🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9752

Re: C structs & A question about octet

#9752
From: BEATTIE
Date: Wed, 05 Nov 1986 14:22
42 lines
2021 bytes
> OK, next question:  I want to define some types to hold bytes, words, and
> long words, where byte == 8 undsigned bits, word == 16 unsigned bits, and
> long words == 32 unsigned bits.  I want to give them nice names, names
> that imply the number of bits.  I could use u8, u16, and u32, but I
> don't *like* those names.  I thought I had a better plan:
> 	use octet for the byte
> 	use hexdectet for sixteen
> 	use <latin for two>, latin for 30> for 32
> but 32 turned out to be "duotrentet" or something and that's ugly.  So
> does anyone have any better names?  Something nice and intuitive and
> not ugly?  How about Greek?  How do they spell them?
> -- 
> Larry McVoy 	        mcvoy@rsch.wisc.edu, 
>      		        {seismo, topaz, harvard, ihnp4, etc}!uwvax!mcvoy
	
I use my own typedefs for portability.
I simply redefine the typedefs to get the required length and
characteristics.
For example SINT32 is a Signed 32 bit Integer anywhere I go and
P - Positive, U - Unsigned
They are nice and intuitive and not very ugly :-)
My typedefs for the VAX are:
typedef	long		PINT32;
typedef	long		SINT32;
typedef	unsigned long	UINT32;
typedef	long		BIT32;

typedef	short		PINT16;
typedef	short		SINT16;
typedef	unsigned short	UINT16;
typedef	short		BIT16;

typedef	char		PINT8;
typedef	char		SINT8;
typedef	unsigned char	UINT8;
typedef	char		BIT8;

---
Tom.
T.W. Beattie
...!{ihnp4 | houxm | whuxl | ulysses}!hoqax!twb
...!{decvax | ucbvax}!ihnp4!hoqax!twb
Technical Details
Message-ID: <287@hoqax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!rutgers!clyde!cbatt!ihnp4!houxm!hoqam!hoqax!twb
References: <2904@rsch.WISC.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!rutgers!clyde!cbatt!ihnp4!houxm!hoqam!hoqax!twb
From: twb@hoqax.UUCP (BEATTIE)
Newsgroups: net.lang.c
Subject: Re: C structs & A question about octet
Message-ID: <287@hoqax.UUCP>
Date: Wed, 5-Nov-86 09:22:14 EST
Article-I.D.: hoqax.287
Posted: Wed Nov  5 09:22:14 1986
Date-Received: Sat, 8-Nov-86 00:07:43 EST
References: <2904@rsch.WISC.EDU>
Distribution: net
Organization: AT&T Bell Laboratories, Holmdel
Lines: 42