diff options
author | Strangerke | 2011-06-13 11:57:24 +0200 |
---|---|---|
committer | Strangerke | 2011-06-13 11:57:24 +0200 |
commit | ffc2aa4e4f41aa679d773ccafdec87bf8d7b5e85 (patch) | |
tree | ee004f6dde791239db37225c1f53057ab39bae8c /engines/cge/btfile.h | |
parent | ccd934e4bfaa2997bf2dcec6818e0c418a11624f (diff) | |
download | scummvm-rg350-ffc2aa4e4f41aa679d773ccafdec87bf8d7b5e85.tar.gz scummvm-rg350-ffc2aa4e4f41aa679d773ccafdec87bf8d7b5e85.tar.bz2 scummvm-rg350-ffc2aa4e4f41aa679d773ccafdec87bf8d7b5e85.zip |
CGE: Format code
Diffstat (limited to 'engines/cge/btfile.h')
-rw-r--r-- | engines/cge/btfile.h | 95 |
1 files changed, 42 insertions, 53 deletions
diff --git a/engines/cge/btfile.h b/engines/cge/btfile.h index 0df9636573..c55891cae4 100644 --- a/engines/cge/btfile.h +++ b/engines/cge/btfile.h @@ -25,73 +25,62 @@ * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon */ -#ifndef __BTFILE__ -#define __BTFILE__ +#ifndef __BTFILE__ +#define __BTFILE__ -#include "cge/general.h" +#include "cge/general.h" namespace CGE { -#define BT_SIZE K(1) -#define BT_KEYLEN 13 -#define BT_LEVELS 2 +#define BT_SIZE K(1) +#define BT_KEYLEN 13 +#define BT_LEVELS 2 -#define BT_NONE 0xFFFF -#define BT_ROOT 0 +#define BT_NONE 0xFFFF +#define BT_ROOT 0 -struct BT_KEYPACK -{ - char Key[BT_KEYLEN]; - uint32 Mark; - uint16 Size; +struct BT_KEYPACK { + char Key[BT_KEYLEN]; + uint32 Mark; + uint16 Size; }; - -struct BT_PAGE -{ - struct HEA - { - uint16 Count; - uint16 Down; - } Hea; - union - { - // dummy filler to make proper size of union - uint8 Data[BT_SIZE-sizeof(HEA)]; - // inner version of data: key + word-sized page link - struct INNER - { - uint8 Key[BT_KEYLEN]; - uint16 Down; - } Inn[(BT_SIZE-sizeof(HEA))/sizeof(INNER)]; - // leaf version of data: key + all user data - BT_KEYPACK Lea[(BT_SIZE-sizeof(HEA))/sizeof(BT_KEYPACK)]; - }; +struct BT_PAGE { + struct HEA { + uint16 Count; + uint16 Down; + } Hea; + union { + // dummy filler to make proper size of union + uint8 Data[BT_SIZE - sizeof(HEA)]; + // inner version of data: key + word-sized page link + struct INNER { + uint8 Key[BT_KEYLEN]; + uint16 Down; + } Inn[(BT_SIZE - sizeof(HEA)) / sizeof(INNER)]; + // leaf version of data: key + all user data + BT_KEYPACK Lea[(BT_SIZE - sizeof(HEA)) / sizeof(BT_KEYPACK)]; + }; }; - - - -class BTFILE : public IOHAND -{ - struct - { - BT_PAGE * Page; - uint16 PgNo; - int Indx; - bool Updt; - } Buff[BT_LEVELS]; - void PutPage (int lev, bool hard = FALSE); - BT_PAGE * GetPage (int lev, uint16 pgn); +class BTFILE : public IOHAND { + struct { + BT_PAGE *Page; + uint16 PgNo; + int Indx; + bool Updt; + } Buff[BT_LEVELS]; + void PutPage(int lev, bool hard = FALSE); + BT_PAGE *GetPage(int lev, uint16 pgn); public: - BTFILE (const char * name, IOMODE mode = REA, CRYPT * crpt = NULL); - virtual ~BTFILE (void); - BT_KEYPACK * Find(const char * key); - BT_KEYPACK * Next(void); - void Make(BT_KEYPACK * keypack, uint16 count); + BTFILE(const char *name, IOMODE mode = REA, CRYPT *crpt = NULL); + virtual ~BTFILE(void); + BT_KEYPACK *Find(const char *key); + BT_KEYPACK *Next(void); + void Make(BT_KEYPACK *keypack, uint16 count); }; } // End of namespace CGE |