summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-03-17 08:50:54 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 09:58:21 +0100
commit0e5686de73a6b9a9b094311df2e82b692bf9f22f (patch)
tree73d5ace8b7155dad58a8f51f43bfa2d4f158138f /src/lib/eet
parent5412be48e1dc5bc25b91c83430deccf79924b940 (diff)
eet: remove use of deprecated Eina_Binbuf functions.
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_cipher.c4
-rw-r--r--src/lib/eet/eet_image.c17
-rw-r--r--src/lib/eet/eet_lib.c8
3 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c
index 119c12e62d..073d4bf8ef 100644
--- a/src/lib/eet/eet_cipher.c
+++ b/src/lib/eet/eet_cipher.c
@@ -882,7 +882,7 @@ eet_cipher(const void *data,
882 Eina_Binbuf *out; 882 Eina_Binbuf *out;
883 Eina_Binbuf *in; 883 Eina_Binbuf *in;
884 884
885 in = eina_binbuf_manage_read_only_new_length(data, size); 885 in = eina_binbuf_manage_new(data, size, EINA_TRUE);
886 out = emile_binbuf_cipher(EMILE_AES256_CBC, in, key, length); 886 out = emile_binbuf_cipher(EMILE_AES256_CBC, in, key, length);
887 887
888 if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0; 888 if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0;
@@ -903,7 +903,7 @@ eet_decipher(const void *data,
903 Eina_Binbuf *out; 903 Eina_Binbuf *out;
904 Eina_Binbuf *in; 904 Eina_Binbuf *in;
905 905
906 in = eina_binbuf_manage_read_only_new_length(data, size); 906 in = eina_binbuf_manage_new(data, size, EINA_TRUE);
907 out = emile_binbuf_decipher(EMILE_AES256_CBC, in, key, length); 907 out = emile_binbuf_decipher(EMILE_AES256_CBC, in, key, length);
908 908
909 if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0; 909 if (result_length) *result_length = out ? eina_binbuf_length_get(out) : 0;
diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c
index 2b6b0c0043..3a20e8f429 100644
--- a/src/lib/eet/eet_image.c
+++ b/src/lib/eet/eet_image.c
@@ -354,7 +354,7 @@ eet_data_image_jpeg_header_decode(const void *data,
354 Emile_Image_Load_Error error; 354 Emile_Image_Load_Error error;
355 int r = 0; 355 int r = 0;
356 356
357 bin = eina_binbuf_manage_read_only_new_length(data, size); 357 bin = eina_binbuf_manage_new(data, size, EINA_TRUE);
358 if (!bin) return 0; 358 if (!bin) return 0;
359 359
360 memset(&opts, 0, sizeof (Emile_Image_Load_Opts)); 360 memset(&opts, 0, sizeof (Emile_Image_Load_Opts));
@@ -407,7 +407,7 @@ eet_data_image_jpeg_rgb_decode(const void *data,
407 // Fix for ABI incompatibility between 1.10 and 1.11 407 // Fix for ABI incompatibility between 1.10 and 1.11
408 if (cspace == 8) cspace = 9; 408 if (cspace == 8) cspace = 9;
409 409
410 bin = eina_binbuf_manage_read_only_new_length(data, size); 410 bin = eina_binbuf_manage_new(data, size, EINA_TRUE);
411 if (!bin) return 0; 411 if (!bin) return 0;
412 412
413 memset(&opts, 0, sizeof (Emile_Image_Load_Opts)); 413 memset(&opts, 0, sizeof (Emile_Image_Load_Opts));
@@ -461,7 +461,7 @@ eet_data_image_jpeg_alpha_decode(const void *data,
461 if (!pixels) 461 if (!pixels)
462 return 0; 462 return 0;
463 463
464 bin = eina_binbuf_manage_read_only_new_length(data, size); 464 bin = eina_binbuf_manage_new(data, size, EINA_TRUE);
465 if (!bin) return 0; 465 if (!bin) return 0;
466 466
467 memset(&opts, 0, sizeof (Emile_Image_Load_Opts)); 467 memset(&opts, 0, sizeof (Emile_Image_Load_Opts));
@@ -590,7 +590,7 @@ eet_data_image_etc2_decode(const void *data,
590 // Fix for ABI incompatibility between 1.10 and 1.11 590 // Fix for ABI incompatibility between 1.10 and 1.11
591 if (cspace == 8) cspace = 9; 591 if (cspace == 8) cspace = 9;
592 592
593 bin = eina_binbuf_manage_read_only_new_length(data, length); 593 bin = eina_binbuf_manage_new(data, length, EINA_TRUE);
594 if (!bin) return 0; 594 if (!bin) return 0;
595 595
596 memset(&opts, 0, sizeof (Emile_Image_Load_Opts)); 596 memset(&opts, 0, sizeof (Emile_Image_Load_Opts));
@@ -714,7 +714,7 @@ eet_data_image_lossless_compressed_convert(int *size,
714 data = (const char *) bigend_data; 714 data = (const char *) bigend_data;
715 } 715 }
716 716
717 in = eina_binbuf_manage_read_only_new_length(data, w * h * 4); 717 in = eina_binbuf_manage_new(data, w * h * 4, EINA_TRUE);
718 if (!in) 718 if (!in)
719 { 719 {
720 free(bigend_data); 720 free(bigend_data);
@@ -1034,7 +1034,7 @@ eet_data_image_etc1_compressed_convert(int *size,
1034 } 1034 }
1035 } 1035 }
1036 1036
1037 in = eina_binbuf_manage_read_only_new_length(buffer, block_count * etc_block_size); 1037 in = eina_binbuf_manage_new(buffer, block_count * etc_block_size, EINA_TRUE);
1038 if (compress) 1038 if (compress)
1039 { 1039 {
1040 Eina_Binbuf *out; 1040 Eina_Binbuf *out;
@@ -1977,13 +1977,12 @@ _eet_data_image_decode_inside(const void *data,
1977 Eina_Binbuf *in; 1977 Eina_Binbuf *in;
1978 Eina_Binbuf *out; 1978 Eina_Binbuf *out;
1979 1979
1980 in = eina_binbuf_manage_read_only_new_length((const unsigned char *) body, size - 8 * sizeof (int)); 1980 in = eina_binbuf_manage_new((const unsigned char *) body, size - 8 * sizeof (int), EINA_TRUE);
1981 if (!in) return 0; 1981 if (!in) return 0;
1982 1982
1983 if ((src_h == h) && (src_w == w) && (row_stride == src_w * 4)) 1983 if ((src_h == h) && (src_w == w) && (row_stride == src_w * 4))
1984 { 1984 {
1985 out = eina_binbuf_manage_read_only_new_length((void*) d, 1985 out = eina_binbuf_manage_new((void*) d, w * h * 4, EINA_TRUE);
1986 w * h * 4);
1987 if (!emile_expand(in, out, 1986 if (!emile_expand(in, out,
1988 eet_2_emile_compressor(comp))) 1987 eet_2_emile_compressor(comp)))
1989 { 1988 {
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index a5ef22d18a..ef4d75c7f5 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -2199,7 +2199,7 @@ eet_alias(Eet_File *ef,
2199 /* figure hash bucket */ 2199 /* figure hash bucket */
2200 hash = _eet_hash_gen(name, ef->header->directory->size); 2200 hash = _eet_hash_gen(name, ef->header->directory->size);
2201 2201
2202 in = eina_binbuf_manage_read_only_new_length((unsigned char*) destination, strlen(destination) + 1); 2202 in = eina_binbuf_manage_new((unsigned char*) destination, strlen(destination) + 1, EINA_TRUE);
2203 if (!in) goto on_error; 2203 if (!in) goto on_error;
2204 2204
2205 /* if we want to compress */ 2205 /* if we want to compress */
@@ -2322,7 +2322,7 @@ eet_write_cipher(Eet_File *ef,
2322 2322
2323 UNLOCK_FILE(ef); 2323 UNLOCK_FILE(ef);
2324 2324
2325 in = eina_binbuf_manage_read_only_new_length(data, size); 2325 in = eina_binbuf_manage_new(data, size, EINA_TRUE);
2326 if (comp) 2326 if (comp)
2327 { 2327 {
2328 Eina_Binbuf *out; 2328 Eina_Binbuf *out;
@@ -2740,7 +2740,7 @@ read_binbuf_from_disk(Eet_File *ef,
2740 Eet_File_Node *efn) 2740 Eet_File_Node *efn)
2741{ 2741{
2742 if (efn->data) 2742 if (efn->data)
2743 return eina_binbuf_manage_read_only_new_length(efn->data, efn->size); 2743 return eina_binbuf_manage_new(efn->data, efn->size, EINA_TRUE);
2744 2744
2745 if (efn->offset > ef->data_size) 2745 if (efn->offset > ef->data_size)
2746 return 0; 2746 return 0;
@@ -2751,5 +2751,5 @@ read_binbuf_from_disk(Eet_File *ef,
2751 if ((efn->offset + efn->size) > ef->data_size) 2751 if ((efn->offset + efn->size) > ef->data_size)
2752 return 0; 2752 return 0;
2753 2753
2754 return eina_binbuf_manage_read_only_new_length(ef->data + efn->offset, efn->size); 2754 return eina_binbuf_manage_new(ef->data + efn->offset, efn->size, EINA_TRUE);
2755} 2755}