celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/2] celix git commit: CELIX-365: Refactors some usage of void* and void** to const void* and const void**
Date Sun, 10 Jul 2016 10:16:39 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 91dee87ed -> e628ee4e6


CELIX-365: Refactors some usage of void* and void** to const void* and const void**


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/516baaa3
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/516baaa3
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/516baaa3

Branch: refs/heads/develop
Commit: 516baaa36e7a7736faa4c13012460b508ea561fe
Parents: 91dee87
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Sun Jul 10 12:13:38 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Sun Jul 10 12:13:38 2016 +0200

----------------------------------------------------------------------
 dependency_manager/private/include/dm_event.h   | 12 ++++-----
 .../include/dm_service_dependency_impl.h        |  4 +--
 .../private/src/dm_component_impl.c             | 20 +++++++-------
 dependency_manager/private/src/dm_event.c       | 10 +++----
 .../private/src/dm_service_dependency.c         | 10 +++----
 .../public/include/dm_component.h               |  6 ++---
 .../public/include/dm_service_dependency.h      | 26 +++++++++---------
 .../phase2a/private/include/phase2a_cmp.h       |  2 +-
 .../phase2a/private/src/phase2a_activator.c     |  2 +-
 .../phase2a/private/src/phase2a_cmp.c           |  4 +--
 .../phase2b/private/include/phase2b_cmp.h       |  2 +-
 .../phase2b/private/src/phase2b_activator.c     |  2 +-
 .../phase2b/private/src/phase2b_cmp.c           |  4 +--
 .../phase3/private/include/phase3_cmp.h         |  4 +--
 .../phase3/private/src/phase3_activator.c       |  2 +-
 .../dm_example/phase3/private/src/phase3_cmp.c  | 10 +++----
 .../private/src/listener_example.c              |  4 +--
 .../tracker_depman/private/include/tracker.h    | 18 ++++++-------
 .../private/src/dependency_activator.c          |  2 +-
 .../tracker_depman/private/src/tracker.c        | 26 +++++++++---------
 framework/private/include/framework_private.h   |  4 +--
 .../private/include/service_reference_private.h |  4 +--
 .../include/service_registration_private.h      | 12 ++++-----
 framework/private/mock/bundle_context_mock.c    |  4 +--
 framework/private/mock/framework_mock.c         |  6 ++---
 framework/private/mock/service_reference_mock.c |  4 +--
 .../private/mock/service_registration_mock.c    | 12 ++++-----
 framework/private/mock/service_registry_mock.c  |  6 ++---
 framework/private/mock/version_range_mock.c     |  2 +-
 framework/private/src/bundle_context.c          |  9 ++++---
 framework/private/src/framework.c               | 10 +++----
 framework/private/src/service_reference.c       |  7 +++--
 framework/private/src/service_registration.c    | 28 ++++++++++++--------
 framework/private/src/service_registry.c        | 28 ++++++++++++--------
 .../private/test/service_registration_test.cpp  |  6 ++---
 .../private/test/service_registry_test.cpp      |  2 +-
 framework/public/include/bundle_context.h       |  2 +-
 framework/public/include/service_registry.h     |  4 +--
 .../private/src/endpoint_discovery_poller.c     |  4 +--
 .../topology_manager/private/src/scope.c        |  4 +--
 utils/private/src/array_list.c                  |  4 +--
 utils/private/src/version_range.c               |  2 +-
 utils/public/include/array_list.h               |  2 +-
 utils/public/include/version_range.h            |  2 +-
 44 files changed, 178 insertions(+), 160 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/private/include/dm_event.h
----------------------------------------------------------------------
diff --git a/dependency_manager/private/include/dm_event.h b/dependency_manager/private/include/dm_event.h
index 21f9831..d04e9b0 100644
--- a/dependency_manager/private/include/dm_event.h
+++ b/dependency_manager/private/include/dm_event.h
@@ -41,7 +41,7 @@ enum dm_event_type {
 typedef enum dm_event_type dm_event_type_e;
 
 struct dm_event {
-	void *service;
+	const void* service;
 	long serviceId;
 	long ranking;
 	service_reference_pt reference;
@@ -53,13 +53,13 @@ struct dm_event {
 typedef struct dm_event *dm_event_pt;
 
 
-celix_status_t event_create(dm_event_type_e event_type, bundle_pt bundle, bundle_context_pt context, service_reference_pt reference, void *service, dm_event_pt *event);
-celix_status_t event_destroy(dm_event_pt *event);
+celix_status_t event_create(dm_event_type_e event_type, bundle_pt bundle, bundle_context_pt context, service_reference_pt reference, const void* service, dm_event_pt *event);
+celix_status_t event_destroy(dm_event_pt* event);
 
-celix_status_t event_equals(void *a, void *b, bool *equals);
+celix_status_t event_equals(const void* a, const void* b, bool* equals);
 
-celix_status_t event_getService(dm_event_pt event, void **service);
-celix_status_t event_compareTo(dm_event_pt event, dm_event_pt compareTo, int *compare);
+celix_status_t event_getService(dm_event_pt event, const void** service);
+celix_status_t event_compareTo(dm_event_pt event, dm_event_pt compareTo, int* compare);
 
 
 #endif /* DM_EVENT_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/private/include/dm_service_dependency_impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager/private/include/dm_service_dependency_impl.h b/dependency_manager/private/include/dm_service_dependency_impl.h
index 60bb113..b67c4af 100644
--- a/dependency_manager/private/include/dm_service_dependency_impl.h
+++ b/dependency_manager/private/include/dm_service_dependency_impl.h
@@ -55,7 +55,7 @@ struct dm_service_dependency {
 	service_remove_with_ref_fpt remove_with_ref;
 	service_swap_with_ref_fpt swap_with_ref;
 
-	void **autoConfigure;
+	const void **autoConfigure;
 	celix_thread_mutex_t lock;
 
 	bool isStarted;
@@ -87,7 +87,7 @@ celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency,
 celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt dependency, bool *instanceBound);
 celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependency, bool *autoConfig);
 
-celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, void ***autoConfigure);
+celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure);
 celix_status_t serviceDependency_unlock(dm_service_dependency_pt dependency);
 celix_status_t serviceDependency_lock(dm_service_dependency_pt dependency);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/private/src/dm_component_impl.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c
index ef46811..270142c 100644
--- a/dependency_manager/private/src/dm_component_impl.c
+++ b/dependency_manager/private/src/dm_component_impl.c
@@ -41,7 +41,7 @@ struct dm_component_struct {
     bundle_context_pt context;
     array_list_pt dm_interfaces;
 
-    void *implementation;
+    void* implementation;
 
     init_fpt callbackInit;
     start_fpt callbackStart;
@@ -61,8 +61,8 @@ struct dm_component_struct {
 };
 
 typedef struct dm_interface_struct {
-    char *serviceName;
-    void *service;
+    char* serviceName;
+    const void* service;
     properties_pt properties;
     service_registration_pt registration;
 } dm_interface_t;
@@ -326,7 +326,7 @@ celix_status_t component_stopTask(dm_component_pt component, void *data __attrib
     return status;
 }
 
-celix_status_t component_addInterface(dm_component_pt component, char *serviceName, char *serviceVersion, void *service, properties_pt properties) {
+celix_status_t component_addInterface(dm_component_pt component, const char* serviceName, const char* serviceVersion, const void* service, properties_pt properties) {
     celix_status_t status = CELIX_SUCCESS;
 
     if (component->active) {
@@ -339,8 +339,8 @@ celix_status_t component_addInterface(dm_component_pt component, char *serviceNa
             properties = properties_create();
         }
 
-        if ((properties_get(properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION) == NULL) && (serviceVersion != NULL)) {
-            properties_set(properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION, serviceVersion);
+        if ((properties_get(properties, CELIX_FRAMEWORK_SERVICE_VERSION) == NULL) && (serviceVersion != NULL)) {
+            properties_set(properties, CELIX_FRAMEWORK_SERVICE_VERSION, serviceVersion);
         }
 
         if (interface && name) {
@@ -660,8 +660,8 @@ celix_status_t component_updateInstance(dm_component_pt component, dm_service_de
     serviceDependency_isAutoConfig(dependency, &autoConfig);
 
     if (autoConfig) {
-        void *service = NULL;
-        void **field = NULL;
+        const void *service = NULL;
+        const void **field = NULL;
 
         if (event != NULL) {
             event_getService(event, &service);
@@ -1137,11 +1137,11 @@ celix_status_t component_getDependencyEvent(dm_component_pt component, dm_servic
 celix_status_t component_configureImplementation(dm_component_pt component, dm_service_dependency_pt dependency) {
     celix_status_t status = CELIX_SUCCESS;
 
-    void **field = NULL;
+    const void **field = NULL;
 
     array_list_pt events = hashMap_get(component->dependencyEvents, dependency);
     if (events) {
-        void *service = NULL;
+        const void *service = NULL;
         dm_event_pt event = NULL;
         component_getDependencyEvent(component, dependency, &event);
         if (event != NULL) {

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/private/src/dm_event.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_event.c b/dependency_manager/private/src/dm_event.c
index 017bcf5..e30720d 100644
--- a/dependency_manager/private/src/dm_event.c
+++ b/dependency_manager/private/src/dm_event.c
@@ -31,7 +31,7 @@
 
 #include "dm_event.h"
 
-celix_status_t event_create(dm_event_type_e event_type, bundle_pt bundle, bundle_context_pt context, service_reference_pt reference, void *service, dm_event_pt *event) {
+celix_status_t event_create(dm_event_type_e event_type, bundle_pt bundle, bundle_context_pt context, service_reference_pt reference, const void *service, dm_event_pt *event) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	*event = calloc(1, sizeof(**event));
@@ -76,14 +76,14 @@ celix_status_t event_destroy(dm_event_pt *event) {
 	return status;
 }
 
-celix_status_t event_equals(void *a, void *b, bool *equals) {
+celix_status_t event_equals(const void *a, const void *b, bool *equals) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!a || !b) {
 		*equals = false;
 	} else {
-		dm_event_pt a_ptr = a;
-		dm_event_pt b_ptr = b;
+		dm_event_pt a_ptr = (dm_event_pt)a;
+		dm_event_pt b_ptr = (dm_event_pt)b;
 
 		*equals = a_ptr->serviceId == b_ptr->serviceId;
 	}
@@ -99,7 +99,7 @@ celix_status_t event_compareTo(dm_event_pt event, dm_event_pt compareTo, int *co
 	return status;
 }
 
-celix_status_t event_getService(dm_event_pt event, void **service) {
+celix_status_t event_getService(dm_event_pt event, const void **service) {
 	*service = event->service;
 	return CELIX_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/private/src/dm_service_dependency.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_service_dependency.c b/dependency_manager/private/src/dm_service_dependency.c
index ca9e8ae..2c713c5 100644
--- a/dependency_manager/private/src/dm_service_dependency.c
+++ b/dependency_manager/private/src/dm_service_dependency.c
@@ -148,7 +148,7 @@ celix_status_t serviceDependency_getStrategy(dm_service_dependency_pt dependency
 
 }
 
-celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, char *serviceName, char *serviceVersionRange, char *filter) {
+celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, const char* serviceName, const char* serviceVersionRange, const char* filter) {
 	celix_status_t status = CELIX_SUCCESS;
 	if (!dependency || !serviceName) {
 		status = CELIX_ILLEGAL_ARGUMENT;
@@ -254,8 +254,8 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
 	return status;
 }
 
-celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, char **filter) {
-	*filter = dependency->tracked_filter;
+celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, const char** filter) {
+	*filter = (const char*)dependency->tracked_filter;
 	return CELIX_SUCCESS;
 }
 
@@ -296,7 +296,7 @@ celix_status_t serviceDependency_setCallbacksWithServiceReference(dm_service_dep
 	return status;
 }
 
-celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, void **field) {
+celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, const void **field) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	celix_thread_mutex_t lock;
@@ -616,7 +616,7 @@ celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependenc
 	return status;
 }
 
-celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, void ***autoConfigure) {
+celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/public/include/dm_component.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_component.h b/dependency_manager/public/include/dm_component.h
index 65c4609..2720a03 100644
--- a/dependency_manager/public/include/dm_component.h
+++ b/dependency_manager/public/include/dm_component.h
@@ -49,11 +49,11 @@ typedef int (*start_fpt)(void *userData);
 typedef int (*stop_fpt)(void *userData);
 typedef int (*deinit_fpt)(void *userData);
 
-celix_status_t component_create(bundle_context_pt context, const char *name, dm_component_pt *component);
+celix_status_t component_create(bundle_context_pt context, const char* name, dm_component_pt *component);
 void component_destroy(dm_component_pt component);
 
-celix_status_t component_addInterface(dm_component_pt component, char *serviceName, char *serviceVersion, void *service, properties_pt properties);
-celix_status_t component_setImplementation(dm_component_pt component, void *implementation);
+celix_status_t component_addInterface(dm_component_pt component, const char* serviceName, const char* serviceVersion, const void* service, properties_pt properties);
+celix_status_t component_setImplementation(dm_component_pt component, void* implementation);
 
 /**
  * Returns an arraylist of service names. The caller owns the arraylist and strings (char *)

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/dependency_manager/public/include/dm_service_dependency.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_service_dependency.h b/dependency_manager/public/include/dm_service_dependency.h
index a2583cc..8088809 100644
--- a/dependency_manager/public/include/dm_service_dependency.h
+++ b/dependency_manager/public/include/dm_service_dependency.h
@@ -38,17 +38,17 @@ typedef enum dm_service_dependency_strategy_enum {
 	DM_SERVICE_DEPENDENCY_STRATEGY_SUSPEND
 } dm_service_dependency_strategy_t;
 
-typedef int (*service_set_fpt)(void *handle, void *service);
-typedef int (*service_add_fpt)(void *handle, void *service);
-typedef int (*service_change_fpt)(void *handle, void *service);
-typedef int (*service_remove_fpt)(void *handle, void *service);
-typedef int (*service_swap_fpt)(void *handle, void *oldService, void *newService);
+typedef int (*service_set_fpt)(void *handle, const void* service);
+typedef int (*service_add_fpt)(void *handle, const void* service);
+typedef int (*service_change_fpt)(void *handle, const void* service);
+typedef int (*service_remove_fpt)(void *handle, const void* service);
+typedef int (*service_swap_fpt)(void *handle, const void* oldService, const void* newService);
 
-typedef celix_status_t (*service_set_with_ref_fpt)(void *handle, service_reference_pt reference, void *service);
-typedef celix_status_t (*service_add_with_ref_fpt)(void *handle, service_reference_pt reference, void *service);
-typedef celix_status_t (*service_change_with_ref_fpt)(void *handle, service_reference_pt reference, void *service);
-typedef celix_status_t (*service_remove_with_ref_fpt)(void *handle, service_reference_pt reference, void *service);
-typedef celix_status_t (*service_swap_with_ref_fpt)(void *handle, service_reference_pt oldReference, void *oldService, service_reference_pt newReference, void *newService);
+typedef celix_status_t (*service_set_with_ref_fpt)(void *handle, service_reference_pt reference, const void* service);
+typedef celix_status_t (*service_add_with_ref_fpt)(void *handle, service_reference_pt reference, const void* service);
+typedef celix_status_t (*service_change_with_ref_fpt)(void *handle, service_reference_pt reference, const void* service);
+typedef celix_status_t (*service_remove_with_ref_fpt)(void *handle, service_reference_pt reference, const void* service);
+typedef celix_status_t (*service_swap_with_ref_fpt)(void *handle, service_reference_pt oldReference, const void* oldService, service_reference_pt newReference, const void* newService);
 
 celix_status_t serviceDependency_create(dm_service_dependency_pt *dependency_ptr);
 celix_status_t serviceDependency_destroy(dm_service_dependency_pt *dependency_ptr);
@@ -56,12 +56,12 @@ celix_status_t serviceDependency_destroy(dm_service_dependency_pt *dependency_pt
 celix_status_t serviceDependency_setRequired(dm_service_dependency_pt dependency, bool required);
 celix_status_t serviceDependency_setStrategy(dm_service_dependency_pt dependency,dm_service_dependency_strategy_t strategy);
 celix_status_t serviceDependency_getStrategy(dm_service_dependency_pt dependency,dm_service_dependency_strategy_t* strategy);
-celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, char *serviceName, char *serviceVersionRange, char *filter);
-celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, char **filter);
+celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, const char* serviceName, const char* serviceVersionRange, const char* filter);
+celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, const char** filter);
 
 celix_status_t serviceDependency_setCallbacks(dm_service_dependency_pt dependency, service_set_fpt set, service_add_fpt add, service_change_fpt change, service_remove_fpt remove, service_swap_fpt swap);
 celix_status_t serviceDependency_setCallbacksWithServiceReference(dm_service_dependency_pt dependency, service_set_with_ref_fpt set, service_add_with_ref_fpt add, service_change_with_ref_fpt change, service_remove_with_ref_fpt remove, service_swap_with_ref_fpt swap);
-celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, void **field);
+celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, const void** field);
 
 #define serviceDependency_setCallbacksSafe(dep, cmpType, servType, set, add, change, remove, swap) \
 	do { \

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2a/private/include/phase2a_cmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/private/include/phase2a_cmp.h b/examples/dm_example/phase2a/private/include/phase2a_cmp.h
index 5b8431a..060b23d 100644
--- a/examples/dm_example/phase2a/private/include/phase2a_cmp.h
+++ b/examples/dm_example/phase2a/private/include/phase2a_cmp.h
@@ -38,7 +38,7 @@ int phase2a_stop(phase2a_cmp_t *cmp);
 int phase2a_deinit(phase2a_cmp_t *cmp);
 void phase2a_destroy(phase2a_cmp_t *cmp);
 
-int phase2a_setPhase1(phase2a_cmp_t *cmp, phase1_t *phase1);
+int phase2a_setPhase1(phase2a_cmp_t *cmp, const phase1_t* phase1);
 
 int phase2a_getData(phase2a_cmp_t *cmp, double *data);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2a/private/src/phase2a_activator.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/private/src/phase2a_activator.c b/examples/dm_example/phase2a/private/src/phase2a_activator.c
index a05ab54..9abf54c 100644
--- a/examples/dm_example/phase2a/private/src/phase2a_activator.c
+++ b/examples/dm_example/phase2a/private/src/phase2a_activator.c
@@ -70,7 +70,7 @@ celix_status_t dm_init(void * userData, bundle_context_pt context, dm_dependency
 		serviceDependency_create(&dep);
 		serviceDependency_setService(dep, PHASE1_NAME, PHASE1_RANGE_ALL, NULL);
 
-        serviceDependency_setCallbacksSafe(dep, phase2a_cmp_t *, phase1_t *, phase2a_setPhase1, NULL, NULL, NULL, NULL);
+        serviceDependency_setCallbacksSafe(dep, phase2a_cmp_t*, const phase1_t*, phase2a_setPhase1, NULL, NULL, NULL, NULL);
 		serviceDependency_setRequired(dep, true);
 		component_addServiceDependency(cmp, dep);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2a/private/src/phase2a_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/private/src/phase2a_cmp.c b/examples/dm_example/phase2a/private/src/phase2a_cmp.c
index b18ea99..3d04196 100644
--- a/examples/dm_example/phase2a/private/src/phase2a_cmp.c
+++ b/examples/dm_example/phase2a/private/src/phase2a_cmp.c
@@ -38,7 +38,7 @@ struct phase2a_cmp_struct {
     bool running;
 	double currentValue;
     celix_thread_mutex_t mutex;
-    phase1_t *phase1Serv;
+    const phase1_t* phase1Serv;
 };
 
 static void *phase2a_thread(void *data);
@@ -85,7 +85,7 @@ void phase2a_destroy(phase2a_cmp_t *cmp) {
 	printf("destroy phase2a\n");
 }
 
-int phase2a_setPhase1(phase2a_cmp_t *cmp, phase1_t *phase1) {
+int phase2a_setPhase1(phase2a_cmp_t *cmp, const phase1_t* phase1) {
     printf("phase2a_setPhase1 called!\n\n");
     celixThreadMutex_lock(&cmp->mutex);
     cmp->phase1Serv = phase1;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2b/private/include/phase2b_cmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/private/include/phase2b_cmp.h b/examples/dm_example/phase2b/private/include/phase2b_cmp.h
index 527975b..7ae0358 100644
--- a/examples/dm_example/phase2b/private/include/phase2b_cmp.h
+++ b/examples/dm_example/phase2b/private/include/phase2b_cmp.h
@@ -38,7 +38,7 @@ int phase2b_stop(phase2b_cmp_t *cmp);
 int phase2b_deinit(phase2b_cmp_t *cmp);
 void phase2b_destroy(phase2b_cmp_t *cmp);
 
-int phase2b_setPhase1(phase2b_cmp_t *cmp, phase1_t *phase1);
+int phase2b_setPhase1(phase2b_cmp_t *cmp, const phase1_t* phase1);
 
 int phase2b_getData(phase2b_cmp_t *cmp, double *data);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2b/private/src/phase2b_activator.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/private/src/phase2b_activator.c b/examples/dm_example/phase2b/private/src/phase2b_activator.c
index ca66d44..dd35f94 100644
--- a/examples/dm_example/phase2b/private/src/phase2b_activator.c
+++ b/examples/dm_example/phase2b/private/src/phase2b_activator.c
@@ -69,7 +69,7 @@ celix_status_t dm_init(void * userData, bundle_context_pt context, dm_dependency
 		dm_service_dependency_pt dep;
 		serviceDependency_create(&dep);
 		serviceDependency_setService(dep, PHASE1_NAME, PHASE1_RANGE_EXACT, NULL);
-		serviceDependency_setCallbacksSafe(dep, phase2b_cmp_t *, phase1_t *, phase2b_setPhase1, NULL, NULL, NULL, NULL);
+		serviceDependency_setCallbacksSafe(dep, phase2b_cmp_t*, const phase1_t*, phase2b_setPhase1, NULL, NULL, NULL, NULL);
 		serviceDependency_setRequired(dep, true);
 		component_addServiceDependency(cmp, dep);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase2b/private/src/phase2b_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/private/src/phase2b_cmp.c b/examples/dm_example/phase2b/private/src/phase2b_cmp.c
index 3f8d319..4c86f42 100644
--- a/examples/dm_example/phase2b/private/src/phase2b_cmp.c
+++ b/examples/dm_example/phase2b/private/src/phase2b_cmp.c
@@ -38,7 +38,7 @@ struct phase2b_cmp_struct {
     bool running;
 	double currentValue;
     celix_thread_mutex_t mutex;
-    phase1_t *phase1Serv;
+    const phase1_t* phase1Serv;
 };
 
 static void *phase2b_thread(void *data);
@@ -85,7 +85,7 @@ void phase2b_destroy(phase2b_cmp_t *cmp) {
 	printf("destroy phase2b\n");
 }
 
-int phase2b_setPhase1(phase2b_cmp_t *cmp, phase1_t *phase1) {
+int phase2b_setPhase1(phase2b_cmp_t *cmp, const phase1_t* phase1) {
     celixThreadMutex_lock(&cmp->mutex);
     cmp->phase1Serv = phase1;
     celixThreadMutex_unlock(&cmp->mutex);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase3/private/include/phase3_cmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/private/include/phase3_cmp.h b/examples/dm_example/phase3/private/include/phase3_cmp.h
index 64c4137..9c63845 100644
--- a/examples/dm_example/phase3/private/include/phase3_cmp.h
+++ b/examples/dm_example/phase3/private/include/phase3_cmp.h
@@ -38,8 +38,8 @@ int phase3_stop(phase3_cmp_t *cmp);
 int phase3_deinit(phase3_cmp_t *cmp);
 void phase3_destroy(phase3_cmp_t *cmp);
 
-int phase3_addPhase2(phase3_cmp_t *cmp, phase2_t *phase2);
-int phase3_removePhase2(phase3_cmp_t *cmp, phase2_t *phase2);
+int phase3_addPhase2(phase3_cmp_t *cmp, const phase2_t* phase2);
+int phase3_removePhase2(phase3_cmp_t *cmp, const phase2_t* phase2);
 
 
 #endif //PHASE3_CMP_H

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase3/private/src/phase3_activator.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/private/src/phase3_activator.c b/examples/dm_example/phase3/private/src/phase3_activator.c
index 6377fcf..8cd20d0 100644
--- a/examples/dm_example/phase3/private/src/phase3_activator.c
+++ b/examples/dm_example/phase3/private/src/phase3_activator.c
@@ -59,7 +59,7 @@ celix_status_t dm_init(void * userData, bundle_context_pt context, dm_dependency
 		serviceDependency_create(&dep);
 		serviceDependency_setService(dep, PHASE2_NAME, NULL, NULL);
 		serviceDependency_setStrategy(dep, DM_SERVICE_DEPENDENCY_STRATEGY_SUSPEND);
-        serviceDependency_setCallbacksSafe(dep, phase3_cmp_t *, phase2_t *, NULL, phase3_addPhase2, NULL, phase3_removePhase2, NULL);
+        serviceDependency_setCallbacksSafe(dep, phase3_cmp_t*, const phase2_t*, NULL, phase3_addPhase2, NULL, phase3_removePhase2, NULL);
 		serviceDependency_setRequired(dep, true);
 		component_addServiceDependency(cmp, dep);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/dm_example/phase3/private/src/phase3_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/private/src/phase3_cmp.c b/examples/dm_example/phase3/private/src/phase3_cmp.c
index db01ad3..0d421c8 100644
--- a/examples/dm_example/phase3/private/src/phase3_cmp.c
+++ b/examples/dm_example/phase3/private/src/phase3_cmp.c
@@ -84,13 +84,13 @@ void phase3_destroy(phase3_cmp_t *cmp) {
 	printf("destroy phase3\n");
 }
 
-int phase3_addPhase2(phase3_cmp_t *cmp, phase2_t *phase2) {
-    arrayList_add(cmp->phase2Services, phase2);
+int phase3_addPhase2(phase3_cmp_t *cmp, const phase2_t* phase2) {
+    arrayList_add(cmp->phase2Services, (void*)phase2);
     return 0;
 }
 
-int phase3_removePhase2(phase3_cmp_t *cmp, phase2_t *phase2) {
-    arrayList_removeElement(cmp->phase2Services, phase2);
+int phase3_removePhase2(phase3_cmp_t *cmp, const phase2_t *phase2) {
+    arrayList_removeElement(cmp->phase2Services, (void*)phase2);
     return 0;
 }
 
@@ -104,7 +104,7 @@ static void *phase3_thread(void *data) {
     while (cmp->running) {
         size = arrayList_size(cmp->phase2Services);
         for (i = 0; i < size; i += 1) {
-            phase2_t *serv = arrayList_get(cmp->phase2Services, i);
+            const phase2_t* serv = arrayList_get(cmp->phase2Services, i);
             serv->getData(serv->handle, &value);
             printf("PHASE3: Data from %p is %f\n", serv, value);
         }

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c
----------------------------------------------------------------------
diff --git a/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c b/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c
index 7903ad1..5ee35a3 100644
--- a/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c
+++ b/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c
@@ -49,8 +49,8 @@ static void* listenerExample_logger(void* data);
 
 celix_status_t listenerExample_alternativeLog(struct listenerActivator *activator, char *message);
 
-celix_status_t ref_equals(void *a, void *b, bool *equals) {
-    return serviceReference_equals(a, b, equals);
+static celix_status_t ref_equals(const void *a, const void *b, bool *equals) {
+    return serviceReference_equals((void*)a, (void*)b, equals);
 }
 
 celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/whiteboard/tracker_depman/private/include/tracker.h
----------------------------------------------------------------------
diff --git a/examples/whiteboard/tracker_depman/private/include/tracker.h b/examples/whiteboard/tracker_depman/private/include/tracker.h
index 3b078ca..55438d2 100644
--- a/examples/whiteboard/tracker_depman/private/include/tracker.h
+++ b/examples/whiteboard/tracker_depman/private/include/tracker.h
@@ -44,15 +44,15 @@ struct data {
 	celix_thread_mutex_t publisher_lock;
 };
 
-celix_status_t tracker_setServ(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_addedServ(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_modifiedServ(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_removedServ(void * handle, service_reference_pt ref, void * service);
-
-celix_status_t tracker_setLog(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_addLog(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_modifiedLog(void * handle, service_reference_pt ref, void * service);
-celix_status_t tracker_removeLog(void * handle, service_reference_pt ref, void * service);
+celix_status_t tracker_setServ(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_addedServ(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_modifiedServ(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_removedServ(void * handle, service_reference_pt ref, const void * service);
+
+celix_status_t tracker_setLog(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_addLog(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_modifiedLog(void * handle, service_reference_pt ref, const void * service);
+celix_status_t tracker_removeLog(void * handle, service_reference_pt ref, const void * service);
 
 celix_status_t service_init(void * userData);
 celix_status_t service_start(void * userData);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/whiteboard/tracker_depman/private/src/dependency_activator.c
----------------------------------------------------------------------
diff --git a/examples/whiteboard/tracker_depman/private/src/dependency_activator.c b/examples/whiteboard/tracker_depman/private/src/dependency_activator.c
index 1ee279e..9ac295d 100644
--- a/examples/whiteboard/tracker_depman/private/src/dependency_activator.c
+++ b/examples/whiteboard/tracker_depman/private/src/dependency_activator.c
@@ -68,7 +68,7 @@ celix_status_t dm_init(void * userData, bundle_context_pt context, dm_dependency
     serviceDependency_setRequired(dep2, false);
     serviceDependency_setService(dep2, (char *) OSGI_LOGSERVICE_NAME, NULL,  NULL);
     serviceDependency_setCallbacksWithServiceReference(dep2, NULL  /*tracker_setLog*/, tracker_addLog, tracker_modifiedLog, tracker_removeLog, NULL);
-	serviceDependency_setAutoConfigure(dep2, &data->logger_lock, (void **) &data->logger);
+	serviceDependency_setAutoConfigure(dep2, &data->logger_lock, (const void **) &data->logger);
     component_addServiceDependency(service, dep2);
 
 	data->service = service;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/examples/whiteboard/tracker_depman/private/src/tracker.c
----------------------------------------------------------------------
diff --git a/examples/whiteboard/tracker_depman/private/src/tracker.c b/examples/whiteboard/tracker_depman/private/src/tracker.c
index 5688810..d38abb9 100644
--- a/examples/whiteboard/tracker_depman/private/src/tracker.c
+++ b/examples/whiteboard/tracker_depman/private/src/tracker.c
@@ -81,60 +81,60 @@ celix_status_t service_deinit(void * userData) {
 	return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_setServ(void * handle, service_reference_pt ref, void * service) {
+celix_status_t tracker_setServ(void * handle, service_reference_pt ref, const void * service) {
 	printf("Service Set %p\n", service);
 	return CELIX_SUCCESS;
 }
 
 
-celix_status_t tracker_addedServ(void * handle, service_reference_pt ref, void * service) {
+celix_status_t tracker_addedServ(void * handle, service_reference_pt ref, const void * service) {
 	struct data * data = (struct data *) handle;
-	arrayList_add(data->publishers, service);
+	arrayList_add(data->publishers, (void*)service);
 	printf("Service Added %p\n", service);
 	return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_modifiedServ(void * handle, service_reference_pt ref, void * service) {
+celix_status_t tracker_modifiedServ(void * handle, service_reference_pt ref, const void * service) {
     printf("Service Changed\n");
 	return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_removedServ(void * handle, service_reference_pt ref, void * service) {
+celix_status_t tracker_removedServ(void * handle, service_reference_pt ref, const void * service) {
 	struct data * data = (struct data *) handle;
-	arrayList_removeElement(data->publishers, service);
+	arrayList_removeElement(data->publishers, (void*) service);
 	printf("Service Removed\n");
 	return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_setLog(void *handle, service_reference_pt ref, void *service) {
+celix_status_t tracker_setLog(void *handle, service_reference_pt ref, const void *service) {
 	struct data * data = (struct data *) handle;
 
 	printf("SET log %p\n", service);
 	if(service) {
-		data->logger = service;
+		data->logger = (log_service_pt)service;
 		((log_service_pt) service)->log(((log_service_pt) service)->logger, OSGI_LOGSERVICE_DEBUG, "SET log");
 	}
 	fprintf(stderr, "SET end %p\n", service);
 	return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_addLog(void *handle, service_reference_pt ref, void *service) {
+celix_status_t tracker_addLog(void *handle, service_reference_pt ref, const void *service) {
     struct data * data = (struct data *) handle;
     printf("Add log %p\n", service);
-    data->logger = service;
+    data->logger = (log_service_pt)service;
     ((log_service_pt) service)->log(((log_service_pt) service)->logger, OSGI_LOGSERVICE_DEBUG, "test");
     return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_modifiedLog(void *handle, service_reference_pt ref, void *service) {
+celix_status_t tracker_modifiedLog(void *handle, service_reference_pt ref, const void *service) {
     struct data * data = (struct data *) handle;
     printf("Modify log\n");
-    data->logger = service;
+    data->logger = (void*)service;
     ((log_service_pt) service)->log(((log_service_pt) service)->logger, OSGI_LOGSERVICE_DEBUG, "test");
     return CELIX_SUCCESS;
 }
 
-celix_status_t tracker_removeLog(void *handle, service_reference_pt ref, void *service) {
+celix_status_t tracker_removeLog(void *handle, service_reference_pt ref, const void *service) {
     struct data * data = (struct data *) handle;
     data->logger = NULL;
     printf("Remove log\n");

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/include/framework_private.h
----------------------------------------------------------------------
diff --git a/framework/private/include/framework_private.h b/framework/private/include/framework_private.h
index ad9335e..9bb927d 100644
--- a/framework/private/include/framework_private.h
+++ b/framework/private/include/framework_private.h
@@ -104,13 +104,13 @@ FRAMEWORK_EXPORT celix_status_t fw_startBundle(framework_pt framework, bundle_pt
 FRAMEWORK_EXPORT celix_status_t framework_updateBundle(framework_pt framework, bundle_pt bundle, const char* inputFile);
 FRAMEWORK_EXPORT celix_status_t fw_stopBundle(framework_pt framework, bundle_pt bundle, bool record);
 
-FRAMEWORK_EXPORT celix_status_t fw_registerService(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const char* serviceName, void* svcObj, properties_pt properties);
+FRAMEWORK_EXPORT celix_status_t fw_registerService(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const char* serviceName, const void* svcObj, properties_pt properties);
 FRAMEWORK_EXPORT celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const char* serviceName, service_factory_pt factory, properties_pt properties);
 FRAMEWORK_EXPORT void fw_unregisterService(service_registration_pt registration);
 
 FRAMEWORK_EXPORT celix_status_t fw_getServiceReferences(framework_pt framework, array_list_pt *references, bundle_pt bundle, const char* serviceName, const char* filter);
 FRAMEWORK_EXPORT celix_status_t framework_ungetServiceReference(framework_pt framework, bundle_pt bundle, service_reference_pt reference);
-FRAMEWORK_EXPORT celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, void** service);
+FRAMEWORK_EXPORT celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, const void** service);
 FRAMEWORK_EXPORT celix_status_t framework_ungetService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, bool *result);
 FRAMEWORK_EXPORT celix_status_t fw_getBundleRegisteredServices(framework_pt framework, bundle_pt bundle, array_list_pt *services);
 FRAMEWORK_EXPORT celix_status_t fw_getBundleServicesInUse(framework_pt framework, bundle_pt bundle, array_list_pt *services);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/include/service_reference_private.h
----------------------------------------------------------------------
diff --git a/framework/private/include/service_reference_private.h b/framework/private/include/service_reference_private.h
index ab3b219..d7fcac1 100644
--- a/framework/private/include/service_reference_private.h
+++ b/framework/private/include/service_reference_private.h
@@ -37,7 +37,7 @@ struct serviceReference {
 	bundle_pt referenceOwner;
 	struct serviceRegistration * registration;
     bundle_pt registrationBundle;
-    void *service;
+    const void* service;
 
 	size_t refCount;
     size_t usageCount;
@@ -59,7 +59,7 @@ celix_status_t serviceReference_isValid(service_reference_pt reference, bool *re
 celix_status_t serviceReference_getUsageCount(service_reference_pt reference, size_t *count);
 celix_status_t serviceReference_getReferenceCount(service_reference_pt reference, size_t *count);
 
-celix_status_t serviceReference_setService(service_reference_pt ref, void *service);
+celix_status_t serviceReference_setService(service_reference_pt ref, const void *service);
 celix_status_t serviceReference_getService(service_reference_pt reference, void **service);
 
 celix_status_t serviceReference_getOwner(service_reference_pt reference, bundle_pt *owner);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/include/service_registration_private.h
----------------------------------------------------------------------
diff --git a/framework/private/include/service_registration_private.h b/framework/private/include/service_registration_private.h
index c7e7998..d6967fb 100644
--- a/framework/private/include/service_registration_private.h
+++ b/framework/private/include/service_registration_private.h
@@ -37,13 +37,13 @@ struct serviceRegistration {
 	char * className;
 	bundle_pt bundle;
 	properties_pt properties;
-	void * svcObj;
+	const void * svcObj;
 	long serviceId;
 
 	bool isUnregistering;
 
 	bool isServiceFactory;
-	void *serviceFactory;
+	const void *serviceFactory;
 
 	struct service *services;
 	int nrOfServices;
@@ -53,8 +53,8 @@ struct serviceRegistration {
 	celix_thread_rwlock_t lock;
 };
 
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void * serviceObject, properties_pt dictionary);
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void * serviceObject, properties_pt dictionary);
+service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void * serviceObject, properties_pt dictionary);
+service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void * serviceObject, properties_pt dictionary);
 
 void serviceRegistration_retain(service_registration_pt registration);
 void serviceRegistration_release(service_registration_pt registration);
@@ -62,8 +62,8 @@ void serviceRegistration_release(service_registration_pt registration);
 bool serviceRegistration_isValid(service_registration_pt registration);
 void serviceRegistration_invalidate(service_registration_pt registration);
 
-celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, void **service);
-celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, void **service);
+celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, const void **service);
+celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, const void **service);
 
 celix_status_t serviceRegistration_getBundle(service_registration_pt registration, bundle_pt *bundle);
 celix_status_t serviceRegistration_getServiceName(service_registration_pt registration, const char **serviceName);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/bundle_context_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/bundle_context_mock.c b/framework/private/mock/bundle_context_mock.c
index 5ef849d..6ec5fae 100644
--- a/framework/private/mock/bundle_context_mock.c
+++ b/framework/private/mock/bundle_context_mock.c
@@ -71,12 +71,12 @@ celix_status_t bundleContext_installBundle2(bundle_context_pt context, const cha
 }
 
 
-celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, void * svcObj,
+celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, const void * svcObj,
         properties_pt properties, service_registration_pt *service_registration) {
 	mock_c()->actualCall("bundleContext_registerService")
 			->withPointerParameters("context", context)
 			->withStringParameters("serviceName", serviceName)
-			->withPointerParameters("svcObj", svcObj)
+			->withPointerParameters("svcObj", (void*)svcObj)
 			->withPointerParameters("properties", properties)
 			->withOutputParameter("service_registration", (void **) service_registration);
 	return mock_c()->returnValue().value.intValue;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/framework_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/framework_mock.c b/framework/private/mock/framework_mock.c
index d7a6978..2f56da9 100644
--- a/framework/private/mock/framework_mock.c
+++ b/framework/private/mock/framework_mock.c
@@ -110,12 +110,12 @@ celix_status_t fw_stopBundle(framework_pt framework, bundle_pt bundle, bool reco
 }
 
 
-celix_status_t fw_registerService(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const char* serviceName, void* svcObj, properties_pt properties) {
+celix_status_t fw_registerService(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, const char* serviceName, const void* svcObj, properties_pt properties) {
 	mock_c()->actualCall("fw_registerService")
 		->withPointerParameters("framework", framework)
 		->withPointerParameters("bundle", bundle)
 		->withStringParameters("serviceName", serviceName)
-		->withPointerParameters("service", svcObj)
+		->withPointerParameters("service", (void*) svcObj)
 		->withPointerParameters("properties", properties)
 		->withOutputParameter("registration", (void **) registration);
 		return mock_c()->returnValue().value.intValue;
@@ -155,7 +155,7 @@ celix_status_t framework_ungetServiceReference(framework_pt framework, bundle_pt
     return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, void **service) {
+celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, const void **service) {
 	mock_c()->actualCall("fw_getService")
 		->withPointerParameters("framework", framework)
 		->withPointerParameters("bundle", bundle)

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/service_reference_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_reference_mock.c b/framework/private/mock/service_reference_mock.c
index c5286b9..96ed005 100644
--- a/framework/private/mock/service_reference_mock.c
+++ b/framework/private/mock/service_reference_mock.c
@@ -77,10 +77,10 @@ celix_status_t serviceReference_getReferenceCount(service_reference_pt reference
 	return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t serviceReference_setService(service_reference_pt ref, void *service){
+celix_status_t serviceReference_setService(service_reference_pt ref, const void *service){
 	mock_c()->actualCall("serviceReference_setService")
 			->withPointerParameters("ref", ref)
-			->withPointerParameters("service", service);
+			->withPointerParameters("service", (void *)service);
 	return mock_c()->returnValue().value.intValue;
 }
 celix_status_t serviceReference_getService(service_reference_pt reference, void **service){

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/service_registration_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_registration_mock.c b/framework/private/mock/service_registration_mock.c
index e50211c..d4accbf 100644
--- a/framework/private/mock/service_registration_mock.c
+++ b/framework/private/mock/service_registration_mock.c
@@ -28,24 +28,24 @@
 #include "service_registration.h"
 #include "service_registration_private.h"
 
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void* serviceObject, properties_pt dictionary) {
+service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void* serviceObject, properties_pt dictionary) {
 	mock_c()->actualCall("serviceRegistration_create")
 		->withParameterOfType("registry_callback_t", "callback", &callback)
 		->withPointerParameters("bundle", bundle)
 		->withStringParameters("serviceName", serviceName)
 		->withIntParameters("serviceId", serviceId)
-		->withPointerParameters("serviceObject", serviceObject)
+		->withPointerParameters("serviceObject", (void*)serviceObject)
 		->withPointerParameters("dictionary", dictionary);
 	return mock_c()->returnValue().value.pointerValue;
 }
 
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void* serviceObject, properties_pt dictionary) {
+service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void* serviceObject, properties_pt dictionary) {
 	mock_c()->actualCall("serviceRegistration_createServiceFactory")
 		->withParameterOfType("registry_callback_t", "callback", &callback)
 		->withPointerParameters("bundle", bundle)
 		->withStringParameters("serviceName", serviceName)
 		->withIntParameters("serviceId", serviceId)
-		->withPointerParameters("serviceObject", serviceObject)
+		->withPointerParameters("serviceObject", (void*) serviceObject)
 		->withPointerParameters("dictionary", dictionary);
 	return mock_c()->returnValue().value.pointerValue;
 }
@@ -75,7 +75,7 @@ celix_status_t serviceRegistration_unregister(service_registration_pt registrati
 }
 
 
-celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, void **service) {
+celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, const void **service) {
 	mock_c()->actualCall("serviceRegistration_getService")
 		->withPointerParameters("registration", registration)
 		->withPointerParameters("bundle", bundle)
@@ -83,7 +83,7 @@ celix_status_t serviceRegistration_getService(service_registration_pt registrati
 	return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, void **service) {
+celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, const void **service) {
 	mock_c()->actualCall("serviceRegistration_ungetService")
 			->withPointerParameters("registration", registration)
 			->withPointerParameters("bundle", bundle)

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/service_registry_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/service_registry_mock.c b/framework/private/mock/service_registry_mock.c
index dfaf6ff..60b8032 100644
--- a/framework/private/mock/service_registry_mock.c
+++ b/framework/private/mock/service_registry_mock.c
@@ -56,12 +56,12 @@ celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bu
 	return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, void * serviceObject, properties_pt dictionary, service_registration_pt *registration) {
+celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void * serviceObject, properties_pt dictionary, service_registration_pt *registration) {
 	mock_c()->actualCall("serviceRegistry_registerService")
 			->withPointerParameters("registry", registry)
 			->withPointerParameters("bundle", bundle)
 			->withStringParameters("serviceName", serviceName)
-			->withPointerParameters("serviceObject", serviceObject)
+			->withPointerParameters("serviceObject", (void*)serviceObject)
 			->withPointerParameters("dictionary", dictionary)
 			->withOutputParameter("registration", registration);
 	return mock_c()->returnValue().value.intValue;
@@ -109,7 +109,7 @@ celix_status_t serviceRegistry_ungetServiceReference(service_registry_pt registr
 	return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, void **service) {
+celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, const void **service) {
 	mock_c()->actualCall("serviceRegistry_getService")
 		->withPointerParameters("registry", registry)
 		->withPointerParameters("bundle", bundle)

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/mock/version_range_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/version_range_mock.c b/framework/private/mock/version_range_mock.c
index 14788d4..36826a7 100644
--- a/framework/private/mock/version_range_mock.c
+++ b/framework/private/mock/version_range_mock.c
@@ -57,7 +57,7 @@ celix_status_t versionRange_isInRange(version_range_pt versionRange, version_pt
 	return mock_c()->returnValue().value.intValue;
 }
 
-celix_status_t versionRange_parse(char * rangeStr, version_range_pt *range) {
+celix_status_t versionRange_parse(const char * rangeStr, version_range_pt *range) {
 	mock_c()->actualCall("versionRange_parse")
         ->withStringParameters("rangeStr", rangeStr)
         ->withOutputParameter("range", (void **) range);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/src/bundle_context.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_context.c b/framework/private/src/bundle_context.c
index 86cad33..0fda1c9 100644
--- a/framework/private/src/bundle_context.c
+++ b/framework/private/src/bundle_context.c
@@ -121,7 +121,7 @@ celix_status_t bundleContext_installBundle2(bundle_context_pt context, const cha
 	return status;
 }
 
-celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, void * svcObj,
+celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, const void * svcObj,
         properties_pt properties, service_registration_pt *service_registration) {
 	service_registration_pt registration = NULL;
 	celix_status_t status = CELIX_SUCCESS;
@@ -219,11 +219,14 @@ celix_status_t bundleContext_ungetServiceReference(bundle_context_pt context, se
     return status;
 }
 
-celix_status_t bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void **service_instance) {
+celix_status_t bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void** service_instance) {
     celix_status_t status = CELIX_SUCCESS;
 
     if (context != NULL && reference != NULL && *service_instance == NULL) {
-	    status = fw_getService(context->framework, context->bundle, reference, service_instance);
+        /*NOTE argument service_instance should be considerd a 'const void**'. 
+        To ensure backwards compatiblity a cast is made instead.
+        */
+	    status = fw_getService(context->framework, context->bundle, reference, (const void**) service_instance);
     } else {
         status = CELIX_ILLEGAL_ARGUMENT;
     }

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 26177eb..09b36a3 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -1229,7 +1229,7 @@ celix_status_t fw_populateDependentGraph(framework_pt framework, bundle_pt expor
     return status;
 }
 
-celix_status_t fw_registerService(framework_pt framework, service_registration_pt *registration, bundle_pt bundle, const char* serviceName, void* svcObj, properties_pt properties) {
+celix_status_t fw_registerService(framework_pt framework, service_registration_pt *registration, bundle_pt bundle, const char* serviceName, const void* svcObj, properties_pt properties) {
 	celix_status_t status = CELIX_SUCCESS;
 	char *error = NULL;
 	if (serviceName == NULL || svcObj == NULL) {
@@ -1290,7 +1290,7 @@ celix_status_t fw_registerService(framework_pt framework, service_registration_p
 
                 status = CELIX_DO_IF(status, serviceRegistry_getServiceReference(framework->registry, framework->bundle,
                                                                                  *registration, &ref));
-                status = CELIX_DO_IF(status, fw_getService(framework,framework->bundle, ref, (void **) &hook));
+                status = CELIX_DO_IF(status, fw_getService(framework,framework->bundle, ref, (const void **) &hook));
                 if (status == CELIX_SUCCESS) {
                     hook->added(hook->handle, infos);
                 }
@@ -1375,7 +1375,7 @@ celix_status_t framework_ungetServiceReference(framework_pt framework, bundle_pt
     return serviceRegistry_ungetServiceReference(framework->registry, bundle, reference);
 }
 
-celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, void **service) {
+celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, const void **service) {
 	return serviceRegistry_getService(framework->registry, bundle, reference, service);
 }
 
@@ -1429,7 +1429,7 @@ void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_lis
 		array_list_pt infos = NULL;
 		bool ungetResult = false;
 
-		fw_getService(framework, framework->bundle, ref, (void **) &hook);
+		fw_getService(framework, framework->bundle, ref, (const void **) &hook);
 
 		arrayList_create(&infos);
 		arrayList_add(infos, info);
@@ -1504,7 +1504,7 @@ void fw_removeServiceListener(framework_pt framework, bundle_pt bundle, service_
 			array_list_pt infos = NULL;
 			bool ungetResult;
 
-			fw_getService(framework, framework->bundle, ref, (void **) &hook);
+			fw_getService(framework, framework->bundle, ref, (const void **) &hook);
 
 			arrayList_create(&infos);
 			arrayList_add(infos, info);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/src/service_reference.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_reference.c b/framework/private/src/service_reference.c
index e51fa7b..b89aaf2 100644
--- a/framework/private/src/service_reference.c
+++ b/framework/private/src/service_reference.c
@@ -151,12 +151,15 @@ celix_status_t serviceReference_getReferenceCount(service_reference_pt ref, size
 celix_status_t serviceReference_getService(service_reference_pt ref, void **service) {
     celix_status_t status = CELIX_SUCCESS;
     celixThreadRwlock_readLock(&ref->lock);
-    *service = ref->service;
+    /*NOTE the service argument should be 'const void**'
+      To ensure backwards compatability a cast is made instead.
+    */
+    *service = (const void**) ref->service;
     celixThreadRwlock_unlock(&ref->lock);
     return status;
 }
 
-celix_status_t serviceReference_setService(service_reference_pt ref, void *service) {
+celix_status_t serviceReference_setService(service_reference_pt ref, const void *service) {
     celix_status_t status = CELIX_SUCCESS;
     celixThreadRwlock_writeLock(&ref->lock);
     ref->service = service;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/src/service_registration.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registration.c b/framework/private/src/service_registration.c
index 22e4b9a..f805860 100644
--- a/framework/private/src/service_registration.c
+++ b/framework/private/src/service_registration.c
@@ -33,23 +33,23 @@
 
 static celix_status_t serviceRegistration_initializeProperties(service_registration_pt registration, properties_pt properties);
 static celix_status_t serviceRegistration_createInternal(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId,
-        void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration);
+        const void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration);
 static celix_status_t serviceRegistration_destroy(service_registration_pt registration);
 
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void * serviceObject, properties_pt dictionary) {
+service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void * serviceObject, properties_pt dictionary) {
     service_registration_pt registration = NULL;
 	serviceRegistration_createInternal(callback, bundle, serviceName, serviceId, serviceObject, dictionary, false, &registration);
 	return registration;
 }
 
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, void * serviceObject, properties_pt dictionary) {
+service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId, const void * serviceObject, properties_pt dictionary) {
     service_registration_pt registration = NULL;
     serviceRegistration_createInternal(callback, bundle, serviceName, serviceId, serviceObject, dictionary, true, &registration);
     return registration;
 }
 
 static celix_status_t serviceRegistration_createInternal(registry_callback_t callback, bundle_pt bundle, const char* serviceName, long serviceId,
-        void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *out) {
+        const void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *out) {
     celix_status_t status = CELIX_SUCCESS;
 
 	service_registration_pt  reg = calloc(1, sizeof(*reg));
@@ -63,7 +63,7 @@ static celix_status_t serviceRegistration_createInternal(registry_callback_t cal
 		reg->refCount = 1;
 
 		reg->serviceId = serviceId;
-		reg->svcObj = serviceObject;
+	reg->svcObj = serviceObject;
 		if (isFactory) {
 			reg->serviceFactory = (service_factory_pt) reg->svcObj;
 		} else {
@@ -189,12 +189,15 @@ celix_status_t serviceRegistration_unregister(service_registration_pt registrati
 	return status;
 }
 
-celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, void **service) {
+celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, const void** service) {
 	int status = CELIX_SUCCESS;
     celixThreadRwlock_readLock(&registration->lock);
     if (registration->isServiceFactory) {
-        service_factory_pt factory = registration->serviceFactory;
-        status = factory->getService(factory->handle, bundle, registration, service);
+        service_factory_pt factory = (void*) registration->serviceFactory;
+        /*NOTE the service argument of the service_factory should be const void**.
+          To ensure backwards compatability a cast is made instead.
+        */
+        status = factory->getService(factory->handle, bundle, registration, (void**) service);
     } else {
         (*service) = registration->svcObj;
     }
@@ -202,11 +205,14 @@ celix_status_t serviceRegistration_getService(service_registration_pt registrati
     return status;
 }
 
-celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, void **service) {
+celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, const void** service) {
     celixThreadRwlock_readLock(&registration->lock);
     if (registration->isServiceFactory) {
-        service_factory_pt factory = registration->serviceFactory;
-        factory->ungetService(factory->handle, bundle, registration, service);
+        service_factory_pt factory = (void*) registration->serviceFactory;
+        /*NOTE the service argument of the service_factory should be const void**.
+          To ensure backwards compatability a cast is made instead.
+        */
+        factory->ungetService(factory->handle, bundle, registration, (void**) service);
     }
     celixThreadRwlock_unlock(&registration->lock);
     return CELIX_SUCCESS;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/src/service_registry.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registry.c b/framework/private/src/service_registry.c
index c3a73ab..c343c7c 100644
--- a/framework/private/src/service_registry.c
+++ b/framework/private/src/service_registry.c
@@ -41,8 +41,8 @@
 #define CHECK_DELETED_REFERENCES true
 #endif
 
-static celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, const char* serviceName, void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration);
-static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, const char* serviceName, void *serviceObject, service_registration_pt registration);
+static celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration);
+static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, const char* serviceName, const void *serviceObject, service_registration_pt registration);
 static celix_status_t serviceRegistry_removeHook(service_registry_pt registry, service_registration_pt registration);
 static void serviceRegistry_logWarningServiceReferenceUsageCount(service_registry_pt registry, size_t usageCount, size_t refCount);
 static void serviceRegistry_logWarningServiceRegistration(service_registry_pt registry, service_registration_pt reg);
@@ -146,15 +146,15 @@ celix_status_t serviceRegistry_getRegisteredServices(service_registry_pt registr
 	return status;
 }
 
-celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, void* serviceObject, properties_pt dictionary, service_registration_pt *registration) {
+celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void* serviceObject, properties_pt dictionary, service_registration_pt *registration) {
     return serviceRegistry_registerServiceInternal(registry, bundle, serviceName, serviceObject, dictionary, false, registration);
 }
 
 celix_status_t serviceRegistry_registerServiceFactory(service_registry_pt registry, bundle_pt bundle, const char* serviceName, service_factory_pt factory, properties_pt dictionary, service_registration_pt *registration) {
-    return serviceRegistry_registerServiceInternal(registry, bundle, serviceName, (void *) factory, dictionary, true, registration);
+    return serviceRegistry_registerServiceInternal(registry, bundle, serviceName, (const void *) factory, dictionary, true, registration);
 }
 
-static celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, const char* serviceName, void* serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration) {
+static celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void* serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration) {
 	array_list_pt regs;
 
 	if (isFactory) {
@@ -601,11 +601,11 @@ celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bu
 	return CELIX_SUCCESS;
 }
 
-celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, void **out) {
+celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, const void **out) {
 	celix_status_t status = CELIX_SUCCESS;
 	service_registration_pt registration = NULL;
     size_t count = 0;
-    void *service = NULL;
+    const void *service = NULL;
     reference_status_t refStatus;
 
 
@@ -622,7 +622,10 @@ celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_p
                 serviceReference_setService(reference, service);
             }
 
-            serviceReference_getService(reference, out);
+            /* NOTE the out argument of sr_getService should be 'const void**'
+               To ensure backwards compatability a cast is made instead.
+            */
+            serviceReference_getService(reference, (void **)out);
         } else {
             *out = NULL; //invalid service registration
         }
@@ -638,7 +641,7 @@ celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_p
 celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, bool *result) {
 	celix_status_t status = CELIX_SUCCESS;
     service_registration_pt reg = NULL;
-    void *service = NULL;
+    const void *service = NULL;
     size_t count = 0;
     celix_status_t subStatus = CELIX_SUCCESS;
     reference_status_t refStatus;
@@ -650,7 +653,10 @@ celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle
     if (refStatus == REF_ACTIVE) {
         subStatus = serviceReference_decreaseUsage(reference, &count);
         if (count == 0) {
-            serviceReference_getService(reference, &service);
+            /*NOTE the argument service of sr_getService should be 'const void**'
+              TO ensure backwards compatability a cast is made instead.
+              */
+            serviceReference_getService(reference, (void**)&service);
             serviceReference_getServiceRegistration(reference, &reg);
             if (reg != NULL) {
                 serviceRegistration_ungetService(reg, bundle, &service);
@@ -669,7 +675,7 @@ celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle
 	return status;
 }
 
-static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, const char* serviceName, void* serviceObject __attribute__((unused)), service_registration_pt registration) {
+static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, const char* serviceName, const void* serviceObject __attribute__((unused)), service_registration_pt registration) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (strcmp(OSGI_FRAMEWORK_LISTENER_HOOK_SERVICE_NAME, serviceName) == 0) {

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/test/service_registration_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_registration_test.cpp b/framework/private/test/service_registration_test.cpp
index 219f1cf..9e670de 100644
--- a/framework/private/test/service_registration_test.cpp
+++ b/framework/private/test/service_registration_test.cpp
@@ -264,7 +264,7 @@ TEST(service_registration, getService) {
 	void *service = (void *) 0x20;
 	service_registration_pt registration = serviceRegistration_create(callback, bundle, name, 0, service, NULL);
 
-	void *actual = NULL;
+	const void *actual = NULL;
 	celix_status_t status = serviceRegistration_getService(registration, bundle, &actual);
 	LONGS_EQUAL(CELIX_SUCCESS, status);
 	POINTERS_EQUAL(service, actual);
@@ -289,7 +289,7 @@ TEST(service_registration, getServiceFromFactory) {
 			.withParameter("registration", registration)
 			.withOutputParameterReturning("service", &service, sizeof(service));
 
-	void *actual = NULL;
+	const void *actual = NULL;
 	celix_status_t status = serviceRegistration_getService(registration, bundle, &actual);
 	LONGS_EQUAL(CELIX_SUCCESS, status);
 	POINTERS_EQUAL(service, actual);
@@ -316,7 +316,7 @@ TEST(service_registration, ungetServiceFromFactory) {
 			.withParameter("registration", registration)
 			.withOutputParameterReturning("service", &service, sizeof(service));
 
-	void *actual = NULL;
+	const void *actual = NULL;
 	celix_status_t status = serviceRegistration_ungetService(registration, bundle, &actual);
 	LONGS_EQUAL(CELIX_SUCCESS, status);
 	POINTERS_EQUAL(service, actual);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/private/test/service_registry_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/service_registry_test.cpp b/framework/private/test/service_registry_test.cpp
index 7db6476..5a0e9f0 100644
--- a/framework/private/test/service_registry_test.cpp
+++ b/framework/private/test/service_registry_test.cpp
@@ -795,7 +795,7 @@ TEST(service_registry, getService) {
 	mock().expectOneCall("framework_log");
 
 
-	void *actual = (void*) 0x666;//generic non null pointer value
+	const void *actual = (void*) 0x666;//generic non null pointer value
 	celix_status_t status = serviceRegistry_getService(registry, bundle, reference, &actual);
 	LONGS_EQUAL(CELIX_BUNDLE_EXCEPTION, status);
 	//test reference with invalid registration

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/public/include/bundle_context.h
----------------------------------------------------------------------
diff --git a/framework/public/include/bundle_context.h b/framework/public/include/bundle_context.h
index 42a8a5c..51ea421 100644
--- a/framework/public/include/bundle_context.h
+++ b/framework/public/include/bundle_context.h
@@ -50,7 +50,7 @@ FRAMEWORK_EXPORT celix_status_t bundleContext_getFramework(bundle_context_pt con
 FRAMEWORK_EXPORT celix_status_t bundleContext_installBundle(bundle_context_pt context, const char* location, bundle_pt *bundle);
 FRAMEWORK_EXPORT celix_status_t bundleContext_installBundle2(bundle_context_pt context, const char* location, const char* inputFile, bundle_pt *bundle);
 
-FRAMEWORK_EXPORT celix_status_t bundleContext_registerService(bundle_context_pt context, const char* serviceName, void * svcObj,
+FRAMEWORK_EXPORT celix_status_t bundleContext_registerService(bundle_context_pt context, const char* serviceName, const void * svcObj,
         properties_pt properties, service_registration_pt *service_registration);
 FRAMEWORK_EXPORT celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, const char* serviceName, service_factory_pt factory,
         properties_pt properties, service_registration_pt *service_registration);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/framework/public/include/service_registry.h
----------------------------------------------------------------------
diff --git a/framework/public/include/service_registry.h b/framework/public/include/service_registry.h
index 365d913..940339f 100644
--- a/framework/public/include/service_registry.h
+++ b/framework/public/include/service_registry.h
@@ -44,7 +44,7 @@ celix_status_t serviceRegistry_destroy(service_registry_pt registry);
 celix_status_t serviceRegistry_getRegisteredServices(service_registry_pt registry, bundle_pt bundle, array_list_pt *services);
 celix_status_t serviceRegistry_getServicesInUse(service_registry_pt registry, bundle_pt bundle, array_list_pt *services);
 
-celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, void * serviceObject, properties_pt dictionary, service_registration_pt *registration);
+celix_status_t serviceRegistry_registerService(service_registry_pt registry, bundle_pt bundle, const char* serviceName, const void * serviceObject, properties_pt dictionary, service_registration_pt *registration);
 celix_status_t serviceRegistry_registerServiceFactory(service_registry_pt registry, bundle_pt bundle, const char* serviceName, service_factory_pt factory, properties_pt dictionary, service_registration_pt *registration);
 
 celix_status_t serviceRegistry_unregisterService(service_registry_pt registry, bundle_pt bundle, service_registration_pt registration);
@@ -55,7 +55,7 @@ celix_status_t serviceRegistry_getServiceReferences(service_registry_pt registry
 celix_status_t serviceRegistry_retainServiceReference(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference);
 celix_status_t serviceRegistry_ungetServiceReference(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference);
 
-celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, void **service);
+celix_status_t serviceRegistry_getService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, const void **service);
 celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle_pt bundle, service_reference_pt reference, bool *result);
 
 celix_status_t serviceRegistry_clearReferencesFor(service_registry_pt registry, bundle_pt bundle);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/remote_services/discovery/private/src/endpoint_discovery_poller.c
----------------------------------------------------------------------
diff --git a/remote_services/discovery/private/src/endpoint_discovery_poller.c b/remote_services/discovery/private/src/endpoint_discovery_poller.c
index 7005ed7..0abbded 100644
--- a/remote_services/discovery/private/src/endpoint_discovery_poller.c
+++ b/remote_services/discovery/private/src/endpoint_discovery_poller.c
@@ -47,7 +47,7 @@
 static void *endpointDiscoveryPoller_performPeriodicPoll(void *data);
 celix_status_t endpointDiscoveryPoller_poll(endpoint_discovery_poller_pt poller, char *url, array_list_pt currentEndpoints);
 static celix_status_t endpointDiscoveryPoller_getEndpoints(endpoint_discovery_poller_pt poller, char *url, array_list_pt *updatedEndpoints);
-static celix_status_t endpointDiscoveryPoller_endpointDescriptionEquals(void *endpointPtr, void *comparePtr, bool *equals);
+static celix_status_t endpointDiscoveryPoller_endpointDescriptionEquals(const void *endpointPtr, const void *comparePtr, bool *equals);
 
 /**
  * Allocates memory and initializes a new endpoint_discovery_poller instance.
@@ -391,7 +391,7 @@ static celix_status_t endpointDiscoveryPoller_getEndpoints(endpoint_discovery_po
 	return status;
 }
 
-static celix_status_t endpointDiscoveryPoller_endpointDescriptionEquals(void *endpointPtr, void *comparePtr, bool *equals) {
+static celix_status_t endpointDiscoveryPoller_endpointDescriptionEquals(const void *endpointPtr, const void *comparePtr, bool *equals) {
 	endpoint_description_pt endpoint = (endpoint_description_pt) endpointPtr;
 	endpoint_description_pt compare = (endpoint_description_pt) comparePtr;
 

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/remote_services/topology_manager/private/src/scope.c
----------------------------------------------------------------------
diff --git a/remote_services/topology_manager/private/src/scope.c b/remote_services/topology_manager/private/src/scope.c
index b600040..b81d050 100644
--- a/remote_services/topology_manager/private/src/scope.c
+++ b/remote_services/topology_manager/private/src/scope.c
@@ -47,7 +47,7 @@ struct scope {
     celix_status_t (*importScopeChangedHandler)(void* manager, char *filter);
 };
 
-static celix_status_t import_equal(void *, void *, bool *equals);
+static celix_status_t import_equal(const void *, const void *, bool *equals);
 
 /*
  * SERVICES
@@ -243,7 +243,7 @@ celix_status_t scope_scopeDestroy(scope_pt scope) {
 /*****************************************************************************
  * STATIC FUNCTIONS
  *****************************************************************************/
-static celix_status_t import_equal(void *src, void *dest, bool *equals) {
+static celix_status_t import_equal(const void *src, const void *dest, bool *equals) {
     celix_status_t status;
 
     filter_pt src_filter = (filter_pt) src;

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/utils/private/src/array_list.c
----------------------------------------------------------------------
diff --git a/utils/private/src/array_list.c b/utils/private/src/array_list.c
index c59f014..e7a2e30 100644
--- a/utils/private/src/array_list.c
+++ b/utils/private/src/array_list.c
@@ -30,7 +30,7 @@
 #include "array_list.h"
 #include "array_list_private.h"
 
-static celix_status_t arrayList_elementEquals(void *a, void *b, bool *equals);
+static celix_status_t arrayList_elementEquals(const void *a, const void *b, bool *equals);
 
 celix_status_t arrayList_create(array_list_pt *list) {
 	return arrayList_createWithEquals(arrayList_elementEquals, list);
@@ -55,7 +55,7 @@ void arrayList_destroy(array_list_pt list) {
 	free(list);
 }
 
-static celix_status_t arrayList_elementEquals(void *a, void *b, bool *equals) {
+static celix_status_t arrayList_elementEquals(const void *a, const void *b, bool *equals) {
 	*equals = (a == b);
 	return CELIX_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/utils/private/src/version_range.c
----------------------------------------------------------------------
diff --git a/utils/private/src/version_range.c b/utils/private/src/version_range.c
index d73a522..ed681fd 100644
--- a/utils/private/src/version_range.c
+++ b/utils/private/src/version_range.c
@@ -177,7 +177,7 @@ celix_status_t versionRange_isHighInclusive(version_range_pt versionRange, bool
 }
 
 
-celix_status_t versionRange_parse(char * rangeStr, version_range_pt *range) {
+celix_status_t versionRange_parse(const char * rangeStr, version_range_pt *range) {
 	celix_status_t status;
 	if (strchr(rangeStr, ',') != NULL) {
 			int vlowL = strcspn(rangeStr+1, ",");

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/utils/public/include/array_list.h
----------------------------------------------------------------------
diff --git a/utils/public/include/array_list.h b/utils/public/include/array_list.h
index c1fc30d..e824b9b 100644
--- a/utils/public/include/array_list.h
+++ b/utils/public/include/array_list.h
@@ -35,7 +35,7 @@ typedef struct arrayList * array_list_pt;
 
 typedef struct arrayListIterator * array_list_iterator_pt;
 
-typedef celix_status_t (*array_list_element_equals_pt)(void *, void *, bool *equals);
+typedef celix_status_t (*array_list_element_equals_pt)(const void*, const void*, bool *equals);
 
 UTILS_EXPORT celix_status_t arrayList_create(array_list_pt *list);
 UTILS_EXPORT celix_status_t arrayList_createWithEquals(array_list_element_equals_pt equals, array_list_pt *list);

http://git-wip-us.apache.org/repos/asf/celix/blob/516baaa3/utils/public/include/version_range.h
----------------------------------------------------------------------
diff --git a/utils/public/include/version_range.h b/utils/public/include/version_range.h
index bf468a8..e0e80b0 100644
--- a/utils/public/include/version_range.h
+++ b/utils/public/include/version_range.h
@@ -146,7 +146,7 @@ celix_status_t versionRange_getHighVersion(version_range_pt versionRange, versio
  * 		- CELIX_ILLEGAL_ARGUMENT If the numerical components are negative,
  * 		  	the qualifier string is invalid or <code>versionStr</code> is impropertly formatted.
  */
-celix_status_t versionRange_parse(char * rangeStr, version_range_pt *range);
+celix_status_t versionRange_parse(const char* rangeStr, version_range_pt *range);
 
 /**
  * @}


Mime
View raw message