Andrew Talbot : setupapi: Sign-compare warnings fix.

Alexandre Julliard julliard at winehq.org
Tue Nov 11 08:35:37 CST 2008


Module: wine
Branch: master
Commit: 1c64c934db07bf9e6431ee43c6e9a53e58c78120
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1c64c934db07bf9e6431ee43c6e9a53e58c78120

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Mon Nov 10 19:37:42 2008 +0000

setupapi: Sign-compare warnings fix.

---

 dlls/setupapi/devinst.c |    5 +++--
 dlls/setupapi/parser.c  |    2 +-
 dlls/setupapi/query.c   |    4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index af4f4d3..f134da1 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -1349,7 +1349,8 @@ BOOL WINAPI SetupDiCreateDeviceInfoA(
 static DWORD SETUPDI_DevNameToDevID(LPCWSTR devName)
 {
     LPCWSTR ptr;
-    DWORD devNameLen = lstrlenW(devName), devInst = 0;
+    int devNameLen = lstrlenW(devName);
+    DWORD devInst = 0;
     BOOL valid = TRUE;
 
     TRACE("%s\n", debugstr_w(devName));
@@ -1704,7 +1705,7 @@ BOOL WINAPI SetupDiGetDeviceInstanceIdW(
         return FALSE;
     }
     TRACE("instance ID: %s\n", debugstr_w(devInfo->instanceId));
-    if (DeviceInstanceIdSize < lstrlenW(devInfo->instanceId) + 1)
+    if (DeviceInstanceIdSize < strlenW(devInfo->instanceId) + 1)
     {
         SetLastError(ERROR_INSUFFICIENT_BUFFER);
         if (RequiredSize)
diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c
index 8c8a518..c2bd84c 100644
--- a/dlls/setupapi/parser.c
+++ b/dlls/setupapi/parser.c
@@ -199,7 +199,7 @@ static struct line *find_line( struct inf_file *file, int section_index, const W
 {
     struct section *section;
     struct line *line;
-    int i;
+    unsigned int i;
 
     if (section_index < 0 || section_index >= file->nb_sections) return NULL;
     section = file->sections[section_index];
diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c
index c5dce78..f44826d 100644
--- a/dlls/setupapi/query.c
+++ b/dlls/setupapi/query.c
@@ -580,7 +580,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
 
     INFCONTEXT ctx;
     WCHAR *dir;
-    INT size;
+    unsigned int size;
 
     TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
           buffer_size, required_size);
@@ -591,7 +591,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
 
     if (!(dir = PARSER_get_dest_dir( context ? context : &ctx ))) return FALSE;
 
-    size = lstrlenW( dir ) + 1;
+    size = strlenW( dir ) + 1;
     if (required_size) *required_size = size;
 
     if (buffer)




More information about the wine-cvs mailing list