summaryrefslogtreecommitdiff
path: root/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-10-02 18:32:18 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-10-02 20:54:50 +0900
commit672bd97cea1c9b3cde4b687de18c0a907a3f3587 (patch)
treefc6200e55e5f62bfbe5250407d271d93709cc1c9 /src/lib/ecore_ipc
parentff3d2a68d5762ec6bed88f97f2a3751bb51caf86 (diff)
ecore_ipc: use the new eina_swap*().
Diffstat (limited to 'src/lib/ecore_ipc')
-rw-r--r--src/lib/ecore_ipc/Ecore_Ipc.h18
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c24
2 files changed, 14 insertions, 28 deletions
diff --git a/src/lib/ecore_ipc/Ecore_Ipc.h b/src/lib/ecore_ipc/Ecore_Ipc.h
index f77870f84d..4679b4a87b 100644
--- a/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -41,17 +41,17 @@ extern "C" {
41typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; /**< An IPC connection handle */ 41typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; /**< An IPC connection handle */
42typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; /**< An IPC connection handle */ 42typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; /**< An IPC connection handle */
43 43
44EAPI unsigned short _ecore_ipc_swap_16(unsigned short v); 44EAPI unsigned short _ecore_ipc_swap_16(unsigned short v) EINA_DEPRECATED;
45EAPI unsigned int _ecore_ipc_swap_32(unsigned int v); 45EAPI unsigned int _ecore_ipc_swap_32(unsigned int v) EINA_DEPRECATED;
46EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); 46EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v) EINA_DEPRECATED;
47 47
48#ifdef WORDS_BIGENDIAN 48#ifdef WORDS_BIGENDIAN
49#define ECORE_IPC_SWAP2NET64(x) _ecore_ipc_swap_64(x) 49#define ECORE_IPC_SWAP2NET64(x) eina_swap64(x)
50#define ECORE_IPC_SWAP2CPU64(x) _ecore_ipc_swap_64(x) 50#define ECORE_IPC_SWAP2CPU64(x) eina_swap64(x)
51#define ECORE_IPC_SWAP2NET32(x) _ecore_ipc_swap_32(x) 51#define ECORE_IPC_SWAP2NET32(x) eina_swap32(x)
52#define ECORE_IPC_SWAP2CPU32(x) _ecore_ipc_swap_32(x) 52#define ECORE_IPC_SWAP2CPU32(x) eina_swap32(x)
53#define ECORE_IPC_SWAP2NET16(x) _ecore_ipc_swap_16(x) 53#define ECORE_IPC_SWAP2NET16(x) eina_swap16(x)
54#define ECORE_IPC_SWAP2CPU16(x) _ecore_ipc_swap_16(x) 54#define ECORE_IPC_SWAP2CPU16(x) eina_swap16(x)
55#define ECORE_IPC_SWAP2NET8(x) (x) 55#define ECORE_IPC_SWAP2NET8(x) (x)
56#define ECORE_IPC_SWAP2CPU8(x) (x) 56#define ECORE_IPC_SWAP2CPU8(x) (x)
57#else 57#else
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 03be3cf38c..8b71783f5c 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -39,39 +39,25 @@
39 39
40int _ecore_ipc_log_dom = -1; 40int _ecore_ipc_log_dom = -1;
41 41
42/****** This swap function are around just for backward compatibility do not remove *******/
42EAPI unsigned short 43EAPI unsigned short
43_ecore_ipc_swap_16(unsigned short v) 44_ecore_ipc_swap_16(unsigned short v)
44{ 45{
45 unsigned char *s, t; 46 return eina_swap16(v);
46
47 s = (unsigned char *)(&v);
48 t = s[0]; s[0] = s[1]; s[1] = t;
49 return v;
50} 47}
51 48
52EAPI unsigned int 49EAPI unsigned int
53_ecore_ipc_swap_32(unsigned int v) 50_ecore_ipc_swap_32(unsigned int v)
54{ 51{
55 unsigned char *s, t; 52 return eina_swap32(v);
56
57 s = (unsigned char *)(&v);
58 t = s[0]; s[0] = s[3]; s[3] = t;
59 t = s[1]; s[1] = s[2]; s[2] = t;
60 return v;
61} 53}
62 54
63EAPI unsigned long long 55EAPI unsigned long long
64_ecore_ipc_swap_64(unsigned long long v) 56_ecore_ipc_swap_64(unsigned long long v)
65{ 57{
66 unsigned char *s, t; 58 return eina_swap64(v);
67
68 s = (unsigned char *)(&v);
69 t = s[0]; s[0] = s[7]; s[7] = t;
70 t = s[1]; s[1] = s[6]; s[6] = t;
71 t = s[2]; s[2] = s[5]; s[5] = t;
72 t = s[3]; s[3] = s[4]; s[4] = t;
73 return v;
74} 59}
60/***********************/
75 61
76static int _ecore_ipc_dlt_int(int out, int prev, int *mode); 62static int _ecore_ipc_dlt_int(int out, int prev, int *mode);
77static int _ecore_ipc_ddlt_int(int in, int prev, int mode); 63static int _ecore_ipc_ddlt_int(int in, int prev, int mode);