Fix warnings by including headers and casting

This commit is contained in:
pscott
2021-03-24 16:09:03 +01:00
parent 69773b0846
commit acdbb36b44
4 changed files with 9 additions and 7 deletions

View File

@@ -64,13 +64,13 @@ int eth_plugin_perform_init(uint8_t *contractAddress, ethPluginInitContract_t *i
PRINTF("Selector %.*H\n", 4, init->selector);
for (i = 0;; i++) {
uint8_t j;
selectors = PIC(INTERNAL_ETH_PLUGINS[i].selectors);
selectors = (const uint8_t **)PIC(INTERNAL_ETH_PLUGINS[i].selectors);
if (selectors == NULL) {
break;
}
for (j = 0; ((j < INTERNAL_ETH_PLUGINS[i].num_selectors) && (contractAddress != NULL));
j++) {
if (memcmp(init->selector, PIC(selectors[j]), SELECTOR_SIZE) == 0) {
if (memcmp(init->selector, (const void *)PIC(selectors[j]), SELECTOR_SIZE) == 0) {
if ((INTERNAL_ETH_PLUGINS[i].availableCheck == NULL) ||
((PluginAvailableCheck) PIC(INTERNAL_ETH_PLUGINS[i].availableCheck))()) {
strcpy(dataContext.tokenContext.pluginName, INTERNAL_ETH_PLUGINS[i].alias);

View File

@@ -92,28 +92,28 @@ const uint8_t* const STARKWARE_SELECTORS[NUM_STARKWARE_SELECTORS] = {
const internalEthPlugin_t const INTERNAL_ETH_PLUGINS[] = {
{erc20_plugin_available_check,
ERC20_SELECTORS,
(const uint8_t **)ERC20_SELECTORS,
NUM_ERC20_SELECTORS,
"-erc20",
erc20_plugin_call},
{erc721_plugin_available_check,
ERC721_SELECTORS,
(const uint8_t **)ERC721_SELECTORS,
NUM_ERC721_SELECTORS,
"-er721",
erc721_plugin_call},
{NULL, COMPOUND_SELECTORS, NUM_COMPOUND_SELECTORS, "-cmpd", compound_plugin_call},
{NULL, (const uint8_t **)COMPOUND_SELECTORS, NUM_COMPOUND_SELECTORS, "-cmpd", compound_plugin_call},
#ifdef HAVE_ETH2
{NULL, ETH2_SELECTORS, NUM_ETH2_SELECTORS, "-eth2", eth2_plugin_call},
{NULL, (const uint8_t **)ETH2_SELECTORS, NUM_ETH2_SELECTORS, "-eth2", eth2_plugin_call},
#endif
#ifdef HAVE_STARKWARE
{NULL, STARKWARE_SELECTORS, 10, "-strk", starkware_plugin_call},
{NULL, (const uint8_t **)STARKWARE_SELECTORS, 10, "-strk", starkware_plugin_call},
#endif

View File

@@ -4,6 +4,7 @@
#endif
#include "ui_callbacks.h"
#include "eth_plugin_handler.h"
#include "ux.h"
typedef enum {

View File

@@ -5,6 +5,7 @@
#include "uint256.h"
#include "string.h"
#include <stdint.h>
#include <os.h>
int handle_get_printable_amount(get_printable_amount_parameters_t* params, chain_config_t* config) {
uint8_t decimals;