* cleaning up warnings (mostly windows). A collection of other warning fixes too...
authorNathan Letwory <nathan@letworyinteractive.com>
Sun, 6 Sep 2009 13:20:05 +0000 (13:20 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Sun, 6 Sep 2009 13:20:05 +0000 (13:20 +0000)
This compiled fine with scons/msvc and scons/mingw (gcc 4.4.0). Please test and report any problems.

30 files changed:
intern/iksolver/intern/TNT/tntmath.h
intern/smoke/intern/tnt/tnt_math_utils.h
intern/string/STR_String.h
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/sound.c
source/blender/blenlib/BLI_fileops.h
source/blender/blenlib/BLI_winstuff.h
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/armature/editarmature_generate.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/imbuf/intern/anim5.c
source/blender/imbuf/intern/hamx.c
source/blender/imbuf/intern/iff.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/writeimage.c
source/blender/python/intern/bpy_interface.c
source/blender/readblenfile/intern/BLO_readblenfile.c
source/blender/windowmanager/intern/wm_files.c
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/VideoTexture/SConscript

index 5773900caf98eadd7ba901fd53e5eb99ad06abd4..55a79e2aba0a6ce013c1f9b248bb2bf60774e3d0 100644 (file)
@@ -35,7 +35,9 @@
 
 // conventional functions required by several matrix algorithms
 
-
+#ifdef _WIN32
+#define hypot _hypot
+#endif
 
 namespace TNT 
 {
index 6e14a1d9b90ba8ae030f1e70da581f0b5830d478..f6aad8eaf38249e3d6e5004c70e2f70446b6df7c 100644 (file)
@@ -4,7 +4,9 @@
 /* needed for fabs, sqrt() below */
 #include <cmath>
 
-
+#ifdef _WIN32
+#define hypot _hypot
+#endif
 
 namespace TNT
 {
index a5e7a0721ec4f4cd5f1d7f8fc333617bce48454e..d8023a06f81b2eb330171329f53e416f7383fdd1 100644 (file)
@@ -54,6 +54,10 @@ using namespace std;
 #include "MEM_guardedalloc.h"
 #endif
 
+#ifdef _WIN32
+#define stricmp _stricmp
+#endif
+
 class STR_String;
 
 typedef  unsigned long dword;
index eb8872c43a57201beca225f1d76992523cbda899..cdb175ed6612bf76d92c29356a5d465b371af792 100644 (file)
 
 #include <time.h>
 
+#ifdef _WIN32
+#define open _open
+#define close _close
+#endif
+
 #include "MEM_guardedalloc.h"
 
 #include "IMB_imbuf_types.h"
index 3e47c1006e53c68426e276e3f1f2f20ca75b3b68..bd0b1a5e36e295e2c7721a07ffa35156d1e6674f 100644 (file)
 #include "BKE_packedFile.h"
 #include "BKE_report.h"
 
+#ifdef _WIN32
+#define open _open
+#define close _close
+#define read _read
+#define write _write
+#endif
+
+
 int seekPackedFile(PackedFile *pf, int offset, int whence)
 {
        int oldseek = -1, seek = 0;
index 3e4297499530ba87c35cfdcd4c8adc059ed86f04..912acc4786f3b6d58b68dc35ea8dcf906963bc29 100644 (file)
 
 
 /* needed for directory lookup */
+/* untitled blend's need getpid for a unique name */
 #ifndef WIN32
   #include <dirent.h>
+#include <unistd.h>
 #else
-  #include "BLI_winstuff.h"
-#endif
-
-/* untitled blend's need getpid for a unique name */
-#ifdef WIN32
 #include <process.h>
-#else
-#include <unistd.h>
-#endif
-
-#ifdef _WIN32
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
+  #include "BLI_winstuff.h"
 #endif
 
 static void ptcache_data_to(void **data, int type, int index, void *to);
index 06ef8a23142d76fa8720c24d9dbf454bf5ee566f..2d5d8dad7a8bc8d97941d3a2f2e98050329d9bd6 100644 (file)
@@ -250,12 +250,12 @@ void sound_free(struct bSound* sound)
 
 void sound_unlink(struct bContext *C, struct bSound* sound)
 {
-       bSound *snd;
        Scene *scene;
        SoundHandle *handle;
 
 // XXX unused currently
 #if 0
+       bSound *snd;
        for(snd = CTX_data_main(C)->sound.first; snd; snd = snd->id.next)
        {
                if(snd->child_sound == sound)
index d2dd40b21a559175a3d50035cb3a554305045409..0c1cdbc4d3a20fa3c608c4a4c917f8abc9819d28 100644 (file)
@@ -36,8 +36,6 @@
 #ifndef BLI_FILEOPS_H
 #define BLI_FILEOPS_H
 
-
-
 void  BLI_recurdir_fileops(char *dirname);
 int BLI_link(char *file, char *to);
 int BLI_is_writable(char *filename);
index fad45f1b6c3e2e7e0affb9d2e4fa732ffb9d07e8..b46ebebacd576e3ebbd3b36b1163720509177d66 100644 (file)
 extern "C" {
 #endif
 
-# ifndef _WIN64
-       #ifndef M_PI
-       #define M_PI            3.14159265358979323846
-       #endif
-       #ifndef M_PI_2
-       #define M_PI_2          1.57079632679489661923
-       #endif
-       #ifndef M_SQRT2
-       #define M_SQRT2         1.41421356237309504880
-       #endif
-       #ifndef M_SQRT1_2
-       #define M_SQRT1_2       0.70710678118654752440
-       #endif
-       #ifndef M_1_PI
-       #define M_1_PI          0.318309886183790671538
-       #endif
-#endif
-
+#define _USE_MATH_DEFINES
 #define MAXPATHLEN MAX_PATH
 
 #ifndef S_ISREG
@@ -92,6 +75,18 @@ extern "C" {
 #define S_ISDIR(x) ((x&S_IFMT) == S_IFDIR)
 #endif
 
+/* defines for using ISO C++ conformant names */
+#define open _open
+#define close _close
+#define write _write
+#define read _read
+#define getcwd _getcwd
+#define chdir _chdir
+#define strdup _strdup
+#define lseek _lseek
+#define getpid _getpid
+#define snprintf _snprintf
+
 #ifndef FREE_WINDOWS
 typedef unsigned int mode_t;
 #endif
index 6c89afe7173f0d366df9a7b3401e8161684086ff..cadf8d2bdd196603d9ef786235b05e4e22621e3c 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* path/file handeling stuff */
+#ifndef WIN32
+  #include <dirent.h>
+  #include <unistd.h>
+#else
+  #include <io.h>
+  #include "BLI_winstuff.h"
+#endif
+
 #include "MEM_guardedalloc.h"
 
 #include "DNA_ID.h" /* Library */
 //XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
 #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE)
 
-/* path/file handeling stuff */
-#ifndef WIN32
-  #include <dirent.h>
-  #include <unistd.h>
-#else
-  #include "BLI_winstuff.h"
-  #include <io.h>
-#endif
 
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <string.h>
 
 #define FILE_MAX                       240
 
index 0228032df01544d42d0572eceaaa67ca3ab1eeeb..e7dc9b0eb1fab686d2168e29a48103b7ea15819e 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <errno.h>
+
 #include "zlib.h"
 
 #ifdef WIN32
-#include "BLI_winstuff.h"
 #include <io.h>
+#include "BLI_winstuff.h"
 #else
 #include <unistd.h> // for read close
 #include <sys/param.h>
 #endif
 
+
 #include "BLI_blenlib.h"
 #include "BLI_storage.h"
 #include "BLI_fileops.h"
 #include "BLI_callbacks.h"
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
 #include "BKE_utildefines.h"
-#include <errno.h>
 
 #include "BLO_sys_types.h" // for intptr_t support
 
index 7cbef85b93881c61bbdd33ffabde0b338f0963fb..cdc5cec705fb714ce879a906c0a8b394a3065b08 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>    
 
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#include <sys/types.h>
-#include <io.h>
-#include <direct.h>
-#endif
-
 #ifndef WIN32
 #include <dirent.h>
 #endif
 #include <malloc.h>
 #endif
 
+#ifdef WIN32
+#include <sys/types.h>
+#include <io.h>
+#include <direct.h>
+#include "BLI_winstuff.h"
+#endif
+
+
 /* lib includes */
 #include "MEM_guardedalloc.h"
 
index 33641a0b0047df59891c5ceb44fe79b80fea78aa..1c21c1817e69f86a9468cc6d974e10b61c83a8b6 100644 (file)
 #include <config.h>
 #endif
 
-#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
-
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
 
+
+#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
+
 #include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
 
 #include "BLO_sys_types.h" // needed for intptr_t
 
+#ifdef _WIN32
+#include "BLI_winstuff.h"
+#endif
+
        /**
         * IDType stuff, I plan to move this
         * out into its own file + prefix, and
index 6a26a71ee3dc766717c3149526d22326522f10b1..0c4835a79b73f3e58586e1103455a29dec71310a 100644 (file)
 
 #include "zlib.h"
 
-#ifdef WIN32
-#include "winsock2.h"
-#include "BLI_winstuff.h"
-#endif
-
 #include <limits.h>
 #include <stdio.h> // for printf fopen fwrite fclose sprintf FILE
 #include <stdlib.h> // for getenv atoi
@@ -46,6 +41,8 @@
     #include <sys/param.h> // for MAXPATHLEN
 #else
     #include <io.h> // for open close read
+#include "winsock2.h"
+#include "BLI_winstuff.h"
 #endif
 
 #include "DNA_anim_types.h"
index c4a94660932b869d7287fef31a1d3b2c0bcc3349..a22e4f66c8d8f191626b49b970302baf2958a752 100644 (file)
@@ -72,23 +72,23 @@ Any case: direct data is ALWAYS after the lib block
 #include <config.h>
 #endif
 
+#include <math.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
 #include "zlib.h"
 
 #ifndef WIN32
 #include <unistd.h>
 #else
 #include "winsock2.h"
-#include "BLI_winstuff.h"
 #include <io.h>
 #include <process.h> // for getpid
+#include "BLI_winstuff.h"
 #endif
 
-#include <math.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
 #include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_action_types.h"
index 6c0eab16af094d68913cd6ff97df4aeab38c2c6b..d327ed34839559e4701b6e90182de441703aa1e9 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <string.h>
 #include <math.h>
+#include <float.h>
 
 #include "MEM_guardedalloc.h"
 
index 549164c23a1689a9b64f1b4ee1702e67983f860e..6c4110c8c371c16d53f5492499138f6b1473dee8 100644 (file)
@@ -34,6 +34,7 @@
 #else
 #include <io.h>
 #include <direct.h>
+#include "BLI_winstuff.h"
 #endif   
 #include "MEM_guardedalloc.h"
 
index 2ef1d3b214d84e10c725bb97fe1034156edfca72..4aa99820a6ef5410e888cbba2c3411e14b9cfdd4 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <float.h>
 
 #include "MEM_guardedalloc.h"
 
index 60480a9f16513c3775305d81a2444c966fb1979d..1567f393d87517d17d721dbbb19d43a2daacba7b 100644 (file)
@@ -74,6 +74,7 @@
 
 #include "ED_curve.h"
 #include "ED_mesh.h"
+#include "ED_particle.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
index b6f29b6a1457e813df68e48c99b7e0b58c92a391..4fe4217cd2ccc03508cc2e12af29bc7c69faf38d 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
                             BLI_countlist BLI_stringdec */
+
 #include "imbuf.h"
 #include "imbuf_patch.h"
 
 
 #include "IMB_anim5.h"
 
+#ifdef _WIN32
+#include <io.h>
+#include "BLI_winstuff.h"
+#endif
+
 typedef struct Anhd{
        unsigned char type, mask;
        unsigned short w, h;
index 2f32d155407ae32c991b30b2537e064a6ebfb37b..258c196fcdf3cfee35e189dee4a17520c92a204a 100644 (file)
 
 #include "BLI_blenlib.h"
 
-#ifdef WIN32
-#include <io.h>
-#endif
-
-
 #include "imbuf.h"
 #include "imbuf_patch.h"
 #include "IMB_imbuf_types.h"
 #include "IMB_ham.h"
 #include "IMB_hamx.h"
 
+#ifdef WIN32
+#include <io.h>
+#include "BLI_winstuff.h"
+#endif
+
 /* actually hard coded endianness */
 #define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3])
 #define GET_LITTLE_LONG(x) (((uchar *) (x))[3] << 24 | ((uchar *) (x))[2] << 16 | ((uchar *) (x))[1] << 8 | ((uchar *) (x))[0])
index c36951730689b467f9cb6c5518a65d1346b4e7cd..5fd823e78c13e2466646f310330fc9f4631c4b16 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-#include <io.h>
-#endif
 #include "BLI_blenlib.h"
 #include "imbuf.h"
 #include "imbuf_patch.h"
 #include "IMB_imbuf_types.h"
 #include "IMB_iff.h"
+#ifdef WIN32
+#include <io.h>
+#include "BLI_winstuff.h"
+#endif
 
 unsigned short imb_start_iff(struct ImBuf *ibuf, int file)
 {
index 86ca43824f3de79e835eb1275e2b207083ba1cdc..6053c5556f16092057f1b069377549d15a9b53e2 100644 (file)
 #include "IMB_thumbs.h"
 #include "IMB_imginfo.h"
 
-
 #include "md5.h"
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
 #ifdef WIN32
 #include <windows.h> /* need to include windows.h so _WIN32_IE is defined  */
 #ifndef _WIN32_IE
 #define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */
 #endif
 #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 */
+#include "BLI_winstuff.h"
 #else
 #include <unistd.h>
 #endif
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-
 #define URI_MAX FILE_MAX*3 + 8
 
 static int get_thumb_dir( char* dir , ThumbSize size)
index 7e1120bf3e452cf18a5f4977e7073031b18ea92b..b3af727190ae28cda07a06e0e7a8fa49fb394157 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
-#include <io.h>
-#endif
-
 #include <stdio.h>
 
 #include "BKE_global.h"
 #include "IMB_bitplanes.h"
 #include "IMB_divers.h"
 
+#ifdef WIN32
+#include <io.h>
+#include "BLI_winstuff.h"
+#endif
 /* added facility to copy with saving non-float rects */
 
 short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags)
index a935b517f77129a6a0e9f2b07033bd9f1dd687fa..a85bcd011a664ef9a93554a05116e3ffb1cc2e8b 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 
-#ifndef WIN32
-#include <dirent.h>
-#else
-#include "BLI_winstuff.h"
-#endif
 
 /* grr, python redefines */
 #ifdef _POSIX_C_SOURCE
 #include "bpy_ui.h"
 #include "bpy_util.h"
 
+#ifndef WIN32
+#include <dirent.h>
+#else
+#include "BLI_winstuff.h"
+#endif
+
 #include "DNA_anim_types.h"
 #include "DNA_space_types.h"
 #include "DNA_text_types.h"
index 40a991ad702e5972f0be8a5e6555a8fcbb41c5d4..5672b9f4cb2b607fd43f613070d4315da88a6d19 100644 (file)
@@ -43,6 +43,7 @@
 
 #ifdef WIN32
 #include <io.h>                // read, open
+#include "BLI_winstuff.h"
 #else // ! WIN32
 #include <unistd.h>            // read
 #endif
index 3921da4f06237702f72b3dacab88101775c7aa2d..a6e38a61e0fde4df17e19f4ed2fdc86c825f62ba 100644 (file)
@@ -37,8 +37,8 @@
 #define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */
 #endif
 #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 "BLI_winstuff.h"
 #else
 #include <unistd.h> /* getpid */
 #endif
index 5e8d6f3cbf0f5da6feca4d9e78ee18b464660e98..1c22d2a0600ec80df88e7206f39ba1f7531108c2 100644 (file)
 #include <config.h>
 #endif
 
-/* This little block needed for linking to Blender... */
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
 
 #include "DNA_object_types.h"
 #include "DNA_property_types.h"
 /* end of blender include block */
 
+
 #include "Value.h"
 #include "VectorValue.h"
 #include "BoolValue.h"
 #include "StringValue.h"
 #include "FloatValue.h"
 #include "KX_GameObject.h"
-//#include "ListValue.h"
 #include "IntValue.h"
 #include "SCA_TimeEventManager.h"
 #include "SCA_IScene.h"
 
+/* This little block needed for linking to Blender... */
+#ifdef WIN32
+#include "BLI_winstuff.h"
+#endif
 
 void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventManager* timemgr,SCA_IScene* scene, bool isInActiveLayer)
 {
index 9e81bcb3871d6d7c2659c58ebf14ee0616ab14df..298d485aaaf22636e4cbc57f7c85516fa014a5cd 100644 (file)
 
 // directory header for py function getBlendFileList
 #include <stdlib.h>
-#ifndef WIN32
-  #include <dirent.h>
-#else
-  #include "BLI_winstuff.h"
-#endif
 
 #ifdef WIN32
 #pragma warning (disable : 4786)
@@ -80,8 +75,6 @@ extern "C" {
 #include "InputParser.h"
 #include "KX_Scene.h"
 
-#include "NG_NetworkScene.h" //Needed for sendMessage()
-
 #include "BL_Shader.h"
 
 #include "KX_PyMath.h"
@@ -111,6 +104,13 @@ extern "C" {
 #include "BLI_blenlib.h"
 #include "GPU_material.h"
 
+#ifndef WIN32
+  #include <dirent.h>
+#else
+  #include "BLI_winstuff.h"
+#endif
+#include "NG_NetworkScene.h" //Needed for sendMessage()
+
 static void setSandbox(TPythonSecurityLevel level);
 
 // 'local' copy of canvas ptr, for window height/width python scripts
index 0d3e495f3e249d20d69811eb2544bea5d8c025be..119bd1c99544037f850bc4a919a1f2bb1d5d8a1d 100644 (file)
@@ -25,6 +25,5 @@ incs += ' ' + env['BF_PYTHON_INC']
 if env['WITH_BF_FFMPEG']:
     defs.append('WITH_FFMPEG')
     incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC']
-    defs.append('__STDC_CONSTANT_MACROS')
 
 env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300,205], cxx_compileflags=env['BGE_CXXFLAGS'])