瀏覽代碼

* Cleanup uintX_t type usage

Bryan Drewery 14 年之前
父節點
當前提交
a2e0ce7a1d
共有 3 個文件被更改,包括 8 次插入22 次删除
  1. 4 4
      src/mod/transfer.mod/transfer.c
  2. 3 3
      src/mod/transfer.mod/transfer.h
  3. 1 15
      src/types.h

+ 4 - 4
src/mod/transfer.mod/transfer.c

@@ -226,13 +226,13 @@ static void eof_dcc_send(int idx)
 
 /* Determine byte order. Used for resend DCC startup packets.
  */
-static inline u_8bit_t byte_order_test(void)
+static inline uint8_t byte_order_test(void)
 {
-  u_16bit_t test = TRANSFER_REGET_PACKETID;
+  uint16_t test = TRANSFER_REGET_PACKETID;
 
-  if (*((u_8bit_t *)&test) == ((TRANSFER_REGET_PACKETID & 0xff00) >> 8))
+  if (*((uint8_t *)&test) == ((TRANSFER_REGET_PACKETID & 0xff00) >> 8))
     return 0;
-  if (*((u_8bit_t *)&test) == (TRANSFER_REGET_PACKETID & 0x00ff))
+  if (*((uint8_t *)&test) == (TRANSFER_REGET_PACKETID & 0x00ff))
     return 1;
   return 0;
 }

+ 3 - 3
src/mod/transfer.mod/transfer.h

@@ -36,11 +36,11 @@ int raw_dcc_send(char *, char *, char *, int *);
 #define TRANSFER_REGET_PACKETID 0xfeab
 
 typedef struct {
-  u_32bit_t byte_offset;	/* Number of bytes to skip relative to
+  uint32_t byte_offset;	/* Number of bytes to skip relative to
 				   the file beginning			*/
-  u_16bit_t packet_id;		/* Identification ID, should be equal
+  uint16_t packet_id;		/* Identification ID, should be equal
 	 			   to TRANSFER_REGET_PACKETID		*/
-  u_8bit_t  byte_order;		/* Byte ordering, see byte_order_test()	*/
+  uint8_t  byte_order;		/* Byte ordering, see byte_order_test()	*/
 } transfer_reget;
 #endif				/* MAKING_TRANSFER */
 

+ 1 - 15
src/types.h

@@ -20,21 +20,7 @@ typedef int (*Function) ();
 typedef int socklen_t;
 #endif
 
-/* 32 bit type */
-#if (SIZEOF_INT == 4)
-typedef unsigned int            u_32bit_t;
-#else
-#  if (SIZEOF_LONG == 4)
-typedef unsigned long           u_32bit_t;
-#  else
-#    include "cant/find/32bit/type"
-#  endif
-#endif
-
-typedef unsigned short int      u_16bit_t;
-typedef unsigned char           u_8bit_t;
-
-typedef u_32bit_t 		dword;
+typedef uint32_t 		dword;
 
 /* port */
 typedef in_port_t		port_t;