2026-05-08 Paul Eggert <eggert@cs.ucla.edu>
+ Pacify -Wuseless-cast via compound literals in lib
+ * lib/bitset.c (bitset_print):
+ * lib/bitset/list.c (LBITSET_ELT_BITS, debug_lbitset):
+ * lib/bitset/table.c (TBITSET_ELT_BITS):
+ * lib/bitsetv.c (bitsetv_dump, debug_bitsetv)
+ (bitsetv_matrix_dump):
+ * lib/gettext.h (gettext, ngettext, textdomain, bindtextdomain)
+ (bind_textdomain_codeset):
+ * lib/gl_anyavltree_list2.h (gl_tree_nx_add_first)
+ (gl_tree_nx_add_last, gl_tree_nx_add_before)
+ (gl_tree_nx_add_after):
+ * lib/gl_anylinked_list2.h (gl_linked_nx_create)
+ (gl_linked_node_nx_set_value, gl_linked_nx_set_at)
+ (gl_linked_search_from_to, gl_linked_indexof_from_to)
+ (gl_linked_nx_add_first, gl_linked_nx_add_last)
+ (gl_linked_nx_add_before, gl_linked_nx_add_after)
+ (gl_linked_nx_add_at):
+ * lib/gl_anyrbtree_list2.h (gl_tree_nx_add_first)
+ (gl_tree_nx_add_last, gl_tree_nx_add_before)
+ (gl_tree_nx_add_after):
+ * lib/gl_anytree_list2.h (gl_tree_node_nx_set_value)
+ (gl_tree_nx_set_at):
+ * lib/gl_anytreehash_list1.h (add_nodes_to_buckets):
+ * lib/gl_anytreehash_list2.h (gl_tree_search_from_to):
+ * lib/gl_array_list.c, lib/gl_carray_list.c, lib/gl_sublist.c:
+ (INDEX_TO_NODE):
+ * lib/gl_hash_map.c (gl_hash_search, gl_hash_nx_getput)
+ (gl_hash_getremove):
+ * lib/gl_hash_set.c (gl_hash_search, gl_hash_nx_add)
+ (gl_hash_remove):
+ * lib/gl_linkedhash_map.c (gl_linkedhash_search)
+ (gl_linkedhash_nx_getput, gl_linkedhash_getremove):
+ * lib/gl_linkedhash_set.c (gl_linkedhash_search)
+ (gl_linkedhash_nx_add, gl_linkedhash_remove):
+ * lib/isnand-nolibm.h (isnand):
+ * lib/isnanf-nolibm.h (isnanf):
+ * lib/isnanl-nolibm.h (isnanl):
+ * lib/math.in.h (isnand, _gl_isnand, isnan):
+ * lib/md4.c, lib/sha1.c:
+ (rol):
+ * lib/pagealign_alloc.c (pagealign_alloc, pagealign_free):
+ * lib/ssfmalloc.h (allocate_block_from_pool):
+ * lib/u64.h (u64hilo, u64lo, u64getlo) [INT_MAX < UINT64_MAX]:
+ Use compound literal when it is safer than a cast
+ and it pacifies -Wuseless-cast.
+ * lib/fsusage.c (PROPAGATE_ALL_ONES):
+ * lib/glthread/thread.h (glthread_atfork, glthread_sigmask):
+ Parenthesize more.
+ * lib/gettext.h (dgettext, dcgettext, dngettext, dcngettext)
+ (bindtextdomain, bind_textdomain_codeset):
+ Check types of unused args.
+
fstrcmp: pacify -Wuseless-cast
* lib/fstrcmp.c (fstrcmp_bounded): Omit unnecessary cast
of uintptr_t to uintptr_t.
if (verbose)
fprintf (file, "%s{n_bits = %lu, set = {",
bitset_type_name_get (bset),
- (unsigned long) bitset_size (bset));
+ (unsigned long) {bitset_size (bset)});
unsigned pos = 30;
bitset_bindex i;
pos = 0;
}
- fprintf (file, "%lu ", (unsigned long) i);
+ fprintf (file, "%lu ", (unsigned long) {i});
pos += 1 + (i >= 10) + (i >= 100);
}
/* Number of bits stored in each element. */
#define LBITSET_ELT_BITS \
- ((unsigned) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS))
+ ((unsigned) {LBITSET_ELT_WORDS * LBITSET_WORD_BITS})
/* Lbitset element. We use an array of bits for each element.
These are linked together in a doubly-linked list. */
for (lbitset_elt *elt = LBITSET_HEAD (bset); elt; elt = elt->next)
{
- fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index);
+ fprintf (stderr, "Elt %lu\n", (unsigned long) {elt->index});
for (unsigned i = 0; i < LBITSET_ELT_WORDS; i++)
{
bitset_word word = elt->words[i];
/* Number of bits stored in each element. */
#define TBITSET_ELT_BITS \
- ((unsigned) (TBITSET_ELT_WORDS * BITSET_WORD_BITS))
+ ((unsigned) {TBITSET_ELT_WORDS * BITSET_WORD_BITS})
/* Tbitset element. We use an array of bits. */
typedef struct tbitset_elt_struct
fprintf (file, "%s\n", title);
for (bitset_windex i = 0; bsetv[i]; i++)
{
- fprintf (file, "%s %lu\n", subtitle, (unsigned long) i);
+ fprintf (file, "%s %lu\n", subtitle, (unsigned long) {i});
bitset_dump (file, bsetv[i]);
}
{
for (bitset_windex i = 0; bsetv[i]; i++)
{
- fprintf (stderr, "%lu: ", (unsigned long) i);
+ fprintf (stderr, "%lu: ", (unsigned long) {i});
debug_bitset (bsetv[i]);
}
/* Contents. */
for (bitset_bindex i = 0; bset[i]; ++i)
{
- fprintf (out, "%2lu|", (unsigned long) i);
+ fprintf (out, "%2lu|", (unsigned long) {i});
for (bitset_bindex j = 0; j < hsize; ++j)
fputs (bitset_test (bset[i], j) ? "1" : " ", out);
fputs ("|\n", out);
&& (~ (x) == (sizeof (x) < sizeof (int) \
? - (1 << (sizeof (x) * CHAR_BIT)) \
: 0))) \
- ? UINTMAX_MAX : (uintmax_t) {x})
+ ? UINTMAX_MAX : (uintmax_t) {(x)})
/* Extract the top bit of X as an uintmax_t value. */
#define EXTRACT_TOP_BIT(x) ((x) \
# pragma GCC diagnostic pop
# endif
# else
-/* The casts to 'const char *' serve the purpose of producing warnings
+/* The 'const char *' compound literals produce warnings
for invalid uses of the value returned from these functions. */
# undef gettext
-# define gettext(Msgid) ((const char *) (Msgid))
+# define gettext(Msgid) ((const char *) {(Msgid)})
# undef dgettext
-# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# define dgettext(Domainname, Msgid) \
+ ((void) (const char *) {(Domainname)}, gettext (Msgid))
# undef dcgettext
# define dcgettext(Domainname, Msgid, Category) \
- ((void) (Category), dgettext (Domainname, Msgid))
+ ((void) (const char *) {(Category)}, dgettext (Domainname, Msgid))
# endif
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 \
- ? ((void) (Msgid2), (const char *) (Msgid1)) \
- : ((void) (Msgid1), (const char *) (Msgid2)))
+ ? ((void) (Msgid2), (const char *) {(Msgid1)}) \
+ : ((void) (Msgid1), (const char *) {(Msgid2)}))
# undef dngettext
# define dngettext(Domainname, Msgid1, Msgid2, N) \
- ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+ ((void) (const char *) {(Domainname)}, ngettext (Msgid1, Msgid2, N))
# undef dcngettext
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
- ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+ ((void) (const char *) {(Category)}, \
+ dngettext (Domainname, Msgid1, Msgid2, N))
# undef textdomain
-# define textdomain(Domainname) ((const char *) (Domainname))
+# define textdomain(Domainname) ((const char *) {(Domainname)})
# undef bindtextdomain
# define bindtextdomain(Domainname, Dirname) \
- ((void) (Domainname), (const char *) (Dirname))
+ ((void) (const char *) {(Domainname)}, (const char *) {(Dirname)})
# undef bind_textdomain_codeset
# define bind_textdomain_codeset(Domainname, Codeset) \
- ((void) (Domainname), (const char *) (Codeset))
+ ((void) (const char *) {(Domainname)}, (const char *) {(Codeset)})
#endif
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (node->value)
- : (size_t)(uintptr_t) node->value);
+ : (size_t) {(uintptr_t) node->value});
/* Add node to the hash table. */
if (add_to_bucket (list, node) < 0)
size_t new_hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
if (new_hashcode != node->h.hashcode)
{
size_t new_hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
if (new_hashcode != node->h.hashcode)
{
size_t hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % list->table_size;
gl_listelement_equals_fn equals = list->base.equals_fn;
size_t hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % list->table_size;
gl_listelement_equals_fn equals = list->base.equals_fn;
node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (node->value)
- : (size_t)(uintptr_t) node->value);
+ : (size_t) {(uintptr_t) node->value});
/* Add node to the hash table. */
if (add_to_bucket (list, node) < 0)
node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (node->value)
- : (size_t)(uintptr_t) node->value);
+ : (size_t) {(uintptr_t) node->value});
/* Add node to the hash table. */
if (add_to_bucket (list, node) < 0)
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
/* Add new_node to the hash table. */
if (add_to_bucket (list, new_node) < 0)
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
/* Add new_node to the hash table. */
if (add_to_bucket (list, new_node) < 0)
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
/* Add new_node to the hash table. */
if (add_to_bucket (list, new_node) < 0)
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
new_node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (new_node->value)
- : (size_t)(uintptr_t) new_node->value);
+ : (size_t) {(uintptr_t) new_node->value});
#endif
/* Add it to the tree. */
size_t new_hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
if (new_hashcode != node->h.hashcode)
{
size_t new_hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
if (new_hashcode != node->h.hashcode)
{
node->h.hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (node->value)
- : (size_t)(uintptr_t) node->value);
+ : (size_t) {(uintptr_t) node->value});
if (add_to_bucket (list, node) < 0)
goto fail;
/* Descend on right branch. */
size_t hashcode =
(list->base.hashcode_fn != NULL
? list->base.hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % list->table_size;
gl_listelement_equals_fn equals = list->base.equals_fn;
const void *nodes_elt;
if (gl_oset_search_atleast (nodes,
compare_position_threshold,
- (void *)(uintptr_t)start_index,
+ (void *)(uintptr_t) {start_index},
&nodes_elt))
{
node = (gl_list_node_t) nodes_elt;
/* struct gl_list_node_impl doesn't exist here. The pointers are actually
indices + 1. */
-#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t)(size_t)((index) + 1)
+#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t) {(index) + 1}
#define NODE_TO_INDEX(node) ((uintptr_t)(node) - 1)
static gl_list_t
/* struct gl_list_node_impl doesn't exist here. The pointers are actually
indices + 1. */
-#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t)(size_t)((index) + 1)
+#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t) {(index) + 1}
#define NODE_TO_INDEX(node) ((uintptr_t)(node) - 1)
static gl_list_t
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(map->hashcode_fn != NULL
? map->hashcode_fn (key)
- : (size_t)(uintptr_t) key);
+ : (size_t) {(uintptr_t) key});
size_t bucket = hashcode % map->table_size;
gl_mapkey_equals_fn equals = map->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
size_t hashcode =
(set->hashcode_fn != NULL
? set->hashcode_fn (elt)
- : (size_t)(uintptr_t) elt);
+ : (size_t) {(uintptr_t) elt});
size_t bucket = hashcode % set->table_size;
gl_setelement_equals_fn equals = set->base.equals_fn;
indices + 1. (We don't use the whole list's gl_list_node_t implementation,
because gl_sublist_next_node and gl_sublist_previous_node would not be easy
to implement with this choice.) */
-#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t)(size_t)((index) + 1)
+#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t) {(index) + 1}
#define NODE_TO_INDEX(node) ((uintptr_t)(node) - 1)
static gl_list_t
((void) (struct { void (*prepare_func) (void); \
void (*parent_func) (void); \
void (*child_func) (void); }) \
- { PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC }, \
+ { (PREPARE_FUNC), (PARENT_FUNC), (CHILD_FUNC) }, \
0)
# ifdef __cplusplus
((void) (struct { void (*prepare_func) (void); \
void (*parent_func) (void); \
void (*child_func) (void); }) \
- { PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC }, \
+ { (PREPARE_FUNC), (PARENT_FUNC), (CHILD_FUNC) }, \
0)
# endif
# define glthread_sigmask(HOW, SET, OSET) \
/* unsupported */ \
((void) (struct { int how; sigset_t const *set; sigset_t *oset; }) \
- { HOW, SET, OSET }, \
+ { (HOW), (SET), (OSET) }, \
0)
# define glthread_join(THREAD, RETVALP) \
glwthread_thread_join (THREAD, RETVALP)
((void) (struct { void (*prepare_func) (void); \
void (*parent_func) (void); \
void (*child_func) (void); }) \
- { PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC }, \
+ { (PREPARE_FUNC), (PARENT_FUNC), (CHILD_FUNC) }, \
0)
# ifdef __cplusplus
ENOSYS)
# define glthread_sigmask(HOW, SET, OSET) \
((void) (struct { int how; sigset_t const *set; sigset_t *oset; }) \
- { HOW, SET, OSET }, \
+ { (HOW), (SET), (OSET) }, \
0)
# define glthread_join(THREAD, RETVALP) \
((void) (struct { gl_thread_t thread; void **retvalp; }) \
# define gl_thread_self_pointer() \
((void *) gl_thread_self ())
# define gl_thread_exit(RETVAL) \
- ((void) (int) { RETVAL })
+ ((void) (int) {(RETVAL)})
# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \
((void) (struct { void (*prepare_func) (void); \
void (*parent_func) (void); \
void (*child_func) (void); }) \
- { PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC }, \
+ { (PREPARE_FUNC), (PARENT_FUNC), (CHILD_FUNC) }, \
0)
#endif
# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */
# undef isnand
-# define isnand(x) __builtin_isnan ((double)(x))
+# define isnand(x) __builtin_isnan ((double) {(x)})
# else
# undef isnand
-# define isnand(x) isnan ((double)(x))
+# define isnand(x) isnan ((double) {(x)})
# endif
#else
/* Test whether X is a NaN. */
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */
# undef isnanf
-# define isnanf(x) __builtin_isnan ((float)(x))
+# define isnanf(x) __builtin_isnan ((float) {(x)})
# elif defined isnan
# undef isnanf
-# define isnanf(x) isnan ((float)(x))
+# define isnanf(x) isnan ((float) {(x)})
# endif
#else
/* Test whether X is a NaN. */
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */
# undef isnanl
-# define isnanl(x) __builtin_isnan ((long double)(x))
+# define isnanl(x) __builtin_isnan ((long double) {(x)})
# elif defined isnan
# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
+# define isnanl(x) isnan ((long double) {(x)})
# endif
#else
/* Test whether X is a NaN. */
on the stack. N and S should be nonnegative and free of side effects.
The array must be freed using freea() before the function returns. */
#define nmalloca(n, s) \
- (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) {s}))
+ (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) {(s)}))
#ifdef __cplusplus
# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
/* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */
# undef isnand
-# define isnand(x) __builtin_isnan ((double)(x))
+# define isnand(x) __builtin_isnan ((double) {(x)})
# elif !defined HAVE_ISNAND_NOLIBM
# undef isnand
-# define isnand(x) isnan ((double)(x))
+# define isnand(x) isnan ((double) {(x)})
# endif
# endif
# else
# define _gl_isnanf(x) rpl_isnanf (x)
# endif
# if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
-# define _gl_isnand(x) __builtin_isnan ((double)(x))
+# define _gl_isnand(x) __builtin_isnan ((double) {(x)})
# else
_GL_EXTERN_C int rpl_isnand (double x);
# define _gl_isnand(x) rpl_isnand (x)
# else
# undef isnan
# define isnan(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \
- sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
- __builtin_isnan ((float)(x)))
+ (sizeof (x) == sizeof (long double) \
+ ? __builtin_isnan ((long double) {(x)}) \
+ : sizeof (x) == sizeof (double) \
+ ? __builtin_isnan ((double) {(x)}) \
+ : __builtin_isnan ((float) {(x)}))
# endif
# endif
# if @GNULIB_ISNAN@ && defined __cplusplus
#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n))))
+#define rol(x, n) (((x) << (n)) | ((uint32_t) {(x)} >> (32 - (n))))
#define R1(a,b,c,d,k,s) a=rol(a+F(b,c,d)+x[k],s);
#define R2(a,b,c,d,k,s) a=rol(a+G(b,c,d)+x[k]+K1,s);
#define R3(a,b,c,d,k,s) a=rol(a+H(b,c,d)+x[k]+K2,s);
if (page_info_map == NULL)
page_info_map =
gl_map_create_empty (GL_HASH_MAP, NULL, NULL, NULL, NULL);
- gl_map_put (page_info_map, ret, (void *) (uintptr_t) size);
+ gl_map_put (page_info_map, ret, (void *) (uintptr_t) {size});
break;
#else
errno = ENOSYS;
if (page_info_map == NULL
|| !gl_map_getremove (page_info_map, aligned_ptr, &value))
abort ();
- if (munmap (aligned_ptr, (size_t) (uintptr_t) value) < 0)
+ if (munmap (aligned_ptr, (size_t) {(uintptr_t) value}) < 0)
error (EXIT_FAILURE, errno, "Failed to unmap memory");
}
break;
ctx->total[0] += lolen;
ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
-#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n))))
+#define rol(x, n) (((x) << (n)) | ((uint32_t) {(x)} >> (32 - (n))))
#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
gl_oset_iterator_t iter =
gl_oset_iterator_atleast (pool->managed_pages,
page_free_space_is_at_least,
- (void *) (uintptr_t) size);
+ (void *) (uintptr_t) {size});
const void *elt;
while (gl_oset_iterator_next (&iter, &elt))
{
/* Native implementations are trivial. See below for comments on what
these operations do. */
typedef uint64_t u64;
-# define u64hilo(hi, lo) ((u64) (((u64) (hi) << 32) + (lo)))
+# define u64hilo(hi, lo) ((u64) {((u64) {(hi)} << 32) + (lo)})
# define u64init(hi, lo) u64hilo (hi, lo)
-# define u64lo(x) ((u64) (x))
-# define u64getlo(x) ((uint32_t) ((x) & UINT32_MAX))
+# define u64lo(x) ((u64) {(x)})
+# define u64getlo(x) ((uint32_t) {(x) & UINT32_MAX})
# define u64size(x) u64lo (x)
# define u64not(x) (~(x))
# define u64lt(x, y) ((x) < (y))