]> granicus.if.org Git - graphviz/commitdiff
remove unused sfdlen() and variants
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Sep 2020 02:41:39 +0000 (19:41 -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/_sfdlen.c [deleted file]
lib/sfio/sfdlen.c [deleted file]
lib/sfio/sfio.h
lib/sfio/sfio.vcxproj
lib/sfio/sfio.vcxproj.filters

index ce5fe7a14e5015da4c52ed893fc2d9d0a3dae76a..22ddbd1c9cb3a8ad9125d32448d8175b431271e1 100644 (file)
@@ -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 \
index 141316679c74f84832ceeea4fe53de15ae540145..68851bf461e6855445059b837289af92080e43fa 100644 (file)
@@ -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 (file)
index 4a5c5b1..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 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 (file)
index b680bee..0000000
+++ /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       <sfio/sfhdr.h>
-
-#include <math.h>
-
-/*     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;
-}
index e89671b2ee747398d1e79baf68580def4cc33f09..38348be05b5aee00105d440da3aaed8e0f6206d9 100644 (file)
@@ -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)                )
index 6c8a55546b92623d3e5009a1960057221a33a40f..c4ed26eebde3dc3f0f48d962d58538c45ef3eed6 100644 (file)
@@ -86,7 +86,6 @@
     <ClCompile Include="sfclrlock.c" />
     <ClCompile Include="sfcvt.c" />
     <ClCompile Include="sfdisc.c" />
-    <ClCompile Include="sfdlen.c" />
     <ClCompile Include="sfexcept.c" />
     <ClCompile Include="sfexit.c" />
     <ClCompile Include="sfextern.c" />
@@ -97,7 +96,6 @@
     <ClCompile Include="sfgetm.c" />
     <ClCompile Include="sfgetr.c" />
     <ClCompile Include="sfgetu.c" />
-    <ClCompile Include="sfio_f\_sfdlen.c" />
     <ClCompile Include="sfio_f\_sfeof.c" />
     <ClCompile Include="sfio_f\_sferror.c" />
     <ClCompile Include="sfio_f\_sffileno.c" />
index ab89537f479803174d4899202bf0b3ddfa690dc1..f7770c782c6abf6648766ae733ec2458c1daf499 100644 (file)
@@ -29,9 +29,6 @@
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="sfio_f\_sfdlen.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfio_f\_sfeof.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -86,9 +83,6 @@
     <ClCompile Include="sfdisc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfdlen.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfexcept.c">
       <Filter>Source Files</Filter>
     </ClCompile>