From 1e9bf0cfdb6c925b28af6f0330467e7d9d798c05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Mar 2010 09:30:00 +0000 Subject: spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) --- source/blender/blenlib/BLI_pbvh.h | 8 +- source/blender/blenlib/BLI_vfontdata.h | 2 +- source/blender/blenlib/intern/BLI_bfile.c | 8 +- source/blender/blenlib/intern/BLI_ghash.c | 4 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 4 +- source/blender/blenlib/intern/BLI_linklist.c | 14 +- source/blender/blenlib/intern/boxpack2d.c | 24 ++-- source/blender/blenlib/intern/bpath.c | 2 +- source/blender/blenlib/intern/dynamiclist.c | 2 +- source/blender/blenlib/intern/edgehash.c | 4 +- source/blender/blenlib/intern/fnmatch.c | 146 ++++++++++----------- source/blender/blenlib/intern/freetypefont.c | 62 ++++----- source/blender/blenlib/intern/math_base.c | 12 +- source/blender/blenlib/intern/math_color.c | 22 ++-- source/blender/blenlib/intern/math_geom.c | 88 ++++++------- source/blender/blenlib/intern/math_matrix.c | 116 ++++++++-------- source/blender/blenlib/intern/math_rotation.c | 20 +-- source/blender/blenlib/intern/math_vector_inline.c | 2 +- source/blender/blenlib/intern/noise.c | 12 +- source/blender/blenlib/intern/path_util.c | 2 +- source/blender/blenlib/intern/pbvh.c | 24 ++-- source/blender/blenlib/intern/scanfill.c | 6 +- source/blender/blenlib/intern/storage.c | 2 +- source/blender/blenlib/intern/string.c | 10 +- source/blender/blenlib/intern/voxel.c | 52 ++++---- source/blender/blenlib/intern/winstuff.c | 30 ++--- 26 files changed, 339 insertions(+), 339 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h index da59c5695a4..313c1e36de6 100644 --- a/source/blender/blenlib/BLI_pbvh.h +++ b/source/blender/blenlib/BLI_pbvh.h @@ -47,7 +47,7 @@ typedef void (*BLI_pbvh_HitCallback)(PBVHNode *node, void *data); PBVH *BLI_pbvh_new(void); void BLI_pbvh_build_mesh(PBVH *bvh, struct MFace *faces, struct MVert *verts, - int totface, int totvert); + int totface, int totvert); void BLI_pbvh_build_grids(PBVH *bvh, struct DMGridData **grids, struct DMGridAdjacency *gridadj, int totgrid, int gridsize, void **gridfaces); @@ -71,7 +71,7 @@ void BLI_pbvh_search_gather(PBVH *bvh, hit first */ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitCallback cb, void *data, - float ray_start[3], float ray_normal[3], int original); + float ray_start[3], float ray_normal[3], int original); int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], float ray_start[3], float ray_normal[3], float *dist); @@ -182,7 +182,7 @@ typedef struct PBVHVertexIter { vi.height= vi.gridsize; \ vi.grid= vi.grids[vi.grid_indices[vi.g]]; \ vi.skip= 0; \ - \ + \ /*if(mode == PVBH_ITER_UNIQUE) { \ vi.grid += subm->grid.offset; \ vi.skip= subm->grid.skip; \ @@ -193,7 +193,7 @@ typedef struct PBVHVertexIter { vi.width= vi.totvert; \ vi.height= 1; \ } \ - \ + \ for(vi.gy=0; vi.gycurEntry) { - ghi->curEntry= ghi->curEntry->next; + ghi->curEntry= ghi->curEntry->next; while (!ghi->curEntry) { ghi->curBucket++; if (ghi->curBucket==ghi->gh->nbuckets) @@ -173,7 +173,7 @@ unsigned int BLI_ghashutil_inthash(void *ptr) { key += ~(key << 9); key ^= (key >> 17); - return (unsigned int)(key & 0xffffffff); + return (unsigned int)(key & 0xffffffff); } int BLI_ghashutil_intcmp(void *a, void *b) { diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index bba9b1793c7..4d64f4a50ff 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1490,7 +1490,7 @@ static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *nod dist = t1x; if (t1y > dist) dist = t1y; - if (t1z > dist) dist = t1z; + if (t1z > dist) dist = t1z; return dist; } @@ -1613,7 +1613,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float { dfs_raycast(&data, root); // iterative_raycast(&data, root); - } + } if(hit) diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c index f9c5fc58a63..62d6f6b936c 100644 --- a/source/blender/blenlib/intern/BLI_linklist.c +++ b/source/blender/blenlib/intern/BLI_linklist.c @@ -92,13 +92,13 @@ void BLI_linklist_append(LinkNode **listp, void *ptr) { nlink->next = NULL; if(node == NULL){ - *listp = nlink; - } else { - while(node->next != NULL){ - node = node->next; - } - node->next = nlink; - } + *listp = nlink; + } else { + while(node->next != NULL){ + node = node->next; + } + node->next = nlink; + } } void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma) { diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index eebffd6bd6e..1c910dbb519 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -240,17 +240,17 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) if (vert->free & quad_flags[j]) { switch (j) { case BL: - SET_BOXRIGHT(box, vert->x); - SET_BOXTOP(box, vert->y); - break; + SET_BOXRIGHT(box, vert->x); + SET_BOXTOP(box, vert->y); + break; case TR: - SET_BOXLEFT(box, vert->x); - SET_BOXBOTTOM(box, vert->y); - break; + SET_BOXLEFT(box, vert->x); + SET_BOXBOTTOM(box, vert->y); + break; case TL: - SET_BOXRIGHT(box, vert->x); - SET_BOXBOTTOM(box, vert->y); - break; + SET_BOXRIGHT(box, vert->x); + SET_BOXBOTTOM(box, vert->y); + break; case BR: SET_BOXLEFT(box, vert->x); SET_BOXTOP(box, vert->y); @@ -302,11 +302,11 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) case TR: box->v[BL]= vert; vert->trb = box; - break; + break; case TL: box->v[BR]= vert; vert->tlb = box; - break; + break; case BR: box->v[TL]= vert; vert->brb = box; @@ -314,7 +314,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) case BL: box->v[TR]= vert; vert->blb = box; - break; + break; } /* Mask free flags for verts that are diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index f7c16a0a8b2..2367af470fe 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -77,7 +77,7 @@ enum BPathTypes { BPATH_SEQ, BPATH_CDATA, - BPATH_DONE + BPATH_DONE }; void BLI_bpathIterator_init( struct BPathIterator *bpi, char *base_path ) { diff --git a/source/blender/blenlib/intern/dynamiclist.c b/source/blender/blenlib/intern/dynamiclist.c index 48ba8247ea9..f059ce3736a 100644 --- a/source/blender/blenlib/intern/dynamiclist.c +++ b/source/blender/blenlib/intern/dynamiclist.c @@ -179,7 +179,7 @@ void *BLI_dlist_find_link(DynamicList *dlist, unsigned int index) if(!dlist || !dlist->da.items) return NULL; if((index <= dlist->da.last_item_index) && (index >= 0) && (dlist->da.count>0)){ - return dlist->da.items[index]; + return dlist->da.items[index]; } else { return NULL; diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index a5c0e3f5b79..4f93abf8357 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -82,7 +82,7 @@ void BLI_edgehash_insert(EdgeHash *eh, int v0, int v1, void *val) { v1 ^= v0; v0 ^= v1; } - hash = EDGEHASH(v0,v1)%eh->nbuckets; + hash = EDGEHASH(v0,v1)%eh->nbuckets; e->v0 = v0; e->v1 = v1; @@ -215,7 +215,7 @@ void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val) { void BLI_edgehashIterator_step(EdgeHashIterator *ehi) { if (ehi->curEntry) { - ehi->curEntry= ehi->curEntry->next; + ehi->curEntry= ehi->curEntry->next; while (!ehi->curEntry) { ehi->curBucket++; if (ehi->curBucket==ehi->eh->nbuckets) diff --git a/source/blender/blenlib/intern/fnmatch.c b/source/blender/blenlib/intern/fnmatch.c index ccb6fa72ea8..a78f9ad7585 100644 --- a/source/blender/blenlib/intern/fnmatch.c +++ b/source/blender/blenlib/intern/fnmatch.c @@ -66,97 +66,97 @@ fnmatch (const char *pattern, const char *string, int flags) # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') - { - c = FOLD (c); + { + c = FOLD (c); - switch (c) + switch (c) { case '?': if (*n == '\0') - return FNM_NOMATCH; + return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') - return FNM_NOMATCH; + return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; + return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) - { - c = *p++; - if (c == '\0') + { + c = *p++; + if (c == '\0') /* Trailing \ loses. */ return FNM_NOMATCH; - c = FOLD (c); - } + c = FOLD (c); + } if (FOLD (*n) != c) - return FNM_NOMATCH; + return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++) - { - if ((flags & FNM_FILE_NAME) && *n == '/') + { + if ((flags & FNM_FILE_NAME) && *n == '/') /* A slash does not match a wildcard under FNM_FILE_NAME. */ return FNM_NOMATCH; - else if (c == '?') + else if (c == '?') { /* A ? needs to match one character. */ if (*n == '\0') - /* There isn't another character; no match. */ - return FNM_NOMATCH; + /* There isn't another character; no match. */ + return FNM_NOMATCH; else - /* One character of the string is consumed in matching - this ? wildcard, so *??? won't match if there are - less than three characters. */ - ++n; + /* One character of the string is consumed in matching + this ? wildcard, so *??? won't match if there are + less than three characters. */ + ++n; + } } - } if (c == '\0') - return 0; + return 0; { - char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; - c1 = FOLD (c1); - for (--p; *n != '\0'; ++n) - if ((c == '[' || FOLD (*n) == c1) && + char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + c1 = FOLD (c1); + for (--p; *n != '\0'; ++n) + if ((c == '[' || FOLD (*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; - return FNM_NOMATCH; + return FNM_NOMATCH; } case '[': { - /* Nonzero if the sense of the character class is inverted. */ - register int not; + /* Nonzero if the sense of the character class is inverted. */ + register int not; - if (*n == '\0') - return FNM_NOMATCH; + if (*n == '\0') + return FNM_NOMATCH; - if ((flags & FNM_PERIOD) && *n == '.' && + if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; + return FNM_NOMATCH; - not = (*p == '!' || *p == '^'); - if (not) - ++p; + not = (*p == '!' || *p == '^'); + if (not) + ++p; - c = *p++; - for (;;) - { + c = *p++; + for (;;) + { register char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') { - if (*p == '\0') - return FNM_NOMATCH; - cstart = cend = *p++; + if (*p == '\0') + return FNM_NOMATCH; + cstart = cend = *p++; } cstart = cend = FOLD (cstart); @@ -174,14 +174,14 @@ fnmatch (const char *pattern, const char *string, int flags) if (c == '-' && *p != ']') { - cend = *p++; - if (!(flags & FNM_NOESCAPE) && cend == '\\') - cend = *p++; - if (cend == '\0') - return FNM_NOMATCH; - cend = FOLD (cend); - - c = *p++; + cend = *p++; + if (!(flags & FNM_NOESCAPE) && cend == '\\') + cend = *p++; + if (cend == '\0') + return FNM_NOMATCH; + cend = FOLD (cend); + + c = *p++; } if (FOLD (*n) >= cstart && FOLD (*n) <= cend) @@ -189,15 +189,15 @@ fnmatch (const char *pattern, const char *string, int flags) if (c == ']') break; - } - if (!not) - return FNM_NOMATCH; - break; + } + if (!not) + return FNM_NOMATCH; + break; matched:; - /* Skip the rest of the [...] that already matched. */ - while (c != ']') - { + /* Skip the rest of the [...] that already matched. */ + while (c != ']') + { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; @@ -205,31 +205,31 @@ fnmatch (const char *pattern, const char *string, int flags) c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') { - if (*p == '\0') - return FNM_NOMATCH; - /* XXX 1003.2d11 is unclear if this is right. */ - ++p; + if (*p == '\0') + return FNM_NOMATCH; + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } } - } - if (not) - return FNM_NOMATCH; + if (not) + return FNM_NOMATCH; } break; default: if (c != FOLD (*n)) - return FNM_NOMATCH; + return FNM_NOMATCH; } - ++n; - } + ++n; + } if (*n == '\0') - return 0; + return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') - /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ - return 0; + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; return FNM_NOMATCH; diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 9227803b681..6d6abc88999 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -429,7 +429,7 @@ static int check_freetypefont(PackedFile * pf) &face ); if(err) { success = 0; - //XXX error("This is not a valid font"); + //XXX error("This is not a valid font"); } else { /* @@ -522,14 +522,14 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character) typedef struct FT_Outline_ { - short n_contours; /* number of contours in glyph */ - short n_points; /* number of points in the glyph */ + short n_contours; /* number of contours in glyph */ + short n_points; /* number of points in the glyph */ - FT_Vector* points; /* the outline's points */ - char* tags; /* the points flags */ - short* contours; /* the contour end points */ + FT_Vector* points; /* the outline's points */ + char* tags; /* the points flags */ + short* contours; /* the contour end points */ - int flags; /* outline masks */ + int flags; /* outline masks */ } FT_Outline; @@ -569,44 +569,44 @@ The following rules are applied to decompose the contour's points into segments Note that it is possible to mix conic and cubic arcs in a single contour, even though no current font driver produces such outlines. - * # on - * off - __---__ + * # on + * off + __---__ #-__ _-- -_ - --__ _- - - --__ # \ - --__ # - -# - Two "on" points + --__ _- - + --__ # \ + --__ # + -# + Two "on" points Two "on" points and one "conic" point - between them + between them - * + * # __ Two "on" points with two "conic" \ - - points between them. The point - \ / \ marked '0' is the middle of the - - 0 \ "off" points, and is a 'virtual' - -_ _- # "on" point where the curve passes. - -- It does not appear in the point - list. - * + \ / \ marked '0' is the middle of the + - 0 \ "off" points, and is a 'virtual' + -_ _- # "on" point where the curve passes. + -- It does not appear in the point + list. + * - * # on - * * off - __---__ - _-- -_ - _- - + * # on + * * off + __---__ + _-- -_ + _- - # \ - # + # - Two "on" points + Two "on" points and two "cubic" point - between them + between them Each glyph's original outline points are located on a grid of indivisible units. The points are stored diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c index 8301f790614..686b35a878e 100644 --- a/source/blender/blenlib/intern/math_base.c +++ b/source/blender/blenlib/intern/math_base.c @@ -45,12 +45,12 @@ double copysign(double x, double y) /* from python 3.1 pymath.c */ double round(double x) { - double absx, y; - absx = fabs(x); - y = floor(absx); - if (absx - y >= 0.5) - y += 1.0; - return copysign(y, x); + double absx, y; + absx = fabs(x); + y = floor(absx); + if (absx - y >= 0.5) + y += 1.0; + return copysign(y, x); } #endif diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 633585a3336..a1bb2754d95 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -365,21 +365,21 @@ int constrain_rgb(float *r, float *g, float *b) { float w; - /* Amount of white needed is w = - min(0, *r, *g, *b) */ + /* Amount of white needed is w = - min(0, *r, *g, *b) */ - w = (0 < *r) ? 0 : *r; - w = (w < *g) ? w : *g; - w = (w < *b) ? w : *b; - w = -w; + w = (0 < *r) ? 0 : *r; + w = (w < *g) ? w : *g; + w = (w < *b) ? w : *b; + w = -w; - /* Add just enough white to make r, g, b all positive. */ + /* Add just enough white to make r, g, b all positive. */ - if (w > 0) { - *r += w; *g += w; *b += w; - return 1; /* Color modified to fit RGB gamut */ - } + if (w > 0) { + *r += w; *g += w; *b += w; + return 1; /* Color modified to fit RGB gamut */ + } - return 0; /* Color within RGB gamut */ + return 0; /* Color within RGB gamut */ } float rgb_to_grayscale(float rgb[3]) diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index f2454f05977..27f36752f80 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -957,7 +957,7 @@ int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3] int isect_aabb_aabb_v3(float min1[3], float max1[3], float min2[3], float max2[3]) { return (min1[0]data+offs); - offs+= size; + offs+= size; return adr; } } @@ -285,7 +285,7 @@ static short testedgeside(float *v1, float *v2, float *v3) float inp; inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy]) - +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]); + +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]); if(inp<0.0) return 0; else if(inp==0) { @@ -362,7 +362,7 @@ static ScFillVert *addedgetoscanlist(EditEdge *eed, int len) /* find location in list */ scsearch.v1= eed->v1; sc= (ScFillVert *)bsearch(&scsearch,scdata,len, - sizeof(ScFillVert), vergscdata); + sizeof(ScFillVert), vergscdata); if(sc==0) printf("Error in search edge: %p\n",eed); else if(addedgetoscanvert(sc,eed)==0) return sc; diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 086f20b7e21..a2f30ae5b01 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -334,7 +334,7 @@ void BLI_adddirstrings() strcpy(files[num].owner, pwuser->pw_name); } else { sprintf(files[num].owner, "%d", files[num].s.st_uid); - } + } } #endif diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index fd0b7e13a66..c344d8c0711 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -220,10 +220,10 @@ int BLI_strcaseeq(const char *a, const char *b) /* strcasestr not available in MSVC */ char *BLI_strcasestr(const char *s, const char *find) { - register char c, sc; - register size_t len; + register char c, sc; + register size_t len; - if ((c = *find++) != 0) { + if ((c = *find++) != 0) { c= tolower(c); len = strlen(find); do { @@ -234,8 +234,8 @@ char *BLI_strcasestr(const char *s, const char *find) } while (sc != c); } while (BLI_strncasecmp(s, find, len) != 0); s--; - } - return ((char *) s); + } + return ((char *) s); } diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index 302d721264d..31ed116c40a 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -93,9 +93,9 @@ float voxel_sample_trilinear(float *data, int *res, float *co) const float w[2] = {1.f - dz, dz}; return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) ) - + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) ); + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) ); } return 0.f; @@ -119,14 +119,14 @@ float voxel_sample_triquadratic(float *data, int *res, float *co) const float w[3] = {dz*(0.5f*dz - 1.f) + 0.5f, dz*(1.f - dz) + 0.5f, 0.5f*dz*dz}; return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) ) - + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) ) - + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) ); + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) ) + + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) ); } return 0.f; @@ -176,21 +176,21 @@ float voxel_sample_tricubic(float *data, int *res, float *co, int bspline) } return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] + u[3] * data[xc[3] + yc[0] + zc[0]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] ) - + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) ) - + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] ) - + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) ) - + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] ) - + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) ) - + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] ) - + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] ) - + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] ) - + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) ); + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) ) + + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) ) + + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) ); } return 0.f; diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 194a164216a..0463e6ea00b 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -225,21 +225,21 @@ int check_file_chars(char *filename) #include char* dirname(char *path) { - char *p; - if( path == NULL || *path == '\0' ) - return "."; - p = path + strlen(path) - 1; - while( *p == '/' ) { - if( p == path ) - return path; - *p-- = '\0'; - } - while( p >= path && *p != '/' ) - p--; - return - p < path ? "." : - p == path ? "/" : - (*p = '\0', path); + char *p; + if( path == NULL || *path == '\0' ) + return "."; + p = path + strlen(path) - 1; + while( *p == '/' ) { + if( p == path ) + return path; + *p-- = '\0'; + } + while( p >= path && *p != '/' ) + p--; + return + p < path ? "." : + p == path ? "/" : + (*p = '\0', path); } /* End of copied part */ -- cgit v1.2.3