aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/errors.cc
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:36:23 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:46:02 -0500
commitc583a2520616c2736cffc389c89a48b159366e6c (patch)
treeb4925f26506fcee96c16119431c01760f05db95d /gdbsupport/errors.cc
parentca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff)
downloadbinutils-users/simark/clang-format.zip
binutils-users/simark/clang-format.tar.gz
binutils-users/simark/clang-format.tar.bz2
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
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);