Module: check_mk
Branch: master
Commit: 12c09340c6bb946785972542228985206cc21a10
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=12c09340c6bb94…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Mar 11 09:58:10 2016 +0100
Made some Column classes more consistent with the rest.
---
livestatus/src/OffsetDoubleColumn.cc | 3 ---
livestatus/src/OffsetIntColumn.cc | 11 ++++-------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/livestatus/src/OffsetDoubleColumn.cc b/livestatus/src/OffsetDoubleColumn.cc
index 70bff8d..70e90d8 100644
--- a/livestatus/src/OffsetDoubleColumn.cc
+++ b/livestatus/src/OffsetDoubleColumn.cc
@@ -26,9 +26,6 @@
#include <string.h>
double OffsetDoubleColumn::getValue(void *data) {
- if (data == nullptr) {
- return 0;
- }
char *p = static_cast<char *>(shiftPointer(data));
if (p == nullptr) {
return 0;
diff --git a/livestatus/src/OffsetIntColumn.cc b/livestatus/src/OffsetIntColumn.cc
index fe8768b..fffcd61 100644
--- a/livestatus/src/OffsetIntColumn.cc
+++ b/livestatus/src/OffsetIntColumn.cc
@@ -25,13 +25,10 @@
#include "OffsetIntColumn.h"
int32_t OffsetIntColumn::getValue(void *data, Query * /*unused*/) {
- if (data == nullptr) {
- return 0;
- }
-
char *p = reinterpret_cast<char *>(shiftPointer(data));
- if (p != nullptr) {
- return *reinterpret_cast<int *>(p + _offset);
+ if (p == nullptr) {
+ return 0;
}
- return 0;
+ auto ptr = reinterpret_cast<int *>(p + _offset);
+ return static_cast<int32_t>(*ptr);
}