[iotcon] fix build error at some destory api. void -> int (native ACR-764) 05/87205/1 accepted/tizen/common/20160907.154130 submit/tizen/20160907.005039
authorjk.pu <jk.pu@samsung.com>
Wed, 7 Sep 2016 04:27:32 +0000 (13:27 +0900)
committerjk.pu <jk.pu@samsung.com>
Wed, 7 Sep 2016 04:28:16 +0000 (13:28 +0900)
Change-Id: I105288397b461515df0eb1589cc951084561b7cd
Signed-off-by: jk.pu <jk.pu@samsung.com>
src/iotcon/iotcon_utils.cc

index 39cb866..1436236 100644 (file)
@@ -206,7 +206,7 @@ TizenResult IotconUtils::ArrayToInterfaces(const picojson::array& i, iotcon_reso
     LogAndReturnTizenError(result, ("iotcon_resource_interfaces_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_resource_interfaces_h>::type, void(*)(iotcon_resource_interfaces_h)> ptr{interfaces, &iotcon_resource_interfaces_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_resource_interfaces_h>::type, int(*)(iotcon_resource_interfaces_h)> ptr{interfaces, &iotcon_resource_interfaces_destroy};
 
   for (const auto& iter : i) {
     if (!iter.is<std::string>()) {
@@ -256,7 +256,7 @@ TizenResult IotconUtils::ArrayToTypes(const picojson::array& types, iotcon_resou
     LogAndReturnTizenError(result, ("iotcon_resource_types_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_resource_types_h>::type, void(*)(iotcon_resource_types_h)> ptr{resource_types, &iotcon_resource_types_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_resource_types_h>::type, int(*)(iotcon_resource_types_h)> ptr{resource_types, &iotcon_resource_types_destroy};
 
   for (const auto& iter : types) {
     if (!iter.is<std::string>()) {
@@ -1078,7 +1078,7 @@ common::TizenResult IotconUtils::QueryFromJson(const picojson::object& source, i
   if (!result) {
     LogAndReturnTizenError(result, ("iotcon_query_create() failed"));
   }
-  std::unique_ptr<std::remove_pointer<iotcon_query_h>::type, void(*)(iotcon_query_h)>
+  std::unique_ptr<std::remove_pointer<iotcon_query_h>::type, int(*)(iotcon_query_h)>
   query_ptr(query, &iotcon_query_destroy); // automatically release the memory
   {
     // resourceType
@@ -1200,7 +1200,7 @@ common::TizenResult IotconUtils::RepresentationFromResource(const ResourceInfoPt
     LogAndReturnTizenError(result, ("iotcon_representation_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_representation_h>::type, void(*)(iotcon_representation_h)> ptr{representation, &iotcon_representation_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_representation_h>::type, int(*)(iotcon_representation_h)> ptr{representation, &iotcon_representation_destroy};
 
   {
     char* uri_path = nullptr;
@@ -1306,7 +1306,7 @@ common::TizenResult IotconUtils::AttributesFromJson(const picojson::object& s,
     LogAndReturnTizenError(result, ("iotcon_attributes_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_attributes_h>::type, void(*)(iotcon_attributes_h)> ptr{attributes, &iotcon_attributes_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_attributes_h>::type, int(*)(iotcon_attributes_h)> ptr{attributes, &iotcon_attributes_destroy};
 
   for (const auto& property : s) {
     const auto& key = property.first;
@@ -1416,7 +1416,7 @@ common::TizenResult IotconUtils::StateListFromJson(const picojson::array& l,
     LogAndReturnTizenError(result, ("iotcon_list_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_list_h>::type, void(*)(iotcon_list_h)> ptr{list, &iotcon_list_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_list_h>::type, int(*)(iotcon_list_h)> ptr{list, &iotcon_list_destroy};
 
   int position = 0;
 
@@ -1628,7 +1628,7 @@ common::TizenResult IotconUtils::OptionsFromJson(const picojson::array& o,
     LogAndReturnTizenError(result, ("iotcon_options_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_options_h>::type, void(*)(iotcon_options_h)> ptr{options, &iotcon_options_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_options_h>::type, int(*)(iotcon_options_h)> ptr{options, &iotcon_options_destroy};
 
   // we ignore values with incorrect types
   // TODO: should we convert them in JS?
@@ -1661,7 +1661,7 @@ common::TizenResult IotconUtils::RepresentationFromJson(const picojson::object&
     LogAndReturnTizenError(result, ("iotcon_representation_create() failed"));
   }
 
-  std::unique_ptr<std::remove_pointer<iotcon_representation_h>::type, void(*)(iotcon_representation_h)> ptr{representation, &iotcon_representation_destroy};
+  std::unique_ptr<std::remove_pointer<iotcon_representation_h>::type, int(*)(iotcon_representation_h)> ptr{representation, &iotcon_representation_destroy};
 
   {
     const auto& uri_path = r.find(kUriPath);