chiark / gitweb /
fix sparse warnings
authorFrederic Crozat <fcrozat@suse.com>
Wed, 29 Feb 2012 13:42:49 +0000 (14:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 5 Mar 2012 14:07:14 +0000 (15:07 +0100)
src/getty-generator.c
src/hashmap.c
src/log.c
src/macro.h
src/mount.c
src/util.c

index 1263785fb51127d646fc11495ec5d03d57d9c0ad..7fac43a0baf02bcd065ad4e59457c3887e17cf54 100644 (file)
@@ -28,7 +28,7 @@
 #include "unit-name.h"
 #include "virt.h"
 
 #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;
 
 static int add_symlink(const char *fservice, const char *tservice) {
         char *from = NULL, *to = NULL;
index 7ef809746d3a67f0cfbf4220bbcd05bd673bce93..6928118615ba48306f15b9afee225550a62ed758 100644 (file)
@@ -55,10 +55,10 @@ struct pool {
         unsigned n_used;
 };
 
         unsigned n_used;
 };
 
-struct pool *first_hashmap_pool = NULL;
+static struct pool *first_hashmap_pool = NULL;
 static void *first_hashmap_tile = 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) {
 static void *first_entry_tile = NULL;
 
 static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
index c37ab226402c462f582b1ba1d8a8bafbbf6cfc39..e1f511cca6189d87c995bad265d6fa760bc99065 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -625,11 +625,11 @@ _noreturn_ static void log_assert(const char *text, const char *file, int line,
 }
 #pragma GCC diagnostic pop
 
 }
 #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.");
 }
 
         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.");
 }
 
         log_assert(text, file, line, func, "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
 }
 
index 58de001f262301dc705507b0cae00ad561e24304..19f259e4f1166c24a5acfde409cb51e17b00b284 100644 (file)
@@ -23,6 +23,7 @@
 ***/
 
 #include <assert.h>
 ***/
 
 #include <assert.h>
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <inttypes.h>
index 0ae964b648a9e56973cdda007708301ff39f2bc4..f80fcf5f4ab29c16052e0df8940fa41206e05210 100644 (file)
@@ -271,7 +271,7 @@ static char* mount_test_option(const char *haystack, const char *needle) {
          * struct mntent */
 
         if (!haystack)
          * struct mntent */
 
         if (!haystack)
-                return false;
+                return NULL;
 
         zero(me);
         me.mnt_opts = (char*) haystack;
 
         zero(me);
         me.mnt_opts = (char*) haystack;
index e9869ea4fad3bfd3695d41a6de7059db6deedfed..bf22f575c7702201c6d7e452883dd1a84a7bcecc 100644 (file)
@@ -892,7 +892,7 @@ int load_env_file(
                 char ***rl) {
 
         FILE *f;
                 char ***rl) {
 
         FILE *f;
-        char **m = 0;
+        char **m = NULL;
         int r;
 
         assert(fname);
         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);
 
         /* Make sure nobody waits for us on a socket anymore */
         close_all_fds(NULL, 0);