[MPlayer-cvslog] r38671 - in trunk/sub: subreader.c subreader.h

al subversion at mplayerhq.hu
Mon Jan 6 22:56:52 EET 2025


Author: al
Date: Mon Jan  6 22:56:52 2025
New Revision: 38671

Log:
sub/subreader: Use matching pointer type for enca_sub_cp

The guess_cp function returns `const char *`, so we should
use the same type for enca_sub_cp as well.

Avoids this warning:

```
sub/subreader.c: In function 'subcp_open':
sub/subreader.c:1287:33: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1287 |                     enca_sub_cp = guess_cp(st, enca_lang, enca_fallback);
      |
```

Modified:
   trunk/sub/subreader.c
   trunk/sub/subreader.h

Modified: trunk/sub/subreader.c
==============================================================================
--- trunk/sub/subreader.c	Mon Jan  6 22:54:19 2025	(r38670)
+++ trunk/sub/subreader.c	Mon Jan  6 22:56:52 2025	(r38671)
@@ -55,7 +55,7 @@
 #include <iconv.h>
 #endif
 char *sub_cp=NULL;
-char *enca_sub_cp=NULL;
+const char *enca_sub_cp=NULL;
 #ifdef CONFIG_FRIBIDI
 #include <fribidi/fribidi.h>
 char *fribidi_charset = NULL;   ///character set that will be passed to FriBiDi

Modified: trunk/sub/subreader.h
==============================================================================
--- trunk/sub/subreader.h	Mon Jan  6 22:54:19 2025	(r38670)
+++ trunk/sub/subreader.h	Mon Jan  6 22:56:52 2025	(r38671)
@@ -33,7 +33,7 @@ extern int sub_no_text_pp;  // disable t
 extern int sub_match_fuzziness;
 extern int sub_format;
 extern char *sub_cp;
-extern char *enca_sub_cp;
+extern const char *enca_sub_cp;
 
 // subtitle formats
 #define SUB_INVALID   -1


More information about the MPlayer-cvslog mailing list