Author: tkreuzer
Date: Sun Feb 15 11:24:52 2015
New Revision: 66286
URL:
http://svn.reactos.org/svn/reactos?rev=66286&view=rev
Log:
[LIBS]
Fix some MSVC warnings (and potential bugs) regarding signed/unsigned comparison.
Modified:
trunk/reactos/lib/drivers/sound/mmixer/sup.c
trunk/reactos/lib/fslib/ext2lib/Super.c
trunk/reactos/lib/fslib/vfatlib/check/check.c
trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h
Modified: trunk/reactos/lib/drivers/sound/mmixer/sup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/s…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmixer/sup.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmixer/sup.c [iso-8859-1] Sun Feb 15 11:24:52 2015
@@ -675,7 +675,8 @@
LPMIXERLINE_EXT MixerLine)
{
LPMIXERCONTROLDETAILS_UNSIGNED Input;
- LONG Value, Index, Channel = 0;
+ LONG Value;
+ ULONG Index, Channel = 0;
ULONG dwValue;
MIXER_STATUS Status;
LPMIXERVOLUME_DATA VolumeData;
Modified: trunk/reactos/lib/fslib/ext2lib/Super.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/ext2lib/Super.c?…
==============================================================================
--- trunk/reactos/lib/fslib/ext2lib/Super.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/ext2lib/Super.c [iso-8859-1] Sun Feb 15 11:24:52 2015
@@ -47,7 +47,7 @@
DPRINT(" Creator OS: %lu\n", pExt2Sb->s_creator_os);
DPRINT(" Revision Level: %lu\n", pExt2Sb->s_rev_level);
DPRINT(" Reserved Block Default UID: %u\n", pExt2Sb->s_def_resuid);
- DPRINT(" Reserved Block Default GID: %u\n", pExt2Sb->s_def_resgid);
+ DPRINT(" Reserved Block Default GID: %u\n", pExt2Sb->s_def_resgid);
DPRINT(" uuid = ");
for (i=0; i < 16; i++)
DbgPrint("%x ", pExt2Sb->s_uuid[i]);
@@ -75,13 +75,13 @@
{
int frags_per_block = 0;
ULONG overhead = 0;
- int rem = 0;
+ ULONG rem = 0;
ULONG i = 0;
ULONG group_block = 0;
ULONG numblocks = 0;
PEXT2_SUPER_BLOCK pExt2Sb = Ext2Sys->ext2_sb;
LARGE_INTEGER SysTime;
-
+
NtQuerySystemTime(&SysTime);
Ext2Sys->blocksize = EXT2_BLOCK_SIZE(pExt2Sb);
@@ -201,14 +201,14 @@
* XXX Not all block groups need the descriptor blocks, but
* being clever is tricky...
*/
- overhead = (int) (3 + Ext2Sys->desc_blocks + Ext2Sys->inode_blocks_per_group);
+ overhead = (3 + Ext2Sys->desc_blocks + Ext2Sys->inode_blocks_per_group);
/*
* See if the last group is big enough to support the
* necessary data structures. If not, we need to get rid of
* it.
*/
- rem = (int) ((pExt2Sb->s_blocks_count - pExt2Sb->s_first_data_block) %
+ rem = ((pExt2Sb->s_blocks_count - pExt2Sb->s_first_data_block) %
pExt2Sb->s_blocks_per_group);
if ((Ext2Sys->group_desc_count == 1) && rem && (rem <
overhead))
@@ -279,14 +279,14 @@
numblocks -= 1 + Ext2Sys->desc_blocks;
}
-
+
numblocks -= 2 + Ext2Sys->inode_blocks_per_group;
-
+
pExt2Sb->s_free_blocks_count += numblocks;
Ext2Sys->group_desc[i].bg_free_blocks_count = (__u16)numblocks;
Ext2Sys->group_desc[i].bg_free_inodes_count =
(__u16)pExt2Sb->s_inodes_per_group;
Ext2Sys->group_desc[i].bg_used_dirs_count = 0;
-
+
group_block += pExt2Sb->s_blocks_per_group;
}
Modified: trunk/reactos/lib/fslib/vfatlib/check/check.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/ch…
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] Sun Feb 15 11:24:52 2015
@@ -838,7 +838,7 @@
int scan_root(DOS_FS *fs)
{
DOS_FILE **chain;
- int i;
+ ULONG i;
root = NULL;
chain = &root;
Modified: trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/do…
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/dosfsck.h [iso-8859-1] Sun Feb 15 11:24:52 2015
@@ -178,8 +178,8 @@
#define FAT_MAX_BAD(fs) (0xff7 | FAT_EXTD(fs))
#define FAT_IS_BAD(fs,v) ((v) >= FAT_MIN_BAD(fs) && (v) <=
FAT_MAX_BAD(fs))
-/* return -16 as a number with fs->fat_bits bits */
-#define FAT_EXTD(fs) (((1 << fs->eff_fat_bits)-1) & ~0xf)
+/* return -16 as an unsigned number with fs->fat_bits bits */
+#define FAT_EXTD(fs) (((1UL << fs->eff_fat_bits)-1) & ~0xf)
#endif