Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit100871c

Browse files
committed
ecpg: Improve some variable names
based on patch from Josh Soref <jsoref@gmail.com>
1 parenta47b38c commit100871c

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
staticvoidECPGdump_a_simple(FILE*o,constchar*name,enumECPGttypetype,
233233
char*varcharsize,
234-
char*arrsiz,constchar*siz,constchar*prefix,int);
235-
staticvoidECPGdump_a_struct(FILE*o,constchar*name,constchar*ind_name,char*arrsiz,
234+
char*arrsize,constchar*size,constchar*prefix,int);
235+
staticvoidECPGdump_a_struct(FILE*o,constchar*name,constchar*ind_name,char*arrsize,
236236
structECPGtype*type,structECPGtype*ind_type,constchar*prefix,constchar*ind_prefix);
237237

238238
void
239239
ECPGdump_a_type(FILE*o,constchar*name,structECPGtype*type,constintbrace_level,
240240
constchar*ind_name,structECPGtype*ind_type,constintind_brace_level,
241241
constchar*prefix,constchar*ind_prefix,
242-
char*arr_str_siz,constchar*struct_sizeof,
242+
char*arr_str_size,constchar*struct_sizeof,
243243
constchar*ind_struct_sizeof)
244244
{
245245
structvariable*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-
/* Ifsiz is NULL, then the offset is 0, if not usesiz as a
406+
/* Ifsize is NULL, then the offset is 0, if not usesize as a
407407
string, it represents the offset needed if we are in an array of structs. */
408408
staticvoid
409409
ECPGdump_a_simple(FILE*o,constchar*name,enumECPGttypetype,
410410
char*varcharsize,
411411
char*arrsize,
412-
constchar*siz,
412+
constchar*size,
413413
constchar*prefix,
414414
intcounter)
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-
* Ifsiz i.e. the size of structure of which this variable is part
556+
* Ifsize 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
staticvoid
572-
ECPGdump_a_struct(FILE*o,constchar*name,constchar*ind_name,char*arrsiz,structECPGtype*type,structECPGtype*ind_type,constchar*prefix,constchar*ind_prefix)
572+
ECPGdump_a_struct(FILE*o,constchar*name,constchar*ind_name,char*arrsize,structECPGtype*type,structECPGtype*ind_type,constchar*prefix,constchar*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
elseif (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)

[8]ページ先頭

©2009-2025 Movatter.jp