From 01d3c60fe0293519161d6e78bb4daa1a639db9df Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 15 Nov 2024 18:00:46 +0900 Subject: [PATCH] [qfcc] Encode param qualifiers in function type I'm not sure whether I'll stick with the current encoding, but it turns out it's necessary to separate function types on parameter qualifiers (I was half expecting that, though). --- tools/qfcc/source/type.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 3f4c12b77..5abe54612 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -1146,8 +1146,13 @@ encode_params (const type_t *type) count = -type->func.num_params - 1; else count = type->func.num_params; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + // in is the default qualifier + if (type->func.param_quals[i] != pq_in) { + dasprintf (encoding, "%c", "c_Oo"[type->func.param_quals[i]]); + } encode_type (encoding, unalias_type (type->func.param_types[i])); + } if (type->func.num_params < 0) dasprintf (encoding, ".");