const cleanup round 1(commentary on what I found)

Mike Schaadt mschaadt at
Tue Mar 13 02:35:53 CDT 2007

Some of this was included in the patch submission.  Some of it I had
questions about.

spawn.c : warnings may or may not be harmless depending on if esecvp
attempts to modify the results.  Specs indicate it doesn't, but the function
typing doesn't indicate so(the difference is 'const char * const argv[]' and
'char *const argv[]')

    strstrW - returns the location where sub was found in str.  I believe
returning a non-const value is what is expected.  Should this be changed to
a non-const parameter, or just leave the warning as is?

        [line 149,153,155] - freeing of const variable.  Is this ok?  I
could imagine it *could* cause problems if what we are freeing isn't in
readable/writeable memory.
        [line 293,403,409] - same as pdb_exit.
        [line 462] - ditto
        line[514] - ditto
        line[643] - ditto

        [line 305, 329] - freeing of const variable again.
        [line 314, 335] - both cases, set return_text to type_str.  Either
parsed_symbol's return_text needs to be constified, proto should be
unconstified, or leave it in place as a necessary cast.

Any comments on the above spots?  what of these are necessary casts?  what
of these can/should be corrected, and what needs to be done to correct them?

**patches submitted to wine-patches**
the following were straight forward patches that shouldn't modify the flow
of the program beyond fixing the warnings.

    strtolW and strtoulW - constify the endptr value.  This is just an
output value to indicate where in the array we stoped processing.  Change
causes this to be the same type as the first value.  Reduces number of
cast-qual warnings by 6.

        [line 176] - switched to const.  Value is never modified in the
function.  Removes a cast-qual warning.

    symbol_clean_string - this function is modifying the string.  This
should most definitely *not* be a const parameter.  It's not even logically
const(as a comment tried to claim) as the the intent of the function is to
make the type string Wine-friendly.  That requires modifications to that
string, and to the variable.  Removes a cast-qual warning.

Comments? questions?

Current number of cast-qual warnings fixed: 8.
Number deemed necessary: 0(you guys need to help me decide what of these
need to remain)
Number looked at: 24.
Estimated number remaining: 521.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the wine-devel mailing list