patch [#31265] Warning Fixes 02/05/2012
authorCampbell Barton <ideasman42@gmail.com>
Sat, 26 May 2012 10:05:22 +0000 (10:05 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 26 May 2012 10:05:22 +0000 (10:05 +0000)
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
source/blender/quicktime/quicktime_import.h
source/gameengine/VideoTexture/VideoFFmpeg.cpp

index f3e71feec58eba7662bf5f2806c15f00a631d78e..c765e15ef51b321e9e9489dc81ce271117079902 100644 (file)
@@ -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;
index e6f3c821b85a3d073a14cdc4eb53f49bb60eb0dd..19bdbb4814c03facfbe0b9aba261a2eaff80cc08 100644 (file)
@@ -61,7 +61,7 @@
 #endif /* _WIN32 _ */
 
 
-char *get_valid_qtname(char *name);
+char *get_valid_qtname(const char *name);
 
 
 // quicktime movie import functions
index 99f2431ac1eb54fabe47ac69777fc3556a89990a..74f1d9ee5f3d1b7e1c3303a556e1cf27ca54eebc 100644 (file)
@@ -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;