Changeset: 00e7f70e953d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/00e7f70e953d
Modified Files:
clients/odbc/driver/ODBCConvert.c
Branch: Mar2025
Log Message:
Rename local function parseint() into parsebignum() for clarity.
diffs (66 lines):
diff --git a/clients/odbc/driver/ODBCConvert.c
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -49,7 +49,7 @@ typedef struct {
* 0 is returned if the string is not a number, or if scale doesn't fit.
*/
static int
-parseint(const char *data, bignum_t *nval)
+parsebignum(const char *data, bignum_t *nval)
{
int fraction = 0; /* inside the fractional part */
int scale = 0;
@@ -57,7 +57,7 @@ parseint(const char *data, bignum_t *nva
nval->val = 0;
nval->precision = 0;
- scale = 0;
+
while (space(*data))
data++;
if (*data == '-') {
@@ -1103,7 +1103,7 @@ ODBCFetch(ODBCStmt *stmt,
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_SECOND:
- switch (parseint(data, &nval)) {
+ switch (parsebignum(data, &nval)) {
case 0:
/* shouldn't happen: getting here means SQL
* server told us a value was of a certain
@@ -2098,7 +2098,7 @@ ODBCFetch(ODBCStmt *stmt,
case SQL_FLOAT:
case SQL_REAL:
/* reparse double and float, parse char */
- if (!parseint(data, &nval)) {
+ if (!parsebignum(data, &nval)) {
/* Invalid character value for cast
* specification */
addStmtError(stmt, "22018", NULL, 0);
@@ -2301,7 +2301,7 @@ ODBCFetch(ODBCStmt *stmt,
case SQL_FLOAT:
case SQL_REAL:
/* reparse double and float, parse char */
- if (!parseint(data, &nval)) {
+ if (!parsebignum(data, &nval)) {
/* Invalid character value for cast
* specification */
addStmtError(stmt, "22018", NULL, 0);
@@ -2370,7 +2370,7 @@ ODBCFetch(ODBCStmt *stmt,
case SQL_FLOAT:
case SQL_REAL:
/* reparse double and float, parse char */
- if (!(i = parseint(data, &nval))) {
+ if (!(i = parsebignum(data, &nval))) {
/* Invalid character value for cast
* specification */
addStmtError(stmt, "22018", NULL, 0);
@@ -3779,7 +3779,7 @@ ODBCStore(ODBCStmt *stmt,
case SQL_C_BINARY:
/* parse character data, reparse floating
* point number */
- if (!parseint(sval, &nval)) {
+ if (!parsebignum(sval, &nval)) {
/* Invalid character value for cast
* specification */
addStmtError(stmt, "22018", NULL, 0);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]