8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 16:03:02 +01:00

Partial 'struct' cleanup

This commit is contained in:
aafemt 2003-09-23 10:13:39 +00:00
parent 6b7cc56b75
commit e637437cb8
16 changed files with 84 additions and 78 deletions

View File

@ -28,6 +28,7 @@
#include "../jrd/common.h"
#include "../qli/dtr.h"
#include "../qli/exe.h"
#include "../qli/parse.h"
#include "../qli/err_proto.h"
#include "../qli/eval_proto.h"
#include "../qli/exe_proto.h"

View File

@ -263,7 +263,7 @@ FRBRD *EXEC_open_blob( QLI_NOD node)
}
struct file *EXEC_open_output(QLI_NOD node)
file* EXEC_open_output(QLI_NOD node)
{
/**************************************
*
@ -275,7 +275,7 @@ struct file *EXEC_open_output(QLI_NOD node)
* Open output stream to re-direct output.
*
**************************************/
IB_FILE *file;
IB_FILE *out_file;
DSC *desc;
TEXT filename[256], temp[64], *p, *q;
#ifndef WIN_NT
@ -298,8 +298,8 @@ struct file *EXEC_open_output(QLI_NOD node)
// If output is to a file, just do it
if (!node->nod_arg[e_out_pipe]) {
if (file = ib_fopen(filename, FOPEN_WRITE_TYPE))
return (struct file *) file;
if (out_file = ib_fopen(filename, FOPEN_WRITE_TYPE))
return (file*)out_file;
ERRQ_print_error(42, filename, NULL, NULL, NULL, NULL);
/* Msg42 Can't open output file %s */
@ -312,8 +312,8 @@ struct file *EXEC_open_output(QLI_NOD node)
#else
#ifdef WIN_NT
if (file = _popen(filename, "w"))
return (struct file *) file;
if (out_file = _popen(filename, "w"))
return (file*)out_file;
#else
arg = argv;
p = filename;
@ -344,8 +344,8 @@ struct file *EXEC_open_output(QLI_NOD node)
close(pair[0]);
if (file = ib_fdopen(pair[1], "w"))
return (struct file *) file;
if (out_file = ib_fdopen(pair[1], "w"))
return (file*)out_file;
#endif
IBERROR(37); // Msg37 ib_fdopen failed

View File

@ -25,13 +25,13 @@
#define _QLI_EXE_PROTO_H_
extern void EXEC_abort (void);
extern void EXEC_execute (struct qli_nod *);
extern FRBRD *EXEC_open_blob (struct qli_nod *);
extern struct file *EXEC_open_output (struct qli_nod *);
extern void EXEC_execute(qli_nod*);
extern FRBRD* EXEC_open_blob(qli_nod*);
extern file* EXEC_open_output(qli_nod*);
extern void EXEC_poll_abort (void);
extern struct dsc *EXEC_receive (struct qli_msg *, struct par *);
extern void EXEC_send (struct qli_msg *);
extern void EXEC_start_request (struct qli_req *, struct qli_msg *);
extern void EXEC_top (struct qli_nod *);
extern dsc* EXEC_receive(qli_msg*, par*);
extern void EXEC_send(qli_msg*);
extern void EXEC_start_request(qli_req*, qli_msg*);
extern void EXEC_top(qli_nod*);
#endif /* _QLI_EXE_PROTO_H_ */

View File

@ -24,6 +24,6 @@
#ifndef _QLI_EXPAN_PROTO_H_
#define _QLI_EXPAN_PROTO_H_
extern struct qli_nod *EXP_expand (struct syn *);
extern qli_nod* EXP_expand(syn*);
#endif /* _QLI_EXPAN_PROTO_H_ */

View File

@ -1915,7 +1915,7 @@ static QLI_NOD expand_sort( SYN input, LLS stack, QLI_NOD list)
ITM item;
SYN *syn_ptr, expr;
QLI_NOD node, *ptr;
USHORT i, position;
USHORT i;
node = MAKE_NODE(nod_list, input->syn_count);
node->nod_count = input->syn_count / 2;
@ -1924,8 +1924,10 @@ static QLI_NOD expand_sort( SYN input, LLS stack, QLI_NOD list)
for (i = 0; i < node->nod_count; i++) {
expr = *syn_ptr++;
if (expr->syn_type == nod_position) {
position = (USHORT) expr->syn_arg[0];
if (expr->syn_type == nod_position)
{ // FIXME: isn't plain 'unsigned long' better here?
// On 64bit platforms long is 64bit as well as pointer
ULONG position = (ULONG) expr->syn_arg[0];
if (!list || !position || position > list->nod_count)
IBERROR(152); // Msg152 invalid ORDER BY ordinal
item = (ITM) list->nod_arg[position - 1];

View File

@ -24,12 +24,12 @@
#ifndef QLI_FORMA_PROTO_H
#define QLI_FORMA_PROTO_H
extern int FMT_expression (struct qli_nod *);
extern TEXT *FMT_format (struct lls *);
extern struct qli_nod *FMT_list (struct qli_nod *);
extern void FMT_print (struct qli_nod *, struct prt *);
extern void FMT_put (const TEXT*, struct prt*);
extern void FMT_report (struct rpt *);
extern int FMT_expression(qli_nod*);
extern TEXT* FMT_format(lls*);
extern qli_nod* FMT_list(qli_nod*);
extern void FMT_print(qli_nod*, prt*);
extern void FMT_put(const TEXT*, prt*);
extern void FMT_report(rpt*);
#endif /* QLI_FORMA_PROTO_H */

View File

@ -24,10 +24,10 @@
#ifndef QLI_GENER_PROTO_H
#define QLI_GENER_PROTO_H
extern struct qli_nod *GEN_generate (struct qli_nod *);
extern qli_nod* GEN_generate(qli_nod*);
extern void GEN_release (void);
extern struct rlb *GEN_rlb_extend (struct rlb *);
extern void GEN_rlb_release (struct rlb *);
extern rlb* GEN_rlb_extend(rlb*);
extern void GEN_rlb_release(rlb*);
#endif /* QLI_GENER_PROTO_H */

View File

@ -30,6 +30,7 @@
#include "../jrd/gds.h"
#include "../qli/dtr.h"
#include "../qli/compile.h"
#include "../qli/parse.h"
#include "../qli/err_proto.h"
#include "../qli/help_proto.h"
#include "../qli/lex_proto.h"

View File

@ -25,6 +25,6 @@
#define _QLI_HELP_PROTO_H_
extern void HELP_fini (void);
extern void HELP_help (struct syn *);
extern void HELP_help(syn*);
#endif /* _QLI_HELP_PROTO_H_ */

View File

@ -36,7 +36,7 @@ static bool scompare(SCHAR *, int, SCHAR *, int);
static SYM hash_table[HASH_SIZE];
static SYM key_symbols;
struct word {
struct word_t {
KWWORDS id;
SCHAR *keyword;
} keywords[] = {
@ -84,7 +84,7 @@ void HSH_init(void)
SCHAR *string;
SYM symbol;
int i;
struct word *word;
word_t* word;
for (i = 0, word = keywords; i < FB_NELEM(keywords); i++, word++) {
for (string = word->keyword; *string; string++);

View File

@ -26,8 +26,8 @@
extern void HSH_fini (void);
extern void HSH_init (void);
extern void HSH_insert (struct sym *);
extern struct sym *HSH_lookup (SCHAR *, int);
extern void HSH_remove (struct sym *);
extern void HSH_insert(sym*);
extern sym* HSH_lookup(SCHAR*, int);
extern void HSH_remove(sym*);
#endif /* QLI_HSH_PROTO_H */

View File

@ -26,20 +26,20 @@
extern bool LEX_active_procedure (void);
extern void LEX_edit (SLONG, SLONG);
extern struct tok *LEX_edit_string (void);
extern struct tok *LEX_filename (void);
extern tok* LEX_edit_string(void);
extern tok* LEX_filename(void);
extern void LEX_fini (void);
extern void LEX_flush (void);
extern bool LEX_get_line (TEXT *, TEXT *, int);
extern void LEX_init (void);
extern void LEX_mark_statement (void);
extern void LEX_pop_line (void);
extern void LEX_procedure (struct dbb *, FRBRD *);
extern void LEX_procedure(dbb*, FRBRD*);
extern bool LEX_push_file (TEXT *, bool);
extern bool LEX_push_string (TEXT *);
extern void LEX_put_procedure (FRBRD *, SLONG, SLONG);
extern void LEX_real (void);
extern struct lls *LEX_statement_list (void);
extern struct tok *LEX_token (void);
extern lls* LEX_statement_list(void);
extern tok* LEX_token(void);
#endif /* _QLI_LEX_PROTO_H_ */

View File

@ -142,7 +142,7 @@ typedef struct rfr_tab_t {
int bit_mask;
} *RFR_TAB;
static const struct rfr_tab_t rfr_table[] = {
static const rfr_tab_t rfr_table[] = {
{ "RDB$INDICES", "RDB$INDEX_INACTIVE", DBB_cap_idx_inactive },
/* OBSOLETE - 1996-Aug-06 David Schnepper
{ "RDB$RELATIONS", "RDB$STORE_TRIGGER", DBB_cap_triggers },

View File

@ -24,33 +24,33 @@
#ifndef QLI_META_PROTO_H
#define QLI_META_PROTO_H
extern int MET_declare (struct dbb *, struct qli_fld *, struct nam *);
extern void MET_define_field (struct dbb *, struct qli_fld *);
extern void MET_define_index (struct syn *);
extern void MET_define_relation (struct qli_rel *, struct qli_rel *);
extern void MET_define_sql_relation (struct qli_rel *);
extern void MET_delete_database (struct dbb *);
extern void MET_delete_field (struct dbb *, struct nam *);
extern void MET_delete_index (struct dbb *, struct nam *);
extern void MET_delete_relation (struct qli_rel *);
extern int MET_dimensions (struct dbb *, TEXT *);
extern void MET_fields (struct qli_rel *);
extern void MET_finish (struct dbb *);
extern int MET_declare(dbb*, qli_fld*, nam*);
extern void MET_define_field(dbb*, qli_fld*);
extern void MET_define_index(syn*);
extern void MET_define_relation(qli_rel*, qli_rel*);
extern void MET_define_sql_relation(qli_rel*);
extern void MET_delete_database(dbb*);
extern void MET_delete_field(dbb*, nam*);
extern void MET_delete_index(dbb*, nam*);
extern void MET_delete_relation(qli_rel*);
extern int MET_dimensions(dbb*, TEXT*);
extern void MET_fields(qli_rel*);
extern void MET_finish(dbb*);
extern int MET_get_datatype (USHORT);
extern void MET_index_info(const TEXT*, const TEXT*, SCHAR*);
extern void MET_meta_commit (struct dbb *);
extern void MET_meta_rollback (struct dbb *);
extern FRBRD *MET_meta_transaction (struct dbb *, int);
extern void MET_modify_field (struct dbb *, struct qli_fld *);
extern void MET_modify_index (struct syn *);
extern void MET_modify_relation (struct qli_rel *, struct qli_fld *);
extern void MET_ready (struct syn *, USHORT);
extern void MET_meta_commit(dbb*);
extern void MET_meta_rollback(dbb*);
extern FRBRD* MET_meta_transaction(dbb*, int);
extern void MET_modify_field(dbb*, qli_fld*);
extern void MET_modify_index(syn*);
extern void MET_modify_relation(qli_rel*, qli_fld*);
extern void MET_ready(syn*, USHORT);
extern void MET_shutdown (void);
extern void MET_sql_alter_table (struct qli_rel *, struct qli_fld *);
extern void MET_sql_cr_view (struct syn *);
extern void MET_sql_grant (struct syn *);
extern void MET_sql_revoke (struct syn *);
extern FRBRD *MET_transaction (NOD_T, struct dbb *);
extern void MET_sql_alter_table(qli_rel*, qli_fld*);
extern void MET_sql_cr_view(syn*);
extern void MET_sql_grant(syn*);
extern void MET_sql_revoke(syn*);
extern FRBRD* MET_transaction(NOD_T, dbb*);
#endif /* QLI_META_PROTO_H */

View File

@ -37,7 +37,7 @@ static void timestamp_to_text(SLONG[2], DSC *);
static void sql_time_to_text(ULONG[1], DSC *);
static void sql_date_to_text(SLONG[1], DSC *);
static void mover_error(int, USHORT, USHORT);
static void now_to_date(struct tm *, SLONG[2]);
static void now_to_date(tm*, SLONG[2]);
static void numeric_to_text(const dsc*, dsc*);
static void string_to_date(const TEXT*, USHORT, SLONG[2]);
static void string_to_time(TEXT *, USHORT, SLONG[2]);
@ -77,7 +77,7 @@ struct dtypes_t {
TEXT *description;
};
static const struct dtypes_t dtypes_table[] = {
static const dtypes_t dtypes_table[] = {
{ dtype_null, "NULL" },
{ dtype_text, "character string" },
{ dtype_cstring, "character string" },
@ -1042,7 +1042,7 @@ static void sql_date_to_text( SLONG date[1], DSC * to)
**************************************/
DSC desc;
TEXT *p, temp[35];
struct tm times;
tm times;
SLONG date2[2];
date2[0] = date[0];
@ -1077,7 +1077,7 @@ static void sql_time_to_text( ULONG date[1], DSC * to)
**************************************/
DSC desc;
TEXT *p, temp[35];
struct tm times;
tm times;
SLONG date2[2];
date2[0] = 0;
@ -1114,7 +1114,7 @@ static void timestamp_to_text( SLONG date[2], DSC * to)
**************************************/
DSC desc;
TEXT *p, temp[35], time[15];
struct tm times;
tm times;
isc_decode_date((GDS_QUAD*)date, &times);
@ -1171,7 +1171,7 @@ static void mover_error( int pattern, USHORT in_type, USHORT out_type)
}
static void now_to_date( struct tm *time, SLONG date[2])
static void now_to_date(tm* time, SLONG date[2])
{
/**************************************
*
@ -1325,7 +1325,8 @@ static void string_to_date(const TEXT* string, USHORT length, SLONG date[2])
**************************************/
TEXT c, temp[15], *t;
USHORT n, month_position, i, components[7], precision, year;
struct tm times, times2, *today;
tm times, times2;
tm* today;
if (!length) {
date[0] = date[1] = 0;
@ -1490,7 +1491,8 @@ static void string_to_time( TEXT * string, USHORT length, SLONG date[2])
TEXT c, *p, temp[15], *t, *end;
USHORT n, i, components[7], precision;
time_t clock;
struct tm times, *today;
tm times;
tm* today;
if (!length) {
date[0] = date[1] = 0;
return;

View File

@ -24,15 +24,15 @@
#ifndef QLI_MOV_PROTO_H
#define QLI_MOV_PROTO_H
extern int MOVQ_compare (struct dsc *, struct dsc *);
extern double MOVQ_date_to_double (const struct dsc*);
extern int MOVQ_compare(dsc*, dsc*);
extern double MOVQ_date_to_double(const dsc*);
extern int MOVQ_decompose (const TEXT*, USHORT, SLONG *);
extern void MOVQ_double_to_date (double, SLONG [2]);
extern void MOVQ_fast (const SCHAR*, SCHAR*, ULONG);
extern double MOVQ_get_double (const struct dsc*);
extern SLONG MOVQ_get_long (const struct dsc*, SSHORT);
extern int MOVQ_get_string (const struct dsc*, TEXT**, struct vary*, USHORT);
extern void MOVQ_move (const struct dsc*, struct dsc*);
extern double MOVQ_get_double(const dsc*);
extern SLONG MOVQ_get_long(const dsc*, SSHORT);
extern int MOVQ_get_string(const dsc*, TEXT**, vary*, USHORT);
extern void MOVQ_move(const dsc*, dsc*);
extern void MOVQ_terminate (const SCHAR*, SCHAR*, SSHORT, SSHORT);
#endif /* QLI_MOV_PROTO_H */