| 9 | #include <limits.h> |
| 10 | #include "gr_rect.h" |
| 11 | dirty_rect * |
| 12 | new_dirty_rect(int size) |
| 13 | { |
| 14 | dirty_rect *new = NULL; |
| 15 | if (size > 0) { |
| 16 | new = (dirty_rect *) calloc(1L, sizeof(dirty_rect)); |
| 17 | if (new) { |
| 18 | new->rects = (GRECT *) calloc((long) size, sizeof(GRECT)); |
| 19 | if (new->rects == NULL) { |
| 20 | free(new); |
| 21 | return (NULL); |
| 22 | } |
| 23 | new->max = size; |
| 24 | } |
| 25 | } |
| 26 | return (new); |
| 27 | } |
| 28 | void |
| 29 | delete_dirty_rect(dirty_rect *this) |
| 30 | { |