Krolyxon
Commit d721d84

Branches

Refs →

nsxivd721d84

Added STREQ macro

Author
Bert Münnich
Date
2011-09-26 21:53 +0200
Parent
d08408e
Commit
d721d8453e6c0ff7112e8228eb58aa438d1f7f1a

+8 −6

5 files changed

  1. M image.c +2 −2
  2. M options.c +1 −1
  3. M thumbs.c +1 −1
  4. M util.c +1 −1
  5. M util.h +3 −1
M image.c View
@@ -303,11 +303,11 @@ bool img_load(img_t *img, const fileinfo_t *file) {
303303 (void) fmt;
304304
305305 #if EXIF_SUPPORT
306− if (!strcmp(fmt, "jpeg"))
306+ if (STREQ(fmt, "jpeg"))
307307 exif_auto_orientate(file);
308308 #endif
309309 #if GIF_SUPPORT
310− if (!strcmp(fmt, "gif"))
310+ if (STREQ(fmt, "gif"))
311311 img_load_gif(img, file);
312312 #endif
313313
M options.c View
@@ -140,5 +140,5 @@ void parse_options(int argc, char **argv) {
140140 _options.filenames = argv + optind;
141141 _options.filecnt = argc - optind;
142142 _options.from_stdin = _options.filecnt == 1 &&
143− !strcmp(_options.filenames[0], "-");
143+ STREQ(_options.filenames[0], "-");
144144 }
M thumbs.c View
@@ -255,7 +255,7 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file,
255255 (void) fmt;
256256
257257 #if EXIF_SUPPORT
258− if (!cache_hit && !strcmp(fmt, "jpeg"))
258+ if (!cache_hit && STREQ(fmt, "jpeg"))
259259 exif_auto_orientate(file);
260260 #endif
261261
M util.c View
@@ -270,7 +270,7 @@ char* r_readdir(r_dir_t *rdir) {
270270
271271 while (1) {
272272 if (rdir->dir && (dentry = readdir(rdir->dir))) {
273− if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
273+ if (STREQ(dentry->d_name, ".") || STREQ(dentry->d_name, ".."))
274274 continue;
275275
276276 len = strlen(rdir->name) + strlen(dentry->d_name) + 2;
M util.h View
@@ -30,7 +30,9 @@
3030 #define MAX(a,b) ((a) > (b) ? (a) : (b))
3131 #endif
3232
33−#define ARRLEN(a) (sizeof(a) / sizeof(a[0]))
33+#define ARRLEN(a) (sizeof(a) / sizeof((a)[0]))
34+
35+#define STREQ(a,b) (!strcmp((a), (b)))
3436
3537 #define TIMEDIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec) * 1000 + \
3638 ((t1)->tv_usec - (t2)->tv_usec) / 1000)