delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2012/04/28/10:58:08

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=WpDZPmQfCxqbg7IvqvAq4HDcjsNzzV08jU7yZAmIrPs=;
b=e0W5vn9Xbm/RZBIJhaBPs1lF/Qnd4LrKDjffuk8nixxxx07I92Z/AScKEKXD+a9Hmd
AIt0juCUBJov6u5nqzjxkDpgUwLWeHRQ3ospabr1pf5bzOYG94xZ7wAVfqSfIYMEGVrt
dbL87+crKCV0JIIaMRM/HZ4TgDI2ay1RWgpz4lQ23V8WEzMiIIXDvqYE2BQW/HksjLt1
ccdll8cnFoyd5PTjt+TsjS5ass7HmoZbf8K48b6ijpbO8IklzZFD61LQQOucsWofbmqd
6X0X/gX3hpPboiGcupJWVvTs9pmMKg0DXC/ltvxlEX18zBkdUxM+lWxqa7XnVICppOXT
+t0A==
MIME-Version: 1.0
Date: Sat, 28 Apr 2012 18:57:52 +0400
Message-ID: <CAOxVtSQCqR4auo2RwWiGGdjhAPJZ_x2zt3QmWjS-ep8M88CO3A@mail.gmail.com>
Subject: [geda-user] gerbv: APERTURE_PARAMETERS_MAX
From: Sergey Alyoshin <alyoshin DOT s AT gmail DOT com>
To: geda-user AT delorie DOT com
Reply-To: geda-user AT delorie DOT com

APERTURE_PARAMETERS_MAX is defined as 102 in src/gerbv.h

I have some gerbers with more than 102 aperture parameters (175 max).  They
crash Gerbv. Is it good to increase APERTURE_PARAMETERS_MAX to say 200 or
relevant code should be rewritten with dynamic array length allocation?

At current state following patch should be applied to be able to (partially)
load gerbers with aperture parameters more than 102, report it and not crush:

diff --git a/src/gerber.c b/src/gerber.c
index d4a2aac..6f350da 100644
--- a/src/gerber.c
+++ b/src/gerber.c
@@ -2164,7 +2164,10 @@ simplify_aperture_macro(gerbv_aperture_t
*aperture, gdouble scale)

 	    if (type != GERBV_APTYPE_NONE) {
 		if (nuf_parameters > APERTURE_PARAMETERS_MAX) {
-		    GERB_COMPILE_ERROR("Number of parameters to aperture macro are
more than gerbv is able to store\n");
+		    GERB_COMPILE_ERROR("Number of parameters to aperture macro (%d) "
+				    "are more than gerbv is able to store (%d)\n",
+				    nuf_parameters, APERTURE_PARAMETERS_MAX);
+		    nuf_parameters = APERTURE_PARAMETERS_MAX;
 		}

 		/*

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019