diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-10 19:20:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-10 19:20:10 +0400 |
commit | 5534701e5d7659d8fdd73ef64375116bb07463e8 (patch) | |
tree | 9c667fb154109a59a0682b036879d15e7038f0ea /source/blender/blenlib | |
parent | 10932e2e9785b92f786deeec2794816a05a6fed1 (diff) |
style cleanup: use capital camel case names for typedef's
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_boxpack2d.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/boxpack2d.c | 28 | ||||
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 70 |
3 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack2d.h index 77e937d7b6f..3bc486054f5 100644 --- a/source/blender/blenlib/BLI_boxpack2d.h +++ b/source/blender/blenlib/BLI_boxpack2d.h @@ -43,7 +43,7 @@ typedef struct BoxPack { /* Verts this box uses * (BL,TR,TL,BR) / 0,1,2,3 */ - struct boxVert *v[4]; + struct BoxVert *v[4]; } BoxPack; void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height); diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index bf63517a4c2..feaa60b40b2 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -33,7 +33,7 @@ * * The defined Below are for internal use only */ -typedef struct boxVert { +typedef struct BoxVert { float x; float y; short free; @@ -48,7 +48,7 @@ typedef struct boxVert { struct BoxPack *isect_cache[4]; int index; -} boxVert; +} BoxVert; /* free vert flags */ #define EPSILON 0.0000001f @@ -121,11 +121,11 @@ static int box_areasort(const void *p1, const void *p2) * */ static float box_width; static float box_height; -static boxVert *vertarray; +static BoxVert *vertarray; static int vertex_sort(const void *p1, const void *p2) { - boxVert *v1, *v2; + BoxVert *v1, *v2; float a1, a2; v1 = vertarray + ((int *)p1)[0]; @@ -154,7 +154,7 @@ static int vertex_sort(const void *p1, const void *p2) * */ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height) { - boxVert *vert; /* the current vert */ + BoxVert *vert; /* the current vert */ int box_index, verts_pack_len, i, j, k, isect; int quad_flags[4] = {BLF, TRF, TLF, BRF}; /* use for looping */ BoxPack *box, *box_test; /*current box and another for intersection tests*/ @@ -170,38 +170,38 @@ void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float * qsort(boxarray, len, sizeof(BoxPack), box_areasort); /* add verts to the boxes, these are only used internally */ - vert = vertarray = MEM_mallocN(len * 4 * sizeof(boxVert), "BoxPack Verts"); + vert = vertarray = MEM_mallocN(len * 4 * sizeof(BoxVert), "BoxPack Verts"); vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "BoxPack Indices"); for (box = boxarray, box_index = 0, i = 0; box_index < len; box_index++, box++) { vert->blb = vert->brb = vert->tlb = - vert->isect_cache[0] = vert->isect_cache[1] = - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS & ~TRF; vert->trb = box; vert->index = i; i++; box->v[BL] = vert; vert++; vert->trb = vert->brb = vert->tlb = - vert->isect_cache[0] = vert->isect_cache[1] = - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS & ~BLF; vert->blb = box; vert->index = i; i++; box->v[TR] = vert; vert++; vert->trb = vert->blb = vert->tlb = - vert->isect_cache[0] = vert->isect_cache[1] = - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS & ~BRF; vert->brb = box; vert->index = i; i++; box->v[TL] = vert; vert++; vert->trb = vert->blb = vert->brb = - vert->isect_cache[0] = vert->isect_cache[1] = - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS & ~TLF; vert->tlb = box; vert->index = i; i++; diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index e6d06484e74..ec7b59702bd 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -385,16 +385,16 @@ int BLI_rename(const char *from, const char *to) enum { /* operation succeeded succeeded */ - recursiveOp_Callback_OK = 0, + RecursiveOp_Callback_OK = 0, /* operation requested not to perform recursive digging for current path */ - recursiveOp_Callback_StopRecurs = 1, + RecursiveOp_Callback_StopRecurs = 1, /* error occured in callback and recursive walking should stop immediately */ - recursiveOp_Callback_Error = 2 + RecursiveOp_Callback_Error = 2 } recuresiveOp_Callback_Result; -typedef int (*recursiveOp_Callback)(const char *from, const char *to); +typedef int (*RecursiveOp_Callback)(const char *from, const char *to); /* appending of filename to dir (ensures for buffer size before appending) */ static void join_dirfile_alloc(char **dst, size_t *alloc_len, const char *dir, const char *file) @@ -419,8 +419,8 @@ static char *strip_last_slash(const char *dir) return result; } -static int recursive_operation(const char *startfrom, const char *startto, recursiveOp_Callback callback_dir_pre, - recursiveOp_Callback callback_file, recursiveOp_Callback callback_dir_post) +static int recursive_operation(const char *startfrom, const char *startto, RecursiveOp_Callback callback_dir_pre, + RecursiveOp_Callback callback_file, RecursiveOp_Callback callback_dir_post) { struct dirent **dirlist; struct stat st; @@ -446,7 +446,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur if (callback_file) { ret = callback_file(from, to); - if (ret != recursiveOp_Callback_OK) + if (ret != RecursiveOp_Callback_OK) ret = -1; } @@ -472,11 +472,11 @@ static int recursive_operation(const char *startfrom, const char *startto, recur /* call pre-recursive walking directory callback */ ret = callback_dir_pre(from, to); - if (ret != recursiveOp_Callback_OK) { + if (ret != RecursiveOp_Callback_OK) { MEM_freeN(from); if (to) free(to); - if (ret == recursiveOp_Callback_StopRecurs) { + if (ret == RecursiveOp_Callback_StopRecurs) { /* callback requested not to perform recursive walking, not an error */ return 0; } @@ -505,7 +505,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur else if (callback_file) { /* call file callback for current path */ ret = callback_file(from_path, to_path); - if (ret != recursiveOp_Callback_OK) + if (ret != RecursiveOp_Callback_OK) ret = -1; } @@ -522,7 +522,7 @@ static int recursive_operation(const char *startfrom, const char *startto, recur if (callback_dir_post) { /* call post-recursive directory callback */ ret = callback_dir_post(from, to); - if (ret != recursiveOp_Callback_OK) + if (ret != RecursiveOp_Callback_OK) ret = -1; } } @@ -541,10 +541,10 @@ static int delete_callback_post(const char *from, const char *UNUSED(to)) if (rmdir(from)) { perror("rmdir"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } static int delete_single_file(const char *from, const char *UNUSED(to)) @@ -552,10 +552,10 @@ static int delete_single_file(const char *from, const char *UNUSED(to)) if (unlink(from)) { perror("unlink"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } FILE *BLI_fopen(const char *filename, const char *mode) @@ -628,27 +628,27 @@ static int copy_callback_pre(const char *from, const char *to) if (check_the_same(from, to)) { fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } if (lstat(from, &st)) { perror("stat"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } /* create a directory */ if (mkdir(to, st.st_mode)) { perror("mkdir"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } /* set proper owner and group on new directory */ if (chown(to, st.st_uid, st.st_gid)) { perror("chown"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } static int copy_single_file(const char *from, const char *to) @@ -660,12 +660,12 @@ static int copy_single_file(const char *from, const char *to) if (check_the_same(from, to)) { fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } if (lstat(from, &st)) { perror("lstat"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } if (S_ISLNK(st.st_mode)) { @@ -690,7 +690,7 @@ static int copy_single_file(const char *from, const char *to) if (need_free) MEM_freeN(link_buffer); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } link_buffer[link_len] = 0; @@ -698,13 +698,13 @@ static int copy_single_file(const char *from, const char *to) if (symlink(link_buffer, to)) { perror("symlink"); if (need_free) MEM_freeN(link_buffer); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } if (need_free) MEM_freeN(link_buffer); - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } else if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode) || @@ -714,30 +714,30 @@ static int copy_single_file(const char *from, const char *to) /* copy special type of file */ if (mknod(to, st.st_mode, st.st_rdev)) { perror("mknod"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } if (set_permissions(to, &st)) - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } else if (!S_ISREG(st.st_mode)) { fprintf(stderr, "Copying of this kind of files isn't supported yet\n"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } from_stream = fopen(from, "rb"); if (!from_stream) { perror("fopen"); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } to_stream = fopen(to, "wb"); if (!to_stream) { perror("fopen"); fclose(from_stream); - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; } while ((len = fread(buf, 1, sizeof(buf), from_stream)) > 0) { @@ -748,9 +748,9 @@ static int copy_single_file(const char *from, const char *to) fclose(from_stream); if (set_permissions(to, &st)) - return recursiveOp_Callback_Error; + return RecursiveOp_Callback_Error; - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } static int move_callback_pre(const char *from, const char *to) @@ -760,7 +760,7 @@ static int move_callback_pre(const char *from, const char *to) if (ret) return copy_callback_pre(from, to); - return recursiveOp_Callback_StopRecurs; + return RecursiveOp_Callback_StopRecurs; } static int move_single_file(const char *from, const char *to) @@ -770,7 +770,7 @@ static int move_single_file(const char *from, const char *to) if (ret) return copy_single_file(from, to); - return recursiveOp_Callback_OK; + return RecursiveOp_Callback_OK; } int BLI_move(const char *file, const char *to) |