diff --git a/magick/threshold.c b/magick/threshold.c
index 53fdf84..2646a35 100644
--- a/magick/threshold.c
+++ b/magick/threshold.c
@@ -146,6 +146,10 @@
 {
 #define ThresholdImageTag  "Threshold/Image"
 
+  CacheView
+    *image_view,
+    *threshold_view;
+
   Image
     *threshold_image;
 
@@ -162,10 +166,6 @@
   MagickRealType
     number_pixels;
 
-  CacheView
-    *image_view,
-    *threshold_view;
-
   assert(image != (const Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
@@ -360,6 +360,9 @@
 {
 #define ThresholdImageTag  "Threshold/Image"
 
+  CacheView
+    *image_view;
+
   ExceptionInfo
     *exception;
 
@@ -370,9 +373,6 @@
   MagickBooleanType
     status;
 
-  CacheView
-    *image_view;
-
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
@@ -516,6 +516,9 @@
 {
 #define ThresholdImageTag  "Threshold/Image"
 
+  CacheView
+    *image_view;
+
   GeometryInfo
     geometry_info;
 
@@ -532,9 +535,6 @@
   MagickStatusType
     flags;
 
-  CacheView
-    *image_view;
-
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
@@ -703,6 +703,9 @@
 {
 #define ClampImageTag  "Clamp/Image"
 
+  CacheView
+    *image_view;
+
   ExceptionInfo
     *exception;
 
@@ -713,9 +716,6 @@
   MagickBooleanType
     status;
 
-  CacheView
-    *image_view;
-
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
@@ -1349,6 +1349,9 @@
 {
 #define DitherImageTag  "Dither/Image"
 
+  CacheView
+    *image_view;
+
   long
     progress,
     y;
@@ -1362,9 +1365,6 @@
   ThresholdMap
     *map;
 
-  CacheView
-    *image_view;
-
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)