delete dead code (dbrace)

This commit is contained in:
Enno Rehling 2016-08-29 13:49:39 +01:00
parent fd273848ae
commit 2eb9b5c5ea
4 changed files with 3 additions and 18 deletions

View File

@ -303,22 +303,6 @@ variant read_race_reference(struct storage *store)
return result; return result;
} }
/** Returns the English name of the race, which is what the database uses.
*/
const char *dbrace(const struct race *rc)
{
static char zText[32]; // FIXME: static return value
char *zPtr = zText;
/* the english names are all in ASCII, so we don't need to worry about UTF8 */
strlcpy(zText, (const char *)LOC(get_locale("en"), rc_name_s(rc, NAME_SINGULAR)), sizeof(zText));
while (*zPtr) {
*zPtr = (char)(toupper(*zPtr));
++zPtr;
}
return zText;
}
void register_race_description_function(race_desc_func func, const char *name) { void register_race_description_function(race_desc_func func, const char *name) {
register_function((pf_generic)func, name); register_function((pf_generic)func, name);
} }

View File

@ -257,7 +257,6 @@ extern "C" {
variant read_race_reference(struct storage *store); variant read_race_reference(struct storage *store);
const char *raceprefix(const struct unit *u); const char *raceprefix(const struct unit *u);
const char *dbrace(const struct race *rc);
void register_race_name_function(race_name_func, const char *); void register_race_name_function(race_name_func, const char *);
void register_race_description_function(race_desc_func, const char *); void register_race_description_function(race_desc_func, const char *);
char * race_namegen(const struct race *rc, struct unit *u); char * race_namegen(const struct race *rc, struct unit *u);

View File

@ -22,11 +22,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "log.h" #include "log.h"
#include "strings.h" #include "strings.h"
#include "umlaut.h" #include "umlaut.h"
#include "assert.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h>
#include <critbit.h> #include <critbit.h>
#define SMAXHASH 2048 #define SMAXHASH 2048
@ -84,6 +84,7 @@ locale *get_or_create_locale(const char *name)
} }
} }
*lp = l = (locale *)calloc(sizeof(locale), 1); *lp = l = (locale *)calloc(sizeof(locale), 1);
assert_alloc(l);
l->hashkey = hkey; l->hashkey = hkey;
l->name = _strdup(name); l->name = _strdup(name);
l->index = nextlocaleindex++; l->index = nextlocaleindex++;

View File

@ -138,6 +138,7 @@ static int check_dupe(const char *format, int level)
static char last_message[32]; /* STATIC_XCALL: used across calls */ static char last_message[32]; /* STATIC_XCALL: used across calls */
static int dupes = 0; /* STATIC_XCALL: used across calls */ static int dupes = 0; /* STATIC_XCALL: used across calls */
if (strncmp(last_message, format, sizeof(last_message)) == 0) { if (strncmp(last_message, format, sizeof(last_message)) == 0) {
// TODO: C6054: String 'last_message' might not be zero - terminated.
++dupes; ++dupes;
return 1; return 1;
} }