This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/Ada] Minor coding-style fixes in ada-lex.l:find_dot_all.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 3 Dec 2013 16:07:47 +0400
- Subject: [commit/Ada] Minor coding-style fixes in ada-lex.l:find_dot_all.
- Authentication-results: sourceware.org; auth=none
Hello,
These patch fixes some small GCS violations that I noticed while working
on that code...
gdb/ChangeLog:
* ada-lex.l (find_dot_all): Fix coding style violations.
Tested on x86_64-linux. Checked in.
Thanks,
--
Joel
---
gdb/ChangeLog | 4 ++++
gdb/ada-lex.l | 27 ++++++++++++++-------------
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cbf4039..b1055dc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2013-12-03 Joel Brobecker <brobecker@adacore.com>
+ * ada-lex.l (find_dot_all): Fix coding style violations.
+
+2013-12-03 Joel Brobecker <brobecker@adacore.com>
+
* ada-lex.l (find_dot_all): Use strncasecmp instead of strncmp.
2013-12-03 Joel Brobecker <brobecker@adacore.com>
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 8ad825b..e9cda4a 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -537,19 +537,20 @@ static int
find_dot_all (const char *str)
{
int i;
- for (i = 0; str[i] != '\000'; i += 1)
- {
- if (str[i] == '.')
- {
- int i0 = i;
- do
- i += 1;
- while (isspace (str[i]));
- if (strncasecmp (str+i, "all", 3) == 0
- && ! isalnum (str[i+3]) && str[i+3] != '_')
- return i0;
- }
- }
+
+ for (i = 0; str[i] != '\000'; i++)
+ if (str[i] == '.')
+ {
+ int i0 = i;
+
+ do
+ i += 1;
+ while (isspace (str[i]));
+
+ if (strncasecmp (str + i, "all", 3) == 0
+ && !isalnum (str[i + 3]) && str[i + 3] != '_')
+ return i0;
+ }
return -1;
}
--
1.8.1.2