hlfw.ca

x9dev

Download patch

ref: 13cbf985bc6e76ebd525cadefb385b21b6674621
parent: 0153ac73e77b59baacb2b6b4220a0e45d784ed22
author: halfwit <michaelmisch1985@gmail.com>
date: Sat Oct 10 07:22:22 PDT 2020

Move back to pointers

--- a/keyboard.c
+++ b/keyboard.c
@@ -57,7 +57,7 @@
 {
     wchar_t rune;
 
-    if (c9read(x9di.ctx, &x9di->keybd->tag, x9di->keybd->fid, x9di->keybd->wroff, 1) != 1)
+    if (c9read(x9di.ctx, &x9di.keybd->tag, x9di.keybd->fid, x9di.keybd->wroff, 1) != 1)
         return 0;
 
     rune = x9di.keybd->rdbuf[0];
--- a/mouse.c
+++ b/mouse.c
@@ -53,7 +53,7 @@
     int n;
 
     /* Magic numbers here are the size of a message from /dev/mouse and its offsets */
-    if((n = c9read(x9di.ctx, &x9di->mouse->tag, x9di->mouse.f, x9di->mouse->wroff, 1 + 4 * 12)) <= 0)
+    if((n = c9read(x9di.ctx, &x9di.mouse->tag, x9di.mouse.f, x9di.mouse->wroff, 1 + 4 * 12)) <= 0)
         return 0;
 
     if (n != 1 + 4 * 12)
@@ -64,9 +64,9 @@
         return 0;
     }
 
-    *x = atoi(x9di.mouse->rdbuf[1 + 0 * 12]) - screen->r.min.x;
-    *y = atoi(x9di.mouse->rdbuf[1 + 1 * 12]) - screen->r.min.y;
-    *b = atoi(x9di.mouse->rdbuf[1 + 2 * 12]);
+    *x = atoi(x9di.mouse->rdbuf + 1 + 0 * 12) - screen->r.min.x;
+    *y = atoi(x9di.mouse->rdbuf + 1 + 1 * 12) - screen->r.min.y;
+    *b = atoi(x9di.mouse->rdbuf + 1 + 2 * 12);
 
     return 1;
 }