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-13 02:34:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-13 02:34:44 +0300
commitdea9aa1591c7fc1a66d361b2e7f047ff687650e3 (patch)
treedb6607bf00215ec5cd77cd247a808755ceb16e2d
parent35b0e1f513847ad8d8271309ce9213fb392e8bdd (diff)
Rename 'elem_dna' to 'elem_full'
-rw-r--r--source/blender/makesdna/intern/dna_utils.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c
index 19bf312e6cd..0a8a7a63f2e 100644
--- a/source/blender/makesdna/intern/dna_utils.c
+++ b/source/blender/makesdna/intern/dna_utils.c
@@ -89,22 +89,22 @@ static bool is_identifier(const char c)
(c == '_'));
}
-uint DNA_elem_id_offset_start(const char *elem_dna)
+uint DNA_elem_id_offset_start(const char *elem_full)
{
- uint elem_dna_offset = 0;
- while (!is_identifier(elem_dna[elem_dna_offset])) {
- elem_dna_offset++;
+ uint elem_full_offset = 0;
+ while (!is_identifier(elem_full[elem_full_offset])) {
+ elem_full_offset++;
}
- return elem_dna_offset;
+ return elem_full_offset;
}
-uint DNA_elem_id_offset_end(const char *elem_dna)
+uint DNA_elem_id_offset_end(const char *elem_full)
{
- uint elem_dna_offset = 0;
- while (is_identifier(elem_dna[elem_dna_offset])) {
- elem_dna_offset++;
+ uint elem_full_offset = 0;
+ while (is_identifier(elem_full[elem_full_offset])) {
+ elem_full_offset++;
}
- return elem_dna_offset;
+ return elem_full_offset;
}
/**
@@ -125,16 +125,16 @@ void DNA_elem_id_strip(char *elem_dst, const char *elem_src)
*/
bool DNA_elem_id_match(
const char *elem_search, const int elem_search_len,
- const char *elem_dna,
- uint *r_elem_dna_offset)
+ const char *elem_full,
+ uint *r_elem_full_offset)
{
BLI_assert(strlen(elem_search) == elem_search_len);
- const uint elem_dna_offset = DNA_elem_id_offset_start(elem_dna);
- const char *elem_dna_trim = elem_dna + elem_dna_offset;
- if (strncmp(elem_search, elem_dna_trim, elem_search_len) == 0) {
- const char c = elem_dna_trim[elem_search_len];
+ const uint elem_full_offset = DNA_elem_id_offset_start(elem_full);
+ const char *elem_full_trim = elem_full + elem_full_offset;
+ if (strncmp(elem_search, elem_full_trim, elem_search_len) == 0) {
+ const char c = elem_full_trim[elem_search_len];
if (c == '\0' || !is_identifier(c)) {
- *r_elem_dna_offset = elem_dna_offset;
+ *r_elem_full_offset = elem_full_offset;
return true;
}
}
@@ -148,32 +148,32 @@ char *DNA_elem_id_rename(
struct MemArena *mem_arena,
const char *elem_src, const int elem_src_len,
const char *elem_dst, const int elem_dst_len,
- const char *elem_dna_src, const int elem_dna_src_len,
- const uint elem_dna_offset_start)
+ const char *elem_full_src, const int elem_full_src_len,
+ const uint elem_full_offset_start)
{
BLI_assert(strlen(elem_src) == elem_src_len);
BLI_assert(strlen(elem_dst) == elem_dst_len);
- BLI_assert(strlen(elem_dna_src) == elem_dna_src_len);
- BLI_assert(DNA_elem_id_offset_start(elem_dna_src) == elem_dna_offset_start);
+ BLI_assert(strlen(elem_full_src) == elem_full_src_len);
+ BLI_assert(DNA_elem_id_offset_start(elem_full_src) == elem_full_offset_start);
UNUSED_VARS_NDEBUG(elem_src);
- const int elem_final_len = (elem_dna_src_len - elem_src_len) + elem_dst_len;
- char *elem_dna_dst = BLI_memarena_alloc(mem_arena, elem_final_len + 1);
+ const int elem_final_len = (elem_full_src_len - elem_src_len) + elem_dst_len;
+ char *elem_full_dst = BLI_memarena_alloc(mem_arena, elem_final_len + 1);
uint i = 0;
- if (elem_dna_offset_start != 0) {
- memcpy(elem_dna_dst, elem_dna_src, elem_dna_offset_start);
- i = elem_dna_offset_start;
+ if (elem_full_offset_start != 0) {
+ memcpy(elem_full_dst, elem_full_src, elem_full_offset_start);
+ i = elem_full_offset_start;
}
- memcpy(&elem_dna_dst[i], elem_dst, elem_dst_len + 1);
+ memcpy(&elem_full_dst[i], elem_dst, elem_dst_len + 1);
i += elem_dst_len;
- uint elem_dna_offset_end = elem_dna_offset_start + elem_src_len;
- if (elem_dna_src[elem_dna_offset_end] != '\0') {
- const int elem_dna_tail_len = (elem_dna_src_len - elem_dna_offset_end);
- memcpy(&elem_dna_dst[i], &elem_dna_src[elem_dna_offset_end], elem_dna_tail_len + 1);
- i += elem_dna_tail_len;
+ uint elem_full_offset_end = elem_full_offset_start + elem_src_len;
+ if (elem_full_src[elem_full_offset_end] != '\0') {
+ const int elem_full_tail_len = (elem_full_src_len - elem_full_offset_end);
+ memcpy(&elem_full_dst[i], &elem_full_src[elem_full_offset_end], elem_full_tail_len + 1);
+ i += elem_full_tail_len;
}
- BLI_assert((strlen(elem_dna_dst) == elem_final_len) && (i == elem_final_len));
- return elem_dna_dst;
+ BLI_assert((strlen(elem_full_dst) == elem_final_len) && (i == elem_final_len));
+ return elem_full_dst;
}
/** \} */