]> code.delx.au - gnu-emacs/blobdiff - nt/preprep.c
Fix typos.
[gnu-emacs] / nt / preprep.c
index 7fedd9b8df2cc7eaf693f855ecf9ae889372d671..7541536714cdaa7e5a05150ae4c0fad6641e8205 100644 (file)
@@ -1,13 +1,12 @@
-/* Pro-process emacs.exe for profiling by MSVC.
-   Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005,
-      2006, 2007  Free Software Foundation, Inc.
+/* Pre-process emacs.exe for profiling by MSVC.
+   Copyright (C) 1999, 2001-2011  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
 
    Andrew Innes <andrewi@harlequin.co.uk>       16-Jan-1999
      based on code from addsection.c
 
    Andrew Innes <andrewi@harlequin.co.uk>       16-Jan-1999
      based on code from addsection.c
@@ -38,9 +36,9 @@ Boston, MA 02110-1301, USA.
 
 PIMAGE_NT_HEADERS
 (__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress,
 
 PIMAGE_NT_HEADERS
 (__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress,
-                                   DWORD FileLength,
-                                   LPDWORD HeaderSum,
-                                   LPDWORD CheckSum);
+                                    DWORD FileLength,
+                                    LPDWORD HeaderSum,
+                                    LPDWORD CheckSum);
 
 #undef min
 #undef max
 
 #undef min
 #undef max
@@ -51,15 +49,15 @@ PIMAGE_NT_HEADERS
 /* File handling.  */
 
 typedef struct file_data {
 /* File handling.  */
 
 typedef struct file_data {
-    char          *name;
-    unsigned long  size;
-    HANDLE         file;
-    HANDLE         file_mapping;
-    unsigned char *file_base;
+  const char    *name;
+  unsigned long  size;
+  HANDLE         file;
+  HANDLE         file_mapping;
+  unsigned char *file_base;
 } file_data;
 
 int
 } file_data;
 
 int
-open_input_file (file_data *p_file, char *filename)
+open_input_file (file_data *p_file, const char *filename)
 {
   HANDLE file;
   HANDLE file_mapping;
 {
   HANDLE file;
   HANDLE file_mapping;
@@ -91,7 +89,7 @@ open_input_file (file_data *p_file, char *filename)
 }
 
 int
 }
 
 int
-open_output_file (file_data *p_file, char *filename, unsigned long size)
+open_output_file (file_data *p_file, const char *filename, unsigned long size)
 {
   HANDLE file;
   HANDLE file_mapping;
 {
   HANDLE file;
   HANDLE file_mapping;
@@ -121,7 +119,7 @@ open_output_file (file_data *p_file, char *filename, unsigned long size)
 }
 
 int
 }
 
 int
-open_inout_file (file_data *p_file, char *filename)
+open_inout_file (file_data *p_file, const char *filename)
 {
   HANDLE file;
   HANDLE file_mapping;
 {
   HANDLE file;
   HANDLE file_mapping;
@@ -179,7 +177,7 @@ get_unrounded_section_size (PIMAGE_SECTION_HEADER p_section)
 
 /* Return pointer to section header for named section. */
 IMAGE_SECTION_HEADER *
 
 /* Return pointer to section header for named section. */
 IMAGE_SECTION_HEADER *
-find_section (char * name, IMAGE_NT_HEADERS * nt_header)
+find_section (const char *name, IMAGE_NT_HEADERS *nt_header)
 {
   PIMAGE_SECTION_HEADER section;
   int i;
 {
   PIMAGE_SECTION_HEADER section;
   int i;
@@ -296,7 +294,7 @@ relocate_offset (DWORD offset,
 #define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL))
 
 #define PTR_TO_OFFSET(ptr, pfile_data) \
 #define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL))
 
 #define PTR_TO_OFFSET(ptr, pfile_data) \
-          ((unsigned char *)(ptr) - (pfile_data)->file_base)
+          ((unsigned const char *)(ptr) - (pfile_data)->file_base)
 
 #define OFFSET_TO_PTR(offset, pfile_data) \
           ((pfile_data)->file_base + (DWORD)(offset))
 
 #define OFFSET_TO_PTR(offset, pfile_data) \
           ((pfile_data)->file_base + (DWORD)(offset))
@@ -323,7 +321,7 @@ relocate_offset (DWORD offset,
    variables, because of dumping.]
 
    We could potentially generate the relocation data ourselves by making
    variables, because of dumping.]
 
    We could potentially generate the relocation data ourselves by making
-   two versions of temacs, one with an extra dummmy section before
+   two versions of temacs, one with an extra dummy section before
    EMHEAP to offset it, and then compare the dumped executables from
    both.  That is a lot of work though, and it doesn't solve the problem
    of dumped pointers to static variables, which also can be relocated.
    EMHEAP to offset it, and then compare the dumped executables from
    both.  That is a lot of work though, and it doesn't solve the problem
    of dumped pointers to static variables, which also can be relocated.
@@ -362,7 +360,7 @@ copy_executable_and_move_sections (file_data *p_infile,
 
 #define COPY_CHUNK(message, src, size)                                         \
   do {                                                                         \
 
 #define COPY_CHUNK(message, src, size)                                         \
   do {                                                                         \
-    unsigned char *s = (void *)(src);                                          \
+    unsigned const char *s = (void *)(src);                                    \
     unsigned long count = (size);                                              \
     printf ("%s\n", (message));                                                        \
     printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base);      \
     unsigned long count = (size);                                              \
     printf ("%s\n", (message));                                                        \
     printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base);      \
@@ -767,7 +765,6 @@ main (int argc, char **argv)
   PIMAGE_NT_HEADERS nt_header;
   file_data in_file, out_file;
   char out_filename[MAX_PATH], in_filename[MAX_PATH];
   PIMAGE_NT_HEADERS nt_header;
   file_data in_file, out_file;
   char out_filename[MAX_PATH], in_filename[MAX_PATH];
-  char *ptr;
 
   strcpy (in_filename, argv[1]);
   strcpy (out_filename, argv[2]);
 
   strcpy (in_filename, argv[1]);
   strcpy (out_filename, argv[2]);
@@ -828,6 +825,3 @@ main (int argc, char **argv)
 }
 
 /* eof */
 }
 
 /* eof */
-
-/* arch-tag: 144ca747-168e-43a0-9736-3f4c0ba1657f
-   (do not change this comment) */