Commit 193e7ce9 by Patrick Steinhardt Committed by Edward Thomson

streams: make file-local functions static

The callback functions that implement the `git_stream` structure are
only used inside of their respective implementation files, but they are
not marked as `static`. Fix this.
parent 2f1d6eff
...@@ -246,7 +246,7 @@ typedef struct { ...@@ -246,7 +246,7 @@ typedef struct {
} mbedtls_stream; } mbedtls_stream;
int mbedtls_connect(git_stream *stream) static int mbedtls_connect(git_stream *stream)
{ {
int ret; int ret;
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
...@@ -266,7 +266,7 @@ int mbedtls_connect(git_stream *stream) ...@@ -266,7 +266,7 @@ int mbedtls_connect(git_stream *stream)
return verify_server_cert(st->ssl); return verify_server_cert(st->ssl);
} }
int mbedtls_certificate(git_cert **out, git_stream *stream) static int mbedtls_certificate(git_cert **out, git_stream *stream)
{ {
unsigned char *encoded_cert; unsigned char *encoded_cert;
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
...@@ -303,7 +303,7 @@ static int mbedtls_set_proxy(git_stream *stream, const git_proxy_options *proxy_ ...@@ -303,7 +303,7 @@ static int mbedtls_set_proxy(git_stream *stream, const git_proxy_options *proxy_
return git_stream_set_proxy(st->io, proxy_options); return git_stream_set_proxy(st->io, proxy_options);
} }
ssize_t mbedtls_stream_write(git_stream *stream, const char *data, size_t data_len, int flags) static ssize_t mbedtls_stream_write(git_stream *stream, const char *data, size_t data_len, int flags)
{ {
ssize_t written = 0, len = min(data_len, SSIZE_MAX); ssize_t written = 0, len = min(data_len, SSIZE_MAX);
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
...@@ -321,7 +321,7 @@ ssize_t mbedtls_stream_write(git_stream *stream, const char *data, size_t data_l ...@@ -321,7 +321,7 @@ ssize_t mbedtls_stream_write(git_stream *stream, const char *data, size_t data_l
return written; return written;
} }
ssize_t mbedtls_stream_read(git_stream *stream, void *data, size_t len) static ssize_t mbedtls_stream_read(git_stream *stream, void *data, size_t len)
{ {
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
int ret; int ret;
...@@ -332,7 +332,7 @@ ssize_t mbedtls_stream_read(git_stream *stream, void *data, size_t len) ...@@ -332,7 +332,7 @@ ssize_t mbedtls_stream_read(git_stream *stream, void *data, size_t len)
return ret; return ret;
} }
int mbedtls_stream_close(git_stream *stream) static int mbedtls_stream_close(git_stream *stream)
{ {
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
int ret = 0; int ret = 0;
...@@ -345,7 +345,7 @@ int mbedtls_stream_close(git_stream *stream) ...@@ -345,7 +345,7 @@ int mbedtls_stream_close(git_stream *stream)
return st->owned ? git_stream_close(st->io) : 0; return st->owned ? git_stream_close(st->io) : 0;
} }
void mbedtls_stream_free(git_stream *stream) static void mbedtls_stream_free(git_stream *stream)
{ {
mbedtls_stream *st = (mbedtls_stream *) stream; mbedtls_stream *st = (mbedtls_stream *) stream;
......
...@@ -572,9 +572,7 @@ typedef struct { ...@@ -572,9 +572,7 @@ typedef struct {
git_cert_x509 cert_info; git_cert_x509 cert_info;
} openssl_stream; } openssl_stream;
int openssl_close(git_stream *stream); static int openssl_connect(git_stream *stream)
int openssl_connect(git_stream *stream)
{ {
int ret; int ret;
BIO *bio; BIO *bio;
...@@ -602,7 +600,7 @@ int openssl_connect(git_stream *stream) ...@@ -602,7 +600,7 @@ int openssl_connect(git_stream *stream)
return verify_server_cert(st->ssl, st->host); return verify_server_cert(st->ssl, st->host);
} }
int openssl_certificate(git_cert **out, git_stream *stream) static int openssl_certificate(git_cert **out, git_stream *stream)
{ {
openssl_stream *st = (openssl_stream *) stream; openssl_stream *st = (openssl_stream *) stream;
int len; int len;
...@@ -644,7 +642,7 @@ static int openssl_set_proxy(git_stream *stream, const git_proxy_options *proxy_ ...@@ -644,7 +642,7 @@ static int openssl_set_proxy(git_stream *stream, const git_proxy_options *proxy_
return git_stream_set_proxy(st->io, proxy_opts); return git_stream_set_proxy(st->io, proxy_opts);
} }
ssize_t openssl_write(git_stream *stream, const char *data, size_t data_len, int flags) static ssize_t openssl_write(git_stream *stream, const char *data, size_t data_len, int flags)
{ {
openssl_stream *st = (openssl_stream *) stream; openssl_stream *st = (openssl_stream *) stream;
int ret, len = min(data_len, INT_MAX); int ret, len = min(data_len, INT_MAX);
...@@ -658,7 +656,7 @@ ssize_t openssl_write(git_stream *stream, const char *data, size_t data_len, int ...@@ -658,7 +656,7 @@ ssize_t openssl_write(git_stream *stream, const char *data, size_t data_len, int
return ret; return ret;
} }
ssize_t openssl_read(git_stream *stream, void *data, size_t len) static ssize_t openssl_read(git_stream *stream, void *data, size_t len)
{ {
openssl_stream *st = (openssl_stream *) stream; openssl_stream *st = (openssl_stream *) stream;
int ret; int ret;
...@@ -669,7 +667,7 @@ ssize_t openssl_read(git_stream *stream, void *data, size_t len) ...@@ -669,7 +667,7 @@ ssize_t openssl_read(git_stream *stream, void *data, size_t len)
return ret; return ret;
} }
int openssl_close(git_stream *stream) static int openssl_close(git_stream *stream)
{ {
openssl_stream *st = (openssl_stream *) stream; openssl_stream *st = (openssl_stream *) stream;
int ret; int ret;
...@@ -682,7 +680,7 @@ int openssl_close(git_stream *stream) ...@@ -682,7 +680,7 @@ int openssl_close(git_stream *stream)
return st->owned ? git_stream_close(st->io) : 0; return st->owned ? git_stream_close(st->io) : 0;
} }
void openssl_free(git_stream *stream) static void openssl_free(git_stream *stream)
{ {
openssl_stream *st = (openssl_stream *) stream; openssl_stream *st = (openssl_stream *) stream;
......
...@@ -69,7 +69,7 @@ static int close_socket(GIT_SOCKET s) ...@@ -69,7 +69,7 @@ static int close_socket(GIT_SOCKET s)
} }
int socket_connect(git_stream *stream) static int socket_connect(git_stream *stream)
{ {
struct addrinfo *info = NULL, *p; struct addrinfo *info = NULL, *p;
struct addrinfo hints; struct addrinfo hints;
...@@ -130,7 +130,7 @@ int socket_connect(git_stream *stream) ...@@ -130,7 +130,7 @@ int socket_connect(git_stream *stream)
return 0; return 0;
} }
ssize_t socket_write(git_stream *stream, const char *data, size_t data_len, int flags) static ssize_t socket_write(git_stream *stream, const char *data, size_t data_len, int flags)
{ {
ssize_t ret, off = 0, len = min(data_len, SSIZE_MAX); ssize_t ret, off = 0, len = min(data_len, SSIZE_MAX);
git_socket_stream *st = (git_socket_stream *) stream; git_socket_stream *st = (git_socket_stream *) stream;
...@@ -149,7 +149,7 @@ ssize_t socket_write(git_stream *stream, const char *data, size_t data_len, int ...@@ -149,7 +149,7 @@ ssize_t socket_write(git_stream *stream, const char *data, size_t data_len, int
return off; return off;
} }
ssize_t socket_read(git_stream *stream, void *data, size_t len) static ssize_t socket_read(git_stream *stream, void *data, size_t len)
{ {
ssize_t ret; ssize_t ret;
git_socket_stream *st = (git_socket_stream *) stream; git_socket_stream *st = (git_socket_stream *) stream;
...@@ -160,7 +160,7 @@ ssize_t socket_read(git_stream *stream, void *data, size_t len) ...@@ -160,7 +160,7 @@ ssize_t socket_read(git_stream *stream, void *data, size_t len)
return ret; return ret;
} }
int socket_close(git_stream *stream) static int socket_close(git_stream *stream)
{ {
git_socket_stream *st = (git_socket_stream *) stream; git_socket_stream *st = (git_socket_stream *) stream;
int error; int error;
...@@ -171,7 +171,7 @@ int socket_close(git_stream *stream) ...@@ -171,7 +171,7 @@ int socket_close(git_stream *stream)
return error; return error;
} }
void socket_free(git_stream *stream) static void socket_free(git_stream *stream)
{ {
git_socket_stream *st = (git_socket_stream *) stream; git_socket_stream *st = (git_socket_stream *) stream;
......
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