Hi! - small optimization: `init' and `inittail' now "assigned" to .cfgInit and .cfgInitTail statically. - removed "COMMAND" statement.
TGROUP reduced from 0e1d1h to 0e1c6h; INIT_TEXT reduced from 3b71h to 3b66h; ICONST reduced from 9b8h to 996h; I_BSS reduced from 0e7ch to 0df6h; IDATA increased from 57ah to 5fah. PS: Later `init' and `inittail' may be integrated back to Config structure, thus removing extra pointers - just remove `cmd' in main.c:kernel() and manipulate .cfgInitTail there directly.
--- Begin Message ---diff -ruNp old/kernel/config.c new/kernel/config.c --- old/kernel/config.c 2004-04-14 07:04:08.000000000 +0000 +++ new/kernel/config.c 2004-05-09 23:29:48.000000000 +0000 @@ -125,6 +125,9 @@ static UBYTE ErrorAlreadyPrinted[128] BS char master_env[128] BSS_INIT({0}); static char *envp = master_env; +static char init[NAMEMAX] = "command.com"; +static char inittail[NAMEMAX] = " /P /E:256\r\n"; + struct config Config = { 0, NUMBUFF, @@ -132,8 +135,8 @@ struct config Config = { 0, NFCBS, 0, - "command.com", - " /P /E:256\r\n", + init, + inittail, NLAST, 0, NSTACKS, @@ -267,7 +270,6 @@ STATIC struct table commands[] = { {"BREAK", 1, CfgBreak}, {"BUFFERS", 1, Config_Buffers}, - {"COMMAND", 1, InitPgm}, {"COUNTRY", 1, Country}, {"DOS", 1, Dosmem}, {"DOSDATA", 1, DosData}, @@ -1237,12 +1239,6 @@ STATIC VOID InitPgmHigh(BYTE * pLine) STATIC VOID InitPgm(BYTE * pLine) { - static char init[NAMEMAX]; - static char inittail[NAMEMAX]; - - Config.cfgInit = init; - Config.cfgInitTail = inittail; - /* Get the string argument that represents the new init pgm */ pLine = GetStringArg(pLine, Config.cfgInit); @@ -1723,8 +1719,8 @@ STATIC void config_init_buffers(int want LoL->firstbuf = pbuffer; - DebugPrintf(("init_buffers (size %u) at", sizeof(struct buffer))); - DebugPrintf((" (%p)", LoL->firstbuf)); + DebugPrintf(("init_buffers (size %u) at (%p)", + sizeof(struct buffer), pbuffer)); buffers--; pbuffer->b_prev = FP_OFF(pbuffer + buffers);
--- End Message ---
