From 155580420a6d49927a95ccae97d880f8cbceda16 Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 25 Feb 2005 23:16:05 +1100 Subject: Optimise away status and case statement in main(). --- ChangeLog | 2 +- src/main.c | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index c51a351..70a8065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,7 @@ * Changed boolean rootshell into shlvl counter. * Catch set -e exits within built-in commands. - * Size optimisations with state/s in main(). + * Size optimisations with setjmp in main(). * Only reread exitstatus on EXEXIT in exitshell. * Eliminated global exerrno. diff --git a/src/main.c b/src/main.c index c686a13..6253010 100644 --- a/src/main.c +++ b/src/main.c @@ -123,30 +123,18 @@ main(int argc, char **argv) #endif state = 0; if (unlikely(setjmp(jmploc.loc))) { - int status; int e; int s; reset(); - s = state; e = exception; - switch (exception) { - case EXERROR: - status = 2; - break; - - case EXEXIT: - case EXEVAL: - s = 0; - /* fall through */ - default: - status = exitstatus; - break; - } - exitstatus = status; + if (e == EXERROR) + exitstatus = 2; - if (s == 0 || iflag == 0 || shlvl) + s = state; + if (e == EXEXIT || e == EXEVAL || + s == 0 || iflag == 0 || shlvl) exitshell(); if (e == EXINT -- cgit 1.4.1 1e9c20e9&follow=1'>diff
path: root/bounce.h (unfollow)
Commit message (Expand)Author
2019-10-24Make clientFormat publicJune McEnroe
2019-10-24Make serverFormat publicJune McEnroe
2019-10-24Rename some thingsJune McEnroe
2019-10-23Add ISUPPORT draft to STANDARDSJune McEnroe
2019-10-23Track own originJune McEnroe
2019-10-23Track channels and sync ISUPPORTJune McEnroe
2019-10-23Track nick changesJune McEnroe
2019-10-23Rename Command to MessageJune McEnroe
2019-10-23Synchronize state after client registrationJune McEnroe
2019-10-23Send to server if client has no needsJune McEnroe
2019-10-23Implement some amount of client connectionJune McEnroe
2019-10-23Set clients non-blockingJune McEnroe
2019-10-23Clean up state.c and factor out parsingJune McEnroe
2019-10-23Respond to pingsJune McEnroe
2019-10-23Add verbose flagJune McEnroe
2019-10-23Set NOSIGPIPE on server connectionJune McEnroe
2019-10-23Set an initial loop capJune McEnroe
2019-10-23Fix rest parsingJune McEnroe
2019-10-23Add dynamic poll listJune McEnroe
2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe
2019-10-23Clean up state somewhatJune McEnroe
2019-10-23Actually send the buffer...June McEnroe
2019-10-23Add stateJune McEnroe