[folks] inspect: Fix use of deprecated Vala API
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] inspect: Fix use of deprecated Vala API
- Date: Fri, 23 Jan 2015 15:02:38 +0000 (UTC)
commit 4a6db9226dc9396830985f0f36e00aa0179303d2
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Jan 23 14:58:21 2015 +0000
inspect: Fix use of deprecated Vala API
This wasn’t fixed before because there was apparently no way of
specifying the base to use for the conversion. Then I realised that
hexadecimal can be forced by ensuring the string has a ‘0x’ prefix,
which it does.
tools/inspect/command-signals.vala | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tools/inspect/command-signals.vala b/tools/inspect/command-signals.vala
index 72b790a..afff682 100644
--- a/tools/inspect/command-signals.vala
+++ b/tools/inspect/command-signals.vala
@@ -229,8 +229,9 @@ private class Folks.Inspect.Commands.Signals : Folks.Inspect.Command
if (class_name_or_instance.length > 2 &&
class_name_or_instance[0] == '0' && class_name_or_instance[1] == 'x')
{
- /* We have a class instance */
- ulong address = class_name_or_instance.to_ulong (null, 16);
+ /* We have a class instance. The ‘0x’ prefix ensures it will be
+ * parsed in base 16. */
+ var address = uint64.parse (class_name_or_instance);
class_instance = (Object) address;
assert (class_instance.get_type ().is_object ());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]