From 052e514170a70a549abbc25199504ae6a58dea27 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 16 Oct 2020 17:42:16 -0700 Subject: [PATCH] remove unused sftell() --- lib/sfio/Makefile.am | 2 +- lib/sfio/sfio.h | 1 - lib/sfio/sfio.vcxproj | 1 - lib/sfio/sfio.vcxproj.filters | 3 --- lib/sfio/sftell.c | 48 ----------------------------------- 5 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 lib/sfio/sftell.c diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am index ad7f65bcb..92a39d1c0 100644 --- a/lib/sfio/Makefile.am +++ b/lib/sfio/Makefile.am @@ -17,7 +17,7 @@ libsfio_C_la_SOURCES = sfclose.c sfcvt.c sfdisc.c \ sfputr.c sfraise.c sfrd.c sfread.c \ sfresize.c sfscanf.c sfseek.c sfsetbuf.c sfsetfd.c \ sfsk.c sfstack.c sfswap.c sfsync.c \ - sftable.c sftell.c sftmp.c sfungetc.c sfvprintf.c \ + sftable.c sftmp.c sfungetc.c sfvprintf.c \ sfvscanf.c sfwr.c sfwrite.c libsfio_C_la_DEPENDENCIES = \ diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 025040b36..173a51a17 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -301,7 +301,6 @@ extern "C" { extern ssize_t sfread(Sfio_t *, void *, size_t); extern ssize_t sfwrite(Sfio_t *, const void *, size_t); extern int sfclose(Sfio_t *); - extern Sfoff_t sftell(Sfio_t *); extern Sfoff_t sfseek(Sfio_t *, Sfoff_t, int); extern ssize_t sfputr(Sfio_t *, const char *, int); extern ssize_t sfnputc(Sfio_t *, int, size_t); diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index 7cc7dc806..74957c26c 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -114,7 +114,6 @@ - diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters index 628eade43..559cd6b57 100644 --- a/lib/sfio/sfio.vcxproj.filters +++ b/lib/sfio/sfio.vcxproj.filters @@ -125,9 +125,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/sfio/sftell.c b/lib/sfio/sftell.c deleted file mode 100644 index 2ad73af5e..000000000 --- a/lib/sfio/sftell.c +++ /dev/null @@ -1,48 +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 - -/* Tell the current location in a given stream -** -** Written by Kiem-Phong Vo. -*/ - -Sfoff_t sftell(Sfio_t * f) -{ - int mode; - Sfoff_t p; - - SFMTXSTART(f, (Sfoff_t) (-1)); - - /* set the stream to the right mode */ - if ((mode = f->mode & SF_RDWR) != (int) f->mode - && _sfmode(f, mode, 0) < 0) - SFMTXRETURN(f, (Sfoff_t) (-1)); - - /* throw away ungetc data */ - if (f->disc == _Sfudisc) - (void) sfclose((*_Sfstack) (f, NIL(Sfio_t *))); - - if (f->flags & SF_STRING) - SFMTXRETURN(f, (Sfoff_t) (f->next - f->data)); - - /* let sfseek() handle the hard case */ - if (f->extent >= 0 && (f->flags & (SF_SHARE | SF_APPENDWR))) - p = sfseek(f, (Sfoff_t) 0, 1); - else - p = f->here + ((f->mode & SF_WRITE) ? f->next - f->data : f->next - - f->endb); - - SFMTXRETURN(f, p); -} -- 2.40.0