Skip to content

Commit c0eb022

Browse files
committed
Adjust variable names
1 parent 2d9fec2 commit c0eb022

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/cursor.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ static bool DetectConfigChange(Cursor* cur)
397397
{
398398
return false;
399399
}
400-
if (cur->converted_types)
400+
if (cur->bound_converted_types)
401401
{
402-
switch (PyObject_RichCompareBool(cur->converted_types, converted_types, Py_EQ))
402+
switch (PyObject_RichCompareBool(cur->bound_converted_types, converted_types, Py_EQ))
403403
{
404404
case -1: // error
405405
Py_DECREF(converted_types);
@@ -417,16 +417,16 @@ static bool DetectConfigChange(Cursor* cur)
417417
converted_types_changed = true;
418418
}
419419
}
420-
else if (cur->converted_types)
420+
else if (cur->bound_converted_types)
421421
{
422422
converted_types_changed = true;
423423
}
424424

425-
if (cur->UseNativeUUID != native_uuid || converted_types_changed)
425+
if (cur->bound_native_uuid != native_uuid || converted_types_changed)
426426
{
427-
Py_XDECREF(cur->converted_types);
428-
cur->converted_types = converted_types;
429-
cur->UseNativeUUID = native_uuid;
427+
Py_XDECREF(cur->bound_converted_types);
428+
cur->bound_converted_types = converted_types;
429+
cur->bound_native_uuid = native_uuid;
430430

431431
if (cur->description != Py_None)
432432
{
@@ -442,6 +442,7 @@ static bool DetectConfigChange(Cursor* cur)
442442
return true;
443443
}
444444

445+
445446
static bool free_results(Cursor* self, int flags)
446447
{
447448
// Internal function called any time we need to free the memory associated with query results. It is safe to call
@@ -463,7 +464,7 @@ static bool free_results(Cursor* self, int flags)
463464
{
464465
BindColsFree(self, PyTuple_GET_SIZE(self->description));
465466
}
466-
Py_XDECREF(self->converted_types);
467+
Py_XDECREF(self->bound_converted_types);
467468

468469
if (self->colinfos)
469470
{
@@ -702,19 +703,19 @@ static bool PrepareResults(Cursor* cur, int cCols)
702703
}
703704
}
704705

705-
cur->UseNativeUUID = UseNativeUUID();
706+
cur->bound_native_uuid = UseNativeUUID();
706707
if (cur->cnxn->map_sqltype_to_converter)
707708
{
708-
cur->converted_types = PyDict_Keys(cur->cnxn->map_sqltype_to_converter);
709-
if (!cur->converted_types)
709+
cur->bound_converted_types = PyDict_Keys(cur->cnxn->map_sqltype_to_converter);
710+
if (!cur->bound_converted_types)
710711
{
711712
PyMem_Free(cur->colinfos);
712713
return false;
713714
}
714715
}
715716
else
716717
{
717-
cur->converted_types = 0;
718+
cur->bound_converted_types = 0;
718719
}
719720

720721
if (!BindCols(cur, cCols))
@@ -2660,8 +2661,8 @@ Cursor_New(Connection* cnxn)
26602661
cur->messages = Py_None;
26612662
cur->valueBufs = 0;
26622663
cur->cbFetchedBufs = 0;
2663-
cur->converted_types = 0;
2664-
cur->UseNativeUUID = 0;
2664+
cur->bound_converted_types = 0;
2665+
cur->bound_native_uuid = 0;
26652666

26662667
Py_INCREF(cnxn);
26672668
Py_INCREF(cur->description);

src/cursor.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,8 @@ struct Cursor
160160
SQLLEN* cbFetchedBufs;
161161

162162
// Track the configuration at the time of using SQLBindCol.
163-
bool UseNativeUUID;
164-
PyObject* converted_types;
165-
// SQLSMALLINT* converted_types;
166-
// int num_converted_types;
163+
bool bound_native_uuid;
164+
PyObject* bound_converted_types;
167165
};
168166

169167
void Cursor_init();

0 commit comments

Comments
 (0)