aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-08-06 08:26:40 -0400
committerJohn Thacker <johnthacker@gmail.com>2022-08-06 08:26:40 -0400
commit6fd212926a8df85bc1dbdbc43db12da8c34115eb (patch)
tree5eba99e40b803a14253a38ebb288b571e543e035 /epan
parent057436ff81dcf9ea92a04914f89cab5f61a5fe92 (diff)
epan: Constify a few range functions
Diffstat (limited to 'epan')
-rw-r--r--epan/range.c6
-rw-r--r--epan/range.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/epan/range.c b/epan/range.c
index 7f4d5d7c36..a2ff590d83 100644
--- a/epan/range.c
+++ b/epan/range.c
@@ -257,7 +257,7 @@ range_convert_str_work(wmem_allocator_t *scope, range_t **rangep, const gchar *e
* stored in the ranges array.
*/
gboolean
-value_is_in_range(range_t *range, guint32 val)
+value_is_in_range(const range_t *range, guint32 val)
{
guint i;
@@ -366,7 +366,7 @@ range_remove_value(wmem_allocator_t *scope, range_t **range, guint32 val)
/* This function returns TRUE if the two given range_t's are equal.
*/
gboolean
-ranges_are_equal(range_t *a, range_t *b)
+ranges_are_equal(const range_t *a, const range_t *b)
{
guint i;
@@ -429,7 +429,7 @@ range_convert_range(wmem_allocator_t *scope, const range_t *range)
/* Create a copy of a range. */
range_t *
-range_copy(wmem_allocator_t *scope, range_t *src)
+range_copy(wmem_allocator_t *scope, const range_t *src)
{
range_t *dst;
size_t range_size;
diff --git a/epan/range.h b/epan/range.h
index 1a4773101a..a679c2640c 100644
--- a/epan/range.h
+++ b/epan/range.h
@@ -91,7 +91,7 @@ WS_DLL_PUBLIC convert_ret_t range_convert_str_work(wmem_allocator_t *scope, rang
* @param val the value to check
* @return TRUE if the value is in range
*/
-WS_DLL_PUBLIC gboolean value_is_in_range(range_t *range, guint32 val);
+WS_DLL_PUBLIC gboolean value_is_in_range(const range_t *range, guint32 val);
/** This function returns TRUE if val has successfully been added to
* a range. This may extend an existing range or create a new one
@@ -116,7 +116,7 @@ WS_DLL_PUBLIC gboolean range_remove_value(wmem_allocator_t *scope, range_t **ran
* @param b second range
* @return TRUE if the value is in range
*/
-WS_DLL_PUBLIC gboolean ranges_are_equal(range_t *a, range_t *b);
+WS_DLL_PUBLIC gboolean ranges_are_equal(const range_t *a, const range_t *b);
/** This function calls the provided callback function for each value in
* in the range. Takes a pointer argument, which is passed to the
@@ -138,7 +138,7 @@ WS_DLL_PUBLIC char *range_convert_range(wmem_allocator_t *scope, const range_t *
* @param src the range to copy
* @return ep allocated copy of the range
*/
-WS_DLL_PUBLIC range_t *range_copy(wmem_allocator_t *scope, range_t *src);
+WS_DLL_PUBLIC range_t *range_copy(wmem_allocator_t *scope, const range_t *src);
#ifdef __cplusplus
}