Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1715)

Unified Diff: native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc

Issue 303223007: [NaCl SDK] nacl_io: Run clang-format over nacl_io sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/stream/stream_node.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc b/native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc
index 5ee66d136a73f04d187cbfd5a143464959396a83..4eaf0efd3a27e1fe88cfeffa50369aaa83b79ce6 100644
--- a/native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc
+++ b/native_client_sdk/src/libraries/nacl_io/syscalls/inet_ntop.cc
@@ -43,10 +43,10 @@ const char* inet_ntop(int af, const void* src, char* dst, socklen_t size) {
for (int i = 0; i < 8; i++) {
host_tuples[i] = ntohs(tuples[i]);
if (host_tuples[i] == 0) {
- if (zero_run_start == -1)
- zero_run_start = i;
+ if (zero_run_start == -1)
+ zero_run_start = i;
} else if (zero_run_start != -1 && zero_run_end == -1) {
- zero_run_end = i;
+ zero_run_end = i;
}
}
@@ -64,13 +64,12 @@ const char* inet_ntop(int af, const void* src, char* dst, socklen_t size) {
if (zero_run_start == 0 &&
(zero_run_end == 6 ||
(zero_run_end == 5 && host_tuples[zero_run_end] == 0xffff))) {
-
if (zero_run_end == 5) {
strcpy(dst, "::ffff:");
} else {
strcpy(dst, "::");
}
- inet_ntop(AF_INET, host_tuples+6, dst+strlen(dst), INET_ADDRSTRLEN);
+ inet_ntop(AF_INET, host_tuples + 6, dst + strlen(dst), INET_ADDRSTRLEN);
} else {
std::stringstream output;
for (int i = 0; i < 8; i++) {
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/stream/stream_node.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698