[Tutor] help with translating a c function to a python function

Alan Gauld alan.gauld at btinternet.com
Thu Jul 5 19:29:11 CEST 2007


"shawn bright" <nephish at gmail.com> wrote
while (usDataLen––)
        {
        uIndex = uchCRCHi ^ *puchMsgg++ ;
        uchCRCHi = uchCRCLo ^ auchCRCHi[uIndex} ;
        uchCRCLo = auchCRCLo[uIndex] ;
        }
    return (uchCRCHi << 8 | uchCRCLo) ;
}

> this part ' auchCRCHi[uIndex};
> it looks like a typo, because there is a closing } that does not 
> match
> the opening [.

Its probably a typo but there is one (pretty remote, and horrible)
possible way for it to be valid which is if uIndex is a macro that
expands to complete the square bracket expression and introduce
an expression which needs a brace to finish it. But thats
just perverse, so I think its a mistake! (Especially since I just
noticed uIndex is used elsewhere without any closing brace)

Alan G. 




More information about the Tutor mailing list