diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-19 14:48:15 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-19 14:48:15 +0400 |
commit | 1c0bdad8354139593cecb7cbbe3de27d8c5f6017 (patch) | |
tree | 82fada8c6425a9cd8194d0ac06b91981c7b5087a /source/blender/blenlib | |
parent | 9b7b8464b9b09f4ca74e40624d3d6c8dffb0247e (diff) | |
parent | 226ff0d4da13ac66991f1708251faa5dff3f7dea (diff) |
svn merge -r40222:40344 ^/trunk/blender
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_voxel.h | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 28 | ||||
-rw-r--r-- | source/blender/blenlib/intern/voxel.c | 10 |
4 files changed, 27 insertions, 25 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 9a3b81e5776..456ee72c4e0 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -35,11 +35,11 @@ */ #ifndef FALSE -#define FALSE 0 +# define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +# define TRUE 1 #endif @@ -94,7 +94,7 @@ /* some math and copy defines */ #ifndef SWAP -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } +# define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } #endif #define ABS(a) ( (a)<0 ? (-(a)) : (a) ) diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 41f8bfab729..8dd95a897ae 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -36,9 +36,9 @@ #define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) ) /* all input coordinates must be in bounding box 0.0 - 1.0 */ -float voxel_sample_nearest(float *data, int *res, float *co); -float voxel_sample_trilinear(float *data, int *res, float *co); -float voxel_sample_triquadratic(float *data, int *res, float *co); -float voxel_sample_tricubic(float *data, int *res, float *co, int bspline); +float voxel_sample_nearest(float *data, const int res[3], const float co[3]); +float voxel_sample_trilinear(float *data, const int res[3], const float co[3]); +float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]); +float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline); #endif /* BLI_VOXEL_H */ diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 5c37d3003e4..961a41690f7 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -23,15 +23,17 @@ * Contributor(s): Campbell Barton. * * ***** END GPL LICENSE BLOCK ***** - * + * */ - + /** \file blender/blenlib/intern/string_utf8.c * \ingroup bli */ - + #include <string.h> +#include "BLI_string.h" + /* from libswish3, originally called u8_isvalid(), * modified to return the index of the bad character (byte index not utf). * http://svn.swish-e.org/libswish3/trunk/src/libswish3/utf8.c r3044 - campbell */ @@ -145,18 +147,18 @@ int BLI_utf8_invalid_strip(char *str, int length) /* compatible with BLI_strncpy, but esnure no partial utf8 chars */ -/* array copied from glib's glib's gutf8.c, +/* array copied from glib's gutf8.c, * note: this looks to be at odd's with 'trailingBytesForUTF8', * need to find out what gives here! - campbell */ static const size_t utf8_skip_data[256] = { - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1 }; char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy) diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index d11386ff606..6d912be71d3 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -36,7 +36,7 @@ -BM_INLINE float D(float *data, int *res, int x, int y, int z) +BM_INLINE float D(float *data, const int res[3], int x, int y, int z) { CLAMP(x, 0, res[0]-1); CLAMP(y, 0, res[1]-1); @@ -46,7 +46,7 @@ BM_INLINE float D(float *data, int *res, int x, int y, int z) /* *** nearest neighbour *** */ /* input coordinates must be in bounding box 0.0 - 1.0 */ -float voxel_sample_nearest(float *data, int *res, float *co) +float voxel_sample_nearest(float *data, const int res[3], const float co[3]) { int xi, yi, zi; @@ -71,7 +71,7 @@ BM_INLINE int _clamp(int a, int b, int c) return (a < b) ? b : ((a > c) ? c : a); } -float voxel_sample_trilinear(float *data, int *res, float *co) +float voxel_sample_trilinear(float *data, const int res[3], const float co[3]) { if (data) { @@ -103,7 +103,7 @@ float voxel_sample_trilinear(float *data, int *res, float *co) } -float voxel_sample_triquadratic(float *data, int *res, float *co) +float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]) { if (data) { @@ -133,7 +133,7 @@ float voxel_sample_triquadratic(float *data, int *res, float *co) return 0.f; } -float voxel_sample_tricubic(float *data, int *res, float *co, int bspline) +float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline) { if (data) { |