/* * swabplist.c Jim Piper 10-08-88 */ #include #include #include swabplist(plist) register struct chromplist *plist; { register int i; if (plist != NULL && (plist->number <= 0 || plist->number > MAXOBJS)) { plist->number = swab4(plist->number); plist->otype = swab4(plist->otype); plist->Cotype = swab4(plist->Cotype); plist->Cpgroup = swab4(plist->Cpgroup); plist->pnumber = swab4(plist->pnumber); for (i=0; i<8; i++) plist->history[i] = swab4(plist->history[i]); plist->Ccy = swab4(plist->Ccy); plist->Cbtype = swab2(plist->Cbtype); plist->cy = swab2(plist->cy); plist->dispor = swab2(plist->dispor); plist->cindexa = swab2(plist->cindexa); plist->cindexm = swab2(plist->cindexm); plist->cindexl = swab2(plist->cindexl); for (i=0; i<6; i++) { plist->wdd[i] = swab2(plist->wdd[i]); plist->mwdd[i] = swab2(plist->gwdd[i]); plist->gwdd[i] = swab2(plist->gwdd[i]); } } } static swab4(i) register int i; { register int b1,b2,b3,b4; b1 = (i>>24)&255; b2 = (i>>16)&255; b3 = (i>>8)&255; b4 = i&255; return((b4<<24)|(b3<<16)|(b2<<8)|b1); } static swab2(i) register int i; { register int b1,b2; b1 = (i>>8)&255; b2 = i&255; return((b2<<8)|b1); }