aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-08-26 18:17:40 -0600
committerTom Tromey <tom@tromey.com>2021-09-24 11:58:04 -0600
commit7ebaa5f7821682c40e79ee1fdfe43528b7d87376 (patch)
treee32d94cab5616bedf19aa1637eaea7e1c0df49fb /gdb/language.c
parent604386598d43e50f183aba65189354e04ffbdda3 (diff)
downloadgdb-7ebaa5f7821682c40e79ee1fdfe43528b7d87376.zip
gdb-7ebaa5f7821682c40e79ee1fdfe43528b7d87376.tar.gz
gdb-7ebaa5f7821682c40e79ee1fdfe43528b7d87376.tar.bz2
Move value_true to value.h
I noticed that value_true is declared in language.h and defined in language.c. However, as part of the value API, I think it would be better in one of those files. And, because it is very short, I changed it to be an inline function in value.h. I've also removed a comment from the implementation, on the basis that it seems obsolete -- if the change it suggests was needed, it probably would have been done by now; and if it is needed in the future, odds are it would be done differently anyway. Finally, this patch also changes value_true and value_logical_not to return a bool, and updates some uses.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/gdb/language.c b/gdb/language.c
index 0354fb8..cb28e63 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -387,23 +387,6 @@ language_info ()
show_language_command (NULL, 1, NULL, NULL);
}
-
-/* This page contains functions that return info about
- (struct value) values used in GDB. */
-
-/* Returns non-zero if the value VAL represents a true value. */
-int
-value_true (struct value *val)
-{
- /* It is possible that we should have some sort of error if a non-boolean
- value is used in this context. Possibly dependent on some kind of
- "boolean-checking" option like range checking. But it should probably
- not depend on the language except insofar as is necessary to identify
- a "boolean" value (i.e. in C using a float, pointer, etc., as a boolean
- should be an error, probably). */
- return !value_logical_not (val);
-}
-
/* This page contains functions for the printing out of
error messages that occur during type- and range-
checking. */