stream: fix minor scan-build warning

stream-tcp.c:134:14: warning: Value stored to 'presize' during its initialization is never read [deadcode.DeadStores]
    uint64_t presize = SC_ATOMIC_GET(st_memuse);
             ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
pull/8753/head
Victor Julien 2 years ago
parent bcf8187443
commit 0c15114450

@ -130,7 +130,7 @@ void StreamTcpIncrMemuse(uint64_t size)
void StreamTcpDecrMemuse(uint64_t size) void StreamTcpDecrMemuse(uint64_t size)
{ {
#ifdef DEBUG_VALIDATION #if defined(DEBUG_VALIDATION) && defined(UNITTESTS)
uint64_t presize = SC_ATOMIC_GET(st_memuse); uint64_t presize = SC_ATOMIC_GET(st_memuse);
if (RunmodeIsUnittests()) { if (RunmodeIsUnittests()) {
BUG_ON(presize > UINT_MAX); BUG_ON(presize > UINT_MAX);
@ -139,7 +139,7 @@ void StreamTcpDecrMemuse(uint64_t size)
(void) SC_ATOMIC_SUB(st_memuse, size); (void) SC_ATOMIC_SUB(st_memuse, size);
#ifdef DEBUG_VALIDATION #if defined(DEBUG_VALIDATION) && defined(UNITTESTS)
if (RunmodeIsUnittests()) { if (RunmodeIsUnittests()) {
uint64_t postsize = SC_ATOMIC_GET(st_memuse); uint64_t postsize = SC_ATOMIC_GET(st_memuse);
BUG_ON(postsize > presize); BUG_ON(postsize > presize);

Loading…
Cancel
Save