From: Chris Hanson Date: Fri, 12 Jan 2007 03:45:55 +0000 (+0000) Subject: Eliminate pointer signedness warnings. X-Git-Tag: 20090517-FFI~795 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=47f53691396cfad0932803b2156423f132fa07e7;p=mit-scheme.git Eliminate pointer signedness warnings. --- diff --git a/v7/src/microcode/bchmmg.c b/v7/src/microcode/bchmmg.c index 690419c86..7d3af3298 100644 --- a/v7/src/microcode/bchmmg.c +++ b/v7/src/microcode/bchmmg.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bchmmg.c,v 9.106 2007/01/05 21:19:25 cph Exp $ +$Id: bchmmg.c,v 9.107 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -3492,7 +3492,7 @@ DEFUN_VOID (statistics_names) for (cntr = 0, ptr = &all_gc_statistics[0], scan = (VECTOR_LOC (vector, 0)); cntr < len; cntr++, ptr++) - *scan++ = (char_pointer_to_string ((unsigned char *) ptr->name)); + *scan++ = (char_pointer_to_string (ptr->name)); return (vector); } @@ -3561,8 +3561,7 @@ DEFINE_PRIMITIVE ("BCHSCHEME-PARAMETERS-GET", Prim_bchscheme_get_params, 0, 0, 0 VECTOR_SET (vector, 2, (long_to_integer ((long) read_overlap))); VECTOR_SET (vector, 3, (long_to_integer ((long) write_overlap))); VECTOR_SET (vector, 4, (long_to_integer ((long) (GET_SLEEP_DELTA ())))); - VECTOR_SET (vector, 5, (char_pointer_to_string - ((unsigned char *) drone_file_name))); + VECTOR_SET (vector, 5, (char_pointer_to_string (drone_file_name))); PRIMITIVE_RETURN (vector); } diff --git a/v7/src/microcode/boot.c b/v7/src/microcode/boot.c index 7750906f7..402b75c52 100644 --- a/v7/src/microcode/boot.c +++ b/v7/src/microcode/boot.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: boot.c,v 9.121 2007/01/05 21:19:25 cph Exp $ +$Id: boot.c,v 9.122 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -213,7 +213,7 @@ DEFUN (names_to_vector, (length, names), unsigned int i; for (i = 0; (i < length); i += 1) { - VECTOR_SET (v, i, (char_pointer_to_symbol (names [i]))); + VECTOR_SET (v, i, (char_pointer_to_symbol ((char *) (names [i])))); } return (v); } @@ -409,7 +409,7 @@ DEFUN (Start_Scheme, (Start_Prim, File_Name), switch (Start_Prim) { case BOOT_FASLOAD: /* (SCODE-EVAL (BINARY-FASLOAD ) GLOBAL-ENV) */ - FName = (char_pointer_to_string ((unsigned char *) File_Name)); + FName = (char_pointer_to_string (File_Name)); prim = (make_primitive ("BINARY-FASLOAD", 1)); inner_arg = Free; *Free++ = prim; @@ -422,7 +422,7 @@ DEFUN (Start_Scheme, (Start_Prim, File_Name), break; case BOOT_LOAD_BAND: /* (LOAD-BAND ) */ - FName = (char_pointer_to_string ((unsigned char *) File_Name)); + FName = (char_pointer_to_string (File_Name)); prim = (make_primitive ("LOAD-BAND", 1)); inner_arg = Free; *Free++ = prim; @@ -442,7 +442,7 @@ DEFUN (Start_Scheme, (Start_Prim, File_Name), case BOOT_EXECUTE: /* (SCODE-EVAL (INITIALIZE-C-COMPILED-BLOCK ) GLOBAL-ENV) */ - FName = (char_pointer_to_string ((unsigned char *) File_Name)); + FName = (char_pointer_to_string (File_Name)); prim = (make_primitive ("INITIALIZE-C-COMPILED-BLOCK", 1)); inner_arg = Free; *Free++ = prim; @@ -603,8 +603,7 @@ DEFINE_PRIMITIVE ("MICROCODE-IDENTIFY", Prim_microcode_identify, 0, 0, 0) Result = (make_vector (IDENTITY_LENGTH, SHARP_F, true)); FAST_VECTOR_SET (Result, ID_RELEASE, SHARP_F); FAST_VECTOR_SET - (Result, ID_MICRO_VERSION, - (char_pointer_to_string ((unsigned char *) PACKAGE_VERSION))); + (Result, ID_MICRO_VERSION, (char_pointer_to_string (PACKAGE_VERSION))); FAST_VECTOR_SET (Result, ID_MICRO_MOD, SHARP_F); FAST_VECTOR_SET (Result, ID_PRINTER_WIDTH, (LONG_TO_UNSIGNED_FIXNUM (OS_tty_x_size ()))); @@ -617,15 +616,13 @@ DEFINE_PRIMITIVE ("MICROCODE-IDENTIFY", Prim_microcode_identify, 0, 0, 0) FAST_VECTOR_SET (Result, ID_FLONUM_EPSILON, (double_to_flonum ((double) DBL_EPSILON))); FAST_VECTOR_SET - (Result, ID_OS_NAME, (char_pointer_to_string ((unsigned char *) OS_Name))); + (Result, ID_OS_NAME, (char_pointer_to_string (OS_Name))); FAST_VECTOR_SET (Result, ID_OS_VARIANT, - (char_pointer_to_string ((unsigned char *) OS_Variant))); + (char_pointer_to_string (OS_Variant))); FAST_VECTOR_SET (Result, ID_STACK_TYPE, - (char_pointer_to_string - ((unsigned char *) STACK_TYPE_STRING))); + (char_pointer_to_string (STACK_TYPE_STRING))); FAST_VECTOR_SET (Result, ID_MACHINE_TYPE, - (char_pointer_to_string - ((unsigned char *) MACHINE_TYPE))); + (char_pointer_to_string (MACHINE_TYPE))); PRIMITIVE_RETURN (Result); } @@ -644,8 +641,7 @@ DEFINE_PRIMITIVE ("MICROCODE-SYSTEM-ERROR-NAMES", Prim_microcode_syserr_names, 0 DEFINE_PRIMITIVE ("MICROCODE-TABLES-FILENAME", Prim_microcode_tables_filename, 0, 0, 0) { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) option_utabmd_file)); + PRIMITIVE_RETURN (char_pointer_to_string (option_utabmd_file)); } DEFINE_PRIMITIVE ("MICROCODE-LIBRARY-PATH", Prim_microcode_library_path, 0, 0, 0) @@ -665,8 +661,7 @@ DEFINE_PRIMITIVE ("MICROCODE-LIBRARY-PATH", Prim_microcode_library_path, 0, 0, 0 (allocate_marked_vector (TC_VECTOR, (end - scan), 1)); SCHEME_OBJECT * scan_result = (VECTOR_LOC (result, 0)); while (scan < end) - (*scan_result++) = - (char_pointer_to_string ((unsigned char *) *scan++)); + (*scan_result++) = (char_pointer_to_string (*scan++)); PRIMITIVE_RETURN (result); } } @@ -680,7 +675,7 @@ DEFUN (argv_to_object, (argc, argv), int argc AND CONST char ** argv) CONST char ** end = (scan + argc); SCHEME_OBJECT * scan_result = (VECTOR_LOC (result, 0)); while (scan < end) - (*scan_result++) = (char_pointer_to_string ((unsigned char *) *scan++)); + (*scan_result++) = (char_pointer_to_string (*scan++)); return (result); } diff --git a/v7/src/microcode/comutl.c b/v7/src/microcode/comutl.c index ab4c31d7a..b8f6ab91d 100644 --- a/v7/src/microcode/comutl.c +++ b/v7/src/microcode/comutl.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: comutl.c,v 1.36 2007/01/05 21:19:25 cph Exp $ +$Id: comutl.c,v 1.37 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -145,7 +145,7 @@ DEFINE_PRIMITIVE ("UTILITY-INDEX->NAME", Prim_utility_index_to_name, 1, 1, if (result == ((char *) NULL)) PRIMITIVE_RETURN (SHARP_F); else - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) result)); + PRIMITIVE_RETURN (char_pointer_to_string (result)); } DEFINE_PRIMITIVE ("BUILTIN-INDEX->NAME", Prim_builtin_index_to_name, 1, 1, @@ -159,7 +159,7 @@ DEFINE_PRIMITIVE ("BUILTIN-INDEX->NAME", Prim_builtin_index_to_name, 1, 1, if (result == ((char *) NULL)) PRIMITIVE_RETURN (SHARP_F); else - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) result)); + PRIMITIVE_RETURN (char_pointer_to_string (result)); } /* This is only meaningful for the C back end. */ diff --git a/v7/src/microcode/extern.c b/v7/src/microcode/extern.c index 749f12fef..2a0c0773e 100644 --- a/v7/src/microcode/extern.c +++ b/v7/src/microcode/extern.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: extern.c,v 9.42 2007/01/05 21:19:25 cph Exp $ +$Id: extern.c,v 9.43 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -127,7 +127,7 @@ DEFINE_PRIMITIVE ("PRIMITIVE-PROCEDURE-DOCUMENTATION", PRIMITIVE_RETURN ((answer == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) answer))); + : (char_pointer_to_string (answer))); } } } @@ -155,9 +155,7 @@ DEFINE_PRIMITIVE ("GET-PRIMITIVE-NAME", Prim_get_primitive_name, 1, 1, fast long number = (PRIMITIVE_NUMBER (primitive)); if ((number < 0) || (number > (NUMBER_OF_PRIMITIVES ()))) error_bad_range_arg (1); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) - (PRIMITIVE_NAME (primitive)))); + PRIMITIVE_RETURN (char_pointer_to_string (PRIMITIVE_NAME (primitive))); } } } diff --git a/v7/src/microcode/extern.h b/v7/src/microcode/extern.h index 06f32db39..2a3555434 100644 --- a/v7/src/microcode/extern.h +++ b/v7/src/microcode/extern.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: extern.h,v 9.67 2007/01/05 21:19:25 cph Exp $ +$Id: extern.h,v 9.68 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -212,13 +212,11 @@ extern SCHEME_OBJECT EXFUN (allocate_marked_vector, (int, long, Boolean)); extern SCHEME_OBJECT EXFUN (make_vector, (long, SCHEME_OBJECT, Boolean)); extern SCHEME_OBJECT EXFUN (allocate_string, (unsigned long)); extern SCHEME_OBJECT EXFUN (allocate_string_no_gc, (unsigned long)); +extern SCHEME_OBJECT EXFUN (memory_to_string, (unsigned long, CONST void *)); extern SCHEME_OBJECT EXFUN - (memory_to_string, (unsigned long, CONST unsigned char *)); -extern SCHEME_OBJECT EXFUN - (memory_to_string_no_gc, (unsigned long, CONST unsigned char *)); -extern SCHEME_OBJECT EXFUN (char_pointer_to_string, (CONST unsigned char *)); -extern SCHEME_OBJECT EXFUN - (char_pointer_to_string_no_gc, (CONST unsigned char *)); + (memory_to_string_no_gc, (unsigned long, CONST void *)); +extern SCHEME_OBJECT EXFUN (char_pointer_to_string, (CONST char *)); +extern SCHEME_OBJECT EXFUN (char_pointer_to_string_no_gc, (CONST char *)); extern CONST char * EXFUN (arg_symbol, (int)); extern CONST char * EXFUN (arg_interned_symbol, (int)); extern SCHEME_OBJECT EXFUN (string_to_symbol, (SCHEME_OBJECT)); diff --git a/v7/src/microcode/fasload.c b/v7/src/microcode/fasload.c index 93c8949b3..963b7dbef 100644 --- a/v7/src/microcode/fasload.c +++ b/v7/src/microcode/fasload.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: fasload.c,v 9.98 2007/01/05 21:19:25 cph Exp $ +$Id: fasload.c,v 9.99 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -855,9 +855,9 @@ The result is a string, or #F if the system was not restored.") PRIMITIVE_HEADER (0); PRIMITIVE_RETURN ((reload_band_name != 0) - ? (char_pointer_to_string ((unsigned char *) reload_band_name)) + ? (char_pointer_to_string (reload_band_name)) : (option_band_file != 0) - ? (char_pointer_to_string ((unsigned char *) option_band_file)) + ? (char_pointer_to_string (option_band_file)) : SHARP_F); } diff --git a/v7/src/microcode/foreign.c b/v7/src/microcode/foreign.c index 3c31369a0..f7b116aea 100644 --- a/v7/src/microcode/foreign.c +++ b/v7/src/microcode/foreign.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: foreign.c,v 1.8 2007/01/05 21:19:25 cph Exp $ +$Id: foreign.c,v 1.9 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -297,7 +297,7 @@ DEFUN (foreign_pointer_to_scheme_object, (ptr_to_ptr, type), case FOREIGN_STRING: temp_ptr = ALIGN_FOREIGN_POINTER (*ptr_to_ptr, FOREIGN_STRING); *ptr_to_ptr = (((unsigned char *) temp_ptr) + 1); - return (char_pointer_to_string ((unsigned char *) temp_ptr; + return (char_pointer_to_string (temp_ptr)); case FOREIGN_PTR: temp_ptr = ALIGN_FOREIGN_POINTER (*ptr_to_ptr, FOREIGN_PTR); *ptr_to_ptr = (((PTR) temp_ptr) + 1); diff --git a/v7/src/microcode/intern.c b/v7/src/microcode/intern.c index c6c86c83d..79b1848db 100644 --- a/v7/src/microcode/intern.c +++ b/v7/src/microcode/intern.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: intern.c,v 9.65 2007/01/05 21:19:25 cph Exp $ +$Id: intern.c,v 9.66 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -46,7 +46,7 @@ DEFUN (string_hash, (length, string), unsigned long length AND CONST char * string) { - CONST unsigned char * scan = string; + CONST unsigned char * scan = ((unsigned char *) string); CONST unsigned char * end = (scan + length); unsigned int result = 0x811c9dc5; while (scan < end) @@ -81,14 +81,14 @@ CONST char * DEFUN (arg_symbol, (n), int n) { CHECK_ARG (n, SYMBOL_P); - return (STRING_LOC ((FAST_MEMORY_REF ((ARG_REF (n)), SYMBOL_NAME)), 0)); + return (STRING_POINTER (FAST_MEMORY_REF ((ARG_REF (n)), SYMBOL_NAME))); } CONST char * DEFUN (arg_interned_symbol, (n), int n) { CHECK_ARG (n, SYMBOL_P); - return (STRING_LOC ((FAST_MEMORY_REF ((ARG_REF (n)), SYMBOL_NAME)), 0)); + return (STRING_POINTER (FAST_MEMORY_REF ((ARG_REF (n)), SYMBOL_NAME))); } SCHEME_OBJECT @@ -139,7 +139,7 @@ DEFUN (string_to_symbol, (string), SCHEME_OBJECT string) { SCHEME_OBJECT * cell = (find_symbol_internal ((STRING_LENGTH (string)), - (STRING_LOC (string, 0)))); + (STRING_POINTER (string)))); return ((EMPTY_LIST_P (*cell)) ? (make_symbol (string, cell)) : (*cell)); } @@ -148,7 +148,7 @@ DEFUN (intern_symbol, (symbol), SCHEME_OBJECT symbol) { SCHEME_OBJECT name = (FAST_MEMORY_REF (symbol, SYMBOL_NAME)); SCHEME_OBJECT * cell - = (find_symbol_internal ((STRING_LENGTH (name)), (STRING_LOC (name, 0)))); + = (find_symbol_internal ((STRING_LENGTH (name)), (STRING_POINTER (name)))); if (!EMPTY_LIST_P (*cell)) return (*cell); else @@ -168,7 +168,7 @@ Returns the symbol whose name is STRING, or #F if no such symbol exists.") { SCHEME_OBJECT string = (ARG_REF (1)); PRIMITIVE_RETURN - (find_symbol ((STRING_LENGTH (string)), (STRING_LOC (string, 0)))); + (find_symbol ((STRING_LENGTH (string)), (STRING_POINTER (string)))); } } @@ -193,7 +193,7 @@ the reader in creating interned symbols.") SCHEME_OBJECT string = (ARG_REF (1)); PRIMITIVE_RETURN (LONG_TO_UNSIGNED_FIXNUM (string_hash ((STRING_LENGTH (string)), - (STRING_LOC (string, 0))))); + (STRING_POINTER (string))))); } } @@ -209,7 +209,7 @@ Equivalent to (MODULO (STRING-HASH STRING) DENOMINATOR).") PRIMITIVE_RETURN (LONG_TO_UNSIGNED_FIXNUM ((string_hash ((STRING_LENGTH (string)), - (STRING_LOC (string, 0)))) + (STRING_POINTER (string)))) % (arg_ulong_integer (2)))); } } diff --git a/v7/src/microcode/nttterm.c b/v7/src/microcode/nttterm.c index 0cad914e9..8ad23dffc 100644 --- a/v7/src/microcode/nttterm.c +++ b/v7/src/microcode/nttterm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: nttterm.c,v 1.8 2007/01/05 21:19:25 cph Exp $ +$Id: nttterm.c,v 1.9 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -63,7 +63,7 @@ DEFINE_PRIMITIVE ("TERMCAP-PARAM-STRING", Prim_termcap_param_string, 5, 5, 0) (arg_nonnegative_integer (3)), (arg_nonnegative_integer (4)), (arg_nonnegative_integer (5)))); - SCHEME_OBJECT result = (char_pointer_to_string ((unsigned char *) s)); + SCHEME_OBJECT result = (char_pointer_to_string (s)); free (s); PRIMITIVE_RETURN (result); } @@ -77,10 +77,9 @@ DEFINE_PRIMITIVE ("TERMCAP-GOTO-STRING", Prim_termcap_goto_string, 5, 5, 0) UP = (((ARG_REF (5)) == SHARP_F) ? 0 : (STRING_ARG (5))); PRIMITIVE_RETURN (char_pointer_to_string - ((unsigned char *) - (tgoto ((STRING_ARG (1)), - (arg_nonnegative_integer (2)), - (arg_nonnegative_integer (3)))))); + (tgoto ((STRING_ARG (1)), + (arg_nonnegative_integer (2)), + (arg_nonnegative_integer (3))))); } } diff --git a/v7/src/microcode/object.h b/v7/src/microcode/object.h index eefbf9a2c..6b762615f 100644 --- a/v7/src/microcode/object.h +++ b/v7/src/microcode/object.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: object.h,v 9.63 2007/01/05 21:19:25 cph Exp $ +$Id: object.h,v 9.64 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -337,6 +337,8 @@ extern SCHEME_OBJECT * memory_base; #define STRING_LOC(string, index) \ (((unsigned char *) (MEMORY_LOC (string, STRING_CHARS))) + (index)) +#define STRING_POINTER(s) ((char *) (MEMORY_LOC (s, STRING_CHARS))) + #define STRING_REF(string, index) \ ((int) (* (STRING_LOC ((string), (index))))) diff --git a/v7/src/microcode/os2xcpt.c b/v7/src/microcode/os2xcpt.c index 9459adc50..1d9cdf910 100644 --- a/v7/src/microcode/os2xcpt.c +++ b/v7/src/microcode/os2xcpt.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2xcpt.c,v 1.17 2007/01/05 21:19:25 cph Exp $ +$Id: os2xcpt.c,v 1.18 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -770,8 +770,7 @@ setup_trap_frame (PEXCEPTIONREPORTRECORD report, } { const char * name = (find_exception_name (report -> ExceptionNum)); - trap_name - = ((name == 0) ? SHARP_F : (char_pointer_to_string ((char *) name))); + trap_name = ((name == 0) ? SHARP_F : (char_pointer_to_string (name))); } /* Push the hardware-trap stack frame. The continuation parser will find this and use it to present meaningful debugging information diff --git a/v7/src/microcode/prgdbm.c b/v7/src/microcode/prgdbm.c index 6f1c1e9f0..fad6997ce 100644 --- a/v7/src/microcode/prgdbm.c +++ b/v7/src/microcode/prgdbm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prgdbm.c,v 1.8 2007/01/05 21:19:25 cph Exp $ +$Id: prgdbm.c,v 1.9 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -106,7 +106,7 @@ static struct allocation_table dbf_table; ((GDBM_FILE) (allocation_item_arg ((arg), (&dbf_table)))) #define GDBM_ERROR_VAL() \ - (char_pointer_to_string ((unsigned char *) (gdbm_strerror (gdbm_errno)))) + (char_pointer_to_string (gdbm_strerror (gdbm_errno))) #define VOID_GDBM_CALL(expression) \ (((expression) == 0) ? SHARP_F : (GDBM_ERROR_VAL ())) @@ -240,7 +240,7 @@ DEFINE_PRIMITIVE ("GDBM-SYNC", Prim_gdbm_sync, 1, 1, 0) DEFINE_PRIMITIVE ("GDBM-VERSION", Prim_gdbm_version, 0, 0, 0) { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) gdbm_version)); + PRIMITIVE_RETURN (char_pointer_to_string (gdbm_version)); } DEFINE_PRIMITIVE ("GDBM-SETOPT", Prim_gdbm_setopt, 3, 3, 0) diff --git a/v7/src/microcode/prims.h b/v7/src/microcode/prims.h index 99ff7b5b6..5565170d9 100644 --- a/v7/src/microcode/prims.h +++ b/v7/src/microcode/prims.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prims.h,v 9.54 2007/01/05 21:19:25 cph Exp $ +$Id: prims.h,v 9.55 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -105,7 +105,7 @@ extern long EXFUN (arg_ascii_integer, (int)); #define STRING_ARG(arg) \ ((STRING_P (ARG_REF (arg))) \ - ? ((char *) (STRING_LOC ((ARG_REF (arg)), 0))) \ + ? (STRING_POINTER (ARG_REF (arg))) \ : ((error_wrong_type_arg (arg)), ((char *) 0))) extern PTR EXFUN (arg_extended_string, (unsigned int, unsigned long *)); diff --git a/v7/src/microcode/prntenv.c b/v7/src/microcode/prntenv.c index 50c9fe477..103484204 100644 --- a/v7/src/microcode/prntenv.c +++ b/v7/src/microcode/prntenv.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prntenv.c,v 1.14 2007/01/05 21:19:25 cph Exp $ +$Id: prntenv.c,v 1.15 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -44,7 +44,7 @@ DEFINE_PRIMITIVE ("FILE-TIME->STRING", Prim_file_time_to_string, 1, 1, if (time_string == 0) PRIMITIVE_RETURN (SHARP_F); (time_string[24]) = '\0'; - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) time_string)); + PRIMITIVE_RETURN (char_pointer_to_string (time_string)); } } @@ -60,7 +60,7 @@ The result is either a string (the variable's value),\n\ PRIMITIVE_RETURN ((variable_value == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) variable_value))); + : (char_pointer_to_string (variable_value))); } } diff --git a/v7/src/microcode/pros2pm.c b/v7/src/microcode/pros2pm.c index eb2fa3862..d04d39554 100644 --- a/v7/src/microcode/pros2pm.c +++ b/v7/src/microcode/pros2pm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pros2pm.c,v 1.25 2007/01/05 21:19:25 cph Exp $ +$Id: pros2pm.c,v 1.26 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -773,7 +773,7 @@ DEFINE_PRIMITIVE ("OS2-CLIPBOARD-READ-TEXT", Prim_OS2_clipboard_read_text, 0, 0, result = SHARP_F; else { - result = (char_pointer_to_string ((unsigned char *) text)); + result = (char_pointer_to_string (text)); OS_free ((void *) text); } PRIMITIVE_RETURN (result); @@ -920,7 +920,7 @@ DEFINE_PRIMITIVE ("OS2WIN-FONT-DIALOG", Prim_OS2_window_font_dialog, 2, 2, 0) : (STRING_ARG (2))))); if (spec == 0) PRIMITIVE_RETURN (SHARP_F); - result = (char_pointer_to_string ((char *) spec)); + result = (char_pointer_to_string (spec)); OS_free ((void *) spec); PRIMITIVE_RETURN (result); } diff --git a/v7/src/microcode/prosenv.c b/v7/src/microcode/prosenv.c index 746c19435..89401d305 100644 --- a/v7/src/microcode/prosenv.c +++ b/v7/src/microcode/prosenv.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prosenv.c,v 1.21 2007/01/05 21:19:25 cph Exp $ +$Id: prosenv.c,v 1.22 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -208,8 +208,7 @@ DEFINE_PRIMITIVE ("WORKING-DIRECTORY-PATHNAME", Prim_working_dir_pathname, 0, 0, "Return the current working directory as a string.") { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (char_pointer_to_string - ((unsigned char *) OS_working_dir_pathname ())); + PRIMITIVE_RETURN (char_pointer_to_string (OS_working_dir_pathname ())); } DEFINE_PRIMITIVE ("SET-WORKING-DIRECTORY-PATHNAME!", Prim_set_working_dir_pathname, 1, 1, @@ -227,7 +226,6 @@ DEFINE_PRIMITIVE ("SYSTEM-CALL-ERROR-MESSAGE", Prim_system_call_error_message, 1 CONST char * message = (OS_error_code_to_message (arg_nonnegative_integer (1))); PRIMITIVE_RETURN - ((message == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) message))); + ((message == 0) ? SHARP_F : (char_pointer_to_string (message))); } } diff --git a/v7/src/microcode/prosfs.c b/v7/src/microcode/prosfs.c index 10c717253..f75cef77a 100644 --- a/v7/src/microcode/prosfs.c +++ b/v7/src/microcode/prosfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prosfs.c,v 1.21 2007/01/05 21:19:25 cph Exp $ +$Id: prosfs.c,v 1.22 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -45,7 +45,7 @@ extern void EXFUN (OS_file_copy, (CONST char *, CONST char *)); PRIMITIVE_RETURN \ ((result == 0) \ ? SHARP_F \ - : (char_pointer_to_string ((unsigned char *) result))); \ + : (char_pointer_to_string (result))); \ } DEFINE_PRIMITIVE ("FILE-EXISTS?", Prim_file_exists_p, 1, 1, diff --git a/v7/src/microcode/prosio.c b/v7/src/microcode/prosio.c index b56d476e6..ecd1816bf 100644 --- a/v7/src/microcode/prosio.c +++ b/v7/src/microcode/prosio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prosio.c,v 1.26 2007/01/05 21:19:25 cph Exp $ +$Id: prosio.c,v 1.27 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -146,8 +146,7 @@ DEFINE_PRIMITIVE ("CHANNEL-TYPE-NAME", Prim_channel_type_name, 1, 1, index = ((unsigned int) type); if (index >= ((sizeof (channel_type_names)) / (sizeof (char *)))) PRIMITIVE_RETURN (SHARP_F); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) (channel_type_names [index]))); + PRIMITIVE_RETURN (char_pointer_to_string (channel_type_names [index])); } DEFINE_PRIMITIVE ("CHANNEL-READ", Prim_channel_read, 4, 4, diff --git a/v7/src/microcode/prosproc.c b/v7/src/microcode/prosproc.c index 38cf4d8b3..84d93c7f6 100644 --- a/v7/src/microcode/prosproc.c +++ b/v7/src/microcode/prosproc.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prosproc.c,v 1.23 2007/01/05 21:19:25 cph Exp $ +$Id: prosproc.c,v 1.24 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -61,8 +61,7 @@ DEFINE_PRIMITIVE ("SCHEME-ENVIRONMENT", Prim_scheme_environment, 0, 0, 0) (allocate_marked_vector (TC_VECTOR, (end_environ - environ), 1)); SCHEME_OBJECT * scan_result = (VECTOR_LOC (result, 0)); while (scan_environ < end_environ) - (*scan_result++) = - (char_pointer_to_string ((unsigned char *) (*scan_environ++))); + (*scan_result++) = (char_pointer_to_string (*scan_environ++)); PRIMITIVE_RETURN (result); } } diff --git a/v7/src/microcode/prospty.c b/v7/src/microcode/prospty.c index 42c22f425..be32573b9 100644 --- a/v7/src/microcode/prospty.c +++ b/v7/src/microcode/prospty.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prospty.c,v 1.8 2007/01/05 21:19:25 cph Exp $ +$Id: prospty.c,v 1.9 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -57,10 +57,8 @@ Returns a vector #(CHANNEL MASTER-NAME SLAVE-NAME).") { SCHEME_OBJECT vector = (allocate_marked_vector (TC_VECTOR, 3, 1)); VECTOR_SET (vector, 0, (long_to_integer (channel))); - VECTOR_SET (vector, 1, - (char_pointer_to_string ((unsigned char *) master_name))); - VECTOR_SET (vector, 2, - (char_pointer_to_string ((unsigned char *) slave_name))); + VECTOR_SET (vector, 1, (char_pointer_to_string (master_name))); + VECTOR_SET (vector, 2, (char_pointer_to_string (slave_name))); transaction_commit (); PRIMITIVE_RETURN (vector); } diff --git a/v7/src/microcode/prostty.c b/v7/src/microcode/prostty.c index a367d6177..2963ca285 100644 --- a/v7/src/microcode/prostty.c +++ b/v7/src/microcode/prostty.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prostty.c,v 1.11 2007/01/05 21:19:25 cph Exp $ +$Id: prostty.c,v 1.12 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -66,16 +66,14 @@ DEFINE_PRIMITIVE ("TTY-COMMAND-BEEP", Prim_tty_command_beep, 0, 0, "Return a string that, when written to the display, will make it beep.") { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) (OS_tty_command_beep ()))); + PRIMITIVE_RETURN (char_pointer_to_string (OS_tty_command_beep ())); } DEFINE_PRIMITIVE ("TTY-COMMAND-CLEAR", Prim_tty_command_clear, 0, 0, "Return a string that, when written to the display, will clear it.") { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) (OS_tty_command_clear ()))); + PRIMITIVE_RETURN (char_pointer_to_string (OS_tty_command_clear ())); } DEFINE_PRIMITIVE ("TTY-NEXT-INTERRUPT-CHAR", Prim_tty_next_interrupt_char, 0, 0, diff --git a/v7/src/microcode/prpgsql.c b/v7/src/microcode/prpgsql.c index 13b3358fd..4f91bfd0c 100644 --- a/v7/src/microcode/prpgsql.c +++ b/v7/src/microcode/prpgsql.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prpgsql.c,v 1.11 2007/01/05 21:19:25 cph Exp $ +$Id: prpgsql.c,v 1.12 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -195,7 +195,7 @@ DEFINE_PRIMITIVE ("PQ-GET-LINE", Prim_pq_get_line, 2, 2, 0) CHECK_ARG (2, STRING_P); PRIMITIVE_RETURN (long_to_integer (PQgetline ((ARG_CONN (1)), - (STRING_LOC ((ARG_REF (2)), 0)), + (STRING_POINTER (ARG_REF (2))), (STRING_LENGTH (ARG_REF (2)))))); } @@ -205,7 +205,7 @@ DEFINE_PRIMITIVE ("PQ-PUT-LINE", Prim_pq_put_line, 2, 2, 0) CHECK_ARG (2, STRING_P); PRIMITIVE_RETURN (long_to_integer (PQputnbytes ((ARG_CONN (1)), - (STRING_LOC ((ARG_REF (2)), 0)), + (STRING_POINTER (ARG_REF (2))), (STRING_LENGTH (ARG_REF (2)))))); } @@ -218,7 +218,7 @@ DEFINE_PRIMITIVE ("PQ-ESCAPE-STRING", Prim_pq_escape_string, 2, 2, 0) CHECK_ARG (1, STRING_P); PRIMITIVE_RETURN (ulong_to_integer (PQescapeString ((STRING_ARG (2)), - (STRING_LOC ((ARG_REF (1)), 0)), + (STRING_POINTER (ARG_REF (1))), (STRING_LENGTH (ARG_REF (1)))))); } @@ -230,9 +230,9 @@ DEFINE_PRIMITIVE ("PQ-ESCAPE-BYTEA", Prim_pq_escape_bytea, 1, 1, 0) size_t escaped_length; unsigned char * escaped = (PQescapeBytea ((STRING_LOC ((ARG_REF (1)), 0)), - (STRING_LENGTH (ARG_REF (1))), - (&escaped_length))); - SCHEME_OBJECT s = (char_pointer_to_string (escaped)); + (STRING_LENGTH (ARG_REF (1))), + (&escaped_length))); + SCHEME_OBJECT s = (char_pointer_to_string ((char *) escaped)); PQfreemem (escaped); PRIMITIVE_RETURN (s); } @@ -244,7 +244,8 @@ DEFINE_PRIMITIVE ("PQ-UNESCAPE-BYTEA", Prim_pq_unescape_bytea, 1, 1, 0) { size_t unescaped_length; unsigned char * unescaped - = (PQunescapeBytea ((STRING_ARG (1)), (&unescaped_length))); + = (PQunescapeBytea (((unsigned char *) (STRING_ARG (1))), + (&unescaped_length))); if (unescaped == 0) error_bad_range_arg (1); { diff --git a/v7/src/microcode/pruxdld.c b/v7/src/microcode/pruxdld.c index a439af411..bb0c2f416 100644 --- a/v7/src/microcode/pruxdld.c +++ b/v7/src/microcode/pruxdld.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pruxdld.c,v 1.21 2007/01/05 21:19:25 cph Exp $ +$Id: pruxdld.c,v 1.22 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -113,6 +113,5 @@ a C char * pointer. Allocate and return a Scheme string with the same\n\ contents.") { PRIMITIVE_HEADER (1); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) (arg_ulong_integer (1)))); + PRIMITIVE_RETURN (char_pointer_to_string ((char *) (arg_ulong_integer (1)))); } diff --git a/v7/src/microcode/pruxenv.c b/v7/src/microcode/pruxenv.c index 44c50712d..85657cd50 100644 --- a/v7/src/microcode/pruxenv.c +++ b/v7/src/microcode/pruxenv.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pruxenv.c,v 1.24 2007/01/05 21:19:25 cph Exp $ +$Id: pruxenv.c,v 1.25 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -45,7 +45,7 @@ DEFINE_PRIMITIVE ("FILE-TIME->STRING", Prim_file_time_to_string, 1, 1, time_t clock = (arg_integer (1)); char * time_string = (UX_ctime (&clock)); (time_string[24]) = '\0'; - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) time_string)); + PRIMITIVE_RETURN (char_pointer_to_string (time_string)); } } @@ -58,8 +58,7 @@ If no such user is known, #F is returned.") { struct passwd * entry = (UX_getpwnam (STRING_ARG (1))); PRIMITIVE_RETURN - ((entry == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) (entry -> pw_dir)))); + ((entry == 0) ? SHARP_F : (char_pointer_to_string (entry -> pw_dir))); } } @@ -71,8 +70,7 @@ If the argument is not a known user ID, #F is returned.") { struct passwd * entry = (UX_getpwuid (arg_nonnegative_integer (1))); PRIMITIVE_RETURN - ((entry == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) (entry -> pw_name)))); + ((entry == 0) ? SHARP_F : (char_pointer_to_string (entry -> pw_name))); } } @@ -84,8 +82,7 @@ If the argument is not a known group ID, #F is returned.") { struct group * entry = (UX_getgrgid (arg_nonnegative_integer (1))); PRIMITIVE_RETURN - ((entry == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) (entry -> gr_name)))); + ((entry == 0) ? SHARP_F : (char_pointer_to_string (entry -> gr_name))); } } @@ -129,8 +126,7 @@ DEFINE_PRIMITIVE ("CURRENT-USER-NAME", Prim_current_user_name, 0, 0, { extern CONST char * EXFUN (OS_current_user_name, (void)); PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (char_pointer_to_string - ((unsigned char *) OS_current_user_name ())); + PRIMITIVE_RETURN (char_pointer_to_string (OS_current_user_name ())); } DEFINE_PRIMITIVE ("CURRENT-USER-HOME-DIRECTORY", Prim_current_user_home_directory, 0, 0, @@ -139,8 +135,7 @@ DEFINE_PRIMITIVE ("CURRENT-USER-HOME-DIRECTORY", Prim_current_user_home_director extern CONST char * EXFUN (OS_current_user_home_directory, (void)); PRIMITIVE_HEADER (0); PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) - OS_current_user_home_directory ())); + (char_pointer_to_string (OS_current_user_home_directory ())); } DEFINE_PRIMITIVE ("SYSTEM", Prim_system, 1, 1, @@ -163,7 +158,7 @@ The result is either a string (the variable's value),\n\ PRIMITIVE_RETURN ((variable_value == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) variable_value))); + : (char_pointer_to_string (variable_value))); } } @@ -191,11 +186,9 @@ DEFINE_PRIMITIVE ("FULL-HOSTNAME", Prim_full_hostname, 0, 0, PRIMITIVE_RETURN ((this_host_entry == 0) ? SHARP_F - : (char_pointer_to_string - ((unsigned char *) (this_host_entry -> h_name)))); + : (char_pointer_to_string (this_host_entry -> h_name))); #else - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) this_host_name)); + PRIMITIVE_RETURN (char_pointer_to_string (this_host_name)); #endif } } @@ -210,8 +203,7 @@ DEFINE_PRIMITIVE ("HOSTNAME", Prim_hostname, 0, 0, #ifdef HAVE_SOCKETS STD_VOID_SYSTEM_CALL (syscall_gethostname, UX_gethostname (this_host_name, HOSTNAMESIZE)); - PRIMITIVE_RETURN - (char_pointer_to_string ((unsigned char *) this_host_name)); + PRIMITIVE_RETURN (char_pointer_to_string (this_host_name)); #else strcpy (this_host_name, "unknown-host"); #endif diff --git a/v7/src/microcode/pruxfs.c b/v7/src/microcode/pruxfs.c index e7d92f9f9..7690d22a2 100644 --- a/v7/src/microcode/pruxfs.c +++ b/v7/src/microcode/pruxfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pruxfs.c,v 9.60 2007/01/05 21:19:25 cph Exp $ +$Id: pruxfs.c,v 9.61 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -169,9 +169,8 @@ DEFUN (file_attributes_internal, (s), struct stat * s) case S_IFLNK: VECTOR_SET (result, 0, (char_pointer_to_string - ((unsigned char *) - (OS_file_soft_link_p - ((CONST char *) (STRING_LOC ((ARG_REF (1)), 0))))))); + (OS_file_soft_link_p + ((CONST char *) (STRING_LOC ((ARG_REF (1)), 0)))))); break; #endif default: @@ -311,7 +310,6 @@ DEFINE_PRIMITIVE ("FILE-SYSTEM-TYPE", Prim_file_system_type, 1, 1, 0) { CONST char * result = (UX_file_system_type (STRING_ARG (1))); PRIMITIVE_RETURN - (char_pointer_to_string - ((unsigned char *) ((result == 0) ? "unknown" : result))); + (char_pointer_to_string ((result == 0) ? "unknown" : result)); } } diff --git a/v7/src/microcode/pruxsock.c b/v7/src/microcode/pruxsock.c index bd1f166d0..5afc02305 100644 --- a/v7/src/microcode/pruxsock.c +++ b/v7/src/microcode/pruxsock.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pruxsock.c,v 1.25 2007/01/05 21:19:25 cph Exp $ +$Id: pruxsock.c,v 1.26 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -165,8 +165,7 @@ DEFINE_PRIMITIVE ("GET-HOST-NAME", Prim_get_host_name, 0, 0, 0) if (host_name == 0) PRIMITIVE_RETURN (SHARP_F); { - SCHEME_OBJECT result - = (char_pointer_to_string ((unsigned char *) host_name)); + SCHEME_OBJECT result = (char_pointer_to_string (host_name)); OS_free ((PTR) host_name); PRIMITIVE_RETURN (result); } @@ -182,8 +181,7 @@ DEFINE_PRIMITIVE ("CANONICAL-HOST-NAME", Prim_canonical_host_name, 1, 1, 0) if (host_name == 0) PRIMITIVE_RETURN (SHARP_F); { - SCHEME_OBJECT result - = (char_pointer_to_string ((unsigned char *) host_name)); + SCHEME_OBJECT result = (char_pointer_to_string (host_name)); OS_free ((PTR) host_name); PRIMITIVE_RETURN (result); } @@ -199,8 +197,7 @@ DEFINE_PRIMITIVE ("GET-HOST-BY-ADDRESS", Prim_get_host_by_address, 1, 1, 0) if (host_name == 0) PRIMITIVE_RETURN (SHARP_F); { - SCHEME_OBJECT result - = (char_pointer_to_string ((unsigned char *) host_name)); + SCHEME_OBJECT result = (char_pointer_to_string (host_name)); OS_free ((PTR) host_name); PRIMITIVE_RETURN (result); } diff --git a/v7/src/microcode/string.c b/v7/src/microcode/string.c index a24dafba6..845bca5cb 100644 --- a/v7/src/microcode/string.c +++ b/v7/src/microcode/string.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: string.c,v 9.51 2007/01/05 21:19:25 cph Exp $ +$Id: string.c,v 9.52 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -66,34 +66,36 @@ DEFUN (allocate_string_no_gc, (nbytes), unsigned long nbytes) SCHEME_OBJECT DEFUN (memory_to_string, (nbytes, data), unsigned long nbytes AND - CONST unsigned char * data) + CONST void * data) { SCHEME_OBJECT result = (allocate_string (nbytes)); unsigned char * scan_result = (STRING_LOC (result, 0)); unsigned char * end_result = (scan_result + nbytes); + CONST unsigned char * scan_data = data; while (scan_result < end_result) - (*scan_result++) = (*data++); + (*scan_result++) = (*scan_data++); return (result); } SCHEME_OBJECT DEFUN (memory_to_string_no_gc, (nbytes, data), unsigned long nbytes AND - CONST unsigned char * data) + CONST void * data) { SCHEME_OBJECT result = (allocate_string_no_gc (nbytes)); unsigned char * scan_result = (STRING_LOC (result, 0)); unsigned char * end_result = (scan_result + nbytes); + CONST unsigned char * scan_data = data; while (scan_result < end_result) - (*scan_result++) = (*data++); + (*scan_result++) = (*scan_data++); return (result); } SCHEME_OBJECT DEFUN (char_pointer_to_string, (char_pointer), - CONST unsigned char * char_pointer) + CONST char * char_pointer) { - CONST unsigned char * scan = char_pointer; + CONST char * scan = char_pointer; if (scan == 0) scan += 1; else @@ -104,9 +106,9 @@ DEFUN (char_pointer_to_string, (char_pointer), SCHEME_OBJECT DEFUN (char_pointer_to_string_no_gc, (char_pointer), - CONST unsigned char * char_pointer) + CONST char * char_pointer) { - CONST unsigned char * scan = char_pointer; + CONST char * scan = char_pointer; if (scan == 0) scan += 1; else diff --git a/v7/src/microcode/sysprim.c b/v7/src/microcode/sysprim.c index cb697827d..44c0d63c8 100644 --- a/v7/src/microcode/sysprim.c +++ b/v7/src/microcode/sysprim.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: sysprim.c,v 9.53 2007/01/05 21:19:25 cph Exp $ +$Id: sysprim.c,v 9.54 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -167,7 +167,7 @@ DEFINE_PRIMITIVE ("GC-SPACE-STATUS", Prim_gc_space_status, 0, 0, 0) DEFINE_PRIMITIVE ("SCHEME-PROGRAM-NAME", Prim_scheme_program_name, 0, 0, 0) { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (char_pointer_to_string ((char *) (scheme_program_name))); + PRIMITIVE_RETURN (char_pointer_to_string (scheme_program_name)); } DEFINE_PRIMITIVE ("READ-BYTE-FROM-MEMORY", Prim_read_byte_from_memory, 1, 1, diff --git a/v7/src/microcode/tterm.c b/v7/src/microcode/tterm.c index 76ee63fe4..761be5061 100644 --- a/v7/src/microcode/tterm.c +++ b/v7/src/microcode/tterm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: tterm.c,v 1.19 2007/01/05 21:19:25 cph Exp $ +$Id: tterm.c,v 1.20 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -104,8 +104,7 @@ DEFINE_PRIMITIVE ("TERMCAP-GET-STRING", Prim_termcap_get_string, 1, 1, 0) { char * result = (tgetstr ((STRING_ARG (1)), (&tgetstr_pointer))); PRIMITIVE_RETURN - ((result == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) result))); + ((result == 0) ? SHARP_F : (char_pointer_to_string (result))); } } @@ -115,7 +114,7 @@ DEFINE_PRIMITIVE ("TERMCAP-PARAM-STRING", Prim_termcap_param_string, 5, 5, 0) { char s [4096]; #if defined(__netbsd__) - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) NULL)); + PRIMITIVE_RETURN (char_pointer_to_string (0)); #else (void) tparam ((STRING_ARG (1)), s, (sizeof (s)), @@ -123,7 +122,7 @@ DEFINE_PRIMITIVE ("TERMCAP-PARAM-STRING", Prim_termcap_param_string, 5, 5, 0) (arg_nonnegative_integer (3)), (arg_nonnegative_integer (4)), (arg_nonnegative_integer (5))); - PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) s)); + PRIMITIVE_RETURN (char_pointer_to_string (s)); #endif } } @@ -136,10 +135,9 @@ DEFINE_PRIMITIVE ("TERMCAP-GOTO-STRING", Prim_termcap_goto_string, 5, 5, 0) UP = (((ARG_REF (5)) == SHARP_F) ? 0 : (STRING_ARG (5))); PRIMITIVE_RETURN (char_pointer_to_string - ((unsigned char *) - (tgoto ((STRING_ARG (1)), - (arg_nonnegative_integer (2)), - (arg_nonnegative_integer (3)))))); + (tgoto ((STRING_ARG (1)), + (arg_nonnegative_integer (2)), + (arg_nonnegative_integer (3))))); } } diff --git a/v7/src/microcode/uxsock.c b/v7/src/microcode/uxsock.c index f0bc7b45b..0c8111f8a 100644 --- a/v7/src/microcode/uxsock.c +++ b/v7/src/microcode/uxsock.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxsock.c,v 1.34 2007/01/05 21:19:25 cph Exp $ +$Id: uxsock.c,v 1.35 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -307,7 +307,7 @@ DEFUN (OS_server_connection_accept, (channel, peer_host, peer_port), unsigned int * peer_port) { static struct sockaddr_in address; - int address_length = (sizeof (struct sockaddr_in)); + socklen_t address_length = (sizeof (struct sockaddr_in)); int s; while (1) { diff --git a/v7/src/microcode/uxtop.c b/v7/src/microcode/uxtop.c index cfb592ad7..ccdd90e9d 100644 --- a/v7/src/microcode/uxtop.c +++ b/v7/src/microcode/uxtop.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxtop.c,v 1.33 2007/01/05 21:19:25 cph Exp $ +$Id: uxtop.c,v 1.34 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -393,10 +393,10 @@ static char * syscall_names_table [] = }; void -OS_syscall_names (unsigned int * length, unsigned char *** names) +OS_syscall_names (unsigned int * length, char *** names) { (*length) = ((sizeof (syscall_names_table)) / (sizeof (char *))); - (*names) = ((unsigned char **) syscall_names_table); + (*names) = syscall_names_table; } static char * syserr_names_table [] = @@ -443,8 +443,8 @@ static char * syserr_names_table [] = }; void -OS_syserr_names (unsigned int * length, unsigned char *** names) +OS_syserr_names (unsigned int * length, char *** names) { (*length) = ((sizeof (syserr_names_table)) / (sizeof (char *))); - (*names) = ((unsigned char **) syserr_names_table); + (*names) = syserr_names_table; } diff --git a/v7/src/microcode/uxtrap.c b/v7/src/microcode/uxtrap.c index 9ac50c214..08ac51cbd 100644 --- a/v7/src/microcode/uxtrap.c +++ b/v7/src/microcode/uxtrap.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxtrap.c,v 1.44 2007/01/05 21:19:25 cph Exp $ +$Id: uxtrap.c,v 1.45 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -188,7 +188,7 @@ SCHEME_OBJECT DEFUN (find_ccblock, (pc), unsigned long pc) { SCHEME_OBJECT * block_addr; - int index; + unsigned int index; block_addr = 0; classify_pc (pc, (&block_addr), (&index)); @@ -358,7 +358,7 @@ DEFUN (continue_from_trap, (signo, info, scp), unsigned long pc = (SIGCONTEXT_PC (scp)); SCHEME_OBJECT primitive = (Registers[REGBLOCK_PRIMITIVE]); SCHEME_OBJECT * block_addr; - int index; + unsigned int index; SCHEME_OBJECT * new_sp = 0; struct trap_recovery_info recovery_info; @@ -391,7 +391,7 @@ DEFUN (continue_from_trap, (signo, info, scp), new_sp = sp_register; SET_RECOVERY_INFO (STATE_UTILITY, - (LONG_TO_UNSIGNED_FIXNUM (index)), + (ULONG_TO_FIXNUM (index)), UNSPECIFIC); break; @@ -400,7 +400,7 @@ DEFUN (continue_from_trap, (signo, info, scp), Free = ((SCHEME_OBJECT *) (SIGCONTEXT_RFREE (scp))); SET_RECOVERY_INFO (STATE_BUILTIN, - (LONG_TO_UNSIGNED_FIXNUM (index)), + (ULONG_TO_FIXNUM (index)), UNSPECIFIC); break; @@ -628,7 +628,7 @@ DEFUN (setup_trap_frame, (signo, info, scp, trinfo, new_stack_pointer), signal_name = ((signo != 0) - ? (char_pointer_to_string ((unsigned char *) (find_signal_name (signo)))) + ? (char_pointer_to_string (find_signal_name (signo))) : SHARP_F); if (Free > MemTop) @@ -725,9 +725,7 @@ DEFUN (find_signal_code_name, (signo, info, scp), } return (cons ((ulong_to_integer (code)), - ((name == 0) - ? SHARP_F - : (char_pointer_to_string ((unsigned char *) name))))); + ((name == 0) ? SHARP_F : (char_pointer_to_string (name))))); } static enum pc_location diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index d5ec22ce1..7dbab00b7 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: x11base.c,v 1.90 2007/01/05 21:19:25 cph Exp $ +$Id: x11base.c,v 1.91 2007/01/12 03:45:55 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -1892,8 +1892,7 @@ DEFINE_PRIMITIVE ("X-DISPLAY-GET-DEFAULT", Prim_x_display_get_default, 3, 3, 0) (XGetDefault ((XD_DISPLAY (x_display_arg (1))), (STRING_ARG (2)), (STRING_ARG (3)))); PRIMITIVE_RETURN - ((result == 0) ? SHARP_F - : (char_pointer_to_string ((unsigned char *) result))); + ((result == 0) ? SHARP_F : (char_pointer_to_string (result))); } } @@ -2525,8 +2524,7 @@ DEFINE_PRIMITIVE ("X-LIST-FONTS", Prim_x_list_fonts, 3, 3, (allocate_marked_vector (TC_VECTOR, actual_count, false)); unsigned int i; for (i = 0; (i < actual_count); i += 1) - VECTOR_SET (result, i, - (char_pointer_to_string ((unsigned char *) (names[i])))); + VECTOR_SET (result, i, (char_pointer_to_string (names[i]))); XFreeFontNames (names); PRIMITIVE_RETURN (result); } @@ -2555,7 +2553,7 @@ DEFINE_PRIMITIVE ("X-GET-ATOM-NAME", Prim_x_get_atom_name, 2, 2, 0) unsigned char error_code = (x_error_code (display)); SCHEME_OBJECT result = ((error_code == 0) - ? (char_pointer_to_string ((unsigned char *) name)) + ? (char_pointer_to_string (name)) : (ulong_to_integer (error_code))); if (name != 0) XFree (name);