Changes in / [e435537:dfc07c1] in mainline


Ignore:
Files:
14 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    re435537 rdfc07c1  
    9898        $(USPACE_PATH)/srv/bd/part/guid_part/g_part \
    9999        $(USPACE_PATH)/srv/bd/part/mbr_part/mbr_part \
    100         $(USPACE_PATH)/srv/bd/sata_bd/sata_bd \
    101100        $(USPACE_PATH)/srv/clipboard/clipboard \
    102101        $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \
     
    123122        nic/ne2k \
    124123        nic/e1k \
    125         nic/rtl8139 \
    126         block/ahci
     124        nic/rtl8139
    127125
    128126RD_DRV_CFG =
  • kernel/generic/src/console/kconsole.c

    re435537 rdfc07c1  
    202202 *
    203203 */
    204 NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev)
     204NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t * indev)
    205205{
    206206        const char *name = input;
    207207       
    208208        size_t found = 0;
    209        
    210         /*
    211          * Maximum Match Length: Length of longest matching common
    212          * substring in case more than one match is found.
    213          */
     209        /* Maximum Match Length : Length of longest matching common substring in
     210           case more than one match is found */
    214211        size_t max_match_len = size;
    215212        size_t max_match_len_tmp = size;
     
    232229        }
    233230       
    234         /*
    235          * If the number of possible completions is more than MAX_TAB_HINTS,
    236          * ask the user whether to display them or not.
    237          */
     231        /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */
    238232        if (found > MAX_TAB_HINTS) {
    239233                printf("\n");
    240                 continue_showing_hints =
    241                     console_prompt_display_all_hints(indev, found);
     234                continue_showing_hints = console_prompt_display_all_hints(indev, found);
    242235        }
    243236       
     
    247240                while (cmdtab_search_one(name, &pos)) {
    248241                        cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link);
    249                        
     242
    250243                        if (continue_showing_hints) {
    251244                                printf("%s (%s)\n", hlp->name, hlp->description);
    252245                                --hints_to_show;
    253246                                ++total_hints_shown;
    254                                
    255                                 if ((hints_to_show == 0) && (total_hints_shown != found)) {
    256                                         /* Ask user to continue */
    257                                         continue_showing_hints =
    258                                             console_prompt_more_hints(indev, &hints_to_show);
     247
     248                                if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */
     249                                        continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show);
    259250                                }
    260251                        }
    261                        
     252
    262253                        pos = pos->next;
    263                        
    264                         for (max_match_len_tmp = 0;
    265                             (output[max_match_len_tmp] ==
    266                             hlp->name[input_len + max_match_len_tmp]) &&
    267                             (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
    268                        
     254                        for(max_match_len_tmp = 0; output[max_match_len_tmp] == hlp->name[input_len + max_match_len_tmp]
     255                                        && max_match_len_tmp < max_match_len; ++max_match_len_tmp);
    269256                        max_match_len = max_match_len_tmp;
    270257                }
    271                
    272                 /* Keep only the characters common in all completions */
     258                /* keep only the characters common in all completions */
    273259                output[max_match_len] = 0;
    274260        }
     
    324310                                continue;
    325311                       
    326                         /*
    327                          * Find the beginning of the word
    328                          * and copy it to tmp
    329                          */
     312                        /* Find the beginning of the word
     313                           and copy it to tmp */
    330314                        size_t beg;
    331315                        for (beg = position - 1; (beg > 0) && (!isspace(current[beg]));
     
    349333                                continue;
    350334
    351                         /*
    352                          * We have hints, possibly many. In case of more than one hint,
    353                          * tmp will contain the common prefix.
    354                          */
     335                        /* We have hints, may be many. In case of more than one hint,
     336                           tmp will contain the common prefix. */
    355337                        size_t off = 0;
    356338                        size_t i = 0;
     
    358340                                if (!wstr_linsert(current, ch, position + i, MAX_CMDLINE))
    359341                                        break;
    360                                
    361342                                i++;
    362343                        }
  • kernel/generic/src/debug/symtab.c

    re435537 rdfc07c1  
    210210 *
    211211 */
    212 int symtab_compl(char *input, size_t size, indev_t *indev)
     212int symtab_compl(char *input, size_t size, indev_t * indev)
    213213{
    214214#ifdef CONFIG_SYMTAB
     
    227227        const char *hint;
    228228        char output[MAX_SYMBOL_NAME];
    229        
    230         /*
    231          * Maximum Match Length: Length of longest matching common substring in
    232          * case more than one match is found.
    233          */
     229        /* Maximum Match Length : Length of longest matching common substring in
     230           case more than one match is found */
    234231        size_t max_match_len = size;
    235232        size_t max_match_len_tmp = size;
     
    241238       
    242239        output[0] = 0;
    243        
    244         while ((hint = symtab_search_one(name, &pos)))
    245                 pos++;
    246        
     240
     241        while ((hint = symtab_search_one(name, &pos))) {
     242                ++pos;
     243        }
     244
    247245        pos = 0;
    248246       
     
    255253        }
    256254       
    257         /*
    258          * If the number of possible completions is more than MAX_TAB_HINTS,
    259          * ask the user whether to display them or not.
    260          */
     255        /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */
    261256        if (found > MAX_TAB_HINTS) {
    262257                printf("\n");
    263                 continue_showing_hints =
    264                     console_prompt_display_all_hints(indev, found);
     258                continue_showing_hints = console_prompt_display_all_hints(indev, found);
    265259        }
    266260       
     
    271265                        sym_name = symbol_table[pos].symbol_name;
    272266                        pos++;
    273                        
    274                         if (continue_showing_hints) {
    275                                 /* We are still showing hints */
     267
     268                        if (continue_showing_hints) { /* We are still showing hints */
    276269                                printf("%s\n", sym_name);
    277270                                --hints_to_show;
    278271                                ++total_hints_shown;
    279                                
    280                                 if ((hints_to_show == 0) && (total_hints_shown != found)) {
    281                                         /* Ask the user to continue */
    282                                         continue_showing_hints =
    283                                             console_prompt_more_hints(indev, &hints_to_show);
     272
     273                                if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */
     274                                        continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show);
    284275                                }
    285276                        }
    286                        
    287                         for (max_match_len_tmp = 0;
    288                             (output[max_match_len_tmp] ==
    289                             sym_name[input_len + max_match_len_tmp]) &&
    290                             (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
    291                        
     277
     278                        for(max_match_len_tmp = 0; output[max_match_len_tmp] == sym_name[input_len + max_match_len_tmp]
     279                                        && max_match_len_tmp < max_match_len; ++max_match_len_tmp);
    292280                        max_match_len = max_match_len_tmp;
    293281                }
    294                
    295                 /* Keep only the characters common in all completions */
     282                /* keep only the characters common in all completions */
    296283                output[max_match_len] = 0;
    297284        }
  • uspace/Makefile

    re435537 rdfc07c1  
    8585        srv/vfs \
    8686        srv/bd/ata_bd \
    87         srv/bd/sata_bd \
    8887        srv/bd/file_bd \
    8988        srv/bd/gxe_bd \
     
    106105        drv/infrastructure/root \
    107106        drv/infrastructure/rootvirt \
    108         drv/block/ahci \
    109107        drv/char/i8042 \
    110108        drv/char/ps2mouse \
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    re435537 rdfc07c1  
    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                
    232231                bytes = read(fd, buff + copied_bytes, bytes_to_read);
    233232                bytes += copied_bytes;
     
    262261                        reads++;
    263262                }
    264                
    265                 if (reading_stdin)
     263
     264                if (reading_stdin) {
    266265                        fflush(stdout);
     266                }
    267267        } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE));
    268268
  • uspace/lib/c/Makefile

    re435537 rdfc07c1  
    7171        generic/device/nic.c \
    7272        generic/device/pci.c \
    73         generic/device/ahci.c \
    7473        generic/elf/elf_load.c \
    7574        generic/event.c \
  • uspace/lib/c/include/ipc/dev_iface.h

    re435537 rdfc07c1  
    5151        /** Interface provided by USB HID devices. */
    5252        USBHID_DEV_IFACE,
    53         /** Interface provided by AHCI devices. */
    54         AHCI_DEV_IFACE,
    5553
    5654        DEV_IFACE_MAX
  • uspace/lib/drv/Makefile

    re435537 rdfc07c1  
    4444        generic/remote_pci.c \
    4545        generic/remote_usbhc.c \
    46         generic/remote_usbhid.c \
    47         generic/remote_ahci.c
     46        generic/remote_usbhid.c
    4847
    4948include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/drv/generic/dev_iface.c

    re435537 rdfc07c1  
    4646#include "remote_usbhid.h"
    4747#include "remote_pci.h"
    48 #include "remote_ahci.h"
    4948
    5049static iface_dipatch_table_t remote_ifaces = {
     
    5655                &remote_usb_iface,
    5756                &remote_usbhc_iface,
    58                 &remote_usbhid_iface,
    59                 &remote_ahci_iface
     57                &remote_usbhid_iface
    6058        }
    6159};
  • uspace/srv/hid/console/console.c

    re435537 rdfc07c1  
    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                        
    631630                        /* Unshift the array. */
    632                         for (size_t i = 1; i < cons->char_remains_len; i++)
     631                        for (size_t i = 1; i < cons->char_remains_len; i++) {
    633632                                cons->char_remains[i - 1] = cons->char_remains[i];
    634                        
     633                        }
    635634                        cons->char_remains_len--;
    636635                }
    637                
    638636                /* Still not enough? Then get another key from the queue. */
    639637                if (pos < size) {
    640638                        link_t *link = prodcons_consume(&cons->input_pc);
    641639                        kbd_event_t *event = list_get_instance(link, kbd_event_t, link);
    642                        
     640
    643641                        /* Accept key presses of printable chars only. */
    644642                        if ((event->type == KEY_PRESS) && (event->c != 0)) {
     
    647645                                cons->char_remains_len = str_size(cons->char_remains);
    648646                        }
    649                        
     647
    650648                        free(event);
    651649                }
Note: See TracChangeset for help on using the changeset viewer.