diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
commit | 23ce26f64c34e30951ad9ade2151552ed77e7357 (patch) | |
tree | d73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /urt/vaxshort.c | |
parent | 1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff) | |
download | netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip |
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'urt/vaxshort.c')
-rw-r--r-- | urt/vaxshort.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/urt/vaxshort.c b/urt/vaxshort.c index 4b57b516..c39e78ec 100644 --- a/urt/vaxshort.c +++ b/urt/vaxshort.c @@ -1,5 +1,5 @@ /* - * V A X S H O R T + * V A X S H O R T * * Code to manipulate 16-bit integers in VAX order in a * machine independent manner. @@ -7,21 +7,21 @@ * (VAX is a trademark of Digital Equipment Corporation) * * Author - - * Michael John Muuss - * + * Michael John Muuss + * * Source - - * SECAD/VLD Computing Consortium, Bldg 394 - * The U. S. Army Ballistic Research Laboratory - * Aberdeen Proving Ground, Maryland 21005-5066 - * + * SECAD/VLD Computing Consortium, Bldg 394 + * The U. S. Army Ballistic Research Laboratory + * Aberdeen Proving Ground, Maryland 21005-5066 + * * Distribution Status - - * Public Domain, Distribution Unlimitied. + * Public Domain, Distribution Unlimited. */ #include "vaxshort.h" /* - * V A X _ G S H O R T + * V A X _ G S H O R T * * Obtain a 16-bit signed integer from two adjacent characters, * stored in VAX order, regardless of word alignment. @@ -29,22 +29,25 @@ int vax_gshort(char *msgp) { - register unsigned char *p = (unsigned char *) msgp; - register int i; + unsigned char *p = (unsigned char *) msgp; + int i; - if( (i = (p[1] << 8) | p[0]) & 0x8000 ) - return(i | ~0xFFFF); /* Sign extend */ - return(i); + if( (i = (p[1] << 8) | p[0]) & 0x8000 ) + return(i | ~0xFFFF); /* Sign extend */ + return(i); } /* - * V A X _ P S H O R T + * V A X _ P S H O R T */ char * vax_pshort(char *msgp, unsigned short s) { - msgp[0] = s & 0xFF; - msgp[1] = s >> 8; - return(msgp+2); + msgp[0] = s & 0xFF; + msgp[1] = s >> 8; + return(msgp+2); } + + + |