Changeset 8651

Show
Ignore:
Timestamp:
02/03/09 19:38:40 (4 years ago)
Author:
ttsou
Message:

cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/ttsou/dist/components/packer/packer.cpp

    r8637 r8651  
    112112 
    113113    PortTypes::ShortSequence *i_in(NULL), *q_in(NULL); 
    114     CORBA::UShort in_len; 
     114    unsigned int short_sz = sizeof (CORBA::Short); 
     115    unsigned int in_len; 
    115116    unsigned int out_idx(0); 
    116117    unsigned int bit_shift(0); 
    117     unsigned int pkt_size(100); 
     118    unsigned int pkt_size(512 / short_sz); 
    118119    bool flag = false; 
    119120    PortTypes::ShortSequence i_out(pkt_size), q_out(pkt_size); 
     
    127128                i_out[out_idx] = i_out[out_idx] | ( ((*i_in)[i] & 0x1) << bit_shift++ ); 
    128129 
    129                 // Too lazy right now to change Short interface... 
    130                 if (bit_shift == 16) { 
     130                if (bit_shift == short_sz) { 
    131131                    bit_shift = 0; 
    132132                    out_idx++; 
     
    140140            } 
    141141 
    142             else if ( ((*q_in)[i] & 0x1) == 1) { 
     142            else if ( ((*q_in)[i] & 0x1) == 0x1) { 
    143143                flag = true; 
    144144            }