Changeset 295 in pacpusframework for branches/0.1.x
- Timestamp:
- Mar 31, 2014, 3:24:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.1.x/include/Pacpus/PacpusTools/BinaryDecoder.h
r126 r295 31 31 #define BINARYDECODER_H 32 32 33 #include "PacpusToolsConfig.h"34 35 33 #ifdef __cplusplus 36 34 extern "C" … … 38 36 #endif // __cplusplus 39 37 38 #include "PacpusToolsConfig.h" 39 40 40 #include <stdio.h> 41 41 … … 768 768 } else { 769 769 *result = 0; 770 return true;770 return false; 771 771 } 772 772 } else { 773 773 // ok data is stored at most in 1 byte 774 774 unsigned char c; 775 c = data[startBit>>3]; // >>3 <=> div 8 776 c >>= (8-((startBit & 0x07)+1)); // &0x07 <=> modulo 8 777 *result = c & getMask8( length ); 775 776 c = data[startBit>>3]; // >>3 <=> div 8 777 //c >>= (8-((startBit & 0x07)+1)); // &0x07 <=> modulo 8 778 c >>= startBit & 0x07 - (length - 1); // &0x07 <=> modulo 8 779 *result = c & getMask8( length ); 778 780 779 781 return true; … … 800 802 } else { 801 803 *result = 0; 802 return true;804 return false; 803 805 } 804 806 }
Note:
See TracChangeset
for help on using the changeset viewer.