]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/urllib.qc
Remove `-Wno-double-declaration`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / urllib.qc
index c69d2f44aab4139b44e1da806baa8e6edbb58a7a..518b207fca24bb5b63222c22d9ac80c8b43d73df 100644 (file)
@@ -1,7 +1,7 @@
 // files
 .float url_fh;
-#define URL_FH_CURL   -1
-#define URL_FH_STDOUT -2
+const float URL_FH_CURL = -1;
+const float URL_FH_STDOUT = -2;
 
 // URLs
 .string url_url;
@@ -85,7 +85,7 @@ float url_URI_Get_Callback(float id, float status, string data)
 void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass)
 {
        entity e;
-       float i;
+       int i;
        if(strstrofs(url, "://", 0) >= 0)
        {
                switch(mode)
@@ -159,7 +159,7 @@ void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass)
                                url_fromid[i] = e;
 
                                // make sure this slot won't be reused quickly even on map change
-                               cvar_set("_urllib_nextslot", ftos(mod(i + 1, NUM_URL_ID)));
+                               cvar_set("_urllib_nextslot", ftos((i + 1) % NUM_URL_ID));
                                break;
                }
        }
@@ -209,7 +209,7 @@ void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass)
 // close a file
 void url_fclose(entity e)
 {
-       float i;
+       int i;
 
        if(e.url_fh == URL_FH_CURL)
        {
@@ -262,7 +262,7 @@ void url_fclose(entity e)
                        url_fromid[i] = e;
 
                        // make sure this slot won't be reused quickly even on map change
-                       cvar_set("_urllib_nextslot", ftos(mod(i + 1, NUM_URL_ID)));
+                       cvar_set("_urllib_nextslot", ftos((i + 1) % NUM_URL_ID));
                }
                else
                {