[CRIU] [PATCH] action-scripts.h: rm explicit numbering of enum

Kir Kolyshkin kir at openvz.org
Mon Sep 12 15:44:50 PDT 2016


C standard specifies that the first enum element is 0 and the next ones
are +1 to a previous element (C90, "3.5.2.2 Enumeration specifiers").
Therefore, there is no need to explicitly specify element values.

The explicit initializers were added in commit 5676383 (scripts:
Add ACT_MAX limit and make @action_names being const) but I do not
see the need for them in there either.

No functional change.

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 criu/include/action-scripts.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/criu/include/action-scripts.h b/criu/include/action-scripts.h
index 4d56300..2e3b25e 100644
--- a/criu/include/action-scripts.h
+++ b/criu/include/action-scripts.h
@@ -2,15 +2,15 @@
 #define __CR_ACTION_SCRIPTS_H__
 
 enum script_actions {
-	ACT_PRE_DUMP		= 0,
-	ACT_POST_DUMP		= 1,
-	ACT_PRE_RESTORE		= 2,
-	ACT_POST_RESTORE	= 3,
-	ACT_NET_LOCK		= 4,
-	ACT_NET_UNLOCK		= 5,
-	ACT_SETUP_NS		= 6,
-	ACT_POST_SETUP_NS	= 7,
-	ACT_POST_RESUME		= 8,
+	ACT_PRE_DUMP,
+	ACT_POST_DUMP,
+	ACT_PRE_RESTORE,
+	ACT_POST_RESTORE,
+	ACT_NET_LOCK,
+	ACT_NET_UNLOCK,
+	ACT_SETUP_NS,
+	ACT_POST_SETUP_NS,
+	ACT_POST_RESUME,
 
 	ACT_MAX
 };
-- 
2.7.4



More information about the CRIU mailing list