From c57faf08e611e65c201e3b9b7dd6b4d2daf8d276 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 14 Apr 2019 21:02:54 +0200 Subject: [PATCH] gutenprint: fix gcc2 build for 5.3.1. --- net-print/gutenprint/gutenprint8-5.3.1.recipe | 4 +- .../patches/gutenprint-5.3.1.patchset | 635 +++++++++++++++++- 2 files changed, 629 insertions(+), 10 deletions(-) diff --git a/net-print/gutenprint/gutenprint8-5.3.1.recipe b/net-print/gutenprint/gutenprint8-5.3.1.recipe index 7cad845ef..a13140811 100644 --- a/net-print/gutenprint/gutenprint8-5.3.1.recipe +++ b/net-print/gutenprint/gutenprint8-5.3.1.recipe @@ -19,8 +19,8 @@ CHECKSUM_SHA256="d80d8f5272d15bca5710f6ef4a2bb95e76d34e1155c5bcd5e83cb9f0a111d0d SOURCE_DIR="gutenprint-$portVersion" PATCHES="gutenprint-$portVersion.patchset" -ARCHITECTURES="?x86_gcc2 ?x86 x86_64" -SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" +ARCHITECTURES="x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 x86" PROVIDES=" gutenprint8$secondaryArchSuffix = $portVersion diff --git a/net-print/gutenprint/patches/gutenprint-5.3.1.patchset b/net-print/gutenprint/patches/gutenprint-5.3.1.patchset index 67d435b88..b57e4055b 100644 --- a/net-print/gutenprint/patches/gutenprint-5.3.1.patchset +++ b/net-print/gutenprint/patches/gutenprint-5.3.1.patchset @@ -1,4 +1,4 @@ -From d3e74adb7d4c9bfb016abc379cca2ced3dbdc863 Mon Sep 17 00:00:00 2001 +From 21ecc8836ac8947b92dc333186566feb5b2d14ba Mon Sep 17 00:00:00 2001 From: Humdinger Date: Fri, 20 Jan 2017 19:56:14 +0100 Subject: undef PAGESIZE on HAIKU @@ -76,10 +76,10 @@ index 4678949..d2ab025 100644 extern int mylineno; -- -2.19.0 +2.19.1 -From d03b91aca94d8bebbe9a44508eb6cce0483bde4d Mon Sep 17 00:00:00 2001 +From be491bfbb717c8181b646c647e1c35562b404483 Mon Sep 17 00:00:00 2001 From: Humdinger Date: Fri, 20 Jan 2017 19:58:12 +0100 Subject: strings.h fixes @@ -123,10 +123,10 @@ index 751424d..2838983 100644 #ifdef HAVE_LIMITS_H #include -- -2.19.0 +2.19.1 -From dc847513f434177d034d7307228b549a7b1b41dc Mon Sep 17 00:00:00 2001 +From 9ba9ee6389451462d48d2823e1d0553506184d1c Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 1 Apr 2017 15:24:54 +0200 Subject: Make gcc2 happy. @@ -153,10 +153,10 @@ index 6ba401a..51fc7ab 100644 test_cd = 1; -- -2.19.0 +2.19.1 -From 6f1aea7b3e69a41ea23149d2248de019991af591 Mon Sep 17 00:00:00 2001 +From 630db95a7eb1fc472bb94abc828643dd3a1ecdf0 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Mon, 21 May 2018 07:42:56 +0200 Subject: Make gcc2 happy, suite. @@ -181,5 +181,624 @@ index 6cd4ca9..a19d6a7 100644 + } } -- -2.19.0 +2.19.1 + + +From 91d29325ef34496408f9f294450d4a40aa8e3ad0 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 14 Apr 2019 20:56:21 +0200 +Subject: gcc2 patch for 5.3.1 + + +diff --git a/src/main/color-conversions.c b/src/main/color-conversions.c +index e5a31a8..bc24618 100644 +--- a/src/main/color-conversions.c ++++ b/src/main/color-conversions.c +@@ -380,6 +380,9 @@ color_##bits##_to_color(const stp_vars_t *vars, const unsigned char *in, \ + int bright_color_adjustment = 0; \ + int hue_only_color_adjustment = 0; \ + int do_user_adjustment = 0; \ ++ const double *hue_map; \ ++ const double *lum_map; \ ++ const double *sat_map; \ + if (lut->color_correction->correction == COLOR_CORRECTION_BRIGHT) \ + bright_color_adjustment = 1; \ + if (lut->color_correction->correction == COLOR_CORRECTION_HUE) \ +@@ -408,9 +411,9 @@ color_##bits##_to_color(const stp_vars_t *vars, const unsigned char *in, \ + (void) stp_curve_cache_get_double_data(&(lut->hue_map)); \ + (void) stp_curve_cache_get_double_data(&(lut->lum_map)); \ + (void) stp_curve_cache_get_double_data(&(lut->sat_map)); \ +- const double *hue_map = CURVE_CACHE_FAST_DOUBLE(&(lut->hue_map)); \ +- const double *lum_map = CURVE_CACHE_FAST_DOUBLE(&(lut->lum_map)); \ +- const double *sat_map = CURVE_CACHE_FAST_DOUBLE(&(lut->sat_map)); \ ++ hue_map = CURVE_CACHE_FAST_DOUBLE(&(lut->hue_map)); \ ++ lum_map = CURVE_CACHE_FAST_DOUBLE(&(lut->lum_map)); \ ++ sat_map = CURVE_CACHE_FAST_DOUBLE(&(lut->sat_map)); \ + \ + if (split_saturation) \ + ssat = sqrt(ssat); \ +@@ -485,6 +488,9 @@ color_##bits##_to_kcmy(const stp_vars_t *vars, const unsigned char *in, \ + int bright_color_adjustment = 0; \ + int hue_only_color_adjustment = 0; \ + int do_user_adjustment = 0; \ ++ const double *hue_map; \ ++ const double *lum_map; \ ++ const double *sat_map; \ + if (lut->color_correction->correction == COLOR_CORRECTION_BRIGHT) \ + bright_color_adjustment = 1; \ + if (lut->color_correction->correction == COLOR_CORRECTION_HUE) \ +@@ -514,9 +520,9 @@ color_##bits##_to_kcmy(const stp_vars_t *vars, const unsigned char *in, \ + (void) stp_curve_cache_get_double_data(&(lut->hue_map)); \ + (void) stp_curve_cache_get_double_data(&(lut->lum_map)); \ + (void) stp_curve_cache_get_double_data(&(lut->sat_map)); \ +- const double *hue_map = CURVE_CACHE_FAST_DOUBLE(&(lut->hue_map)); \ +- const double *lum_map = CURVE_CACHE_FAST_DOUBLE(&(lut->lum_map)); \ +- const double *sat_map = CURVE_CACHE_FAST_DOUBLE(&(lut->sat_map)); \ ++ hue_map = CURVE_CACHE_FAST_DOUBLE(&(lut->hue_map)); \ ++ lum_map = CURVE_CACHE_FAST_DOUBLE(&(lut->lum_map)); \ ++ sat_map = CURVE_CACHE_FAST_DOUBLE(&(lut->sat_map)); \ + \ + if (split_saturation) \ + ssat = sqrt(ssat); \ +diff --git a/src/main/escp2-channels.c b/src/main/escp2-channels.c +index 9e3b4e7..30b3c5f 100644 +--- a/src/main/escp2-channels.c ++++ b/src/main/escp2-channels.c +@@ -408,9 +408,9 @@ load_inkgroup(const char *name) + stp_mxml_node_t *node = + stp_xml_parse_file_from_path_uncached_safe(name, "escp2InkGroup", NULL); + stp_mxml_node_t *child = node->child; ++ size_t count = 0; + igl = stp_zalloc(sizeof(inkgroup_t)); + stp_refcache_add_item("escpInkgroup", name, igl); +- size_t count = 0; + while (child) + { + if (child->type == STP_MXML_ELEMENT && +diff --git a/src/main/escp2-resolutions.c b/src/main/escp2-resolutions.c +index f099907..33c2547 100644 +--- a/src/main/escp2-resolutions.c ++++ b/src/main/escp2-resolutions.c +@@ -178,13 +178,15 @@ int + stpi_escp2_load_resolutions(const stp_vars_t *v, const char *name, + stp_mxml_node_t *node) + { ++ static const char *res_cache = "escp2Resolutions"; ++ stpi_escp2_printer_t *printdef; ++ resolution_list_t *pr; ++ int found = 0; + stp_dprintf(STP_DBG_ESCP2_XML, v, + ">>>Loading resolutions from %s (%p)...", name, (void *) node); +- static const char *res_cache = "escp2Resolutions"; +- stpi_escp2_printer_t *printdef = stpi_escp2_get_printer(v); +- resolution_list_t *pr = ++ printdef = stpi_escp2_get_printer(v); ++ pr = + (resolution_list_t *) stp_refcache_find_item(res_cache, name); +- int found = 0; + if (pr) + stp_dprintf(STP_DBG_ESCP2_XML, v, "cached!"); + if(! pr) +@@ -287,11 +289,13 @@ stpi_escp2_load_quality_presets_from_xml(stp_mxml_node_t *node) + int + stpi_escp2_load_quality_presets(const stp_vars_t *v, const char *name) + { ++ static const char *quality_cache = "escp2QualityPresets"; ++ stpi_escp2_printer_t *printdef; ++ quality_list_t *qpw; + stp_dprintf(STP_DBG_ESCP2_XML, v, + ">>>Loading quality presets from %s...", name); +- static const char *quality_cache = "escp2QualityPresets"; +- stpi_escp2_printer_t *printdef = stpi_escp2_get_printer(v); +- quality_list_t *qpw = ++ printdef = stpi_escp2_get_printer(v); ++ qpw = + (quality_list_t *) stp_refcache_find_item(quality_cache, name); + if (qpw) + stp_dprintf(STP_DBG_ESCP2_XML, v, "cached!"); +diff --git a/src/main/print-dyesub.c b/src/main/print-dyesub.c +index 70fcc39..1b931ae 100644 +--- a/src/main/print-dyesub.c ++++ b/src/main/print-dyesub.c +@@ -2811,9 +2811,10 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "P95Gamma") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_gamma_list; ++ mlist = &mitsu_p95d_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -2823,9 +2824,10 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name, + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "Buzzer") == 0) { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_buzzer_list; ++ mlist = &mitsu_p95d_buzzer_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -2835,9 +2837,10 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name, + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } else if (strcmp(name, "MediaCut") == 0) { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_cutter_list; ++ mlist = &mitsu_p95d_cutter_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -2847,9 +2850,10 @@ mitsu_p95d_load_parameters(const stp_vars_t *v, const char *name, + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } else if (strcmp(name, "Comment") == 0) { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_comment_list; ++ mlist = &mitsu_p95d_comment_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -3217,9 +3221,10 @@ mitsu_p93d_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "P93Gamma") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p93d_gamma_list; ++ mlist = &mitsu_p93d_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -3229,9 +3234,10 @@ mitsu_p93d_load_parameters(const stp_vars_t *v, const char *name, + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "Buzzer") == 0) { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_buzzer_list; ++ mlist = &mitsu_p95d_buzzer_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -3244,9 +3250,10 @@ mitsu_p93d_load_parameters(const stp_vars_t *v, const char *name, + description->deflt.boolean = 0; + description->is_active = 1; + } else if (strcmp(name, "Comment") == 0) { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_p95d_comment_list; ++ mlist = &mitsu_p95d_comment_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -3782,9 +3789,10 @@ mitsu9500_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "CP9500Contrast") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu9500_contrast_list; ++ mlist = &mitsu9500_contrast_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -3894,9 +3902,10 @@ mitsu9550_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu9550_quality_list; ++ mlist = &mitsu9550_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4209,9 +4218,10 @@ mitsu98xx_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu9810_quality_list; ++ mlist = &mitsu9810_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4492,9 +4502,10 @@ mitsu70x_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu70x_quality_list; ++ mlist = &mitsu70x_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4543,9 +4554,10 @@ mitsu707_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu70x_quality_list; ++ mlist = &mitsu70x_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4569,9 +4581,10 @@ mitsu707_load_parameters(const stp_vars_t *v, const char *name, + } + else if (strcmp(name, "Deck") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu707_deck_list; ++ mlist = &mitsu707_deck_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4784,9 +4797,10 @@ mitsu_k60_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_k60_quality_list; ++ mlist = &mitsu_k60_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -4968,9 +4982,10 @@ mitsu_d90_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &mitsu_d90_quality_list; ++ mlist = &mitsu_d90_quality_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -5511,9 +5526,10 @@ shinko_chcs1245_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "DustRemoval") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &shinko_chcs1245_dust_list; ++ mlist = &shinko_chcs1245_dust_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -6863,9 +6879,10 @@ ds820_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "PrintSpeed") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &dnpds820_printspeeds_list; ++ mlist = &dnpds820_printspeeds_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -7314,9 +7331,10 @@ magicard_load_parameters(const stp_vars_t *v, const char *name, + + if (strcmp(name, "BlackType") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &magicard_black_types_list; ++ mlist = &magicard_black_types_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -7387,9 +7405,10 @@ magicard_load_parameters(const stp_vars_t *v, const char *name, + } + else if (strcmp(name, "Holokote") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &magicard_holokotes_list; ++ mlist = &magicard_holokotes_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -7413,9 +7432,10 @@ magicard_load_parameters(const stp_vars_t *v, const char *name, + } + else if (strcmp(name, "OvercoatHole") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &magicard_overcoat_holes_list; ++ mlist = &magicard_overcoat_holes_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -7427,9 +7447,10 @@ magicard_load_parameters(const stp_vars_t *v, const char *name, + } + else if (strcmp(name, "OvercoatHoleDuplex") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &magicard_overcoat_holes_list; ++ mlist = &magicard_overcoat_holes_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +@@ -7465,9 +7486,10 @@ magicard_load_parameters(const stp_vars_t *v, const char *name, + } + else if (strcmp(name, "MagCoer") == 0) + { ++ const dyesub_stringlist_t *mlist; + description->bounds.str = stp_string_list_create(); + +- const dyesub_stringlist_t *mlist = &magicard_mag_coer_list; ++ mlist = &magicard_mag_coer_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); +diff --git a/src/main/print-escp2-data.c b/src/main/print-escp2-data.c +index 267855d..5734b8f 100644 +--- a/src/main/print-escp2-data.c ++++ b/src/main/print-escp2-data.c +@@ -405,9 +405,10 @@ void + stpi_escp2_load_model(const stp_vars_t *v, int model) + { + char buf[MAXPATHLEN+1]; ++ int model_id_from_file; + stp_xml_init(); + snprintf(buf, MAXPATHLEN, "escp2/model/model_%d.xml", model); +- int model_id_from_file = load_model_from_file(v, buf, 0); ++ model_id_from_file = load_model_from_file(v, buf, 0); + stp_xml_exit(); + STPI_ASSERT(model_id_from_file == model, v); + } +diff --git a/src/main/print-escp2.c b/src/main/print-escp2.c +index 6fe807a..1b1c9b2 100644 +--- a/src/main/print-escp2.c ++++ b/src/main/print-escp2.c +@@ -2232,8 +2232,9 @@ escp2_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) + { + int i; ++ int found; + description->p_type = STP_PARAMETER_TYPE_INVALID; +- int found = 0; ++ found = 0; + if (name == NULL) + return; + +@@ -4474,6 +4475,7 @@ escp2_do_print(stp_vars_t *v, stp_image_t *image, int print_op) + int i; + + escp2_privdata_t *pd; ++ int page_number; + + if (strcmp(stp_get_string_parameter(v, "PrintingMode"), "BW") == 0 && + (stp_get_string_parameter(v, "InkType") && +@@ -4500,7 +4502,7 @@ escp2_do_print(stp_vars_t *v, stp_image_t *image, int print_op) + if (strcmp(stp_get_string_parameter(v, "InputImageType"), "Raw") == 0 && + !set_raw_ink_type(v)) + return 0; +- int page_number = stp_get_int_parameter(v, "PageNumber"); ++ page_number = stp_get_int_parameter(v, "PageNumber"); + + pd = (escp2_privdata_t *) stp_zalloc(sizeof(escp2_privdata_t)); + +diff --git a/src/main/print-papers.c b/src/main/print-papers.c +index c457295..737c023 100644 +--- a/src/main/print-papers.c ++++ b/src/main/print-papers.c +@@ -468,6 +468,8 @@ stpi_get_papersize_list_named(const char *name, const char *file) + else + { + char buf[MAXPATHLEN+1]; ++ stp_mxml_node_t *node; ++ const char *stmp; + stp_deprintf(STP_DBG_PAPER, "Loading paper list %s from %s\n", + name, file ? file : "(null)"); + if (! file) +@@ -476,9 +478,9 @@ stpi_get_papersize_list_named(const char *name, const char *file) + (void) snprintf(buf, MAXPATHLEN, "papers/%s.xml", name); + else + strncpy(buf, file, MAXPATHLEN); +- stp_mxml_node_t *node = ++ node = + stp_xml_parse_file_from_path_safe(buf, "paperdef", NULL); +- const char *stmp = stp_mxmlElementGetAttr(node, "name"); ++ stmp = stp_mxmlElementGetAttr(node, "name"); + STPI_ASSERT(stmp && !strcmp(name, stmp), NULL); + impl = stp_malloc(sizeof(papersize_list_impl_t)); + impl->name = stp_strdup(name); +diff --git a/src/main/print-util.c b/src/main/print-util.c +index 1119484..56171b4 100644 +--- a/src/main/print-util.c ++++ b/src/main/print-util.c +@@ -338,10 +338,11 @@ void + stp_eprintf(const stp_vars_t *v, const char *format, ...) + { + int bytes; ++ void * errdata; + stp_outfunc_t errfunc = stp_get_errfunc(v); + if (! errfunc) + errfunc = global_errfunc; +- void * errdata = stp_get_errdata(v); ++ errdata = stp_get_errdata(v); + if (! errdata) + errdata = global_errdata; + if (errfunc) +@@ -424,6 +425,7 @@ stp_dprintf(unsigned long level, const stp_vars_t *v, const char *format, ...) + stpi_init_debug(); + if (level & stpi_debug_level) + { ++ void *dbgdata; + stp_outfunc_t dbgfunc = stp_get_dbgfunc(v); + if (! dbgfunc) + dbgfunc = global_dbgfunc; +@@ -431,7 +433,7 @@ stp_dprintf(unsigned long level, const stp_vars_t *v, const char *format, ...) + dbgfunc = stp_get_errfunc(v); + if (! dbgfunc) + dbgfunc = global_errfunc; +- void *dbgdata = stp_get_dbgdata(v); ++ dbgdata = stp_get_dbgdata(v); + if (! dbgdata) + dbgdata = global_dbgdata; + if (! dbgdata) +diff --git a/src/main/printers.c b/src/main/printers.c +index 58787fa..3636cbe 100644 +--- a/src/main/printers.c ++++ b/src/main/printers.c +@@ -494,12 +494,14 @@ stp_describe_output(const stp_vars_t *v) + int + stp_verify(stp_vars_t *v) + { ++ const stp_printfuncs_t *printfuncs; ++ stp_vars_t *nv; ++ int status; + if (stp_get_verified(v)) + return 1; +- const stp_printfuncs_t *printfuncs = ++ printfuncs = + stpi_get_printfuncs(stp_get_printer(v)); +- stp_vars_t *nv = stp_vars_create_copy(v); +- int status; ++ nv = stp_vars_create_copy(v); + stp_prune_inactive_options(nv); + status = (printfuncs->verify)(nv); + stp_set_verified(v, stp_get_verified(nv)); +diff --git a/src/main/refcache.c b/src/main/refcache.c +index 9664528..0cdc0d1 100644 +--- a/src/main/refcache.c ++++ b/src/main/refcache.c +@@ -113,8 +113,9 @@ stp_refcache_create(const char *name) + static stp_refcache_t * + find_cache_named(const char *cache) + { ++ stp_list_item_t *item; + check_stp_cache(); +- stp_list_item_t *item = stp_list_get_item_by_name(global_cache_list, cache); ++ item = stp_list_get_item_by_name(global_cache_list, cache); + if (item) + return (stp_refcache_t *) stp_list_item_get_data(item); + else +@@ -124,8 +125,9 @@ find_cache_named(const char *cache) + static stp_refcache_t * + find_or_create_cache_named(const char *cache) + { ++ stp_list_item_t *item; + check_stp_cache(); +- stp_list_item_t *item = stp_list_get_item_by_name(global_cache_list, cache); ++ item = stp_list_get_item_by_name(global_cache_list, cache); + if (!item) + { + stp_refcache_create(cache); +@@ -207,8 +209,9 @@ stp_refcache_replace_item(const char *cache, const char *item, void *data) + void + stp_refcache_destroy(const char *cache) + { ++ stp_list_item_t *item; + check_stp_cache(); +- stp_list_item_t *item = stp_list_get_item_by_name(global_cache_list, cache); ++ item = stp_list_get_item_by_name(global_cache_list, cache); + if (item) + { + stp_list_item_destroy(global_cache_list, item); +diff --git a/src/main/sequence.c b/src/main/sequence.c +index 8be0911..482c4cb 100644 +--- a/src/main/sequence.c ++++ b/src/main/sequence.c +@@ -383,13 +383,14 @@ stp_sequence_create_from_xmltree(stp_mxml_node_t *da) + if (child->type == STP_MXML_TEXT) + { + char *endptr; ++ double tmpval; + /* + * Explicitly documented that callers to strtod should clear + * errno before calling it if they want to check the return + * status. + */ + errno = 0; +- double tmpval = strtod(child->value.text.string, &endptr); ++ tmpval = strtod(child->value.text.string, &endptr); + if (endptr == child->value.text.string) + { + stp_erprintf +diff --git a/src/main/xml.c b/src/main/xml.c +index 5587a12..1755131 100644 +--- a/src/main/xml.c ++++ b/src/main/xml.c +@@ -308,8 +308,9 @@ xml_try_parse_file_1(const char *pathname, const char *topnodename) + static stp_mxml_node_t * + xml_try_parse_file(const char *pathname, const char *topnodename) + { ++ stp_mxml_node_t *answer; + stp_xml_init(); +- stp_mxml_node_t *answer = xml_try_parse_file_1(pathname, topnodename); ++ answer = xml_try_parse_file_1(pathname, topnodename); + stp_xml_exit(); + return answer; + } +@@ -423,11 +424,12 @@ void + stp_xml_free_parsed_file(stp_mxml_node_t *node) + { + char *addr_string; ++ stp_param_string_t *cache_entry; + /* free(NULL) is legal and a no-op. */ + if (! node) + return; + stp_asprintf(&addr_string, "%p", (void *) node); +- stp_param_string_t *cache_entry = ++ cache_entry = + stp_string_list_find(cached_xml_files, addr_string); + if (! cache_entry) + { +diff --git a/src/testpattern/testpattern.c b/src/testpattern/testpattern.c +index 3a6f00d..84e6375 100644 +--- a/src/testpattern/testpattern.c ++++ b/src/testpattern/testpattern.c +@@ -613,12 +613,12 @@ fill_channels_##bits(unsigned char *data, size_t len, size_t scount) \ + { \ + int i; \ + int c; \ +- scount = global_channel_depth; \ + T *s_data = (T *) data; \ + unsigned black_val = global_ink_limit * ((1 << bits) - 1); \ +- unsigned blocksize = len / scount; \ +- unsigned blocks = blocksize * scount; \ ++ unsigned blocksize = len / global_channel_depth; \ ++ unsigned blocks = blocksize * global_channel_depth; \ + unsigned extra = len - blocks; \ ++ scount = global_channel_depth; \ + memset(s_data, 0, sizeof(T) * len * scount); \ + for (c = 0; c < scount; c++) \ + { \ +-- +2.19.1