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 2020/12/04 11:57:40 UTC

[celix] branch master updated: fixed calculator example 'sub' shell tips on remote service

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e47f66  fixed calculator example 'sub' shell tips on remote service
     new fcd2a33  Merge pull request #303 from wanglzh/master
5e47f66 is described below

commit 5e47f66a9b9735aae2f2adc50ab9d76afbb3457f
Author: wanglzh <wa...@gmail.com>
AuthorDate: Thu Dec 3 18:19:54 2020 +0800

    fixed calculator example 'sub' shell tips on remote service
---
 .../remote_services/examples/calculator_service/src/calculator_impl.c   | 2 +-
 bundles/remote_services/examples/calculator_shell/src/sub_command.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bundles/remote_services/examples/calculator_service/src/calculator_impl.c b/bundles/remote_services/examples/calculator_service/src/calculator_impl.c
index db6b7b8..27c6c8a 100644
--- a/bundles/remote_services/examples/calculator_service/src/calculator_impl.c
+++ b/bundles/remote_services/examples/calculator_service/src/calculator_impl.c
@@ -47,7 +47,7 @@ int calculator_sub(calculator_t *calculator __attribute__((unused)), double a, d
     int status = CELIX_SUCCESS;
 
     *result = a - b;
-    printf("CALCULATOR: Sub: %f + %f = %f\n", a, b, *result);
+    printf("CALCULATOR: Sub: %f - %f = %f\n", a, b, *result);
 
     return status;
 }
diff --git a/bundles/remote_services/examples/calculator_shell/src/sub_command.c b/bundles/remote_services/examples/calculator_shell/src/sub_command.c
index 9a1f89d..20e6cf4 100644
--- a/bundles/remote_services/examples/calculator_shell/src/sub_command.c
+++ b/bundles/remote_services/examples/calculator_shell/src/sub_command.c
@@ -64,7 +64,7 @@ bool subCommand_execute(void *handle, const char *const_line, FILE *out, FILE *e
             data.rc = 0;
             bool called = celix_bundleContext_useService(context, CALCULATOR_SERVICE, &data, calcCallback);
             if (called && data.rc == 0) {
-                fprintf(out, "CALCULATOR_SHELL: Add: %f + %f = %f\n", data.a, data.b, data.result);
+                fprintf(out, "CALCULATOR_SHELL: Sub: %f - %f = %f\n", data.a, data.b, data.result);
             } else if (!called) {
                 fprintf(err, "Sub: calculator service not available\n");
                 ok = false;