Mixed types



  • The function signature:


    void CheckRow(LBoxObj *, BoolEnum);

    The function call:

    CheckRow(lbox,NULL);



  • Another fun thing to do: passing enums in pointer fields, since small integers are not valid pointers on most platforms.



  • @Carnildo said:

    The function signature:

    void CheckRow(LBoxObj *, BoolEnum);

    The function call:

    CheckRow(lbox,NULL);

    Am I missing something here?  I see:

    A function signature with two parameters, the first a point to an object of class LBoxObj, the second a [Ooh, bingo required] boolean value.

    Got it.  I'm afraid the "Mixed types" subject line got me.  But then, who knows?  Perhaps NULL has been typedef'ed to FILE_NOT_FOUND, which we all know is a perfectly valid member of BoolEnum. ;-)

     



  • "BoolEnum"? Like as in, TRUE/FALSE/FILENOTFOUND?



  • @Daniel Beardsmore said:

    "BoolEnum"? Like as in, TRUE/FALSE/FILENOTFOUND?


    As in, one of the many, many, many, many solutions to the lack of a boolean type in the C89 standard.



  • This probably includes a header that defines NULL as (0) instead of ((void*)0), in which case it'll perfectly happily transparently cast to an enum.


Log in to reply