[PATCH 3/4] ntdll: Avoid double initialization.
Alex Henrie
alexhenrie24 at gmail.com
Tue Dec 29 23:37:58 CST 2015
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/ntdll/cdrom.c | 12 ++++++------
dlls/ntdll/debugbuffer.c | 2 +-
dlls/ntdll/directory.c | 2 +-
dlls/ntdll/loader.c | 2 +-
dlls/ntdll/reg.c | 2 +-
dlls/ntdll/thread.c | 6 ++++--
6 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index 4407277..ee2a743 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -748,8 +748,8 @@ static NTSTATUS CDROM_GetDeviceNumber(int dev, STORAGE_DEVICE_NUMBER* devnum)
static NTSTATUS CDROM_GetDriveGeometry(int dev, int fd, DISK_GEOMETRY* dg)
{
CDROM_TOC toc;
- NTSTATUS ret = 0;
- int fsize = 0;
+ NTSTATUS ret;
+ int fsize;
if ((ret = CDROM_ReadTOC(dev, fd, &toc)) != 0) return ret;
@@ -2432,7 +2432,7 @@ static NTSTATUS DVD_ReadKey(int fd, PDVD_COPY_PROTECT_KEY key)
static NTSTATUS DVD_GetRegion(int fd, PDVD_REGION region)
{
#if defined(linux)
- NTSTATUS ret = STATUS_NOT_SUPPORTED;
+ NTSTATUS ret;
dvd_struct dvd;
dvd_authinfo auth_info;
@@ -2460,7 +2460,7 @@ static NTSTATUS DVD_GetRegion(int fd, PDVD_REGION region)
dk_dvd_read_structure_t dvd;
DVDRegionPlaybackControlInfo rpc;
DVDCopyrightInfo copy;
- NTSTATUS ret = STATUS_NOT_SUPPORTED;
+ NTSTATUS ret;
key.format = kDVDKeyFormatRegionState;
key.keyClass = kDVDKeyClassCSS_CPPM_CPRM;
@@ -2636,7 +2636,7 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
break;
}
#elif defined(__APPLE__)
- NTSTATUS ret = STATUS_NOT_SUPPORTED;
+ NTSTATUS ret;
dk_dvd_read_structure_t dvdrs;
union
{
@@ -2771,7 +2771,7 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
static NTSTATUS GetInquiryData(int fd, PSCSI_ADAPTER_BUS_INFO BufferOut, DWORD OutBufferSize)
{
#ifdef HAVE_SG_IO_HDR_T_INTERFACE_ID
- PSCSI_INQUIRY_DATA pInquiryData = NULL;
+ PSCSI_INQUIRY_DATA pInquiryData;
UCHAR sense_buffer[32];
int iochk, version;
sg_io_hdr_t iocmd;
diff --git a/dlls/ntdll/debugbuffer.c b/dlls/ntdll/debugbuffer.c
index 0ad8882..ef8baeb 100644
--- a/dlls/ntdll/debugbuffer.c
+++ b/dlls/ntdll/debugbuffer.c
@@ -91,7 +91,7 @@ static void dump_DEBUG_BUFFER(const DEBUG_BUFFER *iBuf)
PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(IN ULONG iSize, IN BOOLEAN iEventPair)
{
- PDEBUG_BUFFER oBuf = NULL;
+ PDEBUG_BUFFER oBuf;
FIXME("(%d, %d): stub\n", iSize, iEventPair);
if (iSize < sizeof(DEBUG_BUFFER)) {
iSize = sizeof(DEBUG_BUFFER);
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 3362303..a7dd3f7 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -1011,7 +1011,7 @@ static void add_fs_cache( dev_t dev, fsid_t fsid, BOOLEAN case_sensitive )
*/
static int get_dir_case_sensitivity_attr( const char *dir )
{
- char *mntpoint = NULL;
+ char *mntpoint;
struct attrlist attr;
struct vol_caps caps;
struct get_fsid get_fsid;
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 74feb97..5bcc03e 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1865,7 +1865,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
char error[256], dllname[MAX_PATH];
const WCHAR *name, *p;
DWORD len, i;
- void *handle = NULL;
+ void *handle;
struct builtin_load_info info, *prev_info;
/* Fix the name in case we have a full path and extension */
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index be95a2a..b305fc4 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -536,7 +536,7 @@ NTSTATUS WINAPI NtQueryValueKey( HANDLE handle, const UNICODE_STRING *name,
{
NTSTATUS ret;
UCHAR *data_ptr;
- unsigned int fixed_size = 0, min_size = 0;
+ unsigned int fixed_size, min_size;
TRACE( "(%p,%s,%d,%p,%d)\n", handle, debugstr_us(name), info_class, info, length );
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index aaf7a71..5615285 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -463,7 +463,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
pthread_t pthread_id;
pthread_attr_t attr;
struct ntdll_thread_data *thread_data;
- struct startup_info *info = NULL;
+ struct startup_info *info;
HANDLE handle = 0, actctx = 0;
TEB *teb = NULL;
DWORD tid = 0;
@@ -732,7 +732,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
{
NTSTATUS ret;
DWORD dummy, i;
- BOOL self = FALSE;
+ BOOL self;
#ifdef __i386__
/* on i386 debug registers always require a server call */
@@ -746,6 +746,8 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
ntdll_get_thread_data()->dr6 == context->Dr6 &&
ntdll_get_thread_data()->dr7 == context->Dr7);
}
+#else
+ self = FALSE;
#endif
if (!self)
--
2.6.4
More information about the wine-patches
mailing list