celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/2] celix git commit: CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout.
Date Fri, 16 Oct 2015 11:31:55 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 48558e8bc -> 2963e3c28


CELIX-237: Added interface check to that method must return an int. This to always be able
to throw "exceptions". disabled printing dyn_types to stdout.


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

Branch: refs/heads/develop
Commit: 75773baf300fea80a790efa0d7f53a7acb68ef86
Parents: f60ca0d
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Fri Oct 16 13:26:47 2015 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Fri Oct 16 13:26:47 2015 +0200

----------------------------------------------------------------------
 .../dynamic_function_interface/dyn_interface.c           | 11 +++++++++++
 .../dynamic_function_interface_tst/dyn_type_tests.cpp    |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
index 9bb7bcc..823957b 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
@@ -95,6 +95,17 @@ static int dynInterface_checkInterface(dyn_interface_type *intf) {
             status = ERROR;
             LOG_ERROR("Parse Error. There must be a header section with a type, version and
name entry");
         }
+
+        struct method_entry *mEntry = NULL;
+        TAILQ_FOREACH(mEntry, &intf->methods, entries) {
+            dyn_type *type = dynFunction_returnType(mEntry->dynFunc);
+            int descriptor = dynType_descriptorType(type);
+            if (descriptor != 'N') {
+                status = ERROR;
+                LOG_ERROR("Parse Error. Only method with a return type 'N' (native int) are
supported. Got return type '%c'\n", descriptor);
+                break;
+            }
+        }
     }
 
     return status;

http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp
b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp
index 9cf81c5..4b9bd41 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp
@@ -43,7 +43,7 @@ extern "C" {
         }
 
         FILE *stream = fopen("/dev/null", "w");
-        dynType_print(type, stdout);
+        dynType_print(type, stream);
         fclose(stream);
         dynType_destroy(type);
         //printf("--\n\n");


Mime
View raw message