Fossil SCM

Use count(x) instead of sizeof(x)/sizeof(*x)

andygoth 2016-11-04 21:53 andygoth-timeline-ms
Commit cda8c14c164998c22f4964dd6093b5f8eca0d5b0
1 file changed +2 -4
+2 -4
--- src/timeline.c
+++ src/timeline.c
@@ -2005,11 +2005,11 @@
20052005
if( zSearch ){
20062006
blob_appendf(&desc, " matching \"%h\"", zSearch);
20072007
}
20082008
if( g.perm.Hyperlink ){
20092009
static const char *const azMatchStyles[] = {
2010
- "exact","Exact", "glob","Glob", "like","Like", "regexp","Regexp"
2010
+ "exact", "Exact", "glob", "Glob", "like", "Like", "regexp", "Regexp"
20112011
};
20122012
double rDate;
20132013
zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
20142014
if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
20152015
zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
@@ -2049,13 +2049,11 @@
20492049
style_submenu_entry("n","Max:",4,0);
20502050
timeline_y_submenu(disableY);
20512051
style_submenu_binary("v","With Files","Without Files",
20522052
zType[0]!='a' && zType[0]!='c');
20532053
style_submenu_entry("t", "Tag Filter:", -8, 0);
2054
- style_submenu_multichoice("ms",
2055
- sizeof(azMatchStyles) / sizeof(*azMatchStyles) / 2,
2056
- azMatchStyles, 0);
2054
+ style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0);
20572055
}
20582056
blob_zero(&cond);
20592057
}
20602058
if( PB("showsql") ){
20612059
@ <pre>%h(blob_sql_text(&sql))</pre>
20622060
--- src/timeline.c
+++ src/timeline.c
@@ -2005,11 +2005,11 @@
2005 if( zSearch ){
2006 blob_appendf(&desc, " matching \"%h\"", zSearch);
2007 }
2008 if( g.perm.Hyperlink ){
2009 static const char *const azMatchStyles[] = {
2010 "exact","Exact", "glob","Glob", "like","Like", "regexp","Regexp"
2011 };
2012 double rDate;
2013 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
2014 if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
2015 zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
@@ -2049,13 +2049,11 @@
2049 style_submenu_entry("n","Max:",4,0);
2050 timeline_y_submenu(disableY);
2051 style_submenu_binary("v","With Files","Without Files",
2052 zType[0]!='a' && zType[0]!='c');
2053 style_submenu_entry("t", "Tag Filter:", -8, 0);
2054 style_submenu_multichoice("ms",
2055 sizeof(azMatchStyles) / sizeof(*azMatchStyles) / 2,
2056 azMatchStyles, 0);
2057 }
2058 blob_zero(&cond);
2059 }
2060 if( PB("showsql") ){
2061 @ <pre>%h(blob_sql_text(&sql))</pre>
2062
--- src/timeline.c
+++ src/timeline.c
@@ -2005,11 +2005,11 @@
2005 if( zSearch ){
2006 blob_appendf(&desc, " matching \"%h\"", zSearch);
2007 }
2008 if( g.perm.Hyperlink ){
2009 static const char *const azMatchStyles[] = {
2010 "exact", "Exact", "glob", "Glob", "like", "Like", "regexp", "Regexp"
2011 };
2012 double rDate;
2013 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
2014 if( (!zDate || !zDate[0]) && ( zAfter || zBefore ) ){
2015 zDate = mprintf("%s", (zAfter ? zAfter : zBefore));
@@ -2049,13 +2049,11 @@
2049 style_submenu_entry("n","Max:",4,0);
2050 timeline_y_submenu(disableY);
2051 style_submenu_binary("v","With Files","Without Files",
2052 zType[0]!='a' && zType[0]!='c');
2053 style_submenu_entry("t", "Tag Filter:", -8, 0);
2054 style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0);
 
 
2055 }
2056 blob_zero(&cond);
2057 }
2058 if( PB("showsql") ){
2059 @ <pre>%h(blob_sql_text(&sql))</pre>
2060

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button