Merge commit 'mouraf/for-erwan' into for-erwan
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Thu, 23 Apr 2009 06:57:33 +0000 (23:57 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Thu, 23 Apr 2009 06:57:33 +0000 (23:57 -0700)
Conflicts:

com32/hdt/hdt-cli-hdt.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-pci.c
com32/hdt/hdt-common.c
com32/hdt/hdt-common.h

Simple merge
Simple merge
@@@ -50,11 -50,13 +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;
  
        printf("Available modes:\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++;
+       }
  }
  
  /**
@@@ -117,30 -119,38 +119,38 @@@ static void show_cli_help(int argc __un
        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 ",
 +                      printf("%s ",
                               current_mode->default_modules->modules[j].name);
+                       j++;
                }
 -              more_printf("\n");
 +              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) {
                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",
 +                      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) {
                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",
 +                      printf("\t%s\n",
                               current_mode->set_modules->modules[j].name);
+                       j++;
+               }
        }
  
        /* List finally the default modules of the hdt mode */
Simple merge
Simple merge
@@@ -125,8 -129,8 +129,9 @@@ void reset_more_printf()
  const char *find_argument(const char **argv, const char *argument);
  char *remove_spaces(char *p);
  char *skip_spaces(char *p);
 +char *del_multi_spaces(char *p);
  int detect_dmi(struct s_hardware *hardware);
+ int detect_vpd(struct s_hardware *hardware);
  void detect_disks(struct s_hardware *hardware);
  void detect_pci(struct s_hardware *hardware);
  void cpu_detect(struct s_hardware *hardware);