#1 Fix build with new mono 6, fixing confusion about System.Range and Bless.Util.Range
Merged 2 years ago by tpokorra. Opened 2 years ago by tpokorra.
rpms/ tpokorra/bless master  into  master

@@ -0,0 +1,172 @@ 

+ diff --git a/src/buffers/ByteBuffer.cs b/src/buffers/ByteBuffer.cs

+ index cc98504..f7af6ed 100644

+ --- a/src/buffers/ByteBuffer.cs

+ +++ b/src/buffers/ByteBuffer.cs

+ @@ -670,7 +670,7 @@ public class ByteBuffer : BaseBuffer {

+  	/// Returns as a SegmentCollection the data contained in 

+  	/// the specified range in the buffer.  

+  	///</summary>

+ -	public SegmentCollection RangeToSegmentCollection(Range range)

+ +	public SegmentCollection RangeToSegmentCollection(Util.Range range)

+  	{

+  		if (range.Size == 0)

+  			return null;

+ diff --git a/src/gui/DataBookFinder.cs b/src/gui/DataBookFinder.cs

+ index 50b5034..3248d3a 100644

+ --- a/src/gui/DataBookFinder.cs

+ +++ b/src/gui/DataBookFinder.cs

+ @@ -234,7 +234,7 @@ public class DataBookFinder : IFinder

+  	{

+  		GenericFindOperation state = (GenericFindOperation)ar.AsyncState;

+  		ThreadedAsyncOperation.OperationResult result = state.Result;

+ -		Range match = state.Match;

+ +		Util.Range match = state.Match;

+  

+  		DataView dv = null;

+  

+ @@ -381,7 +381,7 @@ public class DataBookFinder : IFinder

+  	{

+  		ReplaceAllOperation state = (ReplaceAllOperation)ar.AsyncState;

+  		ThreadedAsyncOperation.OperationResult result = state.Result;

+ -		Range firstMatch = state.FirstMatch;

+ +		Util.Range firstMatch = state.FirstMatch;

+  

+  		DataView dv = null;

+  

+ diff --git a/src/gui/areas/AreaGroup.cs b/src/gui/areas/AreaGroup.cs

+ index 58ee147..9f648ef 100644

+ --- a/src/gui/areas/AreaGroup.cs

+ +++ b/src/gui/areas/AreaGroup.cs

+ @@ -198,7 +198,7 @@ public class AreaGroup

+  		set { drawingArea = value; }

+  	}

+  	

+ -	public Range Selection {

+ +	public Bless.Util.Range Selection {

+  		get { return selection; }

+  		set { 

+  			if (selection == value)

+ @@ -251,7 +251,7 @@ public class AreaGroup

+  	/// Get the range of bytes and the number of rows that 

+  	/// are displayed in the current view.

+  	/// </summary>

+ -	public Range GetViewRange(out int nrows)

+ +	public Util.Range GetViewRange(out int nrows)

+  	{

+  		// find out number of rows, bytes in current view

+  		

+ @@ -271,9 +271,9 @@ public class AreaGroup

+  		

+  		// make sure we get an empty clipping Range when bleft==0

+  		if (bleft > 0)

+ -			return new Range(offset, offset + bleft - 1);

+ +			return new Util.Range(offset, offset + bleft - 1);

+  		else

+ -			return new Range();

+ +			return new Util.Range();

+  	}

+  	

+  	/// <summary>

+ @@ -381,7 +381,7 @@ public class AreaGroup

+  	private void SetupBufferCache()

+  	{

+  		int nrows;

+ -		Range view = GetViewRange(out nrows);

+ +		Util.Range view = GetViewRange(out nrows);

+  		if (view.Size != bufferCache.Length)

+  			bufferCache = new byte[view.Size];

+  		

+ @@ -474,12 +474,12 @@ public class AreaGroup

+  		

+  		if (q.Type > r.Type) {

+  			ha = new AtomicHighlight[3]{new AtomicHighlight(r), new AtomicHighlight(q), new AtomicHighlight(r)};

+ -			Range.SplitAtomic(ha, r, q);

+ +			Util.Range.SplitAtomic(ha, r, q);

+  			ha[1].AddContainer(r);

+  		}

+  		else {

+  			ha = new AtomicHighlight[3]{new AtomicHighlight(q), new AtomicHighlight(r), new AtomicHighlight(q)};

+ -			Range.SplitAtomic(ha, q, r);

+ +			Util.Range.SplitAtomic(ha, q, r);

+  			foreach (Highlight h in q.Containers)

+  				ha[1].AddContainer(h);

+  		}

+ @@ -533,7 +533,7 @@ public class AreaGroup

+  	private IntervalTree<AtomicHighlight> GetAtomicHighlights()

+  	{

+  		int nrows;

+ -		Range clip = GetViewRange(out nrows);

+ +		Util.Range clip = GetViewRange(out nrows);

+  		Highlight view = new Highlight(clip, Drawer.HighlightType.Normal);

+  		

+  		// get all highlights in current view

+ @@ -618,7 +618,7 @@ public class AreaGroup

+  		// if we don't find an overlap this means that either

+  		// 1. the prev cursor position is not visible on the screen

+  		// 2. the prev cursor position is at or beyond the end of the file

+ -		IList<AtomicHighlight> overlaps = atomicHighlights.SearchOverlap(new Range(prevCursorOffset, prevCursorOffset));

+ +		IList<AtomicHighlight> overlaps = atomicHighlights.SearchOverlap(new Util.Range(prevCursorOffset, prevCursorOffset));

+  		

+  		AtomicHighlight h = null;

+  		

+ diff --git a/src/tools/find/FindOperations.cs b/src/tools/find/FindOperations.cs

+ index 0351efd..e5984f9 100644

+ --- a/src/tools/find/FindOperations.cs

+ +++ b/src/tools/find/FindOperations.cs

+ @@ -146,8 +146,8 @@ public class ReplaceAllOperation: GenericFindOperation

+  

+  	protected override void DoOperation()

+  	{

+ -		Range m;

+ -		match = new Range();

+ +		Util.Range m;

+ +		match = new Util.Range();

+  		firstMatch = null;

+  

+  		numReplaced = 0;

+ @@ -159,7 +159,7 @@ public class ReplaceAllOperation: GenericFindOperation

+  

+  		while ((m = strategy.FindNext()) != null) {

+  			if (firstMatch == null) {

+ -				firstMatch = new Range(m);

+ +				firstMatch = new Util.Range(m);

+  			}

+  

+  			match.Start = m.Start;

+ diff --git a/src/tools/find/IFindStrategy.cs b/src/tools/find/IFindStrategy.cs

+ index bdf7a87..bc2b21b 100644

+ --- a/src/tools/find/IFindStrategy.cs

+ +++ b/src/tools/find/IFindStrategy.cs

+ @@ -31,13 +31,13 @@ public interface IFindStrategy

+  			ByteBuffer Buffer {	get; set; }

+  				long Position { get; set; }

+  

+ -						Range FindNext();

+ -	Range FindPrevious();

+ +						Util.Range FindNext();

+ +	Util.Range FindPrevious();

+  

+ -	Range FindNext(long limit);

+ -	Range FindPrevious(long limit);

+ +	Util.Range FindNext(long limit);

+ +	Util.Range FindPrevious(long limit);

+  

+  	bool Cancelled { get; set; }

+  		}

+  

+ -} // end namespace

+ \ No newline at end of file

+ +} // end namespace

+ diff --git a/src/tools/find/IFinder.cs b/src/tools/find/IFinder.cs

+ index 594de22..a29a8fd 100644

+ --- a/src/tools/find/IFinder.cs

+ +++ b/src/tools/find/IFinder.cs

+ @@ -30,7 +30,7 @@ public delegate void FirstFindHandler();

+  public interface IFinder

+  {

+  	IFindStrategy Strategy { get; set; }

+ -			Range LastFound { get; set; }

+ +			Util.Range LastFound { get; set; }

+  

+  

+  					event FirstFindHandler FirstFind;

file modified
+6 -1
@@ -3,13 +3,14 @@ 

  

  Name: bless

  Version: 0.6.0

- Release: 28%{?dist}

+ Release: 29%{?dist}

  Summary: High quality, full featured hex editor    

  

  License: GPLv2+        

  URL: http://home.gna.org/bless/           

  Source0: http://download.gna.org/%{name}/%{name}-%{version}.tar.gz

  Patch1: bless-0.6.0-buildfix.patch

+ Patch2: bless-0.6.0-fixblessutilrange.patch

  

  BuildRequires:  gcc

  BuildRequires: mono-devel
@@ -37,6 +38,7 @@ 

  %prep

  %setup -q

  %patch1 -p1 -b .buildfix

+ %patch2 -p1 -b .buildfixrange

  

  sed -i "s#gmcs#mcs#g" configure*

  sed -i "s#gmcs#mcs#g" builder/ModuleBuilder.cs
@@ -65,6 +67,9 @@ 

  %{_datadir}/omf/bless/

  

  %changelog

+ * Thu Feb 20 2020 Timotheus Pokorra <timotheus.pokorra@solidcharity.com> - 0.6.0-29

+ - Fix build with new mono 6, fixing confusion about System.Range and Bless.Util.Range

+ 

  * Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-28

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

no initial comment

Pull-Request has been merged by tpokorra

2 years ago