Changeset 2860 in ntrip


Ignore:
Timestamp:
Jan 19, 2011, 11:06:41 AM (13 years ago)
Author:
stoecker
Message:

64 bit fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/rtcm3torinex/lib/rtcm3torinex.c

    r2850 r2860  
    131131    bitfield = (bitfield<<8)|*(data++); \
    132132    numbits += 8; \
     133  } \
     134}
     135
     136/* extract bits from data stream
     137   b = variable to store result, a = number of bits */
     138#define GETBITS64(b, a) \
     139{ \
     140  if(((a) > 56) && ((a)-56) > numbits) \
     141  { \
     142    uint64_t x; \
     143    GETBITS(x, 56) \
     144    LOADBITS((a)-56) \
     145    b = ((x<<((a)-56)) | (bitfield<<(sizeof(bitfield)*8-numbits)) \
     146    >>(sizeof(bitfield)*8-((a)-56))); \
     147    numbits -= ((a)-56); \
     148  } \
     149  else \
     150  { \
     151    GETBITS(b, a) \
    133152  } \
    134153}
     
    10601079        GETBITS(syncf, 1)
    10611080        SKIPBITS(3+7+1)
    1062         GETBITS(satmask, RTCM3_MSM_NUMSAT)
     1081        GETBITS64(satmask, RTCM3_MSM_NUMSAT)
    10631082
    10641083        /* http://gurmeetsingh.wordpress.com/2008/08/05/fast-bit-counting-routines/ */
     
    10691088          ++numsig;
    10701089        i = numsat*numsig;
    1071         GETBITS(cellmask, (unsigned)i)
     1090        GETBITS64(cellmask, (unsigned)i)
    10721091
    10731092        switch(type % 10)
Note: See TracChangeset for help on using the changeset viewer.