From 0143a2410ccc5fc6d09ca0f727242cb553d24ac2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 20 Jan 2025 00:50:32 +0900 Subject: [PATCH] [qfcc] Use const type_t * for new_horizontal_expr It was missed in the type_t const-correctness pass. --- tools/qfcc/include/expr.h | 4 ++-- tools/qfcc/source/expr.c | 2 +- tools/qfcc/source/statements.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index 8bf479f11..05564a0b4 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -304,7 +304,7 @@ typedef struct { typedef struct { int op; ///< operation to perform const expr_t *vec; ///< vector expression on which to operate - type_t *type; ///< result type + const type_t *type; ///< result type } ex_horizontal_t; typedef struct { @@ -669,7 +669,7 @@ const expr_t *paren_expr (const expr_t *e); \return The new unary expression node (::ex_expr_t) if \a e1 is not an error expression, otherwise \a e1. */ -expr_t *new_horizontal_expr (int op, const expr_t *vec, type_t *type); +expr_t *new_horizontal_expr (int op, const expr_t *vec, const type_t *type); const expr_t *new_swizzle_expr (const expr_t *src, const char *swizzle); diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 825bf26b0..86f618ec3 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -609,7 +609,7 @@ paren_expr (const expr_t *e) } expr_t * -new_horizontal_expr (int op, const expr_t *vec, type_t *type) +new_horizontal_expr (int op, const expr_t *vec, const type_t *type) { if (vec->type == ex_error) { return (expr_t *) vec; diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index de310cf63..22d442ef7 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -2064,7 +2064,7 @@ expr_horizontal (sblock_t *sblock, const expr_t *e, operand_t **op) const char *opcode = "hops"; statement_t *s; int hop; - type_t *res_type = e->hop.type; + const type_t *res_type = e->hop.type; auto vec_type = get_type (e->hop.vec); switch (e->hop.op) {