From: Dmitry V. Levin Date: Tue, 26 Feb 2013 22:02:30 +0000 (+0000) Subject: Fix compilation errors uncovered by -Werror=enum-compare X-Git-Tag: v4.8~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6f55240a1d599adb160ced4bdad36d8f1fd7b92;p=strace Fix compilation errors uncovered by -Werror=enum-compare This fixes regression introduced by commit v4.7-111-g9cbc15b. * syscall.c: Merge all nsyscalls* enums into single enum. Likewise merge nerrnos*, nsignals*, and nioctlents* into single enums. --- diff --git a/syscall.c b/syscall.c index 5bf2a12f..1f8bde1d 100644 --- a/syscall.c +++ b/syscall.c @@ -162,10 +162,6 @@ const char *const signalent0[] = { const struct_ioctlent ioctlent0[] = { #include "ioctlent.h" }; -enum { nsyscalls0 = ARRAY_SIZE(sysent0) }; -enum { nerrnos0 = ARRAY_SIZE(errnoent0) }; -enum { nsignals0 = ARRAY_SIZE(signalent0) }; -enum { nioctlents0 = ARRAY_SIZE(ioctlent0) }; #if SUPPORTED_PERSONALITIES > 1 static const char *const errnoent1[] = { @@ -177,10 +173,6 @@ static const char *const signalent1[] = { static const struct_ioctlent ioctlent1[] = { # include "ioctlent1.h" }; -enum { nsyscalls1 = ARRAY_SIZE(sysent1) }; -enum { nerrnos1 = ARRAY_SIZE(errnoent1) }; -enum { nsignals1 = ARRAY_SIZE(signalent1) }; -enum { nioctlents1 = ARRAY_SIZE(ioctlent1) }; #endif #if SUPPORTED_PERSONALITIES > 2 @@ -193,12 +185,48 @@ static const char *const signalent2[] = { static const struct_ioctlent ioctlent2[] = { # include "ioctlent2.h" }; -enum { nsyscalls2 = ARRAY_SIZE(sysent2) }; -enum { nerrnos2 = ARRAY_SIZE(errnoent2) }; -enum { nsignals2 = ARRAY_SIZE(signalent2) }; -enum { nioctlents2 = ARRAY_SIZE(ioctlent2) }; #endif +enum { + nsyscalls0 = ARRAY_SIZE(sysent0) +#if SUPPORTED_PERSONALITIES > 1 + , nsyscalls1 = ARRAY_SIZE(sysent1) +# if SUPPORTED_PERSONALITIES > 2 + , nsyscalls2 = ARRAY_SIZE(sysent2) +# endif +#endif +}; + +enum { + nerrnos0 = ARRAY_SIZE(errnoent0) +#if SUPPORTED_PERSONALITIES > 1 + , nerrnos1 = ARRAY_SIZE(errnoent1) +# if SUPPORTED_PERSONALITIES > 2 + , nerrnos2 = ARRAY_SIZE(errnoent2) +# endif +#endif +}; + +enum { + nsignals0 = ARRAY_SIZE(signalent0) +#if SUPPORTED_PERSONALITIES > 1 + , nsignals1 = ARRAY_SIZE(signalent1) +# if SUPPORTED_PERSONALITIES > 2 + , nsignals2 = ARRAY_SIZE(signalent2) +# endif +#endif +}; + +enum { + nioctlents0 = ARRAY_SIZE(ioctlent0) +#if SUPPORTED_PERSONALITIES > 1 + , nioctlents1 = ARRAY_SIZE(ioctlent1) +# if SUPPORTED_PERSONALITIES > 2 + , nioctlents2 = ARRAY_SIZE(ioctlent2) +# endif +#endif +}; + #if SUPPORTED_PERSONALITIES > 1 const struct_sysent *sysent = sysent0; const char *const *errnoent = errnoent0;