about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-04-11 08:38:38 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-04-11 08:38:46 +0200
commit5538ffde53c5300918b6847e4c3243e3a3212cbd (patch)
treebd257670750d6f84adc6437fa1a678425efc469a /src
parent74cd8cd6fefbba30cdfc0541e9f6d816f3a79478 (diff)
downloadbox64-5538ffde53c5300918b6847e4c3243e3a3212cbd.tar.gz
box64-5538ffde53c5300918b6847e4c3243e3a3212cbd.zip
Various small fixes and warning removal
Diffstat (limited to 'src')
-rw-r--r--src/elfs/elfdwarf_private.c2
-rwxr-xr-xsrc/emu/x64primop.c18
-rw-r--r--src/emu/x64run66.c12
-rw-r--r--src/emu/x64runf0.c2
-rwxr-xr-xsrc/wrapped/wrappedglib2.c2
-rwxr-xr-xsrc/wrapped/wrappedlibc.c2
-rwxr-xr-xsrc/wrapped/wrappedlibx11.c8
7 files changed, 23 insertions, 23 deletions
diff --git a/src/elfs/elfdwarf_private.c b/src/elfs/elfdwarf_private.c
index 7c5b3c92..bae2b4ea 100644
--- a/src/elfs/elfdwarf_private.c
+++ b/src/elfs/elfdwarf_private.c
@@ -384,7 +384,7 @@ uintptr_t get_parent_registers(dwarf_unwind_t *unwind, const elfheader_t *ehdr,
 #undef PARSE_INST
 
                 uint64_t cfa_reg = -1;
-                unsigned char cfa_signed;
+                unsigned char cfa_signed = 0;
                 union { uint64_t uoff; int64_t soff; } cfa_offset = { .uoff = 0 };
                 ++unwind_constr.reg_count;
                 size_t tablelen = unwind_constr.reg_count * sizeof(uint64_t);
diff --git a/src/emu/x64primop.c b/src/emu/x64primop.c
index 789f4866..c45cb654 100755
--- a/src/emu/x64primop.c
+++ b/src/emu/x64primop.c
@@ -1191,9 +1191,9 @@ uint16_t sbb16(x64emu_t *emu, uint16_t d, uint16_t s)
         res = d - s - 1;
     else
         res = d - s;
-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+   	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+   	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+   	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
 
 	/* calculate the borrow chain.  See note at top */
 	bc = (res & (~d | s)) | (~d & s);
@@ -1213,9 +1213,9 @@ uint32_t sbb32(x64emu_t *emu, uint32_t d, uint32_t s)
         res = d - s - 1;
     else
         res = d - s;
-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-	CONDITIONAL_SET_FLAG(!res, F_ZF);
-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+  	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+  	CONDITIONAL_SET_FLAG(!res, F_ZF);
+  	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
 
 	/* calculate the borrow chain.  See note at top */
 	bc = (res & (~d | s)) | (~d & s);
@@ -1235,9 +1235,9 @@ uint64_t sbb64(x64emu_t *emu, uint64_t d, uint64_t s)
         res = d - s - 1;
     else
         res = d - s;
-	CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
-	CONDITIONAL_SET_FLAG(!res, F_ZF);
-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+  	CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
+  	CONDITIONAL_SET_FLAG(!res, F_ZF);
+  	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
 
 	/* calculate the borrow chain.  See note at top */
 	bc = (res & (~d | s)) | (~d & s);
diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c
index 92093332..eeb64827 100644
--- a/src/emu/x64run66.c
+++ b/src/emu/x64run66.c
@@ -471,12 +471,12 @@ int Run66(x64emu_t *emu, rex_t rex, int rep)
                 if(rex.w) {

                     while(tmp64u) {

                         --tmp64u;

-                        tmp64u = *(uint64_t*)R_RDI;

+                        tmp64u2 = *(uint64_t*)R_RDI;

                         R_RDI += tmp8s;

-                        if(R_RAX==tmp64u)

+                        if(R_RAX==tmp64u2)

                             break;

                     }

-                    if(R_RCX) cmp64(emu, R_RAX, tmp64u);

+                    if(R_RCX) cmp64(emu, R_RAX, tmp64u2);

                 } else {

                     while(tmp64u) {

                         --tmp64u;

@@ -494,12 +494,12 @@ int Run66(x64emu_t *emu, rex_t rex, int rep)
                 if(rex.w) {

                     while(tmp64u) {

                         --tmp64u;

-                        tmp64u = *(uint64_t*)R_RDI;

+                        tmp64u2 = *(uint64_t*)R_RDI;

                         R_RDI += tmp8s;

-                        if(R_RAX!=tmp64u)

+                        if(R_RAX!=tmp64u2)

                             break;

                     }

-                    if(R_RCX) cmp64(emu, R_RAX, tmp64u);

+                    if(R_RCX) cmp64(emu, R_RAX, tmp64u2);

                 } else {

                     while(tmp64u) {

                         --tmp64u;

diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c
index 91626429..8874bf2d 100644
--- a/src/emu/x64runf0.c
+++ b/src/emu/x64runf0.c
@@ -599,7 +599,7 @@ int RunF0(x64emu_t *emu, rex_t rex)
                     pthread_mutex_lock(&emu->context->mutex_lock);

                     tmp8u = add8(emu, EB->byte[0], GB);

                     GB = EB->byte[0];

-                    EB->byte[0] = tmp32u;

+                    EB->byte[0] = tmp8u;

                     pthread_mutex_unlock(&emu->context->mutex_lock);

 #endif

                     break;

diff --git a/src/wrapped/wrappedglib2.c b/src/wrapped/wrappedglib2.c
index 1ccdb19e..cbaf7cad 100755
--- a/src/wrapped/wrappedglib2.c
+++ b/src/wrapped/wrappedglib2.c
@@ -1347,7 +1347,7 @@ EXPORT int my_g_sprintf(x64emu_t* emu, void* buf, void* fmt, uintptr_t* b)
     glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2;
     myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 2);
     PREPARE_VALIST;
-    my->g_vsprintf(buf, fmt, VARARGS);
+    return my->g_vsprintf(buf, fmt, VARARGS);
 }
 
 EXPORT void* my_g_strdup_printf(x64emu_t* emu, void* fmt, uintptr_t* b)
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 9cb00857..b33d67bd 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2270,7 +2270,7 @@ EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t ne
     } else {
         if(old_size
         #ifdef MREMAP_DONTUNMAP
-        && flags&MREMAP_DONTUNMAP==0
+        && ((flags&MREMAP_DONTUNMAP)==0)
         #endif
         ) {
             freeProtection((uintptr_t)old_addr, old_size);
diff --git a/src/wrapped/wrappedlibx11.c b/src/wrapped/wrappedlibx11.c
index 6818d47e..32f3ed26 100755
--- a/src/wrapped/wrappedlibx11.c
+++ b/src/wrapped/wrappedlibx11.c
@@ -654,7 +654,7 @@ EXPORT void* my_XVaCreateNestedList(x64emu_t* emu, int unused, uintptr_t* va) {
         SUPER()
     }
 
-    void* res;
+    void* res = NULL;
     VA_CALL(my->XVaCreateNestedList, unused, new_va, n, res);
     free(new_va);
     free(callbacks);
@@ -675,7 +675,7 @@ EXPORT void* my_XCreateIC(x64emu_t* emu, void* xim, uintptr_t* va) {
         SUPER()
     }
 
-    void* res;
+    void* res = NULL;
     VA_CALL(my->XCreateIC, xim, new_va, n, res);
     free(new_va);
     free(callbacks);
@@ -696,7 +696,7 @@ EXPORT void* my_XSetICValues(x64emu_t* emu, void* xic, uintptr_t* va) {
         SUPER()
     }
 
-    void* res; 
+    void* res = NULL; 
     VA_CALL(my->XSetICValues, xic, new_va, n, res);
     free(new_va);
     free(callbacks);
@@ -728,7 +728,7 @@ EXPORT void* my_XSetIMValues(x64emu_t* emu, void* xim, uintptr_t* va) {
     }
     #undef GO
     
-    void* res;
+    void* res = NULL;
     VA_CALL(my->XSetIMValues, xim, new_va, n, res)
     free(new_va);
     free(callbacks);