thumbs.c: warning fixes
authorAndrea Weikert <elubie@gmx.net>
Mon, 17 Sep 2007 10:26:09 +0000 (10:26 +0000)
committerAndrea Weikert <elubie@gmx.net>
Mon, 17 Sep 2007 10:26:09 +0000 (10:26 +0000)
filelist.c: warning fixes

source/blender/imbuf/intern/thumbs.c
source/blender/src/filelist.c

index 944abb6968cf6586fe954facb01bd194a0acc938..c2e30b091c240193f4d3e82ddf6c9045aa1b70bf 100644 (file)
@@ -48,6 +48,7 @@
 #include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */
 #include "BLI_winstuff.h"
 #include <process.h> /* getpid */
 #include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */
 #include "BLI_winstuff.h"
 #include <process.h> /* getpid */
+#include <direct.h> /* chdir */
 #else
 #include <unistd.h>
 #endif
 #else
 #include <unistd.h>
 #endif
@@ -64,8 +65,6 @@
 
 static int get_thumb_dir( char* dir , ThumbSize size)
 {
 
 static int get_thumb_dir( char* dir , ThumbSize size)
 {
-       char* home;
-
 #ifdef WIN32
        /* yes, applications shouldn't store data there, but so does GIMP :)*/
        SHGetSpecialFolderPath(0, dir, CSIDL_PROFILE, 0);
 #ifdef WIN32
        /* yes, applications shouldn't store data there, but so does GIMP :)*/
        SHGetSpecialFolderPath(0, dir, CSIDL_PROFILE, 0);
@@ -120,7 +119,7 @@ static const unsigned char acceptable[96] = {
   0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
 };
 
   0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
 };
 
-static const char hex[16] = "0123456789abcdef";
+static const char hex[17] = "0123456789abcdef";
 
 /* Note: This escape function works on file: URIs, but if you want to
  * escape something else, please read RFC-2396 */
 
 /* Note: This escape function works on file: URIs, but if you want to
  * escape something else, please read RFC-2396 */
@@ -180,7 +179,7 @@ static int uri_from_filename( const char *dir, const char *file, char *uri )
                        return 0;
                }
                /* on windows, using always uppercase drive/volume letter in uri */
                        return 0;
                }
                /* on windows, using always uppercase drive/volume letter in uri */
-               vol[0] = toupper(dir[0]);
+               vol[0] = (unsigned char)toupper(dir[0]);
                vol[1] = ':';
                vol[2] = '\0';
                strcat(orig_uri, vol);
                vol[1] = ':';
                vol[2] = '\0';
                strcat(orig_uri, vol);
index fbf514ce02d4628c29a9fa378eab2e6535e8af15..23a5e73f7cdc4c63dedb6f3ccb0a16e76d4d829c 100644 (file)
@@ -481,7 +481,7 @@ void BIF_filelist_loadimage(struct FileList* filelist, int index)
                                        scaledy =  ( (float)imb->y/(float)imb->x )*imgwidth;
                                }
                                else {
                                        scaledy =  ( (float)imb->y/(float)imb->x )*imgwidth;
                                }
                                else {
-                                       scaledy = imgheight;
+                                       scaledy = (float)imgheight;
                                        scaledx =  ( (float)imb->x/(float)imb->y )*imgheight;
                                }
                                ex = (short)scaledx;
                                        scaledx =  ( (float)imb->x/(float)imb->y )*imgheight;
                                }
                                ex = (short)scaledx;