From 52e2d901479b1fde80e490f5f53eec853a1310f1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 15 Oct 2013 21:55:38 +0200 Subject: [PATCH] src/system/mtdutils: Fix compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/db59b7d3f1ebb0c0591cd2de8ad677e0645ebfc4 Author: Michael Liebmann Date: 2013-10-15 (Tue, 15 Oct 2013) --- src/system/mtdutils/compr_rtime.cpp | 7 ++++--- src/system/mtdutils/mkfs.jffs2.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/system/mtdutils/compr_rtime.cpp b/src/system/mtdutils/compr_rtime.cpp index c8c6491e2..b3d2c387f 100644 --- a/src/system/mtdutils/compr_rtime.cpp +++ b/src/system/mtdutils/compr_rtime.cpp @@ -27,13 +27,14 @@ static int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out uint32_t *sourcelen, uint32_t *dstlen) { short positions[256]; - int outpos = 0; - int pos=0; + uint32_t outpos = 0; + uint32_t pos=0; memset(positions,0,sizeof(positions)); while (pos < (*sourcelen) && outpos+2 <= (*dstlen)) { - int backpos, runlen=0; + uint32_t backpos; + int runlen=0; unsigned char value; value = data_in[pos]; diff --git a/src/system/mtdutils/mkfs.jffs2.cpp b/src/system/mtdutils/mkfs.jffs2.cpp index 33ea6ffe0..1f81b0878 100644 --- a/src/system/mtdutils/mkfs.jffs2.cpp +++ b/src/system/mtdutils/mkfs.jffs2.cpp @@ -756,7 +756,7 @@ void CMkfsJFFS2::padblock(void) { while (out_ofs % erase_block_size) { full_write(out_fd, ffbuf, min(sizeof(ffbuf), - erase_block_size - (out_ofs % erase_block_size))); + (size_t)(erase_block_size - (out_ofs % erase_block_size)))); } } @@ -868,7 +868,7 @@ void CMkfsJFFS2::create_target_filesystem(struct filesystem_entry *root) } } else { while (out_ofs < pad_fs_size) { - full_write(out_fd, ffbuf, min(sizeof(ffbuf), pad_fs_size - out_ofs)); + full_write(out_fd, ffbuf, min(sizeof(ffbuf), (size_t)(pad_fs_size - out_ofs))); } }