Index: centgeo.c =================================================================== --- centgeo.c (revision 30902) +++ centgeo.c (revision 30903) @@ -117,7 +117,7 @@ return 0; } -void pcb_cline_offs(pcb_line_t *line, double offs, pcb_coord_t *dstx, pcb_coord_t *dsty) +void pcb_cline_offs(pcb_line_t *line, double offs, rnd_coord_t *dstx, rnd_coord_t *dsty) { double line_dx, line_dy; @@ -128,7 +128,7 @@ *dsty = pcb_round((double)line->Point1.Y + offs * line_dy); } -double pcb_cline_pt_offs(pcb_line_t *line, pcb_coord_t px, pcb_coord_t py) +double pcb_cline_pt_offs(pcb_line_t *line, rnd_coord_t px, rnd_coord_t py) { double line_dx, line_dy, pt_dx, pt_dy; @@ -141,7 +141,7 @@ return (line_dx * pt_dx + line_dy * pt_dy) / (line_dx*line_dx + line_dy*line_dy); } -static int line_ep(pcb_line_t *line, pcb_coord_t x, pcb_coord_t y) +static int line_ep(pcb_line_t *line, rnd_coord_t x, rnd_coord_t y) { if ((line->Point1.X == x) && (line->Point1.Y == y)) return 1; if ((line->Point2.X == x) && (line->Point2.Y == y)) return 1; @@ -173,7 +173,7 @@ static int intersect_cline_carc(pcb_line_t *Line, pcb_arc_t *Arc, pcb_box_t *ip, double offs[2], int oline) { double dx, dy, dx1, dy1, l, d, r, r2, Radius; - pcb_coord_t ex, ey, ix, iy; + rnd_coord_t ex, ey, ix, iy; int found = 0; dx = Line->Point2.X - Line->Point1.X; @@ -271,7 +271,7 @@ } -void pcb_carc_offs(pcb_arc_t *arc, double offs, pcb_coord_t *dstx, pcb_coord_t *dsty) +void pcb_carc_offs(pcb_arc_t *arc, double offs, rnd_coord_t *dstx, rnd_coord_t *dsty) { double ang = (arc->StartAngle + offs * arc->Delta) / PCB_RAD_TO_DEG; @@ -279,7 +279,7 @@ *dsty = arc->Y - sin(ang) * arc->Height; } -double pcb_carc_pt_offs(pcb_arc_t *arc, pcb_coord_t px, pcb_coord_t py) +double pcb_carc_pt_offs(pcb_arc_t *arc, rnd_coord_t px, rnd_coord_t py) { double dx, dy, ang, end; @@ -311,7 +311,7 @@ } -static void get_arc_ends(pcb_coord_t *box, pcb_arc_t *arc) +static void get_arc_ends(rnd_coord_t *box, pcb_arc_t *arc) { box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle); box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle); @@ -347,8 +347,8 @@ int pcb_intersect_carc_carc(pcb_arc_t *Arc1, pcb_arc_t *Arc2, pcb_box_t *ip, double offs[2]) { double x, y, dx, dy, r1, r2, a, d, l, dl; - pcb_coord_t pdx, pdy; - pcb_coord_t box[8]; + rnd_coord_t pdx, pdy; + rnd_coord_t box[8]; int found = 0; /* try the end points first */ Index: centgeo.h =================================================================== --- centgeo.h (revision 30902) +++ centgeo.h (revision 30903) @@ -30,12 +30,12 @@ /* Calculate the point on an object corresponding to a [0..1] offset and store the result in dstx;dsty. */ -void pcb_cline_offs(pcb_line_t *line, double offs, pcb_coord_t *dstx, pcb_coord_t *dsty); -void pcb_carc_offs(pcb_arc_t *arc, double offs, pcb_coord_t *dstx, pcb_coord_t *dsty); +void pcb_cline_offs(pcb_line_t *line, double offs, rnd_coord_t *dstx, rnd_coord_t *dsty); +void pcb_carc_offs(pcb_arc_t *arc, double offs, rnd_coord_t *dstx, rnd_coord_t *dsty); /* Project a point (px;py) onto an object and return the offset from point1 */ -double pcb_cline_pt_offs(pcb_line_t *line, pcb_coord_t px, pcb_coord_t py); -double pcb_carc_pt_offs(pcb_arc_t *arc, pcb_coord_t px, pcb_coord_t py); +double pcb_cline_pt_offs(pcb_line_t *line, rnd_coord_t px, rnd_coord_t py); +double pcb_carc_pt_offs(pcb_arc_t *arc, rnd_coord_t px, rnd_coord_t py); #endif Index: cli.c =================================================================== --- cli.c (revision 30902) +++ cli.c (revision 30903) @@ -96,7 +96,7 @@ int begin, end; /* cursor pos */ int invalid; - pcb_coord_t x, y, dist; + rnd_coord_t x, y, dist; pcb_angle_t angle, offs; pcb_cardinal_t id; }; @@ -151,7 +151,7 @@ char tmp[128]; char *sep, *s = strchr(line, ' '), *next; /* skip the instruction */ int i; - pcb_bool succ; + rnd_bool succ; if (s == NULL) return 0; @@ -278,11 +278,11 @@ return from + inslen + extra; } -static int cli_apply_coord(cli_node_t *argv, int start, int end, pcb_coord_t *ox, pcb_coord_t *oy, int annot) +static int cli_apply_coord(cli_node_t *argv, int start, int end, rnd_coord_t *ox, rnd_coord_t *oy, int annot) { int n, relative = 0, have_angle = 0, have_dist = 0, len = (start > 1); double angle = 0, dist = 0, lx, ly, x = *ox, y = *oy; - pcb_coord_t tx, ty; + rnd_coord_t tx, ty; for(n = start; n < end; n++) { int moved = 0; @@ -355,13 +355,13 @@ break; case CLI_PERP: - pcb_message(PCB_MSG_ERROR, "perp not yet implemented\n"); + rnd_message(PCB_MSG_ERROR, "perp not yet implemented\n"); return -1; case CLI_PARAL: - pcb_message(PCB_MSG_ERROR, "paral not yet implemented\n"); + rnd_message(PCB_MSG_ERROR, "paral not yet implemented\n"); return -1; case CLI_TANGENT: - pcb_message(PCB_MSG_ERROR, "tangent not yet implemented\n"); + rnd_message(PCB_MSG_ERROR, "tangent not yet implemented\n"); return -1; case CLI_CENTER: @@ -425,7 +425,7 @@ if (moved) { if ((annot) && (len > 0)) { - pcb_coord_t *c = vtc0_alloc_append(&pcb_ddraft_attached.annot_lines, 4); + rnd_coord_t *c = vtc0_alloc_append(&pcb_ddraft_attached.annot_lines, 4); c[0] = pcb_round(lx); c[1] = pcb_round(ly); c[2] = pcb_round(x); @@ -550,7 +550,7 @@ opp = find_op(op, oplen); if (opp == NULL) { if (strcmp(cmd, "/edit") != 0) - pcb_message(PCB_MSG_ERROR, "ddraft: unknown operator '%s'\n", op); + rnd_message(PCB_MSG_ERROR, "ddraft: unknown operator '%s'\n", op); RND_ACT_IRES(-1); goto ret0; } Index: cli_line.c =================================================================== --- cli_line.c (revision 30902) +++ cli_line.c (revision 30903) @@ -5,18 +5,18 @@ if (argv[n].type == CLI_FROM) n++; else if (argv[n].type == CLI_TO) { - pcb_message(PCB_MSG_ERROR, "Incremental line drawing is not yet supported\n"); + rnd_message(PCB_MSG_ERROR, "Incremental line drawing is not yet supported\n"); return -1; } n = cli_apply_coord(argv, n, argc, &box->X1, &box->Y1, annot); if (n < 0) { if (verbose) - pcb_message(PCB_MSG_ERROR, "Invalid 'from' coord\n"); + rnd_message(PCB_MSG_ERROR, "Invalid 'from' coord\n"); return -1; } if (argv[n].type != CLI_TO) { if (verbose) - pcb_message(PCB_MSG_ERROR, "Missing 'to'\n"); + rnd_message(PCB_MSG_ERROR, "Missing 'to'\n"); return -1; } n++; @@ -25,12 +25,12 @@ n = cli_apply_coord(argv, n, argc, &box->X2, &box->Y2, annot); if (n < 0) { if (verbose) - pcb_message(PCB_MSG_ERROR, "Invalid 'to' coord\n"); + rnd_message(PCB_MSG_ERROR, "Invalid 'to' coord\n"); return -1; } if (n != argc) { if (verbose) - pcb_message(PCB_MSG_ERROR, "Excess tokens after the to coord\n"); + rnd_message(PCB_MSG_ERROR, "Excess tokens after the to coord\n"); return -1; } return 0; @@ -79,7 +79,7 @@ return res; } -static int get_rel_coord(int argc, cli_node_t *argv, int argn, pcb_coord_t *ox, pcb_coord_t *oy) +static int get_rel_coord(int argc, cli_node_t *argv, int argn, rnd_coord_t *ox, rnd_coord_t *oy) { int nto, res; @@ -106,7 +106,7 @@ { int argn = cli_cursor_arg(argc, argv, cursor); int replace = 0, by, res; - pcb_coord_t ox, oy; + rnd_coord_t ox, oy; char buff[CLI_MAX_INS_LEN]; pcb_trace("line c: '%s':%d (argn=%d)\n", line, cursor, argn); @@ -148,7 +148,7 @@ case CLI_RELATIVE: res = get_rel_coord(argc, argv, argn, &ox, &oy); if (res < 0) { - pcb_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); + rnd_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); return 0; } pcb_trace("rel from %$mm,%$mm", ox, oy); @@ -162,7 +162,7 @@ case CLI_ANGLE: res = get_rel_coord(argc, argv, argn, &ox, &oy); if (res < 0) { - pcb_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); + rnd_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); return 0; } replace=1; @@ -171,7 +171,7 @@ case CLI_DIST: res = get_rel_coord(argc, argv, argn, &ox, &oy); if (res < 0) { - pcb_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); + rnd_message(PCB_MSG_ERROR, "Failed to interpret coords already entered\n"); return 0; } replace=1; Index: constraint.c =================================================================== --- constraint.c (revision 30902) +++ constraint.c (revision 30903) @@ -32,9 +32,9 @@ typedef struct { double line_angle[32], move_angle[32]; - pcb_coord_t line_length[32], move_length[32]; + rnd_coord_t line_length[32], move_length[32]; double line_angle_mod, move_angle_mod; - pcb_coord_t line_length_mod, move_length_mod; + rnd_coord_t line_length_mod, move_length_mod; int line_angle_len, line_length_len, move_angle_len, move_length_len; } ddraft_cnst_t; @@ -41,7 +41,7 @@ static ddraft_cnst_t cons; -static int find_best_angle(double *out_ang, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, double *angles, int anglen, double angle_mod) +static int find_best_angle(double *out_ang, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2, double *angles, int anglen, double angle_mod) { double diff, ang, best_diff, target_ang; int n, best; @@ -78,7 +78,7 @@ return 0; } -static int find_best_length(double *out_len, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t *lengths, int lengthlen, pcb_coord_t length_mod) +static int find_best_length(double *out_len, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2, rnd_coord_t *lengths, int lengthlen, rnd_coord_t length_mod) { double len, best_diff, diff, target_len; int n, best; Index: constraint_gui.c =================================================================== --- constraint_gui.c (revision 30902) +++ constraint_gui.c (revision 30903) @@ -125,7 +125,7 @@ static void gui2cons(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { char *end, buff[1024]; - pcb_bool succ; + rnd_bool succ; g2c_array(line_angle, strtod(curr, &end)); g2c_scalar(line_angle_mod, dbl); Index: ddraft.c =================================================================== --- ddraft.c (revision 30902) +++ ddraft.c (revision 30903) @@ -90,7 +90,7 @@ { pcb_objtype_t type; void *ptr1, *ptr2, *ptr3; - pcb_coord_t x, y; + rnd_coord_t x, y; long res = 0; switch(kwobj) { @@ -103,7 +103,7 @@ type = pcb_search_screen(x, y, CUT_TYPES, &ptr1, &ptr2, &ptr3); if (type == 0) { - pcb_message(PCB_MSG_ERROR, "Can't cut that object\n"); + rnd_message(PCB_MSG_ERROR, "Can't cut that object\n"); continue; } res += pcb_trim_split(edges, NULL, (pcb_any_obj_t *)ptr2, REMO_INVALID, x, y, trim); @@ -111,7 +111,7 @@ } break; default: - pcb_message(PCB_MSG_ERROR, "Invalid second argument\n"); + rnd_message(PCB_MSG_ERROR, "Invalid second argument\n"); return -1; } @@ -126,7 +126,7 @@ int kwcut = F_Object, kwobj = F_Object; pcb_objtype_t type; void *ptr1, *ptr2, *ptr3; - pcb_coord_t x, y; + rnd_coord_t x, y; vtp0_t edges; rnd_PCB_ACT_MAY_CONVARG(1, FGW_KEYWORD, trim_split, kwcut = fgw_keyword(&argv[1])); @@ -135,7 +135,7 @@ vtp0_init(&edges); if ((kwobj == kwcut) && (kwobj != F_Object)) { - pcb_message(PCB_MSG_ERROR, "Both cutting edge and objects to cut can't be '%s'\n", kwcut == F_Selected ? "selected" : "found"); + rnd_message(PCB_MSG_ERROR, "Both cutting edge and objects to cut can't be '%s'\n", kwcut == F_Selected ? "selected" : "found"); goto err; } @@ -144,7 +144,7 @@ rnd_hid_get_coords("Select cutting edge object", &x, &y, 0); type = pcb_search_screen(x, y, EDGE_TYPES, &ptr1, &ptr2, &ptr3); if (type == 0) { - pcb_message(PCB_MSG_ERROR, "Invalid cutting edge object\n"); + rnd_message(PCB_MSG_ERROR, "Invalid cutting edge object\n"); goto err; } vtp0_append(&edges, ptr2); @@ -156,12 +156,12 @@ list_by_flag(PCB->Data, &edges, EDGE_TYPES, PCB_FLAG_FOUND); break; default: - pcb_message(PCB_MSG_ERROR, "Invalid first argument\n"); + rnd_message(PCB_MSG_ERROR, "Invalid first argument\n"); goto err; } if (vtp0_len(&edges) < 1) { - pcb_message(PCB_MSG_ERROR, "No cutting edge found\n"); + rnd_message(PCB_MSG_ERROR, "No cutting edge found\n"); goto err; } @@ -253,7 +253,7 @@ do { \ int n; \ if (argc-2 >= sizeof(arr) / sizeof(arr[0])) { \ - pcb_message(PCB_MSG_ERROR, "constraint: Too many " msg "\n"); \ + rnd_message(PCB_MSG_ERROR, "constraint: Too many " msg "\n"); \ RND_ACT_IRES(-1); \ return 0; \ } \ @@ -320,7 +320,7 @@ cons_changed(); break; case ddraft_fields_SPHASH_INVALID: - pcb_message(PCB_MSG_ERROR, "constraint: invalid field '%s'\n", stype); + rnd_message(PCB_MSG_ERROR, "constraint: invalid field '%s'\n", stype); RND_ACT_IRES(-1); return 0; break; @@ -337,7 +337,7 @@ const char *actname = argv[0].val.func->name; pcb_objtype_t type; void *ptr1, *ptr2, *ptr3; - pcb_coord_t x, y; + rnd_coord_t x, y; double dx, dy; pcb_line_t *line; @@ -350,7 +350,7 @@ } if (type != PCB_OBJ_LINE) { - pcb_message(PCB_MSG_ERROR, "%s: target object must be a line\n", actname); + rnd_message(PCB_MSG_ERROR, "%s: target object must be a line\n", actname); RND_ACT_IRES(-1); return 0; } @@ -359,7 +359,7 @@ dx = line->Point2.X - line->Point1.X; dy = line->Point2.Y - line->Point1.Y; if ((dx == 0.0) && (dy == 0.0)) { - pcb_message(PCB_MSG_ERROR, "%s: target line must be longer than 0\n", actname); + rnd_message(PCB_MSG_ERROR, "%s: target line must be longer than 0\n", actname); RND_ACT_IRES(-1); return 0; } @@ -382,7 +382,7 @@ { pcb_objtype_t type; void *ptr1, *ptr2, *ptr3; - pcb_coord_t x, y; + rnd_coord_t x, y; double d, r, base; pcb_route_object_t *line; pcb_arc_t *arc; @@ -390,7 +390,7 @@ if (((pcb_crosshair.AttachedLine.State != PCB_CH_STATE_SECOND) && (pcb_crosshair.AttachedLine.State != PCB_CH_STATE_THIRD)) || (pcb_crosshair.Route.size < 1)) { err_nonline:; - pcb_message(PCB_MSG_ERROR, "tang: must be in line drawing mode with the first point already set\n"); + rnd_message(PCB_MSG_ERROR, "tang: must be in line drawing mode with the first point already set\n"); RND_ACT_IRES(-1); return 0; } @@ -409,7 +409,7 @@ } if (type != PCB_OBJ_ARC) { - pcb_message(PCB_MSG_ERROR, "tang: target object must be an arc\n"); + rnd_message(PCB_MSG_ERROR, "tang: target object must be an arc\n"); RND_ACT_IRES(-1); return 0; } @@ -416,7 +416,7 @@ arc = (pcb_arc_t *)ptr2; if (fabs((double)(arc->Height - arc->Width)) > 100) { - pcb_message(PCB_MSG_ERROR, "tang: elliptical arcs are not supported (%$mm != %$mm)\n", arc->Height, arc->Width); + rnd_message(PCB_MSG_ERROR, "tang: elliptical arcs are not supported (%$mm != %$mm)\n", arc->Height, arc->Width); RND_ACT_IRES(-1); return 0; } @@ -425,7 +425,7 @@ r = arc->Width; if (d <= r) { - pcb_message(PCB_MSG_ERROR, "tang: line must start outside of the circle\n"); + rnd_message(PCB_MSG_ERROR, "tang: line must start outside of the circle\n"); RND_ACT_IRES(-1); return 0; } @@ -448,7 +448,7 @@ pcb_render->set_line_width(pcb_crosshair.GC, 1); pcb_render->set_color(pcb_crosshair.GC, pcb_color_grey33); for(n = 0; n < vtc0_len(&pcb_ddraft_attached.annot_lines); n += 4) { - pcb_coord_t *c = &pcb_ddraft_attached.annot_lines.array[n]; + rnd_coord_t *c = &pcb_ddraft_attached.annot_lines.array[n]; pcb_render->draw_line(pcb_crosshair.GC, c[0], c[1], c[2], c[3]); } Index: trim.c =================================================================== --- trim.c (revision 30902) +++ trim.c (revision 30903) @@ -32,7 +32,7 @@ #define remo_is_valid(v) ((v) > REMO_INVALID) /* Move a line endpoint to a new absoltue coord in an undoable way */ -static void move_lp(pcb_line_t *line, int pt_idx, pcb_coord_t x, pcb_coord_t y) +static void move_lp(pcb_line_t *line, int pt_idx, rnd_coord_t x, rnd_coord_t y) { pcb_point_t *pt; @@ -59,12 +59,12 @@ mino = 1.0; \ } while(0) -static int pcb_trim_line(vtp0_t *cut_edges, pcb_line_t *line, double remo_in, pcb_coord_t rem_x, pcb_coord_t rem_y) +static int pcb_trim_line(vtp0_t *cut_edges, pcb_line_t *line, double remo_in, rnd_coord_t rem_x, rnd_coord_t rem_y) { int p, n; double io[2]; double mino = 0.0, maxo = 1.0, remo = remo_in; - pcb_coord_t x, y; + rnd_coord_t x, y; if (!remo_is_valid(remo)) remo = pcb_cline_pt_offs(line, rem_x, rem_y); @@ -158,7 +158,7 @@ } -static int pcb_trim_arc(vtp0_t *cut_edges, pcb_arc_t *arc, double remo_in, pcb_coord_t rem_x, pcb_coord_t rem_y) +static int pcb_trim_arc(vtp0_t *cut_edges, pcb_arc_t *arc, double remo_in, rnd_coord_t rem_x, rnd_coord_t rem_y) { int p, n; double io[2]; @@ -233,7 +233,7 @@ /* Split a line in two lines at a specific offset (undoable) */ static pcb_line_t *split_lp(pcb_line_t *line, double offs) { - pcb_coord_t x, y; + rnd_coord_t x, y; pcb_line_t *new_line = pcb_line_dup(line->parent.layer, line); pcb_undo_add_obj_to_create(PCB_OBJ_LINE, new_line->parent.layer, new_line, new_line); @@ -265,7 +265,7 @@ return (v1 < 0.0001); } -static int pcb_split_line(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_line_t *line, double remo_in, pcb_coord_t rem_x, pcb_coord_t rem_y) +static int pcb_split_line(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_line_t *line, double remo_in, rnd_coord_t rem_x, rnd_coord_t rem_y) { int p, n, numsplt = 0, res; double io[2]; @@ -313,7 +313,7 @@ return numsplt; } -static int pcb_split_arc(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_arc_t *arc, double remo_in, pcb_coord_t rem_x, pcb_coord_t rem_y) +static int pcb_split_arc(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_arc_t *arc, double remo_in, rnd_coord_t rem_x, rnd_coord_t rem_y) { int p, n, numsplt = 0, res; double io[2]; @@ -361,7 +361,7 @@ return numsplt; } -int pcb_trim_split(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_any_obj_t *obj, double remo, pcb_coord_t rem_x, pcb_coord_t rem_y, int trim) +int pcb_trim_split(vtp0_t *cut_edges, vtp0_t *new_objs, pcb_any_obj_t *obj, double remo, rnd_coord_t rem_x, rnd_coord_t rem_y, int trim) { int res = 0; switch(obj->type) {