From 642f09e99a2269b39ce8aacae2d9b68d3404945a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 25 Nov 2006 05:08:04 +0000 Subject: [PATCH] Eliminate win32 compiler warnings. --- v7/src/microcode/bignum.c | 4 ++-- v7/src/microcode/ntfs.c | 7 ++++--- v7/src/microcode/ntio.c | 5 ++++- v7/src/microcode/prosfs.c | 13 +++++++++---- v7/src/microcode/uxfs.c | 4 ++-- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/v7/src/microcode/bignum.c b/v7/src/microcode/bignum.c index dba1f6185..016b2a828 100644 --- a/v7/src/microcode/bignum.c +++ b/v7/src/microcode/bignum.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bignum.c,v 9.53 2006/09/16 11:19:09 gjr Exp $ +$Id: bignum.c,v 9.54 2006/11/25 05:07:41 cph Exp $ Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology Copyright 1992,1993,1994,1996,1997,2000 Massachusetts Institute of Technology @@ -591,7 +591,7 @@ DEFUN (double_to_bignum, (x), double x) } while (start < scan) { - if ((significand == 0) || (n_valid_bits <= 0)) + if ((significand == 0) || (n_valid_bits == 0)) { while (start < scan) (*--scan) = 0; diff --git a/v7/src/microcode/ntfs.c b/v7/src/microcode/ntfs.c index 3d9f6693d..8127ccb6b 100644 --- a/v7/src/microcode/ntfs.c +++ b/v7/src/microcode/ntfs.c @@ -1,8 +1,9 @@ /* -*-C-*- -$Id: ntfs.c,v 1.30 2003/02/14 18:28:20 cph Exp $ +$Id: ntfs.c,v 1.31 2006/11/25 05:07:47 cph Exp $ -Copyright (c) 1992-2001 Massachusetts Institute of Technology +Copyright 1993,1994,1995,1996,1997,1998 Massachusetts Institute of Technology +Copyright 1999,2000,2001,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -362,7 +363,7 @@ OS_file_touch (const char * filename) struct stat file_status; STD_VOID_UNIX_CALL (fstat, (fd, (&file_status))); if (((file_status . st_mode) & S_IFMT) != S_IFREG) - error_bad_range_arg (1); + return (-1); /* CASE 3: file length of 0 needs special treatment. */ if ((file_status . st_size) == 0) { diff --git a/v7/src/microcode/ntio.c b/v7/src/microcode/ntio.c index d630788ff..4e0414525 100644 --- a/v7/src/microcode/ntio.c +++ b/v7/src/microcode/ntio.c @@ -1,8 +1,9 @@ /* -*-C-*- -$Id: ntio.c,v 1.31 2003/09/26 13:34:10 cph Exp $ +$Id: ntio.c,v 1.32 2006/11/25 05:07:53 cph Exp $ Copyright 1993,1997,1998,2000,2001,2003 Massachusetts Institute of Technology +Copyright 2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -30,6 +31,8 @@ USA. #include "ntgui.h" #include "osterm.h" #include "osfile.h" +#include "osproc.h" +#include "ostty.h" #include "outf.h" #include "ossig.h" #include "intrpt.h" diff --git a/v7/src/microcode/prosfs.c b/v7/src/microcode/prosfs.c index e3ccebc1b..f27435243 100644 --- a/v7/src/microcode/prosfs.c +++ b/v7/src/microcode/prosfs.c @@ -1,8 +1,9 @@ /* -*-C-*- -$Id: prosfs.c,v 1.18 2003/02/14 18:28:23 cph Exp $ +$Id: prosfs.c,v 1.19 2006/11/25 05:07:58 cph Exp $ -Copyright (c) 1987-2001 Massachusetts Institute of Technology +Copyright 1990,1991,1992,1995,1999,2000 Massachusetts Institute of Technology +Copyright 2001,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -269,8 +270,12 @@ Return #F if the file existed and its time was modified.\n\ Otherwise the file did not exist and it was created.") { PRIMITIVE_HEADER (1); - PRIMITIVE_RETURN - (BOOLEAN_TO_OBJECT (OS_file_touch ((CONST char *) (STRING_ARG (1))))); + { + int rc = (OS_file_touch ((CONST char *) (STRING_ARG (1)))); + if (rc < 0) + error_bad_range_arg (1); + PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (rc)); + } } DEFINE_PRIMITIVE ("NEW-DIRECTORY-OPEN", Prim_new_directory_open, 1, 1, diff --git a/v7/src/microcode/uxfs.c b/v7/src/microcode/uxfs.c index 588294085..5ee00ce49 100644 --- a/v7/src/microcode/uxfs.c +++ b/v7/src/microcode/uxfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxfs.c,v 1.26 2006/11/22 18:13:49 cph Exp $ +$Id: uxfs.c,v 1.27 2006/11/25 05:08:04 cph Exp $ Copyright 1990,1991,1992,1995,1996,1997 Massachusetts Institute of Technology Copyright 1998,1999,2000,2001,2002,2006 Massachusetts Institute of Technology @@ -480,7 +480,7 @@ DEFUN (OS_file_touch, (filename), CONST char * filename) struct stat file_status; STD_VOID_SYSTEM_CALL (syscall_fstat, (UX_fstat (fd, (&file_status)))); if (((file_status . st_mode) & S_IFMT) != S_IFREG) - error_system_call (errno, syscall_open); + return (-1); /* CASE 3: file length of 0 needs special treatment. */ if ((file_status . st_size) == 0) { -- 2.25.1