diff -Naur cdb-0.75.orig/alloc.c cdb-0.75-cur/alloc.c
--- cdb-0.75.orig/alloc.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/alloc.c	2005-07-26 21:14:17.000000000 +0900
@@ -1,7 +1,8 @@
+
+#include <stdlib.h>
+
 #include "alloc.h"
 #include "error.h"
-extern char *malloc();
-extern void free();
 
 #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
 #define SPACE 4096 /* must be multiple of ALIGNMENT */
diff -Naur cdb-0.75.orig/auto-str.c cdb-0.75-cur/auto-str.c
--- cdb-0.75.orig/auto-str.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/auto-str.c	2005-07-26 21:21:02.000000000 +0900
@@ -5,8 +5,7 @@
 char buf1[256];
 buffer ss1 = BUFFER_INIT(write,1,buf1,sizeof(buf1));
 
-void puts(s)
-char *s;
+static void puts_(const char* s)
 {
   if (buffer_puts(&ss1,s) == -1) _exit(111);
 }
@@ -25,20 +24,20 @@
   value = argv[2];
   if (!value) _exit(100);
 
-  puts("char ");
-  puts(name);
-  puts("[] = \"\\\n");
+  puts_("char ");
+  puts_(name);
+  puts_("[] = \"\\\n");
 
   while (ch = *value++) {
-    puts("\\");
+    puts_("\\");
     octal[3] = 0;
     octal[2] = '0' + (ch & 7); ch >>= 3;
     octal[1] = '0' + (ch & 7); ch >>= 3;
     octal[0] = '0' + (ch & 7);
-    puts(octal);
+    puts_(octal);
   }
 
-  puts("\\\n\";\n");
+  puts_("\\\n\";\n");
   if (buffer_flush(&ss1) == -1) _exit(111);
   _exit(0);
 }
diff -Naur cdb-0.75.orig/buffer.h cdb-0.75-cur/buffer.h
--- cdb-0.75.orig/buffer.h	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/buffer.h	2005-07-26 21:29:17.000000000 +0900
@@ -6,7 +6,7 @@
   unsigned int p;
   unsigned int n;
   int fd;
-  int (*op)();
+  int (*op)(int, const char*, unsigned int);
 } buffer;
 
 #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
@@ -16,10 +16,10 @@
 extern void buffer_init(buffer *,int (*)(),int,char *,unsigned int);
 
 extern int buffer_flush(buffer *);
-extern int buffer_put(buffer *,char *,unsigned int);
+extern int buffer_put(buffer*, const char*, unsigned int);
 extern int buffer_putalign(buffer *,char *,unsigned int);
 extern int buffer_putflush(buffer *,char *,unsigned int);
-extern int buffer_puts(buffer *,char *);
+extern int buffer_puts(buffer*, const char*);
 extern int buffer_putsalign(buffer *,char *);
 extern int buffer_putsflush(buffer *,char *);
 
diff -Naur cdb-0.75.orig/buffer_put.c cdb-0.75-cur/buffer_put.c
--- cdb-0.75.orig/buffer_put.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/buffer_put.c	2005-07-26 21:27:55.000000000 +0900
@@ -3,7 +3,8 @@
 #include "byte.h"
 #include "error.h"
 
-static int allwrite(int (*op)(),int fd,char *buf,unsigned int len)
+static int allwrite(int (*op)(int, const char*, unsigned int),
+                    int fd, const char* buf, unsigned int len)
 {
   int w;
 
@@ -44,7 +45,7 @@
   return 0;
 }
 
-int buffer_put(buffer *s,char *buf,unsigned int len)
+int buffer_put(buffer* s, const char* buf, unsigned int len)
 {
   unsigned int n;
  
@@ -77,7 +78,7 @@
   return buffer_putalign(s,buf,str_len(buf));
 }
 
-int buffer_puts(buffer *s,char *buf)
+int buffer_puts(buffer* s, const char* buf)
 {
   return buffer_put(s,buf,str_len(buf));
 }
diff -Naur cdb-0.75.orig/cdbdump.c cdb-0.75-cur/cdbdump.c
--- cdb-0.75.orig/cdbdump.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/cdbdump.c	2005-07-26 21:12:45.000000000 +0900
@@ -1,3 +1,6 @@
+
+#include <unistd.h>
+
 #include "uint32.h"
 #include "fmt.h"
 #include "buffer.h"
diff -Naur cdb-0.75.orig/cdbmake.c cdb-0.75-cur/cdbmake.c
--- cdb-0.75.orig/cdbmake.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/cdbmake.c	2005-07-26 21:41:03.000000000 +0900
@@ -1,3 +1,7 @@
+
+#include <unistd.h>
+#include <stdio.h>
+
 #include "error.h"
 #include "open.h"
 #include "strerr.h"
diff -Naur cdb-0.75.orig/cdbstats.c cdb-0.75-cur/cdbstats.c
--- cdb-0.75.orig/cdbstats.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/cdbstats.c	2005-07-26 21:33:49.000000000 +0900
@@ -1,9 +1,13 @@
+
+#include <unistd.h>
+
 #include "uint32.h"
 #include "fmt.h"
 #include "buffer.h"
 #include "strerr.h"
 #include "seek.h"
 #include "cdb.h"
+#include "str.h"
 
 #define FATAL "cdbstats: fatal: "
 
diff -Naur cdb-0.75.orig/cdbtest.c cdb-0.75-cur/cdbtest.c
--- cdb-0.75.orig/cdbtest.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/cdbtest.c	2005-07-26 21:34:01.000000000 +0900
@@ -1,9 +1,13 @@
+
+#include <unistd.h>
+
 #include "uint32.h"
 #include "fmt.h"
 #include "buffer.h"
 #include "strerr.h"
 #include "seek.h"
 #include "cdb.h"
+#include "str.h"
 
 #define FATAL "cdbtest: fatal: "
 
diff -Naur cdb-0.75.orig/conf-cc cdb-0.75-cur/conf-cc
--- cdb-0.75.orig/conf-cc	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/conf-cc	2005-07-26 21:29:49.000000000 +0900
@@ -1,3 +1,3 @@
-gcc -O2
+gcc -Wall -O2
 
 This will be used to compile .c files.
diff -Naur cdb-0.75.orig/error.h cdb-0.75-cur/error.h
--- cdb-0.75.orig/error.h	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/error.h	2005-07-26 21:09:55.000000000 +0900
@@ -1,7 +1,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-extern int errno;
+#include <errno.h>
 
 extern int error_intr;
 extern int error_nomem;
diff -Naur cdb-0.75.orig/install.c cdb-0.75-cur/install.c
--- cdb-0.75.orig/install.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/install.c	2005-07-26 21:40:13.000000000 +0900
@@ -1,3 +1,7 @@
+
+#include <unistd.h>
+#include <sys/stat.h>
+
 #include "buffer.h"
 #include "strerr.h"
 #include "error.h"
diff -Naur cdb-0.75.orig/instcheck.c cdb-0.75-cur/instcheck.c
--- cdb-0.75.orig/instcheck.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/instcheck.c	2005-07-26 21:39:18.000000000 +0900
@@ -1,5 +1,8 @@
+
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+
 #include "strerr.h"
 #include "error.h"
 #include "readwrite.h"
diff -Naur cdb-0.75.orig/seek_cur.c cdb-0.75-cur/seek_cur.c
--- cdb-0.75.orig/seek_cur.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/seek_cur.c	2005-07-26 21:33:03.000000000 +0900
@@ -1,4 +1,6 @@
+
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define CUR 1 /* sigh */
diff -Naur cdb-0.75.orig/seek_set.c cdb-0.75-cur/seek_set.c
--- cdb-0.75.orig/seek_set.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/seek_set.c	2005-07-26 21:32:50.000000000 +0900
@@ -1,4 +1,6 @@
+
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define SET 0 /* sigh */
diff -Naur cdb-0.75.orig/str.h cdb-0.75-cur/str.h
--- cdb-0.75.orig/str.h	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/str.h	2005-07-26 21:23:37.000000000 +0900
@@ -4,7 +4,7 @@
 extern unsigned int str_copy(char *,char *);
 extern int str_diff(char *,char *);
 extern int str_diffn(char *,char *,unsigned int);
-extern unsigned int str_len(char *);
+extern unsigned int str_len(const char*);
 extern unsigned int str_chr(char *,int);
 extern unsigned int str_rchr(char *,int);
 extern int str_start(char *,char *);
diff -Naur cdb-0.75.orig/str_len.c cdb-0.75-cur/str_len.c
--- cdb-0.75.orig/str_len.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/str_len.c	2005-07-26 21:24:06.000000000 +0900
@@ -1,8 +1,8 @@
 #include "str.h"
 
-unsigned int str_len(char *s)
+unsigned int str_len(const char* s)
 {
-  register char *t;
+  register const char* t;
 
   t = s;
   for (;;) {
diff -Naur cdb-0.75.orig/testzero.c cdb-0.75-cur/testzero.c
--- cdb-0.75.orig/testzero.c	2000-02-20 05:42:05.000000000 +0900
+++ cdb-0.75-cur/testzero.c	2005-07-26 21:13:28.000000000 +0900
@@ -1,3 +1,6 @@
+
+#include <unistd.h>
+
 #include "uint32.h"
 #include "scan.h"
 #include "strerr.h"
