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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 959 guests, and 8 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
Page 1 of 2 1 2
proc_kill - Functions with different parameters #431647
10/21/13 16:57
10/21/13 16:57
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Hello laugh
Today I noticed a little bug while using proc_kill.
First of all, heres the code:
Code:
function test(var lol)
{
	while(1)
	{
		DEBUG_VAR(1, 20);
		wait(1);
	}
}

function test(var lol, var tes)
{
	while(1)
	{
		DEBUG_VAR(1, 20);
		wait(1);
	}
}

...

test(1, 5); //test(1);
proc_kill((void*)test);



If Im going to stop test(1) everything works fine, but proc_kill wont stop test(1, 5).
Would be awesome to see a workarround because I know it will take some time till you release the new 3DGS version frown

EDIT: I found a verrrry crappy workarround: Displaying the address and calculate the difference (would be here 0x163)

Code:
proc_kill((void*)(test + 0x163));



This will ONLY stop the second function. Please fix this soon laugh

Last edited by Ch40zzC0d3r; 10/21/13 17:08.
Re: proc_kill - Functions with different parameters [Re: Ch40zzC0d3r] #431656
10/22/13 08:57
10/22/13 08:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, this workaround is really ugly. For killing overloaded functions you'd need another proc_kill function that takes the number of the overloaded function as a parameter.

Until then, definitely give the functions unique names that you want to kill. This will be added to the manual.

Re: proc_kill - Functions with different parameters [Re: jcl] #431672
10/22/13 11:36
10/22/13 11:36
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
but isn't there just overloading in parameter-count but in parameter-types too?

something like:

Code:
void Foo(int Arg)
{
...
}

void Foo(float Arg)
{
...
}



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: proc_kill - Functions with different parameters [Re: Rackscha] #431680
10/22/13 13:16
10/22/13 13:16
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Yes, sure. But what's the point of that remark?


Always learn from history, to be sure you make the same mistakes again...
Re: proc_kill - Functions with different parameters [Re: jcl] #431682
10/22/13 13:54
10/22/13 13:54
Joined: Jul 2013
Posts: 158
F
Feindbild Offline
Member
Feindbild  Offline
Member
F

Joined: Jul 2013
Posts: 158
Originally Posted By: Uhrwerk
Yes, sure. But what's the point of that remark?

Because it shows the problem with this approach:
Originally Posted By: jcl
another proc_kill function that takes the number of the overloaded function as a parameter

Re: proc_kill - Functions with different parameters [Re: Feindbild] #431683
10/22/13 14:53
10/22/13 14:53
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Sorry, I still don't get it... crazy


Always learn from history, to be sure you make the same mistakes again...
Re: proc_kill - Functions with different parameters [Re: Uhrwerk] #431684
10/22/13 14:59
10/22/13 14:59
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Me neither, but I guess I need not understand everything laugh.

Re: proc_kill - Functions with different parameters [Re: jcl] #431690
10/22/13 16:51
10/22/13 16:51
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Both functions still have the same number of args and yet are different.

Re: proc_kill - Functions with different parameters [Re: FBL] #431700
10/22/13 17:49
10/22/13 17:49
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Yes, but no one ever said anything about the arguments... Except of Racksha, that is.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: proc_kill - Functions with different parameters [Re: jcl] #431711
10/22/13 20:18
10/22/13 20:18
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: jcl
For killing overloaded functions you'd need another proc_kill function that takes the number of the overloaded function as a parameter.

jcl, normally I'm needling you to implement features rather than adding advice what no to do in the manual. However, in this specific case it's exactly the opposite for once: please don't implement such a proc_kill function. Such a function will result in extremely hard to maintain and fragile code.


Always learn from history, to be sure you make the same mistakes again...
Page 1 of 2 1 2

Moderated by  jcl, Nems, Spirit, Tobias 

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