From 053c2ed2b975d6c2b198d9adb971d21a70d4df8e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 7 May 2021 14:13:49 +0530 Subject: [PATCH] Make pow10_array const --- kitty/parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/parser.c b/kitty/parser.c index 93ccd2885..0db1d4aaf 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -18,7 +18,7 @@ extern PyTypeObject Screen_Type; // utils {{{ -static uint64_t pow10_array[] = { +const static uint64_t pow_10_array[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000 }; @@ -35,9 +35,9 @@ utoi(const uint32_t *buf, unsigned int sz) { if (*p == '0') { p++; sz--; } else break; } - if (sz < sizeof(pow10_array)/sizeof(pow10_array[0])) { + if (sz < sizeof(pow_10_array)/sizeof(pow_10_array[0])) { for (int i = sz-1, j=0; i >= 0; i--, j++) { - ans += (p[i] - '0') * pow10_array[j]; + ans += (p[i] - '0') * pow_10_array[j]; } } return ans * mult;