473,387 Members | 1,493 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,387 software developers and data experts.

h2py.py bug?

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'

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?
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)

?

Thank you,
Gabriel

Jun 27 '08 #1
0 724

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 Genellina | last post by:
En Tue, 10 Jun 2008 09:44:13 -0300, Gabriel Rossetti <gabriel.rossetti@arimaz.comescribió: Very probably - bug reports outside the tracker are likely to go unnoticed or forgotten. It's...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.