Skip to content

Commit 0d94f02

Browse files
committed
tests: use G_GNUC_UNUSED
Use G_GNUC_UNUSED from GLib instead of ATTRIBUTE_UNUSED. Signed-off-by: Ján Tomko <[email protected]> Reviewed-by: Michal Privoznik <[email protected]>
1 parent 7c65546 commit 0d94f02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+419
-419
lines changed

tests/bhyvexml2argvmock.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
1919
addr->addr[5] = 0;
2020
}
2121

22-
int virNetDevTapCreateInBridgePort(const char *brname ATTRIBUTE_UNUSED,
22+
int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED,
2323
char **ifname,
24-
const virMacAddr *macaddr ATTRIBUTE_UNUSED,
25-
const unsigned char *vmuuid ATTRIBUTE_UNUSED,
26-
const char *tunpath ATTRIBUTE_UNUSED,
27-
int *tapfd ATTRIBUTE_UNUSED,
28-
size_t tapfdSize ATTRIBUTE_UNUSED,
29-
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
30-
virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED,
31-
virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED,
32-
unsigned int mtu ATTRIBUTE_UNUSED,
33-
unsigned int *actualMTU ATTRIBUTE_UNUSED,
34-
unsigned int fakeflags ATTRIBUTE_UNUSED)
24+
const virMacAddr *macaddr G_GNUC_UNUSED,
25+
const unsigned char *vmuuid G_GNUC_UNUSED,
26+
const char *tunpath G_GNUC_UNUSED,
27+
int *tapfd G_GNUC_UNUSED,
28+
size_t tapfdSize G_GNUC_UNUSED,
29+
virNetDevVPortProfilePtr virtPortProfile G_GNUC_UNUSED,
30+
virNetDevVlanPtr virtVlan G_GNUC_UNUSED,
31+
virNetDevCoalescePtr coalesce G_GNUC_UNUSED,
32+
unsigned int mtu G_GNUC_UNUSED,
33+
unsigned int *actualMTU G_GNUC_UNUSED,
34+
unsigned int fakeflags G_GNUC_UNUSED)
3535
{
3636
VIR_FREE(*ifname);
3737
if (VIR_STRDUP(*ifname, "vnet0") < 0)
3838
return -1;
3939
return 0;
4040
}
4141

42-
char *virNetDevTapGetRealDeviceName(char *name ATTRIBUTE_UNUSED)
42+
char *virNetDevTapGetRealDeviceName(char *name G_GNUC_UNUSED)
4343
{
4444
char *fakename;
4545

@@ -48,15 +48,15 @@ char *virNetDevTapGetRealDeviceName(char *name ATTRIBUTE_UNUSED)
4848
return fakename;
4949
}
5050

51-
int virNetDevSetOnline(const char *ifname ATTRIBUTE_UNUSED,
52-
bool online ATTRIBUTE_UNUSED)
51+
int virNetDevSetOnline(const char *ifname G_GNUC_UNUSED,
52+
bool online G_GNUC_UNUSED)
5353
{
5454
return 0;
5555
}
5656

57-
int bind(int sockfd ATTRIBUTE_UNUSED,
58-
const struct sockaddr *addr ATTRIBUTE_UNUSED,
59-
socklen_t addrlen ATTRIBUTE_UNUSED)
57+
int bind(int sockfd G_GNUC_UNUSED,
58+
const struct sockaddr *addr G_GNUC_UNUSED,
59+
socklen_t addrlen G_GNUC_UNUSED)
6060
{
6161
return 0;
6262
}

tests/commandtest.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int checkoutput(const char *testname,
115115
* Only stdin/out/err open
116116
* No slot for return status must log error.
117117
*/
118-
static int test0(const void *unused ATTRIBUTE_UNUSED)
118+
static int test0(const void *unused G_GNUC_UNUSED)
119119
{
120120
virCommandPtr cmd;
121121
int ret = -1;
@@ -140,7 +140,7 @@ static int test0(const void *unused ATTRIBUTE_UNUSED)
140140
* Only stdin/out/err open
141141
* Capturing return status must not log error.
142142
*/
143-
static int test1(const void *unused ATTRIBUTE_UNUSED)
143+
static int test1(const void *unused G_GNUC_UNUSED)
144144
{
145145
virCommandPtr cmd;
146146
int ret = -1;
@@ -168,7 +168,7 @@ static int test1(const void *unused ATTRIBUTE_UNUSED)
168168
* Run program (twice), no args, inherit all ENV, keep CWD.
169169
* Only stdin/out/err open
170170
*/
171-
static int test2(const void *unused ATTRIBUTE_UNUSED)
171+
static int test2(const void *unused G_GNUC_UNUSED)
172172
{
173173
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
174174
int ret;
@@ -199,7 +199,7 @@ static int test2(const void *unused ATTRIBUTE_UNUSED)
199199
* Run program, no args, inherit all ENV, keep CWD.
200200
* stdin/out/err + two extra FD open
201201
*/
202-
static int test3(const void *unused ATTRIBUTE_UNUSED)
202+
static int test3(const void *unused G_GNUC_UNUSED)
203203
{
204204
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
205205
int newfd1 = dup(STDERR_FILENO);
@@ -239,7 +239,7 @@ static int test3(const void *unused ATTRIBUTE_UNUSED)
239239
* Only stdin/out/err open.
240240
* Daemonized
241241
*/
242-
static int test4(const void *unused ATTRIBUTE_UNUSED)
242+
static int test4(const void *unused G_GNUC_UNUSED)
243243
{
244244
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
245245
char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper");
@@ -279,7 +279,7 @@ static int test4(const void *unused ATTRIBUTE_UNUSED)
279279
* Run program, no args, inherit filtered ENV, keep CWD.
280280
* Only stdin/out/err open
281281
*/
282-
static int test5(const void *unused ATTRIBUTE_UNUSED)
282+
static int test5(const void *unused G_GNUC_UNUSED)
283283
{
284284
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
285285

@@ -301,7 +301,7 @@ static int test5(const void *unused ATTRIBUTE_UNUSED)
301301
* Run program, no args, inherit filtered ENV, keep CWD.
302302
* Only stdin/out/err open
303303
*/
304-
static int test6(const void *unused ATTRIBUTE_UNUSED)
304+
static int test6(const void *unused G_GNUC_UNUSED)
305305
{
306306
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
307307

@@ -324,7 +324,7 @@ static int test6(const void *unused ATTRIBUTE_UNUSED)
324324
* Run program, no args, inherit filtered ENV, keep CWD.
325325
* Only stdin/out/err open
326326
*/
327-
static int test7(const void *unused ATTRIBUTE_UNUSED)
327+
static int test7(const void *unused G_GNUC_UNUSED)
328328
{
329329
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
330330

@@ -347,7 +347,7 @@ static int test7(const void *unused ATTRIBUTE_UNUSED)
347347
* Run program, no args, inherit filtered ENV, keep CWD.
348348
* Only stdin/out/err open
349349
*/
350-
static int test8(const void *unused ATTRIBUTE_UNUSED)
350+
static int test8(const void *unused G_GNUC_UNUSED)
351351
{
352352
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
353353

@@ -372,7 +372,7 @@ static int test8(const void *unused ATTRIBUTE_UNUSED)
372372
* Run program, some args, inherit all ENV, keep CWD.
373373
* Only stdin/out/err open
374374
*/
375-
static int test9(const void *unused ATTRIBUTE_UNUSED)
375+
static int test9(const void *unused G_GNUC_UNUSED)
376376
{
377377
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
378378
const char* const args[] = { "arg1", "arg2", NULL };
@@ -409,7 +409,7 @@ static int test9(const void *unused ATTRIBUTE_UNUSED)
409409
* Run program, some args, inherit all ENV, keep CWD.
410410
* Only stdin/out/err open
411411
*/
412-
static int test10(const void *unused ATTRIBUTE_UNUSED)
412+
static int test10(const void *unused G_GNUC_UNUSED)
413413
{
414414
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
415415
const char *const args[] = {
@@ -433,7 +433,7 @@ static int test10(const void *unused ATTRIBUTE_UNUSED)
433433
* Run program, some args, inherit all ENV, keep CWD.
434434
* Only stdin/out/err open
435435
*/
436-
static int test11(const void *unused ATTRIBUTE_UNUSED)
436+
static int test11(const void *unused G_GNUC_UNUSED)
437437
{
438438
const char *args[] = {
439439
abs_builddir "/commandhelper",
@@ -456,7 +456,7 @@ static int test11(const void *unused ATTRIBUTE_UNUSED)
456456
* Run program, no args, inherit all ENV, keep CWD.
457457
* Only stdin/out/err open. Set stdin data
458458
*/
459-
static int test12(const void *unused ATTRIBUTE_UNUSED)
459+
static int test12(const void *unused G_GNUC_UNUSED)
460460
{
461461
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
462462

@@ -477,7 +477,7 @@ static int test12(const void *unused ATTRIBUTE_UNUSED)
477477
* Run program, no args, inherit all ENV, keep CWD.
478478
* Only stdin/out/err open. Set stdin data
479479
*/
480-
static int test13(const void *unused ATTRIBUTE_UNUSED)
480+
static int test13(const void *unused G_GNUC_UNUSED)
481481
{
482482
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
483483
char *outactual = NULL;
@@ -516,7 +516,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED)
516516
* Run program, no args, inherit all ENV, keep CWD.
517517
* Only stdin/out/err open. Set stdin data
518518
*/
519-
static int test14(const void *unused ATTRIBUTE_UNUSED)
519+
static int test14(const void *unused G_GNUC_UNUSED)
520520
{
521521
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
522522
char *outactual = NULL;
@@ -589,7 +589,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED)
589589
* Run program, no args, inherit all ENV, change CWD.
590590
* Only stdin/out/err open
591591
*/
592-
static int test15(const void *unused ATTRIBUTE_UNUSED)
592+
static int test15(const void *unused G_GNUC_UNUSED)
593593
{
594594
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
595595
char *cwd = NULL;
@@ -617,7 +617,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED)
617617
/*
618618
* Don't run program; rather, log what would be run.
619619
*/
620-
static int test16(const void *unused ATTRIBUTE_UNUSED)
620+
static int test16(const void *unused G_GNUC_UNUSED)
621621
{
622622
virCommandPtr cmd = virCommandNew("true");
623623
char *outactual = NULL;
@@ -662,7 +662,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED)
662662
/*
663663
* Test string handling when no output is present.
664664
*/
665-
static int test17(const void *unused ATTRIBUTE_UNUSED)
665+
static int test17(const void *unused G_GNUC_UNUSED)
666666
{
667667
virCommandPtr cmd = virCommandNew("true");
668668
int ret = -1;
@@ -718,7 +718,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
718718
/*
719719
* Run long-running daemon, to ensure no hang.
720720
*/
721-
static int test18(const void *unused ATTRIBUTE_UNUSED)
721+
static int test18(const void *unused G_GNUC_UNUSED)
722722
{
723723
virCommandPtr cmd = virCommandNewArgList("sleep", "100", NULL);
724724
char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper");
@@ -766,7 +766,7 @@ static int test18(const void *unused ATTRIBUTE_UNUSED)
766766
/*
767767
* Asynchronously run long-running daemon, to ensure no hang.
768768
*/
769-
static int test19(const void *unused ATTRIBUTE_UNUSED)
769+
static int test19(const void *unused G_GNUC_UNUSED)
770770
{
771771
virCommandPtr cmd = virCommandNewArgList("sleep", "100", NULL);
772772
pid_t pid;
@@ -803,7 +803,7 @@ static int test19(const void *unused ATTRIBUTE_UNUSED)
803803
* Run program, no args, inherit all ENV, keep CWD.
804804
* Ignore huge stdin data, to provoke SIGPIPE or EPIPE in parent.
805805
*/
806-
static int test20(const void *unused ATTRIBUTE_UNUSED)
806+
static int test20(const void *unused G_GNUC_UNUSED)
807807
{
808808
virCommandPtr cmd = virCommandNewArgList(abs_builddir "/commandhelper",
809809
"--close-stdin", NULL);
@@ -846,7 +846,7 @@ static const char *const newenv[] = {
846846
NULL
847847
};
848848

849-
static int test21(const void *unused ATTRIBUTE_UNUSED)
849+
static int test21(const void *unused G_GNUC_UNUSED)
850850
{
851851
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
852852
int ret = -1;
@@ -894,7 +894,7 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
894894
}
895895

896896
static int
897-
test22(const void *unused ATTRIBUTE_UNUSED)
897+
test22(const void *unused G_GNUC_UNUSED)
898898
{
899899
int ret = -1;
900900
virCommandPtr cmd;
@@ -947,7 +947,7 @@ test22(const void *unused ATTRIBUTE_UNUSED)
947947

948948

949949
static int
950-
test23(const void *unused ATTRIBUTE_UNUSED)
950+
test23(const void *unused G_GNUC_UNUSED)
951951
{
952952
/* Not strictly a virCommand test, but this is the easiest place
953953
* to test this lower-level interface. It takes a double fork to
@@ -1003,7 +1003,7 @@ test23(const void *unused ATTRIBUTE_UNUSED)
10031003
return ret;
10041004
}
10051005

1006-
static int test25(const void *unused ATTRIBUTE_UNUSED)
1006+
static int test25(const void *unused G_GNUC_UNUSED)
10071007
{
10081008
int ret = -1;
10091009
int pipeFD[2] = { -1, -1};
@@ -1081,7 +1081,7 @@ static int test25(const void *unused ATTRIBUTE_UNUSED)
10811081
/*
10821082
* Don't run program; rather, log what would be run.
10831083
*/
1084-
static int test26(const void *unused ATTRIBUTE_UNUSED)
1084+
static int test26(const void *unused G_GNUC_UNUSED)
10851085
{
10861086
virCommandPtr cmd = virCommandNew("true");
10871087
char *outactual = NULL;
@@ -1139,7 +1139,7 @@ static int test26(const void *unused ATTRIBUTE_UNUSED)
11391139
return ret;
11401140
}
11411141

1142-
static int test27(const void *unused ATTRIBUTE_UNUSED)
1142+
static int test27(const void *unused G_GNUC_UNUSED)
11431143
{
11441144
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
11451145
int pipe1[2];
@@ -1277,8 +1277,8 @@ static void virCommandThreadWorker(void *opaque)
12771277
}
12781278

12791279
static void
1280-
virCommandTestFreeTimer(int timer ATTRIBUTE_UNUSED,
1281-
void *opaque ATTRIBUTE_UNUSED)
1280+
virCommandTestFreeTimer(int timer G_GNUC_UNUSED,
1281+
void *opaque G_GNUC_UNUSED)
12821282
{
12831283
/* nothing to be done here */
12841284
}

tests/esxutilstest.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static struct testPath paths[] = {
3333
};
3434

3535
static int
36-
testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
36+
testParseDatastorePath(const void *data G_GNUC_UNUSED)
3737
{
3838
int result = 0;
3939
size_t i;
@@ -121,7 +121,7 @@ static struct testDateTime times[] = {
121121
};
122122

123123
static int
124-
testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
124+
testConvertDateTimeToCalendarTime(const void *data G_GNUC_UNUSED)
125125
{
126126
size_t i;
127127
esxVI_DateTime dateTime;
@@ -172,7 +172,7 @@ static struct testDatastoreItem datastoreItems[] = {
172172
};
173173

174174
static int
175-
testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
175+
testEscapeDatastoreItem(const void *data G_GNUC_UNUSED)
176176
{
177177
size_t i;
178178
char *escaped = NULL;
@@ -212,7 +212,7 @@ static struct testWindows1252ToUTF8 windows1252ToUTF8[] = {
212212
};
213213

214214
static int
215-
testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
215+
testConvertWindows1252ToUTF8(const void *data G_GNUC_UNUSED)
216216
{
217217
size_t i;
218218
char *utf8 = NULL;

tests/eventtest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static pthread_cond_t eventThreadJobCond = PTHREAD_COND_INITIALIZER;
158158
static int eventThreadJobDone;
159159

160160

161-
G_GNUC_NORETURN static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) {
161+
G_GNUC_NORETURN static void *eventThreadLoop(void *data G_GNUC_UNUSED) {
162162
while (1) {
163163
pthread_mutex_lock(&eventThreadMutex);
164164
while (!eventThreadRunOnce)

0 commit comments

Comments
 (0)