drop struct text_object field f
authorPhil Sutter <phil@nwl.cc>
Sun, 25 Oct 2009 21:47:53 +0000 (22:47 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 3 Nov 2009 22:23:23 +0000 (23:23 +0100)
src/exec.c
src/text_object.h

index 90d3d48..3f3297d 100644 (file)
@@ -45,6 +45,7 @@ struct execi_data {
        char *buffer;
        double data;
        timed_thread *p_timed_thread;
+       float barnum;
 };
 
 /* FIXME: this will probably not work, since the variable is being reused
@@ -398,11 +399,11 @@ void print_execigraph(struct text_object *obj, char *p, int p_max_size)
                barnum = get_barnum(p);
 
                if (barnum >= 0.0) {
-                       obj->f = barnum;
+                       ed->barnum = barnum;
                }
                ed->last_update = current_update_time;
        }
-       new_graph(obj, p, (int) (obj->f));
+       new_graph(obj, p, (int) (ed->barnum));
 }
 
 void print_execigauge(struct text_object *obj, char *p, int p_max_size)
@@ -419,11 +420,11 @@ void print_execigauge(struct text_object *obj, char *p, int p_max_size)
                barnum = get_barnum(p);
 
                if (barnum >= 0.0) {
-                       obj->f = 255 * barnum / 100.0;
+                       ed->barnum = 255 * barnum / 100.0;
                }
                ed->last_update = current_update_time;
        }
-       new_gauge(obj, p, round_to_int(obj->f));
+       new_gauge(obj, p, round_to_int(ed->barnum));
 }
 #endif /* X11 */
 
@@ -457,16 +458,16 @@ void print_execibar(struct text_object *obj, char *p, int p_max_size)
                barnum = get_barnum(p);
 
                if (barnum >= 0.0) {
-                       obj->f = barnum;
+                       ed->barnum = barnum;
                }
                ed->last_update = current_update_time;
        }
 #ifdef X11
        if(output_methods & TO_X) {
-               new_bar(obj, p, round_to_int(obj->f * 2.55));
+               new_bar(obj, p, round_to_int(ed->barnum * 2.55));
        } else
 #endif /* X11 */
-               new_bar_in_shell(obj, p, p_max_size, round_to_int(obj->f));
+               new_bar_in_shell(obj, p, p_max_size, round_to_int(ed->barnum));
 }
 
 void free_exec(struct text_object *obj)
index 3395abc..588c8e5 100644 (file)
@@ -434,7 +434,7 @@ struct text_object {
                void *opaque;           /* new style generic per object data */
                char *s;                /* some string */
                int i;                  /* some integer */
-               long l;                 /* some other integer */
+               long l;                 /* some long integer */
 
                struct {
                        void *opaque;   /* temporary workaround to not blow stuff */
@@ -455,7 +455,6 @@ struct text_object {
        int a, b;
        long line;
        unsigned int c, d, e;
-       float f;
        char char_a, char_b;
 };