#21 √ resolved
joshuaknox

"Cast from pointer" warnings (Ubuntu Hardy AMD64)

Reported by joshuaknox | July 31st, 2008 @ 09:56 AM | in 2.4 (Event)

I'll play around with rubygame and report any additional problems: these probably are not a big deal as they aren't reported by the gem install, but jacius requested I file this.


ext/rubygame/rubygame_shared.c: In function ‘Init_rubygame_shared’:
ext/rubygame/rubygame_shared.c:266: warning: cast from pointer to integer of different size

ext/rubygame/rubygame_surface.c: In function ‘rbgm_surface_get_colorkey’:
ext/rubygame/rubygame_surface.c:336: warning: cast to pointer from integer of different size
ext/rubygame/rubygame_surface.c: In function ‘rbgm_surface_getat’:
ext/rubygame/rubygame_surface.c:621: warning: cast to pointer from integer of different size

Comments and changes to this ticket

  • John Croisant

    John Croisant August 16th, 2008 @ 03:54 PM

    • → State changed from “new” to “open”
    • → Tag changed from “@improvement” to “!lowpriority @bug surface”
    • → Milestone changed from “” to “2.4 (Event)”

    Note for myself:

    The offending code in shared is "if( mNamedResource == (int)NULL )".

    The offending code in the two Surface functions is: "if((int *)color == NULL)".

    The code should be restructured to eliminate the comparisons.

    • For named resource, the condition can be removed, and just execute the code unconditionally.
    • For colorkey, the surface's flags should be checked for the presence or absence of the colorkey flag to determine whether a colorkey is set.
    • For get_at, the condition and block can probably be removed entirely.
  • John Croisant

    John Croisant August 16th, 2008 @ 04:55 PM

    • → State changed from “open” to “resolved”

    This issue is fixed in the master branch and will be rolled out with Rubygame 2.4.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Flexible library for making games with the Ruby language.

rubygame.sourceforge.net

Shared Ticket Bins

People watching this ticket

You can update this ticket by sending an email to from your email client. (help)