Re: svn commit: r1917047 - in /apr/apr/trunk: CHANGES buffer/ buffer/apr_buffer.c build.conf include/apr_buffer.h test/Makefile.in test/Makefile.win test/NWGNUaprtest test/abts_tests.h test/testbuffer.c test/testutil.h

"Graham Leggett via dev" <[email protected]>
Newsgroups gmane.comp.apache.apr.devel
Message-ID <[email protected]>
Hi all,

> +/**
> + * Structure for efficiently tracking a buffer that could contain
> + * a zero terminated string, or a fixed length non zero string.
> + */
> +typedef struct
> +{
> +    /** pointer to the data, which could be a string or a memory block. */
> +    union {
> +        char *str;
> +        void *mem;
> +    } d;
> +
> +    /** size of the data. If positive, the data is of fixed size. If
> +      * negative, the data is zero terminated and the absolute value
> +      * represents the data length including terminating zero.
> +      *
> +      * we use apr_int64_t to make it simple to detect overflow.
> +      */
> +    apr_int64_t size;
> +
> +} apr_buffer_t;

I need some advice on handling Windows 32 bit. apr_int64_t for size is too big, and tests are failing.

Technically apr_ssize_t is the right size, but the definition of ssize_t is [-1, SSIZE_MAX]. I need a signed very big number. Given we define apr_ssize_t, is it ok to use apr_ssize_t anyway?

This is purely an internal detail, outside you just see apr_size_t only (limited to half the size).

Regards,
Graham
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.