small patch to compil vdr-1.7.8 with gcc-4.4.0

Message ID 20090714102247.GI2505@gmail.com
State New
Headers

Commit Message

Grégoire Favre July 14, 2009, 10:22 a.m. UTC
  Hello,

today I (finally...) took some time to compil the "new" VDR but it
failed, with this change it compil :


Sorry if I missed something already posted for vdr-1.7.8 here and have a
great day,
  

Comments

Matthias Schwarzott July 14, 2009, 10:33 a.m. UTC | #1
On Dienstag, 14. Juli 2009, Gregoire Favre wrote:
> Hello,
>
> today I (finally...) took some time to compil the "new" VDR but it
> failed, with this change it compil :
>
> --- recording.c~	2009-07-13 21:45:05.000000000 +0200
> +++ recording.c	2009-07-13 21:51:51.000000000 +0200
> @@ -1217,7 +1217,8 @@
>    if (recording) {
>       cThreadLock DeletedRecordingsLock(&DeletedRecordings);
>       Del(recording, false);
> -     char *ext = strrchr(recording->FileName(), '.');
> +     //char *ext = strrchr(recording->FileName(), '.');
> +     char *ext = strrchr(const_cast<char *>(recording->FileName()), '.');
>       if (ext) {
>          strncpy(ext, DELEXT, strlen(ext));
>          recording->fileSizeMB = DirSizeMB(recording->FileName());
>
> Sorry if I missed something already posted for vdr-1.7.8 here and have a
> great day,

Well, but why not having a look at the other gcc-4.4 patches for different 
vdr-versions, and just use the not const recording->fileName member?
This can be done, as cRecordings is a friend of cRecording.

-     char *ext = strrchr(recording->FileName(), '.');
+     char *ext = strrchr(recording->fileName, '.');

Regards
Matthias
  
Grégoire Favre July 14, 2009, 11:23 a.m. UTC | #2
On Tue, Jul 14, 2009 at 12:33:47PM +0200, Matthias Schwarzott wrote:

> Well, but why not having a look at the other gcc-4.4 patches for different 
> vdr-versions, and just use the not const recording->fileName member?
> This can be done, as cRecordings is a friend of cRecording.
> 
> -     char *ext = strrchr(recording->FileName(), '.');
> +     char *ext = strrchr(recording->fileName, '.');

Oh, very nice, I didn't look at the patch for older VDR, of course it's
better this way :-)

Thanks.
  

Patch

--- recording.c~	2009-07-13 21:45:05.000000000 +0200
+++ recording.c	2009-07-13 21:51:51.000000000 +0200
@@ -1217,7 +1217,8 @@ 
   if (recording) {
      cThreadLock DeletedRecordingsLock(&DeletedRecordings);
      Del(recording, false);
-     char *ext = strrchr(recording->FileName(), '.');
+     //char *ext = strrchr(recording->FileName(), '.');
+     char *ext = strrchr(const_cast<char *>(recording->FileName()), '.');
      if (ext) {
         strncpy(ext, DELEXT, strlen(ext));
         recording->fileSizeMB = DirSizeMB(recording->FileName());