From c145dfaa541e8166971353e91dfc281648379cd3 Mon Sep 17 00:00:00 2001 From: batt Date: Mon, 28 Jun 2010 10:51:10 +0000 Subject: [PATCH] Fixes warning. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3952 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/io/kblock.h | 2 ++ bertos/io/kblock_ram.c | 18 +++++++++--------- bertos/io/kblock_ram.h | 5 +++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/bertos/io/kblock.h b/bertos/io/kblock.h index b486fa6d..59d19bae 100644 --- a/bertos/io/kblock.h +++ b/bertos/io/kblock.h @@ -430,4 +430,6 @@ INLINE int kblock_close(struct KBlock *b) return b->vt->close(b); } +void *kblock_unsupportedMap(struct KBlock *b, UNUSED_ARG(size_t, offset), UNUSED_ARG(size_t, size)); + #endif /* IO_KBLOCK_H */ diff --git a/bertos/io/kblock_ram.c b/bertos/io/kblock_ram.c index d5ffc907..6707561d 100644 --- a/bertos/io/kblock_ram.c +++ b/bertos/io/kblock_ram.c @@ -40,56 +40,56 @@ #include -int kblockram_load(KBlock *b, block_idx_t index) +static int kblockram_load(KBlock *b, block_idx_t index) { KBlockRam *r = KBLOCKRAM_CAST(b); memcpy(r->b.priv.pagebuf, r->membuf + index * r->b.blk_size, r->b.blk_size); return 0; } -int kblockram_store(struct KBlock *b, block_idx_t index) +static int kblockram_store(struct KBlock *b, block_idx_t index) { KBlockRam *r = KBLOCKRAM_CAST(b); memcpy(r->membuf + index * r->b.blk_size, r->b.priv.pagebuf, r->b.blk_size); return 0; } -size_t kblockram_readBuf(struct KBlock *b, void *buf, size_t offset, size_t size) +static size_t kblockram_readBuf(struct KBlock *b, void *buf, size_t offset, size_t size) { KBlockRam *r = KBLOCKRAM_CAST(b); memcpy(buf, (uint8_t *)r->b.priv.pagebuf + offset, size); return size; } -size_t kblockram_writeBuf(struct KBlock *b, const void *buf, size_t offset, size_t size) +static size_t kblockram_writeBuf(struct KBlock *b, const void *buf, size_t offset, size_t size) { KBlockRam *r = KBLOCKRAM_CAST(b); memcpy((uint8_t *)r->b.priv.pagebuf + offset, buf, size); return size; } -void * kblockram_map(struct KBlock *b, size_t offset, UNUSED_ARG(size_t, size)) +static void * kblockram_map(struct KBlock *b, size_t offset, UNUSED_ARG(size_t, size)) { return (uint8_t *)b->priv.pagebuf + offset; } -int kblockram_unmap(UNUSED_ARG(struct KBlock *, b), UNUSED_ARG(size_t, offset), UNUSED_ARG(size_t, size)) +static int kblockram_unmap(UNUSED_ARG(struct KBlock *, b), UNUSED_ARG(size_t, offset), UNUSED_ARG(size_t, size)) { return 0; } -int kblockram_error(struct KBlock *b) +static int kblockram_error(struct KBlock *b) { return b->priv.flags; } -int kblockram_dummy(UNUSED_ARG(struct KBlock *,b)) +static int kblockram_dummy(UNUSED_ARG(struct KBlock *,b)) { return 0; } -static const KBlockVTable kblockram_vt = +static KBlockVTable kblockram_vt = { .readBuf = kblockram_readBuf, .writeBuf = kblockram_writeBuf, diff --git a/bertos/io/kblock_ram.h b/bertos/io/kblock_ram.h index b003a601..1ae8933b 100644 --- a/bertos/io/kblock_ram.h +++ b/bertos/io/kblock_ram.h @@ -35,6 +35,8 @@ * \brief KBlock interface */ +#ifndef KBLOCK_RAM_H +#define KBLOCK_RAM_H #include "kblock.h" @@ -54,3 +56,6 @@ INLINE KBlockRam *KBLOCKRAM_CAST(KBlock *b) return (KBlockRam *)b; } +void kblockram_init(KBlockRam *ram, void *buf, size_t size, size_t block_size); + +#endif /* KBLOCK_RAM_H */ -- 2.25.1