+/*
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief PBQP vector.
+ * @date 02.10.2008
+ * @author Sebastian Buchwald
+ * @version $Id$
+ */
+#include "config.h"
+
#include <string.h>
#include "adt/array.h"
-#include "pbqp_t.h"
#include "vector.h"
num pbqp_add(num x, num y)
num res = x + y;
- assert(res >= x);
- assert(res >= y);
+#if !KAPS_USE_UNSIGNED
+ /* No positive overflow. */
+ assert(x < 0 || y < 0 || res >= x);
+ assert(x < 0 || y < 0 || res >= y);
+#endif
+
+ /* No negative overflow. */
+ assert(x > 0 || y > 0 || res <= x);
+ assert(x > 0 || y > 0 || res <= y);
+
+ /* Result is not infinity.*/
assert(res < INF_COSTS);
return res;
vec->entries[index].data = value;
}
-#if EXT_GRS_DEBUG
-void vector_set_description(vector *vec, unsigned index, char *name)
+#if KAPS_ENABLE_VECTOR_NAMES
+void vector_set_description(vector *vec, unsigned index, const char *name)
{
assert(index < vec->len);
vec->entries[index].name = name;