🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11344

Re: Double click detection?

#11344
From: Markus Schmidt
Date: Fri, 03 Feb 1989 18:45
34 lines
2228 bytes
)%
)%|  shimoda@rmi.de       `---'   The last remaining adventure      |
)%|  shimoda@gopnbg.UUCP  |O o|   since there are no more tigers:   |
)
)Please correct me if I am wrong, but doesn't this code fragment
)contain two Bad Things?  No Guru has yet responded, so I thought I
)would take a shot at sticking my foot in my mouth.
)
)It busy-waits.  There is no call to Wait(), or WaitPort() before the
)GetMsg().  Even  if you are busy-waiting only while looking for double
)clicks, you shouldn't.
)
)GetMsg() will return NULL if no message has yet arrived.  With the
)various 'if (imsg-> ... )' tests, you are then indirecting through
)address 0, which while not necessarily fatal, is sloppy and will quite
)likely break on any system with memory protection (unless it's a VAX :-).
)Even if you do call Wait(), you should not depend on GetMsg()
)returning something non-NULL.
)
)Andrew Heybey, atheybey@ptt.lcs.mit.edu     Room 509, 545 Technology Square
.-----------------------------------------------------------------.
Of course you are right both times. As I said, it was hacked down
online so forgive me if this caused any trouble. Next time I will
be more reliable.
I just left out anything except the DoubleClick-stuff.

Thank you anyway.

|  shimoda@rmi.de       `---'   The last remaining adventure      |
|  shimoda@gopnbg.UUCP  |O o|   since there are no more tigers:   |
|                       ==Y==   Doublebuffered async. I/O       _ |
|----------------------- `U' ------------------------------  _ // |
|  Good terminalpackages     begin with A: AmigaCall, A-Ta.. \//  |
`-----------------------------------------------------------------'
Technical Details
Message-ID: <490@infohh.rmi.de>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!unido!rmi!infoac!infohh!shimoda
References: <8901301541.AA05371@PTT.LCS.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!unido!rmi!infoac!infohh!shimoda
From: shimoda@infohh.rmi.de (Markus Schmidt)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Double click detection?
Message-ID: <490@infohh.rmi.de>
Date: 3 Feb 89 18:45:51 GMT
References: <8901301541.AA05371@PTT.LCS.MIT.EDU>
Reply-To: shimoda@infohh.rmi.de (Markus Schmidt)
Organization: RMI Net * Aachen/Hamburg/Flensburg * W.Germany
Lines: 34