summaryrefslogtreecommitdiff
path: root/legacy/eet
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-03-01 11:03:35 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-03-01 11:03:35 +0000
commit3e59d344415701fc64e5d77da66bee0ec9bd6fe4 (patch)
tree4a1bbec76021b74fc0137de88e7af47ad619daa1 /legacy/eet
parentd7aa78290cb853e409122602049178c8e20b51f9 (diff)
* eet: Fix override of global symbols.
Patch from Albin "Lutin" Tonnerre <albin.tonnerre@gmail.com> SVN revision: 46682
Diffstat (limited to 'legacy/eet')
-rw-r--r--legacy/eet/AUTHORS1
-rw-r--r--legacy/eet/ChangeLog5
-rw-r--r--legacy/eet/src/lib/eet_data.c66
-rw-r--r--legacy/eet/src/lib/eet_dictionary.c116
-rw-r--r--legacy/eet/src/lib/eet_image.c90
-rw-r--r--legacy/eet/src/lib/eet_lib.c62
-rw-r--r--legacy/eet/src/lib/eet_node.c4
7 files changed, 173 insertions, 171 deletions
diff --git a/legacy/eet/AUTHORS b/legacy/eet/AUTHORS
index b0d25b1d22..cd5fc41184 100644
--- a/legacy/eet/AUTHORS
+++ b/legacy/eet/AUTHORS
@@ -8,3 +8,4 @@ Vincent Torri <vtorri@univ-evry.fr>
8Gustavo Sverzut Barbieri <barbieri@gmail.com> 8Gustavo Sverzut Barbieri <barbieri@gmail.com>
9Raphael Kubo da Costa <kubo@profusion.mobi> 9Raphael Kubo da Costa <kubo@profusion.mobi>
10Mathieu Taillefumier <mathieu.taillefumier@free.fr> 10Mathieu Taillefumier <mathieu.taillefumier@free.fr>
11Albin "Lutin" Tonnerre <albin.tonnerre@gmail.com>
diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog
index 9c09b10af6..f71ff865c8 100644
--- a/legacy/eet/ChangeLog
+++ b/legacy/eet/ChangeLog
@@ -299,7 +299,7 @@
2992010-01-04 Carsten Haitzler (The Rasterman) 2992010-01-04 Carsten Haitzler (The Rasterman)
300 300
301 * Fix another thread deadlock in mutex handling even in a single-threaded app. 301 * Fix another thread deadlock in mutex handling even in a single-threaded app.
302 302
3032010-01-12 Cedric BAIL 3032010-01-12 Cedric BAIL
304 304
305 * Rewrite Eet_Data. Now you can do list/hash/array of strings and all 305 * Rewrite Eet_Data. Now you can do list/hash/array of strings and all
@@ -334,3 +334,6 @@
334 334
335 * Improve security by zeroying cipher material as soon as possible. 335 * Improve security by zeroying cipher material as soon as possible.
336 336
3372010-03-01 Albin Tonnerre
338
339 * Fix override of global symbols.
diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c
index 34a3b2bde7..284c57fb07 100644
--- a/legacy/eet/src/lib/eet_data.c
+++ b/legacy/eet/src/lib/eet_data.c
@@ -448,11 +448,11 @@ eet_data_get_string_hash(const Eet_Dictionary *ed, const void *src, const void *
448{ 448{
449 if (ed) 449 if (ed)
450 { 450 {
451 int index; 451 int idx;
452 452
453 if (eet_data_get_int(ed, src, src_end, &index) < 0) return -1; 453 if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
454 454
455 return eet_dictionary_string_get_hash(ed, index); 455 return eet_dictionary_string_get_hash(ed, idx);
456 } 456 }
457 457
458 return -1; 458 return -1;
@@ -468,16 +468,16 @@ eet_data_get_string(const Eet_Dictionary *ed, const void *src, const void *src_e
468 if (ed) 468 if (ed)
469 { 469 {
470 const char *str; 470 const char *str;
471 int index; 471 int idx;
472 472
473 if (eet_data_get_int(ed, src, src_end, &index) < 0) return -1; 473 if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
474 474
475 str = eet_dictionary_string_get_char(ed, index); 475 str = eet_dictionary_string_get_char(ed, idx);
476 if (str == NULL) 476 if (str == NULL)
477 return -1; 477 return -1;
478 478
479 *d = (char *) str; 479 *d = (char *) str;
480 return eet_dictionary_string_get_size(ed, index); 480 return eet_dictionary_string_get_size(ed, idx);
481 } 481 }
482 482
483 s = (char *)src; 483 s = (char *)src;
@@ -500,15 +500,15 @@ eet_data_put_string(Eet_Dictionary *ed, const void *src, int *size_ret)
500 if (ed) 500 if (ed)
501 { 501 {
502 const char *str; 502 const char *str;
503 int index; 503 int idx;
504 504
505 str = *((const char **) src); 505 str = *((const char **) src);
506 if (!str) return NULL; 506 if (!str) return NULL;
507 507
508 index = eet_dictionary_string_add(ed, str); 508 idx = eet_dictionary_string_add(ed, str);
509 if (index == -1) return NULL; 509 if (idx == -1) return NULL;
510 510
511 return eet_data_put_int(ed, &index, size_ret); 511 return eet_data_put_int(ed, &idx, size_ret);
512 } 512 }
513 513
514 s = (char *)(*((char **)src)); 514 s = (char *)(*((char **)src));
@@ -598,7 +598,7 @@ static int
598eet_data_get_float(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst) 598eet_data_get_float(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst)
599{ 599{
600 float *d; 600 float *d;
601 int index; 601 int idx;
602 602
603 d = (float *) dst; 603 d = (float *) dst;
604 if (!ed) 604 if (!ed)
@@ -621,9 +621,9 @@ eet_data_get_float(const Eet_Dictionary *ed, const void *src, const void *src_en
621 return len + 1; 621 return len + 1;
622 } 622 }
623 623
624 if (eet_data_get_int(ed, src, src_end, &index) < 0) return -1; 624 if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
625 625
626 if (!eet_dictionary_string_get_float(ed, index, d)) 626 if (!eet_dictionary_string_get_float(ed, idx, d))
627 return -1; 627 return -1;
628 return 1; 628 return 1;
629} 629}
@@ -632,7 +632,7 @@ static void *
632eet_data_put_float(Eet_Dictionary *ed, const void *src, int *size_ret) 632eet_data_put_float(Eet_Dictionary *ed, const void *src, int *size_ret)
633{ 633{
634 char buf[128]; 634 char buf[128];
635 int index; 635 int idx;
636 636
637 eina_convert_dtoa((double)(*(float *)src), buf); 637 eina_convert_dtoa((double)(*(float *)src), buf);
638 638
@@ -649,10 +649,10 @@ eet_data_put_float(Eet_Dictionary *ed, const void *src, int *size_ret)
649 return d; 649 return d;
650 } 650 }
651 651
652 index = eet_dictionary_string_add(ed, buf); 652 idx = eet_dictionary_string_add(ed, buf);
653 if (index == -1) return NULL; 653 if (idx == -1) return NULL;
654 654
655 return eet_data_put_int(ed, &index, size_ret); 655 return eet_data_put_int(ed, &idx, size_ret);
656} 656}
657 657
658/* DOUBLE TYPE */ 658/* DOUBLE TYPE */
@@ -660,7 +660,7 @@ static int
660eet_data_get_double(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst) 660eet_data_get_double(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst)
661{ 661{
662 double *d; 662 double *d;
663 int index; 663 int idx;
664 664
665 d = (double *) dst; 665 d = (double *) dst;
666 666
@@ -684,9 +684,9 @@ eet_data_get_double(const Eet_Dictionary *ed, const void *src, const void *src_e
684 return len + 1; 684 return len + 1;
685 } 685 }
686 686
687 if (eet_data_get_int(ed, src, src_end, &index) < 0) return -1; 687 if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
688 688
689 if (!eet_dictionary_string_get_double(ed, index, d)) 689 if (!eet_dictionary_string_get_double(ed, idx, d))
690 return -1; 690 return -1;
691 return 1; 691 return 1;
692} 692}
@@ -695,7 +695,7 @@ static void *
695eet_data_put_double(Eet_Dictionary *ed, const void *src, int *size_ret) 695eet_data_put_double(Eet_Dictionary *ed, const void *src, int *size_ret)
696{ 696{
697 char buf[128]; 697 char buf[128];
698 int index; 698 int idx;
699 699
700 eina_convert_dtoa((double)(*(double *)src), buf); 700 eina_convert_dtoa((double)(*(double *)src), buf);
701 701
@@ -713,25 +713,25 @@ eet_data_put_double(Eet_Dictionary *ed, const void *src, int *size_ret)
713 return d; 713 return d;
714 } 714 }
715 715
716 index = eet_dictionary_string_add(ed, buf); 716 idx = eet_dictionary_string_add(ed, buf);
717 if (index == -1) return NULL; 717 if (idx == -1) return NULL;
718 718
719 return eet_data_put_int(ed, &index, size_ret); 719 return eet_data_put_int(ed, &idx, size_ret);
720} 720}
721 721
722static int 722static int
723eet_data_get_f32p32(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst) 723eet_data_get_f32p32(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dst)
724{ 724{
725 Eina_F32p32 *fp; 725 Eina_F32p32 *fp;
726 int index; 726 int idx;
727 727
728 fp = (Eina_F32p32*) dst; 728 fp = (Eina_F32p32*) dst;
729 729
730 if (!ed) return -1; 730 if (!ed) return -1;
731 731
732 if (eet_data_get_int(ed, src, src_end, &index) < 0) return -1; 732 if (eet_data_get_int(ed, src, src_end, &idx) < 0) return -1;
733 733
734 if (!eet_dictionary_string_get_fp(ed, index, fp)) 734 if (!eet_dictionary_string_get_fp(ed, idx, fp))
735 return -1; 735 return -1;
736 return 1; 736 return 1;
737} 737}
@@ -740,16 +740,16 @@ static void *
740eet_data_put_f32p32(Eet_Dictionary *ed, const void *src, int *size_ret) 740eet_data_put_f32p32(Eet_Dictionary *ed, const void *src, int *size_ret)
741{ 741{
742 char buf[128]; 742 char buf[128];
743 int index; 743 int idx;
744 744
745 if (!ed) return NULL; 745 if (!ed) return NULL;
746 746
747 eina_convert_fptoa((Eina_F32p32)(*(Eina_F32p32 *)src), buf); 747 eina_convert_fptoa((Eina_F32p32)(*(Eina_F32p32 *)src), buf);
748 748
749 index = eet_dictionary_string_add(ed, buf); 749 idx = eet_dictionary_string_add(ed, buf);
750 if (index == -1) return NULL; 750 if (idx == -1) return NULL;
751 751
752 return eet_data_put_int(ed, &index, size_ret); 752 return eet_data_put_int(ed, &idx, size_ret);
753} 753}
754 754
755static int 755static int
@@ -2744,8 +2744,6 @@ eet_data_get_array(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data
2744 2744
2745 if (IS_POINTER_TYPE(echnk->type)) 2745 if (IS_POINTER_TYPE(echnk->type))
2746 { 2746 {
2747 int ret;
2748
2749 ret = eet_data_get_unknown(context, ed, edd, ede, echnk, echnk->type, EET_G_UNKNOWN, 2747 ret = eet_data_get_unknown(context, ed, edd, ede, echnk, echnk->type, EET_G_UNKNOWN,
2750 &data_ret, p, size); 2748 &data_ret, p, size);
2751 if (!ret) goto on_error; 2749 if (!ret) goto on_error;
diff --git a/legacy/eet/src/lib/eet_dictionary.c b/legacy/eet/src/lib/eet_dictionary.c
index 14db95faf6..42dbd1ba18 100644
--- a/legacy/eet/src/lib/eet_dictionary.c
+++ b/legacy/eet/src/lib/eet_dictionary.c
@@ -81,7 +81,7 @@ eet_dictionary_string_add(Eet_Dictionary *ed, const char *string)
81 Eet_String *current; 81 Eet_String *current;
82 char *str; 82 char *str;
83 int hash; 83 int hash;
84 int index; 84 int idx;
85 int len; 85 int len;
86 86
87 if (!ed) 87 if (!ed)
@@ -89,19 +89,19 @@ eet_dictionary_string_add(Eet_Dictionary *ed, const char *string)
89 89
90 hash = _eet_hash_gen(string, 8); 90 hash = _eet_hash_gen(string, 8);
91 91
92 index = _eet_dictionary_lookup(ed, string, hash); 92 idx = _eet_dictionary_lookup(ed, string, hash);
93 93
94 if (index != -1) 94 if (idx != -1)
95 { 95 {
96 if (ed->all[index].str) 96 if (ed->all[idx].str)
97 { 97 {
98 if (strcmp(ed->all[index].str, string) == 0) 98 if (strcmp(ed->all[idx].str, string) == 0)
99 return index; 99 return idx;
100 } 100 }
101 if (ed->all[index].mmap) 101 if (ed->all[idx].mmap)
102 { 102 {
103 if (strcmp(ed->all[index].mmap, string) == 0) 103 if (strcmp(ed->all[idx].mmap, string) == 0)
104 return index; 104 return idx;
105 } 105 }
106 } 106 }
107 107
@@ -135,7 +135,7 @@ eet_dictionary_string_add(Eet_Dictionary *ed, const char *string)
135 current->len = len; 135 current->len = len;
136 current->mmap = NULL; 136 current->mmap = NULL;
137 137
138 if (index == -1) 138 if (idx == -1)
139 { 139 {
140 current->next = ed->hash[hash]; 140 current->next = ed->hash[hash];
141 current->prev = -1; 141 current->prev = -1;
@@ -143,8 +143,8 @@ eet_dictionary_string_add(Eet_Dictionary *ed, const char *string)
143 } 143 }
144 else 144 else
145 { 145 {
146 current->next = index; 146 current->next = idx;
147 current->prev = ed->all[index].prev; 147 current->prev = ed->all[idx].prev;
148 148
149 if (current->next != -1) 149 if (current->next != -1)
150 ed->all[current->next].prev = ed->count; 150 ed->all[current->next].prev = ed->count;
@@ -158,44 +158,44 @@ eet_dictionary_string_add(Eet_Dictionary *ed, const char *string)
158} 158}
159 159
160int 160int
161eet_dictionary_string_get_size(const Eet_Dictionary *ed, int index) 161eet_dictionary_string_get_size(const Eet_Dictionary *ed, int idx)
162{ 162{
163 if (!ed) return 0; 163 if (!ed) return 0;
164 if (index < 0) return 0; 164 if (idx < 0) return 0;
165 if (index < ed->count) 165 if (idx < ed->count)
166 return ed->all[index].len; 166 return ed->all[idx].len;
167 return 0; 167 return 0;
168} 168}
169 169
170int 170int
171eet_dictionary_string_get_hash(const Eet_Dictionary *ed, int index) 171eet_dictionary_string_get_hash(const Eet_Dictionary *ed, int idx)
172{ 172{
173 if (!ed) return -1; 173 if (!ed) return -1;
174 if (index < 0) return -1; 174 if (idx < 0) return -1;
175 if (index < ed->count) 175 if (idx < ed->count)
176 return ed->all[index].hash; 176 return ed->all[idx].hash;
177 return -1; 177 return -1;
178} 178}
179 179
180const char * 180const char *
181eet_dictionary_string_get_char(const Eet_Dictionary *ed, int index) 181eet_dictionary_string_get_char(const Eet_Dictionary *ed, int idx)
182{ 182{
183 if (!ed) return NULL; 183 if (!ed) return NULL;
184 if (index < 0) return NULL; 184 if (idx < 0) return NULL;
185 if (index < ed->count) 185 if (idx < ed->count)
186 { 186 {
187#ifdef _WIN32 187#ifdef _WIN32
188 /* Windows file system could change the mmaped file when replacing a file. So we need to copy all string in memory to avoid bugs. */ 188 /* Windows file system could change the mmaped file when replacing a file. So we need to copy all string in memory to avoid bugs. */
189 if (ed->all[index].str == NULL) 189 if (ed->all[idx].str == NULL)
190 { 190 {
191 ed->all[index].str = strdup(ed->all[index].mmap); 191 ed->all[idx].str = strdup(ed->all[idx].mmap);
192 ed->all[index].mmap = NULL; 192 ed->all[idx].mmap = NULL;
193 } 193 }
194#else 194#else
195 if (ed->all[index].mmap) 195 if (ed->all[idx].mmap)
196 return ed->all[index].mmap; 196 return ed->all[idx].mmap;
197#endif 197#endif
198 return ed->all[index].str; 198 return ed->all[idx].str;
199 } 199 }
200 return NULL; 200 return NULL;
201} 201}
@@ -246,93 +246,93 @@ _eet_dictionary_string_get_double_cache(const char *s, int len, double *result)
246} 246}
247 247
248static inline Eina_Bool 248static inline Eina_Bool
249_eet_dictionary_test(const Eet_Dictionary *ed, int index, void *result) 249_eet_dictionary_test(const Eet_Dictionary *ed, int idx, void *result)
250{ 250{
251 if (!result) return EINA_FALSE; 251 if (!result) return EINA_FALSE;
252 if (!ed) return EINA_FALSE; 252 if (!ed) return EINA_FALSE;
253 if (index < 0) return EINA_FALSE; 253 if (idx < 0) return EINA_FALSE;
254 if (!(index < ed->count)) return EINA_FALSE; 254 if (!(idx < ed->count)) return EINA_FALSE;
255 return EINA_TRUE; 255 return EINA_TRUE;
256} 256}
257 257
258Eina_Bool 258Eina_Bool
259eet_dictionary_string_get_float(const Eet_Dictionary *ed, int index, float *result) 259eet_dictionary_string_get_float(const Eet_Dictionary *ed, int idx, float *result)
260{ 260{
261 if (!_eet_dictionary_test(ed, index, result)) return EINA_FALSE; 261 if (!_eet_dictionary_test(ed, idx, result)) return EINA_FALSE;
262 262
263 if (!(ed->all[index].type & EET_D_FLOAT)) 263 if (!(ed->all[idx].type & EET_D_FLOAT))
264 { 264 {
265 const char *str; 265 const char *str;
266 266
267 str = ed->all[index].str ? ed->all[index].str : ed->all[index].mmap; 267 str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
268 268
269 if (!_eet_dictionary_string_get_float_cache(str, ed->all[index].len, &ed->all[index].f)) 269 if (!_eet_dictionary_string_get_float_cache(str, ed->all[idx].len, &ed->all[idx].f))
270 { 270 {
271 long long mantisse = 0; 271 long long mantisse = 0;
272 long exponent = 0; 272 long exponent = 0;
273 273
274 if (eina_convert_atod(str, ed->all[index].len, &mantisse, &exponent) == EINA_FALSE) 274 if (eina_convert_atod(str, ed->all[idx].len, &mantisse, &exponent) == EINA_FALSE)
275 return EINA_FALSE; 275 return EINA_FALSE;
276 276
277 ed->all[index].f = ldexpf((float) mantisse, exponent); 277 ed->all[idx].f = ldexpf((float) mantisse, exponent);
278 } 278 }
279 279
280 ed->all[index].type |= EET_D_FLOAT; 280 ed->all[idx].type |= EET_D_FLOAT;
281 } 281 }
282 282
283 *result = ed->all[index].f; 283 *result = ed->all[idx].f;
284 return EINA_TRUE; 284 return EINA_TRUE;
285} 285}
286 286
287Eina_Bool 287Eina_Bool
288eet_dictionary_string_get_double(const Eet_Dictionary *ed, int index, double *result) 288eet_dictionary_string_get_double(const Eet_Dictionary *ed, int idx, double *result)
289{ 289{
290 if (!_eet_dictionary_test(ed, index, result)) return EINA_FALSE; 290 if (!_eet_dictionary_test(ed, idx, result)) return EINA_FALSE;
291 291
292 if (!(ed->all[index].type & EET_D_DOUBLE)) 292 if (!(ed->all[idx].type & EET_D_DOUBLE))
293 { 293 {
294 const char *str; 294 const char *str;
295 295
296 str = ed->all[index].str ? ed->all[index].str : ed->all[index].mmap; 296 str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
297 297
298 if (!_eet_dictionary_string_get_double_cache(str, ed->all[index].len, &ed->all[index].d)) 298 if (!_eet_dictionary_string_get_double_cache(str, ed->all[idx].len, &ed->all[idx].d))
299 { 299 {
300 long long mantisse = 0; 300 long long mantisse = 0;
301 long exponent = 0; 301 long exponent = 0;
302 302
303 if (eina_convert_atod(str, ed->all[index].len, &mantisse, &exponent) == EINA_FALSE) 303 if (eina_convert_atod(str, ed->all[idx].len, &mantisse, &exponent) == EINA_FALSE)
304 return EINA_FALSE; 304 return EINA_FALSE;
305 305
306 ed->all[index].d = ldexp((double) mantisse, exponent); 306 ed->all[idx].d = ldexp((double) mantisse, exponent);
307 } 307 }
308 308
309 ed->all[index].type |= EET_D_DOUBLE; 309 ed->all[idx].type |= EET_D_DOUBLE;
310 } 310 }
311 311
312 *result = ed->all[index].d; 312 *result = ed->all[idx].d;
313 return EINA_TRUE; 313 return EINA_TRUE;
314} 314}
315 315
316Eina_Bool 316Eina_Bool
317eet_dictionary_string_get_fp(const Eet_Dictionary *ed, int index, Eina_F32p32 *result) 317eet_dictionary_string_get_fp(const Eet_Dictionary *ed, int idx, Eina_F32p32 *result)
318{ 318{
319 if (!_eet_dictionary_test(ed, index, result)) return EINA_FALSE; 319 if (!_eet_dictionary_test(ed, idx, result)) return EINA_FALSE;
320 320
321 if (!(ed->all[index].type & EET_D_FIXED_POINT)) 321 if (!(ed->all[idx].type & EET_D_FIXED_POINT))
322 { 322 {
323 const char *str; 323 const char *str;
324 Eina_F32p32 fp; 324 Eina_F32p32 fp;
325 325
326 str = ed->all[index].str ? ed->all[index].str : ed->all[index].mmap; 326 str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
327 327
328 if (!eina_convert_atofp(str, ed->all[index].len, &fp)) 328 if (!eina_convert_atofp(str, ed->all[idx].len, &fp))
329 return EINA_FALSE; 329 return EINA_FALSE;
330 330
331 ed->all[index].fp = fp; 331 ed->all[idx].fp = fp;
332 ed->all[index].type |= EET_D_FIXED_POINT; 332 ed->all[idx].type |= EET_D_FIXED_POINT;
333 } 333 }
334 334
335 *result = ed->all[index].fp; 335 *result = ed->all[idx].fp;
336 return EINA_TRUE; 336 return EINA_TRUE;
337} 337}
338 338
diff --git a/legacy/eet/src/lib/eet_image.c b/legacy/eet/src/lib/eet_image.c
index cfc3a8b7f2..48618d0fcf 100644
--- a/legacy/eet/src/lib/eet_image.c
+++ b/legacy/eet/src/lib/eet_image.c
@@ -753,7 +753,7 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
753 753
754 { 754 {
755 const int *ptr; 755 const int *ptr;
756 void *d = NULL; 756 void *dst = NULL;
757 size_t sz = 0; 757 size_t sz = 0;
758 struct _JPEG_error_mgr jerr; 758 struct _JPEG_error_mgr jerr;
759 JSAMPROW *jbuf; 759 JSAMPROW *jbuf;
@@ -769,7 +769,7 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
769 if (setjmp(jerr.setjmp_buffer)) return NULL; 769 if (setjmp(jerr.setjmp_buffer)) return NULL;
770 770
771 jpeg_create_compress(&cinfo); 771 jpeg_create_compress(&cinfo);
772 if (eet_jpeg_membuf_dst(&cinfo, &d, &sz)) 772 if (eet_jpeg_membuf_dst(&cinfo, &dst, &sz))
773 { 773 {
774 jpeg_destroy_compress(&cinfo); 774 jpeg_destroy_compress(&cinfo);
775 return NULL; 775 return NULL;
@@ -812,12 +812,12 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
812 jpeg_finish_compress(&cinfo); 812 jpeg_finish_compress(&cinfo);
813 jpeg_destroy_compress(&cinfo); 813 jpeg_destroy_compress(&cinfo);
814 814
815 d1 = d; 815 d1 = dst;
816 sz1 = sz; 816 sz1 = sz;
817 } 817 }
818 { 818 {
819 const int *ptr; 819 const int *ptr;
820 void *d = NULL; 820 void *dst = NULL;
821 size_t sz = 0; 821 size_t sz = 0;
822 struct _JPEG_error_mgr jerr; 822 struct _JPEG_error_mgr jerr;
823 JSAMPROW *jbuf; 823 JSAMPROW *jbuf;
@@ -837,7 +837,7 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
837 } 837 }
838 838
839 jpeg_create_compress(&cinfo); 839 jpeg_create_compress(&cinfo);
840 if (eet_jpeg_membuf_dst(&cinfo, &d, &sz)) 840 if (eet_jpeg_membuf_dst(&cinfo, &dst, &sz))
841 { 841 {
842 jpeg_destroy_compress(&cinfo); 842 jpeg_destroy_compress(&cinfo);
843 free(d1); 843 free(d1);
@@ -879,7 +879,7 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
879 jpeg_finish_compress(&cinfo); 879 jpeg_finish_compress(&cinfo);
880 jpeg_destroy_compress(&cinfo); 880 jpeg_destroy_compress(&cinfo);
881 881
882 d2 = d; 882 d2 = dst;
883 sz2 = sz; 883 sz2 = sz;
884 } 884 }
885 d = malloc(12 + sz1 + sz2); 885 d = malloc(12 + sz1 + sz2);
@@ -911,12 +911,12 @@ eet_data_image_jpeg_alpha_convert(int *size, const void *data, unsigned int w, u
911EAPI int 911EAPI int
912eet_data_image_write_cipher(Eet_File *ef, const char *name, const char *key, 912eet_data_image_write_cipher(Eet_File *ef, const char *name, const char *key,
913 const void *data, unsigned int w, unsigned int h, int alpha, 913 const void *data, unsigned int w, unsigned int h, int alpha,
914 int compress, int quality, int lossy) 914 int comp, int quality, int lossy)
915{ 915{
916 void *d = NULL; 916 void *d = NULL;
917 int size = 0; 917 int size = 0;
918 918
919 d = eet_data_image_encode(data, &size, w, h, alpha, compress, quality, lossy); 919 d = eet_data_image_encode(data, &size, w, h, alpha, comp, quality, lossy);
920 if (d) 920 if (d)
921 { 921 {
922 int v; 922 int v;
@@ -931,16 +931,16 @@ eet_data_image_write_cipher(Eet_File *ef, const char *name, const char *key,
931EAPI int 931EAPI int
932eet_data_image_write(Eet_File *ef, const char *name, 932eet_data_image_write(Eet_File *ef, const char *name,
933 const void *data, unsigned int w, unsigned int h, int alpha, 933 const void *data, unsigned int w, unsigned int h, int alpha,
934 int compress, int quality, int lossy) 934 int comp, int quality, int lossy)
935{ 935{
936 return eet_data_image_write_cipher(ef, name, NULL, data, w, h, alpha, compress, quality, lossy); 936 return eet_data_image_write_cipher(ef, name, NULL, data, w, h, alpha, comp, quality, lossy);
937} 937}
938 938
939 939
940EAPI void * 940EAPI void *
941eet_data_image_read_cipher(Eet_File *ef, const char *name, const char *key, 941eet_data_image_read_cipher(Eet_File *ef, const char *name, const char *key,
942 unsigned int *w, unsigned int *h, int *alpha, 942 unsigned int *w, unsigned int *h, int *alpha,
943 int *compress, int *quality, int *lossy) 943 int *comp, int *quality, int *lossy)
944{ 944{
945 unsigned int *d = NULL; 945 unsigned int *d = NULL;
946 void *data = NULL; 946 void *data = NULL;
@@ -956,7 +956,7 @@ eet_data_image_read_cipher(Eet_File *ef, const char *name, const char *key,
956 if (!data) return NULL; 956 if (!data) return NULL;
957 } 957 }
958 958
959 d = eet_data_image_decode(data, size, w, h, alpha, compress, quality, lossy); 959 d = eet_data_image_decode(data, size, w, h, alpha, comp, quality, lossy);
960 960
961 if (free_data) 961 if (free_data)
962 free(data); 962 free(data);
@@ -967,15 +967,15 @@ eet_data_image_read_cipher(Eet_File *ef, const char *name, const char *key,
967EAPI void * 967EAPI void *
968eet_data_image_read(Eet_File *ef, const char *name, 968eet_data_image_read(Eet_File *ef, const char *name,
969 unsigned int *w, unsigned int *h, int *alpha, 969 unsigned int *w, unsigned int *h, int *alpha,
970 int *compress, int *quality, int *lossy) 970 int *comp, int *quality, int *lossy)
971{ 971{
972 return eet_data_image_read_cipher(ef, name, NULL, w, h, alpha, compress, quality, lossy); 972 return eet_data_image_read_cipher(ef, name, NULL, w, h, alpha, comp, quality, lossy);
973} 973}
974 974
975EAPI int 975EAPI int
976eet_data_image_read_to_surface_cipher(Eet_File *ef, const char *name, const char *key, unsigned int src_x, unsigned int src_y, 976eet_data_image_read_to_surface_cipher(Eet_File *ef, const char *name, const char *key, unsigned int src_x, unsigned int src_y,
977 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, 977 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride,
978 int *alpha, int *compress, int *quality, int *lossy) 978 int *alpha, int *comp, int *quality, int *lossy)
979{ 979{
980 void *data = NULL; 980 void *data = NULL;
981 int free_data = 0; 981 int free_data = 0;
@@ -991,7 +991,7 @@ eet_data_image_read_to_surface_cipher(Eet_File *ef, const char *name, const char
991 if (!data) return 0; 991 if (!data) return 0;
992 } 992 }
993 993
994 res = eet_data_image_decode_to_surface(data, size, src_x, src_y, d, w, h, row_stride, alpha, compress, quality, lossy); 994 res = eet_data_image_decode_to_surface(data, size, src_x, src_y, d, w, h, row_stride, alpha, comp, quality, lossy);
995 995
996 if (free_data) 996 if (free_data)
997 free(data); 997 free(data);
@@ -1002,15 +1002,15 @@ eet_data_image_read_to_surface_cipher(Eet_File *ef, const char *name, const char
1002EAPI int 1002EAPI int
1003eet_data_image_read_to_surface(Eet_File *ef, const char *name, unsigned int src_x, unsigned int src_y, 1003eet_data_image_read_to_surface(Eet_File *ef, const char *name, unsigned int src_x, unsigned int src_y,
1004 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, 1004 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride,
1005 int *alpha, int *compress, int *quality, int *lossy) 1005 int *alpha, int *comp, int *quality, int *lossy)
1006{ 1006{
1007 return eet_data_image_read_to_surface_cipher(ef, name, NULL, src_x, src_y, d, w, h, row_stride, alpha, compress, quality, lossy); 1007 return eet_data_image_read_to_surface_cipher(ef, name, NULL, src_x, src_y, d, w, h, row_stride, alpha, comp, quality, lossy);
1008} 1008}
1009 1009
1010EAPI int 1010EAPI int
1011eet_data_image_header_read_cipher(Eet_File *ef, const char *name, const char *key, 1011eet_data_image_header_read_cipher(Eet_File *ef, const char *name, const char *key,
1012 unsigned int *w, unsigned int *h, int *alpha, 1012 unsigned int *w, unsigned int *h, int *alpha,
1013 int *compress, int *quality, int *lossy) 1013 int *comp, int *quality, int *lossy)
1014{ 1014{
1015 void *data = NULL; 1015 void *data = NULL;
1016 int size = 0; 1016 int size = 0;
@@ -1026,7 +1026,7 @@ eet_data_image_header_read_cipher(Eet_File *ef, const char *name, const char *ke
1026 if (!data) return 0; 1026 if (!data) return 0;
1027 } 1027 }
1028 1028
1029 d = eet_data_image_header_decode(data, size, w, h, alpha, compress, quality, lossy); 1029 d = eet_data_image_header_decode(data, size, w, h, alpha, comp, quality, lossy);
1030 if (free_data) 1030 if (free_data)
1031 free(data); 1031 free(data);
1032 1032
@@ -1036,14 +1036,14 @@ eet_data_image_header_read_cipher(Eet_File *ef, const char *name, const char *ke
1036EAPI int 1036EAPI int
1037eet_data_image_header_read(Eet_File *ef, const char *name, 1037eet_data_image_header_read(Eet_File *ef, const char *name,
1038 unsigned int *w, unsigned int *h, int *alpha, 1038 unsigned int *w, unsigned int *h, int *alpha,
1039 int *compress, int *quality, int *lossy) 1039 int *comp, int *quality, int *lossy)
1040{ 1040{
1041 return eet_data_image_header_read_cipher(ef, name, NULL, w, h, alpha, compress, quality, lossy); 1041 return eet_data_image_header_read_cipher(ef, name, NULL, w, h, alpha, comp, quality, lossy);
1042} 1042}
1043 1043
1044 1044
1045EAPI void * 1045EAPI void *
1046eet_data_image_encode_cipher(const void *data, const char *key, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy, int *size_ret) 1046eet_data_image_encode_cipher(const void *data, const char *key, unsigned int w, unsigned int h, int alpha, int comp, int quality, int lossy, int *size_ret)
1047{ 1047{
1048 void *d = NULL; 1048 void *d = NULL;
1049 void *ciphered_d = NULL; 1049 void *ciphered_d = NULL;
@@ -1052,12 +1052,12 @@ eet_data_image_encode_cipher(const void *data, const char *key, unsigned int w,
1052 1052
1053 if (lossy == 0) 1053 if (lossy == 0)
1054 { 1054 {
1055 if (compress > 0) 1055 if (comp > 0)
1056 d = eet_data_image_lossless_compressed_convert(&size, data, w, h, alpha, compress); 1056 d = eet_data_image_lossless_compressed_convert(&size, data, w, h, alpha, comp);
1057 1057
1058 /* eet_data_image_lossless_compressed_convert will refuse to compress something 1058 /* eet_data_image_lossless_compressed_convert will refuse to compress something
1059 if the result is bigger than the entry. */ 1059 if the result is bigger than the entry. */
1060 if (compress <= 0 || d == NULL) 1060 if (comp <= 0 || d == NULL)
1061 d = eet_data_image_lossless_convert(&size, data, w, h, alpha); 1061 d = eet_data_image_lossless_convert(&size, data, w, h, alpha);
1062 } 1062 }
1063 else 1063 else
@@ -1084,13 +1084,13 @@ eet_data_image_encode_cipher(const void *data, const char *key, unsigned int w,
1084} 1084}
1085 1085
1086EAPI void * 1086EAPI void *
1087eet_data_image_encode(const void *data, int *size_ret, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy) 1087eet_data_image_encode(const void *data, int *size_ret, unsigned int w, unsigned int h, int alpha, int comp, int quality, int lossy)
1088{ 1088{
1089 return eet_data_image_encode_cipher(data, NULL, w, h, alpha, compress, quality, lossy, size_ret); 1089 return eet_data_image_encode_cipher(data, NULL, w, h, alpha, comp, quality, lossy, size_ret);
1090} 1090}
1091 1091
1092EAPI int 1092EAPI int
1093eet_data_image_header_decode_cipher(const void *data, const char *key, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy) 1093eet_data_image_header_decode_cipher(const void *data, const char *key, int size, unsigned int *w, unsigned int *h, int *alpha, int *comp, int *quality, int *lossy)
1094{ 1094{
1095 int header[8]; 1095 int header[8];
1096 void *deciphered_d = NULL; 1096 void *deciphered_d = NULL;
@@ -1138,7 +1138,7 @@ eet_data_image_header_decode_cipher(const void *data, const char *key, int size,
1138 if (w) *w = iw; 1138 if (w) *w = iw;
1139 if (h) *h = ih; 1139 if (h) *h = ih;
1140 if (alpha) *alpha = al ? 1 : 0; 1140 if (alpha) *alpha = al ? 1 : 0;
1141 if (compress) *compress = cp; 1141 if (comp) *comp = cp;
1142 if (lossy) *lossy = 0; 1142 if (lossy) *lossy = 0;
1143 if (quality) *quality = 100; 1143 if (quality) *quality = 100;
1144 return 1; 1144 return 1;
@@ -1160,7 +1160,7 @@ eet_data_image_header_decode_cipher(const void *data, const char *key, int size,
1160 if (w) *w = iw; 1160 if (w) *w = iw;
1161 if (h) *h = ih; 1161 if (h) *h = ih;
1162 if (alpha) *alpha = 1; 1162 if (alpha) *alpha = 1;
1163 if (compress) *compress = 0; 1163 if (comp) *comp = 0;
1164 if (lossy) *lossy = 1; 1164 if (lossy) *lossy = 1;
1165 if (quality) *quality = 75; 1165 if (quality) *quality = 75;
1166 return 1; 1166 return 1;
@@ -1177,7 +1177,7 @@ eet_data_image_header_decode_cipher(const void *data, const char *key, int size,
1177 if (w) *w = iw; 1177 if (w) *w = iw;
1178 if (h) *h = ih; 1178 if (h) *h = ih;
1179 if (alpha) *alpha = 0; 1179 if (alpha) *alpha = 0;
1180 if (compress) *compress = 0; 1180 if (comp) *comp = 0;
1181 if (lossy) *lossy = 1; 1181 if (lossy) *lossy = 1;
1182 if (quality) *quality = 75; 1182 if (quality) *quality = 75;
1183 return 1; 1183 return 1;
@@ -1187,9 +1187,9 @@ eet_data_image_header_decode_cipher(const void *data, const char *key, int size,
1187} 1187}
1188 1188
1189EAPI int 1189EAPI int
1190eet_data_image_header_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy) 1190eet_data_image_header_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *comp, int *quality, int *lossy)
1191{ 1191{
1192 return eet_data_image_header_decode_cipher(data, NULL, size, w, h, alpha, compress, quality, lossy); 1192 return eet_data_image_header_decode_cipher(data, NULL, size, w, h, alpha, comp, quality, lossy);
1193} 1193}
1194 1194
1195static void 1195static void
@@ -1217,14 +1217,14 @@ static int
1217_eet_data_image_decode_inside(const void *data, int size, unsigned int src_x, unsigned int src_y, 1217_eet_data_image_decode_inside(const void *data, int size, unsigned int src_x, unsigned int src_y,
1218 unsigned int src_w, unsigned int src_h, 1218 unsigned int src_w, unsigned int src_h,
1219 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, 1219 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride,
1220 int alpha, int compress, int quality, int lossy) 1220 int alpha, int comp, int quality, int lossy)
1221{ 1221{
1222 if (lossy == 0 && quality == 100) 1222 if (lossy == 0 && quality == 100)
1223 { 1223 {
1224 unsigned int *body; 1224 unsigned int *body;
1225 1225
1226 body = ((unsigned int *)data) + 8; 1226 body = ((unsigned int *)data) + 8;
1227 if (!compress) 1227 if (!comp)
1228 { 1228 {
1229 _eet_data_image_copy_buffer(body, src_x, src_y, src_w, d, w, h, row_stride); 1229 _eet_data_image_copy_buffer(body, src_x, src_y, src_w, d, w, h, row_stride);
1230 } 1230 }
@@ -1263,7 +1263,7 @@ _eet_data_image_decode_inside(const void *data, int size, unsigned int src_x, un
1263 for (x = 0; x < (w * h); x++) SWAP32(d[x]); 1263 for (x = 0; x < (w * h); x++) SWAP32(d[x]);
1264 } 1264 }
1265 } 1265 }
1266 else if (compress == 0 && lossy == 1) 1266 else if (comp == 0 && lossy == 1)
1267 { 1267 {
1268 if (alpha) 1268 if (alpha)
1269 { 1269 {
@@ -1306,7 +1306,7 @@ _eet_data_image_decode_inside(const void *data, int size, unsigned int src_x, un
1306} 1306}
1307 1307
1308EAPI void * 1308EAPI void *
1309eet_data_image_decode_cipher(const void *data, const char *key, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy) 1309eet_data_image_decode_cipher(const void *data, const char *key, int size, unsigned int *w, unsigned int *h, int *alpha, int *comp, int *quality, int *lossy)
1310{ 1310{
1311 unsigned int *d = NULL; 1311 unsigned int *d = NULL;
1312 unsigned int iw, ih; 1312 unsigned int iw, ih;
@@ -1341,7 +1341,7 @@ eet_data_image_decode_cipher(const void *data, const char *key, int size, unsign
1341 if (w) *w = iw; 1341 if (w) *w = iw;
1342 if (h) *h = ih; 1342 if (h) *h = ih;
1343 if (alpha) *alpha = ialpha; 1343 if (alpha) *alpha = ialpha;
1344 if (compress) *compress = icompress; 1344 if (comp) *comp = icompress;
1345 if (quality) *quality = iquality; 1345 if (quality) *quality = iquality;
1346 if (lossy) *lossy = ilossy; 1346 if (lossy) *lossy = ilossy;
1347 1347
@@ -1349,15 +1349,15 @@ eet_data_image_decode_cipher(const void *data, const char *key, int size, unsign
1349} 1349}
1350 1350
1351EAPI void * 1351EAPI void *
1352eet_data_image_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy) 1352eet_data_image_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *comp, int *quality, int *lossy)
1353{ 1353{
1354 return eet_data_image_decode_cipher(data, NULL, size, w, h, alpha, compress, quality, lossy); 1354 return eet_data_image_decode_cipher(data, NULL, size, w, h, alpha, comp, quality, lossy);
1355} 1355}
1356 1356
1357EAPI int 1357EAPI int
1358eet_data_image_decode_to_surface_cipher(const void *data, const char *key, int size, unsigned int src_x, unsigned int src_y, 1358eet_data_image_decode_to_surface_cipher(const void *data, const char *key, int size, unsigned int src_x, unsigned int src_y,
1359 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, 1359 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride,
1360 int *alpha, int *compress, int *quality, int *lossy) 1360 int *alpha, int *comp, int *quality, int *lossy)
1361{ 1361{
1362 unsigned int iw, ih; 1362 unsigned int iw, ih;
1363 int ialpha, icompress, iquality, ilossy; 1363 int ialpha, icompress, iquality, ilossy;
@@ -1387,7 +1387,7 @@ eet_data_image_decode_to_surface_cipher(const void *data, const char *key, int s
1387 return 0; 1387 return 0;
1388 1388
1389 if (alpha) *alpha = ialpha; 1389 if (alpha) *alpha = ialpha;
1390 if (compress) *compress = icompress; 1390 if (comp) *comp = icompress;
1391 if (quality) *quality = iquality; 1391 if (quality) *quality = iquality;
1392 if (lossy) *lossy = ilossy; 1392 if (lossy) *lossy = ilossy;
1393 1393
@@ -1397,7 +1397,7 @@ eet_data_image_decode_to_surface_cipher(const void *data, const char *key, int s
1397EAPI int 1397EAPI int
1398eet_data_image_decode_to_surface(const void *data, int size, unsigned int src_x, unsigned int src_y, 1398eet_data_image_decode_to_surface(const void *data, int size, unsigned int src_x, unsigned int src_y,
1399 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, 1399 unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride,
1400 int *alpha, int *compress, int *quality, int *lossy) 1400 int *alpha, int *comp, int *quality, int *lossy)
1401{ 1401{
1402 return eet_data_image_decode_to_surface_cipher(data, NULL, size, src_x, src_y, d, w, h, row_stride, alpha, compress, quality, lossy); 1402 return eet_data_image_decode_to_surface_cipher(data, NULL, size, src_x, src_y, d, w, h, row_stride, alpha, comp, quality, lossy);
1403} 1403}
diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c
index c9f8574b79..9554963362 100644
--- a/legacy/eet/src/lib/eet_lib.c
+++ b/legacy/eet/src/lib/eet_lib.c
@@ -898,7 +898,7 @@ eet_internal_read2(Eet_File *ef)
898{ 898{
899 const int *data = (const int*) ef->data; 899 const int *data = (const int*) ef->data;
900 const char *start = (const char*) ef->data; 900 const char *start = (const char*) ef->data;
901 int index = 0; 901 int idx = 0;
902 int num_directory_entries; 902 int num_directory_entries;
903 int bytes_directory_entries; 903 int bytes_directory_entries;
904 int num_dictionary_entries; 904 int num_dictionary_entries;
@@ -906,7 +906,7 @@ eet_internal_read2(Eet_File *ef)
906 int signature_base_offset; 906 int signature_base_offset;
907 int i; 907 int i;
908 908
909 index += sizeof(int); 909 idx += sizeof(int);
910 if (eet_test_close((int) ntohl(*data) != EET_MAGIC_FILE2, ef)) 910 if (eet_test_close((int) ntohl(*data) != EET_MAGIC_FILE2, ef))
911 return NULL; 911 return NULL;
912 data++; 912 data++;
@@ -919,9 +919,9 @@ eet_internal_read2(Eet_File *ef)
919 } 919 }
920 920
921 /* get entries count and byte count */ 921 /* get entries count and byte count */
922 GET_INT(num_directory_entries, data, index); 922 GET_INT(num_directory_entries, data, idx);
923 /* get dictionary count and byte count */ 923 /* get dictionary count and byte count */
924 GET_INT(num_dictionary_entries, data, index); 924 GET_INT(num_dictionary_entries, data, idx);
925 925
926 bytes_directory_entries = EET_FILE2_DIRECTORY_ENTRY_SIZE * num_directory_entries + EET_FILE2_HEADER_SIZE; 926 bytes_directory_entries = EET_FILE2_DIRECTORY_ENTRY_SIZE * num_directory_entries + EET_FILE2_HEADER_SIZE;
927 bytes_dictionary_entries = EET_FILE2_DICTIONARY_ENTRY_SIZE * num_dictionary_entries; 927 bytes_dictionary_entries = EET_FILE2_DICTIONARY_ENTRY_SIZE * num_dictionary_entries;
@@ -972,12 +972,12 @@ eet_internal_read2(Eet_File *ef)
972 return NULL; 972 return NULL;
973 973
974 /* get entrie header */ 974 /* get entrie header */
975 GET_INT(efn->offset, data, index); 975 GET_INT(efn->offset, data, idx);
976 GET_INT(efn->size, data, index); 976 GET_INT(efn->size, data, idx);
977 GET_INT(efn->data_size, data, index); 977 GET_INT(efn->data_size, data, idx);
978 GET_INT(name_offset, data, index); 978 GET_INT(name_offset, data, idx);
979 GET_INT(name_size, data, index); 979 GET_INT(name_size, data, idx);
980 GET_INT(flag, data, index); 980 GET_INT(flag, data, idx);
981 981
982 efn->compression = flag & 0x1 ? 1 : 0; 982 efn->compression = flag & 0x1 ? 1 : 0;
983 efn->ciphered = flag & 0x2 ? 1 : 0; 983 efn->ciphered = flag & 0x2 ? 1 : 0;
@@ -1035,7 +1035,7 @@ eet_internal_read2(Eet_File *ef)
1035 const int *dico = (const int*) ef->data + EET_FILE2_DIRECTORY_ENTRY_COUNT * num_directory_entries + EET_FILE2_HEADER_COUNT; 1035 const int *dico = (const int*) ef->data + EET_FILE2_DIRECTORY_ENTRY_COUNT * num_directory_entries + EET_FILE2_HEADER_COUNT;
1036 int j; 1036 int j;
1037 1037
1038 if (eet_test_close((num_dictionary_entries * (int) EET_FILE2_DICTIONARY_ENTRY_SIZE + index) > (bytes_dictionary_entries + bytes_directory_entries), ef)) 1038 if (eet_test_close((num_dictionary_entries * (int) EET_FILE2_DICTIONARY_ENTRY_SIZE + idx) > (bytes_dictionary_entries + bytes_directory_entries), ef))
1039 return NULL; 1039 return NULL;
1040 1040
1041 ef->ed = calloc(1, sizeof (Eet_Dictionary)); 1041 ef->ed = calloc(1, sizeof (Eet_Dictionary));
@@ -1054,11 +1054,11 @@ eet_internal_read2(Eet_File *ef)
1054 int hash; 1054 int hash;
1055 int offset; 1055 int offset;
1056 1056
1057 GET_INT(hash, dico, index); 1057 GET_INT(hash, dico, idx);
1058 GET_INT(offset, dico, index); 1058 GET_INT(offset, dico, idx);
1059 GET_INT(ef->ed->all[j].len, dico, index); 1059 GET_INT(ef->ed->all[j].len, dico, idx);
1060 GET_INT(ef->ed->all[j].prev, dico, index); 1060 GET_INT(ef->ed->all[j].prev, dico, idx);
1061 GET_INT(ef->ed->all[j].next, dico, index); 1061 GET_INT(ef->ed->all[j].next, dico, idx);
1062 1062
1063 /* Hash value could be stored on 8bits data, but this will break alignment of all the others data. 1063 /* Hash value could be stored on 8bits data, but this will break alignment of all the others data.
1064 So stick to int and check the value. */ 1064 So stick to int and check the value. */
@@ -1120,7 +1120,7 @@ eet_internal_read1(Eet_File *ef)
1120{ 1120{
1121 const unsigned char *dyn_buf = NULL; 1121 const unsigned char *dyn_buf = NULL;
1122 const unsigned char *p = NULL; 1122 const unsigned char *p = NULL;
1123 int index = 0; 1123 int idx = 0;
1124 int num_entries; 1124 int num_entries;
1125 int byte_entries; 1125 int byte_entries;
1126 int i; 1126 int i;
@@ -1129,7 +1129,7 @@ eet_internal_read1(Eet_File *ef)
1129 1129
1130 /* build header table if read mode */ 1130 /* build header table if read mode */
1131 /* geat header */ 1131 /* geat header */
1132 index += sizeof(int); 1132 idx += sizeof(int);
1133 if (eet_test_close((int)ntohl(*((int *)ef->data)) != EET_MAGIC_FILE, ef)) 1133 if (eet_test_close((int)ntohl(*((int *)ef->data)) != EET_MAGIC_FILE, ef))
1134 return NULL; 1134 return NULL;
1135 1135
@@ -1142,8 +1142,8 @@ eet_internal_read1(Eet_File *ef)
1142 } 1142 }
1143 1143
1144 /* get entries count and byte count */ 1144 /* get entries count and byte count */
1145 EXTRACT_INT(num_entries, ef->data, index); 1145 EXTRACT_INT(num_entries, ef->data, idx);
1146 EXTRACT_INT(byte_entries, ef->data, index); 1146 EXTRACT_INT(byte_entries, ef->data, idx);
1147 1147
1148 /* we cant have <= 0 values here - invalid */ 1148 /* we cant have <= 0 values here - invalid */
1149 if (eet_test_close((num_entries <= 0) || (byte_entries <= 0), ef)) 1149 if (eet_test_close((num_entries <= 0) || (byte_entries <= 0), ef))
@@ -1177,7 +1177,7 @@ eet_internal_read1(Eet_File *ef)
1177 return NULL; 1177 return NULL;
1178 1178
1179 /* actually read the directory block - all of it, into ram */ 1179 /* actually read the directory block - all of it, into ram */
1180 dyn_buf = ef->data + index; 1180 dyn_buf = ef->data + idx;
1181 1181
1182 /* parse directory block */ 1182 /* parse directory block */
1183 p = dyn_buf; 1183 p = dyn_buf;
@@ -1844,7 +1844,7 @@ eet_read_direct(Eet_File *ef, const char *name, int *size_ret)
1844} 1844}
1845 1845
1846EAPI int 1846EAPI int
1847eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int compress, const char *cipher_key) 1847eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int comp, const char *cipher_key)
1848{ 1848{
1849 Eet_File_Node *efn; 1849 Eet_File_Node *efn;
1850 void *data2 = NULL; 1850 void *data2 = NULL;
@@ -1895,16 +1895,16 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
1895 /* figure hash bucket */ 1895 /* figure hash bucket */
1896 hash = _eet_hash_gen(name, ef->header->directory->size); 1896 hash = _eet_hash_gen(name, ef->header->directory->size);
1897 1897
1898 data_size = compress ? 12 + ((size * 101) / 100) : size; 1898 data_size = comp ? 12 + ((size * 101) / 100) : size;
1899 1899
1900 if (compress || !cipher_key) 1900 if (comp || !cipher_key)
1901 { 1901 {
1902 data2 = malloc(data_size); 1902 data2 = malloc(data_size);
1903 if (!data2) goto on_error; 1903 if (!data2) goto on_error;
1904 } 1904 }
1905 1905
1906 /* if we want to compress */ 1906 /* if we want to compress */
1907 if (compress) 1907 if (comp)
1908 { 1908 {
1909 uLongf buflen; 1909 uLongf buflen;
1910 1910
@@ -1920,7 +1920,7 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
1920 data_size = (int)buflen; 1920 data_size = (int)buflen;
1921 if (data_size < 0 || data_size >= size) 1921 if (data_size < 0 || data_size >= size)
1922 { 1922 {
1923 compress = 0; 1923 comp = 0;
1924 data_size = size; 1924 data_size = size;
1925 } 1925 }
1926 else 1926 else
@@ -1954,7 +1954,7 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
1954 } 1954 }
1955 } 1955 }
1956 else 1956 else
1957 if (!compress) 1957 if (!comp)
1958 memcpy(data2, data, size); 1958 memcpy(data2, data, size);
1959 1959
1960 /* Does this node already exist? */ 1960 /* Does this node already exist? */
@@ -1965,7 +1965,7 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
1965 { 1965 {
1966 free(efn->data); 1966 free(efn->data);
1967 efn->ciphered = cipher_key ? 1 : 0; 1967 efn->ciphered = cipher_key ? 1 : 0;
1968 efn->compression = !!compress; 1968 efn->compression = !!comp;
1969 efn->size = data_size; 1969 efn->size = data_size;
1970 efn->data_size = size; 1970 efn->data_size = size;
1971 efn->data = data2; 1971 efn->data = data2;
@@ -1990,7 +1990,7 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
1990 ef->header->directory->nodes[hash] = efn; 1990 ef->header->directory->nodes[hash] = efn;
1991 efn->offset = -1; 1991 efn->offset = -1;
1992 efn->ciphered = cipher_key ? 1 : 0; 1992 efn->ciphered = cipher_key ? 1 : 0;
1993 efn->compression = !!compress; 1993 efn->compression = !!comp;
1994 efn->size = data_size; 1994 efn->size = data_size;
1995 efn->data_size = size; 1995 efn->data_size = size;
1996 efn->data = data2; 1996 efn->data = data2;
@@ -2007,9 +2007,9 @@ eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int
2007} 2007}
2008 2008
2009EAPI int 2009EAPI int
2010eet_write(Eet_File *ef, const char *name, const void *data, int size, int compress) 2010eet_write(Eet_File *ef, const char *name, const void *data, int size, int comp)
2011{ 2011{
2012 return eet_write_cipher(ef, name, data, size, compress, NULL); 2012 return eet_write_cipher(ef, name, data, size, comp, NULL);
2013} 2013}
2014 2014
2015EAPI int 2015EAPI int
diff --git a/legacy/eet/src/lib/eet_node.c b/legacy/eet/src/lib/eet_node.c
index 6905090a8f..6f33dda0a6 100644
--- a/legacy/eet/src/lib/eet_node.c
+++ b/legacy/eet/src/lib/eet_node.c
@@ -626,8 +626,8 @@ eet_node_walk(void *parent, const char *name, Eet_Node *root, Eet_Node_Walk *cb,
626int 626int
627eet_node_init(void) 627eet_node_init(void)
628{ 628{
629 char *choice; 629 const char *choice;
630 char *tmp; 630 const char *tmp;
631 631
632 choice = "chained_mempool"; 632 choice = "chained_mempool";
633 tmp = getenv("EET_MEMPOOL"); 633 tmp = getenv("EET_MEMPOOL");