subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1627966 - in /subversion/trunk/subversion/libsvn_fs_fs: cached_data.c index.c index.h transaction.c
Date Sat, 27 Sep 2014 13:30:22 GMT
Author: stefan2
Date: Sat Sep 27 13:30:21 2014
New Revision: 1627966

URL: http://svn.apache.org/r1627966
Log:
Pin the FSFS f7 item type to a fixed-length data type.
Make sure we use that type consistently.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__p2l_entry_t): Fix the item type to 32 bits which is way
                            more than we'll ever need and which aligns
                            nicely with the rest of the struct.

* subversion/libsvn_fs_fs/index.c
  (read_entry): Remove unnecessary type conversion.

* subversion/libsvn_fs_fs/cached_data.c
  (dbg_log_access): Always use uint32 to hold item types.

* subversion/libsvn_fs_fs/transaction.c
  (write_container_rep,
   write_container_delta_rep,
   write_final_rev): Same.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_fs/index.c
    subversion/trunk/subversion/libsvn_fs_fs/index.h
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1627966&r1=1627965&r2=1627966&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Sat Sep 27 13:30:21 2014
@@ -74,7 +74,7 @@ dbg_log_access(svn_fs_t *fs,
                svn_revnum_t revision,
                apr_uint64_t item_index,
                void *item,
-               int item_type,
+               apr_uint32_t item_type,
                apr_pool_t *scratch_pool)
 {
   /* no-op if this macro is not defined */

Modified: subversion/trunk/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/index.c?rev=1627966&r1=1627965&r2=1627966&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/index.c Sat Sep 27 13:30:21 2014
@@ -2068,7 +2068,7 @@ read_entry(svn_fs_fs__packed_number_stre
   SVN_ERR(packed_stream_get(&value, stream));
   *last_compound += decode_int(value);
 
-  entry.type = (int)(*last_compound & 7);
+  entry.type = *last_compound & 7;
   entry.item.number = *last_compound / 8;
 
   /* Verify item type. */

Modified: subversion/trunk/subversion/libsvn_fs_fs/index.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/index.h?rev=1627966&r1=1627965&r2=1627966&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/index.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/index.h Sat Sep 27 13:30:21 2014
@@ -61,7 +61,7 @@ typedef struct svn_fs_fs__p2l_entry_t
   apr_off_t size;
 
   /* type of the item (see SVN_FS_FS__ITEM_TYPE_*) defines */
-  unsigned type;
+  apr_uint32_t type;
 
   /* modified FNV-1a checksum.  0 if unknown checksum */
   apr_uint32_t fnv1_checksum;

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1627966&r1=1627965&r2=1627966&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Sep 27 13:30:21 2014
@@ -2519,7 +2519,7 @@ write_container_rep(representation_t *re
                     collection_writer_t writer,
                     svn_fs_t *fs,
                     apr_hash_t *reps_hash,
-                    int item_type,
+                    apr_uint32_t item_type,
                     svn_revnum_t final_revision,
                     apr_pool_t *scratch_pool)
 {
@@ -2618,7 +2618,7 @@ write_container_delta_rep(representation
                           svn_fs_t *fs,
                           node_revision_t *noderev,
                           apr_hash_t *reps_hash,
-                          int item_type,
+                          apr_uint32_t item_type,
                           svn_revnum_t final_revision,
                           apr_pool_t *scratch_pool)
 {
@@ -2956,9 +2956,9 @@ write_final_rev(const svn_fs_id_t **new_
   if (noderev->prop_rep && is_txn_rep(noderev->prop_rep))
     {
       apr_hash_t *proplist;
-      int item_type = noderev->kind == svn_node_dir
-                    ? SVN_FS_FS__ITEM_TYPE_DIR_PROPS
-                    : SVN_FS_FS__ITEM_TYPE_FILE_PROPS;
+      apr_uint32_t item_type = noderev->kind == svn_node_dir
+                             ? SVN_FS_FS__ITEM_TYPE_DIR_PROPS
+                             : SVN_FS_FS__ITEM_TYPE_FILE_PROPS;
       SVN_ERR(svn_fs_fs__get_proplist(&proplist, fs, noderev, pool));
 
       noderev->prop_rep->revision = rev;



Mime
View raw message