I'd like you to do a code review. Please review the following patch:
commit 86533d474090658e642d3225093a081f697ce1be
Author: Tiger Dong <xd...@google.com>
Date: Mon Dec 28 17:24:27 2009 +0800
Add -Wextra flag.
diff --git a/cmake/Configure.cmake b/cmake/Configure.cmake
index 10c78f5..e7578b3 100644
--- a/cmake/Configure.cmake
+++ b/cmake/Configure.cmake
@@ -169,7 +169,7 @@ ENDIF(GGL_DEFAULT_SSL_CA_FILE)
INCLUDE(CheckCCompilerFlag)
IF(UNIX)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Werror -Wconversion")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Werror -Wconversion -Wextra")
# No "-Wall -Werror" for C flags, to avoid third_party code break.
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(PROJECT_RESOURCE_DIR share/${PRODUCT_NAME})
diff --git a/extensions/curl_xml_http_request/curl_xml_http_request.cc b/extensions/curl_xml_http_request/curl_xml_http_request.cc
index be3e038..ab3b4e2 100644
--- a/extensions/curl_xml_http_request/curl_xml_http_request.cc
+++ b/extensions/curl_xml_http_request/curl_xml_http_request.cc
@@ -513,6 +513,8 @@ class XMLHttpRequest : public ScriptableHelper<XMLHttpRequestInterface> {
worker_context_(*worker_context) {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
if (worker_context_.this_p->curl_ == worker_context_.curl &&
worker_context_.this_p->WriteHeader(data_) != data_.size()) {
// WriteHeader() failed. Terminate the request.
@@ -521,6 +523,8 @@ class XMLHttpRequest : public ScriptableHelper<XMLHttpRequestInterface> {
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
@@ -539,6 +543,8 @@ class XMLHttpRequest : public ScriptableHelper<XMLHttpRequestInterface> {
status_(status) {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
if (worker_context_.this_p->curl_ == worker_context_.curl &&
worker_context_.this_p->WriteBody(data_, status_, effective_url_) !=
data_.size()) {
@@ -1102,11 +1108,18 @@ class XMLHttpRequestFactory : public XMLHttpRequestFactoryInterface {
static void Lock(CURL *handle, curl_lock_data data,
curl_lock_access access, void *userptr) {
+ GGL_UNUSED(handle);
+ GGL_UNUSED(data);
+ GGL_UNUSED(access);
+ GGL_UNUSED(userptr);
// This synchronization scope is bigger than optimal, but is much simpler.
pthread_mutex_lock(&mutex_);
}
static void Unlock(CURL *handle, curl_lock_data data, void *userptr) {
+ GGL_UNUSED(handle);
+ GGL_UNUSED(data);
+ GGL_UNUSED(userptr);
pthread_mutex_unlock(&mutex_);
}
diff --git a/extensions/dbus_script_class/scriptable_dbus_object.cc b/extensions/dbus_script_class/scriptable_dbus_object.cc
index 653917e..7d4444f 100644
--- a/extensions/dbus_script_class/scriptable_dbus_object.cc
+++ b/extensions/dbus_script_class/scriptable_dbus_object.cc
@@ -183,6 +183,7 @@ class ScriptableDBusObject::Impl : public SmallObject<> {
return ResultVariant(Variant(result));
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false;
}
private:
@@ -227,6 +228,7 @@ class ScriptableDBusObject::Impl : public SmallObject<> {
return Variant::TYPE_INT64;
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
// No use.
return false;
}
diff --git a/extensions/default_framework/default_framework.cc b/extensions/default_framework/default_framework.cc
index 900288e..3443efb 100644
--- a/extensions/default_framework/default_framework.cc
+++ b/extensions/default_framework/default_framework.cc
@@ -67,12 +67,16 @@ class DefaultMemory : public MemoryInterface {
class DefaultPerfmon : public PerfmonInterface {
public:
- virtual Variant GetCurrentValue(const char *counter_path) { return Variant(0); }
+ virtual Variant GetCurrentValue(const char *counter_path) {
+ GGL_UNUSED(counter_path);
+ return Variant(0);
+ }
virtual int AddCounter(const char *counter_path, CallbackSlot *slot) {
+ GGL_UNUSED(counter_path);
delete slot;
return -1;
}
- virtual void RemoveCounter(int id) { }
+ virtual void RemoveCounter(int id) { GGL_UNUSED(id); }
};
class DefaultPower : public PowerInterface {
@@ -88,14 +92,20 @@ class DefaultProcesses : public ProcessesInterface {
public:
virtual void Destroy() { }
virtual int GetCount() const { return 0; }
- virtual ProcessInfoInterface *GetItem(int index) { return NULL; }
+ virtual ProcessInfoInterface *GetItem(int index) {
+ GGL_UNUSED(index);
+ return NULL;
+ }
};
class DefaultProcess : public ProcessInterface {
public:
virtual ProcessesInterface *EnumerateProcesses() { return &default_processes_; }
virtual ProcessInfoInterface *GetForeground() { return NULL; }
- virtual ProcessInfoInterface *GetInfo(int pid) { return NULL; }
+ virtual ProcessInfoInterface *GetInfo(int pid) {
+ GGL_UNUSED(pid);
+ return NULL;
+ }
private:
DefaultProcesses default_processes_;
};
@@ -107,18 +117,21 @@ class DefaultWireless : public WirelessInterface {
virtual bool EnumerationSupported() const { return false; }
virtual int GetAPCount() const { return 0; }
virtual WirelessAccessPointInterface *GetWirelessAccessPoint(int index) {
+ GGL_UNUSED(index);
return NULL;
}
virtual std::string GetName() const { return "Unknown"; }
virtual std::string GetNetworkName() const { return "Unknwon"; }
virtual int GetSignalStrength() const { return 0; }
virtual void ConnectAP(const char *ap_name, Slot1<void, bool> *callback) {
+ GGL_UNUSED(ap_name);
if (callback) {
(*callback)(false);
delete callback;
}
}
virtual void DisconnectAP(const char *ap_name, Slot1<void, bool> *callback) {
+ GGL_UNUSED(ap_name);
if (callback) {
(*callback)(false);
delete callback;
@@ -146,76 +159,152 @@ class DefaultFileSystem : public FileSystemInterface {
public:
virtual DrivesInterface *GetDrives() { return NULL; }
virtual std::string BuildPath(const char *path, const char *name) {
+ GGL_UNUSED(path);
+ GGL_UNUSED(name);
+ return "";
+ }
+ virtual std::string GetDriveName(const char *path) {
+ GGL_UNUSED(path);
+ return "";
+ }
+ virtual std::string GetParentFolderName(const char *path) {
+ GGL_UNUSED(path);
+ return "";
+ }
+ virtual std::string GetFileName(const char *path) {
+ GGL_UNUSED(path);
+ return "";
+ }
+ virtual std::string GetBaseName(const char *path) {
+ GGL_UNUSED(path);
+ return "";
+ }
+ virtual std::string GetExtensionName(const char *path) {
+ GGL_UNUSED(path);
+ return "";
+ }
+ virtual std::string GetAbsolutePathName(const char *path) {
+ GGL_UNUSED(path);
return "";
}
- virtual std::string GetDriveName(const char *path) { return ""; }
- virtual std::string GetParentFolderName(const char *path) { return ""; }
- virtual std::string GetFileName(const char *path) { return ""; }
- virtual std::string GetBaseName(const char *path) { return ""; }
- virtual std::string GetExtensionName(const char *path) { return ""; }
- virtual std::string GetAbsolutePathName(const char *path) { return ""; }
virtual std::string GetTempName() { return ""; }
- virtual bool DriveExists(const char *drive_spec) { return false; }
- virtual bool FileExists(const char *file_spec) { return false; }
- virtual bool FolderExists(const char *folder_spec) { return false; }
- virtual DriveInterface *GetDrive(const char *drive_spec) { return NULL; }
- virtual FileInterface *GetFile(const char *file_path) { return NULL; }
- virtual FolderInterface *GetFolder(const char *folder_path) { return NULL; }
+ virtual bool DriveExists(const char *drive_spec) {
+ GGL_UNUSED(drive_spec);
+ return false;
+ }
+ virtual bool FileExists(const char *file_spec) {
+ GGL_UNUSED(file_spec);
+ return false;
+ }
+ virtual bool FolderExists(const char *folder_spec) {
+ GGL_UNUSED(folder_spec);
+ return false;
+ }
+ virtual DriveInterface *GetDrive(const char *drive_spec) {
+ GGL_UNUSED(drive_spec);
+ return NULL;
+ }
+ virtual FileInterface *GetFile(const char *file_path) {
+ GGL_UNUSED(file_path);
+ return NULL;
+ }
+ virtual FolderInterface *GetFolder(const char *folder_path) {
+ GGL_UNUSED(folder_path);
+ return NULL;
+ }
virtual FolderInterface *GetSpecialFolder(SpecialFolder special_folder) {
+ GGL_UNUSED(special_folder);
return NULL;
}
- virtual bool DeleteFile(const char *file_spec, bool force) { return false; }
+ virtual bool DeleteFile(const char *file_spec, bool force) {
+ GGL_UNUSED(file_spec);
+ GGL_UNUSED(force);
+ return false;
+ }
virtual bool DeleteFolder(const char *folder_spec, bool force) {
+ GGL_UNUSED(folder_spec);
+ GGL_UNUSED(force);
+ return false;
+ }
+ virtual bool MoveFile(const char *source, const char *dest) {
+ GGL_UNUSED(source);
+ GGL_UNUSED(dest);
return false;
}
- virtual bool MoveFile(const char *source, const char *dest) { return false; }
virtual bool MoveFolder(const char *source, const char *dest) {
+ GGL_UNUSED(source);
+ GGL_UNUSED(dest);
return false;
}
virtual bool CopyFile(const char *source, const char *dest,
bool overwrite) {
+ GGL_UNUSED(source);
+ GGL_UNUSED(dest);
+ GGL_UNUSED(overwrite);
return false;
}
virtual bool CopyFolder(const char *source, const char *dest,
bool overwrite) {
+ GGL_UNUSED(source);
+ GGL_UNUSED(dest);
+ GGL_UNUSED(overwrite);
return false;
}
virtual FolderInterface *CreateFolder(const char *path) {
+ GGL_UNUSED(path);
return NULL;
}
virtual TextStreamInterface *CreateTextFile(const char *filename,
bool overwrite,
bool unicode) {
+ GGL_UNUSED(filename);
+ GGL_UNUSED(overwrite);
+ GGL_UNUSED(unicode);
return NULL;
}
virtual TextStreamInterface *OpenTextFile(const char *filename,
IOMode mode,
bool create,
Tristate format) {
+ GGL_UNUSED(filename);
+ GGL_UNUSED(mode);
+ GGL_UNUSED(create);
+ GGL_UNUSED(format);
return NULL;
}
virtual BinaryStreamInterface *CreateBinaryFile(const char *filename,
bool overwrite) {
+ GGL_UNUSED(filename);
+ GGL_UNUSED(overwrite);
return NULL;
}
virtual BinaryStreamInterface *OpenBinaryFile(const char *filename,
IOMode mode,
bool create) {
+ GGL_UNUSED(filename);
+ GGL_UNUSED(mode);
+ GGL_UNUSED(create);
return NULL;
}
virtual TextStreamInterface *GetStandardStream(StandardStreamType type,
bool unicode) {
+ GGL_UNUSED(type);
+ GGL_UNUSED(unicode);
return NULL;
}
virtual std::string GetFileVersion(const char *filename) {
+ GGL_UNUSED(filename);
return "";
}
};
class DefaultAudio : public AudioInterface {
public:
- virtual AudioclipInterface * CreateAudioclip(const char *src) { return NULL; }
+ virtual AudioclipInterface * CreateAudioclip(const char *src) {
+ GGL_UNUSED(src);
+ return NULL;
+ }
};
class DefaultRuntime : public RuntimeInterface {
@@ -256,6 +345,7 @@ class DefaultUser : public UserInterface {
return false;
}
virtual void SetIdlePeriod(time_t period) {
+ GGL_UNUSED(period);
}
virtual time_t GetIdlePeriod() const {
return 0;
@@ -287,14 +377,17 @@ static ScriptableScreen g_script_screen_(&g_screen_);
static ScriptableUser g_script_user_(&g_user_);
static std::string DefaultGetFileIcon(const char *filename) {
+ GGL_UNUSED(filename);
return std::string("");
}
static std::string DefaultBrowseForFile(const char *filter) {
+ GGL_UNUSED(filter);
return std::string("");
}
static ScriptableArray *DefaultBrowseForFiles(const char *filter) {
+ GGL_UNUSED(filter);
return new ScriptableArray();
}
diff --git a/extensions/default_options/default_options.cc b/extensions/default_options/default_options.cc
index 5c8467a..426bb7f 100644
--- a/extensions/default_options/default_options.cc
+++ b/extensions/default_options/default_options.cc
@@ -151,6 +151,7 @@ class DefaultOptions : public MemoryOptions {
}
bool OnFlushTimer(int timer) {
+ GGL_UNUSED(timer);
// DeleteStorage() sets file_manager_ to NULL.
if (!file_manager_)
return false;
@@ -160,6 +161,7 @@ class DefaultOptions : public MemoryOptions {
}
void OnOptionChange(const char *option) {
+ GGL_UNUSED(option);
changed_ = true;
}
diff --git a/extensions/google_gadget_manager/google_gadget_manager.cc b/extensions/google_gadget_manager/google_gadget_manager.cc
index d5f5e60..a09ac0c 100644
--- a/extensions/google_gadget_manager/google_gadget_manager.cc
+++ b/extensions/google_gadget_manager/google_gadget_manager.cc
@@ -179,6 +179,7 @@ void GoogleGadgetManager::Init() {
}
bool GoogleGadgetManager::OnFreeMetadataTimer(int timer) {
+ GGL_UNUSED(timer);
if (!browser_gadget_) {
// Only free metadata when the gadget browser is not active.
metadata_.FreeMemory();
@@ -226,6 +227,7 @@ void GoogleGadgetManager::ScheduleUpdate(int64_t time) {
}
bool GoogleGadgetManager::OnUpdateTimer(int timer) {
+ GGL_UNUSED(timer);
UpdateGadgetsMetadata(false);
return false;
}
@@ -601,6 +603,7 @@ class AddedTimeUpdater {
public:
AddedTimeUpdater(GadgetInfoMap *map) : map_(map) { }
bool Callback(const char *name, const Variant &value, bool encrypted) {
+ GGL_UNUSED(encrypted);
if (strncmp(name, kGadgetAddedTimeOptionPrefix,
arraysize(kGadgetAddedTimeOptionPrefix) - 1) == 0) {
std::string gadget_id(name);
@@ -1163,6 +1166,7 @@ bool GoogleGadgetManager::OnFirstDailyPing(int timer) {
}
bool GoogleGadgetManager::OnDailyPing(int timer) {
+ GGL_UNUSED(timer);
ASSERT(collector_);
global_options_->PutValue(kLastDailyPingTimeOption,
Variant(main_loop_->GetCurrentTime()));
diff --git a/extensions/gst_audio_framework/gst_audio_framework.cc b/extensions/gst_audio_framework/gst_audio_framework.cc
index dccca38..e251e60 100644
--- a/extensions/gst_audio_framework/gst_audio_framework.cc
+++ b/extensions/gst_audio_framework/gst_audio_framework.cc
@@ -397,6 +397,7 @@ class GstAudioclip : public AudioclipInterface {
}
static gboolean OnNewMessage(GstBus *bus, GstMessage *msg, gpointer object) {
+ GGL_UNUSED(bus);
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_ERROR:
(reinterpret_cast<GstAudioclip*>(object))->OnError(msg);
diff --git a/extensions/gst_video_element/gadget_videosink.cc b/extensions/gst_video_element/gadget_videosink.cc
index 6354fe9..ec8a3ce 100755
--- a/extensions/gst_video_element/gadget_videosink.cc
+++ b/extensions/gst_video_element/gadget_videosink.cc
@@ -62,6 +62,7 @@ class GadgetVideoSink::ImageBuffer {
static void ImageBufferClassInit(gpointer g_class, gpointer class_data)
{
+ GGL_UNUSED(class_data);
GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS(g_class);
mini_object_class->finalize =
(GstMiniObjectFinalizeFunction)Finalize;
@@ -324,6 +325,7 @@ GType GadgetVideoSink::GadgetVideoSinkGetType(void) {
sizeof(GadgetVideoSink),
0,
(GInstanceInitFunc)Init,
+ (GTypeValueTable*)NULL
};
videosink_type = g_type_register_static(GST_TYPE_VIDEO_SINK,
diff --git a/extensions/gst_video_element/gst_video_element.cc b/extensions/gst_video_element/gst_video_element.cc
index af26191..80cc3a8 100755
--- a/extensions/gst_video_element/gst_video_element.cc
+++ b/extensions/gst_video_element/gst_video_element.cc
@@ -492,6 +492,7 @@ GstVideoElement::GstStateToLocalState(GstState state) {
gboolean GstVideoElement::OnNewMessage(GstBus *bus,
GstMessage *msg,
gpointer data) {
+ GGL_UNUSED(bus);
ASSERT(msg && data);
GstVideoElement *object = static_cast<GstVideoElement*>(data);
diff --git a/extensions/gtk_edit_element/gtk_edit_impl.cc b/extensions/gtk_edit_element/gtk_edit_impl.cc
index 703707c..44e38d0 100644
--- a/extensions/gtk_edit_element/gtk_edit_impl.cc
+++ b/extensions/gtk_edit_element/gtk_edit_impl.cc
@@ -905,6 +905,7 @@ void GtkEditImpl::QueueCursorBlink() {
}
bool GtkEditImpl::CursorBlinkCallback(int timer_id) {
+ GGL_UNUSED(timer_id);
-- cursor_blink_status_;
if (cursor_blink_status_ < 0)
cursor_blink_status_ = 2;
@@ -1892,6 +1893,7 @@ void GtkEditImpl::UpdateIMCursorLocation() {
void GtkEditImpl::CommitCallback(GtkIMContext *context, const char *str,
void *gg) {
+ GGL_UNUSED(context);
reinterpret_cast<GtkEditImpl*>(gg)->EnterText(str);
reinterpret_cast<GtkEditImpl*>(gg)->QueueRefresh(false, MINIMAL_ADJUST);
}
@@ -1907,6 +1909,7 @@ gboolean GtkEditImpl::RetrieveSurroundingCallback(GtkIMContext *context,
gboolean GtkEditImpl::DeleteSurroundingCallback(GtkIMContext *context, int offset,
int n_chars, void *gg) {
+ GGL_UNUSED(context);
GtkEditImpl *edit = reinterpret_cast<GtkEditImpl*>(gg);
const char *text = edit->text_.c_str();
int text_length = static_cast<int>(edit->text_.length());
@@ -1927,6 +1930,7 @@ gboolean GtkEditImpl::DeleteSurroundingCallback(GtkIMContext *context, int offse
}
void GtkEditImpl::PreeditStartCallback(GtkIMContext *context, void *gg) {
+ GGL_UNUSED(context);
reinterpret_cast<GtkEditImpl*>(gg)->ResetPreedit();
reinterpret_cast<GtkEditImpl*>(gg)->QueueRefresh(false, MINIMAL_ADJUST);
reinterpret_cast<GtkEditImpl*>(gg)->UpdateIMCursorLocation();
@@ -1953,12 +1957,14 @@ void GtkEditImpl::PreeditChangedCallback(GtkIMContext *context, void *gg) {
}
void GtkEditImpl::PreeditEndCallback(GtkIMContext *context, void *gg) {
+ GGL_UNUSED(context);
reinterpret_cast<GtkEditImpl*>(gg)->ResetPreedit();
reinterpret_cast<GtkEditImpl*>(gg)->QueueRefresh(false, MINIMAL_ADJUST);
}
void GtkEditImpl::PasteCallback(GtkClipboard *clipboard,
const gchar *str, void *gg) {
+ GGL_UNUSED(clipboard);
reinterpret_cast<GtkEditImpl*>(gg)->EnterText(str);
reinterpret_cast<GtkEditImpl*>(gg)->QueueRefresh(false, MINIMAL_ADJUST);
}
diff --git a/extensions/gtk_system_framework/gtk_system_framework.cc b/extensions/gtk_system_framework/gtk_system_framework.cc
index 292201e..5fa6aa6 100644
--- a/extensions/gtk_system_framework/gtk_system_framework.cc
+++ b/extensions/gtk_system_framework/gtk_system_framework.cc
@@ -90,6 +90,7 @@ class GtkSystemBrowseForFileHelper {
// Function to destroy the helper object when framework is destroyed.
void OnFrameworkRefChange(int ref, int change) {
+ GGL_UNUSED(ref);
if (change == 0) {
DLOG("Framework destroyed, delete GtkSystemBrowseForFileHelper object.");
delete this;
diff --git a/extensions/gtkmoz_browser_element/CMakeLists.txt b/extensions/gtkmoz_browser_element/CMakeLists.txt
index 9328794..eed53c3 100644
--- a/extensions/gtkmoz_browser_element/CMakeLists.txt
+++ b/extensions/gtkmoz_browser_element/CMakeLists.txt
@@ -32,6 +32,7 @@ OUTPUT_MODULE(gtkmoz-browser-element)
SET(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wno-non-virtual-dtor -Wno-conversion -fno-strict-aliasing")
+STRING(REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
IF(NOT GTKMOZEMBED_FOUND)
MESSAGE(FATAL "gtkmozembed library not found!")
diff --git a/extensions/html_flash_element/html_flash_element.cc b/extensions/html_flash_element/html_flash_element.cc
index 0a4b5d4..835c95a 100644
--- a/extensions/html_flash_element/html_flash_element.cc
+++ b/extensions/html_flash_element/html_flash_element.cc
@@ -92,6 +92,7 @@ class HtmlFlashElement : public BasicElement {
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(object);
if (owner_ && name_ && owner_->movie_object_.Get()) {
Slot *slot = NULL;
ResultVariant prop = owner_->movie_object_.Get()->GetProperty(name_);
diff --git a/extensions/libxml2_xml_parser/libxml2_xml_parser.cc b/extensions/libxml2_xml_parser/libxml2_xml_parser.cc
index ac94989..74dd217 100644
--- a/extensions/libxml2_xml_parser/libxml2_xml_parser.cc
+++ b/extensions/libxml2_xml_parser/libxml2_xml_parser.cc
@@ -86,6 +86,7 @@ static const char kXMLTagUTF32BE[] = {
static bool g_error_occurred = false;
static std::string g_error_buffer;
static void ErrorFunc(void *ctx, const char *msg, ...) {
+ GGL_UNUSED(ctx);
va_list ap;
va_start(ap, msg);
StringAppendVPrintf(&g_error_buffer, msg, ap);
@@ -692,6 +693,7 @@ class XMLParser : public XMLParserInterface {
const char *encoding_fallback,
std::string *encoding,
std::string *utf8_content) {
+ GGL_UNUSED(filename);
// The caller wants nothing?
if (!encoding && !utf8_content)
return true;
diff --git a/extensions/linux_system_framework/file_system.cc b/extensions/linux_system_framework/file_system.cc
index 747e4a0..bd23b70 100644
--- a/extensions/linux_system_framework/file_system.cc
+++ b/extensions/linux_system_framework/file_system.cc
@@ -196,6 +196,7 @@ static bool CopyFolder(const char *source, const char *dest, bool overwrite) {
// The no_use parameter eases wildcard handling. See OperateWildcard.
static bool MoveFile(const char *source, const char *dest, bool no_use) {
+ GGL_UNUSED(no_use);
ASSERT(source);
ASSERT(*source);
ASSERT(dest);
@@ -224,6 +225,7 @@ static bool MoveFile(const char *source, const char *dest, bool no_use) {
// The no_use parameter eases wildcard handling. See OperateWildcard.
static bool MoveFolder(const char *source, const char *dest, bool no_use) {
+ GGL_UNUSED(no_use);
ASSERT(source);
ASSERT(*source);
ASSERT(dest);
@@ -253,6 +255,7 @@ static bool MoveFolder(const char *source, const char *dest, bool no_use) {
// The no_use parameter eases wildcard handling. See OperateWildcard.
static bool DeleteFile(const char *filename, const char *no_use, bool force) {
+ GGL_UNUSED(no_use);
ASSERT(filename);
ASSERT(*filename);
@@ -263,6 +266,7 @@ static bool DeleteFile(const char *filename, const char *no_use, bool force) {
// The no_use parameter eases wildcard handling. See OperateWildcard.
static bool DeleteFolder(const char *filename, const char *no_use, bool force) {
+ GGL_UNUSED(no_use);
ASSERT(filename);
ASSERT(*filename);
@@ -340,6 +344,7 @@ class TextStream : public TextStreamInterface {
line_(-1),
col_(-1),
readingptr_(0) {
+ GGL_UNUSED(unicode);
if (fd_ != -1) {
line_ = 1;
col_ = 1;
@@ -833,6 +838,7 @@ class Drive : public DriveInterface {
}
virtual bool SetVolumnName(const char *name) {
+ GGL_UNUSED(name);
// TODO: implement this.
return false;
}
@@ -1442,6 +1448,7 @@ std::string FileSystem::BuildPath(const char *path, const char *name) {
}
std::string FileSystem::GetDriveName(const char *path) {
+ GGL_UNUSED(path);
return "";
}
@@ -1526,6 +1533,7 @@ std::string FileSystem::GetTempName() {
}
bool FileSystem::DriveExists(const char *drive_spec) {
+ GGL_UNUSED(drive_spec);
return false;
}
@@ -1569,6 +1577,7 @@ bool FileSystem::FolderExists(const char *folder_spec) {
}
DriveInterface *FileSystem::GetDrive(const char *drive_spec) {
+ GGL_UNUSED(drive_spec);
return NULL;
}
@@ -1729,6 +1738,7 @@ FileSystem::GetStandardStream(StandardStreamType type, bool unicode) {
}
std::string FileSystem::GetFileVersion(const char *filename) {
+ GGL_UNUSED(filename);
return "";
}
diff --git a/extensions/linux_system_framework/perfmon.cc b/extensions/linux_system_framework/perfmon.cc
index 9ddef0b..66c5d6c 100644
--- a/extensions/linux_system_framework/perfmon.cc
+++ b/extensions/linux_system_framework/perfmon.cc
@@ -148,6 +148,8 @@ class CpuUsageWatch : public WatchCallbackInterface {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
double last = current_cpu_usage_;
current_cpu_usage_ = GetCurrentCpuUsage();
@@ -161,6 +163,8 @@ class CpuUsageWatch : public WatchCallbackInterface {
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
// In case the main loop is destroyed before the watch.
watch_id_ = -1;
}
diff --git a/extensions/linux_system_framework/power.cc b/extensions/linux_system_framework/power.cc
index e7579c8..c6337f8 100644
--- a/extensions/linux_system_framework/power.cc
+++ b/extensions/linux_system_framework/power.cc
@@ -117,12 +117,16 @@ Power::~Power() {
void Power::OnBatterySignal(const std::string &name,
int argc, const Variant *argv) {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
if (name == kHalSignalPropertyModified)
LoadBatteryInfo();
}
void Power::OnAcAdapterSignal(const std::string &name,
int argc, const Variant *argv) {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
if (name == kHalSignalPropertyModified)
LoadAcAdapterInfo();
}
diff --git a/extensions/linux_system_framework/process.cc b/extensions/linux_system_framework/process.cc
index c682c9f..e415c4c 100644
--- a/extensions/linux_system_framework/process.cc
+++ b/extensions/linux_system_framework/process.cc
@@ -105,6 +105,7 @@ ProcessesInterface *Process::EnumerateProcesses() {
#ifdef HAVE_X11
static int IgnoreXError(Display *display, XErrorEvent *event) {
+ GGL_UNUSED(display);
DLOG("XError: %lu %d %d %d\n", event->serial, event->error_code,
event->request_code, event->minor_code);
return 0;
diff --git a/extensions/linux_system_framework/user.cc b/extensions/linux_system_framework/user.cc
index 9052d85..e2fff0a 100644
--- a/extensions/linux_system_framework/user.cc
+++ b/extensions/linux_system_framework/user.cc
@@ -154,6 +154,7 @@ static int GetHash(int base, const char *str) {
}
bool User::CheckInputEvents(int watch_id) {
+ GGL_UNUSED(watch_id);
char line[256];
FILE *interrupt_file = fopen(kProcfsInterruptsFile, "r");
if (interrupt_file) {
diff --git a/extensions/linux_system_framework/wireless.cc b/extensions/linux_system_framework/wireless.cc
index edd38c5..eea6cab 100644
--- a/extensions/linux_system_framework/wireless.cc
+++ b/extensions/linux_system_framework/wireless.cc
@@ -765,6 +765,7 @@ class Wireless::Impl {
return result_;
}
bool Callback(int i, const Variant &elm) {
+ GGL_UNUSED(i);
if (elm.type() == Variant::TYPE_STRING) {
std::string con_path = VariantValue<std::string>()(elm);
DBusProxy *con =
@@ -795,6 +796,7 @@ class Wireless::Impl {
return true;
}
bool MatchDeviceCallback(int i, const Variant &dev) {
+ GGL_UNUSED(i);
std::string dev_path;
if (dev.ConvertToString(&dev_path) && dev_path == dev_path_) {
result_ = true;
@@ -962,6 +964,7 @@ class Wireless::Impl {
static bool EnumerateSSIDCallback(int i, const Variant &byte,
std::string *ssid) {
+ GGL_UNUSED(i);
if (byte.type() == Variant::TYPE_INT64) {
ssid->push_back(VariantValue<char>()(byte));
return true;
diff --git a/extensions/qt_edit_element/qt_edit_element.cc b/extensions/qt_edit_element/qt_edit_element.cc
index 05ae2b7..741397c 100644
--- a/extensions/qt_edit_element/qt_edit_element.cc
+++ b/extensions/qt_edit_element/qt_edit_element.cc
@@ -356,7 +356,7 @@ CanvasInterface::Alignment QtEditElement::GetAlign() const {
return CanvasInterface::ALIGN_LEFT;
}
-void QtEditElement::SetAlign(CanvasInterface::Alignment align) {
+void QtEditElement::SetAlign(CanvasInterface::Alignment) {
// TODO
}
@@ -365,7 +365,7 @@ CanvasInterface::VAlignment QtEditElement::GetVAlign() const {
return CanvasInterface::VALIGN_TOP;
}
-void QtEditElement::SetVAlign(CanvasInterface::VAlignment valign) {
+void QtEditElement::SetVAlign(CanvasInterface::VAlignment) {
// TODO
}
diff --git a/extensions/qt_script_runtime/converter.cc b/extensions/qt_script_runtime/converter.cc
index 33e8032..d363151 100755
--- a/extensions/qt_script_runtime/converter.cc
+++ b/extensions/qt_script_runtime/converter.cc
@@ -39,6 +39,7 @@ namespace qt {
static bool ConvertJSToNativeVoid(const QScriptValue &qval,
Variant *val) {
+ GGL_UNUSED(qval);
*val = Variant();
return true;
}
@@ -297,6 +298,8 @@ bool ConvertJSArgsToNative(QScriptContext *ctx, Slot *slot,
static bool ConvertNativeToJSVoid(QScriptEngine *engine,
const Variant &val, QScriptValue *qval) {
+ GGL_UNUSED(engine);
+ GGL_UNUSED(val);
*qval = QScriptValue();
return true;
}
@@ -387,6 +390,9 @@ static bool ConvertNativeToJSDate(QScriptEngine *engine,
static bool ConvertNativeToJSFunction(QScriptEngine *engine,
const Variant &val, QScriptValue *qval) {
+ GGL_UNUSED(engine);
+ GGL_UNUSED(val);
+ GGL_UNUSED(qval);
// To be compatible with the Windows version, we don't support returning
// native Slots to JavaScript.
DLOG("ConvertNativeToJSFunction");
diff --git a/extensions/qt_script_runtime/js_function_slot.cc b/extensions/qt_script_runtime/js_function_slot.cc
index fdbe076..3771132 100755
--- a/extensions/qt_script_runtime/js_function_slot.cc
+++ b/extensions/qt_script_runtime/js_function_slot.cc
@@ -80,6 +80,7 @@ JSFunctionSlot::~JSFunctionSlot() {
ResultVariant JSFunctionSlot::Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(object);
bool death_flag = false;
bool *death_flag_ptr = &death_flag;
if (!death_flag_ptr_) {
diff --git a/extensions/qt_script_runtime/js_native_wrapper.cc b/extensions/qt_script_runtime/js_native_wrapper.cc
index c3e6dad..b0e1c24 100644
--- a/extensions/qt_script_runtime/js_native_wrapper.cc
+++ b/extensions/qt_script_runtime/js_native_wrapper.cc
@@ -62,11 +62,14 @@ void JSNativeWrapper::Unref(bool transient) const {
ScriptableInterface::PropertyType JSNativeWrapper::GetPropertyInfo(
const char *name, Variant *prototype) {
+ GGL_UNUSED(name);
+ GGL_UNUSED(prototype);
return ScriptableInterface::PROPERTY_DYNAMIC;
}
bool JSNativeWrapper::EnumerateProperties(
EnumeratePropertiesCallback *callback) {
+ GGL_UNUSED(callback);
#if 0
ScopedLogContext log_context(GetJSScriptContext(js_context_));
ASSERT(callback);
@@ -96,6 +99,7 @@ bool JSNativeWrapper::EnumerateProperties(
}
bool JSNativeWrapper::EnumerateElements(EnumerateElementsCallback *callback) {
+ GGL_UNUSED(callback);
#if 0
ASSERT(callback);
ScopedLogContext log_context(GetJSScriptContext(js_context_));
diff --git a/extensions/qt_script_runtime/js_script_context.cc b/extensions/qt_script_runtime/js_script_context.cc
index 76bd277..217af1e 100755
--- a/extensions/qt_script_runtime/js_script_context.cc
+++ b/extensions/qt_script_runtime/js_script_context.cc
@@ -111,14 +111,14 @@ static QDateTime CustomParseDate(const QString &arg) {
return dt;
}
-QScriptValue ParseDate(QScriptContext *ctx, QScriptEngine *eng) {
+static QScriptValue ParseDate(QScriptContext *ctx, QScriptEngine *eng) {
if (!ctx->argument(0).isString())
return ctx->callee().data().construct(ctx->argumentsObject());
QString arg = ctx->argument(0).toString();
return eng->newDate(CustomParseDate(arg));
}
-QScriptValue CustomDateConstructor(QScriptContext *ctx, QScriptEngine *eng) {
+static QScriptValue CustomDateConstructor(QScriptContext *ctx, QScriptEngine *eng) {
if (!ctx->argument(0).isString())
return ctx->callee().data().construct(ctx->argumentsObject());
QString arg = ctx->argument(0).toString();
@@ -401,6 +401,8 @@ QScriptClass::QueryFlags ResolverScriptClass::queryProperty(
const QScriptString &property_name,
QueryFlags flags,
uint *id) {
+ GGL_UNUSED(object);
+ GGL_UNUSED(flags);
if (!object_) return 0;
QString name = property_name.toString();
@@ -444,6 +446,7 @@ QScriptClass::QueryFlags ResolverScriptClass::queryProperty(
QScriptValue ResolverScriptClass::property(const QScriptValue & object,
const QScriptString & name,
uint id) {
+ GGL_UNUSED(object);
std::string sname = name.toString().toStdString();
JSScriptContext::Impl *impl = GetEngineContextImpl(engine());
@@ -493,6 +496,8 @@ void ResolverScriptClass::setProperty(QScriptValue &object,
const QScriptString &name,
uint id,
const QScriptValue &value) {
+ GGL_UNUSED(object);
+ GGL_UNUSED(id);
std::string sname = name.toString().toStdString();
// Remove me when code is stable
if (sname.compare("trap") == 0)
@@ -617,6 +622,12 @@ bool JSScriptContext::AssignFromContext(ScriptableInterface *dest_object,
ScriptContextInterface *src_context,
ScriptableInterface *src_object,
const char *src_expr) {
+ GGL_UNUSED(dest_object);
+ GGL_UNUSED(dest_object_expr);
+ GGL_UNUSED(dest_property);
+ GGL_UNUSED(src_context);
+ GGL_UNUSED(src_object);
+ GGL_UNUSED(src_expr);
ASSERT(0);
return false;
}
@@ -625,6 +636,7 @@ bool JSScriptContext::AssignFromNative(ScriptableInterface *object,
const char *object_expr,
const char *property,
const Variant &value) {
+ GGL_UNUSED(object);
ScopedLogContext log_context(this);
DLOG("AssignFromNative: o:%s,p:%s,v:%s", object_expr, property,
@@ -644,6 +656,7 @@ bool JSScriptContext::AssignFromNative(ScriptableInterface *object,
Variant JSScriptContext::Evaluate(ScriptableInterface *object,
const char *expr) {
+ GGL_UNUSED(object);
DLOG("Evaluate: %s", expr);
ASSERT(0);
Variant result;
diff --git a/extensions/qt_script_runtime/json.cc b/extensions/qt_script_runtime/json.cc
index bbff23e..4c5a386 100755
--- a/extensions/qt_script_runtime/json.cc
+++ b/extensions/qt_script_runtime/json.cc
@@ -47,6 +47,7 @@ static void AppendArrayToJSON(QScriptEngine *engine, const QScriptValue &qval,
static void AppendStringToJSON(QScriptEngine *engine, QString str,
std::string *json) {
+ GGL_UNUSED(engine);
*json += EncodeJavaScriptString(str.utf16(), '"');
}
@@ -72,6 +73,7 @@ static void AppendObjectToJSON(QScriptEngine *engine, const QScriptValue &qval,
static void AppendNumberToJSON(QScriptEngine *engine, const QScriptValue &qval,
std::string *json) {
+ GGL_UNUSED(engine);
std::string str = qval.toString().toStdString();
if (str.empty() || str[0] == 'I' || str[1] == 'I' || str[0] == 'N')
*json += '0';
@@ -81,6 +83,7 @@ static void AppendNumberToJSON(QScriptEngine *engine, const QScriptValue &qval,
static void AppendDateToJSON(QScriptEngine *engine, const QScriptValue &qval,
std::string *json) {
+ GGL_UNUSED(engine);
*json += kDatePrefix;
uint64_t v = static_cast<uint64_t>(qval.toNumber());
char buf[30];
diff --git a/extensions/qt_system_framework/qt_system_framework.cc b/extensions/qt_system_framework/qt_system_framework.cc
index 566f9c2..b2a2a3a 100644
--- a/extensions/qt_system_framework/qt_system_framework.cc
+++ b/extensions/qt_system_framework/qt_system_framework.cc
@@ -86,6 +86,7 @@ class QtSystemBrowseForFileHelper {
// Function to destroy the helper object when framework is destroyed.
void OnFrameworkRefChange(int ref, int change) {
+ GGL_UNUSED(ref);
if (change == 0) {
DLOG("Framework destroyed, delete QtSystemBrowseForFileHelper object.");
delete this;
@@ -112,6 +113,9 @@ class QtSystemBrowseForFileHelper {
bool BrowseForFilesImpl(const char *filter, bool multiple, const char *title,
BrowseForFileMode mode, const char *default_name,
std::vector<std::string> *result) {
+ GGL_UNUSED(title);
+ GGL_UNUSED(mode);
+ GGL_UNUSED(default_name);
ASSERT(result);
result->clear();
@@ -175,6 +179,7 @@ static std::string GetDesktopEntryIcon(const char *file) {
}
static std::string GetDirectorySpecialIcon(const std::string &file) {
+ GGL_UNUSED(file);
// TODO: check .directory file to show the right icon
return "";
}
diff --git a/extensions/qtwebkit_browser_element/browser_element.cc b/extensions/qtwebkit_browser_element/browser_element.cc
index 9153574..ae87edf 100644
--- a/extensions/qtwebkit_browser_element/browser_element.cc
+++ b/extensions/qtwebkit_browser_element/browser_element.cc
@@ -98,7 +98,7 @@ void BrowserElement::Layout() {
impl_->Layout();
}
-void BrowserElement::DoDraw(CanvasInterface *canvas) {
+void BrowserElement::DoDraw(CanvasInterface *) {
}
BasicElement *BrowserElement::CreateInstance(View *view, const char *name) {
diff --git a/extensions/qtwebkit_browser_element/browser_element_internal.h b/extensions/qtwebkit_browser_element/browser_element_internal.h
index b1ea239..092d9bb 100644
--- a/extensions/qtwebkit_browser_element/browser_element_internal.h
+++ b/extensions/qtwebkit_browser_element/browser_element_internal.h
@@ -42,6 +42,8 @@ class WebPage : public QWebPage {
private slots:
void OnLinkHovered(const QString &link, const QString & title, const QString & textContent ) {
+ GGL_UNUSED(title);
+ GGL_UNUSED(textContent);
url_ = link;
}
@@ -221,7 +223,7 @@ class BrowserElement::Impl {
QWebPage *WebPage::createWindow(
#if QT_VERSION >= 0x040400
- WebWindowType type
+ WebWindowType
#endif
) {
handler_->OpenUrl(url_);
diff --git a/extensions/smjs_script_runtime/converter.cc b/extensions/smjs_script_runtime/converter.cc
index 9e18532..e56bc0f 100644
--- a/extensions/smjs_script_runtime/converter.cc
+++ b/extensions/smjs_script_runtime/converter.cc
@@ -41,6 +41,8 @@ namespace smjs {
static JSBool ConvertJSToNativeVoid(JSContext *cx, jsval js_val,
Variant *native_val) {
+ GGL_UNUSED(cx);
+ GGL_UNUSED(js_val);
*native_val = Variant();
return JS_TRUE;
}
@@ -491,6 +493,8 @@ JSBool ConvertJSArgsToNative(JSContext *cx, NativeJSWrapper *owner,
static JSBool ConvertNativeToJSVoid(JSContext *cx,
const Variant &native_val,
jsval *js_val) {
+ GGL_UNUSED(cx);
+ GGL_UNUSED(native_val);
*js_val = JSVAL_VOID;
return JS_TRUE;
}
@@ -498,6 +502,7 @@ static JSBool ConvertNativeToJSVoid(JSContext *cx,
static JSBool ConvertNativeToJSBool(JSContext *cx,
const Variant &native_val,
jsval *js_val) {
+ GGL_UNUSED(cx);
*js_val = BOOLEAN_TO_JSVAL(VariantValue<bool>()(native_val));
return JS_TRUE;
}
@@ -608,6 +613,9 @@ static JSBool ConvertNativeUTF16ToJSString(JSContext *cx,
static JSBool ReturnSelf(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
jsval *rval) {
+ GGL_UNUSED(cx);
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
*rval = OBJECT_TO_JSVAL(obj);
return JS_TRUE;
}
@@ -697,6 +705,9 @@ static JSBool ConvertNativeToJSDate(JSContext *cx,
static JSBool ConvertNativeToJSFunction(JSContext *cx,
const Variant &native_val,
jsval *js_val) {
+ GGL_UNUSED(cx);
+ GGL_UNUSED(native_val);
+ GGL_UNUSED(js_val);
DLOG("Reading native function in JavaScript");
// Just leave the value that SpiderMonkey recorded in SetProperty.
return JS_TRUE;
diff --git a/extensions/smjs_script_runtime/js_script_context.cc b/extensions/smjs_script_runtime/js_script_context.cc
index 47ee1b0..f0afa52 100644
--- a/extensions/smjs_script_runtime/js_script_context.cc
+++ b/extensions/smjs_script_runtime/js_script_context.cc
@@ -99,6 +99,7 @@ static JSLocaleCallbacks gLocaleCallbacks = {
// SpiderMonkey's upper/lower convertions conform to the Unicode standard.
NULL, NULL,
LocaleCompare, LocaleToUnicode,
+ NULL
};
// For each native classes registered to each JSScriptContext with
@@ -232,6 +233,7 @@ JSScriptContext::~JSScriptContext() {
// way to get the current filename and lineno is from the JSErrorReport.
void JSScriptContext::RecordFileAndLine(JSContext *cx, const char *message,
JSErrorReport *report) {
+ GGL_UNUSED(message);
JSScriptContext *context = GetJSScriptContext(cx);
if (context) {
context->filename_ = report->filename ? report->filename : "";
@@ -402,6 +404,9 @@ Slot *JSScriptContext::Compile(const char *script,
static JSBool ReturnSelf(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
jsval *rval) {
+ GGL_UNUSED(cx);
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
*rval = OBJECT_TO_JSVAL(obj);
return JS_TRUE;
}
@@ -434,6 +439,10 @@ static void ForceGC(JSContext *cx) {
static JSBool DoGC(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
jsval *rval) {
+ GGL_UNUSED(obj);
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
+ GGL_UNUSED(rval);
ForceGC(cx);
return JS_TRUE;
}
@@ -460,6 +469,7 @@ bool JSScriptContext::SetGlobalObject(ScriptableInterface *global_object) {
JSBool JSScriptContext::ConstructObject(JSContext *cx, JSObject *obj,
uintN argc, jsval *argv, jsval *rval) {
+ GGL_UNUSED(rval);
JSScriptContext *context_wrapper = GetJSScriptContext(cx);
ASSERT(context_wrapper);
ScopedLogContext log_context(context_wrapper);
@@ -607,6 +617,7 @@ JSBool JSScriptContext::EvaluateToJSVal(ScriptableInterface *object,
void JSScriptContext::ReportError(JSContext *cx, const char *message,
JSErrorReport *report) {
+ GGL_UNUSED(cx);
LOGE("%s:%d: %s", report->filename, report->lineno, message);
}
diff --git a/extensions/smjs_script_runtime/json.cc b/extensions/smjs_script_runtime/json.cc
index 9497628..779bd53 100644
--- a/extensions/smjs_script_runtime/json.cc
+++ b/extensions/smjs_script_runtime/json.cc
@@ -49,6 +49,7 @@ static void AppendArrayToJSON(JSContext *cx, JSObject *array,
static void AppendStringToJSON(JSContext *cx, JSString *str,
std::string *json) {
+ GGL_UNUSED(cx);
*json += '"';
const jschar *chars = JS_GetStringChars(str);
if (chars) {
diff --git a/extensions/smjs_script_runtime/native_js_wrapper.cc b/extensions/smjs_script_runtime/native_js_wrapper.cc
index 6fc19db..52cba35 100644
--- a/extensions/smjs_script_runtime/native_js_wrapper.cc
+++ b/extensions/smjs_script_runtime/native_js_wrapper.cc
@@ -171,6 +171,7 @@ JSBool NativeJSWrapper::CheckNotDeleted() {
JSBool NativeJSWrapper::CallWrapperSelf(JSContext *cx, JSObject *obj,
uintN argc, jsval *argv,
jsval *rval) {
+ GGL_UNUSED(obj);
if (JS_IsExceptionPending(cx))
return JS_FALSE;
// In this case, the real self object being called is at argv[-2].
@@ -197,6 +198,8 @@ JSBool NativeJSWrapper::CallWrapperMethod(JSContext *cx, JSObject *obj,
JSBool NativeJSWrapper::WrapperDefaultToString(JSContext *cx, JSObject *obj,
uintN argc, jsval *argv,
jsval *rval) {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
if (JS_IsExceptionPending(cx))
return JS_FALSE;
NativeJSWrapper *wrapper = GetWrapperFromJS(cx, obj);
@@ -293,6 +296,7 @@ void NativeJSWrapper::FinalizeWrapper(JSContext *cx, JSObject *obj) {
}
uint32 NativeJSWrapper::MarkWrapper(JSContext *cx, JSObject *obj, void *arg) {
+ GGL_UNUSED(arg);
// The current context may be different from wrapper's context during
// GC marking.
NativeJSWrapper *wrapper = GetWrapperFromJS(cx, obj);
@@ -612,6 +616,8 @@ class NameCollector {
NameCollector(std::vector<std::string> *names) : names_(names) { }
bool Collect(const char *name, ScriptableInterface::PropertyType type,
const Variant &value) {
+ GGL_UNUSED(type);
+ GGL_UNUSED(value);
names_->push_back(name);
return true;
}
diff --git a/gadgets/designer/designer_script_utils.cc b/gadgets/designer/designer_script_utils.cc
index b945dce..ef441bd 100644
--- a/gadgets/designer/designer_script_utils.cc
+++ b/gadgets/designer/designer_script_utils.cc
@@ -277,6 +277,8 @@ class DesignerUtils : public ScriptableHelperNativeOwnedDefault {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
// The gadget manager always use positive instance ids, so this designee_id
// won't conflict with them.
int designee_id = -g_designer_gadget->GetInstanceID() - 1;
@@ -309,6 +311,8 @@ class DesignerUtils : public ScriptableHelperNativeOwnedDefault {
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
diff --git a/ggadget/basic_element.cc b/ggadget/basic_element.cc
index 3e5d80b..634467a 100644
--- a/ggadget/basic_element.cc
+++ b/ggadget/basic_element.cc
@@ -2156,6 +2156,7 @@ void BasicElement::PostSizeEvent() {
}
void BasicElement::SetDesignerMode(bool designer_mode) {
+ GGL_UNUSED(designer_mode);
impl_->designer_mode_ = true;
}
@@ -2229,15 +2230,19 @@ Connection *BasicElement::ConnectOnContentChanged(Slot0<void> *handler) {
}
EventResult BasicElement::HandleMouseEvent(const MouseEvent &event) {
+ GGL_UNUSED(event);
return EVENT_RESULT_UNHANDLED;
}
EventResult BasicElement::HandleDragEvent(const DragEvent &event) {
+ GGL_UNUSED(event);
return EVENT_RESULT_UNHANDLED;
}
EventResult BasicElement::HandleKeyEvent(const KeyboardEvent &event) {
+ GGL_UNUSED(event);
return EVENT_RESULT_UNHANDLED;
}
EventResult BasicElement::HandleOtherEvent(const Event &event) {
+ GGL_UNUSED(event);
return EVENT_RESULT_UNHANDLED;
}
@@ -2248,10 +2253,13 @@ void BasicElement::AggregateClipRegion(const Rectangle &boundary,
void BasicElement::AggregateMoreClipRegion(const Rectangle &boundary,
ClipRegion *region) {
+ GGL_UNUSED(boundary);
+ GGL_UNUSED(region);
}
void BasicElement::EnsureAreaVisible(const Rectangle &rect,
const BasicElement *source) {
+ GGL_UNUSED(source);
// First test if the rectangle is visible in this element.
if (impl_->parent_ && rect.x + rect.w > 0 && rect.y + rect.h > 0 &&
rect.x < GetPixelWidth() && rect.y < GetPixelHeight()) {
diff --git a/ggadget/combobox_element.cc b/ggadget/combobox_element.cc
index 38e7bff..0eda30b 100644
--- a/ggadget/combobox_element.cc
+++ b/ggadget/combobox_element.cc
@@ -301,6 +301,7 @@ class ComboBoxElement::Impl : public SmallObject<> {
}
void OnSelectionRefChange(int ref_count, int change) {
+ GGL_UNUSED(ref_count);
if (change == 0) {
// The source's destructor is being called.
selection_refchange_connection_->Disconnect();
diff --git a/ggadget/common.h b/ggadget/common.h
index aa31363..39f5e65 100644
--- a/ggadget/common.h
+++ b/ggadget/common.h
@@ -221,6 +221,11 @@ template <typename T, size_t N>
char (&ArraySizeHelper(const T (&array)[N]))[N];
/**
+ * Avoids warning on unused parameters of functions.
+ */
+#define GGL_UNUSED(x) (void)x;
+
+/**
* The @c arraysize(arr) macro returns the # of elements in an array arr.
* The expression is a compile-time constant, and therefore can be
* used in defining new arrays, for example. If you use @c arraysize on
diff --git a/ggadget/contentarea_element.cc b/ggadget/contentarea_element.cc
index d2573c0..be08ee9 100644
--- a/ggadget/contentarea_element.cc
+++ b/ggadget/contentarea_element.cc
@@ -142,10 +142,14 @@ class ContentAreaElement::Impl : public SmallObject<> {
public:
QueueDrawCallback(ContentAreaElement *area) : area_(area) { ASSERT(area); }
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
area_->QueueDraw();
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
private:
@@ -443,6 +447,7 @@ class ContentAreaElement::Impl : public SmallObject<> {
}
bool AddContentItem(ContentItem *item, DisplayOptions options) {
+ GGL_UNUSED(options);
ContentItems::iterator it = std::find(content_items_.begin(),
content_items_.end(),
item);
diff --git a/ggadget/copy_element.cc b/ggadget/copy_element.cc
index 55b7ed4..56fdfa4 100644
--- a/ggadget/copy_element.cc
+++ b/ggadget/copy_element.cc
@@ -42,6 +42,7 @@ class CopyElement::Impl : public SmallObject<> {
}
void OnSourceRefChange(int ref_count, int change) {
+ GGL_UNUSED(ref_count);
if (change == 0) {
// The source's destructor is being called.
refchange_connection_->Disconnect();
diff --git a/ggadget/dbus/dbus_proxy.cc b/ggadget/dbus/dbus_proxy.cc
index be408a3..12e6271 100644
--- a/ggadget/dbus/dbus_proxy.cc
+++ b/ggadget/dbus/dbus_proxy.cc
@@ -450,6 +450,7 @@ class DBusProxy::Impl : public SmallObject<> {
void NameOwnerChanged(const char *name, const char *old_owner,
const char *new_owner) {
+ GGL_UNUSED(old_owner);
// Don't monitor owner names.
if (name[0] == ':') return;
#ifdef DBUS_VERBOSE_LOG
diff --git a/ggadget/dbus/dbus_utils.cc b/ggadget/dbus/dbus_utils.cc
index 6a9b641..16334f5 100644
--- a/ggadget/dbus/dbus_utils.cc
+++ b/ggadget/dbus/dbus_utils.cc
@@ -248,6 +248,7 @@ class ArraySignatureIterator {
return sig;
}
bool Callback(int id, const Variant &value) {
+ GGL_UNUSED(id);
std::string sig = GetVariantSignature(value);
if (sig.empty()) return true;
if (is_array_ && !signature_list_.empty() && sig != signature_list_[0])
@@ -267,6 +268,7 @@ class DictSignatureIterator {
std::string GetSignature() const { return signature_; }
bool Callback(const char *name, ScriptableInterface::PropertyType type,
const Variant &value) {
+ GGL_UNUSED(name);
if (type == ScriptableInterface::PROPERTY_METHOD ||
value.type() == Variant::TYPE_VOID) {
// Ignore method and void type properties.
@@ -647,6 +649,7 @@ class DBusMarshaller::Impl {
delete marshaller_;
}
bool Callback(int id, const Variant &value) {
+ GGL_UNUSED(id);
Argument arg(signature_, value);
return marshaller_->AppendArgument(arg);
}
@@ -664,6 +667,7 @@ class DBusMarshaller::Impl {
delete marshaller_;
}
bool Callback(int id, const Variant &value) {
+ GGL_UNUSED(id);
if (index_ >= signature_list_.size()) {
DLOG("The signature of the variant does not match the specified "
"signature.");
@@ -1396,6 +1400,8 @@ class DBusMainLoopClosure::Impl {
public:
DBusDispatchCallback(Impl *impl) : impl_(impl) { }
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
#ifdef DBUS_VERBOSE_LOG
DLOG("Dispatch DBus connection.");
#endif
@@ -1409,6 +1415,8 @@ class DBusMainLoopClosure::Impl {
return status == DBUS_DISPATCH_DATA_REMAINS;
}
virtual void OnRemove(MainLoopInterface* main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
impl_->dispatch_timeout_ = -1;
delete this;
}
@@ -1663,6 +1671,8 @@ class DBusMainLoopClosure::Impl {
static void DispatchStatus(DBusConnection *connection,
DBusDispatchStatus new_status,
void *data) {
+ GGL_UNUSED(connection);
+ GGL_UNUSED(new_status);
#ifdef DBUS_VERBOSE_LOG
DLOG("DispatchStatus");
#endif
@@ -1693,6 +1703,7 @@ class DBusMainLoopClosure::Impl {
}
static void RemoveWatch(DBusWatch* watch, void* data) {
+ GGL_UNUSED(data);
#ifdef DBUS_VERBOSE_LOG
DLOG("DBus remove watch.");
#endif
@@ -1703,6 +1714,7 @@ class DBusMainLoopClosure::Impl {
}
static void WatchToggled(DBusWatch* watch, void* data) {
+ GGL_UNUSED(data);
#ifdef DBUS_VERBOSE_LOG
DLOG("DBus toggle watch.");
#endif
@@ -1725,6 +1737,7 @@ class DBusMainLoopClosure::Impl {
}
static void RemoveTimeout(DBusTimeout *timeout, void* data) {
+ GGL_UNUSED(data);
#ifdef DBUS_VERBOSE_LOG
DLOG("DBus remove timeout.");
#endif
@@ -1735,6 +1748,7 @@ class DBusMainLoopClosure::Impl {
}
static void TimeoutToggled(DBusTimeout *timeout, void* data) {
+ GGL_UNUSED(data);
#ifdef DBUS_VERBOSE_LOG
DLOG("DBus toggle timeout.");
#endif
diff --git a/ggadget/decorated_view_host.cc b/ggadget/decorated_view_host.cc
index 80d9990..b0078b5 100644
--- a/ggadget/decorated_view_host.cc
+++ b/ggadget/decorated_view_host.cc
@@ -186,17 +186,20 @@ bool DecoratedViewHost::ShowContextMenu(int button) {
}
void DecoratedViewHost::Alert(const ViewInterface *view, const char *message) {
+ GGL_UNUSED(view);
impl_->view_decorator_->Alert(message);
}
ViewHostInterface::ConfirmResponse DecoratedViewHost::Confirm(
const ViewInterface *view, const char *message, bool cancel_button) {
+ GGL_UNUSED(view);
return impl_->view_decorator_->Confirm(message, cancel_button);
}
std::string DecoratedViewHost::Prompt(const ViewInterface *view,
const char *message,
const char *default_value) {
+ GGL_UNUSED(view);
return impl_->view_decorator_->Prompt(message, default_value);
}
diff --git a/ggadget/gadget.cc b/ggadget/gadget.cc
index 139759a..781f582 100644
--- a/ggadget/gadget.cc
+++ b/ggadget/gadget.cc
@@ -512,12 +512,16 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
: host_(host), owner_(owner), save_data_(save_data) {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
owner_->impl_->remove_me_timer_ = 0;
if (owner_->impl_->IsSafeToRemove())
host_->RemoveGadget(owner_, save_data_);
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
private:
@@ -595,6 +599,8 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
}
void SetIcons(const Variant ¶m1, const Variant ¶m2) {
+ GGL_UNUSED(param1);
+ GGL_UNUSED(param2);
LOG("pluginHelper.SetIcons is no longer supported. "
"Please specify icons in the manifest file.");
}
@@ -667,6 +673,8 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
std::string OnContextLog(LogLevel level, const char *filename, int line,
const std::string &message,
ScriptContextInterface *context) {
+ GGL_UNUSED(filename);
+ GGL_UNUSED(line);
std::string real_message;
std::string script_filename;
int script_line = 0;
@@ -815,6 +823,7 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
return ResultVariant(Variant(result));
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false;
}
private:
@@ -907,6 +916,8 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
delete details_view_;
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
impl_->destroy_details_view_timer_ = 0;
// Let the destructor do the actual thing, because this callback may
// be removed before it is fired if it is scheduled just before the
@@ -914,6 +925,8 @@ class Gadget::Impl : public ScriptableHelperNativeOwnedDefault {
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
private:
diff --git a/ggadget/gtk/hotkey.cc b/ggadget/gtk/hotkey.cc
index a2bba8b..97f4e9d 100644
--- a/ggadget/gtk/hotkey.cc
+++ b/ggadget/gtk/hotkey.cc
@@ -700,6 +700,7 @@ class HotKeyDialog::Impl {
static gboolean OnEntryClicked(GtkWidget *widget, GdkEventButton *event,
gpointer data) {
+ GGL_UNUSED(event);
Impl *impl = reinterpret_cast<Impl *>(data);
gtk_widget_grab_focus(widget);
impl->UpdateEntryText(true);
@@ -710,6 +711,7 @@ class HotKeyDialog::Impl {
static gboolean OnEntryKeyPressed(GtkWidget *widget, GdkEventKey *event,
gpointer data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(data);
KeyEvent key(event);
if (key.IsValid())
@@ -719,6 +721,7 @@ class HotKeyDialog::Impl {
static gboolean OnEntryKeyReleased(GtkWidget *widget, GdkEventKey *event,
gpointer data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(data);
KeyEvent key(event);
if (key.IsValid() && impl->recorder_.PushKeyEvent(key, false, &key)) {
@@ -730,6 +733,7 @@ class HotKeyDialog::Impl {
}
static void OnClearButtonClicked(GtkButton *button, gpointer data) {
+ GGL_UNUSED(button);
Impl *impl = reinterpret_cast<Impl *>(data);
gtk_window_set_focus(GTK_WINDOW(impl->dialog_), NULL);
impl->hotkey_.Reset();
diff --git a/ggadget/gtk/main_loop.cc b/ggadget/gtk/main_loop.cc
index d6a3bd6..fb06b8f 100644
--- a/ggadget/gtk/main_loop.cc
+++ b/ggadget/gtk/main_loop.cc
@@ -233,6 +233,7 @@ class MainLoop::Impl {
// Callback functions to be registered into gtk's main loop for io watch.
static gboolean IOWatchCallback(GIOChannel *channel, GIOCondition condition,
gpointer data) {
+ GGL_UNUSED(channel);
WatchNode *node = static_cast<WatchNode *>(data);
if (node && !node->calling && !node->removing) {
MainLoop::Impl *impl = node->impl;
diff --git a/ggadget/gtk/menu_builder.cc b/ggadget/gtk/menu_builder.cc
index 5d9fdb9..fe5aab3 100644
--- a/ggadget/gtk/menu_builder.cc
+++ b/ggadget/gtk/menu_builder.cc
@@ -114,6 +114,7 @@ class MenuBuilder::Impl {
}
static void OnItemActivate(GtkMenuItem *item, gpointer data) {
+ GGL_UNUSED(data);
if (g_object_get_data(G_OBJECT(item), kMenuItemNoCallbackTag) != NULL)
return;
diff --git a/ggadget/gtk/npapi_plugin_element.cc b/ggadget/gtk/npapi_plugin_element.cc
index 5e67e10..7dad1a8 100644
--- a/ggadget/gtk/npapi_plugin_element.cc
+++ b/ggadget/gtk/npapi_plugin_element.cc
@@ -177,6 +177,8 @@ class NPAPIPluginElement::Impl : public SmallObject<> {
}
static gboolean OnPlugRemoved(GtkWidget *widget, gpointer data) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(data);
return TRUE;
}
diff --git a/ggadget/gtk/single_view_host.cc b/ggadget/gtk/single_view_host.cc
index 88fe41c..be5eb97 100644
--- a/ggadget/gtk/single_view_host.cc
+++ b/ggadget/gtk/single_view_host.cc
@@ -333,6 +333,7 @@ class SingleViewHost::Impl {
}
void SetShowCaptionAlways(bool always) {
+ GGL_UNUSED(always);
// SingleViewHost will always show caption when window decorator is shown.
}
@@ -719,6 +720,7 @@ class SingleViewHost::Impl {
// gtk signal handlers.
static gboolean FocusInHandler(GtkWidget *widget, GdkEventFocus *event,
gpointer user_data) {
+ GGL_UNUSED(event);
DLOG("FocusInHandler(%p)", widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (impl->move_dragging_)
@@ -729,6 +731,8 @@ class SingleViewHost::Impl {
#ifdef _DEBUG
static gboolean FocusOutHandler(GtkWidget *widget, GdkEventFocus *event,
gpointer user_data) {
+ GGL_UNUSED(event);
+ GGL_UNUSED(user_data);
DLOG("FocusOutHandler(%p)", widget);
return FALSE;
}
@@ -744,6 +748,7 @@ class SingleViewHost::Impl {
}
static void WindowShowHandler(GtkWidget *widget, gpointer user_data) {
+ GGL_UNUSED(widget);
DLOG("View window is going to be shown.");
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (impl->view_ && impl->enable_signals_)
@@ -751,6 +756,7 @@ class SingleViewHost::Impl {
}
static void WindowHideHandler(GtkWidget *widget, gpointer user_data) {
+ GGL_UNUSED(widget);
DLOG("View window is going to be hidden.");
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (impl->view_ && impl->enable_signals_) {
@@ -770,6 +776,7 @@ class SingleViewHost::Impl {
static gboolean ConfigureHandler(GtkWidget *widget, GdkEventConfigure *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (impl->enable_signals_) {
if (impl->win_x_ != event->x || impl->win_y_ != event->y) {
@@ -791,6 +798,7 @@ class SingleViewHost::Impl {
static void DialogResponseHandler(GtkDialog *dialog, gint response,
gpointer user_data) {
+ GGL_UNUSED(dialog);
DLOG("%s button clicked in options dialog.",
response == GTK_RESPONSE_OK ? "Ok" :
response == GTK_RESPONSE_CANCEL ? "Cancel" : "No");
@@ -886,6 +894,8 @@ class SingleViewHost::Impl {
static gboolean ButtonReleaseHandler(GtkWidget *widget, GdkEventButton *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(event);
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (impl->resize_width_mode_ || impl->resize_height_mode_) {
impl->StopResizeDrag();
@@ -897,6 +907,7 @@ class SingleViewHost::Impl {
static void WidgetSizeRequestHandler(GtkWidget *widget,
GtkRequisition *requisition,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
double zoom = impl->view_->GetGraphics()->GetZoom();
if (impl->resizable_mode_ == ViewInterface::RESIZABLE_FALSE) {
@@ -925,6 +936,7 @@ class SingleViewHost::Impl {
static void FixedSizeAllocateHandler(GtkWidget *widget,
GtkAllocation *allocation,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (GTK_WIDGET_VISIBLE(impl->window_) &&
!impl->resize_width_mode_ && !impl->resize_height_mode_ &&
diff --git a/ggadget/gtk/tooltip.cc b/ggadget/gtk/tooltip.cc
index d0449be..2f6d1e0 100644
--- a/ggadget/gtk/tooltip.cc
+++ b/ggadget/gtk/tooltip.cc
@@ -80,6 +80,7 @@ class Tooltip::Impl {
}
bool DelayedShow(int watch_id) {
+ GGL_UNUSED(watch_id);
GdkScreen *screen;
gint x, y;
gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
@@ -89,6 +90,7 @@ class Tooltip::Impl {
}
bool DelayedHide(int watch_id) {
+ GGL_UNUSED(watch_id);
gtk_widget_hide(window_);
hide_timer_ = 0;
return false;
@@ -147,6 +149,8 @@ class Tooltip::Impl {
static gboolean PaintTooltipWindow(GtkWidget *widget, GdkEventExpose *event,
gpointer user_data) {
+ GGL_UNUSED(event);
+ GGL_UNUSED(user_data);
GtkRequisition req;
gtk_widget_size_request(widget, &req);
gtk_paint_flat_box(widget->style, widget->window,
diff --git a/ggadget/gtk/utilities.cc b/ggadget/gtk/utilities.cc
index b6912df..878e77c 100644
--- a/ggadget/gtk/utilities.cc
+++ b/ggadget/gtk/utilities.cc
@@ -419,6 +419,7 @@ static const char kWorkAreaChangeSelfTag[] = "workarea-change-self";
static GdkFilterReturn WorkAreaPropertyNotifyFilter(
GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) {
+ GGL_UNUSED(event);
g_return_val_if_fail(gdk_xevent, GDK_FILTER_CONTINUE);
Slot0<void> *slot = static_cast<Slot0<void> *>(
@@ -457,6 +458,7 @@ static void WorkAreaChangeDestroySelfNotify(gpointer data) {
static void WorkAreaScreenChangedCallback(GtkWidget *widget, GdkScreen *prev,
gpointer data) {
+ GGL_UNUSED(data);
if (prev) {
GdkWindow *root = gdk_screen_get_root_window(prev);
if (root)
@@ -598,6 +600,7 @@ static void OnDebugConsoleDestroy(GtkObject *object, gpointer user_data) {
}
static void OnClearClicked(GtkButton *button, gpointer user_data) {
+ GGL_UNUSED(button);
DebugConsoleInfo *info = static_cast<DebugConsoleInfo *>(user_data);
GtkTextBuffer *buffer = gtk_text_view_get_buffer(info->log_view);
if (buffer) {
diff --git a/ggadget/gtk/view_widget_binder.cc b/ggadget/gtk/view_widget_binder.cc
index 3950615..2bf92b0 100644
--- a/ggadget/gtk/view_widget_binder.cc
+++ b/ggadget/gtk/view_widget_binder.cc
@@ -408,6 +408,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean ButtonReleaseHandler(GtkWidget *widget, GdkEventButton *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
DLOG("ButtonReleaseHandler.");
Impl *impl = reinterpret_cast<Impl *>(user_data);
EventResult result = EVENT_RESULT_UNHANDLED;
@@ -455,6 +456,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean KeyPressHandler(GtkWidget *widget, GdkEventKey *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
EventResult result = EVENT_RESULT_UNHANDLED;
EventResult result2 = EVENT_RESULT_UNHANDLED;
@@ -499,6 +501,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean KeyReleaseHandler(GtkWidget *widget, GdkEventKey *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
EventResult result = EVENT_RESULT_UNHANDLED;
@@ -687,6 +690,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean ScrollHandler(GtkWidget *widget, GdkEventScroll *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
int delta_x = 0, delta_y = 0;
if (event->direction == GDK_SCROLL_UP) {
@@ -709,6 +713,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean LeaveNotifyHandler(GtkWidget *widget, GdkEventCrossing *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
if (event->mode != GDK_CROSSING_NORMAL ||
event->detail == GDK_NOTIFY_INFERIOR)
return FALSE;
@@ -730,6 +735,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean EnterNotifyHandler(GtkWidget *widget, GdkEventCrossing *event,
gpointer user_data) {
+ GGL_UNUSED(widget);
if (event->mode != GDK_CROSSING_NORMAL ||
event->detail == GDK_NOTIFY_INFERIOR)
return FALSE;
@@ -746,6 +752,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean FocusInHandler(GtkWidget *widget, GdkEventFocus *event,
gpointer user_data) {
+ GGL_UNUSED(event);
Impl *impl = reinterpret_cast<Impl *>(user_data);
DLOG("FocusInHandler: widget: %p, view: %p, focused: %d, child: %p",
widget, impl->view_, impl->focused_,
@@ -760,6 +767,7 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static gboolean FocusOutHandler(GtkWidget *widget, GdkEventFocus *event,
gpointer user_data) {
+ GGL_UNUSED(event);
Impl *impl = reinterpret_cast<Impl *>(user_data);
DLOG("FocusOutHandler: widget: %p, view: %p, focused: %d, child: %p",
widget, impl->view_, impl->focused_,
@@ -801,6 +809,9 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
#ifdef GRAB_POINTER_EXPLICITLY
static gboolean GrabBrokenHandler(GtkWidget *widget, GdkEvent *event,
gpointer user_data) {
+ GGL_UNUSED(event);
+ GGL_UNUSED(widget);
+ GGL_UNUSED(user_data);
Impl *impl = reinterpret_cast<Impl *>(user_data);
impl->pointer_grabbed_ = false;
return FALSE;
@@ -813,6 +824,8 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
GtkSelectionData *data,
guint info, guint time,
gpointer user_data) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(info);
Impl *impl = reinterpret_cast<Impl *>(user_data);
if (!impl->current_drag_event_) {
// There are some cases that multiple drag events are fired in one event
@@ -925,11 +938,14 @@ class ViewWidgetBinder::Impl : public SmallObject<> {
static void ScreenChangedHandler(GtkWidget *widget, GdkScreen *last_screen,
gpointer user_data) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(last_screen);
Impl *impl = reinterpret_cast<Impl *>(user_data);
impl->SetupBackgroundMode();
}
static void CompositedChangedHandler(GtkWidget *widget, gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
impl->SetupBackgroundMode();
}
diff --git a/ggadget/host_utils.cc b/ggadget/host_utils.cc
index c5b675a..10d594e 100644
--- a/ggadget/host_utils.cc
+++ b/ggadget/host_utils.cc
@@ -576,6 +576,9 @@ void SetupGadgetGetFeedbackURLHandler(Gadget *gadget) {
}
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(object);
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
if (!url_retrieved_) {
GadgetManagerInterface *gadget_manager = GetGadgetManager();
if (gadget_ && gadget_manager) {
@@ -588,6 +591,7 @@ void SetupGadgetGetFeedbackURLHandler(Gadget *gadget) {
return ResultVariant(Variant(url_));
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false;
}
private:
diff --git a/ggadget/listbox_element.cc b/ggadget/listbox_element.cc
index 21cfb76..ade479a 100644
--- a/ggadget/listbox_element.cc
+++ b/ggadget/listbox_element.cc
@@ -57,6 +57,7 @@ class ListBoxElement::Impl : public SmallObject<> {
item_height_relative_(false),
multiselect_(false),
item_separator_(false) {
+ GGL_UNUSED(view);
}
~Impl() {
diff --git a/ggadget/logger.cc b/ggadget/logger.cc
index 7dec662..53cee0b 100644
--- a/ggadget/logger.cc
+++ b/ggadget/logger.cc
@@ -82,10 +82,14 @@ class LogTask : public WatchCallbackInterface {
: level_(level), file_(file), line_(line), message_(message) {
}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
DoLog(level_, VariantValue<const char *>()(file_), line_, message_);
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
diff --git a/ggadget/main_loop_interface.h b/ggadget/main_loop_interface.h
index ea0deff..2e4e11e 100644
--- a/ggadget/main_loop_interface.h
+++ b/ggadget/main_loop_interface.h
@@ -87,10 +87,13 @@ class WatchCallbackSlot : public WatchCallbackInterface {
public:
WatchCallbackSlot(Slot1<bool, int> *slot) : slot_(slot) { }
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
if (slot_) return (*slot_)(watch_id);
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete slot_;
delete this;
}
diff --git a/ggadget/main_view_decorator_base.cc b/ggadget/main_view_decorator_base.cc
index 2c50905..e249afd 100644
--- a/ggadget/main_view_decorator_base.cc
+++ b/ggadget/main_view_decorator_base.cc
@@ -779,6 +779,8 @@ void MainViewDecoratorBase::GetClientExtents(double *width,
}
bool MainViewDecoratorBase::OnClientSizing(double *width, double *height) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
if (impl_->minimized_)
*height = kVDMainMinimizedHeight;
return true;
diff --git a/ggadget/npapi/npapi_plugin.cc b/ggadget/npapi/npapi_plugin.cc
index 8edcefa..ba706c7 100644
--- a/ggadget/npapi/npapi_plugin.cc
+++ b/ggadget/npapi/npapi_plugin.cc
@@ -555,12 +555,18 @@ class Plugin::Impl : public SmallObject<> {
}
static NPError NPN_RequestRead(NPStream *stream, NPByteRange *rangeList) {
+ GGL_UNUSED(stream);
+ GGL_UNUSED(rangeList);
NOT_IMPLEMENTED();
return NPERR_GENERIC_ERROR;
}
static NPError NPN_NewStream(NPP instance, NPMIMEType type,
const char *target, NPStream **stream) {
+ GGL_UNUSED(instance);
+ GGL_UNUSED(type);
+ GGL_UNUSED(target);
+ GGL_UNUSED(stream);
// Plugin-produced stream is not supported.
NOT_IMPLEMENTED();
return NPERR_GENERIC_ERROR;
@@ -568,12 +574,19 @@ class Plugin::Impl : public SmallObject<> {
static int32 NPN_Write(NPP instance, NPStream *stream,
int32 len, void *buffer) {
+ GGL_UNUSED(instance);
+ GGL_UNUSED(stream);
+ GGL_UNUSED(len);
+ GGL_UNUSED(buffer);
NOT_IMPLEMENTED();
return -1;
}
static NPError NPN_DestroyStream(NPP instance, NPStream *stream,
NPReason reason) {
+ GGL_UNUSED(instance);
+ GGL_UNUSED(stream);
+ GGL_UNUSED(reason);
NOT_IMPLEMENTED();
return NPERR_GENERIC_ERROR;
}
@@ -587,11 +600,13 @@ class Plugin::Impl : public SmallObject<> {
}
static const char *NPN_UserAgent(NPP instance) {
+ GGL_UNUSED(instance);
CHECK_MAIN_THREAD();
return kUserAgent;
}
static uint32 NPN_MemFlush(uint32 size) {
+ GGL_UNUSED(size);
CHECK_MAIN_THREAD();
return 0;
}
@@ -599,6 +614,7 @@ class Plugin::Impl : public SmallObject<> {
static void NPN_ReloadPlugins(NPBool reloadPages) {
// We don't provide any plugin-in with the authority that can reload
// all plug-ins in the plugins directory.
+ GGL_UNUSED(reloadPages);
NOT_IMPLEMENTED();
}
@@ -608,6 +624,7 @@ class Plugin::Impl : public SmallObject<> {
}
static jref NPN_GetJavaPeer(NPP instance) {
+ GGL_UNUSED(instance);
NOT_IMPLEMENTED();
return NULL;
}
@@ -704,6 +721,8 @@ class Plugin::Impl : public SmallObject<> {
}
static void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) {
+ GGL_UNUSED(instance);
+ GGL_UNUSED(invalidRegion);
NOT_IMPLEMENTED();
}
@@ -726,6 +745,7 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier method_name,
const NPVariant *args, uint32_t arg_count,
NPVariant *result) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->invoke &&
npobj->_class->invoke(npobj, method_name, args, arg_count, result);
@@ -734,6 +754,7 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_InvokeDefault(NPP npp, NPObject *npobj,
const NPVariant *args, uint32_t arg_count,
NPVariant *result) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->invokeDefault &&
npobj->_class->invokeDefault(npobj, args, arg_count, result);
@@ -741,12 +762,17 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
NPVariant *result) {
+ GGL_UNUSED(npp);
+ GGL_UNUSED(npobj);
+ GGL_UNUSED(script);
+ GGL_UNUSED(result);
NOT_IMPLEMENTED();
return false;
}
static bool NPN_GetProperty(NPP npp, NPObject *npobj,
NPIdentifier property_name, NPVariant *result) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->getProperty &&
npobj->_class->getProperty(npobj, property_name, result);
@@ -755,6 +781,7 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_SetProperty(NPP npp, NPObject *npobj,
NPIdentifier property_name,
const NPVariant *value) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->setProperty &&
npobj->_class->setProperty(npobj, property_name, value);
@@ -762,6 +789,7 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_RemoveProperty(NPP npp, NPObject *npobj,
NPIdentifier property_name) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->removeProperty &&
npobj->_class->removeProperty(npobj, property_name);
@@ -769,6 +797,7 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_HasProperty(NPP npp, NPObject *npobj,
NPIdentifier property_name) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->hasProperty &&
npobj->_class->hasProperty(npobj, property_name);
@@ -776,27 +805,34 @@ class Plugin::Impl : public SmallObject<> {
static bool NPN_HasMethod(NPP npp, NPObject *npobj,
NPIdentifier method_name) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->hasMethod &&
npobj->_class->hasMethod(npobj, method_name);
}
static void NPN_SetException(NPObject *npobj, const NPUTF8 *message) {
+ GGL_UNUSED(npobj);
+ GGL_UNUSED(message);
NOT_IMPLEMENTED();
}
static bool NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) {
+ GGL_UNUSED(instance);
+ GGL_UNUSED(enabled);
NOT_IMPLEMENTED();
return false;
}
static bool NPN_PopPopupsEnabledState(NPP instance) {
+ GGL_UNUSED(instance);
NOT_IMPLEMENTED();
return false;
}
static bool NPN_Enumerate(NPP npp, NPObject *npobj,
NPIdentifier **identifiers, uint32_t *count) {
+ GGL_UNUSED(npp);
ENSURE_MAIN_THREAD(false);
return npobj && npobj->_class && npobj->_class->enumerate &&
npobj->_class->enumerate(npobj, identifiers, count);
@@ -807,10 +843,14 @@ class Plugin::Impl : public SmallObject<> {
AsyncCall(void (*func)(void *), void *user_data)
: func_(func), user_data_(user_data) { }
virtual bool Call(MainLoopInterface *mainloop, int watch_id) {
+ GGL_UNUSED(mainloop);
+ GGL_UNUSED(watch_id);
(*func_)(user_data_);
return false;
}
virtual void OnRemove(MainLoopInterface *mainloop, int watch_id) {
+ GGL_UNUSED(mainloop);
+ GGL_UNUSED(watch_id);
delete this;
}
private:
@@ -834,6 +874,7 @@ class Plugin::Impl : public SmallObject<> {
// between calling this function and termination of the plugin instance.
static void NPN_PluginThreadAsyncCall(NPP instance, void (*func)(void *),
void *user_data) {
+ GGL_UNUSED(instance);
if (GetGlobalMainLoop()->IsMainThread())
DLOG("NPN_PluginThreadAsyncCall called from the non-main thread.");
else
@@ -852,6 +893,7 @@ class Plugin::Impl : public SmallObject<> {
// Only support window.top and window.location because the flash plugin
// requires them.
static bool BrowserWindowHasProperty(NPObject *npobj, NPIdentifier name) {
+ GGL_UNUSED(npobj);
ENSURE_MAIN_THREAD(false);
std::string name_str = GetIdentifierName(name);
return name_str == "location" || name_str == "top";
@@ -874,6 +916,7 @@ class Plugin::Impl : public SmallObject<> {
}
static bool LocationHasMethod(NPObject *npobj, NPIdentifier name) {
+ GGL_UNUSED(npobj);
ENSURE_MAIN_THREAD(false);
return GetIdentifierName(name) == "toString";
}
@@ -881,6 +924,8 @@ class Plugin::Impl : public SmallObject<> {
static bool LocationInvoke(NPObject *npobj, NPIdentifier name,
const NPVariant *args, uint32_t argCount,
NPVariant *result) {
+ GGL_UNUSED(args);
+ GGL_UNUSED(argCount);
ENSURE_MAIN_THREAD(false);
if (GetIdentifierName(name) == "toString") {
Impl *owner = reinterpret_cast<OwnedNPObject *>(npobj)->owner;
@@ -891,6 +936,7 @@ class Plugin::Impl : public SmallObject<> {
}
static bool LocationHasProperty(NPObject *npobj, NPIdentifier name) {
+ GGL_UNUSED(npobj);
ENSURE_MAIN_THREAD(false);
return GetIdentifierName(name) == "href";
}
diff --git a/ggadget/npapi/npapi_plugin_script.cc b/ggadget/npapi/npapi_plugin_script.cc
index c030d30..3c9b052 100644
--- a/ggadget/npapi/npapi_plugin_script.cc
+++ b/ggadget/npapi/npapi_plugin_script.cc
@@ -109,6 +109,7 @@ class ScriptableNPObject::Impl {
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(object);
NPObject *np_obj = owner_->np_obj_;
scoped_array<NPVariant> args(new NPVariant[argc]);
diff --git a/ggadget/object_videoplayer.cc b/ggadget/object_videoplayer.cc
index 94ae970..e3ef10a 100755
--- a/ggadget/object_videoplayer.cc
+++ b/ggadget/object_videoplayer.cc
@@ -94,10 +94,13 @@ class ObjectVideoPlayer::Impl : public SmallObject<> {
}
void SetItemInfo(const std::string& attr, const std::string& value) {
+ GGL_UNUSED(attr);
+ GGL_UNUSED(value);
// Currently, users are not allowed to modify the tag info.
}
bool IsReadOnlyItem(const std::string& attr) {
+ GGL_UNUSED(attr);
return true;
}
@@ -463,6 +466,7 @@ class ObjectVideoPlayer::Impl : public SmallObject<> {
}
Playlist *NewPlaylist(const char *name, const char *meta_file) {
+ GGL_UNUSED(meta_file);
// We don't use any meta file for playlist. The parameter exists for
// interface compatibility.
if (name) {
@@ -521,6 +525,7 @@ class ObjectVideoPlayer::Impl : public SmallObject<> {
}
bool RequestMediaAccessRights(const std::string &access) {
+ GGL_UNUSED(access);
return true;
}
diff --git a/ggadget/qt/qt_canvas.cc b/ggadget/qt/qt_canvas.cc
index 9528077..09d0595 100644
--- a/ggadget/qt/qt_canvas.cc
+++ b/ggadget/qt/qt_canvas.cc
@@ -169,6 +169,8 @@ class QtCanvas::Impl {
const CanvasInterface *img,
double mx, double my,
const CanvasInterface *mask) {
+ GGL_UNUSED(mx);
+ GGL_UNUSED(my);
DLOG("DrawCanvasWithMask: (%p, %p) on %p", img, mask, owner_);
QPainter *p = painter_;
const QtCanvas *s = reinterpret_cast<const QtCanvas*>(img);
@@ -304,6 +306,16 @@ class QtCanvas::Impl {
const CanvasInterface *texture,
Alignment align, VAlignment valign,
Trimming trimming, int text_flags) {
+ GGL_UNUSED(x);
+ GGL_UNUSED(y);
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
+ GGL_UNUSED(f);
+ GGL_UNUSED(texture);
+ GGL_UNUSED(align);
+ GGL_UNUSED(valign);
+ GGL_UNUSED(trimming);
+ GGL_UNUSED(text_flags);
DLOG("DrawTextWithTexture: %s", text);
ASSERT(0);
return true;
@@ -484,6 +496,7 @@ bool QtCanvas::DrawCanvas(double x, double y, const CanvasInterface *img) {
bool QtCanvas::DrawRawImage(double x, double y,
const char *data, RawImageFormat format,
int width, int height, int stride) {
+ GGL_UNUSED(stride);
QImage::Format qt_format;
if (format == RAWIMAGE_FORMAT_RGB24)
qt_format = QImage::Format_RGB32;
diff --git a/ggadget/qt/qt_main_loop.cc b/ggadget/qt/qt_main_loop.cc
index aa0ba3b..c676e18 100644
--- a/ggadget/qt/qt_main_loop.cc
+++ b/ggadget/qt/qt_main_loop.cc
@@ -73,6 +73,8 @@ class QtMainLoop::Impl : public WatchCallbackInterface {
// Handle thread adding timeout watches
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
union {
char data[sizeof(TimeoutPipeEvent)];
TimeoutPipeEvent event;
@@ -98,6 +100,8 @@ class QtMainLoop::Impl : public WatchCallbackInterface {
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
// do nothing
}
@@ -283,6 +287,7 @@ void QtMainLoop::Run() {
}
bool QtMainLoop::DoIteration(bool may_block) {
+ GGL_UNUSED(may_block);
return true;
}
@@ -345,6 +350,7 @@ void WatchNode::OnTimeout() {
}
void WatchNode::OnIOEvent(int fd) {
+ GGL_UNUSED(fd);
if (!calling_ && !removing_) {
calling_ = true;
bool ret = callback_->Call(main_loop_, watch_id_);
diff --git a/ggadget/qt/qt_menu.cc b/ggadget/qt/qt_menu.cc
index 630336e..d67b812 100644
--- a/ggadget/qt/qt_menu.cc
+++ b/ggadget/qt/qt_menu.cc
@@ -30,6 +30,7 @@ class QtMenu::Impl {
void AddItem(const char *item_text, int style, int stock_icon,
ggadget::Slot1<void, const char *> *handler,
int priority) {
+ GGL_UNUSED(stock_icon);
// FIXME: support stock icons.
QAction *action;
if (!item_text || !*item_text) {
diff --git a/ggadget/qt/qt_view_host.cc b/ggadget/qt/qt_view_host.cc
index f102393..0fd6aa5 100644
--- a/ggadget/qt/qt_view_host.cc
+++ b/ggadget/qt/qt_view_host.cc
@@ -140,7 +140,7 @@ void QtViewHost::SetCaption(const std::string &caption) {
impl_->window_->setWindowTitle(impl_->caption_);
}
-void QtViewHost::SetShowCaptionAlways(bool always) {
+void QtViewHost::SetShowCaptionAlways(bool) {
}
void QtViewHost::SetCursor(ViewInterface::CursorType type) {
@@ -174,6 +174,7 @@ bool QtViewHost::ShowContextMenu(int button) {
}
void QtViewHost::BeginMoveDrag(int button) {
+ GGL_UNUSED(button);
}
void QtViewHost::Alert(const ViewInterface *view, const char *message) {
diff --git a/ggadget/qt/qt_view_host.h b/ggadget/qt/qt_view_host.h
index 31a1506..be4b705 100644
--- a/ggadget/qt/qt_view_host.h
+++ b/ggadget/qt/qt_view_host.h
@@ -76,7 +76,10 @@ class QtViewHost : public ViewHostInterface {
Slot1<bool, int> *feedback_handler);
virtual void CloseView();
virtual bool ShowContextMenu(int button);
- virtual void BeginResizeDrag(int button, ViewInterface::HitTest hittest) {}
+ virtual void BeginResizeDrag(int button, ViewInterface::HitTest hittest) {
+ GGL_UNUSED(button);
+ GGL_UNUSED(hittest);
+ }
virtual void BeginMoveDrag(int button);
virtual void Alert(const ViewInterface *view, const char *message);
diff --git a/ggadget/qt/qt_view_host_internal.h b/ggadget/qt/qt_view_host_internal.h
index 5583b2f..bec2119 100644
--- a/ggadget/qt/qt_view_host_internal.h
+++ b/ggadget/qt/qt_view_host_internal.h
@@ -210,6 +210,7 @@ class QtViewHost::Impl : public QObject {
}
bool ShowContextMenu(int button) {
+ GGL_UNUSED(button);
ASSERT(view_);
context_menu_.clear();
QtMenu qt_menu(&context_menu_);
diff --git a/ggadget/qt/qt_view_widget.cc b/ggadget/qt/qt_view_widget.cc
index 8e5796c..f2b5f88 100644
--- a/ggadget/qt/qt_view_widget.cc
+++ b/ggadget/qt/qt_view_widget.cc
@@ -376,6 +376,7 @@ class QtViewWidget::Impl {
event->acceptProposedAction();
}
void dragLeaveEvent(QDragLeaveEvent *event) {
+ GGL_UNUSED(event);
if (!view_) return;
DLOG("drag leave");
DragEvent drag_event(Event::EVENT_DRAG_OUT, 0, 0);
@@ -545,6 +546,7 @@ void QtViewWidget::QueueDraw() {
}
void QtViewWidget::timerEvent(QTimerEvent *event) {
+ GGL_UNUSED(event);
uint64_t current_time = GetGlobalMainLoop()->GetCurrentTime();
if (impl_->draw_queued_) {
impl_->draw_queued_ = false;
@@ -735,12 +737,14 @@ void QtViewWidget::resizeEvent(QResizeEvent *event) {
}
void QtViewWidget::focusInEvent(QFocusEvent *event) {
+ GGL_UNUSED(event);
if (!impl_->view_) return;
SimpleEvent e(Event::EVENT_FOCUS_IN);
impl_->view_->OnOtherEvent(e);
}
void QtViewWidget::focusOutEvent(QFocusEvent *event) {
+ GGL_UNUSED(event);
if (!impl_->view_) return;
SimpleEvent e(Event::EVENT_FOCUS_OUT);
impl_->view_->OnOtherEvent(e);
diff --git a/ggadget/scriptable_helper.cc b/ggadget/scriptable_helper.cc
index 5704591..5425222 100644
--- a/ggadget/scriptable_helper.cc
+++ b/ggadget/scriptable_helper.cc
@@ -55,6 +55,7 @@ class ScriptableHelperImpl : public ScriptableHelperImplInterface {
// called.
virtual uint64_t GetClassId() const { return 0; }
virtual bool IsInstanceOf(uint64_t class_id) const {
+ GGL_UNUSED(class_id);
ASSERT(false); return false;
}
virtual bool IsStrict() const { ASSERT(false); return false; }
@@ -92,6 +93,7 @@ class ScriptableHelperImpl : public ScriptableHelperImplInterface {
}
void OnRefChange(int ref_count, int change) {
+ GGL_UNUSED(ref_count);
// We have a similar mechanism in ScriptableHolder.
// Please see the comments there.
if (change == 0) {
@@ -373,11 +375,14 @@ class StringEnumGetter : public Slot0<const char *> {
}
virtual ResultVariant Call(ScriptableInterface *obj,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
int index = VariantValue<int>()(slot_->Call(obj, 0, NULL).v());
return ResultVariant(index >= 0 && index < count_ ?
Variant(names_[index]) : Variant(""));
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false; // Not used.
}
Slot *slot_;
@@ -394,6 +399,8 @@ class StringEnumSetter : public Slot1<void, const char *> {
}
virtual ResultVariant Call(ScriptableInterface *obj,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
const char *name = VariantValue<const char *>()(argv[0]);
if (!name)
return ResultVariant();
@@ -408,6 +415,7 @@ class StringEnumSetter : public Slot1<void, const char *> {
return ResultVariant();
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false; // Not used.
}
Slot *slot_;
@@ -449,10 +457,13 @@ class ClassSignalGetter : public Slot0<Slot *> {
}
virtual ResultVariant Call(ScriptableInterface *obj,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
Slot *slot = class_signal_->GetSignal(obj)->GetDefaultSlot();
return ResultVariant(Variant(slot));
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false; // Not used.
}
private:
@@ -478,6 +489,7 @@ class ClassSignalSetter : public Slot1<void, Slot *> {
return ResultVariant();
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
return false; // Not used.
}
private:
@@ -550,6 +562,7 @@ void ScriptableHelperImpl::Ref() const {
}
void ScriptableHelperImpl::Unref(bool transient) const {
+ GGL_UNUSED(transient);
// The parameter traisnent is ignored here. Let the ScriptableHelper
// template deal with it.
#ifdef VERBOSE_DEBUG_REF
diff --git a/ggadget/scriptable_holder.h b/ggadget/scriptable_holder.h
index 0907ef6..0467722 100644
--- a/ggadget/scriptable_holder.h
+++ b/ggadget/scriptable_holder.h
@@ -70,6 +70,7 @@ class ScriptableHolder {
private:
void OnRefChange(int ref_count, int change) {
+ GGL_UNUSED(ref_count);
// The object's destructor is being called.
// This holder still holds a reference on this scriptable object.
// If the program reaches here, the object must be a native owned object,
diff --git a/ggadget/scriptable_menu.cc b/ggadget/scriptable_menu.cc
index d23aa36..d53d144 100644
--- a/ggadget/scriptable_menu.cc
+++ b/ggadget/scriptable_menu.cc
@@ -50,6 +50,7 @@ class ScriptableMenu::Impl : public SmallObject<> {
return result;
}
virtual bool operator==(const Slot &another) const {
+ GGL_UNUSED(another);
// Not used.
return false;
}
diff --git a/ggadget/scrolling_element.cc b/ggadget/scrolling_element.cc
index 8a7497b..c11d693 100644
--- a/ggadget/scrolling_element.cc
+++ b/ggadget/scrolling_element.cc
@@ -222,6 +222,7 @@ int ScrollingElement::GetXPageStep() const {
}
void ScrollingElement::SetXPageStep(int value) {
+ GGL_UNUSED(value);
// TODO: X scroll bar is not supported yet.
}
@@ -242,6 +243,7 @@ int ScrollingElement::GetXLineStep() const {
}
void ScrollingElement::SetXLineStep(int value) {
+ GGL_UNUSED(value);
// TODO: X scroll bar is not supported yet.
}
diff --git a/ggadget/sidebar.cc b/ggadget/sidebar.cc
index 04f5e59..b3b3de7 100644
--- a/ggadget/sidebar.cc
+++ b/ggadget/sidebar.cc
@@ -100,9 +100,9 @@ class SideBar::Impl : public View {
virtual void EnableInputShapeMask(bool /* enable */) {
// Do nothing.
}
- virtual void SetResizable(ViewInterface::ResizableMode mode) {}
- virtual void SetCaption(const std::string &caption) {}
- virtual void SetShowCaptionAlways(bool always) {}
+ virtual void SetResizable(ViewInterface::ResizableMode) {}
+ virtual void SetCaption(const std::string &) {}
+ virtual void SetShowCaptionAlways(bool) {}
virtual void SetCursor(ViewInterface::CursorType type) {
view_element_->SetCursor(type);
owner_->view_host_->SetCursor(type);
@@ -119,6 +119,8 @@ class SideBar::Impl : public View {
}
virtual bool ShowView(bool modal, int flags,
Slot1<bool, int> *feedback_handler) {
+ GGL_UNUSED(modal);
+ GGL_UNUSED(flags);
delete feedback_handler;
if (view_element_->GetChildView()) {
view_element_->SetVisible(true);
@@ -134,8 +136,13 @@ class SideBar::Impl : public View {
virtual bool ShowContextMenu(int button) {
return owner_->view_host_->ShowContextMenu(button);
}
- virtual void BeginResizeDrag(int button, ViewInterface::HitTest hittest) {}
- virtual void BeginMoveDrag(int button) {}
+ virtual void BeginResizeDrag(int button, ViewInterface::HitTest hittest) {
+ GGL_UNUSED(button);
+ GGL_UNUSED(hittest);
+ }
+ virtual void BeginMoveDrag(int button) {
+ GGL_UNUSED(button);
+ }
virtual void Alert(const ViewInterface *view, const char *message) {
owner_->view_host_->Alert(view, message);
}
diff --git a/ggadget/signals.h b/ggadget/signals.h
index e0d1b7c..05c4879 100644
--- a/ggadget/signals.h
+++ b/ggadget/signals.h
@@ -196,6 +196,7 @@ class SignalSlot : public Slot {
virtual ResultVariant Call(ScriptableInterface *obj,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(obj);
// A SignalSlot is always bound to an object, so obj is ignored.
return signal_->Emit(argc, argv);
}
diff --git a/ggadget/slot.h b/ggadget/slot.h
index ef41ffa..add3a15 100644
--- a/ggadget/slot.h
+++ b/ggadget/slot.h
@@ -143,6 +143,8 @@ class PrototypeSlot0 : public Slot {
typedef PrototypeSlot0<R> SelfType;
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argc);
+ GGL_UNUSED(argv);
ASSERT(false);
return ResultVariant();
}
@@ -161,6 +163,7 @@ class FunctorSlot0 : public Slot0<R> {
FunctorSlot0(F functor) : functor_(functor) { }
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
return ResultVariant(Variant(functor_()));
}
@@ -183,6 +186,7 @@ class FunctorSlot0<void, F> : public Slot0<void> {
FunctorSlot0(F functor) : functor_(functor) { }
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
functor_();
return ResultVariant();
@@ -209,6 +213,7 @@ class MethodSlot0 : public Slot0<R> {
int argc, const Variant argv[]) const {
// object parameter is ignored because object is bound when this object
// is constructed.
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
return ResultVariant(Variant((object_->*method_)()));
}
@@ -230,10 +235,12 @@ class MethodSlot0<void, T, M> : public Slot0<void> {
public:
typedef MethodSlot0<void, T, M> SelfType;
MethodSlot0(T* object, M method) : object_(object), method_(method) { }
- virtual ResultVariant Call(ScriptableInterface *,
+ virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
// object parameter is ignored because object is bound when this object
// is constructed.
+ GGL_UNUSED(object);
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
(object_->*method_)();
return ResultVariant();
@@ -268,6 +275,7 @@ class UnboundMethodSlot0 : public Slot0<R> {
}
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
ASSERT(object);
return ResultVariant(Variant((down_cast<T *>(object)->*method_)()));
@@ -295,6 +303,7 @@ class UnboundMethodSlot0<void, T, M> : public Slot0<void> {
void operator()(T *object) const { Call(object, 0, NULL); }
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
ASSERT(object);
(down_cast<T *>(object)->*method_)();
@@ -330,6 +339,7 @@ class DelegatedMethodSlot0 : public Slot0<R> {
}
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
ASSERT(object && delegate_getter_(down_cast<T *>(object)));
return ResultVariant(Variant(
@@ -361,6 +371,7 @@ class DelegatedMethodSlot0<void, T, M, DelegateGetter> : public Slot0<void> {
void operator()(T *object) const { Call(object, 0, NULL); }
virtual ResultVariant Call(ScriptableInterface *object,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
ASSERT(object && delegate_getter_(down_cast<T *>(object)));
(delegate_getter_(down_cast<T *>(object))->*method_)();
@@ -424,6 +435,7 @@ class FunctorSlotClosure0 : public Slot0<R> {
FunctorSlotClosure0(F functor, PA pa) : functor_(functor), pa_(pa) { }
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
return ResultVariant(Variant(functor_(pa_)));
}
@@ -447,6 +459,7 @@ class FunctorSlotClosure0<void, F, PA> : public Slot0<void> {
FunctorSlotClosure0(F functor, PA pa) : functor_(functor), pa_(pa) { }
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
functor_(pa_);
return ResultVariant(Variant());
@@ -498,6 +511,7 @@ class MethodSlotClosure0<void, T, M, PA> : public Slot0<void> {
: obj_(obj), method_(method), pa_(pa) { }
virtual ResultVariant Call(ScriptableInterface *,
int argc, const Variant argv[]) const {
+ GGL_UNUSED(argv);
ASSERT(argc == 0);
(obj_->*method_)(pa_);
return ResultVariant(Variant());
@@ -697,6 +711,8 @@ class PrototypeSlot##n : public Slot##n<R, _arg_type_names> { \
typedef PrototypeSlot##n<R, _arg_type_names> SelfType; \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argc); \
+ GGL_UNUSED(argv); \
ASSERT(false); return ResultVariant(); \
} \
virtual bool operator==(const Slot &another) const { \
@@ -711,6 +727,7 @@ class FunctorSlot##n : public Slot##n<R, _arg_type_names> { \
FunctorSlot##n(F functor) : functor_(functor) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
return ResultVariant(Variant(functor_(_call_args))); \
} \
@@ -731,6 +748,7 @@ class FunctorSlot##n<void, _arg_type_names, F> : \
FunctorSlot##n(F functor) : functor_(functor) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
functor_(_call_args); \
return ResultVariant(Variant()); \
@@ -751,6 +769,7 @@ class MethodSlot##n : public Slot##n<R, _arg_type_names> { \
MethodSlot##n(T *obj, M method) : obj_(obj), method_(method) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
return ResultVariant(Variant((obj_->*method_)(_call_args))); \
} \
@@ -772,6 +791,7 @@ class MethodSlot##n<void, _arg_type_names, T, M> : \
MethodSlot##n(T *obj, M method) : obj_(obj), method_(method) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
(obj_->*method_)(_call_args); \
return ResultVariant(Variant()); \
@@ -803,6 +823,7 @@ class UnboundMethodSlot##n : public Slot##n<R, _arg_type_names> { \
} \
virtual ResultVariant Call(ScriptableInterface *obj, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
ASSERT(obj); \
return ResultVariant(Variant( \
@@ -833,6 +854,7 @@ class UnboundMethodSlot##n<void, _arg_type_names, T, M> : \
} \
virtual ResultVariant Call(ScriptableInterface *obj, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
ASSERT(obj); \
(down_cast<T *>(obj)->*method_)(_call_args); \
@@ -868,6 +890,7 @@ class DelegatedMethodSlot##n : public Slot##n<R, _arg_type_names> { \
} \
virtual ResultVariant Call(ScriptableInterface *obj, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
ASSERT(obj && delegate_getter_(down_cast<T *>(obj))); \
return ResultVariant(Variant( \
@@ -903,6 +926,7 @@ class DelegatedMethodSlot##n<void, _arg_type_names, T, M, DelegateGetter> \
} \
virtual ResultVariant Call(ScriptableInterface *obj, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
ASSERT(obj && delegate_getter_(down_cast<T *>(obj))); \
(delegate_getter_(down_cast<T *>(obj))->*method_)(_call_args); \
@@ -947,6 +971,7 @@ class FunctorSlotClosure##n : public Slot##n<R, _arg_type_names> { \
FunctorSlotClosure##n(F functor, PA pa) : functor_(functor), pa_(pa) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
return ResultVariant(Variant(functor_(_call_args, pa_))); \
} \
@@ -968,6 +993,7 @@ class FunctorSlotClosure##n<void, _arg_type_names, F, PA> : \
FunctorSlotClosure##n(F functor, PA pa) : functor_(functor), pa_(pa) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
functor_(_call_args, pa_); \
return ResultVariant(Variant()); \
@@ -990,6 +1016,7 @@ class MethodSlotClosure##n : public Slot##n<R, _arg_type_names> { \
: obj_(obj), method_(method), pa_(pa) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
return ResultVariant(Variant((obj_->*method_)(_call_args, pa_))); \
} \
@@ -1013,6 +1040,7 @@ class MethodSlotClosure##n<void, _arg_type_names, T, M, PA> : \
: obj_(obj), method_(method), pa_(pa) { } \
virtual ResultVariant Call(ScriptableInterface *, \
int argc, const Variant argv[]) const { \
+ GGL_UNUSED(argv); \
ASSERT(argc == n); \
(obj_->*method_)(_call_args, pa_); \
return ResultVariant(Variant()); \
diff --git a/ggadget/tests/test_module.cc b/ggadget/tests/test_module.cc
index e3d25ee..3b2b34b 100644
--- a/ggadget/tests/test_module.cc
+++ b/ggadget/tests/test_module.cc
@@ -68,6 +68,7 @@ extern "C" {
bool FUNC_NAME(RegisterScriptExtension)(
ggadget::ScriptContextInterface *context,
ggadget::Gadget *gadget) {
+ GGL_UNUSED(gadget);
LOG("Register Script extension %s, context=%p",
AS_STRING(MODULE_NAME), context);
return true;
diff --git a/ggadget/variant.h b/ggadget/variant.h
index f740287..ae6528e 100644
--- a/ggadget/variant.h
+++ b/ggadget/variant.h
@@ -737,7 +737,9 @@ template <>
struct VariantValue<void> {
typedef void value_type;
- value_type operator()(const Variant &v) { }
+ value_type operator()(const Variant &v) {
+ GGL_UNUSED(v);
+ }
};
/**
diff --git a/ggadget/view.cc b/ggadget/view.cc
index be34491..4b479c5 100644
--- a/ggadget/view.cc
+++ b/ggadget/view.cc
@@ -156,6 +156,7 @@ class View::Impl : public SmallObject<> {
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
ASSERT(event_.GetToken() == watch_id);
delete this;
}
diff --git a/ggadget/view_decorator_base.cc b/ggadget/view_decorator_base.cc
index 4cba3ed..ceeb43d 100644
--- a/ggadget/view_decorator_base.cc
+++ b/ggadget/view_decorator_base.cc
@@ -42,10 +42,14 @@ class ViewDecoratorBase::Impl : public SmallObject<> {
public:
SignalPostCallback(const Signal0<void> *signal) : signal_(signal) {}
virtual bool Call(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
(*signal_)();
return false;
}
virtual void OnRemove(MainLoopInterface *main_loop, int watch_id) {
+ GGL_UNUSED(main_loop);
+ GGL_UNUSED(watch_id);
delete this;
}
const Signal0<void> *signal_;
@@ -665,6 +669,8 @@ void ViewDecoratorBase::GetClientExtents(double *width, double *height) const {
bool ViewDecoratorBase::OnClientSizing(double *width, double *height) {
// To be implemented by derived classes to report suitable client size when
// child view is not visible.
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
return true;
}
diff --git a/ggadget/view_element.cc b/ggadget/view_element.cc
index 508736c..131ee77 100644
--- a/ggadget/view_element.cc
+++ b/ggadget/view_element.cc
@@ -398,6 +398,7 @@ EventResult ViewElement::OnMouseEvent(const MouseEvent &event,
EventResult ViewElement::OnDragEvent(const DragEvent &event, bool direct,
BasicElement **fired_element) {
+ GGL_UNUSED(direct);
if (!impl_->child_view_)
return EVENT_RESULT_UNHANDLED;
diff --git a/ggadget/xml_dom.cc b/ggadget/xml_dom.cc
index e64de35..0f02d3f 100644
--- a/ggadget/xml_dom.cc
+++ b/ggadget/xml_dom.cc
@@ -670,8 +670,14 @@ class DOMNodeImpl : public SmallObject<> {
class EmptyNodeList : public DOMNodeListBase {
public:
DEFINE_CLASS_ID(0xd59e03c958194bd8, DOMNodeListInterface);
- virtual DOMNodeInterface *GetItem(size_t index) { return NULL; }
- virtual const DOMNodeInterface *GetItem(size_t index) const { return NULL; }
+ virtual DOMNodeInterface *GetItem(size_t index) {
+ GGL_UNUSED(index);
+ return NULL;
+ }
+ virtual const DOMNodeInterface *GetItem(size_t index) const {
+ GGL_UNUSED(index);
+ return NULL;
+ }
virtual size_t GetLength() const { return 0; }
};
@@ -1009,6 +1015,7 @@ class DOMNodeBase : public ScriptableHelper<Interface>,
virtual std::string GetNodeValue() const { return std::string(); }
virtual DOMExceptionCode SetNodeValue(const std::string &node_value) {
+ GGL_UNUSED(node_value);
return DOM_NO_MODIFICATION_ALLOWED_ERR;
}
virtual bool AllowsNodeValue() const { return false; }
@@ -1362,6 +1369,7 @@ class DOMCharacterData : public DOMNodeBase<Interface1> {
protected:
virtual DOMExceptionCode CheckNewChild(DOMNodeInterface *new_child) {
+ GGL_UNUSED(new_child);
// DOMCharacterData doesn't allow adding children to it.
return DOM_HIERARCHY_REQUEST_ERR;
}
@@ -1418,6 +1426,7 @@ class DOMAttr : public DOMNodeBase<DOMAttrInterface> {
}
virtual DOMNodeInterface *CloneNode(bool deep) const {
+ GGL_UNUSED(deep);
// Attr.cloneNode always clone its children, even if deep is false.
return Super::CloneNode(true);
}
@@ -1452,6 +1461,7 @@ class DOMAttr : public DOMNodeBase<DOMAttrInterface> {
void SetOwnerElement(DOMElement *owner_element); // Defined after DOMElement.
virtual void AppendXML(size_t indent, std::string *xml) {
+ GGL_UNUSED(indent);
// Omit the indent parameter, let the parent deal with it.
xml->append(GetNodeName());
xml->append("=\"");
@@ -1876,6 +1886,7 @@ class DOMText : public DOMCharacterData<DOMTextInterface> {
}
virtual void AppendXML(size_t indent, std::string *xml) {
+ GGL_UNUSED(indent);
// Omit the indent parameter, let the parent deal with it.
std::string node_value(GetNodeValue());
std::string trimmed = TrimString(EncodeXMLString(GetNodeValue()));
@@ -2078,6 +2089,7 @@ class DOMProcessingInstruction
protected:
virtual DOMExceptionCode CheckNewChild(DOMNodeInterface *new_child) {
+ GGL_UNUSED(new_child);
// DOMProcessingInstruction doesn't allow adding children to it.
return DOM_HIERARCHY_REQUEST_ERR;
}
@@ -2316,6 +2328,7 @@ class DOMDocument : public DOMNodeBase<DOMDocumentInterface> {
virtual DOMExceptionCode CreateEntityReference(
const std::string &name, DOMEntityReferenceInterface **result) {
+ GGL_UNUSED(name);
ASSERT(result);
*result = NULL;
return DOM_NOT_SUPPORTED_ERR;
@@ -2353,6 +2366,7 @@ class DOMDocument : public DOMNodeBase<DOMDocumentInterface> {
protected:
virtual DOMNodeInterface *CloneSelf(DOMDocumentInterface *owner_document) {
+ GGL_UNUSED(owner_document);
return NULL;
}
@@ -2416,6 +2430,7 @@ class DOMDocument : public DOMNodeBase<DOMDocumentInterface> {
}
ScriptableInterface *ScriptCreateEntityReference(const std::string &name) {
+ GGL_UNUSED(name);
// TODO: if we support DTD.
return NULL;
}
@@ -2428,8 +2443,11 @@ class DOMDocument : public DOMNodeBase<DOMDocumentInterface> {
}
static void DummySetProperty(const std::string &name, const Variant &value) {
+ GGL_UNUSED(name);
+ GGL_UNUSED(value);
}
static Variant DummyGetProperty(const std::string &name) {
+ GGL_UNUSED(name);
return Variant();
}
diff --git a/hosts/gtk/gadget_browser_host.h b/hosts/gtk/gadget_browser_host.h
index 731a354..db2061f 100644
--- a/hosts/gtk/gadget_browser_host.h
+++ b/hosts/gtk/gadget_browser_host.h
@@ -31,7 +31,7 @@ class GadgetBrowserHost : public ggadget::HostInterface {
GadgetBrowserHost(ggadget::HostInterface *owner, int view_debug_mode)
: owner_(owner), view_debug_mode_(view_debug_mode) {
}
- virtual ViewHostInterface *NewViewHost(Gadget *gadget,
+ virtual ViewHostInterface *NewViewHost(Gadget *,
ViewHostInterface::Type type) {
int flags = ggadget::gtk::SingleViewHost::WM_MANAGEABLE |
ggadget::gtk::SingleViewHost::REMOVE_ON_CLOSE |
@@ -44,12 +44,13 @@ class GadgetBrowserHost : public ggadget::HostInterface {
show_debug_console);
}
virtual void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ggadget::GetGadgetManager()->RemoveGadgetInstance(gadget->GetInstanceID());
}
virtual bool LoadFont(const char *filename) {
return owner_->LoadFont(filename);
}
- virtual void ShowGadgetDebugConsole(Gadget *gadget) {}
+ virtual void ShowGadgetDebugConsole(Gadget *) {}
virtual int GetDefaultFontSize() { return ggadget::kDefaultFontSize; }
virtual bool OpenURL(const Gadget *gadget, const char *url) {
return owner_->OpenURL(gadget, url);
diff --git a/hosts/gtk/gtk_host_base.cc b/hosts/gtk/gtk_host_base.cc
index 6ac6f87..f3de21b 100644
--- a/hosts/gtk/gtk_host_base.cc
+++ b/hosts/gtk/gtk_host_base.cc
@@ -81,6 +81,7 @@ bool GtkHostBase::ConfirmGadget(const std::string &path,
const std::string &title,
const std::string &description,
Permissions *permissions) {
+ GGL_UNUSED(path);
// If the permissions was already saved and there is no ungranted permission,
// just returns true.
if (Gadget::LoadGadgetInitialPermissions(options_name.c_str(), permissions) &&
diff --git a/hosts/gtk/sidebar_gtk_host.cc b/hosts/gtk/sidebar_gtk_host.cc
index 6a1ee5c..12586ca 100644
--- a/hosts/gtk/sidebar_gtk_host.cc
+++ b/hosts/gtk/sidebar_gtk_host.cc
@@ -446,6 +446,7 @@ class SideBarGtkHost::Impl {
}
void OnSideBarResized(int width, int height) {
+ GGL_UNUSED(height);
// ignore width changes when the sidebar is minimized.
if (!sidebar_->IsMinimized()) {
sidebar_width_ = width;
@@ -536,7 +537,7 @@ class SideBarGtkHost::Impl {
}
}
- void OnSideBarClick(View *view) {
+ void OnSideBarClick(View *) {
if (auto_hide_source_) {
g_source_remove(auto_hide_source_);
auto_hide_source_ = 0;
@@ -924,6 +925,7 @@ class SideBarGtkHost::Impl {
// Only for floating main view.
bool OnMainViewBeginMove(int button, int gadget_id) {
+ GGL_UNUSED(button);
GadgetInfo *info = &gadgets_[gadget_id];
ASSERT(info->gadget);
ASSERT(info->floating);
@@ -1095,6 +1097,8 @@ class SideBarGtkHost::Impl {
}
bool OnDetailsViewBeginMove(int button, int gadget_id) {
+ GGL_UNUSED(button);
+ GGL_UNUSED(gadget_id);
// details window is not allowed to move, just return true
return true;
}
@@ -1172,6 +1176,7 @@ class SideBarGtkHost::Impl {
}
bool OnPopOutViewBeginResize(int button, int hittest, int gadget_id) {
+ GGL_UNUSED(gadget_id);
if (button != MouseEvent::BUTTON_LEFT || hittest == ViewInterface::HT_TOP)
return true;
@@ -1189,6 +1194,8 @@ class SideBarGtkHost::Impl {
}
bool OnPopOutViewBeginMove(int button, int gadget_id) {
+ GGL_UNUSED(gadget_id);
+ GGL_UNUSED(button);
// popout window is not allowed to move, just return true
return true;
}
@@ -1574,6 +1581,7 @@ class SideBarGtkHost::Impl {
}
void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ASSERT(gadget);
int id = gadget->GetInstanceID();
// If RemoveGadgetInstance() returns false, then means this instance is not
@@ -1607,22 +1615,27 @@ class SideBarGtkHost::Impl {
// handlers for menu items
void FloatingGadgetMenuHandler(const char *str, Gadget *gadget) {
+ GGL_UNUSED(str);
gadget->ShowMainView();
}
void AddGadgetMenuHandler(const char *str) {
+ GGL_UNUSED(str);
gadget_manager_->ShowGadgetBrowserDialog(&gadget_browser_host_);
}
void ShowAllMenuHandler(const char *str) {
+ GGL_UNUSED(str);
ShowOrHideAll(true);
}
void HideAllMenuHandler(const char *str) {
+ GGL_UNUSED(str);
ShowOrHideAll(false);
}
void AutoHideMenuHandler(const char *str) {
+ GGL_UNUSED(str);
auto_hide_ = !auto_hide_;
options_->PutInternalValue(kOptionAutoHide, Variant(auto_hide_));
@@ -1639,6 +1652,7 @@ class SideBarGtkHost::Impl {
}
void AlwaysOnTopMenuHandler(const char *str) {
+ GGL_UNUSED(str);
always_on_top_ = !always_on_top_;
options_->PutInternalValue(kOptionAlwaysOnTop,
Variant(always_on_top_));
@@ -1672,6 +1686,7 @@ class SideBarGtkHost::Impl {
}
void SideBarPositionMenuHandler(const char *str, int position) {
+ GGL_UNUSED(str);
CloseAllPopOutWindowsOfSideBar(-1);
sidebar_position_ = position;
options_->PutInternalValue(kOptionPosition,
@@ -1683,6 +1698,7 @@ class SideBarGtkHost::Impl {
}
void OpenCloseSidebarMenuHandler(const char *str) {
+ GGL_UNUSED(str);
closed_ = !closed_;
ShowOrHideSideBar(!closed_);
}
@@ -1701,6 +1717,7 @@ class SideBarGtkHost::Impl {
}
void FontSizeMenuHandler(const char *str, int delta) {
+ GGL_UNUSED(str);
int new_font_size;
if (delta == 0) {
new_font_size = kDefaultFontSize;
@@ -1716,12 +1733,14 @@ class SideBarGtkHost::Impl {
}
void AboutMenuHandler(const char *str) {
+ GGL_UNUSED(str);
safe_to_exit_ = false;
ShowAboutDialog(owner_);
safe_to_exit_ = true;
}
void ExitMenuHandler(const char *str) {
+ GGL_UNUSED(str);
owner_->Exit();
}
@@ -1756,6 +1775,7 @@ class SideBarGtkHost::Impl {
// gtk call-backs
static gboolean ToplevelWindowFocusOutHandler(
GtkWidget *widget, GdkEventFocus *event, Impl *impl) {
+ GGL_UNUSED(event);
DLOG("ToplevelWindowFocusOutHandler %d", widget == impl->sidebar_window_);
if (impl->auto_hide_ && !impl->sidebar_->IsMinimized() &&
impl->auto_hide_source_ == 0) {
@@ -1777,6 +1797,7 @@ class SideBarGtkHost::Impl {
static gboolean ToplevelWindowFocusInHandler(
GtkWidget *widget, GdkEventFocus *event, Impl *impl) {
+ GGL_UNUSED(event);
DLOG("ToplevelWindowFocusInHandler %d", widget == impl->sidebar_window_);
if (impl->auto_hide_source_) {
g_source_remove(impl->auto_hide_source_);
@@ -1787,6 +1808,8 @@ class SideBarGtkHost::Impl {
static gboolean SideBarEnterNotifyHandler(
GtkWidget *widget, GdkEventCrossing *event, Impl *impl) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(event);
DLOG("SideBarEnterNotifyHandler");
if (impl->auto_hide_source_) {
g_source_remove(impl->auto_hide_source_);
@@ -1809,6 +1832,8 @@ class SideBarGtkHost::Impl {
static gboolean SideBarLeaveNotifyHandler(
GtkWidget *widget, GdkEventCrossing *event, Impl *impl) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(event);
DLOG("SideBarLeaveNotifyHandler");
if (impl->auto_hide_ && !impl->sidebar_->IsMinimized() &&
!gtk_window_is_active(GTK_WINDOW(impl->sidebar_window_)) &&
@@ -1821,6 +1846,8 @@ class SideBarGtkHost::Impl {
static gboolean DragObserverMotionNotifyHandler(
GtkWidget *widget, GdkEventMotion *event, Impl *impl) {
+ GGL_UNUSED(widget);
+ GGL_UNUSED(event);
if (impl->sidebar_moving_) {
impl->OnSideBarMove();
} else if (impl->dragging_gadget_) {
@@ -1831,6 +1858,7 @@ class SideBarGtkHost::Impl {
static gboolean DragObserverButtonReleaseHandler(
GtkWidget *widget, GdkEventMotion *event, Impl *impl) {
+ GGL_UNUSED(widget);
gdk_pointer_ungrab(event->time);
if (impl->sidebar_moving_) {
impl->OnSideBarEndMove();
@@ -1843,6 +1871,7 @@ class SideBarGtkHost::Impl {
#if GTK_CHECK_VERSION(2,10,0) && defined(GGL_HOST_LINUX)
static void StatusIconActivateHandler(GtkWidget *widget, Impl *impl) {
+ GGL_UNUSED(widget);
if (!impl->gadgets_shown_ ||
(!impl->closed_ && impl->sidebar_->IsMinimized()))
impl->ShowOrHideAll(true);
@@ -1852,6 +1881,7 @@ class SideBarGtkHost::Impl {
static void StatusIconPopupMenuHandler(GtkWidget *widget, guint button,
guint activate_time, Impl *impl) {
+ GGL_UNUSED(widget);
if (impl->status_icon_menu_)
gtk_widget_destroy(impl->status_icon_menu_);
diff --git a/hosts/gtk/simple_gtk_host.cc b/hosts/gtk/simple_gtk_host.cc
index b5da39a..a7d244f 100644
--- a/hosts/gtk/simple_gtk_host.cc
+++ b/hosts/gtk/simple_gtk_host.cc
@@ -382,6 +382,7 @@ class SimpleGtkHost::Impl {
}
void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ASSERT(gadget);
ViewInterface *main_view = gadget->GetMainView();
@@ -474,6 +475,7 @@ class SimpleGtkHost::Impl {
}
void FontSizeMenuHandler(const char *str, int delta) {
+ GGL_UNUSED(str);
int new_font_size;
if (delta == 0) {
new_font_size = kDefaultFontSize;
@@ -490,6 +492,7 @@ class SimpleGtkHost::Impl {
}
void AboutMenuHandler(const char *str) {
+ GGL_UNUSED(str);
safe_to_exit_ = false;
ShowAboutDialog(owner_);
safe_to_exit_ = true;
@@ -693,6 +696,8 @@ class SimpleGtkHost::Impl {
}
void OnMainViewResizedHandler(int width, int height, int gadget_id) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end()) {
AdjustViewHostPosition(&it->second);
@@ -700,6 +705,8 @@ class SimpleGtkHost::Impl {
}
void OnMainViewMovedHandler(int x, int y, int gadget_id) {
+ GGL_UNUSED(x);
+ GGL_UNUSED(y);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end()) {
AdjustViewHostPosition(&it->second);
@@ -720,6 +727,7 @@ class SimpleGtkHost::Impl {
}
bool OnPopOutViewBeginResizeHandler(int button, int hittest, int gadget_id) {
+ GGL_UNUSED(button);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end() && it->second.popout) {
if (it->second.popout_on_right)
@@ -739,6 +747,8 @@ class SimpleGtkHost::Impl {
}
void OnPopOutViewResizedHandler(int width, int height, int gadget_id) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end() && it->second.popout) {
AdjustViewHostPosition(&it->second);
@@ -746,6 +756,7 @@ class SimpleGtkHost::Impl {
}
bool OnPopOutViewBeginMoveHandler(int button) {
+ GGL_UNUSED(button);
// User can't move popout view window.
return true;
}
@@ -763,6 +774,7 @@ class SimpleGtkHost::Impl {
}
bool OnDetailsViewBeginResizeHandler(int button, int hittest, int gadget_id) {
+ GGL_UNUSED(button);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end() && it->second.details) {
if (it->second.details_on_right)
@@ -782,6 +794,8 @@ class SimpleGtkHost::Impl {
}
void OnDetailsViewResizedHandler(int width, int height, int gadget_id) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
GadgetInfoMap::iterator it = gadgets_.find(gadget_id);
if (it != gadgets_.end() && it->second.details) {
AdjustViewHostPosition(&it->second);
@@ -789,6 +803,7 @@ class SimpleGtkHost::Impl {
}
bool OnDetailsViewBeginMoveHandler(int button) {
+ GGL_UNUSED(button);
// User can't move popout view window.
return true;
}
@@ -797,6 +812,7 @@ class SimpleGtkHost::Impl {
static void StatusIconPopupMenuHandler(GtkWidget *widget, guint button,
guint activate_time,
gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
gtk_menu_popup(GTK_MENU(impl->host_menu_), NULL, NULL,
gtk_status_icon_position_menu, impl->status_icon_,
@@ -813,6 +829,7 @@ class SimpleGtkHost::Impl {
#endif
static void ToggleAllGadgetsHandler(GtkWidget *widget, gpointer user_data) {
+ GGL_UNUSED(widget);
Impl *impl = reinterpret_cast<Impl *>(user_data);
impl->ToggleAllGadgets();
}
diff --git a/hosts/gtk/standalone_gtk_host.cc b/hosts/gtk/standalone_gtk_host.cc
index e9e1611..bb6483f 100644
--- a/hosts/gtk/standalone_gtk_host.cc
+++ b/hosts/gtk/standalone_gtk_host.cc
@@ -167,6 +167,7 @@ class StandaloneGtkHost::Impl {
ViewHostInterface *NewViewHost(Gadget *gadget,
ViewHostInterface::Type type) {
+ GGL_UNUSED(gadget);
int vh_flags = GtkHostBase::FlagsToViewHostFlags(flags_);
if (type == ViewHostInterface::VIEW_HOST_OPTIONS) {
vh_flags |= (SingleViewHost::DECORATED | SingleViewHost::WM_MANAGEABLE);
@@ -226,6 +227,7 @@ class StandaloneGtkHost::Impl {
}
void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ASSERT(gadget && gadget == gadget_);
owner_->Exit();
}
@@ -275,10 +277,14 @@ class StandaloneGtkHost::Impl {
}
void OnMainViewResizedHandler(int width, int height) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
AdjustViewHostPosition();
}
void OnMainViewMovedHandler(int x, int y) {
+ GGL_UNUSED(x);
+ GGL_UNUSED(y);
AdjustViewHostPosition();
}
@@ -290,6 +296,7 @@ class StandaloneGtkHost::Impl {
}
bool OnDetailsViewBeginResizeHandler(int button, int hittest) {
+ GGL_UNUSED(button);
if (details_on_right_) {
return hittest == ViewInterface::HT_LEFT ||
hittest == ViewInterface::HT_TOPLEFT ||
@@ -306,10 +313,13 @@ class StandaloneGtkHost::Impl {
}
void OnDetailsViewResizedHandler(int width, int height) {
+ GGL_UNUSED(width);
+ GGL_UNUSED(height);
AdjustViewHostPosition();
}
bool OnDetailsViewBeginMoveHandler(int button) {
+ GGL_UNUSED(button);
// User can't move popout view window.
return true;
}
diff --git a/hosts/qt/gadget_browser_host.h b/hosts/qt/gadget_browser_host.h
index ef627db..f247ae6 100644
--- a/hosts/qt/gadget_browser_host.h
+++ b/hosts/qt/gadget_browser_host.h
@@ -33,24 +33,30 @@ class GadgetBrowserHost : public ggadget::HostInterface {
}
virtual ViewHostInterface *NewViewHost(Gadget *gadget,
ViewHostInterface::Type type) {
+ GGL_UNUSED(gadget);
return new ggadget::qt::QtViewHost(
type, 1.0, ggadget::qt::QtViewHost::FLAG_RECORD_STATES,
view_debug_mode_, NULL);
}
virtual Gadget *LoadGadget(const char *path, const char *options_name,
int instance_id, bool show_debug_console) {
+ GGL_UNUSED(path);
+ GGL_UNUSED(options_name);
+ GGL_UNUSED(instance_id);
+ GGL_UNUSED(show_debug_console);
return NULL;
}
virtual void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ggadget::GetGadgetManager()->RemoveGadgetInstance(gadget->GetInstanceID());
}
virtual bool LoadFont(const char *filename) {
return owner_->LoadFont(filename);
}
virtual void Run() {}
- virtual void ShowGadgetDebugConsole(Gadget *gadget) {}
+ virtual void ShowGadgetDebugConsole(Gadget *) {}
virtual int GetDefaultFontSize() { return ggadget::kDefaultFontSize; }
- virtual bool OpenURL(const Gadget *gadget, const char *url) { return false; }
+ virtual bool OpenURL(const Gadget *, const char *) { return false; }
private:
ggadget::HostInterface *owner_;
int view_debug_mode_;
diff --git a/hosts/qt/qt_host_internal.h b/hosts/qt/qt_host_internal.h
index 1e20b7b..2af7cb3 100644
--- a/hosts/qt/qt_host_internal.h
+++ b/hosts/qt/qt_host_internal.h
@@ -216,6 +216,7 @@ class QtHost::Impl : public QObject {
}
void RemoveGadget(Gadget *gadget, bool save_data) {
+ GGL_UNUSED(save_data);
ViewInterface *main_view = gadget->GetMainView();
// If this gadget is popped out, popin it first.
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
index 557b3c0..245c2b0 100644
--- a/unittest/CMakeLists.txt
+++ b/unittest/CMakeLists.txt
@@ -15,5 +15,6 @@
IF(UNIX)
ADD_DEFINITIONS(-DOS_LINUX)
+ STRING(REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF(UNIX)
ADD_LIBRARY(gtest STATIC gtest.cc)
diff --git a/unittest/gtest_internal.h b/unittest/gtest_internal.h
index 684375e..0b22477 100644
--- a/unittest/gtest_internal.h
+++ b/unittest/gtest_internal.h
@@ -637,10 +637,12 @@ String FormatForFailureMessage(wchar_t wchar);
#define GTEST_FORMAT_IMPL(operand2_type, operand1_printer)\
inline String FormatForComparisonFailureMessage(\
operand2_type::value_type* str, const operand2_type& operand2) {\
+ (void)(operand2);\
return operand1_printer(str);\
}\
inline String FormatForComparisonFailureMessage(\
const operand2_type::value_type* str, const operand2_type& operand2) {\
+ (void)(operand2);\
return operand1_printer(str);\
}
This is a semiautomated message from "gitmail". Complaints or suggestions?
Mail edy...@gmail.com.