From 20f2c86a511f7913cf858e7bd3668b0b59663ba0 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 May 2015 09:11:32 +0100 Subject: Clean up atari source linendings, whitespace damage and executable status --- atari/redrawslots.c | 184 ++++++++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) (limited to 'atari/redrawslots.c') diff --git a/atari/redrawslots.c b/atari/redrawslots.c index 6977a6d2d..f5351866a 100644 --- a/atari/redrawslots.c +++ b/atari/redrawslots.c @@ -1,19 +1,19 @@ -/* - * Copyright 2011 Ole Loots - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . +/* + * Copyright 2011 Ole Loots + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include @@ -25,101 +25,101 @@ void redraw_slots_init(struct s_redrw_slots * slots, short size) { - // TODO: allocate slots dynamically! + // TODO: allocate slots dynamically! slots->size = MIN( MAX_REDRW_SLOTS , size); slots->areas_used = 0; } void redraw_slots_free(struct s_redrw_slots * slots) { - // TOOD: free areas... + // TOOD: free areas... } -static inline bool rect_intersect( struct rect * box1, struct rect * box2 ) -{ - if (box2->x1 < box1->x0) - return false; - - if (box2->y1 < box1->y0) - return false; - - if (box2->x0 > box1->x1) - return false; - - if (box2->y0 > box1->y1) - return false; - - return true; +static inline bool rect_intersect( struct rect * box1, struct rect * box2 ) +{ + if (box2->x1 < box1->x0) + return false; + + if (box2->y1 < box1->y0) + return false; + + if (box2->x0 > box1->x1) + return false; + + if (box2->y0 > box1->y1) + return false; + + return true; } void redraw_slot_schedule_grect(struct s_redrw_slots * slots, GRECT *area, - bool force) + bool force) { - redraw_slot_schedule(slots, area->g_x, area->g_y, - area->g_x + area->g_w, area->g_y + area->g_h, force); + redraw_slot_schedule(slots, area->g_x, area->g_y, + area->g_x + area->g_w, area->g_y + area->g_h, force); } -/* - schedule redraw coords. -*/ +/* + schedule redraw coords. +*/ void redraw_slot_schedule(struct s_redrw_slots * slots, short x0, short y0, - short x1, short y1, bool force) -{ - int i = 0; - struct rect area; - - area.x0 = x0; - area.y0 = y0; - area.x1 = x1; - area.y1 = y1; - - if (force == false) { - for (i=0; iareas_used; i++) { - if (slots->areas[i].x0 <= x0 - && slots->areas[i].x1 >= x1 - && slots->areas[i].y0 <= y0 - && slots->areas[i].y1 >= y1) { - /* the area is already queued for redraw */ - return; - } else { - if (rect_intersect(&slots->areas[i], &area )) { - slots->areas[i].x0 = MIN(slots->areas[i].x0, x0); - slots->areas[i].y0 = MIN(slots->areas[i].y0, y0); - slots->areas[i].x1 = MAX(slots->areas[i].x1, x1); - slots->areas[i].y1 = MAX(slots->areas[i].y1, y1); - return; - } - } - } - } - - if (slots->areas_used < slots->size) { - slots->areas[slots->areas_used].x0 = x0; - slots->areas[slots->areas_used].x1 = x1; - slots->areas[slots->areas_used].y0 = y0; - slots->areas[slots->areas_used].y1 = y1; - slots->areas_used++; - } else { - /* - we are out of available slots, merge box with last slot - this is dumb... but also a very rare case. - */ - slots->areas[slots->size-1].x0 = MIN(slots->areas[i].x0, x0); - slots->areas[slots->size-1].y0 = MIN(slots->areas[i].y0, y0); - slots->areas[slots->size-1].x1 = MAX(slots->areas[i].x1, x1); - slots->areas[slots->size-1].y1 = MAX(slots->areas[i].y1, y1); - } - - return; + short x1, short y1, bool force) +{ + int i = 0; + struct rect area; + + area.x0 = x0; + area.y0 = y0; + area.x1 = x1; + area.y1 = y1; + + if (force == false) { + for (i=0; iareas_used; i++) { + if (slots->areas[i].x0 <= x0 + && slots->areas[i].x1 >= x1 + && slots->areas[i].y0 <= y0 + && slots->areas[i].y1 >= y1) { + /* the area is already queued for redraw */ + return; + } else { + if (rect_intersect(&slots->areas[i], &area )) { + slots->areas[i].x0 = MIN(slots->areas[i].x0, x0); + slots->areas[i].y0 = MIN(slots->areas[i].y0, y0); + slots->areas[i].x1 = MAX(slots->areas[i].x1, x1); + slots->areas[i].y1 = MAX(slots->areas[i].y1, y1); + return; + } + } + } + } + + if (slots->areas_used < slots->size) { + slots->areas[slots->areas_used].x0 = x0; + slots->areas[slots->areas_used].x1 = x1; + slots->areas[slots->areas_used].y0 = y0; + slots->areas[slots->areas_used].y1 = y1; + slots->areas_used++; + } else { + /* + we are out of available slots, merge box with last slot + this is dumb... but also a very rare case. + */ + slots->areas[slots->size-1].x0 = MIN(slots->areas[i].x0, x0); + slots->areas[slots->size-1].y0 = MIN(slots->areas[i].y0, y0); + slots->areas[slots->size-1].x1 = MAX(slots->areas[i].x1, x1); + slots->areas[slots->size-1].y1 = MAX(slots->areas[i].y1, y1); + } + + return; } void redraw_slots_remove_area(struct s_redrw_slots * slots, int i) { - int x; - for(x = i+1; iareas_used; x++){ - slots->areas[x-1] = slots->areas[x]; - } - slots->areas_used--; + int x; + for (x = i+1; iareas_used; x++) { + slots->areas[x-1] = slots->areas[x]; + } + slots->areas_used--; } -- cgit v1.2.3