mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix for Val constructor with new int64 typedefs.
Val::Val had prototypes for int, long, int64, etc. But depending on the architecture some of those might be the same (int64 and long) thus yielding a compile error. Fix: only use int32, int64, etc. for prototype. ints and longs can still be passed, since they will match one of these fixed-width types regardless of platform. Also fix some more compiler warnings with format strings.
This commit is contained in:
parent
2aae4eaf91
commit
2ced4839e9
2 changed files with 6 additions and 26 deletions
|
@ -369,25 +369,25 @@ bool XMLSerializationFormat::Write(char v, const char* tag)
|
|||
|
||||
bool XMLSerializationFormat::Write(uint16 v, const char* tag)
|
||||
{
|
||||
const char* tmp = fmt("%u", v);
|
||||
const char* tmp = fmt("%"PRIu16, v);
|
||||
return WriteElem(tag, "uint16", tmp, strlen(tmp));
|
||||
}
|
||||
|
||||
bool XMLSerializationFormat::Write(uint32 v, const char* tag)
|
||||
{
|
||||
const char* tmp = fmt("%u", v);
|
||||
const char* tmp = fmt("%"PRIu32, v);
|
||||
return WriteElem(tag, "uint32", tmp, strlen(tmp));
|
||||
}
|
||||
|
||||
bool XMLSerializationFormat::Write(uint64 v, const char* tag)
|
||||
{
|
||||
const char* tmp = fmt("%llu", v);
|
||||
const char* tmp = fmt("%"PRIu64, v);
|
||||
return WriteElem(tag, "uint64", tmp, strlen(tmp));
|
||||
}
|
||||
|
||||
bool XMLSerializationFormat::Write(int64 v, const char* tag)
|
||||
{
|
||||
const char* tmp = fmt("%lld", v);
|
||||
const char* tmp = fmt("%"PRId64, v);
|
||||
return WriteElem(tag, "int64", tmp, strlen(tmp));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue