Skip to content

Commit

Permalink
MISRAC2012-Rule-8.3_b: match function declaration and definition
Browse files Browse the repository at this point in the history
  • Loading branch information
milamikica committed Jun 3, 2021
1 parent 2ea56b0 commit b45b774
Show file tree
Hide file tree
Showing 22 changed files with 295 additions and 287 deletions.
8 changes: 4 additions & 4 deletions 3rd-party/rijndael/rijndael.c
Expand Up @@ -715,7 +715,7 @@ static const u32 rcon[] =
*
* @return the number of rounds for the given cipher key size.
*/
int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits)
int rijndaelSetupEncrypt(uint32_t *rk, const uint8_t *key, int keybits)
{
u32 * rk_ = rk;

Expand Down Expand Up @@ -820,7 +820,7 @@ int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits)
*
* @return the number of rounds for the given cipher key size.
*/
int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits)
int rijndaelSetupDecrypt(uint32_t *rk, const uint8_t *key, int keybits)
{
u32 * rk_ = rk;
int nrounds, i, j;
Expand Down Expand Up @@ -865,7 +865,7 @@ int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits)
}
#endif

void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], u8 ciphertext[16])
void rijndaelEncrypt(const uint32_t *rk, int nrounds, const uint8_t plaintext[16], uint8_t ciphertext[16])
{

const u32 * rk_ = rk;
Expand Down Expand Up @@ -1060,7 +1060,7 @@ void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], u8 ciph
}

#ifdef ENABLE_RIJNDAEL_DECRYPT
void rijndaelDecrypt(const u32 *rk, int nrounds, const u8 ciphertext[16], u8 plaintext[16])
void rijndaelDecrypt(const uint32_t *rk, int nrounds, const uint8_t ciphertext[16], uint8_t plaintext[16])
{

const u32 * rk_ = rk;
Expand Down
6 changes: 3 additions & 3 deletions platform/embedded/btstack_uart_block_embedded.c
Expand Up @@ -50,7 +50,7 @@
#include "hal_uart_dma.h"

// uart config
static const btstack_uart_config_t * uart_config;
static const btstack_uart_config_t * uart_configuration;

// data source for integration with BTstack Runloop
static btstack_data_source_t transport_data_source;
Expand Down Expand Up @@ -81,7 +81,7 @@ static void btstack_uart_cts_pulse(void){
}

static int btstack_uart_embedded_init(const btstack_uart_config_t * config){
uart_config = config;
uart_configuration = config;
hal_uart_dma_set_block_received(&btstack_uart_block_received);
hal_uart_dma_set_block_sent(&btstack_uart_block_sent);
return 0;
Expand Down Expand Up @@ -116,7 +116,7 @@ static void btstack_uart_embedded_process(btstack_data_source_t *ds, btstack_dat

static int btstack_uart_embedded_open(void){
hal_uart_dma_init();
hal_uart_dma_set_baud(uart_config->baudrate);
hal_uart_dma_set_baud(uart_configuration->baudrate);

// set up polling data_source
btstack_run_loop_set_data_source_handler(&transport_data_source, &btstack_uart_embedded_process);
Expand Down
18 changes: 9 additions & 9 deletions src/ble/att_db.c
Expand Up @@ -89,7 +89,7 @@ typedef struct att_iterator {

static void att_persistent_ccc_cache(att_iterator_t * it);

static uint8_t const * att_db = NULL;
static uint8_t const * att_database = NULL;
static att_read_callback_t att_read_callback = NULL;
static att_write_callback_t att_write_callback = NULL;
static int att_prepare_write_error_code = 0;
Expand All @@ -100,7 +100,7 @@ static uint16_t att_persistent_ccc_handle;
static uint16_t att_persistent_ccc_uuid16;

static void att_iterator_init(att_iterator_t *it){
it->att_ptr = att_db;
it->att_ptr = att_database;
}

static bool att_iterator_has_next(att_iterator_t *it){
Expand Down Expand Up @@ -208,7 +208,7 @@ void att_set_db(uint8_t const * db){
}
log_info("att_set_db %p", db);
// ignore db version
att_db = &db[1];
att_database = &db[1];
}

void att_set_read_callback(att_read_callback_t callback){
Expand All @@ -223,7 +223,7 @@ void att_dump_attributes(void){
att_iterator_t it;
att_iterator_init(&it);
uint8_t uuid128[16];
log_info("att_dump_attributes, table %p", att_db);
log_info("att_dump_attributes, table %p", att_database);
while (att_iterator_has_next(&it)){
att_iterator_fetch_next(&it);
if (it.handle == 0u) {
Expand Down Expand Up @@ -1165,24 +1165,24 @@ static uint16_t prepare_handle_value(att_connection_t * att_connection,

// MARK: ATT_HANDLE_VALUE_NOTIFICATION 0x1b
uint16_t att_prepare_handle_value_notification(att_connection_t * att_connection,
uint16_t handle,
uint16_t attribute_handle,
const uint8_t *value,
uint16_t value_len,
uint8_t * response_buffer){

response_buffer[0] = ATT_HANDLE_VALUE_NOTIFICATION;
return prepare_handle_value(att_connection, handle, value, value_len, response_buffer);
return prepare_handle_value(att_connection, attribute_handle, value, value_len, response_buffer);
}

// MARK: ATT_HANDLE_VALUE_INDICATION 0x1d
uint16_t att_prepare_handle_value_indication(att_connection_t * att_connection,
uint16_t handle,
uint16_t attribute_handle,
const uint8_t *value,
uint16_t value_len,
uint8_t * response_buffer){

response_buffer[0] = ATT_HANDLE_VALUE_INDICATION;
return prepare_handle_value(att_connection, handle, value, value_len, response_buffer);
return prepare_handle_value(att_connection, attribute_handle, value, value_len, response_buffer);
}

// MARK: Dispatcher
Expand Down Expand Up @@ -1522,7 +1522,7 @@ static uint8_t btp_permissions_for_flags(uint16_t flags){
}

uint16_t btp_att_get_attributes_by_uuid16(uint16_t start_handle, uint16_t end_handle, uint16_t uuid16, uint8_t * response_buffer, uint16_t response_buffer_size){
log_info("btp_att_get_attributes_by_uuid16 %04x from 0x%04x to 0x%04x, db %p", uuid16, start_handle, end_handle, att_db);
log_info("btp_att_get_attributes_by_uuid16 %04x from 0x%04x to 0x%04x, db %p", uuid16, start_handle, end_handle, att_database);
att_dump_attributes();

uint8_t num_attributes = 0;
Expand Down

0 comments on commit b45b774

Please sign in to comment.