#ifndef _RESULT_H #define _RESULT_H #ifdef __cplusplus extern "C" { #endif #include typedef int64_t result_t; struct psum { union { struct { result_t forward, up, down; }; result_t _fields[3]; }; }; typedef struct nsum { result_t hoz, depth; } position_t; #ifdef DEBUG static #else extern #endif inline __attribute__((gnu_inline, const)) position_t normalise_position(struct psum p) { return (struct nsum) { .hoz = p.forward, .depth = p.down - p.up, }; } #ifdef __cplusplus } #endif #endif /* _RESULT_H */