SFML community forums

Bindings - other languages => C => Topic started by: SyS on July 04, 2013, 10:07:37 am

Title: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast
Post by: SyS on July 04, 2013, 10:07:37 am
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.
Title: Re: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast
Post by: Laurent 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.
Title: Re: [CSFML 1.6] sfFont and sfShape: pointer from integer without a cast
Post by: SyS on July 04, 2013, 07:46:01 pm
Okay, thanks.