fixed some warnings when compiling with -O3
Modified: trunk/reactos/drivers/bus/serenum/detect.c
Modified: trunk/reactos/drivers/dd/sndblst/irq.c
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
Modified: trunk/reactos/drivers/input/i8042prt/mouse.c
Modified: trunk/reactos/lib/advapi32/token/token.c
Modified: trunk/reactos/lib/kernel32/misc/time.c
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/ntoskrnl/mm/elf.inc.h
Modified: trunk/reactos/ntoskrnl/mm/pe.c
Modified: trunk/reactos/ntoskrnl/mm/region.c
Modified: trunk/reactos/subsys/csrss/win32csr/conio.c
Modified: trunk/reactos/subsys/system/regedit/regproc.c
_____
Modified: trunk/reactos/drivers/bus/serenum/detect.c
--- trunk/reactos/drivers/bus/serenum/detect.c 2005-07-31 21:51:04 UTC
(rev 16927)
+++ trunk/reactos/drivers/bus/serenum/detect.c 2005-07-31 23:39:05 UTC
(rev 16928)
@@ -472,7 +472,7 @@
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;
_____
Modified: trunk/reactos/drivers/dd/sndblst/irq.c
--- trunk/reactos/drivers/dd/sndblst/irq.c 2005-07-31 21:51:04 UTC
(rev 16927)
+++ trunk/reactos/drivers/dd/sndblst/irq.c 2005-07-31 23:39:05 UTC
(rev 16928)
@@ -65,7 +65,7 @@
ULONG Vector;
KIRQL IRQ_Level;
KAFFINITY Affinity;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
Vector = HalGetInterruptVector(Isa, // FIX THIS
0, // FIX THIS
_____
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
--- trunk/reactos/drivers/input/i8042prt/i8042prt.c 2005-07-31
21:51:04 UTC (rev 16927)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.c 2005-07-31
23:39:05 UTC (rev 16928)
@@ -511,7 +511,7 @@
static NTSTATUS STDCALL I8042BasicDetect(PDEVICE_EXTENSION DevExt)
{
NTSTATUS Status;
- UCHAR Value;
+ UCHAR Value = 0;
UINT Counter;
I8042Flush();
_____
Modified: trunk/reactos/drivers/input/i8042prt/mouse.c
--- trunk/reactos/drivers/input/i8042prt/mouse.c 2005-07-31
21:51:04 UTC (rev 16927)
+++ trunk/reactos/drivers/input/i8042prt/mouse.c 2005-07-31
23:39:05 UTC (rev 16928)
@@ -111,7 +111,7 @@
UCHAR Status,
PUCHAR Value)
{
- BOOLEAN ToReturn;
+ BOOLEAN ToReturn = FALSE;
if (I8042MouseCallIsrHook(DevExt, Status, Value, &ToReturn))
return ToReturn;
_____
Modified: trunk/reactos/lib/advapi32/token/token.c
--- trunk/reactos/lib/advapi32/token/token.c 2005-07-31 21:51:04 UTC
(rev 16927)
+++ trunk/reactos/lib/advapi32/token/token.c 2005-07-31 23:39:05 UTC
(rev 16928)
@@ -327,8 +327,7 @@
PSID SidToCheck,
PBOOL IsMember)
{
- HANDLE AccessToken;
- BOOL ReleaseToken = FALSE;
+ HANDLE AccessToken = NULL;
BOOL Result = FALSE;
DWORD dwSize;
DWORD i;
@@ -353,7 +352,6 @@
goto ByeBye;
}
CloseHandle(ExistingTokenHandle);
- ReleaseToken = TRUE;
}
else
{
@@ -364,7 +362,6 @@
/* Duplicate token to have a impersonation token */
if (!DuplicateToken(ExistingTokenHandle, SecurityAnonymous,
&AccessToken))
return FALSE;
- ReleaseToken = TRUE;
}
else
AccessToken = ExistingTokenHandle;
@@ -395,7 +392,7 @@
ByeBye:
if (lpGroups != NULL)
HeapFree(GetProcessHeap(), 0, lpGroups);
- if (ReleaseToken)
+ if (AccessToken != NULL && AccessToken != ExistingTokenHandle)
CloseHandle(AccessToken);
return Result;
_____
Modified: trunk/reactos/lib/kernel32/misc/time.c
--- trunk/reactos/lib/kernel32/misc/time.c 2005-07-31 21:51:04 UTC
(rev 16927)
+++ trunk/reactos/lib/kernel32/misc/time.c 2005-07-31 23:39:05 UTC
(rev 16928)
@@ -50,7 +50,7 @@
{
PDOSTIME pdtime=(PDOSTIME) lpFatTime;
PDOSDATE pddate=(PDOSDATE) lpFatDate;
- SYSTEMTIME SystemTime;
+ SYSTEMTIME SystemTime = { 0 };
if ( lpFileTime == NULL )
return FALSE;
_____
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
--- trunk/reactos/ntoskrnl/cm/regfile.c 2005-07-31 21:51:04 UTC (rev
16927)
+++ trunk/reactos/ntoskrnl/cm/regfile.c 2005-07-31 23:39:05 UTC (rev
16928)
@@ -4065,6 +4065,10 @@
}
NewKeyCell->HashTableOffset = NewHashTableOffset;
}
+ else
+ {
+ NewHashTableCell = NULL;
+ }
/* Allocate and copy value list and values */
if (SrcKeyCell->NumberOfValues != 0)
_____
Modified: trunk/reactos/ntoskrnl/mm/elf.inc.h
--- trunk/reactos/ntoskrnl/mm/elf.inc.h 2005-07-31 21:51:04 UTC (rev
16927)
+++ trunk/reactos/ntoskrnl/mm/elf.inc.h 2005-07-31 23:39:05 UTC (rev
16928)
@@ -519,8 +519,8 @@
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);
_____
Modified: trunk/reactos/ntoskrnl/mm/pe.c
--- trunk/reactos/ntoskrnl/mm/pe.c 2005-07-31 21:51:04 UTC (rev
16927)
+++ trunk/reactos/ntoskrnl/mm/pe.c 2005-07-31 23:39:05 UTC (rev
16928)
@@ -188,12 +188,12 @@
)
{
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 @@
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 @@
PVOID pData;
l_ReadHeaderFromFile:
+ cbNtHeaderSize = 0;
lnOffset.QuadPart = pidhDosHeader->e_lfanew;
/* read the header from the file */
@@ -330,7 +331,7 @@
}
else
{
- ULONG cbOptHeaderOffsetSize;
+ ULONG cbOptHeaderOffsetSize = 0;
nStatus = STATUS_INVALID_IMAGE_FORMAT;
_____
Modified: trunk/reactos/ntoskrnl/mm/region.c
--- trunk/reactos/ntoskrnl/mm/region.c 2005-07-31 21:51:04 UTC (rev
16927)
+++ trunk/reactos/ntoskrnl/mm/region.c 2005-07-31 23:39:05 UTC (rev
16928)
@@ -110,7 +110,7 @@
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;
_____
Modified: trunk/reactos/subsys/csrss/win32csr/conio.c
--- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-07-31 21:51:04 UTC
(rev 16927)
+++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-07-31 23:39:05 UTC
(rev 16928)
@@ -224,7 +224,7 @@
CSR_API(CsrAllocConsole)
{
PCSRSS_CONSOLE Console;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
BOOLEAN NewConsole = FALSE;
DPRINT("CsrAllocConsole\n");
_____
Modified: trunk/reactos/subsys/system/regedit/regproc.c
--- trunk/reactos/subsys/system/regedit/regproc.c 2005-07-31
21:51:04 UTC (rev 16927)
+++ trunk/reactos/subsys/system/regedit/regproc.c 2005-07-31
23:39:05 UTC (rev 16928)
@@ -384,7 +384,7 @@
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;