summaryrefslogtreecommitdiff
path: root/gdb/dictionary.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-10-26 14:50:13 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-10-26 14:50:13 +0000
commitd552655b4fa7dcaf2b40d9e190b752df6b063036 (patch)
tree27fd49c495aafde05a4a3efcdb8ffa10860f42a3 /gdb/dictionary.c
parent730af9f6239085f1f62a61a37612154d32f75d72 (diff)
downloadgdb-d552655b4fa7dcaf2b40d9e190b752df6b063036.tar.gz
avoid assignment inside if condition (dictionary.c)
This change gets rid of an ARI warning which was recently introduced by one of our changes. gdb/ChangeLog: * dictionary.c (dict_hash): Move assignment out of if condition.
Diffstat (limited to 'gdb/dictionary.c')
-rw-r--r--gdb/dictionary.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 4f18e8c0179..9d53ff0e301 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -798,7 +798,6 @@ dict_hash (const char *string0)
const char *string;
unsigned int hash;
- int c;
string = string0;
if (*string == '_')
@@ -827,7 +826,9 @@ dict_hash (const char *string0)
case '_':
if (string[1] == '_' && string != string0)
{
- if (((c = string[2]) < 'a' || c > 'z') && c != 'O')
+ int c = string[2];
+
+ if ((c < 'a' || c > 'z') && c != 'O')
return hash;
hash = 0;
string += 2;