msvcrt: Cast-qual warnings fix

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Nov 4 11:51:49 CST 2006


Changelog:
    msvcrt: Cast-qual warnings fix.

diff -urN a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
--- a/dlls/msvcrt/file.c	2006-10-31 17:37:57.000000000 +0000
+++ b/dlls/msvcrt/file.c	2006-11-04 17:32:48.000000000 +0000
@@ -1981,6 +1981,7 @@
   {
       unsigned int i, j, nr_lf;
       char *p;
+      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 @@
       }
       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 @@
           {
               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-patches mailing list