diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:29:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:38:00 +0300 |
commit | 171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 (patch) | |
tree | ea51f4fa508a39807e6f6d333b2d53af8a2b9fc1 /source/blender/modifiers/intern/MOD_meshcache_pc2.c | |
parent | 4bf3ca20165959f98c7c830a138ba2901d3dd851 (diff) |
Cleanup: use array syntax for sizeof with fixed values
Also order sizeof(..) first to promote other values to size_t.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshcache_pc2.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshcache_pc2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c index 1ea71730db7..120d1d6d71a 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_pc2.c +++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c @@ -146,7 +146,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, return false; } - if (BLI_fseek(fp, sizeof(float) * 3 * index * pc2_head.verts_tot, SEEK_CUR) != 0) { + if (BLI_fseek(fp, sizeof(float[3]) * index * pc2_head.verts_tot, SEEK_CUR) != 0) { *err_str = "Failed to seek frame"; return false; } @@ -155,7 +155,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, float *vco = *vertexCos; uint i; for (i = pc2_head.verts_tot; i != 0; i--, vco += 3) { - fread(vco, sizeof(float) * 3, 1, fp); + fread(vco, sizeof(float[3]), 1, fp); #ifdef __BIG_ENDIAN__ BLI_endian_switch_float(vco + 0); @@ -170,7 +170,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, uint i; for (i = pc2_head.verts_tot; i != 0; i--, vco += 3) { float tvec[3]; - fread(tvec, sizeof(float) * 3, 1, fp); + fread(tvec, sizeof(float[3]), 1, fp); #ifdef __BIG_ENDIAN__ BLI_endian_switch_float(tvec + 0); |