fnt2fon: janitorial IgnoredReturnValues.
Lionel Debroux
lionel_debroux at yahoo.fr
Fri Sep 14 07:09:26 CDT 2007
---
tools/fnt2fon.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/tools/fnt2fon.c b/tools/fnt2fon.c
index a4d307d..3d376f5 100644
--- a/tools/fnt2fon.c
+++ b/tools/fnt2fon.c
@@ -61,6 +61,66 @@ static BOOL fp_is_open = FALSE;
static FILE *fp = NULL;
static FILE *ofp = NULL;
+FILE *Fopen(const char *filename, const char *mode)
+{
+ FILE *file;
+
+ if ((file = fopen(filename, mode)) == NULL)
+ {
+ fprintf(stderr, "Cannot open %s\n",filename);
+ exit(1);
+ }
+
+ return file;
+}
+
+static void Fclose(FILE *file)
+{
+ if (fclose(file) != 0)
+ {
+ fprintf(stderr, "Cannot close file\n");
+ exit(1);
+ }
+}
+
+static void Fputc(int c, FILE *file)
+{
+ if (fputc(c, file) == EOF)
+ {
+ fprintf(stderr, "Cannot write to file\n");
+ exit(1);
+ }
+}
+
+static void Fread(void *ptr, size_t size, size_t n, FILE *file)
+{
+ size_t n2;
+
+ if (((n2 = fread(ptr, size, n, file)) < n) && ferror(fp))
+ {
+ fprintf(stderr, "Cannot read from file\n");
+ exit(1);
+ }
+}
+
+static void Fwrite(const void *ptr, size_t size, size_t n, FILE *file)
+{
+ if (fwrite(ptr, size, n, file) < n)
+ {
+ fprintf(stderr, "Cannot write to file\n");
+ exit(1);
+ }
+}
+
+static void Fseek(FILE *file, long offset, int whence)
+{
+ if (fseek(file, offset, whence) != 0)
+ {
+ fprintf(stderr, "Cannot seek in file\n");
+ exit(1);
+ }
+}
+
static void cleanup_files(void)
{
if (fp && fp_is_open) {
--
1.5.2.4
--------------060004060403030405040409--
More information about the wine-patches
mailing list