@@ -839,15 +839,8 @@ static void joutput_base(struct cb_field *f) {
839839
840840 // EDIT
841841 /* 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 ) {
851844 register_data_storage_list (f , top );
852845 }
853846
@@ -2249,9 +2242,7 @@ static void joutput_initialize_fp(cb_tree x, struct cb_field *f) {
22492242}
22502243
22512244static void joutput_initialize_external (cb_tree x , struct cb_field * f ) {
2252- unsigned char * p ;
22532245 cb_tree file ;
2254- char name [COB_MINI_BUFF ];
22552246
22562247 joutput_prefix ();
22572248 joutput_data (x );
@@ -2260,22 +2251,10 @@ static void joutput_initialize_external(cb_tree x, struct cb_field *f) {
22602251 f -> size );
22612252 } else if (f -> storage == CB_STORAGE_FILE ) {
22622253 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 );
22712256 } 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 ,
22792258 f -> size );
22802259 }
22812260}
@@ -4401,13 +4380,11 @@ static void joutput_internal_function(struct cb_program *prog,
44014380 cb_tree l ;
44024381 struct cb_field * f ;
44034382 struct cb_file * fl ;
4404- char * p ;
44054383 int i ;
44064384 // int n;
44074385 int parmnum = 0 ;
44084386 // int seen = 0;
44094387 // int anyseen;
4410- char name [COB_MINI_BUFF ];
44114388
44124389 /* Program function */
44134390 // output ("static int\n%s_ (const int entry", prog->program_id);
@@ -4654,15 +4631,11 @@ static void joutput_internal_function(struct cb_program *prog,
46544631 for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
46554632 f = CB_FILE (CB_VALUE (l ))-> record ;
46564633 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 ();
46664639 }
46674640 }
46684641 joutput_initial_values (prog -> working_storage );
@@ -4752,15 +4725,10 @@ static void joutput_internal_function(struct cb_program *prog,
47524725 for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
47534726 f = CB_FILE (CB_VALUE (l ))-> record ;
47544727 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 );
47644732 }
47654733 }
47664734 joutput_initial_values (prog -> working_storage );
@@ -5492,8 +5460,6 @@ static void joutput_declare_member_variables(struct cb_program *prog,
54925460 struct base_list * blp ;
54935461 const char * prevprog ;
54945462 struct cb_field * f ;
5495- char * p ;
5496- char name [COB_MINI_BUFF ];
54975463
54985464 /* CobolDecimal型変数の宣言 */
54995465 if (prog -> decimal_index_max ) {
@@ -5611,27 +5577,21 @@ static void joutput_declare_member_variables(struct cb_program *prog,
56115577 /* External items */
56125578 for (f = prog -> working_storage ; f ; f = f -> sister ) {
56135579 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 ();
56225585 }
56235586 }
56245587 for (l = prog -> file_list ; l ; l = CB_CHAIN (l )) {
56255588 f = CB_FILE (CB_VALUE (l ))-> record ;
56265589 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 ();
56355595 }
56365596 }
56375597
0 commit comments