From: Matthew Fernandez Date: Wed, 23 Sep 2020 03:38:02 +0000 (-0700) Subject: remove unused sfputu() and variants X-Git-Tag: 2.46.0~20^2^2~61^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c8501b7a8f7ab9f262a608be1aca8568a7c6f8d;p=graphviz remove unused sfputu() and variants --- diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am index ee8f4360b..bc74569a9 100644 --- a/lib/sfio/Makefile.am +++ b/lib/sfio/Makefile.am @@ -14,7 +14,7 @@ libsfio_C_la_SOURCES = sfclose.c sfclrlock.c sfcvt.c sfdisc.c \ sfmode.c sfnew.c sfnotify.c \ sfnputc.c sfopen.c sfpkrd.c sfpoll.c sfpool.c \ sfprintf.c sfprints.c sfpurge.c \ - sfputr.c sfputu.c sfraise.c sfrd.c sfread.c sfreserve.c \ + sfputr.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 \ sftable.c sftell.c sftmp.c sfungetc.c sfvprintf.c \ diff --git a/lib/sfio/Sfio_f/Makefile.am b/lib/sfio/Sfio_f/Makefile.am index 1bca9221c..3c6c61feb 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 \ - _sfputu.c _sfslen.c _sfstacked.c \ + _sfslen.c _sfstacked.c \ _sfulen.c _sfvalue.c diff --git a/lib/sfio/Sfio_f/_sfputu.c b/lib/sfio/Sfio_f/_sfputu.c deleted file mode 100644 index dc0a7c871..000000000 --- a/lib/sfio/Sfio_f/_sfputu.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 sfputu - -int sfputu(Sfio_t * f, Sfulong_t u) -{ - return __sf_putu(f, u); -} diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index d61575b7a..2d619ddea 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 sfputu(Sfio_t *, Sfulong_t); extern int sfputc(Sfio_t *, int); extern Sfdouble_t sfgetd(Sfio_t *); @@ -348,7 +347,6 @@ extern "C" { extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t); extern int sfgetc(Sfio_t *); - extern int _sfputu(Sfio_t *, Sfulong_t); extern int _sfflsbuf(Sfio_t *, int); extern int _sffilbuf(Sfio_t *, int); @@ -380,7 +378,6 @@ extern "C" { #else #define _SF_(f) ((Sfio_t*)(f)) #endif -#define __sf_putu(f,v) (_sfputu(_SF_(f),(Sfulong_t)(v))) #define __sf_putc(f,c) (_SF_(f)->next >= _SF_(f)->endw ? \ _sfflsbuf(_SF_(f),(int)((unsigned char)(c))) : \ (int)(*_SF_(f)->next++ = (unsigned char)(c)) ) @@ -393,7 +390,6 @@ extern "C" { #define __sf_value(f) ((f) ? (_SF_(f)->val) : 0) #define __sf_slen() (_Sfi) -#define sfputu(f,v) ( __sf_putu((f),(v)) ) #define sfputc(f,c) ( __sf_putc((f),(c)) ) #define sfgetc(f) ( __sf_getc(f) ) #define sfulen(v) ( __sf_ulen(v) ) diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index 67dd59dc6..8cc096911 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -99,7 +99,6 @@ - @@ -116,7 +115,6 @@ - diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters index b82f4f0f4..c1f08c16b 100644 --- a/lib/sfio/sfio.vcxproj.filters +++ b/lib/sfio/sfio.vcxproj.filters @@ -38,9 +38,6 @@ Source Files - - Source Files - Source Files @@ -131,9 +128,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/sfio/sfputu.c b/lib/sfio/sfputu.c deleted file mode 100644 index c7ce983bc..000000000 --- a/lib/sfio/sfputu.c +++ /dev/null @@ -1,73 +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 an unsigned long value in a portable format. -** -** Written by Kiem-Phong Vo. -*/ - -/** - * @param f write a portable ulong to this stream - * @param v the unsigned value to be written - * @param - * @param - */ -int _sfputu(Sfio_t * f, Sfulong_t v) -{ -#define N_ARRAY (2*sizeof(Sfulong_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); - - /* code v as integers in base SF_UBASE */ - s = ps = &(c[N_ARRAY - 1]); - *s = (uchar) SFUVALUE(v); - while ((v >>= SF_UBITS)) - *--s = (uchar) (SFUVALUE(v) | SF_MORE); - 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, (int) n); -}