You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2016/07/05 14:43:31 UTC
[1/2] celix git commit: CELIX-249: Refactors some usage of char* to
const char*
Repository: celix
Updated Branches:
refs/heads/develop 8c4e037db -> c34eaa689
CELIX-249: Refactors some usage of char* to const char*
- Refactors bundle_context, fw, service_registry, service_registration and most importantly properties
- In most cases the input is changed to const char*. Note that provided char* to these functions is valid.
- The get functions of properties now also return const char* instead of char*. Alot small changes was needed for this
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6f447d85
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6f447d85
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6f447d85
Branch: refs/heads/develop
Commit: 6f447d855724755dbcc5356aae13a98939ba7027
Parents: 8c4e037
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jul 5 16:37:07 2016 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jul 5 16:37:07 2016 +0200
----------------------------------------------------------------------
.../private/src/deployment_package.c | 12 +++----
.../driver_locator/private/src/driver_locator.c | 2 +-
.../private/src/benchmark_runner_activator.c | 4 +--
framework/private/include/framework_private.h | 12 +++----
.../include/service_registration_private.h | 4 +--
framework/private/mock/bundle_context_mock.c | 8 ++---
framework/private/mock/filter_mock.c | 2 +-
framework/private/mock/framework_mock.c | 6 ++--
framework/private/mock/properties_mock.c | 10 +++---
framework/private/mock/service_reference_mock.c | 2 +-
.../private/mock/service_registration_mock.c | 4 +--
framework/private/mock/service_registry_mock.c | 4 +--
framework/private/src/bundle_cache.c | 2 +-
framework/private/src/bundle_context.c | 8 ++---
framework/private/src/celix_launcher.c | 9 +++--
framework/private/src/filter.c | 35 ++++++++++----------
framework/private/src/framework.c | 14 ++++----
framework/private/src/manifest.c | 4 +--
framework/private/src/properties.c | 16 ++++-----
framework/private/src/service_reference.c | 4 +--
framework/private/src/service_registration.c | 10 +++---
framework/private/src/service_registry.c | 14 ++++----
framework/private/test/properties_test.cpp | 10 +++---
.../private/test/service_registration_test.cpp | 6 ++--
framework/public/include/bundle_context.h | 18 +++++-----
framework/public/include/filter.h | 2 +-
framework/public/include/properties.h | 10 +++---
framework/public/include/service_reference.h | 2 +-
framework/public/include/service_registry.h | 4 +--
.../private/src/endpoint_description.c | 8 ++---
.../rsa/private/src/export_registration_dfi.c | 2 +-
.../rsa/private/src/remote_service_admin_dfi.c | 8 ++---
.../private/src/remote_service_admin_impl.c | 12 +++----
.../private/src/remote_service_admin_impl.c | 14 ++++----
34 files changed, 144 insertions(+), 138 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/deployment_admin/private/src/deployment_package.c
----------------------------------------------------------------------
diff --git a/deployment_admin/private/src/deployment_package.c b/deployment_admin/private/src/deployment_package.c
index 4195649..615d6da 100644
--- a/deployment_admin/private/src/deployment_package.c
+++ b/deployment_admin/private/src/deployment_package.c
@@ -177,19 +177,19 @@ celix_status_t deploymentPackage_processEntries(deployment_package_pt package) {
bundle_info_pt info = calloc(1, sizeof(*info));
info->path = name;
info->attributes = values;
- info->symbolicName = properties_get(values, (char *) OSGI_FRAMEWORK_BUNDLE_SYMBOLICNAME);
- char *version = properties_get(values, (char *) OSGI_FRAMEWORK_BUNDLE_VERSION);
+ info->symbolicName = (char*)properties_get(values, OSGI_FRAMEWORK_BUNDLE_SYMBOLICNAME);
+ const char *version = properties_get(values, OSGI_FRAMEWORK_BUNDLE_VERSION);
info->version = NULL;
- status = version_createVersionFromString(version, &info->version);
- char *customizer = properties_get(values, (char *) DEPLOYMENTPACKAGE_CUSTOMIZER);
- deploymentPackage_parseBooleanHeader(customizer, &info->customizer);
+ status = version_createVersionFromString((char*)version, &info->version);
+ const char *customizer = properties_get(values, DEPLOYMENTPACKAGE_CUSTOMIZER);
+ deploymentPackage_parseBooleanHeader((char*)customizer, &info->customizer);
arrayList_add(package->bundleInfos, info);
} else {
resource_info_pt info = calloc(1, sizeof(*info));
info->path = name;
info->attributes = values;
- info->resourceProcessor = properties_get(values, (char *) RESOURCE_PROCESSOR);
+ info->resourceProcessor = (char*)properties_get(values,RESOURCE_PROCESSOR);
arrayList_add(package->resourceInfos, info);
}
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/device_access/driver_locator/private/src/driver_locator.c
----------------------------------------------------------------------
diff --git a/device_access/driver_locator/private/src/driver_locator.c b/device_access/driver_locator/private/src/driver_locator.c
index 8ccd6de..9c360bf 100644
--- a/device_access/driver_locator/private/src/driver_locator.c
+++ b/device_access/driver_locator/private/src/driver_locator.c
@@ -34,7 +34,7 @@
celix_status_t driverLocator_findDrivers(driver_locator_pt locator, properties_pt props, array_list_pt *drivers) {
celix_status_t status = CELIX_SUCCESS;
- char *category = properties_get(props, OSGI_DEVICEACCESS_DEVICE_CATEGORY);
+ const char* category = properties_get(props, OSGI_DEVICEACCESS_DEVICE_CATEGORY);
status = arrayList_create(drivers);
if (status == CELIX_SUCCESS) {
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/examples/locking/benchmark/private/src/benchmark_runner_activator.c
----------------------------------------------------------------------
diff --git a/examples/locking/benchmark/private/src/benchmark_runner_activator.c b/examples/locking/benchmark/private/src/benchmark_runner_activator.c
index c91d68f..09a5be3 100644
--- a/examples/locking/benchmark/private/src/benchmark_runner_activator.c
+++ b/examples/locking/benchmark/private/src/benchmark_runner_activator.c
@@ -139,7 +139,7 @@ static celix_status_t benchmarkRunner_addedService(void * handle, service_refere
service_registration_pt registration = NULL;
properties_pt properties = NULL;
- char *serviceName = NULL;
+ const char* serviceName = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
serviceRegistration_getProperties(registration, &properties);
serviceName = properties_get(properties, "objectClass");
@@ -167,7 +167,7 @@ static celix_status_t benchmarkRunner_removedService(void * handle, service_refe
service_registration_pt registration = NULL;
properties_pt properties = NULL;
- char *serviceName = NULL;
+ const char* serviceName = NULL;
serviceReference_getServiceRegistration(reference, ®istration);
serviceRegistration_getProperties(registration, &properties);
serviceName = properties_get(properties, "objectClass");
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/include/framework_private.h
----------------------------------------------------------------------
diff --git a/framework/private/include/framework_private.h b/framework/private/include/framework_private.h
index b3430f8..28c504d 100644
--- a/framework/private/include/framework_private.h
+++ b/framework/private/include/framework_private.h
@@ -104,18 +104,18 @@ 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, 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, char * serviceName, void * svcObj, properties_pt properties);
-FRAMEWORK_EXPORT celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, char * serviceName, service_factory_pt factory, properties_pt properties);
+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_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, char * filter);
+FRAMEWORK_EXPORT celix_status_t fw_getServiceReferences(framework_pt framework, array_list_pt *references, bundle_pt bundle, const char* serviceName, 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, 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);
-FRAMEWORK_EXPORT void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, char * filter);
+FRAMEWORK_EXPORT void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, const char* filter);
FRAMEWORK_EXPORT void fw_removeServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener);
FRAMEWORK_EXPORT celix_status_t fw_addBundleListener(framework_pt framework, bundle_pt bundle, bundle_listener_pt listener);
@@ -126,7 +126,7 @@ FRAMEWORK_EXPORT celix_status_t fw_removeFrameworkListener(framework_pt framewor
FRAMEWORK_EXPORT void fw_serviceChanged(framework_pt framework, service_event_type_e eventType, service_registration_pt registration, properties_pt oldprops);
-FRAMEWORK_EXPORT celix_status_t fw_isServiceAssignable(framework_pt fw, bundle_pt requester, service_reference_pt reference, bool *assignable);
+FRAMEWORK_EXPORT celix_status_t fw_isServiceAssignable(framework_pt fw, bundle_pt requester, service_reference_pt reference, bool* assignable);
//bundle_archive_t fw_createArchive(long id, char * location);
//void revise(bundle_archive_t archive, char * location);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 4b48e70..442da93 100644
--- a/framework/private/include/service_registration_private.h
+++ b/framework/private/include/service_registration_private.h
@@ -53,8 +53,8 @@ struct serviceRegistration {
celix_thread_rwlock_t lock;
};
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, char * serviceName, long serviceId, void * serviceObject, properties_pt dictionary);
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, 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, 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);
void serviceRegistration_retain(service_registration_pt registration);
void serviceRegistration_release(service_registration_pt registration);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 2796ae8..3ec6287 100644
--- a/framework/private/mock/bundle_context_mock.c
+++ b/framework/private/mock/bundle_context_mock.c
@@ -71,7 +71,7 @@ celix_status_t bundleContext_installBundle2(bundle_context_pt context, char * lo
}
-celix_status_t bundleContext_registerService(bundle_context_pt context, char * serviceName, void * svcObj,
+celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, void * svcObj,
properties_pt properties, service_registration_pt *service_registration) {
mock_c()->actualCall("bundleContext_registerService")
->withPointerParameters("context", context)
@@ -82,7 +82,7 @@ celix_status_t bundleContext_registerService(bundle_context_pt context, char * s
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, char * serviceName, service_factory_pt factory,
+celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, const char * serviceName, service_factory_pt factory,
properties_pt properties, service_registration_pt *service_registration) {
mock_c()->actualCall("bundleContext_registerServiceFactory")
->withPointerParameters("context", context)
@@ -103,7 +103,7 @@ celix_status_t bundleContext_getServiceReferences(bundle_context_pt context, con
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleContext_getServiceReference(bundle_context_pt context, char * serviceName, service_reference_pt *service_reference) {
+celix_status_t bundleContext_getServiceReference(bundle_context_pt context, const char * serviceName, service_reference_pt *service_reference) {
mock_c()->actualCall("bundleContext_getServiceReference")
->withPointerParameters("context", context)
->withStringParameters("serviceName", serviceName)
@@ -158,7 +158,7 @@ celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, b
}
-celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, char * filter) {
+celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, const char * filter) {
mock_c()->actualCall("bundleContext_addServiceListener")
->withPointerParameters("context", context)
->withPointerParameters("listener", listener)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/mock/filter_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/filter_mock.c b/framework/private/mock/filter_mock.c
index ba2b9c1..4836df1 100644
--- a/framework/private/mock/filter_mock.c
+++ b/framework/private/mock/filter_mock.c
@@ -27,7 +27,7 @@
#include "filter.h"
-filter_pt filter_create(char * filterString) {
+filter_pt filter_create(const char * filterString) {
mock_c()->actualCall("filter_create")
->withStringParameters("filterString", filterString);
return mock_c()->returnValue().value.pointerValue;
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/mock/framework_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/framework_mock.c b/framework/private/mock/framework_mock.c
index cf941d4..acd90ad 100644
--- a/framework/private/mock/framework_mock.c
+++ b/framework/private/mock/framework_mock.c
@@ -110,7 +110,7 @@ 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, 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, void* svcObj, properties_pt properties) {
mock_c()->actualCall("fw_registerService")
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
@@ -121,7 +121,7 @@ celix_status_t fw_registerService(framework_pt framework, service_registration_p
return mock_c()->returnValue().value.intValue;
}
-celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt * registration, bundle_pt bundle, char * serviceName, service_factory_pt factory, properties_pt properties) {
+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) {
mock_c()->actualCall("fw_registerServiceFactory")
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
@@ -190,7 +190,7 @@ celix_status_t fw_getBundleServicesInUse(framework_pt framework, bundle_pt bundl
}
-void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, char * filter) {
+void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, const char* filter) {
mock_c()->actualCall("fw_addServiceListener")
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/mock/properties_mock.c
----------------------------------------------------------------------
diff --git a/framework/private/mock/properties_mock.c b/framework/private/mock/properties_mock.c
index 562a145..8f05569 100644
--- a/framework/private/mock/properties_mock.c
+++ b/framework/private/mock/properties_mock.c
@@ -37,28 +37,28 @@ void properties_destroy(properties_pt properties) {
->withPointerParameters("properties", properties);
}
-properties_pt properties_load(char * filename) {
+properties_pt properties_load(const char * filename) {
mock_c()->actualCall("properties_load");
return mock_c()->returnValue().value.pointerValue;
}
-void properties_store(properties_pt properties, char * file, char * header) {
+void properties_store(properties_pt properties, const char * file, const char * header) {
mock_c()->actualCall("properties_store");
}
-char * properties_get(properties_pt properties, char * key) {
+const char * properties_get(properties_pt properties, const char * key) {
mock_c()->actualCall("properties_get")
->withPointerParameters("properties", properties)
->withStringParameters("key", key);
return (char *) mock_c()->returnValue().value.stringValue;
}
-char * properties_getWithDefault(properties_pt properties, char * key, char * defaultValue) {
+const char * properties_getWithDefault(properties_pt properties, const char * key, const char * defaultValue) {
mock_c()->actualCall("properties_getWithDefault");
return mock_c()->returnValue().value.pointerValue;
}
-char * properties_set(properties_pt properties, char * key, char * value) {
+const char * properties_set(properties_pt properties, const char * key, const char * value) {
mock_c()->actualCall("properties_set")
->withPointerParameters("properties", properties)
->withStringParameters("key", key)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 25335f7..7bb643f 100644
--- a/framework/private/mock/service_reference_mock.c
+++ b/framework/private/mock/service_reference_mock.c
@@ -141,7 +141,7 @@ celix_status_t serviceReference_isValid(service_reference_pt reference, bool *re
return mock_c()->returnValue().value.intValue;
}
-bool serviceReference_isAssignableTo(service_reference_pt reference, bundle_pt requester, char * serviceName) {
+bool serviceReference_isAssignableTo(service_reference_pt reference, bundle_pt requester, const char * serviceName) {
mock_c()->actualCall("serviceReference_isAssignableTo")
->withPointerParameters("reference", reference)
->withPointerParameters("requester", requester)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 23fb8a4..5ace85d 100644
--- a/framework/private/mock/service_registration_mock.c
+++ b/framework/private/mock/service_registration_mock.c
@@ -28,7 +28,7 @@
#include "service_registration.h"
#include "service_registration_private.h"
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, 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, void* serviceObject, properties_pt dictionary) {
mock_c()->actualCall("serviceRegistration_create")
->withParameterOfType("registry_callback_t", "callback", &callback)
->withPointerParameters("bundle", bundle)
@@ -39,7 +39,7 @@ service_registration_pt serviceRegistration_create(registry_callback_t callback,
return mock_c()->returnValue().value.pointerValue;
}
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, 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) {
mock_c()->actualCall("serviceRegistration_createServiceFactory")
->withParameterOfType("registry_callback_t", "callback", &callback)
->withPointerParameters("bundle", bundle)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 81be4c5..dfaf6ff 100644
--- a/framework/private/mock/service_registry_mock.c
+++ b/framework/private/mock/service_registry_mock.c
@@ -56,7 +56,7 @@ 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, 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, void * serviceObject, properties_pt dictionary, service_registration_pt *registration) {
mock_c()->actualCall("serviceRegistry_registerService")
->withPointerParameters("registry", registry)
->withPointerParameters("bundle", bundle)
@@ -67,7 +67,7 @@ celix_status_t serviceRegistry_registerService(service_registry_pt registry, bun
return mock_c()->returnValue().value.intValue;
}
-celix_status_t serviceRegistry_registerServiceFactory(service_registry_pt registry, bundle_pt bundle, char * serviceName, service_factory_pt factory, 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) {
mock_c()->actualCall("serviceRegistry_registerServiceFactory")
->withPointerParameters("registry", registry)
->withPointerParameters("bundle", bundle)
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/bundle_cache.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_cache.c b/framework/private/src/bundle_cache.c
index 6641d5c..34fd806 100644
--- a/framework/private/src/bundle_cache.c
+++ b/framework/private/src/bundle_cache.c
@@ -49,7 +49,7 @@ celix_status_t bundleCache_create(properties_pt configurationMap, bundle_cache_p
if (cache == NULL) {
status = CELIX_ENOMEM;
} else {
- char * cacheDir = properties_get(configurationMap, (char *) OSGI_FRAMEWORK_FRAMEWORK_STORAGE);
+ char* cacheDir = (char*)properties_get(configurationMap, (char *) OSGI_FRAMEWORK_FRAMEWORK_STORAGE);
cache->configurationMap = configurationMap;
if (cacheDir == NULL) {
cacheDir = ".cache";
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/bundle_context.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_context.c b/framework/private/src/bundle_context.c
index 594355c..f12dbfa 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, char * lo
return status;
}
-celix_status_t bundleContext_registerService(bundle_context_pt context, char * serviceName, void * svcObj,
+celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, void * svcObj,
properties_pt properties, service_registration_pt *service_registration) {
service_registration_pt registration = NULL;
celix_status_t status = CELIX_SUCCESS;
@@ -138,7 +138,7 @@ celix_status_t bundleContext_registerService(bundle_context_pt context, char * s
return status;
}
-celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, char * serviceName, service_factory_pt factory,
+celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, const char * serviceName, service_factory_pt factory,
properties_pt properties, service_registration_pt *service_registration) {
service_registration_pt registration = NULL;
celix_status_t status = CELIX_SUCCESS;
@@ -169,7 +169,7 @@ celix_status_t bundleContext_getServiceReferences(bundle_context_pt context, con
return status;
}
-celix_status_t bundleContext_getServiceReference(bundle_context_pt context, char * serviceName, service_reference_pt *service_reference) {
+celix_status_t bundleContext_getServiceReference(bundle_context_pt context, const char * serviceName, service_reference_pt *service_reference) {
service_reference_pt reference = NULL;
array_list_pt services = NULL;
celix_status_t status = CELIX_SUCCESS;
@@ -278,7 +278,7 @@ celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, b
return status;
}
-celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, char * filter) {
+celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, const char* filter) {
celix_status_t status = CELIX_SUCCESS;
if (context != NULL && listener != NULL) {
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/celix_launcher.c
----------------------------------------------------------------------
diff --git a/framework/private/src/celix_launcher.c b/framework/private/src/celix_launcher.c
index 7221cc3..0fd04cf 100644
--- a/framework/private/src/celix_launcher.c
+++ b/framework/private/src/celix_launcher.c
@@ -78,7 +78,11 @@ int celixLauncher_launchWithProperties(properties_pt config, framework_pt *frame
curl_global_init(CURL_GLOBAL_NOTHING);
#endif
- char *autoStart = properties_get(config, "cosgi.auto.start.1");
+ const char* autoStartProp = properties_get(config, "cosgi.auto.start.1");
+ char* autoStart = NULL;
+ if (autoStartProp != NULL) {
+ autoStart = strndup(autoStartProp, 1024*10);
+ }
status = framework_create(framework, config);
bundle_pt fwBundle = NULL;
@@ -143,7 +147,8 @@ int celixLauncher_launchWithProperties(properties_pt config, framework_pt *frame
printf("Launcher: Framework Started\n");
-
+ free(autoStart);
+
return status;
}
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/filter.c
----------------------------------------------------------------------
diff --git a/framework/private/src/filter.c b/framework/private/src/filter.c
index 02ebc83..032745f 100644
--- a/framework/private/src/filter.c
+++ b/framework/private/src/filter.c
@@ -31,16 +31,16 @@
#include "celix_log.h"
#include "filter_private.h"
-static void filter_skipWhiteSpace(char * filterString, int * pos);
-static filter_pt filter_parseFilter(char * filterString, int * pos);
-static filter_pt filter_parseFilterComp(char * filterString, int * pos);
-static filter_pt filter_parseAnd(char * filterString, int * pos);
-static filter_pt filter_parseOr(char * filterString, int * pos);
-static filter_pt filter_parseNot(char * filterString, int * pos);
-static filter_pt filter_parseItem(char * filterString, int * pos);
-static char * filter_parseAttr(char * filterString, int * pos);
-static char * filter_parseValue(char * filterString, int * pos);
-static array_list_pt filter_parseSubstring(char * filterString, int * pos);
+static void filter_skipWhiteSpace(char* filterString, int* pos);
+static filter_pt filter_parseFilter(char* filterString, int* pos);
+static filter_pt filter_parseFilterComp(char* filterString, int* pos);
+static filter_pt filter_parseAnd(char* filterString, int* pos);
+static filter_pt filter_parseOr(char* filterString, int* pos);
+static filter_pt filter_parseNot(char* filterString, int* pos);
+static filter_pt filter_parseItem(char* filterString, int* pos);
+static char * filter_parseAttr(char* filterString, int* pos);
+static char * filter_parseValue(char* filterString, int* pos);
+static array_list_pt filter_parseSubstring(char* filterString, int* pos);
static celix_status_t filter_compare(OPERAND operand, char * string, void * value2, bool *result);
static celix_status_t filter_compareString(OPERAND operand, char * string, void * value2, bool *result);
@@ -52,18 +52,19 @@ static void filter_skipWhiteSpace(char * filterString, int * pos) {
}
}
-filter_pt filter_create(char * filterString) {
+filter_pt filter_create(const char* filterString) {
filter_pt filter = NULL;
+ char* filterStr = (char*) filterString;
int pos = 0;
- filter = filter_parseFilter(filterString, &pos);
- if (pos != strlen(filterString)) {
+ filter = filter_parseFilter(filterStr, &pos);
+ if (pos != strlen(filterStr)) {
fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: Extraneous trailing characters.");
filter_destroy(filter);
return NULL;
}
if(filter != NULL){
- filter->filterStr = filterString;
- }
+ filter->filterStr = filterStr;
+ }
return filter;
}
@@ -549,12 +550,12 @@ celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *re
case LESS :
case LESSEQUAL :
case APPROX : {
- char * value = (properties == NULL) ? NULL: properties_get(properties, filter->attribute);
+ char * value = (properties == NULL) ? NULL: (char*)properties_get(properties, filter->attribute);
return filter_compare(filter->operand, value, filter->value, result);
}
case PRESENT: {
- char * value = (properties == NULL) ? NULL: properties_get(properties, filter->attribute);
+ char * value = (properties == NULL) ? NULL: (char*)properties_get(properties, filter->attribute);
*result = value != NULL;
return CELIX_SUCCESS;
}
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 5f63e74..16dcf3f 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -365,7 +365,7 @@ celix_status_t fw_init(framework_pt framework) {
status = CELIX_DO_IF(status, bundle_getState(framework->bundle, &state));
if (status == CELIX_SUCCESS) {
if (state == OSGI_FRAMEWORK_BUNDLE_INSTALLED) {
- char *clean = properties_get(framework->configurationMap, (char *) OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN);
+ const char *clean = properties_get(framework->configurationMap, OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN);
if (clean != NULL && (strcmp(clean, OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT) == 0)) {
bundleCache_delete(framework->cache);
}
@@ -525,7 +525,7 @@ celix_status_t fw_getProperty(framework_pt framework, const char *name, char **v
status = CELIX_ILLEGAL_ARGUMENT;
} else {
if (framework->configurationMap != NULL) {
- *value = properties_get(framework->configurationMap, (char *) name);
+ *value = (char*) properties_get(framework->configurationMap, name);
}
if (*value == NULL) {
*value = getenv(name);
@@ -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, 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, void* svcObj, properties_pt properties) {
celix_status_t status = CELIX_SUCCESS;
char *error = NULL;
if (serviceName == NULL || svcObj == NULL) {
@@ -1312,7 +1312,7 @@ celix_status_t fw_registerService(framework_pt framework, service_registration_p
return status;
}
-celix_status_t fw_registerServiceFactory(framework_pt framework, service_registration_pt *registration, bundle_pt bundle, char * serviceName, service_factory_pt factory, properties_pt properties) {
+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) {
celix_status_t status = CELIX_SUCCESS;
char *error = NULL;
if (serviceName == NULL || factory == NULL) {
@@ -1352,12 +1352,12 @@ celix_status_t fw_getServiceReferences(framework_pt framework, array_list_pt *re
for (refIdx = 0; (*references != NULL) && refIdx < arrayList_size(*references); refIdx++) {
service_reference_pt ref = (service_reference_pt) arrayList_get(*references, refIdx);
service_registration_pt reg = NULL;
- char * serviceName;
+ const char* serviceName;
properties_pt props = NULL;
status = CELIX_DO_IF(status, serviceReference_getServiceRegistration(ref, ®));
status = CELIX_DO_IF(status, serviceRegistration_getProperties(reg, &props));
if (status == CELIX_SUCCESS) {
- serviceName = properties_get(props, (char *) OSGI_FRAMEWORK_OBJECTCLASS);
+ serviceName = properties_get(props, OSGI_FRAMEWORK_OBJECTCLASS);
if (!serviceReference_isAssignableTo(ref, bundle, serviceName)) {
arrayList_remove(*references, refIdx);
refIdx--;
@@ -1393,7 +1393,7 @@ celix_status_t framework_ungetService(framework_pt framework, bundle_pt bundle,
return serviceRegistry_ungetService(framework->registry, bundle, reference, result);
}
-void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, char * sfilter) {
+void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, const char* sfilter) {
array_list_pt listenerHooks = NULL;
listener_hook_info_pt info;
unsigned int i;
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/manifest.c
----------------------------------------------------------------------
diff --git a/framework/private/src/manifest.c b/framework/private/src/manifest.c
index a7c434e..5ee13ad 100644
--- a/framework/private/src/manifest.c
+++ b/framework/private/src/manifest.c
@@ -187,9 +187,9 @@ void manifest_write(manifest_pt manifest, char * filename) {
}
char * manifest_getValue(manifest_pt manifest, const char * name) {
- char * val = properties_get(manifest->mainAttributes, (char *) name);
+ const char* val = properties_get(manifest->mainAttributes, name);
bool isEmpty = utils_isStringEmptyOrNull(val);
- return isEmpty ? NULL : val;
+ return isEmpty ? NULL : (char*)val;
}
int fpeek(FILE *stream) {
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/properties.c
----------------------------------------------------------------------
diff --git a/framework/private/src/properties.c b/framework/private/src/properties.c
index 742e563..7b3fd50 100644
--- a/framework/private/src/properties.c
+++ b/framework/private/src/properties.c
@@ -46,7 +46,7 @@ void properties_destroy(properties_pt properties) {
hashMap_destroy(properties, false, false);
}
-properties_pt properties_load(char *filename) {
+properties_pt properties_load(const char* filename) {
FILE *file = fopen(filename, "r");
properties_pt props = properties_loadWithStream(file);
fclose(file);
@@ -147,7 +147,7 @@ FRAMEWORK_EXPORT properties_pt properties_loadWithStream(FILE *file) {
/**
* Header is ignored for now, cannot handle comments yet
*/
-void properties_store(properties_pt properties, char * filename, char * header) {
+void properties_store(properties_pt properties, const char* filename, const char* header) {
FILE *file = fopen ( filename, "w+" );
char *str;
@@ -209,15 +209,15 @@ celix_status_t properties_copy(properties_pt properties, properties_pt *out) {
return status;
}
-char * properties_get(properties_pt properties, char * key) {
- return hashMap_get(properties, key);
+const char* properties_get(properties_pt properties, const char* key) {
+ return hashMap_get(properties, (void*)key);
}
-char * properties_getWithDefault(properties_pt properties, char * key, char * defaultValue) {
- char * value = properties_get(properties, key);
+const char* properties_getWithDefault(properties_pt properties, const char* key, const char* defaultValue) {
+ const char* value = properties_get(properties, key);
return value == NULL ? defaultValue : value;
}
-char * properties_set(properties_pt properties, char * key, char * value) {
- return hashMap_put(properties, strdup(key), strdup(value));
+const char* properties_set(properties_pt properties, const char* key, const char* value) {
+ return hashMap_put(properties, strndup(key, 1024*10), strndup(value, 1024*10));
}
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/service_reference.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_reference.c b/framework/private/src/service_reference.c
index 5230be6..0a5573c 100644
--- a/framework/private/src/service_reference.c
+++ b/framework/private/src/service_reference.c
@@ -203,7 +203,7 @@ celix_status_t serviceReference_getProperty(service_reference_pt ref, char *key,
if (ref->registration != NULL) {
status = serviceRegistration_getProperties(ref->registration, &props);
if (status == CELIX_SUCCESS) {
- *value = properties_get(props, key);
+ *value = (char*) properties_get(props, key);
}
} else {
*value = NULL;
@@ -255,7 +255,7 @@ celix_status_t serviceReference_isValid(service_reference_pt ref, bool *result)
return CELIX_SUCCESS;
}
-bool serviceReference_isAssignableTo(service_reference_pt reference __attribute__((unused)), bundle_pt requester __attribute__((unused)), char * serviceName __attribute__((unused))) {
+bool serviceReference_isAssignableTo(service_reference_pt reference __attribute__((unused)), bundle_pt requester __attribute__((unused)), const char* serviceName __attribute__((unused))) {
bool allow = true;
/*NOTE for now always true. It would be nice to be able to do somechecks if the services are really assignable.
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/service_registration.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registration.c b/framework/private/src/service_registration.c
index f78fcca..63d2c91 100644
--- a/framework/private/src/service_registration.c
+++ b/framework/private/src/service_registration.c
@@ -32,23 +32,23 @@
#include "constants.h"
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, char * serviceName, long serviceId,
+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);
static celix_status_t serviceRegistration_destroy(service_registration_pt registration);
-service_registration_pt serviceRegistration_create(registry_callback_t callback, bundle_pt bundle, 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, void * serviceObject, properties_pt dictionary) {
service_registration_pt registration = NULL;
serviceRegistration_createInternal(callback, bundle, serviceName, serviceId, serviceObject, dictionary, false, ®istration);
return registration;
}
-service_registration_pt serviceRegistration_createServiceFactory(registry_callback_t callback, bundle_pt bundle, 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 registration = NULL;
serviceRegistration_createInternal(callback, bundle, serviceName, serviceId, serviceObject, dictionary, true, ®istration);
return registration;
}
-static celix_status_t serviceRegistration_createInternal(registry_callback_t callback, bundle_pt bundle, char * serviceName, long serviceId,
+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) {
celix_status_t status = CELIX_SUCCESS;
@@ -58,7 +58,7 @@ static celix_status_t serviceRegistration_createInternal(registry_callback_t cal
reg->services = NULL;
reg->nrOfServices = 0;
reg->isServiceFactory = isFactory;
- reg->className = strdup(serviceName);
+ reg->className = strndup(serviceName, 1024*10);
reg->bundle = bundle;
reg->refCount = 1;
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/src/service_registry.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registry.c b/framework/private/src/service_registry.c
index 48ae75c..db00934 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, char * serviceName, void * serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration);
-static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, char *serviceName, void *serviceObject, service_registration_pt 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_addHooks(service_registry_pt registry, const char* serviceName, 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, 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, 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, char * serviceName, service_factory_pt factory, 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) {
return serviceRegistry_registerServiceInternal(registry, bundle, serviceName, (void *) factory, dictionary, true, registration);
}
-static celix_status_t serviceRegistry_registerServiceInternal(service_registry_pt registry, bundle_pt bundle, 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, void* serviceObject, properties_pt dictionary, bool isFactory, service_registration_pt *registration) {
array_list_pt regs;
if (isFactory) {
@@ -669,7 +669,7 @@ celix_status_t serviceRegistry_ungetService(service_registry_pt registry, bundle
return status;
}
-static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, char *serviceName, void *serviceObject __attribute__((unused)), service_registration_pt registration) {
+static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, const char* serviceName, void* serviceObject __attribute__((unused)), service_registration_pt registration) {
celix_status_t status = CELIX_SUCCESS;
if (strcmp(OSGI_FRAMEWORK_LISTENER_HOOK_SERVICE_NAME, serviceName) == 0) {
@@ -683,7 +683,7 @@ static celix_status_t serviceRegistry_addHooks(service_registry_pt registry, cha
static celix_status_t serviceRegistry_removeHook(service_registry_pt registry, service_registration_pt registration) {
celix_status_t status = CELIX_SUCCESS;
- char *serviceName = NULL;
+ const char* serviceName = NULL;
properties_pt props = NULL;
serviceRegistration_getProperties(registration, &props);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/private/test/properties_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/properties_test.cpp b/framework/private/test/properties_test.cpp
index eaed3a3..3124fe7 100644
--- a/framework/private/test/properties_test.cpp
+++ b/framework/private/test/properties_test.cpp
@@ -63,10 +63,10 @@ TEST(properties, load) {
properties = properties_load(propertiesFile);
LONGS_EQUAL(3, hashMap_size(properties));
- char keyA[] = "a";
- char *valueA = properties_get(properties, keyA);
+ const char keyA[] = "a";
+ const char *valueA = properties_get(properties, keyA);
STRCMP_EQUAL("b", valueA);
- char keyB[] = "b";
+ const char keyB[] = "b";
STRCMP_EQUAL("c", properties_get(properties, keyB));
properties_destroy(properties);
@@ -95,9 +95,9 @@ TEST(properties, copy) {
properties_copy(properties, ©);
char keyA[] = "a";
- char *valueA = properties_get(copy, keyA);
+ const char *valueA = properties_get(copy, keyA);
STRCMP_EQUAL("b", valueA);
- char keyB[] = "b";
+ const char keyB[] = "b";
STRCMP_EQUAL("c", properties_get(copy, keyB));
properties_destroy(properties);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/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 b388de3..f1482a7 100644
--- a/framework/private/test/service_registration_test.cpp
+++ b/framework/private/test/service_registration_test.cpp
@@ -115,7 +115,7 @@ TEST(service_registration, create) {
POINTERS_EQUAL(NULL, registration->services);
LONGS_EQUAL(0, registration->nrOfServices);
- char* get;
+ const char* get;
get = properties_get(registration->properties, (char*)"service.id");
STRCMP_EQUAL("1", get);
@@ -147,7 +147,7 @@ TEST(service_registration, createServiceFactory) {
POINTERS_EQUAL(NULL, registration->services);
LONGS_EQUAL(0, registration->nrOfServices);
- char* get;
+ const char* get;
get = properties_get(registration->properties, (char*)"service.id");
STRCMP_EQUAL("1", get);
@@ -336,7 +336,7 @@ TEST(service_registration, getProperties) {
celix_status_t status = serviceRegistration_getProperties(registration, &actual);
LONGS_EQUAL(CELIX_SUCCESS, status);
- char* get;
+ const char* get;
get = properties_get(registration->properties, (char*)"service.id");
STRCMP_EQUAL("5", get);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/public/include/bundle_context.h
----------------------------------------------------------------------
diff --git a/framework/public/include/bundle_context.h b/framework/public/include/bundle_context.h
index 6c885f5..cf8ac4a 100644
--- a/framework/public/include/bundle_context.h
+++ b/framework/public/include/bundle_context.h
@@ -50,9 +50,9 @@ FRAMEWORK_EXPORT celix_status_t bundleContext_getFramework(bundle_context_pt con
FRAMEWORK_EXPORT celix_status_t bundleContext_installBundle(bundle_context_pt context, char * location, bundle_pt *bundle);
FRAMEWORK_EXPORT celix_status_t bundleContext_installBundle2(bundle_context_pt context, char * location, char *inputFile, bundle_pt *bundle);
-FRAMEWORK_EXPORT celix_status_t bundleContext_registerService(bundle_context_pt context, char * serviceName, void * svcObj,
+FRAMEWORK_EXPORT celix_status_t bundleContext_registerService(bundle_context_pt context, const char * serviceName, void * svcObj,
properties_pt properties, service_registration_pt *service_registration);
-FRAMEWORK_EXPORT celix_status_t bundleContext_registerServiceFactory(bundle_context_pt context, char * serviceName, service_factory_pt factory,
+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);
/**
@@ -64,7 +64,7 @@ FRAMEWORK_EXPORT celix_status_t bundleContext_registerServiceFactory(bundle_cont
* @param service_reference _output_ The found service reference, or NULL when no service is found.
* @return CELIX_SUCCESS on success
*/
-FRAMEWORK_EXPORT celix_status_t bundleContext_getServiceReference(bundle_context_pt context, char * serviceName, service_reference_pt *service_reference);
+FRAMEWORK_EXPORT celix_status_t bundleContext_getServiceReference(bundle_context_pt context, const char * serviceName, service_reference_pt *service_reference);
/** Same as bundleContext_getServiceReference, but than for a optional serviceName combined with a optional filter.
* The resulting array_list should be destroyed by the caller. For all service references return a unget should be called.
@@ -98,13 +98,13 @@ FRAMEWORK_EXPORT celix_status_t bundleContext_retainServiceReference(bundle_cont
*/
FRAMEWORK_EXPORT celix_status_t bundleContext_ungetServiceReference(bundle_context_pt context, service_reference_pt reference);
-FRAMEWORK_EXPORT celix_status_t bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void **service_instance);
-FRAMEWORK_EXPORT celix_status_t bundleContext_ungetService(bundle_context_pt context, service_reference_pt reference, bool *result);
+FRAMEWORK_EXPORT celix_status_t bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void** service_instance);
+FRAMEWORK_EXPORT celix_status_t bundleContext_ungetService(bundle_context_pt context, service_reference_pt reference, bool* result);
-FRAMEWORK_EXPORT celix_status_t bundleContext_getBundles(bundle_context_pt context, array_list_pt *bundles);
-FRAMEWORK_EXPORT celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, bundle_pt *bundle);
+FRAMEWORK_EXPORT celix_status_t bundleContext_getBundles(bundle_context_pt context, array_list_pt* bundles);
+FRAMEWORK_EXPORT celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, bundle_pt* bundle);
-FRAMEWORK_EXPORT celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, char * filter);
+FRAMEWORK_EXPORT celix_status_t bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, const char* filter);
FRAMEWORK_EXPORT celix_status_t bundleContext_removeServiceListener(bundle_context_pt context, service_listener_pt listener);
FRAMEWORK_EXPORT celix_status_t bundleContext_addBundleListener(bundle_context_pt context, bundle_listener_pt listener);
@@ -113,6 +113,6 @@ FRAMEWORK_EXPORT celix_status_t bundleContext_removeBundleListener(bundle_contex
FRAMEWORK_EXPORT celix_status_t bundleContext_addFrameworkListener(bundle_context_pt context, framework_listener_pt listener);
FRAMEWORK_EXPORT celix_status_t bundleContext_removeFrameworkListener(bundle_context_pt context, framework_listener_pt listener);
-FRAMEWORK_EXPORT celix_status_t bundleContext_getProperty(bundle_context_pt context, const char *name, char **value);
+FRAMEWORK_EXPORT celix_status_t bundleContext_getProperty(bundle_context_pt context, const char* name, char** value);
#endif /* BUNDLE_CONTEXT_H_ */
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/public/include/filter.h
----------------------------------------------------------------------
diff --git a/framework/public/include/filter.h b/framework/public/include/filter.h
index 9e78192..2bcefd8 100644
--- a/framework/public/include/filter.h
+++ b/framework/public/include/filter.h
@@ -34,7 +34,7 @@
typedef struct filter * filter_pt;
-FRAMEWORK_EXPORT filter_pt filter_create(char * filterString);
+FRAMEWORK_EXPORT filter_pt filter_create(const char * filterString);
FRAMEWORK_EXPORT void filter_destroy(filter_pt filter);
FRAMEWORK_EXPORT celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *result);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/public/include/properties.h
----------------------------------------------------------------------
diff --git a/framework/public/include/properties.h b/framework/public/include/properties.h
index 9fa5f68..0f0b0b1 100644
--- a/framework/public/include/properties.h
+++ b/framework/public/include/properties.h
@@ -37,13 +37,13 @@ typedef hash_map_pt properties_pt;
FRAMEWORK_EXPORT properties_pt properties_create(void);
FRAMEWORK_EXPORT void properties_destroy(properties_pt properties);
-FRAMEWORK_EXPORT properties_pt properties_load(char * filename);
+FRAMEWORK_EXPORT properties_pt properties_load(const char* filename);
FRAMEWORK_EXPORT properties_pt properties_loadWithStream(FILE *stream);
-FRAMEWORK_EXPORT void properties_store(properties_pt properties, char * file, char * header);
+FRAMEWORK_EXPORT void properties_store(properties_pt properties, const char* file, const char* header);
-FRAMEWORK_EXPORT char * properties_get(properties_pt properties, char * key);
-FRAMEWORK_EXPORT char * properties_getWithDefault(properties_pt properties, char * key, char * defaultValue);
-FRAMEWORK_EXPORT char * properties_set(properties_pt properties, char * key, char * value);
+FRAMEWORK_EXPORT const char* properties_get(properties_pt properties, const char* key);
+FRAMEWORK_EXPORT const char* properties_getWithDefault(properties_pt properties, const char* key, const char* defaultValue);
+FRAMEWORK_EXPORT const char* properties_set(properties_pt properties, const char* key, const char* value);
FRAMEWORK_EXPORT celix_status_t properties_copy(properties_pt properties, properties_pt *copy);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/public/include/service_reference.h
----------------------------------------------------------------------
diff --git a/framework/public/include/service_reference.h b/framework/public/include/service_reference.h
index f6cb9e5..a8af38d 100644
--- a/framework/public/include/service_reference.h
+++ b/framework/public/include/service_reference.h
@@ -37,7 +37,7 @@ typedef struct serviceReference * service_reference_pt;
FRAMEWORK_EXPORT celix_status_t serviceReference_getBundle(service_reference_pt reference, bundle_pt *bundle);
-FRAMEWORK_EXPORT bool serviceReference_isAssignableTo(service_reference_pt reference, bundle_pt requester, char * serviceName);
+FRAMEWORK_EXPORT bool serviceReference_isAssignableTo(service_reference_pt reference, bundle_pt requester, const char* serviceName);
FRAMEWORK_EXPORT celix_status_t serviceReference_getProperty(service_reference_pt reference, char *key, char **value);
FRAMEWORK_EXPORT celix_status_t serviceReference_getPropertyKeys(service_reference_pt reference, char **keys[], unsigned int *size);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/framework/public/include/service_registry.h
----------------------------------------------------------------------
diff --git a/framework/public/include/service_registry.h b/framework/public/include/service_registry.h
index 506f2bf..365d913 100644
--- a/framework/public/include/service_registry.h
+++ b/framework/public/include/service_registry.h
@@ -44,8 +44,8 @@ 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, char * serviceName, void * serviceObject, properties_pt dictionary, service_registration_pt *registration);
-celix_status_t serviceRegistry_registerServiceFactory(service_registry_pt registry, bundle_pt bundle, char * serviceName, service_factory_pt factory, properties_pt dictionary, service_registration_pt *registration);
+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_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);
celix_status_t serviceRegistry_clearServiceRegistrations(service_registry_pt registry, bundle_pt bundle);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/remote_services/remote_service_admin/private/src/endpoint_description.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin/private/src/endpoint_description.c b/remote_services/remote_service_admin/private/src/endpoint_description.c
index 5cf75ce..5068c3c 100644
--- a/remote_services/remote_service_admin/private/src/endpoint_description.c
+++ b/remote_services/remote_service_admin/private/src/endpoint_description.c
@@ -46,9 +46,9 @@ celix_status_t endpointDescription_create(properties_pt properties, endpoint_des
endpoint_description_pt ep = calloc(1,sizeof(*ep));
ep->properties = properties;
- ep->frameworkUUID = properties_get(properties, (char *) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
- ep->id = properties_get(properties, (char *) OSGI_RSA_ENDPOINT_ID);
- ep->service = properties_get(properties, (char *) OSGI_FRAMEWORK_OBJECTCLASS);
+ ep->frameworkUUID = (char*)properties_get(properties, (char *) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
+ ep->id = (char*)properties_get(properties, (char *) OSGI_RSA_ENDPOINT_ID);
+ ep->service = (char*)properties_get(properties, (char *) OSGI_FRAMEWORK_OBJECTCLASS);
ep->serviceId = serviceId;
if (!(ep->frameworkUUID) || !(ep->id) || !(ep->service) ) {
@@ -76,7 +76,7 @@ celix_status_t endpointDescription_destroy(endpoint_description_pt description)
static celix_status_t endpointDescription_verifyLongProperty(properties_pt properties, char *propertyName, long *longProperty) {
celix_status_t status = CELIX_SUCCESS;
- char *value = properties_get(properties, propertyName);
+ const char *value = properties_get(properties, propertyName);
if (value == NULL) {
*longProperty = 0l;
} else {
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
index 1cfcf16..66c849d 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
@@ -105,7 +105,7 @@ celix_status_t exportRegistration_create(log_helper_pt helper, service_reference
/* Add the interface version as a property in the properties_map */
char* intfVersion = NULL;
dynInterface_getVersionString(reg->intf, &intfVersion);
- char *serviceVersion = properties_get(endpoint->properties,(char*) CELIX_FRAMEWORK_SERVICE_VERSION);
+ const char *serviceVersion = properties_get(endpoint->properties,(char*) CELIX_FRAMEWORK_SERVICE_VERSION);
if(serviceVersion!=NULL){
if(strcmp(serviceVersion,intfVersion)!=0){
logHelper_log(helper, OSGI_LOGSERVICE_WARNING, "Service version (%s) and interface version from the descriptor (%s) are not the same!",serviceVersion,intfVersion);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c
index f1f518a..4320a54 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c
@@ -543,11 +543,11 @@ static celix_status_t remoteServiceAdmin_createEndpointDescription(remote_servic
if (!*endpoint) {
status = CELIX_ENOMEM;
} else {
- (*endpoint)->id = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
+ (*endpoint)->id = (char*)properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
char *serviceId = NULL;
serviceReference_getProperty(reference, (char*) OSGI_FRAMEWORK_SERVICE_ID, &serviceId);
(*endpoint)->serviceId = strtoull(serviceId, NULL, 0);
- (*endpoint)->frameworkUUID = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
+ (*endpoint)->frameworkUUID = (char*) properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
(*endpoint)->service = interface;
(*endpoint)->properties = endpointProperties;
}
@@ -678,7 +678,7 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
get.size = 0;
get.writeptr = malloc(1);
- char *serviceUrl = properties_get(endpointDescription->properties, (char*) ENDPOINT_URL);
+ char *serviceUrl = (char*)properties_get(endpointDescription->properties, (char*) ENDPOINT_URL);
char url[256];
snprintf(url, 256, "%s", serviceUrl);
@@ -687,7 +687,7 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
char *timeoutStr = NULL;
// Check if the endpoint has a timeout, if so, use it.
- timeoutStr = properties_get(endpointDescription->properties, (char*) OSGI_RSA_REMOTE_PROXY_TIMEOUT);
+ timeoutStr = (char*) properties_get(endpointDescription->properties, (char*) OSGI_RSA_REMOTE_PROXY_TIMEOUT);
if (timeoutStr == NULL) {
// If not, get the global variable and use that one.
bundleContext_getProperty(rsa->context, (char*) OSGI_RSA_REMOTE_PROXY_TIMEOUT, &timeoutStr);
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
index 7f76e3a..80eb364 100644
--- a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
+++ b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
@@ -589,11 +589,11 @@ celix_status_t remoteServiceAdmin_createEndpointDescription(remote_service_admin
if (!*description) {
status = CELIX_ENOMEM;
} else {
- (*description)->id = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
+ (*description)->id = (char*)properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
char *serviceId = NULL;
- serviceReference_getProperty(reference, (char*) OSGI_FRAMEWORK_SERVICE_ID, &serviceId);
+ serviceReference_getProperty(reference, (char*)OSGI_FRAMEWORK_SERVICE_ID, &serviceId);
(*description)->serviceId = strtoull(serviceId, NULL, 0);
- (*description)->frameworkUUID = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
+ (*description)->frameworkUUID = (char*)properties_get(endpointProperties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
(*description)->service = interface;
(*description)->properties = endpointProperties;
}
@@ -723,7 +723,7 @@ celix_status_t remoteServiceAdmin_send(remote_service_admin_pt rsa, endpoint_des
get.size = 0;
get.writeptr = malloc(1);
- char *serviceUrl = properties_get(endpointDescription->properties, (char *) ENDPOINT_URL);
+ const char* serviceUrl = properties_get(endpointDescription->properties, ENDPOINT_URL);
if (serviceUrl != NULL) {
snprintf(url, 256, "%s", serviceUrl);
} else {
@@ -741,10 +741,10 @@ celix_status_t remoteServiceAdmin_send(remote_service_admin_pt rsa, endpoint_des
char *timeoutStr = NULL;
// Check if the endpoint has a timeout, if so, use it.
- timeoutStr = properties_get(endpointDescription->properties, (char *) OSGI_RSA_REMOTE_PROXY_TIMEOUT);
+ timeoutStr = (char*)properties_get(endpointDescription->properties, OSGI_RSA_REMOTE_PROXY_TIMEOUT);
if (timeoutStr == NULL) {
// If not, get the global variable and use that one.
- status = bundleContext_getProperty(rsa->context, (char *) OSGI_RSA_REMOTE_PROXY_TIMEOUT, &timeoutStr);
+ status = bundleContext_getProperty(rsa->context, OSGI_RSA_REMOTE_PROXY_TIMEOUT, &timeoutStr);
}
// Update timeout if a property is used to set it.
http://git-wip-us.apache.org/repos/asf/celix/blob/6f447d85/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c b/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
index 9f54902..8060a52 100644
--- a/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
+++ b/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
@@ -649,16 +649,16 @@ celix_status_t remoteServiceAdmin_createOrAttachShm(hash_map_pt ipcSegment, remo
char *semPath = NULL;
char *semFtokId = NULL;
- if ((shmPath = properties_get(endpointProperties, (char *) RSA_SHM_PATH_PROPERTYNAME)) == NULL) {
+ if ((shmPath = (char*)properties_get(endpointProperties, (char *) RSA_SHM_PATH_PROPERTYNAME)) == NULL) {
logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "No value found for key %s in endpointProperties.", RSA_SHM_PATH_PROPERTYNAME);
status = CELIX_BUNDLE_EXCEPTION;
- } else if ((shmFtokId = properties_get(endpointProperties, (char *) RSA_SHM_FTOK_ID_PROPERTYNAME)) == NULL) {
+ } else if ((shmFtokId = (char*)properties_get(endpointProperties, (char *) RSA_SHM_FTOK_ID_PROPERTYNAME)) == NULL) {
logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "No value found for key %s in endpointProperties.", RSA_SHM_FTOK_ID_PROPERTYNAME);
status = CELIX_BUNDLE_EXCEPTION;
- } else if ((semPath = properties_get(endpointProperties, (char *) RSA_SEM_PATH_PROPERTYNAME)) == NULL) {
+ } else if ((semPath = (char*)properties_get(endpointProperties, (char *) RSA_SEM_PATH_PROPERTYNAME)) == NULL) {
logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "No value found for key %s in endpointProperties.", RSA_SEM_PATH_PROPERTYNAME);
status = CELIX_BUNDLE_EXCEPTION;
- } else if ((semFtokId = properties_get(endpointProperties, (char *) RSA_SEM_FTOK_ID_PROPERTYNAME)) == NULL) {
+ } else if ((semFtokId = (char*)properties_get(endpointProperties, (char *) RSA_SEM_FTOK_ID_PROPERTYNAME)) == NULL) {
logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "No value found for key %s in endpointProperties.", RSA_SEM_FTOK_ID_PROPERTYNAME);
status = CELIX_BUNDLE_EXCEPTION;
} else {
@@ -800,11 +800,11 @@ celix_status_t remoteServiceAdmin_createEndpointDescription(remote_service_admin
} else {
if (status == CELIX_SUCCESS) {
(*description)->properties = endpointProperties;
- (*description)->frameworkUUID = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
+ (*description)->frameworkUUID = (char*)properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID);
char *serviceId = NULL;
- serviceReference_getProperty(reference, (char*) OSGI_FRAMEWORK_SERVICE_ID, &serviceId);
+ serviceReference_getProperty(reference, (char*)OSGI_FRAMEWORK_SERVICE_ID, &serviceId);
(*description)->serviceId = strtoull(serviceId, NULL, 0);
- (*description)->id = properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
+ (*description)->id = (char*)properties_get(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID);
(*description)->service = interface;
}
}
[2/2] celix git commit: CELIX-249: Refactors config_admin for
properties api change (char* -> const char*)
Posted by pn...@apache.org.
CELIX-249: Refactors config_admin for properties api change (char* -> const char*)
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/c34eaa68
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/c34eaa68
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/c34eaa68
Branch: refs/heads/develop
Commit: c34eaa689cd6d15b732b8d8b9effb968eea25491
Parents: 6f447d8
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jul 5 16:42:32 2016 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jul 5 16:42:32 2016 +0200
----------------------------------------------------------------------
config_admin/config_admin_tst/config_admin_test.cpp | 8 ++++----
.../example_test/private/src/example_managed_service_impl.c | 4 ++--
config_admin/example/private/src/example.c | 2 +-
config_admin/service/private/src/configuration_impl.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/c34eaa68/config_admin/config_admin_tst/config_admin_test.cpp
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/config_admin_test.cpp b/config_admin/config_admin_tst/config_admin_test.cpp
index 80f1480..25898d2 100644
--- a/config_admin/config_admin_tst/config_admin_test.cpp
+++ b/config_admin/config_admin_tst/config_admin_test.cpp
@@ -175,7 +175,7 @@ tst2_service_pt test2Serv = NULL;
properties = NULL;
configuration->configuration_getProperties(configuration->handle, &properties);
if (properties != NULL) {
- char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
+ const char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
CHECK_TEXT("base.device1", test_value);
test_value = properties_get(properties, (char *)prop1);
CHECK_TEXT("printer", test_value);
@@ -195,7 +195,7 @@ tst2_service_pt test2Serv = NULL;
configuration->configuration_getProperties(configuration->handle, &properties);
CHECK((properties != NULL));
if (properties != NULL) {
- char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
+ const char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
CHECK_TEXT("base.device1", test_value);
test_value = properties_get(properties, (char *)key);
CHECK_TEXT("printer", test_value);
@@ -238,14 +238,14 @@ tst2_service_pt test2Serv = NULL;
properties = NULL;
configuration->configuration_getProperties(configuration->handle, &properties);
if (properties != NULL) {
- char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
+ const char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
CHECK_TEXT("base.device1", test_value);
test_value = properties_get(properties, (char *)prop1);
CHECK_TEXT("printer", test_value);
}
configuration2->configuration_getProperties(configuration2->handle, &properties);
if (properties != NULL) {
- char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
+ const char *test_value = properties_get(properties, (char*)OSGI_FRAMEWORK_SERVICE_PID);
CHECK_TEXT("test2_pid", test_value);
test_value = properties_get(properties, (char *)prop1);
CHECK_TEXT("test2_printer", test_value);
http://git-wip-us.apache.org/repos/asf/celix/blob/c34eaa68/config_admin/config_admin_tst/example_test/private/src/example_managed_service_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/example_test/private/src/example_managed_service_impl.c b/config_admin/config_admin_tst/example_test/private/src/example_managed_service_impl.c
index 309cc7a..7bcbf36 100644
--- a/config_admin/config_admin_tst/example_test/private/src/example_managed_service_impl.c
+++ b/config_admin/config_admin_tst/example_test/private/src/example_managed_service_impl.c
@@ -68,8 +68,8 @@ celix_status_t managedServiceImpl_updated(managed_service_pt managedService, pro
msp->store_props(msp->handle, "", "");
}else{
printf("[ managedServiceImpl ]: updated - Received New Properties \n");
- char *value = properties_get(properties, "type");
- char *value2 = properties_get(properties, "second_type");
+ char *value = (char*)properties_get(properties, "type");
+ char *value2 = (char*)properties_get(properties, "second_type");
msp->store_props(msp->handle, value, value2);
// it would be nicer if we get the property values here and store them in the activator structure.
}
http://git-wip-us.apache.org/repos/asf/celix/blob/c34eaa68/config_admin/example/private/src/example.c
----------------------------------------------------------------------
diff --git a/config_admin/example/private/src/example.c b/config_admin/example/private/src/example.c
index e58e6ae..517b252 100644
--- a/config_admin/example/private/src/example.c
+++ b/config_admin/example/private/src/example.c
@@ -49,7 +49,7 @@ celix_status_t example_updated(example_pt component, properties_pt updatedProper
hash_map_iterator_pt iter = hashMapIterator_create(map);
while(hashMapIterator_hasNext(iter)) {
char *key = hashMapIterator_nextKey(iter);
- char *value = properties_get(updatedProperties, key);
+ const char *value = properties_get(updatedProperties, key);
printf("got property %s:%s\n", key, value);
}
} else {
http://git-wip-us.apache.org/repos/asf/celix/blob/c34eaa68/config_admin/service/private/src/configuration_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/configuration_impl.c b/config_admin/service/private/src/configuration_impl.c
index eed51ff..3c2cf00 100644
--- a/config_admin/service/private/src/configuration_impl.c
+++ b/config_admin/service/private/src/configuration_impl.c
@@ -174,7 +174,7 @@ celix_status_t configuration_create2(configuration_admin_factory_pt factory, con
configuration_impl_pt conf_impl;
celix_thread_mutexattr_t mutex_attr;
- char *value;
+ const char *value;
config = calloc(1, sizeof(struct configuration));
if (config == NULL) return CELIX_ENOMEM;