Go to the documentation of this file.00001
00008 #ifndef LONG_MANIP_HH
00009 #define LONG_MANIP_HH
00010
00019 namespace my_lib{
00020
00025 void byte_print(long l);
00031 void byte_swap(void* p, void* q);
00032
00041 inline
00042 void big_to_little(long& l) {
00043 unsigned char* p=(unsigned char*)&l;
00044 for(unsigned i=0; i<sizeof(long)/2; ++i)
00045 byte_swap(p+i, p+(sizeof(long)-1)-i);
00046 }
00047 }
00048 #endif // LONG_MANIP_HH