/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
- * Copyright (C) 2002-2011 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
#include "yaffs_nameval.h"
#include "yaffs_guts.h"
#include "yportenv.h"
+#include "yaffs_endian.h"
static int nval_find(struct yaffs_dev *dev,
const char *xb, int xb_size, const YCHAR *name,
return pos;
}
pos += size;
- if (pos < xb_size - sizeof(size)) {
+ if (pos < (int)(xb_size - sizeof(size))) {
memcpy(&size, xb + pos, sizeof(size));
yaffs_do_endian_s32(dev, &size);
while (size > 0 && (size < xb_size) && (pos + size < xb_size)) {
pos += size;
- if (pos < xb_size - sizeof(size)) {
+ if (pos < (int)(xb_size - sizeof(size))) {
memcpy(&size, xb + pos, sizeof(size));
yaffs_do_endian_s32(dev, &size);
} else
memcpy(&size, xb + pos, sizeof(size));
yaffs_do_endian_s32(dev, &size);
- while (size > sizeof(size) &&
+ while (size > (int)(sizeof(size)) &&
size <= xb_size &&
(pos + size) < xb_size &&
!filled) {
filled = 1;
}
pos += size;
- if (pos < xb_size - sizeof(size)) {
+ if (pos < (int)(xb_size - sizeof(size))) {
memcpy(&size, xb + pos, sizeof(size));
yaffs_do_endian_s32(dev, &size);
}