mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improvements to stringOps format and split functions
- split now optionally retains empty substrings. Added split on fixed field width. - Foam::name() now formats directly into string buffer, which a removes one layer of copying and also avoids using a non-constexpr in the temporary. STYLE: explicit type narrowing on zero-padded output for ensight
This commit is contained in:
@ -59,7 +59,7 @@ Foam::word Foam::ensightCase::options::padded(const label i) const
|
||||
// As per Foam::name, but with fixed length
|
||||
char buf[32];
|
||||
|
||||
::snprintf(buf, 32, printf_.c_str(), i);
|
||||
::snprintf(buf, 32, printf_.c_str(), static_cast<int>(i));
|
||||
buf[31] = 0;
|
||||
|
||||
// no stripping required
|
||||
|
||||
Reference in New Issue
Block a user