summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-09-11 10:31:29 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-09-11 10:31:29 +0200
commit06f645542cc9ca4e881eb3c0a441b510866a1a9f (patch)
tree447677b7c03a93163ce6bf8855f4e023da75297a /src
parente92866bbb1aade3eead0dc6169d26e0b7b30a605 (diff)
logging: Mark the log_info_cat pointer as consts
Applications should keep the log area in a static const area. Mark the pointer as const to address compiler warnings in OpenBSC, cast the const away for the osmo_log_info as it is not declared as const.
Diffstat (limited to 'src')
-rw-r--r--src/logging.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/logging.c b/src/logging.c
index 1ab8767f..eed0b26c 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -740,14 +740,15 @@ int log_init(const struct log_info *inf, void *ctx)
/* copy over the user part */
for (i = 0; i < inf->num_cat; i++) {
- memcpy(&osmo_log_info->cat[i], &inf->cat[i],
+ memcpy((struct log_info_cat *) &osmo_log_info->cat[i],
+ &inf->cat[i],
sizeof(struct log_info_cat));
}
/* copy over the library part */
for (i = 0; i < ARRAY_SIZE(internal_cat); i++) {
unsigned int cn = osmo_log_info->num_cat_user + i;
- memcpy(&osmo_log_info->cat[cn],
+ memcpy((struct log_info_cat *) &osmo_log_info->cat[cn],
&internal_cat[i], sizeof(struct log_info_cat));
}