Permalink
Browse files

Fixed printf in new pyodbcconf.

Eliminated unused code.
Eliminated compiler warning.
  • Loading branch information...
1 parent eeede2f commit 7580498b9f8c8c7e08ad838a4447b6e2037a390d @mkleehammer committed Nov 25, 2010
Showing with 6 additions and 5 deletions.
  1. +0 −2 src/params.cpp
  2. +3 −0 src/row.cpp
  3. +3 −3 utils/pyodbcconf/pyodbcconf.cpp
View
@@ -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
@@ -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);
@@ -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);
}

0 comments on commit 7580498

Please sign in to comment.