]> git.tue.mpg.de Git - paraslash.git/commitdiff
aac_afh: Fix clang warning.
authorAndre Noll <maan@systemlinux.org>
Sun, 17 Nov 2013 22:52:15 +0000 (23:52 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 14 Dec 2013 13:48:08 +0000 (14:48 +0100)
Although gcc seems to have no problem with it, clang complains about
illegal characters in string literals of aac_afh.c:

aac_afh.c:114:25: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
if (!atom_cmp(type1, "<A9>ART"))
      ^~~~
aac_afh.c:116:30: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
else if (!atom_cmp(type1, "<A9>alb"))
   ^~~~
aac_afh.c:118:30: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
else if (!atom_cmp(type1, "<A9>nam"))
   ^~~~
aac_afh.c:120:30: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
else if (!atom_cmp(type1, "<A9>cmt"))
   ^~~~
aac_afh.c:122:30: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
else if (!atom_cmp(type1, "<A9>day"))

This patch encodes the offending value as "\xa9" to make clang happy,

aac_afh.c

index 2d04695a84305972c6a4d87b1aef77457a8606ad..1610cb2c12b99f9494af33dabeef747672253b08 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -111,15 +111,15 @@ static void read_tags(unsigned char *buf, size_t buflen, struct afh_info *afhi)
                q = p + ret + ret2 + 8;
                if (q + size2 > buf + buflen)
                        break;
-               if (!atom_cmp(type1, "©ART"))
+               if (!atom_cmp(type1, "\xa9" "ART"))
                        afhi->tags.artist = get_tag(q, size2);
-               else if (!atom_cmp(type1, "©alb"))
+               else if (!atom_cmp(type1, "\xa9" "alb"))
                        afhi->tags.album = get_tag(q, size2);
-               else if (!atom_cmp(type1, "©nam"))
+               else if (!atom_cmp(type1, "\xa9" "nam"))
                        afhi->tags.title = get_tag(q, size2);
-               else if (!atom_cmp(type1, "©cmt"))
+               else if (!atom_cmp(type1, "\xa9" "cmt"))
                        afhi->tags.comment = get_tag(q, size2);
-               else if (!atom_cmp(type1, "©day"))
+               else if (!atom_cmp(type1, "\xa9" "day"))
                        afhi->tags.year = get_tag(q, size2);
                p += size1;
        }