Index: cpp/frams/param/param.cpp
===================================================================
--- cpp/frams/param/param.cpp	(revision 1302)
+++ cpp/frams/param/param.cpp	(revision 1315)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2022  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -21,6 +21,4 @@
 #define SAVE_SELECTED_NAMES
 #define WARN_MISSING_NAME
-
-char MakeCodeGuardHappy;
 
 ParamEntry empty_paramtab[] =
@@ -559,9 +557,9 @@
 	const char* fname = f->VgetPath();
 	if (fname != NULL)
-		{
+	{
 		fileinfo = SString::sprintf(" while reading from '%s'", fname);
 		if (options.linenum)
 			fileinfo += SString::sprintf(" (line %d)", *options.linenum);
-		}
+	}
 	return fileinfo;
 }
@@ -613,5 +611,5 @@
 			if (seen[i])
 			{
-				SString fileinfo = getFileMessageFor(f,options);
+				SString fileinfo = getFileMessageFor(f, options);
 				logPrintf("ParamInterface", "load", LOG_WARN, "Multiple '%s.%s' properties found%s", getName(), id(i), fileinfo.c_str());
 			}
@@ -622,10 +620,10 @@
 				if (p0[p_len + 1] == '~')
 				{
-					if (p0[p_len+2])
+					if (p0[p_len + 2])
 					{
-						SString fileinfo = getFileMessageFor(f,options);
-						logPrintf("ParamInterface", "load", LOG_WARN, "Ignored unexpected characters after '~': '%s' in '%s:'%s", p0+p_len+1, id(i), fileinfo.c_str());
+						SString fileinfo = getFileMessageFor(f, options);
+						logPrintf("ParamInterface", "load", LOG_WARN, "Ignored unexpected characters after '~': '%s' in '%s:'%s", p0 + p_len + 1, id(i), fileinfo.c_str());
 					}
-				
+
 					SString s;
 					if (!readUntilTilde(f, s))
@@ -939,11 +937,11 @@
 	{
 	case 'd': t += "integer";
-	{paInt a, b, c; int n = getMinMaxIntFromTypeDef(type, a, b, c); if ((n >= 2) && (b >= a)) t += SString::sprintf(" %d..%d", a, b); if (n >= 3) t += SString::sprintf(" (default %d)", c); }
+	{ paInt a, b, c; int n = getMinMaxIntFromTypeDef(type, a, b, c); if ((n >= 2) && (b >= a)) t += SString::sprintf(" %d..%d", a, b); if (n >= 3) t += SString::sprintf(" (default %d)", c); }
 	break;
 	case 'f': t += "float";
-	{double a, b, c; int n = getMinMaxDoubleFromTypeDef(type, a, b, c); if ((n >= 2) && (b >= a)) t += SString::sprintf(" %g..%g", a, b); if (n >= 3) t += SString::sprintf(" (default %g)", c); }
+	{ double a, b, c; int n = getMinMaxDoubleFromTypeDef(type, a, b, c); if ((n >= 2) && (b >= a)) t += SString::sprintf(" %g..%g", a, b); if (n >= 3) t += SString::sprintf(" (default %g)", c); }
 	break;
 	case 's': t += "string";
-	{int a, b; SString c; int n = getMinMaxStringFromTypeDef(type, a, b, c); if ((n >= 2) && (b > 0)) t += SString::sprintf(", max %d chars", b); if (n >= 3) t += SString::sprintf(" (default \"%s\")", c.c_str()); }
+	{ int a, b; SString c; int n = getMinMaxStringFromTypeDef(type, a, b, c); if ((n >= 2) && (b > 0)) t += SString::sprintf(", max %d chars", b); if (n >= 3) t += SString::sprintf(" (default \"%s\")", c.c_str()); }
 	break;
 	case 'x': t += "untyped value"; break;
Index: cpp/frams/param/param.h
===================================================================
--- cpp/frams/param/param.h	(revision 1302)
+++ cpp/frams/param/param.h	(revision 1315)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2022  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -216,6 +216,4 @@
 // implementations:
 
-extern char MakeCodeGuardHappy;
-
 #define PROCOFFSET(_proc_) ( (void (*)(void*,ExtValue*,ExtValue*)) &(FIELDSTRUCT :: _proc_ ## _statrick))
 #define STATICPROCOFFSET(_proc_) ( (void (*)(void*,ExtValue*,ExtValue*)) &(FIELDSTRUCT :: _proc_))
@@ -223,5 +221,5 @@
 #define SETOFFSET(_proc_) ( (int (*)(void*,const ExtValue*)) &(FIELDSTRUCT :: _proc_ ## _statrick))
 
-#define FIELDOFFSET(_fld_) ((intptr_t)((char*)(&((FIELDSTRUCT*)&MakeCodeGuardHappy)->_fld_)-((char*)((FIELDSTRUCT*)&MakeCodeGuardHappy))))
+#define FIELDOFFSET(_fld_) ((intptr_t)offsetof(FIELDSTRUCT, _fld_)) // https://stackoverflow.com/questions/177885/looking-for-something-similar-to-offsetof-for-non-pod-types , https://stackoverflow.com/questions/713963/why-does-this-implementation-of-offsetof-work
 
 #ifdef _DEBUG
@@ -349,25 +347,25 @@
 
 #ifdef CHECK_PARAMENTRY_COUNT
-	
+
 	template <int COUNT>
-	Param(ParamEntry (&t)[COUNT],void* o = 0, const char*n = 0) :SimpleAbstractParam(o, n), tab(t)
+	Param(ParamEntry(&t)[COUNT], void* o = 0, const char*n = 0) :SimpleAbstractParam(o, n), tab(t)
 	{
-		if (!n&&tab) myname = tab[0].name;
+		if (!n && tab) myname = tab[0].name;
 		//printf("Param(ParamEntry t[%d]) %s\n",COUNT,myname?myname:"unknown name");
 		if (tab)
-			{
-			int in_array = COUNT-1-tab[0].group;
+		{
+			int in_array = COUNT - 1 - tab[0].group;
 			if (tab[0].flags != in_array)
-				printf("\nCHECK_PARAMENTRY_COUNT: %d items in ParamEntry[] array, declared %d (%s)\n\n",in_array, tab[0].flags, myname?myname:"unknown name");
-			if (in_array>0 && tab[COUNT-1].id != NULL) //in_array>0 -> completely empty paramtab can't end with the usual zero row because that's also its first row
-				printf("\nCHECK_PARAMENTRY_COUNT: last entry is not null (%s)\n\n",myname?myname:"unknown name");
-			}
+				printf("\nCHECK_PARAMENTRY_COUNT: %d items in ParamEntry[] array, declared %d (%s)\n\n", in_array, tab[0].flags, myname ? myname : "unknown name");
+			if (in_array > 0 && tab[COUNT - 1].id != NULL) //in_array>0 -> completely empty paramtab can't end with the usual zero row because that's also its first row
+				printf("\nCHECK_PARAMENTRY_COUNT: last entry is not null (%s)\n\n", myname ? myname : "unknown name");
+		}
 	}
 
-	template<typename T, typename std::enable_if_t<std::is_same<ParamEntry*,T>::value>* = nullptr > //SFINAE-fu because the normal ParamEntry* overload would be also called for ParamEntry[COUNT] argument
+	template<typename T, typename std::enable_if_t<std::is_same<ParamEntry*, T>::value>* = nullptr > //SFINAE-fu because the normal ParamEntry* overload would be also called for ParamEntry[COUNT] argument
 	Param(T t, void* o = 0, const char*n = 0) :SimpleAbstractParam(o, n), tab(t)
 	{
 		//printf("Param(ParamEntry* t) %s\n",tab?tab[0].name:"");
-		if (!n&&tab) myname = tab[0].name;
+		if (!n && tab) myname = tab[0].name;
 	}
 
@@ -378,12 +376,12 @@
 
 #else // CHECK_PARAMENTRY_COUNT
-	
-	Param(ParamEntry *t = 0, void* o = 0, const char*n = 0) :SimpleAbstractParam(o, n), tab(t)
+
+	Param(ParamEntry *t = 0, void* o = 0, const char*n = 0) : SimpleAbstractParam(o, n), tab(t)
 	{
-		if (!n&&tab) myname = tab[0].name;
+		if (!n && tab) myname = tab[0].name;
 	}
-	
+
 #endif // CHECK_PARAMENTRY_COUNT
-	
+
 	Param(const Param& p) :SimpleAbstractParam(p.object, p.myname), tab(p.tab) {}
 	void operator=(const Param&p) { object = p.object; myname = p.myname; tab = p.tab; }
