Skip to content

Commit a89e74f

Browse files
committed
[Core] Moved the rkEvent structure to the pf namespace
1 parent 97329ec commit a89e74f

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

include/parasol/modules/core.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ struct OpenInfo {
16111611
#define FDF_SYNONYM FD_SYNONYM
16121612

16131613
#define FDF_UNSIGNED FD_UNSIGNED
1614-
#define FDF_FUNCTION FD_FUNCTION // sizeof(struct rkFunction) - use FDF_FUNCTIONPTR for sizeof(APTR)
1614+
#define FDF_FUNCTION FD_FUNCTION // sizeof(FUNCTION) - use FDF_FUNCTIONPTR for sizeof(APTR)
16151615
#define FDF_FUNCTIONPTR (FD_FUNCTION|FD_POINTER)
16161616
#define FDF_STRUCT FD_STRUCT
16171617
#define FDF_RESOURCE FD_RESOURCE
@@ -4419,22 +4419,22 @@ class objCompressedStream : public Object {
44194419
#include <pthread.h>
44204420
#endif
44214421

4422-
#ifdef __system__
4423-
4424-
struct ActionMessage {
4425-
OBJECTID ObjectID; // The object that is to receive the action
4426-
LONG Time;
4427-
AC ActionID; // ID of the action or method to execute
4428-
bool SendArgs;
4422+
namespace pf {
44294423

4430-
// Action arguments follow this structure in a buffer
4431-
};
4424+
#ifdef __system__
4425+
struct ActionMessage {
4426+
OBJECTID ObjectID; // The object that is to receive the action
4427+
LONG Time;
4428+
AC ActionID; // ID of the action or method to execute
4429+
bool SendArgs;
44324430

4431+
// Action arguments follow this structure in a buffer
4432+
};
44334433
#endif
44344434

44354435
// Event support
44364436

4437-
struct rkEvent {
4437+
struct Event {
44384438
EVENTID EventID;
44394439
// Data follows
44404440
};
@@ -4505,6 +4505,8 @@ struct evHotplug {
45054505
char Vendor[40]; // Name of vendor
45064506
};
45074507

4508+
} // namespace
4509+
45084510
namespace fl {
45094511

45104512
// Read endian values from files and objects.

src/core/defs/core.fdl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ struct OpenInfo {
681681
#define FDF_SYNONYM FD_SYNONYM
682682

683683
#define FDF_UNSIGNED FD_UNSIGNED
684-
#define FDF_FUNCTION FD_FUNCTION // sizeof(struct rkFunction) - use FDF_FUNCTIONPTR for sizeof(APTR)
684+
#define FDF_FUNCTION FD_FUNCTION // sizeof(FUNCTION) - use FDF_FUNCTIONPTR for sizeof(APTR)
685685
#define FDF_FUNCTIONPTR (FD_FUNCTION|FD_POINTER)
686686
#define FDF_STRUCT FD_STRUCT
687687
#define FDF_RESOURCE FD_RESOURCE
@@ -2270,22 +2270,22 @@ inline ERR Call(const FUNCTION &Function, ERR &Result) noexcept {
22702270
#include <pthread.h>
22712271
#endif
22722272

2273-
#ifdef __system__
2274-
2275-
struct ActionMessage {
2276-
OBJECTID ObjectID; // The object that is to receive the action
2277-
LONG Time;
2278-
AC ActionID; // ID of the action or method to execute
2279-
bool SendArgs;
2273+
namespace pf {
22802274

2281-
// Action arguments follow this structure in a buffer
2282-
};
2275+
#ifdef __system__
2276+
struct ActionMessage {
2277+
OBJECTID ObjectID; // The object that is to receive the action
2278+
LONG Time;
2279+
AC ActionID; // ID of the action or method to execute
2280+
bool SendArgs;
22832281

2282+
// Action arguments follow this structure in a buffer
2283+
};
22842284
#endif
22852285

22862286
// Event support
22872287

2288-
struct rkEvent {
2288+
struct Event {
22892289
EVENTID EventID;
22902290
// Data follows
22912291
};
@@ -2356,6 +2356,8 @@ struct evHotplug {
23562356
char Vendor[40]; // Name of vendor
23572357
};
23582358

2359+
} // namespace
2360+
23592361
namespace fl {
23602362

23612363
// Read endian values from files and objects.

src/core/lib_events.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ ERR BroadcastEvent(APTR Event, LONG EventSize)
9999
{
100100
pf::Log log(__FUNCTION__);
101101

102-
if ((!Event) or ((size_t)EventSize < sizeof(rkEvent))) return ERR::NullArgs;
102+
if ((!Event) or ((size_t)EventSize < sizeof(pf::Event))) return ERR::NullArgs;
103103

104-
LONG groupmask = 1<<((((rkEvent *)Event)->EventID>>56) & 0xff);
104+
LONG groupmask = 1<<((((pf::Event *)Event)->EventID>>56) & 0xff);
105105

106106
if (glEventMask & groupmask) {
107107
log.trace("Broadcasting event $%.8x%.8x",
108-
(ULONG)(((rkEvent *)Event)->EventID>>32 & 0xffffffff),
109-
(ULONG)(((rkEvent *)Event)->EventID));
108+
(ULONG)(((pf::Event *)Event)->EventID>>32 & 0xffffffff),
109+
(ULONG)(((pf::Event *)Event)->EventID));
110110
SendMessage(MSGID_EVENT, MSF::NIL, Event, EventSize);
111111
}
112112

@@ -294,9 +294,9 @@ ERR msg_event(APTR Custom, LONG MsgID, LONG MsgType, APTR Message, LONG MsgSize)
294294
{
295295
pf::Log log(__FUNCTION__);
296296

297-
if ((!Message) or ((size_t)MsgSize < sizeof(rkEvent))) return ERR::Okay;
297+
if ((!Message) or ((size_t)MsgSize < sizeof(pf::Event))) return ERR::Okay;
298298

299-
rkEvent *eventmsg = (rkEvent *)Message;
299+
pf::Event *eventmsg = (pf::Event *)Message;
300300

301301
log.msg(VLF::DETAIL|VLF::BRANCH, "Event $%.8x%8x has been received.", (LONG)((eventmsg->EventID>>32)& 0xffffffff),
302302
(LONG)(eventmsg->EventID & 0xffffffff));

src/fluid/fluid_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int fcmd_catch(lua_State *Lua)
261261
// Where Args is a named array containing the event parameters. If the event is not known to Fluid, then no Args will
262262
// be provided.
263263

264-
static void receive_event(rkEvent *Info, LONG InfoSize, APTR CallbackMeta)
264+
static void receive_event(pf::Event *Info, LONG InfoSize, APTR CallbackMeta)
265265
{
266266
auto Script = (objScript *)CurrentContext();
267267
auto prv = (prvFluid *)Script->ChildPrivate;

0 commit comments

Comments
 (0)