aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-26 11:12:22 +0200
committerSimon Warta <[email protected]>2015-06-27 10:57:40 +0200
commitfdc1fba275933dfccc347774f9c13c1c6253113a (patch)
tree473f09e63fcb17fe5050d3e76fa9c8a9c68527ed
parent9f8f8bc3951f3b9a8da871b5e5ee0a75be0bace2 (diff)
lib/entropy: Convert &vec[0] to vec.data()
-rw-r--r--src/lib/entropy/cryptoapi_rng/es_capi.cpp4
-rw-r--r--src/lib/entropy/dev_random/dev_random.cpp4
-rw-r--r--src/lib/entropy/egd/es_egd.cpp4
-rw-r--r--src/lib/entropy/proc_walk/proc_walk.cpp4
-rw-r--r--src/lib/entropy/unix_procs/unix_procs.cpp4
5 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.cpp b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
index 2c86152ad..019b55a10 100644
--- a/src/lib/entropy/cryptoapi_rng/es_capi.cpp
+++ b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
@@ -63,9 +63,9 @@ void Win32_CAPI_EntropySource::poll(Entropy_Accumulator& accum)
{
CSP_Handle csp(prov_types[i]);
- if(size_t got = csp.gen_random(&m_buf[0], m_buf.size()))
+ if(size_t got = csp.gen_random(m_buf.data(), m_buf.size()))
{
- accum.add(&m_buf[0], got, 6);
+ accum.add(m_buf.data(), got, 6);
break;
}
}
diff --git a/src/lib/entropy/dev_random/dev_random.cpp b/src/lib/entropy/dev_random/dev_random.cpp
index b115e0da2..526835fea 100644
--- a/src/lib/entropy/dev_random/dev_random.cpp
+++ b/src/lib/entropy/dev_random/dev_random.cpp
@@ -87,9 +87,9 @@ void Device_EntropySource::poll(Entropy_Accumulator& accum)
{
if(FD_ISSET(m_devices[i], &read_set))
{
- const ssize_t got = ::read(m_devices[i], &m_buf[0], m_buf.size());
+ const ssize_t got = ::read(m_devices[i], m_buf.data(), m_buf.size());
if(got > 0)
- accum.add(&m_buf[0], got, ENTROPY_BITS_PER_BYTE);
+ accum.add(m_buf.data(), got, ENTROPY_BITS_PER_BYTE);
}
}
}
diff --git a/src/lib/entropy/egd/es_egd.cpp b/src/lib/entropy/egd/es_egd.cpp
index 728104b44..d64b87ba1 100644
--- a/src/lib/entropy/egd/es_egd.cpp
+++ b/src/lib/entropy/egd/es_egd.cpp
@@ -145,11 +145,11 @@ void EGD_EntropySource::poll(Entropy_Accumulator& accum)
for(size_t i = 0; i != sockets.size(); ++i)
{
- size_t got = sockets[i].read(&m_buf[0], m_buf.size());
+ size_t got = sockets[i].read(m_buf.data(), m_buf.size());
if(got)
{
- accum.add(&m_buf[0], got, 6);
+ accum.add(m_buf.data(), got, 6);
break;
}
}
diff --git a/src/lib/entropy/proc_walk/proc_walk.cpp b/src/lib/entropy/proc_walk/proc_walk.cpp
index 1501f0774..217ed5a52 100644
--- a/src/lib/entropy/proc_walk/proc_walk.cpp
+++ b/src/lib/entropy/proc_walk/proc_walk.cpp
@@ -133,11 +133,11 @@ void ProcWalking_EntropySource::poll(Entropy_Accumulator& accum)
break;
}
- ssize_t got = ::read(fd, &m_buf[0], m_buf.size());
+ ssize_t got = ::read(fd, m_buf.data(), m_buf.size());
::close(fd);
if(got > 0)
- accum.add(&m_buf[0], got, ENTROPY_ESTIMATE);
+ accum.add(m_buf.data(), got, ENTROPY_ESTIMATE);
if(accum.polling_finished())
break;
diff --git a/src/lib/entropy/unix_procs/unix_procs.cpp b/src/lib/entropy/unix_procs/unix_procs.cpp
index d3208b7fc..3c641da70 100644
--- a/src/lib/entropy/unix_procs/unix_procs.cpp
+++ b/src/lib/entropy/unix_procs/unix_procs.cpp
@@ -237,9 +237,9 @@ void Unix_EntropySource::poll(Entropy_Accumulator& accum)
if(FD_ISSET(fd, &read_set))
{
- const ssize_t got = ::read(fd, &m_buf[0], m_buf.size());
+ const ssize_t got = ::read(fd, m_buf.data(), m_buf.size());
if(got > 0)
- accum.add(&m_buf[0], got, ENTROPY_ESTIMATE);
+ accum.add(m_buf.data(), got, ENTROPY_ESTIMATE);
else
proc.spawn(next_source());
}