Jump to content
  • Advertisement
Sign in to follow this  
Alex Pavel

PyModule_AddIntConstat problem

This topic is 1180 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi dev's

I have some problem with PyModule_AddIntConstant because max value for this function si long how can i make this unsigned long long?

Share this post


Link to post
Share on other sites
Advertisement
The problem here is that Python Integer objects can't hold the full range of an unsigned long. You need a Python Long object instead if the value falls out of range. Use PyLong_FromUnsignedLong() to create the Long object and PyModule_AddObject() to add it to the module. Alternately, if you're on a platform where size_t is at least as large as long, you can try using PyInt_FromSize_t(), which will create an Integer object if the value is small enough and a Long object if the value doesn't fit inside an Integer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!