From f920afcc219201ece290aa1674710a0453bfc366 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 8 Sep 2019 20:54:42 +0200 Subject: [PATCH] gutenprint: add recipe for version 5.3.3. the SONAME was bumped. --- net-print/gutenprint/gutenprint9-5.3.3.recipe | 75 ++ .../patches/gutenprint-5.3.3.patchset | 885 ++++++++++++++++++ 2 files changed, 960 insertions(+) create mode 100644 net-print/gutenprint/gutenprint9-5.3.3.recipe create mode 100644 net-print/gutenprint/patches/gutenprint-5.3.3.patchset diff --git a/net-print/gutenprint/gutenprint9-5.3.3.recipe b/net-print/gutenprint/gutenprint9-5.3.3.recipe new file mode 100644 index 000000000..a5630cf82 --- /dev/null +++ b/net-print/gutenprint/gutenprint9-5.3.3.recipe @@ -0,0 +1,75 @@ +SUMMARY="Suite of printer drivers" +DESCRIPTION="Gutenprint, formerly named Gimp-Print, is a suite of printer \ +drivers that may be used with most common UNIX print spooling systems, \ +including CUPS, lpr, LPRng, or others. These drivers provide high quality \ +printing for UNIX (including Macintosh OS X 10.3 and newer) and Linux \ +systems in many cases equal to or better than proprietary vendor-supplied \ +drivers. +Gutenprint also includes an enhanced print plug-in for the GIMP image editor, \ +replacing the Gimp-Print 4.2-based plugin supplied with GIMP 1.2, \ +2.0, and 2.2, and offering an alternative with additional \ +capabilities to the GtkPrint-based plugin supplied with GIMP 2.4 \ +and beyond." +HOMEPAGE="http://gimp-print.sourceforge.net/" +COPYRIGHT="1999-2019 The authors of Gutenprint" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://downloads.sourceforge.net/gimp-print/gutenprint-$portVersion.tar.xz" +CHECKSUM_SHA256="7279ecbc8e67d1858c53cb24e423ea1be98e214872006b79e6e03650dd54a072" +SOURCE_DIR="gutenprint-$portVersion" +PATCHES="gutenprint-$portVersion.patchset" + +ARCHITECTURES="x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 x86" + +PROVIDES=" + gutenprint9$secondaryArchSuffix = $portVersion + lib:libgutenprint$secondaryArchSuffix = 9.4.0 compat >= 9 + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + gutenprint9${secondaryArchSuffix}_devel = $portVersion + devel:libgutenprint$secondaryArchSuffix = 9.4.0 compat >= 9 + " +REQUIRES_devel=" + gutenprint9$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:automake + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:sed + " + +BUILD() +{ + runConfigure ./configure --without-cups + make $jobArgs +} + +INSTALL() +{ + make install + + rm $libDir/libgutenprint.la + + rm -rf $binDir $manDir + + prepareInstalledDevelLibs libgutenprint + fixPkgconfig + + # devel package + packageEntries devel \ + $developDir +} diff --git a/net-print/gutenprint/patches/gutenprint-5.3.3.patchset b/net-print/gutenprint/patches/gutenprint-5.3.3.patchset new file mode 100644 index 000000000..4e641360f --- /dev/null +++ b/net-print/gutenprint/patches/gutenprint-5.3.3.patchset @@ -0,0 +1,885 @@ +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 + +Update patch by Jerome Duval to new release. + +diff --git a/src/testpattern/testpattern.c b/src/testpattern/testpattern.c +index 2474d69..3a6f00d 100644 +--- a/src/testpattern/testpattern.c ++++ b/src/testpattern/testpattern.c +@@ -36,6 +36,9 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#undef PAGESIZE ++#endif + #include "testpattern.h" + #include + #include +diff --git a/src/testpattern/testpatternl.c b/src/testpattern/testpatternl.c +index 048a31b..7c85598 100644 +--- a/src/testpattern/testpatternl.c ++++ b/src/testpattern/testpatternl.c +@@ -20,6 +20,9 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#undef PAGESIZE ++#endif + + /* end standard C headers. */ + +diff --git a/src/testpattern/testpatternl.l b/src/testpattern/testpatternl.l +index 31d6197..27d0998 100644 +--- a/src/testpattern/testpatternl.l ++++ b/src/testpattern/testpatternl.l +@@ -27,6 +27,9 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#undef PAGESIZE ++#endif + #include "testpattern.h" + + #pragma GCC diagnostic ignored "-Wredundant-decls" +diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c +index 2344ffb..7c0c08b 100644 +--- a/src/testpattern/testpatterny.c ++++ b/src/testpattern/testpatterny.c +@@ -73,6 +73,9 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#undef PAGESIZE ++#endif + #include "testpattern.h" + + extern int mylineno; +diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y +index 4678949..d2ab025 100644 +--- a/src/testpattern/testpatterny.y ++++ b/src/testpattern/testpatterny.y +@@ -28,6 +28,9 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#undef PAGESIZE ++#endif + #include "testpattern.h" + + extern int mylineno; +-- +2.19.1 + + +From be491bfbb717c8181b646c647e1c35562b404483 Mon Sep 17 00:00:00 2001 +From: Humdinger +Date: Fri, 20 Jan 2017 19:58:12 +0100 +Subject: strings.h fixes + +Update patch by Jerome Duval to new release. + +diff --git a/src/main/curve.c b/src/main/curve.c +index 2aeb15e..83efd76 100644 +--- a/src/main/curve.c ++++ b/src/main/curve.c +@@ -30,6 +30,7 @@ + #include + #endif + #include ++#include + #include + #include + #include +diff --git a/src/main/escp2-papers.c b/src/main/escp2-papers.c +index 19d1b98..3580842 100644 +--- a/src/main/escp2-papers.c ++++ b/src/main/escp2-papers.c +@@ -22,6 +22,7 @@ + #ifdef HAVE_CONFIG_H + #include + #endif ++#include + #include + #include "gutenprint-internal.h" + #include +diff --git a/src/main/print-ps.c b/src/main/print-ps.c +index 751424d..2838983 100644 +--- a/src/main/print-ps.c ++++ b/src/main/print-ps.c +@@ -32,6 +32,7 @@ + #include "gutenprint-internal.h" + #include + #include ++#include + #include + #ifdef HAVE_LIMITS_H + #include +-- +2.19.1 + + +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. + + +diff --git a/src/main/print-canon.c b/src/main/print-canon.c +index 6ba401a..51fc7ab 100644 +--- a/src/main/print-canon.c ++++ b/src/main/print-canon.c +@@ -3832,7 +3832,6 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) + rather than calculated. + */ + unsigned char arg_ESCP_1 = (init->pt) ? canon_size_type(v,init->caps) : 0x03; /* default size A4 */ +- stp_dprintf(STP_DBG_CANON, v,"setPageMargins2: arg_ESCP_1 = '%x'\n",arg_ESCP_1); + + /* TOFIX: what exactly is to be sent? + * Is it the printable length or the bottom border? +@@ -3846,6 +3845,7 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) + const char* input_slot = stp_get_string_parameter(v, "InputSlot"); + int print_cd = (input_slot && (!strcmp(input_slot, "CD"))); + ++ stp_dprintf(STP_DBG_CANON, v,"setPageMargins2: arg_ESCP_1 = '%x'\n",arg_ESCP_1); + stp_dprintf(STP_DBG_CANON, v,"setPageMargins2: print_cd = %d\n",print_cd); + + test_cd = 1; +-- +2.19.1 + + +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. + + +diff --git a/src/main/channel.c b/src/main/channel.c +index 6cd4ca9..a19d6a7 100644 +--- a/src/main/channel.c ++++ b/src/main/channel.c +@@ -1201,6 +1201,7 @@ stp_channel_get_output_8bit(const stp_vars_t *v) + if (! cg->output_data_8bit) + cg->output_data_8bit = stp_malloc(sizeof(unsigned char) * + cg->total_channels * cg->width); ++ { + int i; + (void) memset(cg->output_data_8bit, 0, sizeof(unsigned char) * + cg->total_channels * cg->width); +@@ -1208,4 +1209,5 @@ stp_channel_get_output_8bit(const stp_vars_t *v) + cg->output_data_8bit[i] = cg->output_data[i] / (unsigned short) 257; + cg->valid_8bit = 1; + return cg->output_data_8bit; ++ } + } +-- +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 + + +From 4a2d20a7e8cfd8efd2fddd35241c72a7330632d4 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 8 Sep 2019 21:24:23 +0200 +Subject: [PATCH] gcc build fix + +--- + src/main/print-dyesub.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/main/print-dyesub.c b/src/main/print-dyesub.c +index 89beb2d..f4fb21d 100644 +--- a/src/main/print-dyesub.c ++++ b/src/main/print-dyesub.c +@@ -1842,6 +1842,7 @@ sony_upd895_load_parameters(const stp_vars_t *v, const char *name, + { + description->bounds.str = stp_string_list_create(); + ++{ + const dyesub_stringlist_t *mlist = &sony_upd895_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { +@@ -1849,6 +1850,7 @@ sony_upd895_load_parameters(const stp_vars_t *v, const char *name, + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } ++} + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } +@@ -2097,6 +2099,7 @@ sony_upd897_load_parameters(const stp_vars_t *v, const char *name, + { + description->bounds.str = stp_string_list_create(); + ++{ + const dyesub_stringlist_t *mlist = &sony_upd897_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { +@@ -2104,6 +2107,7 @@ sony_upd897_load_parameters(const stp_vars_t *v, const char *name, + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } ++} + description->deflt.str = stp_string_list_param(description->bounds.str, 3)->name; + description->is_active = 1; + } +@@ -2364,6 +2368,7 @@ static void sony_upcr20_printer_init_func(stp_vars_t *v) + dyesub_privdata_t *pd = get_privdata(v); + + int hdrlen; ++ char pg = 0; + + /* Generate PJL header */ + memset(buf, 0, sizeof(buf)); +@@ -2391,7 +2396,6 @@ static void sony_upcr20_printer_init_func(stp_vars_t *v) + /* Write block header */ + stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v); + +- char pg = 0; + if (strcmp(pd->pagesize,"B7") == 0) + pg = 0x40; + else if (strcmp(pd->pagesize,"w288h432") == 0) +@@ -2560,6 +2564,7 @@ static void sony_updr80md_printer_init_func(stp_vars_t *v) + dyesub_privdata_t *pd = get_privdata(v); + + int hdrlen; ++ char pg = 0; + + /* Generate PJL header */ + memset(buf, 0, sizeof(buf)); +@@ -2587,7 +2592,6 @@ static void sony_updr80md_printer_init_func(stp_vars_t *v) + /* Write block header */ + stp_zfwrite(hdrbuf, 1, sizeof(hdrbuf), v); + +- char pg = 0; + if (strcmp(pd->pagesize,"Letter") == 0) + pg = 0x00; + else if (strcmp(pd->pagesize,"A4") == 0) +-- +2.23.0 +