English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 01 August 2021, 22:00   #21
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,322
Quote:
Originally Posted by bebbo View Post
looks good.
Looks bad. First of all, the signal is triggered once, but if multiple messages are in the port, you will deadlock on a signal that was already cleared. Second, you do not check which signal was received. Third, you miss a check for NULL because you collected a signal from a different port. The 0xf800... something is because you are not running MuForce (do that!) and you try to evaluate a message through a NULL pointer, and thus instead evaluate the interrupt vector base with offset 0. Thus: [code] signals = Wait(...); if (signal & (1UL
Thomas Richter is offline  
Old 01 August 2021, 22:01   #22
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,322
Quote:
Originally Posted by bebbo View Post
looks good.
Looks bad. First of all, the signal is triggered once, but if multiple messages are in the port, you will deadlock on a signal that was already cleared. Second, you do not check which signal was received. Third, you miss a check for NULL because you collected a signal from a different port. The 0xf800... something is because you are not running MuForce (do that!) and you try to evaluate a message through a NULL pointer, and thus instead evaluate the interrupt vector base with offset 0.



Code:
signals = Wait(...);

if (signal & (1UL << windowsignal)) {
 while(msg = GT_GetIMsg(...)) {
   ... handle messsage ...
   GT_ReplyIMsg(msg);
 }
} else if (signal & (othersignalmask)) {
 ...
}
Thomas Richter is offline  
Old 02 August 2021, 04:28   #23
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 830
Thank you for the sample code. This helped me a lot. I have re-organized my code to follow the same structure. The code is more readable like this and while going through the changes I also spotted an issue with how I was managing the second signal mask.

Will read about MuForce.

Quote:
Originally Posted by Thomas Richter View Post

Code:
signals = Wait(...);

if (signal & (1UL << windowsignal)) {
 while(msg = GT_GetIMsg(...)) {
   ... handle messsage ...
   GT_ReplyIMsg(msg);
 }
} else if (signal & (othersignalmask)) {
 ...
}
Sim085 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
intuition questions meynaf Coders. System 11 09 December 2020 11:27
Help needed for an Intuition event loop thyslo Coders. System 8 29 October 2018 19:08
C Intuition Help plasmab Coders. General 7 15 October 2018 09:05
ClassicWB MultiBoot Menu (right click/left click on boot) not working DuaneL project.ClassicWB 9 13 September 2016 16:32
click click bloody click Dave_wb support.Hardware 14 12 April 2005 09:31

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 +2. The time now is 02:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.06762 seconds with 15 queries