refactored some code. compiles now without suppresing any warning with gcc-6.3.0.
[AROS.git] / rom / graphics / inittmpras.c
blob198e51a444cfb13a286f2b0c7c63d5b874067742
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function InitRastPort()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <graphics/rastport.h>
10 #include <proto/exec.h>
11 #include <proto/graphics.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH3(struct TmpRas *, InitTmpRas,
19 /* SYNOPSIS */
20 AROS_LHA(struct TmpRas *, tmpras, A0),
21 AROS_LHA(void * , buffer, A1),
22 AROS_LHA(ULONG , size , D0),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 78, Graphics)
27 /* FUNCTION
28 Initializes a TmpRas structure. The user has to connect the
29 TmpRas structure to the rastport.
30 Some routines need extra memory in order to be able to operate
31 properly.
33 INPUTS
34 tmpras - pointer to a TmpRas structure to be initialized
35 buffer - pointer to a piece of chip memory.
36 size - size in bytes of buffer.
38 RESULT
39 Properly initialized TmpRas structure to link to RastPort structure
40 for use with functions like Flood(), Text() and AreaEnd().
42 NOTES
43 Alltough the RKRM says InitTmpRas is a VOID function every SDK
44 implements it so that it returns the tmpras argument.
46 EXAMPLE
48 BUGS
49 The function itself is a bug.
50 Why does this function exist at all? The necessary memory should
51 be allocated in InitRastPort() or the functions that need it.
53 SEE ALSO
55 INTERNALS
57 HISTORY
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
63 tmpras->RasPtr = buffer;
64 tmpras->Size = size;
66 return tmpras;
68 AROS_LIBFUNC_EXIT
69 } /* InitTmpRas */