diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-15 19:28:42 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-15 19:28:42 +0000 |
commit | 03dbb73eec19f2a8874cd9aab327ed6bc6f97867 (patch) | |
tree | e9df05c93d42ef8eeab518452b8d21ace51fc834 /urt/vaxshort.c | |
parent | 13894c659cc013427ddafa483768472fbcc76623 (diff) | |
download | netpbm-mirror-03dbb73eec19f2a8874cd9aab327ed6bc6f97867.tar.gz netpbm-mirror-03dbb73eec19f2a8874cd9aab327ed6bc6f97867.tar.xz netpbm-mirror-03dbb73eec19f2a8874cd9aab327ed6bc6f97867.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4758 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'urt/vaxshort.c')
-rw-r--r-- | urt/vaxshort.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/urt/vaxshort.c b/urt/vaxshort.c index 182083ca..b9c8e1ce 100644 --- a/urt/vaxshort.c +++ b/urt/vaxshort.c @@ -27,14 +27,13 @@ * stored in VAX order, regardless of word alignment. */ int -vax_gshort(char *msgp) -{ - unsigned char *p = (unsigned char *) msgp; - int i; - - if( (i = (p[1] << 8) | p[0]) & 0x8000 ) - return(i | ~0xFFFF); /* Sign extend */ - return(i); +vax_gshort(unsigned char * const msgp) { + + int i; + + if ((i = (msgp[1] << 8) | msgp[0]) & 0x8000) + return i | ~0xFFFF; /* Sign extend */ + return(i); } @@ -42,13 +41,14 @@ vax_gshort(char *msgp) /* * V A X _ P S H O R T */ -char * -vax_pshort(char *msgp, unsigned short s) -{ +unsigned char * +vax_pshort(unsigned char * const msgp, + unsigned short const s) { + + msgp[0] = s & 0xFF; + msgp[1] = s >> 8; - msgp[0] = s & 0xFF; - msgp[1] = s >> 8; - return(msgp+2); + return msgp + 2; } |