summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-07 18:27:56 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-07 18:30:19 +0200
commite32c23f253c980150265046c1337c42fce063601 (patch)
treeba87ff55683a4f04b7ff229998630696f5113d04
parent0cf253e9d4d98b5a12538e55cd4e67ab2c6d168e (diff)
downloadokeffa-e32c23f253c980150265046c1337c42fce063601.tar.gz
ekplicit
-rw-r--r--calc/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/calc/main.c b/calc/main.c
index f21905d..d5ee16a 100644
--- a/calc/main.c
+++ b/calc/main.c
@@ -71,9 +71,9 @@ static bool char_isnib(char c){
static word_t char_getnib(char c){
assert(char_isnib(c));
- if (c >= '0' && c <= '9') return c-'0';
- else if (c >= 'A' && c <= 'F') return c-'A'+0xA;
- else return c-'a'+0xA;
+ if (c >= '0' && c <= '9') return (word_t)(c-'0');
+ else if (c >= 'A' && c <= 'F') return (word_t)(c-'A')+0xA;
+ else return (word_t)(c-'a')+0xA;
}
static void op_normal(char c){