Re: [vdr] vdr-2.2.0 compilation fails with gcc7

2017-03-02 Thread Martin Gansser
Thanks for your patch, but then there are further error messages:

g++ -O3 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 
-mtune=generic -fPIC -Werror=overloaded-virtual -Wno-parentheses -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fPIC -c 
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-DREMOTE_KBD -DVDR_USER=\"vdr\" -DSDNOTIFY 
-DLIRC_DEVICE=\"/var/run/lirc/lircd\" -DVIDEODIR=\"/var/lib/vdr/video\" 
-DCONFDIR=\"/etc/vdr\" -DARGSDIR=\"/etc/vdr/conf.d\" 
-DCACHEDIR=\"/var/cache/vdr\" -DRESDIR=\"/usr/share/vdr\" 
-DPLUGINDIR=\"/usr/lib64/vdr\" -DLOCDIR=\"/usr/share/locale\" 
-I/usr/include/freetype2 -I/usr/include/libpng16-o osdbase.o osdbase.c
osdbase.c: In member function 'eOSState cOsdMenu::HotKey(eKeys)':
osdbase.c:513:38: error: ISO C++ forbids comparison between pointer and integer 
[-fpermissive]
   if (s && (s = skipspace(s)) != '\0' && '0' <= s[i] && s[i] <= '9') {
  ^~~~
make: *** [Makefile:126: osdbase.o] Error 1

I fixed this with this patch:

--- a/osdbase.c.orig2017-02-15 15:55:34.555128665 +0100
+++ b/osdbase.c 2017-02-15 15:56:30.898068614 +0100
@@ -510,7 +510,7 @@
   const char *s = item->Text();
   i = 0;
   item_nr = 0;
-  if (s && (s = skipspace(s)) != '\0' && '0' <= s[i] && s[i] <= '9') {
+  if (s && (s = skipspace(s)) != NULL && '0' <= s[i] && s[i] <= '9') {
  do {
 item_nr = item_nr * 10 + (s[i] - '0');
 }

it compiles fine, but I am not shure if this is correct ?
 
 

Gesendet: Donnerstag, 02. März 2017 um 11:35 Uhr
Von: "Klaus Schmidinger" <klaus.schmidin...@tvdr.de>
An: "VDR Mailing List" <vdr@linuxtv.org>
Betreff: Re: [vdr] vdr-2.2.0 compilation fails with gcc7
On 02.03.2017 11:25, Martin Gansser wrote:
> vdr-2.2.0 compilation fails with gcc7 on Fedora26.
> ...

This will be fixed in version 2.3.3, where I have changed "unsigned"
to "signed" in several places to avoid these problems.
Attached are the respective changes, it still applies to version 2.2.0.

Klaus
___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] vdr-2.2.0 compilation fails with gcc7

2017-03-02 Thread Klaus Schmidinger

On 02.03.2017 11:25, Martin Gansser wrote:

vdr-2.2.0 compilation fails with gcc7 on Fedora26.
...


This will be fixed in version 2.3.3, where I have changed "unsigned"
to "signed" in several places to avoid these problems.
Attached are the respective changes, it still applies to version 2.2.0.

Klaus
--- diseqc.c	2015/01/26 12:02:14	4.0
+++ diseqc.c	2017/01/09 15:10:40
@@ -253,10 +253,10 @@
   return result;
 }
 
-uint cDiseqc::SetScrFrequency(uint SatFrequency, const cScr *Scr, uint8_t *Codes) const
+int cDiseqc::SetScrFrequency(int SatFrequency, const cScr *Scr, uint8_t *Codes) const
 {
   if ((Codes[0] & 0xF0) == 0x70 ) { // EN50607 aka JESS
- uint t = SatFrequency == 0 ? 0 : (SatFrequency - 100);
+ int t = SatFrequency == 0 ? 0 : (SatFrequency - 100);
  if (t < 2048 && Scr->Channel() >= 0 && Scr->Channel() < 32) {
 Codes[1] = t >> 8 | Scr->Channel() << 3;
 Codes[2] = t;
@@ -266,7 +266,7 @@
 }
  }
   else { // EN50494 aka Unicable
- uint t = SatFrequency == 0 ? 0 : (SatFrequency + Scr->UserBand() + 2) / 4 - 350; // '+ 2' together with '/ 4' results in rounding!
+ int t = SatFrequency == 0 ? 0 : (SatFrequency + Scr->UserBand() + 2) / 4 - 350; // '+ 2' together with '/ 4' results in rounding!
  if (t < 1024 && Scr->Channel() >= 0 && Scr->Channel() < 8) {
 Codes[3] = t >> 8 | (t == 0 ? 0 : scrBank << 2) | Scr->Channel() << 5;
 Codes[4] = t;
@@ -399,7 +399,7 @@
   return NULL;
 }
 
-cDiseqc::eDiseqcActions cDiseqc::Execute(const char **CurrentAction, uchar *Codes, uint8_t *MaxCodes, const cScr *Scr, uint *Frequency) const
+cDiseqc::eDiseqcActions cDiseqc::Execute(const char **CurrentAction, uchar *Codes, uint8_t *MaxCodes, const cScr *Scr, int *Frequency) const
 {
   if (!*CurrentAction)
  *CurrentAction = commands;
--- diseqc.h	2013/06/12 11:52:17	4.0
+++ diseqc.h	2017/01/09 15:11:19
@@ -86,7 +86,7 @@
   mutable int scrBank;
   char *commands;
   bool parsing;
-  uint SetScrFrequency(uint SatFrequency, const cScr *Scr, uint8_t *Codes) const;
+  int SetScrFrequency(int SatFrequency, const cScr *Scr, uint8_t *Codes) const;
   int SetScrPin(const cScr *Scr, uint8_t *Codes) const;
   const char *Wait(const char *s) const;
   const char *GetPosition(const char *s) const;
@@ -96,7 +96,7 @@
   cDiseqc(void);
   ~cDiseqc();
   bool Parse(const char *s);
-  eDiseqcActions Execute(const char **CurrentAction, uchar *Codes, uint8_t *MaxCodes, const cScr *Scr, uint *Frequency) const;
+  eDiseqcActions Execute(const char **CurrentAction, uchar *Codes, uint8_t *MaxCodes, const cScr *Scr, int *Frequency) const;
   ///< Parses the DiSEqC commands and returns the appropriate action code
   ///< with every call. CurrentAction must be the address of a character pointer,
   ///< which is initialized to NULL. This pointer is used internally while parsing
--- dvbdevice.c	2016/11/07 13:55:58	4.3
+++ dvbdevice.c	2017/01/09 15:11:39
@@ -329,7 +329,7 @@
   void ClearEventQueue(void) const;
   bool GetFrontendStatus(fe_status_t ) const;
   cPositioner *GetPositioner(void);
-  void ExecuteDiseqc(const cDiseqc *Diseqc, unsigned int *Frequency);
+  void ExecuteDiseqc(const cDiseqc *Diseqc, int *Frequency);
   void ResetToneAndVoltage(void);
   bool SetFrontend(void);
   virtual void Action(void);
@@ -696,7 +696,7 @@
   return positioner;
 }
 
-void cDvbTuner::ExecuteDiseqc(const cDiseqc *Diseqc, unsigned int *Frequency)
+void cDvbTuner::ExecuteDiseqc(const cDiseqc *Diseqc, int *Frequency)
 {
   if (!lnbPowerTurnedOn) {
  CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); // must explicitly turn on LNB power
@@ -806,7 +806,7 @@
 
   SETCMD(DTV_DELIVERY_SYSTEM, frontendType);
   if (frontendType == SYS_DVBS || frontendType == SYS_DVBS2) {
- unsigned int frequency = channel.Frequency();
+ int frequency = channel.Frequency();
  if (Setup.DiSEqC) {
 if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), )) {
frequency -= diseqc->Lof();
@@ -829,7 +829,7 @@
 }
  else {
 int tone = SEC_TONE_OFF;
-if (frequency < (unsigned int)Setup.LnbSLOF) {
+if (frequency < Setup.LnbSLOF) {
frequency -= Setup.LnbFrequLo;
tone = SEC_TONE_OFF;
}
--- remux.c	2016/12/22 12:58:20	4.3
+++ remux.c	2017/01/09 15:05:05
@@ -1629,7 +1629,7 @@
   Div += parser->IFrameTemporalReferenceOffset();
if (Div <= 0)
   Div = 1;
-   uint32_t Delta = ptsValues[0] / Div;
+   int Delta = ptsValues[0] / Div;
// determine frame info:
if (isVideo) {
   if (Delta == 3753)
___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] vdr-2.2.0 compilation fails with gcc7

2017-03-02 Thread Martin Gansser
vdr-2.2.0 compilation fails with gcc7 on Fedora26.

g++ -O3 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 
-mtune=generic -fPIC -Werror=overloaded-virtual -Wno-parentheses -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fPIC -c 
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-DREMOTE_KBD -DVDR_USER="vdr" -DSDNOTIFY -DLIRC_DEVICE="/var/run/lirc/lircd" 
-DVIDEODIR="/var/lib/vdr/video" -DCONFDIR="/etc/vdr" 
-DARGSDIR="/etc/vdr/conf.d" -DCACHEDIR="/var/cache/vdr" 
-DRESDIR="/usr/share/vdr" -DPLUGINDIR="/usr/lib64/vdr" 
-DLOCDIR="/usr/share/locale" -I/usr/include/freetype2 -I/usr/include/libpng16   
 -o dvbdevice.o dvbdevice.c
dvbdevice.c: In member function 'bool cDvbTuner::SetFrontend()':
dvbdevice.c:851:31: error: call of overloaded 'abs(unsigned int&)' is ambiguous
  frequency = abs(frequency); // Allow for C-band, where the frequency is 
less than the LOF
   ^
the full build.log file:
https://kojipkgs.fedoraproject.org/work/tasks/3857/18133857/build.log

corrected with the following patch, but i know that's not a good solution, 
because i am not a software developer.

--- a/dvbdevice.c.orig  2017-02-15 15:46:26.642238239 +0100
+++ b/dvbdevice.c   2017-02-15 15:46:51.820575674 +0100
@@ -848,7 +848,7 @@
 CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt));
 CHECK(ioctl(fd_frontend, FE_SET_TONE, tone));
 }
- frequency = abs(frequency); // Allow for C-band, where the frequency is 
less than the LOF
+ frequency = abs(int(frequency)); // Allow for C-band, where the frequency 
is less than the LOF
 
  // DVB-S/DVB-S2 (common parts)
  SETCMD(DTV_FREQUENCY, frequency * 1000UL);

Porting to GCC 7:
https://gcc.gnu.org/gcc-7/porting_to.html#cmath

can somebody help me to correct this ?

___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr