Skip to content

Commit df914b2

Browse files
committed
BLD: more msvc fixes
1 parent 20b8094 commit df914b2

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

pandas/src/ujson/python/objToJSON.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ void NpyArr_iterBegin(JSOBJ _obj, JSONTypeContext *tc)
228228
{
229229
PyArrayObject *obj;
230230
PyArray_Descr *dtype;
231+
NpyArrContext *npyarr;
231232

232233
if (GET_TC(tc)->newObj)
233234
{
@@ -241,7 +242,7 @@ void NpyArr_iterBegin(JSOBJ _obj, JSONTypeContext *tc)
241242
if (PyArray_SIZE(obj) > 0)
242243
{
243244
PRINTMARK();
244-
NpyArrContext *npyarr = PyObject_Malloc(sizeof(NpyArrContext));
245+
npyarr = PyObject_Malloc(sizeof(NpyArrContext));
245246
GET_TC(tc)->npyarr = npyarr;
246247

247248
if (!npyarr)
@@ -321,9 +322,10 @@ void NpyArrPassThru_iterBegin(JSOBJ obj, JSONTypeContext *tc)
321322

322323
void NpyArrPassThru_iterEnd(JSOBJ obj, JSONTypeContext *tc)
323324
{
325+
NpyArrContext* npyarr;
324326
PRINTMARK();
325327
// finished this dimension, reset the data pointer
326-
NpyArrContext* npyarr = GET_TC(tc)->npyarr;
328+
npyarr = GET_TC(tc)->npyarr;
327329
npyarr->curdim--;
328330
npyarr->dataptr -= npyarr->stride * npyarr->index[npyarr->stridedim];
329331
npyarr->stridedim -= npyarr->inc;
@@ -340,8 +342,9 @@ void NpyArrPassThru_iterEnd(JSOBJ obj, JSONTypeContext *tc)
340342

341343
int NpyArr_iterNextItem(JSOBJ _obj, JSONTypeContext *tc)
342344
{
345+
NpyArrContext* npyarr;
343346
PRINTMARK();
344-
NpyArrContext* npyarr = GET_TC(tc)->npyarr;
347+
npyarr = GET_TC(tc)->npyarr;
345348

346349
if (GET_TC(tc)->itemValue != npyarr->array)
347350
{
@@ -363,8 +366,9 @@ int NpyArr_iterNextItem(JSOBJ _obj, JSONTypeContext *tc)
363366

364367
int NpyArr_iterNext(JSOBJ _obj, JSONTypeContext *tc)
365368
{
369+
NpyArrContext* npyarr;
366370
PRINTMARK();
367-
NpyArrContext *npyarr = GET_TC(tc)->npyarr;
371+
npyarr = GET_TC(tc)->npyarr;
368372

369373
if (npyarr->curdim >= npyarr->ndim || npyarr->index[npyarr->stridedim] >= npyarr->dim)
370374
{
@@ -395,8 +399,9 @@ JSOBJ NpyArr_iterGetValue(JSOBJ obj, JSONTypeContext *tc)
395399

396400
char *NpyArr_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
397401
{
402+
NpyArrContext* npyarr;
398403
PRINTMARK();
399-
NpyArrContext *npyarr = GET_TC(tc)->npyarr;
404+
npyarr = GET_TC(tc)->npyarr;
400405
npy_intp idx;
401406
if (GET_TC(tc)->iterNext == NpyArr_iterNextItem)
402407
{
@@ -483,6 +488,8 @@ int Dir_iterNext(JSOBJ _obj, JSONTypeContext *tc)
483488
PyObject *obj = (PyObject *) _obj;
484489
PyObject *itemValue = GET_TC(tc)->itemValue;
485490
PyObject *itemName = NULL;
491+
PyObject* attr;
492+
char* attrStr;
486493

487494

488495
if (itemValue)
@@ -493,8 +500,8 @@ int Dir_iterNext(JSOBJ _obj, JSONTypeContext *tc)
493500

494501
for (; GET_TC(tc)->index < GET_TC(tc)->size; GET_TC(tc)->index ++)
495502
{
496-
PyObject* attr = PyList_GET_ITEM(GET_TC(tc)->attrList, GET_TC(tc)->index);
497-
char* attrStr = PyString_AS_STRING(attr);
503+
attr = PyList_GET_ITEM(GET_TC(tc)->attrList, GET_TC(tc)->index);
504+
attrStr = PyString_AS_STRING(attr);
498505

499506
if (attrStr[0] == '_')
500507
{
@@ -608,12 +615,13 @@ void Index_iterBegin(JSOBJ obj, JSONTypeContext *tc)
608615

609616
int Index_iterNext(JSOBJ obj, JSONTypeContext *tc)
610617
{
618+
Py_ssize_t index;
611619
if (!GET_TC(tc)->citemName)
612620
{
613621
return 0;
614622
}
615623

616-
Py_ssize_t index = GET_TC(tc)->index;
624+
index = GET_TC(tc)->index;
617625
Py_XDECREF(GET_TC(tc)->itemValue);
618626
if (index == 0)
619627
{
@@ -675,12 +683,13 @@ void Series_iterBegin(JSOBJ obj, JSONTypeContext *tc)
675683

676684
int Series_iterNext(JSOBJ obj, JSONTypeContext *tc)
677685
{
686+
Py_ssize_t index;
678687
if (!GET_TC(tc)->citemName)
679688
{
680689
return 0;
681690
}
682691

683-
Py_ssize_t index = GET_TC(tc)->index;
692+
index = GET_TC(tc)->index;
684693
Py_XDECREF(GET_TC(tc)->itemValue);
685694
if (index == 0)
686695
{
@@ -750,12 +759,13 @@ void DataFrame_iterBegin(JSOBJ obj, JSONTypeContext *tc)
750759

751760
int DataFrame_iterNext(JSOBJ obj, JSONTypeContext *tc)
752761
{
762+
Py_ssize_t index;
753763
if (!GET_TC(tc)->citemName)
754764
{
755765
return 0;
756766
}
757767

758-
Py_ssize_t index = GET_TC(tc)->index;
768+
index = GET_TC(tc)->index;
759769
Py_XDECREF(GET_TC(tc)->itemValue);
760770
if (index == 0)
761771
{

setup.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,17 @@
8383

8484
from os.path import splitext, basename, join as pjoin
8585

86-
DESCRIPTION = "Powerful data structures for data analysis and statistics"
86+
DESCRIPTION = ("Powerful data structures for data analysis, time series,"
87+
"and statistics")
8788
LONG_DESCRIPTION = """
8889
**pandas** is a Python package providing fast, flexible, and expressive data
89-
structures designed to make working with "relational" or "labeled" data both
90-
easy and intuitive. It aims to be the fundamental high-level building block for
91-
doing practical, **real world** data analysis in Python. Additionally, it has
92-
the broader goal of becoming **the most powerful and flexible open source data
93-
analysis / manipulation tool available in any language**. It is already well on
94-
its way toward this goal.
90+
structures designed to make working with structured (tabular, multidimensional,
91+
potentially heterogeneous) and time series data both easy and intuitive. It
92+
aims to be the fundamental high-level building block for doing practical,
93+
**real world** data analysis in Python. Additionally, it has the broader goal
94+
of becoming **the most powerful and flexible open source data analysis /
95+
manipulation tool available in any language**. It is already well on its way
96+
toward this goal.
9597
9698
pandas is well suited for many different kinds of data:
9799

0 commit comments

Comments
 (0)