Commit b7dcdf61 authored by Cedric BAIL's avatar Cedric BAIL

* eet: handle fixed point in data stream.


SVN revision: 48055
parent 2cc28483
......@@ -362,3 +362,6 @@
* Only delete the file at the last possible time.
* Reduce open file descriptor.
2010-04-16 Cedric BAIL
* Handle fixed point in data stream.
......@@ -721,7 +721,20 @@ eet_data_get_f32p32(const Eet_Dictionary *ed, const void *src, const void *src_e
fp = (Eina_F32p32*) dst;
if (!ed) return -1;
if (!ed)
{
const char *s, *p;
int len;
s = (const char *) src;
p = s;
len = 0;
while ((p < (const char *)src_end) && (*p != 0)) { len++; p++; }
if (!(eina_convert_atofp(s, len, fp)))
return -1;
return 1;
}
if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
......@@ -736,10 +749,22 @@ eet_data_put_f32p32(Eet_Dictionary *ed, const void *src, int *size_ret)
char buf[128];
int idx;
if (!ed) return NULL;
eina_convert_fptoa((Eina_F32p32)(*(Eina_F32p32 *)src), buf);
if (!ed)
{
char *d;
int len;
len = strlen(buf);
d = malloc(len + 1);
if (!d) return NULL;
memcpy(d, buf, len + 1);
*size_ret = len + 1;
return d;
}
idx = eet_dictionary_string_add(ed, buf);
if (idx == -1) return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment