From e9681fcdcf847928c4e9e289ed440a6df44ba7c9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 23 Jul 2020 19:31:12 -0400 Subject: [PATCH] fix use of int or unsigned long instead of int for monitor id --- src/zm_monitor.cpp | 10 +++++----- src/zm_monitor.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 7ef1e3c31..049e73282 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -106,17 +106,17 @@ std::vector split(const std::string &s, char delim) { return elems; } -Monitor::MonitorLink::MonitorLink( int p_id, const char *p_name ) : - id( p_id ), +Monitor::MonitorLink::MonitorLink(unsigned int p_id, const char *p_name) : + id(p_id), shared_data(NULL), trigger_data(NULL), video_store_data(NULL) { - strncpy( name, p_name, sizeof(name)-1 ); + strncpy(name, p_name, sizeof(name)-1); #if ZM_MEM_MAPPED map_fd = -1; - snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id ); + snprintf(mem_file, sizeof(mem_file), "%s/zm.mmap.%d", staticConfig.PATH_MAP.c_str(), id); #else // ZM_MEM_MAPPED shm_id = 0; #endif // ZM_MEM_MAPPED @@ -276,7 +276,7 @@ bool Monitor::MonitorLink::hasAlarmed() { } Monitor::Monitor( - int p_id, + unsigned int p_id, const char *p_name, const unsigned int p_server_id, const unsigned int p_storage_id, diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 32489313f..6ff3fb5c0 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -218,10 +218,10 @@ protected: uint64_t last_event; public: - MonitorLink(int p_id, const char *p_name); + MonitorLink(unsigned int p_id, const char *p_name); ~MonitorLink(); - inline int Id() const { + inline unsigned int Id() const { return id; } inline const char *Name() const { @@ -366,12 +366,12 @@ protected: std::vector groups; public: - explicit Monitor( int p_id ); + explicit Monitor(unsigned int p_id); // OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info. //bool OurCheckAlarms( Zone *zone, const Image *pImage ); Monitor( - int p_id, + unsigned int p_id, const char *p_name, unsigned int p_server_id, unsigned int p_storage_id, @@ -428,7 +428,7 @@ public: return shared_data->valid; } - inline int Id() const { + inline unsigned int Id() const { return id; } inline const char *Name() const {