Tidy some warnings from clang-tidy

- Some values not read.
- Use of stack after move().

Change-Id: I9cd0c3d79309b5f1fa27ec5a3f50e72ae41c8493
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52430
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_object_avail.cpp b/core/fpdfapi/parser/cpdf_object_avail.cpp
index 1c1ab15..e1b9b3f 100644
--- a/core/fpdfapi/parser/cpdf_object_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_object_avail.cpp
@@ -75,8 +75,9 @@
 }
 
 bool CPDF_ObjectAvail::CheckObjects() {
-  std::stack<uint32_t> objects_to_check = std::move(non_parsed_objects_);
   std::set<uint32_t> checked_objects;
+  std::stack<uint32_t> objects_to_check = std::move(non_parsed_objects_);
+  non_parsed_objects_ = std::stack<uint32_t>();
   while (!objects_to_check.empty()) {
     const uint32_t obj_num = objects_to_check.top();
     objects_to_check.pop();
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index af4cef3..0bdf701 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -1074,7 +1074,6 @@
       }
     } else {
       pStreamDict->SetFor("Resources", pFormDict->GetDictFor("DR")->Clone());
-      pStreamResList = pStreamDict->GetDictFor("Resources");
     }
   }
   switch (type) {
@@ -1316,7 +1315,6 @@
         }
       } else {
         pStreamDict->SetFor("Resources", pFormDict->GetDictFor("DR")->Clone());
-        pStreamResList = pStreamDict->GetDictFor("Resources");
       }
     }
   }
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp
index 0d2ce14..906daf8 100644
--- a/core/fxcodec/jbig2/JBig2_SddProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp
@@ -241,7 +241,7 @@
     return nullptr;
 
   pDict = pdfium::MakeUnique<CJBig2_SymbolDict>();
-  I = J = 0;
+  J = 0;
   for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) {
     if (!EXFLAGS[I] || J >= SDNUMEXSYMS)
       continue;
@@ -508,7 +508,7 @@
   if (num_ex_syms > SDNUMEXSYMS)
     return nullptr;
 
-  I = J = 0;
+  J = 0;
   for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; ++I) {
     if (!EXFLAGS[I] || J >= SDNUMEXSYMS)
       continue;
diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp
index 91a6014..6c9184a 100644
--- a/fpdfsdk/fpdf_save.cpp
+++ b/fpdfsdk/fpdf_save.cpp
@@ -81,7 +81,6 @@
   int size = pArray->size();
   int iFormIndex = -1;
   int iDataSetsIndex = -1;
-  int iLast = size - 2;
   for (int i = 0; i < size - 1; i++) {
     const CPDF_Object* pPDFObj = pArray->GetObjectAt(i);
     if (!pPDFObj->IsString())
@@ -138,7 +137,7 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pDsfileWrite, std::move(pDataDict));
-        iLast = pArray->size() - 2;
+        int iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "datasets", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
@@ -162,7 +161,7 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pfileWrite, std::move(pDataDict));
-        iLast = pArray->size() - 2;
+        int iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "form", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
diff --git a/testing/image_diff/image_diff_png.cpp b/testing/image_diff/image_diff_png.cpp
index d2c9099..09fb34f 100644
--- a/testing/image_diff/image_diff_png.cpp
+++ b/testing/image_diff/image_diff_png.cpp
@@ -593,7 +593,6 @@
       input_color_components = 3;
       output_color_components = 3;
       png_output_color_type = PNG_COLOR_TYPE_RGB;
-      discard_transparency = false;
       break;
 
     case FORMAT_RGBA:
@@ -626,7 +625,6 @@
       input_color_components = 1;
       output_color_components = 1;
       png_output_color_type = PNG_COLOR_TYPE_GRAY;
-      discard_transparency = false;
       break;
 
     default:
diff --git a/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp b/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
index e571837..4aedf00 100644
--- a/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
@@ -1200,7 +1200,6 @@
         AddContentAreaLayoutItem(
             pNewRecord, pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
                             XFA_Element::ContentArea));
-        pPreferredPageArea = pCurrentNode;
         return false;
       }
       if (ePreferredPosition == XFA_AttributeValue::Only) {