isc_throw(JSONError, std::string("Number overflow: ") + number);
}
}
-
+
if (is_double) {
return (Element::create(d));
} else {
ConstElementPtr value = Element::fromJSON(in, file, line, pos);
map->set(key, value);
-
+
skip_to(in, file, line, pos, ",}", WHITESPACE);
c = in.get();
pos++;
if (!b) {
return (result);
}
-
+
if (a->getType() != Element::map || b->getType() != Element::map) {
isc_throw(TypeError, "Non-map Elements passed to removeIdentical");
}
other->getType() != Element::map) {
isc_throw(TypeError, "merge arguments not MapElements");
}
-
+
const std::map<std::string, ConstElementPtr>& m = other->mapValue();
for (std::map<std::string, ConstElementPtr>::const_iterator it = m.begin();
it != m.end() ; ++it) {
addr = addr.substr(0, addr.find_first_of(" "));
IOAddress a(addr);
iface->addAddress(a);
- } else if(line.find("Metric")) {
+ } else if(line.find("Metric") != string::npos) {
// flags
if (line.find("UP") != string::npos) {
iface->flag_up_ = true;
renderer_(NULL),
names_(names)
{}
- MessageRendererBenchMark() {
+ ~MessageRendererBenchMark() {
delete renderer_;
}
unsigned int run() {
class RdataRenderBenchMark {
public:
RdataRenderBenchMark(const vector<T>& dataset) :
- dataset_(dataset)
+ dataset_(dataset),
+ renderer_(NULL)
{}
- RdataRenderBenchMark() {
+ ~RdataRenderBenchMark() {
delete renderer_;
}
unsigned int run() {
const PyObject* rrtype;
const PyObject* rrttl;
const PyObject* rdata;
- s_EDNS* edns_obj = NULL;
assert(null_self == NULL);
&rrclass_type, &rrclass, &rrtype_type, &rrtype,
&rrttl_type, &rrttl, &rdata_type, &rdata)) {
uint8_t extended_rcode;
- edns_obj = PyObject_New(s_EDNS, &edns_type);
+ s_EDNS* edns_obj = PyObject_New(s_EDNS, &edns_type);
if (edns_obj == NULL) {
return (NULL);
}
try {
const uint32_t subtype = tokenToNum<int32_t, 16>(getToken(iss));
const Name servername(getToken(iss));
- string server;
if (!iss.eof()) {
isc_throw(InvalidRdataText, "Unexpected input for AFSDB"
// we assume class/type numbers are officially unassigned. If not we'll
// need to update the test cases.
- static const uint16_t test_class_code = 65533;
+ static const uint16_t test_class_code = 65533;
static const uint16_t test_type_code = 65534;
static const string test_class_str;
static const string test_type_str;
// the first removal attempt should succeed
EXPECT_TRUE(RRParamRegistry::getRegistry().removeType(test_type_code));
- // then toText() should treat it as an "unknown"
+ // then toText() should treat it as an "unknown"
EXPECT_EQ(test_type_unknown_str, RRType(test_type_code).toText());
// attempt of removing non-existent mapping should result in 'false'
EXPECT_FALSE(RRParamRegistry::getRegistry().removeType(test_type_code));
// Get a text representation of the current time.
time_t curtime;
time(&curtime);
- char* buffer = ctime(&curtime);
+ struct tm* timeinfo;
+ timeinfo = localtime(&curtime);
- // Convert to string and strip out the trailing newline
- string current_time = buffer;
- return (isc::util::str::trim(current_time));
+ char buffer[80];
+ strftime(buffer, 80, "%a %b %d %Y %H:%M", timeinfo);
+
+ return (std::string(buffer));
}
LoggerSpecification cur_spec(ROOT_NAME);// Current specification
OutputOption cur_opt; // Current output option
vector<LoggerSpecification> loggers; // Set of logger specifications
- vector<OutputOption> options; // Output options for logger
std::string severity; // Severity set for logger
// Initialize logging system - set the root logger name.
* merchantability of this software or the suitability of this
* software for any particular purpose. It is provided "as is"
* without express or implied warranty of any kind.
- *
+ *
*/
#include <util/hash/sha1.h>
return ((x) ^ (y) ^ (z));
}
-static inline int
+static inline int
SHA1CircularShift(uint8_t bits, uint32_t word) {
return ((word << bits) | (word >> (32 - bits)));
}