Leverage the min macro from util.h

This commit is contained in:
Philip Kelley 2012-11-29 08:35:21 -05:00
parent 6762fe087b
commit 4a6621fdf7
2 changed files with 3 additions and 6 deletions

View File

@ -30,7 +30,6 @@ static const char *basic_authtype = "Basic";
#define PARSE_ERROR_REPLAY -2
#define CHUNK_SIZE 4096
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
enum last_cb {
NONE,
@ -542,7 +541,7 @@ static int http_stream_write_chunked(
}
else {
/* Append as much to the buffer as we can */
int count = MIN(CHUNK_SIZE - s->chunk_buffer_len, len);
int count = min(CHUNK_SIZE - s->chunk_buffer_len, len);
if (!s->chunk_buffer)
s->chunk_buffer = git__malloc(CHUNK_SIZE);

View File

@ -30,8 +30,6 @@
#define CACHED_POST_BODY_BUF_SIZE 4096
#define UUID_LENGTH_CCH 32
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
static const char *prefix_http = "http://";
static const char *prefix_https = "https://";
static const char *upload_pack_service = "upload-pack";
@ -395,7 +393,7 @@ replay:
DWORD bytes_written;
if (!ReadFile(s->post_body, buffer,
MIN(CACHED_POST_BODY_BUF_SIZE, len),
min(CACHED_POST_BODY_BUF_SIZE, len),
&bytes_read, NULL) ||
!bytes_read) {
git__free(buffer);
@ -699,7 +697,7 @@ static int winhttp_stream_write_chunked(
}
else {
/* Append as much to the buffer as we can */
int count = MIN(CACHED_POST_BODY_BUF_SIZE - s->chunk_buffer_len, len);
int count = min(CACHED_POST_BODY_BUF_SIZE - s->chunk_buffer_len, len);
if (!s->chunk_buffer)
s->chunk_buffer = git__malloc(CACHED_POST_BODY_BUF_SIZE);