Fixed generated code in c_ext file
authorLaurent Bessard
Fri, 10 May 2013 13:07:41 +0200
changeset 1119 34db4294c177
parent 1118 2c96a2f36295
child 1120 35d772ec1a76
Fixed generated code in c_ext file
c_ext/c_ext.py
--- a/c_ext/c_ext.py	Fri May 10 13:07:26 2013 +0200
+++ b/c_ext/c_ext.py	Fri May 10 13:07:41 2013 +0200
@@ -44,7 +44,7 @@
         
         # Adding includes
         text += "/* User includes */\n"
-        text += self.CodeFile.includes.gettext()
+        text += self.CodeFile.includes.gettext().strip()
         text += "\n"
         
         text += '#include "iec_types_all.h"\n\n'
@@ -64,26 +64,25 @@
         
         # Adding user global variables and routines
         text += "/* User internal user variables and routines */\n"
-        text += self.CodeFile.globals.gettext()
+        text += self.CodeFile.globals.gettext().strip()
         text += "\n"
         
         # Adding Beremiz confnode functions
         text += "/* Beremiz confnode functions */\n"
         text += "int __init_%s(int argc,char **argv)\n{\n"%location_str
-        text += self.CodeFile.initFunction.gettext()
-        text += "  return 0;\n"
-        text += "\n}\n\n"
+        text += self.CodeFile.initFunction.gettext().strip()
+        text += "  return 0;\n}\n\n"
         
         text += "void __cleanup_%s(void)\n{\n"%location_str
-        text += self.CodeFile.cleanUpFunction.gettext()
+        text += self.CodeFile.cleanUpFunction.gettext().strip()
         text += "\n}\n\n"
         
         text += "void __retrieve_%s(void)\n{\n"%location_str
-        text += self.CodeFile.retrieveFunction.gettext()
+        text += self.CodeFile.retrieveFunction.gettext().strip()
         text += "\n}\n\n"
         
         text += "void __publish_%s(void)\n{\n"%location_str
-        text += self.CodeFile.publishFunction.gettext()
+        text += self.CodeFile.publishFunction.gettext().strip()
         text += "\n}\n\n"
         
         Gen_Cfile_path = os.path.join(buildpath, "CFile_%s.c"%location_str)