pydata/pandas — pull request #1380 by thuske (2012-06-02 06:19:39+00:00)
Title: ujson fix compile error using clang on Mac OS Lion

I had the compile error below when I built 0.8.0 beta1. The build was on Mac OS X 10.7.3, using python.org's python version 2.7.3, numpy version 1.6.2, Apple clang version 3.1.

clang: pandas/src/ujson/python/JSONtoObj.c
pandas/src/ujson/python/JSONtoObj.c:159:36: error: expression is not assignable
((char*)PyArray_DATA(ret)) = new_data;
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
pandas/src/ujson/python/JSONtoObj.c:292:44: error: expression is not assignable
((char*)PyArray_DATA(npyarr->ret)) = new_data;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

This patch changes those lines to use PyArray_BYTES instead, so that the assignment is to an lvalue. The build then succeeds, and nose tests pass. I also successfully tested on a linux box (Scientific Linux 6.0), running python 2.6.6, numpy 1.6.2, and gcc 4.4.4. (I don't have a windows box to test on)