Skip to content

Commit

Permalink
Convert narrowing casts from T{} to static_cast<T>(): url/
Browse files Browse the repository at this point in the history
The style guide encourages use of T{}-style casts under the assumption
that the compiler will warn about narrowing.  This warning is currently
disabled; enabling it requires fixing up the cases that narrow.

Bug: 1216696
Change-Id: I9dc6132462fb8f02b197bf688b690b308e9cb4da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2946568
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890410}
  • Loading branch information
pkasting authored and Chromium LUCI CQ committed Jun 8, 2021
1 parent 6e6d1f1 commit 119c418
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion url/url_canon_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ int _itow_s(int value, char16_t* buffer, size_t size_in_chars, int radix) {
}

for (int i = 0; i < written; ++i) {
buffer[i] = char16_t{temp[i]};
buffer[i] = static_cast<char16_t>(temp[i]);
}
buffer[written] = '\0';
return 0;
Expand Down

0 comments on commit 119c418

Please sign in to comment.