Sync(20): ntdll/tests/rtlstr.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

License: X11

ChangeLog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>

  +dlls/ntdll/tests/rtlstr.c
    fix msvc compile and -W warnings


=====
"Don't wait for the seas to part, or messiahs to come;
 Don't you sit around and waste this chance..." - Live

jon_p_griffiths@yahoo.com

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- wine/dlls/ntdll/tests/rtlstr.c	Sat May 31 12:37:36 2003
+++ wine-develop/dlls/ntdll/tests/rtlstr.c	Mon Jul 14 14:14:22 2003
@@ -24,11 +24,26 @@
 
 #include <stdlib.h>
 
-#include "winbase.h"
 #include "wine/test.h"
+#include "winbase.h"
 #include "winnt.h"
 #include "winnls.h"
-#include "winternl.h"
+
+/* Define the undocumented types we need here as there is no native header */
+typedef struct _STRING {
+  USHORT Length;
+  USHORT MaximumLength;
+  PCHAR Buffer;
+} STRING, *PSTRING;
+typedef const STRING *PCANSI_STRING;
+
+typedef struct _UNICODE_STRING {
+  USHORT Length;        /* bytes */
+  USHORT MaximumLength; /* bytes */
+  PWSTR  Buffer;
+} UNICODE_STRING, *PUNICODE_STRING;
+
+typedef LONG NTSTATUS;
 
 /* Function ptrs for ntdll calls */
 static HMODULE hntdll = 0;
@@ -383,7 +398,7 @@
 
 static void test_RtlDuplicateUnicodeString(void)
 {
-    int pos;
+    size_t pos;
     WCHAR source_buf[257];
     WCHAR dest_buf[257];
     WCHAR res_buf[257];
@@ -393,7 +408,7 @@
     CHAR dest_ansi_buf[257];
     STRING dest_ansi_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_DUPL_USTR; test_num++) {
 	source_str.Length        = dupl_ustr[test_num].source_Length;
@@ -744,13 +759,13 @@
 
 static void test_RtlUnicodeStringToAnsiString(void)
 {
-    int pos;
+    size_t pos;
     CHAR ansi_buf[257];
     WCHAR uni_buf[257];
     STRING ansi_str;
     UNICODE_STRING uni_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_USTR2ASTR; test_num++) {
 	ansi_str.Length        = ustr2astr[test_num].ansi_Length;
@@ -821,7 +836,7 @@
     CHAR dest_buf[257];
     STRING dest_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_APP_ASC2STR; test_num++) {
 	dest_str.Length        = app_asc2str[test_num].dest_Length;
@@ -893,7 +908,7 @@
     STRING dest_str;
     STRING src_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_APP_STR2STR; test_num++) {
 	dest_str.Length        = app_str2str[test_num].dest_Length;
@@ -954,7 +969,7 @@
     { 4, 12, 14,     "Fake0123abcdef",    "Ustr\0",  8, 12, 14,  "FakeUstr\0\0cdef", STATUS_SUCCESS},
     { 4, 11, 14,     "Fake0123abcdef",    "Ustr\0",  8, 11, 14,  "FakeUstr\0\0cdef", STATUS_SUCCESS},
     { 4, 10, 14,     "Fake0123abcdef",    "Ustr\0",  8, 10, 14,  "FakeUstr\0\0cdef", STATUS_SUCCESS},
-/* In the following test the native function writes beyond MaximumLength 
+/* In the following test the native function writes beyond MaximumLength
  *  { 4,  9, 14,     "Fake0123abcdef",    "Ustr\0",  8,  9, 14,    "FakeUstrabcdef", STATUS_SUCCESS},
  */
     { 4,  8, 14,     "Fake0123abcdef",    "Ustr\0",  8,  8, 14,    "FakeUstrabcdef", STATUS_SUCCESS},
@@ -974,7 +989,7 @@
     WCHAR dest_buf[257];
     UNICODE_STRING dest_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_APP_UNI2STR; test_num++) {
 	dest_str.Length        = app_uni2str[test_num].dest_Length;
@@ -1050,7 +1065,7 @@
     UNICODE_STRING dest_str;
     UNICODE_STRING src_str;
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_APP_USTR2STR; test_num++) {
 	dest_str.Length        = app_ustr2str[test_num].dest_Length;
@@ -1161,8 +1176,8 @@
     UNICODE_STRING search_chars;
     USHORT pos;
     NTSTATUS result;
-    int idx;
-    int test_num;
+    size_t idx;
+    size_t test_num;
 
     for (test_num = 0; test_num < NB_FIND_CH_IN_USTR; test_num++) {
 	if (find_ch_in_ustr[test_num].main_str != NULL) {
@@ -1331,7 +1346,7 @@
 
 static void test_RtlUnicodeStringToInteger(void)
 {
-    int test_num;
+    size_t test_num;
     int value;
     NTSTATUS result;
     WCHAR *wstr;
@@ -1395,7 +1410,7 @@
 
 static void test_RtlCharToInteger(void)
 {
-    int test_num;
+    size_t test_num;
     int value;
     NTSTATUS result;
 
@@ -1612,11 +1627,10 @@
 
 static void test_RtlIntegerToUnicodeString(void)
 {
-    int test_num;
+    size_t test_num;
 
-    for (test_num = 0; test_num < NB_INT2STR; test_num++) {
-	one_RtlIntegerToUnicodeString_test(test_num, &int2str[test_num]);
-    } /* for */
+    for (test_num = 0; test_num < NB_INT2STR; test_num++)
+        one_RtlIntegerToUnicodeString_test(test_num, &int2str[test_num]);
 }
 
 
@@ -1640,11 +1654,10 @@
 static void test_RtlIntegerToChar(void)
 {
     NTSTATUS result;
-    int test_num;
+    size_t test_num;
 
-    for (test_num = 0; test_num < NB_INT2STR; test_num++) {
-	one_RtlIntegerToChar_test(test_num, &int2str[test_num]);
-    } /* for */
+    for (test_num = 0; test_num < NB_INT2STR; test_num++)
+      one_RtlIntegerToChar_test(test_num, &int2str[test_num]);
 
     result = pRtlIntegerToChar(int2str[0].value, 20, int2str[0].MaximumLength, NULL);
     ok(result == STATUS_INVALID_PARAMETER,

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux