diff options
author | Bert Münnich <ber.t@gmx.com> | 2011-09-26 21:53:52 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@gmx.com> | 2011-09-26 21:53:52 +0200 |
commit | d721d8453e6c0ff7112e8228eb58aa438d1f7f1a (patch) | |
tree | 449e393e7bb614b150f4c72b3998ae5ced95e201 | |
parent | d08408e94250425e677e1ab33d917e05e229faa2 (diff) |
Added STREQ macro
-rw-r--r-- | image.c | 4 | ||||
-rw-r--r-- | options.c | 2 | ||||
-rw-r--r-- | thumbs.c | 2 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | util.h | 4 |
5 files changed, 8 insertions, 6 deletions
@@ -303,11 +303,11 @@ bool img_load(img_t *img, const fileinfo_t *file) { (void) fmt; #if EXIF_SUPPORT - if (!strcmp(fmt, "jpeg")) + if (STREQ(fmt, "jpeg")) exif_auto_orientate(file); #endif #if GIF_SUPPORT - if (!strcmp(fmt, "gif")) + if (STREQ(fmt, "gif")) img_load_gif(img, file); #endif @@ -140,5 +140,5 @@ void parse_options(int argc, char **argv) { _options.filenames = argv + optind; _options.filecnt = argc - optind; _options.from_stdin = _options.filecnt == 1 && - !strcmp(_options.filenames[0], "-"); + STREQ(_options.filenames[0], "-"); } @@ -255,7 +255,7 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file, (void) fmt; #if EXIF_SUPPORT - if (!cache_hit && !strcmp(fmt, "jpeg")) + if (!cache_hit && STREQ(fmt, "jpeg")) exif_auto_orientate(file); #endif @@ -270,7 +270,7 @@ char* r_readdir(r_dir_t *rdir) { while (1) { if (rdir->dir && (dentry = readdir(rdir->dir))) { - if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, "..")) + if (STREQ(dentry->d_name, ".") || STREQ(dentry->d_name, "..")) continue; len = strlen(rdir->name) + strlen(dentry->d_name) + 2; @@ -30,7 +30,9 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -#define ARRLEN(a) (sizeof(a) / sizeof(a[0])) +#define ARRLEN(a) (sizeof(a) / sizeof((a)[0])) + +#define STREQ(a,b) (!strcmp((a), (b))) #define TIMEDIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec) * 1000 + \ ((t1)->tv_usec - (t2)->tv_usec) / 1000) |