diff --git a/userspace/libsinsp/filter.cpp b/userspace/libsinsp/filter.cpp index 2e810840f3..2eae5086e2 100644 --- a/userspace/libsinsp/filter.cpp +++ b/userspace/libsinsp/filter.cpp @@ -1024,7 +1024,7 @@ int32_t sinsp_filter_check::get_check_id() } -void sinsp_filter_check::add_filter_value(const char* str, uint32_t len, uint16_t i) +void sinsp_filter_check::add_filter_value(const char* str, uint32_t len, uint32_t i) { if (i >= m_val_storages.size()) @@ -1709,7 +1709,7 @@ void sinsp_filter_compiler::parse_check() // // Create the 'or' sequence // - uint64_t num_values = 0; + uint32_t num_values = 0; while(true) { // 'in' clause aware @@ -1762,7 +1762,7 @@ void sinsp_filter_compiler::parse_check() // // Create the 'or' sequence // - uint64_t num_values = 0; + uint32_t num_values = 0; while(true) { // 'in' clause aware diff --git a/userspace/libsinsp/filter_value.h b/userspace/libsinsp/filter_value.h index 9ec5feb259..67c780b0e7 100644 --- a/userspace/libsinsp/filter_value.h +++ b/userspace/libsinsp/filter_value.h @@ -38,10 +38,9 @@ struct g_hash_membuf return std::_Hash_impl::hash(val.first, val.second); #else size_t hash = 5381; - for(uint8_t *p = val.first; p-val.first < val.second; p++) + for(uint8_t *p = val.first; (uint32_t)(p-val.first) < val.second; p++) { int c = *p; - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ } return hash; diff --git a/userspace/libsinsp/filterchecks.h b/userspace/libsinsp/filterchecks.h index b4d659c52e..be2d7f1c6b 100644 --- a/userspace/libsinsp/filterchecks.h +++ b/userspace/libsinsp/filterchecks.h @@ -84,7 +84,7 @@ class sinsp_filter_check // If this check is used by a filter, extract the constant to compare it to // Doesn't return the field length because the filtering engine can calculate it. // - void add_filter_value(const char* str, uint32_t len, uint16_t i = 0 ); + void add_filter_value(const char* str, uint32_t len, uint32_t i = 0 ); virtual void parse_filter_value(const char* str, uint32_t len, uint8_t *storage, uint32_t storage_len); //