From 688bc74ce0ab320cdfc6e73f6db75612968f74c4 Mon Sep 17 00:00:00 2001
From: Steven Le Rouzic <steven.lerouzic@gmail.com>
Date: Sat, 4 Jan 2025 19:12:08 +0100
Subject: Fix a bunch of warnings

---
 asl/meta.hpp               | 8 ++++----
 asl/status.hpp             | 6 ++++--
 asl/string.hpp             | 2 ++
 asl/tests/buffer_tests.cpp | 8 ++++----
 4 files changed, 14 insertions(+), 10 deletions(-)

(limited to 'asl')

diff --git a/asl/meta.hpp b/asl/meta.hpp
index 959201e..43bd7cc 100644
--- a/asl/meta.hpp
+++ b/asl/meta.hpp
@@ -10,10 +10,10 @@ struct source_location
     int         line;
 
     explicit source_location(
-        const char* file = __builtin_FILE(),
-        int line = __builtin_LINE())
-        : file{file}
-        , line{line}
+        const char* file_ = __builtin_FILE(),
+        int line_ = __builtin_LINE())
+        : file{file_}
+        , line{line_}
     {}
 };
 
diff --git a/asl/status.hpp b/asl/status.hpp
index 4638493..3d93213 100644
--- a/asl/status.hpp
+++ b/asl/status.hpp
@@ -21,12 +21,14 @@ class status
 
     static constexpr void* status_to_payload(status_code code)
     {
-        return code == status_code::ok ? nullptr : bit_cast<void*>(((uintptr_t)code << 1) | 1);
+        return code == status_code::ok
+            ? nullptr
+            : bit_cast<void*>((static_cast<uintptr_t>(code) << 1) | 1);
     }
 
     static constexpr status_code payload_to_status(void* payload)
     {
-        return (status_code)(bit_cast<uintptr_t>(payload) >> 1);
+        return static_cast<status_code>(bit_cast<uintptr_t>(payload) >> 1);
     }
 
     status_code code_internal() const;
diff --git a/asl/string.hpp b/asl/string.hpp
index 288767f..86fc304 100644
--- a/asl/string.hpp
+++ b/asl/string.hpp
@@ -59,4 +59,6 @@ public:
     }
 };
 
+string() -> string<>;
+
 } // namespace asl
diff --git a/asl/tests/buffer_tests.cpp b/asl/tests/buffer_tests.cpp
index f3d6446..4c18461 100644
--- a/asl/tests/buffer_tests.cpp
+++ b/asl/tests/buffer_tests.cpp
@@ -364,8 +364,8 @@ ASL_TEST(move_assign_from_heap)
 ASL_TEST(move_assign_trivial_heap_to_inline)
 {
     isize_t alloc_count = 0;
-    asl::buffer<int64_t, CounterAllocator> buf{CounterAllocator(&alloc_count)};
-    asl::buffer<int64_t, CounterAllocator> buf2{CounterAllocator(&alloc_count)};
+    asl::buffer<int64_t, CounterAllocator> buf{CounterAllocator{&alloc_count}};
+    asl::buffer<int64_t, CounterAllocator> buf2{CounterAllocator{&alloc_count}};
 
     buf.push(1);
     buf.push(2);
@@ -389,8 +389,8 @@ ASL_TEST(move_assign_trivial_heap_to_inline)
 ASL_TEST(move_assign_trivial_inline_to_heap)
 {
     isize_t alloc_count = 0;
-    asl::buffer<int64_t, CounterAllocator> buf{CounterAllocator(&alloc_count)};
-    asl::buffer<int64_t, CounterAllocator> buf2{CounterAllocator(&alloc_count)};
+    asl::buffer<int64_t, CounterAllocator> buf{CounterAllocator{&alloc_count}};
+    asl::buffer<int64_t, CounterAllocator> buf2{CounterAllocator{&alloc_count}};
 
     buf.push(1);
     buf.push(2);
-- 
cgit