From 1f63ef6391fe92b69f489f6952afe22efe70016f Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 14 Dec 2010 13:54:00 -0300 Subject: [PATCH] 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 --- cameo/cameo.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cameo/cameo.c b/cameo/cameo.c index a7dea36..8ab0699 100644 --- a/cameo/cameo.c +++ b/cameo/cameo.c @@ -20,10 +20,7 @@ #include "gerber.h" -static int dog_bone = 0; - - -static void process_path(struct path *path, int inside) +static void process_path(struct path *path, int inside, int dog_bone) { int left; 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; @@ -55,11 +52,11 @@ static void process_paths(struct path *paths) leftmost = path_find_leftmost(paths); for (path = paths; path; path = path->next) if (path != leftmost && !path->outside) - process_path(path, 1); + process_path(path, 1, dog_bone); for (path = paths; path; path = path->next) if (path != leftmost && path->outside) - process_path(path, 0); - process_path(leftmost, 0); + process_path(path, 0, dog_bone); + process_path(leftmost, 0, dog_bone); } @@ -78,7 +75,7 @@ static void usage(const char *name) int main(int argc, char **argv) { char *in = NULL, *out = NULL; - int gerber = 0; + int gerber = 0, dog_bone = 0; double r; struct path *paths; int c; @@ -113,7 +110,7 @@ int main(int argc, char **argv) paths = gerber_read(in, r); else paths = gnuplot_read(in, r); - process_paths(paths); + process_paths(paths, dog_bone); gnuplot_write(out, paths); return 0;