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

2009-07-12 Thread David Holland
On Sun, Jul 12, 2009 at 11:57:20PM +0100, Matthias Scheler wrote: > > Well, discussion time! :-) > > Well, I guess it could look like this on Big Endian ports: > [snip] Yeah. Maybe it should be an inline function? See what I wrote on tech-userlevel, and let's continue there... -- David A.

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

2009-07-12 Thread Matthias Scheler
On Sun, Jul 12, 2009 at 04:41:47PM +, David Holland wrote: > >> 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. > > Well, discussion time! :

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

2009-07-12 Thread David Holland
On Sun, Jul 12, 2009 at 11:30:36AM +0100, Matthias Scheler wrote: >> - 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? > > [...] > > The problem was not the w

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

2009-07-12 Thread Matthias Scheler
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 defi

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

2009-07-09 Thread Izumi Tsutsui
> - if (ntohl(cat_hdr.__magic) != _NLS_MAGIC) > + if (ntohl((uint32_t)cat_hdr.__magic) != _NLS_MAGIC) > > Dare I ask how ntohl is defined on these platforms? I would have > expected that routine integer promotions would make the argument 32 > bits wide. > > If that isn't the case it m

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

2009-07-08 Thread David Holland
On Thu, Apr 16, 2009 at 01:52:52PM +, Matthias Scheler wrote: > Modified Files: > src/usr.bin/gencat: gencat.c > > Log Message: > Fix build problem on big endian ports where ntohl() doesn't convert the > argument to "uint32_t" automatically. > > To generate a diff of this commit: