From: Matthew Fernandez Date: Thu, 10 Sep 2020 02:45:50 +0000 (-0700) Subject: remove sfmutex() stub X-Git-Tag: 2.46.0~20^2^2~78^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=046551ea34d893c170501e46c25ab28e4b85670b;p=graphviz remove sfmutex() stub This function is unused, but more problematically it gives the caller the impression of providing a mutual exclusion primitive while being a no-op. We remove it to avoid future confusion or accidental usage. --- diff --git a/lib/sfio/Makefile.am b/lib/sfio/Makefile.am index 5d488e012..41b3a8e64 100644 --- a/lib/sfio/Makefile.am +++ b/lib/sfio/Makefile.am @@ -11,7 +11,7 @@ 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 \ sfflsbuf.c sfgetd.c sfgetl.c sfgetm.c sfgetr.c sfgetu.c \ - sfllen.c sfmode.c sfmutex.c sfnew.c sfnotify.c \ + sfllen.c sfmode.c sfnew.c sfnotify.c \ sfnputc.c sfopen.c sfpkrd.c sfpoll.c sfpool.c sfpopen.c \ sfprintf.c sfprints.c sfpurge.c sfputd.c sfputl.c sfputm.c \ sfputr.c sfputu.c sfraise.c sfrd.c sfread.c sfreserve.c \ diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index a61e37165..97a0f6b68 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -172,9 +172,6 @@ extern "C" { #define SF_SEQUENTIAL 00000020 /* sequential access */ #define SF_JUSTSEEK 00000040 /* just did a sfseek */ -/* this bit signals sfmutex() not to create a mutex for a private stream */ -#define SF_PRIVATE 00000200 /* private stream to Sfio */ - /* on closing, don't be a hero about reread/rewrite on interrupts */ #define SF_ENDING 00000400 diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 57f472d35..5a6b843a0 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -186,12 +186,6 @@ extern "C" { #define SFFMT_JFLAG 04000000 /* 'j' flag, intmax_t */ #define SFFMT_SET 07777770 /* flags settable on calling extf */ -/* for sfmutex() call */ -#define SFMTX_LOCK 0 /* up mutex count */ -#define SFMTX_TRYLOCK 1 /* try to up mutex count */ -#define SFMTX_UNLOCK 2 /* down mutex count */ -#define SFMTX_CLRLOCK 3 /* clear mutex count */ - /* various constants */ #ifndef NULL #define NULL 0 @@ -338,9 +332,6 @@ extern "C" { extern int sfvscanf(Sfio_t *, const char *, va_list); extern int sfresize(Sfio_t *, Sfoff_t); -/* mutex locking for thread-safety */ - extern int sfmutex(Sfio_t *, int); - /* io functions with discipline continuation */ extern ssize_t sfrd(Sfio_t *, void *, size_t, Sfdisc_t *); extern ssize_t sfwr(Sfio_t *, const void *, size_t, Sfdisc_t *); diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index b73eb0301..1d7ab87da 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -115,7 +115,6 @@ - diff --git a/lib/sfio/sfio.vcxproj.filters b/lib/sfio/sfio.vcxproj.filters index 1582f4be6..0a99b91be 100644 --- a/lib/sfio/sfio.vcxproj.filters +++ b/lib/sfio/sfio.vcxproj.filters @@ -128,9 +128,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/sfio/sfmutex.c b/lib/sfio/sfmutex.c deleted file mode 100644 index 3926cd5c4..000000000 --- a/lib/sfio/sfmutex.c +++ /dev/null @@ -1,25 +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 - -/* Obtain/release exclusive use of a stream. -** -** Written by Kiem-Phong Vo. -*/ - -/* the main locking/unlocking interface */ -int sfmutex(Sfio_t * f, int type) -{ - return 0; -} diff --git a/lib/sfio/sfprintf.c b/lib/sfio/sfprintf.c index 055d0178d..65edaed27 100644 --- a/lib/sfio/sfprintf.c +++ b/lib/sfio/sfprintf.c @@ -41,7 +41,6 @@ int sfvsprintf(char *s, int n, const char *form, va_list args) /* make a fake stream */ SFCLEAR(&f, NIL(Vtmutex_t *)); f.flags = SF_STRING | SF_WRITE; - f.bits = SF_PRIVATE; f.mode = SF_WRITE; f.size = n - 1; f.data = f.next = f.endr = (uchar *) s; diff --git a/lib/sfio/sfscanf.c b/lib/sfio/sfscanf.c index 507dd194c..b4293219d 100644 --- a/lib/sfio/sfscanf.c +++ b/lib/sfio/sfscanf.c @@ -38,7 +38,6 @@ int sfvsscanf(const char *s, const char *form, va_list args) /* make a fake stream */ SFCLEAR(&f, NIL(Vtmutex_t *)); f.flags = SF_STRING | SF_READ; - f.bits = SF_PRIVATE; f.mode = SF_READ; f.size = strlen(s); f.data = f.next = f.endw = (uchar *) s;