Star.cpp   Star.cpp 
skipping to change at line 47 skipping to change at line 47
if (!sciName.isEmpty()) return sciName; if (!sciName.isEmpty()) return sciName;
return QString("HP %1").arg(hip); return QString("HP %1").arg(hip);
} }
} }
return ""; return "";
} }
static static
int UnpackBits(bool fromBe,const char *addr,int bits_begin, int UnpackBits(bool fromBe,const char *addr,int bits_begin,
const int bits_size) { const int bits_size) {
assert(bits_size <= 32); Q_ASSERT(bits_size <= 32);
while (bits_begin >= 8) { while (bits_begin >= 8) {
bits_begin -= 8; bits_begin -= 8;
addr++; addr++;
} }
const int bits_end = bits_begin + bits_size; const int bits_end = bits_begin + bits_size;
int rval; int rval;
if (fromBe) { if (fromBe) {
rval = (int)((( (( (((unsigned int)(unsigned char)(addr[0])) << 8) | rval = (int)((( (( (((unsigned int)(unsigned char)(addr[0])) << 8) |
((unsigned int)(unsigned char)(addr[1]))) << 8) | ((unsigned int)(unsigned char)(addr[1]))) << 8) |
((unsigned int)(unsigned char)(addr[2]))) << 8) | ((unsigned int)(unsigned char)(addr[2]))) << 8) |
skipping to change at line 90 skipping to change at line 90
rval = ((unsigned int)rval) >> bits_begin; rval = ((unsigned int)rval) >> bits_begin;
rval |= rval_hi; rval |= rval_hi;
} }
} }
return rval; return rval;
} }
static static
unsigned int UnpackUBits(bool fromBe,const char *addr,int bits_begin, unsigned int UnpackUBits(bool fromBe,const char *addr,int bits_begin,
const int bits_size) { const int bits_size) {
assert(bits_size <= 32); Q_ASSERT(bits_size <= 32);
while (bits_begin >= 8) { while (bits_begin >= 8) {
bits_begin -= 8; bits_begin -= 8;
addr++; addr++;
} }
const int bits_end = bits_begin + bits_size; const int bits_end = bits_begin + bits_size;
unsigned int rval; unsigned int rval;
if (fromBe) { if (fromBe) {
rval = (( (( (((unsigned int)(unsigned char)(addr[0])) << 8) | rval = (( (( (((unsigned int)(unsigned char)(addr[0])) << 8) |
((unsigned int)(unsigned char)(addr[1]))) << 8) | ((unsigned int)(unsigned char)(addr[1]))) << 8) |
((unsigned int)(unsigned char)(addr[2]))) << 8) | ((unsigned int)(unsigned char)(addr[2]))) << 8) |
skipping to change at line 140 skipping to change at line 140
const int _hip = UnpackBits(fromBe,(const char*)this, 0,24); const int _hip = UnpackBits(fromBe,(const char*)this, 0,24);
const unsigned int _cids = UnpackUBits(fromBe,(const char*)this,24, 8); const unsigned int _cids = UnpackUBits(fromBe,(const char*)this,24, 8);
const int _x0 = UnpackBits(fromBe,(const char*)this,32,32); const int _x0 = UnpackBits(fromBe,(const char*)this,32,32);
const int _x1 = UnpackBits(fromBe,(const char*)this,64,32); const int _x1 = UnpackBits(fromBe,(const char*)this,64,32);
const unsigned int _bV = UnpackUBits(fromBe,(const char*)this, 96, 8); const unsigned int _bV = UnpackUBits(fromBe,(const char*)this, 96, 8);
const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,104, 8); const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,104, 8);
const unsigned int _spInt = UnpackUBits(fromBe,(const char*)this,112,16); const unsigned int _spInt = UnpackUBits(fromBe,(const char*)this,112,16);
const int _dx0 = UnpackBits(fromBe,(const char*)this,128,32); const int _dx0 = UnpackBits(fromBe,(const char*)this,128,32);
const int _dx1 = UnpackBits(fromBe,(const char*)this,160,32); const int _dx1 = UnpackBits(fromBe,(const char*)this,160,32);
const int _plx = UnpackBits(fromBe,(const char*)this,192,32); const int _plx = UnpackBits(fromBe,(const char*)this,192,32);
//assert(hip == _hip); //Q_ASSERT(hip == _hip);
//assert(componentIds == _cids); //Q_ASSERT(componentIds == _cids);
//assert(x0 == _x0); //Q_ASSERT(x0 == _x0);
//assert(x1 == _x1); //Q_ASSERT(x1 == _x1);
//assert(bV == _bV); //Q_ASSERT(bV == _bV);
//assert(mag == _mag); //Q_ASSERT(mag == _mag);
//assert(spInt == _spInt); //Q_ASSERT(spInt == _spInt);
//assert(dx0 == _dx0); //Q_ASSERT(dx0 == _dx0);
//assert(dx1 == _dx1); //Q_ASSERT(dx1 == _dx1);
//assert(plx == _plx); //Q_ASSERT(plx == _plx);
hip = _hip; hip = _hip;
componentIds = _cids; componentIds = _cids;
x0 = _x0; x0 = _x0;
x1 = _x1; x1 = _x1;
bV = _bV; bV = _bV;
mag = _mag; mag = _mag;
spInt = _spInt; spInt = _spInt;
dx0 = _dx0; dx0 = _dx0;
dx1 = _dx1; dx1 = _dx1;
plx = _plx; plx = _plx;
skipping to change at line 182 skipping to change at line 182
<< ", plx: " << plx; << ", plx: " << plx;
} }
void Star2::repack(bool fromBe) { void Star2::repack(bool fromBe) {
const int _x0 = UnpackBits(fromBe,(const char*)this, 0,20); const int _x0 = UnpackBits(fromBe,(const char*)this, 0,20);
const int _x1 = UnpackBits(fromBe,(const char*)this,20,20); const int _x1 = UnpackBits(fromBe,(const char*)this,20,20);
const int _dx0 = UnpackBits(fromBe,(const char*)this,40,14); const int _dx0 = UnpackBits(fromBe,(const char*)this,40,14);
const int _dx1 = UnpackBits(fromBe,(const char*)this,54,14); const int _dx1 = UnpackBits(fromBe,(const char*)this,54,14);
const unsigned int _bV = UnpackUBits(fromBe,(const char*)this,68, 7); const unsigned int _bV = UnpackUBits(fromBe,(const char*)this,68, 7);
const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,75, 5); const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,75, 5);
//assert(x0 == _x0); //Q_ASSERT(x0 == _x0);
//assert(x1 == _x1); //Q_ASSERT(x1 == _x1);
//assert(dx0 == _dx0); //Q_ASSERT(dx0 == _dx0);
//assert(dx1 == _dx1); //Q_ASSERT(dx1 == _dx1);
//assert(bV == _bV); //Q_ASSERT(bV == _bV);
//assert(mag == _mag); //Q_ASSERT(mag == _mag);
x0 = _x0; x0 = _x0;
x1 = _x1; x1 = _x1;
dx0 = _dx0; dx0 = _dx0;
dx1 = _dx1; dx1 = _dx1;
bV = _bV; bV = _bV;
mag = _mag; mag = _mag;
} }
void Star2::print(void) { void Star2::print(void) {
qDebug() << "x0: " << x0 qDebug() << "x0: " << x0
skipping to change at line 210 skipping to change at line 210
<< ", dx1: " << dx1 << ", dx1: " << dx1
<< ", bV: " << bV << ", bV: " << bV
<< ", mag: " << mag; << ", mag: " << mag;
} }
void Star3::repack(bool fromBe) { void Star3::repack(bool fromBe) {
const int _x0 = UnpackBits(fromBe,(const char*)this, 0,18); const int _x0 = UnpackBits(fromBe,(const char*)this, 0,18);
const int _x1 = UnpackBits(fromBe,(const char*)this,18,18); const int _x1 = UnpackBits(fromBe,(const char*)this,18,18);
const unsigned int _bV = UnpackUBits(fromBe,(const char*)this,36, 7); const unsigned int _bV = UnpackUBits(fromBe,(const char*)this,36, 7);
const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,43, 5); const unsigned int _mag = UnpackUBits(fromBe,(const char*)this,43, 5);
//assert(x0 == _x0); //Q_ASSERT(x0 == _x0);
//assert(x1 == _x1); //Q_ASSERT(x1 == _x1);
//assert(bV == _bV); //Q_ASSERT(bV == _bV);
//assert(mag == _mag); //Q_ASSERT(mag == _mag);
x0 = _x0; x0 = _x0;
x1 = _x1; x1 = _x1;
bV = _bV; bV = _bV;
mag = _mag; mag = _mag;
} }
void Star3::print(void) { void Star3::print(void) {
qDebug() << "x0: " << x0 qDebug() << "x0: " << x0
<< ", x1: " << x1 << ", x1: " << x1
<< ", bV: " << bV << ", bV: " << bV
 End of changes. 5 change blocks. 
22 lines changed or deleted 22 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/