You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2014/09/11 13:40:36 UTC
svn commit: r1624265 - in /subversion/trunk/subversion: libsvn_fs_fs/
libsvn_fs_x/ libsvn_subr/ tests/libsvn_subr/
Author: ivan
Date: Thu Sep 11 11:40:35 2014
New Revision: 1624265
URL: http://svn.apache.org/r1624265
Log:
* subversion/libsvn_fs_fs/cached_data.c
* subversion/libsvn_fs_fs/index.c
* subversion/libsvn_fs_fs/pack.c
* subversion/libsvn_fs_fs/transaction.c
* subversion/libsvn_fs_x/cached_data.c
* subversion/libsvn_fs_x/index.c
* subversion/libsvn_fs_x/pack.c
* subversion/libsvn_fs_x/transaction.c
* subversion/libsvn_subr/io.c
* subversion/tests/libsvn_subr/io-test.c
(block_read, stream_error_create, copy_item_to_temp, copy_rep_to_temp,
copy_node_to_temp, store_item, pack_range): Use portable APR_SET,
APR_CUR and APR_END constants instead of SEEK_SET, SEEK_CUR and SEEK_END.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
subversion/trunk/subversion/libsvn_fs_fs/index.c
subversion/trunk/subversion/libsvn_fs_fs/pack.c
subversion/trunk/subversion/libsvn_fs_fs/transaction.c
subversion/trunk/subversion/libsvn_fs_x/cached_data.c
subversion/trunk/subversion/libsvn_fs_x/index.c
subversion/trunk/subversion/libsvn_fs_x/pack.c
subversion/trunk/subversion/libsvn_fs_x/transaction.c
subversion/trunk/subversion/libsvn_subr/io.c
subversion/trunk/subversion/tests/libsvn_subr/io-test.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=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Thu Sep 11 11:40:35 2014
@@ -3286,7 +3286,7 @@ block_read(void **result,
&& entry->size < ffd->block_size))
{
void *item = NULL;
- SVN_ERR(svn_io_file_seek(revision_file->file, SEEK_SET,
+ SVN_ERR(svn_io_file_seek(revision_file->file, APR_SET,
&entry->offset, iterpool));
switch (entry->type)
{
Modified: subversion/trunk/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/index.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/index.c Thu Sep 11 11:40:35 2014
@@ -204,7 +204,7 @@ stream_error_create(svn_fs_fs__packed_nu
apr_off_t offset = 0;
SVN_ERR(svn_io_file_name_get(&file_name, stream->file,
stream->pool));
- SVN_ERR(svn_io_file_seek(stream->file, SEEK_CUR, &offset, stream->pool));
+ SVN_ERR(svn_io_file_seek(stream->file, APR_CUR, &offset, stream->pool));
return svn_error_createf(err, NULL, message, file_name,
(apr_uint64_t)offset);
Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Thu Sep 11 11:40:35 2014
@@ -479,7 +479,7 @@ copy_item_to_temp(pack_context_t *contex
svn_fs_fs__p2l_entry_t *new_entry
= apr_pmemdup(context->info_pool, entry, sizeof(*entry));
new_entry->offset = 0;
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_CUR, &new_entry->offset, pool));
+ SVN_ERR(svn_io_file_seek(temp_file, APR_CUR, &new_entry->offset, pool));
APR_ARRAY_PUSH(entries, svn_fs_fs__p2l_entry_t *) = new_entry;
SVN_ERR(copy_file_data(context, temp_file, rev_file, entry->size, pool));
@@ -567,7 +567,7 @@ copy_rep_to_temp(pack_context_t *context
* store it in CONTEXT */
entry = apr_pmemdup(context->info_pool, entry, sizeof(*entry));
entry->offset = 0;
- SVN_ERR(svn_io_file_seek(context->reps_file, SEEK_CUR, &entry->offset,
+ SVN_ERR(svn_io_file_seek(context->reps_file, APR_CUR, &entry->offset,
pool));
add_item_rep_mapping(context, entry);
@@ -589,7 +589,7 @@ copy_rep_to_temp(pack_context_t *context
}
/* copy the whole rep (including header!) to our temp file */
- SVN_ERR(svn_io_file_seek(rev_file, SEEK_SET, &source_offset, pool));
+ SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &source_offset, pool));
SVN_ERR(copy_file_data(context, context->reps_file, rev_file, entry->size,
pool));
@@ -723,12 +723,12 @@ copy_node_to_temp(pack_context_t *contex
* store it in CONTEXT */
entry = apr_pmemdup(context->info_pool, entry, sizeof(*entry));
entry->offset = 0;
- SVN_ERR(svn_io_file_seek(context->reps_file, SEEK_CUR,
+ SVN_ERR(svn_io_file_seek(context->reps_file, APR_CUR,
&entry->offset, pool));
add_item_rep_mapping(context, entry);
/* copy the noderev to our temp file */
- SVN_ERR(svn_io_file_seek(rev_file, SEEK_SET, &source_offset, pool));
+ SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &source_offset, pool));
SVN_ERR(copy_file_data(context, context->reps_file, rev_file, entry->size,
pool));
@@ -1112,7 +1112,7 @@ store_item(pack_context_t *context,
/* select the item in the source file and copy it into the target
* pack file */
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_SET, &item->offset, pool));
+ SVN_ERR(svn_io_file_seek(temp_file, APR_SET, &item->offset, pool));
SVN_ERR(copy_file_data(context, context->pack_file, temp_file,
item->size, pool));
@@ -1325,7 +1325,7 @@ pack_range(pack_context_t *context,
offset = entry->offset;
if (offset < rev_file->l2p_offset)
{
- SVN_ERR(svn_io_file_seek(rev_file->file, SEEK_SET, &offset,
+ SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &offset,
iterpool2));
if (entry->type == SVN_FS_FS__ITEM_TYPE_CHANGES)
Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Thu Sep 11 11:40:35 2014
@@ -1697,7 +1697,7 @@ allocate_item_index(apr_uint64_t *item_i
*item_index = SVN_FS_FS__ITEM_INDEX_FIRST_USER;
to_write = svn__ui64toa(buffer, *item_index + 1);
- SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool));
SVN_ERR(svn_io_file_write_full(file, buffer, to_write, NULL, pool));
SVN_ERR(svn_io_file_close(file, pool));
Modified: subversion/trunk/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cached_data.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/cached_data.c Thu Sep 11 11:40:35 2014
@@ -3116,7 +3116,7 @@ block_read(void **result,
key.revision = svn_fs_x__get_revnum(entry->items[0].change_set);
key.second = entry->items[0].number;
- SVN_ERR(svn_io_file_seek(revision_file, SEEK_SET,
+ SVN_ERR(svn_io_file_seek(revision_file, APR_SET,
&entry->offset, iterpool));
switch (entry->type)
{
Modified: subversion/trunk/subversion/libsvn_fs_x/index.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/index.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/index.c Thu Sep 11 11:40:35 2014
@@ -200,7 +200,7 @@ stream_error_create(packed_number_stream
apr_off_t offset = 0;
SVN_ERR(svn_io_file_name_get(&file_name, stream->file,
stream->pool));
- SVN_ERR(svn_io_file_seek(stream->file, SEEK_CUR, &offset, stream->pool));
+ SVN_ERR(svn_io_file_seek(stream->file, APR_CUR, &offset, stream->pool));
return svn_error_createf(err, NULL, message, file_name,
(apr_uint64_t)offset);
Modified: subversion/trunk/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/pack.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/pack.c Thu Sep 11 11:40:35 2014
@@ -483,7 +483,7 @@ copy_item_to_temp(pack_context_t *contex
svn_fs_x__p2l_entry_t *new_entry
= svn_fs_x__p2l_entry_dup(entry, context->info_pool);
new_entry->offset = 0;
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_CUR, &new_entry->offset, pool));
+ SVN_ERR(svn_io_file_seek(temp_file, APR_CUR, &new_entry->offset, pool));
APR_ARRAY_PUSH(entries, svn_fs_x__p2l_entry_t *) = new_entry;
SVN_ERR(copy_file_data(context, temp_file, rev_file, entry->size, pool));
@@ -573,7 +573,7 @@ copy_rep_to_temp(pack_context_t *context
* store it in CONTEXT */
entry = svn_fs_x__p2l_entry_dup(entry, context->info_pool);
entry->offset = 0;
- SVN_ERR(svn_io_file_seek(context->reps_file, SEEK_CUR, &entry->offset,
+ SVN_ERR(svn_io_file_seek(context->reps_file, APR_CUR, &entry->offset,
pool));
add_item_rep_mapping(context, entry);
@@ -596,7 +596,7 @@ copy_rep_to_temp(pack_context_t *context
}
/* copy the whole rep (including header!) to our temp file */
- SVN_ERR(svn_io_file_seek(rev_file, SEEK_SET, &source_offset, pool));
+ SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &source_offset, pool));
SVN_ERR(copy_file_data(context, context->reps_file, rev_file, entry->size,
pool));
@@ -699,12 +699,12 @@ copy_node_to_temp(pack_context_t *contex
* store it in CONTEXT */
entry = svn_fs_x__p2l_entry_dup(entry, context->info_pool);
entry->offset = 0;
- SVN_ERR(svn_io_file_seek(context->reps_file, SEEK_CUR,
+ SVN_ERR(svn_io_file_seek(context->reps_file, APR_CUR,
&entry->offset, pool));
add_item_rep_mapping(context, entry);
/* copy the noderev to our temp file */
- SVN_ERR(svn_io_file_seek(rev_file, SEEK_SET, &source_offset, pool));
+ SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &source_offset, pool));
SVN_ERR(copy_file_data(context, context->reps_file, rev_file, entry->size,
pool));
@@ -1245,7 +1245,7 @@ write_reps_container(pack_context_t *con
SVN_ERR(svn_fs_x__write_reps_container(pack_stream, container, pool));
SVN_ERR(svn_stream_close(pack_stream));
- SVN_ERR(svn_io_file_seek(context->pack_file, SEEK_CUR, &offset, pool));
+ SVN_ERR(svn_io_file_seek(context->pack_file, APR_CUR, &offset, pool));
container_entry.offset = context->pack_offset;
container_entry.size = offset - container_entry.offset;
@@ -1327,7 +1327,7 @@ write_reps_containers(pack_context_t *co
/* select the change list in the source file, parse it and add it to
* the container */
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_SET, &entry->offset,
+ SVN_ERR(svn_io_file_seek(temp_file, APR_SET, &entry->offset,
iterpool));
SVN_ERR(svn_fs_x__get_representation_length(&representation.size,
&representation.expanded_size,
@@ -1414,7 +1414,7 @@ store_items(pack_context_t *context,
/* select the item in the source file and copy it into the target
* pack file */
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_SET, &entry->offset,
+ SVN_ERR(svn_io_file_seek(temp_file, APR_SET, &entry->offset,
iterpool));
SVN_ERR(copy_file_data(context, context->pack_file, temp_file,
entry->size, iterpool));
@@ -1558,7 +1558,7 @@ write_changes_container(pack_context_t *
container,
pool));
SVN_ERR(svn_stream_close(pack_stream));
- SVN_ERR(svn_io_file_seek(context->pack_file, SEEK_CUR, &offset, pool));
+ SVN_ERR(svn_io_file_seek(context->pack_file, APR_CUR, &offset, pool));
container_entry.offset = context->pack_offset;
container_entry.size = offset - container_entry.offset;
@@ -1654,7 +1654,7 @@ write_changes_containers(pack_context_t
/* select the change list in the source file, parse it and add it to
* the container */
- SVN_ERR(svn_io_file_seek(temp_file, SEEK_SET, &entry->offset,
+ SVN_ERR(svn_io_file_seek(temp_file, APR_SET, &entry->offset,
iterpool));
SVN_ERR(svn_fs_x__read_changes(&changes, temp_stream, iterpool));
SVN_ERR(svn_fs_x__changes_append_list(&list_index, container, changes));
@@ -1880,7 +1880,7 @@ pack_range(pack_context_t *context,
offset = entry->offset;
if (offset < finfo.size)
{
- SVN_ERR(svn_io_file_seek(rev_file, SEEK_SET, &offset,
+ SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset,
iterpool));
if (entry->type == SVN_FS_X__ITEM_TYPE_CHANGES)
Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.c Thu Sep 11 11:40:35 2014
@@ -1513,7 +1513,7 @@ allocate_item_index(apr_uint64_t *item_i
to_write = svn__ui64toa(buffer, *item_index + 1);
/* write it back to disk */
- SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool));
SVN_ERR(svn_io_file_write_full(file, buffer, to_write, NULL, pool));
SVN_ERR(svn_io_file_close(file, pool));
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Thu Sep 11 11:40:35 2014
@@ -3662,7 +3662,7 @@ svn_io_file_aligned_seek(apr_file_t *fil
buffer and no I/O will actually happen in the FILL_BUFFER
section below.
*/
- SVN_ERR(svn_io_file_seek(file, SEEK_CUR, ¤t, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_CUR, ¤t, pool));
fill_buffer = aligned_offset + file_buffer_size <= current
|| current <= aligned_offset;
}
@@ -3673,7 +3673,7 @@ svn_io_file_aligned_seek(apr_file_t *fil
apr_status_t status;
/* seek to the start of the block and cause APR to read 1 block */
- SVN_ERR(svn_io_file_seek(file, SEEK_SET, &aligned_offset, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_SET, &aligned_offset, pool));
status = apr_file_getc(&dummy, file);
/* read may fail if we seek to or behind EOF. That's ok then. */
@@ -3686,7 +3686,7 @@ svn_io_file_aligned_seek(apr_file_t *fil
/* finally, seek to the OFFSET the caller wants */
desired_offset = offset;
- SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool));
if (desired_offset != offset)
return do_io_file_wrapper_cleanup(file, APR_EOF,
N_("Can't seek in file '%s'"),
Modified: subversion/trunk/subversion/tests/libsvn_subr/io-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/io-test.c?rev=1624265&r1=1624264&r2=1624265&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/io-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/io-test.c Thu Sep 11 11:40:35 2014
@@ -561,7 +561,7 @@ aligned_seek(apr_file_t *file,
/* we must be at the desired offset */
current = 0;
- SVN_ERR(svn_io_file_seek(file, SEEK_CUR, ¤t, pool));
+ SVN_ERR(svn_io_file_seek(file, APR_CUR, ¤t, pool));
SVN_TEST_ASSERT(current == (apr_off_t)offset);
return SVN_NO_ERROR;