diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2010-10-09 22:30:20 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2010-10-15 01:10:00 +0530 |
commit | 1d2ef7923d28a74e08a4309b6fa3d36481d2df3b (patch) | |
tree | 50a611811a1408f682ff21500f3f679e429c327a /src/modules/dbus/iface-stream.c | |
parent | 4d84a00b495c44a9e348534bf754ace823c9abe8 (diff) |
volume: Use a macro to check if a volume is valid
This adds a PA_VOLUME_IS_VALID() macro for checking if a given
pa_volume_t is valid. This makes changes to the volume ranges simpler
(just change PA_VOLUME_MAX, for example, without needing to modify any
other code).
Diffstat (limited to 'src/modules/dbus/iface-stream.c')
-rw-r--r-- | src/modules/dbus/iface-stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/dbus/iface-stream.c b/src/modules/dbus/iface-stream.c index 0255be4b..364572b8 100644 --- a/src/modules/dbus/iface-stream.c +++ b/src/modules/dbus/iface-stream.c @@ -378,7 +378,7 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag } for (i = 0; i < n_volume_entries; ++i) { - if (volume[i] > PA_VOLUME_MAX) { + if (PA_VOLUME_IS_VALID(volume[i])) { pa_dbus_send_error(conn, msg, DBUS_ERROR_INVALID_ARGS, "Too large volume value: %u", volume[i]); return; } |