From 5f9601e163749cf8c32277e1e046b39ce1228951 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Fri, 21 Feb 2020 19:54:31 +0100 Subject: [PATCH] Fix warnings with GCC 9.2.0 --- kernel/src/fs/fat32.cpp | 10 +++++----- printf/include/printf_def.hpp | 4 ++-- tlib/src/net.cpp | 2 +- tstl/include/deleter.hpp | 4 ++-- tstl/include/string.hpp | 14 +++++++------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kernel/src/fs/fat32.cpp b/kernel/src/fs/fat32.cpp index c0737c97..9a92b482 100644 --- a/kernel/src/fs/fat32.cpp +++ b/kernel/src/fs/fat32.cpp @@ -61,7 +61,7 @@ fat32::cluster_entry* init_entry(fat32::cluster_entry* entry_ptr, std::string_vi //Compute the checksum of 8.3 Entry char sum = 0; - for(int c = 0; c < 11; ++c){ + for(unsigned int c = 0; c < 11; ++c){ char v = c < len ? name[c] : ' '; sum = ((sum & 1) ? 0x80 : 0) + (sum >> 1) + v; } @@ -1078,7 +1078,7 @@ std::vector fat32::fat32_file_system::files(uint32_t cluster_number){ while(!end_reached){ if(!read_sectors(cluster_lba(cluster_number), fat_bs->sectors_per_cluster, cluster.get())){ - return std::move(files); + return files; } size_t position = 0; @@ -1204,19 +1204,19 @@ std::vector fat32::fat32_file_system::files(uint32_t cluster_number){ //If there are no more cluster, return false if(!cluster_number){ - return std::move(files); + return files; } //The block is corrupted if(cluster_number == CLUSTER_CORRUPTED){ - return std::move(files); + return files; } } ++cluster_position; } - return std::move(files); + return files; } //TODO use expected here diff --git a/printf/include/printf_def.hpp b/printf/include/printf_def.hpp index 3dac40d0..1c4ec23d 100644 --- a/printf/include/printf_def.hpp +++ b/printf/include/printf_def.hpp @@ -248,7 +248,7 @@ std::string vsprintf(const std::string& format, va_list va){ } } - return std::move(s); + return s; } std::string sprintf(const std::string& format, ...){ @@ -259,7 +259,7 @@ std::string sprintf(const std::string& format, ...){ va_end(va); - return std::move(s); + return s; } void vprintf(const std::string& format, va_list va){ diff --git a/tlib/src/net.cpp b/tlib/src/net.cpp index 98bba874..27b21821 100644 --- a/tlib/src/net.cpp +++ b/tlib/src/net.cpp @@ -601,7 +601,7 @@ tlib::socket tlib::socket::accept() { sock._bound = false; sock.error_code = 0; - return std::move(sock); + return sock; } else { error_code = status.error(); } diff --git a/tstl/include/deleter.hpp b/tstl/include/deleter.hpp index 597bed2f..aabb2ff6 100644 --- a/tstl/include/deleter.hpp +++ b/tstl/include/deleter.hpp @@ -14,7 +14,7 @@ template struct default_delete { constexpr default_delete() = default; - constexpr default_delete(const default_delete&) {} + constexpr default_delete(const default_delete&) = default; void operator()(T* ptr) const { static_assert(sizeof(T) > 0, "Type must be complete"); @@ -27,7 +27,7 @@ template struct default_delete { constexpr default_delete() = default; - constexpr default_delete(const default_delete&) {} + constexpr default_delete(const default_delete&) = default; void operator()(T* ptr) const { static_assert(sizeof(T) > 0, "Type must be complete"); diff --git a/tstl/include/string.hpp b/tstl/include/string.hpp index d7ab8753..ccae4c42 100644 --- a/tstl/include/string.hpp +++ b/tstl/include/string.hpp @@ -368,7 +368,7 @@ public: copy += c; - return move(copy); + return copy; } /*! @@ -645,7 +645,7 @@ basic_string operator+(const basic_string& lhs, const basic_string& rhs basic_string result; result += lhs; result += rhs; - return std::move(result); + return result; } template @@ -653,7 +653,7 @@ basic_string operator+(const C* lhs, const basic_string& rhs){ basic_string result; result += lhs; result += rhs; - return std::move(result); + return result; } template @@ -661,7 +661,7 @@ basic_string operator+(const basic_string& lhs, const C* rhs){ basic_string result; result += lhs; result += rhs; - return std::move(result); + return result; } //Operators @@ -852,7 +852,7 @@ std::vector> split(const std::basic_string& s, cha parts.push_back(current); } - return std::move(parts); + return parts; } template @@ -901,7 +901,7 @@ inline std::string to_string(const uint64_t& value){ s += buffer[i]; } - return std::move(s); + return s; } template<> @@ -909,7 +909,7 @@ inline std::string to_string(const int64_t& value){ if(value < 0){ std::string s("-"); s += to_string(static_cast(-value)); - return std::move(s); + return s; } else { return to_string(static_cast(value)); }