pointer to const in lib

pull/23/head
ajneu 2016-06-13 10:26:53 +02:00
parent b70a76670d
commit ef2ea8fa59
2 changed files with 7 additions and 7 deletions

10
lib.c
View File

@ -519,14 +519,14 @@ static int snprintf_error_data(char *buf, size_t len, uint8_t err,
return n; return n;
} }
static int snprintf_error_lostarb(char *buf, size_t len, struct canfd_frame *cf) static int snprintf_error_lostarb(char *buf, size_t len, const struct canfd_frame *cf)
{ {
if (len <= 0) if (len <= 0)
return 0; return 0;
return snprintf(buf, len, "{at bit %d}", cf->data[0]); return snprintf(buf, len, "{at bit %d}", cf->data[0]);
} }
static int snprintf_error_ctrl(char *buf, size_t len, struct canfd_frame *cf) static int snprintf_error_ctrl(char *buf, size_t len, const struct canfd_frame *cf)
{ {
int n = 0; int n = 0;
@ -542,7 +542,7 @@ static int snprintf_error_ctrl(char *buf, size_t len, struct canfd_frame *cf)
return n; return n;
} }
static int snprintf_error_prot(char *buf, size_t len, struct canfd_frame *cf) static int snprintf_error_prot(char *buf, size_t len, const struct canfd_frame *cf)
{ {
int n = 0; int n = 0;
@ -563,8 +563,8 @@ static int snprintf_error_prot(char *buf, size_t len, struct canfd_frame *cf)
return n; return n;
} }
void snprintf_can_error_frame(char *buf, size_t len, struct canfd_frame *cf, void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
char* sep) const char* sep)
{ {
canid_t class, mask; canid_t class, mask;
int i, n = 0, classes = 0; int i, n = 0, classes = 0;

4
lib.h
View File

@ -203,8 +203,8 @@ void sprint_long_canframe(char *buf , struct canfd_frame *cf, int view, int maxd
* *
*/ */
void snprintf_can_error_frame(char *buf, size_t len, struct canfd_frame *cf, void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
char *sep); const char *sep);
/* /*
* Creates a CAN error frame output in user readable format. * Creates a CAN error frame output in user readable format.
*/ */