[Bf-blender-cvs] [76c2203f9ca] master: Cleanup: trailing space for blenloader
Campbell Barton
noreply at git.blender.org
Sun Jun 17 17:07:20 CEST 2018
Commit: 76c2203f9ca5a9f9feeffd594ce6e997ff97b908
Author: Campbell Barton
Date: Sun Jun 17 17:06:07 2018 +0200
Branches: master
https://developer.blender.org/rB76c2203f9ca5a9f9feeffd594ce6e997ff97b908
Cleanup: trailing space for blenloader
===================================================================
M source/blender/blenloader/BLO_readfile.h
M source/blender/blenloader/CMakeLists.txt
M source/blender/blenloader/intern/readblenentry.c
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/readfile.h
M source/blender/blenloader/intern/runtime.c
M source/blender/blenloader/intern/undofile.c
M source/blender/blenloader/intern/versioning_250.c
M source/blender/blenloader/intern/versioning_260.c
M source/blender/blenloader/intern/versioning_270.c
M source/blender/blenloader/intern/versioning_defaults.c
===================================================================
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 0b4ff13c7bd..11f34732cfc 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -64,10 +64,10 @@ typedef struct BlendFileData {
int fileflags;
int globalf;
char filename[1024]; /* 1024 = FILE_MAX */
-
+
struct bScreen *curscreen;
struct Scene *curscene;
-
+
eBlenFileType type;
} BlendFileData;
@@ -150,7 +150,7 @@ struct BlendThumbnail *BLO_thumbnail_from_file(const char *filepath);
struct Main *BLO_main_from_memfile(struct MemFile *memfile, struct Main *bmain, struct Scene **r_scene);
#ifdef __cplusplus
-}
+}
#endif
#endif /* __BLO_READFILE_H__ */
diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt
index 420f651ee7f..dd0a8543b9f 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
../blenfont
../blenkernel
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 73109413271..4ccdbd9e8e1 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -68,10 +68,10 @@
#endif
/* local prototypes --------------------- */
-void BLO_blendhandle_print_sizes(BlendHandle *, void *);
+void BLO_blendhandle_print_sizes(BlendHandle *, void *);
/* Access routines used by filesel. */
-
+
/**
* Open a blendhandle from a file path.
*
@@ -104,7 +104,7 @@ BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize)
return bh;
}
-void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
+void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
{
FileData *fd = (FileData *) bh;
BHead *bhead;
@@ -117,7 +117,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
const short *sp = fd->filesdna->structs[bhead->SDNAnr];
const 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;
@@ -127,7 +127,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
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)));
}
}
@@ -225,7 +225,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
new_prv->rect[0] = NULL;
new_prv->w[0] = new_prv->h[0] = 0;
}
-
+
if (prv->rect[1] && prv->w[1] && prv->h[1]) {
unsigned int *rect = NULL;
size_t len = new_prv->w[1] * new_prv->h[1] * sizeof(unsigned int);
@@ -255,7 +255,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
new_prv = NULL;
prv = NULL;
}
-
+
}
*tot_prev = tot;
@@ -274,7 +274,7 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
GSet *gathered = BLI_gset_ptr_new("linkable_groups gh");
LinkNode *names = NULL;
BHead *bhead;
-
+
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
if (bhead->code == ENDB) {
break;
@@ -282,18 +282,18 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
else if (BKE_idcode_is_valid(bhead->code)) {
if (BKE_idcode_is_linkable(bhead->code)) {
const char *str = BKE_idcode_to_name(bhead->code);
-
+
if (BLI_gset_add(gathered, (void *)str)) {
BLI_linklist_prepend(&names, strdup(str));
}
}
}
}
-
+
BLI_gset_free(gathered, NULL);
-
+
return names;
-}
+}
/**
* Close and free a blendhandle. The handle becomes invalid after this call.
@@ -303,7 +303,7 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
void BLO_blendhandle_close(BlendHandle *bh)
{
FileData *fd = (FileData *) bh;
-
+
blo_freefiledata(fd);
}
@@ -323,7 +323,7 @@ BlendFileData *BLO_read_from_file(
{
BlendFileData *bfd = NULL;
FileData *fd;
-
+
fd = blo_openblenderfile(filepath, reports);
if (fd) {
fd->reports = reports;
@@ -350,7 +350,7 @@ BlendFileData *BLO_read_from_memory(
{
BlendFileData *bfd = NULL;
FileData *fd;
-
+
fd = blo_openblendermemory(mem, memsize, reports);
if (fd) {
fd->reports = reports;
@@ -375,13 +375,13 @@ BlendFileData *BLO_read_from_memfile(
BlendFileData *bfd = NULL;
FileData *fd;
ListBase old_mainlist;
-
+
fd = blo_openblendermemfile(memfile, reports);
if (fd) {
fd->reports = reports;
fd->skip_flags = skip_flags;
BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));
-
+
/* clear ob->proxy_from pointers in old main */
blo_clear_proxy_pointers_from_lib(oldmain);
@@ -389,26 +389,26 @@ BlendFileData *BLO_read_from_memfile(
blo_split_main(&old_mainlist, oldmain);
/* add the library pointers in oldmap lookup */
blo_add_library_pointer_map(&old_mainlist, fd);
-
+
/* makes lookup of existing images in old main */
blo_make_image_pointer_map(fd, oldmain);
-
+
/* makes lookup of existing video clips in old main */
blo_make_movieclip_pointer_map(fd, oldmain);
/* make lookups of existing sound data in old main */
blo_make_sound_pointer_map(fd, oldmain);
-
+
/* removed packed data from this trick - it's internal data that needs saves */
-
+
bfd = blo_read_file_internal(fd, filename);
-
+
/* ensures relinked images are not freed */
blo_end_image_pointer_map(fd, oldmain);
-
+
/* ensures relinked movie clips are not freed */
blo_end_movieclip_pointer_map(fd, oldmain);
-
+
/* ensures relinked sounds are not freed */
blo_end_sound_pointer_map(fd, oldmain);
@@ -467,7 +467,7 @@ void BLO_blendfiledata_free(BlendFileData *bfd)
if (bfd->main) {
BKE_main_free(bfd->main);
}
-
+
if (bfd->user) {
MEM_freeN(bfd->user);
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 842132d554c..c57817c275a 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -262,17 +262,17 @@ static BHead *find_bhead_from_idname(FileData *fd, const char *idname);
void blo_reportf_wrap(ReportList *reports, ReportType type, const char *format, ...)
{
char fixed_buf[1024]; /* should be long enough */
-
+
va_list args;
-
+
va_start(args, format);
vsnprintf(fixed_buf, sizeof(fixed_buf), format, args);
va_end(args);
-
+
fixed_buf[sizeof(fixed_buf) - 1] = '\0';
-
+
BKE_report(reports, type, fixed_buf);
-
+
if (G.background == 0) {
printf("%s: %s\n", BKE_report_type_str(type), fixed_buf);
}
@@ -284,27 +284,27 @@ static const char *library_parent_filepath(Library *lib)
return lib->parent ? lib->parent->filepath : "<direct>";
}
-static OldNewMap *oldnewmap_new(void)
+static OldNewMap *oldnewmap_new(void)
{
OldNewMap *onm= MEM_callocN(sizeof(*onm), "OldNewMap");
-
+
onm->entriessize = 1024;
onm->entries = MEM_malloc_arrayN(onm->entriessize, sizeof(*onm->entries), "OldNewMap.entries");
-
+
return onm;
}
static int verg_oldnewmap(const void *v1, const void *v2)
{
const struct OldNew *x1=v1, *x2=v2;
-
+
if (x1->old > x2->old) return 1;
else if (x1->old < x2->old) return -1;
return 0;
}
-static void oldnewmap_sort(FileData *fd)
+static void oldnewmap_sort(FileData *fd)
{
BLI_assert(fd->libmap->sorted == false);
qsort(fd->libmap->entries, fd->libmap->nentries, sizeof(OldNew), verg_oldnewmap);
@@ -315,9 +315,9 @@ static void oldnewmap_sort(FileData *fd)
static void oldnewmap_insert(OldNewMap *onm, const void *oldaddr, void *newaddr, int nr)
{
OldNew *entry;
-
+
if (oldaddr==NULL || newaddr==NULL) return;
-
+
if (UNLIKELY(onm->nentries == onm->entriessize)) {
onm->entriessize *= 2;
onm->entries = MEM_reallocN(onm->entries, sizeof(*onm->entries) * onm->entriessize);
@@ -387,19 +387,19 @@ static int oldnewmap_lookup_entry_full(const OldNewMap *onm, const void *addr, i
static void *oldnewmap_lookup_and_inc(OldNewMap *onm, const void *addr, bool increase_users)
{
int i;
-
+
if (addr == NULL) return NULL;
-
+
if (onm->lasthit < onm->nentries-1) {
OldNew *entry = &onm->entries[++onm->lasthit];
-
+
if (entry->old == addr) {
if (increase_users)
entry->nr++;
return entry->newp;
}
}
-
+
i = oldnewmap_lookup_entry_full(onm, addr, onm->lasthit);
if (i != -1) {
OldNew *entry = &onm->entries[i];
@@ -409,7 +409,7 @@ static void *oldnewmap_lookup_and_inc(OldNewMap *onm, const void *addr, bool inc
entry->nr++;
return entry->newp;
}
-
+
return NULL;
}
@@ -448,7 +448,7 @@ static void *oldnewmap_liblookup(OldNewMap *onm, const void *addr, const void *l
return NULL;
}
-static void oldnewmap_free_unused(OldNewMap *onm)
+static void oldnewmap_free_unused(OldNewMap *onm)
{
int i;
@@ -461,13 +461,13 @@ static void oldnewmap_free_unused(OldNewMap *onm)
}
}
-static void oldnewmap_clear(OldNewMap *onm)
+static void oldnewmap_clear(OldNewMap *onm)
{
onm->nentries = 0;
onm->lasthit = 0;
}
-static void oldnewmap_free(OldNewMap *onm)
+static void oldnewmap_free(OldNewMap *onm)
{
MEM_freeN(onm->entries);
MEM_freeN(onm);
@@ -483,7 +483,7 @@ static void add_main_to_main(Main *mainvar, Main *from)
{
ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY];
int a;
-
+
set_listbasepointers(mainvar, lbarray);
a = set_listbasepointers(from, fromarray);
while (a--) {
@@ -494,7 +494,7 @@ static void add_main_to_main(Main *mainvar, Main *from)
void blo_join_main(ListBase *mainlist)
{
Main *tojoin, *mainl;
-
+
mainl = mainlist->first;
while ((tojoin = mainl->next)) {
add_main_to_main(mainl, tojoin);
@@ -530,10 +530,10 @@ void blo_split_main(ListBase *mainlist, Main *main)
{
mainlist->first = mainlist->last = main;
main->next = NULL;
-
+
if (BLI_listbase_is_empty(&main->library))
return;
-
+
/* (Library.temp_index -> Main), lookup table */
const unsigned int lib_main
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list