Browse Source

Added STREQ macro

master
Bert Münnich 13 years ago
parent
commit
d721d8453e
5 changed files with 8 additions and 6 deletions
  1. +2
    -2
      image.c
  2. +1
    -1
      options.c
  3. +1
    -1
      thumbs.c
  4. +1
    -1
      util.c
  5. +3
    -1
      util.h

+ 2
- 2
image.c View File

@@ -303,11 +303,11 @@ bool img_load(img_t *img, const fileinfo_t *file) {
(void) fmt; (void) fmt;


#if EXIF_SUPPORT #if EXIF_SUPPORT
if (!strcmp(fmt, "jpeg")) if (STREQ(fmt, "jpeg"))
exif_auto_orientate(file); exif_auto_orientate(file);
#endif #endif
#if GIF_SUPPORT #if GIF_SUPPORT
if (!strcmp(fmt, "gif")) if (STREQ(fmt, "gif"))
img_load_gif(img, file); img_load_gif(img, file);
#endif #endif




+ 1
- 1
options.c View File

@@ -140,5 +140,5 @@ void parse_options(int argc, char **argv) {
_options.filenames = argv + optind; _options.filenames = argv + optind;
_options.filecnt = argc - optind; _options.filecnt = argc - optind;
_options.from_stdin = _options.filecnt == 1 && _options.from_stdin = _options.filecnt == 1 &&
!strcmp(_options.filenames[0], "-"); STREQ(_options.filenames[0], "-");
} }

+ 1
- 1
thumbs.c View File

@@ -255,7 +255,7 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file,
(void) fmt; (void) fmt;


#if EXIF_SUPPORT #if EXIF_SUPPORT
if (!cache_hit && !strcmp(fmt, "jpeg")) if (!cache_hit && STREQ(fmt, "jpeg"))
exif_auto_orientate(file); exif_auto_orientate(file);
#endif #endif




+ 1
- 1
util.c View File

@@ -270,7 +270,7 @@ char* r_readdir(r_dir_t *rdir) {


while (1) { while (1) {
if (rdir->dir && (dentry = readdir(rdir->dir))) { 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; continue;


len = strlen(rdir->name) + strlen(dentry->d_name) + 2; len = strlen(rdir->name) + strlen(dentry->d_name) + 2;


+ 3
- 1
util.h View File

@@ -30,7 +30,9 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif #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 + \ #define TIMEDIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec) * 1000 + \
((t1)->tv_usec - (t2)->tv_usec) / 1000) ((t1)->tv_usec - (t2)->tv_usec) / 1000)


||||||
x
 
000:0
Loading…
Cancel
Save