Since we're just running every command handling function and letting the
function decide whether it need to do anything, there's no need for the
command names and special structure. Instead, just keep an array of
function pointers to iterate.
---
loader/kickstart.c | 51 ++++++++++++++++++++++-----------------------------
1 files changed, 22 insertions(+), 29 deletions(-)
if (!readKickstart(parser, processedFile))
goto quit;
@@ -1019,8 +1012,8 @@ int runKickstart(struct loaderData_s * loaderData, const char *file) {
* every element of the ksTable and run its function. The functions
* themselves will decide if they should do anything or not.
*/
- for (cmd = ksTable; cmd->name; cmd++)
- cmd->setupData(loaderData, handler);
+ for (cmd = ksTable; *cmd != NULL; cmd++)
+ (*cmd)(loaderData, handler);
}
rc = 1;
--
1.7.1.1
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-24-2011, 11:51 PM
David Cantrell
We don't need the command names anymore.
Ack.
On Thu, 20 Jan 2011, Chris Lumens wrote:
Since we're just running every command handling function and letting the
function decide whether it need to do anything, there's no need for the
command names and special structure. Instead, just keep an array of
function pointers to iterate.
---
loader/kickstart.c | 51 ++++++++++++++++++++++-----------------------------
1 files changed, 22 insertions(+), 29 deletions(-)
if (!readKickstart(parser, processedFile))
goto quit;
@@ -1019,8 +1012,8 @@ int runKickstart(struct loaderData_s * loaderData, const char *file) {
* every element of the ksTable and run its function. The functions
* themselves will decide if they should do anything or not.
*/
- for (cmd = ksTable; cmd->name; cmd++)
- cmd->setupData(loaderData, handler);
+ for (cmd = ksTable; *cmd != NULL; cmd++)
+ (*cmd)(loaderData, handler);
}
rc = 1;
--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list