Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
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,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
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,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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