Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanArbuckle committed May 20, 2020
1 parent db45210 commit 8a6a5aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion vncforios/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

void setup_hid(CGSize displaySize);
void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client);
void VNCPointerNew(uint8_t buttonMask, int x, int y, rfbClientPtr client);
void VNCPointerNew(int buttonMask, int x, int y, rfbClientPtr client);

#endif /* hid_h */
14 changes: 5 additions & 9 deletions vncforios/hid.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
static CGSize displaySize;
static uint64_t multitouchDeviceID;

void setup_hid(CGSize scaledDisplaySize)
{
void setup_hid(CGSize scaledDisplaySize) {
eventClient = IOHIDEventSystemClientCreate(kCFAllocatorDefault);
displaySize = scaledDisplaySize;

Expand Down Expand Up @@ -51,15 +50,13 @@ void setup_hid(CGSize scaledDisplaySize)
NSLog(@"AppleMultitouchDevice: 0x%llx", multitouchDeviceID);
}

static void send_event(IOHIDEventRef event)
{
static void send_event(IOHIDEventRef event) {
IOHIDEventSetSenderID(event, multitouchDeviceID);
IOHIDEventSystemClientDispatchEvent(eventClient, event);
CFRelease(event);
}

void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client)
{
void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client) {
uint16_t usage;
uint16_t usagePage = kHIDPage_KeyboardOrKeypad;

Expand Down Expand Up @@ -195,9 +192,8 @@ void VNCKeyboard(rfbBool down, rfbKeySym key, rfbClientPtr client)
send_event(event);
}

static uint8_t lastButtonMask;
void VNCPointerNew(uint8_t buttonMask, int x, int y, rfbClientPtr client)
{
static int lastButtonMask;
void VNCPointerNew(int buttonMask, int x, int y, rfbClientPtr client) {
int diff = lastButtonMask ^ buttonMask;
bool wasDown = (lastButtonMask & 0x1) != 0;
bool isDown = (buttonMask & 0x1) != 0;
Expand Down
19 changes: 7 additions & 12 deletions vncforios/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
static CFStringRef displayName;
static IOSurfaceAcceleratorRef accelerator;

static enum rfbNewClientAction vnc_client_new(rfbClientPtr client)
{
static enum rfbNewClientAction vnc_client_new(rfbClientPtr client) {
return RFB_CLIENT_ACCEPT;
}

static rfbBool vnc_check_password(rfbClientPtr client, const char *data, int size)
{
static rfbBool vnc_check_password(rfbClientPtr client, const char *data, int size) {
return 1;
}

void create_vnc_server()
{
void create_vnc_server() {
int BytesPerPixel = 4;
int BitsPerSample = 8;

Expand Down Expand Up @@ -71,8 +68,8 @@ void create_vnc_server()
rfbRunEventLoop(_remote_screen, -1, true);
}

void draw(CFRunLoopTimerRef timer, void *info) {

void draw(void) {
IOSurfaceLock(fullsizeSurface, 0, nil);
CARenderServerRenderDisplay(0, displayName, fullsizeSurface, 0, 0);
IOSurfaceUnlock(fullsizeSurface, 0, 0);
Expand All @@ -89,14 +86,12 @@ @interface VncSurfaceDrawer : NSObject
@end
@implementation VncSurfaceDrawer

- (void)draw
{
draw(NULL, NULL);
- (void)draw {
draw();
}

@end


int main(int argc, const char *argv[]) {

@autoreleasepool {
Expand Down

0 comments on commit 8a6a5aa

Please sign in to comment.