From: Matthew Fernandez Date: Wed, 23 Sep 2020 02:41:39 +0000 (-0700) Subject: remove unused sfdlen() and variants X-Git-Tag: 2.46.0~20^2^2~61^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0cedefe45060197c77d77e739820d39347ea287;p=graphviz remove unused sfdlen() and variants --- diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am index ce5fe7a14..22ddbd1c9 100644 --- a/lib/sfio/Makefile.am +++ b/lib/sfio/Makefile.am @@ -9,7 +9,7 @@ noinst_HEADERS = sfhdr.h sfio.h sfio_t.h vthread.h noinst_LTLIBRARIES = libsfio_C.la libsfio_C_la_SOURCES = sfclose.c sfclrlock.c sfcvt.c sfdisc.c \ - sfdlen.c sfexcept.c sfexit.c sfextern.c sffilbuf.c \ + sfexcept.c sfexit.c sfextern.c sffilbuf.c \ sfflsbuf.c sfgetd.c sfgetl.c sfgetm.c sfgetr.c sfgetu.c \ sfllen.c sfmode.c sfnew.c sfnotify.c \ sfnputc.c sfopen.c sfpkrd.c sfpoll.c sfpool.c \ diff --git a/lib/sfio/Sfio_f/Makefile.am b/lib/sfio/Sfio_f/Makefile.am index 141316679..68851bf46 100644 --- a/lib/sfio/Sfio_f/Makefile.am +++ b/lib/sfio/Sfio_f/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib noinst_LTLIBRARIES = libsfiof_C.la -libsfiof_C_la_SOURCES = _sfdlen.c _sfeof.c _sferror.c \ +libsfiof_C_la_SOURCES = _sfeof.c _sferror.c \ _sffileno.c _sfgetc.c _sfllen.c _sfputc.c _sfputd.c \ _sfputl.c _sfputm.c _sfputu.c _sfslen.c _sfstacked.c \ _sfulen.c _sfvalue.c diff --git a/lib/sfio/Sfio_f/_sfdlen.c b/lib/sfio/Sfio_f/_sfdlen.c deleted file mode 100644 index 4a5c5b152..000000000 --- a/lib/sfio/Sfio_f/_sfdlen.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 sfdlen - -int sfdlen(Sfdouble_t v) -{ - return __sf_dlen(v); -} diff --git a/lib/sfio/sfdlen.c b/lib/sfio/sfdlen.c deleted file mode 100644 index b680beea1..000000000 --- a/lib/sfio/sfdlen.c +++ /dev/null @@ -1,47 +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 - -#include - -/* Return the length of a double value if coded in a portable format -** -** Written by Kiem-Phong Vo -*/ - -int _sfdlen(Sfdouble_t v) -{ -#define N_ARRAY (16*sizeof(Sfdouble_t)) - int n, w; - Sfdouble_t x; - int exp; - - if (v < 0) - v = -v; - - /* make the magnitude of v < 1 */ - if (v != 0.) - v = frexp(v, &exp); - else - exp = 0; - - for (w = 1; w <= N_ARRAY; ++w) { /* get 2^SF_PRECIS precision at a time */ - n = (int) (x = ldexp(v, SF_PRECIS)); - v = x - n; - if (v <= 0.) - break; - } - - return 1 + sfulen(exp) + w; -} diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index e89671b2e..38348be05 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -337,7 +337,6 @@ extern "C" { extern ssize_t sfpkrd(int, void *, size_t, int, long, int); /* portable handling of primitive types */ - extern int sfdlen(Sfdouble_t); extern int sfllen(Sflong_t); extern int sfulen(Sfulong_t); @@ -361,7 +360,6 @@ extern "C" { extern int _sffilbuf(Sfio_t *, int); - extern int _sfdlen(Sfdouble_t); extern int _sfllen(Sflong_t); extern int _sfulen(Sfulong_t); @@ -401,7 +399,6 @@ extern "C" { (int)(*_SF_(f)->next++ = (unsigned char)(c)) ) #define __sf_getc(f) (_SF_(f)->next >= _SF_(f)->endr ? _sffilbuf(_SF_(f),0) : \ (int)(*_SF_(f)->next++) ) -#define __sf_dlen(v) (_sfdlen((Sfdouble_t)(v)) ) #define __sf_llen(v) (_sfllen((Sflong_t)(v)) ) #define __sf_ulen(v) ((Sfulong_t)(v) < SF_U1 ? 1 : (Sfulong_t)(v) < SF_U2 ? 2 : \ (Sfulong_t)(v) < SF_U3 ? 3 : (Sfulong_t)(v) < SF_U4 ? 4 : 5) @@ -418,7 +415,6 @@ extern "C" { #define sfputm(f,v,m) ( __sf_putm((f),(v),(m)) ) #define sfputc(f,c) ( __sf_putc((f),(c)) ) #define sfgetc(f) ( __sf_getc(f) ) -#define sfdlen(v) ( __sf_dlen(v) ) #define sfllen(v) ( __sf_llen(v) ) #define sfulen(v) ( __sf_ulen(v) ) #define sffileno(f) ( __sf_fileno(f) ) diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index 6c8a55546..c4ed26eeb 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -86,7 +86,6 @@ - @@ -97,7 +96,6 @@ - diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters index ab89537f4..f7770c782 100644 --- a/lib/sfio/sfio.vcxproj.filters +++ b/lib/sfio/sfio.vcxproj.filters @@ -29,9 +29,6 @@ - - Source Files - Source Files @@ -86,9 +83,6 @@ Source Files - - Source Files - Source Files