Index: ipcd356.c =================================================================== --- ipcd356.c (revision 16421) +++ ipcd356.c (revision 16422) @@ -43,10 +43,10 @@ static const char *ipcd356_cookie = "ipcd356 importer"; -static void set_src(pcb_attribute_list_t *a, const char *fn, int lineno) +static void set_src(pcb_attribute_list_t *a, const char *fn, long lineno) { char src[8192]; - pcb_snprintf(src, sizeof(src), "ipcd356::%s:%d", fn, lineno); + pcb_snprintf(src, sizeof(src), "ipcd356::%s:%ld", fn, lineno); pcb_attribute_put(a, "source", src); } @@ -101,14 +101,14 @@ pcb_coord_t hole, width, height, cx, cy; } test_feature_t; -static int parse_feature(char *line, test_feature_t *tf, const char *fn, int lineno, int is_mil, int is_rad, char *netname, char *refdes, char *term) +static int parse_feature(char *line, test_feature_t *tf, const char *fn, long lineno, int is_mil, int is_rad, char *netname, char *refdes, char *term) { if (line[2] != '7') { - pcb_message(PCB_MSG_WARNING, "Ignoring unknown test feautre '3%c%c' in %s:%d' - does not end in 7\n", line[1], line[2], fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring unknown test feautre '3%c%c' in %s:%ld' - does not end in 7\n", line[1], line[2], fn, lineno); return -1; } if (line[26] != '-') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing dash between refdes and pin number\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing dash between refdes and pin number\n", fn, lineno); return -1; } extract_field(netname, line, 3, 16); @@ -118,7 +118,7 @@ tf->is_middle = (line[31] == 'M'); if (line[32] == 'D') { if (extract_dim(&tf->hole, line, 33, 36, 0, is_mil)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid hole dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid hole dimension\n", fn, lineno); return -1; } if (line[37] == 'P') @@ -126,7 +126,7 @@ else if (line[37] == 'U') tf->is_plated = 0; else { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - hole is neither plated nor unplated\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - hole is neither plated nor unplated\n", fn, lineno); return -1; } } @@ -135,59 +135,59 @@ tf->is_plated = 0; } if (line[38] != 'A') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing 'A' for access\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing 'A' for access\n", fn, lineno); return -1; } if (extract_int(&tf->side, line, 40, 41)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid hole dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid hole dimension\n", fn, lineno); return -1; } if (line[41] != 'X') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing 'X'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing 'X'\n", fn, lineno); return -1; } if (extract_dim(&tf->cx, line, 42, 48, 1, is_mil)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid X dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid X dimension\n", fn, lineno); return -1; } if (line[49] != 'Y') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing 'Y'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing 'Y'\n", fn, lineno); return -1; } if (extract_dim(&tf->cy, line, 50, 56, 1, is_mil)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid Y dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid Y dimension\n", fn, lineno); return -1; } if (line[57] != 'X') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing width 'X'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing width 'X'\n", fn, lineno); return -1; } if (extract_dim(&tf->width, line, 58, 61, 0, is_mil)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid width dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid width dimension\n", fn, lineno); return -1; } if (line[62] != 'Y') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing height 'Y'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing height 'Y'\n", fn, lineno); return -1; } if (extract_dim(&tf->height, line, 63, 66, 0, is_mil)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid height 'Y' dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid height 'Y' dimension\n", fn, lineno); return -1; } if (line[67] != 'R') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - missing rotation 'R'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - missing rotation 'R'\n", fn, lineno); return -1; } if (extract_int(&tf->rot, line, 68, 70)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid height 'Y' dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid height 'Y' dimension\n", fn, lineno); return -1; } if (line[72] != 'S') { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - solder mask marker 'S'\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - solder mask marker 'S'\n", fn, lineno); return -1; } if (extract_int(&tf->mask, line, 73, 73)) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - invalid height 'Y' dimension\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - invalid height 'Y' dimension\n", fn, lineno); return -1; } tf->is_tooling = 0; @@ -198,18 +198,18 @@ tf->is_tooling = 1; case '1': /* through hole */ if (tf->hole == 0) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - thru-hole feature without hole dia\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - thru-hole feature without hole dia\n", fn, lineno); return -1; } break; case '2': /* SMT feature */ if (tf->hole > 0) { - pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%d' - SMD feature with hole dia\n", fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring invalid test feautre in %s:%ld' - SMD feature with hole dia\n", fn, lineno); break; } break; default: - pcb_message(PCB_MSG_WARNING, "Ignoring unknown test feautre '3%c%c' in %s:%d - unknown second digit'\n", line[1], line[2], fn, lineno); + pcb_message(PCB_MSG_WARNING, "Ignoring unknown test feautre '3%c%c' in %s:%ld - unknown second digit'\n", line[1], line[2], fn, lineno); } return 0; } @@ -221,7 +221,8 @@ static int ipc356_parse(pcb_board_t *pcb, FILE *f, const char *fn, htsp_t *subcs) { char line_[128], *line, netname[16], refdes[8], term[8]; - int lineno = 0, is_mil = 1, is_rad = 0; + long lineno = 0; + int is_mil = 1, is_rad = 0; test_feature_t tf; pcb_subc_t *sc; pcb_data_t *data = pcb->Data; @@ -241,7 +242,7 @@ case '2': is_mil = 1; is_rad = 1; break; } if (is_rad) { - pcb_message(PCB_MSG_ERROR, "Unimplemented unit in %s:%d - requested radians in rotation, the code doesn't handle that\n", fn, lineno); + pcb_message(PCB_MSG_ERROR, "Unimplemented unit in %s:%ld - requested radians in rotation, the code doesn't handle that\n", fn, lineno); return 1; } } @@ -269,7 +270,7 @@ case '9': /* EOF */ if ((line[1] == '9') && (line[2] == '9')) return 0; - pcb_message(PCB_MSG_ERROR, "Invalid end-of-file marker in %s:%d - expected '999'\n", fn, lineno); + pcb_message(PCB_MSG_ERROR, "Invalid end-of-file marker in %s:%ld - expected '999'\n", fn, lineno); return 1; } }