Guest User

diff for debug.cc

a guest
Oct 28th, 2025
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc
  2. index 2fcbc1f510..42434ef4be 100644
  3. --- a/libs/pbd/debug.cc
  4. +++ b/libs/pbd/debug.cc
  5. @@ -26,8 +26,11 @@
  6. #include <map>
  7. #include <vector>
  8. #include <algorithm>
  9. +#include <sstream>
  10.  
  11. -#include <boost/tokenizer.hpp>
  12. +#ifdef PLATFORM_WINDOWS
  13. +#define strncasecmp _strnicmp
  14. +#endif
  15.  
  16. #include "pbd/debug.h"
  17. #include "pbd/error.h"
  18. @@ -130,23 +133,26 @@ int
  19. PBD::parse_debug_options (const char* str)
  20. {
  21. string in_str = str;
  22. - typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
  23. - boost::char_separator<char> sep (",");
  24. - tokenizer tokens (in_str, sep);
  25. + std::vector<std::string> tokens;
  26. + std::stringstream ss(in_str);
  27. + std::string token;
  28. + while (std::getline(ss, token, ',')) {
  29. + tokens.push_back(token);
  30. + }
  31.  
  32. - for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter != tokens.end(); ++tok_iter) {
  33. - if (*tok_iter == "list") {
  34. + for (auto const& tok : tokens) {
  35. + if (tok == "list") {
  36. list_debug_options ();
  37. return 1;
  38. }
  39.  
  40. - if (*tok_iter == "all") {
  41. + if (tok == "all") {
  42. debug_bits.set (); /* sets all bits */
  43. return 0;
  44. }
  45.  
  46. for (map<const char*,DebugBits>::iterator i = _debug_bit_map().begin(); i != _debug_bit_map().end(); ++i) {
  47. - const char* cstr = (*tok_iter).c_str();
  48. + const char* cstr = tok.c_str();
  49.  
  50. if (strncasecmp (cstr, i->first, strlen (cstr)) == 0) {
  51. debug_bits |= i->second;
Advertisement
Add Comment
Please, Sign In to add comment