Skip to content

Commit 100871c

Browse files
committed
ecpg: Improve some variable names
based on patch from Josh Soref <jsoref@gmail.com>
1 parent a47b38c commit 100871c

File tree

1 file changed

+20
-20
lines changed
  • src/interfaces/ecpg/preproc

1 file changed

+20
-20
lines changed

src/interfaces/ecpg/preproc/type.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ get_type(enum ECPGttype type)
231231
*/
232232
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
233233
char *varcharsize,
234-
char *arrsiz, const char *siz, const char *prefix, int);
235-
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
234+
char *arrsize, const char *size, const char *prefix, int);
235+
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize,
236236
struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix);
237237

238238
void
239239
ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, const int brace_level,
240240
const char *ind_name, struct ECPGtype * ind_type, const int ind_brace_level,
241241
const char *prefix, const char *ind_prefix,
242-
char *arr_str_siz, const char *struct_sizeof,
242+
char *arr_str_size, const char *struct_sizeof,
243243
const char *ind_struct_sizeof)
244244
{
245245
struct variable *var;
@@ -350,9 +350,9 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, const int bra
350350
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
351351
mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
352352

353-
ECPGdump_a_simple(o, name, type->type, str_varchar_one, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : str_arr_one, struct_sizeof, prefix, 0);
353+
ECPGdump_a_simple(o, name, type->type, str_varchar_one, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_arr_one, struct_sizeof, prefix, 0);
354354
if (ind_type != NULL)
355-
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : str_neg_one, ind_struct_sizeof, ind_prefix, 0);
355+
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_neg_one, ind_struct_sizeof, ind_prefix, 0);
356356

357357
free(str_varchar_one);
358358
free(str_arr_one);
@@ -391,9 +391,9 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, const int bra
391391
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
392392
mmfatal(INDICATOR_NOT_SIMPLE, "indicator for simple data type has to be simple");
393393

394-
ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : str_neg_one, struct_sizeof, prefix, type->counter);
394+
ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : str_neg_one, struct_sizeof, prefix, type->counter);
395395
if (ind_type != NULL)
396-
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : ind_type_neg_one, ind_struct_sizeof, ind_prefix, 0);
396+
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_size && strcmp(arr_str_size, "0") != 0) ? arr_str_size : ind_type_neg_one, ind_struct_sizeof, ind_prefix, 0);
397397

398398
free(str_neg_one);
399399
free(ind_type_neg_one);
@@ -403,13 +403,13 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, const int bra
403403
}
404404

405405

406-
/* If siz is NULL, then the offset is 0, if not use siz as a
406+
/* If size is NULL, then the offset is 0, if not use size as a
407407
string, it represents the offset needed if we are in an array of structs. */
408408
static void
409409
ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
410410
char *varcharsize,
411411
char *arrsize,
412-
const char *siz,
412+
const char *size,
413413
const char *prefix,
414414
int counter)
415415
{
@@ -440,7 +440,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
440440
*/
441441
if (((atoi(arrsize) > 0) ||
442442
(atoi(arrsize) == 0 && strcmp(arrsize, "0") != 0)) &&
443-
siz == NULL)
443+
size == NULL)
444444
sprintf(variable, "(%s%s)", prefix ? prefix : "", name);
445445
else
446446
sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
@@ -469,7 +469,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
469469
(atoi(arrsize) > 0) ||
470470
(atoi(varcharsize) == 0 && strcmp(varcharsize, "0") != 0) ||
471471
(atoi(arrsize) == 0 && strcmp(arrsize, "0") != 0))
472-
&& siz == NULL)
472+
&& size == NULL)
473473
{
474474
sprintf(variable, "(%s%s)", prefix ? prefix : "", name);
475475
if ((type == ECPGt_char || type == ECPGt_unsigned_char) &&
@@ -536,7 +536,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
536536
*/
537537
if (((atoi(arrsize) > 0) ||
538538
(atoi(arrsize) == 0 && strcmp(arrsize, "0") != 0)) &&
539-
siz == NULL)
539+
size == NULL)
540540
sprintf(variable, "(%s%s)", prefix ? prefix : "", name);
541541
else
542542
sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
@@ -549,17 +549,17 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
549549
* Array size would be -1 for addresses of members within structure,
550550
* when pointer to structure is being dumped.
551551
*/
552-
if (atoi(arrsize) < 0 && !siz)
552+
if (atoi(arrsize) < 0 && !size)
553553
strcpy(arrsize, "1");
554554

555555
/*
556-
* If siz i.e. the size of structure of which this variable is part
556+
* If size i.e. the size of structure of which this variable is part
557557
* of, that gives the offset to the next element, if required
558558
*/
559-
if (siz == NULL || strlen(siz) == 0)
559+
if (size == NULL || strlen(size) == 0)
560560
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, offset);
561561
else
562-
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, siz);
562+
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, size);
563563

564564
free(variable);
565565
free(offset);
@@ -569,7 +569,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
569569

570570
/* Penetrate a struct and dump the contents. */
571571
static void
572-
ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix)
572+
ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize, struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix)
573573
{
574574
/*
575575
* If offset is NULL, then this is the first recursive level. If not then
@@ -580,7 +580,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
580580
char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
581581
char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
582582

583-
if (atoi(arrsiz) == 1)
583+
if (atoi(arrsize) == 1)
584584
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
585585
else
586586
sprintf(pbuf, "%s%s->", prefix ? prefix : "", name);
@@ -591,7 +591,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
591591
ind_p = &struct_no_indicator;
592592
else if (ind_type != NULL)
593593
{
594-
if (atoi(arrsiz) == 1)
594+
if (atoi(arrsize) == 1)
595595
sprintf(ind_pbuf, "%s%s.", ind_prefix ? ind_prefix : "", ind_name);
596596
else
597597
sprintf(ind_pbuf, "%s%s->", ind_prefix ? ind_prefix : "", ind_name);
@@ -606,7 +606,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
606606
(ind_p != NULL) ? ind_p->name : NULL,
607607
(ind_p != NULL) ? ind_p->type : NULL,
608608
-1,
609-
prefix, ind_prefix, arrsiz, type->struct_sizeof,
609+
prefix, ind_prefix, arrsize, type->struct_sizeof,
610610
(ind_p != NULL) ? ind_type->struct_sizeof : NULL);
611611
if (ind_p != NULL && ind_p != &struct_no_indicator)
612612
ind_p = ind_p->next;

0 commit comments

Comments
 (0)