From: Bruno Haible Date: Sat, 17 Jan 2026 03:39:12 +0000 (+0100) Subject: Fix some -Wzero-as-null-pointer-constant warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5c190b1fdaeab223e01f2a739fde8e11a3435e9;p=thirdparty%2Fgettext.git Fix some -Wzero-as-null-pointer-constant warnings. * gnulib-local/lib/backupfile.c (max_backup_version, backup_args, get_version): Write NULL instead of 0. * gettext-tools/src/x-go.c (add_to_hash_table): Likewise. --- diff --git a/gettext-tools/src/x-go.c b/gettext-tools/src/x-go.c index b5e6f86e3..0dbd7da4a 100644 --- a/gettext-tools/src/x-go.c +++ b/gettext-tools/src/x-go.c @@ -1,5 +1,5 @@ /* xgettext Go backend. - Copyright (C) 2001-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -393,7 +393,7 @@ struct go_package static void add_to_hash_table (hash_table *htab, const char *name, go_type_t *type) { - if (hash_insert_entry (htab, name, strlen (name), type) == 0) + if (hash_insert_entry (htab, name, strlen (name), type) == NULL) /* We have duplicates! */ abort (); } diff --git a/gnulib-local/lib/backupfile.c b/gnulib-local/lib/backupfile.c index c94fc21b7..d0b0c9381 100644 --- a/gnulib-local/lib/backupfile.c +++ b/gnulib-local/lib/backupfile.c @@ -1,5 +1,5 @@ /* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990-2003, 2005-2006, 2012, 2020, 2025 Free Software Foundation, Inc. + Copyright (C) 1990-2026 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -139,7 +139,7 @@ max_backup_version (const char *file, const char *dir) size_t file_name_length = strlen (file); struct dirent *dp; - while ((dp = readdir (dirp)) != 0) + while ((dp = readdir (dirp)) != NULL) { if (REAL_DIR_ENTRY (dp) && strlen (dp->d_name) >= file_name_length + 4) { @@ -186,7 +186,7 @@ static const char * const backup_args[] = "simple", "never", "existing", "nil", "numbered", "t", - 0 + NULL }; static const enum backup_type backup_types[] = @@ -205,7 +205,7 @@ static const enum backup_type backup_types[] = enum backup_type get_version (const char *context, const char *version) { - if (version == 0 || *version == 0) + if (version == NULL || *version == '\0') return numbered_existing; else return XARGMATCH (context, version, backup_args, backup_types);