aboutsummaryrefslogtreecommitdiff
path: root/nxcompshad/src
diff options
context:
space:
mode:
Diffstat (limited to 'nxcompshad/src')
-rw-r--r--nxcompshad/src/Core.cpp2
-rw-r--r--nxcompshad/src/Logger.cpp20
-rw-r--r--nxcompshad/src/Logger.h8
-rw-r--r--nxcompshad/src/X11.cpp14
4 files changed, 16 insertions, 28 deletions
diff --git a/nxcompshad/src/Core.cpp b/nxcompshad/src/Core.cpp
index c5084e884..99ecce82f 100644
--- a/nxcompshad/src/Core.cpp
+++ b/nxcompshad/src/Core.cpp
@@ -216,7 +216,7 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s
// In order to allow this function to
// be suspended and resumed later, we
// need to save these two status vars.
- //
+ //
static int idxIlace = 0;
static int curLine = 0;
diff --git a/nxcompshad/src/Logger.cpp b/nxcompshad/src/Logger.cpp
index 2f3eab65c..9648509b8 100644
--- a/nxcompshad/src/Logger.cpp
+++ b/nxcompshad/src/Logger.cpp
@@ -41,14 +41,11 @@
Logger logger;
-void Logger::user(const char *format, ...)
+void Logger::user(const char *format, va_list arguments)
{
char string[1024];
- va_list arguments;
- va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
- va_end(arguments);
fprintf(stderr, "%s\n", string);
}
@@ -59,26 +56,20 @@ void Logger::error(const char *name, int error)
name, error, strerror(error));
}
-void Logger::warning(const char *name, const char *format, ...)
+void Logger::warning(const char *name, const char *format, va_list arguments)
{
char string[1024];
- va_list arguments;
- va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
- va_end(arguments);
fprintf(stderr, "%s: WARNING! %s\n", name, string);
}
-void Logger::test(const char *name, const char *format, ...)
+void Logger::test(const char *name, const char *format, va_list arguments)
{
char string[1024];
- va_list arguments;
- va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
- va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}
@@ -88,14 +79,11 @@ void Logger::trace(const char *name)
fprintf(stderr, "%s\n", name);
}
-void Logger::debug(const char *name, const char *format, ...)
+void Logger::debug(const char *name, const char *format, va_list arguments)
{
char string[1024];
- va_list arguments;
- va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
- va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}
diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h
index 8436c5f15..c4c46fe9a 100644
--- a/nxcompshad/src/Logger.h
+++ b/nxcompshad/src/Logger.h
@@ -43,17 +43,17 @@ class Logger
{
public:
- void user(const char *format, ...) __attribute__((format(printf, 2, 0)));
+ void user(const char *format, va_list arguments) __attribute__((format(printf, 2, 0)));
void error(const char *name, int error);
- void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
+ void warning(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
- void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
+ void test(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void trace(const char *name);
- void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
+ void debug(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void dump(const char *name, const char *data, int size);
};
diff --git a/nxcompshad/src/X11.cpp b/nxcompshad/src/X11.cpp
index 7a84b7340..9ad43101f 100644
--- a/nxcompshad/src/X11.cpp
+++ b/nxcompshad/src/X11.cpp
@@ -236,7 +236,7 @@ char *Poller::getRect(XRectangle r)
else
{
image_ -> width = r.width;
- image_ -> height = r.height;
+ image_ -> height = r.height;
image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad);
@@ -1155,11 +1155,11 @@ SendKeycode:
if (XKeysymToKeycode(event -> xkey.display, XK_A) != keycode)
{
KeySym keysym = XKeycodeToKeysym(event -> xkey.display, event -> xkey.keycode, 0);
-
+
if (keysym == XK_Mode_switch || keysym == XK_ISO_Level3_Shift)
{
logUser("Poller::handleKeyboardEvent: keysym [%x].\n", (unsigned int)keysym);
-
+
if (XKeycodeToKeysym(display_, 113, 0) == XK_ISO_Level3_Shift ||
(XKeycodeToKeysym(display_, 124, 0) == XK_ISO_Level3_Shift))
{
@@ -1169,7 +1169,7 @@ SendKeycode:
{
event -> xkey.keycode = XKeysymToKeycode(display_, XK_Mode_switch);
}
-
+
logUser("Poller::handleKeyboardEvent: keycode translated to [%x].\n", (unsigned int)event -> xkey.keycode);
}
else
@@ -1503,7 +1503,7 @@ void Poller::updateDamagedAreas(void)
int i;
int y;
-
+
for (i = 0; i < lastUpdatedRegion_ -> numRects; i++)
{
boxPtr = lastUpdatedRegion_ -> rects + i;
@@ -1515,7 +1515,7 @@ void Poller::updateDamagedAreas(void)
image_ -> bytes_per_line =
ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad);
-
+
if (XShmGetImage(display_, DefaultRootWindow(display_), image_,
boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0)
{
@@ -1554,7 +1554,7 @@ void Poller::updateDamagedAreas(void)
{
update(image_ -> data + y * image_ -> bytes_per_line, rectangle);
- rectangle.y++;
+ rectangle.y++;
}
if (shmExtension_ != 1)