*/
#include <babeltrace/ctf-ir/clock-internal.h>
+#include <babeltrace/ctf-ir/utils.h>
#include <babeltrace/ctf-writer/writer-internal.h>
#include <babeltrace/compiler.h>
#include <inttypes.h>
{
int ret = 0;
- if (validate_identifier(name)) {
+ if (bt_ctf_validate_identifier(name)) {
ret = -1;
goto end;
}
if (clock->name) {
- g_string_free(clock->name, TRUE);
+ g_string_assign(clock->name, name);
+ } else {
+ clock->name = g_string_new(name);
+ if (!clock->name) {
+ ret = -1;
+ goto end;
+ }
}
- clock->name = g_string_new(name);
- if (!clock->name) {
- ret = -1;
- goto end;
- }
end:
return ret;
}
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
- if (clock->description->len) {
+ if (clock->description) {
g_string_append_printf(context->string, "\tdescription = \"%s\";\n",
clock->description->str);
}