subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1718346 - in /subversion/branches/ra-git/subversion/libsvn_fs_git: fs_git.h git-revroot.c gitdb.c
Date Mon, 07 Dec 2015 13:13:27 GMT
Author: rhuijben
Date: Mon Dec  7 13:13:27 2015
New Revision: 1718346

URL: http://svn.apache.org/viewvc?rev=1718346&view=rev
Log:
On the ra-git branch: Resolve a constness issues in a library private api.

Found by: clang

* subversion/libsvn_fs_git/fs_git.h
  (svn_fs_git__db_fetch_checksum): Make checksum const.

* subversion/libsvn_fs_git/git-revroot.c
  (fs_git_file_checksum): Update caller.

* subversion/libsvn_fs_git/gitdb.c
  (db_fetch_checksum,
   svn_fs_git__db_fetch_checksum): Make output argument const, like
     our sqlite api.

Modified:
    subversion/branches/ra-git/subversion/libsvn_fs_git/fs_git.h
    subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c
    subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/fs_git.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/fs_git.h?rev=1718346&r1=1718345&r2=1718346&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/fs_git.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/fs_git.h Mon Dec  7 13:13:27 2015
@@ -109,7 +109,7 @@ svn_fs_git__db_fetch_rev(svn_revnum_t *r
 
 
 svn_error_t *
-svn_fs_git__db_fetch_checksum(svn_checksum_t **checksum,
+svn_fs_git__db_fetch_checksum(const svn_checksum_t **checksum,
                               svn_fs_t *fs,
                               const git_oid *oid,
                               svn_checksum_kind_t kind,

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c?rev=1718346&r1=1718345&r2=1718346&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c Mon Dec  7 13:13:27
2015
@@ -1024,6 +1024,7 @@ fs_git_file_checksum(svn_checksum_t **ch
   const git_commit *commit;
   git_tree_entry *entry;
   const char *relpath;
+  const svn_checksum_t *csum;
 
   SVN_ERR(find_branch(&commit, &relpath, root, path, pool));
 
@@ -1042,9 +1043,12 @@ fs_git_file_checksum(svn_checksum_t **ch
       /* ### TODO */
     }
 
-  SVN_ERR(svn_fs_git__db_fetch_checksum(checksum, root->fs,
+  SVN_ERR(svn_fs_git__db_fetch_checksum(&csum, root->fs,
                                         git_tree_entry_id(entry),
                                         kind, pool, pool));
+
+  /* Nice.. sqlite returns const... fs returns non-const */
+  *checksum = csum ? svn_checksum_dup(csum, pool) : NULL;
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c?rev=1718346&r1=1718345&r2=1718346&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c Mon Dec  7 13:13:27 2015
@@ -181,7 +181,7 @@ svn_fs_git__db_fetch_rev(svn_revnum_t *r
 
 
 static svn_error_t *
-db_fetch_checksum(svn_checksum_t **checksum,
+db_fetch_checksum(const svn_checksum_t **checksum,
                   svn_fs_t *fs,
                   const git_oid *oid,
                   int idx,
@@ -235,7 +235,7 @@ db_fetch_checksum(svn_checksum_t **check
 }
 
 svn_error_t *
-svn_fs_git__db_fetch_checksum(svn_checksum_t **checksum,
+svn_fs_git__db_fetch_checksum(const svn_checksum_t **checksum,
                               svn_fs_t *fs,
                               const git_oid *oid,
                               svn_checksum_kind_t kind,



Mime
View raw message