From 838572f7b3cbd0005486dc076ba0df6ec8fab50a Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 22 Oct 2019 23:02:56 +0200 Subject: Dialog.c: save some lines --- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 37 ++++------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'nx-X11/programs') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index 0dcdda5a4..ccea93a92 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -198,7 +198,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_KILL_SESSION_TYPE; local = DIALOG_KILL_SESSION_LOCAL; pid = &nxagentKillDialogPid; - break; } case DIALOG_SUSPEND_SESSION: @@ -207,7 +206,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_SUSPEND_SESSION_TYPE; local = DIALOG_SUSPEND_SESSION_LOCAL; pid = &nxagentSuspendDialogPid; - break; } case DIALOG_ROOTLESS: @@ -216,7 +214,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_ROOTLESS_TYPE; local = DIALOG_ROOTLESS_LOCAL; pid = &nxagentRootlessDialogPid; - break; } case DIALOG_PULLDOWN: @@ -226,7 +223,6 @@ void nxagentLaunchDialog(DialogType dialogType) local = DIALOG_PULLDOWN_LOCAL; pid = &nxagentPulldownDialogPid; window = nxagentPulldownWindow; - break; } case DIALOG_FONT_REPLACEMENT: @@ -235,7 +231,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_FONT_REPLACEMENT_TYPE; local = DIALOG_FONT_REPLACEMENT_LOCAL; pid = &nxagentFontsReplacementDialogPid; - break; } case DIALOG_FAILED_RECONNECTION: @@ -244,7 +239,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_FAILED_RECONNECTION_TYPE; local = DIALOG_FAILED_RECONNECTION_LOCAL; pid = &nxagentFailedReconnectionDialogPid; - break; } case DIALOG_ENABLE_DESKTOP_RESIZE_MODE: @@ -253,7 +247,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_TYPE; local = DIALOG_ENABLE_DESKTOP_RESIZE_MODE_LOCAL; pid = &nxagentEnableRandRModeDialogPid; - break; } case DIALOG_DISABLE_DESKTOP_RESIZE_MODE: @@ -262,7 +255,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE; local = DIALOG_DISABLE_DESKTOP_RESIZE_MODE_LOCAL; pid = &nxagentDisableRandRModeDialogPid; - break; } case DIALOG_ENABLE_DEFER_MODE: @@ -271,7 +263,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_ENABLE_DEFER_MODE_TYPE; local = DIALOG_ENABLE_DEFER_MODE_LOCAL; pid = &nxagentEnableDeferModePid; - break; } case DIALOG_DISABLE_DEFER_MODE: @@ -280,7 +271,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_DISABLE_DEFER_MODE_TYPE; local = DIALOG_DISABLE_DEFER_MODE_LOCAL; pid = &nxagentDisableDeferModePid; - break; } case DIALOG_ENABLE_AUTOGRAB_MODE: @@ -289,7 +279,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_ENABLE_AUTOGRAB_MODE_TYPE; local = DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL; pid = &nxagentEnableAutograbModePid; - break; } case DIALOG_DISABLE_AUTOGRAB_MODE: @@ -298,7 +287,6 @@ void nxagentLaunchDialog(DialogType dialogType) type = DIALOG_DISABLE_AUTOGRAB_MODE_TYPE; local = DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL; pid = &nxagentDisableAutograbModePid; - break; } default: @@ -325,8 +313,7 @@ void nxagentLaunchDialog(DialogType dialogType) } /* - * We don't want to receive SIGCHLD - * before we store the child pid. + * We don't want to receive SIGCHLD before we store the child pid. */ sigemptyset(&set); @@ -346,8 +333,7 @@ void nxagentLaunchDialog(DialogType dialogType) dialogDisplay[0] = '\0'; /* - * Restore the previous set of - * blocked signal. + * Restore the previous set of blocked signal. */ sigprocmask(SIG_SETMASK, &oldSet, NULL); @@ -385,8 +371,7 @@ void nxagentFailedReconnectionDialog(int alert, char *error) NXTransAlert(alert, NX_ALERT_REMOTE); /* - * Make it possible to interrupt the - * loop with a signal. + * Make it possible to interrupt the loop with a signal. */ while (NXDisplayError(nxagentDisplay) == 0 && @@ -477,73 +462,61 @@ void nxagentTerminateDialog(DialogType type) case DIALOG_KILL_SESSION: { pid = nxagentKillDialogPid; - break; } case DIALOG_SUSPEND_SESSION: { pid = nxagentSuspendDialogPid; - break; } case DIALOG_ROOTLESS: { pid = nxagentRootlessDialogPid; - break; } case DIALOG_PULLDOWN: { pid = nxagentPulldownDialogPid; - break; } case DIALOG_FONT_REPLACEMENT: { pid = nxagentFontsReplacementDialogPid; - break; } case DIALOG_FAILED_RECONNECTION: { pid = nxagentFailedReconnectionDialogPid; - break; } case DIALOG_ENABLE_DESKTOP_RESIZE_MODE: { pid = nxagentEnableRandRModeDialogPid; - break; } case DIALOG_DISABLE_DESKTOP_RESIZE_MODE: { pid = nxagentDisableRandRModeDialogPid; - break; } case DIALOG_ENABLE_DEFER_MODE: { pid = nxagentEnableDeferModePid; - break; } case DIALOG_DISABLE_DEFER_MODE: { pid = nxagentDisableDeferModePid; - break; } case DIALOG_ENABLE_AUTOGRAB_MODE: { pid = nxagentEnableAutograbModePid; - break; } case DIALOG_DISABLE_AUTOGRAB_MODE: { pid = nxagentDisableAutograbModePid; - break; } default: @@ -577,13 +550,11 @@ void nxagentTerminateDialog(DialogType type) void nxagentTerminateDialogs(void) { - DialogType type; - #ifdef DEBUG fprintf(stderr, "nxagentTerminateDialogs: Terminating all the running dialogs.\n"); #endif - for (type = DIALOG_FIRST_TAG; type < DIALOG_LAST_TAG; type++) + for (DialogType type = DIALOG_FIRST_TAG; type < DIALOG_LAST_TAG; type++) { nxagentTerminateDialog(type); } -- cgit v1.2.3