Skip to content

Commit 67c8c8e

Browse files
committed
Fix warnings
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16206 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 4107100 commit 67c8c8e

File tree

1 file changed

+2
-9
lines changed
  • SimulationRuntime/c/ModelicaExternalC

1 file changed

+2
-9
lines changed

SimulationRuntime/c/ModelicaExternalC/tables.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <math.h>
3838

3939
#include "../omc_inline.h"
40+
#include "../util/ModelicaUtilities.h"
4041
#ifdef _MSC_VER
4142
#include "../util/omc_msvc.h"
4243
#endif
@@ -432,7 +433,6 @@ static char parseHead(TEXT_FILE *f, const char* hdr, size_t hdrLen, const char *
432433

433434
static size_t Text_readLine(TEXT_FILE *f, char **data, size_t *size)
434435
{
435-
char *tmp = NULL;
436436
size_t col = 0;
437437
size_t i = 0;
438438
int ch = 0;
@@ -475,11 +475,9 @@ static char Text_findTable(TEXT_FILE *f, const char* tableName, size_t *cols, si
475475
{
476476
char *strLn=0;
477477
const char *tblName=0;
478-
int ch=0;
479478
size_t buflen=0;
480479
size_t _cols = 0;
481480
size_t _rows = 0;
482-
size_t i=0;
483481
size_t col = 0;
484482

485483
while(!feof(f->fp))
@@ -515,7 +513,6 @@ static void Text_readTable(TEXT_FILE *f, double *buf, size_t rows, size_t cols)
515513
char *strLn=0;
516514
size_t buflen=0;
517515
size_t sl=0;
518-
size_t nlen=0;
519516
char *number=0;
520517
char *entp = 0;
521518
for(i = 0; i < rows; ++i)
@@ -606,6 +603,7 @@ static size_t Mat_getTypeSize(MAT_FILE *f, long type)
606603
default:
607604
fclose(f->fp);
608605
ModelicaFormatError("Corrupted MAT-file: `%s'",f->filename);
606+
return 0; /* Cannot reach this */
609607
}
610608
}
611609

@@ -783,7 +781,6 @@ static void csv_close(CSV_FILE *f)
783781

784782
static size_t csv_readLine(CSV_FILE *f, char **data, size_t *size)
785783
{
786-
char *tmp = NULL;
787784
size_t col = 0;
788785
size_t i = 0;
789786
int ch = 0;
@@ -884,7 +881,6 @@ static char csv_findTable(CSV_FILE *f, const char *tableName, size_t *cols, size
884881

885882
static void csv_readTable(CSV_FILE *f, const char *tableName, double *data, size_t rows, size_t cols)
886883
{
887-
char stop=0;
888884
char *strLn=NULL;
889885
size_t buflen=0;
890886
size_t c=0;
@@ -929,7 +925,6 @@ static void csv_readTable(CSV_FILE *f, const char *tableName, double *data, size
929925
*/
930926
static void openFile(const char *filename, const char* tableName, size_t *rows, size_t *cols, double **data)
931927
{
932-
size_t i = 0;
933928
size_t sl = 0;
934929
char filetype[5] = {0};
935930
/* get File Type */
@@ -1029,7 +1024,6 @@ static InterpolationTable* InterpolationTable_init(double time, double startTime
10291024
int tableDim2, int colWise)
10301025
{
10311026
size_t i=0;
1032-
size_t l=0;
10331027
size_t size = tableDim1*tableDim2;
10341028
InterpolationTable *tpl = 0;
10351029
tpl = (InterpolationTable*)calloc(1,sizeof(InterpolationTable));
@@ -1206,7 +1200,6 @@ static InterpolationTable2D* InterpolationTable2D_init(int ipoType, const char*
12061200
int tableDim1, int tableDim2, int colWise)
12071201
{
12081202
size_t i=0;
1209-
size_t l=0;
12101203
size_t size = tableDim1*tableDim2;
12111204
InterpolationTable2D *tpl = 0;
12121205
tpl = (InterpolationTable2D*)calloc(1,sizeof(InterpolationTable2D));

0 commit comments

Comments
 (0)