Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn) Newsgroups: net.lang.c Subject: Re: C style Message-ID: <2475@brl-tgr.ARPA> Date: Sun, 27-Oct-85 02:07:32 EST Article-I.D.: brl-tgr.2475 Posted: Sun Oct 27 02:07:32 1985 Date-Received: Tue, 29-Oct-85 00:57:14 EST References: <2467@brl-tgr.ARPA> Organization: Ballistic Research Lab Lines: 16 If this code needs to grow much more, it might be better to make it table-driven: i = 0; do { static int (*funcs[])() = { func1, ..., 0 }; int (*fp)() = funcs; do ret[i] = (*fp)( args ); while ( ret[i] == GOOD && *++fp ); } while ( ret[i] == GOOD && ++i < MAX_RETS ); This example isn't precisely equivalent to the original, but it accomplishes the same general goal.