fixed some warnings when compiling with -O3

svn path=/trunk/; revision=16928
This commit is contained in:
Thomas Bluemel 2005-07-31 23:39:05 +00:00
parent 9804ebb026
commit 3a76f91710
12 changed files with 24 additions and 22 deletions

View file

@ -472,7 +472,7 @@ SerenumDetectLegacyDevice(
ULONG Command;
SERIAL_TIMEOUTS Timeouts;
SERIAL_LINE_CONTROL LCR;
ULONG i, Count;
ULONG i, Count = 0;
UCHAR Buffer[16];
UNICODE_STRING DeviceDescription;
UNICODE_STRING DeviceId;

View file

@ -65,7 +65,7 @@ NTSTATUS EnableIRQ(PDEVICE_OBJECT DeviceObject)
ULONG Vector;
KIRQL IRQ_Level;
KAFFINITY Affinity;
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
Vector = HalGetInterruptVector(Isa, // FIX THIS
0, // FIX THIS

View file

@ -511,7 +511,7 @@ NTSTATUS STDCALL I8042CreateDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS STDCALL I8042BasicDetect(PDEVICE_EXTENSION DevExt)
{
NTSTATUS Status;
UCHAR Value;
UCHAR Value = 0;
UINT Counter;
I8042Flush();

View file

@ -111,7 +111,7 @@ BOOLEAN STDCALL I8042MouseResetIsr(PDEVICE_EXTENSION DevExt,
UCHAR Status,
PUCHAR Value)
{
BOOLEAN ToReturn;
BOOLEAN ToReturn = FALSE;
if (I8042MouseCallIsrHook(DevExt, Status, Value, &ToReturn))
return ToReturn;

View file

@ -327,8 +327,7 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
PSID SidToCheck,
PBOOL IsMember)
{
HANDLE AccessToken;
BOOL ReleaseToken = FALSE;
HANDLE AccessToken = NULL;
BOOL Result = FALSE;
DWORD dwSize;
DWORD i;
@ -353,7 +352,6 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
goto ByeBye;
}
CloseHandle(ExistingTokenHandle);
ReleaseToken = TRUE;
}
else
{
@ -364,7 +362,6 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
/* Duplicate token to have a impersonation token */
if (!DuplicateToken(ExistingTokenHandle, SecurityAnonymous, &AccessToken))
return FALSE;
ReleaseToken = TRUE;
}
else
AccessToken = ExistingTokenHandle;
@ -395,7 +392,7 @@ CheckTokenMembership (HANDLE ExistingTokenHandle,
ByeBye:
if (lpGroups != NULL)
HeapFree(GetProcessHeap(), 0, lpGroups);
if (ReleaseToken)
if (AccessToken != NULL && AccessToken != ExistingTokenHandle)
CloseHandle(AccessToken);
return Result;

View file

@ -50,7 +50,7 @@ FileTimeToDosDateTime(
{
PDOSTIME pdtime=(PDOSTIME) lpFatTime;
PDOSDATE pddate=(PDOSDATE) lpFatDate;
SYSTEMTIME SystemTime;
SYSTEMTIME SystemTime = { 0 };
if ( lpFileTime == NULL )
return FALSE;

View file

@ -4065,6 +4065,10 @@ CmiCopyKey (PREGISTRY_HIVE DstHive,
}
NewKeyCell->HashTableOffset = NewHashTableOffset;
}
else
{
NewHashTableCell = NULL;
}
/* Allocate and copy value list and values */
if (SrcKeyCell->NumberOfValues != 0)

View file

@ -519,8 +519,8 @@ Elf64FmtCreateSection
Elf_Off nFileOffset;
Elf_Addr nVirtualAddr;
Elf_Size nAdj;
Elf_Size nVirtualSize;
Elf_Size nFileSize;
Elf_Size nVirtualSize = 0;
Elf_Size nFileSize = 0;
ASSERT(j <= nPHdrCount);

View file

@ -188,12 +188,12 @@ NTSTATUS NTAPI PeFmtCreateSection
)
{
NTSTATUS nStatus;
ULONG cbFileHeaderOffsetSize;
ULONG cbSectionHeadersOffset;
ULONG cbFileHeaderOffsetSize = 0;
ULONG cbSectionHeadersOffset = 0;
ULONG cbSectionHeadersSize;
ULONG cbSectionHeadersOffsetSize;
ULONG cbSectionHeadersOffsetSize = 0;
ULONG cbOptHeaderSize;
ULONG cbHeadersSize;
ULONG cbHeadersSize = 0;
ULONG nSectionAlignment;
ULONG nFileAlignment;
const IMAGE_DOS_HEADER * pidhDosHeader;
@ -203,8 +203,8 @@ NTSTATUS NTAPI PeFmtCreateSection
PMM_SECTION_SEGMENT pssSegments;
LARGE_INTEGER lnOffset;
PVOID pBuffer;
ULONG nPrevVirtualEndOfSegment;
ULONG nFileSizeOfHeaders;
ULONG nPrevVirtualEndOfSegment = 0;
ULONG nFileSizeOfHeaders = 0;
ULONG i;
ASSERT(FileHeader);
@ -277,6 +277,7 @@ NTSTATUS NTAPI PeFmtCreateSection
PVOID pData;
l_ReadHeaderFromFile:
cbNtHeaderSize = 0;
lnOffset.QuadPart = pidhDosHeader->e_lfanew;
/* read the header from the file */
@ -330,7 +331,7 @@ l_ReadHeaderFromFile:
}
else
{
ULONG cbOptHeaderOffsetSize;
ULONG cbOptHeaderOffsetSize = 0;
nStatus = STATUS_INVALID_IMAGE_FORMAT;

View file

@ -110,7 +110,7 @@ MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress,
ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
{
PMM_REGION InitialRegion;
PVOID InitialBaseAddress;
PVOID InitialBaseAddress = NULL;
PMM_REGION NewRegion;
PLIST_ENTRY CurrentEntry;
PMM_REGION CurrentRegion = NULL;

View file

@ -224,7 +224,7 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
CSR_API(CsrAllocConsole)
{
PCSRSS_CONSOLE Console;
NTSTATUS Status;
NTSTATUS Status = STATUS_SUCCESS;
BOOLEAN NewConsole = FALSE;
DPRINT("CsrAllocConsole\n");

View file

@ -384,7 +384,7 @@ void REGPROC_unescape_string(LPSTR str)
HRESULT setValue(LPSTR val_name, LPSTR val_data)
{
HRESULT hRes;
DWORD dwDataType, dwParseType;
DWORD dwDataType, dwParseType = REG_BINARY;
LPBYTE lpbData;
BYTE convert[KEY_MAX_LEN];
BYTE *bBigBuffer = 0;