diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2021-03-02 00:45:07 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2021-03-02 00:45:07 +0000 |
commit | b8495abcdfaf6c033764608c2e4b719463764266 (patch) | |
tree | 5721908a21be04bdb4c7d5b7970ab406787027c2 /mmap | |
parent | b9b2d56d891a664d4392027b5205fc5e597d2b34 (diff) | |
download | libapr-b8495abcdfaf6c033764608c2e4b719463764266.tar.gz |
Remove Windows apr_mmap_t members pstart, psize and poffset.
They are only used locally in apr_mmap_create().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1887062 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'mmap')
-rw-r--r-- | mmap/win32/mmap.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 8fbb2f25b..1a84b45f8 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -72,8 +72,11 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, static DWORD memblock = 0; DWORD fmaccess = 0; DWORD mvaccess = 0; - DWORD offlo; - DWORD offhi; + /** The physical start, size and offset */ + apr_off_t pstart; + apr_size_t psize; + apr_off_t poffset; + DWORD offlo, offhi; if (size == 0) return APR_EINVAL; @@ -100,9 +103,9 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, } *new = apr_pcalloc(cont, sizeof(apr_mmap_t)); - (*new)->pstart = (offset / memblock) * memblock; - (*new)->poffset = offset - (*new)->pstart; - (*new)->psize = (apr_size_t)((*new)->poffset) + size; + pstart = (offset / memblock) * memblock; + poffset = offset - pstart; + psize = (apr_size_t)poffset + size; /* The size of the CreateFileMapping object is the current size * of the size of the mmap object (e.g. file size), not the size * of the mapped region! @@ -128,10 +131,10 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, return apr_get_os_error(); } - offlo = (DWORD)(*new)->pstart; - offhi = (DWORD)((*new)->pstart >> 32); + offlo = (DWORD)pstart; + offhi = (DWORD)(pstart >> 32); (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, offhi, - offlo, (*new)->psize); + offlo, psize); if (!(*new)->mv) { apr_status_t rv = apr_get_os_error(); @@ -140,7 +143,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, return rv; } - (*new)->mm = (char*)((*new)->mv) + (*new)->poffset; + (*new)->mm = (char *)(*new)->mv + poffset; (*new)->size = size; (*new)->cntxt = cont; APR_RING_ELEM_INIT(*new, link); |