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-05-12 19:02:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-12 19:02:10 +0400
commit2f2b15bbb2a30ee312d65c627d54a12445f4b987 (patch)
tree7d2d442d5351a04887bbe4aac0f039c3f1d416cd /source/blender/blenloader/intern/readblenentry.c
parent23c0d49a7c6aacde784843b14d5b3eece7fe61df (diff)
style cleanup: whitespace, bli & makesdna
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 8f3131c733a..4abbcb1888c 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -71,13 +71,13 @@
/* local prototypes --------------------- */
void BLO_blendhandle_print_sizes(BlendHandle *, void *);
- /* Access routines used by filesel. */
+/* Access routines used by filesel. */
BlendHandle *BLO_blendhandle_from_file(char *file, ReportList *reports)
{
BlendHandle *bh;
- bh= (BlendHandle*)blo_openblenderfile(file, reports);
+ bh = (BlendHandle *)blo_openblenderfile(file, reports);
return bh;
}
@@ -86,36 +86,36 @@ BlendHandle *BLO_blendhandle_from_memory(void *mem, int memsize)
{
BlendHandle *bh;
- bh= (BlendHandle*)blo_openblendermemory(mem, memsize, NULL);
+ bh = (BlendHandle *)blo_openblendermemory(mem, memsize, NULL);
return bh;
}
void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
{
- FileData *fd= (FileData*) bh;
+ FileData *fd = (FileData *) bh;
BHead *bhead;
fprintf(fp, "[\n");
- for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
- if (bhead->code==ENDB)
+ for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
+ if (bhead->code == ENDB)
break;
else {
- short *sp= fd->filesdna->structs[bhead->SDNAnr];
- char *name= fd->filesdna->types[ sp[0] ];
+ short *sp = fd->filesdna->structs[bhead->SDNAnr];
+ char *name = fd->filesdna->types[sp[0]];
char buf[4];
- buf[0]= (bhead->code>>24)&0xFF;
- buf[1]= (bhead->code>>16)&0xFF;
- buf[2]= (bhead->code>>8)&0xFF;
- buf[3]= (bhead->code>>0)&0xFF;
+ buf[0] = (bhead->code >> 24) & 0xFF;
+ buf[1] = (bhead->code >> 16) & 0xFF;
+ buf[2] = (bhead->code >> 8) & 0xFF;
+ buf[3] = (bhead->code >> 0) & 0xFF;
+
+ buf[0] = buf[0] ? buf[0] : ' ';
+ buf[1] = buf[1] ? buf[1] : ' ';
+ buf[2] = buf[2] ? buf[2] : ' ';
+ buf[3] = buf[3] ? buf[3] : ' ';
- buf[0]= buf[0]?buf[0]:' ';
- buf[1]= buf[1]?buf[1]:' ';
- buf[2]= buf[2]?buf[2]:' ';
- buf[3]= buf[3]?buf[3]:' ';
-
- fprintf(fp, "['%.4s', '%s', %d, %ld ],\n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
+ fprintf(fp, "['%.4s', '%s', %d, %ld ],\n", buf, name, bhead->nr, (long int)(bhead->len + sizeof(BHead)));
}
}
fprintf(fp, "]\n");
@@ -123,39 +123,39 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, int *tot_names)
{
- FileData *fd= (FileData*) bh;
- LinkNode *names= NULL;
+ FileData *fd = (FileData *) bh;
+ LinkNode *names = NULL;
BHead *bhead;
- int tot= 0;
+ int tot = 0;
- for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
- if (bhead->code==ofblocktype) {
- char *idname= bhead_id_name(fd, bhead);
+ for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
+ if (bhead->code == ofblocktype) {
+ char *idname = bhead_id_name(fd, bhead);
- BLI_linklist_prepend(&names, strdup(idname+2));
+ BLI_linklist_prepend(&names, strdup(idname + 2));
tot++;
}
- else if (bhead->code==ENDB)
+ else if (bhead->code == ENDB)
break;
}
- *tot_names= tot;
+ *tot_names = tot;
return names;
}
LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *tot_prev)
{
- FileData *fd= (FileData*) bh;
- LinkNode *previews= NULL;
+ FileData *fd = (FileData *) bh;
+ LinkNode *previews = NULL;
BHead *bhead;
- int looking=0;
- PreviewImage* prv = NULL;
- PreviewImage* new_prv = NULL;
- int tot= 0;
-
- for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
- if (bhead->code==ofblocktype) {
- char *idname= bhead_id_name(fd, bhead);
+ int looking = 0;
+ PreviewImage *prv = NULL;
+ PreviewImage *new_prv = NULL;
+ int tot = 0;
+
+ for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
+ if (bhead->code == ofblocktype) {
+ char *idname = bhead_id_name(fd, bhead);
switch (GS(idname)) {
case ID_MA: /* fall through */
case ID_TE: /* fall through */
@@ -171,7 +171,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
break;
}
}
- else if (bhead->code==DATA) {
+ else if (bhead->code == DATA) {
if (looking) {
if (bhead->SDNAnr == DNA_struct_find_nr(fd->filesdna, "PreviewImage") ) {
prv = BLO_library_read_struct(fd, bhead, "PreviewImage");
@@ -179,9 +179,9 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
memcpy(new_prv, prv, sizeof(PreviewImage));
if (prv->rect[0]) {
unsigned int *rect = NULL;
- new_prv->rect[0] = MEM_callocN(new_prv->w[0]*new_prv->h[0]*sizeof(unsigned int), "prvrect");
- bhead= blo_nextbhead(fd, bhead);
- rect = (unsigned int*)(bhead+1);
+ new_prv->rect[0] = MEM_callocN(new_prv->w[0] * new_prv->h[0] * sizeof(unsigned int), "prvrect");
+ bhead = blo_nextbhead(fd, bhead);
+ rect = (unsigned int *)(bhead + 1);
memcpy(new_prv->rect[0], rect, bhead->len);
}
else {
@@ -190,9 +190,9 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
if (prv->rect[1]) {
unsigned int *rect = NULL;
- new_prv->rect[1] = MEM_callocN(new_prv->w[1]*new_prv->h[1]*sizeof(unsigned int), "prvrect");
- bhead= blo_nextbhead(fd, bhead);
- rect = (unsigned int*)(bhead+1);
+ new_prv->rect[1] = MEM_callocN(new_prv->w[1] * new_prv->h[1] * sizeof(unsigned int), "prvrect");
+ bhead = blo_nextbhead(fd, bhead);
+ rect = (unsigned int *)(bhead + 1);
memcpy(new_prv->rect[1], rect, bhead->len);
}
else {
@@ -203,7 +203,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
}
}
}
- else if (bhead->code==ENDB) {
+ else if (bhead->code == ENDB) {
break;
}
else {
@@ -214,24 +214,24 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
}
- *tot_prev= tot;
+ *tot_prev = tot;
return previews;
}
LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
{
- FileData *fd= (FileData*) bh;
- GHash *gathered= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "linkable_groups gh");
- LinkNode *names= NULL;
+ FileData *fd = (FileData *) bh;
+ GHash *gathered = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "linkable_groups gh");
+ LinkNode *names = NULL;
BHead *bhead;
- for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
- if (bhead->code==ENDB) {
+ for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
+ if (bhead->code == ENDB) {
break;
}
else if (BKE_idcode_is_valid(bhead->code)) {
if (BKE_idcode_is_linkable(bhead->code)) {
- const char *str= BKE_idcode_to_name(bhead->code);
+ const char *str = BKE_idcode_to_name(bhead->code);
if (!BLI_ghash_haskey(gathered, (void *)str)) {
BLI_linklist_prepend(&names, strdup(str));
@@ -248,12 +248,12 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
void BLO_blendhandle_close(BlendHandle *bh)
{
- FileData *fd= (FileData*) bh;
+ FileData *fd = (FileData *) bh;
blo_freefiledata(fd);
}
- /**********/
+/**********/
BlendFileData *BLO_read_from_file(const char *filepath, ReportList *reports)
{
@@ -262,8 +262,8 @@ BlendFileData *BLO_read_from_file(const char *filepath, ReportList *reports)
fd = blo_openblenderfile(filepath, reports);
if (fd) {
- fd->reports= reports;
- bfd= blo_read_file_internal(fd, filepath);
+ fd->reports = reports;
+ bfd = blo_read_file_internal(fd, filepath);
blo_freefiledata(fd);
}
@@ -277,8 +277,8 @@ BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports)
fd = blo_openblendermemory(mem, memsize, reports);
if (fd) {
- fd->reports= reports;
- bfd= blo_read_file_internal(fd, "");
+ fd->reports = reports;
+ bfd = blo_read_file_internal(fd, "");
blo_freefiledata(fd);
}
@@ -293,7 +293,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
fd = blo_openblendermemfile(memfile, reports);
if (fd) {
- fd->reports= reports;
+ fd->reports = reports;
BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));
/* clear ob->proxy_from pointers in old main */
@@ -310,7 +310,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
/* makes lookup of existing video clips in old main */
blo_make_movieclip_pointer_map(fd, oldmain);
- bfd= blo_read_file_internal(fd, filename);
+ bfd = blo_read_file_internal(fd, filename);
/* ensures relinked images are not freed */
blo_end_image_pointer_map(fd, oldmain);
@@ -319,11 +319,11 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
blo_end_movieclip_pointer_map(fd, oldmain);
/* move libraries from old main to new main */
- if (bfd && mainlist.first!=mainlist.last) {
+ if (bfd && mainlist.first != mainlist.last) {
/* Library structs themselves */
- bfd->main->library= oldmain->library;
- oldmain->library.first= oldmain->library.last= NULL;
+ bfd->main->library = oldmain->library;
+ oldmain->library.first = oldmain->library.last = NULL;
/* add the Library mainlist to the new main */
BLI_remlink(&mainlist, oldmain);