20 #ifndef OST_IO_SWAP_UTIL_HH
21 #define OST_IO_SWAP_UTIL_HH
32 namespace ost {
namespace io {
36 template <
typename T>
void swap_buf(T* p,
int n);
39 void swap_short(
short int *p,
short int n) {swap_buf<short int>(p,n);}
41 void swap_ushort(
unsigned short int *p,
short int n) {swap_buf<unsigned short int>(p,n);}
43 void swap_int(
int *p,
int n) {swap_buf<int>(p,n);}
51 void swap_long(
long *p,
int n) {swap_buf<long>(p,n);}
59 for(
int k=0;k<n;k++) {
60 a=
reinterpret_cast<unsigned char *
>(&p[k]);
66 }
else if(
sizeof(T)==4) {
73 }
else if(
sizeof(T)==8) {
void swap_double(double *p, int n)
void swap_int(int *p, int n)
void swap_buf(T *p, int n)
void swap_short(short int *p, short int n)
void swap_ushort(unsigned short int *p, short int n)
void swap_uint(uint *p, int n)
void swap_float(float *p, int n)
void swap_long(long *p, int n)