Re: porting C code

2005-01-15 Thread Lucas Raab
Peter Hansen wrote: Lucas Raab wrote: Sorry, the third "byte" is what I meant. Fair enough. Note, however, that as someone pointed out, it's actually the *fourth* of something, and it would not necessarily be a byte. In fact, in your case, it's not: typedef unsigned long int word32 ; void mu

Re: porting C code

2005-01-14 Thread Peter Hansen
Lucas Raab wrote: Sorry, the third "byte" is what I meant. Fair enough. Note, however, that as someone pointed out, it's actually the *fourth* of something, and it would not necessarily be a byte. In fact, in your case, it's not: typedef unsigned long int word32 ; void mu(word32 *a) { int i ;

Re: porting C code

2005-01-14 Thread Duncan Booth
Lucas Raab wrote: > Sorry, the third "byte" is what I meant. As for code samples, I hope the > following will work: > > typedef unsigned long int word32 ; > void mu(word32 *a) > { > int i ; > word32 b[3] ; > > b[0] = b[1] = b[2] = 0 ; > for( i=0 ; i<32 ; i++ ) > { > b[0] <<= 1 ; b[1]

Re: porting C code

2005-01-14 Thread Lucas Raab
Peter Hansen wrote: Lucas Raab wrote: I have the statement: "typedef unsigned long int word32" and later on: "word32 b[3]" referencing the third bit of the integer. If that's really exactly what you have, then you actually have something defining an array of three unsigned long integers named

Re: porting C code

2005-01-13 Thread Peter Hansen
Peter Hansen wrote: but merely a "b[3]" reference somewhere, it would be referencing the third element of an array called "b", which is possibly a byte, "*Fourth* element... I'll come in again. Amongst our elements..." -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: porting C code

2005-01-13 Thread Peter Hansen
Lucas Raab wrote: I have the statement: "typedef unsigned long int word32" and later on: "word32 b[3]" referencing the third bit of the integer. If that's really exactly what you have, then you actually have something defining an array of three unsigned long integers named "b". And even if y

Re: porting C code

2005-01-13 Thread Roy Smith
Lucas Raab <[EMAIL PROTECTED]> wrote: > I am currently in the process of porting some C code into Python and am > stuck. I don't claim to be the greatest C/C++ programmer; in fact, my > skills at C are rudimentary at best. My question is I have the > statement: "typedef unsigned long int word

Re: porting C code

2005-01-13 Thread Steven Bethard
Lucas Raab wrote: I am currently in the process of porting some C code into Python and am stuck. I don't claim to be the greatest C/C++ programmer; in fact, my skills at C are rudimentary at best. My question is I have the statement: "typedef unsigned long int word32" and later on: "word32 b