From 3516970ab392efe4b89854a0f475dc3e8775ab61 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 9 Jul 2014 03:29:11 -0400 Subject: [PATCH] ide/Debugger/watches: Fix unichar evaluation broken by fa765a838029ec71a86787e95ebcab5fda0aae1e - Corrected reference to unichar full name - Corrected message to say invalid 'Codepoint' rather than 'Keypoint' - Fixed sizeof evaluation for L"strings" --- compiler/bootstrap/libec/bootstrap/ast.c | 2 ++ compiler/libec/src/ast.ec | 1 + ide/src/debugger/Debugger.ec | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/bootstrap/libec/bootstrap/ast.c b/compiler/bootstrap/libec/bootstrap/ast.c index 0195a8c..d88eff8 100644 --- a/compiler/bootstrap/libec/bootstrap/ast.c +++ b/compiler/bootstrap/libec/bootstrap/ast.c @@ -3700,6 +3700,8 @@ char ch; unsigned int escaped = 0; char * s = d->initializer->__anon1.exp->__anon1.__anon2.string; +if(s[0] == 'L') +s++; for(c = 1; (ch = s[c]); c++) { if(ch == '\\' && !escaped) diff --git a/compiler/libec/src/ast.ec b/compiler/libec/src/ast.ec index 5ce9fb3..6b696f8 100644 --- a/compiler/libec/src/ast.ec +++ b/compiler/libec/src/ast.ec @@ -979,6 +979,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators) char ch; bool escaped = false; char * s = d.initializer.exp.string; + if(s[0] == 'L') s++; // MAKE MORE ACCURATE for(c = 1; (ch = s[c]); c++) diff --git a/ide/src/debugger/Debugger.ec b/ide/src/debugger/Debugger.ec index 0b028eb..7f4b802 100644 --- a/ide/src/debugger/Debugger.ec +++ b/ide/src/debugger/Debugger.ec @@ -3070,7 +3070,7 @@ class Debugger result = true; } else if(wh.type && (wh.type.kind == charType || (wh.type.kind == classType && wh.type._class && - wh.type._class.registered && !strcmp(wh.type._class.registered.fullName, "ecere::com::unichar"))) ) + wh.type._class.registered && !strcmp(wh.type._class.registered.fullName, "unichar"))) ) { unichar value; int signedValue; @@ -3128,7 +3128,7 @@ class Debugger else if(value > 256 || wh.type.kind != charType) { if(value > 0x10FFFF || !GetCharCategory(value)) - snprintf(string, sizeof(string), $"Invalid Unicode Keypoint (0x%08X)", value); + snprintf(string, sizeof(string), $"Invalid Unicode Codepoint (0x%08X)", value); else snprintf(string, sizeof(string), "\'%s\' (U+%04X)", charString, value); } -- 1.8.3.1