Repository: celix
Updated Branches:
  refs/heads/develop 009fd056e -> 392f12ee4


CELIX-438: Updates updated celix dm api


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

Branch: refs/heads/develop
Commit: 392f12ee41ff388e5587c20b32480124b1a98c5a
Parents: 009fd05
Author: Pepijn Noltes <[email protected]>
Authored: Thu Dec 6 20:19:28 2018 +0100
Committer: Pepijn Noltes <[email protected]>
Committed: Thu Dec 6 20:19:28 2018 +0100

----------------------------------------------------------------------
 libs/framework/include/celix_dm_component.h |  2 +-
 libs/framework/src/dm_component_impl.c      | 19 +++++++------------
 2 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/392f12ee/libs/framework/include/celix_dm_component.h
----------------------------------------------------------------------
diff --git a/libs/framework/include/celix_dm_component.h 
b/libs/framework/include/celix_dm_component.h
index bcfaf52..12bb06d 100644
--- a/libs/framework/include/celix_dm_component.h
+++ b/libs/framework/include/celix_dm_component.h
@@ -116,7 +116,7 @@ const char* celix_dmComponent_getName(celix_dm_component_t 
*cmp);
 /**
  * Returns bundle context for the bundle where this DM component is part of.
  */
-celix_status_t celix_dmComponent_getBundleContext(celix_dm_component_t 
*component, celix_bundle_context_t **out);
+celix_bundle_context_t* 
celix_dmComponent_getBundleContext(celix_dm_component_t *component);
 
 /**
  * Set the component life cycle callbacks.

http://git-wip-us.apache.org/repos/asf/celix/blob/392f12ee/libs/framework/src/dm_component_impl.c
----------------------------------------------------------------------
diff --git a/libs/framework/src/dm_component_impl.c 
b/libs/framework/src/dm_component_impl.c
index c2cc825..45406d1 100644
--- a/libs/framework/src/dm_component_impl.c
+++ b/libs/framework/src/dm_component_impl.c
@@ -1309,21 +1309,16 @@ celix_status_t 
celix_dmComponent_setImplementation(celix_dm_component_t *compone
 }
 
 celix_status_t component_getBundleContext(celix_dm_component_t *component, 
bundle_context_pt *context) {
-    return celix_dmComponent_getBundleContext(component, context);
+    *context = celix_dmComponent_getBundleContext(component);
+    return *context == NULL ? CELIX_BUNDLE_EXCEPTION : CELIX_SUCCESS;
 }
 
-celix_status_t celix_dmComponent_getBundleContext(celix_dm_component_t 
*component, bundle_context_pt *context) {
-       celix_status_t status = CELIX_SUCCESS;
-
-       if (!component) {
-               status = CELIX_ILLEGAL_ARGUMENT;
-       }
-
-       if (status == CELIX_SUCCESS) {
-               *context = component->context;
+celix_bundle_context_t* 
celix_dmComponent_getBundleContext(celix_dm_component_t *component) {
+       celix_bundle_context_t *result = NULL;
+       if (component) {
+               result = component->context;
        }
-
-       return status;
+    return result;
 }
 
 

Reply via email to