[gnome-calculator] Don't create new fundamental types



commit 15b48300d3ea6abe754ec96ba1b9e5e8fc0dbd39
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Jun 24 08:10:12 2014 -0500

    Don't create new fundamental types
    
    The GObject documentation says we should never need to do this, so let's
    trust that and just never do it. It can lead to at least one dangerous,
    hard to debug issue:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708130#c21

 src/equation-lexer.vala  |    6 +++---
 src/equation-parser.vala |    2 +-
 src/equation.vala        |    2 +-
 src/math-equation.vala   |    4 ++--
 src/number.vala          |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/equation-lexer.vala b/src/equation-lexer.vala
index d5ff7eb..652769e 100644
--- a/src/equation-lexer.vala
+++ b/src/equation-lexer.vala
@@ -68,7 +68,7 @@ public enum LexerTokenType
 }
 
 // FIXME: Merge into lexer
-public class PreLexer
+public class PreLexer : Object
 {
     public string stream; /* String being scanned */
     public int index;      /* Current character index */
@@ -240,7 +240,7 @@ public class PreLexer
 }
 
 /* Structure to hold single token. */
-public class LexerToken
+public class LexerToken : Object
 {
     public string text;                /* Copy of token string. */
     public uint start_index;           /* Start index in original stream. */
@@ -249,7 +249,7 @@ public class LexerToken
 }
 
 /* Structure to hold lexer state and all the tokens. */
-public class Lexer
+public class Lexer : Object
 {
     private Parser parser;           /* Pointer to the parser parser. */
     private PreLexer prelexer;       /* Pre-lexer  Pre-lexer is part of lexer. */
diff --git a/src/equation-parser.vala b/src/equation-parser.vala
index 362dbcf..d06485b 100644
--- a/src/equation-parser.vala
+++ b/src/equation-parser.vala
@@ -40,7 +40,7 @@ private enum Precedence
 }
 
 /* ParseNode structure for parse tree. */
-public class ParseNode
+public class ParseNode : Object
 {
     public Parser parser;
     public ParseNode? parent = null;
diff --git a/src/equation.vala b/src/equation.vala
index e56d1e3..f1a0afb 100644
--- a/src/equation.vala
+++ b/src/equation.vala
@@ -102,7 +102,7 @@ public enum ErrorCode
     MP
 }
 
-public class Equation
+public class Equation : Object
 {
     public int base;
     public int wordlen;
diff --git a/src/math-equation.vala b/src/math-equation.vala
index c2a0d71..1cf0dbd 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -17,7 +17,7 @@ public enum NumberMode
 }
 
 /* Expression mode state */
-private class MathEquationState
+private class MathEquationState : Object
 {
     public Number ans;             /* Previously calculated answer */
     public uint ans_base;          /* Representation base of previous answer. */
@@ -33,7 +33,7 @@ private class MathEquationState
     public uint error_token_end;   /* End offset of error token */
 }
 
-private class SolveData
+private class SolveData : Object
 {
     public Number? number_result;
     public string text_result;
diff --git a/src/number.vala b/src/number.vala
index 89b5a01..3d9c01f 100644
--- a/src/number.vala
+++ b/src/number.vala
@@ -55,7 +55,7 @@ public enum AngleUnit
  *
  * x = sign * (BASE^(exponent-1) + BASE^(exponent-2) + ...)
  */
-public class Number
+public class Number : Object
 {
     /* Sign (+1, -1) or 0 for the value zero */
     public int re_sign;


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