Tidy use of sized datatypes. Check for invalid asumption of interchangability

of int/long in encoder/decoder methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22291 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2006-01-11 08:37:16 +00:00
parent fd8bfa11d5
commit 15a2e17e48
19 changed files with 283 additions and 285 deletions

View file

@ -192,14 +192,14 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
}
if (*ptr == '\0' && val <= 0xffff)
{
gsu16 v = val;
uint16_t v = val;
sin->sin_port = GSSwapHostI16ToBig(v);
return YES;
}
else if (strcmp(ptr, "gdomap") == 0)
{
gsu16 v;
uint16_t v;
#ifdef GDOMAP_PORT_OVERRIDE
v = GDOMAP_PORT_OVERRIDE;
#else

View file

@ -79,8 +79,8 @@ typedef enum {
* Its contents are transmitted in network byte order.
*/
typedef struct {
gsu32 type; /* A GSPortItemType as a 4-byte number. */
gsu32 length; /* The length of the item (excluding header). */
uint32_t type; /* A GSPortItemType as a 4-byte number. */
uint32_t length; /* The length of the item (excluding header). */
} GSPortItemHeader;
/*
@ -90,8 +90,8 @@ typedef struct {
* NB. additional data counts as part of the same item.
*/
typedef struct {
gsu32 mId; /* The ID for the message starting with this. */
gsu32 nItems; /* Number of items (including this one). */
uint32_t mId; /* The ID for the message starting with this. */
uint32_t nItems; /* Number of items (including this one). */
unsigned char version;
unsigned char port[16];
} GSPortMsgHeader;
@ -135,10 +135,6 @@ static NSRecursiveLock *messagePortLock = nil;
static NSMapTable *ports = 0;
static Class messagePortClass = 0;
#if NEED_WORD_ALIGNMENT
static unsigned wordAlign;
#endif
- (BOOL) _setupSendPort
{
internal *this = (internal*)self->_internal;
@ -183,9 +179,6 @@ static unsigned wordAlign;
{
if (self == [NSMessagePort class])
{
#if NEED_WORD_ALIGNMENT
wordAlign = objc_alignof_type(@encode(gsu32));
#endif
messagePortClass = self;
ports = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks,
NSNonOwnedPointerMapValueCallBacks, 0);