Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Problem mit realloc() [Re: KDuke] #260355
04/10/09 10:19
04/10/09 10:19
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Sorry, I cant read german, but if the above code gives problems try
Code:
((town_ingame[id])->town_goods)->ware = (int *)malloc((Waren_all+1)*(int)sizeof(int));
I dont know if the old "sizeof" bug has been fixed or not. But this is the workaround.
(That is, re-typecasting sizeof by using (int)sizeof instead)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Problem mit realloc() [Re: EvilSOB] #260385
04/10/09 13:02
04/10/09 13:02
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
Howdy,

Originally Posted By: EvilSOB
I dont know if the old "sizeof" bug has been fixed or not. But this is the workaround.

Yes, the sizeof bug has been fixed in 7.7. smile


@Sylar
Das Problem ist wahrscheinlich, dass die Operatorpräzedenz an folgender Stelle (Edit: und an der Stelle, die KDuke genannt hat, dessen Post ich gerade übersehen habe, sorry^^) zu einem Fehler führt:
Code:
town_ingame[id].town_goods.ware[h] = 0;


Stattdessen müsste sie - denke ich - so aussehen:
Code:
(town_ingame[id].town_goods->ware)[h] = 0;

Sollte das nicht funktionieren, kannst du auch noch 'town_goods->ware' in Klammern setzen.

Eine kurze Erklärung dazu findest du hier: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=255441#Post255441





Last edited by Kombucha; 04/10/09 13:05. Reason: KDukes Post übersehen
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1