Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Hi John! John Machin escribió: >On 22/05/2006 5:22 AM, Gonzalo Monzón wrote: > > >>Thank you for all the suggestions! :-) >> >>The C routine is almost -changing data type long for word- a copy of the >>function given by a hardware manufacturer, the same code used in their >>firmware to calc t

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
On 22/05/2006 5:22 AM, Gonzalo Monzón wrote: > Thank you for all the suggestions! :-) > > The C routine is almost -changing data type long for word- a copy of the > function given by a hardware manufacturer, the same code used in their > firmware to calc the checksum of every piece of data sent

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Thank you for all the suggestions! :-) The C routine is almost -changing data type long for word- a copy of the function given by a hardware manufacturer, the same code used in their firmware to calc the checksum of every piece of data sent or received, and that data is somewhat special: it doe

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
Gonzalo wrote: """ I missed the point to add the *and* to workaround the long result issue! I think I understand it now. I am timing the code once translated, so here are the results for the crc calculation function. """ Yes, and both of us were missing the point that the "16" means 16 bits wide!

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Thank you very much John, I missed the point to add the *and* to workaround the long result issue! I think I understand it now. I am timing the code once translated, so here are the results for the crc calculation function. I did expected a big gap, as this does a lot of lookups to the crc tab

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
For a start, >>> 22002496167782427386022437441624938050682666541682 & 0xL 67560050L >>> so you could just do that at the end. But you don't really want to be carrying all that rubbish around, getting longer and longer each time around the loop. And let's further the translation into Python

Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
I reply again attaching a file as I see the editor wrecked the tab indentation. Gonzalo Monzón escribió: Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose

Re: Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
I reply again attaching a file as I see the editor wrecked the tab indentation. Gonzalo Monzón escribió: Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose

Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose its a must 2.4 as it is the last PythonCE release with great improvements). But I've been stuck with a scri