LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File subversion-1.7.5-libsvn_auth_kwallet-r1345740.patch of Package subversion (Project devel:tools:scm:svn)

svn diff -c1345740 https://svn.apache.org/repos/asf/subversion/trunk

r1345740 | peters | 2012-06-03 19:54:26 +0100 (Sun, 03 Jun 2012) | 7 lines
Changed paths:
   M /subversion/trunk/subversion/libsvn_auth_kwallet/kwallet.cpp

Remove a cast that is both ugly, and apparently illegal in g++ 4.7.

* subversion/libsvn_auth_kwallet/kwallet.cpp
  (q_argc, q_argv): New.
  (kwallet_password_get, kwallet_password_set):
   Use q_argc and q_argv instead of trying to open-code them.

Index: subversion/libsvn_auth_kwallet/kwallet.cpp
===================================================================
--- subversion/libsvn_auth_kwallet/kwallet.cpp.orig	2012-10-02 18:18:00.000000000 +0100
+++ subversion/libsvn_auth_kwallet/kwallet.cpp	2012-10-04 18:38:58.000000000 +0100
@@ -60,6 +60,9 @@
 /* KWallet simple provider, puts passwords in KWallet                    */
 /*-----------------------------------------------------------------------*/
 
+static int q_argc = 1;
+static char q_argv0[] = "svn"; // Build non-const char * from string constant
+static char *q_argv[] = { q_argv0 };
 
 static const char *
 get_application_name(apr_hash_t *parameters,
@@ -212,12 +215,11 @@ kwallet_password_get(svn_boolean_t *done
   QCoreApplication *app;
   if (! qApp)
     {
-      int argc = 1;
-      app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+      int argc = q_argc;
+      app = new QCoreApplication(argc, q_argv);
     }
 
-  KCmdLineArgs::init(1,
-                     (char *[1]) {(char *) "svn"},
+  KCmdLineArgs::init(q_argc, q_argv,
                      get_application_name(parameters, pool),
                      "subversion",
                      ki18n(get_application_name(parameters, pool)),
@@ -289,12 +291,11 @@ kwallet_password_set(svn_boolean_t *done
   QCoreApplication *app;
   if (! qApp)
     {
-      int argc = 1;
-      app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+      int argc = q_argc;
+      app = new QCoreApplication(argc, q_argv);
     }
 
-  KCmdLineArgs::init(1,
-                     (char *[1]) {(char *) "svn"},
+  KCmdLineArgs::init(q_argc, q_argv,
                      get_application_name(parameters, pool),
                      "subversion",
                      ki18n(get_application_name(parameters, pool)),