[Ocipl-commits] SF.net SVN: ocipl: [51] trunk/ocipl
Brought to you by:
martinfuchs
|
From: <mar...@us...> - 2008-05-30 09:24:18
|
Revision: 51
http://ocipl.svn.sourceforge.net/ocipl/?rev=51&view=rev
Author: martinfuchs
Date: 2008-05-30 02:24:19 -0700 (Fri, 30 May 2008)
Log Message:
-----------
- fix array float/double allocation in SqlVariantArray::assign()
- eliminate VS2005 warnings
Modified Paths:
--------------
trunk/ocipl/Makefile.VC6
trunk/ocipl/ocipl.cpp
Modified: trunk/ocipl/Makefile.VC6
===================================================================
--- trunk/ocipl/Makefile.VC6 2008-05-30 09:16:27 UTC (rev 50)
+++ trunk/ocipl/Makefile.VC6 2008-05-30 09:24:19 UTC (rev 51)
@@ -1,8 +1,8 @@
PROJ = ocipl
-INCL_PATH = E:\include
-LIB32 = E:\lib32
-HTML_DIR = E:\html\newhome
+INCL_PATH = W:\include
+LIB32 = W:\lib32
+HTML_DIR = W:\html\newhome
#ORACLE_HOME = D:\Oracle\Ora81
Modified: trunk/ocipl/ocipl.cpp
===================================================================
--- trunk/ocipl/ocipl.cpp 2008-05-30 09:16:27 UTC (rev 50)
+++ trunk/ocipl/ocipl.cpp 2008-05-30 09:24:19 UTC (rev 51)
@@ -856,7 +856,12 @@
if (tag.empty()) {
TCHAR buffer[16];
- _stprintf(buffer, _T("%x"), _stmt_cache.size());
+#ifdef __STDC_WANT_SECURE_LIB__
+ _stprintf_s(buffer, _countof(buffer),
+#else
+ _stprintf(buffer,
+#endif
+ _T("%x"), _stmt_cache.size());
tag = buffer;
}
@@ -1456,7 +1461,9 @@
tstring SqlVariant::str(OCIError* errh) const
{
+#ifdef SQLT_BFLOAT
TCHAR buffer[16];
+#endif
switch(_data_type) {
case 0:
@@ -1675,9 +1682,9 @@
SqlVariantArray::SqlVariantArray(ub2 data_type, int size, int blen)
+ : _size(size),
+ _data_type(data_type)
{
- _data_type = data_type;
-
switch(data_type) {
case OCI_TYPECODE_CHAR:
_data_type = OCI_TYPECODE_VARCHAR;
@@ -1729,9 +1736,9 @@
}
SqlVariantArray::SqlVariantArray(const SqlVariantArray& other)
+ : _size(0),
+ _data_type(0)
{
- _data_type = 0;
-
assign(other);
}
@@ -1739,6 +1746,7 @@
{
clear();
+ _size = other._size;
_data_type = other._data_type;
switch(other._data_type) {
@@ -1755,11 +1763,13 @@
#ifdef SQLT_BFLOAT
case OCI_TYPECODE_BFLOAT:
- _pfloat = new float[*other._pfloat];
+ _pfloat = new float[_size];
+ memcpy(_pfloat, other._pfloat, sizeof(float)*_size);
break;
case OCI_TYPECODE_BDOUBLE:
- _pdouble = new double[*other._pfloat];
+ _pdouble = new double[_size];
+ memcpy(_pfloat, other._pfloat, sizeof(double)*_size);
break;
#endif
@@ -1840,12 +1850,15 @@
assert(0);
}
+ _size = 0;
_data_type = 0;
}
tstring SqlVariantArray::str(int row, OCIError* errh) const
{
+#ifdef SQLT_BFLOAT
TCHAR buffer[16];
+#endif
switch(_data_type) {
case 0:
@@ -1860,11 +1873,21 @@
#ifdef SQLT_BFLOAT
case OCI_TYPECODE_BFLOAT:
- _stprintf(buffer, _T("%f"), _pfloat[row]);
+#ifdef __STDC_WANT_SECURE_LIB__
+ _stprintf_s(buffer, _countof(buffer),
+#else
+ _stprintf(buffer,
+#endif
+ _T("%f"), _pfloat[row]);
return buffer;
case OCI_TYPECODE_BDOUBLE:
- _stprintf(buffer, _T("%f"), _pdouble[row]);
+#ifdef __STDC_WANT_SECURE_LIB__
+ _stprintf_s(buffer, _countof(buffer),
+#else
+ _stprintf(buffer,
+#endif
+ _T("%f"), _pdouble[row]);
return buffer;
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|