Skip to content

Commit

Permalink
rstan: io: Fix type conversion warning
Browse files Browse the repository at this point in the history
```c++
Found the following significant warnings:
  ../inst/include/rstan/io/r_ostream.hpp:48:20: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
  ../inst/include/rstan/io/r_ostream.hpp:71:21: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
```
  • Loading branch information
hsbadr committed Dec 10, 2023
1 parent 59f4c2c commit f229fdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rstan/rstan/inst/include/rstan/io/r_ostream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace rstan {
}

virtual std::streamsize xsputn(const char_type* s, std::streamsize n) {
Rprintf("%.*s", n, s);
Rprintf("%.*s", static_cast<int>(n), s);
return n;
}
};
Expand All @@ -68,7 +68,7 @@ namespace rstan {
}

virtual std::streamsize xsputn(const char_type* s, std::streamsize n) {
REprintf("%.*s", n, s);
REprintf("%.*s", static_cast<int>(n), s);
return n;
}
};
Expand Down

0 comments on commit f229fdd

Please sign in to comment.