lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [12/22] lucy-clownfish git commit: Handle default values for primitive types.
Date Tue, 01 Mar 2016 03:03:20 GMT
Handle default values for primitive types.

Set conversion args to default values prior to Python argument parsing.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/73635f23
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/73635f23
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/73635f23

Branch: refs/heads/master
Commit: 73635f233dc3a5b1addf17aacdf5773d8fad1113
Parents: 2e4d3d3
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Fri Feb 5 18:03:01 2016 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Wed Feb 24 15:36:07 2016 -0800

----------------------------------------------------------------------
 compiler/src/CFCPyMethod.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/73635f23/compiler/src/CFCPyMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyMethod.c b/compiler/src/CFCPyMethod.c
index ef8b152..d8128c2 100644
--- a/compiler/src/CFCPyMethod.c
+++ b/compiler/src/CFCPyMethod.c
@@ -124,7 +124,10 @@ S_gen_declaration(CFCVariable *var, const char *val) {
         }
     }
     else if (CFCType_is_primitive(type)) {
-        ;
+        if (val) {
+            char pattern[] = "    %s_ARG = %s;\n";
+            result = CFCUtil_sprintf(pattern, var_name, val);
+        }
     }
     else {
         CFCUtil_die("Unexpected type, can't gen declaration: %s", type_str);


Mime
View raw message