Ignore:
Timestamp:
Jul 26, 2009, 9:17:28 PM (11 years ago)
Author:
Sam Hocevar
Message:

Coding style: remove tabs and trailing spaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/tests/bench.c

    r3573 r3582  
     1/*
     2 *  libcaca benchmark program
     3 *  Copyright (c) 2009 Pascal Terjan <pterjan@linuxfr.org>
     4 *                2009 Sam Hocevar <sam@hocevar.net>
     5 *
     6 *  This library is free software. It comes without any warranty, to
     7 *  the extent permitted by applicable law. You can redistribute it
     8 *  and/or modify it under the terms of the Do What The Fuck You Want
     9 *  To Public License, Version 2, as published by Sam Hocevar. See
     10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
     11 */
     12
    113#include "config.h"
    214
     
    416
    517#include "caca.h"
     18
     19#define BLIT_LOOPS 1000000
     20#define PUTCHAR_LOOPS 50000000
    621
    722#define TIME(desc, code) \
     
    2338    cv2 = caca_create_canvas(16, 16);
    2439    caca_fill_box(cv2, 0, 0, 16, 16, 'x');
    25     for (i=0; i<1000000; i++) {
    26       if(clear)
    27               caca_clear_canvas(cv);
    28       caca_blit(cv, 1, 1, cv2, mask?cv2:NULL);
     40    for (i = 0; i < BLIT_LOOPS; i++)
     41    {
     42        if(clear)
     43            caca_clear_canvas(cv);
     44        caca_blit(cv, 1, 1, cv2, mask ? cv2 : NULL);
    2945    }
    3046    caca_free_canvas(cv);
     
    3753    int i;
    3854    cv = caca_create_canvas(40, 40);
    39     for (i=0; i<50000000; i++) {
    40       caca_put_char(cv, 1, 1, 'x');
    41       caca_put_char(cv, 1, 1, 'o');
     55    for (i = 0; i < PUTCHAR_LOOPS; i++)
     56    {
     57        caca_put_char(cv, 1, 1, 'x');
     58        caca_put_char(cv, 1, 1, 'o');
    4259    }
    4360    caca_free_canvas(cv);
     
    4663int main(int argc, char *argv[])
    4764{
    48     TIME("blit no mask, no clear",blit(0, 0));
    49     TIME("blit no mask, clear",blit(0, 1));
    50     TIME("blit mask, no clear",blit(1, 0));
    51     TIME("blit mask, clear",blit(1, 1));
    52     TIME("putchars",putchars());
     65    TIME("blit no mask, no clear", blit(0, 0));
     66    TIME("blit no mask, clear", blit(0, 1));
     67    TIME("blit mask, no clear", blit(1, 0));
     68    TIME("blit mask, clear", blit(1, 1));
     69    TIME("putchars", putchars());
    5370    return 0;
    5471}
Note: See TracChangeset for help on using the changeset viewer.