From ecfe4bb61b40d32915c21646da2665ea23e4029a Mon Sep 17 00:00:00 2001 From: Lazerbeak12345 <22641188+Lazerbeak12345@users.noreply.github.com> Date: Wed, 21 May 2025 18:36:49 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: CuriousTommy --- .../include/HIToolbox/CarbonEventsCore.h | 16 ++++++++-------- .../Carbon/HIToolbox/src/CarbonEventsCore.c | 15 +++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/frameworks/Carbon/HIToolbox/include/HIToolbox/CarbonEventsCore.h b/src/frameworks/Carbon/HIToolbox/include/HIToolbox/CarbonEventsCore.h index 841bb8f87..fa58a580f 100644 --- a/src/frameworks/Carbon/HIToolbox/include/HIToolbox/CarbonEventsCore.h +++ b/src/frameworks/Carbon/HIToolbox/include/HIToolbox/CarbonEventsCore.h @@ -40,21 +40,21 @@ typedef UInt32 KeyMap[4]; OSStatus CallNextEventHandler(EventHandlerCallRef a, EventRef b); -OSStatus CreateEvent(CFAllocatorRef a, UInt32 b, UInt32 c, EventTime d, EventAttributes e, EventRef * f); -UInt32 GetEventClass(EventRef a); +OSStatus CreateEvent(CFAllocatorRef a, OSType b, UInt32 c, EventTime d, EventAttributes e, EventRef* f); +OSType GetEventClass(EventRef a); UInt32 GetEventKind(EventRef a); -OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType * d, UInt32 e, UInt32 * f, void * g); +OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType* d, ByteCount e, ByteCount* f, void* g); -OSStatus GetMainEventQueue(); -OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, UInt32 c, const EventTypeSpec * d, void * e, EventHandlerRef * f); +EventQueueRef GetMainEventQueue(); +OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, ItemCount c, const EventTypeSpec* d, void* e, EventHandlerRef* f); -EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a); +EventHandlerUPP NewEventHandlerUPP(EventHandlerProcPtr a); OSStatus PostEventToQueue(EventQueueRef a, EventRef b, EventPriority c); -OSStatus ReceiveNextEvent(UInt32 a, const EventTypeSpec * b, EventTimeout c, Boolean d, EventRef * e); +OSStatus ReceiveNextEvent(ItemCount a, const EventTypeSpec* b, EventTimeout c, Boolean d, EventRef* e); -OSStatus ReleaseEvent(EventRef a); +void ReleaseEvent(EventRef a); OSStatus RemoveEventHandler(EventHandlerRef a); OSStatus SendEventToEventTarget(EventRef a, EventTargetRef b); diff --git a/src/frameworks/Carbon/HIToolbox/src/CarbonEventsCore.c b/src/frameworks/Carbon/HIToolbox/src/CarbonEventsCore.c index a75a7b0e2..38fc41d78 100644 --- a/src/frameworks/Carbon/HIToolbox/src/CarbonEventsCore.c +++ b/src/frameworks/Carbon/HIToolbox/src/CarbonEventsCore.c @@ -35,13 +35,13 @@ OSStatus CallNextEventHandler(EventHandlerCallRef a, EventRef b) return 0; } -OSStatus CreateEvent(CFAllocatorRef a, UInt32 b, UInt32 c, EventTime d, EventAttributes e, EventRef * f) +OSStatus CreateEvent(CFAllocatorRef a, OSType b, UInt32 c, EventTime d, EventAttributes e, EventRef* f) { if (verbose) puts("STUB: CreateEvent called"); return 0; } -UInt32 GetEventClass(EventRef a) +OSType GetEventClass(EventRef a) { if (verbose) puts("STUB: GetEventClass called"); return 0; @@ -53,19 +53,19 @@ UInt32 GetEventKind(EventRef a) return 0; } -OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType * d, UInt32 e, UInt32 * f, void * g) +OSStatus GetEventParameter(EventRef a, EventParamName b, EventParamType c, EventParamType* d, ByteCount e, ByteCount* f, void* g) { if (verbose) puts("STUB: GetEventParameter called"); return 0; } -OSStatus GetMainEventQueue() +EventQueueRef GetMainEventQueue() { if (verbose) puts("STUB: GetMainEventQueue called"); return 0; } -OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, UInt32 c, const EventTypeSpec * d, void * e, EventHandlerRef * f) +OSStatus InstallEventHandler(EventTargetRef a, EventHandlerUPP b, ItemCount c, const EventTypeSpec* d, void* e, EventHandlerRef* f) { if (verbose) puts("STUB: InstallEventHandler called"); return 0; @@ -83,16 +83,15 @@ OSStatus PostEventToQueue(EventQueueRef a, EventRef b, EventPriority c) return 0; } -OSStatus ReceiveNextEvent(UInt32 a, const EventTypeSpec * b, EventTimeout c, Boolean d, EventRef * e) +OSStatus ReceiveNextEvent(ItemCount a, const EventTypeSpec* b, EventTimeout c, Boolean d, EventRef* e) { if (verbose) puts("STUB: ReceiveNextEvent called"); return 0; } -OSStatus ReleaseEvent(EventRef a) +void ReleaseEvent(EventRef a) { if (verbose) puts("STUB: ReleaseEvent called"); - return 0; } OSStatus RemoveEventHandler(EventHandlerRef a) -- 2.51.2