mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Fix warnings seen on SDCC 4.6.0 due to missing const qualifiers
Building with SDCC 4.6.0 emits tons of warnings e.g.: cmd_parser.c:31: warning 356: object in read-only code space should be const cmd_parser.c:36: warning 357: pointer to object in read-only code space should be pointer to const These of course become fatal when building with --Werror. Comparing resultant binaries, it seems that a single string is shifted (deduplication?) but the numbers emitted at the end of the build are otherwise identical.
This commit is contained in:
1 parent
55431b39f6
commit
1b5243714e
22 files changed
+57
-57
No files matched your search
+1
-1
@@ -90,7 +90,7 @@ struct uip_eth_addr uip_ethaddr = { .addr = { 0x02, 0x11, 0x22, 0x33, 0x44, 0x55
|
||||
|
||||
/* ---- leaf calls into subsystems not under test ---- */
|
||||
void flash_read_bulk(uint8_t *dst) { (void)dst; }
|
||||
char *get_flash_size_str(void) { return (char *)"2M"; }
|
||||
const char *get_flash_size_str(void) { return "2M"; }
|
||||
uint8_t sfp_read_reg(uint8_t slot, uint8_t reg) { (void)slot; (void)reg; return 0; }
|
||||
bool gpio_pin_test(uint8_t pin) { (void)pin; return false; }
|
||||
void phy_read(uint8_t phy_id, uint8_t dev_id, uint16_t reg) { (void)phy_id; (void)dev_id; (void)reg; }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define FDATA_DEFS_H
|
||||
#include <stdint.h>
|
||||
typedef enum mime_type_e { mime_HTML = 0, mime_SVG, mime_ICO, mime_PNG, mime_JS, mime_CSS, mime_TXT } mime_type_t;
|
||||
struct f_data { __code char *file; uint32_t start; uint16_t len; mime_type_t mime; uint8_t gzip; };
|
||||
struct f_data { __code const char *file; uint32_t start; uint16_t len; mime_type_t mime; uint8_t gzip; };
|
||||
#define FDATA_START_login_html 0x00040000UL
|
||||
#define FDATA_START_favicon_ico 0x00041000UL
|
||||
#endif
|
||||
@@ -67,18 +67,18 @@ volatile uint8_t sfr_data[4];
|
||||
volatile uint32_t ticks;
|
||||
uint8_t cmd_capture;
|
||||
uint8_t err_status;
|
||||
uint8_t *hex = (uint8_t *)"0123456789abcdef";
|
||||
const uint8_t * const hex = (const uint8_t *)"0123456789abcdef";
|
||||
uint16_t crc_value;
|
||||
uint8_t *HTTP_RESPONCE_TXT = (uint8_t *)"HTTP/1.1 200 OK\r\n\r\n";
|
||||
const uint8_t * const HTTP_RESPONCE_TXT = (const uint8_t *)"HTTP/1.1 200 OK\r\n\r\n";
|
||||
uint32_t flash_size = 0x80000;
|
||||
uint8_t flash_buf[FLASH_BUF_SIZE];
|
||||
uint8_t rx_headers[16];
|
||||
struct flash_region_t flash_region;
|
||||
|
||||
char *mime_strings[] = { "text/html", "image/svg+xml", "image/x-icon",
|
||||
const char * const mime_strings[] = { "text/html", "image/svg+xml", "image/x-icon",
|
||||
"image/png", "text/javascript", "text/css", "text/plain" };
|
||||
|
||||
struct f_data f_data[] = {
|
||||
const struct f_data f_data[] = {
|
||||
{ FILE_NAME, FILE_START, FILE_LEN, mime_HTML, 0 },
|
||||
{ 0, 0, 0, mime_HTML, 0 },
|
||||
};
|
||||
@@ -92,7 +92,7 @@ void flash_read_bulk(uint8_t *dst)
|
||||
void flash_init(uint8_t enable_dio) { (void)enable_dio; }
|
||||
void flash_sector_erase(void) { }
|
||||
void flash_write_bytes(uint8_t *ptr) { (void)ptr; }
|
||||
char *get_flash_size_str(void) { return "512 kB"; }
|
||||
const char *get_flash_size_str(void) { return "512 kB"; }
|
||||
void crc16_bank1(uint8_t *v) { (void)v; }
|
||||
void reset_chip(void) { }
|
||||
void delay(uint16_t t) { (void)t; }
|
||||
@@ -124,7 +124,7 @@ uint16_t strtox(uint8_t *dst, const char *s)
|
||||
return n;
|
||||
}
|
||||
|
||||
void memcpyc(uint8_t *dst, uint8_t *src, uint16_t len) { memcpy(dst, src, len); }
|
||||
void memcpyc(uint8_t *dst, const uint8_t *src, uint16_t len) { memcpy(dst, src, len); }
|
||||
|
||||
bool strstart(const uint8_t *a, const uint8_t *b)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user