From 8865c1ea8fa87353051f5ae47bc1208bd5c84e73 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 25 Sep 2003 13:28:07 +0000 Subject: [PATCH] * Replaced short with int16_t where necessary. git-svn-id: svn://svn.zoy.org/elk/trunk@189 55e467fa-43c5-0310-a8a2-de718669efc6 --- include/object.h | 2 +- lib/xlib/property.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/object.h b/include/object.h index a26eda0..9dbb173 100644 --- a/include/object.h +++ b/include/object.h @@ -256,7 +256,7 @@ struct S_Promise { struct S_Port { Object name; /* string */ - short flags; + uint16_t flags; char unread; unsigned int ptr; FILE *file; diff --git a/lib/xlib/property.c b/lib/xlib/property.c index fe9b06f..85f20aa 100644 --- a/lib/xlib/property.c +++ b/lib/xlib/property.c @@ -144,13 +144,11 @@ static Object P_Get_Property (Object w, Object prop, Object type, Object start, } else { Object v; GC_Node; - /* Assumes short is 16 bits and int is 32 bits. - */ v = Make_Vector ((int)nitems, Null); GC_Link (v); for (i = 0; i < nitems; i++) { x = Make_Unsigned (format == 16 ? - *((short *)data + i) : *((int *)data + i)); + *((int16_t *)data + i) : *((int32_t *)data + i)); VECTOR(v)->data[i] = x; } Car (t) = v; @@ -189,8 +187,8 @@ static Object P_Change_Property (Object w, Object prop, Object type, if (f == 16) { if (x > 65535) Primitive_Error ("format mismatch"); - *((short *)buf + i) = x; /* Assumes short is 16 bits */ - } else *((int *)buf + i) = x; /* and int is 32 bits. */ + *((int16_t *)buf + i) = x; + } else *((int32_t *)buf + i) = x; } break; default: