# New Ticket Created by Andy Dougherty # Please include the string: [perl #18862] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18862 >
Without the following patch, Sun's cc compiler complained: "jit.c", line 504: non-constant initializer: op "NAME" "jit.c", line 702: non-constant initializer: op "U*" "jit.c", line 702: non-constant initializer: op "U*" "jit.c", line 735: non-constant initializer: op "U*" "jit.c", line 735: non-constant initializer: op "U*" The original style was clearer but this at least compiles for me. Suggestions for how to do this better are welcome. --- parrot-current/jit.c Mon Dec 2 11:00:01 2002 +++ parrot-andy/jit.c Wed Dec 4 09:41:11 2002 @@ -501,7 +501,9 @@ op_info_t *op_info; int i, op_arg, typ; opcode_t * cur_op; - char * maps[] = {intval_map, 0, 0, floatval_map}; + char * maps[] = {0, 0, 0, 0}; + maps[0] = intval_map; + maps[3] = floatval_map; map = optimizer->map_branch; /* For each opcode in this section */ @@ -699,10 +701,13 @@ Parrot_jit_optimizer_section_t *sect = jit_info->optimizer->cur_section; Parrot_jit_register_usage_t *ru = sect->ru; int i, typ; - char * maps[] = {jit_info->intval_map, 0, 0, jit_info->floatval_map}; void (*mov_f[4])(struct Parrot_Interp *, int, char *) = { Parrot_jit_emit_mov_rm, 0, 0, Parrot_jit_emit_mov_rm_n}; int lasts[] = { PRESERVED_INT_REGS, 0,0, PRESERVED_FLOAT_REGS }; + char * maps[] = {0, 0, 0, 0}; + maps[0] = jit_info->intval_map; + maps[3] = jit_info->floatval_map; + for (typ = 0; typ < 4; typ++) { if (maps[typ]) { @@ -732,10 +737,12 @@ Parrot_jit_optimizer_section_t *sect = jit_info->optimizer->cur_section; Parrot_jit_register_usage_t *ru = sect->ru; int i, typ; - char * maps[] = {jit_info->intval_map, 0, 0, jit_info->floatval_map}; void (*mov_f[4])(struct Parrot_Interp * , char *, int) = { Parrot_jit_emit_mov_mr, 0, 0, Parrot_jit_emit_mov_mr_n}; int lasts[] = { PRESERVED_INT_REGS, 0,0, PRESERVED_FLOAT_REGS }; + char * maps[] = {0, 0, 0, 0}; + maps[0] = jit_info->intval_map; + maps[3] = jit_info->floatval_map; for (typ = 0; typ < 4; typ++) { if (maps[typ]) -- Andy Dougherty [EMAIL PROTECTED]