Changeset 9036 in ntrip for branches/BNC_2.12/src/RTCM3/bits.h


Ignore:
Timestamp:
Aug 27, 2020, 9:36:18 AM (4 years ago)
Author:
stuerze
Message:

some modification to allow encoding and decoding of SSR corrections in RTCM-SSR and IGS-SSR formats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/RTCM3/bits.h

    r6812 r9036  
    2626#define BITS_H
    2727
    28 #define LOADBITS(a) \
    29 { \
    30   while((a) > numbits) \
    31   { \
     28#define LOADBITS(a) { \
     29  while((a) > numbits) { \
    3230    if(!size--) return false; \
    3331    bitfield = (bitfield<<8)|*(data++); \
     
    3836/* extract bits from data stream
    3937   b = variable to store result, a = number of bits */
    40 #define GETBITS64(b, a) \
    41 { \
    42   if(((a) > 56) && ((a)-56) > numbits) \
    43   { \
     38#define GETBITS64(b, a) { \
     39  if(((a) > 56) && ((a)-56) > numbits) { \
    4440    uint64_t x; \
    4541    GETBITS(x, 56) \
     
    4945    numbits -= ((a)-56); \
    5046  } \
    51   else \
    52   { \
     47  else { \
    5348    GETBITS(b, a) \
    5449  } \
     
    5752/* extract bits from data stream
    5853   b = variable to store result, a = number of bits */
    59 #define GETBITS(b, a) \
    60 { \
     54#define GETBITS(b, a) { \
    6155  LOADBITS(a) \
    6256  b = (bitfield<<(64-numbits))>>(64-(a)); \
     
    6660/* extract bits from data stream
    6761   b = variable to store result, a = number of bits */
    68 #define GETBITSFACTOR(b, a, c) \
    69 { \
     62#define GETBITSFACTOR(b, a, c) { \
    7063  LOADBITS(a) \
    7164  b = ((bitfield<<(sizeof(bitfield)*8-numbits))>>(sizeof(bitfield)*8-(a)))*(c); \
     
    7568/* extract floating value from data stream
    7669   b = variable to store result, a = number of bits */
    77 #define GETFLOAT(b, a, c) \
    78 { \
     70#define GETFLOAT(b, a, c) { \
    7971  LOADBITS(a) \
    8072  b = ((double)((bitfield<<(64-numbits))>>(64-(a))))*(c); \
     
    8476/* extract signed floating value from data stream
    8577   b = variable to store result, a = number of bits */
    86 #define GETFLOATSIGN(b, a, c) \
    87 { \
     78#define GETFLOATSIGN(b, a, c) { \
    8879  LOADBITS(a) \
    8980  b = ((double)(((int64_t)(bitfield<<(64-numbits)))>>(64-(a))))*(c); \
     
    9384/* extract bits from data stream
    9485   b = variable to store result, a = number of bits */
    95 #define GETBITSSIGN(b, a) \
    96 { \
     86#define GETBITSSIGN(b, a) { \
    9787  LOADBITS(a) \
    9888  b = ((int64_t)(bitfield<<(64-numbits)))>>(64-(a)); \
     
    10090}
    10191
    102 #define GETFLOATSIGNM(b, a, c) \
    103 { int l; \
     92#define GETFLOATSIGNM(b, a, c) { \
     93  int l; \
    10494  LOADBITS(a) \
    10595  l = (bitfield<<(64-numbits))>>(64-1); \
     
    113103/* extract byte-aligned byte from data stream,
    114104   b = variable to store size, s = variable to store string pointer */
    115 #define GETSTRING(b, s) \
    116 { \
     105#define GETSTRING(b, s) { \
    117106  b = *(data++); \
    118107  s = (char *) data; \
Note: See TracChangeset for help on using the changeset viewer.