diff --git a/include/logdig.h b/include/logdig.h
index 5e16fe5f95ba39c8869fb22fc1f6f1f192969793..9427d3d4d5cb6747d18a2f44817ef3bb7b5107a5 100644
--- a/include/logdig.h
+++ b/include/logdig.h
@@ -45,8 +45,4 @@ extern const log_16_ivarr log_16_iv;
 extern const log_16_vbarr log_16_vb;
 extern const log_16_bvarr log_16_bv;
 
-#undef vextern
-
 #endif /*LOGDIG_H*/
-
-
diff --git a/include/loghier.h b/include/loghier.h
index 2b527429f898b9da0788d7dee5b5227f3e31ac80..eb44224319b7eba21d29d6d82bd1b60cd2b426e1 100644
--- a/include/loghier.h
+++ b/include/loghier.h
@@ -4,8 +4,6 @@
 #include "logdef.h"
 #include <utils/newasm.h>
 #include <graphics/mylib.h>
-typedef short log_shintarray[log_million];
-
 
 void hier_init (log_action_t *act);
 int commandlabel (log_lrec *lp, char *cmd, char *args);
diff --git a/src/logsim.c b/src/logsim.c
index 23dc97a34dec78398ca630e7951592a72e4bda3b..0e3231619078f28d9913069dd15ac73e49f83e8e 100644
--- a/src/logsim.c
+++ b/src/logsim.c
@@ -35,9 +35,6 @@
    */
 
 
-/* $debug$ {*/
-
-
 #include <utils/p2c.h>
 #include <stdlib.h>
 #include "logsim.h"
@@ -45,11 +42,6 @@
 #include "tool.h"
 #include "logstuff.h"
 
-/*$ if debugging $
-  $ debug on $
-  $ end $*/
-
-
 
 #define traceactions    false
 
@@ -79,8 +71,6 @@ static const histcolortabletype histcolortable = {
 };
 
 
-
-
 static long newsystime, oldsystime, stabtime, resetcounter;
 static log_sigrec *vddsig, *gndsig, *resetsig;
 static int isstable, stabilizing, passready, maketimebid;
@@ -1363,12 +1353,12 @@ static char *log_action_tkinds_NAMES[] =
 
 static char *actionname(char *Result, log_actionkinds action)
 {
-	long i;
+	size_t i;
 	char s[33];
 
 	strcpy(s, log_action_tkinds_NAMES[(long)action]);
-	i = strlen(s) + 1;
-	s[i - 1] = '\0';
+	i = strlen(s);
+	s[i] = '\0';
 	return strcpy(Result, s);
 }
 
@@ -1397,7 +1387,7 @@ static void showgatepins(log_grec *g)
 
 
 
-static void newnode_16(log_action_t *lact,log_nrec ** n)
+static void newnode_16(log_action_t *lact,log_nrec **n)
 {
 	log_action_t *WITH;
 
diff --git a/src/logsimasm.c b/src/logsimasm.c
index 1b9f1e26698d3298bef5f82625aa7e455bb16410..625ec1390c9d30412f97469309318c7ccc5cf9f5 100644
--- a/src/logsimasm.c
+++ b/src/logsimasm.c
@@ -64,8 +64,8 @@ void logsima_init()
 
 void clearnodes(log_nrec *n)
 {
-	register log_tool *tool16 = logsima_action.lact->acttool;
-	register nodeinfo *nip;
+	log_tool *tool16 = logsima_action.lact->acttool;
+	nodeinfo *nip;
 
 	while (n)
 	{
@@ -81,10 +81,10 @@ void clearnodes(log_nrec *n)
 
 void copynodes(log_nrec *n, int *stable)
 {
-	register log_tool *tool16 = logsima_action.lact->acttool;
-	register nodeinfo *nip;
-	register int st = *stable;
-	register log_16_value newv;
+	log_tool *tool16 = logsima_action.lact->acttool;
+	nodeinfo *nip;
+	int st = *stable;
+	log_16_value newv;
 
 	while (n)
 	{
@@ -259,7 +259,7 @@ static char *debug_dasm()
 
 static log_nrec *g_pinnum()
 {
-	register uchar ch;
+	uchar ch;
 
 	if (TRACE_OPS) nc_printf("g_pinnum: %s\n", debug_dasm());
 	switch ((ch = *g_proc++))
@@ -287,8 +287,8 @@ static log_nrec *g_pinnum()
 
 static log_16_value g_expr()
 {
-	register uchar ch;
-	register nodeinfo *nip;
+	uchar ch;
+	nodeinfo *nip;
 
 	if (TRACE_OPS) nc_printf("g_expr: %s\n", debug_dasm());
 	switch ((ch = *g_proc++))
@@ -389,10 +389,10 @@ static log_16_value g_expr()
 
 static void g_stmts()
 {
-	register uchar ch, ch2;
-	register int temp;
-	register log_nrec *np;
-	register nodeinfo *nip;
+	uchar ch, ch2;
+	int temp;
+	log_nrec *np;
+	nodeinfo *nip;
 
 	for (;;)
 	{
@@ -666,7 +666,7 @@ void executeprog(uchar *pr, log_nrec **pins, gateinfo *ginfo, na_long *vars)
 
 void executegates(int *active, log_grec *g)
 {
-	register log_tool *tool16 = logsima_action.lact->acttool;
+	log_tool *tool16 = logsima_action.lact->acttool;
 
 	while (g && g->kind->simtype != tool16)
 		g = g->next;
diff --git a/src/logsimh.c b/src/logsimh.c
index dc65bbbd768b71e7d04ad63a3f25c2450abd09d2..91dd0cf97cc29ae1d9473b7777b9a0baae35fddd 100644
--- a/src/logsimh.c
+++ b/src/logsimh.c
@@ -5686,5 +5686,3 @@ void Log_16_digh(log_16_action *act)
 	}
 }
 
-
-