Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Bytes' orde...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 26 of 30 Topic 9591 of 10094
Post > Topic >>

Re: Bytes' order with different C++ compilers

by nickf3 <nickf3@[EMAIL PROTECTED] > May 22, 2008 at 02:58 PM

>
> Ok, thanks to everybody for enlightenment. From all this I
> gather that the only thing you are complaining about wrt
> ntoh functions (at least the interface) is argument passed
> by value instead of by ptr to uchar?
>

And just to make sure this horse is dead - one last kick :)
As far as I understand the standard the following should be true:

255 <= UCHAR_MAX <= 2**CHAR_BIT - 1

with both UCHAR_MAX and CHAR_BIT being defined by implementation.

Then shouldn't ****table version be

  uint32value = (( buf[ipos]   & 0xff ) << 24 ) |
                (( buf[ipos+1] & 0xff ) << 16 ) |
                (( buf[ipos+2] & 0xff ) <<  8 ) |
                 ( buf[ipos+3] & 0xff );
instead?

Thanks.
--
 Nikolai

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 30 Posts in Topic:
Bytes' order with different C++ compilers
Ulysses4ever@[EMAIL PROTE  2008-05-11 16:40:44 
Re: Bytes' order with different C++ compilers
Carl Barron <cbarron41  2008-05-11 21:59:54 
Re: Bytes' order with different C++ compilers
Francis Glassborow <fr  2008-05-13 10:56:10 
Re: Bytes' order with different C++ compilers
Tony Delroy <tony_in_d  2008-05-13 21:14:12 
Re: Bytes' order with different C++ compilers
ThosRTanner <ttanner2@  2008-05-14 15:13:31 
Re: Bytes' order with different C++ compilers
Ulysses4ever@[EMAIL PROTE  2008-05-14 15:13:17 
Re: Bytes' order with different C++ compilers
Francis Glassborow <fr  2008-05-14 18:10:42 
Re: Bytes' order with different C++ compilers
Alan McKenney <alan_mc  2008-05-15 11:17:54 
Re: Bytes' order with different C++ compilers
Bart van Ingen Schenau &l  2008-05-15 16:04:27 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-16 17:48:11 
Re: Bytes' order with different C++ compilers
Alan McKenney <alan_mc  2008-05-16 18:27:29 
Re: Bytes' order with different C++ compilers
nickf3 <nickf3@[EMAIL   2008-05-17 02:29:20 
Re: Bytes' order with different C++ compilers
Bart van Ingen Schenau &l  2008-05-17 14:35:47 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-17 23:21:56 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-17 23:21:45 
Re: Bytes' order with different C++ compilers
Greg Herlihy <greghe@[  2008-05-19 06:05:51 
Re: Bytes' order with different C++ compilers
nickf3 <nickf3@[EMAIL   2008-05-19 11:59:02 
Re: Bytes' order with different C++ compilers
Alan McKenney <alan_mc  2008-05-19 12:00:38 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-20 05:14:57 
Re: Bytes' order with different C++ compilers
nickf3 <nickf3@[EMAIL   2008-05-21 01:22:18 
Re: Bytes' order with different C++ compilers
"C. M. Heard" &  2008-05-21 01:28:17 
Re: Bytes' order with different C++ compilers
Alan McKenney <alan_mc  2008-05-21 14:03:42 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-21 14:01:51 
Re: Bytes' order with different C++ compilers
Bart van Ingen Schenau &l  2008-05-21 14:27:32 
Re: Bytes' order with different C++ compilers
nickf3 <nickf3@[EMAIL   2008-05-22 01:14:57 
Re: Bytes' order with different C++ compilers
nickf3 <nickf3@[EMAIL   2008-05-22 14:58:37 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-24 09:28:08 
Re: Bytes' order with different C++ compilers
Gerhard Fiedler <gelis  2008-05-25 09:57:35 
Re: Bytes' order with different C++ compilers
Martin Bonner <martinf  2008-05-26 16:16:35 
Re: Bytes' order with different C++ compilers
Gerhard Fiedler <gelis  2008-05-28 10:41:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:26:51 CDT 2008.