diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-08-26 21:44:03 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-08-26 21:44:03 +0000 |
commit | d3a5144876c052c721c19f85f8275174630f9461 (patch) | |
tree | c80c9a1bcf36cc4f7a6d41e8526a1bc0ba110bfd /converter/other | |
parent | 144f2c5647e0139208e4da9b7ae900281b0f03d1 (diff) | |
download | netpbm-mirror-d3a5144876c052c721c19f85f8275174630f9461.tar.gz netpbm-mirror-d3a5144876c052c721c19f85f8275174630f9461.tar.xz netpbm-mirror-d3a5144876c052c721c19f85f8275174630f9461.zip |
Replace macros with inline functions
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@386 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/fiasco/lib/misc.c | 32 | ||||
-rw-r--r-- | converter/other/fiasco/params.c | 3 | ||||
-rw-r--r-- | converter/other/tiff.c | 6 |
3 files changed, 6 insertions, 35 deletions
diff --git a/converter/other/fiasco/lib/misc.c b/converter/other/fiasco/lib/misc.c index 02a1314f..12b94e7a 100644 --- a/converter/other/fiasco/lib/misc.c +++ b/converter/other/fiasco/lib/misc.c @@ -432,38 +432,6 @@ Log2 (double x) return log (x) / 0.69314718; } -#ifndef HAVE_STRCASECMP -bool_t -strcaseeq (const char *s1, const char *s2) -/* - * Compare strings 's1' and 's2', ignoring the case of the characters. - * - * Return value: - * TRUE if strings match, else FALSE - */ -{ - bool_t matched; - char *ls1, *ls2, *ptr; - - assert (s1 && s2); - - ls1 = strdup (s1); - ls2 = strdup (s2); - - for (ptr = ls1; *ptr; ptr++) - *ptr = tolower (*ptr); - for (ptr = ls2; *ptr; ptr++) - *ptr = tolower (*ptr); - - matched = streq (ls1, ls2) ? YES : NO; - - Free (ls1); - Free (ls2); - - return matched; -} -#endif /* not HAVE_STRCASECMP */ - real_t variance (const word_t *pixels, unsigned x0, unsigned y0, unsigned width, unsigned height, unsigned cols) diff --git a/converter/other/fiasco/params.c b/converter/other/fiasco/params.c index 3d0a0252..7a302b82 100644 --- a/converter/other/fiasco/params.c +++ b/converter/other/fiasco/params.c @@ -15,7 +15,8 @@ * $State: Exp $ */ -#define _BSD_SOURCE 1 /* Make sure strdup() is in string.h */ +#define _BSD_SOURCE 1 + /* Make sure strdup() is in string.h and strcaseeq() is in nstring.h */ #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */ #include "config.h" diff --git a/converter/other/tiff.c b/converter/other/tiff.c index a498571b..90d50710 100644 --- a/converter/other/tiff.c +++ b/converter/other/tiff.c @@ -6,6 +6,8 @@ ============================================================================*/ +#define _BSD_SOURCE /* Make sure strcaseeq() is in nstring.h */ + #include <string.h> #ifdef VMS @@ -40,7 +42,7 @@ number(const char * const value, /* It's not a numeric string, so it must be an enumerated value name */ unsigned int i; for (i = 0; tagvallist[i].name; ++i) { - if (STRCASEEQ(value, tagvallist[i].name)) + if (strcaseeq(value, tagvallist[i].name)) return tagvallist[i].value; } pm_error("'%s' is neither a number nor a valid value name", value); @@ -460,7 +462,7 @@ tagDefFind(const char * const name) { for (i = 0; i < ARRAY_SIZE(tagDefinitions) && tagDefinitions[i].name; ++i) { - if (STRCASEEQ(tagDefinitions[i].name, name)) + if (strcaseeq(tagDefinitions[i].name, name)) return &tagDefinitions[i]; } |