[m-rev.] diff: add MR_ prefixes in extras/references
David Overton
dmo at cs.mu.OZ.AU
Mon Jan 21 16:22:06 AEDT 2002
Estimated hours taken: 0.5
Branches: main
extras/references/c_reference.h:
extras/references/nb_reference.m:
extras/references/reference.m:
extras/references/scoped_update.m:
Add "MR_" prefixes to a number of identifiers which were missing them.
Index: c_reference.h
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/c_reference.h,v
retrieving revision 1.1
diff -u -r1.1 c_reference.h
--- c_reference.h 28 Jan 2000 03:37:11 -0000 1.1
+++ c_reference.h 21 Jan 2002 05:20:25 -0000
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 1999-2000 University of Melbourne.
+** Copyright (C) 1999-2000,2002 University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
@@ -35,7 +35,7 @@
** ").
**
** :- pragma c_code(foo_reference = (X::out), will_not_call_mercury, "
-** X = (Word) &foo;
+** X = (MR_Word) &foo;
** ").
*/
@@ -49,7 +49,7 @@
MR_ChoicepointId id;
} ME_Reference;
-typedef Word ME_NbReference;
+typedef MR_Word ME_NbReference;
#endif /* not C_REFERENCE_H */
Index: nb_reference.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/nb_reference.m,v
retrieving revision 1.3
diff -u -r1.3 nb_reference.m
--- nb_reference.m 14 Apr 2000 07:20:21 -0000 1.3
+++ nb_reference.m 21 Jan 2002 05:20:25 -0000
@@ -1,5 +1,5 @@
%-----------------------------------------------------------------------------%
-% Copyright (C) 1998-2000 University of Melbourne.
+% Copyright (C) 1998-2000,2002 University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -52,7 +52,7 @@
% This type is implemented in C.
% Note that if the C type used to implement nb_references changes (from
-% something equivalent to `Word'), then `c_reference.h' should also be
+% something equivalent to `MR_Word'), then `c_reference.h' should also be
% updated.
:- type nb_reference(T) ---> nb_reference(c_pointer).
@@ -60,31 +60,31 @@
:- pragma inline(new_nb_reference/2).
:- pragma c_code(new_nb_reference(X::in, Ref::out), will_not_call_mercury, "
- incr_hp(Ref, 1);
+ MR_incr_hp(Ref, 1);
#ifndef CONSERVATIVE_GC
- save_transient_registers();
+ MR_save_transient_registers();
#endif
- *(Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
- (Word *) Ref);
+ *(MR_Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
+ (MR_Word *) Ref);
#ifndef CONSERVATIVE_GC
- restore_transient_registers();
+ MR_restore_transient_registers();
#endif
").
:- pragma inline(value/2).
:- pragma c_code(value(Ref::in, X::out), will_not_call_mercury, "
- X = *(Word *) Ref;
+ X = *(MR_Word *) Ref;
").
:- pragma inline(update/2).
:- pragma c_code(update(Ref::in, X::in), will_not_call_mercury, "
#ifndef CONSERVATIVE_GC
- save_transient_registers();
+ MR_save_transient_registers();
#endif
- *(Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
- (Word *) Ref);
+ *(MR_Word *) Ref = MR_make_long_lived(X, (MR_TypeInfo) TypeInfo_for_T,
+ (MR_Word *) Ref);
#ifndef CONSERVATIVE_GC
- restore_transient_registers();
+ MR_restore_transient_registers();
#endif
").
Index: reference.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/reference.m,v
retrieving revision 1.3
diff -u -r1.3 reference.m
--- reference.m 28 Jan 2000 03:37:12 -0000 1.3
+++ reference.m 21 Jan 2002 05:20:25 -0000
@@ -1,5 +1,5 @@
%-----------------------------------------------------------------------------%
-% Copyright (C) 1998-2000 University of Melbourne.
+% Copyright (C) 1998-2000,2002 University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -55,22 +55,23 @@
:- pragma inline(new_reference/2).
:- pragma c_code(new_reference(X::in, Ref::out), will_not_call_mercury, "
- incr_hp(Ref, (sizeof(ME_Reference) + sizeof(Word) - 1) / sizeof(Word));
+ MR_incr_hp(Ref, (sizeof(ME_Reference) + sizeof(MR_Word) - 1) /
+ sizeof(MR_Word));
((ME_Reference *) Ref)->value = (void *) X;
((ME_Reference *) Ref)->id = MR_current_choicepoint_id();
").
:- pragma inline(value/2).
:- pragma c_code(value(Ref::in, X::out), will_not_call_mercury, "
- X = (Word) ((ME_Reference *) Ref)->value;
+ X = (MR_Word) ((ME_Reference *) Ref)->value;
").
:- pragma inline(update/2).
:- pragma c_code(update(Ref::in, X::in), will_not_call_mercury, "
ME_Reference *ref = (ME_Reference *) Ref;
if (ref->id != MR_current_choicepoint_id()) {
- MR_trail_current_value((Word *) (&ref->value));
- MR_trail_current_value((Word *) (&ref->id));
+ MR_trail_current_value((MR_Word *) (&ref->value));
+ MR_trail_current_value((MR_Word *) (&ref->id));
ref->id = MR_current_choicepoint_id();
}
ref->value = (void *) X;
Index: scoped_update.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/scoped_update.m,v
retrieving revision 1.2
diff -u -r1.2 scoped_update.m
--- scoped_update.m 8 Oct 1999 02:56:02 -0000 1.2
+++ scoped_update.m 21 Jan 2002 05:20:25 -0000
@@ -1,5 +1,5 @@
%-----------------------------------------------------------------------------%
-% Copyright (C) 1998-1999 University of Melbourne.
+% Copyright (C) 1998-1999,2002 University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -76,9 +76,9 @@
*/
typedef struct {
- Word *var;
- Word insideval;
- Word outsideval;
+ MR_Word *var;
+ MR_Word insideval;
+ MR_Word outsideval;
} *ME_ScopeHandle;
void ME_enter_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason);
@@ -145,8 +145,8 @@
ME_untrail_msg(""ME_exit_scope_failing: ""
""commit/solve\n"");
/* This *may* help GC collect more garbage */
- handle->var = (Word *) 0;
- handle->outsideval = handle->insideval = (Word) 0;
+ handle->var = (MR_Word *) 0;
+ handle->outsideval = handle->insideval = (MR_Word) 0;
break;
default:
@@ -161,18 +161,18 @@
:- pragma c_code(enter_scope(Ptr::in, Scoped_update_handle::muo),
will_not_call_mercury, "
- Word rec;
+ MR_Word rec;
ME_ScopeHandle handle;
- incr_hp(rec, (sizeof(*handle) + sizeof(Word) - 1) / sizeof(Word));
+ MR_incr_hp(rec, (sizeof(*handle) + sizeof(MR_Word) - 1) / sizeof(MR_Word));
handle = (ME_ScopeHandle) rec;
- handle->var = (Word *) Ptr;
- handle->insideval = handle->outsideval = *(Word *) Ptr;
+ handle->var = (MR_Word *) Ptr;
+ handle->insideval = handle->outsideval = *(MR_Word *) Ptr;
MR_trail_function(ME_exit_scope_failing, handle);
ME_show_handle("">> enter scope: "", handle);
- Scoped_update_handle = (Word) handle;
+ Scoped_update_handle = (MR_Word) handle;
").
:- pragma c_code(exit_scope(Handle::mdi), will_not_call_mercury, "
--
David Overton Department of Computer Science & Software Engineering
PhD Student The University of Melbourne, Victoria 3010, Australia
+61 3 8344 9159 http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list