forked from enlightenment/efl
ecore_ipc: use the new eina_swap*().
This commit is contained in:
parent
ff3d2a68d5
commit
672bd97cea
|
@ -41,17 +41,17 @@ extern "C" {
|
|||
typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; /**< An IPC connection handle */
|
||||
typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; /**< An IPC connection handle */
|
||||
|
||||
EAPI unsigned short _ecore_ipc_swap_16(unsigned short v);
|
||||
EAPI unsigned int _ecore_ipc_swap_32(unsigned int v);
|
||||
EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v);
|
||||
EAPI unsigned short _ecore_ipc_swap_16(unsigned short v) EINA_DEPRECATED;
|
||||
EAPI unsigned int _ecore_ipc_swap_32(unsigned int v) EINA_DEPRECATED;
|
||||
EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v) EINA_DEPRECATED;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define ECORE_IPC_SWAP2NET64(x) _ecore_ipc_swap_64(x)
|
||||
#define ECORE_IPC_SWAP2CPU64(x) _ecore_ipc_swap_64(x)
|
||||
#define ECORE_IPC_SWAP2NET32(x) _ecore_ipc_swap_32(x)
|
||||
#define ECORE_IPC_SWAP2CPU32(x) _ecore_ipc_swap_32(x)
|
||||
#define ECORE_IPC_SWAP2NET16(x) _ecore_ipc_swap_16(x)
|
||||
#define ECORE_IPC_SWAP2CPU16(x) _ecore_ipc_swap_16(x)
|
||||
#define ECORE_IPC_SWAP2NET64(x) eina_swap64(x)
|
||||
#define ECORE_IPC_SWAP2CPU64(x) eina_swap64(x)
|
||||
#define ECORE_IPC_SWAP2NET32(x) eina_swap32(x)
|
||||
#define ECORE_IPC_SWAP2CPU32(x) eina_swap32(x)
|
||||
#define ECORE_IPC_SWAP2NET16(x) eina_swap16(x)
|
||||
#define ECORE_IPC_SWAP2CPU16(x) eina_swap16(x)
|
||||
#define ECORE_IPC_SWAP2NET8(x) (x)
|
||||
#define ECORE_IPC_SWAP2CPU8(x) (x)
|
||||
#else
|
||||
|
|
|
@ -39,39 +39,25 @@
|
|||
|
||||
int _ecore_ipc_log_dom = -1;
|
||||
|
||||
/****** This swap function are around just for backward compatibility do not remove *******/
|
||||
EAPI unsigned short
|
||||
_ecore_ipc_swap_16(unsigned short v)
|
||||
{
|
||||
unsigned char *s, t;
|
||||
|
||||
s = (unsigned char *)(&v);
|
||||
t = s[0]; s[0] = s[1]; s[1] = t;
|
||||
return v;
|
||||
return eina_swap16(v);
|
||||
}
|
||||
|
||||
EAPI unsigned int
|
||||
_ecore_ipc_swap_32(unsigned int v)
|
||||
{
|
||||
unsigned char *s, t;
|
||||
|
||||
s = (unsigned char *)(&v);
|
||||
t = s[0]; s[0] = s[3]; s[3] = t;
|
||||
t = s[1]; s[1] = s[2]; s[2] = t;
|
||||
return v;
|
||||
return eina_swap32(v);
|
||||
}
|
||||
|
||||
EAPI unsigned long long
|
||||
_ecore_ipc_swap_64(unsigned long long v)
|
||||
{
|
||||
unsigned char *s, t;
|
||||
|
||||
s = (unsigned char *)(&v);
|
||||
t = s[0]; s[0] = s[7]; s[7] = t;
|
||||
t = s[1]; s[1] = s[6]; s[6] = t;
|
||||
t = s[2]; s[2] = s[5]; s[5] = t;
|
||||
t = s[3]; s[3] = s[4]; s[4] = t;
|
||||
return v;
|
||||
return eina_swap64(v);
|
||||
}
|
||||
/***********************/
|
||||
|
||||
static int _ecore_ipc_dlt_int(int out, int prev, int *mode);
|
||||
static int _ecore_ipc_ddlt_int(int in, int prev, int mode);
|
||||
|
|
Loading…
Reference in New Issue