Source-Changes-D archive

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

Re: CVS commit: src/usr.sbin/rtsold



On Mar 18,  9:08pm, david%l8s.co.uk@localhost (David Laight) wrote:
-- Subject: Re: CVS commit: src/usr.sbin/rtsold

| Only if 'long' is smaller than 1000000.

In this particular case with these constants.

| i386 fails on the line:
|     long interval = arc4random() /* uint32_t */ % 1000000;
| If you use 'unsigned long' then amd64 fails a line later doing:
|     xxx.tv_usec = interval / 1000000;
| The compiler should be able to tell that neither of those lines
| is going to cause any problems.

I could have used uint32_t interval and then there would be no complaints.

| There is no reason to force 32bit systems to do unnecessary 64bit maths.

It is not like this case is performance critical.

christos


Home | Main Index | Thread Index | Old Index