1
0
Fork 0

Codechange: Remove unused/obscure strgen feature for relative offsets in plural/gender choice lists.

pull/13876/head
frosch 2025-03-24 18:23:50 +01:00 committed by frosch
parent 4fc0900865
commit f8292a8d11
1 changed files with 2 additions and 11 deletions

View File

@ -235,25 +235,16 @@ void EmitSingleChar(Buffer *buffer, char *buf, int value)
} }
/* The plural specifier looks like /* The plural specifier looks like
* {NUM} {PLURAL -1 passenger passengers} then it picks either passenger/passengers depending on the count in NUM */ * {NUM} {PLURAL <ARG#> passenger passengers} then it picks either passenger/passengers depending on the count in NUM */
static bool ParseRelNum(char **buf, int *value, int *offset) static bool ParseRelNum(char **buf, int *value, int *offset)
{ {
const char *s = *buf; const char *s = *buf;
char *end; char *end;
bool rel = false;
while (*s == ' ' || *s == '\t') s++; while (*s == ' ' || *s == '\t') s++;
if (*s == '+') {
rel = true;
s++;
}
int v = std::strtol(s, &end, 0); int v = std::strtol(s, &end, 0);
if (end == s) return false; if (end == s) return false;
if (rel || v < 0) {
*value += v;
} else {
*value = v; *value = v;
}
if (offset != nullptr && *end == ':') { if (offset != nullptr && *end == ':') {
/* Take the Nth within */ /* Take the Nth within */
s = end + 1; s = end + 1;