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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c
index 48d21dd..7ca3aa6 100644
--- a/src/streams/mbedtls.c
+++ b/src/streams/mbedtls.c
@@ -246,7 +246,7 @@ typedef struct {
} mbedtls_stream;
-int mbedtls_connect(git_stream *stream)
+static int mbedtls_connect(git_stream *stream)
{
int ret;
mbedtls_stream *st = (mbedtls_stream *) stream;
@@ -266,7 +266,7 @@ int mbedtls_connect(git_stream *stream)
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;
mbedtls_stream *st = (mbedtls_stream *) stream;
@@ -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);
}
-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);
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
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;
int ret;
@@ -332,7 +332,7 @@ ssize_t mbedtls_stream_read(git_stream *stream, void *data, size_t len)
return ret;
}
-int mbedtls_stream_close(git_stream *stream)
+static int mbedtls_stream_close(git_stream *stream)
{
mbedtls_stream *st = (mbedtls_stream *) stream;
int ret = 0;
@@ -345,7 +345,7 @@ int mbedtls_stream_close(git_stream *stream)
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;
diff --git a/src/streams/openssl.c b/src/streams/openssl.c
index 589b8d1..354e0f8 100644
--- a/src/streams/openssl.c
+++ b/src/streams/openssl.c
@@ -572,9 +572,7 @@ typedef struct {
git_cert_x509 cert_info;
} openssl_stream;
-int openssl_close(git_stream *stream);
-
-int openssl_connect(git_stream *stream)
+static int openssl_connect(git_stream *stream)
{
int ret;
BIO *bio;
@@ -602,7 +600,7 @@ int openssl_connect(git_stream *stream)
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;
int len;
@@ -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);
}
-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;
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
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;
int ret;
@@ -669,7 +667,7 @@ ssize_t openssl_read(git_stream *stream, void *data, size_t len)
return ret;
}
-int openssl_close(git_stream *stream)
+static int openssl_close(git_stream *stream)
{
openssl_stream *st = (openssl_stream *) stream;
int ret;
@@ -682,7 +680,7 @@ int openssl_close(git_stream *stream)
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;
diff --git a/src/streams/socket.c b/src/streams/socket.c
index e46fcd2..7134db4 100644
--- a/src/streams/socket.c
+++ b/src/streams/socket.c
@@ -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 hints;
@@ -130,7 +130,7 @@ int socket_connect(git_stream *stream)
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);
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
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;
git_socket_stream *st = (git_socket_stream *) stream;
@@ -160,7 +160,7 @@ ssize_t socket_read(git_stream *stream, void *data, size_t len)
return ret;
}
-int socket_close(git_stream *stream)
+static int socket_close(git_stream *stream)
{
git_socket_stream *st = (git_socket_stream *) stream;
int error;
@@ -171,7 +171,7 @@ int socket_close(git_stream *stream)
return error;
}
-void socket_free(git_stream *stream)
+static void socket_free(git_stream *stream)
{
git_socket_stream *st = (git_socket_stream *) stream;