From: TimePath Date: Sat, 25 Apr 2015 06:32:36 +0000 (+1000) Subject: Declare more ints as ints X-Git-Tag: xonotic-v0.8.1~61^2~28 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=301453d310eb2454cb4fedf0e7486c6616ef2e3f;p=xonotic%2Fxonotic-data.pk3dir.git Declare more ints as ints --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index f47bcf15a..bc516fcea 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2294,7 +2294,7 @@ float xdecode(string s) return ((a * 22 + b) * 22 + c) * 22 + d; } -float lowestbit(int f) +int lowestbit(int f) { f &= ~(f * 2); f &= ~(f * 4); diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index a59d31cac..7e601fdd4 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -296,7 +296,7 @@ float xdecode(string s); // Otherwise, channels 8 to 15 would be blocked for a weird QW feature. #define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0) -float lowestbit(float f); +int lowestbit(float f); #ifdef CSQC entity ReadCSQCEntity(); diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 2cc8e0215..b65a660f0 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -132,7 +132,7 @@ void ImpulseCommands (void) if(self.deadflag == DEAD_NO) { // custom order weapon cycling - i = imp % 10; + int i = imp % 10; m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m); } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 788eb345f..0adae54b2 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -293,10 +293,10 @@ float Obituary_WeaponDeath( if(death_weapon) { w_deathtype = deathtype; - float death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE)); + int death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE)); w_deathtype = false; - if(death_message) + if (death_message) { Send_Notification_WOCOVA( NOTIF_ONE, diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index f0b953704..6a6c89b76 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -133,7 +133,7 @@ float GrapplingHookSend(entity to, int sf) void GrapplingHookThink() { - float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch, s; + float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch; vector dir, org, end, v0, dv, v, myorg, vs; if(self.realowner.hook != self) // how did that happen? { @@ -150,7 +150,7 @@ void GrapplingHookThink() self.nextthink = time; - s = self.realowner.cvar_cl_gunalign; + int s = self.realowner.cvar_cl_gunalign; if(s != 1 && s != 2 && s != 4) s = 3; // default value --s; @@ -315,7 +315,6 @@ void FireGrapplingHook (void) { entity missile; vector org; - float s; vector vs; if(forbidWeaponUse()) return; @@ -323,7 +322,7 @@ void FireGrapplingHook (void) makevectors(self.v_angle); - s = self.cvar_cl_gunalign; + int s = self.cvar_cl_gunalign; if(s != 1 && s != 2 && s != 4) s = 3; // default value --s; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 345bc5bc1..712f30182 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -576,7 +576,7 @@ void WeaponStats_Init(); void WeaponStats_Shutdown(); void spawnfunc_worldspawn (void) { - float fd, l, i, j, n; + float fd, l, j, n; string s; cvar = cvar_normal; @@ -839,7 +839,7 @@ void spawnfunc_worldspawn (void) maplist_reply = strzone(getmaplist()); lsmaps_reply = strzone(getlsmaps()); monsterlist_reply = strzone(getmonsterlist()); - for(i = 0; i < 10; ++i) + for(int i = 0; i < 10; ++i) { s = getrecords(i); if (s) @@ -862,7 +862,7 @@ void spawnfunc_worldspawn (void) { s = ""; n = tokenize_console(cvar_string("sv_curl_serverpackages")); - for(i = 0; i < n; ++i) + for(int i = 0; i < n; ++i) if(substring(argv(i), -18, -1) != "-serverpackage.txt") if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy s = strcat(s, " ", argv(i)); @@ -870,7 +870,7 @@ void spawnfunc_worldspawn (void) if(fd >= 0) { j = search_getsize(fd); - for(i = 0; i < j; ++i) + for(int i = 0; i < j; ++i) s = strcat(s, " ", search_getfilename(fd, i)); search_end(fd); } @@ -878,7 +878,7 @@ void spawnfunc_worldspawn (void) if(fd >= 0) { j = search_getsize(fd); - for(i = 0; i < j; ++i) + for(int i = 0; i < j; ++i) s = strcat(s, " ", search_getfilename(fd, i)); search_end(fd); } diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index f4893094e..b2bbd86cc 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -38,9 +38,6 @@ bool item_keys_usekey(entity l, entity p) { } string item_keys_keylist(float keylist) { - float base, l; - string n; - // no keys if (!keylist) return ""; @@ -49,10 +46,10 @@ string item_keys_keylist(float keylist) { if ((keylist & (keylist-1)) != 0) return strcat("the ", item_keys_names[lowestbit(keylist)]); - n = ""; - base = 0; + string n = ""; + int base = 0; while (keylist) { - l = lowestbit(keylist); + int l = lowestbit(keylist); if (n) n = strcat(n, ", the ", item_keys_names[base + l]); else