Skip to content

Commit

Permalink
Fix compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Nov 4, 2021
1 parent b3c3324 commit 44bc0a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rococoa/rococoa-core/src/main/native/Rococoa.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <Cocoa/Cocoa.h>
#include <objc/objc-runtime.h>

void callOnMainThread(void (*fn)(), BOOL waitUntilDone);
void callOnMainThread(void (*fn)(void), BOOL waitUntilDone);

@interface RococoaHelper : NSObject
+ (void) callback: (NSValue*) fn;
Expand Down
4 changes: 2 additions & 2 deletions rococoa/rococoa-core/src/main/native/Rococoa.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Rococoa.h"

void callOnMainThread(void (*fn)(), BOOL waitUntilDone) {
void callOnMainThread(void (*fn)(void), BOOL waitUntilDone) {
// NSLog(@"callOnMainThread function at address %p", fn);
// Pool is required as we're being called from Java, which probably doesn't have a pool to
// allocate the NSValue from.
Expand All @@ -13,7 +13,7 @@ void callOnMainThread(void (*fn)(), BOOL waitUntilDone) {
@implementation RococoaHelper : NSObject

+ (void) callback: (NSValue*) fnAsValue {
void (*fn)() = [fnAsValue pointerValue];
void (*fn)(void) = [fnAsValue pointerValue];
(*fn)();
}

Expand Down

0 comments on commit 44bc0a3

Please sign in to comment.