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/07/30 12:02:25 UTC
[lucy-commits] [1/2] git commit: refs/heads/cfc-pod - Better fix for double-free in
CFCPerlClass
Updated Branches:
refs/heads/cfc-pod 82fa89370 -> 58f9153df
Better fix for double-free in CFCPerlClass
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/31524da4
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/31524da4
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/31524da4
Branch: refs/heads/cfc-pod
Commit: 31524da43bd565a7391b94b84b5a64e67eac528b
Parents: 82fa893
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jul 30 11:38:53 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jul 30 11:38:53 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/src/CFCPerlClass.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/31524da4/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index a3c8670..6e9d48b 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -75,7 +75,8 @@ CFCPerlClass_init(CFCPerlClass *self, CFCParcel *parcel,
self->parcel = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
self->class_name = CFCUtil_strdup(class_name);
// Client may be NULL, since fetch_singleton() does not always succeed.
- self->client = CFCClass_fetch_singleton(parcel, class_name);
+ CFCClass *client = CFCClass_fetch_singleton(parcel, class_name);
+ self->client = (CFCClass*)CFCBase_incref((CFCBase*)client);
self->pod_spec = NULL;
self->xs_code = NULL;
self->cons_aliases = NULL;
@@ -90,6 +91,7 @@ CFCPerlClass_init(CFCPerlClass *self, CFCParcel *parcel,
void
CFCPerlClass_destroy(CFCPerlClass *self) {
CFCBase_decref((CFCBase*)self->parcel);
+ CFCBase_decref((CFCBase*)self->client);
CFCBase_decref((CFCBase*)self->pod_spec);
FREEMEM(self->class_name);
FREEMEM(self->xs_code);
[lucy-commits] [2/2] git commit: refs/heads/cfc-pod - Omit empty description
sections in pod
Posted by nw...@apache.org.
Omit empty description sections in pod
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/58f9153d
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/58f9153d
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/58f9153d
Branch: refs/heads/cfc-pod
Commit: 58f9153df61f17a711bb60621c2c8304124e8770
Parents: 31524da
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jul 30 11:50:12 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jul 30 12:01:45 2013 +0200
----------------------------------------------------------------------
clownfish/compiler/src/CFCPerlClass.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/58f9153d/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index 6e9d48b..6cc6724 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -409,13 +409,6 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
const char *raw_brief = CFCDocuComment_get_brief(docucom);
char *brief = CFCPerlPod_perlify_doc_text(pod_spec, raw_brief);
- // Get the class's long description.
- const char *raw_description = CFCPerlPod_get_description(pod_spec);
- if (!raw_description || !strlen(raw_description)) {
- raw_description = CFCDocuComment_get_long(docucom);
- }
- char *description = CFCPerlPod_perlify_doc_text(pod_spec, raw_description);
-
// Create SYNOPSIS.
const char *raw_synopsis = CFCPerlPod_get_synopsis(pod_spec);
char *synopsis = CFCUtil_strdup("");
@@ -424,6 +417,20 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
"\n", NULL);
}
+ // Create DESCRIPTION.
+ const char *raw_description = CFCPerlPod_get_description(pod_spec);
+ if (!raw_description || !strlen(raw_description)) {
+ raw_description = CFCDocuComment_get_long(docucom);
+ }
+ char *description = CFCUtil_strdup("");
+ if (raw_description && strlen(raw_description)) {
+ char *desc_text
+ = CFCPerlPod_perlify_doc_text(pod_spec, raw_description);
+ description = CFCUtil_cat(description, "=head1 DESCRIPTION\n\n",
+ desc_text, "\n", NULL);
+ FREEMEM(desc_text);
+ }
+
// Create CONSTRUCTORS.
char *constructor_pod = CFCPerlPod_constructors_pod(pod_spec, client);
@@ -475,8 +482,6 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
"\n"
"%s\n"
"\n"
- "=head1 DESCRIPTION\n"
- "\n"
"%s\n"
"\n"
"%s\n"