[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 38/75: fix compiler warnings in hurd/ext2fs
From: |
Samuel Thibault |
Subject: |
[hurd] 38/75: fix compiler warnings in hurd/ext2fs |
Date: |
Thu, 14 Jan 2016 01:04:08 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 6ca2aa1284a5e82df0193d2727941420361bc50f
Author: Flavio Cruz <address@hidden>
Date: Tue Dec 29 18:11:06 2015 +0100
fix compiler warnings in hurd/ext2fs
ext2fs: Fix compiler warnings.
* ext2fs/balloc.c: Use unsigned char instead of char.
* ext2fs/bitmap.c Use unsigned char for bitmaps.
* ext2fs/dir.c: Fix format.
* ext2fs/ext2fs.h: Use unsigned char for bitmaps.
* ext2fs/ialloc.c: Use unsigned char for bitmaps. Fix format string in
ext2_warning.
* ext2fs/pager.c: Fix format string in ext2_warning and ext2_error.
---
ext2fs/balloc.c | 12 ++++++------
ext2fs/bitmap.c | 2 +-
ext2fs/dir.c | 2 +-
ext2fs/ext2fs.h | 12 ++++++------
ext2fs/hyper.c | 2 +-
ext2fs/ialloc.c | 8 ++++----
ext2fs/pager.c | 4 ++--
7 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index efef8ae..0b9e5a5 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -57,7 +57,7 @@ memscan (void *buf, unsigned char ch, size_t len)
void
ext2_free_blocks (block_t block, unsigned long count)
{
- char *bh;
+ unsigned char *bh;
unsigned long block_group;
unsigned long bit;
unsigned long i;
@@ -140,8 +140,8 @@ ext2_new_block (block_t goal,
block_t prealloc_goal,
block_t *prealloc_count, block_t *prealloc_block)
{
- char *bh = NULL;
- char *p, *r;
+ unsigned char *bh = NULL;
+ unsigned char *p, *r;
int i, j, k, tmp;
unsigned long lmap;
struct ext2_group_desc *gdp;
@@ -231,9 +231,9 @@ repeat:
* Search first in the remainder of the current group; then,
* cyclicly search through the rest of the groups.
*/
- p = ((char *) bh) + (j >> 3);
+ p = bh + (j >> 3);
r = memscan (p, 0, (sblock->s_blocks_per_group - j + 7) >> 3);
- k = (r - ((char *) bh)) << 3;
+ k = (r - bh) << 3;
if (k < sblock->s_blocks_per_group)
{
j = k;
@@ -434,7 +434,7 @@ block_in_use (block_t block, unsigned char *map)
void
ext2_check_blocks_bitmap ()
{
- char *bh;
+ unsigned char *bh;
unsigned long desc_count, bitmap_count, x;
unsigned long desc_blocks;
struct ext2_group_desc *gdp;
diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c
index 9285023..c6d882b 100644
--- a/ext2fs/bitmap.c
+++ b/ext2fs/bitmap.c
@@ -32,7 +32,7 @@
static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
static inline
-unsigned long count_free (char * map, unsigned int numchars)
+unsigned long count_free (unsigned char *map, unsigned int numchars)
{
unsigned int i;
unsigned long sum = 0;
diff --git a/ext2fs/dir.c b/ext2fs/dir.c
index 6cdfba2..bc375c3 100644
--- a/ext2fs/dir.c
+++ b/ext2fs/dir.c
@@ -413,7 +413,7 @@ dirscanblock (vm_address_t blockaddr, struct node *dp, int
idx,
|| EXT2_DIR_REC_LEN (entry->name_len) > entry->rec_len
|| memchr (entry->name, '\0', entry->name_len))
{
- ext2_warning ("bad directory entry: inode: %Ld offset: %zd",
+ ext2_warning ("bad directory entry: inode: %Ld offset: %lu",
dp->cache_id,
currentoff - blockaddr + idx * DIRBLKSIZ);
return ENOENT;
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index b839819..070d5bd 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -116,14 +116,14 @@ void pokel_inherit (struct pokel *pokel, struct pokel
*from);
#include <stdint.h>
-extern int test_bit (unsigned num, char *bitmap);
+extern int test_bit (unsigned num, unsigned char *bitmap);
-extern int set_bit (unsigned num, char *bitmap);
+extern int set_bit (unsigned num, unsigned char *bitmap);
#if defined(__USE_EXTERN_INLINES) || defined(EXT2FS_DEFINE_EI)
/* Returns TRUE if bit NUM is set in BITMAP. */
EXT2FS_EI int
-test_bit (unsigned num, char *bitmap)
+test_bit (unsigned num, unsigned char *bitmap)
{
const uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
const uint_fast32_t mask = 1 << (num & 31);
@@ -133,7 +133,7 @@ test_bit (unsigned num, char *bitmap)
/* Sets bit NUM in BITMAP, and returns the previous state of the bit. Unlike
the linux version, this function is NOT atomic! */
EXT2FS_EI int
-set_bit (unsigned num, char *bitmap)
+set_bit (unsigned num, unsigned char *bitmap)
{
uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
const uint_fast32_t mask = 1 << (num & 31);
@@ -143,7 +143,7 @@ set_bit (unsigned num, char *bitmap)
/* Clears bit NUM in BITMAP, and returns the previous state of the bit.
Unlike the linux version, this function is NOT atomic! */
EXT2FS_EI int
-clear_bit (unsigned num, char *bitmap)
+clear_bit (unsigned num, unsigned char *bitmap)
{
uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
const uint_fast32_t mask = 1 << (num & 31);
@@ -437,7 +437,7 @@ struct pokel global_pokel;
/* If the block size is less than the page size, then this bitmap is used to
record which disk blocks are actually modified, so we don't stomp on parts
of the disk which are backed by file pagers. */
-char *modified_global_blocks;
+unsigned char *modified_global_blocks;
pthread_spinlock_t modified_global_blocks_lock;
extern int global_block_modified (block_t block);
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 5f288bf..91d9d12 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -24,7 +24,7 @@
#include "ext2fs.h"
vm_address_t zeroblock;
-char *modified_global_blocks;
+unsigned char *modified_global_blocks;
static void
allocate_mod_map (void)
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index 7cfc4f3..2809371 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -52,7 +52,7 @@
void
diskfs_free_node (struct node *np, mode_t old_mode)
{
- char *bh;
+ unsigned char *bh;
unsigned long block_group;
unsigned long bit;
struct ext2_group_desc *gdp;
@@ -114,7 +114,7 @@ diskfs_free_node (struct node *np, mode_t old_mode)
ino_t
ext2_alloc_inode (ino_t dir_inum, mode_t mode)
{
- char *bh = NULL;
+ unsigned char *bh = NULL;
int i, j, avefreei;
ino_t inum;
struct ext2_group_desc *gdp;
@@ -225,7 +225,7 @@ repeat:
{
if (set_bit (inum, bh))
{
- ext2_warning ("bit already set for inode %d", inum);
+ ext2_warning ("bit already set for inode %llu", inum);
disk_cache_block_deref (bh);
bh = NULL;
goto repeat;
@@ -250,7 +250,7 @@ repeat:
if (inum < EXT2_FIRST_INO (sblock) || inum > sblock->s_inodes_count)
{
ext2_error ("reserved inode or inode > inodes count - "
- "block_group = %d,inode=%d", i, inum);
+ "block_group = %d,inode=%llu", i, inum);
inum = 0;
goto sync_out;
}
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 47c5f94..458b822 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -636,7 +636,7 @@ pager_unlock_page (struct user_pager_info *pager,
vm_offset_t page)
if (err == ENOSPC)
ext2_warning ("This filesystem is out of space, and will now crash.
Bye!");
else if (err)
- ext2_warning ("inode=%Ld, page=0x%zx: %s",
+ ext2_warning ("inode=%Ld, page=0x%lx: %s",
node->cache_id, page, strerror (err));
return err;
@@ -988,7 +988,7 @@ disk_cache_return_unused (void)
1);
else
{
- printf ("ext2fs: disk cache is starving\n");
+ ext2_debug ("ext2fs: disk cache is starving\n");
/* Give it some time. This should happen rarely. */
sleep (1);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 49/75: fix compiler warnings in hurd/nfs and hurd/nfsd, (continued)
- [hurd] 49/75: fix compiler warnings in hurd/nfs and hurd/nfsd, Samuel Thibault, 2016/01/13
- [hurd] 35/75: fix compiler warnings in hurd/console-client, Samuel Thibault, 2016/01/13
- [hurd] 40/75: fix compiler warnings in hurd/isofs, Samuel Thibault, 2016/01/13
- [hurd] 57/75: Add missing libraries to fix link errors, Samuel Thibault, 2016/01/13
- [hurd] 52/75: fix compiler warnings in hurd/random, Samuel Thibault, 2016/01/13
- [hurd] 62/75: fix mach-defpager static linking, Samuel Thibault, 2016/01/13
- [hurd] 60/75: Drop OTHERLIBS and use LDLIBS exclusively, Samuel Thibault, 2016/01/13
- [hurd] 63/75: allow pfinet to link using -O0, Samuel Thibault, 2016/01/13
- [hurd] 55/75: fix compiler warnings in hurd/utils, Samuel Thibault, 2016/01/13
- [hurd] 48/75: drop the deprecated malloc/free hooks in hurd/mach-defpager, Samuel Thibault, 2016/01/13
- [hurd] 38/75: fix compiler warnings in hurd/ext2fs,
Samuel Thibault <=
- [hurd] 39/75: fix compiler warnings in hurd/console-client, Samuel Thibault, 2016/01/13
- [hurd] 51/75: Include missing header file in hurd/proc, Samuel Thibault, 2016/01/13
- [hurd] 34/75: boot: Fix boot.c compiler warning., Samuel Thibault, 2016/01/13
- [hurd] 53/75: fix compiler warnings in hurd/startup, Samuel Thibault, 2016/01/13
- [hurd] 36/75: fix compiler warnings in hurd/daemons, Samuel Thibault, 2016/01/13
- [hurd] 37/75: fix compiler warnings in hurd/exec, Samuel Thibault, 2016/01/13
- [hurd] 44/75: fix compiler warnings in hurd/libihash, Samuel Thibault, 2016/01/13
- [hurd] 42/75: fix compiler warnings in hurd/isofs, Samuel Thibault, 2016/01/13
- [hurd] 43/75: fix compiler warnings in hurd/libftpconn, Samuel Thibault, 2016/01/13
- [hurd] 61/75: fix compiler warning in hurd/fstests, Samuel Thibault, 2016/01/13