Author: ion
Date: Sat Jul 20 00:10:31 2013
New Revision: 59527
URL:
http://svn.reactos.org/svn/reactos?rev=59527&view=rev
Log:
[MISC]: Cleanup a bunch of unused variables, in cases where it was obvious these variables
were left-overs from debug code, debug prints, or in some cases commented-out
functionality (in which case the variables were commented out instead of removed). If you
own ACLUI, CLASS2, USB, USER32, or EXT2LIB you may want to check that these changes are
accurate (i.e.: such as the last commit where the variable was actually not being used due
to a bug).
Modified:
trunk/reactos/dll/win32/aclui/sidcache.c
trunk/reactos/dll/win32/kernel32/client/except.c
trunk/reactos/drivers/storage/class/class2/class2.c
trunk/reactos/drivers/usb/usbccgp/descriptor.c
trunk/reactos/drivers/usb/usbhub/fdo.c
trunk/reactos/drivers/usb/usbhub/pdo.c
trunk/reactos/drivers/usb/usbstor/error.c
trunk/reactos/drivers/usb/usbstor/queue.c
trunk/reactos/drivers/usb/usbstor/scsi.c
trunk/reactos/lib/drivers/libusb/hub_controller.cpp
trunk/reactos/lib/drivers/libusb/usb_device.cpp
trunk/reactos/lib/fslib/ext2lib/Inode.c
trunk/reactos/lib/fslib/ext2lib/Mke2fs.c
trunk/reactos/win32ss/drivers/videoprt/child.c
trunk/reactos/win32ss/user/user32/controls/static.c
Modified: trunk/reactos/dll/win32/aclui/sidcache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/aclui/sidcache.c…
==============================================================================
--- trunk/reactos/dll/win32/aclui/sidcache.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/aclui/sidcache.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -212,7 +212,7 @@
SID_NAME_USE SidNameUse = SidTypeUnknown;
PPOLICY_ACCOUNT_DOMAIN_INFO PolicyAccountDomainInfo = NULL;
NTSTATUS Status;
- DWORD SidLength, AccountNameSize, DomainNameSize = 0;
+ DWORD AccountNameSize, DomainNameSize = 0;
PSIDREQRESULT ReqRet = NULL;
BOOL Ret = FALSE;
@@ -223,7 +223,6 @@
&Names);
if (NT_SUCCESS(Status))
{
- SidLength = GetLengthSid(pSid);
SidNameUse = Names->Use;
if (ReferencedDomain != NULL &&
Modified: trunk/reactos/dll/win32/kernel32/client/except.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] Sat Jul 20 00:10:31
2013
@@ -396,7 +396,6 @@
SetErrorMode(IN UINT uMode)
{
UINT PrevErrMode, NewMode;
- NTSTATUS Status;
/* Get the previous mode */
PrevErrMode = GetErrorMode();
@@ -418,10 +417,10 @@
NewMode |= (PrevErrMode & SEM_NOALIGNMENTFAULTEXCEPT);
/* Set the new mode */
- Status = NtSetInformationProcess(NtCurrentProcess(),
- ProcessDefaultHardErrorMode,
- (PVOID)&NewMode,
- sizeof(NewMode));
+ NtSetInformationProcess(NtCurrentProcess(),
+ ProcessDefaultHardErrorMode,
+ (PVOID)&NewMode,
+ sizeof(NewMode));
/* Return the previous mode */
return PrevErrMode;
Modified: trunk/reactos/drivers/storage/class/class2/class2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/clas…
==============================================================================
--- trunk/reactos/drivers/storage/class/class2/class2.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/class2/class2.c [iso-8859-1] Sat Jul 20 00:10:31
2013
@@ -471,7 +471,7 @@
UNICODE_STRING unicodeDeviceName;
PFILE_OBJECT fileObject;
CCHAR deviceNameBuffer[256];
- BOOLEAN deviceFound = FALSE;
+ /* BOOLEAN deviceFound = FALSE; See note at the end */
PCLASS_DRIVER_EXTENSION DriverExtension;
PUNICODE_STRING RegistryPath = Argument2;
@@ -578,7 +578,7 @@
if (InitializationData->ClassFindDevices(DriverObject, Argument2,
InitializationData,
portDeviceObject,
DriverExtension->PortNumber)) {
- deviceFound = TRUE;
+ /* deviceFound = TRUE; See note at the end */
}
}
Modified: trunk/reactos/drivers/usb/usbccgp/descriptor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/descri…
==============================================================================
--- trunk/reactos/drivers/usb/usbccgp/descriptor.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbccgp/descriptor.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -311,7 +311,6 @@
{
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
ULONG InterfaceIndex = 0;
- PVOID CurrentPosition;
ULONG DescriptorCount;
//
@@ -337,7 +336,6 @@
return STATUS_INSUFFICIENT_RESOURCES;
}
- CurrentPosition = ConfigurationDescriptor;
do
{
//
@@ -351,7 +349,6 @@
//
FDODeviceExtension->InterfaceList[FDODeviceExtension->InterfaceListCount].InterfaceDescriptor
= InterfaceDescriptor;
FDODeviceExtension->InterfaceListCount++;
- CurrentPosition = (PVOID)((ULONG_PTR)InterfaceDescriptor +
InterfaceDescriptor->bLength);
}
else
{
Modified: trunk/reactos/drivers/usb/usbhub/fdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/fdo.c?r…
==============================================================================
--- trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbhub/fdo.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -436,7 +436,6 @@
QueryStatusChangeEndpoint(
IN PDEVICE_OBJECT DeviceObject)
{
- NTSTATUS Status;
PDEVICE_OBJECT RootHubDeviceObject;
PIO_STACK_LOCATION Stack;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
@@ -520,7 +519,7 @@
//
DPRINT("DeviceObject is %x\n", DeviceObject);
DPRINT("Iocalldriver %x with irp %x\n", RootHubDeviceObject,
HubDeviceExtension->PendingSCEIrp);
- Status = IoCallDriver(RootHubDeviceObject, HubDeviceExtension->PendingSCEIrp);
+ IoCallDriver(RootHubDeviceObject, HubDeviceExtension->PendingSCEIrp);
return STATUS_PENDING;
}
@@ -1509,15 +1508,11 @@
USBD_INTERFACE_LIST_ENTRY InterfaceList[2] = {{NULL, NULL}, {NULL, NULL}};
PURB ConfigUrb = NULL;
ULONG HubStatus;
- PIO_STACK_LOCATION Stack;
NTSTATUS Status = STATUS_SUCCESS;
PHUB_DEVICE_EXTENSION HubDeviceExtension;
PDEVICE_OBJECT RootHubDeviceObject;
- PVOID HubInterfaceBusContext , UsbDInterfaceBusContext;
+ PVOID HubInterfaceBusContext;
PORT_STATUS_CHANGE StatusChange;
-
- // get current stack location
- Stack = IoGetCurrentIrpStackLocation(Irp);
// get hub device extension
HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension;
@@ -1609,8 +1604,6 @@
ExFreePool(Urb);
return Status;
}
-
- UsbDInterfaceBusContext = HubDeviceExtension->UsbDInterface.BusContext;
// Get Root Hub Device Handle
Status = SubmitRequestToRootHub(RootHubDeviceObject,
Modified: trunk/reactos/drivers/usb/usbhub/pdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbhub/pdo.c?r…
==============================================================================
--- trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbhub/pdo.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -54,7 +54,6 @@
OUT PVOID OutParameter1,
OUT PVOID OutParameter2)
{
- NTSTATUS Status;
PIRP ForwardIrp;
IO_STATUS_BLOCK IoStatus;
PIO_STACK_LOCATION ForwardStack, CurrentStack;
@@ -115,7 +114,7 @@
TRUE,
TRUE);
- Status = IoCallDriver(RootHubDeviceObject, ForwardIrp);
+ IoCallDriver(RootHubDeviceObject, ForwardIrp);
//
// Always return pending as the completion routine will take care of it
@@ -194,8 +193,6 @@
{
case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO:
{
- PHUB_DEVICE_EXTENSION DeviceExtension;
-
DPRINT("IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n");
if (Irp->AssociatedIrp.SystemBuffer == NULL
|| Stack->Parameters.DeviceIoControl.OutputBufferLength !=
sizeof(PVOID))
@@ -205,7 +202,6 @@
else
{
PVOID* pHubPointer;
- DeviceExtension =
(PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
pHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer;
// FIXME
@@ -497,10 +493,8 @@
PUNICODE_STRING SourceString = NULL;
PWCHAR ReturnString = NULL;
NTSTATUS Status = STATUS_SUCCESS;
- LCID LocaleId;
DeviceTextType =
IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.DeviceTextType;
- LocaleId =
IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryDeviceText.LocaleId;
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension;
//
Modified: trunk/reactos/drivers/usb/usbstor/error.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/error.…
==============================================================================
--- trunk/reactos/drivers/usb/usbstor/error.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbstor/error.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -245,21 +245,14 @@
ErrorHandlerWorkItemRoutine(
PVOID Context)
{
- NTSTATUS Status;
- PFDO_DEVICE_EXTENSION FDODeviceExtension;
PERRORHANDLER_WORKITEM_DATA WorkItemData = (PERRORHANDLER_WORKITEM_DATA)Context;
- //
- // get fdo
- //
- FDODeviceExtension = WorkItemData->Context->FDODeviceExtension;
-
if (WorkItemData->Context->ErrorIndex == 2)
{
//
// reset device
//
- Status = USBSTOR_HandleTransferError(WorkItemData->DeviceObject,
WorkItemData->Context);
+ USBSTOR_HandleTransferError(WorkItemData->DeviceObject,
WorkItemData->Context);
}
else
{
Modified: trunk/reactos/drivers/usb/usbstor/queue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/queue.…
==============================================================================
--- trunk/reactos/drivers/usb/usbstor/queue.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbstor/queue.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -544,7 +544,6 @@
PFDO_DEVICE_EXTENSION FDODeviceExtension;
PPDO_DEVICE_EXTENSION PDODeviceExtension;
KIRQL OldLevel;
- NTSTATUS Status;
BOOLEAN ResetInProgress;
DPRINT("USBSTOR_StartIo\n");
@@ -660,7 +659,7 @@
//
// execute scsi
//
- Status = USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
+ USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
//
// FIXME: handle error
Modified: trunk/reactos/drivers/usb/usbstor/scsi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/scsi.c…
==============================================================================
--- trunk/reactos/drivers/usb/usbstor/scsi.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbstor/scsi.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -181,9 +181,7 @@
PREAD_CAPACITY_DATA_EX CapacityDataEx;
PREAD_CAPACITY_DATA CapacityData;
PUFI_CAPACITY_RESPONSE Response;
-
NTSTATUS Status;
- PURB Urb;
//
// access context
@@ -274,7 +272,6 @@
ASSERT(Request);
Status = Irp->IoStatus.Status;
- Urb = &Context->Urb;
//
// get SCSI command data block
Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Sat Jul 20 00:10:31
2013
@@ -402,7 +402,6 @@
IN OUT PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
- PCOMMON_DEVICE_EXTENSION DeviceExtension;
PDEVICE_CAPABILITIES DeviceCapabilities;
PPNP_BUS_INFORMATION BusInformation;
PDEVICE_RELATIONS DeviceRelations;
@@ -412,16 +411,6 @@
ULONG HiSpeed, NumPorts;
WCHAR Buffer[300];
LPWSTR DeviceName;
-
- //
- // get device extension
- //
- DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-
- //
- // sanity check
- //
- ASSERT(DeviceExtension->IsFDO == FALSE);
//
// get current stack location
@@ -2189,7 +2178,6 @@
IN OUT PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
- PCOMMON_DEVICE_EXTENSION DeviceExtension;
PURB Urb;
NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
@@ -2197,11 +2185,6 @@
// get current stack location
//
IoStack = IoGetCurrentIrpStackLocation(Irp);
-
- //
- // get device extension
- //
- DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
//
// determine which request should be performed
Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_dev…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -308,7 +308,6 @@
{
PUSB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
NTSTATUS Status;
- UCHAR OldAddress;
UCHAR Index;
DPRINT1("[%s] SetDeviceAddress> Address %x\n", m_USBType,
DeviceAddress);
@@ -340,9 +339,6 @@
// lets have a short nap
KeStallExecutionProcessor(300);
-
- // back up old address
- OldAddress = m_DeviceAddress;
// store new device address
m_DeviceAddress = DeviceAddress;
Modified: trunk/reactos/lib/fslib/ext2lib/Inode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/ext2lib/Inode.c?…
==============================================================================
--- trunk/reactos/lib/fslib/ext2lib/Inode.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/ext2lib/Inode.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -220,7 +220,6 @@
PEXT2_SUPER_BLOCK pExt2Sb = Ext2Sys->ext2_sb;
int i = 0;
bool bRet = true;
- bool bDirty = false;
ULONG TotalBlocks;
TotalBlocks = Inode->i_blocks / (Ext2Sys->blocksize / SECTOR_SIZE);
@@ -245,7 +244,6 @@
if (i == 0)
{
Inode->i_block[Index] = newBlk;
- bDirty = true;
}
else
{
@@ -256,7 +254,6 @@
if (ext2_alloc_block(Ext2Sys, 0, &dwBlk))
{
Inode->i_block[(i + 12 - 1)] = dwBlk;
- bDirty = true;
Inode->i_blocks += (Ext2Sys->blocksize / SECTOR_SIZE);
}
Modified: trunk/reactos/lib/fslib/ext2lib/Mke2fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/ext2lib/Mke2fs.c…
==============================================================================
--- trunk/reactos/lib/fslib/ext2lib/Mke2fs.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/ext2lib/Mke2fs.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -120,7 +120,7 @@
bool zero_blocks(PEXT2_FILESYS fs, ULONG blk, ULONG num,
ULONG *ret_blk, ULONG *ret_count)
{
- ULONG j, count, next_update, next_update_incr;
+ ULONG j, count;
static unsigned char *buf;
bool retval;
@@ -153,11 +153,6 @@
}
/* OK, do the write loop */
- next_update = 0;
- next_update_incr = num / 100;
- if (next_update_incr < 1)
- next_update_incr = 1;
-
for (j=0; j < num; j += STRIDE_LENGTH, blk += STRIDE_LENGTH)
{
if (num-j > STRIDE_LENGTH)
Modified: trunk/reactos/win32ss/drivers/videoprt/child.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/videoprt/c…
==============================================================================
--- trunk/reactos/win32ss/drivers/videoprt/child.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/drivers/videoprt/child.c [iso-8859-1] Sat Jul 20 00:10:31 2013
@@ -67,7 +67,6 @@
{
PWCHAR Buffer = NULL, StaticBuffer;
UNICODE_STRING UnicodeStr;
- ULONG Length;
switch (IrpSp->Parameters.QueryId.IdType)
{
@@ -78,7 +77,6 @@
if (ChildExtension->EdidValid)
{
StaticBuffer = L"DISPLAY\\";
- Length = 8 * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 8) *
sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@@ -92,7 +90,6 @@
else
{
StaticBuffer = L"DISPLAY\\Default_Monitor";
- Length = wcslen(StaticBuffer) * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 1) *
sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@@ -121,7 +118,6 @@
if (ChildExtension->EdidValid)
{
StaticBuffer = L"MONITOR\\";
- Length = 8 * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 9) *
sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
@@ -138,7 +134,6 @@
else
{
StaticBuffer = L"MONITOR\\Default_Monitor";
- Length = wcslen(StaticBuffer) * sizeof(WCHAR);
Buffer = ExAllocatePool(PagedPool, (wcslen(StaticBuffer) + 2) *
sizeof(WCHAR));
if (!Buffer) return STATUS_NO_MEMORY;
Modified: trunk/reactos/win32ss/user/user32/controls/static.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
==============================================================================
--- trunk/reactos/win32ss/user/user32/controls/static.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/controls/static.c [iso-8859-1] Sat Jul 20 00:10:31
2013
@@ -593,7 +593,6 @@
static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
{
DRAWITEMSTRUCT dis;
- HBRUSH hBrush;
HFONT font, oldFont = NULL;
UINT id = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
@@ -609,7 +608,7 @@
font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
if (font) oldFont = SelectObject( hdc, font );
- hBrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
+ /* hBrush = */ STATIC_SendWmCtlColorStatic(hwnd, hdc);
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
if (font) SelectObject( hdc, oldFont );
}