Enabled -Wall and -Werror and fixed resulting bugs.

svn path=/trunk/; revision=6618
This commit is contained in:
Eric Kohl 2003-11-11 17:01:47 +00:00
parent bc1542edef
commit 95d64bbf2f
6 changed files with 18 additions and 17 deletions

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.10 2002/06/07 22:58:10 ekohl Exp $
# $Id: makefile,v 1.11 2003/11/11 17:00:41 ekohl Exp $
PATH_TO_TOP = ../../..
@ -14,6 +14,8 @@ TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
TARGET_CFLAGS = -Wall -Werror
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -1,4 +1,4 @@
/* $Id: objdir.c,v 1.12 2003/09/03 20:16:06 ekohl Exp $
/* $Id: objdir.c,v 1.13 2003/11/11 17:00:41 ekohl Exp $
*
* DESCRIPTION: Object Manager Simple Explorer
* PROGRAMMER: David Welch
@ -284,7 +284,7 @@ ListDirectory (
++ EntryCount;
++ pDirectoryEntry;
}
printf ("\n\t%d object(s)\n", EntryCount);
printf ("\n\t%lu object(s)\n", EntryCount);
/*
* Free any resource.
*/

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.3 2002/07/22 17:53:12 ekohl Exp $
# $Id: makefile,v 1.4 2003/11/11 17:01:22 ekohl Exp $
PATH_TO_TOP = ../../..
@ -10,7 +10,7 @@ TARGET_APPTYPE = console
TARGET_NAME = partinfo
#TARGET_CFLAGS = -fnative_struct
#TARGET_CFLAGS = -Wall -Werror
TARGET_SDKLIBS = ntdll.a kernel32.a

View file

@ -4,6 +4,7 @@
#include <windows.h>
//#include <winioctl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@ -83,7 +84,7 @@ int main (int argc, char *argv[])
ulDrive = strtoul(argv[1], NULL, 10);
if (errno != 0)
{
printf("Error: Malformed drive number\n", errno);
printf("Error: Malformed drive number\n");
return(0);
}
@ -139,7 +140,7 @@ int main (int argc, char *argv[])
NULL))
{
CloseHandle(hDisk);
printf("DeviceIoControl failed! Error: %u\n",
printf("DeviceIoControl failed! Error: %lu\n",
GetLastError());
free(Buffer);
return 0;
@ -149,7 +150,7 @@ int main (int argc, char *argv[])
HexDump((char*)&DiskGeometry, dwRead);
#endif
printf("Drive number: %lu\n", ulDrive);
printf("Cylinders: %I64u\nMediaType: %lx\nTracksPerCylinder: %lu\n"
printf("Cylinders: %I64u\nMediaType: %x\nTracksPerCylinder: %lu\n"
"SectorsPerTrack: %lu\nBytesPerSector: %lu\n\n",
DiskGeometry.Cylinders.QuadPart,
DiskGeometry.MediaType,
@ -177,7 +178,7 @@ int main (int argc, char *argv[])
NULL))
{
CloseHandle(hDisk);
printf("DeviceIoControl(IOCTL_DISK_GET_DRIVE_LAYOUT) failed! Error: %u\n",
printf("DeviceIoControl(IOCTL_DISK_GET_DRIVE_LAYOUT) failed! Error: %lu\n",
GetLastError());
free(Buffer);
return 0;
@ -191,13 +192,13 @@ int main (int argc, char *argv[])
LayoutBuffer = (DRIVE_LAYOUT_INFORMATION*)Buffer;
printf("Partitions %u Signature %x\n",
printf("Partitions %lu Signature %lx\n",
LayoutBuffer->PartitionCount,
LayoutBuffer->Signature);
for (i = 0; i < LayoutBuffer->PartitionCount; i++)
{
printf(" %d: nr: %d boot: %1x type: %x start: 0x%I64x count: 0x%I64x\n",
printf(" %ld: nr: %ld boot: %1x type: %x start: 0x%I64x count: 0x%I64x\n",
i,
LayoutBuffer->PartitionEntry[i].PartitionNumber,
LayoutBuffer->PartitionEntry[i].BootIndicator,

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.1 2003/05/08 18:54:59 ekohl Exp $
# $Id: makefile,v 1.2 2003/11/11 17:01:47 ekohl Exp $
PATH_TO_TOP = ../../..
@ -10,7 +10,7 @@ TARGET_APPTYPE = console
TARGET_NAME = pnpdump
#TARGET_CFLAGS = -fnative_struct
TARGET_CFLAGS = -Wall -Werror
TARGET_SDKLIBS = ntdll.a kernel32.a

View file

@ -3,8 +3,10 @@
*/
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
typedef struct _CM_PNP_BIOS_DEVICE_NODE
@ -420,7 +422,6 @@ PnpDecodeFixedIoPort(unsigned char *Ptr)
static VOID
PnpDecodeMemory16(unsigned char *Ptr)
{
USHORT DescLength;
UCHAR Info;
USHORT MinBase;
USHORT MaxBase;
@ -458,7 +459,6 @@ PnpDecodeMemory16(unsigned char *Ptr)
static VOID
PnpDecodeMemory32(unsigned char *Ptr)
{
USHORT DescLength;
UCHAR Info;
ULONG MinBase;
ULONG MaxBase;
@ -512,7 +512,6 @@ PnpDecodeMemory32(unsigned char *Ptr)
static VOID
PnpDecodeFixedMemory(unsigned char *Ptr)
{
USHORT DescLength;
UCHAR Info;
ULONG Base;
ULONG Length;
@ -669,7 +668,6 @@ int main (int argc, char *argv[])
HKEY hPnpKey;
DWORD dwType;
DWORD dwSize;
DWORD i;
PCM_FULL_RESOURCE_DESCRIPTOR lpBuffer;
PCM_PNP_BIOS_INSTALLATION_CHECK lpPnpInst;
PCM_PNP_BIOS_DEVICE_NODE lpDevNode;