clean up calls.h includes

This commit is contained in:
dzaima 2023-03-26 15:53:04 +03:00
parent 1f70c08aa2
commit 1f2456042c
14 changed files with 15 additions and 22 deletions

View File

@ -1,5 +1,6 @@
#include "../core.h"
#include "../utils/hash.h"
#include "../utils/calls.h"
#include "../utils/mut.h"
#include "../utils/talloc.h"
#include "../builtins.h"

View File

@ -13,7 +13,6 @@
#include "../core.h"
#include "../builtins.h"
#include "../utils/calls.h"
#include "../utils/mut.h"
#if SINGELI_X86_64

View File

@ -291,9 +291,6 @@ B internalTemp_c1(B t, B x) {
return x;
}
#ifdef TEST_MUT
#include "../utils/calls.h"
#endif
B internalTemp_c2(B t, B w, B x) {
#if NATIVE_COMPILER
return c2(native_comp, w, x);

View File

@ -2,6 +2,7 @@
#include "../utils/each.h"
#include "../utils/file.h"
#include "../utils/time.h"
#include "../utils/calls.h"
#include "../builtins.h"

View File

@ -23,7 +23,6 @@
#include "../core.h"
#include "../utils/hash.h"
#include "../utils/talloc.h"
#include "../utils/calls.h"
#define C2i(F, W, X) C2(F, m_i32(W), X)
extern B eq_c2(B,B,B);

View File

@ -1,6 +1,5 @@
#include "../core.h"
#include "../utils/hash.h"
#include "../utils/calls.h"
#include "../utils/file.h"
#include "../utils/wyhash.h"
#include "../utils/time.h"

View File

@ -1,5 +1,6 @@
#include "../core.h"
#include "../utils/mut.h"
#include "../utils/calls.h"
#include "../utils/utf.h"
#include "../utils/talloc.h"
#include "../builtins.h"

View File

@ -31,6 +31,13 @@ static void decSh(Value* x) { if (RARE(PRNK(x)>1)) decShObj(shObjP(x)); }
// some array stuff
typedef void (*M_CopyF)(void*, usz, B, usz, usz);
typedef void (*M_FillF)(void*, usz, B, usz);
extern M_CopyF copyFns[el_MAX];
extern M_FillF fillFns[el_MAX];
#define COPY_TO(WHERE, ELT, MS, X, XS, LEN) copyFns[ELT](WHERE, MS, X, XS, LEN)
#define FILL_TO(WHERE, ELT, MS, X, LEN) fillFns[ELT](WHERE, MS, X, LEN)
#define TYARR_SZ(T,IA) fsizeof(TyArr, a, T##Atom, IA)
#define TYARR_SZ2(T,IA) TYARR_SZ(T,IA)
#define TYARR_SZW(W,IA) (offsetof(TyArr, a) + (W)*(IA))
@ -136,17 +143,11 @@ static bool eqShape(B w, B x) { assert(isArr(w)); assert(isArr(x));
return eqShPart(wsh, xsh, wr);
}
typedef void (*M_CopyF)(void*, usz, B, usz, usz);
typedef void (*M_FillF)(void*, usz, B, usz);
extern M_CopyF copyFns[el_MAX];
extern M_FillF fillFns[el_MAX];
#define COPY_TO(WHERE, ELT, MS, X, XS, LEN) copyFns[ELT](WHERE, MS, X, XS, LEN)
#define FILL_TO(WHERE, ELT, MS, X, LEN) fillFns[ELT](WHERE, MS, X, LEN)
B bit_sel(B b, B e0, B e1); // consumes b; b must be bitarr; b⊏e0‿e1
Arr* allZeroes(usz ia);
Arr* allOnes(usz ia);
B bit_negate(B x); // consumes
void bit_negatePtr(u64* rp, u64* xp, usz count); // count is number of u64-s
B widenBitArr(B x, ur axis); // consumes x, assumes bitarr; returns some array with cell size padded to the nearest of 8,16,32,64 if ≤64 bits, or a multiple of 64 bits otherwise
B narrowWidenedBitArr(B x, ur axis, ur cr, usz* csh); // consumes x.val; undoes widenBitArr, overriding shape past axis to cr↑csh
@ -198,6 +199,9 @@ void fprint_fmt(FILE* f, char* p, ...);
// function stuff
#define C1(F, X) F##_c1(m_f64(0), X)
#define C2(F,W,X) F##_c2(m_f64(0),W,X)
char* type_repr(u8 u);
char* pfn_repr(u8 u);
char* pm1_repr(u8 u);

View File

@ -64,7 +64,6 @@ static NOINLINE i64 readInt(char** p) {
#if USE_REPLXX
#include <replxx.h>
#include <errno.h>
#include "utils/calls.h"
#include "utils/cstr.h"
Replxx* global_replxx;
static char* global_histfile;

View File

@ -4,7 +4,6 @@
#include "builtins.h"
#endif
#include "utils/time.h"
#include "utils/calls.h"
#if defined(RT_WRAP) || defined(WRAP_NNBI)

View File

@ -1,7 +1,6 @@
#pragma once
#define C1(F, X) F##_c1(m_f64(0), X)
#define C2(F,W,X) F##_c2(m_f64(0),W,X)
#define M1C1(M,F, X) m1c1_unsafe(M##_c1, bi_##F, X)
#define M1C2(M,F,W,X) m1c2_unsafe(M##_c2, bi_##F, W, X)
static inline B m1c1_unsafe(D1C1 m, B f, B x) { Md1D d; d.f=f; return m(&d, x); }
@ -35,5 +34,3 @@ extern u8 eqFnData[];
typedef struct { EqFn fn; u8 data; } EqFnObj;
#define EQFN_GET(W_ELT, X_ELT) ({ u8 eqfn_i_ = EQFN_INDEX(W_ELT, X_ELT); (EqFnObj){.fn=eqFns[eqfn_i_], .data=eqFnData[eqfn_i_]}; })
#define EQFN_CALL(FN, W, X, L) (FN).fn(W, X, L, (FN).data)
void bit_negatePtr(u64* rp, u64* xp, usz count); // count is number of u64-s

View File

@ -1,6 +1,5 @@
#include "../core.h"
#include "each.h"
#include "calls.h"
static inline B mv(B* p, usz n) { B r = p [n]; p [n] = m_f64(0); return r; }
static inline B hmv(HArr_p p, usz n) { B r = p.a[n]; p.a[n] = m_f64(0); return r; }

View File

@ -1,5 +1,4 @@
#pragma once
#include "calls.h"
/* Usage:

View File

@ -1,6 +1,5 @@
#include "../core.h"
#include "utf.h"
#include "calls.h"
static i8 utf8lenb(u8 ch) {
if (ch<128) return 1;