Added some missing 'const' keywords to avoid compilation errors with gcc 4.4 (backport from version 1.7.8)

This commit is contained in:
Klaus Schmidinger 2012-02-14 13:53:38 +01:00
parent 17485ccc96
commit 6715f40484
4 changed files with 13 additions and 8 deletions

View File

@ -2367,3 +2367,5 @@ Winfried K
Ralf Schueler <dl4mw@schueler.ws> Ralf Schueler <dl4mw@schueler.ws>
for backporting "Changed cDvbDevice::GrabImage() to use V4L" from version 1.7.3 for backporting "Changed cDvbDevice::GrabImage() to use V4L" from version 1.7.3
to 1.6.0-3 to 1.6.0-3
for backporting "Added some missing 'const' keywords to avoid compilation errors
with gcc 4.4" from version 1.7.8 to 1.6.0-3

View File

@ -5763,3 +5763,5 @@ Video Disk Recorder Revision History
- Changed cDvbDevice::GrabImage() to use V4L2 - Changed cDvbDevice::GrabImage() to use V4L2
(backport from version 1.7.3, thanks to Ralf Schueler). (backport from version 1.7.3, thanks to Ralf Schueler).
- Added some missing 'const' keywords to avoid compilation errors with gcc 4.4
(backport from version 1.7.8, thanks to Ralf Schueler).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.162 2008/02/24 10:28:53 kls Exp $ * $Id: recording.c 1.162.1.1 2012/02/14 13:47:29 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -509,8 +509,8 @@ cRecording::cRecording(cTimer *Timer, const cEvent *Event)
Utf8Strn0Cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH); Utf8Strn0Cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH);
Subtitle = SubtitleBuffer; Subtitle = SubtitleBuffer;
} }
char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE); const char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE);
char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE); const char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE);
if (macroTITLE || macroEPISODE) { if (macroTITLE || macroEPISODE) {
name = strdup(Timer->File()); name = strdup(Timer->File());
name = strreplace(name, TIMERMACRO_TITLE, Title); name = strreplace(name, TIMERMACRO_TITLE, Title);
@ -551,7 +551,7 @@ cRecording::cRecording(const char *FileName)
sortBuffer = NULL; sortBuffer = NULL;
fileName = strdup(FileName); fileName = strdup(FileName);
FileName += strlen(VideoDirectory) + 1; FileName += strlen(VideoDirectory) + 1;
char *p = strrchr(FileName, '/'); const char *p = strrchr(FileName, '/');
name = NULL; name = NULL;
info = new cRecordingInfo; info = new cRecordingInfo;

View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.109.1.1 2008/05/02 14:29:16 kls Exp $ * $Id: svdrp.c 1.109.1.2 2012/02/14 13:52:35 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -736,7 +736,7 @@ void cSVDRP::CmdGRAB(const char *Option)
char *strtok_next; char *strtok_next;
FileName = strtok_r(p, delim, &strtok_next); FileName = strtok_r(p, delim, &strtok_next);
// image type: // image type:
char *Extension = strrchr(FileName, '.'); const char *Extension = strrchr(FileName, '.');
if (Extension) { if (Extension) {
if (strcasecmp(Extension, ".jpg") == 0 || strcasecmp(Extension, ".jpeg") == 0) if (strcasecmp(Extension, ".jpg") == 0 || strcasecmp(Extension, ".jpeg") == 0)
Jpeg = true; Jpeg = true;
@ -795,8 +795,9 @@ void cSVDRP::CmdGRAB(const char *Option)
char RealFileName[PATH_MAX]; char RealFileName[PATH_MAX];
if (FileName) { if (FileName) {
if (grabImageDir) { if (grabImageDir) {
cString s; cString s(FileName);
char *slash = strrchr(FileName, '/'); FileName = s;
const char *slash = strrchr(FileName, '/');
if (!slash) { if (!slash) {
s = AddDirectory(grabImageDir, FileName); s = AddDirectory(grabImageDir, FileName);
FileName = s; FileName = s;