foreign/libsdbfs: fix comparison warnings

Force compared expressions into unsigned values.
parent 81cf88a2
......@@ -27,7 +27,7 @@ int sdbfs_fread(struct sdbfs *fs, int offset, void *buf, int count)
return -ENOENT;
if (offset < 0)
offset = fs->read_offset;
if (offset + count > fs->f_len)
if ((unsigned int)(offset + count) > fs->f_len)
count = fs->f_len - offset;
ret = count;
if (fs->data)
......@@ -47,7 +47,7 @@ int sdbfs_fwrite(struct sdbfs *fs, int offset, void *buf, int count)
return -ENOENT;
if (offset < 0)
offset = fs->read_offset;
if (offset + count > fs->f_len)
if ((unsigned int)(offset + count) > fs->f_len)
count = fs->f_len - offset;
ret = count;
if (fs->data)
......@@ -67,7 +67,7 @@ int sdbfs_ferase(struct sdbfs *fs, int offset, int count)
return -ENOENT;
if (offset < 0)
offset = fs->read_offset;
if (offset + count > fs->f_len)
if ((unsigned int)(offset + count) > fs->f_len)
count = fs->f_len - offset;
ret = count;
if (fs->data)
......
......@@ -90,7 +90,7 @@ static struct sdb_device *sdbfs_readentry(struct sdbfs *fs,
if (fs->flags & SDBFS_F_CONVERT32) {
uint32_t *p = (void *)&fs->current_record;
int i;
unsigned int i;
for (i = 0; i < sizeof(fs->current_record) / sizeof(*p); i++)
p[i] = ntohl(p[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment