[nut]: r549 - src/trunk/libnut/framecode.c

Author: ods15 Date: Sat Feb 2 13:25:06 2008 New Revision: 549 Log: Warning fixes Modified: src/trunk/libnut/framecode.c Modified: src/trunk/libnut/framecode.c ============================================================================== --- src/trunk/libnut/framecode.c (original) +++ src/trunk/libnut/framecode.c Sat Feb 2 13:25:06 2008 @@ -41,11 +41,11 @@ void nut_framecode_generate(const nut_st fti[n++] = (fti_t){ NUT_FLAG_KEY| FLAG_SIZE_MSB, 1, i, 1, 0, 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_CHECKSUM|FLAG_SIZE_MSB, 1, i, 1, 0, 1 }; fti[n++] = (fti_t){ FLAG_CODED_PTS|FLAG_SIZE_MSB, 0, i, 1, 0, 1 }; - if (s[i].fourcc_len == 4 && !strncmp(s[i].fourcc, "mp4v", 4)) { + if (s[i].fourcc_len == 4 && !strncmp((char*)s[i].fourcc, "mp4v", 4)) { fti[n++] = (fti_t){ 0, 1, i, 7, 6, 1 }; fti[n++] = (fti_t){ 0, 2, i, 7, 6, 1 }; consume[i] = e_consume_mpeg4; - } else if (s[i].fourcc_len == 4 && !strncmp(s[i].fourcc, "h264", 4)) { + } else if (s[i].fourcc_len == 4 && !strncmp((char*)s[i].fourcc, "h264", 4)) { consume[i] = e_consume_h264; } else { consume[i] = e_consume_video; @@ -54,13 +54,13 @@ void nut_framecode_generate(const nut_st case NUT_AUDIO_CLASS: fti[n++] = (fti_t){NUT_FLAG_KEY| FLAG_SIZE_MSB, 1, i, 1, 0, 1 }; fti[n++] = (fti_t){NUT_FLAG_KEY|FLAG_CODED_PTS|FLAG_SIZE_MSB, 0, i, 1, 0, 1 }; - if (s[i].fourcc_len == 4 && !strncmp(s[i].fourcc, "mp3 ", 4)) { + if (s[i].fourcc_len == 4 && !strncmp((char*)s[i].fourcc, "mp3 ", 4)) { int j, a[] = {288,336,384,480,576,672,768,960}; for (j = 0; j < sizeof a/sizeof*a; j++) fti[n++] = (fti_t){ NUT_FLAG_KEY, 1, i, a[j]+1, a[j], 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_SIZE_MSB, 1, i, 4, 0, 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_SIZE_MSB, 1, i, 4, 2, 1 }; - } else if (s[i].fourcc_len == 4 && !strncmp(s[i].fourcc, "vrbs", 4)) { + } else if (s[i].fourcc_len == 4 && !strncmp((char*)s[i].fourcc, "vrbs", 4)) { fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_SIZE_MSB, 2, i, 1, 0, 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_SIZE_MSB, 9, i, 1, 0, 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_SIZE_MSB, 23, i, 1, 0, 1 };

On Sat, Feb 02, 2008 at 01:25:07PM +0100, ods15 wrote:
Author: ods15 Date: Sat Feb 2 13:25:06 2008 New Revision: 549
Log: Warning fixes
Modified: src/trunk/libnut/framecode.c
Modified: src/trunk/libnut/framecode.c ============================================================================== --- src/trunk/libnut/framecode.c (original) +++ src/trunk/libnut/framecode.c Sat Feb 2 13:25:06 2008 @@ -41,11 +41,11 @@ void nut_framecode_generate(const nut_st fti[n++] = (fti_t){ NUT_FLAG_KEY| FLAG_SIZE_MSB, 1, i, 1, 0, 1 }; fti[n++] = (fti_t){ NUT_FLAG_KEY|FLAG_CHECKSUM|FLAG_SIZE_MSB, 1, i, 1, 0, 1 }; fti[n++] = (fti_t){ FLAG_CODED_PTS|FLAG_SIZE_MSB, 0, i, 1, 0, 1 }; - if (s[i].fourcc_len == 4 && !strncmp(s[i].fourcc, "mp4v", 4)) { + if (s[i].fourcc_len == 4 && !strncmp((char*)s[i].fourcc, "mp4v", 4)) {
I strongly dislike this sort of change. Pointer signedness warnings are idiotic and should be disabled. Rich

Rich Felker wrote:
I strongly dislike this sort of change. Pointer signedness warnings are idiotic and should be disabled.
fixing properly and keeping in mind unsigned char != signed char != char would be better. lu -- Luca Barbato Gentoo Council Member Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero

On Sat, Feb 02, 2008 at 08:49:01PM +0100, Luca Barbato wrote:
Rich Felker wrote:
I strongly dislike this sort of change. Pointer signedness warnings are idiotic and should be disabled.
fixing properly and keeping in mind unsigned char != signed char != char would be better.
That's orthogonal to the issue at hand here. The function takes a const char * argument but operates on arbitrary bytes. However memcmp is probably the appropriate function to use, but it has the same issue. What one really needs to realize is that signed/unsigned is a property of arithmetic operations performed on data, NOT a property of the data itself. C made a very bad design choice in making these properties of the types. Ignoring the difference between pointers to unsigned and signed versions of the same type is completely valid and often useful and it's annoying that gcc spams warnings about it. Rich
participants (3)
-
Luca Barbato
-
ods15
-
Rich Felker