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:
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/BLI_args.c3
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c9
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c3
-rw-r--r--source/blender/blenlib/intern/bpath.c12
-rw-r--r--source/blender/blenlib/intern/math_base.c3
-rw-r--r--source/blender/blenlib/intern/path_util.c18
-rw-r--r--source/blender/blenlib/intern/storage.c3
-rw-r--r--source/blender/blenlib/intern/string.c18
-rw-r--r--source/blender/blenlib/intern/threads.c3
9 files changed, 48 insertions, 24 deletions
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 5f31565d65b..cf3605a80ff 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -76,7 +76,8 @@ struct bArgs {
int *passes;
};
-static unsigned int case_strhash(const void *ptr) {
+static unsigned int case_strhash(const void *ptr)
+{
const char *s= ptr;
unsigned int i= 0;
unsigned char c;
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 7587a5195a2..e877e985d94 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -70,7 +70,8 @@ struct DynStr {
/***/
-DynStr *BLI_dynstr_new(void) {
+DynStr *BLI_dynstr_new(void)
+{
DynStr *ds= MEM_mallocN(sizeof(*ds), "DynStr");
ds->elems= ds->last= NULL;
ds->curlen= 0;
@@ -78,7 +79,8 @@ DynStr *BLI_dynstr_new(void) {
return ds;
}
-void BLI_dynstr_append(DynStr *ds, const char *cstr) {
+void BLI_dynstr_append(DynStr *ds, const char *cstr)
+{
DynStrElem *dse= malloc(sizeof(*dse));
int cstrlen= strlen(cstr);
@@ -220,7 +222,8 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
}
}
-int BLI_dynstr_get_len(DynStr *ds) {
+int BLI_dynstr_get_len(DynStr *ds)
+{
return ds->curlen;
}
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index eae4f918a67..8e68d42456f 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -350,7 +350,8 @@ static void sort_along_axis(BVHTree *tree, int start, int end, int axis)
//after a call to this function you can expect one of:
// every node to left of a[n] are smaller or equal to it
// every node to the right of a[n] are greater or equal to it
-static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){
+static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis)
+{
int begin = _begin, end = _end, cut;
while(end-begin > 3)
{
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 654ade8955f..485b8137a02 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -644,7 +644,8 @@ void BLI_bpathIterator_step(struct BPathIterator *bpi)
}
}
-int BLI_bpathIterator_isDone( struct BPathIterator *bpi) {
+int BLI_bpathIterator_isDone( struct BPathIterator *bpi)
+{
return bpi->type==BPATH_DONE;
}
@@ -699,7 +700,8 @@ static void bpath_as_report(struct BPathIterator *bpi, const char *message, Repo
}
/* high level function */
-void checkMissingFiles(Main *bmain, ReportList *reports) {
+void checkMissingFiles(Main *bmain, ReportList *reports)
+{
struct BPathIterator *bpi;
/* be sure there is low chance of the path being too short */
@@ -718,7 +720,8 @@ void checkMissingFiles(Main *bmain, ReportList *reports) {
}
/* dont log any errors at the moment, should probably do this */
-void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
+void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
+{
int tot= 0, changed= 0, failed= 0, linked= 0;
struct BPathIterator *bpi;
char filepath[FILE_MAX];
@@ -886,7 +889,8 @@ static int findFileRecursive(char *filename_new, const char *dirname, const char
}
/* high level function - call from fileselector */
-void findMissingFiles(Main *bmain, const char *str) {
+void findMissingFiles(Main *bmain, const char *str)
+{
struct BPathIterator *bpi;
/* be sure there is low chance of the path being too short */
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index 8ad93495f6d..3e18517f3e5 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -64,7 +64,8 @@ double round(double x);
/* from python 3.1 floatobject.c
* ndigits must be between 0 and 21 */
-double double_round(double x, int ndigits) {
+double double_round(double x, int ndigits)
+{
double pow1, pow2, y, z;
if (ndigits >= 0) {
pow1 = pow(10.0, (double)ndigits);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 0b750d5fff3..8adede3337c 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -785,7 +785,8 @@ 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 */
-const char *BLI_getDefaultDocumentFolder(void) {
+const char *BLI_getDefaultDocumentFolder(void)
+{
#if !defined(WIN32)
return getenv("HOME");
@@ -1206,7 +1207,8 @@ void BLI_char_switch(char *string, char from, char to)
}
}
-void BLI_make_exist(char *dir) {
+void BLI_make_exist(char *dir)
+{
int a;
BLI_char_switch(dir, ALTSEP, SEP);
@@ -1550,7 +1552,8 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
return 1;
}
-char *BLI_first_slash(char *string) {
+char *BLI_first_slash(char *string)
+{
char *ffslash, *fbslash;
ffslash= strchr(string, '/');
@@ -1563,7 +1566,8 @@ char *BLI_first_slash(char *string) {
else return fbslash;
}
-char *BLI_last_slash(const char *string) {
+char *BLI_last_slash(const char *string)
+{
char *lfslash, *lbslash;
lfslash= strrchr(string, '/');
@@ -1577,7 +1581,8 @@ char *BLI_last_slash(const char *string) {
}
/* adds a slash if there isnt one there already */
-int BLI_add_slash(char *string) {
+int BLI_add_slash(char *string)
+{
int len = strlen(string);
#ifdef WIN32
if (len==0 || string[len-1]!='\\') {
@@ -1596,7 +1601,8 @@ int BLI_add_slash(char *string) {
}
/* removes a slash if there is one */
-void BLI_del_slash(char *string) {
+void BLI_del_slash(char *string)
+{
int len = strlen(string);
while (len) {
#ifdef WIN32
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 8be86a4b407..e336b914ffa 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -469,7 +469,8 @@ int BLI_exist(const char *name)
}
/* would be better in fileops.c except that it needs stat.h so add here */
-int BLI_is_dir(const char *file) {
+int BLI_is_dir(const char *file)
+{
return S_ISDIR(BLI_exist(file));
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 8315161aeda..db5d4dc99eb 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -43,14 +43,16 @@
#include "BLI_dynstr.h"
#include "BLI_string.h"
-char *BLI_strdupn(const char *str, const size_t len) {
+char *BLI_strdupn(const char *str, const size_t len)
+{
char *n= MEM_mallocN(len+1, "strdup");
memcpy(n, str, len);
n[len]= '\0';
return n;
}
-char *BLI_strdup(const char *str) {
+char *BLI_strdup(const char *str)
+{
return BLI_strdupn(str, strlen(str));
}
@@ -67,7 +69,8 @@ char *BLI_strdupcat(const char *str1, const char *str2)
return n;
}
-char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy) {
+char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
+{
size_t srclen= strlen(src);
size_t cpylen= (srclen>(maxncpy-1))?(maxncpy-1):srclen;
@@ -87,7 +90,8 @@ size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
if (n != -1 && n < count) {
buffer[n] = '\0';
- } else {
+ }
+ else {
buffer[count-1] = '\0';
}
@@ -280,7 +284,8 @@ char *BLI_strcasestr(const char *s, const char *find)
}
-int BLI_strcasecmp(const char *s1, const char *s2) {
+int BLI_strcasecmp(const char *s1, const char *s2)
+{
int i;
for (i=0; ; i++) {
@@ -299,7 +304,8 @@ int BLI_strcasecmp(const char *s1, const char *s2) {
return 0;
}
-int BLI_strncasecmp(const char *s1, const char *s2, size_t len) {
+int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
+{
int i;
for (i=0; i<len; i++) {
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index f9cd675dd8c..097ad2bcd74 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -218,7 +218,8 @@ static void *tslot_thread_start(void *tslot_p)
return tslot->do_thread(tslot->callerdata);
}
-int BLI_thread_is_main(void) {
+int BLI_thread_is_main(void)
+{
return pthread_equal(pthread_self(), mainid);
}