[Cpplint] Re-enable style checker for download and fix some errors.
authorHalton Huo <halton.huo@intel.com>
Fri, 6 Jun 2014 01:47:35 +0000 (09:47 +0800)
committerHalton Huo <halton.huo@intel.com>
Fri, 6 Jun 2014 03:46:59 +0000 (11:46 +0800)
callhistory/callhistory_mobile.cc
content/content_filter.cc
download/download_instance.cc
download/download_instance.h
download/download_instance_tizen.cc
mediaserver/mediaserver_instance.h
speech/speech_instance.h
tools/check-coding-style

index cf74f51..b4cfd16 100644 (file)
@@ -617,8 +617,8 @@ void NotifyDatabaseChange(const char* view, char* changes, void* user_data) {
       case CONTACTS_CHANGE_INSERTED:
         ins = true;
       case CONTACTS_CHANGE_UPDATED:
-        if (!ins)
-        if (check(contacts_db_get_record(CALLH_VIEW_URI, uid, &record))) {
+        if (!ins &&
+            check(contacts_db_get_record(CALLH_VIEW_URI, uid, &record))) {
           picojson::value::object val;
           if (check(SerializeEntry(record, val))) {
             if (ins)
@@ -656,7 +656,6 @@ void NotifyDatabaseChange(const char* view, char* changes, void* user_data) {
 
 }  // namespace
 
-
 bool CallHistoryInstance::CheckBackend() {
   if (backendConnected_)
     return true;
index 0d0c91e..496dad0 100644 (file)
@@ -83,13 +83,13 @@ std::string ContentFilter::convert(const picojson::value& jsonFilter) {
 
   // Tizen requires this weird mapping on type
   if (attributeName == "type") {
-    if (matchValue == "IMAGE")
+    if (matchValue == "IMAGE") {
       matchValue = "0";
-    else if (matchValue == "VIDEO")
+    } else if (matchValue == "VIDEO") {
       matchValue = "1";
-    else if (matchValue == "AUDIO")
+    } else if (matchValue == "AUDIO") {
       matchValue = "3";
-    else if (matchValue == "OTHER") {
+    else if (matchValue == "OTHER") {
       matchValue = "4";
     } else {
       std::cerr << "Filter ERR: unknown media type " << matchValue << std::endl;
index d5de84f..62a8439 100644 (file)
@@ -119,14 +119,14 @@ void DownloadInstance::OnStartInfo(int download_id, void* user_param) {
   const std::string uid(args->download_uid);
   DownloadItemRefPtr item = args->instance->downloads_[uid];
 
-  long long unsigned file_size = 0;
+  long long unsigned file_size = 0;  // NOLINT
   CHECK(download_get_content_size(download_id, &file_size), args);
   item->file_size = file_size;
 }
 
 // static
 void DownloadInstance::OnProgressInfo(int download_id,
-                                      long long unsigned received,
+                                      long long unsigned received,  // NOLINT
                                       void* user_param) {
   DownloadArgs* args = static_cast<DownloadArgs*>(user_param);
   DownloadItemRefPtr item =
index 2b00f78..558dd6b 100644 (file)
@@ -19,7 +19,7 @@ namespace picojson {
 
 class value;
 
-}  // namespace
+}  // namespace picojson
 
 class DownloadInstance : public common::Instance {
  public:
@@ -50,7 +50,7 @@ class DownloadInstance : public common::Instance {
                              download_state_e state,
                              void* user_data);
   static void OnProgressInfo(int download_id,
-                             long long unsigned received,
+                             long long unsigned received,  // NOLINT
                              void* user_param);
   static void OnStartInfo(int download_id, void* user_param);
   static void OnFinishedInfo(int download_id, void* user_param);
@@ -69,7 +69,7 @@ class DownloadInstance : public common::Instance {
 
     int download_id;
     char* file_type;
-    long long unsigned file_size;
+    long long unsigned file_size;  // NOLINT
     char* tmp_saved_path;
     char* content_name;
 
index a03d094..cde9479 100644 (file)
@@ -33,8 +33,10 @@ const std::string DownloadInstance::GetFullDestinationPath(
   // TODO(hdq): User should be able to choose store to external storage
   //            i.e. /opt/storage/sdcard/Downloads
   const std::string default_folder("Downloads");
-  const std::string location = destination.empty() ? default_folder : destination;
-  std::string path = tzplatform_getenv(TZ_USER_CONTENT) + GetActualFolder(location);
+  const std::string location =
+      destination.empty() ? default_folder : destination;
+  std::string path =
+      tzplatform_getenv(TZ_USER_CONTENT) + GetActualFolder(location);
 
   // Create path if not exist
   struct stat path_stat;
index 16ef6fa..7f2068d 100644 (file)
@@ -6,7 +6,8 @@
 #define MEDIASERVER_MEDIASERVER_INSTANCE_H_
 
 #include <glib.h>
-#include <thread>
+#include <thread>  // NOLINT
+
 #include "common/extension.h"
 
 class MediaServerManager;
index 3fd3f23..dc70cda 100644 (file)
@@ -6,7 +6,7 @@
 #define SPEECH_SPEECH_INSTANCE_H_
 
 #include <glib.h>
-#include <thread>
+#include <thread>  // NOLINT
 
 #include "common/extension.h"
 #include "common/picojson.h"
index 3dfa190..29a914a 100755 (executable)
@@ -25,7 +25,6 @@ cpplint.py --filter="$FILTERS" $(find . \
                                ! -path './packaging' \
                                ! -name 'XW_Extension*.h' \
                                ! -name 'picojson.*' \
-                               ! -path './download/*' \
                                \( -name '*.h' -o -name '*.cc' \) )
 
 # Return to previous dir and return the code returned by cpplint.py