summaryrefslogtreecommitdiff
path: root/lib/uinttostr.c
Commit message (Collapse)AuthorAgeFilesLines
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-0/+17
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* inttostr: simplify by removing unnecessary redundancyPaul Eggert2010-10-241-1/+0
| | | | | | | | | | | * lib/anytostr.c: Don't include verify.h. (anytostr): Don't verify that TYPE_SIGNED (inttype) equals inttype_is_signed. Instead, disable the bogus GCC warnings, so that there's no need for inttype_is_signed and for calling TYPE_SIGNED. * lib/imaxtostr.c (inttype_is_signed): Remove; no longer needed. * lib/inttostr.c, lib/offtostr.c, lib/uinttostr.c, lib/umaxtostr.c: Likewise. * modules/inttostr (Depends-on): Remove 'verify'.
* inttostr: revert most-recent changePaul Eggert2010-10-221-0/+1
|
* inttostr: simplify by removing unnecessary redundancyPaul Eggert2010-10-221-1/+0
| | | | | | | | | | | | | * lib/anytostr.c: Don't include verify.h. (anytostr): Don't verify that TYPE_SIGNED (inttype) equals inttype_is_signed. Instead, use TYPE_SIGNED (inttype) directly. This removes the need for inttype_is_signed, which was put in to suppress some GCC warnings about conversions. This rewrite should also suppress those warnings. * lib/imaxtostr.c (inttype_is_signed): Remove; no longer needed. * lib/inttostr.c, lib/offtostr.c, lib/uinttostr.c, lib/umaxtostr.c: Likewise. * modules/inttostr (Depends-on): Remove 'verify'.
* inttostr: add a new function, inttostr, and testsJim Meyering2010-06-101-2/+2
| | | | | | | | | | | | | | | | | The namesake function was not available. The existence of the template file, inttostr.c makes its addition nontrivial. * lib/anytostr.c: Rename from inttostr.c. (anytostr): Rename from inttostr. * lib/inttostr.c: New file. * modules/inttostr (Files): Add anytostr.c. (Makefile.am): Set lib_SOURCES instead of ... * m4/inttostr.m4: Remove uses of AC_LIBOBJ. * lib/imaxtostr.c: Update use. s/inttostr/anytostr/ * lib/offtostr.c: Likewise. * lib/uinttostr.c: Likewise. * lib/umaxtostr.c: Likewise. * modules/inttostr-tests: New file. * tests/test-inttostr.c: New file. Test these functions.
* inttostr: aesthetics and improved (compile-time) safetyJim Meyering2009-10-311-1/+1
| | | | | | | | | | | | | Define inttype_is_signed rather than inttype_is_unsigned, since the sole use is via "#if inttype_is_signed". * lib/imaxtostr.c (inttype_is_signed): Define this, rather than inttype_is_unsigned. * lib/offtostr.c (inttype_is_signed): Likewise. * lib/uinttostr.c (inttype_is_signed): Likewise. * lib/umaxtostr.c (inttype_is_signed): Likewise. * lib/inttostr.c (inttostr): Use verify to cross-check the inttype_is_signed value and the signedness of the actual type. * modules/inttostr (Depends-on): Add verify.
* build: avoid compiler warningsEric Blake2009-10-301-0/+1
| | | | | | | | | | | | * lib/fchmodat.c (lchmod): Mark unused variables. * lib/getopt.c (_getopt_initialize): Likewise. * lib/mktime.c (__mktime_internal): Provide prototype. * lib/inttostr.c (inttostr): Avoid compiler warning even with older gcc that do not understand #pragma GCC diagnostic. * lib/uinttostr.c (inttype_is_unsigned): Define. * lib/umaxtostr.c (inttype_is_unsigned): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* * lib/getaddrinfo.c (getnameinfo): Use new lightweight uinttostr,Jim Meyering2006-10-231-0/+3
in place of snprintf. * modules/inttostr (Files): Add lib/uinttostr.c. * lib/uinttostr.c (inttostr): New file/function. * lib/inttostr.h (uinttostr): Declare. * m4/inttostr.m4: Add AC_LIBOBJ([uinttostr]). * MODULES.html.sh (Numeric conversion functions <stdlib.h>): Add uinttostr. * modules/getaddrinfo (Depends-on): Remove snprintf. Add inttostr.