Do not use C-style casts.
GitOrigin-RevId: 6187bc8f4837fd40aba7ef613e09ecb93e3cf951
This commit is contained in:
parent
18b8e87e74
commit
480f826d16
@ -82,13 +82,13 @@ class TlWriterDotNet : public TL_writer {
|
||||
static std::string to_cCamelCase(const std::string &name, bool flag) {
|
||||
bool next_to_upper = flag;
|
||||
std::string result;
|
||||
for (int i = 0; i < (int)name.size(); i++) {
|
||||
for (std::size_t i = 0; i < name.size(); i++) {
|
||||
if (!is_alnum(name[i])) {
|
||||
next_to_upper = true;
|
||||
continue;
|
||||
}
|
||||
if (next_to_upper) {
|
||||
result += (char)to_upper(name[i]);
|
||||
result += to_upper(name[i]);
|
||||
next_to_upper = false;
|
||||
} else {
|
||||
result += name[i];
|
||||
@ -98,7 +98,7 @@ class TlWriterDotNet : public TL_writer {
|
||||
}
|
||||
|
||||
std::string gen_native_field_name(std::string name) const {
|
||||
for (int i = 0; i < (int)name.size(); i++) {
|
||||
for (std::size_t i = 0; i < name.size(); i++) {
|
||||
if (!is_alnum(name[i])) {
|
||||
name[i] = '_';
|
||||
}
|
||||
@ -115,7 +115,7 @@ class TlWriterDotNet : public TL_writer {
|
||||
if (name == "#") {
|
||||
return "int32_t";
|
||||
}
|
||||
for (int i = 0; i < (int)name.size(); i++) {
|
||||
for (std::size_t i = 0; i < name.size(); i++) {
|
||||
if (!is_alnum(name[i])) {
|
||||
name[i] = '_';
|
||||
}
|
||||
@ -163,7 +163,7 @@ class TlWriterDotNet : public TL_writer {
|
||||
|
||||
if (name == "Vector") {
|
||||
assert(t->arity == 1);
|
||||
assert((int)tree_type->children.size() == 1);
|
||||
assert(tree_type->children.size() == 1);
|
||||
assert(tree_type->children[0]->get_type() == NODE_TYPE_TYPE);
|
||||
const tl_tree_type *child = static_cast<const tl_tree_type *>(tree_type->children[0]);
|
||||
|
||||
@ -172,7 +172,7 @@ class TlWriterDotNet : public TL_writer {
|
||||
|
||||
assert(!is_built_in_simple_type(name) && !is_built_in_complex_type(name));
|
||||
|
||||
for (int i = 0; i < (int)tree_type->children.size(); i++) {
|
||||
for (std::size_t i = 0; i < tree_type->children.size(); i++) {
|
||||
assert(tree_type->children[i]->get_type() == NODE_TYPE_NAT_CONST);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user