* int32_t, uint32_t are now of type "int", and no longer of type "long".

This should help to reduce the number of warnings imported code will throw
  during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
  that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-10-21 20:10:43 +00:00
parent 3dfa121266
commit 15ab0bcf01
22 changed files with 169 additions and 117 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ typedef uint32_t in_addr_t;
* and we are not allowed to import all the BeOS types here.
*/
#ifndef htonl
extern uint32_t __swap_int32(uint32_t); /* private */
// extern uint32_t __swap_int32(uint32_t); /* private */
extern unsigned long __swap_int32(unsigned long); /* private */
extern uint16_t __swap_int16(uint16_t); /* private */
#if BYTE_ORDER == LITTLE_ENDIAN
#define htonl(x) __swap_int32(x)
+6 -5
View File
@@ -1,6 +1,7 @@
/*
** Distributed under the terms of the Haiku License.
*/
/*
* Copyright 2003-2007, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _STDINT_H_
#define _STDINT_H_
@@ -27,8 +28,8 @@ typedef unsigned short uint16_t;
#define INT32_MIN (-INT32_MAX-1)
#define UINT32_MAX (4294967295UL)
typedef signed long int32_t;
typedef unsigned long uint32_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
#define INT64_MAX (9223372036854775807LL)
#define INT64_MIN (-INT64_MAX-1)
+5 -6
View File
@@ -83,13 +83,12 @@ struct sockaddr {
uint8_t sa_data[30];
};
/* this can hold ANY sockaddr we care to throw at it! */
struct sockaddr_storage {
uint8_t ss_len; /* total length */
uint8_t ss_family; /* address family */
uint8_t __ss_pad1[6]; /* align to quad */
uint64_t __ss_pad2; /* force alignment for stupid compilers */
uint8_t __ss_pad3[112]; /* pad to a total of 128 bytes */
uint8_t ss_len; /* total length */
uint8_t ss_family; /* address family */
uint8_t __ss_pad1[6]; /* align to quad */
uint64_t __ss_pad2; /* force alignment to 64 bit */
uint8_t __ss_pad3[112]; /* pad to a total of 128 bytes */
};
struct msghdr {