Skip to content

Commit

Permalink
- Reduce the number of warnings clang gives about the GC macros
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10064 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 10, 2011
1 parent 1084a94 commit 90c9352
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions c_runtime/meta/meta_modelica_gc.c
Expand Up @@ -120,7 +120,7 @@ int mmc_GC_clear(void)
}

/* add pointers to roots */
int mmc_GC_add_roots(modelica_metatype* p, int n, mmc_GC_local_state_type local_GC_state, const char* name)
void mmc_GC_add_roots(modelica_metatype* p, int n, mmc_GC_local_state_type local_GC_state, const char* name)
{
int i;
/* init GC if is not already done */
Expand Down Expand Up @@ -185,7 +185,6 @@ int mmc_GC_add_roots(modelica_metatype* p, int n, mmc_GC_local_state_type local_

}

return 0;
}

/* save the current roots mark */
Expand Down Expand Up @@ -878,6 +877,7 @@ void *mmc_alloc_bytes(unsigned nbytes)
static char *mmc_cur_malloc_buf = NULL;
static long mmc_cur_malloc_buf_ix = 0;
/* Until we have GC, we simply allocate in 256MB chunks... */

const long mmc_cur_malloc_buf_sz = (MMC_GC_PAGE_SIZE<nbytes)?(nbytes+MMC_GC_PAGE_SIZE):(MMC_GC_PAGE_SIZE);
void *p=0;
/* fprintf(stderr, "1 mmc_alloc_bytes(%ld): %ld,%ld\n", nbytes, mmc_cur_malloc_buf, mmc_cur_malloc_buf_ix); */
Expand Down
18 changes: 9 additions & 9 deletions c_runtime/meta/meta_modelica_gc.h
Expand Up @@ -116,7 +116,7 @@ int mmc_GC_init_default(void);
int mmc_GC_clear(void);
/* add pointers to roots */
#define mmc_GC_add_root(A,B,C) mmc_GC_add_roots(A,1,B,C)
int mmc_GC_add_roots(modelica_metatype*, int, mmc_GC_local_state_type local_GC_state, const char*);
void mmc_GC_add_roots(modelica_metatype*, int, mmc_GC_local_state_type local_GC_state, const char*);
/* save the current roots mark */
mmc_GC_local_state_type mmc_GC_save_roots_state(const char* name);
/* remove the current roots mark */
Expand All @@ -130,15 +130,15 @@ int mmc_GC_collect(mmc_GC_local_state_type local_GC_state);

extern mmc_GC_local_state_type dummy_local_GC_state;

#define mmc_GC_init(settings) (0)
#define mmc_GC_init_default(void) (0)
#define mmc_GC_clear(void) (0)
#define mmc_GC_add_root(A,B,C) (0)
#define mmc_GC_add_roots(p, n, local_GC_state, name) (0)
#define mmc_GC_init(settings)
#define mmc_GC_init_default(void)
#define mmc_GC_clear(void)
#define mmc_GC_add_root(A,B,C)
#define mmc_GC_add_roots(p, n, local_GC_state, name)
#define mmc_GC_save_roots_state(name) (dummy_local_GC_state)
#define mmc_GC_undo_roots_state(local_GC_state) (0)
#define mmc_GC_unwind_roots_state(local_GC_state) (0)
#define mmc_GC_collect(local_GC_state) (0)
#define mmc_GC_undo_roots_state(local_GC_state)
#define mmc_GC_unwind_roots_state(local_GC_state)
#define mmc_GC_collect(local_GC_state)

#endif /* defined(_MMC_GC_) */

Expand Down

0 comments on commit 90c9352

Please sign in to comment.