summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cgen.c b/cgen.c
index c4427e1..2fd5cbf 100644
--- a/cgen.c
+++ b/cgen.c
@@ -277,11 +277,12 @@ static void cgen_type_post(CGenerator *g, Type *t) {
}
static void cgen_ctype(CGenerator *g, CType *c) {
- if (c->kind & CTYPE_UNSIGNED) {
- c->kind &= (CTypeKind)~(CTypeKind)CTYPE_UNSIGNED;
+ CTypeKind k = c->kind;
+ if (k & CTYPE_UNSIGNED) {
+ k &= (CTypeKind)~(CTypeKind)CTYPE_UNSIGNED;
cgen_write(g, "unsigned ");
}
- switch (c->kind) {
+ switch (k) {
case CTYPE_CHAR:
cgen_write(g, "char");
break;