aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/errors.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/errors.cc')
-rw-r--r--gdbsupport/errors.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/gdbsupport/errors.cc b/gdbsupport/errors.cc
index 566be37..b5b9cf9 100644
--- a/gdbsupport/errors.cc
+++ b/gdbsupport/errors.cc
@@ -19,7 +19,7 @@
#include "common-defs.h"
#include "errors.h"
-#if defined (USE_WIN32API) || defined(__CYGWIN__)
+#if defined(USE_WIN32API) || defined(__CYGWIN__)
#include <windows.h>
#endif /* USE_WIN32API */
@@ -71,7 +71,7 @@ internal_warning_loc (const char *file, int line, const char *fmt, ...)
va_end (ap);
}
-#if defined (USE_WIN32API) || defined(__CYGWIN__)
+#if defined(USE_WIN32API) || defined(__CYGWIN__)
/* See errors.h. */
@@ -82,29 +82,23 @@ strwinerror (ULONGEST error)
TCHAR *msgbuf;
DWORD lasterr = GetLastError ();
DWORD chars = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM
- | FORMAT_MESSAGE_ALLOCATE_BUFFER,
- NULL,
- error,
- 0, /* Default language */
- (LPTSTR) &msgbuf,
- 0,
- NULL);
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, error, 0, /* Default language */
+ (LPTSTR) &msgbuf, 0, NULL);
if (chars != 0)
{
/* If there is an \r\n appended, zap it. */
- if (chars >= 2
- && msgbuf[chars - 2] == '\r'
- && msgbuf[chars - 1] == '\n')
- {
- chars -= 2;
- msgbuf[chars] = 0;
- }
+ if (chars >= 2 && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n')
+ {
+ chars -= 2;
+ msgbuf[chars] = 0;
+ }
if (chars > ARRAY_SIZE (buf) - 1)
- {
- chars = ARRAY_SIZE (buf) - 1;
- msgbuf [chars] = 0;
- }
+ {
+ chars = ARRAY_SIZE (buf) - 1;
+ msgbuf[chars] = 0;
+ }
#ifdef UNICODE
wcstombs (buf, msgbuf, chars + 1);