diff options
| author | Filippos Karapetis | 2018-12-28 13:38:48 +0200 | 
|---|---|---|
| committer | Filippos Karapetis | 2018-12-28 13:41:39 +0200 | 
| commit | d42cbfde9e1b188222e15bb41801f16ac99515ce (patch) | |
| tree | 9f68535ed4d4a5da0cc63a52f3358221a6a93a01 /engines | |
| parent | 1c055f686e94c1676b8617cc21e0221c0d97dad9 (diff) | |
| download | scummvm-rg350-d42cbfde9e1b188222e15bb41801f16ac99515ce.tar.gz scummvm-rg350-d42cbfde9e1b188222e15bb41801f16ac99515ce.tar.bz2 scummvm-rg350-d42cbfde9e1b188222e15bb41801f16ac99515ce.zip  | |
GLK: ALAN2: Adapt C-style enums and align comments
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/glk/alan2/acode.h | 152 | 
1 files changed, 76 insertions, 76 deletions
diff --git a/engines/glk/alan2/acode.h b/engines/glk/alan2/acode.h index 764eb1967b..5b5a5be990 100644 --- a/engines/glk/alan2/acode.h +++ b/engines/glk/alan2/acode.h @@ -28,12 +28,12 @@  namespace Glk {  namespace Alan2 { -typedef size_t Aptr;			// Type for an ACODE memory address -typedef uint32 Aword;		   // Type for an ACODE word -typedef uint32 Aaddr;		   // Type for an ACODE address -typedef uint32 Abool;		   // Type for an ACODE Boolean value -typedef int32 Aint;			 // Type for an ACODE Integer value -typedef int CodeValue;		  // Definition for the packing process +typedef size_t Aptr;				// Type for an ACODE memory address +typedef uint32 Aword;				// Type for an ACODE word +typedef uint32 Aaddr;				// Type for an ACODE address +typedef uint32 Abool;				// Type for an ACODE Boolean value +typedef int32 Aint;					// Type for an ACODE Integer value +typedef int CodeValue;				// Definition for the packing process  // Constants for the Acode file, words/block & bytes/block  #define BLOCKLEN 256L @@ -47,9 +47,9 @@ typedef int CodeValue;		  // Definition for the packing process  #define TOPVALUE (((CodeValue)1<<VALUEBITS) - 1) // Highest value possible   // Half and quarter points in the code value range  -#define ONEQUARTER (TOPVALUE/4+1)	// Point after first quarter  -#define HALF (2*ONEQUARTER)		// Point after first half  -#define THREEQUARTER (3*ONEQUARTER)	// Point after third quarter  +#define ONEQUARTER (TOPVALUE / 4 + 1)			// Point after first quarter  +#define HALF (2 * ONEQUARTER)					// Point after first half  +#define THREEQUARTER (3 * ONEQUARTER)			// Point after third quarter   // AMACHINE Word Classes  @@ -62,10 +62,10 @@ typedef int WrdKind;  #define  WRD_PREP 5		// 32 - Preposition   #define  WRD_DIR 6		// 64 - Direction   #define  WRD_IT 7		// 128 - It  -#define  WRD_NOISE 8		// 256 - Noise word  +#define  WRD_NOISE 8	// 256 - Noise word   #define  WRD_NOUN 9		// 512 - Noun   #define  WRD_ACT 10		// 1024 - Actor  -#define  WRD_THEM 11		// 2048 - Them  +#define  WRD_THEM 11	// 2048 - Them   #define  WRD_VRB 12		// 4096 - Verb   #define  WRD_CLASSES 13 @@ -80,40 +80,40 @@ typedef int WrdKind;  // Parameter Classes  -typedef enum ClaKind {		// NOTE! These must have the same order as  -	CLA_OBJ = 1,			// the name classes in NAM.H  -	CLA_CNT = (int)CLA_OBJ<<1, -	CLA_ACT = (int)CLA_CNT<<1, -	CLA_NUM = (int)CLA_ACT<<1, -	CLA_STR = (int)CLA_NUM<<1, -	CLA_COBJ = (int)CLA_STR<<1, -	CLA_CACT = (int)CLA_COBJ<<1 -} ClaKind; +enum ClaKind {					// NOTE! These must have the same order as  +	CLA_OBJ = 1 << 0,			// the name classes in NAM.H  +	CLA_CNT = 1 << 1, +	CLA_ACT = 1 << 2, +	CLA_NUM = 1 << 3, +	CLA_STR = 1 << 4, +	CLA_COBJ = 1 << 5, +	CLA_CACT = 1 << 6 +};  // Verb Qualifiers  -typedef enum QualClass { +enum QualClass {  	Q_DEFAULT,  	Q_AFTER,  	Q_BEFORE,  	Q_ONLY -} QualClass; +};  // The AMACHINE Operations  -typedef enum OpClass { +enum OpClass {  	C_CONST,  	C_STMOP,  	C_CURVAR -} OpClass; +}; -typedef enum InstClass { +enum InstClass {  	I_PRINT,			// Print a string from the text file   	I_QUIT,  	I_LOOK,  	I_SAVE,  	I_RESTORE, -	I_LIST,			// List contents of a container  +	I_LIST,				// List contents of a container   	I_EMPTY,  	I_SCORE,  	I_VISITS, @@ -121,16 +121,16 @@ typedef enum InstClass {  	I_CANCEL,  	I_LOCATE,  	I_MAKE, -	I_SET,			// Set a numeric attribute to the  -				// value on top of stack  +	I_SET,				// Set a numeric attribute to the  +						// value on top of stack   	I_STRSET,			// Set a string valued attribute to a  -				// copy of the string on top of stack,  -				// deallocate current contents first  +						// copy of the string on top of stack,  +						// deallocate current contents first   	I_GETSTR,			// Get a string contents from text  -				// file, create a copy and push it  -				// on top of stack  -	I_INCR,			// Increment an attribute  -	I_DECR,			// Decrement a numeric attribute  +						// file, create a copy and push it  +						// on top of stack  +	I_INCR,				// Increment an attribute  +	I_DECR,				// Decrement a numeric attribute   	I_USE,  	I_IN,  	I_DESCRIBE, @@ -162,60 +162,60 @@ typedef enum InstClass {  	I_NOT,  	I_UMINUS,  	I_RND, -	I_SUM,			// SUM-aggregate  -	I_MAX,			// MAX-aggregate  +	I_SUM,				// SUM-aggregate  +	I_MAX,				// MAX-aggregate   	I_COUNT,			// COUNT-aggregate   	I_RETURN,  	I_SYSTEM,  	I_RESTART,			// INTRODUCED: v2.7  -	I_BTW,			// INTRODUCED: v2.8  +	I_BTW,				// INTRODUCED: v2.8   	I_CONTAINS,			//  -""-    	I_DEPSTART,			//  -""-    	I_DEPCASE,			//  -""-    	I_DEPEXEC,			//  -""-    	I_DEPELSE,			//  -""-    	I_DEPEND			//  -""-   -} InstClass; +}; -typedef enum VarClass { +enum VarClass {  	V_PARAM,  	V_CURLOC,  	V_CURACT,  	V_CURVRB,  	V_SCORE -} VarClass; +};  #define I_CLASS(x) ((x)>>28)  #define I_OP(x)	((x&0x8000000)?(x)|0x0f0000000:(x)&0x0fffffff) -typedef struct AcdHdr { +struct AcdHdr {  // Important info  -	char vers[4];			// 01 - Version of compiler  -	Aword size;			// 02 - Size of ACD-file in Awords  +	char vers[4];				// 01 - Version of compiler  +	Aword size;					// 02 - Size of ACD-file in Awords   // Options  -	Abool pack;			// 03 - Is the text packed ?  -	Aword paglen;			// 04 - Length of a page  -	Aword pagwidth;		// 05 - and width  -	Aword debug;			// 06 - Option debug  +	Abool pack;					// 03 - Is the text packed ?  +	Aword paglen;				// 04 - Length of a page  +	Aword pagwidth;				// 05 - and width  +	Aword debug;				// 06 - Option debug   // Data structures  -	Aaddr dict;			// 07 - Dictionary  -	Aaddr oatrs;			// 08 - Object default attributes  -	Aaddr latrs;			// 09 - Location default attributes  -	Aaddr aatrs;			// 0a - Actor default attributes  -	Aaddr acts;			// 0b - Actor table  -	Aaddr objs;			// 0c - Object table  -	Aaddr locs;			// 0d - Location table  -	Aaddr stxs;			// 0e - Syntax table  -	Aaddr vrbs;			// 0f - Verb table  -	Aaddr evts;			// 10 - Event table  -	Aaddr cnts;			// 11 - Container table  -	Aaddr ruls;			// 12 - Rule table  -	Aaddr init;			// 13 - String init table  -	Aaddr start;			// 14 - Start code  -	Aword msgs;			// 15 - Messages table  +	Aaddr dict;					// 07 - Dictionary  +	Aaddr oatrs;				// 08 - Object default attributes  +	Aaddr latrs;				// 09 - Location default attributes  +	Aaddr aatrs;				// 0a - Actor default attributes  +	Aaddr acts;					// 0b - Actor table  +	Aaddr objs;					// 0c - Object table  +	Aaddr locs;					// 0d - Location table  +	Aaddr stxs;					// 0e - Syntax table  +	Aaddr vrbs;					// 0f - Verb table  +	Aaddr evts;					// 10 - Event table  +	Aaddr cnts;					// 11 - Container table  +	Aaddr ruls;					// 12 - Rule table  +	Aaddr init;					// 13 - String init table  +	Aaddr start;				// 14 - Start code  +	Aword msgs;					// 15 - Messages table   // Miscellaneous   	Aword objmin, objmax;		// 16 - Interval for object codes   	Aword actmin, actmax;		// 18 - Interval for actor codes  @@ -224,16 +224,16 @@ typedef struct AcdHdr {  	Aword dirmin, dirmax;		// 1e - Interval for direction codes   	Aword evtmin, evtmax;		// 20 - Interval for event codes   	Aword rulmin, rulmax;		// 22 - Interval for rule codes  -	Aword maxscore;		// 24 - Maximum score  -	Aaddr scores;			// 25 - Score table  -	Aaddr freq;			// 26 - Address to Char freq's for coding  -	Aword acdcrc;			// 27 - Checksum for acd code (excl. hdr)  -	Aword txtcrc;			// 28 - Checksum for text data file  -} AcdHdr; +	Aword maxscore;				// 24 - Maximum score  +	Aaddr scores;				// 25 - Score table  +	Aaddr freq;					// 26 - Address to Char freq's for coding  +	Aword acdcrc;				// 27 - Checksum for acd code (excl. hdr)  +	Aword txtcrc;				// 28 - Checksum for text data file  +};  // Error message numbers  -typedef enum MsgKind { -	M_HUH,			// Obsolete  +enum MsgKind { +	M_HUH,						// Obsolete   	M_WHAT,  	M_WHAT_ALL,  	M_WHAT_IT, @@ -249,7 +249,7 @@ typedef enum MsgKind {  	M_NO_WAY,  	M_CANT0,  	M_CANT, -	M_NOTHING,			// Obsolete  +	M_NOTHING,					// Obsolete   	M_SEEOBJ1,  	M_SEEOBJ2,  	M_SEEOBJ3, @@ -274,16 +274,16 @@ typedef enum MsgKind {  	M_SAVEVERS,  	M_SAVENAME,  	M_RESTOREFROM, -	M_REALLY,			// CHANGED: v2.7 from M_RESTART  -	M_QUITACTION,			// INTRODUCED: v2.7, so M_ARTICLE moved  -	M_ARTICLE,			// INTRODUCED: v2.6 but replaced the M_NOMSG +	M_REALLY,					// CHANGED: v2.7 from M_RESTART  +	M_QUITACTION,				// INTRODUCED: v2.7, so M_ARTICLE moved  +	M_ARTICLE,					// INTRODUCED: v2.6 but replaced the M_NOMSG  	MSGMAX -} MsgKind; +};  #define M_ARTICLE26 M_QUITACTION  #define M_MSGMAX26 M_ARTICLE  } // End of namespace Alan2 -} // Engine of namespace GLK +} // End of namespace Glk  #endif  | 
