Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 51912 invoked from network); 28 Jun 2007 14:36:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 14:36:03 -0000 Received: (qmail 2045 invoked by uid 500); 28 Jun 2007 14:36:01 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 1986 invoked by uid 500); 28 Jun 2007 14:36:01 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 1930 invoked by uid 99); 28 Jun 2007 14:36:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:36:01 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:35:57 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D0A6F1A981A; Thu, 28 Jun 2007 07:35:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r551577 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp Date: Thu, 28 Jun 2007 14:35:36 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070628143536.D0A6F1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Thu Jun 28 07:35:35 2007 New Revision: 551577 URL: http://svn.apache.org/viewvc?view=rev&rev=551577 Log: http://issues.apache.org/activemq/browse/AMQCPP-103 Building Decaf lib Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp?view=diff&rev=551577&r1=551576&r2=551577 ============================================================================== --- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp (original) +++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp Thu Jun 28 07:35:35 2007 @@ -85,10 +85,7 @@ try { unsigned char value = 0; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( &value, sizeof(value) ); - return (bool)( value != 0 ); } DECAF_CATCH_RETHROW( EOFException ) @@ -102,10 +99,7 @@ try { unsigned char value = 0; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( &value, sizeof(value) ); - return (char)( value ); } DECAF_CATCH_RETHROW( EOFException ) @@ -119,10 +113,7 @@ try { unsigned char value = 0; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( &value, sizeof(value) ); - return value; } DECAF_CATCH_RETHROW( EOFException ) @@ -134,10 +125,7 @@ char DataInputStream::readChar() throw ( IOException, EOFException ) { try { unsigned char value = 0; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( &value, sizeof(value) ); - return (char)( value ); } DECAF_CATCH_RETHROW( EOFException ) @@ -150,12 +138,8 @@ try { short value = 0; unsigned char buffer[sizeof(value)] = {0}; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( buffer, sizeof(value) ); - value |= (buffer[0] << 8 | buffer[1] << 0); - return value; } DECAF_CATCH_RETHROW( EOFException ) @@ -167,15 +151,10 @@ unsigned short DataInputStream::readUnsignedShort() throw ( io::IOException, io::EOFException ) { try { - unsigned short value = 0; unsigned char buffer[sizeof(value)] = {0}; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( buffer, sizeof(value) ); - value |= (buffer[0] << 8 | buffer[1] << 0); - return value; } DECAF_CATCH_RETHROW( EOFException ) @@ -186,16 +165,11 @@ //////////////////////////////////////////////////////////////////////////////// int DataInputStream::readInt() throw ( io::IOException, io::EOFException ) { try { - unsigned int value = 0; unsigned char buffer[sizeof(value)] = {0}; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( buffer, sizeof(value) ); - value |= (buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3] << 0); - return value; } DECAF_CATCH_RETHROW( EOFException ) @@ -206,7 +180,6 @@ //////////////////////////////////////////////////////////////////////////////// double DataInputStream::readDouble() throw ( io::IOException, io::EOFException ) { try { - unsigned long long lvalue = this->readLong(); double value = 0.0; memcpy( &value, &lvalue, sizeof( unsigned long long ) ); @@ -220,7 +193,6 @@ //////////////////////////////////////////////////////////////////////////////// float DataInputStream::readFloat() throw ( io::IOException, io::EOFException ) { try { - unsigned int lvalue = this->readInt(); float value = 0.0f; memcpy( &value, &lvalue, sizeof( unsigned int ) ); @@ -235,11 +207,8 @@ long long DataInputStream::readLong() throw ( io::IOException, io::EOFException ) { try { - unsigned long long value = 0; unsigned char buffer[sizeof(value)] = {0}; - - // Get the data in one shot, will throw EOF or IO Exception as needed. readAllData( buffer, sizeof(value) ); // Have to do it this way because on Solaris and Cygwin we get all @@ -267,7 +236,6 @@ std::string DataInputStream::readString() throw ( io::IOException, io::EOFException ) { try { - size_t size = 1024; std::vector buffer; buffer.resize( size );