[gjs: 11/18] wrapperutils: Make static constexpr members uppercase




commit c5401b8efde191bd464789fc0b3ca269e8e929a1
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Nov 28 20:13:03 2020 -0800

    wrapperutils: Make static constexpr members uppercase
    
    These are more like compile-time constants, so format them as uppercase
    for better reading comprehension.

 gi/boxed.h        |  4 ++--
 gi/fundamental.h  |  4 ++--
 gi/gerror.h       |  4 ++--
 gi/interface.h    |  4 ++--
 gi/object.h       |  4 ++--
 gi/union.h        |  4 ++--
 gi/wrapperutils.h | 20 ++++++++++----------
 7 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/gi/boxed.h b/gi/boxed.h
index dfcbe637..d7da8d14 100644
--- a/gi/boxed.h
+++ b/gi/boxed.h
@@ -51,8 +51,8 @@ class BoxedBase
         : GIWrapperBase(proto) {}
     ~BoxedBase(void) {}
 
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GBOXED;
-    static constexpr const char* debug_tag = "GBoxed";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GBOXED;
+    static constexpr const char* DEBUG_TAG = "GBoxed";
 
     static const struct JSClassOps class_ops;
     static const struct JSClass klass;
diff --git a/gi/fundamental.h b/gi/fundamental.h
index a3faa783..4a5273be 100644
--- a/gi/fundamental.h
+++ b/gi/fundamental.h
@@ -39,8 +39,8 @@ class FundamentalBase
         : GIWrapperBase(proto) {}
     ~FundamentalBase(void) {}
 
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GFUNDAMENTAL;
-    static constexpr const char* debug_tag = "fundamental";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GFUNDAMENTAL;
+    static constexpr const char* DEBUG_TAG = "fundamental";
 
     static const struct JSClassOps class_ops;
     static const struct JSClass klass;
diff --git a/gi/gerror.h b/gi/gerror.h
index 104bc765..4176241f 100644
--- a/gi/gerror.h
+++ b/gi/gerror.h
@@ -48,8 +48,8 @@ class ErrorBase
         : GIWrapperBase(proto) {}
     ~ErrorBase(void) {}
 
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GERROR;
-    static constexpr const char* debug_tag = "gerror";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GERROR;
+    static constexpr const char* DEBUG_TAG = "gerror";
 
     static const struct JSClassOps class_ops;
     static const struct JSClass klass;
diff --git a/gi/interface.h b/gi/interface.h
index 309207cb..7f1842b4 100644
--- a/gi/interface.h
+++ b/gi/interface.h
@@ -47,8 +47,8 @@ class InterfaceBase : public GIWrapperBase<InterfaceBase, InterfacePrototype,
         : GIWrapperBase(proto) {}
     ~InterfaceBase(void) {}
 
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GINTERFACE;
-    static constexpr const char* debug_tag = "GInterface";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GINTERFACE;
+    static constexpr const char* DEBUG_TAG = "GInterface";
 
     static const struct JSClassOps class_ops;
     static const struct JSClass klass;
diff --git a/gi/object.h b/gi/object.h
index fc56f671..2467fc40 100644
--- a/gi/object.h
+++ b/gi/object.h
@@ -88,8 +88,8 @@ class ObjectBase
  public:
     using SignalMatchFunc = guint(gpointer, GSignalMatchType, guint, GQuark,
                                   GClosure*, gpointer, gpointer);
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GOBJECT;
-    static constexpr const char* debug_tag = "GObject";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GOBJECT;
+    static constexpr const char* DEBUG_TAG = "GObject";
 
     static const struct JSClassOps class_ops;
     static const struct JSClass klass;
diff --git a/gi/union.h b/gi/union.h
index b46530bc..137a4bb6 100644
--- a/gi/union.h
+++ b/gi/union.h
@@ -33,8 +33,8 @@ class UnionBase
         : GIWrapperBase(proto) {}
     ~UnionBase(void) {}
 
-    static const GjsDebugTopic debug_topic = GJS_DEBUG_GBOXED;
-    static constexpr const char* debug_tag = "union";
+    static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GBOXED;
+    static constexpr const char* DEBUG_TAG = "union";
 
     static const JSClassOps class_ops;
     static const JSClass klass;
diff --git a/gi/wrapperutils.h b/gi/wrapperutils.h
index bb583853..7c0dc246 100644
--- a/gi/wrapperutils.h
+++ b/gi/wrapperutils.h
@@ -284,24 +284,24 @@ class GIWrapperBase {
  protected:
     void debug_lifecycle(const char* message GJS_USED_VERBOSE_LIFECYCLE) const {
         gjs_debug_lifecycle(
-            Base::debug_topic, "[%p: %s pointer %p - %s.%s (%s)] %s", this,
-            Base::debug_tag, ptr_addr(), ns(), name(), type_name(), message);
+            Base::DEBUG_TOPIC, "[%p: %s pointer %p - %s.%s (%s)] %s", this,
+            Base::DEBUG_TAG, ptr_addr(), ns(), name(), type_name(), message);
     }
     void debug_lifecycle(const void* obj GJS_USED_VERBOSE_LIFECYCLE,
                          const char* message GJS_USED_VERBOSE_LIFECYCLE) const {
         gjs_debug_lifecycle(
-            Base::debug_topic,
+            Base::DEBUG_TOPIC,
             "[%p: %s pointer %p - JS wrapper %p - %s.%s (%s)] %s", this,
-            Base::debug_tag, ptr_addr(), obj, ns(), name(), type_name(),
+            Base::DEBUG_TAG, ptr_addr(), obj, ns(), name(), type_name(),
             message);
     }
     void debug_jsprop(const char* message GJS_USED_VERBOSE_PROPS,
                       const char* id GJS_USED_VERBOSE_PROPS,
                       const void* obj GJS_USED_VERBOSE_PROPS) const {
         gjs_debug_jsprop(
-            Base::debug_topic,
+            Base::DEBUG_TOPIC,
             "[%p: %s pointer %p - JS wrapper %p - %s.%s (%s)] %s '%s'", this,
-            Base::debug_tag, ptr_addr(), obj, ns(), name(), type_name(),
+            Base::DEBUG_TAG, ptr_addr(), obj, ns(), name(), type_name(),
             message, id);
     }
     void debug_jsprop(const char* message, jsid id, const void* obj) const {
@@ -314,9 +314,9 @@ class GIWrapperBase {
     static void debug_jsprop_static(const char* message GJS_USED_VERBOSE_PROPS,
                                     jsid id GJS_USED_VERBOSE_PROPS,
                                     const void* obj GJS_USED_VERBOSE_PROPS) {
-        gjs_debug_jsprop(Base::debug_topic,
+        gjs_debug_jsprop(Base::DEBUG_TOPIC,
                          "[%s JS wrapper %p] %s '%s', no instance associated",
-                         Base::debug_tag, obj, message,
+                         Base::DEBUG_TAG, obj, message,
                          gjs_debug_id(id).c_str());
     }
 
@@ -515,7 +515,7 @@ class GIWrapperBase {
 
         static_cast<GIWrapperBase*>(priv)->debug_lifecycle(obj,
                                                            "JSObject created");
-        gjs_debug_lifecycle(Base::debug_topic, "m_proto is %p",
+        gjs_debug_lifecycle(Base::DEBUG_TOPIC, "m_proto is %p",
                             priv->get_prototype());
 
         // We may need to return a value different from obj (for example because
@@ -836,7 +836,7 @@ class GIWrapperPrototype : public Base {
                 constructor))
             return false;
 
-        gjs_debug(Base::debug_topic,
+        gjs_debug(Base::DEBUG_TOPIC,
                   "Defined class for %s (%s), prototype %p, "
                   "JSClass %p, in object %p",
                   Base::name(), Base::type_name(), prototype.get(),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]