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-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/imbuf/intern/metadata.c
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
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
Diffstat (limited to 'source/blender/imbuf/intern/metadata.c')
-rw-r--r--source/blender/imbuf/intern/metadata.c91
1 files changed, 46 insertions, 45 deletions
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 <stdlib.h>
#include <string.h>
@@ -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);
+ }
}