diff --git a/src/classify/intmatcher.cpp b/src/classify/intmatcher.cpp index 7740d269a8..3b1be4e543 100644 --- a/src/classify/intmatcher.cpp +++ b/src/classify/intmatcher.cpp @@ -767,8 +767,6 @@ int IntegerMatcher::UpdateTablesForFeature( uint8_t proto_byte; int32_t proto_word_offset; int32_t proto_offset; - uint8_t config_byte; - int32_t config_offset; PROTO_SET ProtoSet; uint32_t *ProtoPrunerPtr; INT_PROTO Proto; @@ -777,7 +775,6 @@ int IntegerMatcher::UpdateTablesForFeature( uint32_t XFeatureAddress; uint32_t YFeatureAddress; uint32_t ThetaFeatureAddress; - uint8_t* UINT8Pointer; int ProtoIndex; uint8_t Temp; int* IntPointer; @@ -850,21 +847,22 @@ int IntegerMatcher::UpdateTablesForFeature( ConfigWord &= *ConfigMask; - UINT8Pointer = tables->feature_evidence_ - 8; - config_byte = 0; + uint8_t feature_evidence_index = 0; + uint8_t config_byte = 0; while (ConfigWord != 0 || config_byte != 0) { while (config_byte == 0) { config_byte = ConfigWord & 0xff; ConfigWord >>= 8; - UINT8Pointer += 8; + feature_evidence_index += 8; } - config_offset = offset_table[config_byte]; + const uint8_t config_offset = + offset_table[config_byte] + feature_evidence_index - 8; config_byte = next_table[config_byte]; - if (Evidence > UINT8Pointer[config_offset]) - UINT8Pointer[config_offset] = Evidence; + if (Evidence > tables->feature_evidence_[config_offset]) + tables->feature_evidence_[config_offset] = Evidence; } - UINT8Pointer = + uint8_t* UINT8Pointer = &(tables->proto_evidence_[ActualProtoNum + proto_offset][0]); for (ProtoIndex = ClassTemplate->ProtoLengths[ActualProtoNum + proto_offset]; @@ -888,7 +886,7 @@ int IntegerMatcher::UpdateTablesForFeature( } IntPointer = tables->sum_feature_evidence_; - UINT8Pointer = tables->feature_evidence_; + uint8_t* UINT8Pointer = tables->feature_evidence_; int SumOverConfigs = 0; for (ConfigNum = ClassTemplate->NumConfigs; ConfigNum > 0; ConfigNum--) { int evidence = *UINT8Pointer++;