[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16147] trunk/blender: Win64: please check my changes if you ran across them ; ) But should be fine since no additional crashes were reported!

Daniel Genrich daniel.genrich at gmx.net
Sun Aug 17 19:08:01 CEST 2008


Revision: 16147
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16147
Author:   genscher
Date:     2008-08-17 19:08:00 +0200 (Sun, 17 Aug 2008)

Log Message:
-----------
Win64: please check my changes if you ran across them ;) But should be fine since no additional crashes were reported!

Modified Paths:
--------------
    trunk/blender/intern/guardedalloc/intern/mallocn.c
    trunk/blender/intern/guardedalloc/intern/mmap_win.c
    trunk/blender/intern/guardedalloc/mmap_win.h
    trunk/blender/intern/opennl/superlu/smemory.c
    trunk/blender/release/datafiles/datatoc.c
    trunk/blender/source/blender/blenkernel/BKE_customdata.h
    trunk/blender/source/blender/blenkernel/BKE_endian.h
    trunk/blender/source/blender/blenkernel/BKE_utildefines.h
    trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/blenkernel/intern/cloth.c
    trunk/blender/source/blender/blenkernel/intern/displist.c
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/blenkernel/intern/implicit.c
    trunk/blender/source/blender/blenlib/BLI_editVert.h
    trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
    trunk/blender/source/blender/blenlib/intern/fileops.c
    trunk/blender/source/blender/blenlib/intern/psfont.c
    trunk/blender/source/blender/blenlib/intern/util.c
    trunk/blender/source/blender/blenpluginapi/intern/pluginapi.c
    trunk/blender/source/blender/imbuf/intern/cineon/cineonlib.c
    trunk/blender/source/blender/imbuf/intern/cineon/dpxlib.c
    trunk/blender/source/blender/imbuf/intern/cineon/logImageCore.h
    trunk/blender/source/blender/imbuf/intern/cineon/logmemfile.c
    trunk/blender/source/blender/imbuf/intern/cineon/logmemfile.h
    trunk/blender/source/blender/imbuf/intern/scaling.c
    trunk/blender/source/blender/include/BIF_meshtools.h
    trunk/blender/source/blender/makesdna/intern/makesdna.c
    trunk/blender/source/blender/radiosity/CMakeLists.txt
    trunk/blender/source/blender/radiosity/SConscript
    trunk/blender/source/blender/radiosity/intern/source/Makefile
    trunk/blender/source/blender/radiosity/intern/source/radnode.c
    trunk/blender/source/blender/radiosity/intern/source/radpreprocess.c
    trunk/blender/source/blender/render/CMakeLists.txt
    trunk/blender/source/blender/render/SConscript
    trunk/blender/source/blender/render/intern/include/render_types.h
    trunk/blender/source/blender/render/intern/source/occlusion.c
    trunk/blender/source/blender/render/intern/source/pipeline.c
    trunk/blender/source/blender/render/intern/source/rendercore.c
    trunk/blender/source/blender/render/intern/source/shadbuf.c
    trunk/blender/source/blender/render/intern/source/strand.c
    trunk/blender/source/blender/render/intern/source/zbuf.c
    trunk/blender/source/blender/src/buttons_editing.c
    trunk/blender/source/blender/src/buttons_scene.c
    trunk/blender/source/blender/src/drawmesh.c
    trunk/blender/source/blender/src/drawobject.c
    trunk/blender/source/blender/src/editkey.c
    trunk/blender/source/blender/src/editmesh_mods.c
    trunk/blender/source/blender/src/editmesh_tools.c
    trunk/blender/source/blender/src/header_info.c
    trunk/blender/source/blender/src/header_script.c
    trunk/blender/source/blender/src/interface.c
    trunk/blender/source/blender/src/meshlaplacian.c
    trunk/blender/source/blender/src/meshtools.c
    trunk/blender/source/blender/src/parametrizer.c
    trunk/blender/source/blender/src/parametrizer.h
    trunk/blender/source/blender/src/parametrizer_intern.h
    trunk/blender/source/blender/src/renderwin.c
    trunk/blender/source/blender/src/space.c
    trunk/blender/source/blender/src/toolbox.c
    trunk/blender/source/blender/src/transform_conversions.c
    trunk/blender/source/blender/yafray/intern/export_Plugin.cpp
    trunk/blender/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
    trunk/blender/source/kernel/CMakeLists.txt
    trunk/blender/source/kernel/SConscript
    trunk/blender/source/kernel/gen_system/GEN_HashedPtr.cpp
    trunk/blender/source/kernel/gen_system/Makefile

Added Paths:
-----------
    trunk/blender/intern/guardedalloc/BLO_sys_types.h
    trunk/blender/intern/opennl/superlu/BLO_sys_types.h

Added: trunk/blender/intern/guardedalloc/BLO_sys_types.h
===================================================================
--- trunk/blender/intern/guardedalloc/BLO_sys_types.h	                        (rev 0)
+++ trunk/blender/intern/guardedalloc/BLO_sys_types.h	2008-08-17 17:08:00 UTC (rev 16147)
@@ -0,0 +1,112 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * A platform-independent definition of [u]intXX_t
+ * Plus the accompanying header include for htonl/ntohl
+ *
+ * This file includes <sys/types.h> to define [u]intXX_t types, where
+ * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
+ * file.
+ * - Windows uses __intXX compiler-builtin types. These are signed,
+ *   so we have to flip the signs.
+ * For these rogue platforms, we make the typedefs ourselves.
+ *
+ */
+
+/* 
+// DG: original BLO_sys_types.h is in source/blender/blenkernel 
+// but is not allowed be accessed here because of bad-level-call
+*/
+
+#ifndef BLO_SYS_TYPES_H
+#define BLO_SYS_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef FREE_WINDOWS
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+#endif
+ 
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+
+/* The __intXX are built-in types of the visual complier! So we don't
+ * need to include anything else here. */
+
+typedef signed __int8  int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef signed __int64 int64_t;
+
+typedef unsigned __int8  uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+#ifdef _WIN64
+typedef __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
+#else
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+#endif
+
+#elif defined(__linux__)
+
+	/* Linux-i386, Linux-Alpha, Linux-ppc */
+#include <stdint.h>
+
+#elif defined (__APPLE__)
+
+#include <inttypes.h>
+
+#else
+
+	/* FreeBSD, Irix, Solaris */
+#include <sys/types.h>
+
+#endif /* ifdef platform for types */
+
+#ifdef _WIN32
+#define htonl(x) correctByteOrder(x)
+#define ntohl(x) correctByteOrder(x)
+#elif defined (__FreeBSD__) || defined (__OpenBSD__) 
+#include <sys/param.h>
+#elif defined (__APPLE__)
+#include <sys/types.h>
+#else  /* irix sun linux */
+#include <netinet/in.h>
+#endif /* ifdef platform for htonl/ntohl */
+
+#ifdef __cplusplus 
+}
+#endif
+
+#endif /* eof */
+

Modified: trunk/blender/intern/guardedalloc/intern/mallocn.c
===================================================================
--- trunk/blender/intern/guardedalloc/intern/mallocn.c	2008-08-17 16:36:37 UTC (rev 16146)
+++ trunk/blender/intern/guardedalloc/intern/mallocn.c	2008-08-17 17:08:00 UTC (rev 16147)
@@ -49,6 +49,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLO_sys_types.h" // needed for intptr_t
+
 /* --------------------------------------------------------------------- */
 /* Data definition                                                       */
 /* --------------------------------------------------------------------- */
@@ -112,7 +114,7 @@
 	
 
 volatile int totblock= 0;
-volatile unsigned long mem_in_use= 0, mmap_in_use= 0;
+volatile uintptr_t mem_in_use= 0, mmap_in_use= 0;
 
 static volatile struct localListBase _membase;
 static volatile struct localListBase *membase = &_membase;
@@ -335,7 +337,7 @@
 /* Memory statistics print */
 typedef struct MemPrintBlock {
 	const char *name;
-	unsigned long len;
+	uintptr_t len;
 	int items;
 } MemPrintBlock;
 
@@ -485,14 +487,14 @@
 		return(-1);
 	}
 
-	if(sizeof(long)==8) {
-		if (((long) memh) & 0x7) {
+	if(sizeof(intptr_t)==8) {
+		if (((intptr_t) memh) & 0x7) {
 			MemorY_ErroR("free","attempt to free illegal pointer");
 			return(-1);
 		}
 	}
 	else {
-		if (((long) memh) & 0x3) {
+		if (((intptr_t) memh) & 0x3) {
 			MemorY_ErroR("free","attempt to free illegal pointer");
 			return(-1);
 		}

Modified: trunk/blender/intern/guardedalloc/intern/mmap_win.c
===================================================================
--- trunk/blender/intern/guardedalloc/intern/mmap_win.c	2008-08-17 16:36:37 UTC (rev 16146)
+++ trunk/blender/intern/guardedalloc/intern/mmap_win.c	2008-08-17 17:08:00 UTC (rev 16147)
@@ -151,7 +151,7 @@
 }
 
 /* munmap for windows */
-long munmap(void *ptr, long size)
+intptr_t munmap(void *ptr, intptr_t size)
 {
 	MemMap *mm = mmap_findlink(mmapbase, ptr);
 	if (!mm) {

Modified: trunk/blender/intern/guardedalloc/mmap_win.h
===================================================================
--- trunk/blender/intern/guardedalloc/mmap_win.h	2008-08-17 16:36:37 UTC (rev 16146)
+++ trunk/blender/intern/guardedalloc/mmap_win.h	2008-08-17 17:08:00 UTC (rev 16147)
@@ -45,8 +45,10 @@
 
 #define MAP_FAILED ((void *)-1)
 
+#include "BLO_sys_types.h" // needed for intptr_t
+
 void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset);
-long munmap(void *ptr, long size);
+intptr_t munmap(void *ptr, intptr_t size);
 
 #endif
 

Added: trunk/blender/intern/opennl/superlu/BLO_sys_types.h
===================================================================
--- trunk/blender/intern/opennl/superlu/BLO_sys_types.h	                        (rev 0)
+++ trunk/blender/intern/opennl/superlu/BLO_sys_types.h	2008-08-17 17:08:00 UTC (rev 16147)
@@ -0,0 +1,112 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * A platform-independent definition of [u]intXX_t
+ * Plus the accompanying header include for htonl/ntohl
+ *
+ * This file includes <sys/types.h> to define [u]intXX_t types, where
+ * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
+ * file.
+ * - Windows uses __intXX compiler-builtin types. These are signed,
+ *   so we have to flip the signs.
+ * For these rogue platforms, we make the typedefs ourselves.
+ *
+ */
+
+/* 
+// DG: original BLO_sys_types.h is in source/blender/blenkernel 
+// but is not allowed be accessed here because of bad-level-call
+*/
+
+#ifndef BLO_SYS_TYPES_H
+#define BLO_SYS_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef FREE_WINDOWS
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+#endif
+ 
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+
+/* The __intXX are built-in types of the visual complier! So we don't
+ * need to include anything else here. */
+
+typedef signed __int8  int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef signed __int64 int64_t;
+
+typedef unsigned __int8  uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+#ifdef _WIN64
+typedef __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
+#else
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+#endif
+
+#elif defined(__linux__)
+
+	/* Linux-i386, Linux-Alpha, Linux-ppc */
+#include <stdint.h>
+
+#elif defined (__APPLE__)
+
+#include <inttypes.h>
+
+#else
+
+	/* FreeBSD, Irix, Solaris */
+#include <sys/types.h>
+
+#endif /* ifdef platform for types */
+
+#ifdef _WIN32
+#define htonl(x) correctByteOrder(x)
+#define ntohl(x) correctByteOrder(x)
+#elif defined (__FreeBSD__) || defined (__OpenBSD__) 
+#include <sys/param.h>
+#elif defined (__APPLE__)
+#include <sys/types.h>
+#else  /* irix sun linux */
+#include <netinet/in.h>
+#endif /* ifdef platform for htonl/ntohl */
+
+#ifdef __cplusplus 
+}
+#endif
+
+#endif /* eof */
+

Modified: trunk/blender/intern/opennl/superlu/smemory.c
===================================================================
--- trunk/blender/intern/opennl/superlu/smemory.c	2008-08-17 16:36:37 UTC (rev 16146)
+++ trunk/blender/intern/opennl/superlu/smemory.c	2008-08-17 17:08:00 UTC (rev 16147)
@@ -8,6 +8,8 @@
  */
 #include "ssp_defs.h"
 
+#include "BLO_sys_types.h" // needed for intptr_t
+
 /* Constants */
 #define NO_MEMTYPE  4      /* 0: lusup;
 			      1: ucol;
@@ -49,8 +51,8 @@
 
 /* Macros to manipulate stack */
 #define StackFull(x)         ( x + stack.used >= stack.size )
-#define NotDoubleAlign(addr) ( (long int)addr & 7 )
-#define DoubleAlign(addr)    ( ((long int)addr + 7) & ~7L )
+#define NotDoubleAlign(addr) ( (intptr_t)addr & 7 )
+#define DoubleAlign(addr)    ( ((intptr_t)addr + 7) & ~7L )
 #define TempSpace(m, w)      ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
 			      (w + 1) * m * sizeof(float) )
 #define Reduce(alpha)        ((alpha + 1) / 2)  /* i.e. (alpha-1)/2 + 1 */
@@ -611,8 +613,8 @@
     
     last = (char*)usub + xusub[ndim] * iword;
     fragment = (char*) (((char*)stack.array + stack.top1) - last);
-    stack.used -= (long int) fragment;
-    stack.top1 -= (long int) fragment;
+    stack.used -= (intptr_t) fragment;
+    stack.top1 -= (intptr_t) fragment;
 
     Glu->ucol = ucol;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list