fix use of int or unsigned long instead of int for monitor id

This commit is contained in:
Isaac Connor 2020-07-23 19:31:12 -04:00
parent ee4d90d906
commit e9681fcdcf
2 changed files with 10 additions and 10 deletions

View File

@ -106,17 +106,17 @@ std::vector<std::string> split(const std::string &s, char delim) {
return elems; return elems;
} }
Monitor::MonitorLink::MonitorLink( int p_id, const char *p_name ) : Monitor::MonitorLink::MonitorLink(unsigned int p_id, const char *p_name) :
id( p_id ), id(p_id),
shared_data(NULL), shared_data(NULL),
trigger_data(NULL), trigger_data(NULL),
video_store_data(NULL) video_store_data(NULL)
{ {
strncpy( name, p_name, sizeof(name)-1 ); strncpy(name, p_name, sizeof(name)-1);
#if ZM_MEM_MAPPED #if ZM_MEM_MAPPED
map_fd = -1; 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 #else // ZM_MEM_MAPPED
shm_id = 0; shm_id = 0;
#endif // ZM_MEM_MAPPED #endif // ZM_MEM_MAPPED
@ -276,7 +276,7 @@ bool Monitor::MonitorLink::hasAlarmed() {
} }
Monitor::Monitor( Monitor::Monitor(
int p_id, unsigned int p_id,
const char *p_name, const char *p_name,
const unsigned int p_server_id, const unsigned int p_server_id,
const unsigned int p_storage_id, const unsigned int p_storage_id,

View File

@ -218,10 +218,10 @@ protected:
uint64_t last_event; uint64_t last_event;
public: public:
MonitorLink(int p_id, const char *p_name); MonitorLink(unsigned int p_id, const char *p_name);
~MonitorLink(); ~MonitorLink();
inline int Id() const { inline unsigned int Id() const {
return id; return id;
} }
inline const char *Name() const { inline const char *Name() const {
@ -366,12 +366,12 @@ protected:
std::vector<Group *> groups; std::vector<Group *> groups;
public: 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. // OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info.
//bool OurCheckAlarms( Zone *zone, const Image *pImage ); //bool OurCheckAlarms( Zone *zone, const Image *pImage );
Monitor( Monitor(
int p_id, unsigned int p_id,
const char *p_name, const char *p_name,
unsigned int p_server_id, unsigned int p_server_id,
unsigned int p_storage_id, unsigned int p_storage_id,
@ -428,7 +428,7 @@ public:
return shared_data->valid; return shared_data->valid;
} }
inline int Id() const { inline unsigned int Id() const {
return id; return id;
} }
inline const char *Name() const { inline const char *Name() const {