emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110322: Clean up the Windows x64 cha


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110322: Clean up the Windows x64 changes.
Date: Mon, 01 Oct 2012 13:37:37 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110322
fixes bug: http://debbugs.gnu.org/12544
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2012-10-01 13:37:37 +0200
message:
  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'.
modified:
  nt/ChangeLog
  nt/preprep.c
  src/ChangeLog
  src/ralloc.c
  src/unexw32.c
=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2012-09-30 21:36:42 +0000
+++ b/nt/ChangeLog      2012-10-01 11:37:37 +0000
@@ -1,3 +1,10 @@
+2012-10-01  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        * makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST).

=== modified file 'nt/preprep.c'
--- a/nt/preprep.c      2012-09-30 21:36:42 +0000
+++ b/nt/preprep.c      2012-10-01 11:37:37 +0000
@@ -279,16 +279,16 @@
 }
 
 #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))

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-01 09:46:01 +0000
+++ b/src/ChangeLog     2012-10-01 11:37:37 +0000
@@ -1,5 +1,14 @@
 2012-10-01  Eli Zaretskii  <address@hidden>
 
+       * 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 *'.
+
+       * ralloc.c (ROUNDUP): Fix last change.
+       (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
+       'size_t'.
+
        * w32proc.c <disable_itimers>: New static flag.
        (init_timers): Initialize it to zero, after creating the critical
        sections used by the timer threads.

=== modified file 'src/ralloc.c'
--- a/src/ralloc.c      2012-09-30 21:36:42 +0000
+++ b/src/ralloc.c      2012-10-01 11:37:37 +0000
@@ -92,11 +92,11 @@
    by changing the definition of PAGE.  */
 #define PAGE (getpagesize ())
 #define ROUNDUP(size) (((size_t) (size) + page_size - 1) \
-                      & ~((size_t)page_size - 1))
+                      & ~((size_t)(page_size - 1)))
 
 #define MEM_ALIGN sizeof (double)
 #define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \
-                          & ~((size_t)MEM_ALIGN - 1))
+                          & ~(MEM_ALIGN - 1))
 
 /* The hook `malloc' uses for the function which gets more space
    from the system.  */

=== modified file 'src/unexw32.c'
--- a/src/unexw32.c     2012-09-30 21:36:42 +0000
+++ b/src/unexw32.c     2012-10-01 11:37:37 +0000
@@ -314,19 +314,19 @@
 }
 
 #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)
 
 /* Convert address in executing image to RVA.  */
 #define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL))
 
 #define RVA_TO_PTR(var,section,filedata) \
-         ((DWORD_PTR)(RVA_TO_OFFSET (var,section) + (filedata).file_base))
+         ((unsigned char *)(RVA_TO_OFFSET (var,section) + 
(filedata).file_base))
 
 #define PTR_TO_OFFSET(ptr, pfile_data) \
           ((unsigned char *)(ptr) - (pfile_data)->file_base)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]