comparison src/gaim_buffer.c @ 13212:64bae3cbec8d

[gaim-migrate @ 15576] Mostly documentation. Is there any reason the if statement was written the way it was? This seems more clear to me. Also, gaim_buffer.c doesn't seem like the best name for this. I mean, it's a part of Gaim, does it really need "gaim" in the filename? circbuffer.c seems better to me. Anyone else have an opinion? Because you're wrong. No, just kidding. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 10 Feb 2006 06:07:19 +0000
parents 72414fe08156
children 71a6a6b22149
comparison
equal deleted inserted replaced
13211:ca559e2b1d0a 13212:64bae3cbec8d
88 88
89 /* Grow the buffer, if necessary */ 89 /* Grow the buffer, if necessary */
90 if ((buf->buflen - buf->bufused) < len) 90 if ((buf->buflen - buf->bufused) < len)
91 grow_circ_buffer(buf, len); 91 grow_circ_buffer(buf, len);
92 92
93 /* If we may need to wrap */ 93 /* If there is not enough room to copy all of src before hitting
94 if ((buf->inptr - buf->outptr) >= 0) 94 * the end of the buffer then we will need to do two copies.
95 * One copy from inptr to the end of the buffer, and the
96 * second copy from the start of the buffer to the end of src. */
97 if (buf->inptr >= buf->outptr)
95 len_stored = MIN(len, buf->buflen 98 len_stored = MIN(len, buf->buflen
96 - (buf->inptr - buf->buffer)); 99 - (buf->inptr - buf->buffer));
97 else 100 else
98 len_stored = len; 101 len_stored = len;
99 102