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:
authorBastien Montagne <bastien@blender.org>2021-06-23 10:51:11 +0300
committerBastien Montagne <bastien@blender.org>2021-06-23 11:37:00 +0300
commit82c17082ba0e53d782ac6be703d71d188a331dde (patch)
tree3bdb6f1a86bc8bf506d28046ada40b7f881dba86 /source/blender/blenloader/intern/readblenentry.c
parent071799d4fc44f422abacbdad09bb45fb95de89f2 (diff)
Revert "Revert "Enhanced stats/reports for blendfile reading.""
This reverts commit rB3a48147b8ab92, and fixes the issues with linking etc. Change compared to previous buggy commit (rBf8d219dfd4c31) is that new `BlendFileReadReports` reports are now passed to the lowest level function generating the `FileData` (`filedata_new()`), which ensures (and asserts) that all code using it does have a valid non-NULL pointer to a `BlendFileReadReport` data. Sorry for the noise, it's always when you think a change is trivial and do not test it well enough that you end up doing those kind of mistakes...
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 19033ba9bf1..1a324d56f06 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -68,7 +68,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp);
* \param reports: Report errors in opening the file (can be NULL).
* \return A handle on success, or NULL on failure.
*/
-BlendHandle *BLO_blendhandle_from_file(const char *filepath, ReportList *reports)
+BlendHandle *BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
{
BlendHandle *bh;
@@ -88,7 +88,8 @@ BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize)
{
BlendHandle *bh;
- bh = (BlendHandle *)blo_filedata_from_memory(mem, memsize, NULL);
+ bh = (BlendHandle *)blo_filedata_from_memory(
+ mem, memsize, &(BlendFileReadReport){.reports = NULL});
return bh;
}
@@ -366,14 +367,13 @@ void BLO_blendhandle_close(BlendHandle *bh)
*/
BlendFileData *BLO_read_from_file(const char *filepath,
eBLOReadSkip skip_flags,
- ReportList *reports)
+ BlendFileReadReport *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;
fd = blo_filedata_from_file(filepath, reports);
if (fd) {
- fd->reports = reports;
fd->skip_flags = skip_flags;
bfd = blo_read_file_internal(fd, filepath);
blo_filedata_free(fd);
@@ -399,9 +399,8 @@ BlendFileData *BLO_read_from_memory(const void *mem,
BlendFileData *bfd = NULL;
FileData *fd;
- fd = blo_filedata_from_memory(mem, memsize, reports);
+ fd = blo_filedata_from_memory(mem, memsize, &(BlendFileReadReport){.reports = reports});
if (fd) {
- fd->reports = reports;
fd->skip_flags = skip_flags;
bfd = blo_read_file_internal(fd, "");
blo_filedata_free(fd);
@@ -428,9 +427,8 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain,
FileData *fd;
ListBase old_mainlist;
- fd = blo_filedata_from_memfile(memfile, params, reports);
+ fd = blo_filedata_from_memfile(memfile, params, &(BlendFileReadReport){.reports = reports});
if (fd) {
- fd->reports = reports;
fd->skip_flags = params->skip_flags;
BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));