summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-02-19 17:19:38 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-02-19 17:19:38 +0000
commit3123192dfca6336a0fc90d34dec4269aa329b4d0 (patch)
tree20e561959237b4c584ce12978c7ec15236ccfedb /amiga
parentb76ef4333a83e8f543411c578433d5db457788de (diff)
downloadnetsurf-3123192dfca6336a0fc90d34dec4269aa329b4d0.tar.gz
netsurf-3123192dfca6336a0fc90d34dec4269aa329b4d0.tar.bz2
Move timer.device stuff to schedule.c
svn path=/trunk/netsurf/; revision=11712
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c28
-rwxr-xr-xamiga/schedule.c32
-rwxr-xr-xamiga/schedule.h5
-rw-r--r--amiga/system_colour.c1
4 files changed, 38 insertions, 28 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 1db49bb27..64785d26b 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -79,7 +79,6 @@
#include <proto/keymap.h>
#include <proto/locale.h>
#include <proto/Picasso96API.h>
-#include <proto/timer.h>
#include <proto/utility.h>
#include <proto/wb.h>
@@ -133,8 +132,6 @@ char *quirks_stylesheet_url;
char *adblock_stylesheet_url;
struct MsgPort *appport;
-struct Device *TimerBase;
-struct TimerIFace *ITimer;
struct Library *PopupMenuBase = NULL;
struct PopupMenuIFace *IPopupMenu = NULL;
struct Library *KeymapBase = NULL;
@@ -272,20 +269,7 @@ void ami_open_resources(void)
urlStringClass = MakeStringClass();
- msgport = AllocSysObjectTags(ASOT_PORT,
- ASO_NoTrack,FALSE,
- TAG_DONE);
-
- tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
- ASOIOR_Size,sizeof(struct TimeRequest),
- ASOIOR_ReplyPort,msgport,
- ASO_NoTrack,FALSE,
- TAG_DONE);
-
- OpenDevice("timer.device",UNIT_WAITUNTIL,(struct IORequest *)tioreq,0);
-
- TimerBase = (struct Device *)tioreq->Request.io_Device;
- ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
+ ami_schedule_open_timer();
if(!(appport = AllocSysObjectTags(ASOT_PORT,
ASO_NoTrack,FALSE,
@@ -2131,15 +2115,7 @@ void gui_quit(void)
if(IKeymap) DropInterface((struct Interface *)IKeymap);
if(KeymapBase) CloseLibrary(KeymapBase);
- if(ITimer)
- {
- DropInterface((struct Interface *)ITimer);
- }
-
- CloseDevice((struct IORequest *) tioreq);
- FreeSysObject(ASOT_IOREQUEST,tioreq);
- FreeSysObject(ASOT_PORT,msgport);
-
+ ami_schedule_close_timer();
ami_schedule_free();
FreeObjList(window_list);
diff --git a/amiga/schedule.c b/amiga/schedule.c
index 1c670c4bb..030ed266a 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -133,7 +133,7 @@ void schedule_run(BOOL poll)
nscb = pblHeapGetFirst(schedule_list);
- if(nscb == -1) return false;
+ if(nscb == -1) return;
if(poll)
{
@@ -188,3 +188,33 @@ void ami_schedule_free(void)
{
pblHeapFree(schedule_list);
}
+
+void ami_schedule_open_timer(void)
+{
+ msgport = AllocSysObjectTags(ASOT_PORT,
+ ASO_NoTrack,FALSE,
+ TAG_DONE);
+
+ tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
+ ASOIOR_Size,sizeof(struct TimeRequest),
+ ASOIOR_ReplyPort,msgport,
+ ASO_NoTrack,FALSE,
+ TAG_DONE);
+
+ OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
+
+ TimerBase = (struct Device *)tioreq->Request.io_Device;
+ ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
+}
+
+void ami_schedule_close_timer(void)
+{
+ if(ITimer)
+ {
+ DropInterface((struct Interface *)ITimer);
+ }
+
+ CloseDevice((struct IORequest *) tioreq);
+ FreeSysObject(ASOT_IOREQUEST,tioreq);
+ FreeSysObject(ASOT_PORT,msgport);
+}
diff --git a/amiga/schedule.h b/amiga/schedule.h
index 7a3b25f1b..50071e5a8 100755
--- a/amiga/schedule.h
+++ b/amiga/schedule.h
@@ -22,9 +22,14 @@
#include "amiga/os3support.h"
+struct Device *TimerBase;
+struct TimerIFace *ITimer;
+
struct TimeRequest *tioreq;
struct MsgPort *msgport;
+void ami_schedule_open_timer(void);
+void ami_schedule_close_timer(void);
BOOL ami_schedule_create(void);
void ami_schedule_free(void);
void schedule_run(BOOL poll);
diff --git a/amiga/system_colour.c b/amiga/system_colour.c
index eb8a34c95..69c869a16 100644
--- a/amiga/system_colour.c
+++ b/amiga/system_colour.c
@@ -30,7 +30,6 @@
#include <proto/graphics.h>
#include <proto/intuition.h>
#include <intuition/screens.h>
-#include <datatypes/pictureclass.h>
struct gui_system_colour_ctx {
const char *name;