1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-23 05:31:10 +02:00

cameo: changed dog_bone from global variable to argument

- cameo.c (dog_bone, main): moved global variable to "main"
- cameo.c (process_path, process_paths, main): pass dog_bone as argument
This commit is contained in:
Werner Almesberger 2010-12-14 13:54:00 -03:00
parent f80a01a9c0
commit 1f63ef6391

View File

@ -20,10 +20,7 @@
#include "gerber.h" #include "gerber.h"
static int dog_bone = 0; static void process_path(struct path *path, int inside, int dog_bone)
static void process_path(struct path *path, int inside)
{ {
int left; int left;
struct path *new; struct path *new;
@ -37,7 +34,7 @@ static void process_path(struct path *path, int inside)
} }
static void process_paths(struct path *paths) static void process_paths(struct path *paths, int dog_bone)
{ {
struct path *leftmost, *path; struct path *leftmost, *path;
@ -55,11 +52,11 @@ static void process_paths(struct path *paths)
leftmost = path_find_leftmost(paths); leftmost = path_find_leftmost(paths);
for (path = paths; path; path = path->next) for (path = paths; path; path = path->next)
if (path != leftmost && !path->outside) if (path != leftmost && !path->outside)
process_path(path, 1); process_path(path, 1, dog_bone);
for (path = paths; path; path = path->next) for (path = paths; path; path = path->next)
if (path != leftmost && path->outside) if (path != leftmost && path->outside)
process_path(path, 0); process_path(path, 0, dog_bone);
process_path(leftmost, 0); process_path(leftmost, 0, dog_bone);
} }
@ -78,7 +75,7 @@ static void usage(const char *name)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char *in = NULL, *out = NULL; char *in = NULL, *out = NULL;
int gerber = 0; int gerber = 0, dog_bone = 0;
double r; double r;
struct path *paths; struct path *paths;
int c; int c;
@ -113,7 +110,7 @@ int main(int argc, char **argv)
paths = gerber_read(in, r); paths = gerber_read(in, r);
else else
paths = gnuplot_read(in, r); paths = gnuplot_read(in, r);
process_paths(paths); process_paths(paths, dog_bone);
gnuplot_write(out, paths); gnuplot_write(out, paths);
return 0; return 0;