Merge commit 'erwan/master' into for-erwan
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Fri, 17 Apr 2009 21:55:12 +0000 (14:55 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Fri, 17 Apr 2009 21:55:12 +0000 (14:55 -0700)
Conflicts:
com32/hdt/hdt-cli-hdt.c
com32/hdt/hdt-cli.c

1  2 
com32/hdt/hdt-cli-cpu.c
com32/hdt/hdt-cli-dmi.c
com32/hdt/hdt-cli-hdt.c
com32/hdt/hdt-cli-kernel.c
com32/hdt/hdt-cli-pci.c
com32/hdt/hdt-cli-pxe.c
com32/hdt/hdt-cli-syslinux.c
com32/hdt/hdt-cli-vesa.c
com32/hdt/hdt-cli.c

Simple merge
Simple merge
@@@ -50,13 -50,11 +50,13 @@@ static void cli_clear_screen(int argc _
  static void main_show_modes(int argc __unused, char** argv __unused,
                            struct s_hardware *hardware __unused)
  {
 -      int i;
 +      int i = 0;
  
-       more_printf("Available modes:\n");
+       printf("Available modes:\n");
 -      for (i = 0; i < MAX_MODES; i++)
 +      while (list_modes[i]) {
                more_printf("\t%s\n", list_modes[i]->name);
 +              i++;
 +      }
  }
  
  /**
@@@ -116,41 -114,33 +116,41 @@@ static void show_cli_help(int argc __un
  
        find_cli_mode_descr(hdt_cli.mode, &current_mode);
  
-       more_printf("Available commands are:\n");
+       printf("Available commands are:\n");
  
        /* List first default modules of the mode */
 -      if (current_mode->default_modules != NULL ) {
 -              for (j = 0; j < current_mode->default_modules->nb_modules; j++) {
 +      if (current_mode->default_modules &&
 +          current_mode->default_modules->modules) {
 +              while (current_mode->default_modules->modules[j].name) {
                        more_printf("%s ",
                               current_mode->default_modules->modules[j].name);
 +                      j++;
                }
                more_printf("\n");
        }
  
        /* List secondly the show modules of the mode */
 -      if (current_mode->show_modules != NULL &&
 -          current_mode->show_modules->nb_modules != 0) {
 +      if (current_mode->show_modules &&
 +          current_mode->show_modules->modules) {
-               more_printf("show commands:\n");
+               printf("show commands:\n");
 -              for (j = 0; j < current_mode->show_modules->nb_modules; j++)
 +              j = 0;
 +              while (current_mode->show_modules->modules[j].name) {
                        more_printf("\t%s\n",
                               current_mode->show_modules->modules[j].name);
 +                      j++;
 +              }
        }
  
        /* List thirdly the set modules of the mode */
 -      if (current_mode->set_modules != NULL &&
 -          current_mode->set_modules->nb_modules != 0) {
 +      if (current_mode->set_modules &&
 +          current_mode->set_modules->modules) {
-               more_printf("set commands:\n");
+               printf("set commands:\n");
 -              for (j = 0; j < current_mode->set_modules->nb_modules; j++)
 +              j = 0;
 +              while (current_mode->set_modules->modules[j].name) {
                        more_printf("\t%s\n",
                               current_mode->set_modules->modules[j].name);
 +                      j++;
 +              }
        }
  
        /* List finally the default modules of the hdt mode */
                                             current_mode->default_modules,
                                             &associated_module);
                        if (associated_module == NULL)
-                               more_printf("%s ",
+                               printf("%s ",
                                       hdt_mode.default_modules->modules[j].name);
 +                      j++;
                }
-               more_printf("\n");
+               printf("\n");
        }
  
        main_show_modes(argc, argv, hardware);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -180,11 -179,9 +180,11 @@@ void set_mode(cli_mode_t mode, struct s
                break;
        default:
                /* Invalid mode */
-               more_printf("Unknown mode, please choose among:\n");
+               printf("Unknown mode, please choose among:\n");
 -              for (i = 0; i < MAX_MODES; i++)
 +              while (list_modes[i]) {
-                       more_printf("\t%s\n", list_modes[i]->name);
+                       printf("\t%s\n", list_modes[i]->name);
 +                      i++;
 +              }
        }
  
        find_cli_mode_descr(hdt_cli.mode, &current_mode);
@@@ -462,12 -457,11 +462,12 @@@ static void autocomplete_command(char *
         * Then, go through the modes for the special case
         *      '<mode>' -> 'set mode <mode>'
         */
 -      for (j = 0; j < MAX_MODES; j++) {
 +      while (list_modes[j]) {
                if (strncmp(list_modes[j]->name, command, strlen(command)) == 0) {
-                       more_printf("%s\n", list_modes[j]->name);
+                       printf("%s\n", list_modes[j]->name);
                        autocomplete_add_token_to_list(list_modes[j]->name);
                }
 +              j++;
        }
  
        /*