1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
https://github.com/mpruett/audiofile/issues/65
https://bugs.gentoo.org/914349
--- a/libaudiofile/modules/SimpleModule.h
+++ b/libaudiofile/modules/SimpleModule.h
@@ -125,13 +125,17 @@ struct signConverter
static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
static const int kMinSignedValue = -1 << kScaleBits;
- struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ struct signedToUnsigned
{
+ typedef SignedType argument_type;
+ typedef UnsignedType result_type;
UnsignedType operator()(SignedType x) { return x - kMinSignedValue; }
};
- struct unsignedToSigned : public std::unary_function<SignedType, UnsignedType>
+ struct unsignedToSigned
{
+ typedef SignedType argument_type;
+ typedef UnsignedType result_type;
SignedType operator()(UnsignedType x) { return x + kMinSignedValue; }
};
};
@@ -323,8 +327,10 @@ private:
};
template <typename Arg, typename Result>
-struct intToFloat : public std::unary_function<Arg, Result>
+struct intToFloat
{
+ typedef Arg argument_type;
+ typedef Result result_type;
Result operator()(Arg x) const { return x; }
};
@@ -389,14 +395,18 @@ private:
};
template <typename Arg, typename Result, unsigned shift>
-struct lshift : public std::unary_function<Arg, Result>
+struct lshift
{
+ typedef Arg argument_type;
+ typedef Result result_type;
Result operator()(const Arg &x) const { return x << shift; }
};
template <typename Arg, typename Result, unsigned shift>
-struct rshift : public std::unary_function<Arg, Result>
+struct rshift
{
+ typedef Arg argument_type;
+ typedef Result result_type;
Result operator()(const Arg &x) const { return x >> shift; }
};
@@ -491,8 +501,10 @@ private:
};
template <typename Arg, typename Result>
-struct floatToFloat : public std::unary_function<Arg, Result>
+struct floatToFloat
{
+ typedef Arg argument_type;
+ typedef Result result_type;
Result operator()(Arg x) const { return x; }
};
|