diff options
author | orivej <[email protected]> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/tools/ragel6/common.h | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/ragel6/common.h')
-rw-r--r-- | contrib/tools/ragel6/common.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/tools/ragel6/common.h b/contrib/tools/ragel6/common.h index 76c3ea49b68..3ee71d26b02 100644 --- a/contrib/tools/ragel6/common.h +++ b/contrib/tools/ragel6/common.h @@ -114,12 +114,12 @@ struct HostType const char *data2; const char *internalName; bool isSigned; - bool isOrd; - bool isChar; - long long sMinVal; - long long sMaxVal; - unsigned long long uMinVal; - unsigned long long uMaxVal; + bool isOrd; + bool isChar; + long long sMinVal; + long long sMaxVal; + unsigned long long uMinVal; + unsigned long long uMaxVal; unsigned int size; }; @@ -128,7 +128,7 @@ struct HostLang /* Target language. */ enum Lang { - C, D, D2, Go, Java, Ruby, CSharp, OCaml + C, D, D2, Go, Java, Ruby, CSharp, OCaml }; Lang lang; @@ -142,12 +142,12 @@ extern HostLang *hostLang; extern HostLang hostLangC; extern HostLang hostLangD; -extern HostLang hostLangD2; -extern HostLang hostLangGo; +extern HostLang hostLangD2; +extern HostLang hostLangGo; extern HostLang hostLangJava; extern HostLang hostLangRuby; extern HostLang hostLangCSharp; -extern HostLang hostLangOCaml; +extern HostLang hostLangOCaml; HostType *findAlphType( const char *s1 ); HostType *findAlphType( const char *s1, const char *s2 ); @@ -176,12 +176,12 @@ struct KeyOps this->alphType = alphType; isSigned = alphType->isSigned; if ( isSigned ) { - minKey = (long) alphType->sMinVal; - maxKey = (long) alphType->sMaxVal; + minKey = (long) alphType->sMinVal; + maxKey = (long) alphType->sMaxVal; } else { - minKey = (long) (unsigned long) alphType->uMinVal; - maxKey = (long) (unsigned long) alphType->uMaxVal; + minKey = (long) (unsigned long) alphType->uMinVal; + maxKey = (long) (unsigned long) alphType->uMaxVal; } } @@ -202,25 +202,25 @@ struct KeyOps HostType *typeSubsumes( long long maxVal ) { - HostType *hostTypes = hostLang->hostTypes; - + HostType *hostTypes = hostLang->hostTypes; + for ( int i = 0; i < hostLang->numHostTypes; i++ ) { - long long typeMaxVal = hostTypes[i].isSigned ? hostTypes[i].sMaxVal : hostTypes[i].uMaxVal; - if ( maxVal <= typeMaxVal ) - return &hostLang->hostTypes[i]; + long long typeMaxVal = hostTypes[i].isSigned ? hostTypes[i].sMaxVal : hostTypes[i].uMaxVal; + if ( maxVal <= typeMaxVal ) + return &hostLang->hostTypes[i]; } - + return 0; } HostType *typeSubsumes( bool isSigned, long long maxVal ) { - HostType *hostTypes = hostLang->hostTypes; - + HostType *hostTypes = hostLang->hostTypes; + for ( int i = 0; i < hostLang->numHostTypes; i++ ) { - long long typeMaxVal = hostTypes[i].isSigned ? hostTypes[i].sMaxVal : hostTypes[i].uMaxVal; - if ( ( ( isSigned && hostTypes[i].isSigned ) || !isSigned ) && - maxVal <= typeMaxVal ) + long long typeMaxVal = hostTypes[i].isSigned ? hostTypes[i].sMaxVal : hostTypes[i].uMaxVal; + if ( ( ( isSigned && hostTypes[i].isSigned ) || !isSigned ) && + maxVal <= typeMaxVal ) return hostLang->hostTypes + i; } return 0; |