Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-04 00:19:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-04 00:19:11 +0400
commit95670e03a01d30cda5a0f685974f28790be6809d (patch)
treee6d5756cbe51edb083cda2fceff087bda35c361a /source/blender/blenlib
parenta2c182e9233333fc3b8ff40d352113ec95e7e30c (diff)
style cleanup / comment formatting for bli/bke/bmesh
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_bitmap.h4
-rw-r--r--source/blender/blenlib/BLI_bpath.h2
-rw-r--r--source/blender/blenlib/BLI_editVert.h4
-rw-r--r--source/blender/blenlib/BLI_fnmatch.h42
-rw-r--r--source/blender/blenlib/BLI_heap.h4
-rw-r--r--source/blender/blenlib/BLI_math_geom.h10
-rw-r--r--source/blender/blenlib/BLI_math_matrix.h2
-rw-r--r--source/blender/blenlib/BLI_md5.h10
-rw-r--r--source/blender/blenlib/BLI_path_util.h48
-rw-r--r--source/blender/blenlib/BLI_pbvh.h16
-rw-r--r--source/blender/blenlib/BLI_scanfill.h2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c27
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c4
-rw-r--r--source/blender/blenlib/intern/bpath.c6
-rw-r--r--source/blender/blenlib/intern/fileops.c10
-rw-r--r--source/blender/blenlib/intern/freetypefont.c36
-rw-r--r--source/blender/blenlib/intern/math_color.c14
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c6
-rw-r--r--source/blender/blenlib/intern/math_geom.c148
-rw-r--r--source/blender/blenlib/intern/math_matrix.c4
-rw-r--r--source/blender/blenlib/intern/math_rotation.c74
-rw-r--r--source/blender/blenlib/intern/math_vector.c8
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c4
-rw-r--r--source/blender/blenlib/intern/noise.c17
-rw-r--r--source/blender/blenlib/intern/path_util.c160
-rw-r--r--source/blender/blenlib/intern/pbvh.c118
-rw-r--r--source/blender/blenlib/intern/scanfill.c77
-rw-r--r--source/blender/blenlib/intern/storage.c6
-rw-r--r--source/blender/blenlib/intern/string.c8
-rw-r--r--source/blender/blenlib/intern/string_utf8.c12
-rw-r--r--source/blender/blenlib/intern/threads.c94
-rw-r--r--source/blender/blenlib/intern/winstuff.c6
32 files changed, 497 insertions, 486 deletions
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 16a6fb8ee15..2aed71a7d44 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -29,7 +29,7 @@
typedef unsigned int* BLI_bitmap;
/* warning: the bitmap does not keep track of its own size or check
- for out-of-bounds access */
+ * for out-of-bounds access */
/* internal use */
/* 2^5 = 32 (bits) */
@@ -46,7 +46,7 @@ typedef unsigned int* BLI_bitmap;
(BLI_BITMAP_NUM_BLOCKS(_tot) * sizeof(unsigned int))
/* allocate memory for a bitmap with '_tot' bits; free
- with MEM_freeN() */
+ * with MEM_freeN() */
#define BLI_BITMAP_NEW(_tot, _alloc_string) \
((BLI_bitmap)MEM_callocN(BLI_BITMAP_SIZE(_tot), \
_alloc_string))
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h
index f1639bdb3c1..a0f253d9ad4 100644
--- a/source/blender/blenlib/BLI_bpath.h
+++ b/source/blender/blenlib/BLI_bpath.h
@@ -40,7 +40,7 @@ struct Main;
struct ReportList;
/* Function that does something with an ID's file path. Should return 1 if the
- path has changed, and in that case, should write the result to pathOut. */
+ * path has changed, and in that case, should write the result to pathOut. */
typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
/* Executes 'visit' for each path associated with 'id'. */
void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata);
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index b5096abc5bc..0f754d5fc98 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -64,8 +64,8 @@ typedef struct EditVert
short xs, ys; /* used to store a screenspace 2d projection of the verts */
/* f stores selection eg. if (eve->f & SELECT) {...
- h for hidden. if (!eve->h) {...
- f1 and f2 can be used for temp data, clear them first*/
+ * h for hidden. if (!eve->h) {...
+ * f1 and f2 can be used for temp data, clear them first*/
unsigned char f, h, f1, f2;
float bweight;
short fast; /* only 0 or 1, for editmesh_fastmalloc, do not store temp data here! */
diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h
index 711d1aa756b..5914d150d56 100644
--- a/source/blender/blenlib/BLI_fnmatch.h
+++ b/source/blender/blenlib/BLI_fnmatch.h
@@ -1,21 +1,21 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ *
+ * NOTE: The canonical source of this file is maintained with the GNU C Library.
+ * Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+ *
+ * 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef __BLI_FNMATCH_H__
#define __BLI_FNMATCH_H__
@@ -35,13 +35,13 @@ extern "C" {
#undef __P
#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
- it is used only inside the prototype for `fnmatch', which is elided in
- non-ANSI C where `const' is problematical. */
+ * it is used only inside the prototype for `fnmatch', which is elided in
+ * non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* We #undef these before defining them because some losing systems
- (HP-UX A.08.07 for example) define these in <unistd.h>. */
+ * (HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
@@ -61,7 +61,7 @@ extern "C" {
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
- returning zero if it matches, FNM_NOMATCH if not. */
+ * returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h
index 5c67bf52b9a..5ceccda96e4 100644
--- a/source/blender/blenlib/BLI_heap.h
+++ b/source/blender/blenlib/BLI_heap.h
@@ -41,12 +41,12 @@ typedef struct HeapNode HeapNode;
typedef void (*HeapFreeFP)(void *ptr);
/* Creates a new heap. BLI_memarena is used for allocating nodes. Removed nodes
- are recycled, so memory usage will not shrink. */
+ * are recycled, so memory usage will not shrink. */
Heap* BLI_heap_new (void);
void BLI_heap_free (Heap *heap, HeapFreeFP ptrfreefp);
/* Insert heap node with a value (often a 'cost') and pointer into the heap,
- duplicate values are allowed. */
+ * duplicate values are allowed. */
HeapNode* BLI_heap_insert (Heap *heap, float value, void *ptr);
/* Remove a heap node. */
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 2a5543b10ed..a725a3ff4c1 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -103,8 +103,8 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3],
const float v3[3], const float v4[3],
float vi[3], float *r_lambda);
-/*if clip is nonzero, will only return true if lambda is >= 0.0
- (i.e. intersection point is along positive d)*/
+/* if clip is nonzero, will only return true if lambda is >= 0.0
+ * (i.e. intersection point is along positive d)*/
int isect_ray_plane_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, const int clip);
@@ -248,9 +248,9 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,
/****************************** Spherical Harmonics *************************/
/* Uses 2nd order SH => 9 coefficients, stored in this order:
- 0 = (0,0),
- 1 = (1,-1), 2 = (1,0), 3 = (1,1),
- 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
+ * 0 = (0,0),
+ * 1 = (1,-1), 2 = (1,0), 3 = (1,1),
+ * 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
MINLINE void zero_sh(float r[9]);
MINLINE void copy_sh_sh(float r[9], const float a[9]);
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 8c19941e18c..328b5614f52 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -71,7 +71,7 @@ void mul_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]);
void mul_m4_m3m4(float R[4][4], float A[3][3], float B[4][4]);
void mul_m4_m4m3(float R[4][4], float A[4][4], float B[3][3]);
/* note: the A,B arguments are reversed compared to previous mul_m4_m4m4
- function, for consistency with above functions & math notation. */
+ * function, for consistency with above functions & math notation. */
void mult_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]);
void mult_m3_m3m4(float R[3][3], float A[4][4], float B[3][3]);
diff --git a/source/blender/blenlib/BLI_md5.h b/source/blender/blenlib/BLI_md5.h
index 51211d548cd..8ce479b1801 100644
--- a/source/blender/blenlib/BLI_md5.h
+++ b/source/blender/blenlib/BLI_md5.h
@@ -29,15 +29,15 @@
#include <stdlib.h>
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
- output yields to the wanted ASCII representation of the message
- digest. */
+ * result is always in little endian byte order, so that a byte-wise
+ * output yields to the wanted ASCII representation of the message
+ * digest. */
void *md5_buffer(const char *buffer, size_t len, void *resblock);
/* Compute MD5 message digest for bytes read from STREAM. The
- resulting message digest number will be written into the 16 bytes
- beginning at RESBLOCK. */
+ * resulting message digest number will be written into the 16 bytes
+ * beginning at RESBLOCK. */
int md5_stream(FILE *stream, void *resblock);
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 3ee548098ff..e02b48feda7 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -115,10 +115,10 @@ void BLI_splitdirstring(char *di,char *fi);
void BLI_clean(char *path);
/**
- * dir can be any input, like from buttons, and this function
- * converts it to a regular full path.
- * Also removes garbage from directory paths, like /../ or double slashes etc
- */
+ * dir can be any input, like from buttons, and this function
+ * converts it to a regular full path.
+ * Also removes garbage from directory paths, like /../ or double slashes etc
+ */
void BLI_cleanup_file(const char *relabase, char *dir); /* removes trailing slash */
void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds a trailing slash */
void BLI_cleanup_path(const char *relabase, char *dir); /* doesn't touch trailing slash */
@@ -129,18 +129,18 @@ int BLI_parent_dir(char *path);
/* return whether directory is root and thus has no parent dir */
int BLI_has_parent(char *path);
- /**
- * Blender's path code replacement function.
- * Bases \a path strings leading with "//" by the
- * directory \a basepath, and replaces instances of
- * '#' with the \a framenum. Results are written
- * back into \a path.
- *
- * \a path The path to convert
- * \a basepath The directory to base relative paths with.
- * \a framenum The framenumber to replace the frame code with.
- * \retval Returns true if the path was relative (started with "//").
- */
+/**
+ * Blender's path code replacement function.
+ * Bases \a path strings leading with "//" by the
+ * directory \a basepath, and replaces instances of
+ * '#' with the \a framenum. Results are written
+ * back into \a path.
+ *
+ * \a path The path to convert
+ * \a basepath The directory to base relative paths with.
+ * \a framenum The framenumber to replace the frame code with.
+ * \retval Returns true if the path was relative (started with "//").
+ */
int BLI_path_abs(char *path, const char *basepath);
int BLI_path_frame(char *path, int frame, int digits);
int BLI_path_frame_range(char *path, int sta, int end, int digits);
@@ -155,14 +155,14 @@ void BLI_path_rel(char *file, const char *relfile);
# define BLI_path_ncmp strncmp
#endif
- /**
- * Change every \a from in \a string into \a to. The
- * result will be in \a string
- *
- * \a string The string to work on
- * \a from The character to replace
- * \a to The character to replace with
- */
+/**
+ * Change every \a from in \a string into \a to. The
+ * result will be in \a string
+ *
+ * \a string The string to work on
+ * \a from The character to replace
+ * \a to The character to replace with
+ */
void BLI_char_switch(char *string, char from, char to);
/* Initialize path to program executable */
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index 3b52c9b77db..f60f8d90b09 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -60,8 +60,8 @@ void BLI_pbvh_build_grids(PBVH *bvh, struct DMGridData **grids,
void BLI_pbvh_free(PBVH *bvh);
/* Hierarchical Search in the BVH, two methods:
- * for each hit calling a callback
- * gather nodes in an array (easy to multithread) */
+ * - for each hit calling a callback
+ * - gather nodes in an array (easy to multithread) */
void BLI_pbvh_search_callback(PBVH *bvh,
BLI_pbvh_SearchCallback scb, void *search_data,
@@ -72,9 +72,9 @@ void BLI_pbvh_search_gather(PBVH *bvh,
PBVHNode ***array, int *tot);
/* Raycast
- the hit callback is called for all leaf nodes intersecting the ray;
- it's up to the callback to find the primitive within the leaves that is
- hit first */
+ * the hit callback is called for all leaf nodes intersecting the ray;
+ * it's up to the callback to find the primitive within the leaves that is
+ * hit first */
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
float ray_start[3], float ray_normal[3], int original);
@@ -131,8 +131,8 @@ int BLI_pbvh_isDeformed(struct PBVH *pbvh);
/* Vertex Iterator */
/* this iterator has quite a lot of code, but it's designed to:
- - allow the compiler to eliminate dead code and variables
- - spend most of the time in the relatively simple inner loop */
+ * - allow the compiler to eliminate dead code and variables
+ * - spend most of the time in the relatively simple inner loop */
#define PBVH_ITER_ALL 0
#define PBVH_ITER_UNIQUE 1
@@ -159,7 +159,7 @@ typedef struct PBVHVertexIter {
int *vert_indices;
/* result: these are all computed in the macro, but we assume
- that compiler optimizations will skip the ones we don't use */
+ * that compiler optimizations will skip the ones we don't use */
struct MVert *mvert;
float *co;
short *no;
diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h
index d497ffa4941..9589ee6e305 100644
--- a/source/blender/blenlib/BLI_scanfill.h
+++ b/source/blender/blenlib/BLI_scanfill.h
@@ -82,7 +82,7 @@ struct ScanFillVert *BLI_addfillvert(const float vec[3]);
struct ScanFillEdge *BLI_addfilledge(struct ScanFillVert *v1, struct ScanFillVert *v2);
/* Optionally set ScanFillEdge f to this to mark original boundary edges.
- Only needed if there are internal diagonal edges pased to BLI_edgefill. */
+ * Only needed if there are internal diagonal edges pased to BLI_edgefill. */
#define FILLBOUNDARY 1
int BLI_begin_edgefill(void);
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index afc8a6a4aa6..1c0bac4a82f 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -201,16 +201,18 @@ static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, in
//////////////////////////////////////////////////////////////////////////////////////////////////////
//static int size_threshold = 16;
/*
-* Common methods for all algorithms
-*/
-/*static int floor_lg(int a)
+ * Common methods for all algorithms
+ */
+#if 0
+static int floor_lg(int a)
{
return (int)(floor(log(a)/log(2)));
-}*/
+}
+#endif
/*
-* Insertion sort algorithm
-*/
+ * Insertion sort algorithm
+ */
static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis)
{
int i,j;
@@ -244,8 +246,8 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis)
}
/*
-* Heapsort algorithm
-*/
+ * Heapsort algorithm
+ */
#if 0
static void bvh_downheap(BVHNode **a, int i, int n, int lo, int axis)
{
@@ -310,8 +312,8 @@ static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) //
#if 0
/*
-* Quicksort algorithm modified for Introsort
-*/
+ * Quicksort algorithm modified for Introsort
+ */
static void bvh_introsort_loop (BVHNode **a, int lo, int hi, int depth_limit, int axis)
{
int p;
@@ -1210,7 +1212,7 @@ static float calc_nearest_point(const float proj[3], BVHNode *node, float *neare
nearest[i] = proj[i];
}
-/*
+#if 0
//nearest on a general hull
copy_v3_v3(nearest, data->co);
for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2)
@@ -1228,7 +1230,8 @@ static float calc_nearest_point(const float proj[3], BVHNode *node, float *neare
madd_v3_v3fl(nearest, KDOP_AXES[i], du);
}
}
-*/
+#endif
+
return len_squared_v3v3(proj, nearest);
}
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index 57174d0c0dd..7a1f7bee1ce 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -277,8 +277,8 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
}
/* Now we need to check that the box intersects
- * with any other boxes
- * Assume no intersection... */
+ * with any other boxes
+ * Assume no intersection... */
isect = 0;
if (/* Constrain boxes to positive X/Y values */
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index fdda9166c94..7bc2446b64b 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -499,7 +499,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
Tex *tex = (Tex *)id;
if (tex->plugin) {
/* FIXME: rewrite_path assumes path length of FILE_MAX, but
- tex->plugin->name is 160. ... is this field even a path? */
+ * tex->plugin->name is 160. ... is this field even a path? */
//rewrite_path(tex->plugin->name, visit_cb, bpath_user_data);
}
if (tex->type == TEX_VOXELDATA && TEX_VD_IS_SOURCE_PATH(tex->vd->file_format)) {
@@ -594,7 +594,7 @@ void bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag, voi
}
/* Rewrites a relative path to be relative to the main file - unless the path is
- absolute, in which case it is not altered. */
+ * absolute, in which case it is not altered. */
int bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src)
{
/* be sure there is low chance of the path being too short */
@@ -609,7 +609,7 @@ int bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_sr
}
/* Make referenced file absolute. This would be a side-effect of
- BLI_cleanup_file, but we do it explicitely so we know if it changed. */
+ * BLI_cleanup_file, but we do it explicitely so we know if it changed. */
BLI_strncpy(filepath, path_src, FILE_MAX);
if (BLI_path_abs(filepath, base_old)) {
/* Path was relative and is now absolute. Remap.
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 895ae03ab0f..a868cf8ea96 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -60,9 +60,9 @@
/* gzip the file in from and write it to "to".
- return -1 if zlib fails, -2 if the originating file does not exist
- note: will remove the "from" file
- */
+ * return -1 if zlib fails, -2 if the originating file does not exist
+ * note: will remove the "from" file
+ */
int BLI_file_gzip(const char *from, const char *to)
{
char buffer[10240];
@@ -106,8 +106,8 @@ int BLI_file_gzip(const char *from, const char *to)
}
/* gzip the file in from_file and write it to memery to_mem, at most size bytes.
- return the unziped size
- */
+ * return the unziped size
+ */
char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r)
{
gzFile gzfile;
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 3a0d44db12e..8fe081fe70b 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -322,13 +322,13 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
const char *fontname;
VFontData *vfd;
-/*
+#if 0
FT_CharMap found = 0;
FT_CharMap charmap;
FT_UShort my_platform_id = TT_PLATFORM_MICROSOFT;
FT_UShort my_encoding_id = TT_MS_ID_UNICODE_CS;
int n;
-*/
+#endif
// load the freetype font
err = FT_New_Memory_Face( library,
@@ -338,7 +338,8 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
&face );
if(err) return NULL;
-/*
+
+#if 0
for ( n = 0; n < face->num_charmaps; n++ )
{
charmap = face->charmaps[n];
@@ -355,7 +356,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
// now, select the charmap for the face object
err = FT_Set_Charmap( face, found );
if ( err ) { return NULL; }
-*/
+#endif
// allocate blender font
vfd= MEM_callocN(sizeof(*vfd), "FTVFontData");
@@ -416,13 +417,13 @@ static int check_freetypefont(PackedFile * pf)
FT_Face face;
FT_GlyphSlot glyph;
FT_UInt glyph_index;
-/*
+#if 0
FT_CharMap charmap;
FT_CharMap found;
FT_UShort my_platform_id = TT_PLATFORM_MICROSOFT;
FT_UShort my_encoding_id = TT_MS_ID_UNICODE_CS;
int n;
-*/
+#endif
int success = 0;
err = FT_New_Memory_Face( library,
@@ -435,24 +436,23 @@ static int check_freetypefont(PackedFile * pf)
//XXX error("This is not a valid font");
}
else {
-/*
- for ( n = 0; n < face->num_charmaps; n++ )
- {
- charmap = face->charmaps[n];
- if ( charmap->platform_id == my_platform_id &&
- charmap->encoding_id == my_encoding_id )
- {
- found = charmap;
- break;
- }
+
+#if 0
+ for ( n = 0; n < face->num_charmaps; n++) {
+ charmap = face->charmaps[n];
+ if (charmap->platform_id == my_platform_id && charmap->encoding_id == my_encoding_id) {
+ found = charmap;
+ break;
+ }
}
- if ( !found ) { return 0; }
+ if (!found ) { return 0; }
// now, select the charmap for the face object
err = FT_Set_Charmap( face, found );
if ( err ) { return 0; }
-*/
+#endif
+
glyph_index = FT_Get_Char_Index( face, 'A' );
err = FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP);
if(err) success = 0;
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index b9772b1f3b4..96600b6665f 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -290,8 +290,8 @@ void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int
}
/* we define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so.
- for that reason it is sensitive for endianness... with this function it works correctly
-*/
+ * for that reason it is sensitive for endianness... with this function it works correctly
+ */
unsigned int hsv_to_cpack(float h, float s, float v)
{
@@ -413,11 +413,11 @@ void minmax_rgb(short c[])
}
/*If the requested RGB shade contains a negative weight for
- one of the primaries, it lies outside the color gamut
- accessible from the given triple of primaries. Desaturate
- it by adding white, equal quantities of R, G, and B, enough
- to make RGB all positive. The function returns 1 if the
- components were modified, zero otherwise.*/
+ * one of the primaries, it lies outside the color gamut
+ * accessible from the given triple of primaries. Desaturate
+ * it by adding white, equal quantities of R, G, and B, enough
+ * to make RGB all positive. The function returns 1 if the
+ * components were modified, zero otherwise.*/
int constrain_rgb(float *r, float *g, float *b)
{
float w;
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index f497470fa4c..47ee54d6215 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -79,9 +79,9 @@ MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[
}
/* predivide versions to work on associated/premultipled alpha. if this should
- be done or not depends on the background the image will be composited over,
- ideally you would never do color space conversion on an image with alpha
- because it is ill defined */
+ * be done or not depends on the background the image will be composited over,
+ * ideally you would never do color space conversion on an image with alpha
+ * because it is ill defined */
MINLINE void srgb_to_linearrgb_predivide_v4(float linear[4], const float srgb[4])
{
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 64b31df9c8e..9f5e191c9ff 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -331,8 +331,9 @@ int isect_line_line_v2(const float v1[2], const float v2[2], const float v3[2],
}
/* get intersection point of two 2D segments and return intersection type:
- -1: colliniar
- 1: intersection */
+ * -1: colliniar
+ * 1: intersection
+ */
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2])
{
float a1, a2, b1, b2, c1, c2, d;
@@ -531,29 +532,28 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
}
/*
--1: colliniar
- 1: intersection
-
-*/
+ * -1: colliniar
+ * 1: intersection
+ */
static short IsectLLPt2Df(const float x0, const float y0, const float x1, const float y1,
const float x2, const float y2, const float x3, const float y3, float *xi,float *yi)
{
/*
- this function computes the intersection of the sent lines
- and returns the intersection point, note that the function assumes
- the lines intersect. the function can handle vertical as well
- as horizontal lines. note the function isn't very clever, it simply
- applies the math, but we don't need speed since this is a
- pre-processing step
- */
+ * this function computes the intersection of the sent lines
+ * and returns the intersection point, note that the function assumes
+ * the lines intersect. the function can handle vertical as well
+ * as horizontal lines. note the function isn't very clever, it simply
+ * applies the math, but we don't need speed since this is a
+ * pre-processing step
+ */
float c1,c2, // constants of linear equations
det_inv, // the inverse of the determinant of the coefficient
m1,m2; // the slopes of each line
/*
- compute slopes, note the cludge for infinity, however, this will
- be close enough
- */
+ * compute slopes, note the cludge for infinity, however, this will
+ * be close enough
+ */
if (fabs(x1-x0) > 0.000001)
m1 = (y1-y0) / (x1-x0);
else
@@ -629,9 +629,9 @@ int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2],
}
/* moved from effect.c
- test if the line starting at p1 ending at p2 intersects the triangle v0..v2
- return non zero if it does
-*/
+ * test if the line starting at p1 ending at p2 intersects the triangle v0..v2
+ * return non zero if it does
+ */
int isect_line_tri_v3(const float p1[3], const float p2[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, float r_uv[2])
@@ -670,9 +670,9 @@ int isect_line_tri_v3(const float p1[3], const float p2[3],
return 1;
}
/* moved from effect.c
- test if the ray starting at p1 going in d direction intersects the triangle v0..v2
- return non zero if it does
-*/
+ * test if the ray starting at p1 going in d direction intersects the triangle v0..v2
+ * return non zero if it does
+ */
int isect_ray_tri_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, float r_uv[2])
@@ -1512,14 +1512,12 @@ int isect_point_tri_v2(float v0[2], float v1[2], float v2[2], float pt[2])
#endif
/*
-
- x1,y2
- | \
- | \ .(a,b)
- | \
- x1,y1-- x2,y1
-
-*/
+ * x1,y2
+ * | \
+ * | \ .(a,b)
+ * | \
+ * x1,y1-- x2,y1
+ */
int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b)
{
float v1[2], v2[2], v3[2], p[2];
@@ -1541,18 +1539,18 @@ int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y
static int point_in_slice(const float p[3], const float v1[3], const float l1[3], const float l2[3])
{
-/*
-what is a slice ?
-some maths:
-a line including l1,l2 and a point not on the line
-define a subset of R3 delimeted by planes parallel to the line and orthogonal
-to the (point --> line) distance vector,one plane on the line one on the point,
-the room inside usually is rather small compared to R3 though still infinte
-useful for restricting (speeding up) searches
-e.g. all points of triangular prism are within the intersection of 3 'slices'
-onother trivial case : cube
-but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
-*/
+ /*
+ * what is a slice ?
+ * some maths:
+ * a line including l1,l2 and a point not on the line
+ * define a subset of R3 delimeted by planes parallel to the line and orthogonal
+ * to the (point --> line) distance vector,one plane on the line one on the point,
+ * the room inside usually is rather small compared to R3 though still infinte
+ * useful for restricting (speeding up) searches
+ * e.g. all points of triangular prism are within the intersection of 3 'slices'
+ * onother trivial case : cube
+ * but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
+ */
float h,rp[3],cp[3],q[3];
closest_to_line_v3(cp,v1,l1,l2);
@@ -1565,8 +1563,8 @@ but see a 'spat' which is a deformed cube with paired parallel planes needs only
}
#if 0
-/*adult sister defining the slice planes by the origin and the normal
-NOTE |normal| may not be 1 but defining the thickness of the slice*/
+/* adult sister defining the slice planes by the origin and the normal
+ * NOTE |normal| may not be 1 but defining the thickness of the slice */
static int point_in_slice_as(float p[3],float origin[3],float normal[3])
{
float h,rp[3];
@@ -1791,7 +1789,7 @@ void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], co
if(degenerate || (w[0] < 0.0f)) {
/* if w[1] is negative, co is on the other side of the v1-v3 edge,
- so we interpolate using the other triangle */
+ * so we interpolate using the other triangle */
degenerate= barycentric_weights(v2, v3, v4, co, n, w2);
if(!degenerate) {
@@ -2035,8 +2033,8 @@ void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3
void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2])
{
/* find UV such that
- t= u*t0 + v*t1 + (1-u-v)*t2
- u*(t0-t2) + v*(t1-t2)= t-t2 */
+ * t= u*t0 + v*t1 + (1-u-v)*t2
+ * u*(t0-t2) + v*(t1-t2)= t-t2 */
const double a= st0[0]-st2[0], b= st1[0]-st2[0];
const double c= st0[1]-st2[1], d= st1[1]-st2[1];
const double det= a*d - c*b;
@@ -2056,7 +2054,7 @@ void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const
(st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]);
/* X is 2D cross product (determinant)
- A= (p0-p) X (p0-p3)*/
+ * A= (p0-p) X (p0-p3)*/
const double a= (st0[0]-st[0])*(st0[1]-st3[1]) - (st0[1]-st[1])*(st0[0]-st3[0]);
/* B= ( (p0-p) X (p1-p2) + (p1-p) X (p0-p3) ) / 2 */
@@ -2083,7 +2081,7 @@ void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const
}
/* find UV such that
- fST = (1-u)(1-v)*ST0 + u*(1-v)*ST1 + u*v*ST2 + (1-u)*v*ST3 */
+ * fST = (1-u)(1-v)*ST0 + u*(1-v)*ST1 + u*v*ST2 + (1-u)*v*ST3 */
{
const double denom_s= (1-r_uv[0])*(st0[0]-st3[0]) + r_uv[0]*(st1[0]-st2[0]);
const double denom_t= (1-r_uv[0])*(st0[1]-st3[1]) + r_uv[0]*(st1[1]-st2[1]);
@@ -2386,7 +2384,7 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3],
}
/* Add weighted face normal component into normals of the face vertices.
- Caller must pass pre-allocated vdiffs of nverts length. */
+ * Caller must pass pre-allocated vdiffs of nverts length. */
void accumulate_vertex_normals_poly(float **vertnos, float polyno[3],
float **vertcos, float vdiffs[][3], int nverts)
{
@@ -2405,9 +2403,9 @@ void accumulate_vertex_normals_poly(float **vertnos, float polyno[3],
for(i=0; i<nverts; i++) {
const float *cur_edge = vdiffs[i];
-
+
/* calculate angle between the two poly edges incident on
- this vertex */
+ * this vertex */
const float fac= saacos(-dot_v3v3(cur_edge, prev_edge));
/* accumulate */
@@ -2501,27 +2499,27 @@ void tangent_from_uv(float uv1[2], float uv2[2], float uv3[3], float co1[3], flo
/* vector clouds */
/* void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,float (*rpos)[3], float *rweight,
- float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
-
-input
-(
-int list_size
-4 lists as pointer to array[list_size]
-1. current pos array of 'new' positions
-2. current weight array of 'new'weights (may be NULL pointer if you have no weights )
-3. reference rpos array of 'old' positions
-4. reference rweight array of 'old'weights (may be NULL pointer if you have no weights )
-)
-output
-(
-float lloc[3] center of mass pos
-float rloc[3] center of mass rpos
-float lrot[3][3] rotation matrix
-float lscale[3][3] scale matrix
-pointers may be NULL if not needed
-)
-
-*/
+ * float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
+ *
+ * input
+ * (
+ * int list_size
+ * 4 lists as pointer to array[list_size]
+ * 1. current pos array of 'new' positions
+ * 2. current weight array of 'new'weights (may be NULL pointer if you have no weights )
+ * 3. reference rpos array of 'old' positions
+ * 4. reference rweight array of 'old'weights (may be NULL pointer if you have no weights )
+ * )
+ * output
+ * (
+ * float lloc[3] center of mass pos
+ * float rloc[3] center of mass rpos
+ * float lrot[3][3] rotation matrix
+ * float lscale[3][3] scale matrix
+ * pointers may be NULL if not needed
+ * )
+ */
+
/* can't believe there is none in math utils */
static float _det_m3(float m2[3][3])
{
@@ -2608,7 +2606,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
m[2][2] += va[2] * vb[2];
/* building the referenc matrix on the fly
- needed to scale properly later*/
+ * needed to scale properly later */
mr[0][0] += va[0] * va[0];
mr[0][1] += va[0] * va[1];
@@ -3063,7 +3061,7 @@ static float ff_quad_form_factor(const float p[3], const float n[3], const float
float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], float v3[3], float v4[3])
{
/* computes how much hemisphere defined by point and normal is
- covered by a quad or triangle, cosine weighted */
+ * covered by a quad or triangle, cosine weighted */
float q0[3], q1[3], q2[3], q3[3], contrib= 0.0f;
if(ff_visible_quad(p, n, v1, v2, v3, q0, q1, q2, q3))
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index e07025ccf56..69e4102b497 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1290,7 +1290,7 @@ void print_m4(const char *str, float m[][4])
/*********************************** SVD ************************************
* from TNT matrix library
-
+ *
* Compute the Single Value Decomposition of an arbitrary matrix A
* That is compute the 3 matrices U,W,V with U column orthogonal (m,n)
* ,W a diagonal matrix and V an orthogonal square matrix s.t.
@@ -1724,7 +1724,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon)
{
/* compute moon-penrose pseudo inverse of matrix, singular values
- below epsilon are ignored for stability (truncated SVD) */
+ * below epsilon are ignored for stability (truncated SVD) */
float V[4][4], W[4], Wm[4][4], U[4][4];
int i;
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 38bc4794135..b3ce4ba88d4 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1077,7 +1077,7 @@ void compatible_eul(float eul[3], const float oldrot[3])
}
/* the method below was there from ancient days... but why! probably because the code sucks :)
- */
+ */
#if 0
/* calc again */
dx= eul[0] - oldrot[0];
@@ -1134,10 +1134,10 @@ void mat3_to_compatible_eul(float eul[3], const float oldrot[3], float mat[][3])
/* Euler Rotation Order Code:
* was adapted from
- ANSI C code from the article
- "Euler Angle Conversion"
- by Ken Shoemake, shoemake@graphics.cis.upenn.edu
- in "Graphics Gems IV", Academic Press, 1994
+ * ANSI C code from the article
+ * "Euler Angle Conversion"
+ * by Ken Shoemake, shoemake@graphics.cis.upenn.edu
+ * in "Graphics Gems IV", Academic Press, 1994
* for use in Blender
*/
@@ -1393,37 +1393,37 @@ void eulO_to_gimbal_axis(float gmat[][3], const float eul[3], const short order)
/******************************* Dual Quaternions ****************************/
-/*
- Conversion routines between (regular quaternion, translation) and
- dual quaternion.
-
- Version 1.0.0, February 7th, 2007
-
- Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights
- Reserved
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the author(s) be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Author: Ladislav Kavan, kavanl@cs.tcd.ie
-
- Changes for Blender:
- - renaming, style changes and optimizations
- - added support for scaling
-*/
+/**
+ * Conversion routines between (regular quaternion, translation) and
+ * dual quaternion.
+ *
+ * Version 1.0.0, February 7th, 2007
+ *
+ * Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights
+ * Reserved
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the author(s) be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ *
+ * \author Ladislav Kavan, kavanl@cs.tcd.ie
+ *
+ * Changes for Blender:
+ * - renaming, style changes and optimizations
+ * - added support for scaling
+ */
void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
{
@@ -1432,7 +1432,7 @@ void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
float R[4][4], S[4][4];
/* split scaling and rotation, there is probably a faster way to do
- this, it's done like this now to correctly get negative scaling */
+ * this, it's done like this now to correctly get negative scaling */
mult_m4_m4m4(baseRS, mat, basemat);
mat4_to_size(scale,baseRS);
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index ce9896b99cc..01ba62bc741 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -293,8 +293,8 @@ void bisect_v3_v3v3v3(float out[3], const float v1[3], const float v2[3], const
}
/* Returns a reflection vector from a vector and a normal vector
-reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
-*/
+ * reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
+ */
void reflect_v3_v3v3(float out[3], const float v1[3], const float v2[3])
{
float vec[3], normal[3];
@@ -336,8 +336,8 @@ void ortho_basis_v3v3_v3(float v1[3], float v2[3], const float v[3])
}
/* Rotate a point p by angle theta around an arbitrary axis r
- http://local.wasp.uwa.edu.au/~pbourke/geometry/
-*/
+ * http://local.wasp.uwa.edu.au/~pbourke/geometry/
+ */
void rotate_normalized_v3_v3v3fl(float r[3], const float p[3], const float axis[3], const float angle)
{
const float costheta= cos(angle);
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 12e11714a13..34e5cbc6a13 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -523,7 +523,7 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
float d= dot_v3v3(a, a);
/* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
+ * scaled down models with camera xtreme close */
if(d > 1.0e-35f) {
d= sqrtf(d);
mul_v3_v3fl(r, a, 1.0f/d);
@@ -541,7 +541,7 @@ MINLINE double normalize_v3_d(double n[3])
double d= n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
/* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
+ * scaled down models with camera xtreme close */
if(d > 1.0e-35) {
double mul;
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index f77ea3895c3..ddf165662fc 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -1043,7 +1043,8 @@ float BLI_hnoisep(float noisesize, float x, float y, float z)
return noise3_perlin(vec);
}
-/*static float turbulencep(float noisesize, float x, float y, float z, int nr)
+#if 0
+static float turbulencep(float noisesize, float x, float y, float z, int nr)
{
float vec[3];
@@ -1052,7 +1053,8 @@ float BLI_hnoisep(float noisesize, float x, float y, float z)
vec[2]= z/noisesize;
nr++;
return turbulence_perlin(vec, 1.0, (float)(1<<nr));
-}*/
+}
+#endif
/******************/
/* VORONOI/WORLEY */
@@ -1106,7 +1108,7 @@ static float dist_Minkovsky(float x, float y, float z, float e)
/* Not 'pure' Worley, but the results are virtually the same.
- Returns distances in da and point coords in pa */
+ * Returns distances in da and point coords in pa */
void voronoi(float x, float y, float z, float* da, float* pa, float me, int dtype)
{
int xx, yy, zz, xi, yi, zi;
@@ -1222,7 +1224,7 @@ static float voronoi_Cr(float x, float y, float z)
/* Signed version of all 6 of the above, just 2x-1, not really correct though (range is potentially (0, sqrt(6)).
- Used in the musgrave functions */
+ * Used in the musgrave functions */
static float voronoi_F1S(float x, float y, float z)
{
float da[4], pa[12];
@@ -1506,9 +1508,10 @@ float mg_fBm(float x, float y, float z, float H, float lacunarity, float octaves
* ``octaves'' is the number of frequencies in the fBm
* ``offset'' is the zero offset, which determines multifractality (NOT USED??)
*/
- /* this one is in fact rather confusing,
- * there seem to be errors in the original source code (in all three versions of proc.text&mod),
- * I modified it to something that made sense to me, so it might be wrong... */
+
+/* this one is in fact rather confusing,
+ * there seem to be errors in the original source code (in all three versions of proc.text&mod),
+ * I modified it to something that made sense to me, so it might be wrong... */
float mg_MultiFractal(float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
{
float rmd, value=1.0, pwr=1.0, pwHL=powf(lacunarity, -H);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index ec8e1cf6b82..41a73aaf4ba 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -335,7 +335,7 @@ void BLI_cleanup_path(const char *relabase, char *dir)
* is the same as
* strcpy( start, eind );
* except strcpy should not be used because there is overlap,
- * so use memmove's slightly more obscure syntax - Campbell
+ * so use memmove's slightly more obscure syntax - Campbell
*/
#ifdef WIN32
@@ -439,7 +439,7 @@ void BLI_path_rel(char *file, const char *relfile)
if (BLI_strnlen(relfile, 3) > 2 && relfile[1] != ':') {
char* ptemp;
/* fix missing volume name in relative base,
- can happen with old recent-files.txt files */
+ * can happen with old recent-files.txt files */
get_default_root(temp);
ptemp = &temp[2];
if (relfile[0] != '\\' && relfile[0] != '/') {
@@ -471,7 +471,7 @@ void BLI_path_rel(char *file, const char *relfile)
if (lslash)
{
/* find the prefix of the filename that is equal for both filenames.
- This is replaced by the two slashes at the beginning */
+ * This is replaced by the two slashes at the beginning */
char *p= temp;
char *q= file;
@@ -490,8 +490,8 @@ void BLI_path_rel(char *file, const char *relfile)
}
/* we might have passed the slash when the beginning of a dir matches
- so we rewind. Only check on the actual filename
- */
+ * so we rewind. Only check on the actual filename
+ */
if (*q != '/') {
while ( (q >= file) && (*q != '/') ) { --q; --p; }
}
@@ -502,10 +502,10 @@ void BLI_path_rel(char *file, const char *relfile)
strcpy(res, "//");
/* p now points to the slash that is at the beginning of the part
- where the path is different from the relative path.
- We count the number of directories we need to go up in the
- hierarchy to arrive at the common 'prefix' of the path
- */
+ * where the path is different from the relative path.
+ * We count the number of directories we need to go up in the
+ * hierarchy to arrive at the common 'prefix' of the path
+ */
while (p && p < lslash) {
if (*p == '/')
strcat(res, "../");
@@ -646,9 +646,9 @@ int BLI_path_abs(char *path, const char *basepath)
BLI_strncpy(vol, path, 3);
/* we are checking here if we have an absolute path that is not in the current
- blend file as a lib main - we are basically checking for the case that a
- UNIX root '/' is passed.
- */
+ * blend file as a lib main - we are basically checking for the case that a
+ * UNIX root '/' is passed.
+ */
if (!wasrelative && (vol[1] != ':' && (vol[0] == '\0' || vol[0] == '/' || vol[0] == '\\'))) {
char *p = path;
get_default_root(tmp);
@@ -685,11 +685,11 @@ int BLI_path_abs(char *path, const char *basepath)
BLI_cleanup_path(NULL, base);
/* push slashes into unix mode - strings entering this part are
- potentially messed up: having both back- and forward slashes.
- Here we push into one conform direction, and at the end we
- push them into the system specific dir. This ensures uniformity
- of paths and solving some problems (and prevent potential future
- ones) -jesterKing. */
+ * potentially messed up: having both back- and forward slashes.
+ * Here we push into one conform direction, and at the end we
+ * push them into the system specific dir. This ensures uniformity
+ * of paths and solving some problems (and prevent potential future
+ * ones) -jesterKing. */
BLI_char_switch(tmp, '\\', '/');
BLI_char_switch(base, '\\', '/');
@@ -716,11 +716,11 @@ int BLI_path_abs(char *path, const char *basepath)
#ifdef WIN32
/* skip first two chars, which in case of
- absolute path will be drive:/blabla and
- in case of relpath //blabla/. So relpath
- // will be retained, rest will be nice and
- shiny win32 backward slashes :) -jesterKing
- */
+ * absolute path will be drive:/blabla and
+ * in case of relpath //blabla/. So relpath
+ * // will be retained, rest will be nice and
+ * shiny win32 backward slashes :) -jesterKing
+ */
BLI_char_switch(path+2, '/', '\\');
#endif
@@ -753,12 +753,12 @@ int BLI_path_cwd(char *path)
printf( "Could not get the current working directory - $PWD for an unknown reason.");
} else {
/* uses the blend path relative to cwd important for loading relative linked files.
- *
- * cwd should contain c:\ etc on win32 so the relbase can be NULL
- * relbase being NULL also prevents // being misunderstood as relative to the current
- * blend file which isnt a feature we want to use in this case since were dealing
- * with a path from the command line, rather than from inside Blender */
-
+ *
+ * cwd should contain c:\ etc on win32 so the relbase can be NULL
+ * relbase being NULL also prevents // being misunderstood as relative to the current
+ * blend file which isnt a feature we want to use in this case since were dealing
+ * with a path from the command line, rather than from inside Blender */
+
char origpath[FILE_MAX];
BLI_strncpy(origpath, path, FILE_MAX);
@@ -805,7 +805,7 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
/* This is now only used to really get the user's default document folder */
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
- as default location to save documents */
+ * as default location to save documents */
const char *BLI_getDefaultDocumentFolder(void)
{
#ifndef WIN32
@@ -1196,8 +1196,8 @@ void BLI_setenv(const char *env, const char*val)
/**
- Only set an env var if already not there.
- Like Unix setenv(env, val, 0);
+ * Only set an env var if already not there.
+ * Like Unix setenv(env, val, 0);
*/
void BLI_setenv_if_new(const char *env, const char* val)
{
@@ -1288,13 +1288,13 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir,
/* we first push all slashes into unix mode, just to make sure we don't get
- any mess with slashes later on. -jesterKing */
+ * any mess with slashes later on. -jesterKing */
/* constant strings can be passed for those parameters - don't change them - elubie */
- /*
+#if 0
BLI_char_switch(relabase, '\\', '/');
BLI_char_switch(dir, '\\', '/');
BLI_char_switch(file, '\\', '/');
- */
+#endif
/* Resolve relative references */
if (relabase && dir[0] == '/' && dir[1] == '/') {
@@ -1547,31 +1547,31 @@ char *BLI_path_basename(char *path)
return filename ? filename + 1 : path;
}
-/*
- Produce image export path.
-
- Fails returning 0 if image filename is empty or if destination path
- matches image path (i.e. both are the same file).
-
- Trailing slash in dest_dir is optional.
-
- Logic:
-
- - if an image is "below" current .blend file directory, rebuild the
- same dir structure in dest_dir
-
- For example //textures/foo/bar.png becomes
- [dest_dir]/textures/foo/bar.png.
-
- - if an image is not "below" current .blend file directory,
- disregard it's path and copy it in the same directory where 3D file
- goes.
-
- For example //../foo/bar.png becomes [dest_dir]/bar.png.
-
- This logic will help ensure that all image paths are relative and
- that a user gets his images in one place. It'll also provide
- consistent behavior across exporters.
+/**
+ * Produce image export path.
+ *
+ * Fails returning 0 if image filename is empty or if destination path
+ * matches image path (i.e. both are the same file).
+ *
+ * Trailing slash in dest_dir is optional.
+ *
+ * Logic:
+ *
+ * - if an image is "below" current .blend file directory, rebuild the
+ * same dir structure in dest_dir
+ *
+ * For example //textures/foo/bar.png becomes
+ * [dest_dir]/textures/foo/bar.png.
+ *
+ * - if an image is not "below" current .blend file directory,
+ * disregard it's path and copy it in the same directory where 3D file
+ * goes.
+ *
+ * For example //../foo/bar.png becomes [dest_dir]/bar.png.
+ *
+ * This logic will help ensure that all image paths are relative and
+ * that a user gets his images in one place. It'll also provide
+ * consistent behavior across exporters.
*/
int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir)
{
@@ -1740,18 +1740,18 @@ static int add_win32_extension(char *name)
return (retval);
}
-/*
-* Checks if name is a fully qualified filename to an executable.
-* If not it searches $PATH for the file. On Windows it also
-* adds the correct extension (.com .exe etc) from
-* $PATHEXT if necessary. Also on Windows it translates
-* the name to its 8.3 version to prevent problems with
-* spaces and stuff. Final result is returned in fullname.
-*
-* \param fullname The full path and full name of the executable
-* (must be FILE_MAX minimum)
-* \param name The name of the executable (usually argv[0]) to be checked
-*/
+/**
+ * Checks if name is a fully qualified filename to an executable.
+ * If not it searches $PATH for the file. On Windows it also
+ * adds the correct extension (.com .exe etc) from
+ * $PATHEXT if necessary. Also on Windows it translates
+ * the name to its 8.3 version to prevent problems with
+ * spaces and stuff. Final result is returned in fullname.
+ *
+ * \param fullname The full path and full name of the executable
+ * (must be FILE_MAX minimum)
+ * \param name The name of the executable (usually argv[0]) to be checked
+ */
static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name)
{
char filename[FILE_MAX];
@@ -1849,15 +1849,15 @@ const char *BLI_program_dir(void)
}
/**
-* Gets the temp directory when blender first runs.
-* If the default path is not found, use try $TEMP
-*
-* Also make sure the temp dir has a trailing slash
-*
-* \param fullname The full path to the temp directory
-* \param maxlen The size of the fullname buffer
-* \param userdir Directory specified in user preferences
-*/
+ * Gets the temp directory when blender first runs.
+ * If the default path is not found, use try $TEMP
+ *
+ * Also make sure the temp dir has a trailing slash
+ *
+ * \param fullname The full path to the temp directory
+ * \param maxlen The size of the fullname buffer
+ * \param userdir Directory specified in user preferences
+ */
static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
{
fullname[0] = '\0';
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 318cd15d2e9..9e785f30ec7 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -63,52 +63,52 @@ struct PBVHNode {
BB orig_vb;
/* For internal nodes, the offset of the children in the PBVH
- 'nodes' array. */
+ * 'nodes' array. */
int children_offset;
/* Pointer into the PBVH prim_indices array and the number of
- primitives used by this leaf node.
-
- Used for leaf nodes in both mesh- and multires-based PBVHs.
- */
+ * primitives used by this leaf node.
+ *
+ * Used for leaf nodes in both mesh- and multires-based PBVHs.
+ */
int *prim_indices;
unsigned int totprim;
/* Array of indices into the mesh's MVert array. Contains the
- indices of all vertices used by faces that are within this
- node's bounding box.
-
- Note that a vertex might be used by a multiple faces, and
- these faces might be in different leaf nodes. Such a vertex
- will appear in the vert_indices array of each of those leaf
- nodes.
-
- In order to support cases where you want access to multiple
- nodes' vertices without duplication, the vert_indices array
- is ordered such that the first part of the array, up to
- index 'uniq_verts', contains "unique" vertex indices. These
- vertices might not be truly unique to this node, but if
- they appear in another node's vert_indices array, they will
- be above that node's 'uniq_verts' value.
-
- Used for leaf nodes in a mesh-based PBVH (not multires.)
- */
+ * indices of all vertices used by faces that are within this
+ * node's bounding box.
+ *
+ * Note that a vertex might be used by a multiple faces, and
+ * these faces might be in different leaf nodes. Such a vertex
+ * will appear in the vert_indices array of each of those leaf
+ * nodes.
+ *
+ * In order to support cases where you want access to multiple
+ * nodes' vertices without duplication, the vert_indices array
+ * is ordered such that the first part of the array, up to
+ * index 'uniq_verts', contains "unique" vertex indices. These
+ * vertices might not be truly unique to this node, but if
+ * they appear in another node's vert_indices array, they will
+ * be above that node's 'uniq_verts' value.
+ *
+ * Used for leaf nodes in a mesh-based PBVH (not multires.)
+ */
int *vert_indices;
unsigned int uniq_verts, face_verts;
/* An array mapping face corners into the vert_indices
- array. The array is sized to match 'totprim', and each of
- the face's corners gets an index into the vert_indices
- array, in the same order as the corners in the original
- MFace. The fourth value should not be used if the original
- face is a triangle.
-
- Used for leaf nodes in a mesh-based PBVH (not multires.)
- */
+ * array. The array is sized to match 'totprim', and each of
+ * the face's corners gets an index into the vert_indices
+ * array, in the same order as the corners in the original
+ * MFace. The fourth value should not be used if the original
+ * face is a triangle.
+ *
+ * Used for leaf nodes in a mesh-based PBVH (not multires.)
+ */
int (*face_vert_indices)[4];
/* Indicates whether this node is a leaf or not; also used for
- marking various updates that need to be applied. */
+ * marking various updates that need to be applied. */
PBVHNodeFlags flag : 8;
/* Used for raycasting: how close bb is to the ray point. */
@@ -140,7 +140,7 @@ struct PBVH {
int gridsize;
/* Only used during BVH build and update,
- don't need to remain valid after */
+ * don't need to remain valid after */
BLI_bitmap vert_bitmap;
#ifdef PERFCNTRS
@@ -311,7 +311,7 @@ static void grow_nodes(PBVH *bvh, int totnode)
}
/* Add a vertex to the map, with a positive value for unique vertices and
- a negative value for additional vertices */
+ * a negative value for additional vertices */
static int map_insert_vert(PBVH *bvh, GHash *map,
unsigned int *face_verts,
unsigned int *uniq_verts, int vertex)
@@ -417,15 +417,15 @@ static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
}
/* Recursively build a node in the tree
-
- vb is the voxel box around all of the primitives contained in
- this node.
-
- cb is the bounding box around all the centroids of the primitives
- contained in this node
-
- offset and start indicate a range in the array of primitive indices
-*/
+ *
+ * vb is the voxel box around all of the primitives contained in
+ * this node.
+ *
+ * cb is the bounding box around all the centroids of the primitives
+ * contained in this node
+ *
+ * offset and start indicate a range in the array of primitive indices
+ */
static void build_sub(PBVH *bvh, int node_index, BB *cb, BBC *prim_bbc,
int offset, int count)
@@ -689,7 +689,7 @@ static PBVHNode *pbvh_iter_next(PBVHIter *iter)
int revisiting;
/* purpose here is to traverse tree, visiting child nodes before their
- parents, this order is necessary for e.g. computing bounding boxes */
+ * parents, this order is necessary for e.g. computing bounding boxes */
while(iter->stacksize) {
/* pop node */
@@ -925,18 +925,18 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
return;
/* could be per node to save some memory, but also means
- we have to store for each vertex which node it is in */
+ * we have to store for each vertex which node it is in */
vnor= MEM_callocN(sizeof(float)*3*bvh->totvert, "bvh temp vnors");
- /* subtle assumptions:
- - We know that for all edited vertices, the nodes with faces
- adjacent to these vertices have been marked with PBVH_UpdateNormals.
- This is true because if the vertex is inside the brush radius, the
- bounding box of it's adjacent faces will be as well.
- - However this is only true for the vertices that have actually been
- edited, not for all vertices in the nodes marked for update, so we
- can only update vertices marked with ME_VERT_PBVH_UPDATE.
- */
+ /* subtle assumptions:
+ * - We know that for all edited vertices, the nodes with faces
+ * adjacent to these vertices have been marked with PBVH_UpdateNormals.
+ * This is true because if the vertex is inside the brush radius, the
+ * bounding box of it's adjacent faces will be as well.
+ * - However this is only true for the vertices that have actually been
+ * edited, not for all vertices in the nodes marked for update, so we
+ * can only update vertices marked with ME_VERT_PBVH_UPDATE.
+ */
#pragma omp parallel for private(n) schedule(static)
for(n = 0; n < totnode; n++) {
@@ -966,7 +966,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
if(bvh->verts[v].flag & ME_VERT_PBVH_UPDATE) {
/* this seems like it could be very slow but profile
- does not show this, so just leave it for now? */
+ * does not show this, so just leave it for now? */
#pragma omp atomic
vnor[v][0] += fn[0];
#pragma omp atomic
@@ -1454,10 +1454,10 @@ void BLI_pbvh_node_draw(PBVHNode *node, void *UNUSED(data))
}
/* Adapted from:
- http://www.gamedev.net/community/forums/topic.asp?topic_id=512123
- Returns true if the AABB is at least partially within the frustum
- (ok, not a real frustum), false otherwise.
-*/
+ * http://www.gamedev.net/community/forums/topic.asp?topic_id=512123
+ * Returns true if the AABB is at least partially within the frustum
+ * (ok, not a real frustum), false otherwise.
+ */
int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
{
float (*planes)[4] = data;
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index b828ae052f8..7061a0fcf08 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -139,9 +139,9 @@ struct mem_elements {
/* simple optimization for allocating thousands of small memory blocks
- only to be used within loops, and not by one function at a time
- free in the end, with argument '-1'
-*/
+ * only to be used within loops, and not by one function at a time
+ * free in the end, with argument '-1'
+ */
#define MEM_ELEM_BLOCKSIZE 16384
static struct mem_elements * melem__cur= NULL;
static int melem__offs= 0; /* the current free address */
@@ -423,7 +423,7 @@ static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
static void testvertexnearedge(void)
{
/* only vertices with ->h==1 are being tested for
- being close to an edge, if true insert */
+ * being close to an edge, if true insert */
ScanFillVert *eve;
ScanFillEdge *eed,*ed1;
@@ -528,7 +528,8 @@ static int scanfill(PolyFill *pf)
nr= pf->nr;
- /* PRINTS
+ /* PRINTS */
+#if 0
verts= pf->verts;
eve= fillvertbase.first;
while(eve) {
@@ -539,7 +540,8 @@ static int scanfill(PolyFill *pf)
while(eed) {
printf("edge: %x verts: %x %x\n",eed,eed->v1,eed->v2);
eed= eed->next;
- } */
+ }
+#endif
/* STEP 0: remove zero sized edges */
eed= filledgebase.first;
@@ -567,8 +569,8 @@ static int scanfill(PolyFill *pf)
}
/* STEP 1: make using FillVert and FillEdge lists a sorted
- ScanFillVertLink list
- */
+ * ScanFillVertLink list
+ */
sc= scdata= (ScanFillVertLink *)MEM_callocN(pf->verts*sizeof(ScanFillVertLink),"Scanfill1");
eve= fillvertbase.first;
verts= 0;
@@ -591,10 +593,10 @@ static int scanfill(PolyFill *pf)
nexted= eed->next;
BLI_remlink(&filledgebase,eed);
/* This code is for handling zero-length edges that get
- collapsed in step 0. It was removed for some time to
- fix trunk bug #4544, so if that comes back, this code
- may need some work, or there will have to be a better
- fix to #4544. */
+ * collapsed in step 0. It was removed for some time to
+ * fix trunk bug #4544, so if that comes back, this code
+ * may need some work, or there will have to be a better
+ * fix to #4544. */
if(eed->v1->f==255) {
v1= eed->v1;
while((eed->v1->f == 255) && (eed->v1->tmp.v != v1))
@@ -609,7 +611,7 @@ static int scanfill(PolyFill *pf)
eed= nexted;
}
- /*
+#if 0
sc= scdata;
for(a=0;a<verts;a++) {
printf("\nscvert: %x\n",sc->v1);
@@ -619,7 +621,8 @@ static int scanfill(PolyFill *pf)
eed= eed->next;
}
sc++;
- }*/
+ }
+#endif
/* STEP 2: FILL LOOP */
@@ -788,13 +791,13 @@ int BLI_begin_edgefill(void)
int BLI_edgefill(short mat_nr)
{
/*
- - fill works with its own lists, so create that first (no faces!)
- - for vertices, put in ->tmp.v the old pointer
- - struct elements xs en ys are not used here: don't hide stuff in it
- - edge flag ->f becomes 2 when it's a new edge
- - mode: & 1 is check for crossings, then create edges (TO DO )
- - returns number of triangle faces added.
- */
+ * - fill works with its own lists, so create that first (no faces!)
+ * - for vertices, put in ->tmp.v the old pointer
+ * - struct elements xs en ys are not used here: don't hide stuff in it
+ * - edge flag ->f becomes 2 when it's a new edge
+ * - mode: & 1 is check for crossings, then create edges (TO DO )
+ * - returns number of triangle faces added.
+ */
ListBase tempve, temped;
ScanFillVert *eve;
ScanFillEdge *eed,*nexted;
@@ -990,14 +993,14 @@ int BLI_edgefill(short mat_nr)
/* CURRENT STATUS:
- - eve->f :1= availalble in edges
- - eve->xs :polynumber
- - eve->h :amount of edges connected to vertex
- - eve->tmp.v :store! original vertex number
-
- - eed->f :1= boundary edge (optionally set by caller)
- - eed->f1 :poly number
- */
+ * - eve->f :1= availalble in edges
+ * - eve->xs :polynumber
+ * - eve->h :amount of edges connected to vertex
+ * - eve->tmp.v :store! original vertex number
+ *
+ * - eed->f :1= boundary edge (optionally set by caller)
+ * - eed->poly_nr :poly number
+ */
/* STEP 3: MAKE POLYFILL STRUCT */
@@ -1040,13 +1043,15 @@ int BLI_edgefill(short mat_nr)
/* so, sort first */
qsort(pflist, poly, sizeof(PolyFill), vergpoly);
-
- /*pf= pflist;
+
+#if 0
+ pf= pflist;
for(a=1;a<=poly;a++) {
printf("poly:%d edges:%d verts:%d flag: %d\n",a,pf->edges,pf->verts,pf->f);
PRINT2(f, f, pf->min[0], pf->min[1]);
pf++;
- }*/
+ }
+#endif
polycache= pc= MEM_callocN(sizeof(short)*poly, "polycache");
pf= pflist;
@@ -1071,13 +1076,15 @@ int BLI_edgefill(short mat_nr)
}
MEM_freeN(polycache);
}
-
- /* printf("after merge\n");
+
+#if 0
+ printf("after merge\n");
pf= pflist;
for(a=1;a<=poly;a++) {
printf("poly:%d edges:%d verts:%d flag: %d\n",a,pf->edges,pf->verts,pf->f);
pf++;
- } */
+ }
+#endif
/* STEP 5: MAKE TRIANGLES */
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 7c48d000d39..29f11ee0550 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -444,9 +444,9 @@ int BLI_exists(const char *name)
{
#if defined(WIN32) && !defined(__MINGW32__)
struct _stat64i32 st;
- /* in Windows stat doesn't recognize dir ending on a slash
- To not break code where the ending slash is expected we
- don't mess with the argument name directly here - elubie */
+ /* in Windows stat doesn't recognize dir ending on a slash
+ * To not break code where the ending slash is expected we
+ * don't mess with the argument name directly here - elubie */
char tmp[FILE_MAX];
int len, res;
BLI_strncpy(tmp, name, FILE_MAX);
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index e2c86d70872..80f1606414c 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -326,11 +326,11 @@ int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
int BLI_natstrcmp(const char *s1, const char *s2)
{
int d1= 0, d2= 0;
-
+
/* if both chars are numeric, to a strtol().
- then increase string deltas as long they are
- numeric, else do a tolower and char compare */
-
+ * then increase string deltas as long they are
+ * numeric, else do a tolower and char compare */
+
while(1) {
char c1 = tolower(s1[d1]);
char c2 = tolower(s2[d2]);
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index c958648836b..c60df413161 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -27,8 +27,8 @@
*/
/** \file blender/blenlib/intern/string_utf8.c
- * \ingroup bli
- */
+ * \ingroup bli
+ */
#include <string.h>
#include <wchar.h>
@@ -41,9 +41,9 @@
* http://svn.swish-e.org/libswish3/trunk/src/libswish3/utf8.c r3044 - campbell */
/* based on the valid_utf8 routine from the PCRE library by Philip Hazel
-
- length is in bytes, since without knowing whether the string is valid
- it's hard to know how many characters there are! */
+ *
+ * length is in bytes, since without knowing whether the string is valid
+ * it's hard to know how many characters there are! */
static const char trailingBytesForUTF8[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -101,7 +101,7 @@ int BLI_utf8_invalid_byte(const char *str, int length)
break;
/* Check for leading 0xfe or 0xff,
- and then for 1111 1100, xx00 00xx */
+ * and then for 1111 1100, xx00 00xx */
case 5:
if (c == 0xfe || c == 0xff ||
(c == 0xfc && (*p & 0x3c) == 0)) goto utf8_error;
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index e92b445c27f..6048ca8cfc3 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -63,48 +63,48 @@ static void *thread_tls_data;
#endif
/* ********** basic thread control API ************
-
-Many thread cases have an X amount of jobs, and only an Y amount of
-threads are useful (typically amount of cpus)
-
-This code can be used to start a maximum amount of 'thread slots', which
-then can be filled in a loop with an idle timer.
-
-A sample loop can look like this (pseudo c);
-
- ListBase lb;
- int maxthreads= 2;
- int cont= 1;
-
- BLI_init_threads(&lb, do_something_func, maxthreads);
-
- while(cont) {
- if(BLI_available_threads(&lb) && !(escape loop event)) {
- // get new job (data pointer)
- // tag job 'processed
- BLI_insert_thread(&lb, job);
- }
- else PIL_sleep_ms(50);
-
- // find if a job is ready, this the do_something_func() should write in job somewhere
- cont= 0;
- for(go over all jobs)
- if(job is ready) {
- if(job was not removed) {
- BLI_remove_thread(&lb, job);
- }
- }
- else cont= 1;
- }
- // conditions to exit loop
- if(if escape loop event) {
- if(BLI_available_threadslots(&lb)==maxthreads)
- break;
- }
- }
-
- BLI_end_threads(&lb);
-
+ *
+ * Many thread cases have an X amount of jobs, and only an Y amount of
+ * threads are useful (typically amount of cpus)
+ *
+ * This code can be used to start a maximum amount of 'thread slots', which
+ * then can be filled in a loop with an idle timer.
+ *
+ * A sample loop can look like this (pseudo c);
+ *
+ * ListBase lb;
+ * int maxthreads= 2;
+ * int cont= 1;
+ *
+ * BLI_init_threads(&lb, do_something_func, maxthreads);
+ *
+ * while(cont) {
+ * if(BLI_available_threads(&lb) && !(escape loop event)) {
+ * // get new job (data pointer)
+ * // tag job 'processed
+ * BLI_insert_thread(&lb, job);
+ * }
+ * else PIL_sleep_ms(50);
+ *
+ * // find if a job is ready, this the do_something_func() should write in job somewhere
+ * cont= 0;
+ * for(go over all jobs)
+ * if(job is ready) {
+ * if(job was not removed) {
+ * BLI_remove_thread(&lb, job);
+ * }
+ * }
+ * else cont= 1;
+ * }
+ * // conditions to exit loop
+ * if(if escape loop event) {
+ * if(BLI_available_threadslots(&lb)==maxthreads)
+ * break;
+ * }
+ * }
+ *
+ * BLI_end_threads(&lb);
+ *
************************************************ */
static pthread_mutex_t _malloc_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _image_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -146,8 +146,8 @@ void BLI_threadapi_init(void)
}
/* tot = 0 only initializes malloc mutex in a safe way (see sequence.c)
- problem otherwise: scene render will kill of the mutex!
-*/
+ * problem otherwise: scene render will kill of the mutex!
+ */
void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
{
@@ -172,8 +172,8 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
- we copy gomp thread local storage pointer to setting it again
- inside the thread that we start */
+ * we copy gomp thread local storage pointer to setting it again
+ * inside the thread that we start */
thread_tls_data = pthread_getspecific(gomp_tls_key);
#endif
}
@@ -213,7 +213,7 @@ static void *tslot_thread_start(void *tslot_p)
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
- set gomp thread local storage pointer which was copied beforehand */
+ * set gomp thread local storage pointer which was copied beforehand */
pthread_setspecific (gomp_tls_key, thread_tls_data);
#endif
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index b2002b63a22..d61f4a8880e 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -227,8 +227,8 @@ void get_default_root(char* root)
char str[MAX_PATH+1];
/* the default drive to resolve a directory without a specified drive
- should be the Windows installation drive, since this was what the OS
- assumes. */
+ * should be the Windows installation drive, since this was what the OS
+ * assumes. */
if (GetWindowsDirectory(str,MAX_PATH+1)) {
root[0] = str[0];
root[1] = ':';
@@ -236,7 +236,7 @@ void get_default_root(char* root)
root[3] = '\0';
} else {
/* if GetWindowsDirectory fails, something has probably gone wrong,
- we are trying the blender install dir though */
+ * we are trying the blender install dir though */
if (GetModuleFileName(NULL,str,MAX_PATH+1)) {
printf("Error! Could not get the Windows Directory - Defaulting to Blender installation Dir!");
root[0] = str[0];