Fix warnings with GCC 9.2.0

This commit is contained in:
Baptiste Wicht 2020-02-21 19:54:31 +01:00
parent 26bbf11772
commit 5f9601e163
No known key found for this signature in database
GPG Key ID: C5566B6C7F884532
5 changed files with 17 additions and 17 deletions

View File

@ -61,7 +61,7 @@ fat32::cluster_entry* init_entry(fat32::cluster_entry* entry_ptr, std::string_vi
//Compute the checksum of 8.3 Entry //Compute the checksum of 8.3 Entry
char sum = 0; char sum = 0;
for(int c = 0; c < 11; ++c){ for(unsigned int c = 0; c < 11; ++c){
char v = c < len ? name[c] : ' '; char v = c < len ? name[c] : ' ';
sum = ((sum & 1) ? 0x80 : 0) + (sum >> 1) + v; sum = ((sum & 1) ? 0x80 : 0) + (sum >> 1) + v;
} }
@ -1078,7 +1078,7 @@ std::vector<vfs::file> fat32::fat32_file_system::files(uint32_t cluster_number){
while(!end_reached){ while(!end_reached){
if(!read_sectors(cluster_lba(cluster_number), fat_bs->sectors_per_cluster, cluster.get())){ if(!read_sectors(cluster_lba(cluster_number), fat_bs->sectors_per_cluster, cluster.get())){
return std::move(files); return files;
} }
size_t position = 0; size_t position = 0;
@ -1204,19 +1204,19 @@ std::vector<vfs::file> fat32::fat32_file_system::files(uint32_t cluster_number){
//If there are no more cluster, return false //If there are no more cluster, return false
if(!cluster_number){ if(!cluster_number){
return std::move(files); return files;
} }
//The block is corrupted //The block is corrupted
if(cluster_number == CLUSTER_CORRUPTED){ if(cluster_number == CLUSTER_CORRUPTED){
return std::move(files); return files;
} }
} }
++cluster_position; ++cluster_position;
} }
return std::move(files); return files;
} }
//TODO use expected here //TODO use expected here

View File

@ -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, ...){ std::string sprintf(const std::string& format, ...){
@ -259,7 +259,7 @@ std::string sprintf(const std::string& format, ...){
va_end(va); va_end(va);
return std::move(s); return s;
} }
void vprintf(const std::string& format, va_list va){ void vprintf(const std::string& format, va_list va){

View File

@ -601,7 +601,7 @@ tlib::socket tlib::socket::accept() {
sock._bound = false; sock._bound = false;
sock.error_code = 0; sock.error_code = 0;
return std::move(sock); return sock;
} else { } else {
error_code = status.error(); error_code = status.error();
} }

View File

@ -14,7 +14,7 @@ template<typename T>
struct default_delete { struct default_delete {
constexpr default_delete() = default; constexpr default_delete() = default;
constexpr default_delete(const default_delete&) {} constexpr default_delete(const default_delete&) = default;
void operator()(T* ptr) const { void operator()(T* ptr) const {
static_assert(sizeof(T) > 0, "Type must be complete"); static_assert(sizeof(T) > 0, "Type must be complete");
@ -27,7 +27,7 @@ template<typename T>
struct default_delete<T[]> { struct default_delete<T[]> {
constexpr default_delete() = default; constexpr default_delete() = default;
constexpr default_delete(const default_delete&) {} constexpr default_delete(const default_delete&) = default;
void operator()(T* ptr) const { void operator()(T* ptr) const {
static_assert(sizeof(T) > 0, "Type must be complete"); static_assert(sizeof(T) > 0, "Type must be complete");

View File

@ -368,7 +368,7 @@ public:
copy += c; copy += c;
return move(copy); return copy;
} }
/*! /*!
@ -645,7 +645,7 @@ basic_string<C> operator+(const basic_string<C>& lhs, const basic_string<C>& rhs
basic_string<C> result; basic_string<C> result;
result += lhs; result += lhs;
result += rhs; result += rhs;
return std::move(result); return result;
} }
template<typename C> template<typename C>
@ -653,7 +653,7 @@ basic_string<C> operator+(const C* lhs, const basic_string<C>& rhs){
basic_string<C> result; basic_string<C> result;
result += lhs; result += lhs;
result += rhs; result += rhs;
return std::move(result); return result;
} }
template<typename C> template<typename C>
@ -661,7 +661,7 @@ basic_string<C> operator+(const basic_string<C>& lhs, const C* rhs){
basic_string<C> result; basic_string<C> result;
result += lhs; result += lhs;
result += rhs; result += rhs;
return std::move(result); return result;
} }
//Operators //Operators
@ -852,7 +852,7 @@ std::vector<std::basic_string<Char>> split(const std::basic_string<Char>& s, cha
parts.push_back(current); parts.push_back(current);
} }
return std::move(parts); return parts;
} }
template<typename Char> template<typename Char>
@ -901,7 +901,7 @@ inline std::string to_string<uint64_t>(const uint64_t& value){
s += buffer[i]; s += buffer[i];
} }
return std::move(s); return s;
} }
template<> template<>
@ -909,7 +909,7 @@ inline std::string to_string<int64_t>(const int64_t& value){
if(value < 0){ if(value < 0){
std::string s("-"); std::string s("-");
s += to_string(static_cast<uint64_t>(-value)); s += to_string(static_cast<uint64_t>(-value));
return std::move(s); return s;
} else { } else {
return to_string(static_cast<uint64_t>(value)); return to_string(static_cast<uint64_t>(value));
} }