flat assembler
Message board for the users of flat assembler.

Index > Main > Prototypes?!?

Author
Thread Post new topic Reply to topic
evil__donkey



Joined: 07 Dec 2003
Posts: 26
evil__donkey 23 Jul 2004, 08:57
Code:
invoke        ShowWindow, [g_hWndMain], SW_SHOWNORMAL    


FASM doesn't warn if I mistakingly use

Code:
invoke     ShowWindow, [g_hWndMain]    


possibly demonstrating why prototypes are good. =\ (I spent one hour trying to find out the error, and lo! it's right there.)

_________________
--A donkey always says thank you with a kick.
Post 23 Jul 2004, 08:57
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 23 Jul 2004, 09:27
evil__donkey wrote:
FASM doesn't warn if I mistakingly use
Code:
invoke  ShowWindow, [g_hWndMain]    



IMHO, this is the right behaviour. Of course you still can use "win32ax.inc" if you can't live without parameter checking. Smile

Here is one simple example why parameter check is bad sometimes:
Code:
        invoke  ExtCreatePen,PS_COSMETIC,1,eax,0,NULL
        invoke  SelectObject,[.DC], eax
        push    eax ; old pen in the stack

; some line drawing invokes

        invoke  SelectObject, [.DC] ;  The old pen is already in the stack
        invoke  DeleteObject,eax   ;  Delete created pen.
    


In case of parameter check you have to pop eax and then to push it again.

Regards.
Post 23 Jul 2004, 09:27
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 23 Jul 2004, 09:44
It's the "win32axp.inc" that does parameter checking.
Post 23 Jul 2004, 09:44
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 23 Jul 2004, 10:14
Privalov wrote:
It's the "win32axp.inc" that does parameter checking.


Embarassed Sorry, my fault.
Post 23 Jul 2004, 10:14
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.