From e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Apr 2019 06:17:24 +0200 Subject: ClangFormat: apply to source, most of intern Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat --- source/blender/imbuf/intern/metadata.c | 91 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 45 deletions(-) (limited to 'source/blender/imbuf/intern/metadata.c') diff --git a/source/blender/imbuf/intern/metadata.c b/source/blender/imbuf/intern/metadata.c index cc4c2661ef2..ed3b214047a 100644 --- a/source/blender/imbuf/intern/metadata.c +++ b/source/blender/imbuf/intern/metadata.c @@ -21,7 +21,6 @@ * \ingroup imbuf */ - #include #include @@ -39,77 +38,79 @@ #define METADATA_MAX_VALUE_LENGTH 1024 - void IMB_metadata_ensure(struct IDProperty **metadata) { - if (*metadata != NULL) { - return; - } + if (*metadata != NULL) { + return; + } - IDPropertyTemplate val; - *metadata = IDP_New(IDP_GROUP, &val, "metadata"); + IDPropertyTemplate val; + *metadata = IDP_New(IDP_GROUP, &val, "metadata"); } void IMB_metadata_free(struct IDProperty *metadata) { - if (metadata == NULL) { - return; - } + if (metadata == NULL) { + return; + } - IDP_FreeProperty(metadata); - MEM_freeN(metadata); + IDP_FreeProperty(metadata); + MEM_freeN(metadata); } -bool IMB_metadata_get_field(struct IDProperty *metadata, const char *key, char *field, const size_t len) +bool IMB_metadata_get_field(struct IDProperty *metadata, + const char *key, + char *field, + const size_t len) { - IDProperty *prop; + IDProperty *prop; - if (metadata == NULL) { - return false; - } + if (metadata == NULL) { + return false; + } - prop = IDP_GetPropertyFromGroup(metadata, key); + prop = IDP_GetPropertyFromGroup(metadata, key); - if (prop && prop->type == IDP_STRING) { - BLI_strncpy(field, IDP_String(prop), len); - return true; - } - return false; + if (prop && prop->type == IDP_STRING) { + BLI_strncpy(field, IDP_String(prop), len); + return true; + } + return false; } void IMB_metadata_copy(struct ImBuf *dimb, struct ImBuf *simb) { - BLI_assert(dimb != simb); - if (simb->metadata) { - IMB_metadata_free(dimb->metadata); - dimb->metadata = IDP_CopyProperty(simb->metadata); - } + BLI_assert(dimb != simb); + if (simb->metadata) { + IMB_metadata_free(dimb->metadata); + dimb->metadata = IDP_CopyProperty(simb->metadata); + } } void IMB_metadata_set_field(struct IDProperty *metadata, const char *key, const char *value) { - BLI_assert(metadata); - IDProperty *prop = IDP_GetPropertyFromGroup(metadata, key); + BLI_assert(metadata); + IDProperty *prop = IDP_GetPropertyFromGroup(metadata, key); - if (prop != NULL && prop->type != IDP_STRING) { - IDP_FreeFromGroup(metadata, prop); - prop = NULL; - } + if (prop != NULL && prop->type != IDP_STRING) { + IDP_FreeFromGroup(metadata, prop); + prop = NULL; + } - if (prop == NULL) { - prop = IDP_NewString(value, key, METADATA_MAX_VALUE_LENGTH); - IDP_AddToGroup(metadata, prop); - } + if (prop == NULL) { + prop = IDP_NewString(value, key, METADATA_MAX_VALUE_LENGTH); + IDP_AddToGroup(metadata, prop); + } - IDP_AssignString(prop, value, METADATA_MAX_VALUE_LENGTH); + IDP_AssignString(prop, value, METADATA_MAX_VALUE_LENGTH); } void IMB_metadata_foreach(struct ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata) { - if (ibuf->metadata == NULL) { - return; - } - for (IDProperty *prop = ibuf->metadata->data.group.first; prop != NULL; prop = prop->next) { - callback(prop->name, IDP_String(prop), userdata); - } + if (ibuf->metadata == NULL) { + return; + } + for (IDProperty *prop = ibuf->metadata->data.group.first; prop != NULL; prop = prop->next) { + callback(prop->name, IDP_String(prop), userdata); + } } -- cgit v1.2.3