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>2019-02-01 04:44:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-01 04:46:39 +0300
commit552b2287db86ed6e77565672fbccff1d553f823f (patch)
tree235ad970599910d52c822bb89d23fb467f44f1bd /source/blender/blenkernel/intern/customdata.c
parent8a51af7d1c98500022b1ff789284f9e0a3c038cd (diff)
Logging: Use CLOG for blenkernel
Part of D4277 by @sobakasu
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 54ed69fecf9..8bb33dad73e 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -59,6 +59,8 @@
#include "bmesh.h"
+#include "CLG_log.h"
+
/* only for customdata_data_transfer_interp_normal_normals */
#include "data_transfer_intern.h"
@@ -68,6 +70,7 @@
/* ensure typemap size is ok */
BLI_STATIC_ASSERT(ARRAY_SIZE(((CustomData *)NULL)->typemap) == CD_NUMTYPES, "size mismatch");
+static CLG_LogRef LOG = {"bke.customdata"};
/********************* Layer type information **********************/
typedef struct LayerTypeInfo {
@@ -620,7 +623,7 @@ static int layerRead_mdisps(CDataFile *cdf, void *data, int count)
d[i].disps = MEM_calloc_arrayN(d[i].totdisp, 3 * sizeof(float), "mdisps read");
if (!cdf_read_data(cdf, d[i].totdisp * 3 * sizeof(float), d[i].disps)) {
- printf("failed to read multires displacement %d/%d %d\n", i, count, d[i].totdisp);
+ CLOG_ERROR(&LOG, "failed to read multires displacement %d/%d %d", i, count, d[i].totdisp);
return 0;
}
}
@@ -635,7 +638,7 @@ static int layerWrite_mdisps(CDataFile *cdf, const void *data, int count)
for (i = 0; i < count; ++i) {
if (!cdf_write_data(cdf, d[i].totdisp * 3 * sizeof(float), d[i].disps)) {
- printf("failed to write multires displacement %d/%d %d\n", i, count, d[i].totdisp);
+ CLOG_ERROR(&LOG, "failed to write multires displacement %d/%d %d", i, count, d[i].totdisp);
return 0;
}
}
@@ -2241,9 +2244,9 @@ static void CustomData_copy_data_layer(
if (!count || !src_data || !dst_data) {
if (count && !(src_data == NULL && dst_data == NULL)) {
- printf("%s: warning null data for %s type (%p --> %p), skipping\n",
- __func__, layerType_getName(source->layers[src_i].type),
- (void *)src_data, (void *)dst_data);
+ CLOG_WARN(&LOG, "null data for %s type (%p --> %p), skipping",
+ layerType_getName(source->layers[src_i].type),
+ (void *)src_data, (void *)dst_data);
}
return;
}
@@ -3403,7 +3406,7 @@ void CustomData_file_write_prepare(
CustomDataLayer *layer = &data->layers[i];
if (layer->flag & CD_FLAG_NOCOPY) { /* Layers with this flag set are not written to file. */
data->totlayer--;
- /* printf("%s: skipping layer %p (%s)\n", __func__, layer, layer->name); */
+ /* CLOG_WARN(&LOG, "skipping layer %p (%s)", layer, layer->name); */
}
else {
if (UNLIKELY((size_t)j >= write_layers_size)) {
@@ -3656,7 +3659,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
cdf = cdf_create(CDF_TYPE_MESH);
if (!cdf_read_open(cdf, filename)) {
cdf_free(cdf);
- fprintf(stderr, "Failed to read %s layer from %s.\n", layerType_getName(layer->type), filename);
+ CLOG_ERROR(&LOG, "Failed to read %s layer from %s.", layerType_getName(layer->type), filename);
return;
}
@@ -3745,7 +3748,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
}
if (!cdf_write_open(cdf, filename)) {
- fprintf(stderr, "Failed to open %s for writing.\n", filename);
+ CLOG_ERROR(&LOG, "Failed to open %s for writing.", filename);
cdf_free(cdf);
return;
}
@@ -3772,7 +3775,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
}
if (i != data->totlayer) {
- fprintf(stderr, "Failed to write data to %s.\n", filename);
+ CLOG_ERROR(&LOG, "Failed to write data to %s.", filename);
cdf_write_close(cdf);
cdf_free(cdf);
return;
@@ -3877,7 +3880,7 @@ static void copy_bit_flag(void *dst, const void *src, const size_t data_size, co
COPY_BIT_FLAG(uint64_t, dst, src, flag);
break;
default:
- //printf("ERROR %s: Unknown flags-container size (%zu)\n", __func__, datasize);
+ //CLOG_ERROR(&LOG, "Unknown flags-container size (%zu)", datasize);
break;
}
@@ -3896,7 +3899,7 @@ static bool check_bit_flag(const void *data, const size_t data_size, const uint6
case 8:
return ((*((uint64_t *)data) & ((uint64_t)flag)) != 0);
default:
- //printf("ERROR %s: Unknown flags-container size (%zu)\n", __func__, datasize);
+ //CLOG_ERROR(&LOG, "Unknown flags-container size (%zu)", datasize);
return false;
}
}