about summary refs log tree commit diff stats
path: root/src/libtools/myalign32.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-07 17:17:55 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-07 17:17:55 +0200
commitf073415510929646b7e2d5e254c4932b46b40233 (patch)
tree4adb71907705a9b6335de19ae05e1e177c31e6ca /src/libtools/myalign32.c
parent4c69bcd97aff691b464f01ebed057cfcb912612b (diff)
downloadbox64-f073415510929646b7e2d5e254c4932b46b40233.tar.gz
box64-f073415510929646b7e2d5e254c4932b46b40233.zip
[BOX32] More work on 32bits wrapped functions
Diffstat (limited to 'src/libtools/myalign32.c')
-rwxr-xr-xsrc/libtools/myalign32.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libtools/myalign32.c b/src/libtools/myalign32.c
index 63ae2951..e14912a0 100755
--- a/src/libtools/myalign32.c
+++ b/src/libtools/myalign32.c
@@ -201,6 +201,7 @@ size_t myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack, siz
                     case '#':
                     case '+': 
                     case '-': ++p; break; // formating, ignored
+                    case '[': state += 60; ++p; break;
                     case 'm': state = 0; ++p; break; // no argument
                     case 'n':
                     case 'p': state = 30; break; // pointers
@@ -251,6 +252,13 @@ size_t myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack, siz
                 state = 0;
                 ++p;
                 break;
+            case 61:
+                switch(*p) {
+                    case ']': state = 50; break;
+                    case '\\': ++p; if(*p) ++p; break;
+                    default: ++p; break;
+                }
+                break;
             default:
                 // whaaaat?
                 state = 0;
@@ -321,6 +329,7 @@ void myStackAlignScanf32_final(const char* fmt, uint32_t* st, uint64_t* mystack,
                     case '#':
                     case '+': 
                     case '-': ++p; break; // formating, ignored
+                    case '[': state += 60; ++p; break;
                     case 'm': state = 0; ++p; break; // no argument
                     case 'n':
                     case 'p': state = 30; break; // pointers
@@ -381,6 +390,13 @@ void myStackAlignScanf32_final(const char* fmt, uint32_t* st, uint64_t* mystack,
                 ++p;
                 if(!--n) return;
                 break;
+            case 61:
+                switch(*p) {
+                    case ']': state = 50; break;
+                    case '\\': ++p; if(*p) ++p; break;
+                    default: ++p; break;
+                }
+                break;
             default:
                 // whaaaat?
                 state = 0;