Fix various mismatched prototypes and other compilation problems.

Core (make cpc) builds again, but crashes on startup.
diff --git a/contiki/ctk/ctk.c b/contiki/ctk/ctk.c
index 2523d1e..b54e823 100644
--- a/contiki/ctk/ctk.c
+++ b/contiki/ctk/ctk.c
@@ -1231,8 +1231,8 @@
   register char *cptr, *cptr2;
   static unsigned char len, txpos, typos, tlen;
 
-  if(t->input != NULL && t->input(c, t)) {
-    return;
+  if(t->input != NULL && t->input(c, (void*)t)) {
+      return;
   }
 
   txpos = t->xpos;