Replaced Boolean with standard bool wherever possible

This commit is contained in:
tpaviot
2011-08-18 09:41:15 +02:00
parent cd3d06d3ad
commit e40cbca927
21 changed files with 178 additions and 176 deletions
+6 -6
View File
@@ -4,15 +4,15 @@ extern int exppp_continuation_indent; /* default nesting indent for */
extern int exppp_linelength; /* leave some slop for closing */
/* parens. \n is not included in */
/* this count either */
extern int exppp_rmpp; /* if true, create rmpp */
extern int exppp_alphabetize; /* if true, alphabetize */
extern int exppp_terse; /* don't describe action to stdout */
extern int exppp_reference_info; /* if true, add commentary */
extern bool exppp_rmpp; /* if true, create rmpp */
extern bool exppp_alphabetize; /* if true, alphabetize */
extern bool exppp_terse; /* don't describe action to stdout */
extern bool exppp_reference_info; /* if true, add commentary */
/* about where things came from */
extern int exppp_preserve_comments; /* if true, preserve comments where */
extern bool exppp_preserve_comments; /* if true, preserve comments where */
/* possible */
extern char * exppp_output_filename; /* force output filename */
extern int exppp_output_filename_reset; /* if true, force output filename */
extern bool exppp_output_filename_reset; /* if true, force output filename */
void EXPRESSout( Express e );
+2 -1
View File
@@ -78,7 +78,8 @@
/* type Boolean and constants */
/******************************/
typedef enum Boolean_ { False, True} Boolean;
#include <stdbool.h>
/************************/
/* Generic pointer type */
+6 -6
View File
@@ -100,7 +100,7 @@ struct Entity_ {
Linked_List instances; /* hook for applications */
int mark; /* usual hack - prevent traversing sub/super */
/* graph twice */
Boolean abstract;/* is this an abstract supertype? */
bool abstract;/* is this an abstract supertype? */
Type type; /* type pointing back to ourself */
/* Useful to have when evaluating */
/* expressions involving entities */
@@ -164,20 +164,20 @@ extern struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
extern Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
extern Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
extern Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
extern Boolean ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
extern Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
extern Boolean ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern void ENTITYadd_instance PROTO( ( Entity, Generic ) );
extern int ENTITYget_initial_offset PROTO( ( Entity ) );
extern int ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
extern bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
#if 0
extern void ENTITYdelete_instance PROTO( ( Entity, Generic ) );
extern Boolean ENTITYhas_subtype PROTO( ( Entity, Entity ) );
extern bool ENTITYhas_subtype PROTO( ( Entity, Entity ) );
extern Entity ENTITYget_supertype PROTO( ( Entity, String ) );
extern Entity ENTITYget_subtype PROTO( ( Entity, String ) );
extern Boolean ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
extern bool ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
extern Expression ENTITYget_subtype_expression PROTO( ( Entity ) );
extern int ENTITYget_attribute_offset PROTO( ( Entity, Variable ) );
extern int ENTITYget_named_attribute_offset PROTO( ( Entity, String ) );
+8 -8
View File
@@ -64,7 +64,7 @@ typedef enum {
/***************************/
typedef struct Error_ {
Boolean enabled;
bool enabled;
Severity severity;
char * message;
} * Error;
@@ -88,11 +88,11 @@ typedef struct Error_Warning_ {
#include "decstart.h"
#endif /* ERROR_C */
GLOBAL Boolean __ERROR_buffer_errors INITIALLY( False );
GLOBAL bool __ERROR_buffer_errors INITIALLY( false );
GLOBAL char * current_filename INITIALLY( "stdin" );
/* flag to remember whether non-warning errors have occurred */
GLOBAL Boolean ERRORoccurred INITIALLY( False );
GLOBAL bool ERRORoccurred INITIALLY( false );
GLOBAL Error experrc INITIALLY( ERROR_none );
@@ -132,7 +132,7 @@ static_inline
void
ERRORdisable( Error error ) {
if( error != ERROR_none ) {
error->enabled = False;
error->enabled = false;
}
}
@@ -140,19 +140,19 @@ static_inline
void
ERRORenable( Error error ) {
if( error != ERROR_none ) {
error->enabled = True;
error->enabled = true;
}
}
static_inline
Boolean
bool
ERRORis_enabled( Error error ) {
return error->enabled;
}
static_inline
void
ERRORbuffer_messages( Boolean flag ) {
ERRORbuffer_messages( bool flag ) {
extern void ERROR_start_message_buffer( void ),
ERROR_flush_message_buffer( void );
@@ -193,7 +193,7 @@ extern void ERRORreport PROTO( ( Error, ... ) );
struct Symbol_; /* mention Symbol to avoid warning on following line */
extern void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
extern void ERRORreport_with_line PROTO( ( Error, int, ... ) );
extern void ERRORbuffer_messages PROTO( ( Boolean ) );
extern void ERRORbuffer_messages PROTO( ( bool ) );
extern void ERRORflush_messages PROTO( ( void ) );
extern void ERROR_start_message_buffer PROTO( ( void ) );
+1 -1
View File
@@ -149,7 +149,7 @@ union expr_union {
char * attribute; /* inverse .... for 'attr' */
char * binary;
int logical;
Boolean boolean;
bool boolean;
struct Query_ * query;
struct Funcall funcall;
+1 -1
View File
@@ -109,7 +109,7 @@ GLOBAL void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL char * EXPRESSprogram_name;
extern char EXPRESSgetopt_options[]; /* initialized elsewhere */
GLOBAL int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
GLOBAL int EXPRESSignore_duplicate_schemas INITIALLY( False );
GLOBAL bool EXPRESSignore_duplicate_schemas INITIALLY( false );
GLOBAL Dictionary EXPRESSbuiltins; /* procedures/functions */
+3 -3
View File
@@ -60,7 +60,7 @@ typedef struct Scan_Buffer {
char * savedPos;
FILE * file;
char * filename;
Boolean readEof;
bool readEof;
int lineno;
int bol;
} Scan_Buffer;
@@ -124,7 +124,7 @@ extern int SCANprocess_string PROTO( ( void ) );
extern int SCANprocess_encoded_string PROTO( ( void ) );
extern int SCANprocess_semicolon PROTO( ( int ) );
extern void SCANsave_comment PROTO( ( void ) );
extern Boolean SCANread PROTO( ( void ) );
extern bool SCANread PROTO( ( void ) );
#if macros_bit_the_dust
extern void SCANdefine_macro PROTO( ( char *, char * ) );
#endif
@@ -143,7 +143,7 @@ extern long SCANtell PROTO( ( void ) );
static_inline
int
SCANnextchar( char * buffer ) {
extern Boolean SCANread( void );
extern bool SCANread( void );
#ifdef keep_nul
static int escaped = 0;
#endif
+4 -4
View File
@@ -161,15 +161,15 @@ extern int LISTget_length PROTO( ( Linked_List ) );
#if supports_inline_functions || defined(LINKED_LIST_C)
static_inline
Boolean
bool
LISTempty( Linked_List list ) {
if( !list ) {
return True;
return true;
}
if( list->mark->next == list->mark ) {
return True;
return true;
}
return False;
return false;
}
#endif /* supports_inline_functions || defined(LINKED_LIST_C) */
+3 -3
View File
@@ -353,7 +353,7 @@ extern void TYPEinitialize PROTO( ( void ) );
#if 0
extern Dictionary TYPEget_enum_tags PROTO( ( Type ) );
#endif
extern Boolean TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
extern Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
@@ -361,9 +361,9 @@ extern Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * )
#if 0
extern int TYPEget_size PROTO( ( Type ) );
extern Boolean TYPEcompatible PROTO( ( Type, Type ) );
extern bool TYPEcompatible PROTO( ( Type, Type ) );
extern Expression SZD_TYPEget_precision PROTO( ( Sized_Type ) );
extern Boolean SZD_TYPEget_varying PROTO( ( Sized_Type ) );
extern bool SZD_TYPEget_varying PROTO( ( Sized_Type ) );
extern Expression TYPE_REFget_full_name PROTO( ( Type_Reference * ) );
#endif /*0*/
+2 -2
View File
@@ -31,9 +31,9 @@ exppp_usage() {
int Handle_Exppp_Args( int i, char * arg ) {
if( ( ( char )i == 'a' ) || ( ( char )i == 'A' ) ) {
exppp_alphabetize = True;
exppp_alphabetize = true;
} else {
exppp_alphabetize = False;
exppp_alphabetize = false;
}
return 0;
}
+51 -50
View File
@@ -4,6 +4,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdbool.h>
#ifdef __STDC__
#include <stdarg.h>
@@ -11,7 +12,7 @@
#include <varargs.h>
#endif
int exppp_output_filename_reset; /* if true, force output filename */
bool exppp_output_filename_reset; /* if true, force output filename */
/* DAR - moved this from .h file - not sure why was there. */
#include "../express/expbasic.h"
@@ -81,16 +82,16 @@ char * expheader[] = {
0
};
int exppp_alphabetize = False;
bool exppp_alphabetize = false;
int exppp_terse = False;
bool exppp_terse = false;
int exppp_reference_info = False; /* if true, add commentary */
bool exppp_reference_info = false; /* if true, add commentary */
/* about where things came from */
int exppp_preserve_comments = False;
bool exppp_preserve_comments = false;
int exppp_rmpp = True;
bool exppp_rmpp = true;
char rmfilename[] = "rmpp";
FILE * rm;
@@ -232,12 +233,12 @@ va_dcl {
void
exppp_init() {
static int first_time = True;
static bool first_time = true;
if( !first_time ) {
return;
}
first_time = False;
first_time = false;
ERROR_select_empty = ERRORcreate(
"select type %s has no members", SEVERITY_ERROR );
@@ -290,12 +291,12 @@ exppp_ref_info( Symbol * s ) {
/* normally all non-schema objects start out by printing a newline */
/* however, this is undesirable when printing out single objects */
/* use this variable to avoid it */
static int first_line = True; /* if first line */
static bool first_line = true; /* if first line */
static void
first_newline() {
if( first_line ) {
first_line = False;
first_line = false;
} else {
raw( "\n" );
}
@@ -309,7 +310,7 @@ SCHEMAout( Schema s ) {
FILE * f;
int level = 0;
char ** hp;
int described = False;
bool described = false;
if( exppp_output_filename_reset ) {
exppp_output_filename = 0;
@@ -321,7 +322,7 @@ SCHEMAout( Schema s ) {
/* when there is only a single file, allow user to find */
/* out what it is */
exppp_output_filename = filename;
exppp_output_filename_reset = True;
exppp_output_filename_reset = true;
/* since we have to generate a filename, make sure we don't */
/* overwrite a valuable file */
@@ -342,7 +343,7 @@ SCHEMAout( Schema s ) {
strcat( filename, ".pp" );
fprintf( stderr, "%s: writing schema file %s instead\n",
EXPRESSprogram_name, filename );
described = True;
described = true;
}
}
fclose( f );
@@ -369,7 +370,7 @@ SCHEMAout( Schema s ) {
/* first_newline();*/
/* raw("SCHEMA %s;\n",s->symbol.name);*/
first_line = False;
first_line = false;
raw( "\nSCHEMA %s;\n", s->symbol.name );
if( s->u.schema->usedict || s->u.schema->use_schemas
@@ -429,7 +430,7 @@ REFout( Dictionary refdict, Linked_List reflist, char * type, int level ) {
indent2 = level + exppp_continuation_indent;
DICTdo_init( dict, &de );
while( 0 != ( list = ( Linked_List )DICTdo( &de ) ) ) {
int first_time = True;
int first_time = true;
LISTdo( list, r, struct Rename * )
if( first_time ) {
raw( "%s FROM %s\n", type, r->schema->symbol.name );
@@ -440,7 +441,7 @@ REFout( Dictionary refdict, Linked_List reflist, char * type, int level ) {
if( first_time ) {
raw( "%*s(", level, "" );
first_time = False;
first_time = false;
} else {
raw( "%*s ", level, "" );
}
@@ -486,7 +487,7 @@ SCOPErules_out( Scope s, int level ) {
Rule r;
DictionaryEntry de;
if( exppp_alphabetize == False ) {
if( exppp_alphabetize == false ) {
DICTdo_type_init( s->symbol_table, &de, OBJ_RULE );
while( 0 != ( r = ( Rule )DICTdo( &de ) ) ) {
RULE_out( r, level );
@@ -514,7 +515,7 @@ SCOPEfuncs_out( Scope s, int level ) {
Function f;
DictionaryEntry de;
if( exppp_alphabetize == False ) {
if( exppp_alphabetize == false ) {
DICTdo_type_init( s->symbol_table, &de, OBJ_FUNCTION );
while( 0 != ( f = ( Function )DICTdo( &de ) ) ) {
FUNC_out( f, level );
@@ -542,7 +543,7 @@ SCOPEprocs_out( Scope s, int level ) {
Procedure p;
DictionaryEntry de;
if( exppp_alphabetize == False ) {
if( exppp_alphabetize == false ) {
DICTdo_type_init( s->symbol_table, &de, OBJ_PROCEDURE );
while( 0 != ( p = ( Procedure )DICTdo( &de ) ) ) {
PROC_out( p, level );
@@ -625,7 +626,7 @@ RULE_out( Rule r, int level ) {
first_newline();
exppp_ref_info( &r->symbol );
if( exppp_preserve_comments == False ) {
if( exppp_preserve_comments == false ) {
raw( "%*sRULE %s FOR (", level, "", r->symbol.name );
LISTdo( r->u.rule->parameters, p, Variable )
@@ -686,7 +687,7 @@ FUNC_out( Function fn, int level ) {
first_newline();
exppp_ref_info( &fn->symbol );
if( exppp_preserve_comments == False ) {
if( exppp_preserve_comments == false ) {
raw( "%*sFUNCTION %s", level, "", fn->symbol.name );
if( fn->u.func->parameters ) {
@@ -719,7 +720,7 @@ PROC_out( Procedure p, int level ) {
first_newline();
exppp_ref_info( &p->symbol );
if( exppp_preserve_comments == False ) {
if( exppp_preserve_comments == false ) {
raw( "%*sPROCEDURE %s(\n", level, "", p->symbol.name );
ALGargs_out( p->u.proc->parameters, level + strlen( "PROCEDURE " ) );
@@ -945,7 +946,7 @@ CASEout( struct Case_Statement_ *c, int level ) {
void
STMT_out( Statement s, int level ) {
int first_time = True;
bool first_time = true;
if( !s ) { /* null statement */
raw( "%*s;\n", level, "" );
@@ -988,7 +989,7 @@ STMT_out( Statement s, int level ) {
raw( "%*s%s(", level, "", s->symbol.name );
LISTdo( s->u.proc->parameters, p, Expression )
if( first_time ) {
first_time = False;
first_time = false;
} else {
raw( "," );
}
@@ -1034,7 +1035,7 @@ SCOPEentities_out( Scope s, int level ) {
Entity e;
DictionaryEntry de;
if( exppp_alphabetize == False ) {
if( exppp_alphabetize == false ) {
DICTdo_type_init( s->symbol_table, &de, OBJ_ENTITY );
while( 0 != ( e = ( Entity )DICTdo( &de ) ) ) {
ENTITY_out( e, level );
@@ -1076,7 +1077,7 @@ SUBTYPEout( Expression e ) {
void
ENTITY_out( Entity e, int level ) {
int first_time = True;
bool first_time = true;
first_newline();
exppp_ref_info( &e->symbol );
@@ -1105,7 +1106,7 @@ ENTITY_out( Entity e, int level ) {
LISTdo( e->u.entity->supertype_symbols, s, Symbol * )
if( first_time ) {
first_time = False;
first_time = false;
} else {
raw( ", " );
}
@@ -1334,7 +1335,7 @@ SCOPEtypes_out( Scope s, int level ) {
DictionaryEntry de;
Type t;
if( exppp_alphabetize == False ) {
if( exppp_alphabetize == false ) {
DICTdo_type_init( s->symbol_table, &de, OBJ_TYPE );
while( 0 != ( t = ( Type )DICTdo( &de ) ) ) {
TYPE_out( t, level );
@@ -1397,7 +1398,7 @@ void TYPEunique_or_optional_out( TypeBody tb ) {
void
TYPE_body_out( Type t, int level ) {
int first_time = True;
bool first_time = true;
Expression expr;
DictionaryEntry de;
@@ -1507,7 +1508,7 @@ TYPE_body_out( Type t, int level ) {
/* start new enum item */
if( first_time ) {
raw( "%*s(", level, "" );
first_time = False;
first_time = false;
} else {
raw( "%*s ", level, "" );
}
@@ -1549,7 +1550,7 @@ TYPE_body_out( Type t, int level ) {
/* start new entity */
if( first_time ) {
raw( "%*s(", level, "" );
first_time = False;
first_time = false;
} else {
raw( "%*s ", level, "" );
}
@@ -1968,18 +1969,18 @@ EXPRlength( Expression e ) {
#define BIGBUFSIZ 100000
static int old_curpos;
static int old_lineno;
static int string_func_in_use = False;
static int file_func_in_use = False;
static bool string_func_in_use = false;
static bool file_func_in_use = false;
/* return 0 if successful */
static int
/* return false if successful */
static bool
prep_buffer( char * buf, int len ) {
/* this should never happen */
if( string_func_in_use ) {
fprintf( stderr, "cannot generate EXPRESS string representations recursively!\n" );
return 1;
return true;
}
string_func_in_use = True;
string_func_in_use = true;
exppp_buf = exppp_bufp = buf;
exppp_buflen = exppp_maxbuflen = len;
@@ -1989,9 +1990,9 @@ prep_buffer( char * buf, int len ) {
curpos = 1;
old_lineno = 1;
first_line = True;
first_line = true;
return 0;
return false;
}
/* return length of string */
@@ -2000,24 +2001,24 @@ finish_buffer() {
exppp_buf = 0;
curpos = old_curpos;
error_sym.line = old_lineno;
string_func_in_use = False;
string_func_in_use = false;
return 1 + exppp_maxbuflen - exppp_buflen;
}
/* return 0 if successful */
static int
/* return false if successful */
static bool
prep_string() {
/* this should never happen */
if( string_func_in_use ) {
fprintf( stderr, "cannot generate EXPRESS string representations recursively!\n" );
return 1;
return true;
}
string_func_in_use = True;
string_func_in_use = true;
exppp_buf = exppp_bufp = ( char * )malloc( BIGBUFSIZ );
if( !exppp_buf ) {
fprintf( stderr, "failed to allocate exppp buffer\n" );
return 1;
return false;
}
exppp_buflen = exppp_maxbuflen = BIGBUFSIZ;
@@ -2026,9 +2027,9 @@ prep_string() {
old_lineno = error_sym.line;
curpos = 1;
first_line = True;
first_line = true;
return 0;
return false;
}
static char *
@@ -2043,7 +2044,7 @@ finish_string() {
curpos = old_curpos;
error_sym.line = old_lineno;
string_func_in_use = False;
string_func_in_use = false;
return b;
}
@@ -2056,7 +2057,7 @@ prep_file() {
if( file_func_in_use ) {
fprintf( stderr, "cannot print EXPRESS representations recursively!\n" );
}
file_func_in_use = True;
file_func_in_use = true;
/* temporarily change file to stdout and print */
/* This avoids messing up any printing in progress */
@@ -2068,7 +2069,7 @@ prep_file() {
static void
finish_file() {
exppp_fp = oldfp; /* reset back to original file */
file_func_in_use = False;
file_func_in_use = false;
}
static char * placeholder = "placeholder";
+23 -23
View File
@@ -117,15 +117,15 @@
#include "express/object.h"
/* returns true if variable is declared (or redeclared) directly by entity */
int
bool
ENTITYdeclares_variable( Entity e, Variable v ) {
LISTdo( e->u.entity->attributes, attr, Variable )
if( attr == v ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
static
@@ -414,7 +414,7 @@ ENTITY_copy( Generic dummy1, Generic dummy2 ) {
dest->mark = source->mark;
}
Boolean
bool
ENTITY_equal( Generic dummy1, Generic dummy2 ) {
struct Entity * entity1 = ( struct Entity * )dummy1;
struct Entity * entity2 = ( struct Entity * )dummy2;
@@ -686,21 +686,21 @@ ENTITYdelete_instance( Entity entity, Generic instance ) {
** Description: Look for a certain entity in the supertype graph of an entity.
*/
Boolean
bool
ENTITYhas_supertype( Entity child, Entity parent ) {
LISTdo( child->u.entity->supertypes, entity, Entity )
if( entity == parent ) {
return True;
return true;
}
#if 0
if( OBJis_kind_of( entity, Class_Entity ) &&
ENTITYhas_supertype( entity, parent ) )
#endif
if( ENTITYhas_supertype( entity, parent ) ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
#if 0
@@ -764,7 +764,7 @@ ENTITYget_subtype( Entity child, String subname ) {
** Description: Look for a certain entity in the subtype graph of an entity.
*/
Boolean
bool
ENTITYhas_subtype( Entity parent, Entity child ) {
struct Entity * data;
Error experrc;
@@ -772,13 +772,13 @@ ENTITYhas_subtype( Entity parent, Entity child ) {
data = ( struct Entity * )OBJget_data( parent, Class_Entity, &experrc );
LISTdo( data->subtypes, entity, Entity )
if( OBJequal( entity, child, &experrc ) ) {
return True;
return true;
}
if( ENTITYhas_subtype( entity, child ) ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
/*
@@ -791,14 +791,14 @@ ENTITYhas_subtype( Entity parent, Entity child ) {
#endif
Boolean
bool
ENTITYhas_immediate_supertype( Entity child, Entity parent ) {
LISTdo( child->u.entity->supertypes, entity, Entity )
if( entity == parent ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
#if 0
@@ -811,17 +811,17 @@ ENTITYhas_immediate_supertype( Entity child, Entity parent ) {
** Description: Check whether an entity has a specific immediate subclass.
*/
Boolean
bool
ENTITYhas_immediate_subtype( Entity parent, Entity child ) {
LISTdo( parent->u.entity->subtypes, entity, Entity )
if( entity == child ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
Boolean
bool
ENTITYhas_immediate_subtype( Entity parent, Entity child ) {
struct Entity * data;
Error experrc;
@@ -829,10 +829,10 @@ ENTITYhas_immediate_subtype( Entity parent, Entity child ) {
data = ( struct Entity * )OBJget_data( parent, Class_Entity, &experrc );
LISTdo( data->subtypes, entity, Entity )
if( OBJequal( entity, child, &experrc ) ) {
return True;
return true;
}
LISTod;
return False;
return false;
}
/*
@@ -877,7 +877,7 @@ ENTITYget_subtypes( Entity entity ) {
** Description: Retrieve/Set whether an entity is abstract.
*/
Boolean
bool
ENTITYget_abstract( Entity entity ) {
struct Entity * data;
Error experrc;
@@ -887,7 +887,7 @@ ENTITYget_abstract( Entity entity ) {
}
void
ENTITYput_abstract( Entity entity, Boolean abstract ) {
ENTITYput_abstract( Entity entity, bool abstract ) {
struct Entity * data;
Error experrc;
+9 -9
View File
@@ -88,7 +88,7 @@ static int ERROR_with_lines = 0; /* number of warnings & errors */
static char * ERROR_string;
static char * ERROR_string_base;
static char ERROR_unsafe = False;
static bool ERROR_unsafe = false;
static jmp_buf ERROR_safe_env;
/* message buffer file */
@@ -157,7 +157,7 @@ ERRORcreate_warning( char * name, Error error ) {
void
ERRORset_warning( char * name, int set ) {
int found = False;
bool found = false;
if( streq( name, "all" ) ) {
ERRORset_all_warnings( set );
@@ -166,7 +166,7 @@ ERRORset_warning( char * name, int set ) {
} else {
LISTdo( ERRORwarnings, opt, Error_Warning )
if( streq( opt->name, name ) ) {
found = True;
found = true;
LISTdo( opt->errors, err, Error )
err->enabled = set;
LISTod
@@ -256,7 +256,7 @@ va_dcl {
fprintf( error_file, "ERROR: " );
vfprintf( error_file, what->message, args );
fputc( '\n', error_file );
ERRORoccurred = True;
ERRORoccurred = true;
} else if( what->severity >= SEVERITY_WARNING ) {
fprintf( error_file, "WARNING: %d", what->severity );
vfprintf( error_file, what->message, args );
@@ -377,7 +377,7 @@ va_dcl {
ERROR_string += strlen( ERROR_string );
*ERROR_string++ = '\n';
*ERROR_string++ = '\0';
ERRORoccurred = True;
ERRORoccurred = true;
} else if( what->severity >= SEVERITY_WARNING ) {
sprintf( ERROR_string, "%s:%d: WARNING: ", sym->filename, sym->line );
ERROR_string += strlen( ERROR_string );
@@ -401,7 +401,7 @@ va_dcl {
fprintf( error_file, "%s:%d: --ERROR: ", sym->filename, sym->line );
vfprintf( error_file, what->message, args );
fprintf( error_file, "\n" );
ERRORoccurred = True;
ERRORoccurred = true;
} else if( what->severity >= SEVERITY_WARNING ) {
fprintf( error_file, "%s:%d: WARNING: ", sym->filename, sym->line );
ERROR_string += strlen( ERROR_string ) + 1;
@@ -442,7 +442,7 @@ ERRORcreate( char * message, Severity severity ) {
n = ( struct Error_ * )malloc( sizeof( struct Error_ ) );
n->message = message;
n->severity = severity;
n->enabled = True;
n->enabled = true;
return n;
}
@@ -489,7 +489,7 @@ ERROR_start_message_buffer( void ) {
void
ERROR_flush_message_buffer( void ) {
if( __ERROR_buffer_errors == False ) {
if( __ERROR_buffer_errors == false ) {
return;
}
@@ -553,5 +553,5 @@ ERRORsafe( jmp_buf env ) {
void
ERRORunsafe() {
ERROR_unsafe = True;
ERROR_unsafe = true;
}
+14 -14
View File
@@ -123,7 +123,7 @@ extern int yylineno;
static void yyerror PROTO((char*));
Boolean yyeof = False;
bool yyeof = false;
#ifdef FLEX
extern char *yytext;
@@ -378,12 +378,12 @@ static struct scope {
struct {
Expression subtypes;
Linked_List supertypes;
Boolean abstract;
bool abstract;
} subsuper_decl;
struct {
Expression subtypes;
Boolean abstract;
bool abstract;
} subtypes;
struct {
@@ -725,7 +725,7 @@ derive_decl : /* NULL body */
derived_attribute : attribute_decl TOK_COLON attribute_type initializer semicolon
{ $$ = VARcreate($1,$3);
$$->initializer = $4;
$$->flags.attribute = True;
$$->flags.attribute = true;
}
;
@@ -849,7 +849,7 @@ explicit_attribute : attribute_decl_list TOK_COLON optional
LISTdo_links ($1, attr)
v = VARcreate((Expression)attr->data,$4);
v->flags.optional = $3.optional;
v->flags.attribute = True;
v->flags.attribute = true;
attr->data = (Generic)v;
LISTod;
}
@@ -997,7 +997,7 @@ formal_parameter : var id_list TOK_COLON parameter_type
e = EXPcreate_from_symbol(Type_Attribute,tmp);
v = VARcreate(e,$4);
v->flags.optional = $1.var;
v->flags.parameter = True;
v->flags.parameter = true;
param->data = (Generic)v;
/* link it in to the current scope's dict */
@@ -1311,7 +1311,7 @@ inverse_attr : TOK_IDENTIFIER TOK_COLON set_or_bag_of_entity
SCOPEadd_super(t);
$$ = VARcreate(e,t);
}
$$->flags.attribute = True;
$$->flags.attribute = true;
$$->inverse_symbol = $5;}
;
@@ -1640,8 +1640,8 @@ rule_formal_parameter : TOK_IDENTIFIER
SCOPEadd_super(t);
e = EXPcreate_from_symbol(t,$1);
$$ = VARcreate(e,t);
$$->flags.attribute = True;
$$->flags.parameter = True;
$$->flags.attribute = true;
$$->flags.parameter = true;
/* link it in to the current scope's dict */
DICTdefine(CURRENT_SCOPE->symbol_table,
$1->name,(Generic)$$,$1,OBJ_VARIABLE);
@@ -1764,7 +1764,7 @@ statement_rep : /* no statements */
subsuper_decl : /* NULL body */
{ $$.subtypes = EXPRESSION_NULL;
$$.abstract = False;
$$.abstract = false;
$$.supertypes = LIST_NULL; }
| supertype_decl
{ $$.subtypes = $1.subtypes;
@@ -1772,7 +1772,7 @@ subsuper_decl : /* NULL body */
$$.supertypes = LIST_NULL; }
| subtype_decl
{ $$.supertypes = $1;
$$.abstract = False;
$$.abstract = false;
$$.subtypes = EXPRESSION_NULL; }
/* | subtype_decl supertype_decl
{ $$.supertypes = $1;
@@ -1791,15 +1791,15 @@ subtype_decl : TOK_SUBTYPE TOK_OF TOK_LEFT_PAREN defined_type_list
supertype_decl : TOK_ABSTRACT TOK_SUPERTYPE
{ $$.subtypes = (Expression)0;
$$.abstract = True; }
$$.abstract = true; }
| TOK_SUPERTYPE TOK_OF TOK_LEFT_PAREN
supertype_expression TOK_RIGHT_PAREN
{ $$.subtypes = $4;
$$.abstract = False; }
$$.abstract = false; }
| TOK_ABSTRACT TOK_SUPERTYPE TOK_OF TOK_LEFT_PAREN
supertype_expression TOK_RIGHT_PAREN
{ $$.subtypes = $5;
$$.abstract = True; }
$$.abstract = true; }
;
supertype_expression : supertype_factor
+2 -2
View File
@@ -323,13 +323,13 @@ EXPRESSinitialize( void ) {
x->symbol.name = y;\
x->u.func->pcount = c; \
x->u.func->return_type = r; \
x->u.func->builtin = True; \
x->u.func->builtin = true; \
resolved_all(x); \
DICTdefine(EXPRESSbuiltins,y,(Generic)x,0,OBJ_FUNCTION);
#define procdef(x,y,c) x = ALGcreate(OBJ_PROCEDURE);\
x->symbol.name = y;\
x->u.proc->pcount = c; \
x->u.proc->builtin = True; \
x->u.proc->builtin = true; \
resolved_all(x); \
DICTdefine(EXPRESSbuiltins,y,(Generic)x,0,OBJ_PROCEDURE);
/* third arg is # of parameters */
+6 -6
View File
@@ -112,7 +112,7 @@
extern void yyerror();
extern int yylineno;
extern Boolean yyeof;
extern bool yyeof;
static int nesting_level;
/* can't imagine this will ever be more than 2 or 3 - DEL */
@@ -158,7 +158,7 @@ You used flex (in make_rules) but compiled with -DLEX (in Makefile)!
#define YY_INPUT(buf,result,max_size) \
result = (((buf[0] = getc(yyin)) == '\n') \
? (NEWLINE, 1) \
: ((buf[0] == EOF) ? ((yyeof = True), YY_NULL) : 1))
: ((buf[0] == EOF) ? ((yyeof = true), YY_NULL) : 1))
#endif /*slow_yylineno*/
/*#define NEWLINE ((SCANbol = SCANtell()), yylineno++)*/
@@ -179,7 +179,7 @@ You used lex (in make_rules) but compiled with -DFLEX (in Makefile)!
static char unchar[BUFSIZ]; /* one char for lex unput storage */
static char *unchar_p = unchar; /* whether unchar is in use */
static int first_time = True;
static bool first_time = true;
static int
input() {
@@ -225,7 +225,7 @@ SCAN_lex_init(char *filename,FILE *fp) {
/* return to initial scan buffer */
SCAN_current_buffer = 0;
*(SCANcurrent = SCANbuffer.text) = '\0';
SCANbuffer.readEof = False;
SCANbuffer.readEof = false;
SCANbuffer.file = fp;
SCANbuffer.filename = (filename?filename:"");
current_filename = SCANbuffer.filename;
@@ -242,7 +242,7 @@ SCAN_lex_init(char *filename,FILE *fp) {
/* initialize un-got character pointer to start of buffer */
unchar_p = unchar;
first_time = True;
first_time = true;
#endif
}
@@ -262,7 +262,7 @@ id_char [A-Za-z0-9_]
#ifndef FLEX_SCANNER
if (first_time) {
BEGIN code;
first_time = False;
first_time = false;
}
#endif
%}
+3 -3
View File
@@ -123,7 +123,7 @@ main( int argc, char ** argv ) {
int no_need_to_work = 0;/* TRUE if we can exit gracefully without */
/* doing any work */
Boolean buffer_messages = False;
bool buffer_messages = false;
char * filename = 0;
Express model;
@@ -179,10 +179,10 @@ main( int argc, char ** argv ) {
}
break;
case 'B':
buffer_messages = True;
buffer_messages = true;
break;
case 'b':
buffer_messages = False;
buffer_messages = false;
break;
case 'e':
filename = optarg;
+7 -7
View File
@@ -226,7 +226,7 @@ SCANpush_buffer( char * filename, FILE * fp ) {
#else
*( SCANcurrent = SCANbuffer.text ) = '\0';
#endif
SCANbuffer.readEof = False;
SCANbuffer.readEof = false;
SCANbuffer.file = fp;
SCANbuffer.filename = current_filename = filename;
}
@@ -478,17 +478,17 @@ SCANsave_comment( void ) {
last_comment = last_comment;
}
Boolean
bool
SCANread( void ) {
int numRead;
Boolean done;
bool done;
do {
/* this loop is guaranteed to terminate, since buffer[0] is on yyin */
while( SCANbuffer.file == NULL ) {
SCANpop_buffer();
if( SCANtext_ready ) {
return True;
return true;
}
}
@@ -496,7 +496,7 @@ SCANread( void ) {
/* check for more stuff already buffered */
if( SCANtext_ready ) {
return True;
return true;
}
/* check whether we've seen eof on this file */
@@ -504,7 +504,7 @@ SCANread( void ) {
numRead = fread( SCANbuffer.text, sizeof( char ),
SCAN_BUFFER_SIZE, SCANbuffer.file );
if( numRead < SCAN_BUFFER_SIZE ) {
SCANbuffer.readEof = True;
SCANbuffer.readEof = true;
}
#ifdef keep_nul
SCANbuffer.numRead = numRead;
@@ -516,7 +516,7 @@ SCANread( void ) {
if( !( done = SCANtext_ready ) ) {
if( SCAN_current_buffer == 0 ) {
done = True;
done = true;
fclose( SCANbuffer.file ); /* close yyin (I think) */
} else {
SCANpop_buffer();
+15 -15
View File
@@ -94,7 +94,7 @@ static Error ERROR_missing_self;
static Type self = 0; /* always points to current value of SELF */
/* or 0 if none */
static int found_self; /* remember whether we've seen a SELF in a */
static bool found_self; /* remember whether we've seen a SELF in a */
/* WHERE clause */
/***********************/
@@ -253,7 +253,7 @@ EXP_resolve( Expression expr, Scope scope, Type typecheck ) {
Generic x;
Entity e;
Type t;
int func_args_checked = False;
bool func_args_checked = false;
/* if (expr == EXPRESSION_NULL)
return;
@@ -317,7 +317,7 @@ EXP_resolve( Expression expr, Scope scope, Type typecheck ) {
if( f == FUNC_NVL ) {
EXPresolve( ( Expression )LISTget_first( expr->u.funcall.list ), scope, typecheck );
EXPresolve( ( Expression )LISTget_second( expr->u.funcall.list ), scope, typecheck );
func_args_checked = True;
func_args_checked = true;
}
/* why is this here? (snc) */
@@ -397,7 +397,7 @@ EXP_resolve( Expression expr, Scope scope, Type typecheck ) {
/* Geez, don't wipe out original type! */
expr->return_type = expr->u.variable->type;
if( expr->u.variable->flags.attribute ) {
found_self = True;
found_self = true;
}
resolved_all( expr );
break;
@@ -455,7 +455,7 @@ EXP_resolve( Expression expr, Scope scope, Type typecheck ) {
/* will be by the time we return, and besides, */
/* there's no way this will be accessed if the true */
/* entity fails resolution */
found_self = True;
found_self = true;
resolved_all( expr );
} else {
ERRORreport_with_symbol( ERROR_self_is_unknown, &scope->symbol );
@@ -534,7 +534,7 @@ ENTITYresolve_subtype_expression( Expression expr, Entity ent/*was scope*/, Link
expr->symbol.name, sym->line );
i = RESOLVE_FAILED;
} else {
int found = False;
bool found = false;
/* link in to flat list */
if( !*flat ) {
@@ -543,7 +543,7 @@ ENTITYresolve_subtype_expression( Expression expr, Entity ent/*was scope*/, Link
LISTdo( *flat, sub, Entity )
if( sub == ent_ref ) {
found = True;
found = true;
break;
}
LISTod
@@ -562,7 +562,7 @@ ENTITYresolve_subtype_expression( Expression expr, Entity ent/*was scope*/, Link
/* complain (IS p. 44) */
LISTdo( ent_ref->u.entity->supertypes, sup, Entity )
if( sup == ent ) {
found = True;
found = true;
break;
}
LISTod
@@ -1178,14 +1178,14 @@ ENTITYresolve_pass2( Entity e ) {
void
ENTITYcheck_missing_supertypes( Entity ent ) {
int found;
bool found;
/* Make sure each of my subtypes lists me as a supertype */
LISTdo( ent->u.entity->subtypes, sub, Entity )
found = False;
found = false;
LISTdo( sub->u.entity->supertypes, sup, Entity )
if( sup == ent ) {
found = True;
found = true;
break;
}
LISTod;
@@ -1464,7 +1464,7 @@ SCHEMAresolve_pass2( Schema * schema ) {
/* ENTITY_resolve_failed = 1;*/
resolve_failed( e );
} else {
int found = False;
bool found = false;
LISTadd( e->u.entity->supertypes, ( Generic )ref_entity );
if( is_resolve_failed( ref_entity ) ) {
@@ -1478,7 +1478,7 @@ SCHEMAresolve_pass2( Schema * schema ) {
LISTdo( ref_entity->u.entity->subtypes, sub, Entity )
if( sub == e ) {
found = True;
found = true;
break;
}
LISTod
@@ -1512,7 +1512,7 @@ SCHEMAresolve_pass2( Schema * schema ) {
int i;
Qualified_Attr * reference;
Variable attr;
int failed = 0;
bool failed = false;
if( print_objects_while_running & OBJ_ENTITY_BITS ) {
fprintf( stdout, "pass %d: %s (entity)\n", EXPRESSpass,
@@ -1672,7 +1672,7 @@ SCHEMAresolve_pass2( Schema * schema ) {
break;
}
found_self = False;
found_self = false;
EXPresolve( w->expr, scope, Type_Dont_Care );
if( need_self && ! found_self ) {
ERRORreport_with_symbol( ERROR_missing_self,
+9 -9
View File
@@ -219,7 +219,7 @@ TYPEBODYcreate( enum type_enum type ) {
/* may need to be implemented for more types */
#define TYPE_inherits_from(t,e) ((t) && TYPEinherits_from((t),(e)))
Boolean
bool
TYPEinherits_from( Type t, enum type_enum e ) {
TypeBody tb = t->u.type->body;
@@ -230,19 +230,19 @@ TYPEinherits_from( Type t, enum type_enum e ) {
tb->type == bag_ ||
tb->type == set_ ||
tb->type == list_ ) {
return True;
return true;
} else {
return( TYPE_inherits_from( tb->base, e ) );
}
case array_:
return( ( tb->type == array_ ) ? True : TYPE_inherits_from( tb->base, e ) );
return( ( tb->type == array_ ) ? true : TYPE_inherits_from( tb->base, e ) );
case bag_:
return( ( tb->type == bag_ ||
tb->type == set_ ) ? True : TYPE_inherits_from( tb->base, e ) );
tb->type == set_ ) ? true : TYPE_inherits_from( tb->base, e ) );
case set_:
return( ( tb->type == set_ ) ? True : TYPE_inherits_from( tb->base, e ) );
return( ( tb->type == set_ ) ? true : TYPE_inherits_from( tb->base, e ) );
case list_:
return( ( tb->type == list_ ) ? True : TYPE_inherits_from( tb->base, e ) );
return( ( tb->type == list_ ) ? true : TYPE_inherits_from( tb->base, e ) );
default:
break;
}
@@ -506,12 +506,12 @@ TYPEcompatible( Type lhs_type, Type rhs_type ) {
list = COMP_TYPEget_items( rhs_type );
LISTdo( list, e, Entity )
if( !ENTITYhas_supertype( e, entity ) ) {
return False;
return false;
}
LISTod;
return True;
return true;
} else {
return False;
return false;
}
} else if( CLASSinherits_from( lhs_class, Class_Composed_Type ) ) {
return OBJequal( rhs_type, lhs_type, &experrc );
+3 -3
View File
@@ -142,7 +142,7 @@ USEREFout( Schema schema, Dictionary refdict, Linked_List reflist, char * type,
/* step 2: for each list, print out the renames */
DICTdo_init( dict, &de );
while( 0 != ( list = ( Linked_List )DICTdo( &de ) ) ) {
int first_time = True;
bool first_time = true;
LISTdo( list, r, struct Rename * )
/*
@@ -166,7 +166,7 @@ USEREFout( Schema schema, Dictionary refdict, Linked_List reflist, char * type,
}
if( first_time ) {
first_time = False;
first_time = false;
}
if( r->type == OBJ_TYPE ) {
sprintf( td_name, "%s", TYPEtd_name( ( Type )r->object ) );
@@ -2485,7 +2485,7 @@ LIBcopy_constructor( Entity ent, FILE * file ) {
int count = attr_count;
String entnm = ENTITYget_classname( ent );
__attribute__( ( unused ) ) Boolean opt;
__attribute__( ( unused ) ) bool opt;
String StrToLower( String word );
/*mjm7/10/91 copy constructor definition */