speed up qfo writing by about 12.5:1 (for large object files, anyway) by

making compression optional (compressed qfo files will still be handled
transparently)
This commit is contained in:
Bill Currie 2003-02-23 23:43:43 +00:00
parent 71a4ff6379
commit 44285ba5de
4 changed files with 8 additions and 1 deletions

View File

@ -66,6 +66,7 @@ typedef struct {
qboolean compile; // serparate compilation mode
qboolean partial_link; // partial linking
qboolean preprocess_only;// only run cpp, don't ocmpile
qboolean gzip; // compress qfo files when writing
int strip_path; // number of leading path elements to strip
// from source file names
const char *output_file;

View File

@ -52,6 +52,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "function.h"
#include "immediate.h"
#include "obj_file.h"
#include "options.h"
#include "qfcc.h"
#include "reloc.h"
#include "strpool.h"
@ -287,7 +288,7 @@ qfo_write (qfo_t *qfo, const char *filename)
qfo_header_t hdr;
QFile *file;
file = Qopen (filename, "wbz9");
file = Qopen (filename, options.gzip ? "wbz9" : "wb");
if (!file)
return -1;

View File

@ -105,6 +105,7 @@ static const char *short_options =
"U:" // undefine
"N:" // notice options
"M::"
"z" // compress qfo files
;
static void
@ -223,6 +224,9 @@ DecodeArgs (int argc, char **argv)
case 'r':
options.partial_link = true;
break;
case 'z':
options.gzip = true;
break;
case 'C':{ // code options
char *opts = strdup (optarg);
char *temp = strtok (opts, ",");

View File

@ -57,6 +57,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "qfcc.h"
#include "type.h"
options_t options;
int num_linenos;
pr_lineno_t *linenos;
pr_info_t pr;