[m-rev.] trivial diff: fix gcc warnings in rtti_implementation.m

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 4 18:37:16 AEDT 2003


Estimated hours taken: 0.5
Branches: main

library/rtti_implementation.m:
	Fix a bug introduced by petdr in revision 1.38: there were some
	type errors in the C and MC++ code for null/0 and null/1, which
	resulted in warnings from GCC (and potentially errors from other
	C compilers).

Workspace: /home/ceres/fjh/mercury
Index: library/rtti_implementation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/rtti_implementation.m,v
retrieving revision 1.39
diff -u -d -r1.39 rtti_implementation.m
--- library/rtti_implementation.m	17 Jan 2003 05:56:50 -0000	1.39
+++ library/rtti_implementation.m	28 Jan 2003 17:22:09 -0000
@@ -2208,12 +2208,12 @@
 :- pragma foreign_proc("C", null(S::in),
 		[will_not_call_mercury, thread_safe, promise_pure],
 "
-	SUCCESS_INDICATOR = (S == NULL);
+	SUCCESS_INDICATOR = ((void *)S == NULL);
 ").
 :- pragma foreign_proc("MC++", null(S::in),
 		[will_not_call_mercury, thread_safe, promise_pure],
 "
-	SUCCESS_INDICATOR = (S == NULL);
+	SUCCESS_INDICATOR = (S == 0);
 ").
 null(_) :-
 	% This version is only used for back-ends for which there is no
@@ -2226,12 +2226,12 @@
 :- pragma foreign_proc("C", null = (T::out),
 		[will_not_call_mercury, thread_safe, promise_pure],
 "
-	T = NULL;
+	T = (MR_Word) NULL;
 ").
 :- pragma foreign_proc("MC++", null = (T::out),
 		[will_not_call_mercury, thread_safe, promise_pure],
 "
-	T = NULL;
+	T = 0;
 ").
 null = _ :-
 	% This version is only used for back-ends for which there is no

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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