mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2026-10-24 00:48:56 +03:00
inttostr-tests: pacify -Wuseless-cast
* tests/test-inttostr.c (CK): Use compound literals, not casts.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2026-05-10 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
inttostr-tests: pacify -Wuseless-cast
|
||||
* tests/test-inttostr.c (CK): Use compound literals, not casts.
|
||||
|
||||
unilbrk/ulc-width-linebreaks: omit no-op casts
|
||||
* lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks_internal):
|
||||
Omit casts from char * to char *.
|
||||
|
||||
@@ -46,16 +46,16 @@
|
||||
*buf = '\0'; \
|
||||
ASSERT \
|
||||
((TYPE_SIGNED (T) \
|
||||
? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MINIMUM (T)) \
|
||||
: snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MINIMUM (T))) \
|
||||
? snprintf (ref, sizeof ref, "%jd", (intmax_t) {TYPE_MINIMUM (T)}) \
|
||||
: snprintf (ref, sizeof ref, "%ju", (uintmax_t) {TYPE_MINIMUM (T)})) \
|
||||
< sizeof ref); \
|
||||
ASSERT (streq ((p = Fn (TYPE_MINIMUM (T), buf)), ref)); \
|
||||
/* Ensure that INT_BUFSIZE_BOUND is tight for signed types. */ \
|
||||
ASSERT (! TYPE_SIGNED (T) || (p == buf && *p == '-')); \
|
||||
ASSERT \
|
||||
((TYPE_SIGNED (T) \
|
||||
? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MAXIMUM (T)) \
|
||||
: snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MAXIMUM (T))) \
|
||||
? snprintf (ref, sizeof ref, "%jd", (intmax_t) {TYPE_MAXIMUM (T)}) \
|
||||
: snprintf (ref, sizeof ref, "%ju", (uintmax_t) {TYPE_MAXIMUM (T)})) \
|
||||
< sizeof ref); \
|
||||
ASSERT (streq ((p = Fn (TYPE_MAXIMUM (T), buf)), ref)); \
|
||||
/* For unsigned types, the bound is not always tight. */ \
|
||||
|
||||
Reference in New Issue
Block a user