Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
qualify strtoull/strtoll with std namespace
The included header is cstdlib, not stdlib.h, so global/C versions
can be visible only as a side effect, but it is better to use
proper versions in std::.

This caused a problem at least on FreeBSD.
  • Loading branch information
avg-I committed Jan 28, 2013
1 parent ba4812e commit a647328
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/backends/oracle/standard-into-type.cpp
Expand Up @@ -185,15 +185,15 @@ void oracle_standard_into_type_backend::post_fetch(
if (indOCIHolder_ != -1)
{
long long *v = static_cast<long long *>(data_);
*v = strtoll(buf_, NULL, 10);
*v = std::strtoll(buf_, NULL, 10);
}
}
else if (type_ == x_unsigned_long_long)
{
if (indOCIHolder_ != -1)
{
unsigned long long *v = static_cast<unsigned long long *>(data_);
*v = strtoull(buf_, NULL, 10);
*v = std::strtoull(buf_, NULL, 10);
}
}
else if (type_ == x_stdtm)
Expand Down
4 changes: 2 additions & 2 deletions src/backends/oracle/standard-use-type.cpp
Expand Up @@ -343,7 +343,7 @@ void oracle_standard_use_type_backend::post_use(bool gotData, indicator *ind)
if (readOnly_)
{
long long const original = *static_cast<long long *>(data_);
long long const bound = strtoll(buf_, NULL, 10);
long long const bound = std::strtoll(buf_, NULL, 10);

if (original != bound)
{
Expand All @@ -355,7 +355,7 @@ void oracle_standard_use_type_backend::post_use(bool gotData, indicator *ind)
if (readOnly_)
{
unsigned long long const original = *static_cast<unsigned long long *>(data_);
unsigned long long const bound = strtoull(buf_, NULL, 10);
unsigned long long const bound = std::strtoull(buf_, NULL, 10);

if (original != bound)
{
Expand Down
4 changes: 2 additions & 2 deletions src/backends/oracle/vector-into-type.cpp
Expand Up @@ -213,7 +213,7 @@ void oracle_vector_into_type_backend::post_fetch(bool gotData, indicator *ind)
{
if (indOCIHolderVec_[i] != -1)
{
v[i] = strtoll(pos, NULL, 10);
v[i] = std::strtoll(pos, NULL, 10);
}
pos += colSize_;
}
Expand All @@ -231,7 +231,7 @@ void oracle_vector_into_type_backend::post_fetch(bool gotData, indicator *ind)
{
if (indOCIHolderVec_[i] != -1)
{
v[i] = strtoull(pos, NULL, 10);
v[i] = std::strtoull(pos, NULL, 10);
}
pos += colSize_;
}
Expand Down
2 changes: 1 addition & 1 deletion src/backends/postgresql/statement.cpp
Expand Up @@ -451,7 +451,7 @@ long long postgresql_statement_backend::get_affected_rows()
{
const char * resultStr = PQcmdTuples(result_);
char * end;
long long result = strtoll(resultStr, &end, 0);
long long result = std::strtoll(resultStr, &end, 0);
if (end != resultStr)
{
return result;
Expand Down
4 changes: 2 additions & 2 deletions src/backends/sqlite3/standard-into-type.cpp
Expand Up @@ -107,7 +107,7 @@ void sqlite3_standard_into_type_backend::post_fetch(bool gotData,
case x_long_long:
{
long long* dest = static_cast<long long*>(data_);
*dest = strtoll(buf, NULL, 10);
*dest = std::strtoll(buf, NULL, 10);
}
break;
case x_unsigned_long_long:
Expand Down Expand Up @@ -136,7 +136,7 @@ void sqlite3_standard_into_type_backend::post_fetch(bool gotData,

rowid *rid = static_cast<rowid *>(data_);
sqlite3_rowid_backend *rbe = static_cast<sqlite3_rowid_backend *>(rid->get_backend());
long long val = strtoll(buf, NULL, 10);
long long val = std::strtoll(buf, NULL, 10);
rbe->value_ = static_cast<unsigned long>(val);
}
break;
Expand Down

0 comments on commit a647328

Please sign in to comment.