On 15.12.2016 08:17, br...@apache.org wrote: > * buckets/mmap_buckets.c > (serf_mmap_read, > serf_mmap_readline, > serf_mmap_peek): Fix pointer types in output arguments. [...] > @@ -87,18 +87,19 @@ static apr_status_t serf_mmap_readline(s > { > mmap_context_t *ctx = bucket->data; > apr_status_t status; > - char *end; > + const char *eol; > + void *end; > > /* ### Would it be faster to call this once and do the offset ourselves? > */ > status = apr_mmap_offset(&end, ctx->mmap, ctx->offset); > if (SERF_BUCKET_READ_ERROR(status)) > return status; > > - *data = end; > + *data = eol = end; > > *len = ctx->remaining; > - serf_util_readline(&end, len, acceptable, found); > - *len = end - *data; > + serf_util_readline(&eol, len, acceptable, found); > + *len = eol - *data;
I suppose this one might be a wee bit controversial ... any compiler worth its salt will use lifetime analysis to figure out that it needs a single stack slot for both 'eol' and 'end'. IMO, using the correct types here is more valuable than using one less variable at the source level. -- Brane