From 48d84277fa097cfd98e2538e162af5764c234437 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mar 25 2020 03:09:43 +0000 Subject: Fix some -Wreturn-type warnings clang treates these as errors, so this fixes the build with clang --- diff --git a/hplip-fix-Wreturn-type-warning.patch b/hplip-fix-Wreturn-type-warning.patch new file mode 100644 index 0000000..e128078 --- /dev/null +++ b/hplip-fix-Wreturn-type-warning.patch @@ -0,0 +1,111 @@ +--- hplip-3.20.3/prnt/hpps/hppsfilter.c.orig 2020-03-25 01:09:51.585129957 +0000 ++++ hplip-3.20.3/prnt/hpps/hppsfilter.c 2020-03-25 01:10:15.610058293 +0000 +@@ -104,7 +104,7 @@ static void open_tempbookletfile(char *m + if(ptempbooklet_file == NULL) + { + fprintf(stderr, "ERROR: Unable to open temp file %s\n", temp_filename); +- return 1; ++ return; + } + chmod(temp_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +--- hplip-3.20.3/scan/sane/hpaio.c.orig 2020-03-25 01:24:15.558732638 +0000 ++++ hplip-3.20.3/scan/sane/hpaio.c 2020-03-25 02:48:36.097054366 +0000 +@@ -406,20 +406,34 @@ extern SANE_Status sane_hpaio_open(SANE_ + + extern void sane_hpaio_close(SANE_Handle handle) + { +- if (strcmp(*((char **)handle), "MARVELL") == 0) +- return marvell_close(handle); +- if (strcmp(*((char **)handle), "SOAP") == 0) +- return soap_close(handle); +- if (strcmp(*((char **)handle), "SOAPHT") == 0) +- return soapht_close(handle); +- if (strcmp(*((char **)handle), "LEDM") == 0) +- return ledm_close(handle); +- if (strcmp(*((char **)handle), "SCL-PML") == 0) +- return sclpml_close(handle); +- if (strcmp(*((char **)handle), "ESCL") == 0) +- return escl_close(handle); +- if (strcmp(*((char **)handle), "ORBLITE") == 0) +- return orblite_close(handle); ++ if (strcmp(*((char **)handle), "MARVELL") == 0) { ++ marvell_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAP") == 0) { ++ soap_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAPHT") == 0) { ++ soapht_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "LEDM") == 0) { ++ ledm_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SCL-PML") == 0) { ++ sclpml_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ESCL") == 0) { ++ escl_close(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ORBLITE") == 0) { ++ orblite_close(handle); ++ return; ++ } + } /* sane_hpaio_close() */ + + extern const SANE_Option_Descriptor * sane_hpaio_get_option_descriptor(SANE_Handle handle, SANE_Int option) +@@ -539,20 +553,34 @@ extern SANE_Status sane_hpaio_read(SANE_ + /* Note, sane_cancel is called normally not just during IO abort situations. */ + extern void sane_hpaio_cancel( SANE_Handle handle ) + { +- if (strcmp(*((char **)handle), "MARVELL") == 0) +- return marvell_cancel(handle); +- if (strcmp(*((char **)handle), "SOAP") == 0) +- return soap_cancel(handle); +- if (strcmp(*((char **)handle), "SOAPHT") == 0) +- return soapht_cancel(handle); +- if (strcmp(*((char **)handle), "LEDM") == 0) +- return ledm_cancel(handle); +- if (strcmp(*((char **)handle), "SCL-PML") == 0) +- return sclpml_cancel(handle); +- if (strcmp(*((char **)handle), "ESCL") == 0) +- return escl_cancel(handle); +- if (strcmp(*((char **)handle), "ORBLITE") == 0) +- return orblite_cancel(handle); ++ if (strcmp(*((char **)handle), "MARVELL") == 0) { ++ marvell_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAP") == 0) { ++ soap_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SOAPHT") == 0) { ++ soapht_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "LEDM") == 0) { ++ ledm_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "SCL-PML") == 0) { ++ sclpml_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ESCL") == 0) { ++ escl_cancel(handle); ++ return; ++ } ++ if (strcmp(*((char **)handle), "ORBLITE") == 0) { ++ orblite_cancel(handle); ++ return; ++ } + } /* sane_hpaio_cancel() */ + + extern SANE_Status sane_hpaio_set_io_mode(SANE_Handle handle, SANE_Bool nonBlocking) diff --git a/hplip.spec b/hplip.spec index b1d445b..f4884eb 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.20.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -130,6 +130,8 @@ Patch50: hplip-unicodeerror.patch # https://bugs.launchpad.net/hplip/+bug/1863620 Patch51: hplip-pil.patch +Patch52: hplip-fix-Wreturn-type-warning.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow Requires: cups @@ -390,6 +392,7 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h # 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes %patch50 -p1 -b .unicodeerror %patch51 -p1 -b .pil +%patch52 -p1 -b .Wreturn-fix sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -696,6 +699,10 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Wed Mar 25 2020 Tom Stellard - 3.20.3-2 +- Fix some -Wreturn-type warnings +- clang treates these as errors, so this fixes the build with clang. + * Tue Mar 10 2020 Zdenek Dohnal - 3.20.3-1 - 3.20.3