Fossil SCM

Compiler warning fixes. This includes disabling the undocumented FOSSIL_PWREADER feature and upgrading the built-in SQLite.

drh 2016-08-02 08:46 trunk
Commit f35b46d4cb49d343aa41c115917e25d3dfd81953
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
2626
** crypto phasephrase for each command.
2727
*/
2828
#include "config.h"
2929
#include "fshell.h"
3030
#include <ctype.h>
31
+
32
+#ifndef _WIN32
33
+#include <sys/types.h>
34
+#include <sys/wait.h>
35
+#endif
3136
3237
3338
/*
3439
** COMMAND: shell*
3540
**
3641
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
26 ** crypto phasephrase for each command.
27 */
28 #include "config.h"
29 #include "fshell.h"
30 #include <ctype.h>
 
 
 
 
 
31
32
33 /*
34 ** COMMAND: shell*
35 **
36
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
26 ** crypto phasephrase for each command.
27 */
28 #include "config.h"
29 #include "fshell.h"
30 #include <ctype.h>
31
32 #ifndef _WIN32
33 #include <sys/types.h>
34 #include <sys/wait.h>
35 #endif
36
37
38 /*
39 ** COMMAND: shell*
40 **
41
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
11061106
**
11071107
** The number of errors encountered is returned. An error is an
11081108
** unterminated token.
11091109
*/
11101110
static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111
- const char *z, *zStart;
1111
+ const char *zStart;
11121112
int iStart;
11131113
int nBrace;
11141114
int c;
11151115
int nLine;
11161116
int nErr;
@@ -1135,11 +1135,10 @@
11351135
11361136
default:
11371137
return nErr;
11381138
}
11391139
1140
- z = pIn->z;
11411140
iStart = pIn->i;
11421141
zStart = pToken->zText;
11431142
nLine = pToken->nLine;
11441143
nBrace = 1;
11451144
while( nBrace ){
@@ -1681,18 +1680,16 @@
16811680
** This routine is called when we see a method for a class that begins
16821681
** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
16831682
** added to their class definitions.
16841683
*/
16851684
static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
1686
- Token *pCode;
16871685
Token *pClass;
16881686
char *zDecl;
16891687
Decl *pDecl;
16901688
String str;
16911689
int type;
16921690
1693
- pCode = pLast;
16941691
pLast = pLast->pPrev;
16951692
while( pFirst->zText[0]=='P' ){
16961693
int rc = 1;
16971694
switch( pFirst->nText ){
16981695
case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
16991696
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
1106 **
1107 ** The number of errors encountered is returned. An error is an
1108 ** unterminated token.
1109 */
1110 static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111 const char *z, *zStart;
1112 int iStart;
1113 int nBrace;
1114 int c;
1115 int nLine;
1116 int nErr;
@@ -1135,11 +1135,10 @@
1135
1136 default:
1137 return nErr;
1138 }
1139
1140 z = pIn->z;
1141 iStart = pIn->i;
1142 zStart = pToken->zText;
1143 nLine = pToken->nLine;
1144 nBrace = 1;
1145 while( nBrace ){
@@ -1681,18 +1680,16 @@
1681 ** This routine is called when we see a method for a class that begins
1682 ** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
1683 ** added to their class definitions.
1684 */
1685 static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
1686 Token *pCode;
1687 Token *pClass;
1688 char *zDecl;
1689 Decl *pDecl;
1690 String str;
1691 int type;
1692
1693 pCode = pLast;
1694 pLast = pLast->pPrev;
1695 while( pFirst->zText[0]=='P' ){
1696 int rc = 1;
1697 switch( pFirst->nText ){
1698 case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
1699
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
1106 **
1107 ** The number of errors encountered is returned. An error is an
1108 ** unterminated token.
1109 */
1110 static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111 const char *zStart;
1112 int iStart;
1113 int nBrace;
1114 int c;
1115 int nLine;
1116 int nErr;
@@ -1135,11 +1135,10 @@
1135
1136 default:
1137 return nErr;
1138 }
1139
 
1140 iStart = pIn->i;
1141 zStart = pToken->zText;
1142 nLine = pToken->nLine;
1143 nBrace = 1;
1144 while( nBrace ){
@@ -1681,18 +1680,16 @@
1680 ** This routine is called when we see a method for a class that begins
1681 ** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
1682 ** added to their class definitions.
1683 */
1684 static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
 
1685 Token *pClass;
1686 char *zDecl;
1687 Decl *pDecl;
1688 String str;
1689 int type;
1690
 
1691 pLast = pLast->pPrev;
1692 while( pFirst->zText[0]=='P' ){
1693 int rc = 1;
1694 switch( pFirst->nText ){
1695 case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
1696
+3 -3
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,11 +380,11 @@
380380
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381381
** [sqlite_version()] and [sqlite_source_id()].
382382
*/
383383
#define SQLITE_VERSION "3.14.0"
384384
#define SQLITE_VERSION_NUMBER 3014000
385
-#define SQLITE_SOURCE_ID "2016-08-01 17:06:44 90d2c490fc2ed4e073711b84f989ca4d496dcfb5"
385
+#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
386386
387387
/*
388388
** CAPI3REF: Run-Time Library Version Numbers
389389
** KEYWORDS: sqlite3_version, sqlite3_sourceid
390390
**
@@ -18324,11 +18324,11 @@
1832418324
sqlite3_mutex_leave(pMutex);
1832518325
(void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
1832618326
return SQLITE_OK;
1832718327
}
1832818328
SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329
- sqlite3_int64 iCur, iHwtr;
18329
+ sqlite3_int64 iCur = 0, iHwtr = 0;
1833018330
int rc;
1833118331
#ifdef SQLITE_ENABLE_API_ARMOR
1833218332
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
1833318333
#endif
1833418334
rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -193945,11 +193945,11 @@
193945193945
int nArg, /* Number of args */
193946193946
sqlite3_value **apUnused /* Function arguments */
193947193947
){
193948193948
assert( nArg==0 );
193949193949
UNUSED_PARAM2(nArg, apUnused);
193950
- sqlite3_result_text(pCtx, "fts5: 2016-07-30 18:54:54 390a38a142d36d2c57b3f21aab72edcde450125d", -1, SQLITE_TRANSIENT);
193950
+ sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
193951193951
}
193952193952
193953193953
static int fts5Init(sqlite3 *db){
193954193954
static const sqlite3_module fts5Mod = {
193955193955
/* iVersion */ 2,
193956193956
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,11 +380,11 @@
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.0"
384 #define SQLITE_VERSION_NUMBER 3014000
385 #define SQLITE_SOURCE_ID "2016-08-01 17:06:44 90d2c490fc2ed4e073711b84f989ca4d496dcfb5"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -18324,11 +18324,11 @@
18324 sqlite3_mutex_leave(pMutex);
18325 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18326 return SQLITE_OK;
18327 }
18328 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329 sqlite3_int64 iCur, iHwtr;
18330 int rc;
18331 #ifdef SQLITE_ENABLE_API_ARMOR
18332 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18333 #endif
18334 rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -193945,11 +193945,11 @@
193945 int nArg, /* Number of args */
193946 sqlite3_value **apUnused /* Function arguments */
193947 ){
193948 assert( nArg==0 );
193949 UNUSED_PARAM2(nArg, apUnused);
193950 sqlite3_result_text(pCtx, "fts5: 2016-07-30 18:54:54 390a38a142d36d2c57b3f21aab72edcde450125d", -1, SQLITE_TRANSIENT);
193951 }
193952
193953 static int fts5Init(sqlite3 *db){
193954 static const sqlite3_module fts5Mod = {
193955 /* iVersion */ 2,
193956
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,11 +380,11 @@
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.0"
384 #define SQLITE_VERSION_NUMBER 3014000
385 #define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -18324,11 +18324,11 @@
18324 sqlite3_mutex_leave(pMutex);
18325 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18326 return SQLITE_OK;
18327 }
18328 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329 sqlite3_int64 iCur = 0, iHwtr = 0;
18330 int rc;
18331 #ifdef SQLITE_ENABLE_API_ARMOR
18332 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18333 #endif
18334 rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -193945,11 +193945,11 @@
193945 int nArg, /* Number of args */
193946 sqlite3_value **apUnused /* Function arguments */
193947 ){
193948 assert( nArg==0 );
193949 UNUSED_PARAM2(nArg, apUnused);
193950 sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
193951 }
193952
193953 static int fts5Init(sqlite3 *db){
193954 static const sqlite3_module fts5Mod = {
193955 /* iVersion */ 2,
193956
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,11 +120,11 @@
120120
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121121
** [sqlite_version()] and [sqlite_source_id()].
122122
*/
123123
#define SQLITE_VERSION "3.14.0"
124124
#define SQLITE_VERSION_NUMBER 3014000
125
-#define SQLITE_SOURCE_ID "2016-08-01 17:06:44 90d2c490fc2ed4e073711b84f989ca4d496dcfb5"
125
+#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
126126
127127
/*
128128
** CAPI3REF: Run-Time Library Version Numbers
129129
** KEYWORDS: sqlite3_version, sqlite3_sourceid
130130
**
131131
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,11 +120,11 @@
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.0"
124 #define SQLITE_VERSION_NUMBER 3014000
125 #define SQLITE_SOURCE_ID "2016-08-01 17:06:44 90d2c490fc2ed4e073711b84f989ca4d496dcfb5"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
131
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,11 +120,11 @@
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.0"
124 #define SQLITE_VERSION_NUMBER 3014000
125 #define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
131
+15 -11
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170170
171171
172172
/*
173173
** Do a single prompt for a passphrase. Store the results in the blob.
174174
**
175
-** If the FOSSIL_PWREADER environment variable is set, then it will
176
-** be the name of a program that prompts the user for their password/
177
-** passphrase in a secure manner. The program should take one or more
178
-** arguments which are the prompts and should output the acquired
179
-** passphrase as a single line on stdout. This function will read the
180
-** output using popen().
181
-**
182
-** If FOSSIL_PWREADER is not set, or if it is not the name of an
183
-** executable, then use the C-library getpass() routine.
184175
**
185176
** The return value is a pointer to a static buffer that is overwritten
186177
** on subsequent calls to this same routine.
187178
*/
188179
static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
189180
char *z;
181
+#if 0
182
+ */
183
+ ** If the FOSSIL_PWREADER environment variable is set, then it will
184
+ ** be the name of a program that prompts the user for their password/
185
+ ** passphrase in a secure manner. The program should take one or more
186
+ ** arguments which are the prompts and should output the acquired
187
+ ** passphrase as a single line on stdout. This function will read the
188
+ ** output using popen().
189
+ **
190
+ ** If FOSSIL_PWREADER is not set, or if it is not the name of an
191
+ ** executable, then use the C-library getpass() routine.
192
+ */
190193
const char *zProg = fossil_getenv("FOSSIL_PWREADER");
191
- const char *zSecure;
192194
if( zProg && zProg[0] ){
193195
static char zPass[100];
194196
Blob cmd;
195197
FILE *in;
196198
blob_zero(&cmd);
@@ -199,11 +201,13 @@
199201
in = popen(blob_str(&cmd), "r");
200202
fgets(zPass, sizeof(zPass), in);
201203
pclose(in);
202204
blob_reset(&cmd);
203205
z = zPass;
204
- }else if( fossil_security_level()>=2 ){
206
+ }else
207
+#endif
208
+ if( fossil_security_level()>=2 ){
205209
userGenerateScrambleCode();
206210
z = getpass(zPrompt);
207211
if( z ) userDescramble(z);
208212
printf("\033[3A\033[J"); /* Erase previous three lines */
209213
fflush(stdout);
210214
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170
171
172 /*
173 ** Do a single prompt for a passphrase. Store the results in the blob.
174 **
175 ** If the FOSSIL_PWREADER environment variable is set, then it will
176 ** be the name of a program that prompts the user for their password/
177 ** passphrase in a secure manner. The program should take one or more
178 ** arguments which are the prompts and should output the acquired
179 ** passphrase as a single line on stdout. This function will read the
180 ** output using popen().
181 **
182 ** If FOSSIL_PWREADER is not set, or if it is not the name of an
183 ** executable, then use the C-library getpass() routine.
184 **
185 ** The return value is a pointer to a static buffer that is overwritten
186 ** on subsequent calls to this same routine.
187 */
188 static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
189 char *z;
 
 
 
 
 
 
 
 
 
 
 
 
190 const char *zProg = fossil_getenv("FOSSIL_PWREADER");
191 const char *zSecure;
192 if( zProg && zProg[0] ){
193 static char zPass[100];
194 Blob cmd;
195 FILE *in;
196 blob_zero(&cmd);
@@ -199,11 +201,13 @@
199 in = popen(blob_str(&cmd), "r");
200 fgets(zPass, sizeof(zPass), in);
201 pclose(in);
202 blob_reset(&cmd);
203 z = zPass;
204 }else if( fossil_security_level()>=2 ){
 
 
205 userGenerateScrambleCode();
206 z = getpass(zPrompt);
207 if( z ) userDescramble(z);
208 printf("\033[3A\033[J"); /* Erase previous three lines */
209 fflush(stdout);
210
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170
171
172 /*
173 ** Do a single prompt for a passphrase. Store the results in the blob.
174 **
 
 
 
 
 
 
 
 
 
175 **
176 ** The return value is a pointer to a static buffer that is overwritten
177 ** on subsequent calls to this same routine.
178 */
179 static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
180 char *z;
181 #if 0
182 */
183 ** If the FOSSIL_PWREADER environment variable is set, then it will
184 ** be the name of a program that prompts the user for their password/
185 ** passphrase in a secure manner. The program should take one or more
186 ** arguments which are the prompts and should output the acquired
187 ** passphrase as a single line on stdout. This function will read the
188 ** output using popen().
189 **
190 ** If FOSSIL_PWREADER is not set, or if it is not the name of an
191 ** executable, then use the C-library getpass() routine.
192 */
193 const char *zProg = fossil_getenv("FOSSIL_PWREADER");
 
194 if( zProg && zProg[0] ){
195 static char zPass[100];
196 Blob cmd;
197 FILE *in;
198 blob_zero(&cmd);
@@ -199,11 +201,13 @@
201 in = popen(blob_str(&cmd), "r");
202 fgets(zPass, sizeof(zPass), in);
203 pclose(in);
204 blob_reset(&cmd);
205 z = zPass;
206 }else
207 #endif
208 if( fossil_security_level()>=2 ){
209 userGenerateScrambleCode();
210 z = getpass(zPrompt);
211 if( z ) userDescramble(z);
212 printf("\033[3A\033[J"); /* Erase previous three lines */
213 fflush(stdout);
214

Keyboard Shortcuts

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