Skip to content

Commit

Permalink
Fixes "Release" build
Browse files Browse the repository at this point in the history
- removed most warnings
- fixed test (added style)
  • Loading branch information
ypujante committed Dec 22, 2022
1 parent bf3da5e commit 6dc982f
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ install(
set(CPACK_PACKAGE_NAME "${target}")
set(CPACK_PACKAGE_VERSION_MAJOR "${re-edit_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${re-edit_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${re-edit_VERSION_PATCH}-dev")
set(CPACK_PACKAGE_VERSION_PATCH "${re-edit_VERSION_PATCH}")
set(CPACK_SYSTEM_NAME "${re-edit_ARCHIVE_ARCHITECTURE}")

set(CPACK_GENERATOR ZIP)
Expand Down
2 changes: 1 addition & 1 deletion cmake/fetch_re-mock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else()
endif()

set(re-mock_GIT_REPO "https://github.com/pongasoft/re-mock" CACHE STRING "re-mock git repository url" FORCE)
set(re-mock_GIT_TAG "v1.3.1" CACHE STRING "re-mock git tag" FORCE)
set(re-mock_GIT_TAG "v1.3.2" CACHE STRING "re-mock git tag" FORCE)
set(re-mock_DOWNLOAD_URL "${re-mock_GIT_REPO}/archive/refs/tags/${re-mock_GIT_TAG}.zip" CACHE STRING "re-mock download url" FORCE)

FetchContent_Declare(re-mock
Expand Down
9 changes: 8 additions & 1 deletion re-edit.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ if args.release and args.debug:
print('Conflicting options (-r and -d) used')
exit(1)

config = 'Debug'
if generator_is_multi_config:
config = 'Release' if args.release else 'Debug'
else:
config = 'Release' if args.release else 'Debug' if args.debug else cmake_single_config_build_type
if cmake_single_config_build_type != config:
print(f'Single Config Build is [{cmake_single_config_build_type}]... cannot build in [{config}] mode')
exit(1)

cmake_config = ['--config', config]

step = 0
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/re/edit/AppContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ class AppContext
inline void addUndoAttributeChange(widget::Attribute const *iAttribute)
{
RE_EDIT_INTERNAL_ASSERT(fCurrentWidget != nullptr);
return addUndoCurrentWidgetChange(std::move(computeUpdateDescription(fCurrentWidget, iAttribute)));
return addUndoCurrentWidgetChange(computeUpdateDescription(fCurrentWidget, iAttribute));
}

inline void addUndoAttributeReset(widget::Attribute const *iAttribute)
{
RE_EDIT_INTERNAL_ASSERT(fCurrentWidget != nullptr);
return addUndoCurrentWidgetChange(std::move(computeResetDescription(fCurrentWidget, iAttribute)));
return addUndoCurrentWidgetChange(computeResetDescription(fCurrentWidget, iAttribute));
}

template<typename T>
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/re/edit/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,6 @@ void Application::renderLoading()
{
RE_EDIT_INTERNAL_ASSERT(fReLoadingFuture != nullptr);

auto scale = getCurrentFontDpiScale();

auto constexpr kTitle = "Loading...";

if(fReLoadingFuture->fFuture.wait_for(std::chrono::milliseconds(1)) == std::future_status::ready)
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/re/edit/Errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ void log_error(char const *iFile, int iLine, const std::string &format, Args ...
#endif
#ifndef NDEBUG
#define RE_EDIT_LOG_DEBUG(...) re::edit::log_debug(__FILE__, __LINE__, __VA_ARGS__)
#else
#define RE_EDIT_LOG_DEBUG(...)
#endif
#define RE_EDIT_LOG_INFO(...) re::edit::log_info(__FILE__, __LINE__, __VA_ARGS__)
#define RE_EDIT_LOG_WARNING(...) re::edit::log_warning(__FILE__, __LINE__, __VA_ARGS__)
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/re/edit/FilmStrip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ std::vector<unsigned char> loadCompressedBase85(char const *iCompressedBase85)
// compressed binary => binary
const unsigned int buf_decompressed_size = impl::stb_decompress_length((const unsigned char*) compressedData.data());
std::vector<unsigned char> decompressedData(static_cast<size_t>(buf_decompressed_size));
impl::stb_decompress(decompressedData.data(), compressedData.data(), compressedData.size());
impl::stb_decompress(decompressedData.data(), compressedData.data(), static_cast<unsigned int>(compressedData.size()));

return std::move(decompressedData);
return decompressedData;
}

}
Expand Down
1 change: 1 addition & 0 deletions src/cpp/re/edit/UndoManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class CompositeUndoAction : public UndoAction
class RedoAction
{
public:
virtual ~RedoAction() = default;
virtual void execute() = 0;

/**
Expand Down
8 changes: 2 additions & 6 deletions src/cpp/re/edit/WidgetAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,8 @@ void PropertyPath::editView(AppContext &iCtx)
fProvided = true;
fEdited = true;
},
[this](auto &iCtx) { editPropertyView(iCtx); },
[this](auto &iCtx) { tooltipPropertyView(iCtx); });
[this](auto &iCtx) { this->editPropertyView(iCtx); },
[this](auto &iCtx) { this->tooltipPropertyView(iCtx); });
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -1212,10 +1212,6 @@ void UserSampleIndex::editView(AppContext &iCtx)
//------------------------------------------------------------------------
void UserSampleIndex::findErrors(AppContext &iCtx, UserError &oErrors) const
{
static constexpr auto kInvalidUserSampleIndex = "Must be an integer in the range [0, user_sample-count - 1] "
"where user_sample-count is the number of user samples in "
"motherboard_def.lua";

auto count = iCtx.getUserSamplesCount();

if(count < 1)
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/re/edit/WidgetAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ class DiscretePropertyValueList : public SingleAttribute<std::vector<int>>

bool contains(int iValue) const;

using Attribute::editView;

void editView(int iMin,
int iMax,
std::function<void()> const &iOnAdd,
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/re/edit/lua/HDGui2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ void HDGui2D::populate(String *oValue)
void HDGui2D::populate(Integer *oValue)
{
if(oValue)
impl::setValue(*oValue, L.getTableValueAsOptionalInteger(oValue->fName));
impl::setValue(*oValue, L.getTableValueAsOptionalInteger<int>(oValue->fName));
}

//------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions test/cpp/re/edit/lua/TestConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ TEST(ConfigParser, All) {
global_config = {}
global_config["font_size"] = 20
global_config["style"] = "Dark"
global_config["device_history"] = {}
global_config["device_history"][1] = {
name = "CVA-7 CV Analyzer",
Expand Down Expand Up @@ -62,6 +63,7 @@ global_config["device_history"][2] = {
ASSERT_EQ(configString, PreferencesManager::getAsLua(config));

ASSERT_EQ(20, config.fFontSize);
ASSERT_EQ(config::Style::kDark, config.fStyle);
ASSERT_EQ(2, config.fDeviceHistory.size());

{
Expand Down

0 comments on commit 6dc982f

Please sign in to comment.