Skip to content

Commit ea2f69f

Browse files
committed
fix macos deprecation warnings
1 parent 9c221ed commit ea2f69f

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ endif()
735735
if (APPLE)
736736
target_compile_definitions(components PRIVATE GL_SILENCE_DEPRECATION=1)
737737
target_compile_definitions(openmw PRIVATE GL_SILENCE_DEPRECATION=1)
738+
target_compile_definitions(openmw-lib PRIVATE GL_SILENCE_DEPRECATION=1)
738739
endif()
739740

740741
# Apple bundling

apps/opencs/model/prefs/boolsetting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CSMPrefs::SettingWidgets CSMPrefs::BoolSetting::makeWidgets(QWidget* parent)
3434
mWidget->setToolTip(tooltip);
3535
}
3636

37-
connect(mWidget, &QCheckBox::stateChanged, this, &BoolSetting::valueChanged);
37+
connect(mWidget, &QCheckBox::checkStateChanged, this, &BoolSetting::valueChanged);
3838

3939
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget };
4040
}

apps/opencs/model/prefs/shortcutmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ namespace CSMPrefs
431431
std::make_pair((int)Qt::Key_twosuperior, "twosuperior"),
432432
std::make_pair((int)Qt::Key_threesuperior, "threesuperior"),
433433
std::make_pair((int)Qt::Key_acute, "acute"),
434-
std::make_pair((int)Qt::Key_mu, "mu"),
434+
std::make_pair((int)Qt::Key_micro, "mu"),
435435
std::make_pair((int)Qt::Key_paragraph, "paragraph"),
436436
std::make_pair((int)Qt::Key_periodcentered, "periodcentered"),
437437
std::make_pair((int)Qt::Key_cedilla, "cedilla"),

apps/opencs/view/world/dialoguesubview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(
298298
}
299299
else if (qobject_cast<QCheckBox*>(editor))
300300
{
301-
connect(static_cast<QCheckBox*>(editor), &QCheckBox::stateChanged, proxy,
301+
connect(static_cast<QCheckBox*>(editor), &QCheckBox::checkStateChanged, proxy,
302302
qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
303303
}
304304
else if (qobject_cast<QPlainTextEdit*>(editor))

apps/opencs/view/world/extendedcommandconfigurator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void CSVWorld::ExtendedCommandConfigurator::setupCheckBoxes(const std::vector<CS
130130
for (int i = numTypes - numCheckBoxes; i > 0; --i)
131131
{
132132
QCheckBox* checkBox = new QCheckBox(mTypeGroup);
133-
connect(checkBox, &QCheckBox::stateChanged, this, &ExtendedCommandConfigurator::checkBoxStateChanged);
133+
connect(checkBox, &QCheckBox::checkStateChanged, this, &ExtendedCommandConfigurator::checkBoxStateChanged);
134134
mTypeCheckBoxes.insert(std::make_pair(checkBox, CSMWorld::UniversalId::Type_None));
135135
}
136136
}

apps/opencs/view/world/tablesubview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ CSVWorld::TableSubView::TableSubView(
5555
"\nCan be useful in finding the moved or modified"
5656
"\nobject instance while 3D editing.");
5757
autoJump->setCheckState(Qt::Unchecked);
58-
connect(autoJump, &QCheckBox::stateChanged, mTable, &Table::jumpAfterModChanged);
58+
connect(autoJump, &QCheckBox::checkStateChanged, mTable, &Table::jumpAfterModChanged);
5959
optHLayout->insertWidget(0, autoJump);
6060
optHLayout->setContentsMargins(QMargins(0, 3, 0, 0));
6161
mOptions->setLayout(optHLayout);

components/misc/strings/format.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ namespace Misc::StringUtils
5454
const int size = std::snprintf(nullptr, 0, fmt, argument(args)...);
5555
if (size < 0)
5656
throw std::system_error(errno, std::generic_category(), "Failed to compute resulting string size");
57-
// Note: sprintf also writes a trailing null character. We should remove it.
57+
// Note: snprintf also writes a trailing null character. We should remove it.
5858
std::string ret(static_cast<std::size_t>(size) + 1, '\0');
59-
if (std::sprintf(ret.data(), fmt, argument(args)...) < 0)
59+
if (std::snprintf(ret.data(), ret.size(), fmt, argument(args)...) < 0)
6060
throw std::system_error(errno, std::generic_category(), "Failed to format string");
6161
ret.erase(static_cast<std::size_t>(size));
6262
return ret;

0 commit comments

Comments
 (0)