fixed build for clang

This commit is contained in:
2024-10-04 15:26:19 +03:00
parent 9f15a980af
commit 1140957dce
11 changed files with 10558 additions and 10691 deletions

View File

@@ -65,9 +65,16 @@
#define DOUBLEMARK 316
#define POINTSAT 317
extern char* xmalloc(int size);
extern void Message(char *s, int l);
extern void set_up_momentum(int value,int token);
extern void automata_driver(int value);
extern char* copys(char *);
#line 5 "annotate.y"
#include "macro.h"
#include <stdlib.h>
#include "compatible.h"
#ifdef SYS5
@@ -146,8 +153,8 @@ typedef union {
char AnnExTensionNumber[255]; /* to symbole right for the annotation */
static int Recog_My_Token();
static int look_up_specialfunction();
static unMYGETC();
static MYGETC();
static char unMYGETC(char c);
static char MYGETC();
static int map_assgn_op();
#ifndef YYLTYPE
@@ -623,6 +630,7 @@ while (0)
#define YYERRCODE 256
#ifndef YYPURE
int yylex_annotate();
#define YYLEX yylex_annotate()
#endif
@@ -677,7 +685,7 @@ static int yydebug; /* nonzero means print parse trace */
#ifdef __GNUC__
int yyparse_annotate(void);
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
@@ -2258,7 +2266,7 @@ char *p;
register char *p2, *p1;
//extern char *malloc();
newbuf = (char*)malloc((unsigned)(newlength+1));
newbuf = (char*)malloc(newlength+1);
#ifdef __SPF
addToCollection(__LINE__, __FILE__,newbuf, 0);
#endif
@@ -2996,8 +3004,7 @@ look_up_annotate(st)
return (PTR_HASH) pt;
}
static
MYGETC()
static char MYGETC()
{
if (LENSTRINGTOPARSE <= PTTOSTRINGTOPARSE)
@@ -3013,9 +3020,7 @@ MYGETC()
return STRINGTOPARSE[ PTTOSTRINGTOPARSE-1];
}
static
unMYGETC(c)
char c;
static char unMYGETC(char c)
{
if (LENSTRINGTOPARSE <= PTTOSTRINGTOPARSE)
return EOF;
@@ -3086,10 +3091,10 @@ look_up_specialfunction(str)
return TRUE;
}
if (strcmp(specialfunction[i],"Dummy") == 0)
return NULL;
return 0;
}
return NULL;
return 0;
}

View File

@@ -71,5 +71,4 @@ typedef union {
#define DOUBLEMARK 316
#define POINTSAT 317
extern YYSTYPE yylval;

View File

@@ -16,6 +16,12 @@
# include <alloca.h>
#endif
extern char* xmalloc(int size);
extern void Message(char *s, int l);
extern void set_up_momentum(int value,int token);
extern void automata_driver(int value);
extern char* copys(char *);
#define ON 1
#define OFF 0
#define OTHER 2
@@ -182,8 +188,8 @@ extern POINTER newNode();
char AnnExTensionNumber[255]; /* to symbole right for the annotation */
static int Recog_My_Token();
static int look_up_specialfunction();
static unMYGETC();
static MYGETC();
static char unMYGETC(char c);
static char MYGETC();
static int map_assgn_op();
%}
@@ -1114,7 +1120,7 @@ char *p;
register char *p2, *p1;
extern char *malloc();
newbuf = malloc((unsigned)(newlength+1));
newbuf = malloc(newlength+1));
p2 = newbuf;
p1 = newbuf + newlength + 1;
@@ -1844,8 +1850,7 @@ look_up(st)
return (PTR_HASH) pt;
}
static
MYGETC()
static char MYGETC()
{
if (LENSTRINGTOPARSE <= PTTOSTRINGTOPARSE)
@@ -1861,9 +1866,7 @@ MYGETC()
return STRINGTOPARSE[ PTTOSTRINGTOPARSE-1];
}
static
unMYGETC(c)
char c;
static char unMYGETC(char c)
{
if (LENSTRINGTOPARSE <= PTTOSTRINGTOPARSE)
return EOF;
@@ -1931,10 +1934,10 @@ look_up_specialfunction(str)
return TRUE;
}
if (strcmp(specialfunction[i],"Dummy") == 0)
return NULL;
return 0;
}
return NULL;
return 0;
}

View File

@@ -16,8 +16,15 @@
#include "vextern.h"
#include "annotate.tab.h"
extern void Message(char *s, int l);
void reset_semicoln_handler();
void reset();
int class_struct(int value);
int is_declare(int value);
int declare_symb(int value);
int block_like(int state);
int keep_original(int state);
int lastdecl_id; /* o if no main_type appeared */
int left_paren ;
@@ -484,8 +491,7 @@ int value ;
}
class_struct(value)
register int value ;
int class_struct(int value)
{
switch (value) {
case ENUM :
@@ -496,8 +502,7 @@ register int value ;
}
}
declare_symb(value)
register int value ;
int declare_symb(int value)
{
switch (value) {
case TYPENAME :
@@ -523,8 +528,7 @@ void reset()
/* put_line_queue(line_pos_1,line_pos_fname); */
}
block_like(state)
int state ;
int block_like(int state)
{
switch( state) {
@@ -541,9 +545,7 @@ int state ;
}
}
int
is_declare(value)
int value ;
int is_declare(int value)
{
switch (value) {
case TYPENAME:
@@ -594,8 +596,7 @@ void reset_semicoln_handler()
}
keep_original(state)
int state;
int keep_original(int state)
{
switch (state) {
case ELSE_EXPECTED_STATE:

View File

@@ -47,6 +47,7 @@ extern int PTTOSTRINGTOPARSE;
extern PTR_BFND ANNOTATIONSCOPE;
extern PTR_TYPE global_int_annotation;
extern char AnnExTensionNumber[];
extern int yyparse_annotate(void);
/* FORWARD DECLARATION */
int Get_Scope_Of_Annotation();
@@ -100,7 +101,7 @@ static char *Defined_Value_Str[MAX_ANNOTATION];
static int Defined_Value_Value[MAX_ANNOTATION];
/* Indicate if comment is an annotation */
Is_Annotation(str)
int Is_Annotation(str)
char *str;
{
@@ -122,7 +123,7 @@ char *str;
}
}
Is_Annotation_Cont(str)
int Is_Annotation_Cont(str)
char *str;
{
@@ -229,7 +230,7 @@ char *str;
/* basically go thrue the program and parse annotation, and set
if they are defined */
initAnnotation()
int initAnnotation()
{
PTR_CMNT cmnt;
PTR_BFND ptbif;

View File

@@ -35,7 +35,9 @@ void errstr();
PTR_HASH hash_table[hashMax];
#ifdef __SPF
extern void removeFromCollection(void *pointer);
#endif
/*
* init_hash -- initialize the hash table
*/

View File

@@ -37,6 +37,10 @@ extern char* Tool_Unparse_Type();
#define MAXFIELDSYMB 10
#define MAXFIELDTYPE 10
#ifdef __SPF
extern void removeFromCollection(void *pointer);
#endif
#ifdef __SPF_BUILT_IN_PARSER
static int Warning_count = 0;
//static PTR_FILE pointer_on_file_proj;
@@ -73,6 +77,41 @@ char general_info[LAST_CODE][MAXFIELDSYMB];
static struct bif_stack_level *current_level = NULL;*/
PTR_BFND getFunctionHeader();
#ifdef __SPF_BUILT_IN_PARSER
#define xmalloc xmalloc_temp
#define make_a_malloc_stack make_a_malloc_stack_temp
#define mymalloc mymalloc_temp
#define isATypeNode isATypeNode_temp
#define isASymbNode isASymbNode_temp
#define isABifNode isABifNode_temp
#define isALoNode isALoNode_temp
#define hasTypeBaseType hasTypeBaseType_temp
#define isStructType isStructType_temp
#define isPointerType isPointerType_temp
#define isUnionType isUnionType_temp
#define isEnumType isEnumType_temp
#define hasTypeSymbol hasTypeSymbol_temp
#define isAtomicType isAtomicType_temp
#define hasNodeASymb hasNodeASymb_temp
#define isNodeAConst isNodeAConst_temp
#define isAStructDeclBif isAStructDeclBif_temp
#define isAUnionDeclBif isAUnionDeclBif_temp
#define isAEnumDeclBif isAEnumDeclBif_temp
#define isADeclBif isADeclBif_temp
#define isAControlEnd isAControlEnd_temp
#define Message Message_temp
#define Check_Lang_Fortran Check_Lang_Fortran_temp
#define filter filter_temp
#define allocateValueEvaluate allocateValueEvaluate_temp
#define addElementEvaluate addElementEvaluate_temp
#define getElementEvaluate getElementEvaluate_temp
#define resetPresetEvaluate resetPresetEvaluate_temp
#define evaluateExpression evaluateExpression_temp
#define patternMatchExpression patternMatchExpression_temp
#define Follow_Llnd Follow_Llnd_temp
#endif
/*****************************************************************************
* *
@@ -80,13 +119,21 @@ PTR_BFND getFunctionHeader();
* *
*****************************************************************************/
/***************************************************************************/
void Message(s, l)
char *s;
int l;
{
if (l != 0)
fprintf(stderr,"Warning : %s line %d\n",s, l);
else
fprintf(stderr,"Warning : %s\n",s);
Warning_count++;
}
/* Modified to return a pointer (64bit clean) (phb) */
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
char* xmalloc_temp(size)
#else
char* xmalloc(size)
#endif
int size;
{
char *val;
@@ -102,11 +149,7 @@ static ptstack_chaining Current_Allocated_Data = NULL;
static ptstack_chaining First_STACK= NULL;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
void make_a_malloc_stack_temp()
#else
void make_a_malloc_stack()
#endif
{
ptstack_chaining pt;
@@ -133,11 +176,7 @@ void make_a_malloc_stack()
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
char* mymalloc_temp(size)
#else
char* mymalloc(size)
#endif
int size;
{
char *pt1;
@@ -186,7 +225,6 @@ int size;
* *
**************************************************************************/
#ifndef __SPF_BUILT_IN_PARSER
/***************************************************************************/
int isATypeNode(variant)
int variant;
@@ -214,14 +252,9 @@ int variant;
{
return (LLNODE == (int) node_code_kind[variant]);
}
#endif
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int hasTypeBaseType_temp(variant)
#else
int hasTypeBaseType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -236,11 +269,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isStructType_temp(variant)
#else
int isStructType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -255,11 +284,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isPointerType_temp(variant)
#else
int isPointerType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -275,11 +300,7 @@ int variant;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isUnionType_temp(variant)
#else
int isUnionType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -295,11 +316,7 @@ int variant;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isEnumType_temp(variant)
#else
int isEnumType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -315,11 +332,7 @@ int variant;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int hasTypeSymbol_temp(variant)
#else
int hasTypeSymbol(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -334,11 +347,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isAtomicType_temp(variant)
#else
int isAtomicType(variant)
#endif
int variant;
{
if (!isATypeNode(variant))
@@ -353,11 +362,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int hasNodeASymb_temp(variant)
#else
int hasNodeASymb(variant)
#endif
int variant;
{
if ((!isABifNode(variant)) && (!isALoNode(variant)))
@@ -372,11 +377,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isNodeAConst_temp(variant)
#else
int isNodeAConst(variant)
#endif
int variant;
{
if ((!isABifNode(variant)) && (!isALoNode(variant)))
@@ -392,11 +393,7 @@ int variant;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isAStructDeclBif_temp(variant)
#else
int isAStructDeclBif(variant)
#endif
int variant;
{
if (!isABifNode(variant))
@@ -411,11 +408,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isAUnionDeclBif_temp(variant)
#else
int isAUnionDeclBif(variant)
#endif
int variant;
{
if (!isABifNode(variant))
@@ -430,11 +423,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isAEnumDeclBif_temp(variant)
#else
int isAEnumDeclBif(variant)
#endif
int variant;
{
if (!isABifNode(variant))
@@ -449,11 +438,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isADeclBif_temp(variant)
#else
int isADeclBif(variant)
#endif
int variant;
{
if (!isABifNode(variant))
@@ -468,11 +453,7 @@ int variant;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int isAControlEnd_temp(variant)
#else
int isAControlEnd(variant)
#endif
int variant;
{
if (!isABifNode(variant))
@@ -486,28 +467,8 @@ int variant;
return FALSE;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
void Message_temp(s, l)
#else
void Message(s, l)
#endif
char *s;
int l;
{
if (l != 0)
fprintf(stderr,"Warning : %s line %d\n",s, l);
else
fprintf(stderr,"Warning : %s\n",s);
Warning_count++;
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int Check_Lang_Fortran_temp(proj)
#else
int Check_Lang_Fortran(proj)
#endif
PTR_PROJ proj;
{
PTR_FILE ptf;
@@ -529,11 +490,7 @@ PTR_PROJ proj;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
char* filter_temp(s)
#else
char* filter(s)
#endif
char *s;
{
char c;
@@ -693,11 +650,7 @@ static int NbValues = 0;
static int NbElement = 0;
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
void allocateValueEvaluate_temp()
#else
void allocateValueEvaluate()
#endif
{
int i;
PTR_SYMB *pt1;
@@ -732,11 +685,7 @@ void allocateValueEvaluate()
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
void addElementEvaluate_temp(symb, val)
#else
void addElementEvaluate(symb, val)
#endif
PTR_SYMB symb;
int val;
{
@@ -753,11 +702,7 @@ void addElementEvaluate(symb, val)
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int getElementEvaluate_temp(symb)
#else
int getElementEvaluate(symb)
#endif
PTR_SYMB symb;
{
int i;
@@ -773,11 +718,7 @@ int getElementEvaluate(symb)
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
void resetPresetEvaluate_temp()
#else
void resetPresetEvaluate()
#endif
{
NbValues = 0;
NbElement = 0;
@@ -800,11 +741,7 @@ void resetPresetEvaluate()
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int* evaluateExpression_temp(expr)
#else
int* evaluateExpression(expr)
#endif
PTR_LLND expr;
{
int *res, *op1, *op2;
@@ -958,11 +895,7 @@ int* evaluateExpression(expr)
}
/***************************************************************************/
#ifdef __SPF_BUILT_IN_PARSER
int patternMatchExpression_temp(ll1, ll2)
#else
int patternMatchExpression(ll1,ll2)
#endif
PTR_LLND ll1,ll2;
{
int *res1, *res2;
@@ -1044,11 +977,7 @@ int patternMatchExpression(ll1,ll2)
return FALSE;
}
#ifdef __SPF_BUILT_IN_PARSER
PTR_LLND Follow_Llnd_temp(ll, c)
#else
PTR_LLND Follow_Llnd(ll,c)
#endif
PTR_LLND ll;
int c;
{

View File

@@ -35,6 +35,10 @@ extern PTR_SYMB head_symb;
extern PTR_TYPE head_type;
extern PTR_LABEL head_label;
#ifdef __SPF
extern void removeFromCollection(void *pointer);
#endif
/*
* eqn -- checks if first n characters of two strings are the same
*

View File

@@ -54,8 +54,41 @@ char *hpfname;
#define Fortran_Initialized 2
static int Parser_Initiated = 0;
#ifdef __SPF
extern void removeFromCollection(void *pointer);
#endif
#ifdef __SPF_BUILT_IN_PARSER
static PTR_FILE current_file = NULL;
#define DealWith_Rid DealWith_Rid_temp
#define is_overloaded_type is_overloaded_type_temp
#define Find_Type_For_Bif Find_Type_For_Bif_temp
#define Find_Protection_For_Bif Find_Protection_For_Bif_temp
#define Find_BaseType Find_BaseType_temp
#define Find_BaseType2 Find_BaseType2_temp
#define create_unp_str create_unp_str_temp
#define alloc_str alloc_str_temp
#define Reset_Unparser Reset_Unparser_temp
#define BufPutChar BufPutChar_temp
#define BufPutString BufPutString_temp
#define BufPutInt BufPutInt_temp
#define Get_Flag_val Get_Flag_val_temp
#define Treat_Flag Treat_Flag_temp
#define PushPop_Flag PushPop_Flag_temp
#define Tool_Unparse_Symbol Tool_Unparse_Symbol_temp
#define Get_Type_Operand Get_Type_Operand_temp
#define Get_LL_Operand Get_LL_Operand_temp
#define Get_Bif_Operand Get_Bif_Operand_temp
#define GetComp GetComp_temp
#define Eval_Type_Condition Eval_Type_Condition_temp
#define Eval_LLND_Condition Eval_LLND_Condition_temp
#define Eval_Bif_Condition Eval_Bif_Condition_temp
#define SkipToEndif SkipToEndif_temp
#define Tool_Unparse_Type Tool_Unparse_Type_temp
#define Tool_Unparse2_LLnode Tool_Unparse2_LLnode_temp
#define Tool_Unparse_Bif Tool_Unparse_Bif_temp
#else
PTR_FILE current_file=NULL;
#endif
@@ -440,11 +473,7 @@ for (symb = current_file->head_symb; symb ; symb = SYMB_NEXT (symb))
/* manage the unparse buffer */
#ifdef __SPF_BUILT_IN_PARSER
void DealWith_Rid_temp(typei, flg)
#else
void DealWith_Rid(typei, flg)
#endif
PTR_TYPE typei;
int flg; /* if 1 then do virtual */
{ int j;
@@ -539,11 +568,7 @@ void DealWith_Rid(typei, flg)
}
}
#ifdef __SPF_BUILT_IN_PARSER
int is_overloaded_type_temp(bif)
#else
int is_overloaded_type(bif)
#endif
PTR_BFND bif;
{
PTR_LLND ll;
@@ -555,11 +580,7 @@ int is_overloaded_type(bif)
else return 0;
}
#ifdef __SPF_BUILT_IN_PARSER
PTR_TYPE Find_Type_For_Bif_temp(bif)
#else
PTR_TYPE Find_Type_For_Bif(bif)
#endif
PTR_BFND bif;
{
PTR_TYPE type = NULL;
@@ -603,11 +624,7 @@ PTR_TYPE Find_Type_For_Bif(bif)
return type;
}
#ifdef __SPF_BUILT_IN_PARSER
int Find_Protection_For_Bif_temp(bif)
#else
int Find_Protection_For_Bif(bif)
#endif
PTR_BFND bif;
{
int protect = 0;
@@ -642,11 +659,7 @@ int Find_Protection_For_Bif(bif)
return protect;
}
#ifdef __SPF_BUILT_IN_PARSER
PTR_TYPE Find_BaseType_temp(ptype)
#else
PTR_TYPE Find_BaseType(ptype)
#endif
PTR_TYPE ptype;
{
PTR_TYPE pt;
@@ -690,11 +703,7 @@ PTR_TYPE Find_BaseType(ptype)
return pt;
}
#ifdef __SPF_BUILT_IN_PARSER
PTR_TYPE Find_BaseType2_temp(ptype)
#else
PTR_TYPE Find_BaseType2(ptype) /* breaks out of the loop for pointers and references BW */
#endif
PTR_TYPE ptype;
{
PTR_TYPE pt;
@@ -739,12 +748,7 @@ PTR_TYPE Find_BaseType2(ptype) /* breaks out of the loop for pointers an
return pt;
}
#ifdef __SPF_BUILT_IN_PARSER
char* create_unp_str_temp(str)
#else
char *create_unp_str(str)
#endif
char *str;
{
char *pt;
@@ -758,11 +762,7 @@ char *create_unp_str(str)
return pt;
}
#ifdef __SPF_BUILT_IN_PARSER
char* alloc_str_temp(size)
#else
char *alloc_str(size)
#endif
int size;
{
char *pt;
@@ -773,11 +773,7 @@ char *alloc_str(size)
return pt;
}
#ifdef __SPF_BUILT_IN_PARSER
int Reset_Unparser_temp()
#else
int Reset_Unparser()
#endif
{
int i,j;
@@ -801,11 +797,7 @@ int Reset_Unparser()
/* function to manage the unparse buffer */
#ifdef __SPF_BUILT_IN_PARSER
int BufPutChar_temp(c)
#else
int BufPutChar(c)
#endif
char c;
{
if (Buf_pointer >= MAXLENGHTBUF)
@@ -818,11 +810,7 @@ int BufPutChar(c)
return 1;
}
#ifdef __SPF_BUILT_IN_PARSER
int BufPutString_temp(s,len)
#else
int BufPutString(s, len)
#endif
char *s;
int len;
{
@@ -846,11 +834,7 @@ int BufPutString(s, len)
return 1;
}
#ifdef __SPF_BUILT_IN_PARSER
int BufPutInt_temp(i)
#else
int BufPutInt(i)
#endif
int i;
{
int length;
@@ -869,11 +853,7 @@ int BufPutInt(i)
return 1;
}
#ifdef __SPF_BUILT_IN_PARSER
int Get_Flag_val_temp(str, i)
#else
int Get_Flag_val(str, i)
#endif
char *str;
int *i;
{
@@ -911,11 +891,7 @@ int Get_Flag_val(str, i)
}
#ifdef __SPF_BUILT_IN_PARSER
void Treat_Flag_temp(str, i, val)
#else
void Treat_Flag(str, i, val)
#endif
char *str;
int *i;
int val;
@@ -955,11 +931,7 @@ void Treat_Flag(str, i, val)
*i += con;
}
#ifdef __SPF_BUILT_IN_PARSER
void PushPop_Flag_temp(str, i, val)
#else
void PushPop_Flag(str, i, val)
#endif
char *str;
int *i;
int val;
@@ -1006,11 +978,7 @@ void PushPop_Flag(str, i, val)
char * Tool_Unparse_Type();
#ifdef __SPF_BUILT_IN_PARSER
char* Tool_Unparse_Symbol_temp(symb)
#else
char *Tool_Unparse_Symbol (symb)
#endif
PTR_SYMB symb;
{
PTR_TYPE ov_type;
@@ -1103,11 +1071,7 @@ typedef struct
#define COMP_DIFF 1
#ifdef __SPF_BUILT_IN_PARSER
void Get_Type_Operand_temp(str, iptr, ptype, Op)
#else
void Get_Type_Operand (str, iptr, ptype,Op)
#endif
char *str;
int *iptr;
PTR_TYPE ptype;
@@ -1154,11 +1118,7 @@ void Get_Type_Operand (str, iptr, ptype,Op)
}
}
#ifdef __SPF_BUILT_IN_PARSER
void Get_LL_Operand_temp(str, iptr, ll, Op)
#else
void Get_LL_Operand (str, iptr, ll, Op)
#endif
char *str;
int *iptr;
PTR_LLND ll;
@@ -1292,11 +1252,7 @@ void Get_LL_Operand (str, iptr, ll, Op)
}
}
#ifdef __SPF_BUILT_IN_PARSER
void Get_Bif_Operand_temp(str, iptr, bif, Op)
#else
void Get_Bif_Operand (str, iptr, bif,Op)
#endif
char *str;
int *iptr;
PTR_BFND bif;
@@ -1504,11 +1460,7 @@ void Get_Bif_Operand (str, iptr, bif,Op)
}
}
#ifdef __SPF_BUILT_IN_PARSER
int GetComp_temp(str, iptr)
#else
int GetComp (str, iptr)
#endif
char *str;
int *iptr;
{
@@ -1531,11 +1483,7 @@ int GetComp (str, iptr)
return Comp;
}
#ifdef __SPF_BUILT_IN_PARSER
int Eval_Type_Condition_temp(str, ptype)
#else
int Eval_Type_Condition(str, ptype)
#endif
char *str;
PTR_TYPE ptype;
{
@@ -1611,11 +1559,7 @@ int Eval_Type_Condition(str, ptype)
}
}
#ifdef __SPF_BUILT_IN_PARSER
int Eval_LLND_Condition_temp(str, ll)
#else
int Eval_LLND_Condition(str, ll)
#endif
char *str;
PTR_LLND ll;
{
@@ -1692,11 +1636,7 @@ int Eval_LLND_Condition(str, ll)
}
}
#ifdef __SPF_BUILT_IN_PARSER
int Eval_Bif_Condition_temp(str, bif)
#else
int Eval_Bif_Condition(str, bif)
#endif
char *str;
PTR_BFND bif;
{
@@ -1772,11 +1712,7 @@ int Eval_Bif_Condition(str, bif)
}
}
#ifdef __SPF_BUILT_IN_PARSER
int SkipToEndif_temp(str)
#else
int SkipToEndif (str)
#endif
char *str;
{
int ifcount_local = 1;
@@ -1806,11 +1742,7 @@ int SkipToEndif (str)
char *Tool_Unparse2_LLnode ();
#ifdef __SPF_BUILT_IN_PARSER
char* Tool_Unparse_Type_temp(ptype)
#else
char *Tool_Unparse_Type (ptype)
#endif
PTR_TYPE ptype;
/*int def;*/ /* def = 1 : defined type */
/* def = 0 : named type */
@@ -2096,11 +2028,7 @@ char *Tool_Unparse_Type (ptype)
return Buf_address;
}
#ifdef __SPF_BUILT_IN_PARSER
char* Tool_Unparse2_LLnode_temp(ll)
#else
char *Tool_Unparse2_LLnode(ll)
#endif
PTR_LLND ll;
{
int variant;
@@ -2631,11 +2559,7 @@ char *Tool_Unparse2_LLnode(ll)
return Buf_address;
}
#ifdef __SPF_BUILT_IN_PARSER
char* Tool_Unparse_Bif_temp(bif)
#else
char *Tool_Unparse_Bif(bif)
#endif
PTR_BFND bif;
{
int variant;

View File

@@ -48,6 +48,5 @@ if (MSVC_IDE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3")
endif()

View File

@@ -131,7 +131,7 @@ static int gcd(int b, int a)
if (b == 1)
return (1);
while (b != 0) {
register int t = b;
int t = b;
b = a % b;
a = t;
};
@@ -1696,9 +1696,9 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
SUBs[e].coef[i] = 0;
if (i <= problemPtr->_safeVars && problemPtr->_var[i] >= 0) {
//register Eqn eqn = &(SUBs[nSUB++]);
//Eqn eqn = &(SUBs[nSUB++]);
problemPtr->addNumSUBs(1);
register Eqn eqn = &(SUBs[nSUB - 1]);
Eqn eqn = &(SUBs[nSUB - 1]);
for (k = nVars; k >= 0; k--)
eqn->coef[k] = 0;
@@ -1723,9 +1723,9 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
SUBs[e].coef[i] = 0;
};
if (i <= problemPtr->_safeVars && problemPtr->_var[i] >= 0) {
//register Eqn eqn = &(SUBs[nSUB++]);
//Eqn eqn = &(SUBs[nSUB++]);
problemPtr->addNumSUBs(1);
register Eqn eqn = &(SUBs[nSUB - 1]);
Eqn eqn = &(SUBs[nSUB - 1]);
for (k = nVars; k >= 1; k--)
eqn->coef[k] = 0;
@@ -1736,7 +1736,7 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
}
else {
for (e = nEQ - 1; e >= 0; e--) {
register Eqn eqn = &(EQs[e]);
Eqn eqn = &(EQs[e]);
k = eqn->coef[i];
if (k != 0) {
k = c * k;
@@ -1752,7 +1752,7 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
};
};
for (e = nGEQ - 1; e >= 0; e--) {
register Eqn eqn = &(GEQs[e]);
Eqn eqn = &(GEQs[e]);
k = eqn->coef[i];
if (k != 0) {
k = c * k;
@@ -1769,7 +1769,7 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
};
};
for (e = nSUB - 1; e >= 0; e--) {
register Eqn eqn = &(SUBs[e]);
Eqn eqn = &(SUBs[e]);
k = eqn->coef[i];
if (k != 0) {
k = c * k;
@@ -1789,7 +1789,7 @@ void substitute(Problem * problemPtr, Eqn sub, int i, int c)
if (DEBUG)
fprintf(outputFile, "---\n\n");
if (i <= problemPtr->_safeVars && problemPtr->_var[i] >= 0) {
register Eqn eqn;
Eqn eqn;
//eqn = &(SUBs[nSUB++]);
problemPtr->addNumSUBs(1);
eqn = &(SUBs[nSUB - 1]);
@@ -1831,7 +1831,7 @@ void substituteRed(Problem *problemPtr, Eqn sub, int i, int c, bool * foundBlack
};
for (e = nEQ - 1; e >= 0; e--) {
register Eqn eqn = &(EQs[e]);
Eqn eqn = &(EQs[e]);
k = eqn->coef[i];
if (k != 0) {
if (!eqn->color)
@@ -1851,7 +1851,7 @@ void substituteRed(Problem *problemPtr, Eqn sub, int i, int c, bool * foundBlack
};
};
for (e = nGEQ - 1; e >= 0; e--) {
register Eqn eqn = &(GEQs[e]);
Eqn eqn = &(GEQs[e]);
k = eqn->coef[i];
if (k != 0) {
if (!eqn->color)
@@ -1872,7 +1872,7 @@ void substituteRed(Problem *problemPtr, Eqn sub, int i, int c, bool * foundBlack
};
};
for (e = nSUB - 1; e >= 0; e--) {
register Eqn eqn = &(SUBs[e]);
Eqn eqn = &(SUBs[e]);
k = eqn->coef[i];
if (k != 0) {
if (!eqn->color)
@@ -2001,7 +2001,7 @@ static void doElimination(Problem *problemPtr, int e, int i)
assert(inApproximateMode);
for (e = nEQ - 1; e >= 0; e--)
if (EQs[e].coef[i]) {
register Eqn eqn = &(EQs[e]);
Eqn eqn = &(EQs[e]);
int j, k;
for (j = nV; j >= 0; j--)
eqn->coef[j] *= a;
@@ -2012,7 +2012,7 @@ static void doElimination(Problem *problemPtr, int e, int i)
};
for (e = nGEQ - 1; e >= 0; e--)
if (GEQs[e].coef[i]) {
register Eqn eqn = &(GEQs[e]);
Eqn eqn = &(GEQs[e]);
int j, k;
for (j = nV; j >= 0; j--)
eqn->coef[j] *= a;
@@ -2024,7 +2024,7 @@ static void doElimination(Problem *problemPtr, int e, int i)
};
for (e = nSUB - 1; e >= 0; e--)
if (SUBs[e].coef[i]) {
register Eqn eqn = &(SUBs[e]);
Eqn eqn = &(SUBs[e]);
int j, k;
assert(0);
for (j = nV; j >= 0; j--)
@@ -2074,7 +2074,7 @@ static int solveEQ(Problem *problemPtr, int desiredResult)
/* Eliminate all EQ equations */
for (e = nEQ - 1; e >= 0; e--) {
register Eqn eqn = &(EQs[e]);
Eqn eqn = &(EQs[e]);
int sv;
if (inApproximateMode && !nGEQ && safeVars == nVars)
@@ -2521,7 +2521,7 @@ solveGEQstart:
coupledSubscripts = 1;
}
else {
register int g;
int g;
int topVar;
int i0;
int hashCode;
@@ -2573,7 +2573,7 @@ solveGEQstart:
if (g < 0)
g = -g;
for (; i0 >= 0; i0--) {
register int x;
int x;
i = packing[i0];
x = GEQs[e].coef[i];
hashCode = hashCode * keyMult * (i + 3) + x;
@@ -2588,7 +2588,7 @@ solveGEQstart:
g = gcd(x, g);
};
for (; i0 >= 0; i0--) {
register int x;
int x;
i = packing[i0];
x = GEQs[e].coef[i];
hashCode = hashCode * keyMult * (i + 3) + x;
@@ -2607,7 +2607,7 @@ solveGEQstart:
};
{
register int g2 = abs(hashCode);
int g2 = abs(hashCode);
if (DEBUG) {
fprintf(outputFile, "Hash code = %d, eqn = ", hashCode);
printGEQ(&GEQs[e]);