List:Commits« Previous MessageNext Message »
From:pharvey Date:November 14 2006 12:30am
Subject:Connector/ODBC 5 commit: r669 - in trunk/SDK/C: Library include
View as plain text  
Modified:
   trunk/SDK/C/Library/MYODBCC.cpp
   trunk/SDK/C/include/MYODBCC.h
Log:
ENH: minor name improvement to make understanding call easier

Modified: trunk/SDK/C/Library/MYODBCC.cpp
===================================================================
--- trunk/SDK/C/Library/MYODBCC.cpp	2006-11-13 23:20:34 UTC (rev 668)
+++ trunk/SDK/C/Library/MYODBCC.cpp	2006-11-13 23:30:28 UTC (rev 669)
@@ -2450,36 +2450,36 @@
     return j;
 }
 
-int MYODBCC::QString_toWCharArray( QString qs, wchar_t *array, int size )
+int MYODBCC::QString_toWCharArray( QString qs, wchar_t *array, int nLenChars )
 {
     std::wstring st;
     int r = QString_toWString(qs, &st);
     /* enforce max size to copy info wchar array */
-    if(size > 0 && r >= size)
+    if(nLenChars > 0 && r >= nLenChars)
     {
-        st.resize(size-1);
-        r = size-1;
+        st.resize(nLenChars-1);
+        r = nLenChars-1;
     }
     memcpy(array, st.c_str(), (st.length()+1) * sizeof(wchar_t));
     return r;
 }
 
-QString MYODBCC::QString_fromWCharArray( const wchar_t *string, int size )
+QString MYODBCC::QString_fromWCharArray( const wchar_t *pwsString, int nLenChars )
 {
     int i;
     QString str;
 
     /* Handle case where wchar_t is already UTF-16 */
     if ( sizeof ( wchar_t ) == sizeof ( QChar ) ) {
-        return QString::fromUtf16( (ushort *) string, size );
+        return QString::fromUtf16( (ushort *) pwsString, nLenChars );
     }
 
-    if(size < 0)
-        size = wcslen(string);
+    if(nLenChars < 0)
+        nLenChars = wcslen(pwsString);
 
-    for(i = 0; i < size; ++i)
+    for(i = 0; i < nLenChars; ++i)
     {
-        UTF32 C = string[i];
+        UTF32 C = pwsString[i];
         UTF16 X = (UTF16)C;
         if(C > 0xffff)
         {

Modified: trunk/SDK/C/include/MYODBCC.h
===================================================================
--- trunk/SDK/C/include/MYODBCC.h	2006-11-13 23:20:34 UTC (rev 668)
+++ trunk/SDK/C/include/MYODBCC.h	2006-11-13 23:30:28 UTC (rev 669)
@@ -580,8 +580,8 @@
     */
     /*@{*/
     static int QString_toWString( QString qs, std::wstring *ws );
-    static int QString_toWCharArray( QString qs, wchar_t *array, int size = -1 );
-    static QString QString_fromWCharArray( const wchar_t *string, int size = -1 );
+    static int QString_toWCharArray( QString qs, wchar_t *array, int nLenChars = -1 );
+    static QString QString_fromWCharArray( const wchar_t *string, int nLenChars = -1 );
     /*@}*/
 
     /*!

Thread
Connector/ODBC 5 commit: r669 - in trunk/SDK/C: Library includepharvey14 Nov