@@ -839,15 +839,8 @@ static void joutput_base(struct cb_field *f) {
839
839
840
840
// EDIT
841
841
/* Base name */
842
- if (top -> flag_external ) {
843
- strcpy (name , top -> name );
844
- char * nmp ;
845
- for (nmp = name ; * nmp ; nmp ++ ) {
846
- if (* nmp == '-' ) {
847
- * nmp = '_' ;
848
- }
849
- }
850
- } else {
842
+ strcpy_identifier_cobol_to_java (name , top -> name );
843
+ if (!top -> flag_external ) {
851
844
register_data_storage_list (f , top );
852
845
}
853
846
@@ -2249,9 +2242,7 @@ static void joutput_initialize_fp(cb_tree x, struct cb_field *f) {
2249
2242
}
2250
2243
2251
2244
static void joutput_initialize_external (cb_tree x , struct cb_field * f ) {
2252
- unsigned char * p ;
2253
2245
cb_tree file ;
2254
- char name [COB_MINI_BUFF ];
2255
2246
2256
2247
joutput_prefix ();
2257
2248
joutput_data (x );
@@ -2260,22 +2251,10 @@ static void joutput_initialize_external(cb_tree x, struct cb_field *f) {
2260
2251
f -> size );
2261
2252
} else if (f -> storage == CB_STORAGE_FILE ) {
2262
2253
file = CB_TREE (f -> file );
2263
- strcpy (name , CB_FILE (file )-> record -> name );
2264
- for (p = (unsigned char * )name ; * p ; p ++ ) {
2265
- if (* p == '-' ) {
2266
- * p = '_' ;
2267
- }
2268
- }
2269
- joutput (" = CobolExternal.getStorageAddress (\"%s\", %d);\n" , name ,
2270
- f -> size );
2254
+ joutput (" = CobolExternal.getStorageAddress (\"%s\", %d);\n" ,
2255
+ CB_FILE (file )-> record -> name , f -> size );
2271
2256
} else {
2272
- strcpy (name , f -> name );
2273
- for (p = (unsigned char * )name ; * p ; p ++ ) {
2274
- if (islower (* p )) {
2275
- * p = (unsigned char )toupper (* p );
2276
- }
2277
- }
2278
- joutput (" = CobolExternal.getStorageAddress (\"%s\", %d);\n" , name ,
2257
+ joutput (" = CobolExternal.getStorageAddress (\"%s\", %d);\n" , f -> name ,
2279
2258
f -> size );
2280
2259
}
2281
2260
}
@@ -4401,13 +4380,11 @@ static void joutput_internal_function(struct cb_program *prog,
4401
4380
cb_tree l ;
4402
4381
struct cb_field * f ;
4403
4382
struct cb_file * fl ;
4404
- char * p ;
4405
4383
int i ;
4406
4384
// int n;
4407
4385
int parmnum = 0 ;
4408
4386
// int seen = 0;
4409
4387
// int anyseen;
4410
- char name [COB_MINI_BUFF ];
4411
4388
4412
4389
/* Program function */
4413
4390
// output ("static int\n%s_ (const int entry", prog->program_id);
@@ -4654,15 +4631,11 @@ static void joutput_internal_function(struct cb_program *prog,
4654
4631
for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
4655
4632
f = CB_FILE (CB_VALUE (l ))-> record ;
4656
4633
if (f -> flag_external ) {
4657
- strcpy (name , f -> name );
4658
- for (p = name ; * p ; p ++ ) {
4659
- if (* p == '-' ) {
4660
- * p = '_' ;
4661
- }
4662
- }
4663
- joutput_line ("%s%s = CobolExternal.getStorageAddress (\"%s\", %d);" ,
4664
- CB_PREFIX_BASE , name , name ,
4665
- CB_FILE (CB_VALUE (l ))-> record_max );
4634
+ joutput_prefix ();
4635
+ joutput_base (f );
4636
+ joutput (" = CobolExternal.getStorageAddress (\"%s\", %d);" , f -> name ,
4637
+ CB_FILE (CB_VALUE (l ))-> record_max );
4638
+ joutput_newline ();
4666
4639
}
4667
4640
}
4668
4641
joutput_initial_values (prog -> working_storage );
@@ -4752,15 +4725,10 @@ static void joutput_internal_function(struct cb_program *prog,
4752
4725
for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
4753
4726
f = CB_FILE (CB_VALUE (l ))-> record ;
4754
4727
if (f -> flag_external ) {
4755
- strcpy (name , f -> name );
4756
- for (p = name ; * p ; p ++ ) {
4757
- if (* p == '-' ) {
4758
- * p = '_' ;
4759
- }
4760
- }
4761
- joutput_line ("%s%s = CobolExternal.getStorageAddress (\"%s\", %d);" ,
4762
- CB_PREFIX_BASE , name , name ,
4763
- CB_FILE (CB_VALUE (l ))-> record_max );
4728
+ joutput_prefix ();
4729
+ joutput_base (f );
4730
+ joutput_line (" = CobolExternal.getStorageAddress (\"%s\", %d);" ,
4731
+ f -> name , CB_FILE (CB_VALUE (l ))-> record_max );
4764
4732
}
4765
4733
}
4766
4734
joutput_initial_values (prog -> working_storage );
@@ -5492,8 +5460,6 @@ static void joutput_declare_member_variables(struct cb_program *prog,
5492
5460
struct base_list * blp ;
5493
5461
const char * prevprog ;
5494
5462
struct cb_field * f ;
5495
- char * p ;
5496
- char name [COB_MINI_BUFF ];
5497
5463
5498
5464
/* CobolDecimal型変数の宣言 */
5499
5465
if (prog -> decimal_index_max ) {
@@ -5611,27 +5577,21 @@ static void joutput_declare_member_variables(struct cb_program *prog,
5611
5577
/* External items */
5612
5578
for (f = prog -> working_storage ; f ; f = f -> sister ) {
5613
5579
if (f -> flag_external ) {
5614
- strcpy (name , f -> name );
5615
- for (p = name ; * p ; p ++ ) {
5616
- if (* p == '-' ) {
5617
- * p = '_' ;
5618
- }
5619
- }
5620
- joutput ("private CobolDataStorage\t%s%s = null;" , CB_PREFIX_BASE , name );
5621
- joutput (" /* %s */\n" , f -> name );
5580
+ joutput_prefix ();
5581
+ joutput ("private CobolDataStorage " );
5582
+ joutput_base (f );
5583
+ joutput (" = null; /* %s */" , f -> name );
5584
+ joutput_newline ();
5622
5585
}
5623
5586
}
5624
5587
for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
5625
5588
f = CB_FILE (CB_VALUE (l ))-> record ;
5626
5589
if (f -> flag_external ) {
5627
- strcpy (name , f -> name );
5628
- for (p = name ; * p ; p ++ ) {
5629
- if (* p == '-' ) {
5630
- * p = '_' ;
5631
- }
5632
- }
5633
- joutput ("private CobolDataStorage\t%s%s = null;" , CB_PREFIX_BASE , name );
5634
- joutput (" /* %s */\n" , f -> name );
5590
+ joutput_prefix ();
5591
+ joutput ("private CobolDataStorage " );
5592
+ joutput_base (f );
5593
+ joutput (" = null; /* %s */" , f -> name );
5594
+ joutput_newline ();
5635
5595
}
5636
5596
}
5637
5597
0 commit comments