Add util/int/switch.h to declare do_instr() and Do???()

Use switch.h to reduce warnings from clang about implicit declarations
of functions.  I used `grep ... do_*.c | sed ... | sort`, and some
manual editing, to make the big list of Do???() functions.
This commit is contained in:
George Koehler 2019-10-23 19:13:51 -04:00
parent 36f16b0cb8
commit 777d0abb00
18 changed files with 168 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include "mem.h" #include "mem.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
#define LAR 1 #define LAR 1
#define SAR 2 #define SAR 2

View file

@ -12,6 +12,7 @@
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
/* Note that in the EM assembly language brach instructions have /* Note that in the EM assembly language brach instructions have
lables as their arguments, where in the EM machine language they lables as their arguments, where in the EM machine language they

View file

@ -16,6 +16,7 @@
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "stack.h" #include "stack.h"
#include "switch.h"
PRIVATE void compare_obj(size); PRIVATE void compare_obj(size);

View file

@ -14,6 +14,7 @@
#include "fra.h" #include "fra.h"
#include "warn.h" #include "warn.h"
#include "stack.h" #include "stack.h"
#include "switch.h"
void DoCII(void) void DoCII(void)
{ {

View file

@ -14,6 +14,7 @@
#include "fra.h" #include "fra.h"
#include "io.h" #include "io.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
#ifndef NOFLOAT #ifndef NOFLOAT

View file

@ -15,6 +15,7 @@
#include "stack.h" #include "stack.h"
#include "fra.h" #include "fra.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
PRIVATE long inc(long), dec(long); PRIVATE long inc(long), dec(long);

View file

@ -13,6 +13,7 @@
#include "warn.h" #include "warn.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
PRIVATE long adi(long, long, size), sbi(long, long, size), dvi(long, long, size); PRIVATE long adi(long, long, size), sbi(long, long, size), dvi(long, long, size);
PRIVATE long mli(long, long, size), rmi(long, long), ngi(long, size); PRIVATE long mli(long, long, size), rmi(long, long), ngi(long, size);

View file

@ -13,6 +13,7 @@
#include "fra.h" #include "fra.h"
#include "rsb.h" #include "rsb.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
PRIVATE ptr lexback_LB(unsigned long); PRIVATE ptr lexback_LB(unsigned long);

View file

@ -14,6 +14,7 @@
#include "trap.h" #include "trap.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
#ifdef LOGGING #ifdef LOGGING
extern int must_test; extern int must_test;

View file

@ -22,6 +22,7 @@
#include "rsb.h" #include "rsb.h"
#include "io.h" #include "io.h"
#include "linfil.h" #include "linfil.h"
#include "switch.h"
#include "whatever.h" #include "whatever.h"
extern int running; /* from main.c */ extern int running; /* from main.c */

View file

@ -19,6 +19,7 @@
#include "fra.h" #include "fra.h"
#include "rsb.h" #include "rsb.h"
#include "linfil.h" #include "linfil.h"
#include "switch.h"
#include "whatever.h" #include "whatever.h"
extern int running; /* from main.c */ extern int running; /* from main.c */

View file

@ -14,6 +14,7 @@
#include "warn.h" #include "warn.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
#define adp(p,w) ((p) + (w)) #define adp(p,w) ((p) + (w))
#define sbs(t,s) ((s) - (t)) #define sbs(t,s) ((s) - (t))

View file

@ -11,6 +11,7 @@
#include "mem.h" #include "mem.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
PRIVATE void bit_test(size), create_set(size); PRIVATE void bit_test(size), create_set(size);

View file

@ -12,6 +12,7 @@
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
/** STL l: Store local or parameter */ /** STL l: Store local or parameter */
void DoSTL(register long l) void DoSTL(register long l)

View file

@ -13,6 +13,7 @@
#include "warn.h" #include "warn.h"
#include "text.h" #include "text.h"
#include "fra.h" #include "fra.h"
#include "switch.h"
/************************************************************************ /************************************************************************
* No checking is performed, except for division by zero. * * No checking is performed, except for division by zero. *

View file

@ -23,6 +23,7 @@
#include "opcode.h" #include "opcode.h"
#include "m_sigtrp.h" #include "m_sigtrp.h"
#include "rsb.h" #include "rsb.h"
#include "switch.h"
#include "whatever.h" #include "whatever.h"
char mess_file[64] = "int.mess"; /* name of message file */ char mess_file[64] = "int.mess"; /* name of message file */

View file

@ -10,6 +10,7 @@
#include "text.h" #include "text.h"
#include "trap.h" #include "trap.h"
#include "warn.h" #include "warn.h"
#include "switch.h"
void do_instr(unsigned int opcode) void do_instr(unsigned int opcode)
{ {

151
util/int/switch.h Normal file
View file

@ -0,0 +1,151 @@
/* Copyright (c) 2019 ACK Project.
* See the copyright notice in the ACK home directory,
* in the file "Copyright".
*
* Created on: 2019-10-23
*
*/
#ifndef SWITCH_H_
#define SWITCH_H_
#include "global.h" /* size */
/* switch.c */
void do_instr(unsigned int);
/* do_*.c */
void DoAAR(size);
void DoADF(size);
void DoADI(size);
void DoADP(long);
void DoADS(size);
void DoADU(size);
void DoAND(size);
void DoASP(long);
void DoASS(size);
void DoBEQ(long);
void DoBGE(long);
void DoBGT(long);
void DoBLE(long);
void DoBLM(size);
void DoBLS(size);
void DoBLT(long);
void DoBNE(long);
void DoBRA(long);
void DoCAI(void);
void DoCAL(long);
void DoCFF(void);
void DoCFI(void);
void DoCFU(void);
void DoCIF(void);
void DoCII(void);
void DoCIU(void);
void DoCMF(size);
void DoCMI(size);
void DoCMP(void);
void DoCMS(size);
void DoCMU(size);
void DoCOM(size);
void DoCSA(size);
void DoCSB(size);
void DoCUF(void);
void DoCUI(void);
void DoCUU(void);
void DoDCH(void);
void DoDEC(void);
void DoDEE(long);
void DoDEL(long);
void DoDUP(size);
void DoDUS(size);
void DoDVF(size);
void DoDVI(size);
void DoDVU(size);
void DoEXG(size);
void DoFEF(size);
void DoFIF(size);
void DoFIL(unsigned long);
void DoGTO(unsigned long);
void DoINC(void);
void DoINE(long);
void DoINL(long);
void DoINN(size);
void DoIOR(size);
void DoLAE(unsigned long);
void DoLAL(long);
void DoLAR(size);
void DoLDC(long);
void DoLDE(long);
void DoLDF(long);
void DoLDL(long);
void DoLFR(size);
void DoLIL(long);
void DoLIM(void);
void DoLIN(unsigned long);
void DoLNI(void);
void DoLOC(long);
void DoLOE(long);
void DoLOF(long);
void DoLOI(size);
void DoLOL(long);
void DoLOR(long);
void DoLOS(size);
void DoLPB(void);
void DoLPI(long);
void DoLXA(unsigned long);
void DoLXL(unsigned long);
void DoMLF(size);
void DoMLI(size);
void DoMLU(size);
void DoMON(void);
void DoNGF(size);
void DoNGI(size);
void DoNOP(void);
void DoRCK(size);
void DoRET(size);
void DoRMI(size);
void DoRMU(size);
void DoROL(size);
void DoROR(size);
void DoRTT(void);
void DoSAR(size);
void DoSBF(size);
void DoSBI(size);
void DoSBS(size);
void DoSBU(size);
void DoSDE(unsigned long);
void DoSDF(long);
void DoSDL(long);
void DoSET(size);
void DoSIG(void);
void DoSIL(long);
void DoSIM(void);
void DoSLI(size);
void DoSLU(size);
void DoSRI(size);
void DoSRU(size);
void DoSTE(unsigned long);
void DoSTF(long);
void DoSTI(size);
void DoSTL(long);
void DoSTR(long);
void DoSTS(size);
void DoTEQ(void);
void DoTGE(void);
void DoTGT(void);
void DoTLE(void);
void DoTLT(void);
void DoTNE(void);
void DoTRP(void);
void DoXOR(size);
void DoZEQ(long);
void DoZER(size);
void DoZGE(long);
void DoZGT(long);
void DoZLE(long);
void DoZLT(long);
void DoZNE(long);
void DoZRE(long);
void DoZRF(size);
void DoZRL(long);
#endif /* SWITCH_H_ */