@@ -104,7 +104,6 @@ struct attr_list {
104104struct literal_list {
105105 struct literal_list * next ;
106106 struct cb_literal * literal ;
107- cb_tree x ;
108107 int id ;
109108 int make_decimal ;
110109};
@@ -720,7 +719,12 @@ output_string (const unsigned char *s, const int size, const cob_u32_t llit)
720719 } else
721720#endif
722721 if (!isprint (c )) {
722+ #if 1 /* octal */
723723 output ("\\%03o" , c );
724+ #else /* hex (can be useful for a small amount of non-printable characters,
725+ but gets really uggly if the string has a lot of those */
726+ output ("\" \"\\x%X\" \"" , c );
727+ #endif
724728 } else if (c == '\"' ) {
725729 output ("\\%c" , c );
726730 } else if ((c == '\\' || c == '?' ) && !llit ) {
@@ -825,18 +829,17 @@ chk_field_variable_address (struct cb_field *fld)
825829 if (!cb_odoslide )
826830 return 0 ;
827831 if (!fld -> flag_vaddr_done ) {
828- /* Note: this is called _very_ often and takes 15-20% of parse + codegen time,
832+ /* Note: this was called _very_ often and took 15-20% of parse + codegen time,
829833 with about half the time in chk_field_variable_size; so try to not call
830834 this function if not necessary (according to the testsuite: as long as
831835 cb_odoslide is not set, but the caller's coverage is not that well...) */
832836 struct cb_field * f = fld ;
833837 struct cb_field * p ;
834838 for (p = f -> parent ; p ; f = f -> parent , p = f -> parent ) {
835839 for (p = p -> children ; p != f ; p = p -> sister ) {
836- /* Skip PIC L fields as their representation
837- have constant length */
838- if (p -> depending ||
839- (!p -> flag_picture_l && chk_field_variable_size (p ))) {
840+ if (p -> depending /* ODO leads to variable size */
841+ || (!p -> flag_picture_l && chk_field_variable_size (p )) /* skipping PIC L fields */
842+ ) {
840843 fld -> flag_vaddr_done = 1 ;
841844 fld -> vaddr = 1 ;
842845 return 1 ;
@@ -3177,7 +3180,7 @@ output_literals_figuratives_and_constants (void)
31773180 for (lit = literal_cache ; lit ; lit = lit -> next ) {
31783181 output ("static const cob_field %s%d\t= " ,
31793182 CB_PREFIX_CONST , lit -> id );
3180- output_field (lit -> x );
3183+ output_field (CB_TREE ( lit -> literal ) );
31813184 output (";" );
31823185 output_newline ();
31833186 }
@@ -3379,7 +3382,6 @@ cb_lookup_literal (cb_tree x, int make_decimal)
33793382 l -> id = cb_literal_id ;
33803383 l -> literal = literal ;
33813384 l -> make_decimal = make_decimal ;
3382- l -> x = x ;
33833385 l -> next = literal_cache ;
33843386 literal_cache = l ;
33853387
@@ -5579,8 +5581,8 @@ output_initialize_uniform (cb_tree x, struct cb_field *f,
55795581 output_size (x );
55805582 output (");" );
55815583 } else if (!gen_init_working
5582- && (f -> flag_unbounded || !(cb_complex_odo || cb_odoslide ))
5583- && chk_field_variable_size (f ) != NULL ) {
5584+ && (f -> flag_unbounded || !(cb_complex_odo || cb_odoslide ))
5585+ && chk_field_variable_size (f ) != NULL ) {
55845586 out_odoslide_size (f );
55855587 output (");" );
55865588 } else {
@@ -13568,7 +13570,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
1356813570 /* Check matching version */
1356913571#if !defined (HAVE_ATTRIBUTE_CONSTRUCTOR )
1357013572#ifdef _WIN32
13571- if (prog -> flag_main ) /* otherwise we generate that in DllMain*/
13573+ if (prog -> flag_main ) /* otherwise we generate that in DllMain */
1357213574#else
1357313575 if (!prog -> nested_level )
1357413576#endif
@@ -13667,8 +13669,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
1366713669
1366813670 seen = 0 ;
1366913671 for (m = literal_cache ; m ; m = m -> next ) {
13670- if (CB_TREE_CLASS (m -> x ) == CB_CLASS_NUMERIC
13671- && m -> make_decimal ) {
13672+ if (m -> make_decimal ) {
1367213673 if (!seen ) {
1367313674 seen = 1 ;
1367413675 output_line ("/* Set Decimal Constant values */" );
@@ -13887,8 +13888,7 @@ output_internal_function (struct cb_program *prog, cb_tree parameter_list)
1388713888 output_line ("P_clear_decimal:" );
1388813889 seen = 0 ;
1388913890 for (m = literal_cache ; m ; m = m -> next ) {
13890- if (CB_TREE_CLASS (m -> x ) == CB_CLASS_NUMERIC
13891- && m -> make_decimal ) {
13891+ if (m -> make_decimal ) {
1389213892 if (!seen ) {
1389313893 seen = 1 ;
1389413894 output_line ("/* Clear Decimal Constant values */" );
@@ -14972,8 +14972,7 @@ codegen_finalize (void)
1497214972 struct literal_list * m ;
1497314973 int comment_gen = 0 ;
1497414974 for (m = literal_cache ; m ; m = m -> next ) {
14975- if (CB_TREE_CLASS (m -> x ) == CB_CLASS_NUMERIC
14976- && m -> make_decimal ) {
14975+ if (m -> make_decimal ) {
1497714976 if (!comment_gen ) {
1497814977 comment_gen = 1 ;
1497914978 output_storage ("\n/* Decimal constants */\n" );
0 commit comments