Index: cpp/frams/param/mutableparam.cpp
===================================================================
--- cpp/frams/param/mutableparam.cpp	(revision 240)
+++ cpp/frams/param/mutableparam.cpp	(revision 247)
@@ -108,5 +108,5 @@
 	switch(pe->type[0])
 		{
-		case 'd': d=new int(); *((int*)d)=0; break;
+		case 'd': d=new paInt(); *((paInt*)d)=0; break;
 		case 'f': d=new double(); *((double*)d)=0; break;
 		case 's': d=new SString(); break;
@@ -114,5 +114,5 @@
 		case 'o': d=new ExtObject(); break;
 		}
-	pe->offset=(int)d;
+	pe->offset=(intptr_t)d;
 	}
 onadd.action(position);
@@ -134,5 +134,5 @@
 	switch(pe->type[0])
 		{
-		case 'd': delete (int*)d; break;
+		case 'd': delete (paInt*)d; break;
 		case 'f': delete (double*)d; break;
 		case 's': delete (SString*)d; break;
@@ -173,5 +173,5 @@
 pe->group=(short)group;
 pe->flags=(short)(flags | MUTPARAM_ALLOCENTRY);
-pe->offset=(long)data;
+pe->offset=(intptr_t)data;
 pe->id=strdup(id);
 pe->type=strdup(type);
@@ -209,5 +209,5 @@
 }
 
-int MutableParam::setInt(int i,long v)
+int MutableParam::setInt(int i,paInt v)
 {
 int ret=SimpleAbstractParam::setInt(i,v);
Index: cpp/frams/param/mutableparam.h
===================================================================
--- cpp/frams/param/mutableparam.h	(revision 240)
+++ cpp/frams/param/mutableparam.h	(revision 247)
@@ -23,5 +23,5 @@
 SList entries;
 SList groups;
-long changed;
+int changed;
 ParamEntry *entry(int i) {return (i<staticprops)? pe_tab+i : ((ParamEntry*)entries(i-staticprops));}
 void *getTarget(int i) {return (i<staticprops)? SimpleAbstractParam::getTarget(i) : (void*)entry(i)->offset;}
@@ -54,5 +54,5 @@
 void notify(int id);
 
-int setInt(int,long);
+int setInt(int,paInt);
 int setDouble(int,double);
 int setString(int,const SString &);
Index: cpp/frams/param/mutparamlist.cpp
===================================================================
--- cpp/frams/param/mutparamlist.cpp	(revision 240)
+++ cpp/frams/param/mutparamlist.cpp	(revision 247)
@@ -126,5 +126,5 @@
 }
 
-void MutableParamList::onPropAdd(void* data,long i)
+void MutableParamList::onPropAdd(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -136,5 +136,5 @@
 }
 
-void MutableParamList::onPropDelete(void* data,long i)
+void MutableParamList::onPropDelete(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -146,5 +146,5 @@
 }
 
-void MutableParamList::onPropChange(void* data,long i)
+void MutableParamList::onPropChange(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -152,5 +152,5 @@
 }
 
-void MutableParamList::onPropActivate(void* data,long i)
+void MutableParamList::onPropActivate(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -158,5 +158,5 @@
 }
 
-void MutableParamList::onGroupAdd(void* data,long i)
+void MutableParamList::onGroupAdd(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -168,5 +168,5 @@
 }
 
-void MutableParamList::onGroupDelete(void* data,long i)
+void MutableParamList::onGroupDelete(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -178,5 +178,5 @@
 }
 
-void MutableParamList::onGroupChange(void* data,long i)
+void MutableParamList::onGroupChange(void* data,intptr_t i)
 {
 ParamInfo *pi=(ParamInfo*)data;
@@ -295,7 +295,7 @@
 FUN(int,flags,0)
 FUN(SString,getString,SString())
-FUN(long,getInt,0)
+FUN(paInt,getInt,0)
 FUN(double,getDouble,0)
-FUN(ExtValue,getExtValue,ExtValue((long)0))
+FUN(ExtValue,getExtValue,ExtValue((paInt)0))
 FUN(ExtObject,getObject,ExtObject())
 
@@ -322,5 +322,5 @@
 }
 
-FUN2(int,setInt,long)
+FUN2(int,setInt,paInt)
 FUN2(int,setDouble,double)
 FUN2(int,setString,const SString &)
Index: cpp/frams/param/mutparamlist.h
===================================================================
--- cpp/frams/param/mutparamlist.h	(revision 240)
+++ cpp/frams/param/mutparamlist.h	(revision 247)
@@ -75,10 +75,10 @@
 
 SString getString(int);
-long getInt(int);
+paInt getInt(int);
 double getDouble(int);
 ExtValue getExtValue(int);
 ExtObject getObject(int);
 
-int setInt(int,long);
+int setInt(int,paInt);
 int setDouble(int,double);
 int setString(int,const SString &);
Index: cpp/frams/param/param.cpp
===================================================================
--- cpp/frams/param/param.cpp	(revision 240)
+++ 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;
Index: cpp/frams/param/param.h
===================================================================
--- cpp/frams/param/param.h	(revision 240)
+++ cpp/frams/param/param.h	(revision 247)
@@ -7,4 +7,5 @@
 
 #include <stdio.h>
+#include <stdint.h>
 #include <frams/util/sstring.h>
 #include <frams/util/list.h>
@@ -33,4 +34,7 @@
 #define PARAM_DEPRECATED	8192
 
+typedef int32_t paInt;
+#define PA_INT_SCANF "%d"
+
 // the result of param::set() is a combination of bits:
 
@@ -92,5 +96,5 @@
 
 	virtual SString getString(int) = 0;	///< get string value, you can only use this for "s" type property
-	virtual long getInt(int) = 0;	///< get long value, you can only use this for "d" type property
+	virtual paInt getInt(int) = 0;	///< get long value, you can only use this for "d" type property
 	virtual double getDouble(int) = 0;	///< get double value, you can only use this for "f" type property
 	virtual ExtObject getObject(int) = 0;	///< get object reference, you can only use this for "o" type property
@@ -101,5 +105,5 @@
 
 	SString getStringById(const char*prop);  ///< get string value, you can only use this for "s" type property
-	long getIntById(const char* prop);    ///< get long value, you can only use this for "d" type property
+	paInt getIntById(const char* prop);    ///< get long value, you can only use this for "d" type property
 	double getDoubleById(const char* prop);///< get double value, you can only use this for "f" type property
 	ExtObject getObjectById(const char* prop);///< get object reference, you can only use this for "o" type property
@@ -109,5 +113,5 @@
 	int setInt(int i, const char* str);
 	int setDouble(int i, const char* str);
-	virtual int setInt(int, long) = 0;		///< set long value, you can only use this for "d" type prop
+	virtual int setInt(int, paInt) = 0;		///< set long value, you can only use this for "d" type prop
 	virtual int setDouble(int, double) = 0;	///< set double value, you can only use this for "f" type prop
 	virtual int setString(int, const SString &) = 0; 	///< set string value, you can only use this for "s" type prop
@@ -119,5 +123,5 @@
 	int set(int, const char*);		///< oldstyle set, can convert string to long or double
 
-	int setIntById(const char* prop, long);///< set long value, you can only use this for "d" type prop
+	int setIntById(const char* prop, paInt);///< set long value, you can only use this for "d" type prop
 	int setDoubleById(const char* prop, double);///< set double value, you can only use this for "f" type prop
 	int setStringById(const char* prop, const SString &);///< set string value, you can only use this for "s" type prop
@@ -128,5 +132,5 @@
 	/** get valid minimum, maximum and default value for property 'prop'
 		@return 0 if min/max/def information is not available */
-	int getMinMax(int prop, long& minumum, long& maximum, long& def);
+	int getMinMax(int prop, paInt& minumum, paInt& maximum, paInt& def);
 	/** get valid minimum, maximum and default value for property 'prop'
 		@return 0 if min/max/def information is not available */
@@ -172,8 +176,8 @@
 #define SETOFFSET(_proc_) ( (int (*)(void*,const ExtValue*)) &(FIELDSTRUCT :: _proc_ ## _statrick))
 
-#define FIELDOFFSET(_fld_) ((long)((char*)(&((FIELDSTRUCT*)&MakeCodeGuardHappy)->_fld_)-((char*)((FIELDSTRUCT*)&MakeCodeGuardHappy))))
+#define FIELDOFFSET(_fld_) ((intptr_t)((char*)(&((FIELDSTRUCT*)&MakeCodeGuardHappy)->_fld_)-((char*)((FIELDSTRUCT*)&MakeCodeGuardHappy))))
 
 #ifdef DEBUG
-#define PARAM_ILLEGAL_OFFSET ((long)0xdeadbeef)
+#define PARAM_ILLEGAL_OFFSET ((intptr_t)0xdeadbeef)
 #else
 #define PARAM_ILLEGAL_OFFSET 0
@@ -205,5 +209,5 @@
 	short group, flags;
 	const char *name, *type;
-	long offset;
+	intptr_t offset;
 	void *fun1; ///< procedure or get
 	void *fun2; ///< set
@@ -214,5 +218,5 @@
 {
 public:
-	ParamEntryConstructor(const char *_id, short _group = 0, short _flags = 0, const char *_name = 0, const char *_type = 0, long _offset = 0, void *_fun1 = 0, void *_fun2 = 0, const char *_help = 0)
+	ParamEntryConstructor(const char *_id, short _group = 0, short _flags = 0, const char *_name = 0, const char *_type = 0, intptr_t _offset = 0, void *_fun1 = 0, void *_fun2 = 0, const char *_help = 0)
 	{
 		id = _id; group = _group; flags = _flags; name = _name; type = _type; offset = _offset; fun1 = _fun1; fun2 = _fun2; help = _help;
@@ -254,5 +258,5 @@
 
 	SString getString(int);
-	long getInt(int);
+	paInt getInt(int);
 	double getDouble(int);
 	ExtObject getObject(int);
@@ -270,5 +274,5 @@
 	}
 
-	int setInt(int, long);
+	int setInt(int, paInt);
 	int setDouble(int, double);
 	int setString(int, const SString &);
