Blame src/internal/mdso_object_impl.h

5c48f6
/****************************************************************/
5c48f6
/*  mdso: midipix dso scavenger                                 */
5c48f6
/*  Copyright (C) 2015--2017  Z. Gilboa                         */
5c48f6
/*  Released under GPLv2 and GPLv3; see COPYING.MDSO.           */
5c48f6
/****************************************************************/
5c48f6
5c48f6
#include <stdint.h>
5c48f6
5c48f6
static inline void mdso_obj_write_short(unsigned char * ch, uint16_t val)
5c48f6
{
5c48f6
	ch[0] = val;
5c48f6
	ch[1] = val >> 8;
5c48f6
}
5c48f6
5c48f6
static inline void mdso_obj_write_long(unsigned char * ch, uint32_t val)
5c48f6
{
5c48f6
	ch[0] = val;
5c48f6
	ch[1] = val >> 8;
5c48f6
	ch[2] = val >> 16;
5c48f6
	ch[3] = val >> 24;
5c48f6
}
5c48f6
5c48f6
static inline void mdso_obj_write_quad(unsigned char * ch, uint64_t val)
5c48f6
{
5c48f6
	ch[0] = val;
5c48f6
	ch[1] = val >> 8;
5c48f6
	ch[2] = val >> 16;
5c48f6
	ch[3] = val >> 24;
5c48f6
	ch[4] = val >> 32;
5c48f6
	ch[5] = val >> 40;
5c48f6
	ch[6] = val >> 48;
5c48f6
	ch[7] = val >> 56;
5c48f6
}