DLR-SR / Noise

Modelica library for generating stochastic signals to be included in the Modelica Standard Library
9 stars 11 forks source link

Fixes compilation of C sources on Linux #24

Closed sjoelund closed 10 years ago

sjoelund commented 10 years ago

Also removes unused code according to compiler warnings

tbeu commented 10 years ago

I guess it conflicts with #23.

sjoelund commented 10 years ago

I guess so too. This one keeps using 32-bit integers. But it's mostly the same changes I suppose.

tbeu commented 10 years ago

Yes, #23 compiles fine under Linux

[iti@vm-centos-x64-1 Noise]$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[iti@vm-centos-x64-1 Noise]$ gcc -c -Wall -std=c89 ModelicaNoise.c 
[iti@vm-centos-x64-1 Noise]$ 
tbeu commented 10 years ago

You might test #23 and withdraw this pull request.

sjoelund commented 10 years ago

I would if I had a machine where int was not 32-bit. The code in #23 will not work the same on all platforms.

tbeu commented 10 years ago

I see. Even more issues:

tbeu commented 10 years ago

Check ModelicaMatIO.h:

/* uint32 type */
#define _mat_uint32_t unsigned

I guess you want to change this as well and use stdint types instead.

sjoelund commented 10 years ago

Of course :)

tbeu commented 10 years ago

Mo ticket please. Patch would even be better.

akloeckner commented 10 years ago

@sjoelund, @tbeu: We are not sure, which patch to pull and if there are still issues, which you would like to fix first. Could you clarify or propose a joint patch?

tbeu commented 10 years ago

Sure, we are working on it.

sjoelund commented 10 years ago

23 is now better (works for more compilers)