From: Matthew Fernandez <matthew.fernandez@gmail.com>
Date: Thu, 1 Oct 2020 00:51:18 +0000 (-0700)
Subject: remove unused sfgetl()
X-Git-Tag: 2.46.0~20^2^2~51^2~4
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25d012c2f628c61065f2606351f478c8a31b39a7;p=graphviz

remove unused sfgetl()
---

diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am
index 1841b1eec..060289f38 100644
--- a/lib/sfio/Makefile.am
+++ b/lib/sfio/Makefile.am
@@ -10,7 +10,7 @@ noinst_LTLIBRARIES = libsfio_C.la
 
 libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \
 	sfexcept.c sfexit.c sfextern.c sffilbuf.c \
-	sfflsbuf.c sfgetl.c sfgetm.c sfgetr.c sfgetu.c \
+	sfflsbuf.c sfgetm.c sfgetr.c sfgetu.c \
 	sfmode.c sfnew.c sfnotify.c \
 	sfnputc.c sfopen.c sfpkrd.c sfpoll.c sfpool.c \
 	sfprintf.c sfprints.c sfpurge.c \
diff --git a/lib/sfio/sfgetl.c b/lib/sfio/sfgetl.c
deleted file mode 100644
index aa97e4456..000000000
--- a/lib/sfio/sfgetl.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/*************************************************************************
- * Copyright (c) 2011 AT&T Intellectual Property 
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: See CVS logs. Details at http://www.graphviz.org/
- *************************************************************************/
-
-#include	<sfio/sfhdr.h>
-
-/*	Read a long value coded in a portable format.
-**
-**	Written by Kiem-Phong Vo
-*/
-
-Sflong_t sfgetl(Sfio_t * f)
-{
-    Sflong_t v;
-    uchar *s, *ends, c;
-    int p;
-
-    SFMTXSTART(f, (Sflong_t) (-1));
-
-    if (f->mode != SF_READ && _sfmode(f, SF_READ, 0) < 0)
-	SFMTXRETURN(f, (Sflong_t) (-1));
-    SFLOCK(f, 0);
-
-    for (v = 0;;) {
-	if (SFRPEEK(f, s, p) <= 0) {
-	    f->flags |= SF_ERROR;
-	    v = (Sflong_t) (-1);
-	    goto done;
-	}
-	for (ends = s + p; s < ends;) {
-	    c = *s++;
-	    if (c & SF_MORE)
-		v = ((Sfulong_t) v << SF_UBITS) | SFUVALUE(c);
-	    else {		/* special translation for this byte */
-		v = ((Sfulong_t) v << SF_SBITS) | SFSVALUE(c);
-		f->next = s;
-		v = (c & SF_SIGN) ? -v - 1 : v;
-		goto done;
-	    }
-	}
-	f->next = s;
-    }
-  done:
-    SFOPEN(f, 0);
-    SFMTXRETURN(f, v);
-}
diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h
index 8a41e7231..1623f0cbb 100644
--- a/lib/sfio/sfhdr.h
+++ b/lib/sfio/sfhdr.h
@@ -435,7 +435,6 @@ extern "C" {
 
 /* get the real value of a byte in a coded long or ulong */
 #define SFUVALUE(v)	(((ulong)(v))&(SF_MORE-1))
-#define SFSVALUE(v)	((( long)(v))&(SF_SIGN-1))
 #define SFBVALUE(v)	(((ulong)(v))&(SF_BYTE-1))
 
 /* grain size for buffer increment */
diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h
index a818904dd..81329fca4 100644
--- a/lib/sfio/sfio.h
+++ b/lib/sfio/sfio.h
@@ -337,7 +337,6 @@ extern "C" {
 
     extern int sfputc(Sfio_t *, int);
 
-    extern Sflong_t sfgetl(Sfio_t *);
     extern Sfulong_t sfgetu(Sfio_t *);
     extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t);
     extern int sfgetc(Sfio_t *);
@@ -354,10 +353,8 @@ extern "C" {
 #undef extern
 
 /* coding long integers in a portable and compact fashion */
-#define SF_SBITS	6
 #define SF_UBITS	7
 #define SF_BBITS	8
-#define SF_SIGN		(1 << SF_SBITS)
 #define SF_MORE		(1 << SF_UBITS)
 #define SF_BYTE		(1 << SF_BBITS)
 #define SF_U1		SF_MORE
diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj
index 5bde46e41..bbd420020 100644
--- a/lib/sfio/sfio.vcxproj
+++ b/lib/sfio/sfio.vcxproj
@@ -90,7 +90,6 @@
     <ClCompile Include="sfextern.c" />
     <ClCompile Include="sffilbuf.c" />
     <ClCompile Include="sfflsbuf.c" />
-    <ClCompile Include="sfgetl.c" />
     <ClCompile Include="sfgetm.c" />
     <ClCompile Include="sfgetr.c" />
     <ClCompile Include="sfgetu.c" />
diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters
index c7a213180..492ce2e5f 100644
--- a/lib/sfio/sfio.vcxproj.filters
+++ b/lib/sfio/sfio.vcxproj.filters
@@ -65,9 +65,6 @@
     <ClCompile Include="sfflsbuf.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfgetl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfgetm.c">
       <Filter>Source Files</Filter>
     </ClCompile>