X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=gmqcc.h;h=88cf7ff21831336c15f1d6d87515af82176fb6f6;hp=48570ff7a6d0aa712385fd84fa98e437a79c877c;hb=e7d1e701c4498040ff77024d76a81cbc178c78f7;hpb=76278e8b97578f210b34784a55925b043098def9 diff --git a/gmqcc.h b/gmqcc.h index 48570ff..88cf7ff 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -1,6 +1,10 @@ #ifndef GMQCC_HDR #define GMQCC_HDR #include +#include +#include +#include +using std::move; #include #include #include @@ -259,7 +263,7 @@ int util_getline(char **, size_t *, FILE *); /* code.c */ /* Note: if you change the order, fix type_sizeof in ir.c */ -enum { +enum qc_type { TYPE_VOID , TYPE_STRING , TYPE_FLOAT , @@ -498,6 +502,10 @@ typedef int32_t qcint_t; typedef uint32_t qcuint_t; struct code_t { + void* operator new(std::size_t); + void operator delete(void*); + code_t(); + ~code_t(); std::vector statements; std::vector linenums; std::vector columnnums; @@ -506,10 +514,10 @@ struct code_t { std::vector functions; std::vector globals; std::vector chars; - uint16_t crc; - uint32_t entfields; + uint16_t crc = 0; + uint32_t entfields = 0; ht string_cache; - qcint_t string_cached_empty; + qcint_t string_cached_empty = 0; }; /* @@ -589,7 +597,7 @@ void compile_show_werrors(void); /* ir.c */ /* TODO: cleanup */ -enum store_types { +enum store_type { store_global, store_local, /* local, assignable for now, should get promoted later */ store_param, /* parameters, they are locals with a fixed position */