lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [5/6] git commit: refs/heads/move-dumpable - Remove "autocode" from CFCClass.
Date Fri, 26 Jul 2013 01:30:45 GMT
Remove "autocode" from CFCClass.

The "autocode" member var used to hold autogenerated code for Dump/Load.
It's no longer needed.


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

Branch: refs/heads/move-dumpable
Commit: 251d2bcc758d32b5e708d4e52b775f6cad905d9a
Parents: ee8fc5c
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Thu Jul 25 17:12:40 2013 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Thu Jul 25 18:27:24 2013 -0700

----------------------------------------------------------------------
 clownfish/compiler/perl/lib/Clownfish/CFC.xs | 13 -------------
 clownfish/compiler/src/CFCBindClass.c        | 10 ++--------
 clownfish/compiler/src/CFCClass.c            | 15 ---------------
 clownfish/compiler/src/CFCClass.h            |  8 --------
 4 files changed, 2 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/251d2bcc/clownfish/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC.xs b/clownfish/compiler/perl/lib/Clownfish/CFC.xs
index 2af743f..205d191 100644
--- a/clownfish/compiler/perl/lib/Clownfish/CFC.xs
+++ b/clownfish/compiler/perl/lib/Clownfish/CFC.xs
@@ -200,13 +200,6 @@ PPCODE:
     CFCClass_clear_registry();
 
 void
-append_autocode(self, autocode)
-    CFCClass *self;
-    const char *autocode;
-PPCODE:
-    CFCClass_append_autocode(self, autocode);
-
-void
 add_child(self, child)
     CFCClass *self;
     CFCClass *child;
@@ -309,7 +302,6 @@ ALIAS:
     get_cnick             = 2
     set_parent            = 5
     get_parent            = 6
-    get_autocode          = 8
     get_path_part         = 10
     get_parent_class_name = 12
     final                 = 14
@@ -354,11 +346,6 @@ PPCODE:
                 retval = S_cfcbase_to_perlref(parent);
                 break;
             }
-        case 8: {
-                const char *value = CFCClass_get_autocode(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
         case 10: {
                 const char *value = CFCClass_get_path_part(self);
                 retval = value ? newSVpvn(value, strlen(value)) : newSV(0);

http://git-wip-us.apache.org/repos/asf/lucy/blob/251d2bcc/clownfish/compiler/src/CFCBindClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindClass.c b/clownfish/compiler/src/CFCBindClass.c
index f507596..89368f8 100644
--- a/clownfish/compiler/src/CFCBindClass.c
+++ b/clownfish/compiler/src/CFCBindClass.c
@@ -269,12 +269,11 @@ CFCBindClass_to_c_data(CFCBindClass *self) {
     const char *class_name = CFCClass_get_class_name(client);
 
     if (CFCClass_inert(client)) {
-        return CFCUtil_strdup(CFCClass_get_autocode(client));
+        return CFCUtil_strdup("");
     }
 
     const char *ivars_offset = CFCClass_full_ivars_offset(client);
 
-    const char *autocode  = CFCClass_get_autocode(client);
     const char *vt_var    = CFCClass_full_vtable_var(client);
 
     CFCMethod **methods  = CFCClass_methods(client);
@@ -395,16 +394,11 @@ CFCBindClass_to_c_data(CFCBindClass *self) {
         " */\n"
         "\n"
         "cfish_VTable *%s;\n"
-        "\n"
-        "/* Include auxilary automatically generated code for this class.\n"
-        " */\n"
-        "\n"
-        "%s\n"
         "\n";
     char *code
         = CFCUtil_sprintf(pattern, ivars_offset, offsets, method_defs,
                           novel_ms_var, overridden_ms_var, inherited_ms_var,
-                          vt_var, autocode);
+                          vt_var);
 
     FREEMEM(offsets);
     FREEMEM(method_defs);

http://git-wip-us.apache.org/repos/asf/lucy/blob/251d2bcc/clownfish/compiler/src/CFCClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCClass.c b/clownfish/compiler/src/CFCClass.c
index 6e9179d..7b3fa5a 100644
--- a/clownfish/compiler/src/CFCClass.c
+++ b/clownfish/compiler/src/CFCClass.c
@@ -70,7 +70,6 @@ struct CFCClass {
     CFCClassAttribute **attributes;
     size_t num_attributes;
     CFCFileSpec *file_spec;
-    char *autocode;
     char *parent_class_name;
     int is_final;
     int is_inert;
@@ -137,7 +136,6 @@ CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
     }
     self->parent     = NULL;
     self->tree_grown = false;
-    self->autocode   = (char*)CALLOCATE(1, sizeof(char));
     self->children        = (CFCClass**)CALLOCATE(1, sizeof(CFCClass*));
     self->num_kids        = 0;
     self->functions       = (CFCFunction**)CALLOCATE(1, sizeof(CFCFunction*));
@@ -248,7 +246,6 @@ CFCClass_destroy(CFCClass *self) {
     FREEMEM(self->member_vars);
     FREEMEM(self->inert_vars);
     FREEMEM(self->attributes);
-    FREEMEM(self->autocode);
     FREEMEM(self->parent_class_name);
     FREEMEM(self->struct_sym);
     FREEMEM(self->ivars_struct);
@@ -768,18 +765,6 @@ CFCClass_get_parent(CFCClass *self) {
     return self->parent;
 }
 
-void
-CFCClass_append_autocode(CFCClass *self, const char *autocode) {
-    size_t size = strlen(self->autocode) + strlen(autocode) + 1;
-    self->autocode = (char*)REALLOCATE(self->autocode, size);
-    strcat(self->autocode, autocode);
-}
-
-const char*
-CFCClass_get_autocode(CFCClass *self) {
-    return self->autocode;
-}
-
 const char*
 CFCClass_get_path_part(CFCClass *self) {
     return self->file_spec ? CFCFileSpec_get_path_part(self->file_spec) : NULL;

http://git-wip-us.apache.org/repos/asf/lucy/blob/251d2bcc/clownfish/compiler/src/CFCClass.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCClass.h b/clownfish/compiler/src/CFCClass.h
index e247e3d..a26c9c3 100644
--- a/clownfish/compiler/src/CFCClass.h
+++ b/clownfish/compiler/src/CFCClass.h
@@ -218,14 +218,6 @@ CFCClass_set_parent(CFCClass *self, CFCClass *parent);
 CFCClass*
 CFCClass_get_parent(CFCClass *self);
 
-/** Append auxiliary C code.
- */
-void
-CFCClass_append_autocode(CFCClass *self, const char *autocode);
-
-const char*
-CFCClass_get_autocode(CFCClass *self);
-
 const char*
 CFCClass_get_path_part(CFCClass *self);
 


Mime
View raw message