apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@haxent.com.br>
Subject Re: svn commit: r553679 - /apr/apr/trunk/strings/apr_snprintf.c
Date Fri, 06 Jul 2007 11:51:38 GMT
Joe Orton wrote:
> On Fri, Jul 06, 2007 at 12:46:53AM -0000, Davi Arnaut wrote:
>> Author: davi
>> Date: Thu Jul  5 17:46:53 2007
>> New Revision: 553679
>> URL: http://svn.apache.org/viewvc?view=rev&rev=553679
>> Log:
>> Convert wide* types to the portable apr types. Conversion table:
>> wide_int        apr_int32_t
>> u_wide_int      apr_uint32_t
>> widest_int      apr_int64_t
>> u_widest_int    apr_uint64_t
>> bool_int        int
> Are these wide_int -> int32_t changes correct?  wide_int was long before 
> and is now always 32-bit.

When I made the patch, it seemed to be correct because the format checks
using IS_LONG were based upon APR_INT64_T_FMT.

> Also the *INT32_MAX types are from C99 stdint.h which might not be present.

Good catch, I guess we could use *INT_MAX. This begs the question: why
don't we have APR_*INT32_MIN/MAX? Should be pretty straight forward:


#define APR_UINT32_MAX	0xffffffffU
#define APR_UINT64_MAX  0xffffffffffffffffULL

autoconf logic:
	try to figure out from limits.h [1]
	try to figure out from stdint.h
	if none worked, use defaults.


#include <limits.h>

#define stringify(x) #x
#define to_string(x) stringify(x)

int main()
    /* also check if different from default */
    printf("%s\n", to_string(ULONG_MAX));
    return 0;

Ok, that's pretty creative.. but should work.

Davi Arnaut

View raw message