64bit compile clean update

.gitignore expanded with build.32 to allow 2 build directories for windows (believe it, still needed)
Cast added in several places to avoid 64 bit problems.
diff --git a/.gitignore b/.gitignore
index f5c656a..ffac316 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@
 x64/
 x86/
 build/
+build.32/
 bld/
 [Bb]in/
 [Oo]bj/
diff --git a/DocFormats/CMakeLists.txt b/DocFormats/CMakeLists.txt
index b371c09..898e441 100644
--- a/DocFormats/CMakeLists.txt
+++ b/DocFormats/CMakeLists.txt
@@ -48,7 +48,7 @@
     headers/DFCommon.h
     headers/DFCore.h
     headers/DFPlatform.h
-	headers/DFTypes.h)
+    headers/DFTypes.h)
 
 
 ###
diff --git a/DocFormats/platform/3rdparty/w3c-tidy-html5/include/platform.h b/DocFormats/platform/3rdparty/w3c-tidy-html5/include/platform.h
index 2700f52..663cce5 100644
--- a/DocFormats/platform/3rdparty/w3c-tidy-html5/include/platform.h
+++ b/DocFormats/platform/3rdparty/w3c-tidy-html5/include/platform.h
@@ -139,7 +139,7 @@
 
 /* Convenience defines for Windows platforms */
  
-#if defined(WINDOWS) || defined(_WIN32)
+#if defined(_WINDOWS) || defined(_WIN32)
 
 #define WINDOWS_OS
 #ifndef PLATFORM_NAME
@@ -448,7 +448,7 @@
   WINDOWS automatically set by Win16 compilers.
   _WIN32 automatically set by Win32 compilers.
 */
-#if defined(_WIN32) && !defined(__MSL__) && !defined(__BORLANDC__)
+#if defined(_WINDOWS) && !defined(__MSL__) && !defined(__BORLANDC__)
 
 #define futime _futime
 #define fstat _fstat
@@ -467,7 +467,7 @@
   WINDOWS automatically set by Win16 compilers.
   _WIN32 automatically set by Win32 compilers.
 */
-#if defined(_WIN32) && !defined(__MSL__) && !defined(__BORLANDC__)
+#if defined(_WINDOWS) && !defined(__MSL__) && !defined(__BORLANDC__)
 
 #ifndef __WATCOMC__
 #define fileno _fileno
@@ -489,7 +489,7 @@
 
 #endif /* _WIN32 */
 
-#if defined(_WIN32)
+#if defined(_WINDOWS)
 
 #if (defined(_USRDLL) || defined(_WINDLL)) && !defined(TIDY_EXPORT)
 #define TIDY_EXPORT __declspec( dllexport ) 
@@ -514,7 +514,7 @@
 # undef uint
 typedef unsigned int uint;
 #endif
-#if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) || defined(_WIN32)
+#if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) || defined(_WINDOWS)
 # undef ulong
 typedef unsigned long ulong;
 #endif
diff --git a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.c b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.c
index af22644..2aedd88 100755
--- a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.c
+++ b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.c
@@ -96,7 +96,7 @@
 #endif
 
 
-#if defined(_WIN32)
+#if defined(_WINDOWS)
 #include "streamio.h"
 #include "tidy-int.h"
 #include "message.h"
diff --git a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.h b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.h
index 74ec059..6c6a374 100755
--- a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.h
+++ b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/mappedio.h
@@ -8,7 +8,7 @@
 
 */
 
-#if defined(_WIN32)
+#if defined(_WINDOWS)
 int TY_(DocParseFileWithMappedFile)( TidyDocImpl* doc, ctmbstr filnam );
 #endif
 
diff --git a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/tidylib.c b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/tidylib.c
index 351eac0..9aa0bf1 100644
--- a/DocFormats/platform/3rdparty/w3c-tidy-html5/src/tidylib.c
+++ b/DocFormats/platform/3rdparty/w3c-tidy-html5/src/tidylib.c
@@ -848,7 +848,7 @@
 
 int   tidyDocParseFile( TidyDocImpl* doc, ctmbstr filnam )
 {
-#ifdef _WIN32
+#ifdef _WINDOWS
     return TY_(DocParseFileWithMappedFile)( doc, filnam );
 #else
     int status = -ENOENT;
@@ -1010,7 +1010,7 @@
 
 #if !defined(NO_SETMODE_SUPPORT)
 
-#if defined(_WIN32) || defined(OS2_OS)
+#if defined(_WINDOWS) || defined(OS2_OS)
 #include <fcntl.h>
 #include <io.h>
 #endif
@@ -1021,7 +1021,7 @@
 {
 #if !defined(NO_SETMODE_SUPPORT)
 
-#if defined(_WIN32) || defined(OS2_OS)
+#if defined(_WINDOWS) || defined(OS2_OS)
     int oldstdoutmode = -1, oldstderrmode = -1;
 #endif
 
@@ -1033,7 +1033,7 @@
 
 #if !defined(NO_SETMODE_SUPPORT)
 
-#if defined(_WIN32) || defined(OS2_OS)
+#if defined(_WINDOWS) || defined(OS2_OS)
     oldstdoutmode = setmode( fileno(stdout), _O_BINARY );
     oldstderrmode = setmode( fileno(stderr), _O_BINARY );
 #endif
@@ -1048,7 +1048,7 @@
 
 #if !defined(NO_SETMODE_SUPPORT)
 
-#if defined(_WIN32) || defined(OS2_OS)
+#if defined(_WINDOWS) || defined(OS2_OS)
     if ( oldstdoutmode != -1 )
         oldstdoutmode = setmode( fileno(stdout), oldstdoutmode );
     if ( oldstderrmode != -1 )
diff --git a/DocFormats/platform/src/Win32.c b/DocFormats/platform/src/Win32.c
index 43cdbb2..d02f304 100755
--- a/DocFormats/platform/src/Win32.c
+++ b/DocFormats/platform/src/Win32.c
@@ -19,7 +19,7 @@
 
 // This file contains functions that are applicable to Windows
 
-#ifdef WIN32
+#ifdef _WINDOWS
 
 #include <windows.h>
 #include <SDL_image.h>
@@ -141,7 +141,7 @@
 int DFGetImageDimensions(const void *data, size_t len, const char *ext,
                          unsigned int *width, unsigned int *height, char **errmsg)
 {
-    SDL_Surface *image = IMG_Load_RW(SDL_RWFromMem((void *)data,len),1);
+    SDL_Surface *image = IMG_Load_RW(SDL_RWFromMem((void *)data,(int)len),1);
     if (image == NULL) {
         if (errmsg != NULL)
             *errmsg = xstrdup(IMG_GetError());