diff -ruN klic-3.003-2002-01-23/include/klic/control.h klic-3.003-2002-01-25/include/klic/control.h
--- klic-3.003-2002-01-23/include/klic/control.h	Mon Dec 31 12:04:47 2001
+++ klic-3.003-2002-01-25/include/klic/control.h	Fri Jan 25 23:30:10 2002
@@ -35,26 +35,29 @@
  * q: struct goalrec*
  */
 
-#define enqueue_at_priority(p,q0,q)			\
-do{							\
-  qp = enqueue_after_waiting((q0), (p), (q), allocp, 0);	\
-}while(0)
+#define _ENQUEUE_AT_PRIORITY(p, q0, q, is_rel) \
+  (qp = enqueue_after_waiting((struct goalrec*) (q0), \
+    (p), (struct goalrec*) (q), allocp, (is_rel)))
 
-#define enqueue_at_priority_no_check(x,q0,q)		\
-do{							\
-  long prio = intval(x);				\
-  qp = enqueue_goal((q0), prio, (q), glbl);		\
-}while(0)
+#define _ENQUEUE_AT_PRIORITY_NO_CHECK(prio, q0, q) \
+  (qp = enqueue_goal((struct goalrec*) (q0), \
+    (long) (prio), (struct goalrec*) (q), glbl))
+
+#define enqueue_at_priority(p, q0, q)			\
+do{ _ENQUEUE_AT_PRIORITY(p, q0, q, 0); }while(0)
+
+#define enqueue_at_lower_priority(p, q0, q)		\
+do{ _ENQUEUE_AT_PRIORITY(p, q0, q, 1); }while(0)
 
-#define enqueue_at_lower_priority(p,q0,q)		\
+#define enqueue_at_priority_no_check(x, q0, q)		\
 do{							\
-  qp = enqueue_after_waiting((q0), (p), (q), allocp, 1);	\
+  _ENQUEUE_AT_PRIORITY_NO_CHECK(intval(x), q0, q); \
 }while(0)
 
-#define enqueue_at_lower_priority_no_check(x,q0,q)	\
+#define enqueue_at_lower_priority_no_check(x, q0, q)	\
 do{							\
-  long prio = current_prio - intval(x);			\
-  qp = enqueue_goal((q0), prio, (q), glbl);		\
+  long prio = current_prio - intval(x); \
+  _ENQUEUE_AT_PRIORITY_NO_CHECK(prio, q0, q); \
 }while(0)
 
 
@@ -119,7 +122,8 @@
  */
 #define throw_goal(node, oldqp, goal) \
 do{ \
-  qp = enqueue_throw_goal((node), (goal), (oldqp), allocp);\
+  qp = enqueue_throw_goal((node), (struct goalrec*) (goal), \
+    (struct goalrec*) (oldqp), allocp); \
 }while(0)
 
 #endif /* _KLIC_CONTROL_H_ */
diff -ruN klic-3.003-2002-01-23/runtime/cntlmsg.c klic-3.003-2002-01-25/runtime/cntlmsg.c
--- klic-3.003-2002-01-23/runtime/cntlmsg.c	Fri Jan 18 15:37:50 2002
+++ klic-3.003-2002-01-25/runtime/cntlmsg.c	Fri Jan 25 23:29:15 2002
@@ -59,13 +59,15 @@
 extern void send_message();
 extern void send_message_without_wtc_chk();
 extern void terminate_profiling();
+extern q pop_decode_stack();
+extern struct generator_object_method_table* get_exref_methtab();
 
-q pop_decode_stack();
+static int transfer_read();
 
 static timerstruct before_exec, after_exec;
 
 extern void
-init_rusage()
+init_rusage(void)
 {
   measure(before_exec);
 }
@@ -75,8 +77,8 @@
   */
 static q*
 decode_answer_value(inbuf, allocp)
-combuf *inbuf;
-q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
     q exref;
     module decoder;  
@@ -121,9 +123,9 @@
 
 static long
 encode_answer_value(data, buffer, index, wec)
-q data;
-combuf *buffer;
-long index, wec;
+  q data;
+  combuf* buffer;
+  long index, wec;
 {
     long wtc, send_wtc;
 
@@ -141,9 +143,9 @@
 
 extern void
 send_answer_value(data, node, index, wec)
-long node;
-q data;
-long index, wec;
+  long node;
+  q data;
+  long index, wec;
 {
     declare_globals;
     combuf *buffer = NODE_TO_BUFFER(node);
@@ -156,17 +158,13 @@
     }
 }
 
-struct generator_object_method_table* get_exref_methtab();
-
-static int transfer_read();
-
 /*
   READ
   */
 static q*
 decode_read(inbuf, allocp)
-combuf *inbuf;
-q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
     q data, rhook, readhook;
     long node, index, wec;
@@ -259,9 +257,9 @@
 }
 
 static int
-transfer_read(transc,recved_wtc,node,index,wec,exref)
-long transc, recved_wtc, node, index, wec;
-struct exref_object* exref;
+transfer_read(transc, recved_wtc, node, index, wec, exref)
+  long transc, recved_wtc, node, index, wec;
+  struct exref_object* exref;
 {
     declare_globals;
     if(exref->wec > MIN_WEC){
@@ -281,11 +279,11 @@
 
 static long
 encode_read(buffer, index, var, exptbl_indexp, transc)
-combuf *buffer;
-long index;
-q var;
-long * exptbl_indexp;
-long transc;
+  combuf* buffer;
+  long index;
+  q var;
+  long* exptbl_indexp;
+  long transc;
 {
     declare_globals;
     int ret_index,wtc, send_wtc;
@@ -296,7 +294,7 @@
     send_wtc = wtc;
     if (send_wtc == 0)
       send_wtc = READ_WTC_UNIT;
-/*    PUT3_BUFFER(buffer, decode_read, send_wtc, index);*/
+    /* PUT3_BUFFER(buffer, decode_read, send_wtc, index); */
     PUT4_BUFFER(buffer, decode_read, send_wtc, index, transc);
     
     ret_index = regist_exptbl(var);
@@ -308,10 +306,10 @@
 
 extern long
 send_read(node, index, var, transc)
-long node;	/* Node No.	of Imported Data */
-long index;	/* ExpTbl index of Imported Data */
-q var;		/* To Readhook			 */
-long transc;
+  long node;	/* Node No.	of Imported Data */
+  long index;	/* ExpTbl index of Imported Data */
+  q var;	/* To Readhook			 */
+  long transc;
 {
     declare_globals;
     long exptbl_index;
@@ -328,13 +326,11 @@
 }
 
 
-/*
-  RELEASE
-  */
+/* RELEASE */
 static q*
 decode_release(inbuf, allocp)
-combuf *inbuf;
-q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
     q exp_data;
     declare_globals;
@@ -349,10 +345,12 @@
     exp_data = (q)search_exptbl(exp_index, wec);
     return(allocp);
 }
-static void encode_release(buffer, index, wec)
-combuf *buffer;
-long index;
-long wec;
+
+static void
+encode_release(buffer, index, wec)
+  combuf* buffer;
+  long index;
+  long wec;
 {
     declare_globals;
     INT_CL_PROBE_X(netstat.send_release_cnt++);
@@ -362,7 +360,7 @@
 
 extern void
 send_release(node, index, wec)
-long node, index, wec;
+  long node, index, wec;
 {
     declare_globals;
     combuf *buffer = NODE_TO_BUFFER(node);
@@ -378,8 +376,8 @@
   */
 static q*
 decode_unify(inbuf, allocp)
-combuf *inbuf;
-q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
     q exp_data;
     long unify_index, unify_wec;
@@ -405,9 +403,9 @@
 
 static long
 encode_unify(buffer, index, wec, data)
-combuf *buffer;
-q data;
-long index, wec;
+  combuf* buffer;
+  q data;
+  long index, wec;
 {
     declare_globals;
     long wtc, send_wtc;
@@ -426,8 +424,8 @@
 
 extern void
 send_unify(node, index, wec, data)
-long node,index, wec;
-q data;
+  long node, index, wec;
+  q data;
 {
     declare_globals;
     combuf *buffer = NODE_TO_BUFFER(node);
@@ -446,8 +444,8 @@
   */
 static q*
 decode_throw_goal(inbuf, allocp)
-     combuf *inbuf;
-     q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
   declare_globals;
   struct goalrec *newgoal;
@@ -468,9 +466,10 @@
   arity = (unsigned short int)(pred_of_goal->arity); 
   newgoal = (struct goalrec *)allocp;
   allocp = allocp+arity+2;
-/*  if(allocp >= real_heaplimit){
-    fatal("Bad estimation of decodeing, heap exausted");
-  }*/
+  /* if(allocp >= real_heaplimit){
+   *   fatal("Bad estimation of decodeing, heap exausted");
+   * }
+   */
 
   newgoal->pred = pred_of_goal;
 
@@ -488,8 +487,8 @@
 
 static long
 encode_throw_goal(goal, buffer)
-struct goalrec *goal;
-combuf *buffer;
+  struct goalrec* goal;
+  combuf* buffer;
 {
   int arity,i;
   long wtc;
@@ -515,9 +514,9 @@
 
 extern struct goalrec*
 send_throw_goal(node, goal, oldqp)
-long node;
-struct goalrec *goal;
-struct goalrec *oldqp;
+  long node;
+  struct goalrec* goal;
+  struct goalrec* oldqp;
 {
   declare_globals;
   combuf *buffer;
@@ -551,12 +550,12 @@
 
 
 /*
-  TERMINATE MSG decoding/encoding
-  */
+ * TERMINATE MSG decoding/encoding
+ */
 
-static char *
+static char*
 put_network_statistics(io_buf)
-char *io_buf;
+  char* io_buf;
 {
   declare_globals;
   char *ptr = io_buf;
@@ -602,9 +601,9 @@
   return ptr;
 }
 
-static char *
+static char*
 put_node_statistics(io_buf)
-char *io_buf;
+  char* io_buf;
 {
   declare_globals;
   long utime, stime;
@@ -666,8 +665,8 @@
 
 static q*
 decode_terminate_msg(inbuf, allocp)
-combuf *inbuf;
-q *allocp;
+  combuf* inbuf;
+  q* allocp;
 {
   declare_globals;
   extern jmp_buf klic_topmost;
@@ -685,7 +684,7 @@
 
 static void
 encode_terminate_msg(buffer)
-combuf *buffer;
+  combuf* buffer;
 {
     declare_globals;
     PUT_BUFFER(buffer, decode_terminate_msg);
@@ -693,7 +692,7 @@
 
 static void
 send_terminate_msg(node)
-long node;
+  long node;
 {
   declare_globals;
   combuf *buffer = NODE_TO_BUFFER(node);
@@ -709,7 +708,7 @@
   therefore, this message is not delivered to the shoen.
   The child nodes should not call this function.
   */
-void
+extern void
 terminate_all_node()
 {
     declare_globals;
diff -ruN klic-3.003-2002-01-23/runtime/config/shm/distio.c klic-3.003-2002-01-25/runtime/config/shm/distio.c
--- klic-3.003-2002-01-23/runtime/config/shm/distio.c	Sat Dec 29 12:46:20 2001
+++ klic-3.003-2002-01-25/runtime/config/shm/distio.c	Fri Jan 25 23:29:15 2002
@@ -20,9 +20,9 @@
 #include <klic/distio.h>
 
 int klic_gets(str,len,fp)
-char *str;
-int len;
-FILE *fp;
+  char* str;
+  int len;
+  FILE* fp;
 {
   while (1) {
     int r = (int)fgets(str,len,fp);
@@ -34,7 +34,7 @@
 
 
 SystemRead(Str)
-char *Str;
+  char* Str;
 {
   if (!io_tty) {
     io_tty = fopen("/dev/tty","r");
diff -ruN klic-3.003-2002-01-23/runtime/trace.c klic-3.003-2002-01-25/runtime/trace.c
--- klic-3.003-2002-01-23/runtime/trace.c	Mon Jan 21 20:55:25 2002
+++ klic-3.003-2002-01-25/runtime/trace.c	Fri Jan 25 23:29:15 2002
@@ -196,7 +196,7 @@
     if ((module)mod_index[mid]->func == mod) break;
   }
   if (mid == high) {
-    fprintf(stderr, "get_mte(): not found(bug).\n");  /* for debug */
+    fprintf(stderr, "get_mte(): not found(bug), mid=high=%d.\n", mid);  /* for debug */
     return NULL;
   } else return mod_index[mid];
 }
diff -ruN klic-3.003-2002-01-23/runtime/version.c.tmplt klic-3.003-2002-01-25/runtime/version.c.tmplt
--- klic-3.003-2002-01-23/runtime/version.c.tmplt	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2002-01-25/runtime/version.c.tmplt	Fri Jan 25 23:29:15 2002
@@ -1,2 +1,2 @@
-char *runtime_version = "##VERSION";
-char *runtime_date = "##DATE";
+char* runtime_version = "##VERSION";
+char* runtime_date = "##DATE";
