/alps/fwbench

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/fwbench

« back to all changes in this revision

Viewing changes to fwbench.c

  • Committer: Suren A. Chilingaryan
  • Date: 2012-03-08 02:44:56 UTC
  • Revision ID: csa@dside.dyndns.org-20120308024456-nleuyd2tiz0sz7zv
Fix handling of size argument

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
"   -n frames           - Number of frames to write\n"
112
112
"   -g <width>x<height> - Geometry [1024]\n"
113
113
"   -g <pixels>         - Number of megapixels [0.7]\n"
114
 
"   -m <percent>        - Tolerable missing frames  [100%%]\n"
 
114
"   -m <percent>                - Tolerable missing frames  [100%%]\n"
115
115
"   -q                  - Quiete\n"
116
116
"   -h                  - Help\n"
117
117
"\n\n",
173
173
}
174
174
 
175
175
static void set_size(setup_t *setup, size_t size) {
176
 
    setup->iters = size / setup->frame_size + (size % setup->frame_size)?1:0;
 
176
    setup->iters = size / setup->frame_size + ((size % setup->frame_size)?1:0);
177
177
}
178
178
 
179
179
static void set_frames_per_file(setup_t *setup, size_t fpf) {
521
521
        result = read(fd, buffer, setup.frame_size - setup.num_read);
522
522
    }
523
523
 
524
 
    printf("Wrote %lu GB\n", setup.frame_size * setup.frames / 1024 / 1024 / 1024);
 
524
    if (!quiet)
 
525
        printf("Wrote %lu GB\n", setup.frame_size * setup.frames / 1024 / 1024 / 1024);
525
526
 
526
527
    g_thread_join(thr);
527
528