From f1c520cb4943ec8a900d0caf4012c83352e3dbd8 Mon Sep 17 00:00:00 2001 From: Jamiras Date: Sat, 9 Nov 2024 10:25:02 -0700 Subject: [PATCH] address analysis warnings --- src/ui/viewmodels/TriggerConditionViewModel.cpp | 8 ++++---- src/ui/viewmodels/TriggerViewModel.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/viewmodels/TriggerConditionViewModel.cpp b/src/ui/viewmodels/TriggerConditionViewModel.cpp index de3e4c41..90a295ee 100644 --- a/src/ui/viewmodels/TriggerConditionViewModel.cpp +++ b/src/ui/viewmodels/TriggerConditionViewModel.cpp @@ -401,7 +401,7 @@ void TriggerConditionViewModel::SetOperand(const IntModelProperty& pTypeProperty { if (rc_operand_is_memref(&operand) && operand.value.memref->value.memref_type == RC_MEMREF_TYPE_MODIFIED_MEMREF) { - const auto* pModifiedMemref = reinterpret_cast(operand.value.memref); + GSL_SUPPRESS_TYPE1 const auto* pModifiedMemref = reinterpret_cast(operand.value.memref); if (pModifiedMemref->modifier_type != RC_OPERATOR_INDIRECT_READ) { // if the modified memref is not an indirect read, the size and address are stored in the modifier. @@ -704,7 +704,7 @@ static ra::ByteAddress GetParentAddress(const rc_modified_memref_t* pModifiedMem return pModifiedMemref->parent.value.memref->address; case RC_MEMREF_TYPE_MODIFIED_MEMREF: - const auto* pModifiedParentMemref = + GSL_SUPPRESS_TYPE1 const auto* pModifiedParentMemref = reinterpret_cast(pModifiedMemref->parent.value.memref); // chained pointer @@ -724,14 +724,14 @@ static ra::ByteAddress GetIndirectAddressFromOperand(const rc_operand_t* pOperan if (pOperand->value.memref->value.memref_type != RC_MEMREF_TYPE_MODIFIED_MEMREF) return nAddress; - const auto* pModifiedMemref = reinterpret_cast(pOperand->value.memref); + GSL_SUPPRESS_TYPE1 const auto* pModifiedMemref = reinterpret_cast(pOperand->value.memref); if (pModifiedMemref->modifier_type != RC_OPERATOR_INDIRECT_READ) return nAddress; if (pPointerAddress) *pPointerAddress = GetParentAddress(pModifiedMemref); - rc_typed_value_t value, offset; + rc_typed_value_t value{}, offset; offset.type = RC_VALUE_TYPE_UNSIGNED; offset.value.u32 = nAddress; rc_evaluate_operand(&value, &pModifiedMemref->parent, nullptr); diff --git a/src/ui/viewmodels/TriggerViewModel.cpp b/src/ui/viewmodels/TriggerViewModel.cpp index 12c8f1ee..4da274c0 100644 --- a/src/ui/viewmodels/TriggerViewModel.cpp +++ b/src/ui/viewmodels/TriggerViewModel.cpp @@ -1255,7 +1255,7 @@ void TriggerViewModel::UpdateConditionColors(const rc_trigger_t* pTrigger) { // when a condset is paused, processing stops when the first pause condition is true. only highlight it bool bFirstPause = true; - rc_condition_t* pPauseConditions = rc_condset_get_conditions(pSelectedGroup->m_pConditionSet); + const rc_condition_t* pPauseConditions = rc_condset_get_conditions(pSelectedGroup->m_pConditionSet); const rc_condition_t* pEndPauseConditions = pPauseConditions + pSelectedGroup->m_pConditionSet->num_pause_conditions; rc_condition_t* pCondition = pSelectedGroup->m_pConditionSet->conditions;