]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Bug fix/clang tidy warnings part3 (#298)
authorgtsoul-tech <56584633+gtsoul-tech@users.noreply.github.com>
Mon, 10 Jun 2024 07:08:54 +0000 (10:08 +0300)
committerGitHub <noreply@github.com>
Mon, 10 Jun 2024 07:08:54 +0000 (10:08 +0300)
* clang-analyzer-deadcode.DeadStores

* clang-analyzer-optin.performance.Padding

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
src/fdr/fdr_compile.cpp
src/fdr/teddy_compile.cpp
src/fdr/teddy_engine_description.h
src/nfa/limex_internal.h

index 0edb3a94a8f2d7023211ebed4134f05b00cecce0..7d96b6d0a60103ddf6aade582674c9adf1e8beb2 100644 (file)
@@ -206,8 +206,7 @@ bytecode_ptr<FDR> FDRCompiler::setupFDR() {
     assert(ISALIGNED_CL(ptr));
     fdr->floodOffset = verify_u32(ptr - fdr_base);
     memcpy(ptr, floodTable.get(), floodTable.size());
-    ptr += floodTable.size(); // last write, no need to round up
-
+    
     return fdr;
 }
 
index 821a69e2a9552139d613b1b3bc11f1fa788cab3a..6cba29ebd8dc12dda4d4bef853273b9e35b401f7 100644 (file)
@@ -597,7 +597,7 @@ bytecode_ptr<FDR> TeddyCompiler::build() {
     assert(ISALIGNED_CL(ptr));
     teddy->floodOffset = verify_u32(ptr - teddy_base);
     memcpy(ptr, floodTable.get(), floodTable.size());
-    ptr += floodTable.size();
+    
 
     // Write teddy masks.
     u8 *baseMsk = teddy_base + ROUNDUP_CL(headerSize);
index 95931613840c44ed726c8c45e73a866597f32903..4f0ced68a010ceac62911335914e5c9b702397b3 100644 (file)
@@ -39,7 +39,7 @@ namespace ue2 {
 
 #define TEDDY_BUCKET_LOAD 6
 
-struct TeddyEngineDef {
+struct TeddyEngineDef {     //NOLINT (clang-analyzer-optin.performance.Padding)
     u32 id;
     u64a cpu_features;
     u32 numMasks;
index 23b1bd970713176242c14f1e57208a82d2455e0a..691d31106199735fca8329056f786ccd710d5276 100644 (file)
@@ -163,12 +163,12 @@ struct LimExNFA##size {                                                     \
     m512 exceptionAndMask; /**< exception and mask */                       \
 };
 
-CREATE_NFA_LIMEX(32)
-CREATE_NFA_LIMEX(64)
-CREATE_NFA_LIMEX(128)
-CREATE_NFA_LIMEX(256)
-CREATE_NFA_LIMEX(384)
-CREATE_NFA_LIMEX(512)
+CREATE_NFA_LIMEX(32)        //NOLINT (clang-analyzer-optin.performance.Padding)
+CREATE_NFA_LIMEX(64)        //NOLINT (clang-analyzer-optin.performance.Padding)
+CREATE_NFA_LIMEX(128)       //NOLINT (clang-analyzer-optin.performance.Padding)
+CREATE_NFA_LIMEX(256)       //NOLINT (clang-analyzer-optin.performance.Padding)
+CREATE_NFA_LIMEX(384)       //NOLINT (clang-analyzer-optin.performance.Padding)
+CREATE_NFA_LIMEX(512)       //NOLINT (clang-analyzer-optin.performance.Padding)
 
 /** \brief Structure describing a bounded repeat within the LimEx NFA.
  *