diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-14 20:32:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-14 20:32:24 +0300 |
commit | ec00764dd2349f723ba22b45515ec34ee81edcc3 (patch) | |
tree | cf506e71af7172ec63b89aa3d284fab27a2085e6 /source/blender/blenlib | |
parent | 131fa2e00c35ff78042a4f793891eaeb880d715c (diff) | |
parent | 8449f0d77640c466acbda7d6ceeb71bc48317b44 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17434:HEAD
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_linklist.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_memarena.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/SConscript | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_linklist.c | 12 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 2 |
8 files changed, 27 insertions, 9 deletions
diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h index e840ffd167a..ed202c11429 100644 --- a/source/blender/blenlib/BLI_linklist.h +++ b/source/blender/blenlib/BLI_linklist.h @@ -45,6 +45,7 @@ typedef struct LinkNode { } LinkNode; int BLI_linklist_length (struct LinkNode *list); +int BLI_linklist_index (struct LinkNode *list, void *ptr); void BLI_linklist_reverse (struct LinkNode **listp); diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index 34d732e1862..a2954f8fa0d 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -50,6 +50,7 @@ typedef struct MemArena MemArena; struct MemArena* BLI_memarena_new (int bufsize); void BLI_memarena_free (struct MemArena *ma); +void BLI_memarena_use_malloc (struct MemArena *ma); void BLI_memarena_use_calloc (struct MemArena *ma); void* BLI_memarena_alloc (struct MemArena *ma, int size); diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 01a9a1eab0e..f664b75af5a 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -23,7 +23,7 @@ if env['OURPLATFORM'] == 'linux2': cflags='-pthread' incs += ' ../../../extern/binreloc/include' -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'): incs += ' ' + env['BF_PTHREADS_INC'] env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core', 'intern', 'player'], priority = [85,150,195], compileflags =cflags ) diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c index 506a1036ed6..962bbeea373 100644 --- a/source/blender/blenlib/intern/BLI_linklist.c +++ b/source/blender/blenlib/intern/BLI_linklist.c @@ -50,6 +50,18 @@ int BLI_linklist_length(LinkNode *list) { } } +int BLI_linklist_index(struct LinkNode *list, void *ptr) +{ + int index; + + for (index = 0; list; list= list->next, index++) { + if (list->link == ptr) + return index; + } + + return -1; +} + void BLI_linklist_reverse(LinkNode **listp) { LinkNode *rhead= NULL, *cur= *listp; diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 69dd13cd335..87d2f0426b2 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -60,6 +60,10 @@ void BLI_memarena_use_calloc(MemArena *ma) { ma->use_calloc= 1; } +void BLI_memarena_use_malloc(MemArena *ma) { + ma->use_calloc= 0; +} + void BLI_memarena_free(MemArena *ma) { BLI_linklist_free(ma->bufs, (void(*)(void*)) MEM_freeN); MEM_freeN(ma); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 0f2226fc872..a47d37eb69a 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -1351,8 +1351,8 @@ void Mat4ToQuat( float m[][4], float *q) void QuatOne(float *q) { - q[0]= q[2]= q[3]= 0.0; - q[1]= 1.0; + q[0]= 1.0; + q[1]= q[2]= q[3]= 0.0; } void NormalQuat(float *q) diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index ca7a376d3a2..8ba03ad1343 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -47,9 +47,9 @@ #include <time.h> #include <sys/stat.h> -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) #include <sys/statvfs.h> /* Other modern unix os's should probably use this also */ -#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) #include <sys/statfs.h> #endif @@ -179,7 +179,7 @@ double BLI_diskfree(char *dir) return (double) (freec*bytesps*sectorspc); #else -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) struct statvfs disk; #else struct statfs disk; @@ -204,9 +204,9 @@ double BLI_diskfree(char *dir) return -1; #endif -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) if (statvfs(name, &disk)) return(-1); -#elif !defined(__FreeBSD__) && !defined(linux) && (defined (__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) /* WARNING - This may not be supported by geeneric unix os's - Campbell */ if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1); #endif diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 9df8bbc81e3..07c02b8024f 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -42,7 +42,7 @@ /* for checking system threads - BLI_system_thread_count */ #ifdef WIN32 -#include "Windows.h" +#include "windows.h" #elif defined(__APPLE__) #include <sys/types.h> #include <sys/sysctl.h> |