try to make things work on 64 bit systems
src/snc/parse.c
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-branch-2-0/src/snc/parse.c new-branch-2-0/src/snc/parse.c
--- old-branch-2-0/src/snc/parse.c 2022-11-28 22:50:55.785792698 +0100
+++ new-branch-2-0/src/snc/parse.c 2022-11-28 22:50:55.785792698 +0100
@@ -194,6 +194,24 @@
return;
}
+int check_type_too_long(Var *vp)
+{
+ extern int line_num;
+
+ if ((sizeof(long) > 4 && (vp->type == V_LONG || vp->type == V_ULONG))
+ || (sizeof(int) > 4 && (vp->type == V_INT || vp->type == V_UINT)))
+ {
+ fprintf(stderr,
+ "line %d: cannot assign variable >%s< because on this architecture "
+ "its (base) type is larger than 4 bytes. Such variables cannot be faithfully "
+ "mapped to any of the Channel Access base types.\nTry declaring the "
+ "variable as 'int' or, if that is still too large on your system, as 'short'.\n",
+ line_num, vp->name);
+ return FALSE;
+ }
+ return TRUE;
+}
+
/* "Assign" statement: Assign a variable to a DB channel.
* Format: assign <variable> to <string;
* Note: Variable may be subscripted.
@@ -227,6 +245,8 @@
return;
}
+ if (!check_type_too_long(vp)) return;
+
/* Build structure for this channel */
cp = build_db_struct(vp);
@@ -270,6 +290,8 @@
return;
}
+ if (!check_type_too_long(vp)) return;
+
cp = vp->chan;
if (cp == NULL)
{
@@ -352,6 +374,8 @@
return;
}
+ if (!check_type_too_long(vp)) return;
+
/* Build a db structure for this variable */
cp = build_db_struct(vp);
patch 41656482809861d993607895eee0b410b4efda3d
Author: ben.franksen@online.de
Date: Wed Apr 6 20:59:29 CEST 2011
* try to make things work on 64 bit system