Index: trunk/FACT++/dim/README_v20.txt
===================================================================
--- trunk/FACT++/dim/README_v20.txt	(revision 14939)
+++ trunk/FACT++/dim/README_v20.txt	(revision 15282)
@@ -1,4 +1,4 @@
 
-                    DIM version 20r5 Release Notes
+                    DIM version 20r7 Release Notes
 
 Notes 1 and 2 for Unix Users only
@@ -17,11 +17,39 @@
 		Dns </dev/null >& dns.log &
 
-NOTE 3: The Version Number service provided by servers is now set to 2005.
-
+NOTE 3: The Version Number service provided by servers is now set to 2007.
+
+05/04/2013
+Changes for version 2007:
+    - DIM servers were allocating a lot of (possibly) unnecessary memory at startup - fixed.
+    - Tried to fix "Invalid Service ID" messages when creating services/commands in a server.
+      (By protecting the service/command creation in C++)
+    - Fixed many compilation warnings when adding gcc flag -Wconvertion
+    - DIM releases are now:
+	- Windows:
+		- Compiled on Windows 7 Visual Studio 10
+		- Distributed in /bin32 for 32 bits and /bin for 64 bits
+	- Linux:
+		- Compiled on SLC6 with gcc 4.4
+		- Distributed in /linux for 64 bits 
+
+
+17/01/2013
+Changes for version 2006:
+    - Changes only affecting the Linux version of DIM:
+	- v20r5 changes related to removing the masking of signals could cause problems in single thread
+          applications, like smiGUI. The masking/unmasking of signals is now conditional, implemented by a 
+          global variable in the DIM shareable library.
+    	- Changed the DID makefile in order to make sure the correct libdim.so in used when linking.
+	- Changes in DID:
+		- When the list of nodes was long, the list was very slow to display - fixed.
+		- If it was really very long, it crashed - fixed.
+		- In nodes were reported by IPAdress, show servers by node didn't work - fixed.
+		
+		
 21/12/2012
 Changes for version 2005:
     - Moved the WebDID sources to the src directory and the VS settings to the Visual directory
     - In the Multithreaded (the default) version of DIM, signals are not touched anymore.
-      Before they were masked/unmasked at every dim lock/unlock occurence.
+      Before they were masked/unmasked at every dim lock/unlock occurence (Linux only).
     - Fixes in WebDID:
 	- Now DIM nodes defined by an IP Address are shown properly (by IP Name)
Index: trunk/FACT++/dim/dim/dic.hxx
===================================================================
--- trunk/FACT++/dim/dim/dic.hxx	(revision 14939)
+++ trunk/FACT++/dim/dim/dic.hxx	(revision 15282)
@@ -57,7 +57,7 @@
 		{ subscribe((char *)name, time, &nolink, sizeof(short), 0); };
 	DimInfo(const char *name, char *nolink) 
-		{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, 0); };
+		{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, 0); };
 	DimInfo(const char *name, int time, char *nolink) 
-		{ subscribe((char *)name, time, nolink, strlen(nolink)+1, 0); };
+		{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, 0); };
 	DimInfo(const char *name, void *nolink, int nolinksize) 
 		{ subscribe((char *)name, 0, nolink, nolinksize, 0); };
@@ -86,7 +86,7 @@
 		{ subscribe((char *)name, time, &nolink, sizeof(short), handler); };
 	DimInfo(const char *name, char *nolink, DimInfoHandler *handler) 
-		{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, handler); };
+		{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, handler); };
 	DimInfo(const char *name, int time, char *nolink, DimInfoHandler *handler) 
-		{ subscribe((char *)name, time, nolink, strlen(nolink)+1, handler); };
+		{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, handler); };
 	DimInfo(const char *name, void *nolink, int nolinksize, DimInfoHandler *handler) 
 		{ subscribe((char *)name, 0, nolink, nolinksize, handler); };
@@ -158,7 +158,7 @@
 	{ subscribe((char *)name, time, &nolink, sizeof(short), 0); };
 	DimStampedInfo(const char *name, char *nolink) 
-	{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, 0); };
+	{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, 0); };
 	DimStampedInfo(const char *name, int time, char *nolink) 
-	{ subscribe((char *)name, time, nolink, strlen(nolink)+1, 0); };
+	{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, 0); };
 	DimStampedInfo(const char *name, void *nolink, int nolinksize) 
 	{ subscribe((char *)name, 0, nolink, nolinksize, 0); };
@@ -187,7 +187,7 @@
 	{ subscribe((char *)name, time, &nolink, sizeof(short), handler); };
 		DimStampedInfo(const char *name, char *nolink, DimInfoHandler *handler) 
-	{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, handler); };
+	{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, handler); };
 	DimStampedInfo(const char *name, int time, char *nolink, DimInfoHandler *handler) 
-	{ subscribe((char *)name, time, nolink, strlen(nolink)+1, handler); };
+	{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, handler); };
 	DimStampedInfo(const char *name, void *nolink, int nolinksize, DimInfoHandler *handler) 
 	{ subscribe((char *)name, 0, nolink, nolinksize, handler); };
@@ -230,7 +230,7 @@
 	{ subscribe((char *)name, time, &nolink, sizeof(short), 0); };
 	DimUpdatedInfo(const char *name, char *nolink) 
-	{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, 0); };
+	{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, 0); };
 	DimUpdatedInfo(const char *name, int time, char *nolink) 
-	{ subscribe((char *)name, time, nolink, strlen(nolink)+1, 0); };
+	{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, 0); };
 	DimUpdatedInfo(const char *name, void *nolink, int nolinksize) 
 	{ subscribe((char *)name, 0, nolink, nolinksize, 0); };
@@ -259,7 +259,7 @@
 	{ subscribe((char *)name, time, &nolink, sizeof(short), handler); };
 	DimUpdatedInfo(const char *name, char *nolink, DimInfoHandler *handler) 
-	{ subscribe((char *)name, 0, nolink, strlen(nolink)+1, handler); };
+	{ subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1, handler); };
 	DimUpdatedInfo(const char *name, int time, char *nolink, DimInfoHandler *handler) 
-	{ subscribe((char *)name, time, nolink, strlen(nolink)+1, handler); };
+	{ subscribe((char *)name, time, nolink, (int)strlen(nolink)+1, handler); };
 	DimUpdatedInfo(const char *name, void *nolink, int nolinksize, DimInfoHandler *handler) 
 	{ subscribe((char *)name, 0, nolink, nolinksize, handler); };
@@ -310,5 +310,5 @@
 		subscribe((char *)name, 0, &nolink, sizeof(short)); };
 	DimCurrentInfo(const char *name, char *nolink) { 
-		subscribe((char *)name, 0, nolink, strlen(nolink)+1); };
+		subscribe((char *)name, 0, nolink, (int)strlen(nolink)+1); };
 	DimCurrentInfo(const char *name, void *nolink, int nolinksize) { 
 		subscribe((char *)name, 0, nolink, nolinksize); };
@@ -324,5 +324,5 @@
 		subscribe((char *)name, time, &nolink, sizeof(short)); };
 	DimCurrentInfo(const char *name, int time, char *nolink) { 
-		subscribe((char *)name, time, nolink, strlen(nolink)+1); };
+		subscribe((char *)name, time, nolink, (int)strlen(nolink)+1); };
 	DimCurrentInfo(const char *name, int time, void *nolink, int nolinksize) { 
 		subscribe((char *)name, time, nolink, nolinksize); };
@@ -377,5 +377,5 @@
 		subscribe((char *)name, 0, 0, &nolink, sizeof(short), 0); };
 	DimRpcInfo(const char *name, char *nolink) { 
-		subscribe((char *)name, 0, 0, nolink, strlen(nolink)+1, 0); };
+		subscribe((char *)name, 0, 0, nolink, (int)strlen(nolink)+1, 0); };
 	DimRpcInfo(const char *name, void *nolink, int nolinksize) { 
 		subscribe((char *)name, 0, 0, nolink, nolinksize, 0); };
@@ -392,5 +392,5 @@
 		subscribe((char *)name, 0, 0, &nolink, sizeof(short), time); };
 	DimRpcInfo(const char *name, int time, char *nolink) { 
-		subscribe((char *)name, 0, 0, nolink, strlen(nolink)+1, time); };
+		subscribe((char *)name, 0, 0, nolink, (int)strlen(nolink)+1, time); };
 	DimRpcInfo(const char *name, int time, void *nolink, int nolinksize) { 
 		subscribe((char *)name, 0, 0, nolink, nolinksize, time); };
@@ -417,5 +417,5 @@
 	void setData(longlong &data) { doIt(&data, sizeof(longlong)); } ;
 	void setData(short &data) { doIt(&data, sizeof(short)); } ;
-	void setData(char *data)  { doIt(data, strlen(data)+1); } ;
+	void setData(char *data)  { doIt(data, (int)strlen(data)+1); } ;
 
 private :
Index: trunk/FACT++/dim/dim/dim.h
===================================================================
--- trunk/FACT++/dim/dim/dim.h	(revision 14939)
+++ trunk/FACT++/dim/dim/dim.h	(revision 15282)
@@ -14,5 +14,5 @@
 #include "dim_common.h"
 
-#define DIM_VERSION_NUMBER 2005
+#define DIM_VERSION_NUMBER 2007
 
 
Index: trunk/FACT++/dim/dim/dim_common.h
===================================================================
--- trunk/FACT++/dim/dim/dim_common.h	(revision 14939)
+++ trunk/FACT++/dim/dim/dim_common.h	(revision 15282)
@@ -124,4 +124,15 @@
 #include <unistd.h>
 
+extern int DIM_Threads_OFF;
+
+#define DISABLE_SIG     sigset_t set, oset; if (DIM_Threads_OFF) {\
+                                                sigemptyset(&set);\
+												sigaddset(&set,SIGIO);\
+												sigaddset(&set,SIGALRM);\
+												sigprocmask(SIG_BLOCK,&set,&oset);}
+#define ENABLE_SIG       if (DIM_Threads_OFF) {\
+                                                sigprocmask(SIG_SETMASK,&oset,0);}
+
+/*
 #define DISABLE_SIG     sigset_t set, oset; sigemptyset(&set);\
 						sigaddset(&set,SIGIO);\
@@ -129,8 +140,10 @@
 						sigprocmask(SIG_BLOCK,&set,&oset);
 #define ENABLE_SIG      sigprocmask(SIG_SETMASK,&oset,0);
-
-#ifdef VxWorks
+*/
+
 #define DISABLE_AST     DISABLE_SIG DIM_LOCK
 #define ENABLE_AST      DIM_UNLOCK ENABLE_SIG
+
+#ifdef VxWorks
 #define DIM_LOCK taskLock();
 #define DIM_UNLOCK taskUnlock();
@@ -145,6 +158,4 @@
 _DIM_PROTOE( void dim_signal_cond,	() );
 
-#define DISABLE_AST     DIM_LOCK
-#define ENABLE_AST      DIM_UNLOCK
 #define DIM_LOCK 	dim_lock();
 #define DIM_UNLOCK	dim_unlock();
@@ -152,6 +163,4 @@
 #else
 #include <time.h>
-#define DISABLE_AST     DISABLE_SIG DIM_LOCK
-#define ENABLE_AST      DIM_UNLOCK ENABLE_SIG
 #define DIM_LOCK
 #define DIM_UNLOCK
Index: trunk/FACT++/dim/src/conn_handler.c
===================================================================
--- trunk/FACT++/dim/src/conn_handler.c	(revision 14939)
+++ trunk/FACT++/dim/src/conn_handler.c	(revision 15282)
@@ -57,17 +57,17 @@
 	case SRC_DIC :
 		Dic_conns = (DIC_CONNECTION *)
-				calloc( Curr_N_Conns, sizeof(DIC_CONNECTION) );
+				calloc( (size_t)Curr_N_Conns, sizeof(DIC_CONNECTION) );
 		My_type = type;
 		break;
 	case SRC_DNS :
 		Dns_conns = (DNS_CONNECTION *)
-				calloc( Curr_N_Conns, sizeof(DNS_CONNECTION) );
+				calloc( (size_t)Curr_N_Conns, sizeof(DNS_CONNECTION) );
 		My_type = type;
 		break;
 	case SRC_DNA :
 		Dna_conns = (DNA_CONNECTION *)
-				calloc( Curr_N_Conns, sizeof(DNA_CONNECTION) );
+				calloc( (size_t)Curr_N_Conns, sizeof(DNA_CONNECTION) );
 		Net_conns = (NET_CONNECTION *)
-				calloc( Curr_N_Conns, sizeof(NET_CONNECTION) );
+				calloc( (size_t)Curr_N_Conns, sizeof(NET_CONNECTION) );
 		break;
 	default:
@@ -128,6 +128,6 @@
 	register char *new_ptr;
 
-	new_ptr = realloc( conn_ptr, conn_size * n_conns );
-	memset( new_ptr + conn_size * Curr_N_Conns, 0, conn_size * CONN_BLOCK );
+	new_ptr = realloc( conn_ptr, (size_t)(conn_size * n_conns) );
+	memset( new_ptr + conn_size * Curr_N_Conns, 0, (size_t)(conn_size * CONN_BLOCK) );
 	return(new_ptr);
 }
@@ -137,5 +137,5 @@
 
 	Curr_N_Ids = ID_BLOCK;
-	Id_arr = (void *) calloc( Curr_N_Ids, sizeof(ID_ITEM));
+	Id_arr = (void *) calloc( (size_t)Curr_N_Ids, sizeof(ID_ITEM));
 }
 
@@ -145,6 +145,6 @@
 	register char *new_ptr;
 
-	new_ptr = realloc( id_ptr, id_size * n_ids );
-	memset( new_ptr + id_size * Curr_N_Ids, 0, id_size * ID_BLOCK );
+	new_ptr = realloc( id_ptr, (size_t)(id_size * n_ids) );
+	memset( new_ptr + id_size * Curr_N_Ids, 0, (size_t)(id_size * ID_BLOCK) );
 	return(new_ptr);
 }
Index: trunk/FACT++/dim/src/copy_swap.c
===================================================================
--- trunk/FACT++/dim/src/copy_swap.c	(revision 14939)
+++ trunk/FACT++/dim/src/copy_swap.c	(revision 15282)
@@ -176,5 +176,5 @@
 	if(!format_data->par_bytes) {
 		if(buff_in != buff_out)
-			memcpy( buff_out, buff_in, size );
+			memcpy( buff_out, buff_in, (size_t)size );
 		return(size);
 	}
@@ -196,5 +196,5 @@
 					size - curr_size, SIZEOF_CHAR);
 
-				memcpy( buff_out, buff_in, num);
+				memcpy( buff_out, buff_in, (size_t)num);
 				inc_pter( buff_in, num);
 				inc_pter( buff_out, num);
@@ -213,5 +213,5 @@
 					}
 				}
-				memcpy( buff_out, buff_in, num);
+				memcpy( buff_out, buff_in, (size_t)num);
 				inc_pter( buff_in, num);
 				inc_pter( buff_out, num);
@@ -230,5 +230,5 @@
 					}
 				}
-				memcpy( buff_out, buff_in, num);
+				memcpy( buff_out, buff_in, (size_t)num);
 				inc_pter( buff_in, num);
 				inc_pter( buff_out, num);
@@ -251,5 +251,5 @@
 					}
 				}
-				memcpy( buff_out, buff_in, num);
+				memcpy( buff_out, buff_in, (size_t)num);
 				inc_pter( buff_in, num);
 				inc_pter( buff_out, num);
@@ -276,5 +276,5 @@
 	if(!format_data->par_bytes) {
 		if(buff_in != buff_out)
-			memcpy( buff_out, buff_in, size );
+			memcpy( buff_out, buff_in, (size_t)size );
 		return(size);
 	}
@@ -322,5 +322,5 @@
 
 				if(buff_in != buff_out)
-					memcpy( buff_out, buff_in, num);
+					memcpy( buff_out, buff_in, (size_t)num);
 				inc_pter( buff_in, num);
 				inc_pter( buff_out, num);
Index: trunk/FACT++/dim/src/dic.c
===================================================================
--- trunk/FACT++/dim/src/dic.c	(revision 14939)
+++ trunk/FACT++/dim/src/dic.c	(revision 15282)
@@ -224,5 +224,5 @@
 					{
 						servp->pending = WAITING_DNS_UP;
-						dic_release_service( servp->serv_id );
+						dic_release_service( (unsigned)servp->serv_id );
 					}
 					servp = auxp;
@@ -237,5 +237,5 @@
 			break;
 		service_id = vtohl(packet->service_id);
-		if(service_id & 0x80000000)  /* Service removed by server */
+		if((unsigned)service_id & 0x80000000)  /* Service removed by server */
 		{
 			service_id &= 0x7fffffff;
@@ -288,5 +288,5 @@
 							{
 								servp->pending = WAITING_DNS_UP;
-								dic_release_service( servp->serv_id );
+								dic_release_service( (unsigned)servp->serv_id );
 							}
 							servp = auxp;
@@ -337,5 +337,5 @@
 					{
 						servp->pending = WAITING_DNS_UP;
-						dic_release_service( servp->serv_id );
+						dic_release_service( (unsigned)servp->serv_id );
 					}
 					else
@@ -390,5 +390,5 @@
 	{
 		for(formatp = format_data_cp; formatp->par_bytes; formatp++)
-			formatp->flags &= 0xFFF0;    /* NOSWAP */
+			formatp->flags &= (short)0xFFF0;    /* NOSWAP */
 	}
 	if( servp->stamped)
@@ -397,5 +397,5 @@
 		header_size = DIS_STAMPED_HEADER;
 		servp->time_stamp[0] = vtohl(((DIS_STAMPED_PACKET *)packet)->time_stamp[0]);
-		if((servp->time_stamp[0] & 0xFFFF0000) == 0xc0de0000)
+		if(((unsigned)servp->time_stamp[0] & 0xFFFF0000) == 0xc0de0000)
 		{
 /*
@@ -442,5 +442,5 @@
 			if(!buffer_size)
 			{
-				buffer = (int *)malloc(add_size);
+				buffer = (int *)malloc((size_t)add_size);
 				buffer_size = add_size;
 			} 
@@ -450,5 +450,5 @@
 				{
 					free(buffer);
-					buffer = (int *)malloc(add_size);
+					buffer = (int *)malloc((size_t)add_size);
 					buffer_size = add_size;
 				}
@@ -550,5 +550,5 @@
 			(servp->user_routine)( &servp->tag, &size );
 		}
-		dic_release_service( servp->serv_id );
+		dic_release_service( (unsigned)servp->serv_id );
 		Curr_conn_id = 0;
 		return;
@@ -567,5 +567,5 @@
 			if( size > servp->serv_size ) 
 				size = servp->serv_size; 
-			memcpy(servp->serv_address, servp->fill_address, size);
+			memcpy(servp->serv_address, servp->fill_address, (size_t)size);
 			if( servp->user_routine )
 				(servp->user_routine)( &servp->tag, servp->serv_address, &size);
@@ -579,5 +579,5 @@
 	if( once_only )
 	{
-		dic_release_service( servp->serv_id );
+		dic_release_service( (unsigned)servp->serv_id );
 	}
 	Curr_conn_id = 0;
@@ -760,6 +760,6 @@
 				if(serv_size > 0)
 				{
-					fillp = (int *)malloc(serv_size);
-					memcpy( (char *)fillp, (char *)serv_address, serv_size );
+					fillp = (int *)malloc((size_t)serv_size);
+					memcpy( (char *)fillp, (char *)serv_address, (size_t)serv_size );
 				}
 				servp->fill_address = fillp;
@@ -807,5 +807,5 @@
 	newp = (DIC_SERVICE *) malloc(sizeof(DIC_SERVICE));
 	newp->pending = 0;
-	strncpy( newp->serv_name, name, MAX_NAME );
+	strncpy( newp->serv_name, name, (size_t)MAX_NAME );
 	newp->type = type;
 	newp->timeout = timeout;
@@ -817,6 +817,6 @@
 	if(fill_size > 0)
 	{
-		fillp = (int *)malloc(fill_size);
-		memcpy( (char *) fillp, (char *) fill_addr, fill_size );
+		fillp = (int *)malloc((size_t)fill_size);
+		memcpy( (char *) fillp, (char *) fill_addr, (size_t)fill_size );
 	}
 	newp->fill_address = fillp;
@@ -888,6 +888,6 @@
 	if(fill_size > 0)
 	{
-		fillp = (int *)malloc(fill_size);
-		memcpy( (char *) fillp, (char *) fill_addr, fill_size );
+		fillp = (int *)malloc((size_t)fill_size);
+		memcpy( (char *) fillp, (char *) fill_addr, (size_t)fill_size );
 	}
 	servp->fill_address = fillp;
@@ -993,5 +993,5 @@
 	{
 		*secs = servp->time_stamp[1];
-		if((servp->time_stamp[0] & 0xFFFF0000) == 0xc0de0000)
+		if(((unsigned)servp->time_stamp[0] & 0xFFFF0000) == 0xc0de0000)
 			*milisecs = servp->time_stamp[0] & 0x0000FFFF;
 		else
@@ -1022,5 +1022,5 @@
 	DISABLE_AST
 	if( !packet_size ) {
-		dic_packet = (DIC_PACKET *)malloc(DIC_HEADER);
+		dic_packet = (DIC_PACKET *)malloc((size_t)DIC_HEADER);
 		packet_size = DIC_HEADER;
 	}
@@ -1046,7 +1046,7 @@
 	case NOT_PENDING :
 		conn_id = servp->conn_id;
-		strncpy(dic_packet->service_name, servp->serv_name, MAX_NAME); 
+		strncpy(dic_packet->service_name, servp->serv_name, (size_t)MAX_NAME); 
 		dic_packet->type = htovl(DIM_DELETE);
-		dic_packet->service_id = htovl(service_id);
+		dic_packet->service_id = (int)htovl(service_id);
 		dic_packet->size = htovl(DIC_HEADER);
 		dna_write_nowait( conn_id, dic_packet, DIC_HEADER );
@@ -1064,5 +1064,5 @@
 			serv_reqp = &dic_dns_p->service;
 			strcpy( serv_reqp->service_name, servp->serv_name );
-			serv_reqp->service_id = htovl(servp->serv_id | 0x80000000);
+			serv_reqp->service_id = (int)htovl((unsigned)servp->serv_id | 0x80000000);
 			dna_write( Dns_dic_conn_id, dic_dns_p,
 				  sizeof(DIC_DNS_PACKET) );
@@ -1193,5 +1193,5 @@
 		return((DIC_SERVICE *)0);
 	if( (servp = (DIC_SERVICE *) dll_search( (DLL *) Cmnd_head, serv_name,
-					    strlen(serv_name)+1)) )
+					    (int)strlen(serv_name)+1)) )
 		return(servp);
 	return((DIC_SERVICE *)0);
@@ -1205,5 +1205,5 @@
 		return((DIC_SERVICE *)0);
 	if( (servp = (DIC_SERVICE *) dll_search( (DLL *) Service_pend_head, serv_name,
-					    strlen(serv_name)+1)) )
+					    (int)strlen(serv_name)+1)) )
 		return(servp);
 	return((DIC_SERVICE *)0);
@@ -1372,5 +1372,5 @@
 	strcpy(node_info,node_name);
 	for(i = 0; i < 4; i ++)
-		node_info[strlen(node_name)+i+1] = packet->node_addr[i];
+		node_info[(int)strlen(node_name)+i+1] = packet->node_addr[i];
 	port = vtohl(packet->port); 
 	pid = vtohl(packet->pid); 
@@ -1386,5 +1386,5 @@
 			serv_reqp = &dic_dns_p->service;
 			strcpy( serv_reqp->service_name, servp->serv_name );
-			serv_reqp->service_id = htovl(servp->serv_id | 0x80000000);
+			serv_reqp->service_id = (int)htovl((unsigned)servp->serv_id | 0x80000000);
 			dna_write( Dns_dic_conn_id, dic_dns_p,
 				  sizeof(DIC_DNS_PACKET) );
@@ -1405,5 +1405,5 @@
 				serv_reqp = &dic_dns_p->service;
 				strcpy( serv_reqp->service_name, servp->serv_name );
-				serv_reqp->service_id = htovl(servp->serv_id | 0x80000000);
+				serv_reqp->service_id = (int)htovl((unsigned)servp->serv_id | 0x80000000);
 				dna_write( Dns_dic_conn_id, dic_dns_p,
 					sizeof(DIC_DNS_PACKET) );
@@ -1456,7 +1456,7 @@
 			dic_connp = &Dic_conns[conn_id];
 			strncpy( dic_connp->node_name, node_name,
-				 MAX_NODE_NAME); 
+				 (size_t)MAX_NODE_NAME); 
 			strncpy( dic_connp->task_name, task_name,
-				 MAX_TASK_NAME);
+				 (size_t)MAX_TASK_NAME);
 			dic_connp->port = port;
 			dic_connp->pid = pid;
@@ -1508,6 +1508,6 @@
 			bad_connp->n_retries++;
 			bad_connp->retrying = 0;
-			strncpy( bad_connp->conn.node_name, node_name, MAX_NODE_NAME); 
-			strncpy( bad_connp->conn.task_name, task_name, MAX_TASK_NAME);
+			strncpy( bad_connp->conn.node_name, node_name, (size_t)MAX_NODE_NAME); 
+			strncpy( bad_connp->conn.task_name, task_name, (size_t)MAX_TASK_NAME);
 			bad_connp->conn.port = port;
 			tmout = BAD_CONN_TIMEOUT * (bad_connp->n_retries - 1);
@@ -1804,5 +1804,5 @@
 		{
 			servp->pending = WAITING_DNS_UP;
-			dic_release_service( servp->serv_id );
+			dic_release_service( (unsigned)servp->serv_id );
 		}
 		else
@@ -1818,5 +1818,5 @@
 				{
 					servp->pending = WAITING_DNS_UP;
-					dic_release_service( servp->serv_id );
+					dic_release_service( (unsigned)servp->serv_id );
 				}
 			}
@@ -1859,5 +1859,5 @@
 			{
 				servp->pending = WAITING_DNS_UP;
-				dic_release_service( servp->serv_id );
+				dic_release_service( (unsigned)servp->serv_id );
 			}
 			else
@@ -1882,9 +1882,9 @@
 
 	if( !serv_packet_size ) {
-		dic_packet = (DIC_PACKET *)malloc(DIC_HEADER);
+		dic_packet = (DIC_PACKET *)malloc((size_t)DIC_HEADER);
 		serv_packet_size = DIC_HEADER;
 	}
 
-	strncpy( dic_packet->service_name, servp->serv_name, MAX_NAME ); 
+	strncpy( dic_packet->service_name, servp->serv_name, (size_t)MAX_NAME ); 
 	type = servp->type;
 	if(servp->stamped)
@@ -1954,5 +1954,5 @@
 
 	if( !cmnd_packet_size ) {
-		dic_packet = (DIC_PACKET *)malloc(DIC_HEADER + size);
+		dic_packet = (DIC_PACKET *)malloc((size_t)(DIC_HEADER + size));
 		cmnd_packet_size = DIC_HEADER + size;
 	}
@@ -1961,10 +1961,10 @@
 		if( DIC_HEADER + size > cmnd_packet_size ) {
 			free( dic_packet );
-			dic_packet = (DIC_PACKET *)malloc(DIC_HEADER + size);
+			dic_packet = (DIC_PACKET *)malloc((size_t)(DIC_HEADER + size));
 			cmnd_packet_size = DIC_HEADER + size;
 		}
 	}
 
-	strncpy(dic_packet->service_name, servp->serv_name, MAX_NAME); 
+	strncpy(dic_packet->service_name, servp->serv_name, (size_t)MAX_NAME); 
 	dic_packet->type = htovl(COMMAND);
 	dic_packet->timeout = htovl(0);
@@ -2000,5 +2000,5 @@
 	{
 		servp->pending = WAITING_DNS_UP;
-		dic_release_service( servp->serv_id );
+		dic_release_service( (unsigned)servp->serv_id );
 	}
 */
@@ -2008,5 +2008,5 @@
 	{
 		servp->pending = WAITING_DNS_UP;
-		dic_release_service( servp->serv_id );
+		dic_release_service( (unsigned)servp->serv_id );
 	}
 	else
@@ -2052,5 +2052,5 @@
 	get_proc_name(name);
 	strcat(name,"@");
-	get_node_name(&name[strlen(name)]);
+	get_node_name(&name[(int)strlen(name)]);
 	return(1);
 }
@@ -2077,5 +2077,5 @@
 			  {
 			    auxp = servp->prev;
-			    dic_release_service( servp->serv_id );
+			    dic_release_service( (unsigned)servp->serv_id );
 			    servp = auxp;
 			    if(!dic_connp->service_head)
@@ -2157,5 +2157,5 @@
 				{
 					servp->pending = WAITING_DNS_UP;
-					dic_release_service( servp->serv_id );
+					dic_release_service( (unsigned)servp->serv_id );
 				}
 				servp = auxp;
@@ -2249,5 +2249,5 @@
 		if(!curr_allocated_size)
 		{
-			service_info_buffer = (char *)malloc(max_size);
+			service_info_buffer = (char *)malloc((size_t)max_size);
 			curr_allocated_size = max_size;
 		}
@@ -2255,5 +2255,5 @@
 		{
 			free(service_info_buffer);
-			service_info_buffer = (char *)malloc(max_size);
+			service_info_buffer = (char *)malloc((size_t)max_size);
 			curr_allocated_size = max_size;
 		}
@@ -2268,5 +2268,5 @@
 			strcat(buff_ptr, servp->serv_name);
 			strcat(buff_ptr, "\n");
-			buff_ptr += strlen(buff_ptr);
+			buff_ptr += (int)strlen(buff_ptr);
 		}
 	}
Index: trunk/FACT++/dim/src/diccpp.cxx
===================================================================
--- trunk/FACT++/dim/src/diccpp.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/diccpp.cxx	(revision 15282)
@@ -33,5 +33,5 @@
 				t->itsDataSize = *size;
 			}
-			memcpy(t->itsData, buf, *size);
+			memcpy(t->itsData, buf, (size_t)*size);
 		}
 		else if (*size == 0)
@@ -83,5 +83,5 @@
 			itsDataSize = itsSize;
 		}
-		memcpy(itsData, data, itsSize);
+		memcpy(itsData, data, (size_t)itsSize);
 	}
 }
@@ -125,15 +125,15 @@
 	if(itsFormat)
 	{
-		len = strlen(itsFormat)+1;
+		len = (int)strlen(itsFormat)+1;
 		if(len > 1)
 			return itsFormat;
 	}
 	def = dic_get_format(itsId);
-	new_len = strlen(def)+1;
+	new_len = (int)strlen(def)+1;
 	if(new_len > len)
 	{
 		if(itsFormat)
 			delete[] itsFormat;
-		itsFormat = new char[strlen(def)+1];
+		itsFormat = new char[(int)strlen(def)+1];
 	}
 	strcpy(itsFormat, def);
@@ -166,5 +166,5 @@
 		return;
 	}
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy(itsName,name);
 	itsNolinkBuf = nolink;
@@ -174,5 +174,5 @@
 		itsNolinkBuf = new char[nolinksize];
 		itsNolinkSize = nolinksize;
-		memcpy(itsNolinkBuf, nolink, nolinksize);
+		memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
 	}
 	if(!time)
@@ -253,5 +253,5 @@
 		return;
 	}
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy(itsName,name);
 	itsNolinkBuf = nolink;
@@ -261,5 +261,5 @@
 		itsNolinkBuf = new char[nolinksize];
 		itsNolinkSize = nolinksize;
-		memcpy(itsNolinkBuf, nolink, nolinksize);
+		memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
 	}
 	if(!time)
@@ -313,5 +313,5 @@
 		return;
 	}
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy(itsName,name);
 	itsNolinkBuf = nolink;
@@ -321,5 +321,5 @@
 		itsNolinkBuf = new char[nolinksize];
 		itsNolinkSize = nolinksize;
-		memcpy(itsNolinkBuf, nolink, nolinksize);
+		memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
 	}
 	if(!time)
@@ -363,5 +363,5 @@
 			t->itsDataSize = *size;
 		}
-		memcpy(t->itsData, buf, *size);
+		memcpy(t->itsData, buf, (size_t)*size);
 	}
 	else if (*size == 0)
@@ -404,5 +404,5 @@
 		return;
 	}
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy(itsName,name);
 	itsNolinkBuf = nolink;
@@ -412,5 +412,5 @@
 		itsNolinkBuf = new char[nolinksize];
 		itsNolinkSize = nolinksize;
-		memcpy(itsNolinkBuf, nolink, nolinksize);
+		memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
 	}
 	if(!time)
@@ -570,5 +570,5 @@
 		{
 			if(size > 0)
-				memcpy(t->itsData, buf, size);
+				memcpy(t->itsData, buf, (size_t)size);
 			else
 				t->itsData = buf;
@@ -633,5 +633,5 @@
 		{
 			if(size > 0)
-				memcpy(itsData, buf, size);
+				memcpy(itsData, buf, (size_t)size);
 			else
 				itsData = buf;
@@ -676,5 +676,5 @@
 			itsDataSize = itsSize;
 		}
-		memcpy(itsData, data, itsSize);
+		memcpy(itsData, data, (size_t)itsSize);
 	}
 }
@@ -688,5 +688,5 @@
 	itsInit = 0;
 	itsWaiting = 0;
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy(itsName,name);
 	itsHandler = this;
@@ -701,10 +701,10 @@
 		itsNolinkBuf = new char[nolinksize];
 		itsNolinkSize = nolinksize;
-		memcpy(itsNolinkBuf, nolink, nolinksize);
-	}
-	itsNameOut = new char[strlen(name)+1+10];
+		memcpy(itsNolinkBuf, nolink, (size_t)nolinksize);
+	}
+	itsNameOut = new char[(int)strlen(name)+1+10];
 	strcpy(itsNameOut,name);
 	strcat(itsNameOut,(char *)"/RpcIn");
-	itsNameIn = new char[strlen(name)+1+10];
+	itsNameIn = new char[(int)strlen(name)+1+10];
 	strcpy(itsNameIn,name);
 	strcat(itsNameIn,(char *)"/RpcOut");
@@ -752,5 +752,5 @@
 			itsDataOutSize = size;
 		}
-		memcpy(itsDataOut, data, size);
+		memcpy(itsDataOut, data, (size_t)size);
 	}
 	else
@@ -883,5 +883,5 @@
 	DimCurrentInfo srv((char *)"DIS_DNS/SERVER_LIST", timeout, (char *)"\0");
 	str = srv.getString();
-	size = strlen(str)+1;
+	size = (int)strlen(str)+1;
 	totsize = srv.getSize();
 
@@ -894,5 +894,5 @@
 	if(totsize > size)
 	{
-		pid_str = str + strlen(str) + 1;
+		pid_str = str + (int)strlen(str) + 1;
 		if(itsData[4])
 			delete itsData[4];
@@ -910,5 +910,5 @@
 {
 	char *str;
-	char *name = new char[strlen(serverName) + 20];
+	char *name = new char[(int)strlen(serverName) + 20];
 	strcpy(name,(char *)serverName);
 	strcat(name,(char *)"/SERVICE_LIST");
@@ -933,5 +933,5 @@
 {
 	char *str;
-	char *name = new char[strlen(serverName) + 20];
+	char *name = new char[(int)strlen(serverName) + 20];
 	strcpy(name,(char *)serverName);
 	strcat(name,(char *)"/CLIENT_LIST");
@@ -1129,5 +1129,5 @@
 { 
 	DimCmnd a;
-	return a.send((char *)name, (char *)data, strlen(data)+1);
+	return a.send((char *)name, (char *)data, (int)strlen(data)+1);
 }
 
@@ -1171,5 +1171,5 @@
 {
 	DimCmnd a;
-	a.sendNB((char *)name, data, strlen(data)+1);
+	a.sendNB((char *)name, data, (int)strlen(data)+1);
 }
 
@@ -1184,5 +1184,5 @@
 	DimCmnd a;
 	int ret, tag = 1;
-	char *name = new char[strlen(srvName) + 20];
+	char *name = new char[(int)strlen(srvName) + 20];
 	strcpy(name,(char *)srvName);
 	strcat(name,"/SET_EXIT_HANDLER");
@@ -1196,5 +1196,5 @@
 	DimCmnd a;
 	int ret, tag = 1;
-	char *name = new char[strlen(srvName) + 20];
+	char *name = new char[(int)strlen(srvName) + 20];
 	strcpy(name,(char *)srvName);
 	strcat(name,"/EXIT");
Index: trunk/FACT++/dim/src/did/did.c
===================================================================
--- trunk/FACT++/dim/src/did/did.c	(revision 14939)
+++ trunk/FACT++/dim/src/did/did.c	(revision 15282)
@@ -129,5 +129,5 @@
         XtSetArg(arglist[n], XmNadjustLast, False); n++;
 	sprintf(w_name,"matrix_row");
-	row_col_id = XmCreateRowColumn(top_id,w_name,arglist,n);
+	row_col_id = XmCreateRowColumn(top_id,w_name,arglist,(Cardinal)n);
 	XtManageChild(row_col_id);
 	Matrix_id[Curr_matrix] = row_col_id;
@@ -302,5 +302,5 @@
     XtSetArg ( ar[n], XmNscrollingPolicy, XmAUTOMATIC); n++;
 
-    sl = XmCreateScrolledWindow ( f, "ScrollWin", ar, n );
+    sl = XmCreateScrolledWindow ( f, "ScrollWin", ar, (Cardinal)n );
     /*
     XtVaSetValues ( sl, 
@@ -363,5 +363,5 @@
 
 	w = XmCreateSeparator(parent_id, "separator",
-		arglist,n);
+		arglist,(Cardinal)n);
 	XtManageChild(w);
 	return(w);
@@ -758,5 +758,5 @@
     XtSetArg ( arglist[n], XmNtraversalOn,True); n++;
     return XtAppCreateShell(argv[0], NULL, applicationShellWidgetClass,
-                            display, arglist, n);
+                            display, arglist, (Cardinal)n);
      
 }
@@ -860,5 +860,5 @@
 				}
 				for(i = 0;*ptr; ptr++, i++)
-					Curr_view_opt_par[i] = toupper(*ptr);
+					Curr_view_opt_par[i] = (char)toupper((int)*ptr);
 				Curr_view_opt_par[i] = '\0';
 			}
@@ -1033,6 +1033,6 @@
 Widget id,sel_id;
 int i, j, n_nodes, curr_index = 0;
-char nodes_str[MAX_NODE_NAME*MAX_CONNS], max_str[MAX_NODE_NAME];
-char *ptr, *nodeptrs[MAX_CONNS], *curr_str, *sptr;
+char nodes_str[MAX_NODE_NAME*MAX_CONNS*2], max_str[MAX_NODE_NAME];
+char *ptr, *nodeptrs[MAX_CONNS*2], *curr_str, *sptr;
 int get_nodes();
 
@@ -1052,7 +1052,7 @@
 		sptr = ptr;
 		ptr = strchr(ptr,'\n');
+		*ptr++ = '\0';
 		for(j = 0; j < (int)strlen(sptr); j++)
-		  sptr[j] = tolower(sptr[j]);
-		*ptr++ = '\0';
+		  sptr[j] = (char)tolower((int)sptr[j]);
 	}
 	strcpy(max_str,"zzzzzzzzzzzzzzzzzzzzzzzzzzzz");
@@ -1169,5 +1169,5 @@
 		    ptr1 = strchr(ptr,'|');
 		}
-	    strncpy(Curr_service_format,ptr,(int)(ptr1 - ptr));
+	    strncpy(Curr_service_format,ptr,(size_t)(ptr1 - ptr));
 	    Curr_service_format[(int)(ptr1-ptr)] = '\0';
 	}
@@ -1183,7 +1183,7 @@
 
 	if(tag){}
-	Service_content_str = malloc(1024 + (*size)*16);
-	Service_buffer = malloc(*size);
-	memcpy(Service_buffer, (char *)buffer, *size);
+	Service_content_str = malloc((size_t)(1024 + (*size)*16));
+	Service_buffer = malloc((size_t)*size);
+	memcpy(Service_buffer, (char *)buffer, (size_t)*size);
 	Service_size = *size;
 	get_service_format();
@@ -1303,8 +1303,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;
@@ -1313,8 +1313,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;
@@ -1323,8 +1323,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;
@@ -1333,8 +1333,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;
@@ -1343,8 +1343,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;
@@ -1353,8 +1353,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;
@@ -1997,5 +1997,5 @@
       if(last_size)
 	free(last_buffer);
-      last_buffer = malloc(full_size);
+      last_buffer = malloc((size_t)full_size);
       last_size = full_size;
    }
@@ -2143,6 +2143,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,'\"')) )
 	{
@@ -2198,5 +2198,5 @@
 		      Curr_service_id = 0;
 		  }
-		  Curr_service_id = dic_info_service_stamped(Curr_service_name,
+		  Curr_service_id = (int)dic_info_service_stamped(Curr_service_name,
 						     MONITORED,10,0,0,
 						     recv_service_info,0,
@@ -2218,5 +2218,5 @@
 		      Curr_service_id = 0;
 		  }
-		  Curr_service_id = dic_info_service_stamped(Curr_service_name,
+		  Curr_service_id = (int)dic_info_service_stamped(Curr_service_name,
 						     MONITORED,0,0,0,
 						     recv_service_info,0,
@@ -2404,7 +2404,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;
 		}
@@ -2539,16 +2539,19 @@
 				  strcpy(node, server_ptr->node);
 				  strcpy(par, Curr_view_opt_par);
-				  ptr = strchr(node, '.');
-				  if(ptr)
-				    *ptr = '\0';
-				  ptr = strchr(par,'.');
-				  if(ptr)
-				    *ptr = '\0';
+				  if(!isdigit(node[0]))
+				  {
+					ptr = strchr(node, '.');
+					if(ptr)
+						*ptr = '\0';
+					ptr = strchr(par,'.');
+					if(ptr)
+						*ptr = '\0';
+				  }
 				  ptr = node;
 				  for(i = 0; i < (int)strlen(ptr); i++)
-				    ptr[i] = tolower(ptr[i]);
+				    ptr[i] = (char)tolower((int)ptr[i]);
 				  ptr = par;
 				  for(i = 0; i < (int)strlen(ptr); i++)
-				    ptr[i] = tolower(ptr[i]);
+				    ptr[i] = (char)tolower((int)ptr[i]);
 					 if(!strcmp(/*server_ptr->*/node, /*Curr_view_opt_*/par))
 					{
@@ -2661,5 +2664,5 @@
 	w_id = w = XmCreateMenuBar(Matrix_id[Curr_matrix],
 				(String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
-				arglist,n);
+				arglist,(Cardinal)n);
 /*				
 	if(n_services == -1)
@@ -2675,5 +2678,5 @@
 	w = XmCreateCascadeButton(w,
 				(String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
-				arglist,n);
+				arglist,(Cardinal)n);
 	set_something(w,XmNlabelString,name);
 	set_something(w,XmNalignment,XmALIGNMENT_CENTER);
@@ -2689,5 +2692,5 @@
 		ww = XmCreatePulldownMenu(w_id,
 				(String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
-				arglist,n);
+				arglist,(Cardinal)n);
 		set_something(w,XmNsubMenuId,ww);
 		XtManageChild(w);
@@ -2697,5 +2700,5 @@
 		w = XmCreatePushButton(ww,
 				(String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
-				arglist,n);
+				arglist,(Cardinal)n);
 
 		set_something(w,XmNlabelString,"Services");
@@ -2709,5 +2712,5 @@
 		w = XmCreatePushButton(ww,
 				(String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
-				arglist,n);
+				arglist,(Cardinal)n);
 
 		set_something(w,XmNlabelString,"Clients");
@@ -2857,5 +2860,5 @@
 
 	service_ptr = servp->service_ptr;
-	service_list = (DID_SLOT *)malloc(ptr->n_services * MAX_NAME);
+	service_list = (DID_SLOT *)malloc((size_t)(ptr->n_services * MAX_NAME));
 	n_services = ptr->n_services;
 
@@ -3300,5 +3303,5 @@
       XtSetArg(ar[n],XmNselectionLabelString, xmSelection); n++;
       }
-    sd = XmCreateSelectionDialog ( toplevel_widget, "Selection", ar, n );
+    sd = XmCreateSelectionDialog ( toplevel_widget, "Selection", ar, (Cardinal)n );
     XmStringFree(xmList);
     XmStringFree(xmOk);
@@ -3338,5 +3341,5 @@
     XtSetArg(ar[n],XmNwidth, 500); n++;
     XtSetArg(ar[n],XmNdirMask, xm1); n++;
-    sd = XmCreateFileSelectionDialog ( toplevel_widget, "FileSelection", ar, n );
+    sd = XmCreateFileSelectionDialog ( toplevel_widget, "FileSelection", ar, (Cardinal)n );
     
     XmStringFree(xm1);
@@ -3367,5 +3370,5 @@
     */
     XtSetArg(ar[n],XmNselectionLabelString, xm1); n++;
-    sd = XmCreatePromptDialog ( toplevel_widget, "Prompt", ar, n );
+    sd = XmCreatePromptDialog ( toplevel_widget, "Prompt", ar, (Cardinal)n );
     
     XmStringFree(xm1);
@@ -3396,5 +3399,5 @@
     */
     XtSetArg(ar[n],XmNmessageString, xm1); n++;
-    sd = XmCreateQuestionDialog ( toplevel_widget, "Question", ar, n );
+    sd = XmCreateQuestionDialog ( toplevel_widget, "Question", ar, (Cardinal)n );
     
     XmStringFree(xm1);
@@ -3419,5 +3422,5 @@
     XtSetArg(ar[n],XmNborderWidth, 1); n++;
     XtSetArg(ar[n],XmNresizePolicy, XmRESIZE_ANY); n++;
-    fd = XmCreateFormDialog ( toplevel_widget, "Form", ar, n );
+    fd = XmCreateFormDialog ( toplevel_widget, "Form", ar, (Cardinal)n );
     XtManageChild(fd);
 
@@ -3434,5 +3437,5 @@
     XtSetArg(ar[n],XmNleftAttachment, XmATTACH_FORM); n++;
     XtSetArg(ar[n],XmNleftOffset, 0); n++;
-    rc = XmCreateRowColumn ( fd, "rowcol", ar, n );
+    rc = XmCreateRowColumn ( fd, "rowcol", ar, (Cardinal)n );
     XtManageChild(rc);
 
@@ -3444,5 +3447,5 @@
     XtSetArg ( ar[n], XmNscrollingPolicy, XmAUTOMATIC); n++;
 
-    sw = XmCreateScrolledWindow ( rc, "ScrollWin", ar, n );
+    sw = XmCreateScrolledWindow ( rc, "ScrollWin", ar, (Cardinal)n );
     XtManageChild ( sw );
 
@@ -3453,5 +3456,5 @@
     XtSetArg(ar[n],XmNlabelString, xm1); n++;
     XtSetArg(ar[n],XmNalignment, XmALIGNMENT_BEGINNING); n++;
-    lb = XmCreateLabel ( sw, "label", ar, n );
+    lb = XmCreateLabel ( sw, "label", ar, (Cardinal)n );
     XtManageChild(lb);
     XmStringFree(xm1);
@@ -3467,5 +3470,5 @@
     XtSetArg(ar[n],XmNnumColumns, 3); n++;
     XtSetArg(ar[n],XmNpacking, XmPACK_COLUMN); n++;
-    rc1 = XmCreateRowColumn ( rc, "buttons", ar, n );
+    rc1 = XmCreateRowColumn ( rc, "buttons", ar, (Cardinal)n );
     XtManageChild(rc1);
     /*    
@@ -3496,5 +3499,5 @@
     XtSetArg(ar[n],XmNfontList, did_default_font); n++;
     XtSetArg(ar[n],XmNlabelString, xm1); n++;
-    b = XmCreatePushButton ( parent, "button", ar, n );
+    b = XmCreatePushButton ( parent, "button", ar, (Cardinal)n );
  
     XtManageChild(b);
@@ -3506,5 +3509,2 @@
 }
 
-
-
-
Index: trunk/FACT++/dim/src/dim_jni.c
===================================================================
--- trunk/FACT++/dim/src/dim_jni.c	(revision 14939)
+++ trunk/FACT++/dim/src/dim_jni.c	(revision 15282)
@@ -620,5 +620,5 @@
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "String";
   if(This){}
-  ret = send_data(env, name, theCompletionHandler, mode, timeout, (void*) data, strlen(data)+1);
+  ret = send_data(env, name, theCompletionHandler, mode, timeout, (void*) data, (int)strlen(data)+1);
 
 	(*env)->ReleaseStringUTFChars(env,sdata, data);
@@ -640,5 +640,5 @@
 
 	nativeDataArray = (*env)->GetBooleanArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "boolean[]";
@@ -664,5 +664,5 @@
 
 	nativeDataArray = (*env)->GetCharArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jchar[]";
@@ -688,5 +688,5 @@
 
 	nativeDataArray = (*env)->GetByteArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jbyte[]";
@@ -712,5 +712,5 @@
 
 	nativeDataArray = (*env)->GetShortArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jshort[]";
@@ -736,5 +736,5 @@
 
 	nativeDataArray = (*env)->GetIntArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jint[]";
@@ -760,5 +760,5 @@
 
 	nativeDataArray = (*env)->GetLongArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jlong[]";
@@ -784,5 +784,5 @@
 
 	nativeDataArray = (*env)->GetFloatArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jfloat[]";
@@ -808,5 +808,5 @@
 
 	nativeDataArray = (*env)->GetDoubleArrayElements(env,dataArray,0);
-	length          = (*env)->GetArrayLength(env,dataArray) * sizeof(*nativeDataArray);
+	length          = (jint)(*env)->GetArrayLength(env,dataArray) * (jint)sizeof(*nativeDataArray);
 
   DBG(dim_Dbg_SEND_NATIVE) send_data_format = "jdouble[]";
@@ -1009,5 +1009,5 @@
 
 
-  ret = request_service((char *)info, service_type, timeout, 0, 0, callback_function, (dim_long)callback_param, &no_link, 0, stamped);
+  ret = (jint)request_service((char *)info, service_type, timeout, 0, 0, callback_function, (dim_long)callback_param, &no_link, 0, stamped);
   DBGx(dim_Dbg_INFO_SERVICE) printf("DimJNI: client infoService(%s, DataDecoder@0x%08lx, mode=%d, timeout=%d ) returns %d\n", info, (dim_long)theNativeDataDecoder, mode, timeout, ret);
   (*env)->ReleaseStringUTFChars(env, name, info);
@@ -1407,5 +1407,5 @@
 	if(This){}
  	dataEncoder = (*env)->NewGlobalRef(env, dataEncoder);
-	sid = dis_add_service(serviceNameUTF, serviceTypeUTF, 0, 0, server_getInfo_callback, dataEncoder);
+	sid = (jint)dis_add_service(serviceNameUTF, serviceTypeUTF, 0, 0, server_getInfo_callback, dataEncoder);
 
 	DBGx(dim_Dbg_ADD_SERVICE) printf("DimJNI: Server.addService(%s,%s, @%08lx)=%d\n",serviceNameUTF, serviceTypeUTF, (dim_long)dataEncoder, sid);
@@ -1441,5 +1441,5 @@
 	if(This){}
  	dataDecoder = (*env)->NewGlobalRef(env, dataDecoder);
-	sid = dis_add_cmnd(serviceNameUTF, serviceTypeUTF, server_cmnd_callback, dataDecoder);
+	sid = (jint)dis_add_cmnd(serviceNameUTF, serviceTypeUTF, server_cmnd_callback, dataDecoder);
 
 	DBGx(dim_Dbg_ADD_CMND) printf("DimJNI: Server.addCmnd(%s,%s, @%08lx) = %d\n",serviceNameUTF, serviceTypeUTF, (dim_long) dataDecoder, sid);
@@ -1467,5 +1467,5 @@
 
 	DBGe(dim_Dbg_UPDATE_SERVICE) printf("DimJNI: Server.updateService %d\n", sid);
-	do_update_service(sid, clientArray);
+	do_update_service((unsigned int)sid, (int *)clientArray);
 
 	if(clientArray!=NULL) (*env)->ReleaseIntArrayElements(env,clients,clientArray,JNI_ABORT);
@@ -1787,5 +1787,5 @@
   {
     int* data = (int*) internalDataAddress;
-    int leng = internalDataSize/sizeof(int);
+    int leng = (int)internalDataSize/(int)sizeof(int);
     int  i;
 
@@ -2063,5 +2063,5 @@
 	if(nativeClass){}
 //	DBGe(dim_Dbg_MEMORY_ALLOCATE) ; /* report only */
-  address = (jlong) malloc(size);
+  address = (jlong) malloc((size_t)size);
 	DBGx(dim_Dbg_MEMORY_ALLOCATE) printf("DimJNI: MutableMemory.allocateNativeDataBlock of %d bytes at 0x%08lx\n", size, address);
   return address;
@@ -2337,5 +2337,5 @@
 	if(nativeClass){}
 	DBGe(dim_Dbg_MUTABLE_MEMORY) printf("DimJNI: MutableMemory.copyNativeDataBlock\n");
-  memcpy((void *)destinationDataAddress, (void *)sourceDataAddress, length);
+	memcpy((void *)destinationDataAddress, (void *)sourceDataAddress, (size_t)length);
 	return ;
 }
@@ -2391,5 +2391,5 @@
 	if(maxEntries==0) maxEntries = 10;
 	descriptor = (objectDescriptor_type*) malloc(sizeof(objectDescriptor_type));
-	descriptor->entry = (objectDescriptorEntry_type*) malloc(maxEntries * sizeof(objectDescriptorEntry_type));
+	descriptor->entry = (objectDescriptorEntry_type*) malloc((size_t)(maxEntries * (jint)sizeof(objectDescriptorEntry_type)));
 	descriptor->objectClass = (*env)->NewGlobalRef(env, objectClass);
 	descriptor->entries = 0;
@@ -2404,5 +2404,5 @@
 	if(descriptor->entries == descriptor->maxEntries)
 	{
-		objectDescriptorEntry_type* entry = realloc(descriptor->entry, descriptor->maxEntries+10);
+		objectDescriptorEntry_type* entry = realloc(descriptor->entry, (size_t)(descriptor->maxEntries+10));
 //printf("realloc descriptor\n");
 		if(entry==NULL) return NULL;
Index: trunk/FACT++/dim/src/dim_thr.c
===================================================================
--- trunk/FACT++/dim/src/dim_thr.c	(revision 14939)
+++ trunk/FACT++/dim/src/dim_thr.c	(revision 15282)
@@ -121,4 +121,9 @@
 #endif
 */
+    if(DIM_Threads_OFF)
+    {
+		dim_no_threads();
+		return;
+    }
 	if(!DIM_THR_init_done)
 	{
@@ -136,5 +141,5 @@
 		
 #ifndef darwin 	
-		sem_init(&DIM_INIT_Sema, 0, INIT_count);
+		sem_init(&DIM_INIT_Sema, 0, (unsigned int)INIT_count);
 		/*
 		sem_init(&DIM_WAIT_Sema, 0, WAIT_count);
@@ -710,5 +715,5 @@
 	HANDLE hProc;
 	int ret;
-	DWORD p;
+	DWORD p = 0;
 
 #ifndef PXI
@@ -778,6 +783,6 @@
 int dim_set_priority(int threadId, int prio)
 {
-	HANDLE id;
-	int ret, p;
+	HANDLE id = 0;
+	int ret, p = 0;
 
 #ifndef PXI
@@ -815,6 +820,6 @@
 int dim_get_priority(int threadId, int *prio)
 {
-	HANDLE id;
-	int ret, p;
+	HANDLE id = 0;
+	int ret, p = 0;
 
 #ifndef PXI
Index: trunk/FACT++/dim/src/dimcpp.cxx
===================================================================
--- trunk/FACT++/dim/src/dimcpp.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/dimcpp.cxx	(revision 15282)
@@ -94,5 +94,5 @@
 	if(!itsId)
 	{
-		itsId = dim_start_thread(thread_user_routine, this);
+		itsId = (long)dim_start_thread(thread_user_routine, this);
 		return 1;
 	}
Index: trunk/FACT++/dim/src/dis.c
===================================================================
--- trunk/FACT++/dim/src/dis.c	(revision 14939)
+++ trunk/FACT++/dim/src/dis.c	(revision 15282)
@@ -201,5 +201,5 @@
 	if(Dis_packet_size)
 		free(Dis_packet);
-	Dis_packet = (DIS_STAMPED_PACKET *)malloc(DIS_STAMPED_HEADER + size);
+	Dis_packet = (DIS_STAMPED_PACKET *)malloc((size_t)(DIS_STAMPED_HEADER + size));
 	if(Dis_packet)
 	{
@@ -213,10 +213,10 @@
 static int check_service_name(char *name)
 {
-	if(strlen(name) > (MAX_NAME - 1))
+	if((int)strlen(name) > (MAX_NAME - 1))
 		return(0);
 	return(1);
 }
 
-static void dis_init()
+void dis_init()
 {
 	int dis_hash_service_init();
@@ -266,8 +266,8 @@
 	}
 	new_serv = (SERVICE *)malloc( sizeof(SERVICE) );
-	strncpy( new_serv->name, name, MAX_NAME );
+	strncpy( new_serv->name, name, (size_t)MAX_NAME );
 	if(type != (char *)0)
 	{
-		if (strlen(type) >= MAX_NAME)
+		if ((int)strlen(type) >= MAX_NAME)
 		{
 			strcpy(str,"Format String Too Long: ");
@@ -441,5 +441,5 @@
 	}
 	new_serv = (SERVICE *)malloc(sizeof(SERVICE));
-	strncpy(new_serv->name, name, MAX_NAME);
+	strncpy(new_serv->name, name, (size_t)MAX_NAME);
 	if(type != (char *)0)
 	{
@@ -783,5 +783,5 @@
   dis_dns_p->n_services = htovl(n_services);
   dis_dns_p->size = htovl(DIS_DNS_HEADER +
-					n_services * sizeof(SERVICE_REG));
+					n_services * (int)sizeof(SERVICE_REG));
   serv_regp = dis_dns_p->services;
   strcpy( serv_regp->service_name, "DUMMY_UPDATE_PACKET" );
@@ -796,5 +796,5 @@
 }
       if( !dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet),
-		     DIS_DNS_HEADER + n_services * sizeof(SERVICE_REG)))
+		     DIS_DNS_HEADER + n_services * (int)sizeof(SERVICE_REG)))
 	  {
 		release_conn(dnsp->dns_dis_conn_id, 0, 1);
@@ -826,5 +826,5 @@
 */
 		strncpy( dis_dns_p->task_name, dnsp->task_name,
-			MAX_TASK_NAME-4 );
+			(size_t)(MAX_TASK_NAME-4) );
 		dis_dns_p->task_name[MAX_TASK_NAME-4-1] = '\0';
 		get_node_addr( dis_dns_p->node_addr );
@@ -852,5 +852,5 @@
 		dis_dns_p->n_services = htovl(n_services);
 		dis_dns_p->size = htovl( DIS_DNS_HEADER + 
-			(n_services*sizeof(SERVICE_REG)));
+			(n_services*(int)sizeof(SERVICE_REG)));
 		if(dnsp->dns_dis_conn_id > 0)
 		{
@@ -863,5 +863,5 @@
 }
 			if(!dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet), 
-				DIS_DNS_HEADER + n_services*sizeof(SERVICE_REG)))
+				DIS_DNS_HEADER + n_services*(int)sizeof(SERVICE_REG)))
 			{
 				release_conn(dnsp->dns_dis_conn_id, 0, 1);
@@ -917,6 +917,6 @@
 		{
 			dis_dns_p->n_services = htovl(n_services);
-			dis_dns_p->size = htovl(DIS_DNS_HEADER +
-				n_services * sizeof(SERVICE_REG));
+			dis_dns_p->size = (int)htovl(DIS_DNS_HEADER +
+				n_services * (int)sizeof(SERVICE_REG));
 			if(dnsp->dns_dis_conn_id > 0)
 			{
@@ -931,5 +931,5 @@
 					   &(dnsp->dis_dns_packet), 
 					   DIS_DNS_HEADER + n_services *
-						sizeof(SERVICE_REG)) )
+						(int)sizeof(SERVICE_REG)) )
 				{
 					release_conn(dnsp->dns_dis_conn_id, 0, 1);
@@ -946,5 +946,5 @@
 		dis_dns_p->n_services = htovl(n_services);
 		dis_dns_p->size = htovl(DIS_DNS_HEADER +
-					n_services * sizeof(SERVICE_REG));
+					n_services * (int)sizeof(SERVICE_REG));
 		if(dnsp->dns_dis_conn_id > 0)
 		{
@@ -957,5 +957,5 @@
 }
 			if( !dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet),
-				DIS_DNS_HEADER + n_services * sizeof(SERVICE_REG)))
+				DIS_DNS_HEADER + n_services * (int)sizeof(SERVICE_REG)))
 			{
 				release_conn(dnsp->dns_dis_conn_id, 0, 1);
@@ -990,5 +990,5 @@
 */
 			strncpy( dis_dns_p->task_name, dnsp->task_name,
-				MAX_TASK_NAME-4 );
+				(size_t)(MAX_TASK_NAME-4) );
 			dis_dns_p->task_name[MAX_TASK_NAME-4-1] = '\0';
 			get_node_addr( dis_dns_p->node_addr );
@@ -1001,5 +1001,5 @@
 		strcpy( serv_regp->service_name, servp->name );
 		strcpy( serv_regp->service_def, servp->def );
-		serv_regp->service_id = htovl( servp->id | 0x80000000);
+		serv_regp->service_id = (int)htovl( (unsigned)servp->id | 0x80000000);
 		serv_regp++;
 		n_services = 1;
@@ -1007,5 +1007,5 @@
 		dis_dns_p->n_services = htovl(n_services);
 		dis_dns_p->size = htovl(DIS_DNS_HEADER +
-				n_services * sizeof(SERVICE_REG));
+				n_services * (int)sizeof(SERVICE_REG));
 
 if(Debug_on)
@@ -1017,5 +1017,5 @@
 }
 		if( !dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet), 
-			DIS_DNS_HEADER + n_services * sizeof(SERVICE_REG)) )
+			DIS_DNS_HEADER + n_services * (int)sizeof(SERVICE_REG)) )
 		{
 			release_conn(dnsp->dns_dis_conn_id, 0, 1);
@@ -1098,5 +1098,5 @@
 	extern DIS_DNS_CONN *dis_find_dns(dim_long);
 	DIS_DNS_CONN *dnsp;
-	int more_ids[10] = {0};
+	unsigned int more_ids[10] = {0};
 
 	dis_init();
@@ -1132,5 +1132,5 @@
 	if(Dis_first_time)
 	{
-		strncpy( task_name_aux, task, MAX_TASK_NAME );
+		strncpy( task_name_aux, task, (size_t)MAX_TASK_NAME );
 		task_name_aux[MAX_TASK_NAME-1] = '\0';
 		Port_number = SEEK_PORT;
@@ -1159,5 +1159,5 @@
 
 		more_ids[0] = do_dis_add_service_dns( str0, "L", &Version_number,
-				 sizeof(Version_number), 0, 0, dnsid );
+						sizeof(Version_number), 0, 0, dnsid );
 
 		more_ids[1] = do_dis_add_service_dns( str1, "C", 0, 0, client_info, (dim_long)dnsp, dnsid );
@@ -1464,5 +1464,5 @@
 		if( Dis_packet_size )
 			free( Dis_packet );
-		Dis_packet = (DIS_STAMPED_PACKET *)malloc(DIS_STAMPED_HEADER + size);
+		Dis_packet = (DIS_STAMPED_PACKET *)malloc((size_t)(DIS_STAMPED_HEADER + size));
 		if(!Dis_packet)
 		{
@@ -1487,7 +1487,7 @@
 			tz = 0;
 		        gettimeofday(&tv, tz);
-			aux = tv.tv_usec / 1000;
+			aux = (int)tv.tv_usec / 1000;
 			Dis_packet->time_stamp[0] = htovl(aux);
-			Dis_packet->time_stamp[1] = htovl(tv.tv_sec);
+			Dis_packet->time_stamp[1] = htovl((int)tv.tv_sec);
 #endif
 		}
@@ -1498,5 +1498,5 @@
 			Dis_packet->time_stamp[1] = htovl(servp->user_secs);
 		}
-		Dis_packet->reserved[0] = htovl(0xc0dec0de);
+		Dis_packet->reserved[0] = (int)htovl(0xc0dec0de);
 		Dis_packet->quality = htovl(servp->quality);
 	}
@@ -1566,8 +1566,8 @@
 		return;
 	if( !packet_size ) {
-		dis_packet = (DIS_PACKET *)malloc(DIS_HEADER);
+		dis_packet = (DIS_PACKET *)malloc((size_t)DIS_HEADER);
 		packet_size = DIS_HEADER;
 	}
-	service_id = (reqp->service_id | 0x80000000);
+	service_id = (int)((unsigned)reqp->service_id | 0x80000000);
 	dis_packet->service_id = htovl(service_id);
 	dis_packet->size = htovl(DIS_HEADER);
@@ -1599,5 +1599,5 @@
 	if(!buffer_size)
 	{
-		buffer = (int *)malloc(add_size);
+		buffer = (int *)malloc((size_t)add_size);
 		buffer_size = add_size;
 	} 
@@ -1607,5 +1607,5 @@
 		{
 			free(buffer);
-			buffer = (int *)malloc(add_size);
+			buffer = (int *)malloc((size_t)add_size);
 			buffer_size = add_size;
 		}
@@ -1622,6 +1622,6 @@
 			{
 				if(formatp->flags & IT_IS_FLOAT)
-					formatp->flags |= (format & 0xf0);
-				formatp->flags &= 0xFFF0;	/* NOSWAP */
+					formatp->flags |= ((short)format & (short)0xf0);
+				formatp->flags &= (short)0xFFF0;	/* NOSWAP */
 			}
 		}
@@ -1631,5 +1631,5 @@
 			{
 				if(formatp->flags & IT_IS_FLOAT)
-					formatp->flags |= (format & 0xf0);
+					formatp->flags |= ((short)format & (short)0xf0);
 			}
 		}
@@ -1992,6 +1992,6 @@
 			tz = 0;
 		    gettimeofday(&tv, tz);
-			servp->user_secs = tv.tv_sec;
-			servp->user_millisecs = tv.tv_usec / 1000;
+			servp->user_secs = (int)tv.tv_sec;
+			servp->user_millisecs = (int)tv.tv_usec / 1000;
 #endif
 	}
@@ -2074,5 +2074,5 @@
 	if(!packet_size)
 	{
-		dis_packet = (DIS_PACKET *)malloc(DIS_HEADER+size);
+		dis_packet = (DIS_PACKET *)malloc((size_t)(DIS_HEADER+size));
 		packet_size = DIS_HEADER + size;
 	} 
@@ -2082,5 +2082,5 @@
 		{
 			free(dis_packet);
-			dis_packet = (DIS_PACKET *)malloc(DIS_HEADER+size);
+			dis_packet = (DIS_PACKET *)malloc((size_t)(DIS_HEADER+size));
 			packet_size = DIS_HEADER+size;
 		}
@@ -2091,5 +2091,5 @@
 	{
 		dis_packet->service_id = htovl(reqp->service_id);
-		memcpy(dis_packet->buffer, buffer, size);
+		memcpy(dis_packet->buffer, buffer, (size_t)size);
 		dis_packet->size = htovl(DIS_HEADER + size);
 
@@ -2263,5 +2263,5 @@
 		{
 			ENABLE_AST
-			dis_remove_service(servp->id);
+			dis_remove_service((unsigned)servp->id);
 			{
 			DISABLE_AST
@@ -2371,5 +2371,5 @@
 	{
 		ENABLE_AST
-		dis_remove_service(servp->id);
+		dis_remove_service((unsigned)servp->id);
 		{
 		DISABLE_AST
@@ -2467,5 +2467,5 @@
     int found = 0;
 	int release_request();
-	DIS_DNS_CONN *dnsp;
+	DIS_DNS_CONN *dnsp = 0;
 
 	DISABLE_AST;
@@ -2568,5 +2568,5 @@
 		if(!curr_allocated_size)
 		{
-			service_info_buffer = (char *)malloc(max_size);
+			service_info_buffer = (char *)malloc((size_t)max_size);
 			curr_allocated_size = max_size;
 		}
@@ -2574,5 +2574,5 @@
 		{
 			free(service_info_buffer);
-			service_info_buffer = (char *)malloc(max_size);
+			service_info_buffer = (char *)malloc((size_t)max_size);
 			curr_allocated_size = max_size;
 		}
@@ -2587,5 +2587,5 @@
 			strcat(buff_ptr, servp->name);
 			strcat(buff_ptr, "\n");
-			buff_ptr += strlen(buff_ptr);
+			buff_ptr += (int)strlen(buff_ptr);
 		}
 	}
@@ -2743,9 +2743,9 @@
 		sll_init((SLL *) Cmnds_head);
 	}
-	new_cmnd = (DIS_CMND *)malloc((*size)+12);
+	new_cmnd = (DIS_CMND *)malloc((size_t)((*size)+12));
 	new_cmnd->next = 0;
 	new_cmnd->tag = *tag;
 	new_cmnd->size = *size;
-	memcpy(new_cmnd->buffer, cmnd_buff, *size);
+	memcpy(new_cmnd->buffer, cmnd_buff, (size_t)*size);
 	sll_insert_queue((SLL *) Cmnds_head, (SLL *) new_cmnd);
 }
@@ -2782,5 +2782,5 @@
 			ret_val = 1;
 		}
-		memcpy(buffer, cmndp->buffer, *size);
+		memcpy(buffer, cmndp->buffer, (size_t)*size);
 		*tag = cmndp->tag;
 		free(cmndp);
@@ -2824,5 +2824,5 @@
 
 	strcpy(for_str->dsc$a_pointer, c_str);
-	for(i = strlen(c_str); i< for_str->dsc$w_length; i++)
+	for(i = (int)strlen(c_str); i< for_str->dsc$w_length; i++)
 		for_str->dsc$a_pointer[i] = ' ';
 }
@@ -2843,5 +2843,5 @@
 	if(!curr_allocated_size)
 	{
-		dns_info_buffer = malloc(max_size);
+		dns_info_buffer = malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 	}
@@ -2859,9 +2859,9 @@
 			curr_conns[index++] = clip->conn_id;
 		}
-		max_size = (index+1)*sizeof(DNS_CLIENT_INFO);
+		max_size = (index+1)*(int)sizeof(DNS_CLIENT_INFO);
 		if (max_size > curr_allocated_size)
 		{
 			free(dns_info_buffer);
-			dns_info_buffer = malloc(max_size);
+			dns_info_buffer = malloc((size_t)max_size);
 			curr_allocated_size = max_size;
 		}
@@ -2892,7 +2892,7 @@
 	}
 	if(index)
-		dns_client_info[strlen(dns_client_info)-1] = '\0';
+		dns_client_info[(int)strlen(dns_client_info)-1] = '\0';
 	*bufp = (int *)dns_info_buffer;
-	*size = strlen(dns_info_buffer)+1;
+	*size = (int)strlen(dns_info_buffer)+1;
 }
 
@@ -2967,5 +2967,5 @@
 	if(!curr_allocated_size)
 	{
-		service_info_buffer = (char *)malloc(max_size);
+		service_info_buffer = (char *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 	}
@@ -2973,5 +2973,5 @@
 	{
 		free(service_info_buffer);
-		service_info_buffer = (char *)malloc(max_size);
+		service_info_buffer = (char *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 	}
@@ -2996,5 +2996,5 @@
 				servp->registered = Last_n_clients+1;
 				append_service(buff_ptr, servp);
-				buff_ptr += strlen(buff_ptr);
+				buff_ptr += (int)strlen(buff_ptr);
 			}
 		}
@@ -3012,7 +3012,7 @@
 			{
 				strcat(buff_ptr, "-");
-				buff_ptr += strlen(buff_ptr);
+				buff_ptr += (int)strlen(buff_ptr);
 				append_service(buff_ptr, servp);
-				buff_ptr += strlen(buff_ptr);
+				buff_ptr += (int)strlen(buff_ptr);
 			}
 			else if(servp->registered < (Last_n_clients+1))
@@ -3021,9 +3021,9 @@
 				{
 					strcat(buff_ptr, "+");
-					buff_ptr += strlen(buff_ptr);
+					buff_ptr += (int)strlen(buff_ptr);
 					done = 1;
 				}
 				append_service(buff_ptr, servp);
-				buff_ptr += strlen(buff_ptr);
+				buff_ptr += (int)strlen(buff_ptr);
 /*
 				servp->registered = 2;
@@ -3034,5 +3034,5 @@
 	}
 	*bufp = (int *)service_info_buffer;
-	*size = buff_ptr - service_info_buffer+1;
+	*size = (int)(buff_ptr - service_info_buffer+1);
 	if(*size == 1)
 		*size = -1;
@@ -3235,4 +3235,5 @@
 int dis_hash_service_init()
 {
+
   int i;
   static int done = 0;
@@ -3242,10 +3243,14 @@
 	for( i = 0; i < MAX_HASH_ENTRIES; i++ ) 
 	{
+/*
 		Service_hash_table[i] = (SERVICE *) malloc(sizeof(SERVICE));
 		dll_init((DLL *) Service_hash_table[i]);
+*/
+		Service_hash_table[i] = 0;
 		Service_new_entries[i] = 0;
 	}
 	done = 1;
   }
+
   return(1);
 }
@@ -3255,4 +3260,9 @@
 	int index;
 	index = HashFunction(servp->name, MAX_HASH_ENTRIES);
+	if(!Service_hash_table[index])
+	{
+		Service_hash_table[index] = (SERVICE *) malloc(sizeof(SERVICE));
+		dll_init((DLL *) Service_hash_table[index]);
+	}
 	Service_new_entries[index]++;
 	dll_insert_queue((DLL *) Service_hash_table[index], 
@@ -3272,4 +3282,10 @@
 int dis_hash_service_remove(SERVICE *servp)
 {
+	int index;
+	index = HashFunction(servp->name, MAX_HASH_ENTRIES);
+	if(!Service_hash_table[index])
+	{
+		return(0);
+	}
 	dll_remove( (DLL *) servp );
 	return(1);
@@ -3283,7 +3299,11 @@
 
 	index = HashFunction(name, MAX_HASH_ENTRIES);
+	if(!Service_hash_table[index])
+	{
+		return((SERVICE *)0);
+	}
 	if( (servp = (SERVICE *) dll_search(
 					(DLL *) Service_hash_table[index],
-			      		name, strlen(name)+1)) )
+			      		name, (int)strlen(name)+1)) )
 	{
 		return(servp);
@@ -3314,11 +3334,14 @@
 	do
 	{
-		if((!new_entries) || (Service_new_entries[index] > 0))
-		{
-			servp = (SERVICE *) dll_get_next(
+		if(prevp)
+		{
+			if((!new_entries) || (Service_new_entries[index] > 0))
+			{
+				servp = (SERVICE *) dll_get_next(
 						(DLL *) Service_hash_table[index],
 						(DLL *) prevp);
-			if(servp)
-				break;
+				if(servp)
+					break;
+			}
 		}
 		index++;
Index: trunk/FACT++/dim/src/discpp.cxx
===================================================================
--- trunk/FACT++/dim/src/discpp.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/discpp.cxx	(revision 15282)
@@ -17,4 +17,6 @@
 
 extern "C" {
+extern void dis_init();
+
 static void user_routine( void *tagp, void **buf, int *size, int *first_time)
 {
@@ -39,5 +41,5 @@
 	}
 	if( t->itsType == DisSTRING)
-			t->itsSize = strlen((char *)t->itsData)+1;
+			t->itsSize = (int)strlen((char *)t->itsData)+1;
 	*buf = t->itsData;
 	*size = t->itsSize;
@@ -49,5 +51,5 @@
 //	itsTagId = 0;
 	itsDns = dns;
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	itsDataSize = 0;
 	strcpy( itsName, name);
@@ -57,16 +59,21 @@
 		itsServiceHandler = 0;
 //	itsTagId = id_get((void *)this, SRC_DIS);
+	dis_init();
 	if(itsDns == 0)
 	{
+		DISABLE_AST
 		itsId = dis_add_service( name, format, NULL, 0, 
 //				user_routine, itsTagId);
 				user_routine, (dim_long)this);
+		ENABLE_AST
 		DimServer::start();
 	}
 	else
 	{
+		DISABLE_AST
 		itsId = dis_add_service_dns( itsDns->getDnsId(), name, format, NULL, 0, 
 //				user_routine, itsTagId);
 				user_routine, (dim_long)this);
+		ENABLE_AST
 //		itsDns->addServiceId(itsId);
 		DimServer::start(itsDns);
@@ -88,5 +95,5 @@
 		itsDataSize = size;
 	}
-	memcpy(itsData, data, size);
+	memcpy(itsData, data, (size_t)size);
 	itsSize = size;
 }
@@ -125,7 +132,7 @@
 //	itsTagId = 0;
 	itsDns = dns;
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy( itsName, name);
-	itsFormat = new char[strlen(format)+1];
+	itsFormat = new char[(int)strlen(format)+1];
 	strcpy( itsFormat, format);
 	currCmnd = 0;
@@ -135,16 +142,21 @@
 		itsCommandHandler = 0;
 //	itsTagId = id_get((void *)this, SRC_DIS);
+	dis_init();
 	if(!itsDns)
 	{
+		DISABLE_AST
 		itsId = dis_add_cmnd( name, format, command_routine,
 //				itsTagId);
 				(dim_long)this);
+		ENABLE_AST
 		DimServer::start();
 	}
 	else
 	{
+		DISABLE_AST
 		itsId = dis_add_cmnd_dns( itsDns->getDnsId(), name, format, command_routine,
 //			itsTagId);
 			(dim_long)this);
+		ENABLE_AST
 //		itsDns->addServiceId(itsId);
 		DimServer::start(itsDns);
@@ -230,10 +242,10 @@
 //	itsTagId = 0;
 	itsDns = dns;
-	itsName = new char[strlen(name)+1];
+	itsName = new char[(int)strlen(name)+1];
 	strcpy( itsName, name);
-	itsNameIn = new char[strlen(name)+1+10];
+	itsNameIn = new char[(int)strlen(name)+1+10];
 	strcpy( itsNameIn, name);
 	strcat(itsNameIn,(char *)"/RpcIn");
-	itsNameOut = new char[strlen(name)+1+10];
+	itsNameOut = new char[(int)strlen(name)+1+10];
 	strcpy( itsNameOut, name);
 	strcat(itsNameOut,(char *)"/RpcOut");
@@ -244,6 +256,8 @@
 	
 //	itsTagId = id_get((void *)this, SRC_DIS);
+	dis_init();
 	if(!itsDns)
 	{
+		DISABLE_AST
 		itsIdIn = dis_add_cmnd( itsNameIn, formatin, 
 //			rpcin_routine, itsTagId);
@@ -252,8 +266,10 @@
 //			rpcout_routine, itsTagId);
 			rpcout_routine, (dim_long)this);
+		ENABLE_AST
 		DimServer::start();
 	}
 	else
 	{
+		DISABLE_AST
 		itsIdIn = dis_add_cmnd_dns( itsDns->getDnsId(), itsNameIn, formatin, 
 //			rpcin_routine, itsTagId);
@@ -262,4 +278,5 @@
 //			rpcout_routine, itsTagId);
 			rpcout_routine, (dim_long)this);
+		ENABLE_AST
 //		itsDns->addServiceId(itsIdIn);
 //		itsDns->addServiceId(itsIdOut);
@@ -282,5 +299,5 @@
 		itsDataOutSize = size;
 	}
-	memcpy(itsDataOut, data, size);
+	memcpy(itsDataOut, data, (size_t)size);
 	itsSizeOut = size;
 }
@@ -314,5 +331,5 @@
 //	if(!itsNode)
 //	{
-		itsNode = new char[strlen(node)+1];
+		itsNode = new char[(int)strlen(node)+1];
 		strcpy(itsNode,node);
 //	}
@@ -335,5 +352,5 @@
 	{
 		tmp = new int[itsServiceIdListSize + DisDnsIdBlock];
-		memcpy(tmp, itsServiceIdList, itsServiceIdListSize*sizeof(int));
+		memcpy(tmp, itsServiceIdList, (size_t)itsServiceIdListSize*sizeof(int));
 		delete itsServiceIdList;
 		itsServiceIdList = tmp;
@@ -378,5 +395,5 @@
 	if(!itsName)
 	{
-		itsName = new char[strlen(name)+1];
+		itsName = new char[(int)strlen(name)+1];
 		strcpy(itsName,name);
 	}
@@ -437,5 +454,5 @@
 	if(!itsName)
 	{
-		itsName = new char[strlen(name)+1];
+		itsName = new char[(int)strlen(name)+1];
 		strcpy(itsName,name);
 	}
@@ -447,4 +464,6 @@
 	dim_long dnsid;
 
+	dis_init();
+	{
 	DISABLE_AST
 	dns->setName(name);
@@ -452,4 +471,5 @@
 	dis_start_serving_dns(dnsid, (char *)name /*, dns->getServiceIdList()*/);
 	ENABLE_AST
+	}
 }
 /*
@@ -491,4 +511,6 @@
 	int isAuto;
 
+	dis_init();
+	{
 	DISABLE_AST
 //	dns->itsNServices++;
@@ -503,4 +525,5 @@
 	}
 	ENABLE_AST
+	}
 }
 
@@ -798,5 +821,5 @@
 {
 	itsData = string;
-	itsSize = strlen(string)+1;
+	itsSize = (int)strlen(string)+1;
 	itsType = DisSTRING;
 	declareIt((char *)name, (char *)"C", 0, 0);
@@ -880,5 +903,5 @@
 {
 	itsData = string;
-	itsSize = strlen(string)+1;
+	itsSize = (int)strlen(string)+1;
 	itsType = DisSTRING;
 	declareIt((char *)name, (char *)"C", 0, dns);
@@ -987,5 +1010,5 @@
 	{
 		itsData = string;
-		itsSize = strlen(string)+1;
+		itsSize = (int)strlen(string)+1;
 		return dis_update_service( itsId );
 	}
@@ -1106,5 +1129,5 @@
 	{
 		itsData = string;
-		itsSize = strlen(string)+1;
+		itsSize = (int)strlen(string)+1;
 		if( cids == 0)
 		{
@@ -1179,5 +1202,5 @@
 void DimService::setData(char *data)
 {
-	storeIt(data, strlen(data)+1);
+	storeIt(data, (int)strlen(data)+1);
 }
 
@@ -1204,5 +1227,5 @@
 	secs = tsecs;
 	millisecs = tmillisecs;
-	memcpy(itsData, data, datasize);
+	memcpy(itsData, data, (size_t)datasize);
 }
 
@@ -1465,5 +1488,5 @@
 void DimRpc::setData(char *data)
 {
-	storeIt(data,strlen(data)+1);
+	storeIt(data,(int)strlen(data)+1);
 }
 
Index: trunk/FACT++/dim/src/dll.c
===================================================================
--- trunk/FACT++/dim/src/dll.c	(revision 14939)
+++ trunk/FACT++/dim/src/dll.c	(revision 15282)
@@ -53,5 +53,5 @@
 	DISABLE_AST
 	while( auxp!= head ) {
-		if( !memcmp(auxp->user_info, data, size) ) {
+		if( !memcmp(auxp->user_info, data, (size_t)size) ) {
 			ENABLE_AST
 			return(auxp);
@@ -117,5 +117,5 @@
 	DISABLE_AST
 	while( auxp!= head ) {
-		if( !memcmp(&(auxp->user_info[offset]), data, size) ) {
+		if( !memcmp(&(auxp->user_info[offset]), data, (size_t)size) ) {
 			retp = auxp;
 		}
Index: trunk/FACT++/dim/src/dna.c
===================================================================
--- trunk/FACT++/dim/src/dna.c	(revision 14939)
+++ trunk/FACT++/dim/src/dna.c	(revision 15282)
@@ -248,5 +248,5 @@
 	{
 		dna_connp->buffer =
-				(int *) realloc(dna_connp->buffer, size);
+				(int *) realloc(dna_connp->buffer, (size_t)size);
 		dna_connp->buffer_size = size;
 	}
@@ -428,5 +428,5 @@
 	header_p->header_size = htovl(READ_HEADER_SIZE);
 	header_p->data_size = htovl(size);
-	header_p->header_magic = htovl(HDR_MAGIC);
+	header_p->header_magic = (int)htovl(HDR_MAGIC);
 	tcpip_code = dna_write_bytes(conn_id, &header_pkt, READ_HEADER_SIZE, 1);
 	if(tcpip_failure(tcpip_code)) 
@@ -462,11 +462,11 @@
 	DISABLE_AST
 
-	pktp = malloc(READ_HEADER_SIZE+size);
+	pktp = malloc((size_t)(READ_HEADER_SIZE+size));
 	headerp = &(pktp->header);
 	headerp->header_size = htovl(READ_HEADER_SIZE);
 	headerp->data_size = htovl(size);
-	headerp->header_magic = htovl(HDR_MAGIC);
-
-	memcpy(pktp->data, (char *)buffer, size);
+	headerp->header_magic = (int)htovl(HDR_MAGIC);
+
+	memcpy(pktp->data, (char *)buffer, (size_t)size);
 
 	newp = malloc(sizeof(WRITE_ITEM));
@@ -505,5 +505,5 @@
 	} else {
 		dna_connp->state = RD_HDR;
-		dna_connp->buffer = (int *)malloc(TCP_RCV_BUF_SIZE);
+		dna_connp->buffer = (int *)malloc((size_t)TCP_RCV_BUF_SIZE);
 /*
 		if(!dna_connp->buffer)
@@ -623,5 +623,6 @@
 	register int i, size;
 	time_t oldest;
-	int oldesti;
+	int oldesti = 0;
+	extern time_t time();
 
 	if(type == 0)
@@ -803,5 +804,5 @@
 	dna_connp->state = RD_HDR;
 	dna_connp->writing = FALSE;
-	dna_connp->buffer = (int *)malloc(TCP_RCV_BUF_SIZE);
+	dna_connp->buffer = (int *)malloc((size_t)TCP_RCV_BUF_SIZE);
 /*
 	if(!dna_connp->buffer)
@@ -815,5 +816,5 @@
 	dna_connp->saw_init = TRUE;	/* we send it! */
 	dna_start_read(conn_id, READ_HEADER_SIZE);
-	local_buffer.code = htovl(OPN_MAGIC);
+	local_buffer.code = (int)htovl(OPN_MAGIC);
 	get_node_name(local_buffer.node);
 	get_proc_name(local_buffer.task);
Index: trunk/FACT++/dim/src/dns.c
===================================================================
--- trunk/FACT++/dim/src/dns.c	(revision 14939)
+++ trunk/FACT++/dim/src/dns.c	(revision 15282)
@@ -198,5 +198,5 @@
 	int rem_only = 0;
 
-	Dns_conns[conn_id].validity = time(NULL);
+	Dns_conns[conn_id].validity = (int)time(NULL);
 	if( !Dns_conns[conn_id].service_head ) 
 	{
@@ -205,5 +205,5 @@
 		{
 			service_id = vtohl(packet->services[0].service_id);
-			if(service_id & 0x80000000)
+			if((unsigned)service_id & 0x80000000)
 				rem_only = 1;
 		}
@@ -233,7 +233,7 @@
 		Dns_conns[conn_id].protocol = vtohl(packet->protocol);
 		strncpy( Dns_conns[conn_id].node_name, packet->node_name,
-			MAX_NODE_NAME ); 
+			(size_t)MAX_NODE_NAME ); 
 		strncpy( Dns_conns[conn_id].task_name, packet->task_name,
-			MAX_TASK_NAME-4 );
+			(size_t)(MAX_TASK_NAME-4) );
 		strcpy(Dns_conns[conn_id].long_task_name, packet->task_name);
 		Dns_conns[conn_id].task_name[MAX_TASK_NAME-4-1] = '\0';
@@ -277,5 +277,5 @@
 				{
 					ptr1 = ptr;
-					ptr1 += strlen(ptr);
+					ptr1 += (int)strlen(ptr);
 				}
 				if(strstr(Dns_conns[conn_id].node_name,ptr))
@@ -339,5 +339,5 @@
 	}
 	n_services = vtohl(packet->n_services);
-	if(strlen(Dns_conns[conn_id].task_name) == MAX_TASK_NAME-4-1)
+	if((int)strlen(Dns_conns[conn_id].task_name) == MAX_TASK_NAME-4-1)
 		name_too_long = 1;
 	for( i = 0; i < n_services; i++ ) 
@@ -452,5 +452,5 @@
 					/*there are interested clients waiting*/
 					strncpy( servp->serv_def,
-						packet->services[i].service_def,MAX_NAME );
+						packet->services[i].service_def,(size_t)MAX_NAME );
 					servp->conn_id = conn_id;
 					servp->state = 1;
@@ -475,5 +475,5 @@
 					/* test if Service is to be removed */
 					service_id = vtohl(packet->services[i].service_id);
-					if(service_id & 0x80000000)
+					if((unsigned)service_id & 0x80000000)
 					{
 						dll_remove((DLL *) servp);
@@ -525,5 +525,5 @@
 				{
 					strncpy(Dns_conns[conn_id].long_task_name, packet->services[i].service_name,
-						MAX_NAME);
+						(size_t)MAX_NAME);
 					ptrt = strstr(Dns_conns[conn_id].long_task_name,"/CLIENT_LIST");
 					*ptrt = '\0';
@@ -532,8 +532,8 @@
 			strncpy( servp->serv_name,
 				packet->services[i].service_name,
-				MAX_NAME );
+				(size_t)MAX_NAME );
 			strncpy( servp->serv_def,
 				packet->services[i].service_def,
-				MAX_NAME );
+				(size_t)MAX_NAME );
 			servp->state = 1;
 			servp->conn_id = conn_id;
@@ -628,5 +628,5 @@
 */
 	}
-	time_diff = time(NULL) - Dns_conns[conn_id].validity;
+	time_diff = (int)time(NULL) - Dns_conns[conn_id].validity;
 	if(time_diff > (int)(WATCHDOG_TMOUT_MAX*1.2))
 	{
@@ -700,5 +700,5 @@
 			{
 				ptr1 = ptr;
-				ptr1 += strlen(ptr);
+				ptr1 += (int)strlen(ptr);
 			}
 			if(strstr(Net_conns[conn_id].node,ptr))
@@ -777,5 +777,5 @@
 		return(0);
 	}
-	if( service_id & 0x80000000 )  /* remove service */
+	if( (unsigned)service_id & 0x80000000 )  /* remove service */
 	{
 		service_id &= 0x7fffffff;
@@ -843,5 +843,5 @@
 		}
 		servp = (DNS_SERVICE *) malloc(sizeof(DNS_SERVICE));
-		strncpy( servp->serv_name, serv_regp->service_name, MAX_NAME );
+		strncpy( servp->serv_name, serv_regp->service_name, (size_t)MAX_NAME );
 		servp->serv_def[0] = '\0';
 		servp->state = 0;
@@ -1254,9 +1254,9 @@
 	if(n_services == -1)
 		n_services = 0;
-	max_size = sizeof(DNS_SERVER_INFO) + 
-				n_services * sizeof(DNS_SERVICE_INFO);
+	max_size = (int)sizeof(DNS_SERVER_INFO) + 
+				n_services * (int)sizeof(DNS_SERVICE_INFO);
 	if(!curr_allocated_size)
 	{
-		dns_info_buffer = (DNS_DID *)malloc(max_size);
+		dns_info_buffer = (DNS_DID *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 	}
@@ -1264,11 +1264,11 @@
 	{
 		free(dns_info_buffer);
-		dns_info_buffer = (DNS_DID *)malloc(max_size);
+		dns_info_buffer = (DNS_DID *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 	}
 	dns_server_info = &dns_info_buffer->server;
 	dns_service_info = dns_info_buffer->services;
-	strncpy(dns_server_info->task, connp->task_name, MAX_TASK_NAME-4);
-	strncpy(dns_server_info->node, connp->node_name, MAX_NODE_NAME);
+	strncpy(dns_server_info->task, connp->task_name, (size_t)(MAX_TASK_NAME-4));
+	strncpy(dns_server_info->node, connp->node_name, (size_t)MAX_NODE_NAME);
 	dns_server_info->pid = htovl(connp->pid);
 	dns_server_info->n_services = htovl(connp->n_services);
@@ -1277,5 +1277,5 @@
 						    (DLL *) servp)) )
 	{
-		strncpy(dns_service_info->name, servp->serv_name, MAX_NAME); 
+		strncpy(dns_service_info->name, servp->serv_name, (size_t)MAX_NAME); 
 		dns_service_info->status = htovl(1);
 		if(servp->serv_id & 0x10000000)
@@ -1314,19 +1314,19 @@
 		}
 	}
-	max_size = (sizeof(DNS_SERVER_INFO) + MAX_TASK_NAME) * n_server;
-	max_pid_size = sizeof(int) * n_server;
+	max_size = ((int)sizeof(DNS_SERVER_INFO) + MAX_TASK_NAME) * n_server;
+	max_pid_size = (int)sizeof(int) * n_server;
 	if(!curr_allocated_size)
 	{
-		info_buffer = (char *)malloc(max_size);
+		info_buffer = (char *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
-		pid_buffer = (int *)malloc(max_pid_size);
+		pid_buffer = (int *)malloc((size_t)max_pid_size);
 	}
 	else if (max_size > curr_allocated_size)
 	{
 		free(info_buffer);
-		info_buffer = (char *)malloc(max_size);
+		info_buffer = (char *)malloc((size_t)max_size);
 		curr_allocated_size = max_size;
 		free(pid_buffer);
-		pid_buffer = (int *)malloc(max_pid_size);
+		pid_buffer = (int *)malloc((size_t)max_pid_size);
 	}
 	info_buffer[0] = '\0';
@@ -1342,5 +1342,5 @@
 				connp = &Dns_conns[i];
 /*
-				if(strlen(connp->task_name) == MAX_TASK_NAME-4-1)
+				if((int)strlen(connp->task_name) == MAX_TASK_NAME-4-1)
 				{
 					strcpy(aux,connp->task_name);
@@ -1373,5 +1373,5 @@
 				strcat(server,"|");
 				strcpy(info_buffer_ptr, server);
-				info_buffer_ptr += strlen(server);
+				info_buffer_ptr += (int)strlen(server);
 				pid_buffer[pid_index] = connp->pid;
 				pid_index++;
@@ -1395,6 +1395,6 @@
 		pid_index++;
 	}
-	info_buffer[strlen(info_buffer) - 1] = '\0';
-	info_buffer_ptr = &info_buffer[strlen(info_buffer)+1];
+	info_buffer[(int)strlen(info_buffer) - 1] = '\0';
+	info_buffer_ptr = &info_buffer[(int)strlen(info_buffer)+1];
 	pid_size = 0;
 	for(i = 0; i < pid_index; i++)
@@ -1405,9 +1405,9 @@
 			sprintf(server, "%d",pid_buffer[i]);
 		strcpy(info_buffer_ptr, server);
-		info_buffer_ptr += strlen(server);
-		pid_size += strlen(server);
+		info_buffer_ptr += (int)strlen(server);
+		pid_size += (int)strlen(server);
 	}
 	*bufp = (int *)info_buffer;
-	*size = strlen(info_buffer)+1+pid_size+1;
+	*size = (int)strlen(info_buffer)+1+pid_size+1;
 	ENABLE_AST
 }
@@ -1444,7 +1444,7 @@
 	fflush(stdout);
 
-	Server_new_info_id = dis_add_service( "DIS_DNS/SERVER_LIST", "C", 0, 0, 
+	Server_new_info_id =(int) dis_add_service( "DIS_DNS/SERVER_LIST", "C", 0, 0, 
 						get_new_dns_server_info, 0 );
-	Server_info_id = dis_add_service( "DIS_DNS/SERVER_INFO", 0, 0, 0, 
+	Server_info_id = (int)dis_add_service( "DIS_DNS/SERVER_INFO", 0, 0, 0, 
 						get_dns_server_info, 0 );
 	dis_add_cmnd( "DIS_DNS/PRINT_STATS", 0, print_stats, 0 );
@@ -1454,5 +1454,5 @@
 	dis_add_cmnd( "DIS_DNS/PRINT_HASH_TABLE", 0, print_hash_table, 0 );
 	dis_add_cmnd( "DIS_DNS/SERVICE_INFO/RpcIn", "C", set_rpc_info, 0 );
-	Rpc_id = dis_add_service( "DIS_DNS/SERVICE_INFO/RpcOut", "C", 0, 0, 
+	Rpc_id = (int)dis_add_service( "DIS_DNS/SERVICE_INFO/RpcOut", "C", 0, 0, 
 						get_rpc_info, 0 );
 	dns_port = get_dns_port_number();
@@ -1586,5 +1586,5 @@
 			{
 				type = DNS_DIS_SOFT_EXIT;
-				type |= (soft_code << 16) & 0xFFFF0000;
+				type |= (soft_code << (int)16) & (int)0xFFFF0000;
 				dim_print_date_time();
 				printf(" Killing server %s@%s with exit code %d\n",
@@ -1649,5 +1649,5 @@
 	if( (servp = (RED_DNS_SERVICE *) dll_search(
 					(DLL *) Service_hash_table[index],
-			      		name, strlen(name)+1)) )
+			      		name, (int)strlen(name)+1)) )
 	{
 		ptr = (char *)servp - (2 * sizeof(void *));
@@ -1719,5 +1719,5 @@
 
 	Service_info_list = (DNS_SERVICE **)
-		malloc(Curr_n_services*sizeof(DNS_SERVICE *));
+		malloc((size_t)(Curr_n_services*(int)sizeof(DNS_SERVICE *)));
 
 	if(!strchr(wild_name, '*'))
@@ -1768,5 +1768,5 @@
 							break;
 						}
-						dptr1 += strlen(tmp);
+						dptr1 += (int)strlen(tmp);
 						ptr = ptr1;
 						dptr = dptr1;
@@ -1784,5 +1784,5 @@
 					if(!strncmp(dptr, tmp, strlen(tmp)))
 					{
-						dptr += strlen(tmp);
+						dptr += (int)strlen(tmp);
 						ptr = ptr1;
 					}
@@ -1839,5 +1839,5 @@
 	if(!Rpc_info_size)
 	{
-		Rpc_info = malloc(MAX_NAME*(n+1)*2);
+		Rpc_info = malloc((size_t)(MAX_NAME*(n+1)*2));
 		Rpc_info_size = MAX_NAME*(n+1)*2;
 	}
@@ -1845,5 +1845,5 @@
 	{
 		free(Rpc_info);
-		Rpc_info = malloc(MAX_NAME*(n+1)*2);
+		Rpc_info = malloc((size_t)(MAX_NAME*(n+1)*2));
 		Rpc_info_size = MAX_NAME*(n+1)*2;
 	}
@@ -1863,5 +1863,5 @@
 				if( (ptr = strstr(Rpc_info, aux)) )
 				{
-					ptr += strlen(aux);
+					ptr += (int)strlen(aux);
 					if(*ptr == '|')
 						rpc = 2;
@@ -1874,5 +1874,5 @@
 				if( (ptr = strstr(Rpc_info, aux)) )
 				{
-					ptr += strlen(aux);
+					ptr += (int)strlen(aux);
 					if(*ptr == '|')
 						rpc = 2;
@@ -1896,5 +1896,5 @@
 						strcat(rpcaux,"|RPC\n");
 						strcpy(rpcptr, rpcaux);
-						rpcptr += strlen(rpcaux);
+						rpcptr += (int)strlen(rpcaux);
 					}
 				}
@@ -1911,5 +1911,5 @@
 				strcat(rpcaux,"|\n");
 			strcpy(rpcptr, rpcaux);
-			rpcptr += strlen(rpcaux);
+			rpcptr += (int)strlen(rpcaux);
 		}
 	}
@@ -1926,5 +1926,5 @@
 	if(tag){}
 	*buffer = Rpc_info;
-	*size = strlen(Rpc_info)+1;
-}
-
+	*size = (int)strlen(Rpc_info)+1;
+}
+
Index: trunk/FACT++/dim/src/dtq.c
===================================================================
--- trunk/FACT++/dim/src/dtq.c	(revision 14939)
+++ trunk/FACT++/dim/src/dtq.c	(revision 15282)
@@ -10,4 +10,11 @@
 
 /* include files */
+#ifndef WIN32
+#ifndef NOTHREADS
+int DIM_Threads_OFF = 0;
+#else
+int DIM_Threads_OFF = 1;
+#endif
+#endif
 #include <signal.h>
 #include <stdio.h>
@@ -76,4 +83,5 @@
 	extern void dis_no_threads();
 	
+	DIM_Threads_OFF = 1;
 	Threads_off = 1;
 	dic_no_threads();
@@ -231,6 +239,6 @@
 	tz = 0;
 	gettimeofday(&tv, tz);
-	secs = tv.tv_sec;
-	*millies = tv.tv_usec / 1000;
+	secs = (int)tv.tv_sec;
+	*millies = (int)tv.tv_usec / 1000;
 #endif
 	return secs;
@@ -266,5 +274,5 @@
 		else
 		{
-			return(alarm(secs));
+			return((int)alarm((unsigned int)secs));
 		}
 	}
Index: trunk/FACT++/dim/src/examples/demo_client.c
===================================================================
--- trunk/FACT++/dim/src/examples/demo_client.c	(revision 14939)
+++ trunk/FACT++/dim/src/examples/demo_client.c	(revision 15282)
@@ -30,5 +30,5 @@
 		scanf("%s",cmnd);
 		printf("Sending Command: %s\n",cmnd);
-		dic_cmnd_service(aux,cmnd,strlen(cmnd)+1);
+		dic_cmnd_service(aux,cmnd,(int)strlen(cmnd)+1);
 	}
 }
Index: trunk/FACT++/dim/src/examples/pvss_dim_server.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/pvss_dim_server.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/examples/pvss_dim_server.cxx	(revision 15282)
@@ -227,5 +227,5 @@
 //		simpleService.updateService();
 
-		if(strlen(cData.str) < 16)
+		if((int)strlen(cData.str) < 16)
 			strcat(cData.str," abc");
 		cTestService.updateService();
Index: trunk/FACT++/dim/src/examples/rpc_server.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/rpc_server.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/examples/rpc_server.cxx	(revision 15282)
@@ -72,5 +72,5 @@
 		pout.c1 = pin->c1;
 		strcpy(pout.str,pin->str);
-		setData(&pout, strlen(pout.str)+1+5);
+		setData(&pout, (int)strlen(pout.str)+1+5);
 	}
 public:
Index: trunk/FACT++/dim/src/examples/test_client.c
===================================================================
--- trunk/FACT++/dim/src/examples/test_client.c	(revision 14939)
+++ trunk/FACT++/dim/src/examples/test_client.c	(revision 15282)
@@ -83,5 +83,5 @@
 		printf("DNS node = %s\n",node);
 		printf("size = %d\n",*size);
-		memcpy(&t, buf, *size);
+		memcpy(&t, buf, (size_t)*size);
 		printf("t.i = %d, t.d = %2.2f, t.s = %d, t.c = %c, t.f = %2.2f, t.str = %s\n",
 			t.i,t.d,t.s,t.c,t.f,t.str);
@@ -89,5 +89,5 @@
 		tsecs = secs;
 		my_ctime(&tsecs, str, 128);
-		str[strlen(str)-1] = '\0';
+		str[(int)strlen(str)-1] = '\0';
 		printf("timestamp = %s.%d\n",str,millis);
 
Index: trunk/FACT++/dim/src/examples/test_server.c
===================================================================
--- trunk/FACT++/dim/src/examples/test_server.c	(revision 14939)
+++ trunk/FACT++/dim/src/examples/test_server.c	(revision 15282)
@@ -110,5 +110,5 @@
 	{
 		sprintf(str[i],"%s/Service_%03d",argv[1],i);
-		dis_add_service( str[i], "C", str[i], strlen(str[i])+1, 
+		dis_add_service( str[i], "C", str[i], (int)strlen(str[i])+1, 
 			(void *)0, 0 );
 	}
@@ -195,5 +195,5 @@
 				sprintf(more_str[curr_more_index],"%s/More_Service_%03d",argv[1],curr_more_index);
 				more_ids[curr_more_index] = dis_add_service( more_str[curr_more_index], "C", 
-					more_str[curr_more_index], strlen(more_str[curr_more_index])+1, 
+					more_str[curr_more_index], (int)strlen(more_str[curr_more_index])+1, 
 					(void *)0, 0 );
 printf("Adding service %s\n",more_str[curr_more_index]);
Index: trunk/FACT++/dim/src/examples/test_server.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/test_server.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/examples/test_server.cxx	(revision 15282)
@@ -168,5 +168,5 @@
 	if(testServ){}
 
-//	farr[0] = 1.2;
+	//	farr[0] = 1.2;
 //	farr[1] = 2.3;
 //	farrp = new DimService("/PCITCO147/sensors/fan/input","F", farr, sizeof(farr));
@@ -208,6 +208,6 @@
 		bool_serv[1]->updateService();
 		
-		int inCallback = DimServer::inCallback();
-		cout << "main: In callback "<< inCallback << endl; 
+//		int inCallback = DimServer::inCallback();
+//		cout << "main: In callback "<< inCallback << endl; 
 		servint.updateService();
 		if(extraDns)
Index: trunk/FACT++/dim/src/hash.c
===================================================================
--- trunk/FACT++/dim/src/hash.c	(revision 14939)
+++ trunk/FACT++/dim/src/hash.c	(revision 15282)
@@ -28,12 +28,12 @@
    int len;
 
-   len = strlen(name);
+   len = (int)strlen(name);
 
    for(i = 0; i < len; name++, i++)
    {
-      hash = hash*a+(*name);
+      hash = hash*a+(unsigned)(*name);
       a = a*b;
    }
 
-   return (hash % max);
+   return ((int)(hash % (unsigned)max));
 }
Index: trunk/FACT++/dim/src/open_dns.c
===================================================================
--- trunk/FACT++/dim/src/open_dns.c	(revision 14939)
+++ trunk/FACT++/dim/src/open_dns.c	(revision 15282)
@@ -156,5 +156,5 @@
 	get_proc_name(pid_str);
 	sscanf(pid_str,"%d",&pid);
-	srand(ip+pid);
+	srand((unsigned)(ip+pid));
 }
 
@@ -345,5 +345,5 @@
 			strcpy(node_info,dns_node);
 			for(i = 0; i < 4; i ++)
-				node_info[strlen(node_info)+i+1] = (char)0xff;
+				node_info[(int)strlen(node_info)+i+1] = (char)0xff;
 			connp->conn_id = 0;
 			connp->connecting = 1;
@@ -359,5 +359,5 @@
 		if(!conn_id)
 		{
-			strncpy(connp->task_name, DNS_TASK, MAX_TASK_NAME); 
+			strncpy(connp->task_name, DNS_TASK, (size_t)MAX_TASK_NAME); 
 			connp->recv_rout = recv_rout;
 			connp->error_rout = error_rout;
@@ -402,5 +402,5 @@
 			strcpy(node_info,dns_node);
 			for(i = 0; i < 4; i ++)
-				node_info[strlen(node_info)+i+1] = (char)0xff;
+				node_info[(int)strlen(node_info)+i+1] = (char)0xff;
 			connp->conn_id = 0;
 			connp->connecting = 1;
Index: trunk/FACT++/dim/src/sll.c
===================================================================
--- trunk/FACT++/dim/src/sll.c	(revision 14939)
+++ trunk/FACT++/dim/src/sll.c	(revision 15282)
@@ -38,5 +38,5 @@
 	while( (head = head->next) )
 	{
-		if( !memcmp(head->user_info, data, size) )
+		if( !memcmp(head->user_info, data, (size_t)size) )
 		{
 			break;
@@ -123,5 +123,5 @@
 	while( (auxp = item->next) )
 	{
-		if( !memcmp(&(auxp->user_info[offset]), data, size) )
+		if( !memcmp(&(auxp->user_info[offset]), data, (size_t)size) )
 		{
 			item->next = auxp->next;
Index: trunk/FACT++/dim/src/tcpip.c
===================================================================
--- trunk/FACT++/dim/src/tcpip.c	(revision 14939)
+++ trunk/FACT++/dim/src/tcpip.c	(revision 15282)
@@ -290,5 +290,5 @@
 		if(DIM_IO_path[0] == -1)
 		{
-			if( (DIM_IO_path[0] = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
+			if( (DIM_IO_path[0] = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
 			{
 				perror("socket");
@@ -369,5 +369,5 @@
 		closesock(DIM_IO_path[0]);
 		DIM_IO_path[0] = -1;
-		if( (DIM_IO_path[0] = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
+		if( (DIM_IO_path[0] = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
 		{
 			perror("socket");
@@ -568,5 +568,5 @@
 static int get_bytes_to_read(int conn_id)
 {
-	int i, ret, count;
+	int i, ret, count = 0;
 	
 	for(i = 0; i < 3; i++)
@@ -616,7 +616,7 @@
 		would this be better? not sure afterwards...
 		nbytes = (size < count) ? size : count;
-		if( (len = readsock(Net_conns[conn_id].channel, p, nbytes, 0)) <= 0 ) 
-*/
-		if( (len = readsock(Net_conns[conn_id].channel, p, size, 0)) <= 0 ) 
+		if( (len = readsock(Net_conns[conn_id].channel, p, (size_t)nbytes, 0)) <= 0 ) 
+*/
+		if( (len = (int)readsock(Net_conns[conn_id].channel, p, (size_t)size, 0)) <= 0 ) 
 		{	/* Connection closed by other side. */
 			Net_conns[conn_id].read_rout( conn_id, -1, 0 );
@@ -654,6 +654,6 @@
 
 	othersize = sizeof(other);
-	memset( (char *) &other, 0, othersize );
-	Net_conns[conn_id].mbx_channel = accept( Net_conns[conn_id].channel,
+	memset( (char *) &other, 0, (size_t)othersize );
+	Net_conns[conn_id].mbx_channel = (int)accept( Net_conns[conn_id].channel,
 						 (struct sockaddr*)&other, (unsigned int *)&othersize );
 	if( Net_conns[conn_id].mbx_channel < 0 ) 
@@ -842,5 +842,5 @@
 int ret;
 
-	ptr = (unsigned char *)node+strlen(node)+1;
+	ptr = (unsigned char *)node+(int)strlen(node)+1;
     ipaddr[0] = *ptr++;
     ipaddr[1] = *ptr++;
@@ -900,8 +900,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;
 	    host_number = 1;
 #ifndef VxWorks
@@ -928,5 +928,5 @@
 		host_number = 1;
 /*
-          ptr = (unsigned char *)node+strlen(node)+1;
+          ptr = (unsigned char *)node+(int)strlen(node)+1;
           ipaddr[0] = *ptr++;
           ipaddr[1] = *ptr++;
@@ -961,5 +961,5 @@
 #endif
 
-	if( (path = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
+	if( (path = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
 	{
 		perror("socket");
@@ -1053,5 +1053,5 @@
 
     dim_tcpip_init(0);
-	if( (path = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
+	if( (path = (int)socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
 	{
 		return(0);
@@ -1257,5 +1257,5 @@
 	int	wrote;
 
-	wrote = writesock( Net_conns[conn_id].channel, buffer, size, 0 );
+	wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 );
 	if( wrote == -1 ) {
 /*
@@ -1306,5 +1306,5 @@
 	
 	set_non_blocking(Net_conns[conn_id].channel);
-	wrote = writesock( Net_conns[conn_id].channel, buffer, size, 0 );
+	wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 );
 #ifndef WIN32
 	ret = errno;
@@ -1332,5 +1332,5 @@
 			if(selret > 0)
 			{
-				wrote = writesock( Net_conns[conn_id].channel, buffer, size, 0 );
+				wrote = (int)writesock( Net_conns[conn_id].channel, buffer, (size_t)size, 0 );
 				if( wrote == -1 ) 
 				{
Index: trunk/FACT++/dim/src/tokenstring.cxx
===================================================================
--- trunk/FACT++/dim/src/tokenstring.cxx	(revision 14939)
+++ trunk/FACT++/dim/src/tokenstring.cxx	(revision 15282)
@@ -4,5 +4,5 @@
 TokenString::TokenString(char *str)
 {
-	token_buff = new char[(strlen(str)+1)*2];
+	token_buff = new char[((int)strlen(str)+1)*2];
 	token_ptr = token_buff;
 	token_seps = 0;
@@ -14,7 +14,7 @@
 TokenString::TokenString(char *str, char *seps)
 {
-	token_buff = new char[(strlen(str)+1)*2];
-	token_ptr = token_buff;
-	token_seps = new char[(strlen(seps)+1)];
+	token_buff = new char[((int)strlen(str)+1)*2];
+	token_ptr = token_buff;
+	token_seps = new char[((int)strlen(seps)+1)];
 	strcpy(token_seps,seps);
 	store_str(str);
@@ -154,5 +154,5 @@
 
 	curr_token_ptr = token_ptr;
-    token_ptr += strlen(curr_token_ptr)+1;
+    token_ptr += (int)strlen(curr_token_ptr)+1;
 	token = curr_token_ptr;
 
Index: trunk/FACT++/dim/src/util/dim_send_command.c
===================================================================
--- trunk/FACT++/dim/src/util/dim_send_command.c	(revision 14939)
+++ trunk/FACT++/dim/src/util/dim_send_command.c	(revision 15282)
@@ -61,5 +61,5 @@
 		}
 	}
-	dic_cmnd_callback(str,data,strlen(data)+1, rout, silent);
+	dic_cmnd_callback(str,data,(int)strlen(data)+1, rout, silent);
 	while(!received)
 	  dim_wait();
@@ -135,5 +135,5 @@
 	else
 	{
-		dic_cmnd_callback(str,data,strlen(data)+1, rout, silent);
+		dic_cmnd_callback(str,data,(int)strlen(data)+1, rout, silent);
 	}
 	while(!received)
Index: trunk/FACT++/dim/src/utilities.c
===================================================================
--- trunk/FACT++/dim/src/utilities.c	(revision 14939)
+++ trunk/FACT++/dim/src/utilities.c	(revision 15282)
@@ -102,5 +102,5 @@
 #endif
 char node_name[MAX_NODE_NAME];
-unsigned char *ptr;
+char *ptr;
 
 #ifdef WIN32
@@ -117,5 +117,5 @@
 		return(0);
 	}
-    ptr = (unsigned char *)host->h_addr;
+    ptr = (char *)host->h_addr;
     node_addr[0] = *ptr++;
     node_addr[1] = *ptr++;
@@ -150,5 +150,5 @@
 */
 	my_ctime(&t, str, 128);
-	str[strlen(str)-1] = '\0';
+	str[(int)strlen(str)-1] = '\0';
 	printf("PID %d - ",getpid());
 	printf("%s - ",str );
@@ -172,5 +172,5 @@
 	tz = 0;
 	gettimeofday(&tv, tz);
-	millies = tv.tv_usec / 1000;
+	millies = (int)tv.tv_usec / 1000;
 #endif
 	dim_print_date_time();
@@ -233,5 +233,5 @@
 		return(0);
 	else {
-		tot = strlen(p)+1;
+		tot = (int)strlen(p)+1;
 		if(value != 0)
 		{
@@ -239,5 +239,5 @@
 			if(sz > len)
 				sz = len;
-			strncpy(value, p, sz);
+			strncpy(value, p, (size_t)sz);
 			if((sz == len) && (len > 0))
 				value[sz-1] = '\0';
Index: trunk/FACT++/dim/src/webDid/webDid.c
===================================================================
--- trunk/FACT++/dim/src/webDid/webDid.c	(revision 14939)
+++ 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 14939)
+++ 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 14939)
+++ 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 )
 		{
