* cleaning up warnings (mostly windows). A collection of other warning fixes too (undefined function, assuming int, etc.)

This compiled fine with scons/msvc and scons/mingw (gcc 4.4.0). Please test and report any problems.
This commit is contained in:
Nathan Letwory
2009-09-06 13:20:05 +00:00
parent 51aa207d20
commit fb649d5824
30 changed files with 143 additions and 122 deletions

View File

@@ -35,7 +35,9 @@
// conventional functions required by several matrix algorithms
#ifdef _WIN32
#define hypot _hypot
#endif
namespace TNT
{

View File

@@ -4,7 +4,9 @@
/* needed for fabs, sqrt() below */
#include <cmath>
#ifdef _WIN32
#define hypot _hypot
#endif
namespace TNT
{

View 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;

View File

@@ -38,6 +38,11 @@
#include <time.h>
#ifdef _WIN32
#define open _open
#define close _close
#endif
#include "MEM_guardedalloc.h"
#include "IMB_imbuf_types.h"

View File

@@ -63,6 +63,14 @@
#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;

View File

@@ -67,23 +67,13 @@
/* needed for directory lookup */
/* untitled blend's need getpid for a unique name */
#ifndef WIN32
#include <dirent.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
#else
#include <process.h>
#include "BLI_winstuff.h"
#endif
static void ptcache_data_to(void **data, int type, int index, void *to);

View 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)

View 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);

View File

@@ -65,24 +65,7 @@
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

View File

@@ -26,6 +26,24 @@
* ***** 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 */
@@ -53,23 +71,7 @@
//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

View File

@@ -31,27 +31,29 @@
#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

View File

@@ -33,13 +33,6 @@
#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
@@ -82,6 +75,14 @@
#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"

View File

@@ -32,13 +32,14 @@
#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"
@@ -67,6 +68,10 @@
#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

View File

@@ -29,11 +29,6 @@
#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"

View 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"

View File

@@ -30,6 +30,7 @@
#include <string.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"

View File

@@ -34,6 +34,7 @@
#else
#include <io.h>
#include <direct.h>
#include "BLI_winstuff.h"
#endif
#include "MEM_guardedalloc.h"

View File

@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"

View 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"

View 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"
@@ -46,6 +47,11 @@
#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;

View File

@@ -31,11 +31,6 @@
#include "BLI_blenlib.h"
#ifdef WIN32
#include <io.h>
#endif
#include "imbuf.h"
#include "imbuf_patch.h"
#include "IMB_imbuf_types.h"
@@ -46,6 +41,11 @@
#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])

View File

@@ -29,14 +29,15 @@
* $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)
{

View File

@@ -39,31 +39,29 @@
#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)

View File

@@ -29,10 +29,6 @@
* $Id$
*/
#ifdef WIN32
#include <io.h>
#endif
#include <stdio.h>
#include "BKE_global.h"
@@ -71,6 +67,10 @@
#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)

View File

@@ -28,11 +28,6 @@
#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
@@ -48,6 +43,12 @@
#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"

View File

@@ -43,6 +43,7 @@
#ifdef WIN32
#include <io.h> // read, open
#include "BLI_winstuff.h"
#else // ! WIN32
#include <unistd.h> // read
#endif

View 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

View File

@@ -32,26 +32,26 @@
#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)
{

View File

@@ -32,11 +32,6 @@
// 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

View 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'])