[1/2] lucy-clownfish git commit: Fix compiler warnings
Repository: lucy-clownfish Updated Branches: refs/heads/0.5 05d3caa62 -> c83c71364 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/4aec071f Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4aec071f Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4aec071f Branch: refs/heads/0.5 Commit: 4aec071f0616e140d4377e78fbe16ab06cc773de Parents: 05d3caa Author: Nick Wellnhofer Authored: Sat Mar 12 15:39:53 2016 +0100 Committer: Nick Wellnhofer Committed: Sat Mar 12 15:42:33 2016 +0100 -- compiler/common/charmonizer.c| 3 ++- compiler/common/charmonizer.main | 3 ++- compiler/modules/CommonMark/src/config.h | 5 - compiler/src/CFCCallable.c | 6 -- compiler/src/CFCPython.c | 7 +++ 5 files changed, 15 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4aec071f/compiler/common/charmonizer.c -- diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c index 887e57c..87c80d0 100644 --- a/compiler/common/charmonizer.c +++ b/compiler/common/charmonizer.c @@ -7998,7 +7998,8 @@ S_add_compiler_flags(struct chaz_CLI *cli) { } chaz_CFlags_append(extra_cflags, -"-pedantic -Wall -Wextra -Wno-variadic-macros"); +"-pedantic -Wall -Wextra -Wno-variadic-macros" +" -Wno-overlength-strings"); if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) { chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC"); } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4aec071f/compiler/common/charmonizer.main -- diff --git a/compiler/common/charmonizer.main b/compiler/common/charmonizer.main index e8058c6..80f161a 100644 --- a/compiler/common/charmonizer.main +++ b/compiler/common/charmonizer.main @@ -103,7 +103,8 @@ S_add_compiler_flags(struct chaz_CLI *cli) { } chaz_CFlags_append(extra_cflags, -"-pedantic -Wall -Wextra -Wno-variadic-macros"); +"-pedantic -Wall -Wextra -Wno-variadic-macros" +" -Wno-overlength-strings"); if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) { chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC"); } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4aec071f/compiler/modules/CommonMark/src/config.h -- diff --git a/compiler/modules/CommonMark/src/config.h b/compiler/modules/CommonMark/src/config.h index e387e69..97272b2 100644 --- a/compiler/modules/CommonMark/src/config.h +++ b/compiler/modules/CommonMark/src/config.h @@ -18,4 +18,7 @@ typedef char bool; #define HAVE_C99_SNPRINTF #endif -#define inline CHY_INLINE +#if defined(_MSC_VER) && !defined(__cplusplus) + #define inline __inline +#endif + http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4aec071f/compiler/src/CFCCallable.c -- diff --git a/compiler/src/CFCCallable.c b/compiler/src/CFCCallable.c index d421366..ccb3931 100644 --- a/compiler/src/CFCCallable.c +++ b/compiler/src/CFCCallable.c @@ -31,12 +31,6 @@ #include "CFCDocuComment.h" #include "CFCUtil.h" -static const CFCMeta CFCCALLABLE_META = { -"Clownfish::CFC::Model::Callable", -sizeof(CFCCallable), -(CFCBase_destroy_t)CFCCallable_destroy -}; - CFCCallable* CFCCallable_init(CFCCallable *self, const char *exposure, const char *name, CFCType *return_type, CFCParamList *param_list, http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4aec071f/compiler/src/CFCPython.c -- diff --git a/compiler/src/CFCPython.c b/compiler/src/CFCPython.c index d108b69..3c60682 100644 --- a/compiler/src/CFCPython.c +++ b/compiler/src/CFCPython.c @@ -112,6 +112,8 @@ S_write_hostdefs(CFCPython *self) { static char* S_gen_callbacks(CFCPython *self, CFCParcel *parcel, CFCClass **ordered) { +CHY_UNUSED_VAR(self); +CHY_UNUSED_VAR(parcel); char *callbacks = CFCUtil_strdup(""); // Generate implementation files containing callback definitions. @@ -364,6 +366,8 @@ S_gen_callbacks(CFCPython *self, CFCParcel *parcel, CFCClass **ordered) { static char* S_gen_type_linkups(CFCPython *self, CFCParcel *parcel, CFCClass **ordered) { +CHY_UNUSED_VAR(self); +CHY_UNUSED_VAR(parcel); char *handles = CFCUtil_strdup(""); char *py_types = CFCUtil_strdup(""); int num_items = 0; @@ -413,6 +417,9 @@ S_gen_type_link
[1/2] lucy-clownfish git commit: Fix compiler warnings
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 Authored: Sat Feb 20 15:47:22 2016 +0100 Committer: Nick Wellnhofer 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_tnum_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 #include +#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