From: Chris Hanson Date: Tue, 7 Feb 1995 23:54:55 +0000 (+0000) Subject: Add more specific error messages to low-level message allocation code. X-Git-Tag: 20090517-FFI~6666 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8fbe075076699c64bbf6c86d7dc2fa2d961b013f;p=mit-scheme.git Add more specific error messages to low-level message allocation code. --- diff --git a/v7/src/microcode/os2msg.c b/v7/src/microcode/os2msg.c index 2ddf411cc..a1e809d95 100644 --- a/v7/src/microcode/os2msg.c +++ b/v7/src/microcode/os2msg.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2msg.c,v 1.4 1995/01/05 23:54:48 cph Exp $ +$Id: os2msg.c,v 1.5 1995/02/07 23:54:09 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -224,12 +224,41 @@ OS2_initialize_message_lengths (void) } } +void +OS2_check_message_length_initializations (void) +{ + unsigned int type = 0; + while (1) + { + if ((MESSAGE_LENGTH (type)) == 0) + { + char buffer [64]; + sprintf (buffer, "Message type %d not initialized.", type); + OS2_logic_error (buffer); + } + if (type == MSG_TYPE_MAX) + break; + type += 1; + } +} + msg_length_t OS2_message_type_length (msg_type_t type) { - msg_length_t length = (MESSAGE_LENGTH (type)); + msg_length_t length; + if (type > MSG_TYPE_MAX) + { + char buffer [64]; + sprintf (buffer, "Message type %d out of range.", type); + OS2_logic_error (buffer); + } + length = (MESSAGE_LENGTH (type)); if (length == 0) - OS2_logic_error ("Message type has unknown length."); + { + char buffer [64]; + sprintf (buffer, "Message type %d has unknown length.", type); + OS2_logic_error (buffer); + } return (length); } diff --git a/v7/src/microcode/os2top.c b/v7/src/microcode/os2top.c index 53435214d..37bf4cd4f 100644 --- a/v7/src/microcode/os2top.c +++ b/v7/src/microcode/os2top.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2top.c,v 1.10 1995/01/16 20:56:12 cph Exp $ +$Id: os2top.c,v 1.11 1995/02/07 23:54:55 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -51,6 +51,8 @@ extern void OS2_initialize_scheme_thread (void); extern void OS2_initialize_tty (void); extern void OS2_initialize_window_primitives (void); +extern void OS2_check_message_length_initializations (void); + extern const char * OS_Name; extern const char * OS_Variant; extern HMTX OS2_create_queue_lock; @@ -92,6 +94,9 @@ OS_initialize (void) OS2_initialize_tty (); OS2_initialize_window_primitives (); OS2_initialize_processes (); + /* This must be after all of initializations that can set message + lengths. */ + OS2_check_message_length_initializations (); OS_Name = "OS/2"; { const char * version = (OS2_version_string ());