Commit 54042bcf24b6c7c1c99f7a022f3cd00ba338f708

Authored by aliguori
1 parent 0858532e

Remove some warnings and fix windows build.

Initialize some variables to make GCC happy and switch from using index to
strchr.  index is not available on Windows.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6653 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 4 additions and 4 deletions
hw/acpi.c
@@ -841,7 +841,7 @@ int acpi_table_add(const char *t) @@ -841,7 +841,7 @@ int acpi_table_add(const char *t)
841 f = buf; 841 f = buf;
842 while (buf[0]) { 842 while (buf[0]) {
843 struct stat s; 843 struct stat s;
844 - char *n = index(f, ':'); 844 + char *n = strchr(f, ':');
845 if (n) 845 if (n)
846 *n = '\0'; 846 *n = '\0';
847 if(stat(f, &s) < 0) { 847 if(stat(f, &s) < 0) {
@@ -873,7 +873,7 @@ int acpi_table_add(const char *t) @@ -873,7 +873,7 @@ int acpi_table_add(const char *t)
873 while (buf[0]) { 873 while (buf[0]) {
874 struct stat s; 874 struct stat s;
875 int fd; 875 int fd;
876 - char *n = index(f, ':'); 876 + char *n = strchr(f, ':');
877 if (n) 877 if (n)
878 *n = '\0'; 878 *n = '\0';
879 fd = open(f, O_RDONLY); 879 fd = open(f, O_RDONLY);
@@ -4641,8 +4641,8 @@ int main(int argc, char **argv, char **envp) @@ -4641,8 +4641,8 @@ int main(int argc, char **argv, char **envp)
4641 const char *pid_file = NULL; 4641 const char *pid_file = NULL;
4642 int autostart; 4642 int autostart;
4643 const char *incoming = NULL; 4643 const char *incoming = NULL;
4644 - int fd;  
4645 - struct passwd *pwd; 4644 + int fd = 0;
  4645 + struct passwd *pwd = NULL;
4646 const char *chroot_dir = NULL; 4646 const char *chroot_dir = NULL;
4647 const char *run_as = NULL; 4647 const char *run_as = NULL;
4648 4648