Skip to contentSkip to conversation

make a const struct static

PATCH In review Pete Zaitcev 2 participants 2 messages Aug 6, 2010 – Aug 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 make a const struct static

---
 server/server.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 93b990f68e5c2c652759a2db8af049d172b8489c

Author: Pete Zaitcev <[email protected]>
Date:   Thu Aug 5 20:33:21 2010 -0600

Make initialized struct a static const.

server/server.c +1 -1
index 0d6316d..814afec 100644
@@ -1413,7 +1413,7 @@ err_out:
 
 static void add_chkpt_timer(void)
 {
-	struct timeval tv = { TABLED_CHKPT_SEC, 0 };
+	static const struct timeval tv = { TABLED_CHKPT_SEC, 0 };
 
 	if (evtimer_add(&tabled_srv.chkpt_timer, &tv) < 0)
 		applog(LOG_WARNING, "unable to add checkpoint timer");
#1 lore raw
Quoted 11 lines · Pete Zaitcev
---
  server/server.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

commit 93b990f68e5c2c652759a2db8af049d172b8489c

Author: Pete Zaitcev<[email protected]>
Date:   Thu Aug 5 20:33:21 2010 -0600

Make initialized struct a static const.

applied 1-2