Skip to content

Commit fd52b67

Browse files
committed
[src/6model/knowhow_bootstrapper.c] fix gcc 'return value not used' warnings
1 parent d42ba1c commit fd52b67

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/6model/knowhow_bootstrapper.c

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static STRING *p6opaque_str = NULL;
1818

1919
/* Creates a new type with this HOW as its meta-object. */
2020
static void new_type(PARROT_INTERP, PMC *nci) {
21+
PMC * unused;
2122
/* We first create a new HOW instance. */
2223
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
2324
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
@@ -46,11 +47,12 @@ static void new_type(PARROT_INTERP, PMC *nci) {
4647
PARROT_GC_WRITE_BARRIER(interp, STABLE_PMC(type_object));
4748

4849
/* Put it into capture to act as return value. */
49-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", type_object);
50+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", type_object);
5051
}
5152

5253
/* Adds a method. */
5354
static void add_method(PARROT_INTERP, PMC *nci) {
55+
PMC * unused;
5456
/* Get methods table out of meta-object. */
5557
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
5658
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
@@ -62,11 +64,12 @@ static void add_method(PARROT_INTERP, PMC *nci) {
6264

6365
/* Add it, and return added method as result. */
6466
VTABLE_set_pmc_keyed_str(interp, methods, name, method);
65-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", method);
67+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", method);
6668
}
6769

6870
/* Adds an attribute meta-object to the list. */
6971
static void add_attribute(PARROT_INTERP, PMC *nci) {
72+
PMC * unused;
7073
/* Get attributes list out of meta-object. */
7174
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
7275
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
@@ -75,11 +78,12 @@ static void add_attribute(PARROT_INTERP, PMC *nci) {
7578
/* Add meta-attribute to it. */
7679
PMC *meta_attr = VTABLE_get_pmc_keyed_int(interp, capture, 2);
7780
VTABLE_push_pmc(interp, attrs, meta_attr);
78-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", meta_attr);
81+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", meta_attr);
7982
}
8083

8184
/* Finds a method. */
8285
static void find_method(PARROT_INTERP, PMC *nci) {
86+
PMC * unused;
8387
/* Get methods table out of meta-object and look up method. */
8488
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
8589
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
@@ -88,46 +92,51 @@ static void find_method(PARROT_INTERP, PMC *nci) {
8892
PMC *method = VTABLE_get_pmc_keyed_str(interp, methods, name);
8993

9094
/* Put into capture to act as return value. */
91-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", method);
95+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", method);
9296
}
9397

9498
/* Composes the meta-object. */
9599
static void compose(PARROT_INTERP, PMC *nci) {
100+
PMC * unused;
96101
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
97102
PMC *obj = VTABLE_get_pmc_keyed_int(interp, capture, 1);
98-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", obj);
103+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", obj);
99104
}
100105

101106
/* Introspects the parents. Since a KnowHOW doesn't support inheritance,
102107
* just hand back an empty list. */
103108
static void parents(PARROT_INTERP, PMC *nci) {
109+
PMC * unused;
104110
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
105111
PMC *empty = pmc_new(interp, enum_class_FixedPMCArray);
106-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", empty);
112+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", empty);
107113
}
108114

109115
/* Introspects the attributes. For now just hand back real list. */
110116
static void attributes(PARROT_INTERP, PMC *nci) {
117+
PMC * unused;
111118
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
112119
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
113120
PMC *attrs = ((KnowHOWREPRInstance *)PMC_data(self))->attributes;
114-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", attrs);
121+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", attrs);
115122
}
116123

117124
/* Introspects the methods. For now just hand back real method table. */
118125
static void methods(PARROT_INTERP, PMC *nci) {
126+
PMC * unused;
119127
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
120128
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
121129
PMC *meths = ((KnowHOWREPRInstance *)PMC_data(self))->methods;
122-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", meths);
130+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", meths);
123131
}
124132

125133
/* Introspects the name. */
126134
static void name(PARROT_INTERP, PMC *nci) {
135+
PMC * unused;
127136
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
128137
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
129138
STRING *name = ((KnowHOWREPRInstance *)PMC_data(self))->name;
130-
Parrot_pcc_build_call_from_c_args(interp, capture, "S", name);
139+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "S", name);
131140
}
132141

133142
/* Wraps up a C function as a raw NCI method. */
@@ -224,20 +233,22 @@ PMC * SixModelObject_bootstrap_knowhow(PARROT_INTERP, PMC *sc) {
224233

225234
/* Attribute new method. */
226235
static void attr_new(PARROT_INTERP, PMC *nci) {
236+
PMC * unused;
227237
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
228238
PMC *type = VTABLE_get_pmc_keyed_int(interp, capture, 0);
229239
STRING *name = VTABLE_get_string_keyed_str(interp, capture, name_str);
230240
PMC *self = REPR(type)->instance_of(interp, type);
231241
REPR(self)->set_str(interp, self, name);
232-
Parrot_pcc_build_call_from_c_args(interp, capture, "P", self);
242+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "P", self);
233243
}
234244

235245
/* Attribute name introspection. */
236246
static void attr_name(PARROT_INTERP, PMC *nci) {
247+
PMC * unused;
237248
PMC *capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
238249
PMC *self = VTABLE_get_pmc_keyed_int(interp, capture, 0);
239250
STRING *name = REPR(self)->get_str(interp, self);
240-
Parrot_pcc_build_call_from_c_args(interp, capture, "S", name);
251+
unused = Parrot_pcc_build_call_from_c_args(interp, capture, "S", name);
241252
}
242253

243254
/* Sets up a very simple attribute meta-object. Just supports having a

0 commit comments

Comments
 (0)