Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.bin/gencat




On 9 Jul 2009, at 6:32, David Holland wrote:
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/gencat/gencat.c

-       if (ntohl(cat_hdr.__magic) != _NLS_MAGIC)
+       if (ntohl((uint32_t)cat_hdr.__magic) != _NLS_MAGIC)

Yes, it's nasty.

Dare I ask how ntohl is defined on these platforms?

IIRC it is a dummy e.g. something like this:

#define ntohl(x) (x)

I would have expected that routine integer promotions would
make the argument 32bits wide.

The problem was not the width of argument but the fact it is
signed.

If that isn't the case it might be better to adjust how ntohl is
defined...?

Possibly. But I didn't want to change an important global interface,
at least not without prior discussion.

        Kind regards

--
Matthias Scheler                           http://zhadum.org.uk/




Home | Main Index | Thread Index | Old Index