From cea68bf2f212a47ad76f4f5f7e6abedab7532bca Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Fri, 9 Dec 2016 10:03:02 +0000 Subject: [PATCH] Added const to char* to allow initialisation from std::string in applications using the library --- srslte/include/srslte/io/netsink.h | 2 +- srslte/include/srslte/io/netsource.h | 2 +- srslte/lib/io/netsink.c | 2 +- srslte/lib/io/netsource.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/srslte/include/srslte/io/netsink.h b/srslte/include/srslte/io/netsink.h index 4f0771958..3339716c1 100644 --- a/srslte/include/srslte/io/netsink.h +++ b/srslte/include/srslte/io/netsink.h @@ -59,7 +59,7 @@ typedef struct SRSLTE_API { }srslte_netsink_t; SRSLTE_API int srslte_netsink_init(srslte_netsink_t *q, - char *address, + const char *address, uint16_t port, srslte_netsink_type_t type); diff --git a/srslte/include/srslte/io/netsource.h b/srslte/include/srslte/io/netsource.h index 7a2739993..e10d8d644 100644 --- a/srslte/include/srslte/io/netsource.h +++ b/srslte/include/srslte/io/netsource.h @@ -60,7 +60,7 @@ typedef struct SRSLTE_API { }srslte_netsource_t; SRSLTE_API int srslte_netsource_init(srslte_netsource_t *q, - char *address, + const char *address, uint16_t port, srslte_netsource_type_t type); diff --git a/srslte/lib/io/netsink.c b/srslte/lib/io/netsink.c index ce4fdd731..0a4c8110d 100644 --- a/srslte/lib/io/netsink.c +++ b/srslte/lib/io/netsink.c @@ -38,7 +38,7 @@ #include "srslte/io/netsink.h" -int srslte_netsink_init(srslte_netsink_t *q, char *address, uint16_t port, srslte_netsink_type_t type) { +int srslte_netsink_init(srslte_netsink_t *q, const char *address, uint16_t port, srslte_netsink_type_t type) { bzero(q, sizeof(srslte_netsink_t)); q->sockfd=socket(AF_INET, type==SRSLTE_NETSINK_TCP?SOCK_STREAM:SOCK_DGRAM,0); diff --git a/srslte/lib/io/netsource.c b/srslte/lib/io/netsource.c index 9d6849368..4e81331f4 100644 --- a/srslte/lib/io/netsource.c +++ b/srslte/lib/io/netsource.c @@ -36,7 +36,7 @@ #include "srslte/io/netsource.h" -int srslte_netsource_init(srslte_netsource_t *q, char *address, uint16_t port, srslte_netsource_type_t type) { +int srslte_netsource_init(srslte_netsource_t *q, const char *address, uint16_t port, srslte_netsource_type_t type) { bzero(q, sizeof(srslte_netsource_t)); q->sockfd=socket(AF_INET,type==SRSLTE_NETSOURCE_TCP?SOCK_STREAM:SOCK_DGRAM,0);