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
h2py char literal doesn't work #47327
Comments
Tools/scripts/h2py.py doesn't work with char literals in a define. This http://mail.python.org/pipermail/python-list/2005-September/340608.html The fix works, I have included the patch as h2py.py.patch2. Also, the current thing that is done when a char literal is encountered #define EXIT_CHAR 'x' /* ..... */ if(char_read == EXIT_CHAR)
exit(0) and not an integer/numeric value, and if you intend to do numerical This is the way ctypes does it with their h2xml.py & xml2py.py scripts. So currently, a defines like the following : #define EXIT_CHAR 'x'
#define MASK 0xfe
#define LIMIT 4 give (after the h2py.py.patch2 being applied) : EXIT_CHAR = 120
MASK = 0xfe
LIMIT = 4 and the second patch I am submitting (h2py.py.patch) makes it give : EXIT_CHAR = 'x'
MASK = 0xfe
LIMIT = 4 which I think is a better interpretation of the intent of the defines. So to resume : h2py.py.patch2 : this fixes the bug, maintaining the way the original h2py.py.patch : this fixes the bug, but makes a char literal become a Gabriel |
Both patch files are two liners, could someone please take a look and decide if one of them can be accepted? |
Fixed in r85770. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: