Changeset 8565a42 in mainline for uspace/app/bnchmark


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bnchmark/bnchmark.c

    r3061bc1 r8565a42  
    6464        struct timeval start_time;
    6565        gettimeofday(&start_time, NULL);
    66        
     66
    6767        errno_t rc = fn(data);
    6868        if (rc != EOK) {
     
    7070                return rc;
    7171        }
    72        
     72
    7373        struct timeval final_time;
    7474        gettimeofday(&final_time, NULL);
    75        
     75
    7676        /* Calculate time difference in milliseconds */
    7777        *result = ((final_time.tv_usec - start_time.tv_usec) / 1000) +
     
    8484        char *path = (char *) data;
    8585        char *buf = malloc(BUFSIZE);
    86        
     86
    8787        if (buf == NULL)
    8888                return ENOMEM;
    89        
     89
    9090        FILE *file = fopen(path, "r");
    9191        if (file == NULL) {
     
    9494                return EIO;
    9595        }
    96        
     96
    9797        while (!feof(file)) {
    9898                fread(buf, 1, BUFSIZE, file);
     
    104104                }
    105105        }
    106        
     106
    107107        fclose(file);
    108108        free(buf);
     
    113113{
    114114        char *path = (char *) data;
    115        
     115
    116116        DIR *dir = opendir(path);
    117117        if (dir == NULL) {
     
    121121
    122122        struct dirent *dp;
    123        
     123
    124124        while ((dp = readdir(dir))) {
    125125                /* Do nothing */
    126126        }
    127        
     127
    128128        closedir(dir);
    129129        return EOK;
     
    141141        char *test_type = NULL;
    142142        char *endptr;
    143        
     143
    144144        if (argc < 5) {
    145145                fprintf(stderr, NAME ": Error, argument missing.\n");
     
    147147                return 1;
    148148        }
    149        
     149
    150150        if (argc > 5) {
    151151                fprintf(stderr, NAME ": Error, too many arguments.\n");
     
    153153                return 1;
    154154        }
    155        
     155
    156156        // Skip program name
    157157        --argc; ++argv;
     
    163163                return 1;
    164164        }
    165        
     165
    166166        --argc; ++argv;
    167167        test_type = *argv;
     
    172172        --argc; ++argv;
    173173        path = *argv;
    174        
     174
    175175        if (str_cmp(test_type, "sequential-file-read") == 0) {
    176176                fn = sequential_read_file;
     
    191191                        return 1;
    192192                }
    193        
     193
    194194                printf("%s;%s;%s;%lu;ms\n", test_type, path, log_str, milliseconds_taken);
    195195        }
Note: See TracChangeset for help on using the changeset viewer.