From b4cb98cea5595149152be56b483c68854d72f627 Mon Sep 17 00:00:00 2001 From: caro Date: Sat, 18 Feb 2012 14:45:21 +0000 Subject: [PATCH] Edje: remove ugly FMT_* compatibility strings as Evil has now POSIX printf family functions git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@68110 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/edje_cc_mem.c | 10 ++-------- src/bin/edje_inspector.c | 10 ++-------- src/bin/edje_player.c | 8 +------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/bin/edje_cc_mem.c b/src/bin/edje_cc_mem.c index 7c1a5c9..d2d4ae0 100644 --- a/src/bin/edje_cc_mem.c +++ b/src/bin/edje_cc_mem.c @@ -7,12 +7,6 @@ #include "edje_cc.h" -#ifdef _WIN32 -# define FMT_SIZE_T "%Iu" -#else -# define FMT_SIZE_T "%zu" -#endif - void * mem_alloc(size_t size) { @@ -20,7 +14,7 @@ mem_alloc(size_t size) mem = calloc(1, size); if (mem) return mem; - ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s", + ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s", progname, file_in, line, size, strerror(errno)); exit(-1); return NULL; @@ -33,7 +27,7 @@ mem_strdup(const char *s) str = strdup(s); if (str) return str; - ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s. string being duplicated: \"%s\"", + ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"", progname, file_in, line, strlen(s) + 1, strerror(errno), s); exit(-1); return NULL; diff --git a/src/bin/edje_inspector.c b/src/bin/edje_inspector.c index 093de86..676c829 100644 --- a/src/bin/edje_inspector.c +++ b/src/bin/edje_inspector.c @@ -31,12 +31,6 @@ static int _log_dom; #define FLOAT_PRECISION 0.0001 #define FDIFF(a, b) (fabs((a) - (b)) > FLOAT_PRECISION) -#ifdef _WIN32 -# define FMT_UCHAR "%c" -#else -# define FMT_UCHAR "%hhu" -#endif - /* context */ static Eina_List *groups; static Ecore_Evas *ee; @@ -1588,8 +1582,8 @@ main(int argc, char **argv) goto error_getopt; } - DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=" FMT_UCHAR - ", api-fix=" FMT_UCHAR ", machine=" FMT_UCHAR ", file=%s", + DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=%hhu" + ", api-fix=%hhu, machine=%hhu, file=%s", mode, detail, detail_name, group ? group : "", part ? part : "", diff --git a/src/bin/edje_player.c b/src/bin/edje_player.c index 4d0c0a3..208fbb4 100644 --- a/src/bin/edje_player.c +++ b/src/bin/edje_player.c @@ -20,12 +20,6 @@ #include #include -#ifdef _WIN32 -# define FMT_UCHAR "%c" -#else -# define FMT_UCHAR "%hhu" -#endif - struct opts { char *file; char *group; @@ -554,7 +548,7 @@ static unsigned char _parse_color(__UNUSED__ const Ecore_Getopt *parser, __UNUSE { unsigned char *color = (unsigned char *)storage->ptrp; - if (sscanf(str, FMT_UCHAR "," FMT_UCHAR "," FMT_UCHAR, color, color + 1, color + 2) != 3) + if (sscanf(str, "%hhu,%hhu,%hhu", color, color + 1, color + 2) != 3) { fprintf(stderr, "ERROR: incorrect color value '%s'\n", str); return 0; -- 2.7.4