Enabled -Wall and -Werror and fixed resulting bugs.

svn path=/trunk/; revision=6639
This commit is contained in:
Eric Kohl 2003-11-13 15:26:34 +00:00
parent 97dc195d03
commit b1fc831113
22 changed files with 83 additions and 65 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: create.c,v 1.10 2003/11/10 11:32:08 ekohl Exp $
/* $Id: create.c,v 1.11 2003/11/13 15:25:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -52,7 +52,7 @@ CdfsMakeAbsoluteFilename(PFILE_OBJECT pFileObject,
/* verify related object is a directory and target name
don't start with \. */
if (Fcb->Entry.FileFlags & 0x02 == 0 ||
if ((Fcb->Entry.FileFlags & 0x02) == 0 ||
pRelativeFileName[0] == L'\\')
{
return(STATUS_INVALID_PARAMETER);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dirctl.c,v 1.13 2003/08/07 11:47:32 silverblade Exp $
/* $Id: dirctl.c,v 1.14 2003/11/13 15:25:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -170,7 +170,6 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
ULONG len;
ULONG DirIndex;
ULONG Offset = 0;
ULONG Read;
BOOLEAN IsRoot;
PVOID Context = NULL;
ULONG DirSize;
@ -349,11 +348,9 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
return(STATUS_SUCCESS);
}
Offset += Record->RecordLength;
Record = (PVOID)Record + Record->RecordLength;
DirIndex++;
}
CcUnpinData(Context);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fcb.c,v 1.15 2003/08/07 11:47:32 silverblade Exp $
/* $Id: fcb.c,v 1.16 2003/11/13 15:25:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -448,7 +448,6 @@ CdfsDirFindFile(PDEVICE_EXTENSION DeviceExt,
WCHAR TempName[2];
WCHAR Name[256];
PVOID Block;
ULONG FirstSector;
ULONG DirSize;
PDIR_RECORD Record;
ULONG Offset;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: fsctl.c,v 1.16 2003/11/10 11:32:08 ekohl Exp $
/* $Id: fsctl.c,v 1.17 2003/11/13 15:25:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -446,6 +446,9 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
NTSTATUS Status;
CDINFO CdInfo;
PLIST_ENTRY Entry;
PFCB Fcb;
DPRINT1 ("CdfsVerifyVolume() called\n");
#if 0
@ -491,6 +494,14 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
DPRINT1 ("Different volume!\n");
/* FIXME: force volume dismount */
Entry = DeviceExt->FcbListHead.Flink;
while (Entry != &DeviceExt->FcbListHead)
{
Fcb = (PFCB)CONTAINING_RECORD(Entry, FCB, FcbListEntry);
DPRINT1("OpenFile %S RefCount %ld\n", Fcb->PathName, Fcb->RefCount);
Entry = Entry->Flink;
}
Status = STATUS_WRONG_VOLUME;
}

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.6 2003/11/10 11:32:08 ekohl Exp $
# $Id: makefile,v 1.7 2003/11/13 15:25:08 ekohl Exp $
PATH_TO_TOP = ../../..
@ -11,6 +11,8 @@ TARGET_NAME = cdfs
TARGET_OBJECTS = $(TARGET_NAME).o close.o common.o create.o dirctl.o \
fcb.o finfo.o fsctl.o misc.o rw.o volinfo.o cleanup.o
TARGET_CFLAGS = -Werror -Wall
DEP_OBJECTS = $(TARGET_OBJECTS)
include $(PATH_TO_TOP)/rules.mak

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: rw.c,v 1.11 2003/11/09 11:20:28 ekohl Exp $
/* $Id: rw.c,v 1.12 2003/11/13 15:25:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -58,8 +58,6 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
*/
{
NTSTATUS Status = STATUS_SUCCESS;
PUCHAR TempBuffer;
ULONG TempLength;
PCCB Ccb;
PFCB Fcb;
@ -85,6 +83,7 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
if (ReadOffset + Length > Fcb->Entry.DataLengthL)
Length = Fcb->Entry.DataLengthL - ReadOffset;
if (FileObject->PrivateCacheMap == NULL)
{
CcRosInitializeFileCache(FileObject, PAGE_SIZE);
@ -106,6 +105,7 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
{
return STATUS_INVALID_PARAMETER;
}
if (ReadOffset + Length > ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE))
Length = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE) - ReadOffset;
@ -120,11 +120,12 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
if (Length + ReadOffset > Fcb->Entry.DataLengthL)
{
memset(Buffer + Fcb->Entry.DataLengthL - ReadOffset,
0, Length + ReadOffset - Fcb->Entry.DataLengthL);
0,
Length + ReadOffset - Fcb->Entry.DataLengthL);
}
}
return(Status);
return Status;
}
@ -158,8 +159,6 @@ CdfsRead(PDEVICE_OBJECT DeviceObject,
ReadOffset.u.LowPart,
Irp->Flags,
&ReturnedReadLength);
ByeBye:
if (NT_SUCCESS(Status))
{
if (FileObject->Flags & FO_SYNCHRONOUS_IO)

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: blockdev.c,v 1.3 2003/11/10 17:09:29 ekohl Exp $
/* $Id: blockdev.c,v 1.4 2003/11/13 15:25:28 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -44,7 +44,6 @@ FsRecReadSectors(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN OUT PUCHAR Buffer)
{
PIO_STACK_LOCATION Stack;
IO_STATUS_BLOCK IoStatus;
LARGE_INTEGER Offset;
ULONG BlockSize;

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.3 2003/01/16 11:58:15 ekohl Exp $
# $Id: makefile,v 1.4 2003/11/13 15:25:28 ekohl Exp $
PATH_TO_TOP = ../../..
@ -18,7 +18,7 @@ DEP_OBJECTS = $(TARGET_OBJECTS)
TARGET_CLEAN = $(DEP_FILES) *.o *.sys *.sym
TARGET_CFLAGS = -g
TARGET_CFLAGS = -Werror -Wall
include $(PATH_TO_TOP)/rules.mak

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: udfs.c,v 1.2 2003/11/10 17:09:29 ekohl Exp $
/* $Id: udfs.c,v 1.3 2003/11/13 15:25:28 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -98,7 +98,7 @@ FsRecCheckVolumeRecognitionSequence(IN PDEVICE_OBJECT DeviceObject,
break;
}
DPRINT1("Descriptor identifier: [%.5s]\n", Buffer + 1);
DPRINT ("Descriptor identifier: [%.5s]\n", Buffer + 1);
switch (State)
{

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.7 2001/08/21 20:13:12 chorns Exp $
# $Id: Makefile,v 1.8 2003/11/13 15:25:43 ekohl Exp $
PATH_TO_TOP = ../../..
@ -13,6 +13,8 @@ TARGET_OBJECTS = \
msfs.o \
rw.o
TARGET_CFLAGS = -Werror -Wall
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.1 2002/06/25 22:21:41 ekohl Exp $
# $Id: makefile,v 1.2 2003/11/13 15:25:55 ekohl Exp $
PATH_TO_TOP = ../../..
@ -8,6 +8,8 @@ TARGET_NAME = mup
TARGET_OBJECTS = $(TARGET_NAME).o create.o
TARGET_CFLAGS = -Werror -Wall
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.13 2003/06/21 19:55:55 hbirr Exp $
# $Id: Makefile,v 1.14 2003/11/13 15:26:07 ekohl Exp $
PATH_TO_TOP = ../../..
@ -14,6 +14,8 @@ TARGET_OBJECTS = \
rw.o \
volume.o
TARGET_CFLAGS = -Werror -Wall
DEP_OBJECTS = $(TARGET_OBJECTS)
include $(PATH_TO_TOP)/rules.mak

View file

@ -1,4 +1,4 @@
/* $Id: fsctrl.c,v 1.12 2003/09/20 20:31:57 weiden Exp $
/* $Id: fsctrl.c,v 1.13 2003/11/13 15:26:07 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -116,8 +116,6 @@ NpfsConnectPipe(PNPFS_FCB Fcb)
static NTSTATUS
NpfsDisconnectPipe(PNPFS_FCB Fcb)
{
PNPFS_FCB ServerFcb;
DPRINT("NpfsDisconnectPipe()\n");
if (Fcb->PipeState == FILE_PIPE_DISCONNECTED_STATE)

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: attrib.c,v 1.7 2003/11/12 15:30:21 ekohl Exp $
/* $Id: attrib.c,v 1.8 2003/11/13 15:26:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -170,7 +170,6 @@ static VOID
NtfsDumpAttribute (PATTRIBUTE Attribute)
{
PNONRESIDENT_ATTRIBUTE NresAttr;
PRESIDENT_ATTRIBUTE ResAttr;
UNICODE_STRING Name;
ULONGLONG lcn;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: create.c,v 1.2 2003/02/13 22:24:16 hbirr Exp $
/* $Id: create.c,v 1.3 2003/11/13 15:26:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -161,8 +161,8 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
PIO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;
ULONG RequestedDisposition;
ULONG RequestedOptions;
PFCB Fcb;
// ULONG RequestedOptions;
// PFCB Fcb;
// PWSTR FileName;
NTSTATUS Status;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dirctl.c,v 1.6 2003/08/07 11:47:32 silverblade Exp $
/* $Id: dirctl.c,v 1.7 2003/11/13 15:26:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -492,7 +492,7 @@ NtfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
PFILE_NAMES_INFORMATION Buffer0 = NULL;
PFCB Fcb;
PCCB Ccb;
FCB TempFcb;
// FCB TempFcb;
BOOLEAN First = FALSE;
PEXTENDED_IO_STACK_LOCATION Stack;
PFILE_OBJECT FileObject;

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.5 2003/09/20 20:31:57 weiden Exp $
# $Id: makefile,v 1.6 2003/11/13 15:26:34 ekohl Exp $
PATH_TO_TOP = ../../..
@ -8,7 +8,7 @@ TARGET_TYPE = driver
TARGET_NAME = ntfs
TARGET_CFLAGS = -Wno-multichar
TARGET_CFLAGS = -Werror -Wall
TARGET_OBJECTS = $(TARGET_NAME).o attrib.o blockdev.o create.o dirctl.o \
fcb.o finfo.o fsctl.o mft.o volinfo.o close.o rw.o

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mft.c,v 1.3 2003/11/12 15:30:21 ekohl Exp $
/* $Id: mft.c,v 1.4 2003/11/13 15:26:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -266,16 +266,16 @@ ReadVCN (PDEVICE_EXTENSION Vcb,
{
PNONRESIDENT_ATTRIBUTE NresAttr;
PATTRIBUTE attr;
attr = FindAttribute(file, type, 0);
NresAttr = (PNONRESIDENT_ATTRIBUTE) attr;
if (NresAttr == 0 || (vcn < NresAttr->StartVcn ||vcn > NresAttr->LastVcn))
{
PATTRIBUTE attrList = FindAttribute(file,AttributeAttributeList,0);
// PATTRIBUTE attrList = FindAttribute(file,AttributeAttributeList,0);
DbgPrint("Exeption \n");
//KeDebugCheck(0);
// KeDebugCheck(0);
}
ReadExternalAttribute(Vcb, NresAttr, vcn, count, buffer);

View file

@ -297,6 +297,13 @@ extern PNTFS_GLOBAL_DATA NtfsGlobalData;
//LONGLONG RunLCN(PUCHAR run);
//ULONG RunLength(PUCHAR run);
BOOLEAN
FindRun (PNONRESIDENT_ATTRIBUTE NresAttr,
ULONGLONG vcn,
PULONGLONG lcn,
PULONGLONG count);
VOID
NtfsDumpFileAttributes (PFILE_RECORD_HEADER FileRecord);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: rw.c,v 1.1 2003/07/17 13:31:39 chorns Exp $
/* $Id: rw.c,v 1.2 2003/11/13 15:26:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -163,7 +163,6 @@ NtfsRead(PDEVICE_OBJECT DeviceObject,
Irp->Flags,
&ReturnedReadLength);
ByeBye:
if (NT_SUCCESS(Status))
{
if (FileObject->Flags & FO_SYNCHRONOUS_IO)

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1 2003/08/27 21:28:08 dwelch Exp $
# $Id: Makefile,v 1.2 2003/11/13 15:24:14 ekohl Exp $
PATH_TO_TOP = ../../..
@ -12,6 +12,8 @@ TARGET_DDKLIBS =
TARGET_OBJECTS = $(TARGET_NAME).o diskdump_helper.o
TARGET_CFLAGS = -Werror -Wall
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: diskdump.c,v 1.2 2003/10/18 18:49:08 weiden Exp $
/* $Id: diskdump.c,v 1.3 2003/11/13 15:24:14 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -64,10 +64,10 @@ typedef VOID (*SCSIPORTNOTIFICATION)(IN SCSI_NOTIFICATION_TYPE NotificationType,
MM_CORE_DUMP_FUNCTIONS DiskDumpFunctions =
{
DiskDumpPrepare,
DiskDumpInit,
DiskDumpWrite,
DiskDumpFinish,
(PVOID)DiskDumpPrepare,
(PVOID)DiskDumpInit,
(PVOID)DiskDumpWrite,
(PVOID)DiskDumpFinish,
};
typedef struct