Hoist argcount() into its own header file
Muffles compiler warnings about unused function.
This commit is contained in:
parent
2610213b42
commit
99feb308bd
|
@ -0,0 +1,6 @@
|
|||
static void argcount(char *fname, uint32_t nargs, uint32_t c)
|
||||
{
|
||||
if (__unlikely(nargs != c))
|
||||
lerrorf(ArgError, "%s: too %s arguments", fname,
|
||||
nargs < c ? "few" : "many");
|
||||
}
|
|
@ -33,6 +33,8 @@
|
|||
|
||||
#include "flisp.h"
|
||||
|
||||
#include "argcount.h"
|
||||
|
||||
size_t llength(value_t v)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
|
|
@ -62,7 +62,9 @@
|
|||
#include "ieee754.h"
|
||||
|
||||
#include "flisp.h"
|
||||
|
||||
#include "opcodes.h"
|
||||
#include "argcount.h"
|
||||
|
||||
static char *builtin_names[] = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
@ -924,7 +926,6 @@ no_kw:
|
|||
return nargs;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__amd64__) || defined(_M_AMD64)
|
||||
#define ARCH_X86_64
|
||||
#define __CPU__ 686
|
||||
|
|
|
@ -201,12 +201,6 @@ void bounds_error(char *fname, value_t arr, value_t ind)
|
|||
__attribute__((__noreturn__));
|
||||
extern value_t ArgError, IOError, KeyError, MemoryError, EnumerationError;
|
||||
extern value_t UnboundError;
|
||||
static void argcount(char *fname, uint32_t nargs, uint32_t c)
|
||||
{
|
||||
if (__unlikely(nargs != c))
|
||||
lerrorf(ArgError, "%s: too %s arguments", fname,
|
||||
nargs < c ? "few" : "many");
|
||||
}
|
||||
|
||||
struct cvtable {
|
||||
void (*print)(value_t self, struct ios *f);
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "flisp.h"
|
||||
|
||||
#include "argcount.h"
|
||||
|
||||
static value_t iostreamsym, rdsym, wrsym, apsym, crsym, truncsym;
|
||||
static value_t instrsym, outstrsym;
|
||||
struct fltype *iostreamtype;
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include "flisp.h"
|
||||
|
||||
#include "argcount.h"
|
||||
|
||||
value_t fl_stringp(value_t *args, uint32_t nargs)
|
||||
{
|
||||
argcount("string?", nargs, 1);
|
||||
|
|
Loading…
Reference in New Issue