merge
authorStefan Behnel <scoder@users.berlios.de>
Sat, 9 Feb 2008 16:25:17 +0000 (17:25 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 9 Feb 2008 16:25:17 +0000 (17:25 +0100)
1  2 
Cython/Compiler/Nodes.py
Cython/Compiler/PyrexTypes.py

index c90b4d0290e83db24068561760c9cc8e53467b5d,82f992dafc92bc6b3b56902bc0061ba2cf644781..dfd8ae65abe6f86417fe7fe38194498fbdcedc68
@@@ -860,8 -952,21 +952,21 @@@ class CFuncDefNode(FuncDefNode)
      def generate_keyword_list(self, code):
          pass
          
 -    def generate_argument_parsing_code(self, code):
 +    def generate_argument_parsing_code(self, env, code):
-         pass
+         i = 0
+         if self.type.optional_arg_count:
+             code.putln('if (%s) {' % Naming.optional_args_cname)
+             for arg in self.args:
+                 if arg.default:
+                     code.putln('if (%s->%sn > %s) {' % (Naming.optional_args_cname, Naming.pyrex_prefix, i))
+                     declarator = arg.declarator
+                     while not hasattr(declarator, 'name'):
+                         declarator = declarator.base
+                     code.putln('%s = %s->%s;' % (arg.cname, Naming.optional_args_cname, declarator.name))
+                     i += 1
+             for _ in range(self.type.optional_arg_count):
+                 code.putln('}')
+             code.putln('}')
      
      def generate_argument_conversion_code(self, code):
          pass
Simple merge