apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r124243 - /apr/apr/trunk/random/unix/sha2.c
Date Thu, 13 Jan 2005 21:01:48 GMT
Yes, language was insufficient, it should have said something
like 'Cleanup four quadword->dword truncation warnings, the
modulo operator ensures the resulting quantity can safely 
be cast down to a dword.'

A comment in the code apologizing for the cast would also
be worthwhile, I'll do that before backporting.

If I hear no negative feedback, I'll commit Sunday with comment
to 1.0 / 0.9 so they both compile cleanly and such warnings
don't alarm end users.

Bill

At 12:19 PM 1/11/2005, Julian Foad wrote:
>William A. Rowe, Jr. wrote:
>>Can I have a second set of eyes for a reality check before
>>I backport this compile-time cleanup?
>
>It looks fine to me, if you think it is appropriate to back-port such a clean-up.
>
>The log message is rather difficult to understand.
>
>- Julian
>
>
>[...]
>>>Log:
>>>
>>>Clean up 4 extranious emits.  Because of the modulo operator, these
>>>becomes safe casts to unsigned.
>[...]
>>>-        usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
>>>+        usedspace = (unsigned int)((context->bitcount >> 3) +      
                          % SHA256_BLOCK_LENGTH);
>[...]
>
>



Mime
View raw message