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 2013/02/04 00:40:11 UTC
[lucy-commits] git commit: refs/heads/master - Fix CFC compiler warnings and
compilation with g++
Updated Branches:
refs/heads/master 3a0c80dec -> 58726a9df
Fix CFC compiler warnings and compilation with g++
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/58726a9d
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/58726a9d
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/58726a9d
Branch: refs/heads/master
Commit: 58726a9df8b6cc67280127bee6a51fbdc4661ad5
Parents: 3a0c80d
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Feb 4 00:39:08 2013 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Feb 4 00:39:08 2013 +0100
----------------------------------------------------------------------
clownfish/compiler/src/CFCBase.h | 2 +-
clownfish/compiler/src/CFCBindClass.c | 12 ------------
clownfish/compiler/src/CFCLexHeader.c | 2 +-
clownfish/compiler/src/CFCLexHeader.l | 2 +-
clownfish/compiler/src/CFCPerl.c | 1 -
clownfish/compiler/src/CFCPerlClass.c | 1 -
clownfish/compiler/src/CFCPerlMethod.c | 6 +++---
clownfish/compiler/src/CFCPerlSub.c | 4 ++--
8 files changed, 8 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCBase.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBase.h b/clownfish/compiler/src/CFCBase.h
index 54d10fc..9117ae2 100644
--- a/clownfish/compiler/src/CFCBase.h
+++ b/clownfish/compiler/src/CFCBase.h
@@ -37,7 +37,7 @@ struct CFCBase {
};
#endif
struct CFCMeta {
- char *cfc_class;
+ const char *cfc_class;
size_t obj_alloc_size;
CFCBase_destroy_t destroy;
};
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCBindClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindClass.c b/clownfish/compiler/src/CFCBindClass.c
index f4bb499..cfa6a65 100644
--- a/clownfish/compiler/src/CFCBindClass.c
+++ b/clownfish/compiler/src/CFCBindClass.c
@@ -49,10 +49,6 @@ S_to_c_header_dynamic(CFCBindClass *self);
static char*
S_struct_definition(CFCBindClass *self);
-// Return C code defining the class's VTable.
-static char*
-S_vtable_definition(CFCBindClass *self);
-
// Declare typedefs for fresh methods, to ease casting.
static char*
S_method_typedefs(CFCBindClass *self);
@@ -110,14 +106,6 @@ CFCBindClass_destroy(CFCBindClass *self) {
CFCBase_destroy((CFCBase*)self);
}
-static int
-S_method_is_fresh(CFCMethod *method, CFCMethod **fresh_methods) {
- for (int i = 0; fresh_methods[i] != NULL; i++) {
- if (method == fresh_methods[i]) { return 1; }
- }
- return 0;
-}
-
char*
CFCBindClass_to_c_header(CFCBindClass *self) {
if (CFCClass_inert(self->client)) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCLexHeader.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCLexHeader.c b/clownfish/compiler/src/CFCLexHeader.c
index ae9a065..b2d69fd 100644
--- a/clownfish/compiler/src/CFCLexHeader.c
+++ b/clownfish/compiler/src/CFCLexHeader.c
@@ -604,7 +604,7 @@ char *yytext;
struct cfc_StringID *b
= (struct cfc_StringID*)vb;
return strcmp(a, b->string);
- };
+ }
static int
S_identifier_or_keyword(const char *word) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCLexHeader.l
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCLexHeader.l b/clownfish/compiler/src/CFCLexHeader.l
index 169e429..01b1519 100644
--- a/clownfish/compiler/src/CFCLexHeader.l
+++ b/clownfish/compiler/src/CFCLexHeader.l
@@ -75,7 +75,7 @@
struct cfc_StringID *b
= (struct cfc_StringID*)vb;
return strcmp(a, b->string);
- };
+ }
static int
S_identifier_or_keyword(const char *word) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerl.c b/clownfish/compiler/src/CFCPerl.c
index 5983c3d..c80aa34 100644
--- a/clownfish/compiler/src/CFCPerl.c
+++ b/clownfish/compiler/src/CFCPerl.c
@@ -429,7 +429,6 @@ CFCPerl_write_bindings(CFCPerl *self) {
// Hand-rolled XS.
for (size_t i = 0; registry[i] != NULL; i++) {
- CFCPerlClass *class_binding = registry[i];
const char *xs = CFCPerlClass_get_xs_code(registry[i]);
hand_rolled_xs = CFCUtil_cat(hand_rolled_xs, xs, "\n", NULL);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index 03fdba7..f1084de 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -252,7 +252,6 @@ CFCPerlMethod**
CFCPerlClass_method_bindings(CFCPerlClass *self) {
CFCClass *client = self->client;
CFCClass *parent = CFCClass_get_parent(client);
- const char *class_name = self->class_name;
size_t num_bound = 0;
CFCMethod **fresh_methods = CFCClass_fresh_methods(client);
CFCClass **descendants = CFCClass_tree_to_ladder(client);
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlMethod.c b/clownfish/compiler/src/CFCPerlMethod.c
index 10bb9b2..c6bbc82 100644
--- a/clownfish/compiler/src/CFCPerlMethod.c
+++ b/clownfish/compiler/src/CFCPerlMethod.c
@@ -231,9 +231,9 @@ S_self_assign_statement(CFCPerlMethod *self, CFCType *type,
// Make an exception for deserialize -- allow self to be NULL if called as
// a class method.
- char *binding_func = strcmp(method_name, "deserialize") == 0
- ? "XSBind_maybe_sv_to_cfish_obj"
- : "XSBind_sv_to_cfish_obj";
+ const char *binding_func = strcmp(method_name, "deserialize") == 0
+ ? "XSBind_maybe_sv_to_cfish_obj"
+ : "XSBind_sv_to_cfish_obj";
char pattern[] = "%s self = (%s)%s(ST(0), %s, NULL);";
char *statement
= CFCUtil_sprintf(pattern, type_c, type_c, binding_func, vtable_var);
http://git-wip-us.apache.org/repos/asf/lucy/blob/58726a9d/clownfish/compiler/src/CFCPerlSub.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.c b/clownfish/compiler/src/CFCPerlSub.c
index de38183..cb4a5d3 100644
--- a/clownfish/compiler/src/CFCPerlSub.c
+++ b/clownfish/compiler/src/CFCPerlSub.c
@@ -111,8 +111,8 @@ CFCPerlSub_params_hash_def(CFCPerlSub *self) {
}
struct allot_macro_map {
- char *prim_type;
- char *allot_macro;
+ const char *prim_type;
+ const char *allot_macro;
};
struct allot_macro_map prim_type_to_allot_macro[] = {