diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2009-09-06 17:20:05 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2009-09-06 17:20:05 +0400 |
commit | fb649d5824ccccca544c905209ba64340dc1bded (patch) | |
tree | ac9894e159f91ffe65c41612779711fbc3525cac /source/blender/blenlib | |
parent | 51aa207d200d2cef1cdc7f4e90a6a0f7a4b31c8e (diff) |
* 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.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_fileops.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_winstuff.h | 31 | ||||
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 34 | ||||
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 14 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 15 |
5 files changed, 47 insertions, 49 deletions
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index d2dd40b21a5..0c1cdbc4d3a 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -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); diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index fad45f1b6c3..b46ebebacd5 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -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 diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 6c89afe7173..cadf8d2bdd1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -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 diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 0228032df01..e7dc9b0eb1f 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -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 diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 7cbef85b938..cdc5cec705f 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -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" |