summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-10-01 13:37:37 +0200
committerEli Zaretskii <eliz@gnu.org>2012-10-01 13:37:37 +0200
commit2d7d1608381a4c14822e50ae42e2a6d748842cc3 (patch)
treeb22ef7adf83c2aaf47cd7c6439a6e735f6b58551 /nt
parent7692b36bc6557b20f966801e3db346d8a166d32e (diff)
downloademacs-2d7d1608381a4c14822e50ae42e2a6d748842cc3.tar.gz
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/ChangeLog7
-rw-r--r--nt/preprep.c8
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 @@
+2012-10-01 Eli Zaretskii <eliz@gnu.org>
+
+ * 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.
+
2012-09-30 Eli Zaretskii <eliz@gnu.org>
* 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,
}
#define OFFSET_TO_RVA(offset, section) \
- (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData))
+ ((section)->VirtualAddress + ((DWORD_PTR)(offset) - (section)->PointerToRawData))
#define RVA_TO_OFFSET(rva, section) \
- (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress))
+ ((section)->PointerToRawData + ((DWORD_PTR)(rva) - (section)->VirtualAddress))
#define RVA_TO_SECTION_OFFSET(rva, section) \
- ((DWORD_PTR)(rva) - section->VirtualAddress)
+ ((DWORD_PTR)(rva) - (section)->VirtualAddress)
#define RVA_TO_PTR(var,section,filedata) \
- ((void *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base))
+ ((unsigned char *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base))
/* Convert address in executing image to RVA. */
#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL))