diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
commit | 31d2ee9bf77bb991ea4779c47379b2cee84b27ed (patch) | |
tree | fd6f021356fc78d6dfeff9f18f601ce645dd7ffe /source/blender/blenlib | |
parent | 7b7214c72233f72268f72d31fd8626a0f94e557e (diff) |
style cleanup, brackets in else/if, some indentation.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/BLI_args.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/freetypefont.c | 20 | ||||
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 21 |
7 files changed, 25 insertions, 49 deletions
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index bbf005e79ac..3d137641889 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -237,8 +237,7 @@ void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg) { bArgument *a = lookUp(ba, arg, -1, -1); - if (a) - { + if (a) { bArgDoc *d = a->doc; internalDocPrint(d); @@ -251,10 +250,8 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba) { bArgDoc *d; - for( d = ba->docs.first; d; d = d->next) - { - if (d->done == 0) - { + for (d = ba->docs.first; d; d = d->next) { + if (d->done == 0) { internalDocPrint(d); } } diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 4debe1a4b04..72f312ba6e4 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -94,8 +94,7 @@ void *BLI_memarena_alloc(MemArena *ma, int size) if (size>ma->cursize) { unsigned char *tmp; - if(size > ma->bufsize - (ma->align - 1)) - { + if(size > ma->bufsize - (ma->align - 1)) { ma->cursize = PADUP(size+1, ma->align); } else ma->cursize = ma->bufsize; diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 8fe081fe70b..f55ebf915e2 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -99,8 +99,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf err= FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP); // If loading succeeded, convert the FT glyph to the internal format - if(!err) - { + if(!err) { int *npoints; int *onpoints; @@ -162,9 +161,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf if(k == 0) m = l; //virtual conic on-curve points - if(k < npoints[j] - 1 ) - { - if( ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) { + if (k < npoints[j] - 1) { + if (ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) { dx = (ftoutline.points[l].x + ftoutline.points[l+1].x)* scale / 2.0f; dy = (ftoutline.points[l].y + ftoutline.points[l+1].y)* scale / 2.0f; @@ -291,8 +289,7 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode) if(!tf) return FALSE; // Load the font to memory - if(tf->pf) - { + if (tf->pf) { err= FT_New_Memory_Face( library, tf->pf->data, tf->pf->size, @@ -369,17 +366,14 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf) lcode= charcode= FT_Get_First_Char(face, &glyph_index); // No charmap found from the ttf so we need to figure it out - if(glyph_index == 0) - { + if (glyph_index == 0) { FT_CharMap found = NULL; FT_CharMap charmap; int n; - for ( n = 0; n < face->num_charmaps; n++ ) - { + for (n = 0; n < face->num_charmaps; n++) { charmap = face->charmaps[n]; - if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) - { + if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) { found = charmap; break; } diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 6155bf83a57..71077f8e467 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -182,10 +182,8 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *)) if (cmp == NULL) return; if (listbase == NULL) return; - if (listbase->first != listbase->last) - { - for( previous = listbase->first, current = previous->next; current; current = next ) - { + if (listbase->first != listbase->last) { + for (previous = listbase->first, current = previous->next; current; current = next) { next = current->next; previous = current->prev; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 9f5e191c9ff..18418f3105c 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -957,8 +957,7 @@ int isect_sweeping_sphere_tri_v3( return 0; } } - else - { + else { float t0=(-a+radius)/nordotv; float t1=(-a-radius)/nordotv; @@ -1279,13 +1278,11 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float return 1; /* intersection found */ } - else - { + else { return 0; } } - else - { + else { return 0; } } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 54a865c7c22..ffee44078b2 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -468,8 +468,7 @@ void BLI_path_rel(char *file, const char *relfile) /* the last slash in the file indicates where the path part ends */ lslash = BLI_last_slash(temp); - if (lslash) - { + if (lslash) { /* find the prefix of the filename that is equal for both filenames. * This is replaced by the two slashes at the beginning */ char *p= temp; @@ -838,8 +837,7 @@ const char *BLI_getDefaultDocumentFolder(void) */ hResult = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, documentfolder); - if (hResult == S_OK) - { + if (hResult == S_OK) { if (BLI_is_dir(documentfolder)) return documentfolder; } diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 6048ca8cfc3..3894a6a0b8e 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -464,12 +464,10 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep worker = MEM_callocN(sizeof(ThreadedWorker), "threadedworker"); - if (tot > RE_MAX_THREAD) - { + if (tot > RE_MAX_THREAD) { tot = RE_MAX_THREAD; } - else if (tot < 1) - { + else if (tot < 1) { tot= 1; } @@ -498,25 +496,20 @@ void BLI_insert_work(ThreadedWorker *worker, void *param) WorkParam *p = MEM_callocN(sizeof(WorkParam), "workparam"); int index; - if (BLI_available_threads(&worker->threadbase) == 0) - { + if (BLI_available_threads(&worker->threadbase) == 0) { index = worker->total; - while(index == worker->total) - { + while(index == worker->total) { PIL_sleep_ms(worker->sleep_time); - for (index = 0; index < worker->total; index++) - { - if (worker->busy[index] == 0) - { + for (index = 0; index < worker->total; index++) { + if (worker->busy[index] == 0) { BLI_remove_thread_index(&worker->threadbase, index); break; } } } } - else - { + else { index = BLI_available_thread_index(&worker->threadbase); } |