Merge "Enabling build of simpleclientblescan application" into tizen
[platform/upstream/iotivity.git] / examples / OICMiddle / LineInput.cpp
index 52a8528..184258b 100644 (file)
@@ -52,9 +52,8 @@ int LineInput::run()
     while (true) {
         fputs(">", stdout);
         len = 0;
-        getline(&line, &len, stdin);
-        int n = strlen(line);
-        if (!n)
+        const ssize_t n = getline(&line, &len, stdin);
+        if (n <= 0)
             continue;
         if (m_observer) {
             m_observer->cancelObserve();
@@ -116,7 +115,7 @@ LineResult LineInput::processLine(string command, stringstream& result, observec
     return processUnrecognized(elems, result);
 }
 
-LineResult LineInput::processHelp(elements_t& elems, stringstream& ss)
+LineResult LineInput::processHelp(elements_t& /*elems*/, stringstream& ss)
 {
     ss << "\nUsage:\n"
                 "\tfind\t\tFind resources\n"
@@ -139,7 +138,7 @@ LineResult LineInput::processUnrecognized(elements_t& elems, stringstream& ss)
     return LR_Unrecognized;
 }
 
-LineResult LineInput::processFind(elements_t& elems, stringstream& ss)
+LineResult LineInput::processFind(elements_t& /*elems*/, stringstream& /*ss*/)
 {
     m_client->findResources();
     return LR_OK;
@@ -156,7 +155,7 @@ void LineInput::registerResourceWithServer(std::string & url) {
     m_server->registerResource(url, resType, iface);
 }
 
-LineResult LineInput::processShow(elements_t& elems, stringstream& ss)
+LineResult LineInput::processShow(elements_t& /*elems*/, stringstream& ss)
 {
     int index = 0;
     m_resourceList.clear();
@@ -236,7 +235,7 @@ LineResult LineInput::processGet(elements_t& elems, stringstream& ss)
         return LR_Timeout;
     }
 
-    std::string jsonRep = wreq->m_rep.getJSONRepresentation();
+    std::string jsonRep ;//= wreq->m_rep.getJSONRepresentation();
     //ss << jsonRep << endl;
     printJSONAsTable(jsonRep);
         return LR_OK;
@@ -329,7 +328,7 @@ LineResult LineInput::processCancel(elements_t& elems, stringstream& ss)
     return LR_OK;
 }
 
-WrapResource *LineInput::resolveResource(string resID, stringstream& ss)
+WrapResource *LineInput::resolveResource(string resID, stringstream& /*ss*/)
 {
     size_t len;
     string useID = resID;
@@ -352,12 +351,16 @@ WrapResource *LineInput::resolveResource(string resID, stringstream& ss)
     return it->second;
 }
 
-void LineInput::obsCB(token_t token, const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode, const int sequenceNumber)
+void LineInput::obsCB(token_t /*token*/,
+                      const HeaderOptions& /*headerOptions*/,
+                      const OCRepresentation& /*rep*/,
+                      const int eCode,
+                      const int sequenceNumber)
 {
     if (!m_observer)
         return;
     cout << "cb " << eCode << " " << sequenceNumber << '\n';
-    cout << rep.getJSONRepresentation() << "\n";
+    //cout << rep.getJSONRepresentation() << "\n";
 }
 
 ParseState LineInput::finishElem(char*& e, elements_t& elems)
@@ -382,7 +385,7 @@ ParseState LineInput::putCharInElem(char c, char *& e, ParseState newState)
 LineResult LineInput::parseLine(string lineIn, elements_t& elems)
 {
     const char *d;
-    char c, *e, delim;
+    char c, *e, delim = 0;
     bool isSep1, isSep2;
     size_t len = lineIn.size();
     ParseState state = PS_Between;