clang: fix all warnings except deprecations

This commit is contained in:
Stefano Pigozzi 2012-11-12 23:24:01 +01:00
parent 9203f06cf3
commit bec630c347
8 changed files with 17 additions and 7 deletions

2
configure vendored
View File

@ -1162,7 +1162,7 @@ if test -z "$CFLAGS" ; then
WARNFLAGS="-wd167 -wd556 -wd144"
elif test "$cc_vendor" = "clang"; then
CFLAGS="$_opt $_debug $_profile $_march $_pipe"
WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
WARNFLAGS="-Wall -Wno-switch -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
ERRORFLAGS="-Werror=implicit-function-declaration"
elif test "$cc_vendor" != "gnu" ; then
CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe"

View File

@ -1079,7 +1079,7 @@ static void print_status(struct MPContext *mpctx, double a_pos, bool at_frame)
mpctx->last_av_difference = MP_NOPTS_VALUE;
if (mpctx->last_av_difference > 0.5 && drop_frame_cnt > 50
&& !mpctx->drop_message_shown) {
mp_tmsg(MSGT_AVSYNC, MSGL_WARN, mp_gtext(av_desync_help_text));
mp_tmsg(MSGT_AVSYNC, MSGL_WARN, "%s", mp_gtext(av_desync_help_text));
mpctx->drop_message_shown = true;
}
}
@ -3771,7 +3771,9 @@ static void play_current_file(struct MPContext *mpctx)
mpctx->stream->start_pos += seek_to_byte;
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
#ifdef CONFIG_DVBIN
goto_enable_cache:
#endif
if (opts->stream_cache_size > 0) {
int res = stream_enable_cache_percent(mpctx->stream,
opts->stream_cache_size,

View File

@ -322,11 +322,12 @@ void build_edl_timeline(struct MPContext *mpctx)
else if (!parts[i].duration)
anything_done = true;
parts[i].duration = duration;
if (duration && parts[i].src.start < 0)
if (duration && parts[i].src.start < 0) {
if (parts[i].src.end < 0)
missing_srcstart = i;
else
parts[i].src.start = parts[i].src.end - duration;
}
}
if (!anything_done) {
if (missing_duration >= 0) {

View File

@ -188,7 +188,7 @@ static int spudec_alloc_image(spudec_handle_t *this, int stride, int height)
static void setup_palette(spudec_handle_t *spu, uint32_t palette[256])
{
memset(palette, 0, sizeof(palette));
memset(palette, 0, sizeof(*palette) * 256);
struct mp_csp_params csp = MP_CSP_PARAMS_DEFAULTS;
csp.int_bits_in = 8;
csp.int_bits_out = 8;

View File

@ -58,7 +58,10 @@ typedef void TALLOC_CTX;
/* try to make talloc_set_destructor() and talloc_steal() type safe,
if we have a recent gcc */
#if (__GNUC__ >= 3)
#if defined(__clang__) && defined(__llvm__)
#define _TALLOC_TYPEOF(ptr) void *
#define talloc_steal(ctx, ptr) _talloc_steal((ctx),(ptr))
#elif (__GNUC__ >= 3)
#define _TALLOC_TYPEOF(ptr) __typeof__(ptr)
/* this extremely strange macro is to avoid some braindamaged warning
stupidity in gcc 4.1.x */

View File

@ -250,8 +250,11 @@
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
#define GLX_CONTEXT_FLAGS_ARB 0x2094
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
#ifndef __APPLE__
// These are respectively 0x00000001 and 0x00000002 on OSX
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
#endif
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#endif

View File

@ -330,8 +330,9 @@ static CFStringRef get_cv_csp_matrix(struct vo *vo)
return kCVImageBufferYCbCrMatrix_ITU_R_709_2;
case MP_CSP_SMPTE_240M:
return kCVImageBufferYCbCrMatrix_SMPTE_240M_1995;
default:
return kCVImageBufferYCbCrMatrix_ITU_R_601_4;
}
return kCVImageBufferYCbCrMatrix_ITU_R_601_4;
}
static void set_yuv_colorspace(struct vo *vo)

View File

@ -2208,7 +2208,7 @@ static int preinit(struct vo *vo, const char *arg)
};
if (subopt_parse(arg, subopts) != 0) {
mp_msg(MSGT_VO, MSGL_FATAL, help_text);
mp_msg(MSGT_VO, MSGL_FATAL, "%s", help_text);
goto err_out;
}