Skip to content

Rf/macos compile errors

Paul McCarthy requested to merge rf/macos-compile-errors into master

While compiling on macOS using a conda-forge-provided compiler, I encountered the following error:

streamlines.cc:804:23: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing]
          float line[2][3]={{m_path[cnt-1](1),m_path[cnt-1](2),m_path[cnt-1](3)},
                             ^~~~~~~~~~~~~~~~
streamlines.cc:804:23: note: insert an explicit cast to silence this issue
          float line[2][3]={{m_path[cnt-1](1),m_path[cnt-1](2),m_path[cnt-1](3)},
                             ^~~~~~~~~~~~~~~~
                             static_cast<float>( )

This MR adds a number of explicit casts to avoid this error, and also adjusts the indentation within streamlines.cc to be more consistent.

Merge request reports