Author: stefan2
Date: Sun Nov 4 10:43:10 2012
New Revision: 1405522
URL: http://svn.apache.org/viewvc?rev=1405522&view=rev
Log:
Fix 8 -> 4 byte size conversion warning under Win64.
* tools/server-side/fsfs-reorg.c
(compare_noderev_offsets,
compare_representation_offsets): manually convert the difference to a
comparison result
Modified:
subversion/trunk/tools/server-side/fsfs-reorg.c
Modified: subversion/trunk/tools/server-side/fsfs-reorg.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/fsfs-reorg.c?rev=1405522&r1=1405521&r2=1405522&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/fsfs-reorg.c (original)
+++ subversion/trunk/tools/server-side/fsfs-reorg.c Sun Nov 4 10:43:10 2012
@@ -724,8 +724,13 @@ key_matches(svn_string_t *string, const
static int
compare_noderev_offsets(const void *data, const void *key)
{
- return (*(const noderev_t **)data)->original.offset
- - *(const apr_size_t *)key;
+ apr_ssize_t diff = (*(const noderev_t **)data)->original.offset
+ - *(const apr_size_t *)key;
+
+ /* sizeof(int) may be < sizeof(ssize_t) */
+ if (diff < 0)
+ return -1;
+ return diff > 0 ? 1 : 0;
}
static svn_error_t *
@@ -800,8 +805,13 @@ parse_pred(noderev_t **result,
static int
compare_representation_offsets(const void *data, const void *key)
{
- return (*(const representation_t **)data)->original.offset
- - *(const apr_size_t *)key;
+ apr_ssize_t diff = (*(const representation_t **)data)->original.offset
+ - *(const apr_size_t *)key;
+
+ /* sizeof(int) may be < sizeof(ssize_t) */
+ if (diff < 0)
+ return -1;
+ return diff > 0 ? 1 : 0;
}
static representation_t *