Remove unneeded void* casts.

Change-Id: Icf6b0ec88dfc8dc707b18ca4ad25dd77610b4c91
Reviewed-on: https://pdfium-review.googlesource.com/3622
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/core/fdrm/crypto/fx_crypt.cpp b/core/fdrm/crypto/fx_crypt.cpp
index 693b2ef..aac4edb 100644
--- a/core/fdrm/crypto/fx_crypt.cpp
+++ b/core/fdrm/crypto/fx_crypt.cpp
@@ -209,7 +209,7 @@
   ctx->total[0] &= 0xFFFFFFFF;
   ctx->total[1] += ctx->total[0] < length << 3;
   if (left && length >= fill) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+    memcpy(ctx->buffer + left, input, fill);
     md5_process(ctx, ctx->buffer);
     length -= fill;
     input += fill;
@@ -221,7 +221,7 @@
     input += 64;
   }
   if (length) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, length);
+    memcpy(ctx->buffer + left, input, length);
   }
 }
 
diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp
index e0643d5..d2745e8 100644
--- a/core/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/fdrm/crypto/fx_crypt_sha.cpp
@@ -481,11 +481,11 @@
   uint32_t fill = 64 - left;
   ctx->total[0] += length;
   ctx->total[0] &= 0xFFFFFFFF;
-  if (ctx->total[0] < length) {
+  if (ctx->total[0] < length)
     ctx->total[1]++;
-  }
+
   if (left && length >= fill) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+    memcpy(ctx->buffer + left, input, fill);
     sha256_process(ctx, ctx->buffer);
     length -= fill;
     input += fill;
@@ -496,9 +496,8 @@
     length -= 64;
     input += 64;
   }
-  if (length) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, length);
-  }
+  if (length)
+    memcpy(ctx->buffer + left, input, length);
 }
 
 void CRYPT_SHA256Finish(CRYPT_sha256_context* ctx, uint8_t digest[32]) {
@@ -550,18 +549,17 @@
 void CRYPT_SHA384Update(CRYPT_sha384_context* ctx,
                         const uint8_t* input,
                         uint32_t length) {
-  uint32_t left, fill;
-  if (!length) {
+  if (!length)
     return;
-  }
-  left = (uint32_t)ctx->total[0] & 0x7F;
-  fill = 128 - left;
+
+  uint32_t left = static_cast<uint32_t>(ctx->total[0]) & 0x7F;
+  uint32_t fill = 128 - left;
   ctx->total[0] += length;
-  if (ctx->total[0] < length) {
+  if (ctx->total[0] < length)
     ctx->total[1]++;
-  }
+
   if (left && length >= fill) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, fill);
+    memcpy(ctx->buffer + left, input, fill);
     sha384_process(ctx, ctx->buffer);
     length -= fill;
     input += fill;
@@ -572,9 +570,8 @@
     length -= 128;
     input += 128;
   }
-  if (length) {
-    memcpy((void*)(ctx->buffer + left), (void*)input, length);
-  }
+  if (length)
+    memcpy(ctx->buffer + left, input, length);
 }
 
 void CRYPT_SHA384Finish(CRYPT_sha384_context* ctx, uint8_t digest[48]) {
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp
index 44042cb..e95715b 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_security_handler.cpp
@@ -452,11 +452,9 @@
     CRYPT_MD5Finish(&md5, ukeybuf);
     return memcmp(test, ukeybuf, 16) == 0;
   }
-  if (memcmp((void*)ukey.c_str(), ukeybuf, 16) == 0) {
-    return true;
-  }
-  return false;
+  return memcmp(ukey.c_str(), ukeybuf, 16) == 0;
 }
+
 CFX_ByteString CPDF_SecurityHandler::GetUserPassword(const uint8_t* owner_pass,
                                                      uint32_t pass_size,
                                                      int32_t key_len) {
diff --git a/core/fxcodec/codec/ccodec_bmpmodule.cpp b/core/fxcodec/codec/ccodec_bmpmodule.cpp
index 660e89c..003f5d3 100644
--- a/core/fxcodec/codec/ccodec_bmpmodule.cpp
+++ b/core/fxcodec/codec/ccodec_bmpmodule.cpp
@@ -63,13 +63,13 @@
   p->m_AllocFunc = bmp_alloc_func;
   p->m_FreeFunc = bmp_free_func;
   p->bmp_ptr = nullptr;
-  p->parent_ptr = (void*)this;
+  p->parent_ptr = this;
   p->bmp_ptr = bmp_create_decompress();
   if (!p->bmp_ptr) {
     FX_Free(p);
     return nullptr;
   }
-  p->bmp_ptr->context_ptr = (void*)p;
+  p->bmp_ptr->context_ptr = p;
   p->bmp_ptr->err_ptr = m_szLastError;
   p->bmp_ptr->bmp_error_fn = bmp_error_data;
   p->bmp_ptr->bmp_get_row_fn = bmp_read_scanline;
diff --git a/core/fxcodec/codec/ccodec_gifmodule.cpp b/core/fxcodec/codec/ccodec_gifmodule.cpp
index caa21e1..ca9fd07 100644
--- a/core/fxcodec/codec/ccodec_gifmodule.cpp
+++ b/core/fxcodec/codec/ccodec_gifmodule.cpp
@@ -92,13 +92,13 @@
   p->m_AllocFunc = gif_alloc_func;
   p->m_FreeFunc = gif_free_func;
   p->gif_ptr = nullptr;
-  p->parent_ptr = (void*)this;
+  p->parent_ptr = this;
   p->gif_ptr = gif_create_decompress();
   if (!p->gif_ptr) {
     FX_Free(p);
     return nullptr;
   }
-  p->gif_ptr->context_ptr = (void*)p;
+  p->gif_ptr->context_ptr = p;
   p->gif_ptr->err_ptr = m_szLastError;
   p->gif_ptr->gif_error_fn = gif_error_data;
   p->gif_ptr->gif_ask_buf_for_pal_fn = gif_ask_buf_for_pal;
diff --git a/core/fxcodec/codec/ccodec_pngmodule.cpp b/core/fxcodec/codec/ccodec_pngmodule.cpp
index ae34b53..09bc1ac 100644
--- a/core/fxcodec/codec/ccodec_pngmodule.cpp
+++ b/core/fxcodec/codec/ccodec_pngmodule.cpp
@@ -211,7 +211,7 @@
   p->m_FreeFunc = _png_free_func;
   p->png_ptr = nullptr;
   p->info_ptr = nullptr;
-  p->parent_ptr = (void*)this;
+  p->parent_ptr = this;
   p->png_ptr =
       png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
   if (!p->png_ptr) {
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp
index cc51677..e4ef355 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
+++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
@@ -186,7 +186,7 @@
     return false;
   T* ptr = FX_Alloc(T, 1);
   *ptr = val;
-  pAttr->m_Exif[tag] = (void*)ptr;
+  pAttr->m_Exif[tag] = ptr;
   return true;
 }
 
diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp
index b143dcc..315f484 100644
--- a/core/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/fxcodec/codec/fx_codec_icc.cpp
@@ -62,7 +62,7 @@
                              uint32_t dwDstFormat = Icc_FORMAT_DEFAULT) {
   nSrcComponents = 0;
   cmsHPROFILE srcProfile =
-      cmsOpenProfileFromMem((void*)pSrcProfileData, dwSrcProfileSize);
+      cmsOpenProfileFromMem(pSrcProfileData, dwSrcProfileSize);
   if (!srcProfile)
     return nullptr;
 
@@ -70,8 +70,7 @@
   if (!pDstProfileData && dwDstProfileSize == 0 && nDstComponents == 3) {
     dstProfile = cmsCreate_sRGBProfile();
   } else {
-    dstProfile =
-        cmsOpenProfileFromMem((void*)pDstProfileData, dwDstProfileSize);
+    dstProfile = cmsOpenProfileFromMem(pDstProfileData, dwDstProfileSize);
   }
   if (!dstProfile) {
     cmsCloseProfile(srcProfile);
@@ -205,8 +204,7 @@
                            unsigned char* pDest,
                            const unsigned char* pSrc,
                            int32_t pixels) {
-  cmsDoTransform(((CLcmsCmm*)pTransform)->m_hTransform, (void*)pSrc, pDest,
-                 pixels);
+  cmsDoTransform(((CLcmsCmm*)pTransform)->m_hTransform, pSrc, pDest, pixels);
 }
 
 CCodec_IccModule::CCodec_IccModule() : m_nComponents(0) {}
diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h
index 375ca3a..fb901dc 100644
--- a/fpdfsdk/javascript/JS_Define.h
+++ b/fpdfsdk/javascript/JS_Define.h
@@ -222,7 +222,7 @@
                                     v8::Local<v8::Object> obj) {        \
     CJS_Object* pObj = new js_class_name(obj);                          \
     pObj->SetEmbedObject(new class_alternate(pObj));                    \
-    pEngine->SetObjectPrivate(obj, (void*)pObj);                        \
+    pEngine->SetObjectPrivate(obj, pObj);                               \
     pObj->InitInstance(static_cast<CJS_Runtime*>(pEngine));             \
   }                                                                     \
   void js_class_name::JSDestructor(CFXJS_Engine* pEngine,               \