Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by kwyx. 08/15/22 04:54
Workshop examples crash
by yoriz. 08/14/22 16:27
Zorro_setup.exe detected with virus
by yoriz. 08/14/22 16:17
Bulk-parse CSV files from whole directory
by jack_the_whack. 08/13/22 07:57
ARM support for Zorro?
by AndrewAMD. 08/11/22 19:54
DeepLearn script
by jcl. 08/10/22 12:58
New Zorro version 2.50
by hast29. 08/09/22 15:50
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
2 registered members (kwyx, AndrewAMD), 409 guests, and 16 spiders.
Key: Admin, Global Mod, Mod
Newest Members
yoriz, Five_w4ys, kwyx, RandomWalker, boony
18816 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: C++ scripts [Re: jcl] #486134
06/10/22 15:05
06/10/22 15:05
Joined: Feb 2017
Posts: 1,498
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,498
Chicago
For the curious, the Zorro default C++ compiler options do not override struct alignment.

Code
#include <zorro.h>

typedef struct FOO1{
	char a;
	double b;
} FOO1;
#pragma pack(push,1)
typedef struct FOO2{
	char a;
	double b;
} FOO2;
#pragma pack(pop)

DLLFUNC void main() {
	set(LOGFILE);
	FOO1 foo1={};
	FOO2 foo2={};
	char *pA=0,*pB=0;
	pA = (char*)&foo1.a;
	pB = (char*)&foo1.b;
	printf("\nA: %p, B: %p, diff: %d",pA,pB,pB-pA);
	pA = (char*)&foo2.a;
	pB = (char*)&foo2.b;
	printf("\nA: %p, B: %p, diff: %d",pA,pB,pB-pA);
	printf("\nDone!");
}

/* LOG OUTPUT:

A: 0000006041F0B280, B: 0000006041F0B288, diff: 8
A: 0000006041F0B270, B: 0000006041F0B271, diff: 1
Done!

*/

Re: C++ scripts [Re: jcl] #486241
07/02/22 13:02
07/02/22 13:02
Joined: Feb 2017
Posts: 1,498
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,498
Chicago
Miscellaneous C++ problems:

1) cancelTrade is missing the overload where TRADE* is an argument.

2) distribute() function is missing. (but we do have distribute0 and distribute1.)

Re: C++ scripts [Re: jcl] #486242
07/04/22 13:02
07/04/22 13:02
Joined: Jul 2000
Posts: 27,871
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,871
Frankfurt
Thanks, this will be fixed in the next beta. Please continue to test.

Page 2 of 2 1 2

Moderated by  Petra 

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