NTDLL: fix warnings in tests, remove pointless comments

Mike McCormack mike at codeweavers.com
Mon Jun 13 03:23:41 CDT 2005


ChangeLog:
* fix warnings in tests, remove pointless comments
-------------- next part --------------
Index: dlls/ntdll/tests/rtl.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/rtl.c,v
retrieving revision 1.13
diff -u -p -r1.13 rtl.c
--- dlls/ntdll/tests/rtl.c	20 Dec 2004 19:27:07 -0000	1.13
+++ dlls/ntdll/tests/rtl.c	13 Jun 2005 08:25:09 -0000
@@ -527,7 +527,7 @@ static void test_RtlUniform(void)
 }
 
 
-ULONG WINAPI my_RtlRandom(PULONG seed)
+static ULONG WINAPI my_RtlRandom(PULONG seed)
 {
     static ULONG saved_value[128] =
     { /*   0 */ 0x4c8bc0aa, 0x4c022957, 0x2232827a, 0x2f1e7626, 0x7f8bdafb, 0x5c37d02a, 0x0ab48f72, 0x2f0c4ffa,
Index: dlls/ntdll/tests/rtlstr.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/rtlstr.c,v
retrieving revision 1.19
diff -u -p -r1.19 rtlstr.c
--- dlls/ntdll/tests/rtlstr.c	19 Apr 2005 09:49:38 -0000	1.19
+++ dlls/ntdll/tests/rtlstr.c	13 Jun 2005 08:25:10 -0000
@@ -130,7 +130,7 @@ static void InitFunctionPtrs(void)
 	pRtlValidateUnicodeString = (void *)GetProcAddress(hntdll, "RtlValidateUnicodeString");
 	pRtlGUIDFromString = (void *)GetProcAddress(hntdll, "RtlGUIDFromString");
 	pRtlStringFromGUID = (void *)GetProcAddress(hntdll, "RtlStringFromGUID");
-    } /* if */
+    }
 }
 
 
@@ -405,37 +405,37 @@ static void test_RtlDuplicateUnicodeStri
 	if (dupl_ustr[test_num].source_buf != NULL) {
 	    for (pos = 0; pos < dupl_ustr[test_num].source_buf_size/sizeof(WCHAR); pos++) {
 		source_buf[pos] = dupl_ustr[test_num].source_buf[pos];
-	    } /* for */
+	    }
 	    source_str.Buffer = source_buf;
 	} else {
 	    source_str.Buffer = NULL;
-	} /* if */
+	}
 	dest_str.Length        = dupl_ustr[test_num].dest_Length;
 	dest_str.MaximumLength = dupl_ustr[test_num].dest_MaximumLength;
 	if (dupl_ustr[test_num].dest_buf != NULL) {
 	    for (pos = 0; pos < dupl_ustr[test_num].dest_buf_size/sizeof(WCHAR); pos++) {
 		dest_buf[pos] = dupl_ustr[test_num].dest_buf[pos];
-	    } /* for */
+	    }
 	    dest_str.Buffer = dest_buf;
 	} else {
 	    dest_str.Buffer = NULL;
-	} /* if */
+	}
 	res_str.Length        = dupl_ustr[test_num].res_Length;
 	res_str.MaximumLength = dupl_ustr[test_num].res_MaximumLength;
 	if (dupl_ustr[test_num].res_buf != NULL) {
 	    for (pos = 0; pos < dupl_ustr[test_num].res_buf_size/sizeof(WCHAR); pos++) {
 		res_buf[pos] = dupl_ustr[test_num].res_buf[pos];
-	    } /* for */
+	    }
 	    res_str.Buffer = res_buf;
 	} else {
 	    res_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlDuplicateUnicodeString(dupl_ustr[test_num].add_nul, &source_str, &dest_str);
         dest_ansi_str.Length = dest_str.Length / sizeof(WCHAR);
         dest_ansi_str.MaximumLength = dest_ansi_str.Length + 1;
         for (pos = 0; pos < dest_ansi_str.Length; pos++) {
        	    dest_ansi_buf[pos] = (char)dest_buf[pos];
-        } /* for */
+        }
         dest_ansi_buf[dest_ansi_str.Length] = '\0';
         dest_ansi_str.Buffer = dest_ansi_buf;
 	ok(result == dupl_ustr[test_num].result,
@@ -456,7 +456,7 @@ static void test_RtlDuplicateUnicodeStri
 	    ok(dest_str.Buffer != dest_buf,
 	       "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination buffer unchanged %p\n",
 	       test_num, dupl_ustr[test_num].add_nul, dest_str.Buffer);
-        } /* if */
+        }
         if (dest_str.Buffer != NULL && dupl_ustr[test_num].res_buf != NULL) {
 	    ok(memcmp(dest_str.Buffer, res_str.Buffer, dupl_ustr[test_num].res_buf_size) == 0,
 	       "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination \"%s\" expected \"%s\"\n",
@@ -465,8 +465,8 @@ static void test_RtlDuplicateUnicodeStri
 	    ok(dest_str.Buffer == NULL && dupl_ustr[test_num].res_buf == NULL,
 	       "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination %p expected %p\n",
 	       test_num, dupl_ustr[test_num].add_nul, dest_str.Buffer, dupl_ustr[test_num].res_buf);
-        } /* if */
-    } /* for */
+        }
+    }
 }
 
 
@@ -498,11 +498,11 @@ static void test_RtlUpperChar(void)
 	    expected_upper_ch = (CHAR) (byte_ch - 'a' + 'A');
 	} else {
 	    expected_upper_ch = (CHAR) byte_ch;
-	} /* if */
+	}
 	ok(upper_ch == expected_upper_ch,
 	   "RtlUpperChar('%c'[=0x%x]) has result '%c'[=0x%x], expected '%c'[=0x%x]\n",
 	   ch, ch, upper_ch, upper_ch, expected_upper_ch, expected_upper_ch);
-    } /* for */
+    }
 }
 
 
@@ -528,7 +528,7 @@ static void test_RtlUpperString(void)
 	ascii_buf[i] = ch;
 	result_buf[i] = '\0';
 	upper_buf[i] = upper_ch;
-    } /* for */
+    }
     ascii_buf[i] = '\0';
     result_buf[i] = '\0';
     upper_buf[i] = '\0';
@@ -566,11 +566,11 @@ static void test_RtlUpcaseUnicodeChar(vo
 	    expected_upper_ch = 0x178;
 	} else {
 	    expected_upper_ch = ch;
-	} /* if */
+	}
 	ok(upper_ch == expected_upper_ch,
 	   "RtlUpcaseUnicodeChar('%c'[=0x%x]) has result '%c'[=0x%x], expected: '%c'[=0x%x]\n",
 	   ch, ch, upper_ch, upper_ch, expected_upper_ch, expected_upper_ch);
-    } /* for */
+    }
 }
 
 
@@ -596,11 +596,11 @@ static void test_RtlUpcaseUnicodeString(
 	    upper_ch = 0x178;
 	} else {
 	    upper_ch = ch;
-	} /* if */
+	}
 	ascii_buf[i] = ch;
 	result_buf[i] = '\0';
 	upper_buf[i] = upper_ch;
-    } /* for */
+    }
     ascii_buf[i] = '\0';
     result_buf[i] = '\0';
     upper_buf[i] = '\0';
@@ -621,7 +621,7 @@ static void test_RtlUpcaseUnicodeString(
 	   ascii_str.Buffer[i], ascii_str.Buffer[i],
 	   result_str.Buffer[i], result_str.Buffer[i],
 	   upper_str.Buffer[i], upper_str.Buffer[i]);
-    } /* for */
+    }
 }
 
 
@@ -681,11 +681,11 @@ static void test_RtlDowncaseUnicodeStrin
 		case 0x400: lower_ch = 0x0; break;
 		default: lower_ch = ch; break;
 	    } /* switch */
-	} /* if */
+	}
 	source_buf[i] = ch;
 	result_buf[i] = '\0';
 	lower_buf[i] = lower_ch;
-    } /* for */
+    }
     source_buf[i] = '\0';
     result_buf[i] = '\0';
     lower_buf[i] = '\0';
@@ -706,7 +706,7 @@ static void test_RtlDowncaseUnicodeStrin
 	   source_str.Buffer[i], source_str.Buffer[i],
 	   result_str.Buffer[i], result_str.Buffer[i],
 	   lower_str.Buffer[i], lower_str.Buffer[i]);
-    } /* for */
+    }
 }
 
 
@@ -765,17 +765,17 @@ static void test_RtlUnicodeStringToAnsiS
 	    ansi_str.Buffer = ansi_buf;
 	} else {
 	    ansi_str.Buffer = NULL;
-	} /* if */
+	}
 	uni_str.Length        = ustr2astr[test_num].uni_Length;
 	uni_str.MaximumLength = ustr2astr[test_num].uni_MaximumLength;
 	if (ustr2astr[test_num].uni_buf != NULL) {
 	    for (pos = 0; pos < ustr2astr[test_num].uni_buf_size/sizeof(WCHAR); pos++) {
 		uni_buf[pos] = ustr2astr[test_num].uni_buf[pos];
-	    } /* for */
+	    }
 	    uni_str.Buffer = uni_buf;
 	} else {
 	    uni_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlUnicodeStringToAnsiString(&ansi_str, &uni_str, ustr2astr[test_num].doalloc);
 	ok(result == ustr2astr[test_num].result,
 	   "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %lx, expected %lx\n",
@@ -789,7 +789,7 @@ static void test_RtlUnicodeStringToAnsiS
 	ok(memcmp(ansi_str.Buffer, ustr2astr[test_num].res_buf, ustr2astr[test_num].res_buf_size) == 0,
 	   "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has ansi \"%s\" expected \"%s\"\n",
 	   test_num, ustr2astr[test_num].doalloc, ansi_str.Buffer, ustr2astr[test_num].res_buf);
-    } /* for */
+    }
 }
 
 
@@ -836,7 +836,7 @@ static void test_RtlAppendAsciizToString
 	    dest_str.Buffer = dest_buf;
 	} else {
 	    dest_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlAppendAsciizToString(&dest_str, app_asc2str[test_num].src);
 	ok(result == app_asc2str[test_num].result,
 	   "(test %d): RtlAppendAsciizToString(dest, src) has result %lx, expected %lx\n",
@@ -855,8 +855,8 @@ static void test_RtlAppendAsciizToString
 	    ok(dest_str.Buffer == app_asc2str[test_num].res_buf,
 	       "(test %d): RtlAppendAsciizToString(dest, src) dest has Buffer %p expected %p\n",
 	       test_num, dest_str.Buffer, app_asc2str[test_num].res_buf);
-	} /* if */
-    } /* for */
+	}
+    }
 }
 
 
@@ -908,7 +908,7 @@ static void test_RtlAppendStringToString
 	    dest_str.Buffer = dest_buf;
 	} else {
 	    dest_str.Buffer = NULL;
-	} /* if */
+	}
 	src_str.Length         = app_str2str[test_num].src_Length;
 	src_str.MaximumLength  = app_str2str[test_num].src_MaximumLength;
 	if (app_str2str[test_num].src_buf != NULL) {
@@ -917,7 +917,7 @@ static void test_RtlAppendStringToString
 	    src_str.Buffer = src_buf;
 	} else {
 	    src_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlAppendStringToString(&dest_str, &src_str);
 	ok(result == app_str2str[test_num].result,
 	   "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
@@ -936,8 +936,8 @@ static void test_RtlAppendStringToString
 	    ok(dest_str.Buffer == app_str2str[test_num].res_buf,
 	       "(test %d): RtlAppendStringToString(dest, src) dest has Buffer %p expected %p\n",
 	       test_num, dest_str.Buffer, app_str2str[test_num].res_buf);
-	} /* if */
-    } /* for */
+	}
+    }
 }
 
 
@@ -989,7 +989,7 @@ static void test_RtlAppendUnicodeToStrin
 	    dest_str.Buffer = dest_buf;
 	} else {
 	    dest_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlAppendUnicodeToString(&dest_str, (LPCWSTR) app_uni2str[test_num].src);
 	ok(result == app_uni2str[test_num].result,
 	   "(test %d): RtlAppendUnicodeToString(dest, src) has result %lx, expected %lx\n",
@@ -1008,8 +1008,8 @@ static void test_RtlAppendUnicodeToStrin
 	    ok(dest_str.Buffer == (WCHAR *) app_uni2str[test_num].res_buf,
 	       "(test %d): RtlAppendUnicodeToString(dest, src) dest has Buffer %p expected %p\n",
 	       test_num, dest_str.Buffer, app_uni2str[test_num].res_buf);
-	} /* if */
-    } /* for */
+	}
+    }
 }
 
 
@@ -1065,7 +1065,7 @@ static void test_RtlAppendUnicodeStringT
 	    dest_str.Buffer = dest_buf;
 	} else {
 	    dest_str.Buffer = NULL;
-	} /* if */
+	}
 	src_str.Length         = app_ustr2str[test_num].src_Length;
 	src_str.MaximumLength  = app_ustr2str[test_num].src_MaximumLength;
 	if (app_ustr2str[test_num].src_buf != NULL) {
@@ -1074,7 +1074,7 @@ static void test_RtlAppendUnicodeStringT
 	    src_str.Buffer = src_buf;
 	} else {
 	    src_str.Buffer = NULL;
-	} /* if */
+	}
 	result = pRtlAppendUnicodeStringToString(&dest_str, &src_str);
 	ok(result == app_ustr2str[test_num].result,
 	   "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
@@ -1093,8 +1093,8 @@ static void test_RtlAppendUnicodeStringT
 	    ok(dest_str.Buffer == (WCHAR *) app_ustr2str[test_num].res_buf,
 	       "(test %d): RtlAppendStringToString(dest, src) dest has Buffer %p expected %p\n",
 	       test_num, dest_str.Buffer, app_ustr2str[test_num].res_buf);
-	} /* if */
-    } /* for */
+	}
+    }
 }
 
 
@@ -1174,25 +1174,25 @@ static void test_RtlFindCharInUnicodeStr
 	    main_str.MaximumLength = main_str.Length + sizeof(WCHAR);
 	    for (idx = 0; idx < main_str.Length / sizeof(WCHAR); idx++) {
 		main_str_buf[idx] = find_ch_in_ustr[test_num].main_str[idx];
-	    } /* for */
+	    }
 	    main_str.Buffer = main_str_buf;
 	} else {
 	    main_str.Length        = 0;
 	    main_str.MaximumLength = 0;
 	    main_str.Buffer        = NULL;
-	} /* if */
+	}
 	if (find_ch_in_ustr[test_num].search_chars != NULL) {
 	    search_chars.Length        = strlen(find_ch_in_ustr[test_num].search_chars) * sizeof(WCHAR);
 	    search_chars.MaximumLength = search_chars.Length + sizeof(WCHAR);
 	    for (idx = 0; idx < search_chars.Length / sizeof(WCHAR); idx++) {
 		search_chars_buf[idx] = find_ch_in_ustr[test_num].search_chars[idx];
-	    } /* for */
+	    }
 	    search_chars.Buffer = search_chars_buf;
 	} else {
 	    search_chars.Length        = 0;
 	    search_chars.MaximumLength = 0;
 	    search_chars.Buffer        = NULL;
-	} /* if */
+	}
 	pos = 12345;
         result = pRtlFindCharInUnicodeString(find_ch_in_ustr[test_num].flags, &main_str, &search_chars, &pos);
         ok(result == find_ch_in_ustr[test_num].result,
@@ -1205,7 +1205,7 @@ static void test_RtlFindCharInUnicodeStr
            test_num, find_ch_in_ustr[test_num].flags,
            find_ch_in_ustr[test_num].main_str, find_ch_in_ustr[test_num].search_chars,
            pos, find_ch_in_ustr[test_num].pos);
-    } /* for */
+    }
 }
 
 
@@ -1353,7 +1353,7 @@ static void test_RtlUnicodeStringToInteg
 	   "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n",
 	   test_num, str2int[test_num].str, str2int[test_num].base, value, str2int[test_num].value);
 	free(wstr);
-    } /* for */
+    }
 
     wstr = AtoW(str2int[1].str);
     pRtlInitUnicodeString(&uni, wstr);
@@ -1414,8 +1414,8 @@ static void test_RtlCharToInteger(void)
 	    ok(value == str2int[test_num].value,
 	       "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n",
 	       test_num, str2int[test_num].str, str2int[test_num].base, value, str2int[test_num].value);
-	} /* if */
-    } /* for */
+	}
+    }
 
     result = pRtlCharToInteger(str2int[1].str, str2int[1].base, NULL);
     ok(result == STATUS_ACCESS_VIOLATION,
@@ -1561,7 +1561,7 @@ static void one_RtlIntegerToUnicodeStrin
 
     for (pos = 0; pos < STRI_BUFFER_LENGTH; pos++) {
 	expected_str_Buffer[pos] = int2str->Buffer[pos];
-    } /* for */
+    }
     expected_unicode_string.Length = int2str->Length * sizeof(WCHAR);
     expected_unicode_string.MaximumLength = int2str->MaximumLength * sizeof(WCHAR);
     expected_unicode_string.Buffer = expected_str_Buffer;
@@ -1569,7 +1569,7 @@ static void one_RtlIntegerToUnicodeStrin
 
     for (pos = 0; pos < STRI_BUFFER_LENGTH; pos++) {
 	str_Buffer[pos] = '-';
-    } /* for */
+    }
     unicode_string.Length = 0;
     unicode_string.MaximumLength = int2str->MaximumLength * sizeof(WCHAR);
     unicode_string.Buffer = str_Buffer;
@@ -1580,7 +1580,7 @@ static void one_RtlIntegerToUnicodeStrin
 	/* On BUFFER_OVERFLOW the string Buffer should be unchanged */
 	for (pos = 0; pos < STRI_BUFFER_LENGTH; pos++) {
 	    expected_str_Buffer[pos] = '-';
-	} /* for */
+	}
 	/* w2k: The native function has two reasons for BUFFER_OVERFLOW: */
 	/* If the value is too large to convert: The Length is unchanged */
 	/* If str is too small to hold the string: Set str->Length to the length */
@@ -1589,7 +1589,7 @@ static void one_RtlIntegerToUnicodeStrin
 	if (expected_unicode_string.Length > 32 && unicode_string.Length == 0) {
 	    /* The value is too large to convert only triggerd when testing native */
 	    expected_unicode_string.Length = 0;
-	} /* if */
+	}
     } else {
 	ok(result == int2str->result,
 	   "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) has result %lx, expected: %lx\n",
@@ -1598,8 +1598,8 @@ static void one_RtlIntegerToUnicodeStrin
 	    ok(unicode_string.Buffer[unicode_string.Length/sizeof(WCHAR)] == '\0',
 	       "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string \"%s\" is not NULL terminated\n",
 	       test_num, int2str->value, int2str->base, ansi_str.Buffer);
-	} /* if */
-    } /* if */
+	}
+    }
     ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
        "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
        test_num, int2str->value, int2str->base, ansi_str.Buffer, expected_ansi_str.Buffer);
@@ -1720,7 +1720,7 @@ START_TEST(rtlstr)
 	test_RtlAppendStringToString();
 	test_RtlAppendUnicodeToString();
 	test_RtlAppendUnicodeStringToString();
-    } /* if */
+    }
 
     if (pRtlInitUnicodeStringEx)
         test_RtlInitUnicodeStringEx();
@@ -1732,9 +1732,10 @@ START_TEST(rtlstr)
         test_RtlGUIDFromString();
     if (pRtlStringFromGUID)
         test_RtlStringFromGUID();
-        /*
-	 * test_RtlUpcaseUnicodeChar();
-	 * test_RtlUpcaseUnicodeString();
-	 * test_RtlDowncaseUnicodeString();
-	 */
+    if(0)
+    {
+	test_RtlUpcaseUnicodeChar();
+	test_RtlUpcaseUnicodeString();
+	test_RtlDowncaseUnicodeString();
+    }
 }


More information about the wine-patches mailing list