ftp.delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to geda-user-bounces using -f |
X-Recipient: | geda-user AT delorie DOT com |
X-Envelope-From: | paubert AT iram DOT es |
From: | Gabriel Paubert <paubert AT iram DOT es> |
To: | geda-user AT delorie DOT com |
Cc: | Gabriel Paubert <paubert AT iram DOT es> |
Subject: | [geda-user] [PATCH 1/3] Gerber: reset aperture numbers on initialization. |
Date: | Fri, 19 Apr 2013 12:25:36 +0200 |
Message-Id: | <1366367138-16165-2-git-send-email-paubert@iram.es> |
X-Mailer: | git-send-email 1.7.10.4 |
In-Reply-To: | <1366367138-16165-1-git-send-email-paubert@iram.es> |
References: | <1366367138-16165-1-git-send-email-paubert AT iram DOT es> |
X-Spamina-Bogosity: | Ham |
Reply-To: | geda-user AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | geda-user AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
This prevents aperture numbers from growing to infinity if you export several times to Gerber in the same GUI session. --- src/hid/gerber/gerber.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c index b9830e6..d274afe 100644 --- a/src/hid/gerber/gerber.c +++ b/src/hid/gerber/gerber.c @@ -174,6 +174,8 @@ deinitApertureList (ApertureList *list) initApertureList (list); } +static int aperture_count; + static void resetApertures() { int i; @@ -184,13 +186,13 @@ static void resetApertures() curr_aptr_list = NULL; layer_list_max = 0; layer_list_idx = 0; + aperture_count = 0; } /* Create and add a new aperture to the list */ static Aperture * addAperture (ApertureList *list, Coord width, ApertureShape shape) { - static int aperture_count; Aperture *app = (Aperture *) malloc (sizeof *app); if (app == NULL) -- 1.7.10.4
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |