Commit 4a6621fd by Philip Kelley

Leverage the min macro from util.h

parent 6762fe08
...@@ -30,7 +30,6 @@ static const char *basic_authtype = "Basic"; ...@@ -30,7 +30,6 @@ static const char *basic_authtype = "Basic";
#define PARSE_ERROR_REPLAY -2 #define PARSE_ERROR_REPLAY -2
#define CHUNK_SIZE 4096 #define CHUNK_SIZE 4096
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
enum last_cb { enum last_cb {
NONE, NONE,
...@@ -542,7 +541,7 @@ static int http_stream_write_chunked( ...@@ -542,7 +541,7 @@ static int http_stream_write_chunked(
} }
else { else {
/* Append as much to the buffer as we can */ /* 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) if (!s->chunk_buffer)
s->chunk_buffer = git__malloc(CHUNK_SIZE); s->chunk_buffer = git__malloc(CHUNK_SIZE);
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#define CACHED_POST_BODY_BUF_SIZE 4096 #define CACHED_POST_BODY_BUF_SIZE 4096
#define UUID_LENGTH_CCH 32 #define UUID_LENGTH_CCH 32
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
static const char *prefix_http = "http://"; static const char *prefix_http = "http://";
static const char *prefix_https = "https://"; static const char *prefix_https = "https://";
static const char *upload_pack_service = "upload-pack"; static const char *upload_pack_service = "upload-pack";
...@@ -395,7 +393,7 @@ replay: ...@@ -395,7 +393,7 @@ replay:
DWORD bytes_written; DWORD bytes_written;
if (!ReadFile(s->post_body, buffer, 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, NULL) ||
!bytes_read) { !bytes_read) {
git__free(buffer); git__free(buffer);
...@@ -699,7 +697,7 @@ static int winhttp_stream_write_chunked( ...@@ -699,7 +697,7 @@ static int winhttp_stream_write_chunked(
} }
else { else {
/* Append as much to the buffer as we can */ /* 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) if (!s->chunk_buffer)
s->chunk_buffer = git__malloc(CACHED_POST_BODY_BUF_SIZE); s->chunk_buffer = git__malloc(CACHED_POST_BODY_BUF_SIZE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment