Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed printf in new pyodbcconf.

Eliminated unused code.
Eliminated compiler warning.
  • Loading branch information...
commit 7580498b9f8c8c7e08ad838a4447b6e2037a390d 1 parent eeede2f
@mkleehammer authored
View
2  src/params.cpp
@@ -267,8 +267,6 @@ static bool GetIntInfo(Cursor* cur, Py_ssize_t index, PyObject* param, ParamInfo
static bool GetLongInfo(Cursor* cur, Py_ssize_t index, PyObject* param, ParamInfo& info)
{
// TODO: Overflow?
- long long value = PyLong_AsLongLong(param);
-
info.Data.i64 = (INT64)PyLong_AsLongLong(param);
info.ValueType = SQL_C_SBIGINT;
View
3  src/row.cpp
@@ -264,6 +264,9 @@ static PyObject* Row_richcompare(PyObject* olhs, PyObject* orhs, int op)
case Py_LE: result = (lhs->cValues <= rhs->cValues); break;
case Py_LT: result = (lhs->cValues < rhs->cValues); break;
case Py_NE: result = (lhs->cValues != rhs->cValues); break;
+ default:
+ // Can't get here, but don't have a cross-compiler way to silence this.
+ result = false;
}
PyObject* p = result ? Py_True : Py_False;
Py_INCREF(p);
View
6 utils/pyodbcconf/pyodbcconf.cpp
@@ -55,10 +55,10 @@ static PyObject* mod_configure(PyObject* self)
fprintf(f, "[define_macros]\n");
fprintf(f, "PYODBC_VERSION: %s\n", TOSTRING(PYODBC_VERSION));
- fprintf(f, "SQLWCHAR_SIZE: %d\n", sizeof(SQLWCHAR));
+ fprintf(f, "SQLWCHAR_SIZE: %d\n", (int)sizeof(SQLWCHAR));
#if HAVE_WCHAR_H
- fprintf(f, "WCHAR_T_SIZE: %d\n", sizeof(wchar_t));
+ fprintf(f, "WCHAR_T_SIZE: %d\n", (int)sizeof(wchar_t));
#endif
fclose(f);
@@ -74,5 +74,5 @@ static PyMethodDef methods[] =
PyMODINIT_FUNC initpyodbcconf()
{
- PyObject* mod = Py_InitModule4("pyodbcconf", methods, 0, 0, PYTHON_API_VERSION);
+ Py_InitModule4("pyodbcconf", methods, 0, 0, PYTHON_API_VERSION);
}
Please sign in to comment.
Something went wrong with that request. Please try again.