Fossil SCM

Fix the build for MSVC.

drh 2015-05-09 17:57 trunk
Commit 732b651afa972588c83e80f9fa213770c6e8f5cb
2 files changed +5 -1 +2 -2
+5 -1
--- src/piechart.c
+++ src/piechart.c
@@ -20,10 +20,14 @@
2020
*/
2121
#include "config.h"
2222
#include "piechart.h"
2323
#include <math.h>
2424
25
+#ifndef M_PI
26
+# define M_PI 3.1415926535897932385
27
+#endif
28
+
2529
/*
2630
** Return an RGB color name given HSV values. The HSV values
2731
** must each be between between 0 and 255. The string
2832
** returned is held in a static buffer and is overwritten
2933
** on each call.
@@ -208,15 +212,15 @@
208212
*/
209213
void piechart_test_page(void){
210214
const char *zData;
211215
Stmt ins, q;
212216
Blob all, line, token1, token2;
213
- login_check_credentials();
214217
int n = 0;
215218
int width;
216219
int height;
217220
221
+ login_check_credentials();
218222
style_header("Pie Chart Test");
219223
db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
220224
db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
221225
zData = PD("data","");
222226
width = atoi(PD("width","800"));
223227
--- src/piechart.c
+++ src/piechart.c
@@ -20,10 +20,14 @@
20 */
21 #include "config.h"
22 #include "piechart.h"
23 #include <math.h>
24
 
 
 
 
25 /*
26 ** Return an RGB color name given HSV values. The HSV values
27 ** must each be between between 0 and 255. The string
28 ** returned is held in a static buffer and is overwritten
29 ** on each call.
@@ -208,15 +212,15 @@
208 */
209 void piechart_test_page(void){
210 const char *zData;
211 Stmt ins, q;
212 Blob all, line, token1, token2;
213 login_check_credentials();
214 int n = 0;
215 int width;
216 int height;
217
 
218 style_header("Pie Chart Test");
219 db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
220 db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
221 zData = PD("data","");
222 width = atoi(PD("width","800"));
223
--- src/piechart.c
+++ src/piechart.c
@@ -20,10 +20,14 @@
20 */
21 #include "config.h"
22 #include "piechart.h"
23 #include <math.h>
24
25 #ifndef M_PI
26 # define M_PI 3.1415926535897932385
27 #endif
28
29 /*
30 ** Return an RGB color name given HSV values. The HSV values
31 ** must each be between between 0 and 255. The string
32 ** returned is held in a static buffer and is overwritten
33 ** on each call.
@@ -208,15 +212,15 @@
212 */
213 void piechart_test_page(void){
214 const char *zData;
215 Stmt ins, q;
216 Blob all, line, token1, token2;
 
217 int n = 0;
218 int width;
219 int height;
220
221 login_check_credentials();
222 style_header("Pie Chart Test");
223 db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
224 db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
225 zData = PD("data","");
226 width = atoi(PD("width","800"));
227
+2 -2
--- src/stat.c
+++ src/stat.c
@@ -379,16 +379,16 @@
379379
**
380380
** Show relative sizes of tables in the repository database.
381381
*/
382382
void repo_tabsize_page(void){
383383
Stmt q;
384
- login_check_credentials();
385384
int nPageFree;
386385
sqlite3_int64 fsize;
387386
char zBuf[100];
388
- if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
389387
388
+ login_check_credentials();
389
+ if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
390390
style_header("Repository Table Sizes");
391391
style_adunit_config(ADUNIT_RIGHT_OK);
392392
style_submenu_element("Stat", "Repository Stats", "stat");
393393
db_multi_exec(
394394
"CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);"
395395
--- src/stat.c
+++ src/stat.c
@@ -379,16 +379,16 @@
379 **
380 ** Show relative sizes of tables in the repository database.
381 */
382 void repo_tabsize_page(void){
383 Stmt q;
384 login_check_credentials();
385 int nPageFree;
386 sqlite3_int64 fsize;
387 char zBuf[100];
388 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
389
 
 
390 style_header("Repository Table Sizes");
391 style_adunit_config(ADUNIT_RIGHT_OK);
392 style_submenu_element("Stat", "Repository Stats", "stat");
393 db_multi_exec(
394 "CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);"
395
--- src/stat.c
+++ src/stat.c
@@ -379,16 +379,16 @@
379 **
380 ** Show relative sizes of tables in the repository database.
381 */
382 void repo_tabsize_page(void){
383 Stmt q;
 
384 int nPageFree;
385 sqlite3_int64 fsize;
386 char zBuf[100];
 
387
388 login_check_credentials();
389 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
390 style_header("Repository Table Sizes");
391 style_adunit_config(ADUNIT_RIGHT_OK);
392 style_submenu_element("Stat", "Repository Stats", "stat");
393 db_multi_exec(
394 "CREATE VIRTUAL TABLE temp.dbx USING dbstat(%s);"
395

Keyboard Shortcuts

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