From 6b7b8738b3f42071bd09feb37a7a0bb50bfbd280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Thu, 13 Feb 2025 16:58:59 +0100 Subject: [PATCH] r300: do not include newline in the error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/compiler/r300_fragprog_emit.c | 6 +++--- src/gallium/drivers/r300/compiler/r500_fragprog_emit.c | 6 +++--- src/gallium/drivers/r300/compiler/radeon_compiler.c | 4 ++-- .../drivers/r300/compiler/radeon_compiler_util.c | 2 +- src/gallium/drivers/r300/compiler/radeon_dataflow.c | 2 +- .../drivers/r300/compiler/radeon_dataflow_deadcode.c | 8 ++++---- .../drivers/r300/compiler/radeon_pair_schedule.c | 8 ++++---- .../drivers/r300/compiler/radeon_pair_translate.c | 10 ++++------ src/gallium/drivers/r300/compiler/radeon_program.c | 2 +- src/gallium/drivers/r300/compiler/radeon_vert_fc.c | 3 +-- 10 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c index eaf40643efe..0a7a52e1633 100644 --- a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c +++ b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c @@ -38,7 +38,7 @@ struct r300_emit_state { #define error(fmt, args...) \ do { \ - rc_error(&c->Base, "%s::%s(): " fmt "\n", __FILE__, __func__, ##args); \ + rc_error(&c->Base, "%s::%s(): " fmt, __FILE__, __func__, ##args); \ } while (0) static unsigned int @@ -141,7 +141,7 @@ emit_alu(struct r300_emit_state *emit, struct rc_pair_instruction *inst) /* rc_recompute_ips does not give an exact count, because it counts extra stuff * like BEGINTEX, but here it is intended to be only approximative anyway, * just to give some idea how close to the limit we are. */ - rc_error(&c->Base, "Too many ALU instructions used: %u, max: %u.\n", + rc_error(&c->Base, "Too many ALU instructions used: %u, max: %u", rc_recompute_ips(&c->Base), c->Base.max_alu_insts); return 0; } @@ -456,7 +456,7 @@ r300BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user) } if (code->pixsize >= compiler->Base.max_temp_regs) - rc_error(&compiler->Base, "Too many hardware temporaries used.\n"); + rc_error(&compiler->Base, "Too many hardware temporaries used"); if (compiler->Base.Error) return; diff --git a/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c b/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c index 8aeefba5697..fac09e6adbe 100644 --- a/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c +++ b/src/gallium/drivers/r300/compiler/r500_fragprog_emit.c @@ -159,7 +159,7 @@ translate_alu_result_op(struct r300_fragment_program_compiler *c, rc_compare_fun case RC_COMPARE_FUNC_GEQUAL: return R500_INST_ALU_RESULT_OP_GE; case RC_COMPARE_FUNC_NOTEQUAL: return R500_INST_ALU_RESULT_OP_NE; default: - rc_error(&c->Base, "%s: unsupported compare func %i\n", __func__, func); + rc_error(&c->Base, "%s: unsupported compare func %i", __func__, func); return 0; } } @@ -569,7 +569,7 @@ emit_flowcontrol(struct emit_state *s, struct rc_instruction *inst) s->CurrentBranchDepth--; break; default: - rc_error(s->C, "%s: unknown opcode %s\n", __func__, + rc_error(s->C, "%s: unknown opcode %s", __func__, rc_get_opcode_info(inst->U.I.Opcode)->Name); } } @@ -607,7 +607,7 @@ r500BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user) } if (code->max_temp_idx >= compiler->Base.max_temp_regs) - rc_error(&compiler->Base, "Too many hardware temporaries used\n"); + rc_error(&compiler->Base, "Too many hardware temporaries used"); if (compiler->Base.Error) return; diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.c b/src/gallium/drivers/r300/compiler/radeon_compiler.c index 880a44b112e..c1bcedd3889 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler.c @@ -91,7 +91,7 @@ rc_error(struct radeon_compiler *c, const char *fmt, ...) int rc_if_fail_helper(struct radeon_compiler *c, const char *file, int line, const char *assertion) { - rc_error(c, "ICE at %s:%i: assertion failed: %s\n", file, line, assertion); + rc_error(c, "ICE at %s:%i: assertion failed: %s", file, line, assertion); return 1; } @@ -530,7 +530,7 @@ rc_validate_final_shader(struct radeon_compiler *c, void *user) { /* Check the number of constants. */ if (c->Program.Constants.Count > c->max_constants) { - rc_error(c, "Too many constants. Max: %i, Got: %i\n", c->max_constants, + rc_error(c, "Too many constants. Max: %i, Got: %i", c->max_constants, c->Program.Constants.Count); } } diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c index a5e8aba991a..93d0e3f7b1f 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c @@ -682,7 +682,7 @@ rc_get_constant_value(struct radeon_compiler *c, unsigned int index, unsigned in float base = 1.0f; int swz = GET_SWZ(swizzle, chan); if (swz >= 4 || index >= c->Program.Constants.Count) { - rc_error(c, "get_constant_value: Can't find a value.\n"); + rc_error(c, "get_constant_value: Can't find a value"); return 0.0f; } if (GET_BIT(negate, chan)) { diff --git a/src/gallium/drivers/r300/compiler/radeon_dataflow.c b/src/gallium/drivers/r300/compiler/radeon_dataflow.c index 5cf4dcdb15b..ff6b51db329 100644 --- a/src/gallium/drivers/r300/compiler/radeon_dataflow.c +++ b/src/gallium/drivers/r300/compiler/radeon_dataflow.c @@ -649,7 +649,7 @@ get_readers_for_single_write(void *userdata, struct rc_instruction *writer, endloop = tmp; tmp = rc_match_endloop(tmp); if (!tmp) { - rc_error(d->C, "Failed to match endloop.\n"); + rc_error(d->C, "Failed to match endloop"); d->ReaderData->Abort = 1; return; } diff --git a/src/gallium/drivers/r300/compiler/radeon_dataflow_deadcode.c b/src/gallium/drivers/r300/compiler/radeon_dataflow_deadcode.c index 2047f87318e..40506e825d2 100644 --- a/src/gallium/drivers/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/gallium/drivers/r300/compiler/radeon_dataflow_deadcode.c @@ -89,7 +89,7 @@ get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index { if (file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) { if (index >= RC_REGISTER_MAX_INDEX) { - rc_error(s->C, "%s: index %i is out of bounds for file %i\n", __func__, index, file); + rc_error(s->C, "%s: index %i is out of bounds for file %i", __func__, index, file); return NULL; } @@ -101,7 +101,7 @@ get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index return &s->R.Address; } else if (file == RC_FILE_SPECIAL) { if (index >= RC_NUM_SPECIAL_REGISTERS) { - rc_error(s->C, "%s: special file index %i out of bounds\n", __func__, index); + rc_error(s->C, "%s: special file index %i out of bounds", __func__, index); return NULL; } @@ -261,14 +261,14 @@ rc_dataflow_deadcode(struct radeon_compiler *c, void *user) s.BranchStackSize--; } else if (opcode->Opcode == RC_OPCODE_ELSE) { if (branch->HaveElse) { - rc_error(c, "%s: Multiple ELSE for one IF/ENDIF\n", __func__); + rc_error(c, "%s: Multiple ELSE for one IF/ENDIF", __func__); } else { memcpy(&branch->StoreElse, &s.R, sizeof(s.R)); memcpy(&s.R, &branch->StoreEndif, sizeof(s.R)); branch->HaveElse = 1; } } else { - rc_error(c, "%s: Unhandled control flow instruction %s\n", __func__, opcode->Name); + rc_error(c, "%s: Unhandled control flow instruction %s", __func__, opcode->Name); } } } diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c b/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c index 369ada4b19e..790096a1008 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_schedule.c @@ -150,7 +150,7 @@ get_reg_valuep(struct schedule_state *s, rc_register_file file, unsigned int ind return NULL; if (index >= RC_REGISTER_MAX_INDEX) { - rc_error(s->C, "%s: index %i out of bounds\n", __func__, index); + rc_error(s->C, "%s: index %i out of bounds", __func__, index); return NULL; } @@ -764,7 +764,7 @@ rgb_to_alpha_remap(struct schedule_state *s, struct rc_instruction *inst, /* This conversion is not possible, we must have made a mistake in * is_rgb_to_alpha_possible. */ if (new_src_index < 0) { - rc_error(s->C, "rgb_to_alpha_remap failed to allocate src.\n"); + rc_error(s->C, "rgb_to_alpha_remap failed to allocate src"); return; } @@ -1181,7 +1181,7 @@ scan_read(void *data, struct rc_instruction *inst, rc_register_file file, unsign (*v)->NumReaders++; if (s->Current->NumReadValues >= 12) { - rc_error(s->C, "%s: NumReadValues overflow\n", __func__); + rc_error(s->C, "%s: NumReadValues overflow", __func__); } else { s->Current->ReadValues[s->Current->NumReadValues++] = *v; } @@ -1216,7 +1216,7 @@ scan_write(void *data, struct rc_instruction *inst, rc_register_file file, unsig *pv = newv; if (s->Current->NumWriteValues >= 4) { - rc_error(s->C, "%s: NumWriteValues overflow\n", __func__); + rc_error(s->C, "%s: NumWriteValues overflow", __func__); } else { s->Current->WriteValues[s->Current->NumWriteValues++] = newv; } diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_translate.c b/src/gallium/drivers/r300/compiler/radeon_pair_translate.c index 8f92365cc89..49110f676a4 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_translate.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_translate.c @@ -224,8 +224,7 @@ set_pair_instruction(struct r300_fragment_program_compiler *c, struct rc_pair_in source = rc_pair_alloc_source(pair, srcrgb, srcalpha, inst->SrcReg[i].File, inst->SrcReg[i].Index); if (source < 0) { - rc_error(&c->Base, "Failed to translate " - "rgb instruction.\n"); + rc_error(&c->Base, "Failed to translate rgb instruction"); return; } pair->RGB.Arg[i].Source = source; @@ -251,8 +250,7 @@ set_pair_instruction(struct r300_fragment_program_compiler *c, struct rc_pair_in source = rc_pair_alloc_source(pair, srcrgb, srcalpha, inst->SrcReg[i].File, inst->SrcReg[i].Index); if (source < 0) { - rc_error(&c->Base, "Failed to translate " - "alpha instruction.\n"); + rc_error(&c->Base, "Failed to translate alpha instruction"); return; } pair->Alpha.Arg[i].Source = source; @@ -316,7 +314,7 @@ check_opcode_support(struct r300_fragment_program_compiler *c, struct rc_sub_ins if (opcode->HasDstReg) { if (inst->SaturateMode == RC_SATURATE_MINUS_PLUS_ONE) { - rc_error(&c->Base, "Fragment program does not support signed Saturate.\n"); + rc_error(&c->Base, "Fragment program does not support signed Saturate"); return; } } @@ -324,7 +322,7 @@ check_opcode_support(struct r300_fragment_program_compiler *c, struct rc_sub_ins for (unsigned i = 0; i < opcode->NumSrcRegs; i++) { if (inst->SrcReg[i].RelAddr) { rc_error(&c->Base, "Fragment program does not support relative addressing " - " of source operands.\n"); + " of source operands."); return; } } diff --git a/src/gallium/drivers/r300/compiler/radeon_program.c b/src/gallium/drivers/r300/compiler/radeon_program.c index 0359d8574bc..91c4b596aba 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program.c +++ b/src/gallium/drivers/r300/compiler/radeon_program.c @@ -64,7 +64,7 @@ rc_find_free_temporary(struct radeon_compiler *c) c->max_temp_index++; if (c->max_temp_index > RC_REGISTER_MAX_INDEX) { - rc_error(c, "Ran out of temporary registers\n"); + rc_error(c, "Ran out of temporary registers"); return 0; } return c->max_temp_index; diff --git a/src/gallium/drivers/r300/compiler/radeon_vert_fc.c b/src/gallium/drivers/r300/compiler/radeon_vert_fc.c index c5bbadc63bd..44875a201a6 100644 --- a/src/gallium/drivers/r300/compiler/radeon_vert_fc.c +++ b/src/gallium/drivers/r300/compiler/radeon_vert_fc.c @@ -76,8 +76,7 @@ reserve_predicate_reg(struct vert_fc_state *fc_state) } } if (i == fc_state->C->max_temp_regs) { - rc_error(fc_state->C, "No free temporary to use for" - " predicate stack counter.\n"); + rc_error(fc_state->C, "No free temporary to use for predicate stack counter"); return -1; } return 1;