Removing (HANDLE)NULL casts

Francois Gouget fgouget at
Thu Nov 28 19:09:28 CST 2002

Now that we compile Wine in STRICT mode we no longer need casts like
(HRGN)NULL or (HWND)0 (not that we ever really needed the latter).

So I propose to apply the following script which removes all these
unnecessary casts. I can also send the patch but with the script it's
quite unnecessary. Let me know if I should send it anyway (it's a mere
2200 lines).



for file in `find . -name "*.c"`
    if egrep -q "\( *($handles) *\) *(NULL|0)" "$file"
        echo "$file"
        perl -p -i.orig -e 's/\( *('$handles') *\) *(NULL|0(?!\w))/NULL/g' "$file"

Francois Gouget         fgouget at
      Any sufficiently advanced bug is indistinguishable from a feature.
                            -- from some indian guy

More information about the wine-patches mailing list