Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (TipmyPip, clint000, Grant, chsmac85, Martin_HH), 5,858 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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 | 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