[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1628393 - /subversion/trunk/subversion/libsvn_fs_fs/index.c

From: Branko Čibej <brane_at_wandisco.com>
Date: Tue, 30 Sep 2014 14:40:00 +0200

On 30.09.2014 13:10, stefan2_at_apache.org wrote:
> Author: stefan2
> Date: Tue Sep 30 11:10:02 2014
> New Revision: 1628393
> URL: http://svn.apache.org/r1628393
> Log:
> Fix / silence some integer conversion warnings.
> * subversion/libsvn_fs_fs/index.c
> (packed_stream_read): We know those are well within apr_size_t's
> value range.
> (auto_open_l2p_index): The config reader limits the BLOCK_SIZE
> to apr_size_t since r1628392.
> (get_l2p_header_body): Use the appropriate type for the iteration
> variable. Use maximally widening casts
> for non-negative values where appropriate.
> Cast revnum count after we verified its range
> to be within MAX_FILES_PER_DIR.
> (prefetch_l2p_pages): Exit early for non-positive ranges and use
> maximally widening casts for non-negative
> values where appropriate.


In my book, every cast is wrong, and widening casts are doubly wrong
because they're implicit. Casts are marginally acceptable if they're
needed to adapt to a poorly designed and/or hardware/platform-specific
API. But in this case, all the values involved appear to be parameters
or return values of our own private functions.

-- Brane
Received on 2014-09-30 14:40:33 CEST

This is an archived mail posted to the Subversion Dev mailing list.