Change argument to Tempvar constructor to size_t, avoids conversion warning in template construction

This commit is contained in:
Tim Wojtulewicz 2023-02-17 16:35:27 -07:00 committed by Tim Wojtulewicz
parent 6398329cd5
commit 718cced7cd
2 changed files with 3 additions and 3 deletions

View file

@ -7,10 +7,10 @@
namespace zeek::detail namespace zeek::detail
{ {
TempVar::TempVar(int num, const TypePtr& t, ExprPtr _rhs) : type(t) TempVar::TempVar(size_t num, const TypePtr& t, ExprPtr _rhs) : type(t)
{ {
char buf[8192]; char buf[8192];
snprintf(buf, sizeof buf, "#%d", num); snprintf(buf, sizeof buf, "#%zu", num);
name = buf; name = buf;
rhs = std::move(_rhs); rhs = std::move(_rhs);
} }

View file

@ -17,7 +17,7 @@ namespace zeek::detail
class TempVar class TempVar
{ {
public: public:
TempVar(int num, const TypePtr& t, ExprPtr rhs); TempVar(size_t num, const TypePtr& t, ExprPtr rhs);
const char* Name() const { return name.data(); } const char* Name() const { return name.data(); }
const zeek::Type* Type() const { return type.get(); } const zeek::Type* Type() const { return type.get(); }