48 lines
1.6 KiB
Diff
48 lines
1.6 KiB
Diff
|
From 76080541ae09c6242e0a162009c5faec3ba94b41 Mon Sep 17 00:00:00 2001
|
|||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|||
|
Date: Thu, 29 Feb 2024 21:27:47 +0000
|
|||
|
Subject: [PATCH] inspector/inspector.c: Remove extra cases covered by default
|
|||
|
MIME-Version: 1.0
|
|||
|
Content-Type: text/plain; charset=UTF-8
|
|||
|
Content-Transfer-Encoding: 8bit
|
|||
|
|
|||
|
In GCC 14:
|
|||
|
|
|||
|
inspector.c: In function ‘do_xpath’:
|
|||
|
inspector.c:770:3: error: case value ‘5’ not in enumerated type ‘xmlXPathObjectType’ [-Werror=switch]
|
|||
|
770 | case XPATH_POINT:
|
|||
|
| ^~~~
|
|||
|
inspector.c:771:3: error: case value ‘6’ not in enumerated type ‘xmlXPathObjectType’ [-Werror=switch]
|
|||
|
771 | case XPATH_RANGE:
|
|||
|
| ^~~~
|
|||
|
inspector.c:772:3: error: case value ‘7’ not in enumerated type ‘xmlXPathObjectType’ [-Werror=switch]
|
|||
|
772 | case XPATH_LOCATIONSET:
|
|||
|
| ^~~~
|
|||
|
|
|||
|
We already have a default case here, remove the other cases.
|
|||
|
|
|||
|
(cherry picked from commit 9d2ac9c9b48bf34f5fc3485303143302ead4cb4f)
|
|||
|
---
|
|||
|
inspector/inspector.c | 8 --------
|
|||
|
1 file changed, 8 deletions(-)
|
|||
|
|
|||
|
diff --git a/inspector/inspector.c b/inspector/inspector.c
|
|||
|
index 73357c7d7..01abfae0c 100644
|
|||
|
--- a/inspector/inspector.c
|
|||
|
+++ b/inspector/inspector.c
|
|||
|
@@ -764,14 +764,6 @@ do_xpath (const char *query)
|
|||
|
printf ("\n");
|
|||
|
break;
|
|||
|
|
|||
|
- case XPATH_UNDEFINED: /* grrrrr ... switch-enum is a useless warning */
|
|||
|
- case XPATH_BOOLEAN:
|
|||
|
- case XPATH_NUMBER:
|
|||
|
- case XPATH_POINT:
|
|||
|
- case XPATH_RANGE:
|
|||
|
- case XPATH_LOCATIONSET:
|
|||
|
- case XPATH_USERS:
|
|||
|
- case XPATH_XSLT_TREE:
|
|||
|
default:
|
|||
|
r = (char *) xmlXPathCastToString (xpathObj);
|
|||
|
printf ("%s\n", r);
|