[beast: 130/144] BST: fix flags enum combination operators to be consexpr for g++-4.7 C++11
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 130/144] BST: fix flags enum combination operators to be consexpr for g++-4.7 C++11
- Date: Sat, 19 Jan 2013 00:55:15 +0000 (UTC)
commit be15e6bd724b594579b92e7999302e99c0424fef
Author: Tim Janik <timj gnu org>
Date: Sun Jan 13 20:05:48 2013 +0100
BST: fix flags enum combination operators to be consexpr for g++-4.7 C++11
beast-gtk/bstfiledialog.hh | 10 +++++-----
beast-gtk/bstmenus.hh | 10 +++++-----
beast-gtk/bstpatterncolumns.hh | 20 ++++++++++----------
beast-gtk/bstqsampler.hh | 10 +++++-----
4 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/beast-gtk/bstfiledialog.hh b/beast-gtk/bstfiledialog.hh
index 2cf3394..00effdf 100644
--- a/beast-gtk/bstfiledialog.hh
+++ b/beast-gtk/bstfiledialog.hh
@@ -104,10 +104,10 @@ void bst_file_dialog_set_handler (BstFileDialog *self,
G_END_DECLS
// == Flags Enumeration Operators in C++ ==
#ifdef __cplusplus
-inline BstFileDialogMode operator& (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 & (long long unsigned) s2); }
-inline BstFileDialogMode& operator&= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 & s2; return s1; }
-inline BstFileDialogMode operator| (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 | (long long unsigned) s2); }
-inline BstFileDialogMode& operator|= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 | s2; return s1; }
-inline BstFileDialogMode operator~ (BstFileDialogMode s1) { return BstFileDialogMode (~(long long unsigned) s1); }
+constexpr BstFileDialogMode operator& (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 & (long long unsigned) s2); }
+inline BstFileDialogMode& operator&= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 & s2; return s1; }
+constexpr BstFileDialogMode operator| (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 | (long long unsigned) s2); }
+inline BstFileDialogMode& operator|= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 | s2; return s1; }
+constexpr BstFileDialogMode operator~ (BstFileDialogMode s1) { return BstFileDialogMode (~(long long unsigned) s1); }
#endif // __cplusplus
#endif /* __BST_FILE_DIALOG_H__ */
diff --git a/beast-gtk/bstmenus.hh b/beast-gtk/bstmenus.hh
index fc09518..b99d014 100644
--- a/beast-gtk/bstmenus.hh
+++ b/beast-gtk/bstmenus.hh
@@ -65,10 +65,10 @@ BstChoice* bst_choice_alloc (BstChoiceFlags type,
G_END_DECLS
// == Flags Enumeration Operators in C++ ==
#ifdef __cplusplus
-inline BstChoiceFlags operator& (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 & (long long unsigned) s2); }
-inline BstChoiceFlags& operator&= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 & s2; return s1; }
-inline BstChoiceFlags operator| (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 | (long long unsigned) s2); }
-inline BstChoiceFlags& operator|= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 | s2; return s1; }
-inline BstChoiceFlags operator~ (BstChoiceFlags s1) { return BstChoiceFlags (~(long long unsigned) s1); }
+constexpr BstChoiceFlags operator& (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 & (long long unsigned) s2); }
+inline BstChoiceFlags& operator&= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 & s2; return s1; }
+constexpr BstChoiceFlags operator| (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 | (long long unsigned) s2); }
+inline BstChoiceFlags& operator|= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 | s2; return s1; }
+constexpr BstChoiceFlags operator~ (BstChoiceFlags s1) { return BstChoiceFlags (~(long long unsigned) s1); }
#endif // __cplusplus
#endif /* __BST_MENUS_H__ */
diff --git a/beast-gtk/bstpatterncolumns.hh b/beast-gtk/bstpatterncolumns.hh
index 54eb59b..34411e0 100644
--- a/beast-gtk/bstpatterncolumns.hh
+++ b/beast-gtk/bstpatterncolumns.hh
@@ -145,15 +145,15 @@ gboolean bst_pattern_column_has_notes (BstPatternColumn *column);
G_END_DECLS
// == Flags Enumeration Operators in C++ ==
#ifdef __cplusplus
-inline BstPatternLFlags operator& (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 & (long long unsigned) s2); }
-inline BstPatternLFlags& operator&= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 & s2; return s1; }
-inline BstPatternLFlags operator| (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 | (long long unsigned) s2); }
-inline BstPatternLFlags& operator|= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 | s2; return s1; }
-inline BstPatternLFlags operator~ (BstPatternLFlags s1) { return BstPatternLFlags (~(long long unsigned) s1); }
-inline BstPatternFunction operator& (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 & (long long unsigned) s2); }
-inline BstPatternFunction& operator&= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 & s2; return s1; }
-inline BstPatternFunction operator| (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 | (long long unsigned) s2); }
-inline BstPatternFunction& operator|= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 | s2; return s1; }
-inline BstPatternFunction operator~ (BstPatternFunction s1) { return BstPatternFunction (~(long long unsigned) s1); }
+constexpr BstPatternLFlags operator& (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 & (long long unsigned) s2); }
+inline BstPatternLFlags& operator&= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 & s2; return s1; }
+constexpr BstPatternLFlags operator| (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 | (long long unsigned) s2); }
+inline BstPatternLFlags& operator|= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 | s2; return s1; }
+constexpr BstPatternLFlags operator~ (BstPatternLFlags s1) { return BstPatternLFlags (~(long long unsigned) s1); }
+constexpr BstPatternFunction operator& (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 & (long long unsigned) s2); }
+inline BstPatternFunction& operator&= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 & s2; return s1; }
+constexpr BstPatternFunction operator| (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 | (long long unsigned) s2); }
+inline BstPatternFunction& operator|= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 | s2; return s1; }
+constexpr BstPatternFunction operator~ (BstPatternFunction s1) { return BstPatternFunction (~(long long unsigned) s1); }
#endif // __cplusplus
#endif /* __BST_PATTERN_COLUMNS_H__ */
diff --git a/beast-gtk/bstqsampler.hh b/beast-gtk/bstqsampler.hh
index 0946c64..3f2bcdf 100644
--- a/beast-gtk/bstqsampler.hh
+++ b/beast-gtk/bstqsampler.hh
@@ -43,11 +43,11 @@ typedef enum
BST_QSAMPLER_DIRTY = 1 << 7
} BstQSamplerType;
#ifdef __cplusplus
-inline BstQSamplerType operator& (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 & (long long unsigned) s2); }
-inline BstQSamplerType& operator&= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 & s2; return s1; }
-inline BstQSamplerType operator| (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 | (long long unsigned) s2); }
-inline BstQSamplerType& operator|= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 | s2; return s1; }
-inline BstQSamplerType operator~ (BstQSamplerType s1) { return BstQSamplerType (~(long long unsigned) s1); }
+constexpr BstQSamplerType operator& (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 & (long long unsigned) s2); }
+inline BstQSamplerType& operator&= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 & s2; return s1; }
+constexpr BstQSamplerType operator| (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 | (long long unsigned) s2); }
+inline BstQSamplerType& operator|= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 | s2; return s1; }
+constexpr BstQSamplerType operator~ (BstQSamplerType s1) { return BstQSamplerType (~(long long unsigned) s1); }
#endif // __cplusplus
typedef enum
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]