check for my CPU model
Check CPU model. ,.
- Returns
- return value indicates the CPU model found
Definition at line 73 of file bytesex.cc.
References datrw::util::IOUnion< T >::bytes, cpu_Intel, cpu_Motorola, cpu_unknown, DATRW_assert, magic(), and datrw::util::IOUnion< T >::value.
Referenced by main(), datrw::mseed::needswap(), and datrw::mseed::MiniSEEDRecord::readheader().
78 "The integer memory size on this CPU differs from the" 79 "required value of 4");
80 const int& intsize=
sizeof(int);
81 char test_seq[]=
"ABCD";
83 for (
int i=0; i<intsize; i++)
85 u1.bytes[i]=test_seq[i];
86 u2.bytes[i]=test_seq[intsize-i-1];
89 int magnum=
magic(u1.bytes);
91 if (magnum == u1.value)
95 else if (magnum == u2.value)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Ecpu_type
Define different CPU type that are recognized.
int magic(const char *const cmagic)
function to create the magic number