]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
pointer to const in lib
authorajneu <ajneu@users.noreply.github.com>
Mon, 13 Jun 2016 08:26:53 +0000 (10:26 +0200)
committerajneu <ajneu@users.noreply.github.com>
Mon, 13 Jun 2016 08:26:53 +0000 (10:26 +0200)
lib.c
lib.h

diff --git a/lib.c b/lib.c
index 973be52e5c5869c9a39718b5ea59f03cc8ac6a38..fe18e0f9781206030a62aaecf9a61394cf6b8525 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -519,14 +519,14 @@ static int snprintf_error_data(char *buf, size_t len, uint8_t err,
        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)
                return 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;
 
@@ -542,7 +542,7 @@ static int snprintf_error_ctrl(char *buf, size_t len, struct canfd_frame *cf)
        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;
 
@@ -563,8 +563,8 @@ static int snprintf_error_prot(char *buf, size_t len, struct canfd_frame *cf)
        return n;
 }
 
-void snprintf_can_error_frame(char *buf, size_t len, struct canfd_frame *cf,
-                             char* sep)
+void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
+                  const char* sep)
 {
        canid_t class, mask;
        int i, n = 0, classes = 0;
diff --git a/lib.h b/lib.h
index 4f73743be990a3c2e9b34faa4567cdb14c0fd90b..36c3a099c1a6518b9cee01ad08f57292b47ef4da 100644 (file)
--- a/lib.h
+++ b/lib.h
@@ -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,
-                             char *sep);
+void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
+                  const char *sep);
 /*
  * Creates a CAN error frame output in user readable format.
  */