@@ -193,8 +193,9 @@ class CCPPList {
193
193
std::string tab (indentation_spaces, ' ' );
194
194
std::string list_init_func = global_scope->get_unique_name (" list_init_" + list_type_code);
195
195
typecode2listfuncs[list_type_code][" list_init" ] = list_init_func;
196
- std::string signature = indent + " void " + list_init_func + " (" + list_struct_type + " * x, int32_t capacity)" ;
197
- list_func_decls += signature + " ;\n " ;
196
+ std::string signature = " void " + list_init_func + " (" + list_struct_type + " * x, int32_t capacity)" ;
197
+ list_func_decls += indent + " inline " + signature + " ;\n " ;
198
+ signature = indent + signature;
198
199
generated_code += indent + signature + " {\n " ;
199
200
generated_code += indent + tab + " x->capacity = capacity;\n " ;
200
201
generated_code += indent + tab + " x->current_end_point = 0;\n " ;
@@ -213,7 +214,7 @@ class CCPPList {
213
214
std::string signature = " void " + list_dc_func + " ("
214
215
+ list_struct_type + " * src, "
215
216
+ list_struct_type + " * dest)" ;
216
- list_func_decls += signature + " ;\n " ;
217
+ list_func_decls += " inline " + signature + " ;\n " ;
217
218
generated_code += indent + signature + " {\n " ;
218
219
generated_code += indent + tab + " dest->capacity = src->capacity;\n " ;
219
220
generated_code += indent + tab + " dest->current_end_point = src->current_end_point;\n " ;
@@ -231,8 +232,9 @@ class CCPPList {
231
232
std::string tab (indentation_spaces, ' ' );
232
233
std::string list_resize_func = global_scope->get_unique_name (" resize_if_needed_" + list_type_code);
233
234
typecode2listfuncs[list_type_code][" list_resize" ] = list_resize_func;
234
- std::string signature = indent + " void " + list_resize_func + " (" + list_struct_type + " * x)" ;
235
- list_func_decls += signature + " ;\n " ;
235
+ std::string signature = " void " + list_resize_func + " (" + list_struct_type + " * x)" ;
236
+ list_func_decls += indent + " inline " + signature + " ;\n " ;
237
+ signature = indent + signature;
236
238
generated_code += indent + signature + " {\n " ;
237
239
generated_code += indent + tab + " if (x->capacity == x->current_end_point) {\n " ;
238
240
generated_code += indent + tab + tab + " x->capacity = 2 * x->capacity + 1;\n " ;
@@ -252,7 +254,7 @@ class CCPPList {
252
254
std::string signature = " void " + list_append_func + " ("
253
255
+ list_struct_type + " * x, "
254
256
+ list_element_type + " element)" ;
255
- list_func_decls += signature + " ;\n " ;
257
+ list_func_decls += " inline " + signature + " ;\n " ;
256
258
generated_code += indent + signature + " {\n " ;
257
259
std::string list_resize_func = get_list_resize_func (list_type_code);
258
260
generated_code += indent + tab + list_resize_func + " (x);\n " ;
@@ -275,7 +277,7 @@ class CCPPList {
275
277
+ list_struct_type + " * x, "
276
278
+ " int pos, "
277
279
+ list_element_type + " element)" ;
278
- list_func_decls += signature + " ;\n " ;
280
+ list_func_decls += " inline " + signature + " ;\n " ;
279
281
generated_code += indent + signature + " {\n " ;
280
282
std::string list_resize_func = get_list_resize_func (list_type_code);
281
283
generated_code += indent + tab + list_resize_func + " (x);\n " ;
@@ -308,7 +310,7 @@ class CCPPList {
308
310
std::string signature = " int " + list_find_item_pos_func + " ("
309
311
+ list_struct_type + " * x, "
310
312
+ list_element_type + " element)" ;
311
- list_func_decls += signature + " ;\n " ;
313
+ list_func_decls += " inline " + signature + " ;\n " ;
312
314
generated_code += indent + signature + " {\n " ;
313
315
generated_code += indent + tab + " int el_pos = 0;\n " ;
314
316
generated_code += indent + tab + " while(x->current_end_point > el_pos) {;\n " ;
@@ -329,7 +331,7 @@ class CCPPList {
329
331
std::string signature = " void " + list_remove_func + " ("
330
332
+ list_struct_type + " * x, "
331
333
+ list_element_type + " element)" ;
332
- list_func_decls += signature + " ;\n " ;
334
+ list_func_decls += " inline " + signature + " ;\n " ;
333
335
generated_code += indent + signature + " {\n " ;
334
336
std::string find_item_pos_func = get_list_find_item_position_function (list_type_code);
335
337
generated_code += indent + tab + " int el_pos = " + find_item_pos_func + " (x, element);\n " ;
0 commit comments