aboutsummaryrefslogtreecommitdiff
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
commit558b1900b0750489aaedeeb5ad173ce7331db68f (patch)
tree6381e5c94a77c82aa41f7ecd6a7a07e5f838afe7
parenta41df09498a11ee1de8d43e274fe67f719824b58 (diff)
downloadgdb-558b1900b0750489aaedeeb5ad173ce7331db68f.zip
gdb-558b1900b0750489aaedeeb5ad173ce7331db68f.tar.gz
gdb-558b1900b0750489aaedeeb5ad173ce7331db68f.tar.bz2
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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dictionary.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a6fca05..99d24f4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-26 Joel Brobecker <brobecker@adacore.com>
+
+ * dictionary.c (dict_hash): Move assignment out of if condition.
+
2010-10-22 Jie Zhang <jie@codesourcery.com>
* Makefile.in (install): Remove dependency of install-only and
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 4f18e8c..9d53ff0 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;