From f33799d74cfb6d6f532fe7fbdb873e02c2fea4ff Mon Sep 17 00:00:00 2001 From: Fons Rademakers <Fons.Rademakers@cern.ch> Date: Fri, 1 Jun 2001 11:40:13 +0000 Subject: [PATCH] import of CINT 5.14.90. For what is new see http://root.cern.ch/root/Cint.phtml?relnote. git-svn-id: http://root.cern.ch/svn/root/trunk@2351 27541ba8-7e3a-0410-8455-c3a389f83636 --- cint/inc/G__ci.h | 12 ++- cint/include/cstdio | 1 + cint/lib/longlong/longdbl.h | 189 ++++++++++++++++++++++++++++++++++ cint/lib/longlong/longlong.h | 4 +- cint/lib/longlong/setup | 2 +- cint/lib/longlong/setup.bat | 2 +- cint/lib/longlong/setupbc.bat | 2 +- cint/lib/longlong/setuphp | 2 +- cint/src/decl.c | 68 +++++++++++- cint/src/fread.c | 5 + cint/src/newlink.c | 32 +++++- cint/src/parse.c | 7 +- cint/src/sizeof.c | 13 ++- cint/src/tmplt.c | 14 +++ cint/src/typedef.c | 34 ++++++ cint/src/v6_decl.cxx | 68 +++++++++++- cint/src/v6_fread.cxx | 5 + cint/src/v6_newlink.cxx | 32 +++++- cint/src/v6_parse.cxx | 7 +- cint/src/v6_sizeof.cxx | 13 ++- cint/src/v6_tmplt.cxx | 14 +++ cint/src/v6_typedef.cxx | 34 ++++++ 22 files changed, 532 insertions(+), 28 deletions(-) create mode 100644 cint/lib/longlong/longdbl.h diff --git a/cint/inc/G__ci.h b/cint/inc/G__ci.h index e1b492d855e..63535c3b47f 100644 --- a/cint/inc/G__ci.h +++ b/cint/inc/G__ci.h @@ -21,13 +21,16 @@ #ifndef G__CI_H #define G__CI_H -#define G__CINTVERSION 5014089 -#define G__CINTVERSIONSTR "5.14.89, May 20 2001" +#define G__CINTVERSION 5014090 +#define G__CINTVERSIONSTR "5.14.90, May 27 2001" /********************************************************************** * SPECIAL CHANGES and CINT CORE COMPILATION SWITCH **********************************************************************/ +/* Delete following macro for DLL binary compatibility improvement */ +#define G__OLDIMPLEMENTATION1530 + /* Define following macro to enable multi-thread safe libcint and DLL * features. */ /* #define G__MULTITHREADLIBCINT */ @@ -1107,12 +1110,17 @@ struct G__ifunc_table_VMS { **************************************************************************/ struct G__param { int paran; +#ifdef G__OLDIMPLEMENTATION1530 char parameter[G__MAXFUNCPARA][G__ONELINE]; +#endif G__value para[G__MAXFUNCPARA]; #ifndef G__OLDIMPLEMENTATION834 int allparan; struct G__param *next; #endif +#ifndef G__OLDIMPLEMENTATION1530 + char parameter[G__MAXFUNCPARA][G__ONELINE]; +#endif }; diff --git a/cint/include/cstdio b/cint/include/cstdio index 127a90b6d1a..718c25820ab 100644 --- a/cint/include/cstdio +++ b/cint/include/cstdio @@ -1,3 +1,4 @@ namespace std { #include <stdio.h> +typedef FILE FILE; } diff --git a/cint/lib/longlong/longdbl.h b/cint/lib/longlong/longdbl.h new file mode 100644 index 00000000000..d1114ec3baf --- /dev/null +++ b/cint/lib/longlong/longdbl.h @@ -0,0 +1,189 @@ +/* /% C %/ */ +/*********************************************************************** + * cint (C/C++ interpreter) + ************************************************************************ + * Header file lib/longlong/longdbl.h + ************************************************************************ + * Description: + * Support 'long double' + ************************************************************************ + * Copyright(c) 1995~1999 Masaharu Goto (MXJ02154@niftyserve.or.jp) + * + * Permission to use, copy, modify and distribute this software and its + * documentation for non-commercial purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. The author makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + ************************************************************************/ + +#ifndef G__LONGDOUBLE_H +#define G__LONGDOUBLE_H + +#ifndef IOS +#define IOS +#endif + +#ifdef IOS +#include <iostream.h> +//using namespace std; +#endif + +/************************************************************************** +* makecint +**************************************************************************/ +#if defined(__CINT__) + +// #include <bool.h> + +/************************************************************************** +* WIN32 +**************************************************************************/ +#elif defined(_WIN32)||defined(_WINDOWS)||defined(_Windows)||defined(_WINDOWS_) + +typedef long double G__double92; + +/************************************************************************** +* LINUX +**************************************************************************/ +#elif defined(__linux__) + +typedef long double G__double92; + +/************************************************************************** +* OTHER +**************************************************************************/ +#else + +typedef long double G__double92; + +#endif + + +/************************************************************************ +* long double definition +* class G__longdouble is renamed as 'long long' in cint body +************************************************************************/ + +class G__longdouble { + public: + // constructor +#ifndef __CINT__ + G__longdouble(G__double92 x=0) { dat=x; } +#else + G__longdouble(double l=0) { dat = (G__double92)l; } +#endif +#if 0 + G__longdouble(float l) { dat = (G__double92)l; } + G__longdouble(double l) { dat = (G__double92)l; } +#endif + G__longdouble(const G__longdouble& x) { dat=x.dat; } + ~G__longdouble() { } + + // conversion operator + operator double() { return((double)dat); } + + // unary operators + G__longdouble& operator++() { ++dat; return(*this); } + G__longdouble operator++(int dmy) { G__longdouble c(dat++); return(c); } + G__longdouble& operator--() { --dat; return(*this); } + G__longdouble operator--(int dmy) { G__longdouble c(dat--); return(c); } + + // assignment operators + G__longdouble& operator=(const double x) {dat=(G__double92)x;return(*this);} + G__longdouble& operator=(const G__longdouble& x) {dat=x.dat;return(*this); } + G__longdouble& operator+=(const G__longdouble& x) {dat+=x.dat; return(*this); } + G__longdouble& operator-=(const G__longdouble& x) {dat-=x.dat; return(*this); } + G__longdouble& operator*=(const G__longdouble& x) {dat*=x.dat; return(*this); } + G__longdouble& operator/=(const G__longdouble& x) {dat/=x.dat; return(*this); } + + // binary operators + friend G__longdouble operator+(const G__longdouble& a,const G__longdouble& b); + friend G__longdouble operator-(const G__longdouble& a,const G__longdouble& b); + friend G__longdouble operator*(const G__longdouble& a,const G__longdouble& b); + friend G__longdouble operator/(const G__longdouble& a,const G__longdouble& b); + + friend int operator<(const G__longdouble& a,const G__longdouble& b); + friend int operator>(const G__longdouble& a,const G__longdouble& b); + friend int operator<=(const G__longdouble& a,const G__longdouble& b); + friend int operator>=(const G__longdouble& a,const G__longdouble& b); + friend int operator!=(const G__longdouble& a,const G__longdouble& b); + friend int operator==(const G__longdouble& a,const G__longdouble& b); + +#ifdef IOS + friend ostream& operator<<(ostream& ost,const G__longdouble& a); + friend istream& operator>>(istream& ist,G__longdouble& a); +#endif + + private: +#ifndef __CINT__ + G__double92 dat; +#endif +}; + +inline G__longdouble operator+(const G__longdouble& a,const G__longdouble& b){ + G__longdouble c(a.dat+b.dat); + return(c); +} +inline G__longdouble operator-(const G__longdouble& a,const G__longdouble& b){ + G__longdouble c(a.dat-b.dat); + return(c); +} +inline G__longdouble operator*(const G__longdouble& a,const G__longdouble& b){ + G__longdouble c(a.dat*b.dat); + return(c); +} +inline G__longdouble operator/(const G__longdouble& a,const G__longdouble& b){ + G__longdouble c(a.dat/b.dat); + return(c); +} + +inline int operator<(const G__longdouble& a,const G__longdouble& b){ + return(a.dat<b.dat); +} +inline int operator>(const G__longdouble& a,const G__longdouble& b){ + return(a.dat>b.dat); +} +inline int operator<=(const G__longdouble& a,const G__longdouble& b){ + return(a.dat<=b.dat); +} +inline int operator>=(const G__longdouble& a,const G__longdouble& b){ + return(a.dat>=b.dat); +} +inline int operator!=(const G__longdouble& a,const G__longdouble& b){ + return(a.dat!=b.dat); +} +inline int operator==(const G__longdouble& a,const G__longdouble& b){ + return(a.dat==b.dat); +} + +#ifdef IOS +inline ostream& operator<<(ostream& ost,const G__longdouble& a) { + ost << a.dat; + return(ost); +} + +inline istream& operator>>(istream& ist,G__longdouble& a) { + ist >> a.dat; + return(ist); +} +#endif + + +#ifdef __MAKECINT__ +/* +#undef G__REGEXP +#undef G__SHAREDLIB +#undef G__OSFDLL +#pragma eval G__deleteglobal("G__REGEXP"); +#pragma eval G__deleteglobal("G__SHAREDLIB"); +#pragma eval G__deleteglobal("G__OSFDLL"); +#pragma link off global G__REGEXP; +#pragma link off global G__SHAREDLIB; +#pragma link off global G__OSFDLL; +*/ +#endif + + +#endif /* G__LONGLONG_H */ diff --git a/cint/lib/longlong/longlong.h b/cint/lib/longlong/longlong.h index c1081f4767c..0fae2432c54 100644 --- a/cint/lib/longlong/longlong.h +++ b/cint/lib/longlong/longlong.h @@ -137,7 +137,7 @@ class G__longlong { #ifdef IOS friend ostream& operator<<(ostream& ost,const G__longlong& a); - friend istream& operator>>(istream& ist,const G__longlong& a); + friend istream& operator>>(istream& ist,G__longlong& a); #endif private: @@ -225,7 +225,7 @@ inline ostream& operator<<(ostream& ost,const G__longlong& a) { return(ost); } -inline istream& operator>>(istream& ist,const G__longlong& a) { +inline istream& operator>>(istream& ist,G__longlong& a) { //long *upper = (long*)(&a+1); long *lower = (long*)&a; ist >> *lower; diff --git a/cint/lib/longlong/setup b/cint/lib/longlong/setup index 2d3fb672018..5ba30d91a87 100644 --- a/cint/lib/longlong/setup +++ b/cint/lib/longlong/setup @@ -1,4 +1,4 @@ -makecint -mk Makefile -dl $CINTSYSDIR/include/long.dll -H longlong.h -cint -Z0 +makecint -mk Makefile -dl $CINTSYSDIR/include/long.dll -H longlong.h longdbl.h -cint -Z0 make -f Makefile rm G__* Makefile diff --git a/cint/lib/longlong/setup.bat b/cint/lib/longlong/setup.bat index 4d02e222304..dcea7957efd 100644 --- a/cint/lib/longlong/setup.bat +++ b/cint/lib/longlong/setup.bat @@ -1,4 +1,4 @@ -makecint -mk Makefile -dl long.dll -H longlong.h -cint -Z0 +makecint -mk Makefile -dl long.dll -H longlong.h longdbl.h -cint -Z0 nmake -f Makefile CFG="long - Win32 Release" del %cintsysdir%\include\long.dll move Release\long.dll %cintsysdir%\include\long.dll diff --git a/cint/lib/longlong/setupbc.bat b/cint/lib/longlong/setupbc.bat index 75cac0b56e2..2078bdf97f5 100644 --- a/cint/lib/longlong/setupbc.bat +++ b/cint/lib/longlong/setupbc.bat @@ -1,4 +1,4 @@ -makecint -mk Makefile -dl long.dll -H longlong.h -DG__BORLAND -cint -Z0 +makecint -mk Makefile -dl long.dll -H longlong.h longdbl.h -DG__BORLAND -cint -Z0 make.exe -f Makefile del %cintsysdir%\include\long.dll move long.dll %cintsysdir%\include\long.dll diff --git a/cint/lib/longlong/setuphp b/cint/lib/longlong/setuphp index 5da3023a10c..3c479f669e1 100644 --- a/cint/lib/longlong/setuphp +++ b/cint/lib/longlong/setuphp @@ -1,4 +1,4 @@ -makecint -mk Makefile -dl $CINTSYSDIR/include/long.dll -H longlong.h -cint -M0x1c -Z0 +makecint -mk Makefile -dl $CINTSYSDIR/include/long.dll -H longlong.h longdbl.h -cint -M0x1c -Z0 make -f Makefile rm G__* Makefile diff --git a/cint/src/decl.c b/cint/src/decl.c index 19be2caaa3b..77b894f5cc1 100644 --- a/cint/src/decl.c +++ b/cint/src/decl.c @@ -112,7 +112,11 @@ char *new_name; } #endif - if(strcmp(new_name,"double")==0) { + if(strcmp(new_name,"double")==0 +#ifndef G__OLDIMPLEMENTATION1533 + && 'l'!=G__var_type +#endif + ) { cin=G__fgetvarname(new_name,",;=():"); G__var_type='d'; } @@ -139,6 +143,10 @@ char *new_name; G__def_struct_member = store_def_struct_member; #endif } +#ifndef G__OLDIMPLEMENTATION1533 + G__tagnum=G__defined_tagname("G__longdouble",2); + G__typenum=G__search_typename("long double",'u',G__tagnum,G__PARANORMAL); +#endif G__tagnum=G__defined_tagname("G__longlong",2); if(-1==G__tagnum) { G__genericerror("Error: 'long long' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); @@ -175,6 +183,59 @@ char *new_name; G__decl=store_decl; return(0); } +#endif +#ifndef G__OLDIMPLEMENTATION1533 + else if( + 'l'==G__var_type && + (strcmp(new_name,"double")==0 || + strcmp(new_name,"double*")==0 || + strcmp(new_name,"double**")==0 || + strcmp(new_name,"double&")==0)) { + int store_tagnum = G__tagnum; + int store_typenum = G__typenum; + int store_decl = G__decl; + if(0==G__defined_macro("G__LONGLONG_H")) { +#ifndef G__OLDIMPLEMENTATION1153 + int store_def_struct_member = G__def_struct_member; + G__def_struct_member = 0; +#endif + G__decl=0; + G__loadfile("long.dll"); /* used to switch case between .dl and .dll */ + G__decl=1; +#ifndef G__OLDIMPLEMENTATION1153 + G__def_struct_member = store_def_struct_member; +#endif + } + G__tagnum=G__defined_tagname("G__longlong",2); + G__typenum=G__search_typename("long long",'u',G__tagnum,G__PARANORMAL); + G__tagnum=G__defined_tagname("G__longdouble",2); + if(-1==G__tagnum) { + G__genericerror("Error: 'long double' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); + } + G__typenum=G__search_typename("long double",'u',G__tagnum,G__PARANORMAL); + if(strcmp(new_name,"double")==0) { + G__var_type='u'; + G__reftype = G__PARANORMAL; + } + else if(strcmp(new_name,"double*")==0) { + G__var_type='U'; + G__reftype = G__PARANORMAL; + } + else if(strcmp(new_name,"double**")==0) { + G__var_type='U'; + G__reftype = G__PARAP2P; + } + else if(strcmp(new_name,"double&")==0) { + G__var_type='u'; + G__reftype = G__PARAREFERENCE; + } + G__define_var(G__tagnum,G__typenum); + G__var_type='p'; + G__tagnum=store_tagnum; + G__typenum=store_typenum; + G__decl=store_decl; + return(0); + } #endif else if(strcmp(new_name,"unsigned")==0||strcmp(new_name,"signed")==0) { cin=G__fgetvarname(new_name,",;=():"); @@ -2861,6 +2922,11 @@ char *new_name; } #endif +#ifndef G__OLDIMPLEMENTATION1535 + if(0==G__asm_noverflow && 1==G__no_exec_compile) { + G__no_exec = 1; + } +#endif /********************************************************** * read upto next , or ; **********************************************************/ diff --git a/cint/src/fread.c b/cint/src/fread.c index 514c4fc8f42..737f3ec73bb 100644 --- a/cint/src/fread.c +++ b/cint/src/fread.c @@ -250,6 +250,11 @@ char *string,*endmark; /* A<A<int> > */ string[i++]=' '; } +#endif +#ifndef G__OLDIMPLEMENTATION1531 + else if(i>2 && isspace(string[i-1]) && '>'!=string[i-2]) { + --i; + } #endif } spaceflag=1; diff --git a/cint/src/newlink.c b/cint/src/newlink.c index 03dc5c2e296..95c21482ca1 100644 --- a/cint/src/newlink.c +++ b/cint/src/newlink.c @@ -7168,7 +7168,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(0==regexec(&re,ifunc->funcname[i],(size_t)0,(regmatch_t*)NULL,0)){ + if(0==regexec(&re,ifunc->funcname[i],(size_t)0,(regmatch_t*)NULL,0) +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ){ ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7191,7 +7197,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(0!=regex(re,ifunc->funcname[i])){ + if(0!=regex(re,ifunc->funcname[i]) +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ){ ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7211,7 +7223,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(strncmp(buf,ifunc->funcname[i],hash)==0) { + if(strncmp(buf,ifunc->funcname[i],hash)==0 +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ) { ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7231,7 +7249,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(strcmp(buf,ifunc->funcname[i])==0) { + if(strcmp(buf,ifunc->funcname[i])==0 +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ) { ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; diff --git a/cint/src/parse.c b/cint/src/parse.c index 91d1f5e3e08..49b98b95e6c 100644 --- a/cint/src/parse.c +++ b/cint/src/parse.c @@ -2389,8 +2389,8 @@ G__value G__exec_if() /* if(G__return!=G__RETURN_NON)return(result); */ #ifdef G__ASM_DBG if(G__asm_dbg) - G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:1)\n" - ,store_no_exec_compile); + G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:1) %d\n" + ,store_no_exec_compile,G__asm_noverflow); #endif G__no_exec_compile=store_no_exec_compile; G__no_exec=0; @@ -2501,7 +2501,8 @@ G__value G__exec_if() G__no_exec_compile=store_no_exec_compile; #ifdef G__ASM_DBG if(G__asm_dbg) - G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:2)\n",store_no_exec_compile); + G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:2) %d\n" + ,store_no_exec_compile,G__asm_noverflow); #endif G__no_exec=0; } diff --git a/cint/src/sizeof.c b/cint/src/sizeof.c index b61de262d8e..22066192e03 100644 --- a/cint/src/sizeof.c +++ b/cint/src/sizeof.c @@ -246,9 +246,18 @@ char *typename; if((strcmp(typename,"float")==0)|| (strcmp(typename,"float")==0)) return(sizeof(float)); - if((strcmp(typename,"double")==0)|| - (strcmp(typename,"longdouble")==0)) + if((strcmp(typename,"double")==0) +#ifdef G__OLDIMPLEMENTATION1533 + ||(strcmp(typename,"longdouble")==0) +#endif + ) return(sizeof(double)); +#ifndef G__OLDIMPLEMENTATION1533 + if(strcmp(typename,"longdouble")==0) { + int tagnum = G__defined_tagname("G__longdouble",2); + return(G__struct.size[tagnum]); + } +#endif if(strcmp(typename,"void")==0) #ifndef G__OLDIMPLEMENTATION930 return(sizeof(void*)); diff --git a/cint/src/tmplt.c b/cint/src/tmplt.c index d5db6f178ba..8ccf0283533 100644 --- a/cint/src/tmplt.c +++ b/cint/src/tmplt.c @@ -2540,6 +2540,9 @@ int funcmatch; basetagnum = tagnum; bmatch=0; while(0==bmatch && bn<basen) { +#ifndef G__OLDIMPLEMENTATION1532 + int nest=0; +#endif cnt=0; if(bn>=0) basetagnum = G__struct.baseclass[tagnum]->basetagnum[bn]; ++bn; @@ -2556,9 +2559,20 @@ int funcmatch; *p = 0; /* ^ ^ ^ */ ++p; /* ^ ^ ^ */ cntarg[cnt++] = p; +#ifndef G__OLDIMPLEMENTATION1532 + while((0!=(*p) && ','!=(*p) && '>'!=(*p)) || nest) { + if('<'==(*p)) ++nest; + else if('>'==(*p)) --nest; + ++p; + } +#else while(0!=(*p) && ','!=(*p) && '>'!=(*p)) ++p; +#endif } while(','==(*p)); if('>'==(*p)) *p = 0; /* the last '>' */ +#ifndef G__OLDIMPLEMENTATION1532 + if(' '== (*(p-1))) *(p-1) = 0; +#endif /* match template argument */ #ifndef G__OLDIMPLEMENTATION1116 if(fnt>cnt) {/* unmatch */ diff --git a/cint/src/typedef.c b/cint/src/typedef.c index a34ef4a5734..6476dcf77b6 100644 --- a/cint/src/typedef.c +++ b/cint/src/typedef.c @@ -513,6 +513,11 @@ void G__define_type() G__def_struct_member = store_def_struct_member; #endif } +#ifndef G__OLDIMPLEMENTATION1533 + strcpy(tagname,"G__longdouble"); + itemp=G__defined_tagname(tagname,2); + G__search_typename("long double",'u',itemp,G__PARANORMAL); +#endif strcpy(tagname,"G__longlong"); itemp=G__defined_tagname(tagname,2); if(-1==itemp) { @@ -524,6 +529,35 @@ void G__define_type() c=G__fgetname(typename,";,["); } #endif +#ifndef G__OLDIMPLEMENTATION1533 + if(strcmp(typename,"double")==0) { + if('l'==type) { + if(0==G__defined_macro("G__LONGLONG_H")) { +#ifndef G__OLDIMPLEMENTATION1153 + int store_def_struct_member = G__def_struct_member; + G__def_struct_member = 0; +#endif + G__loadfile("long.dll"); /* used to switch case between .dl and .dll */ +#ifndef G__OLDIMPLEMENTATION1153 + G__def_struct_member = store_def_struct_member; +#endif + } + + strcpy(tagname,"G__longlong"); + itemp=G__defined_tagname(tagname,2); + G__search_typename("long long",'u',itemp,G__PARANORMAL); + + strcpy(tagname,"G__longdouble"); + itemp=G__defined_tagname(tagname,2); + if(-1==itemp) { + G__genericerror("Error: 'long double' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); + } + G__search_typename("long double",'u',itemp,G__PARANORMAL); + type='u'; + } + c=G__fgetname(typename,";,["); + } +#endif /* in case of * typedef unsigned long int int32; diff --git a/cint/src/v6_decl.cxx b/cint/src/v6_decl.cxx index 19be2caaa3b..77b894f5cc1 100644 --- a/cint/src/v6_decl.cxx +++ b/cint/src/v6_decl.cxx @@ -112,7 +112,11 @@ char *new_name; } #endif - if(strcmp(new_name,"double")==0) { + if(strcmp(new_name,"double")==0 +#ifndef G__OLDIMPLEMENTATION1533 + && 'l'!=G__var_type +#endif + ) { cin=G__fgetvarname(new_name,",;=():"); G__var_type='d'; } @@ -139,6 +143,10 @@ char *new_name; G__def_struct_member = store_def_struct_member; #endif } +#ifndef G__OLDIMPLEMENTATION1533 + G__tagnum=G__defined_tagname("G__longdouble",2); + G__typenum=G__search_typename("long double",'u',G__tagnum,G__PARANORMAL); +#endif G__tagnum=G__defined_tagname("G__longlong",2); if(-1==G__tagnum) { G__genericerror("Error: 'long long' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); @@ -175,6 +183,59 @@ char *new_name; G__decl=store_decl; return(0); } +#endif +#ifndef G__OLDIMPLEMENTATION1533 + else if( + 'l'==G__var_type && + (strcmp(new_name,"double")==0 || + strcmp(new_name,"double*")==0 || + strcmp(new_name,"double**")==0 || + strcmp(new_name,"double&")==0)) { + int store_tagnum = G__tagnum; + int store_typenum = G__typenum; + int store_decl = G__decl; + if(0==G__defined_macro("G__LONGLONG_H")) { +#ifndef G__OLDIMPLEMENTATION1153 + int store_def_struct_member = G__def_struct_member; + G__def_struct_member = 0; +#endif + G__decl=0; + G__loadfile("long.dll"); /* used to switch case between .dl and .dll */ + G__decl=1; +#ifndef G__OLDIMPLEMENTATION1153 + G__def_struct_member = store_def_struct_member; +#endif + } + G__tagnum=G__defined_tagname("G__longlong",2); + G__typenum=G__search_typename("long long",'u',G__tagnum,G__PARANORMAL); + G__tagnum=G__defined_tagname("G__longdouble",2); + if(-1==G__tagnum) { + G__genericerror("Error: 'long double' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); + } + G__typenum=G__search_typename("long double",'u',G__tagnum,G__PARANORMAL); + if(strcmp(new_name,"double")==0) { + G__var_type='u'; + G__reftype = G__PARANORMAL; + } + else if(strcmp(new_name,"double*")==0) { + G__var_type='U'; + G__reftype = G__PARANORMAL; + } + else if(strcmp(new_name,"double**")==0) { + G__var_type='U'; + G__reftype = G__PARAP2P; + } + else if(strcmp(new_name,"double&")==0) { + G__var_type='u'; + G__reftype = G__PARAREFERENCE; + } + G__define_var(G__tagnum,G__typenum); + G__var_type='p'; + G__tagnum=store_tagnum; + G__typenum=store_typenum; + G__decl=store_decl; + return(0); + } #endif else if(strcmp(new_name,"unsigned")==0||strcmp(new_name,"signed")==0) { cin=G__fgetvarname(new_name,",;=():"); @@ -2861,6 +2922,11 @@ char *new_name; } #endif +#ifndef G__OLDIMPLEMENTATION1535 + if(0==G__asm_noverflow && 1==G__no_exec_compile) { + G__no_exec = 1; + } +#endif /********************************************************** * read upto next , or ; **********************************************************/ diff --git a/cint/src/v6_fread.cxx b/cint/src/v6_fread.cxx index 514c4fc8f42..737f3ec73bb 100644 --- a/cint/src/v6_fread.cxx +++ b/cint/src/v6_fread.cxx @@ -250,6 +250,11 @@ char *string,*endmark; /* A<A<int> > */ string[i++]=' '; } +#endif +#ifndef G__OLDIMPLEMENTATION1531 + else if(i>2 && isspace(string[i-1]) && '>'!=string[i-2]) { + --i; + } #endif } spaceflag=1; diff --git a/cint/src/v6_newlink.cxx b/cint/src/v6_newlink.cxx index 03dc5c2e296..95c21482ca1 100644 --- a/cint/src/v6_newlink.cxx +++ b/cint/src/v6_newlink.cxx @@ -7168,7 +7168,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(0==regexec(&re,ifunc->funcname[i],(size_t)0,(regmatch_t*)NULL,0)){ + if(0==regexec(&re,ifunc->funcname[i],(size_t)0,(regmatch_t*)NULL,0) +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ){ ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7191,7 +7197,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(0!=regex(re,ifunc->funcname[i])){ + if(0!=regex(re,ifunc->funcname[i]) +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ){ ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7211,7 +7223,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(strncmp(buf,ifunc->funcname[i],hash)==0) { + if(strncmp(buf,ifunc->funcname[i],hash)==0 +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ) { ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; @@ -7231,7 +7249,13 @@ int link_stub; #endif while(ifunc) { for(i=0;i<ifunc->allifunc;i++) { - if(strcmp(buf,ifunc->funcname[i])==0) { + if(strcmp(buf,ifunc->funcname[i])==0 +#ifndef G__OLDIMPLEMENTATION1534 + && (-1==ifunc->para_p_tagtable[i][1] || + strncmp(G__struct.name[ifunc->para_p_tagtable[i][1]] + ,"G__CINT_",8)!=0) +#endif + ) { ifunc->globalcomp[i] = globalcomp; #ifndef G__OLDIMPLEMENTATION1138 ++done; diff --git a/cint/src/v6_parse.cxx b/cint/src/v6_parse.cxx index 91d1f5e3e08..49b98b95e6c 100644 --- a/cint/src/v6_parse.cxx +++ b/cint/src/v6_parse.cxx @@ -2389,8 +2389,8 @@ G__value G__exec_if() /* if(G__return!=G__RETURN_NON)return(result); */ #ifdef G__ASM_DBG if(G__asm_dbg) - G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:1)\n" - ,store_no_exec_compile); + G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:1) %d\n" + ,store_no_exec_compile,G__asm_noverflow); #endif G__no_exec_compile=store_no_exec_compile; G__no_exec=0; @@ -2501,7 +2501,8 @@ G__value G__exec_if() G__no_exec_compile=store_no_exec_compile; #ifdef G__ASM_DBG if(G__asm_dbg) - G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:2)\n",store_no_exec_compile); + G__fprinterr(G__serr," G__no_exec_compile %d(G__exec_if:2) %d\n" + ,store_no_exec_compile,G__asm_noverflow); #endif G__no_exec=0; } diff --git a/cint/src/v6_sizeof.cxx b/cint/src/v6_sizeof.cxx index b61de262d8e..22066192e03 100644 --- a/cint/src/v6_sizeof.cxx +++ b/cint/src/v6_sizeof.cxx @@ -246,9 +246,18 @@ char *typename; if((strcmp(typename,"float")==0)|| (strcmp(typename,"float")==0)) return(sizeof(float)); - if((strcmp(typename,"double")==0)|| - (strcmp(typename,"longdouble")==0)) + if((strcmp(typename,"double")==0) +#ifdef G__OLDIMPLEMENTATION1533 + ||(strcmp(typename,"longdouble")==0) +#endif + ) return(sizeof(double)); +#ifndef G__OLDIMPLEMENTATION1533 + if(strcmp(typename,"longdouble")==0) { + int tagnum = G__defined_tagname("G__longdouble",2); + return(G__struct.size[tagnum]); + } +#endif if(strcmp(typename,"void")==0) #ifndef G__OLDIMPLEMENTATION930 return(sizeof(void*)); diff --git a/cint/src/v6_tmplt.cxx b/cint/src/v6_tmplt.cxx index d5db6f178ba..8ccf0283533 100644 --- a/cint/src/v6_tmplt.cxx +++ b/cint/src/v6_tmplt.cxx @@ -2540,6 +2540,9 @@ int funcmatch; basetagnum = tagnum; bmatch=0; while(0==bmatch && bn<basen) { +#ifndef G__OLDIMPLEMENTATION1532 + int nest=0; +#endif cnt=0; if(bn>=0) basetagnum = G__struct.baseclass[tagnum]->basetagnum[bn]; ++bn; @@ -2556,9 +2559,20 @@ int funcmatch; *p = 0; /* ^ ^ ^ */ ++p; /* ^ ^ ^ */ cntarg[cnt++] = p; +#ifndef G__OLDIMPLEMENTATION1532 + while((0!=(*p) && ','!=(*p) && '>'!=(*p)) || nest) { + if('<'==(*p)) ++nest; + else if('>'==(*p)) --nest; + ++p; + } +#else while(0!=(*p) && ','!=(*p) && '>'!=(*p)) ++p; +#endif } while(','==(*p)); if('>'==(*p)) *p = 0; /* the last '>' */ +#ifndef G__OLDIMPLEMENTATION1532 + if(' '== (*(p-1))) *(p-1) = 0; +#endif /* match template argument */ #ifndef G__OLDIMPLEMENTATION1116 if(fnt>cnt) {/* unmatch */ diff --git a/cint/src/v6_typedef.cxx b/cint/src/v6_typedef.cxx index a34ef4a5734..6476dcf77b6 100644 --- a/cint/src/v6_typedef.cxx +++ b/cint/src/v6_typedef.cxx @@ -513,6 +513,11 @@ void G__define_type() G__def_struct_member = store_def_struct_member; #endif } +#ifndef G__OLDIMPLEMENTATION1533 + strcpy(tagname,"G__longdouble"); + itemp=G__defined_tagname(tagname,2); + G__search_typename("long double",'u',itemp,G__PARANORMAL); +#endif strcpy(tagname,"G__longlong"); itemp=G__defined_tagname(tagname,2); if(-1==itemp) { @@ -524,6 +529,35 @@ void G__define_type() c=G__fgetname(typename,";,["); } #endif +#ifndef G__OLDIMPLEMENTATION1533 + if(strcmp(typename,"double")==0) { + if('l'==type) { + if(0==G__defined_macro("G__LONGLONG_H")) { +#ifndef G__OLDIMPLEMENTATION1153 + int store_def_struct_member = G__def_struct_member; + G__def_struct_member = 0; +#endif + G__loadfile("long.dll"); /* used to switch case between .dl and .dll */ +#ifndef G__OLDIMPLEMENTATION1153 + G__def_struct_member = store_def_struct_member; +#endif + } + + strcpy(tagname,"G__longlong"); + itemp=G__defined_tagname(tagname,2); + G__search_typename("long long",'u',itemp,G__PARANORMAL); + + strcpy(tagname,"G__longdouble"); + itemp=G__defined_tagname(tagname,2); + if(-1==itemp) { + G__genericerror("Error: 'long double' not ready. Go to $CINTSYSDIR/lib/longlong and run setup"); + } + G__search_typename("long double",'u',itemp,G__PARANORMAL); + type='u'; + } + c=G__fgetname(typename,";,["); + } +#endif /* in case of * typedef unsigned long int int32; -- GitLab