Index: trunk/FACT++/dim/src/webDid/webDid.c
===================================================================
--- trunk/FACT++/dim/src/webDid/webDid.c	(revision 14937)
+++ trunk/FACT++/dim/src/webDid/webDid.c	(revision 15282)
@@ -15,4 +15,5 @@
 	int match;
 	int busy;
+	int isSMI;
 }SERVER;
 
@@ -23,4 +24,5 @@
 	int match;
 	int busy;
+	int hasSMI;
 }NODE;
 NODE *Node_head = (NODE *)0;
@@ -319,5 +321,5 @@
 			buffer->services[j].n_clients = vtohl(
 				buffer->services[j].n_clients);
-			if(strlen(sname) == MAX_TASK_NAME-4-1)
+			if((int)strlen(sname) == MAX_TASK_NAME-4-1)
 			{
 				strcpy(str,buffer->services[j].name);
@@ -337,4 +339,5 @@
 			nodep = (NODE *)malloc(sizeof(NODE));
 			strcpy(nodep->name,buffer->server.node);
+			nodep->hasSMI = 0;
 			nodep->server_head = (SERVER *)malloc(sizeof(SERVER));
 			sll_init((SLL *)nodep->server_head);
@@ -352,4 +355,10 @@
 			servp->server.n_services = 0;
 			servp->service_ptr = 0;
+			servp->isSMI = 0;
+			if(strstr(sname,"_SMI"))
+			{
+				servp->isSMI = 1;
+				nodep->hasSMI = 1;
+			}
 			sll_insert_queue((SLL *)nodep->server_head,(SLL *)servp);
 		}
@@ -373,7 +382,7 @@
 		if(n_services != -1)
 		{
-			service_size = n_services*sizeof(DNS_SERVICE_INFO);
-			servp->service_ptr = (DNS_SERVICE_INFO *)malloc(service_size);
-			memcpy(servp->service_ptr, buffer->services, service_size);
+			service_size = n_services*(int)sizeof(DNS_SERVICE_INFO);
+			servp->service_ptr = (DNS_SERVICE_INFO *)malloc((size_t)service_size);
+			memcpy(servp->service_ptr, buffer->services, (size_t)service_size);
 			N_services += n_services;
 		}
@@ -391,4 +400,5 @@
 		servp->server.n_services = 0;
 		servp->busy = -1;
+		servp->isSMI = 0;
 	    }
 	}
@@ -464,15 +474,15 @@
 		if(!rpc_flag)
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr1 = strchr(ptr,'|');
 		}
 		else if(rpc_flag == 1)
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr1 = strchr(ptr,',');
 		}
 		else
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr = strchr(ptr,',');
 		    ptr++;
@@ -512,20 +522,20 @@
 		if(!rpc_flag)
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr1 = strchr(ptr,'|');
 		}
 		else if(rpc_flag == 1)
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr1 = strchr(ptr,',');
 		}
 		else
 		{
-		    ptr += strlen(str);
+		    ptr += (int)strlen(str);
 		    ptr = strchr(ptr,',');
 		    ptr++;
 		    ptr1 = strchr(ptr,'|');
 		}
-	    strncpy(format,ptr,(int)(ptr1 - ptr));
+	    strncpy(format,ptr,(size_t)(ptr1 - ptr));
 	    format[(int)(ptr1-ptr)] = '\0';
 	}
@@ -678,5 +688,5 @@
 		servicep->n_browsers = 0;
 		sll_insert_queue((SLL *)Curr_service_head,(SLL *)servicep);
-		servicep->sid = dic_info_service_stamped( service, MONITORED, subscribe, 0, 0,
+		servicep->sid = (int)dic_info_service_stamped( service, MONITORED, subscribe, 0, 0,
 			recv_service_info, servicep, &no_link_int, 4);
 	}
@@ -792,8 +802,8 @@
 		if(servicep->buffer_size)
 			free(servicep->buffer);
-		servicep->buffer = malloc(*size);
+		servicep->buffer = malloc((size_t)*size);
 		servicep->buffer_size = *size;
 	}
-	memcpy(servicep->buffer, (char *)buffer, *size);
+	memcpy(servicep->buffer, (char *)buffer, (size_t)*size);
 	servicep->size = *size;
 	if (servicep->buffer_str_size < (1024 + (*size)*16))
@@ -801,5 +811,5 @@
 		if(servicep->buffer_str_size)
 			free(servicep->buffer_str);
-		servicep->buffer_str = malloc(1024 + (*size)*16);
+		servicep->buffer_str = malloc((size_t)(1024 + (*size)*16));
 		servicep->buffer_str_size = 1024 + (*size)*16;
 	}
@@ -855,5 +865,5 @@
     sprintf(ptr,".%03d",mili);
     strcat(timestr, aux);
-    timestr[strlen(timestr)-1] = '\0';
+    timestr[(int)strlen(timestr)-1] = '\0';
    
     sprintf(str," Timestamp: %s&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Quality: %d&nbsp&nbsp&nbsp Size: %s<br /><br />",
@@ -906,8 +916,8 @@
       strcat(Service_content_str," L");
       if(!num)
-		size = ssize/sizeof(int);
+		size = ssize/(int)sizeof(int);
       else
 		size = num;
-      psize = size * sizeof(int);
+      psize = size * (int)sizeof(int);
       print_service_standard(ptr, size);
       break;
@@ -916,8 +926,8 @@
       strcat(Service_content_str," I");
       if(!num)
-		size = ssize/sizeof(int);
+		size = ssize/(int)sizeof(int);
       else
 		size = num;
-      psize = size * sizeof(int);
+      psize = size * (int)sizeof(int);
       print_service_standard(ptr, size);
       break;
@@ -926,8 +936,8 @@
       strcat(Service_content_str," S");
       if(!num)
-		size = ssize/sizeof(short);
+		size = ssize/(int)sizeof(short);
       else
 		size = num;
-      psize = size * sizeof(short);
+      psize = size * (int)sizeof(short);
       print_service_short(ptr, size);
       break;
@@ -936,8 +946,8 @@
       strcat(Service_content_str," F");
       if(!num)
-		size = ssize/sizeof(float);
+		size = ssize/(int)sizeof(float);
       else
 		size = num;
-      psize = size * sizeof(float);
+      psize = size * (int)sizeof(float);
       print_service_float(ptr, size);
       break;
@@ -946,8 +956,8 @@
       strcat(Service_content_str," D");
       if(!num)
-		size = ssize/sizeof(double);
+		size = ssize/(int)sizeof(double);
       else
 		size = num;
-      psize = size * sizeof(double);
+      psize = size * (int)sizeof(double);
       print_service_double(ptr, size);
       break;
@@ -956,8 +966,8 @@
       strcat(Service_content_str," X");
       if(!num)
-		size = ssize/sizeof(longlong);
+		size = ssize/(int)sizeof(longlong);
       else
 		size = num;
-      psize = size * sizeof(longlong);
+      psize = size * (int)sizeof(longlong);
       print_service_standard(ptr, size*2);
       break;
@@ -999,5 +1009,5 @@
 
 	ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1030,5 +1040,5 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
@@ -1043,5 +1053,5 @@
 
 	ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1068,5 +1078,5 @@
 				if(j == 0)
 					strcat(tmp,"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp D: ");
-				sprintf_html(str, 12, last[j]);
+				sprintf_html(str, 12, (int)last[j]);
 				strcat(tmp,str);
 			}
@@ -1074,5 +1084,5 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
@@ -1087,5 +1097,5 @@
 
 	ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1118,5 +1128,5 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
@@ -1131,5 +1141,5 @@
 	asc = (char *)buff;
 	ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1150,5 +1160,5 @@
 */
 		strcat(tmp," ");
-		strcat(tmp,&str[strlen(str)-2]);
+		strcat(tmp,&str[(int)strlen(str)-2]);
 		/*
 		if(i%4 == 3)
@@ -1180,5 +1190,5 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
@@ -1192,5 +1202,5 @@
 
 	ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1212,9 +1222,9 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
 	strcpy(ptr, tmp);
-	ptr += strlen(tmp);
+	ptr += (int)strlen(tmp);
 }
 
@@ -1225,5 +1235,5 @@
 
     ptr = Service_content_str;
-	ptr += strlen(Service_content_str);
+	ptr += (int)strlen(Service_content_str);
 	for( i = 0; i < size; i++)
 	{
@@ -1245,9 +1255,9 @@
 		}
 		strcpy(ptr, tmp);
-		ptr += strlen(tmp);
+		ptr += (int)strlen(tmp);
 	}
 	strcpy(tmp,"<br />");
 	strcpy(ptr, tmp);
-	ptr += strlen(tmp);
+	ptr += (int)strlen(tmp);
 }
 
@@ -1257,5 +1267,5 @@
 
 	strcat(ptr,"{\n");
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1266,5 +1276,5 @@
 
 	strcat(ptr,"}\n");
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1275,5 +1285,5 @@
 
 	sprintf(ptr,"%s: [\n", node);
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1284,5 +1294,5 @@
 
 	strcat(ptr,"]\n");
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1296,5 +1306,5 @@
 	else
 		sprintf(ptr,"{ %s", child);
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1308,5 +1318,5 @@
 	else
 		strcat(ptr," }\n");
-	ptro = ptr + strlen(ptr);
+	ptro = ptr + (int)strlen(ptr);
 	return ptro;
 }
@@ -1352,5 +1362,5 @@
 	for(i = 0; i < ((int)strlen(label) + 1); i++)
 	{
-		label[i] = tolower(label[i]);
+		label[i] = (char)tolower((int)label[i]);
 		if(label[i] == '.')
 		{
@@ -1384,10 +1394,10 @@
 		if(JSONBufferSize == 0)
 		{
-			JSONBuffer = malloc(N_nodes*128+N_servers*128);
+			JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128));
 		}
 		else if (JSONBufferSize < N_nodes*128+N_servers*128)
 		{
 			free(JSONBuffer);
-			JSONBuffer = malloc(N_nodes*128+N_servers*128);
+			JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128));
 		}
 		ptr = JSONBuffer;
@@ -1397,10 +1407,10 @@
 		if(browserp->JSONBufferSize == 0)
 		{
-			browserp->JSONBuffer = malloc(N_nodes*128+N_servers*128);
+			browserp->JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128));
 		}
 		else if (browserp->JSONBufferSize < N_nodes*128+N_servers*128)
 		{
 			free(browserp->JSONBuffer);
-			browserp->JSONBuffer = malloc(N_nodes*128+N_servers*128);
+			browserp->JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128));
 		}
 		ptr = browserp->JSONBuffer;
@@ -1556,10 +1566,10 @@
 	if(JSONServicesSize == 0)
 	{
-		JSONServices = malloc(n_services*256);
+		JSONServices = malloc((size_t)(n_services*256));
 	}
 	else if (JSONServicesSize < n_services*256)
 	{
 		free(JSONServices);
-		JSONServices = malloc(n_services*256);
+		JSONServices = malloc((size_t)(n_services*256));
 	}
 	if(browserp)
@@ -1704,8 +1714,8 @@
       if(last_size)
 		free(last_buffer);
-      last_buffer = malloc(full_size);
+      last_buffer = malloc((size_t)full_size);
       last_size = full_size;
    }
-   memset(last_buffer, 0, last_size);
+   memset(last_buffer, 0, (size_t)last_size);
    buffer_ptr = last_buffer;
    ptr = format; 
@@ -1864,6 +1874,6 @@
 			strp++;
 		}
-		num = strlen(strp)+1;
-		strncpy((char *)ptr,strp,num);
+		num = (int)strlen(strp)+1;
+		strncpy((char *)ptr,strp,(size_t)num);
 		if( (ptr1 = (char *)strchr((char *)ptr,'\"')) )
 		{
Index: trunk/FACT++/dim/src/webDid/webServer.c
===================================================================
--- trunk/FACT++/dim/src/webDid/webServer.c	(revision 14937)
+++ trunk/FACT++/dim/src/webDid/webServer.c	(revision 15282)
@@ -68,6 +68,6 @@
 	(void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n",
 		      date_buffer, (int)strlen(logbuffer), "text/html");
-    (void)web_write(conn_id,snd_buffer,strlen(snd_buffer));
-                (void)web_write(conn_id,logbuffer,strlen(logbuffer));
+    (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer));
+                (void)web_write(conn_id,logbuffer,(int)strlen(logbuffer));
                 break;
         case LOG: (void)printf("INFO: %s:%s:%d\n",s1, s2,conn_id); 
@@ -98,5 +98,5 @@
 		if((ptr = strstr(buffer, parptr)))
 		{
-			ptrs[i] = ptr+strlen(parptr);
+			ptrs[i] = ptr+(int)strlen(parptr);
 			found++;
 		}
@@ -206,10 +206,10 @@
   int code;
 
-  buffer_size = strlen(buffer) + 1;
+  buffer_size = (int)strlen(buffer) + 1;
   if(buffer_size > conv_buffer_size )
   {
     if(conv_buffer_size)
       free(conv_buffer);
-    conv_buffer = malloc(buffer_size);
+    conv_buffer = malloc((size_t)buffer_size);
     conv_buffer_size = buffer_size;
   }
@@ -333,8 +333,112 @@
 	(void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n",
 		      date_buffer, (int)strlen(ptr), datatype);
-    (void)web_write(conn_id,snd_buffer,strlen(snd_buffer));
+    (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer));
 if(WebDID_Debug)
 	printf("SENDING DATA to conn %d:\n%s\n",conn_id, snd_buffer);
-    (void)web_write(conn_id,ptr,strlen(ptr));
+    (void)web_write(conn_id,ptr,(int)strlen(ptr));
+if(WebDID_Debug == 2)
+	printf("SENDING DATA to conn %d:\n%s\n",conn_id, ptr);
+}
+
+
+void sendSmiData(int conn_id, char *buffer, int type)
+{
+	static char date_buffer[128];
+	static char snd_buffer[BUFSIZE+1]; /* static so zero filled */
+	static char snd_data_buffer[BUFSIZE+1]; /* static so zero filled */
+	char *ptr = 0;
+	char node[128], server[256], service[256];
+	int pid, ret, req, browser, force;
+	extern char *update_services();
+	extern char *update_service_data();
+	extern char *getJSONHeader();
+	extern char *getJSONBuffer();
+	char datatype[128];
+	char *conv_buffer;
+
+	conv_buffer = buffer;
+	strcpy(datatype,"application/json");
+	if(type == 0)
+	{
+	  ptr = getJSONHeader();
+	}
+	else if(type == 1)
+	{
+	    ret = getNodeParameters(conv_buffer, node, &browser);
+		ptr = getJSONBuffer(node, browser);
+	}
+	else if(type == 2)
+	{
+		ret = getServerParameters(conv_buffer, node, server, &pid, &browser);
+		if(!ret)
+		{
+			strcpy(snd_data_buffer,"{}");
+			ptr = snd_data_buffer;
+		}
+		else
+		{
+			ptr = update_services(node, server, pid, browser);
+		}
+	}
+	else if(type == 3)
+	{
+		ret = getServiceParameters(conv_buffer, service, &req, &browser, &force);
+		if(!ret)
+		{
+			strcpy(snd_data_buffer,"{}");
+			ptr = snd_data_buffer;
+		}
+		else
+		{
+			update_service_data(service, conn_id, 0, req, browser, force);
+			return;
+		}
+	}
+	else if(type == 4)
+	{
+		ptr = conv_buffer;
+if(WebDID_Debug)
+		printf("%s\n",ptr);
+		strcpy(datatype,"text/html");
+	}
+	else if(type == 5)
+	{
+		ret = getServiceParameters(conv_buffer, service, &req, &browser, &force);
+		if(!ret)
+		{
+			strcpy(snd_data_buffer,"{}");
+			ptr = snd_data_buffer;
+		}
+		else
+		{
+			check_browser_changes(service, conn_id, 0, req, browser, force);
+			return;
+		}
+	}
+	else if(type == 6)
+	{
+		ret = getServiceParameters(conv_buffer, service, &req, &browser, &force);
+		if(!ret)
+		{
+			strcpy(snd_data_buffer,"{}");
+			ptr = snd_data_buffer;
+		}
+		else
+		{
+			find_services(service, conn_id, browser, force);
+			if(force == -1)
+				strcpy(snd_data_buffer,"");
+			else
+				strcpy(snd_data_buffer,"load");
+			ptr = snd_data_buffer;
+		}
+	}
+	getTime(date_buffer);
+	(void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n",
+		      date_buffer, (int)strlen(ptr), datatype);
+    (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer));
+if(WebDID_Debug)
+	printf("SENDING DATA to conn %d:\n%s\n",conn_id, snd_buffer);
+    (void)web_write(conn_id,ptr,(int)strlen(ptr));
 if(WebDID_Debug == 2)
 	printf("SENDING DATA to conn %d:\n%s\n",conn_id, ptr);
@@ -356,4 +460,6 @@
         else buffer[0]=0;
 
+if(WebDID_Debug)
+printf("Got %s\n", buffer);
         if( strncmp(buffer,"GET ",4) && strncmp(buffer,"get ",4) )
 		{
@@ -371,5 +477,7 @@
         }
 
-        for(j=0;j<i-1;j++)      /* check for illegal parent directory use .. */
+if(WebDID_Debug)
+printf("Got 1 %s\n", buffer);
+       for(j=0;j<i-1;j++)      /* check for illegal parent directory use .. */
 		{
                 if(buffer[j] == '.' && buffer[j+1] == '.')
@@ -379,15 +487,23 @@
 				}
 		}
-        if( !strncmp(&buffer[0],"GET /\0",6) || !strncmp(&buffer[0],"get /\0",6) ) 
+		if((int)strlen(buffer) == 5)
+		{
+			if( !strncmp(&buffer[0],"GET /",5) || !strncmp(&buffer[0],"get /",5) ) 
 			/* convert no filename to index file */
                 (void)strcpy(buffer,"GET /index.html");
-
+		}
+		if((int)strlen(buffer) == 8)
+		{
+			if( !strncmp(&buffer[0],"GET /smi",8) || !strncmp(&buffer[0],"get /smi",8) ) 
+			/* convert no filename to index file */
+                (void)strcpy(buffer,"GET /smi/index.html");
+		}
         /* work out the file type and check we support it */
-        buflen=strlen(buffer);
+        buflen=(int)strlen(buffer);
         fstr = (char *)0;
         for(i=0;extensions[i].ext != 0;i++) 
 		{
-              len = strlen(extensions[i].ext);
-              if( !strncmp(&buffer[buflen-len], extensions[i].ext, len)) 
+              len = (int)strlen(extensions[i].ext);
+              if( !strncmp(&buffer[buflen-len], extensions[i].ext, (size_t)len)) 
 			  {
                         fstr =extensions[i].filetype;
@@ -397,5 +513,5 @@
 /*
 		(void)sprintf(snd_buffer,"HTTP/1.1 100 Continue\r\n\r\n");
-        (void)web_write(conn_id,snd_buffer,strlen(snd_buffer));
+        (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer));
 		printf("SENDING to conn %d:\n%s\n",conn_id, snd_buffer);
 */
@@ -432,4 +548,9 @@
 			{
 				sendData(conn_id, &buffer[5], 6);
+				return;
+			}
+			else if(!strncmp(&buffer[5],"smiObjects",11))
+			{
+				sendSmiData(conn_id, &buffer[5], 2);
 				return;
 			}
@@ -441,8 +562,8 @@
 					*ptr = '\0';
 				}
-				buflen=strlen(buffer);
+				buflen=(int)strlen(buffer);
 				for(i=0;extensions[i].ext != 0;i++) 
 				{
-					len = strlen(extensions[i].ext);
+					len = (int)strlen(extensions[i].ext);
 					if( !strncmp(&buffer[buflen-len], extensions[i].ext, len)) 
 					{
@@ -476,5 +597,5 @@
 
 		flen = 0;
-        while ( (ret = read(file_fd, snd_buffer, BUFSIZE)) > 0 ) 
+        while ( (ret = (int)read(file_fd, snd_buffer, BUFSIZE)) > 0 ) 
 		{
 			flen += ret;
@@ -491,10 +612,10 @@
 		(void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n",
             date_buffer, flen, fstr);
-        (void)web_write(conn_id,snd_buffer,strlen(snd_buffer));
+        (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer));
 if(WebDID_Debug)
 		printf("SENDING to conn %d:\n%s\n",conn_id, snd_buffer);
 
         /* send file in 8KB block - last block may be smaller */
-        while ( (ret = read(file_fd, snd_buffer, BUFSIZE)) > 0 ) {
+        while ( (ret = (int)read(file_fd, snd_buffer, BUFSIZE)) > 0 ) {
                 (void)web_write(conn_id,snd_buffer,ret);
 if(WebDID_Debug == 2)
Index: trunk/FACT++/dim/src/webDid/webTcpip.c
===================================================================
--- trunk/FACT++/dim/src/webDid/webTcpip.c	(revision 14937)
+++ trunk/FACT++/dim/src/webDid/webTcpip.c	(revision 15282)
@@ -163,6 +163,6 @@
 	{
 		dna_connp->buffer =
-				(int *) realloc(dna_connp->buffer, size);
-		memset(dna_connp->buffer, 0, size);
+				(int *) realloc(dna_connp->buffer, (size_t)size);
+		memset(dna_connp->buffer, 0, (size_t)size);
 		dna_connp->buffer_size = size;
 	}
@@ -288,8 +288,8 @@
 	{
 		sscanf(node,"%d.%d.%d.%d",&a, &b, &c, &d);
-	    ipaddr[0] = a;
-	    ipaddr[1] = b;
-	    ipaddr[2] = c;
-	    ipaddr[3] = d;
+	    ipaddr[0] = (unsigned char)a;
+	    ipaddr[1] = (unsigned char)b;
+	    ipaddr[2] = (unsigned char)c;
+	    ipaddr[3] = (unsigned char)d;
 		if( (host = gethostbyaddr(ipaddr, sizeof(ipaddr), AF_INET)) == (struct hostent *)0 )
 		{
