Index: cpp/frams/param/param.cpp
===================================================================
--- cpp/frams/param/param.cpp	(revision 230)
+++ cpp/frams/param/param.cpp	(revision 247)
@@ -37,5 +37,5 @@
 static const char *strchrlimit(const char *t, int ch, const char *limit)
 {
-	int n = limit - t;
+	int n = (int)(limit - t);
 	for (; (n > 0) && *t; t++, n--)
 		if (*t == ch) return t;
@@ -72,9 +72,9 @@
 }
 
-int ParamInterface::getMinMax(int prop, long& minumum, long& maximum, long &def)
+int ParamInterface::getMinMax(int prop, paInt& minumum, paInt& maximum, paInt &def)
 {
 	const char* t = type(prop) + 1;
 	while (*t) if (*t == ' ') break; else t++;
-	return sscanf(t, "%ld %ld %ld", &minumum, &maximum, &def);
+	return sscanf(t, PA_INT_SCANF " " PA_INT_SCANF " " PA_INT_SCANF, &minumum, &maximum, &def);
 }
 
@@ -121,5 +121,5 @@
 	case 'd':
 	{
-		long a = 0, b = 0, c = 0;
+		paInt a = 0, b = 0, c = 0;
 		if (getMinMax(i, a, b, c) < 3) c = a;
 		setInt(i, c);
@@ -144,5 +144,5 @@
 	case 'd':
 	{
-		long a = 0, b = 0, c = 0;
+		paInt a = 0, b = 0, c = 0;
 		getMinMax(i, a, b, c);
 		setInt(i, a);
@@ -167,5 +167,5 @@
 	case 'd':
 	{
-		long a = 0, b = 0, c = 0;
+		paInt a = 0, b = 0, c = 0;
 		getMinMax(i, a, b, c);
 		setInt(i, b);
@@ -178,5 +178,5 @@
 SString ParamInterface::getStringById(const char*prop)
 {int i=findId(prop); if (i>=0) return getString(i); else return SString();}
-long ParamInterface::getIntById(const char*prop)
+paInt ParamInterface::getIntById(const char*prop)
 {int i=findId(prop); if (i>=0) return getInt(i); else return 0;}
 double ParamInterface::getDoubleById(const char*prop)
@@ -187,5 +187,5 @@
 {int i=findId(prop); if (i>=0) return getExtValue(i); else return ExtValue();}
 
-int ParamInterface::setIntById(const char* prop,long v)
+int ParamInterface::setIntById(const char* prop,paInt v)
 {int i=findId(prop); if (i>=0) return setInt(i,v); else return PSET_NOPROPERTY;}
 int ParamInterface::setDoubleById(const char* prop,double v)
@@ -260,5 +260,5 @@
 	{
 		select(defdata);
-		long x = getInt(i);
+		paInt x = getInt(i);
 		select(backup);
 		return x == getInt(i);
@@ -347,5 +347,5 @@
 		if (!*p0) break;
 		p = strchr(p0, ':'); if (!p) continue;
-		p_len = p - p0;
+		p_len = (int)(p - p0);
 		loaded = false;
 		if (p_len && ((i = findIdn(p0, p_len)) >= 0) && (!(flags(i)&PARAM_DONTLOAD)))
@@ -442,9 +442,9 @@
 	if (!stringIsNumeric(str))
 	{
-		long a, b, c;
+		paInt a, b, c;
 		if (getMinMax(i, a, b, c) >= 3)
 			return setInt(i, c);
 		else
-			return setInt(i, (long)0);
+			return setInt(i, (paInt)0);
 	}
 	else
@@ -536,5 +536,5 @@
 			const char *t2 = strchr(t, '~');
 			if (!t2) t2 = t + strlen(t);
-			return SString(t, t2 - t);
+			return SString(t, (int)(t2 - t));
 		}
 	}
@@ -599,5 +599,5 @@
 #endif
 
-long SimpleAbstractParam::getInt(int i)
+paInt SimpleAbstractParam::getInt(int i)
 {
 	SANITY_CHECK(i);
@@ -612,5 +612,5 @@
 	{
 		void *target = getTarget(i);
-		return *((long*)target);
+		return *((paInt*)target);
 	}
 }
@@ -687,5 +687,5 @@
 //////// set
 
-int SimpleAbstractParam::setInt(int i, long x)
+int SimpleAbstractParam::setInt(int i, paInt x)
 {
 	SANITY_CHECK(i);
@@ -693,10 +693,10 @@
 	ParamEntry *pe = entry(i);
 	if (pe->flags&PARAM_READONLY) return PSET_RONLY;
-	long xcopy = x; //only needed for messageOnExceedRange(): retain original, requested value of x because it may be changed below
-	long a = 0, b = 0;
+	paInt xcopy = x; //only needed for messageOnExceedRange(): retain original, requested value of x because it may be changed below
+	paInt a = 0, b = 0;
 	int result = 0;
 	const char* t = pe->type + 1;
 	while (*t) if (*t == ' ') break; else t++;
-	if (sscanf(t, "%ld %ld", &a, &b) == 2)
+	if (sscanf(t, PA_INT_SCANF " " PA_INT_SCANF, &a, &b) == 2)
 		if (a <= b) // if max<min then the min/max constraint check is not supported
 		{
@@ -713,8 +713,8 @@
 	{
 		void *target = getTarget(i);
-		if (dontcheckchanges || (*((long*)target) != x))
+		if (dontcheckchanges || (*((paInt*)target) != x))
 		{
 			result |= PSET_CHANGED;
-			*((long*)target) = x;
+			*((paInt*)target) = x;
 		}
 	}
@@ -770,7 +770,7 @@
 	const char* t = pe->type + 1;
 	while (*t) if (*t == ' ') break; else t++;
-	long a = 0, b = 0;
+	paInt a = 0, b = 0;
 	int result = 0;
-	if (sscanf(t, "%ld %ld", &a, &b) == 2)
+	if (sscanf(t, PA_INT_SCANF " " PA_INT_SCANF, &a, &b) == 2)
 	{
 		if ((x.len() > b) && (b > 0))
@@ -883,7 +883,7 @@
 	const char *lf = strchr(beg, '\n');
 	if (!lf) { lf = (const char*)s + s.len() - 1; poz = s.len(); }
-	else { poz = (lf - (const char*)s) + 1; if (poz > s.len()) poz = s.len(); }
+	else { poz = (int)(lf - (const char*)s) + 1; if (poz > s.len()) poz = s.len(); }
 	while (lf >= beg) if ((*lf == '\n') || (*lf == '\r')) lf--; else break;
-	len = lf - beg + 1;
+	len = (int)(lf - beg) + 1;
 	return beg;
 }
@@ -939,5 +939,5 @@
 		if (equals_sign) // have parameter name
 		{
-			tmpi = findIdn(t, equals_sign - t);
+			tmpi = findIdn(t, (int)(equals_sign - t));
 			i = tmpi;
 			if (tmpi < 0)
@@ -960,5 +960,5 @@
 			if (quote)
 			{
-				tmpvalue.copyFrom(quote + 1, quote2 - quote - 1);
+				tmpvalue.copyFrom(quote + 1, (int)(quote2 - quote) - 1);
 				sstringUnquote(tmpvalue);
 				value = tmpvalue;
