Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 2393) +++ trunk/src/action_helper.c (revision 2394) @@ -556,8 +556,8 @@ wx = Note.X - Crosshair.AttachedBox.Point1.X; wy = Note.Y - Crosshair.AttachedBox.Point1.Y; - if (XOR(Crosshair.AttachedBox.otherway, abs(wy) > abs(wx))) { - Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + abs(wy) * SGNZ(wx); + if (XOR(Crosshair.AttachedBox.otherway, labs(wy) > labs(wx))) { + Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + labs(wy) * SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 if (abs(wy) / 2 >= abs(wx)) @@ -567,7 +567,7 @@ dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90; } else { - Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedBox.Point1.Y + abs(wx) * SGNZ(wy); + Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedBox.Point1.Y + labs(wx) * SGNZ(wy); sa = (wy >= 0) ? -90 : 90; #ifdef ARC45 if (abs(wx) / 2 >= abs(wy)) @@ -577,11 +577,11 @@ dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90; wy = wx; } - if (abs(wy) > 0 && (arc = CreateNewArcOnLayer(CURRENT, + if (labs(wy) > 0 && (arc = CreateNewArcOnLayer(CURRENT, Crosshair.AttachedBox.Point2.X, Crosshair.AttachedBox.Point2.Y, - abs(wy), - abs(wy), + labs(wy), + labs(wy), sa, dir, conf_core.design.line_thickness, Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 2393) +++ trunk/src/crosshair.c (revision 2394) @@ -152,11 +152,11 @@ return; arc.X = Crosshair.AttachedBox.Point1.X; arc.Y = Crosshair.AttachedBox.Point1.Y; - if (XOR(Crosshair.AttachedBox.otherway, abs(wy) > abs(wx))) { - arc.X = Crosshair.AttachedBox.Point1.X + abs(wy) * SGNZ(wx); + if (XOR(Crosshair.AttachedBox.otherway, labs(wy) > labs(wx))) { + arc.X = Crosshair.AttachedBox.Point1.X + labs(wy) * SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 - if (abs(wy) >= 2 * abs(wx)) + if (labs(wy) >= 2 * labs(wx)) dir = (SGNZ(wx) == SGNZ(wy)) ? 45 : -45; else #endif @@ -163,10 +163,10 @@ dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90; } else { - arc.Y = Crosshair.AttachedBox.Point1.Y + abs(wx) * SGNZ(wy); + arc.Y = Crosshair.AttachedBox.Point1.Y + labs(wx) * SGNZ(wy); sa = (wy >= 0) ? -90 : 90; #ifdef ARC45 - if (abs(wx) >= 2 * abs(wy)) + if (labs(wx) >= 2 * labs(wy)) dir = (SGNZ(wx) == SGNZ(wy)) ? -45 : 45; else #endif @@ -173,7 +173,7 @@ dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90; wy = wx; } - wy = abs(wy); + wy = labs(wy); arc.StartAngle = sa; arc.Delta = dir; arc.Width = arc.Height = wy; @@ -204,7 +204,7 @@ ox = dy * h + 0.5 * SGN(dy); oy = -(dx * h + 0.5 * SGN(dx)); gui->draw_line(Crosshair.GC, x1 + ox, y1 + oy, x2 + ox, y2 + oy); - if (abs(ox) >= pixel_slop || abs(oy) >= pixel_slop) { + if (labs(ox) >= pixel_slop || labs(oy) >= pixel_slop) { Angle angle = atan2(dx, dy) * 57.295779; gui->draw_line(Crosshair.GC, x1 - ox, y1 - oy, x2 - ox, y2 - oy); gui->draw_arc(Crosshair.GC, x1, y1, thick / 2, thick / 2, angle - 180, 180); @@ -743,7 +743,7 @@ } } -#define close_enough(v1, v2) (fabs((v1)-(v2)) < 10) +#define close_enough(v1, v2) (labs((v1)-(v2)) < 10) static int onpoint_arc_callback(const BoxType * box, void *cl) { Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 2393) +++ trunk/src/hid_draw_helpers.c (revision 2394) @@ -230,7 +230,7 @@ gui->draw_line(gc, x1 + ox, y1 + oy, x2 + ox, y2 + oy); - if (abs(ox) >= pixel_slop || abs(oy) >= pixel_slop) { + if (labs(ox) >= pixel_slop || labs(oy) >= pixel_slop) { Angle angle = atan2(dx, dy) * 57.295779; gui->draw_line(gc, x1 - ox, y1 - oy, x2 - ox, y2 - oy); gui->draw_arc(gc, x1, y1, t, t, angle - 180, 180); Index: trunk/src/line.c =================================================================== --- trunk/src/line.c (revision 2393) +++ trunk/src/line.c (revision 2394) @@ -111,8 +111,8 @@ if (dx < 0) direction += 4; - dx = abs(dx); - dy = abs(dy); + dx = labs(dx); + dy = labs(dy); min = MIN(dx, dy); /* now set up the second pair of coordinates */ @@ -179,23 +179,23 @@ dx = Crosshair.X - line->Point1.X; dy = Crosshair.Y - line->Point1.Y; if (!way) { - if (abs(dx) > abs(dy)) { - line->Point2.X = Crosshair.X - SGN(dx) * abs(dy); + if (labs(dx) > labs(dy)) { + line->Point2.X = Crosshair.X - SGN(dx) * labs(dy); line->Point2.Y = line->Point1.Y; } else { line->Point2.X = line->Point1.X; - line->Point2.Y = Crosshair.Y - SGN(dy) * abs(dx); + line->Point2.Y = Crosshair.Y - SGN(dy) * labs(dx); } } else { - if (abs(dx) > abs(dy)) { - line->Point2.X = line->Point1.X + SGN(dx) * abs(dy); + if (labs(dx) > labs(dy)) { + line->Point2.X = line->Point1.X + SGN(dx) * labs(dy); line->Point2.Y = Crosshair.Y; } else { line->Point2.X = Crosshair.X; - line->Point2.Y = line->Point1.Y + SGN(dy) * abs(dx);; + line->Point2.Y = line->Point1.Y + SGN(dy) * labs(dx);; } } } @@ -278,13 +278,13 @@ line1.Point1.Y = Crosshair.AttachedLine.Point1.Y; dy = end->Y - line1.Point1.Y; dx = end->X - line1.Point1.X; - if (abs(dx) > abs(dy)) { + if (labs(dx) > labs(dy)) { x_is_long = true; - length = abs(dx); + length = labs(dx); } else { x_is_long = false; - length = abs(dy); + length = labs(dy); } group = GetGroupOfLayer(INDEXOFCURRENT); comp = max_group + 10; /* this out-of-range group might save a call */ @@ -304,12 +304,12 @@ if (x_is_long) { dx = SGN(dx) * length; dy = end->Y - line1.Point1.Y; - length2 = abs(dy); + length2 = labs(dy); } else { dy = SGN(dy) * length; dx = end->X - line1.Point1.X; - length2 = abs(dx); + length2 = labs(dx); } temp2 = length2; f2 = 1.0; @@ -322,24 +322,24 @@ else dx = SGN(dx) * length2; two_lines = true; - if (abs(dx) > abs(dy) && x_is_long) { - line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * abs(dy) : dx - SGN(dx) * abs(dy)); + if (labs(dx) > labs(dy) && x_is_long) { + line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * labs(dy) : dx - SGN(dx) * labs(dy)); line1.Point2.Y = line1.Point1.Y + (way ? dy : 0); } - else if (abs(dy) >= abs(dx) && !x_is_long) { + else if (labs(dy) >= labs(dx) && !x_is_long) { line1.Point2.X = line1.Point1.X + (way ? dx : 0); - line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * abs(dx) : dy - SGN(dy) * abs(dx)); + line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * labs(dx) : dy - SGN(dy) * labs(dx)); } else if (x_is_long) { /* we've changed which axis is long, so only do one line */ line1.Point2.X = line1.Point1.X + dx; - line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * abs(dx) : 0); + line1.Point2.Y = line1.Point1.Y + (way ? SGN(dy) * labs(dx) : 0); two_lines = false; } else { /* we've changed which axis is long, so only do one line */ line1.Point2.Y = line1.Point1.Y + dy; - line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * abs(dy) : 0); + line1.Point2.X = line1.Point1.X + (way ? SGN(dx) * labs(dy) : 0); two_lines = false; } line2.Point1.X = line1.Point2.X; Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 2393) +++ trunk/src/misc.c (revision 2394) @@ -1763,7 +1763,7 @@ else return 0; - if (abs(dx) > abs(dy)) + if (labs(dx) > labs(dy)) return dx > 0 ? 0 : 2; return dy > 0 ? 3 : 1; } Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 2393) +++ trunk/src/polygon.c (revision 2394) @@ -1306,8 +1306,8 @@ if (!conf_core.editor.all_direction_lines) { Coord dx, dy; - dx = abs(Crosshair.AttachedPolygon.Points[n - 1].X - Crosshair.AttachedPolygon.Points[0].X); - dy = abs(Crosshair.AttachedPolygon.Points[n - 1].Y - Crosshair.AttachedPolygon.Points[0].Y); + dx = labs(Crosshair.AttachedPolygon.Points[n - 1].X - Crosshair.AttachedPolygon.Points[0].X); + dy = labs(Crosshair.AttachedPolygon.Points[n - 1].Y - Crosshair.AttachedPolygon.Points[0].Y); if (!(dx == 0 || dy == 0 || dx == dy)) { Message(_("Cannot close polygon because 45 degree lines are requested.\n")); return; Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 2393) +++ trunk/src/rubberband.c (revision 2394) @@ -112,9 +112,9 @@ * circle to the corners of the rectangle since the * closest part of the rectangular region is the corner. */ - x = MIN(abs(i->box.X1 - line->Point1.X), abs(i->box.X2 - line->Point1.X)); + x = MIN(labs(i->box.X1 - line->Point1.X), labs(i->box.X2 - line->Point1.X)); x *= x; - y = MIN(abs(i->box.Y1 - line->Point1.Y), abs(i->box.Y2 - line->Point1.Y)); + y = MIN(labs(i->box.Y1 - line->Point1.Y), labs(i->box.Y2 - line->Point1.Y)); y *= y; x = x + y - (t * t); @@ -133,9 +133,9 @@ touches = 1; } else { - x = MIN(abs(i->box.X1 - line->Point2.X), abs(i->box.X2 - line->Point2.X)); + x = MIN(labs(i->box.X1 - line->Point2.X), labs(i->box.X2 - line->Point2.X)); x *= x; - y = MIN(abs(i->box.Y1 - line->Point2.Y), abs(i->box.Y2 - line->Point2.Y)); + y = MIN(labs(i->box.Y1 - line->Point2.Y), labs(i->box.Y2 - line->Point2.Y)); y *= y; x = x + y - (t * t); Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 2393) +++ trunk/src_plugins/autoplace/autoplace.c (revision 2394) @@ -423,11 +423,11 @@ if (lastbox != NULL && ((lastbox->X1 == box->X1 && lastbox->X2 == box->X2 && - MIN(abs(lastbox->Y1 - box->Y2), - abs(box->Y1 - lastbox->Y2)) < + MIN(labs(lastbox->Y1 - box->Y2), + labs(box->Y1 - lastbox->Y2)) < clearance) || (lastbox->Y1 == box->Y1 && lastbox->Y2 == box->Y2 - && MIN(abs(lastbox->X1 - box->X2), abs(box->X1 - lastbox->X2)) < clearance))) { + && MIN(labs(lastbox->X1 - box->X2), labs(box->X1 - lastbox->X2)) < clearance))) { EXPANDRECT(lastbox, box); otherside->BoxN--; } Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 2393) +++ trunk/src_plugins/autoroute/autoroute.c (revision 2394) @@ -1254,11 +1254,11 @@ return true; } else if (target->type == PAD) { - if (abs(target->parent.pad->Point1.X - nextpoint->X) < abs(target->parent.pad->Point2.X - nextpoint->X)) + if (labs(target->parent.pad->Point1.X - nextpoint->X) < labs(target->parent.pad->Point2.X - nextpoint->X)) nextpoint->X = target->parent.pad->Point1.X; else nextpoint->X = target->parent.pad->Point2.X; - if (abs(target->parent.pad->Point1.Y - nextpoint->Y) < abs(target->parent.pad->Point2.Y - nextpoint->Y)) + if (labs(target->parent.pad->Point1.Y - nextpoint->Y) < labs(target->parent.pad->Point2.Y - nextpoint->Y)) nextpoint->Y = target->parent.pad->Point1.Y; else nextpoint->Y = target->parent.pad->Point2.Y; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 2393) +++ trunk/src_plugins/export_gerber/gerber.c (revision 2394) @@ -1021,7 +1021,7 @@ step = acos((double) minr / (double) max) * 180.0 / M_PI; if (step > 5) step = 5; - nsteps = abs(delta_angle) / step + 1; + nsteps = fabs(delta_angle) / step + 1; step = (double) delta_angle / nsteps; x0 = arcStartX; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 2393) +++ trunk/src_plugins/report/report.c (revision 2394) @@ -538,7 +538,7 @@ if (TEST_FLAG(FOUNDFLAG, arc)) { double l; /* FIXME: we assume width==height here */ - l = M_PI * 2 * arc->Width * abs(arc->Delta) / 360.0; + l = M_PI * 2 * arc->Width * fabs(arc->Delta) / 360.0; length += l; *found = 1; }