Some JMA format and code improvements.
This commit is contained in:
@@ -62,6 +62,7 @@ template <class T> inline T MyMax(T a, T b) {
|
||||
|
||||
|
||||
#define UINT_SIZE (4)
|
||||
#define USHORT_SIZE (2)
|
||||
|
||||
//Convert an array of 4 bytes back into an integer
|
||||
inline unsigned int charp_to_uint(const unsigned char buffer[UINT_SIZE])
|
||||
@@ -73,4 +74,12 @@ inline unsigned int charp_to_uint(const unsigned char buffer[UINT_SIZE])
|
||||
return(num);
|
||||
}
|
||||
|
||||
//Convert an array of 2 bytes back into a short integer
|
||||
inline unsigned short charp_to_ushort(const unsigned char buffer[USHORT_SIZE])
|
||||
{
|
||||
unsigned short num = (unsigned short)buffer[1];
|
||||
num |= ((unsigned short)buffer[0]) << 8;
|
||||
return(num);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user