X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Flib%2Fcounting.qh;h=12ec4a9b61dc7f09a4fff6c80a735022c558ae70;hp=e430a648d168a41d38a976745880113c6f3258f1;hb=0bd99205bd154e058edc6b82995d24e3375f5f97;hpb=34e7f534e2015466228eb3a78c9857741b736dca diff --git a/qcsrc/lib/counting.qh b/qcsrc/lib/counting.qh index e430a648d1..12ec4a9b61 100644 --- a/qcsrc/lib/counting.qh +++ b/qcsrc/lib/counting.qh @@ -61,6 +61,7 @@ _("CI_THI^%d seconds"), /* third */ \ _("CI_MUL^%d seconds")) /* multi */ +[[eraseable]] string count_ordinal(int interval) { // This function is designed primarily for the English language, it's impossible @@ -86,6 +87,7 @@ string count_ordinal(int interval) return ""; } +[[eraseable]] string count_fill(float interval, string zeroth, string first, string second, string third, string multi) { // This function is designed primarily for the English language, it's impossible @@ -116,6 +118,7 @@ string count_fill(float interval, string zeroth, string first, string second, st return ""; } +[[eraseable]] string process_time(float outputtype, float seconds) { float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0; @@ -163,42 +166,37 @@ string process_time(float outputtype, float seconds) if (tmp_minutes) { - output = sprintf( - "%s%s", + output = strcat( count_minutes(tmp_minutes), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } if (tmp_hours) { - output = sprintf( - "%s%s", + output = strcat( count_hours(tmp_hours), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } if (tmp_days) { - output = sprintf( - "%s%s", + output = strcat( count_days(tmp_days), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } if (tmp_weeks) { - output = sprintf( - "%s%s", + output = strcat( count_weeks(tmp_weeks), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } if (tmp_years) { - output = sprintf( - "%s%s", + output = strcat( count_years(tmp_years), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } return output; @@ -214,9 +212,8 @@ string process_time(float outputtype, float seconds) if (tmp_days) { output = sprintf( - "%s%s", count_days(tmp_days), - ((output != "") ? sprintf(", %s", output) : "")); + ((output != "") ? strcat(", ", output) : "")); } return output;