Skip to content

Commit

Permalink
- Got rid of more compiler warnings.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11500 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Mar 22, 2012
1 parent b671be5 commit a4da03b
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 42 deletions.
6 changes: 3 additions & 3 deletions SimulationRuntime/c/ModelicaExternalC/tables.c
Expand Up @@ -361,7 +361,7 @@ char readChr(const char **ptr, size_t *len, char chr)
return 1;
}

char parseHead(TEXT_FILE *f, const char* hdr, size_t hdrLen, char **name,
char parseHead(TEXT_FILE *f, const char* hdr, size_t hdrLen, const char **name,
size_t *rows, size_t *cols)
{
char* endptr;
Expand Down Expand Up @@ -461,7 +461,7 @@ size_t Text_readLine(TEXT_FILE *f, char **data, size_t *size)
char Text_findTable(TEXT_FILE *f, const char* tableName, size_t *cols, size_t *rows)
{
char *strLn=0;
char *tblName=0;
const char *tblName=0;
int ch=0;
size_t buflen=0;
size_t _cols = 0;
Expand Down Expand Up @@ -882,7 +882,7 @@ void csv_readTable(CSV_FILE *f, const char *tableName, double *data, size_t rows
for (col=0;col<cols;col++)
{
data[row*cols+col] = strtod(number,&entp);
trim(&entp,&lh);
trim((const char**)&entp,&lh);
number = entp+1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/c/math-support/dpmpar.c
Expand Up @@ -19,8 +19,8 @@ doublereal dpmpar_(integer *i__)
static struct {
doublereal e_1[3];
doublereal fill_2[1];
} equiv_2 = { 2.22044604926e-16, 2.22507385852e-308,
1.79769313485e308 };
} equiv_2 = {{ 2.22044604926e-16, 2.22507385852e-308,
1.79769313485e308 }};


/* System generated locals */
Expand Down Expand Up @@ -191,7 +191,7 @@ doublereal dpmpar_(integer *i__)
/* Machine constants for IEEE machines. */


ret_val = dmach[(0 + (0 + (*i__ - 1 << 3))) / 8];
ret_val = dmach[(0 + (0 + ((*i__ - 1) << 3))) / 8];
return ret_val;

/* Last card of function dpmpar. */
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/math-support/enorm.c
Expand Up @@ -23,7 +23,7 @@ doublereal enorm_(integer *n, doublereal *x)

/* System generated locals */
integer i__1;
doublereal ret_val, d__1;
doublereal ret_val = 0., d__1;

/* Builtin functions */
double sqrt(doublereal);
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/c/math-support/initialization.c
Expand Up @@ -81,7 +81,7 @@ enum INIT_INIT_METHOD
{
IIM_UNKNOWN = 0,
IIM_NONE,
IIM_STATE,
IIM_STATE
};

const char *initMethodStr[3] = {"unknown", "none", "state"};
Expand Down Expand Up @@ -1132,7 +1132,7 @@ static int state_initialization(DATA *data, int optiMethod, int updateStartValue
*
* \author lochel
*/
const char* mapToDymolaVars(const char* varname)
char* mapToDymolaVars(const char* varname)
{
unsigned int varnameSize = strlen(varname);
unsigned int level = 0;
Expand Down Expand Up @@ -1195,7 +1195,7 @@ static int importStartValues(DATA *data, const char* pInitFile, double initTime)
ModelicaMatReader reader;
ModelicaMatVariable_t *pVar = NULL;
const char *pError = NULL;
const char* newVarname = NULL;
char* newVarname = NULL;

MODEL_DATA *mData = &(data->modelData);
long i;
Expand Down
8 changes: 4 additions & 4 deletions SimulationRuntime/c/math-support/lsame.c
Expand Up @@ -86,12 +86,12 @@ logical lsame_(char *ca, char *cb, ftnlen ca_len, ftnlen cb_len)
/* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or */
/* upper case 'Z'. */

if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta
>= 162 && inta <= 169) {
if ((inta >= 129 && inta <= 137) || (inta >= 145 && inta <= 153) || (inta
>= 162 && inta <= 169)) {
inta += 64;
}
if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb
>= 162 && intb <= 169) {
if ((intb >= 129 && intb <= 137) || (intb >= 145 && intb <= 153) || (intb
>= 162 && intb <= 169)) {
intb += 64;
}

Expand Down
11 changes: 6 additions & 5 deletions SimulationRuntime/c/meta/gc/common.h
Expand Up @@ -187,14 +187,15 @@ modelica_metatype list_get(mmc_GC_free_list_type* free, size_t size);
/***********************************************************************/
/***********************************************************************/


//struct mmc_GC_local_state_type /* the structure of local GC state that is saved on stack */
/*
//struct mmc_GC_local_state_type // the structure of local GC state that is saved on stack
//{
// const char* functionName; /* the function name */
// size_t rootsMark; /* the roots mark */
// size_t rootsStackIndex; /* the index in the mark stack (basically the depth) */
// const char* functionName; // the function name
// size_t rootsMark; // the roots mark
// size_t rootsStackIndex; // the index in the mark stack (basically the depth)
//};
//typedef struct mmc_GC_local_state_type mmc_GC_local_state_type;
*/

#define mmc_GC_local_state_type size_t

Expand Down
28 changes: 14 additions & 14 deletions SimulationRuntime/c/meta/gc/generational.c
Expand Up @@ -81,7 +81,7 @@

#include "generational.h"

//#undef NDEBUG
/*#undef NDEBUG*/
#include <assert.h>

#define MMC_CLOCKS_PER_SEC 1000 /* milliseconds */
Expand Down Expand Up @@ -241,16 +241,16 @@ void mmc_free_c_heap_region(void) {
return;
++mmc_c_heap_collect_count;
while (current != NULL) {
// set to zero!
//mmc_free_core(current->region, current->size);
/* set to zero!*/
/*mmc_free_core(current->region, current->size);*/
current->next = current->region;
current->limit = current->next;
//tmp = current;
/*tmp = current;*/
current = current->next_region;
//free(tmp);
/*free(tmp);*/
}
/* allocate a new C managed heap for the next round */
//mmc_c_heap = mmc_alloc_c_heap_region(MMC_C_HEAP_REGION_SIZE);
/*mmc_c_heap = mmc_alloc_c_heap_region(MMC_C_HEAP_REGION_SIZE);*/
mmc_c_heap_region_total_size = 0;
mmc_string_cache_index = 0;
allocatedInCHeap = 0;
Expand Down Expand Up @@ -400,7 +400,7 @@ static INLINE void **mmc_forward_vec(void **scan, mmc_uint_t nwords, void **next
assert(mmc_isYoungOrOlder(old));
if (!mmc_isYoungOrOlder(old))
{
fprintf(stderr, "slots: %lu p: %p nwords: %lu\n", hdr, old, nwords); fflush(stderr);
fprintf(stderr, "slots: %lu p: %p nwords: %lu\n", hdr, *old, nwords); fflush(stderr);
}
/* reuse `hdr' as `#slots' */
*next++ = *old++;
Expand Down Expand Up @@ -474,14 +474,14 @@ static void **mmc_collect(void **scan, char *region_low, mmc_uint_t region_nbyte
++scan; /* since slots doesn't include the header itself */
if (MMC_HDRHASPTRS(hdr))
{
//if (slots > 0 && ctor != MMC_ARRAY_TAG && ctor > 1) /* RECORD */
//{
// start = 1; /* ignore the fields slot! */
//}
//else
// start = 0; /* do NOT ignore the fields slot! */
/*if (slots > 0 && ctor != MMC_ARRAY_TAG && ctor > 1)*/ /* RECORD */
/*{*/
/* start = 1;*/ /* ignore the fields slot! */
/*}*/
/*else*/
/* start = 0; */ /* do NOT ignore the fields slot! */

//assert(slots > start);
/*assert(slots > start);*/
next = mmc_forward_vec(scan, slots, next, region_low, region_nbytes);
}
scan += slots;
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/c/meta/gc/roots.h
Expand Up @@ -81,11 +81,11 @@ mmc_GC_roots_type roots_decrease(mmc_GC_roots_type roots, size_t default_roots_s
void mmc_GC_add_roots_fallback(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);
/*mmc_GC_local_state_type mmc_GC_save_roots_state(const char* name);*/
/* remove the current roots mark */
//int mmc_GC_undo_roots_state(mmc_GC_local_state_type local_GC_state);
/*int mmc_GC_undo_roots_state(mmc_GC_local_state_type local_GC_state);*/
/* unwind to current function */
//int mmc_GC_unwind_roots_state(mmc_GC_local_state_type local_GC_state);
/*int mmc_GC_unwind_roots_state(mmc_GC_local_state_type local_GC_state);*/

#define mmc_GC_save_roots_state(name) (mmc_GC_state->roots.current)
#define mmc_GC_undo_roots_state(local_GC_state) (mmc_GC_state->roots.current = local_GC_state);
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/meta/realString.c
Expand Up @@ -215,7 +215,7 @@ modelica_string _old_realString(modelica_real r)
* Add safety margin in case some C runtime is trigger happy. */
static char buffer[32];
modelica_string res;
// fprintf(stderr, "\nrealString(%g)\n", r);
/* fprintf(stderr, "\nrealString(%g)\n", r);*/
if (isinf(r) && r < 0)
res = MMC_REFSTRINGLIT(_OMC_LIT_NEG_INF);
else if (isinf(r))
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/daux.c
Expand Up @@ -176,7 +176,7 @@ integer i1mach_(integer *i__)
static integer sanity = 987;
static struct {
integer e_1[16];
} equiv_0 = { 5, 6, 7, 6, 32, 4, 2, 31, 2147483647, 2, 24, -125, 128, 53, -1021, 1024 };
} equiv_0 = {{ 5, 6, 7, 6, 32, 4, 2, 31, 2147483647, 2, 24, -125, 128, 53, -1021, 1024 }};


/* Format strings */
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/ddassl.c
Expand Up @@ -4354,7 +4354,7 @@ doublereal ddanrm_(integer *neq, doublereal *v, doublereal *wt, doublereal *
/* CONTROL FLAG IS SET FOR RECOVERY, THEN RETURN. */

/* L30: */
if (*level <= 0 || *level == 1 && mkntrl <= 1) {
if (*level <= 0 || (*level == 1 && mkntrl <= 1)) {
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/util/modelinfo.c
Expand Up @@ -336,8 +336,8 @@ int printModelInfo(DATA *data, const char *filename, const char *plotfile, const

fclose(fout);
if (plotCommands) {
char *omhome;
char *buf;
char *omhome = NULL;
char *buf = NULL;
int genHtmlRes;
omhome = getenv("OPENMODELICAHOME");
buf = (char*)malloc(230 + 2*strlen(plotfile) + 2*(omhome ? strlen(omhome) : 0));
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/util/string_array.c
Expand Up @@ -938,7 +938,7 @@ void convert_alloc_string_array_from_f77(const string_array_t * a,
transpose_string_array(a, dest);
}

void fill_alloc_string_array(string_array_t* dest, modelica_string value, int ndims, ...)
void fill_alloc_string_array(string_array_t* dest, modelica_string_t value, int ndims, ...)
{
size_t i;
size_t elements = 0;
Expand Down

0 comments on commit a4da03b

Please sign in to comment.