kernel32/tests: src[i] is a char so there is no point trying to stuff 0xcafedead into it.

Francois Gouget fgouget at free.fr
Sun May 27 06:30:42 CDT 2007


---

Visual C++ 2005 warned about a possible loss of information in the 
assignment. In this case it was quite right (which is quite rare).
In fact there is not much point to the 0xcafedead part since src[i] is a 
byte. Even adding an offset does not seem quite necessary.

 dlls/kernel32/tests/virtual.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index bcff9c4..a033096 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -84,7 +84,7 @@ static void test_VirtualAllocEx(void)
     src = (char *) HeapAlloc( GetProcessHeap(), 0, alloc_size );
     dst = (char *) HeapAlloc( GetProcessHeap(), 0, alloc_size );
     for (i = 0; i < alloc_size; i++)
-        src[i] = 0xcafedead + i;
+        src[i] = i & 0xff;
 
     ok(addr1 != NULL, "VirtualAllocEx error %u\n", GetLastError());
     b = WriteProcessMemory(hProcess, addr1, src, alloc_size, &bytes_written);
-- 
1.4.4.4




More information about the wine-patches mailing list