/* Perform arithmetic and other operations on values, for GDB.
- Copyright 1986, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-
#include "defs.h"
#include "value.h"
#include "symtab.h"
+#include "gdbtypes.h"
#include "expression.h"
#include "target.h"
#include <string.h>
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;
argvec[1] = argvec[0];
argvec++;
}
- return target_call_function (argvec[0], 2 - static_memfuncp, argvec + 1);
+ return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1);
}
error ("member function %s not found", tstr);
#ifdef lint
- return target_call_function (argvec[0], 2 - static_memfuncp, argvec + 1);
+ return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1);
#endif
}
argvec[1] = argvec[0];
argvec++;
}
- return target_call_function (argvec[0], 1 - static_memfuncp, argvec + 1);
+ return call_function_by_hand (argvec[0], 1 - static_memfuncp, argvec + 1);
}
error ("member function %s not found", tstr);
return 0; /* For lint -- never reached */
return val;
}
\f
-/* Simulate the C operator ! -- return 1 if ARG1 contains zeros. */
+/* Simulate the C operator ! -- return 1 if ARG1 contains zero. */
int
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);