Fix some -Weffc++ warnings (part 2)

This commit is contained in:
Nekotekina 2021-04-03 19:38:02 +03:00
parent c1f1b1174d
commit 963d150e93
28 changed files with 169 additions and 130 deletions

View file

@ -218,6 +218,10 @@ asmjit::Runtime& asmjit::get_global_runtime()
utils::memory_commit(m_pos, size, utils::protection::wx);
}
custom_runtime(const custom_runtime&) = delete;
custom_runtime& operator=(const custom_runtime&) = delete;
asmjit::Error _add(void** dst, asmjit::CodeHolder* code) noexcept override
{
usz codeSize = code->getCodeSize();
@ -384,6 +388,10 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
MemoryManager1() = default;
MemoryManager1(const MemoryManager1&) = delete;
MemoryManager1& operator=(const MemoryManager1&) = delete;
~MemoryManager1() override
{
utils::memory_release(ptr, c_max_size * 2);

View file

@ -16,6 +16,7 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#pragma GCC diagnostic ignored "-Weffc++"
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wduplicated-branches"
@ -205,13 +206,13 @@ inline FT build_function_asm(F&& builder)
class jit_compiler final
{
// Local LLVM context
llvm::LLVMContext m_context;
llvm::LLVMContext m_context{};
// Execution instance
std::unique_ptr<llvm::ExecutionEngine> m_engine;
std::unique_ptr<llvm::ExecutionEngine> m_engine{};
// Arch
std::string m_cpu;
std::string m_cpu{};
public:
jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags = 0);

View file

@ -1,21 +1,21 @@
/*
* Lightweight URL & URI parser (RFC 1738, RFC 3986)
* https://github.com/corporateshark/LUrlParser
*
*
* The MIT License (MIT)
*
*
* Copyright (C) 2015 Sergey Kosarevsky (sk@linderdaum.com)
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -47,14 +47,14 @@ namespace LUrlParser
{
public:
LUrlParserError m_ErrorCode;
std::string m_Scheme;
std::string m_Host;
std::string m_Port;
std::string m_Path;
std::string m_Query;
std::string m_Fragment;
std::string m_UserName;
std::string m_Password;
std::string m_Scheme{};
std::string m_Host{};
std::string m_Port{};
std::string m_Path{};
std::string m_Query{};
std::string m_Fragment{};
std::string m_UserName{};
std::string m_Password{};
clParseURL()
: m_ErrorCode( LUrlParserError_Uninitialized )

View file

@ -21,11 +21,11 @@ constexpr u8 cheat_type_max = static_cast<u8>(cheat_type::max);
struct cheat_info
{
std::string game;
std::string description;
std::string game{};
std::string description{};
cheat_type type = cheat_type::max;
u32 offset{};
std::string red_script;
std::string red_script{};
bool from_str(const std::string& cheat_line);
std::string to_str() const;

View file

@ -1,6 +1,19 @@
#pragma once
#ifdef _MSC_VER
#pragma warning(push, 0)
#include <pugixml.hpp>
#pragma warning(pop)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Weffc++"
#include <pugixml.hpp>
#pragma GCC diagnostic pop
#endif
#include <memory>
struct rXmlNode
@ -13,7 +26,7 @@ struct rXmlNode
std::string GetAttribute( const std::string &name);
std::string GetNodeContent();
pugi::xml_node handle;
pugi::xml_node handle{};
};
struct rXmlDocument
@ -24,5 +37,5 @@ struct rXmlDocument
void Read(const std::string& data);
std::shared_ptr<rXmlNode> GetRoot();
pugi::xml_document handle;
pugi::xml_document handle{};
};