From 03dbb73eec19f2a8874cd9aab327ed6bc6f97867 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 15 Oct 2023 19:28:42 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4758 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- urt/vaxshort.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'urt/vaxshort.c') 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; } -- cgit 1.4.1