Repository: lucy-clownfish
Updated Branches:
  refs/heads/master a6112d69f -> 2b6e27a24


Fix compiler warnings


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

Branch: refs/heads/master
Commit: 2b6e27a24bf273ba9d626000b0059594cc894269
Parents: 6366c49
Author: Nick Wellnhofer <[email protected]>
Authored: Sat Feb 20 15:47:22 2016 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Sat Feb 20 15:56:54 2016 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC.xs | 20 --------------------
 compiler/src/CFCGo.c               |  2 ++
 compiler/src/CFCGoClass.c          |  2 --
 compiler/src/CFCGoFunc.c           |  6 +++++-
 compiler/src/CFCGoTypeMap.c        |  2 +-
 compiler/src/CFCPyTypeMap.c        |  1 -
 6 files changed, 8 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.xs 
b/compiler/perl/lib/Clownfish/CFC.xs
index 33dba4f..20f889f 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -84,26 +84,6 @@ S_array_of_cfcbase_to_av(CFCBase **things) {
     return retval;
 }
 
-// Transform a Perl arrayref into a NULL-terminated array of CFCBase*.
-static CFCBase**
-S_av_to_array_of_cfcbase(SV *ref, const char *class_name) {
-    if (!SvROK(ref)) { croak("Not an arrayref"); }
-    SV *sv = SvRV(ref);
-    if (SvTYPE(sv) != SVt_PVAV) { croak("Not an arrayref"); }
-    AV *av = (AV*)sv;
-    size_t size = av_len(av) + 1;
-    CFCBase **retval = (CFCBase**)CALLOCATE(size + 1, sizeof(CFCBase*));
-    for (size_t i = 0; i < size; i++) {
-        SV **elem = av_fetch(av, i, 0);
-        if (!*elem || !sv_derived_from(*elem, class_name)) {
-            croak("Array element not of type %s", class_name);
-        }
-        IV objint = SvIV((SV*)SvRV(*elem));
-        retval[i] = INT2PTR(CFCBase*, objint);
-    }
-    return retval;
-}
-
 static SV*
 S_sv_eat_c_string(char *string) {
     if (string) {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/src/CFCGo.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCGo.c b/compiler/src/CFCGo.c
index a5812a3..45e9e3f 100644
--- a/compiler/src/CFCGo.c
+++ b/compiler/src/CFCGo.c
@@ -177,6 +177,7 @@ S_register_classes(CFCGo *self, CFCParcel *parcel) {
 
 static char*
 S_gen_cgo_comment(CFCGo *self, CFCParcel *parcel, const char *h_includes) {
+    CHY_UNUSED_VAR(self);
     const char *prefix = CFCParcel_get_prefix(parcel);
     // Bake in parcel privacy define, so that binding code can be compiled
     // without extra compiler flags.
@@ -230,6 +231,7 @@ S_gen_init_code(CFCGo *self, CFCParcel *parcel) {
 
 static char*
 S_gen_autogen_go(CFCGo *self, CFCParcel *parcel) {
+    CHY_UNUSED_VAR(self);
     const char *clownfish_dot = CFCParcel_is_cfish(parcel)
                                 ? "" : "clownfish.";
     CFCGoClass **registry = CFCGoClass_registry();

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/src/CFCGoClass.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCGoClass.c b/compiler/src/CFCGoClass.c
index 4392b61..a60ce5c 100644
--- a/compiler/src/CFCGoClass.c
+++ b/compiler/src/CFCGoClass.c
@@ -168,7 +168,6 @@ CFCGoClass_go_typing(CFCGoClass *self) {
         content = CFCUtil_strdup("");
     } else {
         const char *short_struct = CFCClass_get_struct_sym(self->client);
-        const char *full_struct  = CFCClass_full_struct_sym(self->client);
 
         CFCClass *parent = CFCClass_get_parent(self->client);
         char *parent_type_str = NULL;
@@ -317,7 +316,6 @@ S_lazy_init_method_bindings(CFCGoClass *self) {
         return;
     }
     CFCUTIL_NULL_CHECK(self->client);
-    CFCClass     *parent        = CFCClass_get_parent(self->client);
     size_t        num_bound     = 0;
     CFCMethod   **fresh_methods = CFCClass_fresh_methods(self->client);
     CFCGoMethod **bound

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/src/CFCGoFunc.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCGoFunc.c b/compiler/src/CFCGoFunc.c
index 6226b06..dbebee8 100644
--- a/compiler/src/CFCGoFunc.c
+++ b/compiler/src/CFCGoFunc.c
@@ -19,6 +19,8 @@
 #include <stdio.h>
 #include <ctype.h>
 
+#include "charmony.h"
+
 #include "CFCGoFunc.h"
 #include "CFCGoTypeMap.h"
 #include "CFCBase.h"
@@ -223,7 +225,8 @@ CFCGoFunc_ctor_start(CFCParcel *parcel, const char *name,
 
 static char*
 S_prep_cfargs(CFCParcel *parcel, CFCClass *invoker,
-                      CFCParamList *param_list, int targ) {
+              CFCParamList *param_list, int targ) {
+    CHY_UNUSED_VAR(parcel);
     CFCVariable **vars = CFCParamList_get_variables(param_list);
     char go_name[GO_NAME_BUF_SIZE];
     char *cfargs = CFCUtil_strdup("");
@@ -269,6 +272,7 @@ CFCGoFunc_ctor_cfargs(CFCParcel *parcel, CFCParamList 
*param_list) {
 char*
 CFCGoFunc_return_statement(CFCParcel *parcel, CFCType *return_type,
                            const char *cf_retval) {
+    CHY_UNUSED_VAR(cf_retval);
     const char *clownfish_dot = CFCParcel_is_cfish(parcel)
                                 ? "" : "clownfish.";
     const char *maybe_decref = CFCType_incremented(return_type)

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/src/CFCGoTypeMap.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCGoTypeMap.c b/compiler/src/CFCGoTypeMap.c
index f8757c6..4c74863 100644
--- a/compiler/src/CFCGoTypeMap.c
+++ b/compiler/src/CFCGoTypeMap.c
@@ -217,7 +217,7 @@ CFCGoTypeMap_go_meth_receiever(const char *struct_name,
     if (param_list != NULL) {
         CFCVariable **vars = CFCParamList_get_variables(param_list);
         size_t num_vars = CFCParamList_num_vars(param_list);
-        for (int i = 1; i < num_vars; i++) {
+        for (size_t i = 1; i < num_vars; i++) {
             const char *name = CFCVariable_get_name(vars[i]);
             if (strcmp(name, buf) == 0) {
                 // Bah, a clash.  Use the original name, even though it's

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2b6e27a2/compiler/src/CFCPyTypeMap.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyTypeMap.c b/compiler/src/CFCPyTypeMap.c
index 016d3dc..7c4a1d6 100644
--- a/compiler/src/CFCPyTypeMap.c
+++ b/compiler/src/CFCPyTypeMap.c
@@ -22,7 +22,6 @@
 
 char*
 CFCPyTypeMap_c_to_py(CFCType *type, const char *cf_var) {
-    const char *type_str = CFCType_to_c(type);
     char *result = NULL;
 
     if (CFCType_is_object(type)) {

Reply via email to