EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   md5.cpp - removing C4554 waning (https://www.eqemulator.org/forums/showthread.php?t=30768)

ptarp 03-09-2010 11:29 AM

md5.cpp - removing C4554 waning
 
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..
Code:

2>c:\users\public\emuserver\svn\branches\spellsbranch\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
Code:

#define MD5STEP(f,w,x,y,z,in,s) (w += f(x,y,z)+in, w = (w<<s | w>>32-s) + x)
to this
Code:

#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.


All times are GMT -4. The time now is 09:19 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.