]> granicus.if.org Git - graphviz/commitdiff
remove unused sfputd() and variants
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Sep 2020 03:12:52 +0000 (20:12 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Sep 2020 00:01:03 +0000 (17:01 -0700)
lib/sfio/Makefile.am
lib/sfio/Sfio_f/Makefile.am
lib/sfio/Sfio_f/_sfputd.c [deleted file]
lib/sfio/sfio.h
lib/sfio/sfio.vcxproj
lib/sfio/sfio.vcxproj.filters
lib/sfio/sfputd.c [deleted file]

index 64a093d4e5c6d7482d6b10a6725ec2ad6862abad..da9b51e2ccfdcab43e21cb0f7d9a70ba1aa655f6 100644 (file)
@@ -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 sfputd.c sfputl.c sfputm.c \
+       sfprintf.c sfprints.c sfpurge.c sfputl.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 \
index c3bbb81b7e6a59f086b19b75d0f4c570483060f6..a1d16c0d6910e4ec72cc9a75424cf2e824220f19 100644 (file)
@@ -6,6 +6,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib
 noinst_LTLIBRARIES = libsfiof_C.la
 
 libsfiof_C_la_SOURCES = \
-       _sffileno.c _sfgetc.c _sfputc.c _sfputd.c \
+       _sffileno.c _sfgetc.c _sfputc.c \
        _sfputl.c _sfputm.c _sfputu.c _sfslen.c _sfstacked.c \
        _sfulen.c _sfvalue.c
diff --git a/lib/sfio/Sfio_f/_sfputd.c b/lib/sfio/Sfio_f/_sfputd.c
deleted file mode 100644 (file)
index 1306540..0000000
+++ /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       <sfio/sfhdr.h>
-
-#undef sfputd
-
-int sfputd(Sfio_t * f, Sfdouble_t d)
-{
-    return __sf_putd(f, d);
-}
index cb16e5c142393e8e86bdbf11e16ce2d5a2b8d4a5..021cf9ef4624f7e36a1ea62b08ee88eec782d723 100644 (file)
@@ -339,7 +339,6 @@ extern "C" {
 /* portable handling of primitive types */
     extern int sfulen(Sfulong_t);
 
-    extern int sfputd(Sfio_t *, Sfdouble_t);
     extern int sfputl(Sfio_t *, Sflong_t);
     extern int sfputu(Sfio_t *, Sfulong_t);
     extern int sfputm(Sfio_t *, Sfulong_t, Sfulong_t);
@@ -351,7 +350,6 @@ extern "C" {
     extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t);
     extern int sfgetc(Sfio_t *);
 
-    extern int _sfputd(Sfio_t *, Sfdouble_t);
     extern int _sfputl(Sfio_t *, Sflong_t);
     extern int _sfputu(Sfio_t *, Sfulong_t);
     extern int _sfputm(Sfio_t *, Sfulong_t, Sfulong_t);
@@ -386,7 +384,6 @@ extern "C" {
 #else
 #define _SF_(f)                ((Sfio_t*)(f))
 #endif
-#define __sf_putd(f,v)         (_sfputd(_SF_(f),(Sfdouble_t)(v)))
 #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)))
@@ -402,7 +399,6 @@ extern "C" {
 #define __sf_value(f)  ((f) ? (_SF_(f)->val) : 0)
 #define __sf_slen()    (_Sfi)
 
-#define sfputd(f,v)                            ( __sf_putd((f),(v))            )
 #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))        )
index 96e20031af8d68fbea7d8c24c6826926e5fc5781..94653ae85a168ad8d35dcea477b541361ece1c43 100644 (file)
@@ -99,7 +99,6 @@
     <ClCompile Include="sfio_f\_sffileno.c" />
     <ClCompile Include="sfio_f\_sfgetc.c" />
     <ClCompile Include="sfio_f\_sfputc.c" />
-    <ClCompile Include="sfio_f\_sfputd.c" />
     <ClCompile Include="sfio_f\_sfputl.c" />
     <ClCompile Include="sfio_f\_sfputm.c" />
     <ClCompile Include="sfio_f\_sfputu.c" />
     <ClCompile Include="sfprintf.c" />
     <ClCompile Include="sfprints.c" />
     <ClCompile Include="sfpurge.c" />
-    <ClCompile Include="sfputd.c" />
     <ClCompile Include="sfputl.c" />
     <ClCompile Include="sfputm.c" />
     <ClCompile Include="sfputr.c" />
index 1cd6088b545c7b26e25f52033462bb000007c88e..a3382ab42d379f500df8990dc2ea4382a897754a 100644 (file)
@@ -38,9 +38,6 @@
     <ClCompile Include="sfio_f\_sfputc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfio_f\_sfputd.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfio_f\_sfputl.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="sfpurge.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfputd.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfputl.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/sfio/sfputd.c b/lib/sfio/sfputd.c
deleted file mode 100644 (file)
index 6a097ec..0000000
+++ /dev/null
@@ -1,84 +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>
-
-#include <float.h>
-#include <math.h>
-
-/*     Write out a floating point value in a portable format
-**
-**     Written by Kiem-Phong Vo.
-*/
-
-int _sfputd(Sfio_t * f, Sfdouble_t v)
-{
-#define N_ARRAY                (16*sizeof(Sfdouble_t))
-    ssize_t n, w;
-    uchar *s, *ends;
-    int exp;
-    uchar c[N_ARRAY];
-    double x;
-
-    SFMTXSTART(f, -1);
-
-    if (f->mode != SF_WRITE && _sfmode(f, SF_WRITE, 0) < 0)
-       SFMTXRETURN(f, -1);
-    SFLOCK(f, 0);
-
-    /* get the sign of v */
-    if (v < 0.) {
-       v = -v;
-       n = 1;
-    } else
-       n = 0;
-
-    /* make the magnitude of v < 1 */
-    if (v != 0.)
-       v = frexp(v, &exp);
-    else
-       exp = 0;
-
-    /* code the sign of v and exp */
-    if ((w = exp) < 0) {
-       n |= 02;
-       w = -w;
-    }
-
-    /* write out the signs and the exp */
-    SFOPEN(f, 0);
-    if (sfputc(f, n) < 0 || (w = sfputu(f, w)) < 0)
-       SFMTXRETURN(f, -1);
-    SFLOCK(f, 0);
-    w += 1;
-
-    s = (ends = &c[0]) + sizeof(c);
-    while (s > ends) {         /* get 2^SF_PRECIS precision at a time */
-       n = (int) (x = ldexp(v, SF_PRECIS));
-       *--s = n | SF_MORE;
-       v = x - n;
-       if (v <= 0.)
-           break;
-    }
-
-    /* last byte is not SF_MORE */
-    ends = &c[0] + sizeof(c) - 1;
-    *ends &= ~SF_MORE;
-
-    /* write out coded bytes */
-    n = ends - s + 1;
-    w = SFWRITE(f, (void *) s, n) == n ? w + n : -1;
-
-    SFOPEN(f, 0);
-    SFMTXRETURN(f, w);
-}