projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sparc: implement float->unsigned conversions
[libfirm]
/
ir
/
kaps
/
vector.c
diff --git
a/ir/kaps/vector.c
b/ir/kaps/vector.c
index
4970d08
..
39aedb9
100644
(file)
--- a/
ir/kaps/vector.c
+++ b/
ir/kaps/vector.c
@@
-22,7
+22,6
@@
* @brief PBQP vector.
* @date 02.10.2008
* @author Sebastian Buchwald
* @brief PBQP vector.
* @date 02.10.2008
* @author Sebastian Buchwald
- * @version $Id$
*/
#include "config.h"
*/
#include "config.h"
@@
-34,9
+33,11
@@
num pbqp_add(num x, num y)
{
num pbqp_add(num x, num y)
{
+ num res;
+
if (x == INF_COSTS || y == INF_COSTS) return INF_COSTS;
if (x == INF_COSTS || y == INF_COSTS) return INF_COSTS;
-
num
res = x + y;
+ res = x + y;
#if !KAPS_USE_UNSIGNED
/* No positive overflow. */
#if !KAPS_USE_UNSIGNED
/* No positive overflow. */
@@
-56,8
+57,8
@@
num pbqp_add(num x, num y)
vector_t *vector_alloc(pbqp_t *pbqp, unsigned length)
{
vector_t *vector_alloc(pbqp_t *pbqp, unsigned length)
{
- assert(length > 0);
vector_t *vec = (vector_t*)obstack_alloc(&pbqp->obstack, sizeof(*vec) + sizeof(*vec->entries) * length);
vector_t *vec = (vector_t*)obstack_alloc(&pbqp->obstack, sizeof(*vec) + sizeof(*vec->entries) * length);
+ assert(length > 0);
vec->len = length;
memset(vec->entries, 0, sizeof(*vec->entries) * length);
vec->len = length;
memset(vec->entries, 0, sizeof(*vec->entries) * length);