Fix sparse warnings.
Mainly making a lot of local functions and variables be marked "static", but there was a "zero as NULL" warning in there too.maint
parent
44c9e8594e
commit
6da4016aea
4
apply.c
4
apply.c
|
@ -724,8 +724,8 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
|
||||||
return offset + hdrsize + patchsize;
|
return offset + hdrsize + patchsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char pluses[] = "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
|
static const char pluses[] = "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
|
||||||
const char minuses[]= "----------------------------------------------------------------------";
|
static const char minuses[]= "----------------------------------------------------------------------";
|
||||||
|
|
||||||
static void show_stats(struct patch *patch)
|
static void show_stats(struct patch *patch)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,7 +206,7 @@ static void update_file(char *line)
|
||||||
printf("git-update-cache --add -- '%s'\n", name);
|
printf("git-update-cache --add -- '%s'\n", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hdrentry {
|
static struct hdrentry {
|
||||||
const char *name;
|
const char *name;
|
||||||
char *dest;
|
char *dest;
|
||||||
} hdrs[] = {
|
} hdrs[] = {
|
||||||
|
|
8
epoch.c
8
epoch.c
|
@ -28,7 +28,7 @@ static BN_CTX *context = NULL;
|
||||||
static struct fraction *one = NULL;
|
static struct fraction *one = NULL;
|
||||||
static struct fraction *zero = NULL;
|
static struct fraction *zero = NULL;
|
||||||
|
|
||||||
static BN_CTX *get_BN_CTX()
|
static BN_CTX *get_BN_CTX(void)
|
||||||
{
|
{
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = BN_CTX_new();
|
context = BN_CTX_new();
|
||||||
|
@ -36,7 +36,7 @@ static BN_CTX *get_BN_CTX()
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fraction *new_zero()
|
static struct fraction *new_zero(void)
|
||||||
{
|
{
|
||||||
struct fraction *result = xmalloc(sizeof(*result));
|
struct fraction *result = xmalloc(sizeof(*result));
|
||||||
BN_init(&result->numerator);
|
BN_init(&result->numerator);
|
||||||
|
@ -75,7 +75,7 @@ static struct fraction *init_fraction(struct fraction *fraction)
|
||||||
return fraction;
|
return fraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fraction *get_one()
|
static struct fraction *get_one(void)
|
||||||
{
|
{
|
||||||
if (!one) {
|
if (!one) {
|
||||||
one = new_zero();
|
one = new_zero();
|
||||||
|
@ -84,7 +84,7 @@ static struct fraction *get_one()
|
||||||
return one;
|
return one;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fraction *get_zero()
|
static struct fraction *get_zero(void)
|
||||||
{
|
{
|
||||||
if (!zero) {
|
if (!zero) {
|
||||||
zero = new_zero();
|
zero = new_zero();
|
||||||
|
|
|
@ -79,7 +79,7 @@ static struct tree_entry_list *find_entry(const char *path)
|
||||||
slash = strchr(path, '/');
|
slash = strchr(path, '/');
|
||||||
if (!slash) {
|
if (!slash) {
|
||||||
len = strlen(path);
|
len = strlen(path);
|
||||||
next = 0;
|
next = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
next = slash + 1;
|
next = slash + 1;
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct command {
|
||||||
char ref_name[0];
|
char ref_name[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct command *commands = NULL;
|
static struct command *commands = NULL;
|
||||||
|
|
||||||
static int is_all_zeroes(const char *hex)
|
static int is_all_zeroes(const char *hex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -310,7 +310,7 @@ static struct commit_list *find_bisection(struct commit_list *list)
|
||||||
return best;
|
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 *newlist = NULL;
|
||||||
struct commit_list **p = &newlist;
|
struct commit_list **p = &newlist;
|
||||||
|
|
|
@ -531,7 +531,7 @@ int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void
|
||||||
return inflate(stream, 0);
|
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;
|
int bytes = strlen(buffer) + 1;
|
||||||
unsigned char *buf = xmalloc(1+size);
|
unsigned char *buf = xmalloc(1+size);
|
||||||
|
|
|
@ -29,7 +29,7 @@ int fetch(unsigned char *sha1)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_version(void)
|
static int get_version(void)
|
||||||
{
|
{
|
||||||
char type = 'v';
|
char type = 'v';
|
||||||
write(fd_out, &type, 1);
|
write(fd_out, &type, 1);
|
||||||
|
|
12
ssh-push.c
12
ssh-push.c
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
unsigned char local_version = 1;
|
static unsigned char local_version = 1;
|
||||||
unsigned char remote_version = 0;
|
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;
|
ssize_t size;
|
||||||
int posn = 0;
|
int posn = 0;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
|
@ -57,7 +57,7 @@ int serve_object(int fd_in, int fd_out) {
|
||||||
return 0;
|
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)
|
if (read(fd_in, &remote_version, 1) < 1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -65,7 +65,7 @@ int serve_version(int fd_in, int fd_out)
|
||||||
return 0;
|
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];
|
char ref[PATH_MAX];
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
|
@ -86,7 +86,7 @@ int serve_ref(int fd_in, int fd_out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void service(int fd_in, int fd_out) {
|
static void service(int fd_in, int fd_out) {
|
||||||
char type;
|
char type;
|
||||||
int retval;
|
int retval;
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue