diff options
| author | zouziyu2002 <[email protected]> | 2023-04-28 22:55:28 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-28 15:55:28 +0100 |
| commit | ce4674defa042fcc87cc1b54b739f81edae7d797 (patch) | |
| tree | cc2799948c32af514ed88d2ed0fcacc71ef58cb7 /bsp | |
| parent | 085ded8eef541ee8b347468c42c359d580fcd127 (diff) | |
[HUST CSE] add forced type conversion when using 'realloc','malloc','calloc' for better readability
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c | 2 | ||||
| -rwxr-xr-x | bsp/simulator/drivers/board.c | 2 | ||||
| -rw-r--r-- | bsp/simulator/drivers/dfs_win32.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c index aca793c1a1..c51bc2709e 100644 --- a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c +++ b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c @@ -995,7 +995,7 @@ static int ahci_init_one(int pdev) int rc; struct ahci_uc_priv *uc_priv = NULL; - uc_priv = malloc(sizeof(struct ahci_uc_priv)); + uc_priv = (struct ahci_uc_priv *)malloc(sizeof(struct ahci_uc_priv)); if (!uc_priv) return -ENOMEM; diff --git a/bsp/simulator/drivers/board.c b/bsp/simulator/drivers/board.c index fa743b6914..5d66ae231c 100755 --- a/bsp/simulator/drivers/board.c +++ b/bsp/simulator/drivers/board.c @@ -23,7 +23,7 @@ rt_uint8_t *rt_hw_sram_init(void) { rt_uint8_t *heap; - heap = malloc(RT_HEAP_SIZE); + heap = (rt_uint8_t *)malloc(RT_HEAP_SIZE); if (heap == RT_NULL) { rt_kprintf("there is no memory in pc."); diff --git a/bsp/simulator/drivers/dfs_win32.c b/bsp/simulator/drivers/dfs_win32.c index ebf1d741c9..f87b38b38a 100644 --- a/bsp/simulator/drivers/dfs_win32.c +++ b/bsp/simulator/drivers/dfs_win32.c @@ -191,7 +191,7 @@ static int dfs_win32_open(struct dfs_file *file) len = strlen(wdirp->finddata.name) + 1; wdirp->handle = handle; //wdirp->nfiles = 1; - wdirp->start = malloc(len); //not rt_malloc! + wdirp->start = (char *)malloc(len); //not rt_malloc! wdirp->end = wdirp->curr = wdirp->start; wdirp->end += len; rt_strncpy(wdirp->curr, wdirp->finddata.name, len); |
