From 859e1d35126afd884efe6d8048bee46be5b396c1 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 22 Sep 2020 20:20:20 -0700 Subject: [PATCH] remove unused sfputl() and variants --- lib/sfio/Makefile.am | 2 +- lib/sfio/Sfio_f/Makefile.am | 2 +- lib/sfio/Sfio_f/_sfputl.c | 21 ---------- lib/sfio/sfio.h | 4 -- lib/sfio/sfio.vcxproj | 2 - lib/sfio/sfio.vcxproj.filters | 6 --- lib/sfio/sfputl.c | 77 ----------------------------------- 7 files changed, 2 insertions(+), 112 deletions(-) delete mode 100644 lib/sfio/Sfio_f/_sfputl.c delete mode 100644 lib/sfio/sfputl.c diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am index da9b51e2c..af2c9f1cb 100644 --- a/lib/sfio/Makefile.am +++ b/lib/sfio/Makefile.am @@ -13,7 +13,7 @@ libsfio_C_la_SOURCES = sfclose.c sfclrlock.c sfcvt.c sfdisc.c \ sfflsbuf.c sfgetd.c sfgetl.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 sfputl.c sfputm.c \ + sfprintf.c sfprints.c sfpurge.c sfputm.c \ sfputr.c sfputu.c sfraise.c sfrd.c sfread.c sfreserve.c \ sfresize.c sfscanf.c sfseek.c sfset.c sfsetbuf.c sfsetfd.c \ sfsize.c sfsk.c sfstack.c sfstrtod.c sfswap.c sfsync.c \ diff --git a/lib/sfio/Sfio_f/Makefile.am b/lib/sfio/Sfio_f/Makefile.am index a1d16c0d6..b5b9f329a 100644 --- a/lib/sfio/Sfio_f/Makefile.am +++ b/lib/sfio/Sfio_f/Makefile.am @@ -7,5 +7,5 @@ noinst_LTLIBRARIES = libsfiof_C.la libsfiof_C_la_SOURCES = \ _sffileno.c _sfgetc.c _sfputc.c \ - _sfputl.c _sfputm.c _sfputu.c _sfslen.c _sfstacked.c \ + _sfputm.c _sfputu.c _sfslen.c _sfstacked.c \ _sfulen.c _sfvalue.c diff --git a/lib/sfio/Sfio_f/_sfputl.c b/lib/sfio/Sfio_f/_sfputl.c deleted file mode 100644 index 4288fd955..000000000 --- a/lib/sfio/Sfio_f/_sfputl.c +++ /dev/null @@ -1,21 +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 - -#undef sfputl - -int sfputl(Sfio_t * f, Sflong_t l) -{ - return __sf_putl(f, l); -} diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 021cf9ef4..1156566dc 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -339,7 +339,6 @@ extern "C" { /* portable handling of primitive types */ extern int sfulen(Sfulong_t); - extern int sfputl(Sfio_t *, Sflong_t); extern int sfputu(Sfio_t *, Sfulong_t); extern int sfputm(Sfio_t *, Sfulong_t, Sfulong_t); extern int sfputc(Sfio_t *, int); @@ -350,7 +349,6 @@ extern "C" { extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t); extern int sfgetc(Sfio_t *); - extern int _sfputl(Sfio_t *, Sflong_t); extern int _sfputu(Sfio_t *, Sfulong_t); extern int _sfputm(Sfio_t *, Sfulong_t, Sfulong_t); extern int _sfflsbuf(Sfio_t *, int); @@ -384,7 +382,6 @@ extern "C" { #else #define _SF_(f) ((Sfio_t*)(f)) #endif -#define __sf_putl(f,v) (_sfputl(_SF_(f),(Sflong_t)(v))) #define __sf_putu(f,v) (_sfputu(_SF_(f),(Sfulong_t)(v))) #define __sf_putm(f,v,m) (_sfputm(_SF_(f),(Sfulong_t)(v),(Sfulong_t)(m))) #define __sf_putc(f,c) (_SF_(f)->next >= _SF_(f)->endw ? \ @@ -399,7 +396,6 @@ extern "C" { #define __sf_value(f) ((f) ? (_SF_(f)->val) : 0) #define __sf_slen() (_Sfi) -#define sfputl(f,v) ( __sf_putl((f),(v)) ) #define sfputu(f,v) ( __sf_putu((f),(v)) ) #define sfputm(f,v,m) ( __sf_putm((f),(v),(m)) ) #define sfputc(f,c) ( __sf_putc((f),(c)) ) diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index 94653ae85..087ee6f2f 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -99,7 +99,6 @@ - @@ -117,7 +116,6 @@ - diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters index a3382ab42..51fb85ebd 100644 --- a/lib/sfio/sfio.vcxproj.filters +++ b/lib/sfio/sfio.vcxproj.filters @@ -38,9 +38,6 @@ Source Files - - Source Files - Source Files @@ -134,9 +131,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/sfio/sfputl.c b/lib/sfio/sfputl.c deleted file mode 100644 index dd08a2950..000000000 --- a/lib/sfio/sfputl.c +++ /dev/null @@ -1,77 +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 - -/* Write out a long value in a portable format -** -** Written by Kiem-Phong Vo. -*/ - -/** - * @param f write a portable long to this stream - * @param v the value to be written - */ -int _sfputl(Sfio_t * f, Sflong_t v) -{ -#define N_ARRAY (2*sizeof(Sflong_t)) - uchar *s, *ps; - ssize_t n, p; - uchar c[N_ARRAY]; - - SFMTXSTART(f, -1); - if (f->mode != SF_WRITE && _sfmode(f, SF_WRITE, 0) < 0) - SFMTXRETURN(f, -1); - SFLOCK(f, 0); - - s = ps = &(c[N_ARRAY - 1]); - if (v < 0) { /* add 1 to avoid 2-complement problems with -SF_MAXINT */ - v = -(v + 1); - *s = (uchar) (SFSVALUE(v) | SF_SIGN); - } else - *s = (uchar) (SFSVALUE(v)); - v = (Sfulong_t) v >> SF_SBITS; - - while (v > 0) { - *--s = (uchar) (SFUVALUE(v) | SF_MORE); - v = (Sfulong_t) v >> SF_UBITS; - } - n = (ps - s) + 1; - - if (n > 8 || SFWPEEK(f, ps, p) < n) - n = SFWRITE(f, (void *) s, n); /* write the hard way */ - else { - switch (n) { - case 8: - *ps++ = *s++; - case 7: - *ps++ = *s++; - case 6: - *ps++ = *s++; - case 5: - *ps++ = *s++; - case 4: - *ps++ = *s++; - case 3: - *ps++ = *s++; - case 2: - *ps++ = *s++; - case 1: - *ps++ = *s++; - } - f->next = ps; - } - - SFOPEN(f, 0); - SFMTXRETURN(f, n); -} -- 2.40.0