From e4b050a64b3862193c7720411968c19f8a202de5 Mon Sep 17 00:00:00 2001
From: lyken <lyken@m-labs.hk>
Date: Tue, 20 Aug 2024 11:38:05 +0800
Subject: [PATCH] core/irrt: fix exception.hpp C++ castings

---
 nac3core/irrt/irrt/exception.hpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/nac3core/irrt/irrt/exception.hpp b/nac3core/irrt/irrt/exception.hpp
index 5b1ec590..4a4b093b 100644
--- a/nac3core/irrt/irrt/exception.hpp
+++ b/nac3core/irrt/irrt/exception.hpp
@@ -55,11 +55,14 @@ void _raise_exception_helper(ExceptionId id,
                              int64_t param2) {
     Exception<SizeT> e = {
         .id = id,
-        .filename = {.base = reinterpret_cast<const uint8_t*>(filename), .len = __builtin_strlen(filename)},
+        .filename = {.base = reinterpret_cast<uint8_t*>(const_cast<char*>(filename)),
+                     .len = static_cast<int32_t>(__builtin_strlen(filename))},
         .line = line,
         .column = 0,
-        .function = {.base = reinterpret_cast<const uint8_t*>(function), .len = __builtin_strlen(function)},
-        .msg = {.base = reinterpret_cast<const uint8_t*>(msg), .len = __builtin_strlen(msg)},
+        .function = {.base = reinterpret_cast<uint8_t*>(const_cast<char*>(function)),
+                     .len = static_cast<int32_t>(__builtin_strlen(function))},
+        .msg = {.base = reinterpret_cast<uint8_t*>(const_cast<char*>(msg)),
+                .len = static_cast<int32_t>(__builtin_strlen(msg))},
     };
     e.params[0] = param0;
     e.params[1] = param1;