From: Tristan Lelong <
tlelong@adeneo-embedded.com>
In in 32 bits, if sizeof(long) == 4 then
(long)var >> 32 == var
So we need to check for that specific case
Signed-off-by: Tristan Lelong <
tlelong@adeneo-embedded.com>
---
without this, the size of the files on the target are huge...
utils/mkyaffs2image.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils/mkyaffs2image.c b/utils/mkyaffs2image.c
index b46f285..7fe4f68 100644
--- a/utils/mkyaffs2image.c
+++ b/utils/mkyaffs2image.c
@@ -302,7 +302,11 @@ static int write_object_header(int id, enum yaffs_obj_type t, struct stat *s, in
if(t == YAFFS_OBJECT_TYPE_FILE)
{
oh->file_size_low = s->st_size;
+#if __SIZEOF_LONG__ == __SIZE_OF_INT__
+ oh->file_size_high = 0;
+#else
oh->file_size_high = (s->st_size >> 32);
+#endif
}
if(t == YAFFS_OBJECT_TYPE_HARDLINK)
--
618FE3EF