aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2013-12-19 14:00:11 +0100
committerPierre Muller <muller@ics.u-strasbg.fr>2013-12-19 18:26:19 +0100
commit3f10b67a597334c1f7459ba696d40925fa7f4ae3 (patch)
tree09059822663fb31085d111815ed0f30c404e4c62 /bfd
parent12e8c7d7c2af309b8fd6bf0f61e99b0a6aad4c80 (diff)
downloadgdb-3f10b67a597334c1f7459ba696d40925fa7f4ae3.zip
gdb-3f10b67a597334c1f7459ba696d40925fa7f4ae3.tar.gz
gdb-3f10b67a597334c1f7459ba696d40925fa7f4ae3.tar.bz2
* Fix indentation issue and reorganize last commit entry
so that it is shorter than 80. peXXigen.c (rsrc_cmp): Fix unused variable warning.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/peXXigen.c39
2 files changed, 26 insertions, 21 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 60f393b..95355fc 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,7 +1,11 @@
2013-12-19 Pierre Muller <muller@sourceware.org>
- * peXXigen.c (u16_mbtouc): Avoid unused function warning by excluding if
- __CYGWIN__ or __MINGW32__ macro is defined.
+ * peXXigen.c (rsrc_cmp): Fix unused variable warning.
+
+2013-12-19 Pierre Muller <muller@sourceware.org>
+
+ * peXXigen.c (u16_mbtouc): Avoid unused function warning by excluding
+ if __CYGWIN__ or __MINGW32__ macro is defined.
(rsrc_cmp): Fix Windows host version and version without wchar header.
[__CYGWIN__, __MINGW32__]: Introduce rsrccmp macro.
Fix coding standard issues.
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 843cae8..d50db73 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -2981,7 +2981,6 @@ static signed int
rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
{
signed int res;
- unsigned int i;
bfd_byte * astring;
unsigned int alen;
bfd_byte * bstring;
@@ -3013,24 +3012,26 @@ rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
min (alen, blen));
#elif defined HAVE_WCHAR_H
- res = 0;
- for (i = min (alen, blen); i--; astring += 2, bstring += 2)
- {
- wchar_t awc;
- wchar_t bwc;
-
- /* Convert UTF-16 unicode characters into wchar_t characters so
- that we can then perform a case insensitive comparison. */
- int Alen = u16_mbtouc (& awc, (const unsigned short *) astring, 2);
- int Blen = u16_mbtouc (& bwc, (const unsigned short *) bstring, 2);
-
- if (Alen != Blen)
- return Alen - Blen;
- res = wcsncasecmp (& awc, & bwc, 1);
- if (res)
- break;
- }
-
+ {
+ unsigned int i;
+ res = 0;
+ for (i = min (alen, blen); i--; astring += 2, bstring += 2)
+ {
+ wchar_t awc;
+ wchar_t bwc;
+
+ /* Convert UTF-16 unicode characters into wchar_t characters so
+ that we can then perform a case insensitive comparison. */
+ int Alen = u16_mbtouc (& awc, (const unsigned short *) astring, 2);
+ int Blen = u16_mbtouc (& bwc, (const unsigned short *) bstring, 2);
+
+ if (Alen != Blen)
+ return Alen - Blen;
+ res = wcsncasecmp (& awc, & bwc, 1);
+ if (res)
+ break;
+ }
+ }
#else
/* Do the best we can - a case sensitive, untranslated comparison. */
res = memcmp (astring, bstring, min (alen, blen) * 2);