Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, ozgur, Quad), 844 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
startup functions #417068
02/08/13 01:27
02/08/13 01:27
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline OP
Expert
Uhrwerk  Offline OP
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I hope I don't inconvenience you... blush
Code:
#include <acknex.h>

void foo_startup_bar()
{
	printf("surprise");
}

Originally Posted By: manual
Functions ending with ..._startup are executed right after the main() function


Always learn from history, to be sure you make the same mistakes again...
Re: startup functions [Re: Uhrwerk] #417273
02/11/13 09:16
02/11/13 09:16
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks, we'll reword the text.

Re: startup functions [Re: jcl] #417468
02/13/13 00:35
02/13/13 00:35
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline OP
Expert
Uhrwerk  Offline OP
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
What is to be said against fixing the bug in this case?


Always learn from history, to be sure you make the same mistakes again...
Re: startup functions [Re: Uhrwerk] #417484
02/13/13 11:02
02/13/13 11:02
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Changing software behavior just to match the documentation could break existing code - therefore we do that only when there's a real reason for it, such as improving or fixing something. In all other cases we change the documentation.

Re: startup functions [Re: jcl] #417525
02/13/13 15:15
02/13/13 15:15
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Originally Posted By: jcl
Changing software behavior just to match the documentation could break existing code - therefore we do that only when there's a real reason for it, such as improving or fixing something. In all other cases we change the documentation.


my personal quote of the week^^.

However, if "startup" is registered from everywhere within the identifier, this limits the programmer, as he can not use this word.

AND

in all other places, theses marks occur ONLY at the end of the identifier. For example in shadercode where we use_var, _bmap etc. This behaviour for "startup" doesnt match the general behaviour, is not intended, so it's a bug.

Last edited by Rackscha; 02/13/13 15:16.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: startup functions [Re: jcl] #417530
02/13/13 15:29
02/13/13 15:29
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline OP
Expert
Uhrwerk  Offline OP
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: jcl
Changing software behavior just to match the documentation could break existing code

But that code was already broken in the first place. smirk

Originally Posted By: jcl
therefore we do that only when there's a real reason for it

There is: As Rakscha pointed out the currently implemented behaviour is totally inconsistent with the rest of the software.

Additionally the "_startup" check does not take into account the number of arguments of the function (does not make any sense to me. If it's a startup it shouldn't have any parameters!) This makes the whole thing even more dangerous.
Code:
#include <acknex.h>

void show_startup_text(TEXT* t)
{
	if (t)
		t->flags |= SHOW;
}

This small piece of code will cause your application to crash. Even worse on my machine the crash occurs randomly.

Last edited by Uhrwerk; 02/13/13 17:40. Reason: Why was this moved to Lite-C Programming?

Always learn from history, to be sure you make the same mistakes again...

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