]> git.proxmox.com Git - qemu.git/commitdiff
Fix dead initialization, spotted by clang analyzer
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 25 Apr 2010 15:27:14 +0000 (15:27 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 25 Apr 2010 15:27:14 +0000 (15:27 +0000)
Fix clang warnings:
/src/qemu/block/vvfat.c:1102:9: warning: Value stored to 'index3' during its initialization is never read
    int index3=index1+1;
/src/qemu/cmd.c:290:15: warning: Value stored to 'p' during its initialization is never read
        char *p = result;

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block/vvfat.c
cmd.c

index 0701df49f45c88fbf6b7d3aef2ad4f21ac8451d9..66259b48d5bab7524aad98ad0f07dd5c00c3f302 100644 (file)
@@ -1099,8 +1099,8 @@ static inline void vvfat_close_current_file(BDRVVVFATState *s)
  */
 static inline int find_mapping_for_cluster_aux(BDRVVVFATState* s,int cluster_num,int index1,int index2)
 {
-    int index3=index1+1;
     while(1) {
+        int index3;
        mapping_t* mapping;
        index3=(index1+index2)/2;
        mapping=array_get(&(s->mapping),index3);
diff --git a/cmd.c b/cmd.c
index cc70311b9f2ddbcd0da1e9298692b4ac2226b66e..2336334eea8597caf4bf34b3e5b84c8e6d729c0d 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -287,7 +287,8 @@ static char *qemu_strsep(char **input, const char *delim)
 {
     char *result = *input;
     if (result != NULL) {
-        char *p = result;
+        char *p;
+
         for (p = result; *p != '\0'; p++) {
             if (strchr(delim, *p)) {
                 break;