All Runtimes: Now sizeof(tick)=4 on all platforms (unsigned int).
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Fri, 24 May 2024 18:47:30 +0200
changeset 3947 9b5cb90297e4
parent 3946 8815b44be31e
child 3948 21e391fb5983
All Runtimes: Now sizeof(tick)=4 on all platforms (unsigned int).
targets/Linux/plc_Linux_main.c
targets/OSX/plc_OSX_main.c
targets/Win32/plc_Win32_main.c
targets/Xenomai/plc_Xenomai_main.c
targets/plc_debug.c
targets/plc_main_head.c
targets/plc_main_tail.c
--- a/targets/Linux/plc_Linux_main.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/Linux/plc_Linux_main.c	Fri May 24 18:47:30 2024 +0200
@@ -25,7 +25,7 @@
 #define _LogError(text,...) _Log(LOG_CRITICAL, text, ##__VA_ARGS__)
 #define _LogWarning(text,...) _Log(LOG_WARNING, text, ##__VA_ARGS__)
 
-static unsigned long __debug_tick;
+static unsigned int __debug_tick;
 
 static pthread_t PLC_thread;
 static pthread_mutex_t python_wait_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -305,9 +305,9 @@
     return 0;
 }
 
-extern unsigned long __tick;
-
-int WaitDebugData(unsigned long *tick)
+extern unsigned int __tick;
+
+int WaitDebugData(unsigned int *tick)
 {
     int res;
     if (PLC_shutdown) return 1;
--- a/targets/OSX/plc_OSX_main.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/OSX/plc_OSX_main.c	Fri May 24 18:47:30 2024 +0200
@@ -69,7 +69,7 @@
     exit(0);
 }
 
-static unsigned long __debug_tick;
+static unsigned int __debug_tick;
 
 pthread_t PLC_thread;
 static pthread_mutex_t python_wait_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -165,9 +165,9 @@
     return 0;
 }
 
-extern unsigned long __tick;
-
-int WaitDebugData(unsigned long *tick)
+extern unsigned int __tick;
+
+int WaitDebugData(unsigned int *tick)
 {
     int res;
     if (PLC_shutdown)
--- a/targets/Win32/plc_Win32_main.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/Win32/plc_Win32_main.c	Fri May 24 18:47:30 2024 +0200
@@ -146,7 +146,7 @@
     }
     return 0;
 }
-static unsigned long __debug_tick;
+static unsigned int __debug_tick;
 
 int TryEnterDebugSection(void)
 {
@@ -187,7 +187,7 @@
 }
 
 /* from plc_debugger.c */
-int WaitDebugData(unsigned long *tick)
+int WaitDebugData(unsigned int *tick)
 {
 	DWORD res;
 	res = WaitForSingleObject(debug_wait_sem, INFINITE);
--- a/targets/Xenomai/plc_Xenomai_main.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/Xenomai/plc_Xenomai_main.c	Fri May 24 18:47:30 2024 +0200
@@ -336,9 +336,9 @@
     }
 }
 
-extern unsigned long __tick;
-
-int WaitDebugData(unsigned long *tick)
+extern unsigned int __tick;
+
+int WaitDebugData(unsigned int *tick)
 {
     char cmd;
     int res;
--- a/targets/plc_debug.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_debug.c	Fri May 24 18:47:30 2024 +0200
@@ -170,7 +170,7 @@
 extern void InitiateDebugTransfer(void);
 extern void CleanupRetain(void);
 
-extern unsigned long __tick;
+extern unsigned int __tick;
 
 void __cleanup_debug(void)
 {
@@ -490,7 +490,7 @@
         BUFFER_FULL,
         BUFFER_EMPTY);
 }
-int WaitDebugData(unsigned long *tick);
+int WaitDebugData(unsigned int *tick);
 /* Wait until debug data ready and return pointer to it */
 int GetDebugData(unsigned int *tick, unsigned int *size, void **buffer){
     int wait_error = WaitDebugData(tick);
--- a/targets/plc_main_head.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_main_head.c	Fri May 24 18:47:30 2024 +0200
@@ -7,7 +7,7 @@
 /*
  * Prototypes of functions provided by generated C softPLC
  **/
-void config_run__(unsigned long tick);
+void config_run__(unsigned int tick);
 void config_init__(void);
 
 /*
@@ -24,13 +24,13 @@
  **/
 IEC_TIME __CURRENT_TIME;
 IEC_BOOL __DEBUG = 0;
-unsigned long __tick = 0;
+unsigned int __tick = 0;
 char *PLC_ID = NULL;
 
 /*
  *  Variable generated by C softPLC and plugins
  **/
-extern unsigned long greatest_tick_count__;
+extern unsigned int greatest_tick_count__;
 
 /* Help to quit cleanly when init fail at a certain level */
 static int init_level = 0;
--- a/targets/plc_main_tail.c	Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_main_tail.c	Fri May 24 18:47:30 2024 +0200
@@ -45,7 +45,7 @@
 typedef struct {
     uint32_t msgidx;
     uint32_t msgsize;
-    unsigned long tick;
+    unsigned int tick;
     IEC_TIME time;
 } mTail;
 
@@ -146,7 +146,7 @@
 static long long Tsync = 0;
 static long long FreqCorr = 0;
 static int Nticks = 0;
-static unsigned long last_tick = 0;
+static unsigned int last_tick = 0;
 
 /*
  * Called on each external periodic sync event