celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [2/2] celix git commit: CELIX-249: Refactors config_admin for properties api change (char* -> const char*)
Date Tue, 05 Jul 2016 14:43:32 GMT
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 <pepijnnoltes@gmail.com>
Authored: Tue Jul 5 16:42:32 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@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;


Mime
View raw message