Fixes for 32-bit compile
authorJens Axboe <axboe@kernel.dk>
Thu, 22 Mar 2012 20:31:00 +0000 (21:31 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Mar 2012 20:31:00 +0000 (21:31 +0100)
- uint32/64 casting
- Real bug fix in types[] index beyond length.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
gclient.c
iolog.c

index deb20f06185c330d244be5347f75f25c4833392f..3e4c348337d90b7b2f5ddf37feabc812a0c71cbe 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -115,7 +115,7 @@ static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd)
        sec = p->log_sec;
        tm = localtime(&sec);
        strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", tm);
        sec = p->log_sec;
        tm = localtime(&sec);
        strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", tm);
-       sprintf(timebuf, "%s.%03ld", tmp, p->log_usec / 1000);
+       sprintf(timebuf, "%s.%03ld", tmp, (long) p->log_usec / 1000);
 
        gdk_threads_enter();
 
 
        gdk_threads_enter();
 
@@ -733,10 +733,10 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts)
        GtkWidget *frame, *box, *tree_view = NULL;
        GtkTreeSelection *selection;
        GtkListStore *model;
        GtkWidget *frame, *box, *tree_view = NULL;
        GtkTreeSelection *selection;
        GtkListStore *model;
-       GType types[FIO_IO_U_MAP_NR + 1];
        int i;
        const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" };
        const int nr_labels = ARRAY_SIZE(labels);
        int i;
        const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" };
        const int nr_labels = ARRAY_SIZE(labels);
+       GType types[nr_labels];
 
        frame = gtk_frame_new("IO depths");
        gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
 
        frame = gtk_frame_new("IO depths");
        gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
diff --git a/iolog.c b/iolog.c
index 7b212bb598f124c3ce745e8f08918d4d0efd4f4d..4818cd4593b2e0c9d000f7d001b86cf2ee416e17 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -517,10 +517,10 @@ void __finish_log(struct io_log *log, const char *name)
        }
 
        for (i = 0; i < log->nr_samples; i++) {
        }
 
        for (i = 0; i < log->nr_samples; i++) {
-               fprintf(f, "%lu, %lu, %u, %u\n", log->log[i].time,
-                                               log->log[i].val,
-                                               log->log[i].ddir,
-                                               log->log[i].bs);
+               fprintf(f, "%lu, %lu, %u, %u\n",
+                               (unsigned long) log->log[i].time,
+                               (unsigned long) log->log[i].val,
+                               log->log[i].ddir, log->log[i].bs);
        }
 
        fclose(f);
        }
 
        fclose(f);