Commit d0847fc2 authored by Povilas Kanapickas's avatar Povilas Kanapickas
Browse files

Fix unused parameter warnings

parent b9be5bc0
......@@ -9,4 +9,10 @@
#define DEFAULT_XORG_SERVER "Xorg"
#endif
#if defined __GNUC__ || defined __clang__
#define XORG_GTEST_UNUSED __attribute__((unused))
#else
#define XORG_GTEST_UNUSED
#endif
#endif
......@@ -399,7 +399,7 @@ const std::string& xorg::testing::XServer::GetVersion(void) {
return d_->version;
}
static int _x_error_handler(Display *dpy, XErrorEvent *err)
static int _x_error_handler(XORG_GTEST_UNUSED Display *dpy, XErrorEvent *err)
{
std::stringstream error;
switch(err->error_code) {
......@@ -435,7 +435,7 @@ static int _x_error_handler(Display *dpy, XErrorEvent *err)
static int _x_io_error_handler(Display *dpy) _X_NORETURN;
static int _x_io_error_handler(Display *dpy)
static int _x_io_error_handler(XORG_GTEST_UNUSED Display *dpy)
{
throw xorg::testing::XIOError("Connection to X Server lost. Possible server crash.");
}
......
......@@ -9,6 +9,12 @@
#include <gtest/gtest-spi.h>
#include <X11/extensions/XInput2.h>
#if defined __GNUC__ || defined __clang__
#define XORG_GTEST_UNUSED __attribute__((unused))
#else
#define XORG_GTEST_UNUSED
#endif
using namespace xorg::testing;
TEST(XServer, LogRemoval)
......@@ -247,7 +253,7 @@ TEST(XServer, ErrorHandler)
static bool error_handler_triggered = false;
static int _test_error_handler(Display *dpy, XErrorEvent *error) {
static int _test_error_handler(XORG_GTEST_UNUSED Display *dpy, XErrorEvent *error) {
error_handler_triggered = true;
if (error->error_code != BadColor)
ADD_FAILURE() << "Error handler triggered with wrong error code\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment