Skip to content

ujson tabs -> spaces and plug some memory leaks #1309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Komnomnomnom
Copy link
Contributor

The ujson source code was tab-intended, this commit converts the ugly tabs to (four) spaces.

Also fixed some memory leaks and some compiler warnings.

All tests pass, tested on 64 bit OSX and 32 bit Ubuntu with Python 2.7.

@wesm
Copy link
Member

wesm commented May 24, 2012

Cool, this looks good. I'm going to try to get this building with MSVC today so that things pass on Win32/Win64. Note: MSVC is very strict about C variable declarations (have to be the first thing to appear in functions). gcc is more loosey-goosey.

@wesm wesm closed this May 24, 2012
@Komnomnomnom
Copy link
Contributor Author

Ah I wasn't aware of that thanks, my main experience is with C++ and gcc.

@wesm
Copy link
Member

wesm commented May 24, 2012

@wesm
Copy link
Member

wesm commented May 24, 2012

How important is the npymath dependency? I think it only affects halffloat? I am having an absolutely wretched time trying to get it to link on Windows 32-bit (works in win64)

@Komnomnomnom
Copy link
Contributor Author

Half float is probably not that important but off the top of my head I think the nan and infinity checking functions are from npymath too.

http://docs.scipy.org/doc/numpy/reference/c-api.coremath.html

There might be alternatives I'm not aware of though?

@wesm
Copy link
Member

wesm commented May 24, 2012

I think the issue is that the official NumPy installers are built with mingw32 and not the VS2008 compiler (FML). As such the npymath.lib file is incompatible. Going to build NumPy 1.6.2 from source. I don't think I've ever hated Microsoft so much

@wesm
Copy link
Member

wesm commented May 24, 2012

Building NumPy from source with VS2008 did the trick. Fun times

@Komnomnomnom
Copy link
Contributor Author

Nice one. They do have a reputation to uphold after all:

  • internet explorer - bane of web development
  • windows - bane of python extension development
  • msvc - bane of C development

On a brighter note I read today that Python is finally moving towards a new VS version http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+PythonInsider+%28Python+Insider%29

I've always built any extensions using minggw on my Windows VM but in future I might test my builds on msvc aswell, save others the pain ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants