aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library_egl.js6
-rw-r--r--src/library_html5.js8
-rw-r--r--src/relooper/Relooper.cpp2
-rw-r--r--src/relooper/test.cpp2
-rw-r--r--src/relooper/test.txt8
5 files changed, 16 insertions, 10 deletions
diff --git a/src/library_egl.js b/src/library_egl.js
index e2d1df43..46ec939e 100644
--- a/src/library_egl.js
+++ b/src/library_egl.js
@@ -492,7 +492,11 @@ var LibraryEGL = {
EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
return 1;
},
-
+
+
+ // EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+ eglWaitGL: 'eglWaitClient',
+
// EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
eglSwapInterval: function(display, interval) {
if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
diff --git a/src/library_html5.js b/src/library_html5.js
index 080bfe39..d9376c2a 100644
--- a/src/library_html5.js
+++ b/src/library_html5.js
@@ -126,7 +126,8 @@ var LibraryJSEvents = {
isInternetExplorer: function() { return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; },
_removeHandler: function(i) {
- JSEvents.eventHandlers[i].target.removeEventListener(JSEvents.eventHandlers[i].eventTypeString, JSEvents.eventHandlers[i].handlerFunc, true);
+ var h = JSEvents.eventHandlers[i];
+ h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture);
JSEvents.eventHandlers.splice(i, 1);
},
@@ -146,6 +147,7 @@ var LibraryJSEvents = {
}
if (eventHandler.callbackfunc) {
+ eventHandler.eventListenerFunc = jsEventHandler;
eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture);
JSEvents.eventHandlers.push(eventHandler);
JSEvents.registerRemoveEventListeners();
@@ -208,8 +210,8 @@ var LibraryJSEvents = {
{{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.metaKey, 'e.metaKey', 'i32') }}};
{{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.button, 'e.button', 'i16') }}};
{{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.buttons, 'e.buttons', 'i16') }}};
- {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementX, 'e.movementX || e.mozMovementX || e.webkitMovementX || (e.screenX-JSEvents.previousScreenX)', 'i32') }}};
- {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementY, 'e.movementY || e.mozMovementY || e.webkitMovementY || (e.screenY-JSEvents.previousScreenY)', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementX, 'e["movementX"] || e["mozMovementX"] || e["webkitMovementX"] || (e.screenX-JSEvents.previousScreenX)', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementY, 'e["movementY"] || e["mozMovementY"] || e["webkitMovementY"] || (e.screenY-JSEvents.previousScreenY)', 'i32') }}};
{{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.canvasX, 'e.clientX - rect.left', 'i32') }}};
{{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.canvasY, 'e.clientY - rect.top', 'i32') }}};
JSEvents.previousScreenX = e.screenX;
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index c6830158..780a6d59 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -655,7 +655,7 @@ void Relooper::Calculate(Block *Entry) {
Block *Curr = *iter;
for (BlockBranchMap::iterator iter = Curr->BranchesOut.begin(); iter != Curr->BranchesOut.end(); iter++) {
Block *Target = iter->first;
- if (!contains(Hoisted, Target) && !contains(NextEntries, Target))
+ if (!contains(Hoisted, Target) && !contains(NextEntries, Target)) {
// abort this hoisting
abort = true;
break;
diff --git a/src/relooper/test.cpp b/src/relooper/test.cpp
index 2b25001b..78de9e64 100644
--- a/src/relooper/test.cpp
+++ b/src/relooper/test.cpp
@@ -312,7 +312,7 @@ int main() {
printf("\n\n", "the_var");
r.Render();
- puts(buffer);
+ puts(r.GetOutputBuffer());
}
if (1) {
diff --git a/src/relooper/test.txt b/src/relooper/test.txt
index 1fa205ba..7d79e037 100644
--- a/src/relooper/test.txt
+++ b/src/relooper/test.txt
@@ -324,10 +324,6 @@
label = 1;
L0: while(1) {
switch(label|0) {
- case 3: {
- // block C
- break;
- }
case 1: {
// block A
if (check == 10) {
@@ -357,6 +353,10 @@
}
break;
}
+ case 3: {
+ // block C
+ break;
+ }
}
}