-
-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: Fixed the cast qualification warnings and enabled
-Wcast-qual
- Loading branch information
Showing
16 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
/* | ||
* This file is part of the Black Magic Debug project. | ||
* | ||
* Copyright (C) 2011 Black Sphere Technologies Ltd. | ||
* Copyright (C) 2011 Black Sphere Technologies Ltd. | ||
* Written by Gareth McMullin <[email protected]> | ||
* Copyright (C) 2022-2024 1BitSquared <[email protected]> | ||
* Modified by Rachel Mant <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -488,7 +490,10 @@ static void exec_q_feature_read(const char *packet, const size_t length) | |
} | ||
const char *const description = target_regs_description(target); | ||
handle_q_string_reply(description ? description : "", packet); | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wcast-qual" | ||
free((void *)description); | ||
#pragma GCC diagnostic pop | ||
} | ||
|
||
static void exec_q_crc(const char *packet, const size_t length) | ||
|
@@ -789,7 +794,7 @@ static void exec_v_flash_write(const char *packet, const size_t length) | |
/* Write Flash Memory */ | ||
const uint32_t count = length - (size_t)(rest - packet); | ||
DEBUG_GDB("Flash Write %08" PRIX32 " %08" PRIX32 "\n", addr, count); | ||
if (cur_target && target_flash_write(cur_target, addr, (uint8_t *)rest, count)) | ||
if (cur_target && target_flash_write(cur_target, addr, (const uint8_t *)rest, count)) | ||
gdb_putpacketz("OK"); | ||
else { | ||
target_flash_complete(cur_target); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* | ||
* Copyright (C) 2014 Allen Ibara <aibara> | ||
* Copyright (C) 2015 Gareth McMullin <[email protected]> | ||
* Copyright (C) 2022 1BitSquared <[email protected]> | ||
* Copyright (C) 2022-2024 1BitSquared <[email protected]> | ||
* Rewritten by Rachel Mant <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
|
@@ -908,7 +908,7 @@ static void lpc43x0_spi_write(target_s *const target, const uint16_t command, co | |
target_mem32_write32(target, LPC43xx_GPIO_PORT0_SET, 1U << 6U); | ||
lpc43x0_ssp0_setup_command(target, command, address); | ||
/* And finally do the meat and potatoes of the transfer */ | ||
uint8_t *const data = (uint8_t *)buffer; | ||
const uint8_t *const data = (const uint8_t *)buffer; | ||
for (size_t i = 0; i < length; ++i) | ||
lpc43x0_ssp0_transfer(target, data[i]); | ||
/* Deselect the Flash */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* This file is part of the Black Magic Debug project. | ||
* | ||
* Copyright (C) 2015 Gareth McMullin <[email protected]> | ||
* Copyright (C) 2022-2023 1BitSquared <[email protected]> | ||
* Copyright (C) 2022-2024 1BitSquared <[email protected]> | ||
* Modified by Rachel Mant <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
|
@@ -358,13 +358,16 @@ bool lpc_flash_write_magic_vect(target_flash_s *f, target_addr_t dest, const voi | |
{ | ||
if (dest == 0) { | ||
/* Fill in the magic vector to allow booting the flash */ | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wcast-qual" | ||
uint32_t *const vectors = (uint32_t *)src; | ||
#pragma GCC diagnostic pop | ||
uint32_t sum = 0; | ||
|
||
/* compute checksum of first 7 vectors */ | ||
/* Compute checksum of first 7 vectors */ | ||
for (size_t i = 0; i < 7U; ++i) | ||
sum += vectors[i]; | ||
/* two's complement is written to 8'th vector */ | ||
/* Two's complement is written to 8'th vector */ | ||
vectors[7] = ~sum + 1U; | ||
} | ||
return lpc_flash_write(f, dest, src, len); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* This file is part of the Black Magic Debug project. | ||
* | ||
* Copyright (C) 2023 1BitSquared <[email protected]> | ||
* Copyright (C) 2023-2024 1BitSquared <[email protected]> | ||
* Written by Rachel Mant <[email protected]> | ||
* All rights reserved. | ||
* | ||
|
@@ -80,7 +80,7 @@ void bmp_spi_write(const spi_bus_e bus, const uint8_t device, const uint16_t com | |
/* Setup the transaction */ | ||
bmp_spi_setup_xfer(bus, device, command, address); | ||
/* Now write out back the data requested */ | ||
uint8_t *const data = (uint8_t *const)buffer; | ||
const uint8_t *const data = (const uint8_t *)buffer; | ||
for (size_t i = 0; i < length; ++i) | ||
/* Do a write to read */ | ||
platform_spi_xfer(bus, data[i]); | ||
|