]> granicus.if.org Git - graphviz/commitdiff
Remove cdt/dttreeset.c, not present in newest CDT
authorErwin Janssen <erwinjanssen@outlook.com>
Sun, 18 Dec 2016 14:31:15 +0000 (15:31 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Wed, 4 Jan 2017 23:30:14 +0000 (00:30 +0100)
The code file dttreeset.c is not present in the most recent version of
CDT, it also isn't used by Graphviz, so it can be removed.

lib/cdt/Makefile.am
lib/cdt/cdt.vcxproj
lib/cdt/cdt.vcxproj.filters
lib/cdt/dttreeset.c [deleted file]

index e99b3e1cf3def4778ca9b68dbc96b5a39434752a..4945f8d341ab74afeda1a2501a825db2e5df0144 100644 (file)
@@ -19,7 +19,7 @@ pkgconfig_DATA = libcdt.pc
 
 libcdt_C_la_SOURCES = dtclose.c dtdisc.c dtextract.c dtflatten.c \
        dthash.c dtlist.c dtmethod.c dtopen.c dtrenew.c dtrestore.c dtsize.c \
-       dtstat.c dtstrhash.c dttree.c dttreeset.c dtview.c dtwalk.c
+       dtstat.c dtstrhash.c dttree.c dtview.c dtwalk.c
 
 libcdt_la_LDFLAGS = -version-info $(CDT_VERSION) -no-undefined
 libcdt_la_SOURCES = $(libcdt_C_la_SOURCES)
index d44b5cd83a9ace4885015cba94da864e3cb475fc..28f727d02a11e9e76cefae2dd694d86616b8491b 100644 (file)
     <ClCompile Include="dtstat.c" />
     <ClCompile Include="dtstrhash.c" />
     <ClCompile Include="dttree.c" />
-    <ClCompile Include="dttreeset.c" />
     <ClCompile Include="dtview.c" />
     <ClCompile Include="dtwalk.c" />
   </ItemGroup>
index b0b51aa8d9e6ab7e0f3078906955d624cd7b4ab2..ccfc8f122b4b232d42564666ad319fa22356c5b7 100644 (file)
@@ -70,9 +70,6 @@
     <ClCompile Include="dttree.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="dttreeset.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="dtview.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/lib/cdt/dttreeset.c b/lib/cdt/dttreeset.c
deleted file mode 100644 (file)
index 4a73b98..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#include       "dthdr.h"
-
-/* Set attributes of a tree.
-**
-** Written by Kiem-Phong Vo (09/17/2001)
-*/
-
-static Dtlink_t* treebalance(Dtlink_t* list, int size)
-{
-       int             n;
-       Dtlink_t        *l, *mid;
-
-       if(size <= 2)
-               return list;
-
-       for(l = list, n = size/2 - 1; n > 0; n -= 1)
-               l = l->right;
-
-       mid = l->right; l->right = NIL(Dtlink_t*);
-       mid->left  = treebalance(list, (n = size/2) );
-       mid->right = treebalance(mid->right, size - (n + 1));
-       return mid;
-}
-
-int dttreeset(Dt_t* dt, int minp, int balance)
-{
-       int     size;
-
-       if(dt->meth->type != DT_OSET)
-               return -1;
-
-       size = dtsize(dt);
-
-       if(minp < 0)
-       {       for(minp = 0; minp < DT_MINP; ++minp)
-                       if((1 << minp) >= size)
-                               break;
-               if(minp <= DT_MINP-4)   /* use log(size) + 4 */
-                       minp += 4;
-       }
-
-       if((dt->data->minp = minp + (minp%2)) > DT_MINP)
-               dt->data->minp = DT_MINP;
-
-       if(balance)
-               dt->data->here = treebalance(dtflatten(dt), size);
-
-       return 0;
-}