Raised This Month: $51 Target: $400
 12% 

[Question] Which Are The Differences?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-15-2013 , 23:58   [Question] Which Are The Differences?
Reply With Quote #1

I'm wondering if is there any difference between the first function and the second one.
And if there is any difference, why then?
May someone give any better explanations for __fastcall than Microsoft gives?

PHP Code:
#if defined __linux__
void OnTakeDamagevoid Victimentvars_t Inflictorentvars_t Attackerfloat Damageint DamageBits ) {
#else
void __fastcall OnTakeDamagevoid Victimintentvars_t Inflictorentvars_t Attackerfloat Damageint DamageBits ) {
#endif
    /*
        printf( "Calling OnTakeDamage!\n" );
    */
#if !defined __linux__
    
reinterpret_cast int __fastcall * ) ( void *, intentvars_t *, entvars_t *, floatint ) > ( /* void * */ CMiscs.TakeDamage ) ( Victim0InflictorAttackerDamageDamageBits );
#else
    
reinterpret_cast int ( * ) ( void *, entvars_t *, entvars_t *, floatint ) > ( /* void * */ CMiscs.TakeDamage ) ( VictimInflictorAttackerDamageDamageBits );
#endif

PHP Code:
#if defined __linux__
int OnTakeDamagevoid Victimentvars_t Inflictorentvars_t Attackerfloat Damageint DamageBits ) {
#else
int __fastcall OnTakeDamagevoid Victimintentvars_t Inflictorentvars_t Attackerfloat Damageint DamageBits ) {
#endif
    /*
        printf( "Calling OnTakeDamage!\n" );
    */
#if !defined __linux__
    
int Result reinterpret_cast int __fastcall * ) ( void *, intentvars_t *, entvars_t *, floatint ) > ( /* void * */ CMiscs.TakeDamage ) ( Victim0InflictorAttackerDamageDamageBits );
#else
    
int Result reinterpret_cast int ( * ) ( void *, entvars_t *, entvars_t *, floatint ) > ( /* void * */ CMiscs.TakeDamage ) ( VictimInflictorAttackerDamageDamageBits );
#endif

    
return Result;

__________________

Last edited by claudiuhks; 03-16-2013 at 00:02.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-16-2013 , 22:48   Re: [Question] Which are the differences?
Reply With Quote #2

Check yourself

http://en.wikipedia.org/wiki/X86_calling_conventions

http://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx

It just change how the things (function args) and stack are handled at ASM level
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode