From a799e5f44b42db671ecec8ed19ac765b2cfb0c03 Mon Sep 17 00:00:00 2001 From: brodsom Date: Mon, 24 May 2004 17:22:35 +0000 Subject: [PATCH] -Use C++ struct declaration style. --- src/alice/alice.h | 9 +++++---- src/burp/burp.h | 36 +++++++++++++++++++++++------------- src/dsql/array.epp | 6 ++++-- src/dsql/keywords.h | 6 ++++-- src/dsql/node.h | 5 +++-- src/dsql/sqlda.h | 8 ++++---- src/dsql/sym.h | 6 ++++-- 7 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/alice/alice.h b/src/alice/alice.h index a38cc8689b..4bd2a140b4 100644 --- a/src/alice/alice.h +++ b/src/alice/alice.h @@ -57,7 +57,7 @@ enum alice_shut_mode { SHUT_FULL = 4 }; -typedef struct user_action +struct user_action { ULONG ua_switches; UCHAR* ua_user; @@ -74,7 +74,7 @@ typedef struct user_action TEXT ua_log_file[MAXPATHLEN]; USHORT ua_db_SQL_dialect; alice_shut_mode ua_shutdown_mode; -} *USER_ACTION; +}; @@ -90,7 +90,7 @@ public: // Transaction block: used to store info about a multidatabase transaction. -typedef struct tdr : public pool_alloc +struct tdr : public pool_alloc { tdr* tdr_next; // next subtransaction SLONG tdr_id; // database-specific transaction id @@ -102,8 +102,9 @@ typedef struct tdr : public pool_alloc FB_API_HANDLE tdr_db_handle; // reattached database handle USHORT tdr_db_caps; // capabilities of database USHORT tdr_state; // see flags below -} *TDR; +}; +typedef tdr* TDR; // Transaction Description Record const int TDR_VERSION = 1; diff --git a/src/burp/burp.h b/src/burp/burp.h index 015f27c46f..d31708da99 100644 --- a/src/burp/burp.h +++ b/src/burp/burp.h @@ -505,7 +505,7 @@ enum att_type { }; -typedef enum att_type ATT_TYPE; +typedef att_type ATT_TYPE; // TMN: Why was this even added in the first place??? //typedef SCHAR att_type; @@ -617,14 +617,16 @@ struct burp_prc { }; -typedef struct gfld { +struct gfld { TEXT gfld_name [GDS_NAME_LEN]; ISC_QUAD gfld_vb; ISC_QUAD gfld_vs; ISC_QUAD gfld_vs2; gfld* gfld_next; USHORT gfld_flags; -} *GFLD; +}; + +typedef gfld* GFLD; enum gfld_flags_vals { GFLD_validation_blr = 1, @@ -692,13 +694,13 @@ const int INVALID_HANDLE_VALUE = -1; // File block -- for multi-file databases -typedef enum { +enum SIZE_CODE { size_n = 0, // none size_k, // k = 1024 size_m, // m = k x 1024 size_g, // g = m x 1024 size_e // error -} SIZE_CODE; +}; struct burp_fil { burp_fil* fil_next; @@ -713,19 +715,23 @@ const size_t FIL_LEN = sizeof(burp_fil); /* Split & Join stuff */ -typedef enum act_t { +enum act_t { ACT_unknown, // action is unknown ACT_backup, ACT_backup_split, ACT_restore, ACT_restore_join -} ACT_T; +}; -typedef struct act { +typedef act_t ACT_T; + +struct act { USHORT act_total; burp_fil* act_file; ACT_T act_action; -} *ACT; +}; + +typedef act* ACT; const size_t ACT_LEN = sizeof(act); @@ -733,7 +739,7 @@ const ULONG MAX_LENGTH = -1UL; // Keep in sync with burp_fil.fil_length // This structure has been cloned from spit.c -typedef struct hdr_split { +struct hdr_split { TEXT hdr_split_tag[18]; TEXT hdr_split_timestamp[30]; TEXT hdr_split_text1[11]; @@ -742,7 +748,9 @@ typedef struct hdr_split { TEXT hdr_split_total[4]; // Total number of files TEXT hdr_split_text3[2]; TEXT hdr_split_name[27]; // File name -} *HDR_SPLIT; +}; + +typedef hdr_split* HDR_SPLIT; /* NOTE: size of the hdr_split_tag and HDR_SPLIT_TAG must be the same and equal to 18. Otherwise we will not be able to join the gbk files v5.x */ @@ -755,7 +763,7 @@ const unsigned int MIN_SPLIT_SIZE = 2048; // bytes // Global switches and data -typedef struct tgbl +struct tgbl { thdd tgbl_thd_data; const TEXT* gbl_database_file_name; @@ -881,7 +889,9 @@ typedef struct tgbl isc_req_handle handles_write_procedure_prms_req_handle1; USHORT hdr_forced_writes; TEXT database_security_class[GDS_NAME_LEN]; // To save database security class for deferred update -} *TGBL; +}; + +typedef tgbl* TGBL; // CVC: This aux routine declared here to not force inclusion of burp.h with burp_proto.h // in other modules. diff --git a/src/dsql/array.epp b/src/dsql/array.epp index da83bd1069..e2909213c4 100644 --- a/src/dsql/array.epp +++ b/src/dsql/array.epp @@ -44,13 +44,15 @@ DATABASE DB = STATIC FILENAME "yachts.lnk"; const int array_desc_column_major = 1; // Set for FORTRAN -typedef struct gen_t { +struct gen_t { UCHAR* gen_sdl; UCHAR** gen_sdl_ptr; UCHAR* gen_end; ISC_STATUS* gen_status; SSHORT gen_internal; -} *GEN_T; +}; + +typedef gen_t *GEN_T; static void adjust_length(ISC_ARRAY_DESC*); static void copy_exact_name (const char*, char*, SSHORT); diff --git a/src/dsql/keywords.h b/src/dsql/keywords.h index 35793ace6e..a12bd21104 100644 --- a/src/dsql/keywords.h +++ b/src/dsql/keywords.h @@ -25,11 +25,13 @@ * MOD 29-Jun-2002 */ -typedef struct tok { +struct tok { USHORT tok_ident; const char* tok_string; USHORT tok_version; -} TOK; +}; + +typedef tok TOK; // These symbols are exported extern "C" { diff --git a/src/dsql/node.h b/src/dsql/node.h index 8d220704e8..e25140f23b 100644 --- a/src/dsql/node.h +++ b/src/dsql/node.h @@ -39,7 +39,7 @@ // an enumeration of the possible node types in a syntax tree -typedef enum nod_t +enum nod_t { nod_unknown_type = 0, nod_commit = 1, // Commands, not executed. @@ -332,8 +332,9 @@ typedef enum nod_t nod_exec_block, // EXECUTE BLOCK support nod_param_val, // default value for SP parameters support nod_rows // ROWS support -} NOD_TYPE; +}; +typedef nod_t NOD_TYPE; /* definition of a syntax node created both in parsing and in context recognition */ diff --git a/src/dsql/sqlda.h b/src/dsql/sqlda.h index 94ce358d8f..ca48db466e 100644 --- a/src/dsql/sqlda.h +++ b/src/dsql/sqlda.h @@ -29,7 +29,7 @@ const USHORT DIALECT_sqlda = 0; const USHORT DIALECT_xsqlda = 1; -typedef struct +struct SQLVAR { SSHORT sqltype; SSHORT sqllen; @@ -37,16 +37,16 @@ typedef struct SSHORT* sqlind; SSHORT sqlname_length; SCHAR sqlname[30]; -} SQLVAR; +}; -typedef struct +struct SQLDA { SCHAR sqldaid[8]; SLONG sqldabc; SSHORT sqln; SSHORT sqld; SQLVAR sqlvar[1]; -} SQLDA; +}; #define SQLDA_LENGTH(n) (sizeof (SQLDA) + (n-1) * sizeof (SQLVAR)) diff --git a/src/dsql/sym.h b/src/dsql/sym.h index 1984a85138..b79e200e4b 100644 --- a/src/dsql/sym.h +++ b/src/dsql/sym.h @@ -28,7 +28,7 @@ // possible symbol types -typedef enum sym_type { +enum sym_type { SYM_statement, SYM_cursor, SYM_keyword, @@ -40,7 +40,9 @@ typedef enum sym_type { SYM_procedure, SYM_intlsym, SYM_eof -} SYM_TYPE; +}; + +typedef sym_type SYM_TYPE; // symbol block