From cec5c069b08ce39fe17af5d0a0df278469f46c57 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 21 Aug 2008 16:17:35 +0000 Subject: 2008-08-21 Joel Sherrill * libblock/include/rtems/bdbuf.h, libblock/include/rtems/diskdevs.h, libblock/src/bdbuf.c, libblock/src/blkdev.c, libblock/src/diskdevs.c, libblock/src/ramdisk.c: Eliminate sign mismatch warnings. --- cpukit/libblock/include/rtems/bdbuf.h | 10 +++++----- cpukit/libblock/include/rtems/diskdevs.h | 8 ++++---- cpukit/libblock/src/bdbuf.c | 18 +++++++++--------- cpukit/libblock/src/blkdev.c | 16 ++++++++-------- cpukit/libblock/src/diskdevs.c | 14 +++++++------- cpukit/libblock/src/ramdisk.c | 6 +++--- 6 files changed, 36 insertions(+), 36 deletions(-) (limited to 'cpukit/libblock') diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h index c5a2748aec..48915e9c16 100644 --- a/cpukit/libblock/include/rtems/bdbuf.h +++ b/cpukit/libblock/include/rtems/bdbuf.h @@ -86,8 +86,8 @@ typedef struct rtems_bdbuf_buffer */ typedef struct rtems_bdbuf_pool { - int blksize; /*< The size of the blocks (in bytes) */ - int nblks; /*< Number of blocks in this pool */ + uint32_t blksize; /*< The size of the blocks (in bytes) */ + uint32_t nblks; /*< Number of blocks in this pool */ uint32_t flags; /*< Configuration flags */ @@ -144,8 +144,8 @@ extern int rtems_bdbuf_pool_configuration_size; * structure. */ typedef struct rtems_bdbuf_config { - int max_read_ahead_blocks; /*< Number of blocks to read ahead. */ - int max_write_blocks; /*< Number of blocks to write at once. */ + uint32_t max_read_ahead_blocks; /*< Number of blocks to read ahead. */ + uint32_t max_write_blocks; /*< Number of blocks to write at once. */ rtems_task_priority swapout_priority; /*< Priority of the swap out task. */ uint32_t swapout_period; /*< Period swapout checks buf timers. */ uint32_t swap_block_hold; /*< Period a buffer is held. */ @@ -317,7 +317,7 @@ rtems_bdbuf_syncdev (dev_t dev); * is not configured. */ rtems_status_code -rtems_bdbuf_find_pool (int block_size, rtems_bdpool_id *pool); +rtems_bdbuf_find_pool (uint32_t block_size, rtems_bdpool_id *pool); /** * Obtain characteristics of buffer pool with specified number. diff --git a/cpukit/libblock/include/rtems/diskdevs.h b/cpukit/libblock/include/rtems/diskdevs.h index 3517ddede2..745fa55bb7 100644 --- a/cpukit/libblock/include/rtems/diskdevs.h +++ b/cpukit/libblock/include/rtems/diskdevs.h @@ -47,16 +47,16 @@ typedef struct rtems_disk_device { char *name; /* Disk device name */ int uses; /* Use counter. Device couldn't be removed if it is in use. */ - int start; /* Starting block number (0 for + uint32_t start; /* Starting block number (0 for physical devices, block offset on the related physical device for logical device) */ - int size; /* Size of physical or logical disk + uint32_t size; /* Size of physical or logical disk in disk blocks */ - int block_size; /* Size of device block (minimum + uint32_t block_size; /* Size of device block (minimum transfer unit) in bytes (must be power of 2) */ - int block_size_log2; /* log2 of block_size */ + uint32_t block_size_log2; /* log2 of block_size */ rtems_bdpool_id pool; /* Buffer pool assigned to this device */ rtems_block_device_ioctl ioctl; /* ioctl handler for this block diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c index 47ce0522e9..57b90d7cef 100644 --- a/cpukit/libblock/src/bdbuf.c +++ b/cpukit/libblock/src/bdbuf.c @@ -927,7 +927,7 @@ rtems_bdbuf_initialize_pool (rtems_bdbuf_pool_config* config, rtems_bdbuf_pool* pool; rtems_bdbuf_buffer* bd; rtems_status_code sc; - int b; + uint32_t b; pool = rtems_bdbuf_get_pool (pid); @@ -1296,7 +1296,7 @@ rtems_bdbuf_get_buffer (rtems_disk_device* pdd, if (!rtems_chain_is_empty (&pool->modified)) { rtems_chain_node* node = rtems_chain_head (&pool->modified); - int write_blocks = 0; + uint32_t write_blocks = 0; node = node->next; while ((write_blocks < rtems_bdbuf_configuration.max_write_blocks) && @@ -1527,7 +1527,7 @@ rtems_bdbuf_read (dev_t device, rtems_disk_device* dd; rtems_bdbuf_pool* pool; rtems_bdbuf_buffer* bd = NULL; - int read_ahead_count; + uint32_t read_ahead_count; rtems_blkdev_request* req; /* @@ -1639,8 +1639,8 @@ rtems_bdbuf_read (dev_t device, * enabled and the pool unlocked. This is a change to the previous version * of the bdbuf code. */ - int result; - int b; + int result; + uint32_t b; rtems_bdbuf_unlock_pool (pool); @@ -2042,7 +2042,7 @@ rtems_bdbuf_swapout_modified_processing (rtems_bdpool_id pid, * assumption. Cannot use the transfer list being empty the sync dev * calls sets the dev to use. */ - if (*dev == -1) + if (*dev == (dev_t)-1) *dev = bd->dev; if (bd->dev == *dev) @@ -2235,7 +2235,7 @@ rtems_bdbuf_swapout_pool_processing (rtems_bdpool_id pid, if (write) { int result; - int b; + uint32_t b; /* * Perform the transfer. No pool locks, no preemption, only the disk @@ -2435,13 +2435,13 @@ rtems_bdbuf_swapout_task (rtems_task_argument arg) * is not configured. */ rtems_status_code -rtems_bdbuf_find_pool (int block_size, rtems_bdpool_id *pool) +rtems_bdbuf_find_pool (uint32_t block_size, rtems_bdpool_id *pool) { rtems_bdbuf_pool* p; rtems_bdpool_id i; rtems_bdpool_id curid = -1; rtems_boolean found = FALSE; - int cursize = INT_MAX; + uint32_t cursize = UINT_MAX; int j; for (j = block_size; (j != 0) && ((j & 1) == 0); j >>= 1); diff --git a/cpukit/libblock/src/blkdev.c b/cpukit/libblock/src/blkdev.c index 0f1997565d..1fd063720f 100644 --- a/cpukit/libblock/src/blkdev.c +++ b/cpukit/libblock/src/blkdev.c @@ -58,8 +58,8 @@ rtems_blkdev_generic_read( while (count > 0) { rtems_bdbuf_buffer *diskbuf; - int copy; - rtems_status_code rc; + uint32_t copy; + rtems_status_code rc; rc = rtems_bdbuf_read(dev, block, &diskbuf); if (rc != RTEMS_SUCCESSFUL) @@ -91,12 +91,12 @@ rtems_blkdev_generic_write( void * arg) { rtems_libio_rw_args_t *args = arg; - int block_size_log2; - int block_size; + int block_size_log2; + uint32_t block_size; char *buf; - unsigned int count; - unsigned int block; - unsigned int blkofs; + uint32_t count; + uint32_t block; + uint32_t blkofs; dev_t dev; rtems_status_code rc; rtems_disk_device *dd; @@ -119,7 +119,7 @@ rtems_blkdev_generic_write( while (count > 0) { rtems_bdbuf_buffer *diskbuf; - int copy; + uint32_t copy; if ((blkofs == 0) && (count >= block_size)) rc = rtems_bdbuf_get(dev, block, &diskbuf); diff --git a/cpukit/libblock/src/diskdevs.c b/cpukit/libblock/src/diskdevs.c index 35332c4b87..b04e08818c 100644 --- a/cpukit/libblock/src/diskdevs.c +++ b/cpukit/libblock/src/diskdevs.c @@ -25,14 +25,14 @@ /* Table of disk devices having the same major number */ typedef struct rtems_disk_device_table { rtems_disk_device **minor; /* minor-indexed disk device table */ - int size; /* Number of entries in the table */ + uint32_t size; /* Number of entries in the table */ } rtems_disk_device_table; /* Pointer to [major].minor[minor] indexed array of disk devices */ static rtems_disk_device_table *disktab; /* Number of allocated entries in disktab table */ -static int disktab_size; +static uint32_t disktab_size; /* Mutual exclusion semaphore for disk devices table */ static rtems_id diskdevs_mutex; @@ -76,8 +76,8 @@ create_disk_entry(dev_t dev) if (major >= disktab_size) { rtems_disk_device_table *p; - int newsize; - int i; + uint32_t newsize; + uint32_t i; newsize = disktab_size * 2; if (major >= newsize) newsize = major + 1; @@ -97,10 +97,10 @@ create_disk_entry(dev_t dev) if ((disktab[major].minor == NULL) || (minor >= disktab[major].size)) { - int newsize; + uint32_t newsize; rtems_disk_device **p; - int i; - int s = disktab[major].size; + uint32_t i; + uint32_t s = disktab[major].size; if (s == 0) newsize = DISKTAB_INITIAL_SIZE; diff --git a/cpukit/libblock/src/ramdisk.c b/cpukit/libblock/src/ramdisk.c index 1b544316df..6ec3b13386 100644 --- a/cpukit/libblock/src/ramdisk.c +++ b/cpukit/libblock/src/ramdisk.c @@ -46,7 +46,7 @@ struct ramdisk { }; static struct ramdisk *ramdisk; -static int nramdisks; +static uint32_t nramdisks; #if RTEMS_RAMDISK_TRACE /** @@ -103,7 +103,7 @@ ramdisk_read(struct ramdisk *rd, rtems_blkdev_request *req) sg = req->bufs; for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) { - int count = sg->length; + uint32_t count = sg->length; from = ((char *)rd->area + (sg->block * rd->block_size)); if (count > remains) count = remains; @@ -143,7 +143,7 @@ ramdisk_write(struct ramdisk *rd, rtems_blkdev_request *req) sg = req->bufs; for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) { - int count = sg->length; + uint32_t count = sg->length; to = ((char *)rd->area + (sg->block * rd->block_size)); if (count > remains) count = remains; -- cgit v1.2.3