Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
unsafe.qh
Go to the documentation of this file.
1#pragma once
2
3#define reinterpret_cast(T, it) _unsafe_cast_##T(0, it)
4#define X(T) \
5 T _unsafe_cast_##T(int dummy, ...) { return ...(0, T); } \
6 USING(T##_fld, .T); T##_fld _unsafe_cast_##T##_fld(int dummy, ...) { return ...(0, T##_fld); }
7X(bool)
8X(int)
9X(float)
10X(vector)
11X(entity)
12X(string)
13USING(rawfunc, float(...));
14X(rawfunc)
15#undef X
16
17#define _strid(s) ITOF(reinterpret_cast(int, s))
18#define strid(s) stof(sprintf("%i", s))
19
20.int _unsafe_fld1, _unsafe_fld2;
22
23#define FTOI(f) ((f) * INTEGER_ONE)
24#define ITOF(i) ((i) / INTEGER_ONE)
25
30
31#define ARRAY_INDEX(T, arr, idx) (reinterpret_cast(T##_fld, reinterpret_cast(int, arr[0]) + FTOI(idx)))
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define USING(name, T)
Definition _all.inc:72
vector
Definition self.qh:92
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
#define reinterpret_cast(T, it)
Definition unsafe.qh:3
#define X(T)
Definition unsafe.qh:4
_unsafe_fld2
Definition unsafe.qh:20
int INTEGER_ONE
Definition unsafe.qh:21