Module: wine Branch: master Commit: 48f3bacb0b3feda2947b031f70af694628b6041e URL: http://source.winehq.org/git/wine.git/?a=commit;h=48f3bacb0b3feda2947b031f70...
Author: Alex Henrie alexhenrie24@gmail.com Date: Tue Dec 29 22:37:58 2015 -0700
ntdll: Avoid double initialization.
Signed-off-by: Alex Henrie alexhenrie24@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 f3c6aa2..04c8e26 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -993,7 +993,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 9223cb4..81885eb 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -532,7 +532,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 1455eb1..0b68185 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)