fix sparse warnings

This commit is contained in:
Frederic Crozat 2012-02-29 14:42:49 +01:00 committed by Lennart Poettering
parent 7be3aa1732
commit 6a39419fe4
6 changed files with 9 additions and 8 deletions

View file

@ -28,7 +28,7 @@
#include "unit-name.h"
#include "virt.h"
const char *arg_dest = "/tmp";
static const char *arg_dest = "/tmp";
static int add_symlink(const char *fservice, const char *tservice) {
char *from = NULL, *to = NULL;

View file

@ -55,10 +55,10 @@ struct pool {
unsigned n_used;
};
struct pool *first_hashmap_pool = NULL;
static struct pool *first_hashmap_pool = NULL;
static void *first_hashmap_tile = NULL;
struct pool *first_entry_pool = NULL;
static struct pool *first_entry_pool = NULL;
static void *first_entry_tile = NULL;
static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {

View file

@ -625,11 +625,11 @@ _noreturn_ static void log_assert(const char *text, const char *file, int line,
}
#pragma GCC diagnostic pop
void log_assert_failed(const char *text, const char *file, int line, const char *func) {
_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func) {
log_assert(text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
}
void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
log_assert(text, file, line, func, "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
}

View file

@ -23,6 +23,7 @@
***/
#include <assert.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <inttypes.h>

View file

@ -271,7 +271,7 @@ static char* mount_test_option(const char *haystack, const char *needle) {
* struct mntent */
if (!haystack)
return false;
return NULL;
zero(me);
me.mnt_opts = (char*) haystack;

View file

@ -892,7 +892,7 @@ int load_env_file(
char ***rl) {
FILE *f;
char **m = 0;
char **m = NULL;
int r;
assert(fname);
@ -4177,7 +4177,7 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid) {
}
void freeze(void) {
_noreturn_ void freeze(void) {
/* Make sure nobody waits for us on a socket anymore */
close_all_fds(NULL, 0);