Skip to content

Commit f6b84eb

Browse files
committed
コーディングをオリジナルコードに合わせました
1 parent ec507cd commit f6b84eb

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

cobc/codegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4360,7 +4360,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
43604360
prog->program_id);
43614361
}
43624362
}
4363-
output_line("cob_set_programid(&module, \"%s\");", prog->program_id);
4363+
output_line ("cob_set_programid(&module, \"%s\");", prog->program_id);
43644364
if (prog->decimal_index_max) {
43654365
output_line ("/* Initialize decimal numbers */");
43664366
for (i = 0; i < prog->decimal_index_max; i++) {

libcob/common.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,14 +2659,15 @@ cob_acuw_justify (unsigned char *data, ...)
26592659
}
26602660

26612661
void
2662-
cob_set_programid(struct cob_module *module, const char *program_name){
2662+
cob_set_programid (struct cob_module *module, const char *program_name)
2663+
{
26632664
int length;
2664-
length = strlen(program_name);
2665-
if (module->program_id != NULL){
2666-
free(module->program_id);
2665+
length = strlen (program_name);
2666+
if (module->program_id != NULL) {
2667+
free (module->program_id);
26672668
}
2668-
module->program_id = cob_malloc((const size_t)length+1);
2669-
strcpy(module->program_id, program_name);
2669+
module->program_id = cob_malloc ((const size_t) length+1);
2670+
strcpy (module->program_id, program_name);
26702671
}
26712672

26722673
int
@@ -2676,23 +2677,23 @@ cob_acuw_calledby (unsigned char *data)
26762677
cob_field *f1;
26772678
char *called_program_name;
26782679

2679-
COB_CHK_PARMS(C$CALLEDBY, 1);
2680+
COB_CHK_PARMS (C$CALLEDBY, 1);
26802681

26812682
if (cob_current_module->cob_procedure_parameters[0]) {
26822683
f1 = cob_current_module->cob_procedure_parameters[0];
26832684
if (cob_current_module->next == NULL){
2684-
memset(f1->data, ' ', (int)f1->size);
2685+
memset (f1->data, ' ', (int)f1->size);
26852686
return 0;
26862687
}else{
26872688
called_program_name = (const char *)cob_current_module->next->program_id;
26882689
if (called_program_name == NULL){
26892690
return -1;
26902691
}
26912692
length = (int)f1->size;
2692-
if (strlen(called_program_name) < length){
2693-
length = strlen(called_program_name);
2693+
if (strlen (called_program_name) < length){
2694+
length = strlen (called_program_name);
26942695
}
2695-
memcpy(f1->data, called_program_name, length);
2696+
memcpy (f1->data, called_program_name, length);
26962697
}
26972698
}
26982699
return 1;

libcob/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ struct cob_module {
351351
const unsigned char flag_binary_truncate;
352352
const unsigned char flag_pretty_display;
353353
const unsigned char spare8;
354-
char *program_id;
354+
char *program_id;
355355
};
356356

357357
/*******************************/
@@ -462,7 +462,7 @@ COB_EXPIMP void cob_ready_trace (void);
462462
COB_EXPIMP void cob_reset_trace (void);
463463

464464
COB_EXPIMP void cob_set_programid (struct cob_module *,
465-
const char *);
465+
const char *);
466466

467467
/* Switch */
468468

0 commit comments

Comments
 (0)