diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-21 17:19:08 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-21 17:19:08 +0300 |
commit | db4a46bc3c97bf9762a472bb8dcd4213b69acf83 (patch) | |
tree | e046508463c2cc928e49a8e95bd27d1c980f87f2 /source/blender/blenloader/intern | |
parent | e34ade4eb3b28a44d7bb1685a0fba32937c8982f (diff) |
Cleanup: hide debug print behind proper debug defines instead of using comments...
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 28 |
2 files changed, 23 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index b5ba9879057..be893177b3b 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -423,11 +423,11 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil BLI_remlink(&old_mainlist, libmain); BLI_addtail(&new_mainlist, libmain); } -#if 0 else { +#ifdef PRINT_DEBUG printf("Dropped Main for lib: %s\n", libmain->curlib->id.name); - } #endif + } } /* In any case, we need to move all lib datablocks themselves - those are 'first level data', * getting rid of them would imply updating spaces & co to prevent invalid pointers access. */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 838179ec0a9..6aa2fc4ac8c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7949,16 +7949,22 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short if (fd->memfile && ELEM(bhead->code, ID_LI, ID_ID)) { const char *idname = bhead_id_name(fd, bhead); - /* printf("Checking %s...\n", idname); */ +#ifdef PRINT_DEBUG + printf("Checking %s...\n", idname); +#endif if (bhead->code == ID_LI) { Main *libmain = fd->old_mainlist->first; /* Skip oldmain itself... */ for (libmain = libmain->next; libmain; libmain = libmain->next) { - /* printf("... against %s: ", libmain->curlib ? libmain->curlib->id.name : "<NULL>"); */ +#ifdef PRINT_DEBUG + printf("... against %s: ", libmain->curlib ? libmain->curlib->id.name : "<NULL>"); +#endif if (libmain->curlib && STREQ(idname, libmain->curlib->id.name)) { Main *oldmain = fd->old_mainlist->first; - /* printf("FOUND!\n"); */ +#ifdef PRINT_DEBUG + printf("FOUND!\n"); +#endif /* In case of a library, we need to re-add its main to fd->mainlist, because if we have later * a missing ID_ID, we need to get the correct lib it is linked to! * Order is crucial, we cannot bulk-add it in BLO_read_from_memfile() like it used to be... */ @@ -7972,13 +7978,19 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short } return blo_nextbhead(fd, bhead); } - /* printf("nothing...\n"); */ +#ifdef PRINT_DEBUG + printf("nothing...\n"); +#endif } } else { - /* printf("... in %s (%s): ", main->curlib ? main->curlib->id.name : "<NULL>", main->curlib ? main->curlib->name : "<NULL>"); */ +#ifdef PRINT_DEBUG + printf("... in %s (%s): ", main->curlib ? main->curlib->id.name : "<NULL>", main->curlib ? main->curlib->name : "<NULL>"); +#endif if ((id = BKE_libblock_find_name_ex(main, GS(idname), idname + 2))) { - /* printf("FOUND!\n"); */ +#ifdef PRINT_DEBUG + printf("FOUND!\n"); +#endif /* Even though we found our linked ID, there is no guarantee its address is still the same... */ if (id != bhead->old) { oldnewmap_insert(fd->libmap, bhead->old, id, GS(id->name)); @@ -7990,7 +8002,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short } return blo_nextbhead(fd, bhead); } - /* printf("nothing...\n"); */ +#ifdef PRINT_DEBUG + printf("nothing...\n"); +#endif } } |