Skip to content

Commit e346514

Browse files
committed
fix the format in codegen.c
1 parent 3743ffd commit e346514

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

cobj/codegen.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -854,39 +854,39 @@ static void joutput_base(struct cb_field *f) {
854854
/* Base name */
855855
strcpy_identifier_cobol_to_java(name, top->name);
856856
// if (!top->flag_external) {
857-
register_data_storage_list(f, top);
857+
register_data_storage_list(f, top);
858858
// }
859859

860860
if (!top->flag_base) {
861861
// if (!top->flag_external) {
862-
if (!top->flag_local || top->flag_is_global) {
863-
bl = cobc_malloc(sizeof(struct base_list));
864-
bl->f = top;
865-
bl->curr_prog = excp_current_program_id;
866-
bl->next = base_cache;
867-
base_cache = bl;
862+
if (!top->flag_local || top->flag_is_global) {
863+
bl = cobc_malloc(sizeof(struct base_list));
864+
bl->f = top;
865+
bl->curr_prog = excp_current_program_id;
866+
bl->next = base_cache;
867+
base_cache = bl;
868+
} else {
869+
if (current_prog->flag_global_use) {
870+
joutput_local("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name);
871+
joutput_local("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name);
872+
joutput_local("\t/* %s */\n", top->name);
873+
joutput_local("static unsigned char\t*save_%s%s;\n", CB_PREFIX_BASE,
874+
name);
868875
} else {
869-
if (current_prog->flag_global_use) {
870-
joutput_local("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name);
871-
joutput_local("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name);
872-
joutput_local("\t/* %s */\n", top->name);
873-
joutput_local("static unsigned char\t*save_%s%s;\n", CB_PREFIX_BASE,
874-
name);
875-
} else {
876-
joutput_local("unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name);
877-
joutput_local("\t/* %s */\n", top->name);
878-
}
876+
joutput_local("unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name);
877+
joutput_local("\t/* %s */\n", top->name);
879878
}
879+
}
880880
// }
881881
top->flag_base = 1;
882882
}
883883

884884
// if (top->flag_external) {
885885
// joutput("%s%s", CB_PREFIX_BASE, name);
886886
// } else {
887-
if (joutput_field_storage(f, top) && f->offset != 0) {
888-
joutput(".getSubDataStorage(%d)", f->offset);
889-
}
887+
if (joutput_field_storage(f, top) && f->offset != 0) {
888+
joutput(".getSubDataStorage(%d)", f->offset);
889+
}
890890
// }
891891

892892
if (cb_field_variable_address(f)) {
@@ -5085,7 +5085,7 @@ static void joutput_init_method(struct cb_program *prog) {
50855085
blp->f->memory_size);
50865086
} else if (blp->f->flag_external) {
50875087
joutput_initialize_external(cb_build_field_reference(blp->f, NULL),
5088-
blp->f);
5088+
blp->f);
50895089
} else {
50905090
joutput_prefix();
50915091
joutput("%s = new CobolDataStorage(%d);", base_name,

0 commit comments

Comments
 (0)