Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/library.c
| Context not available. | |||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include <assert.h> | #include <assert.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| /* all types are needed here, in order to do memory operations */ | /* all types are needed here, in order to do memory operations */ | ||||
| Context not available. | |||||
| # include "PIL_time_utildefines.h" | # include "PIL_time_utildefines.h" | ||||
| #endif | #endif | ||||
| static CLG_LogRef LOG = { "bke.library" }; | |||||
| /* GS reads the memory pointed at in a specific ordering. | /* GS reads the memory pointed at in a specific ordering. | ||||
| * only use this definition, makes little and big endian systems | * only use this definition, makes little and big endian systems | ||||
| * work fine, in conjunction with MAKE_ID */ | * work fine, in conjunction with MAKE_ID */ | ||||
| Context not available. | |||||
| id->tag |= LIB_TAG_EXTRAUSER; | id->tag |= LIB_TAG_EXTRAUSER; | ||||
| if (id->us <= limit) { | if (id->us <= limit) { | ||||
| if (id->us < limit || ((id->us == limit) && (id->tag & LIB_TAG_EXTRAUSER_SET))) { | if (id->us < limit || ((id->us == limit) && (id->tag & LIB_TAG_EXTRAUSER_SET))) { | ||||
| printf("ID user count error: %s (from '%s')\n", id->name, id->lib ? id->lib->filepath : "[Main]"); | CLOG_FATAL(&LOG, "ID user count error: %s (from '%s')", id->name, id->lib ? id->lib->filepath : "[Main]"); | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| id->us = limit + 1; | id->us = limit + 1; | ||||
| Context not available. | |||||
| const int limit = ID_FAKE_USERS(id); | const int limit = ID_FAKE_USERS(id); | ||||
| if (id->us <= limit) { | if (id->us <= limit) { | ||||
| printf("ID user decrement error: %s (from '%s'): %d <= %d\n", | CLOG_FATAL(&LOG, "ID user decrement error: %s (from '%s'): %d <= %d", | ||||
| id->name, id->lib ? id->lib->filepath : "[Main]", id->us, limit); | id->name, id->lib ? id->lib->filepath : "[Main]", id->us, limit); | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| id->us = limit; | id->us = limit; | ||||
| } | } | ||||
| Context not available. | |||||
| /* Proxies only work when the proxified object is linked-in from a library. */ | /* Proxies only work when the proxified object is linked-in from a library. */ | ||||
| if (ob->proxy->id.lib == NULL) { | if (ob->proxy->id.lib == NULL) { | ||||
| printf("Warning, proxy object %s will loose its link to %s, because the " | CLOG_WARN(&LOG, "proxy object %s will loose its link to %s, because the " | ||||
| "proxified object is local.\n", id->newid->name, ob->proxy->id.name); | "proxified object is local.", id->newid->name, ob->proxy->id.name); | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| * referred to from a library. Not checking for local use; if new local proxy | * referred to from a library. Not checking for local use; if new local proxy | ||||
| * was not used locally would be a nasty bug! */ | * was not used locally would be a nasty bug! */ | ||||
| if (is_local || is_lib) { | if (is_local || is_lib) { | ||||
| printf("Warning, made-local proxy object %s will loose its link to %s, " | CLOG_WARN(&LOG, "made-local proxy object %s will loose its link to %s, " | ||||
| "because the linked-in proxy is referenced (is_local=%i, is_lib=%i).\n", | "because the linked-in proxy is referenced (is_local=%i, is_lib=%i).", | ||||
| id->newid->name, ob->proxy->id.name, is_local, is_lib); | id->newid->name, ob->proxy->id.name, is_local, is_lib); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||