Constify received GDB packet

v2:
- Split work into separate patches

The received packet will not be altered in any of the processing functions.
Some it can be made "const".

Change-Id: I7bb410224cf6daa74a6c494624176ccb9ae638ac
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1919
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Christian Eggers
2014-02-14 21:48:52 +01:00
committed by Spencer Oliver
parent 537b06a810
commit 9b2577742c
8 changed files with 46 additions and 46 deletions

View File

@@ -902,7 +902,7 @@ int image_read_section(struct image *image,
return ERROR_OK;
}
int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t *data)
int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t const *data)
{
struct imagesection *section;

View File

@@ -99,7 +99,7 @@ int image_read_section(struct image *image, int section, uint32_t offset,
void image_close(struct image *image);
int image_add_section(struct image *image, uint32_t base, uint32_t size,
int flags, uint8_t *data);
int flags, uint8_t const *data);
int image_calculate_checksum(uint8_t *buffer, uint32_t nbytes,
uint32_t *checksum);

View File

@@ -56,7 +56,7 @@
/* packet j :smp status request */
int gdb_read_smp_packet(struct connection *connection,
char *packet, int packet_size)
char const *packet, int packet_size)
{
struct target *target = get_target_from_connection(connection);
int retval = ERROR_OK;
@@ -77,7 +77,7 @@ int gdb_read_smp_packet(struct connection *connection,
/* J : smp set request */
int gdb_write_smp_packet(struct connection *connection,
char *packet, int packet_size)
char const *packet, int packet_size)
{
struct target *target = get_target_from_connection(connection);
char *separator;

View File

@@ -21,7 +21,7 @@
#include "server/server.h"
int gdb_read_smp_packet(struct connection *connection,
char *packet, int packet_size);
char const *packet, int packet_size);
int gdb_write_smp_packet(struct connection *connection,
char *packet, int packet_size);
char const *packet, int packet_size);