On Mon, Feb 26, 2007 at 05:38:55PM +0100, Paolo Bonzini wrote: > > >In the autogen sources it appears to be named SNV_ASSERT_FCN. In the > >libsnprintfv repository, it's named SNV_ASSERT_FMT - just grep for it. > >Which one should it be? Can't have half and half. > > FCN seems more meaningful.
Bruce agrees, I agree... let's do that. I've checked this in. I also had to revert one of the line wrapping changes - the doc generation script relies on having argument descriptions all on one line, or the formatting of the manual gets messed up. -- Daniel Jacobowitz CodeSourcery 2007-02-26 Daniel Jacobowitz <[EMAIL PROTECTED]> * snprintfv/compat.h (SNV_ASSERT_FMT): Rename to... (SNV_ASSERT_FCN): ...this. Update users. * snprintfv/custom.c, snprintfv/format.c: Let compat.h handle runetype.h and wchar.h. * snprintfv/mem.h (SNV_SCOPE): Delete. (snv_malloc, snv_realloc, snv_free): Do not use it. * snprintfv/printf.c: Keep argument descriptions on one line. * doc/printf.texi: Regenerated. Index: doc/printf.texi =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/doc/printf.texi,v retrieving revision 1.1 diff -u -p -r1.1 printf.texi --- doc/printf.texi 3 Dec 2003 15:06:03 -0000 1.1 +++ doc/printf.texi 26 Feb 2007 16:59:04 -0000 @@ -58,7 +58,7 @@ the handler function to tell %printf abo the user data for the specifier, accessible to the handler function @end table -This is returned by register_printf_function. +This is returned by register_printf_function. @end deffn @@ -771,7 +771,7 @@ there is an error. Yes, this interface is cumbersome and totally useless. It would have been better to simply return the allocated address, but -it turns out that somebody wasn't thinking much when adding +it turns out that somebody wasn't thinking much when adding asprintf to libiberty a few years ago. Index: snprintfv/compat.h =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/snprintfv/compat.h,v retrieving revision 1.2 diff -u -p -r1.2 compat.h --- snprintfv/compat.h 25 Feb 2007 14:45:02 -0000 1.2 +++ snprintfv/compat.h 26 Feb 2007 16:59:04 -0000 @@ -162,11 +162,11 @@ typedef enum { SNV_FALSE = 0, SNV_TRUE = args __attribute__((format (printf, format_idx, arg_idx))) # define SNV_GNUC_NORETURN \ __attribute__((noreturn)) -# define SNV_ASSERT_FMT " (", __PRETTY_FUNCTION__, ")" +# define SNV_ASSERT_FCN " (", __PRETTY_FUNCTION__, ")" #else /* !__GNUC__ */ # define SNV_GNUC_PRINTF( args, format_idx, arg_idx ) args # define SNV_GNUC_NORETURN -# define SNV_ASSERT_FMT "", "", "" +# define SNV_ASSERT_FCN "", "", "" #endif /* !__GNUC__ */ #define snv_assert(expr) snv_fassert(stderr, expr) @@ -174,7 +174,7 @@ typedef enum { SNV_FALSE = 0, SNV_TRUE = if (!(expr)) \ { \ fprintf (stream, "file %s: line %d%s%s%s: assertion \"%s\" failed.\n", \ - __FILE__, __LINE__, SNV_ASSERT_FMT, SNV_STR(expr)); \ + __FILE__, __LINE__, SNV_ASSERT_FCN, SNV_STR(expr)); \ exit(EXIT_FAILURE); \ }; }SNV_STMT_END @@ -183,7 +183,7 @@ typedef enum { SNV_FALSE = 0, SNV_TRUE = if (!(expr)) \ { \ fprintf (stream, "file %s: line %d%s%s%s: assertion \"%s\" failed.\n", \ - __FILE__, __LINE__, SNV_ASSERT_FMT, SNV_STR(expr)); \ + __FILE__, __LINE__, SNV_ASSERT_FCN, SNV_STR(expr)); \ return; \ }; }SNV_STMT_END @@ -192,7 +192,7 @@ typedef enum { SNV_FALSE = 0, SNV_TRUE = if (!(expr)) \ { \ fprintf (stream, "file %s: line %d%s%s%s: assertion \"%s\" failed.\n", \ - __FILE__, __LINE__, SNV_ASSERT_FMT, SNV_STR(expr)); \ + __FILE__, __LINE__, SNV_ASSERT_FCN, SNV_STR(expr)); \ return val; \ }; }SNV_STMT_END Index: snprintfv/custom.c =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/snprintfv/custom.c,v retrieving revision 1.3 diff -u -p -r1.3 custom.c --- snprintfv/custom.c 25 Feb 2007 21:01:05 -0000 1.3 +++ snprintfv/custom.c 26 Feb 2007 16:59:04 -0000 @@ -37,14 +37,6 @@ #include <stddef.h> -#if HAVE_RUNETYPE_H -# include <runetype.h> -#endif - -#ifdef HAVE_WCHAR_H -# include <wchar.h> -#endif - #include "printf.h" Index: snprintfv/format.c =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/snprintfv/format.c,v retrieving revision 1.7 diff -u -p -r1.7 format.c --- snprintfv/format.c 25 Feb 2007 21:01:05 -0000 1.7 +++ snprintfv/format.c 26 Feb 2007 16:59:04 -0000 @@ -39,14 +39,6 @@ #include <math.h> #include <stddef.h> -#if HAVE_RUNETYPE_H -# include <runetype.h> -#endif - -#ifdef HAVE_WCHAR_H -# include <wchar.h> -#endif - #include "printf.h" #ifndef NO_FLOAT_PRINTING Index: snprintfv/mem.h =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/snprintfv/mem.h,v retrieving revision 1.7 diff -u -p -r1.7 mem.h --- snprintfv/mem.h 25 Feb 2007 21:01:05 -0000 1.7 +++ snprintfv/mem.h 26 Feb 2007 16:59:04 -0000 @@ -36,18 +36,6 @@ # include <dmalloc.h> #endif -#ifdef _WIN32 -# ifdef DLL_EXPORT -# define SNV_SCOPE extern __declspec(dllexport) -# else -# ifdef LIBSNPRINTFV_DLL_IMPORT -# define SNV_SCOPE extern __declspec(dllimport) -# endif -# endif -#else -# define SNV_SCOPE extern -#endif - /* This is the API we use throughout libsnprintfv. */ #define snv_new(type, count) \ ((type*)snv_malloc((size_t)sizeof(type) * (count))) @@ -76,7 +64,7 @@ typedef void* (free_proc_t )(snv_point * Return value: * The pointer to the newly-allocated memory area. */ -SNV_SCOPE malloc_proc_t *snv_malloc; +malloc_proc_t *snv_malloc; /** * snv_realloc: @@ -90,7 +78,7 @@ SNV_SCOPE malloc_proc_t *snv_malloc; * The pointer to the newly-allocated memory area, possibly * the same as @old. */ -SNV_SCOPE realloc_proc_t *snv_realloc; +realloc_proc_t *snv_realloc; /** * snv_free: @@ -98,7 +86,7 @@ SNV_SCOPE realloc_proc_t *snv_realloc; * * Frees a block of memory pointed to by @old. */ -SNV_SCOPE free_proc_t *snv_free; +free_proc_t *snv_free; /* And these are reimplemented tout court because they are not fully portable. */ Index: snprintfv/printf.c =================================================================== RCS file: /sources/libsnprintfv/libsnprintfv/snprintfv/printf.c,v retrieving revision 1.3 diff -u -p -r1.3 printf.c --- snprintfv/printf.c 25 Feb 2007 21:01:05 -0000 1.3 +++ snprintfv/printf.c 26 Feb 2007 16:59:04 -0000 @@ -120,8 +120,7 @@ spec_lookup (unsigned spec) * register_printf_function: printf.h * @spec: the character which will trigger @func, cast to an unsigned int. * @fmt: the handler function to actually print the arguments to the specifier - * @arg: the handler function to tell %printf about the types of the arguments - * to the specifier + * @arg: the handler function to tell %printf about the types of the arguments to the specifier * * Register the pair made of @fmt and @arg, so that it is called * when @spec is encountered in a format string.