develooper Front page | perl.perl5.porters | Postings from May 2003

[PATCH win32/win32.c] silence compiler warnings

Thread Next
From:
Abe Timmerman
Date:
May 1, 2003 15:53
Subject:
[PATCH win32/win32.c] silence compiler warnings
Message ID:
200305020051.43166.abe@ztreet.demon.nl
Hi porters,

These warnings should be gone with this patch:

win32.c: In function `win32_execvp':
win32.c:3974: warning: passing arg 3 of `win32_spawnvp' from incompatible pointer type
win32.c: In function `w32_DomainName':
win32.c:4433: warning: passing arg 2 of `WideCharToMultiByte' makes integer from pointer without a cast
win32.c:4437: warning: passing arg 2 of `WideCharToMultiByte' makes integer from pointer without a cast

--- win32/win32.c.orig  2003-03-20 07:33:15.000000000 +0100
+++ win32/win32.c       2003-05-01 22:39:34.000000000 +0200
@@ -3971,7 +3971,7 @@
     /* if this is a pseudo-forked child, we just want to spawn
      * the new program, and return */
     if (w32_pseudo_id) {
-       int status = win32_spawnvp(P_WAIT, cmdname, (char *const *)argv);
+       int status = win32_spawnvp(P_WAIT, cmdname, (const char *const *)argv);
        if (status != -1) {
            my_exit(status);
            return 0;
@@ -4429,11 +4429,11 @@
        /* NERR_Success *is* 0*/
        if (0 == pfnNetWkstaGetInfo(NULL, 100, &pwi)) {
            if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
-               WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
+               WideCharToMultiByte(CP_ACP, 0, pwi->wki100_langroup,
                                    -1, (LPSTR)dname, dnamelen, NULL, NULL);
            }
            else {
-               WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername,
+               WideCharToMultiByte(CP_ACP, 0, pwi->wki100_computername,
                                    -1, (LPSTR)dname, dnamelen, NULL, NULL);
            }
            pfnNetApiBufferFree(pwi);

Good luck,

Abe
-- 
Unspecified = it may work or it may not or demons may fly out of your nose. 
And the hairyness of the demons is almost guaranteed to vary from platform
to platform.
                                   -- Jarkko Hietaniemi on p5p @ 2001-12-10

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About