Changeset b828907 in mainline for kernel/generic/src/debug/symtab.c


Ignore:
Timestamp:
2012-07-20T20:29:54Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
34bc2fe
Parents:
4cdac68 (diff), 6de2d766 (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:

Merge with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/debug/symtab.c

    r4cdac68 rb828907  
    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         /* Maximum Match Length : Length of longest matching common substring in
    230            case more than one match is found */
     229       
     230        /*
     231         * Maximum Match Length: Length of longest matching common substring in
     232         * case more than one match is found.
     233         */
    231234        size_t max_match_len = size;
    232235        size_t max_match_len_tmp = size;
     
    238241       
    239242        output[0] = 0;
    240 
    241         while ((hint = symtab_search_one(name, &pos))) {
    242                 ++pos;
    243         }
    244 
     243       
     244        while ((hint = symtab_search_one(name, &pos)))
     245                pos++;
     246       
    245247        pos = 0;
    246248       
     
    253255        }
    254256       
    255         /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */
     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         */
    256261        if (found > MAX_TAB_HINTS) {
    257262                printf("\n");
    258                 continue_showing_hints = console_prompt_display_all_hints(indev, found);
     263                continue_showing_hints =
     264                    console_prompt_display_all_hints(indev, found);
    259265        }
    260266       
     
    265271                        sym_name = symbol_table[pos].symbol_name;
    266272                        pos++;
    267 
    268                         if (continue_showing_hints) { /* We are still showing hints */
     273                       
     274                        if (continue_showing_hints) {
     275                                /* We are still showing hints */
    269276                                printf("%s\n", sym_name);
    270277                                --hints_to_show;
    271278                                ++total_hints_shown;
    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);
     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);
    275284                                }
    276285                        }
    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);
     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                       
    280292                        max_match_len = max_match_len_tmp;
    281293                }
    282                 /* keep only the characters common in all completions */
     294               
     295                /* Keep only the characters common in all completions */
    283296                output[max_match_len] = 0;
    284297        }
Note: See TracChangeset for help on using the changeset viewer.