auto flow = static_cast<Flow*>(hash_table->first());
assert(flow); // holds true because hash_table->get_count() > 0
- if ( flow == save_me or flow->was_blocked() )
+ if ( (save_me and flow == save_me) or flow->was_blocked() )
{
+ // check for non-null save_me above to silence analyzer
+ // "called C++ object pointer is null" here
if ( flow->was_blocked() )
++blocks;
memmove(&tmp, p, sizeof(uint32_t));
return ntohl(tmp);
}
-
#endif
#else
return ((value & 0xff00) >> 8) | ((value & 0x00ff) << 8);
#else
return value;
-#endif /* WORDS_BIGENDIAN */
+#endif
}
inline uint32_t alignedNtohl(const uint32_t* ptr)
*((uint8_t*)ptr + 2) << 8 | *((uint8_t*)ptr + 3);
#else
value = *ptr;
-#endif /* WORDS_MUSTALIGN */
+#endif
#ifdef WORDS_BIGENDIAN
return ((value & 0xff000000) >> 24) | ((value & 0x00ff0000) >> 8) |
((value & 0x0000ff00) << 8) | ((value & 0x000000ff) << 24);
#else
return value;
-#endif /* WORDS_BIGENDIAN */
+#endif
}
inline uint64_t alignedNtohq(const uint64_t* ptr)
*((uint8_t*)ptr + 6) << 8 | *((uint8_t*)ptr + 7);
#else
value = *ptr;
-#endif /* WORDS_MUSTALIGN */
+#endif
#ifdef WORDS_BIGENDIAN
return ((value & 0xff00000000000000) >> 56) | ((value & 0x00ff000000000000) >> 40) |
((value & 0x000000000000ff00) << 40) | ((value & 0x00000000000000ff) << 56);
#else
return value;
-#endif /* WORDS_BIGENDIAN */
+#endif
}
#endif
static int RunFunc(const char* func, const char* arg1, const char* arg2)
{
sfip_t ip1, ip2;
+ sfip_clear(ip1);
+ sfip_clear(ip2);
int result = SFIP_FAILURE;
if ( arg1 )
result = strcmp(buf1, buf2) ? SFIP_FAILURE : SFIP_SUCCESS;
}
- else if ( !strcmp(func, "sfip_size") )
+ else if ( !strcmp(func, "sfip_size") and arg2 )
{
result = sfip_size(&ip1);
result = (result == atoi(arg2)) ? SFIP_SUCCESS : SFIP_FAILURE;