src/raytracermodule.cc
branchpyrit
changeset 60 a23b5089b9c3
parent 59 64e456ab823d
child 69 303583d2fb97
--- a/src/raytracermodule.cc	Fri Apr 04 13:54:47 2008 +0200
+++ b/src/raytracermodule.cc	Tue Apr 08 01:05:12 2008 +0200
@@ -736,7 +736,7 @@
 static PyObject* Raytracer_render(PyObject* self, PyObject* args)
 {
 	int w = 0, h = 0;
-	char *chardata;
+	unsigned char *chardata;
 	Float *data;
 	PyObject *o;
 
@@ -756,9 +756,9 @@
 
 	// convert data to char
 	printf("[pyrit] Converting image data (float to char)\n");
-	chardata = (char *) malloc(w*h*3);
+	chardata = (unsigned char *) malloc(w*h*3);
 	Float *d = data;
-	for (char *c = chardata; c != chardata + w*h*3; c++, d++) {
+	for (unsigned char *c = chardata; c != chardata + w*h*3; c++, d++) {
 		if (*d > 1.0)
 			*c = 255;
 		else