[m-dev.] diff: fix string.m warnings

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Nov 6 15:32:44 AEDT 2000


library/string.m:
	Fix C compiler warnings about shadowing String and about
	casting away const.

Zoltan.

Index: string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.133
diff -u -b -r1.133 string.m
--- string.m	2000/10/26 05:25:07	1.133
+++ string.m	2000/11/06 04:28:03
@@ -869,13 +869,13 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pragma c_code(string__sub_string_search(String::in, SubString::in,
+:- pragma c_code(string__sub_string_search(WholeString::in, SubString::in,
 			Index::out) , [will_not_call_mercury, thread_safe],
 "{
 	char *match;
-	match = strstr(String, SubString);
+	match = strstr(WholeString, SubString);
 	if (match) {
-		Index = match - String;
+		Index = match - WholeString;
 		SUCCESS_INDICATOR = TRUE;
 	} else {
 		SUCCESS_INDICATOR = FALSE;
@@ -1252,7 +1252,8 @@
 :- func int_length_modifer = string.
 :- pragma c_code(int_length_modifer = (LengthModifier::out),
 		[will_not_call_mercury, thread_safe], "{
-	MR_make_aligned_string(LengthModifier, MR_INTEGER_LENGTH_MODIFIER);
+	MR_make_aligned_string(LengthModifier,
+		(MR_String) (MR_Word) MR_INTEGER_LENGTH_MODIFIER);
 }").
 
 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list