X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fmf_common.h;h=115d6a815e0631f54893ec5091210435fcd3ff5d;hp=40ed1e29c4a616bf5919f2c52850b426823911f5;hb=ba39fbc2e0cee4681395df4079d9e61c27262132;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/menu/mf_common.h b/menu/mf_common.h index 40ed1e29..115d6a81 100644 --- a/menu/mf_common.h +++ b/menu/mf_common.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2004,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,9 +28,10 @@ /**************************************************************************** * Author: Juergen Pfeifer, 1995,1997 * - * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ +/* $Id: mf_common.h,v 0.23 2012/03/10 23:43:41 tom Exp $ */ + /* Common internal header for menu and form library */ #ifndef MF_COMMON_H_incl @@ -62,37 +63,32 @@ extern int errno; #if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else -#define MODULE_ID(id) /*nothing*/ +#define MODULE_ID(id) /*nothing */ #endif - /* Maximum regular 8-bit character code */ #define MAX_REGULAR_CHARACTER (0xff) #define SET_ERROR(code) (errno=(code)) -#define GET_ERROR() (errno) -#define RETURN(code) return( SET_ERROR(code) ) +#define GET_ERROR() (errno) + +#ifdef TRACE +#define RETURN(code) returnCode( SET_ERROR(code) ) +#else +#define RETURN(code) return( SET_ERROR(code) ) +#endif /* The few common values in the status fields for menus and forms */ -#define _POSTED (0x01) /* menu or form is posted */ -#define _IN_DRIVER (0x02) /* menu or form is processing hook routine */ +#define _POSTED (0x01U) /* menu or form is posted */ +#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */ /* Call object hook */ #define Call_Hook( object, handler ) \ - if ( (object) && ((object)->handler) )\ + if ( (object) != 0 && ((object)->handler) != (void *) 0 )\ {\ - (object)->status |= _IN_DRIVER;\ + (object)->status |= (unsigned short) (_IN_DRIVER);\ (object)->handler(object);\ - (object)->status &= ~_IN_DRIVER;\ + (object)->status &= (unsigned short) (~_IN_DRIVER);\ } -#define INLINE - -#ifndef TRACE -# if CC_HAS_INLINE_FUNCS -# undef INLINE -# define INLINE inline -# endif -#endif - #endif /* MF_COMMON_H_incl */