mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.43k stars 1.27k forks source link

Fix playlist parser warning with MSVC from VS2022 #13344

Closed JoergAtGithub closed 3 months ago

JoergAtGithub commented 3 months ago

This PR improves the test coverage of the csv parser used for playlists and fixes the following MSVC warnings:

  [412/982] Building CXX object CMakeFiles\mixxx-lib.dir\src\library\parsercsv.cpp.obj
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\optional(864): warning C4018: '<': signed/unsigned mismatch
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\optional(864): note: the template instantiation context (the oldest one first) is
  D:\mixxx-main-worktree\src\library\parsercsv.cpp(66): note: see reference to function template instantiation 'bool std::operator <<unsigned __int64,qsizetype,0>(const std::optional<unsigned __int64> &,const _Ty2 &) noexcept(<expr>)' being compiled
          with
          [
              _Ty2=qsizetype
          ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\optional(866): warning C4018: '<': signed/unsigned mismatch
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\optional(866): note: the template instantiation context (the oldest one first) is
  D:\mixxx-main-worktree\src\library\parsercsv.cpp(66): note: see reference to function template instantiation 'bool std::operator <<unsigned __int64,qsizetype,0>(const std::optional<unsigned __int64> &,const _Ty2 &) noexcept' being compiled
          with
          [
              _Ty2=qsizetype
          ]

Note, that this warning doesn't occur with 2.4 builds.

While extending the test cases, I noticed, that Windows and Unixes behave different in the case, that the location column is not named "Location"

I therefore enhanced the logic for detecting the location column in CSV files. Instead of looking only for the \ path separator on Windows, we now look for the also allowed / too.

JoergAtGithub commented 3 months ago

Yes!