Ignore:
Timestamp:
Mar 23, 2009 12:55:00 PM (15 years ago)
Author:
bennylp
Message:

Ticket #752: backported changes from ticket #751

Location:
pjproject/branches/1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0

  • pjproject/branches/1.0/pjlib-util/src/pjlib-util/crc32.c

    r1731 r2530  
    2323#define CRC32_INDEX(c)      (c & 0xff) 
    2424#define CRC32_SHIFTED(c)    (c >> 8) 
     25#define CRC32_SWAP(c)       (c) 
    2526 
    2627static const pj_uint32_t crc_tab[] = { 
     
    8384#define CRC32_INDEX(c)      (c >> 24) 
    8485#define CRC32_SHIFTED(c)    (c << 8) 
     86#define CRC32_SWAP(c)       ((((c) & 0xff000000) >> 24) | \ 
     87                             (((c) & 0x00ff0000) >>  8) | \ 
     88                             (((c) & 0x0000ff00) <<  8) | \ 
     89                             (((c) & 0x000000ff) << 24)) 
    8590 
    8691static const pj_uint32_t crc_tab[] = { 
     
    180185PJ_DEF(pj_uint32_t) pj_crc32_final(pj_crc32_context *ctx) 
    181186{ 
    182     return ctx->crc_state; 
     187    return CRC32_SWAP(ctx->crc_state); 
    183188} 
    184189 
Note: See TracChangeset for help on using the changeset viewer.