From e552dc4c9c2f2956a4e1fc1b60e2aec0e3ebf532 Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Fri, 14 Sep 2012 07:55:01 -0700
Subject: [PATCH] Remove some dead assigns

---
 aegisub/src/gl_wrap.cpp                 | 4 +---
 aegisub/src/video_frame.cpp             | 5 ++---
 aegisub/src/video_provider_yuv4mpeg.cpp | 3 +--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/aegisub/src/gl_wrap.cpp b/aegisub/src/gl_wrap.cpp
index a052138c6..f2aa395f8 100644
--- a/aegisub/src/gl_wrap.cpp
+++ b/aegisub/src/gl_wrap.cpp
@@ -123,9 +123,7 @@ static inline Vector2D interp(Vector2D p1, Vector2D p2, float t) {
 }
 
 void OpenGLWrapper::DrawDashedLine(Vector2D p1, Vector2D p2, float step) const {
-	float dist = (p2 - p1).Len();
-	step /= dist;
-	dist -= step;
+	step /= (p2 - p1).Len();
 	for (float t = 0; t < 1.f; t += 2 * step) {
 		DrawLine(interp(p1, p2, t), interp(p1, p2, t + step));
 	}
diff --git a/aegisub/src/video_frame.cpp b/aegisub/src/video_frame.cpp
index 6f9f3ea29..f68f9a3cd 100644
--- a/aegisub/src/video_frame.cpp
+++ b/aegisub/src/video_frame.cpp
@@ -125,14 +125,13 @@ void AegiVideoFrame::SetTo(const unsigned char *source, unsigned int width, unsi
 wxImage AegiVideoFrame::GetImage() const {
 	unsigned char *buf = (unsigned char*)malloc(w*h*3);
 	if (!buf) throw std::bad_alloc();
-	const unsigned char *src = data;
-	unsigned char *dst = buf;
 
 	int Bpp = GetBpp();
 
 	// Convert
 	for (unsigned int y=0;y<h;y++) {
-		dst = buf + y*w*3;
+		unsigned char *dst = buf + y*w*3;
+		const unsigned char *src;
 		if (flipped) src = data + (h-y-1)*pitch;
 		else src = data + y*pitch;
 		for (unsigned int x=0;x<w;x++) {
diff --git a/aegisub/src/video_provider_yuv4mpeg.cpp b/aegisub/src/video_provider_yuv4mpeg.cpp
index 4eaa64fbf..ca2f436ad 100644
--- a/aegisub/src/video_provider_yuv4mpeg.cpp
+++ b/aegisub/src/video_provider_yuv4mpeg.cpp
@@ -308,12 +308,11 @@ YUV4MPEGVideoProvider::Y4M_FrameFlags YUV4MPEGVideoProvider::ParseFrameHeader(co
 /// can easily be done.
 int YUV4MPEGVideoProvider::IndexFile() {
 	int framecount = 0;
-	int64_t curpos = ftello(sf);
 
 	// the ParseFileHeader() call in LoadVideo() will already have read
 	// the file header for us and set the seek position correctly
 	while (true) {
-		curpos = ftello(sf); // update position
+		int64_t curpos = ftello(sf); // update position
 		// continue reading headers until no more are found
 		std::vector<wxString> tags = ReadHeader(curpos, false);
 		curpos = ftello(sf);
-- 
GitLab