# HG changeset patch
# User Edouard Tisserant
# Date 1573141248 -3600
# Node ID 68ac5bf43525ee9b13c97d0d3ea9c509d3644232
# Parent  4a81cec5f78617aae2da8b85de9defd6bdbc02aa
SVGHMI: various fixes to make SVGHMI behave on more versions of twisted and GCC.

diff -r 4a81cec5f786 -r 68ac5bf43525 svghmi/svghmi.c
--- a/svghmi/svghmi.c	Wed Oct 30 15:17:05 2019 +0100
+++ b/svghmi/svghmi.c	Thu Nov 07 16:40:48 2019 +0100
@@ -170,7 +170,7 @@
     return 0;
 }
 
-inline void update_refresh_period(hmi_tree_item_t *dsc, uint16_t refresh_period_ms)
+void update_refresh_period(hmi_tree_item_t *dsc, uint16_t refresh_period_ms)
 {
     while(AtomicCompareExchange(&dsc->wlock, 0, 1)) sched_yield();
     dsc->refresh_period_ms = refresh_period_ms;
diff -r 4a81cec5f786 -r 68ac5bf43525 svghmi/svghmi.py
--- a/svghmi/svghmi.py	Wed Oct 30 15:17:05 2019 +0100
+++ b/svghmi/svghmi.py	Thu Nov 07 16:40:48 2019 +0100
@@ -340,10 +340,10 @@
 
         res = ([], "", False)
 
-        target_fname = "sghmi_"+location_str+".xhtml"
+        target_fname = "svghmi_"+location_str+".xhtml"
 
         target_path = os.path.join(self._getBuildPath(), target_fname)
-        target_file = open(target_path, 'w')
+        target_file = open(target_path, 'wb')
 
         if os.path.exists(svgfile):
 
@@ -385,7 +385,7 @@
         runtimefile = open(runtimefile_path, 'w')
         runtimefile.write("""
 def _runtime_svghmi1_%(location)s_start():
-    svghmi_root.putChild('%(view_name)s',File('%(xhtml)s'))
+    svghmi_root.putChild('%(view_name)s',File('%(xhtml)s', defaultType='application/xhtml+xml'))
 
 def _runtime_svghmi1_%(location)s_stop():
     svghmi_root.delEntity('%(view_name)s')