r4217 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Mon Aug 31 11:10:03 CEST 2009
Author: phk
Date: 2009-08-31 11:10:02 +0200 (Mon, 31 Aug 2009)
New Revision: 4217
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
trunk/varnish-cache/bin/varnishd/cache_ban.c
trunk/varnish-cache/bin/varnishd/cache_expire.c
trunk/varnish-cache/bin/varnishd/cache_pool.c
trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
trunk/varnish-cache/bin/varnishd/common.h
trunk/varnish-cache/bin/varnishd/flint.lnt
trunk/varnish-cache/bin/varnishd/hash_critbit.c
trunk/varnish-cache/bin/varnishd/storage_persistent.c
Log:
Wrap needless returns in a macro that declares them as such, so that
I can tell FlexeLint to ignore them.
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2009-08-31 09:10:02 UTC (rev 4217)
@@ -753,3 +753,4 @@
CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
return (o->objcore->flags & OC_F_BUSY);
}
+
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -268,7 +268,7 @@
WRK_QueueSession(sp);
}
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------*/
Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -550,7 +550,7 @@
HSH_Deref(sp->wrk, &o);
TIM_sleep(params->ban_lurker_sleep);
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -296,7 +296,7 @@
HSH_DerefObjCore(sp);
}
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -424,7 +424,7 @@
TIM_sleep(params->wthread_purge_delay * 1e-3);
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
@@ -497,7 +497,7 @@
wrk_breed_flock(wq[u]);
}
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
@@ -535,7 +535,7 @@
WRONG("BgThread terminated");
- return (NULL);
+ NEEDLESS_RETURN(NULL);
}
void
Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -152,7 +152,7 @@
SES_Delete(sp);
}
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------*/
Modified: trunk/varnish-cache/bin/varnishd/common.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/common.h 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/common.h 2009-08-31 09:10:02 UTC (rev 4217)
@@ -64,3 +64,5 @@
const char *name;
void *ptr;
};
+
+#define NEEDLESS_RETURN(foo) return (foo)
Modified: trunk/varnish-cache/bin/varnishd/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishd/flint.lnt 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/flint.lnt 2009-08-31 09:10:02 UTC (rev 4217)
@@ -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
Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_critbit.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/hash_critbit.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -372,7 +372,7 @@
Lck_Unlock(&hcb_mtx);
WRK_SumStat(&ww);
}
- return NULL;
+ NEEDLESS_RETURN(NULL);
}
/**********************************************************************/
Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-08-28 15:25:11 UTC (rev 4216)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-08-31 09:10:02 UTC (rev 4217)
@@ -997,7 +997,7 @@
printf("Silo completely loaded\n");
while (1)
sleep (1);
- return (NULL);
+ NEEDLESS_RETURN(NULL);
}
/*--------------------------------------------------------------------
More information about the varnish-commit
mailing list