Skip to content

Commit

Permalink
Fix returning -1 to an unsigned int return value in getLastRead/Write…
Browse files Browse the repository at this point in the history
…Index
  • Loading branch information
Isaac Connor committed Oct 29, 2024
1 parent 9f536cc commit fd9d014
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/zm_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,11 +1378,11 @@ SystemTimePoint Monitor::GetTimestamp(int index) const {
return {};
}

unsigned int Monitor::GetLastReadIndex() const {
int Monitor::GetLastReadIndex() const {
return ( shared_data->last_read_index != image_buffer_count ? shared_data->last_read_index : -1 );
}

unsigned int Monitor::GetLastWriteIndex() const {
int Monitor::GetLastWriteIndex() const {
return ( shared_data->last_write_index != image_buffer_count ? shared_data->last_write_index : -1 );
}

Expand Down
4 changes: 2 additions & 2 deletions src/zm_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@ class Monitor : public std::enable_shared_from_this<Monitor> {
unsigned int GetCaptureMaxFPS() const { return capture_max_fps; }
Microseconds GetCaptureDelay() const { return capture_delay; }
Microseconds GetAlarmCaptureDelay() const { return alarm_capture_delay; }
unsigned int GetLastReadIndex() const;
unsigned int GetLastWriteIndex() const;
int GetLastReadIndex() const;
int GetLastWriteIndex() const;
uint64_t GetLastEventId() const;
double GetFPS() const;
void UpdateFPS();
Expand Down

0 comments on commit fd9d014

Please sign in to comment.