Cortex: fix some unused-but-set warnings

Declare the variables as unused because they are used only in ASSERT
calls which are disabled by default.

Change-Id: I4786fad54463b532b00afa5be00ed52fb118776f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6737
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
PulkoMandy 2023-07-24 14:56:48 +02:00 committed by waddlesplash
parent 21b533d448
commit 2a7d6a9850
6 changed files with 11 additions and 18 deletions

View File

@ -142,7 +142,7 @@ void _do_for_each_connected(
ASSERT(origin);
ASSERT(state);
status_t err;
status_t err __attribute__((unused));
if(state->visited.find(origin->id()) != state->visited.end()) {
// PRINT(("### already visited\n"));
@ -605,7 +605,7 @@ bool NodeManager::_find_route_recurse(
ASSERT(IsLocked());
ASSERT(origin);
ASSERT(state);
status_t err;
status_t err __attribute__((unused));
// node already visited?
if(state->visited.find(origin->id()) != state->visited.end()) {
@ -857,8 +857,6 @@ status_t NodeManager::mergeGroups(
D_METHOD((
"NodeManager::mergeGroups(name)\n"));
status_t err;
// [5feb00 c.lenz] already merged
if(sourceGroup->id() == destinationGroup->id())
return B_OK;
@ -869,7 +867,7 @@ status_t NodeManager::mergeGroups(
for(uint32 n = sourceGroup->countNodes(); n; --n) {
NodeRef* node = sourceGroup->nodeAt(n-1);
ASSERT(node);
err = sourceGroup->removeNode(n-1);
status_t err __attribute__((unused)) = sourceGroup->removeNode(n-1);
ASSERT(err == B_OK);
err = destinationGroup->addNode(node);
ASSERT(err == B_OK);
@ -913,7 +911,7 @@ public:
PRINT((
"_changeNodeGroupFn(): '%s'\n", node->name()));
status_t err;
status_t err __attribute__((unused));
NodeGroup* oldGroup = node->group();
if(oldGroup) {
err = oldGroup->removeNode(node);

View File

@ -336,12 +336,10 @@ bigtime_t NodeRef::recordingDelay() const {
bigtime_t NodeRef::calculateRecordingModeDelay() {
PRINT((
"NodeRef::calculateRecordingModeDelay()\n"));
status_t err;
bigtime_t maxBufferDur = 0LL;
vector<Connection> outputConnections;
err = getOutputConnections(outputConnections);
getOutputConnections(outputConnections);
for(
vector<Connection>::iterator it = outputConnections.begin();
it != outputConnections.end(); ++it) {
@ -352,8 +350,7 @@ bigtime_t NodeRef::calculateRecordingModeDelay() {
}
bigtime_t latency = 0LL;
err = m_manager->roster->GetLatencyFor(
node(), &latency);
m_manager->roster->GetLatencyFor(node(), &latency);
PRINT((
" %" B_PRIdBIGTIME "\n", latency));

View File

@ -245,7 +245,6 @@ void RouteApp::xmlExportAttributes(
void RouteApp::xmlExportContent(
ExportContext& context) const {
status_t err;
context.beginContent();
// export app settings
@ -253,7 +252,7 @@ void RouteApp::xmlExportContent(
BMessage m;
exportState(&m);
MessageIO io(&m);
err = context.writeObject(&io);
status_t err __attribute__((unused)) = context.writeObject(&io);
ASSERT(err == B_OK);
}

View File

@ -1065,7 +1065,7 @@ void TransportView::_updateTimeSource() {
// }
// }
if(n < 0)
menu->Superitem()->SetLabel(B_TRANSLATE("(???)"));
menu->Superitem()->SetLabel(B_TRANSLATE("(\?\?\?)"));
}
void TransportView::_updateRunMode() {

View File

@ -445,20 +445,19 @@ NumericValControl::updateParameter(double value)
// bigtime_t tpNow = system_time();
// store value
status_t err;
switch (fParam->ValueType()) {
case B_FLOAT_TYPE:
{ // +++++ left-channel hack
float fValue[2];
fValue[0] = value;
fValue[1] = value;
err = fParam->SetValue((void*)&fValue, sizeof(float)*2, 0LL);
fParam->SetValue((void*)&fValue, sizeof(float)*2, 0LL);
break;
}
case B_DOUBLE_TYPE: {
double fValue = value;
err = fParam->SetValue((void*)&fValue, sizeof(double), 0LL);
fParam->SetValue((void*)&fValue, sizeof(double), 0LL);
break;
}
}

View File

@ -367,7 +367,7 @@ ValControlDigitSegment::ValControlDigitSegment(BMessage* pArchive) :
m_digitPadding(0.0) {
// #/digits
status_t err = pArchive->FindInt16("digits", (int16*)&m_digitCount);
status_t err __attribute__((unused)) = pArchive->FindInt16("digits", (int16*)&m_digitCount);
ASSERT(err == B_OK);
// current value