/+junk/c_sdl_joypad

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad

« back to all changes in this revision

Viewing changes to src/DynamicArray.c

  • Committer: Gustav Hatvigsson
  • Date: 2014-01-29 14:37:25 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140129143725-yan5tlm7mj21a2g1
* Started working on some tests, they do not work... yet.
  I will have to figure out how to do this, it should not be that hard
  :-)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
  return self->len;
38
38
}
39
39
 
 
40
size_t dynamic_array_size (DynamicArray * self) {
 
41
  return self->max_size;
 
42
}
 
43
 
40
44
void dynamic_array_add (DynamicArray * self, void * data) {
41
 
  if (self->len == self->max_size) {
 
45
  if (self->len => self->max_size) {
42
46
    self->array = realloc (self->array, self->max_size + ARRAY_PADDING);
43
47
    self->max_size = self->max_size + ARRAY_PADDING;
44
48
  }