Skip to content

Commit

Permalink
- detect header changes in c_runtime (Makefile*)
Browse files Browse the repository at this point in the history
- assert should be based on SIZE_ELEMENTS in size_alloc (memory_pool.c)
- more index elements (memory_pool.h)
- get rid of unused variable warning (real_array.c)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5131 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 12, 2010
1 parent 3fe6515 commit 9f121f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
9 changes: 5 additions & 4 deletions c_runtime/Makefile
Expand Up @@ -53,10 +53,11 @@ endif

all : $(SIMOBJS) $(OBJS) libc_runtime.a libsim.a libf2c/libf2c.a libsendData.a install

#$(SIMOBJS) : $(HFILES) *.c*
#$(OBJS) : $(HFILES) *.c*
# recompile all if a header changes!
$(SIMOBJS) : $(HFILES) *.c*
$(OBJS) : $(HFILES) *.c*

libc_runtime.a : $(OBJS)
libc_runtime.a : $(OBJS) $(HFILES)
$(AR) $@ $(OBJS)


Expand All @@ -67,7 +68,7 @@ install: libc_runtime.a libsim.a libf2c/libf2c.a
cp sendData/release/libsendData.a $(builddir_lib)/
@$(MAKE) -C java_interface -f Makefile || $(MAKE) -C java_interface -f Makefile.omdev.mingw install

libsim.a : $(SIMOBJS)
libsim.a : $(SIMOBJS) $(HFILES)
$(AR) $@ $(SIMOBJS)

libf2c/libf2c.a :
Expand Down
5 changes: 2 additions & 3 deletions c_runtime/memory_pool.c
Expand Up @@ -98,13 +98,12 @@ m_real* real_alloc(int n)
_index_t start;

assert(n>=0);
assert(current_state.real_buffer_ptr +n < NR_REAL_ELEMENTS);
assert(current_state.real_buffer_ptr + n < NR_REAL_ELEMENTS);

start = current_state.real_buffer_ptr;
current_state.real_buffer_ptr += n;
return real_buffer+start;
/*return start;*/

}

/* allocates n integers in the integer_buffer */
Expand Down Expand Up @@ -174,7 +173,7 @@ int** index_alloc(int n)
_index_t start;

assert(n>=0);
assert(n + current_state.index_buffer_ptr < NR_SIZE_ELEMENTS);
assert(n + current_state.index_buffer_ptr < NR_INDEX_ELEMENTS);

start = current_state.index_buffer_ptr;
current_state.index_buffer_ptr += n;
Expand Down
10 changes: 5 additions & 5 deletions c_runtime/memory_pool.h
Expand Up @@ -34,13 +34,13 @@

#include <stdlib.h>

#define NR_REAL_ELEMENTS 1000000
#define NR_REAL_ELEMENTS 1000000
#define NR_INTEGER_ELEMENTS 1000000
#define NR_STRING_ELEMENTS 10000
#define NR_STRING_ELEMENTS 10000
#define NR_BOOLEAN_ELEMENTS 10000
#define NR_SIZE_ELEMENTS 1000000
#define NR_INDEX_ELEMENTS 10000
#define NR_CHAR_ELEMENTS 10000
#define NR_SIZE_ELEMENTS 1000000
#define NR_INDEX_ELEMENTS 1000000
#define NR_CHAR_ELEMENTS 10000

typedef double m_real;
typedef int m_integer;
Expand Down
2 changes: 1 addition & 1 deletion c_runtime/real_array.c
Expand Up @@ -279,7 +279,7 @@ void indexed_assign_real_array(real_array_t* source,
int* idx_vec2;
int* idx_size;
int quit;
int i,j;
int i/*,j*/;
state mem_state;

assert(base_array_ok(source));
Expand Down

0 comments on commit 9f121f1

Please sign in to comment.