]> granicus.if.org Git - graphviz/commitdiff
remove sfmutex() stub
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 10 Sep 2020 02:45:50 +0000 (19:45 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Sep 2020 00:20:24 +0000 (17:20 -0700)
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.

lib/sfio/Makefile.am
lib/sfio/sfhdr.h
lib/sfio/sfio.h
lib/sfio/sfio.vcxproj
lib/sfio/sfio.vcxproj.filters
lib/sfio/sfmutex.c [deleted file]
lib/sfio/sfprintf.c
lib/sfio/sfscanf.c

index 5d488e0129dcd37dec8bc056fa38946582405afc..41b3a8e640cfb6b96ff64dee0cb808acde0106f7 100644 (file)
@@ -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 \
index a61e37165c66f40dc532aec392e74c626949fbb0..97a0f6b681b79470a7c1c004331be23c6cbb07db 100644 (file)
@@ -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
 
index 57f472d358a9f8c2fdc1b3f28405e6af91b34d54..5a6b843a0ef5246b6790dd566edb6e6ca1f687ad 100644 (file)
@@ -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 *);
index b73eb03014987b317dcbef1e52b1bcca0ba9504f..1d7ab87da56ed487c5dbae9adc2411c96afb2cc2 100644 (file)
     <ClCompile Include="sfio_f\_sfvalue.c" />
     <ClCompile Include="sfllen.c" />
     <ClCompile Include="sfmode.c" />
-    <ClCompile Include="sfmutex.c" />
     <ClCompile Include="sfnew.c" />
     <ClCompile Include="sfnotify.c" />
     <ClCompile Include="sfnputc.c" />
index 1582f4be693ad8856356d756eccc36078bb1b453..0a99b91bebad38f6cdedccad99371f1c7b33f2aa 100644 (file)
     <ClCompile Include="sfmode.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sfmutex.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sfnew.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/sfio/sfmutex.c b/lib/sfio/sfmutex.c
deleted file mode 100644 (file)
index 3926cd5..0000000
+++ /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       <sfio/sfhdr.h>
-
-/*     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;
-}
index 055d0178d2fb1027dd97b3f2dfe8e6de1ddf0871..65edaed2761db2bf00112f26643602a0b259abbf 100644 (file)
@@ -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;
index 507dd194ce15f83b0ea56236c8e912d40fdb10fa..b4293219def9ec1330483d7a3c2a57fce3b64b2d 100644 (file)
@@ -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;