[Winpt-commits] r68 - trunk/Src

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sat Nov 5 13:00:57 CET 2005


Author: twoaday
Date: 2005-11-05 13:00:55 +0100 (Sat, 05 Nov 2005)
New Revision: 68

Modified:
   trunk/Src/ChangeLog
   trunk/Src/wptClipEncryptDlg.cpp
   trunk/Src/wptClipImportDlg.cpp
   trunk/Src/wptClipSignDlg.cpp
   trunk/Src/wptClipSignEncDlg.cpp
   trunk/Src/wptErrors.cpp
   trunk/Src/wptFileManagerDlg.cpp
   trunk/Src/wptFileVerifyDlg.cpp
   trunk/Src/wptKeyEditCB.cpp
   trunk/Src/wptKeyEditDlgs.cpp
   trunk/Src/wptKeyManagerDlg.cpp
   trunk/Src/wptKeygenCBDlg.cpp
   trunk/Src/wptMainProc.cpp
   trunk/Src/wptRegistry.cpp
Log:
More minor changes to avoid GCC warnings.



Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/ChangeLog	2005-11-05 12:00:55 UTC (rev 68)
@@ -1,3 +1,10 @@
+2005-11-05  Timo Schulz  <ts at g10code.com>
+
+	More minor changes to avoid GCC warnings.
+	
+	* wptErrors.cp (winpt_strerror): Return w32
+	formatted error and do not use 'break'.
+	
 2005-11-04  Werner Koch  <wk at g10code.com>
 
 	* WinPT-en.rc: Fixed locations of icons.

Modified: trunk/Src/wptClipEncryptDlg.cpp
===================================================================
--- trunk/Src/wptClipEncryptDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptClipEncryptDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -109,7 +109,7 @@
     p = (char *)calloc (1, len+64);
     if (!p)
 	BUG (NULL);
-    sprintf (p, _("Recipients unsuable for encryption:\n"));
+    strcpy (p, _("Recipients unsuable for encryption:\n"));
     for (k = res->invalid_recipients; k; k = k->next) {
 	get_pubkey (k->fpr, &key);
 	strcat (p, key->subkeys->keyid+8);
@@ -132,8 +132,7 @@
     gpgme_key_t *rset;
     gpgme_ctx_t ctx=NULL;
     gpgme_error_t err;
-    refresh_cache_s rcs = {0};
-    int force_trust = 0, opt = 0;
+    int force_trust = 0;
     int kmode = reg_prefs.keylist_mode? KEYLIST_ENCRYPT_MIN : KEYLIST_ENCRYPT;
     int n;
     
@@ -218,7 +217,6 @@
 	case IDC_ENCRYPT_FNDCMD:
 	{
 	    char tmpbuf[64];
-	    int n;
 
 	    n = GetDlgItemText (dlg, IDC_ENCRYPT_FIND, tmpbuf, DIM (tmpbuf)-1);
 	    if (!n)

Modified: trunk/Src/wptClipImportDlg.cpp
===================================================================
--- trunk/Src/wptClipImportDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptClipImportDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -61,8 +61,6 @@
 void
 print_import_status (gpgme_import_result_t res)
 {
-    int rc = 0;
-
     dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_IMPORT_STAT, glob_hwnd,
 		      import_status_dlg_proc, (LPARAM)res,
 		      _("Key Import Statistics"), IDS_WINPT_IMPORT_STAT);
@@ -78,11 +76,12 @@
     static listview_ctrl_t lv = NULL;
     static int is_revcert;
     static int has_seckeys;
-    int rc = 0, id = 0;    
+    int rc = 0;
+    /*int id=0;*/
     gpgme_error_t err;
     gpgme_ctx_t ctx;
     gpgme_import_result_t res;
-    gpgme_key_t *selkeys = NULL;
+    /*gpgme_key_t *selkeys = NULL;*/
     
     switch( msg ) {
     case WM_INITDIALOG:

Modified: trunk/Src/wptClipSignDlg.cpp
===================================================================
--- trunk/Src/wptClipSignDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptClipSignDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -98,7 +98,6 @@
     gpgme_ctx_t ctx;
     gpgme_error_t err;
     passphrase_cb_s pwd;
-    int rc = 0;
     int n = reg_prefs.word_wrap;
     
     signer = get_gnupg_default_key ();

Modified: trunk/Src/wptClipSignEncDlg.cpp
===================================================================
--- trunk/Src/wptClipSignEncDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptClipSignEncDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -103,7 +103,7 @@
     gpgme_ctx_t ctx;
     passphrase_cb_s pwd;
     char *signer = NULL;
-    int force_trust = 0, opt = 0;
+    int force_trust = 0;
     int kmode = reg_prefs.keylist_mode? KEYLIST_ENCRYPT_MIN : KEYLIST_ENCRYPT;
     int n;
     

Modified: trunk/Src/wptErrors.cpp
===================================================================
--- trunk/Src/wptErrors.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptErrors.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -74,6 +74,7 @@
     static char buf[256];
 	
     switch( errid ) {
+    case -1: w32_fmt_msg (buf, 255); return buf;
     case WPTERR_GENERAL: return _("General error occured");
     case WPTERR_FILE_OPEN: return _("Could not open file");
     case WPTERR_FILE_CREAT: return _("Could not create file");
@@ -92,7 +93,7 @@
     case WPTERR_CLIP: return _("General Clipboard error");
     case WPTERR_REGISTRY: sprintf (buf, "%s", _("Registry error: "));
 			  w32_fmt_msg (buf + strlen (buf), 128);
-			  break;
+	                  return buf;
     case WPTERR_WINSOCK_INIT: return _("Could not startup Winsock 2 interface");
     case WPTERR_WINSOCK_RESOLVE: return _("Could not resolve hostname");
     case WPTERR_WINSOCK_SOCKET: return _("Could not create new socket");
@@ -103,7 +104,7 @@
     case WPTERR_KEYSERVER_NOTFOUND: return _("Keyserver returned: no matching keys in database");
     case WPTERR_HOTKEY: sprintf (buf, "%s", _("Could not register hotkey: "));
 			w32_fmt_msg (buf + strlen (buf), 128);
-			break;
+			return buf;
     case WPTERR_DIR_OPEN: return _("Could not open directory");
     case WPTERR_DIR_CREAT: return _("Could not create directory");
     case WPTERR_CURR_WND: return _("Could not extract data from the current window");

Modified: trunk/Src/wptFileManagerDlg.cpp
===================================================================
--- trunk/Src/wptFileManagerDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptFileManagerDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -66,7 +66,7 @@
     static keylist_t list = NULL;
     gpg_keycache_t kc;
     gpgme_ctx_t ctx;
-    int force_trust = 0, count = 0;
+    int force_trust = 0;
     
     switch (msg) {
     case WM_INITDIALOG:
@@ -538,8 +538,8 @@
         
     case WM_INITMENUPOPUP:
 	if ((UINT)LOWORD (lparam) == 0) {
-	    HMENU hm = (HMENU)wparam;
-	    set_menu_text_bypos (hm, 2, _("&Calc Digest"));
+	    HMENU h = (HMENU)wparam;
+	    set_menu_text_bypos (h, 2, _("&Calc Digest"));
 	}
 	return FALSE;
 
@@ -601,6 +601,7 @@
 	    case ID_FILEMISC_MD_SHA1: algo = GPGME_MD_SHA1; break;
 	    case ID_FILEMISC_MD_RMD160: algo = GPGME_MD_RMD160; break; 
 	    case ID_FILEMISC_MD_SHA256:algo = GPGME_MD_SHA256; break;
+	    default: algo = GPGME_MD_SHA1; break;
 	    }
 	    fm_print_md (lv, dlg, algo);
 	    SetForegroundWindow (dlg);
@@ -671,7 +672,7 @@
             continue;	    
 	listview_get_item_text (lv, i, 1, fname, sizeof (fname)-1);
 	SendDlgItemMessage (dlg, IDC_SECDEL_FILES, LB_ADDSTRING,
-			    NULL, (WPARAM)(char *)fname);
+			    0, (WPARAM)(char *)fname);
     }
 }
 

Modified: trunk/Src/wptFileVerifyDlg.cpp
===================================================================
--- trunk/Src/wptFileVerifyDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptFileVerifyDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -116,8 +116,8 @@
 static DWORD CALLBACK
 file_verify_dlg_thread (void *opaque)
 {
-    DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_VERIFY, GetActiveWindow(),
-                    file_verify_dlg_proc, NULL);
+    DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_VERIFY, 
+		    GetActiveWindow(), file_verify_dlg_proc, 0);
     if (dlg_event) {
 	CloseHandle (dlg_event);
 	dlg_event = NULL;

Modified: trunk/Src/wptKeyEditCB.cpp
===================================================================
--- trunk/Src/wptKeyEditCB.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptKeyEditCB.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -318,10 +318,9 @@
 static const char*
 cmd_setpref_handler (GpgKeyEdit *ctx, gpgme_status_code_t code, const char * key)
 {
-    static char buf[128];
-
     /* XXX: check the code. */
 #if 0
+    static char buf[128];
     if (!ctx->cmd_sent && !strcmp (key, "keyedit.prompt")) {
 	ctx->cmd_sent = 1;
 	return "";
@@ -653,6 +652,9 @@
     case GPGME_STATUS_BAD_PASSPHRASE:
 	ke->setResult (GPG_EDITRES_BAD_PASSPHRASE);
 	break;
+	
+    default:
+	break;
     }
 
     if (ke->getResult () & GPG_EDITRES_BAD_PASSPHRASE) {

Modified: trunk/Src/wptKeyEditDlgs.cpp
===================================================================
--- trunk/Src/wptKeyEditDlgs.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptKeyEditDlgs.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -697,7 +697,6 @@
 char*
 get_subkey_fingerprint (const char *keyid)
 {
-    static char fpr[40];
     gpgme_error_t err;
     gpgme_key_t key, main;
     gpgme_ctx_t ctx;
@@ -1362,7 +1361,8 @@
 {
     gpgme_error_t err;
     GpgKeyEdit *ke;
-    char buf[256], t[512], * pass;
+    char buf[256], t[512];
+    char *pass=NULL;
     int cancel = 0, id = 0, j;
 
     if (!k->key_pair) {
@@ -1393,7 +1393,7 @@
 	return FALSE;
     if( k->is_protected ) {
 	pass = request_passphrase (_("Key Edit"), 1, &cancel);
-	if( cancel )	
+	if (cancel)
 	    return FALSE;	    
     }
     listview_get_item_text (lv, j, 2, buf, sizeof (buf)-1);

Modified: trunk/Src/wptKeyManagerDlg.cpp
===================================================================
--- trunk/Src/wptKeyManagerDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptKeyManagerDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -563,7 +563,7 @@
 	ID_KEYMISC_EDITKEY,
 	0
     };
-    int * resids;
+    int *resids;
     int i;
 
     
@@ -573,6 +573,7 @@
     case 0: return;
     case 3: resids = key_resids; break;
     case 1: resids = edit_resids;break;
+    default: return;
     }
 
     for (i=0; resids[i] != 0; i++)
@@ -777,7 +778,7 @@
        set_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "KM_Pos_Y", buf);
        /* Remove runtime information. This should be the last action taken here. */
        delete kmi; kmi = NULL;
-       SetWindowLong (dlg, GWL_USERDATA, NULL);	   
+       SetWindowLong (dlg, GWL_USERDATA, 0);
        keycache_set_reload (refresh_keys);
        return FALSE;
 

Modified: trunk/Src/wptKeygenCBDlg.cpp
===================================================================
--- trunk/Src/wptKeygenCBDlg.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptKeygenCBDlg.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -61,7 +61,7 @@
 keygen_cb_thread (void *opaque)
 {
     DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYPROG, 
-		    GetActiveWindow (), keygen_cb_dlg_proc, NULL);
+		    GetActiveWindow (), keygen_cb_dlg_proc, 0);
     ExitThread (0);
     return 0;
 }

Modified: trunk/Src/wptMainProc.cpp
===================================================================
--- trunk/Src/wptMainProc.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptMainProc.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -148,7 +148,7 @@
 static gpgme_error_t
 currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set)
 {
-    gpgme_error_t err;
+    gpgme_error_t err = gpg_error (GPG_ERR_NO_ERROR);
     int type;
     
     if (ret_set)
@@ -160,19 +160,19 @@
 
     case ID_WINPT_CURRWND_ENCRYPT:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd,
-                          clip_encrypt_dlg_proc, NULL, 
+                          clip_encrypt_dlg_proc, 0, 
                           _("Encryption"), IDS_WINPT_ENCRYPT );
         break;
         
     case ID_WINPT_CURRWND_SIGNENCRYPT:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd,
-                          clip_signenc_dlg_proc, NULL, 
+                          clip_signenc_dlg_proc, 0, 
                           _("Sign & Encrypt"), IDS_WINPT_SIGNENC );
         break;
         
     case ID_WINPT_CURRWND_SIGN:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd,
-                          clip_sign_dlg_proc, NULL, 
+                          clip_sign_dlg_proc, 0, 
                           _("Signing"), IDS_WINPT_SIGN );
         break;
         
@@ -188,7 +188,7 @@
             err = clip_decrypt_dlg (hwnd);
             if (!err && reg_prefs.use_viewer) {
                 dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
-                                  GetDesktopWindow(), clip_edit_dlg_proc, NULL, 
+                                  GetDesktopWindow(), clip_edit_dlg_proc, 0, 
                                  _("Clipboard Editor"), IDS_WINPT_CLIPEDIT);
 		if (ret_set)
 		    *ret_set = 0;
@@ -198,7 +198,7 @@
 	    km_clip_import (GetDesktopWindow ());
         else {
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
-                              clip_verify_dlg_proc, NULL, 
+                              clip_verify_dlg_proc, 0, 
                               _("Verify"), IDS_WINPT_VERIFY );
             err  = gpg_error (GPG_ERR_EOF); /* make sure window is ot updated. */
         }
@@ -214,7 +214,6 @@
 {
     gpgme_error_t err;
     int type;
-    size_t size = 0;    
     
     if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT)
 	&& gnupg_access_keyring (0) ) {
@@ -229,19 +228,19 @@
         
     case ID_WINPT_ENCRYPT:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, 
-                          clip_encrypt_dlg_proc, NULL,
+                          clip_encrypt_dlg_proc, 0,
                           _("Encryption"), IDS_WINPT_ENCRYPT );
         break;
         
     case ID_WINPT_SIGN:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, 
-                          clip_sign_dlg_proc, NULL, 
+                          clip_sign_dlg_proc, 0, 
                           _("Signing"), IDS_WINPT_SIGN );
         break;
         
     case ID_WINPT_SIGNENCRYPT:
         dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, 
-                          clip_signenc_dlg_proc, NULL, 
+                          clip_signenc_dlg_proc, 0, 
                           _("Sign & Encrypt"), IDS_WINPT_SIGNENC );
         break;
         
@@ -255,7 +254,7 @@
             err = clip_decrypt_dlg (hwnd);
             if (!err && reg_prefs.use_viewer) {
                 dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, 
-				  GetDesktopWindow(), clip_edit_dlg_proc, NULL, 
+				  GetDesktopWindow(), clip_edit_dlg_proc, 0, 
                                  _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
             }
         }
@@ -285,7 +284,7 @@
         }
         else if (type & PGP_CLEARSIG) {
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd,
-                              clip_verify_dlg_proc, NULL, 
+                              clip_verify_dlg_proc, 0, 
                               _("Verify"), IDS_WINPT_VERIFY );
         }
         else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY))
@@ -338,7 +337,6 @@
     reminder_ctx_s ctx;
     LPARAM param;
     curr_wnd_ctx currwnd = {0};	
-    size_t size = 0;
     int rc, set_wc = 0, has_data = 0;
     INITCOMMONCONTROLSEX cce;
     gpgme_error_t err;
@@ -386,7 +384,7 @@
 	    if (chk == -1)
 		DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP,
 				GetDesktopWindow (), confirm_delclipboard_dlg, 
-				NULL);
+				0);
 	    if (wipe_contents || chk)
 		set_clip_text (NULL, " ", 1);
 	    wipe_contents = 0;
@@ -552,7 +550,7 @@
             /** File handling **/
         case ID_WINPT_FILE:
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE, 
-		              GetDesktopWindow(), file_manager_dlg_proc, NULL,
+		              GetDesktopWindow(), file_manager_dlg_proc, 0,
                               _("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE );
             break;
             
@@ -573,41 +571,41 @@
             
         case ID_WINPT_EDIT:
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT,
-			      GetDesktopWindow(), clip_edit_dlg_proc, NULL,
+			      GetDesktopWindow(), clip_edit_dlg_proc, 0,
                              _("Clipboard Editor"), IDS_WINPT_CLIPEDIT );
             break;
             
         case ID_WINPT_ABOUT:
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ABOUT, GetDesktopWindow(), 
-                              about_winpt_dlg_proc, NULL, 
+                              about_winpt_dlg_proc, 0, 
                              _("About WinPT"), IDS_WINPT_ABOUT );
             break;
             
         case ID_WINPT_PREFS:
             dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_PREFS, GetDesktopWindow(),
-                              prefs_dlg_proc, NULL,
+                              prefs_dlg_proc, 0,
                              _("WinPT Preferences"), IDS_WINPT_PREFS );
             break;
             
         case ID_WINPT_GPGPREFS:
             dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(),
-                              gpgprefs_dlg_proc, NULL,
+                              gpgprefs_dlg_proc, 0,
                               _("GnuPG Preferences"), IDS_WINPT_GPGPREFS);
             break;
 
 	case ID_WINPT_CDISKNEW:
 	    DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW,
-			GetDesktopWindow (), cryptdisk_new_dlg_proc, NULL);
+			GetDesktopWindow (), cryptdisk_new_dlg_proc, 0);
 	    break;
 
 	case ID_WINPT_CDISKMOUNT:
 	    DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT, 
-			GetDesktopWindow (), cryptdisk_mount_dlg_proc, NULL);
+			GetDesktopWindow (), cryptdisk_mount_dlg_proc, 0);
 	    break;
 
 	case ID_WINPT_CDISKUNMOUNT:
 	    DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT,
-			GetDesktopWindow (), cryptdisk_umount_dlg_proc, NULL);
+			GetDesktopWindow (), cryptdisk_umount_dlg_proc, 0);
 	    break;
 
 	case ID_WINPT_CDISKUMOUNTALL:

Modified: trunk/Src/wptRegistry.cpp
===================================================================
--- trunk/Src/wptRegistry.cpp	2005-11-04 18:19:07 UTC (rev 67)
+++ trunk/Src/wptRegistry.cpp	2005-11-05 12:00:55 UTC (rev 68)
@@ -52,7 +52,7 @@
     {"CwsDecrypt",  NULL, 0},
     {"CwsSign",     NULL, 0},
     {"CwsSignEnc",  NULL, 0},
-    {0}
+    {NULL, NULL, 0}
 };
 
 winpt_reg_prefs_s reg_prefs;



More information about the Winpt-commits mailing list