profuse/common.h
ksherlock bc7c5d73bb initial checkin
git-svn-id: https://profuse.googlecode.com/svn/trunk@4 aa027e90-d47c-11dd-86d7-074df07e0730
2009-01-01 03:23:02 +00:00

33 lines
474 B
C

/*
* common.h
* ProFUSE
*
* Created by Kelvin Sherlock on 12/20/08.
*
*/
#ifndef __COMMON_H__
#define __COMMON_H__
#include <stdint.h>
#define BLOCK_SIZE 512
inline unsigned load16(const uint8_t *cp)
{
return (cp[1] << 8 ) | cp[0];
}
inline unsigned load24(const uint8_t *cp)
{
return (cp[2] << 16 ) | (cp[1] << 8) | (cp[0]);
}
inline unsigned load32(const uint8_t *cp)
{
return (cp[3] << 24) | (cp[2] << 16 ) | (cp[1] << 8) | (cp[0]);
}
#endif