summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-02-01 11:04:17 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-02-01 14:25:35 +0000
commitf7c560c311d0ba0da94346e17c8b20f40a0ed152 (patch)
treeaf5f63aceb78ff1b153f3727f8adab6ee4e1d653 /src/lib/emile
parent36286a23fe97e3667c1106116d1edbc301c7a9ba (diff)
replace hton and ntoh family functions with ones defined in eina
Summary: This fixes especially the execution of edje_cc on Windows Test Plan: execution of edje_cc Reviewers: cedric, raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7834
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_cipher_gnutls.c8
-rw-r--r--src/lib/emile/emile_cipher_openssl.c8
-rw-r--r--src/lib/emile/emile_image.c15
3 files changed, 6 insertions, 25 deletions
diff --git a/src/lib/emile/emile_cipher_gnutls.c b/src/lib/emile/emile_cipher_gnutls.c
index 966859bdfd..92f41a57d2 100644
--- a/src/lib/emile/emile_cipher_gnutls.c
+++ b/src/lib/emile/emile_cipher_gnutls.c
@@ -2,10 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_NETINET_IN_H
6# include <netinet/in.h>
7#endif
8
9#include <gnutls/abstract.h> 5#include <gnutls/abstract.h>
10#include <gnutls/x509.h> 6#include <gnutls/x509.h>
11#include <gcrypt.h> 7#include <gcrypt.h>
@@ -220,7 +216,7 @@ emile_binbuf_cipher(Emile_Cipher_Algorithm algo,
220 eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt)); 216 eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt));
221 memset(&salt, 0, sizeof (salt)); 217 memset(&salt, 0, sizeof (salt));
222 218
223 tmp = htonl(eina_binbuf_length_get(data)); 219 tmp = eina_htonl(eina_binbuf_length_get(data));
224 eina_binbuf_append_length(result, (unsigned char*) &tmp, sizeof (tmp)); 220 eina_binbuf_append_length(result, (unsigned char*) &tmp, sizeof (tmp));
225 eina_binbuf_append_buffer(result, data); 221 eina_binbuf_append_buffer(result, data);
226 222
@@ -350,7 +346,7 @@ emile_binbuf_decipher(Emile_Cipher_Algorithm algo,
350 346
351 /* Get the decrypted data size */ 347 /* Get the decrypted data size */
352 tmp = *(unsigned int*)(eina_binbuf_string_get(result)); 348 tmp = *(unsigned int*)(eina_binbuf_string_get(result));
353 tmp = ntohl(tmp); 349 tmp = eina_ntohl(tmp);
354 if (tmp > tmp_len || tmp <= 0) 350 if (tmp > tmp_len || tmp <= 0)
355 goto on_error; 351 goto on_error;
356 352
diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c
index b5ca128a23..84b024465e 100644
--- a/src/lib/emile/emile_cipher_openssl.c
+++ b/src/lib/emile/emile_cipher_openssl.c
@@ -2,10 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_NETINET_IN_H
6# include <netinet/in.h>
7#endif
8
9#include <openssl/sha.h> 5#include <openssl/sha.h>
10#include <openssl/evp.h> 6#include <openssl/evp.h>
11#include <openssl/hmac.h> 7#include <openssl/hmac.h>
@@ -149,7 +145,7 @@ emile_binbuf_cipher(Emile_Cipher_Algorithm algo,
149 eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt)); 145 eina_binbuf_append_length(result, (unsigned char*) &salt, sizeof (salt));
150 memset(&salt, 0, sizeof (salt)); 146 memset(&salt, 0, sizeof (salt));
151 147
152 tmp = htonl(eina_binbuf_length_get(data)); 148 tmp = eina_htonl(eina_binbuf_length_get(data));
153 buffer = malloc(crypted_length - sizeof (int)); 149 buffer = malloc(crypted_length - sizeof (int));
154 if (!buffer) goto on_error; 150 if (!buffer) goto on_error;
155 *buffer = tmp; 151 *buffer = tmp;
@@ -279,7 +275,7 @@ emile_binbuf_decipher(Emile_Cipher_Algorithm algo,
279 275
280 /* Get the decrypted data size */ 276 /* Get the decrypted data size */
281 tmp = *(unsigned int*)(eina_binbuf_string_get(result)); 277 tmp = *(unsigned int*)(eina_binbuf_string_get(result));
282 tmp = ntohl(tmp); 278 tmp = eina_ntohl(tmp);
283 if (tmp > tmp_len || tmp <= 0) 279 if (tmp > tmp_len || tmp <= 0)
284 goto on_error; 280 goto on_error;
285 281
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 3432ccf9c5..4f6e11905e 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -2,17 +2,6 @@
2#include <config.h> 2#include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_NETINET_IN_H
6#include <netinet/in.h>
7#endif
8
9#ifdef _WIN32
10#include <winsock2.h>
11#include <Evil.h>
12#define HAVE_BOOLEAN /* This prevents libjpeg to redefine boolean */
13#define XMD_H /* This prevents libjpeg to redefine INT32 */
14#endif
15
16#ifdef ENABLE_LIBLZ4 5#ifdef ENABLE_LIBLZ4
17#include <lz4.h> 6#include <lz4.h>
18#else 7#else
@@ -337,8 +326,8 @@ _emile_tgv_head(Emile_Image *image,
337 image->compress = m[OFFSET_OPTIONS] & 0x1; 326 image->compress = m[OFFSET_OPTIONS] & 0x1;
338 image->blockless = (m[OFFSET_OPTIONS] & 0x2) != 0; 327 image->blockless = (m[OFFSET_OPTIONS] & 0x2) != 0;
339 328
340 image->size.width = ntohl(*((unsigned int *)&(m[OFFSET_WIDTH]))); 329 image->size.width = eina_ntohl(*((unsigned int *)&(m[OFFSET_WIDTH])));
341 image->size.height = ntohl(*((unsigned int *)&(m[OFFSET_HEIGHT]))); 330 image->size.height = eina_ntohl(*((unsigned int *)&(m[OFFSET_HEIGHT])));
342 331
343 if (image->blockless) 332 if (image->blockless)
344 { 333 {