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

[PATCH] Use HSAttributeValue in hsattribute_assign



<HolySmoke> is there any reason why hsattribute_assign (object.c:536) doesn't use the HSAttributeValue typedef?
<The-Compiler> the typedef is newer than that code, I'd guess it just got forgotten

-- 
() ascii ribbon campaign - stop html mail    www.asciiribbon.org
/\ www.the-compiler.org  | I love long mails http://email.is-not-s.ms/
Chuck Norris doesn't look both ways before he crosses the street... he just 
roundhouses any cars that get too close. 
From c53b23f254bf6c2419eda7aebfc0b3f7328ac1a6 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <git _at_ the _minus_ compiler _dot_ org>
Date: Thu, 27 Mar 2014 06:39:24 +0100
Subject: [PATCH] Use HSAttributeValue in hsattribute_assign.

---
 src/object.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/object.c b/src/object.c
index ebf58fb..1c8484b 100644
--- a/src/object.c
+++ b/src/object.c
@@ -533,13 +533,7 @@ int hsattribute_assign(HSAttribute* attr, const char* 
new_value_str, GString* ou
     }
 
     bool error = false;
-    union {
-        bool        b;
-        int         i;
-        unsigned int u;
-        GString*    str;
-        HSColor     color;
-    } new_value, old_value;
+    HSAttributeValue new_value, old_value;
     bool nothing_to_do = false;
 
 #define ATTR_DO_ASSIGN_COMPARE(NAME,MEM) \
-- 
1.9.0

Attachment: pgpJpK9fd5vZ7.pgp
Description: PGP signature