Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3902)

Unified Diff: base/win/pe_image.cc

Issue 1370843003: Remove warning pragmas in pe_image.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/pe_image.cc
diff --git a/base/win/pe_image.cc b/base/win/pe_image.cc
index e67eb0886f1423e978f50d99e88b770106df5440..a5c41388de34c0ae5ea24e6df4c694f1273c18d5 100644
--- a/base/win/pe_image.cc
+++ b/base/win/pe_image.cc
@@ -10,8 +10,6 @@
namespace base {
namespace win {
-// TODO(jschuh): crbug.com/167707 Make sure this code works on 64-bit.
-
// Structure to perform imports enumerations.
struct EnumAllImportsStorage {
PEImage::EnumImportsFunction callback;
@@ -213,7 +211,7 @@ FARPROC PEImage::GetProcAddress(LPCSTR function_name) const {
if (exports <= function && exports + size > function)
#pragma warning(push)
#pragma warning(disable: 4312)
- // This cast generates a warning because it is 32 bit specific.
+ // Cast from 32-bit value to 64-bit pointer generates C4312 on 64-bit.
Nico 2015/12/23 20:57:01 It'd be nice if the comment also said why the warn
Will Harris 2015/12/24 05:35:51 I changed this function to return -1 on both 64-bi
return reinterpret_cast<FARPROC>(0xFFFFFFFF);
#pragma warning(pop)
@@ -456,7 +454,7 @@ bool PEImage::EnumDelayImportChunks(EnumDelayImportChunksFunction callback,
} else {
#pragma warning(push)
#pragma warning(disable: 4312)
- // These casts generate warnings because they are 32 bit specific.
+ // Casts from 32-bit values to 64-bit pointers generates C4312 on 64-bit.
Nico 2015/12/23 20:57:01 ditto
Will Harris 2015/12/24 05:35:51 Done. Actually just changed the cast instead of su
module_name = reinterpret_cast<LPCSTR>(delay_descriptor->rvaDLLName);
name_table =
reinterpret_cast<PIMAGE_THUNK_DATA>(delay_descriptor->rvaINT);
@@ -493,12 +491,8 @@ bool PEImage::EnumOneDelayImportChunk(EnumImportsFunction callback,
import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>(
RVAToAddr(name_table->u1.ForwarderString));
} else {
-#pragma warning(push)
-#pragma warning(disable: 4312)
- // This cast generates a warning because it is 32 bit specific.
import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>(
name_table->u1.ForwarderString);
-#pragma warning(pop)
}
hint = import->Hint;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698