]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
cstylecast parser
authorgtsoul-tech <gtsoulkanakis@gmail.com>
Wed, 22 May 2024 08:11:13 +0000 (11:11 +0300)
committergtsoul-tech <gtsoulkanakis@gmail.com>
Wed, 22 May 2024 08:11:13 +0000 (11:11 +0300)
src/parser/Parser.rl

index 668f3778c53064330bdfff3ce05639e58e16d04e..232b02188022c89f2499076f37b2f547c565f1fc 100644 (file)
@@ -237,8 +237,7 @@ unichar readUtf8CodePoint2c(const char *s) {
 
 static
 unichar readUtf8CodePoint3c(const char *s) {
-    // cppcheck-suppress cstyleCast
-    auto *ts = (const u8 *)s;
+    auto *ts = reinterpret_cast<const u8 *>(s);
     assert(ts[0] >= 0xe0 && ts[0] < 0xf0);
     assert(ts[1] >= 0x80 && ts[1] < 0xc0);
     assert(ts[2] >= 0x80 && ts[2] < 0xc0);
@@ -254,8 +253,7 @@ unichar readUtf8CodePoint3c(const char *s) {
 
 static
 unichar readUtf8CodePoint4c(const char *s) {
-    // cppcheck-suppress cstyleCast
-    auto *ts = (const u8 *)s;
+    auto *ts = reinterpret_cast<const u8 *>(s);
     assert(ts[0] >= 0xf0 && ts[0] < 0xf8);
     assert(ts[1] >= 0x80 && ts[1] < 0xc0);
     assert(ts[2] >= 0x80 && ts[2] < 0xc0);