diff options
| author | Eli Zaretskii | 2012-10-01 13:37:37 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-01 13:37:37 +0200 |
| commit | 2d7d1608381a4c14822e50ae42e2a6d748842cc3 (patch) | |
| tree | b22ef7adf83c2aaf47cd7c6439a6e735f6b58551 /nt | |
| parent | 7692b36bc6557b20f966801e3db346d8a166d32e (diff) | |
| download | emacs-2d7d1608381a4c14822e50ae42e2a6d748842cc3.tar.gz emacs-2d7d1608381a4c14822e50ae42e2a6d748842cc3.zip | |
Clean up the Windows x64 changes.
nt/preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of
'void *', for pointer arithmetics.
(OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET): Enclose all
macro arguments in parentheses.
src/unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
(RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
(RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
as the previous version used 'void *'.
src/ralloc.c (ROUNDUP): Fix last change.
(MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
'size_t'.
Fixes: debbugs:12544
Diffstat (limited to 'nt')
| -rw-r--r-- | nt/ChangeLog | 7 | ||||
| -rw-r--r-- | nt/preprep.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index 7247b18e080..42171de0322 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-10-01 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of | ||
| 4 | 'void *', for pointer arithmetics. | ||
| 5 | (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET): Enclose all | ||
| 6 | macro arguments in parentheses. | ||
| 7 | |||
| 1 | 2012-09-30 Eli Zaretskii <eliz@gnu.org> | 8 | 2012-09-30 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST). | 10 | * makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST). |
diff --git a/nt/preprep.c b/nt/preprep.c index 9824cda0b58..5a632b3875f 100644 --- a/nt/preprep.c +++ b/nt/preprep.c | |||
| @@ -279,16 +279,16 @@ relocate_offset (DWORD_PTR offset, | |||
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | #define OFFSET_TO_RVA(offset, section) \ | 281 | #define OFFSET_TO_RVA(offset, section) \ |
| 282 | (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) | 282 | ((section)->VirtualAddress + ((DWORD_PTR)(offset) - (section)->PointerToRawData)) |
| 283 | 283 | ||
| 284 | #define RVA_TO_OFFSET(rva, section) \ | 284 | #define RVA_TO_OFFSET(rva, section) \ |
| 285 | (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) | 285 | ((section)->PointerToRawData + ((DWORD_PTR)(rva) - (section)->VirtualAddress)) |
| 286 | 286 | ||
| 287 | #define RVA_TO_SECTION_OFFSET(rva, section) \ | 287 | #define RVA_TO_SECTION_OFFSET(rva, section) \ |
| 288 | ((DWORD_PTR)(rva) - section->VirtualAddress) | 288 | ((DWORD_PTR)(rva) - (section)->VirtualAddress) |
| 289 | 289 | ||
| 290 | #define RVA_TO_PTR(var,section,filedata) \ | 290 | #define RVA_TO_PTR(var,section,filedata) \ |
| 291 | ((void *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base)) | 291 | ((unsigned char *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base)) |
| 292 | 292 | ||
| 293 | /* Convert address in executing image to RVA. */ | 293 | /* Convert address in executing image to RVA. */ |
| 294 | #define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) | 294 | #define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) |