Fix compiler warnings over const losses.

This commit is contained in:
Our Air Quality 2019-04-06 11:30:53 +11:00
parent d0373af5c0
commit 2d9c701c37
13 changed files with 22 additions and 22 deletions

View file

@ -19,7 +19,7 @@
typedef void (*handle_http_token)(char *);
struct http_token_table {
char * token;
const char * token;
handle_http_token http_tock_cb;
};

View file

@ -15,9 +15,9 @@ typedef enum {
} HTTP_Client_State;
typedef struct {
char * server;
char * port;
char * path;
const char * server;
const char * port;
const char * path;
char * buffer;
uint16_t buffer_size;
http_final_cb buffer_full_cb;

View file

@ -38,10 +38,10 @@ typedef enum {
* Struct that contains all info for start ota.
*/
typedef struct {
char *server; /**< Server domain */
char *port; /**< Server port */
char *binary_path; /**< Server Path dowload new update binary */
char *sha256_path; /**< Server Path of SHA256 sum for check binary, could be NULL, check will be skipped */
const char *server; /**< Server domain */
const char *port; /**< Server port */
const char *binary_path; /**< Server Path dowload new update binary */
const char *sha256_path; /**< Server Path of SHA256 sum for check binary, could be NULL, check will be skipped */
} ota_info;
/**

View file

@ -239,7 +239,7 @@ typedef struct __attribute__((packed)) {
bool rboot_verify_image(uint32_t initial_offset, uint32_t *image_length, const char **error_message)
{
uint32_t offset = initial_offset;
char *error = NULL;
const char *error = NULL;
RBOOT_DEBUG("rboot_verify_image: verifying image at 0x%08x\n", initial_offset);
if(offset % 4) {
error = "Unaligned flash offset";

View file

@ -690,7 +690,7 @@ sntp_request(void *arg)
void
sntp_init(void)
{
char *def_addr[] = {SNTP_SERVER_ADDRESS};
const char *def_addr[] = {SNTP_SERVER_ADDRESS};
sntp_num_servers = 0;
sntp_set_servers(def_addr, sizeof(def_addr) / sizeof(char*));
@ -715,7 +715,7 @@ sntp_init(void)
/**
* Set the NTP servers
*/
int sntp_set_servers(char *server_url[], int num_servers)
int sntp_set_servers(const char *server_url[], int num_servers)
{
int i;

View file

@ -52,7 +52,7 @@ void sntp_set_timezone(const struct timezone *tz);
* Returns 0 if OK, less than 0 if error.
* NOTE: This function must NOT be called before sntp_initialize().
*/
int sntp_set_servers(char *server_url[], int num_servers);
int sntp_set_servers(const char *server_url[], int num_servers);
/*
* Sets the update delay in ms. If requested value is less than 15s,

View file

@ -1007,7 +1007,7 @@ int ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font
return d->width;
}
int ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, char *str,
int ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, const char *str,
ssd1306_color_t foreground, ssd1306_color_t background)
{
uint8_t t = x;

View file

@ -493,7 +493,7 @@ int ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font
* @param background Background color
* @return Width of the string or negative value if error occured
*/
int ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background);
int ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, const char *str, ssd1306_color_t foreground, ssd1306_color_t background);
/**
* Stop scrolling (the ram data needs to be rewritten)