[PATCH 8/9] FcObjectValidType: tweak -1 checking

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

 



Newer gcc doesn't like when you switch on an enum and use a value
that isn't declared:

fcname.c: In function 'FcObjectValidType':
fcname.c:299:2: warning: case value '4294967295'
	not in enumerated type 'FcType' [-Wswitch]

So tweak the logic to avoid this warning.

Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
 src/fcname.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/fcname.c b/src/fcname.c
index 864ad40..1b32b0f 100644
--- a/src/fcname.c
+++ b/src/fcname.c
@@ -296,8 +296,6 @@ FcObjectValidType (FcObject object, FcType type)
 
     if (t) {
 	switch (t->type) {
-	case -1:
-	    return FcTrue;
 	case FcTypeDouble:
 	case FcTypeInteger:
 	    if (type == FcTypeDouble || type == FcTypeInteger)
@@ -308,7 +306,7 @@ FcObjectValidType (FcObject object, FcType type)
 		return FcTrue;
 	    break;
 	default:
-	    if (type == t->type)
+	    if (t->type == -1 || type == t->type)
 		return FcTrue;
 	    break;
 	}
-- 
1.7.8.4

_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig


[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux