Eina: remove ugly FMT_* compatibility strings as Evil has now POSIX printf family functions

SVN revision: 68087
This commit is contained in:
Vincent Torri 2012-02-17 20:53:36 +00:00
parent 851c947323
commit b10e9943ce
5 changed files with 20 additions and 38 deletions

View File

@ -102,13 +102,8 @@ _eina_magic_strings_alloc(void)
tmp = realloc(_eina_magic_strings, sizeof(Eina_Magic_String) * size);
if (!tmp)
{
#ifdef _WIN32
ERR("could not realloc magic_strings from %Iu to %Iu buckets.",
_eina_magic_strings_allocated, size);
#else
ERR("could not realloc magic_strings from %zu to %zu buckets.",
_eina_magic_strings_allocated, size);
#endif
return NULL;
}

View File

@ -3278,7 +3278,7 @@ _eina_model_free(Eina_Model *model)
const Eina_Model_Description *desc = model->desc;
unsigned int i;
DBG("model %p (%s) refcount=%d deleted=" FMT_UCHAR,
DBG("model %p (%s) refcount=%d deleted=%hhu",
model, model->desc->cache.types[0]->name,
model->refcount, model->deleted);
@ -3358,7 +3358,7 @@ _eina_model_del(Eina_Model *model)
{
const Eina_Model_Description *desc = model->desc;
DBG("model %p (%s) refcount=%d deleted=" FMT_UCHAR,
DBG("model %p (%s) refcount=%d deleted=%hhu",
model, model->desc->cache.types[0]->name,
model->refcount, model->deleted);
@ -3375,7 +3375,7 @@ _eina_model_del(Eina_Model *model)
static void
_eina_model_unref(Eina_Model *model)
{
DBG("model %p (%s) refcount=%d deleted=" FMT_UCHAR,
DBG("model %p (%s) refcount=%d deleted=%hhu",
model, model->desc->cache.types[0]->name,
model->refcount, model->deleted);
@ -3562,7 +3562,7 @@ EAPI Eina_Model *
eina_model_ref(Eina_Model *model)
{
EINA_MODEL_INSTANCE_CHECK_VAL(model, NULL);
DBG("model %p (%s) refcount=%d deleted=" FMT_UCHAR,
DBG("model %p (%s) refcount=%d deleted=%hhu",
model, model->desc->cache.types[0]->name,
model->refcount, model->deleted);
model->refcount++;
@ -3607,7 +3607,7 @@ EAPI Eina_Model *
eina_model_xref(Eina_Model *model, const void *id, const char *label)
{
EINA_MODEL_INSTANCE_CHECK_VAL(model, NULL);
DBG("model %p (%s) refcount=%d deleted=" FMT_UCHAR" id=%p label=%s",
DBG("model %p (%s) refcount=%d deleted=%hhu id=%p label=%s",
model, model->desc->cache.types[0]->name,
model->refcount, model->deleted, id, label ? label : "");

View File

@ -42,20 +42,6 @@
max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
#endif
#ifdef _WIN32
# define FMT_CHAR "%c"
# define FMT_UCHAR "%c"
# define FMT_XCHAR "%c"
# define FMT_OCHAR "%c"
# define FMT_2XCHAR "%2c"
#else
# define FMT_CHAR "%hhd"
# define FMT_UCHAR "%hhu"
# define FMT_XCHAR "%hhx"
# define FMT_OCHAR "%hho"
# define FMT_2XCHAR "%02hhx"
#endif
#define EINA_INLIST_JUMP_SIZE 256
#define READBUFSIZ 65536

View File

@ -465,11 +465,8 @@ _eina_stringshare_small_bucket_dump(Eina_Stringshare_Small_Bucket *bucket,
for (i = 0; i < bucket->count; i++, s++, l++, r++)
{
int dups;
#ifdef _WIN32
printf("DDD: %5hu %5hu '%s'\n", *l, *r, *s);
#else
printf("DDD: %5hhu %5hu '%s'\n", *l, *r, *s);
#endif
dups = (*r - 1);

View File

@ -49,6 +49,10 @@ void *alloca (size_t);
#include <inttypes.h> /* PRId64 and PRIu64 */
#include <sys/time.h> /* struct timeval */
#ifdef HAVE_EVIL
# include <Evil.h>
#endif
#include "eina_config.h"
#include "eina_private.h"
#include "eina_error.h"
@ -221,7 +225,7 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type __UNUSED__, const
{
const char *other_mem;
char buf[64];
snprintf(buf, sizeof(buf), FMT_UCHAR , v);
snprintf(buf, sizeof(buf), "%hhu", v);
other_mem = buf; /* required due &buf == buf */
return eina_value_type_pset(convert, convert_mem, &other_mem);
}
@ -1005,7 +1009,7 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type __UNUSED__, const E
{
const char *other_mem;
char buf[64];
snprintf(buf, sizeof(buf), FMT_CHAR, v);
snprintf(buf, sizeof(buf), "%hhd", v);
other_mem = buf; /* required due &buf == buf */
return eina_value_type_pset(convert, convert_mem, &other_mem);
}
@ -2123,9 +2127,9 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type __UNUSED__
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem;
if ((sscanf(v, FMT_UCHAR, &other_mem) != 1) &&
(sscanf(v, FMT_XCHAR, &other_mem) != 1) &&
(sscanf(v, FMT_OCHAR, &other_mem) != 1))
if ((sscanf(v, "%hhu", &other_mem) != 1) &&
(sscanf(v, "%hhx", &other_mem) != 1) &&
(sscanf(v, "%hho", &other_mem) != 1))
return EINA_FALSE;
return eina_value_type_pset(convert, convert_mem, &other_mem);
}
@ -2168,9 +2172,9 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type __UNUSED__
else if (convert == EINA_VALUE_TYPE_CHAR)
{
char other_mem;
if ((sscanf(v, FMT_CHAR, &other_mem) != 1) &&
(sscanf(v, FMT_XCHAR, &other_mem) != 1) &&
(sscanf(v, FMT_OCHAR, &other_mem) != 1))
if ((sscanf(v, "%hhd", &other_mem) != 1) &&
(sscanf(v, "%hhx", &other_mem) != 1) &&
(sscanf(v, "%hho", &other_mem) != 1))
return EINA_FALSE;
return eina_value_type_pset(convert, convert_mem, &other_mem);
}
@ -3719,12 +3723,12 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type __UNUSED__, const E
if (first)
{
first = EINA_FALSE;
if (!eina_strbuf_append_printf(str, FMT_2XCHAR, *ptr))
if (!eina_strbuf_append_printf(str, "%02hhx", *ptr))
goto error;
}
else
{
if (!eina_strbuf_append_printf(str, " " FMT_2XCHAR, *ptr))
if (!eina_strbuf_append_printf(str, " %02hhx", *ptr))
goto error;
}
}