Fossil SCM

Make azType in statrep.c a const table (which it actually is ...)

jan.nijtmans 2015-05-31 11:19 trunk
Commit b43681dc227deda2bb4217394065ee2ef62afc28
2 files changed +1 -1 +3 -3
+1 -1
--- src/statrep.c
+++ src/statrep.c
@@ -684,11 +684,11 @@
684684
{ "By User", "byuser", RPT_BYUSER },
685685
{ "By Week", "byweek", RPT_BYWEEK },
686686
{ "By Weekday", "byweekday", RPT_BYWEEKDAY },
687687
{ "By Year", "byyear", RPT_BYYEAR },
688688
};
689
- const char *azType[] = {
689
+ const char *const azType[] = {
690690
"a", "All Changes",
691691
"ci", "Check-ins",
692692
"g", "Tags",
693693
"e", "Tech Notes",
694694
"t", "Tickets",
695695
--- src/statrep.c
+++ src/statrep.c
@@ -684,11 +684,11 @@
684 { "By User", "byuser", RPT_BYUSER },
685 { "By Week", "byweek", RPT_BYWEEK },
686 { "By Weekday", "byweekday", RPT_BYWEEKDAY },
687 { "By Year", "byyear", RPT_BYYEAR },
688 };
689 const char *azType[] = {
690 "a", "All Changes",
691 "ci", "Check-ins",
692 "g", "Tags",
693 "e", "Tech Notes",
694 "t", "Tickets",
695
--- src/statrep.c
+++ src/statrep.c
@@ -684,11 +684,11 @@
684 { "By User", "byuser", RPT_BYUSER },
685 { "By Week", "byweek", RPT_BYWEEK },
686 { "By Weekday", "byweekday", RPT_BYWEEKDAY },
687 { "By Year", "byyear", RPT_BYYEAR },
688 };
689 const char *const azType[] = {
690 "a", "All Changes",
691 "ci", "Check-ins",
692 "g", "Tags",
693 "e", "Tech Notes",
694 "t", "Tickets",
695
+3 -3
--- src/style.c
+++ src/style.c
@@ -48,11 +48,11 @@
4848
const char *zName; /* Form query parameter */
4949
const char *zLabel; /* Label. Might be NULL for FF_MULTI */
5050
unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_BINARY */
5151
unsigned char isDisabled; /* True if this control is grayed out */
5252
short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
53
- const char **azChoice; /* value/display pairs for FF_MULTI */
53
+ const char *const *azChoice;/* value/display pairs for FF_MULTI */
5454
const char *zFalse; /* FF_BINARY label when false */
5555
} aSubmenuCtrl[20];
5656
static int nSubmenuCtrl = 0;
5757
#define FF_ENTRY 1
5858
#define FF_MULTI 2
@@ -274,11 +274,11 @@
274274
nSubmenuCtrl++;
275275
}
276276
void style_submenu_multichoice(
277277
const char *zName, /* Query parameter name */
278278
int nChoice, /* Number of options */
279
- const char **azChoice, /* value/display pairs. 2*nChoice entries */
279
+ const char *const *azChoice,/* value/display pairs. 2*nChoice entries */
280280
int isDisabled /* True if this control is disabled */
281281
){
282282
assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
283283
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
284284
aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
@@ -313,11 +313,11 @@
313313
db_finalize(&q);
314314
if( n>0 ){
315315
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
316316
aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
317317
aSubmenuCtrl[nSubmenuCtrl].iSize = n/2;
318
- aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char**)az;
318
+ aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char *const *)az;
319319
aSubmenuCtrl[nSubmenuCtrl].isDisabled = 0;
320320
aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
321321
nSubmenuCtrl++;
322322
}
323323
}
324324
--- src/style.c
+++ src/style.c
@@ -48,11 +48,11 @@
48 const char *zName; /* Form query parameter */
49 const char *zLabel; /* Label. Might be NULL for FF_MULTI */
50 unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_BINARY */
51 unsigned char isDisabled; /* True if this control is grayed out */
52 short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
53 const char **azChoice; /* value/display pairs for FF_MULTI */
54 const char *zFalse; /* FF_BINARY label when false */
55 } aSubmenuCtrl[20];
56 static int nSubmenuCtrl = 0;
57 #define FF_ENTRY 1
58 #define FF_MULTI 2
@@ -274,11 +274,11 @@
274 nSubmenuCtrl++;
275 }
276 void style_submenu_multichoice(
277 const char *zName, /* Query parameter name */
278 int nChoice, /* Number of options */
279 const char **azChoice, /* value/display pairs. 2*nChoice entries */
280 int isDisabled /* True if this control is disabled */
281 ){
282 assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
283 aSubmenuCtrl[nSubmenuCtrl].zName = zName;
284 aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
@@ -313,11 +313,11 @@
313 db_finalize(&q);
314 if( n>0 ){
315 aSubmenuCtrl[nSubmenuCtrl].zName = zName;
316 aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
317 aSubmenuCtrl[nSubmenuCtrl].iSize = n/2;
318 aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char**)az;
319 aSubmenuCtrl[nSubmenuCtrl].isDisabled = 0;
320 aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
321 nSubmenuCtrl++;
322 }
323 }
324
--- src/style.c
+++ src/style.c
@@ -48,11 +48,11 @@
48 const char *zName; /* Form query parameter */
49 const char *zLabel; /* Label. Might be NULL for FF_MULTI */
50 unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_BINARY */
51 unsigned char isDisabled; /* True if this control is grayed out */
52 short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
53 const char *const *azChoice;/* value/display pairs for FF_MULTI */
54 const char *zFalse; /* FF_BINARY label when false */
55 } aSubmenuCtrl[20];
56 static int nSubmenuCtrl = 0;
57 #define FF_ENTRY 1
58 #define FF_MULTI 2
@@ -274,11 +274,11 @@
274 nSubmenuCtrl++;
275 }
276 void style_submenu_multichoice(
277 const char *zName, /* Query parameter name */
278 int nChoice, /* Number of options */
279 const char *const *azChoice,/* value/display pairs. 2*nChoice entries */
280 int isDisabled /* True if this control is disabled */
281 ){
282 assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
283 aSubmenuCtrl[nSubmenuCtrl].zName = zName;
284 aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
@@ -313,11 +313,11 @@
313 db_finalize(&q);
314 if( n>0 ){
315 aSubmenuCtrl[nSubmenuCtrl].zName = zName;
316 aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
317 aSubmenuCtrl[nSubmenuCtrl].iSize = n/2;
318 aSubmenuCtrl[nSubmenuCtrl].azChoice = (const char *const *)az;
319 aSubmenuCtrl[nSubmenuCtrl].isDisabled = 0;
320 aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
321 nSubmenuCtrl++;
322 }
323 }
324

Keyboard Shortcuts

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