]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 20 Nov 2000 17:40:29 +0000 (17:40 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 20 Nov 2000 17:40:29 +0000 (17:40 +0000)
2000-11-20  Jakub Jelinek  <jakub@redhat.com>

* iconvdata/bug-iconv2.c (main): Use %zd in format string.
* io/test-lfs.c (do_test): Cast statbuf.st_size to long long.
* malloc/tst-valloc.c (main): Cast valloc return value to long.
* malloc/tst-obstack.c (verbose_malloc): Use %zd in format string.
* math/test-fpucw.c (main): Use %lx in format string, cast
control words to long.
* stdio-common/tst-fmemopen.c (main): Use %td in format strings.
* stdlib/tst-strtol.c (tests): Avoid (bogus?) decimal constant is so
large that it is unsigned warning.

* sysdeps/unix/sysv/linux/sparc/bits/types.h (__ssize_t): Changing
it to long on sparc64.

2000-11-20  Andreas Jaeger  <aj@suse.de>

* nscd/nscd.h (termination_handler): Add noreturn attribute.
(receiv_print_stats): Likewise.

* elf/ldconfig.c (path_hwcap): Cast -1 for proper comparison.

17 files changed:
ChangeLog
elf/ldconfig.c
iconvdata/bug-iconv2.c
io/test-lfs.c
linuxthreads/ChangeLog
linuxthreads/Examples/ex11.c
linuxthreads/Examples/ex14.c
linuxthreads/Examples/ex3.c
linuxthreads/Examples/ex8.c
linuxthreads/ecmutex.c
malloc/tst-obstack.c
malloc/tst-valloc.c
math/test-fpucw.c
nscd/nscd.h
stdio-common/tst-fmemopen.c
stdlib/tst-strtol.c
sysdeps/unix/sysv/linux/sparc/bits/types.h

index b7b9ee3c275fdae508de10b041aa1544879f5f27..476d9f1dd89a99aef3ea416dec943c0b30921438 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2000-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * iconvdata/bug-iconv2.c (main): Use %zd in format string.
+       * io/test-lfs.c (do_test): Cast statbuf.st_size to long long.
+       * malloc/tst-valloc.c (main): Cast valloc return value to long.
+       * malloc/tst-obstack.c (verbose_malloc): Use %zd in format string.
+       * math/test-fpucw.c (main): Use %lx in format string, cast
+       control words to long.
+       * stdio-common/tst-fmemopen.c (main): Use %td in format strings.
+       * stdlib/tst-strtol.c (tests): Avoid (bogus?) decimal constant is so
+       large that it is unsigned warning.
+
+       * sysdeps/unix/sysv/linux/sparc/bits/types.h (__ssize_t): Changing
+       it to long on sparc64.
+
+2000-11-20  Andreas Jaeger  <aj@suse.de>
+
+       * nscd/nscd.h (termination_handler): Add noreturn attribute.
+       (receiv_print_stats): Likewise.
+
+       * elf/ldconfig.c (path_hwcap): Cast -1 for proper comparison.
+
 2000-11-20  Ulrich Drepper  <drepper@redhat.com>
 
        * malloc/thread-m.h: gcc doesn't tolerate zero-sized types anymore.
index 068f43e1b9c4c675312abd74095145604f20a6a1..9ee5a7d4848711fa6164ce7392331c050ab19ef1 100644 (file)
@@ -191,10 +191,12 @@ path_hwcap (const char *path)
 
       h = _dl_string_hwcap (ptr + 1);
 
-      if (h == -1)
-       h = _dl_string_platform (ptr + 1);
-      if (h == -1)
-       break;
+      if (h == (uint64_t) -1)
+       {
+         h = _dl_string_platform (ptr + 1);
+         if (h == (uint64_t) -1)
+           break;
+       }
       hwcap += 1ULL << h;
 
       /* Search the next part of the path.  */
index a2bf44f41987ea49e6dfaffe8eb1ba9262052d1c..4bd45507ab87b1a09767ee18c61c0210637fc5b6 100644 (file)
@@ -38,7 +38,7 @@ main (void)
     exit (1);
 
   puts ("This used to crash");
-  printf ("%d\n", iconv (cd_a, &from, &from_left, &to, &to_left));
+  printf ("%zd\n", iconv (cd_a, &from, &from_left, &to, &to_left));
   iconv_close (cd_a);
 
   puts ("works now");
index f4aa67f96af144493a4179e10fa4ec7659d8e998..b423a10f08864dd0352951c55ff2db7fb8e62fa8 100644 (file)
@@ -122,9 +122,9 @@ do_test (int argc, char *argv[])
     error (0, errno, "stat64 is not supported");
   else if (ret == -1)
     error (EXIT_FAILURE, errno, "cannot stat file `%s'", name);
-  else if (statbuf.st_size != (TWO_GB+100+5))
+  else if (statbuf.st_size != (TWO_GB + 100 + 5))
     error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.",
-          statbuf.st_size, (TWO_GB+100+5));
+          (long long int) statbuf.st_size, (TWO_GB + 100 + 5));
 
   return 0;
 }
index 685f8ef04f27f30b6151694e96c10d006f02ac8f..215ceff586c07a7c692dcb86b622ca7ad794756a 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * Examples/ex3.c (main): Cast int to long before casting to void *.
+       (search): Cast void * to long, not int.
+       * Examples/ex8.c (main, thread): Similarly.
+       * Examples/ex11.c (main): Similarly.
+       * Examples/ex14.c (worker, do_test): Similarly.
+       * ecmutex.c (worker, do_test): Similarly.
+       (nlocks): Cast to int.
+
 2000-11-08  Bruce Mitchener  <bruce@cubik.org>
 
        * linuxthreads.texi:  Add documentation for pthreads attributes
index fb09d64561b6d1de33e5a8474cf71832c8411eae..a01d18db3606179ebec555c2515c0b7f61e39a46 100644 (file)
@@ -128,7 +128,8 @@ main (void)
 
   for (n = 0; n < NWRITERS; ++n)
     {
-      int err = pthread_create (&thwr[n], NULL, writer_thread, (void *) n);
+      int err = pthread_create (&thwr[n], NULL, writer_thread,
+                               (void *) (long int) n);
 
       if (err != 0)
        error (EXIT_FAILURE, err, "cannot create writer thread");
@@ -136,7 +137,8 @@ main (void)
 
   for (n = 0; n < NREADERS; ++n)
     {
-      int err = pthread_create (&thrd[n], NULL, reader_thread, (void *) n);
+      int err = pthread_create (&thrd[n], NULL, reader_thread,
+                               (void *) (long int) n);
 
       if (err != 0)
        error (EXIT_FAILURE, err, "cannot create reader thread");
index 9d2c98734734c301ff20178d5f0c80ce0a052e9f..7788e521b8f1c513a8619b54b330e699431ba69f 100644 (file)
@@ -19,7 +19,7 @@ static void *
 worker (void *arg)
 {
   void *result = NULL;
-  int nr = (int) arg;
+  int nr = (long int) arg;
   int i;
 
   for (i = 0; i < ROUNDS; ++i)
@@ -110,7 +110,7 @@ do_test (void)
 
   /* Start the threads.  */
   for (i = 0; i < NTHREADS; ++i)
-    if (pthread_create (&threads[i], NULL, worker, (void *) i) != 0)
+    if (pthread_create (&threads[i], NULL, worker, (void *) (long int) i) != 0)
       {
        printf ("Failed to start thread %d\n", i);
        exit (1);
index 8005200eff84ab2513f96a064e1dc590c31f7e4d..b80b323a3341091ad978ba125c2b08c2a562e4f1 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char ** argv)
 
   /* Create the searching threads */
   for (started=0; started<NUM_THREADS; started++)
-    pthread_create(&threads[started], NULL, search, (void *)pid);
+    pthread_create(&threads[started], NULL, search, (void *) (long int) pid);
 
   /* Wait for (join) all the searching threads */
   for (i=0; i<NUM_THREADS; i++)
@@ -66,7 +66,7 @@ void print_it(void *arg)
 
 void *search(void *arg)
 {
-  int num = (int) arg;
+  int num = (long int) arg;
   int i, j, ntries;
   pthread_t tid;
 
index 1b9b335579a4b492d069709237758c17079cba6b..1976bfb0a3408f095f5294519e08421998764a41 100644 (file)
@@ -68,7 +68,7 @@ main (void)
 
   pthread_join (th, &res);
 
-  return (int) res;
+  return (int) (long int) res;
 }
 
 
@@ -97,5 +97,5 @@ thread (void *arg)
   if (status == 0)
     status = var != (PREPARE_BIT | PARENT_BIT);
 
-  return (void *) status;
+  return (void *) (long int) status;
 }
index b9d1d54352fbaef108a5a20c7fb1c75ecae780ea..a47bd099c8c47ee5171e79facd7d2b820347e469 100644 (file)
@@ -14,7 +14,7 @@ static pthread_mutex_t locks[] =
   PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
   PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
 };
-#define nlocks (sizeof (locks) / sizeof (locks[0]))
+#define nlocks ((int) (sizeof (locks) / sizeof (locks[0])))
 
 static pthread_barrier_t barrier;
 #define SYNC pthread_barrier_wait (&barrier)
@@ -30,7 +30,7 @@ worker (void *arg)
   /* We are locking the and unlocked the locks and check the errors.
      Since we are using the error-checking variant the implementation
      should report them.  */
-  int nr = (int) arg;
+  int nr = (long int) arg;
   int i;
   void *result = NULL;
   int retval;
@@ -141,7 +141,7 @@ do_test (void)
   pthread_barrier_init (&barrier, NULL, NTHREADS);
 
   for (i = 0; i < NTHREADS; ++i)
-    if (pthread_create (&threads[i], NULL, worker, (void *) i) != 0)
+    if (pthread_create (&threads[i], NULL, worker, (void *) (long int) i) != 0)
       {
        printf ("failed to create thread %d: %m\n", i);
        exit (1);
index cd19431bb908478fd9bb9c23dda1c989fe9c8e50..769697f185baa04e294124c2b0e652e5fc2e4083 100644 (file)
@@ -14,7 +14,7 @@ static void *
 verbose_malloc (size_t size)
 {
   void *buf = malloc (size);
-  printf ("malloc (%u) => %p\n", size, buf);
+  printf ("malloc (%zu) => %p\n", size, buf);
   return buf;
 }
 
index 7958d5182236747bea8aef7ce8a3f9efddac8c46..643a0dda4ac1b7006d881f0aa15381972f32e28c 100644 (file)
@@ -3,19 +3,21 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(void)
+int
+main (void)
 {
   char *p;
   int pagesize = getpagesize ();
   int i;
 
   p = valloc (pagesize);
-  i = (int) p;
+  i = (long int) p;
 
-  if ((i & (pagesize-1)) != 0) {
-    fprintf (stderr, "Alignment problem: valloc returns %p\n", p);
-    exit(1);
-  }
+  if ((i & (pagesize-1)) != 0)
+    {
+      fprintf (stderr, "Alignment problem: valloc returns %p\n", p);
+      exit (1);
+    }
 
   return 0;
 }
index 0294a42bb5e08ab083ba8bcb7b1649ba8eb476dd..d5706f1f664efb6b8cdafec5b229b88684b76de7 100644 (file)
@@ -32,8 +32,8 @@ main (void)
   cw &= ~_FPU_RESERVED;
 
   if (cw != (_FPU_DEFAULT & ~_FPU_RESERVED))
-    printf ("control word is 0x%x but should be 0x%x.\n",
-           cw, (_FPU_DEFAULT & ~_FPU_RESERVED));
+    printf ("control word is 0x%lx but should be 0x%lx.\n",
+           (long int) cw, (long int) (_FPU_DEFAULT & ~_FPU_RESERVED));
 
   return cw != (_FPU_DEFAULT & ~_FPU_RESERVED);
 
index ab93a9ac3e00565b024be192fa49d1d1afa94b2c..b2d438d550f98fc4e1dd486cf33ea04c3e400d3c 100644 (file)
@@ -102,7 +102,7 @@ extern const char *server_user;
 /* Prototypes for global functions.  */
 
 /* nscd.c */
-extern void termination_handler (int signum);
+extern void termination_handler (int signum) __attribute__ ((__noreturn__));
 extern int nscd_open_socket (void);
 
 /* connections.c */
@@ -115,7 +115,7 @@ extern int nscd_parse_file (const char *fname, struct database dbs[lastdb]);
 
 /* nscd_stat.c */
 extern void send_stats (int fd, struct database dbs[lastdb]);
-extern int receive_print_stats (void);
+extern int receive_print_stats (void) __attribute__ ((__noreturn__));
 
 /* cache.c */
 extern struct hashentry *cache_search (int type, void *key, size_t len,
index f22ebd52fe90cef4c933f70fbd8746a3a851ad0b..84ded4f5991312ab20ca0e0e7d531471a7103e31 100644 (file)
@@ -34,7 +34,7 @@ main (void)
       fputc (ch, stdout);
       if (ch != *cp)
        {
-         printf ("\ncharacter %d: '%c' instead of '%c'\n",
+         printf ("\ncharacter %td: '%c' instead of '%c'\n",
                  cp - blah, ch, *cp);
          exit (1);
        }
@@ -79,7 +79,7 @@ main (void)
       fputc (ch, stdout);
       if (ch != *cp)
        {
-         printf ("%d character: '%c' instead of '%c'\n",
+         printf ("%td character: '%c' instead of '%c'\n",
                  cp - blah, ch, *cp);
          exit (1);
        }
index d4ab95e1db7fce17bbd829988163069bd5b55c47..ae8fdd490587cf8c17e5d299b280bd652faa7de4 100644 (file)
@@ -70,8 +70,8 @@ static const struct ltest tests[] =
   {"922337203685477580777", 9223372036854775807, 0, 0, ERANGE},
   {"9223372036854775810", 9223372036854775807, 0, 0, ERANGE},
   {"-2147483648", -2147483648, 0, 0, 0},
-  {"-9223372036854775808", -9223372036854775808, 0, 0, 0},
-  {"-9223372036854775809", -9223372036854775808, 0, 0, ERANGE},
+  {"-9223372036854775808", 0x8000000000000000, 0, 0, 0},
+  {"-9223372036854775809", 0x8000000000000000, 0, 0, ERANGE},
   {"0x112233445566778899z", 9223372036854775807, 16, 'z', ERANGE},
   {"0xFFFFFFFFFFFF00FF" , 9223372036854775807, 0, 0, ERANGE},
 #endif
index 0cfd271e9b957410bfc71f18da610748dbec8126..a7de62eb1552e6dfeb601fafa21d548e1a18c6a9 100644 (file)
@@ -81,7 +81,7 @@ typedef __quad_t  __off64_t;          /*  "" (LFS) */
 typedef __quad_t __loff_t;             /* Type of file sizes and offsets.  */
 typedef int __pid_t;                   /* Type of process identifications.  */
 #if __WORDSIZE == 64
-typedef long long int __ssize_t;       /* Type of a byte count, or error.  */
+typedef long int __ssize_t;            /* Type of a byte count, or error.  */
 #else
 typedef int __ssize_t;                 /* Type of a byte count, or error.  */
 #endif