httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William A Rowe Jr <wr...@rowe-clan.net>
Subject Re: svn commit: r1698133 - in /httpd/httpd/trunk: include/httpd.h modules/http2/h2_switch.c server/protocol.c server/util.c
Date Thu, 27 Aug 2015 15:06:32 GMT
On Aug 27, 2015 7:14 AM, <icing@apache.org> wrote:
>
> Author: icing
> Date: Thu Aug 27 12:13:59 2015
> New Revision: 1698133
>
> URL: http://svn.apache.org/r1698133
> Log:
> giving ap_array_index a start parameter, adding ap_array_contains
>

>   */
> -AP_DECLARE(int) ap_array_index(const apr_array_header_t *array, const
char *s);
> +AP_DECLARE(int) ap_array_index(const apr_array_header_t *array,
> +                               const char *s,
> +                               apr_size_t start);

You want the type of rv of _index to correspond to the start input to rv,
no?  E.g.

int n = -1, count = 0;
while ((n = ap_array_index(arr, findtag, n + 1)) >= 0)
    ++count;

sizeof(int) does not have to equal sizeof(apr_size_t).  But for indexes I
believe it's fine.  The alternative is apr_ssize_t for both start arg and
rv.

Mime
View raw message