Skip to content

Commit ed7ca96

Browse files
committed
silence 'Wclass-memaccess' warnings
1 parent c2bd719 commit ed7ca96

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

inst/include/tbb/concurrent_vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace internal {
8585
//! Exception helper function
8686
template<typename T>
8787
void handle_unconstructed_elements(T* array, size_t n_of_elements){
88-
std::memset( array, 0, n_of_elements * sizeof( T ) );
88+
std::memset( (void*) array, 0, n_of_elements * sizeof( T ) );
8989
}
9090

9191
//! Base class of concurrent vector implementation.

inst/include/tbb/internal/_concurrent_unordered_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ class concurrent_unordered_base : public Traits
14781478
if (my_buckets[segment] == NULL) {
14791479
size_type sz = segment_size(segment);
14801480
raw_iterator * new_segment = my_allocator.allocate(sz);
1481-
std::memset(new_segment, 0, sz*sizeof(raw_iterator));
1481+
std::memset((void*) new_segment, 0, sz*sizeof(raw_iterator));
14821482

14831483
if (my_buckets[segment].compare_and_swap( new_segment, NULL) != NULL)
14841484
my_allocator.deallocate(new_segment, sz);

inst/include/tbb/tbb_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class zero_allocator : public Allocator<T>
185185

186186
pointer allocate(const size_type n, const void *hint = 0 ) {
187187
pointer ptr = base_allocator_type::allocate( n, hint );
188-
std::memset( ptr, 0, n * sizeof(value_type) );
188+
std::memset( (void*) ptr, 0, n * sizeof(value_type) );
189189
return ptr;
190190
}
191191
};

src/tbb/include/tbb/concurrent_vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace internal {
7474
//! Exception helper function
7575
template<typename T>
7676
void handle_unconstructed_elements(T* array, size_t n_of_elements){
77-
std::memset( array, 0, n_of_elements * sizeof( T ) );
77+
std::memset((void*) array, 0, n_of_elements * sizeof( T ));
7878
}
7979

8080
//! Base class of concurrent vector implementation.

src/tbb/include/tbb/internal/_concurrent_unordered_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ class concurrent_unordered_base : public Traits
14681468
if (my_buckets[segment] == NULL) {
14691469
size_type sz = segment_size(segment);
14701470
raw_iterator * new_segment = my_allocator.allocate(sz);
1471-
std::memset(new_segment, 0, sz*sizeof(raw_iterator));
1471+
std::memset((void*) new_segment, 0, sz*sizeof(raw_iterator));
14721472

14731473
if (my_buckets[segment].compare_and_swap( new_segment, NULL) != NULL)
14741474
my_allocator.deallocate(new_segment, sz);

src/tbb/include/tbb/tbb_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class zero_allocator : public Allocator<T>
174174

175175
pointer allocate(const size_type n, const void *hint = 0 ) {
176176
pointer ptr = base_allocator_type::allocate( n, hint );
177-
std::memset( ptr, 0, n * sizeof(value_type) );
177+
std::memset( (void*) ptr, 0, n * sizeof(value_type) );
178178
return ptr;
179179
}
180180
};

src/tbb/src/old/concurrent_vector_v2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class concurrent_vector_base::helper {
7171
void concurrent_vector_base::helper::extend_segment( concurrent_vector_base& v ) {
7272
const size_t pointers_per_long_segment = sizeof(void*)==4 ? 32 : 64;
7373
segment_t* s = (segment_t*)NFS_Allocate( pointers_per_long_segment, sizeof(segment_t), NULL );
74-
std::memset( s, 0, pointers_per_long_segment*sizeof(segment_t) );
74+
std::memset( (void*) s, 0, pointers_per_long_segment*sizeof(segment_t) );
7575
// If other threads are trying to set pointers in the short segment, wait for them to finish their
7676
// assignments before we copy the short segment to the long segment.
7777
atomic_backoff backoff;

0 commit comments

Comments
 (0)