aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-10-01 13:37:37 +0200
committerEli Zaretskii2012-10-01 13:37:37 +0200
commit2d7d1608381a4c14822e50ae42e2a6d748842cc3 (patch)
treeb22ef7adf83c2aaf47cd7c6439a6e735f6b58551 /src
parent7692b36bc6557b20f966801e3db346d8a166d32e (diff)
downloademacs-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 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/ralloc.c4
-rw-r--r--src/unexw32.c8
3 files changed, 15 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d972f754549..074c74a70e2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
12012-10-01 Eli Zaretskii <eliz@gnu.org> 12012-10-01 Eli Zaretskii <eliz@gnu.org>
2 2
3 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6 as the previous version used 'void *'.
7
8 * ralloc.c (ROUNDUP): Fix last change.
9 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
10 'size_t'.
11
3 * w32proc.c <disable_itimers>: New static flag. 12 * w32proc.c <disable_itimers>: New static flag.
4 (init_timers): Initialize it to zero, after creating the critical 13 (init_timers): Initialize it to zero, after creating the critical
5 sections used by the timer threads. 14 sections used by the timer threads.
diff --git a/src/ralloc.c b/src/ralloc.c
index 9422215b54f..e4a8fe9c6da 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -92,11 +92,11 @@ static int extra_bytes;
92 by changing the definition of PAGE. */ 92 by changing the definition of PAGE. */
93#define PAGE (getpagesize ()) 93#define PAGE (getpagesize ())
94#define ROUNDUP(size) (((size_t) (size) + page_size - 1) \ 94#define ROUNDUP(size) (((size_t) (size) + page_size - 1) \
95 & ~((size_t)page_size - 1)) 95 & ~((size_t)(page_size - 1)))
96 96
97#define MEM_ALIGN sizeof (double) 97#define MEM_ALIGN sizeof (double)
98#define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \ 98#define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \
99 & ~((size_t)MEM_ALIGN - 1)) 99 & ~(MEM_ALIGN - 1))
100 100
101/* The hook `malloc' uses for the function which gets more space 101/* The hook `malloc' uses for the function which gets more space
102 from the system. */ 102 from the system. */
diff --git a/src/unexw32.c b/src/unexw32.c
index f8e755cbd2e..3eefc9ce058 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -314,19 +314,19 @@ relocate_offset (DWORD_PTR offset,
314} 314}
315 315
316#define OFFSET_TO_RVA(offset, section) \ 316#define OFFSET_TO_RVA(offset, section) \
317 (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) 317 ((section)->VirtualAddress + ((DWORD_PTR)(offset) - (section)->PointerToRawData))
318 318
319#define RVA_TO_OFFSET(rva, section) \ 319#define RVA_TO_OFFSET(rva, section) \
320 (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) 320 ((section)->PointerToRawData + ((DWORD_PTR)(rva) - (section)->VirtualAddress))
321 321
322#define RVA_TO_SECTION_OFFSET(rva, section) \ 322#define RVA_TO_SECTION_OFFSET(rva, section) \
323 ((DWORD_PTR)(rva) - section->VirtualAddress) 323 ((DWORD_PTR)(rva) - (section)->VirtualAddress)
324 324
325/* Convert address in executing image to RVA. */ 325/* Convert address in executing image to RVA. */
326#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) 326#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL))
327 327
328#define RVA_TO_PTR(var,section,filedata) \ 328#define RVA_TO_PTR(var,section,filedata) \
329 ((DWORD_PTR)(RVA_TO_OFFSET (var,section) + (filedata).file_base)) 329 ((unsigned char *)(RVA_TO_OFFSET (var,section) + (filedata).file_base))
330 330
331#define PTR_TO_OFFSET(ptr, pfile_data) \ 331#define PTR_TO_OFFSET(ptr, pfile_data) \
332 ((unsigned char *)(ptr) - (pfile_data)->file_base) 332 ((unsigned char *)(ptr) - (pfile_data)->file_base)