A buffer variable wasn't dereferenced in two similar comparisons in ResList
[AROS.git] / compiler / alib / newrectregion.c
blobb511b19f5d777d0892d0da77cff554a205999e61
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function NewRectRegion()
6 Lang: english
7 */
9 #include <graphics/regions.h>
10 #include <proto/graphics.h>
12 /*****************************************************************************
14 NAME */
15 #include <proto/alib.h>
17 struct Region *NewRectRegion(
19 /* SYNOPSIS */
20 WORD MinX,
21 WORD MinY,
22 WORD MaxX,
23 WORD MaxY)
25 /* FUNCTION
26 Creates a new rectangular Region
28 INPUTS
29 MinX, MinY, MaxX, MaxY - The extent of the Rect
31 RESULT
32 Pointer to the newly created Region. NULL on failure.
34 NOTES
35 This function is a shorthand for:
37 struct Rectangle rect;
38 struct Region *region;
40 rect.MinX = MinX;
41 rect.MinY = MinY;
42 rect.MaxX = MaxX;
43 rect.MaxY = MaxY;
45 region = NewRegion();
46 OrRectRegion(region, &rect);
48 EXAMPLE
50 BUGS
52 SEE ALSO
54 INTERNALS
56 HISTORY
57 15-12-2000 stegerg implemented
59 *****************************************************************************/
61 struct Region *region = NewRegion();
63 if (region)
65 struct Rectangle rect = {MinX, MinY, MaxX, MaxY};
66 BOOL res = OrRectRegion(region, &rect);
68 if (res)
69 return region;
71 DisposeRegion(region);
74 return NULL;
76 } /* NewRectRegion */