OSDN Git Service

* Fixed bug
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 16 Mar 2008 15:32:13 +0000 (15:32 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 16 Mar 2008 15:32:13 +0000 (15:32 +0000)
    - Using AC_FUNC_MALLOC by mistake.
      AC_FUNC_MALLOC is neatly used because it is too good though
      it is not necessary.
      AC_FUNC_MALLOC reacts for CentOS due to the bug of autoconf2.59.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@1880 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/malloc.c [new file with mode: 0644]
src/qs_parse_string.c

diff --git a/src/malloc.c b/src/malloc.c
new file mode 100644 (file)
index 0000000..8aa5702
--- /dev/null
@@ -0,0 +1,10 @@
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#undef malloc
+
+#include <sys/types.h>
+
+void *malloc ();
+
+void *rpl_malloc(size_t n) { if (n == 0) n = 1; return malloc (n); }
index 9a4f5c2..65ec77f 100644 (file)
@@ -46,7 +46,9 @@ static int s_cut_cdata_text(const char *s, int len);
 static void qs_dump_node(Doc *doc, Node *node, int indent);
 static void qs_push_node(Doc *doc, Node *node, NodeStack stack);
 static Node *qs_pop_node(Doc *doc, NodeStack stack);
+#ifdef DUMP_NODE_STACK
 static void qs_dump_node_stack(Doc *doc, NodeStack stack);
+#endif
 static void qs_free_node_stack(Doc *doc, NodeStack stack);
 static void s_error_check(Doc *doc, Node *node, NodeStack node_stack, NodeStack err_stack);
 
@@ -701,22 +703,24 @@ qs_pop_node(Doc *doc, NodeStack stack)
 
 
   list_remove(tail);
-  stack->tail = (NodeStackElement)((unsigned int)stack->head->ref - (unsigned int)APR_OFFSETOF(struct node_stack_element, next));
+  stack->tail = (NodeStackElement)((apr_size_t)stack->head->ref - (apr_size_t)APR_OFFSETOF(struct node_stack_element, next));
   if (doc->r == NULL)
     free(tail);
 
   return result;
 }
 
+#ifdef DUMP_NODE_STACK
 static void
 qs_dump_node_stack(Doc *doc, NodeStack stack)
 {
   NodeStackElement elm;
   for (elm = stack->head->next;elm != stack->head; elm = elm->next) {
     if (doc->r) DBG(doc->r, "name:[%s]", elm->node->name);
-     else       fprintf(stderr, "[%x] name:[%s] next:[%x]\n", (unsigned int)elm, elm->node->name, (unsigned int)elm->next);
+     else       fprintf(stderr, "[%x] name:[%s] next:[%x]\n", (apr_size_t)elm, elm->node->name, (apr_size_t)elm->next);
   }
 }
+#endif
 
 static void
 qs_free_node_stack(Doc *doc, NodeStack stack)