Skip to contentSkip to conversation

small patches

Qemu-devel Falk Hueffner 1 participant 1 message Nov 23, 2003

lore
Share & tools
lore
#0 lore raw

* don't abort for empty code on Alpha
* warning fix
* cast as lvalue is deprecated (and probably not intended anyway)
* lrint returns long (why is this declared, anyway?)

Falk

Index: dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.28

dyngen.c +2 -2
diff -u -p -r1.28 dyngen.c
@@ -486,7 +486,7 @@ void gen_code(const char *name, host_ulo
 	    uint8_t *p;
 	    p = p_end - 4;
 	    if (p == p_start)
-		error("empty code for %s", name);
+		fprintf(stderr, "empty code for %s", name);
             if (get32((uint32_t *)p) != 0x6bfa8001)
 		error("ret expected at the end of %s", name);
 	    copy_size = p - p_start;	    
@@ -663,7 +663,7 @@ void gen_code(const char *name, host_ulo
             }
         }
 
-        fprintf(outfile, "    memcpy(gen_code_ptr, (void *)((char *)&%s+%d), %d);\n", name, start_offset - offset, copy_size);
+        fprintf(outfile, "    memcpy(gen_code_ptr, (void *)((char *)&%s+%ld), %d);\n", name, start_offset - offset, copy_size);
 
         /* emit code offset information */
         {

Index: elfload.c
===================================================================
RCS file: /cvsroot/qemu/qemu/elfload.c,v
retrieving revision 1.15

elfload.c +2 -2
diff -u -p -r1.15 elfload.c
@@ -311,8 +311,8 @@ static unsigned long copy_strings(int ar
 	    if (--offset < 0) {
 		offset = p % TARGET_PAGE_SIZE;
 		if (!(pag = (char *) page[p/TARGET_PAGE_SIZE]) &&
-		    !(pag = (char *) page[p/TARGET_PAGE_SIZE] =
-		      (unsigned long *) get_free_page())) {
+		    !(pag = (char *) (page[p/TARGET_PAGE_SIZE] =
+				      (unsigned long *) get_free_page()))) {
 			return 0;
 		}
 	    }

Index: target-i386/exec.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-i386/exec.h,v
retrieving revision 1.5

exec.h +1 -1
diff -u -p -r1.5 exec.h
@@ -306,7 +306,7 @@ static inline void stfl(void *ptr, float
 #define rint rintl
 #endif
 
-extern int lrint(CPU86_LDouble x);
+extern long lrint(CPU86_LDouble x);
 extern int64_t llrint(CPU86_LDouble x);
 extern CPU86_LDouble fabs(CPU86_LDouble x);
 extern CPU86_LDouble sin(CPU86_LDouble x);