diff options
author | Willem Jan Palenstijn | 2013-04-18 23:35:23 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:40:58 +0200 |
commit | 9c2341678ef4984bf92b3878295250faf980b066 (patch) | |
tree | 2fb4805e05e16b9924e80c9947e6bad723b28c4b /common/algorithm.h | |
parent | 8172d679df5148a4a32f46074b20cb6caf91844f (diff) | |
parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
download | scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2 scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip |
Merge branch 'master'
Diffstat (limited to 'common/algorithm.h')
-rw-r--r-- | common/algorithm.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/algorithm.h b/common/algorithm.h index e7ccef4840..7a0eed89ce 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -73,25 +73,25 @@ Out copy_if(In first, In last, Out dst, Op op) { return dst; } -// Our 'specialized' 'set_to' template for char, signed char and unsigned char arrays. +// Our 'specialized' 'fill' template for char, signed char and unsigned char arrays. // Since C++ doesn't support partial specialized template functions (currently) we // are going this way... // With this we assure the usage of memset for those, which should be -// faster than a simple loop like for the generic 'set_to'. +// faster than a simple loop like for the generic 'fill'. template<class Value> -signed char *set_to(signed char *first, signed char *last, Value val) { +signed char *fill(signed char *first, signed char *last, Value val) { memset(first, (val & 0xFF), last - first); return last; } template<class Value> -unsigned char *set_to(unsigned char *first, unsigned char *last, Value val) { +unsigned char *fill(unsigned char *first, unsigned char *last, Value val) { memset(first, (val & 0xFF), last - first); return last; } template<class Value> -char *set_to(char *first, char *last, Value val) { +char *fill(char *first, char *last, Value val) { memset(first, (val & 0xFF), last - first); return last; } @@ -100,7 +100,7 @@ char *set_to(char *first, char *last, Value val) { * Sets all elements in the range [first, last) to val. */ template<class In, class Value> -In set_to(In first, In last, Value val) { +In fill(In first, In last, const Value &val) { while (first != last) *first++ = val; return first; |