diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index 61c80c9c5b822..47a980645f032 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -74,6 +74,7 @@ The `TMVA_SOFIE_GNN` tutorials have been migrated to this workflow and produce i * Including `RConfig.h` and `RVersion.h` is now deprecated and will be removed after ROOT 6.44, use instead `ROOT/RConfig.hxx` and `ROOT/RVersion.hxx`. * The header `Rpair.h` is deprecated and will be removed after ROOT 6.44, use `` instead. * The headers `Htypes.h` and `Gtypes.h` that were deprecated in ROOT 6.20 will now emit warnings and will be fully removed in ROOT 6.44. Use instead `Rtypes.h`. +* The header `Match.h` is deprecated and will be removed in ROOT 6.44, use instead public interface of `TRegExp.h` * The header `GLConstants.h` is no longer part of ROOT installed headers. * The header `PosixThreadInc.h` is deprecated and will be removed after ROOT 6.44. Use instead `` and ``. * The header `RStringView.h` deprecated in ROOT 6.14 will now emit warnings and will be fully removed after ROOT 6.44. Use `ROOT/RStringView.hxx` instead. diff --git a/core/base/inc/Match.h b/core/base/inc/Match.h index f9b08dc31f4b5..c535e8e8f57ea 100644 --- a/core/base/inc/Match.h +++ b/core/base/inc/Match.h @@ -20,6 +20,9 @@ ////////////////////////////////////////////////////////////////////////// #include +#if !defined(ROOT_Match_cxx) && !defined(G__DICTIONARY) +#warning "This header is deprecated and will be removed in ROOT 6.44, use instead public interface of `TRegExp.h`" +#endif typedef unsigned short Pattern_t; diff --git a/core/base/inc/TRegexp.h b/core/base/inc/TRegexp.h index 4604e26f60413..d576f70ebd862 100644 --- a/core/base/inc/TRegexp.h +++ b/core/base/inc/TRegexp.h @@ -23,8 +23,6 @@ #include "Rtypes.h" -#include "Match.h" - class TString; @@ -34,7 +32,7 @@ class TRegexp { enum EStatVal { kOK = 0, kIllegal, kNomem, kToolong }; private: - Pattern_t *fPattern; // Compiled pattern + unsigned short *fPattern; // Compiled pattern EStatVal fStat; // Status static const unsigned fgMaxpat; // Max length of compiled pattern diff --git a/core/base/src/Match.cxx b/core/base/src/Match.cxx index da5226cb608a5..7e26718ffb702 100644 --- a/core/base/src/Match.cxx +++ b/core/base/src/Match.cxx @@ -22,7 +22,7 @@ #include #include - +#define ROOT_Match_cxx #include "Match.h" diff --git a/core/base/src/TRegexp.cxx b/core/base/src/TRegexp.cxx index 27a32c4988da5..1d905bff38ad8 100644 --- a/core/base/src/TRegexp.cxx +++ b/core/base/src/TRegexp.cxx @@ -35,6 +35,8 @@ Warning: The preferred way to use regular expressions is via std::regex. E.g., Index() functions may return incorrect result. */ +#define ROOT_Match_cxx +#include "Match.h" #include "TRegexp.h" #include "TString.h" #include "TError.h" @@ -42,7 +44,7 @@ E.g., Index() functions may return incorrect result. const unsigned TRegexp::fgMaxpat = 2048; - +#include //////////////////////////////////////////////////////////////////////////////// /// Create a regular expression from the input string. If wildcard is @@ -52,6 +54,7 @@ const unsigned TRegexp::fgMaxpat = 2048; TRegexp::TRegexp(const char *re, Bool_t wildcard) { + static_assert(std::is_same_v, Pattern_t>, "Type mismatch in fPattern!"); if (wildcard) GenPattern(MakeWildcard(re)); else diff --git a/core/rint/inc/TTabCom.h b/core/rint/inc/TTabCom.h index b1aa1eba3d2a2..368bda7f4f69b 100644 --- a/core/rint/inc/TTabCom.h +++ b/core/rint/inc/TTabCom.h @@ -218,7 +218,7 @@ class TTabCom { char* fBuf; // initialized by Hook() int* fpLoc; // initialized by Hook() - Pattern_t fPat[ kNUM_PAT ][ MAX_LEN_PAT ]; // array of patterns + unsigned short fPat[ kNUM_PAT ][ MAX_LEN_PAT ]; // array of patterns const char* fRegExp[ kNUM_PAT ]; // corresponding regular expression plain text Bool_t fVarIsPointer; // frodo: pointer or not flag Int_t fLastIter; // frodo: iteration counter for recursive MakeClassFromVarName diff --git a/core/rint/src/TTabCom.cxx b/core/rint/src/TTabCom.cxx index bb3efc749b7a7..31bb80f06fd4a 100644 --- a/core/rint/src/TTabCom.cxx +++ b/core/rint/src/TTabCom.cxx @@ -122,6 +122,9 @@ //////////////////////////////////////////////////////////////////////////// #include "RConfigure.h" +#define ROOT_Match_cxx +#include "Match.h" +#include "TRegexp.h" #include "TTabCom.h" #include "TClass.h" #include "TClassTable.h"