Index: cpp/frams/genetics/f4/f4_general.cpp
===================================================================
--- cpp/frams/genetics/f4/f4_general.cpp	(revision 240)
+++ cpp/frams/genetics/f4/f4_general.cpp	(revision 247)
@@ -593,5 +593,5 @@
 
 
-int f4_Cell::addlink(f4_Cell * nfrom, double nw, long nt)
+int f4_Cell::addlink(f4_Cell * nfrom, double nw, int nt)
 {
 	if (nolink >= MAXINPUTS - 1) return -1; // full!
@@ -675,5 +675,5 @@
 
 
-f4_CellLink::f4_CellLink(f4_Cell * nfrom, double nw, long nt)
+f4_CellLink::f4_CellLink(f4_Cell * nfrom, double nw, int nt)
 {
 	from = nfrom;
@@ -1234,5 +1234,5 @@
 	int i, j, t, res;
 	char tc1, tc2;
-	long relfrom;
+	int relfrom;
 	double w;
 	unsigned gpos, oldpos;
Index: cpp/frams/genetics/f4/f4_general.h
===================================================================
--- cpp/frams/genetics/f4/f4_general.h	(revision 240)
+++ cpp/frams/genetics/f4/f4_general.h	(revision 247)
@@ -101,5 +101,5 @@
 	int onestep();	// execute one simulation step (till a division)
 
-	int   addlink(f4_Cell * nfrom, double nw, long nt);
+	int   addlink(f4_Cell * nfrom, double nw, int nt);
 	void  adjustRec();
 
@@ -129,9 +129,9 @@
 	//f4_OrientMat OM;
 	double       mz;            // freedom in z
-	long         p2_refno;   // number of last end part object, used in f0
-	long         joint_refno;   // number of the joint object, used in f0
-	long         neuro_refno;   // number of the neuro object, used in f0
-
-	long         ctrl;  // neuron type
+	int          p2_refno;   // number of last end part object, used in f0
+	int          joint_refno;   // number of the joint object, used in f0
+	int          neuro_refno;   // number of the neuro object, used in f0
+
+	int          ctrl;  // neuron type
 	double       state;
 	double       inertia;
@@ -147,8 +147,8 @@
 {
 public:
-	f4_CellLink(f4_Cell * nfrom, double nw, long nt);
+	f4_CellLink(f4_Cell * nfrom, double nw, int nt);
 	f4_Cell *    from;
 	// type: 0: input, 1 '*', 2 'G', 3 'T', 4 'S'
-	long         t;
+	int          t;
 	double       w;
 };
@@ -205,5 +205,5 @@
 	int       pos;        // original position in string
 	int       i1;		// internal int  parameter1
-	long      l1;		// internal long parameter1
+	int       l1;		// internal long parameter1
 	double    f1;		// internal double parameter1
 
Index: cpp/frams/genetics/f4/oper_f4.cpp
===================================================================
--- cpp/frams/genetics/f4/oper_f4.cpp	(revision 240)
+++ cpp/frams/genetics/f4/oper_f4.cpp	(revision 247)
@@ -606,5 +606,5 @@
 
 
-unsigned long Geno_f4::style(const char *g, int pos)
+uint32_t Geno_f4::style(const char *g, int pos)
 {
 	char ch = g[pos];
@@ -616,5 +616,5 @@
 	if (!strchr(STYL4CAT_MODIFIC STYL4CAT_NEUMOD STYL4CAT_DIGIT STYL4CAT_REST, ch))
 		return GENSTYLE_CS(0, GENSTYLE_INVALID);
-	unsigned long style = GENSTYLE_CS(0, GENSTYLE_STRIKEOUT); //default, should be changed below
+	uint32_t style = GENSTYLE_CS(0, GENSTYLE_STRIKEOUT); //default, should be changed below
 	if (strchr("X ", ch))              style = GENSTYLE_CS(0, GENSTYLE_NONE);
 	if (strchr("N", ch))               style = GENSTYLE_RGBS(0, 200, 0, GENSTYLE_NONE);
Index: cpp/frams/genetics/f4/oper_f4.h
===================================================================
--- cpp/frams/genetics/f4/oper_f4.h	(revision 240)
+++ cpp/frams/genetics/f4/oper_f4.h	(revision 247)
@@ -38,5 +38,5 @@
 	int crossOver(char *&g1, char *&g2, float& chg1, float& chg2);
 	const char* getSimplest() { return "X"; }
-	unsigned long style(const char *g, int pos);
+	uint32_t style(const char *g, int pos);
 
 	// mutation probabilities
Index: cpp/frams/genetics/f9/oper_f9.cpp
===================================================================
--- cpp/frams/genetics/f9/oper_f9.cpp	(revision 240)
+++ cpp/frams/genetics/f9/oper_f9.cpp	(revision 247)
@@ -109,8 +109,8 @@
 
 ///Applying some colors and font styles...
-unsigned long GenoOper_f9::style(const char *g, int pos)
+uint32_t GenoOper_f9::style(const char *g, int pos)
 {
 	char ch = g[pos];
-	unsigned long style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
+	uint32_t style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
 	char *ptr = strchr((char*)turtle_commands_f9, ch);
 	if (ptr)
Index: cpp/frams/genetics/f9/oper_f9.h
===================================================================
--- cpp/frams/genetics/f9/oper_f9.h	(revision 240)
+++ cpp/frams/genetics/f9/oper_f9.h	(revision 247)
@@ -17,5 +17,5 @@
 	int mutate(char *&g,float& chg,int &method);
 	int crossOver(char *&g1,char *&g2,float& chg1,float& chg2);
-	unsigned long style(const char *g, int pos);
+	uint32_t style(const char *g, int pos);
 	const char* getSimplest() {return "R";}
 
Index: cpp/frams/genetics/fF/oper_fF.cpp
===================================================================
--- cpp/frams/genetics/fF/oper_fF.cpp	(revision 240)
+++ cpp/frams/genetics/fF/oper_fF.cpp	(revision 247)
@@ -89,8 +89,8 @@
 
 ///Applying some colors and font styles...
-unsigned long GenoOper_fF::style(const char *g, int pos)
+uint32_t GenoOper_fF::style(const char *g, int pos)
 {
 	char ch = g[pos];
-	unsigned long style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
+	uint32_t style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
 	if (strchr("-.e 0123456789", ch) != NULL)
 		style = GENSTYLE_CS(GENCOLOR_NUMBER, GENSTYLE_NONE);
Index: cpp/frams/genetics/fF/oper_fF.h
===================================================================
--- cpp/frams/genetics/fF/oper_fF.h	(revision 240)
+++ cpp/frams/genetics/fF/oper_fF.h	(revision 247)
@@ -17,5 +17,5 @@
 	int mutate(char *&g, float& chg, int &method);
 	int crossOver(char *&g1, char *&g2, float& chg1, float& chg2);
-	unsigned long style(const char *g, int pos);
+	uint32_t style(const char *g, int pos);
 	const char* getSimplest() { return "6, 1.05, 1.05, 1.05, 0, 0, 0"; }
 
Index: cpp/frams/genetics/fT/oper_fTest.cpp
===================================================================
--- cpp/frams/genetics/fT/oper_fTest.cpp	(revision 240)
+++ cpp/frams/genetics/fT/oper_fTest.cpp	(revision 247)
@@ -115,8 +115,8 @@
 
 ///Applying some colors and font styles...
-unsigned long GenoOper_fTest::style(const char *g, int pos)
+uint32_t GenoOper_fTest::style(const char *g, int pos)
 {
 	char ch = g[pos];
-	unsigned long style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
+	uint32_t style = GENSTYLE_CS(0, GENSTYLE_INVALID); //default, should be changed below
 	if (ch == 'A') style = GENSTYLE_RGBS(200, 0, 0, GENSTYLE_BOLD);
 	if (ch == 'T') style = GENSTYLE_RGBS(0, 200, 0, GENSTYLE_BOLD);
Index: cpp/frams/genetics/fT/oper_fTest.h
===================================================================
--- cpp/frams/genetics/fT/oper_fTest.h	(revision 240)
+++ cpp/frams/genetics/fT/oper_fTest.h	(revision 247)
@@ -29,5 +29,5 @@
 	int mutate(char *&geno, float& chg, int &method);
 	int crossOver(char *&g1, char *&g2, float& chg1, float& chg2);
-	unsigned long style(const char *g, int pos);
+	uint32_t style(const char *g, int pos);
 	const char* getSimplest() { return "GATCGATTACA"; }
 
Index: cpp/frams/genetics/genman.cpp
===================================================================
--- cpp/frams/genetics/genman.cpp	(revision 240)
+++ cpp/frams/genetics/genman.cpp	(revision 247)
@@ -371,5 +371,5 @@
 }
 
-unsigned long GenMan::Style(const char *g, int pos)
+uint32_t GenMan::Style(const char *g, int pos)
 {
 	Geno G(g);
@@ -380,5 +380,5 @@
 }
 
-void GenMan::GetFullStyle(const char *g, unsigned long *styletab)
+void GenMan::GetFullStyle(const char *g, uint32_t *styletab)
 {
 	Geno G(g);
@@ -404,8 +404,8 @@
 	int chars = 0, lines = 0;
 	bool shortened = false;
-	unsigned long *styletab = new unsigned long[len];
+	uint32_t *styletab = new uint32_t[len];
 	GetFullStyle(g, styletab);
 	SString html = "\n<div style=\"background:white;padding:0.2em;font-family:arial,helvetica,sans-serif;font-size:90%\">";
-	unsigned long prevstyle, prevcolor, style = 0, color = 0;
+	uint32_t prevstyle, prevcolor, style = 0, color = 0;
 	for (int i = 0; i<len; i++)
 	{
@@ -501,5 +501,5 @@
 }
 
-void GenMan::onDelGen(void *obj, long n)
+void GenMan::onDelGen(void *obj, intptr_t n)
 {
 	//old code needs update:
Index: cpp/frams/genetics/genman.h
===================================================================
--- cpp/frams/genetics/genman.h	(revision 240)
+++ cpp/frams/genetics/genman.h	(revision 247)
@@ -46,6 +46,6 @@
 	Geno CrossOver(const Geno&, const Geno&); //returns xover genotype ("child") or empty if errors
 	float Similarity(const Geno&, const Geno&); //returns GENOPER_NOOPER or normalized similarity (1: identical, 0: different)
-	unsigned long Style(const char* g, int pos); //returns Style (and validity) of a genotype char.
-	void GetFullStyle(const char *g, unsigned long *styletab); //optimized. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g).
+	uint32_t Style(const char* g, int pos); //returns Style (and validity) of a genotype char.
+	void GetFullStyle(const char *g, uint32_t *styletab); //optimized. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g).
 	SString HTMLize(const char *g); //returns colored genotype in HTML.
 	SString HTMLizeShort(const char *g); //returns colored genotype (abbreviated if needed) in HTML.
@@ -83,5 +83,5 @@
 #undef STATRICKCLASS
 	void clearStats();
-	static void onDelGen(void*, long);
+	static void onDelGen(void*, intptr_t);
 };
 
Index: cpp/frams/genetics/genoconv.h
===================================================================
--- cpp/frams/genetics/genoconv.h	(revision 240)
+++ cpp/frams/genetics/genoconv.h	(revision 247)
@@ -46,6 +46,6 @@
 		out_format;	//< output format, eg. '0'
 	const char *info;	//< detailed info about converter, format or copyright
-	long enabled;	//< don't touch this! (used by configuration module)
-	long mapsupport; //< set to 1 if your converter supports genotype mapping
+	paInt enabled;	//< don't touch this! (used by configuration module)
+	paInt mapsupport; //< set to 1 if your converter supports genotype mapping
 
 	/// You have to reimplement this method.
Index: cpp/frams/genetics/oper_fx.cpp
===================================================================
--- cpp/frams/genetics/oper_fx.cpp	(revision 240)
+++ cpp/frams/genetics/oper_fx.cpp	(revision 247)
@@ -58,5 +58,5 @@
 	if (p->type(i)[0] == 'd')
 	{
-		long _mn = 0, _mx = 1, _def = 0;
+		paInt _mn = 0, _mx = 1, _def = 0;
 		defined = p->getMinMax(i, _mn, _mx, _def);
 		if (defined == 1) _mx = _mn + 1;
@@ -150,5 +150,5 @@
 void GenoOperators::setIntFromDoubleWithProbabilisticDithering(ParamInterface &p, int index, double value) //TODO
 {
-	p.setInt(index, value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!)
+	p.setInt(index, (paInt)value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!)
 }
 
@@ -187,5 +187,5 @@
 NeuroClass* GenoOperators::parseNeuroClass(char*& s)
 {
-	int len = strlen(s);
+	int len = (int)strlen(s);
 	int Len = 0;
 	NeuroClass *I = NULL;
@@ -193,5 +193,5 @@
 	{
 		const char *n = Neuro::getClass(i)->name;
-		int l = strlen(n);
+		int l = (int)strlen(n);
 		if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = Neuro::getClass(i); Len = l; }
 	}
@@ -210,5 +210,5 @@
 int GenoOperators::neuroClassProp(char*& s, NeuroClass *nc, bool also_v1_N_props)
 {
-	int len = strlen(s);
+	int len = (int)strlen(s);
 	int Len = 0, I = -1;
 	if (nc)
@@ -218,5 +218,5 @@
 		{
 			const char *n = p.id(i);
-			int l = strlen(n);
+			int l = (int)strlen(n);
 			if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; }
 			if (also_v1_N_props) //recognize old properties symbols /=!
@@ -225,5 +225,5 @@
 					if (strcmp(n, "in") == 0) n = "="; else
 						if (strcmp(n, "fo") == 0) n = "!";
-				l = strlen(n);
+				l = (int)strlen(n);
 				if (len >= l && l > Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; }
 			}
@@ -235,5 +235,5 @@
 	{
 		const char *n = p.id(i);
-		int l = strlen(n);
+		int l = (int)strlen(n);
 		if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = i; Len = l; }
 	}
Index: cpp/frams/genetics/oper_fx.h
===================================================================
--- cpp/frams/genetics/oper_fx.h	(revision 240)
+++ cpp/frams/genetics/oper_fx.h	(revision 247)
@@ -31,7 +31,7 @@
 /** \name other useful style/color macros */
 //@{
-#define GENRGB(r,g,b) ((unsigned long)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned long)(unsigned char)(b))<<16)))
-#define GENSTYLE_RGBS(r,g,b,s) ((unsigned long)((unsigned char)s)<<24 | GENRGB(r,g,b))
-#define GENSTYLE_CS(rgb,s) ((unsigned long)((unsigned char)s)<<24 | rgb)
+#define GENRGB(r,g,b) ((uint32_t)(((uint8_t)(r)|((uint16_t)((uint8_t)(g))<<8))|(((uint32_t)(uint8_t)(b))<<16)))
+#define GENSTYLE_RGBS(r,g,b,s) ((uint32_t)((uint8_t)s)<<24 | GENRGB(r,g,b))
+#define GENSTYLE_CS(rgb,s) ((uint32_t)((uint8_t)s)<<24 | rgb)
 
 #define GENGETSTYLE(style) ((style)>>24)
@@ -168,5 +168,5 @@
 Assume white background.
 \sa GENSTYLE_* macros, like GENSTYLE_BOLD*/
-   virtual unsigned long style(const char *geno,int pos) {return GENSTYLE_RGBS(0,0,0,GENSTYLE_NONE);}
+   virtual uint32_t style(const char *geno,int pos) {return GENSTYLE_RGBS(0,0,0,GENSTYLE_NONE);}
 
 ///currently not used (similarity of two genotypes)
