mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Merge branch 'fix_warnings' into 'master'
Fix -Wreturn-local-addr warning See merge request OpenMW/openmw!1194
This commit is contained in:
commit
c4dca196b9
@ -14,6 +14,12 @@ if [[ "${BUILD_TESTS_ONLY}" ]]; then
|
||||
BUILD_BENCHMARKS=ON
|
||||
fi
|
||||
|
||||
CXX_FLAGS='-Werror -Wno-error=deprecated-declarations -Wno-error=nonnull -Wno-error=deprecated-copy'
|
||||
|
||||
if [[ "${CXX}" == 'clang++' ]]; then
|
||||
CXX_FLAGS="${CXX_FLAGS} -Wno-error=unused-lambda-capture -Wno-error=gnu-zero-variadic-macro-arguments"
|
||||
fi
|
||||
|
||||
declare -a CMAKE_CONF_OPTS=(
|
||||
-DCMAKE_C_COMPILER="${CC:-/usr/bin/cc}"
|
||||
-DCMAKE_CXX_COMPILER="${CXX:-/usr/bin/c++}"
|
||||
@ -24,6 +30,8 @@ declare -a CMAKE_CONF_OPTS=(
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DUSE_SYSTEM_TINYXML=ON
|
||||
-DCMAKE_INSTALL_PREFIX=install
|
||||
-DCMAKE_C_FLAGS='-Werror'
|
||||
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}"
|
||||
)
|
||||
|
||||
if [[ $CI_OPENMW_USE_STATIC_DEPS ]]; then
|
||||
|
@ -512,7 +512,7 @@ endif()
|
||||
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long")
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}")
|
||||
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON )
|
||||
|
||||
if (APPLE)
|
||||
|
@ -9,6 +9,9 @@
|
||||
|
||||
#include "data.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
const std::string& ActorAdapter::RaceData::getId() const
|
||||
@ -121,7 +124,7 @@ namespace CSMWorld
|
||||
return SceneUtil::getActorSkeleton(firstPerson, mFemale, beast, werewolf);
|
||||
}
|
||||
|
||||
const std::string& ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
|
||||
std::string_view ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
|
||||
{
|
||||
auto it = mParts.find(index);
|
||||
if (it == mParts.end())
|
||||
@ -139,7 +142,7 @@ namespace CSMWorld
|
||||
return mRaceData->getMalePart(index);
|
||||
}
|
||||
|
||||
return "";
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::string& partName = it->second.first;
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include <QObject>
|
||||
#include <QModelIndex>
|
||||
@ -93,7 +95,7 @@ namespace CSMWorld
|
||||
/// Returns the skeleton the actor should use for attaching parts to
|
||||
std::string getSkeleton() const;
|
||||
/// Retrieves the associated actor part
|
||||
const std::string& getPart(ESM::PartReferenceType index) const;
|
||||
std::string_view getPart(ESM::PartReferenceType index) const;
|
||||
/// Checks if the actor has a data dependency
|
||||
bool hasDependency(const std::string& id) const;
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace CSVRender
|
||||
for (int i = 0; i < ESM::PRT_Count; ++i)
|
||||
{
|
||||
auto type = (ESM::PartReferenceType) i;
|
||||
std::string partId = mActorData->getPart(type);
|
||||
const std::string partId(mActorData->getPart(type));
|
||||
attachBodyPart(type, getBodyPartMesh(partId));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user