Check-in [908009fdc4]
Not logged in
Overview

SHA1 Hash:908009fdc446c4c3a109f70652b431fdd149db19
Date: 2008-05-07 17:38:57
User: drh
Comment:Fix a couple of C++-isms in my_page.c and tagview.c. Remove the return value from autosync().
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/my_page.c from [0d6df55ccb] to [52bd9eb48f].

@@ -80,16 +80,19 @@
 {
   int uid = g.userUid;
   char * sql = mprintf( "SELECT login,cap,info FROM user WHERE uid=%d",
 			uid );
   Stmt st;
+  char const *uname;
+  char const *ucap;
+  char const *uinfo;
   db_prepare( &st, sql );
   free( sql );
   db_step(&st);
-  char const * uname = db_column_text( &st, 0 );
-  char const * ucap = db_column_text( &st, 1 );
-  char const * uinfo = db_column_text( &st, 2 );
+  uname = db_column_text( &st, 0 );
+  ucap = db_column_text( &st, 1 );
+  uinfo = db_column_text( &st, 2 );
 
   @ <h2>Welcome, %s(uname)!</h2>
   @ Your user ID is: %d(uid)<br/>
   @ Your Fossil permissions are: [%s(ucap)]
   @   [TODO: explain these]<br/>
@@ -125,16 +128,17 @@
 
 /*
 ** WEBPAGE: /my
 */
 void mypage_page(void){
+  const char *name;
   login_check_credentials();
   if( !g.okRdWiki ){
     login_needed();
   }
   style_header("Your Home");
-  char const * name = P("name");
+  name = P("name");
   if( name )
   {
     if( 0 == strcmp(name,"tickets") )
     {
       @ TODO: Tickets page.

Modified src/sync.c from [f8524fbcd7] to [80fd8e1587].

@@ -37,21 +37,20 @@
 #endif /* INTERFACE */
 
 /*
 ** If the respository is configured for autosyncing, then do an
 ** autosync.  This will be a pull if the argument is true or a push
-** if the argument is false.  Return true if the autosync is done
-** and false if autosync is not requested for the current repository.
+** if the argument is false.
 */
-int autosync(int flags){
+void autosync(int flags){
   const char *zUrl;
   if( db_get_boolean("autosync", 0)==0 ){
-    return 0;
+    return;
   }
   zUrl = db_get("last-sync-url", 0);
   if( zUrl==0 ){
-    return 0;  /* No default server */
+    return;  /* No default server */
   }
   url_parse(zUrl);
   if( g.urlIsFile ){
     return 0;  /* Network sync only */
   }
@@ -60,11 +59,10 @@
   }else{
     printf("Autosync:  http://%s%s\n", g.urlName, g.urlPath);
   }
   url_enable_proxy("via proxy: ");
   client_sync((flags & AUTOSYNC_PUSH)!=0, 1, 0);
-  return 1;
 }
 
 /*
 ** This routine processes the command-line argument for push, pull,
 ** and sync.  If a command-line argument is given, that is the URL

Modified src/tagview.c from [9d79e57b4d] to [73b17a9efb].

@@ -139,19 +139,19 @@
 
 /*
 ** WEBPAGE: /tagview
 */
 void tagview_page(void){
+  char const * check = 0;
   login_check_credentials();
   if( !g.okRdWiki ){
     login_needed();
   }
   style_header("Tags");
   login_anonymous_available();
   tagview_page_search_miniform();
   @ <hr/>
-  char const * check = 0;
   if( 0 != (check = P("tagid")) ){
     tagview_page_tag_by_id( atoi(check) );
   }else if( 0 != (check = P("like")) ){
     tagview_page_list_tags( check );
   }else if( 0 != (check = P("name")) ){