Changeset 22187
- Timestamp:
- 09/08/08 03:45:51 (3 months ago)
- Location:
- v6/smop
- Files:
-
- 2 modified
-
CMakeLists.txt (modified) (1 diff)
-
src/smop_s1p_array.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/CMakeLists.txt
r22183 r22187 1 1 project (smop) 2 SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_TRACE" ) 2 3 SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) 3 4 cmake_minimum_required (VERSION 2.6) -
v6/smop/src/smop_s1p_array.c
r22183 r22187 42 42 if (new_size > array->size) { 43 43 int old_size = array->size; 44 array->size = 1<<(floor_log2(new_size));44 array->size = new_size; // this looks buggy: 1<<(floor_log2(new_size)); 45 45 //printf("new size:%d resizing to %d previous size:%d\n",new_size,array->size,old_size); 46 array->content = realloc(array->content,array->size); 47 int i;for (i=old_size;i<array->size;i++) array->content[i] = NULL; 46 array->content = realloc(array->content,(array->size * sizeof(void*))); 47 int i; 48 for ( i = old_size ; i < new_size ; i++) { 49 array->content[i] = NULL; 50 } 48 51 } 49 52 }
