From cdbdc937bed03f2ca130b1f564e29ed0ab9e3b4c Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 3 Nov 2010 22:19:19 +0100 Subject: [PATCH] fix some warnings --- qcsrc/server/miscfunctions.qc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index a20c31dd63..5485cc10db 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -2276,9 +2276,11 @@ string getrankings() return strcat("Records for ", map, ":\n", s); } -const float LADDER_FIRSTPOINT = 100; -const float LADDER_CNT = 10; // position X still gives LADDER_FIRSTPOINT/X points -const float LADDER_SIZE = 30; // ladder shows the top X players +#define LADDER_FIRSTPOINT 100 +#define LADDER_CNT 10 + // position X still gives LADDER_FIRSTPOINT/X points +#define LADDER_SIZE 30 + // ladder shows the top X players string top_uids[LADDER_SIZE]; float top_scores[LADDER_SIZE]; string getladder() @@ -2420,11 +2422,12 @@ string getladder() { s = strcat(s, "+-----"); } - if(LADDER_CNT > 9) - for (i = 1; i <= LADDER_CNT - 9; ++i) - { - s = strcat(s, "+------"); - } +#if LADDER_CNT > 9 + for (i = 1; i <= LADDER_CNT - 9; ++i) + { + s = strcat(s, "+------"); + } +#endif s = strcat(s, "+--------------+--------------------\n"); @@ -2440,11 +2443,12 @@ string getladder() { s = strcat(s, strpad(4, argv(j)), "^3| ^7"); // 1st, 2nd, 3rd etc cnt } - if(LADDER_CNT > 9) - for (j = 10; j <= LADDER_CNT; ++j) - { - s = strcat(s, strpad(4, argv(j)), " ^3| ^7"); // 1st, 2nd, 3rd etc cnt - } +#if LADDER_CNT > 9 + for (j = 10; j <= LADDER_CNT; ++j) + { + s = strcat(s, strpad(4, argv(j)), " ^3| ^7"); // 1st, 2nd, 3rd etc cnt + } +#endif s = strcat(s, strpad(13, argv(0)), "^3| ^7"); // speed award cnt s = strcat(s, uid2name(top_uids[i]), "\n"); // name -- 2.39.2