Thread (1 message) 1 message, 1 author, 2019-10-12

Re: [PATCH v4 2/3] format-patch: use enum variables

From: Junio C Hamano <hidden>
Date: 2019-10-12 02:17:01

Denton Liu [off-list ref] writes:
-#define THREAD_SHALLOW 1
-#define THREAD_DEEP 2
-static int thread;
+enum thread_level {
+	THREAD_UNSET,
+	THREAD_SHALLOW,
+	THREAD_DEEP
+};
+static enum thread_level thread;
As the assignment of values do not change, this is a safe conversion
even if an existing code did things like

	if (!thread)
        	... do this ...;

Hopefully nobody did arithmetic on it; thread_level may now become
unsigned depending on the compiler.
-static int config_cover_letter;
+static enum cover_setting config_cover_letter;
Likewise about the signedness.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help