tests: Add missing 'static' attributes (fix warnings from smatch)
Smatch also complains about 0 used for pointers, so replace those by NULL in test-visitor-serialization.c, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
7a46d042e0
commit
748bfb4eee
|
@ -65,7 +65,7 @@ enum {
|
||||||
DSKCHG = 0x80,
|
DSKCHG = 0x80,
|
||||||
};
|
};
|
||||||
|
|
||||||
char test_image[] = "/tmp/qtest.XXXXXX";
|
static char test_image[] = "/tmp/qtest.XXXXXX";
|
||||||
|
|
||||||
#define assert_bit_set(data, mask) g_assert_cmphex((data) & (mask), ==, (mask))
|
#define assert_bit_set(data, mask) g_assert_cmphex((data) & (mask), ==, (mask))
|
||||||
#define assert_bit_clear(data, mask) g_assert_cmphex((data) & (mask), ==, 0)
|
#define assert_bit_clear(data, mask) g_assert_cmphex((data) & (mask), ==, 0)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
#include "qemu/sockets.h"
|
#include "qemu/sockets.h"
|
||||||
|
|
||||||
AioContext *ctx;
|
static AioContext *ctx;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EventNotifier e;
|
EventNotifier e;
|
||||||
|
|
|
@ -56,7 +56,7 @@ static QemuOptsList opts_list_02 = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
QemuOptsList opts_list_03 = {
|
static QemuOptsList opts_list_03 = {
|
||||||
.name = "opts_list_03",
|
.name = "opts_list_03",
|
||||||
.head = QTAILQ_HEAD_INITIALIZER(opts_list_03.head),
|
.head = QTAILQ_HEAD_INITIALIZER(opts_list_03.head),
|
||||||
.desc = {
|
.desc = {
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
#include "block/aio.h"
|
#include "block/aio.h"
|
||||||
#include "qemu/throttle.h"
|
#include "qemu/throttle.h"
|
||||||
|
|
||||||
AioContext *ctx;
|
static AioContext *ctx;
|
||||||
LeakyBucket bkt;
|
static LeakyBucket bkt;
|
||||||
ThrottleConfig cfg;
|
static ThrottleConfig cfg;
|
||||||
ThrottleState ts;
|
static ThrottleState ts;
|
||||||
|
|
||||||
/* useful function */
|
/* useful function */
|
||||||
static bool double_cmp(double x, double y)
|
static bool double_cmp(double x, double y)
|
||||||
|
|
|
@ -372,8 +372,8 @@ static void test_primitive_lists(gconstpointer opaque)
|
||||||
TestArgs *args = (TestArgs *) opaque;
|
TestArgs *args = (TestArgs *) opaque;
|
||||||
const SerializeOps *ops = args->ops;
|
const SerializeOps *ops = args->ops;
|
||||||
PrimitiveType *pt = args->test_data;
|
PrimitiveType *pt = args->test_data;
|
||||||
PrimitiveList pl = { .value = { 0 } };
|
PrimitiveList pl = { .value = { NULL } };
|
||||||
PrimitiveList pl_copy = { .value = { 0 } };
|
PrimitiveList pl_copy = { .value = { NULL } };
|
||||||
PrimitiveList *pl_copy_ptr = &pl_copy;
|
PrimitiveList *pl_copy_ptr = &pl_copy;
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
void *serialize_data;
|
void *serialize_data;
|
||||||
|
@ -771,7 +771,7 @@ static void test_nested_struct_list(gconstpointer opaque)
|
||||||
g_free(args);
|
g_free(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimitiveType pt_values[] = {
|
static PrimitiveType pt_values[] = {
|
||||||
/* string tests */
|
/* string tests */
|
||||||
{
|
{
|
||||||
.description = "string_empty",
|
.description = "string_empty",
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
#include "migration/vmstate.h"
|
#include "migration/vmstate.h"
|
||||||
#include "block/coroutine.h"
|
#include "block/coroutine.h"
|
||||||
|
|
||||||
char temp_file[] = "/tmp/vmst.test.XXXXXX";
|
static char temp_file[] = "/tmp/vmst.test.XXXXXX";
|
||||||
int temp_fd;
|
static int temp_fd;
|
||||||
|
|
||||||
/* Fake yield_until_fd_readable() implementation so we don't have to pull the
|
/* Fake yield_until_fd_readable() implementation so we don't have to pull the
|
||||||
* coroutine code as dependency.
|
* coroutine code as dependency.
|
||||||
|
|
Loading…
Reference in a new issue