diff options
| author | Richard Brooksby | 2013-05-16 13:10:01 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2013-05-16 13:10:01 +0100 |
| commit | 818a65f36f4fe1931a53675ff2bc0e12307d58ef (patch) | |
| tree | 9fa9f341cfaf31fc32b5512ad3980111f0240b91 /mps/code | |
| parent | bb02f55b62ea785cb64bc60bebca8721dd52d886 (diff) | |
| download | emacs-818a65f36f4fe1931a53675ff2bc0e12307d58ef.tar.gz emacs-818a65f36f4fe1931a53675ff2bc0e12307d58ef.zip | |
Replacing duplicate *trivvarargs methods with a single implementation in args.c.
Copied from Perforce
Change: 181851
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/arena.c | 12 | ||||
| -rw-r--r-- | mps/code/arg.c | 11 | ||||
| -rw-r--r-- | mps/code/arg.h | 1 | ||||
| -rw-r--r-- | mps/code/buffer.c | 11 | ||||
| -rw-r--r-- | mps/code/mpm.h | 1 | ||||
| -rw-r--r-- | mps/code/poolabs.c | 9 |
6 files changed, 15 insertions, 30 deletions
diff --git a/mps/code/arena.c b/mps/code/arena.c index 189503b348e..a77a72f590c 100644 --- a/mps/code/arena.c +++ b/mps/code/arena.c | |||
| @@ -46,16 +46,6 @@ static Res ArenaTrivDescribe(Arena arena, mps_lib_FILE *stream) | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | /* ArenaTrivVarargs -- ignore obsolete varargs for future arena classes */ | ||
| 50 | |||
| 51 | static void ArenaTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs) | ||
| 52 | { | ||
| 53 | UNUSED(varargs); | ||
| 54 | args[0].key = MPS_KEY_ARGS_END; | ||
| 55 | AVER(ArgListCheck(args)); | ||
| 56 | } | ||
| 57 | |||
| 58 | |||
| 59 | /* AbstractArenaClass -- The abstract arena class definition | 49 | /* AbstractArenaClass -- The abstract arena class definition |
| 60 | * | 50 | * |
| 61 | * .null: Most abstract class methods are set to NULL. See | 51 | * .null: Most abstract class methods are set to NULL. See |
| @@ -69,7 +59,7 @@ DEFINE_CLASS(AbstractArenaClass, class) | |||
| 69 | class->name = "ABSARENA"; | 59 | class->name = "ABSARENA"; |
| 70 | class->size = 0; | 60 | class->size = 0; |
| 71 | class->offset = 0; | 61 | class->offset = 0; |
| 72 | class->varargs = ArenaTrivVarargs; | 62 | class->varargs = ArgTrivVarargs; |
| 73 | class->init = NULL; | 63 | class->init = NULL; |
| 74 | class->finish = NULL; | 64 | class->finish = NULL; |
| 75 | class->reserved = NULL; | 65 | class->reserved = NULL; |
diff --git a/mps/code/arg.c b/mps/code/arg.c index d8ab7277008..75056285652 100644 --- a/mps/code/arg.c +++ b/mps/code/arg.c | |||
| @@ -167,6 +167,17 @@ void ArgRequire(ArgStruct *argOut, ArgList args, Key key) { | |||
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | /* ArgTrivVarargs -- class method to ignore deprecated varargs */ | ||
| 171 | |||
| 172 | void ArgTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs) | ||
| 173 | { | ||
| 174 | UNUSED(varargs); | ||
| 175 | args[0].key = MPS_KEY_ARGS_END; | ||
| 176 | AVER(ArgListCheck(args)); | ||
| 177 | } | ||
| 178 | |||
| 179 | |||
| 180 | |||
| 170 | /* C. COPYRIGHT AND LICENSE | 181 | /* C. COPYRIGHT AND LICENSE |
| 171 | * | 182 | * |
| 172 | * Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>. | 183 | * Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>. |
diff --git a/mps/code/arg.h b/mps/code/arg.h index e756da04182..2bcc80b0c61 100644 --- a/mps/code/arg.h +++ b/mps/code/arg.h | |||
| @@ -38,6 +38,7 @@ extern Bool ArgListCheck(ArgList args); | |||
| 38 | 38 | ||
| 39 | extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key); | 39 | extern Bool ArgPick(ArgStruct *argOut, ArgList args, Key key); |
| 40 | extern void ArgRequire(ArgStruct *argOut, ArgList args, Key key); | 40 | extern void ArgRequire(ArgStruct *argOut, ArgList args, Key key); |
| 41 | extern void ArgTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs); | ||
| 41 | 42 | ||
| 42 | extern Bool ArgCheckCant(Arg arg); | 43 | extern Bool ArgCheckCant(Arg arg); |
| 43 | extern Bool ArgCheckFormat(Arg arg); | 44 | extern Bool ArgCheckFormat(Arg arg); |
diff --git a/mps/code/buffer.c b/mps/code/buffer.c index d9af5933fcd..12d5c2dcbf3 100644 --- a/mps/code/buffer.c +++ b/mps/code/buffer.c | |||
| @@ -1064,15 +1064,6 @@ void BufferRampReset(Buffer buffer) | |||
| 1064 | /* BufferClass -- support for the basic Buffer class */ | 1064 | /* BufferClass -- support for the basic Buffer class */ |
| 1065 | 1065 | ||
| 1066 | 1066 | ||
| 1067 | /* bufferTrivVarargs -- basic buffer varargs method */ | ||
| 1068 | |||
| 1069 | static void bufferTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs) { | ||
| 1070 | UNUSED(varargs); | ||
| 1071 | args[0].key = MPS_KEY_ARGS_END; | ||
| 1072 | AVER(ArgListCheck(args)); | ||
| 1073 | } | ||
| 1074 | |||
| 1075 | |||
| 1076 | /* bufferTrivInit -- basic buffer init method */ | 1067 | /* bufferTrivInit -- basic buffer init method */ |
| 1077 | 1068 | ||
| 1078 | static Res bufferTrivInit(Buffer buffer, Pool pool, ArgList args) | 1069 | static Res bufferTrivInit(Buffer buffer, Pool pool, ArgList args) |
| @@ -1215,7 +1206,7 @@ DEFINE_CLASS(BufferClass, class) | |||
| 1215 | INHERIT_CLASS(&class->protocol, ProtocolClass); | 1206 | INHERIT_CLASS(&class->protocol, ProtocolClass); |
| 1216 | class->name = "BUFFER"; | 1207 | class->name = "BUFFER"; |
| 1217 | class->size = sizeof(BufferStruct); | 1208 | class->size = sizeof(BufferStruct); |
| 1218 | class->varargs = bufferTrivVarargs; | 1209 | class->varargs = ArgTrivVarargs; |
| 1219 | class->init = bufferTrivInit; | 1210 | class->init = bufferTrivInit; |
| 1220 | class->finish = bufferTrivFinish; | 1211 | class->finish = bufferTrivFinish; |
| 1221 | class->attach = bufferTrivAttach; | 1212 | class->attach = bufferTrivAttach; |
diff --git a/mps/code/mpm.h b/mps/code/mpm.h index ced8ec3e4f6..4292f9fa671 100644 --- a/mps/code/mpm.h +++ b/mps/code/mpm.h | |||
| @@ -219,7 +219,6 @@ extern void PoolTraceEnd(Pool pool, Trace trace); | |||
| 219 | extern void PoolWalk(Pool pool, Seg seg, FormattedObjectsStepMethod f, | 219 | extern void PoolWalk(Pool pool, Seg seg, FormattedObjectsStepMethod f, |
| 220 | void *v, size_t s); | 220 | void *v, size_t s); |
| 221 | extern void PoolFreeWalk(Pool pool, FreeBlockStepMethod f, void *p); | 221 | extern void PoolFreeWalk(Pool pool, FreeBlockStepMethod f, void *p); |
| 222 | extern void PoolTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs); | ||
| 223 | extern Res PoolTrivInit(Pool pool, ArgList arg); | 222 | extern Res PoolTrivInit(Pool pool, ArgList arg); |
| 224 | extern void PoolTrivFinish(Pool pool); | 223 | extern void PoolTrivFinish(Pool pool); |
| 225 | extern Res PoolNoAlloc(Addr *pReturn, Pool pool, Size size, | 224 | extern Res PoolNoAlloc(Addr *pReturn, Pool pool, Size size, |
diff --git a/mps/code/poolabs.c b/mps/code/poolabs.c index c29f409ae9b..212fa76a44c 100644 --- a/mps/code/poolabs.c +++ b/mps/code/poolabs.c | |||
| @@ -122,7 +122,7 @@ DEFINE_CLASS(AbstractPoolClass, class) | |||
| 122 | class->size = 0; | 122 | class->size = 0; |
| 123 | class->offset = 0; | 123 | class->offset = 0; |
| 124 | class->attr = 0; | 124 | class->attr = 0; |
| 125 | class->varargs = PoolTrivVarargs; | 125 | class->varargs = ArgTrivVarargs; |
| 126 | class->init = PoolTrivInit; | 126 | class->init = PoolTrivInit; |
| 127 | class->finish = PoolTrivFinish; | 127 | class->finish = PoolTrivFinish; |
| 128 | class->alloc = PoolNoAlloc; | 128 | class->alloc = PoolNoAlloc; |
| @@ -195,13 +195,6 @@ void PoolTrivFinish(Pool pool) | |||
| 195 | NOOP; | 195 | NOOP; |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | void PoolTrivVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs) | ||
| 199 | { | ||
| 200 | UNUSED(varargs); | ||
| 201 | args[0].key = MPS_KEY_ARGS_END; | ||
| 202 | AVER(ArgListCheck(args)); | ||
| 203 | } | ||
| 204 | |||
| 205 | Res PoolTrivInit(Pool pool, ArgList args) | 198 | Res PoolTrivInit(Pool pool, ArgList args) |
| 206 | { | 199 | { |
| 207 | AVERT(Pool, pool); | 200 | AVERT(Pool, pool); |