From e727056c2e34857dd5556e66c9858506eb63e987 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 May 2012 10:05:22 +0000 Subject: [PATCH] patch [#31265] Warning Fixes 02/05/2012 from Jason Wilkins (jwilkins) only applied some parts: * const correctness * moved a variable into a move local scope so it is also inside a #if/endif and does not end up conditionally unused --- source/blender/quicktime/apple/quicktime_import.c | 2 +- source/blender/quicktime/quicktime_import.h | 2 +- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c index f3e71feec58..c765e15ef51 100644 --- a/source/blender/quicktime/apple/quicktime_import.c +++ b/source/blender/quicktime/apple/quicktime_import.c @@ -136,7 +136,7 @@ void quicktime_exit(void) #ifdef _WIN32 -char *get_valid_qtname(char *name) +const char *get_valid_qtname(char *name) { TCHAR Buffer[MAX_PATH]; DWORD dwRet; diff --git a/source/blender/quicktime/quicktime_import.h b/source/blender/quicktime/quicktime_import.h index e6f3c821b85..19bdbb4814c 100644 --- a/source/blender/quicktime/quicktime_import.h +++ b/source/blender/quicktime/quicktime_import.h @@ -61,7 +61,7 @@ #endif /* _WIN32 _ */ -char *get_valid_qtname(char *name); +char *get_valid_qtname(const char *name); // quicktime movie import functions diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 99f2431ac1e..74f1d9ee5f3 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -588,7 +588,7 @@ void VideoFFmpeg::openCam (char * file, short camIdx) AVInputFormat *inputFormat; AVFormatParameters formatParams; AVRational frameRate; - char *p, filename[28], rateStr[20]; + char filename[28], rateStr[20]; do_init_ffmpeg(); @@ -630,6 +630,8 @@ void VideoFFmpeg::openCam (char * file, short camIdx) return; if (file && strncmp(file, "/dev", 4) == 0) { + char *p; + // user does not specify a driver strncpy(filename, file, sizeof(filename)); filename[sizeof(filename)-1] = 0;