diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-02 17:05:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-02 17:29:08 +0300 |
commit | f67e81e295ac7da6857edc441e0ba582cfcd6424 (patch) | |
tree | 9757f1e83ef017b37579772e4f3bbc675ed31a73 /source/blender/blenloader | |
parent | dc858a048b0f41207678677e0baba1fd29eadfb0 (diff) |
Cleanup: SDNA/DNA naming
Use 'size' instead of 'len' to represent the size of data in bytes,
'len' is used for the result of 'strlen' or the length of an array
in some parts of 'makesdna.c' & 'dna_genfile.c'.
Also clarify comments and some variable names, no functional changes.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fec4f3486d5..dc988afaabe 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2118,7 +2118,7 @@ static void switch_endian_structs(const struct SDNA *filesdna, BHead *bhead) char *data; data = (char *)(bhead + 1); - blocksize = filesdna->typelens[filesdna->structs[bhead->SDNAnr][0]]; + blocksize = filesdna->types_size[filesdna->structs[bhead->SDNAnr][0]]; nblocks = bhead->nr; while (nblocks--) { @@ -2264,9 +2264,9 @@ static void test_pointer_array(FileData *fd, void **mat) * the new dna format. */ if (*mat) { - len = MEM_allocN_len(*mat) / fd->filesdna->pointerlen; + len = MEM_allocN_len(*mat) / fd->filesdna->pointer_size; - if (fd->filesdna->pointerlen == 8 && fd->memsdna->pointerlen == 4) { + if (fd->filesdna->pointer_size == 8 && fd->memsdna->pointer_size == 4) { ipoin = imat = MEM_malloc_arrayN(len, 4, "newmatar"); lpoin = *mat; @@ -2281,7 +2281,7 @@ static void test_pointer_array(FileData *fd, void **mat) *mat = imat; } - if (fd->filesdna->pointerlen == 4 && fd->memsdna->pointerlen == 8) { + if (fd->filesdna->pointer_size == 4 && fd->memsdna->pointer_size == 8) { lpoin = lmat = MEM_malloc_arrayN(len, 8, "newmatar"); ipoin = *mat; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ef2c73a675f..6694e050695 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -531,7 +531,7 @@ static void writestruct_at_address_nr( bh.SDNAnr = struct_nr; sp = wd->sdna->structs[bh.SDNAnr]; - bh.len = nr * wd->sdna->typelens[sp[0]]; + bh.len = nr * wd->sdna->types_size[sp[0]]; if (bh.len == 0) { return; @@ -4047,7 +4047,7 @@ static bool write_file_handle( * * Note that we *borrow* the pointer to 'DNAstr', * so writing each time uses the same address and doesn't cause unnecessary undo overhead. */ - writedata(wd, DNA1, wd->sdna->datalen, wd->sdna->data); + writedata(wd, DNA1, wd->sdna->data_len, wd->sdna->data); #ifdef USE_NODE_COMPAT_CUSTOMNODES /* compatibility data not created on undo */ |