Skip to content

Commit

Permalink
Merge pull request twitter#130 from kevyang/129
Browse files Browse the repository at this point in the history
cc_array - stop doing arithmetic on void *
  • Loading branch information
kevyang committed May 16, 2016
2 parents b8af6c0 + 080c41d commit 780941a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/cc_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct array {
uint32_t nalloc; /* # allocated element */
size_t size; /* element size */
uint32_t nelem; /* # element */
void *data; /* elements */
uint8_t *data; /* elements */
};


Expand Down Expand Up @@ -93,7 +93,7 @@ array_data_assign(struct array *arr, uint32_t nalloc, size_t size, void *data)
* element is out of bounds, return -1.
*/
static inline int
array_locate(struct array *arr, void *elem) {
array_locate(struct array *arr, uint8_t *elem) {
int idx;

idx = (elem - arr->data) / arr->size;
Expand Down

0 comments on commit 780941a

Please sign in to comment.