Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C or lite-c issue? #487600
06/13/23 17:41
06/13/23 17:41
Joined: Jun 2023
Posts: 8
Denia
Mishiwaka Offline OP
Newbie
Mishiwaka  Offline OP
Newbie

Joined: Jun 2023
Posts: 8
Denia
Hi everyone, I have an issue with a code that always returns a syntax error, but this time I can figure out what is really wrong ((( any help?
The error comes from line
double x = *(const double *)a;
and will definitely will pop up also from the next one

int compare(const void *a, const void *b)
{
double x = *(const double *)a;
double y = *(const double *)b;
if (x < y)
{
return -1;
}
else if (x > y)
{
return 1;
}
return 0;
}

Re: C or lite-c issue? [Re: Mishiwaka] #487604
06/14/23 13:14
06/14/23 13:14
Joined: Feb 2017
Posts: 1,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
Chicago
Lite-C has some eccentricities. The compiler probably does not understand your casts.

Just make pointers to double and dereference them in your comparisons.

Re: C or lite-c issue? [Re: Mishiwaka] #487610
06/15/23 13:34
06/15/23 13:34
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Lite-C knows double, but not const.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1