# HG changeset patch
# User xymeng
# Date 1340995618 -14400
# Node ID 4e35c45d0853b130e3e579edd499b9301b2b2d3a
# Parent  a68eca3ad1fe97b4e6fbbc5f9adec5a3c46a294c
Fix the function definition issue so the function pointer format now looks correct.

diff -r a68eca3ad1fe -r 4e35c45d0853 tools/pas2c.hs
--- a/tools/pas2c.hs	Fri Jun 29 01:23:43 2012 +0400
+++ b/tools/pas2c.hs	Fri Jun 29 22:46:58 2012 +0400
@@ -464,7 +464,7 @@
              i' <- id2CTyped t i
              ie <- initExpr2C e
              return [text "#define" <+> i' <+> parens ie <> text "\n"]
-         (_, BTFunction{}, _, Nothing) -> liftM (map(\i -> t' $ text "*" <+> i)) $ mapM (id2CTyped t) ids
+         (_, BTFunction{}, _, Nothing) -> liftM (map(\i -> t' i)) $ mapM (id2CTyped t) ids
          _ -> liftM (map(\i -> t' i <+> ie)) $ mapM (id2CTyped t) ids
     where
     initExpr Nothing = return $ empty
@@ -615,7 +615,7 @@
     type2C' (FunctionType returnType params) = do
         t <- type2C returnType
         p <- withState' id $ functionParams2C params
-        return (\i -> t empty <+> i <> parens p)
+        return (\i -> (t empty <> (parens $ text "*" <> i) <> parens p))
     type2C' (DeriveType (InitBinOp _ _ i)) = type2C' (DeriveType i)
     type2C' (DeriveType (InitPrefixOp _ i)) = type2C' (DeriveType i)
     type2C' (DeriveType (InitNumber _)) = return (text "int" <+>)