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

@@ -15,7 +15,13 @@
#ifdef _NEEDALLOCAH_
# 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;