[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2461-g0c6e723

[email protected] (Nancy Durgin) Thu, 7 Nov 2019 21:08:37 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  0c6e72399d68165970fd7ad6baa946df127c8ea5 (commit)
      from  bceaa77e2142b8c09cbc6422de2132239c5f4b29 (commit)

----------------------------------------------------------------------
commit 0c6e72399d68165970fd7ad6baa946df127c8ea5
Author: Nancy Durgin <[email protected]>
Date:   Thu Nov 7 11:11:28 2019 -0800

    Clean up warnings in halftone code
    
    Needed to get this cleaned up because gcc generated pages of warnings
    related to const chars and such.  Cleaned up the less spammy ones while
    I was in there.
    
    I left one warning in because I think pdfi_get_name_index() and other
    name table funcs should probably take a "const char *name"?  This
    would change some things in pdf_gstate.c where it is used, such as the
    argument to build_type1_halftone().

diff --git a/pdf/pdf_gstate.c b/pdf/pdf_gstate.c
index 626cdb4..1cc1992 100644
--- a/pdf/pdf_gstate.c
+++ b/pdf/pdf_gstate.c
@@ -1070,7 +1070,7 @@ static int GS_TR2(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dic
     return code;
 }
 
-static char *spot_functions[] = {
+static const char *spot_functions[] = {
     "{dup mul exch dup mul add 1 exch sub}",        /* SimpleDot */
     "{dup mul exch dup mul add 1 sub}",             /* InvertedSimpleDot */
     "{360 mul sin 2 div exch 360 mul sin 2 div add",/* DoubleDot */
@@ -1114,7 +1114,7 @@ static char *spot_functions[] = {
      ifelse} ifelse}"                               /* Diamond */
 };
 
-static char *spot_table[] = {
+static const char *spot_table[] = {
     "SimpleDot",
     "InvertedSimpleDot",
     "DoubleDot",
@@ -1343,7 +1343,7 @@ static int build_type1_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
     if (code < 0)
         goto error;
 
-    phtc->comp_number = gs_cname_to_colorant_number(ctx->pgs, name, len, 1);
+    phtc->comp_number = gs_cname_to_colorant_number(ctx->pgs, (byte *)name, len, 1);
 
     code = gs_screen_order_init_memory(order, ctx->pgs, &phtc->params.spot.screen,
                                        gs_currentaccuratescreens(ctx->memory), ctx->memory);
@@ -1392,19 +1392,17 @@ error:
     return code;
 }
 
-static int pdfi_free_halftone(gs_memory_t *memory, void *data, client_name_t cname)
+static void pdfi_free_halftone(gs_memory_t *memory, void *data, client_name_t cname)
 {
     gs_halftone *pht = (gs_halftone *)data;
 
     gs_free_object(memory, pht->params.multiple.components, "pdfi_free_halftone");
-    return 0;
 }
 
 static int pdfi_do_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_dict *page_dict)
 {
     int code;
     int64_t type;
-    pdf_obj *obj = NULL;
     gs_halftone *pht = NULL;
     gx_device_halftone *pdht = NULL;
     gs_halftone_component *phtc = NULL;
@@ -1487,9 +1485,7 @@ error:
 static int GS_HT(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
 {
     int code;
-    int64_t type;
     pdf_obj *obj = NULL;
-    bool error = false;
 
     code = pdfi_dict_get(ctx, GS, "HT", &obj);
     if (code < 0)


Summary of changes:
 pdf/pdf_gstate.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)