Commit cc686f15 authored by Shubham Lagwankar's avatar Shubham Lagwankar

Problem: unused import and inconsistent use of const

Solution: remove unused import and fix const placement.
parent fc36c7d2
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "radix_tree.hpp" #include "radix_tree.hpp"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <string.h> #include <string.h>
node::node (unsigned char *data) : data_ (data) node::node (unsigned char *data) : data_ (data)
...@@ -81,7 +80,7 @@ unsigned char *node::prefix () ...@@ -81,7 +80,7 @@ unsigned char *node::prefix ()
return data_ + 3 * sizeof (uint32_t); return data_ + 3 * sizeof (uint32_t);
} }
void node::set_prefix (unsigned char const *bytes) void node::set_prefix (const unsigned char *bytes)
{ {
memcpy (prefix (), bytes, prefix_length ()); memcpy (prefix (), bytes, prefix_length ());
} }
...@@ -91,7 +90,7 @@ unsigned char *node::first_bytes () ...@@ -91,7 +90,7 @@ unsigned char *node::first_bytes ()
return prefix () + prefix_length (); return prefix () + prefix_length ();
} }
void node::set_first_bytes (unsigned char const *bytes) void node::set_first_bytes (const unsigned char *bytes)
{ {
memcpy (first_bytes (), bytes, edgecount ()); memcpy (first_bytes (), bytes, edgecount ());
} }
...@@ -113,7 +112,7 @@ unsigned char *node::node_ptrs () ...@@ -113,7 +112,7 @@ unsigned char *node::node_ptrs ()
return prefix () + prefix_length () + edgecount (); return prefix () + prefix_length () + edgecount ();
} }
void node::set_node_ptrs (unsigned char const *ptrs) void node::set_node_ptrs (const unsigned char *ptrs)
{ {
memcpy (node_ptrs (), ptrs, edgecount () * sizeof (void *)); memcpy (node_ptrs (), ptrs, edgecount () * sizeof (void *));
} }
......
...@@ -83,7 +83,7 @@ struct node ...@@ -83,7 +83,7 @@ struct node
inline void set_prefix (const unsigned char *prefix); inline void set_prefix (const unsigned char *prefix);
inline void set_first_bytes (const unsigned char *bytes); inline void set_first_bytes (const unsigned char *bytes);
inline void set_first_byte_at (size_t i, unsigned char byte); inline void set_first_byte_at (size_t i, unsigned char byte);
inline void set_node_ptrs (unsigned char const *ptrs); inline void set_node_ptrs (const unsigned char *ptrs);
inline void set_node_at (size_t i, node n); inline void set_node_at (size_t i, node n);
inline void set_edge_at (size_t i, unsigned char byte, node n); inline void set_edge_at (size_t i, unsigned char byte, node n);
void resize (size_t prefix_length, size_t edgecount); void resize (size_t prefix_length, size_t edgecount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment