Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a bunch of compiler warnings.

These were mostly due to unused variables, or variables that were
assigned to but not used.
  • Loading branch information...
commit 7bf5de83f54c15db64735ba23ac7df2e55eb6e80 1 parent f8241af
@cameronwhite cameronwhite authored
View
1  Pinta.Core/Actions/EditActions.cs
@@ -293,7 +293,6 @@ private void HandlerPintaCoreActionsEditCutActivated (object sender, EventArgs e
Gtk.Clipboard cb = Gtk.Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
if (PintaCore.Tools.CurrentTool.TryHandleCut (cb))
return;
- Document doc = PintaCore.Workspace.ActiveDocument;
PintaCore.Tools.Commit ();
// Copy selection
View
2  Pinta.Core/Classes/Document.cs
@@ -50,7 +50,6 @@ public class Document
// The layer used for selections
private Layer selection_layer;
- private int selection_layer_index;
private bool show_selection;
public DocumentSelection Selection = new DocumentSelection();
@@ -308,7 +307,6 @@ public void CreateSelectionLayer ()
Layer old = selection_layer;
selection_layer = CreateLayer ();
- selection_layer_index = current_layer + 1;
if (old != null)
(old.Surface as IDisposable).Dispose ();
View
2  Pinta.Core/Classes/DocumentWorkspace.cs
@@ -44,7 +44,7 @@ private enum ZoomType
internal DocumentWorkspace (Document document)
{
this.document = document;
- History = new DocumentWorkspaceHistory (document, this);
+ History = new DocumentWorkspaceHistory (document);
}
#region Public Properties
View
4 Pinta.Core/Classes/DocumentWorkspaceHistory.cs
@@ -33,14 +33,12 @@ namespace Pinta.Core
public class DocumentWorkspaceHistory
{
private Document document;
- private DocumentWorkspace workspace;
List<BaseHistoryItem> history = new List<BaseHistoryItem> ();
int historyPointer = -1;
- internal DocumentWorkspaceHistory (Document document, DocumentWorkspace workspace)
+ internal DocumentWorkspaceHistory (Document document)
{
this.document = document;
- this.workspace = workspace;
ListStore = new ListStore (typeof (BaseHistoryItem));
}
View
10 Pinta.Core/Clipper/Clipper.cs
@@ -205,7 +205,7 @@ public static Int128 Int128Mul(Int64 lhs, Int64 rhs)
if (denom > result) return new Int128(0); //result is only a fraction of 1
denom = -denom;
- Int128 p = new Int128(0), p2 = new Int128(0);
+ Int128 p = new Int128(0);
for (int i = 0; i < 128; ++i)
{
p.hi = p.hi << 1;
@@ -1137,9 +1137,7 @@ private bool ExecuteInternal(bool fixHoleLinkages)
private Int64 PopScanbeam()
{
Int64 Y = m_Scanbeam.Y;
- Scanbeam sb2 = m_Scanbeam;
m_Scanbeam = m_Scanbeam.next;
- sb2 = null;
return Y;
}
//------------------------------------------------------------------------------
@@ -1174,13 +1172,10 @@ void DisposeOutRec(int index)
private void DisposeOutPts(OutPt pp)
{
if (pp == null) return;
- OutPt tmpPp = null;
pp.prev.next = null;
while (pp != null)
{
- tmpPp = pp;
pp = pp.next;
- tmpPp = null;
}
}
//------------------------------------------------------------------------------
@@ -3080,13 +3075,11 @@ private void FixupOutPolygon(OutRec outRec)
SlopesEqual(pp.prev.pt, pp.pt, pp.next.pt, m_UseFullRange))
{
lastOK = null;
- OutPt tmp = pp;
if (pp == outRec.bottomPt)
outRec.bottomPt = null; //flags need for updating
pp.prev.next = pp.next;
pp.next.prev = pp.prev;
pp = pp.prev;
- tmp = null;
}
else if (pp == lastOK) break;
else
@@ -3420,7 +3413,6 @@ public PolyOffsetBuilder(Polygons pts, Polygons solution, double delta, JoinType
normals = new List<DoublePoint>();
- double deltaSq = delta*delta;
solution.Clear();
solution.Capacity = pts.Count;
for (m_i = 0; m_i < pts.Count; m_i++)
View
2  Pinta.Core/Effects/PixelOp.cs
@@ -92,7 +92,7 @@ public void ApplyBase (ImageSurface dst, Gdk.Point dstOffset, ImageSurface src,
// Do the work.
unsafe {
- for (int row = 0; row < roiSize.Height; ++row) {
+ for (int row = 0; row < height; ++row) {
ColorBgra* dstPtr = dst.GetPointAddress (dstOffset.X, dstOffset.Y + row);
ColorBgra* srcPtr = src.GetPointAddress (srcOffset.X, srcOffset.Y + row);
Apply (dstPtr, srcPtr, width);
View
3  Pinta.Effects/Effects/AddNoiseEffect.cs
@@ -67,9 +67,6 @@ private static double NormalCurve (double x, double scale)
private static void InitLookup ()
{
- int[] curve = new int[tableSize];
- int[] integral = new int[tableSize];
-
double l = 5;
double r = 10;
double scale = 50;
View
3  Pinta.Effects/Effects/BulgeEffect.cs
@@ -55,8 +55,7 @@ unsafe public override void Render (ImageSurface src, ImageSurface dst, Gdk.Rect
float hw = dst.Width / 2f;
float hh = dst.Height / 2f;
float maxrad = Math.Min (hw, hh);
- float maxrad2 = maxrad * maxrad;
- float amt = Data.Amount / 100f;
+ float amt = bulge / 100f;
hh = hh + (float)Data.Offset.Y * hh;
hw = hw + (float)Data.Offset.X * hw;
View
1  Pinta.Effects/Effects/FragmentEffect.cs
@@ -50,7 +50,6 @@ private Gdk.Point[] RecalcPointOffsets (int fragments, double rotationAngle, int
{
double pointStep = 2 * Math.PI / (double)fragments;
double rotationRadians = ((rotationAngle - 90.0) * Math.PI) / 180.0;
- double offsetAngle = pointStep;
Gdk.Point[] pointOffsets = new Gdk.Point[fragments];
View
2  Pinta.Effects/Effects/GaussianBlurEffect.cs
@@ -93,8 +93,6 @@ public unsafe override void Render (ImageSurface src, ImageSurface dest, Gdk.Rec
long* rSums = (long*)p;
p += wlen * sizeof (long);
- ulong arraysLength = (ulong)(sizeof (long) * wlen);
-
// Cache these for a massive performance boost
int src_width = src.Width;
int src_height = src.Height;
View
3  Pinta.Effects/Effects/MandelbrotFractalEffect.cs
@@ -78,9 +78,6 @@ unsafe public override void Render (ImageSurface src, ImageSurface dst, Gdk.Rect
int w = dst.Width;
int h = dst.Height;
- double wDiv2 = (double)w / 2;
- double hDiv2 = (double)h / 2;
-
double invH = 1.0 / h;
double zoom = 1 + zoomFactor * Data.Zoom;
double invZoom = 1.0 / zoom;
View
3  Pinta.Effects/Effects/MotionBlurEffect.cs
@@ -86,9 +86,6 @@ public unsafe override void Render (ImageSurface src, ImageSurface dst, Gdk.Rect
for (int x = rect.Left; x <= rect.GetRight (); ++x) {
int sampleCount = 0;
- PointD a = new PointD ((float)x + points[0].X, (float)y + points[0].Y);
- PointD b = new PointD ((float)x + points[points.Length - 1].X, (float)y + points[points.Length - 1].Y);
-
for (int j = 0; j < points.Length; ++j) {
PointD pt = new PointD (points[j].X + (float)x, points[j].Y + (float)y);
View
5 Pinta.Gui.Widgets/Widgets/Canvas/CanvasRenderer.cs
@@ -132,10 +132,9 @@ private unsafe void RenderOneToOne (List<Layer> layers, Cairo.ImageSurface dst,
var src_ptr = (ColorBgra*)src.DataPtr;
var dst_ptr = (ColorBgra*)dst.DataPtr;
- // Cache widths and heights
+ // Cache widths
int src_width = src.Width;
int dst_width = dst.Width;
- int dst_height = dst.Height;
for (int dstRow = 0; dstRow < srcRect.Height; ++dstRow) {
ColorBgra* dstRowPtr = dst.GetRowAddressUnchecked (dst_ptr, dst_width, dstRow);
@@ -326,8 +325,6 @@ private unsafe void RenderZoomOut (List<Layer> layers, Cairo.ImageSurface dst, G
private unsafe void RenderPixelGrid (Cairo.ImageSurface dst, Gdk.Point offset)
{
- var blackAndWhite = new ColorBgra[2] { ColorBgra.White, ColorBgra.Black };
-
// Draw horizontal lines
var dst_ptr = (ColorBgra*)dst.DataPtr;
int dstHeight = dst.Height;
View
2  Pinta.Gui.Widgets/Widgets/PointPickerGraphic.cs
@@ -178,8 +178,6 @@ private Point MousePtToPosition (Cairo.PointD clientMousePt)
private Cairo.PointD PositionToClientPt (Point pos)
{
- Point center = Allocation.Center ();
-
double halfWidth = PintaCore.Workspace.ImageSize.Width / Allocation.Width;
double halfHeight = PintaCore.Workspace.ImageSize.Height / Allocation.Height;
View
2  Pinta.Tools/Tools/EraserTool.cs
@@ -58,8 +58,6 @@ protected override void OnMouseMove (object o, Gtk.MotionNotifyEventArgs args, C
return;
}
- DrawingArea drawingarea1 = (DrawingArea)o;
-
int x = (int)point.X;
int y = (int)point.Y;
View
2  Pinta.Tools/Tools/FreeformShapeTool.cs
@@ -112,8 +112,6 @@ protected override void OnMouseMove (object o, Gtk.MotionNotifyEventArgs args, C
return;
}
- DrawingArea drawingarea1 = (DrawingArea)o;
-
int x = (int)point.X;
int y = (int)point.Y;
View
1  Pinta.Tools/Tools/ShapeTool.cs
@@ -197,7 +197,6 @@ protected override void OnMouseUp (Gtk.DrawingArea canvas, Gtk.ButtonReleaseEven
DrawShape (Utility.PointsToRectangle (shape_origin, new PointD (x, y), args.Event.IsShiftPressed ()), doc.CurrentLayer, args.Event.IsShiftPressed ());
- Gdk.Rectangle r = GetRectangleFromPoints (shape_origin, new PointD (x, y));
doc.Workspace.Invalidate (last_dirty.ToGdkRectangle ());
is_drawing = false;

0 comments on commit 7bf5de8

Please sign in to comment.
Something went wrong with that request. Please try again.