Commit adecb3e2 authored by Jihun Ha's avatar Jihun Ha Committed by Madan Lanka

Update the things manager code not to produce warning messages in compilation

It is shown that most of warning messages are produced by an existance
of unused parameters in a function. Not to produce the warning message, I
make the unused parameters being commented.
Additionally, fix potential defects in things manager with
CID 65806, 81664, 81560, 82257.

Change-Id: Ie460630d0dc3306087b87b2dd5bb314b1844bc1b
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3681Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 7f1e35f9
......@@ -220,6 +220,9 @@ void RemoveScheduledResource(ScheduledResourceInfo **head,
if (del == NULL)
{
#ifndef WITH_ARDUINO
pthread_mutex_unlock(&lock);
#endif
return;
}
......@@ -536,7 +539,7 @@ OCStackResult ExtractKeyValueFromRequest(OCEntityHandlerRequest *ehRequest,
{
OCStackResult result = OC_STACK_OK;
char *actionSetStr;
char *actionSetStr = NULL;
if( NULL == ehRequest->payload )
{
......@@ -1319,21 +1322,29 @@ OCStackResult BuildCollectionGroupActionCBORResponse(
OC_LOG(INFO, TAG, "Building New Call Info.");
memset(schedule, 0,
sizeof(ScheduledResourceInfo));
#ifndef WITH_ARDUINO
pthread_mutex_lock(&lock);
#endif
schedule->resource = resource;
schedule->actionset = actionset;
schedule->ehRequest =
(OCServerRequest*) ehRequest->requestHandle;
#ifndef WITH_ARDUINO
pthread_mutex_unlock(&lock);
#endif
if (delay > 0)
{
OC_LOG_V(INFO, TAG, "delay_time is %lf seconds.",
actionset->timesteps);
#ifndef WITH_ARDUINO
pthread_mutex_lock(&lock);
#endif
schedule->time = registerTimer(delay,
&schedule->timer_id,
&DoScheduledGroupAction);
#ifndef WITH_ARDUINO
pthread_mutex_unlock(&lock);
#endif
AddScheduledResource(&scheduleResourceList,
schedule);
stackRet = OC_STACK_OK;
......
......@@ -81,7 +81,7 @@ public:
}
}
void setBootstrapRepresentation(OCRepresentation& rep)
void setBootstrapRepresentation(OCRepresentation& /*rep*/)
{
// Not allowed
}
......
......@@ -70,7 +70,7 @@ void timeCheck(int timeSec)
pthread_mutex_unlock(&mutex_lock);
}
void onReboot(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
void onReboot(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
pthread_mutex_lock(&mutex_lock);
isWaiting = 0;
......@@ -85,8 +85,7 @@ void onReboot(const HeaderOptions& headerOptions, const OCRepresentation& rep, c
std::cout << "\t\tReboot:" << rep.getValue< std::string >("value") << std::endl;
}
void onFactoryReset(const HeaderOptions& headerOptions, const OCRepresentation& rep,
const int eCode)
void onFactoryReset(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
pthread_mutex_lock(&mutex_lock);
isWaiting = 0;
......@@ -101,7 +100,7 @@ void onFactoryReset(const HeaderOptions& headerOptions, const OCRepresentation&
std::cout << "\t\tFactoryReset:" << rep.getValue< std::string >("value") << std::endl;
}
void onUpdate(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
void onUpdate(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
pthread_mutex_lock(&mutex_lock);
isWaiting = 0;
......@@ -126,7 +125,7 @@ void onUpdate(const HeaderOptions& headerOptions, const OCRepresentation& rep, c
std::cout << "\t\tRegion:" << rep.getValue< std::string >("r") << std::endl;
}
void onGet(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
void onGet(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
pthread_mutex_lock(&mutex_lock);
isWaiting = 0;
......@@ -277,7 +276,7 @@ void onFoundCandidateResource(std::vector< std::shared_ptr< OCResource > > resou
pthread_mutex_unlock(&mutex_lock);
}
int main(int argc, char* argv[])
int main()
{
std::string str_steps;
......
......@@ -217,7 +217,7 @@ OCEntityHandlerResult entityHandlerForResource(std::shared_ptr< OCResourceReques
}
// callback handler on GET request
void onBootstrap(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
void onBootstrap(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
pthread_mutex_lock(&mutex_lock);
isWaiting = 0;
......@@ -238,7 +238,7 @@ void onBootstrap(const HeaderOptions& headerOptions, const OCRepresentation& rep
defaultRegion = rep.getValue< std::string >("r");
defaultCurrency = rep.getValue< std::string >("c");
std::cout << "\DeviceName : " << defaultDeviceName << std::endl;
std::cout << "\tDeviceName : " << defaultDeviceName << std::endl;
std::cout << "\tLocation : " << defaultLocation << std::endl;
std::cout << "\tLocationName : " << defaultLocationName << std::endl;
std::cout << "\tCurrency : " << defaultCurrency << std::endl;
......
......@@ -139,7 +139,7 @@ public:
}
}
void setRepresentation(OCRepresentation& rep)
void setRepresentation(OCRepresentation& /*rep*/)
{
// AttributeMap attributeMap = rep.getAttributeMap();
// if(rep.getValue("level", m_pressure) == true)
......@@ -169,7 +169,7 @@ public:
// Create the instance of the resource class (in this case instance of class 'BookmarkResource').
BookmarkResource myBookmarkResource;
void* ObserveHandler(void *param)
void* ObserveHandler(void* /*param*/)
{
while (startedThread)
{
......
......@@ -134,7 +134,7 @@ void foundResource(std::shared_ptr<OCResource> resource)
}
}
void onGet(const HeaderOptions& opt, const OCRepresentation &rep,
void onGet(const HeaderOptions& /*opt*/, const OCRepresentation &/*rep*/,
const int eCode)
{
cout << "\nonGet" << endl;
......@@ -144,7 +144,7 @@ void onGet(const HeaderOptions& opt, const OCRepresentation &rep,
cout << "\tInvalid parameter." << endl;
}
void onPut(const HeaderOptions& headerOptions, const OCRepresentation& rep,
void onPut(const HeaderOptions& /*opt*/, const OCRepresentation &/*rep*/,
const int eCode)
{
cout << "\nonPut" << endl;
......@@ -154,8 +154,8 @@ void onPut(const HeaderOptions& headerOptions, const OCRepresentation& rep,
cout << "\tInvalid parameter." << endl;
}
void onPost(const HeaderOptions& headerOptions, const OCRepresentation& rep,
const int eCode)
void onPost(const HeaderOptions& /*opt*/, const OCRepresentation &rep,
const int /*eCode*/)
{
printf("\nonPost\n");
......@@ -259,7 +259,7 @@ void CancelRecursive_allBulbOn()
groupMgr->cancelActionSet(g_resource, "AllBulbOnRecursiveCall", &onPost);
}
void onObserve(const HeaderOptions headerOptions, const OCRepresentation& rep,
void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& rep,
const int& eCode, const int& sequenceNumber)
{
if (eCode == OC_STACK_OK)
......
......@@ -291,7 +291,7 @@ void * handleSlowResponse(void *param, std::shared_ptr< OCResourceRequest > pReq
return NULL;
}
int main(int argc, char* argv[])
int main()
{
// Create PlatformConfig object
PlatformConfig cfg
......
......@@ -277,7 +277,7 @@ std::map< std::string, CollectionPresenceCallback > presenceCallbacks;
// Callback to presence
void GroupManager::collectionPresenceHandler(OCStackResult result, const unsigned int nonce,
const std::string& hostAddress, std::string host, std::string uri)
const std::string& /*hostAddress*/, std::string host, std::string uri)
{
std::cout << "uri : " << uri << std::endl;
std::cout << "host : " << host << std::endl;
......@@ -385,7 +385,7 @@ void GroupManager::checkCollectionRepresentation(const OCRepresentation& rep,
}
}
void GroupManager::onGetForPresence(const HeaderOptions& headerOptions,
void GroupManager::onGetForPresence(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& rep, const int eCode, CollectionPresenceCallback callback)
{
if (eCode == OC_STACK_OK)
......
......@@ -199,8 +199,8 @@ namespace OIC
return newUri;
}
void ThingsConfiguration::onDeleteActionSet(const HeaderOptions& headerOptions,
const OCRepresentation& rep, const int eCode, std::string conf)
void ThingsConfiguration::onDeleteActionSet(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& /*rep*/, const int /*eCode*/, std::string conf)
{
std::shared_ptr < OCResource > resource = getResource(conf);
......
......@@ -315,8 +315,8 @@ namespace OIC
}
}
void ThingsMaintenance::onDeleteGroupAction(const HeaderOptions& headerOptions,
const OCRepresentation& rep, const int eCode, std::string mnt)
void ThingsMaintenance::onDeleteGroupAction(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& /*rep*/, const int eCode, std::string mnt)
{
if (eCode != OC_STACK_OK)
{
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment