Changeset e435537 in mainline for uspace


Ignore:
Timestamp:
2012-07-17T15:14:01Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a00d555
Parents:
9904eb90 (diff), dfc07c1 (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.
Message:

cstyle

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r9904eb90 re435537  
    176176
    177177        bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0);
    178 
     178       
    179179        if (reading_stdin) {
    180180                fd = fileno(stdin);
    181181                /* Allow storing the whole UTF-8 character. */
    182182                blen = STR_BOUNDS(1);
    183         } else {
     183        } else
    184184                fd = open(fname, O_RDONLY);
    185         }
     185       
    186186        if (fd < 0) {
    187187                printf("Unable to open %s\n", fname);
     
    222222                        bytes_to_read = 1;
    223223                } else {
    224                         if ((length != CAT_FULL_FILE)
    225                             && (length - (off64_t)count <= (off64_t)(blen - copied_bytes))) {
     224                        if ((length != CAT_FULL_FILE) &&
     225                            (length - (off64_t)count <= (off64_t)(blen - copied_bytes))) {
    226226                                bytes_to_read = (size_t) (length - count);
    227227                        } else {
     
    229229                        }
    230230                }
     231               
    231232                bytes = read(fd, buff + copied_bytes, bytes_to_read);
    232233                bytes += copied_bytes;
     
    261262                        reads++;
    262263                }
    263 
    264                 if (reading_stdin) {
     264               
     265                if (reading_stdin)
    265266                        fflush(stdout);
    266                 }
    267267        } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE));
    268268
  • uspace/srv/hid/console/console.c

    r9904eb90 re435537  
    617617       
    618618        size_t pos = 0;
    619 
     619       
    620620        /*
    621621         * Read input from keyboard and copy it to the buffer.
     
    628628                        buf[pos] = cons->char_remains[0];
    629629                        pos++;
     630                       
    630631                        /* Unshift the array. */
    631                         for (size_t i = 1; i < cons->char_remains_len; i++) {
     632                        for (size_t i = 1; i < cons->char_remains_len; i++)
    632633                                cons->char_remains[i - 1] = cons->char_remains[i];
    633                         }
     634                       
    634635                        cons->char_remains_len--;
    635636                }
     637               
    636638                /* Still not enough? Then get another key from the queue. */
    637639                if (pos < size) {
    638640                        link_t *link = prodcons_consume(&cons->input_pc);
    639641                        kbd_event_t *event = list_get_instance(link, kbd_event_t, link);
    640 
     642                       
    641643                        /* Accept key presses of printable chars only. */
    642644                        if ((event->type == KEY_PRESS) && (event->c != 0)) {
     
    645647                                cons->char_remains_len = str_size(cons->char_remains);
    646648                        }
    647 
     649                       
    648650                        free(event);
    649651                }
Note: See TracChangeset for help on using the changeset viewer.