diff --git a/common.h b/common.h index e35c247..3024e08 100755 --- a/common.h +++ b/common.h @@ -44,7 +44,7 @@ extern "C" { #include #include #include /* get local ip */ -#include /* get local ip */ +#include /* get local ip */ #include #include //#include "../../uClibc-0.9.28/_install/usr/arm-linux-uclibc/usr/include/linux/filter.h" @@ -57,7 +57,6 @@ extern "C" { //#include "/uClibc-0.9.28/include/pthread.h" #include -typedef unsigned char BOOL; typedef short STATUS; typedef int (*FUNCPTR)(void); //return int typedef unsigned char (*U8FUNCPTR)(void); //return U8 @@ -112,7 +111,7 @@ typedef int tIPC_ID; typedef enum { FALSE, TRUE -} L7_BOOL; +}tBOOL; // abi, modified, 20070412 //typedef unsigned long U64; /* = ULONG in VxWorks */ diff --git a/ip_codec.h b/ip_codec.h index 9a98622..854d2cc 100755 --- a/ip_codec.h +++ b/ip_codec.h @@ -42,7 +42,7 @@ #define ICMP_UNREACHABLE 0x3 #define ICMP_ECHO_REQUEST 0x8 -enum { +typedef enum { ICMP_NETWORK_UNREACHABLE = 0, ICMP_HOST_UNREACHABLE = 1, ICMP_PROTOCOL_UNREACHABLE = 2, diff --git a/ipc.c b/ipc.c index c3326e5..b89e9a1 100755 --- a/ipc.c +++ b/ipc.c @@ -24,7 +24,7 @@ void house_keep(); void PRINT_IPC_TBL(tIPC_TBL *ipc_tbl); tIPC_ID ipc_tbl_msgid=-1; -BOOL alarm_flag; +tBOOL alarm_flag; /*----------------------------------------- * hk_exit : diff --git a/ipc.h b/ipc.h index a378601..93d438f 100755 --- a/ipc.h +++ b/ipc.h @@ -21,7 +21,7 @@ extern "C" { /* in .cpp file, only this line is enough */ #define IPC_DEF_QID 0 -enum { +typedef enum { IPC_EV_TYPE_DEF, IPC_EV_TYPE_WEB, IPC_EV_TYPE_CLI, @@ -38,7 +38,7 @@ typedef struct { key_t key; char name[80]; int type; - BOOL valid; + tBOOL valid; } tIPC_TBL; typedef struct { diff --git a/os_timer.c b/os_timer.c index 7db6261..92fcebd 100755 --- a/os_timer.c +++ b/os_timer.c @@ -582,7 +582,7 @@ void OSTMR_StopXtmr(void *ccb, U16 event) * event - timeout event * return : TRUE/FALSE **********************************************************************/ -BOOL OSTMR_IsTmrListEmpty() +tBOOL OSTMR_IsTmrListEmpty() { if (tmrObj.shm->tmrHdr == NULL) return TRUE; @@ -598,7 +598,7 @@ BOOL OSTMR_IsTmrListEmpty() * event - timeout event * return : TRUE/FALSE **********************************************************************/ -BOOL OSTMR_IsTmrExist(void *ccb, U16 event) +tBOOL OSTMR_IsTmrExist(void *ccb, U16 event) { pTMR_CB cur; diff --git a/os_timer.h b/os_timer.h index 027881d..611877a 100755 --- a/os_timer.h +++ b/os_timer.h @@ -23,7 +23,7 @@ struct _TMR_CB { void *ccb; tIPC_ID Que; /* It is a pointer */ pTMR_CB next; - BOOL idle; + tBOOL idle; }; typedef struct _TMR_CBs tTMR_CBs; @@ -70,7 +70,7 @@ extern void OSTMR_FreeTmrCb(pTMR_CB p); extern void OSTMR_StartTmr(tIPC_ID Que, void *ccb, U32 delay, char *name, U16 event); extern void OSTMR_StopTmrs(void *ccb); extern void OSTMR_StopXtmr(void *ccb, U16 event); -extern BOOL OSTMR_IsTmrListEmpty(void); -extern BOOL OSTMR_IsTmrExist(void *ccb, U16 event); +extern tBOOL OSTMR_IsTmrListEmpty(void); +extern tBOOL OSTMR_IsTmrExist(void *ccb, U16 event); #endif /* _OS_TIMER_H_ */ diff --git a/util.c b/util.c index 5fe5777..ee09ba7 100755 --- a/util.c +++ b/util.c @@ -300,7 +300,7 @@ int get_local_mac(U8 *mac, char *sif) return -1; } - strncpy(sifreq.ifr_name, sif, IF_NAMESIZE-1); + strncpy(sifreq.ifr_name, sif, IFNAMSIZ-1); if (ioctl(fd, SIOCGIFHWADDR, &sifreq) != 0){ printf("error! ioctl failed when getting mac\n"); close(fd); @@ -330,7 +330,7 @@ int get_local_ip(U8 *ip_str, char *sif) return -1; } - strncpy(ifr.ifr_name, sif, IF_NAMESIZE-1); + strncpy(ifr.ifr_name, sif, IFNAMSIZ-1); if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) { perror("ioctl SIOCGIFADDR error"); return -1; @@ -366,7 +366,7 @@ int set_local_ip(char *ip_str, char *sif) bzero(&mask,sizeof(mask)); //sprintf(ifr.ifr_name, sif); - strncpy(ifr.ifr_name, sif, IF_NAMESIZE-1); + strncpy(ifr.ifr_name, sif, IFNAMSIZ-1); addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(ip_str); //printf("addr.sin_addr.s_addr=%x\n",addr.sin_addr.s_addr);