]> Savannah Git Hosting - gnulib.git/commitdiff
Fix gcc warnings on 64-bit mode mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 14:23:15 +0000 (16:23 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 14:23:15 +0000 (16:23 +0200)
* lib/clean-temp.c: Include <stdint.h> instead of defining uintptr_t.
* lib/gl_array_list.c: Likewise.
* lib/gl_array_map.c: Likewise.
* lib/gl_array_set.c: Likewise.
* lib/gl_carray_list.c: Likewise.
* lib/gl_sublist.c: Likewise.
* lib/gl_avltreehash_list.c (uintptr_t): Remove definition.
* lib/gl_rbtreehash_list.c (uintptr_t): Likewise.
* lib/gl_hash_map.c (uintptr_t): Likewise.
* lib/gl_hash_set.c (uintptr_t): Likewise.
* lib/gl_linkedhash_list.c (uintptr_t): Likewise.
* lib/gl_linkedhash_map.c (uintptr_t): Likewise.
* lib/gl_linkedhash_set.c (uintptr_t): Likewise.
* lib/iconv.c (uintptr_t): Likewise.
* lib/iconv_close.c (uintptr_t): Likewise.
* tests/test-lock.c: Include <stdint.h>.
(once_contender_thread, test_once): Cast through 'intptr_t' instead of
'long'.
* modules/clean-temp (Depends-on): Add stdint.
* modules/array-list (Depends-on): Likewise.
* modules/array-map (Depends-on): Likewise.
* modules/array-set (Depends-on): Likewise.
* modules/carray-list (Depends-on): Likewise.
* modules/sublist (Depends-on): Likewise.
* modules/lock-tests (Depends-on): Likewise.

24 files changed:
ChangeLog
lib/clean-temp.c
lib/gl_array_list.c
lib/gl_array_map.c
lib/gl_array_set.c
lib/gl_avltreehash_list.c
lib/gl_carray_list.c
lib/gl_hash_map.c
lib/gl_hash_set.c
lib/gl_linkedhash_list.c
lib/gl_linkedhash_map.c
lib/gl_linkedhash_set.c
lib/gl_rbtreehash_list.c
lib/gl_sublist.c
lib/iconv.c
lib/iconv_close.c
modules/array-list
modules/array-map
modules/array-set
modules/carray-list
modules/clean-temp
modules/lock-tests
modules/sublist
tests/test-lock.c

index 2af43e824db255e3108db2bce51f07c50cdc91c7..2aeef2e7f31e1141dc6e02dcb10fbf84407b9851 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2019-04-27  Bruno Haible  <bruno@clisp.org>
+
+       Fix gcc warnings on 64-bit mode mingw.
+       * lib/clean-temp.c: Include <stdint.h> instead of defining uintptr_t.
+       * lib/gl_array_list.c: Likewise.
+       * lib/gl_array_map.c: Likewise.
+       * lib/gl_array_set.c: Likewise.
+       * lib/gl_carray_list.c: Likewise.
+       * lib/gl_sublist.c: Likewise.
+       * lib/gl_avltreehash_list.c (uintptr_t): Remove definition.
+       * lib/gl_rbtreehash_list.c (uintptr_t): Likewise.
+       * lib/gl_hash_map.c (uintptr_t): Likewise.
+       * lib/gl_hash_set.c (uintptr_t): Likewise.
+       * lib/gl_linkedhash_list.c (uintptr_t): Likewise.
+       * lib/gl_linkedhash_map.c (uintptr_t): Likewise.
+       * lib/gl_linkedhash_set.c (uintptr_t): Likewise.
+       * lib/iconv.c (uintptr_t): Likewise.
+       * lib/iconv_close.c (uintptr_t): Likewise.
+       * tests/test-lock.c: Include <stdint.h>.
+       (once_contender_thread, test_once): Cast through 'intptr_t' instead of
+       'long'.
+       * modules/clean-temp (Depends-on): Add stdint.
+       * modules/array-list (Depends-on): Likewise.
+       * modules/array-map (Depends-on): Likewise.
+       * modules/array-set (Depends-on): Likewise.
+       * modules/carray-list (Depends-on): Likewise.
+       * modules/sublist (Depends-on): Likewise.
+       * modules/lock-tests (Depends-on): Likewise.
+
 2019-04-27  Bruno Haible  <bruno@clisp.org>
 
        error: Tweak indentation.
index d333f56c090e65e21f817c62bf6bc8528e3c35bd..c3cc7da4d427b09592ac83607f59ddbf4fa21be2 100644 (file)
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 # define PATH_MAX 1024
 #endif
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 
 /* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5))
    ensure that while constructing or modifying the data structures, the field
index 4ac743fde4faf676585bf3b7176784b99ce023cf..fa8cf1eb73d14ae6a157ead183faa07fae261a67 100644 (file)
@@ -20,6 +20,7 @@
 /* Specification.  */
 #include "gl_array_list.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 /* Get memcpy.  */
 #include <string.h>
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* -------------------------- gl_list_t Data Type -------------------------- */
 
 /* Concrete gl_list_impl type, valid for this file only.  */
index 33dc719da09e2c0d1655d3d48d0a24070485d351..9302a00051994ac5b6a702741e1b3f7bcab01bf3 100644 (file)
 /* Specification.  */
 #include "gl_array_map.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_map_t Data Type --------------------------- */
 
 struct pair
index cb595fc22189d52f517bec3afdd4d14692c41304..d88f4952a8041f5ec877030d66218e1eae16958b 100644 (file)
 /* Specification.  */
 #include "gl_array_set.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_set_t Data Type --------------------------- */
 
 /* Concrete gl_set_impl type, valid for this file only.  */
index d72f14936148af0a02986d938cdaab5a5a957286..21876bed9e6780f01abc4f770a827cd44af1dcad 100644 (file)
 /* Specification.  */
 #include "gl_avltreehash_list.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "gl_avltree_oset.h"
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 #define WITH_HASHTABLE 1
 
 /* Which kind of binary trees to use for ordered sets.  Quite arbitrary.  */
index 24aa466936b2479e28cc26e09a7129bdc16cbad2..6a546894276f9fae4550e65c8ebe165a9de988f6 100644 (file)
@@ -20,6 +20,7 @@
 /* Specification.  */
 #include "gl_carray_list.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 /* Get memcpy.  */
 #include <string.h>
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* -------------------------- gl_list_t Data Type -------------------------- */
 
 /* Concrete gl_list_impl type, valid for this file only.  */
index 534b472fa06e034949fa7a2288b957dd5aee7edb..ef3224d67a3fc6ad882ef792158d8bde2c77d683 100644 (file)
 /* Specification.  */
 #include "gl_hash_map.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_map_t Data Type --------------------------- */
 
 #include "gl_anyhash1.h"
index 303d137546787bfec877c529274b961de2be7541..64356e1f864790edb582face3f367f31e6d3c8fc 100644 (file)
 /* Specification.  */
 #include "gl_hash_set.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_set_t Data Type --------------------------- */
 
 #include "gl_anyhash1.h"
index efe4996b2b82a076d739545019f0032e46d677e4..d148d5b5a4e6cbccc12487594308317b14e28a24 100644 (file)
 /* Specification.  */
 #include "gl_linkedhash_list.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 #define WITH_HASHTABLE 1
 
 /* -------------------------- gl_list_t Data Type -------------------------- */
index 9e16971a00d673d2198cfa21f1de206680635e7e..c2697d0ba7dc3d724926981fd1f5913f8370cbc0 100644 (file)
 /* Specification.  */
 #include "gl_linkedhash_map.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_map_t Data Type --------------------------- */
 
 #include "gl_anyhash1.h"
index fb1ca007d18b9b6ae9958245b8221e61fe155a75..55fffc4e4271f18d373c81f3d517c5c0902509a3 100644 (file)
 /* Specification.  */
 #include "gl_linkedhash_set.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* --------------------------- gl_set_t Data Type --------------------------- */
 
 #include "gl_anyhash1.h"
index dc86757a8771282bd659e70bf1cb324d6a6092d3..bc40345b0124d3fe5954b11d2c1e6b991f2bd153 100644 (file)
 /* Specification.  */
 #include "gl_rbtreehash_list.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "gl_rbtree_oset.h"
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 #define WITH_HASHTABLE 1
 
 /* Which kind of binary trees to use for ordered sets.  Quite arbitrary.  */
index 31ffcdc58da1fbf422de9ca1851e64675f81057d..9a1f2665f29ea40e92d555693d6e057aa36d5889 100644 (file)
 /* Specification.  */
 #include "gl_sublist.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* -------------------------- gl_list_t Data Type -------------------------- */
 
 /* Concrete gl_list_impl type, valid for this file only.  */
index ebe56f61a692a817393123f7e7acdea0d0364329..9ac43bf60d5c433d69f3de81fb541ccf88ddb786 100644 (file)
@@ -26,9 +26,6 @@
 # include <stdint.h>
 # include <stdlib.h>
 # include "unistr.h"
-# ifndef uintptr_t
-#  define uintptr_t unsigned long
-# endif
 #endif
 
 #if REPLACE_ICONV_UTF
index 9a6da0185eb56b92ee37013928d4b3bfdfdc0870..cc0e118afce95fbe881e9649a4cdc0a22d13b570 100644 (file)
@@ -20,9 +20,6 @@
 #include <iconv.h>
 
 #include <stdint.h>
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
 
 int
 rpl_iconv_close (iconv_t cd)
index 340bb8f454ce109bf6c079a67276b3789d6356e7..60646714701e3081d6c77ca27110de6347df6810 100644 (file)
@@ -7,6 +7,7 @@ lib/gl_array_list.c
 
 Depends-on:
 list
+stdint
 xsize
 
 configure.ac:
index abdef168692296426dba9f3445087a2c4ca97e07..46ae89aa44df19ba1cc8089cfc393df1bf384b30 100644 (file)
@@ -7,6 +7,7 @@ lib/gl_array_map.c
 
 Depends-on:
 map
+stdint
 xsize
 
 configure.ac:
index bb03425fcdf70d21f6002ecaf8103c6096f7b284..a8eb33f671d2e4c5671cead4fc10590ceefd594f 100644 (file)
@@ -7,6 +7,7 @@ lib/gl_array_set.c
 
 Depends-on:
 set
+stdint
 xsize
 
 configure.ac:
index 4a1f66fd21f4795dadb1d1efb6988ca7cecfa6f9..da14c83550228c728bc0c71f376894f72ac4eaec 100644 (file)
@@ -7,6 +7,7 @@ lib/gl_carray_list.c
 
 Depends-on:
 list
+stdint
 xsize
 
 configure.ac:
index 951e0c5c117f9ea656ad49f15ea14969633c9cc9..d5c44ee29438e44f7eaa1dbe0f6e19d716bc243c 100644 (file)
@@ -7,6 +7,7 @@ lib/clean-temp.c
 
 Depends-on:
 stdbool
+stdint
 unistd
 error
 fatal-signal
index 52858f7b32bf133d123cca4cf7b9c0db6e279715..802471e0f16ac084bad56d4f1dfce9a2d9319ecc 100644 (file)
@@ -5,6 +5,7 @@ tests/test-once.c
 
 Depends-on:
 thread
+stdint
 usleep
 yield
 
index 069144304115333f55d65923c99606eb2c5c31e7..6c856cb18aa299f1ff16763d723e55c091f80641 100644 (file)
@@ -7,6 +7,7 @@ lib/gl_sublist.c
 
 Depends-on:
 list
+stdint
 
 configure.ac:
 
index 081cbf72a4d42a4896ab21e7337d8edd10999f32..1ad0c72dcb6b9aeec270697ab0b054bdc661728a 100644 (file)
@@ -83,6 +83,7 @@
    an "OK" result even without ENABLE_LOCKING (on Linux/x86).  */
 #define REPEAT_COUNT 50000
 
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -587,7 +588,7 @@ once_execute (void)
 static void *
 once_contender_thread (void *arg)
 {
-  int id = (int) (long) arg;
+  int id = (int) (intptr_t) arg;
   int repeat;
 
   for (repeat = 0; repeat <= REPEAT_COUNT; repeat++)
@@ -647,7 +648,8 @@ test_once (void)
 
   /* Spawn the threads.  */
   for (i = 0; i < THREAD_COUNT; i++)
-    threads[i] = gl_thread_create (once_contender_thread, (void *) (long) i);
+    threads[i] =
+      gl_thread_create (once_contender_thread, (void *) (intptr_t) i);
 
   for (repeat = 0; repeat <= REPEAT_COUNT; repeat++)
     {