Revert "tests: Update run-make/issue-25581 to reflect how fat pointers are passed."

This reverts commit b12dcdef4f.
This commit is contained in:
Eduard-Mihai Burtescu 2017-11-19 23:38:48 +02:00
parent 89e437354a
commit f9f5ab98b0

View File

@ -2,10 +2,15 @@
#include <stddef.h>
#include <stdint.h>
size_t slice_len(uint8_t *data, size_t len) {
return len;
struct ByteSlice {
uint8_t *data;
size_t len;
};
size_t slice_len(struct ByteSlice bs) {
return bs.len;
}
uint8_t slice_elem(uint8_t *data, size_t len, size_t idx) {
return data[idx];
uint8_t slice_elem(struct ByteSlice bs, size_t idx) {
return bs.data[idx];
}