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

Unified Diff: net/base/nss_memio.c

Issue 42013: Slight code change to make some global variables const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | « net/base/net_util_unittest.cc ('k') | net/base/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/nss_memio.c
===================================================================
--- net/base/nss_memio.c (revision 11293)
+++ net/base/nss_memio.c (working copy)
@@ -168,14 +168,14 @@
transferred += len;
/* Handle part after wrap */
- len = PR_MIN(n, memio_buffer_unused_contiguous(mb));
- if (len > 0) {
+ len = PR_MIN(n, memio_buffer_unused_contiguous(mb));
+ if (len > 0) {
/* Output buffer still not full, input buffer still not empty */
- memcpy(&mb->buf[mb->tail], buf, len);
- mb->tail += len;
+ memcpy(&mb->buf[mb->tail], buf, len);
+ mb->tail += len;
if (mb->tail == mb->bufsize)
mb->tail = 0;
- transferred += len;
+ transferred += len;
}
}
@@ -201,13 +201,13 @@
transferred += len;
/* Handle part after wrap */
- len = PR_MIN(n, memio_buffer_used_contiguous(mb));
- if (len) {
- memcpy(buf, &mb->buf[mb->head], len);
- mb->head += len;
+ len = PR_MIN(n, memio_buffer_used_contiguous(mb));
+ if (len) {
+ memcpy(buf, &mb->buf[mb->head], len);
+ mb->head += len;
if (mb->head == mb->bufsize)
mb->head = 0;
- transferred += len;
+ transferred += len;
}
}
@@ -429,7 +429,7 @@
if (bytes_read > 0) {
mb->tail += bytes_read;
if (mb->tail == mb->bufsize)
- mb->tail = 0;
+ mb->tail = 0;
} else if (bytes_read == 0) {
/* Record EOF condition and report to caller when buffer runs dry */
((PRFilePrivate *)secret)->eof = PR_TRUE;
@@ -472,8 +472,8 @@
#define CHECKEQ(a, b) { \
if ((a) != (b)) { \
- printf("%d != %d, Test failed line %d\n", a, b, __LINE__); \
- exit(1); \
+ printf("%d != %d, Test failed line %d\n", a, b, __LINE__); \
+ exit(1); \
} \
}
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/base/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698