projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gui: Fix temporary filtering by a variable's value.
[pspp]
/
src
/
libpspp
/
sparse-array.c
diff --git
a/src/libpspp/sparse-array.c
b/src/libpspp/sparse-array.c
index 298f2caf9eb9ae09108aa247fc6db7b000183de1..65a4612259f7e0510feb8cb55bbd7e619ce3e1d5 100644
(file)
--- a/
src/libpspp/sparse-array.c
+++ b/
src/libpspp/sparse-array.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009
, 2010, 2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-16,18
+16,18
@@
#include <config.h>
#include <config.h>
-#include
<libpspp/sparse-array.h>
+#include
"libpspp/sparse-array.h"
#include <limits.h>
#include <string.h>
#include <limits.h>
#include <string.h>
-#include
<libpspp/assertion.h>
-#include
<libpspp/cast.h>
-#include
<libpspp/misc.h>
-#include
<libpspp/pool.h>
+#include
"libpspp/assertion.h"
+#include
"libpspp/cast.h"
+#include
"libpspp/misc.h"
+#include
"libpspp/pool.h"
-#include "count-one-bits.h"
-#include "minmax.h"
+#include "
gl/
count-one-bits.h"
+#include "
gl/
minmax.h"
/* Sparse array data structure.
/* Sparse array data structure.
@@
-534,7
+534,9
@@
scan_in_use_reverse (struct leaf_node *leaf, unsigned int idx)
for (;;)
{
int ofs = idx % LONG_BITS;
for (;;)
{
int ofs = idx % LONG_BITS;
- unsigned long int in_use = leaf->in_use[idx / LONG_BITS] << (31 - ofs);
+ unsigned long int in_use;
+
+ in_use = leaf->in_use[idx / LONG_BITS] << (LONG_BITS - 1 - ofs);
if (in_use)
return idx - count_leading_zeros (in_use);
if (idx < LONG_BITS)
if (in_use)
return idx - count_leading_zeros (in_use);
if (idx < LONG_BITS)