bitblt.c

changeset 35
41804cc569ab
parent 33
44d823824a46
child 42
9c85a4cd88a3
     1.1 --- a/bitblt.c	Wed Jan 02 10:17:24 2002 +0000
     1.2 +++ b/bitblt.c	Wed Jan 02 10:17:48 2002 +0000
     1.3 @@ -12,20 +12,23 @@
     1.4  #endif
     1.5  }
     1.6  
     1.7 -static inline u32 rect_width (Rect r)
     1.8 +static inline s32 rect_width (Rect r)
     1.9  {
    1.10    return (r.lower_right.x - r.upper_left.x);
    1.11  }
    1.12  
    1.13 -static inline u32 rect_height (Rect r)
    1.14 +static inline s32 rect_height (Rect r)
    1.15  {
    1.16    return (r.lower_right.y - r.upper_left.y);
    1.17  }
    1.18  
    1.19 -Bitmap *create_bitmap (u32 width, u32 height)
    1.20 +Bitmap *create_bitmap (s32 width, s32 height)
    1.21  {
    1.22    Bitmap *bitmap;
    1.23  
    1.24 +  if ((width <= 0) || (height <= 0))
    1.25 +    return (NULL);
    1.26 +
    1.27    bitmap = calloc (1, sizeof (Bitmap));
    1.28    if (! bitmap)
    1.29      return (NULL);