1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-09-01 02:34:55 +00:00

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.
This commit is contained in:
Bruno Haible
2019-04-27 16:23:15 +02:00
parent 7f9640b568
commit 7ffb59a713
24 changed files with 53 additions and 67 deletions
+29
View File
@@ -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.
+1 -4
View 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>
@@ -65,10 +66,6 @@
# 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
+1 -4
View File
@@ -20,6 +20,7 @@
/* Specification. */
#include "gl_array_list.h"
#include <stdint.h>
#include <stdlib.h>
/* Get memcpy. */
#include <string.h>
@@ -27,10 +28,6 @@
/* 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. */
+1 -4
View File
@@ -20,15 +20,12 @@
/* 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
+1 -4
View File
@@ -20,15 +20,12 @@
/* 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. */
+1 -5
View File
@@ -20,16 +20,12 @@
/* 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. */
+1 -4
View File
@@ -20,6 +20,7 @@
/* Specification. */
#include "gl_carray_list.h"
#include <stdint.h>
#include <stdlib.h>
/* Get memcpy. */
#include <string.h>
@@ -27,10 +28,6 @@
/* 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. */
+1 -5
View File
@@ -20,15 +20,11 @@
/* 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"
+1 -5
View File
@@ -20,15 +20,11 @@
/* 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"
+1 -5
View File
@@ -20,15 +20,11 @@
/* 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 -------------------------- */
+1 -5
View File
@@ -20,15 +20,11 @@
/* 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"
+1 -5
View File
@@ -20,15 +20,11 @@
/* 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"
+1 -5
View File
@@ -20,16 +20,12 @@
/* 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. */
+1 -4
View File
@@ -20,12 +20,9 @@
/* 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. */
-3
View 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
-3
View 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)
+1
View File
@@ -7,6 +7,7 @@ lib/gl_array_list.c
Depends-on:
list
stdint
xsize
configure.ac:
+1
View File
@@ -7,6 +7,7 @@ lib/gl_array_map.c
Depends-on:
map
stdint
xsize
configure.ac:
+1
View File
@@ -7,6 +7,7 @@ lib/gl_array_set.c
Depends-on:
set
stdint
xsize
configure.ac:
+1
View File
@@ -7,6 +7,7 @@ lib/gl_carray_list.c
Depends-on:
list
stdint
xsize
configure.ac:
+1
View File
@@ -7,6 +7,7 @@ lib/clean-temp.c
Depends-on:
stdbool
stdint
unistd
error
fatal-signal
+1
View File
@@ -5,6 +5,7 @@ tests/test-once.c
Depends-on:
thread
stdint
usleep
yield
+1
View File
@@ -7,6 +7,7 @@ lib/gl_sublist.c
Depends-on:
list
stdint
configure.ac:
+4 -2
View 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++)
{