1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 07:03:33 +00:00

137 Commits

Author SHA1 Message Date
Collin Funk
a8482ceecf maint: run 'make update-copyright' 2026-01-01 10:37:05 -08:00
Bruno Haible
6edf6dbacf lib: Reduce scope of local variables.
M = Move variable declaration to its initialization.
R = Reduce scope.
S = Split scope, create separate variables from one variable.
B = Insert braces, creating a block scope.
O = Change order of initializations.

* lib/accept4.c (accept4): M.
* lib/acl-internal.c (acl_ace_nontrivial): R.
* lib/acosl.c (acosl): MS.
* lib/af_alg.c (afalg_stream): B.
* lib/alignalloc.h (alignalloc): R.
* lib/alloca.c (find_stack_direction): M.
(alloca): M.
* lib/amemxfrm.c (amemxfrm): MR.
* lib/arcfour.c (arcfour_stream): MB.
(arcfour_setkey): MB.
* lib/arctwo.c (arctwo_encrypt): M.
(arctwo_decrypt): M.
(arctwo_setkey_ekb): M.
* lib/areadlink-with-size.c (areadlink_with_size): MR.
* lib/areadlinkat-with-size.c (areadlinkat_with_size): MR.
* lib/argmatch.c (argmatch): MO.
(main): RBO.
* lib/argp-fmtstream.c (__argp_make_fmtstream): M.
(__argp_fmtstream_update): M.
(__argp_fmtstream_ensure): R.
(__argp_fmtstream_printf): R.
* lib/argp-fmtstream.h (__argp_fmtstream_set_lmargin): M.
(__argp_fmtstream_set_rmargin): M.
(__argp_fmtstream_set_wmargin): M.
* lib/argp-help.c (validate_uparams): M.
(fill_in_uparams): MR.
(make_hol): MRSO.
(hol_entry_short_iterate): R.
(hol_entry_long_iterate): R.
(hol_entry_first_long): Rename 'num' to 'nopts'.
(canon_doc_option): M.
(hol_append): MR.
(argp_hol): O.
(hol_entry_help): RSBO.
(hol_help): RB.
(usage_argful_short_opt): R.
(usage_long_opt): R.
(hol_usage): SB.
(argp_args_levels): R.
(argp_args_usage): MRB.
(argp_doc): RBO.
(_help): MR.
(__argp_error): R.
* lib/argp-parse.c (group_parse): M.
(parser_init): MRB.
(parser_finalize): MS.
(parser_parse_next): R.
(__argp_parse): MR.
(__argp_input): M.
* lib/argz.c (argz_add_sep): M.
(argz_create_sep): M.
(argz_create): R.
(argz_replace): RB.
* lib/asinl.c (asinl): MRS.
* lib/asnprintf.c (asnprintf): M.
* lib/asnwprintf.c (asnwprintf): M.
* lib/asprintf.c (asprintf): M.
* lib/astrxfrm.c (astrxfrm): MR.
* lib/aszprintf.c (aszprintf): M.
* lib/at-func.c (AT_FUNC_NAME): MR.
* lib/at-func2.c (at_func2): MRS.
* lib/atanl.c (atanl): MRS.
* lib/backupfile.c (numbered_backup): R.
* lib/base32.c (decode_8): R.
(base32_decode_ctx): R.
* lib/base64.c (decode_4): R.
(base64_decode_ctx): R.
* lib/basename-lgpl.c (last_component): R.
(base_len): RO.
* lib/bitset.c (bitset_copy_): R.
* lib/bitset/list.c (lbitset_prune): MR.
(lbitset_weed): MR.
(lbitset_list): SB.
* lib/bitset/table.c (tbitset_list): SB.
* lib/boot-time-aux.h (get_windows_boot_time_fallback): R.
* lib/btoc32.c (btoc32): R.
* lib/c-asprintf.c (c_asprintf): M.
* lib/c-aszprintf.c (c_aszprintf): M.
* lib/c-snprintf.c (c_snprintf): M.
* lib/c-snzprintf.c (c_snzprintf): M.
* lib/c-strcasecmp.c (c_strcasecmp): R.
* lib/c-strcasestr.c (c_strcasestr): MRSB.
* lib/c-strncasecmp.c (c_strncasecmp): R.
* lib/c-strtod.c (C_STRTOD): R.
* lib/c-vsnzprintf.c (c_vsnzprintf): M.
* lib/c-xasprintf.c (c_xasprintf): M.
* lib/c32tob.c (c32tob): R.
* lib/canon-host.c (canon_host_r): MR.
* lib/canonicalize.c (canonicalize_filename_mode_stk): R.
* lib/canonicalize-lgpl.c (realpath_stk): R.
* lib/cbrt.c (cbrt): M.
* lib/cbrtf.c (cbrtf): M.
* lib/cbrtl.c (cbrtl): MR.
* lib/chdir-long.c (chdir_long): M.
(main): MR.
* lib/classpath.c (new_classpath): MB.
* lib/clean-temp.c (create_temp_dir): M.
(unregister_temp_file): M.
(unregister_temp_subdir): M.
(cleanup_temp_file): M.
(cleanup_temp_subdir): M.
(cleanup_temp_dir_contents): MSB.
(open_temp): R.
(fopen_temp): R.
(close_temp): RB.
(fclose_variant_temp): RB.
* lib/clean-temp-simple.c (cleanup_action): MSB.
(cleanup_temporary_file): M.
* lib/copy-file.c (copy_file_internal): MRB.
* lib/cosl.c (cosl): MR.
* lib/crc-generate-table.c (make_crc_table): M.
* lib/crc-x86_64-pclmul.c (crc32_update_no_xor_pclmul): MRSB.
* lib/crc.c (crc32_update_no_xor_slice_by_8): S.
(crc32_update_no_xor_slice_by_n): M.
(crc32_update_no_xor): MR.
* lib/csharpcomp.c (compile_csharp_using_mono): MRB.
(compile_csharp_using_dotnet): MRSB.
(compile_csharp_using_sscli): MRB.
* lib/csharpexec.c (execute_csharp_using_mono): MO.
(execute_csharp_using_dotnet): MO.
(execute_csharp_using_sscli): MO.
(execute_csharp_program): R.
* lib/cygpath.c (execute_and_read_line): M.
* lib/des.c (gl_des_is_weak_key): M.
(gl_3des_ecb_crypt): MO.
* lib/dfa.c (closure): B.
(dfamust): MRB.
* lib/di-set.c (map_device): M.
(di_set_insert): M.
(di_set_lookup): M.
* lib/dirname-lgpl.c (dir_len): R.
* lib/dprintf.c (dprintf): M.
* lib/dup.c (dup_nothrow): R.
* lib/dup2.c (ms_windows_dup2): M.
(klibc_dup2dirfd): M.
(klibc_dup2): MR.
(rpl_dup2): M.
* lib/dup3.c (dup3): M.
* lib/duplocale.c (duplocale): MRSB.
* lib/dzprintf.c (dzprintf): M.
* lib/euidaccess.c (euidaccess): MR.
(main): M.
* lib/exclude.c (add_exclude): R.
* lib/execl.c (execl): SB.
* lib/execle.c (execle): SB.
* lib/execlp.c (execlp): SB.
* lib/execute.c (execute): R.
* lib/fchdir.c (ensure_dirs_slot): M.
(get_name): M.
(_gl_register_fd): R.
* lib/fclose.c (rpl_fclose): MR.
* lib/fcntl.c (dupfd): RO.
(fcntl): R.
(klibc_dupdirfd): M.
(klibc_fcntl): MRSB.
* lib/fdopen.c (rpl_fdopen): M.
* lib/file-has-acl.c (get_aclinfo): R.
(fdfile_has_aclinfo): MR.
* lib/file-remote.c (main): M.
* lib/file-set.c (record_file): M.
(seen_file): R.
* lib/findprog.c (find_in_path): MR.
* lib/findprog-in.c (find_in_given_path): MR.
* lib/flock.c (do_lock): MR.
(do_unlock): M.
(flock): MR.
* lib/fma.c (decode): M.
* lib/fopen.c (rpl_fopen): MR.
* lib/forkpty.c (forkpty): M.
* lib/fprintf.c (fprintf): M.
* lib/freadseek.c (freadseek): MR.
* lib/freopen.c (rpl_freopen): M.
* lib/freopen-safer.c (freopen_safer): M.
* lib/frexp.c (FUNC): MR.
* lib/fseterr.c (fseterr): M.
* lib/fstatat.c (rpl_fstatat): M.
* lib/fstrcmp.c (fstrcmp_free_resources): M.
(fstrcmp_bounded): MR.
* lib/fsusage.c (statvfs_works): R.
* lib/fsync.c (fsync): M.
* lib/ftello.c (ftello): M.
* lib/ftruncate.c (SetFileSize): M.
* lib/fts.c (fts_open): MR.
(fts_load): M.
(fts_close): MR.
(filesystem_type): MRO.
(fts_read): MB.
(fts_children): M.
(fts_build): MR.
(fts_cross_check): RO.
(fd_ring_print): RO.
(fts_stat): RO.
(fts_sort): R.
(fts_alloc): M.
(fts_lfree): R.
(fts_palloc): M.
(fts_padjust): MS.
(fts_maxarglen): M.
(fts_safe_changedir): MR.
* lib/fts-cycle.c (enter_dir): MRO.
(leave_dir): M.
* lib/fzprintf.c (fzprintf): M.
* lib/gc-gnulib.c (gc_cipher_open): MR.
(gc_cipher_setkey): MSB.
(gc_cipher_setiv): M.
(gc_cipher_encrypt_inline): M.
(gc_cipher_decrypt_inline): M.
(gc_hash_open): MR.
(gc_hash_clone): M.
* lib/gc-libgcrypt.c (gc_init): Remove local variable 'err'.
(gc_cipher_open): MR.
(gc_cipher_setkey): M.
(gc_cipher_setiv): M.
(gc_hash_open): MR.
(gc_hash_clone): M.
(gc_md4): MR.
(gc_md5): MR.
(gc_sha1): MR.
(gc_sha256): MR.
(gc_sha512): MR.
(gc_sm3): MR.
(gc_hmac_md5): MR. Remove local variable 'err'.
(gc_hmac_sha1): MR. Remove local variable 'err'.
(gc_hmac_sha256): MR. Remove local variable 'err'.
(gc_hmac_sha512): MR. Remove local variable 'err'.
* lib/gc-pbkdf2.c (gc_pbkdf2_prf): MR.
* lib/gen-uni-tables.c (fill_attributes): M.
(debug_output_predicate): M.
(output_predicate_test): M.
(output_predicate): MR.
(output_category): MR.
(output_combclass): MR.
(output_bidi_category): MR.
(output_decimal_digit_test): M.
(output_decimal_digit): MR.
(output_digit_test): M.
(output_digit): MR.
(output_numeric_test): M.
(output_numeric): MR.
(fill_mirror): MR.
(get_mirror_value): M.
(output_mirror): MR.
(fill_properties): MR.
(fill_property30): MR.
(output_indic_conjunct_break_test): M.
(output_indic_conjunct_break): MR.
(fill_arabicshaping): MR.
(output_joining_type_test): M.
(output_joining_type): MR.
(output_joining_group_test): M.
(output_joining_group): MR.
(fill_scripts): MR.
(output_scripts): MR.
(output_scripts_byname): M.
(fill_blocks): MR.
(output_blocks): M.
(output_ident_category): MR.
(output_charclass): MR.
(output_charmap): MR.
(output_tables): M.
(fill_width): MR.
(output_nonspacing_property): MR.
(output_width_property_test): M.
(debug_output_lbrk_tables): M.
(fill_org_lbp): MR.
(debug_output_org_lbrk_tables): M.
(output_lbpea): M.
(output_lbrk_tables): R.
(output_lbrk_rules_as_tables): M.
(debug_output_wbrk_tables): M.
(fill_org_wbp): MR.
(debug_output_org_wbrk_tables): M.
(output_wbp): M.
(output_wbrk_tables): M.
(output_gbp_test): MR.
(output_gbp_table): MR.
(fill_org_gbp): MR.
(get_decomposition): MR.
(output_decomposition): M.
(output_decomposition_tables): R.
(fill_composition_exclusions): MR.
(debug_output_composition_tables): M.
(output_composition_tables): MSB.
(output_simple_mapping_test): M.
(output_simple_mapping): MR.
(fill_casing_rules): MR.
(fill_casefolding_rules): MR.
(output_casing_rules): M.
(output_version): MR.
* lib/get-rusage-as.c (get_rusage_as_via_setrlimit): R.
(get_rusage_as): M.
* lib/get-rusage-data.c (get_rusage_data_via_setrlimit): R.
(get_rusage_data): M.
* lib/get_ppid_of.c (get_ppid_of): M.
* lib/get_progname_of.c (get_progname_of): MR.
* lib/getaddrinfo.c (use_win32_p): M.
(getaddrinfo): MR.
(freeaddrinfo): M.
* lib/getcwd.c (__getcwd_generic): MRSBO.
* lib/getcwd-lgpl.c (rpl_getcwd): MS.
* lib/getdelim.c (getdelim): MR.
* lib/getdomainname.c (getdomainname): M.
* lib/getentropy.c (getentropy): R.
* lib/getgroups.c (rpl_getgroups): MR.
* lib/gethostname.c (rpl_gethostname): M.
* lib/getloadavg.c (getloadavg): MRB.
* lib/getlocalename_l-unsafe.c (newlocale): MR.
(duplocale): MR.
(freelocale): M.
* lib/getlogin_r.c (getlogin_r): M.
* lib/getndelim2.c (getndelim2): MR.
* lib/getopt.c (exchange): MS.
(process_long_option): MRB.
(_getopt_internal_r): MR.
(_getopt_internal): M.
(main): M.
* lib/getopt1.c (main): M.
* lib/getpass.c (getpass): MRB.
* lib/getprogname.c (getprogname): M.
* lib/getrusage.c (getrusage): M.
* lib/getsockopt.c (rpl_getsockopt): M.
* lib/getsubopt.c (getsubopt): M.
* lib/gettext.h (dcpgettext_expr): M.
(dcnpgettext_expr): M.
* lib/gettimeofday.c (gettimeofday): R.
* lib/getugroups.c (getugroups): MR.
* lib/getumask.c (getumask): R.
* lib/gl_anyavltree_list2.h (rebalance): MR.
(gl_tree_remove_node_from_tree): MR.
(gl_tree_nx_add_before): R.
(gl_tree_nx_add_after): R.
* lib/gl_anyhash2.h (hash_resize): M.
* lib/gl_anylinked_list2.h (gl_linked_get_at): R.
(gl_linked_nx_set_at): R.
(gl_linked_search_from_to): R.
(gl_linked_indexof_from_to): MR.
(gl_linked_nx_add_at): M.
(gl_linked_remove_node): M.
(gl_linked_remove_at): MR.
(gl_linked_iterator_from_to): M.
(gl_linked_sortedlist_search_from_to): R.
(gl_linked_sortedlist_indexof_from_to): R.
* lib/gl_anyrbtree_list2.h (rebalance_after_add): MR.
(gl_tree_remove_node_from_tree): M.
* lib/gl_anytree_list2.h (gl_tree_iterator): MB.
(gl_tree_sortedlist_indexof_from_to): R.
* lib/gl_anytree_omap.h (gl_tree_nx_getput): M.
(gl_tree_iterator): MB.
* lib/gl_anytree_oset.h (gl_tree_nx_add): M.
(gl_tree_update): M.
(gl_tree_iterator): MB.
* lib/gl_anytreehash_list1.h (add_to_bucket): M.
* lib/gl_array_list.c (grow): M.
(gl_array_nx_add_first): M.
(gl_array_nx_add_before): M.
(gl_array_nx_add_after): M.
(gl_array_nx_add_at): M.
(gl_array_remove_node): M.
(gl_array_remove_at): M.
* lib/gl_array_map.c (grow): M.
(gl_array_nx_getput): M.
(gl_array_remove_at): M.
* lib/gl_array_omap.c (grow): M.
(gl_array_nx_add_at): M.
(gl_array_remove_at): M.
* lib/gl_array_oset.c (grow): M.
(gl_array_nx_add_at): M.
(gl_array_remove_at): M.
* lib/gl_array_set.c (grow): M.
* lib/gl_avltree_ordered.h (rebalance): M.
(gl_tree_add_node_before): R.
(gl_tree_add_node_after): R.
(gl_tree_remove_node_no_free): M.
* lib/gl_carray_list.c (gl_carray_node_value): M.
(gl_carray_node_nx_set_value): M.
(gl_carray_get_at): M.
(gl_carray_nx_set_at): M.
(gl_carray_indexof_from_to): M.
(grow): M.
(gl_carray_nx_add_last): M.
(gl_carray_nx_add_at): M.
(gl_carray_remove_at): M.
(gl_carray_iterator_from_to): R.
(gl_carray_sortedlist_indexof_from_to): M.
(gl_carray_sortedlist_nx_add): M.
* lib/gl_rbtree_ordered.h (rebalance_after_add): M.
(gl_tree_remove_node_no_free): M.
* lib/gl_sublist.c (gl_sublist_sortedlist_search_from_to): M.
(gl_sublist_sortedlist_indexof_from_to): M.
* lib/glob.c (__glob): MR.
* lib/globfree.c (globfree): M.
* lib/glthread/lock.c (glthread_rwlock_init_for_glibc): M.
(glthread_rwlock_init_multithreaded): M.
(glthread_rwlock_rdlock_multithreaded): M.
(glthread_rwlock_wrlock_multithreaded): M.
(glthread_rwlock_destroy_multithreaded): M.
(glthread_rwlock_init_multithreaded): M.
(glthread_rwlock_rdlock_multithreaded): M.
(glthread_rwlock_wrlock_multithreaded): M.
(glthread_rwlock_unlock_multithreaded): M.
(glthread_rwlock_destroy_multithreaded): M.
(glthread_recursive_lock_init_multithreaded): M.
(glthread_recursive_lock_lock_multithreaded): M.
(glthread_recursive_lock_destroy_multithreaded): M.
(glthread_recursive_lock_init_multithreaded): M.
(glthread_recursive_lock_lock_multithreaded): M.
* lib/glthread/thread.c (gl_thread_create): M.
* lib/group-member.c (group_member): M.
(main): M.
* lib/hash.c (hash_get_next): MB.
(check_tuning): M.
(hash_initialize): M.
(hash_clear): M.
(hash_free): MS.
(transfer_entries): M.
(hash_rehash): MR.
(hash_insert_if_absent): MR.
(hash_remove): MR.
(hash_print): M.
* lib/hasmntopt.c (hasmntopt): M.
* lib/hmac.c (hmac_hash): R.
(GL_HMAC_FN): R.
* lib/human.c (group_number): MRO.
(human_readable): MR.
(humblock): M.
* lib/hypot.c (hypot): M.
* lib/hypotl.c (hypotl): M.
* lib/i-ring.c (i_ring_pop): M.
* lib/iconv_open.c (rpl_iconv_open): R.
* lib/idcache.c (getuidbyname): M.
(getgidbyname): M.
* lib/inet_ntop.c (inet_ntop4): M.
(inet_ntop6): R.
* lib/inet_pton.c (inet_pton4): MRBO.
(inet_pton6): MRBO.
* lib/ino-map.c (ino_map_insert): M.
* lib/integer_length.c (integer_length): M.
* lib/ioctl.c (rpl_ioctl): M.
(ioctl): M.
* lib/is_l-impl.h (FUNC): M.
* lib/isatty.c (IsCygwinConsoleHandle): R.
* lib/isnan.c (FUNC): MR.
* lib/javacomp.c (compile_using_envjavac): MRB.
(compile_using_javac): MB.
(execute_and_read_line): M.
(write_temp_file): M.
(get_classfile_version): MR.
(is_envjavac_usable): MR.
(is_javac_present): M.
(is_javac_usable): MR.
(compile_java_class): MR.
* lib/javaexec.c (execute_java_class): MRBO.
* lib/javaversion.c (execute_and_read_line): M.
(javaexec_version): R.
* lib/kwset.c (treefails): M.
(kwsprep): MRSB.
(bmexec_trans): MRSO.
(acexec_trans): MRS.
* lib/lchown.c (rpl_lchown): R.
* lib/linebuffer.c (readlinebuffer_delim): RO.
* lib/link.c (link): MRBO.
(rpl_link): M.
* lib/linkat.c (link_immediate): R.
(link_follow): M.
(linkat_follow): M.
* lib/localcharset.c (locale_charset): MR.
* lib/localeinfo.c (is_using_utf8): R. Rename 'mbs' to 'state'.
(init_localeinfo): Rename 's' to 'state'.
* lib/localename.c (gl_locale_name): MSB.
* lib/localename-environ.c (gl_locale_name_environ): MSB.
* lib/localename-unsafe.c (gl_locale_name_canonicalize): MSB.
(gl_locale_name_from_win32_LANGID): M.
(gl_locale_name_from_win32_LCID): M.
(enum_locales_fn): R.
(gl_locale_name_unsafe): MSB.
* lib/log2.c (log2): M.
* lib/log2f.c (log2f): M.
* lib/log2l.c (log2l): M.
* lib/login_tty.c (login_tty): M.
* lib/logl.c (logl): MR.
* lib/long-options.c (parse_long_options): MR.
(parse_gnu_standard_options_only): M.
* lib/mbfile.h (mbfile_multi_getc): MR.
* lib/mbmemcasecoll.c (apply_c32tolower): M.
(mbmemcasecoll): MR.
* lib/mbrtoc32.c (mbrtoc32): R.
* lib/mbrtowc.c (rpl_mbrtowc): MRS.
* lib/mbrtowc-impl.h: MRB.
* lib/mbscasestr.c (knuth_morris_pratt_multibyte): MR.
(mbscasestr): R.
* lib/mbscspn.c (mbscspn): MR.
* lib/mbsnrtowcs-impl.h (FUNC): M.
* lib/mbspbrk.c (mbspbrk): MR.
* lib/mbsrtowcs-impl.h (FUNC): M.
* lib/mbsspn.c (mbsspn): MR.
* lib/mbsstr.c (knuth_morris_pratt_multibyte): MR.
(mbsstr): MR.
* lib/mbswidth.c (mbsnwidth): M.
* lib/mbtowc-impl.h (mbtowc): MR.
* lib/mbtowc-lock.h (mbtowc_with_lock): M.
* lib/mcel.h: MR in comments.
* lib/md2.c (md2_finish_ctx): M.
(md2_process_bytes): M.
(md2_update_chksum): M.
(md2_compress): M.
* lib/md2-stream.c (md2_stream): MR.
* lib/md4.c (md4_finish_ctx): M.
(md4_process_block): MR.
* lib/md4-stream.c (md4_stream): MR.
* lib/md5-stream.c (md5_stream): MR.
* lib/mem-hash-map.c (compute_hashval): M.
(lookup): M.
* lib/memchr.c (__memchr): MRB.
* lib/memchr2.c (memchr2): MRB.
* lib/memrchr.c (__memrchr): MRB.
* lib/mgetgroups.c (mgetgroups): MRS.
* lib/mkancesdirs.c (mkancesdirs): M.
* lib/mkdir.c (rpl_mkdir): MR.
* lib/mkdir-p.c (make_dir_parents): R.
* lib/modechange.c (mode_compile): R.
* lib/mountlist.c (fstype_to_string): M.
(dev_from_mount_options): MR.
(read_file_system_list): MR.
* lib/mpsort.c (mpsort_into_tmp): M.
(mpsort_with_tmp): M.
* lib/msvc-inval.h (TRY_MSVC_INVAL): M.
* lib/mtx.c (mtx_init): MSB.
* lib/nanosleep.c (nanosleep): M.
* lib/nl_langinfo.c (ctype_codeset): MR.
(nl_langinfo_with_lock): M.
* lib/nonblocking.c (get_nonblocking_flag): M.
(set_nonblocking_flag): M.
* lib/nproc.c (num_processors_via_affinity_mask): M.
(cgroup2_mount): MR.
(get_cgroup2_cpu_quota): M.
(parse_omp_threads): Remove variable 'ret'.
(num_processors): M.
* lib/obstack.c (_obstack_newchunk): M.
(_obstack_allocated_p): M.
(__obstack_free): M.
* lib/obstack_printf.c (OBSTACK_PRINTF): M.
(OBSTACK_VPRINTF): M.
* lib/omp-init.c (parse_omp_threads): Remove variable 'ret'.
* lib/openat-proc.c (openat_proc_name): R.
* lib/openat2.c (do_openat2): R.
(openat2): MSB.
* lib/opendir.c (opendir): MR.
* lib/openpty.c (openpty): M.
* lib/os2-spawn.c (prepare_spawn): M.
(spawnpvech): R.
* lib/pagealign_alloc.c (pagealign_alloc): MR.
(pagealign_xalloc): M.
(pagealign_free): M.
* lib/parse-duration.c (parse_scaled_value): M.
(parse_year_month_day): M.
(parse_yearmonthday): MR.
(parse_YMWD): SB.
(parse_hour_minute_second): M.
(parse_hourminutesecond): MR.
(parse_HMS): SB.
(parse_time): M.
(parse_period): MR.
(parse_non_iso8601): M.
* lib/passfd.c (sendfd): MRO.
(recvfd): MRO.
* lib/perror.c (perror): M.
* lib/physmem.c (physmem_total): M.
(physmem_claimable): M.
* lib/pipe-filter-gi.c (filter_loop): MRB.
(pipe_filter_gi_create): M.
(pipe_filter_gi_close): M.
* lib/pipe-filter-ii.c (_beginthreadex): M.
(WaitForMultipleObjects): MR.
(pipe_filter_ii_execute): MRB.
* lib/poll.c (IsSocketHandle): R.
(windows_compute_revents): MRB.
(windows_compute_revents_socket): M.
(poll): MRB. Remove variable 'bRet'.
* lib/popen.c (rpl_popen): MB.
* lib/posix_openpt.c (posix_openpt): M.
* lib/posixtm.c (posix_time_parse): R.
(posixtime): R.
* lib/pread.c (pread): M.
* lib/printf.c (printf): M.
* lib/printf-frexp.c (FUNC): R.
* lib/printf-parse.c (PRINTF_PARSE): MR.
* lib/progreloc.c (maybe_executable): R.
(find_executable): MRSB.
(prepare_relocate): M.
* lib/propername.c (mbsstr_trimmed_wordbounded): RSB.
(proper_name_utf8): M.
* lib/pselect.c (pselect): MR.
* lib/pt_chown.c (do_pt_chown): MR.
* lib/pthread-cond.c (pthread_cond_timedwait): R.
* lib/pthread-rwlock.c (pthread_rwlockattr_init): MSB.
(pthread_rwlock_init): MSB.
(pthread_rwlock_rdlock): MSB.
(pthread_rwlock_wrlock): MSB.
(pthread_rwlock_tryrdlock): MB.
(pthread_rwlock_trywrlock): MB.
(pthread_rwlock_timedrdlock): MSB.
(pthread_rwlock_timedwrlock): MSB.
(pthread_rwlock_unlock): MSB.
(pthread_rwlock_destroy): MSB.
(pthread_rwlock_init): MSB.
(pthread_rwlock_timedrdlock): MRB.
(pthread_rwlock_timedwrlock): MRB.
* lib/pthread_mutex_timedlock.c (pthread_mutex_timedlock): MRB.
* lib/pthread_sigmask.c (pthread_sigmask): MR.
* lib/ptsname_r.c (ptsname_r): MR.
* lib/putenv.c (putenv): M.
* lib/pwrite.c (pwrite): M.
* lib/qcopy-acl.c (qcopy_acl): Remove a use of variable 'ret'.
* lib/qset-acl.c (qset_acl): M.
* lib/qsort.c (_quicksort): MR.
* lib/quotearg.c (set_quoting_flags): M.
(quotearg_buffer_restyled): MRSB.
* lib/random.c (__initstate): M.
(__setstate): M.
(__random): R.
* lib/random_r.c (__srandom_r): M.
(__setstate_r): MO.
(__random_r): M.
* lib/rawmemchr.c (rawmemchr): RB.
* lib/read-file.c (fread_file): M.
(read_file): M.
* lib/readdir.c (readdir): MR.
* lib/readline.c (readline): R.
* lib/readtokens.c (readtoken): R.
(readtokens): M.
* lib/regex-quote.c (regex_quote_spec_gnu): MB.
(regex_quote_spec_pcre): MB.
(regex_quote_length): MR.
(regex_quote): MB.
* lib/relocatable.c (set_this_relocation_prefix): M.
(compute_curr_prefix): MR.
(find_shared_library_fullname): MRS.
(relocate): M.
* lib/relocwrapper.c (activate_libdirs): MB.
(main): M.
* lib/rename.c (rpl_rename): MRBO.
* lib/renameatu.c (renameatu): MRB.
* lib/rijndael-alg-fst.c (rijndaelKeySetupEnc): MSB.
(rijndaelKeySetupDec): MRSB.
(rijndaelEncrypt): MSB.
(rijndaelDecrypt): MSB.
* lib/rijndael-api-fst.c (rijndaelMakeKey): MRSB.
(rijndaelCipherInit): MSB.
(rijndaelBlockEncrypt): MRSB.
(rijndaelPadEncrypt): MRSB.
(rijndaelBlockDecrypt): MRSB.
(rijndaelPadDecrypt): MRSB.
* lib/rmdir.c (rpl_rmdir): M.
* lib/rpmatch.c (localized_pattern): MS.
(try): M.
(rpmatch): MSB.
* lib/same.c (same_nameat): R. Remove variable 'flags'.
* lib/savedir.c (streamsavedir): MRB.
* lib/scandir.c (SCANDIR): MR.
* lib/select.c (IsSocketHandle): R.
(windows_poll_handle): MRSB. Remove variable 'bRet'.
(rpl_select): MR. Remove variable 'bRet'.
* lib/set-permissions.c (set_acls_from_mode): R.
(context_acl_from_mode): R.
(context_aclv_from_mode): M.
(set_acls_from_mode): MR.
(context_acl_from_mode): M.
(set_acls): R.
(set_permissions): MS.
* lib/setenv.c (__add_to_environ): M.
(rpl_setenv): M.
* lib/sethostname.c (sethostname): MR.
* lib/setlocale.c (setlocale_unixlike): MR.
(langcmp): R.
(setlocale_improved): MR.
* lib/setlocale_null.c (setlocale_null_r_with_lock): M.
(setlocale_null): M.
* lib/setsockopt.c (rpl_setsockopt): R.
* lib/sh-quote.c (shell_quote_argv): MB.
* lib/sha1.c (sha1_process_block): R.
* lib/sha1-stream.c (sha1_stream): M.
* lib/sha256.c (sha256_process_block): MR.
* lib/sha256-stream.c (shaxxx_stream): M.
* lib/sha3.c (sha3_read_ctx): R.
(sha3_process_block): R.
* lib/sha3-stream.c (sha3_xxx_stream): M.
* lib/sha512-stream.c (shaxxx_stream): M.
* lib/sig2str.c (str2signum): RS.
(sig2str): MR.
* lib/sigaction.c (sigaction_handler): MR.
(sigaction): MRB.
* lib/sigprocmask.c (sigprocmask): M.
* lib/sigsegv.c (sigsegv_handler): MR.
* lib/sincosl.c (kernel_sinl): MRS.
(kernel_cosl): MRS.
* lib/sinl.c (sinl): MR.
* lib/sleep.c (rpl_sleep): M.
* lib/sm3.c (sm3_process_block): MR.
* lib/sm3-stream.c (sm3_stream): MR.
* lib/snprintf.c (snprintf): M.
* lib/snzprintf.c (snzprintf): M.
* lib/socket.c (rpl_socket): M.
* lib/sockets.c (close_fd_maybe_socket): MR.
(ioctl_fd_maybe_socket): MR.
(gl_sockets_startup): M.
(gl_sockets_cleanup): M.
* lib/spawn-pipe.c (create_pipe): MR.
* lib/spawni.c (__spawni): Split variable declaration.
* lib/sprintf.c (sprintf): M.
* lib/sqrtl.c (sqrtl): MR.
* lib/ssfmalloc.h (allocate_block_from_pool): MSB.
* lib/stackvma.c (rof_open): M.
(vma_iterate_proc): RSB.
(vma_iterate_bsd): MB.
(mapped_range_start): M.
(mapped_range_end): M.
(is_unmapped): MR.
(mapped_range_start): M.
(mapped_range_end): M.
(vma_iterate): MR.
* lib/stat-w32.c (_gl_convert_FILETIME_to_timespec): R.
* lib/stdio-consolesafe.c (gl_consolesafe_fprintf): R.
(gl_consolesafe_printf): R.
* lib/stdio-read.c (CALL_WITH_ERRNO_FIX): M.
(scanf): M.
(fscanf): M.
* lib/stdio-write.c (CALL_WITH_SIGPIPE_EMULATION): M.
(printf): M.
(fprintf): M.
* lib/stpncpy.c (__stpncpy): MSB.
* lib/str-kmp.h (knuth_morris_pratt): M.
* lib/str-two-way.h (critical_factorization): MSB.
(two_way_short_needle): MS.
(two_way_long_needle): MRS.
* lib/strcasecmp.c (strcasecmp): R.
* lib/strcasecmp_l.c (strcasecmp_l): MR.
* lib/strcasestr.c (strcasestr): MRSB.
* lib/strchrnul.c (strchrnul): MRB.
* lib/strerror.c (strerror): M.
* lib/strerror_l.c (strerror_l_r): R.
* lib/strerror_r.c (local_snprintf): M.
(strerror_r): M.
* lib/strfmon_l.c (rpl_strfmon_l): MR.
* lib/strftime.c (__strftime_internal): MR.
* lib/striconv.c (mem_cd_iconv): MR.
(str_cd_iconv): MR.
(str_iconv): M.
* lib/striconveh.c (iconveh_open): MR.
(utf8conv_carefully): M.
(mem_cd_iconveh_internal): MR.
(mem_iconveh): M.
(str_iconveh): M.
* lib/striconveha.c (uniconv_register_autodetect): MRSB.
(mem_iconveha_notranslit): MS.
(mem_iconveha): M.
(str_iconveha_notranslit): MS.
(str_iconveha): M.
* lib/string-buffer-printf.c (sb_appendvf): R.
(sb_appendf): R.
* lib/string-buffer-reversed-printf.c (sbr_prependvf): R.
(sbr_prependf): R.
* lib/string-desc.c (sd_new): R.
* lib/stripslash.c (strip_trailing_slashes): M.
* lib/strncasecmp.c (strncasecmp): R.
* lib/strncasecmp_l.c (strncasecmp_l): MR.
* lib/strptime.c (__strptime_internal): RSB.
* lib/strsep.c (strsep): R.
* lib/strsignal.c (strsignal): R.
* lib/strstr.c (strstr): MRSB.
* lib/strtod.c (parse_number): MR.
(STRTOD): MR.
* lib/strtok_r.c (__strtok_r): M.
* lib/strtol.c (strtol): MR.
* lib/struniq.h (struniq): M.
* lib/supersede.c (open_supersede): R.
* lib/system-quote.c (system_quote_argv): MB.
* lib/szprintf.c (szprintf): M.
* lib/tanl.c (kernel_tanl): MRS.
(tanl): MR.
* lib/tempname.c (try_tempname_len): M.
* lib/term-style-control.c (sprintf_integer): MR.
* lib/textstyle.in.h (ostream_printf): MR.
* lib/time.c (time): M.
* lib/times.c (filetime2clock): M.
* lib/timespec-add.c (timespec_add): R.
* lib/timespec-sub.c (timespec_sub): R.
* lib/tmpdir.c (path_search): MR.
* lib/tmpfile.c (tmpfile): M.
* lib/to_l-impl.h (FUNC): M.
* lib/tparm.c (tparm): MRB.
* lib/trigl.c (ieee754_rem_pio2l): MRS.
(kernel_rem_pio2): MRS.
* lib/trim.c (trim2): MR.
* lib/tsearch.c (check_tree): R.
(maybe_split_for_insert): M.
(__tsearch): MR.
(__tfind): M.
(__tdelete): MRB.
* lib/ttyname_r.c (ttyname_r): M.
* lib/uname.c (uname): MR.
* lib/unicase/locale-language.c (uc_locale_language): M.
* lib/unicase/u-casecmp.h (FUNC): MR.
* lib/unicase/u-casecoll.h (FUNC): MR.
* lib/unicase/u-casemap.h (FUNC): MR.
* lib/unicase/u-casexfrm.h (FUNC): MR.
* lib/unicase/u-ct-casefold.h (FUNC): MR.
* lib/unicase/u-ct-totitle.h (FUNC): MR.
* lib/unicase/u-is-cased.h (FUNC): MR.
* lib/unicase/u-is-invariant.h (FUNC): MR.
* lib/unicase/u8-casefold.c (read_file): M.
* lib/unicase/u8-tolower.c (read_file): M.
* lib/unicase/u8-totitle.c (read_file): M.
* lib/unicase/u8-toupper.c (read_file): M.
* lib/unicase/ulc-casecmp.c (ulc_u8_casefold): MR.
* lib/unicase/ulc-casexfrm.c (ulc_casexfrm): MR.
* lib/unicodeio.c (unicode_to_mb): MR.
* lib/uniconv/u-conv-from-enc.h (FUNC): M.
* lib/uniconv/u-conv-to-enc.h (FUNC): MR.
* lib/uniconv/u-strconv-from-enc.h (FUNC): M.
* lib/uniconv/u-strconv-to-enc.h (FUNC): M.
* lib/uniconv/u16-conv-to-enc.c (FUNC): MR.
* lib/uniconv/u8-conv-from-enc.c (u8_conv_from_encoding): R.
* lib/uniconv/u8-conv-to-enc.c (u8_conv_to_encoding): R.
* lib/uniconv/u8-strconv-to-enc.c (u8_strconv_to_encoding): MS.
* lib/unictype/3level.h (CONCAT(TABLE,_add)): M.
(CONCAT(TABLE,_finalize)): MRB.
* lib/unictype/3levelbit.h (CONCAT(TABLE,_add)): M.
(CONCAT(TABLE,_finalize)): MRB.
* lib/unictype/bidi_byname.c (uc_bidi_class_byname): M.
* lib/unictype/categ_and.c (uc_general_category_and): MR.
* lib/unictype/categ_and_not.c (uc_general_category_and_not): MR.
* lib/unictype/categ_byname.c (uc_general_category_byname): M.
* lib/unictype/categ_of.c (uc_general_category): R.
* lib/unictype/categ_or.c (uc_general_category_or): MR.
* lib/unictype/combiningclass_byname.c (uc_combining_class_byname): M.
* lib/unictype/incb_byname.c (uc_indic_conjunct_break_byname): M.
* lib/unictype/joininggroup_byname.c (uc_joining_group_byname): M.
* lib/unictype/joiningtype_byname.c (uc_joining_type_byname): M.
* lib/unictype/pr_byname.c (uc_property_byname): MRB.
* lib/unictype/scripts.c (uc_script_byname): M.
* lib/unigbrk/u-grapheme-prev.h
(ends_with_incb_consonant_extended_linker_extended): M.
(ends_with_emoji_modifier_sequence): M.
(ends_with_ri_count): M.
(FUNC): M.
* lib/unigbrk/uc-is-grapheme-break.c (uc_is_grapheme_break): M.
* lib/unigbrk/ulc-grapheme-breaks.c (ulc_grapheme_breaks): M.
* lib/unilbrk/u16-width-linebreaks.c (u16_width_linebreaks_internal): M.
* lib/unilbrk/u32-width-linebreaks.c (u32_width_linebreaks_internal): M.
* lib/unilbrk/u8-possible-linebreaks.c (read_file): M.
* lib/unilbrk/u8-width-linebreaks.c (u8_width_linebreaks_internal): M.
(read_file): M.
* lib/unilbrk/ulc-possible-linebreaks.c
(ulc_possible_linebreaks_internal): M.
(read_file): M.
* lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks_internal): M.
(read_file): M.
* lib/uniname/uniname.c (unicode_name_word): MR.
(unicode_character_name): M.
(unicode_name_character): MR.
* lib/uninorm/canonical-decomposition.c (uc_canonical_decomposition): M.
* lib/uninorm/composition.c (uc_composition): M.
* lib/uninorm/decomposition.c (uc_decomposition): M.
* lib/uninorm/u-normalize-internal.h (FUNC): MR.
* lib/uninorm/u-normcmp.h (FUNC): MR.
* lib/uninorm/u-normcoll.h (FUNC): MR.
* lib/uninorm/u-normxfrm.h (FUNC): MR.
* lib/uninorm/uninorm-filter.c (uninorm_filter_write): M.
* lib/unistdio/u-asnprintf.h (ASNPRINTF): M.
* lib/unistdio/u-asprintf.h (ASPRINTF): M.
* lib/unistdio/u-snprintf.h (SNPRINTF): M.
* lib/unistdio/u-sprintf.h (SPRINTF): M.
* lib/unistdio/u-vsnprintf.h (VSNPRINTF): M.
* lib/unistdio/u-vsprintf.h (VSPRINTF): M.
* lib/unistdio/ulc-fprintf.c (ulc_fprintf): M.
* lib/unistdio/ulc-vfprintf.c (ulc_vfprintf): M.
* lib/unistr/u16-chr.c (u16_chr): R.
* lib/unistr/u16-mbsnlen.c (u16_mbsnlen): M.
* lib/unistr/u16-next.c (u16_next): M.
* lib/unistr/u16-strchr.c (u16_strchr): R.
* lib/unistr/u16-strrchr.c (u16_strrchr): R.
* lib/unistr/u16-to-u32.c (FUNC): MR.
* lib/unistr/u16-to-u8.c (FUNC): MR.
* lib/unistr/u32-next.c (u32_next): M.
* lib/unistr/u32-to-u16.c (FUNC): MR.
* lib/unistr/u32-to-u8.c (FUNC): MR.
* lib/unistr/u8-chr.c (u8_chr): M.
* lib/unistr/u8-mbsnlen.c (u8_mbsnlen): M.
* lib/unistr/u8-next.c (u8_next): M.
* lib/unistr/u8-strchr.c (u8_strchr): R.
* lib/unistr/u8-strrchr.c (u8_strrchr): R.
* lib/unistr/u8-to-u16.c (FUNC): MR.
* lib/unistr/u8-to-u32.c (FUNC): MR.
* lib/uniwbrk/u8-wordbreaks.c (read_file): M.
* lib/uniwbrk/ulc-wordbreaks.c (ulc_wordbreaks): M.
(read_file): M.
* lib/uniwidth/u16-width.c (u16_width): M.
* lib/uniwidth/u32-width.c (u32_width): M.
* lib/uniwidth/u8-width.c (u8_width): M.
* lib/unlinkat.c (rpl_unlinkat): MR.
* lib/unsetenv.c (unsetenv): M.
(rpl_unsetenv): R.
* lib/userspec.c (parse_with_separator): MRS.
(main): MR.
* lib/utime.c (_gl_utimens_windows): M.
* lib/utimecmp.c (utimecmpat): R.
* lib/utimens.c (validate_timespec): R.
(fdutimens): MR.
(lutimens): MR.
* lib/utimensat.c (rpl_utimensat): M.
* lib/vasnprintf.c (divide): M.
(decode_long_double): MR.
(decode_double): MR.
(scale10_round_decimal_decoded): MR.
(floorlog10l): MR.
(floorlog10): MR.
(VASNPRINTF): MR.
* lib/vc-mtime.c (is_git_present): MR.
(git_vc_controlled): MR.
(git_unmodified): M.
(git_mtime): MR.
(abs_git_checkout): MR.
(max_vc_mtime): MR.
* lib/vdzprintf.c (vdzprintf): M.
* lib/vfzprintf.c (vfzprintf): M.
* lib/vma-iter.c (rof_open): M.
(vma_iterate_proc): MRSB.
(vma_iterate_bsd): MB.
(vma_iterate): MR.
* lib/vsnzprintf.c (vsnzprintf): M.
* lib/vszprintf.c (vszprintf): M.
* lib/wait-process.c (klibc_waitpid): M.
(wait_subprocess): MR.
* lib/wcs-two-way.h (critical_factorization): MSB.
(two_way_short_needle): MS.
* lib/wcsstr-impl.h (FUNC): MRSB.
* lib/wcswidth-impl.h (FUNC): B.
* lib/wcsxfrm-impl.h (wcsxfrm): MR.
* lib/wctomb-impl.h (wctomb): M.
* lib/wgetcwd-lgpl.c (wgetcwd): MRS.
* lib/windows-cond.c (glwthread_waitqueue_add): M.
(glwthread_waitqueue_notify_first): M.
(glwthread_waitqueue_notify_all): M.
(glwthread_cond_wait): M.
(glwthread_cond_timedwait): MRS.
* lib/windows-cygpath.c (execute_and_read_line): MR.
* lib/windows-rwlock.c (glwthread_waitqueue_add): M.
(glwthread_rwlock_rdlock): M.
(glwthread_rwlock_wrlock): M.
* lib/windows-spawn.c (quoted_arg_length): M.
(quoted_arg_string): M.
(prepare_spawn): MR.
(compose_command): MRB.
(compose_envblock): RSB.
* lib/windows-thread.c (glwthread_thread_self): M.
(glwthread_thread_create): M.
* lib/windows-timedmutex.c (glwthread_timedmutex_timedlock): MR.
* lib/windows-timedrecmutex.c (glwthread_timedrecmutex_timedlock): MR.
* lib/windows-timedrwlock.c (glwthread_waitqueue_add): M.
(glwthread_waitqueue_notify_first): M.
(glwthread_waitqueue_notify_all): M.
(glwthread_timedrwlock_rdlock): M.
(glwthread_timedrwlock_wrlock): M.
(glwthread_timedrwlock_timedrdlock): MR.
(glwthread_timedrwlock_timedwrlock): MR.
* lib/xasprintf.c (xasprintf): M.
* lib/xconcat-filename.c (xconcatenated_filename): M.
* lib/xmalloc.c (xpalloc): R.
* lib/xmalloca.c (xmmalloca): M.
* lib/xprintf.c (xprintf): M.
(xfprintf): M.
* lib/xstring-buffer-printf.c (sb_xappendf): M.
* lib/xstring-buffer-reversed-printf.c (sbr_xprependf): M.
* lib/xstrtod.c (XSTRTOD): MR.
* lib/xstrtol.c (__xstrtol): R.
* lib/xstrtol-error.c (xstrtol_error): R.
* lib/xvasprintf.c (xstrcat): MB.
(xvasprintf): R.
* lib/zprintf.c (zprintf): M.
2025-12-10 00:23:48 +01:00
Bruno Haible
c96880f4d8 Rename some local variables.
* lib/backupfile.c (backupfile_internal): Rename e to saved_errno.
* lib/dirchownmod.c (dirchownmod): Likewise.
* lib/exclude.c (add_exclude_file): Likewise.
* lib/fd-safer.c (fd_safer): Likewise.
* lib/fd-safer-flag.c (fd_safer_flag): Likewise.
* lib/fopen-safer.c (fopen_safer): Likewise.
* lib/pipe2-safer.c (pipe2_safer): Likewise.
* lib/quotearg.c (clone_quoting_options, quotearg_buffer,
quotearg_alloc_mem, quotearg_n_options): Likewise.
* lib/savewd.c (savewd_chdir): Likewise.
* lib/tmpfile-safer.c (tmpfile_safer): Likewise.
* lib/file-has-acl.c (acl_get_link_np): Rename err to saved_errno.
* lib/free.c (rpl_free): Likewise.
* lib/fts.c (fts_build, fts_lfree): Likewise.
* lib/getloadavg.c (getloadavg): Likewise.
* lib/hash.c (hash_free, hash_rehash): Likewise.
* lib/time_rz.c (tzfree): Likewise.
* lib/scandir.c (SCANDIR): Rename save to saved_errno.
2025-12-04 10:19:39 +01:00
Bruno Haible
3ce6744438 lib: Use C99 initialization syntax for single-variable 'for' loops.
* lib/acl-internal.c (acl_nontrivial, acl_ace_nontrivial,
aclv_nontrivial, acl_nfs4_nontrivial): Declare variable of
single-variable 'for' loops in the 'for' clause.
* lib/arcfour.c (arcfour_setkey): Likewise.
* lib/arctwo.c (arctwo_encrypt, arctwo_decrypt, arctwo_setkey_ekb):
Likewise.
* lib/argmatch.c (argmatch, argmatch_exact, argmatch_valid,
argmatch_to_argument): Likewise.
* lib/argz.c (argz_create): Likewise.
* lib/argz.in.h (error_t): Likewise.
* lib/basename-lgpl.c (last_component): Likewise.
* lib/bcp47.c (xpg_to_bcp47, bcp47_to_xpg): Likewise.
* lib/bitset/list.c (lbitset_empty_p): Likewise.
* lib/bitset/vector.c (vbitset_or_and_cmp): Likewise.
* lib/classpath.c (new_classpath): Likewise.
* lib/clean-temp-simple.c (cleanup_action): Likewise.
* lib/clean-temp.c (create_temp_dir, cleanup_temp_dir): Likewise.
* lib/count-leading-zeros.h (COUNT_LEADING_ZEROS): Likewise.
* lib/count-one-bits.h (COUNT_ONE_BITS_GENERIC): Likewise.
* lib/count-trailing-zeros.h (COUNT_TRAILING_ZEROS): Likewise.
* lib/crc-generate-table.c (make_crc_table): Likewise.
* lib/crc.c (crc32_update_no_xor_slice_by_n, crc32_update_no_xor):
Likewise.
* lib/csharpcomp.c (compile_csharp_using_mono,
compile_csharp_using_dotnet, compile_csharp_using_sscli): Likewise.
* lib/csharpexec.c (execute_csharp_using_mono,
execute_csharp_using_dotnet, execute_csharp_using_sscli): Likewise.
* lib/cygpath.c (cygpath_w): Likewise.
* lib/des.c (gl_des_is_weak_key, des_key_schedule, gl_des_setkey,
gl_3des_set2keys, gl_3des_set3keys): Likewise.
* lib/dfa.c (state_index, transit_state, free_mbdata): Likewise.
* lib/di-set.c (di_ent_hash): Likewise.
* lib/diffseq.h (diag): Likewise.
* lib/duplocale.c (duplocale): Likewise.
* lib/execve.c (execve): Likewise.
* lib/fatal-signal.c (init_fatal_signals, uninstall_handlers,
install_handlers, gl_lock_define_initialized, do_init_fatal_signal_set,
get_fatal_signals): Likewise.
* lib/fcntl.c (dupfd): Likewise.
* lib/ffs.c (ffs): Likewise.
* lib/ffsl.h (unsigned): Likewise.
* lib/file-remote.c (file_is_remote): Likewise.
* lib/findprog-in.c (find_in_given_path): Likewise.
* lib/findprog.c (find_in_path): Likewise.
* lib/fma.c (decode, multiply, FUNC): Likewise.
* lib/freelocale.c (freelocale): Likewise.
* lib/fstrcmp.c (fstrcmp_bounded): Likewise.
* lib/ftoastr.c (FTOASTR): Likewise.
* lib/fts.c (find_matching_ancestor, fts_cross_check): Likewise.
* lib/fwriteerror.c (main): Likewise.
* lib/gai_strerror.c (gai_strerror): Likewise.
* lib/gc-gnulib.c (gc_cipher_setkey, gc_cipher_setiv,
gc_cipher_encrypt_inline, gc_cipher_decrypt_inline): Likewise.
* lib/gc-pbkdf2.c (gc_pbkdf2_prf): Likewise.
* lib/gen-uni-tables.c (fill_attributes, debug_output_predicate,
output_predicate_test, output_predicate, output_category,
output_combclass, output_bidi_category, output_decimal_digit_test,
output_decimal_digit, output_digit_test, output_digit,
output_numeric_test, output_numeric, fill_mirror, get_mirror_value,
output_mirror, clear_properties, fill_properties, fill_property30,
output_indic_conjunct_break_test, output_indic_conjunct_break,
fill_arabicshaping, output_joining_type_test, output_joining_type,
output_joining_group_test, output_joining_group, fill_scripts,
output_scripts, output_scripts_byname, output_blocks,
output_ident_category, output_charclass, output_charmap, output_tables,
fill_width, output_nonspacing_property, output_width_property_test,
debug_output_lbp, fill_org_lbp, debug_output_org_lbp, output_lbpea,
output_lbrk_tables, debug_output_wbp, fill_org_wbp,
debug_output_org_wbp, output_wbp, output_gbp_test, output_gbp_table,
fill_org_gbp, output_decomposition, output_decomposition_tables,
fill_composition_exclusions, debug_output_composition_tables,
output_composition_tables, output_simple_mapping_test,
output_simple_mapping, fill_casing_rules, fill_casefolding_rules,
redistribute_casefolding_rules, output_casing_rules): Likewise.
* lib/get_ppid_of.c (get_ppid_of): Likewise.
* lib/getdtablesize.c (getdtablesize): Likewise.
* lib/getloadavg.c (getloadavg): Likewise.
* lib/getlocalename_l-unsafe.c (get_locale_t_name_unsafe, newlocale,
duplocale, freelocale): Likewise.
* lib/getlogin.c (getlogin): Likewise.
* lib/getprogname.c (getprogname): Likewise.
* lib/getugroups.c (getugroups): Likewise.
* lib/gl_anyavltree_list2.h (gl_tree_remove_node_from_tree,
gl_tree_nx_add_first, gl_tree_nx_add_last, gl_tree_nx_add_before,
gl_tree_nx_add_after): Likewise.
* lib/gl_anyhash2.h (hash_resize): Likewise.
* lib/gl_anyhash_primes.h (next_prime): Likewise.
* lib/gl_anylinked_list2.h (gl_linked_nx_create,
gl_linked_search_from_to, gl_linked_list_free,
gl_linked_iterator_from_to, gl_linked_sortedlist_search,
gl_linked_sortedlist_nx_add, gl_linked_sortedlist_remove): Likewise.
* lib/gl_anyrbtree_list2.h (gl_tree_remove_node_from_tree,
gl_tree_nx_add_first, gl_tree_nx_add_last, gl_tree_nx_add_before,
gl_tree_nx_add_after): Likewise.
* lib/gl_anytree_list2.h (gl_tree_sortedlist_search,
gl_tree_sortedlist_search_from_to): Likewise.
* lib/gl_anytree_omap.h (gl_tree_search, gl_tree_search_atleast,
gl_tree_getremove): Likewise.
* lib/gl_anytree_oset.h (gl_tree_search, gl_tree_search_atleast,
gl_tree_search_node, gl_tree_iterator_atleast): Likewise.
* lib/gl_anytreehash_list1.h (add_to_bucket, remove_from_bucket):
Likewise.
* lib/gl_anytreehash_list2.h (gl_tree_search_from_to,
gl_tree_list_free): Likewise.
* lib/gl_array_list.c (gl_array_indexof_from_to, gl_array_nx_add_first,
gl_array_nx_add_before, gl_array_nx_add_after, gl_array_nx_add_at,
gl_array_remove_node, gl_array_remove_at): Likewise.
* lib/gl_array_map.c (gl_array_indexof, gl_array_remove_at): Likewise.
* lib/gl_array_omap.c (gl_array_nx_add_at, gl_array_remove_at):
Likewise.
* lib/gl_array_oset.c (gl_array_nx_add_at, gl_array_remove_at,
gl_array_update): Likewise.
* lib/gl_array_set.c (gl_array_search, gl_array_remove_at,
gl_array_remove): Likewise.
* lib/gl_carray_list.c (gl_carray_nx_add_at, gl_carray_remove_at,
gl_carray_list_free): Likewise.
* lib/gl_hash_map.c (gl_hash_search, gl_hash_nx_getput,
gl_hash_getremove, gl_hash_free): Likewise.
* lib/gl_hash_set.c (gl_hash_search, gl_hash_nx_add, gl_hash_remove,
gl_hash_free): Likewise.
* lib/gl_linkedhash_list.c (remove_from_bucket): Likewise.
* lib/gl_linkedhash_map.c (gl_linkedhash_search,
gl_linkedhash_nx_getput, gl_linkedhash_getremove, gl_linkedhash_free):
Likewise.
* lib/gl_linkedhash_set.c (gl_linkedhash_search, gl_linkedhash_nx_add,
gl_linkedhash_remove, gl_linkedhash_free): Likewise.
* lib/group-member.c (group_member, main): Likewise.
* lib/hash.c (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
hash_get_first, hash_get_entries, hash_do_for_each, hash_clear,
hash_free, find_entry, transfer_entries, hash_print): Likewise.
* lib/hashcode-mem.c (hash_pjw_bare): Likewise.
* lib/hashcode-string2.c (hash_pjw): Likewise.
* lib/human.c (human_readable): Likewise.
* lib/i-ring.c (i_ring_init): Likewise.
* lib/idcache.c (getuser, getuidbyname, getgroup, getgidbyname):
Likewise.
* lib/inet_ntop.c (inet_ntop6): Likewise.
* lib/inet_pton.c (inet_pton6): Likewise.
* lib/ino-map.c (ino_hash): Likewise.
* lib/integer_length.c (integer_length): Likewise.
* lib/integer_length_l.c (FUNC): Likewise.
* lib/javacomp.c (compile_using_envjavac, compile_using_javac):
Likewise.
* lib/javaexec.c (execute_java_class): Likewise.
* lib/kwset.c (kwsprep): Likewise.
* lib/ldexpl.c (main): Likewise.
* lib/localeinfo.c (case_folded_counterparts): Likewise.
* lib/localename-unsafe.c (script_entry, gl_locale_name_canonicalize):
Likewise.
* lib/login_tty.c (login_tty): Likewise.
* lib/mbscasestr.c (knuth_morris_pratt_multibyte): Likewise.
* lib/mbsstr.c (knuth_morris_pratt_multibyte): Likewise.
* lib/md2.c (md2_finish_ctx, md2_update_chksum, md2_compress): Likewise.
* lib/md4.c (md4_process_block): Likewise.
* lib/mem-hash-map.c (resize): Likewise.
* lib/memcasecmp.c (memcasecmp): Likewise.
* lib/memchr.c (__memchr): Likewise.
* lib/memchr2.c (memchr2): Likewise.
* lib/memrchr.c (__memrchr): Likewise.
* lib/mgetgroups.c (mgetgroups): Likewise.
* lib/mktime.c (__mktime_internal): Likewise.
* lib/modechange.c (mode_compile): Likewise.
* lib/mountlist.c (unescape_tab, read_file_system_list): Likewise.
* lib/mpsort.c (mpsort_with_tmp): Likewise.
* lib/nproc.c (num_processors_via_affinity_mask): Likewise.
* lib/obstack.c (strong_alias): Likewise.
* lib/os2-spawn.c (prepare_spawn): Likewise.
* lib/pipe-filter-ii.c (WaitForMultipleObjects): Likewise.
* lib/pipe-safer.c (pipe_safer): Likewise.
* lib/pipe2-safer.c (pipe2_safer): Likewise.
* lib/poll.c (windows_compute_revents, poll): Likewise.
* lib/progreloc.c (find_executable): Likewise.
* lib/pselect.c (rpl_pselect): Likewise.
* lib/putenv.c (SetEnvironmentVariable): Likewise.
* lib/qsort.c (_quicksort): Likewise.
* lib/quotearg.c (quotearg_buffer_restyled, quotearg_free): Likewise.
* lib/random_r.c (__srandom_r): Likewise.
* lib/readtokens.c (readtoken): Likewise.
* lib/readutmp.c (read_utmp_from_systemd): Likewise.
* lib/regex-quote.c (regex_quote_length, regex_quote_copy): Likewise.
* lib/relocwrapper.c (relocate_libdirs, activate_libdirs): Likewise.
* lib/scandir.c (cancel_handler): Likewise.
* lib/select.c (windows_poll_handle, rpl_select): Likewise.
* lib/set-permissions.c (set_acls_from_mode): Likewise.
* lib/setlocale-fixes.c (fill_lc_all_name, setlocale_fixed): Likewise.
* lib/setlocale.c (search, setlocale_unixlike): Likewise.
* lib/setlocale_null-unlocked.c (setlocale_null_r_unlocked): Likewise.
* lib/sh-quote.c (shell_quote_argv): Likewise.
* lib/sha1.c (sha1_process_block): Likewise.
* lib/sha256.c (sha256_read_ctx, sha224_read_ctx, sha256_process_block):
Likewise.
* lib/sha512.c (sha512_read_ctx, sha384_read_ctx, sha512_process_block):
Likewise.
* lib/sig2str.c (str2signum, sig2str): Likewise.
* lib/sigprocmask.c (sigpending, sigprocmask): Likewise.
* lib/sm3.c (sm3_read_ctx, sm3_process_block): Likewise.
* lib/spawn_faction_destroy.c (posix_spawn_file_actions_destroy):
Likewise.
* lib/spawni.c (do_remaining_delayed_dup2, shrink_inheritable_handles,
close_inheritable_handles, __spawni): Likewise.
* lib/ssfmalloc-bitmap.h (init_bitmap_all_bits_clear,
init_bitmap_all_bits_set): Likewise.
* lib/ssfmalloc.h (add_update, drop_update,
allocate_medium_block_in_page, free_medium_block_in_page): Likewise.
* lib/stack-trace-impl.h (print_stack_trace_to): Likewise.
* lib/stat-time.h (stat_time_normalize): Likewise.
* lib/stat-w32.c (_gl_fstat_by_handle): Likewise.
* lib/stat.c (rpl_stat): Likewise.
* lib/stdopen.c (stdopen): Likewise.
* lib/str-kmp.h (knuth_morris_pratt): Likewise.
* lib/str-two-way.h (two_way_long_needle): Likewise.
* lib/strchrnul.c (strchrnul): Likewise.
* lib/strfmon_l.c (rpl_strfmon_l): Likewise.
* lib/strftime.c (underlying_strftime, __strftime_internal): Likewise.
* lib/striconveh.c (iconv_carefully, iconv_carefully_1, tmpbuf):
Likewise.
* lib/striconveha.c (mem_iconveha_notranslit, str_iconveha_notranslit):
Likewise.
* lib/string-desc.c (_sd_c_casecmp, sd_concat): Likewise.
* lib/strnlen.c (strnlen): Likewise.
* lib/strtod.c (parse_number): Likewise.
* lib/strtol.c (INTERNAL(strtol)): Likewise.
* lib/struniq.h (gl_lock_define_initialized): Likewise.
* lib/sys_select.in.h (rpl_fd_isset): Likewise.
* lib/sys_socket.in.h (rpl_fd_isset): Likewise.
* lib/system-quote.c (windows_createprocess_quote, windows_cmd_quote,
system_quote_argv): Likewise.
* lib/tempname.c (try_tempname_len): Likewise.
* lib/term-style-control.c (init_relevant_signal_set,
fatal_or_stopping_signal_handler, continuing_signal_handler,
ensure_other_signal_handlers): Likewise.
* lib/tsearch.c (check_tree): Likewise.
* lib/unicase/u-casemap.h (FUNC): Likewise.
* lib/unicase/u-ct-totitle.h (FUNC): Likewise.
* lib/uniconv/u-conv-from-enc.h (FUNC): Likewise.
* lib/uniconv/u-conv-to-enc.h (FUNC): Likewise.
* lib/uniconv/u8-conv-from-enc.c (u8_conv_from_encoding): Likewise.
* lib/unictype/3level.h (CONCAT(TABLE,_add), CONCAT(TABLE,_iterate),
CONCAT(TABLE,_finalize)): Likewise.
* lib/unictype/3levelbit.h (CONCAT(TABLE,_add), CONCAT(TABLE,_iterate),
CONCAT(TABLE,_finalize)): Likewise.
* lib/unigbrk/ulc-grapheme-breaks.c (ascii_grapheme_breaks,
ulc_grapheme_breaks): Likewise.
* lib/unilbrk/u8-possible-linebreaks.c (main): Likewise.
* lib/unilbrk/u8-width-linebreaks.c (main): Likewise.
* lib/unilbrk/ulc-possible-linebreaks.c
(ulc_possible_linebreaks_internal, main): Likewise.
* lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks_internal,
main): Likewise.
* lib/uniname/uniname.c (unicode_character_name,
unicode_name_character): Likewise.
* lib/uninorm/u-normalize-internal.h (FUNC): Likewise.
* lib/uninorm/uninorm-filter.c (uninorm_filter_write,
uninorm_filter_flush): Likewise.
* lib/uniwbrk/u8-wordbreaks.c (main): Likewise.
* lib/uniwbrk/ulc-wordbreaks.c (ulc_wordbreaks, main): Likewise.
* lib/userspec.c (main): Likewise.
* lib/vasnprintf.c (multiply, divide, convert_to_decimal,
decode_long_double, decode_double, scale10_round_decimal_decoded,
VASNPRINTF): Likewise.
* lib/vma-iter.c (vma_iterate): Likewise.
* lib/windows-cond.c (glwthread_waitqueue_notify_all): Likewise.
* lib/windows-path.c (extended_PATH, extended_environ): Likewise.
* lib/windows-rwlock.c (glwthread_waitqueue_add,
glwthread_waitqueue_notify_all): Likewise.
* lib/windows-spawn.c (quoted_arg_length, quoted_arg_string,
prepare_spawn, compose_command, compose_envblock,
init_inheritable_handles, compose_handles_block): Likewise.
* lib/windows-timedrwlock.c (glwthread_waitqueue_notify_all): Likewise.
* lib/windows-tls.c (glwthread_tls_process_destructors,
glwthread_tls_key_delete): Likewise.
* lib/xstring-desc.c (xsd_concat): Likewise.
* lib/xvasprintf.c (xstrcat, xvasprintf): Likewise.
* lib/newlocale.c (newlocale): Likewise. Move the fail_with_err label
into the loop.
2025-11-18 21:57:53 +01:00
Paul Eggert
6ca831b019 stringeq: prefer memeq to memcmp in other modules
* lib/argmatch.c, lib/argmatch.h, lib/backupfile.c, lib/bcp47.c:
* lib/boot-time.c, lib/csharpcomp.c, lib/csharpexec.c:
* lib/file-has-acl.c, lib/gen-uni-tables.c, lib/get_ppid_of.c:
* lib/get_progname_of.c, lib/getlogin_r.c, lib/getprogname.c:
* lib/getumask.c, lib/isnan.c, lib/mbchar.h, lib/mem-hash-map.c:
* lib/memcoll.c, lib/progname.c, lib/progreloc.c:
* lib/pthread_sigmask.c, lib/quotearg.c, lib/readutmp.c:
* lib/same.c, lib/signbitd.c, lib/signbitf.c, lib/signbitl.c:
* lib/string-desc.c, lib/string.c, lib/string.in.h:
* lib/unictype/3level.h, lib/unictype/3levelbit.h:
* lib/uniname/uniname.c, lib/vc-mtime.c:
Prefer memeq to memcmp when either will do.
Do not make this change to files shared with glibc.
Do not make the change to test files, at least not for now.
* lib/gen-uni-tables.c (memeq): New static function, in same style.
* modules/argmatch, modules/backupfile, modules/bcp47:
* modules/boot-time, modules/csharpcomp, modules/csharpexec:
* modules/file-has-acl:
* modules/get_ppid_of, modules/get_progname_of:
* modules/getlogin_r, modules/getprogname, modules/getumask:
* modules/isnan, modules/mbchar, modules/mem-hash-map:
* modules/memcoll, modules/progname, modules/pthread_sigmask:
* modules/quotearg, modules/readutmp, modules/relocatable-prog:
* modules/relocatable-prog-wrapper, modules/same, modules/signbit:
* modules/string-desc, modules/stringeq, modules/uniname/uniname:
* modules/vc-mtime:
(Depends-on): Add stringeq.
2025-09-17 08:20:24 -07:00
Paul Eggert
2b2bcdbc3b gettext-h: support overriding "gnulib"
This is for GNU Diffutils, which is still using the old way
of also translating Gnulib’s msgids.
* lib/gettext.h (GNULIB_TEXT_DOMAIN): New macro.
* lib/argmatch.c, lib/bitset/stats.c, lib/c-stack.c:
* lib/clean-temp-simple.c, lib/clean-temp-simple.c, lib/clean-temp.c:
* lib/closein.c, lib/closeout.c, lib/copy-acl.c, lib/copy-file.c:
* lib/csharpcomp.c, lib/csharpexec.c, lib/cygpath.c, lib/dfa.c:
* lib/error.c, lib/execute.c, lib/gai_strerror.c, lib/getaddrinfo.c:
* lib/getopt.c, lib/javacomp.c, lib/javaexec.c, lib/javaversion.c:
* lib/mkdir-p.c, lib/obstack.c, lib/openat-die.c, lib/os2-spawn.c:
* lib/pagealign_alloc.c, lib/parse-datetime.y, lib/pipe-filter-gi.c:
* lib/pipe-filter-ii.c, lib/quotearg.c, lib/rpmatch.c, lib/set-acl.c:
* lib/sigpipe-die.c, lib/spawn-pipe.c, lib/strsignal.c, lib/timevar.c:
* lib/unicodeio.c, lib/userspec.c, lib/vc-mtime.c, lib/version-etc.c:
* lib/wait-process.c, lib/windows-cygpath.c, lib/xalloc-die.c:
* lib/xbinary-io.c, lib/xfreopen.c, lib/xmemcoll.c, lib/xprintf.c:
* lib/xsetenv.c, lib/xstdopen.c, lib/xstrerror.c, lib/xstrtol-error.c:
(_): Use GNULIB_TEXT_DOMAIN instead of "gnulib" when calling dgettext.
* lib/argmatch.h (ARGMATCH_DEFINE_GROUP):
* lib/file-type.c (file_type):
* lib/regex_internal.h (gettext) [HAVE_LIBINTL_H & ENABLE_NLS & !_LIBC]:
* lib/xstrtol-error.c (xstrtol_error):
Likewise.
2025-09-09 09:58:33 -07:00
Collin Funk
4883d9e60e quotearg: Remove an unused variable.
* lib/quotearg.c (gettext_quote): Remove a variable that is no longer
used after yesterdays changes.
2025-09-05 18:52:43 -07:00
Paul Eggert
012cf99fda dfa, propername-lite, quotearg: prefer mbszero
Problem reported by Collin Funk in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00063.html
* lib/dfa.c (mbszero) [GAWK]: Omit unnecessary parens.
* lib/localeinfo.c (mbszero) [GAWK]: New macro, copied from dfa.c.
(is_using_utf8, init_localeinfo): Use it.
* lib/propername-lite.c (proper_name_lite):
* lib/quotearg.c (gettext_quote):
Prefer mbszero to initializing the entire mbstate_t.
2025-09-05 15:19:19 -07:00
Bruno Haible
aca171f3a2 quotearg: Improve comment.
* lib/quotearg.c (gettext_quote): Improve terminology. Use standard
encoding name.
2025-09-05 11:01:29 +02:00
Paul Eggert
751e42b0bc quotearg: do not depend on localcharset
* lib/quotearg.c: Do not include localcharset.h.
(gettext_quote): Do not use locale_charset; instead, use
mbrtoc32 to determine whether the character set uses UTF-8.
Treat GB-18030 like similar encodings, as it is not worth the
trouble of special-casing: its special-case code has been broken
since 2011, nobody cared enough to report the bug, and the idea
that someone would use GB-18030 without translations is weird anyway.
* modules/quotearg (Depends-on): Remove localcharset.
2025-09-05 00:20:57 -07:00
Bruno Haible
78c7fe8a85 quotearg: Avoid undefined behaviour.
Reported by Kirill Furman <kfurman@astralinux.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00037.html>.

* lib/quotearg.c (set_char_quoting): Use 'unsigned int', not 'int', for
doing bit mask operations.
2025-03-10 17:28:33 +01:00
Paul Eggert
b00b18c2da quotearg: pacify -Wswitch-enum
* lib/quotearg.c (quotearg_buffer_restyled): Use switch (+E), and
omit default case, to pacify gcc -Wswitch-enum.  This is a good
way to pacify -Wswitch-enum when we don’t want to enumerate
all the enum values.  Omit unnecessary ‘default: break;’s.
2025-02-02 15:36:13 -08:00
Pádraig Brady
7b08932179 maint: run 'make update-copyright' 2025-01-01 09:25:10 +00:00
Bruno Haible
6f6cc5e059 Use the translation domain "gnulib".
* lib/argmatch.c (_): Use translation domain "gnulib".
* lib/bitset/stats.c (_): Likewise.
* lib/c-stack.c (_): Likewise.
* lib/clean-temp.c (_): Likewise.
* lib/clean-temp-simple.c (_): Likewise.
* lib/closein.c (_): Likewise.
* lib/closeout.c (_): Likewise.
* lib/copy-acl.c (_): Likewise.
* lib/copy-file.c (_): Likewise.
* lib/csharpcomp.c (_): Likewise.
* lib/csharpexec.c (_): Likewise.
* lib/cygpath.c (_): Likewise.
* lib/dfa.c (_): Likewise.
* lib/error.c (_): Likewise.
* lib/execute.c (_): Likewise.
* lib/gai_strerror.c (_): Likewise.
* lib/getaddrinfo.c (_): Likewise.
* lib/getopt.c (_): Likewise.
* lib/javacomp.c (_): Likewise.
* lib/javaexec.c (_): Likewise.
* lib/javaversion.c (_): Likewise.
* lib/mkdir-p.c (_): Likewise.
* lib/obstack.c (_) [!_LIBC]: Likewise.
* lib/openat-die.c (_): Likewise.
* lib/os2-spawn.c (_): Likewise.
* lib/pagealign_alloc.c (_): Likewise.
* lib/parse-datetime.y (_): Likewise.
* lib/pipe-filter-gi.c (_): Likewise.
* lib/pipe-filter-ii.c (_): Likewise.
* lib/quotearg.c (_): Likewise.
* lib/regex_internal.h (_): Likewise.
* lib/rpmatch.c (_): Likewise.
* lib/set-acl.c (_): Likewise.
* lib/sigpipe-die.c (_): Likewise.
* lib/spawn-pipe.c (_): Likewise.
* lib/strsignal.c (_) [!_LIBC]: Likewise.
* lib/timevar.c (_): Likewise.
* lib/unicodeio.c (_): Likewise.
* lib/userspec.c (_): Likewise.
* lib/version-etc.c (_): Likewise.
* lib/wait-process.c (_): Likewise.
* lib/xalloc-die.c (_): Likewise.
* lib/xbinary-io.c (_): Likewise.
* lib/xfreopen.c (_): Likewise.
* lib/xmemcoll.c (_): Likewise.
* lib/xsetenv.c (_): Likewise.
* lib/xstdopen.c (_): Likewise.
* lib/xstrerror.c (_): Likewise.
* modules/acl (Depends-on): Add gnulib-i18n.
* modules/argmatch (Depends-on): Likewise.
* modules/bitset (Depends-on): Likewise.
* modules/c-stack (Depends-on): Likewise.
* modules/clean-temp (Depends-on): Likewise.
* modules/clean-temp-simple (Depends-on): Likewise.
* modules/closein (Depends-on): Likewise.
* modules/closeout (Depends-on): Likewise.
* modules/copy-file (Depends-on): Likewise.
* modules/csharpcomp (Depends-on): Likewise.
* modules/csharpexec (Depends-on): Likewise.
* modules/cygpath (Depends-on): Likewise.
* modules/dfa (Depends-on): Likewise.
* modules/error (Depends-on): Likewise.
* modules/execute (Depends-on): Likewise.
* modules/getaddrinfo (Depends-on): Likewise.
* modules/getopt-posix (Depends-on): Likewise.
* modules/javacomp (Depends-on): Likewise.
* modules/javaexec (Depends-on): Likewise.
* modules/javaversion (Depends-on): Likewise.
* modules/mkdir-p (Depends-on): Likewise.
* modules/obstack (Depends-on): Likewise.
* modules/openat-die (Depends-on): Likewise.
* modules/pagealign_alloc (Depends-on): Likewise.
* modules/parse-datetime (Depends-on): Likewise.
* modules/pipe-filter-gi (Depends-on): Likewise.
* modules/pipe-filter-ii (Depends-on): Likewise.
* modules/quotearg (Depends-on): Likewise.
* modules/regex (Depends-on): Likewise.
* modules/rpmatch (Depends-on): Likewise.
* modules/sigpipe-die (Depends-on): Likewise.
* modules/spawn-pipe (Depends-on): Likewise.
* modules/strsignal (Depends-on): Likewise.
* modules/timevar (Depends-on): Likewise.
* modules/unicodeio (Depends-on): Likewise.
* modules/userspec (Depends-on): Likewise.
* modules/version-etc (Depends-on): Likewise.
* modules/wait-process (Depends-on): Likewise.
* modules/xalloc-die (Depends-on): Likewise.
* modules/xbinary-io (Depends-on): Likewise.
* modules/xfreopen (Depends-on): Likewise.
* modules/xmemcoll (Depends-on): Likewise.
* modules/xsetenv (Depends-on): Likewise.
* modules/xstdopen (Depends-on): Likewise.
* modules/xstrerror (Depends-on): Likewise.
2024-12-08 18:05:31 +01:00
Bruno Haible
f3d9653741 Eliminate gcc -Wzero-as-null-pointer-constant warnings.
* lib/argp-help.c: Use NULL, not 0, to denote a null pointer.
* lib/argp-parse.c: Likewise.
* lib/backup-find.c (get_version): Likewise.
* lib/bitset/list.c: Likewise.
* lib/bitset/stats.c (bitset_stats_init): Likewise.
* lib/bitset/table.c: Likewise.
* lib/bitsetv.c (bitsetv_alloc): Likewise.
* lib/error.c (print_errno_message): Likewise.
* lib/exclude.c (new_exclude_segment): Likewise.
* lib/getopt.c (GETOPT_ENTRY): Likewise.
* lib/human.c (block_size_args): Likewise.
* lib/obstack.c (_obstack_begin_worker, _obstack_newchunk,
_obstack_allocated_p, _obstack_free, _obstack_memory_used): Likewise.
* lib/quotearg.c (quoting_style_args, quotearg_buffer_restyled,
quotearg_alloc_mem): Likewise.
* lib/readutmp.c (read_utmp_from_file): Likewise.
* lib/savedir.c (comparison_function_table): Likewise.
* lib/settime.c (settime): Likewise.
* tests/nap.h (nap_works): Likewise.
* tests/test-fts.c (argv, fts_dealloc, remove_tree, main): Likewise.
* tests/test-getaddrinfo.c (simple): Likewise.
* tests/test-nstrftime.h (posixtm_test, TZ, quarter_test, errno_test,
locales_test): Likewise.
* tests/test-parse-datetime.c (main): Likewise.
* tests/test-regex.c (main): Likewise.
2024-11-14 16:12:31 +01:00
Bruno Haible
e95082051d Fix some of the warnings from a clang that masquerades as gcc 13.
* lib/c-stack.c: Use _GL_GNUC_PREREQ to test for the gcc version.
* lib/canonicalize.c: Likewise.
* lib/diffseq.h: Likewise.
* lib/file-has-acl.c: Likewise.
* lib/freopen-safer.c: Likewise.
* lib/getndelim2.c: Likewise.
* lib/mini-gmp-gnulib.c: Likewise.
* lib/propername.c: Likewise.
* lib/quotearg.c: Likewise.
* lib/savedir.c: Likewise.
* lib/vasnprintf.c: Likewise.
* tests/test-argmatch.c: Likewise.
* tests/test-dup2.c: Likewise.
* tests/test-explicit_bzero.c: Likewise.
* tests/test-fcntl.c: Likewise.
* tests/test-fopen.h: Likewise.
* tests/test-getdtablesize.c: Likewise.
* tests/test-getgroups.c: Likewise.
* tests/test-listen.c: Likewise.
* tests/test-localename.c: Likewise.
* tests/test-memset_explicit.c: Likewise.
* tests/test-open.h: Likewise.
* tests/test-perror2.c: Likewise.
* tests/test-select.h: Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD): Don't use
gnu_printf with clang.
* lib/string-buffer.h: Likewise.
* lib/textstyle.in.h: Likewise.
2024-08-27 00:19:14 +02:00
Pádraig Brady
07b31a9465 quotearg: fix shell-escape quoting with single quotes
With shell-escape quoting, we misquoted strings
where the first and last characters required escaping,
while the string also contained single quotes.

* lib/quotearg.c (quotearg_buffer_restyled): Ensure that
pending_shell_escape_end is reset to the initial state
when reprocessing input due to single quotes.
* tests/test-quotearg-simple.c: Add a minimal test case.
* tests/test-quotearg.c: Likewise.
* tests/test-quotearg.h: Likewise.
Reported by Grisha Levit
2024-04-03 23:18:18 +01:00
Simon Josefsson
5b92dd0a45 maint: run 'make update-copyright' 2024-01-01 10:31:48 +01:00
Bruno Haible
a85a9b34bd quotearg: Optimize clearing an mbstate_t.
* lib/quotearg.c: Include <wchar.h>.
(quotearg_buffer_restyled): Use mbszero.
* modules/quotearg (Depends-on): Add mbszero.
2023-07-16 10:29:19 +02:00
Bruno Haible
6d77b0cc66 Optimize away some mbsinit calls.
* lib/mbiter.h (mbiter_multi_next): When the module 'mbrtoc32-regular'
is in use, don't invoke mbsinit and don't compare the mbrtoc32 result
against (size_t)(-3).
* lib/mbuiter.h (mbuiter_multi_next): Likewise.
* lib/mbfile.h (mbfile_multi_getc): Likewise.
* lib/mbswidth.c (mbsnwidth): Likewise.
* lib/mbmemcasecoll.c (apply_c32tolower): Likewise.
* lib/quotearg.c (quotearg_buffer_restyled): Likewise.
2023-07-11 21:30:44 +02:00
Paul Eggert
f27fe1d101 quotearg: update Solaris-related comments
* doc/solaris-versions: Modernize.
* lib/quotearg.c: Update comments.
2023-07-11 10:46:35 -07:00
Bruno Haible
2d422a55f4 quotearg: Overcome wchar_t limitations.
* lib/quotearg.c: Include <uchar.h> instead of <wchar.h>, <wctype.h>.
(quotearg_buffer_restyled): Use mbrtoc32, c32isprint instead of mbrtowc,
iswprint.
* modules/quotearg (Files): Remove m4/mbstate_t.m4, m4/mbrtowc.m4
(redundant).
(Depends-on): Add uchar, mbrtoc32, c32isprint. Remove wchar, wctype-h,
mbrtowc.
(Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/quotearg-tests (Makefile.am): Link test-quotearg with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/quotearg-simple (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/quotearg-simple-tests (Makefile.am): Link test-quotearg-simple
with $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/quote (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/acl (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/acl-tests (Makefile.am): Link test-set-mode-acl and
test-copy-acl with $(LIBUNISTRING) $(LIBC32CONV).
* modules/copy-file (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/copy-file-tests (Makefile.am): Link test-copy-file with
$(LIBUNISTRING) $(LIBC32CONV).
--
* modules/argmatch (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/argmatch-tests (Makefile.am): Link test-argmatch with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/backup-rename (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/backupfile (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/human (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/sh-quote (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/sh-quote-tests (Makefile.am): Link test-sh-quote with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/system-quote (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/system-quote-tests (Makefile.am): Link test-system-quote-main
with $(LIBUNISTRING) $(LIBC32CONV).
* modules/csharpcomp (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/csharpexec (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/javacomp (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/javaexec (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/string-desc-quotearg (Link): New section.
* modules/string-desc-quotearg-tests (Makefile.am): Link
test-string-desc-quotearg with $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/xmemcoll (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
--
* modules/closeout (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/readtokens-tests (Makefile.am): Link test-readtokens with
$(LIBUNISTRING) $(LIBC32CONV).
--
* modules/closein (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/closein-tests (Makefile.am): Link test-closein with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/yesno-tests (Makefile.am): Link test-yesno with
$(LIBUNISTRING) $(LIBC32CONV).
2023-07-01 10:05:37 +02:00
Simon Josefsson
32a72f4537 maint: run 'make update-copyright' 2023-01-01 01:14:21 +01:00
Paul Eggert
2f858e5e43 Rely on new stdbool behavior
Prefer the C23 style to the C99 style,
since the stdbool module now supports C23.
* lib/acl-internal.h, lib/acl.h, lib/argmatch.c, lib/argmatch.h:
* lib/argp-help.c, lib/argv-iter.h, lib/asyncsafe-spin.c:
* lib/backup-internal.h, lib/backupfile.c, lib/base32.h:
* lib/base64.h, lib/basename-lgpl.c, lib/bitset/base.h:
* lib/c-ctype.h, lib/c-strcasestr.c, lib/canonicalize-lgpl.c:
* lib/canonicalize.c, lib/chdir-long.c, lib/chown.c:
* lib/classpath.h, lib/clean-temp-private.h:
* lib/clean-temp-simple.c, lib/clean-temp-simple.h:
* lib/clean-temp.c, lib/clean-temp.h, lib/cloexec.h:
* lib/close-stream.c, lib/closein.c, lib/closeout.c, lib/closeout.h:
* lib/csharpcomp.h, lib/csharpexec.h, lib/cycle-check.c:
* lib/cycle-check.h, lib/des.h, lib/dfa.h, lib/diffseq.h:
* lib/dirname.h, lib/exclude.c, lib/exclude.h, lib/execute.c:
* lib/execute.h, lib/execvpe.c, lib/fatal-signal.c, lib/fchdir.c:
* lib/file-set.h, lib/filevercmp.c, lib/findprog-in.c:
* lib/findprog.c, lib/findprog.h, lib/fma.c, lib/fnmatch.c:
* lib/fopen.c, lib/freadable.h, lib/freading.h, lib/freopen-safer.c:
* lib/fstrcmp.c, lib/fsusage.h, lib/fts.c, lib/fwritable.h:
* lib/fwriteerror.c, lib/fwriting.h, lib/gen-uni-tables.c:
* lib/getaddrinfo.c, lib/getcwd.c, lib/getloadavg.c:
* lib/getndelim2.c, lib/getpass.c, lib/getrandom.c:
* lib/git-merge-changelog.c, lib/gl_list.h, lib/gl_map.h:
* lib/gl_omap.h, lib/gl_oset.h, lib/gl_set.h, lib/glob.c:
* lib/glthread/cond.h, lib/hamt.h, lib/hard-locale.h:
* lib/hash-triple.h, lib/hash.h, lib/human.h, lib/i-ring.h:
* lib/isapipe.c, lib/javacomp.h, lib/javaexec.h, lib/javaversion.c:
* lib/lchown.c, lib/localeinfo.h, lib/localename.c:
* lib/long-options.h, lib/malloc/dynarray.h, lib/mbchar.h:
* lib/mbfile.h, lib/mbiter.h, lib/mbmemcasecoll.h, lib/mbscasestr.c:
* lib/mbsstr.c, lib/mbuiter.h, lib/mkdir-p.h, lib/modechange.h:
* lib/mountlist.h, lib/nanosleep.c, lib/nonblocking.h:
* lib/nstrftime.c, lib/openat.c, lib/openat.h, lib/os2-spawn.c:
* lib/parse-datetime.h, lib/pipe-filter-aux.c, lib/pipe-filter-gi.c:
* lib/pipe-filter-ii.c, lib/pipe-filter.h, lib/posixtm.h:
* lib/priv-set.c, lib/progreloc.c, lib/propername.c:
* lib/pthread-spin.c, lib/quotearg.c, lib/readtokens.c:
* lib/readtokens0.h, lib/readutmp.c, lib/regex-quote.h:
* lib/regex_internal.h, lib/relocwrapper.c, lib/rename.c:
* lib/renameatu.c, lib/rpmatch.c, lib/same.c, lib/same.h:
* lib/save-cwd.c, lib/savewd.c, lib/savewd.h, lib/spawn-pipe.h:
* lib/spawni.c, lib/stack.h, lib/stat.c, lib/stdckdint.in.h:
* lib/strcasestr.c, lib/strfmon_l.c, lib/striconveh.c:
* lib/striconveha.h, lib/string-buffer.h, lib/strptime.c:
* lib/strstr.c, lib/strtod.c, lib/supersede.h, lib/system-quote.c:
* lib/tempname.c, lib/term-style-control.c:
* lib/term-style-control.h, lib/textstyle.in.h, lib/time_rz.c:
* lib/tmpdir.c, lib/tmpdir.h, lib/tmpfile.c, lib/unicase.in.h:
* lib/unicase/caseprop.h, lib/unicase/invariant.h:
* lib/unicase/u16-casemap.c, lib/unicase/u16-ct-totitle.c:
* lib/unicase/u16-is-invariant.c, lib/unicase/u32-casemap.c:
* lib/unicase/u32-ct-totitle.c, lib/unicase/u32-is-invariant.c:
* lib/unicase/u8-casemap.c, lib/unicase/u8-ct-totitle.c:
* lib/unicase/u8-is-invariant.c, lib/unictype.in.h:
* lib/unigbrk.in.h, lib/unigbrk/u16-grapheme-breaks.c:
* lib/unigbrk/u32-grapheme-breaks.c:
* lib/unigbrk/u8-grapheme-breaks.c:
* lib/unigbrk/uc-grapheme-breaks.c, lib/uniname/uniname.c:
* lib/unistr.in.h, lib/unlinkdir.h, lib/userspec.h, lib/utime.c:
* lib/utimecmp.c, lib/utimens.c, lib/wait-process.h:
* lib/windows-cond.c, lib/windows-spawn.c, lib/windows-spawn.h:
* lib/windows-timedrwlock.c, lib/write-any-file.h, lib/xbinary-io.c:
* lib/xstrtod.h, lib/yesno.h:
* tests/nap.h, tests/qemu.h, tests/test-areadlink-with-size.c:
* tests/test-areadlink.c, tests/test-areadlinkat-with-size.c:
* tests/test-areadlinkat.c, tests/test-base32.c:
* tests/test-base64.c, tests/test-ceil2.c, tests/test-ceilf2.c:
* tests/test-chown.c, tests/test-dirname.c, tests/test-dup-safer.c:
* tests/test-dup3.c, tests/test-exclude.c:
* tests/test-execute-child.c, tests/test-execute-main.c:
* tests/test-execute-script.c, tests/test-explicit_bzero.c:
* tests/test-fchownat.c, tests/test-fcntl-safer.c:
* tests/test-fcntl.c, tests/test-fdutimensat.c:
* tests/test-filenamecat.c, tests/test-floor2.c:
* tests/test-floorf2.c, tests/test-fstatat.c, tests/test-fstrcmp.c:
* tests/test-futimens.c, tests/test-getlogin.h, tests/test-getopt.h:
* tests/test-hard-locale.c, tests/test-hash.c:
* tests/test-idpriv-drop.c, tests/test-idpriv-droptemp.c:
* tests/test-immutable.c, tests/test-intprops.c:
* tests/test-lchown.c, tests/test-link.c, tests/test-linkat.c:
* tests/test-lstat.c, tests/test-mbmemcasecmp.c:
* tests/test-mbmemcasecoll.c, tests/test-mkdir.c:
* tests/test-mkdirat.c, tests/test-mkfifo.c, tests/test-mkfifoat.c:
* tests/test-mknod.c, tests/test-nonblocking-pipe-child.c:
* tests/test-nonblocking-pipe-main.c:
* tests/test-nonblocking-socket-child.c:
* tests/test-nonblocking-socket-main.c, tests/test-open.c:
* tests/test-openat.c, tests/test-pipe.c, tests/test-pipe2.c:
* tests/test-poll.c, tests/test-posix_spawn-chdir.c:
* tests/test-posix_spawn-dup2-stdin.c:
* tests/test-posix_spawn-dup2-stdout.c:
* tests/test-posix_spawn-fchdir.c, tests/test-posix_spawn-open1.c:
* tests/test-posix_spawn-open2.c, tests/test-quotearg-simple.c:
* tests/test-quotearg.c, tests/test-readlink.c:
* tests/test-readlinkat.c, tests/test-readtokens.c:
* tests/test-rename.c, tests/test-renameat.c:
* tests/test-renameatu.c, tests/test-rmdir.c, tests/test-round2.c:
* tests/test-select.h, tests/test-spawn-pipe-child.c:
* tests/test-spawn-pipe-main.c, tests/test-spawn-pipe-script.c:
* tests/test-stack.c, tests/test-stat.c, tests/test-supersede.c:
* tests/test-symlink.c, tests/test-symlinkat.c:
* tests/test-system-quote-main.c:
* tests/test-term-style-control-hello.c:
* tests/test-term-style-control-yes.c, tests/test-timespec.c:
* tests/test-trunc2.c, tests/test-truncf2.c, tests/test-unlink.c:
* tests/test-unlinkat.c, tests/test-userspec.c, tests/test-utime.c:
* tests/test-utimens.c, tests/test-utimensat.c:
* tests/unictype/test-categ_byname.c:
* tests/unigbrk/test-uc-is-grapheme-break.c:
Don’t include stdbool.h.
* modules/acl, modules/xgetcwd:
Don’t depend on stdbool, as these modules don’t use bool.
* modules/argp, modules/bitset, modules/diffseq, modules/file-has-acl:
* modules/gen-uni-tables, modules/getrandom:
* modules/hash-triple-simple, modules/posix_spawn-internal:
* modules/strcasestr, modules/supersede, modules/system-quote:
* modules/uniconv/base, modules/uniname/uniname, modules/utime:
* modules/windows-timedrwlock:
Depend on stdbool, as these modules use bool.
2022-09-10 11:45:08 -05:00
Bernhard Voelker
87e6634b28 license: fix GPLv3 texts to use a comma instead of semicolon.
See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Run:
  $ git grep -l 'Foundation; either version 3' \
      | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'

* All files using GPLv3: Adjust via the above command.
2022-01-05 11:56:23 +01:00
Paul Eggert
eec12c00cf maint: run 'make update-copyright' 2022-01-01 09:44:11 -08:00
Paul Eggert
49782e402f * lib/quotarg.c: remove wrong, unneeded comment 2021-08-01 18:06:59 -07:00
Paul Eggert
7969591f9b quotearg: avoid undefined and/or O(N**2)
Avoid undefined and O(N**2) behavior in some very unlikely cases.
* lib/quotearg.c (quotearg_n_options): Document that N must
be less than MIN (INT_MAX, IDX_MAX), and add this to the
abort test; this also avoids a conditional branch.
Use xpalloc instead of xrealloc, to avoid O(N**2) behavior in
very-unlikely cases.
2021-04-03 20:15:43 -07:00
Paul Eggert
4b94832196 maint: run 'make update-copyright' 2020-12-31 23:30:01 -08:00
Paul Eggert
c08f85d74f attribute: new module
This simplifies use of GCC and C2X attributes like ‘deprecated’.
* MODULES.html.sh: Add attribute.
* doc/attribute.texi, lib/attribute.h, modules/attribute: New files.
* doc/gnulib.texi (Particular Modules): Add Attributes.
* lib/backupfile.c, lib/fnmatch.c, lib/freopen-safer.c:
* lib/mbrtoc32.c, lib/mbrtowc.c, lib/nstrftime.c, lib/quotearg.c:
* lib/savewd.c, lib/unistr/u8-uctomb-aux.c, lib/unistr/u8-uctomb.c:
* lib/vasnprintf.c:
Include attribute.h, and let it define FALLTHROUGH.
* lib/bitset/base.h, lib/c-stack.c (__attribute__): Remove macro.
* lib/bitset/base.h (ATTRIBUTE_UNUSED): Define in terms of
_GL_ATTRIBUTE_MAYBE_UNUSED, for forwards compatibility to C2X.
* lib/dfa.c (FALLTHROUGH): Define consistently with gl_COMMON_BODY.
This is a copy since Gawk doesn’t use Gnulib.
* lib/di-set.h (_GL_ATTRIBUTE_NONNULL): Remove definition that
is incompatible with gl_COMMON_BODY’s.  All uses changed.
* lib/fts.c: Include attribte.h, for FALLTHROUGH.
Keep the existing FALLTHROUGH definition since Glibc might use it,
and it does no harm to Gnulib’s FALLTHROUGH.
* lib/fts_.h, lib/inttostr.h:
(__GNUC_PREREQ): Remove; no longer needed.
(__attribute_warn_unused_result__): Remove.  All uses
replaced by _GL_ATTRIBUTE_NODISCARD.
* lib/gl_list.h, lib/gl_map.h, lib/gl_omap.h, lib/gl_oset.h:
* lib/gl_set.h: Prefer _GL_ATTRIBUTE_NODISCARD to an ifdeffed
__attribute__ ((__warn_unused_result__)), for forward
compatibility to C2X.
* lib/hash.h (_GL_ATTRIBUTE_WUR): Remove.  All uses replaced by
_GL_ATTRIBUTE_NODISCARD.
(_GL_ATTRIBUTE_DEPRECATED): Remove, since gl_COMMON_BODY defines it.
* lib/ino-map.h (_GL_ATTRIBUTE_NONNULL): Remove.  All uses
replaced by gl_COMMON_BODY’s implementation, which has a
slightly different signature.
* lib/safe-alloc.h (_GL_ATTRIBUTE_RETURN_CHECK):
Remove.  All uses replaced by _GL_ATTRIBUTE_NODISCARD.
* lib/unused-parameter.h (_GL_UNUSED_PARAMETER):
Define in terms of _GL_ATTRIBUTE_MAYBE_UNUSED.
No doubt all uses should be replaced, at some point.
* m4/gnulib-common.m4 (_GL_GNUC_PREREQ): New macro.
(_Noreturn): Use it.
(_GL_HAS_ATTRIBUTE, _GL_ATTRIBUTE_ALLOC_SIZE)
(_GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_ARTIFICIAL)
(_GL_ATTRIBUTE_COLD)
(_GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR)
(_GL_ATTRIBUTE_WARNING, _GL_ATTRIBUTE_EXTERNALLY_VISIBLE)
(_GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT)
(_GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MAY_ALIAS)
(_GL_ATTRIBUTE_MAYBE_UNUSED)
(_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE)
(_GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_NONSTRING)
(_GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE)
(_GL_ATTRIBUTE_SENTINEL): New macros.
* modules/backup-rename, modules/backupfile, modules/c-vasnprintf:
* modules/fnmatch, modules/freopen-safer, modules/fts:
* modules/mbrtoc32, modules/mbrtowc, modules/nstrftime:
* modules/quotearg, modules/savewd:
* modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf:
* modules/unistdio/ulc-vasnprintf:
* modules/unistr/u8-uctomb, modules/vasnprintf:
(Depends-on:): Add attribute module.
2020-05-03 13:49:20 -07:00
Paul Eggert
2cdc1bafb2 maint: Run 'make update-copyright' 2019-12-31 16:02:16 -08:00
Paul Eggert
e6633650a2 maint: Run 'make update-copyright' 2019-01-01 00:30:05 +01:00
Bruno Haible
16fc1cdc25 maint: Add encoding marker for Emacs to non-ASCII sources.
Similar to commit f406941a8a
from Paul Eggert <eggert@cs.ucla.edu> 2015-09-24.

To determine the file list that need the marker, I used the command:

for f in `find . -type f | grep -v '^\./\.git/' | grep -v '^\./tests/'`; do
  if iconv -f ASCII -t ASCII < $f > /dev/null 2>&1 ; then : ; else
    if iconv -f UTF-8 -t UTF-8 < $f > /dev/null 2>&1 ; then
      if grep 'The GNU C Library is' $f > /dev/null; then :; else
        if grep 'coding: utf-8' $f > /dev/null; then :; else
          echo $f
        fi
      fi
    fi
  fi
done | LC_ALL=C sort
2018-01-05 22:08:14 +01:00
Paul Eggert
281b825eba maint: Run 'make update-copyright' 2018-01-01 00:58:38 +00:00
Paul Eggert
5675bbfd9a quotearg: pacify compiler re unsigned
* lib/quotearg.c (quotearg_n_options):
Rewrite to avoid diagnostic from overly-picky compiler.
Problem reported by Sami Kerola in:
https://lists.gnu.org/archive/html/bug-gnulib/2017-10/msg00060.html
2017-10-19 13:04:21 -07:00
Bruno Haible
03eac9d394 all: Replace many more http URLs by https URLs. Update stale URLs.
* users.txt: Remove mention of 'newts'.
* lib/localename.c: Update comment about LANG_SOTHO.
2017-09-14 00:35:56 +02:00
Paul Eggert
ca35d46812 all: prefer https: URLs 2017-09-13 00:48:57 -07:00
Jim Meyering
6c720446ab quotearg: fix compilation failure due to FALLTHROUGH misuse
* lib/quotearg.c (quotearg_buffer_restyled): Revert one FALLTHROUGH
macro back to /* fall through */ comment.  The macro can apply only
to a following case statement.  Reported by Assaf Gordon.
2017-05-25 21:26:53 -07:00
Bernhard Voelker
949b6cc651 fallthrough: reinstate a FALLTHROUGH instance in quotearg
quotearg.c: Reinstate this instance which is significant
when the if branch is not taken.
2017-05-22 12:48:31 +01:00
Jim Meyering
11fdf80b21 fallthrough: update for GCC 7/8
* lib/quotearg.c (FALLTHROUGH): New macro.
Use it whenever one switch case falls through into the next,
replacing "/* Fall through */" comments.  This exposed one
instance of an unwarranted "fall through" comment: unwarranted
because it preceded a "goto" label not a case statement.
* lib/freopen-safer.c (freopen_safer): Likewise.
* lib/fts.c (leaf_optimization_applies): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* tests/test-getopt_long.h (getopt_long_loop): Likewise.
* tests/test-tsearch.c (mangle_tree): Likewise.  Also include
tests/macros.h for the definition.
* tests/test-argp.c (group1_parser): Likewise.
* tests/test-getopt.h (getopt_loop): Likewise.
2017-05-19 16:47:09 -07:00
Paul Eggert
a3fd683de3 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2017-01-01 02:59:23 +00:00
Paul Eggert
cb4e027f61 quotearg: pacify GCC better
* modules/quotearg (Depends-on): Add minmax, stdint.
* lib/quotearg.c: Include minmax.h, stdint.h.
(nslots): Now int, as there seems little point to going to extra
work merely to support the INT_MAX slot, which nobody ever uses.
(quotearg_n_options): Redo size-overflow checks to pacify GCC
and to catch (mostly-theoretical) ptrdiff_t problems too.
This can be done via one comparison.
2016-12-15 10:19:48 -08:00
Pádraig Brady
8c70d23709 quotearg: never write beyond the returned length
* lib/quotearg.c (quotearg_buffer_restyled): Switch to a read-only
scan of the string when we initially encounter a single quote when
shell quoting, so that if we then switch to a more concise quoting method
we will not have written beyond that returned length.
This is significant for sh-quote, which has separate routines
to determine the length and do the actual quoting.
* tests/test-quotearg.h: Reinstate the buffer bounds checking
now that we never write more than the returned length.
2016-10-19 06:52:57 -07:00
Pádraig Brady
2ed5c11d9b quotearg: minimize shell quoting using double quotes
I.E. 'it'\''s awkward like this'; "it's better like this"

* lib/quotearg.c (quotearg_buffer_restyled): If an ASCII single
quote in encountered then use double quotes (c style quoting)
when possible, as it simplifies the quoting.
* tests/test-quotearg-simple.c: Add test cases.
* tests/test-quotearg.h (use_quotearg_buffer): Adjust to account
for the fact we now may write beyond the returned length.
2016-10-03 15:12:43 +01:00
Paul Eggert
71090a2a31 version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
2016-01-01 00:57:21 -08:00
Pádraig Brady
3e4ade2720 quotearg: add quotearg_n_style_colon()
This quotes with default options of the specified style,
but with quoting enabled for instances of ':'.

While this can be simulated by temporarily modifying
the default quoting style, this is a little awkward,
and care must be taken with such an implementation
to avoid inlining leading to bloated text.

* lib/quotearg.h (quotearg_n_style_colon): Description and declaration.
* lib/quotearg.c (quotearg_n_style_colon): New function implementation.
2015-11-04 23:11:11 +00:00
Pádraig Brady
77d702067d quotearg: constify get_quoting_style parameters
* lib/quotearg.h (get_quoting_style): Mark parameter as const.
* lib/quotearg.c (get_quoting_style): Likewise.
2015-11-03 11:02:04 +00:00
Pádraig Brady
df3cd2684d quotearg: add support for $'' shell escaping
* lib/quotearg.h: Add "shell-escape" and "shell-escape-always"
items and descriptions.
* lib/quotearg.c (quotearg_buffer_restyled): Add support for the
above types by quoting like "shell", but using $'...' syntax
for non printable characters, which should provide unambiguous
printable output for any input.
* tests/test-quotearg-simple.c: Update accordingly.
2015-11-02 11:32:34 +00:00
Paul Eggert
b9bfe78424 version-etc: new year
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
2014-12-31 17:47:54 -08:00
Paul Eggert
94ee038129 mbsstr, quotearg, xstrtol: pacify IRIX 6.5 cc
These were found when building the latest grep snapshot on IRIX 6.5.
* lib/mbsstr.c (knuth_morris_pratt_multibyte): Break "a=b=c;" into
"b=c; a=b;", since IRIX 6.5 cc complains about the former if b is
never used later.
* lib/quotearg.c (quoting_options_from_style):
* lib/xstrtol.c (__xstrtol):
Use enum instead of 0, to pacify IRIX 6.5 cc.
2014-05-11 00:36:59 -07:00