eliminate dead code, fix compile

This commit is contained in:
Enno Rehling 2018-05-17 23:53:44 +02:00
parent 409f5df9a9
commit 7fa568da09
2 changed files with 5 additions and 38 deletions

View File

@ -1036,12 +1036,14 @@ static int include_po(const char *uri) {
const char *filename = uri_to_file(uri, name, sizeof(name));
const char *pos = strstr(filename, ".po");
if (pos) {
size_t len;
const char *str = --pos;
while (str > filename && *str != '.') --str;
if ((pos - str) < sizeof(lname)) {
len = (size_t)(pos - str);
if (len < sizeof(lname)) {
struct locale * lang;
memcpy(lname, str+1, pos - str);
lname[pos - str] = 0;
memcpy(lname, str+1, len);
lname[len] = 0;
lang = get_or_create_locale(lname);
if (lang) {
int err = pofile_read(filename, add_po_string, lang);

View File

@ -83,16 +83,6 @@ static variant xml_fraction(xmlNodePtr node, const char *name) {
return frac_make(0, 1);
}
static void xml_readtext(xmlNodePtr node, struct locale **lang, xmlChar ** text)
{
xmlChar *propValue = xmlGetProp(node, BAD_CAST "locale");
assert(propValue != NULL);
*lang = get_locale((const char *)propValue);
xmlFree(propValue);
*text = xmlNodeListGetString(node->doc, node->children, 1);
}
static spellref *xml_spellref(xmlNode * node, const char *name)
{
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
@ -104,31 +94,6 @@ static spellref *xml_spellref(xmlNode * node, const char *name)
return NULL;
}
static xmlChar *xml_cleanup_string(xmlChar * str)
{
xmlChar *read = str;
xmlChar *write = str;
while (*read) {
/* eat leading whitespace */
if (*read && isspace(*read)) {
while (*read && isspace(*read)) {
++read;
}
*write++ = ' ';
}
while (*read) {
if (*read == '\n')
break;
if (*read == '\r')
break;
*write++ = *read++;
}
}
*write = 0;
return str;
}
static resource_mod * xml_readmodifiers(xmlXPathObjectPtr result, xmlNodePtr node) {
/* reading eressea/resources/resource/modifier */
if (result->nodesetval != NULL && result->nodesetval->nodeNr > 0) {