clang-tidy: Fix clang-diagnostic-strict-prototypes diagnostics
Produces output such as:
```
/usr/bin/clang-tidy -checks=-*, bugprone-branch-clone -export-fixes /tmp/tmpjjns4w4i/tmp2vh08b10.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/platform.c
/mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/pdr.h:35:24: error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes]
pldm_pdr *pldm_pdr_init();
^
void
```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ib9b679682cc25b8c1b294d2be856031f77d755d9
diff --git a/include/libpldm/bios_table.h b/include/libpldm/bios_table.h
index f4796aa..7ec73c8 100644
--- a/include/libpldm/bios_table.h
+++ b/include/libpldm/bios_table.h
@@ -450,7 +450,7 @@
/** @brief Get length that an attribute entry(type: integer) will take
* @return The length that an entry(type: integer) will take
*/
-size_t pldm_bios_table_attr_entry_integer_encode_length();
+size_t pldm_bios_table_attr_entry_integer_encode_length(void);
/** @brief Create an entry of BIOS Attribute Table (type: integer)
* @param[out] entry - Pointer to a buffer to create an entry
@@ -617,7 +617,7 @@
/** @brief Get length that an attribute value entry(type: integer) will take
* @return The length that an entry(type: integer) will take
*/
-size_t pldm_bios_table_attr_value_entry_encode_integer_length();
+size_t pldm_bios_table_attr_value_entry_encode_integer_length(void);
/** @brief Create an attribute value entry(type: integer)
* @param[out] entry - Pointer to bios attribute value entry
diff --git a/include/libpldm/pdr.h b/include/libpldm/pdr.h
index 671b726..09b376a 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -32,7 +32,7 @@
* for PDRs received by other entities) and can associate the returned handle
* to a PLDM terminus id.
*/
-pldm_pdr *pldm_pdr_init();
+pldm_pdr *pldm_pdr_init(void);
/** @brief Destroy a PDR repository (and free up associated resources)
*
@@ -239,7 +239,7 @@
* @return opaque pointer that acts as a handle to the tree; NULL if no
* tree could be created
*/
-pldm_entity_association_tree *pldm_entity_association_tree_init();
+pldm_entity_association_tree *pldm_entity_association_tree_init(void);
/** @brief Add an entity into the entity association tree
*
diff --git a/include/libpldm/requester/pldm.h b/include/libpldm/requester/pldm.h
index 9c5c71e..e0f092f 100644
--- a/include/libpldm/requester/pldm.h
+++ b/include/libpldm/requester/pldm.h
@@ -29,7 +29,7 @@
*
* @return fd on success, pldm_requester_rc_t on error (errno may be set)
*/
-pldm_requester_rc_t pldm_open();
+pldm_requester_rc_t pldm_open(void);
/**
* @brief Send a PLDM request message. Wait for corresponding response message,
diff --git a/src/bios_table.c b/src/bios_table.c
index d7735e1..ef69dc2 100644
--- a/src/bios_table.c
+++ b/src/bios_table.c
@@ -35,7 +35,7 @@
*errmsg = msg;
}
-static uint16_t get_bios_string_handle()
+static uint16_t get_bios_string_handle(void)
{
static uint16_t handle = 0;
assert(handle != UINT16_MAX);
@@ -117,7 +117,7 @@
pldm_bios_table_string_entry_decode_string_length(entry);
}
-static uint16_t get_bios_attr_handle()
+static uint16_t get_bios_attr_handle(void)
{
static uint16_t handle = 0;
assert(handle != UINT16_MAX);
@@ -458,7 +458,7 @@
uint64_t default_value;
} __attribute__((packed));
-size_t pldm_bios_table_attr_entry_integer_encode_length()
+size_t pldm_bios_table_attr_entry_integer_encode_length(void)
{
return sizeof(struct pldm_bios_attr_table_entry) - 1 +
sizeof(struct attr_table_integer_entry_fields);
@@ -743,7 +743,7 @@
str_length);
}
-size_t pldm_bios_table_attr_value_entry_encode_integer_length()
+size_t pldm_bios_table_attr_value_entry_encode_integer_length(void)
{
return sizeof(struct pldm_bios_attr_val_table_entry) - 1 +
sizeof(uint64_t);
diff --git a/src/pdr.c b/src/pdr.c
index fe28aa9..b3a5d5a 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -110,7 +110,7 @@
return record->record_handle;
}
-pldm_pdr *pldm_pdr_init()
+pldm_pdr *pldm_pdr_init(void)
{
pldm_pdr *repo = malloc(sizeof(pldm_pdr));
assert(repo != NULL);
@@ -375,7 +375,7 @@
return node->entity;
}
-pldm_entity_association_tree *pldm_entity_association_tree_init()
+pldm_entity_association_tree *pldm_entity_association_tree_init(void)
{
pldm_entity_association_tree *tree =
malloc(sizeof(pldm_entity_association_tree));
diff --git a/src/requester/pldm.c b/src/requester/pldm.c
index 34f0c30..8b9a17c 100644
--- a/src/requester/pldm.c
+++ b/src/requester/pldm.c
@@ -10,7 +10,7 @@
const uint8_t MCTP_MSG_TYPE_PLDM = 1;
-pldm_requester_rc_t pldm_open()
+pldm_requester_rc_t pldm_open(void)
{
int fd = -1;
int rc = -1;