Browse Source

PM_ExportVector.cc: Fix export_string format string to get correct output for state rewards export (issue #16)

Fixes https://github.com/prismmodelchecker/prism/issues/16.

In SVN commit 12019 (1d8f9fc6b9),
we converted the ODD indizes from long to int64_t to get the same size in 32/64bit on Linux / OS X and Windows.

With this change, the format string used here became incorrect and, on 32bit Linux, the second "%.0f" printing takes
its value from part of the first argument instead of from the double returned by DD_GetNumMinterms.

Now, we use the PRId64 macro to get the correct format string parameter.


git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@12177 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 9 years ago
parent
commit
c6fa9d2d43
  1. 4
      prism/src/mtbdd/PM_ExportVector.cc

4
prism/src/mtbdd/PM_ExportVector.cc

@ -66,8 +66,8 @@ jstring fn // filename
// print file header
switch (export_type) {
case EXPORT_PLAIN: export_string("%d %.0f\n", odd->eoff+odd->toff, DD_GetNumMinterms(ddman, vector, num_vars)); break;
case EXPORT_MATLAB: export_string("%s = sparse(%d,1);\n", export_name, odd->eoff+odd->toff); break;
case EXPORT_PLAIN: export_string("%" PRId64 " %.0f\n", odd->eoff+odd->toff, DD_GetNumMinterms(ddman, vector, num_vars)); break;
case EXPORT_MATLAB: export_string("%s = sparse(%" PRId64 ",1);\n", export_name, odd->eoff+odd->toff); break;
}
// print main part of file

Loading…
Cancel
Save