From 504d71d78d58802c7db0de9e74ebaec7c558a006 Mon Sep 17 00:00:00 2001
From: Eliah Rebstock <elireb54@outlook.com>
Date: Wed, 30 Jan 2019 19:38:38 +0100
Subject: [PATCH] draft

---
 Makefile                   |  12 +-
 include/ana/capfloat.h     |  13 +-
 include/ana/devtechn.h     |  13 +-
 include/ana/devtechp.h     |  14 +-
 include/ana/diode1.h       |  12 +-
 include/ana/ganglion.h     |  13 +-
 include/ana/globals.h      | 285 ++++++++++++-------------
 include/ana/hres.h         |  13 +-
 include/ana/idiff.h        |  15 +-
 include/ana/inter.h        |  17 +-
 include/ana/iscope.h       |   8 +-
 include/ana/iswitch1.h     |   8 +-
 include/ana/iswitch2.h     |   8 +-
 include/ana/main.h         |   8 +-
 include/ana/mmeter.h       |   9 +-
 include/ana/moscap.h       |   7 +-
 include/ana/nfet4.h        |   7 +-
 include/ana/nfet5.h        |   8 +-
 include/ana/nfet7f.h       |   7 +-
 include/ana/nfet7t.h       |  13 +-
 include/ana/npn1.h         |  13 +-
 include/ana/npn2.h         |  13 +-
 include/ana/nsolver.h      |  11 +-
 include/ana/nspc1.h        |  13 +-
 include/ana/numbers.h      |  15 +-
 include/ana/pfet4.h        |  14 +-
 include/ana/pfet5.h        |  14 +-
 include/ana/pfet6.h        |  14 +-
 include/ana/pfet7f.h       |  13 +-
 include/ana/pfet7t.h       |  13 +-
 include/ana/physical.h     |  13 --
 include/ana/pnp1.h         |  13 +-
 include/ana/pnp2.h         |  14 +-
 include/ana/pspc1.h        |  14 +-
 include/ana/pwl.h          |  13 +-
 include/ana/resfloat.h     |  15 +-
 include/ana/rtd.h          |  13 +-
 include/ana/runspec.h      |  13 +-
 include/ana/stairs.h       |  14 +-
 include/ana/tc.h           |  14 +-
 include/ana/thermal.h      |  13 +-
 include/ana/vdiff.h        |  14 +-
 include/ana/vswitch.h      |  14 +-
 include/configreader.h     |   5 +-
 include/gate.h             |  12 +-
 include/graphics/mylib.h   | 115 ++++++++--
 include/graphics/newci.h   |  11 +-
 include/graphics/newcrt.h  |   9 +-
 include/graphics/newkbd.h  |   8 +-
 include/help.h             |   3 +-
 include/label.h            |   8 +-
 include/log.h              |   7 +-
 include/log_action.h       | 349 -------------------------------
 include/logcom.h           |   8 +-
 include/logcurs_arr.h      |   1 +
 include/logcurs_box.h      |   1 +
 include/logcurs_cpy.h      |   1 +
 include/logcurs_del.h      |   1 +
 include/logcurs_prb.h      |   1 +
 include/logdef.h           | 416 ++++++++++++++++++++++++++++++++++---
 include/logdig.h           |  36 ++--
 include/logfont.h          |   2 +-
 include/logglobals.h       |  10 +-
 include/loghier.h          |   7 +-
 include/logntk.h           |  14 +-
 include/logsim.h           |  15 +-
 include/logsima.h          |  32 +--
 include/logsimed.h         |   9 +-
 include/logsimh.h          |  15 +-
 include/logspc.h           |  14 +-
 include/logstructs.h       |  12 +-
 include/logstuff.h         |   5 +-
 include/mygates.h          |   9 +-
 include/node.h             |   5 +-
 include/page.h             |   5 +-
 include/pagereader.h       |   5 +-
 include/pagewriter.h       |   5 +-
 include/screen.h           |   5 +-
 include/settings.h         |   5 +-
 include/swap.h             |   3 +-
 include/tool.h             |   5 +-
 include/utils.h            |   4 +-
 include/utils/filepack.h   |   7 +-
 include/utils/iodecl.h     |   8 +-
 include/utils/misc.h       |   8 +-
 include/utils/newasm.h     |   7 +-
 include/utils/p2c.h        |  10 +-
 include/utils/regex.h      |  12 +-
 include/utils/strings.h    |   5 +-
 include/utils/strlist.h    |   7 +-
 include/utils/sysdevs.h    |   8 +-
 include/utils/sysglobals.h |   8 +-
 include/wire.h             |   9 +-
 src/ana/devtechn.c         |  27 +--
 src/ana/devtechp.c         |  27 +--
 src/ana/diode1.c           |  61 ++----
 src/ana/ganglion.c         |  59 ++----
 src/ana/globals.c          | 122 +++--------
 src/ana/hres.c             |  65 ++----
 src/ana/idiff.c            |  90 +++-----
 src/ana/iscope.c           |  65 ++----
 src/ana/iswitch1.c         |  98 +++------
 src/ana/iswitch2.c         |  98 +++------
 src/ana/main.c             |  18 +-
 src/ana/mmeter.c           |  61 ++----
 src/ana/moscap.c           |  37 ++--
 src/ana/nfet4.c            |  42 ++--
 src/ana/nfet5.c            |  37 ++--
 src/ana/nfet7f.c           |  43 ++--
 src/ana/nfet7t.c           |  44 ++--
 src/ana/npn1.c             |  59 ++----
 src/ana/npn2.c             |  59 ++----
 src/ana/nspc1.c            |  87 +++-----
 src/ana/pfet4.c            |  37 ++--
 src/ana/pfet5.c            |  37 ++--
 src/ana/pfet6.c            |  37 ++--
 src/ana/pfet7f.c           |  44 ++--
 src/ana/pfet7t.c           |  43 ++--
 src/ana/physical.c         |  28 +--
 src/ana/pnp1.c             |  59 ++----
 src/ana/pnp2.c             |  59 ++----
 src/ana/pspc1.c            |  69 +++---
 src/ana/pwl.c              |  95 +++------
 src/ana/resfloat.c         |  42 ++--
 src/ana/rtd.c              |  40 ++--
 src/ana/runspec.c          |  23 +-
 src/ana/stairs.c           |  86 +++-----
 src/ana/tc.c               |  80 +++----
 src/ana/thermal.c          |  33 +--
 src/diggates.c             |  11 +-
 src/graphics/mylib.c       | 349 +++++++------------------------
 src/graphics/newci.c       |  16 +-
 src/graphics/newcrt.c      |   3 +-
 src/log.c                  |  34 ++-
 src/logdef.c               |  77 -------
 src/logdig.c               |  22 --
 src/loghier.c              |   5 +-
 src/logntk.c               | 129 +++---------
 src/logsim.c               |   8 +-
 src/logsimasm.c            |  47 ++---
 src/logsimed.c             | 108 +++-------
 src/logsimh.c              |  29 +--
 src/logspc.c               | 133 +++---------
 src/page.c                 |   3 +-
 src/pagereader.c           |   6 +
 src/pagewriter.c           |   8 +
 src/screen.c               |  13 +-
 src/tool.c                 |   7 +-
 src/utils/filepack.c       |   7 +-
 src/utils/p2c.c            |  10 -
 src/utils/strings.c        |   2 +-
 src/wire.c                 |  12 +-
 152 files changed, 1651 insertions(+), 3466 deletions(-)
 delete mode 100644 include/log_action.h
 delete mode 100644 src/logdef.c

diff --git a/Makefile b/Makefile
index 8241471..886e8ab 100644
--- a/Makefile
+++ b/Makefile
@@ -39,16 +39,18 @@ LIBX11 = -lX11
 
 OTHERLIBS= -lm
 
-CHIPMUNKCC = gcc
+CHIPMUNKCC = g++
 
 CC = $(CHIPMUNKCC)
 
 CHIPMUNKFLAGS = $(ARCH_OPT)
 
-STDC = gnu11
+STDC = c++98
+
+WARN = -g -w # -Wall -Wextra
 
 CFLAGS = $(CHIPMUNKFLAGS) -I$(LOGINC) -I$(XINCLUDEDIR)	\
-	 -DLOGLIB="\"$(LOGLIBDIR)\"" -DF_OK=0 -std=$(STDC) -DCHIPLIB=$(LIBDIR) -g -Wall -Wextra
+	 -DLOGLIB="\"$(LOGLIBDIR)\"" -DF_OK=0 -std=$(STDC) -DCHIPLIB=$(LIBDIR) $(WARN)
 
 ## (3) Choosing default fonts
 ## --------------------------
@@ -139,14 +141,14 @@ clean:
 	rm -rf docs
 	rm -rf $(TARGET_DIR)/*
 
-all: setup clean main
+all: setup main
 
 setup:
 	-if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi
 
 main: $(TARGET_DIR)/log $(TARGET_DIR)/loged
 
-LOGOBJ = $(TARGET_DIR)/log.o $(TOOLOBJ) $(TARGET_DIR)/tooldir.o $(TARGET_DIR)/logdef.o $(TARGET_DIR)/logstuff.o
+LOGOBJ = $(TARGET_DIR)/log.o $(TOOLOBJ) $(TARGET_DIR)/tooldir.o $(TARGET_DIR)/logstuff.o
 LOGEDOBJ = $(TARGET_DIR)/loged.o $(TARGET_DIR)/simdir.o $(SIMOBJ) $(TARGET_DIR)/logstuff.o
 
 $(SRC_DIR)/tooldir.c: $(TOOLOBJ)
diff --git a/include/ana/capfloat.h b/include/ana/capfloat.h
index 12178f3..d74c5ba 100644
--- a/include/ana/capfloat.h
+++ b/include/ana/capfloat.h
@@ -1,16 +1,5 @@
-#ifndef CAPFLOAT_H
-#define CAPFLOAT_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 void Log_capfloat_initlib_32 (Analog_32_action *act);
-
-#endif /*CAPFLOAT_H*/
-
-
diff --git a/include/ana/devtechn.h b/include/ana/devtechn.h
index deefc4f..1995068 100644
--- a/include/ana/devtechn.h
+++ b/include/ana/devtechn.h
@@ -1,16 +1,5 @@
-#ifndef DEVTECHN_H
-#define DEVTECHN_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_DEVTECHN_initlib_32 (Analog_32_action *act);
-
-#endif /*DEVTECHN_H*/
-
-
diff --git a/include/ana/devtechp.h b/include/ana/devtechp.h
index 08252ac..fe1b5c6 100644
--- a/include/ana/devtechp.h
+++ b/include/ana/devtechp.h
@@ -1,17 +1,5 @@
-#ifndef DEVTECHP_H
-#define DEVTECHP_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_DEVTECHP_initlib_32 (Analog_32_action *act);
-
-
-#endif /*DEVTECHP_H*/
-
-
diff --git a/include/ana/diode1.h b/include/ana/diode1.h
index 68f5702..58c9ae9 100644
--- a/include/ana/diode1.h
+++ b/include/ana/diode1.h
@@ -1,15 +1,5 @@
-#ifndef DIODE1_H
-#define DIODE1_H
+#pragma once
 
-#include "logdef.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_Diode1_INITLIB_32 (Analog_32_action *act);
-
-#endif /*DIODE1_H*/
-
-
diff --git a/include/ana/ganglion.h b/include/ana/ganglion.h
index 57e3e6a..a6a9de1 100644
--- a/include/ana/ganglion.h
+++ b/include/ana/ganglion.h
@@ -1,16 +1,5 @@
-#ifndef GANGLION_H
-#define GANGLION_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_ganglion_initlib_32 (Analog_32_action *act);
-
-#endif /*GANGLION_H*/
-
-
diff --git a/include/ana/globals.h b/include/ana/globals.h
index 5049978..770299b 100644
--- a/include/ana/globals.h
+++ b/include/ana/globals.h
@@ -1,18 +1,6 @@
-#ifndef GLOBALS_H
-#define GLOBALS_H
-
+#pragma once
 
 #include "logdef.h"
-#include <graphics/newci.h>
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-
-#ifdef GLOBALS_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 
 /*T*/
 
@@ -399,78 +387,78 @@ typedef struct AnaKlistnode {
 /*******************************************************************************/
 /*System data structures*/
 
-vextern log_action_t *AnaLogglobals;   ///< Log's global variables
-vextern log_action_t *AnaLogIglobals;   ///< Log's global variables
-vextern AnaInt_rec *AnaInt_nodelist;   ///< List of current internal pointers
-vextern AnaAnalog_Colors AnaColormap;   ///< The color map
-vextern AnaAnalog_Levels AnaLevelmap;   ///< The glow mode level map
-vextern AnaCheckarray AnaLimits;   ///< Array for checking system parameters
-vextern AnaCommand_rec *AnaClist;   ///< Structure for holding cnf commands
-vextern AnaKlistnode *AnaKlist;   ///< Structure for tracking analog gates
-vextern log_sigrec *AnaVddsig, *Anagndsig;
+log_action_t *AnaLogglobals;   ///< Log's global variables
+log_action_t *AnaLogIglobals;   ///< Log's global variables
+AnaInt_rec *AnaInt_nodelist;   ///< List of current internal pointers
+AnaAnalog_Colors AnaColormap;   ///< The color map
+AnaAnalog_Levels AnaLevelmap;   ///< The glow mode level map
+AnaCheckarray AnaLimits;   ///< Array for checking system parameters
+AnaCommand_rec *AnaClist;   ///< Structure for holding cnf commands
+AnaKlistnode *AnaKlist;   ///< Structure for tracking analog gates
+log_sigrec *AnaVddsig, *Anagndsig;
     ///< Signal pointers for Vdd and Gnd
-vextern log_nrec *AnaVddnode, *Anagndnode;
+log_nrec *AnaVddnode, *Anagndnode;
     ///< Signal pointers for Vdd and Gnd
 
 
 
-vextern char AnaCh;   ///< Used for 'press any key' debugging
+char AnaCh;   ///< Used for 'press any key' debugging
 
 
 /*******************************************************************************/
 /*Variables that show the state of my simulation and state machine*/
 
-vextern int AnaReady;   ///< Says That a circuit is ready to simulate
-vextern int AnaChanged;   ///< Says That a change has been made
+int AnaReady;   ///< Says That a circuit is ready to simulate
+int AnaChanged;   ///< Says That a change has been made
 
 /*Holds state of simulation proper*/
 
-vextern int AnaStart;   ///< Indicates whether this is initial timestep
-vextern int AnaError;   ///< Simulation flag
-vextern int AnaDone;    ///< Simulation flags
-vextern int AnaOverflow;   ///< Simulation flags
-vextern int AnaToobig;   ///< Simulation flag
-vextern int AnaToosmall;   ///< Simulation flag
-vextern int AnaSuccess;   ///< Simulation flag
-vextern long AnaItercount; ///< Variables for adaptive iteration watchdog
-vextern long AnaItermax; ///< Variables for adaptive iteration watchdog
-vextern double AnaAccum;   ///< Total accumulated timed
-vextern double AnaDt; ///< Present timestep of system
-vextern double AnaDtlast;   ///< Last timestep of system
-vextern int AnaChangedDt;   ///< A new dt has happened
-vextern int AnaChangedP;   ///< A transistor parameter has changed
-vextern int AnaInuse;   ///< At least one analog gate exists
-vextern long AnaDtcount;   ///< Counting variable to prevent roundoff
-vextern long AnaRelaxcount;
+int AnaStart;   ///< Indicates whether this is initial timestep
+int AnaError;   ///< Simulation flag
+int AnaDone;    ///< Simulation flags
+int AnaOverflow;   ///< Simulation flags
+int AnaToobig;   ///< Simulation flag
+int AnaToosmall;   ///< Simulation flag
+int AnaSuccess;   ///< Simulation flag
+long AnaItercount; ///< Variables for adaptive iteration watchdog
+long AnaItermax; ///< Variables for adaptive iteration watchdog
+double AnaAccum;   ///< Total accumulated timed
+double AnaDt; ///< Present timestep of system
+double AnaDtlast;   ///< Last timestep of system
+int AnaChangedDt;   ///< A new dt has happened
+int AnaChangedP;   ///< A transistor parameter has changed
+int AnaInuse;   ///< At least one analog gate exists
+long AnaDtcount;   ///< Counting variable to prevent roundoff
+long AnaRelaxcount;
     ///< Comparison variable for Dtcount for relaxation
-vextern int AnaExact;   ///< Flag for doing accuracy checking
-vextern int AnaDifficult;   ///< Flag for a difficult simulation
-vextern int AnaToomany;   ///< Flag for too many iterations
-vextern int AnaErase;   ///< State of reset memory
-vextern int AnaOldmodel;   ///< Model selection when loading in gates
-vextern int AnaDebugset;   ///< Flag used in debugging mode
-vextern long AnaDebugsize;   ///< Number of significant digits for debug mode
-vextern int AnaTimermode;   ///< Mode selection for benchmarking
-vextern int AnaTimerstate;   ///< State bit for timer state machine
-vextern long AnaTimerval;   ///< Benchmark memory location
-vextern double AnaVshift;   ///< Smallest voltage not requiring a gearshift
-vextern int AnaDimgate;   ///< Switch for dimming unconnected gates
-
-vextern int AnaProbeOn;   ///< State of probe mode
-vextern char AnaLastnodeStr[256];   ///< last node voltage displayed
-vextern char AnaLastGate1Str[256];   ///< last gate1 message displayed
-vextern char AnaLastGate2Str[256];   ///< last gate2 message displayed
-vextern char AnaLastGate3Str[256];   ///< last gate3 message displayed
-vextern char AnaLastGate4Str[256];   ///< last gate3 message displayed
-vextern char AnaLastGate5Str[256];   ///< last gate3 message displayed
-
-vextern long AnaGateHystercount;   ///< Hysteresis counter for probemode
-vextern long AnaNodeHystercount;   ///< Hysteresis counter for probemode
-
-vextern Anaepochs_type AnaEpoch;   ///< Holds present epoch of simulator
-vextern long AnaLastpage;   ///< Lastpage evaluated;  0->Clear array
-vextern log_grec *AnaLastgate;   ///< Lastgate evaluated
-vextern Anatimetype AnaTimestate;   ///< Present time state of system
+int AnaExact;   ///< Flag for doing accuracy checking
+int AnaDifficult;   ///< Flag for a difficult simulation
+int AnaToomany;   ///< Flag for too many iterations
+int AnaErase;   ///< State of reset memory
+int AnaOldmodel;   ///< Model selection when loading in gates
+int AnaDebugset;   ///< Flag used in debugging mode
+long AnaDebugsize;   ///< Number of significant digits for debug mode
+int AnaTimermode;   ///< Mode selection for benchmarking
+int AnaTimerstate;   ///< State bit for timer state machine
+long AnaTimerval;   ///< Benchmark memory location
+double AnaVshift;   ///< Smallest voltage not requiring a gearshift
+int AnaDimgate;   ///< Switch for dimming unconnected gates
+
+int AnaProbeOn;   ///< State of probe mode
+char AnaLastnodeStr[256];   ///< last node voltage displayed
+char AnaLastGate1Str[256];   ///< last gate1 message displayed
+char AnaLastGate2Str[256];   ///< last gate2 message displayed
+char AnaLastGate3Str[256];   ///< last gate3 message displayed
+char AnaLastGate4Str[256];   ///< last gate3 message displayed
+char AnaLastGate5Str[256];   ///< last gate3 message displayed
+
+long AnaGateHystercount;   ///< Hysteresis counter for probemode
+long AnaNodeHystercount;   ///< Hysteresis counter for probemode
+
+Anaepochs_type AnaEpoch;   ///< Holds present epoch of simulator
+long AnaLastpage;   ///< Lastpage evaluated;  0->Clear array
+log_grec *AnaLastgate;   ///< Lastgate evaluated
+Anatimetype AnaTimestate;   ///< Present time state of system
 
 
 /*******************************************************************************/
@@ -481,92 +469,91 @@ vextern Anatimetype AnaTimestate;   ///< Present time state of system
     Quit:Boolean;              {Variable for watchdog}
 $end$*/
 
-vextern long AnaStoptime;   ///< Variable for 'slow' watchdog
+long AnaStoptime;   ///< Variable for 'slow' watchdog
 /*******************************************************************************/
 
 
 /*******************************************************************************/
 /*simulation variables open to the public*/
 
-vextern double AnaVdd;   ///< System Power
-vextern double AnaDtmax;   ///< largest allowable timestep
-vextern double AnaVstep;   ///< Maximum voltage step allowed in simulation
+double AnaVdd;   ///< System Power
+double AnaDtmax;   ///< largest allowable timestep
+double AnaVstep;   ///< Maximum voltage step allowed in simulation
 
-vextern double AnaHighest;   ///< Highest voltage allowed in simulation
-vextern double AnaLowest;   ///< Lowest voltage allowed in simulation
-vextern double AnaSmall;   ///< Guess on a capacitor when Vc=0
+double AnaHighest;   ///< Highest voltage allowed in simulation
+double AnaLowest;   ///< Lowest voltage allowed in simulation
+double AnaSmall;   ///< Guess on a capacitor when Vc=0
+double AnaTol;   ///< Maximum percentage difference for convergance
+double AnaEqn_Epsilon;   ///< epsilon for equation solver
+double AnaVardone_Epsilon;   ///< epsilon for eqn zer test
 
-vextern double AnaTol;   ///< Maximum percentage difference for convergance
-vextern double AnaEqn_Epsilon;   ///< epsilon for equation solver
-vextern double AnaVardone_Epsilon;   ///< epsilon for eqn zero test
+double AnaTimefactor;   ///< How much to scale timestep
+double AnaTimemin;   ///< lowest allowable timestep
+long AnaIterfirstmax;   ///< Number of iterations for first try
+long AnaTimeincrease;   ///< Factor to increase maximum interation by
+double AnaSrange;   ///< Range of optimal voltage steps in simulation
 
-vextern double AnaTimefactor;   ///< How much to scale timestep
-vextern double AnaTimemin;   ///< lowest allowable timestep
-vextern long AnaIterfirstmax;   ///< Number of iterations for first try
-vextern long AnaTimeincrease;   ///< Factor to increase maximum interation by
-vextern double AnaSrange;   ///< Range of optimal voltage steps in simulation
+double AnaTimerelax;   ///< Minimum time to relax accuracy checking
+double AnaNodecap;   ///< Capacitance on a node
 
-vextern double AnaTimerelax;   ///< Minimum time to relax accuracy checking
-vextern double AnaNodecap;   ///< Capacitance on a node
-
-vextern long AnaProbeprec;   ///< Precision of probe mode displays
-vextern long AnaHysteresis;   ///< Amount of Hysteresis in probe mode
+long AnaProbeprec;   ///< Precision of probe mode displays
+long AnaHysteresis;   ///< Amount of Hysteresis in probe mode
 
 /*******************************************************************************/
 
 /*******************************************************************************/
 /*Variables for equation solver*/
 
-vextern long AnaSysRow, AnaSysCol;
-vextern AnaMatRec *AnaSystem;
-vextern AnaSolve_Type AnaS_Section;
-vextern long AnaLastJ;
+long AnaSysRow, AnaSysCol;
+AnaMatRec *AnaSystem;
+AnaSolve_Type AnaS_Section;
+long AnaLastJ;
 
 /*******************************************************************************/
 
 
 
-extern void AnaAddcommand (char *Keyword, char *Arg);
-extern void AnaAnalog_ChangeReset (int Erase);
-extern void AnaCapattrinsert (long base, long attrnum, log_grec *inst,
+void AnaAddcommand (char *Keyword, char *Arg);
+void AnaAnalog_ChangeReset (int Erase);
+void AnaCapattrinsert (long base, long attrnum, log_grec *inst,
 				 int *Ok);
-extern void AnaCapattrload (long base, log_grec *inst, int first);
-extern void AnaCapattrread (long base, log_grec *inst);
-extern void AnaCapattrwrite (long base, log_grec *inst);
-extern void AnaCapCopy (log_grec *inst);
-extern void AnaCapDispose (log_grec *inst);
-extern void AnaCapex (log_grec *inst);
-extern void AnaCapIin (Analog_32_action *act);
-extern void AnaCapInit (log_grec *inst);
-extern void AnaCappass1 (log_grec *inst);
-extern void AnaCappass2 (log_grec *inst);
-extern void AnaCapReset (log_grec *inst);
-extern void AnaCapUpdate (log_grec *inst);
-extern void AnaDiffdump ();
-extern void AnaDummyGate (Analog_32_action *act);
-extern void AnaDummyInit (log_krec *dummykindptr);
-extern void AnaGetcommand (char *Keyword, char *Arg, int *Found);
-extern void AnaGetvar (char *Varname, double *Value);
-extern void AnaMatdump ();
-extern void AnaPopcommand ();
-extern void AnaTimeinit ();
-extern void AnaTimeReset ();
-extern void AnaParamUpdate ();
-
-extern void AnaScoreboard (char *Newmessage, long purpose);
-extern int AnaCrange (log_grec *Inst, long Attrnum, int OkZero);
-extern int AnaDisplayrange (log_grec *Inst, long Attrnum);
-extern double AnaExpo (double V);
-extern double AnaSqrt (double V);
-extern int AnaGate_On_Display (log_grec *Inst);
-extern long AnaGlowVal (long Intensity);
-extern int AnaQuit ();
-extern char *AnaProbeAmpStr (char *AnaResult, double Val);
-extern char *AnaProbeVoltStr (char *AnaResult, double Val);
-extern double AnaTanch (double V);
-
-
-extern int AnaVrange (log_grec *Inst, long Attrnum);
+void AnaCapattrload (long base, log_grec *inst, int first);
+void AnaCapattrread (long base, log_grec *inst);
+void AnaCapattrwrite (long base, log_grec *inst);
+void AnaCapCopy (log_grec *inst);
+void AnaCapDispose (log_grec *inst);
+void AnaCapex (log_grec *inst);
+void AnaCapIin (Analog_32_action *act);
+void AnaCapInit (log_grec *inst);
+void AnaCappass1 (log_grec *inst);
+void AnaCappass2 (log_grec *inst);
+void AnaCapReset (log_grec *inst);
+void AnaCapUpdate (log_grec *inst);
+void AnaDiffdump ();
+void AnaDummyGate (Analog_32_action *act);
+void AnaDummyInit (log_krec *dummykindptr);
+void AnaGetcommand (char *Keyword, char *Arg, int *Found);
+void AnaGetvar (char *Varname, double *Value);
+void AnaMatdump ();
+void AnaPopcommand ();
+void AnaTimeinit ();
+void AnaTimeReset ();
+void AnaParamUpdate ();
+
+void AnaScoreboard (char *Newmessage, long purpose);
+int AnaCrange (log_grec *Inst, long Attrnum, int OkZero);
+int AnaDisplayrange (log_grec *Inst, long Attrnum);
+double AnaExpo (double V);
+double AnaSqrt (double V);
+int AnaGate_On_Display (log_grec *Inst);
+long AnaGlowVal (long Intensity);
+int AnaQuit ();
+char *AnaProbeAmpStr (char *AnaResult, double Val);
+char *AnaProbeVoltStr (char *AnaResult, double Val);
+double AnaTanch (double V);
+
+
+int AnaVrange (log_grec *Inst, long Attrnum);
 
 /*=========================================================================*/
 /* These structures, and variables, hold physical and fab constants for    */
@@ -626,19 +613,15 @@ typedef struct AnaChannelParameters {
 }AnaChannelParameters;
 
 
-vextern AnaPhysicalConstants AnaPhysical;
-vextern AnaPhysicalConstants AnaMaxPhysical;
-vextern AnaPhysicalConstants AnaMinPhysical;
-vextern AnaFabParameters AnaGenFab;
-vextern AnaFabParameters AnaMaxGenFab;
-vextern AnaFabParameters AnaMinGenFab;
-vextern AnaChannelParameters AnaNFab;
-vextern AnaChannelParameters AnaMaxNFab;
-vextern AnaChannelParameters AnaMinNFab;
-vextern AnaChannelParameters AnaPFab;
-vextern AnaChannelParameters AnaMaxPFab;
-vextern AnaChannelParameters AnaMinPFab;
-
-#undef vextern
-
-#endif /*GLOBALS_H*/
+AnaPhysicalConstants AnaPhysical;
+AnaPhysicalConstants AnaMaxPhysical;
+AnaPhysicalConstants AnaMinPhysical;
+AnaFabParameters AnaGenFab;
+AnaFabParameters AnaMaxGenFab;
+AnaFabParameters AnaMinGenFab;
+AnaChannelParameters AnaNFab;
+AnaChannelParameters AnaMaxNFab;
+AnaChannelParameters AnaMinNFab;
+AnaChannelParameters AnaPFab;
+AnaChannelParameters AnaMaxPFab;
+AnaChannelParameters AnaMinPFab;
diff --git a/include/ana/hres.h b/include/ana/hres.h
index 62c6956..a585d5f 100644
--- a/include/ana/hres.h
+++ b/include/ana/hres.h
@@ -1,16 +1,5 @@
-#ifndef HRES_H
-#define HRES_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_hres_initlib_32 (Analog_32_action *act);
-
-#endif /*HRES_H*/
-
-
diff --git a/include/ana/idiff.h b/include/ana/idiff.h
index 4fa185c..530cbfa 100644
--- a/include/ana/idiff.h
+++ b/include/ana/idiff.h
@@ -1,18 +1,5 @@
-#ifndef IDIFF_H
-#define IDIFF_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_idiff_initlib_32 (Analog_32_action *act);
-
-
-#endif /*IDIFF_H*/
-
-
diff --git a/include/ana/inter.h b/include/ana/inter.h
index 371e308..98d6af4 100644
--- a/include/ana/inter.h
+++ b/include/ana/inter.h
@@ -1,21 +1,6 @@
-#ifndef INTER_H
-#define INTER_H
-
+#pragma once
 
 #include "logdef.h"
-#include <graphics/newkbd.h>
-#include <utils/sysglobals.h>
-#include <utils/newasm.h>
-#include <graphics/mylib.h>
-#include "main.h"
-#include "ana/globals.h"
-#include "ana/nsolver.h"
-#include <graphics/newci.h>
 
 extern void Log_32_proc (log_action_t *act);
 extern void Log_33_proc (log_action_t *act);
-
-
-#endif /*INTER_H*/
-
-
diff --git a/include/ana/iscope.h b/include/ana/iscope.h
index ece18ec..0c671ea 100644
--- a/include/ana/iscope.h
+++ b/include/ana/iscope.h
@@ -1,6 +1,4 @@
-#ifndef ISCOPE_H
-#define ISCOPE_H
-
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -11,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_iscope_initlib_32 (Analog_32_action *act);
-
-#endif /*ISCOPE_H*/
-
-
diff --git a/include/ana/iswitch1.h b/include/ana/iswitch1.h
index 1ee2268..4a18341 100644
--- a/include/ana/iswitch1.h
+++ b/include/ana/iswitch1.h
@@ -1,6 +1,4 @@
-#ifndef ISWITCH1_H
-#define ISWITCH1_H
-
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -11,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_iswitch1_initlib_32 (Analog_32_action *act);
-
-#endif /*ISWITCH1_H*/
-
-
diff --git a/include/ana/iswitch2.h b/include/ana/iswitch2.h
index 4c7f11c..e78c3fa 100644
--- a/include/ana/iswitch2.h
+++ b/include/ana/iswitch2.h
@@ -1,6 +1,4 @@
-#ifndef ISWITCH2_H
-#define ISWITCH2_H
-
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -11,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_iswitch2_initlib_32 (Analog_32_action *act);
-
-#endif /*ISWITCH2_H*/
-
-
diff --git a/include/ana/main.h b/include/ana/main.h
index 833e21e..07da00d 100644
--- a/include/ana/main.h
+++ b/include/ana/main.h
@@ -1,5 +1,4 @@
-#ifndef MAIN_H
-#define MAIN_H
+#pragma once
 
 #include <graphics/newci.h>
 #include <graphics/newcrt.h>
@@ -23,8 +22,3 @@ extern void Analog_Systeminit ();
 extern void Analog_TechnologyCnf ();
 
 extern void Analog_Tstep ();
-
-
-#endif /*MAIN_H*/
-
-
diff --git a/include/ana/mmeter.h b/include/ana/mmeter.h
index 0d5960a..ffa71bc 100644
--- a/include/ana/mmeter.h
+++ b/include/ana/mmeter.h
@@ -1,6 +1,4 @@
-#ifndef MMETER_H
-#define MMETER_H
-
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -11,8 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_mmeter_initlib_32 (Analog_32_action *act);
-
-
-#endif /*MMETER_H*/
-
-
diff --git a/include/ana/moscap.h b/include/ana/moscap.h
index 1c4dd56..dca44da 100644
--- a/include/ana/moscap.h
+++ b/include/ana/moscap.h
@@ -1,5 +1,4 @@
-#ifndef MOSCAP_H
-#define MOSCAP_H
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -10,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_moscap_initlib_32 (Analog_32_action *act);
-
-#endif /*MOSCAP_H*/
-
-
diff --git a/include/ana/nfet4.h b/include/ana/nfet4.h
index 3fe278b..aa3a2f4 100644
--- a/include/ana/nfet4.h
+++ b/include/ana/nfet4.h
@@ -1,5 +1,4 @@
-#ifndef NFET4_H
-#define NFET4_H
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -10,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_nfet4_initlib_32 (Analog_32_action *act);
-
-#endif /*NFET4_H*/
-
-
diff --git a/include/ana/nfet5.h b/include/ana/nfet5.h
index fe853cd..334e27b 100644
--- a/include/ana/nfet5.h
+++ b/include/ana/nfet5.h
@@ -1,6 +1,4 @@
-#ifndef NFET5_H
-#define NFET5_H
-
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -11,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_NFET5_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NFET5_H*/
-
-
diff --git a/include/ana/nfet7f.h b/include/ana/nfet7f.h
index 3f9ee9f..44f344e 100644
--- a/include/ana/nfet7f.h
+++ b/include/ana/nfet7f.h
@@ -1,5 +1,4 @@
-#ifndef NFET7F_H
-#define NFET7F_H
+#pragma once
 
 #include "logdef.h"
 #include "ana/nsolver.h"
@@ -10,7 +9,3 @@
 #include <graphics/newci.h>
 
 extern void Log_NFET7F_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NFET7F_H*/
-
-
diff --git a/include/ana/nfet7t.h b/include/ana/nfet7t.h
index 20ac966..1e32326 100644
--- a/include/ana/nfet7t.h
+++ b/include/ana/nfet7t.h
@@ -1,16 +1,5 @@
-#ifndef NFET7T_H
-#define NFET7T_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_NFET7T_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NFET7T_H*/
-
-
diff --git a/include/ana/npn1.h b/include/ana/npn1.h
index 87fc2a9..17403cd 100644
--- a/include/ana/npn1.h
+++ b/include/ana/npn1.h
@@ -1,16 +1,5 @@
-#ifndef NPN1_H
-#define NPN1_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_NPN1_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NPN1_H*/
-
-
diff --git a/include/ana/npn2.h b/include/ana/npn2.h
index 32abe5a..3fb4a77 100644
--- a/include/ana/npn2.h
+++ b/include/ana/npn2.h
@@ -1,16 +1,5 @@
-#ifndef NPN2_H
-#define NPN2_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_NPN2_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NPN2_H*/
-
-
diff --git a/include/ana/nsolver.h b/include/ana/nsolver.h
index c2792fb..2f5e277 100644
--- a/include/ana/nsolver.h
+++ b/include/ana/nsolver.h
@@ -1,12 +1,3 @@
-#ifndef NSOLVER_H
-#define NSOLVER_H
-
-
-#include "ana/globals.h"
-#include "logdef.h"
+#pragma once
 
 void Solve ();
-
-#endif /*NSOLVER_H*/
-
-
diff --git a/include/ana/nspc1.h b/include/ana/nspc1.h
index bbbc487..db46d22 100644
--- a/include/ana/nspc1.h
+++ b/include/ana/nspc1.h
@@ -1,16 +1,5 @@
-#ifndef NSPC1_H
-#define NSPC1_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_NSPC1_INITLIB_32 (Analog_32_action *act);
-
-#endif /*NFET7_H*/
-
-
diff --git a/include/ana/numbers.h b/include/ana/numbers.h
index 313f841..cf22c15 100644
--- a/include/ana/numbers.h
+++ b/include/ana/numbers.h
@@ -1,18 +1,5 @@
-#ifndef NUMBERS_H
-#define NUMBERS_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
-
 
 extern void Log_numbers_initlib_32 (Analog_32_action *act);
-
-
-#endif /*NUMBERS_H*/
-
-
diff --git a/include/ana/pfet4.h b/include/ana/pfet4.h
index 71b3e5e..8f2c74e 100644
--- a/include/ana/pfet4.h
+++ b/include/ana/pfet4.h
@@ -1,17 +1,5 @@
-#ifndef PFET4_H
-#define PFET4_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_pfet4_initlib_32 (Analog_32_action *act);
-
-#endif /*PFET4_H*/
-
-
diff --git a/include/ana/pfet5.h b/include/ana/pfet5.h
index c374d72..2ebf1a5 100644
--- a/include/ana/pfet5.h
+++ b/include/ana/pfet5.h
@@ -1,17 +1,5 @@
-#ifndef PFET5_H
-#define PFET5_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PFET5_INITLIB_32 (Analog_32_action *act);
-
-
-#endif /*PFET5_H*/
-
-
diff --git a/include/ana/pfet6.h b/include/ana/pfet6.h
index c50d17e..cadb245 100644
--- a/include/ana/pfet6.h
+++ b/include/ana/pfet6.h
@@ -1,17 +1,5 @@
-#ifndef PFET6_H
-#define PFET6_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PFET6_INITLIB_32 (Analog_32_action *act);
-
-#endif /*PFET6_H*/
-
-
diff --git a/include/ana/pfet7f.h b/include/ana/pfet7f.h
index 54fd124..fe118c7 100644
--- a/include/ana/pfet7f.h
+++ b/include/ana/pfet7f.h
@@ -1,16 +1,5 @@
-#ifndef PFET7F_H
-#define PFET7F_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PFET7F_INITLIB_32 (Analog_32_action *act);
-
-#endif /*PFET7F_H*/
-
-
diff --git a/include/ana/pfet7t.h b/include/ana/pfet7t.h
index 89bd728..3bd8a1f 100644
--- a/include/ana/pfet7t.h
+++ b/include/ana/pfet7t.h
@@ -1,16 +1,5 @@
-#ifndef PFET7T_H
-#define PFET7T_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PFET7T_INITLIB_32 (Analog_32_action *act);
-
-#endif /*PFET7T_H*/
-
-
diff --git a/include/ana/physical.h b/include/ana/physical.h
index 4ad8180..d1170df 100644
--- a/include/ana/physical.h
+++ b/include/ana/physical.h
@@ -1,16 +1,3 @@
-#ifndef PHYSICAL_H
-#define PHYSICAL_H
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PHYSICAL_initlib_32 (Analog_32_action *act);
-
-#endif /*PHYSICAL_H*/
-
-
diff --git a/include/ana/pnp1.h b/include/ana/pnp1.h
index b0add96..3468bf6 100644
--- a/include/ana/pnp1.h
+++ b/include/ana/pnp1.h
@@ -1,16 +1,5 @@
-#ifndef PNP1_H
-#define PNP1_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PNP1_INITLIB_32 (Analog_32_action *act);
-
-#endif /*PNP1_H*/
-
-
diff --git a/include/ana/pnp2.h b/include/ana/pnp2.h
index c1925b8..6a963ef 100644
--- a/include/ana/pnp2.h
+++ b/include/ana/pnp2.h
@@ -1,17 +1,5 @@
-#ifndef PNP2_H
-#define PNP2_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PNP2_INITLIB_32 (Analog_32_action *act);
-
-
-#endif /*PNP2_H*/
-
-
diff --git a/include/ana/pspc1.h b/include/ana/pspc1.h
index 405124e..9191f5d 100644
--- a/include/ana/pspc1.h
+++ b/include/ana/pspc1.h
@@ -1,17 +1,5 @@
-#ifndef PSPC1_H
-#define PSPC1_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_PSPC1_INITLIB_32 (Analog_32_action *act);
-
-
-#endif /*PSPC1_H*/
-
-
diff --git a/include/ana/pwl.h b/include/ana/pwl.h
index 9256555..0025896 100644
--- a/include/ana/pwl.h
+++ b/include/ana/pwl.h
@@ -1,16 +1,5 @@
-#ifndef PWL_H
-#define PWL_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_pwl_initlib_32 (Analog_32_action *act);
-
-#endif /*PWL_H*/
-
-
diff --git a/include/ana/resfloat.h b/include/ana/resfloat.h
index 27f288e..99a4f03 100644
--- a/include/ana/resfloat.h
+++ b/include/ana/resfloat.h
@@ -1,18 +1,5 @@
-#ifndef RESFLOAT_H
-#define RESFLOAT_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_resfloat_initlib_32 (Analog_32_action *act);
-
-
-#endif /*RESFLOAT_H*/
-
-
diff --git a/include/ana/rtd.h b/include/ana/rtd.h
index 801e974..75b3d2f 100644
--- a/include/ana/rtd.h
+++ b/include/ana/rtd.h
@@ -1,16 +1,5 @@
-#ifndef RTD_H
-#define RTD_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_rtd_initlib_32 (Analog_32_action *act);
-
-#endif /*RTD_H*/
-
-
diff --git a/include/ana/runspec.h b/include/ana/runspec.h
index f8684ef..880bbb6 100644
--- a/include/ana/runspec.h
+++ b/include/ana/runspec.h
@@ -1,16 +1,5 @@
-#ifndef RUNSPEC_H
-#define RUNSPEC_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_RUNSPEC_initlib_32 (Analog_32_action *act);
-
-#endif /*RUNSPEC_H*/
-
-
diff --git a/include/ana/stairs.h b/include/ana/stairs.h
index 4e6f71e..846ce6b 100644
--- a/include/ana/stairs.h
+++ b/include/ana/stairs.h
@@ -1,17 +1,5 @@
-#ifndef STAIRS_H
-#define STAIRS_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_stairs_initlib_32 (Analog_32_action *act);
-
-#endif /*STAIRS_H*/
-
-
diff --git a/include/ana/tc.h b/include/ana/tc.h
index 680a3df..d88e24d 100644
--- a/include/ana/tc.h
+++ b/include/ana/tc.h
@@ -1,20 +1,8 @@
-#ifndef TC_H
-#define TC_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_opamp_initlib_32 (Analog_32_action *act);
 extern void Log_wramp_initlib_32 (Analog_32_action *act);
 extern void Log_hwr_initlib_32 (Analog_32_action *act);
 extern void Log_fwr_initlib_32 (Analog_32_action *act);
-
-
-#endif /*TC_H*/
-
-
diff --git a/include/ana/thermal.h b/include/ana/thermal.h
index d932f04..3a1888d 100644
--- a/include/ana/thermal.h
+++ b/include/ana/thermal.h
@@ -1,16 +1,5 @@
-#ifndef THERMAL_H
-#define THERMAL_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_THERMAL_initlib_32 (Analog_32_action *act);
-
-#endif /*THERMAL_H*/
-
-
diff --git a/include/ana/vdiff.h b/include/ana/vdiff.h
index 267d61b..7c81f1f 100644
--- a/include/ana/vdiff.h
+++ b/include/ana/vdiff.h
@@ -1,17 +1,5 @@
-#ifndef VDIFF_H
-#define VDIFF_H
+#pragma once
 
-
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
 
 extern void Log_vdiff_initlib_32 (Analog_32_action *act);
-
-#endif /*VDIFF_H*/
-
-
diff --git a/include/ana/vswitch.h b/include/ana/vswitch.h
index 5599b5c..e6ce4be 100644
--- a/include/ana/vswitch.h
+++ b/include/ana/vswitch.h
@@ -1,17 +1,5 @@
-#ifndef VSWITCH_H
-#define VSWITCH_H
+#pragma once
 
-#include "logdef.h"
-#include "ana/nsolver.h"
 #include "ana/globals.h"
-#include <graphics/mylib.h>
-#include <utils/newasm.h>
-#include <utils/sysglobals.h>
-#include <graphics/newci.h>
-
 
 extern void Log_vswitch_initlib_32 (Analog_32_action *act);
-
-#endif /*VSWITCH_H*/
-
-
diff --git a/include/configreader.h b/include/configreader.h
index 271805e..dadb05d 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -1,5 +1,4 @@
-#ifndef CONFIGREADER_H
-#define CONFIGREADER_H
+#pragma once
 
 #include "pagereader.h"
 
@@ -8,5 +7,3 @@ void endfatal(struct LOC_initialize *LINK);
 void sethomedirname(char *dir_, struct LOC_initialize *LINK);
 void addgatesfile(char *fn_, struct LOC_initialize *LINK);
 void readcnf(char *fn, struct LOC_initialize* LINK);
-
-#endif
diff --git a/include/gate.h b/include/gate.h
index 7f09075..50758b1 100644
--- a/include/gate.h
+++ b/include/gate.h
@@ -1,18 +1,18 @@
-#ifndef GATE_H
-#define GATE_H
+#pragma once
 
 #include <graphics/mylib.h>
 #include <utils/newasm.h>
 #include "logdef.h"
+#include "node.h"
 
 typedef struct log_grec {
   struct log_grec *next, *confnext;
   na_long info;
   log_nrec **pin;
-  log_pinposrec *pinpos;
-  log_gattrrec *attr;
+  struct log_pinposrec *pinpos;
+  struct log_gattrrec *attr;
   na_long vars;
-  log_krec *kind;
+  struct log_krec *kind;
   short g, x, y, gc, sig;
   na_long temp;
   uchar rot;
@@ -54,5 +54,3 @@ void frygate(log_grec *gate);
 void initpinpos(log_grec *gate);
 void addgate2(short x, short y, short gtype, short sig, log_gattrrec *attrs);
 void movexorgate(short x, short y, short g, short sig, short yy);
-
-#endif
diff --git a/include/graphics/mylib.h b/include/graphics/mylib.h
index 8032e77..cdb150a 100644
--- a/include/graphics/mylib.h
+++ b/include/graphics/mylib.h
@@ -1,5 +1,4 @@
-#ifndef MYLIB_H
-#define MYLIB_H
+#pragma once
 
 #include <X11/Xlib.h>
 
@@ -84,17 +83,109 @@ long m_maxcolor;
 Display *m_display;
 Window m_window;
 int m_initialized;
-int BlackAndWhite;
+int BlackAndWhite = False;
 int screennum;
 
 #define ColorsInSet           16
 #define ColorSets              4
-XColor m_colors[ColorSets+1][ColorsInSet];
+#define AllColors DoRed | DoGreen | DoBlue
+XColor m_colors[ColorSets+1][ColorsInSet] = {
+  {
+    { 0,     0,     0,     0, AllColors, 0 },
+    { 0, 65535,     0,     0, AllColors, 0 },
+    { 0,     0, 65535,     0, AllColors, 0 },
+    { 0, 65535, 65535,     0, AllColors, 0 },
+    { 0,     0,     0, 65535, AllColors, 0 },
+    { 0, 65535,     0, 65535, AllColors, 0 },
+    { 0,     0, 65535, 65535, AllColors, 0 },
+    { 0, 65535, 65535, 65535, AllColors, 0 },
+    { 0, 52428, 52428, 52428, AllColors, 0 },
+    { 0, 34952,     0,     0, AllColors, 0 },
+    { 0,     0, 34952,     0, AllColors, 0 },
+    { 0, 34952, 34952,     0, AllColors, 0 },
+    { 0,     0,     0, 34952, AllColors, 0 },
+    { 0, 34952,     0, 34952, AllColors, 0 },
+    { 0,     0, 34952, 34952, AllColors, 0 },
+    { 0, 44952, 44952, 44952, AllColors, 0 },
+  },
+  {
+    { 0,     0,     0,     0, AllColors, 0 },
+    { 0, 52428,     0,     0, AllColors, 0 },
+    { 0,     0, 52428,     0, AllColors, 0 },
+    { 0, 52428, 52428,     0, AllColors, 0 },
+    { 0,     0,     0, 52428, AllColors, 0 },
+    { 0, 52428,     0, 52428, AllColors, 0 },
+    { 0,     0, 52428, 52428, AllColors, 0 },
+    { 0, 65535, 65535, 65535, AllColors, 0 },
+    { 0, 52428, 52428, 26214, AllColors, 0 },
+    { 0, 21845, 39321, 34952, AllColors, 0 },
+    { 0, 34952, 30583, 43690, AllColors, 0 },
+    { 0, 43690, 21845, 30583, AllColors, 0 },
+    { 0, 52428, 26214, 21845, AllColors, 0 },
+    { 0, 65535, 39321,  8738, AllColors, 0 },
+    { 0, 48059, 34952, 26214, AllColors, 0 },
+    { 0, 44952, 44952, 44952, AllColors, 0 },
+  },
+  {
+    { 0,     0,     0,     0, AllColors, 0 },
+    { 0,  4369,  4369,  4369, AllColors, 0 },
+    { 0,  8738,  8738,  8738, AllColors, 0 },
+    { 0, 13107, 13107, 13107, AllColors, 0 },
+    { 0, 17496, 17496, 17496, AllColors, 0 },
+    { 0, 21845, 21845, 21845, AllColors, 0 },
+    { 0, 26214, 26214, 26214, AllColors, 0 },
+    { 0, 30583, 30583, 30583, AllColors, 0 },
+    { 0, 34952, 34952, 34952, AllColors, 0 },
+    { 0, 39321, 39321, 39321, AllColors, 0 },
+    { 0, 43690, 43690, 43690, AllColors, 0 },
+    { 0, 48059, 48059, 48059, AllColors, 0 },
+    { 0, 52428, 52428, 52428, AllColors, 0 },
+    { 0, 56797, 56797, 56797, AllColors, 0 },
+    { 0, 61166, 61166, 61166, AllColors, 0 },
+    { 0, 65535, 65535, 65535, AllColors, 0 },
+  },
+  {
+    { 0,     0,     0,     0, AllColors, 0 },
+    { 0, 26214, 26214, 26214, AllColors, 0 },
+    { 0, 43690, 43690, 43690, AllColors, 0 },
+    { 0, 65535, 65535, 65535, AllColors, 0 },
+    { 0, 21845,     0,     0, AllColors, 0 },
+    { 0, 34952,     0,     0, AllColors, 0 },
+    { 0, 48059,     0,     0, AllColors, 0 },
+    { 0, 65535,     0,     0, AllColors, 0 },
+    { 0,     0, 21845,     0, AllColors, 0 },
+    { 0,     0, 34952,     0, AllColors, 0 },
+    { 0,     0, 48059,     0, AllColors, 0 },
+    { 0,     0, 65535,     0, AllColors, 0 },
+    { 0,     0,     0, 21845, AllColors, 0 },
+    { 0,     0,     0, 34952, AllColors, 0 },
+    { 0,     0,     0, 48059, AllColors, 0 },
+    { 0,     0,     0, 65535, AllColors, 0 },
+  },
+  {
+    { 0,     0,     0,     0, AllColors, 0 },
+    { 0, 65535,     0,     0, AllColors, 0 },
+    { 0,     0, 65535,     0, AllColors, 0 },
+    { 0, 65535, 65535,     0, AllColors, 0 },
+    { 0,     0,     0, 65535, AllColors, 0 },
+    { 0, 65535,     0, 65535, AllColors, 0 },
+    { 0,     0, 65535, 65535, AllColors, 0 },
+    { 0, 65535, 65535, 65535, AllColors, 0 },
+    { 0, 52428, 52428, 52428, AllColors, 0 },
+    { 0, 34952,     0,     0, AllColors, 0 },
+    { 0,     0, 34952,     0, AllColors, 0 },
+    { 0, 34952, 34952,     0, AllColors, 0 },
+    { 0,     0,     0, 34952, AllColors, 0 },
+    { 0, 34952,     0, 34952, AllColors, 0 },
+    { 0,     0, 34952, 34952, AllColors, 0 },
+    { 0, 44952, 44952, 44952, AllColors, 0 },
+  },
+};
 
 /* Added X display name support.  stafford 7/17/91 */
 void m_set_display_name(char* display_name);
-char m_display_name[DISPLAY_NAME_LENGTH];
-int m_autoraise;
+char m_display_name[DISPLAY_NAME_LENGTH] = "";
+int m_autoraise = false;
 
 void m_init_screen ();
 void m_init_colors ();
@@ -103,7 +194,7 @@ void m_init_graphics ();
 void m_clear ();
 void m_clip (int, int, int, int);
 void m_noclip ();
-void m_unclip();	
+void m_unclip();
 void m_transform (int, int, int, int, int, int, int);
 void m_upside_down ();
 void m_rotscale (double, double, int, int);
@@ -117,7 +208,7 @@ void m_color (int);
 void m_colormode (int c);
 long m_curcolor ();
 long m_curcolormode ();
-void m_setcolor();
+void m_setcolor (int, int, int, int);
 void m_seecolor (int, int *, int *, int *);
 void m_setcolors (m_colorarray, m_colorarray, m_colorarray);
 void m_seecolors (m_colorarray, m_colorarray, m_colorarray);
@@ -154,11 +245,12 @@ void m_setfont();
 void m_seefont();
 void m_graphics_on();
 void m_alpha_on();
+void m_displaytext(char *);
 
 #define m_graphics_off()
 #define m_alpha_off()
 
-void m_readpen();
+void m_readpen(m_tablet_info *pen);
 void m_trackpen();
 void m_waitpen();
 void m_clipxy();
@@ -166,8 +258,3 @@ int m_pollkbd();
 uchar m_inkey();
 uchar m_inkeyn();
 uchar m_testkey();
-
-#endif /*MYLIB_H*/
-
-
-
diff --git a/include/graphics/newci.h b/include/graphics/newci.h
index 1dccde8..88dc6c5 100644
--- a/include/graphics/newci.h
+++ b/include/graphics/newci.h
@@ -1,5 +1,4 @@
-#ifndef NEWCI_H
-#define NEWCI_H
+#pragma once
 
 typedef struct newci_parserec {
 	char switch_[4];
@@ -12,9 +11,6 @@ typedef struct newci_parserec {
 	} UU;
 } newci_parserec;
 
-int P_argc;
-char **P_argv;
-
 void newci_parseswitch (newci_parserec *tab, size_t size, char *bad);
 void newci_eatargument ();
 void newci_fixfname (char *s, char *ext, char *home);
@@ -29,8 +25,3 @@ void newci_inputunmap ();
 void newci_inputstring (char *s);
 long timers_sysclock ();
 long newci_fullseconds ();
-
-#endif /*NEWCI_H*/
-
-
-
diff --git a/include/graphics/newcrt.h b/include/graphics/newcrt.h
index 37e6c2a..4a3462a 100644
--- a/include/graphics/newcrt.h
+++ b/include/graphics/newcrt.h
@@ -1,5 +1,5 @@
-#ifndef NEWCRT_H
-#define NEWCRT_H
+#pragma once
+
 #include <X11/Xlib.h>
 
 /* Caged_date="r      nc_revision='V1.01: $X';" */
@@ -216,8 +216,3 @@ void nc_putchar (uchar c);
 void nc_puts (char * s);
 char *nc_fgets (char *s, int n, FILE *stream);
 void nc_printf (char * fmt, ...);
-
-#endif /*NEWCRT_H*/
-
-
-
diff --git a/include/graphics/newkbd.h b/include/graphics/newkbd.h
index 2ff50b8..7860845 100644
--- a/include/graphics/newkbd.h
+++ b/include/graphics/newkbd.h
@@ -1,5 +1,4 @@
-#ifndef NEWKBD_H
-#define NEWKBD_H
+#pragma once
 
 
 #include <utils/sysglobals.h>
@@ -51,8 +50,3 @@ void nk_ungetkey (uchar c);
 #define nk_getxy(x,y)       nc_getXY(x,y)
 int nk_setcapslock (int newcaps);
 void nk_settransarray (int opcode, nk_keytransinfo **table);
-
-#endif /*NEWKBD_H*/
-
-
-
diff --git a/include/help.h b/include/help.h
index 9407029..43a941c 100644
--- a/include/help.h
+++ b/include/help.h
@@ -1,6 +1,7 @@
+#pragma once
 
 #define help_init(x, y)
 #define help_index(x, y)
 #define help_do(x)
-#define help_show(x, y) 
+#define help_show(x, y)
 #define help_setus
diff --git a/include/label.h b/include/label.h
index 892e7cc..8af8fbf 100644
--- a/include/label.h
+++ b/include/label.h
@@ -1,7 +1,7 @@
-#ifndef LABEL_H
-#define LABEL_H
+#pragma once
 
 #include "logdef.h"
+#define log_lablen      255   /* Maximum length of labels */
 
 typedef struct log_lrec {
   short x, y, w;
@@ -11,7 +11,7 @@ typedef struct log_lrec {
   na_long temp;
 } log_lrec;   /* Label */
 
-void parselabel(strlist_t **lbl, short *numattrs, log_kattrrec **attr);
+void parselabel(strlist_t **lbl, short *numattrs, struct log_kattrrec **attr);
 
 void eralabel(log_lrec *l);
 
@@ -24,5 +24,3 @@ void newlabel(log_lrec **l);
 void unlinklabel(log_lrec *l);
 
 void displabel(log_lrec **l);
-
-#endif
diff --git a/include/log.h b/include/log.h
index 488ce3f..6959c4d 100644
--- a/include/log.h
+++ b/include/log.h
@@ -1,5 +1,4 @@
-#ifndef LOG_H
-#define LOG_H
+#pragma once
 
 #include <utils/p2c.h>
 #include "logdef.h"
@@ -41,7 +40,7 @@ void prealunit(double r, short p, char *u, char *s);
 void prealunit2(double r, short p, char *u, char *s);
 void beginerror();
 void enderror();
-void realstr();
+char* realstr(char*, double, short);
 void setvlsimode(int flag);
 void newbox(log_brec **b);
 short readlibrary(char *n);
@@ -52,5 +51,3 @@ void addlabelat(short x, short y, char *s);
 void settofrom(log_grec **g, char *name);
 void solderat(short x, short y);
 void frysolder(short x, short y);
-
-#endif
diff --git a/include/log_action.h b/include/log_action.h
deleted file mode 100644
index 81523cf..0000000
--- a/include/log_action.h
+++ /dev/null
@@ -1,349 +0,0 @@
-#ifndef LOG_ACTION_H
-#define LOG_ACTION_H
-
-#include "logdef.h"
-#include "gate.h"
-#include "wire.h"
-#include "page.h"
-#include "label.h"
-#include <limits.h>
-
-typedef enum
-{
-	act_init,
-	act_endinit,
-	act_exit,
-	act_clearmsg,
-	act_status,
-	act_cnf,
-	act_immed,
-	act_func,
-	act_color,
-	act_select,
-	act_clear,
-	act_edit,
-	act_pass,
-	act_tstep,
-	act_erasegate,
-	act_touchgate,
-	act_history,
-	act_histval,
-	act_histstr,
-	act_trigger,
-	act_glowcol,
-	act_newgate,
-	act_disposegate,
-	act_copygate,
-	act_writegate,
-	act_readgate,
-	act_connectgate,
-	act_disconnectgate,
-	act_configgate,
-	act_configchgate,
-	act_configrelgate,
-	act_confignode,
-	act_configchnode,
-	act_configrelnode,
-	act_confighist,
-	act_configchhist,
-	act_configrelhist,
-	act_newkind,
-	act_disposekind,
-	act_newnode,
-	act_disposenode,
-	act_copynode,
-	act_combinenodes,
-	act_combineintonode,
-	act_writenode,
-	act_readnode,
-	act_refnodes,
-	act_nodeval,
-	act_general,
-	act_gennode,
-	act_genkind,
-	act_gengate
-} log_actionkinds;
-
-typedef struct log_hooks_t
-{
-	void (*hidecursor) ();
-	void (*hidecursorrect) (long x1, long y1, long x2, long y2);
-	void (*unhidecursor) ();
-	void (*nodeconflict) (log_nrec *n);
-	void (*gateconflict) (log_grec *g);
-	void (*clearconflicts) (struct log_tool *tool);
-	void (*setdimgate) (log_grec *g, int dim);
-	void (*xform) (log_grec *g, short *x, short *y);
-	void (*getsig) (char *name, log_sigrec **sig);
-	void (*report) (int num, char *name);
-	void (*message) (char *msg);
-	void (*vmessage) (char *msg);
-	void (*vmessageflag) (char *msg, int b);
-	void (*trace) (char *msg);
-	void (*dump) (char *msg);
-	void (*setdump) (char *name);
-	void (*closefiles) ();
-	void (*clearalpha) ();
-	void (*drawstr) (int x, int y, char *s);
-	void (*rightstr) (int x, int y, char *s);
-	void (*centerstr) (int x, int y, char *s);
-	void (*clip) ();
-	void (*remcursor) ();
-	void (*clearscreen) ();
-	void (*setmode) (const char *s);
-	void (*getword) (char *buf, char *wrd);
-	void (*getint) (char *buf, long *i, long def);
-	void (*getreal) (char *buf, double *r, double def);
-	void (*getbool) (char *buf, int *b);
-	void (*pen) ();
-	void (*pass) ();
-	void (*trykbd) ();
-	void (*scroll) ();
-	void (*trykbdscroll) ();
-	void (*inkey) (char *ch);
-	void (*udrawgate) (int x, int y, int g, int c);
-	void (*gdrawgate) (int x, int y, int g, int c);
-	void (*drawgate) (log_grec *g);
-	void (*erasegate) (log_grec *g);
-	void (*drawnode) (log_nrec *n, int c);
-	void (*refresh) ();   /*quietly refresh drawing area*/
-	void (*refreshsoon) ();
-	void (*beginbottom) ();
-	void (*endbottom) ();
-	void (*beginerror) ();
-	void (*enderror) ();
-	void (*redraw) ();   /*redraw drawing area*/
-	void (*redrawscreen) ();   /*redraw entire screen*/
-	void (*change) (log_page *page);
-	void (*newgate) (log_grec **g, int gt);
-	void (*copygate) (log_grec *old, log_grec **g);
-	void (*disposegate) (log_grec **g);
-	void (*newnode) (log_nrec **n, int st);
-	void (*copynode) (log_nrec *old, log_nrec **n);
-	void (*disposenode) (log_nrec **n);
-	void (*switchnode) (log_nrec **n, log_nrec *n2);
-	void (*dumpnodes) ();
-	void (*readlnpass) (char *s, int mode);
-	void (*clearfunc) ();
-	void (*refrfunc) ();
-	void (*assertfunc) (char *name);
-	void (*findobject) (int x, int y);
-	void (*findwire) (int x, int y);
-	void (*deletehw) (log_hwrec *hw);
-	void (*deletevw) (log_vwrec *vw);
-	void (*disconnectgate) (log_grec *g);
-	void (*deletegate) (log_grec *g);
-	void (*addhw) (int x1, int x2, int y);
-	void (*addvw) (int x, int y1, int y2);
-	void (*connectgate) (log_grec *g, int *success);
-	void (*waitnear) ();
-	void (*addgate) (int x, int y, int gtype);
-	void (*uaddgate) (int x, int y, int gtype);
-	void (*getgate) (char *name, short *gtype);
-	void (*realunit) (double r, int p, char *u, char *s);
-	void (*realunit2) (double r, int p, char *u, char *s);
-	void (*addlabel) (log_lrec **l, char *s);
-	void (*getcolor) (char *name, short *val, int def);
-	void (*setcmap) (int n, int r, int g, int b);
-	void (*parselabel) (strlist_t **lbl, short *numattrs, log_kattrrec **attr);
-	void (*editattrs) (log_gattrrec *gattr, int numattrs, log_kattrrec *kattr, strlist_t *lbl,
-			char *name, void (*proc) (), void (*chproc) (), void (*relproc) ());
-	void (*newattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
-	void (*disposeattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
-	void (*copyattrs) (log_gattrrec **gattr, log_gattrrec *oldattr, int numattrs, log_kattrrec *kattr);
-	void (*initscreen) ();
-	void (*clearshowalpha) ();
-	void (*setupregion) (log_regrec **r, int pagenum);
-	void (*stamp) (long *i);
-	void (*noclip) ();
-} log_hooks_t;
-
-typedef struct log_hook2_t
-{
-	void (*getnodeval) (log_nrec *n, double *val, char *opts);
-	void (*solderat) (int x, int y);
-	void (*unsolderwires) (log_hwrec *hw, log_vwrec *vw);
-	void (*settofrom) (log_grec **g, char *name);
-	void (*findattrnum) (log_krec *k, char *name, char *kinds, short *num);
-	void (*findattrname) (log_krec *k, int num, char *name);
-	void (*findpinnum) (log_krec *k, char *name, short *num);
-	void (*findpinname) (log_krec *k, int num, char *name);
-	void (*setgattr) (log_grec *g, int num, char *value);
-	void (*setnattr) (log_nrec *n, int num, char *value);
-	void (*findpointmarker) (log_krec *k, int num, short *x, short *y);
-	void (*findboxmarker) (log_krec *k, int num, short *x1, short *y1, short *x2, short *y2);
-	void (*send_general) (struct log_tool *sim, char *act);
-	void (*send_gennode) (log_nrec *n, char *act);
-	void (*send_genkind) (log_krec *k, char *act);
-	void (*send_gengate) (log_grec *g, char *act);
-	void (*send_all) (char *act);
-	void (*send_allnodes) (char *act);
-	void (*send_allkinds) (char *act);
-	void (*send_allgates) (char *act);
-	void (*addlabelat) (int x, int y, char *s);
-	void (*addboxat) (int x1, int y1, int x2, int y2);
-	void (*plainxform) (log_grec *g, short *x, short *y);
-	void (*findattrnum2) (int numattrs, log_kattrrec *kattr, strlist_t *lbl, char *name, char *kinds, short *num);
-	void (*findattrname2) (int numattrs, log_kattrrec *kattr, strlist_t *lbl, int num, char *name);
-	void (*showpinname) (log_grec *g, int i, int c, char *name);
-} log_hook2_t;
-
-typedef struct log_action_t
-{
-	log_actionkinds action;
-	log_krec *actkind;
-	log_grec *actgate;
-	log_grec *actgate2;
-	log_nrec *actnode;
-	log_nrec *actnode2;
-	long actx;
-	long acty;
-	int actflag;
-	int actflag2;
-	FILE **actfile;
-	struct log_tool *acttool;
-	char *actstr;
-	double actval;
-	double actval2;
-	double actval3;
-	log_gattrrec *actgattr;
-	log_kattrrec *actkattr;
-	unsigned char *actproc;
-
-	log_page *pages[log_maxpages]; /** \TODO use a variable size array or a list */
-	size_t numpages; ///< number of pages
-	log_nrec *nbase;
-	long curpage;  ///< current page number
-	long showpage; ///< currenctly displayed page number
-
-
-	log_sigrec *signaltab;
-	short maxsignal;
-	short lastsignal;
-
-	short scale;
-	short hscale;
-	long xoff;	   ///< screen_x = grid_x * scale - xoff
-	long yoff;
-
-	char func[17];
-	char *funcarg;
-
-	log_grec *neargate;
-	log_lrec *nearlabel;
-	log_brec *nearbox;
-	log_hwrec *nearhw;
-	log_hwrec *movinghw;
-	log_vwrec *nearvw;
-	log_vwrec *movingvw;
-
-	log_nrec *probenode;
-	log_grec *probegate;
-	short probepin;
-	struct log_tool *probesimtype;
-	short baselinecolor;
-
-	log_hnrec *hnbase;
-	log_htrec *htbase;
-	log_htrec *htlast;
-
-	long fastspeed;
-	long fastmin;
-	long fastmax;
-	long fastrate;
-
-	long singlestepcount;
-
-	double time;
-	double prevtimestep;
-
-	log_simstatekinds simstate;
-	log_simstatekinds oldsimstate;
-
-	struct log_tool *simstatetool;
-	struct log_tool *oldsimstatetool;
-
-	int histactive;      /** Scope mode is triggered */
-	int dumpopen;        /** Dump output file is open */
-	int traceopen;       /** Trace output is open */
-	int verbose;         /** Commands acknowledge with messages */
-	int traceflag;       /** Debuggin/trace mode on */
-	int quiet;           /** Suppress sound signals */
-	int glowmode;        /** Glowing-wires mode */
-	int probemode;       /** Probe-cursor mode */
-	int markers;         /** Printing markers are defined */
-	int invisible;       /** Gates and wires are invisible */
-	int textinvisible;   /** Lablels and boxes are invisible */
-	int pnuminvisible;   /** Pin numbers are invisible */
-	int dotsvisible;      /** Are "red dots" on or off normally? */
-	int showconflicts;   /** Show onlyconflict */
-	int resetflag;       /** "Reset" command has been given */
-	int pwrflag;         /** Simulator is turned on */
-	int initdone;       /** Done with program initialization */
-	int refrflag;        /** Refreshing all displays */
-
-	int busyflag;        /** Flag for idling simulations */
-
-	short markerx1;
-	short markery1;
-	short markerx2;
-	short markery2;
-
-	m_tablet_info t;
-	m_tablet_info t0;
-	int startpoint;
-	int stillnear;
-	int incircuit;
-
-	short gridx;
-	short gridy;
-	short posx;
-	short posy;
-	short oldx;
-	short oldy;
-	short cx_min;
-	short cy_min;
-	short cx_max;
-	short cy_max;
-	/** Area covered bu cyrsor */
-
-	FILE **tracefile;
-
-	char *homedirname;
-
-	enum
-	{
-		log_host_log,
-		log_host_loged,
-		log_host_3,
-		log_host_4
-	} host;
-	struct log_tool *toolbase;
-
-	log_hooks_t hook;
-	log_colorrec color;
-
-	long curstamp;
-	long labelstamp;                /** Changes to labels */
-	long boxstamp;                  /** Changes to boxes */
-	long msgstamp;                  /** Clearing messages screen */
-	long refrstamp;                 /** Clearing graphics screen */
-	long nattrstamp;                /** Changes to note attributes */
-	long gattrstamp;                /** Changes to gate attributes */
-	long sigstamp;                  /** Changes to signal table */
-	long loadstamp;                 /** A page was loaded */
-	long colorstamp;                /** Color assignment have changes */
-	long resetstamp;   /* Simulation has been reset */
-	long markerstamp;               /** Page markers moved */
-
-	log_krec *probekind;
-	strlist_t *actstrlist;
-	log_hook2_t *hook2;
-	log_hwrec *probehwire;
-	log_vwrec *probevwire;
-	long actx2;
-	long acty2;
-	char genfunc [17];
-} log_action_t;
-
-#endif
diff --git a/include/logcom.h b/include/logcom.h
index c92bb24..936f12b 100644
--- a/include/logcom.h
+++ b/include/logcom.h
@@ -1,5 +1,4 @@
-#ifndef LOGCOM_H
-#define LOGCOM_H
+#pragma once
 
 #include "logdef.h"
 #include <graphics/mylib.h>
@@ -18,8 +17,3 @@ void Log_17_proc (log_action_t *act);
 
 
 void Log_7_time (log_action_t *act);
-
-
-#endif /*LOGCOM_H*/
-
-
diff --git a/include/logcurs_arr.h b/include/logcurs_arr.h
index 7c26728..137fbd6 100644
--- a/include/logcurs_arr.h
+++ b/include/logcurs_arr.h
@@ -1,3 +1,4 @@
+#pragma once
 #define logcurs_arr_width 16
 #define logcurs_arr_height 16
 #define logcurs_arr_x_hot 0
diff --git a/include/logcurs_box.h b/include/logcurs_box.h
index 76d708b..f41aa68 100644
--- a/include/logcurs_box.h
+++ b/include/logcurs_box.h
@@ -1,3 +1,4 @@
+#pragma once
 #define logcurs_box_width 16
 #define logcurs_box_height 16
 #define logcurs_box_x_hot 5
diff --git a/include/logcurs_cpy.h b/include/logcurs_cpy.h
index 7980fc2..e621ce8 100644
--- a/include/logcurs_cpy.h
+++ b/include/logcurs_cpy.h
@@ -1,3 +1,4 @@
+#pragma once
 #define logcurs_cpy_width 16
 #define logcurs_cpy_height 16
 #define logcurs_cpy_x_hot 0
diff --git a/include/logcurs_del.h b/include/logcurs_del.h
index 5c24ece..f6676ed 100644
--- a/include/logcurs_del.h
+++ b/include/logcurs_del.h
@@ -1,3 +1,4 @@
+#pragma once
 #define logcurs_del_width 32
 #define logcurs_del_height 32
 #define logcurs_del_x_hot 9
diff --git a/include/logcurs_prb.h b/include/logcurs_prb.h
index c1ada4f..3e57fb7 100644
--- a/include/logcurs_prb.h
+++ b/include/logcurs_prb.h
@@ -1,3 +1,4 @@
+#pragma once
 #define logcurs_prb_width 16
 #define logcurs_prb_height 16
 #define logcurs_prb_x_hot 0
diff --git a/include/logdef.h b/include/logdef.h
index 1585c59..7fb1cd3 100644
--- a/include/logdef.h
+++ b/include/logdef.h
@@ -1,18 +1,14 @@
-#ifndef LOGDEF_H
-#define LOGDEF_H
+#pragma once
 
-#include <utils/p2c.h>
-#include <graphics/mylib.h>
-#include <utils/strlist.h>
-#include <utils/newasm.h>
+#include "utils/p2c.h"
+#include "utils/strlist.h"
+#include "utils/newasm.h"
 
-#ifdef LOGDEF_G
-# define vextern
-#else
-# define vextern extern
-#endif
+#include "node.h"
+#include "gate.h"
+#include "page.h"
+#include "wire.h"
 
-typedef struct log_action_t log_action_t;
 #define log_maxpages    9   /* Maximum page number */
 #define log_maxpins     255   /* Maximum number of pins on a gate */
 #define log_lablen      255   /* Maximum length of labels */
@@ -65,18 +61,43 @@ typedef struct log_action_t log_action_t;
 typedef short log_zoomtab[5];
 typedef short log_rottab[8];
 
-vextern const log_rottab log_rotxx;
-vextern const log_rottab log_rotxy;
-vextern const log_rottab log_rotyx;
-vextern const log_rottab log_rotyy;
-vextern const log_rottab log_irotxx;
-vextern const log_rottab log_irotxy;
-vextern const log_rottab log_irotyx;
-vextern const log_rottab log_irotyy;
-vextern const log_zoomtab zoomscales;
+const log_rottab log_rotxx = {
+  1, 0, -1, 0, -1, 0, 1, 0
+};
+
+const log_rottab log_rotxy = {
+  0, -1, 0, 1, 0, 1, 0, -1
+};
+
+const log_rottab log_rotyx = {
+  0, 1, 0, -1, 0, 1, 0, -1
+};
+
+const log_rottab log_rotyy = {
+  1, 0, -1, 0, 1, 0, -1, 0
+};
+
+const log_rottab log_irotxx = {
+  1, 0, -1, 0, -1, 0, 1, 0
+};
+
+const log_rottab log_irotxy = {
+  0, 1, 0, -1, 0, -1, 0, 1
+};
+
+const log_rottab log_irotyx = {
+  0, -1, 0, 1, 0, -1, 0, 1
+};
+
+const log_rottab log_irotyy = {
+  1, 0, -1, 0, 1, 0, -1, 0
+};
+
+const log_zoomtab zoomscales = {
+  2, 3, 5, 8, 12
+};
+
 
-typedef char log_pac4[4];
-typedef char log_pac8[8];
 
 typedef union log_kflags {
   short i;
@@ -158,7 +179,7 @@ typedef struct log_gattrrec {
     } U73;
     char *c;
     char *sp;
-    unsigned b : 1 ; 
+    unsigned b : 1 ;
     short nv;
   } UU;
 } log_gattrrec;   /* Gate attribute entry */
@@ -248,7 +269,7 @@ typedef struct log_colorrec {
 
 typedef struct log_tool {
   char name[17];
-  void (*proc) (log_action_t *act);
+  void (*proc) (struct log_action_t *act);
   char *fname, *comment;
   char *shortname;
   unsigned ready : 1, simulator : 1, keep : 1, nostatus : 1, tstepflag : 1;
@@ -263,10 +284,341 @@ typedef struct log_tool {
   double deltatime;
 } log_tool;
 
-
-#undef vextern
-
-#include <log_action.h>
-#endif /*LOGDEF_H*/
-
-
+typedef enum
+{
+	act_init,
+	act_endinit,
+	act_exit,
+	act_clearmsg,
+	act_status,
+	act_cnf,
+	act_immed,
+	act_func,
+	act_color,
+	act_select,
+	act_clear,
+	act_edit,
+	act_pass,
+	act_tstep,
+	act_erasegate,
+	act_touchgate,
+	act_history,
+	act_histval,
+	act_histstr,
+	act_trigger,
+	act_glowcol,
+	act_newgate,
+	act_disposegate,
+	act_copygate,
+	act_writegate,
+	act_readgate,
+	act_connectgate,
+	act_disconnectgate,
+	act_configgate,
+	act_configchgate,
+	act_configrelgate,
+	act_confignode,
+	act_configchnode,
+	act_configrelnode,
+	act_confighist,
+	act_configchhist,
+	act_configrelhist,
+	act_newkind,
+	act_disposekind,
+	act_newnode,
+	act_disposenode,
+	act_copynode,
+	act_combinenodes,
+	act_combineintonode,
+	act_writenode,
+	act_readnode,
+	act_refnodes,
+	act_nodeval,
+	act_general,
+	act_gennode,
+	act_genkind,
+	act_gengate
+} log_actionkinds;
+
+typedef struct log_hooks_t
+{
+	void (*hidecursor) ();
+	void (*hidecursorrect) (long x1, long y1, long x2, long y2);
+	void (*unhidecursor) ();
+	void (*nodeconflict) (struct log_nrec *n);
+	void (*gateconflict) (struct log_grec *g);
+	void (*clearconflicts) (struct log_tool *tool);
+	void (*setdimgate) (log_grec *g, int dim);
+	void (*xform) (log_grec *g, short *x, short *y);
+	void (*getsig) (char *name, log_sigrec **sig);
+	void (*report) (int num, char *name);
+	void (*message) (char *msg);
+	void (*vmessage) (char *msg);
+	void (*vmessageflag) (char *msg, int b);
+	void (*trace) (char *msg);
+	void (*dump) (char *msg);
+	void (*setdump) (char *name);
+	void (*closefiles) ();
+	void (*clearalpha) ();
+	void (*drawstr) (int x, int y, char *s);
+	void (*rightstr) (int x, int y, char *s);
+	void (*centerstr) (int x, int y, char *s);
+	void (*clip) ();
+	void (*remcursor) ();
+	void (*clearscreen) ();
+	void (*setmode) (const char *s);
+	void (*getword) (char *buf, char *wrd);
+	void (*getint) (char *buf, long *i, long def);
+	void (*getreal) (char *buf, double *r, double def);
+	void (*getbool) (char *buf, int *b);
+	void (*pen) ();
+	void (*pass) ();
+	void (*trykbd) ();
+	void (*scroll) ();
+	void (*trykbdscroll) ();
+	void (*inkey) (char *ch);
+	void (*udrawgate) (int x, int y, int g, int c);
+	void (*gdrawgate) (int x, int y, int g, int c);
+	void (*drawgate) (log_grec *g);
+	void (*erasegate) (log_grec *g);
+	void (*drawnode) (log_nrec *n, int c);
+	void (*refresh) ();   /*quietly refresh drawing area*/
+	void (*refreshsoon) ();
+	void (*beginbottom) ();
+	void (*endbottom) ();
+	void (*beginerror) ();
+	void (*enderror) ();
+	void (*redraw) ();   /*redraw drawing area*/
+	void (*redrawscreen) ();   /*redraw entire screen*/
+	void (*change) (log_page *page);
+	void (*newgate) (log_grec **g, short gt);
+	void (*copygate) (log_grec *old, log_grec **g);
+	void (*disposegate) (log_grec **g);
+	void (*newnode) (log_nrec **n, uchar st);
+	void (*copynode) (log_nrec *old, log_nrec **n);
+	void (*disposenode) (log_nrec **n);
+	void (*switchnode) (log_nrec **n, log_nrec *n2);
+	void (*dumpnodes) ();
+	void (*readlnpass) (char *s, short mode);
+	void (*clearfunc) ();
+	void (*refrfunc) ();
+	void (*assertfunc) (char *name);
+	void (*findobject) (short x, short y);
+	void (*findwire) (short x, short y);
+	void (*deletehw) (log_hwrec *hw);
+	void (*deletevw) (log_vwrec *vw);
+	void (*disconnectgate) (log_grec *g);
+	void (*deletegate) (log_grec *g);
+	void (*addhw) (short x1, short x2, short y);
+	void (*addvw) (short x, short y1, short y2);
+	void (*connectgate) (log_grec *g, int *success);
+	void (*waitnear) ();
+	void (*addgate) (short x, short y, short gtype);
+	void (*uaddgate) (short x, short y, short gtype);
+	void (*getgate) (char *name, short *gtype);
+	void (*realunit) (double r, short p, char *u, char *s);
+	void (*realunit2) (double r, short p, char *u, char *s);
+	void (*addlabel) (struct log_lrec **l, char *s);
+	void (*getcolor) (char *name, short *val, short def);
+	void (*setcmap) (short n, short r, short g, short b);
+	void (*parselabel) (strlist_t **lbl, short *numattrs, log_kattrrec **attr);
+	void (*editattrs) (log_gattrrec *gattr, short numattrs, log_kattrrec *kattr, strlist_t *lbl,
+			char *name, void (*proc) (), void (*chproc) (), void (*relproc) ());
+	void (*newattrs) (log_gattrrec **gattr, short numattrs, log_kattrrec *kattr);
+	void (*disposeattrs) (log_gattrrec **gattr, short numattrs, log_kattrrec *kattr);
+	void (*copyattrs) (log_gattrrec **gattr, log_gattrrec *oldattr, short numattrs, log_kattrrec *kattr);
+	void (*initscreen) ();
+	void (*clearshowalpha) ();
+	void (*setupregion) (struct log_regrec **r, short pagenum);
+	void (*stamp) (long *i);
+	void (*noclip) ();
+} log_hooks_t;
+
+typedef struct log_hook2_t
+{
+	void (*getnodeval) (log_nrec *n, double *val, char *opts);
+	void (*solderat) (short x, short y);
+	void (*unsolderwires) (struct log_hwrec *hw, struct log_vwrec *vw);
+	void (*settofrom) (log_grec **g, char *name);
+	void (*findattrnum) (log_krec *k, char *name, char *kinds, short *num);
+	void (*findattrname) (log_krec *k, short num, char *name);
+	void (*findpinnum) (log_krec *k, char *name, short *num);
+	void (*findpinname) (log_krec *k, short num, char *name);
+	void (*setgattr) (log_grec *g, short num, char *value);
+	void (*setnattr) (log_nrec *n, short num, char *value);
+	void (*findpointmarker) (log_krec *k, short num, short *x, short *y);
+	void (*findboxmarker) (log_krec *k, short num, short *x1, short *y1, short *x2, short *y2);
+	void (*send_general) (struct log_tool *sim, char *act);
+	void (*send_gennode) (log_nrec *n, char *act);
+	void (*send_genkind) (log_krec *k, char *act);
+	void (*send_gengate) (log_grec *g, char *act);
+	void (*send_all) (char *act);
+	void (*send_allnodes) (char *act);
+	void (*send_allkinds) (char *act);
+	void (*send_allgates) (char *act);
+	void (*addlabelat) (short x, short y, char *s);
+	void (*addboxat) (short x1, short y1, short x2, short y2);
+	void (*plainxform) (log_grec *g, short *x, short *y);
+	void (*findattrnum2) (short numattrs, log_kattrrec *kattr, strlist_t *lbl, char *name, char *kinds, short *num);
+	void (*findattrname2) (short numattrs, log_kattrrec *kattr, strlist_t *lbl, short num, char *name);
+	void (*showpinname) (log_grec *g, short i, short c, char *name);
+} log_hook2_t;
+
+enum HostEnum {
+		log_host_log,
+		log_host_loged,
+		log_host_3,
+		log_host_4
+	};
+
+typedef struct log_action_t
+{
+	log_actionkinds action;
+	log_krec *actkind;
+	log_grec *actgate;
+	log_grec *actgate2;
+	log_nrec *actnode;
+	log_nrec *actnode2;
+	long actx;
+	long acty;
+	int actflag;
+	int actflag2;
+	FILE **actfile;
+	struct log_tool *acttool;
+	char *actstr;
+	double actval;
+	double actval2;
+	double actval3;
+	log_gattrrec *actgattr;
+	log_kattrrec *actkattr;
+	unsigned char *actproc;
+
+	log_page *pages[log_maxpages]; /** \TODO use a variable size array or a list */
+	size_t numpages; ///< number of pages
+	log_nrec *nbase;
+	long curpage;  ///< current page number
+	long showpage; ///< currenctly displayed page number
+
+
+	log_sigrec *signaltab;
+	short maxsignal;
+	short lastsignal;
+
+	short scale;
+	short hscale;
+	long xoff;	   ///< screen_x = grid_x * scale - xoff
+	long yoff;
+
+	char func[17];
+	char *funcarg;
+
+	log_grec *neargate;
+	log_lrec *nearlabel;
+	log_brec *nearbox;
+	log_hwrec *nearhw;
+	log_hwrec *movinghw;
+	log_vwrec *nearvw;
+	log_vwrec *movingvw;
+
+	log_nrec *probenode;
+	log_grec *probegate;
+	short probepin;
+	struct log_tool *probesimtype;
+	short baselinecolor;
+
+	log_hnrec *hnbase;
+	log_htrec *htbase;
+	log_htrec *htlast;
+
+	long fastspeed;
+	long fastmin;
+	long fastmax;
+	long fastrate;
+
+	long singlestepcount;
+
+	double time;
+	double prevtimestep;
+
+	log_simstatekinds simstate;
+	log_simstatekinds oldsimstate;
+
+	struct log_tool *simstatetool;
+	struct log_tool *oldsimstatetool;
+
+	int histactive;      /** Scope mode is triggered */
+	int dumpopen;        /** Dump output file is open */
+	int traceopen;       /** Trace output is open */
+	int verbose;         /** Commands acknowledge with messages */
+	int traceflag;       /** Debuggin/trace mode on */
+	int quiet;           /** Suppress sound signals */
+	int glowmode;        /** Glowing-wires mode */
+	int probemode;       /** Probe-cursor mode */
+	int markers;         /** Printing markers are defined */
+	int invisible;       /** Gates and wires are invisible */
+	int textinvisible;   /** Lablels and boxes are invisible */
+	int pnuminvisible;   /** Pin numbers are invisible */
+	int dotsvisible;      /** Are "red dots" on or off normally? */
+	int showconflicts;   /** Show onlyconflict */
+	int resetflag;       /** "Reset" command has been given */
+	int pwrflag;         /** Simulator is turned on */
+	int initdone;       /** Done with program initialization */
+	int refrflag;        /** Refreshing all displays */
+
+	int busyflag;        /** Flag for idling simulations */
+
+	short markerx1;
+	short markery1;
+	short markerx2;
+	short markery2;
+
+	m_tablet_info t;
+	m_tablet_info t0;
+	int startpoint;
+	int stillnear;
+	int incircuit;
+
+	short gridx;
+	short gridy;
+	short posx;
+	short posy;
+	short oldx;
+	short oldy;
+	short cx_min;
+	short cy_min;
+	short cx_max;
+	short cy_max;
+	/** Area covered bu cyrsor */
+
+	FILE **tracefile;
+
+	char *homedirname;
+
+	HostEnum host;
+	struct log_tool *toolbase;
+
+	log_hooks_t hook;
+	log_colorrec color;
+
+	long curstamp;
+	long labelstamp;                /** Changes to labels */
+	long boxstamp;                  /** Changes to boxes */
+	long msgstamp;                  /** Clearing messages screen */
+	long refrstamp;                 /** Clearing graphics screen */
+	long nattrstamp;                /** Changes to note attributes */
+	long gattrstamp;                /** Changes to gate attributes */
+	long sigstamp;                  /** Changes to signal table */
+	long loadstamp;                 /** A page was loaded */
+	long colorstamp;                /** Color assignment have changes */
+	long resetstamp;   /* Simulation has been reset */
+	long markerstamp;               /** Page markers moved */
+
+	log_krec *probekind;
+	strlist_t *actstrlist;
+	log_hook2_t *hook2;
+	log_hwrec *probehwire;
+	log_vwrec *probevwire;
+	long actx2;
+	long acty2;
+	char genfunc [17];
+} log_action_t;
diff --git a/include/logdig.h b/include/logdig.h
index 825f8b6..f28d6f5 100644
--- a/include/logdig.h
+++ b/include/logdig.h
@@ -1,17 +1,8 @@
-#ifndef LOGDIG_H
-#define LOGDIG_H
+#pragma once
 
 #include "logdef.h"
 #include <utils/sysglobals.h>
 
-#ifdef LOGDIG_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
 #define log_16_simtype  16
 
 
@@ -43,18 +34,23 @@ typedef struct log_16_action {
   void (*hook_input) (log_action_t *lact, log_nrec *n, log_16_value *v);
   void (*hook_output) (log_action_t *lact, log_nrec *n, log_16_value v);
   void (*hook_ocoutput) (log_action_t *lact, log_nrec *n, log_16_value v);
-  void (*hook_led) (log_action_t *lact, int x, int y, log_16_value v);
-  void (*hook_eraled) (log_action_t *lact, int x, int y);
-  void (*hook_plotled) (log_action_t *lact, int x, int y, log_16_value v);
+  void (*hook_led) (log_action_t *lact, short x, short y, log_16_value v);
+  void (*hook_eraled) (log_action_t *lact, short x, short y);
+  void (*hook_plotled) (log_action_t *lact, short x, short y, log_16_value v);
 } log_16_action;
 
-vextern const log_16_viarr log_16_vi;
-vextern const log_16_ivarr log_16_iv;
-vextern const log_16_vbarr log_16_vb;
-vextern const log_16_bvarr log_16_bv;
-
-#undef vextern
+const log_16_viarr log_16_vi = {
+  0, 1, 3
+};
 
-#endif /*LOGDIG_H*/
+const log_16_ivarr log_16_iv = {
+  log_none, log_zero, log_one, log_one
+};
 
+const log_16_vbarr log_16_vb = {
+  false, false, true
+};
 
+const log_16_bvarr log_16_bv = {
+  log_zero, log_one
+};
diff --git a/include/logfont.h b/include/logfont.h
index 4a456c0..2a7bfa3 100644
--- a/include/logfont.h
+++ b/include/logfont.h
@@ -1,3 +1,3 @@
+#pragma once
 
 #define logfont_lfont NULL
-
diff --git a/include/logglobals.h b/include/logglobals.h
index f400fae..1d95ba4 100644
--- a/include/logglobals.h
+++ b/include/logglobals.h
@@ -1,13 +1,10 @@
-#ifndef LOGGLOBALS
-#define LOGGLOBALS
+#pragma once
 
 #include <utils/p2c.h>
 #include <graphics/newkbd.h>
 #include "settings.h"
 #include "logstructs.h"
 
-extern char *GetChipmunkPath();
-
 /* 0*/
 /* If the pen is in "this" sector, */
 /* 1*/
@@ -69,7 +66,7 @@ extern uchar *loadedgates;   /* Tells whether a gate is in the catalog */
 extern log_krec *kind[maxmaxkinds];   /* Kind of gate in each catalog space */
 extern kindgrouptype kindgroup;   /* Kind of gate in each menu-area space */
 extern kindgrouptype kindsig;
-extern kindattrtype kindattr;
+extern struct kindattrtype kindattr;
 extern strlist_t *gatefilenames;
 extern short maxkinds, catwidth;
 extern catboxrec *catboxes;
@@ -206,6 +203,3 @@ extern void m_saveclip ();
 extern void nc_cursor_on ();
 
 extern void nc_cursor_off ();
-
-
-#endif
diff --git a/include/loghier.h b/include/loghier.h
index 2b52742..798441c 100644
--- a/include/loghier.h
+++ b/include/loghier.h
@@ -1,5 +1,4 @@
-#ifndef LOGHIER_H
-#define LOGHIER_H
+#pragma once
 
 #include "logdef.h"
 #include <utils/newasm.h>
@@ -28,7 +27,3 @@ void examinetemplate (log_grec *g, log_nrec **pp, long ppsize,
 
 
 void Log_7_ginst (log_action_t *act);
-
-#endif /*LOGHIER_H*/
-
-
diff --git a/include/logntk.h b/include/logntk.h
index 429c06d..6d8b579 100644
--- a/include/logntk.h
+++ b/include/logntk.h
@@ -1,17 +1,5 @@
-#ifndef LOGNTK_H
-#define LOGNTK_H
+#pragma once
 
 #include "logdef.h"
-#include "loghier.h"
-#include <utils/newasm.h>
-#include <graphics/newkbd.h>
-#include <graphics/newci.h>
-#include <graphics/newcrt.h>
-#include <graphics/mylib.h>
-#include <utils/regex.h>
 
 extern void Log_logntk_proc (log_action_t *act);
-
-#endif /*LOGNTK_H*/
-
-
diff --git a/include/logsim.h b/include/logsim.h
index 0c03576..ff5ed8c 100644
--- a/include/logsim.h
+++ b/include/logsim.h
@@ -1,16 +1,8 @@
-#ifndef LOGSIM_H
-#define LOGSIM_H
+#pragma once
 
 
 #include "logdef.h"
 #include "logdig.h"
-#include "logsima.h"
-#include "logsimed.h"
-#include <graphics/newkbd.h>
-#include <utils/newasm.h>
-#include <graphics/newci.h>
-#include <graphics/newcrt.h>
-#include <graphics/mylib.h>
 
 extern void Log_16_proc (log_action_t *lact);
 extern void Log_16_7seg (log_16_action *act);
@@ -28,8 +20,3 @@ extern void log_16_conf (log_16_action *act, log_nrec *n);
 
 
 extern void log_16_noprog (log_16_action *act);
-
-
-#endif /*LOGSIM_H*/
-
-
diff --git a/include/logsima.h b/include/logsima.h
index ee394b9..408f11d 100644
--- a/include/logsima.h
+++ b/include/logsima.h
@@ -1,5 +1,4 @@
-#ifndef LOGSIMA_H
-#define LOGSIMA_H
+#pragma once
 
 #include "logsim.h"
 #include "logdef.h"
@@ -7,13 +6,6 @@
 #include <utils/newasm.h>
 
 
-#ifdef LOGSIMA_G
-#define vextern
-#else
-#define vextern extern
-#endif 
-
-
 typedef struct nodeinfo {
   log_16_value v, v0, v00, defv, truev;
 } nodeinfo;
@@ -32,19 +24,15 @@ typedef struct gateinfo {
 } gateinfo;
 
 
-vextern log_tool *logsima_tool_16;
-vextern log_16_action logsima_action;
-extern void (*logsima_dig_inst) (log_16_action *act);
+log_tool *logsima_tool_16;
+log_16_action logsima_action;
+void (*logsima_dig_inst) (log_16_action *act);
 
 
-extern void logsima_init ();
-extern void executegates (int *active, log_grec *g);
-extern void executeprog (uchar *pr, log_nrec **pins, gateinfo *ginfo,
+void logsima_init ();
+void executegates (int *active, log_grec *g);
+void executeprog (uchar *pr, log_nrec **pins, gateinfo *ginfo,
 			    na_long *vars);
-extern void clearnodes (log_nrec *n);
-extern void copynodes (log_nrec *n, int *stable);
-extern void callgate (log_16_actionkinds action);
-
-#endif /*LOGSIMA_H*/
-
-
+void clearnodes (log_nrec *n);
+void copynodes (log_nrec *n, int *stable);
+void callgate (log_16_actionkinds action);
diff --git a/include/logsimed.h b/include/logsimed.h
index 3f4701d..1a4d15d 100644
--- a/include/logsimed.h
+++ b/include/logsimed.h
@@ -1,5 +1,5 @@
-#ifndef LOGSIMED_H
-#define LOGSIMED_H
+#pragma once
+
 
 
 #include "logdef.h"
@@ -19,8 +19,3 @@ extern long indent_16 (uchar *proc, long pc);
 extern long length_16 (uchar *proc, long pc);
 
 extern long assem_16 (char *buf, uchar *proc, long *pc);
-
-
-#endif /*LOGSIMED_H*/
-
-
diff --git a/include/logsimh.h b/include/logsimh.h
index 82164c8..3c1787d 100644
--- a/include/logsimh.h
+++ b/include/logsimh.h
@@ -1,22 +1,9 @@
-#ifndef LOGSIMH_H
-#define LOGSIMH_H
+#pragma once
 
 #include "logdef.h"
-#include "loghier.h"
-#include "logdig.h"
-#include "logsima.h"
-#include "logsimed.h"
-#include <utils/newasm.h>
-#include <graphics/newci.h>
-#include <graphics/mylib.h>
 
 extern void Log_16_inst (log_16_action *act);
 extern void Log_dig_inst (log_16_action *act);
 
 
 extern void Log_16_digh (log_16_action *act);
-
-
-#endif /*LOGSIMH_H*/
-
-
diff --git a/include/logspc.h b/include/logspc.h
index 81fc2c3..f66ecf7 100644
--- a/include/logspc.h
+++ b/include/logspc.h
@@ -1,17 +1,5 @@
-#ifndef LOGSPC_H
-#define LOGSPC_H
+#pragma once
 
 #include "logdef.h"
-#include "loghier.h"
-#include <utils/newasm.h>
-#include <graphics/newkbd.h>
-#include <graphics/newci.h>
-#include <graphics/newcrt.h>
-#include <graphics/mylib.h>
-#include <utils/regex.h>
 
 extern void Log_logspc_proc (log_action_t *act);
-
-#endif /*LOGSPC_H*/
-
-
diff --git a/include/logstructs.h b/include/logstructs.h
index 700d2c4..74093cd 100644
--- a/include/logstructs.h
+++ b/include/logstructs.h
@@ -1,5 +1,4 @@
-#ifndef LOGSTRUCTS
-#define LOGSTRUCTS
+#pragma once
 
 #include "settings.h"
 #include "logdef.h"
@@ -17,6 +16,9 @@ typedef struct ovectorrec {
         schar x1, y1, x2, y2;
 } ovectorrec;
 
+typedef char log_pac4[4];
+typedef char log_pac8[8];
+
 /** Union representing a pack of 256 bytes */
 typedef union filerec {
         uchar b[256];
@@ -26,8 +28,8 @@ typedef union filerec {
         int32_t i[64];
         log_pac8 ix[32];
         ovectorrec vec[64];
-        log_pinrec pin[64];
-        log_pnumrec pnum[64];
+        struct log_pinrec pin[64];
+        struct log_pnumrec pnum[64];
         descrec desc[16];
         log_pac4 c4[64];
 } filerec;
@@ -119,5 +121,3 @@ typedef struct baseptrs {
         short x1copy, y1copy, x2copy, y2copy, dxcopy, dycopy, pgnum;
         int valid;
 } baseptrs;
-
-#endif
diff --git a/include/logstuff.h b/include/logstuff.h
index ae449e6..e064d8d 100644
--- a/include/logstuff.h
+++ b/include/logstuff.h
@@ -1,5 +1,4 @@
-#ifndef LOGSTUFF_H
-#define LOGSTUFF_H
+#pragma once
 
 extern void init_X_screen(void);
 extern void recolor_log_cursors(int color, int force);
@@ -12,4 +11,4 @@ struct ext_proc {
   void (*proc)();
 };
 
-#endif
+void m_bunny(int, int);
diff --git a/include/mygates.h b/include/mygates.h
index a4c03b9..904988b 100644
--- a/include/mygates.h
+++ b/include/mygates.h
@@ -1,6 +1,4 @@
-#ifndef MYGATES_H
-#define MYGATES_H
-
+#pragma once
 
 #include "logdef.h"
 #include "logdig.h"
@@ -12,8 +10,3 @@ extern void Log_mygates_sram8k (log_16_action *act);
 extern void Log_mygates_ascdisp (log_16_action *act);
 
 extern void Log_mygates_asckbd (log_16_action *act);
-
-
-#endif /*MYGATES_H*/
-
-
diff --git a/include/node.h b/include/node.h
index efc87d3..e0ab0f4 100644
--- a/include/node.h
+++ b/include/node.h
@@ -1,5 +1,4 @@
-#ifndef NODE_H
-#define NODE_H
+#pragma once
 
 #include "logdef.h"
 #include "logstructs.h"
@@ -48,5 +47,3 @@ void newnoderef(log_nrec **n, uchar st, long ref);
 void delgetnode(log_nrec **save, log_nrec **old, log_nrec **n);
 void checknode(log_nrec *n, struct LOC_checkcombine *LINK);
 int trycombinenodes(log_nrec **n1, log_nrec **n2);
-
-#endif
diff --git a/include/page.h b/include/page.h
index 8e31257..4f1f6d9 100644
--- a/include/page.h
+++ b/include/page.h
@@ -1,5 +1,4 @@
-#ifndef PAGE_H
-#define PAGE_H
+#pragma once
 
 #include "logdef.h"
 #include "gate.h"
@@ -45,5 +44,3 @@ int pagembb(short pg, short *x1, short *y1, short *x2, short *y2);
 log_page *pageAlloc();
 
 void pageFree(log_page **page);
-
-#endif
diff --git a/include/pagereader.h b/include/pagereader.h
index 3fc7b81..406c11d 100644
--- a/include/pagereader.h
+++ b/include/pagereader.h
@@ -1,5 +1,4 @@
-#ifndef PAGEREADER_H
-#define PAGEREADER_H
+#pragma once
 
 #include <stdio.h>
 #include "logdef.h"
@@ -47,5 +46,3 @@ void loadpage(char *filename_, char *reason_);
 void readattrs(FILE **f, log_gattrrec **gattr, short numattrs, log_kattrrec *kattr, strlist_t *lbl, short count);
 void loadlog30(FILE **f, short ver);
 void readpage(char *filename_, char *reason);
-
-#endif
diff --git a/include/pagewriter.h b/include/pagewriter.h
index 9889ff5..7f0ec3e 100644
--- a/include/pagewriter.h
+++ b/include/pagewriter.h
@@ -1,5 +1,4 @@
-#ifndef PAGEWRITER_H
-#define PAGEWRITER_H
+#pragma once
 
 #include <stdio.h>
 #include "logdef.h"
@@ -25,5 +24,3 @@ void writeattrs(FILE **f, log_gattrrec *gattr, short numattrs, log_kattrrec *kat
 void savepage(short pgnum, char *filename_);
 void emergencysave(short pgnum);
 void safesavepage(short pgnum, char *fn);
-
-#endif
diff --git a/include/screen.h b/include/screen.h
index 544aea0..20881fe 100644
--- a/include/screen.h
+++ b/include/screen.h
@@ -1,5 +1,4 @@
-#ifndef SCREEN_H
-#define SCREEN_H
+#pragma once
 
 #include "logdef.h"
 
@@ -130,5 +129,3 @@ void crosshair(short x, short y);
 void xorcursor();
 
 int hvline(short x1, short y1, short *x2, short *y2);
-
-#endif
diff --git a/include/settings.h b/include/settings.h
index f414c33..8f56050 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -1,5 +1,4 @@
-#ifndef SETTINGS_H
-#define SETTINGS_H
+#pragma once
 
 #define debuglog        false
 #define debugprint      true
@@ -111,5 +110,3 @@
 #define NAMEGAP         (3 * gg.scale) /* signallabel horizontal offset */
 
 #define maxeditmodes    4
-
-#endif
diff --git a/include/swap.h b/include/swap.h
index 78d6c6f..81ccf17 100644
--- a/include/swap.h
+++ b/include/swap.h
@@ -1,3 +1,4 @@
+#pragma once
 #include <stdio.h>
 #include <ctype.h>
 #include <utils/p2c.h>
@@ -18,5 +19,3 @@ extern short getshortsw(char * c);
 extern long getintsw(char * c);
 extern long intsw(long ii);
 extern short reverse(short s);
-
-
diff --git a/include/tool.h b/include/tool.h
index 6d2fa76..c01784a 100644
--- a/include/tool.h
+++ b/include/tool.h
@@ -1,5 +1,4 @@
-#ifndef LOG_TOOL_H
-#define LOG_TOOL_H
+#pragma once
 
 #include "logdef.h"
 
@@ -13,5 +12,3 @@ void calltools(log_actionkinds act);
 void callsimtools(log_actionkinds act);
 void closetool(log_tool *tp);
 void closetools();
-
-#endif
diff --git a/include/utils.h b/include/utils.h
index 7be2a4c..784cabe 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -1,8 +1,6 @@
-#ifndef UTILS_H
-#define UTILS_H
+#pragma once
 
 void readreal(char s_[], double *r);
 void stamp(long *i);
 void getword(char *buf, char *wrd);
 void sortshints(short *x, short *y);
-#endif
diff --git a/include/utils/filepack.h b/include/utils/filepack.h
index f08265d..2d0e22a 100644
--- a/include/utils/filepack.h
+++ b/include/utils/filepack.h
@@ -1,12 +1,7 @@
-#ifndef FILEPACK_H
-#define FILEPACK_H
+#pragma once
 
 #include <utils/sysglobals.h>
 
 void fp_change (char *filename1, char *filename2);
 void fp_remove (char *filename);
 int fp_getwd (char *path, char *rootname);
-
-#endif /*FILEPACK_H*/
-
-
diff --git a/include/utils/iodecl.h b/include/utils/iodecl.h
index f06c8a1..205535c 100644
--- a/include/utils/iodecl.h
+++ b/include/utils/iodecl.h
@@ -1,5 +1,4 @@
-#ifndef IODECLARATIONS_H
-#define IODECLARATIONS_H
+#pragma once
 
 #define P_iominisc      0
 #define P_iomaxisc      31
@@ -232,8 +231,3 @@ _PROCEDURE io_error_link;
 
 void io_escape (long my_code, long select_code);
 uchar io_find_isc (void* *iod_temp);
-
-#endif /*IODECLARATIONS_H*/
-
-
-
diff --git a/include/utils/misc.h b/include/utils/misc.h
index 4e8ee95..8f409b6 100644
--- a/include/utils/misc.h
+++ b/include/utils/misc.h
@@ -1,5 +1,4 @@
-#ifndef MISC_H
-#define MISC_H
+#pragma once
 
 /*homeless orphans*/
 #include <utils/sysglobals.h>
@@ -7,8 +6,3 @@
 /* idle character -- 3.0 bug jws 3/20/84 */
 void misc_getioerrmsg (char *s, long lastior);
 char *tilde_expand  (char *s);
-
-#endif /*MISC_H*/
-
-
-
diff --git a/include/utils/newasm.h b/include/utils/newasm.h
index 2a0418b..6d2c08c 100644
--- a/include/utils/newasm.h
+++ b/include/utils/newasm.h
@@ -1,5 +1,4 @@
-#ifndef NEWASM_H
-#define NEWASM_H
+#pragma once
 
 typedef void* na_long;
 
@@ -22,7 +21,3 @@ int P_ibetweenm (long min, long i, long max, long margin);
 
 void* na_rtosr (double r);
 double na_srtor (void* sr);
-
-#endif /*NEWASM_H*/
-
-
diff --git a/include/utils/p2c.h b/include/utils/p2c.h
index 5e2add3..35aca96 100644
--- a/include/utils/p2c.h
+++ b/include/utils/p2c.h
@@ -1,5 +1,4 @@
-#ifndef P2C_H
-#define P2C_H
+#pragma once
 
 #include <stdio.h>
 
@@ -143,7 +142,7 @@ long    *P_expset     (long *, long) DEPRECATED;
 			    (f##_BFLAGS = 0))
 
 /* Memory allocation */
-# define Malloc(n)  (malloc((n != 0) ? (n) : 1) ?: _OutMem())
+#define Malloc(n)  (malloc((n != 0) ? (n) : 1) ?: _OutMem())
 #define Free(p)     (free((void*)(p)), (p)=NULL)
 
 /* packed arrays */   /* BEWARE: these are untested! */
@@ -176,12 +175,9 @@ long    *P_expset     (long *, long) DEPRECATED;
 #define P_max(a,b)   ((a) > (b) ? (a) : (b))
 #define P_min(a,b)   ((a) < (b) ? (a) : (b))
 
-#endif    /* P2C_H */
-
-
 #if !defined(L_cuserid)
 #define L_cuserid 32
 char * cuserid(char *);
 #endif
 
-
+char *GetChipmunkPath(char *ev, char *deft);
diff --git a/include/utils/regex.h b/include/utils/regex.h
index e12adbb..9672a0d 100644
--- a/include/utils/regex.h
+++ b/include/utils/regex.h
@@ -1,10 +1,8 @@
-#ifndef REGEX_H
-#define REGEX_H
-
+#pragma once
 
+#include <stdlib.h>
 #include <utils/newasm.h>
 
-
 #define re_defchars     "\\[]^-*?+$.|~(){}:=<>"
 #define re_shellchars   "\\[]^-    ?       *  "
 
@@ -18,9 +16,3 @@ void re_replace (char *s, char *rex, char *rpl, size_t *pos,
 int re_matchstr (char *s, char *pat);
 int re_matchsubstr (char *s, char *pat, size_t start, size_t *last);
 void re_grepl (char *s, char *pat, char *rpl);
-
-
-#endif /*REGEX_H*/
-
-
-
diff --git a/include/utils/strings.h b/include/utils/strings.h
index 85c32b3..629b708 100644
--- a/include/utils/strings.h
+++ b/include/utils/strings.h
@@ -1,5 +1,4 @@
-#ifndef P2C_STRING_H
-#define P2C_STRING_H
+#pragma once
 
 #include <utils/p2c.h>
 
@@ -56,5 +55,3 @@ void strchange (char** sp, char *);
  * \deprecated
  */
 char *strcpy_overlap(char *dst, char *src) DEPRECATED;
-
-#endif
diff --git a/include/utils/strlist.h b/include/utils/strlist.h
index bb270a2..bea0ce6 100644
--- a/include/utils/strlist.h
+++ b/include/utils/strlist.h
@@ -1,5 +1,4 @@
-#ifndef STRLIST_H
-#define STRLIST_H
+#pragma once
 
 typedef struct strlist_t
 {
@@ -25,7 +24,3 @@ strlist_t *strlist_append (strlist_t **base, char *s);
 strlist_t *strlist_insert (strlist_t **base, char *s);
 
 void strlist_dump (FILE *f, strlist_t *base);
-
-
-#endif
-
diff --git a/include/utils/sysdevs.h b/include/utils/sysdevs.h
index 51f4a33..62f3824 100644
--- a/include/utils/sysdevs.h
+++ b/include/utils/sysdevs.h
@@ -1,5 +1,4 @@
-#ifndef SYSDEVS_H
-#define SYSDEVS_H
+#pragma once
 
 #include <utils/sysglobals.h>
 
@@ -8,8 +7,3 @@ void sysdate (daterec *thedate);
 void systime (timerec *thetime);
 void setsysdate (daterec thedate);
 void setsystime (timerec thetime);
-
-#endif /*SYSDEVS_H*/
-
-
-
diff --git a/include/utils/sysglobals.h b/include/utils/sysglobals.h
index 7769eff..8f7991f 100644
--- a/include/utils/sysglobals.h
+++ b/include/utils/sysglobals.h
@@ -1,5 +1,4 @@
-#ifndef SYSGLOBALS_H
-#define SYSGLOBALS_H
+#pragma once
 
 #define mminint         (-32768L) /*unused/ */
 
@@ -46,8 +45,3 @@ typedef struct datetimerec {
     daterec date;
     timerec time;
 } datetimerec;
-
-#endif /*SYSGLOBALS_H*/
-
-
-
diff --git a/include/wire.h b/include/wire.h
index be26efd..66e604f 100644
--- a/include/wire.h
+++ b/include/wire.h
@@ -1,5 +1,4 @@
-#ifndef WIRE_H
-#define WIRE_H
+#pragma once
 
 #include "logdef.h"
 
@@ -54,4 +53,8 @@ void chghw(log_hwrec *hw, log_nrec *oldnode, log_nrec *n);
 
 void chgvw(log_vwrec *vw, log_nrec *oldnode, log_nrec *n);
 
-#endif
+void newhw(log_hwrec **hw);
+
+void newvw(log_vwrec **vw);
+
+void newsolder(log_srec **s);
diff --git a/src/ana/devtechn.c b/src/ana/devtechn.c
index ff8dd67..2b60457 100644
--- a/src/ana/devtechn.c
+++ b/src/ana/devtechn.c
@@ -62,8 +62,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-static void initlib_Devtechn(act)
-Analog_32_action *act;
+static void initlib_Devtechn(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
 
@@ -77,8 +76,7 @@ Analog_32_action *act;
 }  /*NFET4_Initlib*/
 
 
-static void Reload_Devtechn(act)
-Analog_32_action *act;
+static void Reload_Devtechn(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -156,8 +154,7 @@ Analog_32_action *act;
 
 }
 
-static void Attr_Devtechn(act)
-Analog_32_action *act;
+static void Attr_Devtechn(Analog_32_action *act)
 {
   long Attrnum;
   log_grec *WITH;
@@ -386,16 +383,14 @@ Analog_32_action *act;
   }
 }
 
-static void Openconfig_Devtechn(act)
-Analog_32_action *act;
+static void Openconfig_Devtechn(Analog_32_action *act)
 {
   if (!act->ok)
     return;
   Reload_Devtechn(act);
 }
 
-static void Readgate_Devtechn(act)
-Analog_32_action *act;
+static void Readgate_Devtechn(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -424,8 +419,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Devtechn(act)
-Analog_32_action *act;
+static void Newgate_Devtechn(Analog_32_action *act)
 {
   Analog_32_action Newact;
 
@@ -441,8 +435,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Devtechn                        */
 /*==========================================================================*/
 
-void Log_DEVTECHN_initlib_32(act)
-Analog_32_action *act;
+void Log_DEVTECHN_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -496,9 +489,3 @@ Analog_32_action *act;
 #undef N_linCgs
 #undef N_aCgw
 #undef N_aCwell
-
-
-
-
-
-
diff --git a/src/ana/devtechp.c b/src/ana/devtechp.c
index 7959c59..669a233 100644
--- a/src/ana/devtechp.c
+++ b/src/ana/devtechp.c
@@ -61,8 +61,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-static void initlib_Devtechp(act)
-Analog_32_action *act;
+static void initlib_Devtechp(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
 
@@ -76,8 +75,7 @@ Analog_32_action *act;
 }  /*NFET4_Initlib*/
 
 
-static void Reload_Devtechp(act)
-Analog_32_action *act;
+static void Reload_Devtechp(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -155,8 +153,7 @@ Analog_32_action *act;
 
 }
 
-static void Attr_Devtechp(act)
-Analog_32_action *act;
+static void Attr_Devtechp(Analog_32_action *act)
 {
   long Attrnum;
   log_grec *WITH;
@@ -385,8 +382,7 @@ Analog_32_action *act;
   }
 }
 
-static void Openconfig_Devtechp(act)
-Analog_32_action *act;
+static void Openconfig_Devtechp(Analog_32_action *act)
 {
 
   if (!act->ok)
@@ -394,8 +390,7 @@ Analog_32_action *act;
   Reload_Devtechp(act);
 }
 
-static void Readgate_Devtechp(act)
-Analog_32_action *act;
+static void Readgate_Devtechp(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -424,8 +419,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Devtechp(act)
-Analog_32_action *act;
+static void Newgate_Devtechp(Analog_32_action *act)
 {
   Analog_32_action Newact;
 
@@ -441,8 +435,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Devtechp                        */
 /*==========================================================================*/
 
-void Log_DEVTECHP_initlib_32(act)
-Analog_32_action *act;
+void Log_DEVTECHP_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -496,9 +489,3 @@ Analog_32_action *act;
 #undef N_linCgs
 #undef N_aCgw
 #undef N_aCwell
-
-
-
-
-
-
diff --git a/src/ana/diode1.c b/src/ana/diode1.c
index e178744..2ce3671 100644
--- a/src/ana/diode1.c
+++ b/src/ana/diode1.c
@@ -52,9 +52,7 @@ typedef struct ICDiode1 {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -83,8 +81,7 @@ int Limitflag, Erase;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void Ex_Diode1(act)
-Analog_32_action *act;
+static void Ex_Diode1(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
   AnaExt_rec *Pin1Ptr;
@@ -160,8 +157,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Diode1(act)
-Analog_32_action *act;
+static void Iin_Diode1(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1;
@@ -208,8 +204,7 @@ Analog_32_action *act;
   }
 }  /*Iin_Diode1*/
 
-static void GetCnf_Diode1(NewIC)
-ICDiode1 *NewIC;
+static void GetCnf_Diode1(ICDiode1 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -265,8 +260,7 @@ ICDiode1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Diode1(act)
-Analog_32_action *act;
+static void initlib_Diode1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICDiode1 *NewIC;
@@ -294,9 +288,7 @@ Analog_32_action *act;
 
 
 
-static int Diode1check(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Diode1check(log_grec *Inst, long Attrnum)
 {
   int Result;
   Diode1Const *Diode1Var;
@@ -348,8 +340,7 @@ long Attrnum;
 }
 
 
-static void Attr_Diode1(act)
-Analog_32_action *act;
+static void Attr_Diode1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -361,8 +352,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Diode1(act)
-Analog_32_action *act;
+static void Newgate_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -398,8 +388,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-static void Copygate_Diode1(act)
-Analog_32_action *act;
+static void Copygate_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var, *Old_Diode1var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -415,8 +404,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_Diode1(act)
-Analog_32_action *act;
+static void Dispose_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -427,8 +415,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Diode1(act)
-Analog_32_action *act;
+static void Readgate_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -464,8 +451,7 @@ Analog_32_action *act;
   Diode1Var->K2 = AnaExpo(-Diode1Var->lam * WITH->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Probe_Diode1(act)
-Analog_32_action *act;
+static void Probe_Diode1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
@@ -519,8 +505,7 @@ Analog_32_action *act;
     AnaScoreboard("$", (long)AnaMessGate3);
 }
 
-static void Reset_Diode1(act)
-Analog_32_action *act;
+static void Reset_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -535,8 +520,7 @@ Analog_32_action *act;
     Limitfill(act->inst, Diode1Var->Limit, false);
 }
 
-static void PreUpdate_Diode1(act)
-Analog_32_action *act;
+static void PreUpdate_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -554,8 +538,7 @@ Analog_32_action *act;
   Diode1Var->NewLimit = (VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Update_Diode1(act)
-Analog_32_action *act;
+static void Update_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -567,8 +550,7 @@ Analog_32_action *act;
   Diode1Var->Limit = Diode1Var->NewLimit;
 }
 
-static void Display_Diode1(act)
-Analog_32_action *act;
+static void Display_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -582,8 +564,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_Diode1(act)
-Analog_32_action *act;
+static void Refresh_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -593,8 +574,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Diode1Var->Limit, false);
 }
 
-static void Erase_Diode1(act)
-Analog_32_action *act;
+static void Erase_Diode1(Analog_32_action *act)
 {
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
@@ -610,8 +590,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_Diode1_INITLIB_32(act)
-Analog_32_action *act;
+void Log_Diode1_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -704,5 +683,3 @@ Analog_32_action *act;
 #undef N_Vcrow
 #undef Cstart
 #undef Gatename
-
-
diff --git a/src/ana/ganglion.c b/src/ana/ganglion.c
index 880a633..7df1bf4 100644
--- a/src/ana/ganglion.c
+++ b/src/ana/ganglion.c
@@ -102,9 +102,7 @@ typedef enum {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -132,8 +130,7 @@ int Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-static void GetCnf_Ganglion(NewIC)
-ICGanglion *NewIC;
+static void GetCnf_Ganglion(ICGanglion *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -241,8 +238,7 @@ ICGanglion *NewIC;
 }
 
 
-static void INITLIB_GANGLION(act)
-Analog_32_action *act;
+static void INITLIB_GANGLION(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICGanglion *NewIC;
@@ -296,9 +292,7 @@ Analog_32_action *act;
 
 
 
-static int Ganglioncheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Ganglioncheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   GanglionConst *GanglionVar;
@@ -395,8 +389,7 @@ long Attrnum;
 }
 
 
-static void Attr_Ganglion(act)
-Analog_32_action *act;
+static void Attr_Ganglion(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -414,8 +407,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Ganglion(act)
-Analog_32_action *act;
+static void Newgate_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -486,8 +478,7 @@ Analog_32_action *act;
   WITH->attr[N_Ktqn - 1].changed = true;
 }
 
-static void Copygate_Ganglion(act)
-Analog_32_action *act;
+static void Copygate_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar, *Old_Ganglionvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -502,8 +493,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_Ganglion(act)
-Analog_32_action *act;
+static void Dispose_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -515,8 +505,7 @@ Analog_32_action *act;
 }
 
 
-static void Readgate_Ganglion(act)
-Analog_32_action *act;
+static void Readgate_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -588,8 +577,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_Ganglion(act)
-Analog_32_action *act;
+static void Reset_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -604,8 +592,7 @@ Analog_32_action *act;
     Limitfill(act->inst, GanglionVar->Limit, false);
 }
 
-static void PreUpdate_Ganglion(act)
-Analog_32_action *act;
+static void PreUpdate_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -622,8 +609,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Ganglion(act)
-Analog_32_action *act;
+static void Update_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -636,8 +622,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_Ganglion(act)
-Analog_32_action *act;
+static void Display_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -651,8 +636,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_Ganglion(act)
-Analog_32_action *act;
+static void Refresh_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -663,8 +647,7 @@ Analog_32_action *act;
 }
 
 
-static void Erase_Ganglion(act)
-Analog_32_action *act;
+static void Erase_Ganglion(Analog_32_action *act)
 {
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
@@ -680,8 +663,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-void Ex_Ganglion(act)
-Analog_32_action *act;
+void Ex_Ganglion(Analog_32_action *act)
 {
   double MinIin, dIindVin, dIindVout, dIindVleak, MinIout, dIoutdVin,
 	 dIoutdVout, dIoutdVleak, MinIleak, dIleakdVin, dIleakdVout,
@@ -856,8 +838,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-void Iin_Ganglion(act)
-Analog_32_action *act;
+void Iin_Ganglion(Analog_32_action *act)
 {
   AnaExt_rec *PinInPtr;
   double VPinIn, VMemIn;
@@ -953,8 +934,7 @@ Analog_32_action *act;
 }  /*Iin_Ganglion*/
 
 
-void Probe_Ganglion(act)
-Analog_32_action *act;
+void Probe_Ganglion(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *NodeInPtr, *NodeOutPtr, *NodeLeakPtr;
@@ -1000,8 +980,7 @@ Analog_32_action *act;
 
 
 
-void Log_ganglion_initlib_32(act)
-Analog_32_action *act;
+void Log_ganglion_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/globals.c b/src/ana/globals.c
index 2e91b4f..192fc6c 100644
--- a/src/ana/globals.c
+++ b/src/ana/globals.c
@@ -42,9 +42,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #endif
 
 
-char *AnaProbeVoltStr(AnaResult, Val)
-char *AnaResult;
-double Val;
+char *AnaProbeVoltStr(char *AnaResult, double Val)
 {
   char Outstr[256];
 
@@ -56,9 +54,7 @@ double Val;
 }
 
 
-char *AnaProbeAmpStr(AnaResult, Val)
-char *AnaResult;
-double Val;
+char *AnaProbeAmpStr(char *AnaResult, double Val)
 {
   char Outstr[256];
 
@@ -71,8 +67,7 @@ double Val;
 
 
 
-long AnaGlowVal(Intensity)
-long Intensity;
+long AnaGlowVal(long Intensity)
 {
   if (Intensity > AnaLevelmap.Level_c) {
     if (Intensity > AnaLevelmap.Level_d) {
@@ -124,8 +119,7 @@ void AnaTimeReset()
 /*Execution procedure for analog gates that cannot presently simulate*/
 
 
-void AnaDummyGate(act)
-Analog_32_action *act;
+void AnaDummyGate(Analog_32_action *act)
 {
   switch (act->action) {
 
@@ -151,8 +145,7 @@ Analog_32_action *act;
 }
 
 
-void AnaDummyInit(dummykindptr)
-log_krec *dummykindptr;
+void AnaDummyInit(log_krec *dummykindptr)
 {
   AnaCell_rec *NewCell;
   long Index, FORLIM;
@@ -178,8 +171,7 @@ log_krec *dummykindptr;
 /********************************************************************************/
 /*                   Procedure to set/clear reset memory                        */
 
-void AnaAnalog_ChangeReset(Erase)
-int Erase;
+void AnaAnalog_ChangeReset(int Erase)
 {
 
   /********************************************************************************/
@@ -230,9 +222,7 @@ int Erase;
 /*******************************************************************************/
 /*            Procedure For Changing Scoreboard Message                        */
 
-void AnaScoreboard(Newmessage_, purpose)
-char *Newmessage_;
-long purpose;
+void AnaScoreboard(char *Newmessage_, long purpose)
 {
 
   /*******************************************************************************/
@@ -269,10 +259,7 @@ long purpose;
 /********************************************************************************/
 /*     Procedure for handling LOG.CNF calls                                     */
 
-void AnaGetcommand(Keyword, Arg, Found)
-char *Keyword;
-char *Arg;
-int *Found;
+void AnaGetcommand(char *Keyword, char *Arg, int *Found)
 {
   /*Key to search under*/
   /*command if found*/
@@ -299,9 +286,7 @@ int *Found;
 }
 
 
-void AnaAddcommand(Keyword, Arg)
-char *Keyword;
-char *Arg;
+void AnaAddcommand(char *Keyword, char *Arg)
 {
   /*Key to search under*/
   /*command if found*/
@@ -332,9 +317,7 @@ void AnaPopcommand()
 /*         Utility procedure for data input                                   */
 /******************************************************************************/
 
-void AnaGetvar(Varname, Value)
-char *Varname;
-double *Value;
+void AnaGetvar(char *Varname, double *Value)
 {
   char Name[256];
   double Newval;
@@ -395,8 +378,7 @@ $end$*/
 /*   Mathmatical library of transcendental functions for cell library          */
 /*=============================================================================*/
 
-double AnaTanch(V)
-double V;
+double AnaTanch(double V)
 {
   double Temp;
 
@@ -417,8 +399,7 @@ double V;
 }
 
 
-double AnaExpo(V)
-double V;
+double AnaExpo(double V)
 {
   if (V < -700)
     return 0.0;
@@ -426,8 +407,7 @@ double V;
     return exp(V);
 }
 
-double AnaSqrt(V)
-double V;
+double AnaSqrt(double V)
 {
   if (V < 0)
     return 0.0;
@@ -440,9 +420,7 @@ double V;
 /*     General purpose procedures for attribute range checking                */
 /*=============================================================================*/
 
-int AnaVrange(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+int AnaVrange(log_grec *Inst, long Attrnum)
 {
   int AnaResult;
 
@@ -456,10 +434,7 @@ long Attrnum;
 }
 
 
-int AnaCrange(Inst, Attrnum, OkZero)
-log_grec *Inst;
-long Attrnum;
-int OkZero;
+int AnaCrange(log_grec *Inst, long Attrnum, int OkZero)
 {
   int AnaResult;
 
@@ -477,9 +452,7 @@ int OkZero;
 }
 
 
-int AnaDisplayrange(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+int AnaDisplayrange(log_grec *Inst, long Attrnum)
 {
   int AnaResult;
 
@@ -492,8 +465,7 @@ long Attrnum;
 
 
 
-int AnaGate_On_Display(Inst)
-log_grec *Inst;
+int AnaGate_On_Display(log_grec *Inst)
 {
   int AnaResult;
   log_grec *GCount;
@@ -521,8 +493,7 @@ log_grec *Inst;
 /*        General purpose library to handle pin to ground capacitance          */
 /*=============================================================================*/
 
-void AnaCapInit(inst)
-log_grec *inst;
+void AnaCapInit(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -542,8 +513,7 @@ log_grec *inst;
 
 
 
-void AnaCapCopy(inst)
-log_grec *inst;
+void AnaCapCopy(log_grec *inst)
 {
   Anainstlist *A_Gate, *A_Oldgate;
   long Index, Numpins;
@@ -563,8 +533,7 @@ log_grec *inst;
 }
 
 
-void AnaCapDispose(inst)
-log_grec *inst;
+void AnaCapDispose(log_grec *inst)
 {
   Anainstlist *A_Gate;
 
@@ -573,8 +542,7 @@ log_grec *inst;
 }
 
 
-void AnaCapReset(inst)
-log_grec *inst;
+void AnaCapReset(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -589,8 +557,7 @@ log_grec *inst;
 }
 
 
-void AnaCappass1(inst)
-log_grec *inst;
+void AnaCappass1(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -610,8 +577,7 @@ log_grec *inst;
 }
 
 
-void AnaCappass2(inst)
-log_grec *inst;
+void AnaCappass2(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -638,8 +604,7 @@ log_grec *inst;
 }
 
 
-void AnaCapUpdate(inst)
-log_grec *inst;
+void AnaCapUpdate(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -654,8 +619,7 @@ log_grec *inst;
 }
 
 
-void AnaCapex(inst)
-log_grec *inst;
+void AnaCapex(log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -684,8 +648,7 @@ log_grec *inst;
 }
 
 
-void AnaCapIin(act)
-Analog_32_action *act;
+void AnaCapIin(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Extnodeptr;
@@ -698,10 +661,7 @@ Analog_32_action *act;
 }
 
 
-void AnaCapattrload(base, inst, first)
-long base;
-log_grec *inst;
-int first;
+void AnaCapattrload(long base, log_grec *inst, int first)
 {
   Anainstlist *A_Gate;
   long Index, Address, Numpins;
@@ -732,9 +692,7 @@ int first;
 }
 
 
-void AnaCapattrwrite(base, inst)
-long base;
-log_grec *inst;
+void AnaCapattrwrite(long base, log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -751,9 +709,7 @@ log_grec *inst;
 }
 
 
-void AnaCapattrread(base, inst)
-long base;
-log_grec *inst;
+void AnaCapattrread(long base, log_grec *inst)
 {
   Anainstlist *A_Gate;
   long Index, Numpins;
@@ -773,10 +729,7 @@ log_grec *inst;
 }
 
 
-static void NodevalSet(Setnode, Value, ResetVal)
-log_nrec *Setnode;
-double Value;
-int ResetVal;
+static void NodevalSet(log_nrec *Setnode, double Value, int ResetVal)
 {
   AnaCell_rec *A_Kind;
   Anainstlist *A_Gate;
@@ -822,10 +775,7 @@ int ResetVal;
 
 
 
-void AnaCapattrinsert(base, attrnum, inst, Ok)
-long base, attrnum;
-log_grec *inst;
-int *Ok;
+void AnaCapattrinsert(long base, long attrnum, log_grec *inst, int *Ok)
 {
   Anainstlist *A_Gate;
   long Nodenum, Param;
@@ -889,8 +839,7 @@ int *Ok;
 }
 
 
-static void Dataout(data)
-char *data;
+static void Dataout(char *data)
 {
   if (AnaLogglobals->traceflag)
     fputs(data, *AnaLogglobals->tracefile);
@@ -963,8 +912,7 @@ void AnaMatdump()
 }
 
 
-static void PrintResult(Rownum)
-long Rownum;
+static void PrintResult(long Rownum)
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
@@ -1140,7 +1088,3 @@ void AnaParamUpdate()
   AnaPFab.mu = AnaPFab.del_mu*AnaPFab.mu0*pow((AnaPhysical.T/300),-2.30);
 
 }
-
-
-
-
diff --git a/src/ana/hres.c b/src/ana/hres.c
index 4fcde0f..d014f9b 100644
--- a/src/ana/hres.c
+++ b/src/ana/hres.c
@@ -111,9 +111,7 @@ typedef enum {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -140,8 +138,7 @@ int Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-static void GetCnf_Hres(NewIC)
-ICHres *NewIC;
+static void GetCnf_Hres(ICHres *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -263,8 +260,7 @@ ICHres *NewIC;
 }
 
 
-static void INITLIB_Hres(act)
-Analog_32_action *act;
+static void INITLIB_Hres(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICHres *NewIC;
@@ -320,9 +316,7 @@ Analog_32_action *act;
       TimeTooSmall=1e-60;*/
 
 
-static int Hrescheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Hrescheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   HresConst *HresVar;
@@ -427,8 +421,7 @@ long Attrnum;
 }
 
 
-static void Attr_Hres(act)
-Analog_32_action *act;
+static void Attr_Hres(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -445,8 +438,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Hres(act)
-Analog_32_action *act;
+static void Newgate_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -523,8 +515,7 @@ Analog_32_action *act;
   WITH->attr[N_CapVdiff - 1].changed = true;
 }
 
-static void Copygate_Hres(act)
-Analog_32_action *act;
+static void Copygate_Hres(Analog_32_action *act)
 {
   HresConst *HresVar, *Old_Hresvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -539,8 +530,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_Hres(act)
-Analog_32_action *act;
+static void Dispose_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -552,8 +542,7 @@ Analog_32_action *act;
 }
 
 
-static void Readgate_Hres(act)
-Analog_32_action *act;
+static void Readgate_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -631,8 +620,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_Hres(act)
-Analog_32_action *act;
+static void Reset_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -647,8 +635,7 @@ Analog_32_action *act;
     Limitfill(act->inst, HresVar->Limit, false);
 }
 
-static void PreUpdate_Hres(act)
-Analog_32_action *act;
+static void PreUpdate_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -670,8 +657,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Hres(act)
-Analog_32_action *act;
+static void Update_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -684,8 +670,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_Hres(act)
-Analog_32_action *act;
+static void Display_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -699,8 +684,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_Hres(act)
-Analog_32_action *act;
+static void Refresh_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -711,8 +695,7 @@ Analog_32_action *act;
 }
 
 
-static void Erase_Hres(act)
-Analog_32_action *act;
+static void Erase_Hres(Analog_32_action *act)
 {
   HresConst *HresVar;
   Anainstlist *A_Gate;
@@ -728,8 +711,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Ex_Hres(act)
-Analog_32_action *act;
+static void Ex_Hres(Analog_32_action *act)
 {
   double MinIin, dIindVin, dIindVout, dIindVlow, dIindVhigh, MinIout,
 	 dIoutdVin, dIoutdVout, dIoutdVlow, dIoutdVhigh, MinIlow, dIlowdVin,
@@ -1070,8 +1052,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Hres(act)
-Analog_32_action *act;
+static void Iin_Hres(Analog_32_action *act)
 {
   AnaExt_rec *PinInPtr;
   double VPinIn, VMemIn;
@@ -1234,8 +1215,7 @@ Analog_32_action *act;
 
 
 
-static void Probe_Hres(act)
-Analog_32_action *act;
+static void Probe_Hres(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *NodeInPtr, *NodeOutPtr, *NodeHighPtr, *NodeLowPtr;
@@ -1307,8 +1287,7 @@ Analog_32_action *act;
 
 
 
-void Log_hres_initlib_32(act)
-Analog_32_action *act;
+void Log_hres_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1413,9 +1392,3 @@ Analog_32_action *act;
 #undef H_Vlow
 #undef H_Vhigh
 #undef Gatename
-
-
-
-
-
-
diff --git a/src/ana/idiff.c b/src/ana/idiff.c
index 63fb833..11b48e4 100644
--- a/src/ana/idiff.c
+++ b/src/ana/idiff.c
@@ -87,9 +87,7 @@ typedef struct ICIDiff {
 
 
 
-static void Switchfill(Inst, Erase)
-log_grec *Inst;
-int Erase;
+static void Switchfill(log_grec *Inst, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -112,9 +110,7 @@ int Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -137,10 +133,7 @@ int Limitflag, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-static double Pulsemaker(Inst, Ftime, First)
-log_grec *Inst;
-double Ftime;
-int First;
+static double Pulsemaker(log_grec *Inst, double Ftime, int First)
 {
   double Result;
   int Found;
@@ -196,8 +189,7 @@ int First;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void Ex_IDiff(act)
-Analog_32_action *act;
+static void Ex_IDiff(Analog_32_action *act)
 {
   	/*IDifferent*/
   	double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -293,8 +285,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_IDiff(act)
-Analog_32_action *act;
+static void Iin_IDiff(Analog_32_action *act)
 {
   	/*IDifferent*/
   	AnaExt_rec *Pin1Ptr, *Pin2Ptr;
@@ -404,8 +395,7 @@ Analog_32_action *act;
 }  /*Iin_IDiff*/
 
 
-static void GetCnf_IDiff(NewIC)
-ICIDiff *NewIC;
+static void GetCnf_IDiff(ICIDiff *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -555,8 +545,7 @@ ICIDiff *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_IDiff(act)
-Analog_32_action *act;
+static void initlib_IDiff(Analog_32_action *act)
 {
   /*IDifferent*/
   AnaCell_rec *NewCell;
@@ -597,9 +586,7 @@ Analog_32_action *act;
 
 
 
-static int IDiffcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int IDiffcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
 
@@ -699,8 +686,7 @@ long Attrnum;
 }
 
 
-static void Attr_IDiff(act)
-Analog_32_action *act;
+static void Attr_IDiff(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -712,8 +698,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_IDiff(act)
-Analog_32_action *act;
+static void Newgate_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -760,8 +745,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_IDiff(act)
-Analog_32_action *act;
+static void Copygate_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar, *Old_IDiffvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -776,8 +760,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_IDiff(act)
-Analog_32_action *act;
+static void Dispose_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -788,8 +771,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_IDiff(act)
-Analog_32_action *act;
+static void Readgate_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -816,8 +798,7 @@ Analog_32_action *act;
   IDiffVar->Reset_Freeze = (*STR1 == 'T' || *STR1 == 't');
 }
 
-static void Writegate_IDiff(act)
-Analog_32_action *act;
+static void Writegate_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -838,8 +819,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_IDiff(act)
-Analog_32_action *act;
+static void Reset_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -859,8 +839,7 @@ Analog_32_action *act;
   }
 }
 
-static void Set_Idiff(act)
-Analog_32_action *act;
+static void Set_Idiff(Analog_32_action *act)
 {
   IDiffConst *IdiffVar;
   Anainstlist *A_Gate;
@@ -872,8 +851,7 @@ Analog_32_action *act;
   IdiffVar->Reset_Freeze = act->inst->attr[N_Freeze - 1].UU.b;
 }
 
-static void Clear_Idiff(act)
-Analog_32_action *act;
+static void Clear_Idiff(Analog_32_action *act)
 {
   IDiffConst *IdiffVar;
   Anainstlist *A_Gate;
@@ -889,8 +867,7 @@ Analog_32_action *act;
   IdiffVar->Reset_Freeze = ICptr->ICFreeze;
 }
 
-static void PreUpdate_IDiff(act)
-Analog_32_action *act;
+static void PreUpdate_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -908,8 +885,7 @@ Analog_32_action *act;
   IDiffVar->NewLimit = (VPin2 - VPin1 + WITH->attr[N_Crowbar - 1].UU.r > -0.0004);
 }
 
-static void Update_IDiff(act)
-Analog_32_action *act;
+static void Update_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -925,8 +901,7 @@ Analog_32_action *act;
     IDiffVar->Time += AnaDtlast;
 }
 
-static void Display_IDiff(act)
-Analog_32_action *act;
+static void Display_IDiff(Analog_32_action *act)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -955,8 +930,7 @@ Analog_32_action *act;
 }
 
 
-static void Touch_IDiff(act)
-Analog_32_action *act;
+static void Touch_IDiff(Analog_32_action *act)
 {
   log_action_t *WITH;
   log_grec *WITH1;
@@ -972,8 +946,7 @@ Analog_32_action *act;
 }
 
 
-static void Erase_Idiff(Inst)
-log_grec *Inst;
+static void Erase_Idiff(log_grec *Inst)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -984,8 +957,7 @@ log_grec *Inst;
   Limitfill(Inst, IDiffVar->Limit, true);
 }
 
-static void Refresh_Idiff(Inst)
-log_grec *Inst;
+static void Refresh_Idiff(log_grec *Inst)
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
@@ -997,8 +969,7 @@ log_grec *Inst;
 }
 
 
-static void Probe_Idiff(act)
-Analog_32_action *act;
+static void Probe_Idiff(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   IDiffConst *IdiffVar;
@@ -1061,8 +1032,7 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-void Log_idiff_initlib_32(act)
-Analog_32_action *act;
+void Log_idiff_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1180,13 +1150,3 @@ Analog_32_action *act;
 #undef N_sDelay
 #undef Cstart
 #undef Gatename
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ana/iscope.c b/src/ana/iscope.c
index 2e29010..58f6358 100644
--- a/src/ana/iscope.c
+++ b/src/ana/iscope.c
@@ -62,10 +62,7 @@ typedef struct Imeterrec {
 /*              Procedure to correctly position labels                        */
 
 
-static void Iscope_Locate(rot, Tx, Ty, Left)
-long rot;
-short *Tx, *Ty;
-int *Left;
+static void Iscope_Locate(long rot, short *Tx, short *Ty, int *Left)
 {
 
   /******************************************************************************/
@@ -102,8 +99,7 @@ int *Left;
 }
 
 
-static double Itot(act)
-Analog_32_action *act;
+static double Itot(Analog_32_action *act)
 {
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
@@ -137,8 +133,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void PreUpdate_Iscope(act)
-Analog_32_action *act;
+static void PreUpdate_Iscope(Analog_32_action *act)
 {
   AnaExt_rec *A_Node;
   AnaCell_rec *Cellptr;
@@ -188,8 +183,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Update_Iscope(act)
-Analog_32_action *act;
+static void Update_Iscope(Analog_32_action *act)
 {
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
@@ -219,8 +213,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Display_Iscope(act)
-Analog_32_action *act;
+static void Display_Iscope(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -254,8 +247,7 @@ Analog_32_action *act;
 }  /*Update_Iscope*/
 
 
-static void Pass1_Iscope(act)
-Analog_32_action *act;
+static void Pass1_Iscope(Analog_32_action *act)
 {
   long Mx, My;
   Imeterrec *Intptr;
@@ -304,8 +296,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Refresh_Iscope(act)
-Analog_32_action *act;
+static void Refresh_Iscope(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -343,8 +334,7 @@ Analog_32_action *act;
 /*                Procedure to give current into cell                          */
 /*******************************************************************************/
 
-static void Iin_Iscope(act)
-Analog_32_action *act;
+static void Iin_Iscope(Analog_32_action *act)
 {
 //  log_grec *WITH;
 
@@ -355,8 +345,7 @@ Analog_32_action *act;
 /*                Procedure to update meter display                            */
 /*******************************************************************************/
 
-static void Erase_Iscope(act)
-Analog_32_action *act;
+static void Erase_Iscope(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -389,8 +378,7 @@ Analog_32_action *act;
 }  /*Erase_Iscope*/
 
 
-static void GetCnf_Iscope(NewIC)
-ICIscope *NewIC;
+static void GetCnf_Iscope(ICIscope *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -441,8 +429,7 @@ ICIscope *NewIC;
 /*******************************************************************************/
 
 
-static void INITLIB_ISCOPE(act)
-Analog_32_action *act;
+static void INITLIB_ISCOPE(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICIscope *NewIC;
@@ -465,8 +452,7 @@ Analog_32_action *act;
 }  /*Iscope_initlib*/
 
 
-static void Attr_Iscope(act)
-Analog_32_action *act;
+static void Attr_Iscope(Analog_32_action *act)
 {
   long Attrnum;
   char Oldout[256], Newout[256];
@@ -529,8 +515,7 @@ Analog_32_action *act;
 /*                Procedure to reset cell in algorithm                       */
 /*******************************************************************************/
 
-static void Reset_Iscope(act)
-Analog_32_action *act;
+static void Reset_Iscope(Analog_32_action *act)
 {
   short tx, ty;
   char Oldout[256];
@@ -585,8 +570,7 @@ Analog_32_action *act;
 /*                Procedure to disconnect a Iscope                             */
 /*******************************************************************************/
 
-static void Disconnect_Iscope(act)
-Analog_32_action *act;
+static void Disconnect_Iscope(Analog_32_action *act)
 {
   short tx, ty;
   char Oldout[256];
@@ -629,8 +613,7 @@ Analog_32_action *act;
 
 
 
-static void Newgate_Iscope(act)
-Analog_32_action *act;
+static void Newgate_Iscope(Analog_32_action *act)
 {
   AnaCell_rec *Cellptr;
   ICIscope *ICptr;
@@ -659,8 +642,7 @@ Analog_32_action *act;
   A_Gate->InstVar = (void *)NewIV;
 }
 
-static void Copygate_Iscope(act)
-Analog_32_action *act;
+static void Copygate_Iscope(Analog_32_action *act)
 {
   AnaCell_rec *Cellptr;
   ICIscope *ICptr;
@@ -682,8 +664,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_Iscope(act)
-Analog_32_action *act;
+static void Probe_Iscope(Analog_32_action *act)
 {
   AnaScoreboard(Gatename, (long)AnaMessGate1);
 }
@@ -694,8 +675,7 @@ Analog_32_action *act;
 /*                  Cell Library Entry   Iscope                                */
 /*=============================================================================*/
 
-void Log_iscope_initlib_32(act)
-Analog_32_action *act;
+void Log_iscope_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -767,12 +747,3 @@ Analog_32_action *act;
 #undef N_Format
 #undef N_Prec
 #undef Gatename
-
-
-
-
-
-
-
-
-
diff --git a/src/ana/iswitch1.c b/src/ana/iswitch1.c
index 3b0d139..4782d58 100644
--- a/src/ana/iswitch1.c
+++ b/src/ana/iswitch1.c
@@ -80,9 +80,7 @@ typedef struct ICIswitch1 {
 
 
 
-static void Iswitch1fill(Inst, State, Erase)
-log_grec *Inst;
-int State, Erase;
+static void Iswitch1fill(log_grec *Inst, int State, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -105,9 +103,7 @@ int State, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -131,11 +127,7 @@ int Limitflag, Erase;
 }
 
 
-static double Bistablemaker(Inst, time, State, Ex, OldIideal)
-log_grec *Inst;
-double time;
-int State, Ex;
-double OldIideal;
+static double Bistablemaker(log_grec *Inst, double time, int State, int Ex, double OldIideal)
 {
   double Newtime, Ratio;
 
@@ -161,11 +153,7 @@ double OldIideal;
 }
 
 
-static double Monostablemaker(Inst, time, State, Ex, OldIideal)
-log_grec *Inst;
-double time;
-int State, Ex;
-double OldIideal;
+static double Monostablemaker(log_grec *Inst, double time, int State, int Ex, double OldIideal)
 {
   double Newtime, Ratio;
 
@@ -201,8 +189,7 @@ double OldIideal;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void Ex_Iswitch1(act)
-Analog_32_action *act;
+static void Ex_Iswitch1(Analog_32_action *act)
 {
   	double MinI1, dI1dV1;
   	AnaExt_rec *Pin1Ptr;
@@ -268,8 +255,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Iswitch1(act)
-Analog_32_action *act;
+static void Iin_Iswitch1(Analog_32_action *act)
 {
   	AnaExt_rec *Pin1Ptr;
   	double VPin1;
@@ -320,8 +306,7 @@ Analog_32_action *act;
 }  /*Iin_Iswitch1*/
 
 
-static void GetCnf_Iswitch1(NewIC)
-ICIswitch1 *NewIC;
+static void GetCnf_Iswitch1 (ICIswitch1 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -432,8 +417,7 @@ ICIswitch1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Iswitch1(act)
-Analog_32_action *act;
+static void initlib_Iswitch1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICIswitch1 *NewIC;
@@ -465,8 +449,7 @@ Analog_32_action *act;
 }  /*Iswitch1_Initlib*/
 
 
-static void ResetInit_Iswitch1(act)
-Analog_32_action *act;
+static void ResetInit_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -491,10 +474,7 @@ Analog_32_action *act;
 }
 
 
-static int Iswitch1check(Inst, Attrnum, act)
-log_grec *Inst;
-long Attrnum;
-Analog_32_action *act;
+static int Iswitch1check(log_grec *Inst, long Attrnum, Analog_32_action *act)
 {
   int Result;
   Iswitch1Const *Iswitch1Var;
@@ -560,8 +540,7 @@ Analog_32_action *act;
 }
 
 
-static void Attr_Iswitch1(act)
-Analog_32_action *act;
+static void Attr_Iswitch1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -573,8 +552,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Iswitch1(act)
-Analog_32_action *act;
+static void Newgate_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -616,8 +594,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_Iswitch1(act)
-Analog_32_action *act;
+static void Copygate_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var, *Old_Iswitch1var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -632,8 +609,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_Iswitch1(act)
-Analog_32_action *act;
+static void Dispose_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -644,8 +620,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Iswitch1(act)
-Analog_32_action *act;
+static void Readgate_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -676,8 +651,7 @@ Analog_32_action *act;
   Iswitch1Var->Iideal = Iswitch1Var->OldIideal;
 }
 
-static void Writegate_Iswitch1(act)
-Analog_32_action *act;
+static void Writegate_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -698,8 +672,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_Iswitch1(act)
-Analog_32_action *act;
+static void Reset_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -720,8 +693,7 @@ Analog_32_action *act;
   }
 }
 
-static void Set_Iswitch1(act)
-Analog_32_action *act;
+static void Set_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -734,8 +706,7 @@ Analog_32_action *act;
 }
 
 
-static void PreUpdate_Iswitch1(act)
-Analog_32_action *act;
+static void PreUpdate_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -761,8 +732,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Iswitch1(act)
-Analog_32_action *act;
+static void Update_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -780,8 +750,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_Iswitch1(act)
-Analog_32_action *act;
+static void Display_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -801,8 +770,7 @@ Analog_32_action *act;
 }
 
 
-static void Touch_Iswitch1(act)
-Analog_32_action *act;
+static void Touch_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -832,8 +800,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_Iswitch1(act)
-Analog_32_action *act;
+static void Refresh_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -844,8 +811,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch1Var->Limit, false);
 }
 
-static void Erase_Iswitch1(act)
-Analog_32_action *act;
+static void Erase_Iswitch1(Analog_32_action *act)
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
@@ -856,8 +822,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch1Var->Limit, true);
 }
 
-static void Probe_Iswitch1(act)
-Analog_32_action *act;
+static void Probe_Iswitch1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   Iswitch1Const *Iswitch1Var;
@@ -906,8 +871,7 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-void Log_iswitch1_initlib_32(act)
-Analog_32_action *act;
+void Log_iswitch1_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1024,13 +988,3 @@ Analog_32_action *act;
 #undef Off
 #undef On
 #undef GateName
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ana/iswitch2.c b/src/ana/iswitch2.c
index 97d55d3..a4c8648 100644
--- a/src/ana/iswitch2.c
+++ b/src/ana/iswitch2.c
@@ -80,9 +80,7 @@ typedef struct ICIswitch2 {
 } ICIswitch2;
 
 
-static void Iswitch2fill(Inst, State, Erase)
-log_grec *Inst;
-int State, Erase;
+static void Iswitch2fill(log_grec *Inst, int State, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -105,9 +103,7 @@ int State, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -131,11 +127,7 @@ int Limitflag, Erase;
 }
 
 
-static double Bistablemaker(Inst, time, State, Ex, OldIideal)
-log_grec *Inst;
-double time;
-int State, Ex;
-double OldIideal;
+static double Bistablemaker(log_grec *Inst, double time, int State, int Ex, double OldIideal)
 {
   double Newtime, Ratio;
 
@@ -162,11 +154,7 @@ double OldIideal;
 
 
 
-static double Monostablemaker(Inst, time, State, Ex, OldIideal)
-log_grec *Inst;
-double time;
-int State, Ex;
-double OldIideal;
+static double Monostablemaker(log_grec *Inst, double time, int State, int Ex, double OldIideal)
 {
   double Newtime, Ratio;
 
@@ -202,8 +190,7 @@ double OldIideal;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void Ex_Iswitch2(act)
-Analog_32_action *act;
+static void Ex_Iswitch2(Analog_32_action *act)
 {
   	double MinI1, dI1dV1;
   	AnaExt_rec *Pin1Ptr;
@@ -269,8 +256,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Iswitch2(act)
-Analog_32_action *act;
+static void Iin_Iswitch2(Analog_32_action *act)
 {
   	AnaExt_rec *Pin1Ptr;
   	double VPin1;
@@ -321,8 +307,7 @@ Analog_32_action *act;
   	}
 }  /*Iin_Iswitch2*/
 
-static void GetCnf_Iswitch2(NewIC)
-ICIswitch2 *NewIC;
+static void GetCnf_Iswitch2(ICIswitch2 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -433,8 +418,7 @@ ICIswitch2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Iswitch2(act)
-Analog_32_action *act;
+static void initlib_Iswitch2(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICIswitch2 *NewIC;
@@ -467,8 +451,7 @@ Analog_32_action *act;
 
 
 
-static void ResetInit_Iswitch2(act)
-Analog_32_action *act;
+static void ResetInit_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -493,10 +476,7 @@ Analog_32_action *act;
 }
 
 
-static int Iswitch2check(Inst, Attrnum, act)
-log_grec *Inst;
-long Attrnum;
-Analog_32_action *act;
+static int Iswitch2check(log_grec *Inst, long Attrnum, Analog_32_action *act)
 {
   int Result;
   Iswitch2Const *Iswitch2Var;
@@ -562,8 +542,7 @@ Analog_32_action *act;
 }
 
 
-static void Attr_Iswitch2(act)
-Analog_32_action *act;
+static void Attr_Iswitch2(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -575,8 +554,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Iswitch2(act)
-Analog_32_action *act;
+static void Newgate_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -618,8 +596,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_Iswitch2(act)
-Analog_32_action *act;
+static void Copygate_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var, *Old_Iswitch2var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -634,8 +611,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_Iswitch2(act)
-Analog_32_action *act;
+static void Dispose_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -646,8 +622,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Iswitch2(act)
-Analog_32_action *act;
+static void Readgate_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -678,8 +653,7 @@ Analog_32_action *act;
   Iswitch2Var->Iideal = Iswitch2Var->OldIideal;
 }
 
-static void Writegate_Iswitch2(act)
-Analog_32_action *act;
+static void Writegate_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -700,8 +674,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_Iswitch2(act)
-Analog_32_action *act;
+static void Reset_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -722,8 +695,7 @@ Analog_32_action *act;
   }
 }
 
-static void Set_Iswitch2(act)
-Analog_32_action *act;
+static void Set_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -735,8 +707,7 @@ Analog_32_action *act;
   Iswitch2Var->Reset_Time = Iswitch2Var->Time - AnaAccum;
 }
 
-static void PreUpdate_Iswitch2(act)
-Analog_32_action *act;
+static void PreUpdate_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -761,8 +732,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Iswitch2(act)
-Analog_32_action *act;
+static void Update_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -780,8 +750,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_Iswitch2(act)
-Analog_32_action *act;
+static void Display_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -801,8 +770,7 @@ Analog_32_action *act;
 }
 
 
-static void Touch_Iswitch2(act)
-Analog_32_action *act;
+static void Touch_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -831,8 +799,7 @@ Analog_32_action *act;
   AnaChanged = true;
 }
 
-static void Refresh_Iswitch2(act)
-Analog_32_action *act;
+static void Refresh_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -843,8 +810,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch2Var->Limit, false);
 }
 
-static void Erase_Iswitch2(act)
-Analog_32_action *act;
+static void Erase_Iswitch2(Analog_32_action *act)
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
@@ -856,8 +822,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_Iswitch2(act)
-Analog_32_action *act;
+static void Probe_Iswitch2(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   Iswitch2Const *Iswitch2Var;
@@ -906,8 +871,7 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-void Log_iswitch2_initlib_32(act)
-Analog_32_action *act;
+void Log_iswitch2_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1025,13 +989,3 @@ Analog_32_action *act;
 #undef Off
 #undef On
 #undef GateName
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ana/main.c b/src/ana/main.c
index 96a2db3..54e821a 100644
--- a/src/ana/main.c
+++ b/src/ana/main.c
@@ -27,10 +27,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /*Version 1.5  Modular*/
 
 
-#include <utils/p2c.h>
+#include "utils/p2c.h"
 #include "ana/nsolver.h"
 #include "ana/main.h"
 #include "node.h"
+#include "logstuff.h"
 
 static void Update ();
 
@@ -1410,8 +1411,7 @@ void Analog_Refresh()
 /*         Procedure To Find A New Kind of Gate In  Symbol Table                */
 /*==============================================================================*/
 
-void Analog_Newkind(newkindptr)
-log_krec *newkindptr;
+void Analog_Newkind(log_krec *newkindptr)
 {
   char Procname[256];
   long Index;
@@ -1732,8 +1732,7 @@ static void Analog_Syntax_Check(int *Ok, long *Totnodes)
 /********************************************************************************/
 /*  Procedure To Allocate Internal Node List - Updates Totnodes Appropiately    */
 
-static void Internal_Number(Totnodes)
-long *Totnodes;
+static void Internal_Number(long *Totnodes)
 {
 
   /********************************************************************************/
@@ -1752,8 +1751,7 @@ long *Totnodes;
 /********************************************************************************/
 /* Procedure To Allocate The correct sized array For Simulation                 */
 
-static void Analog_Allocate(Totnodes)
-long Totnodes;
+static void Analog_Allocate(long Totnodes)
 {
 
   /********************************************************************************/
@@ -2672,9 +2670,3 @@ void Analog_Simulate()
   else
     Update();
 }
-
-
-
-
-
-
diff --git a/src/ana/mmeter.c b/src/ana/mmeter.c
index e6b4ce2..e3a5ced 100644
--- a/src/ana/mmeter.c
+++ b/src/ana/mmeter.c
@@ -64,10 +64,7 @@ typedef struct Imeterrec {
 /*              Procedure to correctly position labels                        */
 
 
-static void Mmeter_Locate(rot, Tx, Ty, Left)
-long rot;
-short *Tx, *Ty;
-int *Left;
+static void Mmeter_Locate(long rot, short *Tx, short *Ty, int *Left)
 {
 
   /******************************************************************************/
@@ -104,8 +101,7 @@ int *Left;
 }
 
 
-static double Itot(act)
-Analog_32_action *act;
+static double Itot(Analog_32_action *act)
 {
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
@@ -139,8 +135,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void PreUpdate_Mmeter(act)
-Analog_32_action *act;
+static void PreUpdate_Mmeter(Analog_32_action *act)
 {
   AnaExt_rec *A_Node;
   AnaCell_rec *Cellptr;
@@ -204,8 +199,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Update_Mmeter(act)
-Analog_32_action *act;
+static void Update_Mmeter(Analog_32_action *act)
 {
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
@@ -235,8 +229,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Display_Mmeter(act)
-Analog_32_action *act;
+static void Display_Mmeter(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -274,8 +267,7 @@ Analog_32_action *act;
 
 
 
-static void Pass1_Mmeter(act)
-Analog_32_action *act;
+static void Pass1_Mmeter(Analog_32_action *act)
 {
   long Mx, My;
   Imeterrec *Intptr;
@@ -323,8 +315,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-static void Refresh_Mmeter(act)
-Analog_32_action *act;
+static void Refresh_Mmeter(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -365,8 +356,7 @@ Analog_32_action *act;
 /*                Procedure to give current into cell                          */
 /*******************************************************************************/
 
-static void Iin_Mmeter(act)
-Analog_32_action *act;
+static void Iin_Mmeter(Analog_32_action *act)
 {
 //  log_grec *WITH;
 
@@ -377,8 +367,7 @@ Analog_32_action *act;
 /*                Procedure to update meter display                            */
 /*******************************************************************************/
 
-static void Erase_Mmeter(act)
-Analog_32_action *act;
+static void Erase_Mmeter(Analog_32_action *act)
 {
   short tx, ty;
   int Left;
@@ -411,8 +400,7 @@ Analog_32_action *act;
 }  /*Erase_Mmeter*/
 
 
-static void GetCnf_Mmeter(NewIC)
-ICMmeter *NewIC;
+static void GetCnf_Mmeter(ICMmeter *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -463,8 +451,7 @@ ICMmeter *NewIC;
 /*******************************************************************************/
 
 
-static void INITLIB_Mmeter(act)
-Analog_32_action *act;
+static void INITLIB_Mmeter(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICMmeter *NewIC;
@@ -487,8 +474,7 @@ Analog_32_action *act;
 }  /*Mmeter_initlib*/
 
 
-static void Attr_Mmeter(act)
-Analog_32_action *act;
+static void Attr_Mmeter(Analog_32_action *act)
 {
   long Attrnum;
   char Oldout[256], Newout[256];
@@ -600,8 +586,7 @@ Analog_32_action *act;
 /*                Procedure to reset cell in algorithm                       */
 /*******************************************************************************/
 
-static void Reset_Mmeter(act)
-Analog_32_action *act;
+static void Reset_Mmeter(Analog_32_action *act)
 {
   short tx, ty;
   char Oldout[256];
@@ -659,8 +644,7 @@ Analog_32_action *act;
 /*                Procedure to disconnect a Mmeter                             */
 /*******************************************************************************/
 
-static void Disconnect_Mmeter(act)
-Analog_32_action *act;
+static void Disconnect_Mmeter(Analog_32_action *act)
 {
   short tx, ty;
   char Oldout[256];
@@ -703,8 +687,7 @@ Analog_32_action *act;
 
 
 
-static void Newgate_Mmeter(act)
-Analog_32_action *act;
+static void Newgate_Mmeter(Analog_32_action *act)
 {
   AnaCell_rec *Cellptr;
   ICMmeter *ICptr;
@@ -736,8 +719,7 @@ Analog_32_action *act;
   A_Gate->InstVar = (void *)NewIV;
 }
 
-static void Copygate_Mmeter(act)
-Analog_32_action *act;
+static void Copygate_Mmeter(Analog_32_action *act)
 {
   AnaCell_rec *Cellptr;
   ICMmeter *ICptr;
@@ -759,8 +741,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_Mmeter(act)
-Analog_32_action *act;
+static void Probe_Mmeter(Analog_32_action *act)
 {
   AnaScoreboard(Gatename, (long)AnaMessGate1);
 }
@@ -771,8 +752,7 @@ Analog_32_action *act;
 /*                  Cell Library Entry   Mmeter                                */
 /*=============================================================================*/
 
-void Log_mmeter_initlib_32(act)
-Analog_32_action *act;
+void Log_mmeter_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -847,8 +827,3 @@ Analog_32_action *act;
 #undef Vdisplay
 #undef Idisplay
 #undef Gatename
-
-
-
-
-
diff --git a/src/ana/moscap.c b/src/ana/moscap.c
index 972bf48..2accdbf 100644
--- a/src/ana/moscap.c
+++ b/src/ana/moscap.c
@@ -62,8 +62,7 @@ typedef struct ICMoscap {
 /****************************************************************************/
 
 
-static void Ex_Moscap(act)
-Analog_32_action *act;
+static void Ex_Moscap(Analog_32_action *act)
 {
   double MinI1, dI1dV1;
   AnaExt_rec *Pin1Ptr;
@@ -125,8 +124,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Moscap(act)
-Analog_32_action *act;
+static void Iin_Moscap(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -166,8 +164,7 @@ Analog_32_action *act;
 }  /*Iin_Moscap*/
 
 
-static void GetCnf_Moscap(NewIC)
-ICMoscap *NewIC;
+static void GetCnf_Moscap(ICMoscap *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -227,8 +224,7 @@ ICMoscap *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Moscap(act)
-Analog_32_action *act;
+static void initlib_Moscap(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICMoscap *NewIC;
@@ -270,9 +266,7 @@ Analog_32_action *act;
 
 
 
-static int Moscapcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Moscapcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   MoscapConst *MoscapVar;
@@ -329,8 +323,7 @@ long Attrnum;
 }
 
 
-static void Attr_Moscap(act)
-Analog_32_action *act;
+static void Attr_Moscap(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -342,8 +335,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Moscap(act)
-Analog_32_action *act;
+static void Newgate_Moscap(Analog_32_action *act)
 {
   MoscapConst *MoscapVar;
   Anainstlist *A_Gate;
@@ -380,8 +372,7 @@ Analog_32_action *act;
   WITH->attr[N_Ktqn - 1].changed = true;
 }
 
-static void Copygate_Moscap(act)
-Analog_32_action *act;
+static void Copygate_Moscap(Analog_32_action *act)
 {
   MoscapConst *MoscapVar, *Old_Moscapvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -395,8 +386,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*Initialize attributes 1 to 3*#*/
 }
 
-static void Dispose_Moscap(act)
-Analog_32_action *act;
+static void Dispose_Moscap(Analog_32_action *act)
 {
   MoscapConst *MoscapVar;
   Anainstlist *A_Gate;
@@ -407,8 +397,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Moscap(act)
-Analog_32_action *act;
+static void Readgate_Moscap(Analog_32_action *act)
 {
   MoscapConst *MoscapVar;
   Anainstlist *A_Gate;
@@ -447,8 +436,7 @@ Analog_32_action *act;
   MoscapVar->Kn2 = 1 / WITH->attr[N_Ktqn - 1].UU.r;
 }
 
-static void Probe_MosCap(act)
-Analog_32_action *act;
+static void Probe_MosCap(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr;
@@ -500,8 +488,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_moscap_initlib_32(act)
-Analog_32_action *act;
+void Log_moscap_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/nfet4.c b/src/ana/nfet4.c
index 1bcc6aa..23494ef 100644
--- a/src/ana/nfet4.c
+++ b/src/ana/nfet4.c
@@ -69,8 +69,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-static void Ex_NFET4(act)
-Analog_32_action *act;
+static void Ex_NFET4(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
 	 dI1dV1, dI1dV2, dI1dV3;
@@ -331,8 +330,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_NFET4(act)
-Analog_32_action *act;
+static void Iin_NFET4(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -456,8 +454,7 @@ Analog_32_action *act;
 }  /*Iin_NFET4*/
 
 
-static void GetCnf_Nfet4(NewIC)
-ICNfet *NewIC;
+static void GetCnf_Nfet4(ICNfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -554,8 +551,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NFET4(act)
-Analog_32_action *act;
+static void initlib_NFET4(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNfet *NewIC;
@@ -591,9 +587,7 @@ Analog_32_action *act;
 
 
 
-static int Nfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Nfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   NfetConst *NfetVar;
@@ -682,8 +676,7 @@ long Attrnum;
 }
 
 
-static void Attr_Nfet4(act)
-Analog_32_action *act;
+static void Attr_Nfet4(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -700,8 +693,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Nfet4(act)
-Analog_32_action *act;
+static void Newgate_Nfet4(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -761,8 +753,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-static void Copygate_Nfet4(act)
-Analog_32_action *act;
+static void Copygate_Nfet4(Analog_32_action *act)
 {
   NfetConst *NfetVar, *Old_Nfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -776,8 +767,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Nfet4(act)
-Analog_32_action *act;
+static void Dispose_Nfet4(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -788,8 +778,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Nfet4(act)
-Analog_32_action *act;
+static void Readgate_Nfet4(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -850,8 +839,7 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Nfet4(act)
-Analog_32_action *act;
+static void Probe_Nfet4(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -926,8 +914,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_nfet4_initlib_32(act)
-Analog_32_action *act;
+void Log_nfet4_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1009,8 +996,3 @@ Analog_32_action *act;
 #undef N_Ktqn
 #undef N_Early
 #undef Gatename
-
-
-
-
-
diff --git a/src/ana/nfet5.c b/src/ana/nfet5.c
index ec5b0ee..82cb430 100644
--- a/src/ana/nfet5.c
+++ b/src/ana/nfet5.c
@@ -67,8 +67,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-static void Ex_NFET5(act)
-Analog_32_action *act;
+static void Ex_NFET5(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
 	 dI1dV1, dI1dV2, dI1dV3;
@@ -243,8 +242,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_NFET5(act)
-Analog_32_action *act;
+static void Iin_NFET5(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -359,8 +357,7 @@ Analog_32_action *act;
 }  /*Iin_NFET5*/
 
 
-static void GetCnf_Nfet5(NewIC)
-ICNfet *NewIC;
+static void GetCnf_Nfet5(ICNfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -457,8 +454,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NFET5(act)
-Analog_32_action *act;
+static void initlib_NFET5(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNfet *NewIC;
@@ -493,9 +489,7 @@ Analog_32_action *act;
 }  /*NFET5_Initlib*/
 
 
-static int Nfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Nfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   NfetConst *NfetVar;
@@ -590,8 +584,7 @@ long Attrnum;
 }
 
 
-static void Attr_Nfet5(act)
-Analog_32_action *act;
+static void Attr_Nfet5(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -608,8 +601,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Nfet5(act)
-Analog_32_action *act;
+static void Newgate_Nfet5(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -666,8 +658,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-static void Copygate_Nfet5(act)
-Analog_32_action *act;
+static void Copygate_Nfet5(Analog_32_action *act)
 {
   NfetConst *NfetVar, *Old_Nfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -681,8 +672,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Nfet5(act)
-Analog_32_action *act;
+static void Dispose_Nfet5(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -693,8 +683,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Nfet5(act)
-Analog_32_action *act;
+static void Readgate_Nfet5(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -753,8 +742,7 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Nfet5(act)
-Analog_32_action *act;
+static void Probe_Nfet5(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -829,8 +817,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NFET5_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NFET5_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/nfet7f.c b/src/ana/nfet7f.c
index 41d7c4f..7543e67 100644
--- a/src/ana/nfet7f.c
+++ b/src/ana/nfet7f.c
@@ -87,8 +87,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-static int Nfetconsts(Inst)
-log_grec *Inst;
+static int Nfetconsts(log_grec *Inst)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -168,8 +167,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-static void Ex_NFET7F(act)
-Analog_32_action *act;
+static void Ex_NFET7F(Analog_32_action *act)
 {
   log_grec *WITH;
   AnaMatRec *WITH1;
@@ -442,8 +440,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_NFET7F(act)
-Analog_32_action *act;
+static void Iin_NFET7F(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
   double VPin1, VPin2, VPin3, VPin4, VMem1, VMem2, VMem3;
@@ -611,8 +608,7 @@ Analog_32_action *act;
 }  /*Iin_NFET7F*/
 
 
-static void GetCnf_Nfet7F(NewIC)
-ICNfet *NewIC;
+static void GetCnf_Nfet7F(ICNfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -689,8 +685,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NFET7F(act)
-Analog_32_action *act;
+static void initlib_NFET7F(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNfet *NewIC;
@@ -726,9 +721,7 @@ Analog_32_action *act;
 
 
 
-static int Nfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Nfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
 
@@ -822,8 +815,7 @@ long Attrnum;
 }
 
 
-static void Attr_Nfet7F(act)
-Analog_32_action *act;
+static void Attr_Nfet7F(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -845,8 +837,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Nfet7F(act)
-Analog_32_action *act;
+static void Newgate_Nfet7F(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -896,8 +887,7 @@ Analog_32_action *act;
   Nfetconsts(WITH);
 }
 
-static void Copygate_Nfet7F(act)
-Analog_32_action *act;
+static void Copygate_Nfet7F(Analog_32_action *act)
 {
   NfetConst *NfetVar, *Old_Nfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -911,8 +901,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Nfet7F(act)
-Analog_32_action *act;
+static void Dispose_Nfet7F(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -923,8 +912,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Nfet7F(act)
-Analog_32_action *act;
+static void Readgate_Nfet7F(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -976,8 +964,7 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Nfet7F(act)
-Analog_32_action *act;
+static void Probe_Nfet7F(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -1057,8 +1044,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Nfet7F(act)
-Analog_32_action *act;
+static void Update_Nfet7F(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   NfetConst *NfetVar;
@@ -1082,8 +1068,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NFET7F_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NFET7F_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/nfet7t.c b/src/ana/nfet7t.c
index 7126daf..fce6f40 100644
--- a/src/ana/nfet7t.c
+++ b/src/ana/nfet7t.c
@@ -87,9 +87,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-static int Nfetconsts(Inst)
-log_grec *Inst;
-
+static int Nfetconsts(log_grec *Inst)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -169,8 +167,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-static void Ex_NFET7T(act)
-Analog_32_action *act;
+static void Ex_NFET7T(Analog_32_action *act)
 {
   log_grec *WITH;
   AnaMatRec *WITH1;
@@ -402,8 +399,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_NFET7T(act)
-Analog_32_action *act;
+static void Iin_NFET7T(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -548,8 +544,7 @@ Analog_32_action *act;
 }  /*Iin_NFET7T*/
 
 
-static void GetCnf_Nfet7T(NewIC)
-ICNfet *NewIC;
+static void GetCnf_Nfet7T(ICNfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -618,8 +613,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NFET7T(act)
-Analog_32_action *act;
+static void initlib_NFET7T(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNfet *NewIC;
@@ -651,9 +645,7 @@ Analog_32_action *act;
 }  /*NFET7T_Initlib*/
 
 
-static int Nfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Nfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
 
@@ -741,8 +733,7 @@ long Attrnum;
 }
 
 
-static void Attr_Nfet7T(act)
-Analog_32_action *act;
+static void Attr_Nfet7T(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -764,8 +755,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Nfet7T(act)
-Analog_32_action *act;
+static void Newgate_Nfet7T(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -815,8 +805,7 @@ Analog_32_action *act;
   Nfetconsts(WITH);
 }
 
-static void Copygate_Nfet7T(act)
-Analog_32_action *act;
+static void Copygate_Nfet7T(Analog_32_action *act)
 {
   NfetConst *NfetVar, *Old_Nfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -830,8 +819,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Nfet7T(act)
-Analog_32_action *act;
+static void Dispose_Nfet7T(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -842,8 +830,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Nfet7T(act)
-Analog_32_action *act;
+static void Readgate_Nfet7T(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -895,8 +882,7 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Nfet7T(act)
-Analog_32_action *act;
+static void Probe_Nfet7T(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -966,8 +952,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Nfet7T(act)
-Analog_32_action *act;
+static void Update_Nfet7T(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   NfetConst *NfetVar;
@@ -993,8 +978,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NFET7T_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NFET7T_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/npn1.c b/src/ana/npn1.c
index af7336d..59bf534 100644
--- a/src/ana/npn1.c
+++ b/src/ana/npn1.c
@@ -60,9 +60,7 @@ typedef struct ICNPN1 {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -104,8 +102,7 @@ int Limitflag, Erase;
 
 
 
-static void Ex_NPN1(act)
-Analog_32_action *act;
+static void Ex_NPN1(Analog_32_action *act)
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
 	 dI3dV1, dI3dV2, dI3dV3;
@@ -274,8 +271,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_NPN1(act)
-Analog_32_action *act;
+static void Iin_NPN1(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -386,8 +382,7 @@ Analog_32_action *act;
   }
 }  /*Iin_NPN1*/
 
-static void GetCnf_NPN1(NewIC)
-ICNPN1 *NewIC;
+static void GetCnf_NPN1(ICNPN1 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -478,8 +473,7 @@ ICNPN1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NPN1(act)
-Analog_32_action *act;
+static void initlib_NPN1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNPN1 *NewIC;
@@ -519,9 +513,7 @@ Analog_32_action *act;
    #define MAKE_IECO(n)	((n)->IECO=(n)->Is*(n)->betaR/((n)->betaR+(n)->betaF))
 */
 
-static int NPN1check(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int NPN1check(log_grec *Inst, long Attrnum)
 {
   int Result;
   NPN1Const *NPN1Var;
@@ -620,8 +612,7 @@ long Attrnum;
 }
 
 
-static void Attr_NPN1(act)
-Analog_32_action *act;
+static void Attr_NPN1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -638,8 +629,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_NPN1(act)
-Analog_32_action *act;
+static void Newgate_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -697,8 +687,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-static void Copygate_NPN1(act)
-Analog_32_action *act;
+static void Copygate_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var, *Old_NPN1var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -714,8 +703,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_NPN1(act)
-Analog_32_action *act;
+static void Dispose_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -726,8 +714,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Npn1(act)
-Analog_32_action *act;
+static void Readgate_Npn1(Analog_32_action *act)
 {
   NPN1Const *Npn1Var;
   Anainstlist *A_Gate;
@@ -786,8 +773,7 @@ Analog_32_action *act;
   Npn1Var->TauCbe = 0.0;
 }
 
-static void Probe_Npn1(act)
-Analog_32_action *act;
+static void Probe_Npn1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -850,8 +836,7 @@ Analog_32_action *act;
   }
 }
 
-static void Reset_NPN1(act)
-Analog_32_action *act;
+static void Reset_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -866,8 +851,7 @@ Analog_32_action *act;
     Limitfill(act->inst, NPN1Var->Limit, false);
 }
 
-static void PreUpdate_NPN1(act)
-Analog_32_action *act;
+static void PreUpdate_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -888,8 +872,7 @@ Analog_32_action *act;
 		       VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Update_NPN1(act)
-Analog_32_action *act;
+static void Update_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -901,8 +884,7 @@ Analog_32_action *act;
   NPN1Var->Limit = NPN1Var->NewLimit;
 }
 
-static void Display_NPN1(act)
-Analog_32_action *act;
+static void Display_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -916,8 +898,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_NPN1(act)
-Analog_32_action *act;
+static void Refresh_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -927,8 +908,7 @@ Analog_32_action *act;
   Limitfill(act->inst, NPN1Var->Limit, false);
 }
 
-static void Erase_NPN1(act)
-Analog_32_action *act;
+static void Erase_NPN1(Analog_32_action *act)
 {
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
@@ -944,8 +924,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NPN1_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NPN1_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/npn2.c b/src/ana/npn2.c
index 3da4aca..4eb3a0b 100644
--- a/src/ana/npn2.c
+++ b/src/ana/npn2.c
@@ -62,9 +62,7 @@ typedef struct ICNPN2 {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -114,8 +112,7 @@ int Limitflag, Erase;
 /****************************************************************************/
 
 
-static void Ex_NPN2(act)
-Analog_32_action *act;
+static void Ex_NPN2(Analog_32_action *act)
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
 	 dI3dV1, dI3dV2, dI3dV3;
@@ -287,8 +284,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_NPN2(act)
-Analog_32_action *act;
+static void Iin_NPN2(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -402,8 +398,7 @@ Analog_32_action *act;
   }
 }  /*Iin_NPN2*/
 
-static void GetCnf_NPN2(NewIC)
-ICNPN2 *NewIC;
+static void GetCnf_NPN2(ICNPN2 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -501,8 +496,7 @@ ICNPN2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NPN2(act)
-Analog_32_action *act;
+static void initlib_NPN2(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNPN2 *NewIC;
@@ -541,9 +535,7 @@ Analog_32_action *act;
 #define MAKE_IECO(n)	((n)->IECO=(n)->Is/(n)->betaR)
 
 
-static int NPN2check(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int NPN2check(log_grec *Inst, long Attrnum)
 {
   int Result;
   NPN2Const *NPN2Var;
@@ -649,8 +641,7 @@ long Attrnum;
 }
 
 
-static void Attr_NPN2(act)
-Analog_32_action *act;
+static void Attr_NPN2(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -667,8 +658,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_NPN2(act)
-Analog_32_action *act;
+static void Newgate_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -730,8 +720,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-static void Copygate_NPN2(act)
-Analog_32_action *act;
+static void Copygate_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var, *Old_NPN2var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -747,8 +736,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_NPN2(act)
-Analog_32_action *act;
+static void Dispose_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -759,8 +747,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Npn2(act)
-Analog_32_action *act;
+static void Readgate_Npn2(Analog_32_action *act)
 {
   NPN2Const *Npn2Var;
   Anainstlist *A_Gate;
@@ -823,8 +810,7 @@ Analog_32_action *act;
   Npn2Var->TauCbe = 0.0;
 }
 
-static void Probe_Npn2(act)
-Analog_32_action *act;
+static void Probe_Npn2(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -887,8 +873,7 @@ Analog_32_action *act;
   }
 }
 
-static void Reset_NPN2(act)
-Analog_32_action *act;
+static void Reset_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -903,8 +888,7 @@ Analog_32_action *act;
     Limitfill(act->inst, NPN2Var->Limit, false);
 }
 
-static void PreUpdate_NPN2(act)
-Analog_32_action *act;
+static void PreUpdate_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -925,8 +909,7 @@ Analog_32_action *act;
 			   VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Update_NPN2(act)
-Analog_32_action *act;
+static void Update_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -938,8 +921,7 @@ Analog_32_action *act;
   NPN2Var->Limit = NPN2Var->NewLimit;
 }
 
-static void Display_NPN2(act)
-Analog_32_action *act;
+static void Display_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -953,8 +935,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_NPN2(act)
-Analog_32_action *act;
+static void Refresh_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -964,8 +945,7 @@ Analog_32_action *act;
   Limitfill(act->inst, NPN2Var->Limit, false);
 }
 
-static void Erase_NPN2(act)
-Analog_32_action *act;
+static void Erase_NPN2(Analog_32_action *act)
 {
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
@@ -981,8 +961,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NPN2_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NPN2_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/nspc1.c b/src/ana/nspc1.c
index 7fdc5d1..2978fd6 100644
--- a/src/ana/nspc1.c
+++ b/src/ana/nspc1.c
@@ -41,7 +41,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* From input file "swiss.text" */
 
 
-#include <utils/p2c.h>
+#include "utils/p2c.h"
 #include "ana/nspc1.h"
 #include "node.h"
 
@@ -84,12 +84,26 @@ typedef struct ICNfet {
 } ICNfet;
 
 
-static void Show_W_L(Inst,erase)
-log_grec *Inst;
-int erase;
+void drawnum3(short x, short y, short n)
+{
+  char s[4];
+
+  m_move((long)x, (long)y);
+  strcpy(s, "   ");
+  m_displaytext(s);
+  if (n >= 100)
+  {
+      s[0] = n/100 + '0';
+      s[1] = (n%100)/10 + '0';
+  } else if (n >= 10 )
+    s[1] = n / 10 + '0';
+  s[2] = n % 10 + '0';
+  m_displaytext(s);
+}
+
+static void Show_W_L(log_grec *Inst, int erase)
 {
   short Lx, Ly, Wx, Wy;
-  void drawnum3();
   short oldWx,oldWy,oldLx,oldLy;
   int W,L;
   float scale;
@@ -193,31 +207,12 @@ int erase;
 }
 
 
-void drawnum3(x, y, n)
-short x, y, n;
-{
-  char s[4];
-
-  m_move((long)x, (long)y);
-  strcpy(s, "   ");
-  m_displaytext(s);
-  if (n >= 100)
-  {
-      s[0] = n/100 + '0';
-      s[1] = (n%100)/10 + '0';
-  } else if (n >= 10 )
-    s[1] = n / 10 + '0';
-  s[2] = n % 10 + '0';
-  m_displaytext(s);
-}
-
 /****************************************************************************/
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
 
-static void Ex_NSPC1(act)
-Analog_32_action *act;
+static void Ex_NSPC1(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4,
          MinI3, dI3dV1, dI3dV2, dI3dV3, dI3dV4,
@@ -430,8 +425,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_NSPC1(act)
-Analog_32_action *act;
+static void Iin_NSPC1(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
   double VPin1, VPin2, VPin3, VPin4, VMem1, VMem2, VMem3;
@@ -555,8 +549,7 @@ Analog_32_action *act;
 }  /*Iin_NSPC1*/
 
 
-static void GetCnf_Nspc1(NewIC)
-ICNfet *NewIC;
+static void GetCnf_Nspc1(ICNfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -684,8 +677,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_NSPC1(act)
-Analog_32_action *act;
+static void initlib_NSPC1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICNfet *NewIC;
@@ -725,9 +717,7 @@ Analog_32_action *act;
 }  /*NSPC1_Initlib*/
 
 
-static int Nfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Nfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   NfetConst *NfetVar;
@@ -865,8 +855,7 @@ long Attrnum;
 }
 
 
-static void Attr_Nspc1(act)
-Analog_32_action *act;
+static void Attr_Nspc1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -888,8 +877,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Nspc1(act)
-Analog_32_action *act;
+static void Newgate_Nspc1(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -962,8 +950,7 @@ Analog_32_action *act;
   WITH->attr[N_Number - 1].changed = true;
 }
 
-static void Copygate_Nspc1(act)
-Analog_32_action *act;
+static void Copygate_Nspc1(Analog_32_action *act)
 {
   NfetConst *NfetVar, *Old_Nfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -977,8 +964,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Nspc1(act)
-Analog_32_action *act;
+static void Dispose_Nspc1(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -989,8 +975,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Nspc1(act)
-Analog_32_action *act;
+static void Readgate_Nspc1(Analog_32_action *act)
 {
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
@@ -1071,8 +1056,7 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Nspc1(act)
-Analog_32_action *act;
+static void Probe_Nspc1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -1156,8 +1140,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_NSPC1_INITLIB_32(act)
-Analog_32_action *act;
+void Log_NSPC1_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1255,11 +1238,3 @@ Analog_32_action *act;
 #undef N_L
 #undef N_Number
 #undef Gatename
-
-
-
-
-
-
-
-
diff --git a/src/ana/pfet4.c b/src/ana/pfet4.c
index a123cb5..7713c2d 100644
--- a/src/ana/pfet4.c
+++ b/src/ana/pfet4.c
@@ -65,8 +65,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-static void Ex_PFET4(act)
-Analog_32_action *act;
+static void Ex_PFET4(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
 	 dI1dV1, dI1dV2, dI1dV3;
@@ -325,8 +324,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_PFET4(act)
-Analog_32_action *act;
+static void Iin_PFET4(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -449,8 +447,7 @@ Analog_32_action *act;
   }
 }  /*Iin_PFET4*/
 
-static void GetCnf_Pfet4(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pfet4(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -547,8 +544,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PFET4(act)
-Analog_32_action *act;
+static void initlib_PFET4(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -584,9 +580,7 @@ Analog_32_action *act;
 
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   PfetConst *PfetVar;
@@ -675,8 +669,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pfet4(act)
-Analog_32_action *act;
+static void Attr_Pfet4(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -693,8 +686,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pfet4(act)
-Analog_32_action *act;
+static void Newgate_Pfet4(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -754,8 +746,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-static void Copygate_Pfet4(act)
-Analog_32_action *act;
+static void Copygate_Pfet4(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -769,8 +760,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pfet4(act)
-Analog_32_action *act;
+static void Dispose_Pfet4(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -781,8 +771,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pfet4(act)
-Analog_32_action *act;
+static void Readgate_Pfet4(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -843,8 +832,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
 }
 
-static void Probe_Pfet4(act)
-Analog_32_action *act;
+static void Probe_Pfet4(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -920,8 +908,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_pfet4_initlib_32(act)
-Analog_32_action *act;
+void Log_pfet4_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pfet5.c b/src/ana/pfet5.c
index 845ddbc..d0820cf 100644
--- a/src/ana/pfet5.c
+++ b/src/ana/pfet5.c
@@ -67,8 +67,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-static void Ex_PFET5(act)
-Analog_32_action *act;
+static void Ex_PFET5(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
 	 dI1dV1, dI1dV2, dI1dV3;
@@ -241,8 +240,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_PFET5(act)
-Analog_32_action *act;
+static void Iin_PFET5(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -357,8 +355,7 @@ Analog_32_action *act;
 }  /*Iin_PFET5*/
 
 
-static void GetCnf_Pfet5(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pfet5(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -455,8 +452,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PFET5(act)
-Analog_32_action *act;
+static void initlib_PFET5(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -491,9 +487,7 @@ Analog_32_action *act;
 }  /*PFET5_Initlib*/
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   PfetConst *PfetVar;
@@ -590,8 +584,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pfet5(act)
-Analog_32_action *act;
+static void Attr_Pfet5(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -608,8 +601,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pfet5(act)
-Analog_32_action *act;
+static void Newgate_Pfet5(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -667,8 +659,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-static void Copygate_Pfet5(act)
-Analog_32_action *act;
+static void Copygate_Pfet5(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -682,8 +673,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pfet5(act)
-Analog_32_action *act;
+static void Dispose_Pfet5(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -694,8 +684,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pfet5(act)
-Analog_32_action *act;
+static void Readgate_Pfet5(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -755,8 +744,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Pfet5(act)
-Analog_32_action *act;
+static void Probe_Pfet5(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -830,8 +818,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PFET5_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PFET5_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pfet6.c b/src/ana/pfet6.c
index 03ed6fe..1f81a77 100644
--- a/src/ana/pfet6.c
+++ b/src/ana/pfet6.c
@@ -68,8 +68,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-static void Ex_PFET6(act)
-Analog_32_action *act;
+static void Ex_PFET6(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4,
          MinI3, dI3dV1, dI3dV2, dI3dV3, dI3dV4,
@@ -284,8 +283,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_PFET6(act)
-Analog_32_action *act;
+static void Iin_PFET6(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
   double VPin1, VPin2, VPin3, VPin4, VMem1, VMem2, VMem3;
@@ -409,8 +407,7 @@ Analog_32_action *act;
 }  /*Iin_PFET6*/
 
 
-static void GetCnf_Pfet6(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pfet6(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -514,8 +511,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PFET6(act)
-Analog_32_action *act;
+static void initlib_PFET6(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -553,9 +549,7 @@ Analog_32_action *act;
 }  /*PFET6_Initlib*/
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   PfetConst *PfetVar;
@@ -665,8 +659,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pfet6(act)
-Analog_32_action *act;
+static void Attr_Pfet6(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -683,8 +676,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pfet6(act)
-Analog_32_action *act;
+static void Newgate_Pfet6(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -746,8 +738,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-static void Copygate_Pfet6(act)
-Analog_32_action *act;
+static void Copygate_Pfet6(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -761,8 +752,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pfet6(act)
-Analog_32_action *act;
+static void Dispose_Pfet6(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -773,8 +763,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pfet6(act)
-Analog_32_action *act;
+static void Readgate_Pfet6(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -839,8 +828,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Pfet6(act)
-Analog_32_action *act;
+static void Probe_Pfet6(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -925,8 +913,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PFET6_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PFET6_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pfet7f.c b/src/ana/pfet7f.c
index 81065d2..8af0e1e 100644
--- a/src/ana/pfet7f.c
+++ b/src/ana/pfet7f.c
@@ -85,9 +85,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-static int Pfetconsts(Inst)
-log_grec *Inst;
-
+static int Pfetconsts(log_grec *Inst)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -165,8 +163,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-static void Ex_PFET7F(act)
-Analog_32_action *act;
+static void Ex_PFET7F(Analog_32_action *act)
 {
   log_grec *WITH;
   AnaMatRec *WITH1;
@@ -447,8 +444,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_PFET7F(act)
-Analog_32_action *act;
+static void Iin_PFET7F(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
   double VPin1, VPin2, VPin3, VPin4, VMem1, VMem2, VMem3;
@@ -616,8 +612,7 @@ Analog_32_action *act;
 }  /*Iin_PFET7F*/
 
 
-static void GetCnf_Pfet7F(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pfet7F(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -694,8 +689,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PFET7F(act)
-Analog_32_action *act;
+static void initlib_PFET7F(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -730,9 +724,7 @@ Analog_32_action *act;
 }  /*PFET7F_Initlib*/
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
 
@@ -825,8 +817,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pfet7F(act)
-Analog_32_action *act;
+static void Attr_Pfet7F(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -848,8 +839,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pfet7F(act)
-Analog_32_action *act;
+static void Newgate_Pfet7F(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -899,8 +889,7 @@ Analog_32_action *act;
   Pfetconsts(WITH);
 }
 
-static void Copygate_Pfet7F(act)
-Analog_32_action *act;
+static void Copygate_Pfet7F(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -914,8 +903,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pfet7F(act)
-Analog_32_action *act;
+static void Dispose_Pfet7F(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -926,8 +914,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pfet7F(act)
-Analog_32_action *act;
+static void Readgate_Pfet7F(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -979,8 +966,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Pfet7F(act)
-Analog_32_action *act;
+static void Probe_Pfet7F(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -1060,8 +1046,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Pfet7F(act)
-Analog_32_action *act;
+static void Update_Pfet7F(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   PfetConst *PfetVar;
@@ -1084,8 +1069,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PFET7F_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PFET7F_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pfet7t.c b/src/ana/pfet7t.c
index 153d8b3..c65efed 100644
--- a/src/ana/pfet7t.c
+++ b/src/ana/pfet7t.c
@@ -87,8 +87,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-static int Pfetconsts(Inst)
-log_grec *Inst;
+static int Pfetconsts(log_grec *Inst)
 
 {
   PfetConst *PfetVar;
@@ -167,8 +166,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-static void Ex_PFET7T(act)
-Analog_32_action *act;
+static void Ex_PFET7T(Analog_32_action *act)
 {
   log_grec *WITH;
   AnaMatRec *WITH1;
@@ -410,8 +408,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_PFET7T(act)
-Analog_32_action *act;
+static void Iin_PFET7T(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
   double VPin1, VPin2, VPin3, VMem1, VMem2, VMem3;
@@ -556,8 +553,7 @@ Analog_32_action *act;
 }  /*Iin_PFET7T*/
 
 
-static void GetCnf_Pfet7T(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pfet7T(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -627,8 +623,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PFET7T(act)
-Analog_32_action *act;
+static void initlib_PFET7T(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -660,9 +655,7 @@ Analog_32_action *act;
 }  /*PFET7T_Initlib*/
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
 
@@ -750,8 +743,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pfet7T(act)
-Analog_32_action *act;
+static void Attr_Pfet7T(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -773,8 +765,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pfet7T(act)
-Analog_32_action *act;
+static void Newgate_Pfet7T(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -824,8 +815,7 @@ Analog_32_action *act;
   Pfetconsts(WITH);
 }
 
-static void Copygate_Pfet7T(act)
-Analog_32_action *act;
+static void Copygate_Pfet7T(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -839,8 +829,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pfet7T(act)
-Analog_32_action *act;
+static void Dispose_Pfet7T(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -851,8 +840,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pfet7T(act)
-Analog_32_action *act;
+static void Readgate_Pfet7T(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -904,8 +892,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Pfet7T(act)
-Analog_32_action *act;
+static void Probe_Pfet7T(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -975,8 +962,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_Pfet7T(act)
-Analog_32_action *act;
+static void Update_Pfet7T(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   PfetConst *PfetVar;
@@ -1003,8 +989,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PFET7T_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PFET7T_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/physical.c b/src/ana/physical.c
index e2f96df..94d1d3e 100644
--- a/src/ana/physical.c
+++ b/src/ana/physical.c
@@ -48,8 +48,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-static void initlib_Physical(act)
-Analog_32_action *act;
+static void initlib_Physical(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
 
@@ -63,8 +62,7 @@ Analog_32_action *act;
 }  /*NFET4_Initlib*/
 
 
-static void Reload_Physical(act)
-Analog_32_action *act;
+static void Reload_Physical(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -110,8 +108,7 @@ Analog_32_action *act;
 
 }
 
-static void Attr_Physical(act)
-Analog_32_action *act;
+static void Attr_Physical(Analog_32_action *act)
 {
   long Attrnum;
   log_grec *WITH;
@@ -215,8 +212,7 @@ Analog_32_action *act;
   }
 }
 
-static void Openconfig_Physical(act)
-Analog_32_action *act;
+static void Openconfig_Physical(Analog_32_action *act)
 {
 
   if (!act->ok)
@@ -224,8 +220,7 @@ Analog_32_action *act;
   Reload_Physical(act);
 }
 
-void Readgate_Physical(act)
-Analog_32_action *act;
+void Readgate_Physical(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -243,8 +238,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Physical(act)
-Analog_32_action *act;
+static void Newgate_Physical(Analog_32_action *act)
 {
   Analog_32_action Newact;
 
@@ -260,8 +254,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Physical                    */
 /*==========================================================================*/
 
-void Log_PHYSICAL_initlib_32(act)
-Analog_32_action *act;
+void Log_PHYSICAL_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -303,10 +296,3 @@ Analog_32_action *act;
 #undef N_phi_ms
 #undef N_Eg
 #undef N_ni
-
-
-
-
-
-
-
diff --git a/src/ana/pnp1.c b/src/ana/pnp1.c
index 7baa96f..afacb64 100644
--- a/src/ana/pnp1.c
+++ b/src/ana/pnp1.c
@@ -60,9 +60,7 @@ typedef struct ICPNP1 {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -104,8 +102,7 @@ int Limitflag, Erase;
 
 
 
-static void Ex_PNP1(act)
-Analog_32_action *act;
+static void Ex_PNP1(Analog_32_action *act)
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
 	 dI3dV1, dI3dV2, dI3dV3;
@@ -274,8 +271,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_PNP1(act)
-Analog_32_action *act;
+static void Iin_PNP1(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -386,8 +382,7 @@ Analog_32_action *act;
   }
 }  /*Iin_PNP1*/
 
-static void GetCnf_PNP1(NewIC)
-ICPNP1 *NewIC;
+static void GetCnf_PNP1(ICPNP1 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -478,8 +473,7 @@ ICPNP1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PNP1(act)
-Analog_32_action *act;
+static void initlib_PNP1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPNP1 *NewIC;
@@ -521,9 +515,7 @@ Analog_32_action *act;
    #define MAKE_IECO(n)	((n)->IECO=(n)->Is*(n)->betaR/((n)->betaR+(n)->betaF))
 */
 
-static int PNP1check(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int PNP1check(log_grec *Inst, long Attrnum)
 {
   int Result;
   PNP1Const *PNP1Var;
@@ -622,8 +614,7 @@ long Attrnum;
 }
 
 
-static void Attr_PNP1(act)
-Analog_32_action *act;
+static void Attr_PNP1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -640,8 +631,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_PNP1(act)
-Analog_32_action *act;
+static void Newgate_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -699,8 +689,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-static void Copygate_PNP1(act)
-Analog_32_action *act;
+static void Copygate_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var, *Old_PNP1var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -716,8 +705,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_PNP1(act)
-Analog_32_action *act;
+static void Dispose_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -728,8 +716,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_PNP1(act)
-Analog_32_action *act;
+static void Readgate_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -788,8 +775,7 @@ Analog_32_action *act;
   PNP1Var->TauCbe = 0.0;
 }
 
-static void Probe_PNP1(act)
-Analog_32_action *act;
+static void Probe_PNP1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -852,8 +838,7 @@ Analog_32_action *act;
   }
 }
 
-static void Reset_PNP1(act)
-Analog_32_action *act;
+static void Reset_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -868,8 +853,7 @@ Analog_32_action *act;
     Limitfill(act->inst, PNP1Var->Limit, false);
 }
 
-static void PreUpdate_PNP1(act)
-Analog_32_action *act;
+static void PreUpdate_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -890,8 +874,7 @@ Analog_32_action *act;
 			   Vpin2 - VPin1 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Update_PNP1(act)
-Analog_32_action *act;
+static void Update_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -903,8 +886,7 @@ Analog_32_action *act;
   PNP1Var->Limit = PNP1Var->NewLimit;
 }
 
-static void Display_PNP1(act)
-Analog_32_action *act;
+static void Display_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -918,8 +900,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_PNP1(act)
-Analog_32_action *act;
+static void Refresh_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -929,8 +910,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PNP1Var->Limit, false);
 }
 
-static void Erase_PNP1(act)
-Analog_32_action *act;
+static void Erase_PNP1(Analog_32_action *act)
 {
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
@@ -946,8 +926,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PNP1_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PNP1_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pnp2.c b/src/ana/pnp2.c
index 5108204..b19665f 100644
--- a/src/ana/pnp2.c
+++ b/src/ana/pnp2.c
@@ -62,9 +62,7 @@ typedef struct ICPNP2 {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -115,8 +113,7 @@ int Limitflag, Erase;
 
 
 
-static void Ex_PNP2(act)
-Analog_32_action *act;
+static void Ex_PNP2(Analog_32_action *act)
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
 	 dI3dV1, dI3dV2, dI3dV3;
@@ -290,8 +287,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_PNP2(act)
-Analog_32_action *act;
+static void Iin_PNP2(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -406,8 +402,7 @@ Analog_32_action *act;
   }
 }  /*Iin_PNP2*/
 
-static void GetCnf_PNP2(NewIC)
-ICPNP2 *NewIC;
+static void GetCnf_PNP2(ICPNP2 *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -505,8 +500,7 @@ ICPNP2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PNP2(act)
-Analog_32_action *act;
+static void initlib_PNP2(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPNP2 *NewIC;
@@ -545,9 +539,7 @@ Analog_32_action *act;
 #define MAKE_IECO(n)	((n)->IECO=(n)->Is/(n)->betaR)
 
 
-static int PNP2check(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int PNP2check(log_grec *Inst, long Attrnum)
 {
   int Result;
   PNP2Const *PNP2Var;
@@ -653,8 +645,7 @@ long Attrnum;
 }
 
 
-static void Attr_PNP2(act)
-Analog_32_action *act;
+static void Attr_PNP2(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -671,8 +662,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_PNP2(act)
-Analog_32_action *act;
+static void Newgate_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -734,8 +724,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-static void Copygate_PNP2(act)
-Analog_32_action *act;
+static void Copygate_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var, *Old_PNP2var;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -751,8 +740,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_PNP2(act)
-Analog_32_action *act;
+static void Dispose_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -763,8 +751,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_PNP2(act)
-Analog_32_action *act;
+static void Readgate_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -827,8 +814,7 @@ Analog_32_action *act;
   PNP2Var->TauCbe = 0.0;
 }
 
-static void Probe_PNP2(act)
-Analog_32_action *act;
+static void Probe_PNP2(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
@@ -891,8 +877,7 @@ Analog_32_action *act;
   }
 }
 
-static void Reset_PNP2(act)
-Analog_32_action *act;
+static void Reset_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -907,8 +892,7 @@ Analog_32_action *act;
     Limitfill(act->inst, PNP2Var->Limit, false);
 }
 
-static void PreUpdate_PNP2(act)
-Analog_32_action *act;
+static void PreUpdate_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -929,8 +913,7 @@ Analog_32_action *act;
 			   Vpin2 - VPin1 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-static void Update_PNP2(act)
-Analog_32_action *act;
+static void Update_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -942,8 +925,7 @@ Analog_32_action *act;
   PNP2Var->Limit = PNP2Var->NewLimit;
 }
 
-static void Display_PNP2(act)
-Analog_32_action *act;
+static void Display_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -957,8 +939,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_PNP2(act)
-Analog_32_action *act;
+static void Refresh_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -968,8 +949,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PNP2Var->Limit, false);
 }
 
-static void Erase_PNP2(act)
-Analog_32_action *act;
+static void Erase_PNP2(Analog_32_action *act)
 {
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
@@ -985,8 +965,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PNP2_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PNP2_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/pspc1.c b/src/ana/pspc1.c
index 9d4a1c1..a203405 100644
--- a/src/ana/pspc1.c
+++ b/src/ana/pspc1.c
@@ -42,7 +42,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* From input file "swiss.text" */
 
 
-#include <utils/p2c.h>
+#include "utils/p2c.h"
+#include "graphics/mylib.h"
 #include "ana/pspc1.h"
 #include "node.h"
 
@@ -84,13 +85,26 @@ typedef struct ICPfet {
 	 InitCgb, InitCdb, InitCsb, InitEarly, InitW, InitL, InitNumber;
 } ICPfet;
 
+void drawnum3(short x, short y, short n)
+{
+  char s[4];
+
+  m_move((long)x, (long)y);
+  strcpy(s, "   ");
+  m_displaytext(s);
+  if (n >= 100)
+  {
+      s[0] = n/100 + '0';
+      s[1] = (n%100)/10 + '0';
+  } else if (n >= 10 )
+    s[1] = n / 10 + '0';
+  s[2] = n % 10 + '0';
+  m_displaytext(s);
+}
 
-static void Show_W_L(Inst,erase)
-log_grec *Inst;
-int erase;
+static void Show_W_L(log_grec *Inst, int erase)
 {
   short Lx, Ly, Wx, Wy;
-  void drawnum3();
   long oldWx,oldWy,oldLx,oldLy;
   int W,L;
   float scale;
@@ -174,8 +188,7 @@ int erase;
 /****************************************************************************/
 
 
-static void Ex_PSPC1(act)
-Analog_32_action *act;
+static void Ex_PSPC1(Analog_32_action *act)
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4,
          MinI3, dI3dV1, dI3dV2, dI3dV3, dI3dV4,
@@ -392,8 +405,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-static void Iin_PSPC1(act)
-Analog_32_action *act;
+static void Iin_PSPC1(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
   double VPin1, VPin2, VPin3, VPin4, VMem1, VMem2, VMem3;
@@ -514,8 +526,7 @@ Analog_32_action *act;
 }  /*Iin_Pspc1*/
 
 
-static void GetCnf_Pspc1(NewIC)
-ICPfet *NewIC;
+static void GetCnf_Pspc1(ICPfet *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -643,8 +654,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PSPC1(act)
-Analog_32_action *act;
+static void initlib_PSPC1(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPfet *NewIC;
@@ -684,9 +694,7 @@ Analog_32_action *act;
 }  /*PSPC1_Initlib*/
 
 
-static int Pfetcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Pfetcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   PfetConst *PfetVar;
@@ -819,8 +827,7 @@ long Attrnum;
 }
 
 
-static void Attr_Pspc1(act)
-Analog_32_action *act;
+static void Attr_Pspc1(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -847,8 +854,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Pspc1(act)
-Analog_32_action *act;
+static void Newgate_Pspc1(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -921,8 +927,7 @@ Analog_32_action *act;
   WITH->attr[N_Number - 1].changed = true;
 }
 
-static void Copygate_Pspc1(act)
-Analog_32_action *act;
+static void Copygate_Pspc1(Analog_32_action *act)
 {
   PfetConst *PfetVar, *Old_Pfetvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -936,8 +941,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-static void Dispose_Pspc1(act)
-Analog_32_action *act;
+static void Dispose_Pspc1(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -948,8 +952,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Pspc1(act)
-Analog_32_action *act;
+static void Readgate_Pspc1(Analog_32_action *act)
 {
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
@@ -1030,8 +1033,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-static void Probe_Pspc1(act)
-Analog_32_action *act;
+static void Probe_Pspc1(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -1116,8 +1118,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PSPC1_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PSPC1_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1216,11 +1217,3 @@ Analog_32_action *act;
 #undef N_L
 #undef N_Number
 #undef Gatename
-
-
-
-
-
-
-
-
diff --git a/src/ana/pwl.c b/src/ana/pwl.c
index f7c19d9..6ba9bfd 100644
--- a/src/ana/pwl.c
+++ b/src/ana/pwl.c
@@ -129,10 +129,7 @@ typedef struct ICPWL {
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-char Limitflag;
-int Erase;
+static void Limitfill(log_grec *Inst, char Limitflag, int Erase)
 {
   Anainstlist *A_Gate;
   PWLConst *PWLVar;
@@ -193,9 +190,7 @@ int Erase;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void locate (x, n, v, j)
-double  x[], v;
-int     n, *j;
+static void locate (double x[], int n, double v, int *j)
 {
         int ascnd,ju,jm,jl;
 
@@ -214,10 +209,7 @@ int     n, *j;
 }
 
 
-static void interp (v, j, PWLVar, i, didv)
-  double        v, *i, *didv;
-  int           j;
-  PWLConst	*PWLVar;
+static void interp (double v, int j, PWLConst *PWLVar, double *i, double *didv)
 {
   double        s;
 
@@ -245,8 +237,7 @@ static void interp (v, j, PWLVar, i, didv)
 }
 
 
-static void Ex_PWL(act)
-Analog_32_action *act;
+static void Ex_PWL(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
   AnaExt_rec *Pin1Ptr;
@@ -320,8 +311,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_PWL(act)
-Analog_32_action *act;
+static void Iin_PWL(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1;
@@ -385,10 +375,11 @@ Analog_32_action *act;
 }  /*Iin_PWL*/
 
 
-static void findcircle (x1, y1, x2, y2, x3, y3, rd,
-                       xc, yc, xl, xr, sd, ml, mr, bl, br)
-  double        x1, y1, x2, y2, x3, y3, *rd;
-  double        *xc, *yc, *xl, *xr, *sd, *ml, *mr, *bl, *br;
+static void findcircle (double x1, double y1, double x2, double y2,
+			double x3, double y3, double *rd,
+			double *xc, double *yc, double *xl,
+			double *xr, double *sd, double *ml,
+			double *mr, double *bl, double *br)
 {
   double        r;
   double        pxl, pyl, pxr, pyr;
@@ -451,10 +442,7 @@ retry:
 }
 
 
-static void pwl2c (x, y, n, radius, PWLVar)
-  double        x[], y[], radius;
-  int           n;
-  PWLConst      *PWLVar;
+static void pwl2c (double x[], double y[], int n, double radius, PWLConst *PWLVar)
 {
   double        r[MAX_PWL-2];
   double        xc[MAX_PWL-2], yc[MAX_PWL-2], xl[MAX_PWL-2], xr[MAX_PWL-2];
@@ -498,8 +486,7 @@ static void pwl2c (x, y, n, radius, PWLVar)
 }
 
 
-static char CheckPWLFile (datafile)
-  FILE		*datafile;
+static char CheckPWLFile (FILE *datafile)
 {
   int		n;
   double        x[MAX_PWL], y[MAX_PWL];
@@ -524,10 +511,7 @@ static char CheckPWLFile (datafile)
 }
 
 
-static void LoadPWLVar (PWLVar, datafileName, radius)
-  PWLConst	*PWLVar;
-  char		*datafileName;
-  double	radius;
+static void LoadPWLVar (PWLConst *PWLVar, char *datafileName, double radius)
 {
   double        x[MAX_PWL], y[MAX_PWL];
   int           n;
@@ -554,8 +538,7 @@ static void LoadPWLVar (PWLVar, datafileName, radius)
 }
 
 
-static void GetCnf_PWL(NewIC)
-ICPWL *NewIC;
+static void GetCnf_PWL(ICPWL *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -609,8 +592,7 @@ ICPWL *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_PWL(act)
-Analog_32_action *act;
+static void initlib_PWL(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICPWL *NewIC;
@@ -637,9 +619,7 @@ Analog_32_action *act;
 
 
 
-static int PWLcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int PWLcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   PWLConst *PWLVar;
@@ -682,8 +662,7 @@ long Attrnum;
 }
 
 
-static void Attr_PWL(act)
-Analog_32_action *act;
+static void Attr_PWL(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -695,8 +674,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_PWL(act)
-Analog_32_action *act;
+static void Newgate_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -735,8 +713,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_PWL(act)
-Analog_32_action *act;
+static void Copygate_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar, *Old_PWLvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -752,8 +729,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_PWL(act)
-Analog_32_action *act;
+static void Dispose_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -764,8 +740,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_PWL(act)
-Analog_32_action *act;
+static void Readgate_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -781,8 +756,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_PWL(act)
-Analog_32_action *act;
+static void Probe_PWL(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
@@ -837,8 +811,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_PWL(act)
-Analog_32_action *act;
+static void Reset_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -854,8 +827,7 @@ Analog_32_action *act;
 }
 
 
-static void PreUpdate_PWL(act)
-Analog_32_action *act;
+static void PreUpdate_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -880,8 +852,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_PWL(act)
-Analog_32_action *act;
+static void Update_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -894,8 +865,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_PWL(act)
-Analog_32_action *act;
+static void Display_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -909,8 +879,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_PWL(act)
-Analog_32_action *act;
+static void Refresh_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -920,8 +889,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PWLVar->Limit, false);
 }
 
-static void Erase_PWL(act)
-Analog_32_action *act;
+static void Erase_PWL(Analog_32_action *act)
 {
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
@@ -937,8 +905,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_PWL_INITLIB_32(act)
-Analog_32_action *act;
+void Log_PWL_INITLIB_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -1029,7 +996,3 @@ Analog_32_action *act;
 
 #undef Cstart
 #undef Gatename
-
-
-
-
diff --git a/src/ana/resfloat.c b/src/ana/resfloat.c
index d798d16..84bf90d 100644
--- a/src/ana/resfloat.c
+++ b/src/ana/resfloat.c
@@ -53,8 +53,7 @@ typedef struct ICResfloat {
 /****************************************************************************/
 
 
-static void Ex_Resfloat(act)
-Analog_32_action *act;
+static void Ex_Resfloat(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
   AnaExt_rec *Pin1Ptr;
@@ -106,8 +105,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Resfloat(act)
-Analog_32_action *act;
+static void Iin_Resfloat(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1;
@@ -146,8 +144,7 @@ Analog_32_action *act;
 }  /*Iin_Resfloat*/
 
 
-static void GetCnf_Resfloat(NewIC)
-ICResfloat *NewIC;
+static void GetCnf_Resfloat(ICResfloat *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -175,8 +172,7 @@ ICResfloat *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Resfloat(act)
-Analog_32_action *act;
+static void initlib_Resfloat(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICResfloat *NewIC;
@@ -200,9 +196,7 @@ Analog_32_action *act;
 
 
 
-static int Resfloatcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Resfloatcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   ResfloatConst *ResfloatVar;
@@ -225,8 +219,7 @@ long Attrnum;
 }
 
 
-static void Attr_Resfloat(act)
-Analog_32_action *act;
+static void Attr_Resfloat(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -238,8 +231,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Resfloat(act)
-Analog_32_action *act;
+static void Newgate_Resfloat(Analog_32_action *act)
 {
   ResfloatConst *ResfloatVar;
   Anainstlist *A_Gate;
@@ -260,8 +252,7 @@ Analog_32_action *act;
   WITH->attr[N_Res - 1].changed = true;
 }
 
-static void Copygate_Resfloat(act)
-Analog_32_action *act;
+static void Copygate_Resfloat(Analog_32_action *act)
 {
   ResfloatConst *ResfloatVar, *Old_Resfloatvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -277,8 +268,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_Resfloat(act)
-Analog_32_action *act;
+static void Dispose_Resfloat(Analog_32_action *act)
 {
   ResfloatConst *ResfloatVar;
   Anainstlist *A_Gate;
@@ -289,8 +279,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Resfloat(act)
-Analog_32_action *act;
+static void Readgate_Resfloat(Analog_32_action *act)
 {
   ResfloatConst *ResfloatVar;
   Anainstlist *A_Gate;
@@ -304,8 +293,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_Resfloat(act)
-Analog_32_action *act;
+static void Probe_Resfloat(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
@@ -365,8 +353,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_resfloat_initlib_32(act)
-Analog_32_action *act;
+void Log_resfloat_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -441,8 +428,3 @@ Analog_32_action *act;
 #undef N_Res
 #undef Cstart
 #undef Gatename
-
-
-
-
-
diff --git a/src/ana/rtd.c b/src/ana/rtd.c
index 7b21a28..fff2fbc 100644
--- a/src/ana/rtd.c
+++ b/src/ana/rtd.c
@@ -120,8 +120,7 @@ typedef struct ICRTD {
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static double SafeExp (x)
-double	x;
+static double SafeExp (double x)
 {
   if (x < -700.0)
     return (0.0);
@@ -131,8 +130,7 @@ double	x;
     return (exp (x));
 }
 
-static void Ex_RTD(act)
-Analog_32_action *act;
+static void Ex_RTD(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
   AnaExt_rec *Pin1Ptr;
@@ -281,8 +279,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_RTD(act)
-Analog_32_action *act;
+static void Iin_RTD(Analog_32_action *act)
 {
 	AnaExt_rec *Pin1Ptr;
 	double VPin1;
@@ -431,8 +428,7 @@ Analog_32_action *act;
 }  /*Iin_RTD*/
 
 
-static void GetCnf_RTD(NewIC)
-ICRTD *NewIC;
+static void GetCnf_RTD(ICRTD *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -555,8 +551,7 @@ ICRTD *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_RTD(act)
-Analog_32_action *act;
+static void initlib_RTD(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICRTD *NewIC;
@@ -592,9 +587,7 @@ Analog_32_action *act;
 
 
 
-static int RTDcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int RTDcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   RTDConst *RTDVar;
@@ -718,8 +711,7 @@ long Attrnum;
 }
 
 
-static void Attr_RTD(act)
-Analog_32_action *act;
+static void Attr_RTD(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -731,8 +723,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_RTD(act)
-Analog_32_action *act;
+static void Newgate_RTD(Analog_32_action *act)
 {
   RTDConst *RTDVar;
   Anainstlist *A_Gate;
@@ -788,8 +779,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_RTD(act)
-Analog_32_action *act;
+static void Copygate_RTD(Analog_32_action *act)
 {
   RTDConst *RTDVar, *Old_RTDvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -805,8 +795,7 @@ Analog_32_action *act;
   AnaCapCopy(act->inst);
 }
 
-static void Dispose_RTD(act)
-Analog_32_action *act;
+static void Dispose_RTD(Analog_32_action *act)
 {
   RTDConst *RTDVar;
   Anainstlist *A_Gate;
@@ -817,8 +806,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_RTD(act)
-Analog_32_action *act;
+static void Readgate_RTD(Analog_32_action *act)
 {
   RTDConst *RTDVar;
   Anainstlist *A_Gate;
@@ -855,8 +843,7 @@ Analog_32_action *act;
 }
 
 
-static void Probe_RTD(act)
-Analog_32_action *act;
+static void Probe_RTD(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
@@ -916,8 +903,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-void Log_rtd_initlib_32(act)
-Analog_32_action *act;
+void Log_rtd_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
diff --git a/src/ana/runspec.c b/src/ana/runspec.c
index cfecb5b..ac392ff 100644
--- a/src/ana/runspec.c
+++ b/src/ana/runspec.c
@@ -49,8 +49,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-static void initlib_Runspec(act)
-Analog_32_action *act;
+static void initlib_Runspec(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
 
@@ -64,8 +63,7 @@ Analog_32_action *act;
 }  /*NFET4_Initlib*/
 
 
-static void Reload_Runspec(act)
-Analog_32_action *act;
+static void Reload_Runspec(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -102,8 +100,7 @@ Analog_32_action *act;
 
 }
 
-static void Attr_Runspec(act)
-Analog_32_action *act;
+static void Attr_Runspec(Analog_32_action *act)
 {
   long Attrnum;
   log_grec *WITH;
@@ -215,16 +212,14 @@ Analog_32_action *act;
   }
 }
 
-static void Openconfig_Runspec(act)
-Analog_32_action *act;
+static void Openconfig_Runspec(Analog_32_action *act)
 {
   if (!act->ok)
     return;
   Reload_Runspec(act);
 }
 
-void Readgate_Runspec(act)
-Analog_32_action *act;
+void Readgate_Runspec(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -243,8 +238,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Runspec(act)
-Analog_32_action *act;
+static void Newgate_Runspec(Analog_32_action *act)
 {
   Analog_32_action Newact;
 
@@ -260,8 +254,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Runspec                          */
 /*==========================================================================*/
 
-void Log_RUNSPEC_initlib_32(act)
-Analog_32_action *act;
+void Log_RUNSPEC_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
@@ -301,5 +294,3 @@ Analog_32_action *act;
 #undef N_P_Na
 #undef N_P_Mu
 #undef N_P_Qss
-
-
diff --git a/src/ana/stairs.c b/src/ana/stairs.c
index c46abd5..e4679aa 100644
--- a/src/ana/stairs.c
+++ b/src/ana/stairs.c
@@ -68,9 +68,7 @@ typedef struct ICStairs {
 
 
 
-static void Switchfill(Inst, Erase)
-log_grec *Inst;
-int Erase;
+static void Switchfill(log_grec *Inst, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -93,9 +91,7 @@ int Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -120,10 +116,7 @@ int Limitflag, Erase;
 
 
 
-static double Stairmaker(Inst, Ftime, First)
-log_grec *Inst;
-double Ftime;
-int First;
+static double Stairmaker(log_grec *Inst, double Ftime, int First)
 {
   double Result;
   int Found;
@@ -177,8 +170,7 @@ int First;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-static void Ex_Stairs(act)
-Analog_32_action *act;
+static void Ex_Stairs(Analog_32_action *act)
 {
   	/*Stairserent*/
   	double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -244,8 +236,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-static void Iin_Stairs(act)
-Analog_32_action *act;
+static void Iin_Stairs(Analog_32_action *act)
 {
   	/*Stairserent*/
   	AnaExt_rec *Pin1Ptr, *Pin2Ptr;
@@ -311,8 +302,7 @@ Analog_32_action *act;
   	}
 }  /*Iin_Stairs*/
 
-static void GetCnf_Stairs(NewIC)
-ICStairs *NewIC;
+static void GetCnf_Stairs(ICStairs *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -397,8 +387,7 @@ ICStairs *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-static void initlib_Stairs(act)
-Analog_32_action *act;
+static void initlib_Stairs(Analog_32_action *act)
 {
   /*Stairserent*/
   AnaCell_rec *NewCell;
@@ -430,9 +419,7 @@ Analog_32_action *act;
 }  /*Stairs_Initlib*/
 
 
-static int Stairscheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int Stairscheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   StairsConst *StairsVar;
@@ -491,8 +478,7 @@ long Attrnum;
 
 
 
-static void Attr_Stairs(act)
-Analog_32_action *act;
+static void Attr_Stairs(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -504,8 +490,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Stairs(act)
-Analog_32_action *act;
+static void Newgate_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -545,8 +530,7 @@ Analog_32_action *act;
   }
 }
 
-static void Copygate_Stairs(act)
-Analog_32_action *act;
+static void Copygate_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar, *Old_Stairsvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -561,8 +545,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_Stairs(act)
-Analog_32_action *act;
+static void Dispose_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -573,8 +556,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-static void Readgate_Stairs(act)
-Analog_32_action *act;
+static void Readgate_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -606,8 +588,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = (*STR1 == 'T' || *STR1 == 't');
 }
 
-static void Writegate_Stairs(act)
-Analog_32_action *act;
+static void Writegate_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -630,8 +611,7 @@ Analog_32_action *act;
 
 
 
-static void Reset_Stairs(act)
-Analog_32_action *act;
+static void Reset_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -651,8 +631,7 @@ Analog_32_action *act;
   }
 }
 
-static void Set_Stairs(act)
-Analog_32_action *act;
+static void Set_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -664,8 +643,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = act->inst->attr[N_Freeze - 1].UU.b;
 }
 
-static void Clear_Stairs(act)
-Analog_32_action *act;
+static void Clear_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -681,8 +659,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = ICptr->ICFreeze;
 }
 
-static void PreUpdate_Stairs(act)
-Analog_32_action *act;
+static void PreUpdate_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -700,8 +677,7 @@ Analog_32_action *act;
   StairsVar->NewLimit = (fabs(VPin1 - VPin2 - StairsVar->Videal) > 0.1);
 }
 
-static void Update_Stairs(act)
-Analog_32_action *act;
+static void Update_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -717,8 +693,7 @@ Analog_32_action *act;
     StairsVar->Timez += AnaDtlast;
 }
 
-static void Display_Stairs(act)
-Analog_32_action *act;
+static void Display_Stairs(Analog_32_action *act)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -750,8 +725,7 @@ Analog_32_action *act;
 }
 
 
-static void Touch_Stairs(act)
-Analog_32_action *act;
+static void Touch_Stairs(Analog_32_action *act)
 {
   log_action_t *WITH;
   log_grec *WITH1;
@@ -767,8 +741,7 @@ Analog_32_action *act;
 }
 
 
-static void Erase_Stairs(Inst)
-log_grec *Inst;
+static void Erase_Stairs(log_grec *Inst)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -779,8 +752,7 @@ log_grec *Inst;
   Limitfill(Inst, StairsVar->Limit, true);
 }
 
-static void Refresh_Stairs(Inst)
-log_grec *Inst;
+static void Refresh_Stairs(log_grec *Inst)
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
@@ -791,8 +763,7 @@ log_grec *Inst;
   Limitfill(Inst, StairsVar->Limit, false);
 }
 
-static void Probe_Stairs(act)
-Analog_32_action *act;
+static void Probe_Stairs(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   StairsConst *StairsVar;
@@ -840,8 +811,7 @@ $End$*/
 /*=============================================================================*/
 
 
-void Log_stairs_initlib_32(act)
-Analog_32_action *act;
+void Log_stairs_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
 
@@ -951,9 +921,3 @@ Analog_32_action *act;
 #undef N_tRdelay
 #undef Cstart
 #undef Gatename
-
-
-
-
-
-
diff --git a/src/ana/tc.c b/src/ana/tc.c
index 3f5237b..d58c3bd 100644
--- a/src/ana/tc.c
+++ b/src/ana/tc.c
@@ -131,9 +131,7 @@ static long AmpRange;
 /****************************************************************************/
 
 
-static void Limitfill(Inst, Limitflag, Erase)
-log_grec *Inst;
-int Limitflag, Erase;
+static void Limitfill(log_grec *Inst, int Limitflag, int Erase)
 {
   short LLx, LLy, URx, URy;
 
@@ -161,8 +159,7 @@ int Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-static void GetCnf_TCAmp(NewIC)
-ICTCAmp *NewIC;
+static void GetCnf_TCAmp(ICTCAmp *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -301,8 +298,7 @@ ICTCAmp *NewIC;
 }
 
 
-static void INITLIB_TCAMP(act)
-Analog_32_action *act;
+static void INITLIB_TCAMP(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICTCAmp *NewIC;
@@ -376,9 +372,7 @@ Analog_32_action *act;
       TimeTooSmall=1e-60;*/
 
 
-static int TCAmpcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+static int TCAmpcheck(log_grec *Inst, long Attrnum)
 {
   int Result;
   TCAmpConst *TCAmpVar;
@@ -484,8 +478,7 @@ long Attrnum;
 }
 
 
-static void Attr_TCAmp(act)
-Analog_32_action *act;
+static void Attr_TCAmp(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -502,8 +495,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_TCAmp(act)
-Analog_32_action *act;
+static void Newgate_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -599,8 +591,7 @@ Analog_32_action *act;
 }
 
 
-static void Copygate_TCAmp(act)
-Analog_32_action *act;
+static void Copygate_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar, *Old_TCAmpvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -615,8 +606,7 @@ Analog_32_action *act;
 }
 
 
-static void Dispose_TCAmp(act)
-Analog_32_action *act;
+static void Dispose_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -628,8 +618,7 @@ Analog_32_action *act;
 }
 
 
-static void Readgate_TCAmp(act)
-Analog_32_action *act;
+static void Readgate_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -725,8 +714,7 @@ Analog_32_action *act;
 }
 
 
-static void Reset_TCAmp(act)
-Analog_32_action *act;
+static void Reset_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -742,8 +730,7 @@ Analog_32_action *act;
 }
 
 
-static void PreUpdate_TCAmp(act)
-Analog_32_action *act;
+static void PreUpdate_TCAmp(Analog_32_action *act)
 {
   	TCAmpConst *TCAmpVar;
   	Anainstlist *A_Gate;
@@ -790,8 +777,7 @@ Analog_32_action *act;
 }
 
 
-static void Update_TCAmp(act)
-Analog_32_action *act;
+static void Update_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -804,8 +790,7 @@ Analog_32_action *act;
 }
 
 
-static void Display_TCAmp(act)
-Analog_32_action *act;
+static void Display_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -819,8 +804,7 @@ Analog_32_action *act;
 }
 
 
-static void Refresh_TCAmp(act)
-Analog_32_action *act;
+static void Refresh_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -832,8 +816,7 @@ Analog_32_action *act;
 
 
 
-static void Erase_TCAmp(act)
-Analog_32_action *act;
+static void Erase_TCAmp(Analog_32_action *act)
 {
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
@@ -845,8 +828,7 @@ Analog_32_action *act;
 
 
 
-static void Probe_TCAmp(act)
-Analog_32_action *act;
+static void Probe_TCAmp(Analog_32_action *act)
 {
   	Anainstlist *A_Gate;
   	AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
@@ -1005,8 +987,7 @@ Analog_32_action *act;
 }
 
 
-void Ex_TCAmp(act)
-Analog_32_action *act;
+void Ex_TCAmp(Analog_32_action *act)
 {
   double MinI1, dI1dV1, dI1dV2, dI1dV3, dI1dV4, MinI2, dI2dV1, dI2dV2, dI2dV3,
 	 dI2dV4, MinI3, dI3dV1, dI3dV2, dI3dV3, dI3dV4, MinI4, dI4dV1, dI4dV2,
@@ -1569,8 +1550,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-void Iin_TCAmp(act)
-Analog_32_action *act;
+void Iin_TCAmp(Analog_32_action *act)
 {
   	AnaExt_rec *Pin1Ptr;
   	double VPin1, VMem1;
@@ -1819,8 +1799,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-static void TC_System(act)
-Analog_32_action *act;
+static void TC_System(Analog_32_action *act)
 {
 
 
@@ -1916,8 +1895,7 @@ Analog_32_action *act;
 }
 
 
-void Ex_Abs(act)
-Analog_32_action *act;
+void Ex_Abs(Analog_32_action *act)
 {
   double MinI1, dI1dV1, dI1dV2, dI1dV3, dI1dV4, MinI2, dI2dV1, dI2dV2, dI2dV3,
 	 dI2dV4, MinI3, dI3dV1, dI3dV2, dI3dV3, dI3dV4, MinI4, dI4dV1, dI4dV2,
@@ -2313,8 +2291,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-void Iin_Abs(act)
-Analog_32_action *act;
+void Iin_Abs(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -2489,8 +2466,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-static void Abs_System(act)
-Analog_32_action *act;
+static void Abs_System(Analog_32_action *act)
 {
 
 
@@ -2587,32 +2563,28 @@ Analog_32_action *act;
 }
 
 
-void Log_opamp_initlib_32(act)
-Analog_32_action *act;
+void Log_opamp_initlib_32(Analog_32_action *act)
 {
   AmpRange = Normal;
   TC_System(act);
 }
 
 
-void Log_wramp_initlib_32(act)
-Analog_32_action *act;
+void Log_wramp_initlib_32(Analog_32_action *act)
 {
   AmpRange = Wide;
   TC_System(act);
 }
 
 
-void Log_hwr_initlib_32(act)
-Analog_32_action *act;
+void Log_hwr_initlib_32(Analog_32_action *act)
 {
   AmpRange = Hwr;
   Abs_System(act);
 }
 
 
-void Log_fwr_initlib_32(act)
-Analog_32_action *act;
+void Log_fwr_initlib_32(Analog_32_action *act)
 {
   AmpRange = Fwr;
   Abs_System(act);
diff --git a/src/ana/thermal.c b/src/ana/thermal.c
index 2962006..4122f7d 100644
--- a/src/ana/thermal.c
+++ b/src/ana/thermal.c
@@ -55,8 +55,7 @@ typedef struct ICThermal {
 
 
 
-static void GetCnf_Thermal(NewIC)
-ICThermal *NewIC;
+static void GetCnf_Thermal(ICThermal *NewIC)
 {
   int Found;
   char Arg[256], Keyword[256];
@@ -101,8 +100,7 @@ ICThermal *NewIC;
 /****************************************************************************/
 
 
-static void initlib_Thermal(act)
-Analog_32_action *act;
+static void initlib_Thermal(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICThermal *NewIC;
@@ -120,8 +118,7 @@ Analog_32_action *act;
   act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
-static void Refresh_Thermal(act)
-Analog_32_action *act;
+static void Refresh_Thermal(Analog_32_action *act)
 {
   short Tx, Ty;
   Anainstlist *A_Gate;
@@ -169,8 +166,7 @@ Analog_32_action *act;
 }
 
 
-static void Erase_Thermal(act)
-Analog_32_action *act;
+static void Erase_Thermal(Analog_32_action *act)
 {
   short Tx, Ty;
   Anainstlist *A_Gate;
@@ -192,8 +188,7 @@ Analog_32_action *act;
 
 
 
-static void Attr_Thermal(act)
-Analog_32_action *act;
+static void Attr_Thermal(Analog_32_action *act)
 {
   long Attrnum;
   log_grec *WITH;
@@ -287,8 +282,7 @@ Analog_32_action *act;
   }
 }
 
-static void Openconfig_Thermal(act)
-Analog_32_action *act;
+static void Openconfig_Thermal(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -306,8 +300,7 @@ Analog_32_action *act;
   WITH->attr[N_Celsius - 1].changed = true;
 }
 
-static void Readgate_Thermal(act)
-Analog_32_action *act;
+static void Readgate_Thermal(Analog_32_action *act)
 {
   log_grec *WITH;
 
@@ -320,8 +313,7 @@ Analog_32_action *act;
 }
 
 
-static void Newgate_Thermal(act)
-Analog_32_action *act;
+static void Newgate_Thermal(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaCell_rec *Cellptr;
@@ -371,8 +363,7 @@ Analog_32_action *act;
     }
 }
 
-static void Copygate_Thermal(act)
-Analog_32_action *act;
+static void Copygate_Thermal(Analog_32_action *act)
 {
   ThermalConst *ThermalVar, *Old_ThermalVar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -385,8 +376,7 @@ Analog_32_action *act;
   A_Gate->InstVar = (void *)ThermalVar;
 }
 
-static void Dispose_Thermal(act)
-Analog_32_action *act;
+static void Dispose_Thermal(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   ThermalConst *ThermalVar;
@@ -402,8 +392,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Thermal                    */
 /*==========================================================================*/
 
-void Log_THERMAL_initlib_32(act)
-Analog_32_action *act;
+void Log_THERMAL_initlib_32(Analog_32_action *act)
 {
   /*Body of procedure*/
 
diff --git a/src/diggates.c b/src/diggates.c
index 42d3e23..ffd69ef 100644
--- a/src/diggates.c
+++ b/src/diggates.c
@@ -618,9 +618,9 @@ void Log_mygates_ascdisp(log_16_action *act_)
 
 		case act_16_new:
 			(*WITH1->hook.getcolor)("CRT", &crtcolor, log_green);
-			m_seefont(&savef);
-			m_seefont(&crtfont);
-			m_setfont(savef);
+			// m_seefont(&savef);
+			// m_seefont(&crtfont);
+			// m_setfont(savef);
 			V.dip = (dispinfo *)Malloc(sizeof(dispinfo));
 			WITH2->info = (void *)V.dip;
 			cleardisp(&V);
@@ -679,7 +679,7 @@ void Log_mygates_ascdisp(log_16_action *act_)
 
 #define map             "1234567890-=qwertyuiop[]asdfghjkl;'\015zxcvbnm,./ \b            "
 #define map_s           "!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:\"\015ZXCVBNM<>? \177            "
-/* p2c: diggates.text, line 569: 
+/* p2c: diggates.text, line 569:
  * Warning: Multi-element string constructors not yet supported [136] */
 #define map_c           "12345\036789\0\037\036\021\027\005\022\024\031\025\t\017\020\033\035\001\023\004\006\007\b\n\013\f~`\015"
 
@@ -754,6 +754,3 @@ void Log_mygates_asckbd(log_16_action *act)
 #undef map
 #undef map_s
 #undef map_c
-
-
-
diff --git a/src/graphics/mylib.c b/src/graphics/mylib.c
index 0070194..08b7b0d 100644
--- a/src/graphics/mylib.c
+++ b/src/graphics/mylib.c
@@ -127,19 +127,6 @@ int nc_initialized;
 #define DefaultFont      "6x10"
 #endif
 
-
-/* Added for command line display specification. - stafford 7/17/91 */
-#define       DISPLAY_NAME_LENGTH 100
-char  m_display_name[DISPLAY_NAME_LENGTH] = "";
-
-/* Added flag for window pop-up mode -- jl */
-
-int m_autoraise = false;
-
-Display *m_display;
-Window m_window;
-int screennum;
-int BlackAndWhite = False;
 int m_events_received;
 
 /*int m_across, m_down, m_maxcolor;*/
@@ -184,100 +171,6 @@ static struct cursor {
   int xoff, yoff, w, h;
 } cursors[4];
 
-#define AllColors DoRed | DoGreen | DoBlue
-XColor m_colors[ColorSets+1][ColorsInSet] = {
-  {
-    { 0,     0,     0,     0, AllColors, 0 },
-    { 0, 65535,     0,     0, AllColors, 0 },
-    { 0,     0, 65535,     0, AllColors, 0 },
-    { 0, 65535, 65535,     0, AllColors, 0 },
-    { 0,     0,     0, 65535, AllColors, 0 },
-    { 0, 65535,     0, 65535, AllColors, 0 },
-    { 0,     0, 65535, 65535, AllColors, 0 },
-    { 0, 65535, 65535, 65535, AllColors, 0 },
-    { 0, 52428, 52428, 52428, AllColors, 0 },
-    { 0, 34952,     0,     0, AllColors, 0 },
-    { 0,     0, 34952,     0, AllColors, 0 },
-    { 0, 34952, 34952,     0, AllColors, 0 },
-    { 0,     0,     0, 34952, AllColors, 0 },
-    { 0, 34952,     0, 34952, AllColors, 0 },
-    { 0,     0, 34952, 34952, AllColors, 0 },
-    { 0, 44952, 44952, 44952, AllColors, 0 },
-  },
-  {
-    { 0,     0,     0,     0, AllColors, 0 },
-    { 0, 52428,     0,     0, AllColors, 0 },
-    { 0,     0, 52428,     0, AllColors, 0 },
-    { 0, 52428, 52428,     0, AllColors, 0 },
-    { 0,     0,     0, 52428, AllColors, 0 },
-    { 0, 52428,     0, 52428, AllColors, 0 },
-    { 0,     0, 52428, 52428, AllColors, 0 },
-    { 0, 65535, 65535, 65535, AllColors, 0 },
-    { 0, 52428, 52428, 26214, AllColors, 0 },
-    { 0, 21845, 39321, 34952, AllColors, 0 },
-    { 0, 34952, 30583, 43690, AllColors, 0 },
-    { 0, 43690, 21845, 30583, AllColors, 0 },
-    { 0, 52428, 26214, 21845, AllColors, 0 },
-    { 0, 65535, 39321,  8738, AllColors, 0 },
-    { 0, 48059, 34952, 26214, AllColors, 0 },
-    { 0, 44952, 44952, 44952, AllColors, 0 },
-  },
-  {
-    { 0,     0,     0,     0, AllColors, 0 },
-    { 0,  4369,  4369,  4369, AllColors, 0 },
-    { 0,  8738,  8738,  8738, AllColors, 0 },
-    { 0, 13107, 13107, 13107, AllColors, 0 },
-    { 0, 17496, 17496, 17496, AllColors, 0 },
-    { 0, 21845, 21845, 21845, AllColors, 0 },
-    { 0, 26214, 26214, 26214, AllColors, 0 },
-    { 0, 30583, 30583, 30583, AllColors, 0 },
-    { 0, 34952, 34952, 34952, AllColors, 0 },
-    { 0, 39321, 39321, 39321, AllColors, 0 },
-    { 0, 43690, 43690, 43690, AllColors, 0 },
-    { 0, 48059, 48059, 48059, AllColors, 0 },
-    { 0, 52428, 52428, 52428, AllColors, 0 },
-    { 0, 56797, 56797, 56797, AllColors, 0 },
-    { 0, 61166, 61166, 61166, AllColors, 0 },
-    { 0, 65535, 65535, 65535, AllColors, 0 },
-  },
-  {
-    { 0,     0,     0,     0, AllColors, 0 },
-    { 0, 26214, 26214, 26214, AllColors, 0 },
-    { 0, 43690, 43690, 43690, AllColors, 0 },
-    { 0, 65535, 65535, 65535, AllColors, 0 },
-    { 0, 21845,     0,     0, AllColors, 0 },
-    { 0, 34952,     0,     0, AllColors, 0 },
-    { 0, 48059,     0,     0, AllColors, 0 },
-    { 0, 65535,     0,     0, AllColors, 0 },
-    { 0,     0, 21845,     0, AllColors, 0 },
-    { 0,     0, 34952,     0, AllColors, 0 },
-    { 0,     0, 48059,     0, AllColors, 0 },
-    { 0,     0, 65535,     0, AllColors, 0 },
-    { 0,     0,     0, 21845, AllColors, 0 },
-    { 0,     0,     0, 34952, AllColors, 0 },
-    { 0,     0,     0, 48059, AllColors, 0 },
-    { 0,     0,     0, 65535, AllColors, 0 },
-  },
-  {
-    { 0,     0,     0,     0, AllColors, 0 },
-    { 0, 65535,     0,     0, AllColors, 0 },
-    { 0,     0, 65535,     0, AllColors, 0 },
-    { 0, 65535, 65535,     0, AllColors, 0 },
-    { 0,     0,     0, 65535, AllColors, 0 },
-    { 0, 65535,     0, 65535, AllColors, 0 },
-    { 0,     0, 65535, 65535, AllColors, 0 },
-    { 0, 65535, 65535, 65535, AllColors, 0 },
-    { 0, 52428, 52428, 52428, AllColors, 0 },
-    { 0, 34952,     0,     0, AllColors, 0 },
-    { 0,     0, 34952,     0, AllColors, 0 },
-    { 0, 34952, 34952,     0, AllColors, 0 },
-    { 0,     0,     0, 34952, AllColors, 0 },
-    { 0, 34952,     0, 34952, AllColors, 0 },
-    { 0,     0, 34952, 34952, AllColors, 0 },
-    { 0, 44952, 44952, 44952, AllColors, 0 },
-  },
-};
-
 static long WindowEventMask = ExposureMask | KeyPressMask |
                               ButtonPressMask | ButtonReleaseMask |
                               PointerMotionMask | StructureNotifyMask |
@@ -329,8 +222,7 @@ static XSizeHints WinSizeHints = {
 
 static char *progname = "mylib";
 
-void GeneralTransform(x, y)
-int *x, *y;
+void GeneralTransform(int *x, int *y)
 {
   int newx, newy;
 
@@ -341,8 +233,7 @@ int *x, *y;
   *y = newy;
 }
 
-void DeltaTransform(x, y)
-int *x, *y;
+void DeltaTransform(int *x, int *y)
 {
   int newx, newy;
 
@@ -353,8 +244,7 @@ int *x, *y;
   *y = newy;
 }
 
-void LimitedTransform(x, y)
-int *x, *y;
+void LimitedTransform(int *x, int *y)
 {
   int newx, newy;
 
@@ -365,8 +255,7 @@ int *x, *y;
   *y = newy;
 }
 
-void GeneralUnTransform(x, y)
-int *x, *y;
+void GeneralUnTransform(int *x, int *y)
 {
   int x1, y1, newx, newy, det;
 
@@ -381,8 +270,7 @@ int *x, *y;
   *y = newy;
 }
 
-void m_cache(newstate)
-int newstate;
+void m_cache(int newstate)
 {
   if (!newstate && !nocache) {
     Ffprintf(stderr, "XFlush()\n");
@@ -391,8 +279,7 @@ int newstate;
   nocache = !newstate;
 }
 
-void m_choosecolors(colorset)
-int colorset;
+void m_choosecolors(int colorset)
 {
   int i;
 
@@ -532,17 +419,17 @@ void DisplayInitialize()
 */
          for(j = 0; j < visual_table_len; j++) { visual_table[j] = -1; }
          for(j = 0; j < gritems_list; j++) {
-           if((grvisual_get[j].class == 0) && (grvisual_get[j].depth == 8))
+           if((grvisual_get[j].c_class == 0) && (grvisual_get[j].depth == 8))
              visual_table[1] = j;              /* StaticGrey */
-           if((grvisual_get[j].class == 1) && (grvisual_get[j].depth == 8))
+           if((grvisual_get[j].c_class == 1) && (grvisual_get[j].depth == 8))
              visual_table[2] = j;              /* GreyScale */
-           if((grvisual_get[j].class == 3) && (grvisual_get[j].depth == 8))
+           if((grvisual_get[j].c_class == 3) && (grvisual_get[j].depth == 8))
              visual_table[3] = j;              /* Psuedocolor */
-           if((grvisual_get[j].class == 4) && (grvisual_get[j].depth == 15))
+           if((grvisual_get[j].c_class == 4) && (grvisual_get[j].depth == 15))
              visual_table[4] = j;              /* TrueColor */
-           if((grvisual_get[j].class == 4) && (grvisual_get[j].depth == 16))
+           if((grvisual_get[j].c_class == 4) && (grvisual_get[j].depth == 16))
              visual_table[5] = j;              /* TrueColor */
-           if((grvisual_get[j].class == 4) && (grvisual_get[j].depth == 24))
+           if((grvisual_get[j].c_class == 4) && (grvisual_get[j].depth == 24))
              visual_table[6] = j;              /* TrueColor */
          }
          log_color = getenv("LOG_COLOR");
@@ -586,7 +473,7 @@ printf("log_color: %s visual_table: %d %d %d %d %d %d %d\n", log_color, visual_t
            printf("Using %s, depth %d\n", visual_type[grvisual_get[gritems].class],
             grvisual_get[gritems].depth); }
 #endif  /* HIRESDB */
-           grclass         = grvisual_get[gritems].class;
+           grclass         = grvisual_get[gritems].c_class;
            grvisual        = grvisual_get[gritems].visual;
            grcolorCount    = grvisual_get[gritems].colormap_size;
            grCurrent.depth = grvisual_get[gritems].depth;
@@ -1142,8 +1029,7 @@ static unsigned char lo_dashed[LINESTIPPLELENGTH] = {7, 1, 7, 1};
 
 static unsigned char *default_linestyle[ColorsInSet];
 
-static unsigned char *FigureOutBWLine(r, g, b)
-     int r, g, b;
+static unsigned char *FigureOutBWLine(int r, int g, int b)
 {
   /* This is just a matter of taste */
 
@@ -1161,8 +1047,7 @@ static unsigned char *FigureOutBWLine(r, g, b)
 }
 
 
-static void do_init_screen(full)
-int full;
+static void do_init_screen(int full)
 {
   Window root;
   int i, x, y;
@@ -1331,8 +1216,7 @@ int full;
 /* Added X display name support.  WES 7/17/91 */
 
 
-void m_set_display_name(display_name)
-char* display_name;
+void m_set_display_name(char* display_name)
 {
   Mfprintf(stderr, "m_set_display_name(\"%s\")\n", display_name);
 
@@ -1370,8 +1254,7 @@ void m_init_colors()
   m_choosecolors(0);
 }
 
-void m_init_pen(hpib_address)
-int hpib_address;
+void m_init_pen(int hpib_address)
 {
   Mfprintf(stderr, "m_init_pen(%d)\n", hpib_address);
 }
@@ -1385,8 +1268,7 @@ int hpib_address;
 static XPoint pointbuf[16][BUF_SIZE];
 static int pointbuf_size[16];
 
-static void buffer_point(color, x, y)
-int color, x, y;
+static void buffer_point(int color, int x, int y)
 {
   pointbuf[color][pointbuf_size[color]].x = x;
   pointbuf[color][pointbuf_size[color]].y = y;
@@ -1414,8 +1296,7 @@ static void flush_points()
 static XSegment linebuf[16][BUF_SIZE];
 static int linebuf_size[16];
 
-static void buffer_line(color, x1, y1, x2, y2)
-int color, x1, y1, x2, y2;
+static void buffer_line(int color, int x1, int y1, int x2, int y2)
 {
   linebuf[color][linebuf_size[color]].x1 = x1;
   linebuf[color][linebuf_size[color]].y1 = y1;
@@ -1445,8 +1326,7 @@ static void flush_lines()
 static XRectangle rectbuf[16][BUF_SIZE];
 static int rectbuf_size[16];
 
-static void buffer_rect(color, x, y, width, height)
-int color, x, y, width, height;
+static void buffer_rect(int color, int x, int y, int width, int height)
 {
   rectbuf[color][rectbuf_size[color]].x = x;
   rectbuf[color][rectbuf_size[color]].y = y;
@@ -1476,8 +1356,7 @@ static void flush_rects()
 static XRectangle fillrectbuf[16][BUF_SIZE];
 static int fillrectbuf_size[16];
 
-static void buffer_fillrect(color, x, y, width, height)
-int color, x, y, width, height;
+static void buffer_fillrect(int color, int x, int y, int width, int height)
 {
   fillrectbuf[color][fillrectbuf_size[color]].x = x;
   fillrectbuf[color][fillrectbuf_size[color]].y = y;
@@ -1531,8 +1410,7 @@ void m_clear()
 
 int m_clip_x1, m_clip_y1, m_clip_x2, m_clip_y2;
 
-void m_clip(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+void m_clip(int x1, int y1, int x2, int y2)
 {
   XRectangle rect;
   int i;
@@ -1618,8 +1496,7 @@ void m_noclip()
   }
 }
 
-void m_transform(xx, yx, xy, yy, d, ax, ay)
-int xx, yx, xy, yy, d, ax, ay;
+void m_transform(int xx, int yx, int xy, int yy, int d, int ax, int ay)
 {
   flip = 0;
   trans = 1;
@@ -1652,9 +1529,7 @@ void m_upside_down()
   trans = 0;
 }
 
-void m_rotscale(rot, scale, ax, ay)
-double rot, scale;
-int ax, ay;
+void m_rotscale(double rot, double scale, int ax, int ay)
 {
   int s, c;
 
@@ -1666,9 +1541,7 @@ int ax, ay;
   m_transform(c, -s, -s, -c, 256, ax, m_down-ay);
 }
 
-void m_rotscaled(rot, scale, ax, ay)
-double rot, scale;
-int ax, ay;
+void m_rotscaled(double rot, double scale, int ax, int ay)
 {
   Mfprintf(stderr, "m_rotscaled(%f, %f, %d, %d)\n", rot, scale, ax, ay);
 
@@ -1736,8 +1609,7 @@ void m_nocursor()
 
 static m_tablet_info mouse;
 
-void m_cursor(x, y)
-int x, y;
+void m_cursor(int x, int y)
 {
   Mfprintf(stderr, "m_cursor(%d, %d)\n", x, y);
 /*  fprintf(stderr, "m_cursor(%d, %d)\n", x, y);  */
@@ -1783,8 +1655,7 @@ static struct {
   { XC_gobbler, m_yellow },
 };
 
-void m_choosecursor(n)
-int n;
+void m_choosecursor(int n)
 {
 /*  Cursor newcursor; */
 
@@ -1818,8 +1689,7 @@ int n;
   }
 }
 
-void m_colormode(c)
-int c;
+void m_colormode(int c)
 {
   int i;
 
@@ -1927,8 +1797,7 @@ int c;
   }
 }
 
-void m_color(newcolor)
-int newcolor;
+void m_color(int newcolor)
 {
   Mfprintf(stderr, "m_color(%d)\n", newcolor);
 
@@ -1957,8 +1826,7 @@ long m_curcolormode()
   return(currentmode);
 }
 
-void m_setcolor(c, r, g, b)
-int c, r, g, b;
+void m_setcolor(int c, int r, int g, int b)
 {
 
   unsigned char *d;
@@ -2032,8 +1900,7 @@ int c, r, g, b;
 
 
 
-void m_seecolor(c, r, g, b)
-int c, *r, *g, *b;
+void m_seecolor(int c, int *r, int *g, int *b)
 {
   Mfprintf(stderr, "m_seecolor(%d)\n", c);
 
@@ -2045,8 +1912,7 @@ int c, *r, *g, *b;
     *r = *g = *b = 0;
 }
 
-void m_setcolors(r, g, b)
-m_colorarray r, g, b;
+void m_setcolors(m_colorarray r, m_colorarray g, m_colorarray b)
 {
   int i;
   unsigned char *d;
@@ -2111,8 +1977,7 @@ m_colorarray r, g, b;
 #endif  /* HIRES */
 }
 
-void m_seecolors(r, g, b)
-m_colorarray r, g, b;
+void m_seecolors(m_colorarray r, m_colorarray g, m_colorarray b)
 {
   int i;
 
@@ -2125,9 +1990,7 @@ m_colorarray r, g, b;
   }
 }
 
-void m_vsetcolors(first, num, r, g, b)
-int first, num;
-m_vcolorarray r, g, b;
+void m_vsetcolors(int first, int num, m_vcolorarray r, m_vcolorarray g, m_vcolorarray b)
 {
   int i;
   unsigned char *d;
@@ -2202,9 +2065,7 @@ m_vcolorarray r, g, b;
 #endif  /* HIRES */
 }
 
-void m_vseecolors(first, num, r, g, b)
-int first, num;
-m_colorarray r, g, b;
+void m_vseecolors(int first, int num, m_colorarray r, m_colorarray g, m_colorarray b)
 {
   int i;
 
@@ -2238,8 +2099,7 @@ static int linestyles[16] = {
 static int currentlinestyle = 0;
 static int linewidth = 0;
 
-void m_linestyle(s)
-int s;
+void m_linestyle(int s)
 {
   int st, i, j, onoff, firstisoff = 0;
   char dashlist[16];
@@ -2346,8 +2206,7 @@ int s;
   }
 }
 
-void m_setlinestyle(s, mask)
-int s, mask;
+void m_setlinestyle(int s, int mask)
 {
   Mfprintf(stderr, "m_setlinestyle(%d, %d)\n", s, mask);
 
@@ -2363,8 +2222,7 @@ int s, mask;
 
 static int curx = 0, cury = 0;
 
-void m_move(x, y)
-int x, y;
+void m_move(int x, int y)
 {
   Mfprintf(stderr, "m_move(%d, %d)\n", x, y);
 
@@ -2375,8 +2233,7 @@ int x, y;
 }
 
 
-int hitdet_line(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+int hitdet_line(int x1, int y1, int x2, int y2)
 {
   int oc1 = 0, oc2 = 0;
   int val;
@@ -2446,8 +2303,7 @@ int x1, y1, x2, y2;
   return 0;  /* should never occur */
 }
 
-void m_draw(x, y)
-int x, y;
+void m_draw(int x, int y)
 {
   Mfprintf(stderr, "m_draw(%d, %d)\n", x, y);
 
@@ -2485,8 +2341,7 @@ int x, y;
   }
 }
 
-void m_drawrel(dx, dy)
-int dx, dy;
+void m_drawrel(int dx, int dy)
 {
   Mfprintf(stderr, "m_drawrel(%d, %d)\n", dx, dy);
 
@@ -2524,8 +2379,7 @@ int dx, dy;
   }
 }
 
-void m_move2(x, y)
-int x, y;
+void m_move2(int x, int y)
 {
   Mfprintf(stderr, "m_move2(%d, %d)\n", x, y);
 
@@ -2535,8 +2389,7 @@ int x, y;
   cury = y;
 }
 
-void m_drawline(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+void m_drawline(int x1, int y1, int x2, int y2)
 {
   Mfprintf(stderr, "m_drawline(%d, %d, %d, %d)\n", x1, y1, x2, y2);
 
@@ -2576,8 +2429,7 @@ int x1, y1, x2, y2;
   }
 }
 
-int hitdet_drawrect(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+int hitdet_drawrect(int x1, int y1, int x2, int y2)
 {
   if (((x1 >= m_clip_x1 && x1 <= m_clip_x2) ||
        (x2 >= m_clip_x1 && x2 <= m_clip_x2)) &&
@@ -2592,8 +2444,7 @@ int x1, y1, x2, y2;
   return 0;
 }
 
-void m_drawrect(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+void m_drawrect(int x1, int y1, int x2, int y2)
 {
   int x, y;
 
@@ -2652,8 +2503,7 @@ int x1, y1, x2, y2;
   }
 }
 
-int hitdet_fillrect(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+int hitdet_fillrect(int x1, int y1, int x2, int y2)
 {
   return ((x1 >= m_clip_x1 || x2 >= m_clip_x1) &&
 	  (x1 <= m_clip_x2 || x2 <= m_clip_x2) &&
@@ -2661,8 +2511,7 @@ int x1, y1, x2, y2;
 	  (y1 <= m_clip_y2 || y2 <= m_clip_y2));
 }
 
-void m_fillrect(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+void m_fillrect(int x1, int y1, int x2, int y2)
 {
   int x, y;
 
@@ -2723,8 +2572,7 @@ int x1, y1, x2, y2;
 
 
 
-void m_grid(x1, y1, x2, y2, dx, dy, ax, ay)
-int x1, y1, x2, y2, dx, dy, ax, ay;
+void m_grid(int x1, int y1, int x2, int y2, int dx, int dy, int ax, int ay)
 {
   struct grid *swapgrid;
   int x, y, wid, hei, i, j;
@@ -2897,15 +2745,13 @@ int x1, y1, x2, y2, dx, dy, ax, ay;
   }
 }
 
-int hitdet_point(x, y)
-int x, y;
+int hitdet_point(int x, int y)
 {
   return (x >= m_clip_x1 && x <= m_clip_x2 &&
 	  y >= m_clip_y1 && y <= m_clip_y2);
 }
 
-void m_drawpoint(x, y)
-int x, y;
+void m_drawpoint(int x, int y)
 {
   TRNSFRM(x, y);
 
@@ -2939,8 +2785,7 @@ int x, y;
   }
 }
 
-int hitdet_ellipse(x, y, rx, ry, filled)
-int x, y, rx, ry, filled;
+int hitdet_ellipse(int x, int y, int rx, int ry, int filled)
 {
   int clp_x1 = m_clip_x1, clp_x2 = m_clip_x2;
   int clp_y1 = m_clip_y1, clp_y2 = m_clip_y2;
@@ -3014,8 +2859,7 @@ int x, y, rx, ry, filled;
   }
 }
 
-void m_circle(x, y, r)
-int x, y, r;
+void m_circle(int x, int y, int r)
 {
   Mfprintf(stderr, "m_circle(%d, %d, %d)\n", x, y, r);
 
@@ -3046,8 +2890,7 @@ int x, y, r;
   }
 }
 
-void m_ellipse(x, y, rx, ry, c)
-int x, y, rx, ry, c;
+void m_ellipse(int x, int y, int rx, int ry, int c)
 {
   Mfprintf(stderr, "m_ellipse(%d, %d, %d, %d, %d)\n", x, y, rx, ry, c);
 
@@ -3086,8 +2929,7 @@ int x, y, rx, ry, c;
   }
 }
 
-void m_ellipse2(x, y, rx, ry, c1, c2)
-int x, y, rx, ry, c1, c2;
+void m_ellipse2(int x, int y, int rx, int ry, int c1, int c2)
 {
   Mfprintf(stderr, "m_ellipse2(%d, %d, %d, %d, %d, %d)\n", x, y, rx, ry, c1, c2);
 
@@ -3126,10 +2968,7 @@ int x, y, rx, ry, c1, c2;
   }
 }
 
-void m_drawarc(x, y, rx, ry, theta1, theta2, rotate, chord)
-long x, y, rx, ry;
-double theta1, theta2, rotate;
-long chord;
+void m_drawarc(long x, long y, long rx, long ry, double theta1, double theta2, double rotate, long chord)
 {
   double a, c1, s1, c2, s2, c3, s3, rc, rs, d, th1, th2, start, stop,
   rcc1, rcs1, rsc1, rss1, rcc2, rcs2, rsc2, rss2, temp;
@@ -3288,10 +3127,7 @@ long chord;
 
 typedef long pts[506];
 
-void m_fillarc(x, y, rx, ry, theta1, theta2, rotate, chord)
-long x, y, rx, ry;
-double theta1, theta2, rotate;
-long chord;
+void m_fillarc(long x, long y, long rx, long ry, double theta1, double theta2, double rotate, long chord)
 {
   pts xp, yp;
   double ss, cc, rs, rc, rsx, rsy, rcx, rcy, th, temp;
@@ -3376,8 +3212,7 @@ long chord;
 #endif
 }
 
-void m_roundrect(x1, y1, x2, y2, rx, ry, c)
-int x1, y1, x2, y2, rx, ry, c;
+void m_roundrect(int x1, int y1, int x2, int y2, int rx, int ry, int c)
 {
   int x, y, wid, hei;
 
@@ -3426,8 +3261,7 @@ int x1, y1, x2, y2, rx, ry, c;
   }
 }
 
-void m_roundrect2(x1, y1, x2, y2, rx, ry, c1, c2)
-int x1, y1, x2, y2, rx, ry, c1, c2;
+void m_roundrect2(int x1, int y1, int x2, int y2, int rx, int ry, int c1, int c2)
 {
   int x, y, wid, hei;
 
@@ -3515,8 +3349,7 @@ int hitdet_bezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4
 			(x4+x3)>>1, (y4+y3)>>1, x4, y4));
 }
 
-void dobezier(x1, y1, x2, y2, x3, y3, x4, y4, fx, fy)
-int x1, y1, x2, y2, x3, y3, x4, y4, fx, fy;
+void dobezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int fx, int fy)
 {
   if ((abs((y4-y3)*(x3-x1)-(y3-y1)*(x4-x3)) < bezthresh) &&
       (abs((y4-y2)*(x2-x1)-(y2-y1)*(x4-x2)) < bezthresh)) {
@@ -3536,8 +3369,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4, fx, fy;
   }
 }
 
-void m_bezier(x1, y1, x2, y2, x3, y3, x4, y4)
-int x1, y1, x2, y2, x3, y3, x4, y4;
+void m_bezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 {
   Mfprintf(stderr, "m_bezier(%d, %d, %d, %d, %d, %d, %d, %d)\n",
                              x1, y1, x2, y2, x3, y3, x4, y4   );
@@ -3574,8 +3406,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4;
   }
 }
 
-void m_bezier2(x1, y1, x2, y2, x3, y3, x4, y4, thresh)
-int x1, y1, x2, y2, x3, y3, x4, y4, thresh;
+void m_bezier2(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int thresh)
 {
   Mfprintf(stderr, "m_bezier2(%d, %d, %d, %d, %d, %d, %d, %d, %d)\n",
                               x1, y1, x2, y2, x3, y3, x4, y4, thresh);
@@ -3613,8 +3444,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4, thresh;
   }
 }
 
-void m_cbezier(x1, y1, x2, y2, x3, y3, x4, y4, thresh)
-int x1, y1, x2, y2, x3, y3, x4, y4, thresh;
+void m_cbezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int thresh)
 {
   Mfprintf(stderr, "m_cbezier(%d, %d, %d, %d, %d, %d, %d, %d, %d)\n",
                               x1, y1, x2, y2, x3, y3, x4, y4, thresh);
@@ -3671,11 +3501,9 @@ struct LOC_polycurve {
     int meef;
 } ;
 
-static void polycurve_doit(x0, y0, x1, y1, x2, y2,
-                           x3, y3, x4, y4, x5, y5,
-                           LINK_polycurve)
-long x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
-struct LOC_polycurve *LINK_polycurve;
+static void polycurve_doit(long x0, long y0, long x1, long y1, long x2, long y2,
+                           long x3, long y3, long x4, long y4, long x5, long y5,
+                           struct LOC_polycurve *LINK_polycurve)
 {
     if (((x4 < 0) ? -x4 : x4) + ((x5 < 0) ? -x5 : x5) + ((y4 < 0) ? -y4 : y4) + ((y5
         < 0) ? -y5 : y5) < SCALE) {
@@ -3710,8 +3538,7 @@ struct LOC_polycurve *LINK_polycurve;
 		   LINK_polycurve);
 }
 
-void m_polycurve(x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5)
-double x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
+void m_polycurve(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double x5, double y5)
 {
     struct LOC_polycurve V_polycurve;
 
@@ -3732,9 +3559,7 @@ double x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
 		   &V_polycurve);
 }
 
-int hitdet_drawpoly(n, points)
-int n;
-XPoint *points;
+int hitdet_drawpoly(int n, XPoint *points)
 {
   int i;
 
@@ -3748,8 +3573,7 @@ XPoint *points;
   return 0;
 }
 
-void m_drawpoly(n, x, y)
-int n, x[], y[];
+void m_drawpoly(int n, int x[], int y[])
 {
   XPoint *pointlist;
   int i, newx, newy;
@@ -3807,9 +3631,7 @@ int n, x[], y[];
    entirely outside polygon.  Thus, we can simply check if any one point
    in the rectangle is in the polygon. */
 
-int hitdet_fillpoly(n, points)
-int n;
-XPoint *points;
+int hitdet_fillpoly(int n, XPoint *points)
 {
   int i, y1, y2, count;
   XPoint *pt1, *pt2;
@@ -3964,8 +3786,7 @@ int n, x[], y[];
 #endif
 
 
-void m_fillpoly(n, x, y)
-int n, x[], y[];
+void m_fillpoly(int n, int x[], int y[])
 {
   XPoint *pointlist;
   int i, newx, newy;
@@ -4008,8 +3829,7 @@ int n, x[], y[];
   }
 }
 
-void m_displaytext(str)
-char *str;
+void m_displaytext(char *str)
 {
   int dir, desc, len;
   XCharStruct size;
@@ -4086,9 +3906,7 @@ void m_drawstr(int x, int y, char *f, char *str)
   }
 }
 
-void m_centerstr(x, y, f, str)
-int x, y;
-char *f, *str;
+void m_centerstr(int x, int y, char *f, char *str)
 {
   int dir, desc, len;
   XCharStruct size;
@@ -4127,9 +3945,7 @@ char *f, *str;
   }
 }
 
-void m_rightstr(x, y, f, str)
-int x, y;
-char *f, *str;
+void m_rightstr(int x, int y, char *f, char *str)
 {
   int dir, desc, len;
   XCharStruct size;
@@ -4168,8 +3984,7 @@ char *f, *str;
   }
 }
 
-long m_strwidth(f, str)      /* daveg, 10/6/89 */
-char *f, *str;
+long m_strwidth(char *f, char *str)      /* daveg, 10/6/89 */
 {
   Mfprintf(stderr, "m_strwidth(f, %s)\n", str);
 
@@ -4224,8 +4039,7 @@ void m_alpha_on()
 }
 
 
-void m_readpen(pen)
-m_tablet_info *pen;
+void m_readpen(m_tablet_info *pen)
 {
   XEvent event;
   int newx, newy;
@@ -4312,8 +4126,7 @@ m_tablet_info *pen;
   mouse.near_ = pen->near_;
 }
 
-void m_trackpen(pen)
-m_tablet_info *pen;
+void m_trackpen(m_tablet_info *pen)
 {
   Pfprintf(stderr, "m_trackpen(pen)\n");
 
@@ -4323,8 +4136,7 @@ m_tablet_info *pen;
   m_cursor(pen->x, pen->y);
 }
 
-void m_trackpen2(pen)
-m_tablet_info *pen;
+void m_trackpen2(m_tablet_info *pen)
 {
   XEvent event;
   int found = 0;
@@ -4455,8 +4267,7 @@ m_tablet_info *pen;
 }
 
 
-void m_waitpen(pen)
-m_tablet_info *pen;
+void m_waitpen(m_tablet_info *pen)
 {
   XEvent event;
   int x, y;
@@ -4700,8 +4511,7 @@ uchar m_testkey()
 #define popuph          70
 
 
-int m_yes_or_no(prompt)
-char *prompt;
+int m_yes_or_no(char *prompt)
 {
   Window root, popup, yesbutton, nobutton;
   char buf[10];
@@ -4900,4 +4710,3 @@ char *prompt;
   XDestroyWindow(m_display, popup);
   return(return_value);
 }
-
diff --git a/src/graphics/newci.c b/src/graphics/newci.c
index 33ae09f..126e7b9 100644
--- a/src/graphics/newci.c
+++ b/src/graphics/newci.c
@@ -4,8 +4,8 @@
 #include <ctype.h>
 
 /* UNIX specific */
-#include <sys/types.h> 
-#include <sys/wait.h> 
+#include <sys/types.h>
+#include <sys/wait.h>
 
 #include <time.h>
 
@@ -67,9 +67,9 @@ static void goodfixname(char *name, char *ext, char *home, int force)
 
 	if (name[i] == ':')
 		return;
-	
+
 	hassuffix = false;
-	
+
 	len = strlen(name);
 	for (i = 0; i < len; ++i)
 	{
@@ -89,7 +89,7 @@ static void goodfixname(char *name, char *ext, char *home, int force)
 
 	if (!hassuffix && *ext != '\0')
 	{
-		name = realloc(name, sizeof(char) * (len + strlen(ext) + 2)); /* name + '.' + ext + '\0' */
+		name = (char *) realloc(name, sizeof(char) * (len + strlen(ext) + 2)); /* name + '.' + ext + '\0' */
 		sprintf(name + strlen(name), ".%s", ext);
 	}
 }
@@ -150,7 +150,7 @@ void newci_parseswitch(newci_parserec* tab, size_t size, char *bad)
 	for (size_t i = 0; i < size; ++i)
 		tab[i].used = 0;
 	*bad = '\000';
-  
+
 	/* still args and arg start with '-' */
 	while (P_argc > 1 && P_argv[1][0] == '-')
 	{
@@ -160,7 +160,7 @@ void newci_parseswitch(newci_parserec* tab, size_t size, char *bad)
 		{
     		for (size_t j = 0; tab[i].switch_[j] != '\0' && !found; j++)
 			{
-				if (tab[i].switch_[j] == P_argv[1][1]) 
+				if (tab[i].switch_[j] == P_argv[1][1])
 					found = 1;
 			}
 		}
@@ -174,7 +174,7 @@ void newci_parseswitch(newci_parserec* tab, size_t size, char *bad)
 		else
 		{
 			tab[i].used = pos++;
-			
+
 			switch (toupper(tab[i].kind))
 			{
 				case 'B': /* boolean */
diff --git a/src/graphics/newcrt.c b/src/graphics/newcrt.c
index d33f121..2b3e7c3 100644
--- a/src/graphics/newcrt.c
+++ b/src/graphics/newcrt.c
@@ -1,5 +1,5 @@
 /* As the name suggests, this is probably a CRT emulator */
-/* Should be rewritten with ncurses, at least. */ 
+/* Should be rewritten with ncurses, at least. */
 #define NEWCRT_G
 #define HIRES
 
@@ -114,7 +114,6 @@ nc_windowRec *nc_lastLineWindow = &__nc_mainWindow;
 nc_windowRec *nc_statusWindow = &__nc_mainWindow;
 nc_windowRec *nc_defaultWindow = &__nc_mainWindow;
 
-XColor m_colors[ColorSets+1][ColorsInSet];    /*   From mylib   */
 static int colortrans[8] = {
 	m_green, m_yellow, m_black, m_red, m_cyan, m_white, m_blue, m_purple,
 };
diff --git a/src/log.c b/src/log.c
index 06a4c66..e3f69a1 100644
--- a/src/log.c
+++ b/src/log.c
@@ -38,25 +38,25 @@
 #include <string.h>
 
 
-#include <utils/p2c.h>
+#include "utils/p2c.h"
 
 #include "logdef.h"
-#include <utils/sysglobals.h>
-#include <utils/sysdevs.h>
+#include "utils/sysglobals.h"
+#include "utils/sysdevs.h"
 
-#include <utils/misc.h>
+#include "utils/misc.h"
 #include "help.h"
-#include <graphics/newci.h>
-#include <utils/filepack.h>
-#include <utils/iodecl.h>
-#include <graphics/mylib.h>
+#include "graphics/newci.h"
+#include "utils/filepack.h"
+#include "utils/iodecl.h"
+#include "graphics/mylib.h"
 #include "logfont.h"
 #include "logstuff.h"
 #include "swap.h"
-#include <graphics/newkbd.h>
-#include <utils/strings.h>
-#include <utils/newasm.h>
-#include <graphics/newcrt.h>
+#include "graphics/newkbd.h"
+#include "utils/strings.h"
+#include "utils/newasm.h"
+#include "graphics/newcrt.h"
 
 #include "settings.h"
 #include "logstructs.h"
@@ -76,8 +76,6 @@
 
 #include "configreader.h"
 
-char *GetChipmunkPath();
-
 enum cursors;
 enum cursors cursortype;
 enum cursors oldcursortype;
@@ -441,8 +439,8 @@ void strwordx(char *buf, char *wrd)
 	char *str1;
 	char *str2;
 
-	str1 = malloc(strlen(buf) + 1);
-	str2 = malloc(strlen(buf) + 1);
+	str1 = (char*) malloc(strlen(buf) + 1);
+	str2 = (char*) malloc(strlen(buf) + 1);
 	strcpy(str1, strltrim(strrtrim(strcpy(str2, buf))));
 	strcpy(buf, str1);
 	free(str1);
@@ -6764,7 +6762,7 @@ static void gatedefinitioncommand()
 static librstrrec *findlibrstr(char *name_)
 {
 	size_t name_length = strlen(name_);
-	char *name = malloc(sizeof(char) * name_length);
+	char *name = (char*) malloc(sizeof(char) * name_length);
 
 	librstrrec *lsp = librstrs;
 	strreverse(name, name_);
@@ -14313,5 +14311,3 @@ int main(int argc, char * argv[])
 		fclose(tracefile);
 	exit(0);
 }
-
-
diff --git a/src/logdef.c b/src/logdef.c
deleted file mode 100644
index 34694bc..0000000
--- a/src/logdef.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* "LOG", the circuit editing and simulation system,
-   "DigLOG", the digital simulator for LOG.
-   Copyright (C) 1985, 1990 David Gillespie.
-   Author's address: daveg@csvax.caltech.edu; 256-80 Caltech/Pasadena CA 91125.
-
-   "AnaLOG", the analog simulator for LOG.
-   Copyright (C) 1985, 1990 John Lazzaro.
-   Author's address: lazzaro@csvax.caltech.edu; 256-80 Caltech.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation (any version).
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-/*
-
-      LOG 4.1   Simulation interface module
-
-      David Gillespie  7/14/88
-
-      The following module is subject to change at any time.
-*/
-
-
-#include <utils/p2c.h>
-
-
-#define LOGDEF_G
-#include "logdef.h"
-
-
-const log_rottab log_rotxx = {
-  1, 0, -1, 0, -1, 0, 1, 0
-};
-
-const log_rottab log_rotxy = {
-  0, -1, 0, 1, 0, 1, 0, -1
-};
-
-const log_rottab log_rotyx = {
-  0, 1, 0, -1, 0, 1, 0, -1
-};
-
-const log_rottab log_rotyy = {
-  1, 0, -1, 0, 1, 0, -1, 0
-};
-
-const log_rottab log_irotxx = {
-  1, 0, -1, 0, -1, 0, 1, 0
-};
-
-const log_rottab log_irotxy = {
-  0, 1, 0, -1, 0, -1, 0, 1
-};
-
-const log_rottab log_irotyx = {
-  0, -1, 0, 1, 0, -1, 0, 1
-};
-
-const log_rottab log_irotyy = {
-  1, 0, -1, 0, 1, 0, -1, 0
-};
-
-const log_zoomtab zoomscales = {
-  2, 3, 5, 8, 12
-};
-
-
diff --git a/src/logdig.c b/src/logdig.c
index ef5a930..40e66dd 100644
--- a/src/logdig.c
+++ b/src/logdig.c
@@ -43,30 +43,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #include "logdig.h"
 
 
-const log_16_viarr log_16_vi = {
-  0, 1, 3
-};
-
-const log_16_ivarr log_16_iv = {
-  log_none, log_zero, log_one, log_one
-};
-
-const log_16_vbarr log_16_vb = {
-  false, false, true
-};
-
-const log_16_bvarr log_16_bv = {
-  log_zero, log_one
-};
 
 
 
 
 /* All the real stuff is in LOGSIM and LOGSIMA */
-
-
-
-
-
-
-
diff --git a/src/loghier.c b/src/loghier.c
index f888350..bfa0aa6 100644
--- a/src/loghier.c
+++ b/src/loghier.c
@@ -228,7 +228,7 @@ char *gateinstname(char *Result, log_grec *g)
 		(*lact->hook2->findattrnum)(g->kind, "inst-of", "CA", &attrinstof);
 		(*lact->hook2->findattrnum)(g->kind, "gate-name", "CA", &attrinstname);
 	}
-	
+
 	if (attrinstname > 0)
 		return strcpy(Result, g->attr[attrinstname - 1].UU.c);
 	else
@@ -348,7 +348,7 @@ void examinetemplate(log_grec *g, log_nrec **pp, long ppsize, int isgeneric, sho
 	xx1 = (kind->x1 + 1) / log_scale0;
 	xx2 = P_imax2((kind->x2 - 1L) / log_scale0, (long)xx1);
 	if (*pnum == NULL)
-		*pnum = Malloc(kind->numpins * 2);
+		*pnum = (short *) Malloc(kind->numpins * 2);
 
 	numrefs = (short *)Malloc(kind->numpins * 2);
 	FORLIM = kind->numpins;
@@ -653,4 +653,3 @@ void Log_7_ginst(log_action_t *act)
 			break;
 	}
 }
-
diff --git a/src/logntk.c b/src/logntk.c
index 5b97674..b819aa9 100644
--- a/src/logntk.c
+++ b/src/logntk.c
@@ -96,9 +96,7 @@ static char nodeprefix[11];
 
 
 
-static strlist_t *strlist_find_r(l1, wrd_)
-strlist_t *l1;
-char *wrd_;
+static strlist_t *strlist_find_r(strlist_t *l1, char *wrd_)
 {
   char wrd[256];
 
@@ -114,9 +112,7 @@ char *wrd_;
 
 
 
-static int tryreset(f, fn)
-FILE **f;
-char *fn;
+static int tryreset(FILE **f, char *fn)
 {
   strlist_t *l1;
   char buf[256];
@@ -162,9 +158,7 @@ struct LOC_Log_logntk_proc {
 } ;
 
 
-static void message(s_, LINK)
-char *s_;
-struct LOC_Log_logntk_proc *LINK;
+static void message(char *s_, struct LOC_Log_logntk_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -175,9 +169,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void emessage(s_, LINK)
-char *s_;
-struct LOC_Log_logntk_proc *LINK;
+static void emessage(char *s_, struct LOC_Log_logntk_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -189,9 +181,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void vmessage(s_, LINK)
-char *s_;
-struct LOC_Log_logntk_proc *LINK;
+static void vmessage(char *s_, struct LOC_Log_logntk_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -202,9 +192,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void addlabel(s_, LINK)
-char *s_;
-struct LOC_Log_logntk_proc *LINK;
+static void addlabel(char *s_, struct LOC_Log_logntk_proc *LINK)
 {
   char s[256];
   log_lrec *l1;
@@ -214,27 +202,19 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void getword(buf, w, LINK)
-char *buf, *w;
-struct LOC_Log_logntk_proc *LINK;
+static void getword(char *buf, char *w, struct LOC_Log_logntk_proc *LINK)
 {
   (*LINK->act->hook.getword)(buf, w);   /*converts to upper case*/
 }
 
 
-static void getint(buf, i, def, LINK)
-char *buf;
-long *i, def;
-struct LOC_Log_logntk_proc *LINK;
+static void getint(char *buf, long *i, long def, struct LOC_Log_logntk_proc *LINK)
 {
   (*LINK->act->hook.getint)(buf, i, def);
 }
 
 
-static void readstrlist(buf, l1, LINK)
-char *buf;
-strlist_t **l1;
-struct LOC_Log_logntk_proc *LINK;
+static void readstrlist(char *buf, strlist_t **l1, struct LOC_Log_logntk_proc *LINK)
 {
   strlist_t *l2;
   char arg[256];
@@ -247,10 +227,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void readstrlista(buf, l1, LINK)
-char *buf;
-strlist_t **l1;
-struct LOC_Log_logntk_proc *LINK;
+static void readstrlista(char *buf, strlist_t **l1, struct LOC_Log_logntk_proc *LINK)
 {
   strlist_t *l2;
   char arg[256];
@@ -265,11 +242,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void readstrlistr(buf, l1, named, LINK)
-char *buf;
-strlist_t **l1;
-int named;
-struct LOC_Log_logntk_proc *LINK;
+static void readstrlistr(char *buf, strlist_t **l1, int named, struct LOC_Log_logntk_proc *LINK)
 {
   strlist_t *l2;
   char arg[256], rex[256];
@@ -288,10 +261,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void addcell(c1, name, cname, fname, LINK)
-cellrec **c1;
-char *name, *cname, *fname;
-struct LOC_Log_logntk_proc *LINK;
+static void addcell(cellrec **c1, char *name, char *cname, char *fname, struct LOC_Log_logntk_proc *LINK)
 {
   *c1 = (cellrec *)Malloc(sizeof(cellrec));
   strcpy((*c1)->name, name);
@@ -305,10 +275,7 @@ struct LOC_Log_logntk_proc *LINK;
   cellbase = *c1;
 }
 
-static void docommand(buf1_, buf_, complain, LINK)
-char *buf1_, *buf_;
-int complain;
-struct LOC_Log_logntk_proc *LINK;
+static void docommand(char *buf1_, char *buf_, int complain, struct LOC_Log_logntk_proc *LINK)
 {
   char buf1[256], buf[256], buf2[256], buf3[256];
   cellrec *c1;
@@ -442,9 +409,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void namenode(n, LINK)
-log_nrec *n;
-struct LOC_Log_logntk_proc *LINK;
+static void namenode(log_nrec *n, struct LOC_Log_logntk_proc *LINK)
 {
   char buf[256], buf2[256];
   strlist_t *l1;
@@ -486,9 +451,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static int trynamegate(g, LINK)
-log_grec *g;
-struct LOC_Log_logntk_proc *LINK;
+static int trynamegate(log_grec *g, struct LOC_Log_logntk_proc *LINK)
 {
   char name[256];
 
@@ -505,9 +468,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void namecellgates(c, LINK)
-cellrec *c;
-struct LOC_Log_logntk_proc *LINK;
+static void namecellgates(cellrec *c, struct LOC_Log_logntk_proc *LINK)
 {
   log_grec *g;
   log_nrec **portlist;
@@ -539,9 +500,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void nameprimgates(p, LINK)
-primrec *p;
-struct LOC_Log_logntk_proc *LINK;
+static void nameprimgates(primrec *p, struct LOC_Log_logntk_proc *LINK)
 {
   char buf[256];
   log_grec *g;
@@ -557,7 +516,7 @@ struct LOC_Log_logntk_proc *LINK;
 	strcpy(buf, g->kind->name);
 	if (*p->cname != '\0') {
 	  pos = 1;
-	  re_replace(buf, p->name, p->cname, &pos, &last);
+	  re_replace(buf, p->name, p->cname, (size_t *) &pos, (size_t *) &last);
 	}
 	p->ccount++;
 	sprintf(STR3, "%s_%ld", buf, p->ccount);
@@ -572,10 +531,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void prolog(args_, bp, LINK)
-char *args_;
-log_brec *bp;
-struct LOC_Log_logntk_proc *LINK;
+static void prolog(char *args_, log_brec *bp, struct LOC_Log_logntk_proc *LINK)
 {
   char args[256];
   log_lrec *lb1;
@@ -761,8 +717,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void epilog(LINK)
-struct LOC_Log_logntk_proc *LINK;
+static void epilog(struct LOC_Log_logntk_proc *LINK)
 {
   cellrec *c;
   transrec *t;
@@ -824,9 +779,7 @@ struct LOC_Log_logntk_proc *LINK;
 
 
 
-static void addbogusname(newcmd, newthing, LINK)
-char *newcmd, *newthing;
-struct LOC_Log_logntk_proc *LINK;
+static void addbogusname(char *newcmd, char *newthing, struct LOC_Log_logntk_proc *LINK)
 {
   log_lrec *l1;
   char cmd[256], args[256];
@@ -843,9 +796,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static strlist_t *mydefndirectory(pg, LINK)
-short pg;
-struct LOC_Log_logntk_proc *LINK;
+static strlist_t *mydefndirectory(short pg, struct LOC_Log_logntk_proc *LINK)
 {
   strlist_t *l1;
 
@@ -873,9 +824,7 @@ struct LOC_readcells {
   char s[256], s2[256], name[256];
 } ;
 
-static void readcellfile(fn, LINK)
-char *fn;
-struct LOC_readcells *LINK;
+static void readcellfile(char *fn, struct LOC_readcells *LINK)
 {
   strlist_t *l1;
   int done, copying;
@@ -929,8 +878,7 @@ struct LOC_readcells *LINK;
   }
 }
 
-static void readcells(LINK)
-struct LOC_dologntk *LINK;
+static void readcells(struct LOC_dologntk *LINK)
 {
   struct LOC_readcells V;
   log_grec *g;
@@ -1045,9 +993,7 @@ struct LOC_writefile {
   long linelen;
 } ;
 
-static void writeword(w, LINK)
-char *w;
-struct LOC_writefile *LINK;
+static void writeword(char *w, struct LOC_writefile *LINK)
 {
   if (LINK->linelen + strlen(w) > 78) {
     fprintf(LINK->LINK->outf, "\n  ");
@@ -1057,8 +1003,7 @@ struct LOC_writefile *LINK;
   LINK->linelen += strlen(w) + 1;
 }
 
-static void writefile(LINK)
-struct LOC_dologntk *LINK;
+static void writefile(struct LOC_dologntk *LINK)
 {
   struct LOC_writefile V;
   log_grec *g;
@@ -1269,7 +1214,7 @@ struct LOC_dologntk *LINK;
 	strcpy(s, g->kind->name);
 	if (*p->cname != '\0') {
 	  i = 1;
-	  re_replace(s, p->name, p->cname, &i, &j);
+	  re_replace(s, p->name, p->cname, (size_t *) &i, (size_t *) &j);
 	}
 	putc('h', LINK->outf);
 	V.linelen = 1;
@@ -1314,8 +1259,7 @@ struct LOC_dologntk *LINK;
   fprintf(LINK->outf, " ;\n");
 }
 
-static void showports(LINK)
-struct LOC_dologntk *LINK;
+static void showports(struct LOC_dologntk *LINK)
 {
   char buf[256];
   strlist_t *l1;
@@ -1332,9 +1276,7 @@ struct LOC_dologntk *LINK;
 }
 
 
-static void dologntk(args_, LINK)
-char *args_;
-struct LOC_Log_logntk_proc *LINK;
+static void dologntk(char *args_, struct LOC_Log_logntk_proc *LINK)
 {
   struct LOC_dologntk V;
   char args[256];
@@ -1436,8 +1378,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void probecommand(LINK)
-struct LOC_Log_logntk_proc *LINK;
+static void probecommand(struct LOC_Log_logntk_proc *LINK)
 {
   strlist_t *defndir, *l1, *curdef;
   int exitflag, boxed;
@@ -1585,9 +1526,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-static void identifycommand(args_, LINK)
-char *args_;
-struct LOC_Log_logntk_proc *LINK;
+static void identifycommand(char *args_, struct LOC_Log_logntk_proc *LINK)
 {
   char args[256];
   strlist_t *defndir, *arglist, *argl;
@@ -1653,8 +1592,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-void Log_logntk_proc(act_)
-log_action_t *act_;
+void Log_logntk_proc(log_action_t *act_)
 {
   struct LOC_Log_logntk_proc V;
   long esc, ior;
@@ -1740,6 +1678,3 @@ log_action_t *act_;
 
   /*else let someone else handle it*/
 }
-
-
-
diff --git a/src/logsim.c b/src/logsim.c
index 8879052..b4f0144 100644
--- a/src/logsim.c
+++ b/src/logsim.c
@@ -38,9 +38,10 @@
 /* $debug$ {*/
 
 
-#include <utils/p2c.h>
+#include "utils/p2c.h"
 #include <stdlib.h>
 #include "logsim.h"
+#include "logstuff.h"
 #include "node.h"
 
 /*$ if debugging $
@@ -589,7 +590,7 @@ void Log_16_pulse(log_16_action *act)
 		return;
 	}
 	WITH1->info = (na_long)((long)WITH1->info - 1);
-	
+
 	if ((long)WITH1->info <= 0)
 		WITH1->vars = (na_long)(((unsigned long)WITH1->vars) & (~(1L << 0)));
 }
@@ -1962,6 +1963,3 @@ void Log_16_proc(log_action_t *lact)
 			break;
 	}
 }
-
-
-
diff --git a/src/logsimasm.c b/src/logsimasm.c
index 1b9f1e2..10b5913 100644
--- a/src/logsimasm.c
+++ b/src/logsimasm.c
@@ -165,7 +165,7 @@ void callgate(log_16_actionkinds action)
 
 	kind = logsima_action.lact->actgate->kind;
 	g_proc = kind->proc;
-	kip = kind->info;
+	kip = (kindinfo*) kind->info;
 	if (kip->hasproc)
 	{
 		while (*g_proc)
@@ -232,7 +232,7 @@ static char *debug_dasm()
 	if (*g_proc)
 	{
 		tmp = (char*)dasm_16(g_proc, &pc);
-		buf = (char*)Malloc(strlen(tmp) + SAFETY_MARGIN); 
+		buf = (char*)Malloc(strlen(tmp) + SAFETY_MARGIN);
 		strcpy(buf, "\"");
 		strcat(buf, tmp);
 		strcat(buf, "\"  <");
@@ -295,33 +295,33 @@ static log_16_value g_expr()
 	{
 		case 0xa0:  /* AND */
 			ch = (int)g_expr();
-			return and_table[ch][(int)g_expr()];
+			return (log_16_value) and_table[ch][(int)g_expr()];
 
 		case 0xa1:  /* NAND */
 			ch = (int)g_expr();
-			return nand_table[ch][(int)g_expr()];
+			return (log_16_value) nand_table[ch][(int)g_expr()];
 
 		case 0xa2:  /* OR */
 			ch = (int)g_expr();
-			return or_table[ch][(int)g_expr()];
+			return (log_16_value) or_table[ch][(int)g_expr()];
 
 		case 0xa3:  /* NOR */
 			ch = (int)g_expr();
-			return nor_table[ch][(int)g_expr()];
+			return (log_16_value) nor_table[ch][(int)g_expr()];
 
 		case 0xa4:  /* XOR */
 			ch = (int)g_expr();
-			return xor_table[ch][(int)g_expr()];
+			return (log_16_value) xor_table[ch][(int)g_expr()];
 
 		case 0xa5:  /* NOT */
-			return not_table[(int)g_expr()];
+			return (log_16_value) not_table[(int)g_expr()];
 
 		case 0xa6:  /* RISE */
-			nip = g_pinnum()->info;
+			nip = (nodeinfo*) g_pinnum()->info;
 			return (nip->v == log_one && nip->v00 == log_zero) ? log_one : log_zero;
 
 		case 0xa7:  /* FALL */
-			nip = g_pinnum()->info;
+			nip = (nodeinfo*) g_pinnum()->info;
 			return (nip->v == log_zero && nip->v00 == log_one) ? log_one : log_zero;
 
 		case 0xa8:  /* ZERO */
@@ -331,15 +331,15 @@ static log_16_value g_expr()
 			return log_one;
 
 		case 0xaa:  /* SAME */
-			nip = g_pinnum()->info;
+			nip = (nodeinfo*) g_pinnum()->info;
 			return (g_pinnum()->info == nip) ? log_one : log_zero;
 
 		case 0xab:  /* internal node */
 			ch = *g_proc++;
 			if (ch < 128)
-				nip = g_info->ppins[ch - 64]->info;
+				nip = (nodeinfo*) g_info->ppins[ch - 64]->info;
 			else
-				nip = g_info->ppins[ch + ((*g_proc++) << 7) - (32*128+64)]->info;
+				nip = (nodeinfo*) g_info->ppins[ch + ((*g_proc++) << 7) - (32*128+64)]->info;
 			return nip->v;
 
 		case 0xac:  /* pvar */
@@ -351,20 +351,20 @@ static log_16_value g_expr()
 					? log_one : log_zero;
 
 		case 0xad:  /* FIX */
-			return fix_table[(int)g_expr()];
+			return (log_16_value) fix_table[(int)g_expr()];
 
 		case 0xb0:  /* high pin */
-			nip = g_pins[*g_proc++]->info;
+			nip = (nodeinfo*) g_pins[*g_proc++]->info;
 			if (TRACE_VAL) nc_printf(" Value of %p is %d\n", nip, (int)nip->v - 1);
 			return nip->v;
 
 		case 0xb1:  /* STRONG */
-			nip = g_pinnum()->info;
+			nip = (nodeinfo*) g_pinnum()->info;
 			return nip->truev;
 
 			case16(0xc0):  /* pin */
 				case16(0xd0):
-					nip = g_pins[ch & 0x1f]->info;
+					nip = (nodeinfo*) g_pins[ch & 0x1f]->info;
 			if (TRACE_VAL) nc_printf(" Value of %p is %d\n", nip, (int)nip->v - 1);
 			return nip->v;
 
@@ -534,7 +534,7 @@ if_skip:
 
 			case 0x1c:  /* PULLDN */
 				np = g_pinnum();
-				nip = np->info;
+				nip = (nodeinfo*) np->info;
 				if (nip->defv == log_one)
 					record_conflict(np);
 				else
@@ -543,7 +543,7 @@ if_skip:
 
 			case 0x1d:  /* PULLUP */
 				np = g_pinnum();
-				nip = np->info;
+				nip = (nodeinfo*) np->info;
 				if (nip->defv == log_zero)
 					record_conflict(np);
 				else
@@ -566,7 +566,7 @@ out_node:
 				switch (g_expr())
 				{
 					case log_zero:
-						nip = np->info;
+						nip = (nodeinfo*) np->info;
 						if (TRACE_VAL) nc_printf(" Output 0 to %p (was %d)\n", nip, nip->v0);
 						if (nip->v0 == log_one)
 							record_conflict(np);
@@ -575,7 +575,7 @@ out_node:
 						break;
 
 					case log_one:
-						nip = np->info;
+						nip = (nodeinfo*) np->info;
 						if (TRACE_VAL) nc_printf(" Output 1 to %p (was %d)\n", nip, nip->v0);
 						if (nip->v0 == log_zero)
 							record_conflict(np);
@@ -595,7 +595,7 @@ out_node:
 oc_out_node:
 				if (g_expr() == log_zero)
 				{
-					nip = np->info;
+					nip = (nodeinfo*) np->info;
 					if (TRACE_VAL) nc_printf(" Output 0 to %p (was %d)\n", nip, nip->v0);
 					if (nip->v0 == log_one)
 						record_conflict(np);
@@ -683,7 +683,7 @@ void executegates(int *active, log_grec *g)
 			g_proc = g->kind->proc;
 			g_pins = g->pin;
 			g_gate = g;
-			g_info = g->info;
+			g_info = (gateinfo*) g->info;
 			g_vars = (long)g->vars;
 			g_stmts();
 			g->vars = (na_long)g_vars;
@@ -692,4 +692,3 @@ void executegates(int *active, log_grec *g)
 	}
 
 }
-
diff --git a/src/logsimed.c b/src/logsimed.c
index f8c382a..7d8b86d 100644
--- a/src/logsimed.c
+++ b/src/logsimed.c
@@ -62,9 +62,7 @@ static void append (struct LOC_dasm_16 *LINK, char *s);
 
 /* append to the local buffer. */
 /* the buf and bufsiz are initialized in dasm_16() */
-static void append(LINK, s)
-struct LOC_dasm_16 *LINK;
-char *s;
+static void append(struct LOC_dasm_16 * LINK, char *s)
 {
 #define GROW_SIZE 1024
 char *tmp;
@@ -83,15 +81,12 @@ char *tmp;
 }
 
 
-static char vr(i, LINK)
-long i;
-struct LOC_dasmop *LINK;
+static char vr(long i, struct LOC_dasmop *LINK)
 {
   return ((char)((i & 15) + 65));
 }
 
-static long getpseudo(LINK)
-struct LOC_dasmop *LINK;
+static long getpseudo(struct LOC_dasmop *LINK)
 {
   long Result;
 
@@ -107,9 +102,7 @@ struct LOC_dasmop *LINK;
   return Result;
 }
 
-static void dasmoppar(z, LINK)
-uchar z;
-struct LOC_dasmop *LINK;
+static void dasmoppar(uchar z, struct LOC_dasmop *LINK)
 {
   uchar ch;
 
@@ -125,8 +118,7 @@ struct LOC_dasmop *LINK;
   append(LINK->LINK, ")");
 }
 
-static void dasmop(LINK)
-struct LOC_dasm_16 *LINK;
+static void dasmop(struct LOC_dasm_16 *LINK)
 {
   struct LOC_dasmop V;
   uchar ch;
@@ -646,9 +638,7 @@ struct LOC_dasm_16 *LINK;
 
 /* dasm_16() returns a pointer to allocated memory. */
 /* the caller must ensure it is freed. */
-char *dasm_16(proc_, pc_)
-uchar *proc_;
-long *pc_;
+char *dasm_16(uchar* proc_, long* pc_)
 {
   struct LOC_dasm_16 V;
 
@@ -673,9 +663,7 @@ long *pc_;
 }
 
 
-long indent_16(proc, pc)
-uchar *proc;
-long pc;
+long indent_16(uchar* proc, long pc)
 {
   long Result;
 
@@ -702,8 +690,7 @@ struct LOC_length_16 {
   long pc;
 } ;
 
-static void instlen(LINK)
-struct LOC_length_16 *LINK;
+static void instlen(struct LOC_length_16 *LINK)
 {
   uchar ch;
 
@@ -836,9 +823,7 @@ struct LOC_length_16 *LINK;
 }
 
 
-long length_16(proc_, pc_)
-uchar *proc_;
-long pc_;
+long length_16(uchar* proc_, long pc_)
 {
   struct LOC_length_16 V;
   long savepc;
@@ -864,18 +849,13 @@ struct LOC_assem_16 {
 
 static void assem (struct LOC_assem_16 *LINK);
 
-static void store(b, LINK)
-short b;
-struct LOC_assem_16 *LINK;
+static void store(short b, struct LOC_assem_16 *LINK)
 {
   (*LINK->pc)++;
   LINK->proc[*LINK->pc - 1] = b;
 }
 
-static int strcheck(s, pref, LINK)
-char *s;
-char *pref;
-struct LOC_assem_16 *LINK;
+static int strcheck(char* s, char* pref, struct LOC_assem_16 *LINK)
 {
   if (strbegins(s, pref)) {
     strcpy_overlap(s, s + strlen(pref));
@@ -889,8 +869,7 @@ struct LOC_assem {
   struct LOC_assem_16 *LINK;
 } ;
 
-static void factor(LINK)
-struct LOC_assem *LINK;
+static void factor(struct LOC_assem *LINK)
 {
   long i, j, FORLIM;
   char STR2[6];
@@ -1224,8 +1203,7 @@ struct LOC_assem *LINK;
   }
 }
 
-static void assem(LINK)
-struct LOC_assem_16 *LINK;
+static void assem(struct LOC_assem_16 *LINK)
 {
   struct LOC_assem V;
   long i, j, i0;
@@ -1264,10 +1242,7 @@ struct LOC_assem_16 *LINK;
 
 
 
-long assem_16(buf_, proc_, pc_)
-char *buf_;
-uchar *proc_;
-long *pc_;
+long assem_16(char* buf_, uchar* proc_, long* pc_)
 {
   struct LOC_assem_16 V;
   long Result;
@@ -1349,9 +1324,7 @@ struct LOC_edit_16 {
    uchar ch;
 } ;
 
-static void resizeproc(len, LINK)
-long len;
-struct LOC_edit_16 *LINK;
+static void resizeproc(long len, struct LOC_edit_16 *LINK)
 {
   long newlen;
   uchar *newproc;
@@ -1368,8 +1341,7 @@ struct LOC_edit_16 *LINK;
   *LINK->proc = newproc;
 }
 
-static void dasminst(LINK)
-struct LOC_edit_16 *LINK;
+static void dasminst(struct LOC_edit_16 *LINK)
 {
   long ind;
   char *buf;
@@ -1389,8 +1361,7 @@ struct LOC_edit_16 *LINK;
   Free(buf);
 }
 
-static void showdef(LINK)
-struct LOC_edit_16 *LINK;
+static void showdef(struct LOC_edit_16 *LINK)
 {
   long i, pc0, FORLIM;
 
@@ -1425,9 +1396,7 @@ struct LOC_edit_16 *LINK;
   LINK->pc = pc0;
 }
 
-static int insertinst(p, n, LINK)
-long p, n;
-struct LOC_edit_16 *LINK;
+static int insertinst(long p, long n, struct LOC_edit_16 *LINK)
 {
   long i;
 
@@ -1445,9 +1414,7 @@ struct LOC_edit_16 *LINK;
     return false;
 }
 
-static void deleteinst(p, n, LINK)
-long p, n;
-struct LOC_edit_16 *LINK;
+static void deleteinst(long p, long n, struct LOC_edit_16 *LINK)
 {
   long i;
 
@@ -1458,10 +1425,7 @@ struct LOC_edit_16 *LINK;
   } while ((*LINK->proc)[i - 2] != '\0');
 }
 
-static long doassem(s, repl, LINK)
-char *s;
-int repl;
-struct LOC_edit_16 *LINK;
+static long doassem(char *s, int repl, struct LOC_edit_16 *LINK)
 {
   long Result, i, FORLIM;
 
@@ -1479,10 +1443,7 @@ struct LOC_edit_16 *LINK;
   return Result;
 }
 
-static void bogusreadln(s, hasdef, LINK)
-char *s;
-int hasdef;
-struct LOC_edit_16 *LINK;
+static void bogusreadln(char *s, int hasdef, struct LOC_edit_16 *LINK)
 {
   long pos;
 
@@ -1496,10 +1457,7 @@ struct LOC_edit_16 *LINK;
 
 
 
-void edit_16(proc_, proclen_, name_)
-uchar **proc_;
-long *proclen_;
-char *name_;
+void edit_16(uchar **proc_, long *proclen_, char *name_)
 {
   struct LOC_edit_16 V;
   long x1, y1, pc0, pc1, sx, sy;
@@ -1760,10 +1718,7 @@ char *name_;
 
 
 
-void dump_16(proc, sl, indenting)
-uchar **proc;
-strlist_t **sl;
-int indenting;
+void dump_16(uchar **proc, strlist_t **sl, int indenting)
 {
   long pc, indent, oindent, proclen;
   strlist_t *l1;
@@ -1803,10 +1758,7 @@ int indenting;
 
 
 
-void read_16(proc, proclen, sl)
-uchar **proc;
-long *proclen;
-strlist_t *sl;
+void read_16(uchar **proc, long *proclen, strlist_t *sl)
 {
   long pc, instrptr, i, newlen;
   uchar instr[1023];
@@ -1856,15 +1808,3 @@ strlist_t *sl;
   }
   (*proc)[pc - 1] = '\0';
 }
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/logsimh.c b/src/logsimh.c
index 1d721de..b361cf4 100644
--- a/src/logsimh.c
+++ b/src/logsimh.c
@@ -1662,7 +1662,7 @@ static void parsegates(struct LOC_compilepage *LINK)
 				if (i == first)
 					i++;
 				else
-					na_exch((void *)(&glist[i - 1]), (void *)(&glist[first - 1]),
+					na_exch((long *)(&glist[i - 1]), (long *)(&glist[first - 1]),
 							sizeof(gaterec));
 				P_setunion(defs, defs, glist[first - 1].outs);
 				first++;
@@ -1683,7 +1683,7 @@ static void parsegates(struct LOC_compilepage *LINK)
 					j = i;
 				}
 			}
-			na_exch((void *)(&glist[j - 1]), (void *)(&glist[first - 1]),
+			na_exch((long *)(&glist[j - 1]), (long *)(&glist[first - 1]),
 					sizeof(gaterec));
 			P_setunion(defs, defs, glist[first - 1].outs);
 			first++;
@@ -1995,23 +1995,17 @@ static instrrec *makeinstr3(instrops code, instrrec *a1, instrrec *a2, instrrec
 	return ip;
 }
 
-static instrrec *makefix0(arg, LINK)
-	instrrec *arg;
-	struct LOC_compilepage *LINK;
+static instrrec *makefix0(instrrec *arg, struct LOC_compilepage *LINK)
 {
 	return (makeinstr1(op_fix0, arg, LINK));
 }
 
-static instrrec *makefix1(arg, LINK)
-	instrrec *arg;
-	struct LOC_compilepage *LINK;
+static instrrec *makefix1(instrrec *arg, struct LOC_compilepage *LINK)
 {
 	return (makeinstr1(op_fix1, arg, LINK));
 }
 
-static instrrec *copytree(ip, LINK)
-	instrrec *ip;
-	struct LOC_compilepage *LINK;
+static instrrec *copytree(instrrec *ip, struct LOC_compilepage *LINK)
 {
 	instrrec *Result, *ip2;
 	noderec *WITH;
@@ -2045,7 +2039,7 @@ static instrrec *copytree(ip, LINK)
 	return Result;
 }
 
-static void replacetree(instrrec **ip, instrrec **ip2, struct LOC_compilepage *LINK)
+static void replacetree(instrrec **ip, instrrec *ip2, struct LOC_compilepage *LINK)
 {
 	disposetree(ip, LINK);
 	*ip = ip2;
@@ -2752,7 +2746,7 @@ static void untrail(trailrec *tp, struct LOC_simplstmt *LINK)
 	while (tp != NULL)
 	{
 		WITH = &LINK->LINK->LINK->things[tp->num];
-		na_exch((void *)(&WITH->poss), (void *)(&tp->oldposs), sizeof(long));
+		na_exch((long *)(&WITH->poss), (long *)(&tp->oldposs), sizeof(long));
 		tflag = WITH->strong;
 		WITH->strong = tp->oldstrong;
 		tp->oldstrong = tflag;
@@ -2922,8 +2916,8 @@ static void trymoveif(struct LOC_simplstmt *LINK)
 
 			while (ip3 != LINK->ip && (good1 || good2))
 			{
-				checkdefvusev(ip3, defv1, usev1, &good1, LINK);
-				checkdefvusev(ip3, defv2, usev2, &good2, LINK);
+				checkdefvusev(ip3, defv1, usev1, (uint *) &good1, LINK);
+				checkdefvusev(ip3, defv2, usev2, (uint *) &good2, LINK);
 				ip3 = ip3->UU.U1.next;
 			}
 
@@ -4807,7 +4801,7 @@ static void updatehdef(hdefrec *hdef)
 				{
 					if (hdef->defreg != NULL)
 						(*WITH->hook.setupregion)(&hdef->defreg, 0);
-				} 
+				}
 				else
 				{
 					if (hdef->defreg == NULL)
@@ -5683,6 +5677,3 @@ void Log_16_digh(log_16_action *act)
 			break;
 	}
 }
-
-
-
diff --git a/src/logspc.c b/src/logspc.c
index 4e9b19f..ac2a1e2 100644
--- a/src/logspc.c
+++ b/src/logspc.c
@@ -188,9 +188,7 @@ static char *filename, *cellname;
 static char nodeprefix[11];
 
 
-static strlist_t *strlist_find_r(l1, wrd_)
-strlist_t *l1;
-char *wrd_;
+static strlist_t *strlist_find_r(strlist_t *l1, char *wrd_)
 {
   char wrd[256];
 
@@ -201,9 +199,7 @@ char *wrd_;
 }
 
 
-static int tryreset(f, fn)
-FILE **f;
-char *fn;
+static int tryreset(FILE **f, char *fn)
 {
   strlist_t *l1;
   char buf[256];
@@ -249,9 +245,7 @@ struct LOC_Log_logspc_proc {
 } ;
 
 
-static void message(s_, LINK)
-char *s_;
-struct LOC_Log_logspc_proc *LINK;
+static void message(char *s_, struct LOC_Log_logspc_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -262,9 +256,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void emessage(s_, LINK)
-char *s_;
-struct LOC_Log_logspc_proc *LINK;
+static void emessage(char *s_, struct LOC_Log_logspc_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -276,9 +268,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void vmessage(s_, LINK)
-char *s_;
-struct LOC_Log_logspc_proc *LINK;
+static void vmessage(char *s_, struct LOC_Log_logspc_proc *LINK)
 {
   char s[256];
   char STR1[256];
@@ -289,9 +279,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void addlabel(s_, LINK)
-char *s_;
-struct LOC_Log_logspc_proc *LINK;
+static void addlabel(char *s_, struct LOC_Log_logspc_proc *LINK)
 {
   char s[256];
   log_lrec *l1;
@@ -301,17 +289,13 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void getword(buf, w, LINK)
-char *buf, *w;
-struct LOC_Log_logspc_proc *LINK;
+static void getword(char *buf, char *w, struct LOC_Log_logspc_proc *LINK)
 {
   (*LINK->act->hook.getword)(buf, w);   /*converts to upper case*/
 }
 
 
-static void spice_strword(s, word, filePtr)
-register char *s, *word;
-FILE *filePtr;
+static void spice_strword(char *s, char *word, FILE *filePtr)
 {
     register char *s1 = s;
     register char *s2 = s;
@@ -348,19 +332,13 @@ FILE *filePtr;
 }
 
 
-static void getint(buf, i, def, LINK)
-char *buf;
-long *i, def;
-struct LOC_Log_logspc_proc *LINK;
+static void getint(char *buf, long *i, long def, struct LOC_Log_logspc_proc *LINK)
 {
   (*LINK->act->hook.getint)(buf, i, def);
 }
 
 
-static void readstrlist(buf, l1, LINK)
-char *buf;
-strlist_t **l1;
-struct LOC_Log_logspc_proc *LINK;
+static void readstrlist(char *buf, strlist_t **l1, struct LOC_Log_logspc_proc *LINK)
 {
   strlist_t *l2;
   char arg[256];
@@ -373,10 +351,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void readstrlista(buf, l1, LINK)
-char *buf;
-strlist_t **l1;
-struct LOC_Log_logspc_proc *LINK;
+static void readstrlista(char *buf, strlist_t **l1, struct LOC_Log_logspc_proc *LINK)
 {
   strlist_t *l2;
   char arg[256];
@@ -391,11 +366,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void readstrlistr(buf, l1, named, LINK)
-char *buf;
-strlist_t **l1;
-int named;
-struct LOC_Log_logspc_proc *LINK;
+static void readstrlistr(char *buf, strlist_t **l1, int named, struct LOC_Log_logspc_proc *LINK)
 {
   strlist_t *l2;
   char arg[256], rex[256];
@@ -414,10 +385,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void addcell(c1, name, cname, fname, LINK)
-cellrec **c1;
-char *name, *cname, *fname;
-struct LOC_Log_logspc_proc *LINK;
+static void addcell(cellrec **c1, char *name, char *cname, char *fname, struct LOC_Log_logspc_proc *LINK)
 {
   *c1 = (cellrec *)Malloc(sizeof(cellrec));
   strcpy((*c1)->name, name);
@@ -432,10 +400,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void docommand(buf1_, buf_, complain, LINK)
-char *buf1_, *buf_;
-int complain;
-struct LOC_Log_logspc_proc *LINK;
+static void docommand(char *buf1_, char *buf_, int complain, struct LOC_Log_logspc_proc *LINK)
 {
   char buf1[256], buf[256], buf2[256], buf3[256];
   cellrec *c1;
@@ -632,9 +597,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void namenode(n, LINK)
-log_nrec *n;
-struct LOC_Log_logspc_proc *LINK;
+static void namenode(log_nrec *n, struct LOC_Log_logspc_proc *LINK)
 {
   char buf[256], buf2[256];
   strlist_t *l1;
@@ -676,9 +639,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static int trynamegate(g, LINK)
-log_grec *g;
-struct LOC_Log_logspc_proc *LINK;
+static int trynamegate(log_grec *g, struct LOC_Log_logspc_proc *LINK)
 {
   char name[256];
 
@@ -695,9 +656,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void namecellgates(c, LINK)
-cellrec *c;
-struct LOC_Log_logspc_proc *LINK;
+static void namecellgates(cellrec *c, struct LOC_Log_logspc_proc *LINK)
 {
   log_grec *g;
   log_nrec **portlist;
@@ -729,9 +688,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void nameprimgates(p, LINK)
-primrec *p;
-struct LOC_Log_logspc_proc *LINK;
+static void nameprimgates(primrec *p, struct LOC_Log_logspc_proc *LINK)
 {
   char buf[256];
   log_grec *g;
@@ -747,7 +704,7 @@ struct LOC_Log_logspc_proc *LINK;
 	strcpy(buf, g->kind->name);
 	if (*p->cname != '\0') {
 	  pos = 1;
-	  re_replace(buf, p->name, p->cname, &pos, &last);
+	  re_replace(buf, p->name, p->cname, (size_t *) &pos, (size_t *) &last);
 	}
 	p->ccount++;
 	sprintf(STR3, "%s_%ld", buf, p->ccount);
@@ -762,10 +719,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void prolog(args_, bp, LINK)
-char *args_;
-log_brec *bp;
-struct LOC_Log_logspc_proc *LINK;
+static void prolog(char *args_, log_brec *bp, struct LOC_Log_logspc_proc *LINK)
 {
   char args[256];
   log_lrec *lb1;
@@ -951,8 +905,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void epilog(LINK)
-struct LOC_Log_logspc_proc *LINK;
+static void epilog(struct LOC_Log_logspc_proc *LINK)
 {
   cellrec *c;
   transrec *t;
@@ -1012,9 +965,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void addbogusname(newcmd, newthing, LINK)
-char *newcmd, *newthing;
-struct LOC_Log_logspc_proc *LINK;
+static void addbogusname(char *newcmd, char *newthing, struct LOC_Log_logspc_proc *LINK)
 {
   log_lrec *l1;
   char cmd[256], args[256];
@@ -1031,9 +982,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static strlist_t *mydefndirectory(pg, LINK)
-short pg;
-struct LOC_Log_logspc_proc *LINK;
+static strlist_t *mydefndirectory(short pg, struct LOC_Log_logspc_proc *LINK)
 {
   strlist_t *l1;
 
@@ -1064,9 +1013,7 @@ struct LOC_readcells {
 } ;
 
 
-static void readcellfile(fn, LINK)
-char *fn;
-struct LOC_readcells *LINK;
+static void readcellfile(char *fn, struct LOC_readcells *LINK)
 {
   strlist_t *l1;
   int done, copying, prewarp;
@@ -1144,8 +1091,7 @@ struct LOC_readcells *LINK;
 }
 
 
-static void readcells(LINK)
-struct LOC_dologspc *LINK;
+static void readcells(struct LOC_dologspc *LINK)
 {
   struct LOC_readcells V;
   log_grec *g;
@@ -1280,9 +1226,7 @@ struct LOC_writefile {
 } ;
 
 
-static void writeword(w, LINK)
-char *w;
-struct LOC_writefile *LINK;
+static void writeword(char *w, struct LOC_writefile *LINK)
 {
   if (LINK->linelen + strlen(w) > 77)
   {
@@ -1298,8 +1242,7 @@ struct LOC_writefile *LINK;
 }
 
 
-static void writefile(LINK)
-struct LOC_dologspc *LINK;
+static void writefile(struct LOC_dologspc *LINK)
 {
   struct LOC_writefile V;
   log_grec *g;
@@ -1857,7 +1800,7 @@ struct LOC_dologspc *LINK;
 	strcpy(s, g->kind->name);
 	if (*p->cname != '\0') {
 	  i = 1;
-	  re_replace(s, p->name, p->cname, &i, &j);
+	  re_replace(s, p->name, p->cname, (size_t *) &i, (size_t *) &j);
 	}
 /*
 	putc('h', LINK->outf);
@@ -1916,8 +1859,7 @@ struct LOC_dologspc *LINK;
 }
 
 
-static void showports(LINK)
-struct LOC_dologspc *LINK;
+static void showports(struct LOC_dologspc *LINK)
 {
   char buf[256];
   strlist_t *l1;
@@ -1934,9 +1876,7 @@ struct LOC_dologspc *LINK;
 }
 
 
-static void dologspc(args_, LINK)
-char *args_;
-struct LOC_Log_logspc_proc *LINK;
+static void dologspc(char *args_, struct LOC_Log_logspc_proc *LINK)
 {
   struct LOC_dologspc V;
   char args[256];
@@ -2131,8 +2071,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void probecommand(LINK)
-struct LOC_Log_logspc_proc *LINK;
+static void probecommand(struct LOC_Log_logspc_proc *LINK)
 {
   strlist_t *defndir, *l1, *curdef;
   int exitflag, boxed;
@@ -2276,9 +2215,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-static void identifycommand(args_, LINK)
-char *args_;
-struct LOC_Log_logspc_proc *LINK;
+static void identifycommand(char *args_, struct LOC_Log_logspc_proc *LINK)
 {
   char args[256];
   strlist_t *defndir, *arglist, *argl;
@@ -2344,8 +2281,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-void Log_logspc_proc(act_)
-log_action_t *act_;
+void Log_logspc_proc(log_action_t *act_)
 {
   struct LOC_Log_logspc_proc V;
   long esc, ior;
@@ -2435,6 +2371,3 @@ log_action_t *act_;
 
   /*else let someone else handle it*/
 }
-
-
-
diff --git a/src/page.c b/src/page.c
index 3a29f82..ec64120 100644
--- a/src/page.c
+++ b/src/page.c
@@ -199,7 +199,7 @@ int pagembb(short pg, short *x1, short *y1, short *x2, short *y2)
 
 log_page *pageAlloc()
 {
-	log_page *newpage = Malloc(sizeof(log_page));
+	log_page *newpage = (log_page *) Malloc(sizeof(log_page));
 
 	newpage->gbase = NULL;
 	newpage->sbase = NULL;
@@ -219,4 +219,3 @@ void pageFree(log_page **page)
 	Free(*page);
 	*page = NULL;
 }
-
diff --git a/src/pagereader.c b/src/pagereader.c
index 1e93155..c75ae94 100644
--- a/src/pagereader.c
+++ b/src/pagereader.c
@@ -3,6 +3,12 @@
 #include "logfont.h"
 #include "node.h"
 #include "log.h"
+#include "graphics/newci.h"
+#include "tool.h"
+#include "utils.h"
+#include "wire.h"
+#include "utils/strings.h"
+#include "screen.h"
 
 void loadfail(char *msg, struct LOC_loadpage *LINK)
 {
diff --git a/src/pagewriter.c b/src/pagewriter.c
index 92e5752..7eef7f6 100644
--- a/src/pagewriter.c
+++ b/src/pagewriter.c
@@ -1,5 +1,13 @@
+#include <string.h>
 #include "pagewriter.h"
+#include "tool.h"
+#include "log.h"
 #include "logfont.h"
+#include "screen.h"
+#include "utils/filepack.h"
+#include "graphics/newcrt.h"
+#include "graphics/newci.h"
+
 
 short countnode(log_nrec *n, struct LOC_savepage *LINK)
 {
diff --git a/src/screen.c b/src/screen.c
index 97e49cb..bdb4947 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -30,14 +30,17 @@
    David Gillespie
    */
 
-#include <utils/p2c.h>
-#include <graphics/newkbd.h>
-#include <graphics/newcrt.h>
+#include "utils/p2c.h"
+#include "graphics/newkbd.h"
+#include "graphics/newcrt.h"
 #include "logglobals.h"
 #include "logfont.h"
 #include "utils.h"
 #include "screen.h"
+#include "logstuff.h"
+#include "log.h"
 #include "node.h"
+#include "utils/strings.h"
 
 static rablistrec rabtable[rabtabsize];   ///< Positions of rabbits
 
@@ -82,7 +85,7 @@ void initscreen()
 	m_upside_down();
 	m_setlinestyle(1L, 0xf0f0L);
 	m_setlinestyle(2L, 0xaaaaL);
-	m_setfont(logfont_lfont);
+	// m_setfont(logfont_lfont);
 	init_X_screen();
 	onescreen = nc_alphashared();
 	eightcolors = (m_maxcolor <= 7);
@@ -2157,5 +2160,3 @@ void showcatalog()
 		cb = cb->next;
 	}
 }
-
-
diff --git a/src/tool.c b/src/tool.c
index 8f3d2ac..cf49a2b 100644
--- a/src/tool.c
+++ b/src/tool.c
@@ -1,8 +1,10 @@
 
-#include <utils/p2c.h>
-#include <graphics/newkbd.h>
+#include "utils/p2c.h"
+#include "graphics/newkbd.h"
+#include "graphics/newci.h"
 #include "logdef.h"
 #include "logglobals.h"
+#include "logstuff.h"
 #include "utils.h"
 #include "node.h"
 
@@ -202,4 +204,3 @@ void closetools()
 		tp = tp->next;
 	}
 }
-
diff --git a/src/utils/filepack.c b/src/utils/filepack.c
index c56982d..cc6dd89 100644
--- a/src/utils/filepack.c
+++ b/src/utils/filepack.c
@@ -12,12 +12,12 @@ void fp_change(char* filename1, char *filename2)
 
 	if (strchr(filename2, '/'))
 	{
-		filename3 = malloc (sizeof(char) * (strlen(filename2) + 1));
+		filename3 = (char *) malloc (sizeof(char) * (strlen(filename2) + 1));
 		strcpy(filename3, filename2);
 	}
 	else
 	{
-		filename3 = malloc (sizeof(char) * (strlen(filename1) + 1));
+		filename3 = (char *) malloc (sizeof(char) * (strlen(filename1) + 1));
 		strcpy(filename3, filename1);
 		cp = (char *) strrchr(filename3, '/');
 		if (cp)
@@ -30,7 +30,7 @@ void fp_change(char* filename1, char *filename2)
 		unlink(filename3);
 	if (!link(filename1, filename3))
 		unlink(filename1);
-	
+
 	free(filename3);
 }
 
@@ -44,4 +44,3 @@ void fp_remove(char *filename)
 {
 	unlink(filename);
 }
-
diff --git a/src/utils/p2c.c b/src/utils/p2c.c
index 6d6cef2..f98c5c3 100644
--- a/src/utils/p2c.c
+++ b/src/utils/p2c.c
@@ -12,20 +12,10 @@
 
 #include <utils/p2c.h>
 
-
-int P_argc;
-char **P_argv;
-
-short P_escapecode;
-int P_ioresult;
-int bigendian;
-
 long EXCP_LINE;    /* Used by Pascal workstation system */
 
 void* __MallocTemp__;
 
-__p2c_jmp_buf *__top_jb;
-
 
 /* determines endian-ness of machine */
 /* contributed by Marwan Jabri, U Sydney */
diff --git a/src/utils/strings.c b/src/utils/strings.c
index ef91bd9..e9c3b55 100644
--- a/src/utils/strings.c
+++ b/src/utils/strings.c
@@ -34,7 +34,7 @@ char *strlower(char *result, char *s)
 char *strreverse(char *result, char *s)
 {
 	size_t len = strlen(s);
-	char *tmp = malloc(sizeof(char) * (len + 1));
+	char *tmp = (char *) malloc(sizeof(char) * (len + 1));
 
 	tmp[len] = '\0';
 	for (size_t i = 0; i < len; i++)
diff --git a/src/wire.c b/src/wire.c
index ec21274..c5c0d9b 100644
--- a/src/wire.c
+++ b/src/wire.c
@@ -1,11 +1,15 @@
 
-#include <utils/p2c.h>
-#include <graphics/newkbd.h>
+#include "utils/p2c.h"
+#include "graphics/newkbd.h"
+#include "graphics/newci.h"
 #include "logglobals.h"
 #include "logdef.h"
 #include "utils.h"
-#include "wire.h"
+#include "log.h"
+#include "screen.h"
 #include "node.h"
+#include "wire.h"
+
 
 void fryhwire(log_hwrec *hw);
 void fryvwire(log_vwrec *vw);
@@ -972,5 +976,3 @@ void fryvwire(log_vwrec *vw)
         clipoff();
         refreshsoon();
 }
-
-
-- 
GitLab