Skip to content

Commit f4eb37a

Browse files
Add const on init methods
1 parent 0912c14 commit f4eb37a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

lib/api/wpc_proto.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ typedef enum
8989
*/
9090
app_proto_res_e WPC_Proto_initialize(const char * port_name,
9191
unsigned long bitrate,
92-
char * gateway_id,
93-
char * gateway_model,
94-
char * gateway_version,
95-
char * sink_id);
92+
const char * gateway_id,
93+
const char * gateway_model,
94+
const char * gateway_version,
95+
const char * sink_id);
9696

9797
/**
9898
* \brief close protobuf interface

lib/wpc_proto/internal_modules/common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ static const wp_ErrorCode APP_ERROR_CODE_LUT[] = {
5353
* Enforce null termination for strings stored
5454
* \return True if successful, False otherwise
5555
*/
56-
bool Common_init(char * gateway_id,
57-
char * gateway_model,
58-
char * gateway_version,
59-
char * sink_id)
56+
bool Common_init(const char * gateway_id,
57+
const char * gateway_model,
58+
const char * gateway_version,
59+
const char * sink_id)
6060
{
6161
strncpy(m_gateway_id, gateway_id, GATEWAY_ID_MAX_SIZE);
6262
m_gateway_id[GATEWAY_ID_MAX_SIZE - 1]='\0';

lib/wpc_proto/internal_modules/common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
* \brief Intialize the common module
2424
* \return True if successful, False otherwise
2525
*/
26-
bool Common_init(char * gateway_id,
27-
char * gateway_model,
28-
char * gateway_version,
29-
char * sink_id);
26+
bool Common_init(const char * gateway_id,
27+
const char * gateway_model,
28+
const char * gateway_version,
29+
const char * sink_id);
3030

3131
char * Common_get_gateway_id(void);
3232

lib/wpc_proto/wpc_proto.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ static int open_and_check_connection(unsigned long baudrate, const char * port_n
5454

5555
app_proto_res_e WPC_Proto_initialize(const char * port_name,
5656
unsigned long bitrate,
57-
char * gateway_id,
58-
char * gateway_model,
59-
char * gateway_version,
60-
char * sink_id)
57+
const char * gateway_id,
58+
const char * gateway_model,
59+
const char * gateway_version,
60+
const char * sink_id)
6161
{
6262
_Static_assert(WPC_PROTO_MAX_RESPONSE_SIZE >= (wp_GetConfigsResp_size + WPC_PROTO_GENERIC_MESSAGE_OVERHEAD),
6363
"Max proto size too low");

0 commit comments

Comments
 (0)