From 9f8f8bc3951f3b9a8da871b5e5ee0a75be0bace2 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 26 Jun 2015 10:56:37 +0200 Subject: lib/ffi: Convert &vec[0] to vec.data() --- src/lib/ffi/ffi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib/ffi/ffi.cpp') diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index 2151c33a9..b8962d034 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -109,7 +109,7 @@ inline int write_output(uint8_t out[], size_t* out_len, const uint8_t buf[], siz *out_len = buf_len; if(avail >= buf_len) { - Botan::copy_mem(out, &buf[0], buf_len); + Botan::copy_mem(out, buf, buf_len); return 0; } return -1; @@ -118,7 +118,7 @@ inline int write_output(uint8_t out[], size_t* out_len, const uint8_t buf[], siz template int write_vec_output(uint8_t out[], size_t* out_len, const std::vector& buf) { - return write_output(out, out_len, &buf[0], buf.size()); + return write_output(out, out_len, buf.data(), buf.size()); } inline int write_str_output(uint8_t out[], size_t* out_len, const std::string& str) @@ -450,7 +450,7 @@ int botan_cipher_update(botan_cipher_t cipher_obj, if(mbuf.size() <= output_size) { - copy_mem(output, &mbuf[0], mbuf.size()); + copy_mem(output, mbuf.data(), mbuf.size()); mbuf.clear(); return 0; } @@ -464,7 +464,7 @@ int botan_cipher_update(botan_cipher_t cipher_obj, *output_written = mbuf.size(); if(output_size >= mbuf.size()) { - copy_mem(output, &mbuf[0], mbuf.size()); + copy_mem(output, mbuf.data(), mbuf.size()); mbuf.clear(); return 0; } @@ -482,7 +482,7 @@ int botan_cipher_update(botan_cipher_t cipher_obj, const size_t taken = round_down(input_size, ud); *input_consumed = taken; *output_size = taken; - copy_mem(&output[0], input, taken); + copy_mem(output, input, taken); ocm->update_in_place(output, taken); return 0; } @@ -493,7 +493,7 @@ int botan_cipher_update(botan_cipher_t cipher_obj, while(input_size >= ud && output_size >= ud) { - copy_mem(&mbuf[0], input, ud); + copy_mem(mbuf.data(), input, ud); cipher.update(mbuf); input_size -= ud; -- cgit v1.2.3