Date: Tuesday, December 13, 2005 @ 16:08:30
  Author: gilles
    Path: /cvsroot/carob/carob

Modified: include/BigDecimal.hpp (1.8 -> 1.9) include/CarobException.hpp
          (1.23 -> 1.24) include/Common.hpp (1.16 -> 1.17)
          include/Connection.hpp (1.32 -> 1.33)
          include/DriverResultSet.hpp (1.19 -> 1.20)
          include/JavaSocket.hpp (1.15 -> 1.16)
          include/ResultSetMetaData.hpp (1.4 -> 1.5) include/TypeTag.hpp
          (1.8 -> 1.9) src/BigDecimal.cpp (1.10 -> 1.11)
          src/CarobException.cpp (1.13 -> 1.14) src/Common.cpp (1.10 ->
          1.11) src/Connection.cpp (1.37 -> 1.38) src/DriverResultSet.cpp
          (1.19 -> 1.20) src/DriverSocket.cpp (1.9 -> 1.10)
          src/SQLDataSerialization.cpp (1.11 -> 1.12)
          test/TestExecWriteRequest.cpp (1.14 -> 1.15)
          test/TestStatement.cpp (1.14 -> 1.15)

Replaced int32_t by int, as much as possible. Native integers are often 
optimized by the compiler, and the syntax is easier to use/read
Kept int32_t only for data read directly from the database (ie. data inside 
tables)
For sizes or lengths, a cast is transparently done, assuming that no 16bits 
system will run carob (no problem for 64bits)


-------------------------------+
 include/BigDecimal.hpp        |    2 +-
 include/CarobException.hpp    |    6 +++---
 include/Common.hpp            |    2 +-
 include/Connection.hpp        |    6 +++---
 include/DriverResultSet.hpp   |   36 ++++++++++++++++++------------------
 include/JavaSocket.hpp        |    2 +-
 include/ResultSetMetaData.hpp |    2 +-
 include/TypeTag.hpp           |    8 ++++----
 src/BigDecimal.cpp            |   18 +++++++++++-------
 src/CarobException.cpp        |    4 ++--
 src/Common.cpp                |    2 +-
 src/Connection.cpp            |   16 ++++++++--------
 src/DriverResultSet.cpp       |   26 +++++++++++++-------------
 src/DriverSocket.cpp          |   16 ++++++++--------
 src/SQLDataSerialization.cpp  |    2 +-
 test/TestExecWriteRequest.cpp |    4 ++--
 test/TestStatement.cpp        |    2 +-
 17 files changed, 79 insertions(+), 75 deletions(-)


Index: carob/include/BigDecimal.hpp
diff -u carob/include/BigDecimal.hpp:1.8 carob/include/BigDecimal.hpp:1.9
--- carob/include/BigDecimal.hpp:1.8    Fri Dec  2 15:53:07 2005
+++ carob/include/BigDecimal.hpp        Tue Dec 13 16:08:30 2005
@@ -70,7 +70,7 @@
 private:
     
   /** Length of the unscaled value java_byte-array */
-  int32_t       byteArrayLength;
+  size_t        byteArrayLength;
   /**
    * Unscaled value of this BigDecimal, as a java_byte array two's-complement 
    * <i>big-endian</i> order: the zeroth element of this array is the most-
Index: carob/include/CarobException.hpp
diff -u carob/include/CarobException.hpp:1.23 
carob/include/CarobException.hpp:1.24
--- carob/include/CarobException.hpp:1.23       Mon Dec 12 14:54:21 2005
+++ carob/include/CarobException.hpp    Tue Dec 13 16:08:30 2005
@@ -106,7 +106,7 @@
   /** get the SQLState if any */
   const std::wstring & getSQLState() const { return SQLState; }
   /** Retrieves the vendor-specific exception code */
-  int32_t getErrorCode() { return errorCode; }
+  int getErrorCode() { return errorCode; }
 
 protected:
   /** Error message */
@@ -118,7 +118,7 @@
   /** SQL error message */
   std::wstring                SQLState;
   /** Vendor-specific error code */
-  int32_t                     errorCode;
+  int                         errorCode;
   /** Local stack trace when available */
   const BackTrace             backTrace;
 private:
@@ -323,7 +323,7 @@
   std::wstring  declaringClass;
   std::wstring  methodName;
   std::wstring  fileName;
-  int32_t       lineNumber;
+  int           lineNumber;
 };
 } //namespace CarobNS
 #endif //_CAROBEXCEPTION_H_
Index: carob/include/Common.hpp
diff -u carob/include/Common.hpp:1.16 carob/include/Common.hpp:1.17
--- carob/include/Common.hpp:1.16       Fri Dec  2 15:53:07 2005
+++ carob/include/Common.hpp    Tue Dec 13 16:08:30 2005
@@ -131,7 +131,7 @@
  * @param i integer to convert
  * @return a wstring representation of the integer
  */
-extern std::wstring toWString(const int32_t& i);
+extern std::wstring toWString(const int& i);
 
 /**
  * Defines data type that can be found in ResultSets
Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.32 carob/include/Connection.hpp:1.33
--- carob/include/Connection.hpp:1.32   Mon Dec 12 14:52:33 2005
+++ carob/include/Connection.hpp        Tue Dec 13 16:08:30 2005
@@ -117,7 +117,7 @@
         * @throws IOException on socket error
         * @throws DriverSQLException on protocol corruption
         */
-       static void       sendCommand(const DriverSocket& socket, int32_t 
command)
+       static void       sendCommand(const DriverSocket& socket, int command)
                         throw (SocketIOException, ProtocolException,
                         UnexpectedException);
   /**
@@ -192,7 +192,7 @@
    * @return number of rows affected, -1 if an error occured
    * @throws SocketIOException if an error occurs
    */
-  int32_t           statementExecuteUpdate(Request& r)
+  int               statementExecuteUpdate(Request& r)
                         throw (SocketIOException, BackendException, 
                         ControllerException, ProtocolException,
                         UnexpectedException);
@@ -459,7 +459,7 @@
    * @return int the number of updated rows or -1 if not found
    * @throws DriverSQLException if an error occurs
    */
-  int32_t             retrieveExecuteUpdateResult(const Request &request)
+  int                 retrieveExecuteUpdateResult(const Request &request)
                           throw (SocketIOException, BackendException,
                           ControllerException, ProtocolException,
                           UnexpectedException);
Index: carob/include/DriverResultSet.hpp
diff -u carob/include/DriverResultSet.hpp:1.19 
carob/include/DriverResultSet.hpp:1.20
--- carob/include/DriverResultSet.hpp:1.19      Thu Dec  8 15:18:37 2005
+++ carob/include/DriverResultSet.hpp   Tue Dec 13 16:08:30 2005
@@ -140,7 +140,7 @@
    * @return the column value, null for SQL NULL
    * @throw SQLException if a database access error occurs
    */
-  std::wstring                getString(int32_t columnIndex)
+  std::wstring                getString(int columnIndex)
                                   throw (SQLException, UnexpectedException);
   /**
    * Get the value of a column in the current row as an int.
@@ -149,7 +149,7 @@
    * @return the column value; NULL if SQL NULL
    * @throw SQLException if a database access error occurs
    */
-  int32_t                     getInt(int32_t columnIndex) throw (SQLException,
+  int32_t                     getInt(int columnIndex) throw (SQLException,
                                   UnexpectedException);
   /**
    * Closes the remote ResultSet if the ResultSet was streamed else just closes
@@ -164,27 +164,27 @@
    * Gets the number of column in this resultSet
    * @return number of columns value
    */
-   int32_t                    getNumberOfColumns() { return nbOfColumns; }
+   int                        getNumberOfColumns() { return nbOfColumns; }
    /**
     * Gets the number of rows that have been fetched yet.
     * Note: this is not the number of rows of the ResultSet, but the current
     * number of rows in memory !
     * @return number of rows fetched until now
     */
-    int32_t                   getNumberOfRowsInMemory() { return nbOfRows; }
+   int                        getNumberOfRowsInMemory() { return nbOfRows; }
     /**
      * A column may have the value of SQL NULL; wasNull() reports whether the
      * last column read had this special value.
      * Note that you must first call getXXX on a column to try to read its 
value
      * and then call wasNull() to find if the value was SQL NULL
-     * If you need to know if a value is NULL beforehand, use isNull(int32_t)
+     * If you need to know if a value is NULL beforehand, use isNull(int)
      * 
      * @return <code>true</code> if the last column read was SQL NULL
-     * @see #isNull(int32_t) const
+     * @see #isNull(int) const
      */
     bool                      wasNull() const { return wasNullFlag; }
     /**
-     * A column may have the value of SQL NULL; isNull(int32_t) reports whether
+     * A column may have the value of SQL NULL; isNull(int) reports whether
      * the value at the given column and current row is NULL.
      * 
      * @param columnIndex the first column is 1, the second is 2,...
@@ -193,7 +193,7 @@
      * @exception SQLException if the ResultSet is closed or the cursor is out
      *            of bounds
      */
-    bool                      isNull(int32_t columnIndex) const
+    bool                      isNull(int columnIndex) const
                                   throw (SQLException, UnexpectedException);
 protected:
   /**
@@ -212,11 +212,11 @@
   void                        setStatement(Statement* stmtPtr);
 private:
   /** Cursor to current row */
-  int32_t                     currentRow;
+  int                         currentRow;
    /** Number of rows */
-  int32_t                     nbOfRows;
+  int                         nbOfRows;
    /** Number of columns */
-  int32_t                     nbOfColumns;
+  int                         nbOfColumns;
   /** The results */
   std::vector< std::vector<ResultSetDataType> >  data;
   /** Indicates that no data has been read yet */
@@ -237,7 +237,7 @@
   /** True if there is more data to fetch from the controller */
   bool                        hasMoreData;
   /** The fetch size */
-  int32_t                     fetchSize;
+  int                         fetchSize;
   /** ResultSet cursor name */
   std::wstring                cursorName;
   /** The fields */
@@ -248,11 +248,11 @@
   bool                        wasNullFlag;
 //TODO:
   /** column name -> index in ResultSet data array */
-//  hash_map<wstring, int32_t>  columnNameToIndex;
+//  hash_map<wstring, int>  columnNameToIndex;
   /** Type of ResultSet */
-  int32_t                     resultSetType;
+  int                         resultSetType;
   /** Concurrency for this ResultSet */
-  int32_t                     resultSetConcurrency;
+  int                         resultSetConcurrency;
 
 //TODO:
   /** Warning chain */
@@ -282,7 +282,7 @@
    * @param columnIndex the column to check
    * @throws SQLException if an error occurs
    */
-  void                        checkRowAndColPosAndSetNullFlag(int32_t 
columnIndex)
+  void                        checkRowAndColPosAndSetNullFlag(int columnIndex)
                                   throw (SQLException, UnexpectedException);
   /** Clear/delete data, nulls and typeTags vectors */
   void                        clearAllData();
@@ -301,9 +301,9 @@
   union
   {
     /** Pointer (to avoid copy of large objects) to a DriverResultSet object */
-    DriverResultSet* resultSetPtr;
+    DriverResultSet*          resultSetPtr;
     /** Number of column concerned by the update */
-    int32_t updateCount;
+    int                       updateCount;
   };
 } ResultSetOrUpdateCount;
 
Index: carob/include/JavaSocket.hpp
diff -u carob/include/JavaSocket.hpp:1.15 carob/include/JavaSocket.hpp:1.16
--- carob/include/JavaSocket.hpp:1.15   Fri Dec  2 16:19:55 2005
+++ carob/include/JavaSocket.hpp        Tue Dec 13 16:08:30 2005
@@ -184,7 +184,7 @@
 
 private:
   /** Socket file descriptor */
-  int32_t       socketFd;
+  int           socketFd;
   /** true if the socket is connected to a host */
   bool          connected;
 };
Index: carob/include/ResultSetMetaData.hpp
diff -u carob/include/ResultSetMetaData.hpp:1.4 
carob/include/ResultSetMetaData.hpp:1.5
--- carob/include/ResultSetMetaData.hpp:1.4     Fri Dec  2 15:53:07 2005
+++ carob/include/ResultSetMetaData.hpp Tue Dec 13 16:08:30 2005
@@ -64,7 +64,7 @@
    * Returns the number of columns in this <code>ResultSet</code> object.
    * @return the number of columns
    */
-  int32_t               getColumnCount() { return resultSetPtr->nbOfColumns; }
+  int                   getColumnCount() { return resultSetPtr->nbOfColumns; }
   /**
    * Indicates whether the designated column is automatically numbered, thus
    * read-only.
Index: carob/include/TypeTag.hpp
diff -u carob/include/TypeTag.hpp:1.8 carob/include/TypeTag.hpp:1.9
--- carob/include/TypeTag.hpp:1.8       Fri Dec  2 15:53:07 2005
+++ carob/include/TypeTag.hpp   Tue Dec 13 16:08:30 2005
@@ -51,7 +51,7 @@
    * @param tn type number to affect
    * @see TypeTagConstants.hpp for possible values
    */
-  TypeTag(int32_t tn) : typeNumber(tn) {};
+  TypeTag(int tn) : typeNumber(tn) {};
   
   /**
    * Reads/deserializes/constructs a TypeTag from a stream.
@@ -74,15 +74,15 @@
   /**
    * Comparison with an integer: compares typeNumber
    */
-  bool operator == (const int32_t& ref) { return typeNumber == ref; }
+  bool operator == (const int& ref) { return typeNumber == ref; }
 
   /**
    * Cast to integer
    */  
-  operator int32_t () { return typeNumber; }
+  operator int () { return typeNumber; }
 private:
   /** Actual Type */
-  int32_t                 typeNumber;
+  int typeNumber;
 };
 
 } //namespace CarobNS
Index: carob/src/BigDecimal.cpp
diff -u carob/src/BigDecimal.cpp:1.10 carob/src/BigDecimal.cpp:1.11
--- carob/src/BigDecimal.cpp:1.10       Fri Dec  2 15:53:07 2005
+++ carob/src/BigDecimal.cpp    Tue Dec 13 16:08:30 2005
@@ -50,7 +50,11 @@
   ResultSetDataType res;
   //1. Read intVal:
   //1.1 Read intValLength
-  input>>retVal->byteArrayLength;
+  int32_t lengthRead;
+  input>>lengthRead;
+  //We receive the length as an int32 but internally, we have an array of 
bytes,
+  //which length actually is of size_t type
+  retVal->byteArrayLength = (size_t)lengthRead;
   if (retVal->byteArrayLength == 0)
   {
     //This is a zero, no byte array
@@ -61,9 +65,9 @@
   {
     retVal->byteArray = new java_byte[retVal->byteArrayLength];
     //1.2 Compute padding
-    int idx = 0;
+    unsigned int idx = 0;
     int32_t wordRead = 0;
-    int padding = retVal->byteArrayLength%4;
+    unsigned int padding = retVal->byteArrayLength%4;
     //If there is a padding, we must read the first 'padding' bytes
     //so we are aligned for the rest of the bytes
     if (padding > 0)
@@ -120,7 +124,7 @@
 
 int* BigDecimal::stripByteArrayLeadingZeroBytes(int& intArrayLength)
 {
-  int keep;
+  unsigned int keep;
   // Find first nonzero byte
   for (keep=0; keep<byteArrayLength && byteArray[keep]==0; keep++);
 
@@ -141,7 +145,7 @@
 
 int* BigDecimal::makeByteArrayPositive(int& intArrayLength)
 {
-  int keep, k;
+  unsigned int keep, k;
 
   // Find first non-sign (0xff) byte of input
   for (keep=0; keep<byteArrayLength && byteArray[keep]==-1; keep++)
@@ -162,10 +166,10 @@
   for (int i = intArrayLength-1; i >= 0; i--)
   {
     result[i] = byteArray[b--] & 0xff;
-    int numBytesToTransfer = std::min(3, b-keep+1);
+    unsigned int numBytesToTransfer = std::min(3, (int)(b-keep+1));
     if (numBytesToTransfer < 0)
       numBytesToTransfer = 0;
-    for (int j=8; j <= 8*numBytesToTransfer; j += 8)
+    for (unsigned int j=8; j <= 8*numBytesToTransfer; j += 8)
       result[i] |= ((byteArray[b--] & 0xff) << j);
 
     // Mask indicates which bits must be complemented
Index: carob/src/CarobException.cpp
diff -u carob/src/CarobException.cpp:1.13 carob/src/CarobException.cpp:1.14
--- carob/src/CarobException.cpp:1.13   Fri Dec  2 15:53:07 2005
+++ carob/src/CarobException.cpp        Tue Dec 13 16:08:30 2005
@@ -82,9 +82,9 @@
     causePtr = NULL;
   
   // receive stackTrace
-  int32_t stLength;
+  int stLength;
   sock>>stLength;
-  for (int32_t i = 0; i < stLength; i++)
+  for (int i = 0; i < stLength; i++)
   {
     stackTrace.push_back(StackTraceElement(sock));
   }
Index: carob/src/Common.cpp
diff -u carob/src/Common.cpp:1.10 carob/src/Common.cpp:1.11
--- carob/src/Common.cpp:1.10   Fri Dec  2 15:53:07 2005
+++ carob/src/Common.cpp        Tue Dec 13 16:08:30 2005
@@ -159,7 +159,7 @@
   // return ret; FIXME throws instead
 }
 
-wstring CarobNS::toWString(const int32_t& arg)
+wstring CarobNS::toWString(const int& arg)
 {
   std::wostringstream buffer;
   buffer << arg;  
Index: carob/src/Connection.cpp
diff -u carob/src/Connection.cpp:1.37 carob/src/Connection.cpp:1.38
--- carob/src/Connection.cpp:1.37       Mon Dec 12 14:52:33 2005
+++ carob/src/Connection.cpp    Tue Dec 13 16:08:30 2005
@@ -63,17 +63,17 @@
   }
 }
 
-void Connection::sendCommand(const DriverSocket& socket, int32_t command)
+void Connection::sendCommand(const DriverSocket& socket, int command)
     throw (SocketIOException, ProtocolException, UnexpectedException)
 {
-  int32_t ack = -1;
+  int ack = -1;
   socket>>ack;
   if (ack != ControllerPrompt)
     throw ProtocolException(
         L"Protocol corruption while trying to send command: "
         + toWString(command) + L". Check the previous command");
   socket<<CommandPrefix;
-  socket<<command;
+  socket<<(int32_t)command;
 }
 
 bool Connection::initConnection(const ConnectionParameters& prms)
@@ -541,7 +541,7 @@
   return retVal;
 }
 
-int32_t Connection::statementExecuteUpdate(Request& request)
+int Connection::statementExecuteUpdate(Request& request)
     throw (SocketIOException, BackendException, ControllerException,
     ProtocolException, UnexpectedException)
 {
@@ -549,7 +549,7 @@
 
   connectionCS.Enter();
 
-  int32_t controllerResponse = -1;
+  int controllerResponse = -1;
   
   checkIfConnected();
   beginTransactionIfNeeded();
@@ -563,7 +563,7 @@
     writeRequestOnStream(request);
     request.setId(receiveLongOrException());
     requestIdIsSet = true;
-    controllerResponse = receiveIntOrException();
+    controllerResponse = (int)receiveIntOrException();
   }
   catch (SocketIOException sioe)
   {
@@ -862,13 +862,13 @@
   return receiveResultSet();
 }
 
-int32_t Connection::retrieveExecuteUpdateResult(const Request &request)
+int Connection::retrieveExecuteUpdateResult(const Request &request)
     throw (SocketIOException, BackendException, ControllerException,
     ProtocolException, UnexpectedException)
 {
   sendCommand(*driverSocketPtr, RetrieveExecuteUpdateResult);
   request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
-  return receiveIntOrException();
+  return (int)receiveIntOrException();
 }
 std::list<ResultSetOrUpdateCount> Connection::retrieveExecuteResult(const 
Request &request)
     throw (SocketIOException, BackendException, ControllerException,
Index: carob/src/DriverResultSet.cpp
diff -u carob/src/DriverResultSet.cpp:1.19 carob/src/DriverResultSet.cpp:1.20
--- carob/src/DriverResultSet.cpp:1.19  Fri Dec  9 16:38:39 2005
+++ carob/src/DriverResultSet.cpp       Tue Dec 13 16:08:30 2005
@@ -36,7 +36,7 @@
 DriverResultSet::~DriverResultSet()
 {
   clearAllData();
-  for (int32_t i=0; i<nbOfColumns; i++)
+  for (int i=0; i<nbOfColumns; i++)
   {
     delete fields[i];
     fields[i] = NULL;
@@ -107,7 +107,7 @@
   const DriverSocket&  socket = conPtr->getDriverSocket();
   // Get the ResultSet metadata, deserialize columns information
   socket>>nbOfColumns;
-  for (int32_t i=0; i<nbOfColumns; i++)
+  for (int i=0; i<nbOfColumns; i++)
   {
     fields.push_back(new Field(socket));
   }
@@ -117,13 +117,13 @@
   {
     throw ProtocolException(L"Column types were expected");
   }
-  
+
   socket>>nbOfRows;
-  
+
   // Receive java types
   if (nbOfRows > 0)
   {
-    for (int32_t col = 0; col < nbOfColumns; col++)
+    for (int col = 0; col < nbOfColumns; col++)
     {
       TypeTag tag(socket);
       deserializers.push_back(SQLDataSerialization::getDeserializer(tag));
@@ -197,7 +197,7 @@
   return true;
 }
 
-wstring DriverResultSet::getString(int32_t columnIndex) throw (SQLException,
+wstring DriverResultSet::getString(int columnIndex) throw (SQLException,
     UnexpectedException)
 {
   checkRowAndColPosAndSetNullFlag(columnIndex);
@@ -259,7 +259,7 @@
   return buffer.str();
 }
 
-int32_t DriverResultSet::getInt(int32_t columnIndex) throw (SQLException, 
+int32_t DriverResultSet::getInt(int columnIndex) throw (SQLException, 
     UnexpectedException)
 {
   checkRowAndColPosAndSetNullFlag(columnIndex);
@@ -298,7 +298,7 @@
   data.reserve(nbOfRows);
 
   // Receive the actual data
-  for (int32_t rowCnt = 0; rowCnt<nbOfRows; rowCnt++)
+  for (int rowCnt = 0; rowCnt<nbOfRows; rowCnt++)
   {
     TypeTag tt(socket);
     if (tt != TT_ROW)
@@ -307,7 +307,7 @@
     }
 
     // First let's flag null values using a burst of booleans
-    for (int32_t colCnt = 0; colCnt < nbOfColumns; colCnt++)
+    for (int colCnt = 0; colCnt < nbOfColumns; colCnt++)
     {
       bool b;
       socket>>b;
@@ -315,7 +315,7 @@
     }
     nulls.push_back(nullsForThisRow);
     
-    for (int32_t colCnt2 = 0; colCnt2 < nbOfColumns; colCnt2++)
+    for (int colCnt2 = 0; colCnt2 < nbOfColumns; colCnt2++)
     {
       if (!nullsForThisRow[colCnt2])
         rowOfData.push_back(deserializers[colCnt2](socket));
@@ -350,7 +350,7 @@
     throw SQLException(L"Trying to access a closed ResultSet");
 }
 
-bool DriverResultSet::isNull(int32_t columnIndex) const throw (SQLException,
+bool DriverResultSet::isNull(int columnIndex) const throw (SQLException,
     UnexpectedException)
 {
   bool answer = false;
@@ -366,14 +366,14 @@
     throw SQLException(L"Column Index out of range ( "
         + toWString(columnIndex) + L" > " + toWString(nbOfColumns) + L").");
 
-  if ((int32_t)data[currentRow].size()<columnIndex-1)
+  if ((int)data[currentRow].size()<columnIndex-1)
     answer = true;
   else
     answer = nulls[currentRow][columnIndex - 1];
   return answer;
 }
 
-void DriverResultSet::checkRowAndColPosAndSetNullFlag(int32_t columnIndex)
+void DriverResultSet::checkRowAndColPosAndSetNullFlag(int columnIndex)
     throw (SQLException, UnexpectedException)
 {
     wasNullFlag = isNull(columnIndex);
Index: carob/src/DriverSocket.cpp
diff -u carob/src/DriverSocket.cpp:1.9 carob/src/DriverSocket.cpp:1.10
--- carob/src/DriverSocket.cpp:1.9      Fri Dec  2 15:53:07 2005
+++ carob/src/DriverSocket.cpp  Tue Dec 13 16:08:30 2005
@@ -44,12 +44,12 @@
   wstring fctName(L"DriverSocket::operator<<(wstring)");
   if (isVerboseEnabled())
     logVerbose(fctName, L"");
-  //First write "true", then the size of the upcoming string, then the string 
itself
+  // First write "true" (for "non null string"), then the size of the upcoming
+  // string, then the string itself
   *this<<true;
-  //TODO: check what size to send !!!
-  int32_t strLen = s.size();
-  *this<<strLen;
-  int32_t totalWritten = 0;
+  size_t strLen = s.size();
+  *this<<(int32_t)strLen;
+  size_t totalWritten = 0;
   while (totalWritten < strLen)
   {
     totalWritten += writeJavaUTF(s);
@@ -75,14 +75,14 @@
   if (ack)
   {
     //First reads the size of the upcomming string, then the string itself.
-    int32_t strSize;
+    int strSize;
     *this>>strSize;
     if (strSize > 0)
     {
       s.reserve(strSize+1);
-      int32_t sizeRead = 0;
+      size_t sizeRead = 0;
       //We must read strSize character, which can be done in several passes
-      while (sizeRead<strSize)
+      while ((int)sizeRead<strSize)
       {
         sizeRead += readJavaUTF(s);
       }
Index: carob/src/SQLDataSerialization.cpp
diff -u carob/src/SQLDataSerialization.cpp:1.11 
carob/src/SQLDataSerialization.cpp:1.12
--- carob/src/SQLDataSerialization.cpp:1.11     Fri Dec  2 15:53:07 2005
+++ carob/src/SQLDataSerialization.cpp  Tue Dec 13 16:08:30 2005
@@ -119,7 +119,7 @@
     throw (SocketIOException, UnexpectedException)
 {
   ResultSetDataType res;
-  int32_t baLength = 0;
+  int baLength = 0;
   input>>baLength;
   uint8_t* byteArrayRead = new uint8_t[baLength];
   int32_t byteRead = 0;
Index: carob/test/TestExecWriteRequest.cpp
diff -u carob/test/TestExecWriteRequest.cpp:1.14 
carob/test/TestExecWriteRequest.cpp:1.15
--- carob/test/TestExecWriteRequest.cpp:1.14    Fri Dec  2 15:53:07 2005
+++ carob/test/TestExecWriteRequest.cpp Tue Dec 13 16:08:30 2005
@@ -90,7 +90,7 @@
   {
     logDebug(fctName, L"Executing write - should succeed");
   }
-  int32_t nbRowsAffected = connectionPtr->statementExecuteUpdate(updtReq);
+  int nbRowsAffected = connectionPtr->statementExecuteUpdate(updtReq);
   if (isDebugEnabled())
   {
     logDebug(fctName, L"Write succeed. Number of rows updated:"
@@ -115,7 +115,7 @@
   {
     updtReq.setSqlQuery(requestBegin + toWString(i)
                       + requestEnd + toWString(i%50));
-    int32_t nbRowsAffected = connectionPtr->statementExecuteUpdate(updtReq);
+    int nbRowsAffected = connectionPtr->statementExecuteUpdate(updtReq);
     CPPUNIT_ASSERT(nbRowsAffected == 1);
   }
   if (isDebugEnabled())
Index: carob/test/TestStatement.cpp
diff -u carob/test/TestStatement.cpp:1.14 carob/test/TestStatement.cpp:1.15
--- carob/test/TestStatement.cpp:1.14   Thu Dec  8 15:19:41 2005
+++ carob/test/TestStatement.cpp        Tue Dec 13 16:08:30 2005
@@ -182,7 +182,7 @@
   {
     logDebug(fctName, L"Executing update - should succeed");
   }
-  int32_t nbRowsAffected = statementPtr->executeUpdate(
+  int nbRowsAffected = statementPtr->executeUpdate(
       L"update product set name='changed by testExecuteUpdateGood' where 
id=0");
   if (isDebugEnabled())
   {

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to