X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Furllib.qc;h=518b207fca24bb5b63222c22d9ac80c8b43d73df;hb=a08620064dbe59abd194f302768d65934b87b6df;hp=c69d2f44aab4139b44e1da806baa8e6edbb58a7a;hpb=267b14d636d605b1e52aa5482dff6f6827b5db94;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/urllib.qc b/qcsrc/common/urllib.qc index c69d2f44a..518b207fc 100644 --- a/qcsrc/common/urllib.qc +++ b/qcsrc/common/urllib.qc @@ -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 {