summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-01-13 15:00:16 +0000
committertron <tron@openttd.org>2007-01-13 15:00:16 +0000
commite043c6cef7b8afb694a528218c18a15bae3b5315 (patch)
tree9bb1adc7db26f0d3e419320319b33f692cbcb593 /src/newgrf_gui.cpp
parent64f34d322d806e4ff3404b7d4f59a63aed5a82d3 (diff)
downloadopenttd-e043c6cef7b8afb694a528218c18a15bae3b5315.tar.xz
(svn r8097) Replace strlen() {==,!=,>} 0 by the more concise {,!}StrEmpty(). Additionally the test takes O(1) instead of O(n) now
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index c02ffb701..0854b18f6 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -75,7 +75,7 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show
if (HASBIT(c->flags, GCF_DISABLED)) y += DrawStringMultiLine(x, y, STR_NEWGRF_DISABLED, w);
/* Draw GRF info if it exists */
- if (c->info != NULL && strlen(c->info) != 0) {
+ if (c->info != NULL && !StrEmpty(c->info)) {
SetDParamStr(0, c->info);
y += DrawStringMultiLine(x, y, STR_02BD, w);
} else {
@@ -116,7 +116,7 @@ static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
for (c = _all_grfs; c != NULL; c = c->next) {
if (n >= w->vscroll.pos && n < w->vscroll.pos + w->vscroll.cap) {
bool h = c == WP(w, newgrf_add_d).sel;
- const char *text = (c->name != NULL && strlen(c->name) != 0) ? c->name : c->filename;
+ const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
/* Draw selection background */
if (h) GfxFillRect(3, y, w->width - 15, y + 9, 156);
@@ -310,7 +310,7 @@ static void NewGRFWndProc(Window *w, WindowEvent *e)
y = w->widget[SNGRFS_FILE_LIST].top;
for (c = *WP(w, newgrf_d).list, i = 0; c != NULL; c = c->next, i++) {
if (i >= w->vscroll.pos && i < w->vscroll.pos + w->vscroll.cap) {
- const char *text = (c->name != NULL && strlen(c->name) != 0) ? c->name : c->filename;
+ const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
PalSpriteID pal;
/* Pick a colour */