Simplifications.
[apps/madmutt.git] / tools / cpkg2c.mll
index 0abfe8b..388973a 100644 (file)
@@ -496,7 +496,7 @@ and ext_member m f = parse
           fprintf ob "};\n";
 
           (* dump struct init func *)
-          fprintf ob "\nstatic void %s_init(void)\n{\n" pkg.name;
+          fprintf ob "\nstatic void (%s_init)(void)\n{\n" pkg.name;
           List.iter (function (m, _, _) ->
             if not (fst m.typ) then
               let init, f, l = m.init in
@@ -627,7 +627,7 @@ int luaopen_%s(lua_State *L)
   let warn ob = output_endline ob "/*** THIS FILE IS AUTOGENERATED !!! ***/"
 
   let process fn file l =
-    try Unix.unlink file with _ -> ();
+    (try Unix.unlink file with _ -> ());
     let ob = open_out_gen  [ Open_trunc ; Open_wronly; Open_creat ] 0o444 file in
     warn ob; fn ob l; close_out ob