]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
get rid of some uses of the insane tokenizer
authorRudolf Polzer <divVerent@xonotic.org>
Tue, 25 Oct 2011 11:57:44 +0000 (13:57 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 25 Oct 2011 11:57:44 +0000 (13:57 +0200)
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/hud_config.qc
qcsrc/common/util.qh
qcsrc/menu/gamecommand.qc
qcsrc/server/g_world.qc
qcsrc/server/gamecommand.qc
qcsrc/server/sv_main.qc

index 9aa81be98e0ccf5b555705bfaf10d1761a0a18bd..7abf7208788d9256deb299ad538dcaa134480d7a 100644 (file)
@@ -354,7 +354,6 @@ float CSQC_ConsoleCommand(string strMessage)
 {
        float argc;
        // Tokenize String
-       //argc = tokenize(strMessage);
        argc = tokenize_console(strMessage);
 
        // Acquire Command
index ea10300ed9773940658a2bef5f7b0913eea06c12..d2072e1017b337d1e4a89c5c82bf3262799d39d5 100644 (file)
@@ -1452,7 +1452,7 @@ void CSQC_common_hud(void)
             if(acc_color_levels)
                 strunzone(acc_color_levels);
             acc_color_levels = strzone(autocvar_accuracy_color_levels);
-            acc_levels = tokenize(acc_color_levels);
+            acc_levels = tokenize_console(acc_color_levels);
             if (acc_levels > MAX_ACCURACY_LEVELS)
                 acc_levels = MAX_ACCURACY_LEVELS;
 
index f26f65ea54b53d3c7a5d8cd564457416d81755d7..488debb11baeb521d6427bfa8bce5fc11d74451d 100644 (file)
@@ -583,7 +583,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        string con_keys;
        float keys;
        con_keys = findkeysforcommand("toggleconsole");
-       keys = tokenize(con_keys);
+       keys = tokenize(con_keys); // findkeysforcommand returns data for this
 
        float hit_con_bind, i;
        for (i = 0; i < keys; ++i)
index 2eee6d74ef1a4d369286c1fcc01a71588ccd130d..b2e77484e398695ea3b2febb290bd217cdf83af5 100644 (file)
@@ -22,7 +22,7 @@ void wordwrap_cb(string s, float l, void(string) callback)
 
 float GameCommand_Generic(string cmd);
 // returns TRUE if handled, FALSE otherwise
-// uses tokenize on its argument!
+// tokenizes its input!
 
 // iterative depth-first search, with fields that go "up", "down left" and "right" in a tree
 // for each element, funcPre is called first, then funcPre and funcPost for all its children, and funcPost last
index 83ef53762c914ab5f5ca4cbd255547d14163f7a8..e637bf5aa87a3f71bd43bf99c94f55f1fc5960a7 100644 (file)
@@ -184,44 +184,5 @@ void GameCommand(string theCommand)
                return;
        }
 
-#if 0
-       if(argv(0) == "tokentest")
-       {
-               string s;
-               float i, n;
-
-               print("SANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_builtin(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("INSANE tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-
-               print("EMULATED tokenizer:\n");
-               s = cvar_string("tokentest");
-               n = tokenize_console_force_emulation(s);
-               for(i = -n; i < n; ++i)
-               {
-                       print("token ", ftos(i), ": '", argv(i), "' = ");
-                       print(ftos(argv_start_index(i)), " to ", ftos(argv_end_index(i)), "\n");
-               }
-               print(".\n");
-               return;
-       }
-#endif
-
        print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
index b134886d4f6fcfc54281c1af591fb028650650c8..5b28212583fa117487b4c9340f541b2c8dc2d7c0 100644 (file)
@@ -961,7 +961,7 @@ string GetMapname()
 float Map_Count, Map_Current;
 string Map_Current_Name;
 
-// NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
+// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
 float GetMaplistPosition()
 {
        float pos, idx;
index f5b662be35e51a5e6a80a72a6ca70ac800cdaaa7..986f2dd84536c7b7141dbe3065a340a817df7d5b 100644 (file)
@@ -596,7 +596,7 @@ void EffectIndexDump()
        fh = fopen("effectinfo.txt", FILE_READ);
        while((s = fgets(fh)))
        {
-               tokenize(s); // tokenize_console would hit the loop counter :(
+               tokenize_console(s);
                if(argv(0) == "effect")
                {
                        if(db_get(d, argv(1)) != "1")
index ce5828affc0194d1c051cf26b3412b6ff2688c61..eb386005d16f16201ba064b01d32e799b1a85bee 100644 (file)
@@ -275,7 +275,7 @@ void SV_OnEntityPreSpawnFunction()
                        s = substring(s, 1, -1);
                }
 
-               n = tokenize(s);
+               n = tokenize_console(s);
                for(i = 0; i < n; ++i)
                {
                        s = argv(i);