Skip to content

Commit 2e966ed

Browse files
committed
fix #555: Use int for index in IEngine::broadcast()
1 parent 8232540 commit 2e966ed

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

include/scratchcpp/iengine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class LIBSCRATCHCPP_EXPORT IEngine
6060
virtual VirtualMachine *startScript(std::shared_ptr<Block> topLevelBlock, Target *) = 0;
6161

6262
/*! Starts the scripts of the broadcast with the given index. */
63-
virtual void broadcast(unsigned int index) = 0;
63+
virtual void broadcast(int index) = 0;
6464

6565
/*! Starts the scripts of the given broadcast. */
6666
virtual void broadcastByPtr(Broadcast *broadcast) = 0;

src/engine/internal/engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ VirtualMachine *Engine::startScript(std::shared_ptr<Block> topLevelBlock, Target
415415
return pushThread(topLevelBlock, target).get();
416416
}
417417

418-
void Engine::broadcast(unsigned int index)
418+
void Engine::broadcast(int index)
419419
{
420420
if (index < 0 || index >= m_broadcasts.size())
421421
return;

src/engine/internal/engine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Engine : public IEngine
3535
void start() override;
3636
void stop() override;
3737
VirtualMachine *startScript(std::shared_ptr<Block> topLevelBlock, Target *target) override;
38-
void broadcast(unsigned int index) override;
38+
void broadcast(int index) override;
3939
void broadcastByPtr(Broadcast *broadcast) override;
4040
void startBackdropScripts(Broadcast *broadcast) override;
4141
void stopScript(VirtualMachine *vm) override;

test/mocks/enginemock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class EngineMock : public IEngine
1717
MOCK_METHOD(void, start, (), (override));
1818
MOCK_METHOD(void, stop, (), (override));
1919
MOCK_METHOD(VirtualMachine *, startScript, (std::shared_ptr<Block>, Target *), (override));
20-
MOCK_METHOD(void, broadcast, (unsigned int), (override));
20+
MOCK_METHOD(void, broadcast, (int), (override));
2121
MOCK_METHOD(void, broadcastByPtr, (Broadcast *), (override));
2222
MOCK_METHOD(void, startBackdropScripts, (Broadcast *), (override));
2323
MOCK_METHOD(void, stopScript, (VirtualMachine *), (override));

0 commit comments

Comments
 (0)