[m-rev.] for review: <lvalue cast cleanups in extras>

Keri Harris harriskeri at clear.net.nz
Sun Apr 2 20:05:34 AEST 2006


Estimated hours taken: 1

extras/concurrency/global.m
extras/curs/curs.m
extras/graphics/mercury_tcltk/mtcltk.m
extras/odbc/odbc.m
- fix 'invalid lvalue in assignment' errors when compiling with gcc4.x



Index: extras/concurrency/global.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/concurrency/global.m,v
retrieving revision 1.3
diff -u -B -r1.3 global.m
--- extras/concurrency/global.m	28 Feb 2003 15:20:33 -0000	1.3
+++ extras/concurrency/global.m	1 Apr 2006 02:53:31 -0000
@@ -54,7 +54,7 @@

 :- pragma c_code(global__new(Thing::in, Glob::out, IO0::di, IO::uo),

 		will_not_call_mercury, "{
 	MR_Word *tmp;
-	MR_incr_hp((MR_Word) tmp, 1);
+	MR_incr_hp((*(MR_Word*)&(tmp)), 1);
 	*tmp = Thing;
 	Glob = (MR_Word) tmp;
 	IO = IO0;
Index: extras/curs/curs.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curs/curs.m,v
retrieving revision 1.6
diff -u -B -r1.6 curs.m
--- extras/curs/curs.m	26 Oct 2005 05:04:14 -0000	1.6
+++ extras/curs/curs.m	1 Apr 2006 02:53:33 -0000
@@ -965,7 +965,7 @@
         wattrset(w, Attr);
         wcolor_set(w, Attr, NULL);
         wclear(w);
-        (PANEL *)Panel = new_panel(w);
+        (*(PANEL**)&(Panel)) = new_panel(w);

         IO = IO0;

Index: extras/graphics/mercury_tcltk/mtcltk.m
===================================================================
RCS
file:
 /home/mercury1/repository/mercury/extras/graphics/mercury_tcltk/mtcltk.m,v
 retrieving revision 1.9
diff -u -B -r1.9 mtcltk.m
--- extras/graphics/mercury_tcltk/mtcltk.m	15 Aug 2005 04:11:42 -0000	1.9
+++ extras/graphics/mercury_tcltk/mtcltk.m	1 Apr 2006 02:53:34 -0000
@@ -141,7 +141,7 @@
 		argc++;
 	}

-	MR_incr_hp(MR_LVALUE_CAST(MR_Word, argv), argc + 1);
+	MR_incr_hp((*(MR_Word*)&(argv)), argc + 1);

 	for (i = 0, l = Args; l != list_empty(); l = list_tail(l), i++) {
 		argv[i] = (char *) MR_list_head(l);
Index: extras/odbc/odbc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/odbc/odbc.m,v
retrieving revision 1.19
diff -u -B -r1.19 odbc.m
--- extras/odbc/odbc.m	30 Mar 2006 01:21:18 -0000	1.19
+++ extras/odbc/odbc.m	1 Apr 2006 02:53:41 -0000
@@ -1549,7 +1549,7 @@
 			** column->value_info == length of data
 			*/
 			column->size = column->value_info + 1;
-			MR_incr_hp_atomic(MR_LVALUE_CAST(MR_Word, column->data),
+			MR_incr_hp_atomic((*(MR_Word*)&(column->data)),
 				(column->size + sizeof(MR_Word)) / sizeof(MR_Word));
 			odbc_get_data_in_one_go(stat, column_id);
 		}

-- 
Public Key:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x756D6F67
Key fingerprint = 7319 FA7D D2DD AED9 DF17 460B 2486 B12A 756D 6F67
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20060402/ad2fc311/attachment.sig>


More information about the reviews mailing list