Skip to content

Commit

Permalink
Specify void as argument for the functions without any arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayurun authored and lukasauer committed Apr 17, 2023
1 parent 320dd74 commit 97fe51d
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 34 deletions.
6 changes: 3 additions & 3 deletions faultplugin/fault_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

fault_list_t *first_fault;

void init_fault_list()
void init_fault_list(void)
{
first_fault = NULL;
}
Expand Down Expand Up @@ -85,7 +85,7 @@ int add_fault(uint64_t fault_address, uint64_t fault_type, uint64_t fault_model,
* This function removes faults from linked list
*
*/
void delete_fault_queue()
void delete_fault_queue(void)
{
fault_list_t *del_item = NULL;
while(first_fault != NULL)
Expand All @@ -102,7 +102,7 @@ void delete_fault_queue()
*
* This function exists to separate fault list management from the rest of the code base
*/
fault_list_t* return_first_fault()
fault_list_t* return_first_fault(void)
{
return first_fault;
}
Expand Down
6 changes: 3 additions & 3 deletions faultplugin/fault_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct fault_list_t



void init_fault_list();
void init_fault_list(void);

/**
* add fault
Expand All @@ -79,14 +79,14 @@ int add_fault(uint64_t fault_address, uint64_t fault_type, uint64_t fault_model,
* This function removes faults from linked list
*
*/
void delete_fault_queue();
void delete_fault_queue(void);

/**
* return_first_fault
*
* This function exists to separate fault list management from the rest of the code base
*/
fault_list_t* return_first_fault();
fault_list_t* return_first_fault(void);

/**
* return_next
Expand Down
14 changes: 7 additions & 7 deletions faultplugin/faultplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static void free_end_point_list(struct end_point_t *list)
* This function deletes all mem info elements in the global linked list mem_info_list.
* Furthermore it deletes the associated avl tree
*/
void mem_info_free()
void mem_info_free(void)
{
mem_info_t *item;
while(mem_info_list != NULL)
Expand Down Expand Up @@ -346,7 +346,7 @@ void print_assembler(struct qemu_plugin_tb *tb)
*
*/

int qemu_setup_config()
int qemu_setup_config(void)
{
g_autoptr(GString) out = g_string_new("");
g_string_printf(out, "[Info]: Start readout of FIFO\n");
Expand Down Expand Up @@ -422,7 +422,7 @@ int qemu_setup_config()
*
* This function will fill the global fault trigger address array and fault address array
*/
int register_fault_trigger_addresses()
int register_fault_trigger_addresses(void)
{
g_autoptr(GString) out = g_string_new("");
g_string_printf(out, "[Info]: Calculate number of faults .......");
Expand Down Expand Up @@ -480,7 +480,7 @@ void invalidate_fault_trigger_address(int fault_trigger_number)
*
* delete the vector containing the fault triggers
*/
void delete_fault_trigger_addresses()
void delete_fault_trigger_addresses(void)
{
free(fault_trigger_addresses);
}
Expand Down Expand Up @@ -518,7 +518,7 @@ int register_live_faults_callback(fault_list_t *fault)
* This function is called in the first used tb block
* This function is maybe a TODO
*/
void handle_first_tb_fault_insertion()
void handle_first_tb_fault_insertion(void)
{

g_autoptr(GString) out = g_string_new("");
Expand Down Expand Up @@ -721,7 +721,7 @@ int plugin_write_to_data_pipe(char *str, size_t len)
}


size_t get_mem_info_list_size()
size_t get_mem_info_list_size(void)
{
size_t size = 0;
mem_info_t *item = mem_info_list;
Expand Down Expand Up @@ -1158,7 +1158,7 @@ int readout_pipe(uint8_t** protobuf_msg_buff, int pipe_fd)
}


int readout_control_qemu()
int readout_control_qemu(void)
{
uint8_t* control_msg_buff;
int msg_size = readout_pipe(&control_msg_buff, pipes->control);
Expand Down
2 changes: 1 addition & 1 deletion faultplugin/registerdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void readout_arm_registers(registerdump_t * current)
current->regs[16] = qemu_plugin_read_reg(25);
}

size_t get_register_dump_count()
size_t get_register_dump_count(void)
{
size_t size = 0;
registerdump_t* current = first_registerdump;
Expand Down
8 changes: 4 additions & 4 deletions faultplugin/singlestep.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

volatile uint64_t req_singlestep = 0;

void init_singlestep_req()
void init_singlestep_req(void)
{
req_singlestep = 0;
}

void check_singlestep()
void check_singlestep(void)
{
if(req_singlestep == 0)
{
Expand All @@ -45,7 +45,7 @@ void check_singlestep()
qemu_plugin_flush_tb();
}

void add_singlestep_req()
void add_singlestep_req(void)
{
g_autoptr(GString) out = g_string_new("");
qemu_plugin_outs("[SINGLESTEP]: increase request\n");
Expand All @@ -55,7 +55,7 @@ void add_singlestep_req()
check_singlestep();
}

void rem_singlestep_req()
void rem_singlestep_req(void)
{
if(req_singlestep != 0)
{
Expand Down
8 changes: 4 additions & 4 deletions faultplugin/singlestep.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@
*
* Init singlestep module. This will initialise all needed variables
*/
void init_singlestep_req();
void init_singlestep_req(void);

/**
* check_singlestep
*
* Check weather singlestepping should be enabled or not. It will disable singlestep if no requests are open. If requests are open it will force qemu into singlestep.
*/
void check_singlestep();
void check_singlestep(void);

/**
* add_singlestep_req
*
* Increase counter for requested singlesteps. This function should be called, if singlestep should be enabled. It will internally call check_singlestep
*/
void add_singlestep_req();
void add_singlestep_req(void);

/**
* rem_singlestep_req
*
* decrease counter for request singlestep. This function should be called, if singlestep should be disabled or is no longer needed.
*/
void rem_singlestep_req();
void rem_singlestep_req(void);
#endif
4 changes: 2 additions & 2 deletions faultplugin/tb_exec_data_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct tb_exec_rb_element {
struct tb_exec_rb_element *tb_exec_rb_list = NULL;
int tb_exec_rb_list_index;

int tb_exec_order_init()
int tb_exec_order_init(void)
{
// List of execution order of tbs.
tb_exec_order_list = NULL;
Expand All @@ -65,7 +65,7 @@ int tb_exec_order_init()
* Free linked list of tb_exec_order_t elements. It does not free the tb_info_t inside.
* These must be freed separately with tb_info_free()
*/
void tb_exec_order_free()
void tb_exec_order_free(void)
{
tb_exec_order_t *item;
while(tb_exec_order_list != NULL)
Expand Down
5 changes: 2 additions & 3 deletions faultplugin/tb_exec_data_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ typedef struct tb_exec_order_t
tb_exec_order_t *next;
}tb_exec_order_t;


int tb_exec_order_init();
int tb_exec_order_init(void);

/**
* tb_exec_order_free()
*
* Free linked list of tb_exec_order_t elements. It does not free the tb_info_t inside.
* These must be freed separately with tb_info_free()
*/
void tb_exec_order_free();
void tb_exec_order_free(void);

/**
* plugin_dump_tb_exec_order
Expand Down
8 changes: 4 additions & 4 deletions faultplugin/tb_info_data_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ tb_info_t *tb_info_list;
/* AVL global variables */
struct avl_table *tb_avl_root;

void tb_info_init()
void tb_info_init(void)
{
// Linked list of tb structs inside tb. Used to delete them.
tb_info_list = NULL;
tb_avl_root = NULL;
}

int tb_info_avl_init()
int tb_info_avl_init(void)
{
// AVL tree used in collecting data. This contains the tbs info of all generated tbs.
// The id of a tb is its base address
Expand All @@ -53,7 +53,7 @@ int tb_info_avl_init()
* Function to delete the translation block information
* structs from memory. Also deletes the avl tree
*/
void tb_info_free()
void tb_info_free(void)
{
tb_info_t *item;
while(tb_info_list != NULL)
Expand Down Expand Up @@ -95,7 +95,7 @@ int tb_comparison_func(const void *tbl_a, const void *tbl_b, void * tbl_param)
else return 0;
}

size_t get_tb_info_list_size()
size_t get_tb_info_list_size(void)
{
tb_info_t *item = tb_info_list;
size_t size = 0;
Expand Down
6 changes: 3 additions & 3 deletions faultplugin/tb_info_data_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ typedef struct tb_info_t
*
* This function initialises all global variables used in module
*/
void tb_info_init();
void tb_info_init(void);

/**
* tb_info_avl_init()
*
* function initialises avl tree for tb info
*/
int tb_info_avl_init();
int tb_info_avl_init(void);

/**
* tb_info_free()
*
* function to delete the translation block information
* structs from memory. Also deletes the avl tree
*/
void tb_info_free();
void tb_info_free(void);

/**
* tb_comparison_func
Expand Down

0 comments on commit 97fe51d

Please sign in to comment.