changeset 285:bb1539decd62

Fix const warning in sdl module
author Michael Pavone <pavone@retrodev.com>
date Tue, 22 Jul 2014 08:35:30 -0700
parents 99c18127da04
children ddf38b66b2e2
files cbackend.js modules/sdl.tp
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cbackend.js	Tue Jul 22 08:32:39 2014 -0700
+++ b/cbackend.js	Tue Jul 22 08:35:30 2014 -0700
@@ -275,6 +275,11 @@
 funcall.prototype.toCTypeName = function() {
 	switch(this.name)
 	{
+	case 'const:':
+	case 'const':
+		var receiver = this.receiver ? this.receiver : this.args[0];
+		return  'const ' + receiver.toCTypeName();
+		break;
 	case 'ptr:':
 	case 'ptr':
 		var receiver = this.receiver ? this.receiver : this.args[0];
--- a/modules/sdl.tp	Tue Jul 22 08:32:39 2014 -0700
+++ b/modules/sdl.tp	Tue Jul 22 08:35:30 2014 -0700
@@ -393,7 +393,7 @@
 
 		llMessage: getError withVars: {
 			str <- string ptr
-			rawstr <- char ptr
+			rawstr <- const: (char ptr)
 		} andCode: {
 			rawstr <- SDL_GetError:
 			str <- make_object: (addr_of: string_meta) NULL 0