[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (c.harding 22613) int vs long in ldapext-ldap-c-api-01



Hi -

The draft new ISO C standard defines a number of integer types of exact and
minimum sizes. Why not use these? The exact 32-bit ones are uint32_t and
int32_t. 

At 15:55 18/11/98 -0800, Kurt D. Zeilenga wrote:
>There are a number of places in the draft uses 'int' instead of a
>sized data type, including:
>	ber_printf 'i' format character, p49
>	ber_scanf 'i' format character, p53.
>
>I believe the encoding/decoding examples would fail on platforms
>where sizeof(int) < 4.  
>
>I would recommend requiring implementations to define the
>following types:
>	typedef unsigned impl_int4 LDAP_UINT4  /* unsigned four octet integer */
>	typedef signed impl_int4 LDAP_SINT4    /* signed four octet integer */
>
>(where impl_int4 would be replaced by the implementation with the
>appropriate platform specific type)  AND that these two types be
>used throughout the API where 4 octet integers are required
>by the underlying protocol.
>
>I would not recommend using 'long' as a substitute for appropriately
>sized typed.  'long' is often too long (impacts performance).
>
>Kurt
>
>
>

Regards,

Chris
+++++

-------------------------------------------------------------------------
           Chris Harding
  T H E    Development Manager
 O P E N   Apex Plaza, Forbury Road, Reading RG1 1AX, UK
G R O U P  Mailto:c.harding@opengroup.org   Ph: +44 118 950 8311 x2262
           WWW: http://www.opengroup.org    Fx: +44 118 950 0110  

OSF/1, Motif, UNIX and the "X" device are registered trademarks in
the US and other countries, and IT DialTone and The Open Group are
trademarks of The Open Group.
-------------------------------------------------------------------------