engines/libaio: remove remnants of abandoned aio features
[fio.git] / goptions.c
index 21d642771be3ad881b35bd23aec07c2a146f4b8e..f44254bf38df5dcea4f0c5ca08f0bc3c3608d531 100644 (file)
@@ -1,5 +1,5 @@
 #include <locale.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <glib.h>
@@ -11,6 +11,7 @@
 #include "ghelpers.h"
 #include "gerror.h"
 #include "parse.h"
+#include "optgroup.h"
 
 struct gopt {
        GtkWidget *box;
@@ -92,10 +93,10 @@ struct gopt_job_view {
 static GNode *gopt_dep_tree;
 
 static GtkWidget *gopt_get_group_frame(struct gopt_job_view *gjv,
-                                      GtkWidget *box, unsigned int groupmask)
+                                      GtkWidget *box, uint64_t groupmask)
 {
-       unsigned int mask, group;
-       struct opt_group *og;
+       uint64_t mask, group;
+       const struct opt_group *og;
        GtkWidget *frame, *hbox;
        struct gopt_frame_widget *gfw;
 
@@ -107,7 +108,7 @@ static GtkWidget *gopt_get_group_frame(struct gopt_job_view *gjv,
        if (!og)
                return NULL;
 
-       group = ffz(~groupmask);
+       group = ffz64(~groupmask);
        gfw = &gjv->g_widgets[group];
        if (!gfw->vbox[0]) {
                frame = gtk_frame_new(og->name);
@@ -825,7 +826,7 @@ static struct gopt *gopt_new_str_val(struct gopt_job_view *gjv,
                                     unsigned long long *p, unsigned int idx)
 {
        struct gopt_str_val *g;
-       const gchar *postfix[] = { "B", "KB", "MB", "GB", "PB", "TB", "" };
+       const gchar *postfix[] = { "B", "KiB", "MiB", "GiB", "PiB", "PiB", "" };
        GtkWidget *label;
        int i;
 
@@ -1135,11 +1136,11 @@ static void gopt_add_options(struct gopt_job_view *gjv,
         */
        for (i = 0; fio_options[i].name; i++) {
                struct fio_option *o = &fio_options[i];
-               unsigned int mask = o->category;
-               struct opt_group *og;
+               uint64_t mask = o->category;
+               const struct opt_group *og;
 
                while ((og = opt_group_from_mask(&mask)) != NULL) {
-                       GtkWidget *vbox = gjv->vboxes[ffz(~og->mask)];
+                       GtkWidget *vbox = gjv->vboxes[ffz64(~og->mask)];
 
                        hbox = gtk_hbox_new(FALSE, 3);
                        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
@@ -1177,19 +1178,20 @@ static GtkWidget *gopt_add_tab(GtkWidget *notebook, const char *name)
        return vbox;
 }
 
-static GtkWidget *gopt_add_group_tab(GtkWidget *notebook, struct opt_group *og)
+static GtkWidget *gopt_add_group_tab(GtkWidget *notebook,
+                                    const struct opt_group *og)
 {
        return gopt_add_tab(notebook, og->name);
 }
 
 static void gopt_add_group_tabs(GtkWidget *notebook, struct gopt_job_view *gjv)
 {
-       struct opt_group *og;
+       const struct opt_group *og;
        unsigned int i;
 
        i = 0;
        do {
-               unsigned int mask = (1U << i);
+               uint64_t mask = (1ULL << i);
 
                og = opt_group_from_mask(&mask);
                if (!og)
@@ -1216,7 +1218,7 @@ static void gopt_handle_str_multi_changed(struct gopt_job_view *gjv,
                        break;
                set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m->checks[i]));
                if (set) {
-                       if (vp->or)
+                       if (vp->orval)
                                val |= vp->oval;
                        else
                                val = vp->oval;
@@ -1433,7 +1435,7 @@ static int gopt_handle_changed_options(struct gopt_job_view *gjv)
                goto done;
 
        while (!flist_empty(&gjv->changed_list)) {
-               gopt = flist_entry(gjv->changed_list.next, struct gopt, changed_list);
+               gopt = flist_first_entry(&gjv->changed_list, struct gopt, changed_list);
                flist_del_init(&gopt->changed_list);
        }
 
@@ -1577,7 +1579,7 @@ void gopt_get_options_window(GtkWidget *window, struct gfio_client *gc)
 
        gjv = calloc(1, sizeof(*gjv));
        INIT_FLIST_HEAD(&gjv->changed_list);
-       gco = flist_entry(gc->o_list.next, struct gfio_client_options, list);
+       gco = flist_first_entry(&gc->o_list, struct gfio_client_options, list);
        gjv->o = &gco->o;
        gjv->dialog = dialog;
        gjv->client = gc;