PDA

View Full Version : md5.cpp - removing C4554 waning


ptarp
03-09-2010, 11:29 AM
Not sure where to put this, and I'm not even sure it makes a real difference snce it's just a warning anyways..

I compile a windows server and visual C++ 2008 spits out a lot of errors, so in an attempt to clean some up I saw this one, and quite a few others like it..
2>c:\users\public\emuserver\svn\branches\spellsbranc h\common\md5.cpp(199) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
These can be removed by changing line 191 from this
#define MD5STEP(f,w,x,y,z,in,s) (w += f(x,y,z)+in, w = (w<<s | w>>32-s) + x)
to this
#define MD5STEP(f,w,x,y,z,in,s) (w += f(x,y,z)+in, w = (w<<s | w>>(32-s)) + x)Sorry that's not a diff, but it's just a parenthesis change to tell the compiler to evaluate (32-s) first Can't remember where I found the info on what the line does, but I think that should be correct.
EDIT: Guess this possibly should have been in server: bug reports forum.