Skip to content

Commit 2360026

Browse files
committed
fix: fix gcc warnings
1 parent fd89ab5 commit 2360026

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/_libs/src/parser/json.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,22 @@ static PyObject *big_int_to_pylong(ondemand::value element) {
5959

6060
static PyObject *json_number_to_pyobject(ondemand::value element) {
6161
ondemand::number num = element.get_number();
62+
PyObject *result;
6263
switch (num.get_number_type()) {
6364
case ondemand::number_type::signed_integer:
64-
return PyLong_FromLongLong(num.get_int64());
65+
result = PyLong_FromLongLong(num.get_int64());
6566
break;
6667
case ondemand::number_type::unsigned_integer:
67-
return PyLong_FromUnsignedLongLong(num.get_uint64());
68+
result = PyLong_FromUnsignedLongLong(num.get_uint64());
6869
break;
6970
case ondemand::number_type::floating_point_number:
70-
return PyFloat_FromDouble(num.get_double());
71+
result = PyFloat_FromDouble(num.get_double());
7172
break;
7273
case ondemand::number_type::big_integer:
73-
return big_int_to_pylong(element);
74+
result = big_int_to_pylong(element);
7475
break;
7576
}
77+
return result;
7678
}
7779

7880
static PyObject *json_str_to_pyobject(ondemand::value element) {
@@ -124,7 +126,7 @@ PyObject *json_loads(PyObject *Py_UNUSED(self), PyObject *args,
124126
return NULL;
125127
}
126128

127-
PyObject *ret;
129+
PyObject *ret = NULL;
128130
try {
129131
simdjson::padded_string padded_json(buf, len);
130132
simdjson::ondemand::document doc =

0 commit comments

Comments
 (0)