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

C comments to C++ comments

This commit is contained in:
robocop 2003-09-10 11:48:08 +00:00
parent 1edfce107b
commit 689497906a
17 changed files with 371 additions and 371 deletions

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
*/ */
/* /*
$Id: all.cpp,v 1.14 2003-04-16 10:18:15 aafemt Exp $ $Id: all.cpp,v 1.15 2003-09-10 11:48:07 robocop Exp $
*/ */
/*************************************************** /***************************************************
@ -88,9 +88,9 @@ BLK ALLQ_alloc( PLB pool, UCHAR type, int count)
SLONG best_tail, tail; SLONG best_tail, tail;
if (type <= (SCHAR) type_MIN || type >= (SCHAR) type_MAX) if (type <= (SCHAR) type_MIN || type >= (SCHAR) type_MAX)
BUGCHECK(1); /* Msg1 bad block type */ BUGCHECK(1); // Msg1 bad block type
/* Compute block length */ // Compute block length
size = block_sizes[type].typ_root_length; size = block_sizes[type].typ_root_length;
@ -104,7 +104,7 @@ BLK ALLQ_alloc( PLB pool, UCHAR type, int count)
#endif #endif
if (size <= 4 || size > 65535) if (size <= 4 || size > 65535)
BUGCHECK(2); /* Msg2 bad block size */ BUGCHECK(2); // Msg2 bad block size
/* Find best fit. Best fit is defined to be the free block of SHORTest /* Find best fit. Best fit is defined to be the free block of SHORTest
tail. If there isn't a fit, extend the pool and try, try again. */ tail. If there isn't a fit, extend the pool and try, try again. */
@ -115,7 +115,7 @@ BLK ALLQ_alloc( PLB pool, UCHAR type, int count)
for (ptr = &pool->plb_free; (free = *ptr); ptr = &free->frb_next) for (ptr = &pool->plb_free; (free = *ptr); ptr = &free->frb_next)
if (free->frb_next if (free->frb_next
&& (SCHAR *) free >= && (SCHAR *) free >=
(SCHAR *) free->frb_next) BUGCHECK(434); /* memory pool free list is incorrect */ (SCHAR *) free->frb_next) BUGCHECK(434); // memory pool free list is incorrect
else if ((tail = free->frb_header.blk_length - size) >= 0 else if ((tail = free->frb_header.blk_length - size) >= 0
&& tail < best_tail) { && tail < best_tail) {
best = ptr; best = ptr;
@ -301,7 +301,7 @@ PLB ALLQ_pool(void)
PLB pool; PLB pool;
int pool_id; int pool_id;
/* Start by assigning a pool id */ // Start by assigning a pool id
for (pool_id = 0; pool_id < pools->vec_count; pool_id++) for (pool_id = 0; pool_id < pools->vec_count; pool_id++)
if (!(pools->vec_object[pool_id])) if (!(pools->vec_object[pool_id]))
@ -408,7 +408,7 @@ void ALLQ_release( FRB block)
pool_id = block->frb_header.blk_pool_id; pool_id = block->frb_header.blk_pool_id;
if (pool_id >= pools->vec_count || if (pool_id >= pools->vec_count ||
!(pool = (PLB) pools->vec_object[pool_id])) BUGCHECK(4); /* Msg4 bad pool id */ !(pool = (PLB) pools->vec_object[pool_id])) BUGCHECK(4); // Msg4 bad pool id
prior = NULL; prior = NULL;
for (ptr = &pool->plb_free; free = *ptr; for (ptr = &pool->plb_free; free = *ptr;
@ -417,7 +417,7 @@ void ALLQ_release( FRB block)
(SCHAR *) free) break; (SCHAR *) free) break;
if ((SCHAR *) block == (SCHAR *) free) if ((SCHAR *) block == (SCHAR *) free)
BUGCHECK(435); /* block released twice */ BUGCHECK(435); // block released twice
/* Merge block into list first, then try to combine blocks */ /* Merge block into list first, then try to combine blocks */
@ -434,10 +434,10 @@ void ALLQ_release( FRB block)
} }
else if ((SCHAR *) block + block->frb_header.blk_length > else if ((SCHAR *) block + block->frb_header.blk_length >
(SCHAR *) free) (SCHAR *) free)
BUGCHECK(436); /* released block overlaps following free block */ BUGCHECK(436); // released block overlaps following free block
} }
/* Try and merge the block with the prior free block */ // Try and merge the block with the prior free block
if (prior) { if (prior) {
if ((SCHAR *) prior + prior->frb_header.blk_length == if ((SCHAR *) prior + prior->frb_header.blk_length ==
@ -447,7 +447,7 @@ void ALLQ_release( FRB block)
} }
else if ((SCHAR *) prior + prior->frb_header.blk_length > else if ((SCHAR *) prior + prior->frb_header.blk_length >
(SCHAR *) block) (SCHAR *) block)
BUGCHECK(437); /* released block overlaps prior free block */ BUGCHECK(437); // released block overlaps prior free block
} }
} }
@ -498,7 +498,7 @@ static void extend_pool( PLB pool, USHORT count)
1); 1);
if ((USHORT) size < count) if ((USHORT) size < count)
IBERROR(481); /* msg 481 unsuccessful attempt to extend pool beyond 64KB */ IBERROR(481); // msg 481 unsuccessful attempt to extend pool beyond 64KB
block = (BLK) ALLQ_malloc(size); block = (BLK) ALLQ_malloc(size);
block->blk_length = size; block->blk_length = size;

View File

@ -68,7 +68,7 @@ int CMD_check_ready(void)
if (QLI_databases) if (QLI_databases)
return FALSE; return FALSE;
ERRQ_msg_put(95, NULL, NULL, NULL, NULL, NULL); /* Msg95 No databases are currently ready */ ERRQ_msg_put(95, NULL, NULL, NULL, NULL, NULL); // Msg95 No databases are currently ready
return TRUE; return TRUE;
} }
@ -340,7 +340,7 @@ void CMD_set( SYN node)
break; break;
case set_form: case set_form:
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
break; break;
case set_password: case set_password:
@ -355,7 +355,7 @@ void CMD_set( SYN node)
case set_prompt: case set_prompt:
string = (CON) value; string = (CON) value;
if (string->con_desc.dsc_length > sizeof(QLI_prompt_string)) if (string->con_desc.dsc_length > sizeof(QLI_prompt_string))
ERRQ_error(86, NULL, NULL, NULL, NULL, NULL); /* Msg86 substitute prompt string too long */ ERRQ_error(86, NULL, NULL, NULL, NULL, NULL); // Msg86 substitute prompt string too long
strncpy(QLI_prompt_string, (char*) string->con_data, strncpy(QLI_prompt_string, (char*) string->con_data,
string->con_desc.dsc_length); string->con_desc.dsc_length);
QLI_prompt_string[string->con_desc.dsc_length] = 0; QLI_prompt_string[string->con_desc.dsc_length] = 0;
@ -364,7 +364,7 @@ void CMD_set( SYN node)
case set_continuation: case set_continuation:
string = (CON) value; string = (CON) value;
if (string->con_desc.dsc_length > sizeof(QLI_cont_string)) if (string->con_desc.dsc_length > sizeof(QLI_cont_string))
ERRQ_error(87, NULL, NULL, NULL, NULL, NULL); /* Msg87 substitute prompt string too long */ ERRQ_error(87, NULL, NULL, NULL, NULL, NULL); // Msg87 substitute prompt string too long
strncpy(QLI_cont_string, (char*) string->con_data, strncpy(QLI_cont_string, (char*) string->con_data,
string->con_desc.dsc_length); string->con_desc.dsc_length);
QLI_cont_string[string->con_desc.dsc_length] = 0; QLI_cont_string[string->con_desc.dsc_length] = 0;
@ -424,7 +424,7 @@ void CMD_set( SYN node)
#endif #endif
default: default:
BUGCHECK(6); /* Msg6 set option not implemented */ BUGCHECK(6); // Msg6 set option not implemented
} }
} }
} }
@ -482,14 +482,14 @@ void CMD_shell( SYN node)
ptr = NULL; ptr = NULL;
return_status = 0; return_status = 0;
mask = 1; mask = 1;
status = lib$spawn(ptr, /* Command to be executed */ status = lib$spawn(ptr, // Command to be executed
NULL, /* Command file */ NULL, // Command file
NULL, /* Output file */ NULL, // Output file
&mask, /* sub-process characteristics mask */ &mask, /* sub-process characteristics mask */
NULL, /* sub-process name */ NULL, /* sub-process name */
NULL, /* returned process id */ NULL, // returned process id
&return_status, /* completion status */ &return_status, // completion status
&15); /* event flag for completion */ &15); // event flag for completion
if (status & 1) if (status & 1)
while (!return_status) while (!return_status)
sys$waitfr(15); sys$waitfr(15);

View File

@ -241,7 +241,7 @@ static QLI_NOD compile_any( QLI_NOD node, QLI_REQ old_request, int internal_flag
} }
if (old_request && request->req_database != old_request->req_database) if (old_request && request->req_database != old_request->req_database)
IBERROR(357); /* Msg357 relations from multiple databases in single rse */ IBERROR(357); // Msg357 relations from multiple databases in single rse
if (old_request && (!receive || !receive->msg_parameters)) { if (old_request && (!receive || !receive->msg_parameters)) {
if (receive) if (receive)
@ -318,7 +318,7 @@ static QLI_NOD compile_assignment( QLI_NOD node, QLI_REQ request, int statement_
compile_expression(initial, request, FALSE); compile_expression(initial, request, FALSE);
if (statement_internal) { if (statement_internal) {
node->nod_arg[e_asn_valid] = NULL; /* Memory reclaimed in the main loop */ node->nod_arg[e_asn_valid] = NULL; // Memory reclaimed in the main loop
node->nod_flags |= NOD_remote; node->nod_flags |= NOD_remote;
node = NULL; node = NULL;
} }
@ -432,7 +432,7 @@ static QLI_NOD compile_edit( QLI_NOD node, QLI_REQ request)
if (value = node->nod_arg[e_edt_input]) { if (value = node->nod_arg[e_edt_input]) {
field = (QLI_FLD) value->nod_arg[e_fld_field]; field = (QLI_FLD) value->nod_arg[e_fld_field];
if (value->nod_type != nod_field || field->fld_dtype != dtype_blob) if (value->nod_type != nod_field || field->fld_dtype != dtype_blob)
IBERROR(356); /* Msg356 EDIT argument must be a blob field */ IBERROR(356); // Msg356 EDIT argument must be a blob field
node->nod_arg[e_edt_input] = node->nod_arg[e_edt_input] =
compile_expression(value, request, FALSE); compile_expression(value, request, FALSE);
} }
@ -713,7 +713,7 @@ static QLI_NOD compile_field( QLI_NOD node, QLI_REQ request, int internal_flag)
QLI_MSG message; QLI_MSG message;
QLI_FLD field; QLI_FLD field;
/* Pick up field characteristics */ // Pick up field characteristics
node->nod_count = 0; node->nod_count = 0;
field = (QLI_FLD) node->nod_arg[e_fld_field]; field = (QLI_FLD) node->nod_arg[e_fld_field];
@ -1096,7 +1096,7 @@ static QLI_NOD compile_prompt( QLI_NOD node)
QLI_FLD field; QLI_FLD field;
USHORT prompt_length; USHORT prompt_length;
/* Make up a plausible prompt length */ // Make up a plausible prompt length
if (!(field = (QLI_FLD) node->nod_arg[e_prm_field])) if (!(field = (QLI_FLD) node->nod_arg[e_prm_field]))
prompt_length = PROMPT_LENGTH; prompt_length = PROMPT_LENGTH;
@ -1243,7 +1243,7 @@ static QLI_REQ compile_rse(
database = &local_dbb; database = &local_dbb;
} }
/* Loop thru relations to make sure only a single database is presented */ // Loop thru relations to make sure only a single database is presented
ctx_ptr = (QLI_CTX *) node->nod_arg + e_rse_count; ctx_ptr = (QLI_CTX *) node->nod_arg + e_rse_count;
ctx_end = ctx_ptr + node->nod_count; ctx_end = ctx_ptr + node->nod_count;
@ -1261,7 +1261,7 @@ static QLI_REQ compile_rse(
if (!*database) if (!*database)
*database = relation->rel_database; *database = relation->rel_database;
else if (*database != relation->rel_database) else if (*database != relation->rel_database)
IBERROR(357); /* Msg357 relations from multiple databases in single rse */ IBERROR(357); // Msg357 relations from multiple databases in single rse
} }
} }
@ -1281,7 +1281,7 @@ static QLI_REQ compile_rse(
compile_context(node, request, internal_flag); compile_context(node, request, internal_flag);
/* Process various clauses */ // Process various clauses
if (node->nod_arg[e_rse_first]) if (node->nod_arg[e_rse_first])
compile_expression(node->nod_arg[e_rse_first], request, TRUE); compile_expression(node->nod_arg[e_rse_first], request, TRUE);
@ -1492,7 +1492,7 @@ static QLI_NOD compile_store( QLI_NOD node, QLI_REQ request, int internal_flag)
QLI_REL relation; QLI_REL relation;
QLI_MSG send; QLI_MSG send;
/* Find or make up request for statement */ // Find or make up request for statement
context = (QLI_CTX) node->nod_arg[e_sto_context]; context = (QLI_CTX) node->nod_arg[e_sto_context];
relation = context->ctx_relation; relation = context->ctx_relation;
@ -2014,9 +2014,9 @@ static QLI_NOD make_reference( QLI_NOD node, QLI_MSG message)
PAR parm; PAR parm;
if (!message) if (!message)
BUGCHECK(363); /* Msg363 missing message */ BUGCHECK(363); // Msg363 missing message
/* Look for an existing field reference */ // Look for an existing field reference
for (parm = message->msg_parameters; parm; parm = parm->par_next) for (parm = message->msg_parameters; parm; parm = parm->par_next)
if (CMP_node_match(parm->par_value, node)) if (CMP_node_match(parm->par_value, node))
@ -2088,7 +2088,7 @@ static void release_message( QLI_MSG message)
break; break;
if (!*ptr) if (!*ptr)
BUGCHECK(364); /* Msg 364 lost message */ BUGCHECK(364); // Msg 364 lost message
*ptr = message->msg_next; *ptr = message->msg_next;
ALL_release((FRB) message); ALL_release((FRB) message);

View File

@ -59,7 +59,7 @@
#endif #endif
#ifndef STARTUP_FILE #ifndef STARTUP_FILE
#define STARTUP_FILE "HOME" /* Assume its Unix */ #define STARTUP_FILE "HOME" // Assume its Unix
#endif #endif
#ifndef SIGQUIT #ifndef SIGQUIT
@ -67,9 +67,9 @@
#define SIGPIPE SIGINT #define SIGPIPE SIGINT
#endif #endif
/* Program wide globals */ // Program wide globals
jmp_buf QLI_env; /* Error return environment */ jmp_buf QLI_env; // Error return environment
TEXT *QLI_error; TEXT *QLI_error;
USHORT sw_verify, sw_trace, sw_buffers; USHORT sw_verify, sw_trace, sw_buffers;
@ -101,8 +101,8 @@ typedef struct answer_t {
static int yes_no_loaded = 0; static int yes_no_loaded = 0;
static struct answer_t answer_table[] = { static struct answer_t answer_table[] = {
{ "", FALSE }, /* NO */ { "", FALSE }, // NO
{ "", TRUE }, /* YES */ { "", TRUE }, // YES
{ NULL, 0 } { NULL, 0 }
}; };
@ -258,7 +258,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
enable_signals(); enable_signals();
if (banner_flag) if (banner_flag)
ERRQ_msg_put(24, NULL, NULL, NULL, NULL, NULL); /* Msg24 Welcome to QLI Query Language Interpreter */ ERRQ_msg_put(24, NULL, NULL, NULL, NULL, NULL); // Msg24 Welcome to QLI Query Language Interpreter
if (version_flag) if (version_flag)
ERRQ_msg_put(25, GDS_VERSION, NULL, NULL, NULL, NULL); /* Msg25 qli version %s */ ERRQ_msg_put(25, GDS_VERSION, NULL, NULL, NULL, NULL); /* Msg25 qli version %s */
@ -290,7 +290,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
PAR_token(); PAR_token();
} }
catch (const std::exception&) { catch (const std::exception&) {
/* try again */ // try again
got_started = 0; got_started = 0;
ERRQ_pending(); ERRQ_pending();
} }
@ -298,7 +298,7 @@ int CLIB_ROUTINE main( int argc, char **argv)
memset(QLI_env, 0, sizeof(QLI_env)); memset(QLI_env, 0, sizeof(QLI_env));
QLI_error = NULL; QLI_error = NULL;
/* Loop until end of file or forced exit */ // Loop until end of file or forced exit
while (QLI_line) { while (QLI_line) {
temp = QLI_default_pool = ALLQ_pool(); temp = QLI_default_pool = ALLQ_pool();
@ -371,7 +371,7 @@ static USHORT process_statement( USHORT flush_flag)
TEXT buffer[512], report[256]; TEXT buffer[512], report[256];
jmp_buf env; jmp_buf env;
/* Clear database active flags in preparation for a new statement */ // Clear database active flags in preparation for a new statement
QLI_abort = FALSE; QLI_abort = FALSE;
execution_tree = NULL; execution_tree = NULL;
@ -392,7 +392,7 @@ static USHORT process_statement( USHORT flush_flag)
enable_signals(); enable_signals();
/* Enable error unwinding and enable the unwinding environment */ // Enable error unwinding and enable the unwinding environment
try { try {
@ -462,12 +462,12 @@ static USHORT process_statement( USHORT flush_flag)
if (!(expanded_tree = (BLK) EXP_expand(syntax_tree))) if (!(expanded_tree = (BLK) EXP_expand(syntax_tree)))
return FALSE; return FALSE;
/* Compile the statement */ // Compile the statement
if (!(execution_tree = (BLK) CMPQ_compile((qli_nod*) expanded_tree))) if (!(execution_tree = (BLK) CMPQ_compile((qli_nod*) expanded_tree)))
return FALSE; return FALSE;
/* Generate any BLR needed to support the request */ // Generate any BLR needed to support the request
if (!GEN_generate(( (qli_nod*) execution_tree))) if (!GEN_generate(( (qli_nod*) execution_tree)))
return FALSE; return FALSE;
@ -509,7 +509,7 @@ static USHORT process_statement( USHORT flush_flag)
} }
} }
/* Release resources associated with the request */ // Release resources associated with the request
GEN_release(); GEN_release();
@ -540,48 +540,48 @@ static void CLIB_ROUTINE signal_arith_excp(USHORT sig, USHORT code, USHORT scp)
switch (code) { switch (code) {
#ifdef FPE_INOVF_TRAP #ifdef FPE_INOVF_TRAP
case FPE_INTOVF_TRAP: case FPE_INTOVF_TRAP:
msg_number = 14; /* Msg14 integer overflow */ msg_number = 14; // Msg14 integer overflow
break; break;
#endif #endif
#ifdef FPE_INTDIV_TRAP #ifdef FPE_INTDIV_TRAP
case FPE_INTDIV_TRAP: case FPE_INTDIV_TRAP:
msg_number = 15; /* Msg15 integer division by zero */ msg_number = 15; // Msg15 integer division by zero
break; break;
#endif #endif
#ifdef FPE_FLTOVF_TRAP #ifdef FPE_FLTOVF_TRAP
case FPE_FLTOVF_TRAP: case FPE_FLTOVF_TRAP:
msg_number = 16; /* Msg16 floating overflow trap */ msg_number = 16; // Msg16 floating overflow trap
break; break;
#endif #endif
#ifdef FPE_FLTDIV_TRAP #ifdef FPE_FLTDIV_TRAP
case FPE_FLTDIV_TRAP: case FPE_FLTDIV_TRAP:
msg_number = 17; /* Msg17 floating division by zero */ msg_number = 17; // Msg17 floating division by zero
break; break;
#endif #endif
#ifdef FPE_FLTUND_TRAP #ifdef FPE_FLTUND_TRAP
case FPE_FLTUND_TRAP: case FPE_FLTUND_TRAP:
msg_number = 18; /* Msg18 floating underflow trap */ msg_number = 18; // Msg18 floating underflow trap
break; break;
#endif #endif
#ifdef FPE_FLTOVF_FAULT #ifdef FPE_FLTOVF_FAULT
case FPE_FLTOVF_FAULT: case FPE_FLTOVF_FAULT:
msg_number = 19; /* Msg19 floating overflow fault */ msg_number = 19; // Msg19 floating overflow fault
break; break;
#endif #endif
#ifdef FPE_FLTUND_FAULT #ifdef FPE_FLTUND_FAULT
case FPE_FLTUND_FAULT: case FPE_FLTUND_FAULT:
msg_number = 20; /* Msg20 floating underflow fault */ msg_number = 20; // Msg20 floating underflow fault
break; break;
#endif #endif
default: default:
msg_number = 21; /* Msg21 arithmetic exception */ msg_number = 21; // Msg21 arithmetic exception
} }
signal(SIGFPE, (void(*)(int)) signal_arith_excp); signal(SIGFPE, (void(*)(int)) signal_arith_excp);
@ -632,9 +632,9 @@ static BOOLEAN yes_no( USHORT number, TEXT * arg1)
NULL); NULL);
if (!yes_no_loaded) { if (!yes_no_loaded) {
yes_no_loaded = 1; yes_no_loaded = 1;
if (!ERRQ_msg_get(498, answer_table[0].answer)) /* Msg498 NO */ if (!ERRQ_msg_get(498, answer_table[0].answer)) // Msg498 NO
strcpy(answer_table[0].answer, "NO"); /* default if msg_get fails */ strcpy(answer_table[0].answer, "NO"); /* default if msg_get fails */
if (!ERRQ_msg_get(497, answer_table[1].answer)) /* Msg497 YES */ if (!ERRQ_msg_get(497, answer_table[1].answer)) // Msg497 YES
strcpy(answer_table[1].answer, "YES"); strcpy(answer_table[1].answer, "YES");
} }

View File

@ -226,7 +226,7 @@ void EVAL_break_increment( QLI_NOD node)
desc1 = &node->nod_desc; desc1 = &node->nod_desc;
/* Knock off count as trivial */ // Knock off count as trivial
if (node->nod_type == nod_rpt_count) { if (node->nod_type == nod_rpt_count) {
*(SLONG *) node->nod_desc.dsc_address += 1; *(SLONG *) node->nod_desc.dsc_address += 1;
@ -258,7 +258,7 @@ void EVAL_break_increment( QLI_NOD node)
node->nod_arg[e_stt_default] = (QLI_NOD) (SLONG) count; node->nod_arg[e_stt_default] = (QLI_NOD) (SLONG) count;
desc1->dsc_missing = FALSE; desc1->dsc_missing = FALSE;
/* Finish off as per operator */ // Finish off as per operator
switch (node->nod_type) { switch (node->nod_type) {
case nod_rpt_min: case nod_rpt_min:
@ -490,14 +490,14 @@ DSC *EVAL_value(QLI_NOD node)
break; break;
default: default:
IBERROR(30); /* Msg30 data type not supported for arithmetic */ IBERROR(30); // Msg30 data type not supported for arithmetic
} }
return desc; return desc;
case nod_prompt: case nod_prompt:
if (!prompt[0][0]) { if (!prompt[0][0]) {
ERRQ_msg_get(499, prompt[0]); /* Msg499 Re-enter */ ERRQ_msg_get(499, prompt[0]); /* Msg499 Re-enter */
ERRQ_msg_get(500, prompt[1]); /* Msg500 Enter */ ERRQ_msg_get(500, prompt[1]); // Msg500 Enter
} }
return execute_prompt(node); return execute_prompt(node);
@ -542,7 +542,7 @@ DSC *EVAL_value(QLI_NOD node)
return FORM_get_field(node); return FORM_get_field(node);
#endif #endif
case nod_user_name: case nod_user_name:
IBERROR(31); /* Msg31 user name is supported only in RSEs temporarily */ IBERROR(31); // Msg31 user name is supported only in RSEs temporarily
case nod_parameter: case nod_parameter:
case nod_position: case nod_position:
@ -751,7 +751,7 @@ static DSC *execute_prompt( QLI_NOD node)
if (reprompt) if (reprompt)
sprintf(string, "\07%s: ", prompt[0]); /* Msg497 Re-enter */ sprintf(string, "\07%s: ", prompt[0]); /* Msg497 Re-enter */
else else
sprintf(string, "%s: ", prompt[1]); /* Msg498 Enter */ sprintf(string, "%s: ", prompt[1]); // Msg498 Enter
} }
if (!LEX_get_line(string, value, length)) { if (!LEX_get_line(string, value, length)) {
@ -781,7 +781,7 @@ static DSC *execute_prompt( QLI_NOD node)
return desc; return desc;
} }
ERRQ_msg_put(32, NULL, NULL, NULL, NULL, NULL); /* Msg32 Input value is too long */ ERRQ_msg_put(32, NULL, NULL, NULL, NULL, NULL); // Msg32 Input value is too long
reprompt = TRUE; reprompt = TRUE;
} }
} }
@ -959,11 +959,11 @@ static int sleuth( QLI_NOD node, DSC * desc1, DSC * desc2, DSC * desc3)
l1 = MOVQ_get_string(desc3, &p1, (VARY*) temp1, TEMP_LENGTH); l1 = MOVQ_get_string(desc3, &p1, (VARY*) temp1, TEMP_LENGTH);
/* Get address and length of search string */ // Get address and length of search string
l2 = MOVQ_get_string(desc2, &p2, (VARY*) temp2, TEMP_LENGTH); l2 = MOVQ_get_string(desc2, &p2, (VARY*) temp2, TEMP_LENGTH);
/* Merge search and control strings */ // Merge search and control strings
l2 = sleuth_merge((UCHAR*) p2, (UCHAR*) (p2 + l2), (UCHAR*) p1, (UCHAR*) (p1 + l1), (UCHAR*) control); l2 = sleuth_merge((UCHAR*) p2, (UCHAR*) (p2 + l2), (UCHAR*) p1, (UCHAR*) (p1 + l1), (UCHAR*) control);
@ -1188,7 +1188,7 @@ static int sleuth_merge(
v = vector; v = vector;
t = temp; t = temp;
/* Parse control string into substitution strings and initializing string */ // Parse control string into substitution strings and initializing string
while (control < end_control) { while (control < end_control) {
c = *control++; c = *control++;
@ -1237,7 +1237,7 @@ static int sleuth_merge(
} }
} }
/* Put in trailing stuff */ // Put in trailing stuff
while (control < end_control) while (control < end_control)
*comb++ = *control++; *comb++ = *control++;
@ -1281,7 +1281,7 @@ static int string_boolean( QLI_NOD node)
if (node->nod_type == nod_sleuth) if (node->nod_type == nod_sleuth)
return sleuth(node, desc1, desc2, desc3); return sleuth(node, desc1, desc2, desc3);
/* Get address and length of strings */ // Get address and length of strings
l2 = MOVQ_get_string(desc2, &p2, (VARY*) temp2, TEMP_LENGTH); l2 = MOVQ_get_string(desc2, &p2, (VARY*) temp2, TEMP_LENGTH);
@ -1352,7 +1352,7 @@ static int string_function(
return TRUE; return TRUE;
} }
/* Handle CONTAINS */ // Handle CONTAINS
if (node->nod_type == nod_containing) { if (node->nod_type == nod_containing) {
while (l1 >= l2) { while (l1 >= l2) {
@ -1370,7 +1370,7 @@ static int string_function(
return FALSE; return FALSE;
} }
/* Handle LIKE */ // Handle LIKE
if (node->nod_type == nod_like) { if (node->nod_type == nod_like) {
c1 = 0; c1 = 0;
@ -1382,7 +1382,7 @@ static int string_function(
return FALSE; return FALSE;
} }
/* Handle MATCHES */ // Handle MATCHES
if (node->nod_type == nod_matches) if (node->nod_type == nod_matches)
if (matches(p1, l1, p2, l2)) if (matches(p1, l1, p2, l2))

View File

@ -406,7 +406,7 @@ static void declare_global( QLI_FLD variable, SYN field_node)
IBERROR(137); /* Msg137 variables may not be based on blob fields. */ IBERROR(137); /* Msg137 variables may not be based on blob fields. */
} }
/* Get rid of any other variables of the same name */ // Get rid of any other variables of the same name
for (ptr = &QLI_variables; field = *ptr; ptr = &field->fld_next) for (ptr = &QLI_variables; field = *ptr; ptr = &field->fld_next)
if (!strcmp if (!strcmp
@ -451,7 +451,7 @@ static void declare_global( QLI_FLD variable, SYN field_node)
while (*p++ = *q++); while (*p++ = *q++);
} }
/* Link new variable into variable chain */ // Link new variable into variable chain
new_fld->fld_next = QLI_variables; new_fld->fld_next = QLI_variables;
QLI_variables = new_fld; QLI_variables = new_fld;
@ -626,7 +626,7 @@ static QLI_NOD expand_boolean( SYN input, LLS stack)
QLI_FLD field; QLI_FLD field;
SSHORT i; SSHORT i;
/* Make node and process arguments */ // Make node and process arguments
node = MAKE_NODE(input->syn_type, input->syn_count); node = MAKE_NODE(input->syn_type, input->syn_count);
ptr = node->nod_arg; ptr = node->nod_arg;
@ -636,7 +636,7 @@ static QLI_NOD expand_boolean( SYN input, LLS stack)
if (!(*ptr = possible_literal(input->syn_arg[i], stack, TRUE))) if (!(*ptr = possible_literal(input->syn_arg[i], stack, TRUE)))
*ptr = expand_expression(input->syn_arg[i], stack); *ptr = expand_expression(input->syn_arg[i], stack);
/* Try to match any prompts against fields to determine prompt length */ // Try to match any prompts against fields to determine prompt length
if (value->nod_type != nod_field) if (value->nod_type != nod_field)
return node; return node;
@ -785,7 +785,7 @@ static void expand_edit_string( QLI_NOD node, ITM item)
return; return;
} }
/* Handle fields */ // Handle fields
field = (QLI_FLD) node->nod_arg[e_fld_field]; field = (QLI_FLD) node->nod_arg[e_fld_field];
@ -838,11 +838,11 @@ static QLI_NOD expand_erase( SYN input, LLS right, LLS left)
} }
if (count == 0) if (count == 0)
IBERROR(139); /* Msg139 no context for ERASE */ IBERROR(139); // Msg139 no context for ERASE
else if (count > 1) else if (count > 1)
IBERROR(140); /* Msg140 can't erase from a join */ IBERROR(140); /* Msg140 can't erase from a join */
/* Make up node big enough to hold fixed fields plus all contexts */ // Make up node big enough to hold fixed fields plus all contexts
node = MAKE_NODE(nod_erase, e_era_count); node = MAKE_NODE(nod_erase, e_era_count);
node->nod_arg[e_era_context] = (QLI_NOD) context; node->nod_arg[e_era_context] = (QLI_NOD) context;
@ -913,7 +913,7 @@ static QLI_NOD expand_expression( SYN input, LLS stack)
&& node->nod_arg[e_stt_value]) && node->nod_arg[e_stt_value])
expand_distinct(node->nod_arg[e_stt_rse], expand_distinct(node->nod_arg[e_stt_rse],
node->nod_arg[e_stt_value]); node->nod_arg[e_stt_value]);
/* count2 next 2 lines go */ // count2 next 2 lines go
if (input->syn_type == nod_count) if (input->syn_type == nod_count)
node->nod_arg[e_stt_value] = 0; node->nod_arg[e_stt_value] = 0;
return node; return node;
@ -930,7 +930,7 @@ static QLI_NOD expand_expression( SYN input, LLS stack)
break; break;
} }
if (!stack) if (!stack)
ERRQ_print_error(454, NULL, NULL, NULL, NULL, NULL); /* could not resolve context for aggregate */ ERRQ_print_error(454, NULL, NULL, NULL, NULL, NULL); // could not resolve context for aggregate
/* count2 /* count2
if (value = input->syn_arg [s_stt_value]) if (value = input->syn_arg [s_stt_value])
{ {
@ -954,7 +954,7 @@ static QLI_NOD expand_expression( SYN input, LLS stack)
case nod_index: case nod_index:
value = input->syn_arg[s_idx_field]; value = input->syn_arg[s_idx_field];
if (value->syn_type != nod_field) if (value->syn_type != nod_field)
IBERROR(466); /* Msg466 Only fields may be subscripted */ IBERROR(466); // Msg466 Only fields may be subscripted
return expand_field(value, stack, input->syn_arg[s_idx_subs]); return expand_field(value, stack, input->syn_arg[s_idx_subs]);
case nod_list: case nod_list:
@ -1165,16 +1165,16 @@ static FRM expand_form( SYN input, QLI_REL relation)
FRM form; FRM form;
TEXT *string; TEXT *string;
/* Figure out form name */ // Figure out form name
if (input && (name = (NAM) input->syn_arg[s_frm_form])) if (input && (name = (NAM) input->syn_arg[s_frm_form]))
string = name->nam_string; string = name->nam_string;
else if (relation) else if (relation)
string = relation->rel_symbol->sym_string; string = relation->rel_symbol->sym_string;
else else
IBERROR(143); /* Msg143 no default form name */ IBERROR(143); // Msg143 no default form name
/* Now figure out which database to look in */ // Now figure out which database to look in
database = NULL; database = NULL;
@ -1184,7 +1184,7 @@ static FRM expand_form( SYN input, QLI_REL relation)
if (!database && relation) if (!database && relation)
database = relation->rel_database; database = relation->rel_database;
/* Look for form either in explicit or any database */ // Look for form either in explicit or any database
if (database) { if (database) {
if (form = FORM_lookup_form(database, string)) if (form = FORM_lookup_form(database, string))
@ -1196,7 +1196,7 @@ static FRM expand_form( SYN input, QLI_REL relation)
FORM_lookup_form(database, FORM_lookup_form(database,
string)) string))
return form; return form;
ERRQ_print_error(144, string, NULL, NULL, NULL, NULL); /* Msg144 No database for form */ ERRQ_print_error(144, string, NULL, NULL, NULL, NULL); // Msg144 No database for form
} }
/* Form doesn't exist, try to make up a default */ /* Form doesn't exist, try to make up a default */
@ -1206,7 +1206,7 @@ static FRM expand_form( SYN input, QLI_REL relation)
(form = FORM_default_form(database, string))) (form = FORM_default_form(database, string)))
return form; return form;
ERRQ_print_error(145, string, database->dbb_filename, NULL, NULL, NULL); /* Msg145 form is not defined in database */ ERRQ_print_error(145, string, database->dbb_filename, NULL, NULL, NULL); // Msg145 form is not defined in database
return NULL; return NULL;
} }
#endif #endif
@ -1287,7 +1287,7 @@ static QLI_NOD expand_form_update( SYN input, LLS right, LLS left)
} }
if (!stack) if (!stack)
IBERROR(146); /* Msg146 no context for form ACCEPT statement */ IBERROR(146); // Msg146 no context for form ACCEPT statement
form = context->ctx_form; form = context->ctx_form;
stack = NULL; stack = NULL;
@ -1298,7 +1298,7 @@ static QLI_NOD expand_form_update( SYN input, LLS right, LLS left)
name = (NAM) * ptr; name = (NAM) * ptr;
if (!(field = FORM_lookup_field(form, name->nam_string))) if (!(field = FORM_lookup_field(form, name->nam_string)))
ERRQ_print_error(147, name->nam_string, form->frm_name, NULL, ERRQ_print_error(147, name->nam_string, form->frm_name, NULL,
NULL, NULL); /* Msg147 field is not defined in form */ NULL, NULL); // Msg147 field is not defined in form
LLS_PUSH(field, &stack); LLS_PUSH(field, &stack);
} }
@ -1481,15 +1481,15 @@ static QLI_NOD expand_modify( SYN input, LLS right, LLS left)
} }
if (!count) if (!count)
IBERROR(148); /* Msg148 no context for modify */ IBERROR(148); // Msg148 no context for modify
/* Make up node big enough to hold fixed fields plus all contexts */ // Make up node big enough to hold fixed fields plus all contexts
node = MAKE_NODE(nod_modify, (int) e_mod_count + count); node = MAKE_NODE(nod_modify, (int) e_mod_count + count);
node->nod_count = count; node->nod_count = count;
ptr = &node->nod_arg[e_mod_count]; ptr = &node->nod_arg[e_mod_count];
/* Loop thru contexts augmenting left context */ // Loop thru contexts augmenting left context
for (contexts = right; contexts; contexts = contexts->lls_next) { for (contexts = right; contexts; contexts = contexts->lls_next) {
context = (QLI_CTX) contexts->lls_object; context = (QLI_CTX) contexts->lls_object;
@ -1527,7 +1527,7 @@ static QLI_NOD expand_modify( SYN input, LLS right, LLS left)
right); right);
} }
else else
IBERROR(149); /* Msg149 field list required for modify */ IBERROR(149); // Msg149 field list required for modify
if (!loop) if (!loop)
return node; return node;
@ -1599,7 +1599,7 @@ static QLI_NOD expand_print( SYN input, LLS right, LLS left)
syn_rse = input->syn_arg[s_prt_rse]; syn_rse = input->syn_arg[s_prt_rse];
/* Check to see if form mode is appropriate */ // Check to see if form mode is appropriate
#ifdef PYXIS #ifdef PYXIS
if (input->syn_arg[s_prt_form] || if (input->syn_arg[s_prt_form] ||
(QLI_form_mode && (QLI_form_mode &&
@ -1682,7 +1682,7 @@ static QLI_NOD expand_print( SYN input, LLS right, LLS left)
/* If no print object showed up, complain! */ /* If no print object showed up, complain! */
if (!count) if (!count)
IBERROR(150); /* Msg150 No items in print list */ IBERROR(150); // Msg150 No items in print list
/* Build new print statement. Unlike the syntax node, the print statement /* Build new print statement. Unlike the syntax node, the print statement
has only print items in it. */ has only print items in it. */
@ -1753,7 +1753,7 @@ static QLI_NOD expand_print_form( SYN input, LLS right, LLS left)
/* If no print object showed up, complain! */ /* If no print object showed up, complain! */
if (!new_right) if (!new_right)
IBERROR(151); /* Msg151 No items in print list */ IBERROR(151); // Msg151 No items in print list
node = make_form_body(new_right, 0, input->syn_arg[s_prt_form]); node = make_form_body(new_right, 0, input->syn_arg[s_prt_form]);
@ -1876,7 +1876,7 @@ static QLI_NOD expand_report( SYN input, LLS right, LLS left)
QLI_NOD node, loop; QLI_NOD node, loop;
PRT print; PRT print;
/* Start by processing record selection expression */ // Start by processing record selection expression
expand_output(input->syn_arg[s_prt_output], right, &print); expand_output(input->syn_arg[s_prt_output], right, &print);
report = print->prt_report = (RPT) input->syn_arg[s_prt_list]; report = print->prt_report = (RPT) input->syn_arg[s_prt_list];
@ -1894,7 +1894,7 @@ static QLI_NOD expand_report( SYN input, LLS right, LLS left)
node->nod_arg[e_prt_list] = (QLI_NOD) report; node->nod_arg[e_prt_list] = (QLI_NOD) report;
node->nod_arg[e_prt_output] = (QLI_NOD) print; node->nod_arg[e_prt_output] = (QLI_NOD) print;
/* Process clauses where they exist */ // Process clauses where they exist
expand_control_break(&report->rpt_top_rpt, right); expand_control_break(&report->rpt_top_rpt, right);
expand_control_break(&report->rpt_top_page, right); expand_control_break(&report->rpt_top_page, right);
@ -1930,7 +1930,7 @@ static QLI_NOD expand_restructure( SYN input, LLS right, LLS left)
QLI_CTX context, ctx; QLI_CTX context, ctx;
LLS stack, search; LLS stack, search;
/* Make a FOR loop to drive the restructure */ // Make a FOR loop to drive the restructure
loop = MAKE_NODE(nod_for, e_for_count); loop = MAKE_NODE(nod_for, e_for_count);
loop->nod_arg[e_for_rse] = expand_rse(input->syn_arg[s_asn_from], &right); loop->nod_arg[e_for_rse] = expand_rse(input->syn_arg[s_asn_from], &right);
@ -1961,7 +1961,7 @@ static QLI_NOD expand_restructure( SYN input, LLS right, LLS left)
for (search = right; search; search = search->lls_next) { for (search = right; search; search = search->lls_next) {
ctx = (QLI_CTX) search->lls_object; ctx = (QLI_CTX) search->lls_object;
/* First look for an exact field name match */ // First look for an exact field name match
for (fld = ctx->ctx_relation->rel_fields; fld; for (fld = ctx->ctx_relation->rel_fields; fld;
fld = fld =
@ -2072,13 +2072,13 @@ static QLI_NOD expand_rse( SYN input, LLS * stack)
parent_context->ctx_sub_rse = node; parent_context->ctx_sub_rse = node;
} }
/* Process the FIRST clause before the context gets augmented */ // Process the FIRST clause before the context gets augmented
if (input->syn_arg[s_rse_first]) if (input->syn_arg[s_rse_first])
node->nod_arg[e_rse_first] = node->nod_arg[e_rse_first] =
expand_expression(input->syn_arg[e_rse_first], old_stack); expand_expression(input->syn_arg[e_rse_first], old_stack);
/* Process relations */ // Process relations
ptr = input->syn_arg + s_rse_count; ptr = input->syn_arg + s_rse_count;
@ -2121,7 +2121,7 @@ static QLI_NOD expand_rse( SYN input, LLS * stack)
LLS_PUSH(context, &new_stack); LLS_PUSH(context, &new_stack);
} }
/* Handle explicit boolean */ // Handle explicit boolean
if (input->syn_arg[e_rse_boolean]) if (input->syn_arg[e_rse_boolean])
boolean = make_and(boolean, boolean = make_and(boolean,
@ -2222,7 +2222,7 @@ static QLI_NOD expand_sort( SYN input, LLS stack, QLI_NOD list)
if (expr->syn_type == nod_position) { if (expr->syn_type == nod_position) {
position = (USHORT) expr->syn_arg[0]; position = (USHORT) expr->syn_arg[0];
if (!list || !position || position > list->nod_count) if (!list || !position || position > list->nod_count)
IBERROR(152); /* Msg152 invalid ORDER BY ordinal */ IBERROR(152); // Msg152 invalid ORDER BY ordinal
item = (ITM) list->nod_arg[position - 1]; item = (ITM) list->nod_arg[position - 1];
*ptr++ = item->itm_value; *ptr++ = item->itm_value;
} }
@ -2529,7 +2529,7 @@ static void expand_values( SYN input, LLS right)
} }
else if (input->syn_arg[s_sto_rse] && (value->syn_type == nod_star)) { else if (input->syn_arg[s_sto_rse] && (value->syn_type == nod_star)) {
if (!(context = find_context((NAM) value->syn_arg[0], right))) if (!(context = find_context((NAM) value->syn_arg[0], right)))
IBERROR(154); /* Msg154 unrecognized context */ IBERROR(154); // Msg154 unrecognized context
value_count += value_count +=
generate_fields(context, (LLS) &values, input->syn_arg[s_sto_rse]); generate_fields(context, (LLS) &values, input->syn_arg[s_sto_rse]);
} }
@ -2539,10 +2539,10 @@ static void expand_values( SYN input, LLS right)
} }
} }
/* Make assignments from values to fields */ // Make assignments from values to fields
if (field_count != value_count) if (field_count != value_count)
IBERROR(189); /* Msg189 the number of values do not match the number of fields */ IBERROR(189); // Msg189 the number of values do not match the number of fields
list = (SYN) ALLOCDV(type_syn, value_count); list = (SYN) ALLOCDV(type_syn, value_count);
list->syn_type = nod_list; list->syn_type = nod_list;
@ -2659,15 +2659,15 @@ static int generate_items( SYN symbol, LLS right, LLS items, QLI_NOD rse)
count = 0; count = 0;
group_list = (rse) ? rse->nod_arg[e_rse_group_by] : NULL; group_list = (rse) ? rse->nod_arg[e_rse_group_by] : NULL;
/* first identify the relation or context */ // first identify the relation or context
if (symbol->syn_count == 1) if (symbol->syn_count == 1)
name = (NAM) symbol->syn_arg[0]; name = (NAM) symbol->syn_arg[0];
else else
IBERROR(153); /* Msg153 asterisk expressions require exactly one qualifying context */ IBERROR(153); // Msg153 asterisk expressions require exactly one qualifying context
if (!(context = find_context(name, right))) if (!(context = find_context(name, right)))
IBERROR(154); /* Msg154 unrecognized context */ IBERROR(154); // Msg154 unrecognized context
relation = context->ctx_relation; relation = context->ctx_relation;
@ -3008,7 +3008,7 @@ static QLI_NOD make_form_body( LLS right, LLS left, SYN form_node)
relation = tmp_context->ctx_relation; relation = tmp_context->ctx_relation;
form = expand_form(form_node, relation); form = expand_form(form_node, relation);
/* Get stack of database fields and form fields */ // Get stack of database fields and form fields
stack = fields = NULL; stack = fields = NULL;
@ -3022,7 +3022,7 @@ static QLI_NOD make_form_body( LLS right, LLS left, SYN form_node)
LLS_PUSH(assignment, &stack); LLS_PUSH(assignment, &stack);
} }
/* Build form update */ // Build form update
node = MAKE_NODE(nod_form_update, e_fup_count); node = MAKE_NODE(nod_form_update, e_fup_count);
node->nod_count = 0; node->nod_count = 0;
@ -3262,7 +3262,7 @@ static QLI_NOD post_map( QLI_NOD node, QLI_CTX context)
QLI_NOD new_node; QLI_NOD new_node;
MAP map; MAP map;
/* Check to see if the item has already been posted */ // Check to see if the item has already been posted
for (map = context->ctx_map; map; map = map->map_next) for (map = context->ctx_map; map; map = map->map_next)
if (CMP_node_match(node, map->map_node)) if (CMP_node_match(node, map->map_node))
@ -3500,7 +3500,7 @@ static void resolve_really( QLI_FLD variable, SYN field_node)
symbol->sym_homonym) if (symbol->sym_type == SYM_database) { symbol->sym_homonym) if (symbol->sym_type == SYM_database) {
dbb = (DBB) symbol->sym_object; dbb = (DBB) symbol->sym_object;
resolved = MET_declare(dbb, variable, fld_name); resolved = MET_declare(dbb, variable, fld_name);
break; /* should be only one db in homonym list */ break; // should be only one db in homonym list
} }
if (!resolved) { if (!resolved) {
@ -3520,7 +3520,7 @@ static void resolve_really( QLI_FLD variable, SYN field_node)
(fld_name, (fld_name,
field-> field->
fld_name)) break; fld_name)) break;
break; /* should be only one rel in homonym list for each db */ break; // should be only one rel in homonym list for each db
} }
} }
} }
@ -3534,7 +3534,7 @@ static void resolve_really( QLI_FLD variable, SYN field_node)
} }
if (!resolved) if (!resolved)
IBERROR(155); /* Msg155 field referenced in BASED ON can not be resolved against readied databases */ IBERROR(155); // Msg155 field referenced in BASED ON can not be resolved against readied databases
if (local) { if (local) {
variable->fld_dtype = field->fld_dtype; variable->fld_dtype = field->fld_dtype;

View File

@ -133,7 +133,7 @@ TEXT *FMT_format(LLS stack)
TEXT *line, *p, *q, *segments[10], *bottom; TEXT *line, *p, *q, *segments[10], *bottom;
ULONG size; ULONG size;
/* Start by inverting the item stack into an item que */ // Start by inverting the item stack into an item que
temp = stack; temp = stack;
stack = NULL; stack = NULL;
@ -245,7 +245,7 @@ TEXT *FMT_format(LLS stack)
max_offset = MAX(max_offset, offset); max_offset = MAX(max_offset, offset);
} }
/* Make another pass checking for overlapping fields */ // Make another pass checking for overlapping fields
for (temp = stack; temp; temp = temp->lls_next) { for (temp = stack; temp; temp = temp->lls_next) {
item = (ITM) temp->lls_object; item = (ITM) temp->lls_object;
@ -266,7 +266,7 @@ TEXT *FMT_format(LLS stack)
if (number_segments == 0) if (number_segments == 0)
return NULL; return NULL;
/* Allocate a string block big enough to hold all lines of the print header */ // Allocate a string block big enough to hold all lines of the print header
size = (max_offset + 1) * (number_segments + 1) + 2; size = (max_offset + 1) * (number_segments + 1) + 2;
@ -303,7 +303,7 @@ TEXT *FMT_format(LLS stack)
} }
} }
/* Make one last pass to put in underlining of headers */ // Make one last pass to put in underlining of headers
if (l = bottom - BOTTOM_LINE) { if (l = bottom - BOTTOM_LINE) {
*p++ = '\n'; *p++ = '\n';
@ -453,7 +453,7 @@ void FMT_print( QLI_NOD list, PRT print)
RPT report; RPT report;
ISC_STATUS_ARRAY status_vector; ISC_STATUS_ARRAY status_vector;
/* Now go thru and make up the first line */ // Now go thru and make up the first line
if (!list) if (!list)
return; return;
@ -551,11 +551,11 @@ void FMT_print( QLI_NOD list, PRT print)
put_line(print, &p, buffer, '\n'); put_line(print, &p, buffer, '\n');
/* Now go back until all blobs have been fetched */ // Now go back until all blobs have been fetched
print_blobs(print, (ITM*) list->nod_arg, (ITM*) end); print_blobs(print, (ITM*) list->nod_arg, (ITM*) end);
/* Finish by closing all blobs */ // Finish by closing all blobs
for (ptr = list->nod_arg; ptr < end; ptr++) { for (ptr = list->nod_arg; ptr < end; ptr++) {
item = (ITM) * ptr; item = (ITM) * ptr;
@ -606,7 +606,7 @@ void FMT_put( TEXT * line, PRT print)
*p = 0; *p = 0;
#ifdef DEV_BUILD #ifdef DEV_BUILD
if (QLI_hex_output) { if (QLI_hex_output) {
/* Hex mode output to assist debugging of multicharset work */ // Hex mode output to assist debugging of multicharset work
for (p = buffer; p < end && *p; p++) for (p = buffer; p < end && *p; p++)
if (PRINTABLE(*p)) if (PRINTABLE(*p))
@ -712,7 +712,7 @@ static int decompose_header(
n = 0; n = 0;
/* Handle simple name first */ // Handle simple name first
if (*string != '"' && *string != '\'') if (*string != '"' && *string != '\'')
while (*string) { while (*string) {
@ -960,7 +960,7 @@ static TEXT *format_report( VEC columns_vec, USHORT width, USHORT * max_width)
if (number_segments == 0) if (number_segments == 0)
return NULL; return NULL;
/* Allocate a string block big enough to hold all lines of the print header */ // Allocate a string block big enough to hold all lines of the print header
l = bottom - BOTTOM_LINE; l = bottom - BOTTOM_LINE;
header = header =
@ -998,7 +998,7 @@ static TEXT *format_report( VEC columns_vec, USHORT width, USHORT * max_width)
} }
} }
/* Make one last pass to put in underlining of headers */ // Make one last pass to put in underlining of headers
if (l = bottom - BOTTOM_LINE) { if (l = bottom - BOTTOM_LINE) {
*p++ = '\n'; *p++ = '\n';
@ -1140,7 +1140,7 @@ static int match_expr( QLI_NOD node1, QLI_NOD node2)
if (node2->nod_type == nod_reference) if (node2->nod_type == nod_reference)
node2 = node2->nod_arg[0]; node2 = node2->nod_arg[0];
/* A constant more or less matches anything */ // A constant more or less matches anything
if (node1->nod_type == nod_constant) if (node1->nod_type == nod_constant)
return TRUE; return TRUE;

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
*/ */
/* /*
$Id: gener.cpp,v 1.18 2003-08-30 02:11:08 brodsom Exp $ $Id: gener.cpp,v 1.19 2003-09-10 11:48:08 robocop Exp $
*/ */
#include "firebird.h" #include "firebird.h"
@ -527,14 +527,14 @@ static void gen_assignment( QLI_NOD node, QLI_REQ request)
from = node->nod_arg[e_asn_from]; from = node->nod_arg[e_asn_from];
/* Handle a local expression locally */ // Handle a local expression locally
if (node->nod_flags & NOD_local) { if (node->nod_flags & NOD_local) {
gen_expression(from, 0); gen_expression(from, 0);
return; return;
} }
/* Generate a remote assignment */ // Generate a remote assignment
rlb = CHECK_RLB(request->req_blr); rlb = CHECK_RLB(request->req_blr);
@ -1127,7 +1127,7 @@ static void gen_for( QLI_NOD node, QLI_REQ request)
if (continuation) if (continuation)
STUFF(blr_end); STUFF(blr_end);
/* Finish off by building a SEND to indicate end of file */ // Finish off by building a SEND to indicate end of file
if (message) { if (message) {
gen_send_receive(message, blr_send); gen_send_receive(message, blr_send);
@ -1185,7 +1185,7 @@ static void gen_function( QLI_NOD node, QLI_REQ request)
else else
rlb = CHECK_RLB(request->req_blr); rlb = CHECK_RLB(request->req_blr);
/* Generate function body */ // Generate function body
STUFF(blr_function); STUFF(blr_function);
function = (FUN) node->nod_arg[e_fun_function]; function = (FUN) node->nod_arg[e_fun_function];
@ -1194,7 +1194,7 @@ static void gen_function( QLI_NOD node, QLI_REQ request)
for (p = (UCHAR *) symbol->sym_string; *p;) for (p = (UCHAR *) symbol->sym_string; *p;)
STUFF(*p++); STUFF(*p++);
/* Generate function arguments */ // Generate function arguments
args = node->nod_arg[e_fun_args]; args = node->nod_arg[e_fun_args];
STUFF(args->nod_count); STUFF(args->nod_count);
@ -1557,7 +1557,7 @@ static void gen_rse( QLI_NOD node, QLI_REQ request)
STUFF(blr_rs_stream); STUFF(blr_rs_stream);
STUFF(node->nod_count); STUFF(node->nod_count);
/* Check for aggregate case */ // Check for aggregate case
context = (QLI_CTX) node->nod_arg[e_rse_count]; context = (QLI_CTX) node->nod_arg[e_rse_count];
@ -1587,7 +1587,7 @@ static void gen_rse( QLI_NOD node, QLI_REQ request)
return; return;
} }
/* Make relation clauses for all relations */ // Make relation clauses for all relations
for (ptr = &node->nod_arg[e_rse_count], end = ptr + node->nod_count; for (ptr = &node->nod_arg[e_rse_count], end = ptr + node->nod_count;
ptr < end; ptr++) { ptr < end; ptr++) {
@ -1602,7 +1602,7 @@ static void gen_rse( QLI_NOD node, QLI_REQ request)
} }
} }
/* Handle various clauses */ // Handle various clauses
if (list = node->nod_arg[e_rse_first]) { if (list = node->nod_arg[e_rse_first]) {
STUFF(blr_first); STUFF(blr_first);

View File

@ -197,12 +197,12 @@ static void print_more(
ERRQ_msg_get(502, prompt); /* Msg502 "Subtopic? " */ ERRQ_msg_get(502, prompt); /* Msg502 "Subtopic? " */
/* Prompt the user for a line */ // Prompt the user for a line
if (!LEX_get_line(prompt, buffer, sizeof(buffer))) if (!LEX_get_line(prompt, buffer, sizeof(buffer)))
return; return;
/* Upcase the response and zap the blanks */ // Upcase the response and zap the blanks
topics[1] = p = topic; topics[1] = p = topic;
@ -242,7 +242,7 @@ static void print_topic(
TEXT string[128], banner[128], *next, *p, *q, *path, buffer[128], TEXT string[128], banner[128], *next, *p, *q, *path, buffer[128],
prompt[80]; prompt[80];
/* Copy the parent string inserting a blank at the end */ // Copy the parent string inserting a blank at the end
p = string; p = string;

View File

@ -298,7 +298,7 @@ TOK LEX_filename(void)
return NULL; return NULL;
} }
/* notice if this looks like a quoted file name */ // notice if this looks like a quoted file name
if (classes[c] & CHR_quote) { if (classes[c] & CHR_quote) {
token->tok_type = tok_quoted; token->tok_type = tok_quoted;
@ -337,10 +337,10 @@ TOK LEX_filename(void)
--p; --p;
} }
/* complain on unterminated quoted string */ // complain on unterminated quoted string
if ((token->tok_type == tok_quoted) && (p[-1] != save)) if ((token->tok_type == tok_quoted) && (p[-1] != save))
IBERROR(60); /* Msg 60 unterminated quoted string */ IBERROR(60); // Msg 60 unterminated quoted string
token->tok_length = p - token->tok_string; token->tok_length = p - token->tok_string;
*p = 0; *p = 0;
@ -428,7 +428,7 @@ int LEX_get_line( TEXT * prompt, TEXT * buffer, int size)
USHORT overflow_flag; USHORT overflow_flag;
SSHORT c; SSHORT c;
/* UNIX flavor */ // UNIX flavor
if (prompt) if (prompt)
ib_printf(prompt); ib_printf(prompt);
@ -472,7 +472,7 @@ int LEX_get_line( TEXT * prompt, TEXT * buffer, int size)
if (overflow_flag) { if (overflow_flag) {
buffer[0] = 0; buffer[0] = 0;
IBERROR(476); /* Msg 476 input line too long */ IBERROR(476); // Msg 476 input line too long
} }
if (sw_verify) if (sw_verify)
@ -529,7 +529,7 @@ int LEX_get_line( TEXT * prompt, TEXT * buffer, int size)
if (status != LIB$_INPSTRTRU) if (status != LIB$_INPSTRTRU)
return FALSE; return FALSE;
buffer[0] = 0; buffer[0] = 0;
IBERROR(476); /* Msg 476 input line too long */ IBERROR(476); // Msg 476 input line too long
} }
else if (length < size) else if (length < size)
*p++ = '\n'; *p++ = '\n';
@ -880,12 +880,12 @@ TOK LEX_token(void)
while (TRUE) { while (TRUE) {
if (!(next = nextchar(FALSE)) || next == '\n') { if (!(next = nextchar(FALSE)) || next == '\n') {
retchar(next); retchar(next);
IBERROR(63); /* Msg 63 unterminated quoted string */ IBERROR(63); // Msg 63 unterminated quoted string
break; break;
} }
*p++ = next; *p++ = next;
if ((p - token->tok_string) >= MAXSYMLEN) if ((p - token->tok_string) >= MAXSYMLEN)
ERRQ_msg_put(470, (TEXT *) MAXSYMLEN, NULL, NULL, NULL, NULL); /* Msg 470 literal too long */ ERRQ_msg_put(470, (TEXT *) MAXSYMLEN, NULL, NULL, NULL, NULL); // Msg 470 literal too long
/* If there are 2 quotes in a row, interpret 2nd as a literal */ /* If there are 2 quotes in a row, interpret 2nd as a literal */
@ -988,7 +988,7 @@ static BOOLEAN get_line( IB_FILE * file, TEXT * buffer, USHORT size)
return FALSE; return FALSE;
if (overflow_flag) if (overflow_flag)
IBERROR(477); /* Msg 477 input line too long */ IBERROR(477); // Msg 477 input line too long
if (sw_verify) if (sw_verify)
ib_fputs(buffer, ib_stdout); ib_fputs(buffer, ib_stdout);
@ -1054,7 +1054,7 @@ static void next_line( BOOLEAN eof_ok)
&& p[-1] == '\n' && *p) && p[-1] == '\n' && *p)
flag = TRUE; flag = TRUE;
else { else {
/* Initialize line block for retrieval */ // Initialize line block for retrieval
p = QLI_line->line_data; p = QLI_line->line_data;
QLI_line->line_ptr = QLI_line->line_data; QLI_line->line_ptr = QLI_line->line_data;
@ -1067,7 +1067,7 @@ static void next_line( BOOLEAN eof_ok)
} }
} }
else { else {
/* Initialize line block for retrieval */ // Initialize line block for retrieval
QLI_line->line_ptr = QLI_line->line_data; QLI_line->line_ptr = QLI_line->line_data;
p = QLI_line->line_data; p = QLI_line->line_data;
@ -1108,7 +1108,7 @@ static void next_line( BOOLEAN eof_ok)
return; return;
} }
/* this is an unexpected end of file */ // this is an unexpected end of file
if (QLI_line->line_type == line_blob) if (QLI_line->line_type == line_blob)
ERRQ_print_error(64, QLI_line->line_source_name, NULL, NULL, NULL, ERRQ_print_error(64, QLI_line->line_source_name, NULL, NULL, NULL,
@ -1121,7 +1121,7 @@ static void next_line( BOOLEAN eof_ok)
else { else {
if (QLI_line->line_type == line_string) if (QLI_line->line_type == line_string)
LEX_pop_line(); LEX_pop_line();
IBERROR(66); /* Msg 66 unexpected eof */ IBERROR(66); // Msg 66 unexpected eof
} }
} }
@ -1130,7 +1130,7 @@ static void next_line( BOOLEAN eof_ok)
QLI_line->line_position = QLI_position; QLI_line->line_position = QLI_position;
/* Dump output to the trace file */ // Dump output to the trace file
if (QLI_line->line_type == line_blob) if (QLI_line->line_type == line_blob)
while (*p) while (*p)
@ -1196,7 +1196,7 @@ static BOOLEAN scan_number( SSHORT c, TEXT ** ptr)
dot = TRUE; dot = TRUE;
} }
/* Gobble up digits up to a single decimal point */ // Gobble up digits up to a single decimal point
for (;;) { for (;;) {
c = nextchar(TRUE); c = nextchar(TRUE);

View File

@ -387,7 +387,7 @@ void MET_define_relation( QLI_REL relation, QLI_REL source)
database->dbb_relations = relation; database->dbb_relations = relation;
relation->rel_database = database; relation->rel_database = database;
/* Go back and pick up relation id */ // Go back and pick up relation id
setup_update(database); setup_update(database);
@ -465,7 +465,7 @@ void MET_define_sql_relation( QLI_REL relation)
database->dbb_relations = relation; database->dbb_relations = relation;
relation->rel_database = database; relation->rel_database = database;
/* Go back and pick up relation id */ // Go back and pick up relation id
setup_update(database); setup_update(database);
@ -572,14 +572,14 @@ void MET_delete_database( DBB dbb)
ERRQ_database_error(dbb, gds_status); ERRQ_database_error(dbb, gds_status);
END_ERROR; END_ERROR;
/* Get write ahead log information */ // Get write ahead log information
if (gds__database_info(status_vector, &DB, sizeof(db_log_info), if (gds__database_info(status_vector, &DB, sizeof(db_log_info),
(char*) db_log_info, sizeof(db_info_buffer), (char*) db_log_info, sizeof(db_info_buffer),
db_info_buffer)) db_info_buffer))
ERRQ_database_error(dbb, status_vector); ERRQ_database_error(dbb, status_vector);
/* extract info from buffer */ // extract info from buffer
wal_info((UCHAR*) db_info_buffer, &log, cur_log, &part_offset); wal_info((UCHAR*) db_info_buffer, &log, cur_log, &part_offset);
@ -610,7 +610,7 @@ void MET_delete_database( DBB dbb)
while (log_stack) { while (log_stack) {
string = (STR) LLS_POP(&log_stack); string = (STR) LLS_POP(&log_stack);
unlink(string->str_data); /* do not check for error */ unlink(string->str_data); // do not check for error
} }
if (unlink(dbb->dbb_filename)) if (unlink(dbb->dbb_filename))
@ -750,7 +750,7 @@ void MET_delete_relation( QLI_REL relation)
SYM symbol; SYM symbol;
RLB rlb; RLB rlb;
/* Pass the mess off to dynamic DDL and let it worry */ // Pass the mess off to dynamic DDL and let it worry
symbol = relation->rel_symbol; symbol = relation->rel_symbol;
rlb = NULL; rlb = NULL;
@ -765,7 +765,7 @@ void MET_delete_relation( QLI_REL relation)
execute_dynamic_ddl(relation->rel_database, rlb); execute_dynamic_ddl(relation->rel_database, rlb);
MET_meta_commit(relation->rel_database); MET_meta_commit(relation->rel_database);
/* Unlink and release various blocks */ // Unlink and release various blocks
purge_relation(relation); purge_relation(relation);
} }
@ -925,7 +925,7 @@ void MET_finish( DBB dbb)
purge_relation(relation); purge_relation(relation);
} }
/* Get rid of any functions */ // Get rid of any functions
while (function = dbb->dbb_functions) { while (function = dbb->dbb_functions) {
dbb->dbb_functions = function->fun_next; dbb->dbb_functions = function->fun_next;
@ -934,7 +934,7 @@ void MET_finish( DBB dbb)
ALL_release((FRB) function); ALL_release((FRB) function);
} }
/* Get rid of any forms */ // Get rid of any forms
#ifdef PYXIS #ifdef PYXIS
if (dbb->dbb_forms) { if (dbb->dbb_forms) {
FORM_finish(dbb); FORM_finish(dbb);
@ -963,7 +963,7 @@ void MET_finish( DBB dbb)
} }
if (!count) if (!count)
BUGCHECK(231); /* Msg231 database block not found for removal */ BUGCHECK(231); // Msg231 database block not found for removal
if (status_vector[1]) if (status_vector[1])
ERRQ_database_error(NULL, status_vector); ERRQ_database_error(NULL, status_vector);
@ -1066,7 +1066,7 @@ void MET_index_info(
if (gds__release_request(gds_status, &request_handle)) if (gds__release_request(gds_status, &request_handle))
ERRQ_database_error(NULL, gds_status); ERRQ_database_error(NULL, gds_status);
/* back up over the last space and finish off */ // back up over the last space and finish off
b--; b--;
*b++ = ')'; *b++ = ')';
@ -1144,7 +1144,7 @@ FRBRD *MET_meta_transaction(DBB database, int update_flag)
FRBRD *transaction; FRBRD *transaction;
if (!database) if (!database)
IBERROR(243); /* Msg243 no active database for operation */ IBERROR(243); // Msg243 no active database for operation
transaction = (database->dbb_capabilities & DBB_cap_multi_trans) ? transaction = (database->dbb_capabilities & DBB_cap_multi_trans) ?
database->dbb_meta_trans : NULL; database->dbb_meta_trans : NULL;
@ -1178,12 +1178,12 @@ FRBRD *MET_meta_transaction(DBB database, int update_flag)
if (!gds_trans && (database->dbb_capabilities & DBB_cap_single_trans)) if (!gds_trans && (database->dbb_capabilities & DBB_cap_single_trans))
{ {
if (update_flag) if (update_flag)
IBERROR(244); /* Msg244 Interactive metadata updates are not available on Rdb */ IBERROR(244); // Msg244 Interactive metadata updates are not available on Rdb
if (!(gds_trans = database->dbb_transaction)) if (!(gds_trans = database->dbb_transaction))
gds_trans = MET_transaction(nod_start_trans, database); gds_trans = MET_transaction(nod_start_trans, database);
} }
/* otherwise make one more effort to start the transaction */ // otherwise make one more effort to start the transaction
else if (!gds_trans) else if (!gds_trans)
{ {
@ -1518,7 +1518,7 @@ void MET_ready( SYN node, USHORT create_flag)
end = node->syn_arg + node->syn_count; end = node->syn_arg + node->syn_count;
/* Start by attaching all databases */ // Start by attaching all databases
for (ptr = node->syn_arg; ptr < end; ptr++) { for (ptr = node->syn_arg; ptr < end; ptr++) {
dbb = (DBB) * ptr; dbb = (DBB) * ptr;
@ -1662,7 +1662,7 @@ void MET_sql_cr_view( SYN node)
STUFF(gds_dyn_def_view); STUFF(gds_dyn_def_view);
STUFF_STRING(symbol->sym_string); STUFF_STRING(symbol->sym_string);
/* The meat of the blr generation will go here */ // The meat of the blr generation will go here
STUFF(gds_dyn_end); STUFF(gds_dyn_end);
STUFF(gds_dyn_eoc); STUFF(gds_dyn_eoc);
@ -1774,7 +1774,7 @@ static void add_field( QLI_REL relation, QLI_FLD field, USHORT position)
if (!(global_field = field->fld_based)) if (!(global_field = field->fld_based))
global_field = field_name; global_field = field_name;
/* Check to see if it already exits in relation */ // Check to see if it already exits in relation
FOR(REQUEST_HANDLE database->dbb_requests[REQ_rfr_def]) FOR(REQUEST_HANDLE database->dbb_requests[REQ_rfr_def])
X IN DB.RDB$RELATION_FIELDS WITH X IN DB.RDB$RELATION_FIELDS WITH
@ -1854,7 +1854,7 @@ static void add_sql_field( QLI_REL relation, QLI_FLD field, USHORT position, RLB
relation_name = relation->rel_symbol; relation_name = relation->rel_symbol;
field_name = field->fld_name; field_name = field->fld_name;
/* Check to see if it already exits in relation */ // Check to see if it already exits in relation
FOR(REQUEST_HANDLE database->dbb_requests[REQ_rfr_def]) FOR(REQUEST_HANDLE database->dbb_requests[REQ_rfr_def])
X IN DB.RDB$RELATION_FIELDS WITH X IN DB.RDB$RELATION_FIELDS WITH
@ -2008,7 +2008,7 @@ static void change_field( QLI_REL relation, QLI_FLD field)
if (field->fld_dtype) { if (field->fld_dtype) {
rollback_update(database); rollback_update(database);
ERRQ_print_error(252, NULL, NULL, NULL, NULL, NULL); /* Msg252 datatype can not be changed locally */ ERRQ_print_error(252, NULL, NULL, NULL, NULL, NULL); // Msg252 datatype can not be changed locally
} }
if (global_field if (global_field
@ -2018,7 +2018,7 @@ static void change_field( QLI_REL relation, QLI_FLD field)
ERRQ_print_error(253, global_field->sym_string, NULL, NULL, NULL, NULL); /* Msg253 global field %s does not exist */ ERRQ_print_error(253, global_field->sym_string, NULL, NULL, NULL, NULL); /* Msg253 global field %s does not exist */
} }
/* Modify RFR */ // Modify RFR
count = 0; count = 0;
FOR(REQUEST_HANDLE database->dbb_requests[REQ_mdf_rfr]) FOR(REQUEST_HANDLE database->dbb_requests[REQ_mdf_rfr])
@ -2417,7 +2417,7 @@ static int clone_global_fields( QLI_REL target, QLI_REL source)
name = (TEXT *) ALLQ_malloc((SLONG) sizeof(Y.RDB$FIELD_NAME)); name = (TEXT *) ALLQ_malloc((SLONG) sizeof(Y.RDB$FIELD_NAME));
strcpy(name, Y.RDB$FIELD_NAME); strcpy(name, Y.RDB$FIELD_NAME);
rollback_update(target->rel_database); rollback_update(target->rel_database);
ERRQ_error(413, name, NULL, NULL, NULL, NULL); /* conflicting previous definition */ ERRQ_error(413, name, NULL, NULL, NULL, NULL); // conflicting previous definition
} }
else else
predefined = TRUE; predefined = TRUE;
@ -2806,7 +2806,7 @@ static void get_database_type( DBB new_dbb)
break; break;
default: default:
ERRQ_error(257, NULL, NULL, NULL, NULL, NULL); /* Msg257 database info call failed */ ERRQ_error(257, NULL, NULL, NULL, NULL, NULL); // Msg257 database info call failed
} }
p += l; p += l;
} }
@ -2841,7 +2841,7 @@ static void get_log_names(
loop = 0; loop = 0;
/* loop up to 10 times to allow the file to be archived */ // loop up to 10 times to allow the file to be archived
while (TRUE) { while (TRUE) {
loop++; loop++;
@ -2895,7 +2895,7 @@ static void get_log_names(
LLS_PUSH(string, log_stack); LLS_PUSH(string, log_stack);
strcpy(string->str_data, nl); strcpy(string->str_data, nl);
/* switch files */ // switch files
if (cl == next_log) { if (cl == next_log) {
cl = cur_log; cl = cur_log;
@ -3030,7 +3030,7 @@ static void install( DBB old_dbb)
FUN function; FUN function;
TEXT *p, *q; TEXT *p, *q;
/* Copy the database block to one out of the permanent pool */ // Copy the database block to one out of the permanent pool
l = old_dbb->dbb_filename_length; l = old_dbb->dbb_filename_length;
new_dbb = (DBB) ALLOCPV(type_dbb, l); new_dbb = (DBB) ALLOCPV(type_dbb, l);
@ -3130,7 +3130,7 @@ static void install( DBB old_dbb)
symbol->sym_object = (BLK) function; symbol->sym_object = (BLK) function;
HSH_insert(symbol); HSH_insert(symbol);
/* Insert another symbol if there is a function query name */ // Insert another symbol if there is a function query name
if (symbol2 = if (symbol2 =
make_symbol(X.RDB$QUERY_NAME, sizeof(X.RDB$QUERY_NAME))) { make_symbol(X.RDB$QUERY_NAME, sizeof(X.RDB$QUERY_NAME))) {
@ -3694,7 +3694,7 @@ static void set_capabilities( DBB database)
req = NULL; req = NULL;
/* Look for desireable fields in system relations */ // Look for desireable fields in system relations
for (rel_field_table = const_cast<RFR_TAB>(rfr_table); rel_field_table->relation; for (rel_field_table = const_cast<RFR_TAB>(rfr_table); rel_field_table->relation;
rel_field_table++) { rel_field_table++) {
@ -3771,8 +3771,8 @@ static void sql_grant_revoke( SYN node, USHORT type)
STUFF(gds_dyn_version_1); STUFF(gds_dyn_version_1);
STUFF(gds_dyn_begin); STUFF(gds_dyn_begin);
/* For each user create a separate grant string */ // For each user create a separate grant string
/* For each specified field create a separate grant string */ // For each specified field create a separate grant string
names = node->syn_arg[s_grant_users]; names = node->syn_arg[s_grant_users];
fields = node->syn_arg[s_grant_fields]; fields = node->syn_arg[s_grant_fields];
@ -3849,7 +3849,7 @@ static void stuff_priv(
rlb = CHECK_RLB(rlb); rlb = CHECK_RLB(rlb);
STUFF(type); STUFF(type);
/* Stuff privileges first */ // Stuff privileges first
priv_count = 0; priv_count = 0;
if (privileges & PRV_select) if (privileges & PRV_select)

View File

@ -205,7 +205,7 @@ int MOVQ_compare( DSC * arg1, DSC * arg2)
} }
} }
/* Handle mixed string comparisons */ // Handle mixed string comparisons
if (arg1->dsc_dtype <= dtype_varying && arg2->dsc_dtype <= dtype_varying) { if (arg1->dsc_dtype <= dtype_varying && arg2->dsc_dtype <= dtype_varying) {
length = MOVQ_get_string(arg1, (TEXT**) &p1, 0, 0); length = MOVQ_get_string(arg1, (TEXT**) &p1, 0, 0);
@ -248,7 +248,7 @@ int MOVQ_compare( DSC * arg1, DSC * arg2)
return 0; return 0;
} }
/* Handle hetergeneous compares */ // Handle hetergeneous compares
if (arg1->dsc_dtype < arg2->dsc_dtype) if (arg1->dsc_dtype < arg2->dsc_dtype)
return (-MOVQ_compare(arg2, arg1)); return (-MOVQ_compare(arg2, arg1));
@ -325,7 +325,7 @@ int MOVQ_compare( DSC * arg1, DSC * arg2)
} }
case dtype_blob: case dtype_blob:
IBERROR(48); /* Msg 48 Blob conversion is not supported */ IBERROR(48); // Msg 48 Blob conversion is not supported
default: default:
mover_error(410, arg1->dsc_dtype, arg2->dsc_dtype); mover_error(410, arg1->dsc_dtype, arg2->dsc_dtype);
@ -536,7 +536,7 @@ double MOVQ_get_double( DSC * desc)
} }
else if (*p == '.') else if (*p == '.')
if (fraction) if (fraction)
IBERROR(52); /* Msg 52 conversion error */ IBERROR(52); // Msg 52 conversion error
else else
fraction = 1; fraction = 1;
else if (!value && *p == '-') else if (!value && *p == '-')
@ -546,7 +546,7 @@ double MOVQ_get_double( DSC * desc)
else if (*p == 'e' || *p == 'E') else if (*p == 'e' || *p == 'E')
break; break;
else if (*p != ' ') else if (*p != ' ')
IBERROR(53); /* Msg 53 conversion error */ IBERROR(53); // Msg 53 conversion error
} }
if (sign) if (sign)
@ -564,7 +564,7 @@ double MOVQ_get_double( DSC * desc)
sign = TRUE; sign = TRUE;
else if (*p == '+' && !exp); else if (*p == '+' && !exp);
else if (*p != ' ') else if (*p != ' ')
IBERROR(54); /* Msg 54 conversion error */ IBERROR(54); // Msg 54 conversion error
} }
if (sign) if (sign)
scale += exp; scale += exp;
@ -842,7 +842,7 @@ if (((ALT_DSC*) from)->dsc_combined_type == ((ALT_DSC*) to)->dsc_combined_type)
((SLONG *) to->dsc_address)[0] = ((SLONG *) from->dsc_address)[0]; ((SLONG *) to->dsc_address)[0] = ((SLONG *) from->dsc_address)[0];
return; return;
case dtype_sql_time: case dtype_sql_time:
/* Error situation */ // Error situation
break; break;
} }
break; break;
@ -863,7 +863,7 @@ if (((ALT_DSC*) from)->dsc_combined_type == ((ALT_DSC*) to)->dsc_combined_type)
((SLONG *) to->dsc_address)[0] = ((SLONG *) from->dsc_address)[1]; ((SLONG *) to->dsc_address)[0] = ((SLONG *) from->dsc_address)[1];
return; return;
case dtype_sql_date: case dtype_sql_date:
/* Error situation */ // Error situation
break; break;
} }
break; break;
@ -949,7 +949,7 @@ if (((ALT_DSC*) from)->dsc_combined_type == ((ALT_DSC*) to)->dsc_combined_type)
case dtype_short: case dtype_short:
*(SSHORT *) p = l = MOVQ_get_long(from, to->dsc_scale); *(SSHORT *) p = l = MOVQ_get_long(from, to->dsc_scale);
if (*(SSHORT *) p != l) if (*(SSHORT *) p != l)
IBERROR(14); /* Msg14 integer overflow */ IBERROR(14); // Msg14 integer overflow
return; return;
case dtype_long: case dtype_long:
@ -966,7 +966,7 @@ if (((ALT_DSC*) from)->dsc_combined_type == ((ALT_DSC*) to)->dsc_combined_type)
} }
if (to->dsc_dtype == dtype_blob || from->dsc_dtype == dtype_blob) if (to->dsc_dtype == dtype_blob || from->dsc_dtype == dtype_blob)
IBERROR(55); /* Msg 55 Blob conversion is not supported */ IBERROR(55); // Msg 55 Blob conversion is not supported
mover_error(410, from->dsc_dtype, to->dsc_dtype); mover_error(410, from->dsc_dtype, to->dsc_dtype);
} }
@ -1249,7 +1249,7 @@ static void numeric_to_text( DSC * from, DSC * to)
(to->dsc_dtype == dtype_cstring && length >= to->dsc_length) || (to->dsc_dtype == dtype_cstring && length >= to->dsc_length) ||
(to->dsc_dtype == dtype_varying (to->dsc_dtype == dtype_varying
&& length > to->dsc_length - sizeof(SSHORT))) && length > to->dsc_length - sizeof(SSHORT)))
IBERROR(57); /* Msg 57 overflow during conversion */ IBERROR(57); // Msg 57 overflow during conversion
q = q =
(TEXT *) ((to->dsc_dtype == dtype_text) ? to->dsc_address : to-> (TEXT *) ((to->dsc_dtype == dtype_text) ? to->dsc_address : to->
@ -1339,7 +1339,7 @@ static void string_to_date( TEXT * string, USHORT length, SLONG date[2])
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
components[i] = 0; components[i] = 0;
/* Parse components */ // Parse components
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
@ -1351,7 +1351,7 @@ static void string_to_date( TEXT * string, USHORT length, SLONG date[2])
if (p == end) if (p == end)
break; break;
/* Handle digit or character strings */ // Handle digit or character strings
c = UPPER(*p); c = UPPER(*p);
if (DIGIT(c)) { if (DIGIT(c)) {
@ -1436,7 +1436,7 @@ static void string_to_date( TEXT * string, USHORT length, SLONG date[2])
times.tm_mday = components[1]; times.tm_mday = components[1];
} }
/* Handle defaulting of year */ // Handle defaulting of year
if (((times.tm_year = components[2]) == 0) && !year) if (((times.tm_year = components[2]) == 0) && !year)
times.tm_year = today->tm_year + 1900; times.tm_year = today->tm_year + 1900;
@ -1501,7 +1501,7 @@ static void string_to_time( TEXT * string, USHORT length, SLONG date[2])
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
components[i] = 0; components[i] = 0;
/* Parse components */ // Parse components
for (i = 3; i < 7; i++) { for (i = 3; i < 7; i++) {
@ -1513,7 +1513,7 @@ static void string_to_time( TEXT * string, USHORT length, SLONG date[2])
if (p == end) if (p == end)
break; break;
/* Handle digit or character strings */ // Handle digit or character strings
c = UPPER(*p); c = UPPER(*p);
if (DIGIT(c)) { if (DIGIT(c)) {

View File

@ -27,7 +27,7 @@
#include <string.h> #include <string.h>
#define PARSER_MAIN #define PARSER_MAIN
#include "../qli/dtr.h" #include "../qli/dtr.h"
#include "../qli/exe.h" /* This is only included to suppress a compiler warning */ #include "../qli/exe.h" // This is only included to suppress a compiler warning
#include "../qli/parse.h" #include "../qli/parse.h"
#include "../qli/compile.h" #include "../qli/compile.h"
#include "../qli/report.h" #include "../qli/report.h"
@ -172,7 +172,7 @@ The following flags are:
*/ */
static USHORT sql_flag, else_count, sw_report, sw_statement, sw_sql_view; static USHORT sql_flag, else_count, sw_report, sw_statement, sw_sql_view;
static SSHORT function_count; /* indicates the depth of UDF calls */ static SSHORT function_count; // indicates the depth of UDF calls
static struct nod_types { static struct nod_types {
KWWORDS nod_t_keyword; KWWORDS nod_t_keyword;
@ -394,7 +394,7 @@ void PAR_token(void)
if (MATCH(KW_COLON)) { if (MATCH(KW_COLON)) {
if (!QLI_databases) { if (!QLI_databases) {
ERRQ_error_format(159, NULL, NULL, NULL, NULL, NULL); /* Msg159 no databases are ready */ ERRQ_error_format(159, NULL, NULL, NULL, NULL, NULL); // Msg159 no databases are ready
ERRQ_pending(); ERRQ_pending();
LEX_token(); LEX_token();
} }
@ -426,7 +426,7 @@ static void check_end(void)
return; return;
} }
SYNTAX_ERROR(161); /* Msg161 end of statement */ SYNTAX_ERROR(161); // Msg161 end of statement
} }
@ -448,7 +448,7 @@ static void command_end(void)
return; return;
} }
SYNTAX_ERROR(162); /* Msg162 end of command */ SYNTAX_ERROR(162); // Msg162 end of command
} }
@ -711,7 +711,7 @@ static SYN parse_accept(void)
* Parse form update statement. * Parse form update statement.
* *
**************************************/ **************************************/
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
return 0; return 0;
} }
@ -938,13 +938,13 @@ static DBB parse_database(void)
database = (DBB) db_symbol->sym_object; database = (DBB) db_symbol->sym_object;
PAR_real_token(); PAR_real_token();
if (!MATCH(KW_DOT)) if (!MATCH(KW_DOT))
SYNTAX_ERROR(158); /* Msg158 period in qualified name */ SYNTAX_ERROR(158); // Msg158 period in qualified name
PAR_real(); PAR_real();
return database; return database;
} }
if (!QLI_databases) if (!QLI_databases)
IBERROR(159); /* Msg159 no databases are ready */ IBERROR(159); // Msg159 no databases are ready
return NULL; return NULL;
} }
@ -996,12 +996,12 @@ static SYN parse_declare(void)
case KW_CHAR: case KW_CHAR:
case KW_VARYING: case KW_VARYING:
if (dtype) if (dtype)
SYNTAX_ERROR(164); /* Msg164 variable definition clause */ SYNTAX_ERROR(164); // Msg164 variable definition clause
dtype = parse_dtype(&length, &scale); dtype = parse_dtype(&length, &scale);
break; break;
case KW_BLOB: case KW_BLOB:
IBERROR(160); /* Msg160 blob variables are not supported */ IBERROR(160); // Msg160 blob variables are not supported
break; break;
case KW_SUB_TYPE: case KW_SUB_TYPE:
@ -1012,7 +1012,7 @@ static SYN parse_declare(void)
case KW_EDIT_STRING: case KW_EDIT_STRING:
PAR_token(); PAR_token();
if (QLI_token->tok_type != tok_quoted) if (QLI_token->tok_type != tok_quoted)
SYNTAX_ERROR(163); /* Msg163 quoted edit string */ SYNTAX_ERROR(163); // Msg163 quoted edit string
edit_string = edit_string =
make_string(QLI_token->tok_string + 1, make_string(QLI_token->tok_string + 1,
QLI_token->tok_length - 2); QLI_token->tok_length - 2);
@ -1023,7 +1023,7 @@ static SYN parse_declare(void)
PAR_token(); PAR_token();
MATCH(KW_IS); MATCH(KW_IS);
if (QLI_token->tok_type != tok_ident) if (QLI_token->tok_type != tok_ident)
SYNTAX_ERROR(199); /* Msg199 identifier */ SYNTAX_ERROR(199); // Msg199 identifier
query_name = parse_symbol(); query_name = parse_symbol();
break; break;
@ -1039,7 +1039,7 @@ static SYN parse_declare(void)
break; break;
default: default:
SYNTAX_ERROR(164); /* Msg164 variable definition clause */ SYNTAX_ERROR(164); // Msg164 variable definition clause
break; break;
} }
} }
@ -1060,9 +1060,9 @@ static SYN parse_declare(void)
} }
if (!dtype && !field_node) if (!dtype && !field_node)
SYNTAX_ERROR(167); /* Msg167 variable data type */ SYNTAX_ERROR(167); // Msg167 variable data type
if (field_node && (dtype || length || scale)) if (field_node && (dtype || length || scale))
IBERROR(168); /* Msg168 no datatype may be specified for a variable based on a field */ IBERROR(168); // Msg168 no datatype may be specified for a variable based on a field
node = SYNTAX_NODE(nod_declare, 2); node = SYNTAX_NODE(nod_declare, 2);
global_variable = (QLI_FLD) ALLOCDV(type_fld, length); global_variable = (QLI_FLD) ALLOCDV(type_fld, length);
@ -1127,7 +1127,7 @@ static SYN parse_define(void)
if (MATCH(KW_INDEX)) if (MATCH(KW_INDEX))
return parse_def_index(); return parse_def_index();
SYNTAX_ERROR(169); /* Msg169 object type for DEFINE */ SYNTAX_ERROR(169); // Msg169 object type for DEFINE
return NULL; return NULL;
} }
@ -1154,7 +1154,7 @@ static SYN parse_def_index(void)
MATCH(KW_FOR); MATCH(KW_FOR);
if (!(node->syn_arg[s_dfi_relation] = (SYN) parse_qualified_relation())) if (!(node->syn_arg[s_dfi_relation] = (SYN) parse_qualified_relation()))
SYNTAX_ERROR(170); /* Msg170 relation name */ SYNTAX_ERROR(170); // Msg170 relation name
PAR_real(); PAR_real();
@ -1240,7 +1240,7 @@ static SYN parse_def_relation(void)
if (KEYWORD(KW_SEMI)) if (KEYWORD(KW_SEMI))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(171); /* Msg171 comma between field definitions */ SYNTAX_ERROR(171); // Msg171 comma between field definitions
} }
} }
@ -1267,7 +1267,7 @@ static SYN parse_delete(void)
++sql_flag; ++sql_flag;
if (!MATCH(KW_FROM)) if (!MATCH(KW_FROM))
SYNTAX_ERROR(172); /* Msg172 FROM */ SYNTAX_ERROR(172); // Msg172 FROM
node = SYNTAX_NODE(nod_erase, s_era_count); node = SYNTAX_NODE(nod_erase, s_era_count);
node->syn_arg[s_era_rse] = rse = node->syn_arg[s_era_rse] = rse =
@ -1310,7 +1310,7 @@ static SYN parse_drop(void)
if (MATCH(KW_RELATION) || MATCH(KW_VIEW) || MATCH(KW_TABLE)) { if (MATCH(KW_RELATION) || MATCH(KW_VIEW) || MATCH(KW_TABLE)) {
node = SYNTAX_NODE(nod_del_relation, 1); node = SYNTAX_NODE(nod_del_relation, 1);
if (!(node->syn_arg[0] = (SYN) parse_qualified_relation())) if (!(node->syn_arg[0] = (SYN) parse_qualified_relation()))
SYNTAX_ERROR(173); /* Msg173 relation or view name */ SYNTAX_ERROR(173); // Msg173 relation or view name
return node; return node;
} }
@ -1330,7 +1330,7 @@ static SYN parse_drop(void)
case KW_DATABASE: case KW_DATABASE:
LEX_filename(); LEX_filename();
if (!(l = QLI_token->tok_length)) if (!(l = QLI_token->tok_length))
ERRQ_error(429, NULL, NULL, NULL, NULL, NULL); /* Msg429 database file name required on DROP DATABASE */ ERRQ_error(429, NULL, NULL, NULL, NULL, NULL); // Msg429 database file name required on DROP DATABASE
q = QLI_token->tok_string; q = QLI_token->tok_string;
if (QLI_token->tok_type == tok_quoted) { if (QLI_token->tok_type == tok_quoted) {
l -= 2; l -= 2;
@ -1344,7 +1344,7 @@ static SYN parse_drop(void)
while (--l); while (--l);
PAR_token(); PAR_token();
/* parse an optional user name and password if given */ // parse an optional user name and password if given
for (;;) { for (;;) {
if (MATCH(KW_USER)) if (MATCH(KW_USER))
@ -1521,7 +1521,7 @@ static SYN parse_edit(void)
if (KEYWORD(KW_SEMI) || if (KEYWORD(KW_SEMI) ||
(QLI_token->tok_type == tok_number) || (KEYWORD(KW_ASTERISK))) { (QLI_token->tok_type == tok_number) || (KEYWORD(KW_ASTERISK))) {
if (!(statement_list = LEX_statement_list())) if (!(statement_list = LEX_statement_list()))
IBERROR(176); /* Msg176 No statements issued yet */ IBERROR(176); // Msg176 No statements issued yet
if (MATCH(KW_ASTERISK)) if (MATCH(KW_ASTERISK))
LEX_edit((SLONG) 0, (SLONG) statement_list->lls_object); LEX_edit((SLONG) 0, (SLONG) statement_list->lls_object);
@ -1539,7 +1539,7 @@ static SYN parse_edit(void)
} }
#ifdef PYXIS #ifdef PYXIS
else if (MATCH(KW_FORM)) else if (MATCH(KW_FORM))
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
#endif #endif
else { else {
type = nod_edit_proc; type = nod_edit_proc;
@ -1687,7 +1687,7 @@ static QLI_FLD parse_field( int global_flag)
case KW_VARYING: case KW_VARYING:
case KW_BLOB: case KW_BLOB:
if (dtype) if (dtype)
SYNTAX_ERROR(179); /* Msg179 field definition clause */ SYNTAX_ERROR(179); // Msg179 field definition clause
dtype = parse_dtype(&length, &scale); dtype = parse_dtype(&length, &scale);
break; break;
@ -1699,7 +1699,7 @@ static QLI_FLD parse_field( int global_flag)
case KW_EDIT_STRING: case KW_EDIT_STRING:
PAR_token(); PAR_token();
if (QLI_token->tok_type != tok_quoted) if (QLI_token->tok_type != tok_quoted)
SYNTAX_ERROR(178); /* Msg178 quoted edit string */ SYNTAX_ERROR(178); // Msg178 quoted edit string
edit_string = edit_string =
make_string(QLI_token->tok_string + 1, make_string(QLI_token->tok_string + 1,
QLI_token->tok_length - 2); QLI_token->tok_length - 2);
@ -1710,7 +1710,7 @@ static QLI_FLD parse_field( int global_flag)
PAR_token(); PAR_token();
MATCH(KW_IS); MATCH(KW_IS);
if (QLI_token->tok_type != tok_ident) if (QLI_token->tok_type != tok_ident)
SYNTAX_ERROR(199); /* Msg199 identifier */ SYNTAX_ERROR(199); // Msg199 identifier
query_name = parse_symbol(); query_name = parse_symbol();
break; break;
@ -1721,7 +1721,7 @@ static QLI_FLD parse_field( int global_flag)
break; break;
default: default:
SYNTAX_ERROR(179); /* Msg179 field definition clause */ SYNTAX_ERROR(179); // Msg179 field definition clause
break; break;
} }
} }
@ -1739,7 +1739,7 @@ static QLI_FLD parse_field( int global_flag)
if (!global_flag) if (!global_flag)
field->fld_based = based_on; field->fld_based = based_on;
else if (based_on) else if (based_on)
IBERROR(180); /* Msg180 global fields may not be based on other fields */ IBERROR(180); // Msg180 global fields may not be based on other fields
return field; return field;
} }
@ -1766,7 +1766,7 @@ static SYN parse_field_name( SYN * fld_ptr)
while (TRUE) { while (TRUE) {
if (MATCH(KW_ASTERISK)) { if (MATCH(KW_ASTERISK)) {
if (!stack) if (!stack)
SYNTAX_ERROR(181); /* Msg181 field name or asterisk expression */ SYNTAX_ERROR(181); // Msg181 field name or asterisk expression
field = make_list(stack); field = make_list(stack);
field->syn_type = nod_star; field->syn_type = nod_star;
return field; return field;
@ -1783,7 +1783,7 @@ static SYN parse_field_name( SYN * fld_ptr)
if (!(MATCH(KW_L_BRCKET))) if (!(MATCH(KW_L_BRCKET)))
return field; return field;
/* Parse an array reference */ // Parse an array reference
stack = NULL; stack = NULL;
for (;;) { for (;;) {
@ -1791,7 +1791,7 @@ static SYN parse_field_name( SYN * fld_ptr)
if (MATCH(KW_R_BRCKET)) if (MATCH(KW_R_BRCKET))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(183); /* Msg183 comma */ SYNTAX_ERROR(183); // Msg183 comma
} }
node = SYNTAX_NODE(nod_index, s_idx_count); node = SYNTAX_NODE(nod_index, s_idx_count);
@ -1819,7 +1819,7 @@ static SYN parse_for(void)
PAR_token(); PAR_token();
#ifdef PYXIS #ifdef PYXIS
if (MATCH(KW_FORM)) if (MATCH(KW_FORM))
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
#endif #endif
node = SYNTAX_NODE(nod_for, s_for_count); node = SYNTAX_NODE(nod_for, s_for_count);
node->syn_arg[s_for_rse] = parse_rse(); node->syn_arg[s_for_rse] = parse_rse();
@ -1841,7 +1841,7 @@ static SYN parse_form(void)
* Parse qualified form name, returning a form block. * Parse qualified form name, returning a form block.
* *
**************************************/ **************************************/
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
} }
#endif #endif
@ -1865,7 +1865,7 @@ static SYN parse_from( USHORT * paren_count, USHORT * bool_flag)
value = parse_primitive_value(0, 0); value = parse_primitive_value(0, 0);
PAR_real(); PAR_real();
if (!MATCH(KW_FROM)) if (!MATCH(KW_FROM))
SYNTAX_ERROR(182); /* Msg182 FROM rse clause */ SYNTAX_ERROR(182); // Msg182 FROM rse clause
} }
else { else {
value = parse_primitive_value(paren_count, bool_flag); value = parse_primitive_value(paren_count, bool_flag);
@ -1912,7 +1912,7 @@ static SYN parse_function(void)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(183); /* Msg183 comma */ SYNTAX_ERROR(183); // Msg183 comma
} }
node->syn_arg[s_fun_args] = make_list(stack); node->syn_arg[s_fun_args] = make_list(stack);
@ -1943,7 +1943,7 @@ static TEXT *parse_header(void)
while (TRUE) { while (TRUE) {
PAR_real(); PAR_real();
if ((QLI_token->tok_keyword != KW_MINUS) && if ((QLI_token->tok_keyword != KW_MINUS) &&
(QLI_token->tok_type != tok_quoted)) SYNTAX_ERROR(184); /* Msg184 quoted header segment */ (QLI_token->tok_type != tok_quoted)) SYNTAX_ERROR(184); // Msg184 quoted header segment
q = QLI_token->tok_string; q = QLI_token->tok_string;
while (*q) while (*q)
*p++ = *q++; *p++ = *q++;
@ -2039,9 +2039,9 @@ static SYN parse_in( SYN value, NOD_T operatr, USHORT all_flag)
PAR_real(); PAR_real();
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(185); /* Msg185 left parenthesis */ SYNTAX_ERROR(185); // Msg185 left parenthesis
/* Time to chose between two forms of the expression */ // Time to chose between two forms of the expression
if (!MATCH(KW_SELECT)) { if (!MATCH(KW_SELECT)) {
node = SYNTAX_NODE(operatr, 2); node = SYNTAX_NODE(operatr, 2);
@ -2101,7 +2101,7 @@ static SYN parse_insert(void)
MATCH(KW_INTO); MATCH(KW_INTO);
node = SYNTAX_NODE(nod_store, s_sto_count); node = SYNTAX_NODE(nod_store, s_sto_count);
/* Pick up relation name for insert */ // Pick up relation name for insert
node->syn_arg[s_sto_relation] = parse_sql_relation(); node->syn_arg[s_sto_relation] = parse_sql_relation();
@ -2116,22 +2116,22 @@ static SYN parse_insert(void)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(186); /* Msg186 comma or terminating right parenthesis */ SYNTAX_ERROR(186); // Msg186 comma or terminating right parenthesis
} }
/* Pick up value list or SELECT statement */ // Pick up value list or SELECT statement
PAR_real(); PAR_real();
if (MATCH(KW_VALUES)) { if (MATCH(KW_VALUES)) {
select_flag = FALSE; select_flag = FALSE;
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(187); /* Msg187 left parenthesis */ SYNTAX_ERROR(187); // Msg187 left parenthesis
} }
else if (MATCH(KW_SELECT)) else if (MATCH(KW_SELECT))
select_flag = TRUE; select_flag = TRUE;
else else
SYNTAX_ERROR(188); /* Msg188 VALUES list or SELECT clause */ SYNTAX_ERROR(188); // Msg188 VALUES list or SELECT clause
while (TRUE) { while (TRUE) {
@ -2195,7 +2195,7 @@ static NOD_T parse_join_type(void)
MATCH(KW_OUTER); MATCH(KW_OUTER);
if (!MATCH(KW_JOIN)) if (!MATCH(KW_JOIN))
SYNTAX_ERROR(489); /* Msg489 JOIN */ SYNTAX_ERROR(489); // Msg489 JOIN
return operatr; return operatr;
} }
@ -2296,7 +2296,7 @@ static CON parse_literal(void)
constant = make_numeric_constant(QLI_token->tok_string, constant = make_numeric_constant(QLI_token->tok_string,
QLI_token->tok_length); QLI_token->tok_length);
else else
SYNTAX_ERROR(190); /* Msg190 value expression */ SYNTAX_ERROR(190); // Msg190 value expression
PAR_token(); PAR_token();
@ -2356,7 +2356,7 @@ static void parse_matching_paren(void)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
return; return;
SYNTAX_ERROR(191); /* Msg191 right parenthesis */ SYNTAX_ERROR(191); // Msg191 right parenthesis
} }
@ -2378,7 +2378,7 @@ static SYN parse_menu(void)
PAR_real_token(); PAR_real_token();
if (QLI_token->tok_type != tok_quoted) if (QLI_token->tok_type != tok_quoted)
SYNTAX_ERROR(192); /* Msg192 quoted string */ SYNTAX_ERROR(192); // Msg192 quoted string
node = SYNTAX_NODE(nod_menu, s_men_count); node = SYNTAX_NODE(nod_menu, s_men_count);
node->syn_arg[s_men_string] = parse_primitive_value(0, 0); node->syn_arg[s_men_string] = parse_primitive_value(0, 0);
@ -2387,9 +2387,9 @@ static SYN parse_menu(void)
while (!MATCH(KW_END)) { while (!MATCH(KW_END)) {
if (!MATCH(KW_ENTREE)) if (!MATCH(KW_ENTREE))
SYNTAX_ERROR(193); /* Msg193 ENTREE or END */ SYNTAX_ERROR(193); // Msg193 ENTREE or END
if (QLI_token->tok_type != tok_quoted) if (QLI_token->tok_type != tok_quoted)
SYNTAX_ERROR(194); /* Msg194 quoted string */ SYNTAX_ERROR(194); // Msg194 quoted string
LLS_PUSH(parse_primitive_value(0, 0), &labels); LLS_PUSH(parse_primitive_value(0, 0), &labels);
MATCH(KW_COLON); MATCH(KW_COLON);
LLS_PUSH(parse_statement(), &statements); LLS_PUSH(parse_statement(), &statements);
@ -2447,7 +2447,7 @@ static SYN parse_modify(void)
if (MATCH(KW_USING)) if (MATCH(KW_USING))
#if PYXIS #if PYXIS
if (MATCH(KW_FORM)) if (MATCH(KW_FORM))
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
else else
#endif #endif
node->syn_arg[s_mod_statement] = parse_statement(); node->syn_arg[s_mod_statement] = parse_statement();
@ -2513,7 +2513,7 @@ static SYN parse_modify_index(void)
} }
if (!node->syn_flags) if (!node->syn_flags)
SYNTAX_ERROR(195); /* Msg195 index state option */ SYNTAX_ERROR(195); // Msg195 index state option
command_end(); command_end();
@ -2542,7 +2542,7 @@ static SYN parse_modify_relation(void)
node->syn_arg[0] = (SYN) relation; node->syn_arg[0] = (SYN) relation;
if (!relation) if (!relation)
SYNTAX_ERROR(196); /* Msg196 relation name */ SYNTAX_ERROR(196); // Msg196 relation name
for (;;) { for (;;) {
PAR_real(); PAR_real();
@ -2570,7 +2570,7 @@ static SYN parse_modify_relation(void)
if (KEYWORD(KW_SEMI)) if (KEYWORD(KW_SEMI))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(198); /* Msg198 comma between field definitions */ SYNTAX_ERROR(198); // Msg198 comma between field definitions
} }
command_end(); command_end();
@ -2630,7 +2630,7 @@ static NAM parse_name(void)
PAR_real(); PAR_real();
if (QLI_token->tok_type != tok_ident) if (QLI_token->tok_type != tok_ident)
SYNTAX_ERROR(199); /* Msg199 identifier */ SYNTAX_ERROR(199); // Msg199 identifier
l = QLI_token->tok_length; l = QLI_token->tok_length;
name = (NAM) ALLOCDV(type_nam, l); name = (NAM) ALLOCDV(type_nam, l);
@ -2693,11 +2693,11 @@ static int parse_ordinal(void)
PAR_real(); PAR_real();
if (QLI_token->tok_type != tok_number) if (QLI_token->tok_type != tok_number)
SYNTAX_ERROR(200); /* Msg200 positive number */ SYNTAX_ERROR(200); // Msg200 positive number
n = atoi(QLI_token->tok_string); n = atoi(QLI_token->tok_string);
if (n < 0) if (n < 0)
SYNTAX_ERROR(200); /* Msg200 positive number */ SYNTAX_ERROR(200); // Msg200 positive number
PAR_token(); PAR_token();
return n; return n;
@ -2838,7 +2838,7 @@ static SYN parse_primitive_value( USHORT * paren_count, USHORT * bool_flag)
case KW_RUNNING: case KW_RUNNING:
if (function_count > 0) if (function_count > 0)
IBERROR(487); /* Msg487 Invalid argument for UDF */ IBERROR(487); // Msg487 Invalid argument for UDF
PAR_real_token(); PAR_real_token();
node = SYNTAX_NODE(nod_running_total, s_stt_count); node = SYNTAX_NODE(nod_running_total, s_stt_count);
if (MATCH(KW_COUNT)) if (MATCH(KW_COUNT))
@ -2987,7 +2987,7 @@ static SYN parse_print(void)
} }
if (!node->syn_arg[s_prt_list] && MATCH(KW_USING)) { if (!node->syn_arg[s_prt_list] && MATCH(KW_USING)) {
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
} }
else else
node->syn_arg[s_prt_output] = parse_output(); node->syn_arg[s_prt_output] = parse_output();
@ -3138,7 +3138,7 @@ static QLI_REL parse_qualified_relation(void)
&& db_symbol->sym_type == SYM_database) { && db_symbol->sym_type == SYM_database) {
PAR_real_token(); PAR_real_token();
if (!MATCH(KW_DOT)) if (!MATCH(KW_DOT))
SYNTAX_ERROR(202); /* Msg202 period in qualified relation name */ SYNTAX_ERROR(202); // Msg202 period in qualified relation name
PAR_real(); PAR_real();
if (relation = resolve_relation(db_symbol, QLI_token->tok_symbol)) { if (relation = resolve_relation(db_symbol, QLI_token->tok_symbol)) {
PAR_token(); PAR_token();
@ -3181,7 +3181,7 @@ static SYN parse_ready( NOD_T node_type)
while (TRUE) { while (TRUE) {
LEX_filename(); LEX_filename();
if (!(l = QLI_token->tok_length)) if (!(l = QLI_token->tok_length))
ERRQ_error(204, NULL, NULL, NULL, NULL, NULL); /* Msg204 database file name required on READY */ ERRQ_error(204, NULL, NULL, NULL, NULL, NULL); // Msg204 database file name required on READY
q = QLI_token->tok_string; q = QLI_token->tok_string;
if (QLI_token->tok_type == tok_quoted) { if (QLI_token->tok_type == tok_quoted) {
l -= 2; l -= 2;
@ -3200,7 +3200,7 @@ static SYN parse_ready( NOD_T node_type)
name = parse_name(); name = parse_name();
database->dbb_symbol = (SYM) name; database->dbb_symbol = (SYM) name;
if (HSH_lookup(name->nam_string, name->nam_length)) if (HSH_lookup(name->nam_string, name->nam_length))
ERRQ_error(408, name->nam_string, NULL, NULL, NULL, NULL); /* Database handle is not unique */ ERRQ_error(408, name->nam_string, NULL, NULL, NULL, NULL); // Database handle is not unique
} }
else else
database->dbb_symbol = (SYM) make_name(); database->dbb_symbol = (SYM) make_name();
@ -3208,7 +3208,7 @@ static SYN parse_ready( NOD_T node_type)
else if (node_type == nod_sql_database) { else if (node_type == nod_sql_database) {
if (MATCH(KW_PAGESIZE)) { if (MATCH(KW_PAGESIZE)) {
if (database->dbb_pagesize) if (database->dbb_pagesize)
SYNTAX_ERROR(390); /* Msg390 Multiple page size specifications */ SYNTAX_ERROR(390); // Msg390 Multiple page size specifications
if (!MATCH(KW_EQUALS)) if (!MATCH(KW_EQUALS))
SYNTAX_ERROR(396); /* Msg396 = (equals) */ SYNTAX_ERROR(396); /* Msg396 = (equals) */
database->dbb_pagesize = parse_ordinal(); database->dbb_pagesize = parse_ordinal();
@ -3400,7 +3400,7 @@ static SYN parse_relational( USHORT * paren_count)
for (rel_ops = relationals; *rel_ops != (NOD_T) 0; rel_ops++) for (rel_ops = relationals; *rel_ops != (NOD_T) 0; rel_ops++)
if (expr1->syn_type == *rel_ops) if (expr1->syn_type == *rel_ops)
return expr1; return expr1;
SYNTAX_ERROR(206); /* Msg206 relational operatr */ SYNTAX_ERROR(206); // Msg206 relational operatr
} }
/* If we haven't already built a node, it must be an ordinary binary operatr. /* If we haven't already built a node, it must be an ordinary binary operatr.
@ -3472,12 +3472,12 @@ static SYN parse_relation(void)
node->syn_arg[s_rel_context] = (SYN) context; node->syn_arg[s_rel_context] = (SYN) context;
if (sql_flag || !MATCH(KW_IN)) { if (sql_flag || !MATCH(KW_IN)) {
if (!QLI_databases) if (!QLI_databases)
IBERROR(207); /* Msg207 a database has not been readied */ IBERROR(207); // Msg207 a database has not been readied
ERRQ_print_error(208, context->sym_string, NULL, NULL, NULL, NULL); /* Msg208 expected \"relation_name\", encountered \"%s\ */ ERRQ_print_error(208, context->sym_string, NULL, NULL, NULL, NULL); /* Msg208 expected \"relation_name\", encountered \"%s\ */
} }
if (! if (!
(node->syn_arg[s_rel_relation] = (node->syn_arg[s_rel_relation] =
(SYN) parse_qualified_relation()))SYNTAX_ERROR(209); /* Msg209 relation name */ (SYN) parse_qualified_relation()))SYNTAX_ERROR(209); // Msg209 relation name
} }
return node; return node;
@ -3501,7 +3501,7 @@ static SYN parse_rename(void)
PAR_real_token(); PAR_real_token();
if (!MATCH(KW_PROCEDURE)) if (!MATCH(KW_PROCEDURE))
SYNTAX_ERROR(210); /* Msg210 PROCEDURE */ SYNTAX_ERROR(210); // Msg210 PROCEDURE
node = SYNTAX_NODE(nod_rename_proc, 2); node = SYNTAX_NODE(nod_rename_proc, 2);
node->syn_arg[0] = (SYN) parse_qualified_procedure(); node->syn_arg[0] = (SYN) parse_qualified_procedure();
@ -3559,12 +3559,12 @@ static SYN parse_report(void)
node = SYNTAX_NODE(nod_report, s_prt_count); node = SYNTAX_NODE(nod_report, s_prt_count);
node->syn_arg[s_prt_list] = (SYN) report; node->syn_arg[s_prt_list] = (SYN) report;
/* Pick up record select expression */ // Pick up record select expression
rse = node->syn_arg[s_prt_rse] = parse_rse(); rse = node->syn_arg[s_prt_rse] = parse_rse();
node->syn_arg[s_prt_output] = parse_output(); node->syn_arg[s_prt_output] = parse_output();
/* Pick up report clauses */ // Pick up report clauses
for (;;) { for (;;) {
PAR_real(); PAR_real();
@ -3583,7 +3583,7 @@ static SYN parse_report(void)
else if (MATCH(KW_BOTTOM)) else if (MATCH(KW_BOTTOM))
top = FALSE; top = FALSE;
else else
SYNTAX_ERROR(382); /* Msg382 TOP or BOTTOM */ SYNTAX_ERROR(382); // Msg382 TOP or BOTTOM
MATCH(KW_OF); MATCH(KW_OF);
if (MATCH(KW_REPORT)) { if (MATCH(KW_REPORT)) {
control = (BRK) ALLOCD(type_brk); control = (BRK) ALLOCD(type_brk);
@ -3610,7 +3610,7 @@ static SYN parse_report(void)
of control breaks based on sorted fields and then add action (print) of control breaks based on sorted fields and then add action (print)
items to that list. */ items to that list. */
if (!(flds = rse->syn_arg[s_rse_sort])) if (!(flds = rse->syn_arg[s_rse_sort]))
SYNTAX_ERROR(383); /* Msg383 sort field */ SYNTAX_ERROR(383); // Msg383 sort field
tmpptr = *ptr; tmpptr = *ptr;
for (i = 0; i < flds->syn_count; i += 2) { for (i = 0; i < flds->syn_count; i += 2) {
control = (BRK) ALLOCD(type_brk); control = (BRK) ALLOCD(type_brk);
@ -3656,7 +3656,7 @@ static SYN parse_report(void)
break; break;
} }
if (!control) if (!control)
SYNTAX_ERROR(383); /* Msg383 sort field */ SYNTAX_ERROR(383); // Msg383 sort field
MATCH(KW_PRINT); MATCH(KW_PRINT);
control->brk_field = qli_fld; control->brk_field = qli_fld;
control->brk_line = parse_print_list(); control->brk_line = parse_print_list();
@ -3678,11 +3678,11 @@ static SYN parse_report(void)
report->rpt_name = (TEXT *) parse_header(); report->rpt_name = (TEXT *) parse_header();
} }
else else
SYNTAX_ERROR(212); /* Msg212 report writer SET option */ SYNTAX_ERROR(212); // Msg212 report writer SET option
break; break;
default: default:
SYNTAX_ERROR(213); /* Msg213 report item */ SYNTAX_ERROR(213); // Msg213 report item
} }
MATCH(KW_SEMI); MATCH(KW_SEMI);
} }
@ -3750,7 +3750,7 @@ static SYN parse_rse(void)
while (stack) while (stack)
*--ptr = (SYN) LLS_POP(&stack); *--ptr = (SYN) LLS_POP(&stack);
/* Pick up various other clauses */ // Pick up various other clauses
while (TRUE) { while (TRUE) {
if (MATCH(KW_WITH)) { if (MATCH(KW_WITH)) {
@ -3759,7 +3759,7 @@ static SYN parse_rse(void)
node->syn_arg[s_rse_boolean] = parse_boolean(0); node->syn_arg[s_rse_boolean] = parse_boolean(0);
} }
else else
IBERROR(384); /* Msg384 Too many WITHs */ IBERROR(384); // Msg384 Too many WITHs
} }
else if (MATCH(KW_SORTED)) { else if (MATCH(KW_SORTED)) {
@ -3823,7 +3823,7 @@ static SYN parse_select(void)
if (!MATCH(KW_ALL) && MATCH(KW_DISTINCT)) if (!MATCH(KW_ALL) && MATCH(KW_DISTINCT))
node->syn_arg[s_prt_distinct] = INT_CAST TRUE; node->syn_arg[s_prt_distinct] = INT_CAST TRUE;
/* Get list of items */ // Get list of items
if (!MATCH(KW_ASTERISK)) { if (!MATCH(KW_ASTERISK)) {
stack = NULL; stack = NULL;
@ -3917,7 +3917,7 @@ static SYN parse_set(void)
#ifdef PYXIS #ifdef PYXIS
case KW_FORM: case KW_FORM:
case KW_FORMS: case KW_FORMS:
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
break; break;
#endif #endif
case KW_MATCHING_LANGUAGE: case KW_MATCHING_LANGUAGE:
@ -3961,7 +3961,7 @@ static SYN parse_set(void)
sw = set_charset; sw = set_charset;
PAR_token(); PAR_token();
MATCH(KW_SET); MATCH(KW_SET);
if (value) { /* allow for NO */ if (value) { // allow for NO
MATCH(KW_EQUALS); MATCH(KW_EQUALS);
value = (U_IPTR) parse_name(); value = (U_IPTR) parse_name();
} }
@ -3988,7 +3988,7 @@ static SYN parse_set(void)
#endif #endif
default: default:
SYNTAX_ERROR(214); /* Msg214 set option */ SYNTAX_ERROR(214); // Msg214 set option
} }
LLS_PUSH(sw, &stack); LLS_PUSH(sw, &stack);
LLS_PUSH(value, &stack); LLS_PUSH(value, &stack);
@ -4075,7 +4075,7 @@ static SYN parse_show(void)
sw = show_version; sw = show_version;
else if (MATCH(KW_RELATION)) { else if (MATCH(KW_RELATION)) {
if (!(value = (BLK) parse_qualified_relation())) if (!(value = (BLK) parse_qualified_relation()))
SYNTAX_ERROR(216); /* Msg216 relation name */ SYNTAX_ERROR(216); // Msg216 relation name
else else
sw = show_relation; sw = show_relation;
} }
@ -4114,13 +4114,13 @@ static SYN parse_show(void)
if (value = (BLK) get_dbb(QLI_token->tok_symbol)) if (value = (BLK) get_dbb(QLI_token->tok_symbol))
PAR_token(); PAR_token();
else else
SYNTAX_ERROR(221); /* Msg221 database name */ SYNTAX_ERROR(221); // Msg221 database name
sw = show_db_fields; sw = show_db_fields;
} }
else { else {
MATCH(KW_RELATION); MATCH(KW_RELATION);
if (!(value = (BLK) parse_qualified_relation())) if (!(value = (BLK) parse_qualified_relation()))
SYNTAX_ERROR(218); /* Msg218 relation name */ SYNTAX_ERROR(218); // Msg218 relation name
else else
sw = show_relation; sw = show_relation;
} }
@ -4135,11 +4135,11 @@ static SYN parse_show(void)
if (value = (BLK) get_dbb(QLI_token->tok_symbol)) if (value = (BLK) get_dbb(QLI_token->tok_symbol))
PAR_token(); PAR_token();
else else
SYNTAX_ERROR(221); /* Msg221 database name */ SYNTAX_ERROR(221); // Msg221 database name
sw = show_db_indices; sw = show_db_indices;
} }
else if (!(value = (BLK) parse_qualified_relation())) else if (!(value = (BLK) parse_qualified_relation()))
SYNTAX_ERROR(220); /* Msg220 relation name */ SYNTAX_ERROR(220); // Msg220 relation name
} }
else if (MATCH(KW_SECURITY_CLASS)) { else if (MATCH(KW_SECURITY_CLASS)) {
sw = show_security_class; sw = show_security_class;
@ -4152,7 +4152,7 @@ static SYN parse_show(void)
if (value = (BLK) get_dbb(QLI_token->tok_symbol)) if (value = (BLK) get_dbb(QLI_token->tok_symbol))
PAR_token(); PAR_token();
else else
SYNTAX_ERROR(221); /* Msg221 database name */ SYNTAX_ERROR(221); // Msg221 database name
} }
else { else {
MATCH(KW_RELATION); MATCH(KW_RELATION);
@ -4176,7 +4176,7 @@ static SYN parse_show(void)
KEYWORD(KW_SEMI) || KEYWORD(KW_FOR)) KEYWORD(KW_SEMI) || KEYWORD(KW_FOR))
sw = show_system_relations; sw = show_system_relations;
else else
SYNTAX_ERROR(215); /* Msg215 RELATIONS or TRIGGERS */ SYNTAX_ERROR(215); // Msg215 RELATIONS or TRIGGERS
} }
else if (MATCH(KW_PROCEDURES)) else if (MATCH(KW_PROCEDURES))
sw = show_procedures; sw = show_procedures;
@ -4229,7 +4229,7 @@ static SYN parse_show(void)
KEYWORD(KW_SEMI) || KEYWORD(KW_FOR)) KEYWORD(KW_SEMI) || KEYWORD(KW_FOR))
sw = show_system_relations; sw = show_system_relations;
else else
SYNTAX_ERROR(215); /* Msg215 RELATIONS or TRIGGERS */ SYNTAX_ERROR(215); // Msg215 RELATIONS or TRIGGERS
} }
else if (MATCH(KW_PROCEDURES)) else if (MATCH(KW_PROCEDURES))
sw = show_procedures; sw = show_procedures;
@ -4284,7 +4284,7 @@ static SYN parse_show(void)
if (value = (BLK) get_dbb(QLI_token->tok_symbol)) if (value = (BLK) get_dbb(QLI_token->tok_symbol))
PAR_token(); PAR_token();
else else
SYNTAX_ERROR(221); /* Msg221 database name */ SYNTAX_ERROR(221); // Msg221 database name
} }
LLS_PUSH(value, &stack); LLS_PUSH(value, &stack);
count++; count++;
@ -4387,7 +4387,7 @@ static SYN parse_sql_alter(void)
PAR_real_token(); PAR_real_token();
if (!MATCH(KW_TABLE)) if (!MATCH(KW_TABLE))
SYNTAX_ERROR(407); /* Msg407 TABLE */ SYNTAX_ERROR(407); // Msg407 TABLE
node = SYNTAX_NODE(nod_sql_al_table, 2); node = SYNTAX_NODE(nod_sql_al_table, 2);
relation = parse_qualified_relation(); relation = parse_qualified_relation();
@ -4403,7 +4403,7 @@ static SYN parse_sql_alter(void)
field->fld_flags |= FLD_drop; field->fld_flags |= FLD_drop;
} }
else else
SYNTAX_ERROR(405); /* Msg405 ADD or DROP */ SYNTAX_ERROR(405); // Msg405 ADD or DROP
field->fld_next = (QLI_FLD) node->syn_arg[1]; field->fld_next = (QLI_FLD) node->syn_arg[1];
node->syn_arg[1] = (SYN) field; node->syn_arg[1] = (SYN) field;
@ -4451,7 +4451,7 @@ static SYN parse_sql_create(void)
else if (MATCH(KW_INDEX)) else if (MATCH(KW_INDEX))
return parse_sql_index_create(unique, descending); return parse_sql_index_create(unique, descending);
else else
SYNTAX_ERROR(389); /* Msg389 INDEX */ SYNTAX_ERROR(389); // Msg389 INDEX
} }
} }
@ -4465,7 +4465,7 @@ if (MATCH (KW_VIEW))
***/ ***/
#endif #endif
SYNTAX_ERROR(386); /* Msg386 object type for CREATE */ SYNTAX_ERROR(386); // Msg386 object type for CREATE
return NULL; return NULL;
} }
@ -4594,7 +4594,7 @@ static QLI_FLD parse_sql_field(void)
break; break;
default: default:
SYNTAX_ERROR(179); /* Msg179 field definition clause */ SYNTAX_ERROR(179); // Msg179 field definition clause
break; break;
} }
@ -4609,7 +4609,7 @@ static QLI_FLD parse_sql_field(void)
field->fld_flags |= FLD_not_null; field->fld_flags |= FLD_not_null;
} }
else { else {
SYNTAX_ERROR(393); /* Msg393 NULL */ SYNTAX_ERROR(393); // Msg393 NULL
} }
return field; return field;
@ -4666,7 +4666,7 @@ static SYN parse_sql_grant_revoke( USHORT type)
break; break;
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(187); /* Msg187 left parenthesis */ SYNTAX_ERROR(187); // Msg187 left parenthesis
do { do {
if (KEYWORD(KW_SELECT) || KEYWORD(KW_INSERT) if (KEYWORD(KW_SELECT) || KEYWORD(KW_INSERT)
@ -4678,7 +4678,7 @@ static SYN parse_sql_grant_revoke( USHORT type)
} while (MATCH(KW_COMMA)); } while (MATCH(KW_COMMA));
if (!MATCH(KW_RIGHT_PAREN)) if (!MATCH(KW_RIGHT_PAREN))
SYNTAX_ERROR(191); /* Msg191 right parenthesis */ SYNTAX_ERROR(191); // Msg191 right parenthesis
continue; continue;
} }
@ -4691,19 +4691,19 @@ static SYN parse_sql_grant_revoke( USHORT type)
PAR_real(); PAR_real();
if (!MATCH(KW_ON)) if (!MATCH(KW_ON))
SYNTAX_ERROR(397); /* Msg397 ON */ SYNTAX_ERROR(397); // Msg397 ON
PAR_real(); PAR_real();
if (!(node->syn_arg[s_grant_relation] = (SYN) parse_qualified_relation())) if (!(node->syn_arg[s_grant_relation] = (SYN) parse_qualified_relation()))
SYNTAX_ERROR(170); /* Msg170 relation name */ SYNTAX_ERROR(170); // Msg170 relation name
if (type == (USHORT) nod_sql_grant) { if (type == (USHORT) nod_sql_grant) {
if (!MATCH(KW_TO)) if (!MATCH(KW_TO))
SYNTAX_ERROR(404); /* Msg404 TO */ SYNTAX_ERROR(404); // Msg404 TO
} }
else { else {
if (!MATCH(KW_FROM)) if (!MATCH(KW_FROM))
SYNTAX_ERROR(403); /* Msg403 FROM */ SYNTAX_ERROR(403); // Msg403 FROM
} }
stack = NULL; stack = NULL;
@ -4721,7 +4721,7 @@ static SYN parse_sql_grant_revoke( USHORT type)
if (MATCH(KW_WITH)) { if (MATCH(KW_WITH)) {
PAR_real(); PAR_real();
if (!MATCH(KW_GRANT)) if (!MATCH(KW_GRANT))
SYNTAX_ERROR(401); /* Msg401 GRANT */ SYNTAX_ERROR(401); // Msg401 GRANT
MATCH(KW_OPTION); MATCH(KW_OPTION);
privileges |= PRV_grant_option; privileges |= PRV_grant_option;
} }
@ -4759,15 +4759,15 @@ static SYN parse_sql_index_create( USHORT unique, USHORT descending)
PAR_real(); PAR_real();
if (!MATCH(KW_ON)) if (!MATCH(KW_ON))
SYNTAX_ERROR(397); /* Msg397 ON */ SYNTAX_ERROR(397); // Msg397 ON
if (!(node->syn_arg[s_dfi_relation] = (SYN) parse_qualified_relation())) if (!(node->syn_arg[s_dfi_relation] = (SYN) parse_qualified_relation()))
SYNTAX_ERROR(170); /* Msg170 relation name */ SYNTAX_ERROR(170); // Msg170 relation name
PAR_real(); PAR_real();
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(185); /* Msg185 left parenthesis */ SYNTAX_ERROR(185); // Msg185 left parenthesis
stack = NULL; stack = NULL;
@ -4776,7 +4776,7 @@ static SYN parse_sql_index_create( USHORT unique, USHORT descending)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(171); /* Msg171 comma between field definitions */ SYNTAX_ERROR(171); // Msg171 comma between field definitions
} }
node->syn_arg[s_dfi_fields] = make_list(stack); node->syn_arg[s_dfi_fields] = make_list(stack);
@ -4832,10 +4832,10 @@ static SYN parse_sql_join_clause( SYN left)
return left; return left;
if (!(right = parse_sql_joined_relation(left))) if (!(right = parse_sql_joined_relation(left)))
SYNTAX_ERROR(490); /* Msg490 joined relation clause */ SYNTAX_ERROR(490); // Msg490 joined relation clause
if (!MATCH(KW_ON)) if (!MATCH(KW_ON))
SYNTAX_ERROR(492); /* Msg492 ON */ SYNTAX_ERROR(492); // Msg492 ON
node = SYNTAX_NODE(nod_rse, (int) s_rse_count + 2 * 2); node = SYNTAX_NODE(nod_rse, (int) s_rse_count + 2 * 2);
node->syn_count = 2; node->syn_count = 2;
@ -4874,7 +4874,7 @@ static SYN parse_sql_table_create(void)
ptr = &relation->rel_fields; ptr = &relation->rel_fields;
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(185); /* Msg185 left parenthesis */ SYNTAX_ERROR(185); // Msg185 left parenthesis
PAR_real(); PAR_real();
@ -4884,7 +4884,7 @@ static SYN parse_sql_table_create(void)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(171); /* Msg171 comma between field definitions */ SYNTAX_ERROR(171); // Msg171 comma between field definitions
} }
command_end(); command_end();
@ -4920,7 +4920,7 @@ static SYN parse_sql_view_create(void)
relation->rel_database = parse_database(); relation->rel_database = parse_database();
relation->rel_symbol = parse_symbol(); relation->rel_symbol = parse_symbol();
/* if field list is present parse it and create corresponding field blocks */ // if field list is present parse it and create corresponding field blocks
if (MATCH(KW_LEFT_PAREN)) { if (MATCH(KW_LEFT_PAREN)) {
for (;;) { for (;;) {
@ -4928,17 +4928,17 @@ static SYN parse_sql_view_create(void)
if (MATCH(KW_RIGHT_PAREN)) if (MATCH(KW_RIGHT_PAREN))
break; break;
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
SYNTAX_ERROR(171); /* Msg171 comma between field definitions */ SYNTAX_ERROR(171); // Msg171 comma between field definitions
} }
} }
/* node->syn_arg [s_crv_fields] = make_list (stack); */ /* node->syn_arg [s_crv_fields] = make_list (stack); */
if (!MATCH(KW_AS)) if (!MATCH(KW_AS))
SYNTAX_ERROR(394); /* Msg394 As */ SYNTAX_ERROR(394); // Msg394 As
if (!KEYWORD(KW_SELECT)) if (!KEYWORD(KW_SELECT))
SYNTAX_ERROR(395); /* Msg395 Select */ SYNTAX_ERROR(395); // Msg395 Select
node->syn_arg[s_crv_rse] = parse_select(); node->syn_arg[s_crv_rse] = parse_select();
@ -4965,7 +4965,7 @@ static SYN parse_sql_relation(void)
node = SYNTAX_NODE(nod_relation, s_rel_count); node = SYNTAX_NODE(nod_relation, s_rel_count);
if (!(node->syn_arg[s_rel_relation] = (SYN) parse_qualified_relation())) if (!(node->syn_arg[s_rel_relation] = (SYN) parse_qualified_relation()))
SYNTAX_ERROR(223); /* Msg223 relation name */ SYNTAX_ERROR(223); // Msg223 relation name
if (!QLI_token->tok_symbol) if (!QLI_token->tok_symbol)
node->syn_arg[s_rel_context] = (SYN) parse_symbol(); node->syn_arg[s_rel_context] = (SYN) parse_symbol();
@ -4995,9 +4995,9 @@ static SYN parse_sql_rse(void)
PAR_real(); PAR_real();
if (!MATCH(KW_FROM)) if (!MATCH(KW_FROM))
SYNTAX_ERROR(224); /* Msg224 FROM clause */ SYNTAX_ERROR(224); // Msg224 FROM clause
/* Parse FROM list of relations */ // Parse FROM list of relations
while (TRUE) { while (TRUE) {
count++; count++;
@ -5023,7 +5023,7 @@ static SYN parse_sql_rse(void)
if (MATCH(KW_GROUP)) { if (MATCH(KW_GROUP)) {
if (sw_sql_view) if (sw_sql_view)
SYNTAX_ERROR(391); /* Msg391 No group by in view def */ SYNTAX_ERROR(391); // Msg391 No group by in view def
PAR_real(); PAR_real();
MATCH(KW_BY); MATCH(KW_BY);
stack = NULL; stack = NULL;
@ -5088,7 +5088,7 @@ static SYN parse_sql_subquery(void)
KWWORDS keyword; KWWORDS keyword;
if (sw_sql_view) if (sw_sql_view)
SYNTAX_ERROR(392); /* Msg392 No aggregates in view def */ SYNTAX_ERROR(392); // Msg392 No aggregates in view def
PAR_token(); PAR_token();
@ -5275,12 +5275,12 @@ static SYN parse_statistical(void)
if (types->nod_t_keyword == keyword) if (types->nod_t_keyword == keyword)
break; break;
/* Handle SQL statisticals a little differently */ // Handle SQL statisticals a little differently
if (sql_flag) { if (sql_flag) {
node = SYNTAX_NODE(types->nod_t_sql_node, s_stt_count); node = SYNTAX_NODE(types->nod_t_sql_node, s_stt_count);
if (!MATCH(KW_LEFT_PAREN)) if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR(227); /* Msg227 left parenthesis */ SYNTAX_ERROR(227); // Msg227 left parenthesis
if (node->syn_type != nod_agg_count || !MATCH(KW_ASTERISK)) { if (node->syn_type != nod_agg_count || !MATCH(KW_ASTERISK)) {
if (MATCH(KW_DISTINCT)) if (MATCH(KW_DISTINCT))
node->syn_arg[s_prt_distinct] = INT_CAST TRUE; node->syn_arg[s_prt_distinct] = INT_CAST TRUE;
@ -5290,7 +5290,7 @@ static SYN parse_statistical(void)
return node; return node;
} }
/* Handle GDML statisticals */ // Handle GDML statisticals
node = SYNTAX_NODE(types->nod_t_node, s_stt_count); node = SYNTAX_NODE(types->nod_t_node, s_stt_count);
@ -5300,13 +5300,13 @@ static SYN parse_statistical(void)
if (!MATCH(KW_OF)) { if (!MATCH(KW_OF)) {
if (sw_report) { if (sw_report) {
if (function_count > 0) if (function_count > 0)
IBERROR(487); /* Msg487 Invalid argument for UDF */ IBERROR(487); // Msg487 Invalid argument for UDF
node->syn_type = types->nod_t_rpt_node; node->syn_type = types->nod_t_rpt_node;
return node; return node;
} }
PAR_real(); PAR_real();
if (!MATCH(KW_OF)) if (!MATCH(KW_OF))
SYNTAX_ERROR(228); /* Msg 228 OF */ SYNTAX_ERROR(228); // Msg 228 OF
} }
node->syn_arg[s_stt_rse] = parse_rse(); node->syn_arg[s_stt_rse] = parse_rse();
@ -5340,7 +5340,7 @@ static SYN parse_store(void)
#ifdef PYXIS #ifdef PYXIS
if (MATCH(KW_FORM)) if (MATCH(KW_FORM))
IBERROR(484); /* FORMs not supported */ IBERROR(484); // FORMs not supported
else else
#endif #endif
node->syn_arg[s_sto_statement] = parse_statement(); node->syn_arg[s_sto_statement] = parse_statement();
@ -5452,7 +5452,7 @@ static SYN parse_transaction( NOD_T node_type)
symbol = symbol->sym_homonym) symbol = symbol->sym_homonym)
if (symbol->sym_type == SYM_database) break; if (symbol->sym_type == SYM_database) break;
if (!symbol) if (!symbol)
SYNTAX_ERROR(229); /* Msg229 database name */ SYNTAX_ERROR(229); // Msg229 database name
LLS_PUSH(symbol->sym_object, &stack); LLS_PUSH(symbol->sym_object, &stack);
PAR_token(); PAR_token();
if (!MATCH(KW_COMMA)) if (!MATCH(KW_COMMA))
@ -5512,9 +5512,9 @@ static SYN parse_update(void)
rse->syn_arg[s_rse_count] = parse_sql_relation(); rse->syn_arg[s_rse_count] = parse_sql_relation();
if (!MATCH(KW_SET)) if (!MATCH(KW_SET))
SYNTAX_ERROR(230); /* Msg230 SET */ SYNTAX_ERROR(230); // Msg230 SET
/* Pick up assignments */ // Pick up assignments
stack = NULL; stack = NULL;

View File

@ -89,7 +89,7 @@ PICS PIC_analyze( TEXT * string, DSC * desc)
picture = (PICS) ALLOCD(type_pic); picture = (PICS) ALLOCD(type_pic);
picture->pic_string = picture->pic_pointer = string; picture->pic_string = picture->pic_pointer = string;
/* Make a first pass just counting characters */ // Make a first pass just counting characters
while ((c = generate(picture)) && c != '?') { while ((c = generate(picture)) && c != '?') {
@ -512,7 +512,7 @@ static void edit_alpha(
if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z')) if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z'))
*out++ = *p++; *out++ = *p++;
else else
IBERROR(69); /* Msg 69 conversion error */ IBERROR(69); // Msg 69 conversion error
break; break;
case 'B': case 'B':
@ -747,13 +747,13 @@ static void edit_float( DSC * desc, PICS picture, TEXT ** output)
sprintf(temp, "%.*f", f_digits, number); sprintf(temp, "%.*f", f_digits, number);
w_digits = strlen(temp); w_digits = strlen(temp);
if (f_digits) { if (f_digits) {
p = temp + w_digits; /* find the end */ p = temp + w_digits; // find the end
w_digits = w_digits - (f_digits + 1); w_digits = w_digits - (f_digits + 1);
while (*--p == '0') while (*--p == '0')
--f_digits; --f_digits;
if (*p != '.') if (*p != '.')
++p; ++p;
*p = 0; /* move the end */ *p = 0; // move the end
} }
if ((w_digits > width) if ((w_digits > width)
|| (!f_digits && w_digits == 1 && temp[0] == '0')) { || (!f_digits && w_digits == 1 && temp[0] == '0')) {

View File

@ -154,7 +154,7 @@ void PRO_copy_procedure(
DB1 = new_database->dbb_handle; DB1 = new_database->dbb_handle;
/* create blob parameter block since procedure is a text blob */ // create blob parameter block since procedure is a text blob
p = bpb; p = bpb;
@ -178,7 +178,7 @@ void PRO_copy_procedure(
PRO_close(new_database, new_blob); PRO_close(new_database, new_blob);
END_STORE; END_STORE;
/* Release the FOR and STORE requests */ // Release the FOR and STORE requests
gds__release_request(gds_status, &store_request); gds__release_request(gds_status, &store_request);
PRO_commit(new_database); PRO_commit(new_database);
} }
@ -203,7 +203,7 @@ void PRO_create( DBB database, TEXT * name)
USHORT bpb_length; USHORT bpb_length;
UCHAR bpb[20], *p; UCHAR bpb[20], *p;
/* See if procedure is already in use */ // See if procedure is already in use
probe(database, name); probe(database, name);
@ -567,7 +567,7 @@ void PRO_setup( DBB dbb)
if (!dbb) if (!dbb)
IBERROR(77); IBERROR(77);
/* Msg 77 database handle required */ // Msg 77 database handle required
/* If we don't have a QLI$PROCEDURES relation, and can't get one, punt */ /* If we don't have a QLI$PROCEDURES relation, and can't get one, punt */
@ -612,7 +612,7 @@ FRBRD *PRO_transaction( DBB database, int update_flag)
FRBRD *transaction; FRBRD *transaction;
if (!database) if (!database)
IBERROR(248); /* Msg248 no active database for operation */ IBERROR(248); // Msg248 no active database for operation
transaction = (database->dbb_capabilities & DBB_cap_multi_trans) ? transaction = (database->dbb_capabilities & DBB_cap_multi_trans) ?
database->dbb_proc_trans : NULL; database->dbb_proc_trans : NULL;
@ -639,12 +639,12 @@ FRBRD *PRO_transaction( DBB database, int update_flag)
if (!gds_trans && (database->dbb_capabilities & DBB_cap_single_trans)) { if (!gds_trans && (database->dbb_capabilities & DBB_cap_single_trans)) {
if (update_flag) if (update_flag)
IBERROR(249); /* Msg249 Interactive metadata updates are not available on Rdb */ IBERROR(249); // Msg249 Interactive metadata updates are not available on Rdb
if (!(gds_trans = database->dbb_transaction)) if (!(gds_trans = database->dbb_transaction))
gds_trans = MET_transaction(nod_start_trans, database); gds_trans = MET_transaction(nod_start_trans, database);
} }
/* otherwise make one more effort to start the transaction */ // otherwise make one more effort to start the transaction
else if (!gds_trans) { else if (!gds_trans) {
START_TRANSACTION START_TRANSACTION
@ -836,7 +836,7 @@ static void probe( DBB database, TEXT * name)
FRBRD *blob; FRBRD *blob;
ISC_STATUS_ARRAY status_vector; ISC_STATUS_ARRAY status_vector;
/* Probe to see if procedure is already in use */ // Probe to see if procedure is already in use
if (blob = PRO_fetch_procedure(database, name)) { if (blob = PRO_fetch_procedure(database, name)) {
gds__close_blob(status_vector, &blob); gds__close_blob(status_vector, &blob);
@ -871,7 +871,7 @@ static int upcase_name( TEXT * name, TEXT * buffer)
if (!c) if (!c)
return l; return l;
if (++l > 31) if (++l > 31)
IBERROR(79); /* Msg 79 procedure name over 31 characters */ IBERROR(79); // Msg 79 procedure name over 31 characters
} }
} }

View File

@ -69,7 +69,7 @@ void RPT_report( QLI_NOD loop)
PRT print; PRT print;
UCHAR *temp; UCHAR *temp;
/* Get to actual report node */ // Get to actual report node
node = loop->nod_arg[e_for_statement]; node = loop->nod_arg[e_for_statement];
report = (RPT) node->nod_arg[e_prt_list]; report = (RPT) node->nod_arg[e_prt_list];
@ -77,7 +77,7 @@ void RPT_report( QLI_NOD loop)
print->prt_new_page = (int(*)()) top_of_page; print->prt_new_page = (int(*)()) top_of_page;
print->prt_page_number = 0; print->prt_page_number = 0;
/* Get to actual report node */ // Get to actual report node
/* If there is a request associated with the loop, start it and possibly /* If there is a request associated with the loop, start it and possibly
send a message slong with it. */ send a message slong with it. */
@ -116,7 +116,7 @@ void RPT_report( QLI_NOD loop)
initialize_break(report->rpt_bottom_page); initialize_break(report->rpt_bottom_page);
initialize_break(report->rpt_bottom_rpt); initialize_break(report->rpt_bottom_rpt);
/* Force TOP breaks for all fields */ // Force TOP breaks for all fields
for (control = report->rpt_top_breaks; control; for (control = report->rpt_top_breaks; control;
control = control->brk_next) FMT_print((QLI_NOD) control->brk_line, print); control = control->brk_next) FMT_print((QLI_NOD) control->brk_line, print);
@ -163,7 +163,7 @@ void RPT_report( QLI_NOD loop)
break; break;
} }
/* Force BOTTOM breaks for all fields */ // Force BOTTOM breaks for all fields
SWAP(message->msg_buffer, report->rpt_buffer); SWAP(message->msg_buffer, report->rpt_buffer);
bottom_break(report->rpt_bottom_breaks, print); bottom_break(report->rpt_bottom_breaks, print);
@ -257,7 +257,7 @@ static int test_break( BRK control, RPT report, QLI_MSG message)
UCHAR *p1, *p2; UCHAR *p1, *p2;
USHORT l; USHORT l;
/* Evaluate the two versions of the expression */ // Evaluate the two versions of the expression
if (ptr1 = EVAL_value((QLI_NOD) control->brk_field)) if (ptr1 = EVAL_value((QLI_NOD) control->brk_field))
desc1 = *ptr1; desc1 = *ptr1;
@ -270,7 +270,7 @@ static int test_break( BRK control, RPT report, QLI_MSG message)
message->msg_buffer = p1; message->msg_buffer = p1;
/* Check for consistently missing */ // Check for consistently missing
if (!ptr1 || !ptr2) if (!ptr1 || !ptr2)
return (ptr1 != ptr2); return (ptr1 != ptr2);

View File

@ -233,7 +233,7 @@ void SHOW_stuff( SYN node)
for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next) for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next)
count += show_security_classes_detail(dbb); count += show_security_classes_detail(dbb);
if (!count) if (!count)
ERRQ_msg_put(90, NULL, NULL, NULL, NULL, NULL); /* Msg90 No security classes defined */ ERRQ_msg_put(90, NULL, NULL, NULL, NULL, NULL); // Msg90 No security classes defined
break; break;
case show_security_class: case show_security_class:
@ -253,7 +253,7 @@ void SHOW_stuff( SYN node)
for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next) for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next)
count += show_views_detail(dbb); count += show_views_detail(dbb);
if (!count) if (!count)
ERRQ_msg_put(92, NULL, NULL, NULL, NULL, NULL); /* Msg92 No views defined */ ERRQ_msg_put(92, NULL, NULL, NULL, NULL, NULL); // Msg92 No views defined
break; break;
case show_relation: case show_relation:
@ -267,7 +267,7 @@ void SHOW_stuff( SYN node)
if (value) { if (value) {
show_rel((QLI_REL) value); show_rel((QLI_REL) value);
if (!show_indices_detail((QLI_REL) value)) if (!show_indices_detail((QLI_REL) value))
ERRQ_msg_put(93, NULL, NULL, NULL, NULL, NULL); /* Msg93 No indices defined */ ERRQ_msg_put(93, NULL, NULL, NULL, NULL, NULL); // Msg93 No indices defined
break; break;
} }
for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next) { for (dbb = QLI_databases; dbb; dbb = dbb->dbb_next) {
@ -277,7 +277,7 @@ void SHOW_stuff( SYN node)
if (!(relation->rel_flags & (REL_system | REL_view))) { if (!(relation->rel_flags & (REL_system | REL_view))) {
show_rel(relation); show_rel(relation);
if (!show_indices_detail(relation)) if (!show_indices_detail(relation))
ERRQ_msg_put(94, NULL, NULL, NULL, NULL, NULL); /* Msg94 No indices defined */ ERRQ_msg_put(94, NULL, NULL, NULL, NULL, NULL); // Msg94 No indices defined
} }
} }
break; break;
@ -290,7 +290,7 @@ void SHOW_stuff( SYN node)
if (!(relation->rel_flags & (REL_system | REL_view))) { if (!(relation->rel_flags & (REL_system | REL_view))) {
show_rel(relation); show_rel(relation);
if (!show_indices_detail(relation)) if (!show_indices_detail(relation))
ERRQ_msg_put(94, NULL, NULL, NULL, NULL, NULL); /* Msg94 No indices defined */ ERRQ_msg_put(94, NULL, NULL, NULL, NULL, NULL); // Msg94 No indices defined
} }
break; break;
@ -383,7 +383,7 @@ void SHOW_stuff( SYN node)
break; break;
default: default:
BUGCHECK(7); /* Msg7 show option not implemented */ BUGCHECK(7); // Msg7 show option not implemented
} }
} }
} }
@ -699,7 +699,7 @@ static void show_datatype(
break; break;
case dtype_blob: case dtype_blob:
ERRQ_msg_partial(105, NULL, NULL, NULL, NULL, NULL); /* Msg105 blob */ ERRQ_msg_partial(105, NULL, NULL, NULL, NULL, NULL); // Msg105 blob
if (segment_length) if (segment_length)
ERRQ_msg_partial(106, (TEXT *) (ULONG) segment_length, NULL, NULL, ERRQ_msg_partial(106, (TEXT *) (ULONG) segment_length, NULL, NULL,
NULL, NULL); /* Msg106 , segment length %d */ NULL, NULL); /* Msg106 , segment length %d */
@ -743,7 +743,7 @@ static void show_datatype(
ERRQ_msg_partial(msg, (TEXT *) (ULONG) length, NULL, NULL, NULL, NULL); ERRQ_msg_partial(msg, (TEXT *) (ULONG) length, NULL, NULL, NULL, NULL);
if (dimensions) if (dimensions)
ERRQ_msg_partial(433, NULL, NULL, NULL, NULL, NULL); /* Msg433 array */ ERRQ_msg_partial(433, NULL, NULL, NULL, NULL, NULL); // Msg433 array
if (dtype == dtype_short || dtype == dtype_long || dtype == dtype_quad) if (dtype == dtype_short || dtype == dtype_long || dtype == dtype_quad)
if (scale) if (scale)
@ -786,7 +786,7 @@ static void show_dbb( DBB database)
ERRQ_msg_put(114, database->dbb_filename, NULL, NULL, NULL, NULL); /* Msg114 Database %s */ ERRQ_msg_put(114, database->dbb_filename, NULL, NULL, NULL, NULL); /* Msg114 Database %s */
} }
else else
ERRQ_msg_put(115, NULL, NULL, NULL, NULL, NULL); /* Msg115 No databases are currently ready */ ERRQ_msg_put(115, NULL, NULL, NULL, NULL, NULL); // Msg115 No databases are currently ready
} }
@ -1053,7 +1053,7 @@ static void show_fields( QLI_REL relation, QLI_FLD fields)
max_name = MAX(max_name, l); max_name = MAX(max_name, l);
} }
/* Now print the fields */ // Now print the fields
for (field = fields; field; field = field->fld_next) { for (field = fields; field; field = field->fld_next) {
if (QLI_abort) if (QLI_abort)
@ -1400,7 +1400,7 @@ static int show_func_detail( DBB database, TEXT * func_name)
FA IN RDB$FUNCTION_ARGUMENTS WITH FA IN RDB$FUNCTION_ARGUMENTS WITH
FA.RDB$FUNCTION_NAME = func_name SORTED BY FA.RDB$ARGUMENT_POSITION FA.RDB$FUNCTION_NAME = func_name SORTED BY FA.RDB$ARGUMENT_POSITION
if (FA.RDB$ARGUMENT_POSITION == 0) if (FA.RDB$ARGUMENT_POSITION == 0)
ERRQ_msg_partial(427, NULL, NULL, NULL, NULL, NULL); /* Msg427 Return argument is */ ERRQ_msg_partial(427, NULL, NULL, NULL, NULL, NULL); // Msg427 Return argument is
else else
ERRQ_msg_partial(428, ERRQ_msg_partial(428,
(TEXT *) (SLONG) FA.RDB$ARGUMENT_POSITION, (TEXT *) (SLONG) FA.RDB$ARGUMENT_POSITION,
@ -1709,7 +1709,7 @@ static void show_gbl_fields( DBB database)
database = database->dbb_next) count += database = database->dbb_next) count +=
show_gbl_fields_detail(database); show_gbl_fields_detail(database);
if (!count) if (!count)
ERRQ_msg_put(125, NULL, NULL, NULL, NULL, NULL); /* Msg125 There are no fields defined in any open database */ ERRQ_msg_put(125, NULL, NULL, NULL, NULL, NULL); // Msg125 There are no fields defined in any open database
} }
} }
@ -2230,13 +2230,13 @@ static void show_sys_trigs( DBB database)
X.RDB$TRIGGER_NAME X.RDB$TRIGGER_NAME
if (!X.RDB$TRIGGER_BLR.NULL) { if (!X.RDB$TRIGGER_BLR.NULL) {
ERRQ_msg_put(379, X.RDB$RELATION_NAME, NULL, NULL, NULL, NULL); /* Msg379 System Triggers */ ERRQ_msg_put(379, X.RDB$RELATION_NAME, NULL, NULL, NULL, NULL); // Msg379 System Triggers
show_trigger_header(X.RDB$TRIGGER_NAME, X.RDB$TRIGGER_TYPE, show_trigger_header(X.RDB$TRIGGER_NAME, X.RDB$TRIGGER_TYPE,
X.RDB$TRIGGER_SEQUENCE, X.RDB$TRIGGER_SEQUENCE,
X.RDB$TRIGGER_INACTIVE, (SLONG*) &X.RDB$DESCRIPTION, X.RDB$TRIGGER_INACTIVE, (SLONG*) &X.RDB$DESCRIPTION,
database, X.RDB$RELATION_NAME); database, X.RDB$RELATION_NAME);
show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */ show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */
376, /* Msg376 Source for the trigger */ 376, // Msg376 Source for the trigger
database, X.RDB$RELATION_NAME); database, X.RDB$RELATION_NAME);
show_trigger_messages(database, X.RDB$TRIGGER_NAME); show_trigger_messages(database, X.RDB$TRIGGER_NAME);
count++; count++;
@ -2244,7 +2244,7 @@ static void show_sys_trigs( DBB database)
END_FOR; END_FOR;
if (!count) if (!count)
ERRQ_msg_put(378, NULL, NULL, NULL, NULL, NULL); /* Msg378 No system triggers */ ERRQ_msg_put(378, NULL, NULL, NULL, NULL, NULL); // Msg378 No system triggers
} }
@ -2325,7 +2325,7 @@ static int show_trigger_detail( DBB database, const TEXT * relation_name)
MET_meta_transaction(database, FALSE); MET_meta_transaction(database, FALSE);
int count = 0; int count = 0;
/* New style triggers */ // New style triggers
if (database->dbb_capabilities & DBB_cap_new_triggers) { if (database->dbb_capabilities & DBB_cap_new_triggers) {
ERRQ_msg_put(365, relation_name, NULL, NULL, NULL, NULL); /* Msg365 Triggers for relation %s */ ERRQ_msg_put(365, relation_name, NULL, NULL, NULL, NULL); /* Msg365 Triggers for relation %s */
@ -2342,7 +2342,7 @@ static int show_trigger_detail( DBB database, const TEXT * relation_name)
(SLONG*) &X.RDB$DESCRIPTION, database, (SLONG*) &X.RDB$DESCRIPTION, database,
relation_name); relation_name);
show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */ show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */
376, /* Msg376 Source for the trigger */ 376, // Msg376 Source for the trigger
database, relation_name); database, relation_name);
show_trigger_messages(database, X.RDB$TRIGGER_NAME); show_trigger_messages(database, X.RDB$TRIGGER_NAME);
count++; count++;
@ -2351,7 +2351,7 @@ static int show_trigger_detail( DBB database, const TEXT * relation_name)
return count; return count;
} }
/* Old style triggers */ // Old style triggers
/* OBSOLETE - 1996-Aug-06 David Schnepper */ /* OBSOLETE - 1996-Aug-06 David Schnepper */
/* OBSOLETE - Msg298 Triggers for relation %s: */ /* OBSOLETE - Msg298 Triggers for relation %s: */
@ -2525,7 +2525,7 @@ static int show_triggers_detail( DBB database)
if (database->dbb_capabilities & DBB_cap_new_triggers) { if (database->dbb_capabilities & DBB_cap_new_triggers) {
/* New style triggers */ // New style triggers
FOR(REQUEST_HANDLE database->dbb_requests[REQ_show_new_triggers]) FOR(REQUEST_HANDLE database->dbb_requests[REQ_show_new_triggers])
X IN RDB$TRIGGERS WITH X.RDB$SYSTEM_FLAG MISSING X IN RDB$TRIGGERS WITH X.RDB$SYSTEM_FLAG MISSING
@ -2540,7 +2540,7 @@ static int show_triggers_detail( DBB database)
(SLONG*) &X.RDB$DESCRIPTION, database, (SLONG*) &X.RDB$DESCRIPTION, database,
X.RDB$RELATION_NAME); X.RDB$RELATION_NAME);
show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */ show_blob_info((SLONG*) &X.RDB$TRIGGER_BLR, (SLONG*) &X.RDB$TRIGGER_SOURCE, 377, /* Msg377 Source for the trigger is not available. Trigger BLR: */
376, /* Msg376 Source for the trigger */ 376, // Msg376 Source for the trigger
database, X.RDB$RELATION_NAME); database, X.RDB$RELATION_NAME);
show_trigger_messages(database, X.RDB$TRIGGER_NAME); show_trigger_messages(database, X.RDB$TRIGGER_NAME);
count++; count++;
@ -2549,7 +2549,7 @@ static int show_triggers_detail( DBB database)
} }
else { else {
/* Old style triggers */ // Old style triggers
/* OBSOLETE - 1996-Aug-06 David Schnepper */ /* OBSOLETE - 1996-Aug-06 David Schnepper */
/* OBSOLETE - Msg305 Triggers for relation %s: */ /* OBSOLETE - Msg305 Triggers for relation %s: */