From 0f1a586272e4f3e61e0b659191c44b315ef18604 Mon Sep 17 00:00:00 2001 From: Andreas Kirsch Date: Sun, 21 Aug 2005 00:10:39 +0000 Subject: [PATCH] Fix a stupid bug which caused ifstring not to work (use typecmp instead of a pointer comparison). >_< git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1240 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 462ac55b6..56c362408 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -4637,7 +4637,7 @@ void QCC_PR_ParseStatement (void) else patch1 = NULL; } - else if (e->type == type_string) //special case, as strings are now pointers, not offsets from string table + else if (!typecmp( e->type, type_string)) //special case, as strings are now pointers, not offsets from string table { QCC_PR_ParseWarning(0, "while (string) can result in bizzare behaviour"); QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_IFNOTS], e, 0, &patch1)); @@ -4796,7 +4796,7 @@ void QCC_PR_ParseStatement (void) } else { - if (e->type == type_string && flag_ifstring) + if (!typecmp( e->type, type_string)) { QCC_PR_ParseWarning(WARN_IFSTRING_USED, "do {} while(string) can result in bizzare behaviour"); QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_IFS], e, NULL, &patch2)); @@ -4890,7 +4890,7 @@ void QCC_PR_ParseStatement (void) if (negate) { - if (e->type == type_string && flag_ifstring) //special case, as strings are now pointers, not offsets from string table + if (!typecmp( e->type, type_string)) //special case, as strings are now pointers, not offsets from string table { QCC_PR_ParseWarning(WARN_IFSTRING_USED, "if not(string) can result in bizzare behaviour"); QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_IFS], e, 0, &patch1)); @@ -4900,7 +4900,7 @@ void QCC_PR_ParseStatement (void) } else { - if (e->type == type_string && flag_ifstring) //special case, as strings are now pointers, not offsets from string table + if (!typecmp( e->type, type_string)) //special case, as strings are now pointers, not offsets from string table { QCC_PR_ParseWarning(WARN_IFSTRING_USED, "if (string) can result in bizzare behaviour"); QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_IFNOTS], e, 0, &patch1));