diff options
author | tron <tron@openttd.org> | 2007-01-13 15:00:16 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-01-13 15:00:16 +0000 |
commit | abb644771af78103d1e8b8f5582e8a56c9dcfbfe (patch) | |
tree | 9bb1adc7db26f0d3e419320319b33f692cbcb593 /src/newgrf_gui.cpp | |
parent | fc78ef95e16e890c917da7a52f7ab1d8f5773a05 (diff) | |
download | openttd-abb644771af78103d1e8b8f5582e8a56c9dcfbfe.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.cpp | 6 |
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 */ |