From 30013ffab514793477e755bda09fb3839df6cb02 Mon Sep 17 00:00:00 2001 From: ultramage Date: Sun, 17 Aug 2008 06:06:28 +0000 Subject: Fixed some messed up operator priority in the mapreg code (bugreport:2078). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13088 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mapreg_sql.c | 16 ++++++++-------- src/map/mapreg_txt.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 401367611..89951fb76 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -36,8 +36,8 @@ char* mapreg_readregstr(int uid) /// Modifies the value of an integer variable. bool mapreg_setreg(int uid, int val) { - int num = uid & 0x00ffffff; - int i = uid & 0xff000000 >> 24; + int num = (uid & 0x00ffffff); + int i = (uid & 0xff000000) >> 24; const char* name = get_str(num); if( val != 0 ) @@ -75,8 +75,8 @@ bool mapreg_setreg(int uid, int val) /// Modifies the value of a string variable. bool mapreg_setregstr(int uid, const char* str) { - int num = uid & 0x00ffffff; - int i = uid & 0xff000000 >> 24; + int num = (uid & 0x00ffffff); + int i = (uid & 0xff000000) >> 24; const char* name = get_str(num); if( str == NULL || *str == 0 ) @@ -159,8 +159,8 @@ static void script_save_mapreg(void) iter = mapreg_db->iterator(mapreg_db); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - int num = key.i & 0x00ffffff; - int i = key.i & 0xff000000 >> 24; + int num = (key.i & 0x00ffffff); + int i = (key.i & 0xff000000) >> 24; const char* name = get_str(num); if( name[1] == '@' ) @@ -174,8 +174,8 @@ static void script_save_mapreg(void) iter = mapregstr_db->iterator(mapregstr_db); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - int num = key.i & 0x00ffffff; - int i = key.i & 0xff000000 >> 24; + int num = (key.i & 0x00ffffff); + int i = (key.i & 0xff000000) >> 24; const char* name = get_str(num); char tmp_str2[2*255+1]; diff --git a/src/map/mapreg_txt.c b/src/map/mapreg_txt.c index f8cfcd6bf..53d05c98b 100644 --- a/src/map/mapreg_txt.c +++ b/src/map/mapreg_txt.c @@ -115,8 +115,8 @@ static void script_save_mapreg(void) iter = mapreg_db->iterator(mapreg_db); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - int num = key.i & 0x00ffffff; - int i = key.i & 0xff000000 >> 24; + int num = (key.i & 0x00ffffff); + int i = (key.i & 0xff000000) >> 24; const char* name = get_str(num); if( name[1] == '@' ) @@ -132,8 +132,8 @@ static void script_save_mapreg(void) iter = mapregstr_db->iterator(mapregstr_db); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { - int num = key.i & 0x00ffffff; - int i = key.i & 0xff000000 >> 24; + int num = (key.i & 0x00ffffff); + int i = (key.i & 0xff000000) >> 24; const char* name = get_str(num); if( name[1] == '@' ) -- cgit v1.2.3-70-g09d2