Skip to content

Commit

Permalink
Convert tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gordthompson authored and mkleehammer committed Sep 8, 2024
1 parent 7aa8536 commit d11592c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions src/getdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,30 +535,30 @@ static PyObject* GetDataTimestamp(Cursor* cur, Py_ssize_t iCol)

switch (cur->colinfos[iCol].sql_type)
{
case SQL_TYPE_TIME:
{
int micros = (int)(value.fraction / 1000); // nanos --> micros
return PyTime_FromTime(value.hour, value.minute, value.second, micros);
}
case SQL_TYPE_TIME:
{
int micros = (int)(value.fraction / 1000); // nanos --> micros
return PyTime_FromTime(value.hour, value.minute, value.second, micros);
}

case SQL_TYPE_DATE:
case SQL_TYPE_DATE:
case SQL_DATE:
return PyDate_FromDate(value.year, value.month, value.day);
return PyDate_FromDate(value.year, value.month, value.day);

case SQL_TYPE_TIMESTAMP:
case SQL_TYPE_TIMESTAMP:
case SQL_TIMESTAMP:
{
if (value.year < 1)
{
value.year = 1;
}
else if (value.year > 9999)
{
value.year = 9999;
}
}
{
if (value.year < 1)
{
value.year = 1;
}
else if (value.year > 9999)
{
value.year = 9999;
}
}
}


int micros = (int)(value.fraction / 1000); // nanos --> micros

Expand Down Expand Up @@ -779,7 +779,7 @@ PyObject *GetData_SqlVariant(Cursor *cur, Py_ssize_t iCol) {
// the ODBC driver read the sql_variant header which contains the underlying data type
pBuff = 0;
indicator = 0;
retcode = SQLGetData(cur->hstmt, static_cast<SQLSMALLINT>(iCol + 1), SQL_C_BINARY,
retcode = SQLGetData(cur->hstmt, static_cast<SQLSMALLINT>(iCol + 1), SQL_C_BINARY,
&pBuff, 0, &indicator);
if (!SQL_SUCCEEDED(retcode))
return RaiseErrorFromHandle(cur->cnxn, "SQLGetData", cur->cnxn->hdbc, cur->hstmt);
Expand Down
2 changes: 1 addition & 1 deletion src/pyodbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ inline void DebugTrace(const char* szFmt, ...) { UNUSED(szFmt); }

// issue #880: entry missing from iODBC sqltypes.h
#ifndef BYTE
typedef unsigned char BYTE;
typedef unsigned char BYTE;
#endif
bool PyMem_Realloc(BYTE** pp, size_t newlen);
// A wrapper around realloc with a safer interface. If it is successful, *pp is updated to the
Expand Down

0 comments on commit d11592c

Please sign in to comment.