Andrew Talbot : msvcrt: Cast-qual warnings fix.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 6 08:49:21 CST 2006
Module: wine
Branch: master
Commit: 55f25b712d574308b7999a6a8d4bf9fb279bac65
URL: http://source.winehq.org/git/wine.git/?a=commit;h=55f25b712d574308b7999a6a8d4bf9fb279bac65
Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date: Sat Nov 4 17:51:49 2006 +0000
msvcrt: Cast-qual warnings fix.
---
dlls/msvcrt/file.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 1624f84..c842ef8 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -1980,7 +1980,8 @@ #endif
else
{
unsigned int i, j, nr_lf;
- char *p;
+ char *p = NULL;
+ const char *q;
const char *s = (const char *)buf, *buf_start = (const char *)buf;
/* find number of \n ( without preceding \r ) */
for ( nr_lf=0,i = 0; i <count; i++)
@@ -1993,7 +1994,7 @@ #endif
}
if (nr_lf)
{
- if ((p = MSVCRT_malloc(count + nr_lf)))
+ if ((q = p = MSVCRT_malloc(count + nr_lf)))
{
for (s = (const char *)buf, i = 0, j = 0; i < count; i++)
{
@@ -2009,13 +2010,13 @@ #endif
{
FIXME("Malloc failed\n");
nr_lf =0;
- p = (char*)buf;
+ q = buf;
}
}
else
- p = (char*)buf;
+ q = buf;
- if ((WriteFile(hand, p, count+nr_lf, &num_written, NULL) == 0 ) || (num_written != count+nr_lf))
+ if ((WriteFile(hand, q, count+nr_lf, &num_written, NULL) == 0 ) || (num_written != count+nr_lf))
{
TRACE("WriteFile (fd %d, hand %p) failed-last error (%d), num_written %d\n",
fd, hand, GetLastError(), num_written);
More information about the wine-cvs
mailing list