Add initial ARM support, fix bit shifting error.
diff --git a/cper-utils.c b/cper-utils.c
index 61a796a..00581e2 100644
--- a/cper-utils.c
+++ b/cper-utils.c
@@ -36,7 +36,7 @@
json_object* result = json_object_new_object();
for (int i=0; i<num_fields; i++)
{
- json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> (7 - i)) & 0b1));
+ json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> i) & 0b1));
}
return result;
@@ -48,7 +48,7 @@
json_object* result = json_object_new_object();
for (int i=0; i<num_fields; i++)
{
- json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> (31 - i)) & 0b1));
+ json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> i) & 0b1));
}
return result;
@@ -60,7 +60,7 @@
json_object* result = json_object_new_object();
for (int i=0; i<num_fields; i++)
{
- json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> (63 - i)) & 0b1));
+ json_object_object_add(result, names[i], json_object_new_boolean((bitfield >> i) & 0b1));
}
return result;