diff options
Diffstat (limited to 'engines/sci/tools/scipack.cpp')
-rw-r--r-- | engines/sci/tools/scipack.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/engines/sci/tools/scipack.cpp b/engines/sci/tools/scipack.cpp index a5b7a8d8a1..c3a8fcbe35 100644 --- a/engines/sci/tools/scipack.cpp +++ b/engines/sci/tools/scipack.cpp @@ -41,15 +41,13 @@ unsigned short *resource_ids = NULL; void -help() -{ +help() { printf("Usage:\n\tscipack <file_0> ... <file_n>\n" "\nBuilds an uncompressed SCI0 resource.000 and a resource.map\n"); } int /* Returns resource ID on success, -1 on error */ -test_file(char *filename) -{ +test_file(char *filename) { char *dot = strchr(filename, '.'); char *endptr; FILE *f; @@ -63,7 +61,7 @@ test_file(char *filename) *dot = 0; for (res_type = 0; res_type < sci_invalid_resource - && strcasecmp(filename, sci_resource_types[res_type]); res_type++); + && strcasecmp(filename, sci_resource_types[res_type]); res_type++); *dot = '.'; @@ -101,8 +99,7 @@ test_file(char *filename) } int -build_file_ids(int count, char **names) -{ +build_file_ids(int count, char **names) { int i; int error = 0; @@ -113,8 +110,7 @@ build_file_ids(int count, char **names) if (id < 0) { error = -1; fprintf(stderr, ": %s\n", names[i]); - } - else resource_ids[i] = id; + } else resource_ids[i] = id; } return error; @@ -122,21 +118,19 @@ build_file_ids(int count, char **names) static inline void -write_uint16(int fd, unsigned int uint) -{ +write_uint16(int fd, unsigned int uint) { unsigned char upper = (uint >> 8) & 0xff; unsigned char lower = (uint) & 0xff; - if ((write(fd, &upper, 1) < 1) - || (write(fd, &lower, 1) < 1)) { + if ((write(fd, &upper, 1) < 1) + || (write(fd, &lower, 1) < 1)) { perror("While writing"); exit(1); } } int -write_files(int count, char **names) -{ +write_files(int count, char **names) { int resource_000, resource_map; int i; @@ -196,10 +190,9 @@ write_files(int count, char **names) close(resource_map); } - + int -main(int argc, char **argv) -{ +main(int argc, char **argv) { printf("scipack.c Copyright (C) 2002 Christoph Reichenbach\n" "This program is FREE SOFTWARE. You may copy it and/or re-distribute it\n" "according to the terms of the GNU General Public License. See LICENSING\n" |