Permalink
Browse files

Merge pull request #85 from libcsp/sam0

Fixed warnings on newer arm compilers
  • Loading branch information...
johandc committed Feb 7, 2017
2 parents cbd9ed6 + e5a7b1d commit 03f18eec1d160c6e2bba3f02e8997121b6ab455d
Showing with 17 additions and 17 deletions.
  1. +6 −6 include/csp/csp.h
  2. +9 −9 src/csp_io.c
  3. +2 −2 src/drivers/usart/usart_linux.c
View
@@ -62,39 +62,39 @@ uint8_t csp_get_address(void);
* This function takes a pointer to a string, which should remain static
* @param hostname Hostname to set
*/
-void csp_set_hostname(char *hostname);
+void csp_set_hostname(const char *hostname);
/** csp_get_hostname
* Get current subsystem hostname.
* @return Pointer to char array with current hostname.
*/
-char *csp_get_hostname(void);
+const char *csp_get_hostname(void);
/** csp_set_model
* Set subsystem model name.
* This function takes a pointer to a string, which should remain static
* @param model Model name to set
*/
-void csp_set_model(char *model);
+void csp_set_model(const char *model);
/** csp_get_model
* Get current model name.
* @return Pointer to char array with current model name.
*/
-char *csp_get_model(void);
+const char *csp_get_model(void);
/** csp_set_revision
* Set subsystem revision. This can be used to override the CMP revision field.
* This function takes a pointer to a string, which should remain static
* @param revision Revision name to set
*/
-void csp_set_revision(char *revision);
+void csp_set_revision(const char *revision);
/** csp_get_revision
* Get subsystem revision.
* @return Pointer to char array with software revision.
*/
-char *csp_get_revision(void);
+const char *csp_get_revision(void);
/** csp_socket
* Create CSP socket endpoint
View
@@ -52,9 +52,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
static uint8_t csp_my_address;
/* Hostname, model and build revision */
-static char *csp_hostname = NULL;
-static char *csp_model = NULL;
-static char *csp_revision = GIT_REV;
+static const char *csp_hostname = NULL;
+static const char *csp_model = NULL;
+static const char *csp_revision = GIT_REV;
#ifdef CSP_USE_PROMISC
extern csp_queue_handle_t csp_promisc_queue;
@@ -70,32 +70,32 @@ uint8_t csp_get_address(void)
return csp_my_address;
}
-void csp_set_hostname(char *hostname)
+void csp_set_hostname(const char *hostname)
{
csp_hostname = hostname;
}
-char *csp_get_hostname(void)
+const char *csp_get_hostname(void)
{
return csp_hostname;
}
-void csp_set_model(char *model)
+void csp_set_model(const char *model)
{
csp_model = model;
}
-char *csp_get_model(void)
+const char *csp_get_model(void)
{
return csp_model;
}
-void csp_set_revision(char *revision)
+void csp_set_revision(const char *revision)
{
csp_revision = revision;
}
-char *csp_get_revision(void)
+const char *csp_get_revision(void)
{
return csp_revision;
}
@@ -39,11 +39,11 @@ usart_callback_t usart_callback = NULL;
static void *serial_rx_thread(void *vptr_args);
-int getbaud(int fd) {
+int getbaud(int ifd) {
struct termios termAttr;
int inputSpeed = -1;
speed_t baudRate;
- tcgetattr(fd, &termAttr);
+ tcgetattr(ifd, &termAttr);
/* Get the input speed. */
baudRate = cfgetispeed(&termAttr);
switch (baudRate) {

0 comments on commit 03f18ee

Please sign in to comment.