Version 3.0

This commit is contained in:
Gary Scavone
2013-09-25 11:21:51 +02:00
committed by Stephen Sinclair
parent 7c0ee03d60
commit 868787a5f9
348 changed files with 12471 additions and 9135 deletions

42
STK/swapstuf.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include "swapstuf.h"
INT32 SwapINT32(INT32 inf)
{
INT32 o;
unsigned char *inp,*outp;
inp=(unsigned char *)&inf;
outp=(unsigned char *)&o;
outp[0]=inp[3]; outp[1]=inp[2]; outp[2]=inp[1]; outp[3]=inp[0];
return(o);
}
INT16 SwapINT16(INT16 inf)
{
INT16 o;
unsigned char *inp,*outp;
inp=(unsigned char *)&inf;
outp=(unsigned char *)&o;
outp[0]=inp[1]; outp[1]=inp[0];
return(o);
}
float SwapFloat(float inf)
{
float o;
unsigned char *inp,*outp;
inp=(unsigned char *)&inf;
outp=(unsigned char *)&o;
outp[0]=inp[3]; outp[1]=inp[2]; outp[2]=inp[1]; outp[3]=inp[0];
return(o);
}
double SwapDouble(double inf)
{
double o;
unsigned char *inp,*outp;
inp=(unsigned char *)&inf;
outp=(unsigned char *)&o;
outp[0]=inp[7]; outp[1]=inp[6]; outp[2]=inp[5]; outp[3]=inp[4];
outp[4]=inp[3]; outp[5]=inp[2]; outp[6]=inp[1]; outp[7]=inp[0];
return(o);
}