summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Lambert <eric_lambert@xyratex.com>2014-06-26 13:48:17 -0700
committerEric Lambert <eric_lambert@xyratex.com>2014-06-26 13:48:17 -0700
commita5440dac2c02abd588167086045a66a98fb6cd5f (patch)
tree90ef462fd937d950170d93ac3255e8066462ea7b
parent0e655f6164476034e5a99571ed1a26e646bf487e (diff)
parent89721c5d17616190b79b1d63f7679a63d9d2f306 (diff)
downloadpyeclib-a5440dac2c02abd588167086045a66a98fb6cd5f.tar.gz
Merge branch 'split-libec' of bitbucket.org:kmgreen2/pyeclib into split-libec
-rw-r--r--setup.py4
-rw-r--r--src/c/pyeclib_c/pyeclib_c.c6
-rw-r--r--src/c/pyeclib_c/pyeclib_c.h16
3 files changed, 15 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 279ec2f..1618021 100644
--- a/setup.py
+++ b/setup.py
@@ -125,13 +125,13 @@ class install(_install):
print("***************************************************")
print("** ")
print("** PyECLib libraries have been installed to: ")
- print("** %s/usr/local/lib" % installroot)
+ print("** %susr/local/lib" % installroot)
print("** ")
print("** Any user using this library must update: ")
print("** LD_LIBRARY_PATH ")
print("** ")
print("** The best way to do this is to put this line:")
- print("** export LD_LIBRARY_PATH=%s" % ("%s/usr/local/lib"
+ print("** export LD_LIBRARY_PATH=%s" % ("%susr/local/lib"
% installroot))
print("** ")
print("** into .bashrc, .profile, or the appropriate shell")
diff --git a/src/c/pyeclib_c/pyeclib_c.c b/src/c/pyeclib_c/pyeclib_c.c
index bf0a251..4607ae7 100644
--- a/src/c/pyeclib_c/pyeclib_c.c
+++ b/src/c/pyeclib_c/pyeclib_c.c
@@ -109,7 +109,7 @@ static PyObject * pyeclib_c_check_metadata(PyObject *self, PyObject *args);
/*
* Determine if an address is aligned to a particular boundary
*/
-static int is_addr_aligned(unsigned int addr, int align)
+static int is_addr_aligned(unsigned long addr, int align)
{
return (addr & (align-1)) == 0;
}
@@ -151,10 +151,10 @@ static int validate_args(int k, int m, int w, pyeclib_type_t type)
* Convert an int list into a bitmap
* Assume the list is '-1' terminated.
*/
-static unsigned long convert_list_to_bitmap(int *list)
+static unsigned long long convert_list_to_bitmap(int *list)
{
int i = 0;
- unsigned long bm = 0;
+ unsigned long long bm = 0;
while (list[i] > -1) {
/*
diff --git a/src/c/pyeclib_c/pyeclib_c.h b/src/c/pyeclib_c/pyeclib_c.h
index fdd2f43..75b35aa 100644
--- a/src/c/pyeclib_c/pyeclib_c.h
+++ b/src/c/pyeclib_c/pyeclib_c.h
@@ -27,6 +27,9 @@
#ifndef __PYEC_LIB_C_H_
#define __PYEC_LIB_C_H_
+/* For exact-width integer types */
+#include <stdint.h>
+
/*
* Make sure these enum values match those exposed from the Python EC interface
* src/python/pyeclib/ec_iface.py
@@ -137,14 +140,15 @@ unsigned int get_best_w_for_ecc_type(pyeclib_type_t type)
*/
typedef struct __attribute__((__packed__)) fragment_header_s
{
- int magic;
- int idx;
- int size;
- int orig_data_size;
- int chksum;
+ uint32_t magic;
+ uint32_t idx;
+ uint32_t size;
+ uint32_t orig_data_size;
+ // FIXME - reserve 16-bytes for md5
+ uint32_t chksum;
// We must be aligned to 16-byte boundaries
// So, size this array accordingly
- int aligned_padding[3];
+ uint32_t aligned_padding[3];
} fragment_header_t;
typedef struct fragment_metadata_s