[Scummvm-cvs-logs] SF.net SVN: scummvm:[44540] scummvm/trunk/tools

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Oct 2 16:44:52 CEST 2009


Revision: 44540
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44540&view=rev
Author:   fingolfin
Date:     2009-10-02 14:44:52 +0000 (Fri, 02 Oct 2009)

Log Message:
-----------
Release resources properly; fix code formatting

Modified Paths:
--------------
    scummvm/trunk/tools/convbdf.c
    scummvm/trunk/tools/skycpt/cptcompiler.cpp

Modified: scummvm/trunk/tools/convbdf.c
===================================================================
--- scummvm/trunk/tools/convbdf.c	2009-10-02 14:42:24 UTC (rev 44539)
+++ scummvm/trunk/tools/convbdf.c	2009-10-02 14:44:52 UTC (rev 44540)
@@ -141,8 +141,7 @@
 }
 
 void
-usage(void)
-{
+usage(void) {
 	char help[] = {
 	"Usage: convbdf [options] [input-files]\n"
 	"		convbdf [options] [-o output-file] [single-input-file]\n"
@@ -156,8 +155,7 @@
 }
 
 /* parse command line options*/
-void getopts(int *pac, char ***pav)
-{
+void getopts(int *pac, char ***pav) {
 	const char *p;
 	char **av;
 	int ac;
@@ -225,8 +223,7 @@
 }
 
 /* remove directory prefix and file suffix from full path*/
-char *basename(char *path)
-{
+char *basename(char *path) {
 	char *p, *b;
 	static char base[256];
 
@@ -246,8 +243,7 @@
 	return base;
 }
 
-int convbdf(char *path)
-{
+int convbdf(char *path) {
 	struct font* pf;
 	int ret = 0;
 
@@ -265,8 +261,7 @@
 	return ret;
 }
 
-int main(int ac, char *av[])
-{
+int main(int ac, char *av[]) {
 	int ret = 0;
 
 	++av; --ac;		/* skip av[0]*/
@@ -290,8 +285,7 @@
 }
 
 /* free font structure*/
-void free_font(struct font* pf)
-{
+void free_font(struct font* pf) {
 	if (!pf)
 		return;
 	free(pf->name);
@@ -303,8 +297,7 @@
 }
 
 /* build incore structure from .bdf file*/
-struct font* bdf_read_font(char *path)
-{
+struct font* bdf_read_font(char *path) {
 	FILE *fp;
 	struct font* pf;
 
@@ -340,8 +333,7 @@
 }
 
 /* read bdf font header information, return 0 on error*/
-int bdf_read_header(FILE *fp, struct font* pf)
-{
+int bdf_read_header(FILE *fp, struct font* pf) {
 	int encoding;
 	int nchars, maxwidth;
 	int firstchar = 65535;
@@ -476,8 +468,7 @@
 }
 
 /* read bdf font bitmaps, return 0 on error*/
-int bdf_read_bitmaps(FILE *fp, struct font* pf)
-{
+int bdf_read_bitmaps(FILE *fp, struct font* pf) {
 	long ofs = 0;
 	int maxwidth = 0;
 	int i, k, encoding, width;
@@ -675,8 +666,7 @@
 }
 
 /* read the next non-comment line, returns buf or NULL if EOF*/
-char *bdf_getline(FILE *fp, char *buf, int len)
-{
+char *bdf_getline(FILE *fp, char *buf, int len) {
 	int c;
 	char *b;
 
@@ -722,8 +712,7 @@
 }
 
 /* generate C source from in-core font*/
-int gen_c_source(struct font* pf, char *path)
-{
+int gen_c_source(struct font* pf, char *path) {
 	FILE *ofp;
 	int h, i;
 	int did_defaultchar = 0;
@@ -936,6 +925,7 @@
 	fprintf(ofp, "DEFINE_FONT(g_sysfont)\n");
 	fprintf(ofp, "#endif\n");
 	fprintf(ofp, "\n} // End of namespace Graphics\n");
+	fclose(ofp);
 
 	return 0;
 }

Modified: scummvm/trunk/tools/skycpt/cptcompiler.cpp
===================================================================
--- scummvm/trunk/tools/skycpt/cptcompiler.cpp	2009-10-02 14:42:24 UTC (rev 44539)
+++ scummvm/trunk/tools/skycpt/cptcompiler.cpp	2009-10-02 14:44:52 UTC (rev 44540)
@@ -524,6 +524,7 @@
 			fwrite(diff, 2, 2 * diffPos, debOutf);
 			printf("diff v0.0%03d: 2 * 2 * %d\n", gameVers[cnt], diffPos);
 		}
+		free(buf288);
 	} else {
 		printf("Creating CPT file with Dummy reset data @ %ld\n", ftell(debOutf));
 		uint16 resetFields16 = 4;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list