Skip to content

Commit

Permalink
Merge pull request #66 from darrenldl/dev
Browse files Browse the repository at this point in the history
Added simd-accel feature testing to .travis.yml, removed use of libc::uint8_t
  • Loading branch information
darrenldl committed Sep 25, 2019
2 parents 72118dc + 4b77509 commit b68f9f3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ branches:

script:
- cargo build --verbose --all
- cargo test --verbose --all
- cargo test --verbose --all --features=simd-accel

env:
global:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 4.0.1
- Updated SIMD C code for Windows compatibility
- Removed include of `unistd.h` in `simd_c/reedsolomon.c`
- Removed GCC `nonnull` attribute in `simd_c/reedsolomon.h`
- See PR #63 #64 for details
- Replaced use of `libc::uint8_t` in `src/galois_8.rs` with `u8`

## 4.0.0
- Major API restructure: removed `Shard` type in favor of generic functions
- The logic of this crate is now generic over choice of finite field
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name= "reed-solomon-erasure"
version = "4.0.0"
version = "4.0.1"
authors = ["Darren Ldl <darrenldldev@gmail.com>"]
edition = "2018"
build = "build.rs"
Expand Down
32 changes: 16 additions & 16 deletions src/galois_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@ fn slice_xor(input: &[u8], out: &mut [u8]) {
))]
extern "C" {
fn reedsolomon_gal_mul(
low: *const libc::uint8_t,
high: *const libc::uint8_t,
input: *const libc::uint8_t,
out: *mut libc::uint8_t,
low: *const u8,
high: *const u8,
input: *const u8,
out: *mut u8,
len: libc::size_t,
) -> libc::size_t;

fn reedsolomon_gal_mul_xor(
low: *const libc::uint8_t,
high: *const libc::uint8_t,
input: *const libc::uint8_t,
out: *mut libc::uint8_t,
low: *const u8,
high: *const u8,
input: *const u8,
out: *mut u8,
len: libc::size_t,
) -> libc::size_t;
}
Expand All @@ -285,13 +285,13 @@ extern "C" {
not(any(target_os = "android", target_os = "ios"))
))]
pub fn mul_slice(c: u8, input: &[u8], out: &mut [u8]) {
let low: *const libc::uint8_t = &MUL_TABLE_LOW[c as usize][0];
let high: *const libc::uint8_t = &MUL_TABLE_HIGH[c as usize][0];
let low: *const u8 = &MUL_TABLE_LOW[c as usize][0];
let high: *const u8 = &MUL_TABLE_HIGH[c as usize][0];

assert_eq!(input.len(), out.len());

let input_ptr: *const libc::uint8_t = &input[0];
let out_ptr: *mut libc::uint8_t = &mut out[0];
let input_ptr: *const u8 = &input[0];
let out_ptr: *mut u8 = &mut out[0];
let size: libc::size_t = input.len();

let bytes_done: usize =
Expand All @@ -306,13 +306,13 @@ pub fn mul_slice(c: u8, input: &[u8], out: &mut [u8]) {
not(any(target_os = "android", target_os = "ios"))
))]
pub fn mul_slice_xor(c: u8, input: &[u8], out: &mut [u8]) {
let low: *const libc::uint8_t = &MUL_TABLE_LOW[c as usize][0];
let high: *const libc::uint8_t = &MUL_TABLE_HIGH[c as usize][0];
let low: *const u8 = &MUL_TABLE_LOW[c as usize][0];
let high: *const u8 = &MUL_TABLE_HIGH[c as usize][0];

assert_eq!(input.len(), out.len());

let input_ptr: *const libc::uint8_t = &input[0];
let out_ptr: *mut libc::uint8_t = &mut out[0];
let input_ptr: *const u8 = &input[0];
let out_ptr: *mut u8 = &mut out[0];
let size: libc::size_t = input.len();

let bytes_done: usize =
Expand Down

0 comments on commit b68f9f3

Please sign in to comment.