Commit 0f16bc7d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Wrap needless returns in a macro that declares them as such, so that

I can tell FlexeLint to ignore them.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4217 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8ef8c6a4
......@@ -753,3 +753,4 @@ ObjIsBusy(const struct object *o)
CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
return (o->objcore->flags & OC_F_BUSY);
}
......@@ -268,7 +268,7 @@ vca_acct(void *arg)
WRK_QueueSession(sp);
}
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------*/
......
......@@ -550,7 +550,7 @@ ban_lurker(struct sess *sp, void *priv)
HSH_Deref(sp->wrk, &o);
TIM_sleep(params->ban_lurker_sleep);
}
return NULL;
NEEDLESS_RETURN(NULL);
}
......
......@@ -296,7 +296,7 @@ exp_timer(struct sess *sp, void *priv)
HSH_DerefObjCore(sp);
}
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
......
......@@ -424,7 +424,7 @@ wrk_herdtimer_thread(void *priv)
TIM_sleep(params->wthread_purge_delay * 1e-3);
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
......@@ -497,7 +497,7 @@ wrk_herder_thread(void *priv)
wrk_breed_flock(wq[u]);
}
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
......@@ -535,7 +535,7 @@ wrk_bgthread(void *arg)
WRONG("BgThread terminated");
return (NULL);
NEEDLESS_RETURN(NULL);
}
void
......
......@@ -152,7 +152,7 @@ vca_main(void *arg)
SES_Delete(sp);
}
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------*/
......
......@@ -64,3 +64,5 @@ struct choice {
const char *name;
void *ptr;
};
#define NEEDLESS_RETURN(foo) return (foo)
......@@ -55,6 +55,7 @@
-efile(766, ../../config.h)
-emacro(413, offsetof) // likely null pointer
-emacro(527, WRONG) // unreachable code
-emacro(527, NEEDLESS_RETURN) // unreachable code
-emacro(702, WEXITSTATUS) // signed shift right
-efunc(525, VCC_Return_Name) // Negative indent
......
......@@ -372,7 +372,7 @@ hcb_cleaner(void *priv)
Lck_Unlock(&hcb_mtx);
WRK_SumStat(&ww);
}
return NULL;
NEEDLESS_RETURN(NULL);
}
/**********************************************************************/
......
......@@ -997,7 +997,7 @@ smp_thread(struct sess *sp, void *priv)
printf("Silo completely loaded\n");
while (1)
sleep (1);
return (NULL);
NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment