Update macOS CI (#7572)

* Use macOS 13

See: https://github.com/actions/runner-images/issues/10721

* Upgrade to XCode 15.2

XCode 15.2 is the default on macOS 13

* Fix unqualified call to std::move warning

* Fix sprintf deprecated warnings

* Upgrade macOS 14 ARM64 builds to XCode 15.4

See: https://github.com/actions/runner-images/issues/10703

* Fix unused lambda capture warnings in Fader.cpp

* Fix unused variable warnings

* Fix formatting warning

Cannot format `const void*` as a string

* Force lambda conversion to function pointer
This commit is contained in:
Dalton Messmer
2024-11-06 17:46:12 -05:00
committed by GitHub
parent 07baf9e27a
commit e36463ce77
11 changed files with 43 additions and 49 deletions

View File

@@ -29,20 +29,17 @@
namespace lmms
{
using std::unique_ptr;
using std::move;
void ComboBoxModel::addItem( QString item, unique_ptr<PixmapLoader> loader )
void ComboBoxModel::addItem(QString item, std::unique_ptr<PixmapLoader> loader)
{
m_items.emplace_back( move(item), move(loader) );
m_items.emplace_back(std::move(item), std::move(loader));
setRange( 0, m_items.size() - 1 );
}
void ComboBoxModel::replaceItem(std::size_t index, QString item, unique_ptr<PixmapLoader> loader)
void ComboBoxModel::replaceItem(std::size_t index, QString item, std::unique_ptr<PixmapLoader> loader)
{
assert(index < m_items.size());
m_items[index] = Item(move(item), move(loader));
m_items[index] = Item(std::move(item), std::move(loader));
emit propertiesChanged();
}

View File

@@ -147,7 +147,7 @@ void Keymap::loadSettings(const QDomElement &element)
QDomNode node = element.firstChild();
m_map.clear();
for (int i = 0; !node.isNull(); i++)
while (!node.isNull())
{
m_map.push_back(node.toElement().attribute("value").toInt());
node = node.nextSibling();

View File

@@ -210,7 +210,7 @@ void ProjectRenderer::abortProcessing()
void ProjectRenderer::updateConsoleProgress()
{
const int cols = 50;
constexpr int cols = 50;
static int rot = 0;
auto buf = std::array<char, 80>{};
auto prog = std::array<char, cols + 1>{};
@@ -221,9 +221,9 @@ void ProjectRenderer::updateConsoleProgress()
}
prog[cols] = 0;
const auto activity = (const char*)"|/-\\";
const auto activity = "|/-\\";
std::fill(buf.begin(), buf.end(), 0);
sprintf(buf.data(), "\r|%s| %3d%% %c ", prog.data(), m_progress,
std::snprintf(buf.data(), buf.size(), "\r|%s| %3d%% %c ", prog.data(), m_progress,
activity[rot] );
rot = ( rot+1 ) % 4;

View File

@@ -116,7 +116,7 @@ void Scale::loadSettings(const QDomElement &element)
QDomNode node = element.firstChild();
m_intervals.clear();
for (int i = 0; !node.isNull(); i++)
while (!node.isNull())
{
Interval temp;
temp.restoreState(node.toElement());

View File

@@ -159,7 +159,7 @@ void MidiApple::removePort( MidiPort* port )
QString MidiApple::sourcePortName( const MidiEvent& event ) const
{
qDebug("sourcePortName return '%s'?\n", event.sourcePort());
qDebug("sourcePortName");
/*
if( event.sourcePort() )
{
@@ -501,7 +501,7 @@ void MidiApple::openDevices()
void MidiApple::openMidiReference( MIDIEndpointRef reference, QString refName, bool isIn )
{
char * registeredName = (char*) malloc(refName.length()+1);
sprintf(registeredName, "%s",refName.toLatin1().constData());
std::snprintf(registeredName, refName.length() + 1, "%s",refName.toLatin1().constData());
qDebug("openMidiReference refName '%s'",refName.toLatin1().constData());
MIDIClientRef mClient = getMidiClientRef();
@@ -623,7 +623,7 @@ char * MidiApple::getFullName(MIDIEndpointRef &endpoint_ref)
size_t deviceNameLen = deviceName == nullptr ? 0 : strlen(deviceName);
size_t endPointNameLen = endPointName == nullptr ? 0 : strlen(endPointName);
char * fullName = (char *)malloc(deviceNameLen + endPointNameLen + 2);
sprintf(fullName, "%s:%s", deviceName,endPointName);
std::snprintf(fullName, deviceNameLen + endPointNameLen + 2, "%s:%s", deviceName,endPointName);
if (deviceName != nullptr) { free(deviceName); }
if (endPointName != nullptr) { free(endPointName); }
return fullName;

View File

@@ -282,20 +282,17 @@ void Fader::paintEvent(QPaintEvent* ev)
void Fader::paintLevels(QPaintEvent* ev, QPainter& painter, bool linear)
{
std::function<float(float value)> mapper = [this](float value) { return ampToDbfs(qMax(0.0001f, value)); };
const auto mapper = linear
? +[](float value) -> float { return value; }
: +[](float value) -> float { return ampToDbfs(qMax(0.0001f, value)); };
if (linear)
{
mapper = [this](float value) { return value; };
}
const float mappedMinPeak(mapper(m_fMinPeak));
const float mappedMaxPeak(mapper(m_fMaxPeak));
const float mappedPeakL(mapper(m_fPeakValue_L));
const float mappedPeakR(mapper(m_fPeakValue_R));
const float mappedPersistentPeakL(mapper(m_persistentPeak_L));
const float mappedPersistentPeakR(mapper(m_persistentPeak_R));
const float mappedUnity(mapper(1.f));
const float mappedMinPeak = mapper(m_fMinPeak);
const float mappedMaxPeak = mapper(m_fMaxPeak);
const float mappedPeakL = mapper(m_fPeakValue_L);
const float mappedPeakR = mapper(m_fPeakValue_R);
const float mappedPersistentPeakL = mapper(m_persistentPeak_L);
const float mappedPersistentPeakR = mapper(m_persistentPeak_R);
const float mappedUnity = mapper(1.f);
painter.save();
@@ -375,10 +372,10 @@ void Fader::paintLevels(QPaintEvent* ev, QPainter& painter, bool linear)
// Please ensure that "clip starts" is the maximum value and that "ok ends"
// is the minimum value and that all other values lie inbetween. Otherwise
// there will be warnings when the gradient is defined.
const float mappedClipStarts(mapper(dbfsToAmp(0.f)));
const float mappedWarnEnd(mapper(dbfsToAmp(-0.01f)));
const float mappedWarnStart(mapper(dbfsToAmp(-6.f)));
const float mappedOkEnd(mapper(dbfsToAmp(-12.f)));
const float mappedClipStarts = mapper(dbfsToAmp(0.f));
const float mappedWarnEnd = mapper(dbfsToAmp(-0.01f));
const float mappedWarnStart = mapper(dbfsToAmp(-6.f));
const float mappedOkEnd = mapper(dbfsToAmp(-12.f));
// Prepare the gradient for the meters
//