--- a/KeypointXML.c
+++ b/KeypointXML.c
@@ -25,19 +25,19 @@
 
 static char* String(const xmlChar* str) {
   char* value;
-  value = strdup(str);
+  value = strdup((char *)str);
   return value;
 }
 
 static int Int(const xmlChar* str) {
   int value;
-  sscanf(str, "%d", &value);
+  sscanf((char *)str, "%d", &value);
   return value;
 }
 
 static double Double(const xmlChar* str) {
   double value;
-  sscanf(str, "%lf", &value);
+  sscanf((char *)str, "%lf", &value);
   return value;
 }
 
@@ -57,89 +57,89 @@
     ret = xmlTextReaderRead(reader);
     while (ret == 1) {
 	name = xmlTextReaderConstName(reader);
-	if (xmlStrcmp(name, "KeypointXMLList")==0) {
+	if (xmlStrcmp( name, (xmlChar*) "KeypointXMLList")==0) {
 	    kl = KeypointXMLList_new0();
 	    ret = xmlTextReaderRead(reader);
 	    while (ret == 1) {
 		name = xmlTextReaderConstName(reader);
-		if (xmlStrcmp(name, "XDim")==0 && xmlTextReaderNodeType(reader)==1) {
+		if (xmlStrcmp(name, (xmlChar*) "XDim")==0 && xmlTextReaderNodeType(reader)==1) {
 		    ret = xmlTextReaderRead(reader);
 		    if (xmlTextReaderHasValue(reader))
 			kl->xDim = Int(xmlTextReaderConstValue(reader));
-		} else if (xmlStrcmp(name, "YDim")==0 && xmlTextReaderNodeType(reader)==1) {
+		} else if (xmlStrcmp(name, (xmlChar*) "YDim")==0 && xmlTextReaderNodeType(reader)==1) {
 		    ret = xmlTextReaderRead(reader);
 		    if (xmlTextReaderHasValue(reader))
 			kl->yDim = Int(xmlTextReaderConstValue(reader));
-		} else if (xmlStrcmp(name, "ImageFile")==0 && xmlTextReaderNodeType(reader)==1) {
+		} else if (xmlStrcmp(name, (xmlChar*) "ImageFile")==0 && xmlTextReaderNodeType(reader)==1) {
 		    ret = xmlTextReaderRead(reader);
 		    if (xmlTextReaderHasValue(reader) && xmlTextReaderNodeType(reader)==3)
 			kl->imageFile = String(xmlTextReaderConstValue(reader));
-		} else if (xmlStrcmp(name, "Arr")==0 && xmlTextReaderNodeType(reader)==1) {
+		} else if (xmlStrcmp(name, (xmlChar*) "Arr")==0 && xmlTextReaderNodeType(reader)==1) {
 		    ret = xmlTextReaderRead(reader);
 		    while (ret == 1) {
 			name = xmlTextReaderConstName(reader);
-			if (xmlStrcmp(name, "KeypointN")==0 && xmlTextReaderNodeType(reader)==1) {
+			if (xmlStrcmp(name, (xmlChar*) "KeypointN")==0 && xmlTextReaderNodeType(reader)==1) {
 			    KeypointN* kp = KeypointN_new0();
 			    ret = xmlTextReaderRead(reader);
 			    while (ret == 1) {
 				name = xmlTextReaderConstName(reader);
-				if (xmlStrcmp(name, "X")==0 && xmlTextReaderNodeType(reader)==1) {
+				if (xmlStrcmp(name, (xmlChar*) "X")==0 && xmlTextReaderNodeType(reader)==1) {
 				    ret = xmlTextReaderRead(reader);
 				    if (xmlTextReaderHasValue(reader))
 					kp->x = Double(xmlTextReaderConstValue(reader));
-				} else if (xmlStrcmp(name, "Y")==0 && xmlTextReaderNodeType(reader)==1) {
+				} else if (xmlStrcmp(name, (xmlChar*) "Y")==0 && xmlTextReaderNodeType(reader)==1) {
 				    ret = xmlTextReaderRead(reader);
 				    if (xmlTextReaderHasValue(reader))
 					kp->y = Double(xmlTextReaderConstValue(reader));
-				} else if (xmlStrcmp(name, "Scale")==0 && xmlTextReaderNodeType(reader)==1) {
+				} else if (xmlStrcmp(name, (xmlChar*) "Scale")==0 && xmlTextReaderNodeType(reader)==1) {
 				    ret = xmlTextReaderRead(reader);
 				    if (xmlTextReaderHasValue(reader))
 					kp->scale = Double(xmlTextReaderConstValue(reader));
-				} else if (xmlStrcmp(name, "Orientation")==0 && xmlTextReaderNodeType(reader)==1) {
+				} else if (xmlStrcmp(name, (xmlChar*) "Orientation")==0 && xmlTextReaderNodeType(reader)==1) {
 				    ret = xmlTextReaderRead(reader);
 				    if (xmlTextReaderHasValue(reader))
 					kp->orientation = Double(xmlTextReaderConstValue(reader));
-				} else if (xmlStrcmp(name, "Dim")==0 && xmlTextReaderNodeType(reader)==1) {
+				} else if (xmlStrcmp(name, (xmlChar*) "Dim")==0 && xmlTextReaderNodeType(reader)==1) {
 				    ret = xmlTextReaderRead(reader);
 				    if (xmlTextReaderHasValue(reader))
 					kp->dim = Int(xmlTextReaderConstValue(reader));
-				} else if (xmlStrcmp(name, "Descriptor")==0 && xmlTextReaderNodeType(reader)==1) {
+				} else if (xmlStrcmp(name, (xmlChar*) "Descriptor")==0 && xmlTextReaderNodeType(reader)==1) {
 				    KeypointN_CreateDescriptor(kp);
 				    int i=0;
 				    while (ret == 1) {
 					name = xmlTextReaderConstName(reader);
-					if (xmlStrcmp(name, "int")==0 && xmlTextReaderNodeType(reader)==1) {
+					if (xmlStrcmp(name, (xmlChar*) "int")==0 && xmlTextReaderNodeType(reader)==1) {
 					    if (xmlTextReaderNodeType(reader)==1) {
 						ret = xmlTextReaderRead(reader);
 						if (xmlTextReaderHasValue(reader))
 						    kp->descriptor[i++] = Int(xmlTextReaderConstValue(reader));
 					    }
 					}
-					if (strcmp(name, "Descriptor")==0 && xmlTextReaderNodeType(reader)==15) {
+					if (xmlStrcmp(name, (xmlChar*) "Descriptor")==0 && xmlTextReaderNodeType(reader)==15) {
 					    break;
 					}
 					ret = xmlTextReaderRead(reader);
 				    }
 				}
-				if (strcmp(name, "Descriptor")==0 && xmlTextReaderNodeType(reader)==15) {
+				if (xmlStrcmp(name, (xmlChar*) "Descriptor")==0 && xmlTextReaderNodeType(reader)==15) {
 				    break;
 				}
 				ret = xmlTextReaderRead(reader);
 			    }
 			    KeypointXMLList_Add(kl, kp);
-			    if (strcmp(name, "KeypointN")==0 && xmlTextReaderNodeType(reader)==15) {
+			    if (xmlStrcmp(name, (xmlChar*) "KeypointN")==0 && xmlTextReaderNodeType(reader)==15) {
 				break;
 			    }
 			}
 			ret = xmlTextReaderRead(reader);
 		    }
-		    if (strcmp(name, "Arr")==0 && xmlTextReaderNodeType(reader)==15) {
+		    if (xmlStrcmp(name, (xmlChar*)"Arr")==0 && xmlTextReaderNodeType(reader)==15) {
 			break;
 		    }
 		}
 		ret = xmlTextReaderRead(reader);
 	    }
-	    if (strcmp(name, "KeypointXMLList")==0 && xmlTextReaderNodeType(reader)==15) {
+	    if (xmlStrcmp(name, (xmlChar*) "KeypointXMLList")==0 && xmlTextReaderNodeType(reader)==15) {
 		break;
 	    }
 	}
@@ -212,53 +212,53 @@
 	writer = xmlNewTextWriterFilename(filename, compressed);
 	if (writer != NULL) {
 		rc = xmlTextWriterSetIndent(writer, 1);
-		rc = xmlTextWriterSetIndentString(writer, "  ");
+		rc = xmlTextWriterSetIndentString(writer, (xmlChar*) "  ");
 
 		rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL);
-		rc = xmlTextWriterStartElement(writer, "KeypointXMLList");
-
-		rc = xmlTextWriterStartElement(writer, "XDim");
+		rc = xmlTextWriterStartElement(writer, (xmlChar*)"KeypointXMLList");
+
+		rc = xmlTextWriterStartElement(writer, (xmlChar*)"XDim");
 		rc = xmlTextWriterWriteFormatString(writer, "%d", x);
 		rc = xmlTextWriterEndElement(writer);
 
-		rc = xmlTextWriterStartElement(writer, "YDim");
+		rc = xmlTextWriterStartElement(writer, (xmlChar*)"YDim");
 		rc = xmlTextWriterWriteFormatString(writer, "%d", y);
 		rc = xmlTextWriterEndElement(writer);
 
-		rc = xmlTextWriterStartElement(writer, "ImageFile");
-		rc = xmlTextWriterWriteString(writer, imageFile);
+		rc = xmlTextWriterStartElement(writer, (xmlChar*)"ImageFile");
+		rc = xmlTextWriterWriteString(writer, (xmlChar*)imageFile);
 		rc = xmlTextWriterEndElement(writer);
 
-		rc = xmlTextWriterStartElement(writer, "Arr");
+		rc = xmlTextWriterStartElement(writer, (xmlChar*)"Arr");
 		int n;
 		for (n=0; n<ArrayList_Count(list); n++) {
-			KeypointN* kp = ArrayList_GetItem(list, n);
-			rc = xmlTextWriterStartElement(writer, "KeypointN");
-
-			rc = xmlTextWriterStartElement(writer, "X");
+			KeypointN* kp = (KeypointN*) ArrayList_GetItem(list, n);
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"KeypointN");
+
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"X");
 			rc = xmlTextWriterWriteFormatString(writer, "%.15g", kp->x);
 			rc = xmlTextWriterEndElement(writer);
 
-			rc = xmlTextWriterStartElement(writer, "Y");
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"Y");
 			rc = xmlTextWriterWriteFormatString(writer, "%.15g", kp->y);
 			rc = xmlTextWriterEndElement(writer);
 
-			rc = xmlTextWriterStartElement(writer, "Scale");
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"Scale");
 			rc = xmlTextWriterWriteFormatString(writer, "%.15g", kp->scale);
 			rc = xmlTextWriterEndElement(writer);
 
-			rc = xmlTextWriterStartElement(writer, "Orientation");
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"Orientation");
 			rc = xmlTextWriterWriteFormatString(writer, "%.15g", kp->orientation);
 			rc = xmlTextWriterEndElement(writer);
 
-			rc = xmlTextWriterStartElement(writer, "Dim");
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"Dim");
 			rc = xmlTextWriterWriteFormatString(writer, "%d", kp->dim);
 			rc = xmlTextWriterEndElement(writer);
 			
-			rc = xmlTextWriterStartElement(writer, "Descriptor");
+			rc = xmlTextWriterStartElement(writer, (xmlChar*)"Descriptor");
 			int i;
 			for(i=0; i< kp->dim; i++) {
-				rc = xmlTextWriterStartElement(writer, "int");
+				rc = xmlTextWriterStartElement(writer, (xmlChar*)"int");
 				rc = xmlTextWriterWriteFormatString(writer, "%d", kp->descriptor[i]);
 				rc = xmlTextWriterEndElement(writer);
 				
@@ -282,8 +282,8 @@
 KeypointN* KeypointN_new0 ()
 {
   KeypointN* self = (KeypointN*)malloc(sizeof(KeypointN));
-  self->domain.getDimensionCount = (void*)KeypointN_GetDimensionCount;
-  self->domain.getDimensionElement = (void*)KeypointN_GetDimensionElement;
+  self->domain.getDimensionCount = (int ( *)(IKDTreeDomain *)) KeypointN_GetDimensionCount;
+  self->domain.getDimensionElement = (int (__cdecl *)(IKDTreeDomain *,int)) KeypointN_GetDimensionElement;
   self->dim = 0;
   self->descriptor = NULL;
   return self;