Skip to content

Commit 51863a0

Browse files
types correction
1 parent a73a6cb commit 51863a0

12 files changed

+29
-31
lines changed

Diff for: IscDbc/Connection.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class PreparedStatement : public Statement
584584
virtual void setDate (int index, DateTime value) = 0;
585585
virtual void setDouble (int index, double value) = 0;
586586
virtual void setFloat (int index, float value) = 0;
587-
virtual void setInt (int index, long value) = 0;
587+
virtual void setInt (int index, int value) = 0;
588588
virtual void setLong (int index, QUAD value) = 0;
589589
virtual void setNull (int index, int type) = 0;
590590
// virtual void setObject( int parameterIndex, Object x ) = 0;
@@ -607,10 +607,8 @@ class PreparedStatement : public Statement
607607
virtual void beginBlobDataTransfer(int index) = 0;
608608
virtual void putBlobSegmentData (int length, const void *bytes) = 0;
609609
virtual void endBlobDataTransfer() = 0;
610-
virtual StatementMetaData*
611-
getStatementMetaDataIPD() = 0;
612-
virtual StatementMetaData*
613-
getStatementMetaDataIRD() = 0;
610+
virtual StatementMetaData* getStatementMetaDataIPD() = 0;
611+
virtual StatementMetaData* getStatementMetaDataIRD() = 0;
614612
virtual int getNumParams() = 0;
615613
virtual int objectVersion() = 0;
616614
};
@@ -644,8 +642,8 @@ class ResultSet
644642
virtual double getDouble (const char *columnName) = 0;
645643
virtual float getFloat (int columnIndex) = 0;
646644
virtual float getFloat (const char *columnName) = 0;
647-
virtual long getInt (int columnIndex) = 0;
648-
virtual long getInt (const char *columnName) = 0;
645+
virtual int getInt (int columnIndex) = 0;
646+
virtual int getInt (const char *columnName) = 0;
649647
virtual QUAD getLong (int columnIndex) = 0;
650648
virtual QUAD getLong (const char *columnName) = 0;
651649
virtual StatementMetaData* getMetaData() = 0;
@@ -802,7 +800,7 @@ class CallableStatement : public PreparedStatement
802800
virtual DateTime getDate(int parameterIndex) = 0;
803801
virtual double getDouble(int parameterIndex) = 0;
804802
virtual float getFloat(int parameterIndex) = 0;
805-
virtual long getInt(int parameterIndex) = 0;
803+
virtual int getInt(int parameterIndex) = 0;
806804
virtual QUAD getLong(int parameterIndex) = 0;
807805
// virtual Object getObject( int parameterIndex ) = 0;
808806
virtual short getShort(int parameterIndex) = 0;

Diff for: IscDbc/IscCallableStatement.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ char IscCallableStatement::getByte(int id)
140140
return getValue (id)->getByte();
141141
}
142142

143-
long IscCallableStatement::getInt(int id)
143+
int IscCallableStatement::getInt(int id)
144144
{
145145
return getValue (id)->getLong();
146146
}

Diff for: IscDbc/IscCallableStatement.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class IscCallableStatement : public IscPreparedStatement, public CallableStateme
5050
virtual DateTime getDate(int parameterIndex);
5151
virtual double getDouble(int parameterIndex);
5252
virtual float getFloat(int parameterIndex);
53-
virtual long getInt(int parameterIndex);
53+
virtual int getInt(int parameterIndex);
5454
virtual QUAD getLong(int parameterIndex);
5555
// virtual Object getObject( int parameterIndex );
5656
virtual short getShort(int parameterIndex);
@@ -76,7 +76,7 @@ class IscCallableStatement : public IscPreparedStatement, public CallableStateme
7676
virtual void setDate (int index, DateTime value) { IscPreparedStatement::setDate ( index, value); }
7777
virtual void setDouble (int index, double value) { IscPreparedStatement::setDouble ( index, value); }
7878
virtual void setFloat (int index, float value) { IscPreparedStatement::setFloat ( index, value); }
79-
virtual void setInt (int index, long value) { IscPreparedStatement::setInt ( index, value); }
79+
virtual void setInt (int index, int value) { IscPreparedStatement::setInt ( index, value); }
8080
virtual void setLong (int index, QUAD value) { IscPreparedStatement::setLong ( index, value); }
8181
virtual void setNull (int index, int type) { IscPreparedStatement::setNull ( index, type); }
8282
// virtual void setObject( int parameterIndex, Object x ) { IscPreparedStatement::setObject( parameterIndex, x ); }

Diff for: IscDbc/IscPreparedStatement.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void IscPreparedStatement::setFloat(int index, float value)
262262
getParameter (index - 1)->setValue (value);
263263
}
264264

265-
void IscPreparedStatement::setInt(int index, long value)
265+
void IscPreparedStatement::setInt(int index, int value)
266266
{
267267
getParameter (index - 1)->setValue (value);
268268
}

Diff for: IscDbc/IscPreparedStatement.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class IscPreparedStatement : public IscStatement, public PreparedStatement
5757
virtual void setDate (int index, DateTime value);
5858
virtual void setDouble (int index, double value);
5959
virtual void setFloat (int index, float value);
60-
virtual void setInt (int index, long value);
60+
virtual void setInt (int index, int value);
6161
virtual void setLong (int index, QUAD value);
6262
virtual void setNull (int index, int type);
6363
// virtual void setObject( int parameterIndex, Object x );

Diff for: IscDbc/IscResultSet.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void IscResultSet::setValue(int index, const char * value)
348348
values.values [index - 1].setString (value, true);
349349
}
350350

351-
void IscResultSet::setValue(int index, long value)
351+
void IscResultSet::setValue(int index, int value)
352352
{
353353
if (index < 1 || index > values.count)
354354
throw SQLEXCEPTION (RUNTIME_ERROR, "invalid column index for result set");
@@ -403,12 +403,12 @@ DateTime IscResultSet::getDate(const char * columnName)
403403
return getValue (columnName)->getDate();
404404
}
405405

406-
long IscResultSet::getInt(int id)
406+
int IscResultSet::getInt(int id)
407407
{
408408
return getValue (id)->getLong();
409409
}
410410

411-
long IscResultSet::getInt(const char * columnName)
411+
int IscResultSet::getInt(const char * columnName)
412412
{
413413
return getValue (columnName)->getLong();
414414
}

Diff for: IscDbc/IscResultSet.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class IscResultSet : public ResultSet, public IscStatementMetaData
6868
virtual double getDouble (const char *columnName);
6969
virtual float getFloat (int columnIndex);
7070
virtual float getFloat (const char *columnName);
71-
virtual long getInt (int columnIndex);
72-
virtual long getInt (const char *columnName);
71+
virtual int getInt (int columnIndex);
72+
virtual int getInt (const char *columnName);
7373
virtual QUAD getLong (int columnIndex);
7474
virtual QUAD getLong (const char *columnName);
7575
virtual StatementMetaData* getMetaData();
@@ -183,7 +183,7 @@ class IscResultSet : public ResultSet, public IscStatementMetaData
183183
virtual bool getDataFromStaticCursor (int column);
184184
virtual bool nextFromProcedure();
185185

186-
void setValue (int index, long value);
186+
void setValue (int index, int value);
187187
void setValue (int index, const char *value);
188188

189189
int numberColumns;

Diff for: OdbcConnection.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ void OdbcConnection::descriptorDeleted(OdbcDesc * descriptor)
20102010
SQLRETURN OdbcConnection::sqlGetConnectAttr(int attribute, SQLPOINTER ptr, int bufferLength, SQLINTEGER *lengthPtr)
20112011
{
20122012
clearErrors();
2013-
long value;
2013+
int value;
20142014
const char *string = NULL;
20152015

20162016
switch (attribute)
@@ -2068,10 +2068,10 @@ SQLRETURN OdbcConnection::sqlGetConnectAttr(int attribute, SQLPOINTER ptr, int b
20682068
return returnStringInfo (ptr, bufferLength, lengthPtr, string);
20692069

20702070
if (ptr)
2071-
*(long*) ptr = value;
2071+
*(int*) ptr = value;
20722072

20732073
if (lengthPtr)
2074-
*lengthPtr = sizeof (long);
2074+
*lengthPtr = sizeof (int);
20752075

20762076
return sqlSuccess();
20772077
}

Diff for: OdbcConvert.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ OdbcConvert::OdbcConvert(OdbcStatement * parent)
8989
bindOffsetPtrIndFrom = &tempBindOffsetPtr;
9090
}
9191

92-
void OdbcConvert::setZeroColumn(DescRecord * to, long rowNumber)
92+
void OdbcConvert::setZeroColumn(DescRecord * to, int rowNumber)
9393
{
9494
SQLPOINTER pointer = getAdressBindDataTo((char*)to->dataPtr);
9595
SQLLEN *indicatorTo = getAdressBindIndTo((char*)to->indicatorPtr);
9696

97-
*(long*)pointer = rowNumber + 1;
97+
*(int*)pointer = rowNumber + 1;
9898
if ( indicatorTo )
99-
*indicatorTo = sizeof(long);
99+
*indicatorTo = sizeof(int);
100100
}
101101

102102
void OdbcConvert::setBindOffsetPtrTo(SQLLEN *bindOffsetPtr, SQLLEN *bindOffsetPtrInd)

Diff for: OdbcConvert.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class OdbcConvert
7777

7878
OdbcConvert(OdbcStatement * parent);
7979

80-
void setZeroColumn(DescRecord * to, long rowNumber);
80+
void setZeroColumn(DescRecord * to, int rowNumber);
8181
void setBindOffsetPtrTo(SQLLEN *bindOffsetPtr, SQLLEN *bindOffsetPtrInd);
8282
void setBindOffsetPtrFrom(SQLLEN *bindOffsetPtr, SQLLEN *bindOffsetPtrInd);
8383
ADRESS_FUNCTION getAdressFunction(DescRecord * from, DescRecord * to);

Diff for: OdbcEnv.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void OdbcEnv::connectionClosed(OdbcConnection * connection)
160160
SQLRETURN OdbcEnv::sqlGetEnvAttr(int attribute, SQLPOINTER ptr, int bufferLength, SQLINTEGER *lengthPtr)
161161
{
162162
clearErrors();
163-
long value;
163+
int value;
164164
char *string = NULL;
165165

166166
try
@@ -187,10 +187,10 @@ SQLRETURN OdbcEnv::sqlGetEnvAttr(int attribute, SQLPOINTER ptr, int bufferLength
187187
return returnStringInfo (ptr, bufferLength, lengthPtr, string);
188188

189189
if (ptr)
190-
*(long*) ptr = value;
190+
*(int*) ptr = value;
191191

192192
if (lengthPtr)
193-
*lengthPtr = sizeof (long);
193+
*lengthPtr = sizeof (int);
194194
}
195195
catch ( std::exception &ex )
196196
{

Diff for: OdbcStatement.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2478,7 +2478,7 @@ SQLRETURN OdbcStatement::sqlGetStmtAttr(int attribute, SQLPOINTER ptr, int buffe
24782478
break;
24792479

24802480
case SQL_ATTR_ROW_NUMBER:
2481-
value = (long) rowNumber;
2481+
value = rowNumber;
24822482
TRACE02(SQL_ATTR_ROW_NUMBER,value);
24832483
break;
24842484

@@ -2533,7 +2533,7 @@ SQLRETURN OdbcStatement::sqlGetStmtAttr(int attribute, SQLPOINTER ptr, int buffe
25332533
*(intptr_t*) ptr = value;
25342534

25352535
if (lengthPtr)
2536-
*lengthPtr = sizeof (long);
2536+
*lengthPtr = sizeof (intptr_t);
25372537
}
25382538
catch ( std::exception &ex )
25392539
{

0 commit comments

Comments
 (0)