Main Page | Namespace List | Class List | File List | Class Members | File Members | Related Pages

uint32_unpack.c

Go to the documentation of this file.
00001 #include "uint32.h"
00002 
00003 void uint32_unpack(char s[4],uint32 *u)
00004 {
00005   uint32 result;
00006 
00007   result = (unsigned char) s[3];
00008   result <<= 8;
00009   result += (unsigned char) s[2];
00010   result <<= 8;
00011   result += (unsigned char) s[1];
00012   result <<= 8;
00013   result += (unsigned char) s[0];
00014 
00015   *u = result;
00016 }
00017 
00018 void uint32_unpack_big(char s[4],uint32 *u)
00019 {
00020   uint32 result;
00021 
00022   result = (unsigned char) s[0];
00023   result <<= 8;
00024   result += (unsigned char) s[1];
00025   result <<= 8;
00026   result += (unsigned char) s[2];
00027   result <<= 8;
00028   result += (unsigned char) s[3];
00029 
00030   *u = result;
00031 }

Generated on Mon Apr 26 09:49:22 2004 for ConstantDataStore by doxygen 1.3.6-20040222