New Ghostscript/GhostPDL compiler warnings - 2017-11-02-19:30:02 - b3c0fafa490932cc43009c53c7f8a17598fe78d7

[email protected]
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20171103041111.4792E20408B4@i7>
Previous Revision: 961b14dd7e686a1543541070a1ba943590ef2bf9
 Current Revision: b3c0fafa490932cc43009c53c7f8a17598fe78d7

commit b3c0fafa490932cc43009c53c7f8a17598fe78d7
Author:     Robin Watts <[email protected]>
AuthorDate: Wed Nov 1 12:07:53 2017 +0000
CommitDate: Wed Nov 1 13:40:13 2017 +0000

    Tweak map_XXXX_subclass functions.
    
    To cope with subclassed devices, we no longer simply call:
    
     pprocs = dev_proc(dev, get_color_mapping_procs);
     pprocs->map_cmyk(dev, ...)
    
    etc. The 'done thing' is to run up the the dev->parent pointers
    as far as we can, and to get the color mapping procedures from
    that. These color mapping procedures then need to be called
    using the dev pointer from which they were fetched.
    
    To do this, we provide get_color_mapping_procs_subclass
    and map_XXX_subclass functions that pickle the dev search.
    
    The only downside to this is that we end up doing the search
    up the tree twice (or more than twice in the case where we
    make several mapping calls).
    
    Here we therefore tweak these functions so that
    get_color_mapping_procs_subclass returns both the procs AND
    the dev to use when calling them in a structure, and the
    map_XXX_subclass functions now take that structure.
    
    Broadly, this change shouldn't actually alter any operation,
    other than being slightly more efficient.
    
    There are a few wrinkles:
    
    1) in gsicc_replacecm.c, we were fetching the procs using the
    dev chasing function, but calling them using the unchased dev
    value. Fixed here to use the matching dev value in both cases.
    
    2) In a couple of places, we have special handling for forwarding
    devices. I am not convinced that we handle subclassed forwarding
    devices correctly (or devices that forward to subclassed devices).
    I have marked these areas with FIXMEs, but they are no worse
    now than they were before.

base/gdevdflt.c
base/gdevdgbr.c
base/gdevnfwd.c
base/gscspace.c
base/gsicc_replacecm.c
base/gsovrc.c
base/gspaint.c
base/gxcmap.c
base/gxdcolor.c
base/gxdevcli.h



Ghostscript:

new scan-build warnings:

./base/gsicc_replacecm.c:375:35: warning: Access to field 'map_cmyk' results in a dereference of a null pointer (loaded from variable 'cm_procs')
    rcm_link->cm_procs.map_cmyk = cm_procs->map_cmyk;
                                  ^~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1826:5: warning: Access to field 'map_rgb' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_rgb(scm.dev, pgs, r, g, b, out);
    ^~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1832:5: warning: Access to field 'map_gray' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_gray(scm.dev, gray, out);
    ^~~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1838:5: warning: Access to field 'map_cmyk' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_cmyk(scm.dev, c, m, y, k, out);
    ^~~~~~~~~~~~~~~~~~~


http://miles.ghostscript.com:8080/artifex/b3c0fafa490932cc43009c53c7f8a17598fe78d7/gs/index.html

http://miles.ghostscript.com:8080/artifex/b3c0fafa490932cc43009c53c7f8a17598fe78d7/gs-scan-build.txt




GhostPCL:

new scan-build warnings:

./base/gsicc_replacecm.c:375:35: warning: Access to field 'map_cmyk' results in a dereference of a null pointer (loaded from variable 'cm_procs')
    rcm_link->cm_procs.map_cmyk = cm_procs->map_cmyk;
                                  ^~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1826:5: warning: Access to field 'map_rgb' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_rgb(scm.dev, pgs, r, g, b, out);
    ^~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1832:5: warning: Access to field 'map_gray' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_gray(scm.dev, gray, out);
    ^~~~~~~~~~~~~~~~~~~

./base/gxdevcli.h:1838:5: warning: Access to field 'map_cmyk' results in a dereference of a null pointer (loaded from field 'procs')
    scm.procs->map_cmyk(scm.dev, c, m, y, k, out);
    ^~~~~~~~~~~~~~~~~~~


http://miles.ghostscript.com:8080/artifex/b3c0fafa490932cc43009c53c7f8a17598fe78d7/pcl/index.html

http://miles.ghostscript.com:8080/artifex/b3c0fafa490932cc43009c53c7f8a17598fe78d7/pcl-scan-build.txt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.