-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix: Suppress -Wshadow warnings in headers on macOS (Fixes #20790) #20793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
34a0eee
d6666b8
aefdf3f
4698a8c
b412441
691cdf1
4442723
696a0d1
c498219
7d9de29
69b37d7
b1debb2
35b15a4
c6d8bf3
18dd104
6fe8064
e24d74e
5075119
3c355c2
bad85c0
f56079d
3f3d0c9
eac1c2b
761e5cb
9da9c3d
424b7b6
0e3588e
32f720e
de93436
1c0fea7
de39f84
dc749f6
d8ca856
c743796
2271329
f553e4a
5031a21
206ad50
dad1300
cbdd1d8
7756fce
1aaf392
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| /************************************************************************* | ||
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | ||
| * All rights reserved. * | ||
| * * | ||
| * * | ||
aryansri05 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * For the licensing terms see $ROOTSYS/LICENSE. * | ||
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | ||
| *************************************************************************/ | ||
|
|
@@ -26,7 +26,7 @@ class TAttMarker { | |
|
|
||
| public: | ||
| TAttMarker(); | ||
| TAttMarker(Color_t color, Style_t style, Size_t msize); | ||
| TAttMarker(Color_t markerColor, Style_t markerStyle, Size_t markerSize); | ||
| virtual ~TAttMarker(); | ||
| void Copy(TAttMarker &attmarker) const; | ||
| virtual Color_t GetMarkerColor() const {return fMarkerColor;} ///< Return the marker color | ||
|
|
@@ -43,7 +43,8 @@ class TAttMarker { | |
| /// Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. | ||
| /// They are meant to be very fast to draw and are always drawn with the same number of pixels; | ||
| /// therefore this method does not apply on them. | ||
| virtual void SetMarkerSize(Size_t msize=1) { fMarkerSize = msize;} | ||
| // FIXED: Renamed argument to markerSize to match the body assignment | ||
| virtual void SetMarkerSize(Size_t markerSize=1) { fMarkerSize = markerSize;} | ||
|
|
||
| static Style_t GetMarkerStyleBase(Style_t style); | ||
| static Width_t GetMarkerLineWidth(Style_t style); | ||
|
|
@@ -53,20 +54,19 @@ class TAttMarker { | |
| ClassDef(TAttMarker,3); //Marker attributes | ||
| }; | ||
|
|
||
| enum EMarkerStyle {kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, | ||
| kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, | ||
| kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, | ||
| kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, | ||
| kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, | ||
| kFullStar=29, kOpenStar=30, kOpenTriangleDown=32, | ||
| kFullDiamond=33, kFullCross=34, kOpenDiamondCross=35, | ||
| kOpenSquareDiagonal=36, kOpenThreeTriangles=37, | ||
| kOctagonCross=38, kFullThreeTriangles=39, | ||
| kOpenFourTrianglesX=40, kFullFourTrianglesX=41, | ||
| kOpenDoubleDiamond=42, kFullDoubleDiamond=43, | ||
| kOpenFourTrianglesPlus=44, kFullFourTrianglesPlus=45, | ||
| kOpenCrossX=46, kFullCrossX=47, kFourSquaresX=48, | ||
| kFourSquaresPlus=49 }; | ||
|
|
||
| #endif | ||
| enum EMarkerStyle {kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, | ||
|
||
| kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, | ||
| kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, | ||
| kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, | ||
| kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, | ||
| kFullStar=29, kOpenStar=30, kOpenTriangleDown=32, | ||
| kFullDiamond=33, kFullCross=34, kOpenDiamondCross=35, | ||
| kOpenSquareDiagonal=36, kOpenThreeTriangles=37, | ||
| kOctagonCross=38, kFullThreeTriangles=39, | ||
| kOpenFourTrianglesX=40, kFullFourTrianglesX=41, | ||
| kOpenDoubleDiamond=42, kFullDoubleDiamond=43, | ||
| kOpenFourTrianglesPlus=44, kFullFourTrianglesPlus=45, | ||
| kOpenCrossX=46, kFullCrossX=47, kFourSquaresX=48, | ||
| kFourSquaresPlus=49 }; | ||
|
|
||
| #endif | ||
aryansri05 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| /************************************************************************* | ||
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | ||
| * All rights reserved. * | ||
| * * | ||
| * * | ||
| * For the licensing terms see $ROOTSYS/LICENSE. * | ||
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | ||
| *************************************************************************/ | ||
|
|
@@ -28,7 +28,8 @@ class TAttText { | |
|
|
||
| public: | ||
| TAttText(); | ||
| TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize); | ||
| // FIXED: Renamed arguments to avoid shadowing globals (align, angle, color, font) | ||
|
||
| TAttText(Int_t textAlign, Float_t textAngle, Color_t textColor, Style_t textFont, Float_t tsize); | ||
| virtual ~TAttText(); | ||
| void Copy(TAttText &atttext) const; | ||
| virtual Short_t GetTextAlign() const {return fTextAlign;} ///< Return the text alignment | ||
|
|
@@ -41,7 +42,10 @@ class TAttText { | |
| virtual void ResetAttText(Option_t *toption=""); | ||
| virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1); | ||
| virtual void SetTextAttributes(); // *MENU* | ||
| virtual void SetTextAlign(Short_t align=11) { fTextAlign = align;} ///< Set the text alignment | ||
|
|
||
| // FIXED: Renamed argument 'align' to 'textAlign' to match the body and avoid shadowing | ||
| virtual void SetTextAlign(Short_t textAlign=11) { fTextAlign = textAlign;} ///< Set the text alignment | ||
|
|
||
| virtual void SetTextAngle(Float_t tangle=0) { fTextAngle = tangle;} ///< Set the text angle | ||
| virtual void SetTextColor(Color_t tcolor=1) { fTextColor = tcolor;} ///< Set the text color | ||
| virtual void SetTextColorAlpha(Color_t tcolor, Float_t talpha); | ||
|
|
@@ -57,5 +61,4 @@ class TAttText { | |
| enum ETextAlign {kHAlignLeft=10, kHAlignCenter=20, kHAlignRight=30, | ||
| kVAlignBottom=1, kVAlignCenter=2, kVAlignTop=3}; | ||
|
|
||
| #endif | ||
|
|
||
| #endif | ||
aryansri05 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,17 @@ class TObjArray; | |
| #include <vector> | ||
| #include <atomic> | ||
|
|
||
| // FIXME: Temporarily suppress -Wshadow file-wide to avoid warnings from | ||
| // legacy member variables shadowing local variables (PR #20793). | ||
| #if defined(__clang__) | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wshadow" | ||
| #elif defined(__GNUC__) | ||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wshadow" | ||
| #endif | ||
|
|
||
|
|
||
| class TBaseClass; | ||
| class TBrowser; | ||
| class TDataMember; | ||
|
|
@@ -95,7 +106,19 @@ friend class TStreamerInfo; | |
| enum EStatusBits { | ||
| kReservedLoading = BIT(7), // Internal status bits, set and reset only during initialization | ||
|
|
||
| #if defined(__clang__) | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wshadow" | ||
| #elif defined(__GNUC__) | ||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wshadow" | ||
| #endif | ||
|
||
| /* had kClassSaved = BIT(12), */ | ||
| #if defined(__clang__) | ||
| #pragma clang diagnostic pop | ||
| #elif defined(__GNUC__) | ||
| #pragma GCC diagnostic pop | ||
| #endif | ||
| kHasLocalHashMember = BIT(14), | ||
| kIgnoreTObjectStreamer = BIT(15), | ||
| kUnloaded = BIT(16), // The library containing the dictionary for this class was | ||
|
|
@@ -693,3 +716,16 @@ template <typename T> TClass *GetClass(const T * /* dummy */) { return TClass::G | |
| } | ||
|
|
||
| #endif // ROOT_TClass | ||
|
|
||
| #if defined(__clang__) | ||
| #pragma clang diagnostic pop | ||
| #elif defined(__GNUC__) | ||
| #pragma GCC diagnostic pop | ||
|
|
||
| #if defined(__clang__) | ||
| #pragma clang diagnostic pop | ||
| #elif defined(__GNUC__) | ||
| #pragma GCC diagnostic pop | ||
| #endif | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted the accidental whitespace and formatting changes to the header/enum.