Fix: Remove various dead or unnecessary assignments

This commit is contained in:
Charles Pigott 2018-10-14 18:17:09 +01:00 committed by frosch
parent f5b1115039
commit e0c0394e37
7 changed files with 8 additions and 15 deletions

View File

@ -498,11 +498,6 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
return l;
}
const WChar *begin = this->buffer;
const WChar *last_space = NULL;
const WChar *last_char = begin;
int width = 0;
int offset = this->buffer - this->buffer_begin;
FontMap::iterator iter = this->runs.Begin();
while (iter->first <= offset) {
@ -513,6 +508,10 @@ const ParagraphLayouter::Line *FallbackParagraphLayout::NextLine(int max_width)
const FontCache *fc = iter->second->fc;
const WChar *next_run = this->buffer_begin + iter->first;
const WChar *begin = this->buffer;
const WChar *last_space = NULL;
const WChar *last_char;
int width = 0;
for (;;) {
WChar c = *this->buffer;
last_char = this->buffer;

View File

@ -508,7 +508,6 @@ public:
y += FONT_HEIGHT_NORMAL;
/* Get the additional purchase info text, if it has not already been queried. */
str = STR_NULL;
if (HasBit(indsp->callback_mask, CBM_IND_FUND_MORE_TEXT)) {
uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, NULL, this->selected_type, INVALID_TILE);
if (callback_res != CALLBACK_FAILED && callback_res != 0x400) {

View File

@ -3472,8 +3472,6 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
} else {
/* Declared as been valid, can be used */
itt[k].gfx = tempid;
size = k + 1;
copy_from = itt;
}
} else if (itt[k].gfx == 0xFF) {
itt[k].ti.x = (int8)GB(itt[k].ti.x, 0, 8);
@ -3787,8 +3785,6 @@ static ChangeInfoResult AirportChangeInfo(uint airport, int numinfo, int prop, B
} else {
/* Declared as been valid, can be used */
att[k].gfx = tempid;
size = k + 1;
copy_from = att;
}
} else if (att[k].gfx == 0xFF) {
att[k].ti.x = (int8)GB(att[k].ti.x, 0, 8);

View File

@ -265,7 +265,7 @@ static SavegameType DetermineOldSavegameType(FILE *f, char *title, const char *l
case SGT_TTD: title = strecpy(title, "(TTD) ", last); break;
default: title = strecpy(title, "(broken) ", last); break;
}
title = strecpy(title, temp, last);
strecpy(title, temp, last);
}
return type;

View File

@ -92,7 +92,7 @@ void Script_CreateDummy(HSQUIRRELVM vm, StringID string, const char *type)
p = newline + 1;
} while (newline != NULL);
dp = strecpy(dp, " }\n}\n", lastof(dummy_script));
strecpy(dp, " }\n}\n", lastof(dummy_script));
/* 3) We translate the error message in the character format that Squirrel wants.
* We can use the fact that the wchar string printing also uses %s to print

View File

@ -170,7 +170,7 @@ void str_fix_scc_encoded(char *str, const char *last)
if ((len == 0 && str + 4 > last) || str + len > last) break;
WChar c;
len = Utf8Decode(&c, str);
Utf8Decode(&c, str);
if (c == '\0') break;
if (c == 0xE028 || c == 0xE02A) {

View File

@ -818,7 +818,6 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
sub_args.ClearTypeInformation();
memset(sub_args_need_free, 0, sizeof(sub_args_need_free));
const char *s = str;
char *p;
uint32 stringid = strtoul(str, &p, 16);
if (*p != ':' && *p != '\0') {
@ -837,7 +836,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
int i = 0;
while (*p != '\0' && i < 20) {
uint64 param;
s = ++p;
const char *s = ++p;
/* Find the next value */
bool instring = false;