From dfd71567402ff5dc6f85bbe1dc080ff55cb4dcc8 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 9 May 2013 13:01:16 +0100 Subject: [PATCH] Tidying up arg.c and arg.h. Copied from Perforce Change: 181665 ServerID: perforce.ravenbrook.com --- mps/code/arg.c | 11 ++++++----- mps/code/arg.h | 11 ++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mps/code/arg.c b/mps/code/arg.c index edb25ebd8c0..4d2447e5c00 100644 --- a/mps/code/arg.c +++ b/mps/code/arg.c @@ -42,12 +42,12 @@ Bool ArgCheckChain(Arg arg) { } Bool ArgCheckSize(Arg arg) { - UNUSED(arg); + UNUSED(arg); /* TODO: Add and call SizeCheck */ return TRUE; } Bool ArgCheckAddr(Arg arg) { - UNUSED(arg); + UNUSED(arg); /* TODO: Add and call AddrCheck */ return TRUE; } @@ -72,7 +72,7 @@ Bool ArgCheckBool(Arg arg) { } Bool ArgCheckCount(Arg arg) { - UNUSED(arg); + UNUSED(arg); /* TODO: Add and call CountCheck */ return TRUE; } @@ -116,6 +116,8 @@ Bool ArgListCheck(ArgList args) } +/* ArgPick -- try to pick an argument out of the argument list by keyword */ + Bool ArgPick(ArgStruct *argOut, ArgList args, Key key) { Index i; @@ -136,14 +138,13 @@ found: break; ++i; } - return TRUE; } /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2013 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/arg.h b/mps/code/arg.h index 2a1385a8dfb..f50107b593f 100644 --- a/mps/code/arg.h +++ b/mps/code/arg.h @@ -11,9 +11,14 @@ #include "mpmtypes.h" -/* KeyStruct -- keyword argument structure */ -/* FIXME: Whether to have a check field should be conditional on variety */ +/* KeyStruct -- keyword argument structure + * + * NOTE: Whether or not to have an argument checking field and functions + * could be conditional on build variety. Checking arguments isn't on + * the critical path, but this might save space if the MPS is being + * deployed in a tight memory situation. + */ #define KeySig ((Sig)0x519CE111) /* SIGnature KEYyy */ typedef struct mps_key_s { @@ -49,7 +54,7 @@ extern Bool ArgCheckCount(Arg arg); /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2013 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. *