473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Re: h2py.py bug?

En Tue, 10 Jun 2008 09:44:13 -0300, Gabriel Rossetti
<ga**************@arimaz.comescribió:
I wanted to use the h2py.py script (Tools/scripts/h2py.py) and it didn't
like char litterals :

Skipping: PC_ERROR = ord()

where my *.h file contained :

#define PC_ERROR '0'

I searched the web and found a post with the same error :

http://mail.python.org/pipermail/pyt...er/340608.html

but it got no replies, I tried the fix and it works. I have the
following questions:

1) Why did it not get any attention, is something wrong with it?
2) If nothing is wrong, did the fix not get applied because a bug report
wasn't filed?
Very probably - bug reports outside the tracker are likely to go unnoticed
or forgotten.
3) Isn't turning a char literal into the ordinal value not contrary to
what a C programmer had in mind when he/she defined it? I mean if you
define a char literal then in python you would have used a string value :

#define PC_ERROR '0'

would become :

PC_ERROR = '0'

in python, and if you intended to use the char type for an 8 bit
numerical value you would have done :

#define PC_ERROR 0x30

where 0x30 is the '0' ascii hex value, so shouldn'it the line in the
diff (see the post) be :

body = p_char.sub("'\\1'", body)

instead of :

body = p_char.sub("ord('\\1')", body)
It's not so clear what's the intended usage - chars are also integers in
C. (I prefer the current behavior, but certainly it may be wrong in
several places).

--
Gabriel Genellina

Jun 27 '08 #1
0 1299

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: lsmithso | last post by:
Python 2.3.4 on RedHat Linux FC3. Tools/scripts/h2py.py doesn't translate C char literals. When I feed it a .h file with the single line: #define GOO 'L' It throws out: Skipping: GOO =...
0
by: Gabriel Rossetti | last post by:
Hello everyone, I wanted to use the h2py.py script (Tools/scripts/h2py.py) and it didn't like char litterals : Skipping: PC_ERROR = ord() where my *.h file contained : #define PC_ERROR...
0
by: Gabriel Rossetti | last post by:
Gabriel Genellina wrote: Ok, I'll file one then. Yes, true, but if you intend to use it as an integer, wouldn't you use a numeric value instead of a character literal?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.