]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Fix false positive constStatement warnings 268/head
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Sat, 11 May 2024 20:11:29 +0000 (23:11 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Sat, 11 May 2024 20:11:29 +0000 (23:11 +0300)
src/fdr/fdr_engine_description.cpp
src/parser/ComponentRepeat.cpp

index c4f5925886972e9a22e5651be7d8a60fbe1af731..6de09f92b7562d770be39ebedf98a1d160b4e178 100644 (file)
@@ -71,7 +71,7 @@ u32 findDesiredStride(size_t num_lits, size_t min_len, size_t min_len_count) {
         } else if (num_lits < 5000) {
             // for larger but not huge sizes, go to stride 2 only if we have at
             // least minlen 3
-            desiredStride = MIN(min_len - 1, 2);
+            desiredStride = std::min(min_len - 1, 2UL);
         }
     }
 
index 78277108d05ac7bbdf6dad23d2d726dbbc46c339..246c395b884da19483169d957cb6580a4852a322 100644 (file)
@@ -321,7 +321,7 @@ void ComponentRepeat::wireRepeats(GlushkovBuildState &bs) {
     }
 
     DEBUG_PRINTF("wiring up %u optional repeats\n", copies - m_min);
-    for (u32 rep = MAX(m_min, 1); rep < copies; rep++) {
+    for (u32 rep = std::max(m_min, 1U); rep < copies; rep++) {
         vector<PositionInfo> lasts = m_lasts[rep - 1];
         if (rep != m_min) {
             lasts.insert(lasts.end(), optLasts.begin(), optLasts.end());