[gjs: 7/10] arg-cache: Use 3 bits to hold GIScopeType




commit 92845352b0f574fa237c3636380c4a89de8be4cf
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Jan 29 14:46:28 2022 -0800

    arg-cache: Use 3 bits to hold GIScopeType
    
    With the introduction of GI_SCOPE_TYPE_FOREVER in g-i 1.71, 2 bits is no
    longer large enough to hold all the values of the enum. Use 3 bits
    instead.

 gi/arg-cache.cpp | 2 +-
 gi/function.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/arg-cache.cpp b/gi/arg-cache.cpp
index 958f7777b..83c4ad4da 100644
--- a/gi/arg-cache.cpp
+++ b/gi/arg-cache.cpp
@@ -285,7 +285,7 @@ struct Callback : Nullable, BaseInfo {
 
     uint8_t m_closure_pos = Argument::ABSENT;
     uint8_t m_destroy_pos = Argument::ABSENT;
-    GIScopeType m_scope : 2;
+    GIScopeType m_scope : 3;
 };
 
 struct Enum {
diff --git a/gi/function.h b/gi/function.h
index 5ebe9b890..a6e9b82dd 100644
--- a/gi/function.h
+++ b/gi/function.h
@@ -76,7 +76,7 @@ struct GjsCallbackTrampoline : public Gjs::Closure {
     std::vector<GjsParamType> m_param_types;
     ffi_cif m_cif;
 
-    GIScopeType m_scope : 2;
+    GIScopeType m_scope : 3;
     bool m_is_vfunc : 1;
 };
 


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