From 04ea97ac8e28f45349fd12dafc7b5544ba5b66a7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 3 Sep 2019 10:07:12 -0400 Subject: [PATCH] Listener: Move port constants into cpp file These are a complete internal detail, so we can hide them from the header entirely. --- include/jbus/Listener.hpp | 4 ---- lib/Listener.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/jbus/Listener.hpp b/include/jbus/Listener.hpp index bf62b3a..d94353a 100644 --- a/include/jbus/Listener.hpp +++ b/include/jbus/Listener.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include @@ -20,9 +19,6 @@ class Listener { std::queue> m_endpointQueue; bool m_running = false; - static const uint32_t DataPort = 0xd6ba; - static const uint32_t ClockPort = 0xc10c; - void listenerProc(); public: diff --git a/lib/Listener.cpp b/lib/Listener.cpp index 24be0a4..ff7d08a 100644 --- a/lib/Listener.cpp +++ b/lib/Listener.cpp @@ -1,5 +1,7 @@ #include "jbus/Listener.hpp" +#include + #include "jbus/Common.hpp" #include "jbus/Endpoint.hpp" @@ -10,6 +12,8 @@ #endif namespace jbus { +constexpr uint32_t DataPort = 0xd6ba; +constexpr uint32_t ClockPort = 0xc10c; void Listener::listenerProc() { #if LOG_LISTENER @@ -29,7 +33,7 @@ void Listener::listenerProc() { WaitGCTicks(GetGCTicksPerSec()); } else { #if LOG_LISTENER - printf("data listening on port %d\n", DataPort); + printf("data listening on port %u\n", DataPort); #endif } } @@ -42,7 +46,7 @@ void Listener::listenerProc() { WaitGCTicks(GetGCTicksPerSec()); } else { #if LOG_LISTENER - printf("clock listening on port %d\n", ClockPort); + printf("clock listening on port %u\n", ClockPort); #endif } }