changeset 31423:fcd4bc97f5f7

rename internal variable for storing PCRE compiled regexp info * lo-regexp.h, lo-regexp.cc (regexp::m_code): Rename from m_data.
author Rafael Laboissiere <rafael@laboissiere.net>
date Fri, 11 Nov 2022 15:40:45 -0500
parents ff5bac1b9372
children d1165473e4b0
files liboctave/util/lo-regexp.cc liboctave/util/lo-regexp.h
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/lo-regexp.cc	Thu Nov 10 05:30:42 2022 -0300
+++ b/liboctave/util/lo-regexp.cc	Fri Nov 11 15:40:45 2022 -0500
@@ -64,8 +64,8 @@
   void
   regexp::free (void)
   {
-    if (m_data)
-      pcre_free (static_cast<pcre *> (m_data));
+    if (m_code)
+      pcre_free (static_cast<pcre *> (m_code));
   }
 
   void
@@ -239,10 +239,10 @@
          | (m_options.freespacing () ? PCRE_EXTENDED : 0)
          | PCRE_UTF8);
 
-    m_data = pcre_compile (buf_str.c_str (), pcre_options,
+    m_code = pcre_compile (buf_str.c_str (), pcre_options,
                            &err, &erroffset, nullptr);
 
-    if (! m_data)
+    if (! m_code)
       (*current_liboctave_error_handler)
         ("%s: %s at position %d of expression", m_who.c_str (), err, erroffset);
   }
@@ -266,7 +266,7 @@
     char *nametable;
     std::size_t idx = 0;
 
-    pcre *re = static_cast<pcre *> (m_data);
+    pcre *re = static_cast<pcre *> (m_code);
 
     pcre_fullinfo (re, nullptr, PCRE_INFO_CAPTURECOUNT,  &subpatterns);
     pcre_fullinfo (re, nullptr, PCRE_INFO_NAMECOUNT, &namecount);
--- a/liboctave/util/lo-regexp.h	Thu Nov 10 05:30:42 2022 -0300
+++ b/liboctave/util/lo-regexp.h	Fri Nov 11 15:40:45 2022 -0500
@@ -51,7 +51,7 @@
     regexp (const std::string& pat = "",
             const regexp::opts& opt = regexp::opts (),
             const std::string& w = "regexp")
-      : m_pattern (pat), m_options (opt), m_data (nullptr), m_named_pats (),
+      : m_pattern (pat), m_options (opt), m_code (nullptr), m_named_pats (),
         m_names (0), m_named_idx (), m_who (w)
     {
       compile_internal ();
@@ -225,7 +225,7 @@
     opts m_options;
 
     // Internal data describing the regular expression.
-    void *m_data;
+    void *m_code;
 
     string_vector m_named_pats;
     int m_names;