diff options
author | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-18 03:02:13 -0700 |
---|---|---|
committer | Tushar Gohad <tushar.gohad@intel.com> | 2014-07-18 03:02:13 -0700 |
commit | 901c37cee613c21b77d595931e56f08179607022 (patch) | |
tree | 067201e12b1166870b62caf1495435eadb169c7f /include/erasurecode | |
parent | ca04a8625db8390b2f6cb0a536e2ede4c2512d9d (diff) | |
download | liberasurecode-901c37cee613c21b77d595931e56f08179607022.tar.gz |
Rename header magic macro
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
Diffstat (limited to 'include/erasurecode')
-rw-r--r-- | include/erasurecode/erasurecode_helpers.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/erasurecode/erasurecode_helpers.h b/include/erasurecode/erasurecode_helpers.h index 8265bdc..9b1fc2b 100644 --- a/include/erasurecode/erasurecode_helpers.h +++ b/include/erasurecode/erasurecode_helpers.h @@ -34,10 +34,6 @@ /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ -#define PYECC_HEADER_MAGIC 0xb0c5ecc - -#define talloc(type, num) (type *) malloc(sizeof(type) * (num)) - #if __STDC_VERSION__ < 199901L #if __GNUC__ >= 2 #define __func__ __FUNCTION__ @@ -49,9 +45,12 @@ #define log_error(str) \ fprintf(stderr, "%s:%d (%s): %s\n", __FILE__, __LINE__, __func__, str) -/* - * Prevent the compiler from padding - * this by using the __packed__ keyword +/* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ + +/** + * liberasurecode fragment header definition + * + * Prevent the compiler from padding this by using the __packed__ keyword */ typedef struct __attribute__((__packed__)) fragment_header_s { @@ -66,8 +65,12 @@ typedef struct __attribute__((__packed__)) fragment_header_s uint32_t aligned_padding[3]; } fragment_header_t; +#define LIBERASURECODE_FRAG_HEADER_MAGIC 0xb0c5ecc + /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ +#define talloc(type, num) (type *) malloc(sizeof(type) * (num)) + /* Determine if an address is aligned to a particular boundary */ static inline int is_addr_aligned(unsigned long addr, int align) @@ -122,7 +125,7 @@ void init_fragment_header(char *buf) { fragment_header_t *header = (fragment_header_t *) buf; - header->magic = PYECC_HEADER_MAGIC; + header->magic = LIBERASURECODE_FRAG_HEADER_MAGIC; } /* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */ |