summaryrefslogtreecommitdiff
path: root/lib/audit_logging
diff options
context:
space:
mode:
authorPhilipp Gesang <philipp.gesang@intra2net.com>2018-07-09 09:41:37 +0200
committerAndrew Bartlett <abartlet@samba.org>2018-09-22 06:05:06 +0200
commitd50aafe932b79bc406501757e780ae1c7d9dddfc (patch)
tree205a49db00588a0edca76344d70d6711e7344ba0 /lib/audit_logging
parent188541076a1a19acb8a3dd572a5bd4f69350cf41 (diff)
downloadsamba-d50aafe932b79bc406501757e780ae1c7d9dddfc.tar.gz
lib/audit_logging: make json_{is_invalid,to_string}() accept a const*
Allow for json_is_invalid() and json_to_string() to be used on a const pointer. Neither function requires for the json object to be mutable so constraining them to non-const* is unnecessary. Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/audit_logging')
-rw-r--r--lib/audit_logging/audit_logging.c4
-rw-r--r--lib/audit_logging/audit_logging.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c
index ac08863129a..c274e971925 100644
--- a/lib/audit_logging/audit_logging.c
+++ b/lib/audit_logging/audit_logging.c
@@ -355,7 +355,7 @@ void json_free(struct json_object *object)
* @return is the object valid?
*
*/
-bool json_is_invalid(struct json_object *object)
+bool json_is_invalid(const struct json_object *object)
{
return !object->valid;
}
@@ -907,7 +907,7 @@ int json_add_guid(struct json_object *object,
* @return A string representation of the object or NULL if the object
* is invalid.
*/
-char *json_to_string(TALLOC_CTX *mem_ctx, struct json_object *object)
+char *json_to_string(TALLOC_CTX *mem_ctx, const struct json_object *object)
{
char *json = NULL;
char *json_string = NULL;
diff --git a/lib/audit_logging/audit_logging.h b/lib/audit_logging/audit_logging.h
index 4203743f315..5f095c0df9a 100644
--- a/lib/audit_logging/audit_logging.h
+++ b/lib/audit_logging/audit_logging.h
@@ -55,7 +55,7 @@ _WARN_UNUSED_RESULT_ struct json_object json_new_object(void);
_WARN_UNUSED_RESULT_ struct json_object json_new_array(void);
void json_free(struct json_object *object);
void json_assert_is_array(struct json_object *array);
-_WARN_UNUSED_RESULT_ bool json_is_invalid(struct json_object *object);
+_WARN_UNUSED_RESULT_ bool json_is_invalid(const struct json_object *object);
_WARN_UNUSED_RESULT_ int json_add_int(struct json_object *object,
const char *name,
@@ -93,6 +93,6 @@ _WARN_UNUSED_RESULT_ struct json_object json_get_array(
_WARN_UNUSED_RESULT_ struct json_object json_get_object(
struct json_object *object, const char *name);
_WARN_UNUSED_RESULT_ char *json_to_string(TALLOC_CTX *mem_ctx,
- struct json_object *object);
+ const struct json_object *object);
#endif
#endif