From: <asf...@us...> - 2009-06-11 21:25:30
|
Revision: 927 http://firebird.svn.sourceforge.net/firebird/?rev=927&view=rev Author: asfernandes Date: 2009-06-11 21:25:27 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Fix a problem (from GCC) found with GCC 4.2.3 on AMD64 Modified Paths: -------------- java-plugin/trunk/src/native/jaygds/source/handle_wrappers.cpp Modified: java-plugin/trunk/src/native/jaygds/source/handle_wrappers.cpp =================================================================== --- java-plugin/trunk/src/native/jaygds/source/handle_wrappers.cpp 2009-06-11 21:20:56 UTC (rev 926) +++ java-plugin/trunk/src/native/jaygds/source/handle_wrappers.cpp 2009-06-11 21:25:27 UTC (rev 927) @@ -438,6 +438,20 @@ */ ISC_QUAD JIscBlobHandle::GetIscQuadFromJavaLong(jlong value) { + ISC_QUAD* returnValue = (ISC_QUAD*)&value; + + if( IsLittleEndianByteOrdering() == false ) + { + char* pointerToReturnValue = (char*)returnValue; + + std::reverse(pointerToReturnValue, pointerToReturnValue + sizeof(ISC_QUAD)); + } + + return *returnValue; + + /*** + * ASF: This code is equivalent with the above one, but it was returning incorrect + * result using GCC 4.2.3 with optimizations turned on in AMD64. ISC_QUAD returnValue = *((ISC_QUAD*)&value); if( IsLittleEndianByteOrdering() == false ) @@ -448,6 +462,7 @@ } return returnValue; + ***/ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |