mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 16:51:06 -07:00
Avoid using deprecated function mps_fix and deprecated macro mps_fix in the test cases; use mps_fix12 instead.
Copied from Perforce Change: 193726
This commit is contained in:
parent
f294e06f1c
commit
9de5c1dfbe
16 changed files with 54 additions and 42 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/* eventpy.c: GENERATE PYTHON INTERFACE TO EVENTS
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2016 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2016-2018 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* This command-line program emits Python data structures that can be
|
||||
* used to parse an event stream in text format (as output by the
|
||||
|
|
@ -22,37 +22,37 @@ int main(int argc, char *argv[])
|
|||
printf("__version__ = %d, %d, %d\n", EVENT_VERSION_MAJOR,
|
||||
EVENT_VERSION_MEDIAN, EVENT_VERSION_MINOR);
|
||||
|
||||
puts("EventKind = namedtuple('EventKind', 'name code doc')");
|
||||
puts("class kind:");
|
||||
puts("KindDesc = namedtuple('KindDesc', 'name code doc')");
|
||||
puts("class Kind:");
|
||||
#define ENUM(_, NAME, DOC) \
|
||||
printf(" " #NAME " = EventKind('" #NAME "', %d, \"%s\")\n", \
|
||||
printf(" " #NAME " = KindDesc('" #NAME "', %d, \"%s\")\n", \
|
||||
EventKind ## NAME, DOC);
|
||||
EventKindENUM(ENUM, _);
|
||||
#undef ENUM
|
||||
|
||||
puts("kinds = {");
|
||||
puts("KIND = {");
|
||||
#define ENUM(_, NAME, _1) \
|
||||
printf(" %d: kind." #NAME ",\n", EventKind ## NAME);
|
||||
printf(" %d: Kind." #NAME ",\n", EventKind ## NAME);
|
||||
EventKindENUM(ENUM, _);
|
||||
#undef ENUM
|
||||
puts("}");
|
||||
|
||||
puts("EventParam = namedtuple('EventParam', 'sort, name')");
|
||||
puts("Event = namedtuple('Event', 'name code always kind params')");
|
||||
puts("class event:");
|
||||
puts("EventParam = namedtuple('EventParam', 'sort name')");
|
||||
puts("EventDesc = namedtuple('EventDesc', 'name code always kind params')");
|
||||
puts("class Event:");
|
||||
#define EVENT_PARAM(X, INDEX, SORT, NAME) \
|
||||
puts(" EventParam('" #SORT "', '" #NAME "'),");
|
||||
#define EVENT_DEFINE(X, NAME, CODE, ALWAYS, KIND) \
|
||||
printf(" " #NAME " = Event('" #NAME "', %d, %s, kind." #KIND ", [\n", \
|
||||
printf(" " #NAME " = EventDesc('" #NAME "', %d, %s, Kind." #KIND ", [\n", \
|
||||
CODE, ALWAYS ? "True" : "False"); \
|
||||
EVENT_ ## NAME ## _PARAMS(EVENT_PARAM, X); \
|
||||
puts(" ]);");
|
||||
puts(" ])");
|
||||
EVENT_LIST(EVENT_DEFINE, 0);
|
||||
#undef EVENT
|
||||
|
||||
puts("events = {");
|
||||
puts("EVENT = {");
|
||||
#define EVENT_ITEM(X, NAME, CODE, ALWAYS, KIND) \
|
||||
printf(" %d: event." #NAME ",\n", CODE);
|
||||
printf(" %d: Event." #NAME ",\n", CODE);
|
||||
EVENT_LIST(EVENT_ITEM, 0);
|
||||
#undef EVENT
|
||||
puts("}");
|
||||
|
|
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (c) 2016 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (c) 2016-2018 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* fmtdy.c: DYLAN OBJECT FORMAT IMPLEMENTATION
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2018 Ravenbrook Limited. See end of file for license.
|
||||
* Portions copyright (c) 2002 Global Graphics Software.
|
||||
*
|
||||
* .readership: MPS developers, Dylan developers
|
||||
|
|
@ -407,8 +407,11 @@ extern mps_res_t dylan_scan1(mps_ss_t mps_ss, mps_addr_t *object_io)
|
|||
return MPS_RES_OK;
|
||||
}
|
||||
|
||||
res = mps_fix(mps_ss, p); /* fix the wrapper */
|
||||
if ( res != MPS_RES_OK ) return res;
|
||||
MPS_SCAN_BEGIN(mps_ss) {
|
||||
res = MPS_FIX12(mps_ss, p); /* fix the wrapper */
|
||||
} MPS_SCAN_END(mps_ss);
|
||||
if (res != MPS_RES_OK)
|
||||
return res;
|
||||
w = (mps_word_t *)p[0]; /* wrapper is header word */
|
||||
assert(dylan_wrapper_check(w));
|
||||
|
||||
|
|
@ -567,8 +570,11 @@ extern mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
|
|||
assert((h & 3) == 0);
|
||||
unused(h);
|
||||
|
||||
res = mps_fix(mps_ss, p);
|
||||
if ( res != MPS_RES_OK ) return res;
|
||||
MPS_SCAN_BEGIN(mps_ss) {
|
||||
res = MPS_FIX12(mps_ss, p);
|
||||
} MPS_SCAN_END(mps_ss);
|
||||
if (res != MPS_RES_OK)
|
||||
return res;
|
||||
|
||||
/* w points to wrapper */
|
||||
w = (mps_word_t *)p[0];
|
||||
|
|
@ -852,7 +858,7 @@ mps_res_t dylan_fmt_weak(mps_fmt_t *mps_fmt_o, mps_arena_t arena)
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2018 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* mpsi.c: MEMORY POOL SYSTEM C INTERFACE LAYER
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001-2016 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2018 Ravenbrook Limited. See end of file for license.
|
||||
* Portions copyright (c) 2002 Global Graphics Software.
|
||||
*
|
||||
* .purpose: This code bridges between the MPS interface to C,
|
||||
|
|
@ -1697,7 +1697,7 @@ mps_res_t mps_fix(mps_ss_t mps_ss, mps_addr_t *ref_io)
|
|||
mps_res_t res;
|
||||
|
||||
MPS_SCAN_BEGIN(mps_ss) {
|
||||
res = MPS_FIX(mps_ss, ref_io);
|
||||
res = MPS_FIX12(mps_ss, ref_io);
|
||||
} MPS_SCAN_END(mps_ss);
|
||||
|
||||
return res;
|
||||
|
|
@ -2159,7 +2159,7 @@ void _mps_args_set_key(mps_arg_s args[MPS_ARGS_MAX], unsigned i,
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2016 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2018 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ Very briefly, the critical path consists of five stages:
|
|||
write a good scanner. Then that could be linked from here.
|
||||
|
||||
#. The first-stage fix, which filters out pointers inline in the
|
||||
scanner. This is implemented in ``MPS_FIX()`` macros in
|
||||
scanner. This is implemented in the ``MPS_FIX1()`` macro in
|
||||
mps.h_.
|
||||
|
||||
.. _mps.h: ../code/mps.h
|
||||
|
|
@ -377,7 +377,7 @@ Document History
|
|||
Copyright and License
|
||||
---------------------
|
||||
|
||||
Copyright © 2012-2014 Ravenbrook Limited. All rights reserved.
|
||||
Copyright © 2012-2018 Ravenbrook Limited. All rights reserved.
|
||||
<http://www.ravenbrook.com/>. This is an open source license. Contact
|
||||
Ravenbrook for commercial licensing options.
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,9 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
the pun would probably work fine almost everywhere)
|
||||
*/
|
||||
comment("About to fix with null scan state...");
|
||||
res = mps_fix(NULL, (mps_addr_t *) &p);
|
||||
MPS_SCAN_BEGIN(ss) {
|
||||
res = MPS_FIX12(NULL, (mps_addr_t *) &p);
|
||||
} MPS_SCAN_END(ss);
|
||||
error("fix with NULL scan state");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -222,7 +222,9 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
the pun would probably work fine almost everywhere)
|
||||
*/
|
||||
comment("About to fix with unaligned scan state...");
|
||||
res = mps_fix(UNALIGNED, (mps_addr_t *) &p);
|
||||
MPS_SCAN_BEGIN(ss) {
|
||||
res = MPS_FIX12(UNALIGNED, (mps_addr_t *) &p);
|
||||
} MPS_SCAN_END(ss);
|
||||
error("fix with unaligned scan state");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -221,7 +221,9 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
the pun would probably work fine almost everywhere)
|
||||
*/
|
||||
comment("About to fix with null pointer...");
|
||||
res = mps_fix(ss, NULL);
|
||||
MPS_SCAN_BEGIN(ss) {
|
||||
res = MPS_FIX2(ss, NULL);
|
||||
} MPS_SCAN_END(ss);
|
||||
error("fix with null pointer");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
*/
|
||||
comment("About to fix with null pointer...");
|
||||
p = NULL;
|
||||
res = mps_fix(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
error("fix with null pointer");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
the pun would probably work fine almost everywhere)
|
||||
*/
|
||||
comment("About to fix on unaligned addr...");
|
||||
res = mps_fix(ss, UNALIGNED);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) UNALIGNED);
|
||||
error("unaligned fix");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
*/
|
||||
comment("About to fix with unaligned pointer...");
|
||||
p = UNALIGNED;
|
||||
res = mps_fix(ss, &p);
|
||||
res = MPS_FIX2(ss, &p);
|
||||
error("fix with unaligned pointer");
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
p = obj->data.assoc;
|
||||
if (p != NULL) {
|
||||
commentif(fixcomments, "fix %li[assoc]", obj->data.id);
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
if (p == NULL) {
|
||||
commentif(deathcomments, "fixed %li[assoc] to NULL", obj->data.id);
|
||||
|
|
@ -250,7 +250,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
*/
|
||||
commentif(fixcomments, "fix %li[%i] -> %li",
|
||||
obj->data.id, i, obj->data.ref[i].id);
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (p == NULL) {
|
||||
commentif(deathcomments, "fixed %li[%i] to NULL", obj->data.id, i);
|
||||
INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT);
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
p = obj->data.assoc;
|
||||
if (p != NULL) {
|
||||
commentif(fixcomments, "fix %li[assoc]", obj->data.id);
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
if (p == NULL) {
|
||||
commentif(deathcomments, "fixed %li[assoc] to NULL", obj->data.id);
|
||||
|
|
@ -236,7 +236,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
*/
|
||||
commentif(fixcomments, "fix %li[%i] -> %li",
|
||||
obj->data.id, i, obj->data.ref[i].id);
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (p == NULL) {
|
||||
commentif(deathcomments, "fixed %li[%i] to NULL", obj->data.id, i);
|
||||
INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
/* make sure to fix the assoc pointer first */
|
||||
p = obj->data.assoc;
|
||||
if (p != NULL) {
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.assoc = p;
|
||||
}
|
||||
|
|
@ -161,7 +161,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
p = obj->data.ref[i].addr;
|
||||
if (p != NULL)
|
||||
{
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
if (obj->ref[0] != NULL)
|
||||
{
|
||||
if (formatcomments) printf("Fix: %p.\n", (void*)&(obj->ref[0]));
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &(obj->ref[0])); /* pun! */
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &(obj->ref[0])); /* pun! */
|
||||
if (res != MPS_RES_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -112,7 +112,7 @@ mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
if (obj->ref[1] != NULL)
|
||||
{
|
||||
if (formatcomments) printf("Fix: %p.\n", (void*)&(obj->ref[1]));
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &(obj->ref[1])); /* pun! */
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &(obj->ref[1])); /* pun! */
|
||||
if (res != MPS_RES_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
*/
|
||||
commentif(fixcomments, "fix %li[%i] -> %li",
|
||||
obj->data.id, i, obj->data.ref[i].id);
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
obj->data.ref[i].addr = p;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
if (p != NULL) {
|
||||
commentif(fixcomments, "fix %li[assoc]", obj->data.id);
|
||||
q = p;
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (res != MPS_RES_OK) return res;
|
||||
if (p == NULL) {
|
||||
asserts(rank == mps_rank_weak(),
|
||||
|
|
@ -387,7 +387,7 @@ static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit)
|
|||
commentif(fixcomments, "fix %li[%i] -> %li",
|
||||
obj->data.id, i, obj->data.ref[i].id);
|
||||
q = p;
|
||||
res = MPS_FIX(ss, (mps_addr_t *) &p);
|
||||
res = MPS_FIX12(ss, (mps_addr_t *) &p);
|
||||
if (p == NULL) {
|
||||
asserts(rank == mps_rank_weak(),
|
||||
"non-weak reference fixed to NULL at %p[i]", obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue