summaryrefslogtreecommitdiff
path: root/cad/magic/patches/patch-calma_CalmaRead.c
blob: 032aa8fc5d4b112bcd4924626a4b94a3e00fe8ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$NetBSD: patch-calma_CalmaRead.c,v 1.2 2013/03/07 22:05:12 joerg Exp $

--- calma/CalmaRead.c.orig	2013-03-02 22:21:53.000000000 +0000
+++ calma/CalmaRead.c
@@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unus
 #include <string.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <stdarg.h>
 
 #include <netinet/in.h>
 
@@ -77,6 +78,8 @@ extern void calmaUnexpected();
 
 bool calmaParseUnits();
 
+void calmaReadError(char *format, ...);
+
 /*
  * Scaling.
  * Multiply all coordinates by calmaReadScale1, then divide them
@@ -437,10 +440,10 @@ calmaRecordName(rtype)
  */
 
     /*VARARGS1*/
-calmaReadError(format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
-    char *format;
-    char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10;
+void calmaReadError(char *format, ...)
 {
+    va_list ap;
+    va_start(ap, format);
     calmaTotalErrors++;
     if (CIFWarningLevel == CIF_WARN_NONE) return;
 
@@ -453,20 +456,20 @@ calmaReadError(format, a1, a2, a3, a4, a
 	    {
 		fprintf(calmaErrorFile, "Error while reading cell \"%s\": ",
 				cifReadCellDef->cd_name);
-		fprintf(calmaErrorFile, format, a1, a2, a3, a4, a5, a6, a7,
-				a8, a9, a10);
+		vfprintf(calmaErrorFile, format, ap);
 	    }
 	}
 	else
 	{
 	    TxError("Error while reading cell \"%s\": ", cifReadCellDef->cd_name);
-	    TxError(format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+	    VTxError(format, ap);
 	}
     }
     else if ((calmaTotalErrors == 100) && (CIFWarningLevel == CIF_WARN_LIMIT))
     {
 	TxError("Error limit set:  Remaining errors will not be reported.\n");
     }
+    va_end(ap);
 }
 
 /*