Commit 4eb11194 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Made to work with C99

Version 1.52. Tagged as 'DrawFile-1_52'
parent 64f82ba6
......@@ -63,11 +63,11 @@ OBJS = o.bbox o.callback o.declare o.header o.main \
o.render o.riscos o.textarea o.trfm o.verify
OBJS_310 = \
o.bbox o.callback o.declare o.files o.header310 oSA.main \
o.muldiv o.render o.riscos o.textarea o.trfm o.verify
o.render o.riscos o.textarea o.trfm o.verify
OBJSD = debug.bbox debug.callback debug.declare o.files o.header \
o.hostfs debug.main o.muldiv debug.render \
debug.riscos debug.textarea debug.trfm debug.verify debug.trace debug.m
o.hostfs debug.main debug.render \
debug.riscos debug.textarea debug.trfm debug.verify debug.jc_trace
INCS = i.bbox i.declare i.main i.render i.files i.textarea i.verify
......@@ -168,6 +168,9 @@ RM.310.DrawFile: ${OBJS_310} ${RESOURCES310} ${OSLIB} CLib:o.Stubs ${ASMUTILS}
# Static dependencies:
o.Messages: LocalRes:Messages
ResGen Messages o.Messages LocalRes:Messages Resources.DrawFile.Messages
o.Message310: LocalRes:Message310
ResGen Messages o.Message310 LocalRes:Message310 Resources.DrawFile.Messages
......
/* (1.51)
/* (1.52)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 1.51
#define Module_MajorVersion_CMHG 1.52
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Dec 2000
#define Module_Date_CMHG 22 Nov 2002
#define Module_MajorVersion "1.51"
#define Module_Version 151
#define Module_MajorVersion "1.52"
#define Module_Version 152
#define Module_MinorVersion ""
#define Module_Date "13 Dec 2000"
#define Module_Date "22 Nov 2002"
#define Module_ApplicationDate2 "13-Dec-00"
#define Module_ApplicationDate4 "13-Dec-2000"
#define Module_ApplicationDate "22-Nov-02"
#define Module_ComponentName "DrawFile"
#define Module_ComponentPath "RiscOS/Sources/Video/Render/DrawFile"
#define Module_FullVersion "1.51"
#define Module_HelpVersion "1.51 (13 Dec 2000)"
#define Module_FullVersion "1.52"
#define Module_HelpVersion "1.52 (22 Nov 2002)"
#define Module_LibraryVersionInfo "1:52"
AREA Asm,CODE,READONLY
EXPORT xhostfs_writec
xhostfs_writec
MOV ip,lr
SWI &40102
MOVVC a1,#0
MOV pc,ip
END
......@@ -172,11 +172,11 @@ os_error *callback_delete (callback_l l)
return NULL;
}
/*------------------------------------------------------------------------*/
static os_error *Callback (void *dh, Level level, bool *unclaimed, int limit,
static os_error *Callback (void *dh, Level level, osbool *unclaimed, int limit,
int *k)
{ Function f;
bool u = TRUE;
osbool u = TRUE;
os_error *error = NULL;
#ifdef XTRACE
......@@ -231,12 +231,12 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *callback (callback_l l, void *dh, bool *unclaimed, int limit, ...)
os_error *callback (callback_l l, void *dh, osbool *unclaimed, int limit, ...)
/*Makes the non-portable assumption that the arguments after |limit| are
on the stack in order of increasing address.*/
{ bool u = TRUE;
{ osbool u = TRUE;
os_error *error = NULL;
tracef ("callback ...\n");
......@@ -267,7 +267,7 @@ os_error *callback_register (callback_l l, callback_fn *fn, void *sh,
for (i = 0; i < limit; i++)
{ Entry e;
bool found = FALSE;
osbool found = FALSE;
if (*level == NULL)
{ /*Need a new one for this level. First create the new |Level|.*/
......@@ -474,7 +474,7 @@ void Trace_Entry (Entry entry, int indent)
static void Trace_Function (Function fns, int indent)
{ Function f;
bool first = TRUE;
osbool first = TRUE;
for (f = fns; f != NULL; f = f->next)
{ if (first)
......
......@@ -40,7 +40,7 @@ os_error *declare (bits flags, drawfile_diagram *diagram, int size)
{ drawfile_object *end, *o;
drawfile_declare_fonts_state state;
os_error *error = NULL;
bool unclaimed;
osbool unclaimed;
tracef ("declare\n");
state.diagram = diagram;
......@@ -67,7 +67,7 @@ finish:
return error != NULL? error: state.error;
}
/*------------------------------------------------------------------------*/
os_error *declare_font_table (void *null, void *s, bool *unclaimed)
os_error *declare_font_table (void *null, void *s, osbool *unclaimed)
{ os_error *error = NULL;
drawfile_declare_fonts_state *state = (drawfile_declare_fonts_state *) s; /*save typing*/
......@@ -103,12 +103,12 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *declare_group (void *null, void *s, bool *unclaimed)
os_error *declare_group (void *null, void *s, osbool *unclaimed)
{ os_error *error = NULL;
drawfile_declare_fonts_state *state = (drawfile_declare_fonts_state *) s /*save typing*/;
drawfile_object *o, *end;
bool u;
osbool u;
tracef ("declare_group\n");
NOT_USED (null)
......@@ -138,12 +138,12 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *declare_tagged (void *null, void *s, bool *unclaimed)
os_error *declare_tagged (void *null, void *s, osbool *unclaimed)
{ os_error *error = NULL;
drawfile_declare_fonts_state *state = (drawfile_declare_fonts_state *) s /*save typing*/;
drawfile_object *o, *end;
bool u;
osbool u;
tracef ("declare_tagged\n");
NOT_USED (null)
......@@ -171,7 +171,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *declare_text_area (void *null, void *s, bool *unclaimed)
os_error *declare_text_area (void *null, void *s, osbool *unclaimed)
{ os_error *error = NULL;
drawfile_declare_fonts_state *state = (drawfile_declare_fonts_state *) s; /*save typing*/
......
......@@ -15,13 +15,14 @@
/*trace.c - simple trace to tube*/
#undef TRACE
#define TRACE 0
#define TRACE 1
/*From CLib*/
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
......@@ -315,4 +316,15 @@ void trace_wait (char *file, int line, int t)
finish:;
}
void *m_alloc (char *file, int line, int size)
{
return malloc(size);
}
void m_free (char *file, int line, void *ptr, int size)
{
free(ptr);
}
#endif /* TRACE */
......@@ -111,7 +111,7 @@ static os_error *Create_List(Association table[], int count,
os_error *error = NULL;
int i;
callback_l l;
bool done_new = FALSE;
osbool done_new = FALSE;
tracef("main_initialise: creating callback list\n");
if ((error = callback_new(&l)) != NULL)
......@@ -142,9 +142,9 @@ _kernel_oserror *main_initialise(char *tail, int podule_base,
{
os_error *error = NULL;
int size;
bool done_open_file = FALSE;
osbool done_open_file = FALSE;
#ifdef STANDALONE
bool done_register_files = FALSE;
osbool done_register_files = FALSE;
#endif
bits flags;
char *message_file_name;
......@@ -305,7 +305,7 @@ finish:
_kernel_oserror *main_service(int service, _kernel_swi_regs * regs,
void *workspace)
{
bool unclaimed = TRUE;
osbool unclaimed = TRUE;
os_error *error = NULL;
workspace = workspace;
......@@ -391,7 +391,7 @@ _kernel_oserror *main_command(char *tail, int argc, int cmd_no,
struct
{
char *file, *m[3][2];
bool bbox, suppress;
osbool bbox, suppress;
char *flatness;
char argd[1024];
}
......
......@@ -19,13 +19,13 @@
callbacks just store their error codes away, and return NULL.
In other words, instead of taking the form
os_error *fn (..., bool *u) { os_error *error = NULL; ...
os_error *fn (..., osbool *u) { os_error *error = NULL; ...
finish: return error; }
they look like this
os_error *fn (..., bool *u) { os_error *error = NULL; ...
os_error *fn (..., osbool *u) { os_error *error = NULL; ...
finish: if (state->error == NULL) state->error = error; return
NULL; }
......@@ -128,7 +128,7 @@ static os_error *Sprite(osspriteop_header * header, os_trfm * trfm)
}
if ((error = xcolourtrans_select_table(header->mode, log2_bpp < 3 ?
(os_palette *) & palette : (os_palette *) - 1,
(os_palette *) & palette : colourtrans_CURRENT_PALETTE,
colourtrans_CURRENT_MODE, colourtrans_CURRENT_PALETTE,
(osspriteop_trans_tab *) & trans_tab)) != NULL)
goto finish;
......@@ -204,7 +204,7 @@ static os_error *Text_System(char *text, os_colour fill, os_trfm * trfm)
/* mask */
{-1, -1, -1, -1, -1, -1, -1, -1}
};
bool done_switch_output = FALSE;
osbool done_switch_output = FALSE;
os_coord base =
{16 * draw_OS_UNIT, 0}, step;
os_trfm char_trfm = *trfm;
......@@ -316,7 +316,7 @@ os_error *render(bits flags, drawfile_diagram * diagram, int size,
drawfile_object *end, *o;
drawfile_render_state state;
os_box inv_clip;
bool can_clip, unclaimed;
osbool can_clip, unclaimed;
tracef("render\n");
can_clip = clip != NULL && trfm_det(trfm) != 0;
......@@ -368,7 +368,7 @@ finish:
return error != NULL ? error : state.error;
}
/*------------------------------------------------------------------------*/
os_error *render_font_table(void *null, void *s, bool * unclaimed)
os_error *render_font_table(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -396,7 +396,7 @@ os_error *render_font_table(void *null, void *s, bool * unclaimed)
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_text_system(void *null, void *s, bool * unclaimed)
os_error *render_text_system(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -479,7 +479,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_text(void *null, void *s, bool * unclaimed)
os_error *render_text(void *null, void *s, osbool * unclaimed)
{
drawfile_render_state *state = (drawfile_render_state *) s; /* save
......@@ -487,7 +487,7 @@ os_error *render_text(void *null, void *s, bool * unclaimed)
os_error *error = NULL;
drawfile_text *text = &state->object->data AS text;
char *font_name;
bool done_find_font = FALSE;
osbool done_find_font = FALSE;
font_f f;
os_trfm trfm;
os_coord base;
......@@ -573,7 +573,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_path(void *null, void *s, bool * unclaimed)
os_error *render_path(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -703,7 +703,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_sprite(void *null, void *s, bool * unclaimed)
os_error *render_sprite(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -781,7 +781,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_group(void *null, void *s, bool * unclaimed)
os_error *render_group(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -789,7 +789,7 @@ os_error *render_group(void *null, void *s, bool * unclaimed)
typing */ ;
drawfile_group *group = &state->object->data AS group;
drawfile_object *o, *end;
bool u;
osbool u;
tracef("render_group\n");
#ifdef TEST
......@@ -833,7 +833,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_tagged(void *null, void *s, bool * unclaimed)
os_error *render_tagged(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -841,7 +841,7 @@ os_error *render_tagged(void *null, void *s, bool * unclaimed)
typing */ ;
drawfile_tagged *tagged = &state->object->data AS tagged;
drawfile_object *o, *end;
bool u;
osbool u;
tracef("render_tagged\n");
#ifdef TEST
......@@ -882,7 +882,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_text_area(void *null, void *s, bool * unclaimed)
os_error *render_text_area(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -919,7 +919,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_trfm_text_system(void *null, void *s, bool * unclaimed)
os_error *render_trfm_text_system(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -1023,7 +1023,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_trfm_text(void *null, void *s, bool * unclaimed)
os_error *render_trfm_text(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -1031,7 +1031,7 @@ os_error *render_trfm_text(void *null, void *s, bool * unclaimed)
typing */
drawfile_trfm_text *trfm_text = &state->object->data AS trfm_text;
char *font_name;
bool done_find_font = FALSE;
osbool done_find_font = FALSE;
font_f f;
os_trfm trfm;
os_coord base;
......@@ -1129,7 +1129,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_trfm_sprite(void *null, void *s, bool * unclaimed)
os_error *render_trfm_sprite(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......@@ -1174,7 +1174,7 @@ finish:
return NULL;
}
/*------------------------------------------------------------------------*/
os_error *render_jpeg(void *null, void *s, bool * unclaimed)
os_error *render_jpeg(void *null, void *s, osbool * unclaimed)
{
os_error *error = NULL;
......
......@@ -108,7 +108,7 @@ struct
os_box *clip;
bits flags;
bool version_given; /* had a \! command yet? */
osbool version_given; /* had a \! command yet? */
Align align; /* \A command */
int font_no; /* \<digits> command */
Triplet fill, bg_hint; /* \C, \B commands */
......
......@@ -40,7 +40,7 @@ typedef
State;
/*------------------------------------------------------------------------*/
bool verify_overlap (os_box *box1, os_box *box2)
osbool verify_overlap (os_box *box1, os_box *box2)
{ return MAX (box1->x0, box2->x0) <= MIN (box1->x1, box2->x1) &&
MAX (box1->y0, box2->y0) <= MIN (box1->y1, box2->y1);
......@@ -114,7 +114,7 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *verify_font_table (void *null, void *s, bool *unclaimed)
os_error *verify_font_table (void *null, void *s, osbool *unclaimed)
{ State *state = (State *) s; /*save typing*/
os_error *error = NULL;
......@@ -141,7 +141,7 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *verify_group (void *null, void *s, bool *unclaimed)
os_error *verify_group (void *null, void *s, osbool *unclaimed)
{ State *state = (State *) s /*save typing*/;
drawfile_object *o, *end;
......@@ -180,7 +180,7 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *verify_text (void *null, void *s, bool *unclaimed)
os_error *verify_text (void *null, void *s, osbool *unclaimed)
{ State *state = (State *) s; /*save typing*/
char *font_name;
......@@ -213,7 +213,7 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *verify_tagged (void *null, void *s, bool *unclaimed)
os_error *verify_tagged (void *null, void *s, osbool *unclaimed)
{ State *state = (State *) s /*save typing*/;
drawfile_object *o, *end;
......@@ -247,7 +247,7 @@ finish:
return error;
}
/*------------------------------------------------------------------------*/
os_error *verify_trfm_text (void *null, void *s, bool *unclaimed)
os_error *verify_trfm_text (void *null, void *s, osbool *unclaimed)
{ char *font_name;
State *state = (State *) s; /*save typing*/
......
......@@ -28,7 +28,7 @@
/* The type of a callback function.
*/
typedef os_error *callback_fn (void *, void *, bool *);
typedef os_error *callback_fn (void *, void *, osbool *);
/* The type of a callback list.
*/
......@@ -54,7 +54,7 @@ extern os_error *callback_delete (callback_l);
* values will be called, and passed the given handle, until
* one is claimed.
*/
extern os_error *callback (callback_l, void *, bool *, int, ...);
extern os_error *callback (callback_l, void *, osbool *, int, ...);
/* Function to register a new callback function.
*
......
......@@ -29,7 +29,7 @@ extern char *verify_lookup_font_index (byte, drawfile_object *);
extern os_error *verify_diagram (drawfile_diagram *, int);
extern bool verify_overlap (os_box *, os_box *);
extern osbool verify_overlap (os_box *, os_box *);
extern callback_fn verify_font_table;
extern callback_fn verify_group;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment