Skip to content
Snippets Groups Projects
Commit e0ba1b6d authored by fgilham's avatar fgilham
Browse files

Fixed indentation I broke in save.c and lisp.c.

parent 757179b1
No related branches found
No related tags found
No related merge requests found
/*
* main() entry point for a stand alone lisp image.
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.54 2007/07/07 17:25:10 fgilham Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.55 2007/07/08 06:58:34 fgilham Exp $
*
*/
......@@ -437,7 +437,8 @@ main(int argc, char *argv[], char *envp[])
if (strcmp(arg, "-core") == 0) {
#ifdef FEATURE_EXECUTABLE
if (builtin_image_flag) {
fprintf(stderr, "Cannot specify alternate core file with executable image.\n");
fprintf(stderr,
"Cannot specify core file in executable image --- sorry about that.\n");
exit(1);
}
#endif
......@@ -447,13 +448,15 @@ main(int argc, char *argv[], char *envp[])
}
core = *++argptr;
if (core == NULL) {
fprintf(stderr, "-core must be followed by the name of the core file to use.\n");
fprintf(stderr,
"-core must be followed by the name of the core file to use.\n");
exit(1);
}
} else if (strcmp(arg, "-lib") == 0) {
lib = *++argptr;
if (lib == NULL) {
fprintf(stderr, "-lib must be followed by a string denoting the CMUCL library path.\n");
fprintf(stderr,
"-lib must be followed by a string denoting the CMUCL library path.\n");
exit(1);
}
} else if (strcmp(arg, "-dynamic-space-size") == 0) {
......@@ -494,7 +497,8 @@ main(int argc, char *argv[], char *envp[])
}
#endif
if (dynamic_space_size > DYNAMIC_SPACE_SIZE) {
fprintf(stderr, "-dynamic-space-size must be no greater than %d MBytes.\n",
fprintf(stderr,
"-dynamic-space-size must be no greater than %d MBytes.\n",
DYNAMIC_SPACE_SIZE / (1024 * 1024));
exit(1);
}
......@@ -623,12 +627,14 @@ main(int argc, char *argv[], char *envp[])
core = argv[0];
}
#endif
globals_init();
#ifdef FEATURE_EXECUTABLE
if (builtin_image_flag != 0) {
extern int image_dynamic_space_size;
long allocation_pointer =
(long) dynamic_0_space + (int) &image_dynamic_space_size;
#if defined(i386) || defined(__x86_64)
SetSymbolValue(ALLOCATION_POINTER, (lispobj) allocation_pointer);
......
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.c,v 1.16 2007/07/07 17:25:10 fgilham Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.c,v 1.17 2007/07/08 06:58:39 fgilham Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -35,29 +35,29 @@ extern int version;
static long
write_bytes(FILE * file, char *addr, long bytes)
{
long count, here, data;
bytes = (bytes + CORE_PAGESIZE - 1) & ~(CORE_PAGESIZE - 1);
fflush(file);
here = ftell(file);
fseek(file, 0, 2);
data = (ftell(file) + CORE_PAGESIZE - 1) & ~(CORE_PAGESIZE - 1);
fseek(file, data, 0);
while (bytes > 0) {
count = fwrite(addr, 1, bytes, file);
if (count > 0) {
bytes -= count;
addr += count;
} else {
perror("Error writing to save file");
bytes = 0;
}
}
fflush(file);
fseek(file, here, 0);
return data / CORE_PAGESIZE - 1;
long count, here, data;
bytes = (bytes + CORE_PAGESIZE - 1) & ~(CORE_PAGESIZE - 1);
fflush(file);
here = ftell(file);
fseek(file, 0, 2);
data = (ftell(file) + CORE_PAGESIZE - 1) & ~(CORE_PAGESIZE - 1);
fseek(file, data, 0);
while (bytes > 0) {
count = fwrite(addr, 1, bytes, file);
if (count > 0) {
bytes -= count;
addr += count;
} else {
perror("Error writing to save file");
bytes = 0;
}
}
fflush(file);
fseek(file, here, 0);
return data / CORE_PAGESIZE - 1;
}
static void
......@@ -171,6 +171,7 @@ save(char *filename, lispobj init_function)
print_ptr((lispobj*) 0x2805a184);
#endif
#ifdef DEBUG_BAD_HEAP
/*
* For some reason x86 has a heap corruption problem. I (rtoy)
......@@ -228,6 +229,7 @@ save(char *filename, lispobj init_function)
exit(0);
}
#ifdef FEATURE_EXECUTABLE
boolean
save_executable(char *filename, lispobj init_function)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment