/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/DynamicArray.c

  • Committer: Gustav Hartvigsson
  • Date: 2017-01-24 20:55:19 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20170124205519-gtr18o3dwbunrrnx
* Fixed the tests in the CMake file
* Made doxygen output static declarations.
* Started work on SApplication
* Played with BaseN.c
  * Now it is a lil' bit better
* Spilt defs.h
  * Added types.h
    * Started work on the full typesystem.
      (Still needs testing)
  * Added primes.[c,h]
    * Contains some static array with primes.
      ("Good" primes, and all primes up to 5 000.
    * And helper functions related to Primes (Needs Tests).
* fixed s_dynamic_array_dump_array.
  (The old version did not make much sense)
* removed some functions from DymanicArray.c
* fixed compiler warnings in Mainloop.c
* removed s_map_(de)serialize_json functions.
* Made s_thread_status_get_name be less prone to error
  (This due to the C11 standard not specifing what these
   values should be)
* fixed s_thread_run
* fixed s_threa_stop

  TODO:
* Write tests for the s_prime_* functions
* Write tests for the s_type_* functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
}
157
157
 
158
158
spointer *
159
 
s_dynamic_array_dump_array (SDynamicArray * self) {
 
159
s_dynamic_array_dump_array (SDynamicArray * self, size_t * out_size) {
160
160
  spointer * ret_val = s_calloc (self->last_item + 1, sizeof (* self->array));
161
 
  for (int i = 0; i <= self->last_item; i++) {
 
161
  
 
162
  for (size_t i = 0; i <= self->last_item; i++) {
162
163
    ret_val[i] = self->array[i];
163
164
  }
164
 
  ret_val[(self->last_item + 1)] = NULL;
 
165
  *out_size = self->last_item + 1;
 
166
  ret_val[*out_size] = NULL;
 
167
  ret_val = s_realloc (ret_val, *out_size * sizeof (* self->array));
165
168
  return ret_val;
166
169
}
167
170