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 2018/01/30 15:34:21 UTC

celix git commit: CELIX-417: Fixes some clang errors and removes unused cmake BUILD options from travis config

Repository: celix
Updated Branches:
  refs/heads/feature/CELIX-417-cmake-refactor 326f27594 -> 83d77f4d0


CELIX-417: Fixes some clang errors and removes unused cmake BUILD options from travis config


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

Branch: refs/heads/feature/CELIX-417-cmake-refactor
Commit: 83d77f4d04b21806cfeb4e9e10b89daa7d9be588
Parents: 326f275
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 30 16:34:11 2018 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 30 16:34:11 2018 +0100

----------------------------------------------------------------------
 .travis.yml                                     |  2 -
 .../publisher/private/src/mp_pub_activator.c    | 30 ++++++-------
 .../subscriber/private/src/mp_sub_activator.c   | 21 ++++-----
 .../publisher/private/src/ps_pub_activator.c    | 45 +++++++++-----------
 .../subscriber/private/src/ps_sub_activator.c   | 27 ++++++------
 5 files changed, 56 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/83d77f4d/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 5af8c60..8bfc819 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -66,7 +66,6 @@ before_script:
     - cd -
     - mkdir build install
     - export BUILD_OPTIONS=" \
-        -DBUILD_CONFIG_ADMIN=OFF \
         -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON \
         -DBUILD_DEPLOYMENT_ADMIN=ON \
         -DBUILD_DEPENDENCY_MANAGER=ON \
@@ -76,7 +75,6 @@ before_script:
         -DBUILD_RSA_DISCOVERY_CONFIGURED=ON \
         -DBUILD_RSA_DISCOVERY_ETCD=ON \
         -DBUILD_RSA_EXAMPLES=ON \
-        -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON \
         -DBUILD_REMOTE_SHELL=ON \
         -DBUILD_SHELL=ON \
         -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON \

http://git-wip-us.apache.org/repos/asf/celix/blob/83d77f4d/pubsub/examples/mp_pubsub/publisher/private/src/mp_pub_activator.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/mp_pubsub/publisher/private/src/mp_pub_activator.c b/pubsub/examples/mp_pubsub/publisher/private/src/mp_pub_activator.c
index 464d1ab..0b6041d 100644
--- a/pubsub/examples/mp_pubsub/publisher/private/src/mp_pub_activator.c
+++ b/pubsub/examples/mp_pubsub/publisher/private/src/mp_pub_activator.c
@@ -80,28 +80,26 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt context)
 
 	int i;
 
-	if(PUB_TOPICS != NULL) {
-		char filter[128];
-		for(i=0; PUB_TOPICS[i] != NULL; i++){
-			const char* topic = PUB_TOPICS[i];
+	char filter[128];
+	for(i=0; PUB_TOPICS[i] != NULL; i++){
+		const char* topic = PUB_TOPICS[i];
 
-			bundle_pt bundle = NULL;
-			long bundleId = 0;
-			bundleContext_getBundle(context,&bundle);
-			bundle_getBundleId(bundle,&bundleId);
+		bundle_pt bundle = NULL;
+		long bundleId = 0;
+		bundleContext_getBundle(context,&bundle);
+		bundle_getBundleId(bundle,&bundleId);
 
-			service_tracker_pt tracker = NULL;
-			memset(filter,0,128);
+		service_tracker_pt tracker = NULL;
+		memset(filter,0,128);
 
-			snprintf(filter, 128, "(&(%s=%s)(%s=%s))", (char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME, PUBSUB_PUBLISHER_TOPIC,topic);
+		snprintf(filter, 128, "(&(%s=%s)(%s=%s))", (char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME, PUBSUB_PUBLISHER_TOPIC,topic);
 
-			service_tracker_customizer_pt customizer = NULL;
+		service_tracker_customizer_pt customizer = NULL;
 
-			serviceTrackerCustomizer_create(act->client,NULL,publisher_publishSvcAdded,NULL,publisher_publishSvcRemoved,&customizer);
-			serviceTracker_createWithFilter(context, filter, customizer, &tracker);
+		serviceTrackerCustomizer_create(act->client,NULL,publisher_publishSvcAdded,NULL,publisher_publishSvcRemoved,&customizer);
+		serviceTracker_createWithFilter(context, filter, customizer, &tracker);
 
-			arrayList_add(act->trackerList,tracker);
-		}
+		arrayList_add(act->trackerList,tracker);
 	}
 
 	publisher_start(act->client);

http://git-wip-us.apache.org/repos/asf/celix/blob/83d77f4d/pubsub/examples/mp_pubsub/subscriber/private/src/mp_sub_activator.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/mp_pubsub/subscriber/private/src/mp_sub_activator.c b/pubsub/examples/mp_pubsub/subscriber/private/src/mp_sub_activator.c
index df9cb0f..591a395 100644
--- a/pubsub/examples/mp_pubsub/subscriber/private/src/mp_sub_activator.c
+++ b/pubsub/examples/mp_pubsub/subscriber/private/src/mp_sub_activator.c
@@ -60,18 +60,15 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt context)
 
 	act->subsvc = subsvc;
 
-	if (SUB_TOPICS !=NULL) {
-
-		int i;
-		for(i=0; SUB_TOPICS[i] != NULL; i++){
-			const char* topic = SUB_TOPICS[i];
-
-			properties_pt props = properties_create();
-			properties_set(props, PUBSUB_SUBSCRIBER_TOPIC,topic);
-			service_registration_pt reg = NULL;
-			bundleContext_registerService(context, PUBSUB_SUBSCRIBER_SERVICE_NAME, subsvc, props, &reg);
-			arrayList_add(act->registrationList,reg);
-		}
+	int i;
+	for(i=0; SUB_TOPICS[i] != NULL; i++){
+		const char* topic = SUB_TOPICS[i];
+
+		properties_pt props = properties_create();
+		properties_set(props, PUBSUB_SUBSCRIBER_TOPIC,topic);
+		service_registration_pt reg = NULL;
+		bundleContext_registerService(context, PUBSUB_SUBSCRIBER_SERVICE_NAME, subsvc, props, &reg);
+		arrayList_add(act->registrationList,reg);
 	}
 
 	subscriber_start((pubsub_receiver_pt)act->subsvc->handle);

http://git-wip-us.apache.org/repos/asf/celix/blob/83d77f4d/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c b/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c
index a1f2dc8..0da3ffc 100644
--- a/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c
+++ b/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c
@@ -76,37 +76,34 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt context)
 	struct publisherActivator * act = (struct publisherActivator *) userData;
 
 	int i;
-	if(PUB_TOPICS !=NULL){
+	char filter[128];
+	for(i=0; PUB_TOPICS[i] != NULL; i++){
+		const char* topic = PUB_TOPICS[i];
 
-		char filter[128];
-		for(i=0; PUB_TOPICS[i] != NULL; i++){
-			const char* topic = PUB_TOPICS[i];
+		bundle_pt bundle = NULL;
+		long bundleId = 0;
+		bundleContext_getBundle(context,&bundle);
+		bundle_getBundleId(bundle,&bundleId);
 
-			bundle_pt bundle = NULL;
-			long bundleId = 0;
-			bundleContext_getBundle(context,&bundle);
-			bundle_getBundleId(bundle,&bundleId);
-
-			service_tracker_pt tracker = NULL;
-			memset(filter,0,128);
+		service_tracker_pt tracker = NULL;
+		memset(filter,0,128);
 #ifdef USE_SCOPE
-				char *scope;
-				asprintf(&scope, "my_scope_%d", i);
-				snprintf(filter, 128, "(&(&(%s=%s)(%s=%s))(%s=%s))",
-						(char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME,
-						PUBSUB_PUBLISHER_TOPIC, topic,
-						PUBLISHER_SCOPE, scope);
-				free(scope);
+			char *scope;
+			asprintf(&scope, "my_scope_%d", i);
+			snprintf(filter, 128, "(&(&(%s=%s)(%s=%s))(%s=%s))",
+					(char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME,
+					PUBSUB_PUBLISHER_TOPIC, topic,
+					PUBLISHER_SCOPE, scope);
+			free(scope);
 #else
-			snprintf(filter, 128, "(&(%s=%s)(%s=%s))", (char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME, PUBSUB_PUBLISHER_TOPIC, topic);
+		snprintf(filter, 128, "(&(%s=%s)(%s=%s))", (char*) OSGI_FRAMEWORK_OBJECTCLASS, PUBSUB_PUBLISHER_SERVICE_NAME, PUBSUB_PUBLISHER_TOPIC, topic);
 #endif
-			service_tracker_customizer_pt customizer = NULL;
-			serviceTrackerCustomizer_create(act->client,NULL,publisher_publishSvcAdded,NULL,publisher_publishSvcRemoved,&customizer);
-			serviceTracker_createWithFilter(context, filter, customizer, &tracker);
+		service_tracker_customizer_pt customizer = NULL;
+		serviceTrackerCustomizer_create(act->client,NULL,publisher_publishSvcAdded,NULL,publisher_publishSvcRemoved,&customizer);
+		serviceTracker_createWithFilter(context, filter, customizer, &tracker);
 
-			arrayList_add(act->trackerList,tracker);
+		arrayList_add(act->trackerList,tracker);
 
-		}
 	}
 
 	publisher_start(act->client);

http://git-wip-us.apache.org/repos/asf/celix/blob/83d77f4d/pubsub/examples/pubsub/subscriber/private/src/ps_sub_activator.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/pubsub/subscriber/private/src/ps_sub_activator.c b/pubsub/examples/pubsub/subscriber/private/src/ps_sub_activator.c
index 4738abd..5f3b283 100644
--- a/pubsub/examples/pubsub/subscriber/private/src/ps_sub_activator.c
+++ b/pubsub/examples/pubsub/subscriber/private/src/ps_sub_activator.c
@@ -61,23 +61,20 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt context)
 
 	act->subsvc = subsvc;
 
-	if (SUB_TOPICS !=NULL){
-
-		int i;
-		for(i=0; SUB_TOPICS[i] != NULL ;i++){
-			const char* topic = SUB_TOPICS[i];
-			properties_pt props = properties_create();
-			properties_set(props, PUBSUB_SUBSCRIBER_TOPIC,topic);
+	int i;
+	for(i=0; SUB_TOPICS[i] != NULL ;i++){
+		const char* topic = SUB_TOPICS[i];
+		properties_pt props = properties_create();
+		properties_set(props, PUBSUB_SUBSCRIBER_TOPIC,topic);
 #ifdef USE_SCOPE
-				char *scope;
-				asprintf(&scope, "my_scope_%d", i);
-				properties_set(props,SUBSCRIBER_SCOPE,scope);
-				free(scope);
+			char *scope;
+			asprintf(&scope, "my_scope_%d", i);
+			properties_set(props,SUBSCRIBER_SCOPE,scope);
+			free(scope);
 #endif
-			service_registration_pt reg = NULL;
-			bundleContext_registerService(context, PUBSUB_SUBSCRIBER_SERVICE_NAME, subsvc, props, &reg);
-			arrayList_add(act->registrationList,reg);
-		}
+		service_registration_pt reg = NULL;
+		bundleContext_registerService(context, PUBSUB_SUBSCRIBER_SERVICE_NAME, subsvc, props, &reg);
+		arrayList_add(act->registrationList,reg);
 	}
 
 	subscriber_start((pubsub_receiver_pt)act->subsvc->handle);