summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44c9e85)
raw | patch | inline | side by side (parent: 44c9e85)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 17:10:45 +0000 (10:10 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 17:10:45 +0000 (10:10 -0700) |
Mainly making a lot of local functions and variables be marked "static",
but there was a "zero as NULL" warning in there too.
but there was a "zero as NULL" warning in there too.
apply.c | patch | blob | history | |
cvs2git.c | patch | blob | history | |
epoch.c | patch | blob | history | |
ls-tree.c | patch | blob | history | |
receive-pack.c | patch | blob | history | |
rev-list.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
ssh-pull.c | patch | blob | history | |
ssh-push.c | patch | blob | history |
index c81b0a240a38b57a9bbd2586889304bef8f5cbbf..701c01a3bcaecfd1e1d4ec3c8b96ab923e2c8c27 100644 (file)
--- a/apply.c
+++ b/apply.c
return offset + hdrsize + patchsize;
}
-const char pluses[] = "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
-const char minuses[]= "----------------------------------------------------------------------";
+static const char pluses[] = "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
+static const char minuses[]= "----------------------------------------------------------------------";
static void show_stats(struct patch *patch)
{
diff --git a/cvs2git.c b/cvs2git.c
index ab0590872e113531aba897e587a08a8dbacf84d9..8c50e67d52399847d2dff77910872507b9fba305 100644 (file)
--- a/cvs2git.c
+++ b/cvs2git.c
printf("git-update-cache --add -- '%s'\n", name);
}
-struct hdrentry {
+static struct hdrentry {
const char *name;
char *dest;
} hdrs[] = {
index 3cbff72b3bf3f57b0a643762bb9651c8570a6f06..6dbcfb34a5a8762608e99fe79f1a4f17475d6f8a 100644 (file)
--- a/epoch.c
+++ b/epoch.c
static struct fraction *one = NULL;
static struct fraction *zero = NULL;
-static BN_CTX *get_BN_CTX()
+static BN_CTX *get_BN_CTX(void)
{
if (!context) {
context = BN_CTX_new();
return context;
}
-static struct fraction *new_zero()
+static struct fraction *new_zero(void)
{
struct fraction *result = xmalloc(sizeof(*result));
BN_init(&result->numerator);
return fraction;
}
-static struct fraction *get_one()
+static struct fraction *get_one(void)
{
if (!one) {
one = new_zero();
return one;
}
-static struct fraction *get_zero()
+static struct fraction *get_zero(void)
{
if (!zero) {
zero = new_zero();
diff --git a/ls-tree.c b/ls-tree.c
index 450bff2472084098af018460567c51ef90b847ad..8d524b89a2a3cecf8d820ddc335e7159db5ccdb1 100644 (file)
--- a/ls-tree.c
+++ b/ls-tree.c
slash = strchr(path, '/');
if (!slash) {
len = strlen(path);
- next = 0;
+ next = NULL;
}
else {
next = slash + 1;
diff --git a/receive-pack.c b/receive-pack.c
index d05f7d5ec42a088b29d3cac14d42b416013aedf7..dfa7cd1d0a81eade8225e11dc0f2b97682a905c0 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
char ref_name[0];
};
-struct command *commands = NULL;
+static struct command *commands = NULL;
static int is_all_zeroes(const char *hex)
{
diff --git a/rev-list.c b/rev-list.c
index 362342eabc1122cd50d717efa86e5769aec9003f..fb75c22bc7c88741758069977afb706f44758cdc 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
return best;
}
-struct commit_list *limit_list(struct commit_list *list)
+static struct commit_list *limit_list(struct commit_list *list)
{
struct commit_list *newlist = NULL;
struct commit_list **p = &newlist;
diff --git a/sha1_file.c b/sha1_file.c
index a4ed4f9cdce7c5ee44aa6d429edaad1d1097b62b..b18e467d8c93843882c892f8810904a9fcd20b01 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return inflate(stream, 0);
}
-void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size)
+static void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size)
{
int bytes = strlen(buffer) + 1;
unsigned char *buf = xmalloc(1+size);
diff --git a/ssh-pull.c b/ssh-pull.c
index 87d523899a83d8c0d3c5ff721208ded30c1a38f4..26356dd7d84ea1bc9f7320b18562ed4117d4fac0 100644 (file)
--- a/ssh-pull.c
+++ b/ssh-pull.c
return ret;
}
-int get_version(void)
+static int get_version(void)
{
char type = 'v';
write(fd_out, &type, 1);
diff --git a/ssh-push.c b/ssh-push.c
index db69c889e79da7afac3fc7791000fd31ec61adb5..090d6f9f8fbde2d736ac5bf563415b0fa402b5aa 100644 (file)
--- a/ssh-push.c
+++ b/ssh-push.c
#include <string.h>
-unsigned char local_version = 1;
-unsigned char remote_version = 0;
+static unsigned char local_version = 1;
+static unsigned char remote_version = 0;
-int serve_object(int fd_in, int fd_out) {
+static int serve_object(int fd_in, int fd_out) {
ssize_t size;
int posn = 0;
unsigned char sha1[20];
return 0;
}
-int serve_version(int fd_in, int fd_out)
+static int serve_version(int fd_in, int fd_out)
{
if (read(fd_in, &remote_version, 1) < 1)
return -1;
return 0;
}
-int serve_ref(int fd_in, int fd_out)
+static int serve_ref(int fd_in, int fd_out)
{
char ref[PATH_MAX];
unsigned char sha1[20];
}
-void service(int fd_in, int fd_out) {
+static void service(int fd_in, int fd_out) {
char type;
int retval;
do {