blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8ddb8cc1fae5e02286c829d7255d3a59bca7ec5c | 305fcec4e4cb01dbcc0ccb779a227649d1199cf2 | /LongWordsDiv2.cpp | 0ad5cbbb4bde56cf1d1f656f86f9a84541ddd90d | [] | no_license | Taxiway/TC_Codes | 3b47e22f901a480d3b8291d560a61395be862840 | 05815b3ec8d320f7ad8b99fc4fa2d3d11eb44f04 | refs/heads/master | 2020-12-24T17:08:23.672337 | 2014-12-26T09:24:20 | 2014-12-26T09:24:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,551 | cpp | // Orz AekdyCoin 福大核武景润后人
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <functional>
#include <cctype>
#include <string>
using namespace std;
#define all(X) (X).begin(), (X).end()
#define sz(a) int((a).size())
typedef long long ll;
class LongWordsDiv2
{
public:
string find(string word);
};
bool isok(string s1, string s2)
{
set<char> st;
for (int i = 0; i < sz(s1); ++i) st.insert(s1[i]);
for (int i = 0; i < sz(s2); ++i) {
if (st.count(s2[i])) return false;
}
return true;
}
string LongWordsDiv2::find(string word)
{
for (int i = 1; i < sz(word); ++i) {
if (word[i] == word[i - 1]) return "Dislikes";
}
for (int i = 0; i < sz(word); ++i) {
for (int j = i + 1; j < sz(word); ++j) {
if (word[i] == word[j]) {
if (!isok(word.substr(i + 1, j - i - 1), word.substr(j + 1))) return "Dislikes";
}
}
}
return "Likes";
}
// BEGIN CUT HERE
/*
// PROBLEM STATEMENT
// Fox Ciel likes all the words that have the following properties:
Each letter of the word is an uppercase English letter.
Equal letters are never consecutive.
There is no subsequence of the form xyxy, where x and y are (not necessarily distinct) letters. Note that a subsequence doesn't have to be contiguous.
Examples:
Ciel does not like "ABBA" because there are two consecutive 'B's.
Ciel does not like "THETOPCODER" because it contains the subsequence "TETE".
Ciel does not like "ABACADA" because it contains the subsequence "AAAA". (Note that here x=y='A'.)
Ciel likes "A", "ABA", and also "ABCBA".
Given a string word, return "Likes" (quotes for clarity) if Ciel likes word and "Dislikes" if she does not.
DEFINITION
Class:LongWordsDiv2
Method:find
Parameters:string
Returns:string
Method signature:string find(string word)
CONSTRAINTS
-word will contain between 1 and 100 characters, inclusive.
-Each character of word will be an uppercase English letter ('A'-'Z').
EXAMPLES
0)
"AAA"
Returns: "Dislikes"
1)
"ABCBA"
Returns: "Likes"
2)
"ABCBAC"
Returns: "Dislikes"
3)
"TOPCODER"
Returns: "Likes"
4)
"VAMOSGIMNASIA"
Returns: "Dislikes"
5)
"SINGLEROUNDMATCH"
Returns: "Likes"
6)
"DALELOBO"
Returns: "Likes"
*/
#define ARRSIZE(x) (sizeof(x)/sizeof(x[0]))
template<typename T>
void print(T a) {
cerr << a;
}
void print(long long a) {
cerr << a << "LL";
}
void print(string a) {
cerr << '"' << a << '"';
}
template<typename T>
void print(vector<T> a) {
cerr << "{";
for (unsigned i = 0; i != a.size(); i++) {
if (i != 0) cerr << ", ";
print(a[i]);
}
cerr << "}" << endl;
}
template<typename T>
void eq(int n, T have, T need) {
if (have == need) {
cerr << "Case " << n << " passed." << endl;
} else {
cerr << "Case " << n << " failed: expected ";
print(need);
cerr << " received ";
print(have);
cerr << "." << endl;
}
}
template<typename T>
void eq(int n, vector<T> have, vector<T> need) {
if(have.size() != need.size()) {
cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements.";
print(have);
print(need);
return;
}
for(unsigned i = 0; i < have.size(); i++) {
if(have[i] != need[i]) {
cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << ".";
print(have);
print(need);
return;
}
}
cerr << "Case " << n << " passed." << endl;
}
void eq(int n, string have, string need) {
if (have == need) {
cerr << "Case " << n << " passed." << endl;
} else {
cerr << "Case " << n << " failed: expected ";
print(need);
cerr << " received ";
print(have);
cerr << "." << endl;
}
}
int main() {
{
LongWordsDiv2 theObject;
eq(0, theObject.find("AAA"),"Dislikes");
}
{
LongWordsDiv2 theObject;
eq(1, theObject.find("ABCBA"),"Likes");
}
{
LongWordsDiv2 theObject;
eq(2, theObject.find("ABCBAC"),"Dislikes");
}
{
LongWordsDiv2 theObject;
eq(3, theObject.find("TOPCODER"),"Likes");
}
{
LongWordsDiv2 theObject;
eq(4, theObject.find("VAMOSGIMNASIA"),"Dislikes");
}
{
LongWordsDiv2 theObject;
eq(5, theObject.find("SINGLEROUNDMATCH"),"Likes");
}
{
LongWordsDiv2 theObject;
eq(6, theObject.find("DALELOBO"),"Likes");
}
}
// END CUT HERE
| [
"hang.hang.zju@gmail.com"
] | hang.hang.zju@gmail.com |
09d4a330af4ed4a349c019248f0e0adbe9131f98 | 965337cc304e01ffbe4937e060282c3eba10ad5e | /launcher.h | 97f15287e88c2757635356708164f25f546426b6 | [] | no_license | GuiBret/MusicDownloader | d77946de07fb1eb743856c7d20ddbcc72182ef3d | af3fa319263b76f877f1ddc76f54f1862c005ad4 | refs/heads/master | 2021-01-12T17:27:49.140195 | 2016-12-11T21:21:36 | 2016-12-11T21:21:36 | 71,575,501 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,393 | h | #ifndef LAUNCHER_H
#define LAUNCHER_H
#include <QMainWindow>
#include <QFileDialog>
#include <QProcess>
#include <QDebug>
#include <QMessageBox>
#include <QEventLoop>
#include <QClipboard>
#include "downloaddisplay.h"
#include "downloadprofile.h"
#include "download.h"
class MyProcess;
class Download;
class DownloadDisplay;
namespace Ui {
class Launcher;
}
class Launcher : public QMainWindow
{
Q_OBJECT
friend class Download;
public:
explicit Launcher(QWidget *parent = 0);
~Launcher();
QString getCodec();
QString getUrl();
QString getPath();
QString getCurrentFileName();
QVector<Download *> downloadList;
private:
Ui::Launcher *ui;
QString videoUrl;
QString videoName;
DownloadDisplay *downloads;
bool download_started;
QClipboard *cb;
QString currentFileName = "";
void checkYoutubeDlInstall();
Download *searchDownload(QString filename);
QUrl getThumbnailUrl(QString url);
private slots:
void browseFileLocation();
void checkUrlValidity();
void downloadFile();
void checkClipboard();
void searchThumbnail();
void handleDownloadFinished();
QVector<Download *> getDownloadList();
signals:
void downloadStarted();
void profileAdded();
void validUrl();
void youtubeDlNotInstalled();
void downloadInstanceCreated(Download *d);
};
#endif // LAUNCHER_H
| [
"guillaume.bretzner@gmail.com"
] | guillaume.bretzner@gmail.com |
bb12e3671d9af83ec46047f1636dfb65132479c8 | 4a48e01886c76b4067bfac67f547f0daac904da0 | /singleLDA/lda.h | 83aaa36bc2c5b40cf2bca86bfea415b1b7c94128 | [
"Apache-2.0"
] | permissive | guzhaki/lda | 6c2c52b1c0c573b3ae6c6cf179128f33b67b446f | 74ec742481f5209828c8f937324d4f2a1487affb | refs/heads/master | 2021-01-18T03:17:09.101220 | 2015-05-18T06:28:52 | 2015-05-18T06:28:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,488 | h | #ifndef _LDA_H
#define _LDA_H
#include <iostream>
#include <thread>
#include <chrono>
#include <vector>
#include <queue>
#include "model.h"
#include "utils.h"
#include "vose.h"
#include "fTree.h"
#include "forest.h"
class simpleLDA : public model
{
public:
// estimate LDA model using Gibbs sampling
int specific_init();
int sampling(int m);
};
class unifLDA : public model
{
public:
// estimate LDA using Metropolis within Gibbs with uniform proposal
int specific_init();
int sampling(int m);
};
class sparseLDA : public model
{
public:
std::vector< std::vector< std::pair<int, int> > > nws;
double ssum, rsum, qsum;
double *q1;
// estimate LDA model using sparse strategy of Yao09
int specific_init();
int sampling(int m);
};
class aliasLDA : public model
{
public:
std::vector<voseAlias*> q;
// estimate LDA model using alias sampling
int specific_init();
int sampling(int m);
void generateQtable(int i);
~aliasLDA()
{
for(int w=0; w<V; ++w)
delete q[w];
}
};
class FTreeLDA : public model
{
public:
fTree *trees;
// estimate LDA model using F+ Tree
int specific_init();
int sampling(int m);
};
class forestLDA : public model
{
public:
forestSample *q;
// estimate LDA model using alias sampling
int specific_init();
int sampling(int m);
};
class lightLDA : public model
{
public:
std::vector<voseAlias> q;
// estimate LDA model using alias sampling
int specific_init();
int sampling(int m);
void generateQtable(int i);
};
#endif
| [
"manzilzaheer@gmail.com"
] | manzilzaheer@gmail.com |
4f48dbbd976a5ffdc476da264188d3a2c676becd | e6c5596143f831c4613047d98d5754760e7bc752 | /CGP_Assignment/Code/Component/G_Timer.h | 40b5d5c2c6461ba65e46b7e12307ddbce0e09ffc | [] | no_license | liaukx-tarc/CGP_Assignment | 9a8c816e1bbe25ceccd21a380b57337aabf92e1d | 3ee3da6381e2ca3dd2be83f0374854a36db2eeec | refs/heads/master | 2023-04-02T01:25:55.288396 | 2021-04-06T23:01:30 | 2021-04-06T23:01:30 | 339,525,577 | 0 | 1 | null | 2021-04-06T23:01:31 | 2021-02-16T20:41:44 | C++ | UTF-8 | C++ | false | false | 344 | h | #ifndef G_TIMER
#define G_TIMER
#include <Windows.h>
class G_Timer {
public:
G_Timer();
~G_Timer();
void init(int);
int framesToUpdate();
private:
LARGE_INTEGER timerFreq;
LARGE_INTEGER timeNow;
LARGE_INTEGER timePrevious;
int Requested_FPS, frameToUpdate;
float intervalsPerFrame, intervalsSinceLastUpdate;
};
#endif // !G_TIMER | [
"liaukx@student.tarc.edu.my"
] | liaukx@student.tarc.edu.my |
966f84ee573742b6a97dd133c044913fe098e59c | 98284cb780bdec9381eb3f96b5bcaad6c5b9abc9 | /src/lib/Transform/Canonicalization.cpp | 0e746757763f45932267f4065c1942624a07022e | [
"NCSA"
] | permissive | nimit-singhania/loopy | a816dffc06ab78d10ede8d27d83a7319080925d3 | 1d87522ef6a7e206e67bf4dd3041fefe5b740c6f | refs/heads/master | 2021-01-11T11:57:45.513338 | 2019-01-31T14:18:56 | 2019-01-31T14:18:56 | 69,502,154 | 18 | 5 | null | 2019-01-31T14:18:57 | 2016-09-28T20:43:11 | C | UTF-8 | C++ | false | false | 2,527 | cpp | //===---- Canonicalization.cpp - Run canonicalization passes ======-------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Run the set of default canonicalization passes.
//
// This pass is mainly used for debugging.
//
//===----------------------------------------------------------------------===//
#include "polly/LinkAllPasses.h"
#include "polly/Canonicalization.h"
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
using namespace polly;
void polly::registerCanonicalicationPasses(llvm::legacy::PassManagerBase &PM) {
PM.add(llvm::createPromoteMemoryToRegisterPass());
PM.add(llvm::createInstructionCombiningPass());
PM.add(llvm::createCFGSimplificationPass());
PM.add(llvm::createTailCallEliminationPass());
PM.add(llvm::createCFGSimplificationPass());
PM.add(llvm::createReassociatePass());
PM.add(llvm::createLoopRotatePass());
PM.add(llvm::createInstructionCombiningPass());
PM.add(llvm::createIndVarSimplifyPass());
PM.add(polly::createCodePreparationPass());
}
namespace {
class PollyCanonicalize : public ModulePass {
PollyCanonicalize(const PollyCanonicalize &) = delete;
const PollyCanonicalize &operator=(const PollyCanonicalize &) = delete;
public:
static char ID;
explicit PollyCanonicalize() : ModulePass(ID) {}
~PollyCanonicalize();
/// @name FunctionPass interface.
//@{
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void releaseMemory();
virtual bool runOnModule(Module &M);
virtual void print(raw_ostream &OS, const Module *) const;
//@}
};
}
PollyCanonicalize::~PollyCanonicalize() {}
void PollyCanonicalize::getAnalysisUsage(AnalysisUsage &AU) const {}
void PollyCanonicalize::releaseMemory() {}
bool PollyCanonicalize::runOnModule(Module &M) {
legacy::PassManager PM;
registerCanonicalicationPasses(PM);
PM.run(M);
return true;
}
void PollyCanonicalize::print(raw_ostream &OS, const Module *) const {}
char PollyCanonicalize::ID = 0;
Pass *polly::createPollyCanonicalizePass() { return new PollyCanonicalize(); }
INITIALIZE_PASS_BEGIN(PollyCanonicalize, "polly-canonicalize",
"Polly - Run canonicalization passes", false, false)
INITIALIZE_PASS_END(PollyCanonicalize, "polly-canonicalize",
"Polly - Run canonicalization passes", false, false)
| [
"nimits@seas.upenn.edu"
] | nimits@seas.upenn.edu |
48ba067a28600767e6d91a897853019ba3183417 | 3054ded5d75ec90aac29ca5d601e726cf835f76c | /Training/UVa/CP3/Mathematics/Ad Hoc/00443 - Humble Numbers.cpp | 5989c6653b41f74472dedf6ef78bf3064d7c0687 | [] | no_license | Yefri97/Competitive-Programming | ef8c5806881bee797deeb2ef12416eee83c03add | 2b267ded55d94c819e720281805fb75696bed311 | refs/heads/master | 2022-11-09T20:19:00.983516 | 2022-04-29T21:29:45 | 2022-04-29T21:29:45 | 60,136,956 | 10 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 670 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MX = 2e9;
int main() {
vector<ll> v;
for (ll l = 1; l <= MX; l *= 7)
for (ll k = 1; k * l <= MX; k *= 5)
for (ll j = 1; j * k * l <= MX; j *= 3)
for (ll i = 1; i * j * k * l <= MX; i *= 2)
v.push_back(i * j * k * l);
sort(v.begin(), v.end());
int n;
while (cin >> n && n) {
string suffix = "th";
if ((n / 10) % 10 != 1) {
if (n % 10 == 1) suffix = "st";
if (n % 10 == 2) suffix = "nd";
if (n % 10 == 3) suffix = "rd";
}
cout << "The " << n << suffix << " humble number is " << v[n - 1] << "." << endl;
}
return 0;
} | [
"yefri.gaitan97@gmail.com"
] | yefri.gaitan97@gmail.com |
982d33eb87a2d3dcdb7d739b3971eec1ab9d9d23 | c08cbfb0e791bac4f6eb06ad44f335d1c2da316b | /Managers/src/Utils/TableModifier.cpp | c32fe6d0d9bd00580bff0a44706cac837e29da50 | [] | no_license | Cliey/BookManager | 9a1be14d8b910b29297210ef7f0a2511ec16f550 | 8231b90b4c3d97453bb25f8e4c287286d5ebae41 | refs/heads/master | 2021-06-23T17:13:45.389609 | 2021-02-21T21:02:10 | 2021-02-21T21:02:10 | 195,285,165 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 6,808 | cpp | #include "Managers/Utils/TableModifier.hpp"
#include "BookAbstract/Book.hpp"
#include "BookEnum/BookType.hpp"
#include "BookFactory/BookFactory.hpp"
#include "EntityTypes/BookSeries.hpp"
#include "EntityTypes/Person.hpp"
#include "EntityTypes/Publisher.hpp"
#include "Utils/EnumUtils.hpp"
#include "Utils/Log.hpp"
#include "Utils/Exceptions.hpp"
#include "../../../Category.hpp"
#include <iostream>
#include <sqlite3.h>
namespace BookManager
{
namespace Manager
{
bool TableModifier::modifyPersonTable(BookManager::Entity::Person person, SQLite::Statement& query)
{
query.bind(":first_name", person.getFirstName());
query.bind(":last_name", person.getLastName());
query.bind(":role", static_cast<int>(person.getRole()));
return query.exec() > 0;
}
bool TableModifier::modifyPublisherTable(BookManager::Entity::Publisher publisher, SQLite::Statement& query)
{
query.bind(":name", publisher.getName());
return query.exec() > 0;
}
bool TableModifier::modifyCategoryTable(BookManager::Category::Category category, SQLite::Statement& query)
{
query.bind(":name", category.getName());
return query.exec() > 0;
}
bool TableModifier::modifyBookSeriesTable(BookManager::Entity::BookSeries bookSeries, SQLite::Statement& query)
{
query.bind(":name", bookSeries.getName());
return query.exec() > 0;
}
template<>
void TableModifier::bindOptional<time_t>(SQLite::Statement& query, std::string bindName, std::optional<time_t> date)
{
if(date)
query.bind(bindName, convertDateToString(date.value())); // YYY-MM-DD
else
query.bind(bindName); // bind to null
}
std::string TableModifier::convertDateToString(std::time_t date)
{
std::tm* dateTm{localtime(&date)};
char buffer [80];
strftime (buffer,80,"%Y-%m-%d",dateTm);
return std::string(buffer);
}
void TableModifier::modifyBooksPersonsTable(int bookId, std::vector<std::shared_ptr<Entity::Person>> persons, SQLite::Statement& query)
{
for(auto person : persons)
{
try
{
query.bind(":book_id", bookId);
query.bind(":person_id", person->getId());
query.exec();
query.reset();
}
catch (const SQLite::Exception &e) {
if (e.getExtendedErrorCode() == SQLITE_CONSTRAINT_FOREIGNKEY)
{
LOG_WINDOW("Error occurred with author : The author \"{}, {}\" doesn't exist.",
person->getLastName(), person->getFirstName())
throw;
}
LOG_WINDOW("Error occurred with author : {}", e.what())
throw;
}
catch(const std::exception& e)
{
LOG_WINDOW("Error occurred with author : {}", e.what())
throw;
}
}
}
void TableModifier::modifyBooksSubCategoriesTable(int bookId, std::vector<std::shared_ptr<Category::Category>> subCategories, SQLite::Statement& query)
{
for(auto subCategorie : subCategories)
{
try
{
query.bind(":book_id", bookId);
query.bind(":subCategory_id", subCategorie->getId());
query.exec();
query.reset();
}
catch (const SQLite::Exception &e) {
if (e.getExtendedErrorCode() == SQLITE_CONSTRAINT_FOREIGNKEY)
{
LOG_WINDOW("Error occurred with Subcategories : The Subcategory \"{}\" doesn't exist.",
subCategorie->getName())
throw;
}
LOG_WINDOW("Error occurred with Subcategories : {}", e.what());
throw;
}
catch(const std::exception& e)
{
LOG_WINDOW("Error occurred with Subcategories : {}", e.what())
throw;
}
}
}
void TableModifier::deleteInTableWithBookIdBind(int bookId, SQLite::Statement& query)
{
query.bind(":book_id", bookId);
query.exec();
}
void TableModifier::bindString(SQLite::Statement& query, std::string bindName, std::string field)
{
if(!field.empty())
query.bind(bindName, field);
else
query.bind(bindName); // bind to null
}
int TableModifier::modifyBookTable(std::shared_ptr<BookManager::Book::Abstraction::Book> book, SQLite::Statement& query)
{
query.bind(":type", static_cast<int>(book->getType()));
query.bind(":title", book->generalInfo.title);
bindPointersType<BookManager::Category::Category, const int>(
query, ":main_category", book->categoryInfo.mainCategory, &BookManager::Category::Category::getId);
bindPointersType<BookManager::Entity::Publisher, const int>(
query, ":publisher", book->generalInfo.publisher, &BookManager::Entity::Publisher::getId);
bindPointersType<BookManager::Entity::BookSeries, const int>(
query, ":book_serie", book->generalInfo.bookSeries, &BookManager::Entity::BookSeries::getId);
bindOptional<time_t>(query, ":published_date", book->generalInfo.published);
bindOptional<time_t>(query, ":purchased_date", book->statInfo.purchasedDate);
bindOptional<double>(query, ":price", book->statInfo.price);
bindOptional<time_t>(query, ":start_reading_date", book->statInfo.startReadingDate);
bindOptional<time_t>(query, ":end_reading_date", book->statInfo.endReadingDate);
query.bind(":status", static_cast<int>(book->additionalInfo.status));
query.bind(":is_read", book->additionalInfo.isRead);
bindOptional<int>(query, ":rate", book->additionalInfo.rate);
bindString(query, ":comment", book->additionalInfo.comment);
try
{
auto rowModified = query.exec();
return rowModified;
}
catch(const std::exception& e)
{
throw;
}
}
} // namespace Manager
} // namespace BookManager | [
"cyril.r38@gmail.com"
] | cyril.r38@gmail.com |
15e1ce3b5e2bda6f3c0ea800ec3694f42c7904a9 | aaf50a46800ec1fa0cec41589493fb762c90e137 | /Lecture-08/Character_Arrays.cpp | f809a93ad5954f273d2abfacba723859bdcd4124 | [] | no_license | nimishagupta1999/LPAAug18_Noida | 10cb1b7006f335bf3ba75ecef3ee0e915cb62b5d | cc2bbbe13f798572a4dcd95deaaa311a4d02536c | refs/heads/master | 2021-09-26T23:27:20.743073 | 2018-11-04T14:02:40 | 2018-11-04T14:02:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 233 | cpp | //
#include <iostream>
using namespace std;
int main(){
char a[]="ABCD";
char b[100];
strcpy(b,a);
cout<<a<<endl;
cout<<b<<endl;
cout<<strlen(a)<<endl;
int c[]={1,2,3,4};
cout<<&c<<endl;
cout<<&c+1<<endl;
return 0;
}
| [
"noreply@github.com"
] | nimishagupta1999.noreply@github.com |
cfca63a964c7e09d06ee177dc3a8327363181015 | 0795b456eb8343c3663c71d8219086e9fbe21078 | /normal-55-Jump_Game/55-Jump_Game__dp.cpp | ecc5b2ce47bd4811a2b8c966388f43bcc9ab7a40 | [] | no_license | burningDown/my_leetcode | ae5521c2233ef86d3e48fd175952ec81f6ae3ca1 | 02be289989b9bbda198578e88f004dc83842d40f | refs/heads/master | 2021-07-06T15:07:45.904592 | 2020-09-07T13:36:40 | 2020-09-07T13:36:40 | 177,900,149 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 474 | cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
if(nums.size() == 0)
return true;
vector<bool> dp(nums.size(), false);
const int l = nums.size();
dp[0] = true;
for(int i=0;i<l;i++)
{
if(dp[i])
{
for(int j=1;j<=nums[i]&&i+j<l;j++)
{
dp[i+j] = true;
}
}
}
return dp[l-1];
}
}; | [
"734556742@qq.com"
] | 734556742@qq.com |
eaac8acefa05825f33be42ed295f89fbf62b09d6 | f1999687072f68060484a2af0ce80126a923aa3a | /DDKInclude/wiavideo.h | 3577490fd2c8bb8613e919fc29d8ada43dfc8f52 | [
"WTFPL"
] | permissive | MSDN-WhiteKnight/DiskView | 159d9ead8f4fbe838cd6680a909a95597c42f66d | 49f488a074e1318494409dab003ddd1a40cc3ed5 | refs/heads/master | 2020-03-17T10:19:08.973961 | 2019-03-19T19:18:49 | 2019-03-19T19:18:49 | 133,508,061 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,231 | h |
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0347 */
/* Compiler settings for wiavideo.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __wiavideo_h__
#define __wiavideo_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IWiaVideo_FWD_DEFINED__
#define __IWiaVideo_FWD_DEFINED__
typedef interface IWiaVideo IWiaVideo;
#endif /* __IWiaVideo_FWD_DEFINED__ */
#ifndef __WiaVideo_FWD_DEFINED__
#define __WiaVideo_FWD_DEFINED__
#ifdef __cplusplus
typedef class WiaVideo WiaVideo;
#else
typedef struct WiaVideo WiaVideo;
#endif /* __cplusplus */
#endif /* __WiaVideo_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_wiavideo_0000 */
/* [local] */
typedef /* [public][public] */
enum __MIDL___MIDL_itf_wiavideo_0000_0001
{ WIAVIDEO_NO_VIDEO = 1,
WIAVIDEO_CREATING_VIDEO = 2,
WIAVIDEO_VIDEO_CREATED = 3,
WIAVIDEO_VIDEO_PLAYING = 4,
WIAVIDEO_VIDEO_PAUSED = 5,
WIAVIDEO_DESTROYING_VIDEO = 6
} WIAVIDEO_STATE;
extern RPC_IF_HANDLE __MIDL_itf_wiavideo_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_wiavideo_0000_v0_0_s_ifspec;
#ifndef __IWiaVideo_INTERFACE_DEFINED__
#define __IWiaVideo_INTERFACE_DEFINED__
/* interface IWiaVideo */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IWiaVideo;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("D52920AA-DB88-41F0-946C-E00DC0A19CFA")
IWiaVideo : public IUnknown
{
public:
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PreviewVisible(
/* [retval][out] */ BOOL *pbPreviewVisible) = 0;
virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PreviewVisible(
/* [in] */ BOOL bPreviewVisible) = 0;
virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ImagesDirectory(
/* [retval][out] */ BSTR *pbstrImageDirectory) = 0;
virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ImagesDirectory(
/* [in] */ BSTR bstrImageDirectory) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateVideoByWiaDevID(
/* [in] */ BSTR bstrWiaDeviceID,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateVideoByDevNum(
/* [in] */ UINT uiDeviceNumber,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateVideoByName(
/* [in] */ BSTR bstrFriendlyName,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DestroyVideo( void) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Play( void) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Pause( void) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE TakePicture(
/* [out] */ BSTR *pbstrNewImageFilename) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ResizeVideo(
/* [in] */ BOOL bStretchToFitParent) = 0;
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCurrentState(
/* [retval][out] */ WIAVIDEO_STATE *pState) = 0;
};
#else /* C style interface */
typedef struct IWiaVideoVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IWiaVideo * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IWiaVideo * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IWiaVideo * This);
/* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PreviewVisible )(
IWiaVideo * This,
/* [retval][out] */ BOOL *pbPreviewVisible);
/* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PreviewVisible )(
IWiaVideo * This,
/* [in] */ BOOL bPreviewVisible);
/* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ImagesDirectory )(
IWiaVideo * This,
/* [retval][out] */ BSTR *pbstrImageDirectory);
/* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ImagesDirectory )(
IWiaVideo * This,
/* [in] */ BSTR bstrImageDirectory);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateVideoByWiaDevID )(
IWiaVideo * This,
/* [in] */ BSTR bstrWiaDeviceID,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateVideoByDevNum )(
IWiaVideo * This,
/* [in] */ UINT uiDeviceNumber,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateVideoByName )(
IWiaVideo * This,
/* [in] */ BSTR bstrFriendlyName,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DestroyVideo )(
IWiaVideo * This);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Play )(
IWiaVideo * This);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Pause )(
IWiaVideo * This);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *TakePicture )(
IWiaVideo * This,
/* [out] */ BSTR *pbstrNewImageFilename);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ResizeVideo )(
IWiaVideo * This,
/* [in] */ BOOL bStretchToFitParent);
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetCurrentState )(
IWiaVideo * This,
/* [retval][out] */ WIAVIDEO_STATE *pState);
END_INTERFACE
} IWiaVideoVtbl;
interface IWiaVideo
{
CONST_VTBL struct IWiaVideoVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IWiaVideo_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IWiaVideo_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IWiaVideo_Release(This) \
(This)->lpVtbl -> Release(This)
#define IWiaVideo_get_PreviewVisible(This,pbPreviewVisible) \
(This)->lpVtbl -> get_PreviewVisible(This,pbPreviewVisible)
#define IWiaVideo_put_PreviewVisible(This,bPreviewVisible) \
(This)->lpVtbl -> put_PreviewVisible(This,bPreviewVisible)
#define IWiaVideo_get_ImagesDirectory(This,pbstrImageDirectory) \
(This)->lpVtbl -> get_ImagesDirectory(This,pbstrImageDirectory)
#define IWiaVideo_put_ImagesDirectory(This,bstrImageDirectory) \
(This)->lpVtbl -> put_ImagesDirectory(This,bstrImageDirectory)
#define IWiaVideo_CreateVideoByWiaDevID(This,bstrWiaDeviceID,hwndParent,bStretchToFitParent,bAutoBeginPlayback) \
(This)->lpVtbl -> CreateVideoByWiaDevID(This,bstrWiaDeviceID,hwndParent,bStretchToFitParent,bAutoBeginPlayback)
#define IWiaVideo_CreateVideoByDevNum(This,uiDeviceNumber,hwndParent,bStretchToFitParent,bAutoBeginPlayback) \
(This)->lpVtbl -> CreateVideoByDevNum(This,uiDeviceNumber,hwndParent,bStretchToFitParent,bAutoBeginPlayback)
#define IWiaVideo_CreateVideoByName(This,bstrFriendlyName,hwndParent,bStretchToFitParent,bAutoBeginPlayback) \
(This)->lpVtbl -> CreateVideoByName(This,bstrFriendlyName,hwndParent,bStretchToFitParent,bAutoBeginPlayback)
#define IWiaVideo_DestroyVideo(This) \
(This)->lpVtbl -> DestroyVideo(This)
#define IWiaVideo_Play(This) \
(This)->lpVtbl -> Play(This)
#define IWiaVideo_Pause(This) \
(This)->lpVtbl -> Pause(This)
#define IWiaVideo_TakePicture(This,pbstrNewImageFilename) \
(This)->lpVtbl -> TakePicture(This,pbstrNewImageFilename)
#define IWiaVideo_ResizeVideo(This,bStretchToFitParent) \
(This)->lpVtbl -> ResizeVideo(This,bStretchToFitParent)
#define IWiaVideo_GetCurrentState(This,pState) \
(This)->lpVtbl -> GetCurrentState(This,pState)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IWiaVideo_get_PreviewVisible_Proxy(
IWiaVideo * This,
/* [retval][out] */ BOOL *pbPreviewVisible);
void __RPC_STUB IWiaVideo_get_PreviewVisible_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IWiaVideo_put_PreviewVisible_Proxy(
IWiaVideo * This,
/* [in] */ BOOL bPreviewVisible);
void __RPC_STUB IWiaVideo_put_PreviewVisible_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IWiaVideo_get_ImagesDirectory_Proxy(
IWiaVideo * This,
/* [retval][out] */ BSTR *pbstrImageDirectory);
void __RPC_STUB IWiaVideo_get_ImagesDirectory_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IWiaVideo_put_ImagesDirectory_Proxy(
IWiaVideo * This,
/* [in] */ BSTR bstrImageDirectory);
void __RPC_STUB IWiaVideo_put_ImagesDirectory_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_CreateVideoByWiaDevID_Proxy(
IWiaVideo * This,
/* [in] */ BSTR bstrWiaDeviceID,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
void __RPC_STUB IWiaVideo_CreateVideoByWiaDevID_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_CreateVideoByDevNum_Proxy(
IWiaVideo * This,
/* [in] */ UINT uiDeviceNumber,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
void __RPC_STUB IWiaVideo_CreateVideoByDevNum_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_CreateVideoByName_Proxy(
IWiaVideo * This,
/* [in] */ BSTR bstrFriendlyName,
/* [in] */ HWND hwndParent,
/* [in] */ BOOL bStretchToFitParent,
/* [in] */ BOOL bAutoBeginPlayback);
void __RPC_STUB IWiaVideo_CreateVideoByName_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_DestroyVideo_Proxy(
IWiaVideo * This);
void __RPC_STUB IWiaVideo_DestroyVideo_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_Play_Proxy(
IWiaVideo * This);
void __RPC_STUB IWiaVideo_Play_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_Pause_Proxy(
IWiaVideo * This);
void __RPC_STUB IWiaVideo_Pause_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_TakePicture_Proxy(
IWiaVideo * This,
/* [out] */ BSTR *pbstrNewImageFilename);
void __RPC_STUB IWiaVideo_TakePicture_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_ResizeVideo_Proxy(
IWiaVideo * This,
/* [in] */ BOOL bStretchToFitParent);
void __RPC_STUB IWiaVideo_ResizeVideo_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IWiaVideo_GetCurrentState_Proxy(
IWiaVideo * This,
/* [retval][out] */ WIAVIDEO_STATE *pState);
void __RPC_STUB IWiaVideo_GetCurrentState_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IWiaVideo_INTERFACE_DEFINED__ */
#ifndef __WIAVIDEOLib_LIBRARY_DEFINED__
#define __WIAVIDEOLib_LIBRARY_DEFINED__
/* library WIAVIDEOLib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_WIAVIDEOLib;
EXTERN_C const CLSID CLSID_WiaVideo;
#ifdef __cplusplus
class DECLSPEC_UUID("3908C3CD-4478-4536-AF2F-10C25D4EF89A")
WiaVideo;
#endif
#endif /* __WIAVIDEOLib_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
unsigned long __RPC_USER HWND_UserSize( unsigned long *, unsigned long , HWND * );
unsigned char * __RPC_USER HWND_UserMarshal( unsigned long *, unsigned char *, HWND * );
unsigned char * __RPC_USER HWND_UserUnmarshal(unsigned long *, unsigned char *, HWND * );
void __RPC_USER HWND_UserFree( unsigned long *, HWND * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
| [
"noreply@github.com"
] | MSDN-WhiteKnight.noreply@github.com |
9144901f114d1cea49c7c7da8f807f67d9b62bc2 | b3d2e5d3db351a4c350785b347c3902d9d91dda6 | /src/posix/intercept.cpp | 82c43873bf02e5ca83e2109fa1a16efb0f216fc9 | [
"CC-BY-3.0"
] | permissive | andersgjerdrum/diggi | 84d83bb357b1d3348d9443e4225c489322c136f7 | c072911c439758b6f1bb1d9972c6fc32aa49d560 | refs/heads/master | 2022-11-07T19:00:58.241516 | 2020-07-01T16:23:11 | 2020-07-01T16:23:11 | 275,837,201 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,486 | cpp | #include "posix/intercept.h"
/**
* @file intercept.cpp
* @author Anders Gjerdrum (anders.gjerdrum@uit.no)
* @author Lars Brenna (lars.brenna@uit.no)
* @brief stub implementaitons for POSIX intercept calls.
* Used for untrusted runtime instances and unit tests to capture system call operations.
* syscall.mk overrides linker symbols for select POSIX calls into this file instead.
* Interposition state set via set_syscall_interposition() determine if calls are pass-through or are intercepted by the runtime.
* @version 0.1
* @date 2020-02-03
*
* @copyright Copyright (c) 2020
*
*/
#include "DiggiAssert.h"
#include "posix/time_stubs.h"
#include "posix/pthread_stubs.h"
#include "posix/unistd_stubs.h"
#include "posix/net_stubs.h"
#include "posix/io_stubs.h"
#include "posix/crypto_stubs.h"
#include "posix/net_utils.h"
#include "posix/io_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/// keep track of socket fd's to help route syscalls to correct handler
/// NOT THREAD SAFE :-O
/// TODO: make this thread safe
/// calls are either treated to file IO or network IO descriptors
#define MAX_SOCKET_FDS 10240
static int socket_fds[MAX_SOCKET_FDS] = {0};
static int socket_fd_index = 0;
static unsigned syscall_interposition = 0;
#define MAX_PRINTIF_SIZE 8092
/**
* @brief Set the syscall interposition object
* sets interposition state, and resets file descriptor accounting.
* @param state
*/
void set_syscall_interposition(unsigned int state) {
syscall_interposition = state;
/*
reset for unit tests
*/
memset(socket_fds,0,sizeof(int) * MAX_SOCKET_FDS);
}
/**
* @brief check if fd is a file descriptor or network descriptor
*
* @param fd
* @return true
* @return false
*/
static bool is_fd_socket(int fd){
for (int i=0;i<socket_fd_index;i++){
if (socket_fds[i] == fd){
return true;
}
}
return false;
}
/**
* @brief debug intercept calls.
* usable if MAMA define is passed as compiler opt.
* @param str
*/
static inline void debug_printf(const char* str){
#ifdef DEBUG_SYSCALL
printf("DEBUG: %s\n", str);
#endif
}
/**
* @brief only usable in unit tests or untrusted runtime instances
*
*/
#if !defined(DIGGI_ENCLAVE) && !defined(UNTRUSTED_APP)
uint32_t __wrap_htonl(uint32_t hostlong) {
debug_printf("htonl");
if (syscall_interposition) { return i_htonl(hostlong); }
else { return __real_htonl(hostlong); }
}
uint16_t __wrap_htons(uint16_t hostshort) {
debug_printf("htons");
if (syscall_interposition) { return i_htons(hostshort); }
else { return __real_htons(hostshort); }
}
uint32_t __wrap_ntohl(uint32_t netlong) {
debug_printf("ntohl");
if (syscall_interposition) { return i_ntohl(netlong); }
else { return __real_ntohl(netlong); }
}
uint16_t __wrap_ntohs(uint16_t netshort) {
debug_printf("ntohs");
if (syscall_interposition) { return i_ntohs(netshort); }
else { return __real_ntohs(netshort); }
}
int __wrap_inet_aton(const char * cp, struct in_addr * inp) {
debug_printf("aton");
if (syscall_interposition) { return i_inet_aton(cp, inp); }
else { return __real_inet_aton(cp, inp); }
}
in_addr_t __wrap_inet_addr(const char * cp) {
debug_printf("inet_addr");
if (syscall_interposition) { return i_inet_addr(cp); }
else {return __real_inet_addr(cp); }
}
in_addr_t __wrap_inet_network(const char * cp) {
debug_printf("inet_network");
if (syscall_interposition) { return i_inet_network(cp); }
else { return __real_inet_network(cp); }
}
char * __wrap_inet_ntoa(struct in_addr in) {
debug_printf("inet_ntoa");
if (syscall_interposition) { return i_inet_ntoa(in); }
else { return __real_inet_ntoa(in); }
}
struct in_addr __wrap_inet_makeaddr(int net, int host) {
debug_printf("inet_makeaddr");
if (syscall_interposition) { return i_inet_makeaddr(net, host); }
else { return __real_inet_makeaddr(net, host); }
}
in_addr_t __wrap_inet_lnaof(struct in_addr in) {
debug_printf("inet_lnaof");
if (syscall_interposition) { return i_inet_lnaof(in); }
else { return __real_inet_lnaof(in); }
}
in_addr_t __wrap_inet_netof(struct in_addr in) {
debug_printf("inet_netof");
if (syscall_interposition) { return i_inet_netof(in); }
else { return __real_inet_netof(in); }
}
const char * __wrap_inet_ntop(int af, const void * src, char * dst, socklen_t size) {
debug_printf("inet_ntop");
if (syscall_interposition) { return i_inet_ntop(af, src, dst, size); }
else { return __real_inet_ntop(af, src, dst, size); }
}
/*int __wrap_sscanf(const char *str, const char *format, ...) {
debug_printf("sscanf");
int retval = 0;
//TODO: implement this.
va_list args;
va_start(args, format);
if (syscall_interposition) {
retval = i_vsscanf(str, format, args);
}
else {
retval = vsscanf(str, format, args);
}
va_end(args);
return retval;
}*/
int __wrap_sprintf(char * str, const char * format, ...)
{
debug_printf("sprintf");
int retval = 0;
va_list args;
va_start(args, format);
if (syscall_interposition) {
retval = i_vsprintf(str, format, args);
}
else {
retval = vsprintf(str, format, args);
}
va_end(args);
return retval;
}
int __wrap_fcntl(int fd, int cmd, ... /*args */) {
debug_printf("fcntl");
va_list argp;
struct flock *lock = NULL;
int flag = 0;
int retval = 0;
va_start(argp, cmd);
if (is_fd_socket(fd)){
flag = va_arg(argp, int);
if (syscall_interposition){
// printf("FCNTL for fd=%d going to network implementation\n", fd);
retval = network_fcntl(fd, cmd, flag);
} else {
retval = __real_fcntl(fd, cmd, flag);
}
}
else if ((cmd == F_SETLK) || (cmd == F_SETLKW) || (cmd == F_GETLK)) {
lock = va_arg(argp, struct flock *);
DIGGI_ASSERT(lock);
if (syscall_interposition) {
retval = i_fcntl(fd, cmd, lock);
}
else {
retval = __real_fcntl(fd, cmd, lock);
}
}
else{
/*
Do not support emulation of file descriptor manipulation yet
*/
DIGGI_ASSERT(!syscall_interposition);
if (cmd == F_GETFL) {
retval = __real_fcntl(fd, cmd);
}
else if(cmd == F_SETFL) {
int op = va_arg(argp, int);
retval = __real_fcntl(fd, cmd, op);
}
else {
/*
Unknown operation
*/
DIGGI_ASSERT(false);
}
}
va_end(argp);
return retval;
}
int __wrap_rand(void) {
//debug_printf("rand"); // commenting out because it is called so often during TLS it makes the log hard to read.
if (syscall_interposition) {
return i_rand();
}
else {
return __real_rand();
}
}
DIR * __wrap_opendir(const char * name) {
debug_printf("opendir");
if (syscall_interposition) {
return i_opendir(name);
}
else {
return __real_opendir(name);
}
}
struct dirent * __wrap_readdir(DIR * dirp) {
debug_printf("readdir");
if (syscall_interposition) {
return i_readdir(dirp);
}
else {
return __real_readdir(dirp);
}
}
int __wrap_closedir(DIR * dirp) {
debug_printf("closedir");
if (syscall_interposition) {
return i_closedir(dirp);
}
else {
return __real_closedir(dirp);
}
}
int __wrap_dup(int oldfd) {
debug_printf("dup");
if (syscall_interposition) {
return i_dup(oldfd);
}
else {
return __real_dup(oldfd);
}
}
FILE * __wrap_fopen(const char * filename, const char * mode) {
debug_printf("fopen");
if (syscall_interposition) {
return i_fopen(filename, mode);
}
else {
return __real_fopen(filename, mode);
}
}
char * __wrap_fgets(char * str, int num, FILE * stream) {
debug_printf("fgets");
if (syscall_interposition) {
return i_fgets(str, num, stream);
}
else {
return __real_fgets(str, num, stream);
}
}
int __wrap_fclose(FILE * stream) {
debug_printf("fclose");
if (syscall_interposition) {
return i_fclose(stream);
}
else {
return __real_fclose(stream);
}
}
int __wrap_fputc(int character, FILE * stream) {
debug_printf("fputc");
if (syscall_interposition) {
return i_fputc(character, stream);
}
else {
return __real_fputc(character, stream);
}
}
int __wrap_fflush(FILE * stream) {
debug_printf("fflush");
if (syscall_interposition) {
return i_fflush(stream);
}
else {
return __real_fflush(stream);
}
}
size_t __wrap_fread(void * ptr, size_t size, size_t count, FILE * stream) {
debug_printf("fread");
if (syscall_interposition) {
return i_fread(ptr, size, count, stream);
}
else {
return __real_fread(ptr, size, count, stream);
}
}
size_t __wrap_fwrite(const void * ptr, size_t size, size_t count, FILE * stream) {
debug_printf("fwrite");
if (syscall_interposition) {
return i_fwrite(ptr, size, count, stream);
}
else {
return __real_fwrite(ptr, size, count, stream);
}
}
int __wrap_chdir(const char * path) {
debug_printf("chdir");
if (syscall_interposition) {
return i_chdir(path);
}
else {
return __real_chdir(path);
}
}
int __wrap_dup2(int oldfd, int newfd) {
debug_printf("dup2");
if (syscall_interposition) {
return i_dup2(oldfd, newfd);
}
else {
return __real_dup2(oldfd, newfd);
}
}
int __wrap_fseeko(FILE * stream, off_t offset, int whence) {
debug_printf("fseeko");
if (syscall_interposition) {
return i_fseeko(stream, offset, whence);
}
else {
return __real_fseeko(stream, offset, whence);
}
}
int __wrap_fseek(FILE * stream, off_t offset, int whence) {
debug_printf("fseek");
if (syscall_interposition) {
return i_fseek(stream, offset, whence);
}
else {
return __real_fseek(stream, offset, whence);
}
}
long __wrap_ftell(FILE * stream) {
debug_printf("ftell");
if (syscall_interposition) {
return i_ftell(stream);
}
else {
return __real_ftell(stream);
}
}
int __wrap_fputs(const char * str, FILE * stream) {
debug_printf("fputs");
if (syscall_interposition) {
return i_fputs(str, stream);
}
else {
return __real_fputs(str, stream);
}
}
int __wrap_fgetc(FILE * stream) {
debug_printf("fgetc");
if (syscall_interposition) {
return i_fgetc(stream);
}
else {
return __real_fgetc(stream);
}
}
int __wrap_fileno(FILE * stream) {
debug_printf("fileno");
if (syscall_interposition) {
return i_fileno(stream);
}
else {
return __real_fileno(stream);
}
}
int __wrap_lstat(const char * path, struct stat * buf) {
debug_printf("lstat");
if (syscall_interposition) {
return i_lstat(path, buf);
}
else {
return __real_lstat(path, buf);
}
}
long __wrap_sysconf(int name) {
debug_printf("sysconf");
if (syscall_interposition) {
return i_sysconf(name);
}
else {
return __real_sysconf(name);
}
}
ssize_t __wrap_readlink(const char * path, char * buf, size_t bufsiz) {
debug_printf("readlink");
if (syscall_interposition) {
return i_readlink(path, buf, bufsiz);
}
else {
return __real_readlink(path, buf, bufsiz);
}
}
int __wrap_fchmod(int fildes, mode_t mode) {
debug_printf("fchmod");
if (syscall_interposition) {
return i_fchmod(fildes, mode);
}
else {
return __real_fchmod(fildes, mode);
}
}
unsigned int __wrap_sleep(unsigned int seconds) {
debug_printf("sleep");
if (syscall_interposition) {
return i_sleep(seconds);
}
else {
return __real_sleep(seconds);
}
}
int __wrap_getpid(void) {
debug_printf("getpid");
if (syscall_interposition) {
return i_getpid();
}
else {
return __real_getpid();
}
}
time_t __wrap_time(time_t * t) {
debug_printf("time");
if (syscall_interposition) {
return i_time(t);
}
else {
return __real_time(t);
}
}
struct tm * __wrap_gmtime(const time_t * timer) {
debug_printf("gmtime");
if (syscall_interposition) {
return i_gmtime(timer);
}
else {
return __real_gmtime(timer);
}
}
int __wrap_utime(const char * filename, const struct utimbuf * times) {
debug_printf("utime");
if (syscall_interposition) {
return i_utime(filename, times);
}
else {
return __real_utime(filename, times);
}
}
int __wrap_utimes(const char * filename, const struct timeval times[2]) {
debug_printf("utimes");
if (syscall_interposition) {
return i_utimes(filename, times);
}
else {
return __real_utimes(filename, times);
}
}
int __wrap_gettimeofday(struct timeval * tv, struct timezone * tz) {
debug_printf("gettimeofday");
if (syscall_interposition) {
return i_gettimeofday(tv, tz);
}
else {
return __real_gettimeofday(tv, tz);
}
}
int __wrap_stat(const char * path, struct stat * buf) {
debug_printf("stat");
if (syscall_interposition) {
return i_stat(path, buf);
}
else {
return __real_stat(path, buf);
}
}
int __wrap_fstat(int fd, struct stat * buf) {
debug_printf("fstat");
if (syscall_interposition) {
return i_fstat(fd, buf);
}
else {
return __real_fstat(fd, buf);
}
}
int __wrap_close(int fd) {
debug_printf("close");
if (syscall_interposition) {
if (is_fd_socket(fd)){
return network_close(fd);
}
else {
return i_close(fd);
}
}
else {
return __real_close(fd);
}
}
int __wrap_access(const char * pathname, int mode) {
debug_printf("access");
if (syscall_interposition) {
return i_access(pathname, mode);
}
else {
return __real_access(pathname, mode);
}
}
/*
Allways have CWD be the same virtual directory
*/
char * __wrap_getcwd(char * buf, size_t size) {
debug_printf("getcwd");
if (syscall_interposition) {
return i_getcwd(buf, size);
}
else {
return __real_getcwd(buf, size);
}
}
int __wrap_ftruncate(int fd, off_t length) {
debug_printf("ftruncate");
if (syscall_interposition) {
return i_ftruncate(fd, length);
}
else {
return __real_ftruncate(fd, length);
}
}
int __wrap_fsync(int fd) {
debug_printf("fsync");
if (syscall_interposition) {
return i_fsync(fd);
}
else {
return __real_fsync(fd);
}
}
char * __wrap_getenv(const char * name) {
debug_printf("getenv");
if (syscall_interposition) {
return i_getenv(name);
}
else {
return __real_getenv(name);
}
}
uid_t __wrap_getuid(void) {
debug_printf("getuid");
if (syscall_interposition) {
return i_getuid();
}
else {
return __real_getuid();
}
}
uid_t __wrap_geteuid(void) {
debug_printf("geteuid");
if (syscall_interposition) {
return i_geteuid();
}
else {
return __real_geteuid();
}
}
int __wrap_fchown(int fd, uid_t owner, gid_t group) {
debug_printf("fchown");
if (syscall_interposition) {
return i_fchown(fd, owner, group);
}
else {
return __real_fchown(fd, owner, group);
}
}
off_t __wrap_lseek(int fd, off_t offset, int whence) {
debug_printf("lseek");
if (syscall_interposition) {
return i_lseek(fd, offset, whence);
}
else {
return __real_lseek(fd, offset, whence);
}
}
int __wrap_open(const char * path, int oflags, mode_t mode) {
debug_printf("open");
if (syscall_interposition) {
return i_open(path, oflags, mode);
}
else {
return __real_open(path, oflags, mode);
}
}
ssize_t __wrap_read(int fildes, void * buf, size_t nbyte) {
debug_printf("read");
if (syscall_interposition) {
return i_read(fildes, buf, nbyte);
}
else {
return __real_read(fildes, buf, nbyte);
}
}
ssize_t __wrap_write(int fd, const void * buf, size_t count) {
debug_printf("write");
if (syscall_interposition) {
return i_write(fd, buf, count);
}
else {
return __real_write(fd, buf, count);
}
}
int __wrap_unlink(const char * pathname) {
debug_printf("unlink");
if (syscall_interposition) {
return i_unlink(pathname);
}
else {
return __real_unlink(pathname);
}
}
int __wrap_mkdir(const char * path, mode_t mode) {
debug_printf("mkdir");
if (syscall_interposition) {
return i_mkdir(path, mode);
}
else {
return __real_mkdir(path, mode);
}
}
int __wrap_rmdir(const char * path) {
debug_printf("rmdir");
if (syscall_interposition) {
return i_rmdir(path);
}
else {
return __real_rmdir(path);
}
}
mode_t __wrap_umask(mode_t mask) {
debug_printf("umask");
if (syscall_interposition) {
return i_umask(mask);
}
else {
return __real_umask(mask);
}
}
void __wrap_freeaddrinfo(struct addrinfo *res)
{
if (syscall_interposition) {
i_freeaddrinfo(res);
}
else{
__real_freeaddrinfo(res);
}
}
int __wrap_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
struct addrinfo **res)
{
if (syscall_interposition) {
return i_getaddrinfo(node, service, hints, res);
}
else
{
return __real_getaddrinfo(node, service, hints, res);
}
}
int __wrap_socket(int domain, int type, int protocol) {
debug_printf("socket");
int new_fd = 0;
if (syscall_interposition) {
new_fd = i_socket(domain, type, protocol);
}
else {
new_fd = __real_socket(domain, type, protocol);
}
if (socket_fd_index == MAX_SOCKET_FDS){
socket_fd_index = 0;
}
socket_fds[socket_fd_index] = new_fd;
socket_fd_index++;
return new_fd;
}
int __wrap_setsockopt(int sockfd, int level, int optname,
const void * optval, socklen_t optlen) {
debug_printf("setsockopt");
if (syscall_interposition) {
return i_setsockopt(sockfd, level, optname, optval, optlen);
}
else {
return __real_setsockopt(sockfd, level, optname, optval, optlen);
}
}
int __wrap_getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
debug_printf("getpeername");
if (syscall_interposition) {
return i_getpeername(sockfd, addr, addrlen);
}
else {
return __real_getpeername(sockfd, addr, addrlen);
}
}
ssize_t __wrap_send(int sockfd, const void * buf, size_t len, int flags) {
debug_printf("send");
if (syscall_interposition) {
return i_send(sockfd, buf, len, flags);
}
else {
return __real_send(sockfd, buf, len, flags);
}
}
ssize_t __wrap_sendto(int sockfd,
const void * buf, size_t len, int flags,
const struct sockaddr * dest_addr, socklen_t addrlen) {
debug_printf("sendto");
if (syscall_interposition) {
return i_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}
else {
return __real_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}
}
ssize_t __wrap_recvfrom(int sockfd, void * buf, size_t len, int flags, struct sockaddr * src_addr, socklen_t * addrlen) {
debug_printf("recvfrom");
if (syscall_interposition) {
return i_recvfrom(sockfd, buf, len, flags, src_addr, addrlen);
}
else {
return __real_recvfrom(sockfd, buf, len, flags, src_addr, addrlen);
}
}
int __wrap_bind(int sockfd,
const struct sockaddr * addr, socklen_t addrlen) {
debug_printf("bind");
if (syscall_interposition) {
return i_bind(sockfd, addr, addrlen);
}
else {
return __real_bind(sockfd, addr, addrlen);
}
}
int __wrap_getsockname(int sockfd, struct sockaddr * addr, socklen_t * addrlen) {
debug_printf("getsockname");
if (syscall_interposition) {
return i_getsockname(sockfd, addr, addrlen);
}
else {
return __real_getsockname(sockfd, addr, addrlen);
}
}
ssize_t __wrap_recv(int sockfd, void * buf, size_t len, int flags) {
debug_printf("recv");
if (syscall_interposition) {
return i_recv(sockfd, buf, len, flags);
}
else {
return __real_recv(sockfd, buf, len, flags);
}
}
int __wrap_connect(int sockfd, const struct sockaddr * addr, socklen_t addrlen) {
debug_printf("connect");
if (syscall_interposition) {
return i_connect(sockfd, addr, addrlen);
}
else {
return __real_connect(sockfd, addr, addrlen);
}
}
int __wrap_accept(int sockfd, struct sockaddr * addr, socklen_t * addrlen) {
debug_printf("accept");
int new_fd = 0;
if (syscall_interposition) {
new_fd = i_accept(sockfd, addr, addrlen);
}
else {
new_fd = __real_accept(sockfd, addr, addrlen);
}
// add to socket_fd_index:
if (socket_fd_index == MAX_SOCKET_FDS){
socket_fd_index = 0;
}
socket_fds[socket_fd_index] = new_fd;
socket_fd_index++;
return new_fd;
}
int __wrap_listen(int sockfd, int backlog) {
debug_printf("listen");
if (syscall_interposition) {
return i_listen(sockfd, backlog);
}
else {
return __real_listen(sockfd, backlog);
}
}
int __wrap_select(int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval * timeout) {
debug_printf("select");
if (syscall_interposition) {
return i_select(nfds, readfds, writefds, exceptfds, timeout);
}
else {
return __real_select(nfds, readfds, writefds, exceptfds, timeout);
}
}
int __wrap_getsockopt(int sockfd, int level, int optname, void * optval, socklen_t * optlen) {
debug_printf("getsockopt");
if (syscall_interposition) {
return i_getsockopt(sockfd, level, optname, optval, optlen);
}
else {
return __real_getsockopt(sockfd, level, optname, optval, optlen);
}
}
int __wrap_sigemptyset(sigset_t * set) {
debug_printf("sigemptyset");
if (syscall_interposition) {
return i_sigemptyset(set);
}
else {
return __real_sigemptyset(set);
}
}
int __wrap_sigaction(int signum,
const struct sigaction * act, struct sigaction * oldact) {
debug_printf("sigaction");
if (syscall_interposition) {
return i_sigaction(signum, act, oldact);
}
else {
return __real_sigaction(signum, act, oldact);
}
}
pid_t __wrap_fork(void) {
debug_printf("fork");
if (syscall_interposition) {
return i_fork();
}
else {
return __real_fork();
}
}
sighandler_t __wrap_signal(int signum, sighandler_t handler) {
debug_printf("signal");
if (syscall_interposition) {
return i_signal(signum, handler);
}
else {
return __real_signal(signum, handler);
}
}
void __wrap__exit(int status) {
debug_printf("exit");
if (syscall_interposition) {
i__exit(status);
}
else {
__real__exit(status);
}
}
int __wrap_execle(const char *path, const char *arg, ...){
debug_printf("execle");
DIGGI_ASSERT(false);
return -1;
}
struct tm *__wrap_localtime(const time_t *timer) {
debug_printf("localtime");
if (syscall_interposition) {
return i_localtime(timer);
}
else {
return __real_localtime(timer);
}
}
int __wrap_pthread_mutexattr_init(pthread_mutexattr_t *attr) {
debug_printf("pthread_mutexattr_init");
if (syscall_interposition) {
return i_pthread_mutexattr_init(attr);
}
else {
return __real_pthread_mutexattr_init(attr);
}
}
int __wrap_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
debug_printf("pthread_mutexattr_settype");
if (syscall_interposition) {
return i_pthread_mutexattr_settype(attr, type);
}
else {
return __real_pthread_mutexattr_settype(attr, type);
}
}
int __wrap_pthread_mutexattr_destroy(pthread_mutexattr_t * attr) {
debug_printf("pthread_mutexattr_destroy");
if (syscall_interposition) {
return i_pthread_mutexattr_destroy(attr);
}
else {
return __real_pthread_mutexattr_destroy(attr);
}
}
int __wrap_pthread_mutex_init(pthread_mutex_t * mutext,
const pthread_mutexattr_t * attr) {
debug_printf("pthread_mutex_init");
if (syscall_interposition) {
return i_pthread_mutex_init(mutext, attr);
}
else {
return __real_pthread_mutex_init(mutext, attr);
}
}
int __wrap_pthread_mutex_lock(pthread_mutex_t * mutex) {
debug_printf("pthread_mutex_lock");
if (syscall_interposition) {
return i_pthread_mutex_lock(mutex);
}
else {
return __real_pthread_mutex_lock(mutex);
}
}
int __wrap_pthread_mutex_unlock(pthread_mutex_t * mutex) {
debug_printf("pthread_mutex_unlock");
if (syscall_interposition) {
return i_pthread_mutex_unlock(mutex);
}
else {
return __real_pthread_mutex_unlock(mutex);
}
}
int __wrap_pthread_mutex_trylock(pthread_mutex_t * mutex) {
debug_printf("pthread_mutex_trylock");
if (syscall_interposition) {
return i_pthread_mutex_trylock(mutex);
}
else {
return __real_pthread_mutex_trylock(mutex);
}
}
int __wrap_pthread_mutex_destroy(pthread_mutex_t * mutex) {
debug_printf("pthread_mutex_destroy");
if (syscall_interposition) {
return i_pthread_mutex_destroy(mutex);
}
else {
return __real_pthread_mutex_destroy(mutex);
}
}
int __wrap_pthread_create(pthread_t * thread,
const pthread_attr_t * attr, void * (*start_routine)(void *), void * arg) {
debug_printf("pthread_create");
if (syscall_interposition) {
return i_pthread_create(thread, attr, start_routine, arg);
}
else {
return __real_pthread_create(thread, attr, start_routine, arg);
}
}
int __wrap_pthread_join(pthread_t thread, void ** value_ptr) {
debug_printf("pthread_join");
if (syscall_interposition) {
return i_pthread_join(thread, value_ptr);
}
else {
return __real_pthread_join(thread, value_ptr);
}
}
int __wrap_pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex) {
debug_printf("pthread_cond_wait");
if (syscall_interposition) {
return i_pthread_cond_wait(cond, mutex);
}
else {
return __real_pthread_cond_wait(cond, mutex);
}
}
int __wrap_pthread_cond_broadcast(pthread_cond_t * cond) {
debug_printf("pthread_cond_broadcast");
if (syscall_interposition) {
return i_pthread_cond_broadcast(cond);
}
else {
return __real_pthread_cond_broadcast(cond);
}
}
int __wrap_pthread_cond_signal(pthread_cond_t * cond) {
debug_printf("pthread_cond_signal");
if (syscall_interposition) {
return i_pthread_cond_signal(cond);
}
else {
return __real_pthread_cond_signal(cond);
}
}
int __wrap_pthread_cond_init(pthread_cond_t * cond,
const pthread_condattr_t * attr) {
debug_printf("pthread_cont_init");
if (syscall_interposition) {
return i_pthread_cond_init(cond, attr);
}
else {
return __real_pthread_cond_init(cond, attr);
}
}
#endif
#ifdef __cplusplus
}
#endif // __cplusplus
| [
"anders@diggi-1.cs.uit.no"
] | anders@diggi-1.cs.uit.no |
c063524b3f5148c890fb934d00993ee21759d62c | 246018707dd500a0953af4c5dc1d9e4ccd63743a | /Project/Project/prob87.cpp | b1e5faed27fac9f2ec9d894a3294c790053bd281 | [
"MIT"
] | permissive | LeoNardo10521/Leetcode | 1a7c3fbda747bd2b0114748613ef93cc592fc59d | 083f7929b916ec327b18edc1ed1ade9a0b51c089 | refs/heads/master | 2020-03-07T04:35:17.302113 | 2018-04-09T03:18:14 | 2018-04-09T03:18:14 | 127,270,314 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,546 | cpp | //My work
class Solution {
public:
bool count(string s1, string s2){
unordered_map <char, int> record1;
unordered_map <char, int> record2;
for (int i = 0; i<s1.length(); i++)
record1[s1[i]]++;
for (int i = 0; i<s2.length(); i++)
record2[s2[i]]++;
if (record2 != record1) return 0;
else return 1;
}
bool jud(string s1, string s2){
int l = s1.length();
if (l == 1) return s1[0] == s2[0];
// if (l<=1) return 1;
/* int l_s = l/2;
if ((count(s1.substr(0,l_s),s2.substr(0,l_s)) && count(s1.substr(l_s,l-l_s),s2.substr(l_s,l-l_s))) ||
(count(s1.substr(0,l-l_s),s2.substr(0,l-l_s)) && count(s2.substr(l-l_s,l_s),s1.substr(l-l_s,l_s))) ||
(count(s1.substr(0,l_s),s2.substr(l-l_s,l_s)) && count(s1.substr(l_s,l-l_s),s2.substr(0,l-l_s))) ||
(count(s2.substr(0,l_s),s1.substr(l-l_s,l_s)) && count(s2.substr(l_s,l-l_s),s1.substr(0,l-l_s))) ;*/
int flag = 0;
for (int i = 1; i<=l-1; i++)
if ((count(s1.substr(0,i),s2.substr(0,i)) && count(s1.substr(i,l-i),s2.substr(i,l-i))
&& jud(s1.substr(0,i),s2.substr(0,i)) && jud(s1.substr(i,l-i),s2.substr(i,l-i))) ||
(count(s1.substr(0,i),s2.substr(l-i,i)) && count(s1.substr(i,l-i),s2.substr(0,l-i))
&& jud(s1.substr(0,i),s2.substr(l-i,i)) && jud(s1.substr(i,l-i),s2.substr(0,l-i)))
)
{flag = 1; break;}
return flag;
}
bool isScramble(string s1, string s2) {
return jud(s1,s2);
}
};
//modified
class Solution {
public:
bool count(string s1, string s2){
vector<int> record1(26,0);
vector<int>record2(26,0);
for (int i = 0; i<s1.length(); i++)
record1[s1[i]-'a']++;
for (int i = 0; i<s2.length(); i++)
record2[s2[i]-'a']++;
return record1 == record2;
}
bool jud(string s1, string s2){
int l = s1.length();
if (s1 == s2) return 1;
if (!count(s1,s2)) return 0;
int flag = 0;
for (int i = 1; i<=l-1; i++)
if ((jud(s1.substr(0,i),s2.substr(0,i)) && jud(s1.substr(i,l-i),s2.substr(i,l-i))) ||
(jud(s1.substr(0,i),s2.substr(l-i,i)) && jud(s1.substr(i,l-i),s2.substr(0,l-i))))
{flag = 1; break;}
return flag;
}
bool isScramble(string s1, string s2) {
return jud(s1,s2);
}
}; | [
"shjdzlq@163.com"
] | shjdzlq@163.com |
094fffe623781c78af8b72cfc7507eb5ab94e197 | 6d1f45ea591f5bd5616de898c29c8f55b22d0ec1 | /include/glfw/__window/create_surface.hpp | 943dc26525579f400488864af52ec0043b4eb59a | [] | no_license | cpp-wrappers/glfw-wrapper | 0136602ad9f4eef07e19149198a5b16893706190 | 4a948ef7f58b0ccb5e1942787d10b2af839106db | refs/heads/master | 2023-06-23T22:43:09.106897 | 2023-06-14T04:58:19 | 2023-06-14T04:58:19 | 175,873,362 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,852 | hpp | #pragma once
#if __has_include(<vk/instance.hpp>) && __has_include(<vk/surface.hpp>)
#include "./handle.hpp"
#include "../__internal/function.hpp"
#include <vk/instance.hpp>
#include <vk/surface.hpp>
#include <types.hpp>
#include <tuple.hpp>
extern "C" GLFW_API int32 glfwCreateWindowSurface(
handle<vk::instance>::underlying_type instance,
handle<glfw::window>::underlying_type window,
const void* allocator,
handle<vk::surface>::underlying_type* surface
);
namespace glfw {
template<typename... Args>
requires types<Args...>::template exclusively_satisfy_predicates<
count_of_decayed_same_as<handle<vk::instance>> == 1,
count_of_decayed_same_as<handle<glfw::window>> == 1
>
vk::expected<handle<vk::surface>>
try_create_window_surface(Args&&... args) {
handle<vk::instance> instance = tuple{ args... }.template
get_decayed_same_as<handle<vk::instance>>();
handle<glfw::window> window = tuple{ args... }.template
get_decayed_same_as<handle<glfw::window>>();
handle<vk::surface> surface;
vk::result result {
glfwCreateWindowSurface(
instance.underlying(),
window.underlying(),
nullptr,
&surface.underlying()
)
};
if(result.error()) {
return result;
}
return surface;
}
template<typename... Args>
handle<vk::surface> create_window_surface(Args&&... args) {
vk::expected<handle<vk::surface>> result
= glfw::try_create_window_surface(forward<Args>(args)...);
if(result.is_unexpected()) {
vk::unexpected_handler(result.get_unexpected());
}
return result.get_expected();
}
} // glfw
inline handle<vk::surface> handle_interface<glfw::window>::
create_surface(handle<vk::instance> instance) {
return glfw::create_window_surface(
handle<glfw::window>{ underlying() },
instance
);
}
#endif | [
"hazeevaidar@gmail.com"
] | hazeevaidar@gmail.com |
39c992fd7333bcbb16b637118d745f0053dc4d4b | 07c3e4c4f82056e76285c81f14ea0fbb263ed906 | /Re-Abyss/app/components/UI/Title/Cursor/Builder.cpp | f01a18859bbd58165f400fdd63ab3c1f9c4902fe | [] | no_license | tyanmahou/Re-Abyss | f030841ca395c6b7ca6f9debe4d0de8a8c0036b5 | bd36687ddabad0627941dbe9b299b3c715114240 | refs/heads/master | 2023-08-02T22:23:43.867123 | 2023-08-02T14:20:26 | 2023-08-02T14:20:26 | 199,132,051 | 9 | 1 | null | 2021-11-22T20:46:39 | 2019-07-27T07:28:34 | C++ | UTF-8 | C++ | false | false | 375 | cpp | #include <abyss/components/UI/Title/Cursor/Builder.hpp>
#include <abyss/modules/UI/base/UIObj.hpp>
#include <abyss/components/UI/Title/Cursor/CursorCtrl.hpp>
namespace abyss::UI::Title::Cursor
{
void Builder::Build(UIObj* pUi)
{
// メイン追加
{
pUi->attach<CursorCtrl>(pUi)->setLayer(DrawLayer::World).setOrder(3);
}
};
} | [
"tyanmahou@gmail.com"
] | tyanmahou@gmail.com |
5c49d675eee539f882921235a7bf6964a1964e97 | 7dc44cd168c7f22bd59e85dfbc86860e50146c1d | /dnn/Project2/소스.cpp | d20fbd093e326e066b911626508b0d53c66138a6 | [] | no_license | 1jd92/dnn | 8a77fb278ef5211c3e8940a714f40bfdd13107b4 | 0471177af6ce227f801b770425403e0b7baa3290 | refs/heads/main | 2023-05-24T12:14:28.935698 | 2021-06-18T18:20:30 | 2021-06-18T18:20:30 | 378,227,712 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,122 | cpp | #include <stdio.h>
#include <memory.h>
#include <stdlib.h>
#include <time.h>
#include <cmath>
#include <iostream>
using namespace std;
template<typename T, typename U>
class _dnn;
template<typename T, typename U>
class _dnn_node;
template<typename T, typename U>
class _dnn2;
template<typename T>
class dnnlayer;
template<typename T>
class dnnconnection;
template<typename T>
class dnnconnectionlist;
template<typename T>
class dnnfloor;
template<typename T>
class dnn;
template<typename T>
class _math {
private:
T leaky;
public:
_math() {
leaky = static_cast<T>(0);
}
inline T _exp(const T a) noexcept {
return exp(a);
}
inline T _log(const T a) noexcept {
return log(a);
}
void setleaky(const T val) noexcept {
leaky = val;
}
T ReLU(const T val) const noexcept {
if (val > static_cast<T>(0)) return val;
else if (leaky) return leaky * val;
else return static_cast<T>(0);
}
T dReLU(const T val) const noexcept {
if (val > static_cast<T>(0)) return static_cast<T>(1);
else return leaky;
}
};
template<>
class _math<double> {
private:
double leaky;
public:
_math() {
leaky = 0.;
}
double _exp(double a) const noexcept {
union { double d; long long x; } u;
u.x = static_cast<long long>(6497320848556798LL * a + 0x3fef127e83d16f12LL);
return u.d;
}
double _log(double a) const noexcept{
union { double d; long long x; } u = { a };
return (u.x - 4606921278410026770) * 1.539095918623324e-16;
}
void setleaky(const double val) noexcept {
leaky = val;
}
double ReLU(const double val) const noexcept{
if (val > 0.) return val;
else if (leaky) return leaky * val;
else return 0.;
}
double dReLU(const double val) const noexcept {
if (val > 0.) return 1.;
else return leaky;
}
};
template<>
class _math<float> {
private:
float leaky;
public:
_math() {
leaky = 0.f;
}
float _exp(float a) const noexcept {
union { float f; int x; } u;
u.x = (int)(12102203 * a + 1064866805);
return u.f;
}
float _log(float a) const noexcept {
union { float f; int x; } u = { a };
return (u.x - 1064866805) * 8.262958405176314e-8f;
}
void setleaky(const float val) noexcept {
leaky = val;
}
float ReLU(const float val) const noexcept {
if (val > 0.f) return val;
else if (leaky) return leaky * val;
else return 0.f;
}
float dReLU(const float val) const noexcept {
if (val > 0.) return 1.f;
else return leaky;
}
};
template <typename T, typename U>
class _dnn {
protected:
U **mem, **emem;
int pmem, nmem;
public:
_dnn() noexcept {
pmem = 0;
nmem = 100;
mem = new U*[100];
emem = mem;
}
template<typename... V>
inline void add(V... ar) noexcept {
static U** mem2;
if (pmem + 1 >= nmem) {
mem2 = new U*[nmem + 100];
memcpy(mem2, mem, sizeof(U*) * nmem);
nmem += 100;
delete[] mem;
mem = mem2;
emem = mem + pmem;
}
*(emem++) = new U(ar...);
pmem++;
}
U& operator[](int n) {
if (n < 0) {
if (pmem + n >= 0) return *(mem[pmem + n]);
else throw(runtime_error("wrong memory access"));
}
else {
if (n < pmem) return *(mem[n]);
else throw(runtime_error("wrong memory access"));
}
}
virtual ~_dnn() {
for (U** _mem = mem; _mem != emem; delete _mem++);
delete[] mem;
}
};
template<typename T, typename U>
class _dnn_node :public _dnn<T, U> {
public:
void calculate() noexcept {
static U **i;
for (i = _dnn<T, U>::mem; i != _dnn<T, U>::emem; i++) (*i)->calculate();
}
};
enum _pooltype {
batchnormalization = 1,
softmax = 2,
avgpool = 4,
maxpool = 5,
secondpool = 6
};
template <typename T>
class dnnlayer :virtual public _math<T> {
protected:
mutable int i, j, k, l, m;
mutable T a, b, c;
mutable dnnconnection<T> **da, *db;
mutable dnnlayer<T> *dc;
dnnconnection<T> **memfrom, **ememfrom, **memto, **ememto;
int pmemfrom, nmemfrom, pmemto, nmemto;
T* dat;
int n, sqrtn;
T tn, bnavg, bnvar;
bool isallocated;
int pooltype;
public:
dnnlayer(int n, int pooltype = 0) noexcept : n(n), pooltype(pooltype) {
pmemfrom = 0; nmemfrom = 100; pmemto = 0; nmemto = 100;
memfrom = new dnnconnection<T> *[100];
memto = new dnnconnection<T> *[100];
ememfrom = memfrom; ememto = memto;
isallocated = false;
sqrtn = static_cast<int>(sqrt(static_cast<double>(n)));
if (n - sqrtn * sqrtn) sqrtn++;
tn = static_cast<T>(n); bnavg = static_cast<T>(0); bnvar = static_cast<T>(1);
}
inline void addfrom(dnnconnection<T> &ar) noexcept {
if (pmemfrom + 1 >= nmemfrom) {
dnnconnection<T>** memfrom2 = new dnnconnection<T> *[nmemfrom + 100];
memcpy(memfrom2, memfrom, sizeof(dnnconnection<T>*) * nmemfrom);
nmemfrom += 100;
delete[] memfrom;
memfrom = memfrom2;
}
*(ememfrom++) = &ar;
ar.next = this;
pmemfrom++;
}
inline void addto(dnnconnection<T> &ar) noexcept {
if (pmemto + 1 >= nmemto) {
dnnconnection<T>** memto2 = new dnnconnection<T> *[nmemto + 100];
memcpy(memto2, memto, sizeof(dnnconnection<T>*) * nmemto);
nmemto += 100;
delete[] memto;
memto = memto2;
}
*(ememto++) = &ar;
ar.prev = this;
pmemto++;
}
void loadptr(T* ptr) noexcept {
if (isallocated) {
isallocated = 0;
delete[] dat;
}
dat = ptr;
}
void allocate() noexcept {
isallocated = true;
dat = new T[n];
}
inline void calculate_rst() {
for (i = 0; i < n; i++) dat[i] = static_cast<T>(0.);
}
inline void calculate_con() {
for (da = memfrom; da != ememfrom; da++) {
db = *da; dc = db->prev; i = dc->n;
for (j = 0; j < n; j++) {
for (k = 0; k < i; k++) {
if ((l = db->nid[k][j]) != -1) dat[j] += db->weight[l] * dc->dat[k];
}
dat[j] += db->weight[db->nid[i][j]];
}
}
}
inline void calculate_bn() {
a = 0; b = 0; tn = static_cast<T>(n);
for (i = 0; i < n; i++) a += dat[i];
a /= tn;
for (i = 0; i < n; i++) {
dat[i] -= a;
b += dat[i] * dat[i];
}
b /= tn;
if (b < static_cast<T>(1e-10)) b = static_cast<T>(1e-10);
c = bnvar / b;
for (i = 0; i < n; i++) dat[i] = c * dat[i] + bnavg;
}
inline void calculate_smax() {
a = 0;
for (i = 0; i < n; i++) {
dat[i] = _math<T>::_exp(dat[i]);
a += dat[i];
}
for (i = 0; i < n; i++) dat[i] /= a;
}
inline void calculate_avgp() {
i = 0;
for (da = memfrom; da != ememfrom; da++) {
db = *da; dc = db->prev; l = dc->n;
i += db->area*db->area;
for (j = 0; j < n; j++)
for (k = 0; k < l; k++)
if (db->nid[k][j] != -1) dat[j] += dc->dat[k];
}
for (j = 0; j < n; j++) dat[j] /= i;
}
inline void calculate_maxp() {
l = 0;
for (i = 0; i < n; i++) dat[i] = static_cast<T>(-NAN);
for (da = memfrom; da != ememfrom; da++) {
db = *da; dc = db->prev; m = dc->n;
l += db->area*db->area;
for (j = 0; j < n; j++)
for (k = 0; k < m; k++)
if (db->nid[k][j] != -1) {
if (dat[j] > dc->dat[k]);
else dat[j] = dc->dat[k];
}
}
}
inline void calculate_2ndp() {
l = 0;
for (i = 0; i < n; i++) dat[i] = static_cast<T>(-NAN);
for (da = memfrom; da != ememfrom; da++) {
db = *da; dc = db->prev; m = dc->n;
l += db->area*db->area;
for (j = 0; j < n; j++)
for (k = 0; k < m; k++)
if (db->nid[k][j] != -1) {
if (dat[j] > dc->dat[k]);
else dat[j] = dc->dat[k];
}
}
}
inline void calculate_ReLU() {
for (i = 0; i < n; i++) dat[i] = _math<T>::ReLU(dat[i]);
}
void calculate() {
if (pooltype < 5) {
calculate_rst();
if (pooltype == 4) calculate_avgp();
else {
calculate_con();
if (pooltype & 1) calculate_bn();
if (pooltype > 1) calculate_smax();
calculate_ReLU();
}
}
else if (pooltype == 5) calculate_maxp();
else calculate_2ndp();
}
virtual ~dnnlayer() {
if (isallocated) delete[] dat;
for (dnnconnection<T>** _memfrom = memfrom; _memfrom != ememfrom; delete _memfrom++);
delete[] memfrom;
for (dnnconnection<T>** _memto = memto; _memto != ememto; delete _memto++);
delete[] memto;
}
friend class dnnconnection<T>;
friend class dnn<T>;
};
template <typename T>
class dnnfloor : public _dnn_node<T, dnnlayer<T>> {
public:
friend class dnn<T>;
};
template <typename T>
class dnn : virtual public _dnn_node <T, dnnfloor<T>>,_math<T> {
mutable int i, j, k;
mutable T a,e;
mutable dnnfloor<T>* b;
mutable dnnlayer<T>* c;
mutable T *d;
mutable dnnconnection<T> **da, **db;
mutable dnnfloor<T> **dc, **dd;
mutable dnnlayer<T> **de, **df;
T *_ans;
T *_ans_mem;
T *_out;
int nout;
T **_in;
int nin;
T error;
dnnlayer<T>* lin;
dnnlayer<T>* lout;
dnnconnectionlist<T> cl;
public:
dnn() {
nout = -1;_out = nullptr; lout = nullptr; _ans_mem = nullptr; nin = -1; _in = nullptr; lin = nullptr;
}
void allocate() {
for (da = cl._dnn <T, dnnconnection<T>>::mem, db = cl._dnn <T, dnnconnection<T>>::emem; da != db; da++) (*da)->allocate();
i = 0;
for (dc = _dnn <T, dnnfloor<T>>::mem,dd= _dnn <T, dnnfloor<T>>::emem; dc != dd; dc++)
for (de = (*dc)->_dnn <T, dnnlayer<T>>::mem, df = (*dc)->_dnn <T, dnnlayer<T>>::emem; de != df; de++)
if (i) (*de)->allocate();
else i = 1;
if (_dnn <T, dnnfloor<T>>::pmem) {
b = _dnn <T, dnnfloor<T>>::mem[_dnn <T, dnnfloor<T>>::pmem - 1];
if (b->_dnn <T, dnnlayer<T>>::pmem) {
nout = b->_dnn<T, dnnlayer<T>>::mem[0]->n;
_out = b->_dnn<T, dnnlayer<T>>::mem[0]->dat;
lout = b->_dnn<T, dnnlayer<T>>::mem[0];
_ans_mem = new T[nout];
}
else throw(runtime_error("wrong memory access"));
b = _dnn <T, dnnfloor<T>>::mem[0];
if (b->_dnn <T, dnnlayer<T>>::pmem) {
nin = b->_dnn<T, dnnlayer<T>>::mem[0]->n;
_in=&(b->_dnn<T, dnnlayer<T>>::mem[0]->dat);
lin = b->_dnn<T, dnnlayer<T>>::mem[0];
}
else throw(runtime_error("wrong memory access"));
}
else throw(runtime_error("wrong memory access"));
}
dnnconnectionlist<T>& connection() {
return cl;
}
void setinput(T* in) {
if (lin) lin->loadptr(in);
else throw(runtime_error("wrong memory access"));
}
void setoutput(T* out) {
_ans = out;
}
void setanswer(int n) {
if (nout) {
_ans = _ans_mem;
for (i = 0; i < nout; i++) _ans[i] = static_cast<T>(0);
_ans[n] = static_cast<T>(1);
}
else throw (runtime_error("wrong memory access"));
}
T* getoutput() {
if (lout) return _out;
else throw (runtime_error("wrong memory access"));
}
T feedforward() {
if (lout){
_dnn_node<T, dnnfloor<T>>::calculate();
a = static_cast<T>(0);
for (i = 0; i < nout; i++) {
if ((e = _out[i]) < static_cast<T>(1e-10)) e = static_cast<T>(1e-10);
a -= _ans[i] * _math<T>::_log(e);
}
error = a;
return a;
}
else throw (runtime_error("wrong memory access"));
}
int getpredict() {
if (lout) {
j = -1; a = static_cast<T>(-NAN);
for (i = 0; i < nout; i++) {
if (a > _out[i]);
else {
a = _out[i], j = i;
}
}
}
return j;
}
int getpredict(T &probablity) {
probablity = a;
return getpredict();
}
int getpredict(T &probablity, T &errorval) {
probablity = a;
errorval = error;
return getpredict();
}
void backpropagation(T* out) {
}
};
template <typename T>
class dnnconnection {
public:
dnnlayer<T> *prev = 0, *next = 0;
T* weight;
int* weight_dropout;
int nweight;
int nweight_withoutbias;
int freedom;
int area;//input size
double alpha, momentum;
int dropout;
int nfrom, nto;
int rnfrom, rnto;
int** nid;
public:
dnnconnection(dnnlayer<T> &prev, dnnlayer<T> &next, int freedom, int area, double alpha, double momentum, double dropout)
:freedom(freedom), area(area), alpha(alpha), momentum(momentum), dropout(static_cast<int>(dropout*32768.)) {
prev.addto(*this);
next.addfrom(*this);
}
dnnconnection(int freedom, int area, double alpha, double momentum, double dropout)
:freedom(freedom), area(area), alpha(alpha), momentum(momentum), dropout(static_cast<int>(dropout*32768.)) {
prev = nullptr;
next = nullptr;
}
void allocate() {
static int i, j, k, l, t, u, upd;
nto = prev->n;
rnto = prev->sqrtn;
nfrom = next->n;
rnfrom = next->sqrtn;
if (freedom < 0) freedom = nfrom / (-freedom);
if (area < 0) area = rnto * 2 / (-area);
nweight = 0;
if (next->pooltype>3) {
nid = new int*[nto + 1];
for (i = 0; i < nto + 1; i++) {
nid[i] = new int[nfrom];
for (j = 0; j < nfrom; j++) nid[i][j] = -1;
}
for (k = 0; k < area; k++)
for (l = 0; l < area; l++)
for (i = 0; i < freedom; i++)
for (j = i; j < nfrom; j += freedom) {
t = k - area / 2 + (j % rnfrom) * rnto / rnfrom;
u = l - area / 2 + (j / rnfrom) * rnto / rnfrom;
if (t >= 0 && t < rnto && u >= 0 && u < rnto)
if (t * rnto + u < nto) nid[t * rnto + u][j] = 0;
}
nweight_withoutbias = 0;
weight = nullptr; weight_dropout = nullptr;
}
else {
nid = new int*[nto + 1];
for (i = 0; i < nto + 1; i++) {
nid[i] = new int[nfrom];
for (j = 0; j < nfrom; j++) nid[i][j] = -1;
}
upd = 0;
for (k = 0; k < area; k++)
for (l = 0; l < area; l++)
for (i = 0; i < freedom; i++) {
for (j = i; j < nfrom; j += freedom) {
t = k - area / 2 + (j % rnfrom) * rnto / rnfrom;
u = l - area / 2 + (j / rnfrom) * rnto / rnfrom;
if (t >= 0 && t < rnto && u >= 0 && u < rnto)
if (t * rnto + u < nto) {
upd = 1;
nid[t * rnto + u][j] = nweight;
}
}
if (upd) upd = 0, nweight++;
}
nweight_withoutbias = nweight;
for (i = 0; i < freedom; i++) {
for (j = i; j < nfrom; j += freedom) nid[nto][j] = nweight;
nweight++;
}
weight = new T[nweight];
weight_dropout = new int[nweight];
for (i = 0; i < nweight_withoutbias; i++) {
weight[i] = static_cast<T>(1.) / (static_cast<T>(area) * static_cast<T>(area));
weight_dropout[i] = 1;
}
for (i = nweight_withoutbias; i < nweight; i++) {
weight[i] = 0;
weight_dropout[i] = 1;
}
}
}
void padding(T val, T bias) {
for (int i = 0; i < nweight_withoutbias; i++) weight[i] = val;
for (int i = nweight_withoutbias; i < nweight; i++) weight[i] = bias;
}
void _dropout() {
for (int i = 0; i < nweight; i++) weight_dropout[i] = ((rand() & 32767) < dropout);
}
~dnnconnection() {
if (nid) {
for (int i = 0; i < nfrom; i++) delete[] nid[i];
delete[] nid;
}
if (weight) delete[] weight;
if (weight_dropout) delete[] weight_dropout;
}
friend class dnnlayer<T>;
friend class dnn<T>;
};
template <typename T>
class dnnconnectionlist : public _dnn <T, dnnconnection<T>> {
public:
friend class dnn<T>;
};
int main() {
srand(time(0));
try {
float in[3] = { 0.1f,0.1f,0.1f };
dnn<float> a;
a.add();
a.add();
a[0].add(3);
a[1].add(5);
a.connection().add(a[0][0], a[1][0], -1, -1, 0, 1, 1);
a.allocate();
a.feedforward();
cout << a.connection()[-1].nweight << " " << a.connection()[-1].nweight_withoutbias;
}
catch (runtime_error a) {
cout << a.what() << endl;
}
/*
try {
dnn<float> a;
//double alpha,double momentum,double dropout
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
a.add(0.1, 0, 0);
//int n
a[0].add(28 * 28);
for (int i = 0; i < 32; i++) a[1].add(28 * 28);
for (int i = 0; i < 32; i++) a[2].add(14 * 14);
for (int i = 0; i < 64; i++) a[3].add(14 * 14);
for (int i = 0; i < 64; i++) a[4].add(7 * 7);
a[5].add(3136);
a[6].add(128);
a[7].add(10);
for (int i = 0; i < 32; i++) {
//int freedom, int area, int ispool, int pooltype
a.connection().add(1, 3, 0, 1);
a[0][0].addfrom(a.connection()[-1]);
a[1][i].addto(a.connection()[-1]);
}
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 32; j++) {
a.connection().add(1, 2, 1, 1);
a[1][i].addfrom(a.connection()[-1]);
a[2][j].addto(a.connection()[-1]);
}
}
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 64; j++) {
a.connection().add(1, 3, 0, 1);
a[2][i].addfrom(a.connection()[-1]);
a[3][j].addto(a.connection()[-1]);
}
}
for (int i = 0; i < 64; i++) {
for (int j = 0; j < 64; j++) {
a.connection().add(1, 2, 1, 1);
a[3][i].addfrom(a.connection()[-1]);
a[4][j].addto(a.connection()[-1]);
}
}
for (int i = 0; i < 64; i++) {
a.connection().add(-1, -1, 0, 1);
a[4][i].addfrom(a.connection()[-1]);
a[5][0].addto(a.connection()[-1]);
}
a.connection().add(-1, -1, 0, 1);
a[5][0].addfrom(a.connection()[-1]);
a[6][0].addto(a.connection()[-1]);
a.connection().add(-1, -1, 0, 1);
a[6][0].addfrom(a.connection()[-1]);
a[7][0].addto(a.connection()[-1]);
}
catch (runtime_error a) {
cout << a.what() << endl;
}
*/
}
| [
"noreply@github.com"
] | 1jd92.noreply@github.com |
02c40d6a8c9edc44e742fc75420855ba1f6ef763 | 7a89c2e347e17f0aed9e16f2de81f6021ad56023 | /src/Components_Web/WeightSensor_Web.cpp | cacc8d61247016aaf4b90b98b3af38de969d0661 | [] | no_license | Whonymous/Gbox420 | aee2618ee817eff34939e8892d4eef52c7f22e00 | 27bbc1a356c2a5d7f040293c3608c6b1288324f9 | refs/heads/master | 2022-12-17T11:51:27.223683 | 2020-09-16T23:02:39 | 2020-09-16T23:02:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,951 | cpp | #include "WeightSensor_Web.h"
WeightSensor_Web::WeightSensor_Web(const __FlashStringHelper *Name, Module_Web *Parent, Settings::WeightSensorSettings *DefaultSettings) : Common(Name), WeightSensor(Name,Parent,DefaultSettings), Common_Web(Name)
{
this->Parent = Parent;
this->Name = Name;
Parent->addToReportQueue(this);
Parent->addToRefreshQueue_Minute(this);
Parent->addToRefreshQueue_Sec(this);
Parent->addToWebsiteQueue_Load(this);
Parent->addToWebsiteQueue_Refresh(this);
Parent->addToWebsiteQueue_Button(this);
Parent->addToWebsiteQueue_Field(this);
}
void WeightSensor_Web::reportToJSON()
{
Common_Web::reportToJSON(); ///< Adds a curly bracket { that needs to be closed at the end
strcat_P(LongMessage, (PGM_P)F("\"}")); ///< closing the curly bracket
}
void WeightSensor_Web::websiteEvent_Load(__attribute__((unused)) char *url)
{
if (strncmp(url, "/S",2) == 0)
{
///
}
}
void WeightSensor_Web::websiteEvent_Refresh(__attribute__((unused)) char *url)
{
if (strncmp(url, "/S",2) == 0) ////When the settings page is refreshed
{
WebServer.setArgString(getComponentName(F("Offset")), toText(*Offset));
WebServer.setArgString(getComponentName(F("Scale")), toText(*Scale));
}
else if(strncmp(url, "/G",2) == 0)
{
WebServer.setArgFloat(getComponentName(F("W")), getWeight());
}
}
void WeightSensor_Web::websiteEvent_Button(char *Button)
{
if (!isThisMyComponent(Button))
{
return;
}
else
{
if (strcmp_P(ShortMessage, (PGM_P)F("Tare")) == 0)
{
triggerTare();
}
}
}
void WeightSensor_Web::websiteEvent_Field(char *Field)
{
if (!isThisMyComponent(Field))
{
return;
}
else
{
if (strcmp_P(ShortMessage, (PGM_P)F("Calibrate")) == 0)
{
triggerCalibration(WebServer.getArgInt());
}
else if (strcmp_P(ShortMessage, (PGM_P)F("Scale")) == 0)
{
setScale(WebServer.getArgFloat());
}
}
} | [
"growboxguy@gmail.com"
] | growboxguy@gmail.com |
690f1ddffc64f82bf8b2072bb7af3d6b94102d75 | b39b0652150a981c9e08d63b78a5b8d57197601e | /doom_py/src/lib/ViZDoomExceptions.cpp | e9bd19b6830b9a2fb36d47251e6abc61072e3463 | [
"MIT"
] | permissive | jaekyeom/doom-py | 476026afd7dad6ecd47cf2633c745e3b09fa5c9c | a7d08a0f2e92b0ba4be538e182791be4c5a11a1b | refs/heads/master | 2020-03-06T18:52:38.651857 | 2018-04-05T14:28:14 | 2018-04-05T14:28:14 | 127,015,715 | 1 | 0 | MIT | 2018-03-27T16:29:10 | 2018-03-27T16:29:10 | null | UTF-8 | C++ | false | false | 3,018 | cpp | /*
Copyright (C) 2016 by Wojciech Jaśkowski, Michał Kempka, Grzegorz Runc, Jakub Toczek, Marek Wydmuch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "ViZDoomExceptions.h"
#include <cstring>
namespace vizdoom{
/* FileDoesNotExistException */
FileDoesNotExistException::FileDoesNotExistException(std::string path){
this->path = path;
}
FileDoesNotExistException::~FileDoesNotExistException() throw(){}
const char* FileDoesNotExistException::what() const throw(){
std::string what = std::string("File \"") + this->path + "\" does not exist.";
return strdup(what.c_str());
}
/* MessageQueueException */
const char* MessageQueueException::what() const throw(){ return "ViZDoom message queue error."; }
/* SharedMemoryException */
const char* SharedMemoryException::what() const throw(){ return "ViZDoom shared memory error."; }
/* ViZDoomErrorException */
const char* ViZDoomErrorException::what() const throw(){ return "Controlled ViZDoom instance reported error."; }
/* ViZDoomIsNotRunningException */
const char* ViZDoomIsNotRunningException::what() const throw(){ return "Controlled ViZDoom instance is not running or not ready."; }
/* ViZDoomMismatchedVersionException */
ViZDoomMismatchedVersionException::ViZDoomMismatchedVersionException(std::string vizdoomVersion, std::string libVersion){
this->vizdoomVersion = vizdoomVersion;
this->libVersion = libVersion;
}
ViZDoomMismatchedVersionException::~ViZDoomMismatchedVersionException() throw(){}
const char* ViZDoomMismatchedVersionException::what() const throw(){
std::string what = "Controlled ViZDoom version (" + this->vizdoomVersion + ") does not match library version (" + this->libVersion + ").";
return strdup(what.c_str());
}
/* ViZDoomUnexpectedExitException */
const char* ViZDoomUnexpectedExitException::what() const throw(){ return "Controlled ViZDoom instance exited unexpectedly."; }
} | [
"jietang@openai.com"
] | jietang@openai.com |
9b2b9977f4dfe96fe4517598e6fa325f7f83e4f1 | 61d4e279bb59dab28e11ac17f99e466cf8aba3cc | /src/server/scripts/Pandaria/MogushanPalace/instance_mogu_shan_palace.cpp | 4dc9ea7dd012fc775b61a4f074654d4cd549ceeb | [] | no_license | dufernst/5.4.8-Wow-source | a840af25441ec9c38622c16de40b2997d4605ad1 | 5511dffb1e9ad2e2e0b794288c4b9ea5041112d5 | refs/heads/master | 2021-01-16T22:12:12.568039 | 2015-08-19T22:55:05 | 2015-08-19T22:55:05 | 41,120,934 | 2 | 10 | null | 2015-08-20T22:03:56 | 2015-08-20T22:03:56 | null | UTF-8 | C++ | false | false | 23,507 | cpp | /*
Dungeon : Template of Mogu'shan Palace 87-89
Instance General Script
Jade servers
*/
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "VMapFactory.h"
#include "mogu_shan_palace.h"
class instance_mogu_shan_palace : public InstanceMapScript
{
public:
instance_mogu_shan_palace() : InstanceMapScript("instance_mogu_shan_palace", 994) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const
{
return new instance_mogu_shan_palace_InstanceMapScript(map);
}
struct instance_mogu_shan_palace_InstanceMapScript : public InstanceScript
{
/*
** Trial of the king.
*/
uint64 xin_guid;
uint64 kuai_guid;
uint64 ming_guid;
uint64 haiyan_guid;
std::list<uint64> scrappers;
std::list<uint64> adepts;
std::list<uint64> grunts;
/*
** End of the trial of the king.
*/
/*
** Gekkan.
*/
uint64 gekkan;
uint64 glintrok_ironhide;
uint64 glintrok_skulker;
uint64 glintrok_oracle;
uint64 glintrok_hexxer;
/*
** End of Gekkan.
*/
/*
** Xin the weaponmaster.
*/
std::list<uint64> animated_staffs;
std::list<uint64> animated_axes;
std::list<uint64> swordLauncherGuids;
/*
** End of Xin the weaponmaster.
*/
uint64 doorBeforeTrialGuid;
uint64 trialChestGuid;
uint64 doorAfterTrialGuid;
uint64 doorBeforeKingGuid;
instance_mogu_shan_palace_InstanceMapScript(Map* map) : InstanceScript(map) {}
void Initialize()
{
xin_guid = 0;
kuai_guid = 0;
ming_guid = 0;
haiyan_guid = 0;
doorBeforeTrialGuid = 0;
trialChestGuid = 0;
doorAfterTrialGuid = 0;
doorBeforeKingGuid = 0;
gekkan = 0;
glintrok_ironhide = 0;
glintrok_skulker = 0;
glintrok_oracle = 0;
glintrok_hexxer = 0;
}
bool SetBossState(uint32 id, EncounterState state)
{
if (!InstanceScript::SetBossState(id, state))
return false;
switch (id)
{
case DATA_TRIAL_OF_THE_KING:
HandleGameObject(doorBeforeTrialGuid, state != IN_PROGRESS);
if (GameObject* chest = instance->GetGameObject(trialChestGuid))
chest->SetPhaseMask(state == DONE ? 1: 128, true);
break;
case DATA_GEKKAN:
HandleGameObject(doorAfterTrialGuid, state == DONE);
// Todo : mod temp portal phasemask
break;
case DATA_XIN_THE_WEAPONMASTER:
HandleGameObject(doorBeforeTrialGuid, state != IN_PROGRESS);
break;
}
return true;
}
void OnGameObjectCreate(GameObject* go)
{
switch (go->GetEntry())
{
case GO_DOOR_BEFORE_TRIAL: doorBeforeTrialGuid = go->GetGUID(); break;
case GO_TRIAL_CHEST: trialChestGuid = go->GetGUID(); go->SetPhaseMask(128, true); break;
case GO_DOOR_AFTER_TRIAL: doorAfterTrialGuid = go->GetGUID(); break;
case GO_DOOR_BEFORE_KING: doorBeforeKingGuid = go->GetGUID(); break;
}
}
void OnCreatureCreate(Creature* creature)
{
OnCreatureCreate_gekkan(creature);
OnCreatureCreate_trial_of_the_king(creature);
OnCreatureCreate_xin_the_weaponmaster(creature);
}
void OnUnitDeath(Unit* unit)
{
OnUnitDeath_gekkan(unit);
}
void SetData(uint32 type, uint32 data)
{
switch (type)
{
case DATA_GEKKAN_ADDS:
if (Creature* pGekkan = instance->GetCreature(gekkan))
{
if (Unit * target = pGekkan->SelectNearestTarget(100.0f))
{
pGekkan->AI()->AttackStart(target);
if (Creature* ironhide = instance->GetCreature(glintrok_ironhide))
ironhide->AI()->AttackStart(target);
if (Creature* skulker = instance->GetCreature(glintrok_skulker))
skulker->AI()->AttackStart(target);
if (Creature* oracle = instance->GetCreature(glintrok_oracle))
oracle->AI()->AttackStart(target);
if (Creature* hexxer = instance->GetCreature(glintrok_hexxer))
hexxer->AI()->AttackStart(target);
}
}
break;
}
SetData_trial_of_the_king(type, data);
SetData_xin_the_weaponmaster(type, data);
}
uint32 GetData(uint32 type)
{
return 0;
}
uint64 GetData64(uint32 type)
{
switch (type)
{
case TYPE_GET_ENTOURAGE_0:
return glintrok_hexxer;
case TYPE_GET_ENTOURAGE_1:
return glintrok_ironhide;
case TYPE_GET_ENTOURAGE_2:
return glintrok_oracle;
case TYPE_GET_ENTOURAGE_3:
return glintrok_skulker;
}
return 0;
}
bool isWipe()
{
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if(Player* plr = i->getSource())
if (plr->isAlive() && !plr->isGameMaster())
return false;
}
}
return true;
}
void SetData_xin_the_weaponmaster(uint32 type, uint32 data)
{
switch (type)
{
case TYPE_ACTIVATE_ANIMATED_STAFF:
{
if (Creature* creature = instance->GetCreature(WoWSource::Containers::SelectRandomContainerElement(animated_staffs)))
if (creature->GetAI())
creature->GetAI()->DoAction(0); //ACTION_ACTIVATE
break;
}
case TYPE_ACTIVATE_ANIMATED_AXE:
{
for (auto guid : animated_axes)
{
if (Creature* creature = instance->GetCreature(guid))
{
if (data)
{
creature->AddAura(SPELL_AXE_TOURBILOL, creature);
creature->AddAura(SPELL_PERMANENT_FEIGN_DEATH, creature);
creature->GetMotionMaster()->MoveRandom(50.0f);
}
else
{
creature->RemoveAurasDueToSpell(SPELL_AXE_TOURBILOL);
creature->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
creature->GetMotionMaster()->MoveTargetedHome();
}
}
}
break;
}
case TYPE_ACTIVATE_SWORD:
{
Position center;
center.Relocate(-4632.39f, -2613.20f, 22.0f);
bool randPos = urand(0, 1);
/* Y
-
***********
-> 1 * 2 <-
+ *********** - X
-> 3 * 4 <-
***********
+ */
for (auto itr: swordLauncherGuids)
{
bool mustActivate = false;
if (Creature* launcher = instance->GetCreature(itr))
{
if (randPos) // Zone 2 & 3
{
if (launcher->GetPositionX() > center.GetPositionX() && launcher->GetPositionY() > center.GetPositionY()
|| launcher->GetPositionX() < center.GetPositionX() && launcher->GetPositionY() < center.GetPositionY())
mustActivate = true;
}
else // Zone 1 & 4
{
if (launcher->GetPositionX() > center.GetPositionX() && launcher->GetPositionY() < center.GetPositionY()
|| launcher->GetPositionX() < center.GetPositionX() && launcher->GetPositionY() > center.GetPositionY())
mustActivate = true;
}
if (data && mustActivate)
launcher->AddAura(SPELL_THROW_AURA, launcher);
else
launcher->RemoveAurasDueToSpell(SPELL_THROW_AURA);
}
}
}
break;
}
}
void OnCreatureCreate_xin_the_weaponmaster(Creature* creature)
{
switch (creature->GetEntry())
{
case 59481:
creature->SetReactState(REACT_PASSIVE);
break;
case CREATURE_ANIMATED_STAFF:
animated_staffs.push_back(creature->GetGUID());
break;
case CREATURE_ANIMATED_AXE:
animated_axes.push_back(creature->GetGUID());
creature->SetReactState(REACT_PASSIVE);
creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 30316);
break;
case CREATURE_LAUNCH_SWORD:
swordLauncherGuids.push_back(creature->GetGUID());
creature->AddAura(SPELL_PERMANENT_FEIGN_DEATH, creature);
break;
}
}
void OnUnitDeath_gekkan(Unit* unit)
{
if (unit->ToCreature())
{
switch (unit->ToCreature()->GetEntry())
{
case CREATURE_GLINTROK_IRONHIDE:
case CREATURE_GLINTROK_SKULKER:
case CREATURE_GLINTROK_ORACLE:
case CREATURE_GLINTROK_HEXXER:
{
if (Creature* c = instance->GetCreature(gekkan))
if (c->GetAI())
c->GetAI()->DoAction(0); //ACTION_ENTOURAGE_DIED
}
break;
}
}
}
void OnCreatureCreate_gekkan(Creature* creature)
{
switch (creature->GetEntry())
{
case CREATURE_GEKKAN:
gekkan = creature->GetGUID();
break;
case CREATURE_GLINTROK_IRONHIDE:
glintrok_ironhide = creature->GetGUID();
break;
case CREATURE_GLINTROK_SKULKER:
glintrok_skulker = creature->GetGUID();
break;
case CREATURE_GLINTROK_ORACLE:
glintrok_oracle = creature->GetGUID();
break;
case CREATURE_GLINTROK_HEXXER:
glintrok_hexxer = creature->GetGUID();
break;
}
}
void SetData_trial_of_the_king(uint32 type, uint32 data)
{
switch (type)
{
case TYPE_OUTRO_05:
{
if (Creature* haiyan = instance->GetCreature(haiyan_guid))
if (haiyan->GetAI())
haiyan->GetAI()->DoAction(1); //ACTION_OUTRO_02
}
break;
case TYPE_OUTRO_04:
{
if (Creature* kuai = instance->GetCreature(kuai_guid))
if (kuai->GetAI())
kuai->GetAI()->DoAction(3); //ACTION_OUTRO_02
}
break;
case TYPE_OUTRO_03:
{
if (Creature* ming = instance->GetCreature(ming_guid))
if (ming->GetAI())
ming->GetAI()->DoAction(2); //ACTION_OUTRO_02
}
break;
case TYPE_OUTRO_02:
{
if (Creature* haiyan = instance->GetCreature(haiyan_guid))
if (haiyan->GetAI())
haiyan->GetAI()->DoAction(0); //ACTION_OUTRO_01
}
break;
case TYPE_OUTRO_01:
{
if (Creature* ming = instance->GetCreature(ming_guid))
if (ming->GetAI())
ming->GetAI()->DoAction(1); //ACTION_OUTRO_01
}
break;
case TYPE_MING_INTRO:
{
if (Creature* ming = instance->GetCreature(ming_guid))
if (ming->GetAI())
ming->GetAI()->DoAction(0); //ACTION_INTRO
}
break;
case TYPE_WIPE_FIRST_BOSS:
{
Creature* xin = instance->GetCreature(xin_guid);
if (!xin)
return;
xin->SetVisible(true);
if (xin->GetAI())
xin->GetAI()->Reset();
switch (data)
{
case 0:
for (auto guid : adepts)
{
Creature* creature = instance->GetCreature(guid);
if (!creature)
continue;
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
creature->RemoveAura(121569);
}
break;
case 1:
for (auto guid : scrappers)
{
Creature* creature = instance->GetCreature(guid);
if (!creature)
continue;
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
creature->RemoveAura(121569);
}
break;
case 2:
for (auto guid : grunts)
{
Creature* creature = instance->GetCreature(guid);
if (!creature)
continue;
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
creature->RemoveAura(121569);
}
break;
}
}
break;
case TYPE_MING_ATTACK:
{
//Move the adepts
for (auto guid : adepts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE
}
Creature* ming = instance->GetCreature(ming_guid);
if (!ming)
return;
ming->GetMotionMaster()->MovePoint(0, -4237.658f, -2613.860f, 16.48f);
ming->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
ming->SetReactState(REACT_AGGRESSIVE);
}
break;
case TYPE_KUAI_ATTACK:
{
//Move the scrappers
for (auto guid : scrappers)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE
}
Creature* kuai = instance->GetCreature(kuai_guid);
if (!kuai)
return;
kuai->GetMotionMaster()->MovePoint(0, -4215.359f, -2601.283f, 16.48f);
kuai->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
kuai->SetReactState(REACT_AGGRESSIVE);
}
break;
case TYPE_HAIYAN_ATTACK:
{
//Move the scrappers
for (auto guid : grunts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE
}
Creature* haiyan = instance->GetCreature(haiyan_guid);
if (!haiyan)
return;
haiyan->GetMotionMaster()->MovePoint(0, -4215.772f, -2627.216f, 16.48f);
haiyan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
haiyan->SetReactState(REACT_AGGRESSIVE);
}
break;
case TYPE_ALL_ATTACK:
{
for (auto guid : adepts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(2); //ACTION_ATTACK
std::list<uint64>::iterator itr = grunts.begin();
std::advance(itr, urand(0, grunts.size() - 1));
Creature* grunt = instance->GetCreature(*itr);
if (creature && grunt)
creature->Attack(grunt, true);
}
for (auto guid : grunts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(2); //ACTION_ATTACK
std::list<uint64>::iterator itr = scrappers.begin();
std::advance(itr, urand(0, scrappers.size() - 1));
Creature* scrapper = instance->GetCreature(*itr);
if (creature && scrapper)
creature->Attack(scrapper, true);
}
for (auto guid : scrappers)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(2); //ACTION_ATTACK
std::list<uint64>::iterator itr = adepts.begin();
std::advance(itr, urand(0, adepts.size() - 1));
Creature* adept = instance->GetCreature(*itr);
if (creature && adept)
creature->Attack(adept, true);
}
SetBossState(DATA_TRIAL_OF_THE_KING, DONE);
}
break;
case TYPE_MING_RETIRED:
//Retire the adepts
for (auto guid : adepts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
}
break;
case TYPE_KUAI_RETIRED:
//Retire the adepts
for (auto guid : scrappers)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
}
break;
case TYPE_HAIYAN_RETIRED:
//Retire the adepts
for (auto guid : grunts)
{
Creature* creature = instance->GetCreature(guid);
if (creature && creature->GetAI())
creature->GetAI()->DoAction(1); //EVENT_RETIRE
}
break;
}
}
void OnCreatureCreate_trial_of_the_king(Creature* creature)
{
switch (creature->GetEntry())
{
case CREATURE_GURTHAN_SCRAPPER:
scrappers.push_back(creature->GetGUID());
break;
case CREATURE_HARTHAK_ADEPT:
adepts.push_back(creature->GetGUID());
break;
case CREATURE_KARGESH_GRUNT:
grunts.push_back(creature->GetGUID());
break;
case CREATURE_KUAI_THE_BRUTE:
kuai_guid = creature->GetGUID();
creature->SetReactState(REACT_PASSIVE);
break;
case CREATURE_MING_THE_CUNNING:
ming_guid = creature->GetGUID();
creature->SetReactState(REACT_PASSIVE);
break;
case CREATURE_HAIYAN_THE_UNSTOPPABLE:
haiyan_guid = creature->GetGUID();
creature->SetReactState(REACT_PASSIVE);
break;
case CREATURE_XIN_THE_WEAPONMASTER_TRIGGER:
xin_guid = creature->GetGUID();
creature->SetReactState(REACT_PASSIVE);
break;
case CREATURE_WHIRLING_DERVISH:
break;
}
}
};
};
class go_mogushan_palace_temp_portal : public GameObjectScript
{
public:
go_mogushan_palace_temp_portal() : GameObjectScript("go_mogushan_palace_temp_portal") { }
bool OnGossipHello(Player* player, GameObject* go)
{
if (go->GetPositionZ() < 0.0f)
player->NearTeleportTo(go->GetPositionX(), go->GetPositionY(), 22.31f, go->GetOrientation());
else
player->NearTeleportTo(go->GetPositionX(), go->GetPositionY(), -39.0f, go->GetOrientation());
return false;
}
};
void AddSC_instance_mogu_shan_palace()
{
new instance_mogu_shan_palace();
new go_mogushan_palace_temp_portal();
}
| [
"andra778@yahoo.com"
] | andra778@yahoo.com |
838b9ec95ffc550ce4384ca158e0299be94ea630 | f556301fd9bdba0e463bb6f08bd83db0fd258a8d | /extensions/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc | e9ac4aa2d4c50073493a6848ea34b972fbd89f32 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | blockspacer/chromium_base_conan | ce7c0825b6a62c2c1272ccab5e31f15d316aa9ac | 726d2a446eb926f694e04ab166c0bbfdb40850f2 | refs/heads/master | 2022-09-14T17:13:27.992790 | 2022-08-24T11:04:58 | 2022-08-24T11:04:58 | 225,695,691 | 18 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 72 | inc | #pragma once
#include "absl/debugging/internal/stacktrace_arm-inl.inc"
| [
"user@email.ru"
] | user@email.ru |
ee0862cd031c5c6fdc26df3a159cf657deb883a6 | 254cbaaf24dde982be6cb877220c95734723753c | /ddutil.cpp | 885d5ac78366d1db4872471ab445fd3342fde0d4 | [] | no_license | ForestJay/SpaceAdventure | f56a92c673af3ba14d3cbeb7187eb2202deaed6e | 76d9fdf23f95cc68c168b84c8586f4566b82afd2 | refs/heads/master | 2021-01-10T17:21:08.793077 | 2015-09-26T22:20:38 | 2015-09-26T22:20:38 | 43,224,915 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,328 | cpp | /*==========================================================================
*
* Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
*
* File: ddutil.cpp
* Content: Routines for loading bitmap and palettes from resources
*
***************************************************************************/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <ddraw.h>
#include "ddutil.h"
/*
* DDLoadBitmap
*
* create a DirectDrawSurface from a bitmap resource.
*
*/
extern "C" IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap,
int dx, int dy, DWORD dwFlags)
{
HBITMAP hbm;
BITMAP bm;
DDSURFACEDESC ddsd;
IDirectDrawSurface *pdds;
//
// try to load the bitmap as a resource, if that fails, try it as a file
//
hbm = (HBITMAP)LoadImage(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, dx, dy, LR_CREATEDIBSECTION);
if (hbm == NULL)
hbm = (HBITMAP)LoadImage(NULL, szBitmap, IMAGE_BITMAP, dx, dy, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
if (hbm == NULL)
return NULL;
//
// get size of the bitmap
//
GetObject(hbm, sizeof(bm), &bm); // get size of bitmap
//
// create a DirectDrawSurface for this bitmap
//
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT |DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | dwFlags;
ddsd.dwWidth = bm.bmWidth;
ddsd.dwHeight = bm.bmHeight;
if (pdd->CreateSurface(&ddsd, &pdds, NULL) != DD_OK)
return NULL;
DDCopyBitmap(pdds, hbm, 0, 0, 0, 0);
DeleteObject(hbm);
return pdds;
}
/*
* DDReLoadBitmap
*
* load a bitmap from a file or resource into a directdraw surface.
* normally used to re-load a surface after a restore.
*
*/
HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap)
{
HBITMAP hbm;
HRESULT hr;
//
// try to load the bitmap as a resource, if that fails, try it as a file
//
hbm = (HBITMAP)LoadImage(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
if (hbm == NULL)
hbm = (HBITMAP)LoadImage(NULL, szBitmap, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
if (hbm == NULL)
return E_FAIL;
hr = DDCopyBitmap(pdds, hbm, 0, 0, 0, 0);
DeleteObject(hbm);
return hr;
}
/*
* DDCopyBitmap
*
* draw a bitmap into a DirectDrawSurface
*
*/
extern "C" HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy)
{
HDC hdcImage;
HDC hdc;
BITMAP bm;
DDSURFACEDESC ddsd;
HRESULT hr;
if (hbm == NULL || pdds == NULL)
return E_FAIL;
//
// make sure this surface is restored.
//
pdds->Restore();
//
// select bitmap into a memoryDC so we can use it.
//
hdcImage = CreateCompatibleDC(NULL);
SelectObject(hdcImage, hbm);
//
// get size of the bitmap
//
GetObject(hbm, sizeof(bm), &bm); // get size of bitmap
dx = dx == 0 ? bm.bmWidth : dx; // use the passed size, unless zero
dy = dy == 0 ? bm.bmHeight : dy;
//
// get size of surface.
//
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH;
pdds->GetSurfaceDesc(&ddsd);
if ((hr = pdds->GetDC(&hdc)) == DD_OK)
{
StretchBlt(hdc, 0, 0, ddsd.dwWidth, ddsd.dwHeight, hdcImage, x, y, dx, dy, SRCCOPY);
pdds->ReleaseDC(hdc);
}
DeleteDC(hdcImage);
return hr;
}
//
// DDLoadPalette
//
// Create a DirectDraw palette object from a bitmap resoure
//
// if the resource does not exist or NULL is passed create a
// default 332 palette.
//
extern "C" IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap)
{
IDirectDrawPalette* ddpal;
int i;
int n;
int fh;
HRSRC h;
LPBITMAPINFOHEADER lpbi;
PALETTEENTRY ape[256];
RGBQUAD * prgb;
//
// build a 332 palette as the default.
//
for (i=0; i<256; i++)
{
ape[i].peRed = (BYTE)(((i >> 5) & 0x07) * 255 / 7);
ape[i].peGreen = (BYTE)(((i >> 2) & 0x07) * 255 / 7);
ape[i].peBlue = (BYTE)(((i >> 0) & 0x03) * 255 / 3);
ape[i].peFlags = (BYTE)0;
}
//
// get a pointer to the bitmap resource.
//
if (szBitmap && (h = FindResource(NULL, szBitmap, RT_BITMAP)))
{
lpbi = (LPBITMAPINFOHEADER)LockResource(LoadResource(NULL, h));
prgb = (RGBQUAD*)((BYTE*)lpbi + lpbi->biSize);
if (lpbi == NULL || lpbi->biSize < sizeof(BITMAPINFOHEADER))
n = 0;
else if (lpbi->biBitCount > 8)
n = 0;
else if (lpbi->biClrUsed == 0)
n = 1 << lpbi->biBitCount;
else
n = lpbi->biClrUsed;
//
// a DIB color table has its colors stored BGR not RGB
// so flip them around.
//
for(i=0; i<n; i++ )
{
ape[i].peRed = prgb[i].rgbRed;
ape[i].peGreen = prgb[i].rgbGreen;
ape[i].peBlue = prgb[i].rgbBlue;
ape[i].peFlags = 0;
}
}
else if (szBitmap && (fh = _lopen(szBitmap, OF_READ)) != -1)
{
BITMAPFILEHEADER bf;
BITMAPINFOHEADER bi;
_lread(fh, &bf, sizeof(bf));
_lread(fh, &bi, sizeof(bi));
_lread(fh, ape, sizeof(ape));
_lclose(fh);
if (bi.biSize != sizeof(BITMAPINFOHEADER))
n = 0;
else if (bi.biBitCount > 8)
n = 0;
else if (bi.biClrUsed == 0)
n = 1 << bi.biBitCount;
else
n = bi.biClrUsed;
//
// a DIB color table has its colors stored BGR not RGB
// so flip them around.
//
for(i=0; i<n; i++ )
{
BYTE r = ape[i].peRed;
ape[i].peRed = ape[i].peBlue;
ape[i].peBlue = r;
}
}
pdd->CreatePalette(DDPCAPS_8BIT, ape, &ddpal, NULL);
return ddpal;
}
/*
* DDColorMatch
*
* convert a RGB color to a pysical color.
*
* we do this by leting GDI SetPixel() do the color matching
* then we lock the memory and see what it got mapped to.
*/
extern "C" DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb)
{
COLORREF rgbT;
HDC hdc;
DWORD dw = CLR_INVALID;
DDSURFACEDESC ddsd;
HRESULT hres;
//
// use GDI SetPixel to color match for us
//
if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK)
{
rgbT = GetPixel(hdc, 0, 0); // save current pixel value
SetPixel(hdc, 0, 0, rgb); // set our value
pdds->ReleaseDC(hdc);
}
//
// now lock the surface so we can read back the converted color
//
ddsd.dwSize = sizeof(ddsd);
while ((hres = pdds->Lock(NULL, &ddsd, 0, NULL)) == DDERR_WASSTILLDRAWING)
;
if (hres == DD_OK)
{
dw = *(DWORD *)ddsd.lpSurface; // get DWORD
dw &= (1 << ddsd.ddpfPixelFormat.dwRGBBitCount)-1; // mask it to bpp
pdds->Unlock(NULL);
}
//
// now put the color that was there back.
//
if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK)
{
SetPixel(hdc, 0, 0, rgbT);
pdds->ReleaseDC(hdc);
}
return dw;
}
/*
* DDSetColorKey
*
* set a color key for a surface, given a RGB.
* if you pass CLR_INVALID as the color key, the pixel
* in the upper-left corner will be used.
*/
extern "C" HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb)
{
DDCOLORKEY ddck;
ddck.dwColorSpaceLowValue = DDColorMatch(pdds, rgb);
ddck.dwColorSpaceHighValue = ddck.dwColorSpaceLowValue;
return pdds->SetColorKey(DDCKEY_SRCBLT, &ddck);
}
| [
"forest.handford@affectiva.com"
] | forest.handford@affectiva.com |
ef098221dbdfc1cb163be159674acb81a0bcb410 | ec42dd1913d515b6d4d836fa2a84deaf47cdadbc | /LiveLogViewer/LiveLog_data.cpp | 3c637816b09c8d62870c9362eac70dcae21812d5 | [] | no_license | WuFan1992/LiveLogViewer | 5b46826a9efc18ab87b592cd5e3981c2e60e2840 | 6c0735c725fa2c8964393dcccf2d941e76b1585a | refs/heads/master | 2021-07-18T03:54:52.117893 | 2017-10-25T10:24:13 | 2017-10-25T10:24:13 | 105,745,696 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 714 | cpp | #include "LiveLog_data.h"
#include "Widget_element.h"
#include <iostream>
#include <qDebug>
using namespace std;
void LiveLog_data::show_source_pressure()
{
qDebug() << source_pressure;
}
void LiveLog_data::show_target_pressure()
{
qDebug() << target_pressure;
}
void LiveLog_data::show_mesure_pressure()
{
qDebug() << mesure_pressure;
}
void LiveLog_data::show_target_temperature()
{
qDebug() << target_temperature;
}
void LiveLog_data::show_mesure_temp_one_line()
{
for (int j = 0; j < mesure_temp_one_line.size(); j++)
{
qDebug() << mesure_temp_one_line.at(j);
}
}
double LiveLog_data::get_time()
{
return time;
}
double LiveLog_data::get_source_pressure()
{
return source_pressure;
} | [
"fanwuchine@gmail.com"
] | fanwuchine@gmail.com |
181e136e34e7a866dbb5718c313c8cf312cd942c | aaebbe73cc851ba9ed8a3493abedb739d122533a | /server/yslib/thread_pool/thread_pool.h | 3366394ddbd0935364afded985f07547c06c696e | [] | no_license | coeux/lingyu-meisha-jp | 7bc1309bf8304a294f9a42d23b985879a28afbc0 | 11972819254b8567cda33d17ffc40b384019a936 | refs/heads/master | 2021-01-21T13:48:12.593930 | 2017-02-14T06:46:02 | 2017-02-14T06:46:02 | 81,812,311 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,365 | h | #ifndef _THREAD_POOL_H_
#define _THREAD_POOL_H_
#include <vector>
#include <assert.h>
using namespace std;
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#include "log.h"
#include "thread_pool_log_def.h"
class thread_pool_t : public boost::noncopyable
{
public:
typedef boost::shared_ptr<boost::asio::io_service> sp_ios_t;
typedef boost::shared_ptr<boost::asio::io_service::work> sp_work_t;
typedef vector<sp_ios_t> sp_ios_vt_t;
typedef vector<sp_work_t> sp_work_vt_t;
public:
thread_pool_t():m_started(false), m_thread_num(1), m_poll_tid(0){}
~thread_pool_t() { stop(); }
void start(uint16_t thread_num_ = 1);
void stop();
sp_ios_t get_io(uint16_t tid_)
{
if (!m_started)
return sp_ios_t();
uint16_t witch = tid_ % m_thread_num;
return m_sp_ios_vt[witch];
}
sp_ios_t poll_io()
{
if (!m_started)
return sp_ios_t();
uint16_t witch = m_poll_tid % m_thread_num;
m_poll_tid++;
return m_sp_ios_vt[witch];
}
template<typename F, typename... Args>
uint16_t async_do(uint16_t tid_, F fun_, Args... args_) //tid thread id
{
if (m_sp_ios_vt.empty())
return -1;
uint16_t witch = tid_ % m_thread_num;
m_sp_ios_vt[witch]->post(boost::bind(&thread_pool_t::handle_do<F, Args...>, this, fun_, args_...));
return witch;
}
template<typename F, typename... Args>
uint16_t async_do(F fun_, Args... args_) //tid thread id
{
if (m_sp_ios_vt.empty())
return -1;
uint16_t witch = m_poll_tid % m_thread_num;
m_poll_tid++;
m_sp_ios_vt[witch]->post(boost::bind(&thread_pool_t::handle_do<F, Args...>, this, fun_, args_...));
return witch;
}
int get_thread_num() { return m_thread_num; }
private:
template<typename F, typename... Args>
void handle_do(F fun_, const Args&... args_)
{
fun_(args_...);
}
private:
bool m_started;
uint16_t m_thread_num;
uint16_t m_poll_tid;
sp_work_vt_t m_sp_work_vt;
sp_ios_vt_t m_sp_ios_vt;
boost::thread_group m_threads;
};
#endif
| [
"641311015@qq.com"
] | 641311015@qq.com |
ba26bc0450d3e3f80c33ec1e3eef2cbd0a15166d | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/CMake/CMake-gumtree/Kitware_CMake_old_new_old_log_857.cpp | 9c028a7894b182986e402756c28ff2800f5cba40 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 237 | cpp | archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Ignoring out-of-order file @%jx (%s) %jd < %jd",
(intmax_t)file->number,
iso9660->pathname.s,
(intmax_t)file->offset,
(intmax_t)iso9660->current_position); | [
"993273596@qq.com"
] | 993273596@qq.com |
583d62156ae1fc6f45981ad1051f9f4478389039 | 0d8a443005e7f8c4dc3b8b59606463d0b334a7ba | /main.cpp | 67e841787e7c837fb8629650361e1e7086253dcb | [] | no_license | HoShuHang/QTGraphics | 1547e214131abdee6cc5d5d49da53a629bcc3c19 | c7e5ba0520d0cfeb3c92c57e7ebb59246943797d | refs/heads/master | 2021-01-10T17:48:50.399007 | 2016-01-05T08:58:34 | 2016-01-05T08:58:34 | 46,609,834 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 275 | cpp | #include "cppunitlite/TestHarness.h"
//#include "utShape.h"
//#include "utGraphics.h"
//#include "utHW3.h"
#include "utTryQt.h"
//#include "utModel.h"
//#include "utVisitor.h"
int main(int argc, char** argv) {
TestResult tr;
TestRegistry::runAllTests(tr);
return 0;
}
| [
"kwite2002@gmail.com"
] | kwite2002@gmail.com |
bd920715a6891dc3482dae6390694cff350a8e69 | 746353363abb3f4e7536de0cbed223dd99dcdcb0 | /src/core/tracer/include/agz/tracer/factory/raw/medium.h | aa93769d63c5e05086490ad2fb34e1ea6e55a834 | [
"MIT"
] | permissive | vcoda/Atrc | 65aeb7d9b9a9578d1d768fc58951ffa7853e025e | 8b6614053d0866b409961d1ddb84238523fa5b02 | refs/heads/master | 2020-09-12T12:36:32.629569 | 2019-11-08T06:53:42 | 2019-11-08T06:53:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 328 | h | #pragma once
#include <agz/tracer/core/medium.h>
AGZ_TRACER_BEGIN
std::shared_ptr<Medium> create_absorbtion_medium(
const Spectrum &sigma_a);
std::shared_ptr<Medium> create_homogeneous_medium(
const Spectrum &sigma_a,
const Spectrum &sigma_s,
real g);
std::shared_ptr<Medium> create_void();
AGZ_TRACER_END
| [
"airguanz@gmail.com"
] | airguanz@gmail.com |
5c7f59cb581ff1e5fbe73dcc99778089391b8a41 | ec8bd794331fb9548a7a3306a1a378227cbfaf79 | /cleanHack_FileIO.cpp | 8c117d5ab0736e30ae83e317747c11eb66faf054 | [] | no_license | awsdert/renegade | 8b3c4524e183e02d1f644bd85bfd324ea875f2b6 | 8060d04ef9cdf6c41090195ea43a93d7d4de8eaf | refs/heads/master | 2021-04-09T16:53:42.289316 | 2012-06-21T17:01:07 | 2012-06-21T17:01:07 | 32,187,805 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,078 | cpp | #include "G.h"
void G::mLoadHack( void )
{
s32 mode = 0, index, count;
xStr txt, text, path, file, name;
xStrT st;
xAStr array;
HACK* hack = new HACK;
CODE code;
u32 tmp;
tree_T->DeleteAllItems();
xTreeID root, doNotModifyThisTreeId;
gGetHackFile( path, file );
wxTextFile file_TF;
file_TF.Open( file );
mNewHack( GetHackRoot(), wxT( "(m)" ), hack, doNotModifyThisTreeId );
for
(
text = file_TF.GetFirstLine();
!file_TF.Eof();
text = file_TF.GetNextLine()
)
{
switch ( mode )
{
case 0: case 2:
if ( text.StartsWith( wxT( "\"" ) ) )
{
if ( mode == 2 )
{
index = 0;
count = array.GetCount();
for ( ; index < count; )
{
BuildCode( code, index, array );
hack->NewCode( code );
}
if ( hack->id == 0u ) mSetHack( root, hack );
else mNewHack( root, name, hack, doNotModifyThisTreeId );
}
hack->Clear();
array.Clear();
st.SetString( text, wxT( '"' ) );
st.GetNextToken();
name = st.GetNextToken();
mode = 1;
}
else if ( mode == 2 ) array.Add( text );
break;
case 1:
hack->id = GetHex( text.Mid( 4, 4 ) );
tmp = GetHex( text.Left( 4 ) );
hack->use = ( ( tmp & HACK_USE ) > 0u );
hack->useRB = ( ( tmp & HACK_RB ) > 0u );
if ( hack->id != 0u )
{
tmp = GetHex( text.Mid( 13, 4 ), 2u );
root = mFindHack( tmp );
}
else root = GetHackRoot();
mode = 2;
}
}
if ( mode == 2 )
{
index = 0;
count = array.GetCount();
for ( ; index < count; )
{
BuildCode( code, index, array );
hack->NewCode( code );
}
if ( hack->id == 0u ) mSetHack( root, hack );
else mNewHack( root, name, hack, doNotModifyThisTreeId );
}
delete hack;
tree_T->SelectItem( GetHackRoot() );
}
void G::mSaveHack( void )
{
xStr path, file;
u16 id = 0u;
gGetHackFile( path, file );
hack_TF.Open( file );
hack_TF.Clear();
mSaveHack( GetHackRoot(), id, 0u );
hack_TF.Write( wxTextFileType_Dos );
hack_TF.Close();
}
void G::mSaveHack( xTreeID root, u16 &id, u16 parentID )
{
HACK* hack = mGetHack( root );
xStr text = tree_T->GetItemText( root );
u16 head = 0u;
if ( hack->use ) head += HACK_USE;
if ( hack->useRB ) head += HACK_RB;
hack_TF.AddLine( wxT( '"' ) + text + wxT( '"' ), wxTextFileType_Dos );
text.Printf( hex16 + hex16 + wxT( " 0000" ) + hex16, head, id, parentID );
hack_TF.AddLine( text, wxTextFileType_Dos );
xAStr array;
s16 iCount = hack->GetCount();
s16 j, jCount;
for ( s16 i = 0; i < iCount; ++i )
{
array = BuildCode( ( *hack )[ i ] );
jCount = array.GetCount();
for ( j = 0; j < jCount; ++j )
hack_TF.AddLine( array[ j ], wxTextFileType_Dos );
}
// Iterate through children
parentID = id;
++id;
xTreeID kid;
xTreeIDV cookie;
for
(
kid = tree_T->GetFirstChild( root, cookie );
kid.IsOk();
kid = tree_T->GetNextChild( root, cookie )
)
{
mSaveHack( kid, id, parentID );
}
}
| [
"gb2985@ef3b2f1c-1a11-4849-4361-9c7d57dfec43"
] | gb2985@ef3b2f1c-1a11-4849-4361-9c7d57dfec43 |
3d6b955bce11244a9d84527c5a8a51c9c77a2404 | d6507daa66666878fb018b394cc0a959a0113ec3 | /01/013.cc | 5bb8f09573d628115e5c394c6739ac1d95678e81 | [] | no_license | dmnsn7/projecteuler | a5d0098cdafcdb68901ecc68c0ba9df77d039ac4 | a737037b9521c940b6b6ed12488ee73e41229b70 | refs/heads/master | 2023-06-09T21:33:46.625979 | 2023-06-07T12:17:21 | 2023-06-07T12:17:21 | 215,997,596 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,420 | cc | // Copyright [2017] <dmnsn7@gmail.com>
#include <bits/stdc++.h>
using std::string;
using std::to_string;
using std::vector;
const int CNT = 100;
const int RESERVED_LEN = 15;
const int QUERY_LEN = 10;
const vector<string> NUMBER = {
"37107287533902102798797998220837590246510135740250",
"46376937677490009712648124896970078050417018260538",
"74324986199524741059474233309513058123726617309629",
"91942213363574161572522430563301811072406154908250",
"23067588207539346171171980310421047513778063246676",
"89261670696623633820136378418383684178734361726757",
"28112879812849979408065481931592621691275889832738",
"44274228917432520321923589422876796487670272189318",
"47451445736001306439091167216856844588711603153276",
"70386486105843025439939619828917593665686757934951",
"62176457141856560629502157223196586755079324193331",
"64906352462741904929101432445813822663347944758178",
"92575867718337217661963751590579239728245598838407",
"58203565325359399008402633568948830189458628227828",
"80181199384826282014278194139940567587151170094390",
"35398664372827112653829987240784473053190104293586",
"86515506006295864861532075273371959191420517255829",
"71693888707715466499115593487603532921714970056938",
"54370070576826684624621495650076471787294438377604",
"53282654108756828443191190634694037855217779295145",
"36123272525000296071075082563815656710885258350721",
"45876576172410976447339110607218265236877223636045",
"17423706905851860660448207621209813287860733969412",
"81142660418086830619328460811191061556940512689692",
"51934325451728388641918047049293215058642563049483",
"62467221648435076201727918039944693004732956340691",
"15732444386908125794514089057706229429197107928209",
"55037687525678773091862540744969844508330393682126",
"18336384825330154686196124348767681297534375946515",
"80386287592878490201521685554828717201219257766954",
"78182833757993103614740356856449095527097864797581",
"16726320100436897842553539920931837441497806860984",
"48403098129077791799088218795327364475675590848030",
"87086987551392711854517078544161852424320693150332",
"59959406895756536782107074926966537676326235447210",
"69793950679652694742597709739166693763042633987085",
"41052684708299085211399427365734116182760315001271",
"65378607361501080857009149939512557028198746004375",
"35829035317434717326932123578154982629742552737307",
"94953759765105305946966067683156574377167401875275",
"88902802571733229619176668713819931811048770190271",
"25267680276078003013678680992525463401061632866526",
"36270218540497705585629946580636237993140746255962",
"24074486908231174977792365466257246923322810917141",
"91430288197103288597806669760892938638285025333403",
"34413065578016127815921815005561868836468420090470",
"23053081172816430487623791969842487255036638784583",
"11487696932154902810424020138335124462181441773470",
"63783299490636259666498587618221225225512486764533",
"67720186971698544312419572409913959008952310058822",
"95548255300263520781532296796249481641953868218774",
"76085327132285723110424803456124867697064507995236",
"37774242535411291684276865538926205024910326572967",
"23701913275725675285653248258265463092207058596522",
"29798860272258331913126375147341994889534765745501",
"18495701454879288984856827726077713721403798879715",
"38298203783031473527721580348144513491373226651381",
"34829543829199918180278916522431027392251122869539",
"40957953066405232632538044100059654939159879593635",
"29746152185502371307642255121183693803580388584903",
"41698116222072977186158236678424689157993532961922",
"62467957194401269043877107275048102390895523597457",
"23189706772547915061505504953922979530901129967519",
"86188088225875314529584099251203829009407770775672",
"11306739708304724483816533873502340845647058077308",
"82959174767140363198008187129011875491310547126581",
"97623331044818386269515456334926366572897563400500",
"42846280183517070527831839425882145521227251250327",
"55121603546981200581762165212827652751691296897789",
"32238195734329339946437501907836945765883352399886",
"75506164965184775180738168837861091527357929701337",
"62177842752192623401942399639168044983993173312731",
"32924185707147349566916674687634660915035914677504",
"99518671430235219628894890102423325116913619626622",
"73267460800591547471830798392868535206946944540724",
"76841822524674417161514036427982273348055556214818",
"97142617910342598647204516893989422179826088076852",
"87783646182799346313767754307809363333018982642090",
"10848802521674670883215120185883543223812876952786",
"71329612474782464538636993009049310363619763878039",
"62184073572399794223406235393808339651327408011116",
"66627891981488087797941876876144230030984490851411",
"60661826293682836764744779239180335110989069790714",
"85786944089552990653640447425576083659976645795096",
"66024396409905389607120198219976047599490197230297",
"64913982680032973156037120041377903785566085089252",
"16730939319872750275468906903707539413042652315011",
"94809377245048795150954100921645863754710598436791",
"78639167021187492431995700641917969777599028300699",
"15368713711936614952811305876380278410754449733078",
"40789923115535562561142322423255033685442488917353",
"44889911501440648020369068063960672322193204149535",
"41503128880339536053299340368006977710650566631954",
"81234880673210146739058568557934581403627822703280",
"82616570773948327592232845941706525094512325230608",
"22918802058777319719839450180888072429661980811197",
"77158542502016545090413245809786882778948721859617",
"72107838435069186155435662884062257473692284509516",
"20849603980134001723930671666823555245252804609722",
"53503534226472524250874054075591789781264330331690",
};
int main() {
int64_t sum = 0;
for (int i = 0; i < CNT; i++) {
string reserved =
string(NUMBER[i].begin(), NUMBER[i].begin() + RESERVED_LEN);
int64_t num;
sscanf(reserved.c_str(), "%ld", &num);
sum += num;
}
string s_sum = to_string(sum);
s_sum = string(s_sum.begin(), s_sum.begin() + QUERY_LEN);
printf("%s\n", s_sum.c_str());
return 0;
}
| [
"jie.liu@airbnb.com"
] | jie.liu@airbnb.com |
ea05f20db6f8fcfa7b3e4211a4036ee32e56962f | 530cea82ed7cb8fabc8efb3fbd3ed393be8eb71f | /OpenArk/DriverModView.h | a9678d1f814f6d4159fc53b619ced935e8acfc66 | [] | no_license | Qazwar/OpenArk-1 | abb0618c5364dc131a35a93c61861394e2242605 | ad6a35d9679997f8da30f07b9f4b2169b2179906 | refs/heads/master | 2022-06-27T03:20:41.791514 | 2020-05-09T09:43:17 | 2020-05-09T09:43:17 | 268,182,709 | 1 | 0 | null | 2020-05-31T00:28:22 | 2020-05-31T00:28:21 | null | UTF-8 | C++ | false | false | 442 | h | #pragma once
#include "StdDialog.h"
#include "common.h"
class DriverModView :public StdTable
{
Q_OBJECT
public:
enum Col {
DriverName,
BaseAddress,
ImageSize,
DriverObject,
DriverPath,
ServiceName,
LoadOrder,
FileCompany,
LastCol
};
DriverModView(QWidget *parent = 0);
~DriverModView();
void InitView();
void SetContextMenu();
private slots:
void OnNouse();
void OnRefresh();
private:
QMenu mMenu;
}; | [
"782598478@qq.com"
] | 782598478@qq.com |
34c64acb37e92c0991fc340f6c880448395b7fd0 | 60a15a584b00895e47628c5a485bd1f14cfeebbe | /comps/docs/ImageDoc/imgactions.h | bb484214d888db0be40c2e9f894ca43100d102fa | [] | no_license | fcccode/vt5 | ce4c1d8fe819715f2580586c8113cfedf2ab44ac | c88049949ebb999304f0fc7648f3d03f6501c65b | refs/heads/master | 2020-09-27T22:56:55.348501 | 2019-06-17T20:39:46 | 2019-06-17T20:39:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,766 | h | #ifndef __imgactions_h__
#define __imgactions_h__
struct CAphineParams;
//[ag]1. classes
//paul12.04.2002
#define DECLARE_AVAIBLE() \
bool IsAvaible() \
{ \
CChechAvailable avail; \
return avail.IsAvaible(); \
} \
struct CChechAvailable
{
bool IsAvaible();
};
bool fill_background_color( IUnknown* punk_image );
class CCropRectCtrl;
class CActionCrop : public CInteractiveActionBase,
public CLongOperationImpl
{
ENABLE_UNDO();
ENABLE_MULTYINTERFACE();
DECLARE_INTERFACE_MAP();
DECLARE_DYNCREATE(CActionCrop)
GUARD_DECLARE_OLECREATE(CActionCrop)
public:
CActionCrop();
virtual ~CActionCrop();
public:
virtual bool Invoke();
virtual bool IsAvaible();
virtual bool IsChecked();
virtual bool IsRequiredInvokeOnTerminate(){return false;}
virtual bool DoLButtonDown( CPoint pt );
virtual bool DoUpdateSettings();
virtual bool Initialize();
virtual void Finalize();
virtual bool DoUndo();
virtual bool DoRedo();
protected:
void StoreCurrentExecuteParams();
bool CanDoCrop();
void _CreateController(CSize sizeContr);
CCropRectCtrl* m_pctrl;
CSize m_size;
CPoint m_point;
CObjectListUndoRecord m_changes;
IUnknownPtr m_ptrImage;
};
class CActionLongUndoBase : public CActionBase,
public CLongOperationImpl
{
ENABLE_UNDO();
ENABLE_MULTYINTERFACE();
DECLARE_INTERFACE_MAP();
public:
virtual bool DoUndo();
virtual bool DoRedo();
CObjectListUndoRecord m_changes;
};
class CActionBorders : public CFilterBase
{
DECLARE_DYNCREATE(CActionBorders)
GUARD_DECLARE_OLECREATE(CActionBorders)
public:
CActionBorders();
virtual ~CActionBorders();
public:
virtual bool InvokeFilter();
color** m_ppColors;
color m_colors;
};
class CActionClone : public CActionLongUndoBase
{
DECLARE_DYNCREATE(CActionClone)
GUARD_DECLARE_OLECREATE(CActionClone)
public:
CActionClone();
virtual ~CActionClone();
public:
virtual bool Invoke();
// virtual bool IsAvaible();
// Max : 2706
DECLARE_AVAIBLE()
};
class CActionExpansion : public CActionLongUndoBase
{
DECLARE_DYNCREATE(CActionExpansion)
GUARD_DECLARE_OLECREATE(CActionExpansion)
public:
CActionExpansion();
virtual ~CActionExpansion();
public:
virtual bool Invoke();
virtual bool IsAvaible();
CImageWrp m_imageSource;
CImageWrp** m_pimagesDest;
long m_nImages;
};
class CActionMerge : public CFilterBase
{
DECLARE_DYNCREATE(CActionMerge)
GUARD_DECLARE_OLECREATE(CActionMerge)
public:
CActionMerge();
virtual ~CActionMerge();
public:
virtual bool InvokeFilter();
// vk begin
virtual bool IsAvaible();
// vk end
CImageWrp** m_pImagesSource;
CImageWrp m_imageDest;
int m_nImages;
};
class CTransformBase2 : public CFilterBase
{
public:
CTransformBase2();
~CTransformBase2();
public:
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget){};
virtual bool SetParams(CAphineParams* pparams) = 0;
virtual bool InvokeFilter();
virtual CRect GetRect(CRect rcSrc){return rcSrc;};
protected:
color** m_ppcolorscr;
color*** m_ppcolordest;
byte** m_ppmask;
long m_colors;
bool m_bAphineTransform;
bool m_bCopyMask;
};
class CActionRotate270 : public CTransformBase2
{
DECLARE_DYNCREATE(CActionRotate270)
GUARD_DECLARE_OLECREATE(CActionRotate270)
public:
CActionRotate270();
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget);
virtual bool SetParams(CAphineParams* pparams);
virtual CRect GetRect(CRect rcSrc){return CRect(rcSrc.left, rcSrc.top, rcSrc.left + rcSrc.Height(), rcSrc.top + rcSrc.Width());};
};
class CActionRotate180 : public CTransformBase2
{
DECLARE_DYNCREATE(CActionRotate180)
GUARD_DECLARE_OLECREATE(CActionRotate180)
public:
CActionRotate180();
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget);
virtual bool SetParams(CAphineParams* pparams);
};
class CActionRotate90 : public CTransformBase2
{
DECLARE_DYNCREATE(CActionRotate90)
GUARD_DECLARE_OLECREATE(CActionRotate90)
public:
CActionRotate90();
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget);
virtual bool SetParams(CAphineParams* pparams);
virtual CRect GetRect(CRect rcSrc){return CRect(rcSrc.left, rcSrc.top, rcSrc.left + rcSrc.Height(), rcSrc.top + rcSrc.Width());};
};
class CActionMirrorVert : public CTransformBase2
{
DECLARE_DYNCREATE(CActionMirrorVert)
GUARD_DECLARE_OLECREATE(CActionMirrorVert)
public:
CActionMirrorVert();
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget);
virtual bool SetParams(CAphineParams* pparams);
// Max : 2706
DECLARE_AVAIBLE()
};
class CActionMirrorHorz : public CTransformBase2
{
DECLARE_DYNCREATE(CActionMirrorHorz)
GUARD_DECLARE_OLECREATE(CActionMirrorHorz)
public:
CActionMirrorHorz();
virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget);
virtual bool SetParams(CAphineParams* pparams);
// Max : 2706
DECLARE_AVAIBLE()
};
class CActionRotate : public CTransformBase2
{
DECLARE_DYNCREATE(CActionRotate)
GUARD_DECLARE_OLECREATE(CActionRotate)
public:
CActionRotate();
public:
virtual bool SetParams(CAphineParams* pparams);
};
class CActionResize : public CTransformBase2
{
DECLARE_DYNCREATE(CActionResize)
GUARD_DECLARE_OLECREATE(CActionResize)
public:
CActionResize();
public:
virtual bool SetParams(CAphineParams* pparams);
};
class CActionImageTransform : public CActionBase
{
DECLARE_DYNCREATE(CActionImageTransform)
GUARD_DECLARE_OLECREATE(CActionImageTransform)
ENABLE_UNDO();
public:
CActionImageTransform();
virtual ~CActionImageTransform();
public:
virtual bool Invoke();
//undo interface
virtual bool DoUndo();
virtual bool DoRedo();
//update interface
virtual bool IsAvaible();
protected:
void _UpdateObject();
protected:
CObjectListUndoRecord m_changes;
bool m_bObject;
CImageWrp m_imageSource, m_imageDest;
CObjectWrp m_object;
};
class CActionShowObjectViewBase : public CActionShowViewBase
{
protected:
virtual void AfterInvoke()
{
::SetValue(GetAppUnknown(), "General", "LastUsedObjectView", _variant_t(GetViewProgID()));
};
};
class CActionShowBinaryViewBase : public CActionShowViewBase
{
protected:
virtual void AfterInvoke()
{
::SetValue(GetAppUnknown(), "General", "LastUsedBinaryView", _variant_t(GetViewProgID()));
};
};
class CActionShowImage : public CActionShowObjectViewBase
{
DECLARE_DYNCREATE(CActionShowImage)
GUARD_DECLARE_OLECREATE(CActionShowImage)
public:
virtual CString GetViewProgID();
};
class CActionShowMasks : public CActionShowObjectViewBase
{
DECLARE_DYNCREATE(CActionShowMasks)
GUARD_DECLARE_OLECREATE(CActionShowMasks)
public:
virtual CString GetViewProgID();
};
class CActionShowObjects : public CActionShowObjectViewBase
{
DECLARE_DYNCREATE(CActionShowObjects)
GUARD_DECLARE_OLECREATE(CActionShowObjects)
public:
virtual CString GetViewProgID();
};
class CActionShowPseudo : public CActionShowObjectViewBase
{
DECLARE_DYNCREATE(CActionShowPseudo)
GUARD_DECLARE_OLECREATE(CActionShowPseudo)
public:
virtual CString GetViewProgID();
};
class CActionShowSource : public CActionShowViewBase
{
DECLARE_DYNCREATE(CActionShowSource)
GUARD_DECLARE_OLECREATE(CActionShowSource)
public:
virtual CString GetViewProgID();
};
class CActionShowBinaryFore : public CActionShowBinaryViewBase
{
DECLARE_DYNCREATE(CActionShowBinaryFore)
GUARD_DECLARE_OLECREATE(CActionShowBinaryFore)
public:
virtual CString GetViewProgID();
};
class CActionShowBinaryBack : public CActionShowBinaryViewBase
{
DECLARE_DYNCREATE(CActionShowBinaryBack)
GUARD_DECLARE_OLECREATE(CActionShowBinaryBack)
public:
virtual CString GetViewProgID();
};
class CActionShowBinary : public CActionShowBinaryViewBase
{
DECLARE_DYNCREATE(CActionShowBinary)
GUARD_DECLARE_OLECREATE(CActionShowBinary)
public:
virtual CString GetViewProgID();
};
class CActionShowBinaryContour : public CActionShowBinaryViewBase
{
DECLARE_DYNCREATE(CActionShowBinaryContour)
GUARD_DECLARE_OLECREATE(CActionShowBinaryContour)
public:
virtual CString GetViewProgID();
};
class CActionShowView : public CActionShowViewBase
{
DECLARE_DYNCREATE(CActionShowView)
GUARD_DECLARE_OLECREATE(CActionShowView)
public:
virtual CString GetViewProgID();
};
class CActionShowPhase : public CActionShowBinaryViewBase
{
DECLARE_DYNCREATE(CActionShowPhase)
GUARD_DECLARE_OLECREATE(CActionShowPhase)
public:
virtual CString GetViewProgID();
};
class CActionShowCalibr : public CActionBase
{
DECLARE_DYNCREATE(CActionShowCalibr)
GUARD_DECLARE_OLECREATE(CActionShowCalibr)
protected:
virtual bool Invoke();
virtual bool IsChecked();
virtual bool IsAvaible();
};
class CActionCipher : public CFilterBase
{
DECLARE_DYNCREATE(CActionCipher)
GUARD_DECLARE_OLECREATE(CActionCipher)
public:
CActionCipher();
virtual ~CActionCipher();
public:
virtual bool InvokeFilter();
};
#endif //__imgactions_h__
| [
"videotestc@gmail.com"
] | videotestc@gmail.com |
6f4e88aa7d42e6dd02b90a9196c38c4a37a5fb79 | 47b9fffb443d477f21eefe36eb6b158fa97d87ac | /coding blocks/Arrays/remove_consecutive_duplicates.cpp | 7e10b8c1edd8a8f41ede53b151e6634402357e91 | [] | no_license | rajaniket/Data-Structures-and-algorithms | 0948e6b64e177d4f62c3adca3536e5f0068a468f | 3fdb2cec941a603cd2d0275fdd90b89bcfafa18e | refs/heads/master | 2021-07-24T15:37:05.019731 | 2021-07-15T10:02:23 | 2021-07-15T10:02:23 | 226,822,141 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 531 | cpp | // remove consecutive duplicates(m-1 ,O(n^2) )
// "ccccooodinnnnngggg__bloockksssss"===> coding_blocks
#include"iostream"
#include"cstring"
using namespace std;
void duplicate_remove(char *a,int l)
{
for(int i=1;i<l;i++)
if(a[i-1]==a[i]){
for(int j=i+1;j<l;j++)
a[j-1]=a[j];
i--; // checking again from same location
l--; // size gets reduced
}
a[l]='\0';
}
int main(){
char a[]="ccccoooooooodinnnnngggg__bloockksssss";
int l=strlen(a);
duplicate_remove(a,l);
cout<<a;
}
| [
"noreply@github.com"
] | rajaniket.noreply@github.com |
4af192cd14118c92357f691d20c1d06f67f1f9cf | 5dc4d4d3bd209b0d7e54c383b83f725ab2ca97fd | /Codeforces/1538/A.cpp | 08df1b57f095f2401dae476350b9e1147f665f45 | [
"MIT"
] | permissive | mohit200008/CodeBank | 3f599e0d0be4d472666a4e754c4578d440251677 | 061f3c1c7c61370fd2c41fc1d76262d403d16f34 | refs/heads/main | 2023-09-03T02:38:21.935473 | 2021-10-22T08:32:43 | 2021-10-22T08:32:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,251 | cpp | /*
"An anomaly, I'm Muhammad Ali
Cause I know one day I'm gonna be the"
- Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size()) cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" "; cout<<endl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const ll INF = 2e18;
const int inf = 2e9;
const int mod1 = 1e9 + 7;
int main(){
Shazam;
test(){
int n; cin >> n;
vector<int> a(n);
get(a);
int p = max_element(all(a)) - a.begin() + 1;
int q = min_element(all(a)) - a.begin() + 1;
if(p > q) swap(p, q);
cout << min({q , n - p + 1, p + n - q + 1}) << endl;
}
return 0;
} | [
"mahendra060704@gmail.com"
] | mahendra060704@gmail.com |
7d2a0bc1f7fc247453ba9c8cdc4745601a1e458c | a8e72b72e08f854fffa56ec7326dc09d0c5847a8 | /conversationlog.cpp | 8ed9439f8f1cc7419bbdd63779ea652c6382aba7 | [] | no_license | mapld/ProgrammingProblems | b16bc5be4e128665379ecda3191b55ddd3673dbd | e9031cdac09a95083b7cbf0ed37a5929aa9b203e | refs/heads/master | 2021-09-02T03:22:05.214931 | 2017-12-29T22:33:30 | 2017-12-29T22:33:30 | 112,629,856 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,361 | cpp | #include <stdio.h>
#include <iostream>
#include <map>
#include <sstream>
#include <set>
#include <queue>
int main(){
using namespace std;
int numMessages;
cin >> numMessages;
set<string> users;
map<string, int> counts;
map<string,bool> used;
for(int i = 0; i < numMessages; i++){
string line;
getline(cin,line);
istringstream iss(line);
string name;
iss >> name;
users.insert(name);
string word;
while(iss >> word){
if(counts.find(word) == counts.end()){
counts[word] = 1;
}
if(used.find(name+word) == used.end()){
used[name+word] = true;
}
}
}
for (set<string>::iterator it=users.begin(); it != users.end(); ++it){
string user = *it;
if(user == ""){
continue;
}
for (map<string,int>::iterator itt=counts.begin(); itt!= counts.end(); ++itt){
string word = itt->first;
if(used.find(user+word) == used.end()){
counts.erase(itt);
}
}
}
std::priority_queue<int> q;
for (map<string,int>::iterator itt=counts.begin(); itt != counts.end(); ++itt){
q.push(itt->second);
}
while(q.size() > 0){
int size = q.top();
q.pop();
for (map<string,int>::iterator itt=counts.begin(); itt != counts.end(); ++itt){
if(itt->second == size){
cout << itt->first << "\n";
counts.erase(itt);
}
}
}
}
| [
"arehnbymartin@abebooks.com"
] | arehnbymartin@abebooks.com |
de4f1665e78d3d60f105985604e1305619215980 | 5f2e4f42080ccb986308688404a2981753f87d69 | /AquaEngine/Generators/NormalOrientedSSAO.h | a9dad49350c42b6e9953f4a90edc90ec9463df4c | [
"MIT"
] | permissive | therselman/aquaengine | 3c941ba6b77dc571e8e426245250e013bf5ae035 | aea6de9f47ba0243b90c144dee4422efb2389cc7 | refs/heads/master | 2021-07-22T13:52:24.316935 | 2017-10-28T11:58:48 | 2017-10-28T11:58:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,694 | h | #pragma once
#include "..\Renderer\ShaderManager.h"
#include "..\Renderer\RendererInterfaces.h"
#include "..\Renderer\RenderDevice\RenderDeviceTypes.h"
#include "..\AquaMath.h"
#include "..\AquaTypes.h"
namespace aqua
{
class Renderer;
class ParameterGroup;
class Camera;
class Allocator;
class LinearAllocator;
struct Viewport;
//Implementation based on http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html
class SSAOGenerator : public ResourceGenerator
{
public:
struct Args
{
ShaderResourceH normal_buffer;
ShaderResourceH depth_buffer;
const Viewport* viewport;
RenderTargetH target;
u32 target_width;
u32 target_height;
};
void init(aqua::Renderer& renderer, lua_State* lua_state, Allocator& allocator, LinearAllocator& scratchpad,
u32 width, u32 height);
void shutdown();
// ResourceGenerator interface
u32 getSecondaryViews(const Camera& camera, RenderView* out_views) override final;
void generate(const void* args_, const VisibilityData* visibility) override final;
void generate(lua_State* lua_state) override final;
private:
Renderer* _renderer;
Allocator* _allocator;
LinearAllocator* _scratchpad_allocator;
u32 _width;
u32 _height;
RenderTargetH _aux_buffer_rt;
ShaderResourceH _aux_buffer_sr;
ShaderPermutation _ssao_shader_permutation;
const ParameterGroupDesc* _ssao_params_desc;
ParameterGroup* _ssao_params;
ShaderPermutation _ssao_blur_shader_permutation;
const ParameterGroupDesc* _ssao_blur_params_desc;
ParameterGroup* _ssao_blur_params;
};
}; | [
"tiago.costav@gmail.com"
] | tiago.costav@gmail.com |
79295f90df5d8f33766ec622477fae9c6cc70b14 | 49b59f314fe0643a1d4750092ae6defd85d4c0fd | /include/taobao.h | 82d1fc105ebf31aafe9088558f369ae893ad81c6 | [
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | permissive | Athenacle/tb | 72ebeed08952d7afb2ee55c9c4bef1c8b64ba2ad | 3c1ad7d02e92822d965453458285386aab37c789 | refs/heads/master | 2020-03-22T14:24:21.622885 | 2018-08-22T11:37:10 | 2018-08-22T11:37:10 | 140,176,856 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,530 | h |
/* shared
*
*/
#ifndef TAOBAO_SHARED_H
#define TAOBAO_SHARED_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h> // for O_RDONLY
#include <string>
namespace tb
{
class Settings;
class Logger;
namespace thread_ns
{
class thread;
class thread_arguments;
} // namespace thread_ns
namespace remote
{
enum {
CONNECTION_NOT_REAL_CONNECT = 0,
CONNECTION_FAILED = 1,
CONNECTION_SUCCESS = 2,
CONNECTION_SUCCESS_DB_CHANGED = 4
};
#ifdef BUILD_WITH_LIBSSH
class SFTPWorker;
#endif
class MySQLWorker;
} // namespace remote
namespace utils
{
// lib/utils.cpp
void InitCoreUtilties();
void DestroyCoreUtilites();
char* requestMemory(unsigned long);
void releaseMemory(const void*);
int gzCompress(unsigned char*, size_t, unsigned char**);
void MD5Hash(const char*, size_t, std::string&);
int MD5HashFile(const char*, std::string&);
int base64Encode(unsigned char*, size_t, char**, bool = false);
size_t checkFileCanRead(const char*, char*, size_t);
void* openFile(const char*, size_t&, char**, unsigned int = O_RDONLY);
int destroyFile(void*, size_t, char**);
int mkParentDir(const std::string&);
bool getParentDir(const std::string&, std::string&);
void formatDirectoryPath(std::string&);
}; // namespace utils
} // namespace tb
#endif
| [
"zjjhwxc@gmail.com"
] | zjjhwxc@gmail.com |
e96af7113d96551b9babff87da4f016a00de6d94 | 4c304390518ed09b983460914c431e446f765869 | /main.cpp | a6b2b662ef7c7795841aea0f2f316ce2df081cf6 | [] | no_license | Tzoali/NoelEscapes | 93b97b6d7dee0b76c69874963568fafd7fe3cc6a | 7ca953545bb602fe9830b3080c15b87df41b11a4 | refs/heads/master | 2023-07-06T23:05:59.193796 | 2021-08-06T14:18:51 | 2021-08-06T14:18:51 | 393,398,498 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,019 | cpp | //INTEGRANTES:
// Daniel Tzoali Arroyo Valdivia
// Omar Arturo Ruiz Bernal
#include "Texture.h"
#include <iostream>
#include <string>
#include <string.h>
#include <time.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_main.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <algorithm>
#include <queue>
#include <fstream>
#include "Santa.h"
#include "Game.h"
#include "Songs.h"
#include "Menu.h"
using namespace std;
int main(int argv, char** args)
{
srand(time(0));
float dtInput = 0;
Uint64 Start = 0;
Uint64 End = 0;
Uint64 Frequency = SDL_GetPerformanceFrequency();
Uint32 Delay = 0;
Uint32 DelayStart = SDL_GetTicks();
Uint32 DelayEnd = 0;
bool running=true;
SDL_Init(SDL_INIT_EVERYTHING);
const Uint8 *keyState;
if(TTF_Init() == -1)
{
SDL_Log("%s\n", TTF_GetError());
return(-1);
}
IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG);
Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048);
SDL_Window* Win = SDL_CreateWindow("Noel Escapes",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
1056, 720,
SDL_WINDOW_SHOWN);
SDL_Surface *logo;
logo = SDL_LoadBMP("res/images/Noel.bmp");
SDL_SetWindowIcon(Win,
logo);
SDL_FreeSurface(logo);
SDL_Renderer* Render = SDL_CreateRenderer(Win, -1, SDL_RENDERER_ACCELERATED);
SDL_SetRenderDrawBlendMode(Render, SDL_BLENDMODE_BLEND);
menu m(Render);
char nombre[1000]={0};
int tam=0;
Delay=0;
SDL_Event Events;
bool read=0;
while(running && m.start(Render,keyState,Delay,Events,nombre,&tam,&read))
{
while(SDL_PollEvent(&Events))
{
if(Events.type==SDL_QUIT)
{
running = false;
}
if(read)
{
if(Events.type==SDL_TEXTINPUT || Events.type==SDL_KEYDOWN)
{
if(Events.type==SDL_KEYDOWN && Events.key.keysym.sym==SDLK_BACKSPACE && tam>0)
{
nombre[--tam]='\0';
}
else if((*(Events.text.text)>='a' && *(Events.text.text)<='z' || *(Events.text.text)>='A' && *(Events.text.text)<='Z' || *(Events.text.text)>='0' && *(Events.text.text)<='9') && tam<=25)
{
nombre[tam]=*(Events.text.text);
nombre[++tam]='\0';
}
}
}
}
keyState=SDL_GetKeyboardState(NULL);
SDL_RenderPresent(Render);
End = SDL_GetPerformanceCounter();
Uint64 Elapsed = End - Start;
dtInput = (float)Elapsed/(float)Frequency;
Start = End;
DelayEnd = SDL_GetTicks();
Delay += DelayEnd - DelayStart;
DelayStart = DelayEnd;
}
return 0;
}
| [
"dtav.sk.99@gmail.com"
] | dtav.sk.99@gmail.com |
ccc0b88009c7cd818fb849343ec8aecd261b2ec3 | 43a0bc7a80572033ba0312078c1118b1865e1c38 | /Øving 3/main.cpp | 5f304acf906a44c3c21681fdf66cbaa42878c301 | [] | no_license | MathiasWahl/Cpp | f6369c497bccb83f87fb3c689ac0f5e8065bb101 | 2309e8826742eb0dcb2b74f8b2fd5327b05e5ac9 | refs/heads/master | 2021-09-07T02:30:29.876267 | 2018-02-15T21:37:06 | 2018-02-15T21:37:06 | 119,513,926 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 816 | cpp | #include "canonball.cpp"
#include "utilities.hpp"
#include <iostream>
#include <ctime>
int main(){
/*
cout << accY() << endl;
cout << "\nTest X:" << endl;
cout << posX(0, 50, 0) << endl;
cout << posX(0, 50, 2.5) << endl;
cout << posX(0, 50, 5) << endl;
cout << "\nTest Y:" << endl;
cout << posY(0, 25, 0) << endl;
cout << posY(0, 25, 2.5) << endl;
cout << posY(0, 25, 5) << endl;
return 0;
*/
int input;
while (true){
cout << "\n--------------------------------------------------------\nWelcome to the shooting ground! Do you want to play? \n0:Exit\n1:Play \n\t>>>";
cin >> input;
if (input == 0){
break;
} else if (input == 1){
playTargetPractice();
} else {
cout << "Please choose between 1 and 0" << endl;
}
}
return 0;
}
| [
"ma10asw@gmail.com"
] | ma10asw@gmail.com |
d822199111c6610bce30326c2aff532a8596e833 | 508510d10ddcb009fc4fb53a26d897bc462039c0 | /PUBG/SDK/PUBG_BP_EquipableItemIconWidget_classes.hpp | d80e238d436117d9d978f2bdcfeb87754c4a5654 | [] | no_license | Avatarchik/PUBG-SDK | ed6e0aa27eac646e557272bbf1607b7351905c8c | 07639ddf96bc0f57fb4b1be0a9b29d5446fcc5da | refs/heads/master | 2021-06-21T07:51:37.309095 | 2017-08-10T08:15:56 | 2017-08-10T08:15:56 | 100,607,141 | 1 | 1 | null | 2017-08-17T13:36:40 | 2017-08-17T13:36:40 | null | UTF-8 | C++ | false | false | 2,181 | hpp | #pragma once
// PLAYERUNKNOWN BattleGrounds () SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace Classes
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// WidgetBlueprintGeneratedClass BP_EquipableItemIconWidget.BP_EquipableItemIconWidget_C
// 0x0010 (0x0338 - 0x0328)
class UBP_EquipableItemIconWidget_C : public UEquipableItemIconBaseWidget
{
public:
class UWidgetAnimation* NoBagSapce; // 0x0328(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate)
class UWidgetAnimation* Warning; // 0x0330(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate)
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("WidgetBlueprintGeneratedClass BP_EquipableItemIconWidget.BP_EquipableItemIconWidget_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"jl2378@cornell.edu"
] | jl2378@cornell.edu |
21fd2e33e78a623cc2d8b55a94007ca87467132f | 138fbf302f4c4797c9bc992fa7aae1db0a2dc597 | /lib/libcds/cds/intrusive/split_list.h | 5ca7f4ab58cefad4eef10a9e5caa04946ed4bfbb | [
"BSD-2-Clause"
] | permissive | dimak08/seminar_in_algorithms | 19cb7bed711963000cebb30f8b459df801df5be5 | 681e105dbdefa781eb0618192886b7b5004c7a6c | refs/heads/master | 2021-01-18T05:48:57.474752 | 2015-09-23T16:10:39 | 2015-09-23T16:10:39 | null | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 48,300 | h | //$$CDS-header$$
#ifndef __CDS_INTRUSIVE_SPLIT_LIST_H
#define __CDS_INTRUSIVE_SPLIT_LIST_H
#include <cds/intrusive/split_list_base.h>
namespace cds { namespace intrusive {
/// Split-ordered list
/** @ingroup cds_intrusive_map
\anchor cds_intrusive_SplitListSet_hp
Hash table implementation based on split-ordered list algorithm discovered by Ori Shalev and Nir Shavit, see
- [2003] Ori Shalev, Nir Shavit "Split-Ordered Lists - Lock-free Resizable Hash Tables"
- [2008] Nir Shavit "The Art of Multiprocessor Programming"
The split-ordered list is a lock-free implementation of an extensible unbounded hash table. It uses original
recursive split-ordering algorithm discovered by Ori Shalev and Nir Shavit that allows to split buckets
without moving an item on resizing.
\anchor cds_SplitList_algo_desc
<b>Short description</b>
[from [2003] Ori Shalev, Nir Shavit "Split-Ordered Lists - Lock-free Resizable Hash Tables"]
The algorithm keeps all the items in one lock-free linked list, and gradually assigns the bucket pointers to
the places in the list where a sublist of “correct” items can be found. A bucket is initialized upon first
access by assigning it to a new “dummy” node (dashed contour) in the list, preceding all items that should be
in that bucket. A newly created bucket splits an older bucket’s chain, reducing the access cost to its items. The
table uses a modulo 2**i hash (there are known techniques for “pre-hashing” before a modulo 2**i hash
to overcome possible binary correlations among values). The table starts at size 2 and repeatedly doubles in size.
Unlike moving an item, the operation of directing a bucket pointer can be done
in a single CAS operation, and since items are not moved, they are never “lost”.
However, to make this approach work, one must be able to keep the items in the
list sorted in such a way that any bucket’s sublist can be “split” by directing a new
bucket pointer within it. This operation must be recursively repeatable, as every
split bucket may be split again and again as the hash table grows. To achieve this
goal the authors introduced recursive split-ordering, a new ordering on keys that keeps items
in a given bucket adjacent in the list throughout the repeated splitting process.
Magically, yet perhaps not surprisingly, recursive split-ordering is achieved by
simple binary reversal: reversing the bits of the hash key so that the new key’s
most significant bits (MSB) are those that were originally its least significant.
The split-order keys of regular nodes are exactly the bit-reverse image of the original
keys after turning on their MSB. For example, items 9 and 13 are in the <tt>1 mod
4</tt> bucket, which can be recursively split in two by inserting a new node between
them.
To insert (respectively delete or search for) an item in the hash table, hash its
key to the appropriate bucket using recursive split-ordering, follow the pointer to
the appropriate location in the sorted items list, and traverse the list until the key’s
proper location in the split-ordering (respectively until the key or a key indicating
the item is not in the list is found). Because of the combinatorial structure induced
by the split-ordering, this will require traversal of no more than an expected constant number of items.
The design is modular: to implement the ordered items list, you can use one of several
non-blocking list-based set algorithms: MichaelList, LazyList.
<b>Implementation</b>
Template parameters are:
- \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for \p OrderedList
- \p OrderedList - ordered list implementation used as bucket for hash set, for example, MichaelList, LazyList.
The intrusive ordered list implementation specifies the type \p T stored in the hash-set, the reclamation
schema \p GC used by hash-set, the comparison functor for the type \p T and other features specific for
the ordered list.
- \p Traits - type traits. See split_list::type_traits for explanation.
Instead of defining \p Traits struct you may use option-based syntax with split_list::make_traits metafunction.
There are several specialization of the split-list class for different \p GC:
- for \ref cds_urcu_gc "RCU type" include <tt><cds/intrusive/split_list_rcu.h></tt> - see
\ref cds_intrusive_SplitListSet_rcu "RCU-based split-list"
- for cds::gc::nogc include <tt><cds/intrusive/split_list_nogc.h></tt> - see
\ref cds_intrusive_SplitListSet_nogc "persistent SplitListSet".
\anchor cds_SplitList_hash_functor
<b>Hash functor</b>
Some member functions of split-ordered list accept the key parameter of type \p Q which differs from \p value_type.
It is expected that type \p Q contains full key of \p value_type, and for equal keys of type \p Q and \p value_type
the hash values of these keys must be equal too.
The hash functor <tt>Traits::hash</tt> should accept parameters of both type:
\code
// Our node type
struct Foo {
std::string key_ ; // key field
// ... other fields
} ;
// Hash functor
struct fooHash {
size_t operator()( const std::string& s ) const
{
return std::hash( s ) ;
}
size_t operator()( const Foo& f ) const
{
return (*this)( f.key_ ) ;
}
};
\endcode
<b>How to use</b>
First, you should choose ordered list type to use in your split-list set:
\code
// For gc::HP-based MichaelList implementation
#include <cds/intrusive/michael_list_hp.h>
// cds::intrusive::SplitListSet declaration
#include <cds/intrusive/split_list.h>
// Type of set items
// Note you should declare your struct based on cds::intrusive::split_list::node
// which is a wrapper for ordered-list node struct.
// In our case, the node type for HP-based MichaelList is cds::intrusive::michael_list::node< cds::gc::HP >
struct Foo: public cds::intrusive::split_list::node< cds::intrusive::michael_list::node< cds::gc::HP > >
{
std::string key_ ; // key field
unsigned val_ ; // value field
// ... other value fields
};
// Declare comparator for the item
struct FooCmp
{
int operator()( const Foo& f1, const Foo& f2 ) const
{
return f1.key_.compare( f2.key_ ) ;
}
};
// Declare base ordered-list type for split-list
// It may be any ordered list type like MichaelList, LazyList
typedef cds::intrusive::MichaelList< cds::gc::HP, Foo,
typename cds::intrusive::michael_list::make_traits<
// hook option
cds::intrusive::opt::hook< cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::HP > > >
// item comparator option
,cds::opt::compare< FooCmp >
>::type
> Foo_list ;
\endcode
Second, you should declare split-list set container:
\code
// Declare hash functor
// Note, the hash functor accepts parameter type Foo and std::string
struct FooHash {
size_t operator()( const Foo& f ) const
{
return cds::opt::v::hash<std::string>()( f.key_ ) ;
}
size_t operator()( const std::string& s ) const
{
return cds::opt::v::hash<std::string>()( s ) ;
}
};
// Split-list set typedef
typedef cds::intrusive::SplitListSet<
cds::gc::HP
,Foo_list
,typename cds::intrusive::split_list::make_traits<
cds::opt::hash< FooHash >
>::type
> Foo_set ;
\endcode
Now, you can use \p Foo_set in your application.
\code
Foo_set fooSet ;
Foo * foo = new Foo ;
foo->key_ = "First" ;
fooSet.insert( *foo ) ;
// and so on ...
\endcode
*/
template <
class GC,
class OrderedList,
# ifdef CDS_DOXYGEN_INVOKED
class Traits = split_list::type_traits
# else
class Traits
# endif
>
class SplitListSet
{
public:
typedef Traits options ; ///< Traits template parameters
typedef GC gc ; ///< Garbage collector
protected:
//@cond
typedef split_list::details::rebind_list_options<OrderedList, options> wrapped_ordered_list ;
//@endcond
public:
# ifdef CDS_DOXYGEN_INVOKED
typedef OrderedList ordered_list ; ///< type of ordered list used as base for split-list
# else
typedef typename wrapped_ordered_list::result ordered_list ;
# endif
typedef typename ordered_list::value_type value_type ; ///< type of value stored in the split-list
typedef typename ordered_list::key_comparator key_comparator ; ///< key comparison functor
typedef typename ordered_list::disposer disposer ; ///< Node disposer functor
/// Hash functor for \p %value_type and all its derivatives that you use
typedef typename cds::opt::v::hash_selector< typename options::hash >::type hash ;
typedef typename options::item_counter item_counter ; ///< Item counter type
typedef typename options::back_off back_off ; ///< back-off strategy for spinning
typedef typename options::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option
typedef typename ordered_list::guarded_ptr guarded_ptr; ///< Guarded pointer
protected:
typedef typename ordered_list::node_type list_node_type ; ///< Node type as declared in ordered list
typedef split_list::node<list_node_type> node_type ; ///< split-list node type
typedef node_type dummy_node_type ; ///< dummy node type
/// Split-list node traits
/**
This traits is intended for converting between underlying ordered list node type \ref list_node_type
and split-list node type \ref node_type
*/
typedef split_list::node_traits<typename ordered_list::node_traits> node_traits ;
//@cond
/// Bucket table implementation
typedef typename split_list::details::bucket_table_selector<
options::dynamic_bucket_table
, gc
, dummy_node_type
, opt::allocator< typename options::allocator >
, opt::memory_model< memory_model >
>::type bucket_table ;
//@endcond
protected:
//@cond
/// Ordered list wrapper to access protected members
class ordered_list_wrapper: public ordered_list
{
typedef ordered_list base_class ;
typedef typename base_class::auxiliary_head bucket_head_type;
public:
bool insert_at( dummy_node_type * pHead, value_type& val )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::insert_at( h, val ) ;
}
template <typename Func>
bool insert_at( dummy_node_type * pHead, value_type& val, Func f )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::insert_at( h, val, f ) ;
}
template <typename Func>
std::pair<bool, bool> ensure_at( dummy_node_type * pHead, value_type& val, Func func )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::ensure_at( h, val, func ) ;
}
bool unlink_at( dummy_node_type * pHead, value_type& val )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::unlink_at( h, val ) ;
}
template <typename Q, typename Compare, typename Func>
bool erase_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp, Func f )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::erase_at( h, val, cmp, f ) ;
}
template <typename Q, typename Compare>
bool erase_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::erase_at( h, val, cmp ) ;
}
template <typename Q, typename Compare>
bool extract_at( dummy_node_type * pHead, typename gc::Guard& guard, split_list::details::search_value_type<Q> const& val, Compare cmp )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::extract_at( h, guard, val, cmp ) ;
}
template <typename Q, typename Compare, typename Func>
bool find_at( dummy_node_type * pHead, split_list::details::search_value_type<Q>& val, Compare cmp, Func f )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::find_at( h, val, cmp, f ) ;
}
template <typename Q, typename Compare>
bool find_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::find_at( h, val, cmp ) ;
}
template <typename Q, typename Compare>
bool get_at( dummy_node_type * pHead, typename gc::Guard& guard, split_list::details::search_value_type<Q> const& val, Compare cmp )
{
assert( pHead != null_ptr<dummy_node_type *>() ) ;
bucket_head_type h(pHead) ;
return base_class::get_at( h, guard, val, cmp ) ;
}
bool insert_aux_node( dummy_node_type * pNode )
{
return base_class::insert_aux_node( pNode ) ;
}
bool insert_aux_node( dummy_node_type * pHead, dummy_node_type * pNode )
{
bucket_head_type h(pHead) ;
return base_class::insert_aux_node( h, pNode ) ;
}
};
//@endcond
protected:
ordered_list_wrapper m_List ; ///< Ordered list containing split-list items
bucket_table m_Buckets ; ///< bucket table
CDS_ATOMIC::atomic<size_t> m_nBucketCountLog2 ; ///< log2( current bucket count )
item_counter m_ItemCounter ; ///< Item counter
hash m_HashFunctor ; ///< Hash functor
protected:
//@cond
typedef cds::details::Allocator< dummy_node_type, typename options::allocator > dummy_node_allocator ;
static dummy_node_type * alloc_dummy_node( size_t nHash )
{
return dummy_node_allocator().New( nHash ) ;
}
static void free_dummy_node( dummy_node_type * p )
{
dummy_node_allocator().Delete( p ) ;
}
/// Calculates hash value of \p key
template <typename Q>
size_t hash_value( Q const& key ) const
{
return m_HashFunctor( key ) ;
}
size_t bucket_no( size_t nHash ) const
{
return nHash & ( (1 << m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed)) - 1 ) ;
}
static size_t parent_bucket( size_t nBucket )
{
assert( nBucket > 0 ) ;
return nBucket & ~( 1 << bitop::MSBnz( nBucket ) ) ;
}
dummy_node_type * init_bucket( size_t nBucket )
{
assert( nBucket > 0 ) ;
size_t nParent = parent_bucket( nBucket ) ;
dummy_node_type * pParentBucket = m_Buckets.bucket( nParent ) ;
if ( pParentBucket == null_ptr<dummy_node_type *>() ) {
pParentBucket = init_bucket( nParent ) ;
}
assert( pParentBucket != null_ptr<dummy_node_type *>() ) ;
// Allocate a dummy node for new bucket
{
dummy_node_type * pBucket = alloc_dummy_node( split_list::dummy_hash( nBucket ) ) ;
if ( m_List.insert_aux_node( pParentBucket, pBucket ) ) {
m_Buckets.bucket( nBucket, pBucket ) ;
return pBucket ;
}
free_dummy_node( pBucket ) ;
}
// Another thread set the bucket. Wait while it done
// In this point, we must wait while nBucket is empty.
// The compiler can decide that waiting loop can be "optimized" (stripped)
// To prevent this situation, we use waiting on volatile bucket_head_ptr pointer.
//
back_off bkoff ;
while ( true ) {
dummy_node_type volatile * p = m_Buckets.bucket( nBucket ) ;
if ( p != null_ptr<dummy_node_type volatile *>() )
return const_cast<dummy_node_type *>( p ) ;
bkoff() ;
}
}
dummy_node_type * get_bucket( size_t nHash )
{
size_t nBucket = bucket_no( nHash ) ;
dummy_node_type * pHead = m_Buckets.bucket( nBucket ) ;
if ( pHead == null_ptr<dummy_node_type *>() )
pHead = init_bucket( nBucket ) ;
assert( pHead->is_dummy() ) ;
return pHead ;
}
void init()
{
// GC and OrderedList::gc must be the same
static_assert(( std::is_same<gc, typename ordered_list::gc>::value ), "GC and OrderedList::gc must be the same") ;
// atomicity::empty_item_counter is not allowed as a item counter
static_assert(( !std::is_same<item_counter, atomicity::empty_item_counter>::value ), "atomicity::empty_item_counter is not allowed as a item counter") ;
// Initialize bucket 0
dummy_node_type * pNode = alloc_dummy_node( 0 /*split_list::dummy_hash(0)*/ ) ;
// insert_aux_node cannot return false for empty list
CDS_VERIFY( m_List.insert_aux_node( pNode )) ;
m_Buckets.bucket( 0, pNode ) ;
}
void inc_item_count()
{
size_t sz = m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed) ;
if ( ( ++m_ItemCounter >> sz ) > m_Buckets.load_factor() && ((size_t)(1 << sz )) < m_Buckets.capacity() )
{
m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, CDS_ATOMIC::memory_order_seq_cst, CDS_ATOMIC::memory_order_relaxed ) ;
}
}
template <typename Q, typename Compare, typename Func>
bool find_( Q& val, Compare cmp, Func f )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
# ifdef CDS_CXX11_LAMBDA_SUPPORT
return m_List.find_at( pHead, sv, cmp,
[&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); }) ;
# else
split_list::details::find_functor_wrapper<Func> ffw( f ) ;
return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) ) ;
# endif
}
template <typename Q, typename Compare>
bool find_( Q const& val, Compare cmp )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
return m_List.find_at( pHead, sv, cmp ) ;
}
template <typename Q, typename Compare>
bool get_( typename gc::Guard& guard, Q const& val, Compare cmp )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
return m_List.get_at( pHead, guard, sv, cmp ) ;
}
template <typename Q, typename Compare, typename Func>
bool erase_( Q const& val, Compare cmp, Func f )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
if ( m_List.erase_at( pHead, sv, cmp, f )) {
--m_ItemCounter ;
return true ;
}
return false ;
}
template <typename Q, typename Compare>
bool erase_( Q const& val, Compare cmp )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
if ( m_List.erase_at( pHead, sv, cmp ) ) {
--m_ItemCounter ;
return true ;
}
return false ;
}
template <typename Q, typename Compare>
bool extract_( typename gc::Guard& guard, Q const& val, Compare cmp )
{
size_t nHash = hash_value( val ) ;
split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
if ( m_List.extract_at( pHead, guard, sv, cmp ) ) {
--m_ItemCounter ;
return true ;
}
return false ;
}
//@endcond
public:
/// Initialize split-ordered list of default capacity
/**
The default capacity is defined in bucket table constructor.
See split_list::expandable_bucket_table, split_list::static_ducket_table
which selects by split_list::dynamic_bucket_table option.
*/
SplitListSet()
: m_nBucketCountLog2(1)
{
init() ;
}
/// Initialize split-ordered list
SplitListSet(
size_t nItemCount ///< estimate average of item count
, size_t nLoadFactor = 1 ///< load factor - average item count per bucket. Small integer up to 8, default is 1.
)
: m_Buckets( nItemCount, nLoadFactor )
, m_nBucketCountLog2(1)
{
init() ;
}
public:
/// Inserts new node
/**
The function inserts \p val in the set if it does not contain
an item with key equal to \p val.
Returns \p true if \p val is placed into the set, \p false otherwise.
*/
bool insert( value_type& val )
{
size_t nHash = hash_value( val ) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ;
if ( m_List.insert_at( pHead, val )) {
inc_item_count() ;
return true ;
}
return false ;
}
/// Inserts new node
/**
This function is intended for derived non-intrusive containers.
The function allows to split creating of new item into two part:
- create item with key only
- insert new item into the set
- if inserting is success, calls \p f functor to initialize value-field of \p val.
The functor signature is:
\code
void func( value_type& val ) ;
\endcode
where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
\p val no any other changes could be made on this set's item by concurrent threads.
The user-defined functor is called only if the inserting is success and may be passed by reference
using <tt>boost::ref</tt>
*/
template <typename Func>
bool insert( value_type& val, Func f )
{
size_t nHash = hash_value( val ) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ;
if ( m_List.insert_at( pHead, val, f )) {
inc_item_count() ;
return true ;
}
return false ;
}
/// Ensures that the \p val exists in the set
/**
The operation performs inserting or changing data with lock-free manner.
If the item \p val is not found in the set, then \p val is inserted into the set.
Otherwise, the functor \p func is called with item found.
The functor signature is:
\code
void func( bool bNew, value_type& item, value_type& val ) ;
\endcode
with arguments:
- \p bNew - \p true if the item has been inserted, \p false otherwise
- \p item - item of the set
- \p val - argument \p val passed into the \p ensure function
If new item has been inserted (i.e. \p bNew is \p true) then \p item and \p val arguments
refers to the same thing.
The functor can change non-key fields of the \p item; however, \p func must guarantee
that during changing no any other modifications could be made on this item by concurrent threads.
You can pass \p func argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
\p second is \p true if new item has been added or \p false if the item with \p key
already is in the set.
*/
template <typename Func>
std::pair<bool, bool> ensure( value_type& val, Func func )
{
size_t nHash = hash_value( val ) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ;
std::pair<bool, bool> bRet = m_List.ensure_at( pHead, val, func ) ;
if ( bRet.first && bRet.second )
inc_item_count() ;
return bRet ;
}
/// Unlinks the item \p val from the set
/**
The function searches the item \p val in the set and unlinks it from the set
if it is found and is equal to \p val.
Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i>
and deletes the item found. \p unlink finds an item by key and deletes it
only if \p val is an item of that set, i.e. the pointer to item found
is equal to <tt> &val </tt>.
The function returns \p true if success and \p false otherwise.
*/
bool unlink( value_type& val )
{
size_t nHash = hash_value( val ) ;
dummy_node_type * pHead = get_bucket( nHash ) ;
assert( pHead != null_ptr<dummy_node_type *>() ) ;
if ( m_List.unlink_at( pHead, val ) ) {
--m_ItemCounter ;
return true ;
}
return false ;
}
/// Deletes the item from the set
/** \anchor cds_intrusive_SplitListSet_hp_erase
The function searches an item with key equal to \p val in the set,
unlinks it from the set, and returns \p true.
If the item with key equal to \p val is not found the function return \p false.
Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i>
and deletes the item found. \p unlink finds an item by key and deletes it
only if \p val is an item of that set, i.e. the pointer to item found
is equal to <tt> &val </tt>.
Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type.
*/
template <typename Q>
bool erase( Q const& val )
{
return erase_( val, key_comparator() ) ;
}
/// Deletes the item from the set with comparing functor \p pred
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_erase "erase(Q const&)"
but \p pred predicate is used for key comparing.
\p Less has the interface like \p std::less.
\p pred must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less>
bool erase_with( const Q& val, Less pred )
{
return erase_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>() ) ;
}
/// Deletes the item from the set
/** \anchor cds_intrusive_SplitListSet_hp_erase_func
The function searches an item with key equal to \p val in the set,
call \p f functor with item found, unlinks it from the set, and returns \p true.
The \ref disposer specified by \p OrderedList class template parameter is called
by garbage collector \p GC asynchronously.
The \p Func interface is
\code
struct functor {
void operator()( value_type const& item ) ;
} ;
\endcode
The functor can be passed by reference with <tt>boost:ref</tt>
If the item with key equal to \p val is not found the function return \p false.
Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type.
*/
template <typename Q, typename Func>
bool erase( Q const& val, Func f )
{
return erase_( val, key_comparator(), f ) ;
}
/// Deletes the item from the set with comparing functor \p pred
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_erase_func "erase(Q const&, Func)"
but \p pred predicate is used for key comparing.
\p Less has the interface like \p std::less.
\p pred must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less, typename Func>
bool erase_with( Q const& val, Less pred, Func f )
{
return erase_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ;
}
/// Extracts the item with specified \p key
/** \anchor cds_intrusive_SplitListSet_hp_extract
The function searches an item with key equal to \p key,
unlinks it from the set, and returns it in \p dest parameter.
If the item with key equal to \p key is not found the function returns \p false.
Note the compare functor should accept a parameter of type \p Q that may be not the same as \p value_type.
The \ref disposer specified in \p OrderedList class' template parameter is called automatically
by garbage collector \p GC when returned \ref guarded_ptr object will be destroyed or released.
@note Each \p guarded_ptr object uses the GC's guard that can be limited resource.
Usage:
\code
typedef cds::intrusive::SplitListSet< your_template_args > splitlist_set;
splitlist_set theSet;
// ...
{
splitlist_set::guarded_ptr gp;
theSet.extract( gp, 5 );
// Deal with gp
// ...
// Destructor of gp releases internal HP guard
}
\endcode
*/
template <typename Q>
bool extract( guarded_ptr& dest, Q const& key )
{
return extract_( dest.guard(), key, key_comparator() );
}
/// Extracts the item using compare functor \p pred
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_extract "extract(guarded_ptr&, Q const&)"
but \p pred predicate is used for key comparing.
\p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q
in any order.
\p pred must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less>
bool extract_with( guarded_ptr& dest, Q const& key, Less pred )
{
return extract_( dest.guard(), key, typename wrapped_ordered_list::template make_compare_from_less<Less>() );
}
/// Finds the key \p val
/** \anchor cds_intrusive_SplitListSet_hp_find_func
The function searches the item with key equal to \p val and calls the functor \p f for item found.
The interface of \p Func functor is:
\code
struct functor {
void operator()( value_type& item, Q& val ) ;
};
\endcode
where \p item is the item found, \p val is the <tt>find</tt> function argument.
You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
The functor can change non-key fields of \p item. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.
The functor does not serialize simultaneous access to the set \p item. If such access is
possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
can modify both arguments.
Note the hash functor specified for class \p Traits template parameter
should accept a parameter of type \p Q that can be not the same as \p value_type.
The function returns \p true if \p val is found, \p false otherwise.
*/
template <typename Q, typename Func>
bool find( Q& val, Func f )
{
return find_( val, key_comparator(), f ) ;
}
/// Finds the key \p val with \p pred predicate for comparing
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_func "find(Q&, Func)"
but \p cmp is used for key compare.
\p Less has the interface like \p std::less.
\p cmp must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less, typename Func>
bool find_with( Q& val, Less pred, Func f )
{
return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ;
}
/// Finds the key \p val
/** \anchor cds_intrusive_SplitListSet_hp_find_cfunc
The function searches the item with key equal to \p val and calls the functor \p f for item found.
The interface of \p Func functor is:
\code
struct functor {
void operator()( value_type& item, Q const& val ) ;
};
\endcode
where \p item is the item found, \p val is the <tt>find</tt> function argument.
You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
The functor can change non-key fields of \p item. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.
The functor does not serialize simultaneous access to the set \p item. If such access is
possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
Note the hash functor specified for class \p Traits template parameter
should accept a parameter of type \p Q that can be not the same as \p value_type.
The function returns \p true if \p val is found, \p false otherwise.
*/
template <typename Q, typename Func>
bool find( Q const& val, Func f )
{
return find_( val, key_comparator(), f ) ;
}
/// Finds the key \p val with \p pred predicate for comparing
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_cfunc "find(Q const&, Func)"
but \p cmp is used for key compare.
\p Less has the interface like \p std::less.
\p cmp must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less, typename Func>
bool find_with( Q const& val, Less pred, Func f )
{
return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ;
}
/// Finds the key \p val
/** \anchor cds_intrusive_SplitListSet_hp_find_val
The function searches the item with key equal to \p val
and returns \p true if it is found, and \p false otherwise.
Note the hash functor specified for class \p Traits template parameter
should accept a parameter of type \p Q that can be not the same as \p value_type.
Otherwise, you may use \p find_with functions with explicit predicate for key comparing.
*/
template <typename Q>
bool find( Q const& val )
{
return find_( val, key_comparator() ) ;
}
/// Finds the key \p val with \p pred predicate for comparing
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_val "find(Q const&)"
but \p cmp is used for key compare.
\p Less has the interface like \p std::less.
\p cmp must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less>
bool find_with( Q const& val, Less pred )
{
return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>() ) ;
}
/// Finds the key \p val and return the item found
/** \anchor cds_intrusive_SplitListSet_hp_get
The function searches the item with key equal to \p val
and assigns the item found to guarded pointer \p ptr.
The function returns \p true if \p val is found, and \p false otherwise.
If \p val is not found the \p ptr parameter is not changed.
The \ref disposer specified in \p OrderedList class' template parameter is called
by garbage collector \p GC automatically when returned \ref guarded_ptr object
will be destroyed or released.
@note Each \p guarded_ptr object uses one GC's guard which can be limited resource.
Usage:
\code
typedef cds::intrusive::SplitListSet< your_template_params > splitlist_set;
splitlist_set theSet;
// ...
{
splitlist_set::guarded_ptr gp;
if ( theSet.get( gp, 5 )) {
// Deal with gp
//...
}
// Destructor of guarded_ptr releases internal HP guard
}
\endcode
Note the compare functor specified for \p OrderedList template parameter
should accept a parameter of type \p Q that can be not the same as \p value_type.
*/
template <typename Q>
bool get( guarded_ptr& ptr, Q const& val )
{
return get_( ptr.guard(), val, key_comparator() );
}
/// Finds the key \p val and return the item found
/**
The function is an analog of \ref cds_intrusive_SplitListSet_hp_get "get( guarded_ptr& ptr, Q const&)"
but \p pred is used for comparing the keys.
\p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q
in any order.
\p pred must imply the same element order as the comparator used for building the set.
*/
template <typename Q, typename Less>
bool get_with( guarded_ptr& ptr, Q const& val, Less pred )
{
return get_( ptr.guard(), val, typename wrapped_ordered_list::template make_compare_from_less<Less>() );
}
/// Returns item count in the set
size_t size() const
{
return m_ItemCounter ;
}
/// Checks if the set is empty
/**
Emptiness is checked by item counting: if item count is zero then the set is empty.
Thus, the correct item counting feature is an important part of split-list set implementation.
*/
bool empty() const
{
return size() == 0 ;
}
/// Clears the set (non-atomic)
/**
The function unlink all items from the set.
The function is not atomic. Therefore, \p clear may be used only for debugging purposes.
For each item the \p disposer is called after unlinking.
*/
void clear()
{
iterator it = begin() ;
while ( it != end() ) {
iterator i(it) ;
++i ;
unlink( *it ) ;
it = i ;
}
}
protected:
//@cond
template <bool IsConst>
class iterator_type
:public split_list::details::iterator_type<node_traits, ordered_list, IsConst>
{
typedef split_list::details::iterator_type<node_traits, ordered_list, IsConst> iterator_base_class ;
typedef typename iterator_base_class::list_iterator list_iterator ;
public:
iterator_type()
: iterator_base_class()
{}
iterator_type( iterator_type const& src )
: iterator_base_class( src )
{}
// This ctor should be protected...
iterator_type( list_iterator itCur, list_iterator itEnd )
: iterator_base_class( itCur, itEnd )
{}
};
//@endcond
public:
/// Forward iterator
/**
The forward iterator for a split-list has some features:
- it has no post-increment operator
- it depends on iterator of underlying \p OrderedList
- The iterator cannot be moved across thread boundary since it may contain GC's guard that is thread-private GC data.
- Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent
deleting operations it is no guarantee that you iterate all item in the split-list.
Therefore, the use of iterators in concurrent environment is not good idea. Use the iterator on the concurrent container
for debug purpose only.
*/
typedef iterator_type<false> iterator ;
/// Const forward iterator
/**
For iterator's features and requirements see \ref iterator
*/
typedef iterator_type<true> const_iterator ;
/// Returns a forward iterator addressing the first element in a split-list
/**
For empty list \code begin() == end() \endcode
*/
iterator begin()
{
return iterator( m_List.begin(), m_List.end() ) ;
}
/// Returns an iterator that addresses the location succeeding the last element in a split-list
/**
Do not use the value returned by <tt>end</tt> function to access any item.
The returned value can be used only to control reaching the end of the split-list.
For empty list \code begin() == end() \endcode
*/
iterator end()
{
return iterator( m_List.end(), m_List.end() ) ;
}
/// Returns a forward const iterator addressing the first element in a split-list
const_iterator begin() const
{
return const_iterator( m_List.begin(), m_List.end() ) ;
}
/// Returns an const iterator that addresses the location succeeding the last element in a split-list
const_iterator end() const
{
return const_iterator( m_List.end(), m_List.end() ) ;
}
};
}} // namespace cds::intrusive
#endif // #ifndef __CDS_INTRUSIVE_SPLIT_LIST_H
| [
"jakob.gruber@gmail.com"
] | jakob.gruber@gmail.com |
734f3de22638441623d47f44ce344f4b0a748ec8 | a6cee0a2e956fcf63f19f359675f5cb0552cdb5a | /garminfitsdk/fit_workout_session_mesg.hpp | 8ad1af7f50d991c188a9d1f09060adee84f355f0 | [] | no_license | KatzSanya/MRC_creator | fc45d0a81d11fb5082b5ef8b84e6bb4c236052b9 | 42128c78fba177cd20b3a948918c0451b0154367 | refs/heads/master | 2023-05-31T23:00:03.848531 | 2021-06-22T01:45:30 | 2021-06-22T01:45:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,508 | hpp | ////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Garmin Canada Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and therefore all warranties, representations, or guarantees of any kind
// (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.
//
// Copyright 2021 Garmin Canada Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.54Release
// Tag = production/akw/21.54.01-0-g081c465c
////////////////////////////////////////////////////////////////////////////////
#if !defined(FIT_WORKOUT_SESSION_MESG_HPP)
#define FIT_WORKOUT_SESSION_MESG_HPP
#include "fit_mesg.hpp"
namespace fit
{
class WorkoutSessionMesg : public Mesg
{
public:
class FieldDefNum final
{
public:
static const FIT_UINT8 MessageIndex = 254;
static const FIT_UINT8 Sport = 0;
static const FIT_UINT8 SubSport = 1;
static const FIT_UINT8 NumValidSteps = 2;
static const FIT_UINT8 FirstStepIndex = 3;
static const FIT_UINT8 PoolLength = 4;
static const FIT_UINT8 PoolLengthUnit = 5;
static const FIT_UINT8 Invalid = FIT_FIELD_NUM_INVALID;
};
WorkoutSessionMesg(void) : Mesg(Profile::MESG_WORKOUT_SESSION)
{
}
WorkoutSessionMesg(const Mesg &mesg) : Mesg(mesg)
{
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of message_index field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsMessageIndexValid() const
{
const Field* field = GetField(254);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns message_index field
///////////////////////////////////////////////////////////////////////
FIT_MESSAGE_INDEX GetMessageIndex(void) const
{
return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set message_index field
///////////////////////////////////////////////////////////////////////
void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex)
{
SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of sport field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsSportValid() const
{
const Field* field = GetField(0);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns sport field
///////////////////////////////////////////////////////////////////////
FIT_SPORT GetSport(void) const
{
return GetFieldENUMValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set sport field
///////////////////////////////////////////////////////////////////////
void SetSport(FIT_SPORT sport)
{
SetFieldENUMValue(0, sport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of sub_sport field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsSubSportValid() const
{
const Field* field = GetField(1);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns sub_sport field
///////////////////////////////////////////////////////////////////////
FIT_SUB_SPORT GetSubSport(void) const
{
return GetFieldENUMValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set sub_sport field
///////////////////////////////////////////////////////////////////////
void SetSubSport(FIT_SUB_SPORT subSport)
{
SetFieldENUMValue(1, subSport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of num_valid_steps field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsNumValidStepsValid() const
{
const Field* field = GetField(2);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns num_valid_steps field
///////////////////////////////////////////////////////////////////////
FIT_UINT16 GetNumValidSteps(void) const
{
return GetFieldUINT16Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set num_valid_steps field
///////////////////////////////////////////////////////////////////////
void SetNumValidSteps(FIT_UINT16 numValidSteps)
{
SetFieldUINT16Value(2, numValidSteps, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of first_step_index field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsFirstStepIndexValid() const
{
const Field* field = GetField(3);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns first_step_index field
///////////////////////////////////////////////////////////////////////
FIT_UINT16 GetFirstStepIndex(void) const
{
return GetFieldUINT16Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set first_step_index field
///////////////////////////////////////////////////////////////////////
void SetFirstStepIndex(FIT_UINT16 firstStepIndex)
{
SetFieldUINT16Value(3, firstStepIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of pool_length field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsPoolLengthValid() const
{
const Field* field = GetField(4);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns pool_length field
// Units: m
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetPoolLength(void) const
{
return GetFieldFLOAT32Value(4, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set pool_length field
// Units: m
///////////////////////////////////////////////////////////////////////
void SetPoolLength(FIT_FLOAT32 poolLength)
{
SetFieldFLOAT32Value(4, poolLength, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of pool_length_unit field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsPoolLengthUnitValid() const
{
const Field* field = GetField(5);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns pool_length_unit field
///////////////////////////////////////////////////////////////////////
FIT_DISPLAY_MEASURE GetPoolLengthUnit(void) const
{
return GetFieldENUMValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set pool_length_unit field
///////////////////////////////////////////////////////////////////////
void SetPoolLengthUnit(FIT_DISPLAY_MEASURE poolLengthUnit)
{
SetFieldENUMValue(5, poolLengthUnit, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
};
} // namespace fit
#endif // !defined(FIT_WORKOUT_SESSION_MESG_HPP)
| [
"helder.giro.lopes@gmail.com"
] | helder.giro.lopes@gmail.com |
234cff216cec4848ab3c7328a2fff23d5f73f26d | 35f01879fcb6a6435994de68518275a07c3d631f | /WinAPI GameFramework/Include/Object/guided_bullet.h | b1aee2b836b877d7be45225285e2039d5504291e | [] | no_license | kwangminy27/WinAPI-GameFramework | 5520a8b8a6d1fc845a9935e7970e3104db522e3a | e4530c6a4a255f853d8407f12225512e24366319 | refs/heads/master | 2020-03-24T22:49:47.052774 | 2018-08-07T12:25:00 | 2018-08-07T12:25:00 | 143,104,758 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 943 | h | #pragma once
#include "bullet.h"
class GuidedBullet final : public Bullet
{
friend class ObjectManager;
public:
virtual bool Initialize() override;
bool is_guided() const;
std::shared_ptr<Object> target() const;
void set_target(std::weak_ptr<Object> const& target);
private:
GuidedBullet() = default;
GuidedBullet(GuidedBullet const& other);
GuidedBullet(GuidedBullet&& other) noexcept;
GuidedBullet& operator=(GuidedBullet const&) = default;
GuidedBullet& operator=(GuidedBullet&&) noexcept = default;
virtual void _Release() override;
virtual void _Input(float time) override;
virtual void _Update(float time) override;
virtual void _LateUpdate(float time) override;
virtual void _Collision(float time) override;
virtual void _Render(HDC device_context, float time) override;
virtual std::unique_ptr<Object, std::function<void(Object*)>> _Clone() override;
bool is_guided_{};
std::weak_ptr<Object> target_{};
};
| [
"kwangminy27@outlook.com"
] | kwangminy27@outlook.com |
6e65d8285c59183add02fe62ae520a469e0963a8 | 966ce6dd5c396494b04a1003ee82e208fd974ce4 | /transport/tests/spool_test.cc | 53290767a9291be5ea017f8b6096f5c3a46a5dde | [] | no_license | drue/King-James | 55c57143297e107c86a4fc05b5d3e4ef1bae4624 | cf1240e902b08b775f47a73599fd919677b72f41 | refs/heads/master | 2021-01-01T17:46:58.709355 | 2014-10-03T11:24:11 | 2014-10-03T11:32:41 | 3,149,344 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 6,132 | cc | #include <stdlib.h>
#include <arpa/inet.h>
#include "gtest/gtest.h"
#include "FLAC++/metadata.h"
#include <openssl/md5.h>
#include "spool.h"
/*
*************
** FLAC md5sum is computed from byte aligned, little endian data
** 3 bytes per sample for 24 bits, 2 bytes for 16 bits
** however, data is fed to FLAC with 4 byte unsigned ints
*************
*/
/*
** test data consists of monotonically increasing integers from zero, so out-of-order or missing samples can be
** easily detected
*/
class SpoolTest : public ::testing::Test {
public:
char tmpl[80];
char *f;
MD5_CTX ctx;
Spool *s;
unsigned int width;
virtual void SetUp() {
width = 3;
strncpy(tmpl, "/tmp/SpoolTest.XXXXXX", sizeof(tmpl));
f = mktemp(tmpl);
MD5_Init(&ctx);
}
virtual void verify() {
FLAC::Metadata::StreamInfo si;
FLAC::Metadata::get_streaminfo(f, si);
const unsigned char *sum = si.get_md5sum();
unsigned char ohash[16];
MD5_Final(ohash, &ctx);
for(int i=0;i<16;i++) {
ASSERT_EQ(ohash[i], sum[i]);
}
}
virtual int pushBlock(int start, bool hash=true) {
buffer& item = s->getEmpty();
unsigned int x;
for ( x=0; x*4 < item.size; x++) {
int z = start + x;
item.buf[x] = z;
if(hash) {
MD5_Update(&ctx, (unsigned char *)&z, width); // only works on little endian arch
}
}
s->pushItem(item);
return start + x;
}
};
TEST_F(SpoolTest, DeallocUnused) {
Spool s(128*5, 128, 24, 44100, 2, false);
}
TEST_F(SpoolTest, Null) {
s = new Spool(5, 128, 24, 48000, 2, false);
s->start(f);
s->initFLAC();
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, OneItem) {
s = new Spool(5, 128, 24, 48000, 2, false);
s->start(f);
s->initFLAC();
pushBlock(0);
s->tick();
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, FiveItems) {
s = new Spool(5, 128, 24, 48000, 2, false);
s->start(f);
s->initFLAC();
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n);
s->tick();
}
s->finish();
s->finishFLAC();
verify();
}
TEST_F(SpoolTest, SpoolUp5) {
s = new Spool(5, 128, 24, 48000, 2, false);
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->initFLAC();
unsigned int x;
do {
x = s->tick();
} while (x > 0);
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, HalfAndHalf) {
s = new Spool(5, 128, 24, 48000, 2, false);
// fill up the buffer reroll buffer, start, then send another five below
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->initFLAC();
unsigned int x;
do {
x = s->tick();
} while (x > 0);
for(int x=5;x<10;x++) {
n = pushBlock(n);
s->tick();
}
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, HalfAndHalf16) {
width = 2;
s = new Spool(5, 128, 16, 48000, 2, false);
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->initFLAC();
unsigned int x;
do {
x = s->tick();
} while (x > 0);
for(int x=0;x<5;x++) {
n = pushBlock(n);
s->tick();
}
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, LoseOne) {
s = new Spool(5, 128, 24, 48000, 2, false);
// fill up the buffer reroll buffer, start, then send another five below
int n = 0;
n = pushBlock(n, false);
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->initFLAC();
unsigned int x;
do {
x = s->tick();
} while (x > 0);
for(int x=0;x<5;x++) {
n = pushBlock(n);
s->tick();
}
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, LoseFive) {
s = new Spool(5, 128, 24, 48000, 2, false);
// fill up the buffer reroll buffer, start, then send another five below
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n, false);
}
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->initFLAC();
unsigned int x;
do {
x = s->tick();
} while (x > 0);
for(int x=0;x<5;x++) {
n = pushBlock(n);
s->tick();
}
s->finish();
s->finishFLAC();
verify();
delete(s);
}
TEST_F(SpoolTest, TLoseFive) {
s = new Spool(5, 128, 24, 48000, 2, true, false);
// fill up the buffer reroll buffer, start, then send another five below
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n, false);
}
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->waitReady();
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->finish();
s->wait();
verify();
delete(s);
}
TEST_F(SpoolTest, TPump) {
s = new Spool(5, 128, 24, 48000, 2, true, false);
int n = 0;
// fill up the buffer reroll buffer, start, then send another five below
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->waitReady();
for(int x=0;x<500;x++) {
n = pushBlock(n);
}
s->finish();
s->wait();
verify();
delete(s);
}
TEST_F(SpoolTest, TTenBig) {
s = new Spool(5, 8000, 24, 48000, 2, true, false);
int n = 0;
// fill up the buffer reroll buffer, start, then send another five below
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->waitReady();
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->finish();
s->wait();
verify();
delete(s);
}
TEST_F(SpoolTest, TFiftyBig) {
s = new Spool(5, 8000, 24, 48000, 2, true, false);
int n = 0;
// fill up the buffer reroll buffer, start, then send another five below
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->waitReady();
for(int x=0;x<50;x++) {
n = pushBlock(n);
}
s->finish();
s->wait();
verify();
delete(s);
}
TEST_F(SpoolTest, TBiggie) {
s = new Spool(5, 3200*8, 24, 48000, 2, true, false);
int n = 0;
for(int x=0;x<5;x++) {
n = pushBlock(n);
}
s->start(f);
s->waitReady();
for(int x=0;x<500;x++) {
n = pushBlock(n);
}
s->finish();
s->wait();
verify();
delete(s);
}
| [
"drue@gigagig.org"
] | drue@gigagig.org |
1b55bcc2094c2cb3a8837fd4f1b007eb5aedd8ad | e2502b991ef5c62bf4263edc62d1e252c9294fbe | /FinalHUDTest/Intermediate/Build/Win32/UE4/Inc/FinalHUDTest/FinalHUDTestGameModeBase.generated.h | 2e0b21199dc4d738a388c3a2bc75a1c8875405f1 | [] | no_license | sbairedd/HONR399Final | 59fc2c34b01ccbad91c2f00ea6679a4aa8039411 | 0c56be06cd50d693ea5925fd065bef2d5bb51255 | refs/heads/master | 2020-04-02T03:00:28.425276 | 2018-04-27T03:58:32 | 2018-04-27T03:58:32 | 129,951,984 | 0 | 0 | null | 2018-04-17T19:00:57 | 2018-04-17T19:00:57 | null | UTF-8 | C++ | false | false | 4,456 | h | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "ObjectMacros.h"
#include "ScriptMacros.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#ifdef FINALHUDTEST_FinalHUDTestGameModeBase_generated_h
#error "FinalHUDTestGameModeBase.generated.h already included, missing '#pragma once' in FinalHUDTestGameModeBase.h"
#endif
#define FINALHUDTEST_FinalHUDTestGameModeBase_generated_h
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS_NO_PURE_DECLS
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS_NO_PURE_DECLS \
private: \
static void StaticRegisterNativesAFinalHUDTestGameModeBase(); \
friend FINALHUDTEST_API class UClass* Z_Construct_UClass_AFinalHUDTestGameModeBase(); \
public: \
DECLARE_CLASS(AFinalHUDTestGameModeBase, AGameModeBase, COMPILED_IN_FLAGS(0 | CLASS_Transient), 0, TEXT("/Script/FinalHUDTest"), NO_API) \
DECLARE_SERIALIZER(AFinalHUDTestGameModeBase) \
enum {IsIntrinsic=COMPILED_IN_INTRINSIC};
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS \
private: \
static void StaticRegisterNativesAFinalHUDTestGameModeBase(); \
friend FINALHUDTEST_API class UClass* Z_Construct_UClass_AFinalHUDTestGameModeBase(); \
public: \
DECLARE_CLASS(AFinalHUDTestGameModeBase, AGameModeBase, COMPILED_IN_FLAGS(0 | CLASS_Transient), 0, TEXT("/Script/FinalHUDTest"), NO_API) \
DECLARE_SERIALIZER(AFinalHUDTestGameModeBase) \
enum {IsIntrinsic=COMPILED_IN_INTRINSIC};
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_STANDARD_CONSTRUCTORS \
/** Standard constructor, called after all reflected properties have been initialized */ \
NO_API AFinalHUDTestGameModeBase(const FObjectInitializer& ObjectInitializer); \
DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(AFinalHUDTestGameModeBase) \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AFinalHUDTestGameModeBase); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AFinalHUDTestGameModeBase); \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API AFinalHUDTestGameModeBase(AFinalHUDTestGameModeBase&&); \
NO_API AFinalHUDTestGameModeBase(const AFinalHUDTestGameModeBase&); \
public:
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_ENHANCED_CONSTRUCTORS \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API AFinalHUDTestGameModeBase(AFinalHUDTestGameModeBase&&); \
NO_API AFinalHUDTestGameModeBase(const AFinalHUDTestGameModeBase&); \
public: \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AFinalHUDTestGameModeBase); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AFinalHUDTestGameModeBase); \
DEFINE_DEFAULT_CONSTRUCTOR_CALL(AFinalHUDTestGameModeBase)
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_12_PROLOG
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_GENERATED_BODY_LEGACY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_STANDARD_CONSTRUCTORS \
public: \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_GENERATED_BODY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS_NO_PURE_DECLS \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS_NO_PURE_DECLS \
FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_ENHANCED_CONSTRUCTORS \
private: \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#undef CURRENT_FILE_ID
#define CURRENT_FILE_ID FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h
PRAGMA_ENABLE_DEPRECATION_WARNINGS
| [
"matrickpay@gmail.com"
] | matrickpay@gmail.com |
4c384429d1e5a31f8744e0d876f49f4f273cd5af | b1950dd1f1f7cfbc8843f993b884baee0d0e3488 | /Even pair sum.cpp | caf297dc1337947ed3247773df7a7459b199129f | [] | no_license | Abhiishek-More/Codechef-Deceber-Challenge | 2645eb96ec384f163f6c8d5b05036b9729ecf8cb | 824bf9798100b2aeb7f572705bbea0826ffd546e | refs/heads/master | 2023-01-30T10:25:31.067782 | 2020-12-19T05:03:54 | 2020-12-19T05:03:54 | 322,769,994 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 714 | cpp | #include<iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
scanf("%d", &T);
while(T--)
{
unsigned long long int out, evenA=0, oddA=0, evenB=0, oddB=0;
scanf("llu %llu", &A, &B);
if(A%2==0)
{
evenA=A/2;
oddA=A/2;
}
else
{
evenA=(A/2);
oddA=evenA+1;
}
if(B%2==0)
{
evenB=B/2;
oddB=B/2;
}
else
{
evenB=(B/2);
oddB=evenB+1;
}
out = (evenA*evenB)+(oddA*oddB);
printf("%llu", out);
}
return 0;
}
| [
"abhiishek.more@gmail.com"
] | abhiishek.more@gmail.com |
7e2174584e904c1c65bf3936394e091591112054 | 561f1f3eb860795e322658667185a7e37ee5635d | /Rook.h | e7bb8e6cbb5bf9518a2b8f69f3926ef9b4fdfc9d | [] | no_license | Sabeehs/Sam-s-Chess | 13fc07997ab9251de5fe64b277c609d190fe20d9 | d654691a032d756378ce9c6c8e3c5bfd945bc0ef | refs/heads/master | 2020-06-18T10:04:21.265923 | 2019-07-15T07:08:50 | 2019-07-15T07:08:50 | 196,264,311 | 0 | 1 | null | 2019-07-15T07:08:51 | 2019-07-10T19:32:42 | C | UTF-8 | C++ | false | false | 270 | h | #pragma once
#include "Piece.h"
#include "Utilities.h"
#include "Board.h"
class Board;
class Piece;
class Rook :
public Piece
{
public:
Rook(int x, int y, int color);
void draw();
void save(ostream& out);
bool isValid(int x, int y, Board& b);
};
| [
"noreply@github.com"
] | Sabeehs.noreply@github.com |
359b8040b067b4a8f2fd4e1e17308bfde6d539a8 | 3bb8fba898d392412653bf564b53f3362edc5af8 | /Backend/src/utils/randomgeneration.cpp | 4fc010c24346cea6e4b9eb2caaec340eb1364d44 | [
"Apache-2.0"
] | permissive | Verdagon/Vale | da1e693938eb024dbf709905c4bb62d45260332d | 12e4f6410b929952ba8bfaa2cf9d6cd6bd55551d | refs/heads/master | 2023-08-06T20:00:08.695404 | 2023-08-01T23:53:31 | 2023-08-01T23:53:31 | 275,885,817 | 33 | 2 | Apache-2.0 | 2023-08-29T19:07:13 | 2020-06-29T17:42:21 | Scala | UTF-8 | C++ | false | false | 2,430 | cpp | #include "randomgeneration.h"
#include <stdint.h>
// Prime so that we don't increase the possibility of collisions.
// Below 2^32 so that it fits in an assembly immediate.
// Courtesy of https://bigprimes.org/
constexpr uint32_t GEN_PRIME_INCREMENTS[128] = {
160991227,
615539387,
139136747,
592239539,
601739071,
902536639,
417154511,
124190947,
350912953,
552641143,
241378009,
727499161,
830516237,
649011019,
178611313,
246703147,
681578717,
214214729,
436204253,
894551831,
583947491,
405597239,
756903031,
420604201,
573091567,
256130671,
293534011,
288459287,
246163271,
784985521,
244309831,
720509219,
966247663,
941308609,
308378267,
964233601,
900380791,
397141793,
203736811,
463344611,
812539913,
350951203,
714560809,
540672833,
917769491,
665142883,
874347479,
104109251,
167094337,
595121851,
505402243,
456329857,
837176653,
557156311,
535625581,
306945347,
113711173,
930534421,
418964797,
927153707,
335061497,
135281207,
863089441,
161170699,
717435781,
768130243,
143771323,
931336333,
406714631,
538466399,
668025037,
914876723,
225796253,
488110109,
990546917,
707788561,
271585519,
526449893,
645957601,
573353107,
363797761,
290497813,
439056169,
643558859,
621947003,
551631173,
706016461,
307384423,
440811083,
409993687,
843007621,
501398423,
254167217,
716556493,
523653803,
870121067,
611279363,
580165259,
256989319,
297345947,
370609901,
437890043,
902598083,
786612301,
694017223,
597535157,
510932707,
703493653,
970994873,
333253153,
905605067,
731025803,
947551313,
946634867,
131220361,
641029517,
431232049,
889467883,
462209603,
441869789,
372557071,
356736713,
328743599,
826525717,
128742517,
114189143,
433464781,
311592769
};
extern uint32_t getRandomGenerationAddend(uint64_t randomNumber) {
constexpr int numElements = (sizeof(GEN_PRIME_INCREMENTS) / sizeof(uint32_t));
static_assert(numElements == 128);
return GEN_PRIME_INCREMENTS[randomNumber % numElements];
}
| [
"noreply@github.com"
] | Verdagon.noreply@github.com |
7d57c8e86929e789a8507f31518db140d94de59e | 4bbb92f4903ffa73410a5c674aef85bf219d4242 | /Nibbler.cpp | fb08f30569c29ff3a53c0a4941574e843a27f2b1 | [] | no_license | RavivarmanPerinpanathan/nibbler | abf107b3599f4792ef52dcdec12cf60a7b5942e8 | c9a3b1b3bf58eb30f3437429b333fb6159659d1e | refs/heads/master | 2020-03-30T00:12:56.468437 | 2015-09-19T01:56:21 | 2015-09-19T01:56:21 | 42,755,295 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,661 | cpp | //
// Nibbler.cpp for Nibbler in /home/perinp_r/rendu/cpp_nibbler
//
// Made by ravivarman perinpanathan
// Login <perinp_r@epitech.net>
//
// Started on Sun Apr 5 20:35:56 2015 ravivarman perinpanathan
// Last update Sun Apr 5 21:14:05 2015 ravivarman perinpanathan
//
#include <string>
#include <iostream>
#include <list>
#include <stdlib.h>
#include <time.h>
#include <dlfcn.h>
#include <map>
#include <list>
#include "Default.hpp"
#include "Nibbler.hpp"
Nibbler::Nibbler(const Coord & dimention, Display_Lib * ptr_lib) :
_dimention(dimention), _ptr_lib(ptr_lib)
{
this->_direction_tab[UP] = Coord(0, -1);
this->_direction_tab[DOWN] = Coord(0, 1);
this->_direction_tab[RIGHT] = Coord(1, 0);
this->_direction_tab[LEFT] = Coord(-1, 0);
this->_direction = RIGHT;
this->_snaque.push_back(Coord(dimention.getX() / 2, dimention.getY() / 2));
this->_snaque.push_back(Coord(dimention.getX() / 2 - 1, dimention.getY() / 2));
this->_snaque.push_back(Coord(dimention.getX() / 2 - 2, dimention.getY() / 2));
this->_snaque.push_back(Coord(dimention.getX() / 2 - 3, dimention.getY() / 2));
for (std::list<Coord>::iterator it = this->_snaque.begin(); it != this->_snaque.end(); it++)
this->_ptr_lib->display_square(it->getX(), it->getY());
this->end = 0;
this->_food = Coord(0, 0);
this->new_food();
}
Nibbler::~Nibbler(void)
{
}
int Nibbler::move_snaque(void)
{
Coord new_head(*(this->_snaque.begin()) + this->_direction_tab[this->_direction]);
if (this->end == 0)
{
this->_ptr_lib->delete_square((this->_snaque.back()).getX(), (this->_snaque.back()).getY());
this->_snaque.pop_back();
}
this->end = 0;
if (this->check_square_is_valid(new_head, 0) == 0)
return (0);
this->_snaque.push_front(new_head);
this->_ptr_lib->display_square((this->_snaque.begin())->getX(), (this->_snaque.begin())->getY());
return (1);
}
int Nibbler::set_direction(eDir & direction)
{
if (direction == ESCAP)
return (0);
else if ((this->_direction == UP && direction == DOWN) || \
(this->_direction == DOWN && direction == UP) || \
(this->_direction == LEFT && direction == RIGHT) || \
(this->_direction == RIGHT && direction == LEFT))
return (1);
this->_direction = direction;
return (1);
}
void Nibbler::new_food(void)
{
srand(time(NULL));
Coord new_food(rand() % (this->_dimention.getX() - 4) + 2, \
rand() % (this->_dimention.getY() - 4) + 2);
this->_ptr_lib->delete_square(this->_food.getX(), this->_food.getY());
if (check_square_is_valid(new_food, 1) == 0 ||
(new_food.getX() == this->_food.getX() && new_food.getY() == this->_food.getY()))
{
new_food.setX(3);
new_food.setY(3);
}
this->_food = new_food;
this->_ptr_lib->display_food(this->_food.getX(), this->_food.getY());
}
int Nibbler::check_square_is_valid(const Coord & element, int option)
{
if (this->_food.getX() == element.getX() &&
this->_food.getY() == element.getY() && option == 1)
return (0);
if (this->_food.getX() == element.getX() &&
this->_food.getY() == element.getY())
{
this->new_food();
this->end = 1;
}
if (element.getX() < 0 || element.getY() < 0 ||
element.getX() >= this->_dimention.getX() ||
element.getY() >= this->_dimention.getY())
return (0);
for (std::list<Coord>::iterator it = this->_snaque.begin(); it != this->_snaque.end(); it++)
{
if (it->getX() == element.getX() &&
it->getY() == element.getY())
return (0);
}
return (1);
}
| [
"perinp_r@epitech.eu"
] | perinp_r@epitech.eu |
24bdf6af37e145da5df1197631e1c161aad39d16 | dd4ea6c4dc8c99d6553de987c5915de31b3d21d2 | /be/test/exprs/encryption_functions_test.cpp | 3c48b38b45747783f819c217fb922677bc31774c | [
"BSD-3-Clause",
"PSF-2.0",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"dtoa",
"MIT",
"LicenseRef-scancode-facebook-patent-rights-2",
"bzip2-1.0.6",
"OpenSSL"
] | permissive | caiconghui/incubator-doris | ac6036e5162e1204dce59facc0f868f3026d4be6 | dd869077f8ce3c2b19f29b3048c4e7e62ac31050 | refs/heads/master | 2023-08-31T20:57:15.392015 | 2023-01-19T07:56:51 | 2023-01-19T07:56:51 | 211,771,485 | 0 | 2 | Apache-2.0 | 2019-09-30T03:57:01 | 2019-09-30T03:57:00 | null | UTF-8 | C++ | false | false | 12,859 | cpp | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include "exprs/encryption_functions.h"
#include <gtest/gtest.h>
#include <iostream>
#include <string>
#include "exprs/anyval_util.h"
#include "testutil/function_utils.h"
namespace doris {
class EncryptionFunctionsTest : public testing::Test {
public:
EncryptionFunctionsTest() = default;
void SetUp() {
utils = new FunctionUtils();
ctx = utils->get_fn_ctx();
}
void TearDown() { delete utils; }
private:
FunctionUtils* utils;
FunctionContext* ctx;
};
TEST_F(EncryptionFunctionsTest, from_base64) {
std::unique_ptr<doris_udf::FunctionContext> context(new doris_udf::FunctionContext());
{
StringVal result =
EncryptionFunctions::from_base64(context.get(), doris_udf::StringVal("aGVsbG8="));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal result =
EncryptionFunctions::from_base64(context.get(), doris_udf::StringVal::null());
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
}
TEST_F(EncryptionFunctionsTest, to_base64) {
std::unique_ptr<doris_udf::FunctionContext> context(new doris_udf::FunctionContext());
{
StringVal result =
EncryptionFunctions::to_base64(context.get(), doris_udf::StringVal("hello"));
StringVal expected = doris_udf::StringVal("aGVsbG8=");
EXPECT_EQ(expected, result);
}
{
StringVal result =
EncryptionFunctions::to_base64(context.get(), doris_udf::StringVal::null());
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
}
TEST_F(EncryptionFunctionsTest, aes_decrypt) {
std::unique_ptr<doris_udf::FunctionContext> context(new doris_udf::FunctionContext());
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"));
StringVal result = EncryptionFunctions::aes_decrypt(context.get(), encryptWord,
doris_udf::StringVal("key"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"));
encryptWord.is_null = true;
StringVal result = EncryptionFunctions::aes_decrypt(context.get(), encryptWord,
doris_udf::StringVal("key"));
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("AES_128_ECB"));
encryptWord.is_null = true;
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("AES_128_ECB"));
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("AES_128_ECB"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("AES_128_ECB"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_256_CBC"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_256_CBC"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB1"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB1"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB8"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB8"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB128"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CFB128"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CTR"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_CTR"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::aes_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_OFB"));
StringVal result = EncryptionFunctions::aes_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("AES_192_OFB"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
}
TEST_F(EncryptionFunctionsTest, sm4_decrypt) {
std::unique_ptr<doris_udf::FunctionContext> context(new doris_udf::FunctionContext());
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"));
StringVal result = EncryptionFunctions::sm4_decrypt(context.get(), encryptWord,
doris_udf::StringVal("key"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"));
encryptWord.is_null = true;
StringVal result = EncryptionFunctions::sm4_decrypt(context.get(), encryptWord,
doris_udf::StringVal("key"));
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("SM4_128_ECB"));
encryptWord.is_null = true;
StringVal result = EncryptionFunctions::sm4_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal::null(), doris_udf::StringVal("SM4_128_ECB"));
StringVal expected = doris_udf::StringVal::null();
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CBC"));
StringVal result = EncryptionFunctions::sm4_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CBC"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CFB128"));
StringVal result = EncryptionFunctions::sm4_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CFB128"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CTR"));
StringVal result = EncryptionFunctions::sm4_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_CTR"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
{
StringVal encryptWord = EncryptionFunctions::sm4_encrypt(
context.get(), doris_udf::StringVal("hello"), doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_OFB"));
StringVal result = EncryptionFunctions::sm4_decrypt(
context.get(), encryptWord, doris_udf::StringVal("key"),
doris_udf::StringVal("01234567890"), doris_udf::StringVal("SM4_128_OFB"));
StringVal expected = doris_udf::StringVal("hello");
EXPECT_EQ(expected, result);
}
}
} // namespace doris
| [
"noreply@github.com"
] | caiconghui.noreply@github.com |
72645eac0c36e809b229ed72ac4b57874e408072 | 2d7236941560fe81a6390a744005128d451aa29d | /src/test/sanity_tests.cpp | 057e13db76f5defb751398c3bc186c6939db8153 | [
"MIT"
] | permissive | zero24x/billiecoin | 1fcb2fa409c3940bd493d8ff7c8ebd754fe5c881 | 1b943b84aa687136edeb6c1fa258705a99157463 | refs/heads/master | 2020-12-23T22:32:08.313554 | 2020-01-30T20:23:10 | 2020-01-30T20:23:10 | 237,296,384 | 0 | 0 | MIT | 2020-01-30T20:11:16 | 2020-01-30T20:11:16 | null | UTF-8 | C++ | false | false | 718 | cpp | // Copyright (c) 2012-2015 The Bitcoin Core developers
// Copyright (c) 2019-2020 The Billiecoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_billiecoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
}
BOOST_AUTO_TEST_SUITE_END()
| [
"admin@coldwallet2020.com"
] | admin@coldwallet2020.com |
f89d31874e0e1036a32c713bc15d8d7ae23abfd8 | a25e95ea8eb3d682286758588f79a29ba77a6121 | /Day26/Coin_Change/1/Iterative.cpp | db32c460e7c4c962d996b445e6311157544875bc | [] | no_license | veedee2000/SDE_30_DAYS | adf12bd9a7909f2c8cca2bf81bba5857c120d0ba | 31bf4220a401f2ea0879dc5aa28403527e6b8c4d | refs/heads/master | 2022-12-23T08:28:24.925486 | 2020-09-07T07:02:06 | 2020-09-07T07:02:06 | 270,763,479 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 421 | cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int>dp(amount + 1, INT_MAX);
dp[0] = 0;
for(int i = 1;i <= amount;i++){
for(auto x:coins){
if(i - x < 0 or dp[i - x] == INT_MAX) continue;
dp[i] = min(1 + dp[i - x], dp[i]);
}
}
return dp[amount] != INT_MAX ? dp[amount] : -1;
}
};
| [
"noreply@github.com"
] | veedee2000.noreply@github.com |
5e13ff7d061edb1fa547b469b4fc03c0cfa029f3 | b3f9d2a11a6ee9ace2b276a49aba380c2a79592b | /Dependencies/Build/src/skia/include/core/SkVertices.h | c127d37432cb2a6daf09ab2c5370d6918733e8d2 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | lah64/test | 0f709e776c890ee1fd826f35fdac914aeba296b2 | 9b03adce666adb85e5ae2d8af5262e0acb4b91e1 | refs/heads/master | 2023-07-21T19:38:42.479734 | 2020-10-01T23:36:55 | 2020-10-01T23:36:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,030 | h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkVertices_DEFINED
#define SkVertices_DEFINED
#include "include/core/SkColor.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
class SkData;
struct SkPoint;
class SkVerticesPriv;
/**
* An immutable set of vertex data that can be used with SkCanvas::drawVertices.
*/
class SK_API SkVertices : public SkNVRefCnt<SkVertices> {
struct Desc;
struct Sizes;
public:
// DEPRECATED -- remove when we've updated canvas virtuals to not mention bones
struct Bone { float values[6]; };
enum VertexMode {
kTriangles_VertexMode,
kTriangleStrip_VertexMode,
kTriangleFan_VertexMode,
kLast_VertexMode = kTriangleFan_VertexMode,
};
/**
* Create a vertices by copying the specified arrays. texs, colors may be nullptr,
* and indices is ignored if indexCount == 0.
*/
static sk_sp<SkVertices> MakeCopy(VertexMode mode, int vertexCount,
const SkPoint positions[],
const SkPoint texs[],
const SkColor colors[],
int indexCount,
const uint16_t indices[]);
static sk_sp<SkVertices> MakeCopy(VertexMode mode, int vertexCount,
const SkPoint positions[],
const SkPoint texs[],
const SkColor colors[]) {
return MakeCopy(mode,
vertexCount,
positions,
texs,
colors,
0,
nullptr);
}
static constexpr int kMaxCustomAttributes = 8;
struct Attribute {
enum class Type : uint8_t {
kFloat,
kFloat2,
kFloat3,
kFloat4,
kByte4_unorm,
};
Attribute() : fType(Type::kFloat) {}
Attribute(Type t) : fType(t) {}
bool operator==(const Attribute& that) const { return fType == that.fType; }
bool operator!=(const Attribute& that) const { return !(*this == that); }
int channelCount() const;
size_t bytesPerVertex() const;
Type fType;
};
enum BuilderFlags {
kHasTexCoords_BuilderFlag = 1 << 0,
kHasColors_BuilderFlag = 1 << 1,
};
class Builder {
public:
Builder(VertexMode mode, int vertexCount, int indexCount, uint32_t flags);
// EXPERIMENTAL -- do not call if you care what happens
Builder(VertexMode mode,
int vertexCount,
int indexCount,
const Attribute* attrs,
int attrCount);
bool isValid() const { return fVertices != nullptr; }
SkPoint* positions();
uint16_t* indices(); // returns null if there are no indices
// if we have texCoords or colors, this will always be null
void* customData(); // returns null if there are no custom attributes
// If we have custom attributes, these will always be null
SkPoint* texCoords(); // returns null if there are no texCoords
SkColor* colors(); // returns null if there are no colors
// Detach the built vertices object. After the first call, this will always return null.
sk_sp<SkVertices> detach();
private:
Builder(const Desc&);
void init(const Desc&);
// holds a partially complete object. only completed in detach()
sk_sp<SkVertices> fVertices;
// Extra storage for intermediate vertices in the case where the client specifies indexed
// triangle fans. These get converted to indexed triangles when the Builder is finalized.
std::unique_ptr<uint8_t[]> fIntermediateFanIndices;
friend class SkVertices;
};
uint32_t uniqueID() const { return fUniqueID; }
const SkRect& bounds() const { return fBounds; }
// returns approximate byte size of the vertices object
size_t approximateSize() const;
/**
* Recreate a vertices from a buffer previously created by calling encode().
* Returns null if the data is corrupt or the length is incorrect for the contents.
*/
static sk_sp<SkVertices> Decode(const void* buffer, size_t length);
/**
* Pack the vertices object into a byte buffer. This can be used to recreate the vertices
* by calling Decode() with the buffer.
*/
sk_sp<SkData> encode() const;
// Provides access to functions that aren't part of the public API.
SkVerticesPriv priv();
const SkVerticesPriv priv() const;
private:
SkVertices() {}
friend class SkVerticesPriv;
// these are needed since we've manually sized our allocation (see Builder::init)
friend class SkNVRefCnt<SkVertices>;
void operator delete(void* p);
Sizes getSizes() const;
// we store this first, to pair with the refcnt in our base-class, so we don't have an
// unnecessary pad between it and the (possibly 8-byte aligned) ptrs.
uint32_t fUniqueID;
// these point inside our allocation, so none of these can be "freed"
SkPoint* fPositions; // [vertexCount]
uint16_t* fIndices; // [indexCount] or null
void* fCustomData; // [customDataSize * vertexCount] or null
SkPoint* fTexs; // [vertexCount] or null
SkColor* fColors; // [vertexCount] or null
SkRect fBounds; // computed to be the union of the fPositions[]
int fVertexCount;
int fIndexCount;
Attribute fAttributes[kMaxCustomAttributes];
int fAttributeCount;
VertexMode fMode;
// below here is where the actual array data is stored.
};
#endif
| [
"alexanderskyzzz@gmail.com"
] | alexanderskyzzz@gmail.com |
de1817cd588bf23a119b7fc380563dcaf06feb26 | 2ba94892764a44d9c07f0f549f79f9f9dc272151 | /Engine/Source/Editor/ComponentVisualizers/Private/SpotLightComponentVisualizer.h | e521ad36695a50299d97924ca6d6fbcfe8d3dc13 | [
"BSD-2-Clause",
"LicenseRef-scancode-proprietary-license"
] | permissive | PopCap/GameIdea | 934769eeb91f9637f5bf205d88b13ff1fc9ae8fd | 201e1df50b2bc99afc079ce326aa0a44b178a391 | refs/heads/master | 2021-01-25T00:11:38.709772 | 2018-09-11T03:38:56 | 2018-09-11T03:38:56 | 37,818,708 | 0 | 0 | BSD-2-Clause | 2018-09-11T03:39:05 | 2015-06-21T17:36:44 | null | UTF-8 | C++ | false | false | 399 | h | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ComponentVisualizer.h"
class FSpotLightComponentVisualizer : public FComponentVisualizer
{
public:
// Begin FComponentVisualizer interface
virtual void DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI) override;
// End FComponentVisualizer interface
};
| [
"dkroell@acm.org"
] | dkroell@acm.org |
8f4eace0c98196e2f60738d99fcd5dc0a663d30b | 238e46a903cf7fac4f83fa8681094bf3c417d22d | /VTK/vtk_7.1.1_x64_Release/include/vtk-7.1/vtkUGFacetReader.h | 3abf940d6d3d984dda01a48ed2f8596b7be429f5 | [
"BSD-3-Clause"
] | permissive | baojunli/FastCAE | da1277f90e584084d461590a3699b941d8c4030b | a3f99f6402da564df87fcef30674ce5f44379962 | refs/heads/master | 2023-02-25T20:25:31.815729 | 2021-02-01T03:17:33 | 2021-02-01T03:17:33 | 268,390,180 | 1 | 0 | BSD-3-Clause | 2020-06-01T00:39:31 | 2020-06-01T00:39:31 | null | UTF-8 | C++ | false | false | 3,262 | h | /*=========================================================================
Program: Visualization Toolkit
Module: vtkUGFacetReader.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkUGFacetReader
* @brief read EDS Unigraphics facet files
*
* vtkUGFacetReader is a source object that reads Unigraphics facet files.
* Unigraphics is a solid modeling system; facet files are the polygonal
* plot files it uses to create 3D plots.
*/
#ifndef vtkUGFacetReader_h
#define vtkUGFacetReader_h
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkPolyDataAlgorithm.h"
class vtkIncrementalPointLocator;
class vtkShortArray;
class VTKIOGEOMETRY_EXPORT vtkUGFacetReader : public vtkPolyDataAlgorithm
{
public:
vtkTypeMacro(vtkUGFacetReader,vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
/**
* Construct object to extract all parts, and with point merging
* turned on.
*/
static vtkUGFacetReader *New();
/**
* Overload standard modified time function. If locator is modified,
* then this object is modified as well.
*/
vtkMTimeType GetMTime();
//@{
/**
* Specify Unigraphics file name.
*/
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
//@}
/**
* Special methods for interrogating the data file.
*/
int GetNumberOfParts();
/**
* Retrieve color index for the parts in the file.
*/
short GetPartColorIndex(int partId);
//@{
/**
* Specify the desired part to extract. The part number must range between
* [0,NumberOfParts-1]. If the value is =(-1), then all parts will be
* extracted. If the value is <(-1), then no parts will be extracted but
* the part colors will be updated.
*/
vtkSetMacro(PartNumber,int);
vtkGetMacro(PartNumber,int);
//@}
//@{
/**
* Turn on/off merging of points/triangles.
*/
vtkSetMacro(Merging,int);
vtkGetMacro(Merging,int);
vtkBooleanMacro(Merging,int);
//@}
//@{
/**
* Specify a spatial locator for merging points. By
* default an instance of vtkMergePoints is used.
*/
void SetLocator(vtkIncrementalPointLocator *locator);
vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
//@}
/**
* Create default locator. Used to create one when none is specified.
*/
void CreateDefaultLocator();
protected:
vtkUGFacetReader();
~vtkUGFacetReader();
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
char *FileName;
vtkShortArray *PartColors;
int PartNumber;
int Merging;
vtkIncrementalPointLocator *Locator;
private:
vtkUGFacetReader(const vtkUGFacetReader&) VTK_DELETE_FUNCTION;
void operator=(const vtkUGFacetReader&) VTK_DELETE_FUNCTION;
};
#endif
| [
"l”ibaojunqd@foxmail.com“"
] | l”ibaojunqd@foxmail.com“ |
ab1b878366e04fb0ea3c827393e478714e8188c1 | af7f2ef58c7cbbbe78f0a2e57a14d45016ec607e | /Micro16/third_pipe.H | daaf12fa5ba2a087f657039df75775b843fa6d53 | [] | no_license | juliolugo96/microbaseball | d585dc313a0fbc216ad1fbb1760cf06d7e033ea9 | bde02945b6d4dcfc1069fcfbd19d712e2352459a | refs/heads/master | 2020-06-10T03:27:10.524604 | 2019-06-24T19:42:49 | 2019-06-24T19:42:49 | 193,567,360 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,433 | h | #ifndef THIRD_PIPE_H
#define THIRD_PIPE_H
/**
* @name Third pipe
* @file third_pipe.H
* @author Micro 16 development team
* @brief Third pipe designed and developed in C++ using
* system-C library
*/
# include <systemc.h>
# include <iostream>
using namespace std;
class third_pipe : public sc_module
{
public:
sc_in <bool> clock;
sc_in <bool> enable;
sc_in < sc_uint<4> > op_in, r3_in;
sc_in < sc_uint<32> > result_in, store_in;
sc_in < sc_uint<8> > dir_in;
sc_out < sc_uint<4> > op_out, r3_out;
sc_out < sc_uint<32> > result_out, store_out;
sc_out < sc_uint<8> > dir_out;
SC_CTOR(third_pipe)
{
for(int i = 0 ; i < 2; i++)
arit_log_reg[i] = 0;
op_reg = 0;
dir_reg = 0;
SC_METHOD(write);
sensitive << clock.pos() << enable << op_in << r3_in << result_in << store_in << dir_in;
SC_METHOD(read);
sensitive << clock.neg();
}
private:
sc_uint<4> op_reg, r3_reg;
sc_uint <32> arit_log_reg[2];
sc_uint <8> dir_reg;
void write()
{
if(enable)
{
op_reg = op_in.read();
r3_reg = r3_in.read();
arit_log_reg[0] = result_in.read();
arit_log_reg[1] = store_in.read();
dir_reg = dir_in.read();
}
}
void read()
{
op_out.write(op_reg);
r3_out.write(r3_reg);
result_out.write(arit_log_reg[0]);
store_out.write(arit_log_reg[1]);
dir_out.write(dir_reg);
}
};
#endif | [
"julio@ignisgravitas.com"
] | julio@ignisgravitas.com |
a7ff28344b98ad10dda0c116d6e488486242db7b | d907ac57899bc7933451097de5224dc70199c7b9 | /offer18/List.cpp | 3e69956072007289e7d5e8776857436a6bc0146f | [] | no_license | wzq-hwx/offer_jian | 1874776629e5854b06b08de75a700cb254e0619a | 4e7ed3a0143fe21ec6f2058f87d013652ccc6ae3 | refs/heads/master | 2020-07-05T00:00:34.301214 | 2019-09-27T07:24:02 | 2019-09-27T07:24:02 | 202,462,673 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,199 | cpp | //
// Created by lenovo on 2019/8/27.
//
#include "List00.h"
#include <stdio.h>
#include <stdlib.h>
ListNode* CreateListNode(int value)
{
ListNode* pNode = new ListNode();
pNode->m_nValue = value;
pNode->m_pNext = nullptr;
return pNode;
}
void ConnectListNodes(ListNode* pCurrent, ListNode* pNext)
{
if(pCurrent == nullptr)
{
printf("Error to connect two nodes.\n");
exit(1);
}
pCurrent->m_pNext = pNext;
}
void PrintListNode(ListNode* pNode)
{
if(pNode == nullptr)
{
printf("The node is nullptr\n");
}
else
{
printf("The key in node is %d.\n", pNode->m_nValue);
}
}
void PrintList(ListNode* pHead)
{
printf("PrintList starts.\n");
ListNode* pNode = pHead;
while(pNode != nullptr)
{
printf("%d\t", pNode->m_nValue);
pNode = pNode->m_pNext;
}
printf("\nPrintList ends.\n");
}
void DestroyList(ListNode* pHead)
{
ListNode* pNode = pHead;
while(pNode != nullptr)
{
pHead = pHead->m_pNext;
delete pNode;
pNode = pHead;
}
}
void AddToTail(ListNode** pHead, int value)
{
ListNode* pNew = new ListNode();
pNew->m_nValue = value;
pNew->m_pNext = nullptr;
if(*pHead == nullptr)
{
*pHead = pNew;
}
else
{
ListNode* pNode = *pHead;
while(pNode->m_pNext != nullptr)
pNode = pNode->m_pNext;
pNode->m_pNext = pNew;
}
}
void RemoveNode(ListNode** pHead, int value)
{
if(pHead == nullptr || *pHead == nullptr)
return;
ListNode* pToBeDeleted = nullptr;
if((*pHead)->m_nValue == value)
{
pToBeDeleted = *pHead;
*pHead = (*pHead)->m_pNext;
}
else
{
ListNode* pNode = *pHead;
while(pNode->m_pNext != nullptr && pNode->m_pNext->m_nValue != value)
pNode = pNode->m_pNext;
if(pNode->m_pNext != nullptr && pNode->m_pNext->m_nValue == value)
{
pToBeDeleted = pNode->m_pNext;
pNode->m_pNext = pNode->m_pNext->m_pNext;
}
}
if(pToBeDeleted != nullptr)
{
delete pToBeDeleted;
pToBeDeleted = nullptr;
}
} | [
"1259906709@qq.com"
] | 1259906709@qq.com |
e33b297aa415a4e9eddaaea8ae93947d887c91e4 | 193f868f85e31da20e01c04cee2f2313c8db1ac8 | /SimulatedAnnealingExtraP/Solution.cpp | e03da327fc90ffe474345d8352fc652e07d5e83b | [
"Apache-2.0"
] | permissive | MiBu84/SMP-Simulated-Annealing | 3a2e9fdcac2d99a8823559f9480c6dc0d8e4ad37 | e70ce403012ffc285e5053afd87e5e78a0d5fefa | refs/heads/master | 2020-03-22T18:23:31.645780 | 2018-07-11T08:56:08 | 2018-07-11T08:56:08 | 140,457,236 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,626 | cpp | #include "stdafx.h"
#include "Solution.h"
#include "Configurator.h"
#include <math.h>
#include "EigenParameterEstimator.h"
#include <iostream>
#include <random>
#include <omp.h>
#include "Configurator.h"
#include "RSSCostCalculator.h"
#include <sstream>
Solution::Solution()
{
if (_len > 0)
_coefficients = new double[_len];
for (int i = 0; i < _len; i++) _coefficients[i] = 0.0;
}
Solution::Solution(MeasurementDB* mdb)
{
double min_c_3 = 10e-2;
double max_c_3 = 1e0;
double min_c_4 = 0.2;
double max_c_4 = 1.0;
double min_c_5 = 0;
double max_c_5 = Configurator::getInstance().max_pol_range;
int num_threads = Configurator::getInstance().num_threads;
int thread_id = omp_get_thread_num();
double split_c4_steps = (abs(min_c_4) + abs(max_c_4)) / num_threads;
double split_c4_min = thread_id * split_c4_steps;
double split_c4_max = (thread_id + 1) * split_c4_steps;
EigenParameterEstimator paramest = EigenParameterEstimator(mdb);
RSSCostCalculator costcalc = RSSCostCalculator(mdb);
if (_len > 0)
_coefficients = new double[_len];
double start_vals[5] = { 0, 0, 1, 0, 0 };
for (int i = 0; i < _len; i++) _coefficients[i] = start_vals[i];
paramest.estimateParameters(this);
costcalc.calculateCost(this);
std::random_device seeder;
std::mt19937 engine(seeder());
std::uniform_real_distribution<double> distc2(min_c_3, max_c_3);
std::uniform_real_distribution<double> distc3(min_c_4, max_c_4);
std::uniform_real_distribution<double> distc4(min_c_5, max_c_5);
Solution act_sol = *this;
act_sol.updateAt(4, distc4(seeder));
int count = 0;
do
{
act_sol.updateAt(2, distc2(seeder));
act_sol.updateAt(3, distc3(seeder));
paramest.estimateParameters(&act_sol);
costcalc.calculateCost(&act_sol);
count++;
} while ((act_sol.get_costs() > this->get_costs()) || std::isnan(act_sol.get_costs()));
*this = act_sol;
}
Solution::Solution(double* coefficients)
{
if (_len > 0)
_coefficients = new double[_len];
for (int i = 0; i < _len; i++) _coefficients[i] = coefficients[i];
}
Solution::Solution(const Solution& other) {
if (_len > 0)
_coefficients = new double[_len];
for (int i = 0; i < this->_len; i++)
this->_coefficients[i] = other._coefficients[i];
_costs = other._costs;
setRandomID();
}
Solution & Solution::operator= (const Solution & other) {
if (_len > 0)
_coefficients = new double[_len];
for (int i = 0; i < this->_len; i++)
this->_coefficients[i] = other._coefficients[i];
_costs = other._costs;
setRandomID();
return *this;
}
Solution Solution::getNeighborSolution() {
Solution random_sol = Solution(this->get_coefficients());
std::random_device seeder;
std::mt19937 engine(seeder());
std::uniform_int_distribution<int> dist2_4(2, 4);
std::uniform_int_distribution<int> dist20(-Configurator::getInstance().std_exp_range, Configurator::getInstance().std_exp_range);
std::uniform_int_distribution<int> distc_2_3_change(-300, 300);
std::uniform_int_distribution<int> dist0or1(0,1);
// Decide which coefficient to change c_2, c_3 or c_4
int coeff = dist2_4(engine);
/*
Er muss doch in Solution nicht in Random Sol nach coefficients suchen, oder?
*/
// Change c_2
double new_val = -1000;
if (coeff == 2) {
do
{
int fac;
if (dist0or1(engine) == 1)
fac = 1;
else
fac = -1;
double val = random_sol.getAt(2);
int log_of_val = int(log10(val));
double change = fac * pow(10, log_of_val - 1);
new_val = val + change;
// Check if we break from 10^x to 10^(x-1) or 10^(x+1)
if (int(log10(val)) > int(log10(new_val))) {
change = change * 0.1;
new_val = val + change;
}
else {
// Everything okay
}
}
// Limit the search space to exclude unrealistic results
while (!(new_val > 0.1) || !(new_val < 1.0));
random_sol.updateAt(2, new_val);
}
// Change c_3
else if (coeff == 3) {
double val = double(dist20(engine)) / 200.0;
if (random_sol.getAt(3) + val > 0.00)
random_sol.updateAt(3, random_sol.getAt(3) + val);
}
// Change c_4
else if (coeff == 4) {
double change = 0.0;
double val = random_sol.getAt(4);
do {
double temp = (double)distc_2_3_change(engine);
change = temp / 100.0;
} while (!((val + change) >= 0.0 && (val + change <= Configurator::getInstance().max_pol_range)));
}
return random_sol;
}
double Solution::evaluateModelFunctionAt(double p)
{
double* c = _coefficients; // just to make access brief
double exp = c[2] * pow(p, c[3]) /* pow(log10(p), c[4])*/;
double y = c[0] + c[1] * pow(2.0, exp) * pow(p, c[4]);
#ifdef SOLUTION_DEBUG
std::cout << "f(" << p << ") = " << c[0] << " + " << c[1] << " * exp"
<< y << " with exp = " << exp << std::endl;
#endif
return y;
}
double Solution::evaluateConstantTermAt(double p)
{
double* c = _coefficients; // just to make access brief
double exp = c[2] * pow(p, c[3]) /* pow(log10(p), c[4])*/;
double y = pow(2.0, exp) * pow(p, c[4]);
#ifdef SOLUTION_DEBUG
std::cout << "varterm(" << p << ") = " << y << " with exp = " << exp << std::endl;
#endif
return y;
}
void Solution::printModelFunction() {
double * c = _coefficients;
std::cout << "(ID: " << this->id << ") \t f(p) = " << c[0] << " + " << c[1] << " * 2^ ("
<< c[2] << " * p^" << c[3] << " * log^" << c[4] << "(p) ) * p^" << c[4] << std::endl;
}
std::string Solution::printModelFunctionLatex() const {
std::ostringstream streamObj;
streamObj << getAt(0);
std::string str_c0 = streamObj.str();
streamObj.str("");
streamObj << getAt(1);
std::string str_c1 = streamObj.str();
streamObj.str("");
streamObj << getAt(2);
std::string str_c2 = streamObj.str();
streamObj.str("");
streamObj << getAt(3);
std::string str_c3 = streamObj.str();
streamObj.str("");
streamObj << getAt(4);
std::string str_c4 = streamObj.str();
streamObj.str("");
std::string func = "";
func += "(\\x, {" + str_c0 + " + " + str_c1 + " * 2 ^ ("
+ str_c2 + " * \\x ^ (" + str_c3 + ")) * \\x ^" + str_c4 + "})";
return func;
}
std::string Solution::printModelFunctionLatexShow() const {
std::ostringstream streamObj;
streamObj << getAt(0);
std::string str_c0 = streamObj.str();
streamObj.str("");
streamObj << getAt(1);
std::string str_c1 = streamObj.str();
streamObj.str("");
streamObj << getAt(2);
std::string str_c2 = streamObj.str();
streamObj.str("");
streamObj << getAt(3);
std::string str_c3 = streamObj.str();
streamObj.str("");
streamObj << getAt(4);
std::string str_c4 = streamObj.str();
streamObj.str("");
std::string func = "";
func += str_c0 + " + " + str_c1 + " * 2 ^ {"
+ str_c2 + " * x ^ {" + str_c3 + "}} * x ^ {" + str_c4 + "}";
return func;
} | [
"michael.burger84@gmx.de"
] | michael.burger84@gmx.de |
982784b052fe88e88786e2a85ce21f2d1b783b97 | a33aac97878b2cb15677be26e308cbc46e2862d2 | /program_data/PKU_raw/95/375.c | 90860a26d5dfc92a47edba6f24b5df84dfa3264f | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 420 | c | int main(int argc, char* argv[])
{
char s1[80],s2[80];
int i;
gets(s1);
gets(s2);
for (i=0;s1[i]!='\0';i++)
{
if (s1[i]<='z'&&s1[i]>='a')
{
s1[i]=s1[i]-32;
}
}
for (i=0;s2[i]!='\0';i++)
{
if (s2[i]<='z'&&s2[i]>='a')
{
s2[i]=s2[i]-32;
}
}
i=strcmp(s1,s2);
if (i==0)
printf ("=");
else if (i<0)
printf ("<");
else if (i>0)
printf (">");
return 0;
}
| [
"bdqnghi@gmail.com"
] | bdqnghi@gmail.com |
e62ea1646814980e4f52832b256289c26ea29887 | ad273708d98b1f73b3855cc4317bca2e56456d15 | /aws-cpp-sdk-application-insights/source/model/ListComponentsResult.cpp | eb4afd45d90e39c9d6228c846b37d839df5be498 | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | novaquark/aws-sdk-cpp | b390f2e29f86f629f9efcf41c4990169b91f4f47 | a0969508545bec9ae2864c9e1e2bb9aff109f90c | refs/heads/master | 2022-08-28T18:28:12.742810 | 2020-05-27T15:46:18 | 2020-05-27T15:46:18 | 267,351,721 | 1 | 0 | Apache-2.0 | 2020-05-27T15:08:16 | 2020-05-27T15:08:15 | null | UTF-8 | C++ | false | false | 1,892 | cpp | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <aws/application-insights/model/ListComponentsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::ApplicationInsights::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListComponentsResult::ListComponentsResult()
{
}
ListComponentsResult::ListComponentsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListComponentsResult& ListComponentsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("ApplicationComponentList"))
{
Array<JsonView> applicationComponentListJsonList = jsonValue.GetArray("ApplicationComponentList");
for(unsigned applicationComponentListIndex = 0; applicationComponentListIndex < applicationComponentListJsonList.GetLength(); ++applicationComponentListIndex)
{
m_applicationComponentList.push_back(applicationComponentListJsonList[applicationComponentListIndex].AsObject());
}
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
944ed5eba0c5fc01df846105723781eb2b5b3342 | 340980d65abc89e98b274417ec118b1beca77924 | /Kick Start/2021/1 A/KGoodnessString.cpp | bf2a189a8fab2177b96a742331b7f4b6ab5cc4d7 | [] | no_license | AthulJoseph27/Code-Jam | fe5b1fcb7c986d443168940a69ddf36127cd2973 | fcab3e58b69cf4eed8fb20f7d3e77403a1acf517 | refs/heads/main | 2023-05-05T04:43:22.181102 | 2021-05-23T17:14:24 | 2021-05-23T17:14:24 | 353,401,041 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,971 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define push push_back
#define all(v) v.begin(), v.end()
void __print(int x)
{
cerr << x;
}
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x)
{
cerr << '{';
__print(x.first);
cerr << ',';
__print(x.second);
cerr << '}';
}
template <typename T>
void __print(const T &x)
{
int f = 0;
cerr << '{';
for (auto &i : x)
cerr << (f++ ? "," : ""), __print(i);
cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v)
{
__print(t);
if (sizeof...(v))
cerr << ", ";
_print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...) \
cerr << "[" << #x << "] = ["; \
_print(x)
#else
#define debug(x...)
#endif
void solve(int cc)
{
string s;
int n, k;
cin >> n >> k;
cin >> s;
int goodness = 0;
for (int i = 1; i <= n / 2; i++)
{
if (s[i - 1] != s[n - i])
goodness++;
}
cout << "Case #" << cc << ": " << abs(goodness - k) << '\n';
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T;
cin >> T;
for (int i = 0; i < T; i++)
{
solve(i + 1);
}
return 0;
} | [
"athuljoseph27052001@gmail.com"
] | athuljoseph27052001@gmail.com |
2f6190370eb297db2b2011dfb5bb2d60cdee6068 | 0953b8e08ae16dfb2ddfe278d28cbcd32d8f1276 | /Bit Manupulation/342. Power of Four.cpp | aa9b477836839ea646e86a5d5234c0b914b92bcc | [] | no_license | Robust-star/Leetcode_Practice | acc876f13cf0bb3d52e2759d8f064f9453c10b5a | 8dddf0626a4dabbecc40108d5e4f7d5bf2336bdd | refs/heads/master | 2023-06-08T21:09:15.501292 | 2021-06-30T16:48:00 | 2021-06-30T16:48:00 | 378,225,927 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,222 | cpp | bool isPowerOfFour(const int &num)
{
return num > 0 && (num & (num - 1)) == 0 && (num & 0xAAAAAAAA) == 0;
}
// Explanation:
// A number which is a power of 4 has binary representation like this:
// 000...1000000...
// There's only a single 1 bit. The number of zeros after the bit 1 must be an even number. 4^0 = 1 (1), 4^1 = 4 (100), 4^2 = 16 (10000). When we multiply a number by 4, we shift it left by 2 which means adding 2 more zeros after the 1 bit. In other words, the 1 bit must be in an even position.
// To check if there's only a single bit 1: num & (num - 1) == 0. According to Cracking the Coding Interview's explanation:
// A & B == 0 means that A and B never have a 1 bit in the same place.
// When you subtract 1 from a number, you look at the least significant bit. If it's a 1 you change it to 0, and you are done. If it's a zero, you must "borrow" from a larger bit. So, you go to increasingly larger bits, changing each bit from a 0 to a 1, until you find a 1. You flip that 1 to a 0 and you are done. Thus, n-1 will look like n, except that n's initial 0s will be 1 s in n-1, and n's least significant 1 will be a 0 in n-1. That is: if n = abcde1000 then n-1 = abcde0111.
// Recall that n and n-1 never have a 1 bit in the same place. n and n-1 have the same part in their binary representation: abcde. We can conclude that abcde = 00000, which means n = 00000...1000...
// Actually this is a way to check if n is a power of 2 (or if n is 0).
// How about (num & 0xAAAAAAAA) == 0? 0xAAAAAAAA is 1010101010101010101010101010101010101010 in binary. ANDing a 32-bit number with 0xAAAAAAAA means setting all even bits to 0. After clearing even bits, if the number is larger than 0, it means the 1 bit is in an odd position and num is just a power of 2. Otherwise num is a power of 4 (or a zero).
// Finally, remember to check num > 0.
// I see lots of solutions using built-in power or log function. I don't know the time complexity of these functions (if you know, please leave your comment to let me know) but I think they're slower than bitwise operation. I also think that computing floating-point number may leads to incorrect results because of accuracy problem.
// Hope this helps! | [
"raj1999gupta@gmail.com"
] | raj1999gupta@gmail.com |
f9874f8ccf40dcb5c1b81242bebf0444488c0bb1 | feff5dadc85629c0947abf87a79f86ace8c84539 | /atcoder/abc256/F.cpp | afba99011943b06a1c6ca8e3de8c6ea5b07fbab7 | [] | no_license | Redleaf23477/ojcodes | af7582d9de8619509fa4ffa5338b2a59d9176608 | 7ee3053a88a78f74764bc473b3bd4887ceac6734 | refs/heads/master | 2023-08-13T22:34:58.000532 | 2023-08-10T15:54:05 | 2023-08-10T15:54:05 | 107,507,680 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,865 | cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
constexpr LL MOD = 998244353;
LL fastpw(LL x, LL p) {
LL ans = 1;
while (p > 0) {
if (p % 2 == 1) ans = ans * x % MOD;
x = x * x % MOD;
p /= 2;
}
return ans;
}
struct BIT {
int n;
vector<LL> bit;
int lowbit(int x) { return x & (-x); }
BIT(int _n) : n(_n), bit(n + 1, 0) {}
void add(int pos, LL val) {
for (; pos <= n; pos += lowbit(pos)) {
bit[pos] = (bit[pos] + val) % MOD;
}
}
LL sum(LL pos) {
LL ans = 0;
for (; pos > 0; pos -= lowbit(pos)) {
ans = (ans + bit[pos]) % MOD;
}
return ans;
}
};
void solve() {
int N, Q; cin >> N >> Q;
vector<LL> A(N);
for (auto &x : A) cin >> x;
BIT zero(N), one(N), two(N);
for (LL i = 1; i <= N; i++) {
zero.add(i, A[i - 1]);
one.add(i, i * A[i - 1] % MOD);
two.add(i, i * i % MOD * A[i - 1] % MOD);
}
LL inv2 = fastpw(2, MOD - 2);
while (Q--) {
int op; cin >> op;
if (op == 1) {
LL x; cin >> x;
LL val; cin >> val; val %= MOD;
val = (val - A[x - 1] + MOD) % MOD;
A[x - 1] = (A[x - 1] + val) % MOD;
zero.add(x, val);
one.add(x, x * val % MOD);
two.add(x, x * x % MOD * val % MOD);
} else {
LL x; cin >> x;
LL ans = (x + 2) % MOD * (x + 1) % MOD * inv2 % MOD * zero.sum(x) % MOD;
ans = (ans + (-3 - 2 * x + MOD) % MOD * inv2 % MOD * one.sum(x) % MOD) % MOD;
ans = (ans + inv2 * two.sum(x) % MOD) % MOD;
cout << ans << "\n";
}
}
}
int main() {
ios::sync_with_stdio(false); cin.tie(0);
// int T; cin >> T;
int T = 1;
while (T--) {
solve();
}
}
| [
"schpokeool@gmail.com"
] | schpokeool@gmail.com |
c92c037f40c5b192a89f583c30cc5ac49aed0012 | 2836cce07d048ed1fc9f1bd53a958df3681112c6 | /Triditizer/logging.cpp | 2ca65f75be0fdc5272ae2739780fcfbed7ee080d | [
"MIT"
] | permissive | samaust/Triditizer | 08ad4b19c4912f669fcd8f4876952856c6f7f53a | bd0a5aa7369be9b80a72d90890e97dc488575a58 | refs/heads/master | 2020-12-31T07:55:47.688623 | 2016-02-21T04:01:16 | 2016-02-21T04:01:16 | 52,189,743 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 729 | cpp |
#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include "logging.h"
va_list va_alist;
std::ofstream ofile;
static bool logOpened = false;
void __cdecl open_log(void)
{
if (!logOpened)
{
logOpened = true;
static char dir[] = "C:\\StereoScreenshots\\stereoLog.txt"; // hardcoded path
ofile.open(dir, std::ios::app);
}
}
void __cdecl add_log(const char *fmt, ...)
{
char logbuf[50000] = { 0 };
if (!fmt) { return; }
va_start(va_alist, fmt);
_vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
va_end(va_alist);
if (ofile)
{
ofile << logbuf << std::endl;
}
}
void __cdecl close_log(void)
{
if (ofile) { ofile.close(); }
} | [
"samaust@hotmail.com"
] | samaust@hotmail.com |
63112593eda14daa8418a57797897735bb3a602a | 536656cd89e4fa3a92b5dcab28657d60d1d244bd | /third_party/blink/renderer/modules/background_fetch/background_fetch_record.cc | 2b90ccf72dd7ed34ed79c43fb28fa52f23d13511 | [
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | ECS-251-W2020/chromium | 79caebf50443f297557d9510620bf8d44a68399a | ac814e85cb870a6b569e184c7a60a70ff3cb19f9 | refs/heads/master | 2022-08-19T17:42:46.887573 | 2020-03-18T06:08:44 | 2020-03-18T06:08:44 | 248,141,336 | 7 | 8 | BSD-3-Clause | 2022-07-06T20:32:48 | 2020-03-18T04:52:18 | null | UTF-8 | C++ | false | false | 3,688 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/background_fetch/background_fetch_record.h"
#include "third_party/blink/renderer/core/fetch/request.h"
#include "third_party/blink/renderer/core/fetch/response.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
namespace blink {
BackgroundFetchRecord::BackgroundFetchRecord(Request* request,
ScriptState* script_state)
: request_(request), script_state_(script_state) {
DCHECK(request_);
DCHECK(script_state_);
response_ready_property_ = MakeGarbageCollected<ResponseReadyProperty>(
ExecutionContext::From(script_state));
}
BackgroundFetchRecord::~BackgroundFetchRecord() = default;
void BackgroundFetchRecord::ResolveResponseReadyProperty(Response* response) {
if (response_ready_property_->GetState() !=
ResponseReadyProperty::State::kPending) {
return;
}
switch (record_state_) {
case State::kPending:
return;
case State::kAborted:
response_ready_property_->Reject(MakeGarbageCollected<DOMException>(
DOMExceptionCode::kAbortError,
"The fetch was aborted before the record was processed."));
return;
case State::kSettled:
if (response) {
response_ready_property_->Resolve(response);
return;
}
if (!script_state_->ContextIsValid())
return;
// TODO(crbug.com/875201): Per https://wicg.github.io/background-fetch/
// #background-fetch-response-exposed, this should be resolved with a
// TypeError. Figure out a way to do so.
// Rejecting this with a TypeError here doesn't work because the
// RejectedType is a DOMException. Update this with the correct error
// once confirmed, or change the RejectedType.
response_ready_property_->Reject(MakeGarbageCollected<DOMException>(
DOMExceptionCode::kUnknownError, "The response is not available."));
}
}
ScriptPromise BackgroundFetchRecord::responseReady(ScriptState* script_state) {
return response_ready_property_->Promise(script_state->World());
}
Request* BackgroundFetchRecord::request() const {
return request_;
}
void BackgroundFetchRecord::UpdateState(
BackgroundFetchRecord::State updated_state) {
DCHECK_EQ(record_state_, State::kPending);
if (!script_state_->ContextIsValid())
return;
record_state_ = updated_state;
ResolveResponseReadyProperty(/* updated_response = */ nullptr);
}
void BackgroundFetchRecord::SetResponseAndUpdateState(
mojom::blink::FetchAPIResponsePtr& response) {
DCHECK(record_state_ == State::kPending);
DCHECK(!response.is_null());
if (!script_state_->ContextIsValid())
return;
record_state_ = State::kSettled;
ScriptState::Scope scope(script_state_);
ResolveResponseReadyProperty(Response::Create(script_state_, *response));
}
bool BackgroundFetchRecord::IsRecordPending() {
return record_state_ == State::kPending;
}
void BackgroundFetchRecord::OnRequestCompleted(
mojom::blink::FetchAPIResponsePtr response) {
if (!response.is_null())
SetResponseAndUpdateState(response);
else
UpdateState(State::kSettled);
}
const KURL& BackgroundFetchRecord::ObservedUrl() const {
return request_->url();
}
void BackgroundFetchRecord::Trace(Visitor* visitor) {
visitor->Trace(request_);
visitor->Trace(response_ready_property_);
visitor->Trace(script_state_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
| [
"pcding@ucdavis.edu"
] | pcding@ucdavis.edu |
d63f80de77cc0dc1bb05120e0c4edf6d09b5087e | 9a94e85ef2820d626cd76123b9aa49190c991003 | /HSPF_MRO_ANDR/build/iOS/Preview/src/_root.HSMRO_FuseControlsControl_Background_Property.cpp | 3545ef526d825925deb981fb2b1554157d60f7ce | [] | no_license | jaypk-104/FUSE | 448db1717a29052f7b551390322a6167dfea34cd | 0464afa07998eea8de081526a9337bd9af42dcf3 | refs/heads/master | 2023-03-13T14:32:43.855977 | 2021-03-18T01:57:10 | 2021-03-18T01:57:10 | 348,617,284 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,847 | cpp | // This file was generated based on '/Users/jay/Dev/Fuse/HSPF_MRO_ANDR/build/iOS/Preview/cache/ux15/HS MRO.unoproj.g.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#include <_root.HSMRO_FuseControlsControl_Background_Property.h>
#include <Fuse.Controls.Control.h>
#include <Uno.UX.IPropertyListener.h>
#include <Uno.UX.PropertyObject.h>
#include <Uno.UX.Selector.h>
static uType* TYPES[1];
namespace g{
// internal sealed class HSMRO_FuseControlsControl_Background_Property
// {
static void HSMRO_FuseControlsControl_Background_Property_build(uType* type)
{
::TYPES[0] = ::g::Fuse::Controls::Control_typeof();
type->SetBase(::g::Uno::UX::Property1_typeof()->MakeType(::g::Fuse::Drawing::Brush_typeof(), NULL));
type->SetFields(1,
::TYPES[0/*Fuse.Controls.Control*/], offsetof(HSMRO_FuseControlsControl_Background_Property, _obj), uFieldFlagsWeak);
}
::g::Uno::UX::Property1_type* HSMRO_FuseControlsControl_Background_Property_typeof()
{
static uSStrong< ::g::Uno::UX::Property1_type*> type;
if (type != NULL) return type;
uTypeOptions options;
options.BaseDefinition = ::g::Uno::UX::Property1_typeof();
options.FieldCount = 2;
options.ObjectSize = sizeof(HSMRO_FuseControlsControl_Background_Property);
options.TypeSize = sizeof(::g::Uno::UX::Property1_type);
type = (::g::Uno::UX::Property1_type*)uClassType::New("HSMRO_FuseControlsControl_Background_Property", options);
type->fp_build_ = HSMRO_FuseControlsControl_Background_Property_build;
type->fp_Get1 = (void(*)(::g::Uno::UX::Property1*, ::g::Uno::UX::PropertyObject*, uTRef))HSMRO_FuseControlsControl_Background_Property__Get1_fn;
type->fp_get_Object = (void(*)(::g::Uno::UX::Property*, ::g::Uno::UX::PropertyObject**))HSMRO_FuseControlsControl_Background_Property__get_Object_fn;
type->fp_Set1 = (void(*)(::g::Uno::UX::Property1*, ::g::Uno::UX::PropertyObject*, void*, uObject*))HSMRO_FuseControlsControl_Background_Property__Set1_fn;
return type;
}
// public HSMRO_FuseControlsControl_Background_Property(Fuse.Controls.Control obj, Uno.UX.Selector name)
void HSMRO_FuseControlsControl_Background_Property__ctor_3_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector* name)
{
__this->ctor_3(obj, *name);
}
// public override sealed Fuse.Drawing.Brush Get(Uno.UX.PropertyObject obj)
void HSMRO_FuseControlsControl_Background_Property__Get1_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject* obj, ::g::Fuse::Drawing::Brush** __retval)
{
uStackFrame __("HSMRO_FuseControlsControl_Background_Property", "Get(Uno.UX.PropertyObject)");
return *__retval = uPtr(uCast< ::g::Fuse::Controls::Control*>(obj, ::TYPES[0/*Fuse.Controls.Control*/]))->Background(), void();
}
// public HSMRO_FuseControlsControl_Background_Property New(Fuse.Controls.Control obj, Uno.UX.Selector name)
void HSMRO_FuseControlsControl_Background_Property__New1_fn(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector* name, HSMRO_FuseControlsControl_Background_Property** __retval)
{
*__retval = HSMRO_FuseControlsControl_Background_Property::New1(obj, *name);
}
// public override sealed Uno.UX.PropertyObject get_Object()
void HSMRO_FuseControlsControl_Background_Property__get_Object_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject** __retval)
{
return *__retval = __this->_obj, void();
}
// public override sealed void Set(Uno.UX.PropertyObject obj, Fuse.Drawing.Brush v, Uno.UX.IPropertyListener origin)
void HSMRO_FuseControlsControl_Background_Property__Set1_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject* obj, ::g::Fuse::Drawing::Brush* v, uObject* origin)
{
uStackFrame __("HSMRO_FuseControlsControl_Background_Property", "Set(Uno.UX.PropertyObject,Fuse.Drawing.Brush,Uno.UX.IPropertyListener)");
uPtr(uCast< ::g::Fuse::Controls::Control*>(obj, ::TYPES[0/*Fuse.Controls.Control*/]))->Background(v);
}
// public HSMRO_FuseControlsControl_Background_Property(Fuse.Controls.Control obj, Uno.UX.Selector name) [instance]
void HSMRO_FuseControlsControl_Background_Property::ctor_3(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector name)
{
ctor_2(name);
_obj = obj;
}
// public HSMRO_FuseControlsControl_Background_Property New(Fuse.Controls.Control obj, Uno.UX.Selector name) [static]
HSMRO_FuseControlsControl_Background_Property* HSMRO_FuseControlsControl_Background_Property::New1(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector name)
{
HSMRO_FuseControlsControl_Background_Property* obj1 = (HSMRO_FuseControlsControl_Background_Property*)uNew(HSMRO_FuseControlsControl_Background_Property_typeof());
obj1->ctor_3(obj, name);
return obj1;
}
// }
} // ::g
| [
"sommelier0052@gmail.com"
] | sommelier0052@gmail.com |
c8839a2c8d72426d766dceee6e57bf436ba87acd | 9da6ffc55ba8a19192bd0efad09657758de4e792 | /1152.D. Neko and Aki's Prank.cpp | 1544eb7b0e929b30c15e95e14ea72be3e95831ea | [] | no_license | fsq/codeforces | b771cb33c67fb34168c8ee0533a67f16673f9057 | 58f3b66439457a7368bb40af38ceaf89b9275b36 | refs/heads/master | 2021-05-11T03:12:27.130277 | 2020-10-16T16:55:03 | 2020-10-16T16:55:03 | 117,908,849 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,010 | cpp | #include "stdc++.h"
int n;
const int M = 1e9 + 7;
int f[2][2003][2003];
int v[2][2003][2003];
int dp(int vis, int i, int s) {
if (s < 0 || s > n-i) return -1;
if (v[vis][i][s]) return f[vis][i][s];
v[vis][i][s] = true;
int& ans = f[vis][i][s];
if (i == n) {
ans = 0;
} else {
if (vis) {
int fl = dp(0, i+1, s+1), fr = dp(0, i+1, s-1);
if (fl==-1 && fr==-1)
ans = -1;
else if (fl==-1 || fr==-1)
ans = max(fl, fr);
else
ans = (fl + fr) % M;
} else {
FOR(x, 2) FOR(y, 2)
if (!(x && y)) {
int fl = dp(x, i+1, s+1), fr = dp(y, i+1, s-1), now = 0;
if (fl==-1 && fr==-1)
now = -1;
else if (fl==-1 || fr==-1)
now = max(fl, fr);
else
now = (fl + fr) % M;
ans = max(ans, now);
}
}
}
if (ans != -1) ans += vis;
return ans;
}
int main() {
cin >> n;
n <<= 1;
MEMSET0(v);
auto ans = dp(0, 0, 0);
cout << ans << endl;
return 0;
} | [
"19474@qq.com"
] | 19474@qq.com |
7bca95f543354b8374d6395548551d7e9a9e2cd5 | 6828a93fe5c060e37a9c26d65ea3bf54837e4005 | /public/public_pushbuton_number.h | 7ad781dc8e27a1267f7b4a816eea8ab470089cfd | [] | no_license | blockspacer/fastfd20200204 | 76d87687ef7aeff174f53e03ad52734df3d5dfff | 63d758b0962f3d2ebe9ecb10e0b26c79469eace4 | refs/heads/master | 2022-04-07T07:19:59.865293 | 2020-02-04T02:34:21 | 2020-02-04T02:34:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 603 | h | #ifndef PUBLIC_PUSHBUTON_NUMBER_H
#define PUBLIC_PUSHBUTON_NUMBER_H
#include <QPushButton>
class public_pushbuton_number : public QPushButton
{
Q_OBJECT
public:
public_pushbuton_number(QWidget *parent);
void setNumber(double num);
double number();
void setNumber(const QString &desc);
QString numberStr();
void setText(const QString &text);
QString text() const;
void setSuffix(const QString &suffix);
protected:
void paintEvent(QPaintEvent *e);
private:
QString _numberStr;
QString _text;
QString _suffix;
};
#endif // PUBLIC_PUSHBUTON_NUMBER_H
| [
"ch593030323@gmail.com"
] | ch593030323@gmail.com |
dcb9b6e268e5213956e8580e69fdf68d5339099d | 7f439919fb8c3a8bbd0111f91217f3fd8668d262 | /Projects/AILib/Genetics/Genetics_3_0/TestGenetics/Source/CommandLineOptions.h | f4c95449e8b2284f6746a482d974d274916b72d6 | [] | no_license | quant-guy/Projects | 459aa1e17e72057b1eef58c1926206686b32a78f | f50361dbfa9ee6e4d40cf99abf63edc6fc7e5308 | refs/heads/master | 2023-07-19T19:20:05.850481 | 2023-07-07T23:32:08 | 2023-07-07T23:32:08 | 48,806,322 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,140 | h | ///////////////////////////////////////////////////////////////////////////////////
// COPYRIGHT 2015 Kovach Technologies, Inc.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. All advertising materials mentioning features or use of this software
// must display the following acknowledgement:
// This product includes software developed by the Kovach Technologies, LLC.
// 4. Neither the name of the Kovach Technologies, LLC nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY Kovach Technologies, LLC AS IS AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL Kovach Technologies, LLC BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// AUTHOR : Daniel Kovach
// DATE : 2015-12-30 10:19:06.739857
///////////////////////////////////////////////////////////////////////////////////
#include <CommandLineParser.hpp>
using namespace Utility::CommandLineParser;
using namespace std;
struct CommandLineOptions
{
// instantiate parser
CmdLine cmd;
// testing modes
SwitchArg GP_Constructor1;
SwitchArg GP_Constructor2;
SwitchArg GP_GetFirst;
SwitchArg GP_GetSecond;
SwitchArg GP_SetFirst;
SwitchArg GP_SetSecond;
SwitchArg GP_Swap;
SwitchArg GG_Constructor1;
SwitchArg GG_Constructor2;
SwitchArg GG_Constructor3;
SwitchArg GG_PutGenetic;
SwitchArg GG_Mutate1;
SwitchArg GG_Mutate2;
SwitchArg GG_Ostream;
SwitchArg GG_OutputMutate;
SwitchArg GPA_Constructor1;
SwitchArg GPA_Constructor2;
SwitchArg GPA_Constructor3;
SwitchArg GPA_Constructor4;
SwitchArg GPA_Constructor5;
SwitchArg GPA_Assignment;
SwitchArg GPA_Perturb;
SwitchArg GPA_Copy;
SwitchArg GPA_Plus;
SwitchArg Verbose;
ValueArg<string> GeneticFilename;
CommandLineOptions( void ) :
cmd ( "TradingEngine", ' ', "0.1" ),
GP_Constructor1 ( "", "GP_Constructor1", "Test GP_Constructor1", cmd, false ),
GP_Constructor2 ( "", "GP_Constructor2", "Test GP_Constructor2", cmd, false ),
GP_GetFirst ( "", "GP_GetFirst", "Test GP_GetFirst", cmd, false ),
GP_GetSecond ( "", "GP_GetSecond", "Test GP_GetSecond", cmd, false ),
GP_SetFirst ( "", "GP_SetFirst", "Test GP_SetFirst", cmd, false ),
GP_SetSecond ( "", "GP_SetSecond", "Test GP_SetSecond", cmd, false ),
GP_Swap ( "", "GP_Swap", "Test GP_Swap", cmd, false ),
GG_Constructor1 ( "", "GG_Constructor1", "Test GG_Constructor1", cmd, false ),
GG_Constructor2 ( "", "GG_Constructor2", "Test GG_Constructor2", cmd, false ),
GG_Constructor3 ( "", "GG_Constructor3", "Test GG_Constructor3", cmd, false ),
GG_PutGenetic ( "", "GG_PutGenetic", "Test GG_PutGenetic", cmd, false ),
GG_Mutate1 ( "", "GG_Mutate1", "Test GG_Mutate1", cmd, false ),
GG_Mutate2 ( "", "GG_Mutate2", "Test GG_Mutate2", cmd, false ),
GG_Ostream ( "", "GG_Ostream", "Test GG_Ostream", cmd, false ),
GG_OutputMutate ( "", "GG_OutputMutate", "Test GG_OutputMutate", cmd, false ),
GPA_Constructor1 ( "", "GPA_Constructor1","Test GPA_Constructor1",cmd, false ),
GPA_Constructor2 ( "", "GPA_Constructor2","Test GPA_Constructor2",cmd, false ),
GPA_Constructor3 ( "", "GPA_Constructor3","Test GPA_Constructor3",cmd, false ),
GPA_Constructor4 ( "", "GPA_Constructor4","Test GPA_Constructor4",cmd, false ),
GPA_Constructor5 ( "", "GPA_Constructor5","Test GPA_Constructor5",cmd, false ),
GPA_Assignment ( "", "GPA_Assignment", "Test GPA_Assignment", cmd, false ),
GPA_Perturb ( "", "GPA_Perturb", "Test GPA_Perturb", cmd, false ),
GPA_Copy ( "", "GPA_Copy", "Test GPA_Copy", cmd, false ),
GPA_Plus ( "", "GPA_Plus", "Test GPA_Plus", cmd, false ),
Verbose ( "", "Verbose", "Toggle verbosity", cmd, false ),
GeneticFilename ( "", "GeneticFilename", "Genetic input filename", false, "string", "string", cmd ) {}
};
CommandLineOptions options;
| [
"0xd3ad@0xd3ad.com"
] | 0xd3ad@0xd3ad.com |
1871f38b043af34c9fef670121afc7b24a5e0c57 | 364c1dd1855c4fa0a969ff1d0c9974be9c2f5271 | /CoopGame/Source/CoopGame/Private/SPlayerState.cpp | 91b31373a50d47f3d8dddb0d36b4cd8c0ed68615 | [
"MIT"
] | permissive | DavidConsidine/CoopGame | 070099ee3bf27f6f349d720f598e30db2165507f | 429f701e208263f1e531bd8057a7ff437766ce6d | refs/heads/master | 2021-03-30T17:35:48.223313 | 2018-05-15T13:21:37 | 2018-05-15T13:21:37 | 117,843,191 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 182 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "SPlayerState.h"
void ASPlayerState::AddScore(float DeltaScore)
{
Score += DeltaScore;
}
| [
"dmconsie@gmail.com"
] | dmconsie@gmail.com |
12a55499c0d2a4d3f2d6ffda5c00713fa69fc8fd | 1dd0195040028e2e8496d4b68bb60ef838dc5c76 | /proxy/epoll_queue/timer_fd.cpp | 1d66daf5ea8479e051ccc29f3c8bab5c766baf66 | [] | no_license | CawaEast/proxi | dc0ea1e79b59abf63a749093aa147622c1161cc2 | ef967652a72c24741ae4ed90aa10b7be9a5e30eb | refs/heads/master | 2021-07-13T09:18:49.530096 | 2017-10-14T14:45:11 | 2017-10-14T14:45:11 | 106,099,935 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,320 | cpp | #include "timer_fd.h"
#include "../util/annotated_exception.h"
#include <sys/timerfd.h>
timer_fd::timer_fd() : file_descriptor() {
}
timer_fd::timer_fd(clock_mode cmode, fd_mode mode) : timer_fd(cmode, {mode}) {
}
timer_fd::timer_fd(clock_mode cmode, std::initializer_list<fd_mode> mode) {
int clock_mode = (cmode == MONOTONIC) ? CLOCK_MONOTONIC : CLOCK_REALTIME;
if ((fd = timerfd_create(clock_mode, value_of(mode))) == -1) {
int err = errno;
throw annotated_exception("timerfd", err);
}
}
void timer_fd::set_interval(long interval_sec, long start_after_sec) const {
itimerspec spec;
memset(&spec, 0, sizeof spec);
spec.it_value.tv_sec = start_after_sec;
spec.it_interval.tv_sec = interval_sec;
if (timerfd_settime(fd, 0, &spec, 0) == -1) {
int err = errno;
throw annotated_exception("timerfd", err);
}
}
int timer_fd::value_of(std::initializer_list<fd_mode> mode) {
int res = 0;
for (auto it = mode.begin(); it != mode.end(); it++) {
switch (*it) {
case NONBLOCK:
res |= TFD_NONBLOCK;
break;
case CLOEXEC:
res |= TFD_CLOEXEC;
break;
case SIMPLE:
res |= 0;
break;
}
}
return res;
} | [
"777.777.1234@mail.ru"
] | 777.777.1234@mail.ru |
515b3c7db27019b147ea5165ceb2ac7ec8167beb | 39a1d46fdf2acb22759774a027a09aa9d10103ba | /ngraph/test/util/engine/interpreter_engine.cpp | 876bd63d146d02b7bc32193d1ae5047acdf88318 | [
"Apache-2.0"
] | permissive | mashoujiang/openvino | 32c9c325ffe44f93a15e87305affd6099d40f3bc | bc3642538190a622265560be6d88096a18d8a842 | refs/heads/master | 2023-07-28T19:39:36.803623 | 2021-07-16T15:55:05 | 2021-07-16T15:55:05 | 355,786,209 | 1 | 3 | Apache-2.0 | 2021-06-30T01:32:47 | 2021-04-08T06:22:16 | C++ | UTF-8 | C++ | false | false | 10,127 | cpp | // Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <cmath>
#include <iomanip>
#include <sstream>
#include "interpreter_engine.hpp"
#include "shared_utils.hpp"
using namespace ngraph;
namespace
{
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value, testing::AssertionResult>::type
compare_values(const std::shared_ptr<ngraph::op::Constant>& expected_results,
const std::shared_ptr<ngraph::runtime::Tensor>& results,
const size_t tolerance_bits)
{
const auto expected = expected_results->get_vector<T>();
const auto result = read_vector<T>(results);
return ngraph::test::all_close_f(expected, result, tolerance_bits);
}
testing::AssertionResult
compare_with_fp_tolerance(const std::shared_ptr<ngraph::op::Constant>& expected_results,
const std::shared_ptr<ngraph::runtime::Tensor>& results,
const float tolerance)
{
auto comparison_result = testing::AssertionSuccess();
const auto expected = expected_results->get_vector<float>();
const auto result = read_vector<float>(results);
return ngraph::test::compare_with_tolerance(expected, result, tolerance);
}
template <typename T>
typename std::enable_if<std::is_integral<T>::value, testing::AssertionResult>::type
compare_values(const std::shared_ptr<ngraph::op::Constant>& expected_results,
const std::shared_ptr<ngraph::runtime::Tensor>& results,
const size_t)
{
const auto expected = expected_results->get_vector<T>();
const auto result = read_vector<T>(results);
return ngraph::test::all_close(expected, result);
}
// used for float16 and bfloat 16 comparisons
template <typename T>
typename std::enable_if<std::is_class<T>::value, testing::AssertionResult>::type
compare_values(const std::shared_ptr<ngraph::op::Constant>& expected_results,
const std::shared_ptr<ngraph::runtime::Tensor>& results,
const size_t tolerance_bits)
{
const auto expected = expected_results->get_vector<T>();
const auto result = read_vector<T>(results);
// TODO: add testing infrastructure for float16 and bfloat16 to avoid cast to double
std::vector<double> expected_double(expected.size());
std::vector<double> result_double(result.size());
NGRAPH_CHECK(expected.size() == result.size(),
"Number of expected and computed results don't match");
for (size_t i = 0; i < expected.size(); ++i)
{
expected_double[i] = static_cast<double>(expected[i]);
result_double[i] = static_cast<double>(result[i]);
}
return ngraph::test::all_close_f(expected_double, result_double, tolerance_bits);
}
}; // namespace
test::INTERPRETER_Engine::INTERPRETER_Engine(const std::shared_ptr<Function> function)
: m_function{function}
{
m_backend = ngraph::runtime::Backend::create(NG_BACKEND_NAME, false); // static INT backend
m_executable = m_backend->compile(m_function);
for (size_t i = 0; i < m_function->get_output_size(); ++i)
{
m_result_tensors.push_back(m_backend->create_tensor(m_function->get_output_element_type(i),
m_function->get_output_shape(i)));
}
}
test::INTERPRETER_Engine::INTERPRETER_Engine(const std::shared_ptr<Function> function,
INTERPRETER_Engine::DynamicBackendTag)
: m_function{function}
{
m_backend = ngraph::runtime::Backend::create(NG_BACKEND_NAME, true); // dynamic INT backend
m_executable = m_backend->compile(m_function);
for (size_t i = 0; i < m_function->get_output_size(); ++i)
{
m_result_tensors.push_back(m_backend->create_dynamic_tensor(
m_function->get_output_element_type(i), m_function->get_output_partial_shape(i)));
}
}
test::INTERPRETER_Engine test::INTERPRETER_Engine::dynamic(const std::shared_ptr<Function> function)
{
return INTERPRETER_Engine{function, DynamicBackendTag{}};
}
void test::INTERPRETER_Engine::infer()
{
const auto& function_results = m_function->get_results();
NGRAPH_CHECK(m_expected_outputs.size() == function_results.size(),
"Expected number of outputs is different from the function's number "
"of results.");
m_executable->call_with_validate(m_result_tensors, m_input_tensors);
}
testing::AssertionResult
test::INTERPRETER_Engine::compare_results_with_tolerance_as_fp(const float tolerance)
{
auto comparison_result = testing::AssertionSuccess();
for (size_t i = 0; i < m_expected_outputs.size(); ++i)
{
const auto& result_tensor = m_result_tensors.at(i);
const auto& expected_result_constant = m_expected_outputs.at(i);
const auto& element_type = result_tensor->get_element_type();
const auto& expected_shape = expected_result_constant->get_shape();
const auto& result_shape = result_tensor->get_shape();
if (expected_shape != result_shape)
{
comparison_result = testing::AssertionFailure();
comparison_result << "Computed data shape(" << result_shape
<< ") does not match the expected shape(" << expected_shape
<< ") for output " << i << std::endl;
break;
}
switch (element_type)
{
case element::Type_t::f32:
comparison_result =
compare_with_fp_tolerance(expected_result_constant, result_tensor, tolerance);
break;
default:
comparison_result = testing::AssertionFailure()
<< "Unsupported data type encountered in "
"'compare_results_with_tolerance_as_fp' method";
}
if (comparison_result == testing::AssertionFailure())
{
break;
}
}
return comparison_result;
}
testing::AssertionResult test::INTERPRETER_Engine::compare_results(const size_t tolerance_bits)
{
auto comparison_result = testing::AssertionSuccess();
for (size_t i = 0; i < m_expected_outputs.size(); ++i)
{
const auto& result_tensor = m_result_tensors.at(i);
const auto& expected_result_constant = m_expected_outputs.at(i);
const auto& element_type = result_tensor->get_element_type();
const auto& expected_shape = expected_result_constant->get_shape();
const auto& result_shape = result_tensor->get_shape();
if (expected_shape != result_shape)
{
comparison_result = testing::AssertionFailure();
comparison_result << "Computed data shape(" << result_shape
<< ") does not match the expected shape(" << expected_shape
<< ") for output " << i << std::endl;
break;
}
switch (element_type)
{
case element::Type_t::f16:
comparison_result = compare_values<ngraph::float16>(
expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::bf16:
comparison_result = compare_values<ngraph::bfloat16>(
expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::f32:
comparison_result =
compare_values<float>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::f64:
comparison_result =
compare_values<double>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::i8:
comparison_result =
compare_values<int8_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::i16:
comparison_result =
compare_values<int16_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::i32:
comparison_result =
compare_values<int32_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::i64:
comparison_result =
compare_values<int64_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::u8:
comparison_result =
compare_values<uint8_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::u16:
comparison_result =
compare_values<uint16_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::u32:
comparison_result =
compare_values<uint32_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::u64:
comparison_result =
compare_values<uint64_t>(expected_result_constant, result_tensor, tolerance_bits);
break;
case element::Type_t::boolean:
comparison_result =
compare_values<char>(expected_result_constant, result_tensor, tolerance_bits);
break;
default:
comparison_result = testing::AssertionFailure()
<< "Unsupported data type encountered in 'compare_results' method";
}
if (comparison_result == testing::AssertionFailure())
{
break;
}
}
return comparison_result;
}
void test::INTERPRETER_Engine::reset()
{
m_input_index = 0;
m_output_index = 0;
m_expected_outputs.clear();
m_input_tensors.clear();
}
| [
"noreply@github.com"
] | mashoujiang.noreply@github.com |
f0e5449999620639d45bced63fa20631fb49ca08 | 1bf8b46afad5402fe6fa74293b464e1ca5ee5fd7 | /SDK/BP_Hakkason_leadShe_functions.cpp | 468fd7991d5286b0564fed8be90525b71855ccf6 | [] | no_license | LemonHaze420/ShenmueIIISDK | a4857eebefc7e66dba9f667efa43301c5efcdb62 | 47a433b5e94f171bbf5256e3ff4471dcec2c7d7e | refs/heads/master | 2021-06-30T17:33:06.034662 | 2021-01-19T20:33:33 | 2021-01-19T20:33:33 | 214,824,713 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,044 | cpp |
#include "../SDK.h"
// Name: Shenmue3, Version: 1.0.2
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.CheckLoadSartShe
// (Net, NetMulticast, MulticastDelegate, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintPure)
// Parameters:
// bool is_load (Parm, OutParm, ZeroConstructor, IsPlainOldData)
// struct FVector SheLocation (Parm, OutParm, IsPlainOldData)
// struct FRotator SheRotation (Parm, OutParm, IsPlainOldData)
void ABP_Hakkason_leadShe_C::CheckLoadSartShe(bool* is_load, struct FVector* SheLocation, struct FRotator* SheRotation)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.CheckLoadSartShe");
ABP_Hakkason_leadShe_C_CheckLoadSartShe_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
if (is_load != nullptr)
*is_load = params.is_load;
if (SheLocation != nullptr)
*SheLocation = params.SheLocation;
if (SheRotation != nullptr)
*SheRotation = params.SheRotation;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.InitSet
// (Net, NetRequest, Exec, Static, Private, Protected, Delegate, NetClient, DLLImport)
// Parameters:
// struct FDataTableRowHandle EventId (BlueprintVisible, BlueprintReadOnly, Parm)
// int UseFlagID (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
// bool LoadStart (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
void ABP_Hakkason_leadShe_C::STATIC_InitSet(const struct FDataTableRowHandle& EventId, int UseFlagID, bool LoadStart)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.InitSet");
ABP_Hakkason_leadShe_C_InitSet_Params params;
params.EventId = EventId;
params.UseFlagID = UseFlagID;
params.LoadStart = LoadStart;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.UserConstructionScript
// (Net, Exec, Native, NetResponse, NetMulticast, Public, Protected, Delegate, NetClient, BlueprintCallable)
void ABP_Hakkason_leadShe_C::UserConstructionScript()
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.UserConstructionScript");
ABP_Hakkason_leadShe_C_UserConstructionScript_Params params;
auto flags = fn->FunctionFlags;
fn->FunctionFlags |= 0x400;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ReceiveTick
// (NetRequest, Exec, Event, NetResponse, Static, NetMulticast, Public, Private, Delegate, NetServer, HasOutParms, HasDefaults, DLLImport, BlueprintCallable, BlueprintEvent)
// Parameters:
// float DeltaSeconds (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
void ABP_Hakkason_leadShe_C::STATIC_ReceiveTick(float DeltaSeconds)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ReceiveTick");
ABP_Hakkason_leadShe_C_ReceiveTick_Params params;
params.DeltaSeconds = DeltaSeconds;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.RenewalActorCount
// (NetReliable, NetRequest, Exec, Native, Public, Private, HasOutParms, NetClient, DLLImport)
// Parameters:
// TEnumAsByte<EN_MainFlowActorID> ActorId (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
// unsigned char RenewalCounter (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
void ABP_Hakkason_leadShe_C::RenewalActorCount(TEnumAsByte<EN_MainFlowActorID> ActorId, unsigned char RenewalCounter)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.RenewalActorCount");
ABP_Hakkason_leadShe_C_RenewalActorCount_Params params;
params.ActorId = ActorId;
params.RenewalCounter = RenewalCounter;
auto flags = fn->FunctionFlags;
fn->FunctionFlags |= 0x400;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.KillSheLead
// (Net, NetRequest, Static, NetMulticast, MulticastDelegate, Public, Private, Protected, Delegate, HasOutParms, HasDefaults, DLLImport, BlueprintEvent, BlueprintPure)
void ABP_Hakkason_leadShe_C::STATIC_KillSheLead()
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.KillSheLead");
ABP_Hakkason_leadShe_C_KillSheLead_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.StartLeadSHE_Macro
// (Net, NetReliable, Exec, Event, NetResponse, Static, NetMulticast, Public, Private, Delegate, NetServer, HasOutParms, HasDefaults, DLLImport, BlueprintCallable, BlueprintEvent)
// Parameters:
// bool LoadStart (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
void ABP_Hakkason_leadShe_C::STATIC_StartLeadSHE_Macro(bool LoadStart)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.StartLeadSHE_Macro");
ABP_Hakkason_leadShe_C_StartLeadSHE_Macro_Params params;
params.LoadStart = LoadStart;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ExecuteUbergraph_BP_Hakkason_leadShe
// (NetReliable, NetRequest, Native, NetResponse, Static, Private, Protected, NetServer, HasOutParms, HasDefaults, NetClient, DLLImport, BlueprintEvent, BlueprintPure, Const)
// Parameters:
// int EntryPoint (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
void ABP_Hakkason_leadShe_C::STATIC_ExecuteUbergraph_BP_Hakkason_leadShe(int EntryPoint)
{
static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ExecuteUbergraph_BP_Hakkason_leadShe");
ABP_Hakkason_leadShe_C_ExecuteUbergraph_BP_Hakkason_leadShe_Params params;
params.EntryPoint = EntryPoint;
auto flags = fn->FunctionFlags;
fn->FunctionFlags |= 0x400;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"35783139+LemonHaze420@users.noreply.github.com"
] | 35783139+LemonHaze420@users.noreply.github.com |
ca72775b59aef895283808d82c4b1905e0a8ee66 | 165b2de352f01137bf108f6ca37b3753b10348f8 | /release/moc_renderwindow.cpp | 3292251436a6355f2e4f0e13d5ea395fc49b86ff | [] | no_license | ASnow/renderer | 9badeb379900b9b2e4d6d0c212b9e66fa43925a4 | 221c19e98de2673a964a091f6cec337a09d7d391 | refs/heads/master | 2016-09-03T00:36:31.756799 | 2011-01-19T16:07:30 | 2011-01-19T16:07:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,838 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'renderwindow.h'
**
** Created: Wed 19. Jan 15:44:30 2011
** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../Raytracer/renderwindow.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'renderwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.7.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_RenderWindow[] = {
// content:
5, // revision
0, // classname
0, 0, // classinfo
5, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: signature, parameters, type, tag, flags
14, 13, 13, 13, 0x0a,
21, 13, 13, 13, 0x0a,
30, 13, 13, 13, 0x0a,
46, 38, 13, 13, 0x0a,
81, 75, 13, 13, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_RenderWindow[] = {
"RenderWindow\0\0exit()\0render()\0about()\0"
"partial\0displayPartialImage(QImage*)\0"
"final\0renderingFinished(QImage*)\0"
};
const QMetaObject RenderWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_RenderWindow,
qt_meta_data_RenderWindow, 0 }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &RenderWindow::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *RenderWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *RenderWindow::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_RenderWindow))
return static_cast<void*>(const_cast< RenderWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int RenderWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: exit(); break;
case 1: render(); break;
case 2: about(); break;
case 3: displayPartialImage((*reinterpret_cast< QImage*(*)>(_a[1]))); break;
case 4: renderingFinished((*reinterpret_cast< QImage*(*)>(_a[1]))); break;
default: ;
}
_id -= 5;
}
return _id;
}
QT_END_MOC_NAMESPACE
| [
"asnow.dev@gmail.com"
] | asnow.dev@gmail.com |
492b642e0e45b1b5dc35a10f4dbcba857d5b0cd4 | bd3630cebd53befb1c5ba3f4281eff3f4503b991 | /VS 2019/Arduino/simple/simple.ino | 2a2a9dad2cf155bc4c665ef3b4ea4925260d29f8 | [] | no_license | YeungShaoFeng/FIlesBackUps | e4dd3d9082049c1caa913a3c11c9e94955d4720c | 9d1b10fdfe3a6acc0a1aad082127f431e718dd9b | refs/heads/master | 2020-09-07T12:34:24.159158 | 2019-11-22T01:37:59 | 2019-11-22T01:37:59 | 220,781,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 207 | ino |
int value = 0;
void setup() {
Serial.begin(115200);
pinMode(PB0, INPUT_ANALOG);
pinMode(PB1, OUTPUT);
}
void loop() {
value = analogRead(PB0);
Serial.println(value);
delay(300);
} | [
"2013114698@qq.com"
] | 2013114698@qq.com |
77f0e7a872511fb3552d5832f5db7befc1721969 | 95fc9763929e66297a6a700aaa2fd59e93ec4c37 | /2/MP2/MP2/Salesman.cpp | 1d03a57d99c6365ac5f99512923b058fab58983e | [] | no_license | endlesslydivided/MathP_2_2 | 1658c1a83763ef1a1da2f957234716fde452e164 | dc631565607359656b4a5fc262391b88d7ab0571 | refs/heads/main | 2023-03-30T07:01:40.562409 | 2021-04-05T07:25:08 | 2021-04-05T07:25:08 | 354,753,187 | 1 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,713 | cpp | #include "Salesman.h"
int sum(int x1, int x2) // суммирование с учетом бесконечности
{
return (x1 == INF || x2 == INF) ? INF : (x1 + x2);
};
int* firstpath(int n) // формирование 1го маршрута 0,1,2,..., n-1, 0
{
int* rc = new int[n + 1]; rc[n] = 0;
for (int i = 0; i < n; i++) rc[i] = i;
return rc;
};
int* source(int n) // формирование исходного массива 1,2,..., n-1
{
int* rc = new int[n - 1];
for (int i = 1; i < n; i++) rc[i - 1] = i;
return rc;
};
void copypath(int n, int* r1, const int* r2) // копировать маршрут
{
for (int i = 0; i < n; i++) r1[i] = r2[i];
};
int distance(int n, int* r, const int* d) // длина маршрута
{
int rc = 0;
for (int i = 0; i < n - 1; i++) rc = sum(rc, d[r[i] * n + r[i + 1]]);
return sum(rc, d[r[n - 1] * n + 0]); //+ последняя дуга (n-1,0)
};
void indx(int n, int* r, const int* s, const short* ntx) {
for (int i = 1; i < n; i++) r[i] = s[ntx[i - 1]];
}
int salesman(
int n, // [in] количество городов
const int* d, // [in] массив [n*n] расстояний
int* r // [out] массив [n] маршрут 0 x x x x
) {
int* s = source(n), * b = firstpath(n), rc = INF, dist = 0;
combi3::permutation p(n - 1);
int k = p.getfirst();
while (k >= 0) // цикл генерации перестановок
{
indx(n, b, s, p.sset); // новый маршрут
if ((dist = distance(n, b, d)) < rc) { rc = dist; copypath(n, r, b); }
k = p.getnext();
};
return rc;
}
| [
"sashakovalev2002@hotmail.com"
] | sashakovalev2002@hotmail.com |
e4680c51e08dfc59af4c1c41967cf3de0175748f | dc2e0d49f99951bc40e323fb92ea4ddd5d9644a0 | /SDK/ThirdLibrary/include/activemq-cpp/decaf/lang/Byte.h | 1b775df4d85fd4baf460c2d706699e116f9d6f79 | [] | no_license | wenyu826/CecilySolution | 8696290d1723fdfe6e41ce63e07c7c25a9295ded | 14c4ba9adbb937d0ae236040b2752e2c7337b048 | refs/heads/master | 2020-07-03T06:26:07.875201 | 2016-11-19T07:04:29 | 2016-11-19T07:04:29 | 74,192,785 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 12,122 | h | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _DECAF_LANG_BYTE_H_
#define _DECAF_LANG_BYTE_H_
#include <decaf/util/Config.h>
#include <decaf/lang/Number.h>
#include <decaf/lang/Comparable.h>
#include <decaf/lang/exceptions/NumberFormatException.h>
#include <string>
namespace decaf{
namespace lang{
class DECAF_API Byte : public Number,
public Comparable<Byte>,
public Comparable<unsigned char> {
private:
unsigned char value;
public:
/** The minimum value that a unsigned char can take on. */
static const unsigned char MIN_VALUE;
/** The maximum value that a unsigned char can take on. */
static const unsigned char MAX_VALUE;
/** The size of the primitive character in bits. */
static const int SIZE;
public:
/**
* @param value - the primitive value to wrap
*/
Byte(unsigned char value);
/**
* Creates a new Byte instance from the given string.
*
* @param value
* The string to convert to an unsigned char
*
* @throws NumberFormatException if the string is not a valid byte.
*/
Byte(const std::string& value);
virtual ~Byte() {}
/**
* Compares this Byte instance with another.
* @param c - the Byte instance to be compared
* @return zero if this object represents the same char value as the
* argument; a positive value if this object represents a value greater
* than the passed in value, and -1 if this object repesents a value
* less than the passed in value.
*/
virtual int compareTo(const Byte& c) const {
return this->value < c.value ? -1 : (this->value > c.value) ? 1 : 0;
}
/**
* Compares equality between this object and the one passed.
* @param c - the value to be compared to this one.
* @return true if this object is equal to the one passed.
*/
virtual bool operator==(const Byte& c) const {
return this->value == c.value;
}
/**
* Compares this object to another and returns true if this object
* is considered to be less than the one passed. This
* @param c - the value to be compared to this one.
* @return true if this object is equal to the one passed.
*/
virtual bool operator<(const Byte& c) const {
return this->value < c.value;
}
/**
* Compares this Byte instance with a char type.
* @param c - the char instance to be compared
* @return zero if this object represents the same char value as the
* argument; a positive value if this object represents a value greater
* than the passed in value, and -1 if this object repesents a value
* less than the passed in value.
*/
virtual int compareTo(const unsigned char& c) const {
return this->value < c ? -1 : (this->value > c) ? 1 : 0;
}
/**
* Compares equality between this object and the one passed.
* @param c - the value to be compared to this one.
* @return true if this object is equal to the one passed.
*/
virtual bool operator==(const unsigned char& c) const {
return this->value == c;
}
/**
* Compares this object to another and returns true if this object
* is considered to be less than the one passed. This
* @param c - the value to be compared to this one.
* @return true if this object is equal to the one passed.
*/
virtual bool operator<(const unsigned char& c) const {
return this->value < c;
}
/**
* @returns true if the two Byte Objects have the same value.
*/
bool equals(const Byte& c) const {
return this->value == c.value;
}
/**
* @returns true if the two Bytes have the same value.
*/
bool equals(const unsigned char& c) const {
return this->value == c;
}
/**
* @returns this Byte Object as a String Representation
*/
std::string toString() const;
/**
* Answers the double value which the receiver represents
* @return double the value of the receiver.
*/
virtual double doubleValue() const {
return (double) this->value;
}
/**
* Answers the float value which the receiver represents
* @return float the value of the receiver.
*/
virtual float floatValue() const {
return (float) this->value;
}
/**
* Answers the byte value which the receiver represents
* @return byte the value of the receiver.
*/
virtual unsigned char byteValue() const {
return this->value;
}
/**
* Answers the short value which the receiver represents
* @return short the value of the receiver.
*/
virtual short shortValue() const {
return (short) this->value;
}
/**
* Answers the int value which the receiver represents
* @return int the value of the receiver.
*/
virtual int intValue() const {
return (int) this->value;
}
/**
* Answers the long value which the receiver represents
* @return long long the value of the receiver.
*/
virtual long long longValue() const {
return (long long) this->value;
}
public: // statics
/**
* @returns a string representing the primitive value as Base 10
*/
static std::string toString(unsigned char value);
/**
* Decodes a String into a Byte. Accepts decimal, hexadecimal, and octal
* numbers given by the following grammar:
*
* The sequence of characters following an (optional) negative sign and/or
* radix specifier ("0x", "0X", "#", or leading zero) is parsed as by the
* Byte::parseByte method with the indicated radix (10, 16, or 8). This
* sequence of characters must represent a positive value or a
* NumberFormatException will be thrown. The result is negated if first
* character of the specified String is the minus sign. No whitespace
* characters are permitted in the string.
* @param value - The string to decode
* @returns a Byte object containing the decoded value
* @throws NumberFomatException if the string is not formatted correctly.
*/
static Byte decode(const std::string& value);
/**
* Parses the string argument as a signed unsigned char in the radix specified by
* the second argument. The characters in the string must all be digits,
* of the specified radix (as determined by whether
* Character.digit(char, int) returns a nonnegative value) except that the
* first character may be an ASCII minus sign '-' to indicate
* a negative value. The resulting byte value is returned.
*
* An exception of type NumberFormatException is thrown if any of the
* following situations occurs:
* * The first argument is null or is a string of length zero.
* * The radix is either smaller than Character.MIN_RADIX or larger than
* Character::MAX_RADIX.
* * Any character of the string is not a digit of the specified radix,
* except that the first character may be a minus sign '-' provided
* that the string is longer than length 1.
* * The value represented by the string is not a value of type unsigned char.
*
* @param s - the String containing the unsigned char to be parsed
* @param radix - the radix to be used while parsing s
* @return the unsigned char represented by the string argument in the
* specified radix.
* @throws NumberFormatException - If String does not contain a parsable
* unsigned char.
*/
static unsigned char parseByte(const std::string& s, int radix);
/**
* Parses the string argument as a signed decimal unsigned char. The
* characters in the string must all be decimal digits, except that the
* first character may be an ASCII minus sign '-' to indicate a
* negative value. The resulting unsigned char value is returned, exactly as
* if the argument and the radix 10 were given as arguments to the
* parseByte( const std::string, int ) method.
* @param s - String to convert to a unsigned char
* @returns the converted unsigned char value
* @throws NumberFormatException if the string is not a unsigned char.
*/
static unsigned char parseByte(const std::string& s);
/**
* Returns a Character instance representing the specified char value.
* @param value - the primitive char to wrap.
* @returns a new Character instance that wraps this value.
*/
static Byte valueOf(unsigned char value) {
return Byte(value);
}
/**
* Returns a Byte object holding the value given by the specified std::string.
* The argument is interpreted as representing a signed decimal unsigned char,
* exactly as if the argument were given to the parseByte( std::string )
* method. The result is a Byte object that represents the unsigned char value
* specified by the string.
* @param value - std::string to parse as base 10
* @return new Byte Object wrapping the primitive
* @throws NumberFormatException if the string is not a decimal unsigned char.
*/
static Byte valueOf(const std::string& value);
/**
* Returns a Byte object holding the value extracted from the specified
* std::string when parsed with the radix given by the second argument.
* The first argument is interpreted as representing a signed unsigned char
* in the radix specified by the second argument, exactly as if the argument
* were given to the parseByte( std::string, int ) method. The result is a
* Byte object that represents the unsigned char value specified by the
* string.
* @param value - std::string to parse as base ( radix )
* @param radix - base of the string to parse.
* @return new Byte Object wrapping the primitive
* @throws NumberFormatException if the string is not a valid unsigned char.
*/
static Byte valueOf(const std::string& value, int radix);
};
}}
#endif /*_DECAF_LANG_BYTE_H_*/
| [
"626955115@qq.com"
] | 626955115@qq.com |
8c60ddb8a98d7d86f8f111993fe4b45f71b0f6b7 | cb3a3c4578ffc9e3e51c5eb2d88c8d488951f42f | /potato/bin_editor/source/scene_doc.h | 41b0d8316ac3561692bf456672cf7ca94197d56f | [
"MIT"
] | permissive | potatoengine/potato | f89bc645a26060f2617756f98009b3215b3ac17b | bbcb42fca25ab18e0b4ea70aad0ccee6fff24dde | refs/heads/main | 2023-01-22T08:33:47.706990 | 2023-01-09T01:58:30 | 2023-01-09T01:58:30 | 158,169,449 | 48 | 3 | MIT | 2023-01-09T01:58:31 | 2018-11-19T05:58:39 | C++ | UTF-8 | C++ | false | false | 3,281 | h | // Copyright by Potato Engine contributors. See accompanying License.txt for copyright details.
#pragma once
#include "scene/edit_component.h"
#include "potato/audio/sound_resource.h"
#include "potato/game/common.h"
#include "potato/render/material.h"
#include "potato/render/mesh.h"
#include "potato/spud/sequence.h"
#include "potato/spud/string.h"
#include "potato/spud/traits.h"
#include "potato/spud/vector.h"
#include <nlohmann/json_fwd.hpp>
namespace up {
class Mesh;
class Material;
class AssetLoader;
struct SceneComponent;
enum class SceneEntityId : uint64 { None = 0 };
struct SceneEntity {
string name;
SceneEntityId sceneId = SceneEntityId::None;
EntityId previewId = EntityId::None;
vector<box<SceneComponent>> components;
int firstChild = -1;
int nextSibling = -1;
int parent = -1;
};
struct SceneComponent {
enum class State { Idle, New, Pending, Removed } state = State::New;
string name;
SceneEntityId parent = SceneEntityId::None;
EditComponent const* info = nullptr;
box<void> data;
};
class SceneDatabase {
public:
box<SceneComponent> createByName(string_view name);
box<SceneComponent> createByType(EditComponent const& component);
deref_span<box<EditComponent> const> components() const noexcept { return _components; }
template <typename T>
void registerComponent() {
_components.push_back(new_box<T>());
}
private:
vector<box<EditComponent>> _components;
};
class SceneDocument {
public:
SceneDocument(string filename, SceneDatabase& database)
: _filename(std::move(filename))
, _database(database) { }
sequence<int> indices() const noexcept { return sequence{static_cast<int>(_entities.size())}; }
SceneEntity& entityAt(int index) noexcept { return _entities[index]; }
int indexOf(SceneEntityId entityId) const noexcept;
SceneEntityId createEntity(string name, SceneEntityId parentId = SceneEntityId::None);
void deleteEntity(SceneEntityId targetId);
void parentTo(SceneEntityId childId, SceneEntityId parentId);
auto addNewComponent(SceneEntityId entityId, EditComponent const& component) -> SceneComponent*;
void createTestObjects(Mesh::Handle const& cube, Material::Handle const& mat, SoundHandle const& ding);
void syncPreview(Space& space);
void syncGame(Space& space) const;
void toJson(nlohmann::json& doc) const;
void fromJson(nlohmann::json const& doc, AssetLoader& assetLoader);
zstring_view filename() const noexcept { return _filename; }
private:
void _deleteEntityAt(int index, vector<SceneEntityId>& out_deleted);
void _toJson(nlohmann::json& el, int index) const;
void _fromJson(nlohmann::json const& el, int index, AssetLoader& assetLoader);
SceneEntityId _allocateEntityId();
SceneEntityId _consumeEntityId(SceneEntityId entityId);
string _filename;
vector<SceneEntity> _entities;
SceneEntityId _nextEntityId = SceneEntityId{1};
SceneDatabase& _database;
};
} // namespace up
| [
"noreply@github.com"
] | potatoengine.noreply@github.com |
9f38e598cccbeb5f9a4fa8900e0bafee22268568 | 9d816d04ea89bdb424008090dec94725c0005a06 | /Src/motor_control_foc.cpp | 6a82321d704682adf3257c4ef0d9c207bdc55cbf | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | McuMirror/STM32F303_BLDCMotorControl | 457fffc18f66a639d05e7feacdf41a94a0588e64 | 34e75019983bae31f50efeb63786a76c43e9aef7 | refs/heads/master | 2020-05-20T16:15:24.679873 | 2019-03-25T11:31:44 | 2019-03-25T11:31:44 | 185,663,106 | 1 | 0 | null | 2019-05-08T18:54:53 | 2019-05-08T18:54:53 | null | UTF-8 | C++ | false | false | 7,030 | cpp | /*
* motor_control_foc.cpp
*
* Created on: 2018/07/19
* Author: Shibasaki
*/
#include "motor_control_foc.hpp"
void BLDCMotor::Update(void)
{
// Calculation of Sine and Cosine Value of the Rotor Position
MyDSP::SinCos(theta_e, &sin_val, &cos_val);
// a-b-c to alpha-beta Conversion
FOCUtil::Clarke_Dynamic(i_a, i_b, i_c, SV_sector, &i_alpha, &i_beta);
// alpha-beta to d-q Conversion
FOCUtil::Park(i_alpha, i_beta, &i_d, &i_q, sin_val, cos_val);
float i_d_hat_prev = i_d_hat;
float i_q_hat_prev = i_q_hat;
// State Observer
// i_d_hat, i_q_hatは1サンプル先の予想値
//// x = (i_d i_q;d_d d_q)
//// u = (v_d v_q)
//// y = (i_d i_q)
//// x_hat[n+1|n] = (A-LC B L) * (x_hat[n|n−1];u[n];y[n])
Eigen::Matrix<float, OBS_NUM_STATE+OBS_NUM_INPUT+OBS_NUM_OUTPUT, OBS_NUM_CHANNEL> obs_in;
obs_in << i_d_hat, i_q_hat, d_d_hat, d_q_hat, v_d, v_q, i_d, i_q;
Eigen::Map<Eigen::Matrix<float, OBS_NUM_STATE, OBS_NUM_CHANNEL, Eigen::RowMajor>> obs_out(obs_out_data);
obs_out.noalias() = obs_mat * obs_in;
constexpr float K_XC = R*T_S*L_Q/L_D*std::exp(-R*T_S/L_D)/(1-std::exp(-R*T_S/L_D));
e_d = d_d_hat + omega_e*K_XC*i_q_hat_prev;
e_q = d_q_hat - omega_e*K_XC*i_d_hat_prev;
// e_d = d_d_hat + omega_e*L_Q*i_q_hat_prev;
// e_q = d_q_hat - omega_e*L_Q*i_d_hat_prev;
e_abs = MyDSP::Hypot(e_d, e_q);
// Damping Control
Eigen::Vector2f hpf_e_dq_out = hpf_e_dq(Eigen::Map<Eigen::Vector2f>(e_dq));
float i_damp_d = K_DAMP * hpf_e_dq_out[0];
float i_damp_q = K_DAMP * hpf_e_dq_out[1];
// Current PI Control with Anti-Windup
switch (status)
{
case FOC_Status::STOP:
pid_i_d.Clear();
pid_i_q.Clear();
v_d = 0;
v_q = 0;
break;
case FOC_Status::IDENTIFICATION:
pid_i_d.Clear();
pid_i_q.Clear();
v_d = v_d_ref;
v_q = v_q_ref;
break;
case FOC_Status::POSITIONING:
pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d);
pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q);
v_d = pid_i_d((i_pos_ref-i_damp_d)-i_d_hat);
v_q = pid_i_q(-i_damp_q-i_q_hat);
v_d += d_d_hat;
v_q += d_q_hat;
break;
case FOC_Status::OPERATION_FEEDFORWARD:
pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d);
pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q);
v_d = pid_i_d((i_d_ref_ff-i_damp_d)-i_d_hat);
v_q = pid_i_q((i_q_ref_ff-i_damp_q)-i_q_hat);
v_d += d_d_hat;
v_q += d_q_hat;
break;
default:
pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d);
pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q);
v_d = pid_i_d(i_d_ref-i_d_hat);
v_q = pid_i_q(i_q_ref-i_q_hat);
v_d += d_d_hat;
v_q += d_q_hat;
break;
}
// Voltage Saturation
v_abs = MyDSP::Hypot(v_d, v_q);
float v_max = v_dc*MyDSP::by_sqrt_three_f;
if (v_abs > v_max)
{
float v_d_tmp = v_d;
float v_q_tmp = v_q;
if (v_d > v_max)
{
v_d = v_max;
v_q = 0;
}
else if (v_d < -v_max)
{
v_d = -v_max;
v_q = 0;
}
else if(v_q > 0)
{
v_q = MyDSP::Sqrt(v_max*v_max - v_d*v_d);
}
else if(v_q < 0)
{
v_q = -MyDSP::Sqrt(v_max*v_max - v_d*v_d);
}
v_wind_d = v_d_tmp - v_d;
v_wind_q = v_q_tmp - v_q;
v_abs = v_max;
}
else
{
v_wind_d = 0;
v_wind_q = 0;
}
// Error of Position Estimation
theta_err = MyDSP::Atan2(-MyDSP::Sign(omega_e)*e_d, MyDSP::Sign(omega_e)*e_q);
// Position Calculation and State Transition
CalculatePosition();
// Calculation of Sine and Cosine Value of the Corrected Rotor Position
float sin_val_v_dq, cos_val_v_dq;
MyDSP::SinCos(theta_e+omega_e*0.5f*T_S*L_Q/L_D, &sin_val_v_dq, &cos_val_v_dq);
// d-q to alpha-beta Conversion
FOCUtil::InvPark(v_d, v_q, &v_alpha, &v_beta, sin_val_v_dq, cos_val_v_dq);
// Duty Cycle Generation
SV_sector = FOCUtil::SVPWM_3phase(v_alpha, v_beta, v_dc, &duty_a, &duty_b, &duty_c);
// Estimation of Next Three-phase Currents
float i_alpha_hat, i_beta_hat;
float i_a_hat, i_b_hat, i_c_hat;
FOCUtil::InvPark(i_d_hat, i_q_hat, &i_alpha_hat, &i_beta_hat, sin_val_v_dq, cos_val_v_dq);
FOCUtil::InvClarke_abc(i_alpha_hat, i_beta_hat, &i_a_hat, &i_b_hat, &i_c_hat);
// Dead Time Compensation
float i_ripple_a, i_ripple_b, i_ripple_c;
FOCUtil::CurrentRippleEstimate(duty_a, duty_b, duty_c, v_dc, F_PWM, (L_D+L_Q)/2, SV_sector, &i_ripple_a, &i_ripple_b, &i_ripple_c);
// float i_dt = v_dc * 2 * C_OSS / T_DEAD;
// duty_a = FOCUtil::DeadTimeCompensate_TTCM(duty_a, i_a+i_ripple_a, i_a-i_ripple_a, i_dt, F_PWM*T_DEAD);
// duty_b = FOCUtil::DeadTimeCompensate_TTCM(duty_b, i_b+i_ripple_b, i_b-i_ripple_b, i_dt, F_PWM*T_DEAD);
// duty_c = FOCUtil::DeadTimeCompensate_TTCM(duty_c, i_c+i_ripple_c, i_c-i_ripple_c, i_dt, F_PWM*T_DEAD);
duty_a = FOCUtil::DeadTimeCompensate_3Level(duty_a, i_a_hat, i_ripple_a, F_PWM*T_DEAD);
duty_b = FOCUtil::DeadTimeCompensate_3Level(duty_b, i_b_hat, i_ripple_b, F_PWM*T_DEAD);
duty_c = FOCUtil::DeadTimeCompensate_3Level(duty_c, i_c_hat, i_ripple_c, F_PWM*T_DEAD);
}
void BLDCMotor::CalculatePosition(void)
{
static uint32_t pos_count = 0;
switch (status)
{
case FOC_Status::STOP:
case FOC_Status::IDENTIFICATION:
alpha_e = 0;
omega_e = 0;
break;
case FOC_Status::POSITIONING:
alpha_e = 0;
omega_e = 0;
if (pos_count++ > 1000)
{
pos_count = 0;
status = FOC_Status::OPERATION_FEEDFORWARD;
}
break;
case FOC_Status::OPERATION_FEEDFORWARD:
if (omega_e > OMEGA_TH_H || omega_e < -OMEGA_TH_H)
{
pid_theta_est.Clear();
status = FOC_Status::OPERATION_SENSORLESS;
}
else
{
alpha_e = alpha_ref;
omega_e += alpha_e * T_S;
}
break;
case FOC_Status::OPERATION_SENSORED_HALL:
// alpha is externally calculated
// omega and theta will be externally overwrited
if (omega_e > OMEGA_TH_H || omega_e < -OMEGA_TH_H)
{
pid_theta_est.Clear();
status = FOC_Status::OPERATION_SENSORLESS;
}
break;
case FOC_Status::OPERATION_SENSORED_ENC:
// alpha is not used
// omega is externally calculated
// theta will be externally overwrited
break;
case FOC_Status::OPERATION_SENSORLESS:
alpha_e = pid_theta_est(theta_err);
omega_e += alpha_e * T_S;
if (e_abs < E_TH_L)
{
status = FOC_Status::OPERATION_FEEDFORWARD;
}
break;
default:
status = FOC_Status::FAULT;
break;
}
theta_e += omega_e * T_S;
if (theta_e >= MyDSP::pi_f)
{
theta_e -= 2*MyDSP::pi_f;
}
else if (theta_e < -MyDSP::pi_f)
{
theta_e += 2*MyDSP::pi_f;
}
}
| [
"48833768+MSiv15@users.noreply.github.com"
] | 48833768+MSiv15@users.noreply.github.com |
485662f427758a8691e26cb25556c3ebb6dff9c6 | fc5cf6e087df5b7934ceed7d2a1d22b094197ff1 | /processed/12-189-9.cc | 8490c885d922319b12653f26ea53234bbdcddd1e | [
"MIT"
] | permissive | giulianobelinassi/LTO-Timing-Analysis | 80767a682960d2f2b1944edaf116466a784ac984 | 12eb7f3444f6c938c0a225f61aec47e419526490 | refs/heads/master | 2023-01-30T09:20:12.705767 | 2020-12-10T00:30:16 | 2020-12-10T00:30:16 | 263,368,860 | 1 | 0 | MIT | 2020-10-27T23:16:33 | 2020-05-12T14:59:34 | C++ | UTF-8 | C++ | false | false | 838,998 | cc | # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc"
# 1 "/home/giulianob/gcc_git_gnu/build_temp/gcc//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc"
# 21 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc"
# 1 "./config.h" 1
# 1 "./auto-host.h" 1
# 7 "./config.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" 1
# 40 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h"
extern "C" {
# 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h"
}
# 9 "./config.h" 2
# 22 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 1
# 32 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 33 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 43 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4
} max_align_t;
typedef decltype(nullptr) nullptr_t;
# 44 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 461 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 452 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 453 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 454 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 462 "/usr/include/features.h" 2 3 4
# 485 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 486 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 28 "/usr/include/stdio.h" 2 3 4
extern "C" {
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
int __count;
union
{
unsigned int __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4
typedef struct _G_fpos_t
{
__off_t __pos;
__mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
__off64_t __pos;
__mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;
typedef void _IO_lock_t;
struct _IO_FILE
{
int _flags;
char *_IO_read_ptr;
char *_IO_read_end;
char *_IO_read_base;
char *_IO_write_base;
char *_IO_write_ptr;
char *_IO_write_end;
char *_IO_buf_base;
char *_IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
struct _IO_FILE *_freeres_list;
void *_freeres_buf;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
size_t __nbytes);
typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
size_t __nbytes);
typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);
typedef int cookie_close_function_t (void *__cookie);
typedef struct _IO_cookie_io_functions_t
{
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 63 "/usr/include/stdio.h" 3 4
typedef __off_t off_t;
typedef __off64_t off64_t;
typedef __ssize_t ssize_t;
typedef __fpos_t fpos_t;
typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (const char *__filename) throw ();
extern int rename (const char *__old, const char *__new) throw ();
extern int renameat (int __oldfd, const char *__old, int __newfd,
const char *__new) throw ();
# 164 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
const char *__new, unsigned int __flags) throw ();
extern FILE *tmpfile (void) ;
# 183 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile64 (void) ;
extern char *tmpnam (char *__s) throw () ;
extern char *tmpnam_r (char *__s) throw () ;
# 204 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
throw () __attribute__ ((__malloc__)) ;
extern int fclose (FILE *__stream);
extern int fflush (FILE *__stream);
# 227 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 237 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 246 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen64 (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen64 (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
extern FILE *fdopen (int __fd, const char *__modes) throw () ;
extern FILE *fopencookie (void *__restrict __magic_cookie,
const char *__restrict __modes,
cookie_io_functions_t __io_funcs) throw () ;
extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
throw () ;
extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) throw ();
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) throw ();
extern void setlinebuf (FILE *__stream) throw ();
extern int fprintf (FILE *__restrict __stream,
const char *__restrict __format, ...);
extern int printf (const char *__restrict __format, ...);
extern int sprintf (char *__restrict __s,
const char *__restrict __format, ...) throw ();
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg);
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg) throw ();
extern int snprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, ...)
throw () __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, __gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__printf__, 3, 0)));
extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
__gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int vdprintf (int __fd, const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) ;
extern int scanf (const char *__restrict __format, ...) ;
extern int sscanf (const char *__restrict __s,
const char *__restrict __format, ...) throw ();
extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
;
extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
;
extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) throw () __asm__ ("" "__isoc99_sscanf")
;
# 432 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s,
const char *__restrict __format, __gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) throw () __asm__ ("" "__isoc99_vsscanf")
__attribute__ ((__format__ (__scanf__, 2, 0)));
# 485 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);
extern int getchar (void);
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 510 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 521 "/usr/include/stdio.h" 3 4
extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);
extern int putchar (int __c);
# 537 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);
extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
extern int getw (FILE *__stream);
extern int putw (int __w, FILE *__stream);
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
# 587 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
FILE *__restrict __stream) ;
# 603 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) ;
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
extern int puts (const char *__s);
extern int ungetc (int __c, FILE *__stream);
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s);
# 662 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
FILE *__restrict __stream);
# 673 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream);
# 707 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);
extern __off_t ftello (FILE *__stream) ;
# 731 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
extern int fsetpos (FILE *__stream, const fpos_t *__pos);
# 750 "/usr/include/stdio.h" 3 4
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
extern void clearerr (FILE *__stream) throw ();
extern int feof (FILE *__stream) throw () ;
extern int ferror (FILE *__stream) throw () ;
extern void clearerr_unlocked (FILE *__stream) throw ();
extern int feof_unlocked (FILE *__stream) throw () ;
extern int ferror_unlocked (FILE *__stream) throw () ;
extern void perror (const char *__s);
# 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern const char *const sys_errlist[];
extern int _sys_nerr;
extern const char *const _sys_errlist[];
# 782 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) throw () ;
extern int fileno_unlocked (FILE *__stream) throw () ;
# 800 "/usr/include/stdio.h" 3 4
extern FILE *popen (const char *__command, const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) throw ();
extern char *cuserid (char *__s);
struct obstack;
extern int obstack_printf (struct obstack *__restrict __obstack,
const char *__restrict __format, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
const char *__restrict __format,
__gnuc_va_list __args)
throw () __attribute__ ((__format__ (__printf__, 2, 0)));
extern void flockfile (FILE *__stream) throw ();
extern int ftrylockfile (FILE *__stream) throw () ;
extern void funlockfile (FILE *__stream) throw ();
# 858 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/stdio.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar (void)
{
return getc (stdin);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fgetc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar_unlocked (void)
{
return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar (int __c)
{
return putc (__c, stdout);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fputc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar_unlocked (int __c)
{
return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) feof_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x0010) != 0);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) ferror_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x0020) != 0);
}
# 865 "/usr/include/stdio.h" 2 3 4
# 873 "/usr/include/stdio.h" 3 4
}
# 47 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 103 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 103 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
extern "C" {
# 187 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
}
# 209 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" 1
# 57 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h"
enum {
_sch_isblank = 0x0001,
_sch_iscntrl = 0x0002,
_sch_isdigit = 0x0004,
_sch_islower = 0x0008,
_sch_isprint = 0x0010,
_sch_ispunct = 0x0020,
_sch_isspace = 0x0040,
_sch_isupper = 0x0080,
_sch_isxdigit = 0x0100,
_sch_isidst = 0x0200,
_sch_isvsp = 0x0400,
_sch_isnvsp = 0x0800,
_sch_isalpha = _sch_isupper|_sch_islower,
_sch_isalnum = _sch_isalpha|_sch_isdigit,
_sch_isidnum = _sch_isidst|_sch_isdigit,
_sch_isgraph = _sch_isalnum|_sch_ispunct,
_sch_iscppsp = _sch_isvsp|_sch_isnvsp,
_sch_isbasic = _sch_isprint|_sch_iscppsp
};
extern const unsigned short _sch_istable[256];
# 110 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h"
extern const unsigned char _sch_toupper[256];
extern const unsigned char _sch_tolower[256];
# 122 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h"
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4
# 28 "/usr/include/ctype.h" 3 4
extern "C" {
# 39 "/usr/include/ctype.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 40 "/usr/include/ctype.h" 2 3 4
enum
{
_ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
_ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
_ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
_ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
_ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
_ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
_ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
_ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
_ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
_IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
_ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
_ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
throw () __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
throw () __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
throw () __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) throw ();
extern int isalpha (int) throw ();
extern int iscntrl (int) throw ();
extern int isdigit (int) throw ();
extern int islower (int) throw ();
extern int isgraph (int) throw ();
extern int isprint (int) throw ();
extern int ispunct (int) throw ();
extern int isspace (int) throw ();
extern int isupper (int) throw ();
extern int isxdigit (int) throw ();
extern int tolower (int __c) throw ();
extern int toupper (int __c) throw ();
extern int isblank (int) throw ();
extern int isctype (int __c, int __mask) throw ();
extern int isascii (int __c) throw ();
extern int toascii (int __c) throw ();
extern int _toupper (int) throw ();
extern int _tolower (int) throw ();
# 174 "/usr/include/ctype.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int isalnum (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISalnum; }
extern __inline __attribute__ ((__gnu_inline__)) int isalpha (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISalpha; }
extern __inline __attribute__ ((__gnu_inline__)) int iscntrl (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IScntrl; }
extern __inline __attribute__ ((__gnu_inline__)) int isdigit (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISdigit; }
extern __inline __attribute__ ((__gnu_inline__)) int islower (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISlower; }
extern __inline __attribute__ ((__gnu_inline__)) int isgraph (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISgraph; }
extern __inline __attribute__ ((__gnu_inline__)) int isprint (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISprint; }
extern __inline __attribute__ ((__gnu_inline__)) int ispunct (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISpunct; }
extern __inline __attribute__ ((__gnu_inline__)) int isspace (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISspace; }
extern __inline __attribute__ ((__gnu_inline__)) int isupper (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISupper; }
extern __inline __attribute__ ((__gnu_inline__)) int isxdigit (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISxdigit; }
extern __inline __attribute__ ((__gnu_inline__)) int isblank (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISblank; }
# 206 "/usr/include/ctype.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) tolower (int __c) throw ()
{
return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) toupper (int __c) throw ()
{
return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
}
# 237 "/usr/include/ctype.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
};
typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4
typedef __locale_t locale_t;
# 238 "/usr/include/ctype.h" 2 3 4
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) throw ();
extern int isalpha_l (int, locale_t) throw ();
extern int iscntrl_l (int, locale_t) throw ();
extern int isdigit_l (int, locale_t) throw ();
extern int islower_l (int, locale_t) throw ();
extern int isgraph_l (int, locale_t) throw ();
extern int isprint_l (int, locale_t) throw ();
extern int ispunct_l (int, locale_t) throw ();
extern int isspace_l (int, locale_t) throw ();
extern int isupper_l (int, locale_t) throw ();
extern int isxdigit_l (int, locale_t) throw ();
extern int isblank_l (int, locale_t) throw ();
extern int __tolower_l (int __c, locale_t __l) throw ();
extern int tolower_l (int __c, locale_t __l) throw ();
extern int __toupper_l (int __c, locale_t __l) throw ();
extern int toupper_l (int __c, locale_t __l) throw ();
# 327 "/usr/include/ctype.h" 3 4
}
# 123 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" 2
# 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
extern "C" {
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;
typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4
typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4
typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4
typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef __useconds_t useconds_t;
typedef __suseconds_t suseconds_t;
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
return __builtin_bswap16 (__bsx);
}
static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{
return __builtin_bswap32 (__bsx);
}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{
return __builtin_bswap64 (__bsx);
}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
return __x;
}
static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
return __x;
}
static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/select.h" 2 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4
typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{
__time_t tv_sec;
__syscall_slong_t tv_nsec;
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
{
__fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern "C" {
# 101 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
# 113 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask);
# 126 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
}
# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 219 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
struct __pthread_internal_list *__next;
} __pthread_list_t;
typedef struct __pthread_internal_slist
{
struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 74 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
int __lock;
unsigned int __count;
int __owner;
unsigned int __nusers;
int __kind;
short __spins;
short __elision;
__pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 75 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 87 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
unsigned int __readers;
unsigned int __writers;
unsigned int __wrphase_futex;
unsigned int __writers_futex;
unsigned int __pad3;
unsigned int __pad4;
int __cur_writer;
int __shared;
signed char __rwelision;
unsigned char __pad1[7];
unsigned long int __pad2;
unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 88 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
struct __pthread_cond_s
{
__extension__ union
{
__extension__ unsigned long long int __wseq;
struct
{
unsigned int __low;
unsigned int __high;
} __wseq32;
};
__extension__ union
{
__extension__ unsigned long long int __g1_start;
struct
{
unsigned int __low;
unsigned int __high;
} __g1_start32;
};
unsigned int __g_refs[2] ;
unsigned int __g_size[2];
unsigned int __g1_orig_size;
unsigned int __wrefs;
unsigned int __g_signals[2];
};
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4
typedef unsigned long int pthread_t;
typedef union
{
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union
{
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
union pthread_attr_t
{
char __size[56];
long int __align;
};
typedef union pthread_attr_t pthread_attr_t;
typedef union
{
struct __pthread_mutex_s __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union
{
struct __pthread_cond_s __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
struct __pthread_rwlock_arch_t __data;
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[4];
int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
}
# 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4
extern "C" {
extern int *__errno_location (void) throw () __attribute__ ((__const__));
extern char *program_invocation_name;
extern char *program_invocation_short_name;
# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4
}
# 214 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 235 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/c++/10/cstring" 1 3
# 39 "/usr/include/c++/10/cstring" 3
# 40 "/usr/include/c++/10/cstring" 3
# 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 1 3
# 262 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3
namespace std
{
typedef long unsigned int size_t;
typedef long int ptrdiff_t;
typedef decltype(nullptr) nullptr_t;
}
# 284 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3
namespace std
{
inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
}
namespace __gnu_cxx
{
inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
}
# 522 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3
# 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h" 1 3
# 523 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 2 3
# 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/cpu_defines.h" 1 3
# 526 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 2 3
# 42 "/usr/include/c++/10/cstring" 2 3
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4
extern "C" {
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *memmove (void *__dest, const void *__src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
int __c, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern "C++"
{
extern void *memchr (void *__s, int __c, size_t __n)
throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern const void *memchr (const void *__s, int __c, size_t __n)
throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void *
memchr (void *__s, int __c, size_t __n) throw ()
{
return __builtin_memchr (__s, __c, __n);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const void *
memchr (const void *__s, int __c, size_t __n) throw ()
{
return __builtin_memchr (__s, __c, __n);
}
}
# 99 "/usr/include/string.h" 3 4
extern "C++" void *rawmemchr (void *__s, int __c)
throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern "C++" const void *rawmemchr (const void *__s, int __c)
throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern "C++" void *memrchr (void *__s, int __c, size_t __n)
throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 122 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *strncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int strcmp (const char *__s1, const char *__s2)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcoll (const char *__s1, const char *__s2)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strxfrm (char *__restrict __dest,
const char *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (2)));
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));
extern char *strdup (const char *__s)
throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
extern char *strndup (const char *__string, size_t __n)
throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 204 "/usr/include/string.h" 3 4
extern "C++"
{
extern char *strchr (char *__s, int __c)
throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern const char *strchr (const char *__s, int __c)
throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
strchr (char *__s, int __c) throw ()
{
return __builtin_strchr (__s, __c);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
strchr (const char *__s, int __c) throw ()
{
return __builtin_strchr (__s, __c);
}
}
extern "C++"
{
extern char *strrchr (char *__s, int __c)
throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern const char *strrchr (const char *__s, int __c)
throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
strrchr (char *__s, int __c) throw ()
{
return __builtin_strrchr (__s, __c);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
strrchr (const char *__s, int __c) throw ()
{
return __builtin_strrchr (__s, __c);
}
}
# 261 "/usr/include/string.h" 3 4
extern "C++" char *strchrnul (char *__s, int __c)
throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern "C++" const char *strchrnul (const char *__s, int __c)
throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strspn (const char *__s, const char *__accept)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern "C++"
{
extern char *strpbrk (char *__s, const char *__accept)
throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern const char *strpbrk (const char *__s, const char *__accept)
throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
strpbrk (char *__s, const char *__accept) throw ()
{
return __builtin_strpbrk (__s, __accept);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
strpbrk (const char *__s, const char *__accept) throw ()
{
return __builtin_strpbrk (__s, __accept);
}
}
extern "C++"
{
extern char *strstr (char *__haystack, const char *__needle)
throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern const char *strstr (const char *__haystack, const char *__needle)
throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
strstr (char *__haystack, const char *__needle) throw ()
{
return __builtin_strstr (__haystack, __needle);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
strstr (const char *__haystack, const char *__needle) throw ()
{
return __builtin_strstr (__haystack, __needle);
}
}
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
throw () __attribute__ ((__nonnull__ (2)));
extern char *__strtok_r (char *__restrict __s,
const char *__restrict __delim,
char **__restrict __save_ptr)
throw () __attribute__ ((__nonnull__ (2, 3)));
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
throw () __attribute__ ((__nonnull__ (2, 3)));
extern "C++" char *strcasestr (char *__haystack, const char *__needle)
throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern "C++" const char *strcasestr (const char *__haystack,
const char *__needle)
throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 369 "/usr/include/string.h" 3 4
extern void *memmem (const void *__haystack, size_t __haystacklen,
const void *__needle, size_t __needlelen)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
extern void *__mempcpy (void *__restrict __dest,
const void *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
const void *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern size_t strlen (const char *__s)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strnlen (const char *__string, size_t __maxlen)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strerror (int __errnum) throw ();
# 421 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
throw () __attribute__ ((__nonnull__ (2))) ;
extern char *strerror_l (int __errnum, locale_t __l) throw ();
# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4
extern "C" {
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bcopy (const void *__src, void *__dest, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
extern "C++"
{
extern char *index (char *__s, int __c)
throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern const char *index (const char *__s, int __c)
throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
index (char *__s, int __c) throw ()
{
return __builtin_index (__s, __c);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
index (const char *__s, int __c) throw ()
{
return __builtin_index (__s, __c);
}
}
extern "C++"
{
extern char *rindex (char *__s, int __c)
throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern const char *rindex (const char *__s, int __c)
throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
rindex (char *__s, int __c) throw ()
{
return __builtin_rindex (__s, __c);
}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
rindex (const char *__s, int __c) throw ()
{
return __builtin_rindex (__s, __c);
}
}
# 104 "/usr/include/strings.h" 3 4
extern int ffs (int __i) throw () __attribute__ ((__const__));
extern int ffsl (long int __l) throw () __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
throw () __attribute__ ((__const__));
extern int strcasecmp (const char *__s1, const char *__s2)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int strncasecmp_l (const char *__s1, const char *__s2,
size_t __n, locale_t __loc)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
}
# 433 "/usr/include/string.h" 2 3 4
extern void explicit_bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
extern char *strsep (char **__restrict __stringp,
const char *__restrict __delim)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *strsignal (int __sig) throw ();
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *__stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int strverscmp (const char *__s1, const char *__s2)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));
extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
extern "C++" char *basename (char *__filename)
throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
extern "C++" const char *basename (const char *__filename)
throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
# 499 "/usr/include/string.h" 3 4
}
# 43 "/usr/include/c++/10/cstring" 2 3
# 71 "/usr/include/c++/10/cstring" 3
extern "C++"
{
namespace std __attribute__ ((__visibility__ ("default")))
{
using ::memchr;
using ::memcmp;
using ::memcpy;
using ::memmove;
using ::memset;
using ::strcat;
using ::strcmp;
using ::strcoll;
using ::strcpy;
using ::strcspn;
using ::strerror;
using ::strlen;
using ::strncat;
using ::strncmp;
using ::strncpy;
using ::strspn;
using ::strtok;
using ::strxfrm;
using ::strchr;
using ::strpbrk;
using ::strrchr;
using ::strstr;
# 122 "/usr/include/c++/10/cstring" 3
}
}
# 236 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/c++/10/new" 1 3
# 38 "/usr/include/c++/10/new" 3
# 39 "/usr/include/c++/10/new" 3
# 1 "/usr/include/c++/10/exception" 1 3
# 33 "/usr/include/c++/10/exception" 3
# 34 "/usr/include/c++/10/exception" 3
#pragma GCC visibility push(default)
# 1 "/usr/include/c++/10/bits/exception.h" 1 3
# 34 "/usr/include/c++/10/bits/exception.h" 3
# 35 "/usr/include/c++/10/bits/exception.h" 3
#pragma GCC visibility push(default)
extern "C++" {
namespace std
{
# 60 "/usr/include/c++/10/bits/exception.h" 3
class exception
{
public:
exception() noexcept { }
virtual ~exception() noexcept;
exception(const exception&) = default;
exception& operator=(const exception&) = default;
exception(exception&&) = default;
exception& operator=(exception&&) = default;
virtual const char*
what() const noexcept;
};
}
}
#pragma GCC visibility pop
# 39 "/usr/include/c++/10/exception" 2 3
extern "C++" {
namespace std
{
class bad_exception : public exception
{
public:
bad_exception() noexcept { }
virtual ~bad_exception() noexcept;
virtual const char*
what() const noexcept;
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate(terminate_handler) noexcept;
terminate_handler get_terminate() noexcept;
void terminate() noexcept __attribute__ ((__noreturn__));
unexpected_handler set_unexpected(unexpected_handler) noexcept;
unexpected_handler get_unexpected() noexcept;
void unexpected() __attribute__ ((__noreturn__));
# 105 "/usr/include/c++/10/exception" 3
bool uncaught_exception() noexcept __attribute__ ((__pure__));
int uncaught_exceptions() noexcept __attribute__ ((__pure__));
}
namespace __gnu_cxx
{
# 137 "/usr/include/c++/10/exception" 3
void __verbose_terminate_handler();
}
}
#pragma GCC visibility pop
# 1 "/usr/include/c++/10/bits/exception_ptr.h" 1 3
# 34 "/usr/include/c++/10/bits/exception_ptr.h" 3
#pragma GCC visibility push(default)
# 1 "/usr/include/c++/10/bits/exception_defines.h" 1 3
# 38 "/usr/include/c++/10/bits/exception_ptr.h" 2 3
# 1 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 1 3
# 34 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3
# 35 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3
#pragma GCC visibility push(default)
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 39 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 2 3
# 50 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3
namespace std
{
class type_info;
}
namespace __cxxabiv1
{
struct __cxa_refcounted_exception;
extern "C"
{
void*
__cxa_allocate_exception(size_t) noexcept;
void
__cxa_free_exception(void*) noexcept;
__cxa_refcounted_exception*
__cxa_init_primary_exception(void *object, std::type_info *tinfo,
void ( *dest) (void *)) noexcept;
}
}
#pragma GCC visibility pop
# 39 "/usr/include/c++/10/bits/exception_ptr.h" 2 3
# 1 "/usr/include/c++/10/typeinfo" 1 3
# 32 "/usr/include/c++/10/typeinfo" 3
# 33 "/usr/include/c++/10/typeinfo" 3
# 1 "/usr/include/c++/10/bits/hash_bytes.h" 1 3
# 33 "/usr/include/c++/10/bits/hash_bytes.h" 3
# 34 "/usr/include/c++/10/bits/hash_bytes.h" 3
namespace std
{
size_t
_Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
size_t
_Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
}
# 37 "/usr/include/c++/10/typeinfo" 2 3
#pragma GCC visibility push(default)
extern "C++" {
namespace __cxxabiv1
{
class __class_type_info;
}
# 80 "/usr/include/c++/10/typeinfo" 3
namespace std
{
class type_info
{
public:
virtual ~type_info();
const char* name() const noexcept
{ return __name[0] == '*' ? __name + 1 : __name; }
# 115 "/usr/include/c++/10/typeinfo" 3
bool before(const type_info& __arg) const noexcept
{ return (__name[0] == '*' && __arg.__name[0] == '*')
? __name < __arg.__name
: __builtin_strcmp (__name, __arg.__name) < 0; }
bool operator==(const type_info& __arg) const noexcept
{
return ((__name == __arg.__name)
|| (__name[0] != '*' &&
__builtin_strcmp (__name, __arg.__name) == 0));
}
# 138 "/usr/include/c++/10/typeinfo" 3
bool operator!=(const type_info& __arg) const noexcept
{ return !operator==(__arg); }
size_t hash_code() const noexcept
{
return _Hash_bytes(name(), __builtin_strlen(name()),
static_cast<size_t>(0xc70f6907UL));
}
virtual bool __is_pointer_p() const;
virtual bool __is_function_p() const;
virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
unsigned __outer) const;
virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
void **__obj_ptr) const;
protected:
const char *__name;
explicit type_info(const char *__n): __name(__n) { }
private:
type_info& operator=(const type_info&);
type_info(const type_info&);
};
class bad_cast : public exception
{
public:
bad_cast() noexcept { }
virtual ~bad_cast() noexcept;
virtual const char* what() const noexcept;
};
class bad_typeid : public exception
{
public:
bad_typeid () noexcept { }
virtual ~bad_typeid() noexcept;
virtual const char* what() const noexcept;
};
}
}
#pragma GCC visibility pop
# 40 "/usr/include/c++/10/bits/exception_ptr.h" 2 3
# 1 "/usr/include/c++/10/new" 1 3
# 41 "/usr/include/c++/10/bits/exception_ptr.h" 2 3
extern "C++" {
namespace std
{
class type_info;
namespace __exception_ptr
{
class exception_ptr;
}
using __exception_ptr::exception_ptr;
exception_ptr current_exception() noexcept;
template<typename _Ex>
exception_ptr make_exception_ptr(_Ex) noexcept;
void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
namespace __exception_ptr
{
using std::rethrow_exception;
class exception_ptr
{
void* _M_exception_object;
explicit exception_ptr(void* __e) noexcept;
void _M_addref() noexcept;
void _M_release() noexcept;
void *_M_get() const noexcept __attribute__ ((__pure__));
friend exception_ptr std::current_exception() noexcept;
friend void std::rethrow_exception(exception_ptr);
template<typename _Ex>
friend exception_ptr std::make_exception_ptr(_Ex) noexcept;
public:
exception_ptr() noexcept;
exception_ptr(const exception_ptr&) noexcept;
exception_ptr(nullptr_t) noexcept
: _M_exception_object(0)
{ }
exception_ptr(exception_ptr&& __o) noexcept
: _M_exception_object(__o._M_exception_object)
{ __o._M_exception_object = 0; }
# 118 "/usr/include/c++/10/bits/exception_ptr.h" 3
exception_ptr&
operator=(const exception_ptr&) noexcept;
exception_ptr&
operator=(exception_ptr&& __o) noexcept
{
exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
return *this;
}
~exception_ptr() noexcept;
void
swap(exception_ptr&) noexcept;
# 145 "/usr/include/c++/10/bits/exception_ptr.h" 3
explicit operator bool() const
{ return _M_exception_object; }
friend bool
operator==(const exception_ptr&, const exception_ptr&)
noexcept __attribute__ ((__pure__));
const class std::type_info*
__cxa_exception_type() const noexcept
__attribute__ ((__pure__));
};
bool
operator==(const exception_ptr&, const exception_ptr&)
noexcept __attribute__ ((__pure__));
bool
operator!=(const exception_ptr&, const exception_ptr&)
noexcept __attribute__ ((__pure__));
inline void
swap(exception_ptr& __lhs, exception_ptr& __rhs)
{ __lhs.swap(__rhs); }
template<typename _Ex>
inline void
__dest_thunk(void* __x)
{ static_cast<_Ex*>(__x)->~_Ex(); }
}
template<typename _Ex>
exception_ptr
make_exception_ptr(_Ex __ex) noexcept
{
# 213 "/usr/include/c++/10/bits/exception_ptr.h" 3
return exception_ptr();
}
}
}
#pragma GCC visibility pop
# 148 "/usr/include/c++/10/exception" 2 3
# 1 "/usr/include/c++/10/bits/nested_exception.h" 1 3
# 33 "/usr/include/c++/10/bits/nested_exception.h" 3
#pragma GCC visibility push(default)
# 1 "/usr/include/c++/10/bits/move.h" 1 3
# 38 "/usr/include/c++/10/bits/move.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _Tp>
inline constexpr _Tp*
__addressof(_Tp& __r) noexcept
{ return __builtin_addressof(__r); }
}
# 1 "/usr/include/c++/10/type_traits" 1 3
# 32 "/usr/include/c++/10/type_traits" 3
# 33 "/usr/include/c++/10/type_traits" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 56 "/usr/include/c++/10/type_traits" 3
template<typename _Tp, _Tp __v>
struct integral_constant
{
static constexpr _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
constexpr operator value_type() const noexcept { return value; }
constexpr value_type operator()() const noexcept { return value; }
};
template<typename _Tp, _Tp __v>
constexpr _Tp integral_constant<_Tp, __v>::value;
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
template<bool __v>
using __bool_constant = integral_constant<bool, __v>;
# 91 "/usr/include/c++/10/type_traits" 3
template<bool, typename, typename>
struct conditional;
template <typename _Type>
struct __type_identity
{ using type = _Type; };
template<typename _Tp>
using __type_identity_t = typename __type_identity<_Tp>::type;
template<typename...>
struct __or_;
template<>
struct __or_<>
: public false_type
{ };
template<typename _B1>
struct __or_<_B1>
: public _B1
{ };
template<typename _B1, typename _B2>
struct __or_<_B1, _B2>
: public conditional<_B1::value, _B1, _B2>::type
{ };
template<typename _B1, typename _B2, typename _B3, typename... _Bn>
struct __or_<_B1, _B2, _B3, _Bn...>
: public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
{ };
template<typename...>
struct __and_;
template<>
struct __and_<>
: public true_type
{ };
template<typename _B1>
struct __and_<_B1>
: public _B1
{ };
template<typename _B1, typename _B2>
struct __and_<_B1, _B2>
: public conditional<_B1::value, _B2, _B1>::type
{ };
template<typename _B1, typename _B2, typename _B3, typename... _Bn>
struct __and_<_B1, _B2, _B3, _Bn...>
: public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
{ };
template<typename _Pp>
struct __not_
: public __bool_constant<!bool(_Pp::value)>
{ };
# 188 "/usr/include/c++/10/type_traits" 3
template<typename>
struct is_reference;
template<typename>
struct is_function;
template<typename>
struct is_void;
template<typename>
struct __is_array_unknown_bounds;
template <typename _Tp, size_t = sizeof(_Tp)>
constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
{ return {}; }
template <typename _TypeIdentity,
typename _NestedType = typename _TypeIdentity::type>
constexpr typename __or_<
is_reference<_NestedType>,
is_function<_NestedType>,
is_void<_NestedType>,
__is_array_unknown_bounds<_NestedType>
>::type __is_complete_or_unbounded(_TypeIdentity)
{ return {}; }
template<typename _Tp>
struct __success_type
{ typedef _Tp type; };
struct __failure_type
{ };
template<typename>
struct remove_cv;
template<typename _Tp>
using __remove_cv_t = typename remove_cv<_Tp>::type;
template<typename>
struct is_const;
template<typename>
struct __is_void_helper
: public false_type { };
template<>
struct __is_void_helper<void>
: public true_type { };
template<typename _Tp>
struct is_void
: public __is_void_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename>
struct __is_integral_helper
: public false_type { };
template<>
struct __is_integral_helper<bool>
: public true_type { };
template<>
struct __is_integral_helper<char>
: public true_type { };
template<>
struct __is_integral_helper<signed char>
: public true_type { };
template<>
struct __is_integral_helper<unsigned char>
: public true_type { };
template<>
struct __is_integral_helper<wchar_t>
: public true_type { };
# 284 "/usr/include/c++/10/type_traits" 3
template<>
struct __is_integral_helper<char16_t>
: public true_type { };
template<>
struct __is_integral_helper<char32_t>
: public true_type { };
template<>
struct __is_integral_helper<short>
: public true_type { };
template<>
struct __is_integral_helper<unsigned short>
: public true_type { };
template<>
struct __is_integral_helper<int>
: public true_type { };
template<>
struct __is_integral_helper<unsigned int>
: public true_type { };
template<>
struct __is_integral_helper<long>
: public true_type { };
template<>
struct __is_integral_helper<unsigned long>
: public true_type { };
template<>
struct __is_integral_helper<long long>
: public true_type { };
template<>
struct __is_integral_helper<unsigned long long>
: public true_type { };
template<>
struct __is_integral_helper<__int128>
: public true_type { };
template<>
struct __is_integral_helper<unsigned __int128>
: public true_type { };
# 364 "/usr/include/c++/10/type_traits" 3
template<typename _Tp>
struct is_integral
: public __is_integral_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename>
struct __is_floating_point_helper
: public false_type { };
template<>
struct __is_floating_point_helper<float>
: public true_type { };
template<>
struct __is_floating_point_helper<double>
: public true_type { };
template<>
struct __is_floating_point_helper<long double>
: public true_type { };
template<>
struct __is_floating_point_helper<__float128>
: public true_type { };
template<typename _Tp>
struct is_floating_point
: public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename>
struct is_array
: public false_type { };
template<typename _Tp, std::size_t _Size>
struct is_array<_Tp[_Size]>
: public true_type { };
template<typename _Tp>
struct is_array<_Tp[]>
: public true_type { };
template<typename>
struct __is_pointer_helper
: public false_type { };
template<typename _Tp>
struct __is_pointer_helper<_Tp*>
: public true_type { };
template<typename _Tp>
struct is_pointer
: public __is_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename>
struct is_lvalue_reference
: public false_type { };
template<typename _Tp>
struct is_lvalue_reference<_Tp&>
: public true_type { };
template<typename>
struct is_rvalue_reference
: public false_type { };
template<typename _Tp>
struct is_rvalue_reference<_Tp&&>
: public true_type { };
template<typename>
struct __is_member_object_pointer_helper
: public false_type { };
template<typename _Tp, typename _Cp>
struct __is_member_object_pointer_helper<_Tp _Cp::*>
: public __not_<is_function<_Tp>>::type { };
template<typename _Tp>
struct is_member_object_pointer
: public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename>
struct __is_member_function_pointer_helper
: public false_type { };
template<typename _Tp, typename _Cp>
struct __is_member_function_pointer_helper<_Tp _Cp::*>
: public is_function<_Tp>::type { };
template<typename _Tp>
struct is_member_function_pointer
: public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename _Tp>
struct is_enum
: public integral_constant<bool, __is_enum(_Tp)>
{ };
template<typename _Tp>
struct is_union
: public integral_constant<bool, __is_union(_Tp)>
{ };
template<typename _Tp>
struct is_class
: public integral_constant<bool, __is_class(_Tp)>
{ };
template<typename _Tp>
struct is_function
: public __bool_constant<!is_const<const _Tp>::value> { };
template<typename _Tp>
struct is_function<_Tp&>
: public false_type { };
template<typename _Tp>
struct is_function<_Tp&&>
: public false_type { };
template<typename>
struct __is_null_pointer_helper
: public false_type { };
template<>
struct __is_null_pointer_helper<std::nullptr_t>
: public true_type { };
template<typename _Tp>
struct is_null_pointer
: public __is_null_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename _Tp>
struct __is_nullptr_t
: public is_null_pointer<_Tp>
{ } __attribute__ ((__deprecated__ ("use '" "std::is_null_pointer" "' instead")));
template<typename _Tp>
struct is_reference
: public __or_<is_lvalue_reference<_Tp>,
is_rvalue_reference<_Tp>>::type
{ };
template<typename _Tp>
struct is_arithmetic
: public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
{ };
template<typename _Tp>
struct is_fundamental
: public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
is_null_pointer<_Tp>>::type
{ };
template<typename _Tp>
struct is_object
: public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
is_void<_Tp>>>::type
{ };
template<typename>
struct is_member_pointer;
template<typename _Tp>
struct is_scalar
: public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
{ };
template<typename _Tp>
struct is_compound
: public __not_<is_fundamental<_Tp>>::type { };
template<typename _Tp>
struct __is_member_pointer_helper
: public false_type { };
template<typename _Tp, typename _Cp>
struct __is_member_pointer_helper<_Tp _Cp::*>
: public true_type { };
template<typename _Tp>
struct is_member_pointer
: public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template<typename, typename>
struct is_same;
template<typename _Tp, typename... _Types>
using __is_one_of = __or_<is_same<_Tp, _Types>...>;
template<typename _Tp>
using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
signed char, signed short, signed int, signed long,
signed long long
, signed __int128
# 604 "/usr/include/c++/10/type_traits" 3
>;
template<typename _Tp>
using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
unsigned char, unsigned short, unsigned int, unsigned long,
unsigned long long
, unsigned __int128
# 623 "/usr/include/c++/10/type_traits" 3
>;
template<typename _Tp>
using __is_standard_integer
= __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
template<typename...> using __void_t = void;
template<typename _Tp, typename = void>
struct __is_referenceable
: public false_type
{ };
template<typename _Tp>
struct __is_referenceable<_Tp, __void_t<_Tp&>>
: public true_type
{ };
template<typename>
struct is_const
: public false_type { };
template<typename _Tp>
struct is_const<_Tp const>
: public true_type { };
template<typename>
struct is_volatile
: public false_type { };
template<typename _Tp>
struct is_volatile<_Tp volatile>
: public true_type { };
template<typename _Tp>
struct is_trivial
: public integral_constant<bool, __is_trivial(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_trivially_copyable
: public integral_constant<bool, __is_trivially_copyable(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_standard_layout
: public integral_constant<bool, __is_standard_layout(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct
is_pod
: public integral_constant<bool, __is_pod(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_literal_type
: public integral_constant<bool, __is_literal_type(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_empty
: public integral_constant<bool, __is_empty(_Tp)>
{ };
template<typename _Tp>
struct is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)>
{ };
template<typename _Tp>
struct is_final
: public integral_constant<bool, __is_final(_Tp)>
{ };
template<typename _Tp>
struct is_abstract
: public integral_constant<bool, __is_abstract(_Tp)>
{ };
template<typename _Tp,
bool = is_arithmetic<_Tp>::value>
struct __is_signed_helper
: public false_type { };
template<typename _Tp>
struct __is_signed_helper<_Tp, true>
: public integral_constant<bool, _Tp(-1) < _Tp(0)>
{ };
template<typename _Tp>
struct is_signed
: public __is_signed_helper<_Tp>::type
{ };
template<typename _Tp>
struct is_unsigned
: public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
{ };
# 770 "/usr/include/c++/10/type_traits" 3
template<typename _Tp, typename _Up = _Tp&&>
_Up
__declval(int);
template<typename _Tp>
_Tp
__declval(long);
template<typename _Tp>
auto declval() noexcept -> decltype(__declval<_Tp>(0));
template<typename, unsigned = 0>
struct extent;
template<typename>
struct remove_all_extents;
template<typename _Tp>
struct __is_array_known_bounds
: public integral_constant<bool, (extent<_Tp>::value > 0)>
{ };
template<typename _Tp>
struct __is_array_unknown_bounds
: public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
{ };
struct __do_is_destructible_impl
{
template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
static true_type __test(int);
template<typename>
static false_type __test(...);
};
template<typename _Tp>
struct __is_destructible_impl
: public __do_is_destructible_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template<typename _Tp,
bool = __or_<is_void<_Tp>,
__is_array_unknown_bounds<_Tp>,
is_function<_Tp>>::value,
bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
struct __is_destructible_safe;
template<typename _Tp>
struct __is_destructible_safe<_Tp, false, false>
: public __is_destructible_impl<typename
remove_all_extents<_Tp>::type>::type
{ };
template<typename _Tp>
struct __is_destructible_safe<_Tp, true, false>
: public false_type { };
template<typename _Tp>
struct __is_destructible_safe<_Tp, false, true>
: public true_type { };
template<typename _Tp>
struct is_destructible
: public __is_destructible_safe<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
struct __do_is_nt_destructible_impl
{
template<typename _Tp>
static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
__test(int);
template<typename>
static false_type __test(...);
};
template<typename _Tp>
struct __is_nt_destructible_impl
: public __do_is_nt_destructible_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template<typename _Tp,
bool = __or_<is_void<_Tp>,
__is_array_unknown_bounds<_Tp>,
is_function<_Tp>>::value,
bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
struct __is_nt_destructible_safe;
template<typename _Tp>
struct __is_nt_destructible_safe<_Tp, false, false>
: public __is_nt_destructible_impl<typename
remove_all_extents<_Tp>::type>::type
{ };
template<typename _Tp>
struct __is_nt_destructible_safe<_Tp, true, false>
: public false_type { };
template<typename _Tp>
struct __is_nt_destructible_safe<_Tp, false, true>
: public true_type { };
template<typename _Tp>
struct is_nothrow_destructible
: public __is_nt_destructible_safe<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, typename... _Args>
struct __is_constructible_impl
: public __bool_constant<__is_constructible(_Tp, _Args...)>
{ };
template<typename _Tp, typename... _Args>
struct is_constructible
: public __is_constructible_impl<_Tp, _Args...>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_default_constructible
: public __is_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_copy_constructible_impl;
template<typename _Tp>
struct __is_copy_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_copy_constructible_impl<_Tp, true>
: public __is_constructible_impl<_Tp, const _Tp&>
{ };
template<typename _Tp>
struct is_copy_constructible
: public __is_copy_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_move_constructible_impl;
template<typename _Tp>
struct __is_move_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_move_constructible_impl<_Tp, true>
: public __is_constructible_impl<_Tp, _Tp&&>
{ };
template<typename _Tp>
struct is_move_constructible
: public __is_move_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<bool, typename _Tp, typename... _Args>
struct __is_nt_constructible_impl
: public false_type
{ };
template<typename _Tp, typename... _Args>
struct __is_nt_constructible_impl<true, _Tp, _Args...>
: public __bool_constant<noexcept(_Tp(std::declval<_Args>()...))>
{ };
template<typename _Tp, typename _Arg>
struct __is_nt_constructible_impl<true, _Tp, _Arg>
: public __bool_constant<noexcept(static_cast<_Tp>(std::declval<_Arg>()))>
{ };
template<typename _Tp>
struct __is_nt_constructible_impl<true, _Tp>
: public __bool_constant<noexcept(_Tp())>
{ };
template<typename _Tp, size_t _Num>
struct __is_nt_constructible_impl<true, _Tp[_Num]>
: public __bool_constant<noexcept(typename remove_all_extents<_Tp>::type())>
{ };
# 1001 "/usr/include/c++/10/type_traits" 3
template<typename _Tp, typename... _Args>
using __is_nothrow_constructible_impl
= __is_nt_constructible_impl<__is_constructible(_Tp, _Args...),
_Tp, _Args...>;
template<typename _Tp, typename... _Args>
struct is_nothrow_constructible
: public __is_nothrow_constructible_impl<_Tp, _Args...>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_nothrow_default_constructible
: public __is_nothrow_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nothrow_copy_constructible_impl;
template<typename _Tp>
struct __is_nothrow_copy_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_nothrow_copy_constructible_impl<_Tp, true>
: public __is_nothrow_constructible_impl<_Tp, const _Tp&>
{ };
template<typename _Tp>
struct is_nothrow_copy_constructible
: public __is_nothrow_copy_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nothrow_move_constructible_impl;
template<typename _Tp>
struct __is_nothrow_move_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_nothrow_move_constructible_impl<_Tp, true>
: public __is_nothrow_constructible_impl<_Tp, _Tp&&>
{ };
template<typename _Tp>
struct is_nothrow_move_constructible
: public __is_nothrow_move_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, typename _Up>
struct is_assignable
: public __bool_constant<__is_assignable(_Tp, _Up)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_copy_assignable_impl;
template<typename _Tp>
struct __is_copy_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_copy_assignable_impl<_Tp, true>
: public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
{ };
template<typename _Tp>
struct is_copy_assignable
: public __is_copy_assignable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_move_assignable_impl;
template<typename _Tp>
struct __is_move_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_move_assignable_impl<_Tp, true>
: public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
{ };
template<typename _Tp>
struct is_move_assignable
: public __is_move_assignable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, typename _Up>
struct __is_nt_assignable_impl
: public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
{ };
template<typename _Tp, typename _Up>
struct __is_nothrow_assignable_impl
: public __and_<__bool_constant<__is_assignable(_Tp, _Up)>,
__is_nt_assignable_impl<_Tp, _Up>>
{ };
template<typename _Tp, typename _Up>
struct is_nothrow_assignable
: public __is_nothrow_assignable_impl<_Tp, _Up>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nt_copy_assignable_impl;
template<typename _Tp>
struct __is_nt_copy_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_nt_copy_assignable_impl<_Tp, true>
: public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
{ };
template<typename _Tp>
struct is_nothrow_copy_assignable
: public __is_nt_copy_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nt_move_assignable_impl;
template<typename _Tp>
struct __is_nt_move_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_nt_move_assignable_impl<_Tp, true>
: public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
{ };
template<typename _Tp>
struct is_nothrow_move_assignable
: public __is_nt_move_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, typename... _Args>
struct is_trivially_constructible
: public __bool_constant<__is_trivially_constructible(_Tp, _Args...)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_trivially_default_constructible
: public __bool_constant<__is_trivially_constructible(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
struct __do_is_implicitly_default_constructible_impl
{
template <typename _Tp>
static void __helper(const _Tp&);
template <typename _Tp>
static true_type __test(const _Tp&,
decltype(__helper<const _Tp&>({}))* = 0);
static false_type __test(...);
};
template<typename _Tp>
struct __is_implicitly_default_constructible_impl
: public __do_is_implicitly_default_constructible_impl
{
typedef decltype(__test(declval<_Tp>())) type;
};
template<typename _Tp>
struct __is_implicitly_default_constructible_safe
: public __is_implicitly_default_constructible_impl<_Tp>::type
{ };
template <typename _Tp>
struct __is_implicitly_default_constructible
: public __and_<__is_constructible_impl<_Tp>,
__is_implicitly_default_constructible_safe<_Tp>>
{ };
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_trivially_copy_constructible_impl;
template<typename _Tp>
struct __is_trivially_copy_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_trivially_copy_constructible_impl<_Tp, true>
: public __and_<__is_copy_constructible_impl<_Tp>,
integral_constant<bool,
__is_trivially_constructible(_Tp, const _Tp&)>>
{ };
template<typename _Tp>
struct is_trivially_copy_constructible
: public __is_trivially_copy_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_trivially_move_constructible_impl;
template<typename _Tp>
struct __is_trivially_move_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_trivially_move_constructible_impl<_Tp, true>
: public __and_<__is_move_constructible_impl<_Tp>,
integral_constant<bool,
__is_trivially_constructible(_Tp, _Tp&&)>>
{ };
template<typename _Tp>
struct is_trivially_move_constructible
: public __is_trivially_move_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, typename _Up>
struct is_trivially_assignable
: public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_trivially_copy_assignable_impl;
template<typename _Tp>
struct __is_trivially_copy_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_trivially_copy_assignable_impl<_Tp, true>
: public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
{ };
template<typename _Tp>
struct is_trivially_copy_assignable
: public __is_trivially_copy_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_trivially_move_assignable_impl;
template<typename _Tp>
struct __is_trivially_move_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
struct __is_trivially_move_assignable_impl<_Tp, true>
: public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
{ };
template<typename _Tp>
struct is_trivially_move_assignable
: public __is_trivially_move_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_trivially_destructible
: public __and_<__is_destructible_safe<_Tp>,
__bool_constant<__has_trivial_destructor(_Tp)>>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct alignment_of
: public integral_constant<std::size_t, alignof(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename>
struct rank
: public integral_constant<std::size_t, 0> { };
template<typename _Tp, std::size_t _Size>
struct rank<_Tp[_Size]>
: public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
template<typename _Tp>
struct rank<_Tp[]>
: public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
template<typename, unsigned _Uint>
struct extent
: public integral_constant<std::size_t, 0> { };
template<typename _Tp, unsigned _Uint, std::size_t _Size>
struct extent<_Tp[_Size], _Uint>
: public integral_constant<std::size_t,
_Uint == 0 ? _Size : extent<_Tp,
_Uint - 1>::value>
{ };
template<typename _Tp, unsigned _Uint>
struct extent<_Tp[], _Uint>
: public integral_constant<std::size_t,
_Uint == 0 ? 0 : extent<_Tp,
_Uint - 1>::value>
{ };
template<typename _Tp, typename _Up>
struct is_same
: public integral_constant<bool, __is_same_as(_Tp, _Up)>
{ };
# 1410 "/usr/include/c++/10/type_traits" 3
template<typename _Base, typename _Derived>
struct is_base_of
: public integral_constant<bool, __is_base_of(_Base, _Derived)>
{ };
template<typename _From, typename _To,
bool = __or_<is_void<_From>, is_function<_To>,
is_array<_To>>::value>
struct __is_convertible_helper
{
typedef typename is_void<_To>::type type;
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
template<typename _From, typename _To>
class __is_convertible_helper<_From, _To, false>
{
template<typename _To1>
static void __test_aux(_To1) noexcept;
template<typename _From1, typename _To1,
typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
static true_type
__test(int);
template<typename, typename>
static false_type
__test(...);
public:
typedef decltype(__test<_From, _To>(0)) type;
};
#pragma GCC diagnostic pop
template<typename _From, typename _To>
struct is_convertible
: public __is_convertible_helper<_From, _To>::type
{ };
template<typename _ToElementType, typename _FromElementType>
using __is_array_convertible
= is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
template<typename _From, typename _To,
bool = __or_<is_void<_From>, is_function<_To>,
is_array<_To>>::value>
struct __is_nt_convertible_helper
: is_void<_To>
{ };
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
template<typename _From, typename _To>
class __is_nt_convertible_helper<_From, _To, false>
{
template<typename _To1>
static void __test_aux(_To1) noexcept;
template<typename _From1, typename _To1>
static
__bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
__test(int);
template<typename, typename>
static false_type
__test(...);
public:
using type = decltype(__test<_From, _To>(0));
};
#pragma GCC diagnostic pop
template<typename _From, typename _To>
struct __is_nothrow_convertible
: public __is_nt_convertible_helper<_From, _To>::type
{ };
# 1508 "/usr/include/c++/10/type_traits" 3
template<typename _Tp>
struct remove_const
{ typedef _Tp type; };
template<typename _Tp>
struct remove_const<_Tp const>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_volatile
{ typedef _Tp type; };
template<typename _Tp>
struct remove_volatile<_Tp volatile>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_cv
{ using type = _Tp; };
template<typename _Tp>
struct remove_cv<const _Tp>
{ using type = _Tp; };
template<typename _Tp>
struct remove_cv<volatile _Tp>
{ using type = _Tp; };
template<typename _Tp>
struct remove_cv<const volatile _Tp>
{ using type = _Tp; };
template<typename _Tp>
struct add_const
{ typedef _Tp const type; };
template<typename _Tp>
struct add_volatile
{ typedef _Tp volatile type; };
template<typename _Tp>
struct add_cv
{
typedef typename
add_const<typename add_volatile<_Tp>::type>::type type;
};
template<typename _Tp>
using remove_const_t = typename remove_const<_Tp>::type;
template<typename _Tp>
using remove_volatile_t = typename remove_volatile<_Tp>::type;
template<typename _Tp>
using remove_cv_t = typename remove_cv<_Tp>::type;
template<typename _Tp>
using add_const_t = typename add_const<_Tp>::type;
template<typename _Tp>
using add_volatile_t = typename add_volatile<_Tp>::type;
template<typename _Tp>
using add_cv_t = typename add_cv<_Tp>::type;
template<typename _Tp>
struct remove_reference
{ typedef _Tp type; };
template<typename _Tp>
struct remove_reference<_Tp&>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_reference<_Tp&&>
{ typedef _Tp type; };
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __add_lvalue_reference_helper
{ typedef _Tp type; };
template<typename _Tp>
struct __add_lvalue_reference_helper<_Tp, true>
{ typedef _Tp& type; };
template<typename _Tp>
struct add_lvalue_reference
: public __add_lvalue_reference_helper<_Tp>
{ };
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __add_rvalue_reference_helper
{ typedef _Tp type; };
template<typename _Tp>
struct __add_rvalue_reference_helper<_Tp, true>
{ typedef _Tp&& type; };
template<typename _Tp>
struct add_rvalue_reference
: public __add_rvalue_reference_helper<_Tp>
{ };
template<typename _Tp>
using remove_reference_t = typename remove_reference<_Tp>::type;
template<typename _Tp>
using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
template<typename _Tp>
using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
template<typename _Unqualified, bool _IsConst, bool _IsVol>
struct __cv_selector;
template<typename _Unqualified>
struct __cv_selector<_Unqualified, false, false>
{ typedef _Unqualified __type; };
template<typename _Unqualified>
struct __cv_selector<_Unqualified, false, true>
{ typedef volatile _Unqualified __type; };
template<typename _Unqualified>
struct __cv_selector<_Unqualified, true, false>
{ typedef const _Unqualified __type; };
template<typename _Unqualified>
struct __cv_selector<_Unqualified, true, true>
{ typedef const volatile _Unqualified __type; };
template<typename _Qualified, typename _Unqualified,
bool _IsConst = is_const<_Qualified>::value,
bool _IsVol = is_volatile<_Qualified>::value>
class __match_cv_qualifiers
{
typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
public:
typedef typename __match::__type __type;
};
template<typename _Tp>
struct __make_unsigned
{ typedef _Tp __type; };
template<>
struct __make_unsigned<char>
{ typedef unsigned char __type; };
template<>
struct __make_unsigned<signed char>
{ typedef unsigned char __type; };
template<>
struct __make_unsigned<short>
{ typedef unsigned short __type; };
template<>
struct __make_unsigned<int>
{ typedef unsigned int __type; };
template<>
struct __make_unsigned<long>
{ typedef unsigned long __type; };
template<>
struct __make_unsigned<long long>
{ typedef unsigned long long __type; };
template<>
struct __make_unsigned<__int128>
{ typedef unsigned __int128 __type; };
# 1730 "/usr/include/c++/10/type_traits" 3
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
bool _IsEnum = is_enum<_Tp>::value>
class __make_unsigned_selector;
template<typename _Tp>
class __make_unsigned_selector<_Tp, true, false>
{
using __unsigned_type
= typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
public:
using __type
= typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
};
class __make_unsigned_selector_base
{
protected:
template<typename...> struct _List { };
template<typename _Tp, typename... _Up>
struct _List<_Tp, _Up...> : _List<_Up...>
{ static constexpr size_t __size = sizeof(_Tp); };
template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
struct __select;
template<size_t _Sz, typename _Uint, typename... _UInts>
struct __select<_Sz, _List<_Uint, _UInts...>, true>
{ using __type = _Uint; };
template<size_t _Sz, typename _Uint, typename... _UInts>
struct __select<_Sz, _List<_Uint, _UInts...>, false>
: __select<_Sz, _List<_UInts...>>
{ };
};
template<typename _Tp>
class __make_unsigned_selector<_Tp, false, true>
: __make_unsigned_selector_base
{
using _UInts = _List<unsigned char, unsigned short, unsigned int,
unsigned long, unsigned long long>;
using __unsigned_type = typename __select<sizeof(_Tp), _UInts>::__type;
public:
using __type
= typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
};
template<>
struct __make_unsigned<wchar_t>
{
using __type
= typename __make_unsigned_selector<wchar_t, false, true>::__type;
};
# 1806 "/usr/include/c++/10/type_traits" 3
template<>
struct __make_unsigned<char16_t>
{
using __type
= typename __make_unsigned_selector<char16_t, false, true>::__type;
};
template<>
struct __make_unsigned<char32_t>
{
using __type
= typename __make_unsigned_selector<char32_t, false, true>::__type;
};
template<typename _Tp>
struct make_unsigned
{ typedef typename __make_unsigned_selector<_Tp>::__type type; };
template<>
struct make_unsigned<bool>;
template<typename _Tp>
struct __make_signed
{ typedef _Tp __type; };
template<>
struct __make_signed<char>
{ typedef signed char __type; };
template<>
struct __make_signed<unsigned char>
{ typedef signed char __type; };
template<>
struct __make_signed<unsigned short>
{ typedef signed short __type; };
template<>
struct __make_signed<unsigned int>
{ typedef signed int __type; };
template<>
struct __make_signed<unsigned long>
{ typedef signed long __type; };
template<>
struct __make_signed<unsigned long long>
{ typedef signed long long __type; };
template<>
struct __make_signed<unsigned __int128>
{ typedef __int128 __type; };
# 1884 "/usr/include/c++/10/type_traits" 3
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
bool _IsEnum = is_enum<_Tp>::value>
class __make_signed_selector;
template<typename _Tp>
class __make_signed_selector<_Tp, true, false>
{
using __signed_type
= typename __make_signed<__remove_cv_t<_Tp>>::__type;
public:
using __type
= typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
};
template<typename _Tp>
class __make_signed_selector<_Tp, false, true>
{
typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
public:
typedef typename __make_signed_selector<__unsigned_type>::__type __type;
};
template<>
struct __make_signed<wchar_t>
{
using __type
= typename __make_signed_selector<wchar_t, false, true>::__type;
};
# 1932 "/usr/include/c++/10/type_traits" 3
template<>
struct __make_signed<char16_t>
{
using __type
= typename __make_signed_selector<char16_t, false, true>::__type;
};
template<>
struct __make_signed<char32_t>
{
using __type
= typename __make_signed_selector<char32_t, false, true>::__type;
};
template<typename _Tp>
struct make_signed
{ typedef typename __make_signed_selector<_Tp>::__type type; };
template<>
struct make_signed<bool>;
template<typename _Tp>
using make_signed_t = typename make_signed<_Tp>::type;
template<typename _Tp>
using make_unsigned_t = typename make_unsigned<_Tp>::type;
template<typename _Tp>
struct remove_extent
{ typedef _Tp type; };
template<typename _Tp, std::size_t _Size>
struct remove_extent<_Tp[_Size]>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_extent<_Tp[]>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_all_extents
{ typedef _Tp type; };
template<typename _Tp, std::size_t _Size>
struct remove_all_extents<_Tp[_Size]>
{ typedef typename remove_all_extents<_Tp>::type type; };
template<typename _Tp>
struct remove_all_extents<_Tp[]>
{ typedef typename remove_all_extents<_Tp>::type type; };
template<typename _Tp>
using remove_extent_t = typename remove_extent<_Tp>::type;
template<typename _Tp>
using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
template<typename _Tp, typename>
struct __remove_pointer_helper
{ typedef _Tp type; };
template<typename _Tp, typename _Up>
struct __remove_pointer_helper<_Tp, _Up*>
{ typedef _Up type; };
template<typename _Tp>
struct remove_pointer
: public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
{ };
template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
is_void<_Tp>>::value>
struct __add_pointer_helper
{ typedef _Tp type; };
template<typename _Tp>
struct __add_pointer_helper<_Tp, true>
{ typedef typename remove_reference<_Tp>::type* type; };
template<typename _Tp>
struct add_pointer
: public __add_pointer_helper<_Tp>
{ };
template<typename _Tp>
using remove_pointer_t = typename remove_pointer<_Tp>::type;
template<typename _Tp>
using add_pointer_t = typename add_pointer<_Tp>::type;
template<std::size_t _Len>
struct __aligned_storage_msa
{
union __type
{
unsigned char __data[_Len];
struct __attribute__((__aligned__)) { } __align;
};
};
# 2067 "/usr/include/c++/10/type_traits" 3
template<std::size_t _Len, std::size_t _Align =
__alignof__(typename __aligned_storage_msa<_Len>::__type)>
struct aligned_storage
{
union type
{
unsigned char __data[_Len];
struct __attribute__((__aligned__((_Align)))) { } __align;
};
};
template <typename... _Types>
struct __strictest_alignment
{
static const size_t _S_alignment = 0;
static const size_t _S_size = 0;
};
template <typename _Tp, typename... _Types>
struct __strictest_alignment<_Tp, _Types...>
{
static const size_t _S_alignment =
alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
static const size_t _S_size =
sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
};
# 2106 "/usr/include/c++/10/type_traits" 3
template <size_t _Len, typename... _Types>
struct aligned_union
{
private:
static_assert(sizeof...(_Types) != 0, "At least one type is required");
using __strictest = __strictest_alignment<_Types...>;
static const size_t _S_len = _Len > __strictest::_S_size
? _Len : __strictest::_S_size;
public:
static const size_t alignment_value = __strictest::_S_alignment;
typedef typename aligned_storage<_S_len, alignment_value>::type type;
};
template <size_t _Len, typename... _Types>
const size_t aligned_union<_Len, _Types...>::alignment_value;
template<typename _Up,
bool _IsArray = is_array<_Up>::value,
bool _IsFunction = is_function<_Up>::value>
struct __decay_selector;
template<typename _Up>
struct __decay_selector<_Up, false, false>
{ typedef __remove_cv_t<_Up> __type; };
template<typename _Up>
struct __decay_selector<_Up, true, false>
{ typedef typename remove_extent<_Up>::type* __type; };
template<typename _Up>
struct __decay_selector<_Up, false, true>
{ typedef typename add_pointer<_Up>::type __type; };
template<typename _Tp>
class decay
{
typedef typename remove_reference<_Tp>::type __remove_type;
public:
typedef typename __decay_selector<__remove_type>::__type type;
};
template<typename _Tp>
using __decay_t = typename decay<_Tp>::type;
template<typename _Tp>
class reference_wrapper;
template<typename _Tp>
struct __strip_reference_wrapper
{
typedef _Tp __type;
};
template<typename _Tp>
struct __strip_reference_wrapper<reference_wrapper<_Tp> >
{
typedef _Tp& __type;
};
template<typename _Tp>
using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
template<bool, typename _Tp = void>
struct enable_if
{ };
template<typename _Tp>
struct enable_if<true, _Tp>
{ typedef _Tp type; };
template<bool _Cond, typename _Tp = void>
using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
template<typename... _Cond>
using _Require = __enable_if_t<__and_<_Cond...>::value>;
template<bool _Cond, typename _Iftrue, typename _Iffalse>
struct conditional
{ typedef _Iftrue type; };
template<typename _Iftrue, typename _Iffalse>
struct conditional<false, _Iftrue, _Iffalse>
{ typedef _Iffalse type; };
template<typename _Tp>
using __remove_cvref_t
= typename remove_cv<typename remove_reference<_Tp>::type>::type;
template<typename... _Tp>
struct common_type;
struct __do_common_type_impl
{
template<typename _Tp, typename _Up>
using __cond_t
= decltype(true ? std::declval<_Tp>() : std::declval<_Up>());
template<typename _Tp, typename _Up>
static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
_S_test(int);
# 2239 "/usr/include/c++/10/type_traits" 3
template<typename, typename>
static __failure_type
_S_test_2(...);
template<typename _Tp, typename _Up>
static decltype(_S_test_2<_Tp, _Up>(0))
_S_test(...);
};
template<>
struct common_type<>
{ };
template<typename _Tp0>
struct common_type<_Tp0>
: public common_type<_Tp0, _Tp0>
{ };
template<typename _Tp1, typename _Tp2,
typename _Dp1 = __decay_t<_Tp1>, typename _Dp2 = __decay_t<_Tp2>>
struct __common_type_impl
{
using type = common_type<_Dp1, _Dp2>;
};
template<typename _Tp1, typename _Tp2>
struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
: private __do_common_type_impl
{
using type = decltype(_S_test<_Tp1, _Tp2>(0));
};
template<typename _Tp1, typename _Tp2>
struct common_type<_Tp1, _Tp2>
: public __common_type_impl<_Tp1, _Tp2>::type
{ };
template<typename...>
struct __common_type_pack
{ };
template<typename, typename, typename = void>
struct __common_type_fold;
template<typename _Tp1, typename _Tp2, typename... _Rp>
struct common_type<_Tp1, _Tp2, _Rp...>
: public __common_type_fold<common_type<_Tp1, _Tp2>,
__common_type_pack<_Rp...>>
{ };
template<typename _CTp, typename... _Rp>
struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
__void_t<typename _CTp::type>>
: public common_type<typename _CTp::type, _Rp...>
{ };
template<typename _CTp, typename _Rp>
struct __common_type_fold<_CTp, _Rp, void>
{ };
template<typename _Tp, bool = is_enum<_Tp>::value>
struct __underlying_type_impl
{
using type = __underlying_type(_Tp);
};
template<typename _Tp>
struct __underlying_type_impl<_Tp, false>
{ };
template<typename _Tp>
struct underlying_type
: public __underlying_type_impl<_Tp>
{ };
template<typename _Tp>
struct __declval_protector
{
static const bool __stop = false;
};
template<typename _Tp>
auto declval() noexcept -> decltype(__declval<_Tp>(0))
{
static_assert(__declval_protector<_Tp>::__stop,
"declval() must not be used!");
return __declval<_Tp>(0);
}
template<typename _Signature>
class result_of;
struct __invoke_memfun_ref { };
struct __invoke_memfun_deref { };
struct __invoke_memobj_ref { };
struct __invoke_memobj_deref { };
struct __invoke_other { };
template<typename _Tp, typename _Tag>
struct __result_of_success : __success_type<_Tp>
{ using __invoke_type = _Tag; };
struct __result_of_memfun_ref_impl
{
template<typename _Fp, typename _Tp1, typename... _Args>
static __result_of_success<decltype(
(std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
), __invoke_memfun_ref> _S_test(int);
template<typename...>
static __failure_type _S_test(...);
};
template<typename _MemPtr, typename _Arg, typename... _Args>
struct __result_of_memfun_ref
: private __result_of_memfun_ref_impl
{
typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
};
struct __result_of_memfun_deref_impl
{
template<typename _Fp, typename _Tp1, typename... _Args>
static __result_of_success<decltype(
((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
), __invoke_memfun_deref> _S_test(int);
template<typename...>
static __failure_type _S_test(...);
};
template<typename _MemPtr, typename _Arg, typename... _Args>
struct __result_of_memfun_deref
: private __result_of_memfun_deref_impl
{
typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
};
struct __result_of_memobj_ref_impl
{
template<typename _Fp, typename _Tp1>
static __result_of_success<decltype(
std::declval<_Tp1>().*std::declval<_Fp>()
), __invoke_memobj_ref> _S_test(int);
template<typename, typename>
static __failure_type _S_test(...);
};
template<typename _MemPtr, typename _Arg>
struct __result_of_memobj_ref
: private __result_of_memobj_ref_impl
{
typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
};
struct __result_of_memobj_deref_impl
{
template<typename _Fp, typename _Tp1>
static __result_of_success<decltype(
(*std::declval<_Tp1>()).*std::declval<_Fp>()
), __invoke_memobj_deref> _S_test(int);
template<typename, typename>
static __failure_type _S_test(...);
};
template<typename _MemPtr, typename _Arg>
struct __result_of_memobj_deref
: private __result_of_memobj_deref_impl
{
typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
};
template<typename _MemPtr, typename _Arg>
struct __result_of_memobj;
template<typename _Res, typename _Class, typename _Arg>
struct __result_of_memobj<_Res _Class::*, _Arg>
{
typedef __remove_cvref_t<_Arg> _Argval;
typedef _Res _Class::* _MemPtr;
typedef typename conditional<__or_<is_same<_Argval, _Class>,
is_base_of<_Class, _Argval>>::value,
__result_of_memobj_ref<_MemPtr, _Arg>,
__result_of_memobj_deref<_MemPtr, _Arg>
>::type::type type;
};
template<typename _MemPtr, typename _Arg, typename... _Args>
struct __result_of_memfun;
template<typename _Res, typename _Class, typename _Arg, typename... _Args>
struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
{
typedef typename remove_reference<_Arg>::type _Argval;
typedef _Res _Class::* _MemPtr;
typedef typename conditional<is_base_of<_Class, _Argval>::value,
__result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
__result_of_memfun_deref<_MemPtr, _Arg, _Args...>
>::type::type type;
};
template<typename _Tp, typename _Up = __remove_cvref_t<_Tp>>
struct __inv_unwrap
{
using type = _Tp;
};
template<typename _Tp, typename _Up>
struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
{
using type = _Up&;
};
template<bool, bool, typename _Functor, typename... _ArgTypes>
struct __result_of_impl
{
typedef __failure_type type;
};
template<typename _MemPtr, typename _Arg>
struct __result_of_impl<true, false, _MemPtr, _Arg>
: public __result_of_memobj<__decay_t<_MemPtr>,
typename __inv_unwrap<_Arg>::type>
{ };
template<typename _MemPtr, typename _Arg, typename... _Args>
struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
: public __result_of_memfun<__decay_t<_MemPtr>,
typename __inv_unwrap<_Arg>::type, _Args...>
{ };
struct __result_of_other_impl
{
template<typename _Fn, typename... _Args>
static __result_of_success<decltype(
std::declval<_Fn>()(std::declval<_Args>()...)
), __invoke_other> _S_test(int);
template<typename...>
static __failure_type _S_test(...);
};
template<typename _Functor, typename... _ArgTypes>
struct __result_of_impl<false, false, _Functor, _ArgTypes...>
: private __result_of_other_impl
{
typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
};
template<typename _Functor, typename... _ArgTypes>
struct __invoke_result
: public __result_of_impl<
is_member_object_pointer<
typename remove_reference<_Functor>::type
>::value,
is_member_function_pointer<
typename remove_reference<_Functor>::type
>::value,
_Functor, _ArgTypes...
>::type
{ };
template<typename _Functor, typename... _ArgTypes>
struct result_of<_Functor(_ArgTypes...)>
: public __invoke_result<_Functor, _ArgTypes...>
{ };
template<size_t _Len, size_t _Align =
__alignof__(typename __aligned_storage_msa<_Len>::__type)>
using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
template <size_t _Len, typename... _Types>
using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
template<typename _Tp>
using decay_t = typename decay<_Tp>::type;
template<bool _Cond, typename _Tp = void>
using enable_if_t = typename enable_if<_Cond, _Tp>::type;
template<bool _Cond, typename _Iftrue, typename _Iffalse>
using conditional_t = typename conditional<_Cond, _Iftrue, _Iffalse>::type;
template<typename... _Tp>
using common_type_t = typename common_type<_Tp...>::type;
template<typename _Tp>
using underlying_type_t = typename underlying_type<_Tp>::type;
template<typename _Tp>
using result_of_t = typename result_of<_Tp>::type;
template<typename...> using void_t = void;
template<typename _Default, typename _AlwaysVoid,
template<typename...> class _Op, typename... _Args>
struct __detector
{
using value_t = false_type;
using type = _Default;
};
template<typename _Default, template<typename...> class _Op,
typename... _Args>
struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
{
using value_t = true_type;
using type = _Op<_Args...>;
};
template<typename _Default, template<typename...> class _Op,
typename... _Args>
using __detected_or = __detector<_Default, void, _Op, _Args...>;
template<typename _Default, template<typename...> class _Op,
typename... _Args>
using __detected_or_t
= typename __detected_or<_Default, _Op, _Args...>::type;
# 2624 "/usr/include/c++/10/type_traits" 3
template <typename _Tp>
struct __is_swappable;
template <typename _Tp>
struct __is_nothrow_swappable;
template<typename... _Elements>
class tuple;
template<typename>
struct __is_tuple_like_impl : false_type
{ };
template<typename... _Tps>
struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
{ };
template<typename _Tp>
struct __is_tuple_like
: public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
{ };
template<typename _Tp>
inline
_Require<__not_<__is_tuple_like<_Tp>>,
is_move_constructible<_Tp>,
is_move_assignable<_Tp>>
swap(_Tp&, _Tp&)
noexcept(__and_<is_nothrow_move_constructible<_Tp>,
is_nothrow_move_assignable<_Tp>>::value);
template<typename _Tp, size_t _Nm>
inline
__enable_if_t<__is_swappable<_Tp>::value>
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
noexcept(__is_nothrow_swappable<_Tp>::value);
namespace __swappable_details {
using std::swap;
struct __do_is_swappable_impl
{
template<typename _Tp, typename
= decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
static true_type __test(int);
template<typename>
static false_type __test(...);
};
struct __do_is_nothrow_swappable_impl
{
template<typename _Tp>
static __bool_constant<
noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
> __test(int);
template<typename>
static false_type __test(...);
};
}
template<typename _Tp>
struct __is_swappable_impl
: public __swappable_details::__do_is_swappable_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template<typename _Tp>
struct __is_nothrow_swappable_impl
: public __swappable_details::__do_is_nothrow_swappable_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template<typename _Tp>
struct __is_swappable
: public __is_swappable_impl<_Tp>::type
{ };
template<typename _Tp>
struct __is_nothrow_swappable
: public __is_nothrow_swappable_impl<_Tp>::type
{ };
template<typename _Tp>
struct is_swappable
: public __is_swappable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
struct is_nothrow_swappable
: public __is_nothrow_swappable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template<typename _Tp>
constexpr bool is_swappable_v =
is_swappable<_Tp>::value;
template<typename _Tp>
constexpr bool is_nothrow_swappable_v =
is_nothrow_swappable<_Tp>::value;
namespace __swappable_with_details {
using std::swap;
struct __do_is_swappable_with_impl
{
template<typename _Tp, typename _Up, typename
= decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
typename
= decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
static true_type __test(int);
template<typename, typename>
static false_type __test(...);
};
struct __do_is_nothrow_swappable_with_impl
{
template<typename _Tp, typename _Up>
static __bool_constant<
noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
&&
noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
> __test(int);
template<typename, typename>
static false_type __test(...);
};
}
template<typename _Tp, typename _Up>
struct __is_swappable_with_impl
: public __swappable_with_details::__do_is_swappable_with_impl
{
typedef decltype(__test<_Tp, _Up>(0)) type;
};
template<typename _Tp>
struct __is_swappable_with_impl<_Tp&, _Tp&>
: public __swappable_details::__do_is_swappable_impl
{
typedef decltype(__test<_Tp&>(0)) type;
};
template<typename _Tp, typename _Up>
struct __is_nothrow_swappable_with_impl
: public __swappable_with_details::__do_is_nothrow_swappable_with_impl
{
typedef decltype(__test<_Tp, _Up>(0)) type;
};
template<typename _Tp>
struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
: public __swappable_details::__do_is_nothrow_swappable_impl
{
typedef decltype(__test<_Tp&>(0)) type;
};
template<typename _Tp, typename _Up>
struct is_swappable_with
: public __is_swappable_with_impl<_Tp, _Up>::type
{ };
template<typename _Tp, typename _Up>
struct is_nothrow_swappable_with
: public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
{ };
template<typename _Tp, typename _Up>
constexpr bool is_swappable_with_v =
is_swappable_with<_Tp, _Up>::value;
template<typename _Tp, typename _Up>
constexpr bool is_nothrow_swappable_with_v =
is_nothrow_swappable_with<_Tp, _Up>::value;
template<typename _Result, typename _Ret,
bool = is_void<_Ret>::value, typename = void>
struct __is_invocable_impl : false_type { };
template<typename _Result, typename _Ret>
struct __is_invocable_impl<_Result, _Ret,
true,
__void_t<typename _Result::type>>
: true_type
{ };
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
template<typename _Result, typename _Ret>
struct __is_invocable_impl<_Result, _Ret,
false,
__void_t<typename _Result::type>>
{
private:
static typename _Result::type _S_get();
template<typename _Tp>
static void _S_conv(_Tp);
template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))>
static true_type
_S_test(int);
template<typename _Tp>
static false_type
_S_test(...);
public:
using type = decltype(_S_test<_Ret>(1));
};
#pragma GCC diagnostic pop
template<typename _Fn, typename... _ArgTypes>
struct __is_invocable
: __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
{ };
template<typename _Fn, typename _Tp, typename... _Args>
constexpr bool __call_is_nt(__invoke_memfun_ref)
{
using _Up = typename __inv_unwrap<_Tp>::type;
return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
std::declval<_Args>()...));
}
template<typename _Fn, typename _Tp, typename... _Args>
constexpr bool __call_is_nt(__invoke_memfun_deref)
{
return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
std::declval<_Args>()...));
}
template<typename _Fn, typename _Tp>
constexpr bool __call_is_nt(__invoke_memobj_ref)
{
using _Up = typename __inv_unwrap<_Tp>::type;
return noexcept(std::declval<_Up>().*std::declval<_Fn>());
}
template<typename _Fn, typename _Tp>
constexpr bool __call_is_nt(__invoke_memobj_deref)
{
return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
}
template<typename _Fn, typename... _Args>
constexpr bool __call_is_nt(__invoke_other)
{
return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
}
template<typename _Result, typename _Fn, typename... _Args>
struct __call_is_nothrow
: __bool_constant<
std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
>
{ };
template<typename _Fn, typename... _Args>
using __call_is_nothrow_
= __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
template<typename _Fn, typename... _Args>
struct __is_nothrow_invocable
: __and_<__is_invocable<_Fn, _Args...>,
__call_is_nothrow_<_Fn, _Args...>>::type
{ };
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
struct __nonesuchbase {};
struct __nonesuch : private __nonesuchbase {
~__nonesuch() = delete;
__nonesuch(__nonesuch const&) = delete;
void operator=(__nonesuch const&) = delete;
};
#pragma GCC diagnostic pop
# 3455 "/usr/include/c++/10/type_traits" 3
}
# 58 "/usr/include/c++/10/bits/move.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 74 "/usr/include/c++/10/bits/move.h" 3
template<typename _Tp>
constexpr _Tp&&
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
{ return static_cast<_Tp&&>(__t); }
template<typename _Tp>
constexpr _Tp&&
forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
{
static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
" substituting _Tp is an lvalue reference type");
return static_cast<_Tp&&>(__t);
}
template<typename _Tp>
constexpr typename std::remove_reference<_Tp>::type&&
move(_Tp&& __t) noexcept
{ return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
template<typename _Tp>
struct __move_if_noexcept_cond
: public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
is_copy_constructible<_Tp>>::type { };
# 118 "/usr/include/c++/10/bits/move.h" 3
template<typename _Tp>
constexpr typename
conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
move_if_noexcept(_Tp& __x) noexcept
{ return std::move(__x); }
# 138 "/usr/include/c++/10/bits/move.h" 3
template<typename _Tp>
inline _Tp*
addressof(_Tp& __r) noexcept
{ return std::__addressof(__r); }
template<typename _Tp>
const _Tp* addressof(const _Tp&&) = delete;
template <typename _Tp, typename _Up = _Tp>
inline _Tp
__exchange(_Tp& __obj, _Up&& __new_val)
{
_Tp __old_val = std::move(__obj);
__obj = std::forward<_Up>(__new_val);
return __old_val;
}
# 179 "/usr/include/c++/10/bits/move.h" 3
template<typename _Tp>
inline
typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
is_move_constructible<_Tp>,
is_move_assignable<_Tp>>::value>::type
swap(_Tp& __a, _Tp& __b)
noexcept(__and_<is_nothrow_move_constructible<_Tp>, is_nothrow_move_assignable<_Tp>>::value)
{
_Tp __tmp = std::move(__a);
__a = std::move(__b);
__b = std::move(__tmp);
}
template<typename _Tp, size_t _Nm>
inline
typename enable_if<__is_swappable<_Tp>::value>::type
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
noexcept(__is_nothrow_swappable<_Tp>::value)
{
for (size_t __n = 0; __n < _Nm; ++__n)
swap(__a[__n], __b[__n]);
}
}
# 41 "/usr/include/c++/10/bits/nested_exception.h" 2 3
extern "C++" {
namespace std
{
class nested_exception
{
exception_ptr _M_ptr;
public:
nested_exception() noexcept : _M_ptr(current_exception()) { }
nested_exception(const nested_exception&) noexcept = default;
nested_exception& operator=(const nested_exception&) noexcept = default;
virtual ~nested_exception() noexcept;
[[noreturn]]
void
rethrow_nested() const
{
if (_M_ptr)
rethrow_exception(_M_ptr);
std::terminate();
}
exception_ptr
nested_ptr() const noexcept
{ return _M_ptr; }
};
template<typename _Except>
struct _Nested_exception : public _Except, public nested_exception
{
explicit _Nested_exception(const _Except& __ex)
: _Except(__ex)
{ }
explicit _Nested_exception(_Except&& __ex)
: _Except(static_cast<_Except&&>(__ex))
{ }
};
template<typename _Tp>
[[noreturn]]
inline void
__throw_with_nested_impl(_Tp&& __t, true_type)
{
using _Up = typename remove_reference<_Tp>::type;
throw _Nested_exception<_Up>{std::forward<_Tp>(__t)};
}
template<typename _Tp>
[[noreturn]]
inline void
__throw_with_nested_impl(_Tp&& __t, false_type)
{ throw std::forward<_Tp>(__t); }
template<typename _Tp>
[[noreturn]]
inline void
throw_with_nested(_Tp&& __t)
{
using _Up = typename decay<_Tp>::type;
using _CopyConstructible
= __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>;
static_assert(_CopyConstructible::value,
"throw_with_nested argument must be CopyConstructible");
using __nest = __and_<is_class<_Up>, __bool_constant<!__is_final(_Up)>,
__not_<is_base_of<nested_exception, _Up>>>;
std::__throw_with_nested_impl(std::forward<_Tp>(__t), __nest{});
}
template<typename _Tp>
using __rethrow_if_nested_cond = typename enable_if<
__and_<is_polymorphic<_Tp>,
__or_<__not_<is_base_of<nested_exception, _Tp>>,
is_convertible<_Tp*, nested_exception*>>>::value
>::type;
template<typename _Ex>
inline __rethrow_if_nested_cond<_Ex>
__rethrow_if_nested_impl(const _Ex* __ptr)
{
if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr))
__ne_ptr->rethrow_nested();
}
inline void
__rethrow_if_nested_impl(const void*)
{ }
template<typename _Ex>
inline void
rethrow_if_nested(const _Ex& __ex)
{ std::__rethrow_if_nested_impl(std::__addressof(__ex)); }
}
}
#pragma GCC visibility pop
# 149 "/usr/include/c++/10/exception" 2 3
# 42 "/usr/include/c++/10/new" 2 3
#pragma GCC visibility push(default)
extern "C++" {
namespace std
{
class bad_alloc : public exception
{
public:
bad_alloc() throw() { }
bad_alloc(const bad_alloc&) = default;
bad_alloc& operator=(const bad_alloc&) = default;
virtual ~bad_alloc() throw();
virtual const char* what() const throw();
};
class bad_array_new_length : public bad_alloc
{
public:
bad_array_new_length() throw() { }
virtual ~bad_array_new_length() throw();
virtual const char* what() const throw();
};
struct nothrow_t
{
explicit nothrow_t() = default;
};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler(new_handler) throw();
new_handler get_new_handler() noexcept;
}
# 126 "/usr/include/c++/10/new" 3
void* operator new(std::size_t)
__attribute__((__externally_visible__));
void* operator new[](std::size_t)
__attribute__((__externally_visible__));
void operator delete(void*) noexcept
__attribute__((__externally_visible__));
void operator delete[](void*) noexcept
__attribute__((__externally_visible__));
void operator delete(void*, std::size_t) noexcept
__attribute__((__externally_visible__));
void operator delete[](void*, std::size_t) noexcept
__attribute__((__externally_visible__));
void* operator new(std::size_t, const std::nothrow_t&) noexcept
__attribute__((__externally_visible__, __malloc__));
void* operator new[](std::size_t, const std::nothrow_t&) noexcept
__attribute__((__externally_visible__, __malloc__));
void operator delete(void*, const std::nothrow_t&) noexcept
__attribute__((__externally_visible__));
void operator delete[](void*, const std::nothrow_t&) noexcept
__attribute__((__externally_visible__));
# 174 "/usr/include/c++/10/new" 3
inline void* operator new(std::size_t, void* __p) noexcept
{ return __p; }
inline void* operator new[](std::size_t, void* __p) noexcept
{ return __p; }
inline void operator delete (void*, void*) noexcept { }
inline void operator delete[](void*, void*) noexcept { }
}
# 230 "/usr/include/c++/10/new" 3
#pragma GCC visibility pop
# 237 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/c++/10/utility" 1 3
# 58 "/usr/include/c++/10/utility" 3
# 59 "/usr/include/c++/10/utility" 3
# 69 "/usr/include/c++/10/utility" 3
# 1 "/usr/include/c++/10/bits/stl_relops.h" 1 3
# 67 "/usr/include/c++/10/bits/stl_relops.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
namespace rel_ops
{
# 85 "/usr/include/c++/10/bits/stl_relops.h" 3
template <class _Tp>
inline bool
operator!=(const _Tp& __x, const _Tp& __y)
{ return !(__x == __y); }
# 98 "/usr/include/c++/10/bits/stl_relops.h" 3
template <class _Tp>
inline bool
operator>(const _Tp& __x, const _Tp& __y)
{ return __y < __x; }
# 111 "/usr/include/c++/10/bits/stl_relops.h" 3
template <class _Tp>
inline bool
operator<=(const _Tp& __x, const _Tp& __y)
{ return !(__y < __x); }
# 124 "/usr/include/c++/10/bits/stl_relops.h" 3
template <class _Tp>
inline bool
operator>=(const _Tp& __x, const _Tp& __y)
{ return !(__x < __y); }
}
}
# 70 "/usr/include/c++/10/utility" 2 3
# 1 "/usr/include/c++/10/bits/stl_pair.h" 1 3
# 69 "/usr/include/c++/10/bits/stl_pair.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 80 "/usr/include/c++/10/bits/stl_pair.h" 3
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
constexpr piecewise_construct_t piecewise_construct =
piecewise_construct_t();
template<typename...>
class tuple;
template<std::size_t...>
struct _Index_tuple;
template <bool, typename _T1, typename _T2>
struct _PCC
{
template <typename _U1, typename _U2>
static constexpr bool _ConstructiblePair()
{
return __and_<is_constructible<_T1, const _U1&>,
is_constructible<_T2, const _U2&>>::value;
}
template <typename _U1, typename _U2>
static constexpr bool _ImplicitlyConvertiblePair()
{
return __and_<is_convertible<const _U1&, _T1>,
is_convertible<const _U2&, _T2>>::value;
}
template <typename _U1, typename _U2>
static constexpr bool _MoveConstructiblePair()
{
return __and_<is_constructible<_T1, _U1&&>,
is_constructible<_T2, _U2&&>>::value;
}
template <typename _U1, typename _U2>
static constexpr bool _ImplicitlyMoveConvertiblePair()
{
return __and_<is_convertible<_U1&&, _T1>,
is_convertible<_U2&&, _T2>>::value;
}
template <bool __implicit, typename _U1, typename _U2>
static constexpr bool _CopyMovePair()
{
using __do_converts = __and_<is_convertible<const _U1&, _T1>,
is_convertible<_U2&&, _T2>>;
using __converts = typename conditional<__implicit,
__do_converts,
__not_<__do_converts>>::type;
return __and_<is_constructible<_T1, const _U1&>,
is_constructible<_T2, _U2&&>,
__converts
>::value;
}
template <bool __implicit, typename _U1, typename _U2>
static constexpr bool _MoveCopyPair()
{
using __do_converts = __and_<is_convertible<_U1&&, _T1>,
is_convertible<const _U2&, _T2>>;
using __converts = typename conditional<__implicit,
__do_converts,
__not_<__do_converts>>::type;
return __and_<is_constructible<_T1, _U1&&>,
is_constructible<_T2, const _U2&&>,
__converts
>::value;
}
};
template <typename _T1, typename _T2>
struct _PCC<false, _T1, _T2>
{
template <typename _U1, typename _U2>
static constexpr bool _ConstructiblePair()
{
return false;
}
template <typename _U1, typename _U2>
static constexpr bool _ImplicitlyConvertiblePair()
{
return false;
}
template <typename _U1, typename _U2>
static constexpr bool _MoveConstructiblePair()
{
return false;
}
template <typename _U1, typename _U2>
static constexpr bool _ImplicitlyMoveConvertiblePair()
{
return false;
}
};
template<typename _U1, typename _U2> class __pair_base
{
template<typename _T1, typename _T2> friend struct pair;
__pair_base() = default;
~__pair_base() = default;
__pair_base(const __pair_base&) = default;
__pair_base& operator=(const __pair_base&) = delete;
};
# 210 "/usr/include/c++/10/bits/stl_pair.h" 3
template<typename _T1, typename _T2>
struct pair
: private __pair_base<_T1, _T2>
{
typedef _T1 first_type;
typedef _T2 second_type;
_T1 first;
_T2 second;
template <typename _U1 = _T1,
typename _U2 = _T2,
typename enable_if<__and_<
__is_implicitly_default_constructible<_U1>,
__is_implicitly_default_constructible<_U2>>
::value, bool>::type = true>
constexpr pair()
: first(), second() { }
template <typename _U1 = _T1,
typename _U2 = _T2,
typename enable_if<__and_<
is_default_constructible<_U1>,
is_default_constructible<_U2>,
__not_<
__and_<__is_implicitly_default_constructible<_U1>,
__is_implicitly_default_constructible<_U2>>>>
::value, bool>::type = false>
explicit constexpr pair()
: first(), second() { }
# 256 "/usr/include/c++/10/bits/stl_pair.h" 3
using _PCCP = _PCC<true, _T1, _T2>;
template<typename _U1 = _T1, typename _U2=_T2, typename
enable_if<_PCCP::template
_ConstructiblePair<_U1, _U2>()
&& _PCCP::template
_ImplicitlyConvertiblePair<_U1, _U2>(),
bool>::type=true>
constexpr pair(const _T1& __a, const _T2& __b)
: first(__a), second(__b) { }
template<typename _U1 = _T1, typename _U2=_T2, typename
enable_if<_PCCP::template
_ConstructiblePair<_U1, _U2>()
&& !_PCCP::template
_ImplicitlyConvertiblePair<_U1, _U2>(),
bool>::type=false>
explicit constexpr pair(const _T1& __a, const _T2& __b)
: first(__a), second(__b) { }
# 288 "/usr/include/c++/10/bits/stl_pair.h" 3
template <typename _U1, typename _U2>
using _PCCFP = _PCC<!is_same<_T1, _U1>::value
|| !is_same<_T2, _U2>::value,
_T1, _T2>;
template<typename _U1, typename _U2, typename
enable_if<_PCCFP<_U1, _U2>::template
_ConstructiblePair<_U1, _U2>()
&& _PCCFP<_U1, _U2>::template
_ImplicitlyConvertiblePair<_U1, _U2>(),
bool>::type=true>
constexpr pair(const pair<_U1, _U2>& __p)
: first(__p.first), second(__p.second) { }
template<typename _U1, typename _U2, typename
enable_if<_PCCFP<_U1, _U2>::template
_ConstructiblePair<_U1, _U2>()
&& !_PCCFP<_U1, _U2>::template
_ImplicitlyConvertiblePair<_U1, _U2>(),
bool>::type=false>
explicit constexpr pair(const pair<_U1, _U2>& __p)
: first(__p.first), second(__p.second) { }
constexpr pair(const pair&) = default;
constexpr pair(pair&&) = default;
template<typename _U1, typename
enable_if<_PCCP::template
_MoveCopyPair<true, _U1, _T2>(),
bool>::type=true>
constexpr pair(_U1&& __x, const _T2& __y)
: first(std::forward<_U1>(__x)), second(__y) { }
template<typename _U1, typename
enable_if<_PCCP::template
_MoveCopyPair<false, _U1, _T2>(),
bool>::type=false>
explicit constexpr pair(_U1&& __x, const _T2& __y)
: first(std::forward<_U1>(__x)), second(__y) { }
template<typename _U2, typename
enable_if<_PCCP::template
_CopyMovePair<true, _T1, _U2>(),
bool>::type=true>
constexpr pair(const _T1& __x, _U2&& __y)
: first(__x), second(std::forward<_U2>(__y)) { }
template<typename _U2, typename
enable_if<_PCCP::template
_CopyMovePair<false, _T1, _U2>(),
bool>::type=false>
explicit pair(const _T1& __x, _U2&& __y)
: first(__x), second(std::forward<_U2>(__y)) { }
template<typename _U1, typename _U2, typename
enable_if<_PCCP::template
_MoveConstructiblePair<_U1, _U2>()
&& _PCCP::template
_ImplicitlyMoveConvertiblePair<_U1, _U2>(),
bool>::type=true>
constexpr pair(_U1&& __x, _U2&& __y)
: first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
template<typename _U1, typename _U2, typename
enable_if<_PCCP::template
_MoveConstructiblePair<_U1, _U2>()
&& !_PCCP::template
_ImplicitlyMoveConvertiblePair<_U1, _U2>(),
bool>::type=false>
explicit constexpr pair(_U1&& __x, _U2&& __y)
: first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
template<typename _U1, typename _U2, typename
enable_if<_PCCFP<_U1, _U2>::template
_MoveConstructiblePair<_U1, _U2>()
&& _PCCFP<_U1, _U2>::template
_ImplicitlyMoveConvertiblePair<_U1, _U2>(),
bool>::type=true>
constexpr pair(pair<_U1, _U2>&& __p)
: first(std::forward<_U1>(__p.first)),
second(std::forward<_U2>(__p.second)) { }
template<typename _U1, typename _U2, typename
enable_if<_PCCFP<_U1, _U2>::template
_MoveConstructiblePair<_U1, _U2>()
&& !_PCCFP<_U1, _U2>::template
_ImplicitlyMoveConvertiblePair<_U1, _U2>(),
bool>::type=false>
explicit constexpr pair(pair<_U1, _U2>&& __p)
: first(std::forward<_U1>(__p.first)),
second(std::forward<_U2>(__p.second)) { }
template<typename... _Args1, typename... _Args2>
pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
pair&
operator=(typename conditional<
__and_<is_copy_assignable<_T1>,
is_copy_assignable<_T2>>::value,
const pair&, const __nonesuch&>::type __p)
{
first = __p.first;
second = __p.second;
return *this;
}
pair&
operator=(typename conditional<
__and_<is_move_assignable<_T1>,
is_move_assignable<_T2>>::value,
pair&&, __nonesuch&&>::type __p)
noexcept(__and_<is_nothrow_move_assignable<_T1>,
is_nothrow_move_assignable<_T2>>::value)
{
first = std::forward<first_type>(__p.first);
second = std::forward<second_type>(__p.second);
return *this;
}
template<typename _U1, typename _U2>
typename enable_if<__and_<is_assignable<_T1&, const _U1&>,
is_assignable<_T2&, const _U2&>>::value,
pair&>::type
operator=(const pair<_U1, _U2>& __p)
{
first = __p.first;
second = __p.second;
return *this;
}
template<typename _U1, typename _U2>
typename enable_if<__and_<is_assignable<_T1&, _U1&&>,
is_assignable<_T2&, _U2&&>>::value,
pair&>::type
operator=(pair<_U1, _U2>&& __p)
{
first = std::forward<_U1>(__p.first);
second = std::forward<_U2>(__p.second);
return *this;
}
void
swap(pair& __p)
noexcept(__and_<__is_nothrow_swappable<_T1>,
__is_nothrow_swappable<_T2>>::value)
{
using std::swap;
swap(first, __p.first);
swap(second, __p.second);
}
private:
template<typename... _Args1, std::size_t... _Indexes1,
typename... _Args2, std::size_t... _Indexes2>
pair(tuple<_Args1...>&, tuple<_Args2...>&,
_Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
};
# 464 "/usr/include/c++/10/bits/stl_pair.h" 3
template<typename _T1, typename _T2>
inline constexpr bool
operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __x.first == __y.first && __x.second == __y.second; }
# 487 "/usr/include/c++/10/bits/stl_pair.h" 3
template<typename _T1, typename _T2>
inline constexpr bool
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __x.first < __y.first
|| (!(__y.first < __x.first) && __x.second < __y.second); }
template<typename _T1, typename _T2>
inline constexpr bool
operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__x == __y); }
template<typename _T1, typename _T2>
inline constexpr bool
operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __y < __x; }
template<typename _T1, typename _T2>
inline constexpr bool
operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__y < __x); }
template<typename _T1, typename _T2>
inline constexpr bool
operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return !(__x < __y); }
# 524 "/usr/include/c++/10/bits/stl_pair.h" 3
template<typename _T1, typename _T2>
inline
typename enable_if<__and_<__is_swappable<_T1>,
__is_swappable<_T2>>::value>::type
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _T1, typename _T2>
typename enable_if<!__and_<__is_swappable<_T1>,
__is_swappable<_T2>>::value>::type
swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
# 564 "/usr/include/c++/10/bits/stl_pair.h" 3
template<typename _T1, typename _T2>
constexpr pair<typename __decay_and_strip<_T1>::__type,
typename __decay_and_strip<_T2>::__type>
make_pair(_T1&& __x, _T2&& __y)
{
typedef typename __decay_and_strip<_T1>::__type __ds_type1;
typedef typename __decay_and_strip<_T2>::__type __ds_type2;
typedef pair<__ds_type1, __ds_type2> __pair_type;
return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
}
# 583 "/usr/include/c++/10/bits/stl_pair.h" 3
}
# 71 "/usr/include/c++/10/utility" 2 3
# 1 "/usr/include/c++/10/initializer_list" 1 3
# 33 "/usr/include/c++/10/initializer_list" 3
# 34 "/usr/include/c++/10/initializer_list" 3
#pragma GCC visibility push(default)
namespace std
{
template<class _E>
class initializer_list
{
public:
typedef _E value_type;
typedef const _E& reference;
typedef const _E& const_reference;
typedef size_t size_type;
typedef const _E* iterator;
typedef const _E* const_iterator;
private:
iterator _M_array;
size_type _M_len;
constexpr initializer_list(const_iterator __a, size_type __l)
: _M_array(__a), _M_len(__l) { }
public:
constexpr initializer_list() noexcept
: _M_array(0), _M_len(0) { }
constexpr size_type
size() const noexcept { return _M_len; }
constexpr const_iterator
begin() const noexcept { return _M_array; }
constexpr const_iterator
end() const noexcept { return begin() + size(); }
};
template<class _Tp>
constexpr const _Tp*
begin(initializer_list<_Tp> __ils) noexcept
{ return __ils.begin(); }
template<class _Tp>
constexpr const _Tp*
end(initializer_list<_Tp> __ils) noexcept
{ return __ils.end(); }
}
#pragma GCC visibility pop
# 77 "/usr/include/c++/10/utility" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<typename _Tp>
struct tuple_size;
template<typename _Tp,
typename _Up = typename remove_cv<_Tp>::type,
typename = typename enable_if<is_same<_Tp, _Up>::value>::type,
size_t = tuple_size<_Tp>::value>
using __enable_if_has_tuple_size = _Tp;
template<typename _Tp>
struct tuple_size<const __enable_if_has_tuple_size<_Tp>>
: public tuple_size<_Tp> { };
template<typename _Tp>
struct tuple_size<volatile __enable_if_has_tuple_size<_Tp>>
: public tuple_size<_Tp> { };
template<typename _Tp>
struct tuple_size<const volatile __enable_if_has_tuple_size<_Tp>>
: public tuple_size<_Tp> { };
template<std::size_t __i, typename _Tp>
struct tuple_element;
template<std::size_t __i, typename _Tp>
using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
template<std::size_t __i, typename _Tp>
struct tuple_element<__i, const _Tp>
{
typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type;
};
template<std::size_t __i, typename _Tp>
struct tuple_element<__i, volatile _Tp>
{
typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type;
};
template<std::size_t __i, typename _Tp>
struct tuple_element<__i, const volatile _Tp>
{
typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type;
};
template<std::size_t __i, typename _Tp>
using tuple_element_t = typename tuple_element<__i, _Tp>::type;
template<typename _T1, typename _T2>
struct __is_tuple_like_impl<std::pair<_T1, _T2>> : true_type
{ };
template<class _Tp1, class _Tp2>
struct tuple_size<std::pair<_Tp1, _Tp2>>
: public integral_constant<std::size_t, 2> { };
template<class _Tp1, class _Tp2>
struct tuple_element<0, std::pair<_Tp1, _Tp2>>
{ typedef _Tp1 type; };
template<class _Tp1, class _Tp2>
struct tuple_element<1, std::pair<_Tp1, _Tp2>>
{ typedef _Tp2 type; };
template<std::size_t _Int>
struct __pair_get;
template<>
struct __pair_get<0>
{
template<typename _Tp1, typename _Tp2>
static constexpr _Tp1&
__get(std::pair<_Tp1, _Tp2>& __pair) noexcept
{ return __pair.first; }
template<typename _Tp1, typename _Tp2>
static constexpr _Tp1&&
__move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
{ return std::forward<_Tp1>(__pair.first); }
template<typename _Tp1, typename _Tp2>
static constexpr const _Tp1&
__const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
{ return __pair.first; }
template<typename _Tp1, typename _Tp2>
static constexpr const _Tp1&&
__const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
{ return std::forward<const _Tp1>(__pair.first); }
};
template<>
struct __pair_get<1>
{
template<typename _Tp1, typename _Tp2>
static constexpr _Tp2&
__get(std::pair<_Tp1, _Tp2>& __pair) noexcept
{ return __pair.second; }
template<typename _Tp1, typename _Tp2>
static constexpr _Tp2&&
__move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
{ return std::forward<_Tp2>(__pair.second); }
template<typename _Tp1, typename _Tp2>
static constexpr const _Tp2&
__const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
{ return __pair.second; }
template<typename _Tp1, typename _Tp2>
static constexpr const _Tp2&&
__const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
{ return std::forward<const _Tp2>(__pair.second); }
};
template<std::size_t _Int, class _Tp1, class _Tp2>
constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
get(std::pair<_Tp1, _Tp2>& __in) noexcept
{ return __pair_get<_Int>::__get(__in); }
template<std::size_t _Int, class _Tp1, class _Tp2>
constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
get(std::pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__move_get(std::move(__in)); }
template<std::size_t _Int, class _Tp1, class _Tp2>
constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
get(const std::pair<_Tp1, _Tp2>& __in) noexcept
{ return __pair_get<_Int>::__const_get(__in); }
template<std::size_t _Int, class _Tp1, class _Tp2>
constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__const_move_get(std::move(__in)); }
template <typename _Tp, typename _Up>
constexpr _Tp&
get(pair<_Tp, _Up>& __p) noexcept
{ return __p.first; }
template <typename _Tp, typename _Up>
constexpr const _Tp&
get(const pair<_Tp, _Up>& __p) noexcept
{ return __p.first; }
template <typename _Tp, typename _Up>
constexpr _Tp&&
get(pair<_Tp, _Up>&& __p) noexcept
{ return std::move(__p.first); }
template <typename _Tp, typename _Up>
constexpr const _Tp&&
get(const pair<_Tp, _Up>&& __p) noexcept
{ return std::move(__p.first); }
template <typename _Tp, typename _Up>
constexpr _Tp&
get(pair<_Up, _Tp>& __p) noexcept
{ return __p.second; }
template <typename _Tp, typename _Up>
constexpr const _Tp&
get(const pair<_Up, _Tp>& __p) noexcept
{ return __p.second; }
template <typename _Tp, typename _Up>
constexpr _Tp&&
get(pair<_Up, _Tp>&& __p) noexcept
{ return std::move(__p.second); }
template <typename _Tp, typename _Up>
constexpr const _Tp&&
get(const pair<_Up, _Tp>&& __p) noexcept
{ return std::move(__p.second); }
template <typename _Tp, typename _Up = _Tp>
inline _Tp
exchange(_Tp& __obj, _Up&& __new_val)
{ return std::__exchange(__obj, std::forward<_Up>(__new_val)); }
template<size_t... _Indexes> struct _Index_tuple { };
# 307 "/usr/include/c++/10/utility" 3
template<size_t _Num>
struct _Build_index_tuple
{
using __type = _Index_tuple<__integer_pack(_Num)...>;
};
template<typename _Tp, _Tp... _Idx>
struct integer_sequence
{
typedef _Tp value_type;
static constexpr size_t size() noexcept { return sizeof...(_Idx); }
};
template<typename _Tp, _Tp _Num>
using make_integer_sequence
= integer_sequence<_Tp, __integer_pack(_Num)...>;
template<size_t... _Idx>
using index_sequence = integer_sequence<size_t, _Idx...>;
template<size_t _Num>
using make_index_sequence = make_integer_sequence<size_t, _Num>;
template<typename... _Types>
using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
# 473 "/usr/include/c++/10/utility" 3
}
# 238 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 259 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/c++/10/stdlib.h" 1 3
# 36 "/usr/include/c++/10/stdlib.h" 3
# 1 "/usr/include/c++/10/cstdlib" 1 3
# 39 "/usr/include/c++/10/cstdlib" 3
# 40 "/usr/include/c++/10/cstdlib" 3
# 75 "/usr/include/c++/10/cstdlib" 3
# 1 "/usr/include/stdlib.h" 1 3 4
# 25 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 26 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 32 "/usr/include/stdlib.h" 2 3 4
extern "C" {
# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 52 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4
typedef enum
{
P_ALL,
P_PID,
P_PGID
} idtype_t;
# 40 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 55 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 75 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
# 87 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
typedef __float128 _Float128;
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 214 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
typedef float _Float32;
# 251 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
typedef double _Float64;
# 268 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
typedef double _Float32x;
# 285 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
typedef long double _Float64x;
# 121 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 56 "/usr/include/stdlib.h" 2 3 4
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
# 97 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) throw () ;
extern double atof (const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
extern float strtof (const char *__restrict __nptr,
char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));
extern long double strtold (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
# 140 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
extern _Float64 strtof64 (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
extern _Float128 strtof128 (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
extern _Float32x strtof32x (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
extern _Float64x strtof64x (const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1)));
# 176 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
extern unsigned long int strtoul (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoll (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1)));
extern int strfromd (char *__dest, size_t __size, const char *__format,
double __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfromf (char *__dest, size_t __size, const char *__format,
float __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfroml (char *__dest, size_t __size, const char *__format,
long double __f)
throw () __attribute__ ((__nonnull__ (3)));
# 232 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
_Float32 __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfromf64 (char *__dest, size_t __size, const char * __format,
_Float64 __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfromf128 (char *__dest, size_t __size, const char * __format,
_Float128 __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfromf32x (char *__dest, size_t __size, const char * __format,
_Float32x __f)
throw () __attribute__ ((__nonnull__ (3)));
extern int strfromf64x (char *__dest, size_t __size, const char * __format,
_Float64x __f)
throw () __attribute__ ((__nonnull__ (3)));
# 274 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
char **__restrict __endptr, int __base,
locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4)));
extern unsigned long int strtoul_l (const char *__restrict __nptr,
char **__restrict __endptr,
int __base, locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4)));
__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
char **__restrict __endptr, int __base,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4)));
__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
char **__restrict __endptr,
int __base, locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4)));
extern double strtod_l (const char *__restrict __nptr,
char **__restrict __endptr, locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern float strtof_l (const char *__restrict __nptr,
char **__restrict __endptr, locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern long double strtold_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
# 316 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern _Float64 strtof64_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern _Float128 strtof128_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern _Float32x strtof32x_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
extern _Float64x strtof64x_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3)));
# 360 "/usr/include/stdlib.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) atoi (const char *__nptr) throw ()
{
return (int) strtol (__nptr, (char **) __null, 10);
}
extern __inline __attribute__ ((__gnu_inline__)) long int
__attribute__ ((__leaf__)) atol (const char *__nptr) throw ()
{
return strtol (__nptr, (char **) __null, 10);
}
__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
__attribute__ ((__leaf__)) atoll (const char *__nptr) throw ()
{
return strtoll (__nptr, (char **) __null, 10);
}
# 385 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) throw () ;
extern long int a64l (const char *__s)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 401 "/usr/include/stdlib.h" 3 4
extern long int random (void) throw ();
extern void srandom (unsigned int __seed) throw ();
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
throw () __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf)
throw () __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) throw ();
extern void srand (unsigned int __seed) throw ();
extern int rand_r (unsigned int *__seed) throw ();
extern double drand48 (void) throw ();
extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) throw ();
extern long int nrand48 (unsigned short int __xsubi[3])
throw () __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) throw ();
extern long int jrand48 (unsigned short int __xsubi[3])
throw () __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) throw ();
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
throw () __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
__extension__ unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
throw () __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern void *calloc (size_t __nmemb, size_t __size)
throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;
extern void *realloc (void *__ptr, size_t __size)
throw () __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));
extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
throw () __attribute__ ((__warn_unused_result__))
__attribute__ ((__alloc_size__ (2, 3)));
extern void free (void *__ptr) throw ();
# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4
extern "C" {
extern void *alloca (size_t __size) throw ();
}
# 569 "/usr/include/stdlib.h" 2 3 4
extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
throw () __attribute__ ((__nonnull__ (1))) ;
extern void *aligned_alloc (size_t __alignment, size_t __size)
throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
extern void abort (void) throw () __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
extern "C++" int at_quick_exit (void (*__func) (void))
throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
# 610 "/usr/include/stdlib.h" 3 4
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
throw () __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) throw () __attribute__ ((__noreturn__));
extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
extern char *getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
extern char *secure_getenv (const char *__name)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
extern int setenv (const char *__name, const char *__value, int __replace)
throw () __attribute__ ((__nonnull__ (2)));
extern int unsetenv (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) throw ();
# 675 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));
# 688 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 710 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps64 (char *__template, int __suffixlen)
__attribute__ ((__nonnull__ (1))) ;
# 731 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
# 742 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 762 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 774 "/usr/include/stdlib.h" 3 4
extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 784 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
extern char *canonicalize_file_name (const char *__name)
throw () __attribute__ ((__nonnull__ (1))) ;
# 800 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
char *__restrict __resolved) throw () ;
typedef int (*__compar_fn_t) (const void *, const void *);
typedef __compar_fn_t comparison_fn_t;
typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
extern void *bsearch (const void *__key, const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) void *
bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar)
{
size_t __l, __u, __idx;
const void *__p;
int __comparison;
__l = 0;
__u = __nmemb;
while (__l < __u)
{
__idx = (__l + __u) / 2;
__p = (void *) (((const char *) __base) + (__idx * __size));
__comparison = (*__compar) (__key, __p);
if (__comparison < 0)
__u = __idx;
else if (__comparison > 0)
__l = __idx + 1;
else
return (void *) __p;
}
return __null;
}
# 826 "/usr/include/stdlib.h" 2 3 4
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
__compar_d_fn_t __compar, void *__arg)
__attribute__ ((__nonnull__ (1, 4)));
extern int abs (int __x) throw () __attribute__ ((__const__)) ;
extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
throw () __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
throw () __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
throw () __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
throw () __attribute__ ((__const__)) ;
# 872 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *gcvt (double __value, int __ndigit, char *__buf)
throw () __attribute__ ((__nonnull__ (3))) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
throw () __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (const char *__s, size_t __n) throw ();
extern int mbtowc (wchar_t *__restrict __pwc,
const char *__restrict __s, size_t __n) throw ();
extern int wctomb (char *__s, wchar_t __wchar) throw ();
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
const char *__restrict __s, size_t __n) throw ();
extern size_t wcstombs (char *__restrict __s,
const wchar_t *__restrict __pwcs, size_t __n)
throw ();
extern int rpmatch (const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
# 957 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
char *const *__restrict __tokens,
char **__restrict __valuep)
throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
extern int posix_openpt (int __oflag) ;
extern int grantpt (int __fd) throw ();
extern int unlockpt (int __fd) throw ();
extern char *ptsname (int __fd) throw () ;
extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
throw () __attribute__ ((__nonnull__ (2)));
extern int getpt (void);
extern int getloadavg (double __loadavg[], int __nelem)
throw () __attribute__ ((__nonnull__ (1)));
# 1013 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) double
__attribute__ ((__leaf__)) atof (const char *__nptr) throw ()
{
return strtod (__nptr, (char **) __null);
}
# 1014 "/usr/include/stdlib.h" 2 3 4
# 1023 "/usr/include/stdlib.h" 3 4
}
# 76 "/usr/include/c++/10/cstdlib" 2 3
# 1 "/usr/include/c++/10/bits/std_abs.h" 1 3
# 33 "/usr/include/c++/10/bits/std_abs.h" 3
# 34 "/usr/include/c++/10/bits/std_abs.h" 3
# 46 "/usr/include/c++/10/bits/std_abs.h" 3
extern "C++"
{
namespace std __attribute__ ((__visibility__ ("default")))
{
using ::abs;
inline long
abs(long __i) { return __builtin_labs(__i); }
inline long long
abs(long long __x) { return __builtin_llabs (__x); }
# 70 "/usr/include/c++/10/bits/std_abs.h" 3
inline constexpr double
abs(double __x)
{ return __builtin_fabs(__x); }
inline constexpr float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline constexpr long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
inline constexpr __int128
abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
# 101 "/usr/include/c++/10/bits/std_abs.h" 3
inline constexpr
__float128
abs(__float128 __x)
{ return __x < 0 ? -__x : __x; }
}
}
# 78 "/usr/include/c++/10/cstdlib" 2 3
# 121 "/usr/include/c++/10/cstdlib" 3
extern "C++"
{
namespace std __attribute__ ((__visibility__ ("default")))
{
using ::div_t;
using ::ldiv_t;
using ::abort;
using ::atexit;
using ::at_quick_exit;
using ::atof;
using ::atoi;
using ::atol;
using ::bsearch;
using ::calloc;
using ::div;
using ::exit;
using ::free;
using ::getenv;
using ::labs;
using ::ldiv;
using ::malloc;
using ::mblen;
using ::mbstowcs;
using ::mbtowc;
using ::qsort;
using ::quick_exit;
using ::rand;
using ::realloc;
using ::srand;
using ::strtod;
using ::strtol;
using ::strtoul;
using ::system;
using ::wcstombs;
using ::wctomb;
inline ldiv_t
div(long __i, long __j) { return ldiv(__i, __j); }
}
# 195 "/usr/include/c++/10/cstdlib" 3
namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
using ::lldiv_t;
using ::_Exit;
using ::llabs;
inline lldiv_t
div(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
using ::lldiv;
# 227 "/usr/include/c++/10/cstdlib" 3
using ::atoll;
using ::strtoll;
using ::strtoull;
using ::strtof;
using ::strtold;
}
namespace std
{
using ::__gnu_cxx::lldiv_t;
using ::__gnu_cxx::_Exit;
using ::__gnu_cxx::llabs;
using ::__gnu_cxx::div;
using ::__gnu_cxx::lldiv;
using ::__gnu_cxx::atoll;
using ::__gnu_cxx::strtof;
using ::__gnu_cxx::strtoll;
using ::__gnu_cxx::strtoull;
using ::__gnu_cxx::strtold;
}
}
# 37 "/usr/include/c++/10/stdlib.h" 2 3
using std::abort;
using std::atexit;
using std::exit;
using std::at_quick_exit;
using std::quick_exit;
using std::div_t;
using std::ldiv_t;
using std::abs;
using std::atof;
using std::atoi;
using std::atol;
using std::bsearch;
using std::calloc;
using std::div;
using std::free;
using std::getenv;
using std::labs;
using std::ldiv;
using std::malloc;
using std::mblen;
using std::mbstowcs;
using std::mbtowc;
using std::qsort;
using std::rand;
using std::realloc;
using std::srand;
using std::strtod;
using std::strtol;
using std::strtoul;
using std::system;
using std::wcstombs;
using std::wctomb;
# 260 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/c++/10/cstdlib" 1 3
# 39 "/usr/include/c++/10/cstdlib" 3
# 40 "/usr/include/c++/10/cstdlib" 3
# 268 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 295 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4
extern "C" {
# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));
extern int euidaccess (const char *__name, int __type)
throw () __attribute__ ((__nonnull__ (1)));
extern int eaccess (const char *__name, int __type)
throw () __attribute__ ((__nonnull__ (1)));
extern int faccessat (int __fd, const char *__file, int __type, int __flag)
throw () __attribute__ ((__nonnull__ (2))) ;
# 334 "/usr/include/unistd.h" 3 4
extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
# 345 "/usr/include/unistd.h" 3 4
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
throw ();
extern int close (int __fd);
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
extern ssize_t write (int __fd, const void *__buf, size_t __n) ;
# 376 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
__off_t __offset) ;
extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
__off_t __offset) ;
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
__off64_t __offset) ;
extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
__off64_t __offset) ;
extern int pipe (int __pipedes[2]) throw () ;
extern int pipe2 (int __pipedes[2], int __flags) throw () ;
# 432 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) throw ();
# 444 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
throw ();
extern int usleep (__useconds_t __useconds);
# 469 "/usr/include/unistd.h" 3 4
extern int pause (void);
extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ;
extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int fchownat (int __fd, const char *__file, __uid_t __owner,
__gid_t __group, int __flag)
throw () __attribute__ ((__nonnull__ (2))) ;
extern int chdir (const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
extern int fchdir (int __fd) throw () ;
# 511 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) throw () ;
extern char *get_current_dir_name (void) throw ();
extern char *getwd (char *__buf)
throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
extern int dup (int __fd) throw () ;
extern int dup2 (int __fd, int __fd2) throw ();
extern int dup3 (int __fd, int __fd2, int __flags) throw ();
extern char **__environ;
extern char **environ;
extern int execve (const char *__path, char *const __argv[],
char *const __envp[]) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
throw () __attribute__ ((__nonnull__ (2)));
extern int execv (const char *__path, char *const __argv[])
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int execle (const char *__path, const char *__arg, ...)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int execl (const char *__path, const char *__arg, ...)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int execvp (const char *__file, char *const __argv[])
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int execlp (const char *__file, const char *__arg, ...)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int execvpe (const char *__file, char *const __argv[],
char *const __envp[])
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int nice (int __inc) throw () ;
extern void _exit (int __status) __attribute__ ((__noreturn__));
# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
{
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_MAX_INPUT,
_PC_NAME_MAX,
_PC_PATH_MAX,
_PC_PIPE_BUF,
_PC_CHOWN_RESTRICTED,
_PC_NO_TRUNC,
_PC_VDISABLE,
_PC_SYNC_IO,
_PC_ASYNC_IO,
_PC_PRIO_IO,
_PC_SOCK_MAXBUF,
_PC_FILESIZEBITS,
_PC_REC_INCR_XFER_SIZE,
_PC_REC_MAX_XFER_SIZE,
_PC_REC_MIN_XFER_SIZE,
_PC_REC_XFER_ALIGN,
_PC_ALLOC_SIZE_MIN,
_PC_SYMLINK_MAX,
_PC_2_SYMLINKS
};
enum
{
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_CLK_TCK,
_SC_NGROUPS_MAX,
_SC_OPEN_MAX,
_SC_STREAM_MAX,
_SC_TZNAME_MAX,
_SC_JOB_CONTROL,
_SC_SAVED_IDS,
_SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING,
_SC_TIMERS,
_SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO,
_SC_SYNCHRONIZED_IO,
_SC_FSYNC,
_SC_MAPPED_FILES,
_SC_MEMLOCK,
_SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION,
_SC_MESSAGE_PASSING,
_SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS,
_SC_AIO_LISTIO_MAX,
_SC_AIO_MAX,
_SC_AIO_PRIO_DELTA_MAX,
_SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX,
_SC_VERSION,
_SC_PAGESIZE,
_SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX,
_SC_SEM_VALUE_MAX,
_SC_SIGQUEUE_MAX,
_SC_TIMER_MAX,
_SC_BC_BASE_MAX,
_SC_BC_DIM_MAX,
_SC_BC_SCALE_MAX,
_SC_BC_STRING_MAX,
_SC_COLL_WEIGHTS_MAX,
_SC_EQUIV_CLASS_MAX,
_SC_EXPR_NEST_MAX,
_SC_LINE_MAX,
_SC_RE_DUP_MAX,
_SC_CHARCLASS_NAME_MAX,
_SC_2_VERSION,
_SC_2_C_BIND,
_SC_2_C_DEV,
_SC_2_FORT_DEV,
_SC_2_FORT_RUN,
_SC_2_SW_DEV,
_SC_2_LOCALEDEF,
_SC_PII,
_SC_PII_XTI,
_SC_PII_SOCKET,
_SC_PII_INTERNET,
_SC_PII_OSI,
_SC_POLL,
_SC_SELECT,
_SC_UIO_MAXIOV,
_SC_IOV_MAX = _SC_UIO_MAXIOV,
_SC_PII_INTERNET_STREAM,
_SC_PII_INTERNET_DGRAM,
_SC_PII_OSI_COTS,
_SC_PII_OSI_CLTS,
_SC_PII_OSI_M,
_SC_T_IOV_MAX,
_SC_THREADS,
_SC_THREAD_SAFE_FUNCTIONS,
_SC_GETGR_R_SIZE_MAX,
_SC_GETPW_R_SIZE_MAX,
_SC_LOGIN_NAME_MAX,
_SC_TTY_NAME_MAX,
_SC_THREAD_DESTRUCTOR_ITERATIONS,
_SC_THREAD_KEYS_MAX,
_SC_THREAD_STACK_MIN,
_SC_THREAD_THREADS_MAX,
_SC_THREAD_ATTR_STACKADDR,
_SC_THREAD_ATTR_STACKSIZE,
_SC_THREAD_PRIORITY_SCHEDULING,
_SC_THREAD_PRIO_INHERIT,
_SC_THREAD_PRIO_PROTECT,
_SC_THREAD_PROCESS_SHARED,
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PHYS_PAGES,
_SC_AVPHYS_PAGES,
_SC_ATEXIT_MAX,
_SC_PASS_MAX,
_SC_XOPEN_VERSION,
_SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX,
_SC_XOPEN_CRYPT,
_SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM,
_SC_2_CHAR_TERM,
_SC_2_C_VERSION,
_SC_2_UPE,
_SC_XOPEN_XPG2,
_SC_XOPEN_XPG3,
_SC_XOPEN_XPG4,
_SC_CHAR_BIT,
_SC_CHAR_MAX,
_SC_CHAR_MIN,
_SC_INT_MAX,
_SC_INT_MIN,
_SC_LONG_BIT,
_SC_WORD_BIT,
_SC_MB_LEN_MAX,
_SC_NZERO,
_SC_SSIZE_MAX,
_SC_SCHAR_MAX,
_SC_SCHAR_MIN,
_SC_SHRT_MAX,
_SC_SHRT_MIN,
_SC_UCHAR_MAX,
_SC_UINT_MAX,
_SC_ULONG_MAX,
_SC_USHRT_MAX,
_SC_NL_ARGMAX,
_SC_NL_LANGMAX,
_SC_NL_MSGMAX,
_SC_NL_NMAX,
_SC_NL_SETMAX,
_SC_NL_TEXTMAX,
_SC_XBS5_ILP32_OFF32,
_SC_XBS5_ILP32_OFFBIG,
_SC_XBS5_LP64_OFF64,
_SC_XBS5_LPBIG_OFFBIG,
_SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME,
_SC_XOPEN_REALTIME_THREADS,
_SC_ADVISORY_INFO,
_SC_BARRIERS,
_SC_BASE,
_SC_C_LANG_SUPPORT,
_SC_C_LANG_SUPPORT_R,
_SC_CLOCK_SELECTION,
_SC_CPUTIME,
_SC_THREAD_CPUTIME,
_SC_DEVICE_IO,
_SC_DEVICE_SPECIFIC,
_SC_DEVICE_SPECIFIC_R,
_SC_FD_MGMT,
_SC_FIFO,
_SC_PIPE,
_SC_FILE_ATTRIBUTES,
_SC_FILE_LOCKING,
_SC_FILE_SYSTEM,
_SC_MONOTONIC_CLOCK,
_SC_MULTI_PROCESS,
_SC_SINGLE_PROCESS,
_SC_NETWORKING,
_SC_READER_WRITER_LOCKS,
_SC_SPIN_LOCKS,
_SC_REGEXP,
_SC_REGEX_VERSION,
_SC_SHELL,
_SC_SIGNALS,
_SC_SPAWN,
_SC_SPORADIC_SERVER,
_SC_THREAD_SPORADIC_SERVER,
_SC_SYSTEM_DATABASE,
_SC_SYSTEM_DATABASE_R,
_SC_TIMEOUTS,
_SC_TYPED_MEMORY_OBJECTS,
_SC_USER_GROUPS,
_SC_USER_GROUPS_R,
_SC_2_PBS,
_SC_2_PBS_ACCOUNTING,
_SC_2_PBS_LOCATE,
_SC_2_PBS_MESSAGE,
_SC_2_PBS_TRACK,
_SC_SYMLOOP_MAX,
_SC_STREAMS,
_SC_2_PBS_CHECKPOINT,
_SC_V6_ILP32_OFF32,
_SC_V6_ILP32_OFFBIG,
_SC_V6_LP64_OFF64,
_SC_V6_LPBIG_OFFBIG,
_SC_HOST_NAME_MAX,
_SC_TRACE,
_SC_TRACE_EVENT_FILTER,
_SC_TRACE_INHERIT,
_SC_TRACE_LOG,
_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC,
_SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE,
_SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC,
_SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE,
_SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE,
_SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC,
_SC_LEVEL4_CACHE_LINESIZE,
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
_SC_RAW_SOCKETS,
_SC_V7_ILP32_OFF32,
_SC_V7_ILP32_OFFBIG,
_SC_V7_LP64_OFF64,
_SC_V7_LPBIG_OFFBIG,
_SC_SS_REPL_MAX,
_SC_TRACE_EVENT_NAME_MAX,
_SC_TRACE_NAME_MAX,
_SC_TRACE_SYS_MAX,
_SC_TRACE_USER_EVENT_MAX,
_SC_XOPEN_STREAMS,
_SC_THREAD_ROBUST_PRIO_INHERIT,
_SC_THREAD_ROBUST_PRIO_PROTECT
};
enum
{
_CS_PATH,
_CS_V6_WIDTH_RESTRICTED_ENVS,
_CS_GNU_LIBC_VERSION,
_CS_GNU_LIBPTHREAD_VERSION,
_CS_V5_WIDTH_RESTRICTED_ENVS,
_CS_V7_WIDTH_RESTRICTED_ENVS,
_CS_LFS_CFLAGS = 1000,
_CS_LFS_LDFLAGS,
_CS_LFS_LIBS,
_CS_LFS_LINTFLAGS,
_CS_LFS64_CFLAGS,
_CS_LFS64_LDFLAGS,
_CS_LFS64_LIBS,
_CS_LFS64_LINTFLAGS,
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
_CS_XBS5_ILP32_OFF32_LDFLAGS,
_CS_XBS5_ILP32_OFF32_LIBS,
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
_CS_XBS5_ILP32_OFFBIG_LIBS,
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
_CS_XBS5_LP64_OFF64_CFLAGS,
_CS_XBS5_LP64_OFF64_LDFLAGS,
_CS_XBS5_LP64_OFF64_LIBS,
_CS_XBS5_LP64_OFF64_LINTFLAGS,
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LIBS,
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LIBS,
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
_CS_POSIX_V6_LP64_OFF64_LIBS,
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LIBS,
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
_CS_POSIX_V7_LP64_OFF64_LIBS,
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
_CS_V6_ENV,
_CS_V7_ENV
};
# 610 "/usr/include/unistd.h" 2 3 4
extern long int pathconf (const char *__path, int __name)
throw () __attribute__ ((__nonnull__ (1)));
extern long int fpathconf (int __fd, int __name) throw ();
extern long int sysconf (int __name) throw ();
extern size_t confstr (int __name, char *__buf, size_t __len) throw ();
extern __pid_t getpid (void) throw ();
extern __pid_t getppid (void) throw ();
extern __pid_t getpgrp (void) throw ();
extern __pid_t __getpgid (__pid_t __pid) throw ();
extern __pid_t getpgid (__pid_t __pid) throw ();
extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
# 660 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) throw ();
extern __pid_t setsid (void) throw ();
extern __pid_t getsid (__pid_t __pid) throw ();
extern __uid_t getuid (void) throw ();
extern __uid_t geteuid (void) throw ();
extern __gid_t getgid (void) throw ();
extern __gid_t getegid (void) throw ();
extern int getgroups (int __size, __gid_t __list[]) throw () ;
extern int group_member (__gid_t __gid) throw ();
extern int setuid (__uid_t __uid) throw () ;
extern int setreuid (__uid_t __ruid, __uid_t __euid) throw () ;
extern int seteuid (__uid_t __uid) throw () ;
extern int setgid (__gid_t __gid) throw () ;
extern int setregid (__gid_t __rgid, __gid_t __egid) throw () ;
extern int setegid (__gid_t __gid) throw () ;
extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
throw ();
extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
throw ();
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
throw () ;
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
throw () ;
extern __pid_t fork (void) throw ();
extern __pid_t vfork (void) throw ();
extern char *ttyname (int __fd) throw ();
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
throw () __attribute__ ((__nonnull__ (2))) ;
extern int isatty (int __fd) throw ();
extern int ttyslot (void) throw ();
extern int link (const char *__from, const char *__to)
throw () __attribute__ ((__nonnull__ (1, 2))) ;
extern int linkat (int __fromfd, const char *__from, int __tofd,
const char *__to, int __flags)
throw () __attribute__ ((__nonnull__ (2, 4))) ;
extern int symlink (const char *__from, const char *__to)
throw () __attribute__ ((__nonnull__ (1, 2))) ;
extern ssize_t readlink (const char *__restrict __path,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (1, 2))) ;
extern int symlinkat (const char *__from, int __tofd,
const char *__to) throw () __attribute__ ((__nonnull__ (1, 3))) ;
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (2, 3))) ;
extern int unlink (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
extern int unlinkat (int __fd, const char *__name, int __flag)
throw () __attribute__ ((__nonnull__ (2)));
extern int rmdir (const char *__path) throw () __attribute__ ((__nonnull__ (1)));
extern __pid_t tcgetpgrp (int __fd) throw ();
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();
extern char *getlogin (void);
extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
extern int setlogin (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern "C" {
extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;
extern int opterr;
extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
throw () __attribute__ ((__nonnull__ (2, 3)));
}
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4
extern "C" {
# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
}
# 870 "/usr/include/unistd.h" 2 3 4
extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1)));
extern int sethostname (const char *__name, size_t __len)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int sethostid (long int __id) throw () ;
extern int getdomainname (char *__name, size_t __len)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int setdomainname (const char *__name, size_t __len)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int vhangup (void) throw ();
extern int revoke (const char *__file) throw () __attribute__ ((__nonnull__ (1))) ;
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale)
throw () __attribute__ ((__nonnull__ (1)));
extern int acct (const char *__name) throw ();
extern char *getusershell (void) throw ();
extern void endusershell (void) throw ();
extern void setusershell (void) throw ();
extern int daemon (int __nochdir, int __noclose) throw () ;
extern int chroot (const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
extern int fsync (int __fd);
extern int syncfs (int __fd) throw ();
extern long int gethostid (void);
extern void sync (void) throw ();
extern int getpagesize (void) throw () __attribute__ ((__const__));
extern int getdtablesize (void) throw ();
# 991 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off_t __length)
throw () __attribute__ ((__nonnull__ (1))) ;
# 1003 "/usr/include/unistd.h" 3 4
extern int truncate64 (const char *__file, __off64_t __length)
throw () __attribute__ ((__nonnull__ (1))) ;
# 1014 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off_t __length) throw () ;
# 1024 "/usr/include/unistd.h" 3 4
extern int ftruncate64 (int __fd, __off64_t __length) throw () ;
# 1035 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) throw () ;
extern void *sbrk (intptr_t __delta) throw ();
# 1056 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) throw ();
# 1079 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off_t __len) ;
# 1089 "/usr/include/unistd.h" 3 4
extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1107 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
int __outfd, __off64_t *__poutoff,
size_t __length, unsigned int __flags);
extern int fdatasync (int __fildes);
# 1124 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern void swab (const void *__restrict __from, void *__restrict __to,
ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
# 1161 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length) ;
# 1170 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) throw ();
# 1171 "/usr/include/unistd.h" 2 3 4
}
# 296 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/param.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/param.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/syslimits.h" 1 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4
# 195 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 183 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 184 "/usr/include/limits.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 188 "/usr/include/limits.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 192 "/usr/include/limits.h" 2 3 4
# 196 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/10/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4
extern "C" {
# 1 "/usr/include/x86_64-linux-gnu/bits/signum.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/signum.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/signum.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4
typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
int sival_int;
void *sival_ptr;
};
typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
{
int si_signo;
int si_errno;
int si_code;
int __pad0;
union
{
int _pad[((128 / sizeof (int)) - 4)];
struct
{
__pid_t si_pid;
__uid_t si_uid;
} _kill;
struct
{
int si_tid;
int si_overrun;
__sigval_t si_sigval;
} _timer;
struct
{
__pid_t si_pid;
__uid_t si_uid;
__sigval_t si_sigval;
} _rt;
struct
{
__pid_t si_pid;
__uid_t si_uid;
int si_status;
__clock_t si_utime;
__clock_t si_stime;
} _sigchld;
struct
{
void *si_addr;
short int si_addr_lsb;
union
{
struct
{
void *_lower;
void *_upper;
} _addr_bnd;
__uint32_t _pkey;
} _bounds;
} _sigfault;
struct
{
long int si_band;
int si_fd;
} _sigpoll;
struct
{
void *_call_addr;
int _syscall;
unsigned int _arch;
} _sigsys;
} _sifields;
} siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
SI_ASYNCNL = -60,
SI_DETHREAD = -7,
SI_TKILL,
SI_SIGIO,
SI_ASYNCIO,
SI_MESGQ,
SI_TIMER,
SI_QUEUE,
SI_USER,
SI_KERNEL = 0x80
# 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};
enum
{
ILL_ILLOPC = 1,
ILL_ILLOPN,
ILL_ILLADR,
ILL_ILLTRP,
ILL_PRVOPC,
ILL_PRVREG,
ILL_COPROC,
ILL_BADSTK,
ILL_BADIADDR
};
enum
{
FPE_INTDIV = 1,
FPE_INTOVF,
FPE_FLTDIV,
FPE_FLTOVF,
FPE_FLTUND,
FPE_FLTRES,
FPE_FLTINV,
FPE_FLTSUB,
FPE_FLTUNK = 14,
FPE_CONDTRAP
};
enum
{
SEGV_MAPERR = 1,
SEGV_ACCERR,
SEGV_BNDERR,
SEGV_PKUERR,
SEGV_ACCADI,
SEGV_ADIDERR,
SEGV_ADIPERR
};
enum
{
BUS_ADRALN = 1,
BUS_ADRERR,
BUS_OBJERR,
BUS_MCEERR_AR,
BUS_MCEERR_AO
};
enum
{
TRAP_BRKPT = 1,
TRAP_TRACE,
TRAP_BRANCH,
TRAP_HWBKPT,
TRAP_UNK
};
enum
{
CLD_EXITED = 1,
CLD_KILLED,
CLD_DUMPED,
CLD_TRAPPED,
CLD_STOPPED,
CLD_CONTINUED
};
enum
{
POLL_IN = 1,
POLL_OUT,
POLL_MSG,
POLL_ERR,
POLL_PRI,
POLL_HUP
};
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4
# 210 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
{
__sigval_t sigev_value;
int sigev_signo;
int sigev_notify;
union
{
int _pad[((64 / sizeof (int)) - 4)];
__pid_t _tid;
struct
{
void (*_function) (__sigval_t);
pthread_attr_t *_attribute;
} _sigev_thread;
} _sigev_un;
} sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
SIGEV_SIGNAL = 0,
SIGEV_NONE,
SIGEV_THREAD,
SIGEV_THREAD_ID = 4
};
# 68 "/usr/include/signal.h" 2 3 4
typedef void (*__sighandler_t) (int);
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
throw ();
extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
throw ();
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
throw ();
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) throw ();
extern int killpg (__pid_t __pgrp, int __sig) throw ();
extern int raise (int __sig) throw ();
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
throw ();
extern int gsignal (int __sig) throw ();
extern void psignal (int __sig, const char *__s);
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
# 170 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) throw () __attribute__ ((__deprecated__));
extern int sigsetmask (int __mask) throw () __attribute__ ((__deprecated__));
extern int siggetmask (void) throw () __attribute__ ((__deprecated__));
# 185 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;
typedef __sighandler_t sig_t;
extern int sigemptyset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
extern int sigfillset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
extern int sigaddset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
extern int sigdelset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
extern int sigismember (const sigset_t *__set, int __signo)
throw () __attribute__ ((__nonnull__ (1)));
extern int sigisemptyset (const sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
extern int sigandset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
extern int sigorset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
{
union
{
__sighandler_t sa_handler;
void (*sa_sigaction) (int, siginfo_t *, void *);
}
__sigaction_handler;
__sigset_t sa_mask;
int sa_flags;
void (*sa_restorer) (void);
};
# 227 "/usr/include/signal.h" 2 3 4
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
sigset_t *__restrict __oset) throw ();
extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) throw ();
extern int sigpending (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
__attribute__ ((__nonnull__ (1, 2)));
extern int sigwaitinfo (const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
extern int sigtimedwait (const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
const struct timespec *__restrict __timeout)
__attribute__ ((__nonnull__ (1)));
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
throw ();
# 286 "/usr/include/signal.h" 3 4
extern const char *const _sys_siglist[(64 + 1)];
extern const char *const sys_siglist[(64 + 1)];
# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
__uint32_t magic1;
__uint32_t extended_size;
__uint64_t xstate_bv;
__uint32_t xstate_size;
__uint32_t __glibc_reserved1[7];
};
struct _fpreg
{
unsigned short significand[4];
unsigned short exponent;
};
struct _fpxreg
{
unsigned short significand[4];
unsigned short exponent;
unsigned short __glibc_reserved1[3];
};
struct _xmmreg
{
__uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _fpxreg _st[8];
struct _xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
struct sigcontext
{
__uint64_t r8;
__uint64_t r9;
__uint64_t r10;
__uint64_t r11;
__uint64_t r12;
__uint64_t r13;
__uint64_t r14;
__uint64_t r15;
__uint64_t rdi;
__uint64_t rsi;
__uint64_t rbp;
__uint64_t rbx;
__uint64_t rdx;
__uint64_t rax;
__uint64_t rcx;
__uint64_t rsp;
__uint64_t rip;
__uint64_t eflags;
unsigned short cs;
unsigned short gs;
unsigned short fs;
unsigned short __pad0;
__uint64_t err;
__uint64_t trapno;
__uint64_t oldmask;
__uint64_t cr2;
__extension__ union
{
struct _fpstate * fpstate;
__uint64_t __fpstate_word;
};
__uint64_t __reserved1 [8];
};
struct _xsave_hdr
{
__uint64_t xstate_bv;
__uint64_t __glibc_reserved1[2];
__uint64_t __glibc_reserved2[5];
};
struct _ymmh_state
{
__uint32_t ymmh_space[64];
};
struct _xstate
{
struct _fpstate fpstate;
struct _xsave_hdr xstate_hdr;
struct _ymmh_state ymmh;
};
# 292 "/usr/include/signal.h" 2 3 4
extern int sigreturn (struct sigcontext *__scp) throw ();
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 302 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4
typedef struct
{
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
# 304 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];
enum
{
REG_R8 = 0,
REG_R9,
REG_R10,
REG_R11,
REG_R12,
REG_R13,
REG_R14,
REG_R15,
REG_RDI,
REG_RSI,
REG_RBP,
REG_RBX,
REG_RDX,
REG_RAX,
REG_RCX,
REG_RSP,
REG_RIP,
REG_EFL,
REG_CSGSFS,
REG_ERR,
REG_TRAPNO,
REG_OLDMASK,
REG_CR2
};
struct _libc_fpxreg
{
unsigned short int significand[4];
unsigned short int exponent;
unsigned short int __glibc_reserved1[3];
};
struct _libc_xmmreg
{
__uint32_t element[4];
};
struct _libc_fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
typedef struct _libc_fpstate *fpregset_t;
typedef struct
{
gregset_t gregs;
fpregset_t fpregs;
__extension__ unsigned long long __reserved1 [8];
} mcontext_t;
typedef struct ucontext_t
{
unsigned long int uc_flags;
struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
__extension__ unsigned long long int __ssp[4];
} ucontext_t;
# 307 "/usr/include/signal.h" 2 3 4
extern int siginterrupt (int __sig, int __interrupt) throw ();
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 317 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
SS_ONSTACK = 1,
SS_DISABLE
};
# 318 "/usr/include/signal.h" 2 3 4
extern int sigaltstack (const stack_t *__restrict __ss,
stack_t *__restrict __oss) throw ();
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
{
void *ss_sp;
int ss_onstack;
};
# 328 "/usr/include/signal.h" 2 3 4
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
throw () __attribute__ ((__deprecated__));
extern int sighold (int __sig) throw ();
extern int sigrelse (int __sig) throw ();
extern int sigignore (int __sig) throw ();
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw ();
# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
const __sigset_t *__restrict __newmask,
__sigset_t *__restrict __oldmask)throw ();
extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
extern int pthread_sigqueue (pthread_t __threadid, int __signo,
const union sigval __value) throw ();
# 360 "/usr/include/signal.h" 2 3 4
extern int __libc_current_sigrtmin (void) throw ();
extern int __libc_current_sigrtmax (void) throw ();
# 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 375 "/usr/include/signal.h" 2 3 4
}
# 29 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/param.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/param.h" 3 4
# 1 "/usr/include/linux/param.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/param.h" 1 3 4
# 1 "/usr/include/asm-generic/param.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/param.h" 2 3 4
# 6 "/usr/include/linux/param.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/param.h" 2 3 4
# 32 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4
# 300 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4
# 307 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 337 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern "C" {
# 52 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
struct timezone
{
int tz_minuteswest;
int tz_dsttime;
};
# 66 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int gettimeofday (struct timeval *__restrict __tv,
void *__restrict __tz) throw () __attribute__ ((__nonnull__ (1)));
extern int settimeofday (const struct timeval *__tv,
const struct timezone *__tz)
throw ();
extern int adjtime (const struct timeval *__delta,
struct timeval *__olddelta) throw ();
enum __itimer_which
{
ITIMER_REAL = 0,
ITIMER_VIRTUAL = 1,
ITIMER_PROF = 2
};
struct itimerval
{
struct timeval it_interval;
struct timeval it_value;
};
typedef int __itimer_which_t;
extern int getitimer (__itimer_which_t __which,
struct itimerval *__value) throw ();
extern int setitimer (__itimer_which_t __which,
const struct itimerval *__restrict __new,
struct itimerval *__restrict __old) throw ();
extern int utimes (const char *__file, const struct timeval __tvp[2])
throw () __attribute__ ((__nonnull__ (1)));
extern int lutimes (const char *__file, const struct timeval __tvp[2])
throw () __attribute__ ((__nonnull__ (1)));
extern int futimes (int __fd, const struct timeval __tvp[2]) throw ();
extern int futimesat (int __fd, const char *__file,
const struct timeval __tvp[2]) throw ();
# 187 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
}
# 338 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/time.h" 1 3 4
# 29 "/usr/include/time.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 30 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4
# 73 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timex.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4
struct timex
{
unsigned int modes;
__syscall_slong_t offset;
__syscall_slong_t freq;
__syscall_slong_t maxerror;
__syscall_slong_t esterror;
int status;
__syscall_slong_t constant;
__syscall_slong_t precision;
__syscall_slong_t tolerance;
struct timeval time;
__syscall_slong_t tick;
__syscall_slong_t ppsfreq;
__syscall_slong_t jitter;
int shift;
__syscall_slong_t stabil;
__syscall_slong_t jitcnt;
__syscall_slong_t calcnt;
__syscall_slong_t errcnt;
__syscall_slong_t stbcnt;
int tai;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32;
};
# 74 "/usr/include/x86_64-linux-gnu/bits/time.h" 2 3 4
extern "C" {
extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) throw ();
}
# 34 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h" 1 3 4
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int tm_gmtoff;
const char *tm_zone;
};
# 40 "/usr/include/time.h" 2 3 4
# 48 "/usr/include/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h" 1 3 4
struct itimerspec
{
struct timespec it_interval;
struct timespec it_value;
};
# 49 "/usr/include/time.h" 2 3 4
struct sigevent;
# 68 "/usr/include/time.h" 3 4
extern "C" {
extern clock_t clock (void) throw ();
extern time_t time (time_t *__timer) throw ();
extern double difftime (time_t __time1, time_t __time0)
throw () __attribute__ ((__const__));
extern time_t mktime (struct tm *__tp) throw ();
extern size_t strftime (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp) throw ();
extern char *strptime (const char *__restrict __s,
const char *__restrict __fmt, struct tm *__tp)
throw ();
extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp,
locale_t __loc) throw ();
extern char *strptime_l (const char *__restrict __s,
const char *__restrict __fmt, struct tm *__tp,
locale_t __loc) throw ();
extern struct tm *gmtime (const time_t *__timer) throw ();
extern struct tm *localtime (const time_t *__timer) throw ();
extern struct tm *gmtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) throw ();
extern struct tm *localtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) throw ();
extern char *asctime (const struct tm *__tp) throw ();
extern char *ctime (const time_t *__timer) throw ();
extern char *asctime_r (const struct tm *__restrict __tp,
char *__restrict __buf) throw ();
extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) throw ();
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
extern char *tzname[2];
extern void tzset (void) throw ();
extern int daylight;
extern long int timezone;
# 190 "/usr/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) throw ();
extern time_t timelocal (struct tm *__tp) throw ();
extern int dysize (int __year) throw () __attribute__ ((__const__));
# 205 "/usr/include/time.h" 3 4
extern int nanosleep (const struct timespec *__requested_time,
struct timespec *__remaining);
extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
throw ();
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
const struct timespec *__req,
struct timespec *__rem);
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
extern int timer_create (clockid_t __clock_id,
struct sigevent *__restrict __evp,
timer_t *__restrict __timerid) throw ();
extern int timer_delete (timer_t __timerid) throw ();
extern int timer_settime (timer_t __timerid, int __flags,
const struct itimerspec *__restrict __value,
struct itimerspec *__restrict __ovalue) throw ();
extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
throw ();
extern int timer_getoverrun (timer_t __timerid) throw ();
extern int timespec_get (struct timespec *__ts, int __base)
throw () __attribute__ ((__nonnull__ (1)));
# 274 "/usr/include/time.h" 3 4
extern int getdate_err;
# 283 "/usr/include/time.h" 3 4
extern struct tm *getdate (const char *__string);
# 297 "/usr/include/time.h" 3 4
extern int getdate_r (const char *__restrict __string,
struct tm *__restrict __resbufp);
}
# 339 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 350 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4
extern "C" {
# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
{
short int l_type;
short int l_whence;
__off_t l_start;
__off_t l_len;
__pid_t l_pid;
};
struct flock64
{
short int l_type;
short int l_whence;
__off64_t l_start;
__off64_t l_len;
__pid_t l_pid;
};
# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4
struct iovec
{
void *iov_base;
size_t iov_len;
};
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
{
F_OWNER_TID = 0,
F_OWNER_PID,
F_OWNER_PGRP,
F_OWNER_GID = F_OWNER_PGRP
};
struct f_owner_ex
{
enum __pid_type type;
__pid_t pid;
};
# 353 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
struct file_handle
{
unsigned int handle_bytes;
int handle_type;
unsigned char f_handle[0];
};
# 392 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern "C" {
extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
throw ();
extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
size_t __count, unsigned int __flags);
extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
__off64_t *__offout, size_t __len,
unsigned int __flags);
extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
unsigned int __flags);
extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
# 447 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
__off64_t __len);
extern int name_to_handle_at (int __dfd, const char *__name,
struct file_handle *__handle, int *__mnt_id,
int __flags) throw ();
extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
int __flags);
}
# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 46 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
struct stat
{
__dev_t st_dev;
__ino_t st_ino;
__nlink_t st_nlink;
__mode_t st_mode;
__uid_t st_uid;
__gid_t st_gid;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt_t st_blocks;
# 91 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 106 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
__syscall_slong_t __glibc_reserved[3];
# 115 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
};
struct stat64
{
__dev_t st_dev;
__ino64_t st_ino;
__nlink_t st_nlink;
__mode_t st_mode;
__uid_t st_uid;
__gid_t st_gid;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt64_t st_blocks;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 164 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
__syscall_slong_t __glibc_reserved[3];
};
# 79 "/usr/include/fcntl.h" 2 3 4
# 148 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...);
# 157 "/usr/include/fcntl.h" 3 4
extern int fcntl64 (int __fd, int __cmd, ...);
# 168 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 178 "/usr/include/fcntl.h" 3 4
extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 192 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...)
__attribute__ ((__nonnull__ (2)));
# 203 "/usr/include/fcntl.h" 3 4
extern int openat64 (int __fd, const char *__file, int __oflag, ...)
__attribute__ ((__nonnull__ (2)));
# 214 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 224 "/usr/include/fcntl.h" 3 4
extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 260 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, off_t __offset, off_t __len,
int __advise) throw ();
# 272 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
int __advise) throw ();
# 282 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, off_t __offset, off_t __len);
# 293 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 304 "/usr/include/fcntl.h" 3 4
}
# 351 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 397 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern "C" {
# 77 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 100 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 121 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
int __options);
struct rusage;
extern __pid_t wait3 (int *__stat_loc, int __options,
struct rusage * __usage) throw ();
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
struct rusage *__usage) throw ();
}
# 398 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 428 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/mman.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/mman.h" 2 3 4
# 41 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mman.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/mman.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mman-map-flags-generic.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/mman.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 1 3 4
# 113 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mman-shared.h" 1 3 4
# 46 "/usr/include/x86_64-linux-gnu/bits/mman-shared.h" 3 4
extern "C" {
int memfd_create (const char *__name, unsigned int __flags) throw ();
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) throw ();
int pkey_alloc (unsigned int __flags, unsigned int __access_rights) throw ();
int pkey_set (int __key, unsigned int __access_rights) throw ();
int pkey_get (int __key) throw ();
int pkey_free (int __key) throw ();
int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) throw ();
}
# 114 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 2 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/mman.h" 2 3 4
# 42 "/usr/include/x86_64-linux-gnu/sys/mman.h" 2 3 4
extern "C" {
# 57 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4
extern void *mmap (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off_t __offset) throw ();
# 70 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4
extern void *mmap64 (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off64_t __offset) throw ();
extern int munmap (void *__addr, size_t __len) throw ();
extern int mprotect (void *__addr, size_t __len, int __prot) throw ();
extern int msync (void *__addr, size_t __len, int __flags);
extern int madvise (void *__addr, size_t __len, int __advice) throw ();
extern int posix_madvise (void *__addr, size_t __len, int __advice) throw ();
extern int mlock (const void *__addr, size_t __len) throw ();
extern int munlock (const void *__addr, size_t __len) throw ();
extern int mlockall (int __flags) throw ();
extern int munlockall (void) throw ();
extern int mincore (void *__start, size_t __len, unsigned char *__vec)
throw ();
# 133 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4
extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
int __flags, ...) throw ();
extern int remap_file_pages (void *__start, size_t __size, int __prot,
size_t __pgoff, int __flags) throw ();
extern int shm_open (const char *__name, int __oflag, mode_t __mode);
extern int shm_unlink (const char *__name);
}
# 429 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/resource.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/resource.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
enum __rlimit_resource
{
RLIMIT_CPU = 0,
RLIMIT_FSIZE = 1,
RLIMIT_DATA = 2,
RLIMIT_STACK = 3,
RLIMIT_CORE = 4,
__RLIMIT_RSS = 5,
RLIMIT_NOFILE = 7,
__RLIMIT_OFILE = RLIMIT_NOFILE,
RLIMIT_AS = 9,
__RLIMIT_NPROC = 6,
__RLIMIT_MEMLOCK = 8,
__RLIMIT_LOCKS = 10,
__RLIMIT_SIGPENDING = 11,
__RLIMIT_MSGQUEUE = 12,
__RLIMIT_NICE = 13,
__RLIMIT_RTPRIO = 14,
__RLIMIT_RTTIME = 15,
__RLIMIT_NLIMITS = 16,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
};
# 131 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
typedef __rlim_t rlim_t;
typedef __rlim64_t rlim64_t;
struct rlimit
{
rlim_t rlim_cur;
rlim_t rlim_max;
};
struct rlimit64
{
rlim64_t rlim_cur;
rlim64_t rlim_max;
};
enum __rusage_who
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1
,
RUSAGE_THREAD = 1
};
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 3 4
struct rusage
{
struct timeval ru_utime;
struct timeval ru_stime;
__extension__ union
{
long int ru_maxrss;
__syscall_slong_t __ru_maxrss_word;
};
__extension__ union
{
long int ru_ixrss;
__syscall_slong_t __ru_ixrss_word;
};
__extension__ union
{
long int ru_idrss;
__syscall_slong_t __ru_idrss_word;
};
__extension__ union
{
long int ru_isrss;
__syscall_slong_t __ru_isrss_word;
};
__extension__ union
{
long int ru_minflt;
__syscall_slong_t __ru_minflt_word;
};
__extension__ union
{
long int ru_majflt;
__syscall_slong_t __ru_majflt_word;
};
__extension__ union
{
long int ru_nswap;
__syscall_slong_t __ru_nswap_word;
};
__extension__ union
{
long int ru_inblock;
__syscall_slong_t __ru_inblock_word;
};
__extension__ union
{
long int ru_oublock;
__syscall_slong_t __ru_oublock_word;
};
__extension__ union
{
long int ru_msgsnd;
__syscall_slong_t __ru_msgsnd_word;
};
__extension__ union
{
long int ru_msgrcv;
__syscall_slong_t __ru_msgrcv_word;
};
__extension__ union
{
long int ru_nsignals;
__syscall_slong_t __ru_nsignals_word;
};
__extension__ union
{
long int ru_nvcsw;
__syscall_slong_t __ru_nvcsw_word;
};
__extension__ union
{
long int ru_nivcsw;
__syscall_slong_t __ru_nivcsw_word;
};
};
# 180 "/usr/include/x86_64-linux-gnu/bits/resource.h" 2 3 4
enum __priority_which
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2
};
extern "C" {
extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
const struct rlimit *__new_limit,
struct rlimit *__old_limit) throw ();
# 217 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
const struct rlimit64 *__new_limit,
struct rlimit64 *__old_limit) throw ();
}
# 25 "/usr/include/x86_64-linux-gnu/sys/resource.h" 2 3 4
extern "C" {
# 42 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
typedef int __rlimit_resource_t;
typedef int __rusage_who_t;
typedef int __priority_which_t;
extern int getrlimit (__rlimit_resource_t __resource,
struct rlimit *__rlimits) throw ();
# 61 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
extern int getrlimit64 (__rlimit_resource_t __resource,
struct rlimit64 *__rlimits) throw ();
extern int setrlimit (__rlimit_resource_t __resource,
const struct rlimit *__rlimits) throw ();
# 81 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
extern int setrlimit64 (__rlimit_resource_t __resource,
const struct rlimit64 *__rlimits) throw ();
extern int getrusage (__rusage_who_t __who, struct rusage *__usage) throw ();
extern int getpriority (__priority_which_t __which, id_t __who) throw ();
extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
throw ();
}
# 441 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/times.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/sys/times.h" 3 4
extern "C" {
struct tms
{
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
};
extern clock_t times (struct tms *__buffer) throw ();
}
# 445 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
extern "C" {
# 521 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
}
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4
typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;
typedef signed char int_fast8_t;
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 2 3 4
# 526 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/inttypes.h" 1 3 4
# 266 "/usr/include/inttypes.h" 3 4
extern "C" {
typedef struct
{
long int quot;
long int rem;
} imaxdiv_t;
# 290 "/usr/include/inttypes.h" 3 4
extern intmax_t imaxabs (intmax_t __n) throw () __attribute__ ((__const__));
extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
throw () __attribute__ ((__const__));
extern intmax_t strtoimax (const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw ();
extern uintmax_t strtoumax (const char *__restrict __nptr,
char ** __restrict __endptr, int __base) throw ();
extern intmax_t wcstoimax (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base)
throw ();
extern uintmax_t wcstoumax (const wchar_t *__restrict __nptr,
wchar_t ** __restrict __endptr, int __base)
throw ();
extern long int __strtol_internal (const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern __inline __attribute__ ((__gnu_inline__)) intmax_t
__attribute__ ((__leaf__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) throw ()
{
return __strtol_internal (nptr, endptr, base, 0);
}
extern unsigned long int __strtoul_internal (const char *__restrict __nptr,
char ** __restrict __endptr,
int __base, int __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
__attribute__ ((__leaf__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) throw ()
{
return __strtoul_internal (nptr, endptr, base, 0);
}
extern long int __wcstol_internal (const wchar_t * __restrict __nptr,
wchar_t **__restrict __endptr,
int __base, int __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern __inline __attribute__ ((__gnu_inline__)) intmax_t
__attribute__ ((__leaf__)) wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()
{
return __wcstol_internal (nptr, endptr, base, 0);
}
extern unsigned long int __wcstoul_internal (const wchar_t *
__restrict __nptr,
wchar_t **
__restrict __endptr,
int __base, int __group)
throw () __attribute__ ((__nonnull__ (1))) ;
extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
__attribute__ ((__leaf__)) wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()
{
return __wcstoul_internal (nptr, endptr, base, 0);
}
# 432 "/usr/include/inttypes.h" 3 4
}
# 530 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 533 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
extern "C" {
# 576 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
}
# 599 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern "C" {
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 205 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file,
struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) throw () __attribute__ ((__nonnull__ (2)));
# 224 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
struct stat64 *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) throw () __attribute__ ((__nonnull__ (2)));
extern int fstatat (int __fd, const char *__restrict __file,
struct stat *__restrict __buf, int __flag)
throw () __attribute__ ((__nonnull__ (2, 3)));
# 249 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
struct stat64 *__restrict __buf, int __flag)
throw () __attribute__ ((__nonnull__ (2, 3)));
extern int lstat (const char *__restrict __file,
struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
# 272 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat64 (const char *__restrict __file,
struct stat64 *__restrict __buf)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int chmod (const char *__file, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (1)));
extern int lchmod (const char *__file, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (1)));
extern int fchmod (int __fd, __mode_t __mode) throw ();
extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
int __flag)
throw () __attribute__ ((__nonnull__ (2))) ;
extern __mode_t umask (__mode_t __mask) throw ();
extern __mode_t getumask (void) throw ();
extern int mkdir (const char *__path, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (1)));
extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (2)));
extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
throw () __attribute__ ((__nonnull__ (1)));
extern int mknodat (int __fd, const char *__path, __mode_t __mode,
__dev_t __dev) throw () __attribute__ ((__nonnull__ (2)));
extern int mkfifo (const char *__path, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (1)));
extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
throw () __attribute__ ((__nonnull__ (2)));
extern int utimensat (int __fd, const char *__path,
const struct timespec __times[2],
int __flags)
throw () __attribute__ ((__nonnull__ (2)));
extern int futimens (int __fd, const struct timespec __times[2]) throw ();
# 395 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
throw () __attribute__ ((__nonnull__ (3)));
extern int __xstat (int __ver, const char *__filename,
struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
extern int __lxstat (int __ver, const char *__filename,
struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
extern int __fxstatat (int __ver, int __fildes, const char *__filename,
struct stat *__stat_buf, int __flag)
throw () __attribute__ ((__nonnull__ (3, 4)));
# 428 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
throw () __attribute__ ((__nonnull__ (3)));
extern int __xstat64 (int __ver, const char *__filename,
struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
extern int __lxstat64 (int __ver, const char *__filename,
struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
struct stat64 *__stat_buf, int __flag)
throw () __attribute__ ((__nonnull__ (3, 4)));
extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
__dev_t *__dev) throw () __attribute__ ((__nonnull__ (2, 4)));
extern int __xmknodat (int __ver, int __fd, const char *__path,
__mode_t __mode, __dev_t *__dev)
throw () __attribute__ ((__nonnull__ (3, 5)));
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4
# 1 "/usr/include/linux/types.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4
# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4
# 1 "/usr/include/linux/posix_types.h" 1 3 4
# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;
typedef void (*__kernel_sighandler_t)(int);
typedef int __kernel_key_t;
typedef int __kernel_mqd_t;
# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
typedef unsigned long __kernel_old_dev_t;
# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;
typedef __kernel_ulong_t __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef int __kernel_pid_t;
typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
typedef __kernel_long_t __kernel_suseconds_t;
typedef int __kernel_daddr_t;
typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;
typedef struct {
int val[2];
} __kernel_fsid_t;
typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;
typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
__s64 tv_sec;
__u32 tv_nsec;
__s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {
__u32 stx_mask;
__u32 stx_blksize;
__u64 stx_attributes;
__u32 stx_nlink;
__u32 stx_uid;
__u32 stx_gid;
__u16 stx_mode;
__u16 __spare0[1];
__u64 stx_ino;
__u64 stx_size;
__u64 stx_blocks;
__u64 stx_attributes_mask;
struct statx_timestamp stx_atime;
struct statx_timestamp stx_btime;
struct statx_timestamp stx_ctime;
struct statx_timestamp stx_mtime;
__u32 stx_rdev_major;
__u32 stx_rdev_minor;
__u32 stx_dev_major;
__u32 stx_dev_minor;
__u64 __spare2[14];
};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
extern "C" {
int statx (int __dirfd, const char *__restrict __path, int __flags,
unsigned int __mask, struct statx *__restrict __buf)
throw () __attribute__ ((__nonnull__ (2, 5)));
}
# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 447 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) stat (const char *__path, struct stat *__statbuf) throw ()
{
return __xstat (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) lstat (const char *__path, struct stat *__statbuf) throw ()
{
return __lxstat (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) fstat (int __fd, struct stat *__statbuf) throw ()
{
return __fxstat (1, __fd, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag) throw ()
{
return __fxstatat (1, __fd, __filename, __statbuf, __flag);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) mknod (const char *__path, __mode_t __mode, __dev_t __dev) throw ()
{
return __xmknod (0, __path, __mode, &__dev);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev) throw ()
{
return __xmknodat (0, __fd, __path, __mode, &__dev);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) stat64 (const char *__path, struct stat64 *__statbuf) throw ()
{
return __xstat64 (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) lstat64 (const char *__path, struct stat64 *__statbuf) throw ()
{
return __lxstat64 (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) fstat64 (int __fd, struct stat64 *__statbuf) throw ()
{
return __fxstat64 (1, __fd, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, int __flag) throw ()
{
return __fxstatat64 (1, __fd, __filename, __statbuf, __flag);
}
}
# 600 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 671 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" 1
# 29 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 1
# 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h"
# 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h"
extern "C" {
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" 1
# 40 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 2
typedef unsigned int hashval_t;
typedef hashval_t (*htab_hash) (const void *);
typedef int (*htab_eq) (const void *, const void *);
typedef void (*htab_del) (void *);
typedef int (*htab_trav) (void **, void *);
typedef void *(*htab_alloc) (size_t, size_t);
typedef void (*htab_free) (void *);
typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t);
typedef void (*htab_free_with_arg) (void *, void *);
# 95 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h"
struct htab {
htab_hash hash_f;
htab_eq eq_f;
htab_del del_f;
void **entries;
size_t size;
size_t n_elements;
size_t n_deleted;
unsigned int searches;
unsigned int collisions;
htab_alloc alloc_f;
htab_free free_f;
void *alloc_arg;
htab_alloc_with_arg alloc_with_arg_f;
htab_free_with_arg free_with_arg_f;
unsigned int size_prime_index;
};
typedef struct htab *htab_t;
enum insert_option {NO_INSERT, INSERT};
extern htab_t htab_create_alloc (size_t, htab_hash,
htab_eq, htab_del,
htab_alloc, htab_free);
extern htab_t htab_create_alloc_ex (size_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del,
htab_alloc, htab_alloc, htab_free);
extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del);
extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del);
extern void htab_set_functions_ex (htab_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern void htab_delete (htab_t);
extern void htab_empty (htab_t);
extern void * htab_find (htab_t, const void *);
extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
extern void ** htab_find_slot_with_hash (htab_t, const void *,
hashval_t, enum insert_option);
extern void htab_clear_slot (htab_t, void **);
extern void htab_remove_elt (htab_t, const void *);
extern void htab_remove_elt_with_hash (htab_t, const void *, hashval_t);
extern void htab_traverse (htab_t, htab_trav, void *);
extern void htab_traverse_noresize (htab_t, htab_trav, void *);
extern size_t htab_size (htab_t);
extern size_t htab_elements (htab_t);
extern double htab_collisions (htab_t);
extern htab_hash htab_hash_pointer;
extern htab_eq htab_eq_pointer;
extern hashval_t htab_hash_string (const void *);
extern hashval_t iterative_hash (const void *, size_t, hashval_t);
}
# 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" 2
extern "C" {
# 84 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h"
extern int filename_cmp (const char *s1, const char *s2);
extern int filename_ncmp (const char *s1, const char *s2,
size_t n);
extern hashval_t filename_hash (const void *s);
extern int filename_eq (const void *s1, const void *s2);
extern int canonical_filename_eq (const char *a, const char *b);
}
# 672 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 683 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/usr/include/dlfcn.h" 1 3 4
# 24 "/usr/include/dlfcn.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 25 "/usr/include/dlfcn.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 1 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 3 4
extern "C" {
extern void _dl_mcount_wrapper_check (void *__selfpc) throw ();
}
# 28 "/usr/include/dlfcn.h" 2 3 4
# 44 "/usr/include/dlfcn.h" 3 4
typedef long int Lmid_t;
extern "C" {
extern void *dlopen (const char *__file, int __mode) throw ();
extern int dlclose (void *__handle) throw () __attribute__ ((__nonnull__ (1)));
extern void *dlsym (void *__restrict __handle,
const char *__restrict __name) throw () __attribute__ ((__nonnull__ (2)));
extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) throw ();
extern void *dlvsym (void *__restrict __handle,
const char *__restrict __name,
const char *__restrict __version)
throw () __attribute__ ((__nonnull__ (2, 3)));
extern char *dlerror (void) throw ();
typedef struct
{
const char *dli_fname;
void *dli_fbase;
const char *dli_sname;
void *dli_saddr;
} Dl_info;
extern int dladdr (const void *__address, Dl_info *__info)
throw () __attribute__ ((__nonnull__ (2)));
extern int dladdr1 (const void *__address, Dl_info *__info,
void **__extra_info, int __flags) throw () __attribute__ ((__nonnull__ (2)));
enum
{
RTLD_DL_SYMENT = 1,
RTLD_DL_LINKMAP = 2
};
extern int dlinfo (void *__restrict __handle,
int __request, void *__restrict __arg)
throw () __attribute__ ((__nonnull__ (1, 3)));
enum
{
RTLD_DI_LMID = 1,
RTLD_DI_LINKMAP = 2,
RTLD_DI_CONFIGADDR = 3,
RTLD_DI_SERINFO = 4,
RTLD_DI_SERINFOSIZE = 5,
RTLD_DI_ORIGIN = 6,
RTLD_DI_PROFILENAME = 7,
RTLD_DI_PROFILEOUT = 8,
RTLD_DI_TLS_MODID = 9,
RTLD_DI_TLS_DATA = 10,
RTLD_DI_MAX = 10
};
typedef struct
{
char *dls_name;
unsigned int dls_flags;
} Dl_serpath;
typedef struct
{
size_t dls_size;
unsigned int dls_cnt;
__extension__ union
{
Dl_serpath dls_serpath[0];
Dl_serpath __dls_serpath_pad[1];
};
} Dl_serinfo;
}
# 684 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/usr/include/x86_64-linux-gnu/gmp.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
# 1 "/usr/include/c++/10/iosfwd" 1 3 4
# 36 "/usr/include/c++/10/iosfwd" 3 4
# 37 "/usr/include/c++/10/iosfwd" 3
# 1 "/usr/include/c++/10/bits/stringfwd.h" 1 3
# 37 "/usr/include/c++/10/bits/stringfwd.h" 3
# 38 "/usr/include/c++/10/bits/stringfwd.h" 3
# 1 "/usr/include/c++/10/bits/memoryfwd.h" 1 3
# 46 "/usr/include/c++/10/bits/memoryfwd.h" 3
# 47 "/usr/include/c++/10/bits/memoryfwd.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 63 "/usr/include/c++/10/bits/memoryfwd.h" 3
template<typename>
class allocator;
template<>
class allocator<void>;
template<typename, typename>
struct uses_allocator;
}
# 41 "/usr/include/c++/10/bits/stringfwd.h" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
template<class _CharT>
struct char_traits;
template<> struct char_traits<char>;
template<> struct char_traits<wchar_t>;
template<> struct char_traits<char16_t>;
template<> struct char_traits<char32_t>;
namespace __cxx11 {
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
}
typedef basic_string<char> string;
typedef basic_string<wchar_t> wstring;
# 93 "/usr/include/c++/10/bits/stringfwd.h" 3
typedef basic_string<char16_t> u16string;
typedef basic_string<char32_t> u32string;
}
# 40 "/usr/include/c++/10/iosfwd" 2 3
# 1 "/usr/include/c++/10/bits/postypes.h" 1 3
# 38 "/usr/include/c++/10/bits/postypes.h" 3
# 39 "/usr/include/c++/10/bits/postypes.h" 3
# 1 "/usr/include/c++/10/cwchar" 1 3
# 39 "/usr/include/c++/10/cwchar" 3
# 40 "/usr/include/c++/10/cwchar" 3
# 1 "/usr/include/wchar.h" 1 3 4
# 27 "/usr/include/wchar.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/wchar.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 36 "/usr/include/wchar.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/wint_t.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/types/wint_t.h" 3 4
typedef unsigned int wint_t;
# 42 "/usr/include/wchar.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h" 1 3 4
typedef __mbstate_t mbstate_t;
# 43 "/usr/include/wchar.h" 2 3 4
# 79 "/usr/include/wchar.h" 3 4
extern "C" {
struct tm;
extern wchar_t *wcscpy (wchar_t *__restrict __dest,
const wchar_t *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
const wchar_t *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern wchar_t *wcscat (wchar_t *__restrict __dest,
const wchar_t *__restrict __src)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern wchar_t *wcsncat (wchar_t *__restrict __dest,
const wchar_t *__restrict __src, size_t __n)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) throw ();
extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
size_t __n) throw ();
extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
locale_t __loc) throw ();
extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
size_t __n, locale_t __loc) throw ();
extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) throw ();
extern size_t wcsxfrm (wchar_t *__restrict __s1,
const wchar_t *__restrict __s2, size_t __n) throw ();
extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2,
locale_t __loc) throw ();
extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
size_t __n, locale_t __loc) throw ();
extern wchar_t *wcsdup (const wchar_t *__s) throw () __attribute__ ((__malloc__));
extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
throw () __asm ("wcschr") __attribute__ ((__pure__));
extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
throw () __asm ("wcschr") __attribute__ ((__pure__));
extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
throw () __asm ("wcsrchr") __attribute__ ((__pure__));
extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
throw () __asm ("wcsrchr") __attribute__ ((__pure__));
# 181 "/usr/include/wchar.h" 3 4
extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc)
throw () __attribute__ ((__pure__));
extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
throw () __attribute__ ((__pure__));
extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
throw () __attribute__ ((__pure__));
extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept)
throw () __asm ("wcspbrk") __attribute__ ((__pure__));
extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs,
const wchar_t *__accept)
throw () __asm ("wcspbrk") __attribute__ ((__pure__));
extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle)
throw () __asm ("wcsstr") __attribute__ ((__pure__));
extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack,
const wchar_t *__needle)
throw () __asm ("wcsstr") __attribute__ ((__pure__));
extern wchar_t *wcstok (wchar_t *__restrict __s,
const wchar_t *__restrict __delim,
wchar_t **__restrict __ptr) throw ();
extern size_t wcslen (const wchar_t *__s) throw () __attribute__ ((__pure__));
extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle)
throw () __asm ("wcswcs") __attribute__ ((__pure__));
extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack,
const wchar_t *__needle)
throw () __asm ("wcswcs") __attribute__ ((__pure__));
# 240 "/usr/include/wchar.h" 3 4
extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
throw () __attribute__ ((__pure__));
extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
throw () __asm ("wmemchr") __attribute__ ((__pure__));
extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c,
size_t __n)
throw () __asm ("wmemchr") __attribute__ ((__pure__));
extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
throw () __attribute__ ((__pure__));
extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
const wchar_t *__restrict __s2, size_t __n) throw ();
extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
throw ();
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();
extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
const wchar_t *__restrict __s2, size_t __n)
throw ();
extern wint_t btowc (int __c) throw ();
extern int wctob (wint_t __c) throw ();
extern int mbsinit (const mbstate_t *__ps) throw () __attribute__ ((__pure__));
extern size_t mbrtowc (wchar_t *__restrict __pwc,
const char *__restrict __s, size_t __n,
mbstate_t *__restrict __p) throw ();
extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
mbstate_t *__restrict __ps) throw ();
extern size_t __mbrlen (const char *__restrict __s, size_t __n,
mbstate_t *__restrict __ps) throw ();
extern size_t mbrlen (const char *__restrict __s, size_t __n,
mbstate_t *__restrict __ps) throw ();
extern wint_t __btowc_alias (int __c) __asm ("btowc");
extern __inline __attribute__ ((__gnu_inline__)) wint_t
__attribute__ ((__leaf__)) btowc (int __c) throw ()
{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
? (wint_t) __c : __btowc_alias (__c)); }
extern int __wctob_alias (wint_t __c) __asm ("wctob");
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__leaf__)) wctob (wint_t __wc) throw ()
{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
? (int) __wc : __wctob_alias (__wc)); }
extern __inline __attribute__ ((__gnu_inline__)) size_t
__attribute__ ((__leaf__)) mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw ()
{ return (__ps != __null
? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); }
extern size_t mbsrtowcs (wchar_t *__restrict __dst,
const char **__restrict __src, size_t __len,
mbstate_t *__restrict __ps) throw ();
extern size_t wcsrtombs (char *__restrict __dst,
const wchar_t **__restrict __src, size_t __len,
mbstate_t *__restrict __ps) throw ();
extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
const char **__restrict __src, size_t __nmc,
size_t __len, mbstate_t *__restrict __ps) throw ();
extern size_t wcsnrtombs (char *__restrict __dst,
const wchar_t **__restrict __src,
size_t __nwc, size_t __len,
mbstate_t *__restrict __ps) throw ();
extern int wcwidth (wchar_t __c) throw ();
extern int wcswidth (const wchar_t *__s, size_t __n) throw ();
extern double wcstod (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern float wcstof (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern long double wcstold (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
# 396 "/usr/include/wchar.h" 3 4
extern _Float32 wcstof32 (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern _Float64 wcstof64 (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern _Float128 wcstof128 (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern _Float32x wcstof32x (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
extern _Float64x wcstof64x (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr) throw ();
# 428 "/usr/include/wchar.h" 3 4
extern long int wcstol (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base) throw ();
extern unsigned long int wcstoul (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base)
throw ();
__extension__
extern long long int wcstoll (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base)
throw ();
__extension__
extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
int __base) throw ();
__extension__
extern long long int wcstoq (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base)
throw ();
__extension__
extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
int __base) throw ();
extern long int wcstol_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base,
locale_t __loc) throw ();
extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
int __base, locale_t __loc) throw ();
__extension__
extern long long int wcstoll_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
int __base, locale_t __loc) throw ();
__extension__
extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
int __base, locale_t __loc)
throw ();
extern double wcstod_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, locale_t __loc)
throw ();
extern float wcstof_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, locale_t __loc)
throw ();
extern long double wcstold_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
# 511 "/usr/include/wchar.h" 3 4
extern _Float32 wcstof32_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
extern _Float64 wcstof64_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
extern _Float128 wcstof128_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
extern _Float32x wcstof32x_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
extern _Float64x wcstof64x_l (const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr,
locale_t __loc) throw ();
# 551 "/usr/include/wchar.h" 3 4
extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
const wchar_t *__restrict __src) throw ();
extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
const wchar_t *__restrict __src, size_t __n)
throw ();
# 567 "/usr/include/wchar.h" 3 4
extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw ();
extern int fwide (__FILE *__fp, int __mode) throw ();
extern int fwprintf (__FILE *__restrict __stream,
const wchar_t *__restrict __format, ...)
;
extern int wprintf (const wchar_t *__restrict __format, ...)
;
extern int swprintf (wchar_t *__restrict __s, size_t __n,
const wchar_t *__restrict __format, ...)
throw () ;
extern int vfwprintf (__FILE *__restrict __s,
const wchar_t *__restrict __format,
__gnuc_va_list __arg)
;
extern int vwprintf (const wchar_t *__restrict __format,
__gnuc_va_list __arg)
;
extern int vswprintf (wchar_t *__restrict __s, size_t __n,
const wchar_t *__restrict __format,
__gnuc_va_list __arg)
throw () ;
extern int fwscanf (__FILE *__restrict __stream,
const wchar_t *__restrict __format, ...)
;
extern int wscanf (const wchar_t *__restrict __format, ...)
;
extern int swscanf (const wchar_t *__restrict __s,
const wchar_t *__restrict __format, ...)
throw () ;
extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) __asm__ ("" "__isoc99_fwscanf")
;
extern int wscanf (const wchar_t *__restrict __format, ...) __asm__ ("" "__isoc99_wscanf")
;
extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) throw () __asm__ ("" "__isoc99_swscanf")
;
# 671 "/usr/include/wchar.h" 3 4
extern int vfwscanf (__FILE *__restrict __s,
const wchar_t *__restrict __format,
__gnuc_va_list __arg)
;
extern int vwscanf (const wchar_t *__restrict __format,
__gnuc_va_list __arg)
;
extern int vswscanf (const wchar_t *__restrict __s,
const wchar_t *__restrict __format,
__gnuc_va_list __arg)
throw () ;
extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfwscanf")
;
extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vwscanf")
;
extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) throw () __asm__ ("" "__isoc99_vswscanf")
;
# 726 "/usr/include/wchar.h" 3 4
extern wint_t fgetwc (__FILE *__stream);
extern wint_t getwc (__FILE *__stream);
extern wint_t getwchar (void);
extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
extern wint_t putwc (wchar_t __wc, __FILE *__stream);
extern wint_t putwchar (wchar_t __wc);
extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
__FILE *__restrict __stream);
extern int fputws (const wchar_t *__restrict __ws,
__FILE *__restrict __stream);
extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
# 781 "/usr/include/wchar.h" 3 4
extern wint_t getwc_unlocked (__FILE *__stream);
extern wint_t getwchar_unlocked (void);
extern wint_t fgetwc_unlocked (__FILE *__stream);
extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
# 807 "/usr/include/wchar.h" 3 4
extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
extern wint_t putwchar_unlocked (wchar_t __wc);
# 817 "/usr/include/wchar.h" 3 4
extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
__FILE *__restrict __stream);
extern int fputws_unlocked (const wchar_t *__restrict __ws,
__FILE *__restrict __stream);
extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
const wchar_t *__restrict __format,
const struct tm *__restrict __tp) throw ();
extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
const wchar_t *__restrict __format,
const struct tm *__restrict __tp,
locale_t __loc) throw ();
# 856 "/usr/include/wchar.h" 3 4
}
# 45 "/usr/include/c++/10/cwchar" 2 3
# 62 "/usr/include/c++/10/cwchar" 3
namespace std
{
using ::mbstate_t;
}
# 135 "/usr/include/c++/10/cwchar" 3
extern "C++"
{
namespace std __attribute__ ((__visibility__ ("default")))
{
using ::wint_t;
using ::btowc;
using ::fgetwc;
using ::fgetws;
using ::fputwc;
using ::fputws;
using ::fwide;
using ::fwprintf;
using ::fwscanf;
using ::getwc;
using ::getwchar;
using ::mbrlen;
using ::mbrtowc;
using ::mbsinit;
using ::mbsrtowcs;
using ::putwc;
using ::putwchar;
using ::swprintf;
using ::swscanf;
using ::ungetwc;
using ::vfwprintf;
using ::vfwscanf;
using ::vswprintf;
using ::vswscanf;
using ::vwprintf;
using ::vwscanf;
using ::wcrtomb;
using ::wcscat;
using ::wcscmp;
using ::wcscoll;
using ::wcscpy;
using ::wcscspn;
using ::wcsftime;
using ::wcslen;
using ::wcsncat;
using ::wcsncmp;
using ::wcsncpy;
using ::wcsrtombs;
using ::wcsspn;
using ::wcstod;
using ::wcstof;
using ::wcstok;
using ::wcstol;
using ::wcstoul;
using ::wcsxfrm;
using ::wctob;
using ::wmemcmp;
using ::wmemcpy;
using ::wmemmove;
using ::wmemset;
using ::wprintf;
using ::wscanf;
using ::wcschr;
using ::wcspbrk;
using ::wcsrchr;
using ::wcsstr;
using ::wmemchr;
# 234 "/usr/include/c++/10/cwchar" 3
}
}
namespace __gnu_cxx
{
using ::wcstold;
# 260 "/usr/include/c++/10/cwchar" 3
using ::wcstoll;
using ::wcstoull;
}
namespace std
{
using ::__gnu_cxx::wcstold;
using ::__gnu_cxx::wcstoll;
using ::__gnu_cxx::wcstoull;
}
# 280 "/usr/include/c++/10/cwchar" 3
namespace std
{
using std::wcstof;
using std::vfwscanf;
using std::vswscanf;
using std::vwscanf;
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
}
# 41 "/usr/include/c++/10/bits/postypes.h" 2 3
# 68 "/usr/include/c++/10/bits/postypes.h" 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 88 "/usr/include/c++/10/bits/postypes.h" 3
typedef long streamoff;
# 98 "/usr/include/c++/10/bits/postypes.h" 3
typedef ptrdiff_t streamsize;
# 111 "/usr/include/c++/10/bits/postypes.h" 3
template<typename _StateT>
class fpos
{
private:
streamoff _M_off;
_StateT _M_state;
public:
fpos()
: _M_off(0), _M_state() { }
# 133 "/usr/include/c++/10/bits/postypes.h" 3
fpos(streamoff __off)
: _M_off(__off), _M_state() { }
fpos(const fpos&) = default;
fpos& operator=(const fpos&) = default;
~fpos() = default;
operator streamoff() const { return _M_off; }
void
state(_StateT __st)
{ _M_state = __st; }
_StateT
state() const
{ return _M_state; }
fpos&
operator+=(streamoff __off)
{
_M_off += __off;
return *this;
}
fpos&
operator-=(streamoff __off)
{
_M_off -= __off;
return *this;
}
fpos
operator+(streamoff __off) const
{
fpos __pos(*this);
__pos += __off;
return __pos;
}
fpos
operator-(streamoff __off) const
{
fpos __pos(*this);
__pos -= __off;
return __pos;
}
streamoff
operator-(const fpos& __other) const
{ return _M_off - __other._M_off; }
};
template<typename _StateT>
inline bool
operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
{ return streamoff(__lhs) == streamoff(__rhs); }
template<typename _StateT>
inline bool
operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
{ return streamoff(__lhs) != streamoff(__rhs); }
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
# 245 "/usr/include/c++/10/bits/postypes.h" 3
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;
}
# 41 "/usr/include/c++/10/iosfwd" 2 3
namespace std __attribute__ ((__visibility__ ("default")))
{
# 74 "/usr/include/c++/10/iosfwd" 3
class ios_base;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ios;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_streambuf;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_istream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ostream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_iostream;
namespace __cxx11 {
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringbuf;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_istringstream;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_ostringstream;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringstream;
}
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_filebuf;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ifstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ofstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_fstream;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class istreambuf_iterator;
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class ostreambuf_iterator;
typedef basic_ios<char> ios;
typedef basic_streambuf<char> streambuf;
typedef basic_istream<char> istream;
typedef basic_ostream<char> ostream;
typedef basic_iostream<char> iostream;
typedef basic_stringbuf<char> stringbuf;
typedef basic_istringstream<char> istringstream;
typedef basic_ostringstream<char> ostringstream;
typedef basic_stringstream<char> stringstream;
typedef basic_filebuf<char> filebuf;
typedef basic_ifstream<char> ifstream;
typedef basic_ofstream<char> ofstream;
typedef basic_fstream<char> fstream;
typedef basic_ios<wchar_t> wios;
typedef basic_streambuf<wchar_t> wstreambuf;
typedef basic_istream<wchar_t> wistream;
typedef basic_ostream<wchar_t> wostream;
typedef basic_iostream<wchar_t> wiostream;
typedef basic_stringbuf<wchar_t> wstringbuf;
typedef basic_istringstream<wchar_t> wistringstream;
typedef basic_ostringstream<wchar_t> wostringstream;
typedef basic_stringstream<wchar_t> wstringstream;
typedef basic_filebuf<wchar_t> wfilebuf;
typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
}
# 35 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4
# 1 "/usr/include/c++/10/cstdio" 1 3 4
# 39 "/usr/include/c++/10/cstdio" 3 4
# 40 "/usr/include/c++/10/cstdio" 3
# 96 "/usr/include/c++/10/cstdio" 3
namespace std
{
using ::FILE;
using ::fpos_t;
using ::clearerr;
using ::fclose;
using ::feof;
using ::ferror;
using ::fflush;
using ::fgetc;
using ::fgetpos;
using ::fgets;
using ::fopen;
using ::fprintf;
using ::fputc;
using ::fputs;
using ::fread;
using ::freopen;
using ::fscanf;
using ::fseek;
using ::fsetpos;
using ::ftell;
using ::fwrite;
using ::getc;
using ::getchar;
using ::perror;
using ::printf;
using ::putc;
using ::putchar;
using ::puts;
using ::remove;
using ::rename;
using ::rewind;
using ::scanf;
using ::setbuf;
using ::setvbuf;
using ::sprintf;
using ::sscanf;
using ::tmpfile;
using ::tmpnam;
using ::ungetc;
using ::vfprintf;
using ::vprintf;
using ::vsprintf;
}
# 157 "/usr/include/c++/10/cstdio" 3
namespace __gnu_cxx
{
# 175 "/usr/include/c++/10/cstdio" 3
using ::snprintf;
using ::vfscanf;
using ::vscanf;
using ::vsnprintf;
using ::vsscanf;
}
namespace std
{
using ::__gnu_cxx::snprintf;
using ::__gnu_cxx::vfscanf;
using ::__gnu_cxx::vscanf;
using ::__gnu_cxx::vsnprintf;
using ::__gnu_cxx::vsscanf;
}
# 36 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4
# 55 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 56 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4
# 57 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4
# 141 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
typedef unsigned long int mp_limb_t;
typedef long int mp_limb_signed_t;
typedef unsigned long int mp_bitcnt_t;
typedef struct
{
int _mp_alloc;
int _mp_size;
mp_limb_t *_mp_d;
} __mpz_struct;
typedef __mpz_struct MP_INT;
typedef __mpz_struct mpz_t[1];
typedef mp_limb_t * mp_ptr;
typedef const mp_limb_t * mp_srcptr;
typedef long int mp_size_t;
typedef long int mp_exp_t;
typedef struct
{
__mpz_struct _mp_num;
__mpz_struct _mp_den;
} __mpq_struct;
typedef __mpq_struct MP_RAT;
typedef __mpq_struct mpq_t[1];
typedef struct
{
int _mp_prec;
int _mp_size;
mp_exp_t _mp_exp;
mp_limb_t *_mp_d;
} __mpf_struct;
typedef __mpf_struct mpf_t[1];
typedef enum
{
GMP_RAND_ALG_DEFAULT = 0,
GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT
} gmp_randalg_t;
typedef struct
{
mpz_t _mp_seed;
gmp_randalg_t _mp_alg;
union {
void *_mp_lc;
} _mp_algdata;
} __gmp_randstate_struct;
typedef __gmp_randstate_struct gmp_randstate_t[1];
typedef const __mpz_struct *mpz_srcptr;
typedef __mpz_struct *mpz_ptr;
typedef const __mpf_struct *mpf_srcptr;
typedef __mpf_struct *mpf_ptr;
typedef const __mpq_struct *mpq_srcptr;
typedef __mpq_struct *mpq_ptr;
# 472 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
extern "C" {
using std::FILE;
void __gmp_set_memory_functions (void *(*) (size_t),
void *(*) (void *, size_t, size_t),
void (*) (void *, size_t)) noexcept;
void __gmp_get_memory_functions (void *(**) (size_t),
void *(**) (void *, size_t, size_t),
void (**) (void *, size_t)) noexcept;
extern const int __gmp_bits_per_limb;
extern int __gmp_errno;
extern const char * const __gmp_version;
void __gmp_randinit (gmp_randstate_t, gmp_randalg_t, ...);
void __gmp_randinit_default (gmp_randstate_t);
void __gmp_randinit_lc_2exp (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);
int __gmp_randinit_lc_2exp_size (gmp_randstate_t, mp_bitcnt_t);
void __gmp_randinit_mt (gmp_randstate_t);
void __gmp_randinit_set (gmp_randstate_t, const __gmp_randstate_struct *);
void __gmp_randseed (gmp_randstate_t, mpz_srcptr);
void __gmp_randseed_ui (gmp_randstate_t, unsigned long int);
void __gmp_randclear (gmp_randstate_t);
unsigned long __gmp_urandomb_ui (gmp_randstate_t, unsigned long);
unsigned long __gmp_urandomm_ui (gmp_randstate_t, unsigned long);
int __gmp_asprintf (char **, const char *, ...);
int __gmp_fprintf (FILE *, const char *, ...);
# 554 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
int __gmp_printf (const char *, ...);
int __gmp_snprintf (char *, size_t, const char *, ...);
int __gmp_sprintf (char *, const char *, ...);
int __gmp_vasprintf (char **, const char *, va_list);
int __gmp_vfprintf (FILE *, const char *, va_list);
int __gmp_vprintf (const char *, va_list);
int __gmp_vsnprintf (char *, size_t, const char *, va_list);
int __gmp_vsprintf (char *, const char *, va_list);
int __gmp_fscanf (FILE *, const char *, ...);
int __gmp_scanf (const char *, ...);
int __gmp_sscanf (const char *, const char *, ...);
int __gmp_vfscanf (FILE *, const char *, va_list);
int __gmp_vscanf (const char *, va_list);
int __gmp_vsscanf (const char *, const char *, va_list);
void *__gmpz_realloc (mpz_ptr, mp_size_t);
void __gmpz_abs (mpz_ptr, mpz_srcptr);
void __gmpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_add_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_addmul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_array_init (mpz_ptr, mp_size_t, mp_size_t);
void __gmpz_bin_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_bin_uiui (mpz_ptr, unsigned long int, unsigned long int);
void __gmpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
unsigned long int __gmpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
unsigned long int __gmpz_cdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));
void __gmpz_clear (mpz_ptr);
void __gmpz_clears (mpz_ptr, ...);
void __gmpz_clrbit (mpz_ptr, mp_bitcnt_t);
int __gmpz_cmp (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_cmp_d (mpz_srcptr, double) __attribute__ ((__pure__));
int __gmpz_cmp_si (mpz_srcptr, signed long int) noexcept __attribute__ ((__pure__));
int __gmpz_cmp_ui (mpz_srcptr, unsigned long int) noexcept __attribute__ ((__pure__));
int __gmpz_cmpabs (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_cmpabs_d (mpz_srcptr, double) __attribute__ ((__pure__));
int __gmpz_cmpabs_ui (mpz_srcptr, unsigned long int) noexcept __attribute__ ((__pure__));
void __gmpz_com (mpz_ptr, mpz_srcptr);
void __gmpz_combit (mpz_ptr, mp_bitcnt_t);
int __gmpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));
int __gmpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__));
int __gmpz_congruent_ui_p (mpz_srcptr, unsigned long, unsigned long) __attribute__ ((__pure__));
void __gmpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_divexact_ui (mpz_ptr, mpz_srcptr, unsigned long);
int __gmpz_divisible_p (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));
int __gmpz_divisible_ui_p (mpz_srcptr, unsigned long) __attribute__ ((__pure__));
int __gmpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__));
void __gmpz_dump (mpz_srcptr);
void *__gmpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr);
void __gmpz_fac_ui (mpz_ptr, unsigned long int);
void __gmpz_2fac_ui (mpz_ptr, unsigned long int);
void __gmpz_mfac_uiui (mpz_ptr, unsigned long int, unsigned long int);
void __gmpz_primorial_ui (mpz_ptr, unsigned long int);
void __gmpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
unsigned long int __gmpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
unsigned long int __gmpz_fdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));
void __gmpz_fib_ui (mpz_ptr, unsigned long int);
void __gmpz_fib2_ui (mpz_ptr, mpz_ptr, unsigned long int);
int __gmpz_fits_sint_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_fits_slong_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_fits_sshort_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_fits_uint_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_fits_ulong_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpz_fits_ushort_p (mpz_srcptr) noexcept __attribute__ ((__pure__));
void __gmpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);
unsigned long int __gmpz_gcd_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
double __gmpz_get_d (mpz_srcptr) __attribute__ ((__pure__));
double __gmpz_get_d_2exp (signed long int *, mpz_srcptr);
long int __gmpz_get_si (mpz_srcptr) noexcept __attribute__ ((__pure__));
char *__gmpz_get_str (char *, int, mpz_srcptr);
unsigned long int __gmpz_get_ui (mpz_srcptr) noexcept __attribute__ ((__pure__));
mp_limb_t __gmpz_getlimbn (mpz_srcptr, mp_size_t) noexcept __attribute__ ((__pure__));
mp_bitcnt_t __gmpz_hamdist (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__));
void __gmpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *);
void __gmpz_init (mpz_ptr) noexcept;
void __gmpz_init2 (mpz_ptr, mp_bitcnt_t);
void __gmpz_inits (mpz_ptr, ...) noexcept;
void __gmpz_init_set (mpz_ptr, mpz_srcptr);
void __gmpz_init_set_d (mpz_ptr, double);
void __gmpz_init_set_si (mpz_ptr, signed long int);
int __gmpz_init_set_str (mpz_ptr, const char *, int);
void __gmpz_init_set_ui (mpz_ptr, unsigned long int);
size_t __gmpz_inp_raw (mpz_ptr, FILE *);
size_t __gmpz_inp_str (mpz_ptr, FILE *, int);
int __gmpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr);
int __gmpz_jacobi (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));
int __gmpz_kronecker_si (mpz_srcptr, long) __attribute__ ((__pure__));
int __gmpz_kronecker_ui (mpz_srcptr, unsigned long) __attribute__ ((__pure__));
int __gmpz_si_kronecker (long, mpz_srcptr) __attribute__ ((__pure__));
int __gmpz_ui_kronecker (unsigned long, mpz_srcptr) __attribute__ ((__pure__));
void __gmpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_lcm_ui (mpz_ptr, mpz_srcptr, unsigned long);
void __gmpz_lucnum_ui (mpz_ptr, unsigned long int);
void __gmpz_lucnum2_ui (mpz_ptr, mpz_ptr, unsigned long int);
int __gmpz_millerrabin (mpz_srcptr, int) __attribute__ ((__pure__));
void __gmpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
void __gmpz_mul_si (mpz_ptr, mpz_srcptr, long int);
void __gmpz_mul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_neg (mpz_ptr, mpz_srcptr);
void __gmpz_nextprime (mpz_ptr, mpz_srcptr);
size_t __gmpz_out_raw (FILE *, mpz_srcptr);
size_t __gmpz_out_str (FILE *, int, mpz_srcptr);
int __gmpz_perfect_power_p (mpz_srcptr) __attribute__ ((__pure__));
int __gmpz_perfect_square_p (mpz_srcptr) __attribute__ ((__pure__));
mp_bitcnt_t __gmpz_popcount (mpz_srcptr) noexcept __attribute__ ((__pure__));
void __gmpz_pow_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
void __gmpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
void __gmpz_powm_ui (mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr);
int __gmpz_probab_prime_p (mpz_srcptr, int) __attribute__ ((__pure__));
void __gmpz_random (mpz_ptr, mp_size_t);
void __gmpz_random2 (mpz_ptr, mp_size_t);
void __gmpz_realloc2 (mpz_ptr, mp_bitcnt_t);
mp_bitcnt_t __gmpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr);
int __gmpz_root (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_rrandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
mp_bitcnt_t __gmpz_scan0 (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__));
mp_bitcnt_t __gmpz_scan1 (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__));
void __gmpz_set (mpz_ptr, mpz_srcptr);
void __gmpz_set_d (mpz_ptr, double);
void __gmpz_set_f (mpz_ptr, mpf_srcptr);
void __gmpz_set_q (mpz_ptr, mpq_srcptr);
void __gmpz_set_si (mpz_ptr, signed long int);
int __gmpz_set_str (mpz_ptr, const char *, int);
void __gmpz_set_ui (mpz_ptr, unsigned long int);
void __gmpz_setbit (mpz_ptr, mp_bitcnt_t);
size_t __gmpz_size (mpz_srcptr) noexcept __attribute__ ((__pure__));
size_t __gmpz_sizeinbase (mpz_srcptr, int) noexcept __attribute__ ((__pure__));
void __gmpz_sqrt (mpz_ptr, mpz_srcptr);
void __gmpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr);
void __gmpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_sub_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_ui_sub (mpz_ptr, unsigned long int, mpz_srcptr);
void __gmpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_submul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_swap (mpz_ptr, mpz_ptr) noexcept;
unsigned long int __gmpz_tdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));
void __gmpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
unsigned long int __gmpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
void __gmpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
void __gmpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
unsigned long int __gmpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
int __gmpz_tstbit (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__));
void __gmpz_ui_pow_ui (mpz_ptr, unsigned long int, unsigned long int);
void __gmpz_urandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
void __gmpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);
void __gmpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);
mp_srcptr __gmpz_limbs_read (mpz_srcptr);
mp_ptr __gmpz_limbs_write (mpz_ptr, mp_size_t);
mp_ptr __gmpz_limbs_modify (mpz_ptr, mp_size_t);
void __gmpz_limbs_finish (mpz_ptr, mp_size_t);
mpz_srcptr __gmpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t);
void __gmpq_abs (mpq_ptr, mpq_srcptr);
void __gmpq_add (mpq_ptr, mpq_srcptr, mpq_srcptr);
void __gmpq_canonicalize (mpq_ptr);
void __gmpq_clear (mpq_ptr);
void __gmpq_clears (mpq_ptr, ...);
int __gmpq_cmp (mpq_srcptr, mpq_srcptr) __attribute__ ((__pure__));
int __gmpq_cmp_si (mpq_srcptr, long, unsigned long) __attribute__ ((__pure__));
int __gmpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __attribute__ ((__pure__));
int __gmpq_cmp_z (mpq_srcptr, mpz_srcptr) __attribute__ ((__pure__));
void __gmpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr);
void __gmpq_div_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
int __gmpq_equal (mpq_srcptr, mpq_srcptr) noexcept __attribute__ ((__pure__));
void __gmpq_get_num (mpz_ptr, mpq_srcptr);
void __gmpq_get_den (mpz_ptr, mpq_srcptr);
double __gmpq_get_d (mpq_srcptr) __attribute__ ((__pure__));
char *__gmpq_get_str (char *, int, mpq_srcptr);
void __gmpq_init (mpq_ptr);
void __gmpq_inits (mpq_ptr, ...);
size_t __gmpq_inp_str (mpq_ptr, FILE *, int);
void __gmpq_inv (mpq_ptr, mpq_srcptr);
void __gmpq_mul (mpq_ptr, mpq_srcptr, mpq_srcptr);
void __gmpq_mul_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
void __gmpq_neg (mpq_ptr, mpq_srcptr);
size_t __gmpq_out_str (FILE *, int, mpq_srcptr);
void __gmpq_set (mpq_ptr, mpq_srcptr);
void __gmpq_set_d (mpq_ptr, double);
void __gmpq_set_den (mpq_ptr, mpz_srcptr);
void __gmpq_set_f (mpq_ptr, mpf_srcptr);
void __gmpq_set_num (mpq_ptr, mpz_srcptr);
void __gmpq_set_si (mpq_ptr, signed long int, unsigned long int);
int __gmpq_set_str (mpq_ptr, const char *, int);
void __gmpq_set_ui (mpq_ptr, unsigned long int, unsigned long int);
void __gmpq_set_z (mpq_ptr, mpz_srcptr);
void __gmpq_sub (mpq_ptr, mpq_srcptr, mpq_srcptr);
void __gmpq_swap (mpq_ptr, mpq_ptr) noexcept;
void __gmpf_abs (mpf_ptr, mpf_srcptr);
void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);
void __gmpf_add_ui (mpf_ptr, mpf_srcptr, unsigned long int);
void __gmpf_ceil (mpf_ptr, mpf_srcptr);
void __gmpf_clear (mpf_ptr);
void __gmpf_clears (mpf_ptr, ...);
int __gmpf_cmp (mpf_srcptr, mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_cmp_z (mpf_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_cmp_d (mpf_srcptr, double) __attribute__ ((__pure__));
int __gmpf_cmp_si (mpf_srcptr, signed long int) noexcept __attribute__ ((__pure__));
int __gmpf_cmp_ui (mpf_srcptr, unsigned long int) noexcept __attribute__ ((__pure__));
void __gmpf_div (mpf_ptr, mpf_srcptr, mpf_srcptr);
void __gmpf_div_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
void __gmpf_div_ui (mpf_ptr, mpf_srcptr, unsigned long int);
void __gmpf_dump (mpf_srcptr);
int __gmpf_eq (mpf_srcptr, mpf_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));
int __gmpf_fits_sint_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_fits_slong_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_fits_sshort_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_fits_uint_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_fits_ulong_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
int __gmpf_fits_ushort_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
void __gmpf_floor (mpf_ptr, mpf_srcptr);
double __gmpf_get_d (mpf_srcptr) __attribute__ ((__pure__));
double __gmpf_get_d_2exp (signed long int *, mpf_srcptr);
mp_bitcnt_t __gmpf_get_default_prec (void) noexcept __attribute__ ((__pure__));
mp_bitcnt_t __gmpf_get_prec (mpf_srcptr) noexcept __attribute__ ((__pure__));
long __gmpf_get_si (mpf_srcptr) noexcept __attribute__ ((__pure__));
char *__gmpf_get_str (char *, mp_exp_t *, int, size_t, mpf_srcptr);
unsigned long __gmpf_get_ui (mpf_srcptr) noexcept __attribute__ ((__pure__));
void __gmpf_init (mpf_ptr);
void __gmpf_init2 (mpf_ptr, mp_bitcnt_t);
void __gmpf_inits (mpf_ptr, ...);
void __gmpf_init_set (mpf_ptr, mpf_srcptr);
void __gmpf_init_set_d (mpf_ptr, double);
void __gmpf_init_set_si (mpf_ptr, signed long int);
int __gmpf_init_set_str (mpf_ptr, const char *, int);
void __gmpf_init_set_ui (mpf_ptr, unsigned long int);
size_t __gmpf_inp_str (mpf_ptr, FILE *, int);
int __gmpf_integer_p (mpf_srcptr) noexcept __attribute__ ((__pure__));
void __gmpf_mul (mpf_ptr, mpf_srcptr, mpf_srcptr);
void __gmpf_mul_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
void __gmpf_mul_ui (mpf_ptr, mpf_srcptr, unsigned long int);
void __gmpf_neg (mpf_ptr, mpf_srcptr);
size_t __gmpf_out_str (FILE *, int, size_t, mpf_srcptr);
void __gmpf_pow_ui (mpf_ptr, mpf_srcptr, unsigned long int);
void __gmpf_random2 (mpf_ptr, mp_size_t, mp_exp_t);
void __gmpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr);
void __gmpf_set (mpf_ptr, mpf_srcptr);
void __gmpf_set_d (mpf_ptr, double);
void __gmpf_set_default_prec (mp_bitcnt_t) noexcept;
void __gmpf_set_prec (mpf_ptr, mp_bitcnt_t);
void __gmpf_set_prec_raw (mpf_ptr, mp_bitcnt_t) noexcept;
void __gmpf_set_q (mpf_ptr, mpq_srcptr);
void __gmpf_set_si (mpf_ptr, signed long int);
int __gmpf_set_str (mpf_ptr, const char *, int);
void __gmpf_set_ui (mpf_ptr, unsigned long int);
void __gmpf_set_z (mpf_ptr, mpz_srcptr);
size_t __gmpf_size (mpf_srcptr) noexcept __attribute__ ((__pure__));
void __gmpf_sqrt (mpf_ptr, mpf_srcptr);
void __gmpf_sqrt_ui (mpf_ptr, unsigned long int);
void __gmpf_sub (mpf_ptr, mpf_srcptr, mpf_srcptr);
void __gmpf_sub_ui (mpf_ptr, mpf_srcptr, unsigned long int);
void __gmpf_swap (mpf_ptr, mpf_ptr) noexcept;
void __gmpf_trunc (mpf_ptr, mpf_srcptr);
void __gmpf_ui_div (mpf_ptr, unsigned long int, mpf_srcptr);
void __gmpf_ui_sub (mpf_ptr, unsigned long int, mpf_srcptr);
void __gmpf_urandomb (mpf_t, gmp_randstate_t, mp_bitcnt_t);
# 1465 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
mp_limb_t __gmpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) noexcept;
mp_limb_t __gmpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
int __gmpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__));
int __gmpn_zero_p (mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__));
void __gmpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
mp_limb_t __gmpn_divexact_by3c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
mp_limb_t __gmpn_divrem (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
mp_limb_t __gmpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr);
mp_limb_t __gmpn_div_qr_1 (mp_ptr, mp_limb_t *, mp_srcptr, mp_size_t, mp_limb_t);
mp_limb_t __gmpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
mp_size_t __gmpn_gcd (mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
mp_limb_t __gmpn_gcd_11 (mp_limb_t, mp_limb_t) __attribute__ ((__pure__));
mp_limb_t __gmpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__));
mp_limb_t __gmpn_gcdext_1 (mp_limb_signed_t *, mp_limb_signed_t *, mp_limb_t, mp_limb_t);
mp_size_t __gmpn_gcdext (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
size_t __gmpn_get_str (unsigned char *, int, mp_ptr, mp_size_t);
mp_bitcnt_t __gmpn_hamdist (mp_srcptr, mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__));
mp_limb_t __gmpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
mp_limb_t __gmpn_mod_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__));
mp_limb_t __gmpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
void __gmpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_sqr (mp_ptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_neg (mp_ptr, mp_srcptr, mp_size_t);
void __gmpn_com (mp_ptr, mp_srcptr, mp_size_t);
int __gmpn_perfect_square_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__));
int __gmpn_perfect_power_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__));
mp_bitcnt_t __gmpn_popcount (mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__));
mp_size_t __gmpn_pow_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
mp_limb_t __gmpn_preinv_mod_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __attribute__ ((__pure__));
void __gmpn_random (mp_ptr, mp_size_t);
void __gmpn_random2 (mp_ptr, mp_size_t);
mp_limb_t __gmpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
mp_bitcnt_t __gmpn_scan0 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));
mp_bitcnt_t __gmpn_scan1 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));
mp_size_t __gmpn_set_str (mp_ptr, const unsigned char *, size_t, int);
size_t __gmpn_sizeinbase (mp_srcptr, mp_size_t, int);
mp_size_t __gmpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) noexcept;
mp_limb_t __gmpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
void __gmpn_tdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
void __gmpn_and_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_andn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_nand_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_ior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_iorn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_nior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_xor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_xnor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
void __gmpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
void __gmpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
void __gmpn_zero (mp_ptr, mp_size_t);
mp_limb_t __gmpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
mp_limb_t __gmpn_sec_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
mp_size_t __gmpn_sec_add_1_itch (mp_size_t) __attribute__ ((__pure__));
mp_limb_t __gmpn_sec_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
mp_size_t __gmpn_sec_sub_1_itch (mp_size_t) __attribute__ ((__pure__));
void __gmpn_cnd_swap (mp_limb_t, volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t);
void __gmpn_sec_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
mp_size_t __gmpn_sec_mul_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__));
void __gmpn_sec_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
mp_size_t __gmpn_sec_sqr_itch (mp_size_t) __attribute__ ((__pure__));
void __gmpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_bitcnt_t, mp_srcptr, mp_size_t, mp_ptr);
mp_size_t __gmpn_sec_powm_itch (mp_size_t, mp_bitcnt_t, mp_size_t) __attribute__ ((__pure__));
void __gmpn_sec_tabselect (volatile mp_limb_t *, volatile const mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
mp_limb_t __gmpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
mp_size_t __gmpn_sec_div_qr_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__));
void __gmpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
mp_size_t __gmpn_sec_div_r_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__));
int __gmpn_sec_invert (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_bitcnt_t, mp_ptr);
mp_size_t __gmpn_sec_invert_itch (mp_size_t) __attribute__ ((__pure__));
# 1714 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
extern __inline__ __attribute__ ((__gnu_inline__)) void
__gmpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
{
if (__gmp_w != __gmp_u)
__gmpz_set (__gmp_w, __gmp_u);
__gmp_w->_mp_size = ((__gmp_w->_mp_size) >= 0 ? (__gmp_w->_mp_size) : -(__gmp_w->_mp_size));
}
# 1738 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpz_fits_uint_p (mpz_srcptr __gmp_z) noexcept
{
mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fffffff * 2U + 1U)));;
}
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpz_fits_ulong_p (mpz_srcptr __gmp_z) noexcept
{
mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fffffffffffffffL * 2UL + 1UL)));;
}
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpz_fits_ushort_p (mpz_srcptr __gmp_z) noexcept
{
mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fff * 2 + 1)));;
}
extern __inline__ __attribute__ ((__gnu_inline__))
unsigned long
__gmpz_get_ui (mpz_srcptr __gmp_z) noexcept
{
mp_ptr __gmp_p = __gmp_z->_mp_d;
mp_size_t __gmp_n = __gmp_z->_mp_size;
mp_limb_t __gmp_l = __gmp_p[0];
return (__gmp_n != 0 ? __gmp_l : 0);
# 1794 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) noexcept
{
mp_limb_t __gmp_result = 0;
if (__builtin_expect ((__gmp_n >= 0 && __gmp_n < ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size))) != 0, 1))
__gmp_result = __gmp_z->_mp_d[__gmp_n];
return __gmp_result;
}
extern __inline__ __attribute__ ((__gnu_inline__)) void
__gmpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
{
if (__gmp_w != __gmp_u)
__gmpz_set (__gmp_w, __gmp_u);
__gmp_w->_mp_size = - __gmp_w->_mp_size;
}
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpz_perfect_square_p (mpz_srcptr __gmp_a)
{
mp_size_t __gmp_asize;
int __gmp_result;
__gmp_asize = __gmp_a->_mp_size;
__gmp_result = (__gmp_asize >= 0);
if (__builtin_expect ((__gmp_asize > 0) != 0, 1))
__gmp_result = __gmpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize);
return __gmp_result;
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_bitcnt_t
__gmpz_popcount (mpz_srcptr __gmp_u) noexcept
{
mp_size_t __gmp_usize;
mp_bitcnt_t __gmp_result;
__gmp_usize = __gmp_u->_mp_size;
__gmp_result = (__gmp_usize < 0 ? ~ (static_cast<mp_bitcnt_t> (0)) : (static_cast<mp_bitcnt_t> (0)));
if (__builtin_expect ((__gmp_usize > 0) != 0, 1))
__gmp_result = __gmpn_popcount (__gmp_u->_mp_d, __gmp_usize);
return __gmp_result;
}
extern __inline__ __attribute__ ((__gnu_inline__))
void
__gmpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u)
{
__gmpz_tdiv_q (__gmp_w, (&((__gmp_u)->_mp_num)), (&((__gmp_u)->_mp_den)));
}
extern __inline__ __attribute__ ((__gnu_inline__))
size_t
__gmpz_size (mpz_srcptr __gmp_z) noexcept
{
return ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size));
}
extern __inline__ __attribute__ ((__gnu_inline__)) void
__gmpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
{
if (__gmp_w != __gmp_u)
__gmpq_set (__gmp_w, __gmp_u);
__gmp_w->_mp_num._mp_size = ((__gmp_w->_mp_num._mp_size) >= 0 ? (__gmp_w->_mp_num._mp_size) : -(__gmp_w->_mp_num._mp_size));
}
extern __inline__ __attribute__ ((__gnu_inline__)) void
__gmpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
{
if (__gmp_w != __gmp_u)
__gmpq_set (__gmp_w, __gmp_u);
__gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size;
}
# 2136 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
{
mp_limb_t __gmp_c;
do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_add_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)) == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0);
return __gmp_c;
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) noexcept
{
mp_limb_t __gmp_c;
do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x + (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_r) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x + 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_r) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0);
return __gmp_c;
}
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) noexcept
{
int __gmp_result;
do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_y; (__gmp_result) = 0; __gmp_i = (__gmp_size); while (--__gmp_i >= 0) { __gmp_x = (__gmp_xp)[__gmp_i]; __gmp_y = (__gmp_yp)[__gmp_i]; if (__gmp_x != __gmp_y) { (__gmp_result) = (__gmp_x > __gmp_y ? 1 : -1); break; } } } while (0);
return __gmp_result;
}
extern __inline__ __attribute__ ((__gnu_inline__))
int
__gmpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) noexcept
{
do {
if (__gmp_p[--__gmp_n] != 0)
return 0;
} while (__gmp_n != 0);
return 1;
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
{
mp_limb_t __gmp_c;
do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_sub_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x - 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)), __gmp_x == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0);
return __gmp_c;
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) noexcept
{
mp_limb_t __gmp_c;
do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x - (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_x) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x - 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_x) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0);
return __gmp_c;
}
extern __inline__ __attribute__ ((__gnu_inline__))
mp_limb_t
__gmpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
{
while (*__gmp_up == 0)
{
*__gmp_rp = 0;
if (!--__gmp_n)
return 0;
++__gmp_up; ++__gmp_rp;
}
*__gmp_rp = (- *__gmp_up) & ((~ (static_cast<mp_limb_t> (0))) >> 0);
if (--__gmp_n)
__gmpn_com (++__gmp_rp, ++__gmp_up, __gmp_n);
return 1;
}
}
# 2285 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
std::ostream& operator<< (std::ostream &, mpz_srcptr);
std::ostream& operator<< (std::ostream &, mpq_srcptr);
std::ostream& operator<< (std::ostream &, mpf_srcptr);
std::istream& operator>> (std::istream &, mpz_ptr);
std::istream& operator>> (std::istream &, mpq_ptr);
std::istream& operator>> (std::istream &, mpf_ptr);
# 2316 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4
enum
{
GMP_ERROR_NONE = 0,
GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
GMP_ERROR_DIVISION_BY_ZERO = 2,
GMP_ERROR_SQRT_OF_NEGATIVE = 4,
GMP_ERROR_INVALID_ARGUMENT = 8
};
# 689 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" 1
# 39 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
# 39 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern "C" {
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" 2
# 55 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern void unlock_stream (FILE *);
extern void unlock_std_streams (void);
extern FILE *fopen_unlocked (const char *, const char *);
extern FILE *fdopen_unlocked (int, const char *);
extern FILE *freopen_unlocked (const char *, const char *, FILE *);
extern char **buildargv (const char *) __attribute__ ((__malloc__));
extern void freeargv (char **);
extern char **dupargv (char * const *) __attribute__ ((__malloc__));
extern void expandargv (int *, char ***);
extern int writeargv (char * const *, FILE *);
extern int countargv (char * const *);
# 123 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const char *lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern const char *dos_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern const char *unix_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern char *lrealpath (const char *);
extern int is_valid_fd (int fd);
extern char *concat (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
# 157 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern char *reconcat (char *, const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
extern unsigned long concat_length (const char *, ...) __attribute__ ((__sentinel__));
extern char *concat_copy (char *, const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__sentinel__));
extern char *concat_copy2 (const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
extern char *libiberty_concat_ptr;
# 193 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern int fdmatch (int fd1, int fd2);
# 205 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern char * getpwd (void);
# 218 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern long get_run_time (void);
extern char *make_relative_prefix (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern char *make_relative_prefix_ignore_links (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern const char *choose_tmpdir (void) __attribute__ ((__returns_nonnull__));
extern char *choose_temp_base (void) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__));
extern char *make_temp_file (const char *) __attribute__ ((__malloc__));
extern char *make_temp_file_with_prefix (const char *, const char *) __attribute__ ((__malloc__));
extern int unlink_if_ordinary (const char *);
extern const char *spaces (int count);
extern int errno_max (void);
extern const char *strerrno (int);
extern int strtoerrno (const char *);
extern char *xstrerror (int) __attribute__ ((__returns_nonnull__));
extern int signo_max (void);
# 292 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const char *strsigno (int);
extern int strtosigno (const char *);
extern int xatexit (void (*fn) (void));
extern void xexit (int status) __attribute__ ((__noreturn__));
extern void xmalloc_set_program_name (const char *);
extern void xmalloc_failed (size_t) __attribute__ ((__noreturn__));
extern void *xmalloc (size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1))) __attribute__ ((warn_unused_result));
extern void *xrealloc (void *, size_t) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (2))) __attribute__ ((warn_unused_result));
extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1, 2))) __attribute__ ((warn_unused_result));
extern char *xstrdup (const char *) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern void *xmemdup (const void *, size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern double physmem_total (void);
extern double physmem_available (void);
extern unsigned int xcrc32 (const unsigned char *, int, unsigned int);
# 391 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const unsigned char _hex_value[256];
extern void hex_init (void);
# 428 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern struct pex_obj *pex_init (int flags, const char *pname,
const char *tempbase) __attribute__ ((__returns_nonnull__));
# 528 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const char *pex_run (struct pex_obj *obj, int flags,
const char *executable, char * const *argv,
const char *outname, const char *errname,
int *err);
# 543 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const char *pex_run_in_environment (struct pex_obj *obj, int flags,
const char *executable,
char * const *argv,
char * const *env,
const char *outname,
const char *errname, int *err);
extern FILE *pex_input_file (struct pex_obj *obj, int flags,
const char *in_name);
extern FILE *pex_input_pipe (struct pex_obj *obj, int binary);
extern FILE *pex_read_output (struct pex_obj *, int binary);
extern FILE *pex_read_err (struct pex_obj *, int binary);
extern int pex_get_status (struct pex_obj *, int count, int *vector);
struct pex_time
{
unsigned long user_seconds;
unsigned long user_microseconds;
unsigned long system_seconds;
unsigned long system_microseconds;
};
extern int pex_get_times (struct pex_obj *, int count,
struct pex_time *vector);
extern void pex_free (struct pex_obj *);
# 618 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern const char *pex_one (int flags, const char *executable,
char * const *argv, const char *pname,
const char *outname, const char *errname,
int *status, int *err);
# 637 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern int pexecute (const char *, char * const *, const char *,
const char *, char **, char **, int);
extern int pwait (int, int *, int);
extern void *bsearch_r (const void *, const void *,
size_t, size_t,
int (*)(const void *, const void *, void *),
void *);
# 661 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern char *xasprintf (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 2))) __attribute__ ((__nonnull__ (1)));
# 673 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern char *xvasprintf (const char *, va_list) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 0))) __attribute__ ((__nonnull__ (1)));
# 722 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern void setproctitle (const char *name, ...);
extern void stack_limit_increase (unsigned long);
# 735 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
extern void *C_alloca (size_t) __attribute__ ((__malloc__));
# 762 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h"
}
# 693 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
# 763 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
extern void fancy_abort (const char *, int, const char *)
__attribute__ ((__noreturn__)) __attribute__ ((__cold__));
# 894 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 963 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1055 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1073 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1091 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1107 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1224 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" 1
# 77 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h"
typedef long __gcc_host_wide_int__;
# 141 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h"
static inline unsigned long
least_bit_hwi (unsigned long x)
{
return (x & -x);
}
static inline bool
pow2_or_zerop (unsigned long x)
{
return least_bit_hwi (x) == x;
}
static inline bool
pow2p_hwi (unsigned long x)
{
return x && pow2_or_zerop (x);
}
# 184 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h"
static inline int
clz_hwi (unsigned long x)
{
if (x == 0)
return 64;
return __builtin_clzl (x);
}
static inline int
ctz_hwi (unsigned long x)
{
if (x == 0)
return 64;
return __builtin_ctzl (x);
}
static inline int
ffs_hwi (unsigned long x)
{
return __builtin_ffsl (x);
}
static inline int
popcount_hwi (unsigned long x)
{
return __builtin_popcountl (x);
}
static inline int
floor_log2 (unsigned long x)
{
return 64 - 1 - clz_hwi (x);
}
static inline int
ceil_log2 (unsigned long x)
{
return x == 0 ? 0 : floor_log2 (x - 1) + 1;
}
static inline int
exact_log2 (unsigned long x)
{
return pow2p_hwi (x) ? ctz_hwi (x) : -1;
}
extern long abs_hwi (long);
extern unsigned long absu_hwi (long);
extern long gcd (long, long);
extern long pos_mul_hwi (long, long);
extern long mul_hwi (long, long);
extern long least_common_multiple (long, long);
static inline int
ctz_or_zero (unsigned long x)
{
return ffs_hwi (x) - 1;
}
static inline long
sext_hwi (long src, unsigned int prec)
{
if (prec == 64)
return src;
else
{
((void)(!(prec < 64) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 291, __FUNCTION__), 0 : 0));
int shift = 64 - prec;
return ((long) ((unsigned long) src << shift)) >> shift;
}
# 304 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h"
}
static inline unsigned long
zext_hwi (unsigned long src, unsigned int prec)
{
if (prec == 64)
return src;
else
{
((void)(!(prec < 64) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 314, __FUNCTION__), 0 : 0));
return src & ((1UL << prec) - 1);
}
}
inline long
abs_hwi (long x)
{
((void)(!(x != (long) (1UL << (64 - 1))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 324, __FUNCTION__), 0 : 0));
return x >= 0 ? x : -x;
}
inline unsigned long
absu_hwi (long x)
{
return x >= 0 ? (unsigned long)x : -(unsigned long)x;
}
# 1225 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2
typedef int sort_r_cmp_fn (const void *, const void *, void *);
void qsort_chk (void *, size_t, size_t, sort_r_cmp_fn *, void *);
void gcc_sort_r (void *, size_t, size_t, sort_r_cmp_fn *, void *);
void gcc_qsort (void *, size_t, size_t, int (*)(const void *, const void *));
void gcc_stablesort (void *, size_t, size_t,
int (*)(const void *, const void *));
# 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 1
# 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h"
typedef int64_t gcov_type;
typedef uint64_t gcov_type_unsigned;
struct bitmap_obstack;
class bitmap_head;
typedef class bitmap_head *bitmap;
typedef const class bitmap_head *const_bitmap;
struct simple_bitmap_def;
typedef struct simple_bitmap_def *sbitmap;
typedef const struct simple_bitmap_def *const_sbitmap;
struct rtx_def;
typedef struct rtx_def *rtx;
typedef const struct rtx_def *const_rtx;
class scalar_mode;
class scalar_int_mode;
class scalar_float_mode;
class complex_mode;
class fixed_size_mode;
template<typename> class opt_mode;
typedef opt_mode<scalar_mode> opt_scalar_mode;
typedef opt_mode<scalar_int_mode> opt_scalar_int_mode;
typedef opt_mode<scalar_float_mode> opt_scalar_float_mode;
template<typename> struct pod_mode;
typedef pod_mode<scalar_mode> scalar_mode_pod;
typedef pod_mode<scalar_int_mode> scalar_int_mode_pod;
typedef pod_mode<fixed_size_mode> fixed_size_mode_pod;
struct rtx_def;
struct rtx_expr_list;
struct rtx_insn_list;
struct rtx_sequence;
struct rtx_insn;
struct rtx_debug_insn;
struct rtx_nonjump_insn;
struct rtx_jump_insn;
struct rtx_call_insn;
struct rtx_jump_table_data;
struct rtx_barrier;
struct rtx_code_label;
struct rtx_note;
struct rtvec_def;
typedef struct rtvec_def *rtvec;
typedef const struct rtvec_def *const_rtvec;
struct hwivec_def;
typedef struct hwivec_def *hwivec;
typedef const struct hwivec_def *const_hwivec;
union tree_node;
typedef union tree_node *tree;
typedef const union tree_node *const_tree;
struct gimple;
typedef gimple *gimple_seq;
struct gimple_stmt_iterator;
struct gcond;
struct gdebug;
struct ggoto;
struct glabel;
struct gswitch;
struct gassign;
struct gasm;
struct gcall;
struct gtransaction;
struct greturn;
struct gbind;
struct gcatch;
struct geh_filter;
struct geh_mnt;
struct geh_else;
struct gresx;
struct geh_dispatch;
struct gphi;
struct gtry;
struct gomp_atomic_load;
struct gomp_atomic_store;
struct gomp_continue;
struct gomp_critical;
struct gomp_ordered;
struct gomp_for;
struct gomp_parallel;
struct gomp_task;
struct gomp_sections;
struct gomp_single;
struct gomp_target;
struct gomp_teams;
struct symtab_node;
struct cgraph_node;
struct varpool_node;
struct cgraph_edge;
union section;
typedef union section section;
struct gcc_options;
struct cl_target_option;
struct cl_optimization;
struct cl_option;
struct cl_decoded_option;
struct cl_option_handlers;
struct diagnostic_context;
class pretty_printer;
class diagnostic_event_id_t;
template<typename T> struct array_traits;
template<typename T, typename Traits = array_traits<T>,
bool has_constant_size = Traits::has_constant_size>
class bitmap_view;
typedef unsigned char addr_space_t;
enum ir_type {
IR_GIMPLE,
IR_RTL_CFGRTL,
IR_RTL_CFGLAYOUT
};
struct cpp_reader;
struct cpp_token;
enum tls_model {
TLS_MODEL_NONE,
TLS_MODEL_EMULATED,
TLS_MODEL_REAL,
TLS_MODEL_GLOBAL_DYNAMIC = TLS_MODEL_REAL,
TLS_MODEL_LOCAL_DYNAMIC,
TLS_MODEL_INITIAL_EXEC,
TLS_MODEL_LOCAL_EXEC
};
enum offload_abi {
OFFLOAD_ABI_UNSET,
OFFLOAD_ABI_LP64,
OFFLOAD_ABI_ILP32
};
enum profile_update {
PROFILE_UPDATE_SINGLE,
PROFILE_UPDATE_ATOMIC,
PROFILE_UPDATE_PREFER_ATOMIC
};
enum profile_reproducibility {
PROFILE_REPRODUCIBILITY_SERIAL,
PROFILE_REPRODUCIBILITY_PARALLEL_RUNS,
PROFILE_REPRODUCIBILITY_MULTITHREADED
};
enum unwind_info_type
{
UI_NONE,
UI_SJLJ,
UI_DWARF2,
UI_TARGET,
UI_SEH
};
enum node_frequency {
NODE_FREQUENCY_UNLIKELY_EXECUTED,
NODE_FREQUENCY_EXECUTED_ONCE,
NODE_FREQUENCY_NORMAL,
NODE_FREQUENCY_HOT
};
enum optimization_type {
OPTIMIZE_FOR_SPEED,
OPTIMIZE_FOR_BOTH,
OPTIMIZE_FOR_SIZE
};
enum pad_direction {
PAD_NONE,
PAD_UPWARD,
PAD_DOWNWARD
};
enum var_init_status
{
VAR_INIT_STATUS_UNKNOWN,
VAR_INIT_STATUS_UNINITIALIZED,
VAR_INIT_STATUS_INITIALIZED
};
enum warn_strict_overflow_code
{
WARN_STRICT_OVERFLOW_ALL = 1,
WARN_STRICT_OVERFLOW_CONDITIONAL = 2,
WARN_STRICT_OVERFLOW_COMPARISON = 3,
WARN_STRICT_OVERFLOW_MISC = 4,
WARN_STRICT_OVERFLOW_MAGNITUDE = 5
};
typedef int alias_set_type;
class edge_def;
typedef class edge_def *edge;
typedef const class edge_def *const_edge;
struct basic_block_def;
typedef struct basic_block_def *basic_block;
typedef const struct basic_block_def *const_basic_block;
# 343 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h"
typedef int reg_class_t;
class rtl_opt_pass;
namespace gcc {
class context;
}
typedef std::pair <tree, tree> tree_pair;
typedef std::pair <const char *, int> string_int_pair;
template <typename ValueType>
struct kv_pair
{
const char *const name;
const ValueType value;
};
template<typename T>
struct iterator_range
{
public:
iterator_range (const T &begin, const T &end)
: m_begin (begin), m_end (end) {}
T begin () const { return m_begin; }
T end () const { return m_end; }
private:
T m_begin;
T m_end;
};
# 402 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h"
enum function_class {
function_c94,
function_c99_misc,
function_c99_math_complex,
function_sincos,
function_c11_misc,
function_c2x_misc
};
enum symbol_visibility
{
VISIBILITY_DEFAULT,
VISIBILITY_PROTECTED,
VISIBILITY_HIDDEN,
VISIBILITY_INTERNAL
};
enum flt_eval_method
{
FLT_EVAL_METHOD_UNPREDICTABLE = -1,
FLT_EVAL_METHOD_PROMOTE_TO_FLOAT = 0,
FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE = 1,
FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE = 2,
FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 = 16
};
enum excess_precision_type
{
EXCESS_PRECISION_TYPE_IMPLICIT,
EXCESS_PRECISION_TYPE_STANDARD,
EXCESS_PRECISION_TYPE_FAST
};
typedef void (*gt_pointer_operator) (void *, void *);
typedef unsigned char uchar;
# 1 "./insn-modes.h" 1
enum machine_mode
{
E_VOIDmode,
E_BLKmode,
E_CCmode,
E_CCGCmode,
E_CCGOCmode,
E_CCNOmode,
E_CCGZmode,
E_CCAmode,
E_CCCmode,
E_CCOmode,
E_CCPmode,
E_CCSmode,
E_CCZmode,
E_CCFPmode,
E_BImode,
E_QImode,
E_HImode,
E_SImode,
E_DImode,
E_TImode,
E_OImode,
E_XImode,
E_P2QImode,
E_P2HImode,
E_POImode,
E_QQmode,
E_HQmode,
E_SQmode,
E_DQmode,
E_TQmode,
E_UQQmode,
E_UHQmode,
E_USQmode,
E_UDQmode,
E_UTQmode,
E_HAmode,
E_SAmode,
E_DAmode,
E_TAmode,
E_UHAmode,
E_USAmode,
E_UDAmode,
E_UTAmode,
E_SFmode,
E_DFmode,
E_XFmode,
E_TFmode,
E_SDmode,
E_DDmode,
E_TDmode,
E_CQImode,
E_CP2QImode,
E_CHImode,
E_CP2HImode,
E_CSImode,
E_CDImode,
E_CTImode,
E_CPOImode,
E_COImode,
E_CXImode,
E_SCmode,
E_DCmode,
E_XCmode,
E_TCmode,
E_V2QImode,
E_V4QImode,
E_V2HImode,
E_V1SImode,
E_V8QImode,
E_V4HImode,
E_V2SImode,
E_V1DImode,
E_V12QImode,
E_V6HImode,
E_V14QImode,
E_V16QImode,
E_V8HImode,
E_V4SImode,
E_V2DImode,
E_V1TImode,
E_V32QImode,
E_V16HImode,
E_V8SImode,
E_V4DImode,
E_V2TImode,
E_V64QImode,
E_V32HImode,
E_V16SImode,
E_V8DImode,
E_V4TImode,
E_V128QImode,
E_V64HImode,
E_V32SImode,
E_V16DImode,
E_V8TImode,
E_V64SImode,
E_V2SFmode,
E_V4SFmode,
E_V2DFmode,
E_V8SFmode,
E_V4DFmode,
E_V2TFmode,
E_V16SFmode,
E_V8DFmode,
E_V4TFmode,
E_V32SFmode,
E_V16DFmode,
E_V8TFmode,
E_V64SFmode,
E_V32DFmode,
E_V16TFmode,
MAX_MACHINE_MODE,
MIN_MODE_RANDOM = E_VOIDmode,
MAX_MODE_RANDOM = E_BLKmode,
MIN_MODE_CC = E_CCmode,
MAX_MODE_CC = E_CCFPmode,
MIN_MODE_INT = E_QImode,
MAX_MODE_INT = E_XImode,
MIN_MODE_PARTIAL_INT = E_P2QImode,
MAX_MODE_PARTIAL_INT = E_POImode,
MIN_MODE_FRACT = E_QQmode,
MAX_MODE_FRACT = E_TQmode,
MIN_MODE_UFRACT = E_UQQmode,
MAX_MODE_UFRACT = E_UTQmode,
MIN_MODE_ACCUM = E_HAmode,
MAX_MODE_ACCUM = E_TAmode,
MIN_MODE_UACCUM = E_UHAmode,
MAX_MODE_UACCUM = E_UTAmode,
MIN_MODE_FLOAT = E_SFmode,
MAX_MODE_FLOAT = E_TFmode,
MIN_MODE_DECIMAL_FLOAT = E_SDmode,
MAX_MODE_DECIMAL_FLOAT = E_TDmode,
MIN_MODE_COMPLEX_INT = E_CQImode,
MAX_MODE_COMPLEX_INT = E_CXImode,
MIN_MODE_COMPLEX_FLOAT = E_SCmode,
MAX_MODE_COMPLEX_FLOAT = E_TCmode,
MIN_MODE_VECTOR_BOOL = E_VOIDmode,
MAX_MODE_VECTOR_BOOL = E_VOIDmode,
MIN_MODE_VECTOR_INT = E_V2QImode,
MAX_MODE_VECTOR_INT = E_V64SImode,
MIN_MODE_VECTOR_FRACT = E_VOIDmode,
MAX_MODE_VECTOR_FRACT = E_VOIDmode,
MIN_MODE_VECTOR_UFRACT = E_VOIDmode,
MAX_MODE_VECTOR_UFRACT = E_VOIDmode,
MIN_MODE_VECTOR_ACCUM = E_VOIDmode,
MAX_MODE_VECTOR_ACCUM = E_VOIDmode,
MIN_MODE_VECTOR_UACCUM = E_VOIDmode,
MAX_MODE_VECTOR_UACCUM = E_VOIDmode,
MIN_MODE_VECTOR_FLOAT = E_V2SFmode,
MAX_MODE_VECTOR_FLOAT = E_V16TFmode,
NUM_MACHINE_MODES = MAX_MACHINE_MODE
};
# 450 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/signop.h" 1
# 28 "/home/giulianob/gcc_git_gnu/gcc/gcc/signop.h"
enum signop {
SIGNED,
UNSIGNED
};
# 451 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 1
# 314 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename T> class generic_wide_int;
template <int N> class fixed_wide_int_storage;
class wide_int_storage;
typedef generic_wide_int <wide_int_storage> wide_int;
typedef generic_wide_int < fixed_wide_int_storage <((64 + 4 + 64 - 1) & ~(64 - 1))> > offset_int;
typedef generic_wide_int < fixed_wide_int_storage <(((160 + 64) / 64) * 64)> > widest_int;
typedef generic_wide_int < fixed_wide_int_storage <(((160 + 64) / 64) * 64) * 2> > widest2_int;
template <bool SE, bool HDP = true>
class wide_int_ref_storage;
typedef generic_wide_int <wide_int_ref_storage <false> > wide_int_ref;
# 348 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
namespace wi
{
# 358 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
enum overflow_type {
OVF_NONE = 0,
OVF_UNDERFLOW = -1,
OVF_OVERFLOW = 1,
OVF_UNKNOWN = 2
};
enum precision_type {
FLEXIBLE_PRECISION,
VAR_PRECISION,
CONST_PRECISION
};
# 403 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename T> struct int_traits;
template <typename T1, typename T2,
enum precision_type P1 = int_traits <T1>::precision_type,
enum precision_type P2 = int_traits <T2>::precision_type>
struct binary_traits;
template <typename T1, typename T2>
struct binary_traits <T1, T2, FLEXIBLE_PRECISION, FLEXIBLE_PRECISION>
{
typedef widest_int result_type;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, FLEXIBLE_PRECISION, VAR_PRECISION>
{
typedef wide_int result_type;
typedef result_type operator_result;
typedef bool predicate_result;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, FLEXIBLE_PRECISION, CONST_PRECISION>
{
typedef generic_wide_int < fixed_wide_int_storage
<int_traits <T2>::precision> > result_type;
typedef result_type operator_result;
typedef bool predicate_result;
typedef result_type signed_shift_result_type;
typedef bool signed_predicate_result;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, VAR_PRECISION, FLEXIBLE_PRECISION>
{
typedef wide_int result_type;
typedef result_type operator_result;
typedef bool predicate_result;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, CONST_PRECISION, FLEXIBLE_PRECISION>
{
typedef generic_wide_int < fixed_wide_int_storage
<int_traits <T1>::precision> > result_type;
typedef result_type operator_result;
typedef bool predicate_result;
typedef result_type signed_shift_result_type;
typedef bool signed_predicate_result;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, CONST_PRECISION, CONST_PRECISION>
{
static_assert ((int_traits <T1>::precision == int_traits <T2>::precision), "int_traits <T1>::precision == int_traits <T2>::precision");
typedef generic_wide_int < fixed_wide_int_storage
<int_traits <T1>::precision> > result_type;
typedef result_type operator_result;
typedef bool predicate_result;
typedef result_type signed_shift_result_type;
typedef bool signed_predicate_result;
};
template <typename T1, typename T2>
struct binary_traits <T1, T2, VAR_PRECISION, VAR_PRECISION>
{
typedef wide_int result_type;
typedef result_type operator_result;
typedef bool predicate_result;
};
}
namespace wi
{
template <typename T>
unsigned int get_precision (const T &);
template <typename T1, typename T2>
unsigned int get_binary_precision (const T1 &, const T2 &);
template <typename T1, typename T2>
void copy (T1 &, const T2 &);
# 512 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename T> bool fits_shwi_p (const T &);
template <typename T> bool fits_uhwi_p (const T &);
template <typename T> bool neg_p (const T &, signop = SIGNED);
template <typename T>
long sign_mask (const T &);
template <typename T1, typename T2> bool eq_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool ne_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool lt_p (const T1 &, const T2 &, signop);
template <typename T1, typename T2> bool lts_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool ltu_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool le_p (const T1 &, const T2 &, signop);
template <typename T1, typename T2> bool les_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool leu_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool gt_p (const T1 &, const T2 &, signop);
template <typename T1, typename T2> bool gts_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool gtu_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool ge_p (const T1 &, const T2 &, signop);
template <typename T1, typename T2> bool ges_p (const T1 &, const T2 &);
template <typename T1, typename T2> bool geu_p (const T1 &, const T2 &);
template <typename T1, typename T2>
int cmp (const T1 &, const T2 &, signop);
template <typename T1, typename T2>
int cmps (const T1 &, const T2 &);
template <typename T1, typename T2>
int cmpu (const T1 &, const T2 &);
template <typename T> typename wi::binary_traits <T, T>::result_type bit_not (const T &);
template <typename T> typename wi::binary_traits <T, T>::result_type neg (const T &);
template <typename T> typename wi::binary_traits <T, T>::result_type neg (const T &, overflow_type *);
template <typename T> typename wi::binary_traits <T, T>::result_type abs (const T &);
template <typename T> typename wi::binary_traits <T, T>::result_type ext (const T &, unsigned int, signop);
template <typename T> typename wi::binary_traits <T, T>::result_type sext (const T &, unsigned int);
template <typename T> typename wi::binary_traits <T, T>::result_type zext (const T &, unsigned int);
template <typename T> typename wi::binary_traits <T, T>::result_type set_bit (const T &, unsigned int);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type min (const T1 &, const T2 &, signop);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smin (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umin (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type max (const T1 &, const T2 &, signop);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smax (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umax (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_and (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_and_not (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_or (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_or_not (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_xor (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type add (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type add (const T1 &, const T2 &, signop, overflow_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sub (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sub (const T1 &, const T2 &, signop, overflow_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul (const T1 &, const T2 &, signop, overflow_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smul (const T1 &, const T2 &, overflow_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umul (const T1 &, const T2 &, overflow_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul_high (const T1 &, const T2 &, signop);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_trunc (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sdiv_trunc (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_trunc (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_floor (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_floor (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sdiv_floor (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_ceil (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_ceil (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_round (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type divmod_trunc (const T1 &, const T2 &, signop,
typename wi::binary_traits <T1, T2>::result_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type gcd (const T1 &, const T2 &, signop = UNSIGNED);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_trunc (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smod_trunc (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umod_trunc (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_floor (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umod_floor (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_ceil (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_round (const T1 &, const T2 &, signop,
overflow_type * = 0);
template <typename T1, typename T2>
bool multiple_of_p (const T1 &, const T2 &, signop);
template <typename T1, typename T2>
bool multiple_of_p (const T1 &, const T2 &, signop,
typename wi::binary_traits <T1, T2>::result_type *);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lshift (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lrshift (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type arshift (const T1 &, const T2 &);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type rshift (const T1 &, const T2 &, signop sgn);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lrotate (const T1 &, const T2 &, unsigned int = 0);
template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type rrotate (const T1 &, const T2 &, unsigned int = 0);
bool only_sign_bit_p (const wide_int_ref &, unsigned int);
bool only_sign_bit_p (const wide_int_ref &);
int clz (const wide_int_ref &);
int clrsb (const wide_int_ref &);
int ctz (const wide_int_ref &);
int exact_log2 (const wide_int_ref &);
int floor_log2 (const wide_int_ref &);
int ffs (const wide_int_ref &);
int popcount (const wide_int_ref &);
int parity (const wide_int_ref &);
template <typename T>
unsigned long extract_uhwi (const T &, unsigned int, unsigned int);
template <typename T>
unsigned int min_precision (const T &, signop);
static inline void accumulate_overflow (overflow_type &, overflow_type);
}
namespace wi
{
class storage_ref
{
public:
storage_ref () {}
storage_ref (const long *, unsigned int, unsigned int);
const long *val;
unsigned int len;
unsigned int precision;
unsigned int get_len () const;
unsigned int get_precision () const;
const long *get_val () const;
};
}
inline::wi::storage_ref::storage_ref (const long *val_in,
unsigned int len_in,
unsigned int precision_in)
: val (val_in), len (len_in), precision (precision_in)
{
}
inline unsigned int
wi::storage_ref::get_len () const
{
return len;
}
inline unsigned int
wi::storage_ref::get_precision () const
{
return precision;
}
inline const long *
wi::storage_ref::get_val () const
{
return val;
}
# 711 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename storage>
class generic_wide_int : public storage
{
public:
generic_wide_int ();
template <typename T>
generic_wide_int (const T &);
template <typename T>
generic_wide_int (const T &, unsigned int);
long to_shwi (unsigned int) const;
long to_shwi () const;
unsigned long to_uhwi (unsigned int) const;
unsigned long to_uhwi () const;
long to_short_addr () const;
long sign_mask () const;
long elt (unsigned int) const;
long sext_elt (unsigned int) const;
unsigned long ulow () const;
unsigned long uhigh () const;
long slow () const;
long shigh () const;
template <typename T>
generic_wide_int &operator = (const T &);
# 754 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename T> generic_wide_int &operator &= (const T &c) { return (*this = wi::bit_and (*this, c)); }
template <typename T> generic_wide_int &operator |= (const T &c) { return (*this = wi::bit_or (*this, c)); }
template <typename T> generic_wide_int &operator ^= (const T &c) { return (*this = wi::bit_xor (*this, c)); }
template <typename T> generic_wide_int &operator += (const T &c) { return (*this = wi::add (*this, c)); }
template <typename T> generic_wide_int &operator -= (const T &c) { return (*this = wi::sub (*this, c)); }
template <typename T> generic_wide_int &operator *= (const T &c) { return (*this = wi::mul (*this, c)); }
template <typename T> generic_wide_int &operator <<= (const T &c) { return (*this = wi::lshift (*this, c)); }
template <typename T> generic_wide_int &operator >>= (const T &c) { return (*this = *this >> c); }
generic_wide_int &operator ++ () { *this += 1; return *this; }
generic_wide_int &operator -- () { *this += -1; return *this; }
void dump () const;
static const bool is_sign_extended
= wi::int_traits <generic_wide_int <storage> >::is_sign_extended;
};
template <typename storage>
inline generic_wide_int <storage>::generic_wide_int () {}
template <typename storage>
template <typename T>
inline generic_wide_int <storage>::generic_wide_int (const T &x)
: storage (x)
{
}
template <typename storage>
template <typename T>
inline generic_wide_int <storage>::generic_wide_int (const T &x,
unsigned int precision)
: storage (x, precision)
{
}
template <typename storage>
inline long
generic_wide_int <storage>::to_shwi (unsigned int precision) const
{
if (precision < 64)
return sext_hwi (this->get_val ()[0], precision);
else
return this->get_val ()[0];
}
template <typename storage>
inline long
generic_wide_int <storage>::to_shwi () const
{
if (is_sign_extended)
return this->get_val ()[0];
else
return to_shwi (this->get_precision ());
}
template <typename storage>
inline unsigned long
generic_wide_int <storage>::to_uhwi (unsigned int precision) const
{
if (precision < 64)
return zext_hwi (this->get_val ()[0], precision);
else
return this->get_val ()[0];
}
template <typename storage>
inline unsigned long
generic_wide_int <storage>::to_uhwi () const
{
return to_uhwi (this->get_precision ());
}
template <typename storage>
inline long
generic_wide_int <storage>::to_short_addr () const
{
return this->get_val ()[0];
}
template <typename storage>
inline long
generic_wide_int <storage>::sign_mask () const
{
unsigned int len = this->get_len ();
((void)(!(len > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 855, __FUNCTION__), 0 : 0));
unsigned long high = this->get_val ()[len - 1];
if (!is_sign_extended)
{
unsigned int precision = this->get_precision ();
int excess = len * 64 - precision;
if (excess > 0)
high <<= excess;
}
return (long) (high) < 0 ? -1 : 0;
}
template <typename storage>
inline long
generic_wide_int <storage>::slow () const
{
return this->get_val ()[0];
}
template <typename storage>
inline long
generic_wide_int <storage>::shigh () const
{
return this->get_val ()[this->get_len () - 1];
}
template <typename storage>
inline unsigned long
generic_wide_int <storage>::ulow () const
{
return this->get_val ()[0];
}
template <typename storage>
inline unsigned long
generic_wide_int <storage>::uhigh () const
{
return this->get_val ()[this->get_len () - 1];
}
template <typename storage>
inline long
generic_wide_int <storage>::elt (unsigned int i) const
{
if (i >= this->get_len ())
return sign_mask ();
else
return this->get_val ()[i];
}
template <typename storage>
inline long
generic_wide_int <storage>::sext_elt (unsigned int i) const
{
long elt_i = elt (i);
if (!is_sign_extended)
{
unsigned int precision = this->get_precision ();
unsigned int lsb = i * 64;
if (precision - lsb < 64)
elt_i = sext_hwi (elt_i, precision - lsb);
}
return elt_i;
}
template <typename storage>
template <typename T>
inline generic_wide_int <storage> &
generic_wide_int <storage>::operator = (const T &x)
{
storage::operator = (x);
return *this;
}
template <typename storage>
void
generic_wide_int <storage>::dump () const
{
unsigned int len = this->get_len ();
const long *val = this->get_val ();
unsigned int precision = this->get_precision ();
fprintf (
# 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
stderr
# 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
, "[");
if (len * 64 < precision)
fprintf (
# 951 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
stderr
# 951 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
, "...,");
for (unsigned int i = 0; i < len - 1; ++i)
fprintf (
# 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
stderr
# 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
, "%#"
# 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
"l" "x"
# 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
",", val[len - 1 - i]);
fprintf (
# 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
stderr
# 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
, "%#"
# 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4
"l" "x"
# 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
"], precision = %d\n",
val[0], precision);
}
namespace wi
{
template <typename storage>
struct int_traits < generic_wide_int <storage> >
: public wi::int_traits <storage>
{
static unsigned int get_precision (const generic_wide_int <storage> &);
static wi::storage_ref decompose (long *, unsigned int,
const generic_wide_int <storage> &);
};
}
template <typename storage>
inline unsigned int
wi::int_traits < generic_wide_int <storage> >::
get_precision (const generic_wide_int <storage> &x)
{
return x.get_precision ();
}
template <typename storage>
inline wi::storage_ref
wi::int_traits < generic_wide_int <storage> >::
decompose (long *, unsigned int precision,
const generic_wide_int <storage> &x)
{
((void)(!(precision == x.get_precision ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 984, __FUNCTION__), 0 : 0));
return wi::storage_ref (x.get_val (), x.get_len (), precision);
}
template <bool SE, bool HDP>
class wide_int_ref_storage : public wi::storage_ref
{
private:
long scratch[2];
public:
wide_int_ref_storage () {}
wide_int_ref_storage (const wi::storage_ref &);
template <typename T>
wide_int_ref_storage (const T &);
template <typename T>
wide_int_ref_storage (const T &, unsigned int);
};
template <bool SE, bool HDP>
inline wide_int_ref_storage <SE, HDP>::
wide_int_ref_storage (const wi::storage_ref &x)
: storage_ref (x)
{}
template <bool SE, bool HDP>
template <typename T>
inline wide_int_ref_storage <SE, HDP>::wide_int_ref_storage (const T &x)
: storage_ref (wi::int_traits <T>::decompose (scratch,
wi::get_precision (x), x))
{
}
template <bool SE, bool HDP>
template <typename T>
inline wide_int_ref_storage <SE, HDP>::
wide_int_ref_storage (const T &x, unsigned int precision)
: storage_ref (wi::int_traits <T>::decompose (scratch, precision, x))
{
}
namespace wi
{
template <bool SE, bool HDP>
struct int_traits <wide_int_ref_storage <SE, HDP> >
{
static const enum precision_type precision_type = VAR_PRECISION;
static const bool host_dependent_precision = HDP;
static const bool is_sign_extended = SE;
};
}
namespace wi
{
unsigned int force_to_size (long *, const long *,
unsigned int, unsigned int, unsigned int,
signop sgn);
unsigned int from_array (long *, const long *,
unsigned int, unsigned int, bool = true);
}
class wide_int_storage
{
private:
long val[((160 + 64) / 64)];
unsigned int len;
unsigned int precision;
public:
wide_int_storage ();
template <typename T>
wide_int_storage (const T &);
unsigned int get_precision () const;
const long *get_val () const;
unsigned int get_len () const;
long *write_val ();
void set_len (unsigned int, bool = false);
template <typename T>
wide_int_storage &operator = (const T &);
static wide_int from (const wide_int_ref &, unsigned int, signop);
static wide_int from_array (const long *, unsigned int,
unsigned int, bool = true);
static wide_int create (unsigned int);
wide_int bswap () const;
};
namespace wi
{
template <>
struct int_traits <wide_int_storage>
{
static const enum precision_type precision_type = VAR_PRECISION;
static const bool host_dependent_precision = false;
static const bool is_sign_extended = true;
template <typename T1, typename T2>
static wide_int get_binary_result (const T1 &, const T2 &);
};
}
inline wide_int_storage::wide_int_storage () {}
template <typename T>
inline wide_int_storage::wide_int_storage (const T &x)
{
{ static_assert ((!wi::int_traits<T>::host_dependent_precision), "!wi::int_traits<T>::host_dependent_precision"); }
{ static_assert ((wi::int_traits<T>::precision_type != wi::CONST_PRECISION), "wi::int_traits<T>::precision_type != wi::CONST_PRECISION"); }
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
precision = xi.precision;
wi::copy (*this, xi);
}
template <typename T>
inline wide_int_storage&
wide_int_storage::operator = (const T &x)
{
{ static_assert ((!wi::int_traits<T>::host_dependent_precision), "!wi::int_traits<T>::host_dependent_precision"); }
{ static_assert ((wi::int_traits<T>::precision_type != wi::CONST_PRECISION), "wi::int_traits<T>::precision_type != wi::CONST_PRECISION"); }
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
precision = xi.precision;
wi::copy (*this, xi);
return *this;
}
inline unsigned int
wide_int_storage::get_precision () const
{
return precision;
}
inline const long *
wide_int_storage::get_val () const
{
return val;
}
inline unsigned int
wide_int_storage::get_len () const
{
return len;
}
inline long *
wide_int_storage::write_val ()
{
return val;
}
inline void
wide_int_storage::set_len (unsigned int l, bool is_sign_extended)
{
len = l;
if (!is_sign_extended && len * 64 > precision)
val[len - 1] = sext_hwi (val[len - 1],
precision % 64);
}
inline wide_int
wide_int_storage::from (const wide_int_ref &x, unsigned int precision,
signop sgn)
{
wide_int result = wide_int::create (precision);
result.set_len (wi::force_to_size (result.write_val (), x.val, x.len,
x.precision, precision, sgn));
return result;
}
inline wide_int
wide_int_storage::from_array (const long *val, unsigned int len,
unsigned int precision, bool need_canon_p)
{
wide_int result = wide_int::create (precision);
result.set_len (wi::from_array (result.write_val (), val, len, precision,
need_canon_p));
return result;
}
inline wide_int
wide_int_storage::create (unsigned int precision)
{
wide_int x;
x.precision = precision;
return x;
}
template <typename T1, typename T2>
inline wide_int
wi::int_traits <wide_int_storage>::get_binary_result (const T1 &x, const T2 &y)
{
static_assert ((wi::int_traits <T1>::precision_type != FLEXIBLE_PRECISION || wi::int_traits <T2>::precision_type != FLEXIBLE_PRECISION), "wi::int_traits <T1>::precision_type != FLEXIBLE_PRECISION || wi::int_traits <T2>::precision_type != FLEXIBLE_PRECISION")
;
if (wi::int_traits <T1>::precision_type == FLEXIBLE_PRECISION)
return wide_int::create (wi::get_precision (y));
else
return wide_int::create (wi::get_precision (x));
}
template <int N>
class fixed_wide_int_storage
{
private:
long val[(N + 64 + 1) / 64];
unsigned int len;
public:
fixed_wide_int_storage ();
template <typename T>
fixed_wide_int_storage (const T &);
unsigned int get_precision () const;
const long *get_val () const;
unsigned int get_len () const;
long *write_val ();
void set_len (unsigned int, bool = false);
static generic_wide_int < fixed_wide_int_storage <N> > from (const wide_int_ref &, signop);
static generic_wide_int < fixed_wide_int_storage <N> > from_array (const long *, unsigned int,
bool = true);
};
namespace wi
{
template <int N>
struct int_traits < fixed_wide_int_storage <N> >
{
static const enum precision_type precision_type = CONST_PRECISION;
static const bool host_dependent_precision = false;
static const bool is_sign_extended = true;
static const unsigned int precision = N;
template <typename T1, typename T2>
static generic_wide_int < fixed_wide_int_storage <N> > get_binary_result (const T1 &, const T2 &);
};
}
template <int N>
inline fixed_wide_int_storage <N>::fixed_wide_int_storage () {}
template <int N>
template <typename T>
inline fixed_wide_int_storage <N>::fixed_wide_int_storage (const T &x)
{
typename wi::binary_traits <T, generic_wide_int < fixed_wide_int_storage <N> > >::result_type *assertion __attribute__ ((__unused__));
wi::copy (*this, generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > (x, N));
}
template <int N>
inline unsigned int
fixed_wide_int_storage <N>::get_precision () const
{
return N;
}
template <int N>
inline const long *
fixed_wide_int_storage <N>::get_val () const
{
return val;
}
template <int N>
inline unsigned int
fixed_wide_int_storage <N>::get_len () const
{
return len;
}
template <int N>
inline long *
fixed_wide_int_storage <N>::write_val ()
{
return val;
}
template <int N>
inline void
fixed_wide_int_storage <N>::set_len (unsigned int l, bool)
{
len = l;
static_assert ((N % 64 == 0), "N % HOST_BITS_PER_WIDE_INT == 0");
}
template <int N>
inline generic_wide_int < fixed_wide_int_storage <N> >
fixed_wide_int_storage <N>::from (const wide_int_ref &x, signop sgn)
{
generic_wide_int < fixed_wide_int_storage <N> > result;
result.set_len (wi::force_to_size (result.write_val (), x.val, x.len,
x.precision, N, sgn));
return result;
}
template <int N>
inline generic_wide_int < fixed_wide_int_storage <N> >
fixed_wide_int_storage <N>::from_array (const long *val,
unsigned int len,
bool need_canon_p)
{
generic_wide_int < fixed_wide_int_storage <N> > result;
result.set_len (wi::from_array (result.write_val (), val, len,
N, need_canon_p));
return result;
}
template <int N>
template <typename T1, typename T2>
inline generic_wide_int < fixed_wide_int_storage <N> >
wi::int_traits < fixed_wide_int_storage <N> >::
get_binary_result (const T1 &, const T2 &)
{
return generic_wide_int < fixed_wide_int_storage <N> > ();
}
class trailing_wide_int_storage
{
private:
unsigned int m_precision;
unsigned char *m_len;
long *m_val;
public:
trailing_wide_int_storage (unsigned int, unsigned char *, long *);
unsigned int get_len () const;
unsigned int get_precision () const;
const long *get_val () const;
long *write_val ();
void set_len (unsigned int, bool = false);
template <typename T>
trailing_wide_int_storage &operator = (const T &);
};
typedef generic_wide_int <trailing_wide_int_storage> trailing_wide_int;
namespace wi
{
template <>
struct int_traits <trailing_wide_int_storage>
: public int_traits <wide_int_storage> {};
}
template <int N>
struct trailing_wide_ints
{
private:
unsigned short m_precision;
unsigned char m_max_len;
unsigned char m_len[N];
long m_val[1];
public:
typedef generic_wide_int <wide_int_ref_storage <wi::int_traits <trailing_wide_int_storage>::is_sign_extended, wi::int_traits <trailing_wide_int_storage>::host_dependent_precision> > const_reference;
void set_precision (unsigned int);
unsigned int get_precision () const { return m_precision; }
trailing_wide_int operator [] (unsigned int);
const_reference operator [] (unsigned int) const;
static size_t extra_size (unsigned int);
size_t extra_size () const { return extra_size (m_precision); }
};
inline trailing_wide_int_storage::
trailing_wide_int_storage (unsigned int precision, unsigned char *len,
long *val)
: m_precision (precision), m_len (len), m_val (val)
{
}
inline unsigned int
trailing_wide_int_storage::get_len () const
{
return *m_len;
}
inline unsigned int
trailing_wide_int_storage::get_precision () const
{
return m_precision;
}
inline const long *
trailing_wide_int_storage::get_val () const
{
return m_val;
}
inline long *
trailing_wide_int_storage::write_val ()
{
return m_val;
}
inline void
trailing_wide_int_storage::set_len (unsigned int len, bool is_sign_extended)
{
*m_len = len;
if (!is_sign_extended && len * 64 > m_precision)
m_val[len - 1] = sext_hwi (m_val[len - 1],
m_precision % 64);
}
template <typename T>
inline trailing_wide_int_storage &
trailing_wide_int_storage::operator = (const T &x)
{
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, m_precision);
wi::copy (*this, xi);
return *this;
}
template <int N>
inline void
trailing_wide_ints <N>::set_precision (unsigned int precision)
{
m_precision = precision;
m_max_len = ((precision + 64 - 1)
/ 64);
}
template <int N>
inline trailing_wide_int
trailing_wide_ints <N>::operator [] (unsigned int index)
{
return trailing_wide_int_storage (m_precision, &m_len[index],
&m_val[index * m_max_len]);
}
template <int N>
inline typename trailing_wide_ints <N>::const_reference
trailing_wide_ints <N>::operator [] (unsigned int index) const
{
return wi::storage_ref (&m_val[index * m_max_len],
m_len[index], m_precision);
}
template <int N>
inline size_t
trailing_wide_ints <N>::extra_size (unsigned int precision)
{
unsigned int max_len = ((precision + 64 - 1)
/ 64);
return (N * max_len - 1) * sizeof (long);
}
# 1503 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
namespace wi
{
template <typename T, bool signed_p>
struct primitive_int_traits
{
static const enum precision_type precision_type = FLEXIBLE_PRECISION;
static const bool host_dependent_precision = true;
static const bool is_sign_extended = true;
static unsigned int get_precision (T);
static wi::storage_ref decompose (long *, unsigned int, T);
};
}
template <typename T, bool signed_p>
inline unsigned int
wi::primitive_int_traits <T, signed_p>::get_precision (T)
{
return sizeof (T) * 8;
}
template <typename T, bool signed_p>
inline wi::storage_ref
wi::primitive_int_traits <T, signed_p>::decompose (long *scratch,
unsigned int precision, T x)
{
scratch[0] = x;
if (signed_p || scratch[0] >= 0 || precision <= 64)
return wi::storage_ref (scratch, 1, precision);
scratch[1] = 0;
return wi::storage_ref (scratch, 2, precision);
}
namespace wi
{
template <>
struct int_traits <unsigned char>
: public primitive_int_traits <unsigned char, false> {};
template <>
struct int_traits <unsigned short>
: public primitive_int_traits <unsigned short, false> {};
template <>
struct int_traits <int>
: public primitive_int_traits <int, true> {};
template <>
struct int_traits <unsigned int>
: public primitive_int_traits <unsigned int, false> {};
template <>
struct int_traits <long>
: public primitive_int_traits <long, true> {};
template <>
struct int_traits <unsigned long>
: public primitive_int_traits <unsigned long, false> {};
template <>
struct int_traits <long long>
: public primitive_int_traits <long long, true> {};
template <>
struct int_traits <unsigned long long>
: public primitive_int_traits <unsigned long long, false> {};
}
namespace wi
{
class hwi_with_prec
{
public:
hwi_with_prec () {}
hwi_with_prec (long, unsigned int, signop);
long val;
unsigned int precision;
signop sgn;
};
hwi_with_prec shwi (long, unsigned int);
hwi_with_prec uhwi (unsigned long, unsigned int);
hwi_with_prec minus_one (unsigned int);
hwi_with_prec zero (unsigned int);
hwi_with_prec one (unsigned int);
hwi_with_prec two (unsigned int);
}
inline wi::hwi_with_prec::hwi_with_prec (long v, unsigned int p,
signop s)
: precision (p), sgn (s)
{
if (precision < 64)
val = sext_hwi (v, precision);
else
val = v;
}
inline wi::hwi_with_prec
wi::shwi (long val, unsigned int precision)
{
return hwi_with_prec (val, precision, SIGNED);
}
inline wi::hwi_with_prec
wi::uhwi (unsigned long val, unsigned int precision)
{
return hwi_with_prec (val, precision, UNSIGNED);
}
inline wi::hwi_with_prec
wi::minus_one (unsigned int precision)
{
return wi::shwi (-1, precision);
}
inline wi::hwi_with_prec
wi::zero (unsigned int precision)
{
return wi::shwi (0, precision);
}
inline wi::hwi_with_prec
wi::one (unsigned int precision)
{
return wi::shwi (1, precision);
}
inline wi::hwi_with_prec
wi::two (unsigned int precision)
{
return wi::shwi (2, precision);
}
namespace wi
{
template<typename T, precision_type = int_traits<T>::precision_type>
struct ints_for
{
static int zero (const T &) { return 0; }
};
template<typename T>
struct ints_for<T, VAR_PRECISION>
{
static hwi_with_prec zero (const T &);
};
}
template<typename T>
inline wi::hwi_with_prec
wi::ints_for<T, wi::VAR_PRECISION>::zero (const T &x)
{
return wi::zero (wi::get_precision (x));
}
namespace wi
{
template <>
struct int_traits <wi::hwi_with_prec>
{
static const enum precision_type precision_type = VAR_PRECISION;
static const bool host_dependent_precision = false;
static const bool is_sign_extended = true;
static unsigned int get_precision (const wi::hwi_with_prec &);
static wi::storage_ref decompose (long *, unsigned int,
const wi::hwi_with_prec &);
};
}
inline unsigned int
wi::int_traits <wi::hwi_with_prec>::get_precision (const wi::hwi_with_prec &x)
{
return x.precision;
}
inline wi::storage_ref
wi::int_traits <wi::hwi_with_prec>::
decompose (long *scratch, unsigned int precision,
const wi::hwi_with_prec &x)
{
((void)(!(precision == x.precision) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 1700, __FUNCTION__), 0 : 0));
scratch[0] = x.val;
if (x.sgn == SIGNED || x.val >= 0 || precision <= 64)
return wi::storage_ref (scratch, 1, precision);
scratch[1] = 0;
return wi::storage_ref (scratch, 2, precision);
}
namespace wi
{
bool eq_p_large (const long *, unsigned int,
const long *, unsigned int, unsigned int);
bool lts_p_large (const long *, unsigned int, unsigned int,
const long *, unsigned int);
bool ltu_p_large (const long *, unsigned int, unsigned int,
const long *, unsigned int);
int cmps_large (const long *, unsigned int, unsigned int,
const long *, unsigned int);
int cmpu_large (const long *, unsigned int, unsigned int,
const long *, unsigned int);
unsigned int sext_large (long *, const long *,
unsigned int,
unsigned int, unsigned int);
unsigned int zext_large (long *, const long *,
unsigned int,
unsigned int, unsigned int);
unsigned int set_bit_large (long *, const long *,
unsigned int, unsigned int, unsigned int);
unsigned int lshift_large (long *, const long *,
unsigned int, unsigned int, unsigned int);
unsigned int lrshift_large (long *, const long *,
unsigned int, unsigned int, unsigned int,
unsigned int);
unsigned int arshift_large (long *, const long *,
unsigned int, unsigned int, unsigned int,
unsigned int);
unsigned int and_large (long *, const long *, unsigned int,
const long *, unsigned int, unsigned int);
unsigned int and_not_large (long *, const long *,
unsigned int, const long *,
unsigned int, unsigned int);
unsigned int or_large (long *, const long *, unsigned int,
const long *, unsigned int, unsigned int);
unsigned int or_not_large (long *, const long *,
unsigned int, const long *,
unsigned int, unsigned int);
unsigned int xor_large (long *, const long *, unsigned int,
const long *, unsigned int, unsigned int);
unsigned int add_large (long *, const long *, unsigned int,
const long *, unsigned int, unsigned int,
signop, overflow_type *);
unsigned int sub_large (long *, const long *, unsigned int,
const long *, unsigned int, unsigned int,
signop, overflow_type *);
unsigned int mul_internal (long *, const long *,
unsigned int, const long *,
unsigned int, unsigned int, signop,
overflow_type *, bool);
unsigned int divmod_internal (long *, unsigned int *,
long *, const long *,
unsigned int, unsigned int,
const long *,
unsigned int, unsigned int,
signop, overflow_type *);
}
template <typename T>
inline unsigned int
wi::get_precision (const T &x)
{
return wi::int_traits <T>::get_precision (x);
}
template <typename T1, typename T2>
inline unsigned int
wi::get_binary_precision (const T1 &x, const T2 &y)
{
return get_precision (wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::
get_binary_result (x, y));
}
template <typename T1, typename T2>
inline void
wi::copy (T1 &x, const T2 &y)
{
long *xval = x.write_val ();
const long *yval = y.get_val ();
unsigned int len = y.get_len ();
unsigned int i = 0;
do
xval[i] = yval[i];
while (++i < len);
x.set_len (len, y.is_sign_extended);
}
template <typename T>
inline bool
wi::fits_shwi_p (const T &x)
{
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
return xi.len == 1;
}
template <typename T>
inline bool
wi::fits_uhwi_p (const T &x)
{
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
if (xi.precision <= 64)
return true;
if (xi.len == 1)
return xi.slow () >= 0;
return xi.len == 2 && xi.uhigh () == 0;
}
template <typename T>
inline bool
wi::neg_p (const T &x, signop sgn)
{
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
if (sgn == UNSIGNED)
return false;
return xi.sign_mask () < 0;
}
template <typename T>
inline long
wi::sign_mask (const T &x)
{
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x);
return xi.sign_mask ();
}
template <typename T1, typename T2>
inline bool
wi::eq_p (const T1 &x, const T2 &y)
{
unsigned int precision = get_binary_precision (x, y);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (xi.is_sign_extended && yi.is_sign_extended)
{
if (xi.len != yi.len)
return false;
unsigned int i = 0;
do
if (xi.val[i] != yi.val[i])
return false;
while (++i != xi.len);
return true;
}
if (__builtin_expect (yi.len == 1, true))
{
if (xi.len != 1)
return false;
if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0)))
return xi.val[0] == 0;
unsigned long diff = xi.val[0] ^ yi.val[0];
int excess = 64 - precision;
if (excess > 0)
diff <<= excess;
return diff == 0;
}
return eq_p_large (xi.val, xi.len, yi.val, yi.len, precision);
}
template <typename T1, typename T2>
inline bool
wi::ne_p (const T1 &x, const T2 &y)
{
return !eq_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::lts_p (const T1 &x, const T2 &y)
{
unsigned int precision = get_binary_precision (x, y);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (wi::fits_shwi_p (yi))
{
if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0)))
return neg_p (xi);
if (wi::fits_shwi_p (xi))
return xi.to_shwi () < yi.to_shwi ();
if (neg_p (xi))
return true;
return false;
}
if ((__builtin_constant_p (xi.len == 1) && (xi.len == 1)))
return !neg_p (yi);
return lts_p_large (xi.val, xi.len, precision, yi.val, yi.len);
}
template <typename T1, typename T2>
inline bool
wi::ltu_p (const T1 &x, const T2 &y)
{
unsigned int precision = get_binary_precision (x, y);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if ((__builtin_constant_p (yi.len == 1 && yi.val[0] >= 0) && (yi.len == 1 && yi.val[0] >= 0)))
return xi.len == 1 && xi.to_uhwi () < (unsigned long) yi.val[0];
if ((__builtin_constant_p (xi.len == 1 && xi.val[0] >= 0) && (xi.len == 1 && xi.val[0] >= 0)))
return yi.len != 1 || yi.to_uhwi () > (unsigned long) xi.val[0];
if (__builtin_expect (xi.len + yi.len == 2, true))
{
unsigned long xl = xi.to_uhwi ();
unsigned long yl = yi.to_uhwi ();
return xl < yl;
}
return ltu_p_large (xi.val, xi.len, precision, yi.val, yi.len);
}
template <typename T1, typename T2>
inline bool
wi::lt_p (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == SIGNED)
return lts_p (x, y);
else
return ltu_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::les_p (const T1 &x, const T2 &y)
{
return !lts_p (y, x);
}
template <typename T1, typename T2>
inline bool
wi::leu_p (const T1 &x, const T2 &y)
{
return !ltu_p (y, x);
}
template <typename T1, typename T2>
inline bool
wi::le_p (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == SIGNED)
return les_p (x, y);
else
return leu_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::gts_p (const T1 &x, const T2 &y)
{
return lts_p (y, x);
}
template <typename T1, typename T2>
inline bool
wi::gtu_p (const T1 &x, const T2 &y)
{
return ltu_p (y, x);
}
template <typename T1, typename T2>
inline bool
wi::gt_p (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == SIGNED)
return gts_p (x, y);
else
return gtu_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::ges_p (const T1 &x, const T2 &y)
{
return !lts_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::geu_p (const T1 &x, const T2 &y)
{
return !ltu_p (x, y);
}
template <typename T1, typename T2>
inline bool
wi::ge_p (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == SIGNED)
return ges_p (x, y);
else
return geu_p (x, y);
}
template <typename T1, typename T2>
inline int
wi::cmps (const T1 &x, const T2 &y)
{
unsigned int precision = get_binary_precision (x, y);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (wi::fits_shwi_p (yi))
{
if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0)))
return neg_p (xi) ? -1 : !(xi.len == 1 && xi.val[0] == 0);
if (wi::fits_shwi_p (xi))
{
long xl = xi.to_shwi ();
long yl = yi.to_shwi ();
return xl < yl ? -1 : xl > yl;
}
if (neg_p (xi))
return -1;
return 1;
}
if ((__builtin_constant_p (xi.len == 1) && (xi.len == 1)))
return neg_p (yi) ? 1 : -1;
return cmps_large (xi.val, xi.len, precision, yi.val, yi.len);
}
template <typename T1, typename T2>
inline int
wi::cmpu (const T1 &x, const T2 &y)
{
unsigned int precision = get_binary_precision (x, y);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if ((__builtin_constant_p (yi.len == 1 && yi.val[0] >= 0) && (yi.len == 1 && yi.val[0] >= 0)))
{
if (xi.len != 1)
return 1;
unsigned long xl = xi.to_uhwi ();
unsigned long yl = yi.val[0];
return xl < yl ? -1 : xl > yl;
}
if ((__builtin_constant_p (xi.len == 1 && xi.val[0] >= 0) && (xi.len == 1 && xi.val[0] >= 0)))
{
if (yi.len != 1)
return -1;
unsigned long xl = xi.val[0];
unsigned long yl = yi.to_uhwi ();
return xl < yl ? -1 : xl > yl;
}
if (__builtin_expect (xi.len + yi.len == 2, true))
{
unsigned long xl = xi.to_uhwi ();
unsigned long yl = yi.to_uhwi ();
return xl < yl ? -1 : xl > yl;
}
return cmpu_large (xi.val, xi.len, precision, yi.val, yi.len);
}
template <typename T1, typename T2>
inline int
wi::cmp (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == SIGNED)
return cmps (x, y);
else
return cmpu (x, y);
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::bit_not (const T &x)
{
typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, get_precision (result));
for (unsigned int i = 0; i < xi.len; ++i)
val[i] = ~xi.val[i];
result.set_len (xi.len);
return result;
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::neg (const T &x)
{
return sub (0, x);
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::neg (const T &x, overflow_type *overflow)
{
*overflow = only_sign_bit_p (x) ? OVF_OVERFLOW : OVF_NONE;
return sub (0, x);
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::abs (const T &x)
{
return neg_p (x) ? neg (x) : typename wi::binary_traits <T, T>::result_type (x);
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::sext (const T &x, unsigned int offset)
{
typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision);
if (offset <= 64)
{
val[0] = sext_hwi (xi.ulow (), offset);
result.set_len (1, true);
}
else
result.set_len (sext_large (val, xi.val, xi.len, precision, offset));
return result;
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::zext (const T &x, unsigned int offset)
{
typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision);
if (offset >= precision)
{
wi::copy (result, xi);
return result;
}
if (offset < 64)
{
val[0] = zext_hwi (xi.ulow (), offset);
result.set_len (1, true);
}
else
result.set_len (zext_large (val, xi.val, xi.len, precision, offset), true);
return result;
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::ext (const T &x, unsigned int offset, signop sgn)
{
return sgn == SIGNED ? sext (x, offset) : zext (x, offset);
}
template <typename T>
inline typename wi::binary_traits <T, T>::result_type
wi::set_bit (const T &x, unsigned int bit)
{
typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision);
if (precision <= 64)
{
val[0] = xi.ulow () | (1UL << bit);
result.set_len (1);
}
else
result.set_len (set_bit_large (val, xi.val, xi.len, precision, bit));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::min (const T1 &x, const T2 &y, signop sgn)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val __attribute__ ((__unused__)) = result.write_val ();
unsigned int precision = get_precision (result);
if (wi::le_p (x, y, sgn))
wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > (x, precision));
else
wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > (y, precision));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::smin (const T1 &x, const T2 &y)
{
return wi::min (x, y, SIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::umin (const T1 &x, const T2 &y)
{
return wi::min (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::max (const T1 &x, const T2 &y, signop sgn)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val __attribute__ ((__unused__)) = result.write_val ();
unsigned int precision = get_precision (result);
if (wi::ge_p (x, y, sgn))
wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > (x, precision));
else
wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > (y, precision));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::smax (const T1 &x, const T2 &y)
{
return wi::max (x, y, SIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::umax (const T1 &x, const T2 &y)
{
return wi::max (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::bit_and (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
if (__builtin_expect (xi.len + yi.len == 2, true))
{
val[0] = xi.ulow () & yi.ulow ();
result.set_len (1, is_sign_extended);
}
else
result.set_len (and_large (val, xi.val, xi.len, yi.val, yi.len,
precision), is_sign_extended);
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::bit_and_not (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
if (__builtin_expect (xi.len + yi.len == 2, true))
{
val[0] = xi.ulow () & ~yi.ulow ();
result.set_len (1, is_sign_extended);
}
else
result.set_len (and_not_large (val, xi.val, xi.len, yi.val, yi.len,
precision), is_sign_extended);
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::bit_or (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
if (__builtin_expect (xi.len + yi.len == 2, true))
{
val[0] = xi.ulow () | yi.ulow ();
result.set_len (1, is_sign_extended);
}
else
result.set_len (or_large (val, xi.val, xi.len,
yi.val, yi.len, precision), is_sign_extended);
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::bit_or_not (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
if (__builtin_expect (xi.len + yi.len == 2, true))
{
val[0] = xi.ulow () | ~yi.ulow ();
result.set_len (1, is_sign_extended);
}
else
result.set_len (or_not_large (val, xi.val, xi.len, yi.val, yi.len,
precision), is_sign_extended);
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::bit_xor (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
if (__builtin_expect (xi.len + yi.len == 2, true))
{
val[0] = xi.ulow () ^ yi.ulow ();
result.set_len (1, is_sign_extended);
}
else
result.set_len (xor_large (val, xi.val, xi.len,
yi.val, yi.len, precision), is_sign_extended);
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::add (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (precision <= 64)
{
val[0] = xi.ulow () + yi.ulow ();
result.set_len (1);
}
# 2441 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
else if ((__builtin_constant_p (precision > 64) && (precision > 64))
&& __builtin_expect (xi.len + yi.len == 2, true))
{
unsigned long xl = xi.ulow ();
unsigned long yl = yi.ulow ();
unsigned long resultl = xl + yl;
val[0] = resultl;
val[1] = (long) resultl < 0 ? 0 : -1;
result.set_len (1 + (((resultl ^ xl) & (resultl ^ yl))
>> (64 - 1)));
}
else
result.set_len (add_large (val, xi.val, xi.len,
yi.val, yi.len, precision,
UNSIGNED, 0));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::add (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (precision <= 64)
{
unsigned long xl = xi.ulow ();
unsigned long yl = yi.ulow ();
unsigned long resultl = xl + yl;
if (sgn == SIGNED)
{
if ((((resultl ^ xl) & (resultl ^ yl))
>> (precision - 1)) & 1)
{
if (xl > resultl)
*overflow = OVF_UNDERFLOW;
else if (xl < resultl)
*overflow = OVF_OVERFLOW;
else
*overflow = OVF_NONE;
}
else
*overflow = OVF_NONE;
}
else
*overflow = ((resultl << (64 - precision))
< (xl << (64 - precision)))
? OVF_OVERFLOW : OVF_NONE;
val[0] = resultl;
result.set_len (1);
}
else
result.set_len (add_large (val, xi.val, xi.len,
yi.val, yi.len, precision,
sgn, overflow));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::sub (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (precision <= 64)
{
val[0] = xi.ulow () - yi.ulow ();
result.set_len (1);
}
# 2527 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
else if ((__builtin_constant_p (precision > 64) && (precision > 64))
&& __builtin_expect (xi.len + yi.len == 2, true))
{
unsigned long xl = xi.ulow ();
unsigned long yl = yi.ulow ();
unsigned long resultl = xl - yl;
val[0] = resultl;
val[1] = (long) resultl < 0 ? 0 : -1;
result.set_len (1 + (((resultl ^ xl) & (xl ^ yl))
>> (64 - 1)));
}
else
result.set_len (sub_large (val, xi.val, xi.len,
yi.val, yi.len, precision,
UNSIGNED, 0));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::sub (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (precision <= 64)
{
unsigned long xl = xi.ulow ();
unsigned long yl = yi.ulow ();
unsigned long resultl = xl - yl;
if (sgn == SIGNED)
{
if ((((xl ^ yl) & (resultl ^ xl)) >> (precision - 1)) & 1)
{
if (xl > yl)
*overflow = OVF_UNDERFLOW;
else if (xl < yl)
*overflow = OVF_OVERFLOW;
else
*overflow = OVF_NONE;
}
else
*overflow = OVF_NONE;
}
else
*overflow = ((resultl << (64 - precision))
> (xl << (64 - precision)))
? OVF_UNDERFLOW : OVF_NONE;
val[0] = resultl;
result.set_len (1);
}
else
result.set_len (sub_large (val, xi.val, xi.len,
yi.val, yi.len, precision,
sgn, overflow));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mul (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
if (precision <= 64)
{
val[0] = xi.ulow () * yi.ulow ();
result.set_len (1);
}
else
result.set_len (mul_internal (val, xi.val, xi.len, yi.val, yi.len,
precision, UNSIGNED, 0, false));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mul (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
result.set_len (mul_internal (val, xi.val, xi.len,
yi.val, yi.len, precision,
sgn, overflow, false));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::smul (const T1 &x, const T2 &y, overflow_type *overflow)
{
return mul (x, y, SIGNED, overflow);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::umul (const T1 &x, const T2 &y, overflow_type *overflow)
{
return mul (x, y, UNSIGNED, overflow);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mul_high (const T1 &x, const T2 &y, signop sgn)
{
typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision);
result.set_len (mul_internal (val, xi.val, xi.len,
yi.val, yi.len, precision,
sgn, 0, true));
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::div_trunc (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
quotient.set_len (divmod_internal (quotient_val, 0, 0, xi.val, xi.len,
precision,
yi.val, yi.len, yi.precision,
sgn, overflow));
return quotient;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::sdiv_trunc (const T1 &x, const T2 &y)
{
return div_trunc (x, y, SIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::udiv_trunc (const T1 &x, const T2 &y)
{
return div_trunc (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::div_floor (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn) && remainder != 0)
return quotient - 1;
return quotient;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::sdiv_floor (const T1 &x, const T2 &y)
{
return div_floor (x, y, SIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::udiv_floor (const T1 &x, const T2 &y)
{
return div_floor (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::div_ceil (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (wi::neg_p (x, sgn) == wi::neg_p (y, sgn) && remainder != 0)
return quotient + 1;
return quotient;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::udiv_ceil (const T1 &x, const T2 &y)
{
return div_ceil (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::div_round (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (remainder != 0)
{
if (sgn == SIGNED)
{
typename wi::binary_traits <T1, T2>::result_type abs_remainder = wi::abs (remainder);
if (wi::geu_p (abs_remainder, wi::sub (wi::abs (y), abs_remainder)))
{
if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn))
return quotient - 1;
else
return quotient + 1;
}
}
else
{
if (wi::geu_p (remainder, wi::sub (y, remainder)))
return quotient + 1;
}
}
return quotient;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::divmod_trunc (const T1 &x, const T2 &y, signop sgn,
typename wi::binary_traits <T1, T2>::result_type *remainder_ptr)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn, 0));
remainder.set_len (remainder_len);
*remainder_ptr = remainder;
return quotient;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::gcd (const T1 &a, const T2 &b, signop sgn)
{
T1 x, y, z;
x = wi::abs (a);
y = wi::abs (b);
while (gt_p (x, 0, sgn))
{
z = mod_trunc (y, x, sgn);
y = x;
x = z;
}
return y;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mod_trunc (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (remainder);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
divmod_internal (0, &remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn, overflow);
remainder.set_len (remainder_len);
return remainder;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::smod_trunc (const T1 &x, const T2 &y)
{
return mod_trunc (x, y, SIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::umod_trunc (const T1 &x, const T2 &y)
{
return mod_trunc (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mod_floor (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn) && remainder != 0)
return remainder + y;
return remainder;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::umod_floor (const T1 &x, const T2 &y)
{
return mod_floor (x, y, UNSIGNED);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mod_ceil (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (wi::neg_p (x, sgn) == wi::neg_p (y, sgn) && remainder != 0)
return remainder - y;
return remainder;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::result_type
wi::mod_round (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow)
{
typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val ();
typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val ();
unsigned int precision = get_precision (quotient);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
unsigned int remainder_len;
quotient.set_len (divmod_internal (quotient_val,
&remainder_len, remainder_val,
xi.val, xi.len, precision,
yi.val, yi.len, yi.precision, sgn,
overflow));
remainder.set_len (remainder_len);
if (remainder != 0)
{
if (sgn == SIGNED)
{
typename wi::binary_traits <T1, T2>::result_type abs_remainder = wi::abs (remainder);
if (wi::geu_p (abs_remainder, wi::sub (wi::abs (y), abs_remainder)))
{
if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn))
return remainder + y;
else
return remainder - y;
}
}
else
{
if (wi::geu_p (remainder, wi::sub (y, remainder)))
return remainder - y;
}
}
return remainder;
}
template <typename T1, typename T2>
inline bool
wi::multiple_of_p (const T1 &x, const T2 &y, signop sgn)
{
return wi::mod_trunc (x, y, sgn) == 0;
}
template <typename T1, typename T2>
inline bool
wi::multiple_of_p (const T1 &x, const T2 &y, signop sgn,
typename wi::binary_traits <T1, T2>::result_type *res)
{
typename wi::binary_traits <T1, T2>::result_type remainder;
typename wi::binary_traits <T1, T2>::result_type quotient
= divmod_trunc (x, y, sgn, &remainder);
if (remainder == 0)
{
*res = quotient;
return true;
}
return false;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T1>::result_type
wi::lshift (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
unsigned int precision = get_precision (result);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
if (geu_p (yi, precision))
{
val[0] = 0;
result.set_len (1);
}
else
{
unsigned int shift = yi.to_uhwi ();
# 3054 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
if ((__builtin_constant_p (xi.precision > 64) && (xi.precision > 64))
? ((__builtin_constant_p (shift < 64 - 1) && (shift < 64 - 1))
&& xi.len == 1
&& ((unsigned long) (xi.val[0]) - (unsigned long) (0) <= (unsigned long) ((~((long) (1UL << (64 - 1)))) >> shift) - (unsigned long) (0)))
: precision <= 64)
{
val[0] = xi.ulow () << shift;
result.set_len (1);
}
else
result.set_len (lshift_large (val, xi.val, xi.len,
precision, shift));
}
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T1>::result_type
wi::lrshift (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
if (geu_p (yi, xi.precision))
{
val[0] = 0;
result.set_len (1);
}
else
{
unsigned int shift = yi.to_uhwi ();
# 3098 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
if ((__builtin_constant_p (xi.precision > 64) && (xi.precision > 64))
? (shift < 64
&& xi.len == 1
&& xi.val[0] >= 0)
: xi.precision <= 64)
{
val[0] = xi.to_uhwi () >> shift;
result.set_len (1);
}
else
result.set_len (lrshift_large (val, xi.val, xi.len, xi.precision,
get_precision (result), shift));
}
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T1>::result_type
wi::arshift (const T1 &x, const T2 &y)
{
typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val ();
generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x);
generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y);
if (geu_p (yi, xi.precision))
{
val[0] = sign_mask (x);
result.set_len (1);
}
else
{
unsigned int shift = yi.to_uhwi ();
if (xi.precision <= 64)
{
val[0] = sext_hwi (xi.ulow () >> shift, xi.precision - shift);
result.set_len (1, true);
}
else
result.set_len (arshift_large (val, xi.val, xi.len, xi.precision,
get_precision (result), shift));
}
return result;
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T1>::result_type
wi::rshift (const T1 &x, const T2 &y, signop sgn)
{
if (sgn == UNSIGNED)
return lrshift (x, y);
else
return arshift (x, y);
}
template <typename T1, typename T2>
typename wi::binary_traits <T1, T1>::result_type
wi::lrotate (const T1 &x, const T2 &y, unsigned int width)
{
unsigned int precision = get_binary_precision (x, x);
if (width == 0)
width = precision;
typename wi::binary_traits <T2, T2>::result_type ymod = umod_trunc (y, width);
typename wi::binary_traits <T1, T1>::result_type left = wi::lshift (x, ymod);
typename wi::binary_traits <T1, T1>::result_type right = wi::lrshift (x, wi::sub (width, ymod));
if (width != precision)
return wi::zext (left, width) | wi::zext (right, width);
return left | right;
}
template <typename T1, typename T2>
typename wi::binary_traits <T1, T1>::result_type
wi::rrotate (const T1 &x, const T2 &y, unsigned int width)
{
unsigned int precision = get_binary_precision (x, x);
if (width == 0)
width = precision;
typename wi::binary_traits <T2, T2>::result_type ymod = umod_trunc (y, width);
typename wi::binary_traits <T1, T1>::result_type right = wi::lrshift (x, ymod);
typename wi::binary_traits <T1, T1>::result_type left = wi::lshift (x, wi::sub (width, ymod));
if (width != precision)
return wi::zext (left, width) | wi::zext (right, width);
return left | right;
}
inline int
wi::parity (const wide_int_ref &x)
{
return popcount (x) & 1;
}
template <typename T>
inline unsigned long
wi::extract_uhwi (const T &x, unsigned int bitpos, unsigned int width)
{
unsigned precision = get_precision (x);
if (precision < bitpos + width)
precision = bitpos + width;
generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision);
if (width == 0)
return 0;
unsigned int start = bitpos / 64;
unsigned int shift = bitpos % 64;
unsigned long res = xi.elt (start);
res >>= shift;
if (shift + width > 64)
{
unsigned long upper = xi.elt (start + 1);
res |= upper << (-shift % 64);
}
return zext_hwi (res, width);
}
template <typename T>
inline unsigned int
wi::min_precision (const T &x, signop sgn)
{
if (sgn == SIGNED)
return get_precision (x) - clrsb (x);
else
return get_precision (x) - clz (x);
}
# 3248 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator < (const T1 &x, const T2 &y) { return wi::lts_p (x, y); }
template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator <= (const T1 &x, const T2 &y) { return wi::les_p (x, y); }
template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator > (const T1 &x, const T2 &y) { return wi::gts_p (x, y); }
template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator >= (const T1 &x, const T2 &y) { return wi::ges_p (x, y); }
# 3287 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h"
template<typename T> typename wi::binary_traits <generic_wide_int<T>, generic_wide_int<T> >::result_type operator ~ (const generic_wide_int<T> &x) { return wi::bit_not (x); }
template<typename T> typename wi::binary_traits <generic_wide_int<T>, generic_wide_int<T> >::result_type operator - (const generic_wide_int<T> &x) { return wi::neg (x); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::predicate_result operator == (const T1 &x, const T2 &y) { return wi::eq_p (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::predicate_result operator != (const T1 &x, const T2 &y) { return wi::ne_p (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator & (const T1 &x, const T2 &y) { return wi::bit_and (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator | (const T1 &x, const T2 &y) { return wi::bit_or (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator ^ (const T1 &x, const T2 &y) { return wi::bit_xor (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator + (const T1 &x, const T2 &y) { return wi::add (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator - (const T1 &x, const T2 &y) { return wi::sub (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator * (const T1 &x, const T2 &y) { return wi::mul (x, y); }
template<typename T1, typename T2> typename wi::binary_traits <T1, T1>::operator_result operator << (const T1 &x, const T2 &y) { return wi::lshift (x, y); }
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::signed_shift_result_type
operator >> (const T1 &x, const T2 &y)
{
return wi::arshift (x, y);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::signed_shift_result_type
operator / (const T1 &x, const T2 &y)
{
return wi::sdiv_trunc (x, y);
}
template <typename T1, typename T2>
inline typename wi::binary_traits <T1, T2>::signed_shift_result_type
operator % (const T1 &x, const T2 &y)
{
return wi::smod_trunc (x, y);
}
template<typename T>
void
gt_ggc_mx (generic_wide_int <T> *)
{
}
template<typename T>
void
gt_pch_nx (generic_wide_int <T> *)
{
}
template<typename T>
void
gt_pch_nx (generic_wide_int <T> *, void (*) (void *, void *), void *)
{
}
template<int N>
void
gt_ggc_mx (trailing_wide_ints <N> *)
{
}
template<int N>
void
gt_pch_nx (trailing_wide_ints <N> *)
{
}
template<int N>
void
gt_pch_nx (trailing_wide_ints <N> *, void (*) (void *, void *), void *)
{
}
namespace wi
{
struct never_used1 {};
struct never_used2 {};
wide_int min_value (unsigned int, signop);
wide_int min_value (never_used1 *);
wide_int min_value (never_used2 *);
wide_int max_value (unsigned int, signop);
wide_int max_value (never_used1 *);
wide_int max_value (never_used2 *);
wide_int from_buffer (const unsigned char *, unsigned int);
void to_mpz (const wide_int_ref &, mpz_t, signop);
wide_int mask (unsigned int, bool, unsigned int);
wide_int shifted_mask (unsigned int, unsigned int, bool, unsigned int);
wide_int set_bit_in_zero (unsigned int, unsigned int);
wide_int insert (const wide_int &x, const wide_int &y, unsigned int,
unsigned int);
wide_int round_down_for_mask (const wide_int &, const wide_int &);
wide_int round_up_for_mask (const wide_int &, const wide_int &);
wide_int mod_inv (const wide_int &a, const wide_int &b);
template <typename T>
T mask (unsigned int, bool);
template <typename T>
T shifted_mask (unsigned int, unsigned int, bool);
template <typename T>
T set_bit_in_zero (unsigned int);
unsigned int mask (long *, unsigned int, bool, unsigned int);
unsigned int shifted_mask (long *, unsigned int, unsigned int,
bool, unsigned int);
unsigned int from_array (long *, const long *,
unsigned int, unsigned int, bool);
}
inline wide_int
wi::mask (unsigned int width, bool negate_p, unsigned int precision)
{
wide_int result = wide_int::create (precision);
result.set_len (mask (result.write_val (), width, negate_p, precision));
return result;
}
inline wide_int
wi::shifted_mask (unsigned int start, unsigned int width, bool negate_p,
unsigned int precision)
{
wide_int result = wide_int::create (precision);
result.set_len (shifted_mask (result.write_val (), start, width, negate_p,
precision));
return result;
}
inline wide_int
wi::set_bit_in_zero (unsigned int bit, unsigned int precision)
{
return shifted_mask (bit, 1, false, precision);
}
template <typename T>
inline T
wi::mask (unsigned int width, bool negate_p)
{
static_assert ((wi::int_traits<T>::precision), "wi::int_traits<T>::precision");
T result;
result.set_len (mask (result.write_val (), width, negate_p,
wi::int_traits <T>::precision));
return result;
}
template <typename T>
inline T
wi::shifted_mask (unsigned int start, unsigned int width, bool negate_p)
{
static_assert ((wi::int_traits<T>::precision), "wi::int_traits<T>::precision");
T result;
result.set_len (shifted_mask (result.write_val (), start, width,
negate_p,
wi::int_traits <T>::precision));
return result;
}
template <typename T>
inline T
wi::set_bit_in_zero (unsigned int bit)
{
return shifted_mask <T> (bit, 1, false);
}
static inline void
wi::accumulate_overflow (wi::overflow_type &overflow,
wi::overflow_type suboverflow)
{
if (!suboverflow)
return;
if (!overflow)
overflow = suboverflow;
else if (overflow != suboverflow)
overflow = wi::OVF_UNKNOWN;
}
# 452 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int-print.h" 1
# 29 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int-print.h"
extern void print_dec (const wide_int_ref &wi, char *buf, signop sgn);
extern void print_dec (const wide_int_ref &wi, FILE *file, signop sgn);
extern void print_decs (const wide_int_ref &wi, char *buf);
extern void print_decs (const wide_int_ref &wi, FILE *file);
extern void print_decu (const wide_int_ref &wi, char *buf);
extern void print_decu (const wide_int_ref &wi, FILE *file);
extern void print_hex (const wide_int_ref &wi, char *buf);
extern void print_hex (const wide_int_ref &wi, FILE *file);
# 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 466 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" 1
# 32 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename T> struct poly_int_pod;
template<unsigned int N, typename T> class poly_int;
# 62 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<typename T, wi::precision_type = wi::int_traits<T>::precision_type>
struct poly_coeff_traits;
template<typename T>
struct poly_coeff_traits<T, wi::FLEXIBLE_PRECISION>
{
typedef T result;
typedef T int_type;
static const int signedness = (T (0) >= T (-1));
static const int precision = sizeof (T) * 8;
static const T max_value = (signedness
? ((T (1) << (precision - 2))
+ ((T (1) << (precision - 2)) - 1))
: T (-1));
static const int rank = sizeof (T) * 2 + !signedness;
};
template<typename T>
struct poly_coeff_traits<T, wi::VAR_PRECISION>
{
typedef T result;
typedef int int_type;
static const int signedness = -1;
static const int precision = (((160 + 64) / 64) * 64);
static const int rank = 0x7fffffff;
};
template<typename T>
struct poly_coeff_traits<T, wi::CONST_PRECISION>
{
typedef typename wi::binary_traits <T, T>::result_type result;
typedef int int_type;
static const int signedness = 1;
static const int precision = wi::int_traits<T>::precision;
static const int rank = precision * 2 / 8;
};
template<typename T1, typename T2>
struct poly_coeff_pair_traits
{
# 118 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
static const bool lossless_p = (poly_coeff_traits<T1>::signedness
== poly_coeff_traits<T2>::signedness
? (poly_coeff_traits<T1>::precision
>= poly_coeff_traits<T2>::precision)
: (poly_coeff_traits<T1>::signedness == 1
&& poly_coeff_traits<T2>::signedness == 0
&& (poly_coeff_traits<T1>::precision
> poly_coeff_traits<T2>::precision)));
static const int result_kind
= ((poly_coeff_traits<T1>::rank <= poly_coeff_traits<long>::rank
&& poly_coeff_traits<T2>::rank <= poly_coeff_traits<long>::rank)
? 0
: (poly_coeff_traits<T1>::rank <= poly_coeff_traits<unsigned long>::rank
&& poly_coeff_traits<T2>::rank <= poly_coeff_traits<unsigned long>::rank)
? 1 : 2);
};
template<typename T1, typename T2, typename T3,
bool lossless_p = poly_coeff_pair_traits<T1, T2>::lossless_p>
struct if_lossless;
template<typename T1, typename T2, typename T3>
struct if_lossless<T1, T2, T3, true>
{
typedef T3 type;
};
# 166 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<typename T>
struct poly_int_traits
{
static const bool is_poly = false;
static const unsigned int num_coeffs = 1;
typedef T coeff_type;
typedef typename poly_coeff_traits<T>::int_type int_type;
};
template<unsigned int N, typename C>
struct poly_int_traits<poly_int_pod<N, C> >
{
static const bool is_poly = true;
static const unsigned int num_coeffs = N;
typedef C coeff_type;
typedef typename poly_coeff_traits<C>::int_type int_type;
};
template<unsigned int N, typename C>
struct poly_int_traits<poly_int<N, C> > : poly_int_traits<poly_int_pod<N, C> >
{
};
template<typename T1, typename T2 = T1,
bool is_poly = poly_int_traits<T1>::is_poly>
struct if_nonpoly {};
template<typename T1, typename T2>
struct if_nonpoly<T1, T2, false>
{
typedef T2 type;
};
template<typename T1, typename T2, typename T3,
bool is_poly1 = poly_int_traits<T1>::is_poly,
bool is_poly2 = poly_int_traits<T2>::is_poly>
struct if_nonpoly2 {};
template<typename T1, typename T2, typename T3>
struct if_nonpoly2<T1, T2, T3, false, false>
{
typedef T3 type;
};
template<typename T1, typename T2 = T1,
bool is_poly = poly_int_traits<T1>::is_poly>
struct if_poly {};
template<typename T1, typename T2>
struct if_poly<T1, T2, true>
{
typedef T2 type;
};
# 234 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<typename T1, typename T2 = T1,
int result_kind = poly_coeff_pair_traits<T1, T2>::result_kind>
struct poly_result;
template<typename T1, typename T2>
struct poly_result<T1, T2, 0>
{
typedef long type;
typedef type cast;
};
template<typename T1, typename T2>
struct poly_result<T1, T2, 1>
{
typedef unsigned long type;
typedef type cast;
};
template<typename T1, typename T2>
struct poly_result<T1, T2, 2>
{
typedef typename wi::binary_traits <T1, T2>::result_type type;
typedef const T1 &cast;
};
# 337 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename C>
struct poly_int_pod
{
public:
template<typename Ca>
poly_int_pod &operator = (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int_pod>::type &operator = (const Ca &);
template<typename Ca>
poly_int_pod &operator += (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int_pod>::type &operator += (const Ca &);
template<typename Ca>
poly_int_pod &operator -= (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int_pod>::type &operator -= (const Ca &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int_pod>::type &operator *= (const Ca &);
poly_int_pod &operator <<= (unsigned int);
bool is_constant () const;
template<typename T>
typename if_lossless<T, C, bool>::type is_constant (T *) const;
C to_constant () const;
template<typename Ca>
static poly_int<N, C> from (const poly_int_pod<N, Ca> &, unsigned int,
signop);
template<typename Ca>
static poly_int<N, C> from (const poly_int_pod<N, Ca> &, signop);
bool to_shwi (poly_int_pod<N, long> *) const;
bool to_uhwi (poly_int_pod<N, unsigned long> *) const;
poly_int<N, long> force_shwi () const;
poly_int<N, unsigned long> force_uhwi () const;
C coeffs[N];
};
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int_pod<N, C>&
poly_int_pod<N, C>::operator = (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i])));
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
poly_int_pod<N, C>::operator = (const Ca &a)
{
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = a) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (a)));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0]))));
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int_pod<N, C>&
poly_int_pod<N, C>::operator += (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] += a.coeffs[i];
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
poly_int_pod<N, C>::operator += (const Ca &a)
{
this->coeffs[0] += a;
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int_pod<N, C>&
poly_int_pod<N, C>::operator -= (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] -= a.coeffs[i];
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
poly_int_pod<N, C>::operator -= (const Ca &a)
{
this->coeffs[0] -= a;
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type &
poly_int_pod<N, C>::operator *= (const Ca &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] *= a;
return *this;
}
template<unsigned int N, typename C>
inline poly_int_pod<N, C>&
poly_int_pod<N, C>::operator <<= (unsigned int a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] <<= a;
return *this;
}
template<unsigned int N, typename C>
inline bool
poly_int_pod<N, C>::is_constant () const
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (this->coeffs[i] != 0)
return false;
return true;
}
template<unsigned int N, typename C>
template<typename T>
inline typename if_lossless<T, C, bool>::type
poly_int_pod<N, C>::is_constant (T *const_value) const
{
if (is_constant ())
{
*const_value = this->coeffs[0];
return true;
}
return false;
}
template<unsigned int N, typename C>
inline C
poly_int_pod<N, C>::to_constant () const
{
((void)(!(is_constant ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 504, __FUNCTION__), 0 : 0));
return this->coeffs[0];
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int<N, C>
poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a,
unsigned int bitsize, signop sgn)
{
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = C::from (a.coeffs[i], bitsize, sgn)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (C::from (a.coeffs[i], bitsize, sgn))));
return r;
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int<N, C>
poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a, signop sgn)
{
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = C::from (a.coeffs[i], sgn)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (C::from (a.coeffs[i], sgn))));
return r;
}
template<unsigned int N, typename C>
inline bool
poly_int_pod<N, C>::to_shwi (poly_int_pod<N, long> *r) const
{
for (unsigned int i = 0; i < N; i++)
if (!wi::fits_shwi_p (this->coeffs[i]))
return false;
for (unsigned int i = 0; i < N; i++)
r->coeffs[i] = this->coeffs[i].to_shwi ();
return true;
}
template<unsigned int N, typename C>
inline bool
poly_int_pod<N, C>::to_uhwi (poly_int_pod<N, unsigned long> *r) const
{
for (unsigned int i = 0; i < N; i++)
if (!wi::fits_uhwi_p (this->coeffs[i]))
return false;
for (unsigned int i = 0; i < N; i++)
r->coeffs[i] = this->coeffs[i].to_uhwi ();
return true;
}
template<unsigned int N, typename C>
inline poly_int<N, long>
poly_int_pod<N, C>::force_shwi () const
{
poly_int_pod<N, long> r;
for (unsigned int i = 0; i < N; i++)
r.coeffs[i] = this->coeffs[i].to_shwi ();
return r;
}
template<unsigned int N, typename C>
inline poly_int<N, unsigned long>
poly_int_pod<N, C>::force_uhwi () const
{
poly_int_pod<N, unsigned long> r;
for (unsigned int i = 0; i < N; i++)
r.coeffs[i] = this->coeffs[i].to_uhwi ();
return r;
}
# 611 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename C>
class poly_int : public poly_int_pod<N, C>
{
public:
poly_int () {}
template<typename Ca>
poly_int (const poly_int<N, Ca> &);
template<typename Ca>
poly_int (const poly_int_pod<N, Ca> &);
template<typename C0>
poly_int (const C0 &);
template<typename C0, typename C1>
poly_int (const C0 &, const C1 &);
template<typename Ca>
poly_int &operator = (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int>::type &operator = (const Ca &);
template<typename Ca>
poly_int &operator += (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int>::type &operator += (const Ca &);
template<typename Ca>
poly_int &operator -= (const poly_int_pod<N, Ca> &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int>::type &operator -= (const Ca &);
template<typename Ca>
typename if_nonpoly<Ca, poly_int>::type &operator *= (const Ca &);
poly_int &operator <<= (unsigned int);
};
template<unsigned int N, typename C>
template<typename Ca>
inline
poly_int<N, C>::poly_int (const poly_int<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i])));
}
template<unsigned int N, typename C>
template<typename Ca>
inline
poly_int<N, C>::poly_int (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i])));
}
template<unsigned int N, typename C>
template<typename C0>
inline
poly_int<N, C>::poly_int (const C0 &c0)
{
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = c0) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (c0)));
for (unsigned int i = 1; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0]))));
}
template<unsigned int N, typename C>
template<typename C0, typename C1>
inline
poly_int<N, C>::poly_int (const C0 &c0, const C1 &c1)
{
static_assert ((N >= 2), "N >= 2");
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = c0) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (c0)));
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[1] = c1) : (void) ((*this).coeffs[1].~C (), new (&(*this).coeffs[1]) C (c1)));
for (unsigned int i = 2; i < N; i++)
((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0]))));
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int<N, C>&
poly_int<N, C>::operator = (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] = a.coeffs[i];
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
poly_int<N, C>::operator = (const Ca &a)
{
this->coeffs[0] = a;
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
this->coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0]);
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int<N, C>&
poly_int<N, C>::operator += (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] += a.coeffs[i];
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
poly_int<N, C>::operator += (const Ca &a)
{
this->coeffs[0] += a;
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline poly_int<N, C>&
poly_int<N, C>::operator -= (const poly_int_pod<N, Ca> &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] -= a.coeffs[i];
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
poly_int<N, C>::operator -= (const Ca &a)
{
this->coeffs[0] -= a;
return *this;
}
template<unsigned int N, typename C>
template<typename Ca>
inline typename if_nonpoly<Ca, poly_int<N, C> >::type &
poly_int<N, C>::operator *= (const Ca &a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] *= a;
return *this;
}
template<unsigned int N, typename C>
inline poly_int<N, C>&
poly_int<N, C>::operator <<= (unsigned int a)
{
for (unsigned int i = 0; i < N; i++)
this->coeffs[i] <<= a;
return *this;
}
template<typename Ca, typename Cb, typename Cc>
inline typename if_nonpoly<Ca, bool>::type
coeffs_in_range_p (const Ca &a, const Cb &b, const Cc &c)
{
return a >= b && a <= c;
}
template<unsigned int N, typename Ca, typename Cb, typename Cc>
inline typename if_nonpoly<Ca, bool>::type
coeffs_in_range_p (const poly_int_pod<N, Ca> &a, const Cb &b, const Cc &c)
{
for (unsigned int i = 0; i < N; i++)
if (a.coeffs[i] < b || a.coeffs[i] > c)
return false;
return true;
}
namespace wi {
template<unsigned int N>
inline poly_int<N, hwi_with_prec>
shwi (const poly_int_pod<N, long> &a, unsigned int precision)
{
poly_int<N, hwi_with_prec> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (hwi_with_prec *) 0), wi::int_traits<hwi_with_prec>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::shwi (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~hwi_with_prec (), new (&(r).coeffs[i]) hwi_with_prec (wi::shwi (a.coeffs[i], precision))));
return r;
}
template<unsigned int N>
inline poly_int<N, hwi_with_prec>
uhwi (const poly_int_pod<N, unsigned long> &a, unsigned int precision)
{
poly_int<N, hwi_with_prec> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (hwi_with_prec *) 0), wi::int_traits<hwi_with_prec>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::uhwi (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~hwi_with_prec (), new (&(r).coeffs[i]) hwi_with_prec (wi::uhwi (a.coeffs[i], precision))));
return r;
}
template<unsigned int N, typename Ca>
inline poly_int<N, typename poly_result<Ca, Ca>::type>
sext (const poly_int_pod<N, Ca> &a, unsigned int precision)
{
typedef typename poly_result<Ca, Ca>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sext (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sext (a.coeffs[i], precision))));
return r;
}
template<unsigned int N, typename Ca>
inline poly_int<N, typename poly_result<Ca, Ca>::type>
zext (const poly_int_pod<N, Ca> &a, unsigned int precision)
{
typedef typename poly_result<Ca, Ca>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::zext (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::zext (a.coeffs[i], precision))));
return r;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
operator + (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Ca, Cb>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) + b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) + b.coeffs[i])));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
operator + (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = NCa (a.coeffs[0]) + b) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (NCa (a.coeffs[0]) + b)));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
operator + (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = a + NCb (b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (a + NCb (b.coeffs[0]))));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCb (b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCb (b.coeffs[i]))));
return r;
}
namespace wi {
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], b.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
add (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a.coeffs[0], b)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a.coeffs[0], b))));
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], wi::ints_for<Cb>::zero (b))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], wi::ints_for<Cb>::zero (b)))))
;
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
add (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a, b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a, b.coeffs[0]))));
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (wi::ints_for<Ca>::zero (a), b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (wi::ints_for<Ca>::zero (a), b.coeffs[i]))))
;
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
signop sgn, wi::overflow_type *overflow)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a.coeffs[0], b.coeffs[0], sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a.coeffs[0], b.coeffs[0], sgn, overflow))));
for (unsigned int i = 1; i < N; i++)
{
wi::overflow_type suboverflow;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], b.coeffs[i], sgn, &suboverflow))))
;
wi::accumulate_overflow (*overflow, suboverflow);
}
return r;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
operator - (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Ca, Cb>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) - b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) - b.coeffs[i])));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
operator - (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = NCa (a.coeffs[0]) - b) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (NCa (a.coeffs[0]) - b)));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
operator - (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = a - NCb (b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (a - NCb (b.coeffs[0]))));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = -NCb (b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (-NCb (b.coeffs[i]))));
return r;
}
namespace wi {
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], b.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
sub (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a.coeffs[0], b)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a.coeffs[0], b))));
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], wi::ints_for<Cb>::zero (b))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], wi::ints_for<Cb>::zero (b)))))
;
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
sub (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a, b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a, b.coeffs[0]))));
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (wi::ints_for<Ca>::zero (a), b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (wi::ints_for<Ca>::zero (a), b.coeffs[i]))))
;
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
signop sgn, wi::overflow_type *overflow)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a.coeffs[0], b.coeffs[0], sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a.coeffs[0], b.coeffs[0], sgn, overflow))));
for (unsigned int i = 1; i < N; i++)
{
wi::overflow_type suboverflow;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], b.coeffs[i], sgn, &suboverflow))))
;
wi::accumulate_overflow (*overflow, suboverflow);
}
return r;
}
}
template<unsigned int N, typename Ca>
inline poly_int<N, typename poly_result<Ca, Ca>::type>
operator - (const poly_int_pod<N, Ca> &a)
{
typedef typename poly_result<Ca, Ca>::cast NCa;
typedef typename poly_result<Ca, Ca>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = -NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (-NCa (a.coeffs[i]))));
return r;
}
namespace wi {
template<unsigned int N, typename Ca>
inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type>
neg (const poly_int_pod<N, Ca> &a)
{
typedef typename wi::binary_traits <Ca, Ca>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::neg (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::neg (a.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca>
inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type>
neg (const poly_int_pod<N, Ca> &a, wi::overflow_type *overflow)
{
typedef typename wi::binary_traits <Ca, Ca>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::neg (a.coeffs[0], overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::neg (a.coeffs[0], overflow))));
for (unsigned int i = 1; i < N; i++)
{
wi::overflow_type suboverflow;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::neg (a.coeffs[i], &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::neg (a.coeffs[i], &suboverflow))));
wi::accumulate_overflow (*overflow, suboverflow);
}
return r;
}
}
template<unsigned int N, typename Ca>
inline poly_int<N, typename poly_result<Ca, Ca>::type>
operator ~ (const poly_int_pod<N, Ca> &a)
{
if (N >= 2)
return -1 - a;
return ~a.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
operator * (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) * b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) * b)));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
operator * (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a) * b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a) * b.coeffs[i])));
return r;
}
namespace wi {
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
mul (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a.coeffs[i], b)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a.coeffs[i], b))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
mul (const Ca &a, const poly_int_pod<N, Cb> &b)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a, b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a, b.coeffs[i]))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type>
mul (const poly_int_pod<N, Ca> &a, const Cb &b,
signop sgn, wi::overflow_type *overflow)
{
typedef typename wi::binary_traits <Ca, Cb>::result_type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::mul (a.coeffs[0], b, sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::mul (a.coeffs[0], b, sgn, overflow))));
for (unsigned int i = 1; i < N; i++)
{
wi::overflow_type suboverflow;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a.coeffs[i], b, sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a.coeffs[i], b, sgn, &suboverflow))));
wi::accumulate_overflow (*overflow, suboverflow);
}
return r;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Ca>::type>
operator << (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Ca>::cast NCa;
typedef typename poly_result<Ca, Ca>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) << b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) << b)));
return r;
}
namespace wi {
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type>
lshift (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename wi::binary_traits <Ca, Ca>::result_type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::lshift (a.coeffs[i], b)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::lshift (a.coeffs[i], b))));
return r;
}
}
template<typename Ca, typename Cb>
inline bool
maybe_eq_2 (const Ca &a0, const Ca &a1, const Cb &b0, const Cb &b1)
{
if (a1 != b1)
return (a1 < b1
? b0 <= a0 && (a0 - b0) % (b1 - a1) == 0
: b0 >= a0 && (b0 - a0) % (a1 - b1) == 0);
return a0 == b0;
}
template<typename Ca, typename Cb>
inline bool
maybe_eq_2 (const Ca &a0, const Ca &a1, const Cb &b)
{
if (a1 != 0)
return (a1 < 0
? b <= a0 && (a0 - b) % a1 == 0
: b >= a0 && (b - a0) % a1 == 0);
return a0 == b;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
maybe_eq (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
static_assert ((N <= 2), "N <= 2");
if (N == 2)
return maybe_eq_2 (a.coeffs[0], a.coeffs[1], b.coeffs[0], b.coeffs[1]);
return a.coeffs[0] == b.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Cb, bool>::type
maybe_eq (const poly_int_pod<N, Ca> &a, const Cb &b)
{
static_assert ((N <= 2), "N <= 2");
if (N == 2)
return maybe_eq_2 (a.coeffs[0], a.coeffs[1], b);
return a.coeffs[0] == b;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Ca, bool>::type
maybe_eq (const Ca &a, const poly_int_pod<N, Cb> &b)
{
static_assert ((N <= 2), "N <= 2");
if (N == 2)
return maybe_eq_2 (b.coeffs[0], b.coeffs[1], a);
return a == b.coeffs[0];
}
template<typename Ca, typename Cb>
inline typename if_nonpoly2<Ca, Cb, bool>::type
maybe_eq (const Ca &a, const Cb &b)
{
return a == b;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
maybe_ne (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] != b.coeffs[i])
return true;
return a.coeffs[0] != b.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Cb, bool>::type
maybe_ne (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] != 0)
return true;
return a.coeffs[0] != b;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Ca, bool>::type
maybe_ne (const Ca &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (b.coeffs[i] != 0)
return true;
return a != b.coeffs[0];
}
template<typename Ca, typename Cb>
inline typename if_nonpoly2<Ca, Cb, bool>::type
maybe_ne (const Ca &a, const Cb &b)
{
return a != b;
}
# 1312 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline bool
maybe_le (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] < b.coeffs[i])
return true;
return a.coeffs[0] <= b.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Cb, bool>::type
maybe_le (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] < 0)
return true;
return a.coeffs[0] <= b;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Ca, bool>::type
maybe_le (const Ca &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (b.coeffs[i] > 0)
return true;
return a <= b.coeffs[0];
}
template<typename Ca, typename Cb>
inline typename if_nonpoly2<Ca, Cb, bool>::type
maybe_le (const Ca &a, const Cb &b)
{
return a <= b;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
maybe_lt (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] < b.coeffs[i])
return true;
return a.coeffs[0] < b.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Cb, bool>::type
maybe_lt (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (a.coeffs[i] < 0)
return true;
return a.coeffs[0] < b;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Ca, bool>::type
maybe_lt (const Ca &a, const poly_int_pod<N, Cb> &b)
{
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if (b.coeffs[i] > 0)
return true;
return a < b.coeffs[0];
}
template<typename Ca, typename Cb>
inline typename if_nonpoly2<Ca, Cb, bool>::type
maybe_lt (const Ca &a, const Cb &b)
{
return a < b;
}
# 1414 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<typename T1, typename T2>
inline bool
ordered_p (const T1 &a, const T2 &b)
{
return ((poly_int_traits<T1>::num_coeffs == 1
&& poly_int_traits<T2>::num_coeffs == 1)
|| (!maybe_lt (b, a))
|| (!maybe_lt (a, b)));
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
ordered_min (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if ((!maybe_lt (b, a)))
return a;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1439, __FUNCTION__), 0 : 0));
return b;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
ordered_min (const Ca &a, const poly_int_pod<N, Cb> &b)
{
if ((!maybe_lt (b, a)))
return a;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1453, __FUNCTION__), 0 : 0));
return b;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
ordered_min (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if ((!maybe_lt (b, a)))
return a;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1467, __FUNCTION__), 0 : 0));
return b;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
ordered_max (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if ((!maybe_lt (b, a)))
return b;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1487, __FUNCTION__), 0 : 0));
return a;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
ordered_max (const Ca &a, const poly_int_pod<N, Cb> &b)
{
if ((!maybe_lt (b, a)))
return b;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1501, __FUNCTION__), 0 : 0));
return a;
}
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
ordered_max (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if ((!maybe_lt (b, a)))
return b;
else
{
if (N > 1)
((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1515, __FUNCTION__), 0 : 0));
return a;
}
}
template<unsigned int N, typename Ca>
inline Ca
constant_lower_bound (const poly_int_pod<N, Ca> &a)
{
((void)(!((!maybe_lt (a, typename poly_int_traits<Ca>::int_type (0)))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1527, __FUNCTION__), 0 : 0));
return a.coeffs[0];
}
template<unsigned int N, typename Ca, typename Cb>
inline typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type
constant_lower_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if ((!maybe_lt (a, b)))
return a.coeffs[0];
return b;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type
constant_upper_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b)
{
if ((!maybe_lt (b, a)))
return a.coeffs[0];
return b;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
lower_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_int_traits<Cb>::int_type ICb;
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((NCa (a.coeffs[0])) < (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (((NCa (a.coeffs[0])) < (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b))))));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) < (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) < (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0))))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
lower_bound (const Ca &a, const poly_int_pod<N, Cb> &b)
{
return lower_bound (b, a);
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
lower_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<Ca, Cb>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) < (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) < (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i]))))));
return r;
}
template<typename Ca, typename Cb>
inline typename poly_result<typename if_nonpoly<Ca>::type, typename if_nonpoly<Cb>::type>::type
lower_bound (const Ca &a, const Cb &b)
{
return a < b ? a : b;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
upper_bound (const poly_int_pod<N, Ca> &a, const Cb &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_int_traits<Cb>::int_type ICb;
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((NCa (a.coeffs[0])) > (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (((NCa (a.coeffs[0])) > (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b))))));
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) > (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) > (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0))))));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
upper_bound (const Ca &a, const poly_int_pod<N, Cb> &b)
{
return upper_bound (b, a);
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
upper_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<Ca, Cb>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) > (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) > (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i]))))));
return r;
}
template<unsigned int N, typename Ca>
inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type
coeff_gcd (const poly_int_pod<N, Ca> &a)
{
unsigned int i;
for (i = N - 1; i > 0; --i)
if (a.coeffs[i] != 0)
break;
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type C;
C r = a.coeffs[i];
for (unsigned int j = 0; j < i; ++j)
if (a.coeffs[j] != 0)
r = gcd (r, C (a.coeffs[j]));
return r;
}
template<unsigned int N, typename Ca, typename Cb>
poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
common_multiple (const poly_int_pod<N, Ca> &a, Cb b)
{
typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type xgcd = coeff_gcd (a);
return a * (least_common_multiple (xgcd, b) / xgcd);
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type>
common_multiple (const Ca &a, const poly_int_pod<N, Cb> &b)
{
return common_multiple (b, a);
}
# 1692 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
poly_int<N, typename poly_result<Ca, Cb>::type>
force_common_multiple (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b)
{
if (b.is_constant ())
return common_multiple (a, b.coeffs[0]);
if (a.is_constant ())
return common_multiple (a.coeffs[0], b);
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C;
typedef typename poly_int_traits<Ca>::int_type ICa;
for (unsigned int i = 1; i < N; ++i)
if (a.coeffs[i] != ICa (0))
{
C lcm = least_common_multiple (NCa (a.coeffs[i]), NCb (b.coeffs[i]));
C amul = lcm / a.coeffs[i];
C bmul = lcm / b.coeffs[i];
for (unsigned int j = 0; j < N; ++j)
((void)(!(a.coeffs[j] * amul == b.coeffs[j] * bmul) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1714, __FUNCTION__), 0 : 0));
return a * amul;
}
(fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1717, __FUNCTION__));
}
# 1731 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline int
compare_sizes_for_sort (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b)
{
for (unsigned int i = N; i-- > 0; )
if (a.coeffs[i] != b.coeffs[i])
return a.coeffs[i] < b.coeffs[i] ? -1 : 1;
return 0;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
can_align_p (const poly_int_pod<N, Ca> &value, Cb align)
{
for (unsigned int i = 1; i < N; i++)
if ((value.coeffs[i] & (align - 1)) != 0)
return false;
return true;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
can_align_up (const poly_int_pod<N, Ca> &value, Cb align,
poly_int_pod<N, Ca> *aligned)
{
if (!can_align_p (value, align))
return false;
*aligned = value + (-value.coeffs[0] & (align - 1));
return true;
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
can_align_down (const poly_int_pod<N, Ca> &value, Cb align,
poly_int_pod<N, Ca> *aligned)
{
if (!can_align_p (value, align))
return false;
*aligned = value - (value.coeffs[0] & (align - 1));
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cc>
inline bool
known_equal_after_align_up (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
Cc align)
{
poly_int<N, Ca> aligned_a;
poly_int<N, Cb> aligned_b;
return (can_align_up (a, align, &aligned_a)
&& can_align_up (b, align, &aligned_b)
&& (!maybe_ne (aligned_a, aligned_b)));
}
template<unsigned int N, typename Ca, typename Cb, typename Cc>
inline bool
known_equal_after_align_down (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
Cc align)
{
poly_int<N, Ca> aligned_a;
poly_int<N, Cb> aligned_b;
return (can_align_down (a, align, &aligned_a)
&& can_align_down (b, align, &aligned_b)
&& (!maybe_ne (aligned_a, aligned_b)));
}
# 1823 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
force_align_up (const poly_int_pod<N, Ca> &value, Cb align)
{
((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1827, __FUNCTION__), 0 : 0));
return value + (-value.coeffs[0] & (align - 1));
}
# 1838 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
force_align_down (const poly_int_pod<N, Ca> &value, Cb align)
{
((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1842, __FUNCTION__), 0 : 0));
return value - (value.coeffs[0] & (align - 1));
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
aligned_lower_bound (const poly_int_pod<N, Ca> &value, Cb align)
{
poly_int<N, Ca> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = (value.coeffs[i] - (value.coeffs[i] & (align - 1)))) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca ((value.coeffs[i] - (value.coeffs[i] & (align - 1))))))
;
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
aligned_upper_bound (const poly_int_pod<N, Ca> &value, Cb align)
{
poly_int<N, Ca> r;
for (unsigned int i = 0; i < N; i++)
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = (value.coeffs[i] + (-value.coeffs[i] & (align - 1)))) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca ((value.coeffs[i] + (-value.coeffs[i] & (align - 1))))))
;
return r;
}
# 1886 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
force_align_down_and_div (const poly_int_pod<N, Ca> &value, Cb align)
{
((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1890, __FUNCTION__), 0 : 0));
poly_int<N, Ca> r;
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((value.coeffs[0] - (value.coeffs[0] & (align - 1))) / align)) : (void) ((r).coeffs[0].~Ca (), new (&(r).coeffs[0]) Ca (((value.coeffs[0] - (value.coeffs[0] & (align - 1))) / align))))
;
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = value.coeffs[i] / align) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca (value.coeffs[i] / align)));
return r;
}
# 1910 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, Ca>
force_align_up_and_div (const poly_int_pod<N, Ca> &value, Cb align)
{
((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1914, __FUNCTION__), 0 : 0));
poly_int<N, Ca> r;
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((value.coeffs[0] + (-value.coeffs[0] & (align - 1))) / align)) : (void) ((r).coeffs[0].~Ca (), new (&(r).coeffs[0]) Ca (((value.coeffs[0] + (-value.coeffs[0] & (align - 1))) / align))))
;
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = value.coeffs[i] / align) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca (value.coeffs[i] / align)));
return r;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline bool
known_misalignment (const poly_int_pod<N, Ca> &value, Cb align, Cm *misalign)
{
((void)(!(align != 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1934, __FUNCTION__), 0 : 0));
if (!can_align_p (value, align))
return false;
*misalign = value.coeffs[0] & (align - 1);
return true;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type
force_get_misalignment (const poly_int_pod<N, Ca> &a, Cb align)
{
((void)(!(can_align_p (a, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1949, __FUNCTION__), 0 : 0));
return a.coeffs[0] & (align - 1);
}
template<unsigned int N, typename Ca>
inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type
known_alignment (const poly_int_pod<N, Ca> &a)
{
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type C;
C r = a.coeffs[0];
for (unsigned int i = 1; i < N; ++i)
r |= a.coeffs[i];
return r & -r;
}
template<unsigned int N, typename Ca, typename Cb, typename Cr>
inline typename if_nonpoly<Cb, bool>::type
can_ior_p (const poly_int_pod<N, Ca> &a, Cb b, Cr *result)
{
typedef typename poly_int_traits<Ca>::int_type int_type;
if (N >= 2)
for (unsigned int i = 1; i < N; i++)
if ((-(a.coeffs[i] & -a.coeffs[i]) & b) != int_type (0))
return false;
*result = a;
result->coeffs[0] |= b;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline typename if_nonpoly<Cb, bool>::type
constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b, Cm *multiple)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
if (NCa (a.coeffs[0]) % NCb (b) != 0 || !a.is_constant ())
return false;
*multiple = NCa (a.coeffs[0]) / NCb (b);
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline typename if_nonpoly<Ca, bool>::type
constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_int_traits<Ca>::int_type int_type;
if (NCa (a) % NCb (b.coeffs[0]) != 0
|| (a != int_type (0) && !b.is_constant ()))
return false;
*multiple = NCa (a) / NCb (b.coeffs[0]);
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline bool
constant_multiple_p (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b, Cm *multiple)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_int_traits<Ca>::int_type ICa;
typedef typename poly_int_traits<Cb>::int_type ICb;
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C;
if (NCa (a.coeffs[0]) % NCb (b.coeffs[0]) != 0)
return false;
C r = NCa (a.coeffs[0]) / NCb (b.coeffs[0]);
for (unsigned int i = 1; i < N; ++i)
if (b.coeffs[i] == ICb (0)
? a.coeffs[i] != ICa (0)
: (NCa (a.coeffs[i]) % NCb (b.coeffs[i]) != 0
|| NCa (a.coeffs[i]) / NCb (b.coeffs[i]) != r))
return false;
*multiple = r;
return true;
}
template<typename Ca, typename Cb>
inline typename if_nonpoly2<Ca, Cb, bool>::type
multiple_p (Ca a, Cb b)
{
return a % b == 0;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Cb, bool>::type
multiple_p (const poly_int_pod<N, Ca> &a, Cb b)
{
for (unsigned int i = 0; i < N; ++i)
if (a.coeffs[i] % b != 0)
return false;
return true;
}
template<unsigned int N, typename Ca, typename Cb>
inline typename if_nonpoly<Ca, bool>::type
multiple_p (Ca a, const poly_int_pod<N, Cb> &b)
{
typedef typename poly_int_traits<Ca>::int_type int_type;
return a % b.coeffs[0] == 0 && (a == int_type (0) || b.is_constant ());
}
template<unsigned int N, typename Ca, typename Cb>
inline bool
multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if (b.is_constant ())
return multiple_p (a, b.coeffs[0]);
typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type tmp;
return constant_multiple_p (a, b, &tmp);
}
template<typename Ca, typename Cb, typename Cm>
inline typename if_nonpoly2<Ca, Cb, bool>::type
multiple_p (Ca a, Cb b, Cm *multiple)
{
if (a % b != 0)
return false;
*multiple = a / b;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline typename if_nonpoly<Cb, bool>::type
multiple_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cm> *multiple)
{
if (!multiple_p (a, b))
return false;
for (unsigned int i = 0; i < N; ++i)
multiple->coeffs[i] = a.coeffs[i] / b;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline typename if_nonpoly<Ca, bool>::type
multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
if (a % b.coeffs[0] != 0 || (NCa (a) != 0 && !b.is_constant ()))
return false;
*multiple = a / b.coeffs[0];
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cm>
inline bool
multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b,
poly_int_pod<N, Cm> *multiple)
{
if (b.is_constant ())
return multiple_p (a, b.coeffs[0], multiple);
return constant_multiple_p (a, b, multiple);
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type>
exact_div (const poly_int_pod<N, Ca> &a, Cb b)
{
typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C;
poly_int<N, C> r;
for (unsigned int i = 0; i < N; i++)
{
((void)(!(a.coeffs[i] % b == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2162, __FUNCTION__), 0 : 0));
((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = a.coeffs[i] / b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (a.coeffs[i] / b)));
}
return r;
}
template<unsigned int N, typename Ca, typename Cb>
inline poly_int<N, typename poly_result<Ca, Cb>::type>
exact_div (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b)
{
if (b.is_constant ())
return exact_div (a, b.coeffs[0]);
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C;
typedef typename poly_int_traits<Cb>::int_type int_type;
((void)(!(a.coeffs[0] % b.coeffs[0] == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2182, __FUNCTION__), 0 : 0));
C r = NCa (a.coeffs[0]) / NCb (b.coeffs[0]);
for (unsigned int i = 1; i < N; ++i)
((void)(!(b.coeffs[i] == int_type (0) ? a.coeffs[i] == int_type (0) : (a.coeffs[i] % b.coeffs[i] == 0 && NCa (a.coeffs[i]) / NCb (b.coeffs[i]) == r)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2185, __FUNCTION__), 0 : 0))
;
return r;
}
# 2201 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb, typename Cq>
inline typename if_nonpoly2<Cb, Cq, bool>::type
can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, Cq *quotient)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
Cq q = NCa (a.coeffs[0]) / NCb (b);
if (!a.is_constant ())
return false;
*quotient = q;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cq>
inline typename if_nonpoly<Cq, bool>::type
can_div_trunc_p (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
Cq *quotient)
{
typedef typename poly_result<Ca, Cb>::cast NCa;
typedef typename poly_result<Cb, Ca>::cast NCb;
typedef typename poly_int_traits<Ca>::int_type ICa;
typedef typename poly_int_traits<Cb>::int_type ICb;
typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C;
C q = NCa (a.coeffs[0]) / NCb (b.coeffs[0]);
# 2277 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
bool rem_p = NCa (a.coeffs[0]) % NCb (b.coeffs[0]) != 0;
for (unsigned int i = 1; i < N; ++i)
{
if (b.coeffs[i] == ICb (0))
{
if (a.coeffs[i] != ICa (0))
return false;
}
else
{
if (q == 0)
{
if (a.coeffs[i] != ICa (0))
{
C neg_abs_a = (a.coeffs[i] < 0 ? a.coeffs[i] : -a.coeffs[i]);
C neg_abs_b = (b.coeffs[i] < 0 ? b.coeffs[i] : -b.coeffs[i]);
if (neg_abs_a < neg_abs_b)
return false;
rem_p = true;
}
}
else
{
if (NCa (a.coeffs[i]) / NCb (b.coeffs[i]) != q)
return false;
if (NCa (a.coeffs[i]) % NCb (b.coeffs[i]) != 0)
rem_p = true;
}
}
}
if (rem_p && (!ordered_p (a, ICa (0)) || !ordered_p (b, ICb (0))))
return false;
*quotient = q;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr>
inline typename if_nonpoly<Cq, bool>::type
can_div_trunc_p (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
Cq *quotient, Cr *remainder)
{
if (!can_div_trunc_p (a, b, quotient))
return false;
*remainder = a - *quotient * b;
return true;
}
# 2345 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb, typename Cq>
inline typename if_nonpoly<Cb, bool>::type
can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
poly_int_pod<N, Cq> *quotient)
{
for (unsigned int i = 1; i < N; ++i)
if (a.coeffs[i] % b != 0)
return false;
for (unsigned int i = 0; i < N; ++i)
quotient->coeffs[i] = a.coeffs[i] / b;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr>
inline typename if_nonpoly<Cb, bool>::type
can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b,
poly_int_pod<N, Cq> *quotient, Cr *remainder)
{
if (!can_div_trunc_p (a, b, quotient))
return false;
*remainder = a.coeffs[0] % b;
return true;
}
template<unsigned int N, typename Ca, typename Cb, typename Cq>
inline bool
can_div_trunc_p (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
poly_int_pod<N, Cq> *quotient)
{
if (b.is_constant ())
return can_div_trunc_p (a, b.coeffs[0], quotient);
if (!can_div_trunc_p (a, b, "ient->coeffs[0]))
return false;
for (unsigned int i = 1; i < N; ++i)
quotient->coeffs[i] = 0;
return true;
}
# 2401 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<unsigned int N, typename Ca, typename Cb, typename Cq>
inline typename if_nonpoly<Cq, bool>::type
can_div_away_from_zero_p (const poly_int_pod<N, Ca> &a,
const poly_int_pod<N, Cb> &b,
Cq *quotient)
{
if (!can_div_trunc_p (a, b, quotient))
return false;
if (maybe_ne (*quotient * b, a))
*quotient += (*quotient < 0 ? -1 : 1);
return true;
}
template<unsigned int N, typename C>
void
print_dec (const poly_int_pod<N, C> &value, FILE *file, signop sgn)
{
if (value.is_constant ())
print_dec (value.coeffs[0], file, sgn);
else
{
fprintf (file, "[");
for (unsigned int i = 0; i < N; ++i)
{
print_dec (value.coeffs[i], file, sgn);
fputc (i == N - 1 ? ']' : ',', file);
}
}
}
template<unsigned int N, typename C>
void
print_dec (const poly_int_pod<N, C> &value, FILE *file)
{
static_assert ((poly_coeff_traits<C>::signedness >= 0), "poly_coeff_traits<C>::signedness >= 0");
print_dec (value, file,
poly_coeff_traits<C>::signedness ? SIGNED : UNSIGNED);
}
template<unsigned int N, typename C>
void
print_hex (const poly_int_pod<N, C> &value, FILE *file)
{
if (value.is_constant ())
print_hex (value.coeffs[0], file);
else
{
fprintf (file, "[");
for (unsigned int i = 0; i < N; ++i)
{
print_hex (value.coeffs[i], file);
fputc (i == N - 1 ? ']' : ',', file);
}
}
}
# 2482 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
template<typename T1, typename T2,
typename Res = typename poly_result<typename poly_int_traits<typename poly_result<typename poly_int_traits<T1>::coeff_type, typename poly_int_traits<T2>::coeff_type>::type>::coeff_type, typename poly_int_traits<unsigned long>::coeff_type>::type
>
struct poly_span_traits
{
template<typename T>
static const T &cast (const T &x) { return x; }
};
template<typename T1, typename T2>
struct poly_span_traits<T1, T2, unsigned long>
{
template<typename T>
static typename if_nonpoly<T, unsigned long>::type
cast (const T &x) { return x; }
template<unsigned int N, typename T>
static poly_int<N, unsigned long>
cast (const poly_int_pod<N, T> &x) { return x; }
};
template<typename T>
inline bool
known_size_p (const T &a)
{
return maybe_ne (a, typename poly_int_traits<T>::int_type (-1));
}
template<typename T1, typename T2, typename T3>
inline bool
maybe_in_range_p (const T1 &val, const T2 &pos, const T3 &size)
{
typedef poly_span_traits<T1, T2> start_span;
typedef poly_span_traits<T3, T3> size_span;
if ((!maybe_le (pos, val)))
return false;
if (!known_size_p (size))
return true;
if ((poly_int_traits<T1>::num_coeffs > 1
|| poly_int_traits<T2>::num_coeffs > 1)
&& maybe_lt (val, pos))
return true;
return maybe_lt (start_span::cast (val) - start_span::cast (pos),
size_span::cast (size));
}
template<typename T1, typename T2, typename T3>
inline bool
known_in_range_p (const T1 &val, const T2 &pos, const T3 &size)
{
typedef poly_span_traits<T1, T2> start_span;
typedef poly_span_traits<T3, T3> size_span;
return (known_size_p (size)
&& (!maybe_lt (val, pos))
&& (!maybe_le (size_span::cast (size), start_span::cast (val) - start_span::cast (pos)))
);
}
template<typename T1, typename T2, typename T3, typename T4>
inline bool
ranges_maybe_overlap_p (const T1 &pos1, const T2 &size1,
const T3 &pos2, const T4 &size2)
{
if (maybe_in_range_p (pos2, pos1, size1))
return maybe_ne (size2, typename poly_int_traits<T4>::int_type (0));
if (maybe_in_range_p (pos1, pos2, size2))
return maybe_ne (size1, typename poly_int_traits<T2>::int_type (0));
return false;
}
template<typename T1, typename T2, typename T3, typename T4>
inline bool
ranges_known_overlap_p (const T1 &pos1, const T2 &size1,
const T3 &pos2, const T4 &size2)
{
typedef poly_span_traits<T1, T3> start_span;
typedef poly_span_traits<T2, T2> size1_span;
typedef poly_span_traits<T4, T4> size2_span;
# 2593 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h"
return (known_size_p (size1)
&& known_size_p (size2)
&& (!maybe_le (size1_span::cast (size1), start_span::cast (pos2) - start_span::cast (lower_bound (pos1, pos2))))
&& (!maybe_le (size2_span::cast (size2), start_span::cast (pos1) - start_span::cast (lower_bound (pos1, pos2))))
);
}
template<typename T1, typename T2, typename T3, typename T4>
inline bool
known_subrange_p (const T1 &pos1, const T2 &size1,
const T3 &pos2, const T4 &size2)
{
typedef typename poly_int_traits<T2>::coeff_type C2;
typedef poly_span_traits<T1, T3> start_span;
typedef poly_span_traits<T2, T4> size_span;
return ((!maybe_le (size1, typename poly_int_traits<T2>::int_type (0)))
&& (poly_coeff_traits<C2>::signedness > 0
|| known_size_p (size1))
&& known_size_p (size2)
&& (!maybe_lt (pos1, pos2))
&& (!maybe_lt (size2, size1))
&& (!maybe_lt (size_span::cast (size2) - size_span::cast (size1), start_span::cast (pos1) - start_span::cast (pos2)))
);
}
template<typename T>
inline typename if_nonpoly<T, bool>::type
endpoint_representable_p (const T &pos, const T &size)
{
return (!known_size_p (size)
|| pos <= poly_coeff_traits<T>::max_value - size);
}
template<unsigned int N, typename C>
inline bool
endpoint_representable_p (const poly_int_pod<N, C> &pos,
const poly_int_pod<N, C> &size)
{
if (known_size_p (size))
for (unsigned int i = 0; i < N; ++i)
if (pos.coeffs[i] > poly_coeff_traits<C>::max_value - size.coeffs[i])
return false;
return true;
}
template<unsigned int N, typename C>
void
gt_ggc_mx (poly_int_pod<N, C> *)
{
}
template<unsigned int N, typename C>
void
gt_pch_nx (poly_int_pod<N, C> *)
{
}
template<unsigned int N, typename C>
void
gt_pch_nx (poly_int_pod<N, C> *, void (*) (void *, void *), void *)
{
}
# 467 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int-types.h" 1
# 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int-types.h"
typedef poly_int_pod<1, unsigned short> poly_uint16_pod;
typedef poly_int_pod<1, long> poly_int64_pod;
typedef poly_int_pod<1,
unsigned long> poly_uint64_pod;
typedef poly_int_pod<1, offset_int> poly_offset_int_pod;
typedef poly_int_pod<1, wide_int> poly_wide_int_pod;
typedef poly_int_pod<1, widest_int> poly_widest_int_pod;
typedef poly_int<1, unsigned short> poly_uint16;
typedef poly_int<1, long> poly_int64;
typedef poly_int<1, unsigned long> poly_uint64;
typedef poly_int<1, offset_int> poly_offset_int;
typedef poly_int<1, wide_int> poly_wide_int;
typedef poly_int<1, wide_int_ref> poly_wide_int_ref;
typedef poly_int<1, widest_int> poly_widest_int;
# 468 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "./insn-modes-inline.h" 1
# 10 "./insn-modes-inline.h"
inline __attribute__((__always_inline__))
poly_uint16
mode_size_inline (machine_mode mode)
{
extern poly_uint16_pod mode_size[NUM_MACHINE_MODES];
((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 18, __FUNCTION__), 0 : 0));
switch (mode)
{
case E_VOIDmode: return 0;
case E_BLKmode: return 0;
case E_CCmode: return 4;
case E_CCGCmode: return 4;
case E_CCGOCmode: return 4;
case E_CCNOmode: return 4;
case E_CCGZmode: return 4;
case E_CCAmode: return 4;
case E_CCCmode: return 4;
case E_CCOmode: return 4;
case E_CCPmode: return 4;
case E_CCSmode: return 4;
case E_CCZmode: return 4;
case E_CCFPmode: return 4;
case E_BImode: return 1;
case E_QImode: return 1;
case E_HImode: return 2;
case E_SImode: return 4;
case E_DImode: return 8;
case E_TImode: return 16;
case E_OImode: return 32;
case E_XImode: return 64;
case E_P2QImode: return 2;
case E_P2HImode: return 4;
case E_POImode: return 32;
case E_QQmode: return 1;
case E_HQmode: return 2;
case E_SQmode: return 4;
case E_DQmode: return 8;
case E_TQmode: return 16;
case E_UQQmode: return 1;
case E_UHQmode: return 2;
case E_USQmode: return 4;
case E_UDQmode: return 8;
case E_UTQmode: return 16;
case E_HAmode: return 2;
case E_SAmode: return 4;
case E_DAmode: return 8;
case E_TAmode: return 16;
case E_UHAmode: return 2;
case E_USAmode: return 4;
case E_UDAmode: return 8;
case E_UTAmode: return 16;
case E_SFmode: return 4;
case E_DFmode: return 8;
case E_TFmode: return 16;
case E_SDmode: return 4;
case E_DDmode: return 8;
case E_TDmode: return 16;
case E_CQImode: return 2;
case E_CP2QImode: return 4;
case E_CHImode: return 4;
case E_CP2HImode: return 8;
case E_CSImode: return 8;
case E_CDImode: return 16;
case E_CTImode: return 32;
case E_CPOImode: return 64;
case E_COImode: return 64;
case E_CXImode: return 128;
case E_SCmode: return 8;
case E_DCmode: return 16;
case E_TCmode: return 32;
case E_V2QImode: return 2;
case E_V4QImode: return 4;
case E_V2HImode: return 4;
case E_V1SImode: return 4;
case E_V8QImode: return 8;
case E_V4HImode: return 8;
case E_V2SImode: return 8;
case E_V1DImode: return 8;
case E_V12QImode: return 12;
case E_V6HImode: return 12;
case E_V14QImode: return 14;
case E_V16QImode: return 16;
case E_V8HImode: return 16;
case E_V4SImode: return 16;
case E_V2DImode: return 16;
case E_V1TImode: return 16;
case E_V32QImode: return 32;
case E_V16HImode: return 32;
case E_V8SImode: return 32;
case E_V4DImode: return 32;
case E_V2TImode: return 32;
case E_V64QImode: return 64;
case E_V32HImode: return 64;
case E_V16SImode: return 64;
case E_V8DImode: return 64;
case E_V4TImode: return 64;
case E_V128QImode: return 128;
case E_V64HImode: return 128;
case E_V32SImode: return 128;
case E_V16DImode: return 128;
case E_V8TImode: return 128;
case E_V64SImode: return 256;
case E_V2SFmode: return 8;
case E_V4SFmode: return 16;
case E_V2DFmode: return 16;
case E_V8SFmode: return 32;
case E_V4DFmode: return 32;
case E_V2TFmode: return 32;
case E_V16SFmode: return 64;
case E_V8DFmode: return 64;
case E_V4TFmode: return 64;
case E_V32SFmode: return 128;
case E_V16DFmode: return 128;
case E_V8TFmode: return 128;
case E_V64SFmode: return 256;
case E_V32DFmode: return 256;
case E_V16TFmode: return 256;
default: return mode_size[mode];
}
}
inline __attribute__((__always_inline__))
poly_uint16
mode_nunits_inline (machine_mode mode)
{
extern const poly_uint16_pod mode_nunits[NUM_MACHINE_MODES];
switch (mode)
{
case E_VOIDmode: return 0;
case E_BLKmode: return 0;
case E_CCmode: return 1;
case E_CCGCmode: return 1;
case E_CCGOCmode: return 1;
case E_CCNOmode: return 1;
case E_CCGZmode: return 1;
case E_CCAmode: return 1;
case E_CCCmode: return 1;
case E_CCOmode: return 1;
case E_CCPmode: return 1;
case E_CCSmode: return 1;
case E_CCZmode: return 1;
case E_CCFPmode: return 1;
case E_BImode: return 1;
case E_QImode: return 1;
case E_HImode: return 1;
case E_SImode: return 1;
case E_DImode: return 1;
case E_TImode: return 1;
case E_OImode: return 1;
case E_XImode: return 1;
case E_P2QImode: return 1;
case E_P2HImode: return 1;
case E_POImode: return 1;
case E_QQmode: return 1;
case E_HQmode: return 1;
case E_SQmode: return 1;
case E_DQmode: return 1;
case E_TQmode: return 1;
case E_UQQmode: return 1;
case E_UHQmode: return 1;
case E_USQmode: return 1;
case E_UDQmode: return 1;
case E_UTQmode: return 1;
case E_HAmode: return 1;
case E_SAmode: return 1;
case E_DAmode: return 1;
case E_TAmode: return 1;
case E_UHAmode: return 1;
case E_USAmode: return 1;
case E_UDAmode: return 1;
case E_UTAmode: return 1;
case E_SFmode: return 1;
case E_DFmode: return 1;
case E_XFmode: return 1;
case E_TFmode: return 1;
case E_SDmode: return 1;
case E_DDmode: return 1;
case E_TDmode: return 1;
case E_CQImode: return 2;
case E_CP2QImode: return 2;
case E_CHImode: return 2;
case E_CP2HImode: return 2;
case E_CSImode: return 2;
case E_CDImode: return 2;
case E_CTImode: return 2;
case E_CPOImode: return 2;
case E_COImode: return 2;
case E_CXImode: return 2;
case E_SCmode: return 2;
case E_DCmode: return 2;
case E_XCmode: return 2;
case E_TCmode: return 2;
case E_V2QImode: return 2;
case E_V4QImode: return 4;
case E_V2HImode: return 2;
case E_V1SImode: return 1;
case E_V8QImode: return 8;
case E_V4HImode: return 4;
case E_V2SImode: return 2;
case E_V1DImode: return 1;
case E_V12QImode: return 12;
case E_V6HImode: return 6;
case E_V14QImode: return 14;
case E_V16QImode: return 16;
case E_V8HImode: return 8;
case E_V4SImode: return 4;
case E_V2DImode: return 2;
case E_V1TImode: return 1;
case E_V32QImode: return 32;
case E_V16HImode: return 16;
case E_V8SImode: return 8;
case E_V4DImode: return 4;
case E_V2TImode: return 2;
case E_V64QImode: return 64;
case E_V32HImode: return 32;
case E_V16SImode: return 16;
case E_V8DImode: return 8;
case E_V4TImode: return 4;
case E_V128QImode: return 128;
case E_V64HImode: return 64;
case E_V32SImode: return 32;
case E_V16DImode: return 16;
case E_V8TImode: return 8;
case E_V64SImode: return 64;
case E_V2SFmode: return 2;
case E_V4SFmode: return 4;
case E_V2DFmode: return 2;
case E_V8SFmode: return 8;
case E_V4DFmode: return 4;
case E_V2TFmode: return 2;
case E_V16SFmode: return 16;
case E_V8DFmode: return 8;
case E_V4TFmode: return 4;
case E_V32SFmode: return 32;
case E_V16DFmode: return 16;
case E_V8TFmode: return 8;
case E_V64SFmode: return 64;
case E_V32DFmode: return 32;
case E_V16TFmode: return 16;
default: return mode_nunits[mode];
}
}
inline __attribute__((__always_inline__))
unsigned char
mode_inner_inline (machine_mode mode)
{
extern const unsigned char mode_inner[NUM_MACHINE_MODES];
((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 269, __FUNCTION__), 0 : 0));
switch (mode)
{
case E_VOIDmode: return E_VOIDmode;
case E_BLKmode: return E_BLKmode;
case E_CCmode: return E_CCmode;
case E_CCGCmode: return E_CCGCmode;
case E_CCGOCmode: return E_CCGOCmode;
case E_CCNOmode: return E_CCNOmode;
case E_CCGZmode: return E_CCGZmode;
case E_CCAmode: return E_CCAmode;
case E_CCCmode: return E_CCCmode;
case E_CCOmode: return E_CCOmode;
case E_CCPmode: return E_CCPmode;
case E_CCSmode: return E_CCSmode;
case E_CCZmode: return E_CCZmode;
case E_CCFPmode: return E_CCFPmode;
case E_BImode: return E_BImode;
case E_QImode: return E_QImode;
case E_HImode: return E_HImode;
case E_SImode: return E_SImode;
case E_DImode: return E_DImode;
case E_TImode: return E_TImode;
case E_OImode: return E_OImode;
case E_XImode: return E_XImode;
case E_P2QImode: return E_P2QImode;
case E_P2HImode: return E_P2HImode;
case E_POImode: return E_POImode;
case E_QQmode: return E_QQmode;
case E_HQmode: return E_HQmode;
case E_SQmode: return E_SQmode;
case E_DQmode: return E_DQmode;
case E_TQmode: return E_TQmode;
case E_UQQmode: return E_UQQmode;
case E_UHQmode: return E_UHQmode;
case E_USQmode: return E_USQmode;
case E_UDQmode: return E_UDQmode;
case E_UTQmode: return E_UTQmode;
case E_HAmode: return E_HAmode;
case E_SAmode: return E_SAmode;
case E_DAmode: return E_DAmode;
case E_TAmode: return E_TAmode;
case E_UHAmode: return E_UHAmode;
case E_USAmode: return E_USAmode;
case E_UDAmode: return E_UDAmode;
case E_UTAmode: return E_UTAmode;
case E_SFmode: return E_SFmode;
case E_DFmode: return E_DFmode;
case E_XFmode: return E_XFmode;
case E_TFmode: return E_TFmode;
case E_SDmode: return E_SDmode;
case E_DDmode: return E_DDmode;
case E_TDmode: return E_TDmode;
case E_CQImode: return E_QImode;
case E_CP2QImode: return E_P2QImode;
case E_CHImode: return E_HImode;
case E_CP2HImode: return E_P2HImode;
case E_CSImode: return E_SImode;
case E_CDImode: return E_DImode;
case E_CTImode: return E_TImode;
case E_CPOImode: return E_POImode;
case E_COImode: return E_OImode;
case E_CXImode: return E_XImode;
case E_SCmode: return E_SFmode;
case E_DCmode: return E_DFmode;
case E_XCmode: return E_XFmode;
case E_TCmode: return E_TFmode;
case E_V2QImode: return E_QImode;
case E_V4QImode: return E_QImode;
case E_V2HImode: return E_HImode;
case E_V1SImode: return E_SImode;
case E_V8QImode: return E_QImode;
case E_V4HImode: return E_HImode;
case E_V2SImode: return E_SImode;
case E_V1DImode: return E_DImode;
case E_V12QImode: return E_QImode;
case E_V6HImode: return E_HImode;
case E_V14QImode: return E_QImode;
case E_V16QImode: return E_QImode;
case E_V8HImode: return E_HImode;
case E_V4SImode: return E_SImode;
case E_V2DImode: return E_DImode;
case E_V1TImode: return E_TImode;
case E_V32QImode: return E_QImode;
case E_V16HImode: return E_HImode;
case E_V8SImode: return E_SImode;
case E_V4DImode: return E_DImode;
case E_V2TImode: return E_TImode;
case E_V64QImode: return E_QImode;
case E_V32HImode: return E_HImode;
case E_V16SImode: return E_SImode;
case E_V8DImode: return E_DImode;
case E_V4TImode: return E_TImode;
case E_V128QImode: return E_QImode;
case E_V64HImode: return E_HImode;
case E_V32SImode: return E_SImode;
case E_V16DImode: return E_DImode;
case E_V8TImode: return E_TImode;
case E_V64SImode: return E_SImode;
case E_V2SFmode: return E_SFmode;
case E_V4SFmode: return E_SFmode;
case E_V2DFmode: return E_DFmode;
case E_V8SFmode: return E_SFmode;
case E_V4DFmode: return E_DFmode;
case E_V2TFmode: return E_TFmode;
case E_V16SFmode: return E_SFmode;
case E_V8DFmode: return E_DFmode;
case E_V4TFmode: return E_TFmode;
case E_V32SFmode: return E_SFmode;
case E_V16DFmode: return E_DFmode;
case E_V8TFmode: return E_TFmode;
case E_V64SFmode: return E_SFmode;
case E_V32DFmode: return E_DFmode;
case E_V16TFmode: return E_TFmode;
default: return mode_inner[mode];
}
}
inline __attribute__((__always_inline__))
unsigned char
mode_unit_size_inline (machine_mode mode)
{
extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 396, __FUNCTION__), 0 : 0));
switch (mode)
{
case E_VOIDmode: return 0;
case E_BLKmode: return 0;
case E_CCmode: return 4;
case E_CCGCmode: return 4;
case E_CCGOCmode: return 4;
case E_CCNOmode: return 4;
case E_CCGZmode: return 4;
case E_CCAmode: return 4;
case E_CCCmode: return 4;
case E_CCOmode: return 4;
case E_CCPmode: return 4;
case E_CCSmode: return 4;
case E_CCZmode: return 4;
case E_CCFPmode: return 4;
case E_BImode: return 1;
case E_QImode: return 1;
case E_HImode: return 2;
case E_SImode: return 4;
case E_DImode: return 8;
case E_TImode: return 16;
case E_OImode: return 32;
case E_XImode: return 64;
case E_P2QImode: return 2;
case E_P2HImode: return 4;
case E_POImode: return 32;
case E_QQmode: return 1;
case E_HQmode: return 2;
case E_SQmode: return 4;
case E_DQmode: return 8;
case E_TQmode: return 16;
case E_UQQmode: return 1;
case E_UHQmode: return 2;
case E_USQmode: return 4;
case E_UDQmode: return 8;
case E_UTQmode: return 16;
case E_HAmode: return 2;
case E_SAmode: return 4;
case E_DAmode: return 8;
case E_TAmode: return 16;
case E_UHAmode: return 2;
case E_USAmode: return 4;
case E_UDAmode: return 8;
case E_UTAmode: return 16;
case E_SFmode: return 4;
case E_DFmode: return 8;
case E_TFmode: return 16;
case E_SDmode: return 4;
case E_DDmode: return 8;
case E_TDmode: return 16;
case E_CQImode: return 1;
case E_CP2QImode: return 2;
case E_CHImode: return 2;
case E_CP2HImode: return 4;
case E_CSImode: return 4;
case E_CDImode: return 8;
case E_CTImode: return 16;
case E_CPOImode: return 32;
case E_COImode: return 32;
case E_CXImode: return 64;
case E_SCmode: return 4;
case E_DCmode: return 8;
case E_TCmode: return 16;
case E_V2QImode: return 1;
case E_V4QImode: return 1;
case E_V2HImode: return 2;
case E_V1SImode: return 4;
case E_V8QImode: return 1;
case E_V4HImode: return 2;
case E_V2SImode: return 4;
case E_V1DImode: return 8;
case E_V12QImode: return 1;
case E_V6HImode: return 2;
case E_V14QImode: return 1;
case E_V16QImode: return 1;
case E_V8HImode: return 2;
case E_V4SImode: return 4;
case E_V2DImode: return 8;
case E_V1TImode: return 16;
case E_V32QImode: return 1;
case E_V16HImode: return 2;
case E_V8SImode: return 4;
case E_V4DImode: return 8;
case E_V2TImode: return 16;
case E_V64QImode: return 1;
case E_V32HImode: return 2;
case E_V16SImode: return 4;
case E_V8DImode: return 8;
case E_V4TImode: return 16;
case E_V128QImode: return 1;
case E_V64HImode: return 2;
case E_V32SImode: return 4;
case E_V16DImode: return 8;
case E_V8TImode: return 16;
case E_V64SImode: return 4;
case E_V2SFmode: return 4;
case E_V4SFmode: return 4;
case E_V2DFmode: return 8;
case E_V8SFmode: return 4;
case E_V4DFmode: return 8;
case E_V2TFmode: return 16;
case E_V16SFmode: return 4;
case E_V8DFmode: return 8;
case E_V4TFmode: return 16;
case E_V32SFmode: return 4;
case E_V16DFmode: return 8;
case E_V8TFmode: return 16;
case E_V64SFmode: return 4;
case E_V32DFmode: return 8;
case E_V16TFmode: return 16;
default: return mode_unit_size[mode];
}
}
inline __attribute__((__always_inline__))
unsigned short
mode_unit_precision_inline (machine_mode mode)
{
extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 521, __FUNCTION__), 0 : 0));
switch (mode)
{
case E_VOIDmode: return 0;
case E_BLKmode: return 0;
case E_CCmode: return 4*(8);
case E_CCGCmode: return 4*(8);
case E_CCGOCmode: return 4*(8);
case E_CCNOmode: return 4*(8);
case E_CCGZmode: return 4*(8);
case E_CCAmode: return 4*(8);
case E_CCCmode: return 4*(8);
case E_CCOmode: return 4*(8);
case E_CCPmode: return 4*(8);
case E_CCSmode: return 4*(8);
case E_CCZmode: return 4*(8);
case E_CCFPmode: return 4*(8);
case E_BImode: return 1;
case E_QImode: return 1*(8);
case E_HImode: return 2*(8);
case E_SImode: return 4*(8);
case E_DImode: return 8*(8);
case E_TImode: return 16*(8);
case E_OImode: return 32*(8);
case E_XImode: return 64*(8);
case E_P2QImode: return 16;
case E_P2HImode: return 32;
case E_POImode: return 160;
case E_QQmode: return 1*(8);
case E_HQmode: return 2*(8);
case E_SQmode: return 4*(8);
case E_DQmode: return 8*(8);
case E_TQmode: return 16*(8);
case E_UQQmode: return 1*(8);
case E_UHQmode: return 2*(8);
case E_USQmode: return 4*(8);
case E_UDQmode: return 8*(8);
case E_UTQmode: return 16*(8);
case E_HAmode: return 2*(8);
case E_SAmode: return 4*(8);
case E_DAmode: return 8*(8);
case E_TAmode: return 16*(8);
case E_UHAmode: return 2*(8);
case E_USAmode: return 4*(8);
case E_UDAmode: return 8*(8);
case E_UTAmode: return 16*(8);
case E_SFmode: return 4*(8);
case E_DFmode: return 8*(8);
case E_XFmode: return 80;
case E_TFmode: return 16*(8);
case E_SDmode: return 4*(8);
case E_DDmode: return 8*(8);
case E_TDmode: return 16*(8);
case E_CQImode: return 1*(8);
case E_CP2QImode: return 16;
case E_CHImode: return 2*(8);
case E_CP2HImode: return 32;
case E_CSImode: return 4*(8);
case E_CDImode: return 8*(8);
case E_CTImode: return 16*(8);
case E_CPOImode: return 160;
case E_COImode: return 32*(8);
case E_CXImode: return 64*(8);
case E_SCmode: return 4*(8);
case E_DCmode: return 8*(8);
case E_XCmode: return 80;
case E_TCmode: return 16*(8);
case E_V2QImode: return 1*(8);
case E_V4QImode: return 1*(8);
case E_V2HImode: return 2*(8);
case E_V1SImode: return 4*(8);
case E_V8QImode: return 1*(8);
case E_V4HImode: return 2*(8);
case E_V2SImode: return 4*(8);
case E_V1DImode: return 8*(8);
case E_V12QImode: return 1*(8);
case E_V6HImode: return 2*(8);
case E_V14QImode: return 1*(8);
case E_V16QImode: return 1*(8);
case E_V8HImode: return 2*(8);
case E_V4SImode: return 4*(8);
case E_V2DImode: return 8*(8);
case E_V1TImode: return 16*(8);
case E_V32QImode: return 1*(8);
case E_V16HImode: return 2*(8);
case E_V8SImode: return 4*(8);
case E_V4DImode: return 8*(8);
case E_V2TImode: return 16*(8);
case E_V64QImode: return 1*(8);
case E_V32HImode: return 2*(8);
case E_V16SImode: return 4*(8);
case E_V8DImode: return 8*(8);
case E_V4TImode: return 16*(8);
case E_V128QImode: return 1*(8);
case E_V64HImode: return 2*(8);
case E_V32SImode: return 4*(8);
case E_V16DImode: return 8*(8);
case E_V8TImode: return 16*(8);
case E_V64SImode: return 4*(8);
case E_V2SFmode: return 4*(8);
case E_V4SFmode: return 4*(8);
case E_V2DFmode: return 8*(8);
case E_V8SFmode: return 4*(8);
case E_V4DFmode: return 8*(8);
case E_V2TFmode: return 16*(8);
case E_V16SFmode: return 4*(8);
case E_V8DFmode: return 8*(8);
case E_V4TFmode: return 16*(8);
case E_V32SFmode: return 4*(8);
case E_V16DFmode: return 8*(8);
case E_V8TFmode: return 16*(8);
case E_V64SFmode: return 4*(8);
case E_V32DFmode: return 8*(8);
case E_V16TFmode: return 16*(8);
default: return mode_unit_precision[mode];
}
}
# 469 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" 1
# 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
typedef opt_mode<machine_mode> opt_machine_mode;
extern poly_uint16_pod mode_size[NUM_MACHINE_MODES];
extern const poly_uint16_pod mode_precision[NUM_MACHINE_MODES];
extern const unsigned char mode_inner[NUM_MACHINE_MODES];
extern const poly_uint16_pod mode_nunits[NUM_MACHINE_MODES];
extern unsigned char mode_unit_size[NUM_MACHINE_MODES];
extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
extern const unsigned char mode_wider[NUM_MACHINE_MODES];
extern const unsigned char mode_2xwider[NUM_MACHINE_MODES];
template<typename T>
struct mode_traits
{
# 68 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
enum from_int { dummy = MAX_MACHINE_MODE };
};
template<>
struct mode_traits<machine_mode>
{
typedef machine_mode from_int;
};
# 89 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
extern const char * const mode_name[NUM_MACHINE_MODES];
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mode-classes.def" 1
# 95 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" 2
enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MODE_PARTIAL_INT, MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_FLOAT, MODE_DECIMAL_FLOAT, MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT, MODE_VECTOR_BOOL, MODE_VECTOR_INT, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM, MODE_VECTOR_FLOAT, MAX_MODE_CLASS };
extern const unsigned char mode_class[NUM_MACHINE_MODES];
# 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
template<typename T>
class opt_mode
{
public:
enum from_int { dummy = MAX_MACHINE_MODE };
inline __attribute__ ((always_inline)) constexpr opt_mode () : m_mode (E_VOIDmode) {}
inline __attribute__ ((always_inline)) constexpr opt_mode (const T &m) : m_mode (m) {}
template<typename U>
inline __attribute__ ((always_inline)) constexpr opt_mode (const U &m) : m_mode (T (m)) {}
inline __attribute__ ((always_inline)) constexpr opt_mode (from_int m) : m_mode (machine_mode (m)) {}
machine_mode else_void () const;
machine_mode else_blk () const { return else_mode (((void) 0, E_BLKmode)); }
machine_mode else_mode (machine_mode) const;
T require () const;
bool exists () const;
template<typename U> bool exists (U *) const;
bool operator== (const T &m) const { return m_mode == m; }
bool operator!= (const T &m) const { return m_mode != m; }
private:
machine_mode m_mode;
};
template<typename T>
inline __attribute__ ((always_inline)) machine_mode
opt_mode<T>::else_void () const
{
return m_mode;
}
template<typename T>
inline machine_mode
opt_mode<T>::else_mode (machine_mode fallback) const
{
return m_mode == E_VOIDmode ? fallback : m_mode;
}
template<typename T>
inline T
opt_mode<T>::require () const
{
((void)(!(m_mode != E_VOIDmode) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h", 293, __FUNCTION__), 0 : 0));
return typename mode_traits<T>::from_int (m_mode);
}
template<typename T>
inline __attribute__ ((always_inline)) bool
opt_mode<T>::exists () const
{
return m_mode != E_VOIDmode;
}
template<typename T>
template<typename U>
inline bool
opt_mode<T>::exists (U *mode) const
{
if (m_mode != E_VOIDmode)
{
*mode = T (typename mode_traits<T>::from_int (m_mode));
return true;
}
return false;
}
template<typename T>
struct pod_mode
{
typedef typename mode_traits<T>::from_int from_int;
typedef typename T::measurement_type measurement_type;
machine_mode m_mode;
inline __attribute__ ((always_inline)) constexpr
operator machine_mode () const { return m_mode; }
inline __attribute__ ((always_inline)) constexpr
operator T () const { return from_int (m_mode); }
inline __attribute__ ((always_inline)) pod_mode &operator = (const T &m) { m_mode = m; return *this; }
};
template<typename T>
inline bool
is_a (machine_mode m)
{
return T::includes_p (m);
}
template<typename T, typename U>
inline bool
is_a (const opt_mode<U> &m)
{
return T::includes_p (m.else_void ());
}
template<typename T>
inline T
as_a (machine_mode m)
{
((void)(!(T::includes_p (m)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h", 361, __FUNCTION__), 0 : 0));
return typename mode_traits<T>::from_int (m);
}
template<typename T, typename U>
inline T
as_a (const opt_mode<U> &m)
{
return as_a <T> (m.else_void ());
}
template<typename T>
inline opt_mode<T>
dyn_cast (machine_mode m)
{
if (T::includes_p (m))
return T (typename mode_traits<T>::from_int (m));
return opt_mode<T> ();
}
template<typename T, typename U>
inline opt_mode<T>
dyn_cast (const opt_mode<U> &m)
{
return dyn_cast <T> (m.else_void ());
}
template<typename T, typename U>
inline bool
is_a (machine_mode m, U *result)
{
if (T::includes_p (m))
{
*result = T (typename mode_traits<T>::from_int (m));
return true;
}
return false;
}
class scalar_int_mode
{
public:
typedef mode_traits<scalar_int_mode>::from_int from_int;
typedef unsigned short measurement_type;
inline __attribute__ ((always_inline)) scalar_int_mode () {}
inline __attribute__ ((always_inline)) constexpr
scalar_int_mode (from_int m) : m_mode (machine_mode (m)) {}
inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; }
static bool includes_p (machine_mode);
protected:
machine_mode m_mode;
};
inline bool
scalar_int_mode::includes_p (machine_mode m)
{
return (((enum mode_class) mode_class[m]) == MODE_INT || ((enum mode_class) mode_class[m]) == MODE_PARTIAL_INT);
}
class scalar_float_mode
{
public:
typedef mode_traits<scalar_float_mode>::from_int from_int;
typedef unsigned short measurement_type;
inline __attribute__ ((always_inline)) scalar_float_mode () {}
inline __attribute__ ((always_inline)) constexpr
scalar_float_mode (from_int m) : m_mode (machine_mode (m)) {}
inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; }
static bool includes_p (machine_mode);
protected:
machine_mode m_mode;
};
inline bool
scalar_float_mode::includes_p (machine_mode m)
{
return (((enum mode_class) mode_class[m]) == MODE_FLOAT || ((enum mode_class) mode_class[m]) == MODE_DECIMAL_FLOAT);
}
class scalar_mode
{
public:
typedef mode_traits<scalar_mode>::from_int from_int;
typedef unsigned short measurement_type;
inline __attribute__ ((always_inline)) scalar_mode () {}
inline __attribute__ ((always_inline)) constexpr
scalar_mode (from_int m) : m_mode (machine_mode (m)) {}
inline __attribute__ ((always_inline)) constexpr
scalar_mode (const scalar_int_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
scalar_mode (const scalar_float_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
scalar_mode (const scalar_int_mode_pod &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; }
static bool includes_p (machine_mode);
protected:
machine_mode m_mode;
};
inline bool
scalar_mode::includes_p (machine_mode m)
{
switch (((enum mode_class) mode_class[m]))
{
case MODE_INT:
case MODE_PARTIAL_INT:
case MODE_FRACT:
case MODE_UFRACT:
case MODE_ACCUM:
case MODE_UACCUM:
case MODE_FLOAT:
case MODE_DECIMAL_FLOAT:
return true;
default:
return false;
}
}
class complex_mode
{
public:
typedef mode_traits<complex_mode>::from_int from_int;
typedef unsigned short measurement_type;
inline __attribute__ ((always_inline)) complex_mode () {}
inline __attribute__ ((always_inline)) constexpr
complex_mode (from_int m) : m_mode (machine_mode (m)) {}
inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; }
static bool includes_p (machine_mode);
protected:
machine_mode m_mode;
};
inline bool
complex_mode::includes_p (machine_mode m)
{
return (((enum mode_class) mode_class[m]) == MODE_COMPLEX_INT || ((enum mode_class) mode_class[m]) == MODE_COMPLEX_FLOAT);
}
inline __attribute__ ((always_inline)) poly_uint16
mode_to_bytes (machine_mode mode)
{
return (__builtin_constant_p (mode)
? mode_size_inline (mode) : mode_size[mode]);
}
inline __attribute__ ((always_inline)) poly_uint16
mode_to_bits (machine_mode mode)
{
return mode_to_bytes (mode) * (8);
}
inline __attribute__ ((always_inline)) poly_uint16
mode_to_precision (machine_mode mode)
{
return mode_precision[mode];
}
inline __attribute__ ((always_inline)) scalar_mode
mode_to_inner (machine_mode mode)
{
return scalar_mode::from_int (__builtin_constant_p (mode)
? mode_inner_inline (mode)
: mode_inner[mode]);
}
inline __attribute__ ((always_inline)) unsigned char
mode_to_unit_size (machine_mode mode)
{
return (__builtin_constant_p (mode)
? mode_unit_size_inline (mode) : mode_unit_size[mode]);
}
inline __attribute__ ((always_inline)) unsigned short
mode_to_unit_precision (machine_mode mode)
{
return (__builtin_constant_p (mode)
? mode_unit_precision_inline (mode) : mode_unit_precision[mode]);
}
inline __attribute__ ((always_inline)) poly_uint16
mode_to_nunits (machine_mode mode)
{
return (__builtin_constant_p (mode)
? mode_nunits_inline (mode) : mode_nunits[mode]);
}
inline __attribute__ ((always_inline)) poly_uint16
GET_MODE_SIZE (machine_mode mode)
{
return mode_to_bytes (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type
GET_MODE_SIZE (const T &mode)
{
return mode_to_bytes (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type
GET_MODE_SIZE (const T &mode)
{
return mode_to_bytes (mode).coeffs[0];
}
inline __attribute__ ((always_inline)) poly_uint16
GET_MODE_BITSIZE (machine_mode mode)
{
return mode_to_bits (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type
GET_MODE_BITSIZE (const T &mode)
{
return mode_to_bits (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type
GET_MODE_BITSIZE (const T &mode)
{
return mode_to_bits (mode).coeffs[0];
}
# 679 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
inline __attribute__ ((always_inline)) poly_uint16
GET_MODE_PRECISION (machine_mode mode)
{
return mode_to_precision (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type
GET_MODE_PRECISION (const T &mode)
{
return mode_to_precision (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type
GET_MODE_PRECISION (const T &mode)
{
return mode_to_precision (mode).coeffs[0];
}
extern const unsigned char mode_ibit[NUM_MACHINE_MODES];
extern const unsigned char mode_fbit[NUM_MACHINE_MODES];
extern const unsigned long mode_mask_array[NUM_MACHINE_MODES];
# 737 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
inline __attribute__ ((always_inline)) poly_uint16
GET_MODE_NUNITS (machine_mode mode)
{
return mode_to_nunits (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type
GET_MODE_NUNITS (const T &mode)
{
return mode_to_nunits (mode);
}
template<typename T>
inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type
GET_MODE_NUNITS (const T &mode)
{
return mode_to_nunits (mode).coeffs[0];
}
template<typename T>
inline __attribute__ ((always_inline)) opt_mode<T>
GET_MODE_WIDER_MODE (const T &m)
{
return typename opt_mode<T>::from_int (mode_wider[m]);
}
template<typename T>
inline __attribute__ ((always_inline)) opt_mode<T>
GET_MODE_2XWIDER_MODE (const T &m)
{
return typename opt_mode<T>::from_int (mode_2xwider[m]);
}
extern const unsigned char mode_complex[NUM_MACHINE_MODES];
class fixed_size_mode
{
public:
typedef mode_traits<fixed_size_mode>::from_int from_int;
typedef unsigned short measurement_type;
inline __attribute__ ((always_inline)) fixed_size_mode () {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (from_int m) : m_mode (machine_mode (m)) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const scalar_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const scalar_int_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const scalar_float_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const scalar_mode_pod &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const scalar_int_mode_pod &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr
fixed_size_mode (const complex_mode &m) : m_mode (m) {}
inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; }
static bool includes_p (machine_mode);
protected:
machine_mode m_mode;
};
inline bool
fixed_size_mode::includes_p (machine_mode mode)
{
return mode_to_bytes (mode).is_constant ();
}
# 841 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
extern opt_machine_mode mode_for_size (poly_uint64, enum mode_class, int);
inline opt_scalar_int_mode
int_mode_for_size (poly_uint64 size, int limit)
{
return dyn_cast <scalar_int_mode> (mode_for_size (size, MODE_INT, limit));
}
inline opt_scalar_float_mode
float_mode_for_size (poly_uint64 size)
{
return dyn_cast <scalar_float_mode> (mode_for_size (size, MODE_FLOAT, 0));
}
inline opt_scalar_float_mode
decimal_float_mode_for_size (unsigned int size)
{
return dyn_cast <scalar_float_mode>
(mode_for_size (size, MODE_DECIMAL_FLOAT, 0));
}
extern machine_mode smallest_mode_for_size (poly_uint64, enum mode_class);
inline scalar_int_mode
smallest_int_mode_for_size (poly_uint64 size)
{
return as_a <scalar_int_mode> (smallest_mode_for_size (size, MODE_INT));
}
extern opt_scalar_int_mode int_mode_for_mode (machine_mode);
extern opt_machine_mode bitwise_mode_for_mode (machine_mode);
extern opt_machine_mode mode_for_vector (scalar_mode, poly_uint64);
extern opt_machine_mode related_vector_mode (machine_mode, scalar_mode,
poly_uint64 = 0);
extern opt_machine_mode related_int_vector_mode (machine_mode);
class bit_field_mode_iterator
{
public:
bit_field_mode_iterator (long, long,
poly_int64, poly_int64,
unsigned int, bool);
bool next_mode (scalar_int_mode *);
bool prefer_smaller_modes ();
private:
opt_scalar_int_mode m_mode;
long m_bitsize;
long m_bitpos;
poly_int64 m_bitregion_start;
poly_int64 m_bitregion_end;
unsigned int m_align;
bool m_volatilep;
int m_count;
};
extern bool get_best_mode (int, int, poly_uint64, poly_uint64, unsigned int,
unsigned long, bool, scalar_int_mode *);
extern unsigned short mode_base_align[NUM_MACHINE_MODES];
extern unsigned get_mode_alignment (machine_mode);
extern const unsigned char class_narrowest_mode[MAX_MODE_CLASS];
# 939 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
template<typename T>
inline T
get_narrowest_mode (T mode)
{
return typename mode_traits<T>::from_int
(class_narrowest_mode[((enum mode_class) mode_class[mode])]);
}
extern scalar_int_mode byte_mode;
extern scalar_int_mode word_mode;
extern scalar_int_mode ptr_mode;
extern void init_adjust_machine_modes (void);
# 964 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
inline bool
HWI_COMPUTABLE_MODE_P (machine_mode mode)
{
machine_mode mme = mode;
return ((((enum mode_class) mode_class[mme]) == MODE_INT || ((enum mode_class) mode_class[mme]) == MODE_PARTIAL_INT)
&& mode_to_precision (mme).coeffs[0] <= 64);
}
inline bool
HWI_COMPUTABLE_MODE_P (scalar_int_mode mode)
{
return GET_MODE_PRECISION (mode) <= 64;
}
struct int_n_data_t {
unsigned int bitsize;
scalar_int_mode_pod m;
};
extern bool int_n_enabled_p[1];
extern const int_n_data_t int_n_data[1];
template<typename T>
inline bool
is_int_mode (machine_mode mode, T *int_mode)
{
if (((enum mode_class) mode_class[mode]) == MODE_INT)
{
*int_mode = scalar_int_mode (scalar_int_mode::from_int (mode));
return true;
}
return false;
}
template<typename T>
inline bool
is_float_mode (machine_mode mode, T *float_mode)
{
if (((enum mode_class) mode_class[mode]) == MODE_FLOAT)
{
*float_mode = scalar_float_mode (scalar_float_mode::from_int (mode));
return true;
}
return false;
}
template<typename T>
inline bool
is_complex_int_mode (machine_mode mode, T *cmode)
{
if (((enum mode_class) mode_class[mode]) == MODE_COMPLEX_INT)
{
*cmode = complex_mode (complex_mode::from_int (mode));
return true;
}
return false;
}
template<typename T>
inline bool
is_complex_float_mode (machine_mode mode, T *cmode)
{
if (((enum mode_class) mode_class[mode]) == MODE_COMPLEX_FLOAT)
{
*cmode = complex_mode (complex_mode::from_int (mode));
return true;
}
return false;
}
inline bool
is_narrower_int_mode (machine_mode mode, scalar_int_mode limit)
{
scalar_int_mode int_mode;
return (is_a <scalar_int_mode> (mode, &int_mode)
&& GET_MODE_PRECISION (int_mode) < GET_MODE_PRECISION (limit));
}
namespace mode_iterator
{
template<typename T>
inline void
start (opt_mode<T> *iter, enum mode_class mclass)
{
if (((machine_mode) class_narrowest_mode[mclass]) == E_VOIDmode)
*iter = opt_mode<T> ();
else
*iter = as_a<T> (((machine_mode) class_narrowest_mode[mclass]));
}
inline void
start (machine_mode *iter, enum mode_class mclass)
{
*iter = ((machine_mode) class_narrowest_mode[mclass]);
}
template<typename T>
inline bool
iterate_p (opt_mode<T> *iter)
{
return iter->exists ();
}
inline bool
iterate_p (machine_mode *iter)
{
return *iter != E_VOIDmode;
}
template<typename T>
inline void
get_wider (opt_mode<T> *iter)
{
*iter = GET_MODE_WIDER_MODE (iter->require ());
}
inline void
get_wider (machine_mode *iter)
{
*iter = GET_MODE_WIDER_MODE (*iter).else_void ();
}
template<typename T>
inline void
get_known_wider (T *iter)
{
*iter = GET_MODE_WIDER_MODE (*iter).require ();
}
template<typename T>
inline void
get_2xwider (opt_mode<T> *iter)
{
*iter = GET_MODE_2XWIDER_MODE (iter->require ());
}
inline void
get_2xwider (machine_mode *iter)
{
*iter = GET_MODE_2XWIDER_MODE (*iter).else_void ();
}
}
# 1183 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h"
template<typename T>
void
gt_ggc_mx (pod_mode<T> *)
{
}
template<typename T>
void
gt_pch_nx (pod_mode<T> *)
{
}
template<typename T>
void
gt_pch_nx (pod_mode<T> *, void (*) (void *, void *), void *)
{
}
# 470 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" 1
# 49 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h"
struct double_int
{
static double_int from_uhwi (unsigned long cst);
static double_int from_shwi (long cst);
static double_int from_pair (long high, unsigned long low);
static double_int from_buffer (const unsigned char *buffer, int len);
static double_int mask (unsigned prec);
static double_int max_value (unsigned int prec, bool uns);
static double_int min_value (unsigned int prec, bool uns);
double_int &operator ++ ();
double_int &operator -- ();
double_int &operator *= (double_int);
double_int &operator += (double_int);
double_int &operator -= (double_int);
double_int &operator &= (double_int);
double_int &operator ^= (double_int);
double_int &operator |= (double_int);
long to_shwi () const;
unsigned long to_uhwi () const;
bool fits_uhwi () const;
bool fits_shwi () const;
bool fits_hwi (bool uns) const;
int trailing_zeros () const;
int popcount () const;
bool multiple_of (double_int, bool, double_int *) const;
double_int set_bit (unsigned) const;
double_int mul_with_sign (double_int, bool unsigned_p, bool *overflow) const;
double_int wide_mul_with_sign (double_int, bool unsigned_p,
double_int *higher, bool *overflow) const;
double_int add_with_sign (double_int, bool unsigned_p, bool *overflow) const;
double_int sub_with_overflow (double_int, bool *overflow) const;
double_int neg_with_overflow (bool *overflow) const;
double_int operator * (double_int) const;
double_int operator + (double_int) const;
double_int operator - (double_int) const;
double_int operator - () const;
double_int operator ~ () const;
double_int operator & (double_int) const;
double_int operator | (double_int) const;
double_int operator ^ (double_int) const;
double_int and_not (double_int) const;
double_int lshift (long count) const;
double_int lshift (long count, unsigned int prec, bool arith) const;
double_int rshift (long count) const;
double_int rshift (long count, unsigned int prec, bool arith) const;
double_int alshift (long count, unsigned int prec) const;
double_int arshift (long count, unsigned int prec) const;
double_int llshift (long count, unsigned int prec) const;
double_int lrshift (long count, unsigned int prec) const;
double_int lrotate (long count, unsigned int prec) const;
double_int rrotate (long count, unsigned int prec) const;
double_int div (double_int, bool, unsigned) const;
double_int sdiv (double_int, unsigned) const;
double_int udiv (double_int, unsigned) const;
double_int mod (double_int, bool, unsigned) const;
double_int smod (double_int, unsigned) const;
double_int umod (double_int, unsigned) const;
double_int divmod_with_overflow (double_int, bool, unsigned,
double_int *, bool *) const;
double_int divmod (double_int, bool, unsigned, double_int *) const;
double_int sdivmod (double_int, unsigned, double_int *) const;
double_int udivmod (double_int, unsigned, double_int *) const;
double_int ext (unsigned prec, bool uns) const;
double_int zext (unsigned prec) const;
double_int sext (unsigned prec) const;
bool is_zero () const;
bool is_one () const;
bool is_minus_one () const;
bool is_negative () const;
int cmp (double_int b, bool uns) const;
int ucmp (double_int b) const;
int scmp (double_int b) const;
bool ult (double_int b) const;
bool ule (double_int b) const;
bool ugt (double_int b) const;
bool slt (double_int b) const;
bool sle (double_int b) const;
bool sgt (double_int b) const;
double_int max (double_int b, bool uns);
double_int smax (double_int b);
double_int umax (double_int b);
double_int min (double_int b, bool uns);
double_int smin (double_int b);
double_int umin (double_int b);
bool operator == (double_int cst2) const;
bool operator != (double_int cst2) const;
unsigned long low;
long high;
};
# 207 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h"
inline double_int
double_int::from_shwi (long cst)
{
double_int r;
r.low = (unsigned long) cst;
r.high = cst < 0 ? -1 : 0;
return r;
}
# 230 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h"
inline double_int
double_int::from_uhwi (unsigned long cst)
{
double_int r;
r.low = cst;
r.high = 0;
return r;
}
inline double_int
double_int::from_pair (long high, unsigned long low)
{
double_int r;
r.low = low;
r.high = high;
return r;
}
inline double_int &
double_int::operator ++ ()
{
*this += (double_int::from_shwi (1));
return *this;
}
inline double_int &
double_int::operator -- ()
{
*this -= (double_int::from_shwi (1));
return *this;
}
inline double_int &
double_int::operator &= (double_int b)
{
*this = *this & b;
return *this;
}
inline double_int &
double_int::operator ^= (double_int b)
{
*this = *this ^ b;
return *this;
}
inline double_int &
double_int::operator |= (double_int b)
{
*this = *this | b;
return *this;
}
inline long
double_int::to_shwi () const
{
return (long) low;
}
inline unsigned long
double_int::to_uhwi () const
{
return low;
}
inline bool
double_int::fits_uhwi () const
{
return high == 0;
}
inline double_int
double_int::operator ~ () const
{
double_int result;
result.low = ~low;
result.high = ~high;
return result;
}
inline double_int
double_int::operator | (double_int b) const
{
double_int result;
result.low = low | b.low;
result.high = high | b.high;
return result;
}
inline double_int
double_int::operator & (double_int b) const
{
double_int result;
result.low = low & b.low;
result.high = high & b.high;
return result;
}
inline double_int
double_int::and_not (double_int b) const
{
double_int result;
result.low = low & ~b.low;
result.high = high & ~b.high;
return result;
}
inline double_int
double_int::operator ^ (double_int b) const
{
double_int result;
result.low = low ^ b.low;
result.high = high ^ b.high;
return result;
}
void dump_double_int (FILE *, double_int, bool);
# 376 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h"
inline bool
double_int::is_zero () const
{
return low == 0 && high == 0;
}
inline bool
double_int::is_one () const
{
return low == 1 && high == 0;
}
inline bool
double_int::is_minus_one () const
{
return low == -1UL && high == -1;
}
inline bool
double_int::is_negative () const
{
return high < 0;
}
inline bool
double_int::operator == (double_int cst2) const
{
return low == cst2.low && high == cst2.high;
}
inline bool
double_int::operator != (double_int cst2) const
{
return low != cst2.low || high != cst2.high;
}
inline int
double_int::popcount () const
{
return popcount_hwi (high) + popcount_hwi (low);
}
void mpz_set_double_int (mpz_t, double_int, bool);
double_int mpz_get_double_int (const_tree, mpz_t, bool);
namespace wi
{
template <>
struct int_traits <double_int>
{
static const enum precision_type precision_type = CONST_PRECISION;
static const bool host_dependent_precision = true;
static const unsigned int precision = (2 * 64);
static unsigned int get_precision (const double_int &);
static wi::storage_ref decompose (long *, unsigned int,
const double_int &);
};
}
inline unsigned int
wi::int_traits <double_int>::get_precision (const double_int &)
{
return precision;
}
inline wi::storage_ref
wi::int_traits <double_int>::decompose (long *scratch, unsigned int p,
const double_int &x)
{
((void)(!(precision == p) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h", 462, __FUNCTION__), 0 : 0));
scratch[0] = x.low;
if ((x.high == 0 && scratch[0] >= 0) || (x.high == -1 && scratch[0] < 0))
return wi::storage_ref (scratch, 1, precision);
scratch[1] = x.high;
return wi::storage_ref (scratch, 2, precision);
}
# 471 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/align.h" 1
# 22 "/home/giulianob/gcc_git_gnu/gcc/gcc/align.h"
struct align_flags_tuple
{
int log;
int maxskip;
void normalize ()
{
int n = (1 << log);
if (maxskip > n)
maxskip = n - 1;
}
int get_value ()
{
return maxskip + 1;
}
};
class align_flags
{
public:
align_flags (int log0 = 0, int maxskip0 = 0, int log1 = 0, int maxskip1 = 0)
{
levels[0].log = log0;
levels[0].maxskip = maxskip0;
levels[1].log = log1;
levels[1].maxskip = maxskip1;
normalize ();
}
void normalize ()
{
for (unsigned i = 0; i < 2; i++)
levels[i].normalize ();
}
static align_flags max (const align_flags f0, const align_flags f1)
{
int log0 = ((f0.levels[0].log) > (f1.levels[0].log) ? (f0.levels[0].log) : (f1.levels[0].log));
int maxskip0 = ((f0.levels[0].maxskip) > (f1.levels[0].maxskip) ? (f0.levels[0].maxskip) : (f1.levels[0].maxskip));
int log1 = ((f0.levels[1].log) > (f1.levels[1].log) ? (f0.levels[1].log) : (f1.levels[1].log));
int maxskip1 = ((f0.levels[1].maxskip) > (f1.levels[1].maxskip) ? (f0.levels[1].maxskip) : (f1.levels[1].maxskip));
return align_flags (log0, maxskip0, log1, maxskip1);
}
align_flags_tuple levels[2];
};
# 472 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" 1
# 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
enum real_value_class {
rvc_zero,
rvc_normal,
rvc_inf,
rvc_nan
};
struct real_value {
unsigned int cl : 2;
unsigned int decimal : 1;
unsigned int sign : 1;
unsigned int signalling : 1;
unsigned int canonical : 1;
unsigned int uexp : (32 - 6);
unsigned long sig[((128 + (8 * 8)) / (8 * 8))];
};
# 80 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
extern char test_real_width
[sizeof (struct real_value) <= (((128 + (8 * 8)) + 32)/64 + (((128 + (8 * 8)) + 32)%64 ? 1 : 0)) * sizeof (long) ? 1 : -1];
# 118 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
struct real_format
{
void (*encode) (const struct real_format *, long *,
const struct real_value *);
void (*decode) (const struct real_format *, struct real_value *,
const long *);
int b;
int p;
int pnan;
int emin;
int emax;
int signbit_ro;
int signbit_rw;
# 158 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
int ieee_bits;
bool round_towards_zero;
bool has_sign_dependent_rounding;
bool has_nans;
bool has_inf;
bool has_denorm;
bool has_signed_zero;
bool qnan_msb_set;
bool canonical_nan_lsbs_set;
const char *name;
};
extern const struct real_format *
real_format_for_mode[MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1
+ MAX_MODE_DECIMAL_FLOAT - MIN_MODE_DECIMAL_FLOAT + 1];
# 217 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
class format_helper
{
public:
format_helper (const real_format *format) : m_format (format) {}
template<typename T> format_helper (const T &);
const real_format *operator-> () const { return m_format; }
operator const real_format *() const { return m_format; }
bool decimal_p () const { return m_format && m_format->b == 10; }
bool can_represent_integral_type_p (tree type) const;
private:
const real_format *m_format;
};
template<typename T>
inline format_helper::format_helper (const T &m)
: m_format (m == ((void) 0, E_VOIDmode) ? 0 : (real_format_for_mode[(((enum mode_class) mode_class[m]) == MODE_DECIMAL_FLOAT) ? (((m) - MIN_MODE_DECIMAL_FLOAT) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class) mode_class[m]) == MODE_FLOAT ? ((m) - MIN_MODE_FLOAT) : ((fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/real.h", 234, __FUNCTION__)), 0)]))
{}
# 244 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
extern bool HONOR_NANS (machine_mode);
extern bool HONOR_NANS (const_tree);
extern bool HONOR_NANS (const_rtx);
extern bool HONOR_SNANS (machine_mode);
extern bool HONOR_SNANS (const_tree);
extern bool HONOR_SNANS (const_rtx);
extern bool HONOR_INFINITIES (machine_mode);
extern bool HONOR_INFINITIES (const_tree);
extern bool HONOR_INFINITIES (const_rtx);
extern bool HONOR_SIGNED_ZEROS (machine_mode);
extern bool HONOR_SIGNED_ZEROS (const_tree);
extern bool HONOR_SIGNED_ZEROS (const_rtx);
extern bool HONOR_SIGN_DEPENDENT_ROUNDING (machine_mode);
extern bool HONOR_SIGN_DEPENDENT_ROUNDING (const_tree);
extern bool HONOR_SIGN_DEPENDENT_ROUNDING (const_rtx);
extern bool real_arithmetic (struct real_value *, int, const struct real_value *,
const struct real_value *);
extern bool real_compare (int, const struct real_value *, const struct real_value *);
extern bool real_isinf (const struct real_value *);
extern bool real_isnan (const struct real_value *);
extern bool real_issignaling_nan (const struct real_value *);
extern bool real_isfinite (const struct real_value *);
extern bool real_isneg (const struct real_value *);
extern bool real_isnegzero (const struct real_value *);
extern bool real_identical (const struct real_value *, const struct real_value *);
extern bool real_equal (const struct real_value *, const struct real_value *);
extern bool real_less (const struct real_value *, const struct real_value *);
extern void real_convert (struct real_value *, format_helper,
const struct real_value *);
extern bool exact_real_truncate (format_helper, const struct real_value *);
extern void real_to_decimal (char *, const struct real_value *, size_t,
size_t, int);
extern void real_to_decimal_for_mode (char *, const struct real_value *, size_t,
size_t, int, machine_mode);
extern void real_to_hexadecimal (char *, const struct real_value *,
size_t, size_t, int);
extern long real_to_integer (const struct real_value *);
extern int real_from_string (struct real_value *, const char *);
extern void real_from_string3 (struct real_value *, const char *, format_helper);
extern long real_to_target (long *, const struct real_value *, format_helper);
extern void real_from_target (struct real_value *, const long *,
format_helper);
extern void real_inf (struct real_value *);
extern bool real_nan (struct real_value *, const char *, int, format_helper);
extern void real_maxval (struct real_value *, int, machine_mode);
extern void real_2expN (struct real_value *, int, format_helper);
extern unsigned int real_hash (const struct real_value *);
extern const struct real_format ieee_single_format;
extern const struct real_format mips_single_format;
extern const struct real_format motorola_single_format;
extern const struct real_format spu_single_format;
extern const struct real_format ieee_double_format;
extern const struct real_format mips_double_format;
extern const struct real_format motorola_double_format;
extern const struct real_format ieee_extended_motorola_format;
extern const struct real_format ieee_extended_intel_96_format;
extern const struct real_format ieee_extended_intel_96_round_53_format;
extern const struct real_format ieee_extended_intel_128_format;
extern const struct real_format ibm_extended_format;
extern const struct real_format mips_extended_format;
extern const struct real_format ieee_quad_format;
extern const struct real_format mips_quad_format;
extern const struct real_format vax_f_format;
extern const struct real_format vax_d_format;
extern const struct real_format vax_g_format;
extern const struct real_format real_internal_format;
extern const struct real_format decimal_single_format;
extern const struct real_format decimal_double_format;
extern const struct real_format decimal_quad_format;
extern const struct real_format ieee_half_format;
extern const struct real_format arm_half_format;
extern const struct real_format arm_bfloat_half_format;
# 418 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
extern struct real_value real_value_truncate (format_helper, struct real_value);
extern struct real_value real_value_negate (const struct real_value *);
extern struct real_value real_value_abs (const struct real_value *);
extern int significand_size (format_helper);
extern struct real_value real_from_string2 (const char *, format_helper);
# 443 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
extern int real_exponent (const struct real_value *);
extern void real_ldexp (struct real_value *, const struct real_value *, int);
extern struct real_value dconst0;
extern struct real_value dconst1;
extern struct real_value dconst2;
extern struct real_value dconstm1;
extern struct real_value dconsthalf;
# 466 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h"
extern const struct real_value * dconst_e_ptr (void);
extern const struct real_value *dconst_third_ptr (void);
extern const struct real_value *dconst_quarter_ptr (void);
extern const struct real_value *dconst_sixth_ptr (void);
extern const struct real_value *dconst_ninth_ptr (void);
extern const struct real_value * dconst_sqrt2_ptr (void);
struct real_value real_value_from_int_cst (const_tree, const_tree);
extern rtx const_double_from_real_value (struct real_value, machine_mode);
extern bool exact_real_inverse (format_helper, struct real_value *);
bool real_can_shorten_arithmetic (machine_mode, machine_mode);
extern tree build_real (tree, struct real_value);
extern tree build_real_truncate (tree, struct real_value);
extern bool real_powi (struct real_value *, format_helper,
const struct real_value *, long);
extern void real_trunc (struct real_value *, format_helper,
const struct real_value *);
extern void real_floor (struct real_value *, format_helper,
const struct real_value *);
extern void real_ceil (struct real_value *, format_helper,
const struct real_value *);
extern void real_round (struct real_value *, format_helper,
const struct real_value *);
extern void real_roundeven (struct real_value *, format_helper,
const struct real_value *);
extern void real_copysign (struct real_value *, const struct real_value *);
extern bool real_isinteger (const struct real_value *, format_helper);
extern bool real_isinteger (const struct real_value *, long *);
extern bool real_nextafter (struct real_value *, format_helper,
const struct real_value *, const struct real_value *);
extern void get_max_float (const struct real_format *, char *, size_t, bool);
extern wide_int real_to_integer (const struct real_value *, bool *, int);
extern void real_from_integer (struct real_value *, format_helper,
const wide_int_ref &, signop);
extern void build_sinatan_real (struct real_value *, tree);
# 475 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h" 1
# 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h"
struct fixed_value
{
double_int data;
scalar_mode_pod mode;
};
# 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h"
extern struct fixed_value fconst0[18];
extern struct fixed_value fconst1[8];
# 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h"
extern rtx const_fixed_from_fixed_value (struct fixed_value, machine_mode);
extern struct fixed_value fixed_from_double_int (double_int, scalar_mode);
static inline rtx
const_fixed_from_double_int (double_int payload,
scalar_mode mode)
{
return
const_fixed_from_fixed_value (fixed_from_double_int (payload, mode),
mode);
}
extern void fixed_from_string (struct fixed_value *, const char *,
scalar_mode);
extern tree build_fixed (tree, struct fixed_value);
extern bool fixed_convert (struct fixed_value *, scalar_mode,
const struct fixed_value *, bool);
extern bool fixed_convert_from_int (struct fixed_value *, scalar_mode,
double_int, bool, bool);
extern bool fixed_convert_from_real (struct fixed_value *, scalar_mode,
const struct real_value *, bool);
extern void real_convert_from_fixed (struct real_value *, scalar_mode,
const struct fixed_value *);
extern bool fixed_identical (const struct fixed_value *, const struct fixed_value *);
extern unsigned int fixed_hash (const struct fixed_value *);
extern void fixed_to_decimal (char *str, const struct fixed_value *, size_t);
extern bool fixed_arithmetic (struct fixed_value *, int, const struct fixed_value *,
const struct fixed_value *, bool);
extern bool fixed_compare (int, const struct fixed_value *,
const struct fixed_value *);
extern bool fixed_isneg (const struct fixed_value *);
# 476 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 1
# 246 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/statistics.h" 1
# 61 "/home/giulianob/gcc_git_gnu/gcc/gcc/statistics.h"
struct function;
extern void statistics_early_init (void);
extern void statistics_init (void);
extern void statistics_fini (void);
extern void statistics_fini_pass (void);
extern void statistics_counter_event (struct function *, const char *, int);
extern void statistics_histogram_event (struct function *, const char *, int);
# 247 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" 1
# 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h"
# 1 "./gtype-desc.h" 1
# 31 "./gtype-desc.h"
extern void gt_ggc_mx_line_maps (void *);
extern void gt_ggc_mx_cpp_token (void *);
extern void gt_ggc_mx_cpp_macro (void *);
extern void gt_ggc_mx_string_concat (void *);
extern void gt_ggc_mx_string_concat_db (void *);
extern void gt_ggc_mx_hash_map_location_hash_string_concat__ (void *);
extern void gt_ggc_mx_bitmap_head (void *);
extern void gt_ggc_mx_rtx_def (void *);
extern void gt_ggc_mx_rtvec_def (void *);
extern void gt_ggc_mx_gimple (void *);
extern void gt_ggc_mx_symtab_node (void *);
extern void gt_ggc_mx_cgraph_edge (void *);
extern void gt_ggc_mx_section (void *);
extern void gt_ggc_mx_cl_target_option (void *);
extern void gt_ggc_mx_cl_optimization (void *);
extern void gt_ggc_mx_edge_def (void *);
extern void gt_ggc_mx_basic_block_def (void *);
extern void gt_ggc_mx_stack_local_entry (void *);
extern void gt_ggc_mx_machine_function (void *);
extern void gt_ggc_mx_bitmap_element (void *);
extern void gt_ggc_mx_generic_wide_int_wide_int_storage_ (void *);
extern void gt_ggc_mx_coverage_data (void *);
extern void gt_ggc_mx_mem_attrs (void *);
extern void gt_ggc_mx_reg_attrs (void *);
extern void gt_ggc_mx_object_block (void *);
extern void gt_ggc_mx_vec_rtx_va_gc_ (void *);
extern void gt_ggc_mx_real_value (void *);
extern void gt_ggc_mx_fixed_value (void *);
extern void gt_ggc_mx_constant_descriptor_rtx (void *);
extern void gt_ggc_mx_function (void *);
extern void gt_ggc_mx_target_rtl (void *);
extern void gt_ggc_mx_cgraph_rtl_info (void *);
extern void gt_ggc_mx_hash_map_tree_tree_decl_tree_cache_traits_ (void *);
extern void gt_ggc_mx_hash_map_tree_tree_type_tree_cache_traits_ (void *);
extern void gt_ggc_mx_ptr_info_def (void *);
extern void gt_ggc_mx_range_info_def (void *);
extern void gt_ggc_mx_die_struct (void *);
extern void gt_ggc_mx_vec_constructor_elt_va_gc_ (void *);
extern void gt_ggc_mx_vec_tree_va_gc_ (void *);
extern void gt_ggc_mx_lang_type (void *);
extern void gt_ggc_mx_lang_decl (void *);
extern void gt_ggc_mx_tree_statement_list_node (void *);
extern void gt_ggc_mx_target_globals (void *);
extern void gt_ggc_mx_lang_tree_node (void *);
extern void gt_ggc_mx_tree_map (void *);
extern void gt_ggc_mx_tree_decl_map (void *);
extern void gt_ggc_mx_tree_int_map (void *);
extern void gt_ggc_mx_tree_vec_map (void *);
extern void gt_ggc_mx_vec_alias_pair_va_gc_ (void *);
extern void gt_ggc_mx_libfunc_entry (void *);
extern void gt_ggc_mx_hash_table_libfunc_hasher_ (void *);
extern void gt_ggc_mx_target_libfuncs (void *);
extern void gt_ggc_mx_sequence_stack (void *);
extern void gt_ggc_mx_vec_rtx_insn__va_gc_ (void *);
extern void gt_ggc_mx_call_site_record_d (void *);
extern void gt_ggc_mx_vec_uchar_va_gc_ (void *);
extern void gt_ggc_mx_vec_call_site_record_va_gc_ (void *);
extern void gt_ggc_mx_gimple_df (void *);
extern void gt_ggc_mx_dw_fde_node (void *);
extern void gt_ggc_mx_rtx_constant_pool (void *);
extern void gt_ggc_mx_frame_space (void *);
extern void gt_ggc_mx_vec_callinfo_callee_va_gc_ (void *);
extern void gt_ggc_mx_vec_callinfo_dalloc_va_gc_ (void *);
extern void gt_ggc_mx_stack_usage (void *);
extern void gt_ggc_mx_eh_status (void *);
extern void gt_ggc_mx_control_flow_graph (void *);
extern void gt_ggc_mx_loops (void *);
extern void gt_ggc_mx_language_function (void *);
extern void gt_ggc_mx_hash_set_tree_ (void *);
extern void gt_ggc_mx_types_used_by_vars_entry (void *);
extern void gt_ggc_mx_hash_table_used_type_hasher_ (void *);
extern void gt_ggc_mx_nb_iter_bound (void *);
extern void gt_ggc_mx_loop_exit (void *);
extern void gt_ggc_mx_loop (void *);
extern void gt_ggc_mx_control_iv (void *);
extern void gt_ggc_mx_vec_loop_p_va_gc_ (void *);
extern void gt_ggc_mx_niter_desc (void *);
extern void gt_ggc_mx_hash_table_loop_exit_hasher_ (void *);
extern void gt_ggc_mx_vec_basic_block_va_gc_ (void *);
extern void gt_ggc_mx_rtl_bb_info (void *);
extern void gt_ggc_mx_vec_edge_va_gc_ (void *);
extern void gt_ggc_mx_vec_ipa_ref_t_va_gc_ (void *);
extern void gt_ggc_mx_section_hash_entry (void *);
extern void gt_ggc_mx_lto_file_decl_data (void *);
extern void gt_ggc_mx_ipa_replace_map (void *);
extern void gt_ggc_mx_vec_ipa_replace_map__va_gc_ (void *);
extern void gt_ggc_mx_ipa_param_adjustments (void *);
extern void gt_ggc_mx_vec_ipa_param_performed_split_va_gc_ (void *);
extern void gt_ggc_mx_cgraph_simd_clone (void *);
extern void gt_ggc_mx_cgraph_function_version_info (void *);
extern void gt_ggc_mx_hash_table_cgraph_edge_hasher_ (void *);
extern void gt_ggc_mx_cgraph_indirect_call_info (void *);
extern void gt_ggc_mx_asm_node (void *);
extern void gt_ggc_mx_symbol_table (void *);
extern void gt_ggc_mx_hash_table_section_name_hasher_ (void *);
extern void gt_ggc_mx_hash_table_asmname_hasher_ (void *);
extern void gt_ggc_mx_hash_map_symtab_node__symbol_priority_map_ (void *);
extern void gt_ggc_mx_constant_descriptor_tree (void *);
extern void gt_ggc_mx_hash_map_alias_set_hash_int_ (void *);
extern void gt_ggc_mx_alias_set_entry (void *);
extern void gt_ggc_mx_vec_alias_set_entry__va_gc_ (void *);
extern void gt_ggc_mx_hash_table_function_version_hasher_ (void *);
extern void gt_ggc_mx_lto_in_decl_state (void *);
extern void gt_ggc_mx_hash_table_ipa_bit_ggc_hash_traits_ (void *);
extern void gt_ggc_mx_hash_table_ipa_vr_ggc_hash_traits_ (void *);
extern void gt_ggc_mx_ipa_node_params (void *);
extern void gt_ggc_mx_ipa_edge_args (void *);
extern void gt_ggc_mx_ipa_agg_replacement_value (void *);
extern void gt_ggc_mx_ipa_fn_summary (void *);
extern void gt_ggc_mx_odr_type_d (void *);
extern void gt_ggc_mx_vec_ipa_adjusted_param_va_gc_ (void *);
extern void gt_ggc_mx_param_access (void *);
extern void gt_ggc_mx_vec_param_access__va_gc_ (void *);
extern void gt_ggc_mx_isra_func_summary (void *);
extern void gt_ggc_mx_vec_isra_param_desc_va_gc_ (void *);
extern void gt_ggc_mx_ipa_sra_function_summaries (void *);
extern void gt_ggc_mx_typeinfo (void *);
extern void gt_ggc_mx_dw_cfi_node (void *);
extern void gt_ggc_mx_dw_loc_descr_node (void *);
extern void gt_ggc_mx_dw_loc_list_struct (void *);
extern void gt_ggc_mx_dw_discr_list_node (void *);
extern void gt_ggc_mx_dw_cfa_location (void *);
extern void gt_ggc_mx_vec_dw_cfi_ref_va_gc_ (void *);
extern void gt_ggc_mx_addr_table_entry (void *);
extern void gt_ggc_mx_indirect_string_node (void *);
extern void gt_ggc_mx_dwarf_file_data (void *);
extern void gt_ggc_mx_hash_map_char__tree_ (void *);
extern void gt_ggc_mx_dw_cfi_row (void *);
extern void gt_ggc_mx_reg_saved_in_data (void *);
extern void gt_ggc_mx_vec_dw_fde_ref_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_indirect_string_hasher_ (void *);
extern void gt_ggc_mx_comdat_type_node (void *);
extern void gt_ggc_mx_vec_dw_line_info_entry_va_gc_ (void *);
extern void gt_ggc_mx_dw_line_info_table (void *);
extern void gt_ggc_mx_vec_dw_attr_node_va_gc_ (void *);
extern void gt_ggc_mx_limbo_die_struct (void *);
extern void gt_ggc_mx_hash_table_dwarf_file_hasher_ (void *);
extern void gt_ggc_mx_hash_table_decl_die_hasher_ (void *);
extern void gt_ggc_mx_vec_dw_die_ref_va_gc_ (void *);
extern void gt_ggc_mx_variable_value_struct (void *);
extern void gt_ggc_mx_hash_table_variable_value_hasher_ (void *);
extern void gt_ggc_mx_hash_table_block_die_hasher_ (void *);
extern void gt_ggc_mx_var_loc_node (void *);
extern void gt_ggc_mx_var_loc_list_def (void *);
extern void gt_ggc_mx_call_arg_loc_node (void *);
extern void gt_ggc_mx_hash_table_decl_loc_hasher_ (void *);
extern void gt_ggc_mx_cached_dw_loc_list_def (void *);
extern void gt_ggc_mx_hash_table_dw_loc_list_hasher_ (void *);
extern void gt_ggc_mx_vec_dw_line_info_table__va_gc_ (void *);
extern void gt_ggc_mx_vec_pubname_entry_va_gc_ (void *);
extern void gt_ggc_mx_vec_macinfo_entry_va_gc_ (void *);
extern void gt_ggc_mx_vec_dw_ranges_va_gc_ (void *);
extern void gt_ggc_mx_vec_dw_ranges_by_label_va_gc_ (void *);
extern void gt_ggc_mx_vec_die_arg_entry_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_addr_hasher_ (void *);
extern void gt_ggc_mx_hash_map_tree_sym_off_pair_ (void *);
extern void gt_ggc_mx_inline_entry_data (void *);
extern void gt_ggc_mx_hash_table_inline_entry_data_hasher_ (void *);
extern void gt_ggc_mx_temp_slot (void *);
extern void gt_ggc_mx_initial_value_struct (void *);
extern void gt_ggc_mx_vec_temp_slot_p_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_const_int_hasher_ (void *);
extern void gt_ggc_mx_hash_table_const_wide_int_hasher_ (void *);
extern void gt_ggc_mx_hash_table_const_poly_int_hasher_ (void *);
extern void gt_ggc_mx_hash_table_reg_attr_hasher_ (void *);
extern void gt_ggc_mx_hash_table_const_double_hasher_ (void *);
extern void gt_ggc_mx_hash_table_const_fixed_hasher_ (void *);
extern void gt_ggc_mx_eh_region_d (void *);
extern void gt_ggc_mx_eh_landing_pad_d (void *);
extern void gt_ggc_mx_eh_catch_d (void *);
extern void gt_ggc_mx_vec_eh_region_va_gc_ (void *);
extern void gt_ggc_mx_vec_eh_landing_pad_va_gc_ (void *);
extern void gt_ggc_mx_hash_map_gimple__int_ (void *);
extern void gt_ggc_mx_hash_table_insn_cache_hasher_ (void *);
extern void gt_ggc_mx_temp_slot_address_entry (void *);
extern void gt_ggc_mx_hash_table_temp_address_hasher_ (void *);
extern void gt_ggc_mx_hash_map_tree_hash_tree_ (void *);
extern void gt_ggc_mx_test_struct (void *);
extern void gt_ggc_mx_test_of_length (void *);
extern void gt_ggc_mx_test_other (void *);
extern void gt_ggc_mx_test_of_union (void *);
extern void gt_ggc_mx_example_base (void *);
extern void gt_ggc_mx_test_node (void *);
extern void gt_ggc_mx_user_struct (void *);
extern void gt_ggc_mx_hash_table_libfunc_decl_hasher_ (void *);
extern void gt_ggc_mx_string_pool_data (void *);
extern void gt_ggc_mx_type_hash (void *);
extern void gt_ggc_mx_hash_table_type_cache_hasher_ (void *);
extern void gt_ggc_mx_hash_table_int_cst_hasher_ (void *);
extern void gt_ggc_mx_hash_table_poly_int_cst_hasher_ (void *);
extern void gt_ggc_mx_hash_table_cl_option_hasher_ (void *);
extern void gt_ggc_mx_hash_table_tree_decl_map_cache_hasher_ (void *);
extern void gt_ggc_mx_hash_table_tree_vec_map_cache_hasher_ (void *);
extern void gt_ggc_mx_hash_table_section_hasher_ (void *);
extern void gt_ggc_mx_hash_table_object_block_hasher_ (void *);
extern void gt_ggc_mx_hash_table_tree_descriptor_hasher_ (void *);
extern void gt_ggc_mx_hash_table_const_rtx_desc_hasher_ (void *);
extern void gt_ggc_mx_hash_table_tm_clone_hasher_ (void *);
extern void gt_ggc_mx_tm_restart_node (void *);
extern void gt_ggc_mx_hash_map_tree_tree_ (void *);
extern void gt_ggc_mx_hash_table_ssa_name_hasher_ (void *);
extern void gt_ggc_mx_hash_table_tm_restart_hasher_ (void *);
extern void gt_ggc_mx_vec_mem_addr_template_va_gc_ (void *);
extern void gt_ggc_mx_scev_info_str (void *);
extern void gt_ggc_mx_hash_table_scev_info_hasher_ (void *);
extern void gt_ggc_mx_ssa_operand_memory_d (void *);
extern void gt_ggc_mx_vec_omp_declare_variant_entry_va_gc_ (void *);
extern void gt_ggc_mx_omp_declare_variant_base_entry (void *);
extern void gt_ggc_mx_hash_table_omp_declare_variant_hasher_ (void *);
extern void gt_ggc_mx_hash_table_omp_declare_variant_alt_hasher_ (void *);
extern void gt_ggc_mx_hash_table_dllimport_hasher_ (void *);
extern void gt_ggc_mx_hash_map_char__unsigned_ (void *);
extern void gt_ggc_mx_vec_gimple__va_gc_ (void *);
extern void gt_ggc_mx_int_range_1_ (void *);
extern void gt_ggc_mx_vec_ipa_agg_jf_item_va_gc_ (void *);
extern void gt_ggc_mx_ipa_bits (void *);
extern void gt_ggc_mx_vec_ipa_param_descriptor_va_gc_ (void *);
extern void gt_ggc_mx_vec_ipa_bits__va_gc_ (void *);
extern void gt_ggc_mx_vec_ipa_vr_va_gc_ (void *);
extern void gt_ggc_mx_ipcp_transformation (void *);
extern void gt_ggc_mx_vec_ipa_jump_func_va_gc_ (void *);
extern void gt_ggc_mx_vec_ipa_polymorphic_call_context_va_gc_ (void *);
extern void gt_ggc_mx_ipa_node_params_t (void *);
extern void gt_ggc_mx_ipa_edge_args_sum_t (void *);
extern void gt_ggc_mx_function_summary_ipcp_transformation__ (void *);
extern void gt_ggc_mx_hash_table_tm_wrapper_hasher_ (void *);
extern void gt_ggc_mx_hash_table_decl_state_hasher_ (void *);
extern void gt_ggc_mx_vec_expr_eval_op_va_gc_ (void *);
extern void gt_ggc_mx_vec_condition_va_gc_ (void *);
extern void gt_ggc_mx_vec_size_time_entry_va_gc_ (void *);
extern void gt_ggc_mx_fast_function_summary_ipa_fn_summary__va_gc_ (void *);
extern void gt_ggc_mx_tree_type_map (void *);
extern void gt_ggc_mx_hash_table_tree_type_map_cache_hasher_ (void *);
extern void gt_ggc_mx_vec_odr_type_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_value_annotation_hasher_ (void *);
extern void gt_ggc_mx_vec_Entity_Id_va_gc_atomic_ (void *);
extern void gt_ggc_mx_tree_entity_vec_map (void *);
extern void gt_ggc_mx_hash_table_dummy_type_hasher_ (void *);
extern void gt_ggc_mx_parm_attr_d (void *);
extern void gt_ggc_mx_vec_parm_attr_va_gc_ (void *);
extern void gt_ggc_mx_stmt_group (void *);
extern void gt_ggc_mx_elab_info (void *);
extern void gt_ggc_mx_range_check_info_d (void *);
extern void gt_ggc_mx_vec_range_check_info_va_gc_ (void *);
extern void gt_ggc_mx_loop_info_d (void *);
extern void gt_ggc_mx_vec_loop_info_va_gc_ (void *);
extern void gt_ggc_mx_gnat_binding_level (void *);
extern void gt_ggc_mx_packable_type_hash (void *);
extern void gt_ggc_mx_hash_table_packable_type_hasher_ (void *);
extern void gt_ggc_mx_pad_type_hash (void *);
extern void gt_ggc_mx_hash_table_pad_type_hasher_ (void *);
extern void gt_ggc_mx_c_label_vars (void *);
extern void gt_ggc_mx_c_binding (void *);
extern void gt_ggc_mx_c_scope (void *);
extern void gt_ggc_mx_c_goto_bindings (void *);
extern void gt_ggc_mx_vec_c_goto_bindings_p_va_gc_ (void *);
extern void gt_ggc_mx_c_inline_static (void *);
extern void gt_ggc_mx_sorted_fields_type (void *);
extern void gt_ggc_mx_vec_const_char_p_va_gc_ (void *);
extern void gt_ggc_mx_vec_tree_gc_vec_va_gc_ (void *);
extern void gt_ggc_mx_align_stack (void *);
extern void gt_ggc_mx_vec_pending_weak_va_gc_ (void *);
extern void gt_ggc_mx_vec_pending_redefinition_va_gc_ (void *);
extern void gt_ggc_mx_opt_stack (void *);
extern void gt_ggc_mx_c_parser (void *);
extern void gt_ggc_mx_vec_c_token_va_gc_ (void *);
extern void gt_ggc_mx_binding_table_s (void *);
extern void gt_ggc_mx_binding_entry_s (void *);
extern void gt_ggc_mx_cxx_binding (void *);
extern void gt_ggc_mx_cp_binding_level (void *);
extern void gt_ggc_mx_vec_cp_class_binding_va_gc_ (void *);
extern void gt_ggc_mx_cp_token_cache (void *);
extern void gt_ggc_mx_vec_deferred_access_check_va_gc_ (void *);
extern void gt_ggc_mx_vec_cxx_saved_binding_va_gc_ (void *);
extern void gt_ggc_mx_saved_scope (void *);
extern void gt_ggc_mx_cxx_int_tree_map (void *);
extern void gt_ggc_mx_named_label_entry (void *);
extern void gt_ggc_mx_hash_table_named_label_hash_ (void *);
extern void gt_ggc_mx_hash_table_cxx_int_tree_map_hasher_ (void *);
extern void gt_ggc_mx_tree_pair_s (void *);
extern void gt_ggc_mx_vec_tree_pair_s_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_named_decl_hash_ (void *);
extern void gt_ggc_mx_tinst_level (void *);
extern void gt_ggc_mx_tree_check (void *);
extern void gt_ggc_mx_vec_cp_token_va_gc_ (void *);
extern void gt_ggc_mx_cp_lexer (void *);
extern void gt_ggc_mx_vec_cp_default_arg_entry_va_gc_ (void *);
extern void gt_ggc_mx_cp_parser_context (void *);
extern void gt_ggc_mx_vec_cp_unparsed_functions_entry_va_gc_ (void *);
extern void gt_ggc_mx_cp_parser (void *);
extern void gt_ggc_mx_hash_map_tree_int_ (void *);
extern void gt_ggc_mx_constexpr_fundef (void *);
extern void gt_ggc_mx_hash_table_constexpr_fundef_hasher_ (void *);
extern void gt_ggc_mx_constexpr_call (void *);
extern void gt_ggc_mx_hash_table_constexpr_call_hasher_ (void *);
extern void gt_ggc_mx_sat_entry (void *);
extern void gt_ggc_mx_hash_table_sat_hasher_ (void *);
extern void gt_ggc_mx_coroutine_info (void *);
extern void gt_ggc_mx_hash_table_coroutine_info_hasher_ (void *);
extern void gt_ggc_mx_source_location_table_entry (void *);
extern void gt_ggc_mx_hash_table_source_location_table_entry_hash_ (void *);
extern void gt_ggc_mx_named_label_use_entry (void *);
extern void gt_ggc_mx_vec_incomplete_var_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_typename_hasher_ (void *);
extern void gt_ggc_mx_hash_table_mangled_decl_hash_ (void *);
extern void gt_ggc_mx_vec_pending_noexcept_va_gc_ (void *);
extern void gt_ggc_mx_vec_tree_int_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_conv_type_hasher_ (void *);
extern void gt_ggc_mx_subsumption_entry (void *);
extern void gt_ggc_mx_hash_table_subsumption_hasher_ (void *);
extern void gt_ggc_mx_pending_template (void *);
extern void gt_ggc_mx_spec_entry (void *);
extern void gt_ggc_mx_hash_table_spec_hasher_ (void *);
extern void gt_ggc_mx_hash_map_tree_tree_pair_p_ (void *);
extern void gt_ggc_mx_vec_tinfo_s_va_gc_ (void *);
extern void gt_ggc_mx_vec_deferred_access_va_gc_ (void *);
extern void gt_ggc_mx_hash_table_cplus_array_hasher_ (void *);
extern void gt_ggc_mx_hash_table_list_hasher_ (void *);
extern void gt_ggc_mx_pending_abstract_type (void *);
extern void gt_ggc_mx_hash_table_abstract_type_hasher_ (void *);
extern void gt_ggc_mx_Statement (void *);
extern void gt_ggc_mx_binding_level (void *);
extern void gt_ggc_mx_d_label_use_entry (void *);
extern void gt_ggc_mx_hash_map_Statement__d_label_entry_ (void *);
extern void gt_ggc_mx_hash_table_module_hasher_ (void *);
extern void gt_ggc_mx_module_htab_entry (void *);
extern void gt_ggc_mx_hash_table_module_decl_hasher_ (void *);
extern void gt_ggc_mx_objc_map_private (void *);
extern void gt_ggc_mx_hashed_entry (void *);
extern void gt_ggc_mx_hashed_attribute (void *);
extern void gt_ggc_mx_imp_entry (void *);
extern void gt_ggc_mx_string_descriptor (void *);
extern void gt_ggc_mx_hash_table_objc_string_hasher_ (void *);
extern void gt_ggc_mx_vec_ident_data_tuple_va_gc_ (void *);
extern void gt_ggc_mx_vec_msgref_entry_va_gc_ (void *);
extern void gt_ggc_mx_vec_prot_list_entry_va_gc_ (void *);
extern void gt_ggc_mx_vec_ivarref_entry_va_gc_ (void *);
# 1388 "./gtype-desc.h"
extern void gt_pch_nx_line_maps (void *);
extern void gt_pch_nx_cpp_token (void *);
extern void gt_pch_nx_cpp_macro (void *);
extern void gt_pch_nx_string_concat (void *);
extern void gt_pch_nx_string_concat_db (void *);
extern void gt_pch_nx_hash_map_location_hash_string_concat__ (void *);
extern void gt_pch_nx_bitmap_head (void *);
extern void gt_pch_nx_rtx_def (void *);
extern void gt_pch_nx_rtvec_def (void *);
extern void gt_pch_nx_gimple (void *);
extern void gt_pch_nx_symtab_node (void *);
extern void gt_pch_nx_cgraph_edge (void *);
extern void gt_pch_nx_section (void *);
extern void gt_pch_nx_cl_target_option (void *);
extern void gt_pch_nx_cl_optimization (void *);
extern void gt_pch_nx_edge_def (void *);
extern void gt_pch_nx_basic_block_def (void *);
extern void gt_pch_nx_stack_local_entry (void *);
extern void gt_pch_nx_machine_function (void *);
extern void gt_pch_nx_bitmap_element (void *);
extern void gt_pch_nx_generic_wide_int_wide_int_storage_ (void *);
extern void gt_pch_nx_coverage_data (void *);
extern void gt_pch_nx_mem_attrs (void *);
extern void gt_pch_nx_reg_attrs (void *);
extern void gt_pch_nx_object_block (void *);
extern void gt_pch_nx_vec_rtx_va_gc_ (void *);
extern void gt_pch_nx_real_value (void *);
extern void gt_pch_nx_fixed_value (void *);
extern void gt_pch_nx_constant_descriptor_rtx (void *);
extern void gt_pch_nx_function (void *);
extern void gt_pch_nx_target_rtl (void *);
extern void gt_pch_nx_cgraph_rtl_info (void *);
extern void gt_pch_nx_hash_map_tree_tree_decl_tree_cache_traits_ (void *);
extern void gt_pch_nx_hash_map_tree_tree_type_tree_cache_traits_ (void *);
extern void gt_pch_nx_ptr_info_def (void *);
extern void gt_pch_nx_range_info_def (void *);
extern void gt_pch_nx_die_struct (void *);
extern void gt_pch_nx_vec_constructor_elt_va_gc_ (void *);
extern void gt_pch_nx_vec_tree_va_gc_ (void *);
extern void gt_pch_nx_lang_type (void *);
extern void gt_pch_nx_lang_decl (void *);
extern void gt_pch_nx_tree_statement_list_node (void *);
extern void gt_pch_nx_target_globals (void *);
extern void gt_pch_nx_lang_tree_node (void *);
extern void gt_pch_nx_tree_map (void *);
extern void gt_pch_nx_tree_decl_map (void *);
extern void gt_pch_nx_tree_int_map (void *);
extern void gt_pch_nx_tree_vec_map (void *);
extern void gt_pch_nx_vec_alias_pair_va_gc_ (void *);
extern void gt_pch_nx_libfunc_entry (void *);
extern void gt_pch_nx_hash_table_libfunc_hasher_ (void *);
extern void gt_pch_nx_target_libfuncs (void *);
extern void gt_pch_nx_sequence_stack (void *);
extern void gt_pch_nx_vec_rtx_insn__va_gc_ (void *);
extern void gt_pch_nx_call_site_record_d (void *);
extern void gt_pch_nx_vec_uchar_va_gc_ (void *);
extern void gt_pch_nx_vec_call_site_record_va_gc_ (void *);
extern void gt_pch_nx_gimple_df (void *);
extern void gt_pch_nx_dw_fde_node (void *);
extern void gt_pch_nx_rtx_constant_pool (void *);
extern void gt_pch_nx_frame_space (void *);
extern void gt_pch_nx_vec_callinfo_callee_va_gc_ (void *);
extern void gt_pch_nx_vec_callinfo_dalloc_va_gc_ (void *);
extern void gt_pch_nx_stack_usage (void *);
extern void gt_pch_nx_eh_status (void *);
extern void gt_pch_nx_control_flow_graph (void *);
extern void gt_pch_nx_loops (void *);
extern void gt_pch_nx_language_function (void *);
extern void gt_pch_nx_hash_set_tree_ (void *);
extern void gt_pch_nx_types_used_by_vars_entry (void *);
extern void gt_pch_nx_hash_table_used_type_hasher_ (void *);
extern void gt_pch_nx_nb_iter_bound (void *);
extern void gt_pch_nx_loop_exit (void *);
extern void gt_pch_nx_loop (void *);
extern void gt_pch_nx_control_iv (void *);
extern void gt_pch_nx_vec_loop_p_va_gc_ (void *);
extern void gt_pch_nx_niter_desc (void *);
extern void gt_pch_nx_hash_table_loop_exit_hasher_ (void *);
extern void gt_pch_nx_vec_basic_block_va_gc_ (void *);
extern void gt_pch_nx_rtl_bb_info (void *);
extern void gt_pch_nx_vec_edge_va_gc_ (void *);
extern void gt_pch_nx_vec_ipa_ref_t_va_gc_ (void *);
extern void gt_pch_nx_section_hash_entry (void *);
extern void gt_pch_nx_lto_file_decl_data (void *);
extern void gt_pch_nx_ipa_replace_map (void *);
extern void gt_pch_nx_vec_ipa_replace_map__va_gc_ (void *);
extern void gt_pch_nx_ipa_param_adjustments (void *);
extern void gt_pch_nx_vec_ipa_param_performed_split_va_gc_ (void *);
extern void gt_pch_nx_cgraph_simd_clone (void *);
extern void gt_pch_nx_cgraph_function_version_info (void *);
extern void gt_pch_nx_hash_table_cgraph_edge_hasher_ (void *);
extern void gt_pch_nx_cgraph_indirect_call_info (void *);
extern void gt_pch_nx_asm_node (void *);
extern void gt_pch_nx_symbol_table (void *);
extern void gt_pch_nx_hash_table_section_name_hasher_ (void *);
extern void gt_pch_nx_hash_table_asmname_hasher_ (void *);
extern void gt_pch_nx_hash_map_symtab_node__symbol_priority_map_ (void *);
extern void gt_pch_nx_constant_descriptor_tree (void *);
extern void gt_pch_nx_hash_map_alias_set_hash_int_ (void *);
extern void gt_pch_nx_alias_set_entry (void *);
extern void gt_pch_nx_vec_alias_set_entry__va_gc_ (void *);
extern void gt_pch_nx_hash_table_function_version_hasher_ (void *);
extern void gt_pch_nx_lto_in_decl_state (void *);
extern void gt_pch_nx_hash_table_ipa_bit_ggc_hash_traits_ (void *);
extern void gt_pch_nx_hash_table_ipa_vr_ggc_hash_traits_ (void *);
extern void gt_pch_nx_ipa_node_params (void *);
extern void gt_pch_nx_ipa_edge_args (void *);
extern void gt_pch_nx_ipa_agg_replacement_value (void *);
extern void gt_pch_nx_ipa_fn_summary (void *);
extern void gt_pch_nx_odr_type_d (void *);
extern void gt_pch_nx_vec_ipa_adjusted_param_va_gc_ (void *);
extern void gt_pch_nx_param_access (void *);
extern void gt_pch_nx_vec_param_access__va_gc_ (void *);
extern void gt_pch_nx_isra_func_summary (void *);
extern void gt_pch_nx_vec_isra_param_desc_va_gc_ (void *);
extern void gt_pch_nx_ipa_sra_function_summaries (void *);
extern void gt_pch_nx_typeinfo (void *);
extern void gt_pch_nx_dw_cfi_node (void *);
extern void gt_pch_nx_dw_loc_descr_node (void *);
extern void gt_pch_nx_dw_loc_list_struct (void *);
extern void gt_pch_nx_dw_discr_list_node (void *);
extern void gt_pch_nx_dw_cfa_location (void *);
extern void gt_pch_nx_vec_dw_cfi_ref_va_gc_ (void *);
extern void gt_pch_nx_addr_table_entry (void *);
extern void gt_pch_nx_indirect_string_node (void *);
extern void gt_pch_nx_dwarf_file_data (void *);
extern void gt_pch_nx_hash_map_char__tree_ (void *);
extern void gt_pch_nx_dw_cfi_row (void *);
extern void gt_pch_nx_reg_saved_in_data (void *);
extern void gt_pch_nx_vec_dw_fde_ref_va_gc_ (void *);
extern void gt_pch_nx_hash_table_indirect_string_hasher_ (void *);
extern void gt_pch_nx_comdat_type_node (void *);
extern void gt_pch_nx_vec_dw_line_info_entry_va_gc_ (void *);
extern void gt_pch_nx_dw_line_info_table (void *);
extern void gt_pch_nx_vec_dw_attr_node_va_gc_ (void *);
extern void gt_pch_nx_limbo_die_struct (void *);
extern void gt_pch_nx_hash_table_dwarf_file_hasher_ (void *);
extern void gt_pch_nx_hash_table_decl_die_hasher_ (void *);
extern void gt_pch_nx_vec_dw_die_ref_va_gc_ (void *);
extern void gt_pch_nx_variable_value_struct (void *);
extern void gt_pch_nx_hash_table_variable_value_hasher_ (void *);
extern void gt_pch_nx_hash_table_block_die_hasher_ (void *);
extern void gt_pch_nx_var_loc_node (void *);
extern void gt_pch_nx_var_loc_list_def (void *);
extern void gt_pch_nx_call_arg_loc_node (void *);
extern void gt_pch_nx_hash_table_decl_loc_hasher_ (void *);
extern void gt_pch_nx_cached_dw_loc_list_def (void *);
extern void gt_pch_nx_hash_table_dw_loc_list_hasher_ (void *);
extern void gt_pch_nx_vec_dw_line_info_table__va_gc_ (void *);
extern void gt_pch_nx_vec_pubname_entry_va_gc_ (void *);
extern void gt_pch_nx_vec_macinfo_entry_va_gc_ (void *);
extern void gt_pch_nx_vec_dw_ranges_va_gc_ (void *);
extern void gt_pch_nx_vec_dw_ranges_by_label_va_gc_ (void *);
extern void gt_pch_nx_vec_die_arg_entry_va_gc_ (void *);
extern void gt_pch_nx_hash_table_addr_hasher_ (void *);
extern void gt_pch_nx_hash_map_tree_sym_off_pair_ (void *);
extern void gt_pch_nx_inline_entry_data (void *);
extern void gt_pch_nx_hash_table_inline_entry_data_hasher_ (void *);
extern void gt_pch_nx_temp_slot (void *);
extern void gt_pch_nx_initial_value_struct (void *);
extern void gt_pch_nx_vec_temp_slot_p_va_gc_ (void *);
extern void gt_pch_nx_hash_table_const_int_hasher_ (void *);
extern void gt_pch_nx_hash_table_const_wide_int_hasher_ (void *);
extern void gt_pch_nx_hash_table_const_poly_int_hasher_ (void *);
extern void gt_pch_nx_hash_table_reg_attr_hasher_ (void *);
extern void gt_pch_nx_hash_table_const_double_hasher_ (void *);
extern void gt_pch_nx_hash_table_const_fixed_hasher_ (void *);
extern void gt_pch_nx_eh_region_d (void *);
extern void gt_pch_nx_eh_landing_pad_d (void *);
extern void gt_pch_nx_eh_catch_d (void *);
extern void gt_pch_nx_vec_eh_region_va_gc_ (void *);
extern void gt_pch_nx_vec_eh_landing_pad_va_gc_ (void *);
extern void gt_pch_nx_hash_map_gimple__int_ (void *);
extern void gt_pch_nx_hash_table_insn_cache_hasher_ (void *);
extern void gt_pch_nx_temp_slot_address_entry (void *);
extern void gt_pch_nx_hash_table_temp_address_hasher_ (void *);
extern void gt_pch_nx_hash_map_tree_hash_tree_ (void *);
extern void gt_pch_nx_test_struct (void *);
extern void gt_pch_nx_test_of_length (void *);
extern void gt_pch_nx_test_other (void *);
extern void gt_pch_nx_test_of_union (void *);
extern void gt_pch_nx_example_base (void *);
extern void gt_pch_nx_test_node (void *);
extern void gt_pch_nx_user_struct (void *);
extern void gt_pch_nx_hash_table_libfunc_decl_hasher_ (void *);
extern void gt_pch_nx_string_pool_data (void *);
extern void gt_pch_nx_type_hash (void *);
extern void gt_pch_nx_hash_table_type_cache_hasher_ (void *);
extern void gt_pch_nx_hash_table_int_cst_hasher_ (void *);
extern void gt_pch_nx_hash_table_poly_int_cst_hasher_ (void *);
extern void gt_pch_nx_hash_table_cl_option_hasher_ (void *);
extern void gt_pch_nx_hash_table_tree_decl_map_cache_hasher_ (void *);
extern void gt_pch_nx_hash_table_tree_vec_map_cache_hasher_ (void *);
extern void gt_pch_nx_hash_table_section_hasher_ (void *);
extern void gt_pch_nx_hash_table_object_block_hasher_ (void *);
extern void gt_pch_nx_hash_table_tree_descriptor_hasher_ (void *);
extern void gt_pch_nx_hash_table_const_rtx_desc_hasher_ (void *);
extern void gt_pch_nx_hash_table_tm_clone_hasher_ (void *);
extern void gt_pch_nx_tm_restart_node (void *);
extern void gt_pch_nx_hash_map_tree_tree_ (void *);
extern void gt_pch_nx_hash_table_ssa_name_hasher_ (void *);
extern void gt_pch_nx_hash_table_tm_restart_hasher_ (void *);
extern void gt_pch_nx_vec_mem_addr_template_va_gc_ (void *);
extern void gt_pch_nx_scev_info_str (void *);
extern void gt_pch_nx_hash_table_scev_info_hasher_ (void *);
extern void gt_pch_nx_ssa_operand_memory_d (void *);
extern void gt_pch_nx_vec_omp_declare_variant_entry_va_gc_ (void *);
extern void gt_pch_nx_omp_declare_variant_base_entry (void *);
extern void gt_pch_nx_hash_table_omp_declare_variant_hasher_ (void *);
extern void gt_pch_nx_hash_table_omp_declare_variant_alt_hasher_ (void *);
extern void gt_pch_nx_hash_table_dllimport_hasher_ (void *);
extern void gt_pch_nx_hash_map_char__unsigned_ (void *);
extern void gt_pch_nx_vec_gimple__va_gc_ (void *);
extern void gt_pch_nx_int_range_1_ (void *);
extern void gt_pch_nx_vec_ipa_agg_jf_item_va_gc_ (void *);
extern void gt_pch_nx_ipa_bits (void *);
extern void gt_pch_nx_vec_ipa_param_descriptor_va_gc_ (void *);
extern void gt_pch_nx_vec_ipa_bits__va_gc_ (void *);
extern void gt_pch_nx_vec_ipa_vr_va_gc_ (void *);
extern void gt_pch_nx_ipcp_transformation (void *);
extern void gt_pch_nx_vec_ipa_jump_func_va_gc_ (void *);
extern void gt_pch_nx_vec_ipa_polymorphic_call_context_va_gc_ (void *);
extern void gt_pch_nx_ipa_node_params_t (void *);
extern void gt_pch_nx_ipa_edge_args_sum_t (void *);
extern void gt_pch_nx_function_summary_ipcp_transformation__ (void *);
extern void gt_pch_nx_hash_table_tm_wrapper_hasher_ (void *);
extern void gt_pch_nx_hash_table_decl_state_hasher_ (void *);
extern void gt_pch_nx_vec_expr_eval_op_va_gc_ (void *);
extern void gt_pch_nx_vec_condition_va_gc_ (void *);
extern void gt_pch_nx_vec_size_time_entry_va_gc_ (void *);
extern void gt_pch_nx_fast_function_summary_ipa_fn_summary__va_gc_ (void *);
extern void gt_pch_nx_tree_type_map (void *);
extern void gt_pch_nx_hash_table_tree_type_map_cache_hasher_ (void *);
extern void gt_pch_nx_vec_odr_type_va_gc_ (void *);
extern void gt_pch_nx_hash_table_value_annotation_hasher_ (void *);
extern void gt_pch_nx_vec_Entity_Id_va_gc_atomic_ (void *);
extern void gt_pch_nx_tree_entity_vec_map (void *);
extern void gt_pch_nx_hash_table_dummy_type_hasher_ (void *);
extern void gt_pch_nx_parm_attr_d (void *);
extern void gt_pch_nx_vec_parm_attr_va_gc_ (void *);
extern void gt_pch_nx_stmt_group (void *);
extern void gt_pch_nx_elab_info (void *);
extern void gt_pch_nx_range_check_info_d (void *);
extern void gt_pch_nx_vec_range_check_info_va_gc_ (void *);
extern void gt_pch_nx_loop_info_d (void *);
extern void gt_pch_nx_vec_loop_info_va_gc_ (void *);
extern void gt_pch_nx_gnat_binding_level (void *);
extern void gt_pch_nx_packable_type_hash (void *);
extern void gt_pch_nx_hash_table_packable_type_hasher_ (void *);
extern void gt_pch_nx_pad_type_hash (void *);
extern void gt_pch_nx_hash_table_pad_type_hasher_ (void *);
extern void gt_pch_nx_c_label_vars (void *);
extern void gt_pch_nx_c_binding (void *);
extern void gt_pch_nx_c_scope (void *);
extern void gt_pch_nx_c_goto_bindings (void *);
extern void gt_pch_nx_vec_c_goto_bindings_p_va_gc_ (void *);
extern void gt_pch_nx_c_inline_static (void *);
extern void gt_pch_nx_sorted_fields_type (void *);
extern void gt_pch_nx_vec_const_char_p_va_gc_ (void *);
extern void gt_pch_nx_vec_tree_gc_vec_va_gc_ (void *);
extern void gt_pch_nx_align_stack (void *);
extern void gt_pch_nx_vec_pending_weak_va_gc_ (void *);
extern void gt_pch_nx_vec_pending_redefinition_va_gc_ (void *);
extern void gt_pch_nx_opt_stack (void *);
extern void gt_pch_nx_c_parser (void *);
extern void gt_pch_nx_vec_c_token_va_gc_ (void *);
extern void gt_pch_nx_binding_table_s (void *);
extern void gt_pch_nx_binding_entry_s (void *);
extern void gt_pch_nx_cxx_binding (void *);
extern void gt_pch_nx_cp_binding_level (void *);
extern void gt_pch_nx_vec_cp_class_binding_va_gc_ (void *);
extern void gt_pch_nx_cp_token_cache (void *);
extern void gt_pch_nx_vec_deferred_access_check_va_gc_ (void *);
extern void gt_pch_nx_vec_cxx_saved_binding_va_gc_ (void *);
extern void gt_pch_nx_saved_scope (void *);
extern void gt_pch_nx_cxx_int_tree_map (void *);
extern void gt_pch_nx_named_label_entry (void *);
extern void gt_pch_nx_hash_table_named_label_hash_ (void *);
extern void gt_pch_nx_hash_table_cxx_int_tree_map_hasher_ (void *);
extern void gt_pch_nx_tree_pair_s (void *);
extern void gt_pch_nx_vec_tree_pair_s_va_gc_ (void *);
extern void gt_pch_nx_hash_table_named_decl_hash_ (void *);
extern void gt_pch_nx_tinst_level (void *);
extern void gt_pch_nx_tree_check (void *);
extern void gt_pch_nx_vec_cp_token_va_gc_ (void *);
extern void gt_pch_nx_cp_lexer (void *);
extern void gt_pch_nx_vec_cp_default_arg_entry_va_gc_ (void *);
extern void gt_pch_nx_cp_parser_context (void *);
extern void gt_pch_nx_vec_cp_unparsed_functions_entry_va_gc_ (void *);
extern void gt_pch_nx_cp_parser (void *);
extern void gt_pch_nx_hash_map_tree_int_ (void *);
extern void gt_pch_nx_constexpr_fundef (void *);
extern void gt_pch_nx_hash_table_constexpr_fundef_hasher_ (void *);
extern void gt_pch_nx_constexpr_call (void *);
extern void gt_pch_nx_hash_table_constexpr_call_hasher_ (void *);
extern void gt_pch_nx_sat_entry (void *);
extern void gt_pch_nx_hash_table_sat_hasher_ (void *);
extern void gt_pch_nx_coroutine_info (void *);
extern void gt_pch_nx_hash_table_coroutine_info_hasher_ (void *);
extern void gt_pch_nx_source_location_table_entry (void *);
extern void gt_pch_nx_hash_table_source_location_table_entry_hash_ (void *);
extern void gt_pch_nx_named_label_use_entry (void *);
extern void gt_pch_nx_vec_incomplete_var_va_gc_ (void *);
extern void gt_pch_nx_hash_table_typename_hasher_ (void *);
extern void gt_pch_nx_hash_table_mangled_decl_hash_ (void *);
extern void gt_pch_nx_vec_pending_noexcept_va_gc_ (void *);
extern void gt_pch_nx_vec_tree_int_va_gc_ (void *);
extern void gt_pch_nx_hash_table_conv_type_hasher_ (void *);
extern void gt_pch_nx_subsumption_entry (void *);
extern void gt_pch_nx_hash_table_subsumption_hasher_ (void *);
extern void gt_pch_nx_pending_template (void *);
extern void gt_pch_nx_spec_entry (void *);
extern void gt_pch_nx_hash_table_spec_hasher_ (void *);
extern void gt_pch_nx_hash_map_tree_tree_pair_p_ (void *);
extern void gt_pch_nx_vec_tinfo_s_va_gc_ (void *);
extern void gt_pch_nx_vec_deferred_access_va_gc_ (void *);
extern void gt_pch_nx_hash_table_cplus_array_hasher_ (void *);
extern void gt_pch_nx_hash_table_list_hasher_ (void *);
extern void gt_pch_nx_pending_abstract_type (void *);
extern void gt_pch_nx_hash_table_abstract_type_hasher_ (void *);
extern void gt_pch_nx_Statement (void *);
extern void gt_pch_nx_binding_level (void *);
extern void gt_pch_nx_d_label_use_entry (void *);
extern void gt_pch_nx_hash_map_Statement__d_label_entry_ (void *);
extern void gt_pch_nx_hash_table_module_hasher_ (void *);
extern void gt_pch_nx_module_htab_entry (void *);
extern void gt_pch_nx_hash_table_module_decl_hasher_ (void *);
extern void gt_pch_nx_objc_map_private (void *);
extern void gt_pch_nx_hashed_entry (void *);
extern void gt_pch_nx_hashed_attribute (void *);
extern void gt_pch_nx_imp_entry (void *);
extern void gt_pch_nx_string_descriptor (void *);
extern void gt_pch_nx_hash_table_objc_string_hasher_ (void *);
extern void gt_pch_nx_vec_ident_data_tuple_va_gc_ (void *);
extern void gt_pch_nx_vec_msgref_entry_va_gc_ (void *);
extern void gt_pch_nx_vec_prot_list_entry_va_gc_ (void *);
extern void gt_pch_nx_vec_ivarref_entry_va_gc_ (void *);
extern void gt_pch_p_9line_maps
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9cpp_token
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9cpp_macro
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13string_concat
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16string_concat_db
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38hash_map_location_hash_string_concat__
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11bitmap_head
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7rtx_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9rtvec_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11symtab_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11symtab_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11symtab_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11cgraph_edge
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7section
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16cl_target_option
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15cl_optimization
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8edge_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15basic_block_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17stack_local_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16machine_function
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14bitmap_element
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_34generic_wide_int_wide_int_storage_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13coverage_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9mem_attrs
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9reg_attrs
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12object_block
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14vec_rtx_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10real_value
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11fixed_value
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23constant_descriptor_rtx
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8function
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10target_rtl
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15cgraph_rtl_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_42hash_map_tree_tree_decl_tree_cache_traits_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_42hash_map_tree_tree_type_tree_cache_traits_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12ptr_info_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14range_info_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10die_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_constructor_elt_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15vec_tree_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9lang_type
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9lang_decl
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24tree_statement_list_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14target_globals
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14lang_tree_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8tree_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13tree_decl_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12tree_int_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12tree_vec_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21vec_alias_pair_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13libfunc_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26hash_table_libfunc_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15target_libfuncs
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14sequence_stack
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_rtx_insn__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18call_site_record_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16vec_uchar_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_call_site_record_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9gimple_df
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11dw_fde_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17rtx_constant_pool
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11frame_space
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_callinfo_callee_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_callinfo_dalloc_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11stack_usage
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9eh_status
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18control_flow_graph
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_5loops
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17language_function
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14hash_set_tree_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24types_used_by_vars_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_used_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13nb_iter_bound
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9loop_exit
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_4loop
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10control_iv
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17vec_loop_p_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10niter_desc
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_loop_exit_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22vec_basic_block_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11rtl_bb_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15vec_edge_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_ipa_ref_t_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18section_hash_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18lto_file_decl_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15ipa_replace_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_ipa_replace_map__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21ipa_param_adjustments
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_36vec_ipa_param_performed_split_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17cgraph_simd_clone
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28cgraph_function_version_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_cgraph_edge_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_25cgraph_indirect_call_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8asm_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12symbol_table
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_section_name_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26hash_table_asmname_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_42hash_map_symtab_node__symbol_priority_map_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24constant_descriptor_tree
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_map_alias_set_hash_int_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15alias_set_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_alias_set_entry__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_35hash_table_function_version_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17lto_in_decl_state
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_35hash_table_ipa_bit_ggc_hash_traits_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_34hash_table_ipa_vr_ggc_hash_traits_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15ipa_node_params
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13ipa_edge_args
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_25ipa_agg_replacement_value
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14ipa_fn_summary
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10odr_type_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29vec_ipa_adjusted_param_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12param_access
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_param_access__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17isra_func_summary
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_isra_param_desc_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26ipa_sra_function_summaries
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8typeinfo
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11dw_cfi_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17dw_loc_descr_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18dw_loc_list_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18dw_discr_list_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15dw_cfa_location
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21vec_dw_cfi_ref_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16addr_table_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20indirect_string_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15dwarf_file_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20hash_map_char__tree_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10dw_cfi_row
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17reg_saved_in_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21vec_dw_fde_ref_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_34hash_table_indirect_string_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16comdat_type_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29vec_dw_line_info_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18dw_line_info_table
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23vec_dw_attr_node_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16limbo_die_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_dwarf_file_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_decl_die_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21vec_dw_die_ref_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21variable_value_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_variable_value_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_block_die_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12var_loc_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16var_loc_list_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17call_arg_loc_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_decl_loc_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22cached_dw_loc_list_def
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_dw_loc_list_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30vec_dw_line_info_table__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_pubname_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_macinfo_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_dw_ranges_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29vec_dw_ranges_by_label_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_die_arg_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23hash_table_addr_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_map_tree_sym_off_pair_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17inline_entry_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_36hash_table_inline_entry_data_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9temp_slot
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20initial_value_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22vec_temp_slot_p_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_const_int_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_const_wide_int_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_const_poly_int_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_reg_attr_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_const_double_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_const_fixed_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11eh_region_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16eh_landing_pad_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10eh_catch_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_eh_region_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_25vec_eh_landing_pad_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21hash_map_gimple__int_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_insn_cache_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23temp_slot_address_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_temp_address_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24hash_map_tree_hash_tree_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11test_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14test_of_length
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10test_other
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13test_of_union
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12example_base
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12example_base
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12example_base
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9test_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11user_struct
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_libfunc_decl_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16string_pool_data
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9type_hash
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_type_cache_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26hash_table_int_cst_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_poly_int_cst_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_cl_option_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38hash_table_tree_decl_map_cache_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_37hash_table_tree_vec_map_cache_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26hash_table_section_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31hash_table_object_block_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_34hash_table_tree_descriptor_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_const_rtx_desc_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_tm_clone_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_6gimple
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15tm_restart_node
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19hash_map_tree_tree_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_ssa_name_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_tm_restart_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28vec_mem_addr_template_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13scev_info_str
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_scev_info_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20ssa_operand_memory_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_36vec_omp_declare_variant_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30omp_declare_variant_base_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38hash_table_omp_declare_variant_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_42hash_table_omp_declare_variant_alt_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_dllimport_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24hash_map_char__unsigned_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18vec_gimple__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12int_range_1_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_ipa_agg_jf_item_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8ipa_bits
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31vec_ipa_param_descriptor_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_ipa_bits__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17vec_ipa_vr_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19ipcp_transformation
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_ipa_jump_func_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_39vec_ipa_polymorphic_call_context_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17ipa_node_params_t
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19ipa_edge_args_sum_t
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38function_summary_ipcp_transformation__
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_tm_wrapper_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_decl_state_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23vec_expr_eval_op_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_condition_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_size_time_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_44fast_function_summary_ipa_fn_summary__va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13tree_type_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38hash_table_tree_type_map_cache_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19vec_odr_type_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_35hash_table_value_annotation_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_Entity_Id_va_gc_atomic_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19tree_entity_vec_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_dummy_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11parm_attr_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_parm_attr_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10stmt_group
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9elab_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18range_check_info_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_range_check_info_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11loop_info_d
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_20vec_loop_info_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18gnat_binding_level
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18packable_type_hash
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_32hash_table_packable_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13pad_type_hash
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_pad_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12c_label_vars
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9c_binding
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_7c_scope
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15c_goto_bindings
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28vec_c_goto_bindings_p_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15c_inline_static
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18sorted_fields_type
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23vec_const_char_p_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22vec_tree_gc_vec_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11align_stack
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23vec_pending_weak_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31vec_pending_redefinition_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9opt_stack
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8c_parser
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18vec_c_token_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15binding_table_s
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_15binding_entry_s
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11cxx_binding
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16cp_binding_level
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_cp_class_binding_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14cp_token_cache
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_32vec_deferred_access_check_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28vec_cxx_saved_binding_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11saved_scope
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16cxx_int_tree_map
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17named_label_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_named_label_hash_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_35hash_table_cxx_int_tree_map_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11tree_pair_s
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22vec_tree_pair_s_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_named_decl_hash_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_11tinst_level
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10tree_check
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19vec_cp_token_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_8cp_lexer
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_31vec_cp_default_arg_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17cp_parser_context
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_38vec_cp_unparsed_functions_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9cp_parser
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18hash_map_tree_int_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16constexpr_fundef
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_35hash_table_constexpr_fundef_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14constexpr_call
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_constexpr_call_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9sat_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_22hash_table_sat_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_14coroutine_info
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_33hash_table_coroutine_info_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27source_location_table_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_44hash_table_source_location_table_entry_hash_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21named_label_use_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_25vec_incomplete_var_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27hash_table_typename_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_29hash_table_mangled_decl_hash_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_pending_noexcept_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_19vec_tree_int_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_28hash_table_conv_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17subsumption_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_subsumption_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16pending_template
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_10spec_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23hash_table_spec_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26hash_map_tree_tree_pair_p_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_18vec_tinfo_s_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_deferred_access_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_cplus_array_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23hash_table_list_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_21pending_abstract_type
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_32hash_table_abstract_type_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9Statement
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_13binding_level
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17d_label_use_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_34hash_map_Statement__d_label_entry_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_25hash_table_module_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17module_htab_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_module_decl_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16objc_map_private
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_12hashed_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_16hashed_attribute
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_9imp_entry
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_17string_descriptor
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_30hash_table_objc_string_hasher_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_27vec_ident_data_tuple_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_23vec_msgref_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_26vec_prot_list_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
extern void gt_pch_p_24vec_ivarref_entry_va_gc_
(void *, void *, gt_pointer_operator, void *);
# 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" 2
typedef void (*gt_note_pointers) (void *, void *, gt_pointer_operator,
void *);
typedef void (*gt_handle_reorder) (void *, void *, gt_pointer_operator,
void *);
extern int gt_pch_note_object (void *, void *, gt_note_pointers);
extern void gt_pch_note_reorder (void *, void *, gt_handle_reorder);
extern void gt_clear_caches ();
typedef void (*gt_pointer_walker) (void *);
struct ggc_root_tab {
void *base;
size_t nelt;
size_t stride;
gt_pointer_walker cb;
gt_pointer_walker pchw;
};
extern const struct ggc_root_tab * const gt_ggc_rtab[];
extern const struct ggc_root_tab * const gt_ggc_deletable_rtab[];
extern const struct ggc_root_tab * const gt_pch_scalar_rtab[];
# 91 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h"
extern int ggc_set_mark (const void *);
extern int ggc_marked_p (const void *);
extern void gt_pch_n_S (const void *);
extern void gt_ggc_m_S (const void *);
extern void init_stringpool (void);
extern void init_ggc (void);
extern bool ggc_protect_identifiers;
extern void gt_pch_save (FILE *f);
extern void *ggc_internal_alloc (size_t, void (*)(void *), size_t,
size_t )
__attribute__ ((__malloc__));
inline void *
ggc_internal_alloc (size_t s )
{
return ggc_internal_alloc (s, nullptr, 0, 1 );
}
extern size_t ggc_round_alloc_size (size_t requested_size);
extern void *ggc_internal_cleared_alloc (size_t, void (*)(void *),
size_t, size_t
) __attribute__ ((__malloc__));
inline void *
ggc_internal_cleared_alloc (size_t s )
{
return ggc_internal_cleared_alloc (s, nullptr, 0, 1 );
}
extern void *ggc_realloc (void *, size_t );
extern void ggc_free (void *);
extern void dump_ggc_loc_statistics ();
template<typename T>
void
finalize (void *p)
{
static_cast<T *> (p)->~T ();
}
template<typename T>
inline bool
need_finalization_p ()
{
return !__has_trivial_destructor (T);
}
template<typename T>
inline T *
ggc_alloc ()
{
if (need_finalization_p<T> ())
return static_cast<T *> (ggc_internal_alloc (sizeof (T), finalize<T>, 0, 1
));
else
return static_cast<T *> (ggc_internal_alloc (sizeof (T), nullptr, 0, 1
));
}
template<typename T>
inline T *
ggc_alloc_no_dtor ()
{
return static_cast<T *> (ggc_internal_alloc (sizeof (T), nullptr, 0, 1
));
}
template<typename T>
inline T *
ggc_cleared_alloc ()
{
if (need_finalization_p<T> ())
return static_cast<T *> (ggc_internal_cleared_alloc (sizeof (T),
finalize<T>, 0, 1
));
else
return static_cast<T *> (ggc_internal_cleared_alloc (sizeof (T), nullptr, 0, 1
));
}
template<typename T>
inline T *
ggc_vec_alloc (size_t c )
{
if (need_finalization_p<T> ())
return static_cast<T *> (ggc_internal_alloc (c * sizeof (T), finalize<T>,
sizeof (T), c ));
else
return static_cast<T *> (ggc_internal_alloc (c * sizeof (T), nullptr, 0, 0
));
}
template<typename T>
inline T *
ggc_cleared_vec_alloc (size_t c )
{
if (need_finalization_p<T> ())
return static_cast<T *> (ggc_internal_cleared_alloc (c * sizeof (T),
finalize<T>,
sizeof (T), c
));
else
return static_cast<T *> (ggc_internal_cleared_alloc (c * sizeof (T), nullptr,
0, 0 ));
}
inline void *
ggc_alloc_atomic (size_t s )
{
return ggc_internal_alloc (s );
}
template <typename T>
inline void
ggc_delete (T *ptr)
{
ptr->~T ();
ggc_free (ptr);
}
extern const char *ggc_alloc_string (const char *contents, int length
);
extern void ggc_collect (void);
extern void ggc_trim (void);
extern void ggc_grow (void);
extern void ggc_register_root_tab (const struct ggc_root_tab *);
extern void gt_pch_restore (FILE *f);
extern void ggc_print_statistics (void);
extern void stringpool_statistics (void);
extern void init_ggc_heuristics (void);
extern void report_heap_memory_use (void);
inline struct rtx_def *
ggc_alloc_rtx_def_stat (size_t s )
{
return (struct rtx_def *) ggc_internal_alloc (s );
}
inline union tree_node *
ggc_alloc_tree_node_stat (size_t s )
{
return (union tree_node *) ggc_internal_alloc (s );
}
inline union tree_node *
ggc_alloc_cleared_tree_node_stat (size_t s )
{
return (union tree_node *) ggc_internal_cleared_alloc (s );
}
inline gimple *
ggc_alloc_cleared_gimple_statement_stat (size_t s )
{
return (gimple *) ggc_internal_cleared_alloc (s );
}
inline void
gt_ggc_mx (const char *s)
{
((const_cast<char *> (s)) != nullptr && ((void *) (const_cast<char *> (s))) != (void *) 1 && ! ggc_set_mark (const_cast<char *> (s)));
}
inline void
gt_pch_nx (const char *)
{
}
inline void
gt_ggc_mx (int)
{
}
inline void
gt_pch_nx (int)
{
}
inline void
gt_pch_nx (unsigned int)
{
}
# 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 1
# 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
extern void ggc_free (void *);
extern size_t ggc_round_alloc_size (size_t requested_size);
extern void *ggc_realloc (void *, size_t );
# 183 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
extern void dump_vec_loc_statistics (void);
extern htab_t vec_mem_usage_hash;
struct vec_prefix
{
void register_overhead (void *, size_t, size_t );
void release_overhead (void *, size_t, size_t, bool );
static unsigned calculate_allocation (vec_prefix *, unsigned, bool);
static unsigned calculate_allocation_1 (unsigned, unsigned);
template <typename, typename, typename> friend struct vec;
friend struct va_gc;
friend struct va_gc_atomic;
friend struct va_heap;
unsigned m_alloc : 31;
unsigned m_using_auto_storage : 1;
unsigned m_num;
};
inline unsigned
vec_prefix::calculate_allocation (vec_prefix *pfx, unsigned reserve,
bool exact)
{
if (exact)
return (pfx ? pfx->m_num : 0) + reserve;
else if (!pfx)
return ((4) > (reserve) ? (4) : (reserve));
return calculate_allocation_1 (pfx->m_alloc, pfx->m_num + reserve);
}
template<typename, typename, typename> struct vec;
struct vl_embed { };
struct vl_ptr { };
# 254 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
struct va_heap
{
typedef vl_ptr default_layout;
template<typename T>
static void reserve (vec<T, va_heap, vl_embed> *&, unsigned, bool
);
template<typename T>
static void release (vec<T, va_heap, vl_embed> *&);
};
template<typename T>
inline void
va_heap::reserve (vec<T, va_heap, vl_embed> *&v, unsigned reserve, bool exact
)
{
size_t elt_size = sizeof (T);
unsigned alloc
= vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact);
((void)(!(alloc) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 282, __FUNCTION__), 0 : 0));
if (0 && v)
v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
v->allocated (), false);
size_t size = vec<T, va_heap, vl_embed>::embedded_size (alloc);
unsigned nelem = v ? v->length () : 0;
v = static_cast <vec<T, va_heap, vl_embed> *> (xrealloc (v, size));
v->embedded_init (alloc, nelem);
if (0)
v->m_vecpfx.register_overhead (v, alloc, elt_size );
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
template<typename T>
void
va_heap::release (vec<T, va_heap, vl_embed> *&v)
{
size_t elt_size = sizeof (T);
if (v == nullptr)
return;
if (0)
v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
v->allocated (), true);
::free (v);
v = nullptr;
}
#pragma GCC diagnostic pop
struct va_gc
{
typedef vl_embed default_layout;
template<typename T, typename A>
static void reserve (vec<T, A, vl_embed> *&, unsigned, bool
);
template<typename T, typename A>
static void release (vec<T, A, vl_embed> *&v);
};
template<typename T, typename A>
inline void
va_gc::release (vec<T, A, vl_embed> *&v)
{
if (v)
::ggc_free (v);
v = nullptr;
}
template<typename T, typename A>
void
va_gc::reserve (vec<T, A, vl_embed> *&v, unsigned reserve, bool exact
)
{
unsigned alloc
= vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact);
if (!alloc)
{
::ggc_free (v);
v = nullptr;
return;
}
size_t size = vec<T, A, vl_embed>::embedded_size (alloc);
size = ::ggc_round_alloc_size (size);
size_t vec_offset = sizeof (vec_prefix);
size_t elt_size = sizeof (T);
alloc = (size - vec_offset) / elt_size;
size = vec_offset + alloc * elt_size;
unsigned nelem = v ? v->length () : 0;
v = static_cast <vec<T, A, vl_embed> *> (::ggc_realloc (v, size
));
v->embedded_init (alloc, nelem);
}
struct va_gc_atomic : va_gc
{
};
# 415 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T,
typename A = va_heap,
typename L = typename A::default_layout>
struct vec
{
};
# 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T>
void
debug_helper (vec<T> &ref)
{
unsigned i;
for (i = 0; i < ref.length (); ++i)
{
fprintf (
# 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
stderr
# 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
, "[%d] = ", i);
debug_slim (ref[i]);
fputc ('\n',
# 442 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
stderr
# 442 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
);
}
}
template<typename T>
void
debug_helper (vec<T, va_gc> &ref)
{
unsigned i;
for (i = 0; i < ref.length (); ++i)
{
fprintf (
# 458 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
stderr
# 458 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
, "[%d] = ", i);
debug_slim (ref[i]);
fputc ('\n',
# 460 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
stderr
# 460 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
);
}
}
# 501 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template <typename T>
inline void
vec_default_construct (T *dst, unsigned n)
{
# 520 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
for ( ; n; ++dst, --n)
::new (static_cast<void*>(dst)) T ();
}
template <typename T>
inline void
vec_copy_construct (T *dst, const T *src, unsigned n)
{
for ( ; n; ++dst, ++src, --n)
::new (static_cast<void*>(dst)) T (*src);
}
struct vnull
{
template <typename T, typename A, typename L>
constexpr operator vec<T, A, L> () { return vec<T, A, L>(); }
};
extern vnull vNULL;
# 574 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
struct vec<T, A, vl_embed>
{
public:
unsigned allocated (void) const { return m_vecpfx.m_alloc; }
unsigned length (void) const { return m_vecpfx.m_num; }
bool is_empty (void) const { return m_vecpfx.m_num == 0; }
T *address (void) { return m_vecdata; }
const T *address (void) const { return m_vecdata; }
T *begin () { return address (); }
const T *begin () const { return address (); }
T *end () { return address () + length (); }
const T *end () const { return address () + length (); }
const T &operator[] (unsigned) const;
T &operator[] (unsigned);
T &last (void);
bool space (unsigned) const;
bool iterate (unsigned, T *) const;
bool iterate (unsigned, T **) const;
vec *copy () const;
void splice (const vec &);
void splice (const vec *src);
T *quick_push (const T &);
T &pop (void);
void truncate (unsigned);
void quick_insert (unsigned, const T &);
void ordered_remove (unsigned);
void unordered_remove (unsigned);
void block_remove (unsigned, unsigned);
void qsort (int (*) (const void *, const void *));
void sort (int (*) (const void *, const void *, void *), void *);
T *bsearch (const void *key, int (*compar)(const void *, const void *));
T *bsearch (const void *key,
int (*compar)(const void *, const void *, void *), void *);
unsigned lower_bound (T, bool (*)(const T &, const T &)) const;
bool contains (const T &search) const;
static size_t embedded_size (unsigned);
void embedded_init (unsigned, unsigned = 0, unsigned = 0);
void quick_grow (unsigned len);
void quick_grow_cleared (unsigned len);
template <typename, typename, typename> friend struct vec;
friend struct va_gc;
friend struct va_gc_atomic;
friend struct va_heap;
vec_prefix m_vecpfx;
T m_vecdata[1];
};
# 645 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline bool
vec_safe_space (const vec<T, A, vl_embed> *v, unsigned nelems)
{
return v ? v->space (nelems) : nelems == 0;
}
template<typename T, typename A>
inline unsigned
vec_safe_length (const vec<T, A, vl_embed> *v)
{
return v ? v->length () : 0;
}
template<typename T, typename A>
inline T *
vec_safe_address (vec<T, A, vl_embed> *v)
{
return v ? v->address () : nullptr;
}
template<typename T, typename A>
inline bool
vec_safe_is_empty (vec<T, A, vl_embed> *v)
{
return v ? v->is_empty () : true;
}
template<typename T, typename A>
inline bool
vec_safe_reserve (vec<T, A, vl_embed> *&v, unsigned nelems, bool exact = false
)
{
bool extend = nelems ? !vec_safe_space (v, nelems) : false;
if (extend)
A::reserve (v, nelems, exact );
return extend;
}
template<typename T, typename A>
inline bool
vec_safe_reserve_exact (vec<T, A, vl_embed> *&v, unsigned nelems
)
{
return vec_safe_reserve (v, nelems, true );
}
template<typename T, typename A>
inline void
vec_alloc (vec<T, A, vl_embed> *&v, unsigned nelems )
{
v = nullptr;
vec_safe_reserve (v, nelems, false );
}
template<typename T, typename A>
inline void
vec_free (vec<T, A, vl_embed> *&v)
{
A::release (v);
}
template<typename T, typename A>
inline void
vec_safe_grow (vec<T, A, vl_embed> *&v, unsigned len )
{
unsigned oldlen = vec_safe_length (v);
((void)(!(len >= oldlen) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 729, __FUNCTION__), 0 : 0));
vec_safe_reserve_exact (v, len - oldlen );
v->quick_grow (len);
}
template<typename T, typename A>
inline void
vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len )
{
unsigned oldlen = vec_safe_length (v);
vec_safe_grow (v, len );
vec_default_construct (v->address () + oldlen, len - oldlen);
}
template<typename T>
inline void
vec_safe_grow_cleared (vec<T, va_heap, vl_ptr> *&v,
unsigned len )
{
v->safe_grow_cleared (len );
}
template<typename T>
inline bool
vec_safe_reserve (vec<T, va_heap, vl_ptr> *&v, unsigned nelems, bool exact = false
)
{
return v->reserve (nelems, exact);
}
template<typename T, typename A>
inline bool
vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T **ptr)
{
if (v)
return v->iterate (ix, ptr);
else
{
*ptr = 0;
return false;
}
}
template<typename T, typename A>
inline bool
vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T *ptr)
{
if (v)
return v->iterate (ix, ptr);
else
{
*ptr = 0;
return false;
}
}
template<typename T, typename A>
inline T *
vec_safe_push (vec<T, A, vl_embed> *&v, const T &obj )
{
vec_safe_reserve (v, 1, false );
return v->quick_push (obj);
}
template<typename T, typename A>
inline void
vec_safe_insert (vec<T, A, vl_embed> *&v, unsigned ix, const T &obj
)
{
vec_safe_reserve (v, 1, false );
v->quick_insert (ix, obj);
}
template<typename T, typename A>
inline void
vec_safe_truncate (vec<T, A, vl_embed> *v, unsigned size)
{
if (v)
v->truncate (size);
}
template<typename T, typename A>
inline vec<T, A, vl_embed> *
vec_safe_copy (vec<T, A, vl_embed> *src )
{
return src ? src->copy () : nullptr;
}
template<typename T, typename A>
inline void
vec_safe_splice (vec<T, A, vl_embed> *&dst, const vec<T, A, vl_embed> *src
)
{
unsigned src_len = vec_safe_length (src);
if (src_len)
{
vec_safe_reserve_exact (dst, vec_safe_length (dst) + src_len
);
dst->splice (*src);
}
}
template<typename T, typename A>
inline bool
vec_safe_contains (vec<T, A, vl_embed> *v, const T &search)
{
return v ? v->contains (search) : false;
}
template<typename T, typename A>
inline const T &
vec<T, A, vl_embed>::operator[] (unsigned ix) const
{
((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 870, __FUNCTION__), 0 : 0));
return m_vecdata[ix];
}
template<typename T, typename A>
inline T &
vec<T, A, vl_embed>::operator[] (unsigned ix)
{
((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 878, __FUNCTION__), 0 : 0));
return m_vecdata[ix];
}
template<typename T, typename A>
inline T &
vec<T, A, vl_embed>::last (void)
{
((void)(!(m_vecpfx.m_num > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 889, __FUNCTION__), 0 : 0));
return (*this)[m_vecpfx.m_num - 1];
}
# 900 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline bool
vec<T, A, vl_embed>::space (unsigned nelems) const
{
return m_vecpfx.m_alloc - m_vecpfx.m_num >= nelems;
}
# 915 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline bool
vec<T, A, vl_embed>::iterate (unsigned ix, T *ptr) const
{
if (ix < m_vecpfx.m_num)
{
*ptr = m_vecdata[ix];
return true;
}
else
{
*ptr = 0;
return false;
}
}
# 941 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline bool
vec<T, A, vl_embed>::iterate (unsigned ix, T **ptr) const
{
if (ix < m_vecpfx.m_num)
{
*ptr = (const_cast<T *> ((&m_vecdata[ix])));
return true;
}
else
{
*ptr = 0;
return false;
}
}
template<typename T, typename A>
inline vec<T, A, vl_embed> *
vec<T, A, vl_embed>::copy (void) const
{
vec<T, A, vl_embed> *new_vec = nullptr;
unsigned len = length ();
if (len)
{
vec_alloc (new_vec, len );
new_vec->embedded_init (len, len);
vec_copy_construct (new_vec->address (), m_vecdata, len);
}
return new_vec;
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> &src)
{
unsigned len = src.length ();
if (len)
{
((void)(!(space (len)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 986, __FUNCTION__), 0 : 0));
vec_copy_construct (end (), src.address (), len);
m_vecpfx.m_num += len;
}
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> *src)
{
if (src)
splice (*src);
}
template<typename T, typename A>
inline T *
vec<T, A, vl_embed>::quick_push (const T &obj)
{
((void)(!(space (1)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1009, __FUNCTION__), 0 : 0));
T *slot = &m_vecdata[m_vecpfx.m_num++];
*slot = obj;
return slot;
}
template<typename T, typename A>
inline T &
vec<T, A, vl_embed>::pop (void)
{
((void)(!(length () > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1022, __FUNCTION__), 0 : 0));
return m_vecdata[--m_vecpfx.m_num];
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::truncate (unsigned size)
{
((void)(!(length () >= size) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1034, __FUNCTION__), 0 : 0));
m_vecpfx.m_num = size;
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::quick_insert (unsigned ix, const T &obj)
{
((void)(!(length () < allocated ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1046, __FUNCTION__), 0 : 0));
((void)(!(ix <= length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1047, __FUNCTION__), 0 : 0));
T *slot = &m_vecdata[ix];
memmove (slot + 1, slot, (m_vecpfx.m_num++ - ix) * sizeof (T));
*slot = obj;
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::ordered_remove (unsigned ix)
{
((void)(!(ix < length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1062, __FUNCTION__), 0 : 0));
T *slot = &m_vecdata[ix];
memmove (slot, slot + 1, (--m_vecpfx.m_num - ix) * sizeof (T));
}
# 1105 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::unordered_remove (unsigned ix)
{
((void)(!(ix < length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1109, __FUNCTION__), 0 : 0));
m_vecdata[ix] = m_vecdata[--m_vecpfx.m_num];
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::block_remove (unsigned ix, unsigned len)
{
((void)(!(ix + len <= length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1121, __FUNCTION__), 0 : 0));
T *slot = &m_vecdata[ix];
m_vecpfx.m_num -= len;
memmove (slot, slot + len, (m_vecpfx.m_num - ix) * sizeof (T));
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::qsort (int (*cmp) (const void *, const void *))
{
if (length () > 1)
gcc_qsort (address (), length (), sizeof (T), cmp);
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::sort (int (*cmp) (const void *, const void *, void *),
void *data)
{
if (length () > 1)
gcc_sort_r (address (), length (), sizeof (T), cmp, data);
}
template<typename T, typename A>
inline T *
vec<T, A, vl_embed>::bsearch (const void *key,
int (*compar) (const void *, const void *))
{
const void *base = this->address ();
size_t nmemb = this->length ();
size_t size = sizeof (T);
size_t l, u, idx;
const void *p;
int comparison;
l = 0;
u = nmemb;
while (l < u)
{
idx = (l + u) / 2;
p = (const void *) (((const char *) base) + (idx * size));
comparison = (*compar) (key, p);
if (comparison < 0)
u = idx;
else if (comparison > 0)
l = idx + 1;
else
return (T *)const_cast<void *>(p);
}
return nullptr;
}
template<typename T, typename A>
inline T *
vec<T, A, vl_embed>::bsearch (const void *key,
int (*compar) (const void *, const void *,
void *), void *data)
{
const void *base = this->address ();
size_t nmemb = this->length ();
size_t size = sizeof (T);
size_t l, u, idx;
const void *p;
int comparison;
l = 0;
u = nmemb;
while (l < u)
{
idx = (l + u) / 2;
p = (const void *) (((const char *) base) + (idx * size));
comparison = (*compar) (key, p, data);
if (comparison < 0)
u = idx;
else if (comparison > 0)
l = idx + 1;
else
return (T *)const_cast<void *>(p);
}
return nullptr;
}
template<typename T, typename A>
inline bool
vec<T, A, vl_embed>::contains (const T &search) const
{
unsigned int len = length ();
for (unsigned int i = 0; i < len; i++)
if ((*this)[i] == search)
return true;
return false;
}
template<typename T, typename A>
unsigned
vec<T, A, vl_embed>::lower_bound (T obj, bool (*lessthan)(const T &, const T &))
const
{
unsigned int len = length ();
unsigned int half, middle;
unsigned int first = 0;
while (len > 0)
{
half = len / 2;
middle = first;
middle += half;
T middle_elem = (*this)[middle];
if (lessthan (middle_elem, obj))
{
first = middle;
++first;
len = len - half - 1;
}
else
len = half;
}
return first;
}
# 1280 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, typename A>
inline size_t
vec<T, A, vl_embed>::embedded_size (unsigned alloc)
{
struct alignas (T) U { char data[sizeof (T)]; };
typedef vec<U, A, vl_embed> vec_embedded;
typedef typename std::conditional<std::is_standard_layout<T>::value,
vec, vec_embedded>::type vec_stdlayout;
static_assert (sizeof (vec_stdlayout) == sizeof (vec), "");
static_assert (alignof (vec_stdlayout) == alignof (vec), "");
return
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
__builtin_offsetof (
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
vec_stdlayout
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
,
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
m_vecdata
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4
)
# 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
+ alloc * sizeof (T);
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::embedded_init (unsigned alloc, unsigned num, unsigned aut)
{
m_vecpfx.m_alloc = alloc;
m_vecpfx.m_using_auto_storage = aut;
m_vecpfx.m_num = num;
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::quick_grow (unsigned len)
{
((void)(!(length () <= len && len <= m_vecpfx.m_alloc) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1314, __FUNCTION__), 0 : 0));
m_vecpfx.m_num = len;
}
template<typename T, typename A>
inline void
vec<T, A, vl_embed>::quick_grow_cleared (unsigned len)
{
unsigned oldlen = length ();
size_t growby = len - oldlen;
quick_grow (len);
if (growby != 0)
vec_default_construct (address () + oldlen, growby);
}
template<typename T>
void
gt_ggc_mx (vec<T, va_gc> *v)
{
extern void gt_ggc_mx (T &);
for (unsigned i = 0; i < v->length (); i++)
gt_ggc_mx ((*v)[i]);
}
template<typename T>
void
gt_ggc_mx (vec<T, va_gc_atomic, vl_embed> *v __attribute__ ((__unused__)))
{
}
template<typename T, typename A>
void
gt_pch_nx (vec<T, A, vl_embed> *v)
{
extern void gt_pch_nx (T &);
for (unsigned i = 0; i < v->length (); i++)
gt_pch_nx ((*v)[i]);
}
template<typename T, typename A>
void
gt_pch_nx (vec<T *, A, vl_embed> *v, gt_pointer_operator op, void *cookie)
{
for (unsigned i = 0; i < v->length (); i++)
op (&((*v)[i]), cookie);
}
template<typename T, typename A>
void
gt_pch_nx (vec<T, A, vl_embed> *v, gt_pointer_operator op, void *cookie)
{
extern void gt_pch_nx (T *, gt_pointer_operator, void *);
for (unsigned i = 0; i < v->length (); i++)
gt_pch_nx (&((*v)[i]), op, cookie);
}
# 1410 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T>
struct vec<T, va_heap, vl_ptr>
{
public:
void create (unsigned nelems );
void release (void);
bool exists (void) const
{ return m_vec != nullptr; }
bool is_empty (void) const
{ return m_vec ? m_vec->is_empty () : true; }
unsigned length (void) const
{ return m_vec ? m_vec->length () : 0; }
T *address (void)
{ return m_vec ? m_vec->m_vecdata : nullptr; }
const T *address (void) const
{ return m_vec ? m_vec->m_vecdata : nullptr; }
T *begin () { return address (); }
const T *begin () const { return address (); }
T *end () { return begin () + length (); }
const T *end () const { return begin () + length (); }
const T &operator[] (unsigned ix) const
{ return (*m_vec)[ix]; }
bool operator!=(const vec &other) const
{ return !(*this == other); }
bool operator==(const vec &other) const
{ return address () == other.address (); }
T &operator[] (unsigned ix)
{ return (*m_vec)[ix]; }
T &last (void)
{ return m_vec->last (); }
bool space (int nelems) const
{ return m_vec ? m_vec->space (nelems) : nelems == 0; }
bool iterate (unsigned ix, T *p) const;
bool iterate (unsigned ix, T **p) const;
vec copy () const;
bool reserve (unsigned, bool = false );
bool reserve_exact (unsigned );
void splice (const vec &);
void safe_splice (const vec & );
T *quick_push (const T &);
T *safe_push (const T &);
T &pop (void);
void truncate (unsigned);
void safe_grow (unsigned );
void safe_grow_cleared (unsigned );
void quick_grow (unsigned);
void quick_grow_cleared (unsigned);
void quick_insert (unsigned, const T &);
void safe_insert (unsigned, const T & );
void ordered_remove (unsigned);
void unordered_remove (unsigned);
void block_remove (unsigned, unsigned);
void qsort (int (*) (const void *, const void *));
void sort (int (*) (const void *, const void *, void *), void *);
T *bsearch (const void *key, int (*compar)(const void *, const void *));
T *bsearch (const void *key,
int (*compar)(const void *, const void *, void *), void *);
unsigned lower_bound (T, bool (*)(const T &, const T &)) const;
bool contains (const T &search) const;
void reverse (void);
bool using_auto_storage () const;
vec<T, va_heap, vl_embed> *m_vec;
};
# 1500 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T, size_t N = 0>
class auto_vec : public vec<T, va_heap>
{
public:
auto_vec ()
{
m_auto.embedded_init (((N) > (2) ? (N) : (2)), 0, 1);
this->m_vec = &m_auto;
}
auto_vec (size_t s)
{
if (s > N)
{
this->create (s);
return;
}
m_auto.embedded_init (((N) > (2) ? (N) : (2)), 0, 1);
this->m_vec = &m_auto;
}
~auto_vec ()
{
this->release ();
}
private:
vec<T, va_heap, vl_embed> m_auto;
T m_data[((N - 1) > (1) ? (N - 1) : (1))];
};
template<typename T>
class auto_vec<T, 0> : public vec<T, va_heap>
{
public:
auto_vec () { this->m_vec = nullptr; }
auto_vec (size_t n) { this->create (n); }
~auto_vec () { this->release (); }
};
template<typename T>
inline void
vec_alloc (vec<T> *&v, unsigned nelems )
{
v = new vec<T>;
v->create (nelems );
}
class auto_string_vec : public auto_vec <char *>
{
public:
~auto_string_vec ();
};
# 1578 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template <typename T>
class auto_delete_vec : public auto_vec <T *>
{
public:
auto_delete_vec () {}
auto_delete_vec (size_t s) : auto_vec <T *> (s) {}
~auto_delete_vec ();
private:
auto_delete_vec<T> (const auto_delete_vec<T>&) = delete; void operator= (const auto_delete_vec<T> &) = delete;
};
template<typename T>
inline void
vec_check_alloc (vec<T, va_heap> *&vec, unsigned nelems )
{
if (!vec)
vec_alloc (vec, nelems );
}
template<typename T>
inline void
vec_free (vec<T> *&v)
{
if (v == nullptr)
return;
v->release ();
delete v;
v = nullptr;
}
# 1624 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::iterate (unsigned ix, T *ptr) const
{
if (m_vec)
return m_vec->iterate (ix, ptr);
else
{
*ptr = 0;
return false;
}
}
# 1647 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::iterate (unsigned ix, T **ptr) const
{
if (m_vec)
return m_vec->iterate (ix, ptr);
else
{
*ptr = 0;
return false;
}
}
# 1686 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
inline
auto_string_vec::~auto_string_vec ()
{
int i;
char *str;
for (i = 0; (*this).iterate ((i), &(str)); ++(i))
free (str);
}
template <typename T>
inline
auto_delete_vec<T>::~auto_delete_vec ()
{
int i;
T *item;
for (i = 0; (*this).iterate ((i), &(item)); ++(i))
delete item;
}
template<typename T>
inline vec<T, va_heap, vl_ptr>
vec<T, va_heap, vl_ptr>::copy (void) const
{
vec<T, va_heap, vl_ptr> new_vec = vNULL;
if (length ())
new_vec.m_vec = m_vec->copy ();
return new_vec;
}
# 1731 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h"
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::reserve (unsigned nelems, bool exact )
{
if (space (nelems))
return false;
vec<T, va_heap, vl_embed> *oldvec = m_vec;
unsigned int oldsize = 0;
bool handle_auto_vec = m_vec && using_auto_storage ();
if (handle_auto_vec)
{
m_vec = nullptr;
oldsize = oldvec->length ();
nelems += oldsize;
}
va_heap::reserve (m_vec, nelems, exact );
if (handle_auto_vec)
{
vec_copy_construct (m_vec->address (), oldvec->address (), oldsize);
m_vec->m_vecpfx.m_num = oldsize;
}
return true;
}
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::reserve_exact (unsigned nelems )
{
return reserve (nelems, true );
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::create (unsigned nelems )
{
m_vec = nullptr;
if (nelems > 0)
reserve_exact (nelems );
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::release (void)
{
if (!m_vec)
return;
if (using_auto_storage ())
{
m_vec->m_vecpfx.m_num = 0;
return;
}
va_heap::release (m_vec);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::splice (const vec<T, va_heap, vl_ptr> &src)
{
if (src.length ())
m_vec->splice (*(src.m_vec));
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::safe_splice (const vec<T, va_heap, vl_ptr> &src
)
{
if (src.length ())
{
reserve_exact (src.length ());
splice (src);
}
}
template<typename T>
inline T *
vec<T, va_heap, vl_ptr>::quick_push (const T &obj)
{
return m_vec->quick_push (obj);
}
template<typename T>
inline T *
vec<T, va_heap, vl_ptr>::safe_push (const T &obj )
{
reserve (1, false );
return quick_push (obj);
}
template<typename T>
inline T &
vec<T, va_heap, vl_ptr>::pop (void)
{
return m_vec->pop ();
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::truncate (unsigned size)
{
if (m_vec)
m_vec->truncate (size);
else
((void)(!(size == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1885, __FUNCTION__), 0 : 0));
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::safe_grow (unsigned len )
{
unsigned oldlen = length ();
((void)(!(oldlen <= len) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1898, __FUNCTION__), 0 : 0));
reserve_exact (len - oldlen );
if (m_vec)
m_vec->quick_grow (len);
else
((void)(!(len == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1903, __FUNCTION__), 0 : 0));
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::safe_grow_cleared (unsigned len )
{
unsigned oldlen = length ();
size_t growby = len - oldlen;
safe_grow (len );
if (growby != 0)
vec_default_construct (address () + oldlen, growby);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::quick_grow (unsigned len)
{
((void)(!(m_vec) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1930, __FUNCTION__), 0 : 0));
m_vec->quick_grow (len);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::quick_grow_cleared (unsigned len)
{
((void)(!(m_vec) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1943, __FUNCTION__), 0 : 0));
m_vec->quick_grow_cleared (len);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::quick_insert (unsigned ix, const T &obj)
{
m_vec->quick_insert (ix, obj);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::safe_insert (unsigned ix, const T &obj )
{
reserve (1, false );
quick_insert (ix, obj);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::ordered_remove (unsigned ix)
{
m_vec->ordered_remove (ix);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::unordered_remove (unsigned ix)
{
m_vec->unordered_remove (ix);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::block_remove (unsigned ix, unsigned len)
{
m_vec->block_remove (ix, len);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::qsort (int (*cmp) (const void *, const void *))
{
if (m_vec)
m_vec->qsort (cmp);
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::sort (int (*cmp) (const void *, const void *,
void *), void *data)
{
if (m_vec)
m_vec->sort (cmp, data);
}
template<typename T>
inline T *
vec<T, va_heap, vl_ptr>::bsearch (const void *key,
int (*cmp) (const void *, const void *))
{
if (m_vec)
return m_vec->bsearch (key, cmp);
return nullptr;
}
template<typename T>
inline T *
vec<T, va_heap, vl_ptr>::bsearch (const void *key,
int (*cmp) (const void *, const void *,
void *), void *data)
{
if (m_vec)
return m_vec->bsearch (key, cmp, data);
return nullptr;
}
template<typename T>
inline unsigned
vec<T, va_heap, vl_ptr>::lower_bound (T obj,
bool (*lessthan)(const T &, const T &))
const
{
return m_vec ? m_vec->lower_bound (obj, lessthan) : 0;
}
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::contains (const T &search) const
{
return m_vec ? m_vec->contains (search) : false;
}
template<typename T>
inline void
vec<T, va_heap, vl_ptr>::reverse (void)
{
unsigned l = length ();
T *ptr = address ();
for (unsigned i = 0; i < l / 2; i++)
std::swap (ptr[i], ptr[l - i - 1]);
}
template<typename T>
inline bool
vec<T, va_heap, vl_ptr>::using_auto_storage () const
{
return m_vec->m_vecpfx.m_using_auto_storage;
}
template<typename T>
inline void
release_vec_vec (vec<vec<T> > &vec)
{
for (unsigned i = 0; i < vec.length (); i++)
vec[i].release ();
vec.release ();
}
# 249 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 1
# 250 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h" 1
# 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h"
hashval_t iterative_hash_host_wide_int (long, hashval_t);
hashval_t iterative_hash_hashval_t (hashval_t, hashval_t);
namespace inchash
{
class hash
{
public:
hash (hashval_t seed = 0)
{
val = seed;
bits = 0;
}
hashval_t end ()
{
return val;
}
void add_int (unsigned v)
{
val = iterative_hash_hashval_t (v, val);
}
template<unsigned int N, typename T>
void add_poly_int (const poly_int_pod<N, T> &v)
{
for (unsigned int i = 0; i < N; ++i)
add_int (v.coeffs[i]);
}
void add_hwi (long v)
{
val = iterative_hash_host_wide_int (v, val);
}
template<unsigned int N, typename T>
void add_poly_hwi (const poly_int_pod<N, T> &v)
{
for (unsigned int i = 0; i < N; ++i)
add_hwi (v.coeffs[i]);
}
template<typename T>
void add_wide_int (const generic_wide_int<T> &x)
{
add_int (x.get_len ());
for (unsigned i = 0; i < x.get_len (); i++)
add_hwi (x.sext_elt (i));
}
void add_ptr (const void *ptr)
{
add (&ptr, sizeof (ptr));
}
void add (const void *data, size_t len)
{
val = iterative_hash (data, len, val);
}
void merge_hash (hashval_t other)
{
val = iterative_hash_hashval_t (other, val);
}
void merge (hash &other)
{
merge_hash (other.val);
}
template<class T> void add_object(T &obj)
{
add (&obj, sizeof(T));
}
void add_flag (bool flag)
{
bits = (bits << 1) | flag;
}
void commit_flag ()
{
add_int (bits);
bits = 0;
}
void add_commutative (hash &a, hash &b)
{
if (a.end() > b.end())
{
merge (b);
merge (a);
}
else
{
merge (a);
merge (b);
}
}
private:
hashval_t val;
unsigned bits;
};
}
# 174 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h"
inline
hashval_t
iterative_hash_hashval_t (hashval_t val, hashval_t val2)
{
hashval_t a = 0x9e3779b9;
{ a -= val; a -= val2; a ^= (val2>>13); val -= val2; val -= a; val ^= (a<< 8); val2 -= a; val2 -= val; val2 ^= ((val&0xffffffff)>>13); a -= val; a -= val2; a ^= ((val2&0xffffffff)>>12); val -= val2; val -= a; val = (val ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= val; val2 = (val2 ^ (val>> 5)) & 0xffffffff; a -= val; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; val -= val2; val -= a; val = (val ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= val; val2 = (val2 ^ (val>>15)) & 0xffffffff; };
return val2;
}
inline
hashval_t
iterative_hash_host_wide_int (long val, hashval_t val2)
{
if (sizeof (long) == sizeof (hashval_t))
return iterative_hash_hashval_t (val, val2);
else
{
hashval_t a = (hashval_t) val;
int zero = 0;
hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
{ a -= b; a -= val2; a ^= (val2>>13); b -= val2; b -= a; b ^= (a<< 8); val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13); a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12); b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff; a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff; };
if (sizeof (long) > 2 * sizeof (hashval_t))
{
hashval_t a = (hashval_t) (val >> (sizeof (hashval_t) * 16 + zero));
hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 24 + zero));
{ a -= b; a -= val2; a ^= (val2>>13); b -= val2; b -= a; b ^= (a<< 8); val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13); a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12); b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff; a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff; };
}
return val2;
}
}
# 251 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats-traits.h" 1
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats-traits.h"
enum mem_alloc_origin
{
HASH_TABLE_ORIGIN,
HASH_MAP_ORIGIN,
HASH_SET_ORIGIN,
VEC_ORIGIN,
BITMAP_ORIGIN,
GGC_ORIGIN,
ALLOC_POOL_ORIGIN,
MEM_ALLOC_ORIGIN_LENGTH
};
static const char * mem_alloc_origin_names[] = { "Hash tables", "Hash maps",
"Hash sets", "Heap vectors", "Bitmaps", "GGC memory", "Allocation pool" };
# 252 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h" 1
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h"
template <typename Type>
struct typed_free_remove
{
static inline void remove (Type *p);
};
template <typename Type>
inline void
typed_free_remove <Type>::remove (Type *p)
{
free (p);
}
template <typename Type>
struct typed_delete_remove
{
static inline void remove (Type *p);
};
template <typename Type>
inline void
typed_delete_remove <Type>::remove (Type *p)
{
delete p;
}
template <typename Type>
struct typed_noop_remove
{
static inline void remove (Type &);
};
template <typename Type>
inline void
typed_noop_remove <Type>::remove (Type &)
{
}
template <typename Type, Type Empty, Type Deleted = Empty>
struct int_hash : typed_noop_remove <Type>
{
typedef Type value_type;
typedef Type compare_type;
static inline hashval_t hash (value_type);
static inline bool equal (value_type existing, value_type candidate);
static inline void mark_deleted (Type &);
static const bool empty_zero_p = Empty == 0;
static inline void mark_empty (Type &);
static inline bool is_deleted (Type);
static inline bool is_empty (Type);
};
template <typename Type, Type Empty, Type Deleted>
inline hashval_t
int_hash <Type, Empty, Deleted>::hash (value_type x)
{
return x;
}
template <typename Type, Type Empty, Type Deleted>
inline bool
int_hash <Type, Empty, Deleted>::equal (value_type x, value_type y)
{
return x == y;
}
template <typename Type, Type Empty, Type Deleted>
inline void
int_hash <Type, Empty, Deleted>::mark_deleted (Type &x)
{
((void)(!(Empty != Deleted) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h", 115, __FUNCTION__), 0 : 0));
x = Deleted;
}
template <typename Type, Type Empty, Type Deleted>
inline void
int_hash <Type, Empty, Deleted>::mark_empty (Type &x)
{
x = Empty;
}
template <typename Type, Type Empty, Type Deleted>
inline bool
int_hash <Type, Empty, Deleted>::is_deleted (Type x)
{
return Empty != Deleted && x == Deleted;
}
template <typename Type, Type Empty, Type Deleted>
inline bool
int_hash <Type, Empty, Deleted>::is_empty (Type x)
{
return x == Empty;
}
template <typename Type>
struct pointer_hash
{
typedef Type *value_type;
typedef Type *compare_type;
static inline hashval_t hash (const value_type &);
static inline bool equal (const value_type &existing,
const compare_type &candidate);
static inline void mark_deleted (Type *&);
static const bool empty_zero_p = true;
static inline void mark_empty (Type *&);
static inline bool is_deleted (Type *);
static inline bool is_empty (Type *);
};
template <typename Type>
inline hashval_t
pointer_hash <Type>::hash (const value_type &candidate)
{
return (hashval_t) ((intptr_t)candidate >> 3);
}
template <typename Type>
inline bool
pointer_hash <Type>::equal (const value_type &existing,
const compare_type &candidate)
{
return existing == candidate;
}
template <typename Type>
inline void
pointer_hash <Type>::mark_deleted (Type *&e)
{
e = reinterpret_cast<Type *> (1);
}
template <typename Type>
inline void
pointer_hash <Type>::mark_empty (Type *&e)
{
e = nullptr;
}
template <typename Type>
inline bool
pointer_hash <Type>::is_deleted (Type *e)
{
return e == reinterpret_cast<Type *> (1);
}
template <typename Type>
inline bool
pointer_hash <Type>::is_empty (Type *e)
{
return e == nullptr;
}
struct string_hash : pointer_hash <const char>
{
static inline hashval_t hash (const char *);
static inline bool equal (const char *, const char *);
};
inline hashval_t
string_hash::hash (const char *id)
{
return htab_hash_string (id);
}
inline bool
string_hash::equal (const char *id1, const char *id2)
{
return strcmp (id1, id2) == 0;
}
template<typename T>
struct ggc_remove
{
static void remove (T &) {}
static void
ggc_mx (T &p)
{
extern void gt_ggc_mx (T &);
gt_ggc_mx (p);
}
static void
ggc_maybe_mx (T &p)
{
ggc_mx (p);
}
static void
pch_nx (T &p)
{
extern void gt_pch_nx (T &);
gt_pch_nx (p);
}
static void
pch_nx (T &p, gt_pointer_operator op, void *cookie)
{
op (&p, cookie);
}
};
template<typename T>
struct ggc_cache_remove : ggc_remove<T>
{
static void ggc_maybe_mx (T &) {}
static int
keep_cache_entry (T &e)
{
return ggc_marked_p (e) ? -1 : 0;
}
};
template <typename T>
struct nofree_ptr_hash : pointer_hash <T>, typed_noop_remove <T *> {};
template <typename T>
struct free_ptr_hash : pointer_hash <T>, typed_free_remove <T> {};
template <typename T>
struct delete_ptr_hash : pointer_hash <T>, typed_delete_remove <T> {};
template <typename T>
struct ggc_ptr_hash : pointer_hash <T>, ggc_remove <T *> {};
template <typename T>
struct ggc_cache_ptr_hash : pointer_hash <T>, ggc_cache_remove <T *> {};
struct nofree_string_hash : string_hash, typed_noop_remove <const char *> {};
template <typename T1, typename T2>
struct pair_hash
{
typedef std::pair <typename T1::value_type,
typename T2::value_type> value_type;
typedef std::pair <typename T1::compare_type,
typename T2::compare_type> compare_type;
static inline hashval_t hash (const value_type &);
static inline bool equal (const value_type &, const compare_type &);
static inline void remove (value_type &);
static inline void mark_deleted (value_type &);
static const bool empty_zero_p = T1::empty_zero_p;
static inline void mark_empty (value_type &);
static inline bool is_deleted (const value_type &);
static inline bool is_empty (const value_type &);
};
template <typename T1, typename T2>
inline hashval_t
pair_hash <T1, T2>::hash (const value_type &x)
{
return iterative_hash_hashval_t (T1::hash (x.first), T2::hash (x.second));
}
template <typename T1, typename T2>
inline bool
pair_hash <T1, T2>::equal (const value_type &x, const compare_type &y)
{
return T1::equal (x.first, y.first) && T2::equal (x.second, y.second);
}
template <typename T1, typename T2>
inline void
pair_hash <T1, T2>::remove (value_type &x)
{
T1::remove (x.first);
T2::remove (x.second);
}
template <typename T1, typename T2>
inline void
pair_hash <T1, T2>::mark_deleted (value_type &x)
{
T1::mark_deleted (x.first);
}
template <typename T1, typename T2>
inline void
pair_hash <T1, T2>::mark_empty (value_type &x)
{
T1::mark_empty (x.first);
}
template <typename T1, typename T2>
inline bool
pair_hash <T1, T2>::is_deleted (const value_type &x)
{
return T1::is_deleted (x.first);
}
template <typename T1, typename T2>
inline bool
pair_hash <T1, T2>::is_empty (const value_type &x)
{
return T1::is_empty (x.first);
}
template <typename T> struct default_hash_traits : T {};
template <typename T>
struct default_hash_traits <T *> : ggc_ptr_hash <T> {};
# 253 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map-traits.h" 1
# 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map-traits.h"
template <typename H, typename Value>
struct simple_hashmap_traits
{
typedef typename H::value_type key_type;
static const bool maybe_mx = true;
static inline hashval_t hash (const key_type &);
static inline bool equal_keys (const key_type &, const key_type &);
template <typename T> static inline void remove (T &);
static const bool empty_zero_p = H::empty_zero_p;
template <typename T> static inline bool is_empty (const T &);
template <typename T> static inline bool is_deleted (const T &);
template <typename T> static inline void mark_empty (T &);
template <typename T> static inline void mark_deleted (T &);
};
template <typename H, typename Value>
inline hashval_t
simple_hashmap_traits <H, Value>::hash (const key_type &h)
{
return H::hash (h);
}
template <typename H, typename Value>
inline bool
simple_hashmap_traits <H, Value>::equal_keys (const key_type &k1,
const key_type &k2)
{
return H::equal (k1, k2);
}
template <typename H, typename Value>
template <typename T>
inline void
simple_hashmap_traits <H, Value>::remove (T &entry)
{
H::remove (entry.m_key);
entry.m_value.~Value ();
}
template <typename H, typename Value>
template <typename T>
inline bool
simple_hashmap_traits <H, Value>::is_empty (const T &entry)
{
return H::is_empty (entry.m_key);
}
template <typename H, typename Value>
template <typename T>
inline bool
simple_hashmap_traits <H, Value>::is_deleted (const T &entry)
{
return H::is_deleted (entry.m_key);
}
template <typename H, typename Value>
template <typename T>
inline void
simple_hashmap_traits <H, Value>::mark_empty (T &entry)
{
H::mark_empty (entry.m_key);
}
template <typename H, typename Value>
template <typename T>
inline void
simple_hashmap_traits <H, Value>::mark_deleted (T &entry)
{
H::mark_deleted (entry.m_key);
}
template <typename H, typename Value>
struct simple_cache_map_traits: public simple_hashmap_traits<H,Value>
{
static const bool maybe_mx = false;
};
template <typename Value>
struct unbounded_hashmap_traits
{
template <typename T> static inline void remove (T &);
static const bool empty_zero_p = default_hash_traits <Value>::empty_zero_p;
template <typename T> static inline bool is_empty (const T &);
template <typename T> static inline bool is_deleted (const T &);
template <typename T> static inline void mark_empty (T &);
template <typename T> static inline void mark_deleted (T &);
};
template <typename Value>
template <typename T>
inline void
unbounded_hashmap_traits <Value>::remove (T &entry)
{
default_hash_traits <Value>::remove (entry.m_value);
}
template <typename Value>
template <typename T>
inline bool
unbounded_hashmap_traits <Value>::is_empty (const T &entry)
{
return default_hash_traits <Value>::is_empty (entry.m_value);
}
template <typename Value>
template <typename T>
inline bool
unbounded_hashmap_traits <Value>::is_deleted (const T &entry)
{
return default_hash_traits <Value>::is_deleted (entry.m_value);
}
template <typename Value>
template <typename T>
inline void
unbounded_hashmap_traits <Value>::mark_empty (T &entry)
{
default_hash_traits <Value>::mark_empty (entry.m_value);
}
template <typename Value>
template <typename T>
inline void
unbounded_hashmap_traits <Value>::mark_deleted (T &entry)
{
default_hash_traits <Value>::mark_deleted (entry.m_value);
}
template <typename Key, typename Value>
struct unbounded_int_hashmap_traits : unbounded_hashmap_traits <Value>
{
typedef Key key_type;
static inline hashval_t hash (Key);
static inline bool equal_keys (Key, Key);
};
template <typename Key, typename Value>
inline hashval_t
unbounded_int_hashmap_traits <Key, Value>::hash (Key k)
{
return k;
}
template <typename Key, typename Value>
inline bool
unbounded_int_hashmap_traits <Key, Value>::equal_keys (Key k1, Key k2)
{
return k1 == k2;
}
# 254 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
template<typename, typename, typename> class hash_map;
template<typename, bool, typename> class hash_set;
template <typename Type>
struct xcallocator
{
static Type *data_alloc (size_t count);
static void data_free (Type *memory);
};
template <typename Type>
inline Type *
xcallocator <Type>::data_alloc (size_t count)
{
return static_cast <Type *> (xcalloc (count, sizeof (Type)));
}
template <typename Type>
inline void
xcallocator <Type>::data_free (Type *memory)
{
return ::free (memory);
}
struct prime_ent
{
hashval_t prime;
hashval_t inv;
hashval_t inv_m2;
hashval_t shift;
};
extern struct prime_ent const prime_tab[];
extern unsigned int hash_table_sanitize_eq_limit;
extern unsigned int hash_table_higher_prime_index (unsigned long n)
__attribute__ ((__pure__));
extern __attribute__ ((__noreturn__)) __attribute__ ((__cold__)) void hashtab_chk_error ();
# 322 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
inline hashval_t
mul_mod (hashval_t x, hashval_t y, hashval_t inv, int shift)
{
hashval_t t1, t2, t3, t4, q, r;
t1 = ((uint64_t)x * inv) >> 32;
t2 = x - t1;
t3 = t2 >> 1;
t4 = t1 + t3;
q = t4 >> shift;
r = x - (q * y);
return r;
}
inline hashval_t
hash_table_mod1 (hashval_t hash, unsigned int index)
{
const struct prime_ent *p = &prime_tab[index];
((void)(!(sizeof (hashval_t) * 8 <= 32) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 343, __FUNCTION__), 0 : 0));
return mul_mod (hash, p->prime, p->inv, p->shift);
}
inline hashval_t
hash_table_mod2 (hashval_t hash, unsigned int index)
{
const struct prime_ent *p = &prime_tab[index];
((void)(!(sizeof (hashval_t) * 8 <= 32) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 353, __FUNCTION__), 0 : 0));
return 1 + mul_mod (hash, p->prime - 2, p->inv_m2, p->shift);
}
class mem_usage;
# 372 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
template <typename Descriptor, bool Lazy = false,
template<typename Type> class Allocator = xcallocator>
class hash_table
{
typedef typename Descriptor::value_type value_type;
typedef typename Descriptor::compare_type compare_type;
public:
explicit hash_table (size_t, bool ggc = false,
bool sanitize_eq_and_hash = true,
bool gather_mem_stats = 0,
mem_alloc_origin origin = HASH_TABLE_ORIGIN
);
explicit hash_table (const hash_table &, bool ggc = false,
bool sanitize_eq_and_hash = true,
bool gather_mem_stats = 0,
mem_alloc_origin origin = HASH_TABLE_ORIGIN
);
~hash_table ();
static hash_table *
create_ggc (size_t n, bool sanitize_eq_and_hash = true )
{
hash_table *table = ggc_alloc<hash_table> ();
new (table) hash_table (n, true, sanitize_eq_and_hash, 0,
HASH_TABLE_ORIGIN );
return table;
}
size_t size () const { return m_size; }
size_t elements () const { return m_n_elements - m_n_deleted; }
size_t elements_with_deleted () const { return m_n_elements; }
void empty () { if (elements ()) empty_slow (); }
bool is_empty () const { return elements () == 0; }
void clear_slot (value_type *);
value_type &find_with_hash (const compare_type &, hashval_t);
value_type &find (const value_type &value)
{
return find_with_hash (value, Descriptor::hash (value));
}
value_type *find_slot (const value_type &value, insert_option insert)
{
return find_slot_with_hash (value, Descriptor::hash (value), insert);
}
# 445 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
value_type *find_slot_with_hash (const compare_type &comparable,
hashval_t hash, enum insert_option insert);
void remove_elt_with_hash (const compare_type &, hashval_t);
void remove_elt (const value_type &value)
{
remove_elt_with_hash (value, Descriptor::hash (value));
}
template <typename Argument,
int (*Callback) (value_type *slot, Argument argument)>
void traverse_noresize (Argument argument);
template <typename Argument,
int (*Callback) (value_type *slot, Argument argument)>
void traverse (Argument argument);
class iterator
{
public:
iterator () : m_slot (nullptr), m_limit (nullptr) {}
iterator (value_type *slot, value_type *limit) :
m_slot (slot), m_limit (limit) {}
inline value_type &operator * () { return *m_slot; }
void slide ();
inline iterator &operator ++ ();
bool operator != (const iterator &other) const
{
return m_slot != other.m_slot || m_limit != other.m_limit;
}
private:
value_type *m_slot;
value_type *m_limit;
};
iterator begin () const
{
if (Lazy && m_entries == nullptr)
return iterator ();
iterator iter (m_entries, m_entries + m_size);
iter.slide ();
return iter;
}
iterator end () const { return iterator (); }
double collisions () const
{
return m_searches ? static_cast <double> (m_collisions) / m_searches : 0;
}
private:
void operator= (hash_table&);
template<typename T> friend void gt_ggc_mx (hash_table<T> *);
template<typename T> friend void gt_pch_nx (hash_table<T> *);
template<typename T> friend void
hashtab_entry_note_pointers (void *, void *, gt_pointer_operator, void *);
template<typename T, typename U, typename V> friend void
gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *);
template<typename T, typename U>
friend void gt_pch_nx (hash_set<T, false, U> *, gt_pointer_operator, void *);
template<typename T> friend void gt_pch_nx (hash_table<T> *,
gt_pointer_operator, void *);
template<typename T> friend void gt_cleare_cache (hash_table<T> *);
void empty_slow ();
value_type *alloc_entries (size_t n ) const;
value_type *find_empty_slot_for_expand (hashval_t);
void verify (const compare_type &comparable, hashval_t hash);
bool too_empty_p (unsigned int);
void expand ();
static bool is_deleted (value_type &v)
{
return Descriptor::is_deleted (v);
}
static bool is_empty (value_type &v)
{
return Descriptor::is_empty (v);
}
static void mark_deleted (value_type &v)
{
Descriptor::mark_deleted (v);
}
static void mark_empty (value_type &v)
{
Descriptor::mark_empty (v);
}
typename Descriptor::value_type *m_entries;
size_t m_size;
size_t m_n_elements;
size_t m_n_deleted;
unsigned int m_searches;
unsigned int m_collisions;
unsigned int m_size_prime_index;
bool m_ggc;
bool m_sanitize_eq_and_hash;
static const bool m_gather_mem_stats = false;
};
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 1
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
template<typename Key, typename Value,
typename Traits = simple_hashmap_traits<default_hash_traits<Key>,
Value> >
class hash_map;
class mem_location
{
public:
inline
mem_location () {}
inline
mem_location (mem_alloc_origin origin, bool ggc,
const char *filename = nullptr, int line = 0,
const char *function = nullptr):
m_filename (filename), m_function (function), m_line (line), m_origin
(origin), m_ggc (ggc) {}
inline
mem_location (mem_location &other): m_filename (other.m_filename),
m_function (other.m_function), m_line (other.m_line),
m_origin (other.m_origin), m_ggc (other.m_ggc) {}
hashval_t
hash ()
{
inchash::hash hash;
hash.add_ptr (m_filename);
hash.add_ptr (m_function);
hash.add_int (m_line);
return hash.end ();
}
int
equal (const mem_location &other)
{
return m_filename == other.m_filename && m_function == other.m_function
&& m_line == other.m_line;
}
inline const char *
get_trimmed_filename ()
{
const char *s1 = m_filename;
const char *s2;
while ((s2 = strstr (s1, "gcc/")))
s1 = s2 + 4;
return s1;
}
inline char *
to_string ()
{
unsigned l = strlen (get_trimmed_filename ()) + strlen (m_function)
+ 30;
char *s = ((char *) xmalloc (sizeof (char) * (l)));
sprintf (s, "%s:%i (%s)", get_trimmed_filename (),
m_line, m_function);
s[((48) < (l - 1) ? (48) : (l - 1))] = '\0';
return s;
}
static const char *
get_origin_name (mem_alloc_origin origin)
{
return mem_alloc_origin_names[(unsigned) origin];
}
const char *m_filename;
const char *m_function;
int m_line;
mem_alloc_origin m_origin;
bool m_ggc;
};
class mem_usage
{
public:
mem_usage (): m_allocated (0), m_times (0), m_peak (0), m_instances (1) {}
mem_usage (size_t allocated, size_t times, size_t peak, size_t instances = 0):
m_allocated (allocated), m_times (times), m_peak (peak),
m_instances (instances) {}
inline void
register_overhead (size_t size)
{
m_allocated += size;
m_times++;
if (m_peak < m_allocated)
m_peak = m_allocated;
}
inline void
release_overhead (size_t size)
{
((void)(!(size <= m_allocated) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h", 153, __FUNCTION__), 0 : 0));
m_allocated -= size;
}
mem_usage
operator+ (const mem_usage &second)
{
return mem_usage (m_allocated + second.m_allocated,
m_times + second.m_times,
m_peak + second.m_peak,
m_instances + second.m_instances);
}
inline bool
operator== (const mem_usage &second) const
{
return (m_allocated == second.m_allocated
&& m_peak == second.m_peak
&& m_times == second.m_times);
}
inline bool
operator< (const mem_usage &second) const
{
if (*this == second)
return false;
return (m_allocated == second.m_allocated ?
(m_peak == second.m_peak ? m_times < second.m_times
: m_peak < second.m_peak) : m_allocated < second.m_allocated);
}
static int
compare (const void *first, const void *second)
{
typedef std::pair<mem_location *, mem_usage *> mem_pair_t;
const mem_pair_t f = *(const mem_pair_t *)first;
const mem_pair_t s = *(const mem_pair_t *)second;
if (*f.second == *s.second)
return 0;
return *f.second < *s.second ? 1 : -1;
}
inline void
dump (mem_location *loc, const mem_usage &total) const
{
char *location_string = loc->to_string ();
fprintf (
# 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
, "%-48s " "%" "9"
# 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
"l" "u"
# 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
"%c" ":%5.1f%%"
"%" "9"
# 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
"l" "u"
# 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
"%c" "%" "9"
# 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
"l" "u"
# 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
"%c" ":%5.1f%%%10s\n",
location_string, (uint64_t)(((m_allocated) < 10 * 1024 ? (m_allocated) : ((m_allocated) < 10 * (1024 * 1024) ? (m_allocated) / 1024 : (m_allocated) / (1024 * 1024)))), ((m_allocated) < 10 * 1024 ? ' ' : ((m_allocated) < 10 * (1024 * 1024) ? 'k' : 'M')),
get_percent (m_allocated, total.m_allocated),
(uint64_t)(((m_peak) < 10 * 1024 ? (m_peak) : ((m_peak) < 10 * (1024 * 1024) ? (m_peak) / 1024 : (m_peak) / (1024 * 1024)))), ((m_peak) < 10 * 1024 ? ' ' : ((m_peak) < 10 * (1024 * 1024) ? 'k' : 'M')), (uint64_t)(((m_times) < 10 * 1024 ? (m_times) : ((m_times) < 10 * (1024 * 1024) ? (m_times) / 1024 : (m_times) / (1024 * 1024)))), ((m_times) < 10 * 1024 ? ' ' : ((m_times) < 10 * (1024 * 1024) ? 'k' : 'M')),
get_percent (m_times, total.m_times), loc->m_ggc ? "ggc" : "heap");
free (location_string);
}
inline void
dump_footer () const
{
fprintf (
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
, "%s" "%" "53"
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
"l" "u"
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
"%c" "%" "26"
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
"l" "u"
# 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
"%c" "\n", "Total",
(uint64_t)(((m_allocated) < 10 * 1024 ? (m_allocated) : ((m_allocated) < 10 * (1024 * 1024) ? (m_allocated) / 1024 : (m_allocated) / (1024 * 1024)))), ((m_allocated) < 10 * 1024 ? ' ' : ((m_allocated) < 10 * (1024 * 1024) ? 'k' : 'M')), (uint64_t)(((m_times) < 10 * 1024 ? (m_times) : ((m_times) < 10 * (1024 * 1024) ? (m_times) / 1024 : (m_times) / (1024 * 1024)))), ((m_times) < 10 * 1024 ? ' ' : ((m_times) < 10 * (1024 * 1024) ? 'k' : 'M')));
}
static inline float
get_percent (size_t nominator, size_t denominator)
{
return denominator == 0 ? 0.0f : nominator * 100.0 / denominator;
}
static inline void
print_dash_line (size_t count = 140)
{
while (count--)
fputc ('-',
# 240 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 240 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
);
fputc ('\n',
# 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
);
}
static inline void
dump_header (const char *name)
{
fprintf (
# 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
, "%-48s %11s%16s%10s%17s\n", name, "Leak", "Peak",
"Times", "Type");
}
size_t m_allocated;
size_t m_times;
size_t m_peak;
size_t m_instances;
};
template <class T>
class mem_usage_pair
{
public:
mem_usage_pair (T *usage_, size_t allocated_): usage (usage_),
allocated (allocated_) {}
T *usage;
size_t allocated;
};
template <class T>
class mem_alloc_description
{
public:
struct mem_location_hash : nofree_ptr_hash <mem_location>
{
static hashval_t
hash (value_type l)
{
inchash::hash hstate;
hstate.add_ptr ((const void *)l->m_filename);
hstate.add_ptr (l->m_function);
hstate.add_int (l->m_line);
return hstate.end ();
}
static bool
equal (value_type l1, value_type l2)
{
return (l1->m_filename == l2->m_filename
&& l1->m_function == l2->m_function
&& l1->m_line == l2->m_line);
}
};
typedef hash_map <mem_location_hash, T *> mem_map_t;
typedef hash_map <const void *, mem_usage_pair<T> > reverse_mem_map_t;
typedef hash_map <const void *, std::pair<T *, size_t> > reverse_object_map_t;
typedef std::pair <mem_location *, T *> mem_list_t;
mem_alloc_description ();
~mem_alloc_description ();
bool contains_descriptor_for_instance (const void *ptr);
T *get_descriptor_for_instance (const void *ptr);
T *register_descriptor (const void *ptr, mem_location *location);
T *register_descriptor (const void *ptr, mem_alloc_origin origin,
bool ggc, const char *name, int line,
const char *function);
T *register_instance_overhead (size_t size, const void *ptr);
void register_object_overhead (T *usage, size_t size, const void *ptr);
T *release_instance_overhead (void *ptr, size_t size,
bool remove_from_map = false);
void release_object_overhead (void *ptr);
void unregister_descriptor (void *ptr);
T get_sum (mem_alloc_origin origin);
mem_list_t *get_list (mem_alloc_origin origin, unsigned *length);
void dump (mem_alloc_origin origin);
reverse_object_map_t *m_reverse_object_map;
private:
T *register_overhead (size_t size, mem_alloc_origin origin, const char *name,
int line, const char *function, const void *ptr);
mem_location m_location;
mem_map_t *m_map;
reverse_mem_map_t *m_reverse_map;
};
template <class T>
inline bool
mem_alloc_description<T>::contains_descriptor_for_instance (const void *ptr)
{
return m_reverse_map->get (ptr);
}
template <class T>
inline T*
mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr)
{
return m_reverse_map->get (ptr) ? (*m_reverse_map->get (ptr)).usage : nullptr;
}
template <class T>
inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr,
mem_location *location)
{
T *usage = nullptr;
T **slot = m_map->get (location);
if (slot)
{
delete location;
usage = *slot;
usage->m_instances++;
}
else
{
usage = new T ();
m_map->put (location, usage);
}
if (!m_reverse_map->get (ptr))
m_reverse_map->put (ptr, mem_usage_pair<T> (usage, 0));
return usage;
}
template <class T>
inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr,
mem_alloc_origin origin,
bool ggc,
const char *filename,
int line,
const char *function)
{
mem_location *l = new mem_location (origin, ggc, filename, line, function);
return register_descriptor (ptr, l);
}
template <class T>
inline T*
mem_alloc_description<T>::register_instance_overhead (size_t size,
const void *ptr)
{
mem_usage_pair <T> *slot = m_reverse_map->get (ptr);
if (!slot)
{
return nullptr;
}
T *usage = (*slot).usage;
usage->register_overhead (size);
return usage;
}
template <class T>
void
mem_alloc_description<T>::register_object_overhead (T *usage, size_t size,
const void *ptr)
{
m_reverse_object_map->put (ptr, std::pair<T *, size_t> (usage, size));
}
template <class T>
inline T*
mem_alloc_description<T>::register_overhead (size_t size,
mem_alloc_origin origin,
const char *filename,
int line,
const char *function,
const void *ptr)
{
T *usage = register_descriptor (ptr, origin, filename, line, function);
usage->register_overhead (size);
return usage;
}
template <class T>
inline T *
mem_alloc_description<T>::release_instance_overhead (void *ptr, size_t size,
bool remove_from_map)
{
mem_usage_pair<T> *slot = m_reverse_map->get (ptr);
if (!slot)
{
return nullptr;
}
T *usage = (*slot).usage;
usage->release_overhead (size);
if (remove_from_map)
m_reverse_map->remove (ptr);
return usage;
}
template <class T>
inline void
mem_alloc_description<T>::release_object_overhead (void *ptr)
{
std::pair <T *, size_t> *entry = m_reverse_object_map->get (ptr);
entry->first->release_overhead (entry->second);
m_reverse_object_map->remove (ptr);
}
template <class T>
inline void
mem_alloc_description<T>::unregister_descriptor (void *ptr)
{
m_reverse_map->remove (ptr);
}
template <class T>
inline
mem_alloc_description<T>::mem_alloc_description ()
{
m_map = new mem_map_t (13, false, false, false);
m_reverse_map = new reverse_mem_map_t (13, false, false, false);
m_reverse_object_map = new reverse_object_map_t (13, false, false, false);
}
template <class T>
inline
mem_alloc_description<T>::~mem_alloc_description ()
{
for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end ();
++it)
{
delete (*it).first;
delete (*it).second;
}
delete m_map;
delete m_reverse_map;
delete m_reverse_object_map;
}
template <class T>
inline
typename mem_alloc_description<T>::mem_list_t *
mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length)
{
size_t element_size = sizeof (mem_list_t);
mem_list_t *list = ((mem_list_t *) xcalloc ((m_map->elements ()), sizeof (mem_list_t)));
unsigned i = 0;
for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end ();
++it)
if ((*it).first->m_origin == origin)
list[i++] = std::pair<mem_location*, T*> (*it);
gcc_qsort (list, i, element_size, T::compare);
*length = i;
return list;
}
template <class T>
inline T
mem_alloc_description<T>::get_sum (mem_alloc_origin origin)
{
unsigned length;
mem_list_t *list = get_list (origin, &length);
T sum;
for (unsigned i = 0; i < length; i++)
sum = sum + *list[i].second;
free ((void*) (list));
return sum;
}
template <class T>
inline void
mem_alloc_description<T>::dump (mem_alloc_origin origin)
{
unsigned length;
fprintf (
# 636 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 636 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
, "\n");
mem_list_t *list = get_list (origin, &length);
T total = get_sum (origin);
T::print_dash_line ();
T::dump_header (mem_location::get_origin_name (origin));
T::print_dash_line ();
for (int i = length - 1; i >= 0; i--)
list[i].second->dump (list[i].first, total);
T::print_dash_line ();
T::dump_header (mem_location::get_origin_name (origin));
T::print_dash_line ();
total.dump_footer ();
T::print_dash_line ();
free ((void*) (list));
fprintf (
# 655 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4
stderr
# 655 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h"
, "\n");
}
# 595 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map.h" 1
# 35 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map.h"
const size_t default_hash_map_size = 13;
template<typename KeyId, typename Value,
typename Traits
>
class hash_map
{
typedef typename Traits::key_type Key;
struct hash_entry
{
Key m_key;
Value m_value;
typedef hash_entry value_type;
typedef Key compare_type;
static hashval_t hash (const hash_entry &e)
{
return Traits::hash (e.m_key);
}
static bool equal (const hash_entry &a, const Key &b)
{
return Traits::equal_keys (a.m_key, b);
}
static void remove (hash_entry &e) { Traits::remove (e); }
static void mark_deleted (hash_entry &e) { Traits::mark_deleted (e); }
static bool is_deleted (const hash_entry &e)
{
return Traits::is_deleted (e);
}
static const bool empty_zero_p = Traits::empty_zero_p;
static void mark_empty (hash_entry &e) { Traits::mark_empty (e); }
static bool is_empty (const hash_entry &e) { return Traits::is_empty (e); }
static void ggc_mx (hash_entry &e)
{
gt_ggc_mx (e.m_key);
gt_ggc_mx (e.m_value);
}
static void ggc_maybe_mx (hash_entry &e)
{
if (Traits::maybe_mx)
ggc_mx (e);
}
static void pch_nx (hash_entry &e)
{
gt_pch_nx (e.m_key);
gt_pch_nx (e.m_value);
}
static void pch_nx (hash_entry &e, gt_pointer_operator op, void *c)
{
pch_nx_helper (e.m_key, op, c);
pch_nx_helper (e.m_value, op, c);
}
static int keep_cache_entry (hash_entry &e)
{
return ggc_marked_p (e.m_key);
}
private:
template<typename T>
static void
pch_nx_helper (T &x, gt_pointer_operator op, void *cookie)
{
gt_pch_nx (&x, op, cookie);
}
static void
pch_nx_helper (int, gt_pointer_operator, void *)
{
}
static void
pch_nx_helper (unsigned int, gt_pointer_operator, void *)
{
}
static void
pch_nx_helper (bool, gt_pointer_operator, void *)
{
}
template<typename T>
static void
pch_nx_helper (T *&x, gt_pointer_operator op, void *cookie)
{
op (&x, cookie);
}
};
public:
explicit hash_map (size_t n = default_hash_map_size, bool ggc = false,
bool sanitize_eq_and_hash = true,
bool gather_mem_stats = 0
)
: m_table (n, ggc, sanitize_eq_and_hash, gather_mem_stats,
HASH_MAP_ORIGIN )
{
}
explicit hash_map (const hash_map &h, bool ggc = false,
bool sanitize_eq_and_hash = true,
bool gather_mem_stats = 0
)
: m_table (h.m_table, ggc, sanitize_eq_and_hash, gather_mem_stats,
HASH_MAP_ORIGIN ) {}
static hash_map *create_ggc (size_t size = default_hash_map_size,
bool gather_mem_stats = 0
)
{
hash_map *map = ggc_alloc<hash_map> ();
new (map) hash_map (size, true, true, gather_mem_stats );
return map;
}
bool put (const Key &k, const Value &v)
{
hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
INSERT);
bool ins = hash_entry::is_empty (*e);
if (ins)
{
e->m_key = k;
new ((void *) &e->m_value) Value (v);
}
else
e->m_value = v;
return !ins;
}
Value *get (const Key &k)
{
hash_entry &e = m_table.find_with_hash (k, Traits::hash (k));
return Traits::is_empty (e) ? nullptr : &e.m_value;
}
Value &get_or_insert (const Key &k, bool *existed = nullptr)
{
hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k),
INSERT);
bool ins = Traits::is_empty (*e);
if (ins)
{
e->m_key = k;
new ((void *)&e->m_value) Value ();
}
if (existed != nullptr)
*existed = !ins;
return e->m_value;
}
void remove (const Key &k)
{
m_table.remove_elt_with_hash (k, Traits::hash (k));
}
template<typename Arg, bool (*f)(const typename Traits::key_type &,
const Value &, Arg)>
void traverse (Arg a) const
{
for (typename hash_table<hash_entry>::iterator iter = m_table.begin ();
iter != m_table.end (); ++iter)
f ((*iter).m_key, (*iter).m_value, a);
}
template<typename Arg, bool (*f)(const typename Traits::key_type &,
Value *, Arg)>
void traverse (Arg a) const
{
for (typename hash_table<hash_entry>::iterator iter = m_table.begin ();
iter != m_table.end (); ++iter)
if (!f ((*iter).m_key, &(*iter).m_value, a))
break;
}
size_t elements () const { return m_table.elements (); }
void empty () { m_table.empty(); }
bool is_empty () const { return m_table.is_empty (); }
class iterator
{
public:
explicit iterator (const typename hash_table<hash_entry>::iterator &iter) :
m_iter (iter) {}
iterator &operator++ ()
{
++m_iter;
return *this;
}
class reference_pair {
public:
const Key &first;
Value &second;
reference_pair (const Key &key, Value &value) : first (key), second (value) {}
template <typename K, typename V>
operator std::pair<K, V> () const { return std::pair<K, V> (first, second); }
};
reference_pair operator* ()
{
hash_entry &e = *m_iter;
return reference_pair (e.m_key, e.m_value);
}
bool
operator != (const iterator &other) const
{
return m_iter != other.m_iter;
}
private:
typename hash_table<hash_entry>::iterator m_iter;
};
iterator begin () const { return iterator (m_table.begin ()); }
iterator end () const { return iterator (m_table.end ()); }
private:
template<typename T, typename U, typename V> friend void gt_ggc_mx (hash_map<T, U, V> *);
template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *);
template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *);
template<typename T, typename U, typename V> friend void gt_cleare_cache (hash_map<T, U, V> *);
hash_table<hash_entry> m_table;
};
template<typename K, typename V, typename H>
static inline void
gt_ggc_mx (hash_map<K, V, H> *h)
{
gt_ggc_mx (&h->m_table);
}
template<typename K, typename V, typename H>
static inline void
gt_pch_nx (hash_map<K, V, H> *h)
{
gt_pch_nx (&h->m_table);
}
template<typename K, typename V, typename H>
static inline void
gt_cleare_cache (hash_map<K, V, H> *h)
{
if (h)
gt_cleare_cache (&h->m_table);
}
template<typename K, typename V, typename H>
static inline void
gt_pch_nx (hash_map<K, V, H> *h, gt_pointer_operator op, void *cookie)
{
op (&h->m_table.m_entries, cookie);
}
enum hm_alloc { hm_heap = false, hm_ggc = true };
template<bool ggc, typename K, typename V, typename H>
inline hash_map<K,V,H> *
hash_map_maybe_create (hash_map<K,V,H> *&h,
size_t size = default_hash_map_size)
{
if (!h)
{
if (ggc)
h = hash_map<K,V,H>::create_ggc (size);
else
h = new hash_map<K,V,H> (size);
}
return h;
}
template<typename K, typename V, typename H>
inline V*
hash_map_safe_get (hash_map<K,V,H> *h, const K& k)
{
return h ? h->get (k) : nullptr;
}
template<bool ggc, typename K, typename V, typename H>
inline V&
hash_map_safe_get_or_insert (hash_map<K,V,H> *&h, const K& k, bool *e = nullptr,
size_t size = default_hash_map_size)
{
return hash_map_maybe_create<ggc> (h, size)->get_or_insert (k, e);
}
template<bool ggc, typename K, typename V, typename H>
inline bool
hash_map_safe_put (hash_map<K,V,H> *&h, const K& k, const V& v,
size_t size = default_hash_map_size)
{
return hash_map_maybe_create<ggc> (h, size)->put (k, v);
}
# 596 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2
extern mem_alloc_description<mem_usage>& hash_table_usage (void);
extern void dump_hash_table_loc_statistics (void);
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
hash_table<Descriptor, Lazy, Allocator>::hash_table (size_t size, bool ggc,
bool sanitize_eq_and_hash,
bool gather_mem_stats
__attribute__ ((__unused__)),
mem_alloc_origin origin
) :
m_n_elements (0), m_n_deleted (0), m_searches (0), m_collisions (0),
m_ggc (ggc), m_sanitize_eq_and_hash (sanitize_eq_and_hash)
{
unsigned int size_prime_index;
size_prime_index = hash_table_higher_prime_index (size);
size = prime_tab[size_prime_index].prime;
if (m_gather_mem_stats)
hash_table_usage ().register_descriptor (this, origin, ggc
, 0,0,0);
if (Lazy)
m_entries = nullptr;
else
m_entries = alloc_entries (size );
m_size = size;
m_size_prime_index = size_prime_index;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
hash_table<Descriptor, Lazy, Allocator>::hash_table (const hash_table &h,
bool ggc,
bool sanitize_eq_and_hash,
bool gather_mem_stats
__attribute__ ((__unused__)),
mem_alloc_origin origin
) :
m_n_elements (h.m_n_elements), m_n_deleted (h.m_n_deleted),
m_searches (0), m_collisions (0), m_ggc (ggc),
m_sanitize_eq_and_hash (sanitize_eq_and_hash)
{
size_t size = h.m_size;
if (m_gather_mem_stats)
hash_table_usage ().register_descriptor (this, origin, ggc
, 0,0,0);
if (Lazy && h.m_entries == nullptr)
m_entries = nullptr;
else
{
value_type *nentries = alloc_entries (size );
for (size_t i = 0; i < size; ++i)
{
value_type &entry = h.m_entries[i];
if (is_deleted (entry))
mark_deleted (nentries[i]);
else if (!is_empty (entry))
new ((void*) (nentries + i)) value_type (entry);
}
m_entries = nentries;
}
m_size = size;
m_size_prime_index = h.m_size_prime_index;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
hash_table<Descriptor, Lazy, Allocator>::~hash_table ()
{
if (!Lazy || m_entries)
{
for (size_t i = m_size - 1; i < m_size; i--)
if (!is_empty (m_entries[i]) && !is_deleted (m_entries[i]))
Descriptor::remove (m_entries[i]);
if (!m_ggc)
Allocator <value_type> ::data_free (m_entries);
else
ggc_free (m_entries);
if (m_gather_mem_stats)
hash_table_usage ().release_instance_overhead (this,
sizeof (value_type)
* m_size, true);
}
else if (m_gather_mem_stats)
hash_table_usage ().unregister_descriptor (this);
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
inline typename hash_table<Descriptor, Lazy, Allocator>::value_type *
hash_table<Descriptor, Lazy,
Allocator>::alloc_entries (size_t n ) const
{
value_type *nentries;
if (m_gather_mem_stats)
hash_table_usage ().register_instance_overhead (sizeof (value_type) * n, this);
if (!m_ggc)
nentries = Allocator <value_type> ::data_alloc (n);
else
nentries = ::ggc_cleared_vec_alloc<value_type> (n );
((void)(!(nentries != nullptr) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 715, __FUNCTION__), 0 : 0));
if (!Descriptor::empty_zero_p)
for (size_t i = 0; i < n; i++)
mark_empty (nentries[i]);
return nentries;
}
# 730 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
typename hash_table<Descriptor, Lazy, Allocator>::value_type *
hash_table<Descriptor, Lazy,
Allocator>::find_empty_slot_for_expand (hashval_t hash)
{
hashval_t index = hash_table_mod1 (hash, m_size_prime_index);
size_t size = m_size;
value_type *slot = m_entries + index;
hashval_t hash2;
if (is_empty (*slot))
return slot;
((void)(!(!is_deleted (*slot)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 743, __FUNCTION__), 0 : 0));
hash2 = hash_table_mod2 (hash, m_size_prime_index);
for (;;)
{
index += hash2;
if (index >= size)
index -= size;
slot = m_entries + index;
if (is_empty (*slot))
return slot;
((void)(!(!is_deleted (*slot)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 755, __FUNCTION__), 0 : 0));
}
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
inline bool
hash_table<Descriptor, Lazy, Allocator>::too_empty_p (unsigned int elts)
{
return elts * 8 < m_size && m_size > 32;
}
# 776 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>::expand ()
{
value_type *oentries = m_entries;
unsigned int oindex = m_size_prime_index;
size_t osize = size ();
value_type *olimit = oentries + osize;
size_t elts = elements ();
unsigned int nindex;
size_t nsize;
if (elts * 2 > osize || too_empty_p (elts))
{
nindex = hash_table_higher_prime_index (elts * 2);
nsize = prime_tab[nindex].prime;
}
else
{
nindex = oindex;
nsize = osize;
}
value_type *nentries = alloc_entries (nsize);
if (m_gather_mem_stats)
hash_table_usage ().release_instance_overhead (this, sizeof (value_type)
* osize);
m_entries = nentries;
m_size = nsize;
m_size_prime_index = nindex;
m_n_elements -= m_n_deleted;
m_n_deleted = 0;
value_type *p = oentries;
do
{
value_type &x = *p;
if (!is_empty (x) && !is_deleted (x))
{
value_type *q = find_empty_slot_for_expand (Descriptor::hash (x));
new ((void*) q) value_type (x);
}
p++;
}
while (p < olimit);
if (!m_ggc)
Allocator <value_type> ::data_free (oentries);
else
ggc_free (oentries);
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>::empty_slow ()
{
size_t size = m_size;
size_t nsize = size;
value_type *entries = m_entries;
for (size_t i = size - 1; i < size; i--)
if (!is_empty (entries[i]) && !is_deleted (entries[i]))
Descriptor::remove (entries[i]);
if (size > 1024*1024 / sizeof (value_type))
nsize = 1024 / sizeof (value_type);
else if (too_empty_p (m_n_elements))
nsize = m_n_elements * 2;
if (nsize != size)
{
unsigned int nindex = hash_table_higher_prime_index (nsize);
nsize = prime_tab[nindex].prime;
if (!m_ggc)
Allocator <value_type> ::data_free (m_entries);
else
ggc_free (m_entries);
m_entries = alloc_entries (nsize);
m_size = nsize;
m_size_prime_index = nindex;
}
else if (Descriptor::empty_zero_p)
memset ((void *) entries, 0, size * sizeof (value_type));
else
for (size_t i = 0; i < size; i++)
mark_empty (entries[i]);
m_n_deleted = 0;
m_n_elements = 0;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>::clear_slot (value_type *slot)
{
((void)(!(!(slot < m_entries || slot >= m_entries + size () || is_empty (*slot) || is_deleted (*slot))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 890, __FUNCTION__), 0 : 0))
;
Descriptor::remove (*slot);
mark_deleted (*slot);
m_n_deleted++;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
typename hash_table<Descriptor, Lazy, Allocator>::value_type &
hash_table<Descriptor, Lazy, Allocator>
::find_with_hash (const compare_type &comparable, hashval_t hash)
{
m_searches++;
size_t size = m_size;
hashval_t index = hash_table_mod1 (hash, m_size_prime_index);
if (Lazy && m_entries == nullptr)
m_entries = alloc_entries (size);
if (m_sanitize_eq_and_hash)
verify (comparable, hash);
value_type *entry = &m_entries[index];
if (is_empty (*entry)
|| (!is_deleted (*entry) && Descriptor::equal (*entry, comparable)))
return *entry;
hashval_t hash2 = hash_table_mod2 (hash, m_size_prime_index);
for (;;)
{
m_collisions++;
index += hash2;
if (index >= size)
index -= size;
entry = &m_entries[index];
if (is_empty (*entry)
|| (!is_deleted (*entry) && Descriptor::equal (*entry, comparable)))
return *entry;
}
}
# 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
typename hash_table<Descriptor, Lazy, Allocator>::value_type *
hash_table<Descriptor, Lazy, Allocator>
::find_slot_with_hash (const compare_type &comparable, hashval_t hash,
enum insert_option insert)
{
if (Lazy && m_entries == nullptr)
{
if (insert == INSERT)
m_entries = alloc_entries (m_size);
else
return nullptr;
}
if (insert == INSERT && m_size * 3 <= m_n_elements * 4)
expand ();
if (m_sanitize_eq_and_hash)
verify (comparable, hash);
m_searches++;
value_type *first_deleted_slot = nullptr;
hashval_t index = hash_table_mod1 (hash, m_size_prime_index);
hashval_t hash2 = hash_table_mod2 (hash, m_size_prime_index);
value_type *entry = &m_entries[index];
size_t size = m_size;
if (is_empty (*entry))
goto empty_entry;
else if (is_deleted (*entry))
first_deleted_slot = &m_entries[index];
else if (Descriptor::equal (*entry, comparable))
return &m_entries[index];
for (;;)
{
m_collisions++;
index += hash2;
if (index >= size)
index -= size;
entry = &m_entries[index];
if (is_empty (*entry))
goto empty_entry;
else if (is_deleted (*entry))
{
if (!first_deleted_slot)
first_deleted_slot = &m_entries[index];
}
else if (Descriptor::equal (*entry, comparable))
return &m_entries[index];
}
empty_entry:
if (insert == NO_INSERT)
return nullptr;
if (first_deleted_slot)
{
m_n_deleted--;
mark_empty (*first_deleted_slot);
return first_deleted_slot;
}
m_n_elements++;
return &m_entries[index];
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>
::verify (const compare_type &comparable, hashval_t hash)
{
for (size_t i = 0; i < ((hash_table_sanitize_eq_limit) < (m_size) ? (hash_table_sanitize_eq_limit) : (m_size)); i++)
{
value_type *entry = &m_entries[i];
if (!is_empty (*entry) && !is_deleted (*entry)
&& hash != Descriptor::hash (*entry)
&& Descriptor::equal (*entry, comparable))
hashtab_chk_error ();
}
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>
::remove_elt_with_hash (const compare_type &comparable, hashval_t hash)
{
value_type *slot = find_slot_with_hash (comparable, hash, NO_INSERT);
if (slot == nullptr)
return;
Descriptor::remove (*slot);
mark_deleted (*slot);
m_n_deleted++;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
template<typename Argument,
int (*Callback)
(typename hash_table<Descriptor, Lazy, Allocator>::value_type *slot,
Argument argument)>
void
hash_table<Descriptor, Lazy, Allocator>::traverse_noresize (Argument argument)
{
if (Lazy && m_entries == nullptr)
return;
value_type *slot = m_entries;
value_type *limit = slot + size ();
do
{
value_type &x = *slot;
if (!is_empty (x) && !is_deleted (x))
if (! Callback (slot, argument))
break;
}
while (++slot < limit);
}
template <typename Descriptor, bool Lazy,
template <typename Type> class Allocator>
template <typename Argument,
int (*Callback)
(typename hash_table<Descriptor, Lazy, Allocator>::value_type *slot,
Argument argument)>
void
hash_table<Descriptor, Lazy, Allocator>::traverse (Argument argument)
{
if (too_empty_p (elements ()) && (!Lazy || m_entries))
expand ();
traverse_noresize <Argument, Callback> (argument);
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
void
hash_table<Descriptor, Lazy, Allocator>::iterator::slide ()
{
for ( ; m_slot < m_limit; ++m_slot )
{
value_type &x = *m_slot;
if (!is_empty (x) && !is_deleted (x))
return;
}
m_slot = nullptr;
m_limit = nullptr;
}
template<typename Descriptor, bool Lazy,
template<typename Type> class Allocator>
inline typename hash_table<Descriptor, Lazy, Allocator>::iterator &
hash_table<Descriptor, Lazy, Allocator>::iterator::operator ++ ()
{
++m_slot;
slide ();
return *this;
}
# 1146 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h"
template<typename E>
static inline void
gt_ggc_mx (hash_table<E> *h)
{
typedef hash_table<E> table;
if (!((h->m_entries) != nullptr && ((void *) (h->m_entries)) != (void *) 1 && ! ggc_set_mark (h->m_entries)))
return;
for (size_t i = 0; i < h->m_size; i++)
{
if (table::is_empty (h->m_entries[i])
|| table::is_deleted (h->m_entries[i]))
continue;
E::ggc_maybe_mx (h->m_entries[i]);
}
}
template<typename D>
static inline void
hashtab_entry_note_pointers (void *obj, void *h, gt_pointer_operator op,
void *cookie)
{
hash_table<D> *map = static_cast<hash_table<D> *> (h);
((void)(!(map->m_entries == obj) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 1173, __FUNCTION__), 0 : 0));
for (size_t i = 0; i < map->m_size; i++)
{
typedef hash_table<D> table;
if (table::is_empty (map->m_entries[i])
|| table::is_deleted (map->m_entries[i]))
continue;
D::pch_nx (map->m_entries[i], op, cookie);
}
}
template<typename D>
static void
gt_pch_nx (hash_table<D> *h)
{
bool success
= gt_pch_note_object (h->m_entries, h, hashtab_entry_note_pointers<D>);
((void)(!(success) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 1191, __FUNCTION__), 0 : 0));
for (size_t i = 0; i < h->m_size; i++)
{
if (hash_table<D>::is_empty (h->m_entries[i])
|| hash_table<D>::is_deleted (h->m_entries[i]))
continue;
D::pch_nx (h->m_entries[i]);
}
}
template<typename D>
static inline void
gt_pch_nx (hash_table<D> *h, gt_pointer_operator op, void *cookie)
{
op (&h->m_entries, cookie);
}
template<typename H>
inline void
gt_cleare_cache (hash_table<H> *h)
{
typedef hash_table<H> table;
if (!h)
return;
for (typename table::iterator iter = h->begin (); iter != h->end (); ++iter)
if (!table::is_empty (*iter) && !table::is_deleted (*iter))
{
int res = H::keep_cache_entry (*iter);
if (res == 0)
h->clear_slot (&*iter);
else if (res != -1)
H::ggc_mx (*iter);
}
}
# 477 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" 1
# 34 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h"
template<typename KeyId, bool Lazy = false,
typename Traits = default_hash_traits<KeyId> >
class hash_set
{
public:
typedef typename Traits::value_type Key;
explicit hash_set (size_t n = 13, bool ggc = false )
: m_table (n, ggc, true, 0, HASH_SET_ORIGIN ) {}
static hash_set *
create_ggc (size_t n)
{
hash_set *set = ggc_alloc<hash_set> ();
new (set) hash_set (n, true);
return set;
}
bool add (const Key &k)
{
Key *e = m_table.find_slot_with_hash (k, Traits::hash (k), INSERT);
bool existed = !Traits::is_empty (*e);
if (!existed)
new (e) Key (k);
return existed;
}
bool contains (const Key &k)
{
if (Lazy)
return (m_table.find_slot_with_hash (k, Traits::hash (k), NO_INSERT)
!= nullptr);
Key &e = m_table.find_with_hash (k, Traits::hash (k));
return !Traits::is_empty (e);
}
void remove (const Key &k)
{
m_table.remove_elt_with_hash (k, Traits::hash (k));
}
template<typename Arg, bool (*f)(const typename Traits::value_type &, Arg)>
void traverse (Arg a) const
{
for (typename hash_table<Traits, Lazy>::iterator iter = m_table.begin ();
iter != m_table.end (); ++iter)
f (*iter, a);
}
size_t elements () const { return m_table.elements (); }
void empty () { m_table.empty (); }
bool is_empty () const { return m_table.is_empty (); }
class iterator
{
public:
explicit iterator (const typename hash_table<Traits,
Lazy>::iterator &iter) :
m_iter (iter) {}
iterator &operator++ ()
{
++m_iter;
return *this;
}
Key
operator* ()
{
return *m_iter;
}
bool
operator != (const iterator &other) const
{
return m_iter != other.m_iter;
}
private:
typename hash_table<Traits, Lazy>::iterator m_iter;
};
iterator begin () const { return iterator (m_table.begin ()); }
iterator end () const { return iterator (m_table.end ()); }
private:
template<typename T, typename U>
friend void gt_ggc_mx (hash_set<T, false, U> *);
template<typename T, typename U>
friend void gt_pch_nx (hash_set<T, false, U> *);
template<typename T, typename U>
friend void gt_pch_nx (hash_set<T, false, U> *, gt_pointer_operator, void *);
hash_table<Traits, Lazy> m_table;
};
# 161 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h"
template<typename T>
void
debug_helper (hash_set<T> &ref)
{
for (typename hash_set<T>::iterator it = ref.begin ();
it != ref.end (); ++it)
{
debug_slim (*it);
fputc ('\n',
# 169 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" 3 4
stderr
# 169 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h"
);
}
}
# 191 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h"
template<typename K, typename H>
static inline void
gt_ggc_mx (hash_set<K, false, H> *h)
{
gt_ggc_mx (&h->m_table);
}
template<typename K, typename H>
static inline void
gt_pch_nx (hash_set<K, false, H> *h)
{
gt_pch_nx (&h->m_table);
}
template<typename K, typename H>
static inline void
gt_pch_nx (hash_set<K, false, H> *h, gt_pointer_operator op, void *cookie)
{
op (&h->m_table.m_entries, cookie);
}
# 478 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" 1
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" 1
# 50 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
typedef unsigned int linenum_type;
typedef long long linenum_arith_t;
inline int compare (linenum_type lhs, linenum_type rhs)
{
linenum_arith_t diff = (linenum_arith_t)lhs - (linenum_arith_t)rhs;
if (diff)
return diff > 0 ? 1 : -1;
return 0;
}
enum lc_reason
{
LC_ENTER = 0,
LC_LEAVE,
LC_RENAME,
LC_RENAME_VERBATIM,
LC_ENTER_MACRO,
LC_HWM
};
# 291 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
typedef unsigned int location_t;
const unsigned int LINE_MAP_MAX_COLUMN_NUMBER = (1U << 12);
const location_t LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES = 0x50000000;
const location_t LINE_MAP_MAX_LOCATION_WITH_COLS = 0x60000000;
const location_t LINE_MAP_MAX_LOCATION = 0x70000000;
# 319 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
struct source_range
{
location_t m_start;
location_t m_finish;
static source_range from_location (location_t loc)
{
source_range result;
result.m_start = loc;
result.m_finish = loc;
return result;
}
static source_range from_locations (location_t start,
location_t finish)
{
source_range result;
result.m_start = start;
result.m_finish = finish;
return result;
}
};
typedef void *(*line_map_realloc) (void *, size_t);
typedef size_t (*line_map_round_alloc_size_func) (size_t);
# 384 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
struct line_map {
location_t start_location;
};
# 402 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
struct line_map_ordinary : public line_map {
enum lc_reason reason : 8;
unsigned char sysp;
unsigned int m_column_and_range_bits : 8;
# 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
unsigned int m_range_bits : 8;
const char *to_file;
linenum_type to_line;
location_t included_from;
};
const location_t MAX_LOCATION_T = 0x7FFFFFFF;
struct cpp_hashnode;
struct line_map_macro : public line_map {
unsigned int n_tokens;
struct cpp_hashnode *
macro;
# 527 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
location_t * macro_locations;
location_t expansion;
};
# 566 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
inline bool
IS_ORDINARY_LOC (location_t loc)
{
return loc < LINE_MAP_MAX_LOCATION;
}
inline bool
IS_ADHOC_LOC (location_t loc)
{
return loc > MAX_LOCATION_T;
}
inline bool
IS_MACRO_LOC (location_t loc)
{
return !IS_ORDINARY_LOC (loc) && !IS_ADHOC_LOC (loc);
}
inline bool
MAP_ORDINARY_P (const line_map *map)
{
return IS_ORDINARY_LOC (map->start_location);
}
bool
linemap_macro_expansion_map_p (const line_map *);
inline line_map_ordinary *
linemap_check_ordinary (line_map *map)
{
do { if (! (MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 604, __FUNCTION__); } while (0);
return (line_map_ordinary *)map;
}
inline const line_map_ordinary *
linemap_check_ordinary (const line_map *map)
{
do { if (! (MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 615, __FUNCTION__); } while (0);
return (const line_map_ordinary *)map;
}
inline line_map_macro *linemap_check_macro (line_map *map)
{
do { if (! (!MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 624, __FUNCTION__); } while (0);
return (line_map_macro *)map;
}
inline const line_map_macro *
linemap_check_macro (const line_map *map)
{
do { if (! (!MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 634, __FUNCTION__); } while (0);
return (const line_map_macro *)map;
}
inline location_t
MAP_START_LOCATION (const line_map *map)
{
return map->start_location;
}
inline linenum_type
ORDINARY_MAP_STARTING_LINE_NUMBER (const line_map_ordinary *ord_map)
{
return ord_map->to_line;
}
inline unsigned char
ORDINARY_MAP_IN_SYSTEM_HEADER_P (const line_map_ordinary *ord_map)
{
return ord_map->sysp;
}
inline const char *
ORDINARY_MAP_FILE_NAME (const line_map_ordinary *ord_map)
{
return ord_map->to_file;
}
inline cpp_hashnode *
MACRO_MAP_MACRO (const line_map_macro *macro_map)
{
return macro_map->macro;
}
inline unsigned int
MACRO_MAP_NUM_MACRO_TOKENS (const line_map_macro *macro_map)
{
return macro_map->n_tokens;
}
inline location_t *
MACRO_MAP_LOCATIONS (const line_map_macro *macro_map)
{
return macro_map->macro_locations;
}
inline location_t
MACRO_MAP_EXPANSION_POINT_LOCATION (const line_map_macro *macro_map)
{
return macro_map->expansion;
}
# 714 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
struct maps_info_ordinary {
line_map_ordinary * maps;
unsigned int allocated;
unsigned int used;
mutable unsigned int cache;
};
struct maps_info_macro {
line_map_macro * maps;
unsigned int allocated;
unsigned int used;
mutable unsigned int cache;
};
struct location_adhoc_data {
location_t locus;
source_range src_range;
void * data;
};
struct htab;
# 765 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
struct location_adhoc_data_map {
struct htab * htab;
location_t curr_loc;
unsigned int allocated;
struct location_adhoc_data *data;
};
class line_maps {
public:
~line_maps ();
maps_info_ordinary info_ordinary;
maps_info_macro info_macro;
unsigned int depth;
bool trace_includes;
location_t highest_location;
location_t highest_line;
unsigned int max_column_hint;
line_map_realloc reallocator;
line_map_round_alloc_size_func round_alloc_size;
struct location_adhoc_data_map location_adhoc_data_map;
location_t builtin_location;
bool seen_line_directive;
unsigned int default_range_bits;
unsigned int num_optimized_ranges;
unsigned int num_unoptimized_ranges;
};
inline unsigned int
LINEMAPS_ALLOCATED (const line_maps *set, bool map_kind)
{
if (map_kind)
return set->info_macro.allocated;
else
return set->info_ordinary.allocated;
}
inline unsigned int &
LINEMAPS_ALLOCATED (line_maps *set, bool map_kind)
{
if (map_kind)
return set->info_macro.allocated;
else
return set->info_ordinary.allocated;
}
inline unsigned int
LINEMAPS_USED (const line_maps *set, bool map_kind)
{
if (map_kind)
return set->info_macro.used;
else
return set->info_ordinary.used;
}
inline unsigned int &
LINEMAPS_USED (line_maps *set, bool map_kind)
{
if (map_kind)
return set->info_macro.used;
else
return set->info_ordinary.used;
}
inline unsigned int &
LINEMAPS_CACHE (const line_maps *set, bool map_kind)
{
if (map_kind)
return set->info_macro.cache;
else
return set->info_ordinary.cache;
}
inline line_map *
LINEMAPS_MAP_AT (const line_maps *set, bool map_kind, int index)
{
if (map_kind)
return &set->info_macro.maps[index];
else
return &set->info_ordinary.maps[index];
}
inline line_map *
LINEMAPS_LAST_MAP (const line_maps *set, bool map_kind)
{
return LINEMAPS_MAP_AT (set, map_kind,
LINEMAPS_USED (set, map_kind) - 1);
}
inline line_map *
LINEMAPS_LAST_ALLOCATED_MAP (const line_maps *set, bool map_kind)
{
return LINEMAPS_MAP_AT (set, map_kind,
LINEMAPS_ALLOCATED (set, map_kind) - 1);
}
inline line_map_ordinary *
LINEMAPS_ORDINARY_MAPS (const line_maps *set)
{
return set->info_ordinary.maps;
}
inline line_map_ordinary *
LINEMAPS_ORDINARY_MAP_AT (const line_maps *set, int index)
{
do { if (! (index >= 0 && (unsigned int)index < LINEMAPS_USED (set, false))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 919, __FUNCTION__); } while (0)
;
return (line_map_ordinary *)LINEMAPS_MAP_AT (set, false, index);
}
inline unsigned int
LINEMAPS_ORDINARY_ALLOCATED (const line_maps *set)
{
return LINEMAPS_ALLOCATED (set, false);
}
inline unsigned int
LINEMAPS_ORDINARY_USED (const line_maps *set)
{
return LINEMAPS_USED (set, false);
}
inline unsigned int &
LINEMAPS_ORDINARY_CACHE (const line_maps *set)
{
return LINEMAPS_CACHE (set, false);
}
inline line_map_ordinary *
LINEMAPS_LAST_ORDINARY_MAP (const line_maps *set)
{
return (line_map_ordinary *)LINEMAPS_LAST_MAP (set, false);
}
inline line_map_ordinary *
LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP (const line_maps *set)
{
return (line_map_ordinary *)LINEMAPS_LAST_ALLOCATED_MAP (set, false);
}
inline line_map_macro *
LINEMAPS_MACRO_MAPS (const line_maps *set)
{
return set->info_macro.maps;
}
inline line_map_macro *
LINEMAPS_MACRO_MAP_AT (const line_maps *set, int index)
{
do { if (! (index >= 0 && (unsigned int)index < LINEMAPS_USED (set, true))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 975, __FUNCTION__); } while (0)
;
return (line_map_macro *)LINEMAPS_MAP_AT (set, true, index);
}
inline unsigned int
LINEMAPS_MACRO_ALLOCATED (const line_maps *set)
{
return LINEMAPS_ALLOCATED (set, true);
}
inline unsigned int
LINEMAPS_MACRO_USED (const line_maps *set)
{
return LINEMAPS_USED (set, true);
}
inline unsigned int &
LINEMAPS_MACRO_CACHE (const line_maps *set)
{
return LINEMAPS_CACHE (set, true);
}
inline line_map_macro *
LINEMAPS_LAST_MACRO_MAP (const line_maps *set)
{
return (line_map_macro *)LINEMAPS_LAST_MAP (set, true);
}
inline location_t
LINEMAPS_MACRO_LOWEST_LOCATION (const line_maps *set)
{
return LINEMAPS_MACRO_USED (set)
? MAP_START_LOCATION (LINEMAPS_LAST_MACRO_MAP (set))
: MAX_LOCATION_T + 1;
}
inline line_map_macro *
LINEMAPS_LAST_ALLOCATED_MACRO_MAP (const line_maps *set)
{
return (line_map_macro *)LINEMAPS_LAST_ALLOCATED_MAP (set, true);
}
extern location_t get_combined_adhoc_loc (line_maps *, location_t,
source_range, void *);
extern void *get_data_from_adhoc_loc (const line_maps *, location_t);
extern location_t get_location_from_adhoc_loc (const line_maps *,
location_t);
extern source_range get_range_from_loc (line_maps *set, location_t loc);
bool
pure_location_p (line_maps *set, location_t loc);
extern location_t get_pure_location (line_maps *set, location_t loc);
inline location_t
COMBINE_LOCATION_DATA (class line_maps *set,
location_t loc,
source_range src_range,
void *block)
{
return get_combined_adhoc_loc (set, loc, src_range, block);
}
extern void rebuild_location_adhoc_htab (class line_maps *);
extern void linemap_init (class line_maps *set,
location_t builtin_location);
extern void linemap_check_files_exited (class line_maps *);
extern location_t linemap_line_start
(class line_maps *set, linenum_type to_line, unsigned int max_column_hint);
# 1092 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
extern const line_map *linemap_add
(class line_maps *, enum lc_reason, unsigned int sysp,
const char *to_file, linenum_type to_line);
extern const line_map *linemap_lookup
(const line_maps *, location_t);
bool linemap_tracks_macro_expansion_locs_p (class line_maps *);
const char* linemap_map_get_macro_name (const line_map_macro *);
# 1121 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
int linemap_location_in_system_header_p (class line_maps *,
location_t);
bool linemap_location_from_macro_expansion_p (const line_maps *,
location_t);
bool linemap_location_from_macro_definition_p (class line_maps *,
location_t);
extern location_t linemap_macro_map_loc_unwind_toward_spelling
(line_maps *set, const line_map_macro *macro_map, location_t location);
const location_t RESERVED_LOCATION_COUNT = 2;
inline linenum_type
SOURCE_LINE (const line_map_ordinary *ord_map, location_t loc)
{
return ((loc - ord_map->start_location)
>> ord_map->m_column_and_range_bits) + ord_map->to_line;
}
inline linenum_type
SOURCE_COLUMN (const line_map_ordinary *ord_map, location_t loc)
{
return ((loc - ord_map->start_location)
& ((1 << ord_map->m_column_and_range_bits) - 1)) >> ord_map->m_range_bits;
}
inline location_t
linemap_included_from (const line_map_ordinary *ord_map)
{
return ord_map->included_from;
}
const line_map_ordinary *linemap_included_from_linemap
(line_maps *set, const line_map_ordinary *map);
inline bool
MAIN_FILE_P (const line_map_ordinary *ord_map)
{
return ord_map->included_from == 0;
}
extern location_t
linemap_position_for_column (class line_maps *, unsigned int);
location_t
linemap_position_for_line_and_column (line_maps *set,
const line_map_ordinary *,
linenum_type, unsigned int);
location_t
linemap_position_for_loc_and_offset (class line_maps *set,
location_t loc,
unsigned int offset);
inline const char *
LINEMAP_FILE (const line_map_ordinary *ord_map)
{
return ord_map->to_file;
}
inline linenum_type
LINEMAP_LINE (const line_map_ordinary *ord_map)
{
return ord_map->to_line;
}
inline unsigned char
LINEMAP_SYSP (const line_map_ordinary *ord_map)
{
return ord_map->sysp;
}
int linemap_compare_locations (class line_maps *set,
location_t pre,
location_t post);
inline bool
linemap_location_before_p (class line_maps *set,
location_t loc_a,
location_t loc_b)
{
return linemap_compare_locations (set, loc_a, loc_b) >= 0;
}
typedef struct
{
const char *file;
int line;
int column;
void *data;
bool sysp;
} expanded_location;
class range_label;
# 1279 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
enum range_display_kind
{
SHOW_RANGE_WITH_CARET,
SHOW_RANGE_WITHOUT_CARET,
SHOW_LINES_WITHOUT_RANGE
};
struct location_range
{
location_t m_loc;
enum range_display_kind m_range_display_kind;
const range_label *m_label;
};
# 1320 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
template <typename T, int NUM_EMBEDDED>
class semi_embedded_vec
{
public:
semi_embedded_vec ();
~semi_embedded_vec ();
unsigned int count () const { return m_num; }
T& operator[] (int idx);
const T& operator[] (int idx) const;
void push (const T&);
void truncate (int len);
private:
int m_num;
T m_embedded[NUM_EMBEDDED];
int m_alloc;
T *m_extra;
};
template <typename T, int NUM_EMBEDDED>
semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec ()
: m_num (0), m_alloc (0), m_extra (nullptr)
{
}
template <typename T, int NUM_EMBEDDED>
semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec ()
{
free ((void*) (m_extra));
}
template <typename T, int NUM_EMBEDDED>
T&
semi_embedded_vec<T, NUM_EMBEDDED>::operator[] (int idx)
{
do { if (! (idx < m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1364, __FUNCTION__); } while (0);
if (idx < NUM_EMBEDDED)
return m_embedded[idx];
else
{
do { if (! (m_extra != nullptr)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1369, __FUNCTION__); } while (0);
return m_extra[idx - NUM_EMBEDDED];
}
}
template <typename T, int NUM_EMBEDDED>
const T&
semi_embedded_vec<T, NUM_EMBEDDED>::operator[] (int idx) const
{
do { if (! (idx < m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1380, __FUNCTION__); } while (0);
if (idx < NUM_EMBEDDED)
return m_embedded[idx];
else
{
do { if (! (m_extra != nullptr)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1385, __FUNCTION__); } while (0);
return m_extra[idx - NUM_EMBEDDED];
}
}
template <typename T, int NUM_EMBEDDED>
void
semi_embedded_vec<T, NUM_EMBEDDED>::push (const T& value)
{
int idx = m_num++;
if (idx < NUM_EMBEDDED)
m_embedded[idx] = value;
else
{
idx -= NUM_EMBEDDED;
if (nullptr == m_extra)
{
do { if (! (m_alloc == 0)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1405, __FUNCTION__); } while (0);
m_alloc = 16;
m_extra = ((T *) xmalloc (sizeof (T) * (m_alloc)));
}
else if (idx >= m_alloc)
{
do { if (! (m_alloc > 0)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1411, __FUNCTION__); } while (0);
m_alloc *= 2;
m_extra = ((T *) xrealloc ((void *) (m_extra), sizeof (T) * (m_alloc)));
}
do { if (! (m_extra)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1415, __FUNCTION__); } while (0);
do { if (! (idx < m_alloc)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1416, __FUNCTION__); } while (0);
m_extra[idx] = value;
}
}
template <typename T, int NUM_EMBEDDED>
void
semi_embedded_vec<T, NUM_EMBEDDED>::truncate (int len)
{
do { if (! (len <= m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1427, __FUNCTION__); } while (0);
m_num = len;
}
class fixit_hint;
class diagnostic_path;
# 1609 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
class rich_location
{
public:
rich_location (line_maps *set, location_t loc,
const range_label *label = nullptr);
~rich_location ();
location_t get_loc () const { return get_loc (0); }
location_t get_loc (unsigned int idx) const;
void
add_range (location_t loc,
enum range_display_kind range_display_kind
= SHOW_RANGE_WITHOUT_CARET,
const range_label *label = nullptr);
void
set_range (unsigned int idx, location_t loc,
enum range_display_kind range_display_kind);
unsigned int get_num_locations () const { return m_ranges.count (); }
const location_range *get_range (unsigned int idx) const;
location_range *get_range (unsigned int idx);
expanded_location get_expanded_location (unsigned int idx);
void
override_column (int column);
void
add_fixit_insert_before (const char *new_content);
void
add_fixit_insert_before (location_t where,
const char *new_content);
void
add_fixit_insert_after (const char *new_content);
void
add_fixit_insert_after (location_t where,
const char *new_content);
void
add_fixit_remove ();
void
add_fixit_remove (location_t where);
void
add_fixit_remove (source_range src_range);
void
add_fixit_replace (const char *new_content);
void
add_fixit_replace (location_t where,
const char *new_content);
void
add_fixit_replace (source_range src_range,
const char *new_content);
unsigned int get_num_fixit_hints () const { return m_fixit_hints.count (); }
fixit_hint *get_fixit_hint (int idx) const { return m_fixit_hints[idx]; }
fixit_hint *get_last_fixit_hint () const;
bool seen_impossible_fixit_p () const { return m_seen_impossible_fixit; }
# 1718 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
void fixits_cannot_be_auto_applied ()
{
m_fixits_cannot_be_auto_applied = true;
}
bool fixits_can_be_auto_applied_p () const
{
return !m_fixits_cannot_be_auto_applied;
}
const diagnostic_path *get_path () const { return m_path; }
void set_path (const diagnostic_path *path) { m_path = path; }
private:
bool reject_impossible_fixit (location_t where);
void stop_supporting_fixits ();
void maybe_add_fixit (location_t start,
location_t next_loc,
const char *new_content);
public:
static const int STATICALLY_ALLOCATED_RANGES = 3;
protected:
line_maps *m_line_table;
semi_embedded_vec <location_range, STATICALLY_ALLOCATED_RANGES> m_ranges;
int m_column_override;
bool m_have_expanded_location;
expanded_location m_expanded_location;
static const int MAX_STATIC_FIXIT_HINTS = 2;
semi_embedded_vec <fixit_hint *, MAX_STATIC_FIXIT_HINTS> m_fixit_hints;
bool m_seen_impossible_fixit;
bool m_fixits_cannot_be_auto_applied;
const diagnostic_path *m_path;
};
class label_text
{
public:
label_text ()
: m_buffer (nullptr), m_caller_owned (false)
{}
void maybe_free ()
{
if (m_caller_owned)
free (m_buffer);
}
static label_text borrow (const char *buffer)
{
return label_text (const_cast <char *> (buffer), false);
}
static label_text take (char *buffer)
{
return label_text (buffer, true);
}
char *take_or_copy ()
{
if (m_caller_owned)
return m_buffer;
else
return xstrdup (m_buffer);
}
char *m_buffer;
bool m_caller_owned;
private:
label_text (char *buffer, bool owned)
: m_buffer (buffer), m_caller_owned (owned)
{}
};
# 1823 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
class range_label
{
public:
virtual ~range_label () {}
virtual label_text get_text (unsigned range_idx) const = 0;
};
# 1848 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
class fixit_hint
{
public:
fixit_hint (location_t start,
location_t next_loc,
const char *new_content);
~fixit_hint () { free (m_bytes); }
bool affects_line_p (const char *file, int line) const;
location_t get_start_loc () const { return m_start; }
location_t get_next_loc () const { return m_next_loc; }
bool maybe_append (location_t start,
location_t next_loc,
const char *new_content);
const char *get_string () const { return m_bytes; }
size_t get_length () const { return m_len; }
bool insertion_p () const { return m_start == m_next_loc; }
bool ends_with_newline_p () const;
private:
location_t m_start;
location_t m_next_loc;
char *m_bytes;
size_t m_len;
};
enum location_resolution_kind
{
LRK_MACRO_EXPANSION_POINT,
LRK_SPELLING_LOCATION,
LRK_MACRO_DEFINITION_LOCATION
};
# 1940 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
location_t linemap_resolve_location (class line_maps *,
location_t loc,
enum location_resolution_kind lrk,
const line_map_ordinary **loc_map);
# 1952 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
location_t linemap_unwind_toward_expansion (class line_maps *,
location_t loc,
const line_map **loc_map);
# 1970 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h"
location_t linemap_unwind_to_first_non_reserved_loc (class line_maps *,
location_t loc,
const line_map **map);
expanded_location linemap_expand_location (class line_maps *,
const line_map *,
location_t loc);
struct linemap_stats
{
long num_ordinary_maps_allocated;
long num_ordinary_maps_used;
long ordinary_maps_allocated_size;
long ordinary_maps_used_size;
long num_expanded_macros;
long num_macro_tokens;
long num_macro_maps_used;
long macro_maps_allocated_size;
long macro_maps_used_size;
long macro_maps_locations_size;
long duplicated_macro_maps_locations_size;
long adhoc_table_size;
long adhoc_table_entries_used;
};
bool linemap_get_file_highest_location (class line_maps * set,
const char *file_name,
location_t *loc);
void linemap_get_statistics (line_maps *, struct linemap_stats *);
void linemap_dump_location (line_maps *, location_t, FILE *);
void linemap_dump (FILE *, line_maps *, unsigned, bool);
void line_table_dump (FILE *, line_maps *, unsigned int, unsigned int);
enum location_aspect
{
LOCATION_ASPECT_CARET,
LOCATION_ASPECT_START,
LOCATION_ASPECT_FINISH
};
extern expanded_location
linemap_client_expand_location_to_spelling_point (location_t,
enum location_aspect);
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" 2
extern class line_maps *line_table;
extern class line_maps *saved_line_table;
# 37 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h"
static_assert ((((location_t) 1) < RESERVED_LOCATION_COUNT), "BUILTINS_LOCATION < RESERVED_LOCATION_COUNT");
extern bool is_location_from_builtin_token (location_t);
extern expanded_location expand_location (location_t);
extern int location_compute_display_column (expanded_location exploc,
int tabstop);
class char_span
{
public:
char_span (const char *ptr, size_t n_elts) : m_ptr (ptr), m_n_elts (n_elts) {}
operator bool() const { return m_ptr; }
size_t length () const { return m_n_elts; }
const char *get_buffer () const { return m_ptr; }
char operator[] (int idx) const
{
((void)(!(idx >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 64, __FUNCTION__), 0 : 0));
((void)(!((size_t)idx < m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 65, __FUNCTION__), 0 : 0));
return m_ptr[idx];
}
char_span subspan (int offset, int n_elts) const
{
((void)(!(offset >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 71, __FUNCTION__), 0 : 0));
((void)(!(offset < (int)m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 72, __FUNCTION__), 0 : 0));
((void)(!(n_elts >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 73, __FUNCTION__), 0 : 0));
((void)(!(offset + n_elts <= (int)m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 74, __FUNCTION__), 0 : 0));
return char_span (m_ptr + offset, n_elts);
}
char *xstrdup () const
{
return ::xstrndup (m_ptr, m_n_elts);
}
private:
const char *m_ptr;
size_t m_n_elts;
};
extern char_span location_get_source_line (const char *file_path, int line);
extern bool location_missing_trailing_newline (const char *file_path);
extern expanded_location
expand_location_to_spelling_point (location_t,
enum location_aspect aspect
= LOCATION_ASPECT_CARET);
extern location_t expansion_point_location_if_in_system_header (location_t);
extern location_t expansion_point_location (location_t);
extern location_t input_location;
# 122 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h"
static inline int
in_system_header_at (location_t loc)
{
return linemap_location_in_system_header_p (line_table, loc);
}
static inline bool
from_macro_expansion_at (location_t loc)
{
return linemap_location_from_macro_expansion_p (line_table, loc);
}
static inline bool
from_macro_definition_at (location_t loc)
{
return linemap_location_from_macro_definition_p (line_table, loc);
}
static inline location_t
get_pure_location (location_t loc)
{
return get_pure_location (line_table, loc);
}
static inline location_t
get_start (location_t loc)
{
return get_range_from_loc (line_table, loc).m_start;
}
static inline location_t
get_finish (location_t loc)
{
return get_range_from_loc (line_table, loc).m_finish;
}
extern location_t make_location (location_t caret,
location_t start, location_t finish);
extern location_t make_location (location_t caret, source_range src_range);
void dump_line_table_statistics (void);
void dump_location_info (FILE *stream);
void diagnostics_file_cache_fini (void);
void diagnostics_file_cache_forcibly_evict_file (const char *file_path);
class string_concat
{
public:
string_concat (int num, location_t *locs);
int m_num;
location_t * m_locs;
};
struct location_hash : int_hash <location_t, ((location_t) 0)> { };
class string_concat_db
{
public:
string_concat_db ();
void record_string_concatenation (int num, location_t *locs);
bool get_string_concatenation (location_t loc,
int *out_num,
location_t **out_locs);
private:
static location_t get_key_loc (location_t loc);
friend void ::gt_ggc_mx_string_concat_db (void *x_p);
friend void ::gt_pch_nx_string_concat_db (void *x_p);
friend void ::gt_pch_p_16string_concat_db (void *this_obj, void *x_p,
gt_pointer_operator op,
void *cookie);
hash_map <location_hash, string_concat *> *m_table;
};
# 479 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h" 1
# 150 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h"
template <typename T>
struct is_a_helper
{
template <typename U>
static inline bool test (U *p);
template <typename U>
static inline T cast (U *p);
};
# 168 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h"
template <typename T>
template <typename U>
inline T
is_a_helper <T>::cast (U *p)
{
return reinterpret_cast <T> (p);
}
# 183 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h"
template <typename T, typename U>
inline bool
is_a (U *p)
{
return is_a_helper<T>::test (p);
}
template <typename T, typename U>
inline T
as_a (U *p)
{
((void)(!(is_a <T> (p)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h", 197, __FUNCTION__), 0 : 0));
return is_a_helper <T>::cast (p);
}
template <typename T, typename U>
inline T
safe_as_a (U *p)
{
if (p)
{
((void)(!(is_a <T> (p)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h", 210, __FUNCTION__), 0 : 0));
return is_a_helper <T>::cast (p);
}
else
return nullptr;
}
template <typename T, typename U>
inline T
dyn_cast (U *p)
{
if (is_a <T> (p))
return is_a_helper <T>::cast (p);
else
return static_cast <T> (0);
}
template <typename T, typename U>
inline T
safe_dyn_cast (U *p)
{
return p ? dyn_cast <T> (p) : 0;
}
# 480 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/memory-block.h" 1
# 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/memory-block.h"
class memory_block_pool
{
public:
static const size_t block_size = 64 * 1024;
static const size_t freelist_size = 1024 * 1024 / block_size;
memory_block_pool ();
static inline void *allocate () __attribute__ ((__malloc__));
static inline void release (void *);
static void trim (int nblocks = freelist_size);
void reduce_free_list (int);
private:
static memory_block_pool instance;
struct block_list
{
block_list *m_next;
};
block_list *m_blocks;
};
inline void *
memory_block_pool::allocate ()
{
if (instance.m_blocks == nullptr)
return ((char *) xmalloc (sizeof (char) * (block_size)));
void *result = instance.m_blocks;
instance.m_blocks = instance.m_blocks->m_next;
;
return result;
}
inline void
memory_block_pool::release (void *uncast_block)
{
block_list *block = new (uncast_block) block_list;
block->m_next = instance.m_blocks;
instance.m_blocks = block;
;
}
extern void *mempool_obstack_chunk_alloc (size_t) __attribute__ ((__malloc__));
extern void mempool_obstack_chunk_free (void *);
# 481 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" 1
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" 1
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
struct function;
struct profile_count;
class sreal;
enum profile_quality {
UNINITIALIZED_PROFILE,
GUESSED_LOCAL,
GUESSED_GLOBAL0,
GUESSED_GLOBAL0_ADJUSTED,
GUESSED,
AFDO,
ADJUSTED,
PRECISE
};
extern const char *profile_quality_as_string (enum profile_quality);
extern bool parse_profile_quality (const char *value,
profile_quality *quality);
bool slow_safe_scale_64bit (uint64_t a, uint64_t b, uint64_t c, uint64_t *res);
inline bool
safe_scale_64bit (uint64_t a, uint64_t b, uint64_t c, uint64_t *res)
{
uint64_t tmp;
if (!__builtin_mul_overflow (a, b, &tmp)
&& !__builtin_add_overflow (tmp, c/2, &tmp))
{
*res = tmp / c;
return true;
}
if (c == 1)
{
*res = (uint64_t) -1;
return false;
}
# 106 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
return slow_safe_scale_64bit (a, b, c, res);
}
# 146 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
class profile_probability
{
static const int n_bits = 29;
static const uint32_t max_probability = (uint32_t) 1 << (n_bits - 2);
static const uint32_t uninitialized_probability
= ((uint32_t) 1 << (n_bits - 1)) - 1;
uint32_t m_val : 29;
enum profile_quality m_quality : 3;
friend struct profile_count;
public:
profile_probability (): m_val (uninitialized_probability),
m_quality (GUESSED)
{}
profile_probability (uint32_t val, profile_quality quality):
m_val (val), m_quality (quality)
{}
static profile_probability never ()
{
profile_probability ret;
ret.m_val = 0;
ret.m_quality = PRECISE;
return ret;
}
static profile_probability guessed_never ()
{
profile_probability ret;
ret.m_val = 0;
ret.m_quality = GUESSED;
return ret;
}
static profile_probability very_unlikely ()
{
profile_probability r = guessed_always ().apply_scale (1, 2000);
r.m_val--;
return r;
}
static profile_probability unlikely ()
{
profile_probability r = guessed_always ().apply_scale (1, 5);
r.m_val--;
return r;
}
static profile_probability even ()
{
return guessed_always ().apply_scale (1, 2);
}
static profile_probability very_likely ()
{
return always () - very_unlikely ();
}
static profile_probability likely ()
{
return always () - unlikely ();
}
static profile_probability guessed_always ()
{
profile_probability ret;
ret.m_val = max_probability;
ret.m_quality = GUESSED;
return ret;
}
static profile_probability always ()
{
profile_probability ret;
ret.m_val = max_probability;
ret.m_quality = PRECISE;
return ret;
}
static profile_probability uninitialized ()
{
profile_probability c;
c.m_val = uninitialized_probability;
c.m_quality = GUESSED;
return c;
}
bool initialized_p () const
{
return m_val != uninitialized_probability;
}
bool reliable_p () const
{
return m_quality >= ADJUSTED;
}
static profile_probability from_reg_br_prob_base (int v)
{
profile_probability ret;
((void)(!(v >= 0 && v <= 10000) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 259, __FUNCTION__), 0 : 0));
ret.m_val = (((v * (uint64_t) max_probability) + (10000) / 2) / (10000));
ret.m_quality = GUESSED;
return ret;
}
profile_probability adjusted () const
{
profile_probability ret = *this;
if (!initialized_p ())
return *this;
ret.m_quality = ADJUSTED;
return ret;
}
int to_reg_br_prob_base () const
{
((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 277, __FUNCTION__), 0 : 0));
return (((m_val * (uint64_t) 10000) + (max_probability) / 2) / (max_probability));
}
static profile_probability from_reg_br_prob_note (int v)
{
profile_probability ret;
ret.m_val = ((unsigned int)v) / 8;
ret.m_quality = (enum profile_quality)(v & 7);
return ret;
}
int to_reg_br_prob_note () const
{
((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 292, __FUNCTION__), 0 : 0));
int ret = m_val * 8 + m_quality;
((void)(!(from_reg_br_prob_note (ret) == *this) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 294, __FUNCTION__), 0 : 0));
return ret;
}
static profile_probability probability_in_gcov_type
(gcov_type val1, gcov_type val2)
{
profile_probability ret;
((void)(!(val1 >= 0 && val2 > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 303, __FUNCTION__), 0 : 0));
if (val1 > val2)
ret.m_val = max_probability;
else
{
uint64_t tmp;
safe_scale_64bit (val1, max_probability, val2, &tmp);
((void)(!(tmp <= max_probability) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 310, __FUNCTION__), 0 : 0));
ret.m_val = tmp;
}
ret.m_quality = PRECISE;
return ret;
}
bool operator== (const profile_probability &other) const
{
return m_val == other.m_val && m_quality == other.m_quality;
}
profile_probability operator+ (const profile_probability &other) const
{
if (other == never ())
return *this;
if (*this == never ())
return other;
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
profile_probability ret;
ret.m_val = (((uint32_t)(m_val + other.m_val)) < (max_probability) ? ((uint32_t)(m_val + other.m_val)) : (max_probability));
ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
return ret;
}
profile_probability &operator+= (const profile_probability &other)
{
if (other == never ())
return *this;
if (*this == never ())
{
*this = other;
return *this;
}
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
m_val = (((uint32_t)(m_val + other.m_val)) < (max_probability) ? ((uint32_t)(m_val + other.m_val)) : (max_probability));
m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
}
return *this;
}
profile_probability operator- (const profile_probability &other) const
{
if (*this == never ()
|| other == never ())
return *this;
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
profile_probability ret;
ret.m_val = m_val >= other.m_val ? m_val - other.m_val : 0;
ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
return ret;
}
profile_probability &operator-= (const profile_probability &other)
{
if (*this == never ()
|| other == never ())
return *this;
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
m_val = m_val >= other.m_val ? m_val - other.m_val : 0;
m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
}
return *this;
}
profile_probability operator* (const profile_probability &other) const
{
if (*this == never ()
|| other == never ())
return never ();
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
profile_probability ret;
ret.m_val = ((((uint64_t)m_val * other.m_val) + (max_probability) / 2) / (max_probability));
ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED));
return ret;
}
profile_probability &operator*= (const profile_probability &other)
{
if (*this == never ()
|| other == never ())
return *this = never ();
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
m_val = ((((uint64_t)m_val * other.m_val) + (max_probability) / 2) / (max_probability));
m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED));
}
return *this;
}
profile_probability operator/ (const profile_probability &other) const
{
if (*this == never ())
return never ();
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
profile_probability ret;
if (m_val >= other.m_val)
{
ret.m_val = max_probability;
ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (GUESSED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (GUESSED))
;
return ret;
}
else if (!m_val)
ret.m_val = 0;
else
{
((void)(!(other.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 432, __FUNCTION__), 0 : 0));
ret.m_val = ((((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) < (max_probability) ? (((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) : (max_probability))
;
}
ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED));
return ret;
}
profile_probability &operator/= (const profile_probability &other)
{
if (*this == never ())
return *this = never ();
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
if (m_val > other.m_val)
{
m_val = max_probability;
m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (GUESSED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (GUESSED))
;
return *this;
}
else if (!m_val)
;
else
{
((void)(!(other.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 462, __FUNCTION__), 0 : 0));
m_val = ((((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) < (max_probability) ? (((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) : (max_probability))
;
}
m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED));
}
return *this;
}
# 487 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
profile_probability split (const profile_probability &cprob)
{
profile_probability ret = *this * cprob;
if (!(*this == always ()))
*this = (*this - ret) / ret.invert ();
return ret;
}
gcov_type apply (gcov_type val) const
{
if (*this == uninitialized ())
return val / 2;
return (((val * m_val) + (max_probability) / 2) / (max_probability));
}
profile_probability invert () const
{
return always() - *this;
}
profile_probability guessed () const
{
profile_probability ret = *this;
ret.m_quality = GUESSED;
return ret;
}
profile_probability afdo () const
{
profile_probability ret = *this;
ret.m_quality = AFDO;
return ret;
}
profile_probability apply_scale (int64_t num, int64_t den) const
{
if (*this == never ())
return *this;
if (!initialized_p ())
return uninitialized ();
profile_probability ret;
uint64_t tmp;
safe_scale_64bit (m_val, num, den, &tmp);
ret.m_val = ((tmp) < (max_probability) ? (tmp) : (max_probability));
ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED));
return ret;
}
# 560 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
bool probably_reliable_p () const
{
if (m_quality >= ADJUSTED)
return true;
if (!initialized_p ())
return false;
return m_val < max_probability / 100
|| m_val > max_probability - max_probability / 100;
}
bool verify () const
{
((void)(!(m_quality != UNINITIALIZED_PROFILE) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 573, __FUNCTION__), 0 : 0));
if (m_val == uninitialized_probability)
return m_quality == GUESSED;
else if (m_quality < GUESSED)
return false;
return m_val <= max_probability;
}
bool operator< (const profile_probability &other) const
{
return initialized_p () && other.initialized_p () && m_val < other.m_val;
}
bool operator> (const profile_probability &other) const
{
return initialized_p () && other.initialized_p () && m_val > other.m_val;
}
bool operator<= (const profile_probability &other) const
{
return initialized_p () && other.initialized_p () && m_val <= other.m_val;
}
bool operator>= (const profile_probability &other) const
{
return initialized_p () && other.initialized_p () && m_val >= other.m_val;
}
uint32_t value () const { return m_val; }
enum profile_quality quality () const { return m_quality; }
void dump (FILE *f) const;
void debug () const;
bool differs_from_p (profile_probability other) const;
bool differs_lot_from_p (profile_probability other) const;
profile_probability combine_with_count (profile_count count1,
profile_probability other,
profile_count count2) const;
sreal to_sreal () const;
static profile_probability stream_in (class lto_input_block *);
void stream_out (struct output_block *);
void stream_out (struct lto_output_stream *);
};
# 690 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
struct profile_count
{
public:
static const int n_bits = 61;
static const uint64_t max_count = ((uint64_t) 1 << n_bits) - 2;
private:
static const uint64_t uninitialized_count = ((uint64_t) 1 << n_bits) - 1;
# 711 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h"
uint64_t m_val : n_bits;
enum profile_quality m_quality : 3;
public:
bool compatible_p (const profile_count other) const
{
if (!initialized_p () || !other.initialized_p ())
return true;
if (*this == zero ()
|| other == zero ())
return true;
if (ipa ().nonzero_p ()
&& !(other.ipa () == other))
return false;
if (other.ipa ().nonzero_p ()
&& !(ipa () == *this))
return false;
return ipa_p () == other.ipa_p ();
}
static profile_count zero ()
{
return from_gcov_type (0);
}
static profile_count adjusted_zero ()
{
profile_count c;
c.m_val = 0;
c.m_quality = ADJUSTED;
return c;
}
static profile_count guessed_zero ()
{
profile_count c;
c.m_val = 0;
c.m_quality = GUESSED;
return c;
}
static profile_count one ()
{
return from_gcov_type (1);
}
static profile_count uninitialized ()
{
profile_count c;
c.m_val = uninitialized_count;
c.m_quality = GUESSED_LOCAL;
return c;
}
gcov_type to_gcov_type () const
{
((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 778, __FUNCTION__), 0 : 0));
return m_val;
}
bool initialized_p () const
{
return m_val != uninitialized_count;
}
bool reliable_p () const
{
return m_quality >= ADJUSTED;
}
bool ipa_p () const
{
return !initialized_p () || m_quality >= GUESSED_GLOBAL0;
}
bool precise_p () const
{
return m_quality == PRECISE;
}
uint32_t value () const { return m_val; }
enum profile_quality quality () const { return m_quality; }
bool ok_for_merging (profile_count other) const
{
if (m_quality < ADJUSTED
|| other.m_quality < ADJUSTED)
return true;
return !(other < *this);
}
profile_count merge (profile_count other) const
{
if (*this == other || !other.initialized_p ()
|| m_quality > other.m_quality)
return *this;
if (other.m_quality > m_quality
|| other > *this)
return other;
return *this;
}
bool operator== (const profile_count &other) const
{
return m_val == other.m_val && m_quality == other.m_quality;
}
profile_count operator+ (const profile_count &other) const
{
if (other == zero ())
return *this;
if (*this == zero ())
return other;
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
profile_count ret;
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 853, __FUNCTION__), 0 : 0));
ret.m_val = m_val + other.m_val;
ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
return ret;
}
profile_count &operator+= (const profile_count &other)
{
if (other == zero ())
return *this;
if (*this == zero ())
{
*this = other;
return *this;
}
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 872, __FUNCTION__), 0 : 0));
m_val += other.m_val;
m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
}
return *this;
}
profile_count operator- (const profile_count &other) const
{
if (*this == zero () || other == zero ())
return *this;
if (!initialized_p () || !other.initialized_p ())
return uninitialized ();
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 885, __FUNCTION__), 0 : 0));
profile_count ret;
ret.m_val = m_val >= other.m_val ? m_val - other.m_val : 0;
ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
return ret;
}
profile_count &operator-= (const profile_count &other)
{
if (*this == zero () || other == zero ())
return *this;
if (!initialized_p () || !other.initialized_p ())
return *this = uninitialized ();
else
{
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 900, __FUNCTION__), 0 : 0));
m_val = m_val >= other.m_val ? m_val - other.m_val: 0;
m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality));
}
return *this;
}
bool verify () const
{
((void)(!(m_quality != UNINITIALIZED_PROFILE) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 910, __FUNCTION__), 0 : 0));
return m_val != uninitialized_count || m_quality == GUESSED_LOCAL;
}
bool operator< (const profile_count &other) const
{
if (!initialized_p () || !other.initialized_p ())
return false;
if (*this == zero ())
return !(other == zero ());
if (other == zero ())
return false;
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 924, __FUNCTION__), 0 : 0));
return m_val < other.m_val;
}
bool operator> (const profile_count &other) const
{
if (!initialized_p () || !other.initialized_p ())
return false;
if (*this == zero ())
return false;
if (other == zero ())
return !(*this == zero ());
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 936, __FUNCTION__), 0 : 0));
return initialized_p () && other.initialized_p () && m_val > other.m_val;
}
bool operator< (const gcov_type other) const
{
((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 942, __FUNCTION__), 0 : 0));
((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 943, __FUNCTION__), 0 : 0));
return ipa ().initialized_p () && ipa ().m_val < (uint64_t) other;
}
bool operator> (const gcov_type other) const
{
((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 949, __FUNCTION__), 0 : 0));
((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 950, __FUNCTION__), 0 : 0));
return ipa ().initialized_p () && ipa ().m_val > (uint64_t) other;
}
bool operator<= (const profile_count &other) const
{
if (!initialized_p () || !other.initialized_p ())
return false;
if (*this == zero ())
return true;
if (other == zero ())
return (*this == zero ());
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 962, __FUNCTION__), 0 : 0));
return m_val <= other.m_val;
}
bool operator>= (const profile_count &other) const
{
if (!initialized_p () || !other.initialized_p ())
return false;
if (other == zero ())
return true;
if (*this == zero ())
return (other == zero ());
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 974, __FUNCTION__), 0 : 0));
return m_val >= other.m_val;
}
bool operator<= (const gcov_type other) const
{
((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 980, __FUNCTION__), 0 : 0));
((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 981, __FUNCTION__), 0 : 0));
return ipa ().initialized_p () && ipa ().m_val <= (uint64_t) other;
}
bool operator>= (const gcov_type other) const
{
((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 987, __FUNCTION__), 0 : 0));
((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 988, __FUNCTION__), 0 : 0));
return ipa ().initialized_p () && ipa ().m_val >= (uint64_t) other;
}
bool nonzero_p () const
{
return initialized_p () && m_val != 0;
}
profile_count force_nonzero () const
{
if (!initialized_p ())
return *this;
profile_count ret = *this;
if (ret.m_val == 0)
{
ret.m_val = 1;
ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED));
}
return ret;
}
profile_count max (profile_count other) const
{
profile_count val = *this;
if (ipa ().nonzero_p () || other.ipa ().nonzero_p ())
{
val = ipa ();
other = other.ipa ();
}
if (!initialized_p ())
return other;
if (!other.initialized_p ())
return *this;
if (*this == zero ())
return other;
if (other == zero ())
return *this;
((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1032, __FUNCTION__), 0 : 0));
if (val.m_val < other.m_val || (m_val == other.m_val
&& val.m_quality < other.m_quality))
return other;
return *this;
}
profile_count apply_probability (int prob) const
{
((void)(!(prob >= 0 && prob <= 10000) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1043, __FUNCTION__), 0 : 0));
if (m_val == 0)
return *this;
if (!initialized_p ())
return uninitialized ();
profile_count ret;
ret.m_val = (((m_val * prob) + (10000) / 2) / (10000));
ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED));
return ret;
}
profile_count apply_probability (profile_probability prob) const
{
if (*this == zero ())
return *this;
if (prob == profile_probability::never ())
return zero ();
if (!initialized_p ())
return uninitialized ();
profile_count ret;
uint64_t tmp;
safe_scale_64bit (m_val, prob.m_val, profile_probability::max_probability,
&tmp);
ret.m_val = tmp;
ret.m_quality = ((m_quality) < (prob.m_quality) ? (m_quality) : (prob.m_quality));
return ret;
}
profile_count apply_scale (int64_t num, int64_t den) const
{
if (m_val == 0)
return *this;
if (!initialized_p ())
return uninitialized ();
profile_count ret;
uint64_t tmp;
((void)(!(num >= 0 && den > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1082, __FUNCTION__), 0 : 0));
safe_scale_64bit (m_val, num, den, &tmp);
ret.m_val = ((tmp) < (max_count) ? (tmp) : (max_count));
ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED));
return ret;
}
profile_count apply_scale (profile_count num, profile_count den) const
{
if (*this == zero ())
return *this;
if (num == zero ())
return num;
if (!initialized_p () || !num.initialized_p () || !den.initialized_p ())
return uninitialized ();
if (num == den)
return *this;
((void)(!(den.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1099, __FUNCTION__), 0 : 0));
profile_count ret;
uint64_t val;
safe_scale_64bit (m_val, num.m_val, den.m_val, &val);
ret.m_val = ((val) < (max_count) ? (val) : (max_count));
ret.m_quality = ((((((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) < (num.m_quality) ? (((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) : (num.m_quality))) < (den.m_quality) ? (((((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) < (num.m_quality) ? (((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) : (num.m_quality))) : (den.m_quality))
;
if (num.ipa_p ())
ret.m_quality = ((ret.m_quality) > (num == num.ipa () ? GUESSED : num.m_quality) ? (ret.m_quality) : (num == num.ipa () ? GUESSED : num.m_quality))
;
return ret;
}
profile_count guessed_local () const
{
profile_count ret = *this;
if (!initialized_p ())
return *this;
ret.m_quality = GUESSED_LOCAL;
return ret;
}
profile_count global0 () const
{
profile_count ret = *this;
if (!initialized_p ())
return *this;
ret.m_quality = GUESSED_GLOBAL0;
return ret;
}
profile_count global0adjusted () const
{
profile_count ret = *this;
if (!initialized_p ())
return *this;
ret.m_quality = GUESSED_GLOBAL0_ADJUSTED;
return ret;
}
profile_count guessed () const
{
profile_count ret = *this;
ret.m_quality = ((ret.m_quality) < (GUESSED) ? (ret.m_quality) : (GUESSED));
return ret;
}
profile_count ipa () const
{
if (m_quality > GUESSED_GLOBAL0_ADJUSTED)
return *this;
if (m_quality == GUESSED_GLOBAL0)
return zero ();
if (m_quality == GUESSED_GLOBAL0_ADJUSTED)
return adjusted_zero ();
return uninitialized ();
}
profile_count afdo () const
{
profile_count ret = *this;
ret.m_quality = AFDO;
return ret;
}
profile_probability probability_in (const profile_count overall) const
{
if (*this == zero ()
&& !(overall == zero ()))
return profile_probability::never ();
if (!initialized_p () || !overall.initialized_p ()
|| !overall.m_val)
return profile_probability::uninitialized ();
if (*this == overall && m_quality == PRECISE)
return profile_probability::always ();
profile_probability ret;
((void)(!(compatible_p (overall)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1188, __FUNCTION__), 0 : 0));
if (overall.m_val < m_val)
{
ret.m_val = profile_probability::max_probability;
ret.m_quality = GUESSED;
return ret;
}
else
ret.m_val = (((m_val * profile_probability::max_probability) + (overall.m_val) / 2) / (overall.m_val))
;
ret.m_quality = ((((((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) > (GUESSED) ? (((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) : (GUESSED))) < (ADJUSTED) ? (((((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) > (GUESSED) ? (((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) : (GUESSED))) : (ADJUSTED))
;
return ret;
}
int to_frequency (struct function *fun) const;
int to_cgraph_frequency (profile_count entry_bb_count) const;
sreal to_sreal_scale (profile_count in, bool *known = nullptr) const;
void dump (FILE *f) const;
void debug () const;
bool differs_from_p (profile_count other) const;
static void adjust_for_ipa_scaling (profile_count *num, profile_count *den);
profile_count combine_with_ipa_count (profile_count ipa);
profile_count combine_with_ipa_count_within
(profile_count ipa, profile_count ipa2);
static profile_count from_gcov_type (gcov_type v,
profile_quality quality = PRECISE);
static profile_count stream_in (class lto_input_block *);
void stream_out (struct output_block *);
void stream_out (struct lto_output_stream *);
};
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" 2
# 41 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
enum tree_dump_index
{
TDI_none,
TDI_cgraph,
TDI_inheritance,
TDI_clones,
TDI_original,
TDI_gimple,
TDI_nested,
TDI_lto_stream_out,
TDI_profile_report,
TDI_lang_all,
TDI_tree_all,
TDI_rtl_all,
TDI_ipa_all,
TDI_end
};
enum dump_kind
{
DK_none,
DK_lang,
DK_tree,
DK_rtl,
DK_ipa
};
enum dump_flag
{
TDF_NONE = 0,
TDF_ADDRESS = (1 << 0),
TDF_SLIM = (1 << 1),
TDF_RAW = (1 << 2),
TDF_DETAILS = (1 << 3),
TDF_STATS = (1 << 4),
TDF_BLOCKS = (1 << 5),
TDF_VOPS = (1 << 6),
TDF_LINENO = (1 << 7),
TDF_UID = (1 << 8),
TDF_STMTADDR = (1 << 9),
TDF_GRAPH = (1 << 10),
TDF_MEMSYMS = (1 << 11),
TDF_RHS_ONLY = (1 << 12),
TDF_ASMNAME = (1 << 13),
TDF_EH = (1 << 14),
TDF_NOUID = (1 << 15),
TDF_ALIAS = (1 << 16),
TDF_ENUMERATE_LOCALS = (1 << 17),
TDF_CSELIB = (1 << 18),
TDF_SCEV = (1 << 19),
TDF_GIMPLE = (1 << 20),
TDF_FOLDING = (1 << 21),
MSG_OPTIMIZED_LOCATIONS = (1 << 22),
MSG_MISSED_OPTIMIZATION = (1 << 23),
MSG_NOTE = (1 << 24),
MSG_ALL_KINDS = (MSG_OPTIMIZED_LOCATIONS
| MSG_MISSED_OPTIMIZATION
| MSG_NOTE),
# 178 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
MSG_PRIORITY_USER_FACING = (1 << 25),
MSG_PRIORITY_INTERNALS = (1 << 26),
MSG_PRIORITY_REEMITTED = (1 << 27),
MSG_ALL_PRIORITIES = (MSG_PRIORITY_USER_FACING
| MSG_PRIORITY_INTERNALS
| MSG_PRIORITY_REEMITTED),
TDF_COMPARE_DEBUG = (1 << 28),
TDF_ERROR = (1 << 26),
TDF_ALL_VALUES = (1 << 29) - 1
};
typedef enum dump_flag dump_flags_t;
static inline dump_flags_t
operator| (dump_flags_t lhs, dump_flags_t rhs)
{
return (dump_flags_t)((int)lhs | (int)rhs);
}
static inline dump_flags_t
operator& (dump_flags_t lhs, dump_flags_t rhs)
{
return (dump_flags_t)((int)lhs & (int)rhs);
}
static inline dump_flags_t
operator~ (dump_flags_t flags)
{
return (dump_flags_t)~((int)flags);
}
static inline dump_flags_t &
operator|= (dump_flags_t &lhs, dump_flags_t rhs)
{
lhs = (dump_flags_t)((int)lhs | (int)rhs);
return lhs;
}
static inline dump_flags_t &
operator&= (dump_flags_t &lhs, dump_flags_t rhs)
{
lhs = (dump_flags_t)((int)lhs & (int)rhs);
return lhs;
}
enum optgroup_flag
{
OPTGROUP_NONE = 0,
OPTGROUP_IPA = (1 << 1),
OPTGROUP_LOOP = (1 << 2),
OPTGROUP_INLINE = (1 << 3),
OPTGROUP_OMP = (1 << 4),
OPTGROUP_VEC = (1 << 5),
OPTGROUP_OTHER = (1 << 6),
OPTGROUP_ALL = (OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE
| OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER)
};
typedef enum optgroup_flag optgroup_flags_t;
static inline optgroup_flags_t
operator| (optgroup_flags_t lhs, optgroup_flags_t rhs)
{
return (optgroup_flags_t)((int)lhs | (int)rhs);
}
static inline optgroup_flags_t &
operator|= (optgroup_flags_t &lhs, optgroup_flags_t rhs)
{
lhs = (optgroup_flags_t)((int)lhs | (int)rhs);
return lhs;
}
struct dump_file_info
{
const char *suffix;
const char *swtch;
const char *glob;
const char *pfilename;
const char *alt_filename;
FILE *pstream;
FILE *alt_stream;
dump_kind dkind;
dump_flags_t pflags;
dump_flags_t alt_flags;
optgroup_flags_t optgroup_flags;
int pstate;
int alt_state;
int num;
bool owns_strings;
bool graph_dump_initialized;
};
class dump_user_location_t
{
public:
dump_user_location_t () : m_count (), m_loc (((location_t) 0)) {}
dump_user_location_t (const gimple *stmt);
dump_user_location_t (const rtx_insn *insn);
static dump_user_location_t
from_location_t (location_t loc)
{
return dump_user_location_t (profile_count (), loc);
}
static dump_user_location_t
from_function_decl (tree fndecl);
profile_count get_count () const { return m_count; }
location_t get_location_t () const { return m_loc; }
private:
dump_user_location_t (profile_count count, location_t loc)
: m_count (count), m_loc (loc)
{}
profile_count m_count;
location_t m_loc;
};
class dump_impl_location_t
{
public:
dump_impl_location_t (
const char *file = __builtin_FILE (),
int line = __builtin_LINE (),
const char *function = __builtin_FUNCTION ()
)
: m_file (file), m_line (line), m_function (function)
{}
const char *m_file;
int m_line;
const char *m_function;
};
# 404 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
class dump_metadata_t
{
public:
dump_metadata_t (dump_flags_t dump_flags,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
: m_dump_flags (dump_flags),
m_impl_location (impl_location)
{
}
dump_flags_t get_dump_flags () const { return m_dump_flags; }
const dump_impl_location_t &
get_impl_location () const { return m_impl_location; }
private:
dump_flags_t m_dump_flags;
dump_impl_location_t m_impl_location;
};
# 436 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
class dump_location_t
{
public:
dump_location_t (const dump_impl_location_t &impl_location
= dump_impl_location_t ())
: m_user_location (dump_user_location_t ()),
m_impl_location (impl_location)
{
}
dump_location_t (const gimple *stmt,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
: m_user_location (dump_user_location_t (stmt)),
m_impl_location (impl_location)
{
}
dump_location_t (const rtx_insn *insn,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
: m_user_location (dump_user_location_t (insn)),
m_impl_location (impl_location)
{
}
dump_location_t (const dump_user_location_t &user_location,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
: m_user_location (user_location),
m_impl_location (impl_location)
{
}
static dump_location_t
from_location_t (location_t loc,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
{
return dump_location_t (dump_user_location_t::from_location_t (loc),
impl_location);
}
const dump_user_location_t &
get_user_location () const { return m_user_location; }
const dump_impl_location_t &
get_impl_location () const { return m_impl_location; }
location_t get_location_t () const
{
return m_user_location.get_location_t ();
}
profile_count get_count () const { return m_user_location.get_count (); }
private:
dump_user_location_t m_user_location;
dump_impl_location_t m_impl_location;
};
extern FILE *dump_begin (int, dump_flags_t *, int part=-1);
extern void dump_end (int, FILE *);
extern int opt_info_switch_p (const char *);
extern const char *dump_flag_name (int);
extern const kv_pair<optgroup_flags_t> optgroup_options[];
extern dump_flags_t
parse_dump_option (const char *, const char **);
extern FILE *dump_file;
extern dump_flags_t dump_flags;
extern const char *dump_file_name;
extern bool dumps_are_enabled;
extern void set_dump_file (FILE *new_dump_file);
static inline bool
dump_enabled_p (void)
{
return dumps_are_enabled;
}
# 563 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
extern void dump_printf (const dump_metadata_t &, const char *, ...)
__attribute__ ((__format__ (__gcc_dump_printf__, 2 ,3))) __attribute__ ((__nonnull__ (2)));
extern void dump_printf_loc (const dump_metadata_t &, const dump_user_location_t &,
const char *, ...)
__attribute__ ((__format__ (__gcc_dump_printf__, 3 ,0))) __attribute__ ((__nonnull__ (3)));
extern void dump_function (int phase, tree fn);
extern void dump_basic_block (dump_flags_t, basic_block, int);
extern void dump_generic_expr_loc (const dump_metadata_t &,
const dump_user_location_t &,
dump_flags_t, tree);
extern void dump_generic_expr (const dump_metadata_t &, dump_flags_t, tree);
extern void dump_gimple_stmt_loc (const dump_metadata_t &,
const dump_user_location_t &,
dump_flags_t, gimple *, int);
extern void dump_gimple_stmt (const dump_metadata_t &, dump_flags_t, gimple *, int);
extern void dump_gimple_expr_loc (const dump_metadata_t &,
const dump_user_location_t &,
dump_flags_t, gimple *, int);
extern void dump_gimple_expr (const dump_metadata_t &, dump_flags_t, gimple *, int);
extern void dump_symtab_node (const dump_metadata_t &, symtab_node *);
template<unsigned int N, typename C>
void dump_dec (const dump_metadata_t &, const poly_int<N, C> &);
extern void dump_dec (dump_flags_t, const poly_wide_int &, signop);
extern void dump_hex (dump_flags_t, const poly_wide_int &);
extern void dumpfile_ensure_any_optinfo_are_flushed ();
extern unsigned int get_dump_scope_depth ();
extern void dump_begin_scope (const char *name,
const dump_user_location_t &user_location,
const dump_impl_location_t &impl_location);
extern void dump_end_scope ();
class auto_dump_scope
{
public:
auto_dump_scope (const char *name,
const dump_user_location_t &user_location,
const dump_impl_location_t &impl_location
= dump_impl_location_t ())
{
if (dump_enabled_p ())
dump_begin_scope (name, user_location, impl_location);
}
~auto_dump_scope ()
{
if (dump_enabled_p ())
dump_end_scope ();
}
};
# 640 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h"
extern void dump_function (int phase, tree fn);
extern void print_combine_total_stats (void);
extern bool enable_rtl_dump_file (void);
extern void dump_node (const_tree, dump_flags_t, FILE *);
extern void dump_combine_total_stats (FILE *);
extern void dump_bb (FILE *, basic_block, int, dump_flags_t);
class opt_pass;
namespace gcc {
class dump_manager
{
public:
dump_manager ();
~dump_manager ();
unsigned int
dump_register (const char *suffix, const char *swtch, const char *glob,
dump_kind dkind, optgroup_flags_t optgroup_flags,
bool take_ownership);
void
register_dumps ();
struct dump_file_info *
get_dump_file_info (int phase) const;
struct dump_file_info *
get_dump_file_info_by_switch (const char *swtch) const;
char *
get_dump_file_name (int phase, int part = -1) const;
char *
get_dump_file_name (struct dump_file_info *dfi, int part = -1) const;
void
dump_switch_p (const char *arg);
int
dump_start (int phase, dump_flags_t *flag_ptr);
void
dump_finish (int phase);
FILE *
dump_begin (int phase, dump_flags_t *flag_ptr, int part);
int
dump_initialized_p (int phase) const;
const char *
dump_flag_name (int phase) const;
void register_pass (opt_pass *pass);
private:
int
dump_phase_enabled_p (int phase) const;
int
dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob);
int
dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename);
int
opt_info_enable_passes (optgroup_flags_t optgroup_flags, dump_flags_t flags,
const char *filename);
bool update_dfi_for_opt_info (dump_file_info *dfi) const;
private:
int m_next_dump;
struct dump_file_info *m_extra_dump_files;
size_t m_extra_dump_files_in_use;
size_t m_extra_dump_files_alloced;
optgroup_flags_t m_optgroup_flags;
dump_flags_t m_optinfo_flags;
char *m_optinfo_filename;
friend bool ::enable_rtl_dump_file (void);
friend int ::opt_info_switch_p (const char *arg);
};
}
# 482 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 1
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 1
# 111 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4
# 112 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 2
# 153 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h"
extern "C" {
struct _obstack_chunk
{
char *limit;
struct _obstack_chunk *prev;
char contents[4];
};
struct obstack
{
size_t chunk_size;
struct _obstack_chunk *chunk;
char *object_base;
char *next_free;
char *chunk_limit;
union
{
size_t i;
void *p;
} temp;
size_t alignment_mask;
union
{
void *(*plain) (size_t);
void *(*extra) (void *, size_t);
} chunkfun;
union
{
void (*plain) (void *);
void (*extra) (void *, void *);
} freefun;
void *extra_arg;
unsigned use_extra_arg : 1;
unsigned maybe_empty_object : 1;
unsigned alloc_failed : 1;
};
extern void _obstack_newchunk (struct obstack *, size_t);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *,
size_t, size_t,
void *(*) (size_t), void (*) (void *));
extern int _obstack_begin_1 (struct obstack *,
size_t, size_t,
void *(*) (void *, size_t),
void (*) (void *, void *), void *);
extern size_t _obstack_memory_used (struct obstack *)
# 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 3 4
__attribute__ ((__pure__))
# 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h"
;
extern void (*obstack_alloc_failed_handler) (void);
extern int obstack_exit_failure;
# 532 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h"
}
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/diagnostic-url.h" 1
# 27 "/home/giulianob/gcc_git_gnu/gcc/gcc/diagnostic-url.h"
typedef enum
{
DIAGNOSTICS_URL_NO = 0,
DIAGNOSTICS_URL_YES = 1,
DIAGNOSTICS_URL_AUTO = 2
} diagnostic_url_rule_t;
enum diagnostic_url_format
{
URL_FORMAT_NONE,
URL_FORMAT_ST,
URL_FORMAT_BEL
};
const diagnostic_url_format URL_FORMAT_DEFAULT = URL_FORMAT_BEL;
extern diagnostic_url_format determine_url_format (diagnostic_url_rule_t);
# 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 2
struct text_info
{
const char *format_spec;
va_list *args_ptr;
int err_no;
void **x_data;
rich_location *m_richloc;
void set_location (unsigned int idx, location_t loc,
enum range_display_kind range_display_kind);
location_t get_location (unsigned int index_of_location) const;
};
enum diagnostic_prefixing_rule_t
{
DIAGNOSTICS_SHOW_PREFIX_ONCE = 0x0,
DIAGNOSTICS_SHOW_PREFIX_NEVER = 0x1,
DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE = 0x2
};
struct chunk_info
{
struct chunk_info *prev;
const char *args[30 * 2];
};
class output_buffer
{
public:
output_buffer ();
~output_buffer ();
struct obstack formatted_obstack;
struct obstack chunk_obstack;
struct obstack *obstack;
struct chunk_info *cur_chunk_array;
FILE *stream;
int line_length;
char digit_buffer[128];
bool flush_p;
};
static inline const char *
output_buffer_formatted_text (output_buffer *buff)
{
__extension__ ({ struct obstack *__o = (buff->obstack); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('\0'))); });
return (const char *) ((void *) (buff->obstack)->object_base);
}
static inline void
output_buffer_append_r (output_buffer *buff, const char *start, int length)
{
((void)(!(start) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h", 128, __FUNCTION__), 0 : 0));
__extension__ ({ struct obstack *__o = (buff->obstack); size_t __len = (length); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, start, __len); __o->next_free += __len; (void) 0; });
for (int i = 0; i < length; i++)
if (start[i] == '\n')
buff->line_length = 0;
else
buff->line_length++;
}
static inline const char *
output_buffer_last_position_in_text (const output_buffer *buff)
{
const char *p = nullptr;
struct obstack *text = buff->obstack;
if (((void *) (text)->object_base) != ((void *) (text)->next_free))
p = ((const char *) ((void *) (text)->next_free)) - 1;
return p;
}
typedef unsigned int pp_flags;
enum pp_padding
{
pp_none, pp_before, pp_after
};
struct pp_wrapping_mode_t
{
diagnostic_prefixing_rule_t rule;
int line_cutoff;
};
# 184 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
typedef bool (*printer_fn) (pretty_printer *, text_info *, const char *,
int, bool, bool, bool, bool *, const char **);
class format_postprocessor
{
public:
virtual ~format_postprocessor () {}
virtual format_postprocessor *clone() const = 0;
virtual void handle (pretty_printer *) = 0;
};
# 220 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
class pretty_printer
{
public:
explicit pretty_printer (int = 0);
explicit pretty_printer (const pretty_printer &other);
virtual ~pretty_printer ();
virtual pretty_printer *clone () const;
output_buffer *buffer;
char *prefix;
pp_padding padding;
int maximum_length;
int indent_skip;
pp_wrapping_mode_t wrapping;
# 261 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
printer_fn format_decoder;
format_postprocessor *m_format_postprocessor;
bool emitted_prefix;
bool need_newline;
bool translate_identifiers;
bool show_color;
diagnostic_url_format url_format;
};
static inline const char *
pp_get_prefix (const pretty_printer *pp) { return pp->prefix; }
# 353 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
extern void pp_set_line_maximum_length (pretty_printer *, int);
extern void pp_set_prefix (pretty_printer *, char *);
extern char *pp_take_prefix (pretty_printer *);
extern void pp_destroy_prefix (pretty_printer *);
extern int pp_remaining_character_count_for_line (pretty_printer *);
extern void pp_clear_output_area (pretty_printer *);
extern const char *pp_formatted_text (pretty_printer *);
extern const char *pp_last_position_in_text (const pretty_printer *);
extern void pp_emit_prefix (pretty_printer *);
extern void pp_append_text (pretty_printer *, const char *, const char *);
extern void pp_newline_and_flush (pretty_printer *);
extern void pp_newline_and_indent (pretty_printer *, int);
extern void pp_separate_with (pretty_printer *, char);
# 382 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
extern void pp_printf (pretty_printer *, const char *, ...)
__attribute__ ((__format__ (__gcc_diag__, 2 ,3))) __attribute__ ((__nonnull__ (2)));
extern void pp_verbatim (pretty_printer *, const char *, ...)
__attribute__ ((__format__ (__gcc_diag__, 2 ,3))) __attribute__ ((__nonnull__ (2)));
extern void pp_flush (pretty_printer *);
extern void pp_really_flush (pretty_printer *);
extern void pp_format (pretty_printer *, text_info *);
extern void pp_output_formatted_text (pretty_printer *);
extern void pp_format_verbatim (pretty_printer *, text_info *);
extern void pp_indent (pretty_printer *);
extern void pp_newline (pretty_printer *);
extern void pp_character (pretty_printer *, int);
extern void pp_string (pretty_printer *, const char *);
extern void pp_write_text_to_stream (pretty_printer *);
extern void pp_write_text_as_dot_label_to_stream (pretty_printer *, bool);
extern void pp_write_text_as_html_like_dot_to_stream (pretty_printer *pp);
extern void pp_maybe_space (pretty_printer *);
extern void pp_begin_quote (pretty_printer *, bool);
extern void pp_end_quote (pretty_printer *, bool);
extern void pp_begin_url (pretty_printer *pp, const char *url);
extern void pp_end_url (pretty_printer *pp);
static inline pp_wrapping_mode_t
pp_set_verbatim_wrapping_ (pretty_printer *pp)
{
pp_wrapping_mode_t oldmode = (pp)->wrapping;
(pp)->wrapping.line_cutoff = 0;
(pp)->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_NEVER;
return oldmode;
}
extern const char *identifier_to_locale (const char *);
extern void *(*identifier_to_locale_alloc) (size_t);
extern void (*identifier_to_locale_free) (void *);
inline void
pp_wide_integer (pretty_printer *pp, long i)
{
do { sprintf ((pp)->buffer->digit_buffer, "%"
# 430 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 3 4
"l" "d"
# 430 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h"
, i); pp_string (pp, (pp)->buffer->digit_buffer); } while (0);
}
template<unsigned int N, typename T>
void pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &);
# 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.h" 1
# 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.h"
namespace ana {
class bar_chart
{
public:
typedef unsigned long value_t;
void add_item (const char *name, value_t value);
void print (pretty_printer *pp) const;
private:
struct item
{
item (const char *name, value_t value)
: m_name (xstrdup (name)), m_strlen (strlen (name)) , m_value (value) {}
~item () { free (m_name); }
char *m_name;
size_t m_strlen;
value_t m_value;
};
static void print_padding (pretty_printer *pp, size_t count);
auto_delete_vec<item> m_items;
};
}
# 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2
namespace ana {
void
bar_chart::add_item (const char *name, value_t value)
{
m_items.safe_push (new item (name, value));
}
void
bar_chart::print (pretty_printer *pp) const
{
size_t max_width_name = 0;
size_t max_width_value = 0;
value_t max_value = 0;
unsigned i;
item *item;
char digit_buffer[128];
for (i = 0; (m_items).iterate ((i), &(item)); ++(i))
{
max_width_name = ((max_width_name) > (item->m_strlen) ? (max_width_name) : (item->m_strlen));
sprintf (digit_buffer, "%li", item->m_value);
max_width_value = ((max_width_value) > (strlen (digit_buffer)) ? (max_width_value) : (strlen (digit_buffer)));
max_value = ((max_value) > (item->m_value) ? (max_value) : (item->m_value));
}
for (i = 0; (m_items).iterate ((i), &(item)); ++(i))
{
pp_string (pp, item->m_name);
print_padding (pp, max_width_name - item->m_strlen);
pp_string (pp, ": ");
sprintf (digit_buffer, "%li", item->m_value);
const size_t value_width = strlen (digit_buffer);
print_padding (pp, max_width_value - value_width);
pp_string (pp, digit_buffer);
pp_character (pp, '|');
const int max_width_bar
= ((max_value) < (76 - (max_width_name + max_width_value + 4)) ? (max_value) : (76 - (max_width_name + max_width_value + 4)));
const int bar_width
= (max_value > 0 ? (max_width_bar * item->m_value) / max_value : 0);
for (int j = 0; j < bar_width; j++)
pp_character (pp, '#');
print_padding (pp, max_width_bar - bar_width);
pp_character (pp, '|');
pp_newline (pp);
}
}
void
bar_chart::print_padding (pretty_printer *pp, size_t count)
{
for (size_t i = 0; i < count; i++)
pp_character (pp, ' ');
}
}
| [
"giuliano.belinassi@usp.br"
] | giuliano.belinassi@usp.br |
da10169407063a36c889421a77c9ab31671cdb6c | 8bc919cd1c0e880b736052154a33a3ffaa3a1c0d | /24.chapter/Demo.04/Demo.h | dfa205af1d72cbbf6bf458111cc7f8311fb06af3 | [] | no_license | goodpaperman/inside | 84d4ae5c8a0ad322bfa3e73ca77e69a33f27e708 | 70380057cdc00a6c9033ddaf21669949a23592c9 | refs/heads/master | 2020-05-30T11:02:41.953202 | 2019-06-01T03:52:43 | 2019-06-01T03:52:43 | 189,687,692 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,385 | h | // Demo.h : main header file for the DEMO application
//
#if !defined(AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_)
#define AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CDemoApp:
// See Demo.cpp for the implementation of this class
//
class CDemoApp : public CWinApp
{
public:
CDemoApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDemoApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
COleTemplateServer m_server;
// Server object for document creation
//{{AFX_MSG(CDemoApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_)
| [
"haihai107@126.com"
] | haihai107@126.com |
9dde6429e549a56f144a51df5e35eb37d8475c85 | 2cd65c1db4c92118386ff60fff8ab7d8d2ee93ed | /WrapperFunctions.hpp | c3f731f65c55c9aa7b76864f45ab7658e8b34f34 | [
"MIT"
] | permissive | Haaxor1689/Interpreter | 8b8042823de5d6b575d905a3cbf0beded173de55 | e9221db4c665f82eef0c70a1a3a09745d547b81a | refs/heads/master | 2021-04-27T15:18:09.064218 | 2018-08-19T15:23:51 | 2018-08-19T15:23:51 | 122,468,839 | 0 | 0 | null | 2018-02-27T17:57:00 | 2018-02-22T11:18:02 | C++ | UTF-8 | C++ | false | false | 689 | hpp | #pragma once
#include <string>
#include <iostream>
#include "Helpers.hpp"
namespace Interpreter {
void Write(const Value& string) {
std::cout << ToString(string);
}
void WriteLine(const Value& string) {
std::cout << ToString(string) << std::endl;
}
double ReadNumber() {
std::string read;
std::getline(std::cin, read);
try {
return std::stod(read);
} catch (const std::invalid_argument&) {
throw InternalException("Failed to convert input to number.");
}
}
std::string ReadText() {
std::string read;
std::getline(std::cin, read);
return read;
}
}
| [
"betkomaros@gmail.com"
] | betkomaros@gmail.com |
cb5b392c6c228bcdd33b085dcca734ed29a8d960 | 4a905d68030de1c8efd41fd580e99dcad360ffe1 | /DCC practice contest 2/jaam.cpp | 414e5a971d6ef56de8df003401082288a246cbd7 | [] | no_license | AliAkberAakash/_CONTESTS_ | e687d80c7a69fdb134be08f1755e1dd93c6292c1 | e9fe96eda38dd107bdd025d955d69e4fe789704b | refs/heads/master | 2021-01-22T22:56:51.355883 | 2018-05-01T19:31:41 | 2018-05-01T19:31:41 | 85,589,590 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 263 | cpp |
#include<stdio.h>
#include<math.h>
#define pi 2*acos (0.0)
int main()
{
int i,t;
double r, a;
scanf("%d", &t);
for(i=1; i<=t; i++)
{
scanf("%lf", &r);
a=(4*r*r)-(pi*r*r);
printf("Case %d: %.lf\n", i, a);
}
}
| [
"cedward318@gmail.com"
] | cedward318@gmail.com |
7aecae623ed538c25bc02ff7d6aa9e1cdd2615c9 | 282cb2c13dc07b6632a0c7f2d54f80ba6454c7a6 | /chapter5/5_22.cpp | 6b3b857f230f2636ea0072a3d98392b151271c37 | [] | no_license | YipengUva/cpp_primer_solutions | 850c789ccb4e6038b1b683d54d47b8932b25e251 | 45fda2dde20cfa8054a3020467b8c4dc0de5fb6c | refs/heads/master | 2020-05-31T23:16:29.283644 | 2019-11-13T10:52:30 | 2019-11-13T10:52:30 | 190,535,852 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 362 | cpp | #include <iostream>
#include <vector>
#include <assert.h>
#include <string>
using namespace std;
int main(){
int sz;
while(cin >> sz){
if (sz <= 0){
std::cout << "using positive input: ";
continue;
}else
break;
}
std::cout << "input: " << sz << endl;
return 0;
}
| [
"yipeng.song@hotmail.com"
] | yipeng.song@hotmail.com |
736a7489a8d36a1c937cf64d39ebc56af7595bf8 | 45e425ccfed054b2c92b6489f05070b02e25e6ef | /codeforce/Robot Vacuum Cleaner.cpp | 5fd2d1c45b4b3625ef395875b23d72a0f1b4691c | [] | no_license | riddhi2000/Competitive-programming | 7d249d6c8f3756b68da738583dca429bab99f661 | 13e1d4fd40add753dedf524bf827b01491b6408c | refs/heads/master | 2021-09-08T08:11:20.594961 | 2018-03-08T14:21:45 | 2018-03-08T14:21:45 | 108,946,879 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 238 | cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pp pop_back
#define mp make_pair
#define MOD 1e9+7
int main(){
int n;
cin >> n;
for(int i=0;i<n;i++){
string s;
cin >> s;
}
} | [
"riddhi.patel@students.iiit.ac.in"
] | riddhi.patel@students.iiit.ac.in |
ac05503fc8391b952bb93fcaf8735c4b205b9c5a | cefa236ced93d5893ff79d48bf4f1eb9e7a625be | /Распределительный контест/2.cpp | 58ca487d84e3e34cf6288eba2ba69c767c4b484a | [
"MIT"
] | permissive | NoliVerga/mipt_1course | 26a461140eed0779d5128fc8f788e246d3d30c98 | 6139629d371b1fa1f747d918d7e95ff804e16d78 | refs/heads/master | 2021-01-20T16:41:59.309307 | 2015-03-26T10:36:25 | 2015-03-26T10:36:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205 | cpp | #include <stdio.h>
#include <iostream>
using namespace std;
int main() {
int hh, mm, x;
cin >> hh
>> mm
>> x;
mm += x;
hh += mm/60;
mm = mm % 60;
printf("%#02d:%#02d", hh, mm);
return 0;
}
| [
"b.bagno@itima.ru"
] | b.bagno@itima.ru |
32fd46e615aa134d1b7eb9f621d4c6319f7ea51f | 9e5b086abad65730292b2dad52e3f1999351e318 | /example/ConsumeLoop.cpp | 5ede5f2fe7e22da5e7cbec002416309d518c8fea | [
"Apache-2.0"
] | permissive | morganstanley/binlog | 4cd5da5c4db9db70e3dfe94c0ccddf8a82748302 | 4cd8f78cfa371921583fa94132b10d68b50f0242 | refs/heads/main | 2023-06-25T17:51:30.753346 | 2023-06-19T12:04:31 | 2023-06-21T09:11:28 | 226,114,666 | 289 | 49 | Apache-2.0 | 2023-06-15T08:30:16 | 2019-12-05T13:59:09 | C++ | UTF-8 | C++ | false | false | 872 | cpp | #include <binlog/binlog.hpp>
#include <fstream>
#include <iostream>
#include <string>
void processInput(const std::string& input, binlog::SessionWriter& writer)
{
BINLOG_INFO_W(writer, "Input received: {}", input);
/* do processing ... */
BINLOG_INFO_W(writer, "Input processed");
}
int main()
{
std::ofstream logfile("consumeloop.blog", std::ofstream::out|std::ofstream::binary);
//[loop
binlog::Session session;
const std::size_t queueCapacityBytes = 1 << 20;
binlog::SessionWriter writer(session, queueCapacityBytes);
std::string input;
while (std::getline(std::cin, input))
{
processInput(input, writer); // logs using `writer`
session.consume(logfile);
}
//]
if (! logfile)
{
std::cerr << "Failed to write consumeloop.blog\n";
return 1;
}
std::cout << "Binary log written to consumeloop.blog\n";
return 0;
}
| [
"Benedek.Thaler@morganstanley.com"
] | Benedek.Thaler@morganstanley.com |
480e3ce309fba42985492505a8cd60a43bfab314 | cf8ddfc720bf6451c4ef4fa01684327431db1919 | /SDK/ARKSurvivalEvolved_FeedingTroughBaseBP_parameters.hpp | c28ebebb3b696f52702c24fa7a5fd28b0dd56a17 | [
"MIT"
] | permissive | git-Charlie/ARK-SDK | 75337684b11e7b9f668da1f15e8054052a3b600f | c38ca9925309516b2093ad8c3a70ed9489e1d573 | refs/heads/master | 2023-06-20T06:30:33.550123 | 2021-07-11T13:41:45 | 2021-07-11T13:41:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,715 | hpp | #pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_FeedingTroughBaseBP_classes.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.Check Team and Set Visual Visibility
struct AFeedingTroughBaseBP_C_Check_Team_and_Set_Visual_Visibility_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPServerHandleNetExecCommand
struct AFeedingTroughBaseBP_C_BPServerHandleNetExecCommand_Params
{
class APlayerController** FromPC; // (Parm, ZeroConstructor, IsPlainOldData)
struct FName* CommandName; // (Parm, ZeroConstructor, IsPlainOldData)
struct FBPNetExecParams ExecParams; // (Parm, OutParm, ReferenceParm)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.OnRep_ShowArea
struct AFeedingTroughBaseBP_C_OnRep_ShowArea_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPClientDoMultiUse
struct AFeedingTroughBaseBP_C_BPClientDoMultiUse_Params
{
class APlayerController** ForPC; // (Parm, ZeroConstructor, IsPlainOldData)
int* ClientUseIndex; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPGetMultiUseEntries
struct AFeedingTroughBaseBP_C_BPGetMultiUseEntries_Params
{
class APlayerController** ForPC; // (Parm, ZeroConstructor, IsPlainOldData)
TArray<struct FMultiUseEntry> MultiUseEntries; // (Parm, OutParm, ZeroConstructor, ReferenceParm)
TArray<struct FMultiUseEntry> ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm)
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ReceiveBeginPlay
struct AFeedingTroughBaseBP_C_ReceiveBeginPlay_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ThrottledTick
struct AFeedingTroughBaseBP_C_ThrottledTick_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.UserConstructionScript
struct AFeedingTroughBaseBP_C_UserConstructionScript_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ServerRequest_ToggleShowarea
struct AFeedingTroughBaseBP_C_ServerRequest_ToggleShowarea_Params
{
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ServerRequest_TurnOffAllShowarea
struct AFeedingTroughBaseBP_C_ServerRequest_TurnOffAllShowarea_Params
{
class APlayerController* PC; // (Parm, ZeroConstructor, IsPlainOldData)
};
// Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ExecuteUbergraph_FeedingTroughBaseBP
struct AFeedingTroughBaseBP_C_ExecuteUbergraph_FeedingTroughBaseBP_Params
{
int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"sergey.2bite@gmail.com"
] | sergey.2bite@gmail.com |
f264a6edc16b6c8897757c06e8e6cf670bd265ce | 9120a9b17d00f41e5af26b66f5b667c02d870df0 | /SOURCE/ocf/oledoc.cpp | 3a10279840a8591499edca7917dd715b27e99577 | [
"Zlib"
] | permissive | pierrebestwork/owl | dd77c095abb214a107f17686e6143907bf809930 | 807aa5ab4df9ee9faa35ba6df9a342a62b9bac76 | refs/heads/master | 2023-02-14T02:12:38.490348 | 2020-03-16T16:41:49 | 2020-03-16T16:41:49 | 326,663,704 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,538 | cpp | //----------------------------------------------------------------------------
// ObjectComponents
// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
//
//$Revision: 1.13 $
//$Author: jogybl $
//$Date: 2007-09-15 11:43:48 $
//
// Implementation of TOleDocument. Doc/View document that supports OLE 2
// using OCF TOcDocument
//----------------------------------------------------------------------------
#define INC_OLE2
#include <ocf/pch.h>
#if !defined(OWL_DOCMANAG_H)
# include <owl/docmanag.h>
#endif
#if !defined(OCF_OLEMDIFR_H)
# include <ocf/olemdifr.h>
#endif
#if !defined(OCF_OCDOC_H)
# include <ocf/ocdoc.h>
#endif
#if !defined(OCF_OCAPP_H)
# include <ocf/ocapp.h>
#endif
#if !defined(OCF_OLEDOC_H)
# include <ocf/oledoc.h>
#endif
#if !defined(OCF_OLEFRAME_H)
# include <ocf/oleframe.h>
#endif
#if !defined(OCF_OLEVIEW_H)
# include <ocf/oleview.h>
#endif
__OCF_BEGIN_NAMESPACE
__OWL_USING_NAMESPACE
OWL_DIAGINFO;
//
//
//
TOleDocument::TOleDocument(TDocument* parent)
:
TStorageDocument(parent),
OcDoc(0),
Closing(false)
{
}
//
// For an OLE container the compound file remains open
// until the application shuts down
//
TOleDocument::~TOleDocument()
{
delete OcDoc;
}
//
// Prepare document shutdown
//
bool
TOleDocument::CanClose()
{
//
// if it's an open edit dll stop the closing process
TView* curView = GetViewList();
while (curView) {
// get the ole view
TOleView* oleView = TYPESAFE_DOWNCAST(curView, TOleView);
if (oleView && oleView->IsOpenEditing() && !GetOcApp()->IsOptionSet(amExeMode)) {
TOleFrame* olefr = TYPESAFE_DOWNCAST(oleView->GetApplication()->GetMainWindow(), TOleFrame);
CHECK(olefr);
olefr->ShowWindow(SW_HIDE);
oleView->OleShutDown();
return false; // don't close
}
curView = curView->GetNextView();
}
// Just say yes if we are already in the closing process, or are embedded,
// or have multiple views open
//
if (Closing || IsEmbedded())
return true;
return TDocument::CanClose();
}
//
// Shut down the TOleView's
//
void
TOleDocument::OleViewClose()
{
TView* curView = GetViewList();
while (curView) {
TOleView* oleView = TYPESAFE_DOWNCAST(curView, TOleView);
if (oleView)
oleView->OleShutDown();
curView = curView->GetNextView();
}
}
//
// Close the compound file
//
bool
TOleDocument::Close()
{
// Make sure that TOleView's are closed first
//
OleViewClose();
OcDoc->Close();
return TStorageDocument::Close();
}
//
// Close the OLE document when the server is done with the
// given IStorage from its container
//
bool
TOleDocument::ReleaseDoc()
{
PRECONDITION(OcDoc);
TStorageDocument::ReleaseDoc();
OcDoc->SetStorage((IStorage*)0);
return true;
}
//
// Open the OLE document when the server is provided with an
// IStorage from its container
//
bool
TOleDocument::SetStorage(IStorage* stg, bool remember)
{
PRECONDITION(OcDoc);
// If a storage is provided, then we are now using container's IStorage
//
if (stg)
Embedded = true;
OcDoc->SetStorage(stg, remember);
TStorageDocument::SetStorage(stg, remember);
return true;
}
//
// Restores the original root IStorage before the save operation
//
bool
TOleDocument::RestoreStorage()
{
PRECONDITION(OcDoc);
OcDoc->RestoreStorage();
TStorageDocument::RestoreStorage();
return true;
}
//
// Set the initial open mode
//
void
TOleDocument::PreOpen()
{
SetOpenMode(ofReadWrite | ofTransacted);
}
//
// Open the compound file so that we have an IStorage for use
// with embedded objects. A document partner is created
// to handle OLE related stuff.
//
bool
TOleDocument::InitDoc()
{
if (IsOpen())
return true; // compound file already open
// Give user a chance to set a different open mode
//
PreOpen();
if (GetDocPath())
SetOpenMode(GetOpenMode() | (ofNoCreate));
else
SetOpenMode(GetOpenMode() | ofTemporary);
if (TStorageDocument::Open(GetOpenMode(), GetDocPath())) {
if (OcDoc) { // use the existing ocdoc
OcDoc->SetStorage(StorageI);
}
else if (GetOcApp()) {
OcDoc = new TOcDocument(*GetOcApp(), GetDocPath(), StorageI);
}
return true;
}
return false;
}
//
// Save the embedded objects, if any
//
bool
TOleDocument::Commit(bool force)
{
if (Write())
return TStorageDocument::Commit(force);
else
return false;
}
//
// Load the embedded objects, if any
//
bool
TOleDocument::Open(int, LPCTSTR path)
{
if (path)
SetDocPath(path);
return Read();
}
//
// Check if current document path is the same as the
// OcDoc's.
//
bool TOleDocument::PathChanged()
{
return _tcsicmp(OcDoc->GetName().c_str(), GetDocPath()) != 0;
}
//
// Save embed objects to the compound file
//
bool
TOleDocument::Write()
{
// Switch to new storage if path has changed & it is permanent ("SaveAs")
//
IStorage* newStorageI;
bool saveAs = PathChanged() && !OrgStorageI; // also is 'remember'
bool sameAsLoad = !PathChanged() && !OrgStorageI; // use current storage
if (saveAs) {
// Update link monikers
//
owl_string newName(GetDocPath());
OcDoc->SetName(newName);
if (IsEmbedded())
newStorageI = StorageI; // Use the one assigned by container
else
newStorageI = GetNewStorage();
}
else
newStorageI = StorageI;
return newStorageI ?
OcDoc->SaveParts(newStorageI, sameAsLoad, saveAs) :
false;
}
//
// Load embed objects from the compound file
//
bool
TOleDocument::Read()
{
// Load the embedded objects, if any
//
return OcDoc->LoadParts();
}
//
// Revert to last saved compound file
//
bool
TOleDocument::Revert(bool clear)
{
if (!StorageI)
return true; // return OK if storage already released
if (!TDocument::Revert(clear) || !ReleaseDoc())
return false;
if (!clear) {
InitDoc();
Open(0);
}
SetDirty(false);
return true;
}
//
// Get OWL application partner
//
TOcApp*
TOleDocument::GetOcApp()
{
TOleFrame* olefr = TYPESAFE_DOWNCAST(GetDocManager().GetApplication()->GetMainWindow(), TOleFrame);
return olefr->GetOcApp();
}
__OCF_END_NAMESPACE
//==============================================================================
| [
"Chris.Driver@taxsystems.com"
] | Chris.Driver@taxsystems.com |
82d66046230f8bad66698793fd97b3bfee7b1f32 | fee10e5c4ab189dd4aeea70761c80ae273e3098a | /src/ai/dnnf_engine__.hpp | e595035db98ae53dac2d1f128b6753c386cff74f | [] | no_license | frederic-koriche/ccpg | 9970a2456b2d3b1cc0679a4161c911799713440f | 178122d4ad3a72bf49b3373e4fc4ffd377d667aa | refs/heads/master | 2020-03-23T12:41:53.580866 | 2018-08-26T15:51:45 | 2018-08-26T15:51:45 | 141,575,514 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,233 | hpp | // -----------------------------------------------------------------------------
// Online Combinatorial Optimization
// dnnf_engine__.hpp
// -----------------------------------------------------------------------------
#ifndef DNNF_ENGINE__HPP
#define DNNF_ENGINE__HPP
#include "dnnf_circuit__.hpp"
// -----------------------------------------------------------------------------
// Abstract class Engine__<DNNF,Q>
// Inference engine for dDNNF using the push-weights dynamic programming scheme
// -----------------------------------------------------------------------------
template<query_t Q>
class Engine__<DNNF,Q>
{
protected: // Attributes
const Circuit<DNNF>& circuit__;
const uword n_literals__;
const uword n_nodes__;
const uword n_variables__;
public: // Constructors & Destructor
Engine__(const Circuit<DNNF>& circuit) :
circuit__(circuit),
n_literals__(circuit.n_literals()),
n_nodes__(circuit.n_nodes()),
n_variables__(circuit.n_variables())
{
}
~Engine__()
{
}
protected: // Push false node
inline void push_false_node(dvec& node_weights,
const uword index,
traits::ct)
{
node_weights[index] = 0.0;
}
inline void push_false_node(dvec& node_weights,
const uword index,
traits::min)
{
node_weights[index] = std::numeric_limits<double>::infinity();
}
inline void push_false_node(dvec& node_weights,
const uword index,
traits::max)
{
node_weights[index] = -std::numeric_limits<double>::infinity();
}
inline void push_false_node(dvec& node_weights, const uword index)
{
push_false_node(node_weights, index, traits::to_query<Q>());
}
protected: // Push true node
inline void push_true_node(dvec& node_weights,
const uword index,
traits::ct)
{
node_weights[index] = 1.0;
}
inline void push_true_node(dvec& node_weights,
const uword index,
traits::min)
{
node_weights[index] = 0.0;
}
inline void push_true_node(dvec& node_weights,
const uword index,
traits::max)
{
push_true_node(node_weights, index, traits::to_query<MIN>());
}
inline void push_true_node(dvec& node_weights, const uword index)
{
push_true_node(node_weights, index, traits::to_query<Q>());
}
protected: // Push literal node
inline void push_literal_node(dvec& node_weights,
const uword index,
const dvec& literal_weights)
{
uword x = circuit__.node_label(index).vars[0];
if(circuit__.node_label(index).sgn)
node_weights[index] = literal_weights[2 * x];
else
node_weights[index] = literal_weights[(2 * x) + 1];
}
protected: // Push and node
inline void push_and_node(dvec& node_weights,
const uword index,
traits::ct)
{
auto children = circuit__.out_edges(index);
node_weights[index] = 1.0;
for(auto c = children.begin(); c != children.end(); ++c)
node_weights[index] *= node_weights[c.col()];
}
inline void push_and_node(dvec& node_weights,
const uword index,
traits::min)
{
auto children = circuit__.out_edges(index);
node_weights[index] = 0.0;
for(auto c = children.begin(); c != children.end(); ++c)
node_weights[index] += node_weights[c.col()];
}
inline void push_and_node(dvec& node_weights,
const uword index,
traits::max)
{
push_and_node(node_weights, index, traits::to_query<MIN>());
}
inline void push_and_node(dvec& node_weights, const uword index)
{
push_and_node(node_weights, index, traits::to_query<Q>());
}
protected: // Push or node
inline void push_or_node(dvec& node_weights,
const uword index,
const dvec& literal_weights,
traits::ct)
{
auto children = circuit__.out_edges(index);
node_weights[index] = 0.0;
for(auto c = children.begin(); c != children.end(); ++c)
{
uword child = c.col();
const uvec& vars = circuit__.edge_label(index, child);
double edge_weight = 1;
for(uword i = 0; i < vars.size(); ++i)
{
uword x = vars[i];
double w = literal_weights[2 * x] + literal_weights[(2 * x) + 1];
edge_weight *= w;
}
node_weights[index] += (edge_weight * node_weights[child]);
}
}
inline void push_or_node(sp_dmat& edge_weights,
dvec& node_weights,
const uword index,
const dvec& literal_weights,
traits::ct)
{
auto children = circuit__.out_edges(index);
node_weights[index] = 0.0;
for(auto c = children.begin(); c != children.end(); ++c)
{
uword child = c.col();
const uvec& vars = circuit__.edge_label(index, child);
double edge_weight = 1;
for(uword i = 0; i < vars.size(); ++i)
{
uword x = vars[i];
double w = literal_weights[2 * x] + literal_weights[(2 * x) + 1];
edge_weight *= w;
}
edge_weights(index, child) = (edge_weight * node_weights[child]);
node_weights[index] += (edge_weight * node_weights[child]);
}
}
inline void push_or_node(sp_dmat& edge_weights,
dvec& node_weights,
const uword index,
const dvec& literal_weights,
traits::min)
{
auto children = circuit__.out_edges(index);
node_weights[index] = std::numeric_limits<double>::infinity();
for(auto c = children.begin(); c != children.end(); ++c)
{
uword child = c.col();
const uvec& vars = circuit__.edge_label(index, child);
double edge_weight = 0;
for(uword i = 0; i < vars.size(); ++i)
{
uword x = vars[i];
double w = std::min(literal_weights[2 * x], literal_weights[(2 * x) + 1]);
edge_weight += w;
}
edge_weights(index, child) = edge_weight + node_weights[child];
node_weights[index] = std::min(node_weights[index], edge_weight + node_weights[child]);
}
}
inline void push_or_node(sp_dmat& edge_weights,
dvec& node_weights,
const uword index,
const dvec& literal_weights,
traits::max)
{
auto children = circuit__.out_edges(index);
node_weights[index] = -std::numeric_limits<double>::infinity();
for(auto c = children.begin(); c != children.end(); ++c)
{
uword child = c.col();
const uvec& vars = circuit__.edge_label(index, child);
double edge_weight = 0;
for(uword i = 0; i < vars.size(); ++i)
{
uword x = vars[i];
double w = std::max(literal_weights[2 * x], literal_weights[(2 * x) + 1]);
edge_weight += w;
}
edge_weights(index, child) = edge_weight + node_weights[child];
node_weights[index] = std::max(node_weights[index], edge_weight + node_weights[child]);
}
}
inline void push_or_node(dvec& node_weights,
const uword index,
const dvec& literal_weights)
{
push_or_node(node_weights, index, literal_weights, traits::to_query<Q>());
}
inline void push_or_node(sp_dmat& edge_weights,
dvec& node_weights,
const uword index,
const dvec& literal_weights)
{
push_or_node(edge_weights, node_weights, index, literal_weights, traits::to_query<Q>());
}
protected: // get_weight
inline static double get_weight(const dvec& assignment,
const dvec& objective,
traits::min)
{
assert(objective.n_elem == assignment.n_elem);
return arma::dot(assignment,objective);
}
inline static double get_weight(const dvec& assignment,
const dvec& objective,
traits::max)
{
return get_weight(assignment,objective,traits::to_query<MIN>());
}
inline static double get_weight(const dvec& assignment,
const dvec& objective,
traits::ct)
{
assert(objective.n_elem == assignment.n_elem);
double w = 1;
for(uword x = 0; x < assignment.n_elem; ++x)
if(assignment[x] == 1.0)
w *= objective[x];
return w;
}
public: // public inference operations
inline static double get_weight(const dvec& assignment, const dvec& objective)
{
return get_weight(assignment,objective,traits::to_query<Q>());
}
inline void push_weights(dvec& node_weights, const dvec& literal_weights)
{
for(uword index = 0; index < n_nodes__; ++index)
switch(circuit__.node_label(index).type)
{
case 'a':
push_and_node(node_weights, index);
break;
case 'f':
push_false_node(node_weights, index);
break;
case 'l':
push_literal_node(node_weights, index, literal_weights);
break;
case 'o':
push_or_node(node_weights, index, literal_weights);
break;
case 't':
push_true_node(node_weights, index);
break;
}
}
inline void push_weights(sp_dmat& edge_weights, dvec& node_weights, const dvec& literal_weights)
{
for(uword index = 0; index < n_nodes__; ++index)
switch(circuit__.node_label(index).type)
{
case 'a':
push_and_node(node_weights, index);
break;
case 'f':
push_false_node(node_weights, index);
break;
case 'l':
push_literal_node(node_weights, index, literal_weights);
break;
case 'o':
push_or_node(edge_weights, node_weights, index, literal_weights);
break;
case 't':
push_true_node(node_weights, index);
break;
}
}
};
#endif
| [
"frederic.koriche@cril.univ-artois.fr"
] | frederic.koriche@cril.univ-artois.fr |
92ac97eee0f993faddb31b0b4ad83e55e7c82cf0 | e51d009c6c6a1633c2c11ea4e89f289ea294ec7e | /xr2-dsgn/sources/xray/editor/base/sources/editor_creator.cpp | a8bba7087ad8331121f5d4d34321e1a57a3a99a9 | [] | no_license | avmal0-Cor/xr2-dsgn | a0c726a4d54a2ac8147a36549bc79620fead0090 | 14e9203ee26be7a3cb5ca5da7056ecb53c558c72 | refs/heads/master | 2023-07-03T02:05:00.566892 | 2021-08-06T03:10:53 | 2021-08-06T03:10:53 | 389,939,196 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 478 | cpp | ////////////////////////////////////////////////////////////////////////////
// Created : 05.08.2010
// Author : Sergey Pryshchepa
// Copyright (C) GSC Game World - 2010
////////////////////////////////////////////////////////////////////////////
#include "pch.h"
#include "editor_creator.h"
using xray::editor_base::editor_creator;
void editor_creator::set_memory_allocator(xray::editor_base::allocator_type* allocator)
{
ASSERT(!g_allocator);
g_allocator = allocator;
}
| [
"youalexandrov@icloud.com"
] | youalexandrov@icloud.com |
637e4bd19074dd69c526a36662c3b4e88ac2e7e1 | 519de3b9fca2d6f905e7f3498884094546432c30 | /kk-4.x/frameworks/av/media/libmediaplayerservice/nuplayer/StreamingSource.h | ce7be8bae9de93892cc9cec762ac2a00da2a3280 | [
"Apache-2.0",
"LicenseRef-scancode-unicode"
] | permissive | hongshui3000/mt5507_android_4.4 | 2324e078190b97afbc7ceca22ec1b87b9367f52a | 880d4424989cf91f690ca187d6f0343df047da4f | refs/heads/master | 2020-03-24T10:34:21.213134 | 2016-02-24T05:57:53 | 2016-02-24T05:57:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,571 | h | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef STREAMING_SOURCE_H_
#define STREAMING_SOURCE_H_
#include "NuPlayer.h"
#include "NuPlayerSource.h"
namespace android {
struct ABuffer;
struct ATSParser;
struct NuPlayer::StreamingSource : public NuPlayer::Source {
StreamingSource(
const sp<AMessage> ¬ify,
const sp<IStreamSource> &source);
virtual void prepareAsync();
virtual void setUrlBeforeSeek(const char *url);
virtual void start();
virtual status_t feedMoreTSData();
virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
virtual bool isRealTime() const;
protected:
virtual ~StreamingSource();
virtual sp<MetaData> getFormatMeta(bool audio);
private:
sp<IStreamSource> mSource;
status_t mFinalResult;
sp<NuPlayerStreamListener> mStreamListener;
sp<ATSParser> mTSParser;
DISALLOW_EVIL_CONSTRUCTORS(StreamingSource);
};
} // namespace android
#endif // STREAMING_SOURCE_H_
| [
"342981011@qq.com"
] | 342981011@qq.com |
4ed2932fc5efbd1f3b1b7fc4e969fe65b0ce2637 | c6d740867f864b48b63b7bc47a91492b384252d2 | /include/sliding_window/search/compute_simple_model.hpp | 456d122de5aa8c5eaf2e980f61b3412315eaedfc | [
"BSD-3-Clause"
] | permissive | marehr/sliding-window | de5b8f9cad990fe068843bec7aad7f44f795d886 | 036af20e1b311e8deb4465fdf2f8e4ce887c4300 | refs/heads/master | 2023-08-28T01:47:26.956809 | 2021-10-14T13:34:14 | 2021-10-14T13:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 242 | hpp | #pragma once
#include <sliding_window/search/minimiser_model.hpp>
#include <sliding_window/shared.hpp>
namespace sliding_window
{
std::vector<size_t> compute_simple_model(search_arguments const & arguments);
} // namespace sliding_window
| [
"evelin.aasna@fu-berlin.de"
] | evelin.aasna@fu-berlin.de |
cefa67cacc12fdc2d3f8351faa87397337c7cff7 | fa21a16149fec2b2a04647d69674f5b8a228bf15 | /RenderCore/Assets/ModelRunTime.cpp | 515d2bc932fe66928ec76110574568216d955ba1 | [
"MIT"
] | permissive | yorung/XLE | 3581cbe3ed455b8a27e97ed615e1f6f96d42ae85 | 083ce4c9d3fe32002ff5168e571cada2715bece4 | refs/heads/master | 2020-03-29T10:07:35.485095 | 2015-08-29T07:51:02 | 2015-08-29T07:51:02 | 30,400,035 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 80,163 | cpp | // Copyright 2015 XLGAMES Inc.
//
// Distributed under the MIT License (See
// accompanying file "LICENSE" or the website
// http://www.opensource.org/licenses/mit-license.php)
#include "ModelRunTime.h"
#include "ModelRunTimeInternal.h"
#include "DelayedDrawCall.h"
#include "MaterialScaffold.h"
#include "TransformationCommands.h"
#include "AssetUtils.h" // maybe only needed for chunk ids
#include "Material.h"
#include "RawAnimationCurve.h"
#include "SharedStateSet.h"
#include "DeferredShaderResource.h"
#include "../Techniques/Techniques.h"
#include "../Techniques/ResourceBox.h"
#include "../Techniques/ParsingContext.h"
#include "../Techniques/CommonResources.h"
#include "../Techniques/PredefinedCBLayout.h"
#include "../Metal/Buffer.h"
#include "../Metal/State.h"
#include "../Metal/DeviceContext.h"
#include "../Metal/DeviceContextImpl.h"
#include "../Resource.h"
#include "../RenderUtils.h"
#include "../../Assets/AssetUtils.h"
#include "../../Assets/BlockSerializer.h"
#include "../../Assets/ChunkFile.h"
#include "../../Assets/IntermediateAssets.h"
#include "../../Core/Exceptions.h"
#include "../../Utility/PtrUtils.h"
#include "../../Utility/Streams/FileUtils.h"
#include "../../Utility/IteratorUtils.h"
#include "../../Utility/StringFormat.h"
#include "../../Math/Transformations.h"
#include "../../ConsoleRig/Console.h"
#include <string>
#pragma warning(disable:4189)
namespace RenderCore { namespace Assets
{
using ::Assets::ResChar;
/// <summary>Internal namespace with utilities for constructing models</summary>
/// These functions are normally used within the constructor of ModelRenderer
namespace ModelConstruction
{
static const std::string DefaultShader = "illum";
static size_t InsertOrCombine(std::vector<std::vector<uint8>>& dest, std::vector<uint8>&& compare)
{
assert(compare.size());
for (auto i = dest.cbegin(); i!=dest.cend(); ++i) {
if (i->size() == compare.size() && (XlCompareMemory(AsPointer(i->begin()), AsPointer(compare.begin()), i->size()) == 0)) {
return std::distance(dest.cbegin(), i);
}
}
dest.push_back(std::forward<std::vector<uint8>>(compare));
return dest.size()-1;
}
struct SubMatResources
{
unsigned _shaderName;
unsigned _matParams;
unsigned _constantBuffer;
unsigned _texturesIndex;
unsigned _renderStateSet;
DelayStep _delayStep;
};
static const ModelCommandStream::GeoCall& GetGeoCall(const ModelScaffold& scaffold, unsigned geoCallIndex)
{
// get the "RawGeometry" object in the given scaffold for the give
// geocall index. This will query both unskinned and skinned raw calls
auto& cmdStream = scaffold.CommandStream();
auto geoCallCount = cmdStream.GetGeoCallCount();
return (geoCallIndex < geoCallCount) ? cmdStream.GetGeoCall(geoCallIndex) : cmdStream.GetSkinCall(geoCallIndex - geoCallCount);
}
static const RawGeometry& GetGeo(const ModelScaffold& scaffold, unsigned geoCallIndex)
{
// get the "RawGeometry" object in the given scaffold for the give
// geocall index. This will query both unskinned and skinned raw calls
auto& meshData = scaffold.ImmutableData();
auto geoCallCount = scaffold.CommandStream().GetGeoCallCount();
auto& geoCall = GetGeoCall(scaffold, geoCallIndex);
return (geoCallIndex < geoCallCount) ? meshData._geos[geoCall._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoCall._geoId];
}
static unsigned GetDrawCallCount(const ModelScaffold& scaffold, unsigned geoCallIndex)
{
return (unsigned)GetGeo(scaffold, geoCallIndex)._drawCallsCount;
}
static MaterialGuid ScaffoldMaterialIndex(const ModelScaffold& scaffold, unsigned geoCallIndex, unsigned drawCallIndex)
{
auto& meshData = scaffold.ImmutableData();
auto geoCallCount = scaffold.CommandStream().GetGeoCallCount();
auto& geoCall = GetGeoCall(scaffold, geoCallIndex);
auto& geo = (geoCallIndex < geoCallCount) ? meshData._geos[geoCall._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoCall._geoId];
unsigned subMatI = geo._drawCalls[drawCallIndex]._subMaterialIndex;
// the "sub material index" in the draw call is an index
// into the array in the geo call
if (subMatI < geoCall._materialCount) {
return geoCall._materialGuids[subMatI];
}
return ~unsigned(0x0);
}
template <typename T> static bool AtLeastOneValidDrawCall(const RawGeometry& geo, const ModelScaffold& scaffold, unsigned geoCallIndex, std::vector<std::pair<MaterialGuid, T>>& subMatResources)
{
// look for at least one valid draw call in this geo instance
// a valid draw call should have got shader and material information bound
bool atLeastOneValidDrawCall = false;
for (unsigned di=0; di<geo._drawCallsCount; ++di) {
auto& d = geo._drawCalls[di];
if (d._indexCount) {
auto subMatIndex = ScaffoldMaterialIndex(scaffold, geoCallIndex, di);
auto snm = LowerBound(subMatResources, subMatIndex);
if (snm != subMatResources.cend() && snm->first == subMatIndex) {
return true;
}
}
}
return false; // didn't find any draw calls with good material information. This whole geo object can be ignored.
}
static void LoadBlock(BasicFile& file, uint8 destination[], size_t fileOffset, size_t readSize)
{
file.Seek(fileOffset, SEEK_SET);
file.Read(destination, 1, readSize);
}
static bool HasElement(const GeoInputAssembly& ia, const char name[])
{
auto end = &ia._elements[ia._elementCount];
return std::find_if(
ia._elements, end,
[=](const VertexElement& ele) { return !XlCompareString(ele._semantic, name); }) != end;
}
#if defined(_DEBUG)
static std::string MakeDescription(const ParameterBox& paramBox)
{
std::vector<std::pair<const utf8*, std::string>> defines;
BuildStringTable(defines, paramBox);
std::stringstream dst;
for (auto i=defines.cbegin(); i!=defines.cend(); ++i) {
if (i != defines.cbegin()) { dst << "; "; }
dst << i->first << " = " << i->second;
}
return dst.str();
}
class ParamBoxDescriptions
{
public:
void Add(unsigned index, const ParameterBox& box)
{
auto existing = LowerBound(_descriptions, index);
if (existing == _descriptions.end() || existing->first != index) {
_descriptions.insert(existing, std::make_pair(index, MakeDescription(box)));
}
}
std::vector<std::pair<unsigned,std::string>> _descriptions;
};
#else
class ParamBoxDescriptions
{
public:
void Add(unsigned index, const ParameterBox& box) {}
};
#endif
static unsigned BuildGeoParamBox(
const GeoInputAssembly& ia, SharedStateSet& sharedStateSet,
ModelConstruction::ParamBoxDescriptions& paramBoxDesc, bool normalFromSkinning)
{
// Build a parameter box for this geometry configuration. The input assembly
ParameterBox geoParameters;
if (HasElement(ia, "TEXCOORD")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_TEXCOORD", 1); }
if (HasElement(ia, "COLOR")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_COLOUR", 1); }
if (HasElement(ia, "NORMAL") || normalFromSkinning)
{ geoParameters.SetParameter((const utf8*)"GEO_HAS_NORMAL", 1); }
if (HasElement(ia, "TEXTANGENT")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_TANGENT_FRAME", 1); }
if (HasElement(ia, "TEXBITANGENT")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_BITANGENT", 1); }
if (HasElement(ia, "BONEINDICES") && HasElement(ia, "BONEWEIGHTS"))
{ geoParameters.SetParameter((const utf8*)"GEO_HAS_SKIN_WEIGHTS", 1); }
auto result = sharedStateSet.InsertParameterBox(geoParameters);
paramBoxDesc.Add(result, geoParameters);
return result;
}
static const auto DefaultNormalsTextureBindingHash = ParameterBox::MakeParameterNameHash("NormalsTexture");
static std::vector<std::pair<MaterialGuid, SubMatResources>> BuildMaterialResources(
const ModelScaffold& scaffold, const MaterialScaffold& matScaffold,
SharedStateSet& sharedStateSet, unsigned levelOfDetail,
std::vector<uint64>& textureBindPoints,
std::vector<std::vector<uint8>>& prescientMaterialConstantBuffers,
ParamBoxDescriptions& paramBoxDesc, const Techniques::PredefinedCBLayout& cbLayout,
const ::Assets::DirectorySearchRules* searchRules)
{
std::vector<std::pair<MaterialGuid, SubMatResources>> materialResources;
auto& cmdStream = scaffold.CommandStream();
auto& meshData = scaffold.ImmutableData();
auto geoCallCount = cmdStream.GetGeoCallCount();
auto skinCallCount = cmdStream.GetSkinCallCount();
for (unsigned gi=0; gi<geoCallCount + skinCallCount; ++gi) {
auto& geoInst = (gi < geoCallCount) ? cmdStream.GetGeoCall(gi) : cmdStream.GetSkinCall(gi - geoCallCount);
if (geoInst._levelOfDetail != levelOfDetail) { continue; }
// Lookup the mesh geometry and material information from their respective inputs.
auto& geo = (gi < geoCallCount) ? meshData._geos[geoInst._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoInst._geoId];
for (unsigned di=0; di<geo._drawCallsCount; ++di) {
auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, gi, di);
auto existing = LowerBound(materialResources, scaffoldMatIndex);
if (existing == materialResources.cend() || existing->first != scaffoldMatIndex) {
materialResources.insert(existing, std::make_pair(scaffoldMatIndex, SubMatResources()));
}
}
}
// fill in the details for all of the material references we found
for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) {
std::string shaderName = DefaultShader;
i->second._shaderName = sharedStateSet.InsertShaderName(shaderName);
i->second._texturesIndex = (unsigned)std::distance(materialResources.begin(), i);
}
// build material constants
for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) {
auto* matData = matScaffold.GetMaterial(i->first);
auto cbData = matData ? cbLayout.BuildCBDataAsVector(matData->_constants) : std::vector<uint8>(cbLayout._cbSize, uint8(0));
i->second._constantBuffer =
(unsigned)InsertOrCombine(
prescientMaterialConstantBuffers,
std::move(cbData));
}
// configure the texture bind points array & material parameters box
for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) {
ParameterBox materialParamBox;
RenderStateSet stateSet;
// we need to create a list of all of the texture bind points that are referenced
// by all of the materials used here. They will end up in sorted order
auto* matData = matScaffold.GetMaterial(i->first);
if (matData) {
const auto& materialScaffoldData = i->first;
materialParamBox = matData->_matParams;
stateSet = matData->_stateSet;
for (auto param = matData->_bindings.Begin(); !param.IsEnd(); ++param) {
materialParamBox.SetParameter(
(const utf8*)(StringMeld<64, utf8>() << "RES_HAS_" << param.Name()), 1);
auto bindNameHash = Hash64((const char*)param.Name());
auto q = std::lower_bound(textureBindPoints.begin(), textureBindPoints.end(), bindNameHash);
if (q != textureBindPoints.end() && *q == bindNameHash) { continue; }
textureBindPoints.insert(q, bindNameHash);
}
auto boundNormalMapName = matData->_bindings.GetString<::Assets::ResChar>(DefaultNormalsTextureBindingHash);
if (!boundNormalMapName.empty()) {
// We need to decide whether the normal map is "DXT"
// format or not. This information isn't in the material
// itself; we actually need to look at the texture file
// to see what format it is. Unfortunately that means
// opening the texture file to read it's header. However
// we can accelerate it a bit by caching the result
bool isDxtNormalMap = false;
if (searchRules) {
::Assets::ResChar resolvedPath[MaxPath];
searchRules->ResolveFile(resolvedPath, dimof(resolvedPath), boundNormalMapName.c_str());
isDxtNormalMap = IsDXTNormalMap(resolvedPath);
} else
isDxtNormalMap = IsDXTNormalMap(boundNormalMapName);
materialParamBox.SetParameter((const utf8*)"RES_HAS_NormalsTexture_DXT", isDxtNormalMap);
}
}
i->second._matParams = sharedStateSet.InsertParameterBox(materialParamBox);
i->second._renderStateSet = sharedStateSet.InsertRenderStateSet(stateSet);
i->second._delayStep =
(stateSet._forwardBlendOp == Metal::BlendOp::NoBlending) ? DelayStep::OpaqueRender : DelayStep::PostDeferred;
paramBoxDesc.Add(i->second._matParams, materialParamBox);
}
return materialResources;
}
std::vector<const DeferredShaderResource*> BuildBoundTextures(
const ModelScaffold& scaffold, const MaterialScaffold& matScaffold,
const ::Assets::DirectorySearchRules* searchRules,
const std::vector<std::pair<MaterialGuid, SubMatResources>>& materialResources,
const std::vector<uint64>& textureBindPoints, unsigned textureSetCount,
std::vector<::Assets::rstring>& boundTextureNames)
{
auto texturesPerMaterial = textureBindPoints.size();
std::vector<const DeferredShaderResource*> boundTextures;
boundTextures.resize(textureSetCount * texturesPerMaterial, nullptr);
DEBUG_ONLY(boundTextureNames.resize(textureSetCount * texturesPerMaterial));
for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) {
unsigned textureSetIndex = i->second._texturesIndex;
auto* matData = matScaffold.GetMaterial(i->first);
if (!matData) { continue; }
for (auto param=matData->_bindings.Begin(); !param.IsEnd(); ++param) {
auto bindNameHash = Hash64((const char*)param.Name());
auto i = std::find(textureBindPoints.cbegin(), textureBindPoints.cend(), bindNameHash);
assert(i!=textureBindPoints.cend() && *i == bindNameHash);
auto index = std::distance(textureBindPoints.cbegin(), i);
auto resourceName = matData->_bindings.GetString<::Assets::ResChar>(param.HashName());
if (resourceName.empty()) continue;
TRY {
// note -- Ideally we want to do this filename resolve in a background thread
// however, it doesn't work well with our resources system. Because we're
// expecting to create the DeferredShaderResource from a definitive file
// name, something that can be matched against other (already loaded) resources.
// So we need something different here... Something that can resolve a filename
// in the background, and then return a shareable resource afterwards
auto dsti = textureSetIndex*texturesPerMaterial + index;
if (searchRules) {
ResChar resolvedPath[MaxPath];
searchRules->ResolveFile(resolvedPath, dimof(resolvedPath), resourceName.c_str());
boundTextures[dsti] = &::Assets::GetAssetDep<DeferredShaderResource>(resolvedPath);
DEBUG_ONLY(boundTextureNames[dsti] = resolvedPath);
} else {
boundTextures[dsti] = &::Assets::GetAssetDep<DeferredShaderResource>(resourceName.c_str());
DEBUG_ONLY(boundTextureNames[dsti] = resourceName);
}
} CATCH (const ::Assets::Exceptions::InvalidAsset&) {
LogWarning << "Warning -- shader resource (" << resourceName << ") couldn't be found";
} CATCH_END
}
}
return std::move(boundTextures);
}
class BuffersUnderConstruction
{
public:
unsigned _vbSize;
unsigned _ibSize;
unsigned AllocateIB(unsigned size, RenderCore::Metal::NativeFormat::Enum format)
{
unsigned allocation = _ibSize;
// we have to align the index buffer offset correctly
unsigned indexStride = (format == RenderCore::Metal::NativeFormat::R32_UINT)?4:2;
unsigned rem = _ibSize % indexStride;
if (rem != 0) {
allocation += indexStride - rem;
}
_ibSize = allocation + size;
return allocation;
}
unsigned AllocateVB(unsigned size)
{
unsigned result = _vbSize;
_vbSize += size;
return result;
}
BuffersUnderConstruction() : _vbSize(0), _ibSize(0) {}
};
}
unsigned BuildLowLevelInputAssembly(
Metal::InputElementDesc dst[], unsigned dstMaxCount,
const VertexElement* source, unsigned sourceCount,
unsigned lowLevelSlot)
{
unsigned vertexElementCount = 0;
for (unsigned i=0; i<sourceCount; ++i) {
auto& sourceElement = source[i];
assert((vertexElementCount+1) <= dstMaxCount);
if ((vertexElementCount+1) <= dstMaxCount) {
// in some cases we need multiple "slots". When we have multiple slots, the vertex data
// should be one after another in the vb (that is, not interleaved)
dst[vertexElementCount++] = Metal::InputElementDesc(
sourceElement._semantic, sourceElement._semanticIndex,
Metal::NativeFormat::Enum(sourceElement._format), lowLevelSlot, sourceElement._startOffset);
}
}
return vertexElementCount;
}
ModelRenderer::ModelRenderer(
const ModelScaffold& scaffold, const MaterialScaffold& matScaffold,
SharedStateSet& sharedStateSet,
const ::Assets::DirectorySearchRules* searchRules, unsigned levelOfDetail)
{
using namespace ModelConstruction;
const auto& cbLayout = ::Assets::GetAssetDep<Techniques::PredefinedCBLayout>("game/xleres/BasicMaterialConstants.txt");
// build the underlying objects required to render the given scaffold
// (at the given level of detail)
std::vector<uint64> textureBindPoints;
std::vector<std::vector<uint8>> prescientMaterialConstantBuffers;
ModelConstruction::ParamBoxDescriptions paramBoxDesc;
auto materialResources = BuildMaterialResources(
scaffold, matScaffold, sharedStateSet, levelOfDetail,
textureBindPoints, prescientMaterialConstantBuffers,
paramBoxDesc, cbLayout, searchRules);
// one "textureset" for each sub material (though, in theory, we could
// combine texture sets for materials that share the same textures
unsigned textureSetCount = unsigned(materialResources.size());
auto& cmdStream = scaffold.CommandStream();
auto& meshData = scaffold.ImmutableData();
// First we need to bind each draw call to a material in our
// material scaffold. Then we need to find the superset of all bound textures
// This superset will be used to initialize all of the technique
// input interfaces
// The final resolved texture is defined by the "meshCall" object and by the
// "drawCall" objects. MeshCall gives us the material id, and the draw call
// gives us the sub material id.
// Note that we can have cases where the same mesh is referenced multiple times by
// a single "geo call". In these cases, we want the mesh data to be stored once
// in the vertex buffer / index buffer but for there to be multiple sets of "draw calls"
// So, we have to separate the mesh processing from the draw call processing here
BuffersUnderConstruction workingBuffers;
auto geoCallCount = cmdStream.GetGeoCallCount();
auto skinCallCount = cmdStream.GetSkinCallCount();
auto drawCallCount = 0;
for (unsigned c=0; c<geoCallCount + skinCallCount; ++c) { drawCallCount += GetDrawCallCount(scaffold, c); }
// We should calculate the size we'll need for nascentIB & nascentVB first,
// so we don't have to do any reallocations
////////////////////////////////////////////////////////////////////////
// u n s k i n n e d g e o //
std::vector<Pimpl::Mesh> meshes;
std::vector<Pimpl::MeshAndDrawCall> drawCalls;
std::vector<Pimpl::DrawCallResources> drawCallRes;
drawCalls.reserve(drawCallCount);
drawCallRes.reserve(drawCallCount);
for (unsigned gi=0; gi<geoCallCount; ++gi) {
auto& geoInst = cmdStream.GetGeoCall(gi);
if (geoInst._levelOfDetail != levelOfDetail) { continue; }
// Check to see if this mesh has at least one valid draw call. If there
// is none, we can skip it completely
assert(geoInst._geoId < meshData._geoCount);
auto& geo = meshData._geos[geoInst._geoId];
if (!AtLeastOneValidDrawCall(geo, scaffold, gi, materialResources)) { continue; }
// if we encounter the same mesh multiple times, we don't need to store it every time
auto mesh = FindIf(meshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoInst._geoId; });
if (mesh == meshes.end()) {
meshes.push_back(
Pimpl::BuildMesh(
geoInst, geo, workingBuffers, sharedStateSet,
AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size(),
paramBoxDesc));
mesh = meshes.end()-1;
}
// setup the "Draw call" objects next
for (unsigned di=0; di<geo._drawCallsCount; ++di) {
auto& d = geo._drawCalls[di];
if (!d._indexCount) { continue; }
auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, gi, di);
auto matResI = LowerBound(materialResources, scaffoldMatIndex);
if (matResI == materialResources.cend() || matResI->first != scaffoldMatIndex) {
continue; // missing shader name means a "no-draw" shader
}
const auto& matRes = matResI->second;
// "Draw call resources" are used when performing this draw call.
// They help select the right shader, and are also required for
// setting the graphics state (bound textures and shader constants, etc)
// We can initialise them now using some information from the geometry
// object and some information from the material.
Pimpl::DrawCallResources res(
matRes._shaderName,
mesh->_geoParamBox, matRes._matParams,
matRes._texturesIndex, matRes._constantBuffer,
matRes._renderStateSet, matRes._delayStep, scaffoldMatIndex);
drawCallRes.push_back(res);
drawCalls.push_back(std::make_pair(gi, d));
}
}
////////////////////////////////////////////////////////////////////////
// s k i n n e d g e o //
std::vector<Pimpl::SkinnedMesh> skinnedMeshes;
std::vector<Pimpl::MeshAndDrawCall> skinnedDrawCalls;
std::vector<Pimpl::SkinnedMeshAnimBinding> skinnedBindings;
for (unsigned gi=0; gi<skinCallCount; ++gi) {
auto& geoInst = cmdStream.GetSkinCall(gi);
if (geoInst._levelOfDetail != levelOfDetail) { continue; }
// Check to see if this mesh has at least one valid draw call. If there
// is none, we can skip it completely
assert(geoInst._geoId < meshData._boundSkinnedControllerCount);
auto& geo = meshData._boundSkinnedControllers[geoInst._geoId];
if (!AtLeastOneValidDrawCall(geo, scaffold, unsigned(geoCallCount + gi), materialResources)) { continue; }
// if we encounter the same mesh multiple times, we don't need to store it every time
auto mesh = FindIf(skinnedMeshes, [=](const Pimpl::SkinnedMesh& mesh) { return mesh._id == geoInst._geoId; });
if (mesh == skinnedMeshes.end()) {
skinnedMeshes.push_back(
Pimpl::BuildMesh(geoInst, geo, workingBuffers, sharedStateSet,
AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size(),
paramBoxDesc));
skinnedBindings.push_back(
Pimpl::BuildAnimBinding(
geoInst, geo, sharedStateSet,
AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size()));
mesh = skinnedMeshes.end()-1;
}
for (unsigned di=0; di<geo._drawCallsCount; ++di) {
auto& d = geo._drawCalls[di];
if (!d._indexCount) { continue; }
auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, unsigned(geoCallCount + gi), di);
auto subMatResI = LowerBound(materialResources, scaffoldMatIndex);
if (subMatResI == materialResources.cend() || subMatResI->first != scaffoldMatIndex) {
continue; // missing shader name means a "no-draw" shader
}
auto& matRes = subMatResI->second;
Pimpl::DrawCallResources res(
matRes._shaderName,
mesh->_geoParamBox, matRes._matParams,
matRes._texturesIndex, matRes._constantBuffer,
matRes._renderStateSet, matRes._delayStep, scaffoldMatIndex);
drawCallRes.push_back(res);
skinnedDrawCalls.push_back(std::make_pair(gi, d));
}
}
////////////////////////////////////////////////////////////////////////
//
// We have to load the "large blocks" from the file here
// -- todo -- this part can be pushed into the background
// using the buffer uploads system
//
std::vector<uint8> nascentVB, nascentIB;
nascentVB.resize(workingBuffers._vbSize);
nascentIB.resize(workingBuffers._ibSize);
BasicFile file(scaffold.Filename().c_str(), "rb");
auto largeBlocksOffset = scaffold.LargeBlocksOffset();
for (auto m=meshes.begin(); m!=meshes.end(); ++m) {
LoadBlock(file, &nascentIB[m->_ibOffset], largeBlocksOffset + m->_sourceFileIBOffset, m->_sourceFileIBSize);
LoadBlock(file, &nascentVB[m->_vbOffset], largeBlocksOffset + m->_sourceFileVBOffset, m->_sourceFileVBSize);
}
for (auto m=skinnedMeshes.begin(); m!=skinnedMeshes.end(); ++m) {
LoadBlock(file, &nascentIB[m->_ibOffset], largeBlocksOffset + m->_sourceFileIBOffset, m->_sourceFileIBSize);
LoadBlock(file, &nascentVB[m->_vbOffset], largeBlocksOffset + m->_sourceFileVBOffset, m->_sourceFileVBSize);
for (unsigned s=0; s<Pimpl::SkinnedMesh::VertexStreams::Max; ++s) {
LoadBlock(file, &nascentVB[m->_extraVbOffset[s]], largeBlocksOffset + m->_sourceFileExtraVBOffset[s], m->_sourceFileExtraVBSize[s]);
}
}
////////////////////////////////////////////////////////////////////////
// now that we have a list of all of the sub materials used, and we know how large the resource
// interface is, we build an array of deferred shader resources for shader inputs.
std::vector<::Assets::rstring> boundTextureNames;
auto boundTextures = BuildBoundTextures(
scaffold, matScaffold, searchRules,
materialResources, textureBindPoints, textureSetCount,
boundTextureNames);
////////////////////////////////////////////////////////////////////////
std::vector<Metal::ConstantBuffer> finalConstantBuffers;
for (auto cb=prescientMaterialConstantBuffers.cbegin(); cb!=prescientMaterialConstantBuffers.end(); ++cb) {
assert(cb->size());
Metal::ConstantBuffer newCB(AsPointer(cb->begin()), cb->size());
finalConstantBuffers.push_back(std::move(newCB));
}
Metal::VertexBuffer vb(AsPointer(nascentVB.begin()), nascentVB.size());
Metal::IndexBuffer ib(AsPointer(nascentIB.begin()), nascentIB.size());
////////////////////////////////////////////////////////////////////////
_validationCallback = std::make_shared<::Assets::DependencyValidation>();
::Assets::RegisterAssetDependency(_validationCallback, cbLayout.GetDependencyValidation());
for (const auto& t:boundTextures) if (t) ::Assets::RegisterAssetDependency(_validationCallback, t->GetDependencyValidation()); // rebuild the entire renderer if any texture changes
auto pimpl = std::make_unique<Pimpl>();
pimpl->_vertexBuffer = std::move(vb);
pimpl->_indexBuffer = std::move(ib);
pimpl->_meshes = std::move(meshes);
pimpl->_skinnedMeshes = std::move(skinnedMeshes);
pimpl->_skinnedBindings = std::move(skinnedBindings);
pimpl->_drawCalls = std::move(drawCalls);
pimpl->_drawCallRes = std::move(drawCallRes);
pimpl->_skinnedDrawCalls = std::move(skinnedDrawCalls);
pimpl->_boundTextures = std::move(boundTextures);
pimpl->_constantBuffers = std::move(finalConstantBuffers);
pimpl->_texturesPerMaterial = textureBindPoints.size();
pimpl->_scaffold = &scaffold;
pimpl->_levelOfDetail = levelOfDetail;
#if defined(_DEBUG)
pimpl->_vbSize = (unsigned)nascentVB.size();
pimpl->_ibSize = (unsigned)nascentIB.size();
pimpl->_boundTextureNames = std::move(boundTextureNames);
pimpl->_paramBoxDesc = std::move(paramBoxDesc._descriptions);
#endif
_pimpl = std::move(pimpl);
DEBUG_ONLY(LogReport());
}
ModelRenderer::~ModelRenderer()
{}
class ModelRenderingBox
{
public:
class Desc {};
Metal::ConstantBuffer _localTransformBuffer;
ModelRenderingBox(const Desc&)
{
Metal::ConstantBuffer localTransformBuffer(nullptr, sizeof(Techniques::LocalTransformConstants));
_localTransformBuffer = std::move(localTransformBuffer);
}
~ModelRenderingBox() {}
};
Metal::BoundUniforms* ModelRenderer::Pimpl::BeginVariation(
const ModelRendererContext& context,
const SharedStateSet& sharedStateSet,
unsigned drawCallIndex,
TechniqueInterface techniqueInterface) const
{
static Utility::ParameterBox tempGlobalStatesBox;
const auto& res = _drawCallRes[drawCallIndex];
sharedStateSet.BeginRenderState(context, tempGlobalStatesBox, res._renderStateSet);
return sharedStateSet.BeginVariation(
context, res._shaderName, techniqueInterface, res._geoParamBox, res._materialParamBox);
}
auto ModelRenderer::Pimpl::BeginGeoCall(
const ModelRendererContext& context,
Metal::ConstantBuffer& localTransformBuffer,
const MeshToModel* transforms,
const Float4x4& modelToWorld,
unsigned geoCallIndex) const -> TechniqueInterface
{
auto& cmdStream = _scaffold->CommandStream();
auto& geoCall = cmdStream.GetGeoCall(geoCallIndex);
if (transforms) {
auto localToModel = transforms->GetMeshToModel(geoCall._transformMarker);
Techniques::LocalTransformConstants trans;
trans = Techniques::MakeLocalTransform(Combine(localToModel, modelToWorld), ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld));
localTransformBuffer.Update(*context._context, &trans, sizeof(trans));
}
// todo -- should be possible to avoid this search
auto mesh = FindIf(_meshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoCall._geoId; });
assert(mesh != _meshes.end());
auto& devContext = *context._context;
devContext.Bind(_indexBuffer, Metal::NativeFormat::Enum(mesh->_indexFormat), mesh->_ibOffset);
devContext.Bind(ResourceList<Metal::VertexBuffer, 1>(std::make_tuple(std::ref(_vertexBuffer))), mesh->_vertexStride, mesh->_vbOffset);
return mesh->_techniqueInterface;
}
auto ModelRenderer::Pimpl::BeginSkinCall(
const ModelRendererContext& context,
Metal::ConstantBuffer& localTransformBuffer,
const MeshToModel* transforms,
const Float4x4& modelToWorld,
unsigned geoCallIndex,
PreparedAnimation* preparedAnimation) const -> TechniqueInterface
{
auto& cmdStream = _scaffold->CommandStream();
auto& geoCall = cmdStream.GetSkinCall(geoCallIndex);
// We only need to use the "transforms" array when we don't
// have prepared animation
// (otherwise that information gets burned into the
// prepared vertex positions)
if (!preparedAnimation && transforms) {
auto meshToWorld = Combine(transforms->GetMeshToModel(geoCall._transformMarker), modelToWorld);
auto trans = Techniques::MakeLocalTransform(modelToWorld, ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld));
localTransformBuffer.Update(*context._context, &trans, sizeof(trans));
}
auto cm = FindIf(_skinnedMeshes, [=](const Pimpl::SkinnedMesh& mesh) { return mesh._id == geoCall._geoId; });
assert(cm != _skinnedMeshes.end());
auto meshIndex = std::distance(_skinnedMeshes.cbegin(), cm);
auto result = cm->_skinnedTechniqueInterface;
auto& devContext = *context._context;
devContext.Bind(_indexBuffer, Metal::NativeFormat::Enum(cm->_indexFormat), cm->_ibOffset);
auto animGeo = SkinnedMesh::VertexStreams::AnimatedGeo;
UINT strides[2], offsets[2];
ID3D::Buffer* underlyingVBs[2];
strides[0] = cm->_extraVbStride[animGeo];
offsets[0] = cm->_extraVbOffset[animGeo];
strides[1] = cm->_vertexStride;
offsets[1] = cm->_vbOffset;
underlyingVBs[0] = underlyingVBs[1] = _vertexBuffer.GetUnderlying();
// If we have a prepared animation, we have to replace the bindings
// with the data from there.
if (preparedAnimation) {
underlyingVBs[0] = preparedAnimation->_skinningBuffer.GetUnderlying();
strides[0] = _skinnedBindings[meshIndex]._vertexStride;
offsets[0] = preparedAnimation->_vbOffsets[meshIndex];
result = _skinnedBindings[meshIndex]._techniqueInterface;
}
context._context->GetUnderlying()->IASetVertexBuffers(0, 2, underlyingVBs, strides, offsets);
return result;
}
void ModelRenderer::Pimpl::ApplyBoundUnforms(
const ModelRendererContext& context,
Metal::BoundUniforms& boundUniforms,
unsigned resourcesIndex,
unsigned constantsIndex,
const Metal::ConstantBuffer* cbs[2])
{
const Metal::ShaderResourceView* srvs[16];
assert(_texturesPerMaterial <= dimof(srvs));
for (unsigned c=0; c<_texturesPerMaterial; c++) {
auto* t = _boundTextures[resourcesIndex * _texturesPerMaterial + c];
srvs[c] = t?(&t->GetShaderResource()):nullptr;
}
cbs[1] = &_constantBuffers[constantsIndex];
assert(cbs[1] && cbs[1]->GetUnderlying());
boundUniforms.Apply(
*context._context, context._parserContext->GetGlobalUniformsStream(),
RenderCore::Metal::UniformsStream(nullptr, cbs, 2, srvs, _texturesPerMaterial));
}
auto ModelRenderer::Pimpl::BuildMesh(
const ModelCommandStream::GeoCall& geoInst,
const RawGeometry& geo,
ModelConstruction::BuffersUnderConstruction& workingBuffers,
SharedStateSet& sharedStateSet,
const uint64 textureBindPoints[], unsigned textureBindPointsCnt,
ModelConstruction::ParamBoxDescriptions& paramBoxDesc,
bool normalFromSkinning) -> Mesh
{
Mesh result;
result._id = geoInst._geoId;
result._indexFormat = geo._ib._format;
result._vertexStride = geo._vb._ia._vertexStride;
result._geoParamBox = ModelConstruction::BuildGeoParamBox(geo._vb._ia, sharedStateSet, paramBoxDesc, normalFromSkinning);
// (source file locators)
result._sourceFileIBOffset = geo._ib._offset;
result._sourceFileIBSize = geo._ib._size;
result._sourceFileVBOffset = geo._vb._offset;
result._sourceFileVBSize = geo._vb._size;
// (vb, ib allocations)
result._ibOffset = workingBuffers.AllocateIB(result._sourceFileIBSize, Metal::NativeFormat::Enum(result._indexFormat));
result._vbOffset = workingBuffers.AllocateVB(result._sourceFileVBSize);
Metal::InputElementDesc inputDesc[12];
unsigned vertexElementCount = BuildLowLevelInputAssembly(
inputDesc, dimof(inputDesc),
geo._vb._ia._elements, geo._vb._ia._elementCount);
result._techniqueInterface = sharedStateSet.InsertTechniqueInterface(
inputDesc, vertexElementCount, textureBindPoints, textureBindPointsCnt);
return result;
}
auto ModelRenderer::Pimpl::BuildMesh(
const ModelCommandStream::GeoCall& geoInst,
const BoundSkinnedGeometry& geo,
ModelConstruction::BuffersUnderConstruction& workingBuffers,
SharedStateSet& sharedStateSet,
const uint64 textureBindPoints[], unsigned textureBindPointsCnt,
ModelConstruction::ParamBoxDescriptions& paramBoxDesc) -> SkinnedMesh
{
// Build the mesh, starting with the same basic behaviour as
// unskinned meshes.
// (there a sort-of "slice" here... It's a bit of a hack)
bool skinnedNormal = ModelConstruction::HasElement(geo._animatedVertexElements._ia, "NORMAL");
Pimpl::SkinnedMesh result;
(Pimpl::Mesh&)result = BuildMesh(
geoInst, (const RawGeometry&)geo, workingBuffers, sharedStateSet,
textureBindPoints, textureBindPointsCnt,
paramBoxDesc, skinnedNormal);
auto animGeo = Pimpl::SkinnedMesh::VertexStreams::AnimatedGeo;
auto skelBind = Pimpl::SkinnedMesh::VertexStreams::SkeletonBinding;
const VertexData* vd[2];
vd[animGeo] = &geo._animatedVertexElements;
vd[skelBind] = &geo._skeletonBinding;
for (unsigned c=0; c<2; ++c) {
result._sourceFileExtraVBOffset[c] = vd[c]->_offset;
result._sourceFileExtraVBSize[c] = vd[c]->_size;
result._extraVbOffset[c] = workingBuffers.AllocateVB(result._sourceFileExtraVBSize[c]);
result._extraVbStride[c] = vd[c]->_ia._vertexStride;
}
////////////////////////////////////////////////////////////////////////////////
// Build the input assembly we will use while rendering. This should
// contain the unskinned the vertex elements, and also the skinned vertex
// elements.
//
// There are 3 possible paths for the skinned vertex elements:
// 1) we do the skinning in the vertex shader, as we encounter them.
// (In this case, we also need the skinning parameter vertex elements)
// 2) we do the skinning in a geometry shader prepare step
// 3) we do no skinning at all
//
// In path 2, the geometry shader prepare step may change the format of the
// vertex elements. This typically occurs when using 16 bit floats (or maybe
// even fixed point formats). That means we need another technique interface
// for the prepared animation case!
{
Metal::InputElementDesc inputDescForRender[12];
unsigned eleCount =
BuildLowLevelInputAssembly(
inputDescForRender, dimof(inputDescForRender),
geo._animatedVertexElements._ia._elements,
geo._animatedVertexElements._ia._elementCount);
// (add the unanimated part)
eleCount +=
BuildLowLevelInputAssembly(
&inputDescForRender[eleCount], dimof(inputDescForRender) - eleCount,
geo._vb._ia._elements, geo._vb._ia._elementCount, 1);
result._skinnedTechniqueInterface = sharedStateSet.InsertTechniqueInterface(
inputDescForRender, eleCount,
textureBindPoints, textureBindPointsCnt);
}
return result;
}
ModelRenderer::Pimpl::DrawCallResources::DrawCallResources()
{
_shaderName = _geoParamBox = _materialParamBox = 0;
_textureSet = _constantBuffer = _renderStateSet = 0;
_delayStep = DelayStep::OpaqueRender;
_materialBindingGuid = 0;
}
ModelRenderer::Pimpl::DrawCallResources::DrawCallResources(
unsigned shaderName,
unsigned geoParamBox, unsigned matParamBox,
unsigned textureSet, unsigned constantBuffer,
unsigned renderStateSet, DelayStep delayStep, MaterialGuid materialBindingGuid)
{
_shaderName = shaderName;
_geoParamBox = geoParamBox;
_materialParamBox = matParamBox;
_textureSet = textureSet;
_constantBuffer = constantBuffer;
_renderStateSet = renderStateSet;
_delayStep = delayStep;
_materialBindingGuid = materialBindingGuid;
}
void ModelRenderer::Render(
const ModelRendererContext& context,
const SharedStateSet& sharedStateSet,
const Float4x4& modelToWorld,
const MeshToModel* transforms,
PreparedAnimation* preparedAnimation) const
{
auto& box = Techniques::FindCachedBox<ModelRenderingBox>(ModelRenderingBox::Desc());
const Metal::ConstantBuffer* pkts[] = { &box._localTransformBuffer, nullptr };
unsigned currTextureSet = ~unsigned(0x0), currCB = ~unsigned(0x0), currGeoCall = ~unsigned(0x0);
Pimpl::TechniqueInterface currTechniqueInterface = ~Pimpl::TechniqueInterface(0x0);
Metal::BoundUniforms* currUniforms = nullptr;
auto& devContext = *context._context;
auto& scaffold = *_pimpl->_scaffold;
auto& cmdStream = scaffold.CommandStream();
if (!transforms) {
Techniques::LocalTransformConstants trans;
trans = Techniques::MakeLocalTransform(modelToWorld, ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld));
box._localTransformBuffer.Update(*context._context, &trans, sizeof(trans));
}
if (Tweakable("SkinnedAsStatic", false)) { preparedAnimation = nullptr; }
TRY
{
// skinned and unskinned geometry are almost the same, except for
// "BeginGeoCall" / "BeginSkinCall". Never the less, we need to split
// them into separate loops
//////////// Render un-skinned geometry ////////////
Metal::ConstantBuffer drawCallIndexBuffer(nullptr, sizeof(unsigned)*4);
devContext.BindGS(MakeResourceList(drawCallIndexBuffer));
unsigned drawCallIndex = 0;
for (auto md=_pimpl->_drawCalls.cbegin(); md!=_pimpl->_drawCalls.cend(); ++md, ++drawCallIndex) {
if (md->first != currGeoCall) {
currTechniqueInterface = _pimpl->BeginGeoCall(
context, box._localTransformBuffer, transforms, modelToWorld, md->first);
currGeoCall = md->first;
}
auto* boundUniforms = _pimpl->BeginVariation(context, sharedStateSet, drawCallIndex, currTechniqueInterface);
const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex];
if ( boundUniforms != currUniforms
|| drawCallRes._textureSet != currTextureSet
|| drawCallRes._constantBuffer != currCB) {
if (boundUniforms) {
_pimpl->ApplyBoundUnforms(
context, *boundUniforms, drawCallRes._textureSet, drawCallRes._constantBuffer, pkts);
}
currTextureSet = drawCallRes._textureSet; currCB = drawCallRes._constantBuffer;
currUniforms = boundUniforms;
}
const auto& d = md->second;
devContext.Bind(Metal::Topology::Enum(d._topology)); // do we really need to set the topology every time?
// -- this draw call index stuff is only required in some cases --
// we need some way to customise the model rendering method for different purposes
devContext.Bind(Techniques::CommonResources()._dssReadWriteWriteStencil, 1+drawCallIndex); // write stencil buffer with draw index
unsigned drawCallIndexB[4] = { drawCallIndex, 0, 0, 0 };
drawCallIndexBuffer.Update(devContext, drawCallIndexB, sizeof(drawCallIndexB));
// -------------
devContext.DrawIndexed(d._indexCount, d._firstIndex, d._firstVertex);
}
//////////// Render skinned geometry ////////////
currGeoCall = ~unsigned(0x0);
for (auto md=_pimpl->_skinnedDrawCalls.cbegin();
md!=_pimpl->_skinnedDrawCalls.cend(); ++md, ++drawCallIndex) {
if (md->first != currGeoCall) {
currTechniqueInterface = _pimpl->BeginSkinCall(
context, box._localTransformBuffer, transforms, modelToWorld, md->first,
preparedAnimation);
currGeoCall = md->first;
}
auto* boundUniforms = _pimpl->BeginVariation(context, sharedStateSet, drawCallIndex, currTechniqueInterface);
const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex];
if ( boundUniforms != currUniforms
|| drawCallRes._textureSet != currTextureSet
|| drawCallRes._constantBuffer != currCB) {
if (boundUniforms) {
_pimpl->ApplyBoundUnforms(
context, *boundUniforms, drawCallRes._textureSet, drawCallRes._constantBuffer, pkts);
}
currTextureSet = drawCallRes._textureSet; currCB = drawCallRes._constantBuffer;
currUniforms = boundUniforms;
}
const auto& d = md->second;
devContext.Bind(Metal::Topology::Enum(d._topology)); // do we really need to set the topology every time?
devContext.DrawIndexed(d._indexCount, d._firstIndex, d._firstVertex);
}
}
CATCH(::Assets::Exceptions::InvalidAsset& e) { context._parserContext->Process(e); }
CATCH(::Assets::Exceptions::PendingAsset& e) { context._parserContext->Process(e); }
CATCH_END
}
////////////////////////////////////////////////////////////////////////////////
bool CompareDrawCall(const DelayedDrawCall& lhs, const DelayedDrawCall& rhs)
{
if (lhs._shaderVariationHash == rhs._shaderVariationHash) {
if (lhs._renderer == rhs._renderer) {
if (lhs._subMesh == rhs._subMesh) {
return lhs._drawCallIndex < rhs._drawCallIndex;
}
return lhs._subMesh < rhs._subMesh;
}
return lhs._renderer < rhs._renderer;
}
return lhs._shaderVariationHash < rhs._shaderVariationHash;
}
void ModelRenderer::Prepare(
DelayedDrawCallSet& dest,
const SharedStateSet& sharedStateSet,
const Float4x4& modelToWorld,
const MeshToModel* transforms)
{
unsigned mainTransformIndex = ~unsigned(0x0);
if (!transforms) {
mainTransformIndex = (unsigned)dest._transforms.size();
dest._transforms.push_back(modelToWorld);
}
// After culling; submit all of the draw-calls in this mesh to a list to be sorted
// Note -- only unskinned geometry supported currently. In theory, we might be able
// to do the same with skinned geometry (at least, when not using the "prepare" step
unsigned drawCallIndex = 0;
for (auto md=_pimpl->_drawCalls.cbegin(); md!=_pimpl->_drawCalls.cend(); ++md, ++drawCallIndex) {
const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex];
const auto& d = md->second;
auto geoParamIndex = drawCallRes._geoParamBox;
auto matParamIndex = drawCallRes._materialParamBox;
auto shaderNameIndex = drawCallRes._shaderName;
auto& cmdStream = _pimpl->_scaffold->CommandStream();
auto& geoCall = cmdStream.GetGeoCall(md->first);
auto mesh = FindIf(
_pimpl->_meshes, [=](const Pimpl::Mesh& mesh)
{ return mesh._id == geoCall._geoId; });
assert(mesh != _pimpl->_meshes.end());
auto step = unsigned(drawCallRes._delayStep);
DelayedDrawCall entry;
entry._drawCallIndex = drawCallIndex;
entry._renderer = this;
if (transforms) {
auto trans = Combine(
transforms->GetMeshToModel(geoCall._transformMarker),
modelToWorld);
entry._meshToWorld = (unsigned)dest._transforms.size();
dest._transforms.push_back(trans);
} else {
entry._meshToWorld = mainTransformIndex;
}
unsigned techniqueInterface = mesh->_techniqueInterface;
entry._shaderVariationHash = techniqueInterface ^ (geoParamIndex << 12) ^ (matParamIndex << 15) ^ (shaderNameIndex << 24); // simple hash of these indices. Note that collisions might be possible
entry._indexCount = d._indexCount;
entry._firstIndex = d._firstIndex;
entry._firstVertex = d._firstVertex;
entry._topology = Metal::Topology::Enum(d._topology);
entry._subMesh = AsPointer(mesh);
dest._entries[step].push_back(entry);
}
// Also try to render skinned geometry... But we want to render this with skinning disabled
// (this path is intended for rendering many static objects)
for (auto md=_pimpl->_skinnedDrawCalls.cbegin(); md!=_pimpl->_skinnedDrawCalls.cend(); ++md, ++drawCallIndex) {
const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex];
const auto& d = md->second;
auto geoParamIndex = drawCallRes._geoParamBox;
auto matParamIndex = drawCallRes._materialParamBox;
auto shaderNameIndex = drawCallRes._shaderName;
auto& cmdStream = _pimpl->_scaffold->CommandStream();
auto& geoCall = cmdStream.GetSkinCall(md->first);
auto mesh = FindIf(
_pimpl->_skinnedMeshes,
[=](const Pimpl::Mesh& mesh) { return mesh._id == geoCall._geoId; });
assert(mesh != _pimpl->_skinnedMeshes.end());
auto step = unsigned(drawCallRes._delayStep);
DelayedDrawCall entry;
entry._drawCallIndex = drawCallIndex;
entry._renderer = this;
if (transforms) {
auto trans = Combine(
transforms->GetMeshToModel(geoCall._transformMarker),
modelToWorld);
entry._meshToWorld = (unsigned)dest._transforms.size();
dest._transforms.push_back(trans);
} else {
entry._meshToWorld = mainTransformIndex;
}
unsigned techniqueInterface = mesh->_skinnedTechniqueInterface;
entry._shaderVariationHash = techniqueInterface ^ (geoParamIndex << 12) ^ (matParamIndex << 15) ^ (shaderNameIndex << 24); // simple hash of these indices. Note that collisions might be possible
entry._indexCount = d._indexCount;
entry._firstIndex = d._firstIndex;
entry._firstVertex = d._firstVertex;
entry._topology = Metal::Topology::Enum(d._topology) | 0x100;
entry._subMesh = AsPointer(mesh);
dest._entries[step].push_back(entry);
}
}
namespace WLTFlags { enum Enum { LocalToWorld = 1<<0, LocalSpaceView = 1<<1, MaterialGuid = 1<<2 }; }
template<int Flags>
void WriteLocalTransform(
void* dest,
const ModelRendererContext& context,
const Float4x4& t, uint64 materialGuid)
{
auto* dst = (Techniques::LocalTransformConstants*)dest;
// Write some system constants that are supposed
// to be provided by the model renderer
if (constant_expression<!!(Flags&WLTFlags::LocalToWorld)>::result()) {
CopyTransform(dst->_localToWorld, t);
}
if (constant_expression<!!(Flags&WLTFlags::LocalSpaceView)>::result()) {
auto worldSpaceView = ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld);
TransformPointByOrthonormalInverse(t, worldSpaceView);
dst->_localSpaceView = worldSpaceView;
}
if (constant_expression<!!(Flags&WLTFlags::MaterialGuid)>::result()) {
dst->_materialGuid = materialGuid;
}
}
template<bool HasCallback>
void ModelRenderer::RenderPreparedInternal(
const ModelRendererContext& context, const SharedStateSet& sharedStateSet,
DelayedDrawCallSet& drawCalls, DelayStep delayStep,
const std::function<void(unsigned, unsigned, unsigned)>* callback)
{
if (drawCalls.GetRendererGUID() != typeid(ModelRenderer).hash_code())
Throw(::Exceptions::BasicLabel("Delayed draw call set matched with wrong renderer type"));
auto& entries = drawCalls._entries[(unsigned)delayStep];
if (entries.empty()) return;
Techniques::LocalTransformConstants localTrans;
localTrans._localSpaceView = Float3(0.f, 0.f, 0.f);
Metal::ConstantBuffer& localTransformBuffer = Techniques::CommonResources()._localTransformBuffer;
const Metal::ConstantBuffer* pkts[] = { &localTransformBuffer, nullptr };
std::sort(entries.begin(), entries.end(), CompareDrawCall);
const ModelRenderer::Pimpl::Mesh* currentMesh = nullptr;
RenderCore::Metal::BoundUniforms* boundUniforms = nullptr;
unsigned currentVariationHash = ~unsigned(0x0);
unsigned currentTextureSet = ~unsigned(0x0);
unsigned currentConstantBufferIndex = ~unsigned(0x0);
unsigned currentTechniqueInterface = ~unsigned(0x0);
for (auto d=entries.cbegin(); d!=entries.cend(); ++d) {
auto& renderer = *(const ModelRenderer*)d->_renderer;
const auto& drawCallRes = renderer._pimpl->_drawCallRes[d->_drawCallIndex];
if (currentMesh != d->_subMesh) {
if (d->_topology > 0xff) {
auto& mesh = *(const Pimpl::SkinnedMesh*)d->_subMesh;
context._context->Bind(renderer._pimpl->_indexBuffer, Metal::NativeFormat::Enum(mesh._indexFormat), mesh._ibOffset);
const Metal::VertexBuffer* vbs[] = { &renderer._pimpl->_vertexBuffer, &renderer._pimpl->_vertexBuffer };
unsigned strides[] = { mesh._extraVbStride[0], mesh._vertexStride };
unsigned offsets[] = { mesh._extraVbOffset[0], mesh._vbOffset };
context._context->Bind(0, 2, vbs, strides, offsets);
currentMesh = &mesh;
currentTechniqueInterface = mesh._skinnedTechniqueInterface;
} else {
auto& mesh = *(const Pimpl::Mesh*)d->_subMesh;
context._context->Bind(renderer._pimpl->_indexBuffer, Metal::NativeFormat::Enum(mesh._indexFormat), mesh._ibOffset);
context._context->Bind(MakeResourceList(renderer._pimpl->_vertexBuffer), mesh._vertexStride, mesh._vbOffset);
currentMesh = &mesh;
currentTechniqueInterface = mesh._techniqueInterface;
}
currentTextureSet = ~unsigned(0x0);
}
// Note -- at the moment, shader variation hash is the sorting priority.
// This reduces the shader changes to a minimum. It also means we
// do the work in "BeginVariation" to resolve the variation
// as rarely as possible. However, we could pre-resolve all of the
// variations that we're going to need and use another value as the
// sorting priority instead... That might reduce the API thrashing
// in some cases.
if (currentVariationHash != d->_shaderVariationHash) {
auto& mesh = *(const Pimpl::Mesh*)d->_subMesh;
boundUniforms = sharedStateSet.BeginVariation(
context, drawCallRes._shaderName, currentTechniqueInterface, drawCallRes._geoParamBox,
drawCallRes._materialParamBox);
currentVariationHash = d->_shaderVariationHash;
currentTextureSet = ~unsigned(0x0);
}
if (!boundUniforms) continue;
static Utility::ParameterBox tempGlobalStatesBox;
sharedStateSet.BeginRenderState(context, tempGlobalStatesBox, drawCallRes._renderStateSet);
// We have to do this transform update very frequently! isn't there a better way?
{
D3D11_MAPPED_SUBRESOURCE result;
HRESULT hresult = context._context->GetUnderlying()->Map(
localTransformBuffer.GetUnderlying(), 0, D3D11_MAP_WRITE_DISCARD, 0, &result);
assert(SUCCEEDED(hresult) && result.pData); (void)hresult;
WriteLocalTransform<WLTFlags::LocalToWorld|WLTFlags::MaterialGuid>(
result.pData, context, drawCalls._transforms[d->_meshToWorld], drawCallRes._materialBindingGuid);
context._context->GetUnderlying()->Unmap(localTransformBuffer.GetUnderlying(), 0);
}
auto textureSet = drawCallRes._textureSet;
auto constantBufferIndex = drawCallRes._constantBuffer;
// sometimes the same render call may be rendered in several different locations. In these cases,
// we can reduce the API thrashing to the minimum by avoiding re-setting resources and constants
if (boundUniforms && (textureSet != currentTextureSet || constantBufferIndex != currentConstantBufferIndex)) {
renderer._pimpl->ApplyBoundUnforms(
context, *boundUniforms,
textureSet, constantBufferIndex, pkts);
currentTextureSet = textureSet;
currentConstantBufferIndex = constantBufferIndex;
}
context._context->Bind((Metal::Topology::Enum)(d->_topology & 0xff));
if (constant_expression<HasCallback>::result()) {
(*callback)(d->_indexCount, d->_firstIndex, d->_firstVertex);
} else
context._context->DrawIndexed(d->_indexCount, d->_firstIndex, d->_firstVertex);
}
}
void ModelRenderer::RenderPrepared(
const ModelRendererContext& context, const SharedStateSet& sharedStateSet,
DelayedDrawCallSet& drawCalls, DelayStep delayStep)
{
RenderPreparedInternal<false>(context, sharedStateSet, drawCalls, delayStep, nullptr);
}
void ModelRenderer::RenderPrepared(
const ModelRendererContext& context, const SharedStateSet& sharedStateSet,
DelayedDrawCallSet& drawCalls, DelayStep delayStep,
const std::function<void(unsigned, unsigned, unsigned)>& callback)
{
assert(callback);
RenderPreparedInternal<true>(context, sharedStateSet, drawCalls, delayStep, &callback);
}
////////////////////////////////////////////////////////////////////////////////
/// \todo -- this DestroyArray stuff is too awkward. Instead, let's create
/// some "SerializeableArray" or "SerializeableBlock" or something --
/// and have it deal with the internals (even if it means increasing memory size slightly)
ModelCommandStream::~ModelCommandStream()
{
DestroyArray(_geometryInstances, &_geometryInstances[_geometryInstanceCount]);
DestroyArray(_skinControllerInstances, &_skinControllerInstances[_skinControllerInstanceCount]);
}
GeoInputAssembly::~GeoInputAssembly()
{
DestroyArray(_elements, &_elements[_elementCount]);
}
RawGeometry::~RawGeometry() {}
BoundSkinnedGeometry::~BoundSkinnedGeometry() {}
ModelImmutableData::~ModelImmutableData()
{
DestroyArray(_geos, &_geos[_geoCount]);
DestroyArray(_boundSkinnedControllers, &_boundSkinnedControllers[_boundSkinnedControllerCount]);
}
////////////////////////////////////////////////////////////
uint64 GeoInputAssembly::BuildHash() const
{
// Build a hash for this object.
// Note that we should be careful that we don't get an
// noise from characters in the left-over space in the
// semantic names. Do to this right, we should make sure
// that left over space has no effect.
auto elementsHash = Hash64(_elements, PtrAdd(_elements, _elementCount * sizeof(VertexElement)));
elementsHash ^= uint64(_vertexStride);
return elementsHash;
}
////////////////////////////////////////////////////////////
Float4x4 ModelRenderer::MeshToModel::GetMeshToModel(unsigned transformMarker) const
{
// The "skeleton binding" tells us how to map from the matrices that
// are output from the transformation machine to the input matrices
// expected by the "transformMarker" index scheme
if (_skeletonBinding) {
assert(transformMarker < _skeletonBinding->_modelJointIndexToMachineOutput.size());
auto machineOutputIndex = _skeletonBinding->_modelJointIndexToMachineOutput[transformMarker];
if (machineOutputIndex == ~unsigned(0x0)) {
// no mapping... we just have to assume identity mesh-to-model
return Identity<Float4x4>();
} else if (machineOutputIndex >= _skeletonOutputCount) {
assert(0);
return Identity<Float4x4>();
}
return _skeletonOutput[machineOutputIndex];
} else {
if (transformMarker >= _skeletonOutputCount) {
assert(0);
return Identity<Float4x4>();
}
return _skeletonOutput[transformMarker];
}
}
ModelRenderer::MeshToModel::MeshToModel()
{
_skeletonOutput = nullptr;
_skeletonOutputCount = 0;
_skeletonBinding = nullptr;
}
ModelRenderer::MeshToModel::MeshToModel(
const Float4x4 skeletonOutput[], unsigned skeletonOutputCount,
const SkeletonBinding* binding)
{
_skeletonOutput = skeletonOutput;
_skeletonOutputCount = skeletonOutputCount;
_skeletonBinding = binding;
}
template<unsigned Size>
static std::string Width(unsigned input)
{
static char buffer[Size+1];
auto err = _itoa_s(input, buffer, 10);
if (!err) {
auto length = XlStringLen(buffer);
if (length < Size) {
auto movement = Size-length;
XlMoveMemory(&buffer[movement], buffer, length);
XlSetMemory(buffer, ' ', movement);
buffer[Size] = '\0';
}
return std::string(buffer);
} else { return std::string("<<err>>"); }
}
std::vector<MaterialGuid> ModelRenderer::DrawCallToMaterialBinding() const
{
std::vector<MaterialGuid> result;
result.reserve(_pimpl->_drawCallRes.size());
for (auto i=_pimpl->_drawCallRes.begin(); i!=_pimpl->_drawCallRes.end(); ++i) {
result.push_back(i->_materialBindingGuid);
}
return std::move(result);
}
MaterialGuid ModelRenderer::GetMaterialBindingForDrawCall(unsigned drawCallIndex) const
{
if (drawCallIndex < _pimpl->_drawCallRes.size())
return _pimpl->_drawCallRes[drawCallIndex]._materialBindingGuid;
return ~0ull;
}
void ModelRenderer::LogReport() const
{
LogInfo << "---<< Model Renderer: " << _pimpl->_scaffold->Filename() << " (LOD: " << _pimpl->_levelOfDetail << ") >>---";
LogInfo << " [" << _pimpl->_meshes.size() << "] meshes";
LogInfo << " [" << _pimpl->_skinnedMeshes.size() << "] skinned meshes";
LogInfo << " [" << _pimpl->_constantBuffers.size() << "] constant buffers";
LogInfo << " [" << _pimpl->_drawCalls.size() << "] draw calls";
LogInfo << " [" << _pimpl->_skinnedDrawCalls.size() << "] skinned draw calls";
LogInfo << " [" << _pimpl->_boundTextures.size() << "] bound textures";
LogInfo << " [" << _pimpl->_texturesPerMaterial << "] textures per material";
DEBUG_ONLY(LogInfo << " [" << _pimpl->_vbSize / 1024.f << "k] VB size");
DEBUG_ONLY(LogInfo << " [" << _pimpl->_ibSize / 1024.f << "k] IB size");
LogInfo << " Draw calls | Indxs | GeoC | Shr | GeoP | MatP | Tex | CB | RS ";
for (unsigned c=0; c<_pimpl->_drawCalls.size(); ++c) {
const auto&m = _pimpl->_drawCalls[c].first;
const auto&d = _pimpl->_drawCalls[c].second;
const auto&r = _pimpl->_drawCallRes[c];
LogInfo
<< " [" << Width<3>(c) << "] (M) |"
<< Width<7>(d._indexCount) << " |"
<< Width<5>(m) << " |"
<< Width<5>(r._shaderName) << " |"
<< Width<5>(r._geoParamBox) << " |"
<< Width<5>(r._materialParamBox) << " |"
<< Width<5>(r._textureSet) << " |"
<< Width<5>(r._constantBuffer) << " |"
<< Width<5>(r._renderStateSet);
}
for (unsigned c=0; c<_pimpl->_skinnedDrawCalls.size(); ++c) {
const auto&m = _pimpl->_skinnedDrawCalls[c].first;
const auto&d = _pimpl->_skinnedDrawCalls[c].second;
const auto&r = _pimpl->_drawCallRes[c + _pimpl->_drawCalls.size()];
LogInfo
<< " [" << Width<3>(c) << "] (S) |"
<< Width<7>(d._indexCount) << " |"
<< Width<5>(m) << " |"
<< Width<5>(r._shaderName) << " |"
<< Width<5>(r._geoParamBox) << " |"
<< Width<5>(r._materialParamBox) << " |"
<< Width<5>(r._textureSet) << " |"
<< Width<5>(r._constantBuffer) << " |"
<< Width<5>(r._renderStateSet);
}
LogInfo << " Meshes | GeoC | SrcVB | SrcIB | VtxS | TchI | GeoP | IdxF";
for (unsigned c=0; c<_pimpl->_meshes.size(); ++c) {
const auto&m = _pimpl->_meshes[c];
LogInfo
<< " [" << Width<3>(c) << "] (M) |"
<< Width<5>(m._id) << " |"
<< Width<6>(m._sourceFileVBSize/1024) << "k |"
<< Width<6>(m._sourceFileIBSize/1024) << "k |"
<< Width<5>(m._vertexStride) << " |"
<< Width<5>(m._techniqueInterface) << " |"
<< Width<5>(m._geoParamBox) << " |"
<< Width<5>(m._indexFormat);
}
for (unsigned c=0; c<_pimpl->_skinnedMeshes.size(); ++c) {
const auto&m = _pimpl->_skinnedMeshes[c];
LogInfo
<< " [" << Width<3>(c) << "] (S) |"
<< Width<5>(m._id) << " |"
<< Width<6>(m._sourceFileVBSize/1024) << "k |"
<< Width<6>(m._sourceFileIBSize/1024) << "k |"
<< Width<5>(m._vertexStride) << " |"
<< Width<5>(m._techniqueInterface) << " |"
<< Width<5>(m._geoParamBox) << " |"
<< Width<5>(m._indexFormat);
}
#if defined(_DEBUG)
if (_pimpl->_texturesPerMaterial) {
LogInfo << " Bound Textures";
for (unsigned c=0; c<_pimpl->_boundTextureNames.size() / _pimpl->_texturesPerMaterial; ++c) {
StringMeld<512> temp;
for (unsigned q=0; q<_pimpl->_texturesPerMaterial; ++q) {
if (q) { temp << ", "; }
temp << _pimpl->_boundTextureNames[c*_pimpl->_texturesPerMaterial+q];
}
LogInfo << " [" << Width<3>(c) << "] " << temp;
}
}
LogInfo << " Parameter Boxes";
for (unsigned c=0; c<_pimpl->_paramBoxDesc.size(); ++c) {
auto& i = _pimpl->_paramBoxDesc[c];
LogInfo << " [" << Width<3>(i.first) << "] " << i.second;
}
#endif
}
////////////////////////////////////////////////////////////
static std::pair<std::unique_ptr<uint8[]>, unsigned> LoadRawData(const char filename[])
{
BasicFile file(filename, "rb");
auto chunks = Serialization::ChunkFile::LoadChunkTable(file);
// look for the first model scaffold chunk
Serialization::ChunkFile::ChunkHeader largeBlocksChunk;
Serialization::ChunkFile::ChunkHeader scaffoldChunk;
for (auto i=chunks.begin(); i!=chunks.end(); ++i) {
if (i->_type == ChunkType_ModelScaffold && !scaffoldChunk._fileOffset) {
scaffoldChunk = *i;
}
if (i->_type == ChunkType_ModelScaffoldLargeBlocks && !largeBlocksChunk._fileOffset) {
largeBlocksChunk = *i;
}
}
if ( !scaffoldChunk._fileOffset
|| !largeBlocksChunk._fileOffset) {
throw ::Assets::Exceptions::FormatError("Missing model scaffold chunks: %s", filename);
}
if (scaffoldChunk._chunkVersion != 0) {
throw ::Assets::Exceptions::FormatError("Incorrect file version: %s", filename);
}
auto rawMemoryBlock = std::make_unique<uint8[]>(scaffoldChunk._size);
file.Seek(scaffoldChunk._fileOffset, SEEK_SET);
file.Read(rawMemoryBlock.get(), 1, scaffoldChunk._size);
return std::make_pair(std::move(rawMemoryBlock), largeBlocksChunk._fileOffset);
}
ModelScaffold::ModelScaffold(const ResChar filename[])
{
std::unique_ptr<uint8[]> rawMemoryBlock;
unsigned largeBlocksOffset = 0;
std::tie(rawMemoryBlock, largeBlocksOffset) = LoadRawData(filename);
Serialization::Block_Initialize(rawMemoryBlock.get());
_data = (const ModelImmutableData*)Serialization::Block_GetFirstObject(rawMemoryBlock.get());
_validationCallback = std::make_shared<::Assets::DependencyValidation>();
RegisterFileDependency(_validationCallback, filename);
_filename = filename;
_rawMemoryBlock = std::move(rawMemoryBlock);
_largeBlocksOffset = largeBlocksOffset;
}
ModelScaffold::ModelScaffold(std::shared_ptr<::Assets::PendingCompileMarker>&& marker)
{
_data = nullptr;
_largeBlocksOffset = 0;
if (marker->GetState() == ::Assets::AssetState::Ready) {
CompleteFromMarker(*marker);
} else {
_marker = std::forward<std::shared_ptr<::Assets::PendingCompileMarker>>(marker);
_validationCallback = std::make_shared<::Assets::DependencyValidation>();
}
}
ModelScaffold::ModelScaffold(ModelScaffold&& moveFrom)
: _rawMemoryBlock(std::move(moveFrom._rawMemoryBlock))
, _filename(std::move(moveFrom._filename))
, _marker(std::move(moveFrom._marker))
, _validationCallback(std::move(moveFrom._validationCallback))
{
_data = moveFrom._data;
moveFrom._data = nullptr;
_largeBlocksOffset = moveFrom._largeBlocksOffset;
}
ModelScaffold& ModelScaffold::operator=(ModelScaffold&& moveFrom)
{
_rawMemoryBlock = std::move(moveFrom._rawMemoryBlock);
_data = moveFrom._data;
moveFrom._data = nullptr;
_largeBlocksOffset = moveFrom._largeBlocksOffset;
_filename = std::move(moveFrom._filename);
_marker = std::move(moveFrom._marker);
_validationCallback = std::move(moveFrom._validationCallback);
return *this;
}
ModelScaffold::~ModelScaffold()
{
if (_data)
_data->~ModelImmutableData();
}
void ModelScaffold::Resolve() const
{
if (_marker) {
if (_marker->GetState() == ::Assets::AssetState::Invalid) {
Throw(::Assets::Exceptions::InvalidAsset(_marker->Initializer(), ""));
} else if (_marker->GetState() == ::Assets::AssetState::Pending) {
// we need to throw immediately on pending resource
// this object is useless while it's pending.
Throw(::Assets::Exceptions::PendingAsset(_marker->Initializer(), ""));
}
// hack -- Resolve needs to be called by const methods (like "GetStaticBoundingBox")
// but Resolve() must change all the internal pointers... It's an awkward
// case for const-correctness
const_cast<ModelScaffold*>(this)->CompleteFromMarker(*_marker);
_marker.reset();
}
}
::Assets::AssetState ModelScaffold::TryResolve()
{
if (_marker) {
auto markerState = _marker->GetState();
if (markerState != ::Assets::AssetState::Ready) return markerState;
CompleteFromMarker(*_marker);
_marker.reset();
}
return ::Assets::AssetState::Ready;
}
::Assets::AssetState ModelScaffold::StallAndResolve()
{
if (_marker) {
auto markerState = _marker->StallWhilePending();
if (markerState != ::Assets::AssetState::Ready) return markerState;
CompleteFromMarker(*_marker);
_marker.reset();
}
return ::Assets::AssetState::Ready;
}
void ModelScaffold::CompleteFromMarker(::Assets::PendingCompileMarker& marker)
{
std::unique_ptr<uint8[]> rawMemoryBlock;
unsigned largeBlocksOffset = 0;
std::tie(rawMemoryBlock, largeBlocksOffset) = LoadRawData(marker._sourceID0);
Serialization::Block_Initialize(rawMemoryBlock.get());
_data = (const ModelImmutableData*)Serialization::Block_GetFirstObject(rawMemoryBlock.get());
_filename = marker._sourceID0;
if (!_validationCallback) {
_validationCallback = marker._dependencyValidation;
} else
::Assets::RegisterAssetDependency(_validationCallback, marker._dependencyValidation);
_rawMemoryBlock = std::move(rawMemoryBlock);
_largeBlocksOffset = largeBlocksOffset;
}
unsigned ModelScaffold::LargeBlocksOffset() const { Resolve(); return _largeBlocksOffset; }
const ModelImmutableData& ModelScaffold::ImmutableData() const { Resolve(); return *_data; };
const ModelCommandStream& ModelScaffold::CommandStream() const { Resolve(); return _data->_visualScene; }
const TransformationMachine& ModelScaffold::EmbeddedSkeleton() const { Resolve(); return _data->_embeddedSkeleton; }
std::pair<Float3, Float3> ModelScaffold::GetStaticBoundingBox(unsigned) const { Resolve(); return _data->_boundingBox; }
}}
| [
"djewsbury@xlgames.com"
] | djewsbury@xlgames.com |
111432182e861e9eb32c28e4bc858c46736ec8a4 | 44e52ef313820c9700aaf2267ecbec749c315227 | /FarmacieC++/Pastile.h | 27e1b2dce6b9c48b2154b25cf05d86147ef36c51 | [] | no_license | Hornshade/ProiectPOO | cc60e8da4b742e21fb0a4033f0c368f8618f35cc | 49bac14b1e183eebceefbcf26bc63d4e629fc9cb | refs/heads/master | 2022-10-01T03:21:48.212773 | 2020-06-08T10:23:40 | 2020-06-08T10:23:40 | 270,623,914 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205 | h | #pragma once
#include "Medicament.h"
class Pastile :
public Medicament
{
public:
Pastile(Medicament med,int numarpastile);
string AfisareString();
int GetNrPastile();
protected:
int numarPastile;
};
| [
"sabin.mihai@yahoo.com"
] | sabin.mihai@yahoo.com |
8e3297fa8bc04d6f6e9f52c04a072bd4e9b86a58 | 8f512f6c3f3ec78d5e3e8721b373b2410c7285b2 | /hw5110/hw5110.ino | 600b2de225404e800fad25b499706d5a621c70db | [] | no_license | khawajamechatronics/Arduino-1 | d9882fd96b89c273d1a7eb68e717c7c127b2580a | ef31fc3443c36e3fa20f7c2c91d49f2579ee05c6 | refs/heads/master | 2020-03-28T05:54:17.246651 | 2017-12-26T08:56:12 | 2017-12-26T08:56:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,722 | ino | /*
7-17-2011
Spark Fun Electronics 2011
Nathan Seidle
This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This code writes a series of images and text to the Nokia 5110 84x48 graphic LCD:
http://www.sparkfun.com/products/10168
Do not drive the backlight with 5V. It will smoke. However, the backlight on the LCD seems to be
happy with direct drive from the 3.3V regulator.
Although the PCD8544 controller datasheet recommends 3.3V, the graphic Nokia 5110 LCD can run at 3.3V or 5V.
No resistors needed on the signal lines.
You will need 5 signal lines to connect to the LCD, 3.3 or 5V for power, 3.3V for LED backlight, and 1 for ground.
*/
#define PIN_SCE 7 //Pin 3 on LCD
#define PIN_RESET 6 //Pin 4 on LCD
#define PIN_DC 5 //Pin 5 on LCD
#define PIN_SDIN 4 //Pin 6 on LCD
#define PIN_SCLK 3 //Pin 7 on LCD
//The DC pin tells the LCD if we are sending a command or data
#define LCD_COMMAND 0
#define LCD_DATA 1
//You may find a different size screen, but this one is 84 by 48 pixels
#define LCD_X 84
#define LCD_Y 48
//This table contains the hex values that represent pixels
//for a font that is 5 pixels wide and 8 pixels high
static const byte ASCII[][5] = {
{0x00, 0x00, 0x00, 0x00, 0x00} // 20
,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 !
,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 "
,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 #
,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $
,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 %
,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 &
,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 '
,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 (
,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 )
,{0x14, 0x08, 0x3e, 0x08, 0x14} // 2a *
,{0x08, 0x08, 0x3e, 0x08, 0x08} // 2b +
,{0x00, 0x50, 0x30, 0x00, 0x00} // 2c ,
,{0x08, 0x08, 0x08, 0x08, 0x08} // 2d -
,{0x00, 0x60, 0x60, 0x00, 0x00} // 2e .
,{0x20, 0x10, 0x08, 0x04, 0x02} // 2f /
,{0x3e, 0x51, 0x49, 0x45, 0x3e} // 30 0
,{0x00, 0x42, 0x7f, 0x40, 0x00} // 31 1
,{0x42, 0x61, 0x51, 0x49, 0x46} // 32 2
,{0x21, 0x41, 0x45, 0x4b, 0x31} // 33 3
,{0x18, 0x14, 0x12, 0x7f, 0x10} // 34 4
,{0x27, 0x45, 0x45, 0x45, 0x39} // 35 5
,{0x3c, 0x4a, 0x49, 0x49, 0x30} // 36 6
,{0x01, 0x71, 0x09, 0x05, 0x03} // 37 7
,{0x36, 0x49, 0x49, 0x49, 0x36} // 38 8
,{0x06, 0x49, 0x49, 0x29, 0x1e} // 39 9
,{0x00, 0x36, 0x36, 0x00, 0x00} // 3a :
,{0x00, 0x56, 0x36, 0x00, 0x00} // 3b ;
,{0x08, 0x14, 0x22, 0x41, 0x00} // 3c <
,{0x14, 0x14, 0x14, 0x14, 0x14} // 3d =
,{0x00, 0x41, 0x22, 0x14, 0x08} // 3e >
,{0x02, 0x01, 0x51, 0x09, 0x06} // 3f ?
,{0x32, 0x49, 0x79, 0x41, 0x3e} // 40 @
,{0x7e, 0x11, 0x11, 0x11, 0x7e} // 41 A
,{0x7f, 0x49, 0x49, 0x49, 0x36} // 42 B
,{0x3e, 0x41, 0x41, 0x41, 0x22} // 43 C
,{0x7f, 0x41, 0x41, 0x22, 0x1c} // 44 D
,{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E
,{0x7f, 0x09, 0x09, 0x09, 0x01} // 46 F
,{0x3e, 0x41, 0x49, 0x49, 0x7a} // 47 G
,{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H
,{0x00, 0x41, 0x7f, 0x41, 0x00} // 49 I
,{0x20, 0x40, 0x41, 0x3f, 0x01} // 4a J
,{0x7f, 0x08, 0x14, 0x22, 0x41} // 4b K
,{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L
,{0x7f, 0x02, 0x0c, 0x02, 0x7f} // 4d M
,{0x7f, 0x04, 0x08, 0x10, 0x7f} // 4e N
,{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O
,{0x7f, 0x09, 0x09, 0x09, 0x06} // 50 P
,{0x3e, 0x41, 0x51, 0x21, 0x5e} // 51 Q
,{0x7f, 0x09, 0x19, 0x29, 0x46} // 52 R
,{0x46, 0x49, 0x49, 0x49, 0x31} // 53 S
,{0x01, 0x01, 0x7f, 0x01, 0x01} // 54 T
,{0x3f, 0x40, 0x40, 0x40, 0x3f} // 55 U
,{0x1f, 0x20, 0x40, 0x20, 0x1f} // 56 V
,{0x3f, 0x40, 0x38, 0x40, 0x3f} // 57 W
,{0x63, 0x14, 0x08, 0x14, 0x63} // 58 X
,{0x07, 0x08, 0x70, 0x08, 0x07} // 59 Y
,{0x61, 0x51, 0x49, 0x45, 0x43} // 5a Z
,{0x00, 0x7f, 0x41, 0x41, 0x00} // 5b [
,{0x02, 0x04, 0x08, 0x10, 0x20} // 5c \
,{0x00, 0x41, 0x41, 0x7f, 0x00} // 5d ]
,{0x04, 0x02, 0x01, 0x02, 0x04} // 5e ^
,{0x40, 0x40, 0x40, 0x40, 0x40} // 5f _
,{0x00, 0x01, 0x02, 0x04, 0x00} // 60
,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 // without this we get offset by 1
,{0x20, 0x54, 0x54, 0x54, 0x78} // 61 a
,{0x7f, 0x48, 0x44, 0x44, 0x38} // 62 b
,{0x38, 0x44, 0x44, 0x44, 0x20} // 63 c
,{0x38, 0x44, 0x44, 0x48, 0x7f} // 64 d
,{0x38, 0x54, 0x54, 0x54, 0x18} // 65 e
,{0x08, 0x7e, 0x09, 0x01, 0x02} // 66 f
,{0x0c, 0x52, 0x52, 0x52, 0x3e} // 67 g
,{0x7f, 0x08, 0x04, 0x04, 0x78} // 68 h
,{0x00, 0x44, 0x7d, 0x40, 0x00} // 69 i
,{0x20, 0x40, 0x44, 0x3d, 0x00} // 6a j
,{0x7f, 0x10, 0x28, 0x44, 0x00} // 6b k
,{0x00, 0x41, 0x7f, 0x40, 0x00} // 6c l
,{0x7c, 0x04, 0x18, 0x04, 0x78} // 6d m
,{0x7c, 0x08, 0x04, 0x04, 0x78} // 6e n
,{0x38, 0x44, 0x44, 0x44, 0x38} // 6f o
,{0x7c, 0x14, 0x14, 0x14, 0x08} // 70 p
,{0x08, 0x14, 0x14, 0x18, 0x7c} // 71 q
,{0x7c, 0x08, 0x04, 0x04, 0x08} // 72 r
,{0x48, 0x54, 0x54, 0x54, 0x20} // 73 s
,{0x04, 0x3f, 0x44, 0x40, 0x20} // 74 t
,{0x3c, 0x40, 0x40, 0x20, 0x7c} // 75 u
,{0x1c, 0x20, 0x40, 0x20, 0x1c} // 76 v
,{0x3c, 0x40, 0x30, 0x40, 0x3c} // 77 w
,{0x44, 0x28, 0x10, 0x28, 0x44} // 78 x
,{0x0c, 0x50, 0x50, 0x50, 0x3c} // 79 y
,{0x44, 0x64, 0x54, 0x4c, 0x44} // 7a z
,{0x00, 0x08, 0x36, 0x41, 0x00} // 7b {
,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c |
,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d }
,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ~
,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f DEL
};
//This is the SFE flame in bit form
char SFEFlame[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xE0, 0xF0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0x1E, 0x0E, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFE, 0xFC, 0xF8, 0xF8, 0xF0, 0xF8, 0xFE, 0xFE, 0xFC, 0xF8, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xF8, 0xFC, 0xFE, 0xFE, 0xFF, 0xFF, 0xF3, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0,
0xF1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F,
0x3F, 0x1F, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x0F, 0x0F, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03,
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x1F,
0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
//Another SparkFun logo
char SFEFlameBubble [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xC0, 0xC0, 0xE0, 0xE0, 0xF0, 0xF8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
0xFE, 0xFE, 0xFE, 0xFE, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xF8, 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0,
0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x3F, 0x3F,
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x0F, 0x3F, 0x7F, 0x7F, 0x3F, 0x1E,
0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x03, 0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xE0,
0xE0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF8, 0x7C, 0x7C, 0x7E, 0x7C, 0x38, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF8, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF0, 0xF0,
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
0xE1, 0xE3, 0xE3, 0xE7, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0,
0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7E, 0x7C, 0x78, 0x70, 0x60, 0x40, 0x40, 0x00,
0x00,
};
//This is awesome in bitmap form
char awesome[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x30, 0x18, 0x1C,
0x0C, 0x0C, 0x06, 0x06, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07,
0x07, 0x07, 0x0E, 0x06, 0x1C, 0x1C, 0x38, 0x70, 0x70, 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0x3C, 0xCE, 0x67, 0x33, 0x18, 0x08,
0x08, 0xC8, 0xF8, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
0x70, 0x38, 0x18, 0x18, 0x08, 0x08, 0x08, 0xF8, 0xF0, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 0x01, 0x07,
0x0F, 0x3C, 0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x0F, 0x00, 0x0C, 0x7F,
0x60, 0x60, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x61, 0x63,
0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x08, 0x08, 0xFC, 0x8C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0xF8, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x3C, 0x70, 0xE0, 0x80, 0x00, 0x07, 0x0C, 0x38, 0x60, 0xC0,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0,
0xF0, 0xE0, 0xC0, 0x80, 0xC0, 0x30, 0x18, 0x0F, 0x00, 0x00, 0x80, 0xC0, 0x70, 0x3C, 0x1F, 0x07,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06,
0x0E, 0x1C, 0x18, 0x38, 0x31, 0x73, 0x62, 0x66, 0x64, 0xC7, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF,
0xC7, 0xC7, 0xC7, 0x67, 0x63, 0x63, 0x71, 0x30, 0x38, 0x18, 0x1C, 0x0C, 0x06, 0x03, 0x03, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
void setup(void) {
LCDInit(); //Init the LCD
}
void loop(void) {
LCDClear();
LCDBitmap(SFEFlame);
delay(1000);
LCDClear();
LCDBitmap(SFEFlameBubble);
delay(1000);
LCDClear();
LCDBitmap(awesome);
delay(1000);
LCDClear();
LCDString("Hello World!");
// LCDString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
// LCDString("abcdefghijklmnopqrstuvwxyz");
delay(1000);
}
void gotoXY(int x, int y) {
LCDWrite(0, 0x80 | x); // Column.
LCDWrite(0, 0x40 | y); // Row. ?
}
//This takes a large array of bits and sends them to the LCD
void LCDBitmap(char my_array[]){
for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++)
LCDWrite(LCD_DATA, my_array[index]);
}
//This function takes in a character, looks it up in the font table/array
//And writes it to the screen
//Each character is 8 bits tall and 5 bits wide. We pad one blank column of
//pixels on each side of the character for readability.
void LCDCharacter(char character) {
LCDWrite(LCD_DATA, 0x00); //Blank vertical line padding
for (int index = 0 ; index < 5 ; index++)
LCDWrite(LCD_DATA, ASCII[character - 0x20][index]);
//0x20 is the ASCII character for Space (' '). The font table starts with this character
LCDWrite(LCD_DATA, 0x00); //Blank vertical line padding
}
//Given a string of characters, one by one is passed to the LCD
void LCDString(char *characters) {
while (*characters)
LCDCharacter(*characters++);
}
//Clears the LCD by writing zeros to the entire screen
void LCDClear(void) {
for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++)
LCDWrite(LCD_DATA, 0x00);
gotoXY(0, 0); //After we clear the display, return to the home position
}
//This sends the magical commands to the PCD8544
void LCDInit(void) {
//Configure control pins
pinMode(PIN_SCE, OUTPUT);
pinMode(PIN_RESET, OUTPUT);
pinMode(PIN_DC, OUTPUT);
pinMode(PIN_SDIN, OUTPUT);
pinMode(PIN_SCLK, OUTPUT);
//Reset the LCD to a known state
digitalWrite(PIN_RESET, LOW);
digitalWrite(PIN_RESET, HIGH);
LCDWrite(LCD_COMMAND, 0x21); //Tell LCD that extended commands follow
LCDWrite(LCD_COMMAND, 0xB0); //Set LCD Vop (Contrast): Try 0xB1(good @ 3.3V) or 0xBF if your display is too dark
LCDWrite(LCD_COMMAND, 0x04); //Set Temp coefficent
LCDWrite(LCD_COMMAND, 0x14); //LCD bias mode 1:48: Try 0x13 or 0x14
LCDWrite(LCD_COMMAND, 0x20); //We must send 0x20 before modifying the display control mode
LCDWrite(LCD_COMMAND, 0x0C); //Set display control, normal mode. 0x0D for inverse
}
//There are two memory banks in the LCD, data/RAM and commands. This
//function sets the DC pin high or low depending, and then sends
//the data byte
void LCDWrite(byte data_or_command, byte data) {
digitalWrite(PIN_DC, data_or_command); //Tell the LCD that we are writing either to data or a command
//Send the data
digitalWrite(PIN_SCE, LOW);
shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);
digitalWrite(PIN_SCE, HIGH);
}
| [
"davidh@zickel.net"
] | davidh@zickel.net |
eb2deb296ba6e32c2313d68e9059b59670fa99f7 | 94e5a9e157d3520374d95c43fe6fec97f1fc3c9b | /vjudge/181014 - Matrix Chain Multiplication/G.cpp | 1f663817f6f43ec9af85307b5ae1c16107782cb4 | [
"MIT"
] | permissive | dipta007/Competitive-Programming | 0127c550ad523884a84eb3ea333d08de8b4ba528 | 998d47f08984703c5b415b98365ddbc84ad289c4 | refs/heads/master | 2021-01-21T14:06:40.082553 | 2020-07-06T17:40:46 | 2020-07-06T17:40:46 | 54,851,014 | 8 | 4 | null | 2020-05-02T13:14:41 | 2016-03-27T22:30:02 | C++ | UTF-8 | C++ | false | false | 3,876 | cpp | #pragma comment(linker, "/stack:640000000")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI=acos(-1.0);
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
#define MP(x, y) make_pair(x, y)
#define PB(x) push_back(x)
#define rep(i,n) for(int i = 1 ; i<=(n) ; i++)
#define repI(i,n) for(int i = 0 ; i<(n) ; i++)
#define FOR(i,L,R) for (int i = (int)(L); i <= (int)(R); i++)
#define ROF(i,L,R) for (int i = (int)(L); i >= (int)(R); i--)
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define ALL(p) p.begin(),p.end()
#define ALLR(p) p.rbegin(),p.rend()
#define SET(p) memset(p, -1, sizeof(p))
#define CLR(p) memset(p, 0, sizeof(p))
#define MEM(p, v) memset(p, v, sizeof(p))
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld%lld",&a,&b)
#define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define getC(n) scanf("%c",&n)
#define getF(n) scanf("%lf",&n)
#define getS(n) scanf("%s",n)
#define bitCheck(N,in) ((bool)(N&(1<<(in))))
#define bitOff(N,in) (N&(~(1<<(in))))
#define bitOn(N,in) (N|(1<<(in)))
#define bitCount(a) __builtin_popcount(a)
#define iseq(a,b) (fabs(a-b)<EPS)
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define vi vector < int >
#define vii vector < vector < int > >
#define pii pair< int, int >
#define ff first
#define ss second
#define ll long long
#define ull unsigned long long
template< class T > inline T _abs(T n) { return ((n) < 0 ? -(n) : (n)); }
template< class T > inline T _max(T a, T b) { return (!((a)<(b))?(a):(b)); }
template< class T > inline T _min(T a, T b) { return (((a)<(b))?(a):(b)); }
template< class T > inline T _swap(T &a, T &b) { a=a^b;b=a^b;a=a^b;}
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <typename T> string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); }
#ifdef dipta007
#define debug(args...) {cerr<<"Debug: "; dbg,args; cerr<<endl;}
#else
#define debug(args...) // Just strip off all debug tokens
#endif
struct debugger{
template<typename T> debugger& operator , (const T& v){
cerr<<v<<" ";
return *this;
}
}dbg;
int n,a[500];
int dp[504][504][2];
int call(int beg, int end, int flg)
{
if(beg > end) return 0;
int &ret = dp[beg][end][flg];
if(ret!=-1) return ret;
ret = flg + call(beg+1, end, 1);
FOR(i, beg+1, end)
{
if(a[i] == a[beg])
{
ret = min(ret, flg + call(beg+1, i-1, 0) + call(i+1, end, 1));
}
}
return ret;
}
int main() {
#ifdef dipta007
//READ("in.txt");
// WRITE("out.txt");
#endif // dipta007
// ios_base::sync_with_stdio(0);cin.tie(0);
while(~getI(n))
{
FOR(i,0,n-1) getI(a[i]);
SET(dp);
printf("%d\n",call(0, n-1, 1));
}
return 0;
}
| [
"shubhashis.roy@selise.ch"
] | shubhashis.roy@selise.ch |
1931ce73851dea1dd464bad6ec4366436f8b5b2b | 45fe78a0331af76d966ffed52518d4a4e1abb9e0 | /Console07Amib2/VARIABLEFRICTION.cpp | 8c4c4df3cf9da8a0bc57dff1c0d7b24d7d6f360f | [] | no_license | sophia-qin/Console07HW | c93864e8634d7d5694f917a96563d6cab32a4fb3 | 81c52aaf1222552d05ad8776590257b464cd9ac7 | refs/heads/master | 2020-03-26T03:00:05.371096 | 2019-06-18T06:07:32 | 2019-06-18T06:07:32 | 144,435,099 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 536 | cpp |
#include "states.h"
namespace VARIABLEFRICTION {
// NOTE: all of {setup, enter, loop, exit} are optional
void setup() {
// do setup!
// things like pinMode, configure steppers, etc.
}
void enter() {
// called when state is entered
// turn on steppers, maybe home steppers, etc.
}
void loop() {
// called in a loop continuously while in this state
// monitor sensors, etc.
}
void exit() {
// called when state is exited
// disable steppers, let gate up, etc.
}
// now you have to implement the various events
}
| [
"noreply@github.com"
] | sophia-qin.noreply@github.com |
0b5307fe53be749330c478281f8703c3455392de | 51a0da6db94fbe7fb0d4e8c0d3713f25e24d52fd | /benchmarks/nearestNeighbors/octTreeConcurrent/flock/lf_types.h | d1e23a4463a9c90bba628e3d7771b1d2b7de2626 | [
"MIT"
] | permissive | cmuparlay/pbbsbench | 633d61448cc935bea00d3dadb68fc46efac95eeb | ecbd6ea5ebfaafc7af2082d8d821b78e28543bf9 | refs/heads/master | 2023-07-19T19:45:18.849181 | 2023-07-12T17:05:45 | 2023-07-12T17:05:45 | 167,005,662 | 64 | 19 | MIT | 2023-04-07T23:55:09 | 2019-01-22T14:12:47 | C++ | UTF-8 | C++ | false | false | 9,440 | h | #include <atomic>
#include "tagged.h"
#include "lf_log.h"
#pragma once
namespace flck {
template <typename V>
struct atomic {
private:
using IT = size_t;
using TV = internal::tagged<V>;
IT get_val(internal::Log &p) {
return p.commit_value(v.load()).first; }
public:
std::atomic<IT> v;
static_assert(sizeof(V) <= 4 || std::is_pointer<V>::value,
"Type for mutable must be a pointer or at most 4 bytes");
// not much to it. heavy lifting done in TV
atomic(V vv) : v(TV::init(vv)) {}
atomic() : v(TV::init(0)) {}
void init(V vv) {v = TV::init(vv);}
V load() {return TV::value(get_val(internal::lg));}
V load_ni() {return TV::value(v.load());}
V read() {return TV::value(v.load());}
V read_snapshot() {return TV::value(v.load());}
void store(V vv) {TV::cas(v, get_val(internal::lg), vv);}
bool cas(V old_v, V new_v) { // not safe inside locks
assert(internal::lg.is_empty());
return cas_ni(old_v, new_v);
}
bool cas_ni(V old_v, V new_v) {
IT old_t = v.load();
return (TV::value(old_t) == old_v &&
TV::cas(v, old_t, new_v, true));}
void cam(V oldv, V newv) {
IT old_t = get_val(internal::lg);
if (TV::value(old_t) == oldv)
TV::cas(v, old_t, newv);}
V operator=(V b) {store(b); return b; }
// compatibility with multiversioning
void validate() {}
// operator V() { return load(); } // implicit conversion
};
template <typename V>
struct atomic_double {
private:
struct alignas(16) TV {size_t count; V val; };
TV v;
void cam(TV oldv, TV newv) {
__int128 oldvi = *((__int128*) &oldv);
__int128 newvi = *((__int128*) &newv);
__sync_bool_compare_and_swap((__int128*) this, oldvi, newvi);
}
public:
static_assert(sizeof(V) <= 8,
"Type for mutable_double must be at most 8 bytes");
atomic_double(V vv) : v({1, vv}) {}
atomic_double() : v({1, 0}) {}
V load() {return internal::lg.commit_value_safe(v.val).first;}
V read() {return v.val;}
void init(V vv) {v.val = vv;}
void store(V newv) {
size_t cnt = internal::lg.commit_value(v.count).first;
#ifdef NoSkip // used to test performance without optimization
cam({cnt, v.val}, {cnt+1, newv});
#else
// skip if done for efficiency
skip_if_done_no_log([&] { cam({cnt, v.val}, {cnt+1, newv});});
#endif
}
V operator=(V b) {
store(b);
return b;
}
};
template <typename V>
struct atomic_aba_free {
private:
constexpr static unsigned long set_bit= (1ul << 63);
public:
std::atomic<V> v;
atomic_aba_free(V initial) : v(initial) {}
atomic_aba_free() {}
V load() { // set then mask high bit to ensure not zero
size_t x = internal::lg.commit_value((size_t) v.load() | set_bit).first;
return (V) (x & ~set_bit);
}
void init(V vv) { v = vv; }
void store(V vv) {
V old_v = load();
v.compare_exchange_strong(old_v, vv);
}
void cam(V expected, V new_v) {
V old_v = load();
if (expected == old_v)
v.compare_exchange_strong(old_v, new_v);
}
V operator=(V b) { store(b); return b; }
};
template <typename V>
struct atomic_write_once {
private:
constexpr static unsigned long set_bit= (1ul << 63);
public:
std::atomic<V> v;
atomic_write_once(V initial) : v(initial) {}
atomic_write_once() {}
V load() { // set then mask high bit to ensure not zero
size_t x = internal::lg.commit_value((size_t) v.load() | set_bit).first;
return (V) (x & ~set_bit);
}
V load_ni() {return v.load();}
void init(V vv) { v = vv; }
void store(V vv) { v = vv; }
bool cas_ni(V exp_v, V new_v) {return v.compare_exchange_strong(exp_v, new_v);}
V operator=(V b) { store(b); return b; }
// inline operator V() { return load(); } // implicit conversion
};
// *****************************
// Memory pool using epoch based collection and safe (idempotent)
// allocation and retire in a lock.
// *****************************
namespace internal {
struct lock;
}
template <typename T, typename Pool=internal::mem_pool<T>>
struct memory_pool {
Pool pool;
void reserve(size_t n) { pool.reserve(n);}
void clear() { pool.clear(); }
void stats() { pool.stats();}
void shuffle(size_t n) { pool.shuffle(n);}
void acquire(T* p) { pool.acquire(p);}
bool* retire(T* p) {
assert(p != nullptr);
if (!internal::helping)
return internal::with_empty_log([&] {return pool.retire(p);});
else return nullptr;
//auto x = internal::lg.commit_value_safe(p);
//if (x.second) // only retire if first try
// internal::with_empty_log([&] {pool.retire(p);});
}
bool* retire_ni(T* p) {
assert(p != nullptr);
return internal::with_empty_log([&] {return pool.retire(p);});
}
void destruct(T* p) {
assert(p != nullptr);
auto x = internal::lg.commit_value_safe(p);
if (x.second) // only retire if first try
internal::with_empty_log([&] {pool.destruct(p);});
}
void destruct_ni(T* p) {
assert(p != nullptr);
internal::with_empty_log([&] {pool.destruct(p);});
}
template <typename F, typename ... Args>
// f is a function that initializes a new object before it is shared
T* new_init(F f, Args... args) {
//run f without logging (i.e. an empty log)
T* newv = internal::with_log(internal::Log(), [&] {
T* x = pool.new_obj(args...);
f(x);
return x;});
auto r = internal::lg.commit_value(newv);
if (!r.second) // destruct if already initialized
internal::with_empty_log([&] {pool.destruct(newv);});
return r.first;
}
// Idempotent allocation
template <typename ... Args>
T* new_obj(Args ...args) {
return new_obj_fl(args...).first;
}
protected:
friend class internal::lock;
// The following protected routines are only used internally
// in the lock code (not accessible to the user)
// Returns a pointer to the new object and a possible pointer
// to a location in the log containing the pointer.
// The location is null if this was not the first among thunks
// to allocate the object.
// The returned pointer can be one of done_true or done_false
// if the object is already retired using retire_acquired.
template <typename ... Args>
std::pair<T*,internal::log_entry*> new_obj_acquired(Args... args) {
auto [ptr,fl] = new_obj_fl(args...);
if (internal::lg.is_empty()) return std::pair(ptr, nullptr);
internal::log_entry* l = internal::lg.current_entry();
if (!fl && !is_done(ptr)) {
pool.acquire(ptr);
return std::make_pair((T*) l->load(), nullptr);
} else return std::make_pair(ptr, fl ? l : nullptr);
}
// le must be a value returned as the second return value of new_obj_acquired.
// It will be either be null or a pointer to a log entry containing p.
// If non-null then it clears p from the log by replacing it with
// the result (true or false) so that p can be safely reclaimed.
// It then retires p.
// It is important that only one of the helping thunks is passed an le that
// is not null, otherwise could be retired multiple times
template<typename TT>
void retire_acquired_result(T* p, internal::log_entry* le, std::optional<TT> result) {
if (internal::lg.is_empty()) pool.retire(p);
else if (le != nullptr) {
*le = tag_result(result);
internal::with_empty_log([&] { pool.retire(p);});
}
}
bool is_done(T* p) {return is_done_flag(p);}
template <typename RT>
std::optional<RT> done_val_result(T* p) {
auto r = extract_result(p);
if (r.has_value()) return (RT) r.value();
else return {};
}
private:
bool done_val(T* p) {return extract_bool(p);}
// this version also returns a flag to specify whether actually allocated
// vs., having been allocated by another instance of a thunk
template <typename ... Args>
std::pair<T*,bool> new_obj_fl(Args... args) {
// TODO: helpers might do lots of allocates and frees,
// can potentially optimize by checking if a log value has already been committed.
T* newv = internal::with_log(internal::Log(),
[&] {return pool.new_obj(args...);});
auto r = internal::lg.commit_value(newv);
// if already allocated return back to pool
if (!r.second) {
internal::with_empty_log([&] {pool.destruct(newv);}); }
return r;
}
// the following tags a long entry with the return value of a thunk
// 1 at the 48th bit is true, 2 at the 48th bit is false
bool is_done_flag(T* p) {
return (((size_t) p) >> 48) > 0;
}
void* tag_bool(bool result) {
return (void*) (result ? (1ul << 48) : (2ul << 48));
}
bool extract_bool(T* p) {
return (((size_t) p) >> 48) == 1ul;
}
// a poor mans "optional". The flag at the 48th bit indicates presence,
// and the lower 48 bits are the value if present.
template<typename TT>
void* tag_result(std::optional<TT> result) {
if(!result.has_value()) return (void*) (2ul << 48);
else return (void*) ((1ul << 48) | (size_t) result.value());
}
std::optional<size_t> extract_result(T* p) {
if (extract_bool(p))
return ((size_t) p) & ((1ul << 48) - 1);
return {};
}
};
template<typename V>
V commit(V v) {return internal::lg.commit_value(v).first;}
template <typename F>
bool skip_if_done(F f) { return internal::skip_if_done(f); }
template <typename F>
bool skip_if_done_no_log(F f) { return internal::skip_if_done_no_log(f); }
template <typename F>
void non_idempotent(F f) { internal::with_empty_log(f); }
} // namespace flck
| [
"magdalen@aware.aladdin.cs.cmu.edu"
] | magdalen@aware.aladdin.cs.cmu.edu |
2a13283de0b38ebfd064785dc610d48ae0849d11 | 274dde0cd7ded9c38d0a71f5af8125c85cb10afe | /src/fj_mesh.cc | b5562a7a171fbd638e60ec5afa19afa13958b3e1 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | theomission/Fujiyama-Renderer | a81572c625421bde63096622d5c4436a505fc80d | e49c074dde1a4ab2abc5e687458487b35a692722 | refs/heads/master | 2020-12-28T22:46:45.517020 | 2015-11-20T19:19:35 | 2015-11-20T19:34:04 | 48,100,567 | 1 | 0 | null | 2015-12-16T09:28:36 | 2015-12-16T09:28:36 | null | UTF-8 | C++ | false | false | 10,574 | cc | // Copyright (c) 2011-2015 Hiroshi Tsubokawa
// See LICENSE and README
#include "fj_mesh.h"
#include "fj_intersection.h"
#include "fj_primitive_set.h"
#include "fj_triangle.h"
#include "fj_ray.h"
#define ATTRIBUTE_LIST(ATTR) \
ATTR(Point, Vector, P_, Position) \
ATTR(Point, Vector, N_, Normal) \
ATTR(Point, Color, Cd_, Color) \
ATTR(Point, TexCoord, uv_, Texture) \
ATTR(Point, Vector, velocity_, Velocity) \
ATTR(Face, Index3, indices_, Indices) \
ATTR(Face, int, face_group_id_, GroupID)
namespace fj {
#define ATTR(Class, Type, Name, Label) \
void Mesh::Add##Class##Label() \
{ \
Name.resize(Get##Class##Count()); \
} \
Type Mesh::Get##Class##Label(int idx) const \
{ \
if (idx < 0 || idx >= static_cast<int>(Name.size())) { \
return Type(); \
} \
return Name[idx]; \
} \
void Mesh::Set##Class##Label(int idx, const Type &value) \
{ \
if (idx < 0 || idx >= static_cast<int>(Name.size())) \
return; \
Name[idx] = value; \
} \
bool Mesh::Has##Class##Label() const \
{ \
return !Name.empty(); \
}
ATTRIBUTE_LIST(ATTR)
#undef ATTR
void Mesh::Clear()
{
point_count_ = 0;
face_count_ = 0;
bounds_ = Box();
#define ATTR(Class, Type, Name, Label) std::vector<Type>().swap(Name);
ATTRIBUTE_LIST(ATTR)
#undef ATTR
}
static void get_point_positions(const Mesh &mesh, Index face_index,
Vector &P0, Vector &P1, Vector &P2)
{
const Index3 face = mesh.GetFaceIndices(face_index);
P0 = mesh.GetPointPosition(face.i0);
P1 = mesh.GetPointPosition(face.i1);
P2 = mesh.GetPointPosition(face.i2);
}
static void get_point_normals(const Mesh &mesh, Index face_index,
Vector &N0, Vector &N1, Vector &N2)
{
const Index3 face = mesh.GetFaceIndices(face_index);
N0 = mesh.GetPointNormal(face.i0);
N1 = mesh.GetPointNormal(face.i1);
N2 = mesh.GetPointNormal(face.i2);
}
static void get_point_texture(const Mesh &mesh, Index face_index,
TexCoord &T0, TexCoord &T1, TexCoord &T2)
{
const Index3 face = mesh.GetFaceIndices(face_index);
T0 = mesh.GetPointTexture(face.i0);
T1 = mesh.GetPointTexture(face.i1);
T2 = mesh.GetPointTexture(face.i2);
}
static void get_point_velocity(const Mesh &mesh, Index face_index,
Vector &V0, Vector &V1, Vector &V2)
{
const Index3 face = mesh.GetFaceIndices(face_index);
V0 = mesh.GetPointVelocity(face.i0);
V1 = mesh.GetPointVelocity(face.i1);
V2 = mesh.GetPointVelocity(face.i2);
}
static void get_vertex_normals(const Mesh &mesh, Index face_index,
Vector &N0, Vector &N1, Vector &N2)
{
N0 = mesh.GetVertexNormal(3 * face_index + 0);
N1 = mesh.GetVertexNormal(3 * face_index + 1);
N2 = mesh.GetVertexNormal(3 * face_index + 2);
}
static Vector compute_shading_normal(const Mesh &mesh, Index face_index, double u, double v)
{
Vector N0, N1, N2;
if (mesh.HasVertexNormal()) {
get_vertex_normals(mesh, face_index, N0, N1, N2);
}
else {
get_point_normals(mesh, face_index, N0, N1, N2);
}
return TriComputeNormal(N0, N1, N2, u, v);
}
Mesh::Mesh() : point_count_(0), face_count_(0), bounds_()
{
face_group_name_[""] = 0;
}
Mesh::~Mesh()
{
}
int Mesh::GetPointCount() const
{
return point_count_;
}
int Mesh::GetFaceCount() const
{
return face_count_;
}
void Mesh::SetPointCount(int count)
{
point_count_ = count;
}
void Mesh::SetFaceCount(int count)
{
face_count_ = count;
}
const Box &Mesh::GetBounds() const
{
return bounds_;
}
//TODO TEST
bool Mesh::HasVertexNormal() const
{
return !vertex_normal_.IsEmpty();
}
Vector Mesh::GetVertexNormal(Index vertex_id) const
{
if (HasVertexNormal()) {
return vertex_normal_.Get(vertex_id);
}
else {
return Vector(0, 0, 0);
}
}
int Mesh::CreateFaceGroup(const std::string &group_name)
{
std::map<std::string, int>::const_iterator it = face_group_name_.find(group_name);
if (it != face_group_name_.end()) {
return it->second;
}
const int new_id = static_cast<int>(face_group_name_.size());
face_group_name_[group_name] = new_id;
return new_id;
}
int Mesh::LookupFaceGroup(const std::string &group_name) const
{
std::map<std::string, int>::const_iterator it = face_group_name_.find(group_name);
if (it != face_group_name_.end()) {
return it->second;
} else {
return -1;
}
}
void Mesh::ComputeNormals()
{
if (!HasPointPosition() || !HasFaceIndices())
return;
const int nverts = GetPointCount();
const int nfaces = GetFaceCount();
if (!HasPointNormal()) {
AddPointNormal();
}
// initialize N
for (int i = 0; i < nverts; i++) {
SetPointNormal(i, Vector(0, 0, 0));
}
// compute N
for (int i = 0; i < nfaces; i++) {
Vector P0, P1, P2;
get_point_positions(*this, i, P0, P1, P2);
Vector N0, N1, N2;
get_point_normals(*this, i, N0, N1, N2);
const Index3 face = GetFaceIndices(i);
const Vector Ng = TriComputeFaceNormal(P0, P1, P2);
SetPointNormal(face.i0, N0 + Ng);
SetPointNormal(face.i1, N1 + Ng);
SetPointNormal(face.i2, N2 + Ng);
}
// normalize N
for (int i = 0; i < nverts; i++) {
Vector N = GetPointNormal(i);
SetPointNormal(i, Normalize(&N));
}
}
void Mesh::ComputeBounds()
{
bounds_.ReverseInfinite();
for (int i = 0; i < GetFaceCount(); i++) {
Box tri_bounds;
GetPrimitiveBounds(i, &tri_bounds);
bounds_.AddBox(tri_bounds);
}
}
bool Mesh::ray_intersect(Index prim_id, const Ray &ray,
Real time, Intersection *isect) const
{
Vector P0, P1, P2;
get_point_positions(*this, prim_id, P0, P1, P2);
if (HasPointVelocity()) {
Vector velocity0, velocity1, velocity2;
get_point_velocity(*this, prim_id, velocity0, velocity1, velocity2);
P0 += time * velocity0;
P1 += time * velocity1;
P2 += time * velocity2;
}
double u, v;
double t_hit;
const int hit = TriRayIntersect(
P0, P1, P2,
ray.orig, ray.dir, DO_NOT_CULL_BACKFACES,
&t_hit, &u, &v);
if (!hit)
return false;
if (isect == NULL)
return true;
// we don't know N at time sampled point with velocity motion blur
// just using N from mesh data
// intersect info
isect->N = compute_shading_normal(*this, prim_id, u, v);
// TODO TMP uv handling
// UV = (1-u-v) * UV0 + u * UV1 + v * UV2
if (HasPointTexture()) {
TexCoord uv0, uv1, uv2;
get_point_texture(*this, prim_id, uv0, uv1, uv2);
const float t = 1 - u - v;
isect->uv.u = t * uv0.u + u * uv1.u + v * uv2.u;
isect->uv.v = t * uv0.v + u * uv1.v + v * uv2.v;
TriComputeDerivatives(
P0, P1, P2,
uv0, uv1, uv2,
&isect->dPdu, &isect->dPdv);
}
else {
isect->uv.u = 0;
isect->uv.v = 0;
isect->dPdu = Vector(0, 0, 0);
isect->dPdv = Vector(0, 0, 0);
}
isect->P = RayPointAt(ray, t_hit);
isect->object = NULL;
isect->prim_id = prim_id;
isect->shading_group_id = GetFaceGroupID(prim_id);
isect->t_hit = t_hit;
return true;
}
struct SubTri {
SubTri(): P0(), P1(), P2(), vel0(), vel1(), vel2() {}
~SubTri() {}
Vector P0, P1, P2;
Vector vel0, vel1, vel2;
};
static bool box_tri_intersect(const Box &box, const SubTri &tri)
{
const int N_STEPS = 8;
const Vector step0 = tri.vel0 / N_STEPS;
const Vector step1 = tri.vel1 / N_STEPS;
const Vector step2 = tri.vel2 / N_STEPS;
for (int i = 0; i < N_STEPS; i++) {
const Vector P0 = tri.P0 + i * step0;
const Vector P1 = tri.P1 + i * step1;
const Vector P2 = tri.P2 + i * step2;
Box segment_bounds;
TriComputeBounds(P0, P1, P2, &segment_bounds);
segment_bounds.AddPoint(P0 + step0);
segment_bounds.AddPoint(P1 + step1);
segment_bounds.AddPoint(P2 + step2);
if (BoxBoxIntersect(segment_bounds, box)) {
return true;
}
}
return false;
}
static bool box_tri_intersect_recursive(const Box &box, const SubTri &tri, int depth);
static bool box_tri_intersect_recursive(const Box &box, const SubTri &tri, int depth)
{
if (depth == 0) {
return box_tri_intersect(box, tri);
}
const Vector P01 = (tri.P0 + tri.P1) / 2;
const Vector P12 = (tri.P1 + tri.P2) / 2;
const Vector P20 = (tri.P2 + tri.P0) / 2;
const Vector vel01 = (tri.vel0 + tri.vel1) / 2;
const Vector vel12 = (tri.vel1 + tri.vel2) / 2;
const Vector vel20 = (tri.vel2 + tri.vel0) / 2;
SubTri t;
t.P0 = tri.P0;
t.P1 = P01;
t.P2 = P20;
t.vel0 = tri.vel0;
t.vel1 = vel01;
t.vel2 = vel20;
if (box_tri_intersect_recursive(box, t, depth - 1)) {
return true;
}
t.P0 = P01;
t.P1 = tri.P1;
t.P2 = P12;
t.vel0 = vel01;
t.vel1 = tri.vel1;
t.vel2 = vel12;
if (box_tri_intersect_recursive(box, t, depth - 1)) {
return true;
}
t.P0 = P12;
t.P1 = tri.P2;
t.P2 = P20;
t.vel0 = vel12;
t.vel1 = tri.vel2;
t.vel2 = vel20;
if (box_tri_intersect_recursive(box, t, depth - 1)) {
return true;
}
t.P0 = P01;
t.P1 = P12;
t.P2 = P20;
t.vel0 = vel01;
t.vel1 = vel12;
t.vel2 = vel20;
if (box_tri_intersect_recursive(box, t, depth - 1)) {
return true;
}
return false;
}
bool Mesh::box_intersect(Index prim_id, const Box &box) const
{
const int recursive_depth = 0;
SubTri t;
get_point_positions(*this, prim_id, t.P0, t.P1, t.P2);
get_point_velocity(*this, prim_id, t.vel0, t.vel1, t.vel2);
return box_tri_intersect_recursive(box, t, recursive_depth);
#if 0
Vector P0, P1, P2;
get_point_positions(*this, prim_id, P0, P1, P2);
const Vector centroid = box.Centroid();
const Vector halfsize = .5 * box.Diagonal();
return TriBoxIntersect(P0, P1, P2, centroid, halfsize);
#endif
}
void Mesh::get_primitive_bounds(Index prim_id, Box *bounds) const
{
Vector P0, P1, P2;
get_point_positions(*this, prim_id, P0, P1, P2);
TriComputeBounds(P0, P1, P2, bounds);
if (HasPointVelocity()) {
Vector velocity0, velocity1, velocity2;
get_point_velocity(*this, prim_id, velocity0, velocity1, velocity2);
const Vector P0_close = P0 + velocity0;
const Vector P1_close = P1 + velocity1;
const Vector P2_close = P2 + velocity2;
bounds->AddPoint(P0_close);
bounds->AddPoint(P1_close);
bounds->AddPoint(P2_close);
}
}
void Mesh::get_bounds(Box *bounds) const
{
*bounds = GetBounds();
}
Index Mesh::get_primitive_count() const
{
return GetFaceCount();
}
void MshGetFacePointPosition(const Mesh *mesh, int face_index,
Vector *P0, Vector *P1, Vector *P2)
{
get_point_positions(*mesh, face_index, *P0, *P1, *P2);
}
void MshGetFacePointNormal(const Mesh *mesh, int face_index,
Vector *N0, Vector *N1, Vector *N2)
{
get_point_normals(*mesh, face_index, *N0, *N1, *N2);
}
} // namespace xxx
| [
"hiroshi@fujiyama-renderer.com"
] | hiroshi@fujiyama-renderer.com |
a40351cb23afb5a418fb8dfeab23c44b6dbef4e2 | 647d7b666e450446b8a596da3e5e3b0d424c14c3 | /Programming-code2/code/Chapter18/chapter.18.3.cpp | 0636faf20eb60e3b9d00ea5c0526dd51ca9283c7 | [] | no_license | JamesBryant24/C-_exp | a1f6bc297cbe3dcbb313658ebfe645d773697c68 | 924ba6da434029785ecde14c805541e203446c7c | refs/heads/master | 2020-04-07T07:09:59.199120 | 2018-11-20T09:53:26 | 2018-11-20T09:53:26 | 158,166,273 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 776 | cpp |
//
// This is example code from Chapter 18.3 "Essential operations" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "../std_lib_facilities.h"
//------------------------------------------------------------------------------
int main()
{
string s("Triumph"); // initialize s to the character string "Triumph"
vector<double> v(10); // make v a vector of 10 doubles
vector<double> vi(10); // vector of 10 doubles, each initialized to 0.0
vector<string> vs(10); // vector of 10 strings, each initialized to ""
vector<vector< int> > vvi(10); // vector of 10 vectors, each initialized to vector()
}
//------------------------------------------------------------------------------
| [
"zkx48@mail.ustc.edu.cn"
] | zkx48@mail.ustc.edu.cn |
685a195a2eebdddf231da065fd785ff5b1e5b070 | 8c0aa69b4a148f96bcdf4637329262d5227ddf08 | /include/goetia/sketches/sketch/vec/blaze/blazemark/blazemark/blaze/Vec6Vec6Add.h | 3e1eeccb933b20ea1aa59c8efbee47677ec33cb5 | [
"BSD-3-Clause",
"MIT"
] | permissive | camillescott/goetia | edd42c80451a13d4d0ced2f6ddb4ed9cb9ac7c80 | db75dc0d87126c5ad20c35405699d89153f109a8 | refs/heads/main | 2023-04-12T15:30:48.253961 | 2022-03-25T00:23:39 | 2022-03-25T00:23:39 | 81,270,193 | 6 | 0 | MIT | 2022-04-01T21:40:58 | 2017-02-08T00:40:08 | C++ | UTF-8 | C++ | false | false | 3,012 | h | //=================================================================================================
/*!
// \file blazemark/blaze/Vec6Vec6Add.h
// \brief Header file for the Blaze 6D vector/vector addition kernel
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZEMARK_BLAZE_VEC6VEC6ADD_H_
#define _BLAZEMARK_BLAZE_VEC6VEC6ADD_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blazemark/system/Types.h>
namespace blazemark {
namespace blaze {
//=================================================================================================
//
// KERNEL FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\name Blaze kernel functions */
//@{
double vec6vec6add( size_t N, size_t steps );
//@}
//*************************************************************************************************
} // namespace blaze
} // namespace blazemark
#endif
| [
"noreply@github.com"
] | camillescott.noreply@github.com |
9d35f580aec05643f502ae17c61935c0f4b08158 | c519ddbec51dc90fcbd0e33ecf83d536118a7dca | /ConfigUtils.hpp | 6529b41d58c54b539eaadce1683f4c7ef09eceb2 | [] | no_license | PROSUP-Project/Landmarks_transfer | c5289d294c110c4d43a4ba5c1aba384e0f2fe703 | 208e351156668daeac1e91bddc348d519ba98070 | refs/heads/master | 2022-04-10T21:49:07.908748 | 2020-03-26T21:08:47 | 2020-03-26T21:08:47 | 250,368,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,711 | hpp | #ifndef __CONFIG_UTILS_HPP__
#define __CONFIG_UTILS_HPP__
#include <iostream>
#include <string>
#include <fstream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
/**
* Adds a path to the given property tree.
* The path will be requested as user input with the given input phrase.
* @param input_phrase text that will be shown in the console to ask for the input
* @param name name of the parameter in the property tree
* @param parameters property tree where the parameter should be added
*/
void addPath(const std::string& input_phrase, const std::string& name, boost::property_tree::ptree* tree);
/**
* Asks the given question and adds the path as parameter with the given name.
* If the user input is left empty this parameter will be skipped.
* @param input_phrase text that will be shown in the console to ask for the input
* @param name name of the parameter in the property tree
* @param parameters property tree where the parameter should be added
*/
void addOptionalPath(const std::string& input_phrase, const std::string& name, boost::property_tree::ptree* parameters);
/**
* Adds a new landmark to the given list of landmarks
* @param landmarks a property tree containing a list of landmarks
* @param name the name of the landmark that should be added
*/
void addLandmark(boost::property_tree::ptree* landmarks, const std::string& name);
/**
* Adds all landmarks of a radius to the given property tree.
* @param config property tree where the landmarks child should be added
*/
void addRadiusLandmarks(boost::property_tree::ptree* config);
/**
* Adds all landmarks of an ulna to the given property tree.
* @param config property tree where the landmarks child should be added
*/
void addUlnaLandmarks(boost::property_tree::ptree* config);
/**
* Adds a parameter to the given property tree.
* @param <T> the type of the parameter
* @param input_phrase text that will be shown in the console to ask for the input
* @param name name of the parameter in the property tree
* @param parameters property tree where the parameter should be added
*/
template<typename T>
void addParameter(const std::string& input_phrase, const std::string& name, boost::property_tree::ptree* parameters){
std::string input_line;
bool correct = false;
while(!correct){
std::cout << input_phrase << std::flush;
try{
getline(std::cin, input_line);
T input = boost::lexical_cast<T>(input_line);
parameters->put(name, input);
correct = true;
}catch( boost::bad_lexical_cast &e){
std::cout << "Input error, please repeat." << std::endl;
}
}
}
#endif
| [
"noreply@github.com"
] | PROSUP-Project.noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.