projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-svn-id: http://ltt.polymtl.ca/svn@247 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
traceset.c
diff --git
a/ltt/branches/poly/lttv/traceset.c
b/ltt/branches/poly/lttv/traceset.c
index ab04a4ee4937df5b63e7acc98bc51f0feab76570..85e33225bb95e252b2b85e6cfc6cc4f499e87b5b 100644
(file)
--- a/
ltt/branches/poly/lttv/traceset.c
+++ b/
ltt/branches/poly/lttv/traceset.c
@@
-14,55
+14,57
@@
struct _LttvTraceset {
};
};
-LttvTraceset *lttv_trace
_
set_new()
+LttvTraceset *lttv_traceset_new()
{
{
- LttvTraceset s;
+ LttvTraceset
*
s;
s = g_new(LttvTraceset, 1);
s->traces = g_ptr_array_new();
s->attributes = g_ptr_array_new();
s = g_new(LttvTraceset, 1);
s->traces = g_ptr_array_new();
s->attributes = g_ptr_array_new();
- s->a = g_object_new(LTTV_ATTRIBUTE_TYPE);
+ s->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+ return s;
}
}
-
LttvTraceset *
lttv_traceset_destroy(LttvTraceset *s)
+
void
lttv_traceset_destroy(LttvTraceset *s)
{
int i, nb;
for(i = 0 ; i < s->attributes->len ; i++) {
{
int i, nb;
for(i = 0 ; i < s->attributes->len ; i++) {
-
lttv_attribute_free((lttv_attributes
*)s->attributes->pdata[i]);
+
g_object_unref((LttvAttribute
*)s->attributes->pdata[i]);
}
}
- g_ptr_array_free(s->attributes);
- g_ptr_array_free(s->traces);
-
lttv_attribute_free
(s->a);
-
return
g_free(s);
+ g_ptr_array_free(s->attributes
, TRUE
);
+ g_ptr_array_free(s->traces
, TRUE
);
+
g_object_unref
(s->a);
+ g_free(s);
}
void lttv_traceset_add(LttvTraceset *s, LttTrace *t)
{
g_ptr_array_add(s->traces, t);
}
void lttv_traceset_add(LttvTraceset *s, LttTrace *t)
{
g_ptr_array_add(s->traces, t);
- g_ptr_array_add(s->attributes, g_object_new(LTTV_ATTRIBUTE_TYPE));
+ g_ptr_array_add(s->attributes, g_object_new(LTTV_ATTRIBUTE_TYPE
, NULL
));
}
unsigned lttv_traceset_number(LttvTraceset *s)
{
}
unsigned lttv_traceset_number(LttvTraceset *s)
{
- return s->traces
.
len;
+ return s->traces
->
len;
}
LttTrace *lttv_traceset_get(LttvTraceset *s, unsigned i)
{
g_assert(s->traces->len > i);
}
LttTrace *lttv_traceset_get(LttvTraceset *s, unsigned i)
{
g_assert(s->traces->len > i);
- return ((LttTrace *)s->traces
.
pdata[i]);
+ return ((LttTrace *)s->traces
->
pdata[i]);
}
}
-
LttTrace *
lttv_traceset_remove(LttvTraceset *s, unsigned i)
+
void
lttv_traceset_remove(LttvTraceset *s, unsigned i)
{
{
- return g_ptr_array_remove_index(s->traces, i);
- lttv_attribute_free(g_ptr_array_remove_index(s->attributes,i));
+ g_ptr_array_remove_index(s->traces, i);
+ g_object_unref(s->attributes->pdata[i]);
+ g_ptr_array_remove_index(s->attributes,i);
}
}
@@
-77,7
+79,5
@@
LttvAttribute *lttv_traceset_attribute(LttvTraceset *s)
LttvAttribute *lttv_traceset_trace_attribute(LttvTraceset *s, unsigned i)
{
LttvAttribute *lttv_traceset_trace_attribute(LttvTraceset *s, unsigned i)
{
- return (LttAttribute *)s->attributes->pdata[i];
+ return (Ltt
v
Attribute *)s->attributes->pdata[i];
}
}
-
-
This page took
0.024491 seconds
and
4
git commands to generate.