subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1399494 - /subversion/trunk/subversion/bindings/javahl/native/
Date Thu, 18 Oct 2012 00:36:05 GMT
Author: hwright
Date: Thu Oct 18 00:36:04 2012
New Revision: 1399494

URL: http://svn.apache.org/viewvc?rev=1399494&view=rev
Log:
JavaHL: Update many C-style casts to use the C++ static cast.

* subversion/bindings/javahl/native:
  <everywhere>: Update casts to use static_cast<>(Foo *) where appropriate.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/BlameCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/ChangelistCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
    subversion/trunk/subversion/bindings/javahl/native/CommitCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp
    subversion/trunk/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp
    subversion/trunk/subversion/bindings/javahl/native/ImportFilterCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/InfoCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp
    subversion/trunk/subversion/bindings/javahl/native/ListCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/OutputStream.cpp
    subversion/trunk/subversion/bindings/javahl/native/PatchCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp
    subversion/trunk/subversion/bindings/javahl/native/ProplistCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
    subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
    subversion/trunk/subversion/bindings/javahl/native/StatusCallback.cpp

Modified: subversion/trunk/subversion/bindings/javahl/native/BlameCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/BlameCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/BlameCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/BlameCallback.cpp Thu Oct 18 00:36:04
2012
@@ -61,11 +61,9 @@ BlameCallback::callback(void *baton,
                         apr_pool_t *pool)
 {
   if (baton)
-    return ((BlameCallback *)baton)->singleLine(start_revnum, end_revnum,
-                                                line_no, revision, rev_props,
-                                                merged_revision,
-                                                merged_rev_props, merged_path,
-                                                line, local_change, pool);
+    return static_cast<BlameCallback *>(baton)->singleLine(start_revnum,
+        end_revnum, line_no, revision, rev_props, merged_revision,
+        merged_rev_props, merged_path, line, local_change, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/ChangelistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ChangelistCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ChangelistCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ChangelistCallback.cpp Thu Oct 18 00:36:04
2012
@@ -53,7 +53,8 @@ ChangelistCallback::callback(void *baton
                              apr_pool_t *pool)
 {
   if (baton)
-    ((ChangelistCallback *)baton)->doChangelist(path, changelist, pool);
+    static_cast<ChangelistCallback *>(baton)->doChangelist(path, changelist,
+            pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp Thu Oct 18 00:36:04
2012
@@ -324,7 +324,7 @@ ClientContext::cancelOperation()
 svn_error_t *
 ClientContext::checkCancel(void *cancelBaton)
 {
-    ClientContext *that = (ClientContext *)cancelBaton;
+    ClientContext *that = static_cast<ClientContext *>(cancelBaton);
     if (that->m_cancelOperation)
         return svn_error_create(SVN_ERR_CANCELLED, NULL,
                                 _("Operation cancelled"));

Modified: subversion/trunk/subversion/bindings/javahl/native/CommitCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CommitCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CommitCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CommitCallback.cpp Thu Oct 18 00:36:04
2012
@@ -57,7 +57,7 @@ CommitCallback::callback(const svn_commi
                          apr_pool_t *pool)
 {
   if (baton)
-    return ((CommitCallback *)baton)->commitInfo(commit_info, pool);
+    return static_cast<CommitCallback *>(baton)->commitInfo(commit_info, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CommitMessage.cpp Thu Oct 18 00:36:04
2012
@@ -50,9 +50,9 @@ CommitMessage::callback(const char **log
                         void *baton,
                         apr_pool_t *pool)
 {
-  if (baton && ((CommitMessage *)baton)->m_jcommitMessage)
-    return ((CommitMessage *)baton)->getCommitMessage(log_msg, tmp_file,
-                                                      commit_items, pool);
+  if (baton && static_cast<CommitMessage *>(baton)->m_jcommitMessage)
+    return static_cast<CommitMessage *>(baton)->getCommitMessage(
+            log_msg, tmp_file, commit_items, pool);
 
   *log_msg = NULL;
   *tmp_file = NULL;

Modified: subversion/trunk/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp Thu Oct 18
00:36:04 2012
@@ -46,7 +46,7 @@ DiffSummaryReceiver::summarize(const svn
                                apr_pool_t *pool)
 {
   if (baton)
-    return ((DiffSummaryReceiver *) baton)->onSummary(diff, pool);
+    return static_cast<DiffSummaryReceiver *>(baton)->onSummary(diff, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/ImportFilterCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ImportFilterCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ImportFilterCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ImportFilterCallback.cpp Thu Oct 18
00:36:04 2012
@@ -56,8 +56,8 @@ ImportFilterCallback::callback(void *bat
                                apr_pool_t *pool)
 {
   if (baton)
-    return ((ImportFilterCallback *)baton)->doImportFilter(filtered,
-                        local_abspath, dirent, pool);
+    return static_cast<ImportFilterCallback *>(baton)->doImportFilter(
+            filtered, local_abspath, dirent, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/InfoCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/InfoCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/InfoCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/InfoCallback.cpp Thu Oct 18 00:36:04
2012
@@ -52,7 +52,7 @@ InfoCallback::callback(void *baton,
                        apr_pool_t *pool)
 {
   if (baton)
-    return ((InfoCallback *)baton)->singleInfo(path, info, pool);
+    return static_cast<InfoCallback *>(baton)->singleInfo(path, info, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp Thu Oct 18 00:36:04
2012
@@ -70,7 +70,7 @@ svn_error_t *InputStream::read(void *bat
 {
   JNIEnv *env = JNIUtil::getEnv();
   // An object of our class is passed in as the baton.
-  InputStream *that = (InputStream*)baton;
+  InputStream *that = static_cast<InputStream *>(baton);
 
   // The method id will not change during the time this library is
   // loaded, so it can be cached.

Modified: subversion/trunk/subversion/bindings/javahl/native/ListCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ListCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ListCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ListCallback.cpp Thu Oct 18 00:36:04
2012
@@ -57,8 +57,8 @@ ListCallback::callback(void *baton,
                        apr_pool_t *pool)
 {
   if (baton)
-    return ((ListCallback *)baton)->doList(path, dirent, lock, abs_path,
-                                           pool);
+    return static_cast<ListCallback *>(baton)->doList(
+            path, dirent, lock, abs_path, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp Thu Oct 18 00:36:04
2012
@@ -57,7 +57,8 @@ LogMessageCallback::callback(void *baton
                              apr_pool_t *pool)
 {
   if (baton)
-    return ((LogMessageCallback *)baton)->singleMessage(log_entry, pool);
+    return static_cast<LogMessageCallback *>(baton)->singleMessage(
+            log_entry, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/OutputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OutputStream.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OutputStream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OutputStream.cpp Thu Oct 18 00:36:04
2012
@@ -76,7 +76,7 @@ svn_error_t *OutputStream::write(void *b
   JNIEnv *env = JNIUtil::getEnv();
 
   // An object of our class is passed in as the baton.
-  OutputStream *that = (OutputStream*)baton;
+  OutputStream *that = static_cast<OutputStream *>(baton);
 
   // The method id will not change during the time this library is
   // loaded, so it can be cached.

Modified: subversion/trunk/subversion/bindings/javahl/native/PatchCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/PatchCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/PatchCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/PatchCallback.cpp Thu Oct 18 00:36:04
2012
@@ -54,10 +54,9 @@ PatchCallback::callback(void *baton,
                         apr_pool_t *pool)
 {
   if (baton)
-    return ((PatchCallback *)baton)->singlePatch(filtered,
-                                                 canon_path_from_patchfile,
-                                                 patch_abspath, reject_abspath,
-                                                 pool);
+    return static_cast<PatchCallback *>(baton)->singlePatch(
+            filtered, canon_path_from_patchfile, patch_abspath, reject_abspath,
+            pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp Thu Oct 18 00:36:04 2012
@@ -427,7 +427,7 @@ svn_error_t *Prompter::simple_prompt(svn
                                      svn_boolean_t may_save,
                                      apr_pool_t *pool)
 {
-  Prompter *that = (Prompter*)baton;
+  Prompter *that = static_cast<Prompter *>(baton);
   svn_auth_cred_simple_t *ret =
     (svn_auth_cred_simple_t*)apr_pcalloc(pool, sizeof(*ret));
   if (!that->prompt(realm, username, may_save ? true : false))
@@ -460,7 +460,7 @@ svn_error_t *Prompter::username_prompt(s
                                        svn_boolean_t may_save,
                                        apr_pool_t *pool)
 {
-  Prompter *that = (Prompter*)baton;
+  Prompter *that = static_cast<Prompter *>(baton);
   svn_auth_cred_username_t *ret =
     (svn_auth_cred_username_t*)apr_pcalloc(pool, sizeof(*ret));
   const char *user = that->askQuestion(realm, _("Username: "), true,
@@ -484,7 +484,7 @@ Prompter::ssl_server_trust_prompt(svn_au
                                   svn_boolean_t may_save,
                                   apr_pool_t *pool)
 {
-  Prompter *that = (Prompter*)baton;
+  Prompter *that = static_cast<Prompter *>(baton);
   svn_auth_cred_ssl_server_trust_t *ret =
     (svn_auth_cred_ssl_server_trust_t*)apr_pcalloc(pool, sizeof(*ret));
 
@@ -550,7 +550,7 @@ Prompter::ssl_client_cert_prompt(svn_aut
                                  svn_boolean_t may_save,
                                  apr_pool_t *pool)
 {
-  Prompter *that = (Prompter*)baton;
+  Prompter *that = static_cast<Prompter *>(baton);
   svn_auth_cred_ssl_client_cert_t *ret =
     (svn_auth_cred_ssl_client_cert_t*)apr_pcalloc(pool, sizeof(*ret));
   const char *cert_file =
@@ -572,7 +572,7 @@ Prompter::ssl_client_cert_pw_prompt(svn_
                                     svn_boolean_t may_save,
                                     apr_pool_t *pool)
 {
-  Prompter *that = (Prompter*)baton;
+  Prompter *that = static_cast<Prompter *>(baton);
   svn_auth_cred_ssl_client_cert_pw_t *ret =
     (svn_auth_cred_ssl_client_cert_pw_t*)apr_pcalloc(pool, sizeof(*ret));
   const char *info = that->askQuestion(realm,
@@ -593,7 +593,7 @@ Prompter::plaintext_prompt(svn_boolean_t
                            void *baton,
                            apr_pool_t *pool)
 {
-  Prompter *that = (Prompter *) baton;
+  Prompter *that = static_cast<Prompter *>(baton);
 
   bool result = that->askYesNo(realmstring,
                                _("Store password unencrypted?"),
@@ -610,7 +610,7 @@ Prompter::plaintext_passphrase_prompt(sv
                                       void *baton,
                                       apr_pool_t *pool)
 {
-  Prompter *that = (Prompter *) baton;
+  Prompter *that = static_cast<Prompter *>(baton);
 
   bool result = that->askYesNo(realmstring,
                                _("Store passphrase unencrypted?"),

Modified: subversion/trunk/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ProplistCallback.cpp Thu Oct 18 00:36:04
2012
@@ -54,7 +54,8 @@ ProplistCallback::callback(void *baton,
                            apr_pool_t *pool)
 {
   if (baton)
-    return ((ProplistCallback *)baton)->singlePath(path, prop_hash, pool);
+    return static_cast<ProplistCallback *>(baton)->singlePath(
+            path, prop_hash, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Thu Oct 18
00:36:04 2012
@@ -49,7 +49,7 @@ ReposNotifyCallback::notify(void *baton,
                             apr_pool_t *pool)
 {
   if (baton)
-    ((ReposNotifyCallback *)baton)->onNotify(notify, pool);
+    static_cast<ReposNotifyCallback *>(baton)->onNotify(notify, pool);
 }
 
 /**

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp Thu Oct 18 00:36:04 2012
@@ -68,7 +68,7 @@ void SVNRepos::cancelOperation()
 svn_error_t *
 SVNRepos::checkCancel(void *cancelBaton)
 {
-  SVNRepos *that = (SVNRepos *)cancelBaton;
+  SVNRepos *that = static_cast<SVNRepos *>(cancelBaton);
   if (that->m_cancelOperation)
     return svn_error_create(SVN_ERR_CANCELLED, NULL,
                             _("Operation cancelled"));

Modified: subversion/trunk/subversion/bindings/javahl/native/StatusCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/StatusCallback.cpp?rev=1399494&r1=1399493&r2=1399494&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/StatusCallback.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/StatusCallback.cpp Thu Oct 18 00:36:04
2012
@@ -55,7 +55,8 @@ StatusCallback::callback(void *baton,
                          apr_pool_t *pool)
 {
   if (baton)
-    return ((StatusCallback *)baton)->doStatus(local_abspath, status, pool);
+    return static_cast<StatusCallback *>(baton)->doStatus(
+            local_abspath, status, pool);
 
   return SVN_NO_ERROR;
 }



Mime
View raw message