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/intern | |
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/intern')
-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 |
5 files changed, 24 insertions, 8 deletions
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> |