comparison liboctave/util/lo-regexp.cc @ 32094:f3d12359f0e4

lo-regexp.cc: Avoid unused variable warning with PCRE2. * liboctave/util/lo-regexp.cc (octave::regexp::match): Avoid warning about set but unused variable when building with PCRE2.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 13 May 2023 15:15:51 +0200
parents 0fe37636be04
children 2e484f9f1f18
comparison
equal deleted inserted replaced
32093:c409e2eeb9c7 32094:f3d12359f0e4
486 std::string match_string = std::string (*listptr, end - start + 1); 486 std::string match_string = std::string (*listptr, end - start + 1);
487 #endif 487 #endif
488 488
489 string_vector tokens (pos_match); 489 string_vector tokens (pos_match);
490 string_vector named_tokens (m_names); 490 string_vector named_tokens (m_names);
491 #if ! defined (HAVE_PCRE2)
491 int pos_offset = 0; 492 int pos_offset = 0;
493 #endif
492 pos_match = 0; 494 pos_match = 0;
493 495
494 for (int i = 1; i < matches; i++) 496 for (int i = 1; i < matches; i++)
495 { 497 {
496 #if defined (HAVE_PCRE2) 498 #if defined (HAVE_PCRE2)
530 tokens(pos_match++) = std::string (buffer.c_str() + ovector[2*i], len); 532 tokens(pos_match++) = std::string (buffer.c_str() + ovector[2*i], len);
531 #else 533 #else
532 tokens(pos_match++) = std::string (*(listptr+i), len); 534 tokens(pos_match++) = std::string (*(listptr+i), len);
533 #endif 535 #endif
534 } 536 }
537 #if ! defined (HAVE_PCRE2)
535 else 538 else
536 pos_offset++; 539 pos_offset++;
540 #endif
537 } 541 }
538 } 542 }
539 543
540 #if ! defined (HAVE_PCRE2) 544 #if ! defined (HAVE_PCRE2)
541 pcre_free_substring_list (listptr); 545 pcre_free_substring_list (listptr);