[Expat-checkins] expat/lib xmlparse.c,1.40,1.41

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Thu May 23 12:09:07 2002


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv26803/lib

Modified Files:
	xmlparse.c 
Log Message:
Give in and define a constant for the intial number of elements in the
content type scaffold.
This removes the annoying magic number in the code.


Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- xmlparse.c	23 May 2002 18:37:03 -0000	1.40
+++ xmlparse.c	23 May 2002 18:50:51 -0000	1.41
@@ -168,6 +168,8 @@
   int				nextsib;
 } CONTENT_SCAFFOLD;
 
+#define INIT_SCAFFOLD_ELEMENTS 32
+
 typedef struct block {
   struct block *next;
   int size;
@@ -4944,13 +4946,10 @@
       dtd.scaffSize *= 2;
     }
     else {
-      /* 32 is the new value of dtd.scaffSize;
-         these two occurances must be kept in sync:
-      */
-      temp = MALLOC(32 * sizeof(CONTENT_SCAFFOLD));
+      temp = MALLOC(INIT_SCAFFOLD_ELEMENTS * sizeof(CONTENT_SCAFFOLD));
       if (temp == NULL)
         return -1;
-      dtd.scaffSize = 32;
+      dtd.scaffSize = INIT_SCAFFOLD_ELEMENTS;
     }
     dtd.scaffold = temp;
   }