Fix tar.gz build by removing legacy include to ltt directory
[lttv.git] / lttv / lttv / attribute.c
index 80126a5e167eb1c717c856a8888be03f2e54ec96..57c6d33285e930a668bac8996bea3eb62f0714bc 100644 (file)
@@ -22,8 +22,7 @@
 
 #include <string.h>
 #include <lttv/attribute.h>
-#include <ltt/ltt.h>
-#include <ltt/compiler.h>
+#include <lttv/compiler.h>
 
 typedef union _AttributeValue {
        int dv_int;
@@ -50,7 +49,7 @@ typedef struct _Attribute {
 static __inline__ LttvAttributeValue
 address_of_value(LttvAttributeType t, AttributeValue *v)
 {
-       LttvAttributeValue va;
+       LttvAttributeValue va = { NULL };       /* init to NULL for gcc */
 
        switch(t) {
                case LTTV_INT: va.v_int = &v->dv_int; break;
@@ -487,13 +486,15 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE *fp)
 
        LttvAttribute *subtree;
 
-       fscanf(fp,"<ATTRS>");
+       res = fscanf(fp, "<ATTRS>");
+       g_assert(res > 0);
        while(1) {
                res = fscanf(fp, "<ATTR NAME=\"%256[^\"]\" TYPE=%10[^ >]", buffer, type);
                g_assert(res == 2);
                name = g_quark_from_string(buffer);
                if(strcmp(type, "ATTRS") == 0) {
-                       fscanf(fp, ">");
+                       res = fscanf(fp, ">");
+                       g_assert(res > 0);
                        subtree = lttv_attribute_find_subdir(self, name);
                        lttv_attribute_read_xml(subtree, fp);
                }
@@ -553,11 +554,13 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE *fp)
                }
                else if(strcmp(type, "NONE") == 0) {
                        value = lttv_attribute_add(self, name, LTTV_NONE);
-                       fscanf(fp, "/>");
+                       res = fscanf(fp, "/>");
+                       g_assert(res > 0);
                }
                else g_error("Unknown type to read");
        }
-       fscanf(fp,"</ATTRS>");
+       res = fscanf(fp, "</ATTRS>");
+       g_assert(res > 0);
 }
 
 static LttvAttribute *
This page took 0.023722 seconds and 4 git commands to generate.