From 84db139d2d0a5ef67c3a5daa26e2bcc032cdef19 Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Wed, 6 Feb 2019 00:02:29 +0100
Subject: [PATCH] readlibrary: remove some unused parameters

---
 src/libraryreader.c | 48 ++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/src/libraryreader.c b/src/libraryreader.c
index 5d8a3d5..3721ee6 100644
--- a/src/libraryreader.c
+++ b/src/libraryreader.c
@@ -115,7 +115,7 @@ static long readcoord(struct LOC_readlibrary_at *LINK)
 		return (i - 256);
 }
 
-static void bound(log_krec *k, long x, long y, struct LOC_readlibrary_at *LINK)
+static void bound(log_krec *k, long x, long y)
 {
 	if (x < k->bbx1)
 		k->bbx1 = x;
@@ -127,7 +127,7 @@ static void bound(log_krec *k, long x, long y, struct LOC_readlibrary_at *LINK)
 		k->bby2 = y;
 }
 
-static long uncompress(long i, struct LOC_readlibrary_at *LINK)
+static long uncompress(long i)
 {
 	if (i < 0)
 		i += 256;
@@ -140,7 +140,6 @@ static long uncompress(long i, struct LOC_readlibrary_at *LINK)
 
 static descrec *readdesc(char *rec)
 {
-	unsigned short i,j1,j2,s1,s2;
 	static descrec d;
 	d.ptr = getintsw(rec);
 	d.numvects = rec[4];
@@ -315,10 +314,10 @@ short readlibrary_at(char *n_, short where, int loadit)
 			kind[i - 1]->flag.i = WITH1->flag;
 			if (kind[i - 1]->flag.U3.expanded)
 			{
-				kind[i - 1]->bigprocsize = uncompress((long)WITH1->procsize, &V);
-				kind[i - 1]->biglblsize = uncompress((long)WITH1->lblsize, &V);
+				kind[i - 1]->bigprocsize = uncompress((long)WITH1->procsize);
+				kind[i - 1]->biglblsize = uncompress((long)WITH1->lblsize);
 				kind[i - 1]->numpnums = 0;
-				kind[i - 1]->bigvectsize = uncompress((long)WITH1->numpnums, &V);
+				kind[i - 1]->bigvectsize = uncompress((long)WITH1->numpnums);
 			}
 			else
 			{
@@ -350,8 +349,8 @@ short readlibrary_at(char *n_, short where, int loadit)
 			WITH->bby1 = -log_scale0;
 			WITH->bbx2 = log_scale0;
 			WITH->bby2 = log_scale0;
-			bound(kind[i - 1], (long)WITH->x1, (long)WITH->y1, &V);
-			bound(kind[i - 1], (long)WITH->x2, (long)WITH->y2, &V);
+			bound(kind[i - 1], (long)WITH->x1, (long)WITH->y1);
+			bound(kind[i - 1], (long)WITH->x2, (long)WITH->y2);
 
 			if (WITH->numvects != 0)
 			{
@@ -398,9 +397,9 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->UU.U99.x2 = readcoord(&V);
 								WITH2->UU.U99.y2 = readcoord(&V);
 								WITH2->numcoords = 2;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x2,
-										(long)WITH2->UU.U99.y2, &V);
+										(long)WITH2->UU.U99.y2);
 								break;
 
 							case 'r':
@@ -410,9 +409,9 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->UU.U99.y2 = readcoord(&V);
 								WITH2->UU.U98.num = readcoord(&V);
 								WITH2->numcoords = 2;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x2,
-										(long)WITH2->UU.U99.y2, &V);
+										(long)WITH2->UU.U99.y2);
 								break;
 
 							case 'F':
@@ -426,13 +425,13 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->UU.U99.x4 = readcoord(&V);
 								WITH2->UU.U99.y4 = readcoord(&V);
 								WITH2->numcoords = 4;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x2,
-										(long)WITH2->UU.U99.y2, &V);
+										(long)WITH2->UU.U99.y2);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x3,
-										(long)WITH2->UU.U99.y3, &V);
+										(long)WITH2->UU.U99.y3);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x4,
-										(long)WITH2->UU.U99.y4, &V);
+										(long)WITH2->UU.U99.y4);
 								break;
 
 							case 'p':
@@ -440,7 +439,7 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->x1 = readcoord(&V);
 								WITH2->y1 = readcoord(&V);
 								WITH2->numcoords = 1;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								break;
 
 							case 'b':
@@ -450,9 +449,9 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->UU.U99.x2 = readcoord(&V);
 								WITH2->UU.U99.y2 = readcoord(&V);
 								WITH2->numcoords = 2;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								bound(kind[i - 1], (long)WITH2->UU.U99.x2,
-										(long)WITH2->UU.U99.y2, &V);
+										(long)WITH2->UU.U99.y2);
 								break;
 
 							case 't':
@@ -461,7 +460,7 @@ short readlibrary_at(char *n_, short where, int loadit)
 								WITH2->x1 = readcoord(&V);
 								WITH2->y1 = readcoord(&V);
 								WITH2->numcoords = 1;
-								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V);
+								bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1);
 								j000 = readnum(&V);
 								buf[j000] = '\0';
 								for (j00 = 0; j00 < j000; j00++)
@@ -501,9 +500,9 @@ short readlibrary_at(char *n_, short where, int loadit)
 						WITH->vector[j].UU.U99.y2 =
 							GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].y2;
 						bound(kind[i - 1], (long)WITH->vector[j].x1,
-								(long)WITH->vector[j].y1, &V);
+								(long)WITH->vector[j].y1);
 						bound(kind[i - 1], (long)WITH->vector[j].UU.U99.x2,
-								(long)WITH->vector[j].UU.U99.y2, &V);
+								(long)WITH->vector[j].UU.U99.y2);
 						V.p++;
 					}
 				}
@@ -525,7 +524,7 @@ short readlibrary_at(char *n_, short where, int loadit)
 					WITH->pin[j].s = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].s;
 					WITH->pin[j].c = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].c;
 					bound(kind[i - 1], (long)(WITH->pin[j].x * log_scale0),
-							(long)(WITH->pin[j].y * log_scale0), &V);
+							(long)(WITH->pin[j].y * log_scale0));
 					WITH->pinnames[j] = NULL;
 					V.p++;
 				}
@@ -541,8 +540,7 @@ short readlibrary_at(char *n_, short where, int loadit)
 					readint(&V);
 					WITH->pnum[j] = readpnum((char *) &GETFBUF(libf1[V.f - 1]->f, filerec).b
 							[4*V.p]);
-					bound(kind[i - 1], (long)WITH->pnum[j].x, (long)WITH->pnum[j].y,
-							&V);
+					bound(kind[i - 1], (long)WITH->pnum[j].x, (long)WITH->pnum[j].y);
 					V.p++;
 				}
 			}
-- 
GitLab