Skip to content

Commit

Permalink
Update to uncrustify 0.61 and reformatting skew3-lcp and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
bingmann committed Dec 11, 2015
1 parent d507dfb commit 163de77
Show file tree
Hide file tree
Showing 27 changed files with 1,377 additions and 1,178 deletions.
1,326 changes: 705 additions & 621 deletions examples/applications/skew3-lcp.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/stxxl/bits/common/utils.h
Expand Up @@ -199,7 +199,7 @@ typename compat::remove_const<Integral>::type
div_ceil(Integral n, Integral2 d)
{
#if 0 // ambiguous overload for std::div(unsigned_anything, unsigned_anything)
typedef __typeof__ (std::div(n, d)) div_type;
typedef __typeof__ (std::div (n, d)) div_type;
div_type result = std::div(n, d);
return result.quot + (result.rem != 0);
#else
Expand Down
6 changes: 3 additions & 3 deletions include/stxxl/bits/common/winner_tree.h
Expand Up @@ -189,10 +189,10 @@ class winner_tree
* corresponds to the path from leaf [index] to root. If only the value of
* player [index] has changed the result is a valid winner tree.
*
* \param index The player whose value has changed.
* \param index The player whose value has changed.
*
* \param done Set done to true if the player has been deactivated
* or removed. All games will be lost then.
* \param done Set done to true if the player has been deactivated
* or removed. All games will be lost then.
*/
inline void replay_on_change(unsigned int index, bool done = false)
{
Expand Down
2 changes: 1 addition & 1 deletion include/stxxl/bits/containers/hash_map/hash_map.h
Expand Up @@ -1107,7 +1107,7 @@ class hash_map : private noncopyable
}
};

/* Rebuild hash-map. The desired number of buckets may be supplied. */
/* Rebuild hash-map. The desired number of buckets may be supplied. */
void _rebuild_buckets(internal_size_type n_desired = 0)
{
STXXL_VERBOSE_HASH_MAP("_rebuild_buckets()");
Expand Down
6 changes: 3 additions & 3 deletions include/stxxl/bits/containers/hash_map/iterator.h
Expand Up @@ -245,9 +245,9 @@ class hash_map_iterator_base
public:
//! Advance iterator to the next value
//! The next value is determined in the following way
//! - if there are remaining internal or external values in the current
//! bucket, choose the smallest among them, that is not marked as deleted
//! - otherwise continue with the next bucket
//! - if there are remaining internal or external values in the current
//! bucket, choose the smallest among them, that is not marked as deleted
//! - otherwise continue with the next bucket
void find_next(bool start_prefetching = false)
{
// invariant: current external value is always > current internal value
Expand Down
4 changes: 2 additions & 2 deletions include/stxxl/bits/containers/hash_map/iterator_map.h
Expand Up @@ -175,8 +175,8 @@ class iterator_map : private noncopyable
(**it2fix).source_ = hash_map_type::src_internal;
(**it2fix).node_ = node;
(**it2fix).i_external_++;
if ((** it2fix).reader_)
(** it2fix).reader_->operator ++ ();
if ((**it2fix).reader_)
(**it2fix).reader_->operator ++ ();
}
}

Expand Down
4 changes: 2 additions & 2 deletions include/stxxl/bits/containers/parallel_priority_queue.h
Expand Up @@ -1900,8 +1900,8 @@ class parallel_priority_queue : private noncopyable
block_size, DefaultMemSize, MaxItems> > minima_type;
//! allow minima tree access to internal data structures
friend class ppq_local::minima_tree<
parallel_priority_queue<value_type, compare_type, alloc_strategy,
block_size, DefaultMemSize, MaxItems> >;
parallel_priority_queue<value_type, compare_type, alloc_strategy,
block_size, DefaultMemSize, MaxItems> >;

//! Inverse comparison functor
struct inv_compare_type
Expand Down
2 changes: 1 addition & 1 deletion include/stxxl/bits/io/completion_handler.h
Expand Up @@ -90,7 +90,7 @@ class completion_handler
void operator () (request* req)
{
if (m_ptr.get())
(* m_ptr)(req);
(*m_ptr)(req);
}
};

Expand Down
2 changes: 1 addition & 1 deletion include/stxxl/bits/io/request_queue_impl_worker.h
Expand Up @@ -54,7 +54,7 @@ class request_queue_impl_worker : public request_queue
#endif

protected:
void start_thread(void* (* worker)(void*), void* arg, thread_type& t, state<thread_state>& s);
void start_thread(void* (*worker)(void*), void* arg, thread_type& t, state<thread_state>& s);
void stop_thread(thread_type& t, state<thread_state>& s, semaphore& sem);
};

Expand Down
2 changes: 1 addition & 1 deletion include/stxxl/bits/mng/adaptor.h
Expand Up @@ -135,7 +135,7 @@ class blocked_index
};

#define STXXL_ADAPTOR_ARITHMETICS(pos) \
bool operator == (const self_type& a) const \
bool operator == (const self_type &a) const \
{ \
return (a.pos == pos); \
} \
Expand Down
18 changes: 9 additions & 9 deletions include/stxxl/bits/mng/block_scheduler.h
Expand Up @@ -603,7 +603,7 @@ class block_scheduler_algorithm_online_lru : public block_scheduler_algorithm<Sw
internal_block_type * get_free_internal_block()
{
// try to get a free internal_block
if (internal_block_type * iblock = get_free_internal_block_from_block_scheduler())
if (internal_block_type* iblock = get_free_internal_block_from_block_scheduler())
return iblock;
// evict block
assert(! evictable_blocks.empty()); // fails it there is not enough memory available
Expand Down Expand Up @@ -636,7 +636,7 @@ class block_scheduler_algorithm_online_lru : public block_scheduler_algorithm<Sw
while (! evictable_blocks.empty())
{
SwappableBlockType& sblock = swappable_blocks[evictable_blocks.pop()];
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
}
}
Expand Down Expand Up @@ -706,7 +706,7 @@ class block_scheduler_algorithm_online_lru : public block_scheduler_algorithm<Sw
SwappableBlockType& sblock = swappable_blocks[sbid];
if (sblock.is_evictable())
evictable_blocks.erase(sbid);
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
}

Expand Down Expand Up @@ -788,7 +788,7 @@ class block_scheduler_algorithm_simulation : public block_scheduler_algorithm<Sw
while (! evictable_blocks.empty())
{
SwappableBlockType& sblock = swappable_blocks[evictable_blocks.top()];
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
evictable_blocks.pop();
}
Expand Down Expand Up @@ -941,7 +941,7 @@ class block_scheduler_algorithm_offline_lfd : public block_scheduler_algorithm<S
internal_block_type * get_free_internal_block()
{
// try to get a free internal_block
if (internal_block_type * iblock = get_free_internal_block_from_block_scheduler())
if (internal_block_type* iblock = get_free_internal_block_from_block_scheduler())
return iblock;
// evict block
assert(! evictable_blocks.empty()); // fails it there is not enough memory available
Expand Down Expand Up @@ -1011,7 +1011,7 @@ class block_scheduler_algorithm_offline_lfd : public block_scheduler_algorithm<S
while (! evictable_blocks.empty())
{
SwappableBlockType& sblock = swappable_blocks[evictable_blocks.pop()];
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
}
}
Expand Down Expand Up @@ -1095,7 +1095,7 @@ class block_scheduler_algorithm_offline_lfd : public block_scheduler_algorithm<S
SwappableBlockType& sblock = swappable_blocks[sbid];
if (sblock.is_evictable())
evictable_blocks.erase(sbid);
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
}

Expand Down Expand Up @@ -1643,7 +1643,7 @@ class block_scheduler_algorithm_offline_lru_prefetching : public block_scheduler
while (! free_evictable_blocks.empty())
{
SwappableBlockType& sblock = swappable_blocks[pop_begin(free_evictable_blocks)];
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
return_free_internal_block(iblock);
}
}
Expand Down Expand Up @@ -1784,7 +1784,7 @@ class block_scheduler_algorithm_offline_lru_prefetching : public block_scheduler
t = free_evictable_blocks.erase(sbid);
assert(t != 0);
}
if (internal_block_type * iblock = sblock.deinitialize())
if (internal_block_type* iblock = sblock.deinitialize())
{
if (shall_keep_internal_block(schedule_meta))
// => swappable_block shall keep its internal_block
Expand Down
2 changes: 1 addition & 1 deletion include/stxxl/bits/mng/buf_istream.h
Expand Up @@ -71,7 +71,7 @@ class buf_istream : private noncopyable

// obvious schedule
//for(int_type i = 0; i < seq_length; ++i)
// prefetch_seq[i] = i;
// prefetch_seq[i] = i;

// optimal schedule
nbuffers = STXXL_MAX(2 * ndisks, unsigned_type(nbuffers - 1));
Expand Down
50 changes: 25 additions & 25 deletions include/stxxl/bits/parallel/multiway_merge.h
Expand Up @@ -421,15 +421,15 @@ multiway_merge_3_variant(RandomAccessIteratorIterator seqs_begin,
goto s210;
}

#define STXXL_MERGE3CASE(a, b, c, c0, c1) \
s ## a ## b ## c : \
*target = *seq ## a; \
++target; \
--length; \
++seq ## a; \
if (length == 0) goto finish; \
if (seq ## a c0 seq ## b) goto s ## a ## b ## c; \
if (seq ## a c1 seq ## c) goto s ## b ## a ## c; \
#define STXXL_MERGE3CASE(a, b, c, c0, c1) \
s ## a ## b ## c : \
*target = *seq ## a; \
++target; \
--length; \
++seq ## a; \
if (length == 0) goto finish; \
if (seq ## a c0 seq ## b) goto s ## a ## b ## c; \
if (seq ## a c1 seq ## c) goto s ## b ## a ## c; \
goto s ## b ## c ## a;

STXXL_MERGE3CASE(0, 1, 2, <=, <=);
Expand Down Expand Up @@ -578,12 +578,12 @@ multiway_merge_4_variant(RandomAccessIteratorIterator seqs_begin,
seq2(seqs_begin[2].first, seqs_begin[2].second, comp),
seq3(seqs_begin[3].first, seqs_begin[3].second, comp);

#define STXXL_DECISION(a, b, c, d) do { \
if (seq ## d < seq ## a) goto s ## d ## a ## b ## c; \
if (seq ## d < seq ## b) goto s ## a ## d ## b ## c; \
if (seq ## d < seq ## c) goto s ## a ## b ## d ## c; \
goto s ## a ## b ## c ## d; \
} \
#define STXXL_DECISION(a, b, c, d) do { \
if (seq ## d < seq ## a) goto s ## d ## a ## b ## c; \
if (seq ## d < seq ## b) goto s ## a ## d ## b ## c; \
if (seq ## d < seq ## c) goto s ## a ## b ## d ## c; \
goto s ## a ## b ## c ## d; \
} \
while (0)

if (seq0 <= seq1)
Expand All @@ -608,16 +608,16 @@ multiway_merge_4_variant(RandomAccessIteratorIterator seqs_begin,
STXXL_DECISION(2, 1, 0, 3);
}

#define STXXL_MERGE4CASE(a, b, c, d, c0, c1, c2) \
s ## a ## b ## c ## d : \
if (length == 0) goto finish; \
*target = *seq ## a; \
++target; \
--length; \
++seq ## a; \
if (seq ## a c0 seq ## b) goto s ## a ## b ## c ## d; \
if (seq ## a c1 seq ## c) goto s ## b ## a ## c ## d; \
if (seq ## a c2 seq ## d) goto s ## b ## c ## a ## d; \
#define STXXL_MERGE4CASE(a, b, c, d, c0, c1, c2) \
s ## a ## b ## c ## d : \
if (length == 0) goto finish; \
*target = *seq ## a; \
++target; \
--length; \
++seq ## a; \
if (seq ## a c0 seq ## b) goto s ## a ## b ## c ## d; \
if (seq ## a c1 seq ## c) goto s ## b ## a ## c ## d; \
if (seq ## a c2 seq ## d) goto s ## b ## c ## a ## d; \
goto s ## b ## c ## d ## a;

STXXL_MERGE4CASE(0, 1, 2, 3, <=, <=, <=);
Expand Down
20 changes: 10 additions & 10 deletions include/stxxl/bits/stream/sort_stream.h
Expand Up @@ -412,11 +412,11 @@ template <
class AllocStr
>
class runs_creator<
use_push<ValueType>,
CompareType,
BlockSize,
AllocStr
>: private noncopyable
use_push<ValueType>,
CompareType,
BlockSize,
AllocStr
>: private noncopyable
{
public:
typedef CompareType cmp_type;
Expand Down Expand Up @@ -720,11 +720,11 @@ template <
class AllocStr
>
class runs_creator<
from_sorted_sequences<ValueType>,
CompareType,
BlockSize,
AllocStr
>: private noncopyable
from_sorted_sequences<ValueType>,
CompareType,
BlockSize,
AllocStr
>: private noncopyable
{
public:
typedef ValueType value_type;
Expand Down
2 changes: 1 addition & 1 deletion lib/io/request_queue_impl_worker.cpp
Expand Up @@ -32,7 +32,7 @@

STXXL_BEGIN_NAMESPACE

void request_queue_impl_worker::start_thread(void* (* worker)(void*), void* arg, thread_type& t, state<thread_state>& s)
void request_queue_impl_worker::start_thread(void* (*worker)(void*), void* arg, thread_type& t, state<thread_state>& s)
{
assert(s() == NOT_RUNNING);
#if STXXL_STD_THREADS
Expand Down
2 changes: 1 addition & 1 deletion lib/io/ufs_file_base.cpp
Expand Up @@ -226,7 +226,7 @@ void ufs_file_base::_set_size(offset_type newsize)
if (!(m_mode & RDONLY) && !m_is_device)
{
#if STXXL_WINDOWS || defined(__MINGW32__)
HANDLE hfile = (HANDLE) ::_get_osfhandle(file_des);
HANDLE hfile = (HANDLE)::_get_osfhandle(file_des);
STXXL_THROW_ERRNO_NE_0((hfile == INVALID_HANDLE_VALUE), io_error,
"_get_osfhandle() path=" << filename << " fd=" << file_des);

Expand Down
4 changes: 2 additions & 2 deletions lib/io/wfs_file_base.cpp
Expand Up @@ -88,7 +88,7 @@ static HANDLE open_file_impl(const std::string& filename, int mode)
}

HANDLE file_des = ::CreateFileA(filename.c_str(), dwDesiredAccess, dwShareMode, NULL,
dwCreationDisposition, dwFlagsAndAttributes, NULL);
dwCreationDisposition, dwFlagsAndAttributes, NULL);

if (file_des != INVALID_HANDLE_VALUE)
return file_des;
Expand All @@ -101,7 +101,7 @@ static HANDLE open_file_impl(const std::string& filename, int mode)
dwFlagsAndAttributes &= ~FILE_FLAG_NO_BUFFERING;

HANDLE file_des = ::CreateFileA(filename.c_str(), dwDesiredAccess, dwShareMode, NULL,
dwCreationDisposition, dwFlagsAndAttributes, NULL);
dwCreationDisposition, dwFlagsAndAttributes, NULL);

if (file_des != INVALID_HANDLE_VALUE)
return file_des;
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/malloc_count.cpp
Expand Up @@ -143,7 +143,7 @@ extern void * malloc(size_t size) throw ()
if (real_malloc)
{
/* call read malloc procedure in libc */
ret = (* real_malloc)(alignment + size);
ret = (*real_malloc)(alignment + size);

inc_count(size);
if (log_operations && size >= log_operations_threshold) {
Expand Down Expand Up @@ -217,7 +217,7 @@ extern void free(void* ptr) throw ()
ptr, (long long)size, curr);
}

(* real_free)(ptr);
(*real_free)(ptr);
}

/* exported calloc() symbol that overrides loading from libc, implemented using
Expand Down Expand Up @@ -291,7 +291,7 @@ extern void * realloc(void* ptr, size_t size) throw ()
dec_count(oldsize);
inc_count(size);

newptr = (* real_realloc)(ptr, alignment + size);
newptr = (*real_realloc)(ptr, alignment + size);

if (log_operations && size >= log_operations_threshold)
{
Expand Down

0 comments on commit 163de77

Please sign in to comment.