Move code in src

This commit is contained in:
angt
2015-11-11 09:14:35 +01:00
parent e122d76a32
commit 9cf4c97468
7 changed files with 3 additions and 3 deletions

26
src/common.h Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include <stdlib.h>
#include <stdint.h>
#define COUNT(x) (sizeof(x)/sizeof(x[0]))
#define ALIGN_SIZE (1<<4)
#define ALIGN_MASK (ALIGN_SIZE-1)
#define ALIGN(x) (((x)+ALIGN_MASK)&~ALIGN_MASK)
#define ALIGN_DOWN(x) ((x)&~ALIGN_MASK)
#define PALIGN(x) ((void *)ALIGN((size_t)(x)))
#define PALIGN_DOWN(x) ((void *)ALIGN_DOWN((size_t)(x)))
#define _unused_ __attribute__((unused))
typedef struct buffer buffer_t;
struct buffer {
uint8_t *data;
uint8_t *read;
uint8_t *write;
uint8_t *end;
};