diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:35:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-26 14:50:48 +0300 |
commit | f1e49038543cf75766f4a220f62cdc6cdbc0e27d (patch) | |
tree | 0cec2c64739a6a4ca246fe26bed6fe629ea315cb /source/blender/blenkernel/intern/idprop.c | |
parent | fae5a907d4d1380f087f1226ebbd65d9d0718cc6 (diff) |
Cleanup: full sentences in comments, improve comment formatting
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 578b8aa49d5..a67e78ceea0 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -54,15 +54,15 @@ static CLG_LogRef LOG = {"bke.idprop"}; -/*local size table.*/ +/* Local size table. */ static size_t idp_size_table[] = { 1, /*strings*/ sizeof(int), sizeof(float), - sizeof(float[3]), /*Vector type, deprecated*/ - sizeof(float[16]), /*Matrix type, deprecated*/ - 0, /*arrays don't have a fixed size*/ - sizeof(ListBase), /*Group type*/ + sizeof(float[3]), /* Vector type, deprecated. */ + sizeof(float[16]), /* Matrix type, deprecated. */ + 0, /* Arrays don't have a fixed size. */ + sizeof(ListBase), /* Group type. */ sizeof(void *), sizeof(double), }; @@ -99,12 +99,12 @@ IDProperty *IDP_CopyIDPArray(const IDProperty *array, const int flag) narray->data.pointer = MEM_dupallocN(array->data.pointer); for (int i = 0; i < narray->len; i++) { - /* ok, the copy functions always allocate a new structure, + /* OK, the copy functions always allocate a new structure, * which doesn't work here. instead, simply copy the * contents of the new structure into the array cell, * then free it. this makes for more maintainable * code than simply re-implementing the copy functions - * in this loop.*/ + * in this loop. */ IDProperty *tmp = IDP_CopyProperty_ex(GETPROP(narray, i), flag); memcpy(GETPROP(narray, i), tmp, sizeof(IDProperty)); MEM_freeN(tmp); @@ -228,7 +228,7 @@ static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr) } } -/*this function works for strings too!*/ +/* This function works for strings too! */ void IDP_ResizeArray(IDProperty *prop, int newlen) { const bool is_grow = newlen >= prop->len; @@ -390,8 +390,8 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st) BLI_assert(prop->type == IDP_STRING); int newlen = prop->len + (int)strlen(st); - /* we have to remember that prop->len includes the null byte for strings. - * so there's no need to add +1 to the resize function.*/ + /* We have to remember that prop->len includes the null byte for strings. + * so there's no need to add +1 to the resize function. */ IDP_ResizeArray(prop, newlen); strcat(prop->data.pointer, st); } @@ -400,8 +400,8 @@ void IDP_ConcatString(IDProperty *str1, IDProperty *append) { BLI_assert(append->type == IDP_STRING); - /* since ->len for strings includes the NULL byte, we have to subtract one or - * we'll get an extra null byte after each concatenation operation.*/ + /* Since ->len for strings includes the NULL byte, we have to subtract one or + * we'll get an extra null byte after each concatenation operation. */ int newlen = str1->len + append->len - 1; IDP_ResizeArray(str1, newlen); strcat(str1->data.pointer, append->data.pointer); @@ -775,10 +775,10 @@ IDProperty *IDP_GetProperties(ID *id, const bool create_if_needed) if (create_if_needed) { id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty"); id->properties->type = IDP_GROUP; - /* don't overwrite the data's name and type + /* NOTE(campbell): Don't overwrite the data's name and type * some functions might need this if they - * don't have a real ID, should be named elsewhere - Campbell */ - /* strcpy(id->name, "top_level_group");*/ + * don't have a real ID, should be named elsewhere. */ + // strcpy(id->name, "top_level_group"); } return id->properties; } @@ -1219,7 +1219,7 @@ static void IDP_DirectLinkArray(IDProperty *prop, BlendDataReader *reader) static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader) { - /*since we didn't save the extra string buffer, set totallen to len.*/ + /* Since we didn't save the extra string buffer, set totallen to len. */ prop->totallen = prop->len; BLO_read_data_address(reader, &prop->data.pointer); } @@ -1230,7 +1230,7 @@ static void IDP_DirectLinkGroup(IDProperty *prop, BlendDataReader *reader) BLO_read_list(reader, lb); - /*Link child id properties now*/ + /* Link child id properties now. */ LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) { IDP_DirectLinkProperty(loop, reader); } |