Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (NULL == 0) ?



>It is used to determine the size of buffers to store the string
>representation of an integer.  Just grep for 'SIZEOF_LONG \* 8'.

If we change the `8' to `CHAR_BIT' (which will need to be determined at
configuration time if there isn't a limits.h), it would be more
portable.  But we are assuming 8-bit bytes, as well as ASCII, in a lot
of character handling code.

>ntype in struct node has to be at least 32 bit long but it is defined to
>int.  But it would be wasting of memory to use long on systems where int
>has 32 bits and long has 64.

It might be wise to do a configuration check for the smallest type of
at least 32 bits.  There are a number of bitfields that could use
this.

>In hashtable.h it is assumed that sizeof(void*) >= sizeof(long).

We should have a union there, as we do elsewhere.  long and void * are
sufficient, but it might be neater to have some other pointer types too
(it would reduce casting, and would not decrease efficiency).

-zefram




Messages sorted by: Reverse Date, Date, Thread, Author