Updated stdint.h and stdbool.h which are used with compilers that are pre-C99 standard (i.e. borland). This also cleaned up warnings when built with codeblocks using MinGW.
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ int bip_send_pdu(BACNET_ADDRESS * dest, /* destination address */
|
||||
} else if (dest->mac_len == 6) {
|
||||
/* valid unicast */
|
||||
(void) decode_unsigned32(&dest->mac[0],
|
||||
&(bip_dest.sin_addr.s_addr));
|
||||
(uint32_t *)&(bip_dest.sin_addr.s_addr));
|
||||
(void) decode_unsigned16(&dest->mac[4], &(bip_dest.sin_port));
|
||||
memset(&(bip_dest.sin_zero), '\0', 8);
|
||||
mtu[1] = BVLC_ORIGINAL_UNICAST_NPDU;
|
||||
|
||||
@@ -71,7 +71,6 @@ static void set_broadcast_address(uint32_t net_address)
|
||||
bip_set_broadcast_addr(INADDR_BROADCAST);
|
||||
#else
|
||||
long broadcast_address = 0;
|
||||
long mask = 0;
|
||||
|
||||
if (IN_CLASSA(ntohl(net_address)))
|
||||
broadcast_address =
|
||||
|
||||
@@ -1,28 +1,17 @@
|
||||
#ifndef STDBOOL_H
|
||||
#define STDBOOL_H
|
||||
#ifndef _STDBOOL_H
|
||||
#define _STDBOOL_H
|
||||
|
||||
/* C99 Boolean types for compilers without C99 support */
|
||||
/* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef int _Bool;
|
||||
#ifndef bool
|
||||
#if !defined(__cplusplus)
|
||||
|
||||
/*typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;*/
|
||||
#define bool _Bool
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true 1
|
||||
#endif
|
||||
#ifndef false
|
||||
#define false 0
|
||||
#endif
|
||||
#define __bool_true_false_are_defined 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* Defines the standard integer types that are used in code */
|
||||
/* for the x86 processor and Borland Compiler */
|
||||
|
||||
#ifndef STDINT_H
|
||||
#define STDINT_H
|
||||
#ifndef _STDINT_H
|
||||
#define _STDINT_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -11,9 +11,21 @@ typedef signed char int8_t; /* 1 byte -127 to 127 */
|
||||
typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */
|
||||
typedef signed short int16_t; /* 2 bytes -32767 to 32767 */
|
||||
/*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */
|
||||
typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */
|
||||
typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */
|
||||
typedef unsigned uint32_t; /* 4 bytes 0 to 4294967295 */
|
||||
typedef int int32_t; /* 4 bytes -2147483647 to 2147483647 */
|
||||
/* typedef signed long long int64_t; */
|
||||
/* typedef unsigned long long uint64_t; */
|
||||
|
||||
#define INT8_MIN (-128)
|
||||
#define INT16_MIN (-32768)
|
||||
#define INT32_MIN (-2147483647 - 1)
|
||||
|
||||
#define INT8_MAX 127
|
||||
#define INT16_MAX 32767
|
||||
#define INT32_MAX 2147483647
|
||||
|
||||
#define UINT8_MAX 0xff /* 255U */
|
||||
#define UINT16_MAX 0xffff /* 65535U */
|
||||
#define UINT32_MAX 0xffffffff /* 4294967295U */
|
||||
|
||||
#endif /* STDINT_H */
|
||||
|
||||
Reference in New Issue
Block a user