From 8d5f00870f72929b1b1523c0ab6a23ecca73bae0 Mon Sep 17 00:00:00 2001 From: Steven Dee <steve@smartercode.net> Date: Sun, 30 Nov 2014 19:08:36 -0500 Subject: [PATCH] Remove vacuous states in base64_sem?.c I don't think these actually affect correctness since there's no way for 0x40 or 0x60 to show up in a parse tree anyway, but they're confusing. --- examples/base64_sem1.c | 4 ++-- examples/base64_sem2.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/base64_sem1.c b/examples/base64_sem1.c index 4da171f3..afbbef84 100644 --- a/examples/base64_sem1.c +++ b/examples/base64_sem1.c @@ -29,9 +29,9 @@ HParsedToken *act_bsfdig(const HParseResult *p, void* user_data) uint8_t c = H_CAST_UINT(p->ast); - if(c >= 0x40 && c <= 0x5A) // A-Z + if(c >= 0x41 && c <= 0x5A) // A-Z res->uint = c - 0x41; - else if(c >= 0x60 && c <= 0x7A) // a-z + else if(c >= 0x61 && c <= 0x7A) // a-z res->uint = c - 0x61 + 26; else if(c >= 0x30 && c <= 0x39) // 0-9 res->uint = c - 0x30 + 52; diff --git a/examples/base64_sem2.c b/examples/base64_sem2.c index b7a2263e..b8f7b4a2 100644 --- a/examples/base64_sem2.c +++ b/examples/base64_sem2.c @@ -31,9 +31,9 @@ uint8_t bsfdig_value(const HParsedToken *p) if(p && p->token_type == TT_UINT) { uint8_t c = p->uint; - if(c >= 0x40 && c <= 0x5A) // A-Z + if(c >= 0x41 && c <= 0x5A) // A-Z value = c - 0x41; - else if(c >= 0x60 && c <= 0x7A) // a-z + else if(c >= 0x61 && c <= 0x7A) // a-z value = c - 0x61 + 26; else if(c >= 0x30 && c <= 0x39) // 0-9 value = c - 0x30 + 52; -- GitLab