$FreeBSD$ --- ../../deploy/src/plugin/solaris/common/CReadBuffer.cpp 10 Oct 2007 17:38:54 -0000 1.2 +++ ../../deploy/src/plugin/solaris/common/CReadBuffer.cpp 2 Jul 2008 23:01:41 -0000 @@ -14,21 +14,21 @@ } int CReadBuffer::getInt(int * x) { - char buff[4]; int rv = getIt(buff, 4); int result = (buff[0] << 24) | ((buff[1] << 16) & 0xFF0000) | ((buff[2] << 8) & 0xFF00) | (buff[3] & 0xFF); + *x = result; return rv; } int CReadBuffer::getJLong(jlong * x) { - char buff[8]; int rv = getIt(buff, 8); + jlong result = ((jlong)buff[0] << 56) | (((jlong)buff[1] << 48) & 0xFF000000000000LL) | (((jlong)buff[2] << 40) & 0xFF0000000000LL) | @@ -37,16 +37,22 @@ (((jlong)buff[5] << 16) & 0xFF0000LL) | (((jlong)buff[6] << 8) & 0xFF00LL) | ((jlong)buff[7] & 0xFFLL); + *x = result; return rv; } -int CReadBuffer::getShort(short * x) { +int CReadBuffer::getJLong(long long * x) { + + getJLong((jlong *)x); +} +int CReadBuffer::getShort(short * x) { char buff[2]; int rv = getIt(buff, 2); short result = (buff[0] << 8) | (buff[1] & 0xFF); + *x = result; return rv; } --- ../../deploy/src/plugin/solaris/common/CReadBuffer.h 10 Oct 2007 17:38:54 -0000 1.2 +++ ../../deploy/src/plugin/solaris/common/CReadBuffer.h 2 Jul 2008 23:01:41 -0000 @@ -14,6 +14,7 @@ CReadBuffer(int); int getInt(int *); int getJLong(jlong *); + int getJLong(long long *); int getShort(short *); int getString(char **); int getByte(char *); --- ../../deploy/src/plugin/solaris/common/CWriteBuffer.cpp 10 Oct 2007 17:38:54 -0000 1.2 +++ ../../deploy/src/plugin/solaris/common/CWriteBuffer.cpp 2 Jul 2008 23:01:41 -0000 @@ -21,6 +21,7 @@ } void CWriteBuffer::putInt(int x) { + checkBuffSize(4); m_buff[m_data_length++] = (x >> 24) & 0xFF; m_buff[m_data_length++] = (x >> 16) & 0xFF; @@ -30,6 +31,7 @@ } void CWriteBuffer::putJLong(jlong x) { + checkBuffSize(8); m_buff[m_data_length++] = (x >> 56) & 0xFF; m_buff[m_data_length++] = (x >> 48) & 0xFF; @@ -41,6 +43,11 @@ m_buff[m_data_length++] = x & 0xFF; } +void CWriteBuffer::putJLong(long long x) { + + putJLong((jlong)x); +} + void CWriteBuffer::putShort(short x) { checkBuffSize(2); --- ../../deploy/src/plugin/solaris/common/CWriteBuffer.h 10 Oct 2007 17:38:54 -0000 1.2 +++ ../../deploy/src/plugin/solaris/common/CWriteBuffer.h 2 Jul 2008 23:01:41 -0000 @@ -19,6 +19,7 @@ ~CWriteBuffer(); void putInt(int x); void putJLong(jlong x); + void putJLong(long long x); void putShort(short x); void putString(const char *); void putString(const char *, int length);