about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorChi-Kuan Chiu <105687635+devarajabc@users.noreply.github.com>2024-10-23 04:08:49 +0800
committerGitHub <noreply@github.com>2024-10-22 22:08:49 +0200
commit2c2b252dac9c89ea51d046f552c7042eb4bea354 (patch)
treeb144c6676256024e752c01b806733a0c09daeaf3 /src
parent8efd1e3ae0c98940b9c134a1c1de401e1f74ec3b (diff)
downloadbox64-2c2b252dac9c89ea51d046f552c7042eb4bea354.tar.gz
box64-2c2b252dac9c89ea51d046f552c7042eb4bea354.zip
[Box64] Fix compilation issues (#1938) (#1952)
Fixed compilation errors related to variable declarations within
switch-case statements without enclosing braces. This adjustment
ensures compatibility with older versions of compiler.

Resolves: #1938
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.c3
-rw-r--r--src/libtools/my_x11_xevent.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c
index 1d161eec..eb239e5c 100644
--- a/src/dynarec/rv64/dynarec_rv64_helper.c
+++ b/src/dynarec/rv64/dynarec_rv64_helper.c
@@ -2694,11 +2694,12 @@ void vector_loadmask(dynarec_rv64_t* dyn, int ninst, int vreg, uint64_t imm, int
                     ADDI(s1, xZR, 1);
                     VMV_S_X(vreg, s1);
                     return;
-                case 2:
+                case 2: {
                     int scratch = fpu_get_scratch(dyn);
                     VMV_V_I(scratch, 1);
                     VSLIDE1UP_VX(vreg, scratch, xZR, VECTOR_UNMASKED);
                     return;
+                }
                 case 3:
                     VMV_V_I(vreg, 1);
                     return;
diff --git a/src/libtools/my_x11_xevent.c b/src/libtools/my_x11_xevent.c
index 71cadc52..bd1bf97f 100644
--- a/src/libtools/my_x11_xevent.c
+++ b/src/libtools/my_x11_xevent.c
@@ -256,7 +256,7 @@ void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src)
             dst->xcookie.cookie = src->xcookie.cookie;
             dst->xcookie.data = to_ptrv_silent(src->xcookie.data);  // in case data are not initialized
             break;
-        default:
+        default: {
             register_events_t* head = register_events_head;
             while(head) {
                 if(type>=head->start_event && type<=head->end_event) {
@@ -269,6 +269,7 @@ void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src)
                 head = head->next;
             }
             printf_log(LOG_INFO, "Warning, unsupported 32bits XEvent type=%d\n", type);
+        }    
     }
 }
 void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src)
@@ -492,7 +493,7 @@ void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src)
             dst->xcookie.data = from_ptrv(src->xcookie.data);
             break;
 
-        default:
+        default: {
             register_events_t* head = register_events_head;
             while(head) {
                 if(type>=head->start_event && type<=head->end_event) {
@@ -505,6 +506,7 @@ void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src)
                 head = head->next;
             }
             printf_log(LOG_INFO, "Warning, unsupported 32bits (un)XEvent type=%d\n", type);
+        }
     }
 }