Skip to content

Commit

Permalink
- Fix some gcc warnings for mmc_mk_bcon, etc
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7682 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 12, 2011
1 parent 2d5115f commit 94241c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions c_runtime/meta_modelica.c
Expand Up @@ -40,7 +40,7 @@ void *mmc_alloc_bytes(unsigned nbytes)
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=256*1024*1024; /* 256MB chunks */
void *p;
void *p=0;
/* fprintf(stderr, "1 mmc_alloc_bytes(%ld): %ld,%ld\n", nbytes, mmc_cur_malloc_buf, mmc_cur_malloc_buf_ix); */
if (mmc_cur_malloc_buf == NULL || nbytes>(mmc_cur_malloc_buf_sz-mmc_cur_malloc_buf_ix)) {
if ( (mmc_cur_malloc_buf = malloc(mmc_cur_malloc_buf_sz)) == 0 ) {
Expand All @@ -54,9 +54,9 @@ void *mmc_alloc_bytes(unsigned nbytes)
p = mmc_cur_malloc_buf + mmc_cur_malloc_buf_ix;

/* Force 16-byte alignment, like malloc... TODO: Check if this is needed :) */
mmc_cur_malloc_buf_ix += nbytes; // + ((nbytes%16) ? 16-(nbytes%16): 0);
mmc_cur_malloc_buf_ix += nbytes; /* + ((nbytes%16) ? 16-(nbytes%16): 0); */

// fprintf(stderr, "2 mmc_alloc_bytes(%ld): %ld,%ld => %ld\n", nbytes, mmc_cur_malloc_buf, mmc_cur_malloc_buf_ix, p);
/* fprintf(stderr, "2 mmc_alloc_bytes(%ld): %ld,%ld => %ld\n", nbytes, mmc_cur_malloc_buf, mmc_cur_malloc_buf_ix, p); */
return p;
}

Expand Down
2 changes: 1 addition & 1 deletion c_runtime/meta_modelica.h
Expand Up @@ -150,7 +150,7 @@ static void *mmc_alloc_words(unsigned nwords)

#define MMC_FALSE (mmc_mk_icon(0))
#define MMC_TRUE (mmc_mk_icon(1))
#define mmc_mk_bcon(X) (X != 0 ? MMC_TRUE : MMC_FALSE)
#define mmc_mk_bcon(X) ((X) != 0 ? MMC_TRUE : MMC_FALSE)

static inline void* mmc_mk_icon(mmc_sint_t i)
{
Expand Down

0 comments on commit 94241c8

Please sign in to comment.