You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/11/05 18:36:24 UTC

[1/4] git commit: Fix comment

Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 86113b3c9 -> f3d7d809a


Fix comment


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

Branch: refs/heads/master
Commit: fd798e0bc94f0214e28acce7db154ed25d82531b
Parents: 86113b3
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Nov 5 16:55:03 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Nov 5 16:55:03 2014 +0100

----------------------------------------------------------------------
 compiler/common/charmonizer.c    | 2 +-
 compiler/common/charmonizer.main | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fd798e0b/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index f346714..3cf9769 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -7687,7 +7687,7 @@ chaz_VariadicMacros_run(void) {
  * limitations under the License.
  */
 
-/* Source fragment for Lucy's charmonizer.c.
+/* Source fragment for the Clownfish compiler's charmonizer.c.
  */
 
 #include <stdio.h>

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fd798e0b/compiler/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.main b/compiler/common/charmonizer.main
index 8d8ea73..4794e7d 100644
--- a/compiler/common/charmonizer.main
+++ b/compiler/common/charmonizer.main
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-/* Source fragment for Lucy's charmonizer.c.
+/* Source fragment for the Clownfish compiler's charmonizer.c.
  */
 
 #include <stdio.h>


[4/4] git commit: Regenerate charmonizer.c

Posted by nw...@apache.org.
Regenerate charmonizer.c


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

Branch: refs/heads/master
Commit: f3d7d809a96930ce355f16534861a1303fa92c0f
Parents: 546400a
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Nov 5 18:35:03 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Nov 5 18:35:03 2014 +0100

----------------------------------------------------------------------
 compiler/common/charmonizer.c | 14 +++++++------
 runtime/common/charmonizer.c  | 41 +++++++++++++++++---------------------
 2 files changed, 26 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f3d7d809/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index 3cf9769..ea0a1f6 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -2217,9 +2217,9 @@ S_chaz_CLI_error(chaz_CLI *self, const char *pattern, ...) {
 static void
 S_chaz_CLI_rebuild_help(chaz_CLI *self) {
     int i;
-    size_t amount = 200; // Length of section headers.
+    size_t amount = 200; /* Length of section headers. */
 
-    // Allocate space.
+    /* Allocate space. */
     if (self->usage) {
         amount += strlen(self->usage);
     }
@@ -2243,7 +2243,7 @@ S_chaz_CLI_rebuild_help(chaz_CLI *self) {
     self->help = (char*)malloc(amount);
     self->help[0] = '\0';
 
-    // Accumulate "help" string.
+    /* Accumulate "help" string. */
     if (self->usage) {
         strcat(self->help, self->usage);
     }
@@ -2323,6 +2323,7 @@ chaz_CLI_destroy(chaz_CLI *self) {
     free(self->opts);
     free(self->usage);
     free(self->help);
+    free(self);
 }
 
 void
@@ -2344,14 +2345,14 @@ chaz_CLI_register(chaz_CLI *self, const char *name, const char *help,
     int arg_required = !!(flags & CHAZ_CLI_ARG_REQUIRED);
     int arg_optional = !!(flags & CHAZ_CLI_ARG_OPTIONAL);
 
-    // Validate flags
+    /* Validate flags */
     if (arg_required && arg_optional) {
         S_chaz_CLI_error(self, "Conflicting flags: value both optional "
                          "and required");
         return 0;
     }
 
-    // Insert new option.  Keep options sorted by name.
+    /* Insert new option.  Keep options sorted by name. */
     for (rank = self->num_opts; rank > 0; rank--) {
         int comparison = strcmp(name, self->opts[rank - 1].name);
         if (comparison == 0) {
@@ -2373,7 +2374,7 @@ chaz_CLI_register(chaz_CLI *self, const char *name, const char *help,
     self->opts[rank].defined = 0;
     self->opts[rank].value   = NULL;
 
-    // Update `help` with new option.
+    /* Update `help` with new option. */
     S_chaz_CLI_rebuild_help(self);
 
     return 1;
@@ -2516,6 +2517,7 @@ chaz_CLI_parse(chaz_CLI *self, int argc, const char *argv[]) {
         }
     }
 
+    free(name);
     return 1;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f3d7d809/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index e6a39bd..a2696e3 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -2217,9 +2217,9 @@ S_chaz_CLI_error(chaz_CLI *self, const char *pattern, ...) {
 static void
 S_chaz_CLI_rebuild_help(chaz_CLI *self) {
     int i;
-    size_t amount = 200; // Length of section headers.
+    size_t amount = 200; /* Length of section headers. */
 
-    // Allocate space.
+    /* Allocate space. */
     if (self->usage) {
         amount += strlen(self->usage);
     }
@@ -2243,7 +2243,7 @@ S_chaz_CLI_rebuild_help(chaz_CLI *self) {
     self->help = (char*)malloc(amount);
     self->help[0] = '\0';
 
-    // Accumulate "help" string.
+    /* Accumulate "help" string. */
     if (self->usage) {
         strcat(self->help, self->usage);
     }
@@ -2323,6 +2323,7 @@ chaz_CLI_destroy(chaz_CLI *self) {
     free(self->opts);
     free(self->usage);
     free(self->help);
+    free(self);
 }
 
 void
@@ -2344,14 +2345,14 @@ chaz_CLI_register(chaz_CLI *self, const char *name, const char *help,
     int arg_required = !!(flags & CHAZ_CLI_ARG_REQUIRED);
     int arg_optional = !!(flags & CHAZ_CLI_ARG_OPTIONAL);
 
-    // Validate flags
+    /* Validate flags */
     if (arg_required && arg_optional) {
         S_chaz_CLI_error(self, "Conflicting flags: value both optional "
                          "and required");
         return 0;
     }
 
-    // Insert new option.  Keep options sorted by name.
+    /* Insert new option.  Keep options sorted by name. */
     for (rank = self->num_opts; rank > 0; rank--) {
         int comparison = strcmp(name, self->opts[rank - 1].name);
         if (comparison == 0) {
@@ -2373,7 +2374,7 @@ chaz_CLI_register(chaz_CLI *self, const char *name, const char *help,
     self->opts[rank].defined = 0;
     self->opts[rank].value   = NULL;
 
-    // Update `help` with new option.
+    /* Update `help` with new option. */
     S_chaz_CLI_rebuild_help(self);
 
     return 1;
@@ -2516,6 +2517,7 @@ chaz_CLI_parse(chaz_CLI *self, int argc, const char *argv[]) {
         }
     }
 
+    free(name);
     return 1;
 }
 
@@ -7758,6 +7760,10 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
 
     chaz_CFlags_hide_symbols(extra_cflags);
+
+    if (chaz_CLI_defined(cli, "disable-threads")) {
+        chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
+    }
 }
 
 static int
@@ -8027,25 +8033,14 @@ int main(int argc, const char **argv) {
     /* Initialize. */
     chaz_CLI *cli
         = chaz_CLI_new(argv[0], "charmonizer: Probe C build environment");
+    chaz_CLI_register(cli, "disable-threads", "whether to disable threads",
+                      CHAZ_CLI_NO_ARG);
     chaz_CLI_set_usage(cli, "Usage: charmonizer [OPTIONS] [-- [CFLAGS]]");
-    {
-        int result = chaz_Probe_parse_cli_args(argc, argv, cli);
-        if (!result) {
-            chaz_Probe_die_usage();
-        }
-        chaz_Probe_init(cli);
-        S_add_compiler_flags(cli);
-    }
-    {
-        int i;
-        for (i = 0; i < argc; i++) {
-            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
-                chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-                chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
-                break;
-            }
-        }
+    if (!chaz_Probe_parse_cli_args(argc, argv, cli)) {
+        chaz_Probe_die_usage();
     }
+    chaz_Probe_init(cli);
+    S_add_compiler_flags(cli);
 
     /* Employ integer features but don't define stdint types in charmony.h. */
     chaz_ConfWriter_append_conf(


[2/4] git commit: Use .cfp files in build dependency checks

Posted by nw...@apache.org.
Use .cfp files in build dependency checks


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

Branch: refs/heads/master
Commit: b54623b7c59cdde089f831914c4e169a37bb87a7
Parents: fd798e0
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Oct 29 22:53:35 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Nov 5 16:55:22 2014 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b54623b7/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index 9ec6676..b83ab58 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -186,7 +186,7 @@ sub _cfh_filepaths {
     my $source_dirs = $self->clownfish_params('source');
     for my $source_dir (@$source_dirs) {
         next unless -e $source_dir;
-        push @paths, @{ $self->rscan_dir( $source_dir, qr/\.cfh$/ ) };
+        push @paths, @{ $self->rscan_dir( $source_dir, qr/\.cf[hp]$/ ) };
     }
     return \@paths;
 }


[3/4] git commit: Use chaz_CLI for --disable-threads option

Posted by nw...@apache.org.
Use chaz_CLI for --disable-threads option


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

Branch: refs/heads/master
Commit: 546400a2c7ebf54e0f108c72d6f112dfb66a8c18
Parents: b54623b
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Nov 5 18:34:37 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Nov 5 18:34:37 2014 +0100

----------------------------------------------------------------------
 runtime/common/charmonizer.main | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/546400a2/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 4664782..d3a7105 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -85,6 +85,10 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
 
     chaz_CFlags_hide_symbols(extra_cflags);
+
+    if (chaz_CLI_defined(cli, "disable-threads")) {
+        chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
+    }
 }
 
 static int
@@ -354,25 +358,14 @@ int main(int argc, const char **argv) {
     /* Initialize. */
     chaz_CLI *cli
         = chaz_CLI_new(argv[0], "charmonizer: Probe C build environment");
+    chaz_CLI_register(cli, "disable-threads", "whether to disable threads",
+                      CHAZ_CLI_NO_ARG);
     chaz_CLI_set_usage(cli, "Usage: charmonizer [OPTIONS] [-- [CFLAGS]]");
-    {
-        int result = chaz_Probe_parse_cli_args(argc, argv, cli);
-        if (!result) {
-            chaz_Probe_die_usage();
-        }
-        chaz_Probe_init(cli);
-        S_add_compiler_flags(cli);
-    }
-    {
-        int i;
-        for (i = 0; i < argc; i++) {
-            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
-                chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-                chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
-                break;
-            }
-        }
+    if (!chaz_Probe_parse_cli_args(argc, argv, cli)) {
+        chaz_Probe_die_usage();
     }
+    chaz_Probe_init(cli);
+    S_add_compiler_flags(cli);
 
     /* Employ integer features but don't define stdint types in charmony.h. */
     chaz_ConfWriter_append_conf(