From 51b57ded888cbdacb5ad126363f8ae6adc9541b6 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Mon, 29 Jun 1992 23:34:38 +0000 Subject: * dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c, symtab.h, tm-i386v4.h, valprint.c, values.c: Lint. * breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c, findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c, putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c, values.c: Replace bcopy() use with memcpy(), which is more standard and can take advantage of gcc's builtin functions for increased performance. * breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c, ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h, target.c, values.c: Replace bzero() use with memset(), which is more standard and can take advantage of gcc's builtin functions for increased performance. * i386-tdep.c, main.c, valprint.c: Replace bcmp() use with memcmp(), which is more standard and can take advantage of gcc's builtin functions for increased performance. --- gdb/valarith.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gdb/valarith.c') diff --git a/gdb/valarith.c b/gdb/valarith.c index c52a06e..4c0706b 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -17,11 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include "defs.h" #include "value.h" #include "symtab.h" +#include "gdbtypes.h" #include "expression.h" #include "target.h" #include @@ -135,7 +134,8 @@ value_subscripted_rvalue (array, idx) error ("no such vector element"); v = allocate_value (elt_type); - bcopy (VALUE_CONTENTS (array) + elt_offs, VALUE_CONTENTS (v), elt_size); + (void) memcpy (VALUE_CONTENTS (v), VALUE_CONTENTS (array) + elt_offs, + elt_size); if (VALUE_LVAL (array) == lval_internalvar) VALUE_LVAL (v) = lval_internalvar_component; @@ -550,7 +550,7 @@ value_binop (arg1, arg2, op) return val; } -/* Simulate the C operator ! -- return 1 if ARG1 contains zeros. */ +/* Simulate the C operator ! -- return 1 if ARG1 contains zero. */ int value_zerop (arg1) @@ -561,6 +561,9 @@ value_zerop (arg1) COERCE_ARRAY (arg1); + if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_FLT) + return 0 == value_as_double (arg1); + len = TYPE_LENGTH (VALUE_TYPE (arg1)); p = VALUE_CONTENTS (arg1); -- cgit v1.1