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>2018-05-08 14:32:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-08 14:32:52 +0300
commit53580265118236a096257b50f29d354243bdefe3 (patch)
tree9d0739dd34b8679abce1c6adfd01da9aff782907 /source/blender/blenloader
parent59ce30f32b45a04eb352590fe719a30efa3f4a6a (diff)
Cleanup: quiet -Warray-bounds warning
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 7d73b3050a6..9e9481566b0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -765,7 +765,9 @@ static BHeadN *get_bhead(FileData *fd)
bh8_from_bh4(&bhead, &bhead4);
}
else {
- memcpy(&bhead, &bhead4, sizeof(bhead));
+ /* MIN2 is only to quiet '-Warray-bounds' compiler warning. */
+ BLI_assert(sizeof(bhead) == sizeof(bhead4));
+ memcpy(&bhead, &bhead4, MIN2(sizeof(bhead), sizeof(bhead4)));
}
}
else {
@@ -786,7 +788,9 @@ static BHeadN *get_bhead(FileData *fd)
bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN));
}
else {
- memcpy(&bhead, &bhead8, sizeof(bhead));
+ /* MIN2 is only to quiet '-Warray-bounds' compiler warning. */
+ BLI_assert(sizeof(bhead) == sizeof(bhead8));
+ memcpy(&bhead, &bhead8, MIN2(sizeof(bhead), sizeof(bhead8)));
}
}
else {