Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast  (Read 3607 times)

0 Members and 1 Guest are viewing this topic.

SyS

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Hello everyone.

First and foremost, thanks for everything; the SFML is a mind-blowing library, the community and the docs/tutorials really help a lot, and Laurent has been doing an amazing work.



I have been coding in C for some time now, and been using CSFML for several months.
The program I'm currently working on runs well, but I get some weird warnings related to sfFont and sfShape.

sfString * sfSyS_sfStringDeclaration
        (const char * pathToFont,
        unsigned int uintCharSize, const sfUint32 * ptrUintCharset,
        const char * strText, sfColor colorString,
        const sfBool boolCenterSpriteOnItself,
        const float fltScaleX, const float fltScaleY)
{
        sfString * string = sfString_Create ();
       
        sfFont * font = sfFont_CreateFromFile
                (pathToFont, uintCharSize, ptrUintCharset);
       ...
}

On the third line of this function, I get the following warning, that I don't understand: [...] warning: initialization makes pointer from integer without a cast [enabled by default]. The function sfFont_CreateFromFile returning a type sfFont *, I don't get where is the mistake here.

The same things happen for sfShape and a function I made (sfSyS_sfShapeCircleSmoothArrayDeclaration) that returns sfShape * *:
void GameModule_StarsRowDeclaration
        (sfShape * * * shapeStars,
        const short STARS_ANTIALIASING_LEVEL,
        short * shrtShapeStarsDeclarationCounter,
        short * shrtNumberOfStarsBig,
        short * shrtNumberOfStarsMediumBig,
        short * shrtNumberOfStarsMediumSmall,
        short * shrtNumberOfStarsSmall,
        unsigned int uintRenderWindowWidth,
        unsigned int uintRenderWindowHeight)
{
        ...
        *(shapeStars + i) =
                sfSyS_sfShapeCircleSmoothArrayDeclaration (...)
        ...
}

Maybe I'm just lacking some C basics.


Thanks in advance, and, again, you're doing an admirable job.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast
« Reply #1 on: July 04, 2013, 10:19:55 am »
Hum I don't know, everything looks ok.

But you should consider switching to SFML 2, SFML 1 has been unmaintained for years.
Laurent Gomila - SFML developer

SyS

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast
« Reply #2 on: July 04, 2013, 07:46:01 pm »
Okay, thanks.

 

anything