From: davidsen@prodigy.com (Bill Davidsen)
To: linuxppc-dev@lists.linuxppc.org
Subject: Re: [ppc-dev] Re: Restructuring Efforts
Date: Wed, 17 Feb 1999 07:50:25 -0500 [thread overview]
Message-ID: <199902171250.HAA00182@darkstar.prodigy.com> (raw)
In-Reply-To: <Pine.LNX.4.04.9902162012560.432-100000@narn.local.drgw.net> from hozer@drgw.net
Troy Benjegerdes <hozer@drgw.net> noted:
> ifdefs are evil ;)
> OTOH, I don't know if I like a ton of 'if _machine' from a readability
> standpoint. I would like something similiar to the Alpha's and Corey
> Minyards rework with a structure for various machines with any code that
> would have been inside an #ifdef , switch(_machine) if _machine.
Well, you can preserve readability if you are willing to put the
machine types in an enum and make use of "pointer to function
returning" arrays. So instead of doing something like init_mem() you
would use (*init_mem[_machine])() instead.
Another trick is to have a set if defines which you provide for each
machine type, and then call. Either of these provide easy extensibility
without ifdefs.
--
-bill davidsen (davidsen@prodigy.com)
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]
next prev parent reply other threads:[~1999-02-17 12:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-16 16:33 Restructuring Efforts Christian Zankel
1999-02-16 20:11 ` Cort Dougan
1999-02-17 2:35 ` Troy Benjegerdes
1999-02-17 6:45 ` Cort Dougan
1999-02-17 10:53 ` Gabriel Paubert
1999-02-17 16:40 ` Troy Benjegerdes
1999-02-17 16:32 ` Benjamin Herrenschmidt
1999-02-17 12:50 ` Bill Davidsen [this message]
1999-02-17 17:27 ` [ppc-dev] " Benjamin Herrenschmidt
1999-02-17 23:44 ` David A. Gatwood
1999-02-18 11:25 ` Benjamin Herrenschmidt
1999-02-17 12:19 ` Gabriel Paubert
1999-02-18 8:44 ` Jesper Skov
1999-02-18 14:00 ` Gabriel Paubert
1999-02-18 14:26 ` Jesper Skov
1999-02-18 17:03 ` Cort Dougan
1999-02-20 4:39 ` Troy Benjegerdes
1999-02-22 20:03 ` Gabriel Paubert
1999-02-17 12:26 ` [ppc-dev] " Bill Davidsen
1999-02-17 12:12 ` Gabriel Paubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199902171250.HAA00182@darkstar.prodigy.com \
--to=davidsen@prodigy.com \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).