diff -ruN klic-3.003-2001-11-23/compiler/klicdb.c klic-3.003-2001-11-24/compiler/klicdb.c
--- klic-3.003-2001-11-23/compiler/klicdb.c	Fri Nov 23 13:59:41 2001
+++ klic-3.003-2001-11-24/compiler/klicdb.c	Sat Nov 24 14:51:10 2001
@@ -16,154 +16,184 @@
 #ifdef USELOCKF
 #include <fcntl.h>
 #endif
+#include <assert.h>
 
-extern void *malloc();
+extern void* malloc();
 
-char *dbdir = 0;
-char *initdbdir = 0;
-int nocfiles = 0;
-int nolink = 0;
-int makelib = 0;
-char *libmade;
+static char* dbdir = NULL;
+static char* initdbdir = NULL;
+static int nocfiles = 0;
+static int nolink = 0;
+static int makelib = 0;
+static char* libmade;
 
 struct atomrec {
-  struct atomrec *next;
+  struct atomrec* next;
   int id;
-  unsigned char *name;
-} *atomroot;
-int nextatom;
+  unsigned char* name;
+};
+static struct atomrec* atomroot;
+static int nextatom;
 
 struct functrec {
-  struct functrec *next;
+  struct functrec* next;
   int id;
-  struct atomrec *principal_functor;
+  struct atomrec* principal_functor;
   int arity;
-} *functroot;
-int nextfunct;
+};
+static struct functrec* functroot;
+static int nextfunct;
 
 enum mod_or_class { Mod, Class };
 
 struct modrec {
-  struct modrec *next;
-  unsigned char *name;		/* name of the module */
-  enum mod_or_class morc;	/* whether itis a class or a module */
-  struct predrec *defined;	/* predicates defined in the module */
+  struct modrec* next;
+  unsigned char* name;		/* name of the module */
+  enum mod_or_class morc;	/* whether it is a class or a module */
+  struct predrec* defined;	/* predicates defined in the module */
 				/* sorted by names alphabetically */
-  struct refmodrec *refmod;	/* module referenced from the module */
+  struct refmodrec* refmod;	/* module referenced from the module */
 				/* sorted by names alphabetically */
-} *modroot, currentmod;
+};
+static struct modrec* modroot;
+static struct modrec currentmod;
 
 struct refmodrec {
-  struct refmodrec *next;
+  struct refmodrec* next;
   enum mod_or_class morc;
-  unsigned char *name;
+  unsigned char* name;
 };
 
 struct predrec {
-  struct predrec *next;
-  unsigned char *name;
+  struct predrec* next;
+  unsigned char* name;
 };
 
-int changes;
+static int changes;
 
-#ifdef __STDC__
-static voidfn error_exit;
-#endif
-static void error_exit(format, arg1, arg2)
-     char *format, *arg1, *arg2;
+static void error_exit(
+  char* format,
+  char* arg1,
+  char* arg2 )
 {
-  (void)fprintf(stderr, format, arg1, arg2);
+  (void) fprintf(stderr, format, arg1, arg2);
   putc('\n', stderr);
   exit(-1);
 }
 
-usage_error(command)
-     char *command;
+static void usage_error(
+  char* command )
 {
-  error_exit("Usage: %s [-n] [-x dbdir] [-X initdbdir] file ...", command, 0);
+  error_exit("Usage: %s [-n] [-x dbdir] [-X initdbdir] file ...",
+    command, NULL );
 }
 
-static struct modrec *find_module(name, morc, root)
-     unsigned char *name;
-     enum mod_or_class morc;
-     struct modrec *root;
+static struct modrec* find_module(
+  unsigned char* name,
+  enum mod_or_class morc,
+  struct modrec* root )
 {
-  while (root != 0 &&
-	 (root->morc != morc ||
-	  strcmp((char *)name, (char *)root->name) != 0)) {
-    root = root->next;
+  int name_is_found;
+
+  for( ; root != NULL; root = root->next) {
+    name_is_found = (strcmp((char*) name, (char*) root->name) == 0);
+    if(root->morc==morc && name_is_found)
+      break;
   }
+  assert(root==NULL || (root->morc==morc && name_is_found));
   return root;
 }
 
-static struct atomrec *enter_atom(name)
-     unsigned char *name;
+static struct atomrec* enter_atom(
+  unsigned char* name )
 {
-  struct atomrec *a;
-  int len = strlen((char *)name);
-  for (a=atomroot; a!=0; a=a->next) {
-    if (strcmp((char *)name,(char *)a->name) == 0) return a;
+  struct atomrec* a;
+  const int len = strlen((char*) name);
+
+  for (a=atomroot; a!=NULL; a=a->next) {
+    if (strcmp((char*) name, (char*) a->name) == 0)
+      return a;
   }
-  a = (struct atomrec *)malloc(sizeof(struct atomrec));
-  a->name = (unsigned char *)strcpy((char *)malloc(len+1),(char *)name);
+  assert(a == NULL);
+
+  a = (struct atomrec*) malloc(sizeof(struct atomrec));
+  a->name = (unsigned char*) malloc(len + 1);
+  a->name = (unsigned char*) strcpy((char*) a->name, (char*) name);
   a->next = atomroot;
-  a->id = nextatom++;
+  a->id = nextatom;
+  nextatom++;
   atomroot = a;
   changes = 1;
   return a;
 }
 
-static void enter_functor(name)
-     unsigned char *name;
+static void enter_functor(
+  unsigned char* name )
 {
-  struct functrec *f;
-  unsigned char *p;
-  struct atomrec *functor;
+  struct functrec* f;
+  unsigned char* p;
+  struct atomrec* functor;
   int arity;
 
-  for (p=name+strlen((char *)name)-1; *p!='_'; p--)
+  for (p=name+strlen((char*) name)-1; *p!='_'; p--)
     ;
-  *p = 0;
-  arity = atoi(p+1);
+  *p = '\0';
+  arity = atoi(p + 1);
   functor = enter_atom(name);
-  for (f=functroot; f!=0; f=f->next) {
+  for (f=functroot; f!=NULL; f=f->next) {
     if (f->principal_functor == functor &&
 	f->arity == arity)
       return;
   }
-  f = (struct functrec *)malloc(sizeof(struct functrec));
+  assert(f == NULL);
+
+  f = (struct functrec*) malloc(sizeof(struct functrec));
   f->principal_functor = functor;
   f->arity = arity;
   f->next = functroot;
-  f->id = nextfunct++;
+  f->id = nextfunct;
+  nextfunct++;
   functroot = f;
   changes = 1;
 }
 
-static void update_module_info()
+/**
+ * Compares the newly read module info in currentmod
+ * with the original info in klic.db (if existent),
+ * and updates the info if any changes are found
+ */
+static void update_module_info(void)
 {
-  /* Compares the newly read module info in currenmod
-     with the original info in klic.db (if existent),
-     and updates the info if any changes are found */
-  struct modrec *m;
+  struct modrec* m;
 
-  for (m=modroot; m!=0; m=m->next) {
+  for (m=modroot; m!=NULL; m=m->next) {
     if (m->morc == currentmod.morc &&
-	strcmp((char *)m->name, (char *)currentmod.name) == 0) {
-      struct refmodrec *rmo, *rmn;
-      for (rmo=m->refmod, rmn=currentmod.refmod;
-	   rmo != 0 && rmn != 0 &&
-	   strcmp((char *)rmo->name, (char *)rmn->name) == 0;
-	   rmo=rmo->next, rmn=rmn->next)
-	;
-      if (rmo==0 || rmn == 0) {
-	struct predrec *po, *pn;
-	for (po=m->defined, pn=currentmod.defined;
-	     po !=0 && pn !=0 &&
-	     strcmp((char *)po->name, (char *)pn->name) == 0;
-	     po=po->next, pn=pn->next)
-	  ;
-	if (po==0 && pn==0) {
+	strcmp((char*) m->name, (char*) currentmod.name) == 0) {
+      int rm_is_changed;
+      struct refmodrec *rm_old, *rm_new;
+      for(rm_old = m->refmod, rm_new = currentmod.refmod;
+	  rm_old != NULL && rm_new != NULL;
+	  rm_old = rm_old->next, rm_new = rm_new->next) {
+	rm_is_changed =
+	  (strcmp((char*) rm_old->name, (char*) rm_new->name) != 0);
+	if(rm_is_changed)
+	  break;
+      }
+      assert(rm_old==NULL || rm_new==NULL || rm_is_changed);
+
+      if (rm_old==NULL || rm_new==NULL) {
+	int pred_is_changed;
+	struct predrec *p_old, *p_new;
+	for(p_old = m->defined, p_new = currentmod.defined;
+	    p_old != NULL && p_new != NULL;
+	    p_old = p_old->next, p_new = p_new->next) {
+	  pred_is_changed =
+	    (strcmp((char*) p_old->name, (char*) p_new->name) != 0);
+	  if(pred_is_changed)
+	    break;
+	}
+	assert(p_old==NULL || p_new==NULL || pred_is_changed);
+	if (p_old==NULL && p_new==NULL) {
 	  return;
 	}
       }
@@ -172,78 +202,93 @@
       return;
     }
   }
-  m = (struct modrec *)malloc(sizeof(struct modrec));
+  assert(m == NULL);
+
+  m = (struct modrec*) malloc(sizeof(struct modrec));
   *m = currentmod;
   m->next = modroot;
   modroot = m;
   return;
 }
 
-static void enter_module(name, morc)
-     unsigned char *name;
-     enum mod_or_class morc;
+static void enter_module(
+  unsigned char* name,
+  enum mod_or_class morc )
 {
-  if (currentmod.name != 0) {
+  if (currentmod.name != NULL) {
     /* not the first module to be entered */
     update_module_info();
   }
-  currentmod.name = (unsigned char *)
-    strcpy((char *)malloc(strlen((char *)name)+1),(char *)name);
+  currentmod.name = (unsigned char*) malloc(strlen((char*) name) + 1);
+  currentmod.name = (unsigned char*)
+    strcpy((char*) currentmod.name, (char*) name);
   currentmod.morc = morc;
-  currentmod.defined = 0;
-  currentmod.refmod = 0;
+  currentmod.defined = NULL;
+  currentmod.refmod = NULL;
 }
 
-static void enter_predicate(name)
-     unsigned char *name;
+static void enter_predicate(
+  unsigned char* name )
 {
   struct predrec *p, **r;
+  int name_offset;
+
+  for (p=currentmod.defined; p!=NULL; p=p->next) {
+    name_offset = strcmp((char*) name, (char*) p->name);
+    if (name_offset == 0) return;
+    if (name_offset > 0) break;
+  }
+  assert(p==NULL || name_offset > 0);
+
+  p = (struct predrec*) malloc(sizeof(struct predrec));
+  p->name = (unsigned char*) malloc(strlen((char*) name) + 1);
+  p->name = (unsigned char*) strcpy((char*) p->name, (char*) name);
+  for(r = &currentmod.defined; *r != NULL; r = &(*r)->next) {
+    name_offset = strcmp((char*) name, (char*) ((*r)->name));
+    if(name_offset >= 0)
+      break;
+  }
+  assert(*r==NULL || name_offset >= 0);
 
-  for (p=currentmod.defined; p!=0; p=p->next) {
-    int res = strcmp((char *)name, (char *)p->name);
-    if (res == 0) return;
-    if (res > 0) break;
-  }
-  p = (struct predrec *)malloc(sizeof(struct predrec));
-  p->name = (unsigned char *)
-    strcpy((char *)malloc(strlen((char *)name)+1),(char *)name);
-  for (r = &currentmod.defined;
-       *r != 0 && strcmp((char *)name, (char *)((*r)->name)) < 0;
-       r = &(*r)->next)
-    ;
   p->next = *r;
   *r = p;
 }
 
-static void enter_ref_module(name, morc)
-     unsigned char *name;
-     enum mod_or_class morc;
+static void enter_ref_module(
+  unsigned char* name,
+  enum mod_or_class morc )
 {
   struct refmodrec *m, **r;
-  for (m=currentmod.refmod; m!=0; m=m->next) {
+  int name_offset;
+
+  for (m=currentmod.refmod; m!=NULL; m=m->next) {
     if (morc > m->morc) break;
     if (morc == m->morc) {
-      int res = strcmp((char *)name,(char *)m->name);
-      if (res > 0) break;
-      if (res == 0) return;
+      name_offset = strcmp((char*) name,(char*) m->name);
+      if (name_offset > 0) break;
+      if (name_offset == 0) return;
     }
   }
-  m = (struct refmodrec *)malloc(sizeof(struct refmodrec));
+  assert(m==NULL || morc > m->morc || name_offset > 0);
+
+  m = (struct refmodrec*) malloc(sizeof(struct refmodrec));
   m->morc = morc;
-  m->name = (unsigned char *)
-    strcpy((char *)malloc(strlen((char *)name)+1),(char *)name);
-  for (r = &currentmod.refmod;
-       *r != 0 && morc < (*r)->morc &&
-       strcmp((char *)name, (char *)((*r)->name)) < 0;
-       r = &(*r)->next)
-    ;
+  m->name = (unsigned char*) malloc(strlen((char*) name) + 1);
+  m->name = (unsigned char*) strcpy((char*) m->name, (char*) name);
+  for(r = &currentmod.refmod; *r != NULL; r = &(*r)->next) {
+    name_offset = strcmp((char*) name, (char*) ((*r)->name));
+    if(morc >= (*r)->morc || name_offset >= 0)
+      break;
+  }
+  assert(*r==NULL || morc >= (*r)->morc || name_offset >= 0);
+
   m->next = *r;
   *r = m;
 }
 
-static void enter_one_line(buf, pathname)
-     char *buf;
-     char *pathname;
+static void enter_one_line(
+  char* buf,
+  char* pathname )
 {
   if (buf[0] == '#') {
     return;			/* comment line */
@@ -267,75 +312,77 @@
   }
 }
 
-static void read_db_file(file, pathname)
-     FILE *file;
-     char *pathname;
+static void read_db_file(
+  FILE* file,
+  char* pathname )
 {
   char buf[BUFSIZE];
-  while (fgets(buf,BUFSIZE,file) != 0) {
-    *strchr(buf,'\n') = 0;
+  while (fgets(buf, BUFSIZE, file) == buf) {
+    *strchr(buf, '\n') = '\0';
     enter_one_line(buf, pathname);
   }
-  (void)fclose(file);
-  if (currentmod.name != 0) {
+  (void) fclose(file);
+  if (currentmod.name != NULL) {
     /* not the first module to be entered */
     update_module_info();
-    currentmod.name = 0;
+    currentmod.name = NULL;
   }
 }
 
-static void read_ext_file(pathname)
-     char *pathname;
+static void read_ext_file(
+  char* pathname )
 {
-  FILE *file;
+  FILE* file;
 
   file = fopen(pathname, "r");
-  if (file==0) error_exit("Cannot open file %s", pathname, 0);
+  if (file==NULL)
+    error_exit("Cannot open file %s", pathname, NULL);
   read_db_file(file, pathname);
 }
 
-static char *make_path(dir, name)
-     char *dir;
-     char *name;
-{
-  char *path;
-  if (dir != 0) {
-    path = (char *)malloc(strlen(dir)+strlen(name)+2);
-    (void)sprintf(path, "%s/%s", dir, name);
+static char* make_path(
+  char* dir,
+  char* name )
+{
+  char* path;
+  if (dir != NULL) {
+    path = (char*) malloc(strlen(dir) + 1 + strlen(name) + 1);
+    (void) sprintf(path, "%s/%s", dir, name);
   } else {
     path = name;
   }
   return path;
 }
 
-static FILE *open_cwd_out(name)
-     char *name;
+static FILE* open_cwd_out(
+  char* name )
 {
-  FILE *file;
-  if ((file=fopen(name, "w")) == 0) {
-    error_exit("Cannot open file %s", name, 0);
+  FILE* file;
+  file = fopen(name, "w");
+  if (file == NULL) {
+    error_exit("Cannot open file %s", name, NULL);
   }
   return file;
 }
 
-static FILE *open_db_out(name)
-     char *name;
+static FILE* open_db_out(
+  char* name )
 {
-  FILE *file;
-  char *path = make_path(dbdir, name);
-  if ((file=fopen(path, "w")) == 0) {
-    error_exit("Cannot open file %s", path, 0);
+  FILE* file;
+  char* path = make_path(dbdir, name);
+  file = fopen(path, "w");
+  if (file == NULL) {
+    error_exit("Cannot open file %s", path, NULL);
   }
   return file;
 }
 
-static void reverse_atomrecs()
+static void reverse_atomrecs(void)
 {
-  struct atomrec
-    *next = atomroot,
-    *x = 0;
-  while (next != 0) {
-    struct atomrec *last = x;
+  struct atomrec* next = atomroot;
+  struct atomrec* x = NULL;
+  while (next != NULL) {
+    struct atomrec* last = x;
     x = next;
     next = x->next;
     x->next = last;
@@ -343,13 +390,12 @@
   atomroot = x;
 }
 
-static void reverse_functrecs()
+static void reverse_functrecs(void)
 {
-  struct functrec
-    *next = functroot,
-    *x = 0;
-  while (next != 0) {
-    struct functrec *last = x;
+  struct functrec* next = functroot;
+  struct functrec* x = NULL;
+  while (next != NULL) {
+    struct functrec* last = x;
     x = next;
     next = x->next;
     x->next = last;
@@ -357,9 +403,9 @@
   functroot = x;
 }
 
-static int hexvalue(c, name)
-     int c;
-     unsigned char *name;
+static int hexvalue(
+  int c,
+  unsigned char* name )
 {
   if ('0' <= c && c <= '9') return c - '0';
   if ('A' <= c && c <= 'F') return c - 'A' + 10;
@@ -367,80 +413,97 @@
   error_exit("Invalid atom name: %s", name, 0);
 }
 
-static void real_atom_name(name,q)
-     unsigned char *name, *q;
+static void real_atom_name(
+  unsigned char* name,
+  unsigned char* q )
 {
-  unsigned char *p = name;
-  while (*p != 0) {
+  unsigned char* p = name;
+  while (*p != '\0') {
     if (*p == '_') {
-      int c = *++p;
+      int c;
+      p++;
+      c = *p;
       if (c == '_') {
 	*q = '_';
       } else {
-	int n = (hexvalue(c,name) << 4);
-	c = *++p;
-	*q = n+hexvalue(c,name);
+	int n = (hexvalue(c, name) << 4);
+	p++;
+	c = *p;
+	*q = n + hexvalue(c, name);
       }
     } else {
       *q = *p;
     }
     p++; q++;
   }
-  *q = 0;
+  assert(*p == '\0');
+  *q = '\0';
 }
 
-static void real_pred_name(name,q)
-     unsigned char *name, *q;
+static void real_pred_name(
+  unsigned char* name,
+  unsigned char* q )
 {
-  unsigned char *p = name;
-  unsigned char *e;
-  while (*p != 0 && (*p != '_' || *(p+1) != 'x'))
+  unsigned char* p = name;
+  unsigned char* e;
+  while (*p != '\0' && (*p != '_' || *(p+1) != 'x'))
     p++;
+  assert(*p=='\0' || (*p=='_' && *(p+1)=='x'));
+
   p += 2;
-  e = p + strlen((char *)p);
-  while (*(--e) != '_')
-    ;
+  e = p + strlen((char*) p);
+  do{
+    e--;
+  }while(*e != '_');
+  assert(*e == '_');
+
   while (p < e) {
     if (*p == '_') {
-      int c = *++p;
+      int c;
+      p++;
+      c = *p;
       if (c == '_') {
 	*q = '_';
       } else {
-	int n = (hexvalue(c,name) << 4);
-	c = *++p;
-	*q = n+hexvalue(c,name);
+	int n = (hexvalue(c, name) << 4);
+	p++;
+	c = *p;
+	*q = n + hexvalue(c, name);
       }
     } else {
       *q = *p;
     }
     p++; q++;
   }
-  *q = 0;
+  assert(p >= e);
+  *q = '\0';
 }
 
-static void print_c_string(file, str)
-     FILE *file;
-     unsigned char *str;
+static void print_c_string(
+  FILE* file,
+  unsigned char* str )
 {
   int c;
-  (void)fprintf(file, "(unsigned char *)");
-  (void)putc('\"', file);
-  while ((c=*str) != 0) {
-    if (c=='\\' || c=='"') (void)putc('\\', file);
-    (void)putc(c, file);
+  (void) fprintf(file, "(unsigned char*)");
+  (void) putc('\"', file);
+  while ((c = *str) != '\0') {
+    if (c=='\\' || c=='"')
+      (void) putc('\\', file);
+    (void) putc(c, file);
     str++;
   }
-  (void)putc('\"', file);
+  assert(c == '\0');
+  (void) putc('\"', file);
 }
 
-#define TEMPDBNAME ".klic.db"
+#define TEMPDBNAME  ".klic.db"
 
-static write_db_files(inittime)
-     time_t inittime;
+static write_db_files(
+  time_t inittime )
 {
   FILE *atomh, *atomc, *functh, *functc, *newdb;
-  struct atomrec *a;
-  struct functrec *f;
+  struct atomrec* a;
+  struct functrec* f;
 
   newdb = open_db_out(TEMPDBNAME);
   (void)fprintf(newdb, "#KLIC DB for system @%lu\n",
@@ -689,7 +752,7 @@
   int err = unlink(name);
   if (err == 0) return;
   if (errno != ENOENT) {
-    error_exit("Can't clear file: %s", name);
+    error_exit("Can't clear file: %s", name, NULL);
   }
 }
 
@@ -740,10 +803,10 @@
   dbpath = make_path(dbdir, DBFILENAME);
 
   if (stat(initpath, &initstat) != 0) {
-    error_exit("Can't access file: %s", initpath);
+    error_exit("Can't access file: %s", initpath, NULL);
   }
   if (!makelib && stat(libdbpath, &libdbstat) != 0) {
-    error_exit("Can't access file: %s", libdbpath);
+    error_exit("Can't access file: %s", libdbpath, NULL);
   }
 
 #ifdef USELOCKF
diff -ruN klic-3.003-2001-11-23/include/klic/interpe.h klic-3.003-2001-11-24/include/klic/interpe.h
--- klic-3.003-2001-11-23/include/klic/interpe.h	Fri Nov 23 13:59:41 2001
+++ klic-3.003-2001-11-24/include/klic/interpe.h	Sat Nov 24 11:15:47 2001
@@ -48,7 +48,7 @@
 #endif
 
 /*********** Some convenient macros **************/
-/*extern long total_node, my_node;*/
+/* Extern long total_node, my_node; */
 #define MASTER_NODE		0L
 #define SHOEN_NODE		total_node
 #define IS_MASTER_NODE(node)	((node) == MASTER_NODE)
@@ -76,8 +76,8 @@
 #endif
 
 /************* WTC related definition ***************/
-extern long shoen_wtc;
-extern long node_wtc;
+Extern long shoen_wtc;
+Extern long node_wtc;
 
 #define SUPPLY_WTC_UNIT		0x1000000L
 #define THROW_WTC_UNIT		0x1000L
@@ -110,17 +110,17 @@
     struct exp_entry* next;
 };
 
-extern struct exp_entry* exp_table;
-extern long current_exp_size;
-extern long active_exp_entry;
+Extern struct exp_entry* exp_table;
+Extern long current_exp_size;
+Extern long active_exp_entry;
 
 #define UNUSED_EXPREC 0xf0f0f0ff /* This value is curious!! */
 #define UNUSED_IMPREC 0xf0f0f0ff /* it too. */
 
 /* Export Hash Table */
-extern struct exp_entry* exp_hash_table[EXP_TABLE_HASH_SIZE];
+Extern struct exp_entry* exp_hash_table[EXP_TABLE_HASH_SIZE];
 
-extern struct exp_entry* top_of_exp_freelist;
+Extern struct exp_entry* top_of_exp_freelist;
 
 /************** Import Table ********************/
 
@@ -129,22 +129,22 @@
     q object;
 };
 
-extern struct imp_entry* imp_table;
-extern long current_imp_size;
+Extern struct imp_entry* imp_table;
+Extern long current_imp_size;
 
-extern struct imp_entry top_of_imp_freelist;
+Extern struct imp_entry top_of_imp_freelist;
 
-extern long active_imp_rec;
-extern long free_imp_rec;
+Extern long active_imp_rec;
+Extern long free_imp_rec;
 
-extern long receive_answer_flag;
-extern long answer_return_exp_index;
-extern q decode_data;		/* Un natural way of value passing. */
+Extern long receive_answer_flag;
+Extern long answer_return_exp_index;
+Extern q decode_data;		/* Un natural way of value passing. */
 
 /* Options set by program arguments */
-extern long eager_transfer_level	Init(0);
-extern int network_statistics_flag	Init(0);
-extern int msg_busywait_flag		Init(0);
+Extern long eager_transfer_level	Init(0);
+Extern int network_statistics_flag	Init(0);
+Extern int msg_busywait_flag		Init(0);
 
 /************* message suspend record **************/
 
@@ -155,16 +155,16 @@
     combuf* outbuf;
 };
 
-extern struct susp_msg_rec* susp_msg_list;
+Extern struct susp_msg_rec* susp_msg_list;
 
 /************* Message decoder stack ****************/
 
 #define INIT_DECODE_STACK_SIZE 0x1000
 
-extern q* decode_stack;
-extern q* decode_stack_ptr;
-extern q* decode_stack_limit;
-extern int decode_stack_size;
+Extern q* decode_stack;
+Extern q* decode_stack_ptr;
+Extern q* decode_stack_limit;
+Extern int decode_stack_size;
 
 /************* Network Statistics Measurement *******/
 
@@ -197,7 +197,7 @@
     long recv_data_siz;
 };
 
-extern struct netstat netstat;
+Extern struct netstat netstat;
 
 #define ERROR_STOP for(;;)
 
diff -ruN klic-3.003-2001-11-23/include/klic/rmon.h klic-3.003-2001-11-24/include/klic/rmon.h
--- klic-3.003-2001-11-23/include/klic/rmon.h	Fri Nov 23 13:59:41 2001
+++ klic-3.003-2001-11-24/include/klic/rmon.h	Sat Nov 24 11:17:12 2001
@@ -23,7 +23,8 @@
     int ms_on;
     int mr_on;
 };
-extern volatile struct perfmon_state perfmon_state;
+
+Extern volatile struct perfmon_state perfmon_state;
 
 struct perfmon_counter {
     long intr_count;
@@ -32,10 +33,11 @@
     long ms_count;
     long mr_count;
 };
-extern volatile struct perfmon_counter perfmon_counter;
 
-extern char* rmonnode;
-extern int rmon_tid;
+Extern volatile struct perfmon_counter perfmon_counter;
+
+Extern char* rmonnode;
+Extern int rmon_tid;
 
 #define IDLE_ON()  (perfmon_state.idle_on = 1)
 #define IDLE_OFF() (perfmon_state.idle_on = 0)
@@ -46,7 +48,7 @@
 #define RECV_ON()  (perfmon_state.mr_on = 1)
 #define RECV_OFF() (perfmon_state.mr_on = 0)
 
-extern int gather_prof_ready Init(1);
+Extern int gather_prof_ready Init(1);
 struct profile_rec {
     long stimes;  /* sampling times */
     long itimes;  /* idle times */
@@ -55,9 +57,9 @@
     long mrtimes; /* message receiving times */
 };
 
-extern struct profile_rec* shoen_profile;
-extern int gathered_count Init(0);
+Extern struct profile_rec* shoen_profile;
+Extern int gathered_count Init(0);
 
-extern long* send_pbuf;
+Extern long* send_pbuf;
 
 #endif /* _KLIC_RMON_H_ */
diff -ruN klic-3.003-2001-11-23/include/klic/timing.h klic-3.003-2001-11-24/include/klic/timing.h
--- klic-3.003-2001-11-23/include/klic/timing.h	Fri Nov 23 13:59:41 2001
+++ klic-3.003-2001-11-24/include/klic/timing.h	Sat Nov 24 11:18:08 2001
@@ -35,9 +35,9 @@
 
 #endif
 
-extern int gctimes Init(0);
-extern int gcums Init(0);
-extern int gcsms Init(0);
-extern int measure_gc Init(0);
+Extern int gctimes Init(0);
+Extern int gcums Init(0);
+Extern int gcsms Init(0);
+Extern int measure_gc Init(0);
 
 #endif /* _KLIC_TIMING_H_ */
