[moserial] Fix compile-time errors
- From: Michael J. Chudobiak <mjc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [moserial] Fix compile-time errors
- Date: Wed, 13 Jun 2012 17:10:07 +0000 (UTC)
commit 31d487d1a463fa0160ef140b8f9bc8a11b61228c
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jun 13 12:46:11 2012 +0100
Fix compile-time errors
TextIter were causing errors:
Cannot pass value to reference or output parameter
https://bugzilla.gnome.org/show_bug.cgi?id=678016
src/HexTextBuffer.vala | 18 +++++++++---------
src/MainWindow.vala | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/HexTextBuffer.vala b/src/HexTextBuffer.vala
index 940fbbf..ab4d55a 100644
--- a/src/HexTextBuffer.vala
+++ b/src/HexTextBuffer.vala
@@ -63,40 +63,40 @@ public class moserial.HexTextBuffer : TextBuffer
this.get_iter_at_mark(out nextCharIter, nextCharMark);
TextMark startMark = new TextMark("startMark", true);
this.add_mark(startMark, nextCharIter);
- this.insert(nextCharIter, "\n%08x".printf(hexBytes), 9);
+ this.insert(ref nextCharIter, "\n%08x".printf(hexBytes), 9);
this.get_iter_at_mark(out startIter, startMark);
this.apply_tag_by_name("hex_address", startIter, nextCharIter);
this.delete_mark(startMark);
- this.insert(nextCharIter, " ", 1);
+ this.insert(ref nextCharIter, " ", 1);
this.delete_mark(nextHexMark);
nextHexIter=nextCharIter;
nextHexMark = new TextMark("nextHex", true);
this.add_mark(nextHexMark, nextHexIter);
- this.insert(nextCharIter, " ", 51);
+ this.insert(ref nextCharIter, " ", 51);
this.delete_mark(nextCharMark);
nextCharMark = new TextMark("nextChar", true);
this.add_mark(nextCharMark, nextCharIter);
}
else if((hexBytes % 8)==0) {
this.get_iter_at_mark(out nextHexIter, nextHexMark);
- this.insert(nextHexIter, " ", 2);
+ this.insert(ref nextHexIter, " ", 2);
TextIter tempIter;
//remove space to align chars
tempIter = nextHexIter;
tempIter.forward_chars(2);
- this.delete(nextHexIter, tempIter);
+ this.delete(ref nextHexIter, ref tempIter);
this.delete_mark(nextHexMark);
nextHexMark = new TextMark("nextHex", true);
this.add_mark(nextHexMark, nextHexIter);
}
this.get_iter_at_mark(out nextHexIter, nextHexMark);
incomingHexBuffer+="%02X ".printf(data);
- this.insert(nextHexIter, incomingHexBuffer, (int)incomingHexBuffer.length);
+ this.insert(ref nextHexIter, incomingHexBuffer, (int)incomingHexBuffer.length);
//remove space to align chars
TextIter tempIter;
tempIter = nextHexIter;
tempIter.forward_chars(3);
- this.delete(nextHexIter, tempIter);
+ this.delete(ref nextHexIter, ref tempIter);
//add odd coloring
/*if(((hexBytes+1)%2)==0) {
tempIter.backward_chars(3);
@@ -112,9 +112,9 @@ public class moserial.HexTextBuffer : TextBuffer
unichar c = "%c".printf(data).get_char();
string s = "%c".printf(data);
if(s.validate() && c.isprint())
- this.insert(nextCharIter, s, (int)s.length);
+ this.insert(ref nextCharIter, s, (int)s.length);
else
- this.insert(nextCharIter, ".", 1);
+ this.insert(ref nextCharIter, ".", 1);
this.delete_mark(nextCharMark);
nextCharMark = new TextMark("nextChar", true);
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
index 05ce4f5..304f944 100644
--- a/src/MainWindow.vala
+++ b/src/MainWindow.vala
@@ -371,7 +371,7 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
}
buf.get_end_iter(out iter);
- buf.insert(iter, builder.str, (int)builder.str.length);
+ buf.insert(ref iter, builder.str, (int)builder.str.length);
}
public void sendString(Widget w) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]