hexsha
stringlengths 40
40
| size
int64 7
1.05M
| ext
stringclasses 13
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 4
269
| max_stars_repo_name
stringlengths 5
109
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
listlengths 1
9
| max_stars_count
int64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 4
269
| max_issues_repo_name
stringlengths 5
116
| max_issues_repo_head_hexsha
stringlengths 40
40
| max_issues_repo_licenses
listlengths 1
9
| max_issues_count
int64 1
48.5k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 4
269
| max_forks_repo_name
stringlengths 5
116
| max_forks_repo_head_hexsha
stringlengths 40
40
| max_forks_repo_licenses
listlengths 1
9
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 7
1.05M
| avg_line_length
float64 1.21
330k
| max_line_length
int64 6
990k
| alphanum_fraction
float64 0.01
0.99
| author_id
stringlengths 2
40
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67c7ce6787c9bf7a0be0c7cc579c2513f6d3b05d
| 39
|
hpp
|
C++
|
src/boost_qvm_deduce_scalar.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 10
|
2018-03-17T00:58:42.000Z
|
2021-07-06T02:48:49.000Z
|
src/boost_qvm_deduce_scalar.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 2
|
2021-03-26T15:17:35.000Z
|
2021-05-20T23:55:08.000Z
|
src/boost_qvm_deduce_scalar.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 4
|
2019-05-28T21:06:37.000Z
|
2021-07-06T03:06:52.000Z
|
#include <boost/qvm/deduce_scalar.hpp>
| 19.5
| 38
| 0.794872
|
miathedev
|
67c833b4161bf53e5fa34b56d5c52a9a1182dc5f
| 6,965
|
cpp
|
C++
|
uploadwidget.cpp
|
HIIT/meeting-recorder
|
8fea5b3c0f5dd7eb120b1af8770191b358cd3886
|
[
"MIT"
] | 3
|
2016-08-25T07:22:19.000Z
|
2019-05-23T13:12:04.000Z
|
uploadwidget.cpp
|
HIIT/meeting-recorder
|
8fea5b3c0f5dd7eb120b1af8770191b358cd3886
|
[
"MIT"
] | null | null | null |
uploadwidget.cpp
|
HIIT/meeting-recorder
|
8fea5b3c0f5dd7eb120b1af8770191b358cd3886
|
[
"MIT"
] | 4
|
2017-03-20T22:22:33.000Z
|
2021-12-10T22:35:52.000Z
|
#include <QDebug>
#include <QDialogButtonBox>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QFormLayout>
#include <QInputDialog>
#include <QLabel>
#include "uploadwidget.h"
// ---------------------------------------------------------------------
UploadWidget::UploadWidget(QWidget *parent, QString directory) : QDialog(parent)
{
setWindowTitle("Re:Know Meeting recorder file upload");
resize(800,250);
QLabel *hint = new QLabel("Press \"Start\" to begin uploading.", this);
showtxt = new QCheckBox("Show details", this);
connect(showtxt, SIGNAL(stateChanged(int)), this, SLOT(showHideDetails(int)));
txt = new QPlainTextEdit();
txt->setReadOnly(true);
txt->setPlainText("uploadwidget started");
txt->hide();
pbar_value = 0;
pbar = new QProgressBar();
if (!settings.contains("username"))
preferences_new();
else {
appendText("using username: " + username() + ", server_ip:" + server_ip());
appendText("using server_path:" + server_path());
}
prefButton = new QPushButton("Preferences");
prefButton->setAutoDefault(false);
startButton = new QPushButton("Start");
startButton->setAutoDefault(false);
exitButton = new QPushButton("Cancel");
exitButton->setAutoDefault(false);
QDialogButtonBox *bb = new QDialogButtonBox();
bb->addButton(prefButton, QDialogButtonBox::ActionRole);
bb->addButton(startButton, QDialogButtonBox::ActionRole);
bb->addButton(exitButton, QDialogButtonBox::RejectRole);
connect(prefButton, SIGNAL(released()), this, SLOT(preferences_new()));
connect(startButton, SIGNAL(released()), this, SLOT(startUpload()));
connect(exitButton, SIGNAL(released()), this, SLOT(reject()));
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(hint);
layout->addWidget(showtxt);
layout->addStretch(0);
layout->addWidget(txt);
layout->addWidget(pbar);
layout->addWidget(bb);
setLayout(layout);
uploader = new UploadThread(directory);
connect(uploader, SIGNAL(uploadMessage(const QString&)),
this, SLOT(appendText(const QString&)));
connect(uploader, SIGNAL(blockSent()),
this, SLOT(updateProgressbar()));
connect(uploader, SIGNAL(nBlocks(int)),
this, SLOT(setMaximumProgressbar(int)));
connect(uploader, SIGNAL(uploadFinished()),
this, SLOT(uploadFinished()));
connect(uploader, SIGNAL(passwordRequested()),
this, SLOT(passwordWidget()));
connect(this, SIGNAL(passwordEntered(const QString&)),
uploader, SLOT(setPassword(const QString&)));
}
// ---------------------------------------------------------------------
void UploadWidget::appendText(const QString& text) {
txt->appendPlainText(text);
}
// ---------------------------------------------------------------------
void UploadWidget::updateProgressbar() {
pbar->setValue(++pbar_value);
}
// ---------------------------------------------------------------------
void UploadWidget::setMaximumProgressbar(int value) {
qDebug() << "setMaximumProgressbar() called, value:" << value;
pbar->setMinimum(0);
pbar->setMaximum(value);
}
// ---------------------------------------------------------------------
void UploadWidget::preferences() {
bool ok;
QString deftext = settings.value("username", "").toString();
QString text = QInputDialog::getText(this, "Preferences",
"Username:", QLineEdit::Normal,
deftext, &ok);
if (ok) {
settings.setValue("username", text);
appendText("username changed to: " + username());
}
}
// ---------------------------------------------------------------------
void UploadWidget::preferences_new() {
QDialog *prefs = new QDialog(this);
prefs->setWindowTitle("Re:Know Meeting recorder preferences");
prefs->resize(750,200);
QString un = settings.value("username", "").toString();
QString ip = settings.value("server_ip",
"128.214.113.2").toString();
QString sp = settings.value("server_path",
"/group/reknow/instrumented_meeting_room/data").toString();
QLineEdit *usernameEdit = new QLineEdit(un, prefs);
QLineEdit *serveripEdit = new QLineEdit(ip, prefs);
QLineEdit *serverpathEdit = new QLineEdit(sp, prefs);
QDialogButtonBox *pbb = new QDialogButtonBox(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
connect(pbb, SIGNAL(accepted()), prefs, SLOT(accept()));
connect(pbb, SIGNAL(rejected()), prefs, SLOT(reject()));
QGroupBox *gb = new QGroupBox("Preferences");
QFormLayout *flayout = new QFormLayout;
flayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
flayout->addRow(new QLabel("username"), usernameEdit);
flayout->addRow(new QLabel("server IP address"), serveripEdit);
flayout->addRow(new QLabel("server path"), serverpathEdit);
gb->setLayout(flayout);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(gb);
layout->addWidget(pbb);
prefs->setLayout(layout);
if (prefs->exec()) {
settings.setValue("username", usernameEdit->text());
settings.setValue("server_ip", serveripEdit->text());
settings.setValue("server_path", serverpathEdit->text());
appendText("updated preferences");
}
}
// ---------------------------------------------------------------------
void UploadWidget::startUpload() {
uploader->setPreferences(username(), server_ip(), server_path());
prefButton->setEnabled(false);
startButton->setEnabled(false);
exitButton->setText("Cancel");
uploader->start();
}
// ---------------------------------------------------------------------
QString UploadWidget::username() {
return settings.value("username", "MISSING_USERNAME").toString();
}
// ---------------------------------------------------------------------
QString UploadWidget::server_ip() {
return settings.value("server_ip", "MISSING_SERVERIP").toString();
}
// ---------------------------------------------------------------------
QString UploadWidget::server_path() {
return settings.value("server_path", "MISSING_SERVERPATH").toString();
}
// ---------------------------------------------------------------------
void UploadWidget::uploadFinished() {
prefButton->setEnabled(true);
startButton->setEnabled(true);
exitButton->setText("OK");
}
// ---------------------------------------------------------------------
void UploadWidget::passwordWidget() {
bool ok;
QString pw = QInputDialog::getText(NULL, "Enter your password",
"Password:", QLineEdit::Password,
"", &ok);
if (ok)
emit passwordEntered(pw);
else
emit passwordEntered("");
}
// ---------------------------------------------------------------------
void UploadWidget::showHideDetails(int state) {
if (state)
txt->show();
else
txt->hide();
}
// ---------------------------------------------------------------------
// Local Variables:
// c-basic-offset: 4
// End:
| 30.682819
| 82
| 0.582915
|
HIIT
|
67cc4770ead426ae65e1e9a93682a44500bd6d79
| 1,088
|
cpp
|
C++
|
Programming Basics - C++/LabEndExercises/04.ComplexCondition/PointnRectangleBorder/PointOnRectangleBorder.cpp
|
vesy53/SoftUni
|
0bb3a65d62efb537dfbd9d260c01cf9e3b3adb91
|
[
"MIT"
] | null | null | null |
Programming Basics - C++/LabEndExercises/04.ComplexCondition/PointnRectangleBorder/PointOnRectangleBorder.cpp
|
vesy53/SoftUni
|
0bb3a65d62efb537dfbd9d260c01cf9e3b3adb91
|
[
"MIT"
] | null | null | null |
Programming Basics - C++/LabEndExercises/04.ComplexCondition/PointnRectangleBorder/PointOnRectangleBorder.cpp
|
vesy53/SoftUni
|
0bb3a65d62efb537dfbd9d260c01cf9e3b3adb91
|
[
"MIT"
] | null | null | null |
// PointnectangleBorder.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double x1, y1, x2, y2, x_of_point, y_of_point;
cin >> x1 >> y1 >> x2 >> y2 >> x_of_point >> y_of_point;
bool is_on_left_border, is_on_right_border, is_on_top_border, is_on_bottom_border;
double left, right, top, bottom;
left = fmin(x1, x2);
right = fmax(x1, x2);
top = fmin(y1, y2);
bottom = fmax(y1, y2);
is_on_left_border = left == x_of_point && y_of_point >= top && y_of_point <= bottom;
is_on_right_border = right == x_of_point && y_of_point >= top && y_of_point <= bottom;
is_on_top_border = top == y_of_point && x_of_point >= left && x_of_point <= right;
is_on_bottom_border = bottom == y_of_point && x_of_point >= left && x_of_point <= right;
bool is_on_border = is_on_left_border || is_on_right_border ||
is_on_top_border || is_on_bottom_border;
if (is_on_border)
{
cout << "Border" << endl;
}
else
{
cout << "Inside / Outside" << endl;
}
return 0;
}
| 27.2
| 89
| 0.675551
|
vesy53
|
67cd7c8ce2e802bd94ccd9a7c0b62ab92a4250cf
| 420
|
hpp
|
C++
|
src/Base/TaskProcessors/MPITaskProcessor/MPIPincoTags.hpp
|
PhilipVinc/PincoSimulator
|
562192cf3b09d0e67be7e6fee67ff9b59fbc3fd3
|
[
"MIT"
] | 1
|
2017-10-23T13:22:01.000Z
|
2017-10-23T13:22:01.000Z
|
src/Base/TaskProcessors/MPITaskProcessor/MPIPincoTags.hpp
|
PhilipVinc/PincoSimulator
|
562192cf3b09d0e67be7e6fee67ff9b59fbc3fd3
|
[
"MIT"
] | null | null | null |
src/Base/TaskProcessors/MPITaskProcessor/MPIPincoTags.hpp
|
PhilipVinc/PincoSimulator
|
562192cf3b09d0e67be7e6fee67ff9b59fbc3fd3
|
[
"MIT"
] | null | null | null |
//
// Created by Filippo Vicentini on 22/02/2018.
//
#ifndef SIMULATOR_MPIPINCOTAGS_HPP
#define SIMULATOR_MPIPINCOTAGS_HPP
#define MASTER_RANK 0
#define SOLVER_STRING_MESSAGE_TAG 1
#define TASKDATA_VECTOR_MESSAGE_TAG 2
#define TASKRESULTS_VECTOR_MESSAGE_TAG 3
#define TERMINATE_WHEN_DONE_MESSAGE_TAG 15
#define NODE_TERMINATED_MESSAGE_TAG 16
#define NODE_PROGRESS_MESSAGE_TAG 17
#endif //SIMULATOR_MPIPINCOTAGS_HPP
| 22.105263
| 46
| 0.852381
|
PhilipVinc
|
67d050b2c3766dd161cd59c8ce8c3934d4fab51a
| 1,972
|
cpp
|
C++
|
Container.cpp
|
ProfessorDey/Phantasmagoria
|
cb3a96cf393d503a8184316957dde97db4f18fc8
|
[
"BSD-3-Clause"
] | null | null | null |
Container.cpp
|
ProfessorDey/Phantasmagoria
|
cb3a96cf393d503a8184316957dde97db4f18fc8
|
[
"BSD-3-Clause"
] | null | null | null |
Container.cpp
|
ProfessorDey/Phantasmagoria
|
cb3a96cf393d503a8184316957dde97db4f18fc8
|
[
"BSD-3-Clause"
] | null | null | null |
#include "Container.h"
#include <sstream>
Container::Container() {
size = 6;
slotsTaken = 0;
for (int i = 0; i < size; i++) {
contents[i] = 0;
}
}
int Container::SlotsTaken(int m, int value) {
if (m) slotsTaken = value;
return slotsTaken;
}
int Container::Size() {
return size;
}
std::string Container::ListContents() {
std::string contentList = "";
for (int i = 0; i < size; i++) {
contentList += std::to_string(contents[i]);
if (i != (size - 1)) contentList += " ";
}
return contentList;
}
int Container::GetItem(int index) {
return contents[index];
}
int Container::SetContents(std::string s) {
std::istringstream is(s);
for (int i = 0; i < size; i++) {
is >> contents[i];
}
return 0;
}
int Container::AddItem(int itemID) {
if (slotsTaken < size) {
contents[slotsTaken] = itemID;
slotsTaken++;
return 0;
}
return -1;
}
int Container::RemoveItem(int index) {
if (contents[index]) contents[index] = 0; // If container is not empty, remove contents
else return -1;
slotsTaken--; // Decrement slotsTaken
if (index != slotsTaken) Sort(); // Then if index does not match slotsTaken (slotsTaken being 1 higher than highest filled slot until we decremented it), sort, as we have left an empty slot below slotsTaken
return 0;
}
int Container::Sort() { // A simple filling sorting function, if open slot, fill it with context of highest non-empty index or finish if none available
int sorting = -1;
int index = 0;
int backIndex = size -1;
while (index < size) {
if (!contents[index]) { // If slot is empty
while (backIndex != index && !contents[backIndex]) {
backIndex--;
}
if (backIndex == index) break; // If no items beyond index to sort, break loop and return
contents[index] = contents[backIndex]; // Otherwise shift contents
contents[backIndex] = 0;
}
else index++; // Otherwise keep iterating through slots
}
return 0;
}
| 26.293333
| 208
| 0.640467
|
ProfessorDey
|
67d17ad64d0caf8ac072c5f36efd5dea3c8996a3
| 2,125
|
cpp
|
C++
|
cpp/src/runtime_cpu/datawriter.cpp
|
fragata-ai/arhat
|
e22e6655ee83140be30b9657e63af1593e3054ed
|
[
"Apache-2.0"
] | 23
|
2019-11-28T13:52:04.000Z
|
2021-12-20T03:00:07.000Z
|
cpp/src/runtime_cpu/datawriter.cpp
|
fragata-ai/arhat
|
e22e6655ee83140be30b9657e63af1593e3054ed
|
[
"Apache-2.0"
] | 1
|
2019-12-05T09:17:39.000Z
|
2019-12-05T10:57:30.000Z
|
cpp/src/runtime_cpu/datawriter.cpp
|
fragata-ai/arhat
|
e22e6655ee83140be30b9657e63af1593e3054ed
|
[
"Apache-2.0"
] | 2
|
2019-12-03T00:02:26.000Z
|
2019-12-04T17:01:00.000Z
|
//
// Copyright 2019-2020 FRAGATA COMPUTER SYSTEMS AG
//
// 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.
//
#include <cstdio>
#include <cassert>
#include "runtime/arhat.h"
#include "runtime_cpu/arhat.h"
namespace arhat {
namespace cpu {
//
// ArrayWriter
//
// construction/destruction
ArrayWriter::ArrayWriter() {
dim1 = 0;
bsz = 0;
itemSize = 0;
xfer0 = nullptr;
xfer1 = nullptr;
}
ArrayWriter::~ArrayWriter() {
delete[] xfer0;
delete[] xfer1;
}
// interface
void ArrayWriter::Init(int dim1, int bsz, int itemSize) {
assert(xfer0 == nullptr && xfer1 == nullptr);
assert(itemSize == 1 || itemSize == 2 || itemSize == 4 || itemSize == 8);
this->dim1 = dim1;
this->bsz = bsz;
this->itemSize = itemSize;
int xferSize = dim1 * bsz * itemSize;
xfer0 = new byte_t[xferSize];
xfer1 = new byte_t[xferSize];
}
int ArrayWriter::Len() const {
return data.Len();
}
int ArrayWriter::Size(int index) const {
return data.Size(index);
}
byte_t *ArrayWriter::Buffer(int index) const {
return data.Buffer(index);
}
void ArrayWriter::GetData(int index, void *buf) const {
data.GetData(index, buf);
}
// overrides
void ArrayWriter::WriteBatch(const void *buf, int count) {
assert(count <= bsz);
// full batch must be always available even when (count < bsz)
CpuMemcpy(xfer0, buf, dim1 * bsz * itemSize);
TransposeSlice(xfer1, xfer0, dim1, bsz, itemSize);
byte_t *ptr = xfer1;
int rsz = dim1 * itemSize;
for (int i = 0; i < count; i++) {
data.Add(rsz, ptr);
ptr += rsz;
}
}
} // cpu
} // arhat
| 23.097826
| 77
| 0.656
|
fragata-ai
|
67d3778d179fe63b63ceaeade9c30b6d1eb9cbdb
| 13,196
|
cpp
|
C++
|
server/server/server.cpp
|
Tonyx97/TombMP
|
7eb2d265df2fe7312b7ed07dd5943736340b921c
|
[
"MIT"
] | 3
|
2021-10-10T11:12:03.000Z
|
2021-11-04T16:46:57.000Z
|
server/server/server.cpp
|
Tonyx97/TombMP
|
7eb2d265df2fe7312b7ed07dd5943736340b921c
|
[
"MIT"
] | null | null | null |
server/server/server.cpp
|
Tonyx97/TombMP
|
7eb2d265df2fe7312b7ed07dd5943736340b921c
|
[
"MIT"
] | null | null | null |
import utils;
import prof;
#include <shared/defs.h>
#include <shared/net/net.h>
#include <shared/crypto/sha512.h>
#include <shared/scripting/resource_system.h>
#include <shared/scripting/resource.h>
#include <shared/timer_system/timer_system.h>
#include <game_ms/game_ms.h>
#include <scripting/events.h>
#include <net/handlers/hl_net_defs.h>
#include <game/handlers/hl_defs.h>
#include <game/level.h>
#include <game/player.h>
#include "server.h"
server::server()
{
peer = SLNet::RakPeerInterface::GetInstance();
ms = new game_ms();
ft = new file_transfer();
}
server::~server()
{
delete ft;
delete ms;
if (!peer)
return;
peer->Shutdown(100);
SLNet::RakPeerInterface::DestroyInstance(peer);
update_users_db();
}
bool server::init_settings()
{
prof::printt(YELLOW, "Loading server info...");
auto file = std::ifstream(SETTINGS_FILE());
if (!file)
return false;
json si;
file >> si;
if (auto val = si["ip_address"]; !val.is_string())
return false;
else info.ip = val;
if (auto val = si["server_name"]; !val.is_string())
return false;
else info.name = val;
if (auto val = si["password"]; !val.is_string())
return false;
else info.pass = val;
if (auto val = si["gamemode"]; !val.is_string())
return false;
else info.gamemode = val;
if (auto val = si["refresh_rate"]; !val.is_number_integer())
return false;
else info.ticks = val;
auto startup_resources = si["startup_resources"];
for (const std::string& rsrc : startup_resources)
info.startup_resources.insert(rsrc);
prof::printt(CYAN, "IP: '{}'", info.ip.c_str());
prof::printt(CYAN, "Server name: '{}'", info.name.c_str());
prof::printt(CYAN, "Gamemode: '{}'", info.gamemode.c_str());
prof::printt(CYAN, "Refresh rate: {}", info.ticks);
for (const auto& rsrc : info.startup_resources)
prof::printt(CYAN, "Startup resource: '{}'", rsrc.c_str());
return true;
}
bool server::init_game_settings()
{
auto file = std::ifstream(GAME_SETTINGS_FILE());
if (!file)
return false;
json gi;
file >> gi;
if (auto val = gi["playerInfo"]; val.is_boolean()) game_settings.player_info = val;
if (auto val = gi["friendlyFire"]; val.is_boolean()) game_settings.friendly_fire = val;
if (auto val = gi["flipMapSync"]; val.is_boolean()) game_settings.flip_map_sync = val;
prof::printt(YELLOW, "Initializing server game settings...");
prof::printt(CYAN, "playerInfo: {}", game_settings.player_info);
prof::printt(CYAN, "friendlyFire: {}", game_settings.friendly_fire);
prof::printt(CYAN, "flipMapSync: {}", game_settings.flip_map_sync);
return true;
}
bool server::init_user_database()
{
prof::printt(YELLOW, "Loading users database...");
if (users_db_file = std::fstream(USERS_DB, std::ios::in))
{
users_db_file >> users_db;
users_db_file.close();
}
return true;
}
bool server::init_masterserver_connection()
{
return ms->connect();
}
bool server::init()
{
if (!peer)
return false;
if (!init_masterserver_connection())
return false;
if (!init_settings())
return false;
if (!init_game_settings())
return false;
if (!init_user_database())
return false;
if (!info.pass.empty())
peer->SetIncomingPassword(info.pass.c_str(), static_cast<int>(info.pass.length()));
#ifdef _DEBUG
peer->SetTimeoutTime(60000, SLNet::UNASSIGNED_SYSTEM_ADDRESS);
#else
peer->SetTimeoutTime(2500, SLNet::UNASSIGNED_SYSTEM_ADDRESS);
#endif
SLNet::SocketDescriptor socket_desc;
socket_desc.port = tr::net::GAME_SERVER_PORT_INT;
socket_desc.socketFamily = AF_INET;
if (peer->Startup(MAX_PLAYERS(), &socket_desc, 1) != SLNet::RAKNET_STARTED)
return false;
peer->SetMaximumIncomingConnections(MAX_PLAYERS());
peer->SetOccasionalPing(true);
peer->SetUnreliableTimeout(2500);
peer->SetSplitMessageProgressInterval(100);
return (bs_ready = true);
}
bool server::load_resources(bool startup)
{
if (!std::filesystem::is_directory(resource_system::RESOURCES_PATH))
return false;
int loaded = 0,
failed = 0;
for (const auto& p : std::filesystem::directory_iterator(resource_system::RESOURCES_PATH))
{
const auto& pp = p.path();
auto path = pp.string() + '\\',
folder = pp.filename().string();
if (startup && !info.startup_resources.contains(folder))
continue;
if (!g_resource->load_server_resource(path, folder, startup))
++failed;
else ++loaded;
}
prof::printt(CYAN, "{} loaded resources, {} failed", loaded, failed);
return true;
}
bool server::set_user_flags(const std::string& user, uint64_t flags)
{
auto& arr = users_db[USERS_DB_ARRAY];
if (!arr.contains(user))
return false;
auto& user_obj = arr[user];
if (user_obj.size() != 2)
return false;
user_obj[1] = flags;
return true;
}
bool server::register_user(const std::string& user, const std::string& pass)
{
auto& arr = users_db[USERS_DB_ARRAY];
if (arr.contains(user))
return false;
arr[user] = { crypto::sha512(pass), NET_PLAYER_FLAG_USER };
update_users_db();
return true;
}
bool server::verify_user(const std::string& user, const std::string& pass, uint64_t& flags, bool& invalid_pass)
{
const auto& arr = users_db[USERS_DB_ARRAY];
if (!arr.contains(user))
return false;
const auto& user_obj = arr[user];
if (user_obj.size() != 2)
return false;
if (std::string(user_obj.at(0)).compare(crypto::sha512(pass)))
return !(invalid_pass = true);
flags = user_obj.at(1);
update_users_db();
return true;
}
bool server::is_game_setting_enabled(game_setting id)
{
switch (id)
{
case GAME_SETTING_PLAYER_INFO: return game_settings.player_info;
case GAME_SETTING_FRIENDLY_FIRE: return game_settings.friendly_fire;
case GAME_SETTING_FLIP_MAP_SYNC: return game_settings.flip_map_sync;
}
return false;
}
bool server::verify_game_ownership(net_player* player)
{
/*const bool verified = ms->verify_game_ownership(player->get_steam_id());
g_server->send_packet_broadcast_ex(ID_NET_PLAYER_STEAM_ID, player->get_sys_address(), false, verified);
if (!verified)
peer->CloseConnection(player->get_sys_address(), true);
else player->verify_game_purchase();
return false;*/
return true;
}
void server::remove_player(PLAYER_ID id)
{
if (auto it = net_players.find(id); it != net_players.end())
{
auto n_player = it->second;
if (auto player = n_player->get_player())
g_level->remove_entity(player);
delete n_player;
net_players.erase(it);
}
}
void server::set_game_setting_enabled(game_setting id, bool enabled)
{
switch (id)
{
case GAME_SETTING_PLAYER_INFO: game_settings.player_info = enabled; break;
case GAME_SETTING_FRIENDLY_FIRE: game_settings.friendly_fire = enabled; break;
case GAME_SETTING_FLIP_MAP_SYNC: game_settings.flip_map_sync = enabled; break;
}
send_packet_broadcast(ID_SERVER_GAME_SETTINGS, game_settings);
}
void server::update_users_db()
{
users_db_file.open(USERS_DB, std::ios::out, std::ios::trunc);
users_db_file << std::setw(4) << users_db << std::endl;
users_db_file.close();
}
int server::get_system_ping(const SLNet::SystemAddress& addr) const
{
return peer->GetLastPing(addr);
}
void server::remove_player(net_player* player)
{
remove_player(player->get_id());
}
SLNet::BitStream* server::create_all_resources_sync_status_packet()
{
auto rsrcs_count = g_resource->get_resources_count();
if (rsrcs_count <= 0)
return nullptr;
auto bs = g_server->create_packet(ID_RESOURCE_SYNC_ALL_STATUS);
bs->Write(rsrcs_count);
g_resource->for_each_resource([&](resource* rsrc)
{
bs->Write(gns::resource::action { .name = rsrc->get_folder().c_str(), .action = rsrc->get_status() });
});
return bs;
}
net_player* server::add_player(SLNet::Packet* p)
{
auto n_player = new net_player();
n_player->set_sys_address(p->systemAddress);
n_player->set_id(p->guid.g);
n_player->set_id_str(p->guid.ToString());
n_player->set_name("** Not Connected **");
auto player = g_level->add_player(n_player);
n_player->set_player(player);
auto id = n_player->get_id();
net_players.insert({ id, n_player });
gns::net_player::connect info;
info.id = id;
info.sid = player->get_sync_id();
send_packet_broadcast_ex(ID_NET_PLAYER_CONNECT, p->systemAddress, true, info);
prof::printt(GREEN, "New connection from {}", p->systemAddress.ToString());
return n_player;
}
net_player* server::get_net_player(PLAYER_ID id)
{
auto it = net_players.find(id);
return (it != net_players.end() ? it->second : nullptr);
}
net_player* server::get_net_player(const SLNet::SystemAddress sys_address)
{
auto it = std::find_if(net_players.begin(), net_players.end(), [&](const auto& p) { return p.second->get_sys_address() == sys_address; });
return (it != net_players.end() ? it->second : nullptr);
}
void server::on_resource_action(resource* rsrc, resource_action action, script_action_result res, bool done)
{
if (!done)
return;
switch (action)
{
case RESOURCE_ACTION_START:
{
if (res == SCRIPT_ACTION_OK || res == SCRIPT_ACTION_SCRIPT_ERROR)
{
for (const auto& [id, player] : g_server->get_net_players())
player->sync_all_resources();
}
break;
}
case RESOURCE_ACTION_STOP:
{
if (res == SCRIPT_ACTION_OK)
{
if (auto packet = g_server->create_all_resources_sync_status_packet())
g_server->send_packet_broadcast(packet);
}
}
}
}
void server::script_error_callback(script* s, const std::string& err)
{
for (const auto& [id, player] : g_server->get_net_players())
if (player->has_resource_permissions())
g_server->send_packet_broadcast_ex(ID_NET_PLAYER_SCRIPT_ERROR, player->get_sys_address(), false, gns::net_player::script_error { err.substr(0, err.find('\n')).c_str() });
}
void server::dispatch_packets()
{
if (tick++ % (get_ticks() * MS_UPDATE_MODIFIER()) == 0)
{
std::string players_list;
std::for_each(net_players.begin(), net_players.end(), [&](const std::pair<PLAYER_ID, net_player*>& p) { players_list += p.second->get_name() + ";"; });
//prof::printt(GREEN, "Public IP {}", info.ip);
ms->send_info(info.ip, info.name, info.gamemode, g_level->get_name(), players_list, static_cast<int>(net_players.size()), MAX_PLAYERS());
send_packet_broadcast(ID_SYNC_REQUEST_STREAM_INFO);
}
// trigger onTick event
g_resource->trigger_event(events::engine::ON_TICK, tick);
// dispatch files transferring
ft->dispatch();
// update the server timers
g_timer->update();
// update streamers sync
g_level->update_entity_streamers();
// dispatch packets now
for (auto p = peer->Receive(); p; peer->DeallocatePacket(p), p = peer->Receive())
{
auto is_packet_in_range = [&](auto pid, auto min, auto max)
{
return (pid > min && pid < max);
};
PLAYER_ID id = p->guid.g;
auto sys_address = p->systemAddress;
SLNet::BitStream bs_in(p->data, p->length, false);
switch (const auto packet_id = get_packet_id(p, &bs_in))
{
case ID_NEW_INCOMING_CONNECTION:
{
auto player = add_player(p);
gns::level::load out_info {};
out_info.name = g_level->get_filename().c_str();
out_info.restart = false;
send_packet_broadcast_ex(ID_SERVER_GAME_SETTINGS, sys_address, false, game_settings);
send_packet_broadcast_ex(ID_LEVEL_LOAD, sys_address, false, out_info);
#ifdef LEVEL_EDITOR
g_resource->set_action_callback(nullptr);
g_resource->set_err_callback_fn(nullptr);
g_resource->restart_all();
g_resource->set_action_callback(server::on_resource_action);
g_resource->set_err_callback_fn(server::script_error_callback);
#endif
player->sync_all_resources();
break;
}
default:
{
if (packet_id == ID_DISCONNECTION_NOTIFICATION || packet_id == ID_CONNECTION_LOST ||
is_packet_in_range(packet_id, ID_NET_PLAYER_PACKET_BEGIN, ID_NET_PLAYER_PACKET_END))
{
net_player_handlers::handle_packet(get_net_player(id), packet_id);
}
else if (is_packet_in_range(packet_id, ID_SERVER_PACKET_BEGIN, ID_SERVER_PACKET_END))
server_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_LEVEL_PACKET_BEGIN, ID_LEVEL_PACKET_END))
level_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_RESOURCE_PACKET_BEGIN, ID_RESOURCE_PACKET_END))
resource_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_PLAYER_PACKET_BEGIN, ID_PLAYER_PACKET_END))
player_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_PROJECTILE_PACKET_BEGIN, ID_PROJECTILE_PACKET_END))
projectile_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_FX_PACKET_BEGIN, ID_FX_PACKET_END))
fx_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_AUDIO_PACKET_BEGIN, ID_AUDIO_PACKET_END))
audio_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_ITEM_PACKET_BEGIN, ID_ITEM_PACKET_END))
entity_handlers::handle_packet(get_net_player(id), packet_id);
else if (is_packet_in_range(packet_id, ID_SYNC_BEGIN, ID_SYNC_END))
sync_handlers::handle_packet(get_net_player(id), packet_id);
}
}
reset_bs();
}
std::this_thread::sleep_for(std::chrono::microseconds(get_update_rate()));
}
| 25.039848
| 173
| 0.724007
|
Tonyx97
|
67d457a2c4b6811701439ce0d694f70e0050f804
| 25,088
|
cpp
|
C++
|
reducers/dedup/src/cilk/encoder-reducer.cpp
|
neboat/cilkbench
|
ab94183fa348fa8afb7d1547211b202beb4e1d07
|
[
"MIT"
] | 7
|
2018-12-09T14:10:16.000Z
|
2021-02-08T10:37:39.000Z
|
reducers/dedup/src/cilk/encoder-reducer.cpp
|
neboat/cilkbench
|
ab94183fa348fa8afb7d1547211b202beb4e1d07
|
[
"MIT"
] | null | null | null |
reducers/dedup/src/cilk/encoder-reducer.cpp
|
neboat/cilkbench
|
ab94183fa348fa8afb7d1547211b202beb4e1d07
|
[
"MIT"
] | 4
|
2019-05-28T16:22:09.000Z
|
2020-02-24T18:27:24.000Z
|
/*
* Decoder for dedup files
*
* Copyright 2010 Princeton University.
* All rights reserved.
*
* Originally written by Minlan Yu.
* Largely rewritten by Christian Bienia.
*/
/*
* The pipeline model for Encode is
* Fragment->FragmentRefine->Deduplicate->Compress->Reorder
* Each stage has basically three steps:
* 1. fetch a group of items from the queue
* 2. process the items
* 3. put them in the queue for the next stage
*/
#include <assert.h>
#include <strings.h>
#include <math.h>
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <iostream>
#include <fstream>
#include <cilk/cilk.h>
#include <cilk/cilk_api.h>
#include <cilk/reducer_ostream.h>
#include "cilkpub_report_time.h"
#include "config.h"
#include "debug.h"
#include "dedupdef.h"
#include "encoder.h"
#include "util/ktiming.h"
#include "util/util.h"
#include "util/hashtable.h"
#include "util/rabin.h"
size_t xostream(std::ofstream &os, const void *buf, size_t len);
int ostream_header(std::ostream &os, byte compress_type);
size_t xostream(std::ostream &os, const void *buf, size_t len) {
char *p = (char *)buf;
size_t nsent = 0;
ssize_t rv;
while (nsent < len) {
/* rv = write(sd, p, len - nsent); */
/* if (0 > rv && (errno == EINTR || errno == EAGAIN)) */
/* continue; */
/* if (0 > rv) */
/* return -1; */
os.write(p, len - nsent);
if (os.good())
return -1;
nsent += rv;
p += rv;
}
return nsent;
}
int ostream_header(std::ostream &os, byte compress_type) {
int checkbit = CHECKBIT;
if (xostream(os, &checkbit, sizeof(int)) < 0) {
return -1;
}
if (xostream(os, &compress_type, sizeof(byte)) < 0) {
return -1;
}
return 0;
}
#define TIMING 0
#if TIMING
#define WHEN_TIMING(...) __VA_ARGS__
#else
#define WHEN_TIMING(...)
#endif
#ifdef ENABLE_GZIP_COMPRESSION
#include <zlib.h>
#endif //ENABLE_GZIP_COMPRESSION
#ifdef ENABLE_BZIP2_COMPRESSION
#include <bzlib.h>
#endif //ENABLE_BZIP2_COMPRESSION
#ifdef ENABLE_STATISTICS
#include "util/stats.h"
//variable with global statistics
stats_t stats;
#endif
// The configuration block defined in main
static config_t * conf;
// Hash table data structure & utility functions
static struct hashtable *cache;
static unsigned int hash_from_key_fn( void *k ) {
// NOTE: sha1 sum is integer-aligned
return ((unsigned int *)k)[0];
}
static int keys_equal_fn( void *key1, void *key2 ) {
return (memcmp(key1, key2, SHA1_LEN) == 0);
}
// Arguments
typedef struct file_info {
// src file descriptor, first pipeline stage only
int fd_in;
// output file descriptor, first pipeline stage only
int fd_out;
// output file stream
cilk::reducer_ostream *f_out_reducer;
// input file buffer, first pipeline stage & preloading only
unsigned char *buffer; // holds the content from input file
size_t buf_seek; // where we are reading in the buffer
// meaningful content left in the buffer after buf_seek
size_t bytes_left;
int next_offset; // the next offset returned by rabinseg after buf_seek
} file_info_t;
// Simple write utility function
// static int write_file(int fd, u_char type, size_t len, u_char * content) {
static int write_file(std::ostream &f_out,
u_char type, size_t len, u_char * content) {
if (xostream(f_out, &type, sizeof(type)) < 0){
perror("xwrite:");
EXIT_TRACE("xwrite type fails\n");
return -1;
}
if (xostream(f_out, &len, sizeof(len)) < 0){
EXIT_TRACE("xwrite content fails\n");
}
if (xostream(f_out, content, len) < 0){
EXIT_TRACE("xwrite content fails\n");
}
return 0;
}
/*
* Helper function that creates and initializes the output file
* Takes the file name to use as input and returns the file handle
* The output file can be used to write chunks without any further steps
*/
/* XXX
static int create_output_file(char *outfile) {
int fd;
WHEN_TIMING( float t1 = 0.0f, t2 = 0.0f; )
WHEN_TIMING( clockmark_t begin, end; )
WHEN_TIMING( begin = ktiming_getmark(); )
//Create output file
fd = open(outfile, O_CREAT | O_TRUNC | O_WRONLY,
S_IRGRP | S_IWUSR | S_IRUSR | S_IROTH);
if (fd < 0) {
EXIT_TRACE("Cannot open output file.");
}
WHEN_TIMING({
end = ktiming_getmark();
t1 = ktiming_diff_usec(&begin, &end);
begin = end;
})
//Write header
if (write_header(fd, conf->compress_type)) {
EXIT_TRACE("Cannot write output file header.\n");
}
WHEN_TIMING({
end = ktiming_getmark();
t2 = ktiming_diff_usec(&begin, &end);
printf("open time = %.4f seconds\n", t1/1000000000);
printf("header time = %.4f seconds\n", t2/1000000000);
})
return fd;
} */
/*
* Helper function that writes a chunk to an output file depending on
* its state. The function will write the SHA1 sum if the chunk has
* already been written before, or it will write the compressed data
* of the chunk if it has not been written yet.
*
* This function will block if the compressed data is not available yet.
* This function might update the state of the chunk if there are any changes.
*/
// NOTE: The serial version relies on the fact that chunks are processed
// in-order, which means if it reaches the function it is guaranteed all
// data is ready.
// static void write_chunk_to_file(int fd, chunk_t *chunk) {
static void write_chunk_to_file(std::ostream &f_out, chunk_t *chunk) {
assert(chunk!=NULL);
if(!chunk->isDuplicate) {
// Unique chunk, data has not been written yet, do so now
write_file(f_out, TYPE_COMPRESS, chunk->len, chunk->data);
} else {
// Duplicate chunk, data has been written to file; just write SHA1
write_file( f_out, TYPE_FINGERPRINT, SHA1_LEN,
(unsigned char *)(chunk->sha1) );
}
}
/*
* Computational kernel of compression stage
*
* Actions performed:
* - Compress a data chunk
*/
static void sub_Compress(chunk_t *const chunk) {
assert(chunk!=NULL);
// compress the item and add it to the database
switch (conf->compress_type) {
case COMPRESS_NONE:
break; // nothing to do
#ifdef ENABLE_GZIP_COMPRESSION
case COMPRESS_GZIP: {
// Gzip compression buffer must be at least 0.1% larger than
// the source buffer plus 12 bytes
size_t len = chunk->len + (chunk->len >> 9) + 12;
unsigned char *comp_data = (unsigned char*)malloc(len);
if(comp_data == NULL) {
EXIT_TRACE("Malloc for space of compression data failed.\n");
}
size_t old_len = len;
// compress the block
int r = compress(comp_data, &len, chunk->data, chunk->len);
if (r != Z_OK) {
EXIT_TRACE("Compression failed\n");
}
if(len < old_len) { // Shrink buffer to actual size
unsigned char *new_mem = (unsigned char*)realloc(comp_data, len);
assert(new_mem != NULL);
comp_data = new_mem;
}
// no need to free the old data, because those are just pointer
// pointing into the buffer that stores the data read from the
// input file
chunk->data = comp_data;
chunk->len = len;
break;
}
#endif // ENABLE_GZIP_COMPRESSION
#ifdef ENABLE_BZIP2_COMPRESSION
case COMPRESS_BZIP2: {
// Bzip compression buffer must be at least 1% larger than
// the source buffer plus 600 bytes
size_t len = chunk->len + (chunk->len >> 6) + 600;
void *comp_data = malloc(len);
if(comp_data == NULL) {
EXIT_TRACE("Malloc for space of compression data failed.\n");
}
size_t old_len = len;
// compress the block
int ret = BZ2_bzBuffToBuffCompress(comp_data, &len, chunk->data,
chunk->len, 9, 0, 30);
if (r != BZ_OK) {
EXIT_TRACE("Compression failed\n");
}
// Shrink buffer to actual size
if(len < old_len) {
void *new_mem = realloc(comp_data, len);
assert(new_mem != NULL);
comp_data = new_mem;
}
// no need to free the old data, because those are just pointer
// pointing into the buffer that stores data read from input file
chunk->data = comp_data;
chunk->len = len;
break;
}
#endif // ENABLE_BZIP2_COMPRESSION
default:
EXIT_TRACE("Compression type not implemented.\n");
break;
}
#ifdef ENABLE_STATISTICS
stats.total_compressed += chunk->len;
#endif
return;
}
/*
* Computational kernel of deduplication stage
*
* Actions performed:
* - Calculate SHA1 signature for each incoming data chunk
* - Perform database lookup to determine chunk redundancy status
* - On miss add chunk to database
* - Returns chunk redundancy status
*/
static int sub_Deduplicate(chunk_t *const chunk) {
assert(chunk != NULL);
assert(chunk->data != NULL);
SHA1_Digest(chunk->data, chunk->len, (unsigned char *)(chunk->sha1));
// Query database to determine whether we've seen the data chunk before
int found = hashtable_search_key(cache, (void *)(chunk->sha1));
chunk->isDuplicate = found;
if(found == 0) {
// Miss: Create entry in hashtable and forward data to compression stage
// Insert the key into the hashtable so the later iterations know that
// this particular data has been seen by earlier iteration
if(hashtable_insert(cache, (void *)(chunk->sha1), chunk) == 0) {
EXIT_TRACE("hashtable_insert_key failed");
}
}
// There is nothing to do if it's a hit
#ifdef ENABLE_STATISTICS
if(found) {
stats.nDuplicates++;
} else {
stats.total_dedup += chunk->len;
}
#endif
return found;
}
// practically a define. Never changes
static const int rf_win_dataprocess = 0;
// Read 'bytes_to_read' into buffer and returns actual bytes read
// Would like to use xread but can't --- it returns 0 if the file hits EOF
// before bytes_to_read number of bytes are read
static inline size_t
read_next_chunk(int fd, unsigned char *buffer, size_t bytes_to_read) {
size_t ret;
size_t bytes_read = 0;
while(bytes_read < bytes_to_read) {
ret = read(fd, buffer, bytes_to_read - bytes_read);
if(ret < 0) {
perror("I/O error:");
EXIT_TRACE("file read fails\n");
} else if(ret == 0) { // done reading the file
break;
}
bytes_read += ret;
}
return bytes_read;
}
static inline void
setup_initial_buffer(file_info_t *const args,
u32int *const rabintab, u32int *const rabinwintab) {
if(conf->preloading == 0) {
assert(args->buffer != NULL);
size_t bytes_read = read_next_chunk(args->fd_in, args->buffer, MAXBUF);
if(bytes_read == 0) EXIT_TRACE("Input file empty.");
args->bytes_left = bytes_read;
}
args->next_offset = rabinseg(args->buffer, args->bytes_left,
rf_win_dataprocess, rabintab, rabinwintab);
assert(args->next_offset <= args->bytes_left);
}
// get the next chunk and setup the file buffer, buffer seek, and next offset
// for the next chunk. If we hit the end of the file, the next offset will
// be set to 0 after the last chunk is retrieved. Each malloced-buffer that
// holds the input file content will be freed when the last chunk pointing
// to it has been written out to the output file, except for the very last
// buffer, which is freed in Encode when the pipeline ends.
static size_t
get_next_chunk(file_info_t *const args, chunk_t *const chunk,
u32int *const rabintab, u32int *const rabinwintab) {
// static local variable to preserve the values between invocations
size_t buf_seek = args->buf_seek;
size_t bytes_left = args->bytes_left;
unsigned char *const buffer = args->buffer;
size_t next_offset = args->next_offset;
assert(next_offset > 0);
chunk->data = buffer + buf_seek;
chunk->len = next_offset;
bytes_left -= next_offset;
buf_seek += next_offset;
assert(bytes_left >= 0);
if(bytes_left != 0) {
// find the next chunk to split off
next_offset = rabinseg(buffer + buf_seek, bytes_left,
rf_win_dataprocess, rabintab, rabinwintab);
if( (conf->preloading == 0) && (next_offset == bytes_left) ) {
// this will be the last chunk pointing to the old buffer
unsigned char *new_buf = (unsigned char *) malloc(MAXBUF);
size_t bytes_read = read_next_chunk(args->fd_in,
new_buf+bytes_left , MAXBUF-bytes_left);
if(bytes_read > 0) { // there is actually more input
memcpy(new_buf, buffer + buf_seek, bytes_left); // get left over
args->buffer = new_buf; // replace the old buffer with the new
chunk->buffer_to_free = buffer; // be sure we free the old one
buf_seek = 0; // reset the seek index
bytes_left += bytes_read; // reset the other stuff
next_offset = rabinseg(args->buffer, bytes_left,
rf_win_dataprocess, rabintab, rabinwintab);
} else {
// otherwise we have hit the end of the file, and there is
// no point moving data into new buf; we will realize we are
// done the next time this function is invoked, via the fact
// that bytes_left will be 0
free(new_buf);
}
}
assert(next_offset <= bytes_left && next_offset >= 0);
} else { // we are indeed done after this chunk returns
next_offset = 0;
}
args->next_offset = next_offset;
args->buf_seek = buf_seek;
args->bytes_left = bytes_left;
return chunk->len;
}
/*
* Integrate all computationally intensive pipeline
* stages to improve cache efficiency.
*
* Ange: The file is read in and chopped into chunks.
* Each chunk is then furhter segmented into smaller segments using Rabin
* finger printing (and each segment is variable size --- Rabin finger
* printing finds a good place to split the chunk so that even if the file
* changes, where the segments split stays roughly the same).
*
* Each segment goes through the stage of
* -- check duplicates (compute SHA1 key)
* -- compress the segment if this is first time it's seen
* -- write the segment (or SHA1) to file, depending on whether it is a
* duplicate or not
*/
void *SerialIntegratedPipeline(file_info_t *const args) {
/* WHEN_TIMING( uint64_t write_time = 0.0f, dedup_time = 0.0f; ) */
/* WHEN_TIMING( float preproc_time = 0.0f, comp_time = 0.0f; ) */
/* WHEN_TIMING( float read_time = 0.0f, total_time = 0.0f; ) */
/* WHEN_TIMING( clockmark_t first, last; ) */
/* WHEN_TIMING( clockmark_t begin, end; ) */
/* WHEN_TIMING( first = begin = ktiming_getmark(); ) */
// int fd_out = create_output_file(conf->outfile);
// XXX
// if (write_header(args->fd_out, conf->compress_type)) {
// EXIT_TRACE("Cannot write output file header.\n");
// }
if (ostream_header(args->f_out_reducer->get_reference(), conf->compress_type)) {
EXIT_TRACE("Cannot write output file header.\n");
}
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* preproc_time = ktiming_diff_usec(&begin, &end); */
/* }) */
u32int *const rabintab = (u32int *) malloc(256*sizeof rabintab[0]);
u32int *const rabinwintab = (u32int *) malloc(256*sizeof rabintab[0]);
if(rabintab == NULL || rabinwintab == NULL) {
EXIT_TRACE("Memory allocation failed.\n");
}
rabininit(rf_win_dataprocess, rabintab, rabinwintab);
/* WHEN_TIMING( begin = ktiming_getmark(); ) */
setup_initial_buffer(args, rabintab, rabinwintab);
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* begin = end; */
/* read_time += ktiming_diff_usec(&begin, &end); */
/* }) */
while(args->next_offset > 0) {
chunk_t *chunk = (chunk_t *) malloc(sizeof(chunk_t));
if(chunk == NULL) EXIT_TRACE("Memory allocation failed.\n");
chunk->buffer_to_free = (unsigned char *) NULL;
// get the next chunk from input file / buffer
/* WHEN_TIMING( begin = ktiming_getmark(); ) */
get_next_chunk(args, chunk, rabintab, rabinwintab);
assert(chunk->len > 0);
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* begin = end; */
/* read_time += ktiming_diff_usec(&begin, &end); */
/* }) */
// keep of the stats on the sizes of the uncompressed chunks seen
#ifdef ENABLE_STATISTICS
// update statistics
stats.nChunks[CHUNK_SIZE_TO_SLOT(chunk->len)]++;
#endif
// Deduplicate: check if in the hashtable; if so, get the
// pointer to the chunk that contains the compressed data
int isDuplicate = sub_Deduplicate(chunk);
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* dedup_time += ktiming_diff_usec(&begin, &end); */
/* begin = end; */
/* }) */
cilk_spawn [](file_info_t *const args, chunk_t *chunk, int isDuplicate) -> void {
// If chunk is unique compress & archive it.
if(isDuplicate == 0) {
sub_Compress(chunk); // compress the entire chunk
// chunk.data will point to a newly-malloc-ed memory
}
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* comp_time += ktiming_diff_usec(&begin, &end); */
/* begin = end; */
/* }) */
// write_chunk_to_file(args->fd_out, chunk);
write_chunk_to_file(args->f_out_reducer->get_reference(), chunk);
/* WHEN_TIMING({ */
/* end = ktiming_getmark(); */
/* write_time += ktiming_diff_usec(&begin, &end); */
/* begin = end; */
/* }) */
// since we have written out the chunk, now we can free the buffer
// if this was the last chunk pointing into the buffer
if(chunk->buffer_to_free) {
free(chunk->buffer_to_free);
chunk->buffer_to_free = (unsigned char *) NULL;
}
// the SHA1 is in the hashtable, so we can't free the chunk yet
if(chunk->isDuplicate == 0) {
// the compressed data has been written out, so we can free it
free(chunk->data);
/* // get new memory for the next chunk so we don't overwrite the SHA1 */
/* // anything in the hashtable will be freed at the end of the program */
/* chunk = (chunk_t *) malloc(sizeof(chunk_t)); */
/* if(chunk == NULL) EXIT_TRACE("Memory allocation failed.\n"); */
/* chunk->buffer_to_free = (unsigned char *) NULL; */
} else { // otherwise, we can free it
free(chunk);
}
} (args, chunk, isDuplicate);
}
cilk_sync;
free(rabintab);
free(rabinwintab);
// free(chunk); // free the last one allocated
/* WHEN_TIMING({ */
/* last = ktiming_getmark(); */
/* total_time = ktiming_diff_usec(&first, &last); */
/* }) */
/* WHEN_TIMING({ */
/* printf("Preproc time = %.4f seconds\n", (double)preproc_time*1.0e-9); */
/* printf("Reading time = %.4f seconds\n", (double)read_time*1.0e-9); */
/* printf("Dedup time = %.4f seconds\n", (double)dedup_time*1.0e-9); */
/* printf("Compress time = %.4f seconds\n", (double)comp_time*1.0e-9); */
/* printf("Writing time = %.4f seconds\n", (double)write_time*1.0e-9); */
/* printf("Mist. time = %.4f seconds\n", */
/* (double)(total_time - preproc_time - read_time */
/* - dedup_time - comp_time - write_time)*1.0e-9); */
/* }) */
// XXX
// close(fd_out);
return NULL;
}
/*--------------------------------------------------------------------------*/
/* Encode
* Compress an input stream
*
* Arguments:
* conf: Configuration parameters
*
*/
void Encode(config_t * _conf) {
struct stat filestat;
// timing stuff
float preload_time = 0.0f;
float process_time = 0.0f;
clockmark_t begin, end, preload_end;
conf = _conf;
#ifdef ENABLE_STATISTICS
init_stats(&stats);
#endif
// Create chunk cache
cache = hashtable_create(65536, hash_from_key_fn, keys_equal_fn, FALSE);
if(cache == NULL) {
printf("ERROR: Out of memory\n");
exit(1);
}
file_info_t args;
/* src file stat */
if (stat(conf->infile, &filestat) < 0)
EXIT_TRACE("stat() %s failed: %s\n", conf->infile, strerror(errno));
if (!S_ISREG(filestat.st_mode))
EXIT_TRACE("not a normal file: %s\n", conf->infile);
#ifdef ENABLE_STATISTICS
stats.total_input = filestat.st_size;
#endif
/* src file open */
if((args.fd_in = open(conf->infile, O_RDONLY | O_LARGEFILE)) < 0) {
EXIT_TRACE("%s file open error %s\n", conf->infile, strerror(errno));
}
/* output file open */
// if((args.fd_out = open(conf->outfile,
// O_CREAT | O_TRUNC | O_WRONLY | O_TRUNC,
// S_IRGRP | S_IWUSR | S_IRUSR | S_IROTH)) < 0) {
// EXIT_TRACE("%s output file open error %s\n", conf->outfile,
// strerror(errno));
// }
std::filebuf fb;
if(NULL == (fb.open(conf->outfile,
std::ios::out | std::ios::trunc))) {
EXIT_TRACE("%s output file open error %s\n", conf->outfile,
strerror(errno));
}
args.f_out_reducer = new cilk::reducer_ostream(std::ostream(&fb));
begin = ktiming_getmark();
// Sanity check
if(MAXBUF < 8 * ANCHOR_JUMP) {
printf("WARNING: I/O buffer size is small. Performance degraded.\n");
fflush(NULL);
}
if(conf->preloading) {
// Load entire file into memory if requested by user
unsigned char *file_buffer = (unsigned char *) malloc(filestat.st_size);
if(file_buffer == NULL)
EXIT_TRACE("Error allocating memory for input buffer.\n");
size_t bytes_read=0;
// Read data until buffer full
while(bytes_read < filestat.st_size) {
size_t r = read(args.fd_in, file_buffer + bytes_read,
filestat.st_size - bytes_read);
if(r < 0) {
perror("I/O error: ");
} else if(r == 0) {
break;
}
bytes_read += r;
}
args.bytes_left = filestat.st_size;
args.buffer = file_buffer;
preload_end = ktiming_getmark();
preload_time = ktiming_diff_usec(&begin, &preload_end);
} else {
args.buffer = (unsigned char *) malloc(MAXBUF);
}
args.buf_seek = 0;
// XXX This is where the old ROI timing begin
// Do the processing
SerialIntegratedPipeline(&args);
// XXX This is where the old ROI timing end
end = ktiming_getmark();
process_time = ktiming_diff_usec(&begin, &end);
// clean up
free(args.buffer);
/* clean up with the src file */
if(conf->infile != NULL)
close(args.fd_in);
// close(args.fd_out);
fb.close();
hashtable_destroy(cache, TRUE);
if(preload_time) {
printf("Preloading time = %.4f seconds\n", preload_time*1.0e-9);
}
printf("Processing time = %.4f seconds\n", process_time*1.0e-9);
/*
cilkpub_report_time(stdout,
"dedup-serial-preload",
conf->nthreads,
preload_time / 1.0e9,
conf->infile, "");
cilkpub_report_time(stdout,
"dedup-serial-process",
conf->nthreads,
process_time / 1.0e9,
conf->infile, "");
*/
#ifdef ENABLE_STATISTICS
/* dest file stat */
if (stat(conf->outfile, &filestat) < 0)
EXIT_TRACE("stat() %s failed: %s\n", conf->outfile, strerror(errno));
stats.total_output = filestat.st_size;
// Analyze and print statistics
if(conf->verbose) print_stats(&stats);
#endif
}
| 33.361702
| 89
| 0.592674
|
neboat
|
67db1cc10447917ed8d10841a7c21c9ec6dcc8e5
| 1,931
|
cpp
|
C++
|
src/remote_server.cpp
|
Marcos-Seafloor/udp_bridge
|
4acd257f7da3b6d591f4091fc0dbfadb53d038dd
|
[
"BSD-2-Clause"
] | null | null | null |
src/remote_server.cpp
|
Marcos-Seafloor/udp_bridge
|
4acd257f7da3b6d591f4091fc0dbfadb53d038dd
|
[
"BSD-2-Clause"
] | null | null | null |
src/remote_server.cpp
|
Marcos-Seafloor/udp_bridge
|
4acd257f7da3b6d591f4091fc0dbfadb53d038dd
|
[
"BSD-2-Clause"
] | null | null | null |
#include "udp_bridge/udp_bridge.h"
#include "std_msgs/String.h"
#include "std_msgs/Bool.h"
#include "std_msgs/Float32.h"
#include "geographic_msgs/GeoPointStamped.h"
#include "marine_msgs/Heartbeat.h"
#include "marine_msgs/Contact.h"
#include "marine_msgs/NavEulerStamped.h"
#include "marine_msgs/RadarSectorStamped.h"
#include "diagnostic_msgs/DiagnosticArray.h"
#include "sensor_msgs/NavSatFix.h"
#include "sensor_msgs/PointCloud.h"
#include "marine_msgs/Helm.h"
#include "geometry_msgs/TwistStamped.h"
#include "geographic_msgs/GeoPath.h"
#include "geographic_visualization_msgs/GeoVizItem.h"
#include <regex>
#include "boost/date_time/posix_time/posix_time.hpp"
std::map<udp_bridge::Channel,std::string> udp_bridge::UDPROSNode::topic_map;
int main(int argc, char **argv)
{
ros::init(argc, argv, "udp_bridge_remote_server");
std::string host = "localhost";
if (argc > 1)
host = argv[1];
int send_port = 4202;
int receive_port = 4203;
udp_bridge::UDPROSNode n(host,send_port,receive_port);
n.addSender<geographic_msgs::GeoPointStamped,udp_bridge::position>("/udp/position");
n.addSender<geographic_msgs::GeoPoint,udp_bridge::origin>("/udp/origin");
n.addSender<marine_msgs::Heartbeat,udp_bridge::heartbeat>("/udp/heartbeat");
n.addSender<marine_msgs::NavEulerStamped, udp_bridge::heading>("/udp/heading");
n.addSender<marine_msgs::Contact, udp_bridge::contact>("/udp/contact");
n.addSender<marine_msgs::NavEulerStamped,udp_bridge::posmv_orientation>("/udp/posmv/orientation");
n.addSender<sensor_msgs::NavSatFix,udp_bridge::posmv_position>("/udp/posmv/position");
n.addSender<geometry_msgs::TwistStamped,udp_bridge::sog>("/udp/sog");
n.addSender<marine_msgs::RadarSectorStamped,udp_bridge::radar>("/udp/radar");
n.addSender<geographic_visualization_msgs::GeoVizItem, udp_bridge::display>("/udp/project11/display");
n.spin();
return 0;
}
| 38.62
| 106
| 0.751942
|
Marcos-Seafloor
|
67db81ac7e5c1edd2ac06147f6fe9869087531fd
| 2,656
|
cpp
|
C++
|
lib/SILOptimizer/PassManager/SILOptimizerRequests.cpp
|
tkachukandrew/swift
|
49ca2d077804e03fa19029b3add128b7a4692806
|
[
"Apache-2.0"
] | 4
|
2019-04-22T18:02:44.000Z
|
2021-09-10T10:25:14.000Z
|
lib/SILOptimizer/PassManager/SILOptimizerRequests.cpp
|
brandonasuncion/swift
|
236237fc9ec4e607d29c89e9bc287142a16c2e19
|
[
"Apache-2.0"
] | 1
|
2020-09-19T16:23:45.000Z
|
2020-09-19T16:23:45.000Z
|
lib/SILOptimizer/PassManager/SILOptimizerRequests.cpp
|
brandonasuncion/swift
|
236237fc9ec4e607d29c89e9bc287142a16c2e19
|
[
"Apache-2.0"
] | 1
|
2017-11-01T15:48:30.000Z
|
2017-11-01T15:48:30.000Z
|
//===--- SILOptimizerRequests.cpp - Requests for SIL Optimization --------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "swift/AST/SILOptimizerRequests.h"
#include "swift/AST/Evaluator.h"
#include "swift/SILOptimizer/PassManager/PassPipeline.h"
#include "swift/Subsystems.h"
#include "llvm/ADT/Hashing.h"
using namespace swift;
namespace swift {
// Implement the SILOptimizer type zone (zone 13).
#define SWIFT_TYPEID_ZONE SILOptimizer
#define SWIFT_TYPEID_HEADER "swift/AST/SILOptimizerTypeIDZone.def"
#include "swift/Basic/ImplementTypeIDZone.h"
#undef SWIFT_TYPEID_ZONE
#undef SWIFT_TYPEID_HEADER
} // end namespace swift
//----------------------------------------------------------------------------//
// ExecuteSILPipelineRequest computation.
//----------------------------------------------------------------------------//
bool SILPipelineExecutionDescriptor::
operator==(const SILPipelineExecutionDescriptor &other) const {
return SM == other.SM && Plan == other.Plan &&
IsMandatory == other.IsMandatory && IRMod == other.IRMod;
}
llvm::hash_code swift::hash_value(const SILPipelineExecutionDescriptor &desc) {
return llvm::hash_combine(desc.SM, desc.Plan, desc.IsMandatory, desc.IRMod);
}
void swift::simple_display(llvm::raw_ostream &out,
const SILPipelineExecutionDescriptor &desc) {
out << "Run pipelines { ";
interleave(
desc.Plan.getPipelines(),
[&](SILPassPipeline stage) { out << stage.Name; },
[&]() { out << ", "; });
out << " } on ";
simple_display(out, desc.SM);
}
SourceLoc
swift::extractNearestSourceLoc(const SILPipelineExecutionDescriptor &desc) {
return extractNearestSourceLoc(desc.SM);
}
// Define request evaluation functions for each of the SILGen requests.
static AbstractRequestFunction *silOptimizerRequestFunctions[] = {
#define SWIFT_REQUEST(Zone, Name, Sig, Caching, LocOptions) \
reinterpret_cast<AbstractRequestFunction *>(&Name::evaluateRequest),
#include "swift/AST/SILOptimizerTypeIDZone.def"
#undef SWIFT_REQUEST
};
void swift::registerSILOptimizerRequestFunctions(Evaluator &evaluator) {
evaluator.registerRequestFunctions(Zone::SILOptimizer,
silOptimizerRequestFunctions);
}
| 36.888889
| 80
| 0.66491
|
tkachukandrew
|
67e06dbdf2ead3e05670324dddb86b977dc0c06a
| 1,137
|
cpp
|
C++
|
tests/util/test_math.cpp
|
GLorieul/FluidBoxPublic
|
a026e16cf5c6efc606832a9f5bdac3738e0062e3
|
[
"MIT"
] | null | null | null |
tests/util/test_math.cpp
|
GLorieul/FluidBoxPublic
|
a026e16cf5c6efc606832a9f5bdac3738e0062e3
|
[
"MIT"
] | null | null | null |
tests/util/test_math.cpp
|
GLorieul/FluidBoxPublic
|
a026e16cf5c6efc606832a9f5bdac3738e0062e3
|
[
"MIT"
] | null | null | null |
#include <gtest/gtest.h>
#include "util/math.hpp"
using namespace fb;
TEST(util_misc, abs)
{
ASSERT_EQ(fb::abs(+2) , 2);
ASSERT_EQ(fb::abs(-2) , 2);
ASSERT_FLOAT_EQ(fb::abs(+2.0), 2.0);
ASSERT_FLOAT_EQ(fb::abs(-2.0), 2.0);
}
TEST(util_misc, min)
{
ASSERT_EQ(fb::min(2,3) , 2);
ASSERT_EQ(fb::min(2,-3) , -3);
ASSERT_FLOAT_EQ(fb::min(2.0,3.0), 2.0);
ASSERT_FLOAT_EQ(fb::min(2.0,-3.0), -3.0);
}
TEST(util_misc, max)
{
ASSERT_EQ(fb::max(2,3), 3);
ASSERT_EQ(fb::max(2,-3), 2);
ASSERT_FLOAT_EQ(fb::max(2.0,3.0), 3.0);
ASSERT_FLOAT_EQ(fb::max(2.0,-3.0), 2.0);
}
TEST(util_misc, intPow)
{
ASSERT_DOUBLE_EQ(fb::intPow<3>(2.0), 8.0);
ASSERT_DOUBLE_EQ(fb::intPow<1>(2.0), 2.0);
ASSERT_DOUBLE_EQ(fb::intPow<0>(2.0), 1.0);
}
TEST(util_misc, areFloatsEqual)
{
ASSERT_TRUE ( areFloatsEqual(2.0, 2.0) );
ASSERT_FALSE( areFloatsEqual(2.0,-2.0) );
ASSERT_TRUE ( areFloatsEqual(2.0, 2.0 + 1e-16));
ASSERT_FALSE( areFloatsEqual(0.0, 2.0) );
ASSERT_TRUE ( areFloatsEqual(0.0, 0.0) );
ASSERT_FALSE( areFloatsEqual(0.0, 1e100) );
}
| 24.191489
| 52
| 0.588391
|
GLorieul
|
67e39239ba659f9b822b6aa0e14ca51d121b9eae
| 909
|
cpp
|
C++
|
qt/backup2/label_history_dlg.cpp
|
darkstar62/tribble-backup
|
4a50a641684b25a6ff9c2850cad2ede0fa487a00
|
[
"BSD-3-Clause"
] | null | null | null |
qt/backup2/label_history_dlg.cpp
|
darkstar62/tribble-backup
|
4a50a641684b25a6ff9c2850cad2ede0fa487a00
|
[
"BSD-3-Clause"
] | null | null | null |
qt/backup2/label_history_dlg.cpp
|
darkstar62/tribble-backup
|
4a50a641684b25a6ff9c2850cad2ede0fa487a00
|
[
"BSD-3-Clause"
] | null | null | null |
// Copyright (C) 2013 Cory Maccarrone
// Author: Cory Maccarrone <darkstar6262@gmail.com>
#include "qt/backup2/label_history_dlg.h"
#include <QVector>
#include <QTreeWidgetItem>
#include <sstream>
#include "ui_label_history_dlg.h" // NOLINT
using std::ostringstream;
LabelHistoryDlg::LabelHistoryDlg(
QVector<BackupItem> history, QWidget* parent)
: QDialog(parent),
ui_(new Ui::LabelHistoryDlg),
history_(history) {
ui_->setupUi(this);
for (BackupItem item : history_) {
QStringList view_strings;
QString size = QLocale().toString((qulonglong)item.size);
view_strings.append(item.date.toString());
view_strings.append(item.type);
view_strings.append(size);
view_strings.append(item.label);
view_strings.append(item.description);
new QTreeWidgetItem(ui_->label_history, view_strings);
}
}
LabelHistoryDlg::~LabelHistoryDlg() {
delete ui_;
}
| 24.567568
| 61
| 0.723872
|
darkstar62
|
67e41d9bcbedab69ffa23148657f92ac146b644a
| 1,936
|
hpp
|
C++
|
include/Fabrics/AssetsFabric.hpp
|
Megaxela/HGEngineReloadedEditor
|
be79b6089985da1bf811be8a6d06ce25f71236b1
|
[
"MIT"
] | null | null | null |
include/Fabrics/AssetsFabric.hpp
|
Megaxela/HGEngineReloadedEditor
|
be79b6089985da1bf811be8a6d06ce25f71236b1
|
[
"MIT"
] | null | null | null |
include/Fabrics/AssetsFabric.hpp
|
Megaxela/HGEngineReloadedEditor
|
be79b6089985da1bf811be8a6d06ce25f71236b1
|
[
"MIT"
] | 1
|
2020-03-12T04:39:14.000Z
|
2020-03-12T04:39:14.000Z
|
#pragma once
// C++ STL
#include <unordered_set>
#include <memory>
#include <filesystem>
#include <functional>
#include <map>
#include <set>
namespace HG::Editor::AssetSystem::Assets
{
class AbstractAsset;
}
namespace HG::Editor::Fabrics
{
/**
* @brief Class that describes fabric for
* project assets.
*/
class AssetsFabric
{
public:
using AssetPtr = std::shared_ptr<HG::Editor::AssetSystem::Assets::AbstractAsset>;
/**
* @brief Constructor.
*/
AssetsFabric();
/**
* @brief Method for creating asset from path to asset.
* If path points to directory - `Assets::DirectoryAsset` will be created.
* If asset type can't be detected - `Assets::OtherAsset` will be
* created. If there is some error - `nullptr` will be returned.
* @param path Path to asset.
* @return Shared pointer to asset.
*/
AssetPtr create(std::filesystem::path path);
/**
* @brief Method, that performs registration of some
* asset into this fabric.
* @tparam Asset Asset type.
* @param extensions Extension for identifying asset.
*/
template<typename AssetType>
void registrate (std::set<std::string> extensions)
{
m_data.emplace(extensions, [](std::filesystem::path path) -> AssetPtr
{
return std::make_shared<AssetType>(std::move(path));
});
}
/**
* @brief Method, that performs clearing of
* fabric data.
*/
void clear();
/**
* @brief Method, that performs registration of
* default assets.
*/
void registrateDefault();
private:
std::map<
std::set<std::string>,
std::function<AssetPtr(std::filesystem::path)>
> m_data;
};
}
| 24.2
| 89
| 0.558368
|
Megaxela
|
67e4378ba4e0e0d1447fc58cb035f0ff859e5326
| 1,484
|
cpp
|
C++
|
src/transport/SecureSession.cpp
|
joonhaengHeo/connectedhomeip
|
c24c34b0f94569ba31ffcda5ab76c98160136606
|
[
"Apache-2.0"
] | 1
|
2022-02-22T02:02:10.000Z
|
2022-02-22T02:02:10.000Z
|
src/transport/SecureSession.cpp
|
joonhaengHeo/connectedhomeip
|
c24c34b0f94569ba31ffcda5ab76c98160136606
|
[
"Apache-2.0"
] | null | null | null |
src/transport/SecureSession.cpp
|
joonhaengHeo/connectedhomeip
|
c24c34b0f94569ba31ffcda5ab76c98160136606
|
[
"Apache-2.0"
] | null | null | null |
/*
* Copyright (c) 2021 Project CHIP Authors
*
* 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.
*/
#include <access/AuthMode.h>
#include <transport/SecureSession.h>
namespace chip {
namespace Transport {
Access::SubjectDescriptor SecureSession::GetSubjectDescriptor() const
{
Access::SubjectDescriptor subjectDescriptor;
if (IsOperationalNodeId(mPeerNodeId))
{
subjectDescriptor.authMode = Access::AuthMode::kCase;
subjectDescriptor.subject = mPeerNodeId;
subjectDescriptor.cats = mPeerCATs;
subjectDescriptor.fabricIndex = mFabric;
}
else if (IsPAKEKeyId(mPeerNodeId))
{
subjectDescriptor.authMode = Access::AuthMode::kPase;
subjectDescriptor.subject = mPeerNodeId;
subjectDescriptor.fabricIndex = mFabric;
}
else
{
VerifyOrDie(false);
}
return subjectDescriptor;
}
} // namespace Transport
} // namespace chip
| 30.916667
| 78
| 0.690027
|
joonhaengHeo
|
67e823cb6827db604ed6e67aacf1be94d351b20f
| 2,342
|
cpp
|
C++
|
src/node/minisketchwrapper.cpp
|
apokalyzr/bitcoin
|
5b4b8f76f3ae11064d4aa3ac157558e364751fd2
|
[
"MIT"
] | 9
|
2022-02-20T11:12:21.000Z
|
2022-02-23T21:24:03.000Z
|
src/node/minisketchwrapper.cpp
|
apokalyzr/bitcoin
|
5b4b8f76f3ae11064d4aa3ac157558e364751fd2
|
[
"MIT"
] | 12
|
2021-12-14T01:00:25.000Z
|
2022-03-24T01:49:23.000Z
|
src/node/minisketchwrapper.cpp
|
apokalyzr/bitcoin
|
5b4b8f76f3ae11064d4aa3ac157558e364751fd2
|
[
"MIT"
] | 15
|
2022-02-10T00:08:33.000Z
|
2022-03-24T00:01:30.000Z
|
// Copyright (c) 2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <node/minisketchwrapper.h>
#include <logging.h>
#include <util/time.h>
#include <minisketch.h>
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <utility>
#include <vector>
namespace node {
namespace {
static constexpr uint32_t BITS = 32;
uint32_t FindBestImplementation()
{
std::optional<std::pair<int64_t, uint32_t>> best;
uint32_t max_impl = Minisketch::MaxImplementation();
for (uint32_t impl = 0; impl <= max_impl; ++impl) {
std::vector<int64_t> benches;
uint64_t offset = 0;
/* Run a little benchmark with capacity 32, adding 184 entries, and decoding 11 of them once. */
for (int b = 0; b < 11; ++b) {
if (!Minisketch::ImplementationSupported(BITS, impl)) break;
Minisketch sketch(BITS, impl, 32);
auto start = GetTimeMicros();
for (uint64_t e = 0; e < 100; ++e) {
sketch.Add(e*1337 + b*13337 + offset);
}
for (uint64_t e = 0; e < 84; ++e) {
sketch.Add(e*1337 + b*13337 + offset);
}
offset += (*sketch.Decode(32))[0];
auto stop = GetTimeMicros();
benches.push_back(stop - start);
}
/* Remember which implementation has the best median benchmark time. */
if (!benches.empty()) {
std::sort(benches.begin(), benches.end());
if (!best || best->first > benches[5]) {
best = std::make_pair(benches[5], impl);
}
}
}
assert(best.has_value());
LogPrintf("Using Minisketch implementation number %i\n", best->second);
return best->second;
}
uint32_t Minisketch32Implementation()
{
// Fast compute-once idiom.
static uint32_t best = FindBestImplementation();
return best;
}
} // namespace
Minisketch MakeMinisketch32(size_t capacity)
{
return Minisketch(BITS, Minisketch32Implementation(), capacity);
}
Minisketch MakeMinisketch32FP(size_t max_elements, uint32_t fpbits)
{
return Minisketch::CreateFP(BITS, Minisketch32Implementation(), max_elements, fpbits);
}
} // namespace node
| 29.275
| 104
| 0.627242
|
apokalyzr
|
67f151fc1082b8fadacb5858b6a89ea7e7b43840
| 923
|
hpp
|
C++
|
vmm/kvm/kvm.hpp
|
bl0nd/libvmm
|
e52605fda07a28fe507bf6274b0c9148f570d4a1
|
[
"MIT"
] | 1
|
2021-09-15T21:47:40.000Z
|
2021-09-15T21:47:40.000Z
|
vmm/kvm/kvm.hpp
|
ibokuri/libvmm
|
e52605fda07a28fe507bf6274b0c9148f570d4a1
|
[
"MIT"
] | null | null | null |
vmm/kvm/kvm.hpp
|
ibokuri/libvmm
|
e52605fda07a28fe507bf6274b0c9148f570d4a1
|
[
"MIT"
] | null | null | null |
//
// kvm.hpp - Public KVM header
//
#pragma once
#include <cstddef> // size_t
#include "vmm/kvm/detail/ioctls/system.hpp"
#include "vmm/kvm/detail/ioctls/vm.hpp"
#include "vmm/kvm/detail/ioctls/vcpu.hpp"
#include "vmm/kvm/detail/ioctls/device.hpp"
#include "vmm/kvm/detail/types/fam_struct.hpp"
namespace vmm::kvm {
using System = vmm::kvm::detail::System;
using Vm = vmm::kvm::detail::Vm;
using Vcpu = vmm::kvm::detail::Vcpu;
using Device = vmm::kvm::detail::Device;
using VcpuExit = vmm::kvm::detail::VcpuExit;
using IrqLevel = vmm::kvm::detail::IrqLevel;
template<std::size_t N> using IrqRouting = vmm::kvm::detail::IrqRouting<N>;
#if defined(__i386__) || defined(__x86_64__)
template<std::size_t N> using MsrList = vmm::kvm::detail::MsrList<N>;
template<std::size_t N> using Msrs = vmm::kvm::detail::Msrs<N>;
template<std::size_t N> using Cpuids = vmm::kvm::detail::Cpuids<N>;
#endif
} // namespace vmm::kvm
| 27.147059
| 75
| 0.709642
|
bl0nd
|
67f67f72c9daf92e3f29798df7a3296e3e786c3d
| 9,626
|
cpp
|
C++
|
system/worker_thread_pbft.cpp
|
p-shubham/resilientdb
|
8e69c28e73ddebdfca8359479be4499c1cb5de41
|
[
"MIT"
] | 1
|
2022-03-04T20:34:29.000Z
|
2022-03-04T20:34:29.000Z
|
system/worker_thread_pbft.cpp
|
p-shubham/resilientdb
|
8e69c28e73ddebdfca8359479be4499c1cb5de41
|
[
"MIT"
] | null | null | null |
system/worker_thread_pbft.cpp
|
p-shubham/resilientdb
|
8e69c28e73ddebdfca8359479be4499c1cb5de41
|
[
"MIT"
] | 1
|
2020-02-12T01:20:26.000Z
|
2020-02-12T01:20:26.000Z
|
#include "global.h"
#include "message.h"
#include "thread.h"
#include "worker_thread.h"
#include "txn.h"
#include "wl.h"
#include "query.h"
#include "ycsb_query.h"
#include "math.h"
#include "helper.h"
#include "msg_thread.h"
#include "msg_queue.h"
#include "work_queue.h"
#include "message.h"
#include "timer.h"
#include "chain.h"
/**
* Processes an incoming client batch and sends a Pre-prepare message to al replicas.
*
* This function assumes that a client sends a batch of transactions and
* for each transaction in the batch, a separate transaction manager is created.
* Next, this batch is forwarded to all the replicas as a BatchRequests Message,
* which corresponds to the Pre-Prepare stage in the PBFT protocol.
*
* @param msg Batch of Transactions of type CientQueryBatch from the client.
* @return RC
*/
RC WorkerThread::process_client_batch(Message *msg)
{
//printf("ClientQueryBatch: %ld, THD: %ld :: CL: %ld :: RQ: %ld\n",msg->txn_id, get_thd_id(), msg->return_node_id, clbtch->cqrySet[0]->requests[0]->key);
//fflush(stdout);
ClientQueryBatch *clbtch = (ClientQueryBatch *)msg;
// Authenticate the client signature.
validate_msg(clbtch);
#if VIEW_CHANGES
// If message forwarded to the non-primary.
if (g_node_id != get_current_view(get_thd_id()))
{
client_query_check(clbtch);
return RCOK;
}
// Partial failure of Primary 0.
fail_primary(msg, 9);
#endif
// Initialize all transaction mangers and Send BatchRequests message.
create_and_send_batchreq(clbtch, clbtch->txn_id);
return RCOK;
}
/**
* Process incoming BatchRequests message from the Primary.
*
* This function is used by the non-primary or backup replicas to process an incoming
* BatchRequests message sent by the primary replica. This processing would require
* sending messages of type PBFTPrepMessage, which correspond to the Prepare phase of
* the PBFT protocol. Due to network delays, it is possible that a repica may have
* received some messages of type PBFTPrepMessage and PBFTCommitMessage, prior to
* receiving this BatchRequests message.
*
* @param msg Batch of Transactions of type BatchRequests from the primary.
* @return RC
*/
RC WorkerThread::process_batch(Message *msg)
{
uint64_t cntime = get_sys_clock();
BatchRequests *breq = (BatchRequests *)msg;
//printf("BatchRequests: TID:%ld : VIEW: %ld : THD: %ld\n",breq->txn_id, breq->view, get_thd_id());
//fflush(stdout);
// Assert that only a non-primary replica has received this message.
assert(g_node_id != get_current_view(get_thd_id()));
// Check if the message is valid.
validate_msg(breq);
#if VIEW_CHANGES
// Store the batch as it could be needed during view changes.
store_batch_msg(breq);
#endif
// Allocate transaction managers for all the transactions in the batch.
set_txn_man_fields(breq, 0);
#if TIMER_ON
// The timer for this client batch stores the hash of last request.
add_timer(breq, txn_man->get_hash());
#endif
// Storing the BatchRequests message.
txn_man->set_primarybatch(breq);
// Send Prepare messages.
txn_man->send_pbft_prep_msgs();
// End the counter for pre-prepare phase as prepare phase starts next.
double timepre = get_sys_clock() - cntime;
INC_STATS(get_thd_id(), time_pre_prepare, timepre);
// Only when BatchRequests message comes after some Prepare message.
for (uint64_t i = 0; i < txn_man->info_prepare.size(); i++)
{
// Decrement.
uint64_t num_prep = txn_man->decr_prep_rsp_cnt();
if (num_prep == 0)
{
txn_man->set_prepared();
break;
}
}
// If enough Prepare messages have already arrived.
if (txn_man->is_prepared())
{
// Send Commit messages.
txn_man->send_pbft_commit_msgs();
double timeprep = get_sys_clock() - txn_man->txn_stats.time_start_prepare - timepre;
INC_STATS(get_thd_id(), time_prepare, timeprep);
double timediff = get_sys_clock() - cntime;
// Check if any Commit messages arrived before this BatchRequests message.
for (uint64_t i = 0; i < txn_man->info_commit.size(); i++)
{
uint64_t num_comm = txn_man->decr_commit_rsp_cnt();
if (num_comm == 0)
{
txn_man->set_committed();
break;
}
}
// If enough Commit messages have already arrived.
if (txn_man->is_committed())
{
#if TIMER_ON
// End the timer for this client batch.
server_timer->endTimer(txn_man->hash);
#endif
// Proceed to executing this batch of transactions.
send_execute_msg();
// End the commit counter.
INC_STATS(get_thd_id(), time_commit, get_sys_clock() - txn_man->txn_stats.time_start_commit - timediff);
}
}
else
{
// Although batch has not prepared, still some commit messages could have arrived.
for (uint64_t i = 0; i < txn_man->info_commit.size(); i++)
{
txn_man->decr_commit_rsp_cnt();
}
}
// Release this txn_man for other threads to use.
bool ready = txn_man->set_ready();
assert(ready);
// UnSetting the ready for the txn id representing this batch.
txn_man = get_transaction_manager(msg->txn_id, 0);
while (true)
{
bool ready = txn_man->unset_ready();
if (!ready)
{
continue;
}
else
{
break;
}
}
return RCOK;
}
/**
* Processes incoming Prepare message.
*
* This functions precessing incoming messages of type PBFTPrepMessage. If a replica
* received 2f identical Prepare messages from distinct replicas, then it creates
* and sends a PBFTCommitMessage to all the other replicas.
*
* @param msg Prepare message of type PBFTPrepMessage from a replica.
* @return RC
*/
RC WorkerThread::process_pbft_prep_msg(Message *msg)
{
//cout << "PBFTPrepMessage: TID: " << msg->txn_id << " FROM: " << msg->return_node_id << endl;
//fflush(stdout);
// Start the counter for prepare phase.
if (txn_man->prep_rsp_cnt == 2 * g_min_invalid_nodes)
{
txn_man->txn_stats.time_start_prepare = get_sys_clock();
}
// Check if the incoming message is valid.
PBFTPrepMessage *pmsg = (PBFTPrepMessage *)msg;
validate_msg(pmsg);
// Check if sufficient number of Prepare messages have arrived.
if (prepared(pmsg))
{
// Send Commit messages.
txn_man->send_pbft_commit_msgs();
// End the prepare counter.
INC_STATS(get_thd_id(), time_prepare, get_sys_clock() - txn_man->txn_stats.time_start_prepare);
}
return RCOK;
}
/**
* Checks if the incoming PBFTCommitMessage can be accepted.
*
* This functions checks if the hash and view of the commit message matches that of
* the Pre-Prepare message. Once 2f+1 messages are received it returns a true and
* sets the `is_committed` flag for furtue identification.
*
* @param msg PBFTCommitMessage.
* @return bool True if the transactions of this batch can be executed.
*/
bool WorkerThread::committed_local(PBFTCommitMessage *msg)
{
//cout << "Check Commit: TID: " << txn_man->get_txn_id() << "\n";
//fflush(stdout);
// Once committed is set for this transaction, no further processing.
if (txn_man->is_committed())
{
return false;
}
// If BatchRequests messages has not arrived, then hash is empty; return false.
if (txn_man->get_hash().empty())
{
//cout << "hash empty: " << txn_man->get_txn_id() << "\n";
//fflush(stdout);
txn_man->info_commit.push_back(msg->return_node);
return false;
}
else
{
if (!checkMsg(msg))
{
// If message did not match.
//cout << txn_man->get_hash() << " :: " << msg->hash << "\n";
//cout << get_current_view(get_thd_id()) << " :: " << msg->view << "\n";
//fflush(stdout);
return false;
}
}
uint64_t comm_cnt = txn_man->decr_commit_rsp_cnt();
if (comm_cnt == 0 && txn_man->is_prepared())
{
txn_man->set_committed();
return true;
}
return false;
}
/**
* Processes incoming Commit message.
*
* This functions precessing incoming messages of type PBFTCommitMessage. If a replica
* received 2f+1 identical Commit messages from distinct replicas, then it asks the
* execute-thread to execute all the transactions in this batch.
*
* @param msg Commit message of type PBFTCommitMessage from a replica.
* @return RC
*/
RC WorkerThread::process_pbft_commit_msg(Message *msg)
{
//cout << "PBFTCommitMessage: TID " << msg->txn_id << " FROM: " << msg->return_node_id << "\n";
//fflush(stdout);
if (txn_man->commit_rsp_cnt == 2 * g_min_invalid_nodes + 1)
{
txn_man->txn_stats.time_start_commit = get_sys_clock();
}
// Check if message is valid.
PBFTCommitMessage *pcmsg = (PBFTCommitMessage *)msg;
validate_msg(pcmsg);
txn_man->add_commit_msg(pcmsg);
// Check if sufficient number of Commit messages have arrived.
if (committed_local(pcmsg))
{
#if TIMER_ON
// End the timer for this client batch.
server_timer->endTimer(txn_man->hash);
#endif
// Add this message to execute thread's queue.
send_execute_msg();
INC_STATS(get_thd_id(), time_commit, get_sys_clock() - txn_man->txn_stats.time_start_commit);
}
return RCOK;
}
| 30.365931
| 157
| 0.652088
|
p-shubham
|
67f83c73f210663b2aaeda92479d04c351489aec
| 604
|
cpp
|
C++
|
Downloads/CommonQuestions.cpp
|
alvim452/curso-C-plus-plus
|
ea9b996471d5ea9375b483698d62da7f3574f125
|
[
"MIT"
] | null | null | null |
Downloads/CommonQuestions.cpp
|
alvim452/curso-C-plus-plus
|
ea9b996471d5ea9375b483698d62da7f3574f125
|
[
"MIT"
] | null | null | null |
Downloads/CommonQuestions.cpp
|
alvim452/curso-C-plus-plus
|
ea9b996471d5ea9375b483698d62da7f3574f125
|
[
"MIT"
] | null | null | null |
#include <iostream>
using namespace std;
//COMMON QUESTIONS.
/* PVS-STUDIO. static code analyser. promo code #code_beauty*/
int main()
{
int savedMoney[5] = {100, 200, 300, 400, 500};
int total = 0;
//for(int i=0; i<= 5; i++){ erro comun index 0 to 4 or <=4 not 5.
for(int i=0; i< 5; i++){ //corrrigido
for(int i=0; i< 5; i--){ // erro comum; infinit loop, ou loop infinito porque neste loop regressivo, a condição i<5 é sempre verdadeira; deveria ser for(int i=5; i=0; i--)
total += savedMoney[i];
cout << "Total: " << total << endl;
}
system("pause>0");
return 0;
}
| 26.26087
| 177
| 0.609272
|
alvim452
|
67fb4f4a6f9de9c737029b7830976eaf7734e763
| 32,621
|
hpp
|
C++
|
arbor/include/arbor/simd/avx.hpp
|
akuesters/arbor
|
c2a2216db0b21860e66b8b2a4e09f2edc601cad1
|
[
"BSD-3-Clause"
] | null | null | null |
arbor/include/arbor/simd/avx.hpp
|
akuesters/arbor
|
c2a2216db0b21860e66b8b2a4e09f2edc601cad1
|
[
"BSD-3-Clause"
] | null | null | null |
arbor/include/arbor/simd/avx.hpp
|
akuesters/arbor
|
c2a2216db0b21860e66b8b2a4e09f2edc601cad1
|
[
"BSD-3-Clause"
] | null | null | null |
#pragma once
// AVX/AVX2 SIMD intrinsics implementation.
#ifdef __AVX__
#include <cmath>
#include <cstdint>
#include <immintrin.h>
#include <arbor/simd/approx.hpp>
#include <arbor/simd/implbase.hpp>
namespace arb {
namespace simd {
namespace detail {
struct avx_int4;
struct avx_double4;
static constexpr unsigned avx_min_align = 16;
template <>
struct simd_traits<avx_int4> {
static constexpr unsigned width = 4;
static constexpr unsigned min_align = avx_min_align;
using scalar_type = std::int32_t;
using vector_type = __m128i;
using mask_impl = avx_int4;
};
template <>
struct simd_traits<avx_double4> {
static constexpr unsigned width = 4;
static constexpr unsigned min_align = avx_min_align;
using scalar_type = double;
using vector_type = __m256d;
using mask_impl = avx_double4;
};
struct avx_int4: implbase<avx_int4> {
// Use default implementations for: element, set_element, div.
using implbase<avx_int4>::cast_from;
using int32 = std::int32_t;
static __m128i broadcast(int32 v) {
return _mm_set1_epi32(v);
}
static void copy_to(const __m128i& v, int32* p) {
_mm_storeu_si128((__m128i*)p, v);
}
static void copy_to_masked(const __m128i& v, int32* p, const __m128i& mask) {
_mm_maskstore_ps(reinterpret_cast<float*>(p), mask, _mm_castsi128_ps(v));
}
static __m128i copy_from(const int32* p) {
return _mm_loadu_si128((const __m128i*)p);
}
static __m128i copy_from_masked(const int32* p, const __m128i& mask) {
return _mm_castps_si128(_mm_maskload_ps(reinterpret_cast<const float*>(p), mask));
}
static __m128i copy_from_masked(const __m128i& v, const int32* p, const __m128i& mask) {
__m128 d = _mm_maskload_ps(reinterpret_cast<const float*>(p), mask);
return ifelse(mask, _mm_castps_si128(d), v);
}
static __m128i cast_from(tag<avx_double4>, const __m256d& v) {
return _mm256_cvttpd_epi32(v);
}
static int element0(const __m128i& a) {
return _mm_cvtsi128_si32(a);
}
static __m128i neg(const __m128i& a) {
__m128i zero = _mm_setzero_si128();
return _mm_sub_epi32(zero, a);
}
static __m128i add(const __m128i& a, const __m128i& b) {
return _mm_add_epi32(a, b);
}
static __m128i sub(const __m128i& a, const __m128i& b) {
return _mm_sub_epi32(a, b);
}
static __m128i mul(const __m128i& a, const __m128i& b) {
return _mm_mullo_epi32(a, b);
}
static __m128i fma(const __m128i& a, const __m128i& b, const __m128i& c) {
return _mm_add_epi32(_mm_mullo_epi32(a, b), c);
}
static __m128i logical_not(const __m128i& a) {
__m128i ones = {};
return _mm_xor_si128(a, _mm_cmpeq_epi32(ones, ones));
}
static __m128i logical_and(const __m128i& a, const __m128i& b) {
return _mm_and_si128(a, b);
}
static __m128i logical_or(const __m128i& a, const __m128i& b) {
return _mm_or_si128(a, b);
}
static __m128i cmp_eq(const __m128i& a, const __m128i& b) {
return _mm_cmpeq_epi32(a, b);
}
static __m128i cmp_neq(const __m128i& a, const __m128i& b) {
return logical_not(cmp_eq(a, b));
}
static __m128i cmp_gt(const __m128i& a, const __m128i& b) {
return _mm_cmpgt_epi32(a, b);
}
static __m128i cmp_geq(const __m128i& a, const __m128i& b) {
return logical_not(cmp_gt(b, a));
}
static __m128i cmp_lt(const __m128i& a, const __m128i& b) {
return cmp_gt(b, a);
}
static __m128i cmp_leq(const __m128i& a, const __m128i& b) {
return logical_not(cmp_gt(a, b));
}
static __m128i ifelse(const __m128i& m, const __m128i& u, const __m128i& v) {
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(v), _mm_castsi128_ps(u), _mm_castsi128_ps(m)));
}
static __m128i mask_broadcast(bool b) {
return _mm_set1_epi32(-(int32)b);
}
static __m128i mask_unpack(unsigned long long k) {
// Only care about bottom four bits of k.
__m128i b = _mm_set1_epi8((char)k);
b = logical_or(b, _mm_setr_epi32(0xfefefefe,0xfdfdfdfd,0xfbfbfbfb,0xf7f7f7f7));
__m128i ones = {};
ones = _mm_cmpeq_epi32(ones, ones);
return _mm_cmpeq_epi32(b, ones);
}
static bool mask_element(const __m128i& u, int i) {
return static_cast<bool>(element(u, i));
}
static void mask_set_element(__m128i& u, int i, bool b) {
set_element(u, i, -(int32)b);
}
static void mask_copy_to(const __m128i& m, bool* y) {
// Negate (convert 0xffffffff to 0x00000001) and move low bytes to
// bottom 4 bytes.
__m128i s = _mm_setr_epi32(0x0c080400ul,0,0,0);
__m128i p = _mm_shuffle_epi8(neg(m), s);
std::memcpy(y, &p, 4);
}
static __m128i mask_copy_from(const bool* w) {
__m128i r;
std::memcpy(&r, w, 4);
__m128i s = _mm_setr_epi32(0x80808000ul, 0x80808001ul, 0x80808002ul, 0x80808003ul);
return neg(_mm_shuffle_epi8(r, s));
}
static __m128i max(const __m128i& a, const __m128i& b) {
return _mm_max_epi32(a, b);
}
static __m128i min(const __m128i& a, const __m128i& b) {
return _mm_min_epi32(a, b);
}
static int reduce_add(const __m128i& a) {
// Add [a3|a2|a1|a0] to [a2|a3|a0|a1]
__m128i b = add(a, _mm_shuffle_epi32(a, 0xb1));
// Add [b3|b2|b1|b0] to [b1|b0|b3|b2]
__m128i c = add(b, _mm_shuffle_epi32(b, 0x4e));
return element0(c);
}
};
struct avx_double4: implbase<avx_double4> {
// Use default implementations for:
// element, set_element, fma.
using implbase<avx_double4>::cast_from;
using int64 = std::int64_t;
// CMPPD predicates:
static constexpr int cmp_eq_oq = 0;
static constexpr int cmp_unord_q = 3;
static constexpr int cmp_neq_uq = 4;
static constexpr int cmp_true_uq = 15;
static constexpr int cmp_lt_oq = 17;
static constexpr int cmp_le_oq = 18;
static constexpr int cmp_nge_uq = 25;
static constexpr int cmp_ge_oq = 29;
static constexpr int cmp_gt_oq = 30;
static __m256d broadcast(double v) {
return _mm256_set1_pd(v);
}
static void copy_to(const __m256d& v, double* p) {
_mm256_storeu_pd(p, v);
}
static void copy_to_masked(const __m256d& v, double* p, const __m256d& mask) {
_mm256_maskstore_pd(p, _mm256_castpd_si256(mask), v);
}
static __m256d copy_from(const double* p) {
return _mm256_loadu_pd(p);
}
static __m256d copy_from_masked(const double* p, const __m256d& mask) {
return _mm256_maskload_pd(p, _mm256_castpd_si256(mask));
}
static __m256d copy_from_masked(const __m256d& v, const double* p, const __m256d& mask) {
__m256d d = _mm256_maskload_pd(p, _mm256_castpd_si256(mask));
return ifelse(mask, d, v);
}
static __m256d cast_from(tag<avx_int4>, const __m128i& v) {
return _mm256_cvtepi32_pd(v);
}
static double element0(const __m256d& a) {
return _mm_cvtsd_f64(_mm256_castpd256_pd128(a));
}
static __m256d neg(const __m256d& a) {
return _mm256_sub_pd(zero(), a);
}
static __m256d add(const __m256d& a, const __m256d& b) {
return _mm256_add_pd(a, b);
}
static __m256d sub(const __m256d& a, const __m256d& b) {
return _mm256_sub_pd(a, b);
}
static __m256d mul(const __m256d& a, const __m256d& b) {
return _mm256_mul_pd(a, b);
}
static __m256d div(const __m256d& a, const __m256d& b) {
return _mm256_div_pd(a, b);
}
static __m256d logical_not(const __m256d& a) {
__m256d ones = {};
return _mm256_xor_pd(a, _mm256_cmp_pd(ones, ones, 15));
}
static __m256d logical_and(const __m256d& a, const __m256d& b) {
return _mm256_and_pd(a, b);
}
static __m256d logical_or(const __m256d& a, const __m256d& b) {
return _mm256_or_pd(a, b);
}
static __m256d cmp_eq(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_eq_oq);
}
static __m256d cmp_neq(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_neq_uq);
}
static __m256d cmp_gt(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_gt_oq);
}
static __m256d cmp_geq(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_ge_oq);
}
static __m256d cmp_lt(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_lt_oq);
}
static __m256d cmp_leq(const __m256d& a, const __m256d& b) {
return _mm256_cmp_pd(a, b, cmp_le_oq);
}
static __m256d ifelse(const __m256d& m, const __m256d& u, const __m256d& v) {
return _mm256_blendv_pd(v, u, m);
}
static __m256d mask_broadcast(bool b) {
return _mm256_castsi256_pd(_mm256_set1_epi64x(-(int64)b));
}
static bool mask_element(const __m256d& u, int i) {
return static_cast<bool>(element(u, i));
}
static __m256d mask_unpack(unsigned long long k) {
// Only care about bottom four bits of k.
__m128i b = _mm_set1_epi8((char)k);
// (Note: there is no _mm_setr_epi64x (!))
__m128i bl = _mm_or_si128(b, _mm_set_epi64x(0xfdfdfdfdfdfdfdfd, 0xfefefefefefefefe));
__m128i bu = _mm_or_si128(b, _mm_set_epi64x(0xf7f7f7f7f7f7f7f7, 0xfbfbfbfbfbfbfbfb));
__m128i ones = {};
ones = _mm_cmpeq_epi32(ones, ones);
bl = _mm_cmpeq_epi64(bl, ones);
bu = _mm_cmpeq_epi64(bu, ones);
return _mm256_castsi256_pd(combine_m128i(bu, bl));
}
static void mask_set_element(__m256d& u, int i, bool b) {
char data[256];
_mm256_storeu_pd((double*)data, u);
((int64*)data)[i] = -(int64)b;
u = _mm256_loadu_pd((double*)data);
}
static void mask_copy_to(const __m256d& m, bool* y) {
// Convert to 32-bit wide mask values, and delegate to
// avx2_int4.
avx_int4::mask_copy_to(lo_epi32(_mm256_castpd_si256(m)), y);
}
static __m256d mask_copy_from(const bool* w) {
__m128i zero = _mm_setzero_si128();
__m128i r;
std::memcpy(&r, w, 4);
// Move bytes:
// rl: byte 0 to byte 0, byte 1 to byte 8, zero elsewhere.
// ru: byte 2 to byte 0, byte 3 to byte 8, zero elsewhere.
//
// Subtract from zero to translate
// 0x0000000000000001 to 0xffffffffffffffff.
__m128i sl = _mm_setr_epi32(0x80808000ul, 0x80808080ul, 0x80808001ul, 0x80808080ul);
__m128i rl = _mm_sub_epi64(zero, _mm_shuffle_epi8(r, sl));
__m128i su = _mm_setr_epi32(0x80808002ul, 0x80808080ul, 0x80808003ul, 0x80808080ul);
__m128i ru = _mm_sub_epi64(zero, _mm_shuffle_epi8(r, su));
return _mm256_castsi256_pd(combine_m128i(ru, rl));
}
static __m256d max(const __m256d& a, const __m256d& b) {
return _mm256_max_pd(a, b);
}
static __m256d min(const __m256d& a, const __m256d& b) {
return _mm256_min_pd(a, b);
}
static __m256d abs(const __m256d& x) {
__m256i m = _mm256_set1_epi64x(0x7fffffffffffffffll);
return _mm256_and_pd(x, _mm256_castsi256_pd(m));
}
static double reduce_add(const __m256d& a) {
// add [a3|a2|a1|a0] to [a1|a0|a3|a2]
__m256d b = add(a, _mm256_permute2f128_pd(a, a, 0x01));
// add [b3|b2|b1|b0] to [b2|b3|b0|b1]
__m256d c = add(b, _mm256_permute_pd(b, 0x05));
return element0(c);
}
// Exponential is calculated as follows:
//
// e^x = e^g · 2^n,
//
// where g in [-0.5, 0.5) and n is an integer. 2^n can be
// calculated via bit manipulation or specialized scaling intrinsics,
// whereas e^g is approximated using the order-6 rational
// approximation:
//
// e^g = R(g)/R(-g)
//
// with R(x) split into even and odd terms:
//
// R(x) = Q(x^2) + x·P(x^2)
//
// so that the ratio can be computed as:
//
// e^g = 1 + 2·g·P(g^2) / (Q(g^2)-g·P(g^2)).
//
// Note that the coefficients for R are close to but not the same as those
// from the 6,6 Padé approximant to the exponential.
//
// The exponents n and g are calculated by:
//
// n = floor(x/ln(2) + 0.5)
// g = x - n·ln(2)
//
// so that x = g + n·ln(2). We have:
//
// |g| = |x - n·ln(2)|
// = |x - x + α·ln(2)|
//
// for some fraction |α| ≤ 0.5, and thus |g| ≤ 0.5ln(2) ≈ 0.347.
//
// Tne subtraction x - n·ln(2) is performed in two parts, with
// ln(2) = C1 + C2, in order to compensate for the possible loss of precision
// attributable to catastrophic rounding. C1 comprises the first
// 32-bits of mantissa, C2 the remainder.
static __m256d exp(const __m256d& x) {
// Masks for exceptional cases.
auto is_large = cmp_gt(x, broadcast(exp_maxarg));
auto is_small = cmp_lt(x, broadcast(exp_minarg));
auto is_nan = _mm256_cmp_pd(x, x, cmp_unord_q);
// Compute n and g.
auto n = _mm256_floor_pd(add(mul(broadcast(ln2inv), x), broadcast(0.5)));
auto g = sub(x, mul(n, broadcast(ln2C1)));
g = sub(g, mul(n, broadcast(ln2C2)));
auto gg = mul(g, g);
// Compute the g*P(g^2) and Q(g^2).
auto odd = mul(g, horner(gg, P0exp, P1exp, P2exp));
auto even = horner(gg, Q0exp, Q1exp, Q2exp, Q3exp);
// Compute R(g)/R(-g) = 1 + 2*g*P(g^2) / (Q(g^2)-g*P(g^2))
auto expg = add(broadcast(1), mul(broadcast(2),
div(odd, sub(even, odd))));
// Finally, compute product with 2^n.
// Note: can only achieve full range using the ldexp implementation,
// rather than multiplying by 2^n directly.
auto result = ldexp_positive(expg, _mm256_cvtpd_epi32(n));
return
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(0),
ifelse(is_nan, broadcast(NAN),
result)));
}
// Use same rational polynomial expansion as for exp(x), without
// the unit term.
//
// For |x|<=0.5, take n to be zero. Otherwise, set n as above,
// and scale the answer by:
// expm1(x) = 2^n * expm1(g) + (2^n - 1).
static __m256d expm1(const __m256d& x) {
auto is_large = cmp_gt(x, broadcast(exp_maxarg));
auto is_small = cmp_lt(x, broadcast(expm1_minarg));
auto is_nan = _mm256_cmp_pd(x, x, cmp_unord_q);
auto half = broadcast(0.5);
auto one = broadcast(1.);
auto two = add(one, one);
auto nzero = cmp_leq(abs(x), half);
auto n = _mm256_floor_pd(add(mul(broadcast(ln2inv), x), half));
n = ifelse(nzero, zero(), n);
auto g = sub(x, mul(n, broadcast(ln2C1)));
g = sub(g, mul(n, broadcast(ln2C2)));
auto gg = mul(g, g);
auto odd = mul(g, horner(gg, P0exp, P1exp, P2exp));
auto even = horner(gg, Q0exp, Q1exp, Q2exp, Q3exp);
// Note: multiply by two, *then* divide: avoids a subnormal
// intermediate that will get truncated to zero with default
// icpc options.
auto expgm1 = div(mul(two, odd), sub(even, odd));
// For small x (n zero), bypass scaling step to avoid underflow.
// Otherwise, compute result 2^n * expgm1 + (2^n-1) by:
// result = 2 * ( 2^(n-1)*expgm1 + (2^(n-1)+0.5) )
// to avoid overflow when n=1024.
auto nm1 = _mm256_cvtpd_epi32(sub(n, one));
auto scaled = mul(add(sub(exp2int(nm1), half), ldexp_normal(expgm1, nm1)), two);
return
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(-1),
ifelse(is_nan, broadcast(NAN),
ifelse(nzero, expgm1,
scaled))));
}
// Natural logarithm:
//
// Decompose x = 2^g * u such that g is an integer and
// u is in the interval [sqrt(2)/2, sqrt(2)].
//
// Then ln(x) is computed as R(u-1) + g*ln(2) where
// R(z) is a rational polynomial approximating ln(z+1)
// for small z:
//
// R(z) = z - z^2/2 + z^3 * P(z)/Q(z)
//
// where P and Q are degree 5 polynomials, Q monic.
//
// In order to avoid cancellation error, ln(2) is represented
// as C3 + C4, with the C4 correction term approx. -2.1e-4.
// The summation order for R(z)+2^g is:
//
// z^3*P(z)/Q(z) + g*C4 - z^2/2 + z + g*C3
static __m256d log(const __m256d& x) {
// Masks for exceptional cases.
auto is_large = cmp_geq(x, broadcast(HUGE_VAL));
auto is_small = cmp_lt(x, broadcast(log_minarg));
auto is_domainerr = _mm256_cmp_pd(x, broadcast(0), cmp_nge_uq);
__m256d g = _mm256_cvtepi32_pd(logb_normal(x));
__m256d u = fraction_normal(x);
__m256d one = broadcast(1.);
__m256d half = broadcast(0.5);
auto gtsqrt2 = cmp_geq(u, broadcast(sqrt2));
g = ifelse(gtsqrt2, add(g, one), g);
u = ifelse(gtsqrt2, mul(u, half), u);
auto z = sub(u, one);
auto pz = horner(z, P0log, P1log, P2log, P3log, P4log, P5log);
auto qz = horner1(z, Q0log, Q1log, Q2log, Q3log, Q4log);
auto z2 = mul(z, z);
auto z3 = mul(z2, z);
auto r = div(mul(z3, pz), qz);
r = add(r, mul(g, broadcast(ln2C4)));
r = sub(r, mul(z2, half));
r = add(r, z);
r = add(r, mul(g, broadcast(ln2C3)));
// Return NaN if x is NaN or negarive, +inf if x is +inf,
// or -inf if zero or (positive) denormal.
return
ifelse(is_domainerr, broadcast(NAN),
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(-HUGE_VAL),
r)));
}
protected:
static __m256d zero() {
return _mm256_setzero_pd();
}
static __m128i hi_epi32(__m256i x) {
__m128i xl = _mm256_castsi256_si128(x);
__m128i xh = _mm256_extractf128_si256(x, 1);
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(xl), _mm_castsi128_ps(xh), 0xddu));
}
static __m128i lo_epi32(__m256i x) {
__m128i xl = _mm256_castsi256_si128(x);
__m128i xh = _mm256_extractf128_si256(x, 1);
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(xl), _mm_castsi128_ps(xh), 0x88u));
}
static __m256i combine_m128i(__m128i hi, __m128i lo) {
return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
}
// horner(x, a0, ..., an) computes the degree n polynomial A(x) with coefficients
// a0, ..., an by a0+x·(a1+x·(a2+...+x·an)...).
static inline __m256d horner(__m256d x, double a0) {
return broadcast(a0);
}
template <typename... T>
static __m256d horner(__m256d x, double a0, T... tail) {
return add(mul(x, horner(x, tail...)), broadcast(a0));
}
// horner1(x, a0, ..., an) computes the degree n+1 monic polynomial A(x) with coefficients
// a0, ..., an, 1 by by a0+x·(a1+x·(a2+...+x·(an+x)...).
static inline __m256d horner1(__m256d x, double a0) {
return add(x, broadcast(a0));
}
template <typename... T>
static __m256d horner1(__m256d x, double a0, T... tail) {
return add(mul(x, horner1(x, tail...)), broadcast(a0));
}
// Compute 2.0^n.
static __m256d exp2int(__m128i n) {
n = _mm_slli_epi32(n, 20);
n = _mm_add_epi32(n, _mm_set1_epi32(1023<<20));
auto nl = _mm_shuffle_epi32(n, 0x50);
auto nh = _mm_shuffle_epi32(n, 0xfa);
__m256i nhnl = combine_m128i(nh, nl);
return _mm256_castps_pd(
_mm256_blend_ps(_mm256_set1_ps(0),
_mm256_castsi256_ps(nhnl),0xaa));
}
// Compute n and f such that x = 2^n·f, with |f| ∈ [1,2), given x is finite and normal.
static __m128i logb_normal(const __m256d& x) {
__m128i xw = hi_epi32(_mm256_castpd_si256(x));
__m128i emask = _mm_set1_epi32(0x7ff00000);
__m128i ebiased = _mm_srli_epi32(_mm_and_si128(xw, emask), 20);
return _mm_sub_epi32(ebiased, _mm_set1_epi32(1023));
}
static __m256d fraction_normal(const __m256d& x) {
// 0x800fffffffffffff (intrinsic takes signed parameter)
__m256d emask = _mm256_castsi256_pd(_mm256_set1_epi64x(-0x7ff0000000000001));
__m256d bias = _mm256_castsi256_pd(_mm256_set1_epi64x(0x3ff0000000000000));
return _mm256_or_pd(bias, _mm256_and_pd(emask, x));
}
// Compute 2^n·x when both x and 2^n·x are normal, finite and strictly positive doubles.
static __m256d ldexp_positive(__m256d x, __m128i n) {
n = _mm_slli_epi32(n, 20);
auto zero = _mm_set1_epi32(0);
auto nl = _mm_unpacklo_epi32(zero, n);
auto nh = _mm_unpackhi_epi32(zero, n);
__m128d xl = _mm256_castpd256_pd128(x);
__m128d xh = _mm256_extractf128_pd(x, 1);
__m128i suml = _mm_add_epi64(nl, _mm_castpd_si128(xl));
__m128i sumh = _mm_add_epi64(nh, _mm_castpd_si128(xh));
__m256i sumhl = combine_m128i(sumh, suml);
return _mm256_castsi256_pd(sumhl);
}
// Compute 2^n·x when both x and 2^n·x are normal and finite.
static __m256d ldexp_normal(__m256d x, __m128i n) {
__m256d smask = _mm256_castsi256_pd(_mm256_set1_epi64x(0x7fffffffffffffffll));
__m256d sbits = _mm256_andnot_pd(smask, x);
n = _mm_slli_epi32(n, 20);
auto zi = _mm_set1_epi32(0);
auto nl = _mm_unpacklo_epi32(zi, n);
auto nh = _mm_unpackhi_epi32(zi, n);
__m128d xl = _mm256_castpd256_pd128(x);
__m128d xh = _mm256_extractf128_pd(x, 1);
__m128i suml = _mm_add_epi64(nl, _mm_castpd_si128(xl));
__m128i sumh = _mm_add_epi64(nh, _mm_castpd_si128(xh));
__m256i sumhl = combine_m128i(sumh, suml);
auto nzans = _mm256_or_pd(_mm256_and_pd(_mm256_castsi256_pd(sumhl), smask), sbits);
return ifelse(cmp_eq(x, zero()), zero(), nzans);
}
};
#if defined(__AVX2__) && defined(__FMA__)
struct avx2_int4;
struct avx2_double4;
template <>
struct simd_traits<avx2_int4> {
static constexpr unsigned width = 4;
static constexpr unsigned min_align = avx_min_align;
using scalar_type = std::int32_t;
using vector_type = __m128i;
using mask_impl = avx_int4;
};
template <>
struct simd_traits<avx2_double4> {
static constexpr unsigned width = 4;
static constexpr unsigned min_align = avx_min_align;
using scalar_type = double;
using vector_type = __m256d;
using mask_impl = avx2_double4;
};
// Note: we derive from avx_int4 only as an implementation shortcut.
// Because `avx2_int4` does not derive from `implbase<avx2_int4>`,
// any fallback methods in `implbase` will use the `avx_int4`
// functions rather than the `avx2_int4` functions.
struct avx2_int4: avx_int4 {
using implbase<avx_int4>::cast_from;
// Need to provide a cast overload for avx2_double4 tag:
static __m128i cast_from(tag<avx2_double4>, const __m256d& v) {
return _mm256_cvttpd_epi32(v);
}
};
// Note: we derive from avx_double4 only as an implementation shortcut.
// Because `avx2_double4` does not derive from `implbase<avx2_double4>`,
// any fallback methods in `implbase` will use the `avx_double4`
// functions rather than the `avx2_double4` functions.
struct avx2_double4: avx_double4 {
using implbase<avx_double4>::cast_from;
using implbase<avx_double4>::gather;
// Need to provide a cast overload for avx2_int4 tag:
static __m256d cast_from(tag<avx2_int4>, const __m128i& v) {
return _mm256_cvtepi32_pd(v);
}
static __m256d fma(const __m256d& a, const __m256d& b, const __m256d& c) {
return _mm256_fmadd_pd(a, b, c);
}
static vector_type logical_not(const vector_type& a) {
__m256i ones = {};
return _mm256_xor_pd(a, _mm256_castsi256_pd(_mm256_cmpeq_epi32(ones, ones)));
}
static __m256d mask_unpack(unsigned long long k) {
// Only care about bottom four bits of k.
__m256i b = _mm256_set1_epi8((char)k);
b = _mm256_or_si256(b, _mm256_setr_epi64x(
0xfefefefefefefefe, 0xfdfdfdfdfdfdfdfd,
0xfbfbfbfbfbfbfbfb, 0xf7f7f7f7f7f7f7f7));
__m256i ones = {};
ones = _mm256_cmpeq_epi64(ones, ones);
return _mm256_castsi256_pd(_mm256_cmpeq_epi64(ones, b));
}
static void mask_copy_to(const __m256d& m, bool* y) {
// Convert to 32-bit wide mask values, and delegate to
// avx2_int4.
avx_int4::mask_copy_to(lo_epi32(_mm256_castpd_si256(m)), y);
}
static __m256d mask_copy_from(const bool* w) {
__m256i zero = _mm256_setzero_si256();
__m128i r;
std::memcpy(&r, w, 4);
return _mm256_castsi256_pd(_mm256_sub_epi64(zero, _mm256_cvtepi8_epi64(r)));
}
static __m256d gather(tag<avx2_int4>, const double* p, const __m128i& index) {
return _mm256_i32gather_pd(p, index, 8);
}
static __m256d gather(tag<avx2_int4>, __m256d a, const double* p, const __m128i& index, const __m256d& mask) {
return _mm256_mask_i32gather_pd(a, p, index, mask, 8);
};
// avx4_double4 versions of log, exp, and expm1 use the same algorithms as for avx_double4,
// but use AVX2-specialized bit manipulation and FMA.
static __m256d exp(const __m256d& x) {
// Masks for exceptional cases.
auto is_large = cmp_gt(x, broadcast(exp_maxarg));
auto is_small = cmp_lt(x, broadcast(exp_minarg));
auto is_nan = _mm256_cmp_pd(x, x, cmp_unord_q);
// Compute n and g.
auto n = _mm256_floor_pd(fma(broadcast(ln2inv), x, broadcast(0.5)));
auto g = fma(n, broadcast(-ln2C1), x);
g = fma(n, broadcast(-ln2C2), g);
auto gg = mul(g, g);
// Compute the g*P(g^2) and Q(g^2).
auto odd = mul(g, horner(gg, P0exp, P1exp, P2exp));
auto even = horner(gg, Q0exp, Q1exp, Q2exp, Q3exp);
// Compute R(g)/R(-g) = 1 + 2*g*P(g^2) / (Q(g^2)-g*P(g^2))
auto expg = fma(broadcast(2), div(odd, sub(even, odd)), broadcast(1));
// Finally, compute product with 2^n.
// Note: can only achieve full range using the ldexp implementation,
// rather than multiplying by 2^n directly.
auto result = ldexp_positive(expg, _mm256_cvtpd_epi32(n));
return
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(0),
ifelse(is_nan, broadcast(NAN),
result)));
}
static __m256d expm1(const __m256d& x) {
auto is_large = cmp_gt(x, broadcast(exp_maxarg));
auto is_small = cmp_lt(x, broadcast(expm1_minarg));
auto is_nan = _mm256_cmp_pd(x, x, cmp_unord_q);
auto half = broadcast(0.5);
auto one = broadcast(1.);
auto two = add(one, one);
auto smallx = cmp_leq(abs(x), half);
auto n = _mm256_floor_pd(fma(broadcast(ln2inv), x, half));
n = ifelse(smallx, zero(), n);
auto g = fma(n, broadcast(-ln2C1), x);
g = fma(n, broadcast(-ln2C2), g);
auto gg = mul(g, g);
auto odd = mul(g, horner(gg, P0exp, P1exp, P2exp));
auto even = horner(gg, Q0exp, Q1exp, Q2exp, Q3exp);
auto expgm1 = div(mul(two, odd), sub(even, odd));
auto nm1 = _mm256_cvtpd_epi32(sub(n, one));
auto scaled = mul(add(sub(exp2int(nm1), half), ldexp_normal(expgm1, nm1)), two);
return
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(-1),
ifelse(is_nan, broadcast(NAN),
ifelse(smallx, expgm1,
scaled))));
}
static __m256d log(const __m256d& x) {
// Masks for exceptional cases.
auto is_large = cmp_geq(x, broadcast(HUGE_VAL));
auto is_small = cmp_lt(x, broadcast(log_minarg));
auto is_domainerr = _mm256_cmp_pd(x, broadcast(0), cmp_nge_uq);
__m256d g = _mm256_cvtepi32_pd(logb_normal(x));
__m256d u = fraction_normal(x);
__m256d one = broadcast(1.);
__m256d half = broadcast(0.5);
auto gtsqrt2 = cmp_geq(u, broadcast(sqrt2));
g = ifelse(gtsqrt2, add(g, one), g);
u = ifelse(gtsqrt2, mul(u, half), u);
auto z = sub(u, one);
auto pz = horner(z, P0log, P1log, P2log, P3log, P4log, P5log);
auto qz = horner1(z, Q0log, Q1log, Q2log, Q3log, Q4log);
auto z2 = mul(z, z);
auto z3 = mul(z2, z);
auto r = div(mul(z3, pz), qz);
r = fma(g, broadcast(ln2C4), r);
r = fms(z2, half, r);
r = sub(z, r);
r = fma(g, broadcast(ln2C3), r);
// Return NaN if x is NaN or negative, +inf if x is +inf,
// or -inf if zero or (positive) denormal.
return
ifelse(is_domainerr, broadcast(NAN),
ifelse(is_large, broadcast(HUGE_VAL),
ifelse(is_small, broadcast(-HUGE_VAL),
r)));
}
protected:
static __m128i lo_epi32(__m256i a) {
a = _mm256_shuffle_epi32(a, 0x08);
a = _mm256_permute4x64_epi64(a, 0x08);
return _mm256_castsi256_si128(a);
}
static __m128i hi_epi32(__m256i a) {
a = _mm256_shuffle_epi32(a, 0x0d);
a = _mm256_permute4x64_epi64(a, 0x08);
return _mm256_castsi256_si128(a);
}
static inline __m256d horner(__m256d x, double a0) {
return broadcast(a0);
}
template <typename... T>
static __m256d horner(__m256d x, double a0, T... tail) {
return fma(x, horner(x, tail...), broadcast(a0));
}
static inline __m256d horner1(__m256d x, double a0) {
return add(x, broadcast(a0));
}
template <typename... T>
static __m256d horner1(__m256d x, double a0, T... tail) {
return fma(x, horner1(x, tail...), broadcast(a0));
}
static __m256d fms(const __m256d& a, const __m256d& b, const __m256d& c) {
return _mm256_fmsub_pd(a, b, c);
}
// Compute 2.0^n.
// Overrides avx_double4::exp2int.
static __m256d exp2int(__m128i n) {
__m256d x = broadcast(1);
__m256i nshift = _mm256_slli_epi64(_mm256_cvtepi32_epi64(n), 52);
__m256i sum = _mm256_add_epi64(nshift, _mm256_castpd_si256(x));
return _mm256_castsi256_pd(sum);
}
// Compute 2^n*x when both x and 2^n*x are normal, finite and strictly positive doubles.
// Overrides avx_double4::ldexp_positive.
static __m256d ldexp_positive(__m256d x, __m128i n) {
__m256i nshift = _mm256_slli_epi64(_mm256_cvtepi32_epi64(n), 52);
__m256i sum = _mm256_add_epi64(nshift, _mm256_castpd_si256(x));
return _mm256_castsi256_pd(sum);
}
// Compute 2^n*x when both x and 2^n*x are normal and finite.
// Overrides avx_double4::ldexp_normal.
static __m256d ldexp_normal(__m256d x, __m128i n) {
__m256d smask = _mm256_castsi256_pd(_mm256_set1_epi64x(0x7fffffffffffffffll));
__m256d sbits = _mm256_andnot_pd(smask, x);
__m256i nshift = _mm256_slli_epi64(_mm256_cvtepi32_epi64(n), 52);
__m256i sum = _mm256_add_epi64(nshift, _mm256_castpd_si256(x));
auto nzans = _mm256_or_pd(_mm256_and_pd(_mm256_castsi256_pd(sum), smask), sbits);
return ifelse(cmp_eq(x, zero()), zero(), nzans);
}
// Override avx_double4::logb_normal so as to use avx2 version of hi_epi32.
static __m128i logb_normal(const __m256d& x) {
__m128i xw = hi_epi32(_mm256_castpd_si256(x));
__m128i emask = _mm_set1_epi32(0x7ff00000);
__m128i ebiased = _mm_srli_epi32(_mm_and_si128(xw, emask), 20);
return _mm_sub_epi32(ebiased, _mm_set1_epi32(1023));
}
};
#endif // defined(__AVX2__) && defined(__FMA__)
} // namespace detail
namespace simd_abi {
template <typename T, unsigned N> struct avx;
template <> struct avx<int, 4> { using type = detail::avx_int4; };
template <> struct avx<double, 4> { using type = detail::avx_double4; };
#if defined(__AVX2__) && defined(__FMA__)
template <typename T, unsigned N> struct avx2;
template <> struct avx2<int, 4> { using type = detail::avx2_int4; };
template <> struct avx2<double, 4> { using type = detail::avx2_double4; };
#endif
} // namespace simd_abi
} // namespace simd
} // namespace arb
#endif // def __AVX__
| 32.719157
| 114
| 0.621226
|
akuesters
|
67fbaa809402c522de98e6d2aacfc0bac1a03f74
| 725
|
cpp
|
C++
|
SpaghettiDungeonGen/DRandom.cpp
|
RedBreadcat/SpaghettiDungeonGenerator
|
1153dd8f26dfd835ca70c520e735f199f50ef858
|
[
"MIT"
] | 39
|
2019-11-23T14:52:46.000Z
|
2022-01-04T08:57:04.000Z
|
SpaghettiDungeonGen/DRandom.cpp
|
RedBreadcat/SpaghettiDungeonGenerator
|
1153dd8f26dfd835ca70c520e735f199f50ef858
|
[
"MIT"
] | null | null | null |
SpaghettiDungeonGen/DRandom.cpp
|
RedBreadcat/SpaghettiDungeonGenerator
|
1153dd8f26dfd835ca70c520e735f199f50ef858
|
[
"MIT"
] | 5
|
2019-11-24T00:35:04.000Z
|
2019-12-09T11:08:16.000Z
|
#include "DRandom.h"
#include <iostream>
DRandom* DRandom::instance = nullptr;
DRandom::DRandom(unsigned int seed)
{
rng.seed(seed);
instance = this;
}
DRandom::~DRandom()
{
instance = nullptr;
}
Direction DRandom::GetDirection()
{
boost::random::uniform_int_distribution<int> distributionDir(0, 3);
return static_cast<Direction>(distributionDir(rng));
}
int DRandom::GetInt(int a, int b)
{
boost::random::uniform_int_distribution<int> dist(a, b);
return dist(rng);
}
float DRandom::GetFloat(float a, float b)
{
boost::random::uniform_real_distribution<float> dist(a, b);
return dist(rng);
}
float DRandom::GetZeroOne()
{
boost::random::uniform_real_distribution<float> dist(0.0f, 1.0f);
return dist(rng);
}
| 18.589744
| 68
| 0.725517
|
RedBreadcat
|
67fcf735412ab081f12a2a94eef6f437a59faca5
| 4,677
|
cpp
|
C++
|
ENgine/SceneEntities/UI/ContainerWidget.cpp
|
ENgineE777/OakEngine
|
6890fc89a0e9d151e7a0bcc1c276c13594616e9a
|
[
"Zlib"
] | 13
|
2020-12-02T02:13:29.000Z
|
2022-03-11T06:14:54.000Z
|
ENgine/SceneEntities/UI/ContainerWidget.cpp
|
ENgineE777/OakEngine
|
6890fc89a0e9d151e7a0bcc1c276c13594616e9a
|
[
"Zlib"
] | null | null | null |
ENgine/SceneEntities/UI/ContainerWidget.cpp
|
ENgineE777/OakEngine
|
6890fc89a0e9d151e7a0bcc1c276c13594616e9a
|
[
"Zlib"
] | null | null | null |
#include "ContainerWidget.h"
#include "Root/Root.h"
namespace Oak
{
CLASSREG(SceneEntity, ContainerWidget, "ContainerWidget")
META_DATA_DESC(ContainerWidget)
BASE_SCENE_ENTITY_PROP(ContainerWidget)
ENUM_PROP(ContainerWidget, horzAlign, 0, "Prop", "Horz align", "Horizontal aligment of a widget")
ENUM_ELEM("Left", 0)
ENUM_ELEM("Center", 1)
ENUM_ELEM("Right", 2)
ENUM_END
ENUM_PROP(ContainerWidget, vertAlign, 0, "Prop", "Vert align", "Vertical aligment of a widget")
ENUM_ELEM("Top", 3)
ENUM_ELEM("Center", 1)
ENUM_ELEM("Bottom", 4)
ENUM_END
ENUM_PROP(ContainerWidget, horzSize, 0, "Prop", "Horz size", "Type of width of a widget")
ENUM_ELEM("Fixed", 0)
ENUM_ELEM("Fill parent", 1)
ENUM_ELEM("Wrap content", 2)
ENUM_END
ENUM_PROP(ContainerWidget, vertSize, 0, "Prop", "Vert size", "Type of height of a widget")
ENUM_ELEM("Fixed", 0)
ENUM_ELEM("Fill parent", 1)
ENUM_ELEM("Wrap content", 2)
ENUM_END
FLOAT_PROP(ContainerWidget, leftPadding.x, 0.0f, "Prop", "left padding", "Left padding of a widget")
FLOAT_PROP(ContainerWidget, leftPadding.y, 0.0f, "Prop", "top padding", "Top padding of a widget")
FLOAT_PROP(ContainerWidget, rightPadding.x, 0.0f, "Prop", "right padding", "Right padding of a widget")
FLOAT_PROP(ContainerWidget, rightPadding.y, 0.0f, "Prop", "bottom padding", "Bottom padding of a widget")
COLOR_PROP(ContainerWidget, color, COLOR_WHITE, "Prop", "color")
META_DATA_DESC_END()
void ContainerWidget::Init()
{
transform.unitsScale = &Sprite::pixelsPerUnit;
transform.unitsInvScale = &Sprite::pixelsPerUnitInvert;
transform.transformFlag = SpriteTransformFlags;
Tasks(true)->AddTask(199, this, (Object::Delegate)&ContainerWidget::FullDraw);
}
void ContainerWidget::CalcState()
{
Math::Vector3 parentSize;
ContainerWidget* parentWidget = dynamic_cast<ContainerWidget*>(parent);
if (parentWidget)
{
parentSize = parentWidget->GetTransform().size;
curColor = parentWidget->color * color;
}
else
{
parentSize.x = root.render.GetDevice()->GetWidth() * Sprite::pixelsHeight / root.render.GetDevice()->GetHeight();
parentSize.y = Sprite::pixelsHeight;
curColor = color;
}
if (horzSize == Size::fillParent)
{
transform.position = Math::Vector3(0.0f, transform.position.y, transform.position.z);
transform.size.x = parentSize.x - rightPadding.x - leftPadding.x;
}
if (vertSize == Size::fillParent)
{
transform.position = Math::Vector3(transform.position.y, 0.0f, transform.position.z);
transform.size.y = parentSize.y - rightPadding.y - leftPadding.y;
}
/*if (parentWidget)
{
Math::Vector3 offset = parentWidget->GetTransform().size * parentWidget->GetTransform().offset;
transform.global.Pos().x -= offset.x;
transform.global.Pos().y -= offset.y;
}*/
if (horzAlign == Align::alignLeft)
{
transform.global.Pos().x += leftPadding.x;
}
else
if (horzAlign == Align::alignCenter)
{
transform.global.Pos().x += leftPadding.x + (parentSize.x - rightPadding.x - leftPadding.x) * 0.5f;
}
else
if (horzAlign == Align::alignRight)
{
transform.global.Pos().x += -rightPadding.x + parentSize.x;
}
if (vertAlign == Align::alignTop)
{
transform.global.Pos().y += leftPadding.y;
}
else
if (vertAlign == Align::alignCenter)
{
transform.global.Pos().y += leftPadding.y + (parentSize.y - rightPadding.x - leftPadding.x) * 0.5f;
}
else
if (vertAlign == Align::alignBottom)
{
transform.global.Pos().y += (-rightPadding.y) + parentSize.y;
}
//transform.global.Pos().y = Sprite::pixelsHeight - transform.global.Pos().y;
if (scene->IsPlaying() && !parent)
{
Math::Matrix view;
root.render.GetTransform(TransformStage::View, view);
view.Inverse();
view.Pos() *= Sprite::pixelsPerUnit;
float k = Sprite::pixelsHeight / root.render.GetDevice()->GetHeight();
transform.global.Pos().x += view.Pos().x - root.render.GetDevice()->GetWidth() * 0.5f * k;
transform.global.Pos().y += view.Pos().y - root.render.GetDevice()->GetHeight() * 0.5f * k;
}
//trans.axis.x = (horzAlign == align_right) ? -1.0f : 1.0f;
//trans.axis.y = (vertAlign == align_bottom) ? -1.0f : 1.0f;
}
void ContainerWidget::FullDraw(float dt)
{
if (parent)
{
return;
}
DrawSelfWithChilds(dt);
}
void ContainerWidget::DrawSelfWithChilds(float dt)
{
if (!visible)
{
return;
}
CalcState();
Draw(dt);
for (auto* child : childs)
{
ContainerWidget* childWidget = dynamic_cast<ContainerWidget*>(child);
if (childWidget)
{
childWidget->DrawSelfWithChilds(dt);
}
}
}
void ContainerWidget::Draw(float dt)
{
}
}
| 26.87931
| 116
| 0.678213
|
ENgineE777
|
db0136dd20e2624239b921956d1b41da57cee1f3
| 30,041
|
cpp
|
C++
|
src/qt/qtbase/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
|
zwollerob/PhantomJS_AMR6VL
|
71c126e98a8c32950158d04d0bd75823cd008b99
|
[
"BSD-3-Clause"
] | null | null | null |
src/qt/qtbase/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
|
zwollerob/PhantomJS_AMR6VL
|
71c126e98a8c32950158d04d0bd75823cd008b99
|
[
"BSD-3-Clause"
] | null | null | null |
src/qt/qtbase/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
|
zwollerob/PhantomJS_AMR6VL
|
71c126e98a8c32950158d04d0bd75823cd008b99
|
[
"BSD-3-Clause"
] | null | null | null |
/****************************************************************************
**
** Copyright (C) 2012 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtCore/QUrlQuery>
#include <QtTest/QtTest>
typedef QList<QPair<QString, QString> > QueryItems;
Q_DECLARE_METATYPE(QueryItems)
Q_DECLARE_METATYPE(QUrl::ComponentFormattingOptions)
class tst_QUrlQuery : public QObject
{
Q_OBJECT
public:
tst_QUrlQuery()
{
qRegisterMetaType<QueryItems>();
}
private Q_SLOTS:
void constructing();
void addRemove();
void multiAddRemove();
void multiplyAddSamePair();
void setQueryItems_data();
void setQueryItems();
void basicParsing_data();
void basicParsing();
void reconstructQuery_data();
void reconstructQuery();
void encodedSetQueryItems_data();
void encodedSetQueryItems();
void encodedParsing_data();
void encodedParsing();
void differentDelimiters();
// old tests from tst_qurl.cpp
// add new tests above
void old_queryItems();
void old_hasQueryItem_data();
void old_hasQueryItem();
};
static QString prettyElement(const QString &key, const QString &value)
{
QString result;
if (key.isNull())
result += "null -> ";
else
result += '"' % key % "\" -> ";
if (value.isNull())
result += "null";
else
result += '"' % value % '"';
return result;
}
static QString prettyPair(QList<QPair<QString, QString> >::const_iterator it)
{
return prettyElement(it->first, it->second);
}
template <typename T>
static QByteArray prettyList(const T &items)
{
QString result = "(";
bool first = true;
typename T::const_iterator it = items.constBegin();
for ( ; it != items.constEnd(); ++it) {
if (!first)
result += ", ";
first = false;
result += prettyPair(it);
}
result += ")";
return result.toLocal8Bit();
}
static bool compare(const QList<QPair<QString, QString> > &actual, const QueryItems &expected,
const char *actualStr, const char *expectedStr, const char *file, int line)
{
return QTest::compare_helper(actual == expected, "Compared values are not the same",
qstrdup(prettyList(actual)), qstrdup(prettyList(expected).data()),
actualStr, expectedStr, file, line);
}
#define COMPARE_ITEMS(actual, expected) \
do { \
if (!compare(actual, expected, #actual, #expected, __FILE__, __LINE__)) \
return; \
} while (0)
inline QueryItems operator+(QueryItems items, const QPair<QString, QString> &pair)
{
// items is already a copy
items.append(pair);
return items;
}
inline QueryItems operator+(const QPair<QString, QString> &pair, QueryItems items)
{
// items is already a copy
items.prepend(pair);
return items;
}
inline QPair<QString, QString> qItem(const QString &first, const QString &second)
{
return qMakePair(first, second);
}
inline QPair<QString, QString> qItem(const char *first, const QString &second)
{
return qMakePair(QString::fromUtf8(first), second);
}
inline QPair<QString, QString> qItem(const char *first, const char *second)
{
return qMakePair(QString::fromUtf8(first), QString::fromUtf8(second));
}
inline QPair<QString, QString> qItem(const QString &first, const char *second)
{
return qMakePair(first, QString::fromUtf8(second));
}
static QUrlQuery emptyQuery()
{
return QUrlQuery();
}
void tst_QUrlQuery::constructing()
{
QUrlQuery empty;
QVERIFY(empty.isEmpty());
QCOMPARE(empty.queryPairDelimiter(), QUrlQuery::defaultQueryPairDelimiter());
QCOMPARE(empty.queryValueDelimiter(), QUrlQuery::defaultQueryValueDelimiter());
// undefined whether it is detached, but don't crash
QVERIFY(empty.isDetached() || !empty.isDetached());
empty.clear();
QVERIFY(empty.isEmpty());
{
QUrlQuery copy(empty);
QVERIFY(copy.isEmpty());
QVERIFY(!copy.isDetached());
QVERIFY(copy == empty);
QVERIFY(!(copy != empty));
copy = empty;
QVERIFY(copy == empty);
copy = QUrlQuery();
QVERIFY(copy == empty);
}
{
QUrlQuery copy(emptyQuery());
QVERIFY(copy == empty);
}
QVERIFY(!empty.hasQueryItem("a"));
QVERIFY(empty.queryItemValue("a").isEmpty());
QVERIFY(empty.allQueryItemValues("a").isEmpty());
QVERIFY(!empty.hasQueryItem(""));
QVERIFY(empty.queryItemValue("").isEmpty());
QVERIFY(empty.allQueryItemValues("").isEmpty());
QVERIFY(!empty.hasQueryItem(QString()));
QVERIFY(empty.queryItemValue(QString()).isEmpty());
QVERIFY(empty.allQueryItemValues(QString()).isEmpty());
QVERIFY(empty.queryItems().isEmpty());
QUrlQuery other;
other.addQueryItem("a", "b");
QVERIFY(!other.isEmpty());
QVERIFY(other.isDetached());
QVERIFY(other != empty);
QVERIFY(!(other == empty));
QUrlQuery copy(other);
QVERIFY(copy == other);
copy.clear();
QVERIFY(copy.isEmpty());
QVERIFY(copy != other);
copy = other;
QVERIFY(!copy.isEmpty());
QVERIFY(copy == other);
copy = QUrlQuery();
QVERIFY(copy.isEmpty());
empty.setQueryDelimiters('(', ')');
QCOMPARE(empty.queryValueDelimiter(), QChar(QLatin1Char('(')));
QCOMPARE(empty.queryPairDelimiter(), QChar(QLatin1Char(')')));
QList<QPair<QString, QString> > query;
query += qMakePair(QString("type"), QString("login"));
query += qMakePair(QString("name"), QString::fromUtf8("åge nissemannsen"));
query += qMakePair(QString("ole&du"), QString::fromUtf8("anne+jørgen=sant"));
query += qMakePair(QString("prosent"), QString("%"));
copy.setQueryItems(query);
QVERIFY(!copy.isEmpty());
}
void tst_QUrlQuery::addRemove()
{
QUrlQuery query;
{
// one item
query.addQueryItem("a", "b");
QVERIFY(!query.isEmpty());
QVERIFY(query.hasQueryItem("a"));
QCOMPARE(query.queryItemValue("a"), QString("b"));
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "b");
QList<QPair<QString, QString> > allItems = query.queryItems();
QCOMPARE(allItems.count(), 1);
QCOMPARE(allItems.at(0).first, QString("a"));
QCOMPARE(allItems.at(0).second, QString("b"));
}
QUrlQuery original = query;
{
// two items
query.addQueryItem("c", "d");
QVERIFY(query.hasQueryItem("a"));
QCOMPARE(query.queryItemValue("a"), QString("b"));
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "b");
QVERIFY(query.hasQueryItem("c"));
QCOMPARE(query.queryItemValue("c"), QString("d"));
QCOMPARE(query.allQueryItemValues("c"), QStringList() << "d");
QList<QPair<QString, QString> > allItems = query.queryItems();
QCOMPARE(allItems.count(), 2);
QVERIFY(allItems.contains(qItem("a", "b")));
QVERIFY(allItems.contains(qItem("c", "d")));
QVERIFY(query != original);
QVERIFY(!(query == original));
}
{
// remove an item that isn't there
QUrlQuery copy = query;
query.removeQueryItem("e");
QCOMPARE(query, copy);
}
{
// remove an item
query.removeQueryItem("c");
QVERIFY(query.hasQueryItem("a"));
QCOMPARE(query.queryItemValue("a"), QString("b"));
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "b");
QList<QPair<QString, QString> > allItems = query.queryItems();
QCOMPARE(allItems.count(), 1);
QCOMPARE(allItems.at(0).first, QString("a"));
QCOMPARE(allItems.at(0).second, QString("b"));
QVERIFY(query == original);
QVERIFY(!(query != original));
}
{
// add an item with en empty value
QString emptyButNotNull(0, Qt::Uninitialized);
QVERIFY(emptyButNotNull.isEmpty());
QVERIFY(!emptyButNotNull.isNull());
query.addQueryItem("e", "");
QVERIFY(query.hasQueryItem("a"));
QCOMPARE(query.queryItemValue("a"), QString("b"));
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "b");
QVERIFY(query.hasQueryItem("e"));
QCOMPARE(query.queryItemValue("e"), emptyButNotNull);
QCOMPARE(query.allQueryItemValues("e"), QStringList() << emptyButNotNull);
QList<QPair<QString, QString> > allItems = query.queryItems();
QCOMPARE(allItems.count(), 2);
QVERIFY(allItems.contains(qItem("a", "b")));
QVERIFY(allItems.contains(qItem("e", emptyButNotNull)));
QVERIFY(query != original);
QVERIFY(!(query == original));
}
{
// remove the items
query.removeQueryItem("a");
query.removeQueryItem("e");
QVERIFY(query.isEmpty());
}
}
void tst_QUrlQuery::multiAddRemove()
{
QUrlQuery query;
{
// one item, two values
query.addQueryItem("a", "b");
query.addQueryItem("a", "c");
QVERIFY(!query.isEmpty());
QVERIFY(query.hasQueryItem("a"));
// returns the first one
QVERIFY(query.queryItemValue("a") == "b");
// order is the order we set them in
QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c");
}
{
// add another item, two values
query.addQueryItem("A", "B");
query.addQueryItem("A", "C");
QVERIFY(query.hasQueryItem("A"));
QVERIFY(query.hasQueryItem("a"));
QVERIFY(query.queryItemValue("a") == "b");
QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c");
QVERIFY(query.queryItemValue("A") == "B");
QVERIFY(query.allQueryItemValues("A") == QStringList() << "B" << "C");
}
{
// remove one of the original items
query.removeQueryItem("a");
QVERIFY(query.hasQueryItem("a"));
// it must have removed the first one
QVERIFY(query.queryItemValue("a") == "c");
}
{
// remove the items we added later
query.removeAllQueryItems("A");
QVERIFY(!query.isEmpty());
QVERIFY(!query.hasQueryItem("A"));
}
{
// add one element to the current, then remove them
query.addQueryItem("a", "d");
query.removeAllQueryItems("a");
QVERIFY(!query.hasQueryItem("a"));
QVERIFY(query.isEmpty());
}
}
void tst_QUrlQuery::multiplyAddSamePair()
{
QUrlQuery query;
query.addQueryItem("a", "a");
query.addQueryItem("a", "a");
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "a" << "a");
query.addQueryItem("a", "a");
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "a" << "a" << "a");
query.removeQueryItem("a");
QCOMPARE(query.allQueryItemValues("a"), QStringList() << "a" << "a");
}
void tst_QUrlQuery::setQueryItems_data()
{
QTest::addColumn<QueryItems>("items");
QString emptyButNotNull(0, Qt::Uninitialized);
QTest::newRow("empty") << QueryItems();
QTest::newRow("1-novalue") << (QueryItems() << qItem("a", QString()));
QTest::newRow("1-emptyvalue") << (QueryItems() << qItem("a", emptyButNotNull));
QueryItems list;
list << qItem("a", "b");
QTest::newRow("1-value") << list;
QTest::newRow("1-multi") << (list + qItem("a", "c"));
QTest::newRow("1-duplicated") << (list + qItem("a", "b"));
list << qItem("c", "d");
QTest::newRow("2") << list;
list << qItem("c", "e");
QTest::newRow("2-multi") << list;
}
void tst_QUrlQuery::setQueryItems()
{
QFETCH(QueryItems, items);
QUrlQuery query;
QueryItems::const_iterator it = items.constBegin();
for ( ; it != items.constEnd(); ++it)
query.addQueryItem(it->first, it->second);
COMPARE_ITEMS(query.queryItems(), items);
query.clear();
query.setQueryItems(items);
COMPARE_ITEMS(query.queryItems(), items);
}
void tst_QUrlQuery::basicParsing_data()
{
QTest::addColumn<QString>("queryString");
QTest::addColumn<QueryItems>("items");
QString emptyButNotNull(0, Qt::Uninitialized);
QTest::newRow("null") << QString() << QueryItems();
QTest::newRow("empty") << "" << QueryItems();
QTest::newRow("1-novalue") << "a" << (QueryItems() << qItem("a", QString()));
QTest::newRow("1-emptyvalue") << "a=" << (QueryItems() << qItem("a", emptyButNotNull));
QTest::newRow("1-value") << "a=b" << (QueryItems() << qItem("a", "b"));
// some longer keys
QTest::newRow("1-longkey-novalue") << "thisisalongkey" << (QueryItems() << qItem("thisisalongkey", QString()));
QTest::newRow("1-longkey-emptyvalue") << "thisisalongkey=" << (QueryItems() << qItem("thisisalongkey", emptyButNotNull));
QTest::newRow("1-longkey-value") << "thisisalongkey=b" << (QueryItems() << qItem("thisisalongkey", "b"));
// longer values
QTest::newRow("1-longvalue-value") << "a=thisisalongreasonablyvalue"
<< (QueryItems() << qItem("a", "thisisalongreasonablyvalue"));
QTest::newRow("1-longboth-value") << "thisisalongkey=thisisalongreasonablyvalue"
<< (QueryItems() << qItem("thisisalongkey", "thisisalongreasonablyvalue"));
// two or more entries
QueryItems baselist;
baselist << qItem("a", "b") << qItem("c", "d");
QTest::newRow("2-ab-cd") << "a=b&c=d" << baselist;
QTest::newRow("2-cd-ab") << "c=d&a=b" << (QueryItems() << qItem("c", "d") << qItem("a", "b"));
// the same entry multiply defined
QTest::newRow("2-a-a") << "a&a" << (QueryItems() << qItem("a", QString()) << qItem("a", QString()));
QTest::newRow("2-ab-a") << "a=b&a" << (QueryItems() << qItem("a", "b") << qItem("a", QString()));
QTest::newRow("2-ab-ab") << "a=b&a=b" << (QueryItems() << qItem("a", "b") << qItem("a", "b"));
QTest::newRow("2-ab-ac") << "a=b&a=c" << (QueryItems() << qItem("a", "b") << qItem("a", "c"));
QPair<QString, QString> novalue = qItem("somekey", QString());
QueryItems list2 = baselist + novalue;
QTest::newRow("3-novalue-ab-cd") << "somekey&a=b&c=d" << (novalue + baselist);
QTest::newRow("3-ab-novalue-cd") << "a=b&somekey&c=d" << (QueryItems() << qItem("a", "b") << novalue << qItem("c", "d"));
QTest::newRow("3-ab-cd-novalue") << "a=b&c=d&somekey" << list2;
list2 << qItem("otherkeynovalue", QString());
QTest::newRow("4-ab-cd-novalue-novalue") << "a=b&c=d&somekey&otherkeynovalue" << list2;
QPair<QString, QString> emptyvalue = qItem("somekey", emptyButNotNull);
list2 = baselist + emptyvalue;
QTest::newRow("3-emptyvalue-ab-cd") << "somekey=&a=b&c=d" << (emptyvalue + baselist);
QTest::newRow("3-ab-emptyvalue-cd") << "a=b&somekey=&c=d" << (QueryItems() << qItem("a", "b") << emptyvalue << qItem("c", "d"));
QTest::newRow("3-ab-cd-emptyvalue") << "a=b&c=d&somekey=" << list2;
}
void tst_QUrlQuery::basicParsing()
{
QFETCH(QString, queryString);
QFETCH(QueryItems, items);
QUrlQuery query(queryString);
QCOMPARE(query.isEmpty(), items.isEmpty());
COMPARE_ITEMS(query.queryItems(), items);
}
void tst_QUrlQuery::reconstructQuery_data()
{
QTest::addColumn<QString>("queryString");
QTest::addColumn<QueryItems>("items");
QString emptyButNotNull(0, Qt::Uninitialized);
QTest::newRow("null") << QString() << QueryItems();
QTest::newRow("empty") << "" << QueryItems();
QTest::newRow("1-novalue") << "a" << (QueryItems() << qItem("a", QString()));
QTest::newRow("1-emptyvalue") << "a=" << (QueryItems() << qItem("a", emptyButNotNull));
QTest::newRow("1-value") << "a=b" << (QueryItems() << qItem("a", "b"));
// some longer keys
QTest::newRow("1-longkey-novalue") << "thisisalongkey" << (QueryItems() << qItem("thisisalongkey", QString()));
QTest::newRow("1-longkey-emptyvalue") << "thisisalongkey=" << (QueryItems() << qItem("thisisalongkey", emptyButNotNull));
QTest::newRow("1-longkey-value") << "thisisalongkey=b" << (QueryItems() << qItem("thisisalongkey", "b"));
// longer values
QTest::newRow("1-longvalue-value") << "a=thisisalongreasonablyvalue"
<< (QueryItems() << qItem("a", "thisisalongreasonablyvalue"));
QTest::newRow("1-longboth-value") << "thisisalongkey=thisisalongreasonablyvalue"
<< (QueryItems() << qItem("thisisalongkey", "thisisalongreasonablyvalue"));
// two or more entries
QueryItems baselist;
baselist << qItem("a", "b") << qItem("c", "d");
QTest::newRow("2-ab-cd") << "a=b&c=d" << baselist;
// the same entry multiply defined
QTest::newRow("2-a-a") << "a&a" << (QueryItems() << qItem("a", QString()) << qItem("a", QString()));
QTest::newRow("2-ab-ab") << "a=b&a=b" << (QueryItems() << qItem("a", "b") << qItem("a", "b"));
QTest::newRow("2-ab-ac") << "a=b&a=c" << (QueryItems() << qItem("a", "b") << qItem("a", "c"));
QTest::newRow("2-ac-ab") << "a=c&a=b" << (QueryItems() << qItem("a", "c") << qItem("a", "b"));
QTest::newRow("2-ab-cd") << "a=b&c=d" << (QueryItems() << qItem("a", "b") << qItem("c", "d"));
QTest::newRow("2-cd-ab") << "c=d&a=b" << (QueryItems() << qItem("c", "d") << qItem("a", "b"));
QueryItems list2 = baselist + qItem("somekey", QString());
QTest::newRow("3-ab-cd-novalue") << "a=b&c=d&somekey" << list2;
list2 << qItem("otherkeynovalue", QString());
QTest::newRow("4-ab-cd-novalue-novalue") << "a=b&c=d&somekey&otherkeynovalue" << list2;
list2 = baselist + qItem("somekey", emptyButNotNull);
QTest::newRow("3-ab-cd-emptyvalue") << "a=b&c=d&somekey=" << list2;
}
void tst_QUrlQuery::reconstructQuery()
{
QFETCH(QString, queryString);
QFETCH(QueryItems, items);
QUrlQuery query;
// add the items
for (QueryItems::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it) {
query.addQueryItem(it->first, it->second);
}
QCOMPARE(query.query(), queryString);
}
void tst_QUrlQuery::encodedSetQueryItems_data()
{
QTest::addColumn<QString>("queryString");
QTest::addColumn<QString>("key");
QTest::addColumn<QString>("value");
QTest::addColumn<QUrl::ComponentFormattingOptions>("encoding");
QTest::addColumn<QString>("expectedQuery");
QTest::addColumn<QString>("expectedKey");
QTest::addColumn<QString>("expectedValue");
typedef QUrl::ComponentFormattingOptions F;
QTest::newRow("nul") << "f%00=bar%00" << "f%00" << "bar%00" << F(QUrl::PrettyDecoded)
<< "f%00=bar%00" << "f%00" << "bar%00";
QTest::newRow("non-decodable-1") << "foo%01%7f=b%1ar" << "foo%01%7f" << "b%1ar" << F(QUrl::PrettyDecoded)
<< "foo%01%7F=b%1Ar" << "foo%01%7F" << "b%1Ar";
QTest::newRow("non-decodable-2") << "foo\x01\x7f=b\x1ar" << "foo\x01\x7f" << "b\x1Ar" << F(QUrl::PrettyDecoded)
<< "foo%01%7F=b%1Ar" << "foo%01%7F" << "b%1Ar";
QTest::newRow("space") << "%20=%20" << "%20" << "%20" << F(QUrl::PrettyDecoded)
<< " = " << " " << " ";
QTest::newRow("encode-space") << " = " << " " << " " << F(QUrl::FullyEncoded)
<< "%20=%20" << "%20" << "%20";
// tri-state
QTest::newRow("decode-non-delimiters") << "%3C%5C%3E=%7B%7C%7D%5E%60" << "%3C%5C%3E" << "%7B%7C%7D%5E%60" << F(QUrl::DecodeReserved)
<< "<\\>={|}^`" << "<\\>" << "{|}^`";
QTest::newRow("encode-non-delimiters") << "<\\>={|}^`" << "<\\>" << "{|}^`" << F(QUrl::EncodeReserved)
<< "%3C%5C%3E=%7B%7C%7D%5E%60" << "%3C%5C%3E" << "%7B%7C%7D%5E%60";
QTest::newRow("pretty-non-delimiters") << "<\\>={|}^`" << "<\\>" << "{|}^`" << F(QUrl::PrettyDecoded)
<< "%3C%5C%3E=%7B%7C%7D%5E%60" << "<\\>" << "{|}^`";
QTest::newRow("equals") << "%3D=%3D" << "%3D" << "%3D" << F(QUrl::PrettyDecoded)
<< "%3D=%3D" << "=" << "=";
QTest::newRow("equals-2") << "%3D==" << "=" << "=" << F(QUrl::PrettyDecoded)
<< "%3D=%3D" << "=" << "=";
QTest::newRow("ampersand") << "%26=%26" << "%26" << "%26" << F(QUrl::PrettyDecoded)
<< "%26=%26" << "&" << "&";
QTest::newRow("hash") << "#=#" << "%23" << "%23" << F(QUrl::PrettyDecoded)
<< "#=#" << "#" << "#";
QTest::newRow("decode-hash") << "%23=%23" << "%23" << "%23" << F(QUrl::PrettyDecoded)
<< "#=#" << "#" << "#";
QTest::newRow("percent") << "%25=%25" << "%25" << "%25" << F(QUrl::PrettyDecoded)
<< "%25=%25" << "%25" << "%25";
QTest::newRow("bad-percent-1") << "%=%" << "%" << "%" << F(QUrl::PrettyDecoded)
<< "%25=%25" << "%25" << "%25";
QTest::newRow("bad-percent-2") << "%2=%2" << "%2" << "%2" << F(QUrl::PrettyDecoded)
<< "%252=%252" << "%252" << "%252";
QTest::newRow("plus") << "+=+" << "+" << "+" << F(QUrl::PrettyDecoded)
<< "+=+" << "+" << "+";
QTest::newRow("2b") << "%2b=%2b" << "%2b" << "%2b" << F(QUrl::PrettyDecoded)
<< "%2B=%2B" << "%2B" << "%2B";
// plus signs must not be touched
QTest::newRow("encode-plus") << "+=+" << "+" << "+" << F(QUrl::FullyEncoded)
<< "+=+" << "+" << "+";
QTest::newRow("decode-2b") << "%2b=%2b" << "%2b" << "%2b" << F(QUrl::PrettyDecoded)
<< "%2B=%2B" << "%2B" << "%2B";
QTest::newRow("unicode") << "q=R%C3%a9sum%c3%A9" << "q" << "R%C3%a9sum%c3%A9" << F(QUrl::PrettyDecoded)
<< QString::fromUtf8("q=R\xc3\xa9sum\xc3\xa9") << "q" << QString::fromUtf8("R\xc3\xa9sum\xc3\xa9");
QTest::newRow("encode-unicode") << QString::fromUtf8("q=R\xc3\xa9sum\xc3\xa9") << "q" << QString::fromUtf8("R\xc3\xa9sum\xc3\xa9")
<< F(QUrl::FullyEncoded)
<< "q=R%C3%A9sum%C3%A9" << "q" << "R%C3%A9sum%C3%A9";
}
void tst_QUrlQuery::encodedSetQueryItems()
{
QFETCH(QString, key);
QFETCH(QString, value);
QFETCH(QString, expectedQuery);
QFETCH(QString, expectedKey);
QFETCH(QString, expectedValue);
QFETCH(QUrl::ComponentFormattingOptions, encoding);
QUrlQuery query;
query.addQueryItem(key, value);
COMPARE_ITEMS(query.queryItems(encoding), QueryItems() << qItem(expectedKey, expectedValue));
QCOMPARE(query.query(encoding), expectedQuery);
}
void tst_QUrlQuery::encodedParsing_data()
{
encodedSetQueryItems_data();
}
void tst_QUrlQuery::encodedParsing()
{
QFETCH(QString, queryString);
QFETCH(QString, expectedQuery);
QFETCH(QString, expectedKey);
QFETCH(QString, expectedValue);
QFETCH(QUrl::ComponentFormattingOptions, encoding);
QUrlQuery query(queryString);
COMPARE_ITEMS(query.queryItems(encoding), QueryItems() << qItem(expectedKey, expectedValue));
QCOMPARE(query.query(encoding), expectedQuery);
}
void tst_QUrlQuery::differentDelimiters()
{
QUrlQuery query;
query.setQueryDelimiters('(', ')');
{
// parse:
query.setQuery("foo(bar)hello(world)");
QueryItems expected;
expected << qItem("foo", "bar") << qItem("hello", "world");
COMPARE_ITEMS(query.queryItems(), expected);
COMPARE_ITEMS(query.queryItems(QUrl::FullyEncoded), expected);
COMPARE_ITEMS(query.queryItems(QUrl::PrettyDecoded), expected);
}
{
// reconstruct:
// note the final ')' is missing because there are no further items
QCOMPARE(query.query(), QString("foo(bar)hello(world"));
}
{
// set items containing the new delimiters and the old ones
query.clear();
query.addQueryItem("z(=)", "y(&)");
QCOMPARE(query.query(), QString("z%28=%29(y%28&%29"));
QUrlQuery copy = query;
QCOMPARE(query.query(), QString("z%28=%29(y%28&%29"));
copy.setQueryDelimiters(QUrlQuery::defaultQueryValueDelimiter(),
QUrlQuery::defaultQueryPairDelimiter());
QCOMPARE(copy.query(), QString("z(%3D)=y(%26)"));
}
}
void tst_QUrlQuery::old_queryItems()
{
// test imported from old tst_qurl.cpp
QUrlQuery url;
QList<QPair<QString, QString> > newItems;
newItems += qMakePair(QString("1"), QString("a"));
newItems += qMakePair(QString("2"), QString("b"));
newItems += qMakePair(QString("3"), QString("c"));
newItems += qMakePair(QString("4"), QString("a b"));
newItems += qMakePair(QString("5"), QString("&"));
newItems += qMakePair(QString("foo bar"), QString("hello world"));
newItems += qMakePair(QString("foo+bar"), QString("hello+world"));
newItems += qMakePair(QString("tex"), QString("a + b = c"));
url.setQueryItems(newItems);
QVERIFY(!url.isEmpty());
QList<QPair<QString, QString> > setItems = url.queryItems();
QVERIFY(newItems == setItems);
url.addQueryItem("1", "z");
#if 0
// undefined behaviour in the new QUrlQuery
QVERIFY(url.hasQueryItem("1"));
QCOMPARE(url.queryItemValue("1").toLatin1().constData(), "a");
url.addQueryItem("1", "zz");
QStringList expected;
expected += "a";
expected += "z";
expected += "zz";
QCOMPARE(url.allQueryItemValues("1"), expected);
url.removeQueryItem("1");
QCOMPARE(url.allQueryItemValues("1").size(), 2);
QCOMPARE(url.queryItemValue("1").toLatin1().constData(), "z");
#endif
url.removeAllQueryItems("1");
QVERIFY(!url.hasQueryItem("1"));
QCOMPARE(url.queryItemValue("4").toLatin1().constData(), "a b");
QCOMPARE(url.queryItemValue("5").toLatin1().constData(), "&");
QCOMPARE(url.queryItemValue("tex").toLatin1().constData(), "a + b = c");
QCOMPARE(url.queryItemValue("foo bar").toLatin1().constData(), "hello world");
//url.setUrl("http://www.google.com/search?q=a+b");
url.setQuery("q=a+b");
QCOMPARE(url.queryItemValue("q"), QString("a+b"));
//url.setUrl("http://www.google.com/search?q=a=b"); // invalid, but should be tolerated
url.setQuery("q=a=b");
QCOMPARE(url.queryItemValue("q"), QString("a=b"));
}
void tst_QUrlQuery::old_hasQueryItem_data()
{
QTest::addColumn<QString>("url");
QTest::addColumn<QString>("item");
QTest::addColumn<bool>("trueFalse");
// the old tests started with "http://www.foo.bar"
QTest::newRow("no query items") << "" << "baz" << false;
QTest::newRow("query item: hello") << "hello=world" << "hello" << true;
QTest::newRow("no query item: world") << "hello=world" << "world" << false;
QTest::newRow("query item: qt") << "hello=world&qt=rocks" << "qt" << true;
}
void tst_QUrlQuery::old_hasQueryItem()
{
QFETCH(QString, url);
QFETCH(QString, item);
QFETCH(bool, trueFalse);
QCOMPARE(QUrlQuery(url).hasQueryItem(item), trueFalse);
}
#if 0
// this test doesn't make sense anymore
void tst_QUrl::removeAllEncodedQueryItems_data()
{
QTest::addColumn<QUrl>("url");
QTest::addColumn<QByteArray>("key");
QTest::addColumn<QUrl>("result");
QTest::newRow("test1") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b&ccc=c") << QByteArray("bbb") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&ccc=c");
QTest::newRow("test2") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b&ccc=c") << QByteArray("aaa") << QUrl::fromEncoded("http://qt-project.org/foo?bbb=b&ccc=c");
// QTest::newRow("test3") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b&ccc=c") << QByteArray("ccc") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b");
QTest::newRow("test4") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b&ccc=c") << QByteArray("b%62b") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&bbb=b&ccc=c");
QTest::newRow("test5") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&b%62b=b&ccc=c") << QByteArray("b%62b") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&ccc=c");
QTest::newRow("test6") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&b%62b=b&ccc=c") << QByteArray("bbb") << QUrl::fromEncoded("http://qt-project.org/foo?aaa=a&b%62b=b&ccc=c");
}
void tst_QUrl::removeAllEncodedQueryItems()
{
QFETCH(QUrl, url);
QFETCH(QByteArray, key);
QFETCH(QUrl, result);
url.removeAllEncodedQueryItems(key);
QCOMPARE(url, result);
}
#endif
QTEST_APPLESS_MAIN(tst_QUrlQuery)
#include "tst_qurlquery.moc"
| 37.041924
| 188
| 0.588695
|
zwollerob
|
db051c03fd193415a35f9d7f2707c28a9a148409
| 907
|
cpp
|
C++
|
test/buffer_test.cpp
|
spoonb/libcomm
|
5638dac889bddb16420d8321067c783438a5deaf
|
[
"0BSD"
] | null | null | null |
test/buffer_test.cpp
|
spoonb/libcomm
|
5638dac889bddb16420d8321067c783438a5deaf
|
[
"0BSD"
] | null | null | null |
test/buffer_test.cpp
|
spoonb/libcomm
|
5638dac889bddb16420d8321067c783438a5deaf
|
[
"0BSD"
] | null | null | null |
/*
* Copyright 2015. 2016 C. Brett Witherspoon
*/
#define BOOST_TEST_MODULE buffer_test
#include <boost/test/unit_test.hpp>
#include <array>
#include <numeric>
#include <vector>
#include "signum/buffer.hpp"
BOOST_AUTO_TEST_CASE(buffer_empty_test)
{
signum::buffer<float> buf;
BOOST_REQUIRE(buf.empty());
BOOST_CHECK_EQUAL(buf.size(), 0);
}
BOOST_AUTO_TEST_CASE(buffer_vector_test)
{
std::vector<int> vec(10);
signum::buffer<int> buf(vec);
std::iota(vec.begin(), vec.end(), -1);
BOOST_CHECK_EQUAL(vec.size(), buf.size());
BOOST_CHECK_EQUAL_COLLECTIONS(vec.begin(), vec.end(), buf.begin(), buf.end());
}
BOOST_AUTO_TEST_CASE(buffer_array_test)
{
std::array<int, 10> arr;
signum::buffer<int> buf(arr);
std::iota(arr.begin(), arr.end(), -1);
BOOST_CHECK_EQUAL(arr.size(), buf.size());
BOOST_CHECK_EQUAL_COLLECTIONS(arr.begin(), arr.end(), buf.begin(), buf.end());
}
| 18.510204
| 80
| 0.694598
|
spoonb
|
db08e212d62fd7c3dec85be01c13fe9982a9b93b
| 1,341
|
cpp
|
C++
|
DEM/Src/L3/Story/Dlg/DlgNodePhrase.cpp
|
moltenguy1/deusexmachina
|
134f4ca4087fff791ec30562cb250ccd50b69ee1
|
[
"MIT"
] | 2
|
2017-04-30T20:24:29.000Z
|
2019-02-12T08:36:26.000Z
|
DEM/Src/L3/Story/Dlg/DlgNodePhrase.cpp
|
moltenguy1/deusexmachina
|
134f4ca4087fff791ec30562cb250ccd50b69ee1
|
[
"MIT"
] | null | null | null |
DEM/Src/L3/Story/Dlg/DlgNodePhrase.cpp
|
moltenguy1/deusexmachina
|
134f4ca4087fff791ec30562cb250ccd50b69ee1
|
[
"MIT"
] | null | null | null |
#include "DlgNodePhrase.h"
#include "DlgSystem.h"
#include "DlgLink.h"
#include <Game/GameServer.h>
#include <Events/EventManager.h>
namespace Story
{
ImplementRTTI(Story::CDlgNodePhrase, Story::CDlgNode);
ImplementFactory(Story::CDlgNodePhrase);
void CDlgNodePhrase::OnEnter(CActiveDlg& Dlg)
{
DlgSys->SayPhrase(SpeakerEntity, Phrase, Dlg);
}
//---------------------------------------------------------------------
CDlgNode* CDlgNodePhrase::Trigger(CActiveDlg& Dlg)
{
while (Dlg.IsCheckingConditions && Dlg.LinkIdx < Links.Size())
{
EExecStatus Status = Links[Dlg.LinkIdx]->Validate(Dlg);
if (Status == Success)
{
if (Links[Dlg.LinkIdx]->pTargetNode)
{
Dlg.IsCheckingConditions = false;
EventMgr->FireEvent(CStrID("OnDlgContinueAvailable"));
}
break;
}
else if (Status == Running) return this;
else Dlg.LinkIdx++;
}
if (Dlg.IsCheckingConditions)
{
Dlg.IsCheckingConditions = false;
Dlg.Continued = false;
EventMgr->FireEvent(CStrID("OnDlgEndAvailable"));
}
if (!Dlg.Continued && (Timeout < 0.f || Dlg.NodeEnterTime + Timeout > GameSrv->GetTime())) return this;
return (Dlg.LinkIdx == Links.Size()) ? NULL : Links[Dlg.LinkIdx]->DoTransition(Dlg);
}
//---------------------------------------------------------------------
} //namespace AI
| 26.82
| 105
| 0.608501
|
moltenguy1
|
db0ba05dd30e728d3919f7c3f3f7f3b4f1165dc6
| 670
|
cpp
|
C++
|
src/NumericalAlgorithms/Interpolation/InterpolationTargetDetail.cpp
|
fmahebert/spectre
|
936e2dff0434f169b9f5b03679cd27794003700a
|
[
"MIT"
] | null | null | null |
src/NumericalAlgorithms/Interpolation/InterpolationTargetDetail.cpp
|
fmahebert/spectre
|
936e2dff0434f169b9f5b03679cd27794003700a
|
[
"MIT"
] | null | null | null |
src/NumericalAlgorithms/Interpolation/InterpolationTargetDetail.cpp
|
fmahebert/spectre
|
936e2dff0434f169b9f5b03679cd27794003700a
|
[
"MIT"
] | null | null | null |
// Distributed under the MIT License.
// See LICENSE.txt for details.
#include "NumericalAlgorithms/Interpolation/InterpolationTargetDetail.hpp"
#include "Time/TimeStepId.hpp"
namespace intrp::InterpolationTarget_detail {
double get_temporal_id_value(const double time) noexcept { return time; }
double get_temporal_id_value(const TimeStepId& time_id) noexcept {
return time_id.substep_time().value();
}
double evaluate_temporal_id_for_expiration(const double time) noexcept {
return time;
}
double evaluate_temporal_id_for_expiration(const TimeStepId& time_id) noexcept {
return time_id.step_time().value();
}
} // namespace intrp::InterpolationTarget_detail
| 33.5
| 80
| 0.808955
|
fmahebert
|
db0d4b738a405fcba6ba4826812821b08f216bfd
| 7,754
|
cpp
|
C++
|
src/MushMeshRuby/MushMeshRubyMesh.cpp
|
mushware/adanaxis-core-app
|
679ac3e8a122e059bb208e84c73efc19753e87dd
|
[
"MIT"
] | 9
|
2020-11-02T17:20:40.000Z
|
2021-12-25T15:35:36.000Z
|
src/MushMeshRuby/MushMeshRubyMesh.cpp
|
mushware/adanaxis-core-app
|
679ac3e8a122e059bb208e84c73efc19753e87dd
|
[
"MIT"
] | 2
|
2020-06-27T23:14:13.000Z
|
2020-11-02T17:28:32.000Z
|
src/MushMeshRuby/MushMeshRubyMesh.cpp
|
mushware/adanaxis-core-app
|
679ac3e8a122e059bb208e84c73efc19753e87dd
|
[
"MIT"
] | 1
|
2021-05-12T23:05:42.000Z
|
2021-05-12T23:05:42.000Z
|
//%Header {
/*****************************************************************************
*
* File: src/MushMeshRuby/MushMeshRubyMesh.cpp
*
* Copyright: Andy Southgate 2002-2007, 2020
*
* 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.
*
****************************************************************************/
//%Header } DtzgnA/sS22NxSMgQuoZ2Q
/*
* $Id: MushMeshRubyMesh.cpp,v 1.14 2006/11/14 14:02:16 southa Exp $
* $Log: MushMeshRubyMesh.cpp,v $
* Revision 1.14 2006/11/14 14:02:16 southa
* Ball projectiles
*
* Revision 1.13 2006/09/12 15:28:51 southa
* World sphere
*
* Revision 1.12 2006/09/09 11:16:41 southa
* One-time vertex buffer generation
*
* Revision 1.11 2006/07/17 14:43:41 southa
* Billboarded deco objects
*
* Revision 1.10 2006/07/16 09:19:47 southa
* Delete mesh before creating
*
* Revision 1.9 2006/06/22 19:07:33 southa
* Build fixes
*
* Revision 1.8 2006/06/21 12:17:58 southa
* Ruby object generation
*
* Revision 1.7 2006/06/19 15:57:19 southa
* Materials
*
* Revision 1.6 2006/06/16 01:02:33 southa
* Ruby mesh generation
*
* Revision 1.5 2006/06/14 18:45:49 southa
* Ruby mesh generation
*
* Revision 1.4 2006/06/14 11:20:08 southa
* Ruby mesh generation
*
* Revision 1.3 2006/06/13 19:30:37 southa
* Ruby mesh generation
*
* Revision 1.2 2006/06/13 10:35:04 southa
* Ruby data objects
*
* Revision 1.1 2006/06/12 16:01:23 southa
* Ruby mesh generation
*
*/
#include "MushMeshRubyMesh.h"
#include "MushMeshRubyBase.h"
#include "MushMeshRubyBasePrism.h"
#include "MushMeshRubyBaseSingleFacet.h"
#include "MushMeshRubyBaseWorldSphere.h"
#include "MushMeshRubyDisplacement.h"
#include "MushMeshRubyExtruder.h"
// #include "MushMeshRubyRuby.h"
MUSHRUBYDATAOBJ_INSTANCE(MushMesh4Mesh);
using namespace Mushware;
using namespace std;
MUSHRUBYDATAOBJ_INITIALIZE(MushMesh4Mesh)(Mushware::tRubyArgC inArgC, Mushware::tRubyValue *inpArgV, Mushware::tRubyValue inSelf)
{
if (inArgC != 1)
{
MushRubyUtil::Raise("MushMesh constructor requires one parameter <mesh name>");
}
MushRubyValue nameValue(inpArgV[0]);
std::string nameStr = nameValue.String();
DataObjRef(inSelf).NameSet(nameStr);
tDataObjData::Sgl().IfExistsDelete(nameStr); // Create mesh if it doesn't exist
tDataObjData::Sgl().GetOrCreate(nameStr); // Create mesh if it doesn't exist
WRef(inSelf).VertexDelegateSet(MushMesh4Mesh::tDataRef(nameStr));
WRef(inSelf).ColourDelegateSet(MushMesh4Mesh::tDataRef(nameStr));
WRef(inSelf).TexCoordDelegateSet(MushMesh4Mesh::tDataRef(nameStr));
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::BaseAdd(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
try
{
if (MushMeshRubyBasePrism::IsInstanceOf(inArg0))
{
WRef(inSelf).BaseGive(new MushMeshLibraryPrism(MushMeshRubyBasePrism::Ref(inArg0)));
}
else if (MushMeshRubyBaseSingleFacet::IsInstanceOf(inArg0))
{
WRef(inSelf).BaseGive(new MushMeshLibrarySingleFacet(MushMeshRubyBaseSingleFacet::Ref(inArg0)));
}
else if (MushMeshRubyBaseWorldSphere::IsInstanceOf(inArg0))
{
WRef(inSelf).BaseGive(new MushMeshLibraryWorldSphere(MushMeshRubyBaseWorldSphere::Ref(inArg0)));
}
else
{
MushRubyUtil::Raise("Wrong type for BaseAdd - must be MushMeshRubyBaseXXXX");
}
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::BaseDisplacementAdd(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
if (!MushMeshRubyDisplacement::IsInstanceOf(inArg0))
{
MushRubyUtil::Raise("Wrong type for BaseDisplacementAdd - must be MushDisplacement");
}
try
{
WRef(inSelf).BaseDisplacementSet(MushMeshRubyDisplacement::Ref(inArg0));
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::BillboardSet(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
try
{
MushRubyValue param0(inArg0);
if (param0.Bool())
{
WRef(inSelf).TransformTypeSet(MushMesh4Mesh::kTransformTypeBillboard);
}
else
{
WRef(inSelf).TransformTypeSet(MushMesh4Mesh::kTransformTypeNormal);
}
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::BillboardRandomSet(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
try
{
MushRubyValue param0(inArg0);
if (param0.Bool())
{
WRef(inSelf).TransformTypeSet(MushMesh4Mesh::kTransformTypeBillboardRandom);
}
else
{
WRef(inSelf).TransformTypeSet(MushMesh4Mesh::kTransformTypeNormal);
}
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::ExtruderAdd(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
if (!MushMeshRubyExtruder::IsInstanceOf(inArg0))
{
MushRubyUtil::Raise("Wrong type for ExtruderAdd - must be MushExtruder");
}
try
{
WRef(inSelf).ExtruderGive(new MushMeshLibraryExtruder(MushMeshRubyExtruder::Ref(inArg0)));
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::MaterialAdd(Mushware::tRubyValue inSelf, Mushware::tRubyValue inArg0)
{
try
{
MushRubyValue param0(inArg0);
std::string materialName = param0.String();
WRef(inSelf).MaterialNameSet(materialName, 0);
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
Mushware::tRubyValue
MushMeshRubyMesh::Make(Mushware::tRubyValue inSelf)
{
try
{
WRef(inSelf).Make();
}
catch (std::exception& e)
{
MushRubyUtil::Raise(e.what());
}
return inSelf;
}
void
MushMeshRubyMesh::RubyInstall(void)
{
DataObjInstall("MushMesh");
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mBaseAdd", BaseAdd);
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mBaseDisplacementAdd", BaseDisplacementAdd);
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mBillboardSet", BillboardSet);
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mBillboardRandomSet", BillboardRandomSet);
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mExtruderAdd", ExtruderAdd);
MushRubyUtil::MethodDefineOneParam(DataObjKlass(), "mMaterialAdd", MaterialAdd);
MushRubyUtil::MethodDefineNoParams(DataObjKlass(), "mMake", Make);
}
namespace
{
void Install(void)
{
MushRubyInstall::Sgl().Add(MushMeshRubyMesh::RubyInstall);
}
MushcoreInstaller install(Install);
}
| 28.718519
| 129
| 0.702218
|
mushware
|
db0d66113af48963ee3ac011198e90d611f2e898
| 832
|
cpp
|
C++
|
Source/AnimInertialBlend/AnimGraphNode_InertialBlend.cpp
|
HogeTatu/UE4Sample_AnimInertialBlend
|
659bcc4e03cd94946346451abf5a05154f775346
|
[
"MIT"
] | 17
|
2018-06-10T16:50:47.000Z
|
2021-12-24T05:01:00.000Z
|
Source/AnimInertialBlend/AnimGraphNode_InertialBlend.cpp
|
HogeTatu/UE4Sample_AnimInertialBlend
|
659bcc4e03cd94946346451abf5a05154f775346
|
[
"MIT"
] | null | null | null |
Source/AnimInertialBlend/AnimGraphNode_InertialBlend.cpp
|
HogeTatu/UE4Sample_AnimInertialBlend
|
659bcc4e03cd94946346451abf5a05154f775346
|
[
"MIT"
] | 2
|
2020-11-09T01:26:26.000Z
|
2021-12-24T05:00:52.000Z
|
// Fill out your copyright notice in the Description page of Project Settings.
#include "AnimGraphNode_InertialBlend.h"
#define LOCTEXT_NAMESPACE "A3Nodes"
UAnimGraphNode_InertialBlend::UAnimGraphNode_InertialBlend(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
FLinearColor UAnimGraphNode_InertialBlend::GetNodeTitleColor() const
{
return FLinearColor(0.823f, 0.867f, 0.914f);
}
FText UAnimGraphNode_InertialBlend::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return LOCTEXT("AnimGraphNodeInertialBlend_Title", "Inertial Blend");
}
FText UAnimGraphNode_InertialBlend::GetTooltipText() const
{
return LOCTEXT("AnimGraphNodeInertialBlend_Tooltip", "Inertial Blend");
}
FString UAnimGraphNode_InertialBlend::GetNodeCategory() const
{
return TEXT("Blends");
}
#undef LOCTEXT_NAMESPACE
| 25.212121
| 103
| 0.81851
|
HogeTatu
|
db0e91776ad55d8a718c6232897e9bac035d5fa4
| 7,269
|
cc
|
C++
|
mpegutils/src/com/goffersoft/core/test_list.cc
|
goffersoft/commonutils-cpp
|
6bbfb517ae780e9013bf3e1838aa704f044d39d3
|
[
"MIT"
] | null | null | null |
mpegutils/src/com/goffersoft/core/test_list.cc
|
goffersoft/commonutils-cpp
|
6bbfb517ae780e9013bf3e1838aa704f044d39d3
|
[
"MIT"
] | null | null | null |
mpegutils/src/com/goffersoft/core/test_list.cc
|
goffersoft/commonutils-cpp
|
6bbfb517ae780e9013bf3e1838aa704f044d39d3
|
[
"MIT"
] | null | null | null |
/**
**
** This file is part of mpegutils.
**
** mpegutils is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** mpegutils is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with mpegutils. If not, see <http://www.gnu.org/licenses/>.
**
** This file contains test code for the list.h class
**/
#include <iostream>
#include <typeinfo>
#include "list.h"
#include "hash.h"
using std::endl;
using std::cout;
using std::default_random_engine;
using std::uniform_int_distribution;
using com::goffersoft::core::_SLink;
using com::goffersoft::core::_DLink;
using com::goffersoft::core::SLink;
using com::goffersoft::core::CSLink;
using com::goffersoft::core::DLink;
using com::goffersoft::core::CDLink;
using com::goffersoft::core::TLink;
using com::goffersoft::core::ListBase;
using com::goffersoft::core::ISList;
using com::goffersoft::core::SList;
using com::goffersoft::core::ForwardListIterator;
using com::goffersoft::core::Hash;
using com::goffersoft::core::HashType;
template <typename T, bool circular = false>
void
print_list(T* head) {
T* link = head;
T* test_link = nullptr;
int i = 1;
if (circular) {
test_link = head;
}
if (link == nullptr) {
cout << "printing List : <empty>" << endl;
return;
} else {
cout << "printing List :" << endl;
}
do {
cout << "[" << i << "] = "
<< *link->get_info() << endl;
link = (T*)link->get_next();
i++;
} while (link != test_link);
}
template <typename T>
void
delete_slist(T* head, T* tail) {
T* link;
cout << "deleting list :" << endl;
while (head) {
link = head;
head = T::remove_head(head, tail);
delete link;
}
}
template <typename T>
void
delete_dlist(T* head) {
T* link;
cout << "deleting list :" << endl;
while (head) {
link = head;
head = T::remove_head(head);
delete link;
}
}
struct TestSLink: public SLink {
TestSLink(int ii): i(ii) {}
int i;
int* get_info() { return &i; }
};
struct TestObject {
TestObject(int ii): i(ii) {}
int i;
int* get_info() { return &i; }
inline operator int() { return i; }
};
struct TestSLinkCircular: public CSLink {
TestSLinkCircular(int ii): i(ii) {}
int i;
int* get_info() { return &i; }
};
struct TestDLink: public DLink {
TestDLink(int ii): i(ii) {}
int i;
int* get_info() { return &i; }
};
struct TestDLinkCircular : public CDLink {
TestDLinkCircular(int ii): i(ii) {}
int i;
int* get_info() { return &i; }
};
template <typename T, bool circular = false>
void
list_test_dlink() {
T* head;
for(int i = 0; i < 2; i++) {
head = nullptr;
print_list<T, circular>(head);
head = new T(1);
print_list<T, circular>(head);
head->insert(new T(2));
print_list<T, circular>(head);
head = (T*)T::insert_head(head,
new T(3));
head->insert(new T(4));
print_list<T, circular>(head);
delete_dlist<_DLink<circular> >(head);
}
}
template <typename T, bool circular = false>
void
list_test_slink() {
T* head;
T* tail;
for(int i = 0; i < 2; i++) {
head = nullptr;
tail = nullptr;
print_list<T, circular>(head);
head = new T(1);
print_list<T, circular>(head);
tail = new T(2);
head->insert(tail);
print_list<T, circular>(head);
head = (T*)T::insert_head(head,
new T(3),
tail);
head->insert(new T(4));
print_list<T, circular>(head);
delete_slist<_SLink<circular> >(head, tail);
}
}
template <typename T, typename L, bool circular = false>
void list_test_listbase() {
ListBase<T> lb;
T* link = new T(1);
lb.set_head(link);
lb.set_tail(link);
lb.set_size(1);
cout << "List Size:" << lb.get_size() << endl;
print_list<T, circular>(lb.get_head());
delete_slist<L>(lb.get_head(), lb.get_tail());
}
template <typename T, bool circular>
void list_test_islist() {
ISList<T> list;
T* link1 = new T(1);
T* link2 = new T(2);
T* link3 = new T(3);
list.append(*link1);
list.append(*link2);
list.append(*link3);
ForwardListIterator<ISList<T>, T> it = list.begin();
for(int i = 0; it != list.end(); ++it, i++) {
cout << "list["<<i<<"]="<<*((*it)->get_info()) << endl;
}
cout << "List Size:" << list.get_size() << endl;
delete_slist<_SLink<circular> >(list.get_head(), list.get_tail());
}
template <typename T, bool circular>
void list_test_slist() {
SList<T> list;
T* link1 = new T(1);
T* link2 = new T(2);
T* link3 = new T(3);
T* link4 = new T(4);
T* link5 = new T(5);
T* link6 = new T(6);
list.insert(*link4);
list.append(*link1);
list.append(*link2);
list.append(*link3);
list.insert(*link5);
list.insert(*link6, 4);
//print_list<typename SList<T>::AnchorType,
// circular>((typename SList<T>::AnchorType *)list.get_head());
ForwardListIterator<SList<T>, typename SList<T>::AnchorType> it = list.begin();
for(int i = 0; it != list.end(); ++it, i++) {
cout << "list["<<i<<"]="<<*(*it)->get_info()->get_info() << endl;
}
cout << "List Size:" << list.get_size() << endl;
delete_slist<_SLink<circular> >(list.get_head(), list.get_tail());
delete link1;
delete link2;
delete link3;
delete link4;
delete link5;
delete link6;
}
int list_test_main (int argc, const char **argv) {
cout << "**Test SLink : " << endl;
list_test_slink<TestSLink>();
cout << "**Test TLink(SLink) : " << endl;
list_test_slink<TLink<int, SLink>, false>();
cout << "**Test SLink Circular : " << endl;
list_test_slink<TestSLinkCircular, true>();
cout << "**Test TLink(SLink) Circular : " << endl;
list_test_slink<TLink<int, CSLink >, true>();
cout << "**Test DLink : " << endl;
list_test_dlink<TestDLink>();
cout << "**Test TLink(DLink) : " << endl;
list_test_dlink<TLink<int, DLink > >();
cout << "**Test DLink Circular : " << endl;
list_test_dlink<TestDLinkCircular, true>();
cout << "**Test TLink(DLink) Circular : " << endl;
list_test_dlink<TLink<int, CDLink >, true>();
cout << "**Test ListBase : " << endl;
list_test_listbase< TLink<int, SLink>, SLink, false>();
cout << "**Test ISList : " << endl;
list_test_islist<TestSLink, false>();
cout << "**Test SList : " << endl;
list_test_slist<TestObject, false>();
cout << "**Test IDList : " << endl;
list_test_islist<TestSLink, false>();
cout << "**Test DList : " << endl;
list_test_slist<TestObject, false>();
default_random_engine generator;
uniform_int_distribution<unsigned> distribution;
for(int i = 0; i < 5; i++) {
cout << distribution(generator) << endl;
}
Hash<int, int>* h = new Hash<int, int>(10);
h->put(5, 5);
int* x = h->get(5);
if(x)
cout << *x << endl;
else
cout << "nullptr" << endl;
delete h;
return 0;
}
| 22.297546
| 81
| 0.611226
|
goffersoft
|
db13a485217853846037c5cf0abe04d63cbc07b9
| 33,987
|
cpp
|
C++
|
src/frameworks/av/media/libstagefright/codecs/m4v_h263/dec/src/vlc_dequant.cpp
|
dAck2cC2/m3e
|
475b89b59d5022a94e00b636438b25e27e4eaab2
|
[
"Apache-2.0"
] | 10
|
2020-04-17T04:02:36.000Z
|
2021-11-23T11:38:42.000Z
|
src/frameworks/av/media/libstagefright/codecs/m4v_h263/dec/src/vlc_dequant.cpp
|
dAck2cC2/m3e
|
475b89b59d5022a94e00b636438b25e27e4eaab2
|
[
"Apache-2.0"
] | 3
|
2020-02-19T16:53:25.000Z
|
2021-04-29T07:28:40.000Z
|
src/frameworks/av/media/libstagefright/codecs/m4v_h263/dec/src/vlc_dequant.cpp
|
dAck2cC2/m3e
|
475b89b59d5022a94e00b636438b25e27e4eaab2
|
[
"Apache-2.0"
] | 5
|
2019-12-25T04:05:02.000Z
|
2022-01-14T16:57:55.000Z
|
/* ------------------------------------------------------------------
* Copyright (C) 1998-2009 PacketVideo
*
* 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.
* -------------------------------------------------------------------
*/
#include "mp4dec_lib.h"
#include "vlc_decode.h"
#include "zigzag.h"
typedef PV_STATUS(*VlcDecFuncP)(BitstreamDecVideo *stream, Tcoef *pTcoef);
static const uint8 AC_rowcol[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1,
};
static const uint8 mask[8] = /* for fast bitmap */
{128, 64, 32, 16, 8, 4, 2, 1};
/***********************************************************CommentBegin******
*
* -- VlcDequantMpegBlock -- Decodes the DCT coefficients of one 8x8 block and perform
dequantization using Mpeg mode.
Date: 08/08/2000
Modified: 3/21/01
Added pre IDCT clipping, new ACDC prediction structure, ACDC prediction clipping,
16-bit int case, removed multiple zigzaging
******************************************************************************/
#ifdef PV_SUPPORT_MAIN_PROFILE
int VlcDequantMpegIntraBlock(void *vid, int comp, int switched,
uint8 *bitmapcol, uint8 *bitmaprow)
{
VideoDecData *video = (VideoDecData*) vid;
Vol *currVol = video->vol[video->currLayer];
BitstreamDecVideo *stream = video->bitstream;
int16 *datablock = video->mblock->block[comp]; /* 10/20/2000, assume it has been reset of all-zero !!!*/
int mbnum = video->mbnum;
uint CBP = video->headerInfo.CBP[mbnum];
int QP = video->QPMB[mbnum];
typeDCStore *DC = video->predDC + mbnum;
int x_pos = video->mbnum_col;
typeDCACStore *DCAC_row = video->predDCAC_row + x_pos;
typeDCACStore *DCAC_col = video->predDCAC_col;
uint ACpred_flag = (uint) video->acPredFlag[mbnum];
/*** VLC *****/
int i, j, k;
Tcoef run_level;
int last, return_status;
VlcDecFuncP vlcDecCoeff;
int direction;
const int *inv_zigzag;
/*** Quantizer ****/
int dc_scaler;
int sum;
int *qmat;
int32 temp;
const int B_Xtab[6] = {0, 1, 0, 1, 2, 3};
const int B_Ytab[6] = {0, 0, 1, 1, 2, 3};
int16 *dcac_row, *dcac_col;
dcac_row = (*DCAC_row)[B_Xtab[comp]];
dcac_col = (*DCAC_col)[B_Ytab[comp]];
i = 1 - switched;
#ifdef FAST_IDCT
*((uint32*)bitmapcol) = *((uint32*)(bitmapcol + 4)) = 0;
*bitmaprow = 0;
#endif
/* select which Huffman table to be used */
vlcDecCoeff = video->vlcDecCoeffIntra;
dc_scaler = (comp < 4) ? video->mblock->DCScalarLum : video->mblock->DCScalarChr;
/* enter the zero run decoding loop */
sum = 0;
qmat = currVol->iqmat;
/* perform only VLC decoding */
/* We cannot do DCACrecon before VLC decoding. 10/17/2000 */
doDCACPrediction(video, comp, datablock, &direction);
if (!ACpred_flag) direction = 0;
inv_zigzag = zigzag_inv + (ACpred_flag << 6) + (direction << 6);
if (CBP & (1 << (5 - comp)))
{
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = VLC_ERROR;
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
/* i = NCOEFF_BLOCK; */ /* 11/1/00 */
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
i = VLC_NO_LAST_BIT;
last = 1;
break;
}
k = inv_zigzag[i];
if (run_level.sign == 1)
{
datablock[k] -= run_level.level;
}
else
{
datablock[k] += run_level.level;
}
if (AC_rowcol[k])
{
temp = (int32)datablock[k] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3;
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int) temp;
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
sum ^= temp;
}
i++;
}
while (!last);
}
else
{
i = 1; /* 04/26/01 needed for switched case */
}
///// NEED TO DEQUANT THOSE PREDICTED AC COEFF
/* dequantize the rest of AC predicted coeff that haven't been dequant */
if (ACpred_flag)
{
i = NCOEFF_BLOCK; /* otherwise, FAST IDCT won't work correctly, 10/18/2000 */
if (!direction) /* check vertical */
{
dcac_row[0] = datablock[1];
dcac_row[1] = datablock[2];
dcac_row[2] = datablock[3];
dcac_row[3] = datablock[4];
dcac_row[4] = datablock[5];
dcac_row[5] = datablock[6];
dcac_row[6] = datablock[7];
for (j = 0, k = 8; k < 64; k += 8, j++)
{
if (dcac_col[j] = datablock[k])
{ /* ACDC clipping 03/26/01 */
if (datablock[k] > 2047) dcac_col[j] = 2047;
else if (datablock[k] < -2048) dcac_col[j] = -2048;
temp = (int32)dcac_col[j] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01*/
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp; /* 7/5/01 */
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
for (k = 1; k < 8; k++)
{
if (datablock[k])
{
temp = (int32)datablock[k] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01*/
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp; /* 7/5/01 */
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
}
else
{
dcac_col[0] = datablock[8];
dcac_col[1] = datablock[16];
dcac_col[2] = datablock[24];
dcac_col[3] = datablock[32];
dcac_col[4] = datablock[40];
dcac_col[5] = datablock[48];
dcac_col[6] = datablock[56];
for (j = 0, k = 1; k < 8; k++, j++)
{
if (dcac_row[j] = datablock[k])
{ /* ACDC clipping 03/26/01 */
if (datablock[k] > 2047) dcac_row[j] = 2047;
else if (datablock[k] < -2048) dcac_row[j] = -2048;
temp = (int32)dcac_row[j] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01 */
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp;
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
for (k = 8; k < 64; k += 8)
{
if (datablock[k])
{
temp = (int32)datablock[k] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01 */
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp;
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
}
}
else
{
/* Store the qcoeff-values needed later for prediction */
dcac_row[0] = datablock[1]; /* ACDC, no need for clipping */
dcac_row[1] = datablock[2];
dcac_row[2] = datablock[3];
dcac_row[3] = datablock[4];
dcac_row[4] = datablock[5];
dcac_row[5] = datablock[6];
dcac_row[6] = datablock[7];
dcac_col[0] = datablock[8];
dcac_col[1] = datablock[16];
dcac_col[2] = datablock[24];
dcac_col[3] = datablock[32];
dcac_col[4] = datablock[40];
dcac_col[5] = datablock[48];
dcac_col[6] = datablock[56];
for (k = 1; k < 8; k++)
{
if (datablock[k])
{
temp = (int32)datablock[k] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01*/
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp; /* 7/5/01 */
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
for (k = 8; k < 64; k += 8)
{
if (datablock[k])
{
temp = (int32)datablock[k] * qmat[k] * QP;
temp = (temp + (0x7 & (temp >> 31))) >> 3; /* 03/26/01 */
if (temp > 2047) temp = 2047;
else if (temp < -2048) temp = -2048;
datablock[k] = (int)temp;
sum ^= temp;
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
}
if (datablock[0])
{
temp = (int32)datablock[0] * dc_scaler;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[0] = (int)temp;
sum ^= temp;
#ifdef FAST_IDCT
bitmapcol[0] |= 128;
#endif
}
if ((sum & 1) == 0)
{
datablock[63] = datablock[63] ^ 0x1;
#ifdef FAST_IDCT /* 7/5/01, need to update bitmap */
if (datablock[63])
bitmapcol[7] |= 1;
#endif
i = (-64 & i) | NCOEFF_BLOCK; /* if i > -1 then i is set to NCOEFF_BLOCK */
}
#ifdef FAST_IDCT
if (i > 10)
{
for (k = 1; k < 4; k++)
{
if (bitmapcol[k] != 0)
{
(*bitmaprow) |= mask[k];
}
}
}
#endif
/* Store the qcoeff-values needed later for prediction */
(*DC)[comp] = datablock[0];
return i;
}
/***********************************************************CommentBegin******
*
* -- VlcDequantMpegInterBlock -- Decodes the DCT coefficients of one 8x8 block and perform
dequantization using Mpeg mode for INTER block.
Date: 08/08/2000
Modified: 3/21/01
clean up, added clipping, 16-bit int case, new ACDC prediction
******************************************************************************/
int VlcDequantMpegInterBlock(void *vid, int comp,
uint8 *bitmapcol, uint8 *bitmaprow)
{
VideoDecData *video = (VideoDecData*) vid;
BitstreamDecVideo *stream = video->bitstream;
Vol *currVol = video->vol[video->currLayer];
int16 *datablock = video->mblock->block[comp]; /* 10/20/2000, assume it has been reset of all-zero !!!*/
int mbnum = video->mbnum;
int QP = video->QPMB[mbnum];
/*** VLC *****/
int i, k;
Tcoef run_level;
int last, return_status;
VlcDecFuncP vlcDecCoeff;
/*** Quantizer ****/
int sum;
int *qmat;
int32 temp;
i = 0 ;
#ifdef FAST_IDCT
*((uint32*)bitmapcol) = *((uint32*)(bitmapcol + 4)) = 0;
*bitmaprow = 0;
#endif
/* select which Huffman table to be used */
vlcDecCoeff = video->vlcDecCoeffInter;
/* enter the zero run decoding loop */
sum = 0;
qmat = currVol->niqmat;
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = VLC_ERROR;
sum = 1; /* no of coefficients should not get reset 03/07/2002 */
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
/* i = NCOEFF_BLOCK; */ /* 11/1/00 */
//return VLC_NO_LAST_BIT;
i = VLC_NO_LAST_BIT;
last = 1;
sum = 1; /* no of coefficients should not get reset 03/07/2002 */
break;
}
k = zigzag_inv[i];
if (run_level.sign == 1)
{
temp = (-(int32)(2 * run_level.level + 1) * qmat[k] * QP + 15) >> 4; /* 03/23/01 */
if (temp < -2048) temp = - 2048;
}
else
{
temp = ((int32)(2 * run_level.level + 1) * qmat[k] * QP) >> 4; /* 03/23/01 */
if (temp > 2047) temp = 2047;
}
datablock[k] = (int)temp;
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
sum ^= temp;
i++;
}
while (!last);
if ((sum & 1) == 0)
{
datablock[63] = datablock[63] ^ 0x1;
#ifdef FAST_IDCT /* 7/5/01, need to update bitmap */
if (datablock[63])
bitmapcol[7] |= 1;
#endif
i = NCOEFF_BLOCK;
}
#ifdef FAST_IDCT
if (i > 10)
{
for (k = 1; k < 4; k++) /* 07/19/01 */
{
if (bitmapcol[k] != 0)
{
(*bitmaprow) |= mask[k];
}
}
}
#endif
return i;
}
#endif
/***********************************************************CommentBegin******
*
* -- VlcDequantIntraH263Block -- Decodes the DCT coefficients of one 8x8 block and perform
dequantization in H.263 mode for INTRA block.
Date: 08/08/2000
Modified: 3/21/01
clean up, added clipping, 16-bit int case, removed multiple zigzaging
******************************************************************************/
int VlcDequantH263IntraBlock(VideoDecData *video, int comp, int switched,
uint8 *bitmapcol, uint8 *bitmaprow)
{
BitstreamDecVideo *stream = video->bitstream;
int16 *datablock = video->mblock->block[comp]; /* 10/20/2000, assume it has been reset of all-zero !!!*/
int32 temp;
int mbnum = video->mbnum;
uint CBP = video->headerInfo.CBP[mbnum];
int QP = video->QPMB[mbnum];
typeDCStore *DC = video->predDC + mbnum;
int x_pos = video->mbnum_col;
typeDCACStore *DCAC_row = video->predDCAC_row + x_pos;
typeDCACStore *DCAC_col = video->predDCAC_col;
uint ACpred_flag = (uint) video->acPredFlag[mbnum];
/*** VLC *****/
int i, j, k;
Tcoef run_level;
int last, return_status;
VlcDecFuncP vlcDecCoeff;
int direction;
const int *inv_zigzag;
/*** Quantizer ****/
int dc_scaler;
int sgn_coeff;
const int B_Xtab[6] = {0, 1, 0, 1, 2, 3};
const int B_Ytab[6] = {0, 0, 1, 1, 2, 3};
int16 *dcac_row, *dcac_col;
dcac_row = (*DCAC_row)[B_Xtab[comp]];
dcac_col = (*DCAC_col)[B_Ytab[comp]];
#ifdef FAST_IDCT
*((uint32*)bitmapcol) = *((uint32*)(bitmapcol + 4)) = 0;
*bitmaprow = 0;
#endif
/* select which Huffman table to be used */
vlcDecCoeff = video->vlcDecCoeffIntra;
dc_scaler = (comp < 4) ? video->mblock->DCScalarLum : video->mblock->DCScalarChr;
/* perform only VLC decoding */
doDCACPrediction(video, comp, datablock, &direction);
if (!ACpred_flag) direction = 0;
inv_zigzag = zigzag_inv + (ACpred_flag << 6) + (direction << 6); /* 04/17/01 */
i = 1;
if (CBP & (1 << (5 - comp)))
{
i = 1 - switched;
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = VLC_ERROR;
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
i = VLC_NO_LAST_BIT;
last = 1;
break;
}
k = inv_zigzag[i];
if (run_level.sign == 1)
{
datablock[k] -= run_level.level;
sgn_coeff = -1;
}
else
{
datablock[k] += run_level.level;
sgn_coeff = 1;
}
if (AC_rowcol[k]) /* 10/25/2000 */
{
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
}
i++;
}
while (!last);
}
///// NEED TO DEQUANT THOSE PREDICTED AC COEFF
/* dequantize the rest of AC predicted coeff that haven't been dequant */
if (ACpred_flag)
{
i = NCOEFF_BLOCK; /* otherwise, FAST IDCT won't work correctly, 10/18/2000 */
if (!direction) /* check vertical */
{
dcac_row[0] = datablock[1];
dcac_row[1] = datablock[2];
dcac_row[2] = datablock[3];
dcac_row[3] = datablock[4];
dcac_row[4] = datablock[5];
dcac_row[5] = datablock[6];
dcac_row[6] = datablock[7];
for (j = 0, k = 8; k < 64; k += 8, j++)
{
dcac_col[j] = datablock[k];
if (dcac_col[j])
{
if (datablock[k] > 0)
{
if (datablock[k] > 2047) dcac_col[j] = 2047;
sgn_coeff = 1;
}
else
{
if (datablock[k] < -2048) dcac_col[j] = -2048;
sgn_coeff = -1;
}
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
for (k = 1; k < 8; k++)
{
if (datablock[k])
{
sgn_coeff = (datablock[k] > 0) ? 1 : -1;
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
}
else
{
dcac_col[0] = datablock[8];
dcac_col[1] = datablock[16];
dcac_col[2] = datablock[24];
dcac_col[3] = datablock[32];
dcac_col[4] = datablock[40];
dcac_col[5] = datablock[48];
dcac_col[6] = datablock[56];
for (j = 0, k = 1; k < 8; k++, j++)
{
dcac_row[j] = datablock[k];
if (dcac_row[j])
{
if (datablock[k] > 0)
{
if (datablock[k] > 2047) dcac_row[j] = 2047;
sgn_coeff = 1;
}
else
{
if (datablock[k] < -2048) dcac_row[j] = -2048;
sgn_coeff = -1;
}
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int) temp;
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
for (k = 8; k < 64; k += 8)
{
if (datablock[k])
{
sgn_coeff = (datablock[k] > 0) ? 1 : -1;
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
}
}
else
{
dcac_row[0] = datablock[1];
dcac_row[1] = datablock[2];
dcac_row[2] = datablock[3];
dcac_row[3] = datablock[4];
dcac_row[4] = datablock[5];
dcac_row[5] = datablock[6];
dcac_row[6] = datablock[7];
dcac_col[0] = datablock[8];
dcac_col[1] = datablock[16];
dcac_col[2] = datablock[24];
dcac_col[3] = datablock[32];
dcac_col[4] = datablock[40];
dcac_col[5] = datablock[48];
dcac_col[6] = datablock[56];
for (k = 1; k < 8; k++)
{
if (datablock[k])
{
sgn_coeff = (datablock[k] > 0) ? 1 : -1;
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[k] |= 128;
#endif
}
}
for (k = 8; k < 64; k += 8)
{
if (datablock[k])
{
sgn_coeff = (datablock[k] > 0) ? 1 : -1;
temp = (int32)QP * (2 * datablock[k] + sgn_coeff) - sgn_coeff + (QP & 1) * sgn_coeff;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[0] |= mask[k>>3];
#endif
}
}
}
if (datablock[0])
{
#ifdef FAST_IDCT
bitmapcol[0] |= 128;
#endif
temp = (int32)datablock[0] * dc_scaler;
if (temp > 2047) temp = 2047; /* 03/14/01 */
else if (temp < -2048) temp = -2048;
datablock[0] = (int16)temp;
}
#ifdef FAST_IDCT
if (i > 10)
{
for (k = 1; k < 4; k++) /* if i > 10 then k = 0 does not matter */
{
if (bitmapcol[k] != 0)
{
(*bitmaprow) |= mask[k]; /* (1<<(7-i)); */
}
}
}
#endif
/* Store the qcoeff-values needed later for prediction */
(*DC)[comp] = datablock[0];
return i;
}
int VlcDequantH263IntraBlock_SH(VideoDecData *video, int comp, uint8 *bitmapcol, uint8 *bitmaprow)
{
BitstreamDecVideo *stream = video->bitstream;
int16 *datablock = video->mblock->block[comp]; /*, 10/20/2000, assume it has been reset of all-zero !!!*/
int32 temp;
int mbnum = video->mbnum;
uint CBP = video->headerInfo.CBP[mbnum];
int16 QP = video->QPMB[mbnum];
typeDCStore *DC = video->predDC + mbnum;
int x_pos = video->mbnum_col;
typeDCACStore *DCAC_row = video->predDCAC_row + x_pos;
typeDCACStore *DCAC_col = video->predDCAC_col;
uint ACpred_flag = (uint) video->acPredFlag[mbnum];
/*** VLC *****/
int i, k;
Tcoef run_level;
int last, return_status;
VlcDecFuncP vlcDecCoeff;
#ifdef PV_ANNEX_IJKT_SUPPORT
int direction;
const int *inv_zigzag;
#endif
/*** Quantizer ****/
const int B_Xtab[6] = {0, 1, 0, 1, 2, 3};
const int B_Ytab[6] = {0, 0, 1, 1, 2, 3};
int16 *dcac_row, *dcac_col;
dcac_row = (*DCAC_row)[B_Xtab[comp]];
dcac_col = (*DCAC_col)[B_Ytab[comp]];
i = 1;
#ifdef FAST_IDCT
*((uint32*)bitmapcol) = *((uint32*)(bitmapcol + 4)) = 0;
*bitmaprow = 0;
#endif
/* select which Huffman table to be used */
vlcDecCoeff = video->vlcDecCoeffIntra;
#ifdef PV_ANNEX_IJKT_SUPPORT
if (comp > 3) /* ANNEX_T */
{
QP = video->QP_CHR;
}
if (!video->advanced_INTRA)
{
#endif
if ((CBP & (1 << (5 - comp))) == 0)
{
#ifdef FAST_IDCT
bitmapcol[0] = 128;
bitmapcol[1] = bitmapcol[2] = bitmapcol[3] = bitmapcol[4] = bitmapcol[5] = bitmapcol[6] = bitmapcol[7] = 0;
#endif
datablock[0] <<= 3; /* no need to clip */
return 1;//ncoeffs;
}
else
{
/* enter the zero run decoding loop */
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = VLC_ERROR;
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
/* i = NCOEFF_BLOCK; */ /* 11/1/00 */
i = VLC_NO_LAST_BIT;
last = 1;
break;
}
k = zigzag_inv[i];
if (run_level.sign == 0)
{
temp = (int32)QP * (2 * run_level.level + 1) - 1 + (QP & 1);
if (temp > 2047) temp = 2047;
}
else
{
temp = -(int32)QP * (2 * run_level.level + 1) + 1 - (QP & 1);
if (temp < -2048) temp = -2048;
}
datablock[k] = (int16) temp;
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
i++;
}
while (!last);
}
/* no ACDC prediction when ACDC disable */
if (datablock[0])
{
#ifdef FAST_IDCT
bitmapcol[0] |= 128;
#endif
datablock[0] <<= 3; /* no need to clip 09/18/2001 */
}
#ifdef PV_ANNEX_IJKT_SUPPORT
}
else /* advanced_INTRA mode */
{
i = 1;
doDCACPrediction_I(video, comp, datablock);
/* perform only VLC decoding */
if (!ACpred_flag)
{
direction = 0;
}
else
{
direction = video->mblock->direction;
}
inv_zigzag = zigzag_inv + (ACpred_flag << 6) + (direction << 6); /* 04/17/01 */
if (CBP & (1 << (5 - comp)))
{
i = 0;
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = VLC_ERROR;
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
/* i = NCOEFF_BLOCK; */ /* 11/1/00 */
ACpred_flag = 0; /* no of coefficients should not get reset 03/07/2002 */
i = VLC_NO_LAST_BIT;
last = 1;
break;
}
k = inv_zigzag[i];
if (run_level.sign == 0)
{
datablock[k] += (int16)QP * 2 * run_level.level;
if (datablock[k] > 2047) datablock[k] = 2047;
}
else
{
datablock[k] -= (int16)QP * 2 * run_level.level;
if (datablock[k] < -2048) datablock[k] = -2048;
}
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
i++;
}
while (!last);
}
///// NEED TO DEQUANT THOSE PREDICTED AC COEFF
/* dequantize the rest of AC predicted coeff that haven't been dequant */
if (ACpred_flag)
{
i = NCOEFF_BLOCK;
for (k = 1; k < 8; k++)
{
if (datablock[k])
{
bitmapcol[k] |= 128;
}
if (datablock[k<<3])
{
bitmapcol[0] |= mask[k];
}
}
}
dcac_row[0] = datablock[1];
dcac_row[1] = datablock[2];
dcac_row[2] = datablock[3];
dcac_row[3] = datablock[4];
dcac_row[4] = datablock[5];
dcac_row[5] = datablock[6];
dcac_row[6] = datablock[7];
dcac_col[0] = datablock[8];
dcac_col[1] = datablock[16];
dcac_col[2] = datablock[24];
dcac_col[3] = datablock[32];
dcac_col[4] = datablock[40];
dcac_col[5] = datablock[48];
dcac_col[6] = datablock[56];
if (datablock[0])
{
#ifdef FAST_IDCT
bitmapcol[0] |= 128;
#endif
datablock[0] |= 1;
if (datablock[0] < 0)
{
datablock[0] = 0;
}
}
}
#endif
#ifdef FAST_IDCT
if (i > 10)
{
for (k = 1; k < 4; k++) /* if i > 10 then k = 0 does not matter */
{
if (bitmapcol[k] != 0)
{
(*bitmaprow) |= mask[k]; /* (1<<(7-i)); */
}
}
}
#endif
/* Store the qcoeff-values needed later for prediction */
(*DC)[comp] = datablock[0];
return i;
}
/***********************************************************CommentBegin******
*
* -- VlcDequantInterH263Block -- Decodes the DCT coefficients of one 8x8 block and perform
dequantization in H.263 mode for INTER block.
Date: 08/08/2000
Modified: 3/21/01
clean up, added clipping, 16-bit int case
******************************************************************************/
int VlcDequantH263InterBlock(VideoDecData *video, int comp,
uint8 *bitmapcol, uint8 *bitmaprow)
{
BitstreamDecVideo *stream = video->bitstream;
int16 *datablock = video->mblock->block[comp]; /* 10/20/2000, assume it has been reset of all-zero !!!*/
int32 temp;
int mbnum = video->mbnum;
int QP = video->QPMB[mbnum];
/*** VLC *****/
int i, k;
Tcoef run_level;
int last, return_status;
VlcDecFuncP vlcDecCoeff;
/*** Quantizer ****/
i = 0;
#ifdef FAST_IDCT
*((uint32*)bitmapcol) = *((uint32*)(bitmapcol + 4)) = 0;
*bitmaprow = 0;
#endif
/* select which Huffman table to be used */
vlcDecCoeff = video->vlcDecCoeffInter;
/* enter the zero run decoding loop */
do
{
return_status = (*vlcDecCoeff)(stream, &run_level);
if (return_status != PV_SUCCESS)
{
last = 1;/* 11/1/2000 let it slips undetected, just like
in original version */
i = -1;
break;
}
i += run_level.run;
last = run_level.last;
if (i >= 64)
{
i = -1;
last = 1;
break;
}
if (run_level.sign == 0)
{
temp = (int32)QP * (2 * run_level.level + 1) - 1 + (QP & 1);
if (temp > 2047) temp = 2047;
}
else
{
temp = -(int32)QP * (2 * run_level.level + 1) + 1 - (QP & 1);
if (temp < -2048) temp = -2048;
}
k = zigzag_inv[i];
datablock[k] = (int16)temp;
#ifdef FAST_IDCT
bitmapcol[k&0x7] |= mask[k>>3];
#endif
i++;
}
while (!last);
#ifdef FAST_IDCT
if (i > 10) /* 07/19/01 */
{
for (k = 1; k < 4; k++) /* if (i > 10 ) k = 0 does not matter */
{
if (bitmapcol[k] != 0)
{
(*bitmaprow) |= mask[k]; /* (1<<(7-i)); */
}
}
}
#endif
return i;
}
| 29.477016
| 119
| 0.439962
|
dAck2cC2
|
db141373f0c94f5b029ca75c6c172b3fd25ba2fa
| 1,063
|
cpp
|
C++
|
lib/src/adschain/crypto/PrivateKeyPrime256v1.cpp
|
apastor/ads-chain-cpp-library
|
323d9c731f14031532dc072703d24e237d0a252e
|
[
"Apache-2.0"
] | 2
|
2020-05-15T11:45:13.000Z
|
2020-05-20T17:26:43.000Z
|
lib/src/adschain/crypto/PrivateKeyPrime256v1.cpp
|
apastor/ads-chain-cpp-library
|
323d9c731f14031532dc072703d24e237d0a252e
|
[
"Apache-2.0"
] | null | null | null |
lib/src/adschain/crypto/PrivateKeyPrime256v1.cpp
|
apastor/ads-chain-cpp-library
|
323d9c731f14031532dc072703d24e237d0a252e
|
[
"Apache-2.0"
] | null | null | null |
#include <iostream>
#include <openssl/evp.h>
#include <openssl/ec.h>
#include "adschain/crypto/PrivateKey.h"
namespace adschain {
class PrivateKeyPrime256v1 : public PrivateKey {
public:
INJECT(PrivateKeyPrime256v1()) {
EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
if (!key) {
throw std::runtime_error("EC_KEY initialization error");
}
EC_KEY_set_asn1_flag(key, OPENSSL_EC_NAMED_CURVE);
if (EC_KEY_generate_key(key) != 1) {
EC_KEY_free(key);
throw std::runtime_error("error generating key pair");
}
if (EC_KEY_check_key(key) != 1) {
EC_KEY_free(key);
throw std::runtime_error("error validating ec_key");
}
pKeyPtr = EVP_PKEY_new();
if (EVP_PKEY_assign_EC_KEY(pKeyPtr, key) != 1) {
EC_KEY_free(key);
throw std::runtime_error("error assigning key to EVP_PKEY struct");
}
}
};
fruit::Component<PrivateKey> getPrivateKeyPrime256v1Component() {
return fruit::createComponent()
.bind<PrivateKey, PrivateKeyPrime256v1>();
}
} // namespace adschain
| 27.25641
| 73
| 0.69238
|
apastor
|
db16cfe3b10c0f2800e9ffcbd792836dfc8d3f54
| 9,078
|
cpp
|
C++
|
test/tests/cpu/instructions/sbc.cpp
|
SteelCityKeyPuncher/nesturbia
|
a98a5d52ec2b508f64075933020bd64f584690b2
|
[
"MIT"
] | null | null | null |
test/tests/cpu/instructions/sbc.cpp
|
SteelCityKeyPuncher/nesturbia
|
a98a5d52ec2b508f64075933020bd64f584690b2
|
[
"MIT"
] | null | null | null |
test/tests/cpu/instructions/sbc.cpp
|
SteelCityKeyPuncher/nesturbia
|
a98a5d52ec2b508f64075933020bd64f584690b2
|
[
"MIT"
] | null | null | null |
#include <array>
#include <cstdint>
#include "catch2/catch_all.hpp"
#include "nesturbia/cpu.hpp"
using namespace nesturbia;
TEST_CASE("Cpu_Instructions_SBC_inx", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xbeef](0xf0) - !C(1) = 0x60
memory[0x00] = 0xe1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 6);
// SBC: A(0x50) - [0xbeef](0xb0) - !C(0) = 0x9f
memory[0x00] = 0xe1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0xb0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = false;
cpu.executeInstruction();
CHECK(cpu.A == 0x9f);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == true);
CHECK(cpu.P.N == true);
CHECK(cpu.cycles == 7 + 6);
// SBC: A(0x50) - [0xbeef](0x30) - !C(1) = 0x20
memory[0x00] = 0xe1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0x30;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x20);
CHECK(cpu.P.C == true);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 6);
// SBC: A(0x50) - [0xbeef](0x50) - !C(1) = 0x00
memory[0x00] = 0xe1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0x50;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x00);
CHECK(cpu.P.C == true);
CHECK(cpu.P.Z == true);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 6);
// SBC: A(0x50) - [0xbeef](0x60) - !C(1) = 0xf0
memory[0x00] = 0xe1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0x60;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0xf0);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == true);
CHECK(cpu.cycles == 7 + 6);
}
TEST_CASE("Cpu_Instructions_SBC_zpg", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xab](0xf0) - !C(1) = 0x60
memory[0x00] = 0xe5;
memory[0x01] = 0xab;
memory[0xab] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 3);
}
TEST_CASE("Cpu_Instructions_SBC_imm", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - imm(0xf0) - !C(1) = 0x60
memory[0x00] = 0xe9;
memory[0x01] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 2);
}
TEST_CASE("Cpu_Instructions_SBC_abs", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xbeef](0xf0) - !C(1) = 0x60
memory[0x00] = 0xed;
memory[0x01] = 0xef;
memory[0x02] = 0xbe;
memory[0xbeef] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 4);
}
TEST_CASE("Cpu_Instructions_SBC_iny", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xbeef + Y(0)](0xf0) - !C(1) = 0x60
memory[0x00] = 0xf1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeef] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 5);
// SBC: A(0x50) - [0xbeef + Y(0x10)](0xf0) - !C(1) = 0x60
memory[0x00] = 0xf1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbeff] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.Y = 0x10;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 5);
// SBC: A(0x50) - [0xbeef + Y(0x40)](0xf0) - !C(1) = 0x60
// Tests page crossing (extra cycle)
memory[0x00] = 0xf1;
memory[0x01] = 0xab;
memory[0xab] = 0xef;
memory[0xac] = 0xbe;
memory[0xbf2f] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.Y = 0x40;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 6);
}
TEST_CASE("Cpu_Instructions_SBC_zpx", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xab + X(3)](0xf0) - !C(1) = 0x60
memory[0x00] = 0xf5;
memory[0x01] = 0xab;
memory[0xae] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.X = 0x03;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 4);
}
TEST_CASE("Cpu_Instructions_SBC_aby", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xbeef + Y(3)](0xf0) - !C(1) = 0x60
memory[0x00] = 0xf9;
memory[0x01] = 0xef;
memory[0x02] = 0xbe;
memory[0xbef2] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.Y = 0x03;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 4);
// SBC: A(0x50) - [0xbeef + Y(0x11)](0xf0) - !C(1) = 0x60
// Tests page crossing (extra cycle)
memory[0x00] = 0xf9;
memory[0x01] = 0xef;
memory[0x02] = 0xbe;
memory[0xbf00] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.Y = 0x11;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 5);
}
TEST_CASE("Cpu_Instructions_SBC_abx", "[cpu]") {
std::array<uint8_t, 0x10000> memory = {};
auto read = [&memory](uint16_t address) { return memory.at(address); };
auto write = [&memory](uint16_t address, uint8_t value) { memory.at(address) = value; };
Cpu cpu(read, write, [] {});
// SBC: A(0x50) - [0xbeef + X(3)](0xf0) - !C(0) = 0x60
memory[0x00] = 0xfd;
memory[0x01] = 0xef;
memory[0x02] = 0xbe;
memory[0xbef2] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.X = 0x03;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 4);
// SBC: A(0x50) - [0xbeef + X(0x11)](0xf0) - !C(0) = 0x60
// Tests page crossing (extra cycle)
memory[0x00] = 0xfd;
memory[0x01] = 0xef;
memory[0x02] = 0xbe;
memory[0xbf00] = 0xf0;
cpu.Power();
cpu.A = 0x50;
cpu.P.C = true;
cpu.X = 0x11;
cpu.executeInstruction();
CHECK(cpu.A == 0x60);
CHECK(cpu.P.C == false);
CHECK(cpu.P.Z == false);
CHECK(cpu.P.V == false);
CHECK(cpu.P.N == false);
CHECK(cpu.cycles == 7 + 5);
}
| 20.773455
| 90
| 0.583719
|
SteelCityKeyPuncher
|
db1e7088a74f839d3db98672f0a3b38c86dbc9b5
| 4,343
|
cc
|
C++
|
test/extensions/filters/http/nats/streaming/metadata_subject_retriever_test.cc
|
sirajmansour/envoy-nats-streaming
|
d7ccd15f474e822ba14c62172e352c4fe8d9701e
|
[
"Apache-2.0"
] | 27
|
2018-03-26T22:22:13.000Z
|
2021-09-01T17:44:45.000Z
|
test/extensions/filters/http/nats/streaming/metadata_subject_retriever_test.cc
|
sirajmansour/envoy-nats-streaming
|
d7ccd15f474e822ba14c62172e352c4fe8d9701e
|
[
"Apache-2.0"
] | 9
|
2018-03-28T06:49:32.000Z
|
2018-09-19T04:08:02.000Z
|
test/extensions/filters/http/nats/streaming/metadata_subject_retriever_test.cc
|
sirajmansour/envoy-nats-streaming
|
d7ccd15f474e822ba14c62172e352c4fe8d9701e
|
[
"Apache-2.0"
] | 6
|
2018-03-27T06:45:25.000Z
|
2021-02-18T07:16:45.000Z
|
#include <iostream>
#include "envoy/http/metadata_accessor.h"
#include "common/config/nats_streaming_well_known_names.h"
#include "common/protobuf/utility.h"
#include "extensions/filters/http/nats/streaming/metadata_subject_retriever.h"
#include "test/test_common/utility.h"
#include "fmt/format.h"
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace Nats {
namespace Streaming {
namespace {
const std::string empty_json = R"EOF(
{
}
)EOF";
// TODO(talnordan): Move this to `mocks/http/filter`.
class TesterMetadataAccessor : public Http::MetadataAccessor {
public:
virtual absl::optional<const std::string *> getFunctionName() const {
if (!function_name_.empty()) {
return &function_name_;
}
return {};
}
virtual absl::optional<const ProtobufWkt::Struct *> getFunctionSpec() const {
if (function_spec_.has_value()) {
return &function_spec_.value();
}
return {};
}
virtual absl::optional<const ProtobufWkt::Struct *>
getClusterMetadata() const {
if (cluster_metadata_.has_value()) {
return &cluster_metadata_.value();
}
return {};
}
virtual absl::optional<const ProtobufWkt::Struct *> getRouteMetadata() const {
if (route_metadata_.has_value()) {
return &route_metadata_.value();
}
return {};
}
std::string function_name_;
absl::optional<ProtobufWkt::Struct> function_spec_;
absl::optional<ProtobufWkt::Struct> cluster_metadata_;
absl::optional<ProtobufWkt::Struct> route_metadata_;
};
ProtobufWkt::Struct getMetadata(const std::string &json) {
ProtobufWkt::Struct metadata;
MessageUtil::loadFromJson(json, metadata);
return metadata;
}
TesterMetadataAccessor
getMetadataAccessor(const std::string &function_name,
const ProtobufWkt::Struct &func_metadata,
const ProtobufWkt::Struct &cluster_metadata,
const ProtobufWkt::Struct &route_metadata) {
TesterMetadataAccessor testaccessor;
testaccessor.function_name_ = function_name;
testaccessor.function_spec_ = func_metadata;
testaccessor.cluster_metadata_ = cluster_metadata;
testaccessor.route_metadata_ = route_metadata;
return testaccessor;
}
TesterMetadataAccessor getMetadataAccessorFromJson(
const std::string &function_name, const std::string &func_json,
const std::string &cluster_json, const std::string &route_json) {
auto func_metadata = getMetadata(func_json);
auto cluster_metadata = getMetadata(cluster_json);
auto route_metadata = getMetadata(route_json);
return getMetadataAccessor(function_name, func_metadata, cluster_metadata,
route_metadata);
}
} // namespace
TEST(MetadataSubjectRetrieverTest, EmptyJsonAndNoFunctions) {
const std::string function_name = "";
const std::string &func_json = empty_json;
const std::string &cluster_json = empty_json;
const std::string &route_json = empty_json;
auto metadata_accessor =
getMetadataAccessorFromJson("", func_json, cluster_json, route_json);
MetadataSubjectRetriever subjectRetriever;
auto subject = subjectRetriever.getSubject(metadata_accessor);
EXPECT_FALSE(subject.has_value());
}
TEST(MetadataSubjectRetrieverTest, ConfiguredSubject) {
const std::string configuredSubject = "Subject1";
const std::string func_json = empty_json;
const std::string cluster_json_template = R"EOF(
{{
"{}": "ci",
"{}": "dp",
}}
)EOF";
const std::string cluster_json =
fmt::format(cluster_json_template,
Config::MetadataNatsStreamingKeys::get().CLUSTER_ID,
Config::MetadataNatsStreamingKeys::get().DISCOVER_PREFIX);
const std::string route_json = empty_json;
auto metadata_accessor = getMetadataAccessorFromJson(
configuredSubject, func_json, cluster_json, route_json);
MetadataSubjectRetriever subjectRetriever;
auto maybe_actual_subject = subjectRetriever.getSubject(metadata_accessor);
ASSERT_TRUE(maybe_actual_subject.has_value());
auto actual_subject = maybe_actual_subject.value();
EXPECT_EQ(*actual_subject.subject, configuredSubject);
EXPECT_EQ(*actual_subject.cluster_id, "ci");
EXPECT_EQ(*actual_subject.discover_prefix, "dp");
}
} // namespace Streaming
} // namespace Nats
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
| 29.147651
| 80
| 0.732904
|
sirajmansour
|
db1eddcfa11d8bbc7ea9189a887c1362d49b78a3
| 4,172
|
cpp
|
C++
|
libs/qCC_io/LASFields.cpp
|
ohanlonl/qCMAT
|
f6ca04fa7c171629f094ee886364c46ff8b27c0b
|
[
"BSD-Source-Code"
] | null | null | null |
libs/qCC_io/LASFields.cpp
|
ohanlonl/qCMAT
|
f6ca04fa7c171629f094ee886364c46ff8b27c0b
|
[
"BSD-Source-Code"
] | null | null | null |
libs/qCC_io/LASFields.cpp
|
ohanlonl/qCMAT
|
f6ca04fa7c171629f094ee886364c46ff8b27c0b
|
[
"BSD-Source-Code"
] | 1
|
2019-02-03T12:19:42.000Z
|
2019-02-03T12:19:42.000Z
|
//##########################################################################
//# #
//# CLOUDCOMPARE #
//# #
//# This program is free software; you can redistribute it and/or modify #
//# it under the terms of the GNU General Public License as published by #
//# the Free Software Foundation; version 2 or later of the License. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU General Public License for more details. #
//# #
//# COPYRIGHT: CloudCompare project #
//# #
//##########################################################################
#include "LASFields.h"
//qCC_db
#include <ccPointCloud.h>
#include <ccScalarField.h>
LasField::LasField( LAS_FIELDS fieldType/*=LAS_INVALID*/,
double defaultVal/*=0*/,
double min/*=0.0*/,
double max/*=-1.0*/)
: type(fieldType)
, sf(0)
, firstValue(0.0)
, minValue(min)
, maxValue(max)
, defaultValue(defaultVal)
{}
bool LasField::GetLASFields(ccPointCloud* cloud, std::vector<LasField>& fieldsToSave)
{
try
{
//official LAS fields
std::vector<LasField> lasFields;
lasFields.reserve(14);
{
lasFields.emplace_back(LAS_CLASSIFICATION, 0, 0, 255); //unsigned char: between 0 and 255
lasFields.emplace_back(LAS_CLASSIF_VALUE, 0, 0, 31); //5 bits: between 0 and 31
lasFields.emplace_back(LAS_CLASSIF_SYNTHETIC, 0, 0, 1); //1 bit: 0 or 1
lasFields.emplace_back(LAS_CLASSIF_KEYPOINT, 0, 0, 1); //1 bit: 0 or 1
lasFields.emplace_back(LAS_CLASSIF_WITHHELD, 0, 0, 1); //1 bit: 0 or 1
lasFields.emplace_back(LAS_INTENSITY, 0, 0, 65535); //16 bits: between 0 and 65536
lasFields.emplace_back(LAS_TIME, 0, 0, -1.0); //8 bytes (double)
lasFields.emplace_back(LAS_RETURN_NUMBER, 1, 1, 7); //3 bits: between 1 and 7
lasFields.emplace_back(LAS_NUMBER_OF_RETURNS, 1, 1, 7); //3 bits: between 1 and 7
lasFields.emplace_back(LAS_SCAN_DIRECTION, 0, 0, 1); //1 bit: 0 or 1
lasFields.emplace_back(LAS_FLIGHT_LINE_EDGE, 0, 0, 1); //1 bit: 0 or 1
lasFields.emplace_back(LAS_SCAN_ANGLE_RANK, 0, -90, 90); //signed char: between -90 and +90
lasFields.emplace_back(LAS_USER_DATA, 0, 0, 255); //unsigned char: between 0 and 255
lasFields.emplace_back(LAS_POINT_SOURCE_ID, 0, 0, 65535); //16 bits: between 0 and 65536
}
//we are going to check now the existing cloud SFs
for (unsigned i = 0; i < cloud->getNumberOfScalarFields(); ++i)
{
ccScalarField* sf = static_cast<ccScalarField*>(cloud->getScalarField(i));
//find an equivalent in official LAS fields
QString sfName = QString(sf->getName()).toUpper();
bool outBounds = false;
for (size_t j = 0; j < lasFields.size(); ++j)
{
//if the name matches
if (sfName == lasFields[j].getName().toUpper())
{
//check bounds
double sfMin = sf->getGlobalShift() + sf->getMax();
double sfMax = sf->getGlobalShift() + sf->getMax();
if (sfMin < lasFields[j].minValue || (lasFields[j].maxValue != -1.0 && sfMax > lasFields[j].maxValue)) //outbounds?
{
ccLog::Warning(QString("[LAS] Found a '%1' scalar field, but its values outbound LAS specifications (%2-%3)...").arg(sf->getName()).arg(lasFields[j].minValue).arg(lasFields[j].maxValue));
outBounds = true;
}
else
{
//we add the SF to the list of saved fields
fieldsToSave.push_back(lasFields[j]);
fieldsToSave.back().sf = sf;
}
break;
}
}
}
}
catch (const std::bad_alloc&)
{
ccLog::Warning("[LasField::GetLASFields] Not enough memory");
return false;
}
return true;
}
| 42.141414
| 193
| 0.565676
|
ohanlonl
|
db20f5f7f23a4174e98ccedee3acaa899731e3d1
| 962
|
cpp
|
C++
|
3space/src/content/dts/renderable_shape_factory.cpp
|
gifted-nguvu/darkstar-dts-converter
|
aa17a751a9f3361ca9bbb400ee4c9516908d1297
|
[
"MIT"
] | 2
|
2020-03-18T18:23:27.000Z
|
2020-08-02T15:59:16.000Z
|
3space/src/content/dts/renderable_shape_factory.cpp
|
gifted-nguvu/darkstar-dts-converter
|
aa17a751a9f3361ca9bbb400ee4c9516908d1297
|
[
"MIT"
] | 5
|
2019-07-07T16:47:47.000Z
|
2020-08-10T16:20:00.000Z
|
3space/src/content/dts/renderable_shape_factory.cpp
|
gifted-nguvu/darkstar-dts-converter
|
aa17a751a9f3361ca9bbb400ee4c9516908d1297
|
[
"MIT"
] | 1
|
2020-03-18T18:23:30.000Z
|
2020-03-18T18:23:30.000Z
|
#include "content/dts/darkstar.hpp"
#include "content/dts/3space.hpp"
#include "content/dts/dts_renderable_shape.hpp"
#include "content/dts/3space_renderable_shape.hpp"
#include "content/dts/null_renderable_shape.hpp"
namespace studio::content::dts
{
std::unique_ptr<content::renderable_shape> make_shape(std::basic_istream<std::byte>& shape_stream)
{
if (content::dts::darkstar::is_darkstar_dts(shape_stream))
{
return std::make_unique<darkstar::dts_renderable_shape>(content::dts::darkstar::read_shape(shape_stream, std::nullopt));
}
if (content::dts::three_space::v1::is_3space_dts(shape_stream))
{
auto shapes = content::dts::three_space::v1::read_shapes(shape_stream);
if (shapes.empty())
{
return std::make_unique<null_renderable_shape>();
}
return std::make_unique<three_space::dts_renderable_shape>(shapes.front());
}
return std::make_unique<null_renderable_shape>();
}
}
| 32.066667
| 126
| 0.719335
|
gifted-nguvu
|
db251c305f4ab8387be0988a4f5029fbac21de56
| 1,280
|
cpp
|
C++
|
atcoder/abc021/C/main.cpp
|
xirc/cp-algorithm
|
89c67cff2f00459c5bb020ab44bff5ae419a1728
|
[
"Apache-2.0"
] | 8
|
2020-12-23T07:54:53.000Z
|
2021-11-23T02:46:35.000Z
|
atcoder/abc021/C/main.cpp
|
xirc/cp-algorithm
|
89c67cff2f00459c5bb020ab44bff5ae419a1728
|
[
"Apache-2.0"
] | 1
|
2020-11-07T13:22:29.000Z
|
2020-12-20T12:54:00.000Z
|
atcoder/abc021/C/main.cpp
|
xirc/cp-algorithm
|
89c67cff2f00459c5bb020ab44bff5ae419a1728
|
[
"Apache-2.0"
] | 1
|
2021-01-16T03:40:10.000Z
|
2021-01-16T03:40:10.000Z
|
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ff = long double;
ll const inf = 1e16;
ll const MOD = 1e9 + 7;
int N, M;
int a, b;
vector<vector<ll>> G;
vector<vector<ll>> C;
ll solve() {
for (int k = 0; k < N; k++) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (G[i][k] == inf) continue;
if (G[k][j] == inf) continue;
int w = G[i][k] + G[k][j];
ll c = C[i][k] * C[k][j] % MOD;
if (G[i][j] > w) {
G[i][j] = w;
C[i][j] = c;
} else if (G[i][j] == w) {
C[i][j] = (C[i][j] + c) % MOD;
}
}
}
}
return C[a][b];
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> N;
cin >> a >> b;
--a, --b;
cin >> M;
G.assign(N, vector<ll>(N, inf));
C.assign(N, vector<ll>(N, 0));
for (int i = 0; i < N; ++i) {
G[i][i] = 0;
C[i][i] = 0;
}
for (int i = 0; i < M; ++i) {
int x, y;
cin >> x >> y;
--x, --y;
G[x][y] = G[y][x] = 1;
C[x][y] = C[y][x] = 1;
}
cout << solve() << endl;
return 0;
}
| 22.068966
| 50
| 0.35
|
xirc
|
db2b4501fd4221049e3e0de0bc8d19b8dbc5b334
| 153
|
hpp
|
C++
|
include/msqlite/throws/error.hpp
|
ricardocosme/msqlite
|
95af5b04831c7af449f87346301b6e26bf749e9f
|
[
"MIT"
] | 19
|
2020-08-18T21:25:05.000Z
|
2022-01-14T03:45:41.000Z
|
include/msqlite/throws/error.hpp
|
ricardocosme/msqlite
|
95af5b04831c7af449f87346301b6e26bf749e9f
|
[
"MIT"
] | null | null | null |
include/msqlite/throws/error.hpp
|
ricardocosme/msqlite
|
95af5b04831c7af449f87346301b6e26bf749e9f
|
[
"MIT"
] | null | null | null |
#pragma once
#include "msqlite/error.hpp"
#include "msqlite/throws/value_or_throw.hpp"
namespace msqlite::throws {
using error = ::msqlite::error;
}
| 13.909091
| 44
| 0.738562
|
ricardocosme
|
db30dad49658635d045b6d1f3df78cdad8d27027
| 6,860
|
cpp
|
C++
|
srrg2_proslam/apps/convert_rgbd_to_srrg2.cpp
|
srrg-sapienza/srrg2_proslam
|
6321cd9f8c892c1949442abce6a934106954b2ae
|
[
"BSD-3-Clause"
] | 16
|
2020-03-11T14:27:38.000Z
|
2021-12-08T13:05:29.000Z
|
srrg2_proslam/apps/convert_rgbd_to_srrg2.cpp
|
srrg-sapienza/srrg2_proslam
|
6321cd9f8c892c1949442abce6a934106954b2ae
|
[
"BSD-3-Clause"
] | 4
|
2020-05-21T11:59:27.000Z
|
2021-09-08T03:59:24.000Z
|
srrg2_proslam/apps/convert_rgbd_to_srrg2.cpp
|
srrg-sapienza/srrg2_proslam
|
6321cd9f8c892c1949442abce6a934106954b2ae
|
[
"BSD-3-Clause"
] | 1
|
2020-11-30T08:17:23.000Z
|
2020-11-30T08:17:23.000Z
|
#include <iostream>
#include <srrg_boss/serializer.h>
#include <srrg_messages/instances.h>
#include <srrg_system_utils/parse_command_line.h>
#include <srrg_system_utils/system_utils.h>
using namespace srrg2_core;
// clang-format off
const char* banner[] = {"This program converts a folder containing RGB (and depth) imagery to SRRG format",
0};
// clang-format on
// ds TODO kill me with fire
int main(int argc_, char** argv_) {
messages_registerTypes();
// ds set up CLI parameters
// clang-format off
ParseCommandLine command_line_parser(argv_, banner);
ArgumentString folder_images_rgb (
&command_line_parser, "fr", "folder-rgb", "folder containing RGB images", "");
ArgumentString folder_images_depth (
&command_line_parser, "fd", "folder-depth", "folder containing Depth images", "");
ArgumentString timestamps (
&command_line_parser, "t", "timestamps", "optional file containing timestamp data", "");
ArgumentString message_target (
&command_line_parser, "s", "source", "generated source file name", "out.json");
const std::string topic_intensity = "/camera/rgb/image_color";
const std::string topic_depth = "/camera/depth/image";
// clang-format on
command_line_parser.parse();
if (!folder_images_rgb.isSet() || folder_images_rgb.value().empty()) {
printBanner(banner);
return 0;
}
if (message_target.value().empty()) {
printBanner(banner);
return 0;
}
if (!timestamps.value().empty()) {
std::cerr << "using timestamps data: " << timestamps.value() << std::endl;
}
// ds configure serializer
Serializer serializer;
serializer.setFilePath(message_target.value());
// ds super duper hardcoding for ICL
Matrix3f camera_calibration_matrix(Matrix3f::Zero());
camera_calibration_matrix << 481.2, 0, 319.5, 0, -481, 239.5, 0, 0, 1;
// ds parse timestamp file (hardcoded deprecated txtio)
if (!timestamps.value().empty()) {
std::ifstream timestamps_file(timestamps.value());
assert(timestamps_file.good());
assert(timestamps_file.is_open());
std::string line_buffer;
size_t number_of_written_messages_intensity = 0;
size_t number_of_written_messages_depth = 0;
size_t number_of_skipped_messages = 0;
// ds read line by line
while (std::getline(timestamps_file, line_buffer)) {
// ds parse line and assemble stereo message
const size_t a = line_buffer.find_first_of(' ') + 1;
const size_t b = line_buffer.find_first_of(' ', a) + 1;
const size_t c = line_buffer.find_first_of(' ', b) + 1;
const size_t d = line_buffer.find_first_of(' ', c) + 1;
const size_t e = line_buffer.find_first_of(' ', d) + 1;
ImageMessagePtr image_message(new ImageMessage(line_buffer.substr(a, b - a - 1),
line_buffer.substr(b, c - b - 1),
std::stoi(line_buffer.substr(c, d - c - 1)),
std::stod(line_buffer.substr(d, e - d - 1))));
// ds check for RGB or depth image string
if (image_message->topic.value() == topic_intensity) {
// ds parse image file name
const size_t f = line_buffer.rfind(folder_images_rgb.value());
const size_t g = line_buffer.find(".png" /*ICL*/, f);
const std::string image_name = line_buffer.substr(f, g - f + 4);
// ds load image from disk and convert
cv::Mat image_opencv = cv::imread(image_name, CV_LOAD_IMAGE_GRAYSCALE);
if (image_opencv.rows <= 0 || image_opencv.cols <= 0) {
std::cerr << "\nWARNING: skipping invalid image: " << image_name
<< " with dimensions: " << image_opencv.rows << " x " << image_opencv.cols
<< std::endl;
++number_of_skipped_messages;
continue;
}
cv::imshow("processed image RGB", image_opencv);
cv::waitKey(1);
ImageUInt8 base_image;
base_image.fromCv(image_opencv);
image_message->setImage(&base_image);
serializer.writeObject(*image_message);
std::cerr << "I";
++number_of_written_messages_intensity;
} else if (image_message->topic.value() == topic_depth) {
if (!folder_images_depth.isSet()) {
std::cerr << "\nWARNING: skipped message with topic: " << image_message->frame_id.value()
<< " (folder not set)" << std::endl;
++number_of_skipped_messages;
continue;
}
// ds parse image file name
const size_t f = line_buffer.rfind(folder_images_depth.value());
const size_t g = line_buffer.find(".pgm" /*ICL*/, f);
const std::string image_name = line_buffer.substr(f, g - f + 4);
// ds load image from disk and convert
cv::Mat image_opencv = cv::imread(image_name, CV_LOAD_IMAGE_ANYDEPTH);
if (image_opencv.rows <= 0 || image_opencv.cols <= 0) {
std::cerr << "\nWARNING: skipping invalid image: " << image_name
<< " with dimensions: " << image_opencv.rows << " x " << image_opencv.cols
<< std::endl;
++number_of_skipped_messages;
continue;
}
cv::imshow("processed image Depth", image_opencv);
cv::waitKey(1);
ImageUInt16 image_depth;
image_depth.fromCv(image_opencv);
image_message->setImage(&image_depth); /*ImageFloat takes up more than double the space*/
serializer.writeObject(*image_message);
std::cerr << "D";
++number_of_written_messages_depth;
} else {
std::cerr << "\nWARNING: skipped message with topic: " << image_message->topic.value()
<< std::endl;
++number_of_skipped_messages;
}
// ds always produce a camera info message
CameraInfoMessagePtr camera_message(
new CameraInfoMessage(image_message->topic.value() + "/info",
image_message->frame_id.value(),
image_message->seq.value(),
image_message->timestamp.value()));
camera_message->depth_scale.setValue(1e-3f);
camera_message->projection_model.setValue("pinhole");
camera_message->distortion_model.setValue("undistorted");
camera_message->camera_matrix.setValue(camera_calibration_matrix);
serializer.writeObject(*camera_message);
}
std::cerr << std::endl;
std::cerr << "written messages RGB: " << number_of_written_messages_intensity << std::endl;
std::cerr << " written messages D: " << number_of_written_messages_depth << std::endl;
std::cerr << " skipped messages: " << number_of_skipped_messages << std::endl;
}
return 0;
}
| 43.417722
| 107
| 0.619825
|
srrg-sapienza
|
db33051d78b4b03197eb4c6841988862413ae424
| 41,780
|
cpp
|
C++
|
S5CppLogic/l_ua.cpp
|
mcb5637/S5BinkHook
|
c449238b95e1fd0463386e3fbace519f3db70e34
|
[
"MIT"
] | null | null | null |
S5CppLogic/l_ua.cpp
|
mcb5637/S5BinkHook
|
c449238b95e1fd0463386e3fbace519f3db70e34
|
[
"MIT"
] | null | null | null |
S5CppLogic/l_ua.cpp
|
mcb5637/S5BinkHook
|
c449238b95e1fd0463386e3fbace519f3db70e34
|
[
"MIT"
] | null | null | null |
#include "pch.h"
#include "l_ua.h"
#include "luaext.h"
#include "l_entity.h"
#include <random>
#include "entityiterator.h"
std::vector<UACannonBuilderAbilityData> UnlimitedArmy::CannonBuilderAbilityData = std::vector<UACannonBuilderAbilityData>();
UnlimitedArmy::~UnlimitedArmy()
{
luaL_unref(L, LUA_REGISTRYINDEX, Formation);
luaL_unref(L, LUA_REGISTRYINDEX, CommandQueue);
luaL_unref(L, LUA_REGISTRYINDEX, Spawner);
luaL_unref(L, LUA_REGISTRYINDEX, Normalize);
}
UnlimitedArmy::UnlimitedArmy(int p)
{
Player = p;
}
void UnlimitedArmy::CalculatePos()
{
int tick = (*shok_EGL_CGLEGameLogic::GlobalObj)->GetTick();
if (tick == PosLastUpdatedTick)
return;
float x = 0, y = 0;
int num = 0;
for (int id : Leaders) {
bool con = false;
for (UAReset& r : PrepDefenseReset)
if (r.EntityId == id) {
con = true;
break;
}
if (con)
continue;
shok_EGL_CGLEEntity* e = shok_EGL_CGLEEntity::GetEntityByID(id);
if (e != nullptr) {
x += e->Position.X;
y += e->Position.Y;
num++;
}
}
if (num == 0) {
LastPos.X = -1;
LastPos.Y = -1;
}
else {
LastPos.X = x / num;
LastPos.Y = y / num;
}
PosLastUpdatedTick = tick;
}
void UnlimitedArmy::CleanDead()
{
auto remo = [this](int id) {
if (shok_EGL_CGLEEntity::EntityIDIsDead(id)) {
shok_EGL_CGLEEntity* e = shok_EGL_CGLEEntity::GetEntityByID(id);
if (e != nullptr && e->IsEntityInCategory(shok_EntityCategory::Hero)) {
this->DeadHeroes.push_back(id);
}
NeedFormat();
return true;
}
return false;
};
auto e = std::remove_if(Leaders.begin(), Leaders.end(), remo);
Leaders.erase(e, Leaders.end());
e = std::remove_if(LeaderInTransit.begin(), LeaderInTransit.end(), remo);
LeaderInTransit.erase(e, LeaderInTransit.end());
auto e2 = std::remove_if(Cannons.begin(), Cannons.end(), [](UACannonData& d) { return shok_EGL_CGLEEntity::EntityIDIsDead(d.EntityId); });
Cannons.erase(e2, Cannons.end());
e = std::remove_if(DeadHeroes.begin(), DeadHeroes.end(), [this](int id) {
if (!shok_EGL_CGLEEntity::EntityIDIsDead(id)) {
this->AddLeader(shok_EGL_CGLEEntity::GetEntityByID(id));
return true;
}
return shok_EGL_CGLEEntity::GetEntityByID(id) == nullptr;
});
DeadHeroes.erase(e, DeadHeroes.end());
int tick = (*shok_EGL_CGLEGameLogic::GlobalObj)->GetTick();
TargetCache.erase(std::remove_if(TargetCache.begin(), TargetCache.end(), [tick](UATargetCache& c) { return c.Tick < tick; }), TargetCache.end());
}
void UnlimitedArmy::Tick()
{
CleanDead();
CalculatePos();
CheckTransit();
CallSpawner();
if (Leaders.size() == 0) {
CallCommandQueue();
return;
}
PosLastUpdatedTick = -1;
CalculatePos();
if (!IsTargetValid(CurrentBattleTarget)) {
shok_EGL_CGLEEntity* e = GetNearestTargetInArea(Player, LastPos, Area, IgnoreFleeing);
if (e == nullptr)
CurrentBattleTarget = 0;
else {
CurrentBattleTarget = e->EntityId;
for (UACannonData d : Cannons) {
d.LastUpdated = -1;
}
}
}
bool preventComands = false;
if (!preventComands && Status != UAStatus::MovingNoBattle && CurrentBattleTarget != 0) {
CheckStatus(UAStatus::Battle);
preventComands = true;
}
if (!preventComands && !LastPos.IsInRange(Target, 1500)) {
if (Status != UAStatus::Moving && Status != UAStatus::MovingNoBattle)
CheckStatus(UAStatus::Moving);
preventComands = true;
}
if (!preventComands) {
CheckStatus(UAStatus::Idle);
if (AutoRotateFormation >= 0) {
shok_EGL_CGLEEntity* e = GetNearestTargetInArea(Player, LastPos, AutoRotateFormation, IgnoreFleeing);
if (e != nullptr) {
float a = LastPos.GetAngleBetween(e->Position);
if (std::fabsf(a - LastRotation) > 10) {
LastRotation = a;
ReMove = true;
}
}
}
preventComands = true;
}
CallCommandQueue();
if (Status == UAStatus::Battle)
BattleCommand();
else if (Status == UAStatus::Moving || Status == UAStatus::MovingNoBattle)
MoveCommand();
else if (Status == UAStatus::Idle)
FormationCommand();
}
void UnlimitedArmy::NeedFormat()
{
if (Status == UAStatus::Idle)
Status = UAStatus::IdleUnformated;
}
void UnlimitedArmy::AddLeader(shok_EGL_CGLEEntity* e)
{
CalculatePos();
if (Leaders.size() == 0 || LastPos.IsInRange(e->Position, Area)) {
Leaders.push_back(e->EntityId);
PosLastUpdatedTick = -1;
if (Target.X == -1) {
Target = e->Position;
}
NeedFormat();
if (e->IsEntityInCategory(shok_EntityCategory::Cannon))
Cannons.push_back({ e->EntityId, -1 });
}
else
LeaderInTransit.push_back(e->EntityId);
}
void UnlimitedArmy::OnIdChanged(int old, int ne)
{
for (int i = 0; i < static_cast<int>(Leaders.size()); i++) {
if (Leaders[i] == old)
Leaders[i] = ne;
}
for (int i = 0; i < static_cast<int>(LeaderInTransit.size()); i++) {
if (LeaderInTransit[i] == old)
LeaderInTransit[i] = ne;
}
for (int i = 0; i < static_cast<int>(DeadHeroes.size()); i++) {
if (DeadHeroes[i] == old)
DeadHeroes[i] = ne;
}
for (int i = 0; i < static_cast<int>(Cannons.size()); i++) {
if (Cannons[i].EntityId == old)
Cannons[i].EntityId = ne;
}
}
void UnlimitedArmy::CheckTransit()
{
if (Leaders.size() == 0 && LeaderInTransit.size() > 0) {
Leaders.push_back(LeaderInTransit[0]);
if (shok_EGL_CGLEEntity::GetEntityByID(LeaderInTransit[0])->IsEntityInCategory(shok_EntityCategory::Cannon))
Cannons.push_back({ LeaderInTransit[0], -1 });
LeaderInTransit.erase(LeaderInTransit.begin());
PosLastUpdatedTick = -1;
CalculatePos();
NeedFormat();
}
auto e = std::remove_if(LeaderInTransit.begin(), LeaderInTransit.end(), [this](int id) {
shok_EGL_CGLEEntity* e = shok_EGL_CGLEEntity::GetEntityByID(id);
if (this->LastPos.IsInRange(e->Position, this->Area)) {
this->Leaders.push_back(id);
if (e->IsEntityInCategory(shok_EntityCategory::Cannon))
this->Cannons.push_back({ e->EntityId, -1 });
this->NeedFormat();
return true;
}
return false;
});
LeaderInTransit.erase(e, LeaderInTransit.end());
for (int id : LeaderInTransit) {
shok_EGL_CMovingEntity* e = ((shok_EGL_CMovingEntity*)shok_EGL_CGLEEntity::GetEntityByID(id));
if (!LeaderIsMoving(e)) {
e->Move(LastPos);
}
}
}
int UnlimitedArmy::GetSize(bool transit, bool hero)
{
int r = Leaders.size();
if (transit)
r += LeaderInTransit.size();
if (hero)
r += DeadHeroes.size();
return r;
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetNearestTargetInArea(int player, shok_position& p, float ran, bool notFleeing)
{
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateOfEntityCategory catLeader = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::TargetFilter_TargetTypeLeader);
EntityIteratorPredicateIsNotSoldier nsol = EntityIteratorPredicateIsNotSoldier();
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsBuilding buil = EntityIteratorPredicateIsBuilding();
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateIsNotFleeingFrom nflee = EntityIteratorPredicateIsNotFleeingFrom(p, 500);
EntityIteratorPredicateOfEntityCategory cat = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::TargetFilter_TargetType);
EntityIteratorPredicatePriority prio1 = EntityIteratorPredicatePriority(2, &catLeader);
EntityIteratorPredicatePriority prio2 = EntityIteratorPredicatePriority(1, &buil);
EntityIteratorPredicateNotInBuilding notinbuild = EntityIteratorPredicateNotInBuilding();
EntityIteratorPredicate* preds[11] = {
&relev, &pl, &cat, &al, &nsol, &vis, ¬inbuild, &cir, &prio1, &prio2, &nflee
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, notFleeing ? 11 : 10);
EntityIterator iter = EntityIterator(&a);
shok_EGL_CGLEEntity* r = iter.GetNearest(nullptr);
return r;
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetFurthestConversionTargetInArea(int player, shok_position& p, float ran, bool notFleeing)
{
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateOfEntityCategory cat = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::TargetFilter_TargetTypeLeader);
EntityIteratorPredicateIsNotSoldier nsol = EntityIteratorPredicateIsNotSoldier();
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateIsNotFleeingFrom nflee = EntityIteratorPredicateIsNotFleeingFrom(p, 500);
EntityIteratorPredicateNotInBuilding notinbuild = EntityIteratorPredicateNotInBuilding();
EntityIteratorPredicateFunc fun = EntityIteratorPredicateFunc([this](shok_EGL_CGLEEntity* e) {
return this->CheckTargetCache(e->EntityId, 1);
});
EntityIteratorPredicate* preds[10] = {
&relev, &pl, &cat, &al, &nsol, &vis, ¬inbuild, &cir, &fun, &nflee
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, notFleeing ? 10 : 9);
EntityIterator iter = EntityIterator(&a);
shok_EGL_CGLEEntity* r = iter.GetFurthest(nullptr);
return r;
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetNearestSettlerInArea(int player, shok_position& p, float ran, bool notFleeing)
{
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateOfEntityCategory cat = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::TargetFilter_TargetTypeLeader);
EntityIteratorPredicateIsNotSoldier nsol = EntityIteratorPredicateIsNotSoldier();
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateIsNotFleeingFrom nflee = EntityIteratorPredicateIsNotFleeingFrom(p, 500);
EntityIteratorPredicateNotInBuilding notinbuild = EntityIteratorPredicateNotInBuilding();
EntityIteratorPredicate* preds[9] = {
&relev, &pl, &cat, &al, &nsol, &vis, ¬inbuild, &cir, &nflee
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, notFleeing ? 9 : 8);
EntityIterator iter = EntityIterator(&a);
return iter.GetNearest(nullptr);
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetNearestBuildingInArea(int player, shok_position& p, float ran) {
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateIsBuilding buil = EntityIteratorPredicateIsBuilding();
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateFunc fun = EntityIteratorPredicateFunc([this](shok_EGL_CGLEEntity* e) {
return this->CheckTargetCache(e->EntityId, 2);
});
EntityIteratorPredicate* preds[7] = {
&relev, &pl, &al, &buil, &vis, &cir, &fun
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, 7);
EntityIterator iter = EntityIterator(&a);
return iter.GetNearest(nullptr);
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetNearestBridgeInArea(shok_position& p, float ran) {
EntityIteratorPredicateOfPlayer pl = EntityIteratorPredicateOfPlayer(0);
EntityIteratorPredicateIsBuilding buil = EntityIteratorPredicateIsBuilding();
EntityIteratorPredicateOfEntityCategory cat = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::Bridge);
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateFunc fun = EntityIteratorPredicateFunc([this](shok_EGL_CGLEEntity* e) {
return this->CheckTargetCache(e->EntityId, 1);
});
EntityIteratorPredicate* preds[5] = {
&pl, &buil, &cat, &cir, &fun
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, 5);
EntityIterator iter = EntityIterator(&a);
return iter.GetNearest(nullptr);
}
shok_EGL_CGLEEntity* UnlimitedArmy::GetNearestSnipeTargetInArea(int player, shok_position& p, float ran, bool notFleeing)
{
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateOfEntityCategory he = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::Hero);
EntityIteratorPredicateOfEntityCategory can = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::Cannon);
EntityIteratorPredicate* cats[2] = {
&he, &can
};
EntityIteratorPredicateOr cat = EntityIteratorPredicateOr(cats, 2);
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateNotInBuilding notinbuild = EntityIteratorPredicateNotInBuilding();
EntityIteratorPredicateFunc fun = EntityIteratorPredicateFunc([this](shok_EGL_CGLEEntity* e) {
return this->CheckTargetCache(e->EntityId, 1);
});
EntityIteratorPredicateIsNotFleeingFrom nflee = EntityIteratorPredicateIsNotFleeingFrom(p, 500);
EntityIteratorPredicate* preds[9] = {
&relev, &pl, &cat, &al, &vis, ¬inbuild, &cir, &fun, &nflee
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, notFleeing ? 9 : 8);
EntityIterator iter = EntityIterator(&a);
return iter.GetNearest(nullptr);
}
bool UnlimitedArmy::IsTargetValid(int id)
{
if (shok_EGL_CGLEEntity::EntityIDIsDead(id))
return false;
shok_EGL_CGLEEntity* e = shok_EGL_CGLEEntity::GetEntityByID(id);
if (!LastPos.IsInRange(e->Position, Area))
return false;
shok_GGL_CCamouflageBehavior* c = e->GetBehavior<shok_GGL_CCamouflageBehavior>();
if (c != nullptr) {
return c->InvisibilityRemaining <= 0;
}
if (!IgnoreFleeing)
return true;
return EntityIteratorPredicateIsNotFleeingFrom::IsNotFleeingFrom(e, LastPos, 500);
}
void UnlimitedArmy::CheckStatus(UAStatus status)
{
if (Status != status) {
Status = status;
ReMove = true;
}
}
bool UnlimitedArmy::LeaderIsMoving(shok_EGL_CGLEEntity* e)
{
shok_LeaderCommand comm = e->EventLeaderGetCurrentCommand();
return (comm == shok_LeaderCommand::Move || comm == shok_LeaderCommand::AttackMove || comm == shok_LeaderCommand::Patrol) && !LeaderIsIdle(e);
}
bool UnlimitedArmy::LeaderIsIdle(shok_EGL_CGLEEntity* e)
{
return static_cast<shok_GGL_CSettler*>(e)->IsIdle();
}
bool UnlimitedArmy::LeaderIsInBattle(shok_EGL_CGLEEntity* e)
{
shok_LeaderCommand comm = e->EventLeaderGetCurrentCommand();
return (comm == shok_LeaderCommand::Attack || comm == shok_LeaderCommand::AttackMove || comm == shok_LeaderCommand::HeroAbility) && !LeaderIsIdle(e);
}
bool UnlimitedArmy::IsRanged(shok_EGL_CGLEEntity* e)
{
return e->IsEntityInCategory(shok_EntityCategory::LongRange) || e->IsEntityInCategory(shok_EntityCategory::Cannon) || e->IsEntityInCategory(shok_EntityCategory::TargetFilter_CustomRanged);
}
bool UnlimitedArmy::IsNonCombat(shok_EGL_CGLEEntity* e)
{
return e->IsEntityInCategory(shok_EntityCategory::TargetFilter_NonCombat);
}
void UnlimitedArmy::BattleCommand()
{
shok_position p = shok_EGL_CGLEEntity::GetEntityByID(CurrentBattleTarget)->Position;
shok_EGL_CGLELandscape* ls = (*shok_EGL_CGLEGameLogic::GlobalObj)->Landscape;
if (ls->GetSector(&p) == 0) {
shok_position pou;
if (ls->GetNearestPositionInSector(&p, 1000, shok_EGL_CGLEEntity::GetEntityByID(Leaders[0])->GetSector(), &pou))
p = pou;
}
if (ReMove) {
PrepDefenseReset.clear();
NormalizeSpeed(false, false);
}
for (int id : Leaders) {
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(id));
if (e->IsEntityInCategory(shok_EntityCategory::Hero) || IsNonCombat(e)) {
if (ExecuteHeroAbility(e))
continue;
}
if ((ReMove || !LeaderIsInBattle(e) ) && !IsNonCombat(e) && !e->IsEntityInCategory(shok_EntityCategory::Cannon)) {
if (IsRanged(e)) {
e->AttackEntity(CurrentBattleTarget);
}
else {
e->AttackMove(p);
}
}
}
int tick = (*shok_EGL_CGLEGameLogic::GlobalObj)->GetTick();
for (UACannonData cd : Cannons) {
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(cd.EntityId));
if (ReMove || !LeaderIsInBattle(e) || cd.LastUpdated == -1) {
if (cd.LastUpdated < 0 || cd.LastUpdated < tick) {
e->AttackEntity(CurrentBattleTarget);
cd.LastUpdated = tick + 1;
}
else {
e->AttackMove(p);
cd.LastUpdated = -1;
}
}
}
ReMove = false;
}
void UnlimitedArmy::MoveCommand()
{
if (ReMove) {
PrepDefenseReset.clear();
NormalizeSpeed(true, false);
}
shok_position p = Target;
shok_EGL_CGLELandscape* ls = (*shok_EGL_CGLEGameLogic::GlobalObj)->Landscape;
if (ls->GetSector(&p) == 0) {
shok_position pou;
if (ls->GetNearestPositionInSector(&p, 1000, shok_EGL_CGLEEntity::GetEntityByID(Leaders[0])->GetSector(), &pou))
p = pou;
}
if (Status == UAStatus::MovingNoBattle) {
for (int id : Leaders) {
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(id));
if (ReMove || !LeaderIsMoving(e)) {
e->Move(p);
}
}
}
else {
for (int id : Leaders) {
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(id));
if (ReMove || LeaderIsIdle(e)) {
e->AttackMove(p);
}
}
}
ReMove = false;
}
void UnlimitedArmy::FormationCommand()
{
if (ReMove) {
NormalizeSpeed(false, false);
PrepDefenseReset.clear();
CallFormation();
}
else if (PrepDefense && IsIdle()) {
for (int id : Leaders) {
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(id));
if ((e->IsEntityInCategory(shok_EntityCategory::Hero) || IsNonCombat(e)) && e->EventLeaderGetCurrentCommand() != shok_LeaderCommand::HeroAbility) {
if (ExecutePrepDefense(e)) {
UAReset r;
r.EntityId = id;
r.Pos = e->Position;
PrepDefenseReset.push_back(r);
}
}
}
PrepDefenseReset.erase(std::remove_if(PrepDefenseReset.begin(), PrepDefenseReset.end(), [this](UAReset& r) {
if (shok_EGL_CGLEEntity::EntityIDIsDead(r.EntityId))
return true;
shok_EGL_CMovingEntity* e = static_cast<shok_EGL_CMovingEntity*>(shok_EGL_CGLEEntity::GetEntityByID(r.EntityId));
if (e->EventLeaderGetCurrentCommand() != shok_LeaderCommand::HeroAbility) {
shok_EGL_CMovingEntity* m = static_cast<shok_EGL_CMovingEntity*>(e);
m->Move(r.Pos);
m->SetTargetRotation(r.Pos.r);
shok_EGL_CEventValue_bool ev{ shok_EventIDs::Leader_SetIsUsingTargetOrientation, true };
m->FireEvent(&ev);
return true;
}
return false;
}), PrepDefenseReset.end());
}
ReMove = false;
}
void UnlimitedArmy::RemoveLeader(shok_EGL_CGLEEntity* e)
{
int id = e->EntityId;
auto f = [id](int i) { return i == id; };
auto en = std::remove_if(Leaders.begin(), Leaders.end(), f);
Leaders.erase(en, Leaders.end());
en = std::remove_if(LeaderInTransit.begin(), LeaderInTransit.end(), f);
LeaderInTransit.erase(en, LeaderInTransit.end());
NeedFormat();
}
bool UnlimitedArmy::IsIdle()
{
if (GetSize(true, false) == 0)
return true;
if (Status != UAStatus::Idle)
return false;
if (LeaderInTransit.size() > 0)
return false;
CalculatePos();
if (!LastPos.IsInRange(Target, 1000))
return false;
for (int id : Leaders)
if (!LeaderIsIdle(shok_EGL_CGLEEntity::GetEntityByID(id)))
return false;
return true;
}
int UnlimitedArmy::CountTargetsInArea(int player, shok_position& p, float ran, bool notFleeing)
{
EntityIteratorPredicateIsRelevant relev = EntityIteratorPredicateIsRelevant();
int buff[8];
int bufflen = 8;
EntityIteratorPredicateAnyPlayer::FillHostilePlayers(player, buff, bufflen);
EntityIteratorPredicateAnyPlayer pl = EntityIteratorPredicateAnyPlayer(buff, bufflen);
EntityIteratorPredicateOfEntityCategory cat = EntityIteratorPredicateOfEntityCategory(shok_EntityCategory::TargetFilter_TargetType);
EntityIteratorPredicateIsVisible vis = EntityIteratorPredicateIsVisible();
EntityIteratorPredicateInCircle cir = EntityIteratorPredicateInCircle(p.X, p.Y, ran);
EntityIteratorPredicateIsBuilding buil = EntityIteratorPredicateIsBuilding();
EntityIteratorPredicateIsAlive al = EntityIteratorPredicateIsAlive();
EntityIteratorPredicateIsNotFleeingFrom nflee = EntityIteratorPredicateIsNotFleeingFrom(p, 500);
EntityIteratorPredicate* preds[7] = {
&relev, &pl, &cat, &al, &vis, &cir, &nflee
};
EntityIteratorPredicateAnd a = EntityIteratorPredicateAnd(preds, notFleeing ? 7 : 6);
EntityIterator iter = EntityIterator(&a);
int count = 0;
shok_EGL_CGLEEntity* e = nullptr;
while (true) {
e = iter.GetNext(nullptr, nullptr);
if (e == nullptr)
break;
count++;
}
return count;
}
void UnlimitedArmy::CallFormation()
{
int t = lua_gettop(L);
lua_rawgeti(L, LUA_REGISTRYINDEX, Formation);
lua_pushnumber(L, LastRotation);
lua_call(L, 1, 0); // errors get propagated to lua tick
lua_settop(L, t);
}
void UnlimitedArmy::CallCommandQueue()
{
int t = lua_gettop(L);
lua_rawgeti(L, LUA_REGISTRYINDEX, CommandQueue);
lua_call(L, 0, 0); // errors get propagated to lua tick
lua_settop(L, t);
}
void UnlimitedArmy::CallSpawner()
{
int t = lua_gettop(L);
lua_rawgeti(L, LUA_REGISTRYINDEX, Spawner);
lua_call(L, 0, 0); // errors get propagated to lua tick
lua_settop(L, t);
}
void UnlimitedArmy::NormalizeSpeed(bool normalize, bool force)
{
int t = lua_gettop(L);
lua_rawgeti(L, LUA_REGISTRYINDEX, Normalize);
lua_pushboolean(L, normalize);
lua_pushboolean(L, force);
lua_call(L, 2, 0); // errors get propagated to lua tick
lua_settop(L, t);
}
std::random_device rand_dev;
std::mt19937 generator(rand_dev());
std::uniform_int_distribution<int> distr(-10, 10);
bool UnlimitedArmy::ExecuteHeroAbility(shok_EGL_CGLEEntity* e)
{
// first instant abilities
{
shok_GGL_CRangedEffectAbility* a = e->GetBehavior<shok_GGL_CRangedEffectAbility>();
if (a != nullptr) {
shok_GGL_CRangedEffectAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CRangedEffectAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
float r = 1000;
if (p->AffectsLongRangeOnly)
r = 3000;
if (p->IsAggressive()) {
if (!static_cast<shok_GGL_CSettler*>(e)->IsMoving() && CountTargetsInArea(Player, e->Position, r, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityRangedEffect();
}
}
else if (p->IsDefensive()) {
if (CountTargetsInArea(Player, e->Position, r, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityRangedEffect();
}
}
else if (p->IsHeal()) {
if (e->Health <= e->GetMaxHealth()/2 && CountTargetsInArea(Player, e->Position, r, IgnoreFleeing) >= 2) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityRangedEffect();
}
}
}
}
}
{
shok_GGL_CSummonBehavior* a = e->GetBehavior<shok_GGL_CSummonBehavior>();
if (a != nullptr) {
shok_GGL_CSummonBehaviorProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CSummonBehaviorProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, Area, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilitySummon();
e->ObservedEntities.ForAll([this](shok_attachment* a) {
if (a->AttachmentType == shok_AttachmentType::SUMMONER_SUMMONED)
AddLeader(shok_EGL_CGLEEntity::GetEntityByID(a->EntityId));
});
}
}
}
}
// then noninstant
{
shok_GGL_CCircularAttack* a = e->GetBehavior<shok_GGL_CCircularAttack>();
if (a != nullptr) {
shok_GGL_CCircularAttackProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CCircularAttackProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, p->Range, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityCircularAttack();
return true;
}
}
}
}
{
shok_GGL_CBombPlacerBehavior* a = e->GetBehavior<shok_GGL_CBombPlacerBehavior>();
if (a != nullptr) {
shok_GGL_CHeroAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CHeroAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, 500, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityPlaceBomb(e->Position);
return true;
}
}
}
}
{
shok_GGL_CCannonBuilderBehavior* a = e->GetBehavior<shok_GGL_CCannonBuilderBehavior>();
if (a != nullptr) {
shok_GGL_CCannonBuilderBehaviorProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CCannonBuilderBehaviorProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
int ety = e->EntityType;
auto d = std::find_if(CannonBuilderAbilityData.begin(), CannonBuilderAbilityData.end(), [ety](UACannonBuilderAbilityData& d) {return d.HeroType == ety; });
if (d != CannonBuilderAbilityData.end() && CountTargetsInArea(Player, e->Position, 2000, IgnoreFleeing) >= 10) {
shok_position p = e->Position;
p.X += distr(generator)*100;
p.Y += distr(generator)*100;
p.FloorToBuildingPlacement();
if (shok_canPlaceBuilding(d->BottomType, Player, &p, 0, 0)) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityPlaceCannon(p, d->BottomType, d->TopType);
return true;
}
}
}
}
}
{
shok_GGL_CShurikenAbility* a = e->GetBehavior<shok_GGL_CShurikenAbility>();
if (a != nullptr) {
shok_GGL_CShurikenAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CShurikenAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, p->Range, IgnoreFleeing) >= 10) {
shok_EGL_CGLEEntity* tar = GetNearestSettlerInArea(Player, e->Position, p->Range, IgnoreFleeing);
if (tar != nullptr) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityShuriken(tar->EntityId);
return true;
}
}
}
}
}
{
shok_GGL_CConvertSettlerAbility* a = e->GetBehavior<shok_GGL_CConvertSettlerAbility>();
if (a != nullptr) {
shok_GGL_CConvertSettlerAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CConvertSettlerAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, p->ConversionMaxRange, IgnoreFleeing) >= 10) {
shok_EGL_CGLEEntity* tar = GetFurthestConversionTargetInArea(Player, e->Position, p->ConversionStartRange, IgnoreFleeing);
if (tar != nullptr) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityConvert(tar->EntityId);
UpdateTargetCache(tar->EntityId, 600);
return true;
}
}
}
}
}
{
shok_GGL_CSniperAbility* a = e->GetBehavior<shok_GGL_CSniperAbility>();
if (a != nullptr) {
shok_GGL_CSniperAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CSniperAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
shok_EGL_CGLEEntity* tar = GetNearestSnipeTargetInArea(Player, e->Position, p->Range, IgnoreFleeing);
if (tar != nullptr) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilitySnipe(tar->EntityId);
UpdateTargetCache(tar->EntityId, 600);
return true;
}
}
}
}
{
shok_GGL_CInflictFearAbility* a = e->GetBehavior<shok_GGL_CInflictFearAbility>();
if (a != nullptr) {
shok_GGL_CInflictFearAbilityProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CInflictFearAbilityProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (CountTargetsInArea(Player, e->Position, p->Range/2, IgnoreFleeing) >= 10) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityInflictFear();
return true;
}
}
}
}
{
shok_GGL_CKegPlacerBehavior* a = e->GetBehavior<shok_GGL_CKegPlacerBehavior>();
if (a != nullptr) {
shok_GGL_CKegPlacerBehaviorProperties* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CKegPlacerBehaviorProperties>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
shok_EGL_CGLEEntity* tar = GetNearestBuildingInArea(Player, e->Position, Area);
if (tar == nullptr && SabotageBridges)
tar = GetNearestBridgeInArea(e->Position, 6000);
if (tar != nullptr) {
static_cast<shok_GGL_CSettler*>(e)->ThiefSabotage(tar->EntityId);
UpdateTargetCache(tar->EntityId, 500);
return true;
}
}
}
}
if (shok_EGL_CGLEEntity::CamoActivateCb) { // if camo fix is active, use camo to get rid of attackers
shok_GGL_CCamouflageBehavior* a = e->GetBehavior<shok_GGL_CCamouflageBehavior>();
if (a != nullptr && !shok_DynamicCast<shok_GGL_CCamouflageBehavior, shok_GGL_CThiefCamouflageBehavior>(a)) {
shok_GGL_CCamouflageBehaviorProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CCamouflageBehaviorProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
if (e->Health <= e->GetMaxHealth() / 2 && CountTargetsInArea(Player, e->Position, Area, IgnoreFleeing) >= 5) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityActivateCamoflage();
return true;
}
}
}
}
return false;
}
bool UnlimitedArmy::ExecutePrepDefense(shok_EGL_CGLEEntity* e)
{
{
shok_GGL_CCannonBuilderBehavior* a = e->GetBehavior<shok_GGL_CCannonBuilderBehavior>();
if (a != nullptr) {
shok_GGL_CCannonBuilderBehaviorProps* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CCannonBuilderBehaviorProps>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
int ety = e->EntityType;
auto d = std::find_if(CannonBuilderAbilityData.begin(), CannonBuilderAbilityData.end(), [ety](UACannonBuilderAbilityData& d) {return d.HeroType == ety; });
if (d != CannonBuilderAbilityData.end()) {
shok_position p = e->Position;
p.X += distr(generator) * 100;
p.Y += distr(generator) * 100;
p.FloorToBuildingPlacement();
if (shok_canPlaceBuilding(d->BottomType, Player, &p, 0, 0)) {
static_cast<shok_GGL_CSettler*>(e)->HeroAbilityPlaceCannon(p, d->BottomType, d->TopType);
return true;
}
}
}
}
}
{
shok_GGL_CKegPlacerBehavior* a = e->GetBehavior<shok_GGL_CKegPlacerBehavior>();
if (a != nullptr) {
shok_GGL_CKegPlacerBehaviorProperties* p = e->GetEntityType()->GetBehaviorProps<shok_GGL_CKegPlacerBehaviorProperties>();
if (a->SecondsCharged >= p->RechargeTimeSeconds) {
shok_EGL_CGLEEntity* tar = GetNearestBuildingInArea(Player, e->Position, Area);
if (tar == nullptr && SabotageBridges)
tar = GetNearestBridgeInArea(e->Position, Area);
if (tar != nullptr) {
static_cast<shok_GGL_CSettler*>(e)->ThiefSabotage(tar->EntityId);
UpdateTargetCache(tar->EntityId, 500);
return true;
}
}
}
}
return false;
}
bool UnlimitedArmy::CheckTargetCache(int id, int count) {
for (UATargetCache& t : TargetCache) {
if (t.EntityId == id) {
if (t.Num < count) {
return true;
}
return false;
}
}
return true;
}
void UnlimitedArmy::UpdateTargetCache(int id, int time) {
int tick = (*shok_EGL_CGLEGameLogic::GlobalObj)->GetTick();
for (UATargetCache& t : TargetCache) {
if (t.EntityId == id) {
t.Num++;
t.Tick = tick + time;
return;
}
}
TargetCache.push_back({ id, tick + time, 1 });
}
int UnlimitedArmy::AddLeader(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->AddLeader(luaext_checkSettler(L, 2));
return 0;
}
int UnlimitedArmy::GetPos(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->CalculatePos();
luaext_pushPos(L, a->LastPos);
return 1;
}
int UnlimitedArmy::Tick(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->Tick();
return 0;
}
int UnlimitedArmy::Iterate(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_pushcfunction(L, [](lua_State* L) {
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
int i = luaL_checkint(L, 2);
i++;
if (i >= static_cast<int>(a->Leaders.size())) {
lua_pushnil(L);
lua_pushnil(L);
}
else {
lua_pushnumber(L, i);
lua_pushnumber(L, a->Leaders[i]);
}
return 2;
} );
lua_pushvalue(L, 1);
lua_pushnumber(L, -1);
return 3;
}
int UnlimitedArmy::IterateTransit(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_pushcfunction(L, [](lua_State* L) {
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
int i = luaL_checkint(L, 2);
i++;
if (i >= (int)a->LeaderInTransit.size()) {
lua_pushnil(L);
lua_pushnil(L);
}
else {
lua_pushnumber(L, i);
lua_pushnumber(L, a->LeaderInTransit[i]);
}
return 2;
});
lua_pushvalue(L, 1);
lua_pushnumber(L, -1);
return 3;
}
int UnlimitedArmy::OnIdChanged(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
int old = luaL_checkint(L, 2);
int ne = luaL_checkint(L, 3);
a->OnIdChanged(old, ne);
return 0;
}
int UnlimitedArmy::GetSize(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
int i = a->GetSize(lua_toboolean(L, 2), lua_toboolean(L, 3));
lua_pushnumber(L, i);
return 1;
}
int UnlimitedArmy::RemoveLeader(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->RemoveLeader(luaext_checkEntity(L, 2));
return 0;
}
int UnlimitedArmy::IsIdle(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_pushboolean(L, a->IsIdle());
return 1;
}
int UnlimitedArmy::GetStatus(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_pushnumber(L, static_cast<int>(a->Status));
return 1;
}
int UnlimitedArmy::SetArea(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->Area = luaL_checkfloat(L, 2);
return 0;
}
int UnlimitedArmy::SetTarget(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
luaext_checkPos(L, a->Target, 2);
return 0;
}
int UnlimitedArmy::DumpTable(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_newtable(L);
lua_pushstring(L, "Leaders");
lua_newtable(L);
int i = 1;
for (int l : a->Leaders) {
lua_pushnumber(L, l);
lua_rawseti(L, -2, i);
i++;
}
lua_rawset(L, -3);
lua_pushstring(L, "LeadersTransit");
lua_newtable(L);
i = 1;
for (int l : a->LeaderInTransit) {
lua_pushnumber(L, l);
lua_rawseti(L, -2, i);
i++;
}
lua_rawset(L, -3);
lua_pushstring(L, "DeadHeroes");
lua_newtable(L);
i = 1;
for (int l : a->DeadHeroes) {
lua_pushnumber(L, l);
lua_rawseti(L, -2, i);
i++;
}
lua_rawset(L, -3);
lua_pushstring(L, "Player");
lua_pushnumber(L, a->Player);
lua_rawset(L, -3);
lua_pushstring(L, "Status");
lua_pushnumber(L, static_cast<int>(a->Status));
lua_rawset(L, -3);
lua_pushstring(L, "Area");
lua_pushnumber(L, a->Area);
lua_rawset(L, -3);
lua_pushstring(L, "CurrentBattleTarget");
lua_pushnumber(L, a->CurrentBattleTarget);
lua_rawset(L, -3);
lua_pushstring(L, "Target");
luaext_pushPos(L, a->Target);
lua_rawset(L, -3);
lua_pushstring(L, "ReMove");
lua_pushboolean(L, a->ReMove);
lua_rawset(L, -3);
lua_pushstring(L, "IgnoreFleeing");
lua_pushboolean(L, a->IgnoreFleeing);
lua_rawset(L, -3);
lua_pushstring(L, "AutoRotateFormation");
lua_pushnumber(L, a->AutoRotateFormation);
lua_rawset(L, -3);
return 1;
}
int UnlimitedArmy::ReadTable(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_pushstring(L, "Leaders");
lua_rawget(L, 2);
int i = 1;
a->Leaders.clear();
while (true) {
lua_rawgeti(L, -1, i);
if (!lua_isnumber(L, -1)) {
lua_pop(L, 1);
break;
}
int id = luaL_checkint(L, -1);
a->Leaders.emplace_back(id);
if (shok_EGL_CGLEEntity::GetEntityByID(id)->IsEntityInCategory(shok_EntityCategory::Cannon))
a->Cannons.push_back({ id, -1 });
lua_pop(L, 1);
i++;
}
lua_pop(L, 1);
lua_pushstring(L, "LeadersTransit");
lua_rawget(L, 2);
i = 1;
a->LeaderInTransit.clear();
while (true) {
lua_rawgeti(L, -1, i);
if (!lua_isnumber(L, -1)) {
lua_pop(L, 1);
break;
}
a->LeaderInTransit.emplace_back(luaL_checkint(L, -1));
lua_pop(L, 1);
i++;
}
lua_pop(L, 1);
lua_pushstring(L, "DeadHeroes");
lua_rawget(L, 2);
i = 1;
a->DeadHeroes.clear();
while (true) {
lua_rawgeti(L, -1, i);
if (!lua_isnumber(L, -1)) {
lua_pop(L, 1);
break;
}
a->DeadHeroes.emplace_back(luaL_checkint(L, -1));
lua_pop(L, 1);
i++;
}
lua_pop(L, 1);
lua_pushstring(L, "Player");
lua_rawget(L, 2);
a->Player = luaL_checkint(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "Status");
lua_rawget(L, 2);
a->Status = static_cast<UAStatus>(luaL_checkint(L, -1));
lua_pop(L, 1);
lua_pushstring(L, "Area");
lua_rawget(L, 2);
a->Area = luaL_checkfloat(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "CurrentBattleTarget");
lua_rawget(L, 2);
a->CurrentBattleTarget = luaL_checkint(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "Target");
lua_rawget(L, 2);
luaext_checkPos(L, a->Target, -1);
lua_pop(L, 1);
lua_pushstring(L, "ReMove");
lua_rawget(L, 2);
a->ReMove = lua_toboolean(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "IgnoreFleeing");
lua_rawget(L, 2);
a->IgnoreFleeing = lua_toboolean(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "AutoRotateFormation");
lua_rawget(L, 2);
a->AutoRotateFormation = luaL_checkfloat(L, -1);
lua_pop(L, 1);
return 0;
}
int UnlimitedArmy::SetStatus(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->Status = static_cast<UAStatus>(luaL_checkint(L, 2));
return 0;
}
int UnlimitedArmy::SetReMove(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->ReMove = lua_toboolean(L, 2);
return 0;
}
int UnlimitedArmy::SetCurrentBattleTarget(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->CurrentBattleTarget = luaext_checkEntityId(L, 2);
return 0;
}
int UnlimitedArmy::GetRangedMelee(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
lua_newtable(L);
lua_newtable(L);
lua_newtable(L);
int ran = 1, mel = 1, nc = 1;
for (int id : a->Leaders) {
lua_pushnumber(L, id);
shok_EGL_CGLEEntity* e = shok_EGL_CGLEEntity::GetEntityByID(id);
if (a->IsRanged(e)) {
lua_rawseti(L, -4, ran);
ran++;
}
else if (a->IsNonCombat(e)) {
lua_rawseti(L, -2, nc);
nc++;
}
else {
lua_rawseti(L, -3, mel);
mel++;
}
}
return 3;
}
int UnlimitedArmy::SetIgnoreFleeing(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->IgnoreFleeing = lua_toboolean(L, 2);
return 0;
}
int UnlimitedArmy::SetAutoRotateFormation(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->AutoRotateFormation = luaL_checkfloat(L, 2);
return 0;
}
int UnlimitedArmy::GetFirstDeadHero(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
if (a->DeadHeroes.size() > 0)
lua_pushnumber(L, a->DeadHeroes[0]);
else
lua_pushnil(L);
return 1;
}
int UnlimitedArmy::SetPrepDefense(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->PrepDefense = lua_toboolean(L, 2);
return 0;
}
int UnlimitedArmy::SetSabotageBridges(lua_State* L)
{
UnlimitedArmy* a = luaext_GetUserData<UnlimitedArmy>(L, 1);
a->SabotageBridges = lua_toboolean(L, 2);
return 0;
}
int l_uaNew(lua_State* L) {
int pl = luaL_checkint(L, 1);
UnlimitedArmy* a = luaext_newUserData<UnlimitedArmy>(L, pl);
a->L = L;
lua_pushvalue(L, 2);
a->Formation = luaL_ref(L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 3);
a->CommandQueue = luaL_ref(L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 4);
a->Spawner = luaL_ref(L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 5);
a->Normalize = luaL_ref(L, LUA_REGISTRYINDEX);
return 1;
}
int l_uaNearest(lua_State* L) {
int pl = luaL_checkint(L, 1);
shok_position p;
luaext_checkPos(L, p, 2);
float r = luaL_checkfloat(L, 3);
shok_EGL_CGLEEntity* e = UnlimitedArmy::GetNearestTargetInArea(pl, p, r, lua_toboolean(L, 4));
if (e == nullptr)
lua_pushnumber(L, 0);
else
lua_pushnumber(L, e->EntityId);
return 1;
}
int l_uaCount(lua_State* L) {
int pl = luaL_checkint(L, 1);
shok_position p;
luaext_checkPos(L, p, 2);
float r = luaL_checkfloat(L, 3);
lua_pushnumber(L, UnlimitedArmy::CountTargetsInArea(pl, p, r, lua_toboolean(L, 4)));
return 1;
}
int l_uaAddCannonBuilderData(lua_State* L) {
UACannonBuilderAbilityData d = { luaL_checkint(L, 1), luaL_checkint(L, 2), luaL_checkint(L, 3) };
UnlimitedArmy::CannonBuilderAbilityData.emplace_back(d);
return 0;
}
void l_ua_init(lua_State* L)
{
luaext_registerFunc(L, "New", &l_uaNew);
luaext_registerFunc(L, "GetNearestEnemyInArea", &l_uaNearest);
luaext_registerFunc(L, "CountTargetEntitiesInArea", &l_uaCount);
luaext_registerFunc(L, "AddCannonBuilderData", &l_uaAddCannonBuilderData);
luaext_prepareUserDataType<UnlimitedArmy>(L);
}
// local x,y = GUI.Debug_GetMapPositionUnderMouse(); return CppLogic.UA.GetNearestEnemyInArea(1, x,y, 1000)
| 33.857374
| 189
| 0.725539
|
mcb5637
|
db38249cfc5b31beb2959dc50e318cfc0f6d432e
| 2,622
|
cpp
|
C++
|
framework/sysdeps/linux/physicaladdress.cpp
|
thac0/opendcdiag
|
b2f8cf0efa6de5cf9582c9a29dcd291367e2c73c
|
[
"Apache-2.0"
] | 21
|
2021-11-09T18:40:08.000Z
|
2022-03-07T04:41:39.000Z
|
framework/sysdeps/linux/physicaladdress.cpp
|
thac0/opendcdiag
|
b2f8cf0efa6de5cf9582c9a29dcd291367e2c73c
|
[
"Apache-2.0"
] | 20
|
2021-10-29T21:30:48.000Z
|
2022-03-30T16:48:03.000Z
|
framework/sysdeps/linux/physicaladdress.cpp
|
thac0/opendcdiag
|
b2f8cf0efa6de5cf9582c9a29dcd291367e2c73c
|
[
"Apache-2.0"
] | 8
|
2021-11-01T17:53:21.000Z
|
2022-03-30T05:25:22.000Z
|
/*
* Copyright 2022 Intel Corporation.
* SPDX-License-Identifier: Apache-2.0
*/
#include "sandstone_p.h"
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#define PAGE_SIZE 4096U
#define PAGE_SHIFT __builtin_ctz(PAGE_SIZE)
// proc(5) says:
// /proc/[pid]/pagemap (since Linux 2.6.25)
// This file shows the mapping of each of the process's virtual pages
// into physical page frames or swap area. It contains one 64-bit value
// for each virtual page, with the bits set as follows:
//
// 63 If set, the page is present in RAM.
//
// 62 If set, the page is in swap space
//
// 61 (since Linux 3.5)
// The page is a file-mapped page or a shared anonymous page.
//
// 60-57 (since Linux 3.11)
// Zero
//
// 56 (since Linux 4.2)
// The page is exclusively mapped.
//
// 55 (since Linux 3.11)
// PTE is soft-dirty (see the kernel source file Documentation/admin-guide/mm/soft-dirty.rst).
//
// 54-0 If the page is present in RAM (bit 63), then these bits
// provide the page frame number, which can be used to index
// /proc/kpageflags and /proc/kpagecount. If the page is
// present in swap (bit 62), then bits 4-0 give the swap
// type, and bits 54-5 encode the swap offset.
uint64_t retrieve_physical_address(const volatile void *ptr)
{
struct CloseFd {
int fd = -1;
~CloseFd() { if (fd >= 0) close(fd); }
};
// On Linux, the first and the last pages are always unmapped. The last
// page needs to be for ABI reasons, as any negative values between -1 and
// -4095 are errno codes. The first page because of NULL pointer
// dereferences (unless MMAP_PAGE_ZERO personality is in effect, but the
// less you know about that, the better).
// /proc/sys/vm/mmap_min_addr also applies to non-superuser processes.
uintptr_t v = uintptr_t(ptr);
if (v < PAGE_SIZE || v > ~uintptr_t(PAGE_SIZE))
return 0;
static const CloseFd pagemap = { open("/proc/self/pagemap", O_RDONLY) };
if (pagemap.fd == -1)
return 0;
uint64_t descriptor;
off_t pagemapoffset = v / PAGE_SIZE * sizeof(uint64_t);
int n = pread(pagemap.fd, &descriptor, sizeof(descriptor), pagemapoffset);
if (n < 0)
return 0;
// bit 63: page present in RAM?
if (int64_t(descriptor) >= 0)
return 0;
// is the PFN a valid number?
descriptor &= (UINT64_C(1) << 54) - 1;
if (!descriptor)
return 0;
return (descriptor << PAGE_SHIFT) + (v & (PAGE_SIZE - 1));
}
| 31.97561
| 105
| 0.622426
|
thac0
|
db3bccead719d76999423353e1016263f0513e18
| 1,987
|
cpp
|
C++
|
tests/common/test_uint_types.cpp
|
ivotron/foxxll
|
64849c4177a61ff51d89db431285a842f8325d27
|
[
"BSL-1.0"
] | 9
|
2018-10-16T09:04:50.000Z
|
2020-12-15T09:05:21.000Z
|
tests/common/test_uint_types.cpp
|
ivotron/foxxll
|
64849c4177a61ff51d89db431285a842f8325d27
|
[
"BSL-1.0"
] | 6
|
2018-01-09T20:36:33.000Z
|
2018-01-19T22:44:59.000Z
|
tests/common/test_uint_types.cpp
|
ivotron/foxxll
|
64849c4177a61ff51d89db431285a842f8325d27
|
[
"BSL-1.0"
] | 8
|
2018-05-25T09:47:18.000Z
|
2021-05-02T14:41:14.000Z
|
/***************************************************************************
* tests/common/test_uint_types.cpp
*
* Part of FOXXLL. See http://foxxll.org
*
* Copyright (C) 2013 Timo Bingmann <tb@panthema.net>
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
**************************************************************************/
#include <tlx/die.hpp>
#include <foxxll/common/uint_types.hpp>
// forced instantiation
template class foxxll::uint_pair<uint8_t>;
template class foxxll::uint_pair<uint16_t>;
template <typename uint>
void dotest(unsigned int nbytes)
{
// simple initialize
uint a = 42;
// check sizeof (again)
die_unless(sizeof(a) == nbytes);
// count up 1024 and down again
uint b = 0xFFFFFF00;
uint b_save = b;
uint64_t b64 = b;
for (unsigned int i = 0; i < 1024; ++i)
{
die_unless(b.u64() == b64);
die_unless(b.ull() == b64);
die_unless(b != a);
++b, ++b64;
}
die_unless(b != b_save);
for (unsigned int i = 0; i < 1024; ++i)
{
die_unless(b.u64() == b64);
die_unless(b.ull() == b64);
die_unless(b != a);
--b, --b64;
}
die_unless(b.u64() == b64);
die_unless(b.ull() == b64);
die_unless(b == b_save);
// check min and max value
die_unless(uint::min() <= a);
die_unless(uint::max() >= a);
die_unless(std::numeric_limits<uint>::min() < a);
die_unless(std::numeric_limits<uint>::max() > a);
// check simple math
a = 42;
a = a + a;
die_unless(a == uint(84));
die_unless(a.ull() == 84);
a += uint(0xFFFFFF00);
die_unless(a.ull() == 84 + static_cast<unsigned long long>(0xFFFFFF00));
}
int main()
{
dotest<foxxll::uint40>(5);
dotest<foxxll::uint48>(6);
return 0;
}
/**************************************************************************/
| 23.939759
| 76
| 0.519879
|
ivotron
|
db3cbb8b5762033585415fa454b0f5ebb21ea627
| 1,257
|
cpp
|
C++
|
cpp/arrayMisc/bitwiseAndNumbersRange.cpp
|
locmpham/codingtests
|
3805fc98c0fa0dbee52e12531f6205e77b52899e
|
[
"MIT"
] | null | null | null |
cpp/arrayMisc/bitwiseAndNumbersRange.cpp
|
locmpham/codingtests
|
3805fc98c0fa0dbee52e12531f6205e77b52899e
|
[
"MIT"
] | null | null | null |
cpp/arrayMisc/bitwiseAndNumbersRange.cpp
|
locmpham/codingtests
|
3805fc98c0fa0dbee52e12531f6205e77b52899e
|
[
"MIT"
] | 1
|
2021-07-09T19:13:11.000Z
|
2021-07-09T19:13:11.000Z
|
/*
LEETCODE: 201
Given two integers left and right that represent the range [left, right], return the bitwise AND
of all numbers in this range, inclusive.
Example 1:
Input: left = 5, right = 7
Output: 4
Example 2:
Input: left = 0, right = 0
Output: 0
Example 3:
Input: left = 1, right = 2147483647
Output: 0
Constraints:
0 <= left <= right <= 231 - 1
*/
#include <iostream>
using namespace std;
int rangeBitwiseAnd(int left, int right) {
int count = 0;
// 1) Find position of Most Significant Bit (MSB) in both numbers, msb_p.
// 2) If positions of MSB are different, then result is 0.
// 3) If positions are same. Let positions be msb_p, return 2**msb_p as result.
while (left != right) {
left >>= 1;
right >>= 1;
count++;
}
// If msb_p of left and right are different, left & right will end up = 0
// If they are the same position, left and right will end up = 1
return left << count;
}
int main() {
cout << "[5, 7]: " << rangeBitwiseAnd(5, 7) << endl;
cout << "[0, 0]: " << rangeBitwiseAnd(0, 0) << endl;
cout << "[1, 2147483647]: " << rangeBitwiseAnd(1, 2147483647) << endl;
}
| 19.338462
| 101
| 0.575975
|
locmpham
|
db41a8c8d2f7f228503e332d0e42636c7a7515a4
| 11,916
|
hpp
|
C++
|
tests/test_kel_coroutines.hpp
|
DymOK93/kelcoro
|
ce5f974446296153fdcc63fd136dfc0c48970c39
|
[
"Apache-2.0"
] | null | null | null |
tests/test_kel_coroutines.hpp
|
DymOK93/kelcoro
|
ce5f974446296153fdcc63fd136dfc0c48970c39
|
[
"Apache-2.0"
] | null | null | null |
tests/test_kel_coroutines.hpp
|
DymOK93/kelcoro
|
ce5f974446296153fdcc63fd136dfc0c48970c39
|
[
"Apache-2.0"
] | null | null | null |
#ifndef TEST_KEL_COROUTINES_HPP
#define TEST_KEL_COROUTINES_HPP
#include <atomic>
#include <cassert>
#include <coroutine>
#include <iterator>
#include <memory_resource>
#include <ranges>
#include <set>
#include <string>
#include <string_view>
#include <thread>
#include <vector>
#include "test_kel_base.hpp"
import kel.coro;
import kel.traits;
namespace kel::test {
struct one {};
struct two {
using input_type = int;
};
struct three {};
struct four {};
} // namespace kel::test
namespace kel {
template <>
struct event_traits<named_tag<"Event">> {
using input_type = int;
};
template <>
struct event_traits<test::three> {
using input_type = std::vector<std::string>;
};
} // namespace kel
namespace test {
template <typename Name>
inline constinit kel::event_t<Name> event{};
struct test_selector {
template <typename Event>
auto& operator()(std::type_identity<Event>) const noexcept {
return ::test::event<Event>;
}
};
} // namespace test
namespace kel::test {
inline task<size_t> Task(int i) {
auto& p = co_await this_coro::promise;
auto handle = co_await this_coro::handle;
co_return i;
}
inline generator<int> Foo() {
auto& p = co_await this_coro::promise;
auto handle = co_await this_coro::handle;
for (int i = 0;; ++i)
co_yield co_await Task(i);
}
TEST(Generator) {
static_assert(std::ranges::input_range<kel::generator<size_t>&&>);
static_assert(std::input_iterator<kel::generator<std::vector<int>>::iterator>);
static_assert(std::ranges::output_range<kel::generator<int>, int> &&
std::ranges::input_range<kel::generator<int>>);
int i = 1;
for (auto value :
Foo().view() | ::std::views::take(100) | std::views::filter([](auto v) { return v % 2; })) {
verify(value == i);
i += 2;
}
}
void split_str(std::string_view s, char delimiter, generator<std::string_view> consumator) {
for (auto& out : consumator) {
const auto sub_end = s.find(delimiter);
out = s.substr(0, sub_end);
if (sub_end != std::string_view::npos)
s.remove_prefix(sub_end + 1);
else
break;
}
}
TEST(Consumator) {
split_str("h h h h h", ' ',
make_consumator<std::string_view>([](std::string_view s) { verify(s == "h"); }));
}
// clang-format off
template<std::ranges::borrowed_range... Ranges>
auto zip(Ranges&&... rs)->generator<decltype(std::tie(std::declval<Ranges>()[0]...))> {
for (size_t i = 0; ((i < rs.size()) && ...); ++i)
co_await yield(rs[i]...);
}
TEST(ZIP) {
std::vector<size_t> vec;
vec.resize(12, 20);
std::string sz = "Hello world";
for (auto [a,b,c] : zip(vec, sz, std::string_view(sz))) {
verify(a == 20);
}
}
// clang-format on
// x and y are shown, not yields away. Any lvalue in kel::generator will be yielded like this,
// rvalues will be transformed into generator::value_type and stored until generator resumes
// this solves several problems:
// better perfomance(no copy) / move
// making yield_value always noexcept for lvalues(important for coroutines)
// yielding an references
// interesting applications on consumer side
inline generator<const int> ViewGenerator() {
int x = 1;
int y = 2;
while (x < 100) {
co_await yield(++x);
co_yield y;
}
}
TEST(ViewGenerator) {
std::set<const int*> addresses;
for (auto& i : ViewGenerator())
addresses.emplace(&i);
verify(addresses.size() == 2);
}
template <typename MemoryResource>
inline logical_thread_mm<MemoryResource> Multithread(std::allocator_arg_t, MemoryResource,
std::atomic<int32_t>& value) {
auto& p = co_await this_coro::promise;
auto handle = co_await this_coro::handle;
co_await jump_on(another_thread);
for (auto i : std::views::iota(0, 100))
++value;
}
template <typename MemoryResource = std::allocator<std::byte>>
inline void Moo(std::atomic<int32_t>& value) {
std::vector<logical_thread_mm<MemoryResource>> workers;
for (int i = 0; i < 10; ++i)
workers.emplace_back(Multithread<MemoryResource>(std::allocator_arg, MemoryResource{}, value));
stop(workers); // more effective then just dctors for all
}
TEST(LogicalThread) {
std::atomic<int32_t> i;
Moo(i);
verify(i == 1000); // 10 coroutines * 100 increments
}
kel::logical_thread Bar(bool& requested) {
auto& promise = co_await this_coro::promise;
co_await jump_on(another_thread);
auto token = co_await this_coro::stop_token;
while (true) {
std::this_thread::sleep_for(std::chrono::microseconds(5));
if (token.stop_requested()) {
requested = true;
co_return;
}
}
}
TEST(CoroutinesIntegral) {
bool is_requested = false;
Bar(is_requested);
verify(is_requested == true);
}
struct statefull_resource {
size_t sz = 0;
// sizeof of this thing affects frame size with 2 multiplier bcs its saved in frame + saved for coroutine
void* allocate(size_t size) {
sz = size;
return ::operator new(size);
}
void deallocate(void* ptr, size_t size) noexcept {
assert(sz == size); // cant throw here(std::terminate)
::operator delete(ptr, size);
}
};
TEST(LogicalThreadMM) {
std::atomic<int32_t> i;
Moo<statefull_resource>(i);
verify(i == 1000); // 10 coroutines * 100 increments
}
task<size_t, statefull_resource> TaskMM(int i, statefull_resource) {
auto& p = co_await this_coro::promise;
co_return i;
}
generator<task<size_t, statefull_resource>, std::allocator<std::byte>> GenMM() {
for (auto i : std::views::iota(0, 10))
co_yield TaskMM(i, statefull_resource{0});
}
async_task<size_t> GetResult(auto just_task) {
co_return co_await just_task;
}
TEST(GenMM) {
int i = 0;
for (auto& task : GenMM().view() | std::views::filter([](auto&&) { return true; })) {
verify(GetResult(std::move(task)).get() == i);
++i;
}
}
TEST(JobMM) {
auto job_creator = [](std::atomic<int32_t>& value,
std::pmr::memory_resource*) -> job_mm<std::pmr::polymorphic_allocator<std::byte>> {
auto th_id = std::this_thread::get_id();
co_await jump_on(another_thread);
verify(th_id != std::this_thread::get_id());
value.fetch_add(1, std::memory_order::release);
if (value.load(std::memory_order::relaxed) == 10)
value.notify_one();
};
std::atomic<int32_t> flag = 0;
for (auto i : std::views::iota(0, 10))
job_creator(flag, std::pmr::new_delete_resource());
while (flag.load(std::memory_order::acquire) != 10)
flag.wait(flag.load(std::memory_order::relaxed));
verify(flag == 10);
}
bool Foooo(int a, int b, std::function<bool(int&, int)> f, int c) {
int value = 10;
// POINT 2: invoke a Foooo from co_await call
auto result = f(value, a + b + c);
verify(value == 20);
// POINT 5: after coroutine suspends we are here
verify(result == true);
return result;
}
TEST(Call) {
// usually it used for async callbacks, but it is possible to use for synchronous callbacks too
[]() -> job {
// POINT 1: entering
// may auto or auto&&, value / summ / ret is a references to arguments in Foooo
auto [value, summ, ret] = co_await this_coro::invoked_in(Foooo, 10, 15, signature<bool(int&, int)>{}, 20);
verify(value == 10);
value = 20;
verify(summ == 45);
// POINT 3: part of the coroutine(from co_await call to next suspend) becomes callback for Foooo
ret = true; // setting return value, because Foooo expects it from callback
// POINT 4: first coroutine suspend after co_await call
}();
}
job sub(std::atomic<int>& count) {
while (true) {
int i = co_await event<named_tag<"Event">>;
if (i == 0)
co_return;
if (count.fetch_add(i, std::memory_order::relaxed) == 1999999)
count.notify_one();
}
}
logical_thread writer(std::atomic<int>& count) {
co_await jump_on(another_thread);
for (auto i : std::views::iota(0, 1000)) {
sub(count);
co_await quit_if_requested;
}
}
logical_thread reader() {
co_await jump_on(another_thread);
for (;;) {
event<named_tag<"Event">>.notify_all(this_thread_executor{}, 1);
co_await quit_if_requested;
}
}
TEST(ThreadSafety) {
std::atomic<int> count = 0;
auto _2 = writer(count);
auto _4 = reader();
auto _5 = reader();
auto _3 = writer(count);
while (count.load() < 2000000)
count.wait(count.load());
stop(_2, _4, _5, _3);
event<named_tag<"Event">>.notify_all(this_thread_executor{}, 0);
}
async_task<void> waiter_any(uint32_t& count) {
co_await jump_on(another_thread);
for (int32_t i : std::views::iota(0, 100000)) {
auto variant = co_await when_any<one, two, three, four>(::test::test_selector{});
assert(variant.index() != 0); // something happens
count++;
}
}
async_task<void> waiter_all(uint32_t& count) {
co_await jump_on(another_thread);
for (int32_t i : std::views::iota(0, 100000)) {
auto tuple = co_await when_all<one, two, three, four>(::test::test_selector{});
assert(std::get<2>(tuple) == std::vector<std::string>(3, "hello world"));
assert(std::get<1>(tuple) == 5);
count++;
}
}
template <typename Event>
logical_thread notifier(auto& pool) {
co_await jump_on(another_thread);
while (true) {
pool.notify_all<Event>();
co_await quit_if_requested;
}
}
template <typename Event>
logical_thread notifier(auto& pool, auto input) {
co_await jump_on(another_thread);
while (true) {
pool.notify_all<Event>(input);
co_await quit_if_requested;
}
}
TEST(WhenAny) {
event_pool<this_thread_executor, ::test::test_selector> pool;
auto _1 = notifier<one>(pool);
auto _2 = notifier<two>(pool, 5);
auto _3 = notifier<three>(pool, std::vector<std::string>(3, "hello world"));
auto _4 = notifier<four>(pool);
uint32_t count = 0;
auto anyx = waiter_any(count);
anyx.wait();
stop(_1, _2, _3, _4);
pool.notify_all<one>();
pool.notify_all<two>(5);
pool.notify_all<three>(std::vector<std::string>(3, "hello world"));
pool.notify_all<four>();
verify(count == 100000);
}
TEST(WhenAll) {
event_pool<this_thread_executor, ::test::test_selector> pool;
auto _1 = notifier<one>(pool);
auto _2 = notifier<two>(pool, 5);
auto _3 = notifier<three>(pool, std::vector<std::string>(3, "hello world"));
auto _4 = notifier<four>(pool);
uint32_t count = 0;
auto allx = waiter_all(count);
allx.wait();
stop(_1, _2, _3, _4);
pool.notify_all<one>();
pool.notify_all<two>(5);
pool.notify_all<three>(std::vector<std::string>(3, "hello world"));
pool.notify_all<four>();
verify(count == 100000);
}
async_task<std::string> Afoo() {
co_await jump_on(another_thread);
co_return "hello world";
}
TEST(AsyncTasks) {
std::vector<async_task<std::string>> atasks;
for (auto i : std::views::iota(0, 1000))
atasks.emplace_back(Afoo());
for (auto& t : atasks)
if (rand() % 1000 > 900)
verify(t.get() == "hello world");
}
async_task<void> DoVoid() {
co_return;
}
TEST(VoidAsyncTask) {
auto task = DoVoid();
task.wait();
}
task<std::string> DoSmth() {
co_await jump_on(another_thread);
co_return "hello from task";
}
async_task<void> TasksUser() {
std::vector<task<std::string>> vec;
for (int i = 0; i < 10; ++i)
vec.emplace_back(DoSmth());
for (int i = 0; i < 8; ++i) {
std::string result = co_await vec[i];
verify(result == "hello from task");
}
co_return;
}
channel<std::tuple<int, double, float>> Creator() {
for (int i = 0; i < 100; ++i) {
co_await jump_on(another_thread);
std::this_thread::sleep_for(std::chrono::microseconds(3));
co_await yield{i, static_cast<double>(i), static_cast<float>(i)};
}
}
async_task<void> ChannelTester() {
auto my_stream = Creator();
int i = 0;
while (auto* v = co_await my_stream) {
auto tpl = std::tuple{i, static_cast<double>(i), static_cast<float>(i)};
verify(*v == tpl);
++i;
}
}
TEST(Channel) {
auto tester = ChannelTester();
tester.wait();
}
} // namespace kel::test
#endif // !TEST_KEL_COROUTINES_HPP
| 27.647332
| 110
| 0.657771
|
DymOK93
|
db4254ad3e11cfc870e6ab6142c24f75ac9e96d6
| 597
|
cpp
|
C++
|
dynamic/sticker.cpp
|
SiverPineValley/algo
|
29c75c6b226fdb15a3b6695e763ee49d4871094e
|
[
"Apache-2.0"
] | null | null | null |
dynamic/sticker.cpp
|
SiverPineValley/algo
|
29c75c6b226fdb15a3b6695e763ee49d4871094e
|
[
"Apache-2.0"
] | null | null | null |
dynamic/sticker.cpp
|
SiverPineValley/algo
|
29c75c6b226fdb15a3b6695e763ee49d4871094e
|
[
"Apache-2.0"
] | null | null | null |
// 9465
#include <iostream>
using namespace std;
int main(void)
{
int t, n;
int s[100001][2];
cin >> t;
while(t--)
{
cin >> n;
for(int i = 0; i < 2; i++)
for(int j = 1; j <= n; j++)
cin >> s[j][i];
int a[n+1][3];
for(int j = 0; j < 3; j++)
a[0][j] = 0;
for(int i = 1; i <= n; i++)
{
a[i][0] = max(a[i-1][0],a[i-1][1]);
a[i][0] = max(a[i][0],a[i-1][2]);
a[i][1] = max(a[i-1][0],a[i-1][2]) + s[i][0];
a[i][2] = max(a[i-1][0],a[i-1][1]) + s[i][1];
}
int ans = 0;
for(int i = 0; i < 3; i++)
ans = max(ans,a[n][i]);
cout << ans << "\n";
}
return 0;
}
| 19.258065
| 48
| 0.40871
|
SiverPineValley
|
db42860a87e154769ce66878f69c6e49cac0e6ef
| 4,609
|
cpp
|
C++
|
examples/22_remesher/main.cpp
|
Deiv99/cinolib
|
fbb6e951703764e5b97f074aede87752c3165d17
|
[
"MIT"
] | 532
|
2018-05-11T14:28:32.000Z
|
2022-03-29T12:42:07.000Z
|
examples/22_remesher/main.cpp
|
Deiv99/cinolib
|
fbb6e951703764e5b97f074aede87752c3165d17
|
[
"MIT"
] | 33
|
2018-08-01T16:47:01.000Z
|
2021-09-29T14:36:12.000Z
|
examples/22_remesher/main.cpp
|
Deiv99/cinolib
|
fbb6e951703764e5b97f074aede87752c3165d17
|
[
"MIT"
] | 64
|
2018-09-07T13:02:02.000Z
|
2022-03-13T18:17:29.000Z
|
/* This sample program reads a triangle mesh and performs
* an area equalizing remeshing scheme. This is a variant
* of the algorithm described in
*
* A Remeshing Approach to Multiresolution Modeling
* M.Botsch, L.Kobbelt
* Symposium on Geomtry Processing, 2004
*
* Enjoy!
*/
#include <QApplication>
#include <QGridLayout>
#include <QPushButton>
#include <QLabel>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <cinolib/meshes/meshes.h>
#include <cinolib/gui/qt/qt_gui_tools.h>
#include <cinolib/profiler.h>
#include <cinolib/remesh_BotschKobbelt2004.h>
using namespace cinolib;
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
int main(int argc, char **argv)
{
using namespace cinolib;
QApplication a(argc, argv);
QWidget window;
QPushButton but_mark_color("Mark Colors", &window);
QPushButton but_mark_creases("Mark Creases", &window);
QPushButton but_mark_boundary("Mark Boundary", &window);
QPushButton but_unmark_all("Unmark all", &window);
QPushButton but_remesh("Remesh", &window);
QSpinBox sb_crease_angle(&window);
QSpinBox sb_niters(&window);
QDoubleSpinBox sb_target_length(&window);
GLcanvas gui(&window);
QGridLayout layout;
sb_crease_angle.setMaximum(180);
sb_crease_angle.setMinimum(0);
sb_crease_angle.setValue(60);
sb_niters.setValue(10);
sb_target_length.setDecimals(4);
sb_target_length.setMinimum(0.0001);
sb_target_length.setMaximum(9999);
layout.addWidget(&but_mark_color,0,0,1,2);
layout.addWidget(&but_mark_creases,0,2,1,2);
layout.addWidget(new QLabel("Crease angle >=",&window),1,2);
layout.addWidget(&sb_crease_angle,1,3);
layout.addWidget(&but_mark_boundary,0,4,1,2);
layout.addWidget(&but_unmark_all,0,6,1,2);
layout.addWidget(&but_remesh,0,8,1,2);
layout.addWidget(new QLabel("#iters: ",&window),1,8);
layout.addWidget(&sb_niters,1,9);
layout.addWidget(new QLabel("target length: ",&window),2,8);
layout.addWidget(&sb_target_length,2,9);
layout.addWidget(&gui,3,0,1,10);
window.setLayout(&layout);
window.show();
window.resize(800,600);
std::string s = (argc==2) ? std::string(argv[1]) : std::string(DATA_PATH) + "/pyramid.off";
cinolib::DrawableTrimesh<> m(s.c_str());
m.show_marked_edge(true);
m.show_wireframe(true);
m.show_mesh_flat();
gui.push_obj(&m);
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QPushButton::connect(&but_mark_color, &QPushButton::clicked, [&]()
{
m.edge_mark_color_discontinuities();
m.updateGL();
gui.updateGL();
});
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QPushButton::connect(&but_mark_boundary, &QPushButton::clicked, [&]()
{
m.edge_mark_boundaries();
m.updateGL();
gui.updateGL();
});
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QPushButton::connect(&but_mark_creases, &QPushButton::clicked, [&]()
{
double thresh_rad = static_cast<double>(sb_crease_angle.value()) * M_PI/180.0;
for(uint eid=0; eid<m.num_edges(); ++eid)
{
if(m.edge_dihedral_angle(eid) > thresh_rad)
{
m.edge_data(eid).flags[MARKED] = true;
}
}
m.updateGL();
gui.updateGL();
});
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QPushButton::connect(&but_unmark_all, &QPushButton::clicked, [&]()
{
m.edge_set_flag(MARKED,false);
m.updateGL();
gui.updateGL();
});
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QPushButton::connect(&but_remesh, &QPushButton::clicked, [&]()
{
Profiler profiler;
for(int i=0; i<sb_niters.value(); ++i)
{
profiler.push("Remesh iteration");
remesh_Botsch_Kobbelt_2004(m, sb_target_length.value(),true);
profiler.pop();
m.updateGL();
gui.updateGL();
}
});
// default params: remesh with 1/10th edge length, preserving sharp features
sb_target_length.setValue(m.edge_avg_length()*0.1);
emit but_mark_creases.clicked();
// CMD+1 to show mesh controls.
SurfaceMeshControlPanel<DrawableTrimesh<>> panel(&m, &gui);
QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_1), &gui), &QShortcut::activated, [&](){panel.show();});
return a.exec();
}
| 32.457746
| 126
| 0.576915
|
Deiv99
|
b9cbaa0e4219e5faedfe205bd18b5f4c8d92b372
| 1,503
|
hpp
|
C++
|
include/eepp/ui/uitab.hpp
|
jayrulez/eepp
|
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
|
[
"MIT"
] | 37
|
2020-01-20T06:21:24.000Z
|
2022-03-21T17:44:50.000Z
|
include/eepp/ui/uitab.hpp
|
jayrulez/eepp
|
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
|
[
"MIT"
] | null | null | null |
include/eepp/ui/uitab.hpp
|
jayrulez/eepp
|
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
|
[
"MIT"
] | 9
|
2019-03-22T00:33:07.000Z
|
2022-03-01T01:35:59.000Z
|
#ifndef EE_UICUITAB_HPP
#define EE_UICUITAB_HPP
#include <eepp/ui/uiselectbutton.hpp>
namespace EE { namespace UI {
class UITabWidget;
class EE_API UITab : public UISelectButton {
public:
static UITab* New();
UITab();
Node* getOwnedWidget() const;
void setOwnedWidget( Node* ownedWidget );
virtual ~UITab();
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void setTheme( UITheme* Theme );
virtual const String& getText();
virtual UIPushButton* setText( const String& text );
virtual bool applyProperty( const StyleSheetProperty& attribute );
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& propertyIndex = 0 );
UITabWidget* getTabWidget();
virtual UIWidget* getExtraInnerWidget() const;
protected:
friend class UITabWidget;
Node* mOwnedWidget;
String mText;
std::string mOwnedName;
mutable UIWidget* mCloseButton{nullptr};
Float mDragTotalDiff;
UITabWidget* mTabWidget;
Uint32 onDrag( const Vector2f& position, const Uint32& flags, const Sizef& dragDiff );
Uint32 onDragStart( const Vector2i& position, const Uint32& flags );
Uint32 onDragStop( const Vector2i& position, const Uint32& flags );
virtual Uint32 onMessage( const NodeMessage* message );
virtual void onStateChange();
virtual void onAutoSize();
virtual void onParentChange();
virtual void onSizeChange();
void setOwnedNode();
void updateTab();
};
}} // namespace EE::UI
#endif
| 20.04
| 87
| 0.743846
|
jayrulez
|
b9d1380b2b595bd323f3f9d3141b5e6fdee12c5d
| 1,009
|
cpp
|
C++
|
cpp/1001-10000/1181-1190/Shortest Distance to Target Color.cpp
|
KaiyuWei/leetcode
|
fd61f5df60cfc7086f7e85774704bacacb4aaa5c
|
[
"MIT"
] | 150
|
2015-04-04T06:53:49.000Z
|
2022-03-21T13:32:08.000Z
|
cpp/1001-10000/1181-1190/Shortest Distance to Target Color.cpp
|
yizhu1012/leetcode
|
d6fa443a8517956f1fcc149c8c4f42c0ad93a4a7
|
[
"MIT"
] | 1
|
2015-04-13T15:15:40.000Z
|
2015-04-21T20:23:16.000Z
|
cpp/1001-10000/1181-1190/Shortest Distance to Target Color.cpp
|
yizhu1012/leetcode
|
d6fa443a8517956f1fcc149c8c4f42c0ad93a4a7
|
[
"MIT"
] | 64
|
2015-06-30T08:00:07.000Z
|
2022-01-01T16:44:14.000Z
|
class Solution {
public:
vector<int> shortestDistanceColor(vector<int>& colors, vector<vector<int>>& queries) {
int n = colors.size();
vector<vector<int>> dp(n, vector<int>(3, INT_MAX));
vector<int> pos(3, -1);
for (int i = 0; i < colors.size(); i++) {
int color = colors[i];
pos[color-1] = i;
for (int k = 0; k < 3; k++) {
dp[i][k] = pos[k] >= 0 ? i - pos[k] : INT_MAX;
}
}
pos[0] = pos[1] = pos[2] = -1;
for (int i = colors.size()-1; i >= 0; i--) {
int color = colors[i];
pos[color-1] = i;
for (int k = 0; k < 3; k++) {
dp[i][k] = min(dp[i][k], pos[k] >= 0 ? pos[k] - i : INT_MAX);
}
}
vector<int> ans;
for (auto& query : queries) {
int v = dp[query[0]][query[1]-1];
ans.push_back(v == INT_MAX ? -1 : v);
}
return ans;
}
};
| 30.575758
| 90
| 0.401388
|
KaiyuWei
|
b9d1392e2d588cc485187fe3befa34d47a21a7ce
| 616
|
cpp
|
C++
|
uva/chapter_1/the3nplus1problem.cpp
|
pi-guy-in-the-sky/competitive-programming
|
e079f6caf07b5de061ea4f56218f9b577e49a965
|
[
"MIT"
] | null | null | null |
uva/chapter_1/the3nplus1problem.cpp
|
pi-guy-in-the-sky/competitive-programming
|
e079f6caf07b5de061ea4f56218f9b577e49a965
|
[
"MIT"
] | null | null | null |
uva/chapter_1/the3nplus1problem.cpp
|
pi-guy-in-the-sky/competitive-programming
|
e079f6caf07b5de061ea4f56218f9b577e49a965
|
[
"MIT"
] | 1
|
2020-10-25T05:46:57.000Z
|
2020-10-25T05:46:57.000Z
|
// Problem ID: 100
// By Alexander Cai, 12-06-2019
// Accepted
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
int cycle_length(int n) {
int temp = n, length = 1;
while (temp != 1) {
if (temp % 2 == 0) temp >>= 1;
else temp = temp * 3 + 1;
length += 1;
}
return length;
}
int main() {
int i, j, l, max;
while (cin >> i >> j) {
int ti = i, tj = j;
if (i > j) swap(i, j);
max = 1;
for (int k = i; k <= j; k++) {
l = cycle_length(k);
if (l > max) max = l;
}
cout << ti << " " << tj << " " << max << endl;
}
return 0;
}
| 17.6
| 50
| 0.483766
|
pi-guy-in-the-sky
|
b9d22eef7ef7fafb3b9f6101105d48099da36a07
| 633
|
cpp
|
C++
|
1036.cpp
|
F-SpaceMan/uriChallenges
|
932f54f7bee622aacf648acb27a291905a7df92a
|
[
"MIT"
] | 1
|
2019-12-04T18:50:34.000Z
|
2019-12-04T18:50:34.000Z
|
1036.cpp
|
F-SpaceMan/uriChallenges
|
932f54f7bee622aacf648acb27a291905a7df92a
|
[
"MIT"
] | null | null | null |
1036.cpp
|
F-SpaceMan/uriChallenges
|
932f54f7bee622aacf648acb27a291905a7df92a
|
[
"MIT"
] | null | null | null |
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<math.h>
using namespace std;
int main()
{
double A, B, C, delta, divi, raiz, x1, x2;
cin >> A >> B >> C;
delta = (B*B) - (4*A*C);
raiz = sqrt(delta);
divi = 2*A;
if(delta < 0 || divi == 0)
{
cout << "Impossivel calcular" << endl;
}
else
{
x1 = (-B+raiz)/ divi;
x2 = (-B-raiz)/ divi;
cout << "R1 = " << fixed << setprecision(5) << x1 << endl;
cout << "R2 = " << fixed << setprecision(5) << x2 << endl;
}
system("pause");
return 0;
}
| 17.583333
| 67
| 0.447077
|
F-SpaceMan
|
b9d700ac0dece4568a1aff6a95abb72786c1ec56
| 9,942
|
cpp
|
C++
|
firmware/libraries/state-swallowing/state-swallowing.cpp
|
miaucl/sti-robot-competition
|
9984306a0b9c93d98d401e026df202e902c2c47c
|
[
"MIT"
] | null | null | null |
firmware/libraries/state-swallowing/state-swallowing.cpp
|
miaucl/sti-robot-competition
|
9984306a0b9c93d98d401e026df202e902c2c47c
|
[
"MIT"
] | null | null | null |
firmware/libraries/state-swallowing/state-swallowing.cpp
|
miaucl/sti-robot-competition
|
9984306a0b9c93d98d401e026df202e902c2c47c
|
[
"MIT"
] | null | null | null |
/*
state-analysis.h - Following state methods
Created by Mirko Indumi, 2019.
*/
#include "Arduino.h"
#include "math.h"
#include "config.h"
#include "sensors.h"
#include "actuators.h"
// Internal control flags
enum IState
{
is_start,
is_open,
is_move,
is_stopping,
is_bottle_swallowed,
is_back_off_start,
is_back_off,
is_off
};
static IState is_state = is_start;
static long openTimestamp = 0;
static long swallowingTimestamp = 0;
static long back_off_timestamp = 0;
static int bottleInRobot = 0;
static int proxDetectZero = 0;
void stateSwallowingEnterRoutine( boolean ledState[LED_COUNT],
boolean flags[FLAG_COUNT])
{
ledState[LED_RUNNING] = HIGH;
bottleInRobot = 0;
is_state = is_start;
}
void stateSwallowingRoutine(int proximityMeasurements[SENSOR_PROXIMITY_COUNT][SENSOR_PROXIMITY_MEASUREMENT_COUNT],
int proximityAmbientMeasurements[SENSOR_PROXIMITY_COUNT],
int proximityAmbientVarianceMeasurements[SENSOR_PROXIMITY_COUNT],
double motorSpeeds[ACTUATOR_MOTOR_COUNT],
double motorSpeedMeasurements[ACTUATOR_MOTOR_COUNT],
int servoAngles[ACTUATOR_SERVO_COUNT],
boolean btnState[BTN_COUNT],
boolean ledState[LED_COUNT],
boolean flags[FLAG_COUNT])
{
#ifdef SERIAL_ENABLE
Serial.print("swallowing(");
Serial.print(is_state);
Serial.print(")\t");
#endif
#ifdef DEBUG_ENABLE
if (Serial.available() > 0)
{
char b = Serial.read();
if (b == ' ')
{
stopMotor(ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
stopMotor(ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
is_state = is_off;
}
else if (b == 's')
{
// Stop motors
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = 0;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = 0;
writeRawMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeRawMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
}
}
#endif
// Start swallowing bottle
if (is_state == is_start)
{
#ifdef SERIAL_ENABLE
Serial.print("open");
#endif
servoAngles[ACTUATOR_SERVO_BAR_RIGHT] = ACTUATOR_SERVO_BAR_RIGHT_OPEN;
servoAngles[ACTUATOR_SERVO_BAR_LEFT] = ACTUATOR_SERVO_BAR_LEFT_OPEN;
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_RIGHT, ACTUATOR_SERVO_BAR_RIGHT_PIN);
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_LEFT, ACTUATOR_SERVO_BAR_LEFT_PIN);
openTimestamp = millis();
is_state = is_open;
}
// Opening the bar
if (is_state == is_open)
{
if (millis() - openTimestamp > SWALLOWING_OPEN_DURATION)
{
#ifdef SERIAL_ENABLE
Serial.print("opened");
#endif
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = SWALLOWING_SPEED;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = SWALLOWING_SPEED;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
swallowingTimestamp = millis();
proxDetectZero = getAverageProximityValue(proximityMeasurements, SENSOR_PROXIMITY_DETECT) - proximityAmbientMeasurements[SENSOR_PROXIMITY_DETECT];
is_state = is_move;
}
}
else if (is_state == is_move)
{
#ifdef SERIAL_ENABLE
Serial.print("move \ttime: ");
Serial.print(millis() - swallowingTimestamp);
Serial.print("\t");
#endif
int proxDetect = getAverageProximityValue(proximityMeasurements, SENSOR_PROXIMITY_DETECT) - proximityAmbientMeasurements[SENSOR_PROXIMITY_DETECT];
int proximityDownLeft = getAverageProximityValue(proximityMeasurements, SENSOR_PROXIMITY_DOWN_LEFT) - proximityAmbientMeasurements[SENSOR_PROXIMITY_DOWN_LEFT];
int proximityDownRight = getAverageProximityValue(proximityMeasurements, SENSOR_PROXIMITY_DOWN_RIGHT) - proximityAmbientMeasurements[SENSOR_PROXIMITY_DOWN_RIGHT];
#ifdef SERIAL_ENABLE
Serial.print("\tbottle detection: ");
Serial.print(proxDetectZero);
Serial.print(", ");
Serial.print(proxDetect);
Serial.print("\t");
#endif
if (millis() - swallowingTimestamp > SWALLOWING_DURATION)
{
#ifdef SERIAL_ENABLE
Serial.print(" > timeout");
#endif
// Stop motors
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = 0;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = 0;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
servoAngles[ACTUATOR_SERVO_BAR_RIGHT] = ACTUATOR_SERVO_BAR_RIGHT_CLOSED;
servoAngles[ACTUATOR_SERVO_BAR_LEFT] = ACTUATOR_SERVO_BAR_LEFT_CLOSED;
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_RIGHT, ACTUATOR_SERVO_BAR_RIGHT_PIN);
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_LEFT, ACTUATOR_SERVO_BAR_LEFT_PIN);
is_state = is_stopping;
}
else if (millis() - swallowingTimestamp > SWALLOWING_DURATION_OFFSET && fabsf(proxDetect - proxDetectZero) > SWALLOWING_BOTTLE_DETECTION_THRESHOLD)
{
#ifdef SERIAL_ENABLE
Serial.print(" > detection");
#endif
// Stop motors
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = 0;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = 0;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
bottleInRobot = 1;
servoAngles[ACTUATOR_SERVO_BAR_RIGHT] = ACTUATOR_SERVO_BAR_RIGHT_CLOSED;
servoAngles[ACTUATOR_SERVO_BAR_LEFT] = ACTUATOR_SERVO_BAR_LEFT_CLOSED;
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_RIGHT, ACTUATOR_SERVO_BAR_RIGHT_PIN);
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_LEFT, ACTUATOR_SERVO_BAR_LEFT_PIN);
is_state = is_stopping;
}
else if ((abs(proximityDownLeft) > WANDER_PROXIMITY_DOWN_THRESHOLD ||
abs(proximityDownRight) > WANDER_PROXIMITY_DOWN_THRESHOLD))// && flags[FLAG_ON_PLATFORM])
{
#ifdef SERIAL_ENABLE
Serial.print(" > down detection");
#endif
is_state = is_back_off_start;
// Stop motors
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = 0;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = 0;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
}
}
else if (is_state == is_back_off_start)
{
#ifdef SERIAL_ENABLE
Serial.print("start back off");
#endif
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = -WANDER_PLATFORM_SPEED;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = -WANDER_PLATFORM_SPEED;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
back_off_timestamp = millis();
is_state = is_back_off;
}
else if (is_state == is_back_off)
{
#ifdef SERIAL_ENABLE
Serial.print("time: ");
Serial.print(millis() - back_off_timestamp);
#endif
if (millis() - back_off_timestamp > SWALLOWING_BACK_OFF_DURATION)
{
// Stop motors
motorSpeeds[ACTUATOR_MOTOR_RIGHT] = 0;
motorSpeeds[ACTUATOR_MOTOR_LEFT] = 0;
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
writeMotorSpeed(motorSpeeds, ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
servoAngles[ACTUATOR_SERVO_BAR_RIGHT] = ACTUATOR_SERVO_BAR_RIGHT_CLOSED;
servoAngles[ACTUATOR_SERVO_BAR_LEFT] = ACTUATOR_SERVO_BAR_LEFT_CLOSED;
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_RIGHT, ACTUATOR_SERVO_BAR_RIGHT_PIN);
writeServoAngle(servoAngles, ACTUATOR_SERVO_BAR_LEFT, ACTUATOR_SERVO_BAR_LEFT_PIN);
flags[FLAG_STONES_DETECTED] = 1;
is_state = is_stopping;
}
}
else if (is_state == is_stopping)
{
if (fabsf(motorSpeedMeasurements[ACTUATOR_MOTOR_LEFT]) < SWALLOWING_STOPPING_THRESHOLD &&
fabsf(motorSpeedMeasurements[ACTUATOR_MOTOR_RIGHT]) < SWALLOWING_STOPPING_THRESHOLD)
{
#ifdef SERIAL_ENABLE
Serial.print("stopped and close");
#endif
if (flags[FLAG_STONES_DETECTED])
{
is_state = is_off;
}
else if (bottleInRobot == 1)
{
#ifdef SERIAL_ENABLE
Serial.print(" > bottle swallowed");
#endif
flags[FLAG_SWALLOWED_BOTTLE] = 1;
is_state = is_bottle_swallowed;
}
else
{
flags[FLAG_SWALLOW_TIMEOUT] = 1;
is_state = is_off;
}
}
}
#ifdef SERIAL_ENABLE
Serial.println();
#endif
}
void stateSwallowingExitRoutine(boolean ledState[LED_COUNT],
boolean flags[FLAG_COUNT])
{
ledState[LED_RUNNING] = LOW;
stopMotor(ACTUATOR_MOTOR_RIGHT, ACTUATOR_MOTOR_RIGHT_DIRECTION_PIN, ACTUATOR_MOTOR_RIGHT_SPEED_PIN);
stopMotor(ACTUATOR_MOTOR_LEFT, ACTUATOR_MOTOR_LEFT_DIRECTION_PIN, ACTUATOR_MOTOR_LEFT_SPEED_PIN);
// setServoAngle(ACTUATOR_SERVO_BAR_RIGHT_CLOSED, ACTUATOR_SERVO_BAR_RIGHT, ACTUATOR_SERVO_BAR_RIGHT_PIN);
// setServoAngle(ACTUATOR_SERVO_BAR_LEFT_CLOSED, ACTUATOR_SERVO_BAR_LEFT, ACTUATOR_SERVO_BAR_LEFT_PIN);
}
| 35.891697
| 166
| 0.736371
|
miaucl
|
b9da52f3fe1403d1391569fc27fa64a6ee233f26
| 144,723
|
cpp
|
C++
|
test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK2
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK4
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK9
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK10
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
int x;
#pragma omp threadprivate(x)
template <typename T>
T tmain() {
int a[2];
#pragma omp target
#pragma omp teams distribute parallel for copyin(x)
for (int i = 0; i < 2; ++i) {
a[i] = x;
}
return T();
}
int main() {
int a[2];
#ifdef LAMBDA
[&]() {
#pragma omp target
#pragma omp teams distribute parallel for copyin(x)
for (int i = 0; i < 2; ++i) {
// Skip global, bound tid and loop vars
a[i] = x;
// Skip global, bound tid and loop vars
[&]() {
a[i] = x;
}();
}
}();
return 0;
#else
#pragma omp target
#pragma omp teams distribute parallel for copyin(x)
for (int i = 0; i < 2; ++i) {
a[i] = x;
}
return tmain<int>();
//return 0;
#endif
}
// Skip global, bound tid and loop vars
// Skip global, bound tid and loop vars
// Skip global, bound tid and loop vars
// Skip global, bound tid and loop vars
// prev lb and ub
// iter variables
#endif
// CHECK1-LABEL: define {{[^@]+}}@main
// CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK1-NEXT: [[X_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[X_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK1-NEXT: [[TMP1:%.*]] = load i64, i64* [[X_CASTED]], align 8
// CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 8
// CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 8
// CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK1-NEXT: store i8* null, i8** [[TMP11]], align 8
// CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3:[0-9]+]], i64 -1, i64 2)
// CHECK1-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK1-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK1: omp_offload.failed:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64(i64 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2:[0-9]+]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK1: omp_offload.cont:
// CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
// CHECK1-NEXT: ret i32 [[CALL]]
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64
// CHECK1-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK1-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK1-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK1: cond.true:
// CHECK1-NEXT: br label [[COND_END:%.*]]
// CHECK1: cond.false:
// CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: br label [[COND_END]]
// CHECK1: cond.end:
// CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK1-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK1: omp.inner.for.cond:
// CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK1: omp.inner.for.body:
// CHECK1-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK1-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK1: omp.inner.for.inc:
// CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK1: omp.inner.for.end:
// CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK1: omp.loop.exit:
// CHECK1-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK1-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK1-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK1-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK1-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK1: cond.true:
// CHECK1-NEXT: br label [[COND_END:%.*]]
// CHECK1: cond.false:
// CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: br label [[COND_END]]
// CHECK1: cond.end:
// CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK1-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK1: omp.inner.for.cond:
// CHECK1-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK1: omp.inner.for.body:
// CHECK1-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK1-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK1: omp.body.continue:
// CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK1: omp.inner.for.inc:
// CHECK1-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK1-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK1: omp.inner.for.end:
// CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK1: omp.loop.exit:
// CHECK1-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
// CHECK1-SAME: () #[[ATTR3:[0-9]+]] comdat {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK1-NEXT: [[X_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[X_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK1-NEXT: [[TMP1:%.*]] = load i64, i64* [[X_CASTED]], align 8
// CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 8
// CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 8
// CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK1-NEXT: store i8* null, i8** [[TMP11]], align 8
// CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i64 2)
// CHECK1-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.4, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.5, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK1-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK1: omp_offload.failed:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34(i64 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK1: omp_offload.cont:
// CHECK1-NEXT: ret i32 0
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34
// CHECK1-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined..2 to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK1-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK1-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK1: cond.true:
// CHECK1-NEXT: br label [[COND_END:%.*]]
// CHECK1: cond.false:
// CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: br label [[COND_END]]
// CHECK1: cond.end:
// CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK1-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK1: omp.inner.for.cond:
// CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK1: omp.inner.for.body:
// CHECK1-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK1-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK1-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK1: omp.inner.for.inc:
// CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK1: omp.inner.for.end:
// CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK1: omp.loop.exit:
// CHECK1-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK1-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK1-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK1-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK1-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK1-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK1-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK1: cond.true:
// CHECK1-NEXT: br label [[COND_END:%.*]]
// CHECK1: cond.false:
// CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: br label [[COND_END]]
// CHECK1: cond.end:
// CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK1-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK1-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK1: omp.inner.for.cond:
// CHECK1-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK1: omp.inner.for.body:
// CHECK1-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK1-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK1: omp.body.continue:
// CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK1: omp.inner.for.inc:
// CHECK1-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK1-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK1: omp.inner.for.end:
// CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK1: omp.loop.exit:
// CHECK1-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK1-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK1-NEXT: ret i32* @x
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK1-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK1-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@main
// CHECK2-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK2-NEXT: [[X_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[X_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK2-NEXT: [[TMP1:%.*]] = load i64, i64* [[X_CASTED]], align 8
// CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 8
// CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 8
// CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK2-NEXT: store i8* null, i8** [[TMP11]], align 8
// CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3:[0-9]+]], i64 -1, i64 2)
// CHECK2-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK2-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK2-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK2: omp_offload.failed:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64(i64 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2:[0-9]+]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK2: omp_offload.cont:
// CHECK2-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
// CHECK2-NEXT: ret i32 [[CALL]]
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64
// CHECK2-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK2-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK2-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK2: cond.true:
// CHECK2-NEXT: br label [[COND_END:%.*]]
// CHECK2: cond.false:
// CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: br label [[COND_END]]
// CHECK2: cond.end:
// CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK2-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK2: omp.inner.for.cond:
// CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK2-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK2: omp.inner.for.body:
// CHECK2-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK2-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK2-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK2: omp.inner.for.inc:
// CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK2: omp.inner.for.end:
// CHECK2-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK2: omp.loop.exit:
// CHECK2-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK2-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK2-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK2-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK2-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK2-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK2: cond.true:
// CHECK2-NEXT: br label [[COND_END:%.*]]
// CHECK2: cond.false:
// CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: br label [[COND_END]]
// CHECK2: cond.end:
// CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK2-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK2: omp.inner.for.cond:
// CHECK2-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK2-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK2: omp.inner.for.body:
// CHECK2-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK2-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK2-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK2-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK2: omp.body.continue:
// CHECK2-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK2: omp.inner.for.inc:
// CHECK2-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK2-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK2: omp.inner.for.end:
// CHECK2-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK2: omp.loop.exit:
// CHECK2-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
// CHECK2-SAME: () #[[ATTR3:[0-9]+]] comdat {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK2-NEXT: [[X_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[X_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK2-NEXT: [[TMP1:%.*]] = load i64, i64* [[X_CASTED]], align 8
// CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 8
// CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 8
// CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK2-NEXT: store i8* null, i8** [[TMP11]], align 8
// CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i64 2)
// CHECK2-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.4, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.5, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK2-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK2-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK2: omp_offload.failed:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34(i64 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK2: omp_offload.cont:
// CHECK2-NEXT: ret i32 0
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34
// CHECK2-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined..2 to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK2-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK2-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK2: cond.true:
// CHECK2-NEXT: br label [[COND_END:%.*]]
// CHECK2: cond.false:
// CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: br label [[COND_END]]
// CHECK2: cond.end:
// CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK2-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK2: omp.inner.for.cond:
// CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK2-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK2: omp.inner.for.body:
// CHECK2-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK2-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK2-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK2-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK2-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK2: omp.inner.for.inc:
// CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK2: omp.inner.for.end:
// CHECK2-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK2: omp.loop.exit:
// CHECK2-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK2-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK2-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK2-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK2-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK2-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK2-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK2-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK2: cond.true:
// CHECK2-NEXT: br label [[COND_END:%.*]]
// CHECK2: cond.false:
// CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: br label [[COND_END]]
// CHECK2: cond.end:
// CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK2-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK2-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK2: omp.inner.for.cond:
// CHECK2-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK2-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK2-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK2: omp.inner.for.body:
// CHECK2-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK2-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK2-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK2-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK2: omp.body.continue:
// CHECK2-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK2: omp.inner.for.inc:
// CHECK2-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK2-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK2-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK2: omp.inner.for.end:
// CHECK2-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK2: omp.loop.exit:
// CHECK2-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK2-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK2-NEXT: ret i32* @x
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK2-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK2-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@main
// CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK3-NEXT: [[X_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[X_CASTED]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[X_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 4
// CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 4
// CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK3-NEXT: store i8* null, i8** [[TMP11]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3:[0-9]+]], i64 -1, i64 2)
// CHECK3-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK3-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK3: omp_offload.failed:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64(i32 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2:[0-9]+]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK3: omp_offload.cont:
// CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
// CHECK3-NEXT: ret i32 [[CALL]]
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64
// CHECK3-SAME: (i32 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[X_ADDR]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK3-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK3-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK3: cond.true:
// CHECK3-NEXT: br label [[COND_END:%.*]]
// CHECK3: cond.false:
// CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: br label [[COND_END]]
// CHECK3: cond.end:
// CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK3-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK3: omp.inner.for.cond:
// CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK3: omp.inner.for.body:
// CHECK3-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i32 [[TMP9]], i32 [[TMP10]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK3: omp.inner.for.inc:
// CHECK3-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK3: omp.inner.for.end:
// CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK3: omp.loop.exit:
// CHECK3-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTPREVIOUS_LB_]], i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTPREVIOUS_UB_]], i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP3]], i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK3-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK3: cond.true:
// CHECK3-NEXT: br label [[COND_END:%.*]]
// CHECK3: cond.false:
// CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: br label [[COND_END]]
// CHECK3: cond.end:
// CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK3-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK3: omp.inner.for.cond:
// CHECK3-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK3: omp.inner.for.body:
// CHECK3-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK3-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i32 0, i32 [[TMP13]]
// CHECK3-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK3: omp.body.continue:
// CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK3: omp.inner.for.inc:
// CHECK3-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK3-NEXT: store i32 [[ADD2]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK3: omp.inner.for.end:
// CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK3: omp.loop.exit:
// CHECK3-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
// CHECK3-SAME: () #[[ATTR3:[0-9]+]] comdat {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK3-NEXT: [[X_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[X_CASTED]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[X_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 4
// CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 4
// CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK3-NEXT: store i8* null, i8** [[TMP11]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i64 2)
// CHECK3-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.4, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.5, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK3-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK3: omp_offload.failed:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34(i32 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK3: omp_offload.cont:
// CHECK3-NEXT: ret i32 0
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34
// CHECK3-SAME: (i32 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined..2 to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[X_ADDR]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK3-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK3-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK3: cond.true:
// CHECK3-NEXT: br label [[COND_END:%.*]]
// CHECK3: cond.false:
// CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: br label [[COND_END]]
// CHECK3: cond.end:
// CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK3-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK3: omp.inner.for.cond:
// CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK3: omp.inner.for.body:
// CHECK3-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK3-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32, [2 x i32]*, i32*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i32 [[TMP9]], i32 [[TMP10]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK3: omp.inner.for.inc:
// CHECK3-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK3: omp.inner.for.end:
// CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK3: omp.loop.exit:
// CHECK3-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK3-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTPREVIOUS_LB_]], i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTPREVIOUS_UB_]], i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK3-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP3]], i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK3-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK3: cond.true:
// CHECK3-NEXT: br label [[COND_END:%.*]]
// CHECK3: cond.false:
// CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: br label [[COND_END]]
// CHECK3: cond.end:
// CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK3-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK3-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK3: omp.inner.for.cond:
// CHECK3-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK3: omp.inner.for.body:
// CHECK3-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK3-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i32 0, i32 [[TMP13]]
// CHECK3-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK3: omp.body.continue:
// CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK3: omp.inner.for.inc:
// CHECK3-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK3-NEXT: store i32 [[ADD2]], i32* [[DOTOMP_IV]], align 4
// CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK3: omp.inner.for.end:
// CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK3: omp.loop.exit:
// CHECK3-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK3-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK3-NEXT: ret i32* @x
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK3-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK3-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@main
// CHECK4-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK4-NEXT: [[X_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[X_CASTED]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[X_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 4
// CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 4
// CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK4-NEXT: store i8* null, i8** [[TMP11]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3:[0-9]+]], i64 -1, i64 2)
// CHECK4-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK4-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK4-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK4: omp_offload.failed:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64(i32 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2:[0-9]+]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK4: omp_offload.cont:
// CHECK4-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
// CHECK4-NEXT: ret i32 [[CALL]]
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l64
// CHECK4-SAME: (i32 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[X_ADDR]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK4-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK4-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK4: cond.true:
// CHECK4-NEXT: br label [[COND_END:%.*]]
// CHECK4: cond.false:
// CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: br label [[COND_END]]
// CHECK4: cond.end:
// CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK4-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK4: omp.inner.for.cond:
// CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK4-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK4: omp.inner.for.body:
// CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i32 [[TMP9]], i32 [[TMP10]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK4-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK4: omp.inner.for.inc:
// CHECK4-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK4: omp.inner.for.end:
// CHECK4-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK4: omp.loop.exit:
// CHECK4-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTPREVIOUS_LB_]], i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTPREVIOUS_UB_]], i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP3]], i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK4-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK4: cond.true:
// CHECK4-NEXT: br label [[COND_END:%.*]]
// CHECK4: cond.false:
// CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: br label [[COND_END]]
// CHECK4: cond.end:
// CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK4-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK4: omp.inner.for.cond:
// CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK4-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK4: omp.inner.for.body:
// CHECK4-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK4-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK4-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i32 0, i32 [[TMP13]]
// CHECK4-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK4-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK4: omp.body.continue:
// CHECK4-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK4: omp.inner.for.inc:
// CHECK4-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK4-NEXT: store i32 [[ADD2]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK4: omp.inner.for.end:
// CHECK4-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK4: omp.loop.exit:
// CHECK4-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
// CHECK4-SAME: () #[[ATTR3:[0-9]+]] comdat {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK4-NEXT: [[X_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* @x, align 4
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[X_CASTED]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[X_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to [2 x i32]**
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP8]], align 4
// CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8** [[TMP9]] to [2 x i32]**
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP10]], align 4
// CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK4-NEXT: store i8* null, i8** [[TMP11]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: call void @__kmpc_push_target_tripcount_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i64 2)
// CHECK4-NEXT: [[TMP14:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB3]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34.region_id, i32 2, i8** [[TMP12]], i8** [[TMP13]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.4, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.5, i32 0, i32 0), i8** null, i8** null, i32 0, i32 0)
// CHECK4-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
// CHECK4-NEXT: br i1 [[TMP15]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK4: omp_offload.failed:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34(i32 [[TMP1]], [2 x i32]* [[A]]) #[[ATTR2]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK4: omp_offload.cont:
// CHECK4-NEXT: ret i32 0
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l34
// CHECK4-SAME: (i32 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: store i32 [[X]], i32* [[X_ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined..2 to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[X_ADDR]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK4-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK4-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK4: cond.true:
// CHECK4-NEXT: br label [[COND_END:%.*]]
// CHECK4: cond.false:
// CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: br label [[COND_END]]
// CHECK4: cond.end:
// CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK4-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK4: omp.inner.for.cond:
// CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK4-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK4: omp.inner.for.body:
// CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32, [2 x i32]*, i32*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), i32 [[TMP9]], i32 [[TMP10]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK4-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK4: omp.inner.for.inc:
// CHECK4-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK4: omp.inner.for.end:
// CHECK4-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK4: omp.loop.exit:
// CHECK4-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 4
// CHECK4-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTPREVIOUS_LB_]], i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTPREVIOUS_UB_]], i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK4-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTPREVIOUS_LB__ADDR]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[DOTPREVIOUS_UB__ADDR]], align 4
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP3]], i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK4-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK4: cond.true:
// CHECK4-NEXT: br label [[COND_END:%.*]]
// CHECK4: cond.false:
// CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: br label [[COND_END]]
// CHECK4: cond.end:
// CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK4-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK4-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK4: omp.inner.for.cond:
// CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK4-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK4-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK4: omp.inner.for.body:
// CHECK4-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK4-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK4-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i32 0, i32 [[TMP13]]
// CHECK4-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK4-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK4: omp.body.continue:
// CHECK4-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK4: omp.inner.for.inc:
// CHECK4-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP14]], 1
// CHECK4-NEXT: store i32 [[ADD2]], i32* [[DOTOMP_IV]], align 4
// CHECK4-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK4: omp.inner.for.end:
// CHECK4-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK4: omp.loop.exit:
// CHECK4-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK4-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK4-NEXT: ret i32* @x
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK4-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK4-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@main
// CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 8
// CHECK9-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[CLASS_ANON]], %class.anon* [[REF_TMP]], i32 0, i32 0
// CHECK9-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP0]], align 8
// CHECK9-NEXT: call void @"_ZZ4mainENK3$_0clEv"(%class.anon* noundef [[REF_TMP]])
// CHECK9-NEXT: ret i32 0
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l46
// CHECK9-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK9-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK9-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK9-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR2]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK9-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK9-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK9-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK9-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK9-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK9-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK9-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK9: cond.true:
// CHECK9-NEXT: br label [[COND_END:%.*]]
// CHECK9: cond.false:
// CHECK9-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: br label [[COND_END]]
// CHECK9: cond.end:
// CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK9-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK9-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK9: omp.inner.for.cond:
// CHECK9-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK9: omp.inner.for.body:
// CHECK9-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK9-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK9-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK9: omp.inner.for.inc:
// CHECK9-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK9-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK9: omp.inner.for.end:
// CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK9: omp.loop.exit:
// CHECK9-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR2]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK9-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK9-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK9-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK9-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK9-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK9-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK9-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK9-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK9-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK9-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK9-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK9-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK9: cond.true:
// CHECK9-NEXT: br label [[COND_END:%.*]]
// CHECK9: cond.false:
// CHECK9-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: br label [[COND_END]]
// CHECK9: cond.end:
// CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK9-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK9-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK9: omp.inner.for.cond:
// CHECK9-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK9: omp.inner.for.body:
// CHECK9-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK9-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK9-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK9-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK9-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 0
// CHECK9-NEXT: store [2 x i32]* [[TMP0]], [2 x i32]** [[TMP14]], align 8
// CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 1
// CHECK9-NEXT: store i32* [[I]], i32** [[TMP15]], align 8
// CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 2
// CHECK9-NEXT: store i32* [[TMP1]], i32** [[TMP16]], align 8
// CHECK9-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(%class.anon.0* noundef [[REF_TMP]])
// CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK9: omp.body.continue:
// CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK9: omp.inner.for.inc:
// CHECK9-NEXT: [[TMP17:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP17]], 1
// CHECK9-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK9: omp.inner.for.end:
// CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK9: omp.loop.exit:
// CHECK9-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK9-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK9-NEXT: ret i32* @x
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK9-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK9-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@main
// CHECK10-SAME: () #[[ATTR0:[0-9]+]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[A:%.*]] = alloca [2 x i32], align 4
// CHECK10-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 8
// CHECK10-NEXT: store i32 0, i32* [[RETVAL]], align 4
// CHECK10-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[CLASS_ANON]], %class.anon* [[REF_TMP]], i32 0, i32 0
// CHECK10-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[TMP0]], align 8
// CHECK10-NEXT: call void @"_ZZ4mainENK3$_0clEv"(%class.anon* noundef [[REF_TMP]])
// CHECK10-NEXT: ret i32 0
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l46
// CHECK10-SAME: (i64 noundef [[X:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK10-NEXT: store i64 [[X]], i64* [[X_ADDR]], align 8
// CHECK10-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[X_ADDR]] to i32*
// CHECK10-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [2 x i32]*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), [2 x i32]* [[TMP0]], i32* [[CONV]])
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR2]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK10-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK10-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK10-NEXT: store i32 0, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK10-NEXT: store i32 1, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK10-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
// CHECK10-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 92, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_COMB_LB]], i32* [[DOTOMP_COMB_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK10-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
// CHECK10-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK10: cond.true:
// CHECK10-NEXT: br label [[COND_END:%.*]]
// CHECK10: cond.false:
// CHECK10-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: br label [[COND_END]]
// CHECK10: cond.end:
// CHECK10-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
// CHECK10-NEXT: store i32 [[COND]], i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK10-NEXT: store i32 [[TMP6]], i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK10: omp.inner.for.cond:
// CHECK10-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
// CHECK10-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK10: omp.inner.for.body:
// CHECK10-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_COMB_LB]], align 4
// CHECK10-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
// CHECK10-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_COMB_UB]], align 4
// CHECK10-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB3]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, [2 x i32]*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i64 [[TMP10]], i64 [[TMP12]], [2 x i32]* [[TMP0]], i32* [[TMP1]])
// CHECK10-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK10: omp.inner.for.inc:
// CHECK10-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: [[TMP14:%.*]] = load i32, i32* [[DOTOMP_STRIDE]], align 4
// CHECK10-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
// CHECK10-NEXT: store i32 [[ADD]], i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK10: omp.inner.for.end:
// CHECK10-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK10: omp.loop.exit:
// CHECK10-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]])
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], [2 x i32]* noundef nonnull align 4 dereferenceable(8) [[A:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR2]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca [2 x i32]*, align 8
// CHECK10-NEXT: [[X_ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[I:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK10-NEXT: store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK10-NEXT: store [2 x i32]* [[A]], [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: store i32* [[X]], i32** [[X_ADDR]], align 8
// CHECK10-NEXT: [[TMP0:%.*]] = load [2 x i32]*, [2 x i32]** [[A_ADDR]], align 8
// CHECK10-NEXT: [[TMP1:%.*]] = load i32*, i32** [[X_ADDR]], align 8
// CHECK10-NEXT: store i32 0, i32* [[DOTOMP_LB]], align 4
// CHECK10-NEXT: store i32 1, i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = trunc i64 [[TMP2]] to i32
// CHECK10-NEXT: [[TMP3:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
// CHECK10-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP3]] to i32
// CHECK10-NEXT: store i32 [[CONV]], i32* [[DOTOMP_LB]], align 4
// CHECK10-NEXT: store i32 [[CONV1]], i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: store i32 1, i32* [[DOTOMP_STRIDE]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
// CHECK10-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
// CHECK10-NEXT: call void @__kmpc_for_static_init_4(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP5]], i32 34, i32* [[DOTOMP_IS_LAST]], i32* [[DOTOMP_LB]], i32* [[DOTOMP_UB]], i32* [[DOTOMP_STRIDE]], i32 1, i32 1)
// CHECK10-NEXT: [[TMP6:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
// CHECK10-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
// CHECK10: cond.true:
// CHECK10-NEXT: br label [[COND_END:%.*]]
// CHECK10: cond.false:
// CHECK10-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: br label [[COND_END]]
// CHECK10: cond.end:
// CHECK10-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
// CHECK10-NEXT: store i32 [[COND]], i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTOMP_LB]], align 4
// CHECK10-NEXT: store i32 [[TMP8]], i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
// CHECK10: omp.inner.for.cond:
// CHECK10-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTOMP_UB]], align 4
// CHECK10-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
// CHECK10-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
// CHECK10: omp.inner.for.body:
// CHECK10-NEXT: [[TMP11:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
// CHECK10-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
// CHECK10-NEXT: store i32 [[ADD]], i32* [[I]], align 4
// CHECK10-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP1]], align 4
// CHECK10-NEXT: [[TMP13:%.*]] = load i32, i32* [[I]], align 4
// CHECK10-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
// CHECK10-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[TMP0]], i64 0, i64 [[IDXPROM]]
// CHECK10-NEXT: store i32 [[TMP12]], i32* [[ARRAYIDX]], align 4
// CHECK10-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 0
// CHECK10-NEXT: store [2 x i32]* [[TMP0]], [2 x i32]** [[TMP14]], align 8
// CHECK10-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 1
// CHECK10-NEXT: store i32* [[I]], i32** [[TMP15]], align 8
// CHECK10-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], %class.anon.0* [[REF_TMP]], i32 0, i32 2
// CHECK10-NEXT: store i32* [[TMP1]], i32** [[TMP16]], align 8
// CHECK10-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(%class.anon.0* noundef [[REF_TMP]])
// CHECK10-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
// CHECK10: omp.body.continue:
// CHECK10-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
// CHECK10: omp.inner.for.inc:
// CHECK10-NEXT: [[TMP17:%.*]] = load i32, i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP17]], 1
// CHECK10-NEXT: store i32 [[ADD3]], i32* [[DOTOMP_IV]], align 4
// CHECK10-NEXT: br label [[OMP_INNER_FOR_COND]]
// CHECK10: omp.inner.for.end:
// CHECK10-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
// CHECK10: omp.loop.exit:
// CHECK10-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]])
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@_ZTW1x
// CHECK10-SAME: () #[[ATTR4:[0-9]+]] comdat {
// CHECK10-NEXT: ret i32* @x
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK10-SAME: () #[[ATTR5:[0-9]+]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK10-NEXT: ret void
//
| 68.008929
| 432
| 0.583646
|
tkolar23
|
b9de9e1845927d3be88b38a57078bde0a13e35de
| 919
|
cpp
|
C++
|
src/ReplaceUTF8/ReplaceUTF8.cpp
|
dnasdw/ReplaceUTF8
|
1394503b98781fb72764ca02ae742789ef5d7d47
|
[
"MIT"
] | null | null | null |
src/ReplaceUTF8/ReplaceUTF8.cpp
|
dnasdw/ReplaceUTF8
|
1394503b98781fb72764ca02ae742789ef5d7d47
|
[
"MIT"
] | null | null | null |
src/ReplaceUTF8/ReplaceUTF8.cpp
|
dnasdw/ReplaceUTF8
|
1394503b98781fb72764ca02ae742789ef5d7d47
|
[
"MIT"
] | null | null | null |
#include <sdw.h>
int UMain(int argc, UChar* argv[])
{
if (argc != 5)
{
return 1;
}
string sPattern = UToU8(argv[3]);
string sReplacement = UToU8(argv[4]);
FILE* fp = UFopen(argv[1], USTR("rb"), false);
if (fp == nullptr)
{
return 1;
}
fseek(fp, 0, SEEK_END);
u32 uFileSize = ftell(fp);
fseek(fp, 0, SEEK_SET);
char* pTemp = new char[uFileSize + 1];
fread(pTemp, 1, uFileSize, fp);
fclose(fp);
pTemp[uFileSize] = '\0';
bool bBOM = false;
if (uFileSize >= 3 && pTemp[0] == '\xEF' && pTemp[1] == '\xBB' && pTemp[2] == '\xBF')
{
bBOM = true;
}
string sText;
if (bBOM)
{
sText = pTemp + 3;
}
else
{
sText = pTemp;
}
delete[] pTemp;
sText = Replace(sText, sPattern, sReplacement);
fp = UFopen(argv[2], USTR("wb"), false);
if (fp == nullptr)
{
return 1;
}
if (bBOM)
{
fwrite("\xEF\xBB\xBF", 3, 1, fp);
}
fwrite(sText.c_str(), 1, sText.size(), fp);
fclose(fp);
return 0;
}
| 17.673077
| 86
| 0.575626
|
dnasdw
|
b9ebdf1d86b5c6d54cb702e9e2313b9a42c0bf48
| 784
|
cpp
|
C++
|
src/action/Grab.cpp
|
RKJenamani/ada_feeding
|
2eb93216ddfc71d516b0cb9e909407d4361b907e
|
[
"BSD-3-Clause"
] | null | null | null |
src/action/Grab.cpp
|
RKJenamani/ada_feeding
|
2eb93216ddfc71d516b0cb9e909407d4361b907e
|
[
"BSD-3-Clause"
] | null | null | null |
src/action/Grab.cpp
|
RKJenamani/ada_feeding
|
2eb93216ddfc71d516b0cb9e909407d4361b907e
|
[
"BSD-3-Clause"
] | null | null | null |
#include "feeding/action/Grab.hpp"
namespace feeding {
namespace action {
//==============================================================================
void grabFood(
const std::shared_ptr<ada::Ada>& ada,
const std::shared_ptr<Workspace>& workspace)
{
if (!workspace->getDefaultFoodItem())
{
workspace->addDefaultFoodItemAtPose(
ada->getHand()->getEndEffectorBodyNode()->getTransform());
}
ada->getHand()->grab(workspace->getDefaultFoodItem());
}
//==============================================================================
void ungrabAndDeleteFood(
const std::shared_ptr<ada::Ada>& ada,
const std::shared_ptr<Workspace>& workspace)
{
ada->getHand()->ungrab();
workspace->deleteFood();
}
} // namespace action
} // namespace feeding
| 26.133333
| 80
| 0.55102
|
RKJenamani
|
b9ecc1ccd0e410d12d7d6537dcb7c6a57ffad4a3
| 1,495
|
cpp
|
C++
|
Homeworks/Homework-1/Task 2/DNSRecord.cpp
|
kgolov/uni-object-oriented-programming
|
9fac38a7bf9a0b673db8e5688714fe320793fed7
|
[
"MIT"
] | null | null | null |
Homeworks/Homework-1/Task 2/DNSRecord.cpp
|
kgolov/uni-object-oriented-programming
|
9fac38a7bf9a0b673db8e5688714fe320793fed7
|
[
"MIT"
] | null | null | null |
Homeworks/Homework-1/Task 2/DNSRecord.cpp
|
kgolov/uni-object-oriented-programming
|
9fac38a7bf9a0b673db8e5688714fe320793fed7
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include "DNSRecord.h"
DNSRecord::DNSRecord() {
setDomain("");
setIpAddress("");
}
DNSRecord::~DNSRecord() {
delete[] domainName;
delete[] ipAddress;
}
DNSRecord::DNSRecord(const char* domain, const char* ipaddr) {
setDomain(domain);
setIpAddress(ipaddr);
}
// Copy constructor
DNSRecord::DNSRecord(const DNSRecord& toCopy) {
setDomain(toCopy.domain());
setIpAddress(toCopy.ipaddr());
}
// Operator =, used later in the DNSCache class
DNSRecord& DNSRecord::operator=(const DNSRecord& toCopy) {
if (this != &toCopy) {
setDomain(toCopy.domain());
setIpAddress(toCopy.ipaddr());
}
return *this;
}
const char* DNSRecord::domain() const {
return domainName;
}
const char* DNSRecord::ipaddr() const {
return ipAddress;
}
void DNSRecord::setDomain(const char* domain) {
if (domain == nullptr) {
return;
}
delete[] domainName;
// Strlen for domain string
int size = strlen(domain) + 1;
// Allocate needed memory
domainName = new char[size];
// Copy the domain string, including the terminating zero
strcpy_s(domainName, size, domain);
}
void DNSRecord::setIpAddress(const char* ipaddr) {
if (ipaddr == nullptr) {
return;
}
delete[] ipAddress;
// Strlen for ipaddr string
int size = strlen(ipaddr) + 1;
// Allocate needed memory
ipAddress = new char[size];
// Copy the domain string, including the terminating zero
strcpy_s(ipAddress, size, ipaddr);
}
| 19.671053
| 63
| 0.666221
|
kgolov
|
b9ee342b5146afeae96e11cc3d993221cd900ec1
| 10,852
|
cpp
|
C++
|
src/DewDropPlayer/Engine/AC3Engine.cpp
|
kineticpsychology/Dew-Drop-Project
|
1704ac491395800c0b1e54d1d0fd761fc5a71296
|
[
"0BSD"
] | null | null | null |
src/DewDropPlayer/Engine/AC3Engine.cpp
|
kineticpsychology/Dew-Drop-Project
|
1704ac491395800c0b1e54d1d0fd761fc5a71296
|
[
"0BSD"
] | null | null | null |
src/DewDropPlayer/Engine/AC3Engine.cpp
|
kineticpsychology/Dew-Drop-Project
|
1704ac491395800c0b1e54d1d0fd761fc5a71296
|
[
"0BSD"
] | null | null | null |
/*******************************************************************************
* *
* COPYRIGHT (C) Aug, 2020 | Polash Majumdar *
* *
* This file is part of the Dew Drop Player project. The file content comes *
* "as is" without any warranty of definitive functionality. The author of the *
* code is not to be held liable for any improper functionality, broken code, *
* bug and otherwise unspecified error that might cause damage or might break *
* the application where this code is imported. In accordance with the *
* Zero-Clause BSD licence model of the Dew Drop project, the end-user/adopter *
* of this code is hereby granted the right to use, copy, modify, and/or *
* distribute this code with/without keeping this copyright notice. *
* *
* TL;DR - It's a free world. All of us should give back to the world that we *
* get so much from. I have tried doing my part by making this code *
* free (as in free beer). Have fun. Just don't vandalize the code *
* or morph it into a malicious one. *
* *
*******************************************************************************/
#include "AC3Engine.h"
// Don't ask. Ripped from the example provided in the liba52 sample decoder code
int16_t AC3ENGINE::_convert(int32_t i)
{
if (i > 0x43c07fff)
return 32767;
else if (i < 0x43bf8000)
return -32768;
else
return i - 0x43c00000;
}
// Don't ask. Ripped from the example provided in the liba52 sample decoder code
void AC3ENGINE::_float2s16_2(float * _f, int16_t * s16)
{
int i;
int32_t * f = (int32_t *)_f;
for (i = 0; i < 256; i++) {
s16[2 * i] = this->_convert(f[i]);
s16[2 * i + 1] = this->_convert(f[i + 256]);
}
}
// Similar to AAC, do a manual parsing of the frames like a lookup
// so that we can do a more easy seek/tell going by frame index
void AC3ENGINE::_ParseA52Frames()
{
DWORD dwFrameOffset, dwFrameSize, dwFlags = 0;
dwFrameOffset = 0;
do
{
dwFrameSize = a52_syncinfo(&(_lpEncodedSrcData[dwFrameOffset]), (int*)&dwFlags, (int*)&_dwSampleRate, (int*)&_dwBitrate);
_btChannels = (BYTE)(dwFlags & A52_CHANNEL_MASK);
if (dwFrameSize > 0)
{
_dwFrameCount++;
if (_dwFrameCount == 1)
_FrameLookup = (LPDWORD)LocalAlloc(LPTR, _dwFrameCount * sizeof(DWORD));
else
_FrameLookup = (LPDWORD)LocalReAlloc(_FrameLookup, _dwFrameCount * sizeof(DWORD), LHND);
_FrameLookup[_dwFrameCount - 1] = dwFrameOffset;
}
dwFrameOffset += dwFrameSize;
} while (dwFrameOffset < _dwSrcDataSize);
return;
}
// Free up the Frame dictionary
void AC3ENGINE::_Cleanup()
{
if (_FrameLookup)
{
LocalFree(_FrameLookup);
_FrameLookup = NULL;
}
if (_ac3State)
{
a52_free(_ac3State);
_ac3State = NULL;
}
return;
}
// The main decoding logic
BYTE AC3ENGINE::_Decode()
{
DWORD dwCumulDecoded = 0, dwFlags, dwIndex;
float level = 1.0, bias = 384.0;
sample_t *samples = NULL;
// It might be tempting but do NOT use this variable as class member
// The reason is two pieces of 'Decode()' will eventually be called
// from a thread and might result in data overwriting!
BYTE FrameDecodeData[AC3_BLOCK_DECODED_SIZE] { 0 };
// Invalid chunk ID. Bail
if (_dwCurrentIndex >= CHUNKCOUNT) return DEWDEC_DECODE_ERROR;
ZeroMemory(&(_lpDecodedData[_dwCurrentIndex * CHUNKSIZE]), CHUNKSIZE);
// Take up the leftovers
if (_dwOverflow > 0)
CopyMemory(&(_lpDecodedData[_dwCurrentIndex * CHUNKSIZE]), _lpDecodedChunk, _dwOverflow);
dwCumulDecoded = _dwOverflow;
// No more data left to decode. Bail.
if (_bNoMoreData) return DEWDEC_DECODE_EOD;
do
{
dwFlags = AC3_INTENDED_OUT_CHANNELS;
a52_frame(_ac3State, &_lpEncodedSrcData[_FrameLookup[_dwCurrentPos]], (int*)&dwFlags, &level, bias);
// Set this flag ASAP so that the other threaded call to Decode can
// understand that no more data is left
if (_dwCurrentPos >= (_dwFrameCount - 1)) _bNoMoreData = TRUE;
samples = a52_samples(_ac3State);
for (dwIndex = 0; dwIndex < AC3_BLOCKS_PER_FRAME; dwIndex++)
{
a52_block(_ac3State);
this->_float2s16_2(samples, (int16_t*)FrameDecodeData);
CopyMemory(&(_lpDecodedChunk[dwIndex * AC3_BLOCK_DECODED_SIZE]), FrameDecodeData, AC3_BLOCK_DECODED_SIZE);
}
_dwCurrentPos++;
if ((dwCumulDecoded + AC3_FRAME_DECODED_SIZE) >= CHUNKSIZE)
{
// Keep the overflow amount in the lpDecodedChunk buffer
_dwOverflow = (dwCumulDecoded + AC3_FRAME_DECODED_SIZE) - CHUNKSIZE;
CopyMemory(&(_lpDecodedData[_dwCurrentIndex * CHUNKSIZE + dwCumulDecoded]), _lpDecodedChunk, CHUNKSIZE - dwCumulDecoded);
CopyMemory(_lpDecodedChunk, &(_lpDecodedChunk[CHUNKSIZE - dwCumulDecoded]), _dwOverflow);
return DEWDEC_DECODE_OK;
}
else
{
// Not yet there. Add up the cumulative decoded data value
// and continue with the looped decoding
CopyMemory(&(_lpDecodedData[_dwCurrentIndex * CHUNKSIZE + dwCumulDecoded]), _lpDecodedChunk, AC3_FRAME_DECODED_SIZE);
dwCumulDecoded += AC3_FRAME_DECODED_SIZE;
}
if (_dwCurrentPos >= (_dwFrameCount - 1))
{
_bNoMoreData = TRUE;
return DEWDEC_DECODE_EOD;
}
} while (TRUE);
return DEWDEC_DECODE_ERROR;
}
// Set the frame cursor to the appropriate proportionate famre offset
BYTE AC3ENGINE::_Seek(DWORD dwMS)
{
// As typical, we won't allow seeking if the media is not playing or paused
if (_btStatus == DEWS_MEDIA_PLAYING || DEWS_MEDIA_PAUSED)
{
if (!_ac3State) return DEWERR_MM_ACTION;
if (_dwDuration == 0) return DEWERR_SUCCESS;
if (dwMS >= _dwDuration)
_dwCurrentPos = _dwFrameCount;
else
_dwCurrentPos = (DWORD)((float)dwMS * _fFPMS);
return DEWERR_SUCCESS;
}
return DEWERR_MM_ACTION;
}
// The same. Initialize the library name and the media type
AC3ENGINE::AC3ENGINE()
{
_btMediaType = DEWMT_AC3;
StringCchPrintf(_wsLibrary, MAX_PATH, L"liba52 version 0.7.4");
}
// This is a stub indirect delegate to the main 'Load' function
BYTE AC3ENGINE::Load(HWND notificationWindow, LPCWSTR srcFile)
{
// Sanity checks
if (notificationWindow == NULL || notificationWindow == INVALID_HANDLE_VALUE) return DEWERR_INVALID_PARAM;
if (!srcFile) return DEWERR_INVALID_FILE;
// Store the entire file into the internal storage
if (!this->_StoreRawInputData(srcFile)) return DEWERR_FILE_READ;
// Set the flag to indicate that we're going to make an overloaded call
_bOverloadedLoadFunctionCall = TRUE;
StringCchPrintf(_wsSrcFile, MAX_CHAR_PATH, L"%s", srcFile);
// Then call the actual function to load the media
return this->Load(notificationWindow, _lpEncodedSrcData, _dwSrcDataSize);
}
// The main 'Load' function which loads by input source data
BYTE AC3ENGINE::Load(HWND notificationWindow, LPBYTE srcDataBytes, DWORD dataSize)
{
MMRESULT mmr = 0;
if (notificationWindow == NULL || notificationWindow == INVALID_HANDLE_VALUE) return DEWERR_INVALID_PARAM;
if (!srcDataBytes) return DEWERR_INVALID_PARAM;
if (dataSize <= 0x00) return DEWERR_INVALID_PARAM;
// Set the notification window
_hWndNotify = notificationWindow;
// Proceed with lpEncodedSrcData population only if this function
// has been called explicitly from outside (and not an overloaded call)
if (!_bOverloadedLoadFunctionCall)
{
_dwSrcDataSize = dataSize;
_lpEncodedSrcData = (LPBYTE)LocalAlloc(LPTR, _dwSrcDataSize);
CopyMemory(_lpEncodedSrcData, srcDataBytes, _dwSrcDataSize);
}
_ac3State = a52_init(MM_ACCEL_DJBFFT);
if (!_ac3State) return DEWERR_ENGINE_STARTUP;
// Setup the frame list and set the continuous frame marker
_ParseA52Frames();
_dwCurrentPos = 0;
// Setup WAVEFORMATEX (we'll go with 16 bit depth).
_wfex.cbSize = 0;
_wfex.wFormatTag = WAVE_FORMAT_PCM;
_wfex.wBitsPerSample = 16;
_wfex.nChannels = AC3_INTENDED_OUT_CHANNELS;
_wfex.nSamplesPerSec = _dwSampleRate;
_wfex.nBlockAlign = _wfex.wBitsPerSample * _wfex.nChannels / 8;
_wfex.nAvgBytesPerSec = _wfex.nSamplesPerSec * _wfex.nBlockAlign;
// Since the samples per frame is fixed and we have the frame count
// get the total sample count as well.
_dwTotalSamples = _dwFrameCount * AC3_BLOCKS_PER_FRAME * AC3_SAMPLES_PER_BLOCK_PER_CHANNEL;
_dwDuration = (DWORD)((float)_dwTotalSamples / (((float)_dwSampleRate)/1000.0f));
_fFPMS = (float)_dwFrameCount / (float)_dwDuration;
_btStatus = DEWS_MEDIA_LOADED;
return DEWERR_SUCCESS;
}
// Derive the time from the frame cursor
DWORD AC3ENGINE::Tell()
{
if (!_ac3State)
return (DWORD)0xFFFFFFFF; // INVALID_HANDLE_VALUE
return ((_dwCurrentPos * _dwDuration)/_dwFrameCount);
}
// Housekeeping and cleanup
AC3ENGINE::~AC3ENGINE()
{
this->_Cleanup();
return;
}
// Isolated method to dabble and see if the file is loadable
BOOL AC3ENGINE::IsLoadable(LPCWSTR testFile)
{
HANDLE hTmpAC3 = NULL;
DWORD dwLength = 0;
// Minimum bytes to satisfoctoily conclude if the stream looks like AC3
const DWORD MIN_AC3_BYTES = 7;
BYTE lpTmpAC3Data[MIN_AC3_BYTES];
a52_state_t *tmpAC3State = NULL;
DWORD dwTmpFlags, dwTmpSampleRate, dwTmpBitrate;
int iRet = 0;
hTmpAC3 = CreateFile(testFile, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hTmpAC3 == NULL || hTmpAC3 == INVALID_HANDLE_VALUE) return FALSE;
dwLength = GetFileSize(hTmpAC3, NULL);
if (dwLength < MIN_AC3_BYTES)
{
CloseHandle(hTmpAC3);
return FALSE;
}
ReadFile(hTmpAC3, lpTmpAC3Data, MIN_AC3_BYTES, &dwLength, NULL);
CloseHandle(hTmpAC3);
tmpAC3State = a52_init(MM_ACCEL_DJBFFT);
if (!tmpAC3State) return FALSE;
iRet = a52_syncinfo(lpTmpAC3Data, (int*)&dwTmpFlags,
(int*)&dwTmpSampleRate, (int*)&dwTmpBitrate);
a52_free(tmpAC3State);
return (iRet > 0);
}
| 38.211268
| 133
| 0.636933
|
kineticpsychology
|
b9ee5f9f6e3865f9d5a7bd5521d0f5f507d04c3c
| 2,591
|
cpp
|
C++
|
db/BucketHeaderPage.cpp
|
LPetrlik/karindb
|
8fe2b953c13f1d1aed9bb550799f7cfaf13b50ea
|
[
"MIT"
] | null | null | null |
db/BucketHeaderPage.cpp
|
LPetrlik/karindb
|
8fe2b953c13f1d1aed9bb550799f7cfaf13b50ea
|
[
"MIT"
] | null | null | null |
db/BucketHeaderPage.cpp
|
LPetrlik/karindb
|
8fe2b953c13f1d1aed9bb550799f7cfaf13b50ea
|
[
"MIT"
] | null | null | null |
/* Copyright (c) 2015 Kerio Technologies s.r.o.
*
* 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 OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
* LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder shall not
* be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization of the
* copyright holder.
*/
// BucketHeaderPage.cpp - bucket file header page.
#include "stdafx.h"
#include "BucketHeaderPage.h"
namespace kerio {
namespace hashdb {
void BucketHeaderPage::validate() const
{
HeaderPage::validate();
// HighestPageNumber must be HighestBucket + 1
// 16 4 HighestPageNumber: highest page number in this file
// 24 4 HighestBucket: highest bucket in use
const uint32_t highestBucketNumber = getHighestBucket();
const uint32_t highestPageNumber = getHighestPageNumber();
RAISE_DATABASE_CORRUPTED_IF(highestPageNumber != highestBucketNumber + 1, "bad highest bucket number %u for bucket file with %u pages on %s", highestBucketNumber, highestPageNumber, getId().toString());
// DataSize >= NumberOfRecords * minimum record size
const uint64_t numberOfRecords = getDatabaseNumberOfRecords();
const uint64_t dataSize = getDataSize();
RAISE_DATABASE_CORRUPTED_IF(numberOfRecords * 5 > dataSize, "data size %u too small for %u records on %s", dataSize, numberOfRecords, getId().toString());
}
}; // namespace hashdb
}; // namespace kerio
| 47.981481
| 204
| 0.76071
|
LPetrlik
|
b9ef234b26b4a0f2b330342c404f7ec9c4886ebb
| 1,074
|
hpp
|
C++
|
src/editor/configuration.hpp
|
tksuoran/erhe
|
07d1ea014e1675f6b09bff0d9d4f3568f187e0d8
|
[
"Apache-2.0"
] | 36
|
2021-05-03T10:47:49.000Z
|
2022-03-19T12:54:03.000Z
|
src/editor/configuration.hpp
|
tksuoran/erhe
|
07d1ea014e1675f6b09bff0d9d4f3568f187e0d8
|
[
"Apache-2.0"
] | 29
|
2020-05-17T08:26:31.000Z
|
2022-03-27T08:52:47.000Z
|
src/editor/configuration.hpp
|
tksuoran/erhe
|
07d1ea014e1675f6b09bff0d9d4f3568f187e0d8
|
[
"Apache-2.0"
] | 2
|
2022-01-24T09:24:37.000Z
|
2022-01-31T20:45:36.000Z
|
#pragma once
#include "erhe/components/component.hpp"
#include "erhe/components/components.hpp"
#include "erhe/gl/wrapper_enums.hpp"
namespace editor {
class Configuration
: public erhe::components::Component
{
public:
static constexpr std::string_view c_name{"Configuration"};
static constexpr uint32_t hash{
compiletime_xxhash::xxh32(
c_name.data(),
c_name.size(),
{}
)
};
Configuration(int argc, char** argv);
// Implements Component
[[nodiscard]] auto get_type_hash() const -> uint32_t override { return hash; }
// Public API
[[nodiscard]] auto depth_clear_value_pointer() const -> const float *; // reverse_depth ? 0.0f : 1.0f;
[[nodiscard]] auto depth_function (const gl::Depth_function depth_function) const -> gl::Depth_function;
bool gui {true};
bool openxr {false};
bool show_window {true};
bool parallel_initialization{false};
bool reverse_depth {true};
};
} // namespace editor
| 28.263158
| 118
| 0.626629
|
tksuoran
|
b9ef7c43a34b866ea9d2a9d81a9fcf0d91112e69
| 606
|
cc
|
C++
|
atom/app/atom_main_args.cc
|
fireball-x/atom-shell
|
d229338e40058a9b4323b2544f62818a3c55748c
|
[
"MIT"
] | 4
|
2016-04-02T14:53:54.000Z
|
2017-07-26T05:47:43.000Z
|
atom/app/atom_main_args.cc
|
cocos-creator/atom-shell
|
d229338e40058a9b4323b2544f62818a3c55748c
|
[
"MIT"
] | null | null | null |
atom/app/atom_main_args.cc
|
cocos-creator/atom-shell
|
d229338e40058a9b4323b2544f62818a3c55748c
|
[
"MIT"
] | 2
|
2015-07-18T09:31:03.000Z
|
2019-12-24T09:55:03.000Z
|
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_main_args.h"
#include "vendor/node/deps/uv/include/uv.h"
namespace atom {
// static
std::vector<std::string> AtomCommandLine::argv_;
// static
void AtomCommandLine::Init(int argc, const char* const* argv) {
// Hack around with the argv pointer. Used for process.title = "blah"
char** new_argv = uv_setup_args(argc, const_cast<char**>(argv));
for (int i = 0; i < argc; ++i) {
argv_.push_back(new_argv[i]);
}
}
} // namespace atom
| 26.347826
| 71
| 0.689769
|
fireball-x
|
b9f194f84c9089d498f66ef090c85dd916d22c2e
| 221
|
cpp
|
C++
|
test/tests_main.cpp
|
martinusbach/SmartMeterMonitor
|
6cb91dd67a81e1ee202e55ad2e59a7a1d0baf96a
|
[
"MIT"
] | null | null | null |
test/tests_main.cpp
|
martinusbach/SmartMeterMonitor
|
6cb91dd67a81e1ee202e55ad2e59a7a1d0baf96a
|
[
"MIT"
] | null | null | null |
test/tests_main.cpp
|
martinusbach/SmartMeterMonitor
|
6cb91dd67a81e1ee202e55ad2e59a7a1d0baf96a
|
[
"MIT"
] | null | null | null |
// Copyright (c) 2019 Martien Oppeneer.
// This software is MIT licensed; see LICENSE.MIT.
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <catch2/catch.hpp>
| 31.571429
| 97
| 0.728507
|
martinusbach
|
b9f63dc4aac6467d758353bd84e10962711c115b
| 1,621
|
cpp
|
C++
|
PAT/PAT Advanced/c++/1145.cpp
|
Accelerator404/Algorithm-Demonstration
|
e40a499c23a56d363c743c76ac967d9c4247a4be
|
[
"Apache-2.0"
] | 1
|
2019-09-18T23:45:27.000Z
|
2019-09-18T23:45:27.000Z
|
PAT/PAT Advanced/c++/1145.cpp
|
Accelerator404/Algorithm-Demonstration
|
e40a499c23a56d363c743c76ac967d9c4247a4be
|
[
"Apache-2.0"
] | null | null | null |
PAT/PAT Advanced/c++/1145.cpp
|
Accelerator404/Algorithm-Demonstration
|
e40a499c23a56d363c743c76ac967d9c4247a4be
|
[
"Apache-2.0"
] | 1
|
2019-09-18T23:45:28.000Z
|
2019-09-18T23:45:28.000Z
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
//PAT Advanced Level 1145 Hashing - Average Search Time
bool isPrime(int num){
if(num <= 1)
return false;
else if(num == 2 || num == 3)
return true;
int range = sqrt((double)num);
for (int i = 2; i <= range; ++i) {
if(num%i == 0)
return false;
}
return true;
}
int main() {
int MSize,N,M,TSize;
vector<int> hashTable;
cin >> MSize >> N >> M;
TSize = MSize;
while(!isPrime(TSize))
TSize++;
hashTable.resize(TSize);
for (int i = 0; i < N; ++i) {
int input;
scanf("%d",&input);
int j = 0;
bool inserted = false;
while(j < TSize){
int Hkey = (input + j*j) % TSize;
if(hashTable[Hkey] != 0)
j++;
else{
hashTable[Hkey] = input;
inserted = true;
break;
}
}
if(!inserted)
printf("%d cannot be inserted.\n",input);
}
int searchTime = 0;
for (int i = 0; i < M; ++i) {
int key;
scanf("%d",&key);
//比较操作的次数
int cmpTime = 0;
while(cmpTime <= TSize){
int Hkey = (key + cmpTime*cmpTime) % TSize;
cmpTime++;
//如果在某一位没有检测到数,即为该位未冲突
// 未冲突却未插入key,说明散列里没有这个key,退出查找
if(hashTable[Hkey] == key || hashTable[Hkey] == 0)
break;
}
searchTime += cmpTime;
}
printf("%.01f\n",((double)searchTime / M));
return 0;
}
| 23.838235
| 62
| 0.47008
|
Accelerator404
|
b9ffac43ab24cf333d0a9230fe7d34747cb09a4e
| 21,082
|
cpp
|
C++
|
src/gui/widgets/layout.cpp
|
dream-overflow/o3d
|
087ab870cc0fd9091974bb826e25c23903a1dde0
|
[
"FSFAP"
] | 2
|
2019-06-22T23:29:44.000Z
|
2019-07-07T18:34:04.000Z
|
src/gui/widgets/layout.cpp
|
dream-overflow/o3d
|
087ab870cc0fd9091974bb826e25c23903a1dde0
|
[
"FSFAP"
] | null | null | null |
src/gui/widgets/layout.cpp
|
dream-overflow/o3d
|
087ab870cc0fd9091974bb826e25c23903a1dde0
|
[
"FSFAP"
] | null | null | null |
/**
* @file layout.cpp
* @brief
* @author Frederic SCHERMA (frederic.scherma@dreamoverflow.org)
* @date 2001-12-25
* @copyright Copyright (c) 2001-2017 Dream Overflow. All rights reserved.
* @details
*/
#include "o3d/gui/precompiled.h"
#include "o3d/gui/widgets/layout.h"
#include "o3d/engine/scene/scene.h"
#include "o3d/gui/widgets/window.h"
#include "o3d/gui/gui.h"
#include "o3d/gui/guitype.h"
#include "o3d/gui/widgetmanager.h"
#include "o3d/engine/context.h"
#include <algorithm>
using namespace o3d;
O3D_IMPLEMENT_ABSTRACT_CLASS1(Layout, GUI_LAYOUT, Widget)
/*---------------------------------------------------------------------------------------
default constructor
---------------------------------------------------------------------------------------*/
Layout::Layout(BaseObject *parent) :
Widget(parent),
m_window(nullptr)
{
m_capacities.enable(CAPS_LAYOUT_TYPE);
}
Layout::Layout(Widget *widget) :
Widget(widget),
m_window(nullptr)
{
m_capacities.enable(CAPS_LAYOUT_TYPE);
m_pos.set(0,0);
}
Layout::Layout(Window *window) :
Widget(window),
m_window(window)
{
m_capacities.enable(CAPS_LAYOUT_TYPE);
m_pos.set(0,0);
// initial size
if (window)
m_size = window->getMinSize();
}
// construct as child layout
Layout::Layout(Layout *layout) :
Widget(layout),
m_window(nullptr)
{
m_capacities.enable(CAPS_LAYOUT_TYPE);
m_pos.set(0,0);
}
/*---------------------------------------------------------------------------------------
destructor
---------------------------------------------------------------------------------------*/
Layout::~Layout()
{
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
deletePtr(*it);
}
/*---------------------------------------------------------------------------------------
Mouse events management
---------------------------------------------------------------------------------------*/
Bool Layout::isTargeted(Int32 x, Int32 y, Widget *&pWidget)
{
// recursive targeted
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if ((*it)->isTargeted(x - (*it)->pos().x(), y - (*it)->pos().y(), pWidget))
return True;
}
return False;
}
void Layout::draw()
{
if (!isShown())
return;
// local space
getScene()->getContext()->modelView().translate(Vector3(
(Float)m_pos.x(),
(Float)m_pos.y(),
0.f));
// draw recursively all sons
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
getScene()->getContext()->modelView().push();
(*it)->draw();
getScene()->getContext()->modelView().pop();
}
}
/*---------------------------------------------------------------------------------------
Events Management
---------------------------------------------------------------------------------------*/
void Layout::sizeChanged()
{
}
/*---------------------------------------------------------------------------------------
insert a widget in last position
---------------------------------------------------------------------------------------*/
void Layout::addWidget(Widget *widget)
{
if (widget->getParent() != this)
O3D_ERROR(E_InvalidParameter("The given widget is not a child of this layout"));
m_sonList.push_back(widget);
widget->defineLayoutItem();
setDirty();
// each time a new widget is added, check again for the initial widget focus
if ((getGui()->getWidgetManager()->getFocusedWindow() == m_window) &&
(getGui()->getWidgetManager()->getFocusedWidget() == nullptr))
{
if (widget->isFocusable())
getGui()->getWidgetManager()->setFocus(widget);
}
}
void Layout::insertWidget(Widget *widget, const Widget *before)
{
if (widget->getParent() != this)
O3D_ERROR(E_InvalidParameter("The given widget is not a child of this layout"));
// recursive search
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if (*it == before)
{
m_sonList.insert(it, widget);
widget->defineLayoutItem();
setDirty();
// each time a new widget is added, check again for the initial widget focus
if ((getGui()->getWidgetManager()->getFocusedWindow() == m_window) &&
(getGui()->getWidgetManager()->getFocusedWidget() == nullptr))
{
if (widget->isFocusable())
getGui()->getWidgetManager()->setFocus(widget);
}
return;
}
}
O3D_ERROR(E_InvalidParameter("The given 'before' widget is not a child of this layout"));
}
/*---------------------------------------------------------------------------------------
retrieve a widget by its object name (objects must have unique name for a valid result)
---------------------------------------------------------------------------------------*/
Widget* Layout::findWidget(const String &name)
{
if (getName() == name)
return this;
// recursive search
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if ((*it)->getName() == name)
return *it;
// the child widget is a container ?
if ((*it)->getLayout())
{
Widget *pWidget = (*it)->getLayout()->findWidget(name);
if (pWidget)
return pWidget;
}
}
return nullptr;
}
const Widget* Layout::findWidget(const String &name) const
{
if (getName() == name)
return this;
// recursive search
for (CIT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if ((*it)->getName() == name)
return *it;
// the child widget is a container ?
if ((*it)->getLayout())
{
const Widget *pWidget = (*it)->getLayout()->findWidget(name);
if (pWidget)
return pWidget;
}
}
return nullptr;
}
/*---------------------------------------------------------------------------------------
search for an existing widget by its pointer (search in recursively if it is not a direct son)
---------------------------------------------------------------------------------------*/
Bool Layout::isWidgetExist(Widget *pWidget) const
{
if (this == pWidget)
return True;
// recursive search
for (CIT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if (*it == pWidget)
return True;
// the child widget is a container ?
if ((*it)->getLayout())
{
if ((*it)->getLayout()->isWidgetExist(pWidget))
return True;
}
}
return False;
}
/*---------------------------------------------------------------------------------------
delete a widget (and recursively all its sons) and return true if success
---------------------------------------------------------------------------------------*/
Bool Layout::deleteWidget(Widget *pWidget)
{
// recursive search
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if ((*it) == pWidget)
{
getGui()->getWidgetManager()->checkPrevTargetedWidget(pWidget);
deletePtr(*it);
m_sonList.erase(it);
setDirty();
return True;
}
// recurse on children
if ((*it)->getLayout())
{
if ((*it)->getLayout()->deleteWidget(pWidget))
{
setDirty();
return True;
}
}
}
return False;
}
void Layout::deleteAllWidgets()
{
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
getGui()->getWidgetManager()->checkPrevTargetedWidget(*it);
deletePtr(*it);
}
m_sonList.clear();
setDirty();
}
Widget* Layout::findNextTabIndex(Widget *widget, Int32 direction)
{
// returns the first widget (deep finding)
if (!widget)
{
if (m_sonList.size() > 0)
{
if (direction > 0)
{
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if ((*it)->getTabIndex() < 0)
{
Widget *first = (*it)->findNextTabIndex(nullptr, 1);
if (first && first->isFocusable())
return first;
}
}
}
else if (direction < 0)
{
for (RIT_WidgetList rit = m_sonList.rbegin(); rit != m_sonList.rend(); ++rit)
{
if ((*rit)->isFocusable() && ((*rit)->getTabIndex() < 0))
{
Widget *last = (*rit)->findNextTabIndex(nullptr, -1);
if (last && last->isFocusable())
return last;
}
}
}
}
// no focusable widgets founds
return nullptr;
}
// bubble search
if (direction > 0)
{
Widget *next = nullptr;
// first search on sibling widgets and deeply
for (IT_WidgetList it = m_sonList.begin(); it != m_sonList.end(); ++it)
{
if (*it == widget)
{
++it;
while (it != m_sonList.end())
{
if ((*it)->getLayout())
next = (*it)->getLayout()->findNextTabIndex(nullptr, 1);
else
next = (*it)->findNextTabIndex(nullptr, 1);
if (next && next->isFocusable())
return next;
++it;
}
break;
}
}
return nullptr;
}
else if (direction < 0)
{
Widget *next = nullptr;
for (RIT_WidgetList rit = m_sonList.rbegin(); rit != m_sonList.rend(); ++rit)
{
if (*rit == widget)
{
++rit;
while (rit != m_sonList.rend())
{
if ((*rit)->getLayout())
next = (*rit)->getLayout()->findNextTabIndex(nullptr, -1);
else
next = (*rit)->findNextTabIndex(nullptr, -1);
if (next && next->isFocusable())
return next;
++rit;
}
break;
}
}
return nullptr;
}
else
{
return widget;
}
}
/*---------------------------------------------------------------------------------------
process the layout calculation
---------------------------------------------------------------------------------------*/
void Layout::layout()
{
// (re)calculates minimums needed for each item and other preparations for layout
calcMin();
// apply the layout and repositions/resizes the items
computeSizes();
// layout is now updated
setClean();
}
/*---------------------------------------------------------------------------------------
set the dimensions of the layout and perform the layout
---------------------------------------------------------------------------------------*/
void Layout::setDimension(const Vector2i &pos, const Vector2i &size)
{
m_pos = pos;
m_size = size;
layout();
}
/*---------------------------------------------------------------------------------------
get the minimal widget size
---------------------------------------------------------------------------------------*/
Vector2i Layout::getMinSize()
{
Vector2i minSize(calcMin());
if (minSize.x() < m_minSize.x()) {
minSize.x() = m_minSize.x();
}
if (minSize.y() < m_minSize.y()) {
minSize.y() = m_minSize.y();
}
return minSize;
}
/*---------------------------------------------------------------------------------------
Fit the window to the size of the content of the layout
---------------------------------------------------------------------------------------*/
Vector2i Layout::getMinWindowSize()
{
Vector2i minSize(getMinSize());
Vector2i size(m_window->size());
Vector2i clientSize(m_window->getClientSize());
return Vector2i(
minSize.x() + size.x() - clientSize.x(),
minSize.y() + size.y() - clientSize.y());
}
Vector2i Layout::getMaxWindowSize()
{
return m_window->maxSize();
}
Vector2i Layout::fit()
{
if (!m_window || !m_window->isTopLevelWidget()) {
O3D_WARNING("Works only on top-level windows objects");
return Vector2i(0,0);
}
// take the min size by default and limit it by max size
Vector2i size(getMinWindowSize());
Vector2i sizeMax(getMaxWindowSize());
if (m_window->isTopLevelWidget()) {
sizeMax.x() = getGui()->getWidth();
sizeMax.y() = getGui()->getHeight();
}
if (sizeMax.x() != -1 && size.x() > sizeMax.x()) {
size.x() = sizeMax.x();
}
if (sizeMax.y() != -1 && size.y() > sizeMax.y()) {
size.y() = sizeMax.y();
}
m_window->setSize(size);
return size;
}
/*---------------------------------------------------------------------------------------
Similar to Fit, but sizes the interior (virtual) size of a window
---------------------------------------------------------------------------------------*/
Vector2i Layout::getMinClientSize()
{
return getMinSize();
}
Vector2i Layout::getMaxClientSize()
{
Vector2i maxSize(m_window->maxSize());
if (maxSize != Widget::DEFAULT_SIZE) {
Vector2i size(m_window->size());
Vector2i clientSize(m_window->getClientSize());
return Vector2i(
maxSize.x() + clientSize.x() - size.x(),
maxSize.y() + clientSize.y() - size.y());
} else {
return Widget::DEFAULT_SIZE;
}
}
Vector2i Layout::virtualFitSize()
{
Vector2i size(getMinClientSize());
Vector2i sizeMax(getMaxClientSize());
// Limit the size if sizeMax != DefaultSize
if (size.x() > sizeMax.x() && sizeMax.x() != -1) {
size.x() = sizeMax.x();
}
if (size.y() > sizeMax.y() && sizeMax.y() != -1) {
size.y() = sizeMax.y();
}
return size;
}
void Layout::fitInside()
{
if (!m_window) {
O3D_WARNING("Works only on windows objects");
return;
}
Vector2i size;
if (m_window->isTopLevelWidget()) {
size = virtualFitSize();
} else {
size = getMinClientSize();
}
m_window->setVirtualSize(size);
}
void Layout::setSizeHints()
{
if (!m_window || !m_window->isTopLevelWidget()) {
O3D_WARNING("Works only on top-level windows objects");
return;
}
// Preserve the window's max size hints, but set the lower bound according to
// the sizer calculations
Vector2i size = fit();
m_window->setSizeHints(
size.x(),
size.y(),
m_window->maxSize().x(),
m_window->maxSize().y());
}
void Layout::setVirtualSizeHints()
{
if (!m_window) {
O3D_WARNING("Works only on windows objects");
return;
}
// Preserve the window's max size hints, but set the lower bound according to
// the layout calculations
fitInside();
Vector2i size(m_window->getVirtualSize());
m_window->setVirtualSizeHints(
size.x(),
size.y(),
m_window->maxSize().x(),
m_window->maxSize().y());
}
/*---------------------------------------------------------------------------------------
constructors
---------------------------------------------------------------------------------------*/
LayoutItem::LayoutItem(Widget *pWidget) :
m_itemType(ITEM_NONE),
m_pWidget(nullptr),
m_ratio(0.f)
{
setWidget(pWidget);
}
LayoutItem::LayoutItem(Layout *pLayout) :
m_itemType(ITEM_NONE),
m_pWidget(nullptr),
m_ratio(0.f)
{
setLayout(pLayout);
}
LayoutItem::LayoutItem(Spacer *pSpacer) :
m_itemType(ITEM_NONE),
m_pWidget(nullptr),
m_ratio(0.f)
{
setSpacer(pSpacer);
}
/*---------------------------------------------------------------------------------------
define the widget
---------------------------------------------------------------------------------------*/
void LayoutItem::setWidget(Widget *pWidget)
{
O3D_ASSERT(pWidget != nullptr);
m_itemType = ITEM_WIDGET;
m_pWidget = pWidget;
// widget doesn't become smaller than its initial size
m_minSize = pWidget->size();
if (pWidget->isFixedMinSize()) {
pWidget->setMinSize(m_minSize);
}
// aspect ratio calculated from initial size
setRatio(m_minSize);
}
/*---------------------------------------------------------------------------------------
define the layout
---------------------------------------------------------------------------------------*/
void LayoutItem::setLayout(Layout *pLayout)
{
O3D_ASSERT(pLayout != nullptr);
m_itemType = ITEM_LAYOUT;
m_pLayout = pLayout;
// m_minSize is set later
}
/*---------------------------------------------------------------------------------------
define the space
---------------------------------------------------------------------------------------*/
void LayoutItem::setSpacer(Spacer *pSpacer)
{
O3D_ASSERT(pSpacer != nullptr);
m_itemType = ITEM_SPACER;
m_pSpacer = pSpacer;
m_minSize = pSpacer->size();
setRatio(m_minSize);
}
/*---------------------------------------------------------------------------------------
set the layout item dimensions
---------------------------------------------------------------------------------------*/
void LayoutItem::setDimension(const Vector2i &_pos, const Vector2i &_size)
{
O3D_ASSERT(m_pWidget != nullptr);
Vector2i pos(_pos);
Vector2i size(_size);
// aspect ratio
if (m_pWidget->isShaped()) {
// adjust aspect ratio
Int32 rwidth = (Int32)(size.y() * m_ratio);
if (rwidth > size.x()) {
// fit horizontally
Int32 rheight = (Int32)(size.x() / m_ratio);
// add vertical space
if (m_pWidget->getVerticalAlign() == WidgetProperties::MIDDLE_ALIGN) {
pos.y() += (size.y() - rheight) / 2;
} else if (m_pWidget->getVerticalAlign() == WidgetProperties::BOTTOM_ALIGN) {
pos.y() += (size.y() - rheight);
}
// use reduced dimensions
size.y() = rheight;
} else if (rwidth < size.x()) {
// add horizontal space
if (m_pWidget->getHorizontalAlign() == WidgetProperties::CENTER_ALIGN) {
pos.x() += (size.x() - rwidth) / 2;
} else if (m_pWidget->getHorizontalAlign() == WidgetProperties::RIGHT_ALIGN) {
pos.x() += (size.x() - rwidth);
}
size.x() = rwidth;
}
}
// This is what getPosition() returns. Since we calculate borders afterwards,
// getPos() will be the top-left corner of the surrounding border
m_pos = pos;
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_LEFT) {
pos.x() += m_pWidget->getBorderSize();
size.x() -= m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_RIGHT) {
size.x() -= m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_TOP) {
pos.y() += m_pWidget->getBorderSize();
size.y() -= m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_BOTTOM) {
size.y() -= m_pWidget->getBorderSize();
}
if (size.x() < 0) {
size.x() = 0;
}
if (size.y() < 0) {
size.y() = 0;
}
m_rect = Box2i(pos,size);
switch (m_itemType) {
case ITEM_NONE:
O3D_WARNING("Undefined layout item type");
break;
case ITEM_WIDGET:
m_pWidget->setSize(pos.x(), pos.y(), size.x(), size.y(), Widget::SIZE_ALLOW_MINUS_ONE);
break;
case ITEM_LAYOUT:
m_pLayout->setDimension(pos,size);
break;
case ITEM_SPACER:
m_pSpacer->setSize(size);
break;
}
}
Vector2i LayoutItem::getMinSizeIncludeBorders() const
{
// TODO see for window first layout borders...
Vector2i minSize(m_minSize);
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_LEFT) {
minSize.x() += m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_RIGHT) {
minSize.x() += m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_TOP) {
minSize.y() += m_pWidget->getBorderSize();
}
if (m_pWidget->getBorderElt() & WidgetProperties::BORDER_BOTTOM) {
minSize.y() += m_pWidget->getBorderSize();
}
return minSize;
}
//---------------------------------------------------------------------------------------
// return the minimal size of the widget item
//---------------------------------------------------------------------------------------
Vector2i LayoutItem::calcMin()
{
O3D_ASSERT(m_pWidget != nullptr);
if (isLayout()) {
m_minSize = m_pLayout->getMinSize();
// if we have to preserve aspect ratio and this is the first-time calculation,
// consider ration to be initial size
if (m_pLayout->isShaped() && (m_ratio == 0.f)) {
setRatio(m_minSize);
}
} else if (isWidget()) {
// Since the size of the widget may change during runtime, we should use
// the current minimal/best size
m_minSize = m_pWidget->getEffectiveMinSize();
}
return getMinSizeIncludeBorders();
}
| 26.787802
| 99
| 0.491984
|
dream-overflow
|
6a048a01d6b2a4960b5d8065dcd11c66f8dc16c5
| 22,234
|
cpp
|
C++
|
src/bindings/Scriptdev2/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
|
mfooo/wow
|
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
|
[
"OpenSSL"
] | 1
|
2017-11-16T19:04:07.000Z
|
2017-11-16T19:04:07.000Z
|
src/bindings/Scriptdev2/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
|
mfooo/wow
|
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
|
[
"OpenSSL"
] | null | null | null |
src/bindings/Scriptdev2/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp
|
mfooo/wow
|
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
|
[
"OpenSSL"
] | null | null | null |
/* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_ZulJin
SD%Complete: 85%
SDComment:
EndScriptData */
#include "precompiled.h"
#include "zulaman.h"
//Still not used, need more info
#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!"
#define SOUND_INTRO 12090
//Speech
#define SAY_AGGRO -1568051
#define SAY_BEAR_TRANSFORM -1568052
#define SAY_EAGLE_TRANSFORM -1568053
#define SAY_LYNX_TRANSFORM -1568054
#define SAY_DRAGONHAWK_TRANSFORM -1568055
#define SAY_FIRE_BREATH -1568056
#define SAY_BERSERK -1568057
#define SAY_KILL1 -1568058
#define SAY_KILL2 -1568059
#define SAY_DEATH -1568060
//Spells:
// ====== Troll Form
#define SPELL_WHIRLWIND 17207
#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed
// ====== Bear Form
#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid
#define SPELL_OVERPOWER 43456 // use after melee attack dodged
// ====== Eagle Form
#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577
#define SPELL_ZAP_INFORM 42577
#define SPELL_ZAP_DAMAGE 43137 // 1250 damage
#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex
#define CREATURE_FEATHER_VORTEX 24136
#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual
#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second
//Lynx Form
#define SPELL_CLAW_RAGE_HASTE 42583
#define SPELL_CLAW_RAGE_TRIGGER 43149
#define SPELL_CLAW_RAGE_DAMAGE 43150
#define SPELL_LYNX_RUSH_HASTE 43152
#define SPELL_LYNX_RUSH_DAMAGE 43153
//Dragonhawk Form
#define SPELL_FLAME_WHIRL 43213 // trigger two spells
#define SPELL_FLAME_BREATH 43215
#define SPELL_SUMMON_PILLAR 43216 // summon 24187
#define CREATURE_COLUMN_OF_FIRE 24187
#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217
//cosmetic
#define SPELL_SPIRIT_AURA 42466
#define SPELL_SIPHON_SOUL 43501
//Transforms:
#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg
#define SPELL_SHAPE_OF_THE_EAGLE 42606
#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30%
#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608
#define SPELL_BERSERK 45078
#define WEAPON_ID 33975
#define PHASE_BEAR 0
#define PHASE_EAGLE 1
#define PHASE_LYNX 2
#define PHASE_DRAGONHAWK 3
#define PHASE_TROLL 4
//coords for going for changing form
#define CENTER_X 120.15f
#define CENTER_Y 703.71f
#define CENTER_Z 45.11f
struct SpiritInfoStruct
{
uint32 entry;
float x, y, z, orient;
};
static SpiritInfoStruct SpiritInfo[] =
{
{23878, 147.87f, 706.51f, 45.11f, 3.04f},
{23880, 88.95f, 705.49f, 45.11f, 6.11f},
{23877, 137.23f, 725.98f, 45.11f, 3.71f},
{23879, 104.29f, 726.43f, 45.11f, 5.43f}
};
struct TransformStruct
{
uint32 id;
uint32 spell, unaura;
};
static TransformStruct Transform[] =
{
{SAY_BEAR_TRANSFORM, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND},
{SAY_EAGLE_TRANSFORM, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR},
{SAY_LYNX_TRANSFORM, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE},
{SAY_DRAGONHAWK_TRANSFORM, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX}
};
struct MANGOS_DLL_DECL boss_zuljinAI : public ScriptedAI
{
boss_zuljinAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
// wait for core patch be accepted
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_CLAW_RAGE_DAMAGE);
if(TempSpell)
{
//if(TempSpell->DmgClass != SPELL_DAMAGE_CLASS_MELEE)
// TempSpell->DmgClass = SPELL_DAMAGE_CLASS_MELEE;
if(TempSpell->EffectApplyAuraName[2] != SPELL_AURA_MOD_STUN)
TempSpell->EffectApplyAuraName[2] = SPELL_AURA_MOD_STUN;
}
Reset();
}
ScriptedInstance *pInstance;
uint64 SpiritGUID[4];
uint64 ClawTargetGUID;
uint64 TankGUID;
uint32 Phase;
uint32 health_20;
uint32 Intro_Timer;
uint32 Berserk_Timer;
uint32 Whirlwind_Timer;
uint32 Grievous_Throw_Timer;
uint32 Creeping_Paralysis_Timer;
uint32 Overpower_Timer;
uint32 Claw_Rage_Timer;
uint32 Lynx_Rush_Timer;
uint32 Claw_Counter;
uint32 Claw_Loop_Timer;
uint32 Flame_Whirl_Timer;
uint32 Flame_Breath_Timer;
uint32 Pillar_Of_Fire_Timer;
void Reset()
{
if(pInstance)
pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
Phase = 0;
health_20 = m_creature->GetMaxHealth()*0.2;
Intro_Timer = 37000;
Berserk_Timer = 600000;
Whirlwind_Timer = 7000;
Grievous_Throw_Timer = 8000;
Creeping_Paralysis_Timer = 7000;
Overpower_Timer = 0;
Claw_Rage_Timer = 5000;
Lynx_Rush_Timer = 14000;
Claw_Loop_Timer = 0;
Claw_Counter = 0;
Flame_Whirl_Timer = 5000;
Flame_Breath_Timer = 6000;
Pillar_Of_Fire_Timer = 7000;
ClawTargetGUID = 0;
TankGUID = 0;
DespawnAdds();
DespawnSummons(CREATURE_FEATHER_VORTEX);
DespawnSummons(CREATURE_COLUMN_OF_FIRE);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, WEAPON_ID);
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
void Aggro(Unit *who)
{
if(pInstance)
pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
m_creature->SetInCombatWithZone();
DoScriptText(SAY_AGGRO, m_creature);
SpawnAdds();
EnterPhase(0);
}
void KilledUnit(Unit* victim)
{
if(Intro_Timer)
return;
switch(rand()%2)
{
case 0: DoScriptText(SAY_KILL1, m_creature); break;
case 1: DoScriptText(SAY_KILL2, m_creature); break;
}
}
void JustDied(Unit* Killer)
{
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, DONE);
DoScriptText(SAY_DEATH, m_creature);
DespawnSummons(CREATURE_COLUMN_OF_FIRE);
if (Unit* Temp = m_creature->GetMap()->GetUnit(SpiritGUID[3]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
}
void AttackStart(Unit* who)
{
if (!who)
return;
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
m_creature->SetInCombatWith(who);
who->SetInCombatWith(m_creature);
if (!m_creature->isInCombat())
{
Aggro(who);
}
if(Phase == 2)
DoStartNoMovement(who);
else
DoStartMovement(who);
}
}
void DoMeleeAttackIfReady()
{
if( !m_creature->IsNonMeleeSpellCasted(false))
{
if(m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
{
if(Phase == 1 && !Overpower_Timer)
{
uint32 health = m_creature->getVictim()->GetHealth();
m_creature->AttackerStateUpdate(m_creature->getVictim());
if(m_creature->getVictim() && health == m_creature->getVictim()->GetHealth())
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_OVERPOWER, false);
Overpower_Timer = 5000;
}
}else m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
}
}
}
void SpawnAdds()
{
Creature *pCreature = NULL;
for(uint8 i = 0; i < 4; i++)
{
pCreature = m_creature->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
if(pCreature)
{
pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true);
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
SpiritGUID[i] = pCreature->GetGUID();
}
}
}
void DespawnAdds()
{
for(uint8 i = 0; i < 4; ++i)
{
if (SpiritGUID[i])
if (Creature* pTemp = m_creature->GetMap()->GetCreature(SpiritGUID[i]))
pTemp->ForcedDespawn();
SpiritGUID[i] = 0;
}
}
void DespawnSummons(uint32 uiEntry)
{
std::list<Creature*> lTempList;
GetCreatureListWithEntryInGrid(lTempList, m_creature, uiEntry, 100.0f);
if (lTempList.empty())
return;
for(std::list<Creature*>::iterator i = lTempList.begin(); i != lTempList.end(); ++i)
(*i)->ForcedDespawn();
}
void EnterPhase(uint32 NextPhase)
{
switch(NextPhase)
{
case 0:
break;
case 1:
case 2:
case 3:
case 4:
m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z, 0);
m_creature->SendMonsterMove(CENTER_X, CENTER_Y, CENTER_Z, SPLINETYPE_NORMAL, SPLINEFLAG_WALKMODE, 0);
DoResetThreat();
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 0);
m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(m_creature, Transform[Phase].spell);
DoScriptText(Transform[Phase].id, m_creature);
if (Phase > 0)
{
if (Unit* pTemp = m_creature->GetMap()->GetUnit(SpiritGUID[Phase - 1]))
pTemp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
if (Unit* pTemp = m_creature->GetMap()->GetUnit(SpiritGUID[NextPhase - 1]))
pTemp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp
if (NextPhase == 2)
{
m_creature->GetMotionMaster()->Clear();
m_creature->CastSpell(m_creature, SPELL_ENERGY_STORM, true); // enemy aura
for(uint8 i = 0; i < 4; i++)
{
Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if(Vortex)
{
Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Vortex->SetSpeedRate(MOVE_RUN, 1.0f);
Vortex->AI()->AttackStart(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0));
Vortex->SetInCombatWithZone();
}
}
}
else
m_creature->AI()->AttackStart(m_creature->getVictim());
if(NextPhase == 3)
{
m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
DespawnSummons(CREATURE_FEATHER_VORTEX);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
}
break;
default:
break;
}
Phase = NextPhase;
}
void UpdateAI(const uint32 diff)
{
if(!TankGUID)
{
if(!m_creature->SelectHostileTarget() && !m_creature->getVictim())
return;
if(m_creature->GetHealth() < health_20 * (4 - Phase))
EnterPhase(Phase + 1);
}
if(Berserk_Timer < diff)
{
m_creature->CastSpell(m_creature, SPELL_BERSERK, true);
DoScriptText(SAY_BERSERK, m_creature);
Berserk_Timer = 60000;
}else Berserk_Timer -= diff;
switch (Phase)
{
case 0:
if(Intro_Timer)
{
if(Intro_Timer <= diff)
{
DoScriptText(SAY_AGGRO, m_creature);
Intro_Timer = 0;
}else Intro_Timer -= diff;
}
if(Whirlwind_Timer < diff)
{
DoCast(m_creature, SPELL_WHIRLWIND);
Whirlwind_Timer = 15000 + rand()%5000;
}else Whirlwind_Timer -= diff;
if(Grievous_Throw_Timer < diff)
{
if(Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
m_creature->CastSpell(target, SPELL_GRIEVOUS_THROW, false);
Grievous_Throw_Timer = 10000;
}else Grievous_Throw_Timer -= diff;
break;
case 1:
if(Creeping_Paralysis_Timer < diff)
{
DoCast(m_creature, SPELL_CREEPING_PARALYSIS);
Creeping_Paralysis_Timer = 20000;
}else Creeping_Paralysis_Timer -= diff;
if(Overpower_Timer < diff)
{
// implemented in DoMeleeAttackIfReady()
Overpower_Timer = 0;
}else Overpower_Timer -= diff;
break;
case 2:
return;
case 3:
if(Claw_Rage_Timer <= diff)
{
if(!TankGUID)
{
if(Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
TankGUID = m_creature->getVictim()->GetGUID();
m_creature->SetSpeedRate(MOVE_RUN, 5.0f);
AttackStart(target); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
Claw_Counter = 0;
}
}
else if(!Claw_Rage_Timer) // do not do this when Lynx_Rush
{
if(Claw_Loop_Timer < diff)
{
Unit* target = m_creature->getVictim();
if (!target || !target->isTargetableForAttack())
target = m_creature->GetMap()->GetUnit(TankGUID);
if (!target || !target->isTargetableForAttack())
target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0);
if (target)
{
AttackStart(target);
if (m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
{
m_creature->CastSpell(target, SPELL_CLAW_RAGE_DAMAGE, true);
Claw_Counter++;
if (Claw_Counter == 12)
{
Claw_Rage_Timer = 15000 + rand()%5000;
m_creature->SetSpeedRate(MOVE_RUN, 1.2f);
AttackStart(m_creature->GetMap()->GetUnit(TankGUID));
TankGUID = 0;
return;
}
else
Claw_Loop_Timer = 500;
}
}
else
EnterEvadeMode(); // if(target)
}
else
Claw_Loop_Timer -= diff;
} //if(TankGUID)
}
else
Claw_Rage_Timer -= diff;
if (Lynx_Rush_Timer <= diff)
{
if (!TankGUID)
{
if(Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
TankGUID = m_creature->getVictim()->GetGUID();
m_creature->SetSpeedRate(MOVE_RUN, 5.0f);
AttackStart(target); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
}
}
else if (!Lynx_Rush_Timer)
{
Unit* target = m_creature->getVictim();
if (!target || !target->isTargetableForAttack())
{
target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0);
AttackStart(target);
}
if (target)
{
if (m_creature->IsWithinDistInMap(target, ATTACK_DISTANCE))
{
m_creature->CastSpell(target, SPELL_LYNX_RUSH_DAMAGE, true);
Claw_Counter++;
if (Claw_Counter == 9)
{
Lynx_Rush_Timer = 15000 + rand()%5000;
m_creature->SetSpeedRate(MOVE_RUN, 1.2f);
AttackStart(m_creature->GetMap()->GetUnit(TankGUID));
TankGUID = 0;
}
else
AttackStart(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0));
}
}
else
EnterEvadeMode(); // if(target)
} //if(TankGUID)
}
else
Lynx_Rush_Timer -= diff;
break;
case 4:
if(Flame_Whirl_Timer < diff)
{
DoCast(m_creature, SPELL_FLAME_WHIRL);
Flame_Whirl_Timer = 12000;
}Flame_Whirl_Timer -= diff;
if(Pillar_Of_Fire_Timer < diff)
{
if(Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
float x, y, z;
target->GetPosition(x, y, z);
Creature* Pillar = m_creature->SummonCreature(CREATURE_COLUMN_OF_FIRE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
if(Pillar)
{
Pillar->CastSpell(Pillar, SPELL_PILLAR_TRIGGER, true);
Pillar->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
Pillar_Of_Fire_Timer = 10000;
}else Pillar_Of_Fire_Timer -= diff;
if(Flame_Breath_Timer < diff)
{
if(Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
m_creature->CastSpell(m_creature, SPELL_FLAME_BREATH, false);
Flame_Breath_Timer = 10000;
}else Flame_Breath_Timer -= diff;
break;
default:
break;
}
if(!TankGUID)
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_zuljin(Creature *_Creature)
{
return new boss_zuljinAI (_Creature);
}
struct MANGOS_DLL_DECL do_nothingAI : public ScriptedAI
{
do_nothingAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void Aggro(Unit* who) {}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff) {}
};
CreatureAI* GetAI_do_nothing(Creature *_Creature)
{
return new do_nothingAI (_Creature);
}
struct MANGOS_DLL_DECL feather_vortexAI : public ScriptedAI
{
feather_vortexAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void Aggro(Unit* target) {}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if(spell->Id == SPELL_ZAP_INFORM)
m_creature->CastSpell(caster, SPELL_ZAP_DAMAGE, true);
}
void UpdateAI(const uint32 diff)
{
//if the vortex reach the target, it change his target to another player
if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
AttackStart(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0));
}
};
CreatureAI* GetAI_feather_vortexAI(Creature *_Creature)
{
return new feather_vortexAI (_Creature);
}
void AddSC_boss_zuljin()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_zuljin";
newscript->GetAI = &GetAI_boss_zuljin;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "do_nothing";
newscript->GetAI = &GetAI_do_nothing;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_zuljin_vortex";
newscript->GetAI = &GetAI_feather_vortexAI;
newscript->RegisterSelf();
}
| 34.471318
| 230
| 0.55586
|
mfooo
|
6a08aa1bf8593f8e45607b9b0dcaf439b9360a28
| 24,630
|
cpp
|
C++
|
cpp/depends/igl/headers/igl/dual_contouring.cpp
|
GitZHCODE/zspace_modules
|
2264cb837d2f05184a51b7b453c7e24288e88ee1
|
[
"MIT"
] | 2
|
2022-03-28T14:10:50.000Z
|
2022-03-28T14:10:51.000Z
|
cpp/depends/igl/headers/igl/dual_contouring.cpp
|
GitZHCODE/zspace_modules
|
2264cb837d2f05184a51b7b453c7e24288e88ee1
|
[
"MIT"
] | null | null | null |
cpp/depends/igl/headers/igl/dual_contouring.cpp
|
GitZHCODE/zspace_modules
|
2264cb837d2f05184a51b7b453c7e24288e88ee1
|
[
"MIT"
] | 2
|
2022-03-23T10:33:10.000Z
|
2022-03-28T14:09:55.000Z
|
#include "dual_contouring.h"
#include "quadprog.h"
#include "parallel_for.h"
#include <thread>
#include <mutex>
#include <vector>
#include <unordered_map>
#include <iostream>
namespace igl
{
// These classes not intended to be used directly
class Hash
{
public:
// https://stackoverflow.com/a/26348708/148668
uint64_t operator()(const std::tuple<int, int, int> & key) const
{
// Check that conversion is safe. Could use int16_t directly everywhere
// below but it's an uncommon type to expose and grid indices should
// never be more than 2¹⁵-1 in the first place.
assert( std::get<0>(key) == (int)(int16_t)std::get<0>(key));
assert( std::get<1>(key) == (int)(int16_t)std::get<1>(key));
assert( std::get<2>(key) == (int)(int16_t)std::get<2>(key));
uint64_t result = uint16_t(std::get<0>(key));
result = (result << 16) + uint16_t(std::get<1>(key));
result = (result << 16) + uint16_t(std::get<2>(key));
return result;
};
};
template <typename Scalar>
class DualContouring
{
// Types
public:
using RowVector3S = Eigen::Matrix<Scalar,1,3>;
using RowVector4S = Eigen::Matrix<Scalar,1,4>;
using Matrix4S = Eigen::Matrix<Scalar,4,4>;
using Matrix3S = Eigen::Matrix<Scalar,3,3>;
using Vector3S = Eigen::Matrix<Scalar,3,1>;
using KeyTriplet = std::tuple<int,int,int>;
public:
// Working variables
// see dual_contouring.h
// f(x) returns >0 outside, <0 inside, and =0 on the surface
std::function<Scalar(const RowVector3S &)> f;
// f_grad(x) returns (df/dx)/‖df/dx‖ (normalization only important when
// f(x) = 0).
std::function<RowVector3S(const RowVector3S &)> f_grad;
bool constrained;
bool triangles;
bool root_finding;
RowVector3S min_corner;
RowVector3S step;
Eigen::Matrix<Scalar,Eigen::Dynamic,3> V;
// Internal variables
// Running number of vertices added during contouring
typename decltype(V)::Index n;
// map from cell subscript to index in V
std::unordered_map< KeyTriplet, typename decltype(V)::Index, Hash > C2V;
// running list of aggregate vertex positions (used for spring
// regularization term)
std::vector<RowVector3S,Eigen::aligned_allocator<RowVector3S>> vV;
// running list of subscripts corresponding to vertices
std::vector<Eigen::RowVector3i,Eigen::aligned_allocator<Eigen::RowVector3i>> vI;
// running list of quadric matrices corresponding to inserted vertices
std::vector<Matrix4S,Eigen::aligned_allocator<Matrix4S>> vH;
// running list of number of faces incident on this vertex (used to
// normalize spring regulatization term)
std::vector<int> vcount;
// running list of output quad faces
Eigen::Matrix<Eigen::Index,Eigen::Dynamic,Eigen::Dynamic> Q;
// running number of real quads in Q (used for dynamic array allocation)
typename decltype(Q)::Index m;
// mutexes used to insert into Q and (vV,vI,vH,vcount)
std::mutex Qmut;
std::mutex Vmut;
public:
DualContouring(
const std::function<Scalar(const RowVector3S &)> & _f,
const std::function<RowVector3S(const RowVector3S &)> & _f_grad,
const bool _constrained = false,
const bool _triangles = false,
const bool _root_finding = true):
f(_f),
f_grad(_f_grad),
constrained(_constrained),
triangles(_triangles),
root_finding(_root_finding),
n(0),
C2V(0),
vV(),vI(),vH(),vcount(),
m(0)
{ }
// Side effects: new entry in vV,vI,vH,vcount, increment n
// Returns index of new vertex
typename decltype(V)::Index new_vertex()
{
const auto v = n;
n++;
vcount.resize(n);
vV.resize(n);
vI.resize(n);
vH.resize(n);
vcount[v] = 0;
vV[v].setZero();
vH[v].setZero();
return v;
};
// Inputs:
// kc 3-long vector of {x,y,z} index of primal grid **cell**
// Returns index to corresponding dual vertex
// Side effects: if vertex for this cell does not yet exist, creates it
typename decltype(V)::Index sub2dual(const Eigen::RowVector3i & kc)
{
const KeyTriplet key = {kc(0),kc(1),kc(2)};
const auto it = C2V.find(key);
typename decltype(V)::Index v = -1;
if(it == C2V.end())
{
v = new_vertex();
C2V[key] = v;
vI[v] = kc;
}else
{
v = it->second;
}
return v;
};
RowVector3S primal(const Eigen::RowVector3i & ic) const
{
return min_corner + (ic.cast<Scalar>().array() * step.array()).matrix();
}
Eigen::RowVector3i inverse_primal(const RowVector3S & x) const
{
// x = min_corner + (ic.cast<Scalar>().array() * step.array()).matrix();
// x-min_corner = (ic.cast<Scalar>().array() * step.array())
// (x-min_corner).array() / step.array() = ic.cast<Scalar>().array()
// ((x-min_corner).array() / step.array()).round() = ic
return
((x-min_corner).array()/step.array()).round().template cast<int>();
}
// Inputs:
// x x-index of vertex on primal grid
// y y-index of vertex on primal grid
// z z-index of vertex on primal grid
// o which edge are we looking back on? o=0->x,o=1->y,o=2->z
// Side effects: may insert new vertices into vV,vI,vH,vcount, new faces
// into Q
bool single_edge(const int & x, const int & y, const int & z, const int & o)
{
const RowVector3S e0 = primal(Eigen::RowVector3i(x,y,z));
const Scalar f0 = f(e0);
return single_edge(x,y,z,o,e0,f0);
}
bool single_edge(
const int & x,
const int & y,
const int & z,
const int & o,
const RowVector3S & e0,
const Scalar & f0)
{
//e1 computed here needs to precisely agree with e0 when called with
//correspond x,y,z. So, don't do this:
//Eigen::RowVector3d e1 = e0;
//e1(o) -= step(o);
Eigen::RowVector3i jc(x,y,z);
jc(o) -= 1;
const RowVector3S e1 = primal(jc);
const Scalar f1 = f(e1);
return single_edge(x,y,z,o,e0,f0,e1,f1);
}
bool single_edge(
const int & x,
const int & y,
const int & z,
const int & o,
const RowVector3S & e0,
const Scalar & f0,
const RowVector3S & e1,
const Scalar & f1)
{
const Scalar isovalue = 0;
if((f0>isovalue) == (f1>isovalue)) { return false; }
// Position of crossing point along edge
RowVector3S p;
Scalar t = -1;
if(root_finding)
{
Scalar tl = 0;
bool gl = f0>0;
Scalar tu = 1;
bool gu = f1>0;
assert(gu ^ gl);
int riter = 0;
const int max_riter = 7;
while(true)
{
t = 0.5*(tu + tl);
p = e0+t*(e1-e0);
riter++;
if(riter > max_riter) { break;}
const Scalar ft = f(p);
if( (ft>0) == gu) { tu = t; }
else if( (ft>0) == gl){ tl = t; }
else { break; }
}
}else
{
// inverse lerp
const Scalar delta = f1-f0;
if(delta == 0) { t = 0.5; }
t = (isovalue - f0)/delta;
p = e0+t*(e1-e0);
}
// insert vertex at this point to triangulate quad face
const typename decltype(V)::Index ev = triangles ? new_vertex() : -1;
if(triangles)
{
const std::lock_guard<std::mutex> lock(Vmut);
vV[ev] = p;
vcount[ev] = 1;
vI[ev] = Eigen::RowVector3i(-1,-1,-1);
}
// edge normal from function handle (could use grid finite
// differences/interpolation gradients)
const RowVector3S dfdx = f_grad(p);
// homogenous plane equation
const RowVector4S P = (RowVector4S()<<dfdx,-dfdx.dot(p)).finished();
// quadric contribution
const Matrix4S H = P.transpose() * P;
// Build quad face from dual vertices of 4 cells around this edge
Eigen::RowVector4i face;
int k = 0;
for(int i = -1;i<=0;i++)
{
for(int j = -1;j<=0;j++)
{
Eigen::RowVector3i kc(x,y,z);
kc(o)--;
kc((o+1)%3)+=i;
kc((o+2)%3)+=j;
const std::lock_guard<std::mutex> lock(Vmut);
const typename decltype(V)::Index v = sub2dual(kc);
vV[v] += p;
vcount[v]++;
vH[v] += H;
face(k++) = v;
}
}
{
const std::lock_guard<std::mutex> lock(Qmut);
if(triangles)
{
if(m+4 >= Q.rows()){ Q.conservativeResize(2*m+4,Q.cols()); }
if(f0>f1)
{
Q.row(m+0)<< ev,face(3),face(1) ;
Q.row(m+1)<< ev,face(1),face(0);
Q.row(m+2)<< face(2), ev,face(0);
Q.row(m+3)<< face(2),face(3), ev;
}else
{
Q.row(m+0)<< ev,face(1),face(3) ;
Q.row(m+1)<< ev,face(3),face(2);
Q.row(m+2)<< face(0), ev,face(2);
Q.row(m+3)<< face(0),face(1), ev;
}
m+=4;
}else
{
if(m+1 >= Q.rows()){ Q.conservativeResize(2*m+1,Q.cols()); }
if(f0>f1)
{
Q.row(m)<< face(2),face(3),face(1),face(0);
}else
{
Q.row(m)<< face(0),face(1),face(3),face(2);
}
m++;
}
}
return true;
}
// Side effects: Q resized to fit m, V constructed to fit n and
// reconstruct data in vH,vI,vV,vcount
void dual_vertex_positions()
{
Q.conservativeResize(m,Q.cols());
V.resize(n,3);
igl::parallel_for(n,[&](const Eigen::Index v)
{
RowVector3S mid = vV[v] / Scalar(vcount[v]);
if(triangles && vI[v](0)<0 ){ V.row(v) = mid; return; }
const Scalar w = 1e-2*(0.01+vcount[v]);
Matrix3S A = vH[v].block(0,0,3,3) + w*Matrix3S::Identity();
RowVector3S b = -vH[v].block(3,0,1,3) + w*mid;
// Replace with solver
//RowVector3S p = b * A.inverse();
//
// min_p ½ pᵀ A p - pᵀb
//
// let p = p₀ + x
//
// min ½ (p₀ + x )ᵀ A (p₀ + x ) - (p₀ + x )ᵀb
// step≥x≥0
const RowVector3S p0 =
min_corner + ((vI[v].template cast<Scalar>().array()) * step.array()).matrix();
const RowVector3S x =
constrained ?
igl::quadprog<Scalar,3>(A,(p0*A-b).transpose(),Vector3S(0,0,0),step.transpose()) :
Eigen::LLT<Matrix3S>(A).solve(-(p0*A-b).transpose());
V.row(v) = p0+x;
},1000ul);
}
// Inputs:
// _min_corner minimum (bottomLeftBack) corner of primal grid
// max_corner maximum (topRightFront) corner of primal grid
// nx number of primal grid vertices along x-axis
// ny number of primal grid vertices along y-ayis
// nz number of primal grid vertices along z-azis
// Side effects: prepares vV,vI,vH,vcount, Q for vertex_positions()
void dense(
const RowVector3S & _min_corner,
const RowVector3S & max_corner,
const int nx,
const int ny,
const int nz)
{
min_corner = _min_corner;
step =
(max_corner-min_corner).array()/(RowVector3S(nx,ny,nz).array()-1);
// Should do some reasonable reserves for C2V,vV,vI,vH,vcount
Q.resize(std::pow(nx*ny*nz,2./3.),triangles?3:4);
// loop over grid
igl::parallel_for(nx,[&](const int x)
{
for(int y = 0;y<ny;y++)
{
for(int z = 0;z<nz;z++)
{
const RowVector3S e0 = primal(Eigen::RowVector3i(x,y,z));
const Scalar f0 = f(e0);
// we'll consider the edges going "back" from this vertex
for(int o = 0;o<3;o++)
{
// off-by-one boundary cases
if(((o==0)&&x==0)||((o==1)&&y==0)||((o==2)&&z==0)){ continue;}
single_edge(x,y,z,o,e0,f0);
}
}
}
},10ul);
dual_vertex_positions();
}
template <typename DerivedGf, typename DerivedGV>
void dense(
const Eigen::MatrixBase<DerivedGf> & Gf,
const Eigen::MatrixBase<DerivedGV> & GV,
const int nx,
const int ny,
const int nz)
{
min_corner = GV.colwise().minCoeff();
const RowVector3S max_corner = GV.colwise().maxCoeff();
step =
(max_corner-min_corner).array()/(RowVector3S(nx,ny,nz).array()-1);
// Should do some reasonable reserves for C2V,vV,vI,vH,vcount
Q.resize(std::pow(nx*ny*nz,2./3.),triangles?3:4);
const auto xyz2i = [&nx,&ny,&nz]
(const int & x, const int & y, const int & z)->Eigen::Index
{
return x+nx*(y+ny*(z));
};
// loop over grid
igl::parallel_for(nz,[&](const int z)
{
for(int y = 0;y<ny;y++)
{
for(int x = 0;x<nx;x++)
{
//const Scalar f0 = f(e0);
const Eigen::Index k0 = xyz2i(x,y,z);
const RowVector3S e0 = GV.row(k0);
const Scalar f0 = Gf(k0);
// we'll consider the edges going "back" from this vertex
for(int o = 0;o<3;o++)
{
Eigen::RowVector3i jc(x,y,z);
jc(o) -= 1;
if(jc(o)<0) { continue;} // off-by-one boundary cases
const int k1 = xyz2i(jc(0),jc(1),jc(2));
const RowVector3S e1 = GV.row(k1);
const Scalar f1 = Gf(k1);
single_edge(x,y,z,o,e0,f0,e1,f1);
}
}
}
},10ul);
dual_vertex_positions();
}
void sparse(
const RowVector3S & _step,
const Eigen::Matrix<Scalar,Eigen::Dynamic,1> & Gf,
const Eigen::Matrix<Scalar,Eigen::Dynamic,3> & GV,
const Eigen::Matrix<int,Eigen::Dynamic,2> & GI)
{
step = _step;
Q.resize((triangles?4:1)*GI.rows(),triangles?3:4);
// in perfect world doesn't matter where min_corner is so long as it is
// _on_ the grid. For models very far from origin, centering grid near
// model avoids possible rounding error in hash()/inverse_primal()
// [still very unlikely, but let's be safe]
min_corner = GV.colwise().minCoeff();
// igl::parallel_for here made things worse. Probably need to do proper
// map-reduce rather than locks on mutexes.
for(Eigen::Index i = 0;i<GI.rows();i++)
{
RowVector3S e0 = GV.row(GI(i,0));
RowVector3S e1 = GV.row(GI(i,1));
Eigen::RowVector3i ic0 = inverse_primal(e0);
Eigen::RowVector3i ic1 = inverse_primal(e1);
#ifndef NDEBUG
RowVector3S p0 = primal(ic0);
RowVector3S p1 = primal(ic1);
assert( (p0-e0).norm() < 1e-10);
assert( (p1-e1).norm() < 1e-10);
#endif
Scalar f0 = Gf(GI(i,0)); //f(e0);
Scalar f1 = Gf(GI(i,1)); //f(e1);
// should differ in just one coordinate. Find that coordinate.
int o = -1;
for(int j = 0;j<3;j++)
{
if(ic0(j) == ic1(j)){ continue;}
if(ic0(j) - ic1(j) == 1)
{
assert(o == -1 && "Edges should differ in just one coordinate");
o = j;
continue; // rather than break so assertions fire
}
if(ic1(j) - ic0(j) == 1)
{
assert(o == -1 && "Edges should differ in just one coordinate");
std::swap(e0,e1);
std::swap(f0,f1);
std::swap(ic0,ic1);
o = j;
continue; // rather than break so assertions fire
} else
{
assert(false && "Edges should differ in just one coordinate");
}
}
assert(o>=0 && "Edges should differ in just one coordinate");
// i0 is the larger subscript location and ic1 is backward in the o
// direction.
for(int j = 0;j<3;j++){ assert(ic0(j) == ic1(j)+(o==j)); }
const int x = ic0(0);
const int y = ic0(1);
const int z = ic0(2);
single_edge(x,y,z,o,e0,f0,e1,f1);
}
dual_vertex_positions();
}
};
}
template <
typename DerivedV,
typename DerivedQ>
IGL_INLINE void igl::dual_contouring(
const std::function<
typename DerivedV::Scalar(const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f,
const std::function<
Eigen::Matrix<typename DerivedV::Scalar,1,3>(
const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f_grad,
const Eigen::Matrix<typename DerivedV::Scalar,1,3> & min_corner,
const Eigen::Matrix<typename DerivedV::Scalar,1,3> & max_corner,
const int nx,
const int ny,
const int nz,
const bool constrained,
const bool triangles,
const bool root_finding,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedQ> & Q)
{
typedef typename DerivedV::Scalar Scalar;
DualContouring<Scalar> DC(f,f_grad,constrained,triangles,root_finding);
DC.dense(min_corner,max_corner,nx,ny,nz);
V = DC.V;
Q = DC.Q.template cast<typename DerivedQ::Scalar>();
}
template <
typename DerivedGf,
typename DerivedGV,
typename DerivedV,
typename DerivedQ>
IGL_INLINE void igl::dual_contouring(
const std::function<
typename DerivedV::Scalar(const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f,
const std::function<
Eigen::Matrix<typename DerivedV::Scalar,1,3>(
const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f_grad,
const Eigen::MatrixBase<DerivedGf> & Gf,
const Eigen::MatrixBase<DerivedGV> & GV,
const int nx,
const int ny,
const int nz,
const bool constrained,
const bool triangles,
const bool root_finding,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedQ> & Q)
{
typedef typename DerivedV::Scalar Scalar;
DualContouring<Scalar> DC(f,f_grad,constrained,triangles,root_finding);
DC.dense(Gf,GV,nx,ny,nz);
V = DC.V;
Q = DC.Q.template cast<typename DerivedQ::Scalar>();
}
template <
typename DerivedGf,
typename DerivedGV,
typename DerivedGI,
typename DerivedV,
typename DerivedQ>
IGL_INLINE void igl::dual_contouring(
const std::function<typename DerivedV::Scalar(const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f,
const std::function<Eigen::Matrix<typename DerivedV::Scalar,1,3>(const Eigen::Matrix<typename DerivedV::Scalar,1,3> &)> & f_grad,
const Eigen::Matrix<typename DerivedV::Scalar,1,3> & step,
const Eigen::MatrixBase<DerivedGf> & Gf,
const Eigen::MatrixBase<DerivedGV> & GV,
const Eigen::MatrixBase<DerivedGI> & GI,
const bool constrained,
const bool triangles,
const bool root_finding,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedQ> & Q)
{
if(GI.rows() == 0){ return;}
assert(GI.cols() == 2);
typedef typename DerivedV::Scalar Scalar;
DualContouring<Scalar> DC(f,f_grad,constrained,triangles,root_finding);
DC.sparse(step,Gf,GV,GI);
V = DC.V;
Q = DC.Q.template cast<typename DerivedQ::Scalar>();
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::dual_contouring<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::function<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, std::function<Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, int, int, int, bool, bool, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::dual_contouring<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::function<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, std::function<Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, int, int, bool, bool, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::dual_contouring<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::function<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, std::function<Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&, Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&, int, int, int, bool, bool, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::dual_contouring<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::function<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, std::function<Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, bool, bool, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::dual_contouring<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::function<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, std::function<Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> (Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&)> const&, Eigen::Matrix<Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, 1, 3, 1, 1, 3> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, bool, bool, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
#endif
| 43.439153
| 1,028
| 0.550873
|
GitZHCODE
|
6a0b0379f33ca738f6130f7a59a585c1e5736c0a
| 1,212
|
cpp
|
C++
|
src/codegen/proxy/zone_map_proxy.cpp
|
star013/peloton
|
0e1c5f32fde00529f19f7ff5f5e7d5b4979f06ef
|
[
"Apache-2.0"
] | 2
|
2021-03-29T01:29:18.000Z
|
2022-02-27T11:22:15.000Z
|
src/codegen/proxy/zone_map_proxy.cpp
|
star013/peloton
|
0e1c5f32fde00529f19f7ff5f5e7d5b4979f06ef
|
[
"Apache-2.0"
] | null | null | null |
src/codegen/proxy/zone_map_proxy.cpp
|
star013/peloton
|
0e1c5f32fde00529f19f7ff5f5e7d5b4979f06ef
|
[
"Apache-2.0"
] | 3
|
2018-02-25T23:30:33.000Z
|
2018-04-08T10:11:42.000Z
|
//===----------------------------------------------------------------------===//
//
// Peloton
//
// zone_map_proxy.cpp
//
// Identification: src/codegen/proxy/zone_map_proxy.cpp
//
// Copyright (c) 2015-2017, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
//=----------------------------------------------------------------------===//
//
// Peloton
//
// zone_map_proxy.cpp
//
// Identification: src/codegen/proxy/zone_map_proxy.cpp
//
// Copyright (c) 2015-2017, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#include "codegen/proxy/zone_map_proxy.h"
namespace peloton {
namespace codegen {
DEFINE_TYPE(PredicateInfo, "peloton::storage::PredicateInfo", MEMBER(col_id),
MEMBER(comparison_operator), MEMBER(predicate_value));
DEFINE_TYPE(ZoneMapManager, "peloton::storage::ZoneMapManager", MEMBER(opaque));
DEFINE_METHOD(peloton::storage, ZoneMapManager, ShouldScanTileGroup);
DEFINE_METHOD(peloton::storage, ZoneMapManager, GetInstance);
} // namespace codegen
} // namespace peloton
| 31.076923
| 80
| 0.523102
|
star013
|
6a0c09700c92d4000eefc18e0a2c6d5f13007833
| 10,869
|
cpp
|
C++
|
websocket.cpp
|
looyao/mevent
|
fa268e93b33264c71d086ba9387b5ab2fabd0257
|
[
"MIT"
] | 42
|
2017-03-07T02:45:22.000Z
|
2019-02-26T15:26:25.000Z
|
websocket.cpp
|
looyao/mevent
|
fa268e93b33264c71d086ba9387b5ab2fabd0257
|
[
"MIT"
] | null | null | null |
websocket.cpp
|
looyao/mevent
|
fa268e93b33264c71d086ba9387b5ab2fabd0257
|
[
"MIT"
] | 11
|
2017-03-07T06:42:30.000Z
|
2019-03-06T03:15:46.000Z
|
#include "websocket.h"
#include "mevent.h"
#include "base64.h"
#include "util.h"
#include "connection.h"
#include "lock_guard.h"
#include <string>
#include <openssl/sha.h>
namespace mevent {
// http://tools.ietf.org/html/rfc6455#section-5.2 Base Framing Protocol
//
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-------+-+-------------+-------------------------------+
// |F|R|R|R| opcode|M| Payload len | Extended payload length |
// |I|S|S|S| (4) |A| (7) | (16/64) |
// |N|V|V|V| |S| | (if payload len==126/127) |
// | |1|2|3| |K| | |
// +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
// | Extended payload length continued, if payload len == 127 |
// + - - - - - - - - - - - - - - - +-------------------------------+
// | |Masking-key, if MASK set to 1 |
// +-------------------------------+-------------------------------+
// | Masking-key (continued) | Payload Data |
// +-------------------------------- - - - - - - - - - - - - - - - +
// : Payload Data continued ... :
// + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
// | Payload Data continued ... |
// +---------------------------------------------------------------+
//Reference: https://github.com/dhbaird/easywsclient
#define READ_BUFFER_SIZE 2048
void WebSocket::Reset() {
rbuf_.clear();
std::vector<uint8_t>().swap(rbuf_);
cache_str_.clear();
std::string().swap(cache_str_);
on_close_func_ = nullptr;
ping_func_ = nullptr;
pong_func_ = nullptr;
on_message_func_ = nullptr;
max_buffer_size_ = 8192;
}
void WebSocket::MakeFrame(std::vector<uint8_t> &frame_data, const std::string &message, uint8_t opcode) {
std::size_t message_len = message.length();
std::vector<uint8_t> header;
if (message_len < 126) {
header.assign(2, 0);
} else if (message_len < 65536) {
header.assign(4, 0);
} else {
header.assign(10, 0);
}
header[0] = 0x80 | opcode;
if (message_len < 126) {
header[1] = (message_len & 0xff);
} else if (message_len < 65536) {
header[1] = 126;
header[2] = (message_len >> 8) & 0xff;
header[3] = (message_len >> 0) & 0xff;
} else {
header[1] = 127;
header[2] = (message_len >> 56) & 0xff;
header[3] = (message_len >> 48) & 0xff;
header[4] = (message_len >> 40) & 0xff;
header[5] = (message_len >> 32) & 0xff;
header[6] = (message_len >> 24) & 0xff;
header[7] = (message_len >> 16) & 0xff;
header[8] = (message_len >> 8) & 0xff;
header[9] = (message_len >> 0) & 0xff;
}
frame_data.insert(frame_data.end(), header.begin(), header.end());
if (!message.empty()) {
frame_data.insert(frame_data.end(), message.begin(), message.end());
}
}
void WebSocket::Handshake(std::string &data, const std::string &sec_websocket_key) {
std::string sec_str = sec_websocket_key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
unsigned char md[SHA_DIGEST_LENGTH];
SHA_CTX ctx;
SHA1_Init(&ctx);
SHA1_Update(&ctx, sec_str.c_str(), sec_str.length());
SHA1_Final(md, &ctx);
std::string sec_str_b64 = Base64Encode(static_cast<const unsigned char *>(md), SHA_DIGEST_LENGTH);
data = "HTTP/1.1 101 Switching Protocols" CRLF;
data += "Server: " SERVER CRLF;
data += "Date: " + util::GetGMTimeStr() + CRLF;
data += "Upgrade: websocket" CRLF;
data += "Connection: Upgrade" CRLF;
data += "Sec-WebSocket-Accept: " + sec_str_b64 + CRLF;
data += CRLF;
}
bool WebSocket::Upgrade()
{
if (conn_->Req()->sec_websocket_key_.empty()) {
return false;
}
std::string sec_websocket_key = conn_->Req()->sec_websocket_key_;
// conn_->Req()->Reset();
// conn_->Resp()->Reset();
conn_->Req()->status_ = RequestStatus::UPGRADE;
std::string response_header;
Handshake(response_header, sec_websocket_key);
conn_->WriteString(response_header);
return true;
}
ConnStatus WebSocket::ReadData() {
char buf[READ_BUFFER_SIZE];
ssize_t n = 0;
do {
n = conn_->Readn(buf, READ_BUFFER_SIZE);
if (n > 0) {
rbuf_.insert(rbuf_.end(), buf, buf + n);
if (!Parse()) {
return ConnStatus::ERROR;
}
} else if (n < 0) {
return ConnStatus::CLOSE;
} else {
break;
}
} while (n == READ_BUFFER_SIZE);
return ConnStatus::AGAIN;
}
bool WebSocket::Parse() {
while (true) {
WebSocketHeader wsh;
if (rbuf_.size() < 2) {
return true;
}
const uint8_t *data = static_cast<const uint8_t *>(&rbuf_[0]);
wsh.len = 0;
wsh.fin = (data[0] & 0x80) == 0x80;
wsh.opcode = static_cast<WebSocketOpcodeType>(data[0] & 0x0f);
wsh.mask = (data[1] & 0x80) == 0x80;
wsh.len0 = data[1] & 0x7f;
wsh.header_size = 2;
if (wsh.len0 == 126) {
wsh.header_size += 2;
} else if (wsh.len0 == 127) {
wsh.header_size += 8;
}
if (wsh.mask) {
wsh.header_size += sizeof(wsh.masking_key);
}
if (rbuf_.size() < wsh.header_size) {
return true;
}
if (wsh.len0 < 126) {
wsh.len = wsh.len0;
} else if (wsh.len0 == 126) {
wsh.len |= ((uint64_t) data[2]) << 8;
wsh.len |= ((uint64_t) data[3]) << 0;
} else if (wsh.len0 == 127) {
wsh.len |= ((uint64_t) data[2]) << 56;
wsh.len |= ((uint64_t) data[3]) << 48;
wsh.len |= ((uint64_t) data[4]) << 40;
wsh.len |= ((uint64_t) data[5]) << 32;
wsh.len |= ((uint64_t) data[6]) << 24;
wsh.len |= ((uint64_t) data[7]) << 16;
wsh.len |= ((uint64_t) data[8]) << 8;
wsh.len |= ((uint64_t) data[9]) << 0;
}
if (wsh.mask) {
wsh.masking_key[0] = data[wsh.header_size - 4];
wsh.masking_key[1] = data[wsh.header_size - 3];
wsh.masking_key[2] = data[wsh.header_size - 2];
wsh.masking_key[3] = data[wsh.header_size - 1];
}
if (rbuf_.size() < wsh.header_size + wsh.len) {
return true;
}
if (cache_str_.length() + wsh.len > max_buffer_size_) {
return false;
}
if (wsh.mask && wsh.len > 0) {
for (uint64_t i = 0; i != wsh.len; i++) {
rbuf_[i + wsh.header_size] ^= wsh.masking_key[i & 0x3];
}
}
cache_str_.insert(cache_str_.end(), rbuf_.begin() + wsh.header_size, rbuf_.begin() + wsh.header_size + wsh.len);
if (wsh.opcode == WebSocketOpcodeType::BINARY_FRAME
|| wsh.opcode == WebSocketOpcodeType::TEXT_FRAME
|| wsh.opcode == WebSocketOpcodeType::CONTINUATION) {
if (wsh.fin) {
conn_->WebSocketTaskPush(wsh.opcode, cache_str_);
cache_str_.clear();
std::string().swap(cache_str_);
}
} else if (wsh.opcode == WebSocketOpcodeType::PING) {
conn_->WebSocketTaskPush(wsh.opcode, cache_str_);
cache_str_.clear();
std::string().swap(cache_str_);
} else if (wsh.opcode == WebSocketOpcodeType::PONG) {
conn_->WebSocketTaskPush(wsh.opcode, cache_str_);
} else if (wsh.opcode == WebSocketOpcodeType::CLOSE) {
conn_->WebSocketTaskPush(wsh.opcode, cache_str_);
} else {
conn_->WebSocketTaskPush(WebSocketOpcodeType::CLOSE, cache_str_);
}
rbuf_.erase(rbuf_.begin(), rbuf_.begin() + wsh.header_size + wsh.len);
}
return true;
}
void WebSocket::SendPong(const std::string &str) {
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::PONG);
conn_->WriteData(frame_data);
}
void WebSocket::SendPing(const std::string &str) {
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::PING);
conn_->WriteData(frame_data);
}
void WebSocket::WriteString(const std::string &str) {
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::TEXT_FRAME);
conn_->WriteData(frame_data);
}
bool WebSocket::SendPongSafe(const std::string &str) {
LockGuard lock_guard(conn_->mtx_);
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::PONG);
conn_->WriteData(frame_data);
ConnStatus status = conn_->Flush();
if (status == ConnStatus::ERROR && status == ConnStatus::CLOSE) {
return false;
}
return true;
}
bool WebSocket::SendPingSafe(const std::string &str) {
LockGuard lock_guard(conn_->mtx_);
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::PING);
conn_->WriteData(frame_data);
ConnStatus status = conn_->Flush();
if (status == ConnStatus::ERROR && status == ConnStatus::CLOSE) {
return false;
}
return true;
}
bool WebSocket::WriteStringSafe(const std::string &str) {
LockGuard lock_guard(conn_->mtx_);
std::vector<uint8_t> frame_data;
MakeFrame(frame_data, str, WebSocketOpcodeType::TEXT_FRAME);
conn_->WriteData(frame_data);
ConnStatus status = conn_->Flush();
if (status == ConnStatus::ERROR && status == ConnStatus::CLOSE) {
return false;
}
return true;
}
bool WebSocket::WriteRawDataSafe(const std::vector<uint8_t> &data) {
LockGuard lock_guard(conn_->mtx_);
conn_->WriteData(data);
ConnStatus status = conn_->Flush();
if (status == ConnStatus::ERROR && status == ConnStatus::CLOSE) {
return false;
}
return true;
}
Connection *WebSocket::Conn() {
return conn_;
}
void WebSocket::SetOnMessageHandler(WebSocketHandlerFunc func) {
on_message_func_ = func;
}
void WebSocket::SetPingHandler(WebSocketHandlerFunc func) {
ping_func_ = func;
}
void WebSocket::SetPongHandler(WebSocketHandlerFunc func) {
pong_func_ = func;
}
void WebSocket::SetOnCloseHandler(WebSocketCloseHandlerFunc func) {
on_close_func_ = func;
}
void WebSocket::SetMaxBufferSize(std::size_t size) {
max_buffer_size_ = size;
}
}//namespace mevent
| 30.70339
| 120
| 0.532616
|
looyao
|
6a0c8e7f098e46030e17b107c0409e74b185ccc9
| 4,136
|
cpp
|
C++
|
CommonLibF4/src/F4SE/Interfaces.cpp
|
blipvert/CommonLibF4
|
d8681e20ed560fe14c45b02d6717f3444ed5ec9d
|
[
"MIT"
] | 24
|
2019-07-01T06:48:42.000Z
|
2022-03-06T02:20:30.000Z
|
CommonLibF4/src/F4SE/Interfaces.cpp
|
blipvert/CommonLibF4
|
d8681e20ed560fe14c45b02d6717f3444ed5ec9d
|
[
"MIT"
] | 4
|
2021-04-25T03:58:17.000Z
|
2022-01-28T06:52:35.000Z
|
CommonLibF4/src/F4SE/Interfaces.cpp
|
blipvert/CommonLibF4
|
d8681e20ed560fe14c45b02d6717f3444ed5ec9d
|
[
"MIT"
] | 11
|
2019-07-01T19:56:11.000Z
|
2022-02-27T19:46:07.000Z
|
#include "F4SE/Interfaces.h"
#include "F4SE/API.h"
#include "F4SE/Logger.h"
namespace F4SE
{
bool MessagingInterface::RegisterListener(EventCallback* a_handler, stl::zstring a_sender) const
{
const auto success =
GetProxy().RegisterListener(
GetPluginHandle(),
a_sender.data(),
a_handler);
if (!success) {
log::warn("failed to register listener for {}"sv, a_sender);
}
return success;
}
bool MessagingInterface::Dispatch(std::uint32_t a_messageType, void* a_data, std::uint32_t a_dataLen, const char* a_receiver) const
{
const auto success =
GetProxy().Dispatch(
GetPluginHandle(),
a_messageType,
a_data,
a_dataLen,
a_receiver);
if (!success) {
log::warn("failed to dispatch to {}"sv, (a_receiver ? a_receiver : "all listeners"));
}
return success;
}
bool ScaleformInterface::Register(stl::zstring a_name, RegisterCallback* a_callback) const
{
const auto success =
GetProxy().Register(
a_name.data(),
a_callback);
if (!success) {
log::warn("failed to register {}"sv, a_name);
}
return success;
}
void SerializationInterface::SetUniqueID(std::uint32_t a_uid)
{
GetProxy().SetUniqueID(
GetPluginHandle(),
a_uid);
}
void SerializationInterface::SetRevertCallback(EventCallback* a_callback) const
{
GetProxy().SetRevertCallback(
GetPluginHandle(),
a_callback);
}
void SerializationInterface::SetSaveCallback(EventCallback* a_callback) const
{
GetProxy().SetSaveCallback(
GetPluginHandle(),
a_callback);
}
void SerializationInterface::SetLoadCallback(EventCallback* a_callback) const
{
GetProxy().SetLoadCallback(
GetPluginHandle(),
a_callback);
}
void SerializationInterface::SetFormDeleteCallback(FormDeleteCallback* a_callback) const
{
GetProxy().SetFormDeleteCallback(
GetPluginHandle(),
a_callback);
}
bool SerializationInterface::WriteRecord(std::uint32_t a_type, std::uint32_t a_version, const void* a_buf, std::uint32_t a_length) const
{
const auto success =
GetProxy().WriteRecord(
a_type,
a_version,
a_buf,
a_length);
if (!success) {
log::warn("failed to write record"sv);
}
return success;
}
bool SerializationInterface::OpenRecord(std::uint32_t a_type, std::uint32_t a_version) const
{
const auto success =
GetProxy().OpenRecord(
a_type,
a_version);
if (!success) {
log::warn("failed to open record"sv);
}
return success;
}
bool SerializationInterface::WriteRecordData(const void* a_buf, std::uint32_t a_length) const
{
const auto success =
GetProxy().WriteRecordData(
a_buf,
a_length);
if (!success) {
log::warn("failed to write record data"sv);
}
return success;
}
bool SerializationInterface::GetNextRecordInfo(std::uint32_t& a_type, std::uint32_t& a_version, std::uint32_t& a_length) const
{
const auto success =
GetProxy().GetNextRecordInfo(
std::addressof(a_type),
std::addressof(a_version),
std::addressof(a_length));
if (!success) {
log::warn("failed to get next record info"sv);
}
return success;
}
std::uint32_t SerializationInterface::ReadRecordData(void* a_buf, std::uint32_t a_length) const
{
const auto read =
GetProxy().ReadRecordData(
a_buf,
a_length);
if (read != a_length) {
log::warn("failed to read full record data {}B of {}B"sv, read, a_length);
}
return read;
}
bool PapyrusInterface::Register(RegisterFunctions* a_callback) const
{
const auto success = GetProxy().Register(a_callback);
if (!success) {
log::warn("failed to register callback"sv);
}
return success;
}
void* TrampolineInterface::AllocateFromBranchPool(std::size_t a_size) const
{
const auto mem =
GetProxy().AllocateFromBranchPool(
GetPluginHandle(),
a_size);
if (!mem) {
log::warn("failed to allocate from branch pool"sv);
}
return mem;
}
void* TrampolineInterface::AllocateFromLocalPool(std::size_t a_size) const
{
const auto mem =
GetProxy().AllocateFromLocalPool(
GetPluginHandle(),
a_size);
if (!mem) {
log::warn("failed to allocate from local pool"sv);
}
return mem;
}
}
| 23.106145
| 137
| 0.699952
|
blipvert
|
6a0ca3de6d18224a17a66cd8b884973869b02cd6
| 278,761
|
cpp
|
C++
|
Unity/build/iOS-Simulator/Classes/Native/Il2CppCompilerCalculateTypeValues_11Table.cpp
|
AnnaOpareva/Unity-iOS
|
dba005999d63e387167a36fe1feafd0b900626a8
|
[
"MIT"
] | 31
|
2019-01-15T16:32:02.000Z
|
2021-12-21T21:59:57.000Z
|
Unity/build/iOS-Simulator/Classes/Native/Il2CppCompilerCalculateTypeValues_11Table.cpp
|
AnnaOpareva/Unity-iOS
|
dba005999d63e387167a36fe1feafd0b900626a8
|
[
"MIT"
] | 5
|
2019-05-16T05:36:44.000Z
|
2022-03-18T10:12:53.000Z
|
Unity/build/iOS-Simulator/Classes/Native/Il2CppCompilerCalculateTypeValues_11Table.cpp
|
AnnaOpareva/Unity-iOS
|
dba005999d63e387167a36fe1feafd0b900626a8
|
[
"MIT"
] | 3
|
2019-05-25T02:30:43.000Z
|
2021-10-12T10:56:57.000Z
|
#import <TargetConditionals.h> // Modified by PostBuild.cs
#if TARGET_OS_SIMULATOR // Modified by PostBuild.cs
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "il2cpp-class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
// System.Action
struct Action_t591D2A86165F896B4B800BB5C25CE18672A55579;
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4;
// System.Byte[]
struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821;
// System.Char[]
struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2;
// System.Collections.Hashtable
struct Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9;
// System.Collections.IDictionary
struct IDictionary_t1BD5C1546718A374EA8122FBD6C6EE45331E8CE7;
// System.Collections.IDictionaryEnumerator
struct IDictionaryEnumerator_t456EB67407D2045A257B66A3A25A825E883FD027;
// System.Collections.IList
struct IList_tA637AB426E16F84F84ACC2813BDCF3A0414AF0AA;
// System.DelegateData
struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE;
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
// System.Diagnostics.StackTrace[]
struct StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196;
// System.Exception
struct Exception_t;
// System.IAsyncResult
struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598;
// System.Int32[]
struct Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83;
// System.IntPtr[]
struct IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD;
// System.MarshalByRefObject
struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF;
// System.Object[]
struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A;
// System.Reflection.MethodBase
struct MethodBase_t;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// System.Reflection.MonoMethod
struct MonoMethod_t;
// System.Runtime.CompilerServices.IAsyncStateMachine
struct IAsyncStateMachine_tEFDFBE18E061A6065AB2FF735F1425FB59F919BC;
// System.Runtime.Remoting.Activation.IActivator
struct IActivator_t15974073F0D524FFDBDED25A50325BECD183BA87;
// System.Runtime.Remoting.Contexts.Context
struct Context_tE86AB6B3D9759C8E715184808579EFE761683724;
// System.Runtime.Remoting.Identity
struct Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6;
// System.Runtime.Remoting.Messaging.ArgInfo
struct ArgInfo_t67419B6DE53980148631C33DF785307579134942;
// System.Runtime.Remoting.Messaging.AsyncResult
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2;
// System.Runtime.Remoting.Messaging.CADArgHolder
struct CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A;
// System.Runtime.Remoting.Messaging.CallContextRemotingData
struct CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347;
// System.Runtime.Remoting.Messaging.CallContextSecurityData
struct CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF;
// System.Runtime.Remoting.Messaging.Header[]
struct HeaderU5BU5D_t5EDB44F2B731039304163091DF818493DBB049AC;
// System.Runtime.Remoting.Messaging.IMessage
struct IMessage_t959A000023FFE2ED91C7AF8BB68CB6482888F8EB;
// System.Runtime.Remoting.Messaging.IMessageCtrl
struct IMessageCtrl_t51110C788CCAABE4722884C5FBAF98D97E90DA3D;
// System.Runtime.Remoting.Messaging.IMessageSink
struct IMessageSink_tB1CED1C3E8A2782C843D48468DB443B7940FC76C;
// System.Runtime.Remoting.Messaging.IMethodCallMessage
struct IMethodCallMessage_t9A3B0B9D1DCB71D44BB799FD5CA1100C4824C386;
// System.Runtime.Remoting.Messaging.IMethodMessage
struct IMethodMessage_tAF63A8DBD140DA0E8F5D8385270F81429CAA6420;
// System.Runtime.Remoting.Messaging.LogicalCallContext
struct LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E;
// System.Runtime.Remoting.Messaging.MCMDictionary
struct MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434;
// System.Runtime.Remoting.Messaging.MessageDictionary
struct MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5;
// System.Runtime.Remoting.Messaging.MethodReturnDictionary
struct MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48;
// System.Runtime.Remoting.Messaging.MonoMethodMessage
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234;
// System.Runtime.Remoting.Messaging.ObjRefSurrogate
struct ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547;
// System.Runtime.Remoting.Messaging.RemotingSurrogate
struct RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA;
// System.Runtime.Remoting.ObjRef
struct ObjRef_tA220448511DCA671EFC23F87F1C7FCA6ACC749D2;
// System.Runtime.Remoting.Proxies.RealProxy
struct RealProxy_t4B0A745F7C99373132CC67FE86D13421411361EF;
// System.Runtime.Remoting.Proxies.RemotingProxy
struct RemotingProxy_t02A995D835CE746F989867DC6713F084B355A4D9;
// System.Runtime.Remoting.ServerIdentity
struct ServerIdentity_t93C5C5C4D608C5E714F0C5061B9BFC17B3B567D2;
// System.Runtime.Serialization.ISurrogateSelector
struct ISurrogateSelector_t4C99617DAC31689CEC0EDB09B067A65E80E1C3EA;
// System.Runtime.Serialization.SafeSerializationManager
struct SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770;
// System.Security.Principal.IPrincipal
struct IPrincipal_t63FD7F58FBBE134C8FE4D31710AAEA00B000F0BF;
// System.String
struct String_t;
// System.String[]
struct StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E;
// System.Threading.ContextCallback
struct ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676;
// System.Threading.ExecutionContext
struct ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70;
// System.Threading.SendOrPostCallback
struct SendOrPostCallback_t3F9C0164860E4AA5138DF8B4488DFB0D33147F01;
// System.Threading.Tasks.Task
struct Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2;
// System.Threading.Tasks.Task`1<System.Boolean>
struct Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439;
// System.Threading.Tasks.Task`1<System.Int32>[]
struct Task_1U5BU5D_tF1E5C7D356B3C934B63AB0B3384819D681C4FD20;
// System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>
struct Task_1_t1359D75350E9D976BFA28AD96E417450DE277673;
// System.Threading.WaitCallback
struct WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC;
// System.Threading.WaitHandle
struct WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6;
// System.Type
struct Type_t;
// System.Type[]
struct TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F;
// System.UInt32[]
struct UInt32U5BU5D_t9AA834AF2940E75BBF8E3F08FF0D20D266DB71CB;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_com;
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_pinvoke;
struct Exception_t_marshaled_com;
struct Exception_t_marshaled_pinvoke;
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_com;
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_pinvoke;
struct WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6_marshaled_com;
struct WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6_marshaled_pinvoke;
#ifndef RUNTIMEOBJECT_H
#define RUNTIMEOBJECT_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Object
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMEOBJECT_H
#ifndef ATTRIBUTE_TF048C13FB3C8CFCC53F82290E4A3F621089F9A74_H
#define ATTRIBUTE_TF048C13FB3C8CFCC53F82290E4A3F621089F9A74_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Attribute
struct Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ATTRIBUTE_TF048C13FB3C8CFCC53F82290E4A3F621089F9A74_H
#ifndef EVENTARGS_T8E6CA180BE0E56674C6407011A94BAF7C757352E_H
#define EVENTARGS_T8E6CA180BE0E56674C6407011A94BAF7C757352E_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.EventArgs
struct EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E : public RuntimeObject
{
public:
public:
};
struct EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E_StaticFields
{
public:
// System.EventArgs System.EventArgs::Empty
EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E * ___Empty_0;
public:
inline static int32_t get_offset_of_Empty_0() { return static_cast<int32_t>(offsetof(EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E_StaticFields, ___Empty_0)); }
inline EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E * get_Empty_0() const { return ___Empty_0; }
inline EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E ** get_address_of_Empty_0() { return &___Empty_0; }
inline void set_Empty_0(EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E * value)
{
___Empty_0 = value;
Il2CppCodeGenWriteBarrier((&___Empty_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EVENTARGS_T8E6CA180BE0E56674C6407011A94BAF7C757352E_H
#ifndef EXCEPTION_T_H
#define EXCEPTION_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Exception
struct Exception_t : public RuntimeObject
{
public:
// System.String System.Exception::_className
String_t* ____className_1;
// System.String System.Exception::_message
String_t* ____message_2;
// System.Collections.IDictionary System.Exception::_data
RuntimeObject* ____data_3;
// System.Exception System.Exception::_innerException
Exception_t * ____innerException_4;
// System.String System.Exception::_helpURL
String_t* ____helpURL_5;
// System.Object System.Exception::_stackTrace
RuntimeObject * ____stackTrace_6;
// System.String System.Exception::_stackTraceString
String_t* ____stackTraceString_7;
// System.String System.Exception::_remoteStackTraceString
String_t* ____remoteStackTraceString_8;
// System.Int32 System.Exception::_remoteStackIndex
int32_t ____remoteStackIndex_9;
// System.Object System.Exception::_dynamicMethods
RuntimeObject * ____dynamicMethods_10;
// System.Int32 System.Exception::_HResult
int32_t ____HResult_11;
// System.String System.Exception::_source
String_t* ____source_12;
// System.Runtime.Serialization.SafeSerializationManager System.Exception::_safeSerializationManager
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
// System.Diagnostics.StackTrace[] System.Exception::captured_traces
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
// System.IntPtr[] System.Exception::native_trace_ips
IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* ___native_trace_ips_15;
public:
inline static int32_t get_offset_of__className_1() { return static_cast<int32_t>(offsetof(Exception_t, ____className_1)); }
inline String_t* get__className_1() const { return ____className_1; }
inline String_t** get_address_of__className_1() { return &____className_1; }
inline void set__className_1(String_t* value)
{
____className_1 = value;
Il2CppCodeGenWriteBarrier((&____className_1), value);
}
inline static int32_t get_offset_of__message_2() { return static_cast<int32_t>(offsetof(Exception_t, ____message_2)); }
inline String_t* get__message_2() const { return ____message_2; }
inline String_t** get_address_of__message_2() { return &____message_2; }
inline void set__message_2(String_t* value)
{
____message_2 = value;
Il2CppCodeGenWriteBarrier((&____message_2), value);
}
inline static int32_t get_offset_of__data_3() { return static_cast<int32_t>(offsetof(Exception_t, ____data_3)); }
inline RuntimeObject* get__data_3() const { return ____data_3; }
inline RuntimeObject** get_address_of__data_3() { return &____data_3; }
inline void set__data_3(RuntimeObject* value)
{
____data_3 = value;
Il2CppCodeGenWriteBarrier((&____data_3), value);
}
inline static int32_t get_offset_of__innerException_4() { return static_cast<int32_t>(offsetof(Exception_t, ____innerException_4)); }
inline Exception_t * get__innerException_4() const { return ____innerException_4; }
inline Exception_t ** get_address_of__innerException_4() { return &____innerException_4; }
inline void set__innerException_4(Exception_t * value)
{
____innerException_4 = value;
Il2CppCodeGenWriteBarrier((&____innerException_4), value);
}
inline static int32_t get_offset_of__helpURL_5() { return static_cast<int32_t>(offsetof(Exception_t, ____helpURL_5)); }
inline String_t* get__helpURL_5() const { return ____helpURL_5; }
inline String_t** get_address_of__helpURL_5() { return &____helpURL_5; }
inline void set__helpURL_5(String_t* value)
{
____helpURL_5 = value;
Il2CppCodeGenWriteBarrier((&____helpURL_5), value);
}
inline static int32_t get_offset_of__stackTrace_6() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTrace_6)); }
inline RuntimeObject * get__stackTrace_6() const { return ____stackTrace_6; }
inline RuntimeObject ** get_address_of__stackTrace_6() { return &____stackTrace_6; }
inline void set__stackTrace_6(RuntimeObject * value)
{
____stackTrace_6 = value;
Il2CppCodeGenWriteBarrier((&____stackTrace_6), value);
}
inline static int32_t get_offset_of__stackTraceString_7() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTraceString_7)); }
inline String_t* get__stackTraceString_7() const { return ____stackTraceString_7; }
inline String_t** get_address_of__stackTraceString_7() { return &____stackTraceString_7; }
inline void set__stackTraceString_7(String_t* value)
{
____stackTraceString_7 = value;
Il2CppCodeGenWriteBarrier((&____stackTraceString_7), value);
}
inline static int32_t get_offset_of__remoteStackTraceString_8() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_8)); }
inline String_t* get__remoteStackTraceString_8() const { return ____remoteStackTraceString_8; }
inline String_t** get_address_of__remoteStackTraceString_8() { return &____remoteStackTraceString_8; }
inline void set__remoteStackTraceString_8(String_t* value)
{
____remoteStackTraceString_8 = value;
Il2CppCodeGenWriteBarrier((&____remoteStackTraceString_8), value);
}
inline static int32_t get_offset_of__remoteStackIndex_9() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackIndex_9)); }
inline int32_t get__remoteStackIndex_9() const { return ____remoteStackIndex_9; }
inline int32_t* get_address_of__remoteStackIndex_9() { return &____remoteStackIndex_9; }
inline void set__remoteStackIndex_9(int32_t value)
{
____remoteStackIndex_9 = value;
}
inline static int32_t get_offset_of__dynamicMethods_10() { return static_cast<int32_t>(offsetof(Exception_t, ____dynamicMethods_10)); }
inline RuntimeObject * get__dynamicMethods_10() const { return ____dynamicMethods_10; }
inline RuntimeObject ** get_address_of__dynamicMethods_10() { return &____dynamicMethods_10; }
inline void set__dynamicMethods_10(RuntimeObject * value)
{
____dynamicMethods_10 = value;
Il2CppCodeGenWriteBarrier((&____dynamicMethods_10), value);
}
inline static int32_t get_offset_of__HResult_11() { return static_cast<int32_t>(offsetof(Exception_t, ____HResult_11)); }
inline int32_t get__HResult_11() const { return ____HResult_11; }
inline int32_t* get_address_of__HResult_11() { return &____HResult_11; }
inline void set__HResult_11(int32_t value)
{
____HResult_11 = value;
}
inline static int32_t get_offset_of__source_12() { return static_cast<int32_t>(offsetof(Exception_t, ____source_12)); }
inline String_t* get__source_12() const { return ____source_12; }
inline String_t** get_address_of__source_12() { return &____source_12; }
inline void set__source_12(String_t* value)
{
____source_12 = value;
Il2CppCodeGenWriteBarrier((&____source_12), value);
}
inline static int32_t get_offset_of__safeSerializationManager_13() { return static_cast<int32_t>(offsetof(Exception_t, ____safeSerializationManager_13)); }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * get__safeSerializationManager_13() const { return ____safeSerializationManager_13; }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 ** get_address_of__safeSerializationManager_13() { return &____safeSerializationManager_13; }
inline void set__safeSerializationManager_13(SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * value)
{
____safeSerializationManager_13 = value;
Il2CppCodeGenWriteBarrier((&____safeSerializationManager_13), value);
}
inline static int32_t get_offset_of_captured_traces_14() { return static_cast<int32_t>(offsetof(Exception_t, ___captured_traces_14)); }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* get_captured_traces_14() const { return ___captured_traces_14; }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196** get_address_of_captured_traces_14() { return &___captured_traces_14; }
inline void set_captured_traces_14(StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* value)
{
___captured_traces_14 = value;
Il2CppCodeGenWriteBarrier((&___captured_traces_14), value);
}
inline static int32_t get_offset_of_native_trace_ips_15() { return static_cast<int32_t>(offsetof(Exception_t, ___native_trace_ips_15)); }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* get_native_trace_ips_15() const { return ___native_trace_ips_15; }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD** get_address_of_native_trace_ips_15() { return &___native_trace_ips_15; }
inline void set_native_trace_ips_15(IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* value)
{
___native_trace_ips_15 = value;
Il2CppCodeGenWriteBarrier((&___native_trace_ips_15), value);
}
};
struct Exception_t_StaticFields
{
public:
// System.Object System.Exception::s_EDILock
RuntimeObject * ___s_EDILock_0;
public:
inline static int32_t get_offset_of_s_EDILock_0() { return static_cast<int32_t>(offsetof(Exception_t_StaticFields, ___s_EDILock_0)); }
inline RuntimeObject * get_s_EDILock_0() const { return ___s_EDILock_0; }
inline RuntimeObject ** get_address_of_s_EDILock_0() { return &___s_EDILock_0; }
inline void set_s_EDILock_0(RuntimeObject * value)
{
___s_EDILock_0 = value;
Il2CppCodeGenWriteBarrier((&___s_EDILock_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Exception
struct Exception_t_marshaled_pinvoke
{
char* ____className_1;
char* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_pinvoke* ____innerException_4;
char* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
char* ____stackTraceString_7;
char* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
char* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
intptr_t* ___native_trace_ips_15;
};
// Native definition for COM marshalling of System.Exception
struct Exception_t_marshaled_com
{
Il2CppChar* ____className_1;
Il2CppChar* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_com* ____innerException_4;
Il2CppChar* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
Il2CppChar* ____stackTraceString_7;
Il2CppChar* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
Il2CppChar* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
intptr_t* ___native_trace_ips_15;
};
#endif // EXCEPTION_T_H
#ifndef MARSHALBYREFOBJECT_TC4577953D0A44D0AB8597CFA868E01C858B1C9AF_H
#define MARSHALBYREFOBJECT_TC4577953D0A44D0AB8597CFA868E01C858B1C9AF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MarshalByRefObject
struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF : public RuntimeObject
{
public:
// System.Object System.MarshalByRefObject::_identity
RuntimeObject * ____identity_0;
public:
inline static int32_t get_offset_of__identity_0() { return static_cast<int32_t>(offsetof(MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF, ____identity_0)); }
inline RuntimeObject * get__identity_0() const { return ____identity_0; }
inline RuntimeObject ** get_address_of__identity_0() { return &____identity_0; }
inline void set__identity_0(RuntimeObject * value)
{
____identity_0 = value;
Il2CppCodeGenWriteBarrier((&____identity_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.MarshalByRefObject
struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF_marshaled_pinvoke
{
Il2CppIUnknown* ____identity_0;
};
// Native definition for COM marshalling of System.MarshalByRefObject
struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF_marshaled_com
{
Il2CppIUnknown* ____identity_0;
};
#endif // MARSHALBYREFOBJECT_TC4577953D0A44D0AB8597CFA868E01C858B1C9AF_H
#ifndef U3CU3EC_TFBB9560424DFB5E39123CDE092BE03875E657079_H
#define U3CU3EC_TFBB9560424DFB5E39123CDE092BE03875E657079_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c
struct U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079 : public RuntimeObject
{
public:
public:
};
struct U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields
{
public:
// System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c::<>9
U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079 * ___U3CU3E9_0;
// System.Threading.SendOrPostCallback System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c::<>9__6_0
SendOrPostCallback_t3F9C0164860E4AA5138DF8B4488DFB0D33147F01 * ___U3CU3E9__6_0_1;
// System.Threading.WaitCallback System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c::<>9__6_1
WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * ___U3CU3E9__6_1_2;
public:
inline static int32_t get_offset_of_U3CU3E9_0() { return static_cast<int32_t>(offsetof(U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields, ___U3CU3E9_0)); }
inline U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079 * get_U3CU3E9_0() const { return ___U3CU3E9_0; }
inline U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079 ** get_address_of_U3CU3E9_0() { return &___U3CU3E9_0; }
inline void set_U3CU3E9_0(U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079 * value)
{
___U3CU3E9_0 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3E9_0), value);
}
inline static int32_t get_offset_of_U3CU3E9__6_0_1() { return static_cast<int32_t>(offsetof(U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields, ___U3CU3E9__6_0_1)); }
inline SendOrPostCallback_t3F9C0164860E4AA5138DF8B4488DFB0D33147F01 * get_U3CU3E9__6_0_1() const { return ___U3CU3E9__6_0_1; }
inline SendOrPostCallback_t3F9C0164860E4AA5138DF8B4488DFB0D33147F01 ** get_address_of_U3CU3E9__6_0_1() { return &___U3CU3E9__6_0_1; }
inline void set_U3CU3E9__6_0_1(SendOrPostCallback_t3F9C0164860E4AA5138DF8B4488DFB0D33147F01 * value)
{
___U3CU3E9__6_0_1 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3E9__6_0_1), value);
}
inline static int32_t get_offset_of_U3CU3E9__6_1_2() { return static_cast<int32_t>(offsetof(U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields, ___U3CU3E9__6_1_2)); }
inline WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * get_U3CU3E9__6_1_2() const { return ___U3CU3E9__6_1_2; }
inline WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC ** get_address_of_U3CU3E9__6_1_2() { return &___U3CU3E9__6_1_2; }
inline void set_U3CU3E9__6_1_2(WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * value)
{
___U3CU3E9__6_1_2 = value;
Il2CppCodeGenWriteBarrier((&___U3CU3E9__6_1_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CU3EC_TFBB9560424DFB5E39123CDE092BE03875E657079_H
#ifndef U3CU3EC__DISPLAYCLASS4_0_T91BE7D82E3148DC17AD2CF3AFA190EE3018F2368_H
#define U3CU3EC__DISPLAYCLASS4_0_T91BE7D82E3148DC17AD2CF3AFA190EE3018F2368_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c__DisplayClass4_0
struct U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368 : public RuntimeObject
{
public:
// System.Threading.Tasks.Task System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c__DisplayClass4_0::innerTask
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___innerTask_0;
// System.Action System.Runtime.CompilerServices.AsyncMethodBuilderCore/<>c__DisplayClass4_0::continuation
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___continuation_1;
public:
inline static int32_t get_offset_of_innerTask_0() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368, ___innerTask_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_innerTask_0() const { return ___innerTask_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_innerTask_0() { return &___innerTask_0; }
inline void set_innerTask_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___innerTask_0 = value;
Il2CppCodeGenWriteBarrier((&___innerTask_0), value);
}
inline static int32_t get_offset_of_continuation_1() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368, ___continuation_1)); }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * get_continuation_1() const { return ___continuation_1; }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 ** get_address_of_continuation_1() { return &___continuation_1; }
inline void set_continuation_1(Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * value)
{
___continuation_1 = value;
Il2CppCodeGenWriteBarrier((&___continuation_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CU3EC__DISPLAYCLASS4_0_T91BE7D82E3148DC17AD2CF3AFA190EE3018F2368_H
#ifndef CONTINUATIONWRAPPER_TCC429E05B578FB77DAD5970B18B3DD07748DB201_H
#define CONTINUATIONWRAPPER_TCC429E05B578FB77DAD5970B18B3DD07748DB201_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncMethodBuilderCore/ContinuationWrapper
struct ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201 : public RuntimeObject
{
public:
// System.Action System.Runtime.CompilerServices.AsyncMethodBuilderCore/ContinuationWrapper::m_continuation
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___m_continuation_0;
// System.Action System.Runtime.CompilerServices.AsyncMethodBuilderCore/ContinuationWrapper::m_invokeAction
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___m_invokeAction_1;
// System.Threading.Tasks.Task System.Runtime.CompilerServices.AsyncMethodBuilderCore/ContinuationWrapper::m_innerTask
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_innerTask_2;
public:
inline static int32_t get_offset_of_m_continuation_0() { return static_cast<int32_t>(offsetof(ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201, ___m_continuation_0)); }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * get_m_continuation_0() const { return ___m_continuation_0; }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 ** get_address_of_m_continuation_0() { return &___m_continuation_0; }
inline void set_m_continuation_0(Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * value)
{
___m_continuation_0 = value;
Il2CppCodeGenWriteBarrier((&___m_continuation_0), value);
}
inline static int32_t get_offset_of_m_invokeAction_1() { return static_cast<int32_t>(offsetof(ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201, ___m_invokeAction_1)); }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * get_m_invokeAction_1() const { return ___m_invokeAction_1; }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 ** get_address_of_m_invokeAction_1() { return &___m_invokeAction_1; }
inline void set_m_invokeAction_1(Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * value)
{
___m_invokeAction_1 = value;
Il2CppCodeGenWriteBarrier((&___m_invokeAction_1), value);
}
inline static int32_t get_offset_of_m_innerTask_2() { return static_cast<int32_t>(offsetof(ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201, ___m_innerTask_2)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_innerTask_2() const { return ___m_innerTask_2; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_innerTask_2() { return &___m_innerTask_2; }
inline void set_m_innerTask_2(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_innerTask_2 = value;
Il2CppCodeGenWriteBarrier((&___m_innerTask_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONTINUATIONWRAPPER_TCC429E05B578FB77DAD5970B18B3DD07748DB201_H
#ifndef MOVENEXTRUNNER_T6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_H
#define MOVENEXTRUNNER_T6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner
struct MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A : public RuntimeObject
{
public:
// System.Threading.ExecutionContext System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner::m_context
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___m_context_0;
// System.Runtime.CompilerServices.IAsyncStateMachine System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner::m_stateMachine
RuntimeObject* ___m_stateMachine_1;
public:
inline static int32_t get_offset_of_m_context_0() { return static_cast<int32_t>(offsetof(MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A, ___m_context_0)); }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * get_m_context_0() const { return ___m_context_0; }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 ** get_address_of_m_context_0() { return &___m_context_0; }
inline void set_m_context_0(ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * value)
{
___m_context_0 = value;
Il2CppCodeGenWriteBarrier((&___m_context_0), value);
}
inline static int32_t get_offset_of_m_stateMachine_1() { return static_cast<int32_t>(offsetof(MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A, ___m_stateMachine_1)); }
inline RuntimeObject* get_m_stateMachine_1() const { return ___m_stateMachine_1; }
inline RuntimeObject** get_address_of_m_stateMachine_1() { return &___m_stateMachine_1; }
inline void set_m_stateMachine_1(RuntimeObject* value)
{
___m_stateMachine_1 = value;
Il2CppCodeGenWriteBarrier((&___m_stateMachine_1), value);
}
};
struct MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_StaticFields
{
public:
// System.Threading.ContextCallback System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner::s_invokeMoveNext
ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * ___s_invokeMoveNext_2;
public:
inline static int32_t get_offset_of_s_invokeMoveNext_2() { return static_cast<int32_t>(offsetof(MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_StaticFields, ___s_invokeMoveNext_2)); }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * get_s_invokeMoveNext_2() const { return ___s_invokeMoveNext_2; }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 ** get_address_of_s_invokeMoveNext_2() { return &___s_invokeMoveNext_2; }
inline void set_s_invokeMoveNext_2(ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * value)
{
___s_invokeMoveNext_2 = value;
Il2CppCodeGenWriteBarrier((&___s_invokeMoveNext_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MOVENEXTRUNNER_T6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_H
#ifndef ASYNCTASKCACHE_T34A97832FCD6948CE68777740FA37AEAB550E6CF_H
#define ASYNCTASKCACHE_T34A97832FCD6948CE68777740FA37AEAB550E6CF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncTaskCache
struct AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF : public RuntimeObject
{
public:
public:
};
struct AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields
{
public:
// System.Threading.Tasks.Task`1<System.Boolean> System.Runtime.CompilerServices.AsyncTaskCache::TrueTask
Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * ___TrueTask_0;
// System.Threading.Tasks.Task`1<System.Boolean> System.Runtime.CompilerServices.AsyncTaskCache::FalseTask
Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * ___FalseTask_1;
// System.Threading.Tasks.Task`1<System.Int32>[] System.Runtime.CompilerServices.AsyncTaskCache::Int32Tasks
Task_1U5BU5D_tF1E5C7D356B3C934B63AB0B3384819D681C4FD20* ___Int32Tasks_2;
public:
inline static int32_t get_offset_of_TrueTask_0() { return static_cast<int32_t>(offsetof(AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields, ___TrueTask_0)); }
inline Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * get_TrueTask_0() const { return ___TrueTask_0; }
inline Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 ** get_address_of_TrueTask_0() { return &___TrueTask_0; }
inline void set_TrueTask_0(Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * value)
{
___TrueTask_0 = value;
Il2CppCodeGenWriteBarrier((&___TrueTask_0), value);
}
inline static int32_t get_offset_of_FalseTask_1() { return static_cast<int32_t>(offsetof(AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields, ___FalseTask_1)); }
inline Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * get_FalseTask_1() const { return ___FalseTask_1; }
inline Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 ** get_address_of_FalseTask_1() { return &___FalseTask_1; }
inline void set_FalseTask_1(Task_1_tD6131FE3A3A2F1D58DB886B6CF31A2672B75B439 * value)
{
___FalseTask_1 = value;
Il2CppCodeGenWriteBarrier((&___FalseTask_1), value);
}
inline static int32_t get_offset_of_Int32Tasks_2() { return static_cast<int32_t>(offsetof(AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields, ___Int32Tasks_2)); }
inline Task_1U5BU5D_tF1E5C7D356B3C934B63AB0B3384819D681C4FD20* get_Int32Tasks_2() const { return ___Int32Tasks_2; }
inline Task_1U5BU5D_tF1E5C7D356B3C934B63AB0B3384819D681C4FD20** get_address_of_Int32Tasks_2() { return &___Int32Tasks_2; }
inline void set_Int32Tasks_2(Task_1U5BU5D_tF1E5C7D356B3C934B63AB0B3384819D681C4FD20* value)
{
___Int32Tasks_2 = value;
Il2CppCodeGenWriteBarrier((&___Int32Tasks_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ASYNCTASKCACHE_T34A97832FCD6948CE68777740FA37AEAB550E6CF_H
#ifndef CRITICALFINALIZEROBJECT_T8B006E1DEE084E781F5C0F3283E9226E28894DD9_H
#define CRITICALFINALIZEROBJECT_T8B006E1DEE084E781F5C0F3283E9226E28894DD9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ConstrainedExecution.CriticalFinalizerObject
struct CriticalFinalizerObject_t8B006E1DEE084E781F5C0F3283E9226E28894DD9 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CRITICALFINALIZEROBJECT_T8B006E1DEE084E781F5C0F3283E9226E28894DD9_H
#ifndef EXCEPTIONDISPATCHINFO_T0C54083F3909DAF986A4DEAA7C047559531E0E2A_H
#define EXCEPTIONDISPATCHINFO_T0C54083F3909DAF986A4DEAA7C047559531E0E2A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ExceptionServices.ExceptionDispatchInfo
struct ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A : public RuntimeObject
{
public:
// System.Exception System.Runtime.ExceptionServices.ExceptionDispatchInfo::m_Exception
Exception_t * ___m_Exception_0;
// System.Object System.Runtime.ExceptionServices.ExceptionDispatchInfo::m_stackTrace
RuntimeObject * ___m_stackTrace_1;
public:
inline static int32_t get_offset_of_m_Exception_0() { return static_cast<int32_t>(offsetof(ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A, ___m_Exception_0)); }
inline Exception_t * get_m_Exception_0() const { return ___m_Exception_0; }
inline Exception_t ** get_address_of_m_Exception_0() { return &___m_Exception_0; }
inline void set_m_Exception_0(Exception_t * value)
{
___m_Exception_0 = value;
Il2CppCodeGenWriteBarrier((&___m_Exception_0), value);
}
inline static int32_t get_offset_of_m_stackTrace_1() { return static_cast<int32_t>(offsetof(ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A, ___m_stackTrace_1)); }
inline RuntimeObject * get_m_stackTrace_1() const { return ___m_stackTrace_1; }
inline RuntimeObject ** get_address_of_m_stackTrace_1() { return &___m_stackTrace_1; }
inline void set_m_stackTrace_1(RuntimeObject * value)
{
___m_stackTrace_1 = value;
Il2CppCodeGenWriteBarrier((&___m_stackTrace_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXCEPTIONDISPATCHINFO_T0C54083F3909DAF986A4DEAA7C047559531E0E2A_H
#ifndef ARGINFO_T67419B6DE53980148631C33DF785307579134942_H
#define ARGINFO_T67419B6DE53980148631C33DF785307579134942_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ArgInfo
struct ArgInfo_t67419B6DE53980148631C33DF785307579134942 : public RuntimeObject
{
public:
// System.Int32[] System.Runtime.Remoting.Messaging.ArgInfo::_paramMap
Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* ____paramMap_0;
// System.Int32 System.Runtime.Remoting.Messaging.ArgInfo::_inoutArgCount
int32_t ____inoutArgCount_1;
// System.Reflection.MethodBase System.Runtime.Remoting.Messaging.ArgInfo::_method
MethodBase_t * ____method_2;
public:
inline static int32_t get_offset_of__paramMap_0() { return static_cast<int32_t>(offsetof(ArgInfo_t67419B6DE53980148631C33DF785307579134942, ____paramMap_0)); }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* get__paramMap_0() const { return ____paramMap_0; }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83** get_address_of__paramMap_0() { return &____paramMap_0; }
inline void set__paramMap_0(Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* value)
{
____paramMap_0 = value;
Il2CppCodeGenWriteBarrier((&____paramMap_0), value);
}
inline static int32_t get_offset_of__inoutArgCount_1() { return static_cast<int32_t>(offsetof(ArgInfo_t67419B6DE53980148631C33DF785307579134942, ____inoutArgCount_1)); }
inline int32_t get__inoutArgCount_1() const { return ____inoutArgCount_1; }
inline int32_t* get_address_of__inoutArgCount_1() { return &____inoutArgCount_1; }
inline void set__inoutArgCount_1(int32_t value)
{
____inoutArgCount_1 = value;
}
inline static int32_t get_offset_of__method_2() { return static_cast<int32_t>(offsetof(ArgInfo_t67419B6DE53980148631C33DF785307579134942, ____method_2)); }
inline MethodBase_t * get__method_2() const { return ____method_2; }
inline MethodBase_t ** get_address_of__method_2() { return &____method_2; }
inline void set__method_2(MethodBase_t * value)
{
____method_2 = value;
Il2CppCodeGenWriteBarrier((&____method_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARGINFO_T67419B6DE53980148631C33DF785307579134942_H
#ifndef CADARGHOLDER_T8983A769C5D0C79BEF91202F0167A41040D9FF4A_H
#define CADARGHOLDER_T8983A769C5D0C79BEF91202F0167A41040D9FF4A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADArgHolder
struct CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A : public RuntimeObject
{
public:
// System.Int32 System.Runtime.Remoting.Messaging.CADArgHolder::index
int32_t ___index_0;
public:
inline static int32_t get_offset_of_index_0() { return static_cast<int32_t>(offsetof(CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A, ___index_0)); }
inline int32_t get_index_0() const { return ___index_0; }
inline int32_t* get_address_of_index_0() { return &___index_0; }
inline void set_index_0(int32_t value)
{
___index_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADARGHOLDER_T8983A769C5D0C79BEF91202F0167A41040D9FF4A_H
#ifndef CADMESSAGEBASE_T427360000344A4FE250725A55B58FFB950AE5C6B_H
#define CADMESSAGEBASE_T427360000344A4FE250725A55B58FFB950AE5C6B_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADMessageBase
struct CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B : public RuntimeObject
{
public:
// System.Object[] System.Runtime.Remoting.Messaging.CADMessageBase::_args
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____args_0;
// System.Byte[] System.Runtime.Remoting.Messaging.CADMessageBase::_serializedArgs
ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ____serializedArgs_1;
// System.Int32 System.Runtime.Remoting.Messaging.CADMessageBase::_propertyCount
int32_t ____propertyCount_2;
// System.Runtime.Remoting.Messaging.CADArgHolder System.Runtime.Remoting.Messaging.CADMessageBase::_callContext
CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * ____callContext_3;
// System.Byte[] System.Runtime.Remoting.Messaging.CADMessageBase::serializedMethod
ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___serializedMethod_4;
public:
inline static int32_t get_offset_of__args_0() { return static_cast<int32_t>(offsetof(CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B, ____args_0)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__args_0() const { return ____args_0; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__args_0() { return &____args_0; }
inline void set__args_0(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____args_0 = value;
Il2CppCodeGenWriteBarrier((&____args_0), value);
}
inline static int32_t get_offset_of__serializedArgs_1() { return static_cast<int32_t>(offsetof(CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B, ____serializedArgs_1)); }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get__serializedArgs_1() const { return ____serializedArgs_1; }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of__serializedArgs_1() { return &____serializedArgs_1; }
inline void set__serializedArgs_1(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value)
{
____serializedArgs_1 = value;
Il2CppCodeGenWriteBarrier((&____serializedArgs_1), value);
}
inline static int32_t get_offset_of__propertyCount_2() { return static_cast<int32_t>(offsetof(CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B, ____propertyCount_2)); }
inline int32_t get__propertyCount_2() const { return ____propertyCount_2; }
inline int32_t* get_address_of__propertyCount_2() { return &____propertyCount_2; }
inline void set__propertyCount_2(int32_t value)
{
____propertyCount_2 = value;
}
inline static int32_t get_offset_of__callContext_3() { return static_cast<int32_t>(offsetof(CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B, ____callContext_3)); }
inline CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * get__callContext_3() const { return ____callContext_3; }
inline CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A ** get_address_of__callContext_3() { return &____callContext_3; }
inline void set__callContext_3(CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * value)
{
____callContext_3 = value;
Il2CppCodeGenWriteBarrier((&____callContext_3), value);
}
inline static int32_t get_offset_of_serializedMethod_4() { return static_cast<int32_t>(offsetof(CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B, ___serializedMethod_4)); }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_serializedMethod_4() const { return ___serializedMethod_4; }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_serializedMethod_4() { return &___serializedMethod_4; }
inline void set_serializedMethod_4(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value)
{
___serializedMethod_4 = value;
Il2CppCodeGenWriteBarrier((&___serializedMethod_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADMESSAGEBASE_T427360000344A4FE250725A55B58FFB950AE5C6B_H
#ifndef CADMETHODREF_T5AA4D29CC08E917A0691DD37DB71600FC0059759_H
#define CADMETHODREF_T5AA4D29CC08E917A0691DD37DB71600FC0059759_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADMethodRef
struct CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759 : public RuntimeObject
{
public:
// System.Boolean System.Runtime.Remoting.Messaging.CADMethodRef::ctor
bool ___ctor_0;
// System.String System.Runtime.Remoting.Messaging.CADMethodRef::typeName
String_t* ___typeName_1;
// System.String System.Runtime.Remoting.Messaging.CADMethodRef::methodName
String_t* ___methodName_2;
// System.String[] System.Runtime.Remoting.Messaging.CADMethodRef::param_names
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___param_names_3;
// System.String[] System.Runtime.Remoting.Messaging.CADMethodRef::generic_arg_names
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___generic_arg_names_4;
public:
inline static int32_t get_offset_of_ctor_0() { return static_cast<int32_t>(offsetof(CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759, ___ctor_0)); }
inline bool get_ctor_0() const { return ___ctor_0; }
inline bool* get_address_of_ctor_0() { return &___ctor_0; }
inline void set_ctor_0(bool value)
{
___ctor_0 = value;
}
inline static int32_t get_offset_of_typeName_1() { return static_cast<int32_t>(offsetof(CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759, ___typeName_1)); }
inline String_t* get_typeName_1() const { return ___typeName_1; }
inline String_t** get_address_of_typeName_1() { return &___typeName_1; }
inline void set_typeName_1(String_t* value)
{
___typeName_1 = value;
Il2CppCodeGenWriteBarrier((&___typeName_1), value);
}
inline static int32_t get_offset_of_methodName_2() { return static_cast<int32_t>(offsetof(CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759, ___methodName_2)); }
inline String_t* get_methodName_2() const { return ___methodName_2; }
inline String_t** get_address_of_methodName_2() { return &___methodName_2; }
inline void set_methodName_2(String_t* value)
{
___methodName_2 = value;
Il2CppCodeGenWriteBarrier((&___methodName_2), value);
}
inline static int32_t get_offset_of_param_names_3() { return static_cast<int32_t>(offsetof(CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759, ___param_names_3)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_param_names_3() const { return ___param_names_3; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_param_names_3() { return &___param_names_3; }
inline void set_param_names_3(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___param_names_3 = value;
Il2CppCodeGenWriteBarrier((&___param_names_3), value);
}
inline static int32_t get_offset_of_generic_arg_names_4() { return static_cast<int32_t>(offsetof(CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759, ___generic_arg_names_4)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_generic_arg_names_4() const { return ___generic_arg_names_4; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_generic_arg_names_4() { return &___generic_arg_names_4; }
inline void set_generic_arg_names_4(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___generic_arg_names_4 = value;
Il2CppCodeGenWriteBarrier((&___generic_arg_names_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADMETHODREF_T5AA4D29CC08E917A0691DD37DB71600FC0059759_H
#ifndef CADOBJREF_TA8BAE8646770C27FB69FB6FE43C9C81B68C72591_H
#define CADOBJREF_TA8BAE8646770C27FB69FB6FE43C9C81B68C72591_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADObjRef
struct CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591 : public RuntimeObject
{
public:
// System.Runtime.Remoting.ObjRef System.Runtime.Remoting.Messaging.CADObjRef::objref
ObjRef_tA220448511DCA671EFC23F87F1C7FCA6ACC749D2 * ___objref_0;
// System.Int32 System.Runtime.Remoting.Messaging.CADObjRef::SourceDomain
int32_t ___SourceDomain_1;
// System.Byte[] System.Runtime.Remoting.Messaging.CADObjRef::TypeInfo
ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___TypeInfo_2;
public:
inline static int32_t get_offset_of_objref_0() { return static_cast<int32_t>(offsetof(CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591, ___objref_0)); }
inline ObjRef_tA220448511DCA671EFC23F87F1C7FCA6ACC749D2 * get_objref_0() const { return ___objref_0; }
inline ObjRef_tA220448511DCA671EFC23F87F1C7FCA6ACC749D2 ** get_address_of_objref_0() { return &___objref_0; }
inline void set_objref_0(ObjRef_tA220448511DCA671EFC23F87F1C7FCA6ACC749D2 * value)
{
___objref_0 = value;
Il2CppCodeGenWriteBarrier((&___objref_0), value);
}
inline static int32_t get_offset_of_SourceDomain_1() { return static_cast<int32_t>(offsetof(CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591, ___SourceDomain_1)); }
inline int32_t get_SourceDomain_1() const { return ___SourceDomain_1; }
inline int32_t* get_address_of_SourceDomain_1() { return &___SourceDomain_1; }
inline void set_SourceDomain_1(int32_t value)
{
___SourceDomain_1 = value;
}
inline static int32_t get_offset_of_TypeInfo_2() { return static_cast<int32_t>(offsetof(CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591, ___TypeInfo_2)); }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_TypeInfo_2() const { return ___TypeInfo_2; }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_TypeInfo_2() { return &___TypeInfo_2; }
inline void set_TypeInfo_2(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value)
{
___TypeInfo_2 = value;
Il2CppCodeGenWriteBarrier((&___TypeInfo_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADOBJREF_TA8BAE8646770C27FB69FB6FE43C9C81B68C72591_H
#ifndef CALLCONTEXT_TFB5D4D2D6BB4F51BA82A549CEA456DD9608CDA1A_H
#define CALLCONTEXT_TFB5D4D2D6BB4F51BA82A549CEA456DD9608CDA1A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CallContext
struct CallContext_tFB5D4D2D6BB4F51BA82A549CEA456DD9608CDA1A : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CALLCONTEXT_TFB5D4D2D6BB4F51BA82A549CEA456DD9608CDA1A_H
#ifndef CALLCONTEXTREMOTINGDATA_T40838E8CBCE35E4459B70A8F701128385E2D1347_H
#define CALLCONTEXTREMOTINGDATA_T40838E8CBCE35E4459B70A8F701128385E2D1347_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CallContextRemotingData
struct CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347 : public RuntimeObject
{
public:
// System.String System.Runtime.Remoting.Messaging.CallContextRemotingData::_logicalCallID
String_t* ____logicalCallID_0;
public:
inline static int32_t get_offset_of__logicalCallID_0() { return static_cast<int32_t>(offsetof(CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347, ____logicalCallID_0)); }
inline String_t* get__logicalCallID_0() const { return ____logicalCallID_0; }
inline String_t** get_address_of__logicalCallID_0() { return &____logicalCallID_0; }
inline void set__logicalCallID_0(String_t* value)
{
____logicalCallID_0 = value;
Il2CppCodeGenWriteBarrier((&____logicalCallID_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CALLCONTEXTREMOTINGDATA_T40838E8CBCE35E4459B70A8F701128385E2D1347_H
#ifndef CALLCONTEXTSECURITYDATA_T72826F22C5CFD231ECF664638EFFBF458D0AE9AF_H
#define CALLCONTEXTSECURITYDATA_T72826F22C5CFD231ECF664638EFFBF458D0AE9AF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CallContextSecurityData
struct CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF : public RuntimeObject
{
public:
// System.Security.Principal.IPrincipal System.Runtime.Remoting.Messaging.CallContextSecurityData::_principal
RuntimeObject* ____principal_0;
public:
inline static int32_t get_offset_of__principal_0() { return static_cast<int32_t>(offsetof(CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF, ____principal_0)); }
inline RuntimeObject* get__principal_0() const { return ____principal_0; }
inline RuntimeObject** get_address_of__principal_0() { return &____principal_0; }
inline void set__principal_0(RuntimeObject* value)
{
____principal_0 = value;
Il2CppCodeGenWriteBarrier((&____principal_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CALLCONTEXTSECURITYDATA_T72826F22C5CFD231ECF664638EFFBF458D0AE9AF_H
#ifndef CLIENTCONTEXTREPLYSINK_T800CF65D66E386E44690A372676FC9936E2DCA8C_H
#define CLIENTCONTEXTREPLYSINK_T800CF65D66E386E44690A372676FC9936E2DCA8C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ClientContextReplySink
struct ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C : public RuntimeObject
{
public:
// System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Messaging.ClientContextReplySink::_replySink
RuntimeObject* ____replySink_0;
// System.Runtime.Remoting.Contexts.Context System.Runtime.Remoting.Messaging.ClientContextReplySink::_context
Context_tE86AB6B3D9759C8E715184808579EFE761683724 * ____context_1;
public:
inline static int32_t get_offset_of__replySink_0() { return static_cast<int32_t>(offsetof(ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C, ____replySink_0)); }
inline RuntimeObject* get__replySink_0() const { return ____replySink_0; }
inline RuntimeObject** get_address_of__replySink_0() { return &____replySink_0; }
inline void set__replySink_0(RuntimeObject* value)
{
____replySink_0 = value;
Il2CppCodeGenWriteBarrier((&____replySink_0), value);
}
inline static int32_t get_offset_of__context_1() { return static_cast<int32_t>(offsetof(ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C, ____context_1)); }
inline Context_tE86AB6B3D9759C8E715184808579EFE761683724 * get__context_1() const { return ____context_1; }
inline Context_tE86AB6B3D9759C8E715184808579EFE761683724 ** get_address_of__context_1() { return &____context_1; }
inline void set__context_1(Context_tE86AB6B3D9759C8E715184808579EFE761683724 * value)
{
____context_1 = value;
Il2CppCodeGenWriteBarrier((&____context_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIENTCONTEXTREPLYSINK_T800CF65D66E386E44690A372676FC9936E2DCA8C_H
#ifndef CLIENTCONTEXTTERMINATORSINK_TCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB_H
#define CLIENTCONTEXTTERMINATORSINK_TCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ClientContextTerminatorSink
struct ClientContextTerminatorSink_tCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB : public RuntimeObject
{
public:
// System.Runtime.Remoting.Contexts.Context System.Runtime.Remoting.Messaging.ClientContextTerminatorSink::_context
Context_tE86AB6B3D9759C8E715184808579EFE761683724 * ____context_0;
public:
inline static int32_t get_offset_of__context_0() { return static_cast<int32_t>(offsetof(ClientContextTerminatorSink_tCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB, ____context_0)); }
inline Context_tE86AB6B3D9759C8E715184808579EFE761683724 * get__context_0() const { return ____context_0; }
inline Context_tE86AB6B3D9759C8E715184808579EFE761683724 ** get_address_of__context_0() { return &____context_0; }
inline void set__context_0(Context_tE86AB6B3D9759C8E715184808579EFE761683724 * value)
{
____context_0 = value;
Il2CppCodeGenWriteBarrier((&____context_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CLIENTCONTEXTTERMINATORSINK_TCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB_H
#ifndef ENVOYTERMINATORSINK_T58C3EE980197493267EB942D964BC8B507F14806_H
#define ENVOYTERMINATORSINK_T58C3EE980197493267EB942D964BC8B507F14806_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.EnvoyTerminatorSink
struct EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806 : public RuntimeObject
{
public:
public:
};
struct EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806_StaticFields
{
public:
// System.Runtime.Remoting.Messaging.EnvoyTerminatorSink System.Runtime.Remoting.Messaging.EnvoyTerminatorSink::Instance
EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806 * ___Instance_0;
public:
inline static int32_t get_offset_of_Instance_0() { return static_cast<int32_t>(offsetof(EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806_StaticFields, ___Instance_0)); }
inline EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806 * get_Instance_0() const { return ___Instance_0; }
inline EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806 ** get_address_of_Instance_0() { return &___Instance_0; }
inline void set_Instance_0(EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806 * value)
{
___Instance_0 = value;
Il2CppCodeGenWriteBarrier((&___Instance_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENVOYTERMINATORSINK_T58C3EE980197493267EB942D964BC8B507F14806_H
#ifndef ERRORMESSAGE_T8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D_H
#define ERRORMESSAGE_T8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ErrorMessage
struct ErrorMessage_t8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D : public RuntimeObject
{
public:
// System.String System.Runtime.Remoting.Messaging.ErrorMessage::_uri
String_t* ____uri_0;
public:
inline static int32_t get_offset_of__uri_0() { return static_cast<int32_t>(offsetof(ErrorMessage_t8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D, ____uri_0)); }
inline String_t* get__uri_0() const { return ____uri_0; }
inline String_t** get_address_of__uri_0() { return &____uri_0; }
inline void set__uri_0(String_t* value)
{
____uri_0 = value;
Il2CppCodeGenWriteBarrier((&____uri_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ERRORMESSAGE_T8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D_H
#ifndef HEADER_TBB05146C08BE55AC72B8813E862DA50FDFB2417C_H
#define HEADER_TBB05146C08BE55AC72B8813E862DA50FDFB2417C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.Header
struct Header_tBB05146C08BE55AC72B8813E862DA50FDFB2417C : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // HEADER_TBB05146C08BE55AC72B8813E862DA50FDFB2417C_H
#ifndef ILLOGICALCALLCONTEXT_T86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179_H
#define ILLOGICALCALLCONTEXT_T86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.IllogicalCallContext
struct IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179 : public RuntimeObject
{
public:
// System.Collections.Hashtable System.Runtime.Remoting.Messaging.IllogicalCallContext::m_Datastore
Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * ___m_Datastore_0;
// System.Object System.Runtime.Remoting.Messaging.IllogicalCallContext::m_HostContext
RuntimeObject * ___m_HostContext_1;
public:
inline static int32_t get_offset_of_m_Datastore_0() { return static_cast<int32_t>(offsetof(IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179, ___m_Datastore_0)); }
inline Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * get_m_Datastore_0() const { return ___m_Datastore_0; }
inline Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 ** get_address_of_m_Datastore_0() { return &___m_Datastore_0; }
inline void set_m_Datastore_0(Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * value)
{
___m_Datastore_0 = value;
Il2CppCodeGenWriteBarrier((&___m_Datastore_0), value);
}
inline static int32_t get_offset_of_m_HostContext_1() { return static_cast<int32_t>(offsetof(IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179, ___m_HostContext_1)); }
inline RuntimeObject * get_m_HostContext_1() const { return ___m_HostContext_1; }
inline RuntimeObject ** get_address_of_m_HostContext_1() { return &___m_HostContext_1; }
inline void set_m_HostContext_1(RuntimeObject * value)
{
___m_HostContext_1 = value;
Il2CppCodeGenWriteBarrier((&___m_HostContext_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ILLOGICALCALLCONTEXT_T86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179_H
#ifndef LOGICALCALLCONTEXT_T3A9A7C02A28577F0879F6E950E46EEC595731D7E_H
#define LOGICALCALLCONTEXT_T3A9A7C02A28577F0879F6E950E46EEC595731D7E_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.LogicalCallContext
struct LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E : public RuntimeObject
{
public:
// System.Collections.Hashtable System.Runtime.Remoting.Messaging.LogicalCallContext::m_Datastore
Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * ___m_Datastore_1;
// System.Runtime.Remoting.Messaging.CallContextRemotingData System.Runtime.Remoting.Messaging.LogicalCallContext::m_RemotingData
CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347 * ___m_RemotingData_2;
// System.Runtime.Remoting.Messaging.CallContextSecurityData System.Runtime.Remoting.Messaging.LogicalCallContext::m_SecurityData
CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF * ___m_SecurityData_3;
// System.Object System.Runtime.Remoting.Messaging.LogicalCallContext::m_HostContext
RuntimeObject * ___m_HostContext_4;
// System.Boolean System.Runtime.Remoting.Messaging.LogicalCallContext::m_IsCorrelationMgr
bool ___m_IsCorrelationMgr_5;
public:
inline static int32_t get_offset_of_m_Datastore_1() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E, ___m_Datastore_1)); }
inline Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * get_m_Datastore_1() const { return ___m_Datastore_1; }
inline Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 ** get_address_of_m_Datastore_1() { return &___m_Datastore_1; }
inline void set_m_Datastore_1(Hashtable_t978F65B8006C8F5504B286526AEC6608FF983FC9 * value)
{
___m_Datastore_1 = value;
Il2CppCodeGenWriteBarrier((&___m_Datastore_1), value);
}
inline static int32_t get_offset_of_m_RemotingData_2() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E, ___m_RemotingData_2)); }
inline CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347 * get_m_RemotingData_2() const { return ___m_RemotingData_2; }
inline CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347 ** get_address_of_m_RemotingData_2() { return &___m_RemotingData_2; }
inline void set_m_RemotingData_2(CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347 * value)
{
___m_RemotingData_2 = value;
Il2CppCodeGenWriteBarrier((&___m_RemotingData_2), value);
}
inline static int32_t get_offset_of_m_SecurityData_3() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E, ___m_SecurityData_3)); }
inline CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF * get_m_SecurityData_3() const { return ___m_SecurityData_3; }
inline CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF ** get_address_of_m_SecurityData_3() { return &___m_SecurityData_3; }
inline void set_m_SecurityData_3(CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF * value)
{
___m_SecurityData_3 = value;
Il2CppCodeGenWriteBarrier((&___m_SecurityData_3), value);
}
inline static int32_t get_offset_of_m_HostContext_4() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E, ___m_HostContext_4)); }
inline RuntimeObject * get_m_HostContext_4() const { return ___m_HostContext_4; }
inline RuntimeObject ** get_address_of_m_HostContext_4() { return &___m_HostContext_4; }
inline void set_m_HostContext_4(RuntimeObject * value)
{
___m_HostContext_4 = value;
Il2CppCodeGenWriteBarrier((&___m_HostContext_4), value);
}
inline static int32_t get_offset_of_m_IsCorrelationMgr_5() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E, ___m_IsCorrelationMgr_5)); }
inline bool get_m_IsCorrelationMgr_5() const { return ___m_IsCorrelationMgr_5; }
inline bool* get_address_of_m_IsCorrelationMgr_5() { return &___m_IsCorrelationMgr_5; }
inline void set_m_IsCorrelationMgr_5(bool value)
{
___m_IsCorrelationMgr_5 = value;
}
};
struct LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E_StaticFields
{
public:
// System.Type System.Runtime.Remoting.Messaging.LogicalCallContext::s_callContextType
Type_t * ___s_callContextType_0;
public:
inline static int32_t get_offset_of_s_callContextType_0() { return static_cast<int32_t>(offsetof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E_StaticFields, ___s_callContextType_0)); }
inline Type_t * get_s_callContextType_0() const { return ___s_callContextType_0; }
inline Type_t ** get_address_of_s_callContextType_0() { return &___s_callContextType_0; }
inline void set_s_callContextType_0(Type_t * value)
{
___s_callContextType_0 = value;
Il2CppCodeGenWriteBarrier((&___s_callContextType_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOGICALCALLCONTEXT_T3A9A7C02A28577F0879F6E950E46EEC595731D7E_H
#ifndef MESSAGEDICTIONARY_TC2DDCAFD65B74954A76393BCE90E57F58298F5C5_H
#define MESSAGEDICTIONARY_TC2DDCAFD65B74954A76393BCE90E57F58298F5C5_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MessageDictionary
struct MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5 : public RuntimeObject
{
public:
// System.Collections.IDictionary System.Runtime.Remoting.Messaging.MessageDictionary::_internalProperties
RuntimeObject* ____internalProperties_0;
// System.Runtime.Remoting.Messaging.IMethodMessage System.Runtime.Remoting.Messaging.MessageDictionary::_message
RuntimeObject* ____message_1;
// System.String[] System.Runtime.Remoting.Messaging.MessageDictionary::_methodKeys
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ____methodKeys_2;
// System.Boolean System.Runtime.Remoting.Messaging.MessageDictionary::_ownProperties
bool ____ownProperties_3;
public:
inline static int32_t get_offset_of__internalProperties_0() { return static_cast<int32_t>(offsetof(MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5, ____internalProperties_0)); }
inline RuntimeObject* get__internalProperties_0() const { return ____internalProperties_0; }
inline RuntimeObject** get_address_of__internalProperties_0() { return &____internalProperties_0; }
inline void set__internalProperties_0(RuntimeObject* value)
{
____internalProperties_0 = value;
Il2CppCodeGenWriteBarrier((&____internalProperties_0), value);
}
inline static int32_t get_offset_of__message_1() { return static_cast<int32_t>(offsetof(MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5, ____message_1)); }
inline RuntimeObject* get__message_1() const { return ____message_1; }
inline RuntimeObject** get_address_of__message_1() { return &____message_1; }
inline void set__message_1(RuntimeObject* value)
{
____message_1 = value;
Il2CppCodeGenWriteBarrier((&____message_1), value);
}
inline static int32_t get_offset_of__methodKeys_2() { return static_cast<int32_t>(offsetof(MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5, ____methodKeys_2)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get__methodKeys_2() const { return ____methodKeys_2; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of__methodKeys_2() { return &____methodKeys_2; }
inline void set__methodKeys_2(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
____methodKeys_2 = value;
Il2CppCodeGenWriteBarrier((&____methodKeys_2), value);
}
inline static int32_t get_offset_of__ownProperties_3() { return static_cast<int32_t>(offsetof(MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5, ____ownProperties_3)); }
inline bool get__ownProperties_3() const { return ____ownProperties_3; }
inline bool* get_address_of__ownProperties_3() { return &____ownProperties_3; }
inline void set__ownProperties_3(bool value)
{
____ownProperties_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MESSAGEDICTIONARY_TC2DDCAFD65B74954A76393BCE90E57F58298F5C5_H
#ifndef DICTIONARYENUMERATOR_TA162086B57068DE62A7BAD2CAA7003E632DE2AB9_H
#define DICTIONARYENUMERATOR_TA162086B57068DE62A7BAD2CAA7003E632DE2AB9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MessageDictionary/DictionaryEnumerator
struct DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9 : public RuntimeObject
{
public:
// System.Runtime.Remoting.Messaging.MessageDictionary System.Runtime.Remoting.Messaging.MessageDictionary/DictionaryEnumerator::_methodDictionary
MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5 * ____methodDictionary_0;
// System.Collections.IDictionaryEnumerator System.Runtime.Remoting.Messaging.MessageDictionary/DictionaryEnumerator::_hashtableEnum
RuntimeObject* ____hashtableEnum_1;
// System.Int32 System.Runtime.Remoting.Messaging.MessageDictionary/DictionaryEnumerator::_posMethod
int32_t ____posMethod_2;
public:
inline static int32_t get_offset_of__methodDictionary_0() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9, ____methodDictionary_0)); }
inline MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5 * get__methodDictionary_0() const { return ____methodDictionary_0; }
inline MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5 ** get_address_of__methodDictionary_0() { return &____methodDictionary_0; }
inline void set__methodDictionary_0(MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5 * value)
{
____methodDictionary_0 = value;
Il2CppCodeGenWriteBarrier((&____methodDictionary_0), value);
}
inline static int32_t get_offset_of__hashtableEnum_1() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9, ____hashtableEnum_1)); }
inline RuntimeObject* get__hashtableEnum_1() const { return ____hashtableEnum_1; }
inline RuntimeObject** get_address_of__hashtableEnum_1() { return &____hashtableEnum_1; }
inline void set__hashtableEnum_1(RuntimeObject* value)
{
____hashtableEnum_1 = value;
Il2CppCodeGenWriteBarrier((&____hashtableEnum_1), value);
}
inline static int32_t get_offset_of__posMethod_2() { return static_cast<int32_t>(offsetof(DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9, ____posMethod_2)); }
inline int32_t get__posMethod_2() const { return ____posMethod_2; }
inline int32_t* get_address_of__posMethod_2() { return &____posMethod_2; }
inline void set__posMethod_2(int32_t value)
{
____posMethod_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DICTIONARYENUMERATOR_TA162086B57068DE62A7BAD2CAA7003E632DE2AB9_H
#ifndef METHODCALL_TF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA_H
#define METHODCALL_TF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MethodCall
struct MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA : public RuntimeObject
{
public:
// System.String System.Runtime.Remoting.Messaging.MethodCall::_uri
String_t* ____uri_0;
// System.String System.Runtime.Remoting.Messaging.MethodCall::_typeName
String_t* ____typeName_1;
// System.String System.Runtime.Remoting.Messaging.MethodCall::_methodName
String_t* ____methodName_2;
// System.Object[] System.Runtime.Remoting.Messaging.MethodCall::_args
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____args_3;
// System.Type[] System.Runtime.Remoting.Messaging.MethodCall::_methodSignature
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ____methodSignature_4;
// System.Reflection.MethodBase System.Runtime.Remoting.Messaging.MethodCall::_methodBase
MethodBase_t * ____methodBase_5;
// System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.MethodCall::_callContext
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ____callContext_6;
// System.Runtime.Remoting.Identity System.Runtime.Remoting.Messaging.MethodCall::_targetIdentity
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ____targetIdentity_7;
// System.Type[] System.Runtime.Remoting.Messaging.MethodCall::_genericArguments
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ____genericArguments_8;
// System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodCall::ExternalProperties
RuntimeObject* ___ExternalProperties_9;
// System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodCall::InternalProperties
RuntimeObject* ___InternalProperties_10;
public:
inline static int32_t get_offset_of__uri_0() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____uri_0)); }
inline String_t* get__uri_0() const { return ____uri_0; }
inline String_t** get_address_of__uri_0() { return &____uri_0; }
inline void set__uri_0(String_t* value)
{
____uri_0 = value;
Il2CppCodeGenWriteBarrier((&____uri_0), value);
}
inline static int32_t get_offset_of__typeName_1() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____typeName_1)); }
inline String_t* get__typeName_1() const { return ____typeName_1; }
inline String_t** get_address_of__typeName_1() { return &____typeName_1; }
inline void set__typeName_1(String_t* value)
{
____typeName_1 = value;
Il2CppCodeGenWriteBarrier((&____typeName_1), value);
}
inline static int32_t get_offset_of__methodName_2() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____methodName_2)); }
inline String_t* get__methodName_2() const { return ____methodName_2; }
inline String_t** get_address_of__methodName_2() { return &____methodName_2; }
inline void set__methodName_2(String_t* value)
{
____methodName_2 = value;
Il2CppCodeGenWriteBarrier((&____methodName_2), value);
}
inline static int32_t get_offset_of__args_3() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____args_3)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__args_3() const { return ____args_3; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__args_3() { return &____args_3; }
inline void set__args_3(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____args_3 = value;
Il2CppCodeGenWriteBarrier((&____args_3), value);
}
inline static int32_t get_offset_of__methodSignature_4() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____methodSignature_4)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get__methodSignature_4() const { return ____methodSignature_4; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of__methodSignature_4() { return &____methodSignature_4; }
inline void set__methodSignature_4(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
____methodSignature_4 = value;
Il2CppCodeGenWriteBarrier((&____methodSignature_4), value);
}
inline static int32_t get_offset_of__methodBase_5() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____methodBase_5)); }
inline MethodBase_t * get__methodBase_5() const { return ____methodBase_5; }
inline MethodBase_t ** get_address_of__methodBase_5() { return &____methodBase_5; }
inline void set__methodBase_5(MethodBase_t * value)
{
____methodBase_5 = value;
Il2CppCodeGenWriteBarrier((&____methodBase_5), value);
}
inline static int32_t get_offset_of__callContext_6() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____callContext_6)); }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * get__callContext_6() const { return ____callContext_6; }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E ** get_address_of__callContext_6() { return &____callContext_6; }
inline void set__callContext_6(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * value)
{
____callContext_6 = value;
Il2CppCodeGenWriteBarrier((&____callContext_6), value);
}
inline static int32_t get_offset_of__targetIdentity_7() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____targetIdentity_7)); }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * get__targetIdentity_7() const { return ____targetIdentity_7; }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 ** get_address_of__targetIdentity_7() { return &____targetIdentity_7; }
inline void set__targetIdentity_7(Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * value)
{
____targetIdentity_7 = value;
Il2CppCodeGenWriteBarrier((&____targetIdentity_7), value);
}
inline static int32_t get_offset_of__genericArguments_8() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ____genericArguments_8)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get__genericArguments_8() const { return ____genericArguments_8; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of__genericArguments_8() { return &____genericArguments_8; }
inline void set__genericArguments_8(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
____genericArguments_8 = value;
Il2CppCodeGenWriteBarrier((&____genericArguments_8), value);
}
inline static int32_t get_offset_of_ExternalProperties_9() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ___ExternalProperties_9)); }
inline RuntimeObject* get_ExternalProperties_9() const { return ___ExternalProperties_9; }
inline RuntimeObject** get_address_of_ExternalProperties_9() { return &___ExternalProperties_9; }
inline void set_ExternalProperties_9(RuntimeObject* value)
{
___ExternalProperties_9 = value;
Il2CppCodeGenWriteBarrier((&___ExternalProperties_9), value);
}
inline static int32_t get_offset_of_InternalProperties_10() { return static_cast<int32_t>(offsetof(MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA, ___InternalProperties_10)); }
inline RuntimeObject* get_InternalProperties_10() const { return ___InternalProperties_10; }
inline RuntimeObject** get_address_of_InternalProperties_10() { return &___InternalProperties_10; }
inline void set_InternalProperties_10(RuntimeObject* value)
{
___InternalProperties_10 = value;
Il2CppCodeGenWriteBarrier((&___InternalProperties_10), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // METHODCALL_TF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA_H
#ifndef METHODRESPONSE_T185820C6B3E7D56E9026084CB2CEF1387151D907_H
#define METHODRESPONSE_T185820C6B3E7D56E9026084CB2CEF1387151D907_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MethodResponse
struct MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907 : public RuntimeObject
{
public:
// System.String System.Runtime.Remoting.Messaging.MethodResponse::_methodName
String_t* ____methodName_0;
// System.String System.Runtime.Remoting.Messaging.MethodResponse::_uri
String_t* ____uri_1;
// System.String System.Runtime.Remoting.Messaging.MethodResponse::_typeName
String_t* ____typeName_2;
// System.Reflection.MethodBase System.Runtime.Remoting.Messaging.MethodResponse::_methodBase
MethodBase_t * ____methodBase_3;
// System.Object System.Runtime.Remoting.Messaging.MethodResponse::_returnValue
RuntimeObject * ____returnValue_4;
// System.Exception System.Runtime.Remoting.Messaging.MethodResponse::_exception
Exception_t * ____exception_5;
// System.Type[] System.Runtime.Remoting.Messaging.MethodResponse::_methodSignature
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ____methodSignature_6;
// System.Runtime.Remoting.Messaging.ArgInfo System.Runtime.Remoting.Messaging.MethodResponse::_inArgInfo
ArgInfo_t67419B6DE53980148631C33DF785307579134942 * ____inArgInfo_7;
// System.Object[] System.Runtime.Remoting.Messaging.MethodResponse::_args
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____args_8;
// System.Object[] System.Runtime.Remoting.Messaging.MethodResponse::_outArgs
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____outArgs_9;
// System.Runtime.Remoting.Messaging.IMethodCallMessage System.Runtime.Remoting.Messaging.MethodResponse::_callMsg
RuntimeObject* ____callMsg_10;
// System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.MethodResponse::_callContext
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ____callContext_11;
// System.Runtime.Remoting.Identity System.Runtime.Remoting.Messaging.MethodResponse::_targetIdentity
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ____targetIdentity_12;
// System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodResponse::ExternalProperties
RuntimeObject* ___ExternalProperties_13;
// System.Collections.IDictionary System.Runtime.Remoting.Messaging.MethodResponse::InternalProperties
RuntimeObject* ___InternalProperties_14;
public:
inline static int32_t get_offset_of__methodName_0() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____methodName_0)); }
inline String_t* get__methodName_0() const { return ____methodName_0; }
inline String_t** get_address_of__methodName_0() { return &____methodName_0; }
inline void set__methodName_0(String_t* value)
{
____methodName_0 = value;
Il2CppCodeGenWriteBarrier((&____methodName_0), value);
}
inline static int32_t get_offset_of__uri_1() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____uri_1)); }
inline String_t* get__uri_1() const { return ____uri_1; }
inline String_t** get_address_of__uri_1() { return &____uri_1; }
inline void set__uri_1(String_t* value)
{
____uri_1 = value;
Il2CppCodeGenWriteBarrier((&____uri_1), value);
}
inline static int32_t get_offset_of__typeName_2() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____typeName_2)); }
inline String_t* get__typeName_2() const { return ____typeName_2; }
inline String_t** get_address_of__typeName_2() { return &____typeName_2; }
inline void set__typeName_2(String_t* value)
{
____typeName_2 = value;
Il2CppCodeGenWriteBarrier((&____typeName_2), value);
}
inline static int32_t get_offset_of__methodBase_3() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____methodBase_3)); }
inline MethodBase_t * get__methodBase_3() const { return ____methodBase_3; }
inline MethodBase_t ** get_address_of__methodBase_3() { return &____methodBase_3; }
inline void set__methodBase_3(MethodBase_t * value)
{
____methodBase_3 = value;
Il2CppCodeGenWriteBarrier((&____methodBase_3), value);
}
inline static int32_t get_offset_of__returnValue_4() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____returnValue_4)); }
inline RuntimeObject * get__returnValue_4() const { return ____returnValue_4; }
inline RuntimeObject ** get_address_of__returnValue_4() { return &____returnValue_4; }
inline void set__returnValue_4(RuntimeObject * value)
{
____returnValue_4 = value;
Il2CppCodeGenWriteBarrier((&____returnValue_4), value);
}
inline static int32_t get_offset_of__exception_5() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____exception_5)); }
inline Exception_t * get__exception_5() const { return ____exception_5; }
inline Exception_t ** get_address_of__exception_5() { return &____exception_5; }
inline void set__exception_5(Exception_t * value)
{
____exception_5 = value;
Il2CppCodeGenWriteBarrier((&____exception_5), value);
}
inline static int32_t get_offset_of__methodSignature_6() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____methodSignature_6)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get__methodSignature_6() const { return ____methodSignature_6; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of__methodSignature_6() { return &____methodSignature_6; }
inline void set__methodSignature_6(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
____methodSignature_6 = value;
Il2CppCodeGenWriteBarrier((&____methodSignature_6), value);
}
inline static int32_t get_offset_of__inArgInfo_7() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____inArgInfo_7)); }
inline ArgInfo_t67419B6DE53980148631C33DF785307579134942 * get__inArgInfo_7() const { return ____inArgInfo_7; }
inline ArgInfo_t67419B6DE53980148631C33DF785307579134942 ** get_address_of__inArgInfo_7() { return &____inArgInfo_7; }
inline void set__inArgInfo_7(ArgInfo_t67419B6DE53980148631C33DF785307579134942 * value)
{
____inArgInfo_7 = value;
Il2CppCodeGenWriteBarrier((&____inArgInfo_7), value);
}
inline static int32_t get_offset_of__args_8() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____args_8)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__args_8() const { return ____args_8; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__args_8() { return &____args_8; }
inline void set__args_8(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____args_8 = value;
Il2CppCodeGenWriteBarrier((&____args_8), value);
}
inline static int32_t get_offset_of__outArgs_9() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____outArgs_9)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__outArgs_9() const { return ____outArgs_9; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__outArgs_9() { return &____outArgs_9; }
inline void set__outArgs_9(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____outArgs_9 = value;
Il2CppCodeGenWriteBarrier((&____outArgs_9), value);
}
inline static int32_t get_offset_of__callMsg_10() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____callMsg_10)); }
inline RuntimeObject* get__callMsg_10() const { return ____callMsg_10; }
inline RuntimeObject** get_address_of__callMsg_10() { return &____callMsg_10; }
inline void set__callMsg_10(RuntimeObject* value)
{
____callMsg_10 = value;
Il2CppCodeGenWriteBarrier((&____callMsg_10), value);
}
inline static int32_t get_offset_of__callContext_11() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____callContext_11)); }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * get__callContext_11() const { return ____callContext_11; }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E ** get_address_of__callContext_11() { return &____callContext_11; }
inline void set__callContext_11(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * value)
{
____callContext_11 = value;
Il2CppCodeGenWriteBarrier((&____callContext_11), value);
}
inline static int32_t get_offset_of__targetIdentity_12() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ____targetIdentity_12)); }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * get__targetIdentity_12() const { return ____targetIdentity_12; }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 ** get_address_of__targetIdentity_12() { return &____targetIdentity_12; }
inline void set__targetIdentity_12(Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * value)
{
____targetIdentity_12 = value;
Il2CppCodeGenWriteBarrier((&____targetIdentity_12), value);
}
inline static int32_t get_offset_of_ExternalProperties_13() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ___ExternalProperties_13)); }
inline RuntimeObject* get_ExternalProperties_13() const { return ___ExternalProperties_13; }
inline RuntimeObject** get_address_of_ExternalProperties_13() { return &___ExternalProperties_13; }
inline void set_ExternalProperties_13(RuntimeObject* value)
{
___ExternalProperties_13 = value;
Il2CppCodeGenWriteBarrier((&___ExternalProperties_13), value);
}
inline static int32_t get_offset_of_InternalProperties_14() { return static_cast<int32_t>(offsetof(MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907, ___InternalProperties_14)); }
inline RuntimeObject* get_InternalProperties_14() const { return ___InternalProperties_14; }
inline RuntimeObject** get_address_of_InternalProperties_14() { return &___InternalProperties_14; }
inline void set_InternalProperties_14(RuntimeObject* value)
{
___InternalProperties_14 = value;
Il2CppCodeGenWriteBarrier((&___InternalProperties_14), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // METHODRESPONSE_T185820C6B3E7D56E9026084CB2CEF1387151D907_H
#ifndef OBJREFSURROGATE_TE2F801FFAE2DBDE6B44A528F7E537922F3840547_H
#define OBJREFSURROGATE_TE2F801FFAE2DBDE6B44A528F7E537922F3840547_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ObjRefSurrogate
struct ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // OBJREFSURROGATE_TE2F801FFAE2DBDE6B44A528F7E537922F3840547_H
#ifndef REMOTINGSURROGATE_T722F41294C1F4DEA38A993DB43F51AC8CBB494BA_H
#define REMOTINGSURROGATE_T722F41294C1F4DEA38A993DB43F51AC8CBB494BA_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.RemotingSurrogate
struct RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REMOTINGSURROGATE_T722F41294C1F4DEA38A993DB43F51AC8CBB494BA_H
#ifndef REMOTINGSURROGATESELECTOR_TEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_H
#define REMOTINGSURROGATESELECTOR_TEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
struct RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44 : public RuntimeObject
{
public:
// System.Runtime.Serialization.ISurrogateSelector System.Runtime.Remoting.Messaging.RemotingSurrogateSelector::_next
RuntimeObject* ____next_3;
public:
inline static int32_t get_offset_of__next_3() { return static_cast<int32_t>(offsetof(RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44, ____next_3)); }
inline RuntimeObject* get__next_3() const { return ____next_3; }
inline RuntimeObject** get_address_of__next_3() { return &____next_3; }
inline void set__next_3(RuntimeObject* value)
{
____next_3 = value;
Il2CppCodeGenWriteBarrier((&____next_3), value);
}
};
struct RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields
{
public:
// System.Type System.Runtime.Remoting.Messaging.RemotingSurrogateSelector::s_cachedTypeObjRef
Type_t * ___s_cachedTypeObjRef_0;
// System.Runtime.Remoting.Messaging.ObjRefSurrogate System.Runtime.Remoting.Messaging.RemotingSurrogateSelector::_objRefSurrogate
ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547 * ____objRefSurrogate_1;
// System.Runtime.Remoting.Messaging.RemotingSurrogate System.Runtime.Remoting.Messaging.RemotingSurrogateSelector::_objRemotingSurrogate
RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA * ____objRemotingSurrogate_2;
public:
inline static int32_t get_offset_of_s_cachedTypeObjRef_0() { return static_cast<int32_t>(offsetof(RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields, ___s_cachedTypeObjRef_0)); }
inline Type_t * get_s_cachedTypeObjRef_0() const { return ___s_cachedTypeObjRef_0; }
inline Type_t ** get_address_of_s_cachedTypeObjRef_0() { return &___s_cachedTypeObjRef_0; }
inline void set_s_cachedTypeObjRef_0(Type_t * value)
{
___s_cachedTypeObjRef_0 = value;
Il2CppCodeGenWriteBarrier((&___s_cachedTypeObjRef_0), value);
}
inline static int32_t get_offset_of__objRefSurrogate_1() { return static_cast<int32_t>(offsetof(RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields, ____objRefSurrogate_1)); }
inline ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547 * get__objRefSurrogate_1() const { return ____objRefSurrogate_1; }
inline ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547 ** get_address_of__objRefSurrogate_1() { return &____objRefSurrogate_1; }
inline void set__objRefSurrogate_1(ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547 * value)
{
____objRefSurrogate_1 = value;
Il2CppCodeGenWriteBarrier((&____objRefSurrogate_1), value);
}
inline static int32_t get_offset_of__objRemotingSurrogate_2() { return static_cast<int32_t>(offsetof(RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields, ____objRemotingSurrogate_2)); }
inline RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA * get__objRemotingSurrogate_2() const { return ____objRemotingSurrogate_2; }
inline RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA ** get_address_of__objRemotingSurrogate_2() { return &____objRemotingSurrogate_2; }
inline void set__objRemotingSurrogate_2(RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA * value)
{
____objRemotingSurrogate_2 = value;
Il2CppCodeGenWriteBarrier((&____objRemotingSurrogate_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REMOTINGSURROGATESELECTOR_TEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_H
#ifndef RETURNMESSAGE_TCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03_H
#define RETURNMESSAGE_TCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ReturnMessage
struct ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03 : public RuntimeObject
{
public:
// System.Object[] System.Runtime.Remoting.Messaging.ReturnMessage::_outArgs
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____outArgs_0;
// System.Object[] System.Runtime.Remoting.Messaging.ReturnMessage::_args
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____args_1;
// System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.ReturnMessage::_callCtx
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ____callCtx_2;
// System.Object System.Runtime.Remoting.Messaging.ReturnMessage::_returnValue
RuntimeObject * ____returnValue_3;
// System.String System.Runtime.Remoting.Messaging.ReturnMessage::_uri
String_t* ____uri_4;
// System.Exception System.Runtime.Remoting.Messaging.ReturnMessage::_exception
Exception_t * ____exception_5;
// System.Reflection.MethodBase System.Runtime.Remoting.Messaging.ReturnMessage::_methodBase
MethodBase_t * ____methodBase_6;
// System.String System.Runtime.Remoting.Messaging.ReturnMessage::_methodName
String_t* ____methodName_7;
// System.Type[] System.Runtime.Remoting.Messaging.ReturnMessage::_methodSignature
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ____methodSignature_8;
// System.String System.Runtime.Remoting.Messaging.ReturnMessage::_typeName
String_t* ____typeName_9;
// System.Runtime.Remoting.Messaging.MethodReturnDictionary System.Runtime.Remoting.Messaging.ReturnMessage::_properties
MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48 * ____properties_10;
// System.Runtime.Remoting.Identity System.Runtime.Remoting.Messaging.ReturnMessage::_targetIdentity
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ____targetIdentity_11;
// System.Runtime.Remoting.Messaging.ArgInfo System.Runtime.Remoting.Messaging.ReturnMessage::_inArgInfo
ArgInfo_t67419B6DE53980148631C33DF785307579134942 * ____inArgInfo_12;
public:
inline static int32_t get_offset_of__outArgs_0() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____outArgs_0)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__outArgs_0() const { return ____outArgs_0; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__outArgs_0() { return &____outArgs_0; }
inline void set__outArgs_0(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____outArgs_0 = value;
Il2CppCodeGenWriteBarrier((&____outArgs_0), value);
}
inline static int32_t get_offset_of__args_1() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____args_1)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__args_1() const { return ____args_1; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__args_1() { return &____args_1; }
inline void set__args_1(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____args_1 = value;
Il2CppCodeGenWriteBarrier((&____args_1), value);
}
inline static int32_t get_offset_of__callCtx_2() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____callCtx_2)); }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * get__callCtx_2() const { return ____callCtx_2; }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E ** get_address_of__callCtx_2() { return &____callCtx_2; }
inline void set__callCtx_2(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * value)
{
____callCtx_2 = value;
Il2CppCodeGenWriteBarrier((&____callCtx_2), value);
}
inline static int32_t get_offset_of__returnValue_3() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____returnValue_3)); }
inline RuntimeObject * get__returnValue_3() const { return ____returnValue_3; }
inline RuntimeObject ** get_address_of__returnValue_3() { return &____returnValue_3; }
inline void set__returnValue_3(RuntimeObject * value)
{
____returnValue_3 = value;
Il2CppCodeGenWriteBarrier((&____returnValue_3), value);
}
inline static int32_t get_offset_of__uri_4() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____uri_4)); }
inline String_t* get__uri_4() const { return ____uri_4; }
inline String_t** get_address_of__uri_4() { return &____uri_4; }
inline void set__uri_4(String_t* value)
{
____uri_4 = value;
Il2CppCodeGenWriteBarrier((&____uri_4), value);
}
inline static int32_t get_offset_of__exception_5() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____exception_5)); }
inline Exception_t * get__exception_5() const { return ____exception_5; }
inline Exception_t ** get_address_of__exception_5() { return &____exception_5; }
inline void set__exception_5(Exception_t * value)
{
____exception_5 = value;
Il2CppCodeGenWriteBarrier((&____exception_5), value);
}
inline static int32_t get_offset_of__methodBase_6() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____methodBase_6)); }
inline MethodBase_t * get__methodBase_6() const { return ____methodBase_6; }
inline MethodBase_t ** get_address_of__methodBase_6() { return &____methodBase_6; }
inline void set__methodBase_6(MethodBase_t * value)
{
____methodBase_6 = value;
Il2CppCodeGenWriteBarrier((&____methodBase_6), value);
}
inline static int32_t get_offset_of__methodName_7() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____methodName_7)); }
inline String_t* get__methodName_7() const { return ____methodName_7; }
inline String_t** get_address_of__methodName_7() { return &____methodName_7; }
inline void set__methodName_7(String_t* value)
{
____methodName_7 = value;
Il2CppCodeGenWriteBarrier((&____methodName_7), value);
}
inline static int32_t get_offset_of__methodSignature_8() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____methodSignature_8)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get__methodSignature_8() const { return ____methodSignature_8; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of__methodSignature_8() { return &____methodSignature_8; }
inline void set__methodSignature_8(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
____methodSignature_8 = value;
Il2CppCodeGenWriteBarrier((&____methodSignature_8), value);
}
inline static int32_t get_offset_of__typeName_9() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____typeName_9)); }
inline String_t* get__typeName_9() const { return ____typeName_9; }
inline String_t** get_address_of__typeName_9() { return &____typeName_9; }
inline void set__typeName_9(String_t* value)
{
____typeName_9 = value;
Il2CppCodeGenWriteBarrier((&____typeName_9), value);
}
inline static int32_t get_offset_of__properties_10() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____properties_10)); }
inline MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48 * get__properties_10() const { return ____properties_10; }
inline MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48 ** get_address_of__properties_10() { return &____properties_10; }
inline void set__properties_10(MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48 * value)
{
____properties_10 = value;
Il2CppCodeGenWriteBarrier((&____properties_10), value);
}
inline static int32_t get_offset_of__targetIdentity_11() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____targetIdentity_11)); }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * get__targetIdentity_11() const { return ____targetIdentity_11; }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 ** get_address_of__targetIdentity_11() { return &____targetIdentity_11; }
inline void set__targetIdentity_11(Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * value)
{
____targetIdentity_11 = value;
Il2CppCodeGenWriteBarrier((&____targetIdentity_11), value);
}
inline static int32_t get_offset_of__inArgInfo_12() { return static_cast<int32_t>(offsetof(ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03, ____inArgInfo_12)); }
inline ArgInfo_t67419B6DE53980148631C33DF785307579134942 * get__inArgInfo_12() const { return ____inArgInfo_12; }
inline ArgInfo_t67419B6DE53980148631C33DF785307579134942 ** get_address_of__inArgInfo_12() { return &____inArgInfo_12; }
inline void set__inArgInfo_12(ArgInfo_t67419B6DE53980148631C33DF785307579134942 * value)
{
____inArgInfo_12 = value;
Il2CppCodeGenWriteBarrier((&____inArgInfo_12), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RETURNMESSAGE_TCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03_H
#ifndef SERVERCONTEXTTERMINATORSINK_T11FA44A0CACACA4A89B73434FB6D685479C6B8E0_H
#define SERVERCONTEXTTERMINATORSINK_T11FA44A0CACACA4A89B73434FB6D685479C6B8E0_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ServerContextTerminatorSink
struct ServerContextTerminatorSink_t11FA44A0CACACA4A89B73434FB6D685479C6B8E0 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SERVERCONTEXTTERMINATORSINK_T11FA44A0CACACA4A89B73434FB6D685479C6B8E0_H
#ifndef SERVEROBJECTREPLYSINK_TE1CEF247A2AC5DFD53842706CFE097CE9556CCB8_H
#define SERVEROBJECTREPLYSINK_TE1CEF247A2AC5DFD53842706CFE097CE9556CCB8_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ServerObjectReplySink
struct ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8 : public RuntimeObject
{
public:
// System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Messaging.ServerObjectReplySink::_replySink
RuntimeObject* ____replySink_0;
// System.Runtime.Remoting.ServerIdentity System.Runtime.Remoting.Messaging.ServerObjectReplySink::_identity
ServerIdentity_t93C5C5C4D608C5E714F0C5061B9BFC17B3B567D2 * ____identity_1;
public:
inline static int32_t get_offset_of__replySink_0() { return static_cast<int32_t>(offsetof(ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8, ____replySink_0)); }
inline RuntimeObject* get__replySink_0() const { return ____replySink_0; }
inline RuntimeObject** get_address_of__replySink_0() { return &____replySink_0; }
inline void set__replySink_0(RuntimeObject* value)
{
____replySink_0 = value;
Il2CppCodeGenWriteBarrier((&____replySink_0), value);
}
inline static int32_t get_offset_of__identity_1() { return static_cast<int32_t>(offsetof(ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8, ____identity_1)); }
inline ServerIdentity_t93C5C5C4D608C5E714F0C5061B9BFC17B3B567D2 * get__identity_1() const { return ____identity_1; }
inline ServerIdentity_t93C5C5C4D608C5E714F0C5061B9BFC17B3B567D2 ** get_address_of__identity_1() { return &____identity_1; }
inline void set__identity_1(ServerIdentity_t93C5C5C4D608C5E714F0C5061B9BFC17B3B567D2 * value)
{
____identity_1 = value;
Il2CppCodeGenWriteBarrier((&____identity_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SERVEROBJECTREPLYSINK_TE1CEF247A2AC5DFD53842706CFE097CE9556CCB8_H
#ifndef SERVEROBJECTTERMINATORSINK_T635122FE05BCEDE34F4B07AA9590AD77509752FD_H
#define SERVEROBJECTTERMINATORSINK_T635122FE05BCEDE34F4B07AA9590AD77509752FD_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink
struct ServerObjectTerminatorSink_t635122FE05BCEDE34F4B07AA9590AD77509752FD : public RuntimeObject
{
public:
// System.Runtime.Remoting.Messaging.IMessageSink System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink::_nextSink
RuntimeObject* ____nextSink_0;
public:
inline static int32_t get_offset_of__nextSink_0() { return static_cast<int32_t>(offsetof(ServerObjectTerminatorSink_t635122FE05BCEDE34F4B07AA9590AD77509752FD, ____nextSink_0)); }
inline RuntimeObject* get__nextSink_0() const { return ____nextSink_0; }
inline RuntimeObject** get_address_of__nextSink_0() { return &____nextSink_0; }
inline void set__nextSink_0(RuntimeObject* value)
{
____nextSink_0 = value;
Il2CppCodeGenWriteBarrier((&____nextSink_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SERVEROBJECTTERMINATORSINK_T635122FE05BCEDE34F4B07AA9590AD77509752FD_H
#ifndef STACKBUILDERSINK_T312B8C166D43B3871C33905CA64E57520C479897_H
#define STACKBUILDERSINK_T312B8C166D43B3871C33905CA64E57520C479897_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.StackBuilderSink
struct StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897 : public RuntimeObject
{
public:
// System.MarshalByRefObject System.Runtime.Remoting.Messaging.StackBuilderSink::_target
MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF * ____target_0;
// System.Runtime.Remoting.Proxies.RealProxy System.Runtime.Remoting.Messaging.StackBuilderSink::_rp
RealProxy_t4B0A745F7C99373132CC67FE86D13421411361EF * ____rp_1;
public:
inline static int32_t get_offset_of__target_0() { return static_cast<int32_t>(offsetof(StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897, ____target_0)); }
inline MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF * get__target_0() const { return ____target_0; }
inline MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF ** get_address_of__target_0() { return &____target_0; }
inline void set__target_0(MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF * value)
{
____target_0 = value;
Il2CppCodeGenWriteBarrier((&____target_0), value);
}
inline static int32_t get_offset_of__rp_1() { return static_cast<int32_t>(offsetof(StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897, ____rp_1)); }
inline RealProxy_t4B0A745F7C99373132CC67FE86D13421411361EF * get__rp_1() const { return ____rp_1; }
inline RealProxy_t4B0A745F7C99373132CC67FE86D13421411361EF ** get_address_of__rp_1() { return &____rp_1; }
inline void set__rp_1(RealProxy_t4B0A745F7C99373132CC67FE86D13421411361EF * value)
{
____rp_1 = value;
Il2CppCodeGenWriteBarrier((&____rp_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // STACKBUILDERSINK_T312B8C166D43B3871C33905CA64E57520C479897_H
#ifndef VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#define VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
#endif // VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#ifndef DATETIME_T349B7449FBAAFF4192636E2B7A07694DA9236132_H
#define DATETIME_T349B7449FBAAFF4192636E2B7A07694DA9236132_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTime
struct DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132
{
public:
// System.UInt64 System.DateTime::dateData
uint64_t ___dateData_44;
public:
inline static int32_t get_offset_of_dateData_44() { return static_cast<int32_t>(offsetof(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132, ___dateData_44)); }
inline uint64_t get_dateData_44() const { return ___dateData_44; }
inline uint64_t* get_address_of_dateData_44() { return &___dateData_44; }
inline void set_dateData_44(uint64_t value)
{
___dateData_44 = value;
}
};
struct DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132_StaticFields
{
public:
// System.Int32[] System.DateTime::DaysToMonth365
Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* ___DaysToMonth365_29;
// System.Int32[] System.DateTime::DaysToMonth366
Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* ___DaysToMonth366_30;
// System.DateTime System.DateTime::MinValue
DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 ___MinValue_31;
// System.DateTime System.DateTime::MaxValue
DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 ___MaxValue_32;
public:
inline static int32_t get_offset_of_DaysToMonth365_29() { return static_cast<int32_t>(offsetof(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132_StaticFields, ___DaysToMonth365_29)); }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* get_DaysToMonth365_29() const { return ___DaysToMonth365_29; }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83** get_address_of_DaysToMonth365_29() { return &___DaysToMonth365_29; }
inline void set_DaysToMonth365_29(Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* value)
{
___DaysToMonth365_29 = value;
Il2CppCodeGenWriteBarrier((&___DaysToMonth365_29), value);
}
inline static int32_t get_offset_of_DaysToMonth366_30() { return static_cast<int32_t>(offsetof(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132_StaticFields, ___DaysToMonth366_30)); }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* get_DaysToMonth366_30() const { return ___DaysToMonth366_30; }
inline Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83** get_address_of_DaysToMonth366_30() { return &___DaysToMonth366_30; }
inline void set_DaysToMonth366_30(Int32U5BU5D_t2B9E4FDDDB9F0A00EC0AC631BA2DA915EB1ECF83* value)
{
___DaysToMonth366_30 = value;
Il2CppCodeGenWriteBarrier((&___DaysToMonth366_30), value);
}
inline static int32_t get_offset_of_MinValue_31() { return static_cast<int32_t>(offsetof(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132_StaticFields, ___MinValue_31)); }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 get_MinValue_31() const { return ___MinValue_31; }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 * get_address_of_MinValue_31() { return &___MinValue_31; }
inline void set_MinValue_31(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 value)
{
___MinValue_31 = value;
}
inline static int32_t get_offset_of_MaxValue_32() { return static_cast<int32_t>(offsetof(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132_StaticFields, ___MaxValue_32)); }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 get_MaxValue_32() const { return ___MaxValue_32; }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 * get_address_of_MaxValue_32() { return &___MaxValue_32; }
inline void set_MaxValue_32(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 value)
{
___MaxValue_32 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIME_T349B7449FBAAFF4192636E2B7A07694DA9236132_H
#ifndef DECIMAL_T44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_H
#define DECIMAL_T44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Decimal
struct Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8
{
public:
// System.Int32 System.Decimal::flags
int32_t ___flags_14;
// System.Int32 System.Decimal::hi
int32_t ___hi_15;
// System.Int32 System.Decimal::lo
int32_t ___lo_16;
// System.Int32 System.Decimal::mid
int32_t ___mid_17;
public:
inline static int32_t get_offset_of_flags_14() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8, ___flags_14)); }
inline int32_t get_flags_14() const { return ___flags_14; }
inline int32_t* get_address_of_flags_14() { return &___flags_14; }
inline void set_flags_14(int32_t value)
{
___flags_14 = value;
}
inline static int32_t get_offset_of_hi_15() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8, ___hi_15)); }
inline int32_t get_hi_15() const { return ___hi_15; }
inline int32_t* get_address_of_hi_15() { return &___hi_15; }
inline void set_hi_15(int32_t value)
{
___hi_15 = value;
}
inline static int32_t get_offset_of_lo_16() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8, ___lo_16)); }
inline int32_t get_lo_16() const { return ___lo_16; }
inline int32_t* get_address_of_lo_16() { return &___lo_16; }
inline void set_lo_16(int32_t value)
{
___lo_16 = value;
}
inline static int32_t get_offset_of_mid_17() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8, ___mid_17)); }
inline int32_t get_mid_17() const { return ___mid_17; }
inline int32_t* get_address_of_mid_17() { return &___mid_17; }
inline void set_mid_17(int32_t value)
{
___mid_17 = value;
}
};
struct Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields
{
public:
// System.UInt32[] System.Decimal::Powers10
UInt32U5BU5D_t9AA834AF2940E75BBF8E3F08FF0D20D266DB71CB* ___Powers10_6;
// System.Decimal System.Decimal::Zero
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___Zero_7;
// System.Decimal System.Decimal::One
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___One_8;
// System.Decimal System.Decimal::MinusOne
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___MinusOne_9;
// System.Decimal System.Decimal::MaxValue
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___MaxValue_10;
// System.Decimal System.Decimal::MinValue
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___MinValue_11;
// System.Decimal System.Decimal::NearNegativeZero
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___NearNegativeZero_12;
// System.Decimal System.Decimal::NearPositiveZero
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___NearPositiveZero_13;
public:
inline static int32_t get_offset_of_Powers10_6() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___Powers10_6)); }
inline UInt32U5BU5D_t9AA834AF2940E75BBF8E3F08FF0D20D266DB71CB* get_Powers10_6() const { return ___Powers10_6; }
inline UInt32U5BU5D_t9AA834AF2940E75BBF8E3F08FF0D20D266DB71CB** get_address_of_Powers10_6() { return &___Powers10_6; }
inline void set_Powers10_6(UInt32U5BU5D_t9AA834AF2940E75BBF8E3F08FF0D20D266DB71CB* value)
{
___Powers10_6 = value;
Il2CppCodeGenWriteBarrier((&___Powers10_6), value);
}
inline static int32_t get_offset_of_Zero_7() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___Zero_7)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_Zero_7() const { return ___Zero_7; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_Zero_7() { return &___Zero_7; }
inline void set_Zero_7(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___Zero_7 = value;
}
inline static int32_t get_offset_of_One_8() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___One_8)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_One_8() const { return ___One_8; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_One_8() { return &___One_8; }
inline void set_One_8(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___One_8 = value;
}
inline static int32_t get_offset_of_MinusOne_9() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___MinusOne_9)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_MinusOne_9() const { return ___MinusOne_9; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_MinusOne_9() { return &___MinusOne_9; }
inline void set_MinusOne_9(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___MinusOne_9 = value;
}
inline static int32_t get_offset_of_MaxValue_10() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___MaxValue_10)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_MaxValue_10() const { return ___MaxValue_10; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_MaxValue_10() { return &___MaxValue_10; }
inline void set_MaxValue_10(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___MaxValue_10 = value;
}
inline static int32_t get_offset_of_MinValue_11() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___MinValue_11)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_MinValue_11() const { return ___MinValue_11; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_MinValue_11() { return &___MinValue_11; }
inline void set_MinValue_11(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___MinValue_11 = value;
}
inline static int32_t get_offset_of_NearNegativeZero_12() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___NearNegativeZero_12)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_NearNegativeZero_12() const { return ___NearNegativeZero_12; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_NearNegativeZero_12() { return &___NearNegativeZero_12; }
inline void set_NearNegativeZero_12(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___NearNegativeZero_12 = value;
}
inline static int32_t get_offset_of_NearPositiveZero_13() { return static_cast<int32_t>(offsetof(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_StaticFields, ___NearPositiveZero_13)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_NearPositiveZero_13() const { return ___NearPositiveZero_13; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_NearPositiveZero_13() { return &___NearPositiveZero_13; }
inline void set_NearPositiveZero_13(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___NearPositiveZero_13 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DECIMAL_T44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8_H
#ifndef ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#define ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF
{
public:
public:
};
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((&___enumSeperatorCharArray_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com
{
};
#endif // ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#ifndef INTPTR_T_H
#define INTPTR_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTPTR_T_H
#ifndef ASYNCMETHODBUILDERCORE_T4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_H
#define ASYNCMETHODBUILDERCORE_T4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01
{
public:
// System.Runtime.CompilerServices.IAsyncStateMachine System.Runtime.CompilerServices.AsyncMethodBuilderCore::m_stateMachine
RuntimeObject* ___m_stateMachine_0;
// System.Action System.Runtime.CompilerServices.AsyncMethodBuilderCore::m_defaultContextAction
Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * ___m_defaultContextAction_1;
public:
inline static int32_t get_offset_of_m_stateMachine_0() { return static_cast<int32_t>(offsetof(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01, ___m_stateMachine_0)); }
inline RuntimeObject* get_m_stateMachine_0() const { return ___m_stateMachine_0; }
inline RuntimeObject** get_address_of_m_stateMachine_0() { return &___m_stateMachine_0; }
inline void set_m_stateMachine_0(RuntimeObject* value)
{
___m_stateMachine_0 = value;
Il2CppCodeGenWriteBarrier((&___m_stateMachine_0), value);
}
inline static int32_t get_offset_of_m_defaultContextAction_1() { return static_cast<int32_t>(offsetof(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01, ___m_defaultContextAction_1)); }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * get_m_defaultContextAction_1() const { return ___m_defaultContextAction_1; }
inline Action_t591D2A86165F896B4B800BB5C25CE18672A55579 ** get_address_of_m_defaultContextAction_1() { return &___m_defaultContextAction_1; }
inline void set_m_defaultContextAction_1(Action_t591D2A86165F896B4B800BB5C25CE18672A55579 * value)
{
___m_defaultContextAction_1 = value;
Il2CppCodeGenWriteBarrier((&___m_defaultContextAction_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_marshaled_pinvoke
{
RuntimeObject* ___m_stateMachine_0;
Il2CppMethodPointer ___m_defaultContextAction_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.AsyncMethodBuilderCore
struct AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_marshaled_com
{
RuntimeObject* ___m_stateMachine_0;
Il2CppMethodPointer ___m_defaultContextAction_1;
};
#endif // ASYNCMETHODBUILDERCORE_T4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01_H
#ifndef COMPILATIONRELAXATIONSATTRIBUTE_T0067C359924196418CFB0DE4C07C5F4C4BCD54FF_H
#define COMPILATIONRELAXATIONSATTRIBUTE_T0067C359924196418CFB0DE4C07C5F4C4BCD54FF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.CompilationRelaxationsAttribute
struct CompilationRelaxationsAttribute_t0067C359924196418CFB0DE4C07C5F4C4BCD54FF : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Int32 System.Runtime.CompilerServices.CompilationRelaxationsAttribute::m_relaxations
int32_t ___m_relaxations_0;
public:
inline static int32_t get_offset_of_m_relaxations_0() { return static_cast<int32_t>(offsetof(CompilationRelaxationsAttribute_t0067C359924196418CFB0DE4C07C5F4C4BCD54FF, ___m_relaxations_0)); }
inline int32_t get_m_relaxations_0() const { return ___m_relaxations_0; }
inline int32_t* get_address_of_m_relaxations_0() { return &___m_relaxations_0; }
inline void set_m_relaxations_0(int32_t value)
{
___m_relaxations_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPILATIONRELAXATIONSATTRIBUTE_T0067C359924196418CFB0DE4C07C5F4C4BCD54FF_H
#ifndef COMPILERGENERATEDATTRIBUTE_T29C03D4EB4F2193B5BF85D03923EA47423C946FC_H
#define COMPILERGENERATEDATTRIBUTE_T29C03D4EB4F2193B5BF85D03923EA47423C946FC_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.CompilerGeneratedAttribute
struct CompilerGeneratedAttribute_t29C03D4EB4F2193B5BF85D03923EA47423C946FC : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPILERGENERATEDATTRIBUTE_T29C03D4EB4F2193B5BF85D03923EA47423C946FC_H
#ifndef CONFIGUREDTASKAWAITER_TF1AAA16B8A1250CA037E32157A3424CD2BA47874_H
#define CONFIGUREDTASKAWAITER_TF1AAA16B8A1250CA037E32157A3424CD2BA47874_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874
{
public:
// System.Threading.Tasks.Task System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter::m_task
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
// System.Boolean System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter::m_continueOnCapturedContext
bool ___m_continueOnCapturedContext_1;
public:
inline static int32_t get_offset_of_m_task_0() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874, ___m_task_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_task_0() const { return ___m_task_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_task_0() { return &___m_task_0; }
inline void set_m_task_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_task_0 = value;
Il2CppCodeGenWriteBarrier((&___m_task_0), value);
}
inline static int32_t get_offset_of_m_continueOnCapturedContext_1() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874, ___m_continueOnCapturedContext_1)); }
inline bool get_m_continueOnCapturedContext_1() const { return ___m_continueOnCapturedContext_1; }
inline bool* get_address_of_m_continueOnCapturedContext_1() { return &___m_continueOnCapturedContext_1; }
inline void set_m_continueOnCapturedContext_1(bool value)
{
___m_continueOnCapturedContext_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_pinvoke
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
int32_t ___m_continueOnCapturedContext_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter
struct ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_com
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
int32_t ___m_continueOnCapturedContext_1;
};
#endif // CONFIGUREDTASKAWAITER_TF1AAA16B8A1250CA037E32157A3424CD2BA47874_H
#ifndef CUSTOMCONSTANTATTRIBUTE_TBAC64D25BCB4BE5CAC32AC430CA8BEF070923191_H
#define CUSTOMCONSTANTATTRIBUTE_TBAC64D25BCB4BE5CAC32AC430CA8BEF070923191_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.CustomConstantAttribute
struct CustomConstantAttribute_tBAC64D25BCB4BE5CAC32AC430CA8BEF070923191 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CUSTOMCONSTANTATTRIBUTE_TBAC64D25BCB4BE5CAC32AC430CA8BEF070923191_H
#ifndef EXTENSIONATTRIBUTE_T34A17741DB6F2A390F30532BD50B269ECDB8F124_H
#define EXTENSIONATTRIBUTE_T34A17741DB6F2A390F30532BD50B269ECDB8F124_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.ExtensionAttribute
struct ExtensionAttribute_t34A17741DB6F2A390F30532BD50B269ECDB8F124 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXTENSIONATTRIBUTE_T34A17741DB6F2A390F30532BD50B269ECDB8F124_H
#ifndef FIXEDBUFFERATTRIBUTE_TF3065E17C7BDDEAEDC5D80CED0509DB83C558743_H
#define FIXEDBUFFERATTRIBUTE_TF3065E17C7BDDEAEDC5D80CED0509DB83C558743_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.FixedBufferAttribute
struct FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Type System.Runtime.CompilerServices.FixedBufferAttribute::elementType
Type_t * ___elementType_0;
// System.Int32 System.Runtime.CompilerServices.FixedBufferAttribute::length
int32_t ___length_1;
public:
inline static int32_t get_offset_of_elementType_0() { return static_cast<int32_t>(offsetof(FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743, ___elementType_0)); }
inline Type_t * get_elementType_0() const { return ___elementType_0; }
inline Type_t ** get_address_of_elementType_0() { return &___elementType_0; }
inline void set_elementType_0(Type_t * value)
{
___elementType_0 = value;
Il2CppCodeGenWriteBarrier((&___elementType_0), value);
}
inline static int32_t get_offset_of_length_1() { return static_cast<int32_t>(offsetof(FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743, ___length_1)); }
inline int32_t get_length_1() const { return ___length_1; }
inline int32_t* get_address_of_length_1() { return &___length_1; }
inline void set_length_1(int32_t value)
{
___length_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FIXEDBUFFERATTRIBUTE_TF3065E17C7BDDEAEDC5D80CED0509DB83C558743_H
#ifndef FRIENDACCESSALLOWEDATTRIBUTE_T7924C8657D64E9FCB405FD7457DDF6EFA131BE96_H
#define FRIENDACCESSALLOWEDATTRIBUTE_T7924C8657D64E9FCB405FD7457DDF6EFA131BE96_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.FriendAccessAllowedAttribute
struct FriendAccessAllowedAttribute_t7924C8657D64E9FCB405FD7457DDF6EFA131BE96 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FRIENDACCESSALLOWEDATTRIBUTE_T7924C8657D64E9FCB405FD7457DDF6EFA131BE96_H
#ifndef INTERNALSVISIBLETOATTRIBUTE_T3AEE3C8B7B894E54091E79A5A1C570B6DBB82767_H
#define INTERNALSVISIBLETOATTRIBUTE_T3AEE3C8B7B894E54091E79A5A1C570B6DBB82767_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.InternalsVisibleToAttribute
struct InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.String System.Runtime.CompilerServices.InternalsVisibleToAttribute::_assemblyName
String_t* ____assemblyName_0;
// System.Boolean System.Runtime.CompilerServices.InternalsVisibleToAttribute::_allInternalsVisible
bool ____allInternalsVisible_1;
public:
inline static int32_t get_offset_of__assemblyName_0() { return static_cast<int32_t>(offsetof(InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767, ____assemblyName_0)); }
inline String_t* get__assemblyName_0() const { return ____assemblyName_0; }
inline String_t** get_address_of__assemblyName_0() { return &____assemblyName_0; }
inline void set__assemblyName_0(String_t* value)
{
____assemblyName_0 = value;
Il2CppCodeGenWriteBarrier((&____assemblyName_0), value);
}
inline static int32_t get_offset_of__allInternalsVisible_1() { return static_cast<int32_t>(offsetof(InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767, ____allInternalsVisible_1)); }
inline bool get__allInternalsVisible_1() const { return ____allInternalsVisible_1; }
inline bool* get_address_of__allInternalsVisible_1() { return &____allInternalsVisible_1; }
inline void set__allInternalsVisible_1(bool value)
{
____allInternalsVisible_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTERNALSVISIBLETOATTRIBUTE_T3AEE3C8B7B894E54091E79A5A1C570B6DBB82767_H
#ifndef RUNTIMECOMPATIBILITYATTRIBUTE_TF386C60D3DD4A0E1759F1D8F76841FC4522A6126_H
#define RUNTIMECOMPATIBILITYATTRIBUTE_TF386C60D3DD4A0E1759F1D8F76841FC4522A6126_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
struct RuntimeCompatibilityAttribute_tF386C60D3DD4A0E1759F1D8F76841FC4522A6126 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Boolean System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::m_wrapNonExceptionThrows
bool ___m_wrapNonExceptionThrows_0;
public:
inline static int32_t get_offset_of_m_wrapNonExceptionThrows_0() { return static_cast<int32_t>(offsetof(RuntimeCompatibilityAttribute_tF386C60D3DD4A0E1759F1D8F76841FC4522A6126, ___m_wrapNonExceptionThrows_0)); }
inline bool get_m_wrapNonExceptionThrows_0() const { return ___m_wrapNonExceptionThrows_0; }
inline bool* get_address_of_m_wrapNonExceptionThrows_0() { return &___m_wrapNonExceptionThrows_0; }
inline void set_m_wrapNonExceptionThrows_0(bool value)
{
___m_wrapNonExceptionThrows_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMECOMPATIBILITYATTRIBUTE_TF386C60D3DD4A0E1759F1D8F76841FC4522A6126_H
#ifndef RUNTIMEWRAPPEDEXCEPTION_T5E7538D9FD99A8A0FB32B396776E294A29866C0D_H
#define RUNTIMEWRAPPEDEXCEPTION_T5E7538D9FD99A8A0FB32B396776E294A29866C0D_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.RuntimeWrappedException
struct RuntimeWrappedException_t5E7538D9FD99A8A0FB32B396776E294A29866C0D : public Exception_t
{
public:
// System.Object System.Runtime.CompilerServices.RuntimeWrappedException::m_wrappedException
RuntimeObject * ___m_wrappedException_17;
public:
inline static int32_t get_offset_of_m_wrappedException_17() { return static_cast<int32_t>(offsetof(RuntimeWrappedException_t5E7538D9FD99A8A0FB32B396776E294A29866C0D, ___m_wrappedException_17)); }
inline RuntimeObject * get_m_wrappedException_17() const { return ___m_wrappedException_17; }
inline RuntimeObject ** get_address_of_m_wrappedException_17() { return &___m_wrappedException_17; }
inline void set_m_wrappedException_17(RuntimeObject * value)
{
___m_wrappedException_17 = value;
Il2CppCodeGenWriteBarrier((&___m_wrappedException_17), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMEWRAPPEDEXCEPTION_T5E7538D9FD99A8A0FB32B396776E294A29866C0D_H
#ifndef STATEMACHINEATTRIBUTE_T0F08DD69D5AB4A30C6A13E245143DD5335A4DA93_H
#define STATEMACHINEATTRIBUTE_T0F08DD69D5AB4A30C6A13E245143DD5335A4DA93_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.StateMachineAttribute
struct StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Type System.Runtime.CompilerServices.StateMachineAttribute::<StateMachineType>k__BackingField
Type_t * ___U3CStateMachineTypeU3Ek__BackingField_0;
public:
inline static int32_t get_offset_of_U3CStateMachineTypeU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93, ___U3CStateMachineTypeU3Ek__BackingField_0)); }
inline Type_t * get_U3CStateMachineTypeU3Ek__BackingField_0() const { return ___U3CStateMachineTypeU3Ek__BackingField_0; }
inline Type_t ** get_address_of_U3CStateMachineTypeU3Ek__BackingField_0() { return &___U3CStateMachineTypeU3Ek__BackingField_0; }
inline void set_U3CStateMachineTypeU3Ek__BackingField_0(Type_t * value)
{
___U3CStateMachineTypeU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((&___U3CStateMachineTypeU3Ek__BackingField_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // STATEMACHINEATTRIBUTE_T0F08DD69D5AB4A30C6A13E245143DD5335A4DA93_H
#ifndef TASKAWAITER_T0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_H
#define TASKAWAITER_T0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F
{
public:
// System.Threading.Tasks.Task System.Runtime.CompilerServices.TaskAwaiter::m_task
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
public:
inline static int32_t get_offset_of_m_task_0() { return static_cast<int32_t>(offsetof(TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F, ___m_task_0)); }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * get_m_task_0() const { return ___m_task_0; }
inline Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 ** get_address_of_m_task_0() { return &___m_task_0; }
inline void set_m_task_0(Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * value)
{
___m_task_0 = value;
Il2CppCodeGenWriteBarrier((&___m_task_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_marshaled_pinvoke
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.TaskAwaiter
struct TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_marshaled_com
{
Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * ___m_task_0;
};
#endif // TASKAWAITER_T0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F_H
#ifndef TUPLEELEMENTNAMESATTRIBUTE_T9DA57F2C0033062D34728E524F7A057A0BDF6CEB_H
#define TUPLEELEMENTNAMESATTRIBUTE_T9DA57F2C0033062D34728E524F7A057A0BDF6CEB_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.TupleElementNamesAttribute
struct TupleElementNamesAttribute_t9DA57F2C0033062D34728E524F7A057A0BDF6CEB : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.String[] System.Runtime.CompilerServices.TupleElementNamesAttribute::_transformNames
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ____transformNames_0;
public:
inline static int32_t get_offset_of__transformNames_0() { return static_cast<int32_t>(offsetof(TupleElementNamesAttribute_t9DA57F2C0033062D34728E524F7A057A0BDF6CEB, ____transformNames_0)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get__transformNames_0() const { return ____transformNames_0; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of__transformNames_0() { return &____transformNames_0; }
inline void set__transformNames_0(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
____transformNames_0 = value;
Il2CppCodeGenWriteBarrier((&____transformNames_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TUPLEELEMENTNAMESATTRIBUTE_T9DA57F2C0033062D34728E524F7A057A0BDF6CEB_H
#ifndef TYPEFORWARDEDFROMATTRIBUTE_TEE8D8DA95C9112F53D8E66EA00F476C923A003E2_H
#define TYPEFORWARDEDFROMATTRIBUTE_TEE8D8DA95C9112F53D8E66EA00F476C923A003E2_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.TypeForwardedFromAttribute
struct TypeForwardedFromAttribute_tEE8D8DA95C9112F53D8E66EA00F476C923A003E2 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.String System.Runtime.CompilerServices.TypeForwardedFromAttribute::assemblyFullName
String_t* ___assemblyFullName_0;
public:
inline static int32_t get_offset_of_assemblyFullName_0() { return static_cast<int32_t>(offsetof(TypeForwardedFromAttribute_tEE8D8DA95C9112F53D8E66EA00F476C923A003E2, ___assemblyFullName_0)); }
inline String_t* get_assemblyFullName_0() const { return ___assemblyFullName_0; }
inline String_t** get_address_of_assemblyFullName_0() { return &___assemblyFullName_0; }
inline void set_assemblyFullName_0(String_t* value)
{
___assemblyFullName_0 = value;
Il2CppCodeGenWriteBarrier((&___assemblyFullName_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TYPEFORWARDEDFROMATTRIBUTE_TEE8D8DA95C9112F53D8E66EA00F476C923A003E2_H
#ifndef FIRSTCHANCEEXCEPTIONEVENTARGS_T0FA7904C9F4BAA2FC640BE3E5AC348F153AD8B6D_H
#define FIRSTCHANCEEXCEPTIONEVENTARGS_T0FA7904C9F4BAA2FC640BE3E5AC348F153AD8B6D_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs
struct FirstChanceExceptionEventArgs_t0FA7904C9F4BAA2FC640BE3E5AC348F153AD8B6D : public EventArgs_t8E6CA180BE0E56674C6407011A94BAF7C757352E
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FIRSTCHANCEEXCEPTIONEVENTARGS_T0FA7904C9F4BAA2FC640BE3E5AC348F153AD8B6D_H
#ifndef HANDLEPROCESSCORRUPTEDSTATEEXCEPTIONSATTRIBUTE_TA72E0974E174E223166E56C7E2B20C319C322260_H
#define HANDLEPROCESSCORRUPTEDSTATEEXCEPTIONSATTRIBUTE_TA72E0974E174E223166E56C7E2B20C319C322260_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute
struct HandleProcessCorruptedStateExceptionsAttribute_tA72E0974E174E223166E56C7E2B20C319C322260 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // HANDLEPROCESSCORRUPTEDSTATEEXCEPTIONSATTRIBUTE_TA72E0974E174E223166E56C7E2B20C319C322260_H
#ifndef REMOTEACTIVATOR_T1882A1F35EE36C9F6A639472386A46AB7E49180A_H
#define REMOTEACTIVATOR_T1882A1F35EE36C9F6A639472386A46AB7E49180A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Activation.RemoteActivator
struct RemoteActivator_t1882A1F35EE36C9F6A639472386A46AB7E49180A : public MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REMOTEACTIVATOR_T1882A1F35EE36C9F6A639472386A46AB7E49180A_H
#ifndef CADMETHODCALLMESSAGE_T7B9A972EAA7214F4072621D30B449A5BADC3BFF8_H
#define CADMETHODCALLMESSAGE_T7B9A972EAA7214F4072621D30B449A5BADC3BFF8_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADMethodCallMessage
struct CADMethodCallMessage_t7B9A972EAA7214F4072621D30B449A5BADC3BFF8 : public CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B
{
public:
// System.String System.Runtime.Remoting.Messaging.CADMethodCallMessage::_uri
String_t* ____uri_5;
public:
inline static int32_t get_offset_of__uri_5() { return static_cast<int32_t>(offsetof(CADMethodCallMessage_t7B9A972EAA7214F4072621D30B449A5BADC3BFF8, ____uri_5)); }
inline String_t* get__uri_5() const { return ____uri_5; }
inline String_t** get_address_of__uri_5() { return &____uri_5; }
inline void set__uri_5(String_t* value)
{
____uri_5 = value;
Il2CppCodeGenWriteBarrier((&____uri_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADMETHODCALLMESSAGE_T7B9A972EAA7214F4072621D30B449A5BADC3BFF8_H
#ifndef CADMETHODRETURNMESSAGE_TC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C_H
#define CADMETHODRETURNMESSAGE_TC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CADMethodReturnMessage
struct CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C : public CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B
{
public:
// System.Object System.Runtime.Remoting.Messaging.CADMethodReturnMessage::_returnValue
RuntimeObject * ____returnValue_5;
// System.Runtime.Remoting.Messaging.CADArgHolder System.Runtime.Remoting.Messaging.CADMethodReturnMessage::_exception
CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * ____exception_6;
// System.Type[] System.Runtime.Remoting.Messaging.CADMethodReturnMessage::_sig
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ____sig_7;
public:
inline static int32_t get_offset_of__returnValue_5() { return static_cast<int32_t>(offsetof(CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C, ____returnValue_5)); }
inline RuntimeObject * get__returnValue_5() const { return ____returnValue_5; }
inline RuntimeObject ** get_address_of__returnValue_5() { return &____returnValue_5; }
inline void set__returnValue_5(RuntimeObject * value)
{
____returnValue_5 = value;
Il2CppCodeGenWriteBarrier((&____returnValue_5), value);
}
inline static int32_t get_offset_of__exception_6() { return static_cast<int32_t>(offsetof(CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C, ____exception_6)); }
inline CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * get__exception_6() const { return ____exception_6; }
inline CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A ** get_address_of__exception_6() { return &____exception_6; }
inline void set__exception_6(CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A * value)
{
____exception_6 = value;
Il2CppCodeGenWriteBarrier((&____exception_6), value);
}
inline static int32_t get_offset_of__sig_7() { return static_cast<int32_t>(offsetof(CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C, ____sig_7)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get__sig_7() const { return ____sig_7; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of__sig_7() { return &____sig_7; }
inline void set__sig_7(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
____sig_7 = value;
Il2CppCodeGenWriteBarrier((&____sig_7), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CADMETHODRETURNMESSAGE_TC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C_H
#ifndef CONSTRUCTIONCALL_T24A620B6D0B83BCF9CF434AD9A5532D0826950AE_H
#define CONSTRUCTIONCALL_T24A620B6D0B83BCF9CF434AD9A5532D0826950AE_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ConstructionCall
struct ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE : public MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA
{
public:
// System.Runtime.Remoting.Activation.IActivator System.Runtime.Remoting.Messaging.ConstructionCall::_activator
RuntimeObject* ____activator_11;
// System.Object[] System.Runtime.Remoting.Messaging.ConstructionCall::_activationAttributes
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ____activationAttributes_12;
// System.Collections.IList System.Runtime.Remoting.Messaging.ConstructionCall::_contextProperties
RuntimeObject* ____contextProperties_13;
// System.Type System.Runtime.Remoting.Messaging.ConstructionCall::_activationType
Type_t * ____activationType_14;
// System.String System.Runtime.Remoting.Messaging.ConstructionCall::_activationTypeName
String_t* ____activationTypeName_15;
// System.Boolean System.Runtime.Remoting.Messaging.ConstructionCall::_isContextOk
bool ____isContextOk_16;
// System.Runtime.Remoting.Proxies.RemotingProxy System.Runtime.Remoting.Messaging.ConstructionCall::_sourceProxy
RemotingProxy_t02A995D835CE746F989867DC6713F084B355A4D9 * ____sourceProxy_17;
public:
inline static int32_t get_offset_of__activator_11() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____activator_11)); }
inline RuntimeObject* get__activator_11() const { return ____activator_11; }
inline RuntimeObject** get_address_of__activator_11() { return &____activator_11; }
inline void set__activator_11(RuntimeObject* value)
{
____activator_11 = value;
Il2CppCodeGenWriteBarrier((&____activator_11), value);
}
inline static int32_t get_offset_of__activationAttributes_12() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____activationAttributes_12)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get__activationAttributes_12() const { return ____activationAttributes_12; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of__activationAttributes_12() { return &____activationAttributes_12; }
inline void set__activationAttributes_12(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
____activationAttributes_12 = value;
Il2CppCodeGenWriteBarrier((&____activationAttributes_12), value);
}
inline static int32_t get_offset_of__contextProperties_13() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____contextProperties_13)); }
inline RuntimeObject* get__contextProperties_13() const { return ____contextProperties_13; }
inline RuntimeObject** get_address_of__contextProperties_13() { return &____contextProperties_13; }
inline void set__contextProperties_13(RuntimeObject* value)
{
____contextProperties_13 = value;
Il2CppCodeGenWriteBarrier((&____contextProperties_13), value);
}
inline static int32_t get_offset_of__activationType_14() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____activationType_14)); }
inline Type_t * get__activationType_14() const { return ____activationType_14; }
inline Type_t ** get_address_of__activationType_14() { return &____activationType_14; }
inline void set__activationType_14(Type_t * value)
{
____activationType_14 = value;
Il2CppCodeGenWriteBarrier((&____activationType_14), value);
}
inline static int32_t get_offset_of__activationTypeName_15() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____activationTypeName_15)); }
inline String_t* get__activationTypeName_15() const { return ____activationTypeName_15; }
inline String_t** get_address_of__activationTypeName_15() { return &____activationTypeName_15; }
inline void set__activationTypeName_15(String_t* value)
{
____activationTypeName_15 = value;
Il2CppCodeGenWriteBarrier((&____activationTypeName_15), value);
}
inline static int32_t get_offset_of__isContextOk_16() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____isContextOk_16)); }
inline bool get__isContextOk_16() const { return ____isContextOk_16; }
inline bool* get_address_of__isContextOk_16() { return &____isContextOk_16; }
inline void set__isContextOk_16(bool value)
{
____isContextOk_16 = value;
}
inline static int32_t get_offset_of__sourceProxy_17() { return static_cast<int32_t>(offsetof(ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE, ____sourceProxy_17)); }
inline RemotingProxy_t02A995D835CE746F989867DC6713F084B355A4D9 * get__sourceProxy_17() const { return ____sourceProxy_17; }
inline RemotingProxy_t02A995D835CE746F989867DC6713F084B355A4D9 ** get_address_of__sourceProxy_17() { return &____sourceProxy_17; }
inline void set__sourceProxy_17(RemotingProxy_t02A995D835CE746F989867DC6713F084B355A4D9 * value)
{
____sourceProxy_17 = value;
Il2CppCodeGenWriteBarrier((&____sourceProxy_17), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSTRUCTIONCALL_T24A620B6D0B83BCF9CF434AD9A5532D0826950AE_H
#ifndef CONSTRUCTIONCALLDICTIONARY_T33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_H
#define CONSTRUCTIONCALLDICTIONARY_T33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ConstructionCallDictionary
struct ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677 : public MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5
{
public:
public:
};
struct ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_StaticFields
{
public:
// System.String[] System.Runtime.Remoting.Messaging.ConstructionCallDictionary::InternalKeys
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___InternalKeys_4;
public:
inline static int32_t get_offset_of_InternalKeys_4() { return static_cast<int32_t>(offsetof(ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_StaticFields, ___InternalKeys_4)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_InternalKeys_4() const { return ___InternalKeys_4; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_InternalKeys_4() { return &___InternalKeys_4; }
inline void set_InternalKeys_4(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___InternalKeys_4 = value;
Il2CppCodeGenWriteBarrier((&___InternalKeys_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSTRUCTIONCALLDICTIONARY_T33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_H
#ifndef CONSTRUCTIONRESPONSE_T772CA297A73A84339329D0FCD37FCDF257A0BAA2_H
#define CONSTRUCTIONRESPONSE_T772CA297A73A84339329D0FCD37FCDF257A0BAA2_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ConstructionResponse
struct ConstructionResponse_t772CA297A73A84339329D0FCD37FCDF257A0BAA2 : public MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSTRUCTIONRESPONSE_T772CA297A73A84339329D0FCD37FCDF257A0BAA2_H
#ifndef READER_T8A0F3818A710941785287CE8D7184C05480C2EA6_H
#define READER_T8A0F3818A710941785287CE8D7184C05480C2EA6_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.LogicalCallContext/Reader
struct Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6
{
public:
// System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.LogicalCallContext/Reader::m_ctx
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___m_ctx_0;
public:
inline static int32_t get_offset_of_m_ctx_0() { return static_cast<int32_t>(offsetof(Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6, ___m_ctx_0)); }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * get_m_ctx_0() const { return ___m_ctx_0; }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E ** get_address_of_m_ctx_0() { return &___m_ctx_0; }
inline void set_m_ctx_0(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * value)
{
___m_ctx_0 = value;
Il2CppCodeGenWriteBarrier((&___m_ctx_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.Remoting.Messaging.LogicalCallContext/Reader
struct Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6_marshaled_pinvoke
{
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___m_ctx_0;
};
// Native definition for COM marshalling of System.Runtime.Remoting.Messaging.LogicalCallContext/Reader
struct Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6_marshaled_com
{
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___m_ctx_0;
};
#endif // READER_T8A0F3818A710941785287CE8D7184C05480C2EA6_H
#ifndef MCMDICTIONARY_TD801081CC84A219F173B4A5A90A53A75A43D5434_H
#define MCMDICTIONARY_TD801081CC84A219F173B4A5A90A53A75A43D5434_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MCMDictionary
struct MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 : public MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5
{
public:
public:
};
struct MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434_StaticFields
{
public:
// System.String[] System.Runtime.Remoting.Messaging.MCMDictionary::InternalKeys
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___InternalKeys_4;
public:
inline static int32_t get_offset_of_InternalKeys_4() { return static_cast<int32_t>(offsetof(MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434_StaticFields, ___InternalKeys_4)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_InternalKeys_4() const { return ___InternalKeys_4; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_InternalKeys_4() { return &___InternalKeys_4; }
inline void set_InternalKeys_4(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___InternalKeys_4 = value;
Il2CppCodeGenWriteBarrier((&___InternalKeys_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MCMDICTIONARY_TD801081CC84A219F173B4A5A90A53A75A43D5434_H
#ifndef METHODRETURNDICTIONARY_TFCD4ADFA43AA2736517130020BBB9E60A253EB48_H
#define METHODRETURNDICTIONARY_TFCD4ADFA43AA2736517130020BBB9E60A253EB48_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MethodReturnDictionary
struct MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48 : public MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5
{
public:
public:
};
struct MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields
{
public:
// System.String[] System.Runtime.Remoting.Messaging.MethodReturnDictionary::InternalReturnKeys
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___InternalReturnKeys_4;
// System.String[] System.Runtime.Remoting.Messaging.MethodReturnDictionary::InternalExceptionKeys
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___InternalExceptionKeys_5;
public:
inline static int32_t get_offset_of_InternalReturnKeys_4() { return static_cast<int32_t>(offsetof(MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields, ___InternalReturnKeys_4)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_InternalReturnKeys_4() const { return ___InternalReturnKeys_4; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_InternalReturnKeys_4() { return &___InternalReturnKeys_4; }
inline void set_InternalReturnKeys_4(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___InternalReturnKeys_4 = value;
Il2CppCodeGenWriteBarrier((&___InternalReturnKeys_4), value);
}
inline static int32_t get_offset_of_InternalExceptionKeys_5() { return static_cast<int32_t>(offsetof(MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields, ___InternalExceptionKeys_5)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_InternalExceptionKeys_5() const { return ___InternalExceptionKeys_5; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_InternalExceptionKeys_5() { return &___InternalExceptionKeys_5; }
inline void set_InternalExceptionKeys_5(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___InternalExceptionKeys_5 = value;
Il2CppCodeGenWriteBarrier((&___InternalExceptionKeys_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // METHODRETURNDICTIONARY_TFCD4ADFA43AA2736517130020BBB9E60A253EB48_H
#ifndef ONEWAYATTRIBUTE_T848DB2BC395D34A01B2932EEC85CEA65CA9C9B43_H
#define ONEWAYATTRIBUTE_T848DB2BC395D34A01B2932EEC85CEA65CA9C9B43_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.OneWayAttribute
struct OneWayAttribute_t848DB2BC395D34A01B2932EEC85CEA65CA9C9B43 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ONEWAYATTRIBUTE_T848DB2BC395D34A01B2932EEC85CEA65CA9C9B43_H
#ifndef SOAPATTRIBUTE_TFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE_H
#define SOAPATTRIBUTE_TFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Metadata.SoapAttribute
struct SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Boolean System.Runtime.Remoting.Metadata.SoapAttribute::_useAttribute
bool ____useAttribute_0;
// System.String System.Runtime.Remoting.Metadata.SoapAttribute::ProtXmlNamespace
String_t* ___ProtXmlNamespace_1;
// System.Object System.Runtime.Remoting.Metadata.SoapAttribute::ReflectInfo
RuntimeObject * ___ReflectInfo_2;
public:
inline static int32_t get_offset_of__useAttribute_0() { return static_cast<int32_t>(offsetof(SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE, ____useAttribute_0)); }
inline bool get__useAttribute_0() const { return ____useAttribute_0; }
inline bool* get_address_of__useAttribute_0() { return &____useAttribute_0; }
inline void set__useAttribute_0(bool value)
{
____useAttribute_0 = value;
}
inline static int32_t get_offset_of_ProtXmlNamespace_1() { return static_cast<int32_t>(offsetof(SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE, ___ProtXmlNamespace_1)); }
inline String_t* get_ProtXmlNamespace_1() const { return ___ProtXmlNamespace_1; }
inline String_t** get_address_of_ProtXmlNamespace_1() { return &___ProtXmlNamespace_1; }
inline void set_ProtXmlNamespace_1(String_t* value)
{
___ProtXmlNamespace_1 = value;
Il2CppCodeGenWriteBarrier((&___ProtXmlNamespace_1), value);
}
inline static int32_t get_offset_of_ReflectInfo_2() { return static_cast<int32_t>(offsetof(SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE, ___ReflectInfo_2)); }
inline RuntimeObject * get_ReflectInfo_2() const { return ___ReflectInfo_2; }
inline RuntimeObject ** get_address_of_ReflectInfo_2() { return &___ReflectInfo_2; }
inline void set_ReflectInfo_2(RuntimeObject * value)
{
___ReflectInfo_2 = value;
Il2CppCodeGenWriteBarrier((&___ReflectInfo_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SOAPATTRIBUTE_TFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE_H
#ifndef DELEGATE_T_H
#define DELEGATE_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Delegate
struct Delegate_t : public RuntimeObject
{
public:
// System.IntPtr System.Delegate::method_ptr
Il2CppMethodPointer ___method_ptr_0;
// System.IntPtr System.Delegate::invoke_impl
intptr_t ___invoke_impl_1;
// System.Object System.Delegate::m_target
RuntimeObject * ___m_target_2;
// System.IntPtr System.Delegate::method
intptr_t ___method_3;
// System.IntPtr System.Delegate::delegate_trampoline
intptr_t ___delegate_trampoline_4;
// System.IntPtr System.Delegate::extra_arg
intptr_t ___extra_arg_5;
// System.IntPtr System.Delegate::method_code
intptr_t ___method_code_6;
// System.Reflection.MethodInfo System.Delegate::method_info
MethodInfo_t * ___method_info_7;
// System.Reflection.MethodInfo System.Delegate::original_method_info
MethodInfo_t * ___original_method_info_8;
// System.DelegateData System.Delegate::data
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
// System.Boolean System.Delegate::method_is_virtual
bool ___method_is_virtual_10;
public:
inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); }
inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; }
inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; }
inline void set_method_ptr_0(Il2CppMethodPointer value)
{
___method_ptr_0 = value;
}
inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); }
inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; }
inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; }
inline void set_invoke_impl_1(intptr_t value)
{
___invoke_impl_1 = value;
}
inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); }
inline RuntimeObject * get_m_target_2() const { return ___m_target_2; }
inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; }
inline void set_m_target_2(RuntimeObject * value)
{
___m_target_2 = value;
Il2CppCodeGenWriteBarrier((&___m_target_2), value);
}
inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); }
inline intptr_t get_method_3() const { return ___method_3; }
inline intptr_t* get_address_of_method_3() { return &___method_3; }
inline void set_method_3(intptr_t value)
{
___method_3 = value;
}
inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); }
inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; }
inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; }
inline void set_delegate_trampoline_4(intptr_t value)
{
___delegate_trampoline_4 = value;
}
inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); }
inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; }
inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; }
inline void set_extra_arg_5(intptr_t value)
{
___extra_arg_5 = value;
}
inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); }
inline intptr_t get_method_code_6() const { return ___method_code_6; }
inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; }
inline void set_method_code_6(intptr_t value)
{
___method_code_6 = value;
}
inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); }
inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; }
inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; }
inline void set_method_info_7(MethodInfo_t * value)
{
___method_info_7 = value;
Il2CppCodeGenWriteBarrier((&___method_info_7), value);
}
inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); }
inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; }
inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; }
inline void set_original_method_info_8(MethodInfo_t * value)
{
___original_method_info_8 = value;
Il2CppCodeGenWriteBarrier((&___original_method_info_8), value);
}
inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value)
{
___data_9 = value;
Il2CppCodeGenWriteBarrier((&___data_9), value);
}
inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); }
inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; }
inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; }
inline void set_method_is_virtual_10(bool value)
{
___method_is_virtual_10 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Delegate
struct Delegate_t_marshaled_pinvoke
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// Native definition for COM marshalling of System.Delegate
struct Delegate_t_marshaled_com
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
#endif // DELEGATE_T_H
#ifndef ASYNCSTATEMACHINEATTRIBUTE_T71790D316286529022E8E3342C82150023358A00_H
#define ASYNCSTATEMACHINEATTRIBUTE_T71790D316286529022E8E3342C82150023358A00_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncStateMachineAttribute
struct AsyncStateMachineAttribute_t71790D316286529022E8E3342C82150023358A00 : public StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ASYNCSTATEMACHINEATTRIBUTE_T71790D316286529022E8E3342C82150023358A00_H
#ifndef ASYNCTASKMETHODBUILDER_1_T66ED1808B26B8081A2804D6A750D13386E360BD9_H
#define ASYNCTASKMETHODBUILDER_1_T66ED1808B26B8081A2804D6A750D13386E360BD9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Threading.Tasks.VoidTaskResult>
struct AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9
{
public:
// System.Runtime.CompilerServices.AsyncMethodBuilderCore System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::m_coreState
AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 ___m_coreState_1;
// System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::m_task
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___m_task_2;
public:
inline static int32_t get_offset_of_m_coreState_1() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9, ___m_coreState_1)); }
inline AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 get_m_coreState_1() const { return ___m_coreState_1; }
inline AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 * get_address_of_m_coreState_1() { return &___m_coreState_1; }
inline void set_m_coreState_1(AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01 value)
{
___m_coreState_1 = value;
}
inline static int32_t get_offset_of_m_task_2() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9, ___m_task_2)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_m_task_2() const { return ___m_task_2; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_m_task_2() { return &___m_task_2; }
inline void set_m_task_2(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___m_task_2 = value;
Il2CppCodeGenWriteBarrier((&___m_task_2), value);
}
};
struct AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9_StaticFields
{
public:
// System.Threading.Tasks.Task`1<TResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::s_defaultResultTask
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___s_defaultResultTask_0;
public:
inline static int32_t get_offset_of_s_defaultResultTask_0() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9_StaticFields, ___s_defaultResultTask_0)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_s_defaultResultTask_0() const { return ___s_defaultResultTask_0; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_s_defaultResultTask_0() { return &___s_defaultResultTask_0; }
inline void set_s_defaultResultTask_0(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___s_defaultResultTask_0 = value;
Il2CppCodeGenWriteBarrier((&___s_defaultResultTask_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ASYNCTASKMETHODBUILDER_1_T66ED1808B26B8081A2804D6A750D13386E360BD9_H
#ifndef COMPILATIONRELAXATIONS_TCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B_H
#define COMPILATIONRELAXATIONS_TCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.CompilationRelaxations
struct CompilationRelaxations_tCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B
{
public:
// System.Int32 System.Runtime.CompilerServices.CompilationRelaxations::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(CompilationRelaxations_tCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPILATIONRELAXATIONS_TCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B_H
#ifndef CONFIGUREDTASKAWAITABLE_T24DE1415466EE20060BE5AD528DC5C812CFA53A9_H
#define CONFIGUREDTASKAWAITABLE_T24DE1415466EE20060BE5AD528DC5C812CFA53A9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9
{
public:
// System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter System.Runtime.CompilerServices.ConfiguredTaskAwaitable::m_configuredTaskAwaiter
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 ___m_configuredTaskAwaiter_0;
public:
inline static int32_t get_offset_of_m_configuredTaskAwaiter_0() { return static_cast<int32_t>(offsetof(ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9, ___m_configuredTaskAwaiter_0)); }
inline ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 get_m_configuredTaskAwaiter_0() const { return ___m_configuredTaskAwaiter_0; }
inline ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 * get_address_of_m_configuredTaskAwaiter_0() { return &___m_configuredTaskAwaiter_0; }
inline void set_m_configuredTaskAwaiter_0(ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874 value)
{
___m_configuredTaskAwaiter_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9_marshaled_pinvoke
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_pinvoke ___m_configuredTaskAwaiter_0;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.ConfiguredTaskAwaitable
struct ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9_marshaled_com
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874_marshaled_com ___m_configuredTaskAwaiter_0;
};
#endif // CONFIGUREDTASKAWAITABLE_T24DE1415466EE20060BE5AD528DC5C812CFA53A9_H
#ifndef DATETIMECONSTANTATTRIBUTE_T4E7414CDD051958BEA1F01140F38441AA442D9BE_H
#define DATETIMECONSTANTATTRIBUTE_T4E7414CDD051958BEA1F01140F38441AA442D9BE_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.DateTimeConstantAttribute
struct DateTimeConstantAttribute_t4E7414CDD051958BEA1F01140F38441AA442D9BE : public CustomConstantAttribute_tBAC64D25BCB4BE5CAC32AC430CA8BEF070923191
{
public:
// System.DateTime System.Runtime.CompilerServices.DateTimeConstantAttribute::date
DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 ___date_0;
public:
inline static int32_t get_offset_of_date_0() { return static_cast<int32_t>(offsetof(DateTimeConstantAttribute_t4E7414CDD051958BEA1F01140F38441AA442D9BE, ___date_0)); }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 get_date_0() const { return ___date_0; }
inline DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 * get_address_of_date_0() { return &___date_0; }
inline void set_date_0(DateTime_t349B7449FBAAFF4192636E2B7A07694DA9236132 value)
{
___date_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIMECONSTANTATTRIBUTE_T4E7414CDD051958BEA1F01140F38441AA442D9BE_H
#ifndef DECIMALCONSTANTATTRIBUTE_T3DFC057911F4AF28AD6A0472300EBE4C038BD9B5_H
#define DECIMALCONSTANTATTRIBUTE_T3DFC057911F4AF28AD6A0472300EBE4C038BD9B5_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.DecimalConstantAttribute
struct DecimalConstantAttribute_t3DFC057911F4AF28AD6A0472300EBE4C038BD9B5 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Decimal System.Runtime.CompilerServices.DecimalConstantAttribute::dec
Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 ___dec_0;
public:
inline static int32_t get_offset_of_dec_0() { return static_cast<int32_t>(offsetof(DecimalConstantAttribute_t3DFC057911F4AF28AD6A0472300EBE4C038BD9B5, ___dec_0)); }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 get_dec_0() const { return ___dec_0; }
inline Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 * get_address_of_dec_0() { return &___dec_0; }
inline void set_dec_0(Decimal_t44EE9DA309A1BF848308DE4DDFC070CAE6D95EE8 value)
{
___dec_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DECIMALCONSTANTATTRIBUTE_T3DFC057911F4AF28AD6A0472300EBE4C038BD9B5_H
#ifndef ITERATORSTATEMACHINEATTRIBUTE_TECB2E5CA9F79A291BC0E217CD60F706C5AFC563E_H
#define ITERATORSTATEMACHINEATTRIBUTE_TECB2E5CA9F79A291BC0E217CD60F706C5AFC563E_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.IteratorStateMachineAttribute
struct IteratorStateMachineAttribute_tECB2E5CA9F79A291BC0E217CD60F706C5AFC563E : public StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ITERATORSTATEMACHINEATTRIBUTE_TECB2E5CA9F79A291BC0E217CD60F706C5AFC563E_H
#ifndef LOADHINT_TAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF_H
#define LOADHINT_TAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.LoadHint
struct LoadHint_tAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF
{
public:
// System.Int32 System.Runtime.CompilerServices.LoadHint::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(LoadHint_tAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOADHINT_TAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF_H
#ifndef CER_T26325DB2296A2720F6F7C6608A867BCCC7739807_H
#define CER_T26325DB2296A2720F6F7C6608A867BCCC7739807_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ConstrainedExecution.Cer
struct Cer_t26325DB2296A2720F6F7C6608A867BCCC7739807
{
public:
// System.Int32 System.Runtime.ConstrainedExecution.Cer::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Cer_t26325DB2296A2720F6F7C6608A867BCCC7739807, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CER_T26325DB2296A2720F6F7C6608A867BCCC7739807_H
#ifndef CONSISTENCY_TDE0B5998ED48C4408C59644E7E13E309B2309729_H
#define CONSISTENCY_TDE0B5998ED48C4408C59644E7E13E309B2309729_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ConstrainedExecution.Consistency
struct Consistency_tDE0B5998ED48C4408C59644E7E13E309B2309729
{
public:
// System.Int32 System.Runtime.ConstrainedExecution.Consistency::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Consistency_tDE0B5998ED48C4408C59644E7E13E309B2309729, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSISTENCY_TDE0B5998ED48C4408C59644E7E13E309B2309729_H
#ifndef ARGINFOTYPE_TA83FD150C3F02425BD56A3910808C973DF2DBF63_H
#define ARGINFOTYPE_TA83FD150C3F02425BD56A3910808C973DF2DBF63_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.ArgInfoType
struct ArgInfoType_tA83FD150C3F02425BD56A3910808C973DF2DBF63
{
public:
// System.Byte System.Runtime.Remoting.Messaging.ArgInfoType::value__
uint8_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ArgInfoType_tA83FD150C3F02425BD56A3910808C973DF2DBF63, ___value___2)); }
inline uint8_t get_value___2() const { return ___value___2; }
inline uint8_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(uint8_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARGINFOTYPE_TA83FD150C3F02425BD56A3910808C973DF2DBF63_H
#ifndef ASYNCRESULT_TCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_H
#define ASYNCRESULT_TCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.AsyncResult
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2 : public RuntimeObject
{
public:
// System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_state
RuntimeObject * ___async_state_0;
// System.Threading.WaitHandle System.Runtime.Remoting.Messaging.AsyncResult::handle
WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6 * ___handle_1;
// System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_delegate
RuntimeObject * ___async_delegate_2;
// System.IntPtr System.Runtime.Remoting.Messaging.AsyncResult::data
intptr_t ___data_3;
// System.Object System.Runtime.Remoting.Messaging.AsyncResult::object_data
RuntimeObject * ___object_data_4;
// System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::sync_completed
bool ___sync_completed_5;
// System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::completed
bool ___completed_6;
// System.Boolean System.Runtime.Remoting.Messaging.AsyncResult::endinvoke_called
bool ___endinvoke_called_7;
// System.Object System.Runtime.Remoting.Messaging.AsyncResult::async_callback
RuntimeObject * ___async_callback_8;
// System.Threading.ExecutionContext System.Runtime.Remoting.Messaging.AsyncResult::current
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___current_9;
// System.Threading.ExecutionContext System.Runtime.Remoting.Messaging.AsyncResult::original
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___original_10;
// System.Int64 System.Runtime.Remoting.Messaging.AsyncResult::add_time
int64_t ___add_time_11;
// System.Runtime.Remoting.Messaging.MonoMethodMessage System.Runtime.Remoting.Messaging.AsyncResult::call_message
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234 * ___call_message_12;
// System.Runtime.Remoting.Messaging.IMessageCtrl System.Runtime.Remoting.Messaging.AsyncResult::message_ctrl
RuntimeObject* ___message_ctrl_13;
// System.Runtime.Remoting.Messaging.IMessage System.Runtime.Remoting.Messaging.AsyncResult::reply_message
RuntimeObject* ___reply_message_14;
// System.Threading.WaitCallback System.Runtime.Remoting.Messaging.AsyncResult::orig_cb
WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * ___orig_cb_15;
public:
inline static int32_t get_offset_of_async_state_0() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___async_state_0)); }
inline RuntimeObject * get_async_state_0() const { return ___async_state_0; }
inline RuntimeObject ** get_address_of_async_state_0() { return &___async_state_0; }
inline void set_async_state_0(RuntimeObject * value)
{
___async_state_0 = value;
Il2CppCodeGenWriteBarrier((&___async_state_0), value);
}
inline static int32_t get_offset_of_handle_1() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___handle_1)); }
inline WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6 * get_handle_1() const { return ___handle_1; }
inline WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6 ** get_address_of_handle_1() { return &___handle_1; }
inline void set_handle_1(WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6 * value)
{
___handle_1 = value;
Il2CppCodeGenWriteBarrier((&___handle_1), value);
}
inline static int32_t get_offset_of_async_delegate_2() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___async_delegate_2)); }
inline RuntimeObject * get_async_delegate_2() const { return ___async_delegate_2; }
inline RuntimeObject ** get_address_of_async_delegate_2() { return &___async_delegate_2; }
inline void set_async_delegate_2(RuntimeObject * value)
{
___async_delegate_2 = value;
Il2CppCodeGenWriteBarrier((&___async_delegate_2), value);
}
inline static int32_t get_offset_of_data_3() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___data_3)); }
inline intptr_t get_data_3() const { return ___data_3; }
inline intptr_t* get_address_of_data_3() { return &___data_3; }
inline void set_data_3(intptr_t value)
{
___data_3 = value;
}
inline static int32_t get_offset_of_object_data_4() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___object_data_4)); }
inline RuntimeObject * get_object_data_4() const { return ___object_data_4; }
inline RuntimeObject ** get_address_of_object_data_4() { return &___object_data_4; }
inline void set_object_data_4(RuntimeObject * value)
{
___object_data_4 = value;
Il2CppCodeGenWriteBarrier((&___object_data_4), value);
}
inline static int32_t get_offset_of_sync_completed_5() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___sync_completed_5)); }
inline bool get_sync_completed_5() const { return ___sync_completed_5; }
inline bool* get_address_of_sync_completed_5() { return &___sync_completed_5; }
inline void set_sync_completed_5(bool value)
{
___sync_completed_5 = value;
}
inline static int32_t get_offset_of_completed_6() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___completed_6)); }
inline bool get_completed_6() const { return ___completed_6; }
inline bool* get_address_of_completed_6() { return &___completed_6; }
inline void set_completed_6(bool value)
{
___completed_6 = value;
}
inline static int32_t get_offset_of_endinvoke_called_7() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___endinvoke_called_7)); }
inline bool get_endinvoke_called_7() const { return ___endinvoke_called_7; }
inline bool* get_address_of_endinvoke_called_7() { return &___endinvoke_called_7; }
inline void set_endinvoke_called_7(bool value)
{
___endinvoke_called_7 = value;
}
inline static int32_t get_offset_of_async_callback_8() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___async_callback_8)); }
inline RuntimeObject * get_async_callback_8() const { return ___async_callback_8; }
inline RuntimeObject ** get_address_of_async_callback_8() { return &___async_callback_8; }
inline void set_async_callback_8(RuntimeObject * value)
{
___async_callback_8 = value;
Il2CppCodeGenWriteBarrier((&___async_callback_8), value);
}
inline static int32_t get_offset_of_current_9() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___current_9)); }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * get_current_9() const { return ___current_9; }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 ** get_address_of_current_9() { return &___current_9; }
inline void set_current_9(ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * value)
{
___current_9 = value;
Il2CppCodeGenWriteBarrier((&___current_9), value);
}
inline static int32_t get_offset_of_original_10() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___original_10)); }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * get_original_10() const { return ___original_10; }
inline ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 ** get_address_of_original_10() { return &___original_10; }
inline void set_original_10(ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * value)
{
___original_10 = value;
Il2CppCodeGenWriteBarrier((&___original_10), value);
}
inline static int32_t get_offset_of_add_time_11() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___add_time_11)); }
inline int64_t get_add_time_11() const { return ___add_time_11; }
inline int64_t* get_address_of_add_time_11() { return &___add_time_11; }
inline void set_add_time_11(int64_t value)
{
___add_time_11 = value;
}
inline static int32_t get_offset_of_call_message_12() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___call_message_12)); }
inline MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234 * get_call_message_12() const { return ___call_message_12; }
inline MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234 ** get_address_of_call_message_12() { return &___call_message_12; }
inline void set_call_message_12(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234 * value)
{
___call_message_12 = value;
Il2CppCodeGenWriteBarrier((&___call_message_12), value);
}
inline static int32_t get_offset_of_message_ctrl_13() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___message_ctrl_13)); }
inline RuntimeObject* get_message_ctrl_13() const { return ___message_ctrl_13; }
inline RuntimeObject** get_address_of_message_ctrl_13() { return &___message_ctrl_13; }
inline void set_message_ctrl_13(RuntimeObject* value)
{
___message_ctrl_13 = value;
Il2CppCodeGenWriteBarrier((&___message_ctrl_13), value);
}
inline static int32_t get_offset_of_reply_message_14() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___reply_message_14)); }
inline RuntimeObject* get_reply_message_14() const { return ___reply_message_14; }
inline RuntimeObject** get_address_of_reply_message_14() { return &___reply_message_14; }
inline void set_reply_message_14(RuntimeObject* value)
{
___reply_message_14 = value;
Il2CppCodeGenWriteBarrier((&___reply_message_14), value);
}
inline static int32_t get_offset_of_orig_cb_15() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2, ___orig_cb_15)); }
inline WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * get_orig_cb_15() const { return ___orig_cb_15; }
inline WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC ** get_address_of_orig_cb_15() { return &___orig_cb_15; }
inline void set_orig_cb_15(WaitCallback_t61C5F053CAC7A7FE923208EFA060693D7997B4EC * value)
{
___orig_cb_15 = value;
Il2CppCodeGenWriteBarrier((&___orig_cb_15), value);
}
};
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_StaticFields
{
public:
// System.Threading.ContextCallback System.Runtime.Remoting.Messaging.AsyncResult::ccb
ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * ___ccb_16;
public:
inline static int32_t get_offset_of_ccb_16() { return static_cast<int32_t>(offsetof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_StaticFields, ___ccb_16)); }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * get_ccb_16() const { return ___ccb_16; }
inline ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 ** get_address_of_ccb_16() { return &___ccb_16; }
inline void set_ccb_16(ContextCallback_t8AE8A965AC6C7ECD396F527F15CDC8E683BE1676 * value)
{
___ccb_16 = value;
Il2CppCodeGenWriteBarrier((&___ccb_16), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.Remoting.Messaging.AsyncResult
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_pinvoke
{
Il2CppIUnknown* ___async_state_0;
WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6_marshaled_pinvoke* ___handle_1;
Il2CppIUnknown* ___async_delegate_2;
intptr_t ___data_3;
Il2CppIUnknown* ___object_data_4;
int32_t ___sync_completed_5;
int32_t ___completed_6;
int32_t ___endinvoke_called_7;
Il2CppIUnknown* ___async_callback_8;
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___current_9;
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___original_10;
int64_t ___add_time_11;
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_pinvoke* ___call_message_12;
RuntimeObject* ___message_ctrl_13;
RuntimeObject* ___reply_message_14;
Il2CppMethodPointer ___orig_cb_15;
};
// Native definition for COM marshalling of System.Runtime.Remoting.Messaging.AsyncResult
struct AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_com
{
Il2CppIUnknown* ___async_state_0;
WaitHandle_tFD46B5B45A6BB296EA3A104C91DF2A7C03C10AC6_marshaled_com* ___handle_1;
Il2CppIUnknown* ___async_delegate_2;
intptr_t ___data_3;
Il2CppIUnknown* ___object_data_4;
int32_t ___sync_completed_5;
int32_t ___completed_6;
int32_t ___endinvoke_called_7;
Il2CppIUnknown* ___async_callback_8;
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___current_9;
ExecutionContext_t0E11C30308A4CC964D8A2EA9132F9BDCE5362C70 * ___original_10;
int64_t ___add_time_11;
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_com* ___call_message_12;
RuntimeObject* ___message_ctrl_13;
RuntimeObject* ___reply_message_14;
Il2CppMethodPointer ___orig_cb_15;
};
#endif // ASYNCRESULT_TCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_H
#ifndef CALLTYPE_TBE39760BBF734FCF6769A65BFA1F512B1D107243_H
#define CALLTYPE_TBE39760BBF734FCF6769A65BFA1F512B1D107243_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.CallType
struct CallType_tBE39760BBF734FCF6769A65BFA1F512B1D107243
{
public:
// System.Int32 System.Runtime.Remoting.Messaging.CallType::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(CallType_tBE39760BBF734FCF6769A65BFA1F512B1D107243, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CALLTYPE_TBE39760BBF734FCF6769A65BFA1F512B1D107243_H
#ifndef SOAPFIELDATTRIBUTE_T0D4849AE71639A7044E81BF800B5687F7CD5D35C_H
#define SOAPFIELDATTRIBUTE_T0D4849AE71639A7044E81BF800B5687F7CD5D35C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Metadata.SoapFieldAttribute
struct SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C : public SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE
{
public:
// System.String System.Runtime.Remoting.Metadata.SoapFieldAttribute::_elementName
String_t* ____elementName_3;
// System.Boolean System.Runtime.Remoting.Metadata.SoapFieldAttribute::_isElement
bool ____isElement_4;
public:
inline static int32_t get_offset_of__elementName_3() { return static_cast<int32_t>(offsetof(SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C, ____elementName_3)); }
inline String_t* get__elementName_3() const { return ____elementName_3; }
inline String_t** get_address_of__elementName_3() { return &____elementName_3; }
inline void set__elementName_3(String_t* value)
{
____elementName_3 = value;
Il2CppCodeGenWriteBarrier((&____elementName_3), value);
}
inline static int32_t get_offset_of__isElement_4() { return static_cast<int32_t>(offsetof(SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C, ____isElement_4)); }
inline bool get__isElement_4() const { return ____isElement_4; }
inline bool* get_address_of__isElement_4() { return &____isElement_4; }
inline void set__isElement_4(bool value)
{
____isElement_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SOAPFIELDATTRIBUTE_T0D4849AE71639A7044E81BF800B5687F7CD5D35C_H
#ifndef SOAPMETHODATTRIBUTE_T072DC0C06B866B7CF194BFF308CA9FA5C22EE722_H
#define SOAPMETHODATTRIBUTE_T072DC0C06B866B7CF194BFF308CA9FA5C22EE722_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Metadata.SoapMethodAttribute
struct SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722 : public SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE
{
public:
// System.String System.Runtime.Remoting.Metadata.SoapMethodAttribute::_responseElement
String_t* ____responseElement_3;
// System.String System.Runtime.Remoting.Metadata.SoapMethodAttribute::_responseNamespace
String_t* ____responseNamespace_4;
// System.String System.Runtime.Remoting.Metadata.SoapMethodAttribute::_returnElement
String_t* ____returnElement_5;
// System.String System.Runtime.Remoting.Metadata.SoapMethodAttribute::_soapAction
String_t* ____soapAction_6;
// System.Boolean System.Runtime.Remoting.Metadata.SoapMethodAttribute::_useAttribute
bool ____useAttribute_7;
// System.String System.Runtime.Remoting.Metadata.SoapMethodAttribute::_namespace
String_t* ____namespace_8;
public:
inline static int32_t get_offset_of__responseElement_3() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____responseElement_3)); }
inline String_t* get__responseElement_3() const { return ____responseElement_3; }
inline String_t** get_address_of__responseElement_3() { return &____responseElement_3; }
inline void set__responseElement_3(String_t* value)
{
____responseElement_3 = value;
Il2CppCodeGenWriteBarrier((&____responseElement_3), value);
}
inline static int32_t get_offset_of__responseNamespace_4() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____responseNamespace_4)); }
inline String_t* get__responseNamespace_4() const { return ____responseNamespace_4; }
inline String_t** get_address_of__responseNamespace_4() { return &____responseNamespace_4; }
inline void set__responseNamespace_4(String_t* value)
{
____responseNamespace_4 = value;
Il2CppCodeGenWriteBarrier((&____responseNamespace_4), value);
}
inline static int32_t get_offset_of__returnElement_5() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____returnElement_5)); }
inline String_t* get__returnElement_5() const { return ____returnElement_5; }
inline String_t** get_address_of__returnElement_5() { return &____returnElement_5; }
inline void set__returnElement_5(String_t* value)
{
____returnElement_5 = value;
Il2CppCodeGenWriteBarrier((&____returnElement_5), value);
}
inline static int32_t get_offset_of__soapAction_6() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____soapAction_6)); }
inline String_t* get__soapAction_6() const { return ____soapAction_6; }
inline String_t** get_address_of__soapAction_6() { return &____soapAction_6; }
inline void set__soapAction_6(String_t* value)
{
____soapAction_6 = value;
Il2CppCodeGenWriteBarrier((&____soapAction_6), value);
}
inline static int32_t get_offset_of__useAttribute_7() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____useAttribute_7)); }
inline bool get__useAttribute_7() const { return ____useAttribute_7; }
inline bool* get_address_of__useAttribute_7() { return &____useAttribute_7; }
inline void set__useAttribute_7(bool value)
{
____useAttribute_7 = value;
}
inline static int32_t get_offset_of__namespace_8() { return static_cast<int32_t>(offsetof(SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722, ____namespace_8)); }
inline String_t* get__namespace_8() const { return ____namespace_8; }
inline String_t** get_address_of__namespace_8() { return &____namespace_8; }
inline void set__namespace_8(String_t* value)
{
____namespace_8 = value;
Il2CppCodeGenWriteBarrier((&____namespace_8), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SOAPMETHODATTRIBUTE_T072DC0C06B866B7CF194BFF308CA9FA5C22EE722_H
#ifndef SOAPPARAMETERATTRIBUTE_T1CB67B052C746AA6B61A0C0C5D214A098E63ABD6_H
#define SOAPPARAMETERATTRIBUTE_T1CB67B052C746AA6B61A0C0C5D214A098E63ABD6_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Metadata.SoapParameterAttribute
struct SoapParameterAttribute_t1CB67B052C746AA6B61A0C0C5D214A098E63ABD6 : public SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SOAPPARAMETERATTRIBUTE_T1CB67B052C746AA6B61A0C0C5D214A098E63ABD6_H
#ifndef SOAPTYPEATTRIBUTE_T1C7E0B175F9D3211051EC6DF57A195527AEE937A_H
#define SOAPTYPEATTRIBUTE_T1C7E0B175F9D3211051EC6DF57A195527AEE937A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Metadata.SoapTypeAttribute
struct SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A : public SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE
{
public:
// System.Boolean System.Runtime.Remoting.Metadata.SoapTypeAttribute::_useAttribute
bool ____useAttribute_3;
// System.String System.Runtime.Remoting.Metadata.SoapTypeAttribute::_xmlElementName
String_t* ____xmlElementName_4;
// System.String System.Runtime.Remoting.Metadata.SoapTypeAttribute::_xmlNamespace
String_t* ____xmlNamespace_5;
// System.String System.Runtime.Remoting.Metadata.SoapTypeAttribute::_xmlTypeName
String_t* ____xmlTypeName_6;
// System.String System.Runtime.Remoting.Metadata.SoapTypeAttribute::_xmlTypeNamespace
String_t* ____xmlTypeNamespace_7;
// System.Boolean System.Runtime.Remoting.Metadata.SoapTypeAttribute::_isType
bool ____isType_8;
// System.Boolean System.Runtime.Remoting.Metadata.SoapTypeAttribute::_isElement
bool ____isElement_9;
public:
inline static int32_t get_offset_of__useAttribute_3() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____useAttribute_3)); }
inline bool get__useAttribute_3() const { return ____useAttribute_3; }
inline bool* get_address_of__useAttribute_3() { return &____useAttribute_3; }
inline void set__useAttribute_3(bool value)
{
____useAttribute_3 = value;
}
inline static int32_t get_offset_of__xmlElementName_4() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____xmlElementName_4)); }
inline String_t* get__xmlElementName_4() const { return ____xmlElementName_4; }
inline String_t** get_address_of__xmlElementName_4() { return &____xmlElementName_4; }
inline void set__xmlElementName_4(String_t* value)
{
____xmlElementName_4 = value;
Il2CppCodeGenWriteBarrier((&____xmlElementName_4), value);
}
inline static int32_t get_offset_of__xmlNamespace_5() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____xmlNamespace_5)); }
inline String_t* get__xmlNamespace_5() const { return ____xmlNamespace_5; }
inline String_t** get_address_of__xmlNamespace_5() { return &____xmlNamespace_5; }
inline void set__xmlNamespace_5(String_t* value)
{
____xmlNamespace_5 = value;
Il2CppCodeGenWriteBarrier((&____xmlNamespace_5), value);
}
inline static int32_t get_offset_of__xmlTypeName_6() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____xmlTypeName_6)); }
inline String_t* get__xmlTypeName_6() const { return ____xmlTypeName_6; }
inline String_t** get_address_of__xmlTypeName_6() { return &____xmlTypeName_6; }
inline void set__xmlTypeName_6(String_t* value)
{
____xmlTypeName_6 = value;
Il2CppCodeGenWriteBarrier((&____xmlTypeName_6), value);
}
inline static int32_t get_offset_of__xmlTypeNamespace_7() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____xmlTypeNamespace_7)); }
inline String_t* get__xmlTypeNamespace_7() const { return ____xmlTypeNamespace_7; }
inline String_t** get_address_of__xmlTypeNamespace_7() { return &____xmlTypeNamespace_7; }
inline void set__xmlTypeNamespace_7(String_t* value)
{
____xmlTypeNamespace_7 = value;
Il2CppCodeGenWriteBarrier((&____xmlTypeNamespace_7), value);
}
inline static int32_t get_offset_of__isType_8() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____isType_8)); }
inline bool get__isType_8() const { return ____isType_8; }
inline bool* get_address_of__isType_8() { return &____isType_8; }
inline void set__isType_8(bool value)
{
____isType_8 = value;
}
inline static int32_t get_offset_of__isElement_9() { return static_cast<int32_t>(offsetof(SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A, ____isElement_9)); }
inline bool get__isElement_9() const { return ____isElement_9; }
inline bool* get_address_of__isElement_9() { return &____isElement_9; }
inline void set__isElement_9(bool value)
{
____isElement_9 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SOAPTYPEATTRIBUTE_T1C7E0B175F9D3211051EC6DF57A195527AEE937A_H
#ifndef MULTICASTDELEGATE_T_H
#define MULTICASTDELEGATE_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value)
{
___delegates_11 = value;
Il2CppCodeGenWriteBarrier((&___delegates_11), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
};
// Native definition for COM marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
};
#endif // MULTICASTDELEGATE_T_H
#ifndef ASYNCTASKMETHODBUILDER_T0CD1893D670405BED201BE8CA6F2E811F2C0F487_H
#define ASYNCTASKMETHODBUILDER_T0CD1893D670405BED201BE8CA6F2E811F2C0F487_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487
{
public:
// System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Threading.Tasks.VoidTaskResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder::m_builder
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
public:
inline static int32_t get_offset_of_m_builder_1() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487, ___m_builder_1)); }
inline AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 get_m_builder_1() const { return ___m_builder_1; }
inline AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 * get_address_of_m_builder_1() { return &___m_builder_1; }
inline void set_m_builder_1(AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 value)
{
___m_builder_1 = value;
}
};
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields
{
public:
// System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult> System.Runtime.CompilerServices.AsyncTaskMethodBuilder::s_cachedCompleted
Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * ___s_cachedCompleted_0;
public:
inline static int32_t get_offset_of_s_cachedCompleted_0() { return static_cast<int32_t>(offsetof(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields, ___s_cachedCompleted_0)); }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * get_s_cachedCompleted_0() const { return ___s_cachedCompleted_0; }
inline Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 ** get_address_of_s_cachedCompleted_0() { return &___s_cachedCompleted_0; }
inline void set_s_cachedCompleted_0(Task_1_t1359D75350E9D976BFA28AD96E417450DE277673 * value)
{
___s_cachedCompleted_0 = value;
Il2CppCodeGenWriteBarrier((&___s_cachedCompleted_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_marshaled_pinvoke
{
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
};
// Native definition for COM marshalling of System.Runtime.CompilerServices.AsyncTaskMethodBuilder
struct AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_marshaled_com
{
AsyncTaskMethodBuilder_1_t66ED1808B26B8081A2804D6A750D13386E360BD9 ___m_builder_1;
};
#endif // ASYNCTASKMETHODBUILDER_T0CD1893D670405BED201BE8CA6F2E811F2C0F487_H
#ifndef DEFAULTDEPENDENCYATTRIBUTE_T5401DA33101638B630ABCB8C22120ABDB29FE191_H
#define DEFAULTDEPENDENCYATTRIBUTE_T5401DA33101638B630ABCB8C22120ABDB29FE191_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.CompilerServices.DefaultDependencyAttribute
struct DefaultDependencyAttribute_t5401DA33101638B630ABCB8C22120ABDB29FE191 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Runtime.CompilerServices.LoadHint System.Runtime.CompilerServices.DefaultDependencyAttribute::loadHint
int32_t ___loadHint_0;
public:
inline static int32_t get_offset_of_loadHint_0() { return static_cast<int32_t>(offsetof(DefaultDependencyAttribute_t5401DA33101638B630ABCB8C22120ABDB29FE191, ___loadHint_0)); }
inline int32_t get_loadHint_0() const { return ___loadHint_0; }
inline int32_t* get_address_of_loadHint_0() { return &___loadHint_0; }
inline void set_loadHint_0(int32_t value)
{
___loadHint_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DEFAULTDEPENDENCYATTRIBUTE_T5401DA33101638B630ABCB8C22120ABDB29FE191_H
#ifndef RELIABILITYCONTRACTATTRIBUTE_T784D3086C6F43192DE3A8676636DE98EE2CBEE45_H
#define RELIABILITYCONTRACTATTRIBUTE_T784D3086C6F43192DE3A8676636DE98EE2CBEE45_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ConstrainedExecution.ReliabilityContractAttribute
struct ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
// System.Runtime.ConstrainedExecution.Consistency System.Runtime.ConstrainedExecution.ReliabilityContractAttribute::_consistency
int32_t ____consistency_0;
// System.Runtime.ConstrainedExecution.Cer System.Runtime.ConstrainedExecution.ReliabilityContractAttribute::_cer
int32_t ____cer_1;
public:
inline static int32_t get_offset_of__consistency_0() { return static_cast<int32_t>(offsetof(ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45, ____consistency_0)); }
inline int32_t get__consistency_0() const { return ____consistency_0; }
inline int32_t* get_address_of__consistency_0() { return &____consistency_0; }
inline void set__consistency_0(int32_t value)
{
____consistency_0 = value;
}
inline static int32_t get_offset_of__cer_1() { return static_cast<int32_t>(offsetof(ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45, ____cer_1)); }
inline int32_t get__cer_1() const { return ____cer_1; }
inline int32_t* get_address_of__cer_1() { return &____cer_1; }
inline void set__cer_1(int32_t value)
{
____cer_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RELIABILITYCONTRACTATTRIBUTE_T784D3086C6F43192DE3A8676636DE98EE2CBEE45_H
#ifndef MONOMETHODMESSAGE_T0846334ADE91F66FECE638BEF57256CFF6EEA234_H
#define MONOMETHODMESSAGE_T0846334ADE91F66FECE638BEF57256CFF6EEA234_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.MonoMethodMessage
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234 : public RuntimeObject
{
public:
// System.Reflection.MonoMethod System.Runtime.Remoting.Messaging.MonoMethodMessage::method
MonoMethod_t * ___method_0;
// System.Object[] System.Runtime.Remoting.Messaging.MonoMethodMessage::args
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ___args_1;
// System.String[] System.Runtime.Remoting.Messaging.MonoMethodMessage::names
StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* ___names_2;
// System.Byte[] System.Runtime.Remoting.Messaging.MonoMethodMessage::arg_types
ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___arg_types_3;
// System.Runtime.Remoting.Messaging.LogicalCallContext System.Runtime.Remoting.Messaging.MonoMethodMessage::ctx
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___ctx_4;
// System.Object System.Runtime.Remoting.Messaging.MonoMethodMessage::rval
RuntimeObject * ___rval_5;
// System.Exception System.Runtime.Remoting.Messaging.MonoMethodMessage::exc
Exception_t * ___exc_6;
// System.Runtime.Remoting.Messaging.AsyncResult System.Runtime.Remoting.Messaging.MonoMethodMessage::asyncResult
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2 * ___asyncResult_7;
// System.Runtime.Remoting.Messaging.CallType System.Runtime.Remoting.Messaging.MonoMethodMessage::call_type
int32_t ___call_type_8;
// System.String System.Runtime.Remoting.Messaging.MonoMethodMessage::uri
String_t* ___uri_9;
// System.Runtime.Remoting.Messaging.MCMDictionary System.Runtime.Remoting.Messaging.MonoMethodMessage::properties
MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 * ___properties_10;
// System.Type[] System.Runtime.Remoting.Messaging.MonoMethodMessage::methodSignature
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ___methodSignature_11;
// System.Runtime.Remoting.Identity System.Runtime.Remoting.Messaging.MonoMethodMessage::identity
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ___identity_12;
public:
inline static int32_t get_offset_of_method_0() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___method_0)); }
inline MonoMethod_t * get_method_0() const { return ___method_0; }
inline MonoMethod_t ** get_address_of_method_0() { return &___method_0; }
inline void set_method_0(MonoMethod_t * value)
{
___method_0 = value;
Il2CppCodeGenWriteBarrier((&___method_0), value);
}
inline static int32_t get_offset_of_args_1() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___args_1)); }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* get_args_1() const { return ___args_1; }
inline ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A** get_address_of_args_1() { return &___args_1; }
inline void set_args_1(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* value)
{
___args_1 = value;
Il2CppCodeGenWriteBarrier((&___args_1), value);
}
inline static int32_t get_offset_of_names_2() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___names_2)); }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* get_names_2() const { return ___names_2; }
inline StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E** get_address_of_names_2() { return &___names_2; }
inline void set_names_2(StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* value)
{
___names_2 = value;
Il2CppCodeGenWriteBarrier((&___names_2), value);
}
inline static int32_t get_offset_of_arg_types_3() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___arg_types_3)); }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_arg_types_3() const { return ___arg_types_3; }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_arg_types_3() { return &___arg_types_3; }
inline void set_arg_types_3(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value)
{
___arg_types_3 = value;
Il2CppCodeGenWriteBarrier((&___arg_types_3), value);
}
inline static int32_t get_offset_of_ctx_4() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___ctx_4)); }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * get_ctx_4() const { return ___ctx_4; }
inline LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E ** get_address_of_ctx_4() { return &___ctx_4; }
inline void set_ctx_4(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * value)
{
___ctx_4 = value;
Il2CppCodeGenWriteBarrier((&___ctx_4), value);
}
inline static int32_t get_offset_of_rval_5() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___rval_5)); }
inline RuntimeObject * get_rval_5() const { return ___rval_5; }
inline RuntimeObject ** get_address_of_rval_5() { return &___rval_5; }
inline void set_rval_5(RuntimeObject * value)
{
___rval_5 = value;
Il2CppCodeGenWriteBarrier((&___rval_5), value);
}
inline static int32_t get_offset_of_exc_6() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___exc_6)); }
inline Exception_t * get_exc_6() const { return ___exc_6; }
inline Exception_t ** get_address_of_exc_6() { return &___exc_6; }
inline void set_exc_6(Exception_t * value)
{
___exc_6 = value;
Il2CppCodeGenWriteBarrier((&___exc_6), value);
}
inline static int32_t get_offset_of_asyncResult_7() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___asyncResult_7)); }
inline AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2 * get_asyncResult_7() const { return ___asyncResult_7; }
inline AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2 ** get_address_of_asyncResult_7() { return &___asyncResult_7; }
inline void set_asyncResult_7(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2 * value)
{
___asyncResult_7 = value;
Il2CppCodeGenWriteBarrier((&___asyncResult_7), value);
}
inline static int32_t get_offset_of_call_type_8() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___call_type_8)); }
inline int32_t get_call_type_8() const { return ___call_type_8; }
inline int32_t* get_address_of_call_type_8() { return &___call_type_8; }
inline void set_call_type_8(int32_t value)
{
___call_type_8 = value;
}
inline static int32_t get_offset_of_uri_9() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___uri_9)); }
inline String_t* get_uri_9() const { return ___uri_9; }
inline String_t** get_address_of_uri_9() { return &___uri_9; }
inline void set_uri_9(String_t* value)
{
___uri_9 = value;
Il2CppCodeGenWriteBarrier((&___uri_9), value);
}
inline static int32_t get_offset_of_properties_10() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___properties_10)); }
inline MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 * get_properties_10() const { return ___properties_10; }
inline MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 ** get_address_of_properties_10() { return &___properties_10; }
inline void set_properties_10(MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 * value)
{
___properties_10 = value;
Il2CppCodeGenWriteBarrier((&___properties_10), value);
}
inline static int32_t get_offset_of_methodSignature_11() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___methodSignature_11)); }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* get_methodSignature_11() const { return ___methodSignature_11; }
inline TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F** get_address_of_methodSignature_11() { return &___methodSignature_11; }
inline void set_methodSignature_11(TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* value)
{
___methodSignature_11 = value;
Il2CppCodeGenWriteBarrier((&___methodSignature_11), value);
}
inline static int32_t get_offset_of_identity_12() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234, ___identity_12)); }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * get_identity_12() const { return ___identity_12; }
inline Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 ** get_address_of_identity_12() { return &___identity_12; }
inline void set_identity_12(Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * value)
{
___identity_12 = value;
Il2CppCodeGenWriteBarrier((&___identity_12), value);
}
};
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields
{
public:
// System.String System.Runtime.Remoting.Messaging.MonoMethodMessage::CallContextKey
String_t* ___CallContextKey_13;
// System.String System.Runtime.Remoting.Messaging.MonoMethodMessage::UriKey
String_t* ___UriKey_14;
public:
inline static int32_t get_offset_of_CallContextKey_13() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields, ___CallContextKey_13)); }
inline String_t* get_CallContextKey_13() const { return ___CallContextKey_13; }
inline String_t** get_address_of_CallContextKey_13() { return &___CallContextKey_13; }
inline void set_CallContextKey_13(String_t* value)
{
___CallContextKey_13 = value;
Il2CppCodeGenWriteBarrier((&___CallContextKey_13), value);
}
inline static int32_t get_offset_of_UriKey_14() { return static_cast<int32_t>(offsetof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields, ___UriKey_14)); }
inline String_t* get_UriKey_14() const { return ___UriKey_14; }
inline String_t** get_address_of_UriKey_14() { return &___UriKey_14; }
inline void set_UriKey_14(String_t* value)
{
___UriKey_14 = value;
Il2CppCodeGenWriteBarrier((&___UriKey_14), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Runtime.Remoting.Messaging.MonoMethodMessage
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_pinvoke
{
MonoMethod_t * ___method_0;
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ___args_1;
char** ___names_2;
uint8_t* ___arg_types_3;
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___ctx_4;
Il2CppIUnknown* ___rval_5;
Exception_t_marshaled_pinvoke* ___exc_6;
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_pinvoke* ___asyncResult_7;
int32_t ___call_type_8;
char* ___uri_9;
MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 * ___properties_10;
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ___methodSignature_11;
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ___identity_12;
};
// Native definition for COM marshalling of System.Runtime.Remoting.Messaging.MonoMethodMessage
struct MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_marshaled_com
{
MonoMethod_t * ___method_0;
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* ___args_1;
Il2CppChar** ___names_2;
uint8_t* ___arg_types_3;
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E * ___ctx_4;
Il2CppIUnknown* ___rval_5;
Exception_t_marshaled_com* ___exc_6;
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_marshaled_com* ___asyncResult_7;
int32_t ___call_type_8;
Il2CppChar* ___uri_9;
MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434 * ___properties_10;
TypeU5BU5D_t7FE623A666B49176DE123306221193E888A12F5F* ___methodSignature_11;
Identity_tB4E8BEFF42D505C9B24C9284934E6538F29606B6 * ___identity_12;
};
#endif // MONOMETHODMESSAGE_T0846334ADE91F66FECE638BEF57256CFF6EEA234_H
#ifndef HEADERHANDLER_T1242348575203397A2448B743F85E89A6EF8576F_H
#define HEADERHANDLER_T1242348575203397A2448B743F85E89A6EF8576F_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Messaging.HeaderHandler
struct HeaderHandler_t1242348575203397A2448B743F85E89A6EF8576F : public MulticastDelegate_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // HEADERHANDLER_T1242348575203397A2448B743F85E89A6EF8576F_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1100 = { sizeof (RemoteActivator_t1882A1F35EE36C9F6A639472386A46AB7E49180A), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1101 = { sizeof (SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1101[3] =
{
SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE::get_offset_of__useAttribute_0(),
SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE::get_offset_of_ProtXmlNamespace_1(),
SoapAttribute_tFAB893E3F49B2A2431C47FA7E79746BD6AE4C5CE::get_offset_of_ReflectInfo_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1102 = { sizeof (SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1102[2] =
{
SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C::get_offset_of__elementName_3(),
SoapFieldAttribute_t0D4849AE71639A7044E81BF800B5687F7CD5D35C::get_offset_of__isElement_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1103 = { sizeof (SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1103[6] =
{
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__responseElement_3(),
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__responseNamespace_4(),
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__returnElement_5(),
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__soapAction_6(),
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__useAttribute_7(),
SoapMethodAttribute_t072DC0C06B866B7CF194BFF308CA9FA5C22EE722::get_offset_of__namespace_8(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1104 = { sizeof (SoapParameterAttribute_t1CB67B052C746AA6B61A0C0C5D214A098E63ABD6), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1105 = { sizeof (SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1105[7] =
{
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__useAttribute_3(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__xmlElementName_4(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__xmlNamespace_5(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__xmlTypeName_6(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__xmlTypeNamespace_7(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__isType_8(),
SoapTypeAttribute_t1C7E0B175F9D3211051EC6DF57A195527AEE937A::get_offset_of__isElement_9(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1106 = { sizeof (CallContext_tFB5D4D2D6BB4F51BA82A549CEA456DD9608CDA1A), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1107 = { sizeof (IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1107[2] =
{
IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179::get_offset_of_m_Datastore_0(),
IllogicalCallContext_t86AF2EA64B3A9BB99C979A1C2EC3578C5D7EB179::get_offset_of_m_HostContext_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1108 = { sizeof (LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E), -1, sizeof(LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1108[6] =
{
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E_StaticFields::get_offset_of_s_callContextType_0(),
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E::get_offset_of_m_Datastore_1(),
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E::get_offset_of_m_RemotingData_2(),
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E::get_offset_of_m_SecurityData_3(),
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E::get_offset_of_m_HostContext_4(),
LogicalCallContext_t3A9A7C02A28577F0879F6E950E46EEC595731D7E::get_offset_of_m_IsCorrelationMgr_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1109 = { sizeof (Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6)+ sizeof (RuntimeObject), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1109[1] =
{
Reader_t8A0F3818A710941785287CE8D7184C05480C2EA6::get_offset_of_m_ctx_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1110 = { sizeof (CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1110[1] =
{
CallContextSecurityData_t72826F22C5CFD231ECF664638EFFBF458D0AE9AF::get_offset_of__principal_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1111 = { sizeof (CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1111[1] =
{
CallContextRemotingData_t40838E8CBCE35E4459B70A8F701128385E2D1347::get_offset_of__logicalCallID_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1112 = { sizeof (ArgInfoType_tA83FD150C3F02425BD56A3910808C973DF2DBF63)+ sizeof (RuntimeObject), sizeof(uint8_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1112[3] =
{
ArgInfoType_tA83FD150C3F02425BD56A3910808C973DF2DBF63::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1113 = { sizeof (ArgInfo_t67419B6DE53980148631C33DF785307579134942), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1113[3] =
{
ArgInfo_t67419B6DE53980148631C33DF785307579134942::get_offset_of__paramMap_0(),
ArgInfo_t67419B6DE53980148631C33DF785307579134942::get_offset_of__inoutArgCount_1(),
ArgInfo_t67419B6DE53980148631C33DF785307579134942::get_offset_of__method_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1114 = { sizeof (AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2), -1, sizeof(AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1114[17] =
{
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_async_state_0(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_handle_1(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_async_delegate_2(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_data_3(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_object_data_4(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_sync_completed_5(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_completed_6(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_endinvoke_called_7(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_async_callback_8(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_current_9(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_original_10(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_add_time_11(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_call_message_12(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_message_ctrl_13(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_reply_message_14(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2::get_offset_of_orig_cb_15(),
AsyncResult_tCCDC69FF29D3DE32F7BD57870BBC329EFF8E58E2_StaticFields::get_offset_of_ccb_16(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1115 = { sizeof (CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1115[1] =
{
CADArgHolder_t8983A769C5D0C79BEF91202F0167A41040D9FF4A::get_offset_of_index_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1116 = { sizeof (CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1116[3] =
{
CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591::get_offset_of_objref_0(),
CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591::get_offset_of_SourceDomain_1(),
CADObjRef_tA8BAE8646770C27FB69FB6FE43C9C81B68C72591::get_offset_of_TypeInfo_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1117 = { sizeof (CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1117[5] =
{
CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759::get_offset_of_ctor_0(),
CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759::get_offset_of_typeName_1(),
CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759::get_offset_of_methodName_2(),
CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759::get_offset_of_param_names_3(),
CADMethodRef_t5AA4D29CC08E917A0691DD37DB71600FC0059759::get_offset_of_generic_arg_names_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1118 = { sizeof (CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1118[5] =
{
CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B::get_offset_of__args_0(),
CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B::get_offset_of__serializedArgs_1(),
CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B::get_offset_of__propertyCount_2(),
CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B::get_offset_of__callContext_3(),
CADMessageBase_t427360000344A4FE250725A55B58FFB950AE5C6B::get_offset_of_serializedMethod_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1119 = { sizeof (CADMethodCallMessage_t7B9A972EAA7214F4072621D30B449A5BADC3BFF8), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1119[1] =
{
CADMethodCallMessage_t7B9A972EAA7214F4072621D30B449A5BADC3BFF8::get_offset_of__uri_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1120 = { sizeof (CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1120[3] =
{
CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C::get_offset_of__returnValue_5(),
CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C::get_offset_of__exception_6(),
CADMethodReturnMessage_tC46DD1930F6C9F9EF55AAEBD5F3C638BD9FE823C::get_offset_of__sig_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1121 = { sizeof (ClientContextTerminatorSink_tCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1121[1] =
{
ClientContextTerminatorSink_tCF852D4ABC4831352A62C8FBD896C48BBB8DA3FB::get_offset_of__context_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1122 = { sizeof (ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1122[2] =
{
ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C::get_offset_of__replySink_0(),
ClientContextReplySink_t800CF65D66E386E44690A372676FC9936E2DCA8C::get_offset_of__context_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1123 = { sizeof (ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1123[7] =
{
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__activator_11(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__activationAttributes_12(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__contextProperties_13(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__activationType_14(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__activationTypeName_15(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__isContextOk_16(),
ConstructionCall_t24A620B6D0B83BCF9CF434AD9A5532D0826950AE::get_offset_of__sourceProxy_17(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1124 = { sizeof (ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677), -1, sizeof(ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1124[1] =
{
ConstructionCallDictionary_t33EA51E02BAE154DFF42DA8FEA82BF0D3ED49677_StaticFields::get_offset_of_InternalKeys_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1125 = { sizeof (ConstructionResponse_t772CA297A73A84339329D0FCD37FCDF257A0BAA2), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1126 = { sizeof (EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806), -1, sizeof(EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1126[1] =
{
EnvoyTerminatorSink_t58C3EE980197493267EB942D964BC8B507F14806_StaticFields::get_offset_of_Instance_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1127 = { sizeof (ErrorMessage_t8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1127[1] =
{
ErrorMessage_t8FBAA06EDB2D3BB3E5E066247C3761ADAC64D47D::get_offset_of__uri_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1128 = { sizeof (Header_tBB05146C08BE55AC72B8813E862DA50FDFB2417C), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1129 = { sizeof (HeaderHandler_t1242348575203397A2448B743F85E89A6EF8576F), sizeof(Il2CppMethodPointer), 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1130 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1131 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1132 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1133 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1134 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1135 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1136 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1137 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1138 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1139 = { sizeof (MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1139[11] =
{
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__uri_0(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__typeName_1(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__methodName_2(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__args_3(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__methodSignature_4(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__methodBase_5(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__callContext_6(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__targetIdentity_7(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of__genericArguments_8(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of_ExternalProperties_9(),
MethodCall_tF8FFD68F9EB80746F22EA5B9C23E9701A440E5CA::get_offset_of_InternalProperties_10(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1140 = { sizeof (MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434), -1, sizeof(MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1140[1] =
{
MCMDictionary_tD801081CC84A219F173B4A5A90A53A75A43D5434_StaticFields::get_offset_of_InternalKeys_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1141 = { sizeof (MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1141[4] =
{
MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5::get_offset_of__internalProperties_0(),
MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5::get_offset_of__message_1(),
MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5::get_offset_of__methodKeys_2(),
MessageDictionary_tC2DDCAFD65B74954A76393BCE90E57F58298F5C5::get_offset_of__ownProperties_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1142 = { sizeof (DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1142[3] =
{
DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9::get_offset_of__methodDictionary_0(),
DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9::get_offset_of__hashtableEnum_1(),
DictionaryEnumerator_tA162086B57068DE62A7BAD2CAA7003E632DE2AB9::get_offset_of__posMethod_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1143 = { sizeof (MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1143[15] =
{
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__methodName_0(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__uri_1(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__typeName_2(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__methodBase_3(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__returnValue_4(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__exception_5(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__methodSignature_6(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__inArgInfo_7(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__args_8(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__outArgs_9(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__callMsg_10(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__callContext_11(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of__targetIdentity_12(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of_ExternalProperties_13(),
MethodResponse_t185820C6B3E7D56E9026084CB2CEF1387151D907::get_offset_of_InternalProperties_14(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1144 = { sizeof (MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48), -1, sizeof(MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1144[2] =
{
MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields::get_offset_of_InternalReturnKeys_4(),
MethodReturnDictionary_tFCD4ADFA43AA2736517130020BBB9E60A253EB48_StaticFields::get_offset_of_InternalExceptionKeys_5(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1145 = { sizeof (MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234), -1, sizeof(MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1145[15] =
{
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_method_0(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_args_1(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_names_2(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_arg_types_3(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_ctx_4(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_rval_5(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_exc_6(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_asyncResult_7(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_call_type_8(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_uri_9(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_properties_10(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_methodSignature_11(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234::get_offset_of_identity_12(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields::get_offset_of_CallContextKey_13(),
MonoMethodMessage_t0846334ADE91F66FECE638BEF57256CFF6EEA234_StaticFields::get_offset_of_UriKey_14(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1146 = { sizeof (CallType_tBE39760BBF734FCF6769A65BFA1F512B1D107243)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1146[5] =
{
CallType_tBE39760BBF734FCF6769A65BFA1F512B1D107243::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1147 = { sizeof (OneWayAttribute_t848DB2BC395D34A01B2932EEC85CEA65CA9C9B43), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1148 = { sizeof (RemotingSurrogate_t722F41294C1F4DEA38A993DB43F51AC8CBB494BA), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1149 = { sizeof (ObjRefSurrogate_tE2F801FFAE2DBDE6B44A528F7E537922F3840547), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1150 = { sizeof (RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44), -1, sizeof(RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1150[4] =
{
RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields::get_offset_of_s_cachedTypeObjRef_0(),
RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields::get_offset_of__objRefSurrogate_1(),
RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44_StaticFields::get_offset_of__objRemotingSurrogate_2(),
RemotingSurrogateSelector_tEABB3D5ACF04B7270F565E8BC105DDD94DDFFE44::get_offset_of__next_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1151 = { sizeof (ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1151[13] =
{
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__outArgs_0(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__args_1(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__callCtx_2(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__returnValue_3(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__uri_4(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__exception_5(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__methodBase_6(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__methodName_7(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__methodSignature_8(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__typeName_9(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__properties_10(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__targetIdentity_11(),
ReturnMessage_tCB42BAB06521388D0FC8E5745FC9A74FCC4E6E03::get_offset_of__inArgInfo_12(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1152 = { sizeof (ServerContextTerminatorSink_t11FA44A0CACACA4A89B73434FB6D685479C6B8E0), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1153 = { sizeof (ServerObjectTerminatorSink_t635122FE05BCEDE34F4B07AA9590AD77509752FD), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1153[1] =
{
ServerObjectTerminatorSink_t635122FE05BCEDE34F4B07AA9590AD77509752FD::get_offset_of__nextSink_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1154 = { sizeof (ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1154[2] =
{
ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8::get_offset_of__replySink_0(),
ServerObjectReplySink_tE1CEF247A2AC5DFD53842706CFE097CE9556CCB8::get_offset_of__identity_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1155 = { sizeof (StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1155[2] =
{
StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897::get_offset_of__target_0(),
StackBuilderSink_t312B8C166D43B3871C33905CA64E57520C479897::get_offset_of__rp_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1156 = { sizeof (HandleProcessCorruptedStateExceptionsAttribute_tA72E0974E174E223166E56C7E2B20C319C322260), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1157 = { sizeof (FirstChanceExceptionEventArgs_t0FA7904C9F4BAA2FC640BE3E5AC348F153AD8B6D), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1158 = { sizeof (ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1158[2] =
{
ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A::get_offset_of_m_Exception_0(),
ExceptionDispatchInfo_t0C54083F3909DAF986A4DEAA7C047559531E0E2A::get_offset_of_m_stackTrace_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1159 = { sizeof (CriticalFinalizerObject_t8B006E1DEE084E781F5C0F3283E9226E28894DD9), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1160 = { sizeof (Consistency_tDE0B5998ED48C4408C59644E7E13E309B2309729)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1160[5] =
{
Consistency_tDE0B5998ED48C4408C59644E7E13E309B2309729::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1161 = { sizeof (Cer_t26325DB2296A2720F6F7C6608A867BCCC7739807)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1161[4] =
{
Cer_t26325DB2296A2720F6F7C6608A867BCCC7739807::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1162 = { sizeof (ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1162[2] =
{
ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45::get_offset_of__consistency_0(),
ReliabilityContractAttribute_t784D3086C6F43192DE3A8676636DE98EE2CBEE45::get_offset_of__cer_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1163 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1164 = { sizeof (TupleElementNamesAttribute_t9DA57F2C0033062D34728E524F7A057A0BDF6CEB), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1164[1] =
{
TupleElementNamesAttribute_t9DA57F2C0033062D34728E524F7A057A0BDF6CEB::get_offset_of__transformNames_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1165 = { sizeof (AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487)+ sizeof (RuntimeObject), -1, sizeof(AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1165[2] =
{
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487_StaticFields::get_offset_of_s_cachedCompleted_0(),
AsyncTaskMethodBuilder_t0CD1893D670405BED201BE8CA6F2E811F2C0F487::get_offset_of_m_builder_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1166 = { 0, 0, 0, 0 };
extern const int32_t g_FieldOffsetTable1166[3] =
{
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1167 = { sizeof (AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF), -1, sizeof(AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1167[3] =
{
AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields::get_offset_of_TrueTask_0(),
AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields::get_offset_of_FalseTask_1(),
AsyncTaskCache_t34A97832FCD6948CE68777740FA37AEAB550E6CF_StaticFields::get_offset_of_Int32Tasks_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1168 = { sizeof (AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01)+ sizeof (RuntimeObject), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1168[2] =
{
AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01::get_offset_of_m_stateMachine_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
AsyncMethodBuilderCore_t4CE6C1E4B0621A6EC45CF6E0E8F1F633FFF9FF01::get_offset_of_m_defaultContextAction_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1169 = { sizeof (MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A), -1, sizeof(MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1169[3] =
{
MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A::get_offset_of_m_context_0(),
MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A::get_offset_of_m_stateMachine_1(),
MoveNextRunner_t6A0B9DE31628DAC797ABC84945D4C62B07C3E65A_StaticFields::get_offset_of_s_invokeMoveNext_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1170 = { sizeof (ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1170[3] =
{
ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201::get_offset_of_m_continuation_0(),
ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201::get_offset_of_m_invokeAction_1(),
ContinuationWrapper_tCC429E05B578FB77DAD5970B18B3DD07748DB201::get_offset_of_m_innerTask_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1171 = { sizeof (U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1171[2] =
{
U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368::get_offset_of_innerTask_0(),
U3CU3Ec__DisplayClass4_0_t91BE7D82E3148DC17AD2CF3AFA190EE3018F2368::get_offset_of_continuation_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1172 = { sizeof (U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079), -1, sizeof(U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable1172[3] =
{
U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields::get_offset_of_U3CU3E9_0(),
U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields::get_offset_of_U3CU3E9__6_0_1(),
U3CU3Ec_tFBB9560424DFB5E39123CDE092BE03875E657079_StaticFields::get_offset_of_U3CU3E9__6_1_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1173 = { sizeof (AsyncStateMachineAttribute_t71790D316286529022E8E3342C82150023358A00), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1174 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1175 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1176 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1177 = { sizeof (IteratorStateMachineAttribute_tECB2E5CA9F79A291BC0E217CD60F706C5AFC563E), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1178 = { sizeof (RuntimeCompatibilityAttribute_tF386C60D3DD4A0E1759F1D8F76841FC4522A6126), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1178[1] =
{
RuntimeCompatibilityAttribute_tF386C60D3DD4A0E1759F1D8F76841FC4522A6126::get_offset_of_m_wrapNonExceptionThrows_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1179 = { sizeof (RuntimeWrappedException_t5E7538D9FD99A8A0FB32B396776E294A29866C0D), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1179[1] =
{
RuntimeWrappedException_t5E7538D9FD99A8A0FB32B396776E294A29866C0D::get_offset_of_m_wrappedException_17(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1180 = { sizeof (StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1180[1] =
{
StateMachineAttribute_t0F08DD69D5AB4A30C6A13E245143DD5335A4DA93::get_offset_of_U3CStateMachineTypeU3Ek__BackingField_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1181 = { sizeof (TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F)+ sizeof (RuntimeObject), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1181[1] =
{
TaskAwaiter_t0CDE8DBB564F0A0EA55FA6B3D43EEF96BC26252F::get_offset_of_m_task_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1182 = { 0, 0, 0, 0 };
extern const int32_t g_FieldOffsetTable1182[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1183 = { sizeof (ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9)+ sizeof (RuntimeObject), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1183[1] =
{
ConfiguredTaskAwaitable_t24DE1415466EE20060BE5AD528DC5C812CFA53A9::get_offset_of_m_configuredTaskAwaiter_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1184 = { sizeof (ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874)+ sizeof (RuntimeObject), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1184[2] =
{
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874::get_offset_of_m_task_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
ConfiguredTaskAwaiter_tF1AAA16B8A1250CA037E32157A3424CD2BA47874::get_offset_of_m_continueOnCapturedContext_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1185 = { 0, 0, 0, 0 };
extern const int32_t g_FieldOffsetTable1185[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1186 = { 0, 0, 0, 0 };
extern const int32_t g_FieldOffsetTable1186[2] =
{
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1187 = { sizeof (TypeForwardedFromAttribute_tEE8D8DA95C9112F53D8E66EA00F476C923A003E2), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1187[1] =
{
TypeForwardedFromAttribute_tEE8D8DA95C9112F53D8E66EA00F476C923A003E2::get_offset_of_assemblyFullName_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1188 = { sizeof (LoadHint_tAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1188[4] =
{
LoadHint_tAD3279A5DC1810A6D778793F6D5D2B52F8E7D4AF::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1189 = { sizeof (DefaultDependencyAttribute_t5401DA33101638B630ABCB8C22120ABDB29FE191), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1189[1] =
{
DefaultDependencyAttribute_t5401DA33101638B630ABCB8C22120ABDB29FE191::get_offset_of_loadHint_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1190 = { sizeof (CompilationRelaxations_tCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable1190[2] =
{
CompilationRelaxations_tCFC58143CB8E81E1E407EEA8FF9C9DF876F0750B::get_offset_of_value___2() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1191 = { sizeof (CompilationRelaxationsAttribute_t0067C359924196418CFB0DE4C07C5F4C4BCD54FF), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1191[1] =
{
CompilationRelaxationsAttribute_t0067C359924196418CFB0DE4C07C5F4C4BCD54FF::get_offset_of_m_relaxations_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1192 = { sizeof (CompilerGeneratedAttribute_t29C03D4EB4F2193B5BF85D03923EA47423C946FC), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1193 = { sizeof (CustomConstantAttribute_tBAC64D25BCB4BE5CAC32AC430CA8BEF070923191), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1194 = { sizeof (DateTimeConstantAttribute_t4E7414CDD051958BEA1F01140F38441AA442D9BE), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1194[1] =
{
DateTimeConstantAttribute_t4E7414CDD051958BEA1F01140F38441AA442D9BE::get_offset_of_date_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1195 = { sizeof (DecimalConstantAttribute_t3DFC057911F4AF28AD6A0472300EBE4C038BD9B5), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1195[1] =
{
DecimalConstantAttribute_t3DFC057911F4AF28AD6A0472300EBE4C038BD9B5::get_offset_of_dec_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1196 = { sizeof (ExtensionAttribute_t34A17741DB6F2A390F30532BD50B269ECDB8F124), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1197 = { sizeof (FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1197[2] =
{
FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743::get_offset_of_elementType_0(),
FixedBufferAttribute_tF3065E17C7BDDEAEDC5D80CED0509DB83C558743::get_offset_of_length_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1198 = { sizeof (InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable1198[2] =
{
InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767::get_offset_of__assemblyName_0(),
InternalsVisibleToAttribute_t3AEE3C8B7B894E54091E79A5A1C570B6DBB82767::get_offset_of__allInternalsVisible_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1199 = { sizeof (FriendAccessAllowedAttribute_t7924C8657D64E9FCB405FD7457DDF6EFA131BE96), -1, 0, 0 };
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // Modified by PostBuild.cs
| 49.734344
| 262
| 0.855697
|
AnnaOpareva
|
6a14537588806e8493ff5ffe7b49a9bc0d6bf50b
| 4,343
|
hh
|
C++
|
ACAP_linux/3rd/CoMISo/NSolver/NewtonSolver.hh
|
shubhMaheshwari/Automatic-Unpaired-Shape-Deformation-Transfer
|
8c9afe017769f9554706bcd267b6861c4c144999
|
[
"MIT"
] | 216
|
2018-09-09T11:53:56.000Z
|
2022-03-19T13:41:35.000Z
|
ACAP_linux/3rd/CoMISo/NSolver/NewtonSolver.hh
|
gaolinorange/Automatic-Unpaired-Shape-Deformation-Transfer
|
8c9afe017769f9554706bcd267b6861c4c144999
|
[
"MIT"
] | 13
|
2018-10-23T08:29:09.000Z
|
2021-09-08T06:45:34.000Z
|
ACAP_linux/3rd/CoMISo/NSolver/NewtonSolver.hh
|
shubhMaheshwari/Automatic-Unpaired-Shape-Deformation-Transfer
|
8c9afe017769f9554706bcd267b6861c4c144999
|
[
"MIT"
] | 41
|
2018-09-13T08:50:41.000Z
|
2022-02-23T00:33:54.000Z
|
//=============================================================================
//
// CLASS NewtonSolver
//
//=============================================================================
#ifndef COMISO_NEWTONSOLVER_HH
#define COMISO_NEWTONSOLVER_HH
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include <CoMISo/Config/config.hh>
//== INCLUDES =================================================================
#include <CoMISo/Config/CoMISoDefines.hh>
#include <CoMISo/Utils/StopWatch.hh>
#include "NProblemInterface.hh"
#include "NProblemGmmInterface.hh"
//#include <Base/Debug/DebTime.hh>
#if COMISO_SUITESPARSE_AVAILABLE
#include <Eigen/UmfPackSupport>
#include <Eigen/CholmodSupport>
#endif
// ToDo: why is Metis not working yet?
//#if COMISO_METIS_AVAILABLE
// #include <Eigen/MetisSupport>
//#endif
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace COMISO {
//== CLASS DEFINITION =========================================================
/** \class NewtonSolver NewtonSolver.hh <ACG/.../NewtonSolver.hh>
Brief Description.
A more elaborate description follows.
*/
class COMISODLLEXPORT NewtonSolver
{
public:
enum LinearSolver {LS_EigenLU, LS_Umfpack, LS_MUMPS};
typedef Eigen::VectorXd VectorD;
typedef Eigen::SparseMatrix<double> SMatrixD;
typedef Eigen::Triplet<double> Triplet;
/// Default constructor
NewtonSolver(const double _eps = 1e-6, const double _eps_line_search = 1e-9, const int _max_iters = 200, const double _alpha_ls=0.2, const double _beta_ls = 0.6)
: eps_(_eps), eps_ls_(_eps_line_search), max_iters_(_max_iters), alpha_ls_(_alpha_ls), beta_ls_(_beta_ls), solver_type_(LS_EigenLU), constant_hessian_structure_(false)
{
//#if COMISO_SUITESPARSE_AVAILABLE
// solver_type_ = LS_Umfpack;
//#endif
}
// solve without linear constraints
int solve(NProblemInterface* _problem)
{
SMatrixD A(0,_problem->n_unknowns());
VectorD b(VectorD::Index(0));
return solve(_problem, A, b);
}
// solve with linear constraints
// Warning: so far only feasible starting points with (_A*_problem->initial_x() == b) are supported!
// Extension to infeasible starting points is planned
int solve(NProblemInterface* _problem, const SMatrixD& _A, const VectorD& _b);
// select internal linear solver
void set_linearsolver(LinearSolver _st)
{
solver_type_ = _st;
}
protected:
bool factorize(NProblemInterface* _problem, const SMatrixD& _A,
const VectorD& _b, const VectorD& _x, double& _regularize_hessian,
double& _regularize_constraints, const bool _first_factorization);
double backtracking_line_search(NProblemInterface* _problem, VectorD& _x,
VectorD& _g, VectorD& _dx, double& _newton_decrement, double& _fx,
const double _t_start = 1.0);
void analyze_pattern(SMatrixD& _KKT);
bool numerical_factorization(SMatrixD& _KKT);
void solve_kkt_system(const VectorD& _rhs, VectorD& _dx);
// deprecated function!
// solve
int solve(NProblemGmmInterface* _problem);
// deprecated function!
// solve specifying parameters
int solve(NProblemGmmInterface* _problem, int _max_iter, double _eps)
{
max_iters_ = _max_iter;
eps_ = _eps;
return solve(_problem);
}
// deprecated function!
bool& constant_hessian_structure() { return constant_hessian_structure_; }
protected:
double* P(std::vector<double>& _v)
{
if( !_v.empty())
return ((double*)&_v[0]);
else
return 0;
}
private:
double eps_;
double eps_ls_;
int max_iters_;
double alpha_ls_;
double beta_ls_;
VectorD x_ls_;
LinearSolver solver_type_;
// cache KKT Matrix
SMatrixD KKT_;
// Sparse LU decomposition
Eigen::SparseLU<SMatrixD> lu_solver_;
#if COMISO_SUITESPARSE_AVAILABLE
Eigen::UmfPackLU<SMatrixD> umfpack_solver_;
#endif
// deprecated
bool constant_hessian_structure_;
};
//=============================================================================
} // namespace COMISO
//=============================================================================
#endif // ACG_NEWTONSOLVER_HH defined
//=============================================================================
| 26.975155
| 171
| 0.61225
|
shubhMaheshwari
|
6a15419fccea3b82d34ba4bc71ba7283e8512d91
| 1,684
|
hpp
|
C++
|
include/eve/algo/mismatch.hpp
|
microblink/eve
|
26d50d59190d3e2817c3ca95614e3e74f6c6f30a
|
[
"MIT"
] | null | null | null |
include/eve/algo/mismatch.hpp
|
microblink/eve
|
26d50d59190d3e2817c3ca95614e3e74f6c6f30a
|
[
"MIT"
] | null | null | null |
include/eve/algo/mismatch.hpp
|
microblink/eve
|
26d50d59190d3e2817c3ca95614e3e74f6c6f30a
|
[
"MIT"
] | null | null | null |
//==================================================================================================
/*
EVE - Expressive Vector Engine
Copyright : EVE Contributors & Maintainers
SPDX-License-Identifier: MIT
*/
//==================================================================================================
#pragma once
#include <eve/algo/concepts.hpp>
#include <eve/algo/find.hpp>
#include <eve/algo/traits.hpp>
#include <eve/algo/views/zip.hpp>
#include <eve/function/is_equal.hpp>
#include <utility>
namespace eve::algo
{
template <typename TraitsSupport>
struct mismatch_ : TraitsSupport
{
template <zipped_range_pair R, typename P>
EVE_FORCEINLINE auto operator()(R&& r, P p) const
{
return algo::find_if_not[TraitsSupport::get_traits()]
(std::forward<R>(r), apply_to_zip_pair{p});
}
template <zipped_range_pair R>
EVE_FORCEINLINE auto operator()(R&& r) const
{
auto rezipped = r[common_type];
auto rezipped_res = operator()(rezipped, eve::is_equal);
return unalign(r.begin()) + (rezipped_res - rezipped.begin());
}
template <typename R1, typename R2, typename P>
requires zip_to_range<R1, R2>
EVE_FORCEINLINE auto operator()(R1&& r1, R2&& r2, P p) const
{
return operator()(views::zip(std::forward<R1>(r1), std::forward<R2>(r2)), p);
}
template <typename R1, typename R2>
requires zip_to_range<R1, R2>
EVE_FORCEINLINE auto operator()(R1&& r1, R2&& r2) const
{
return operator()(views::zip(std::forward<R1>(r1), std::forward<R2>(r2)));
}
};
inline constexpr auto mismatch = function_with_traits<mismatch_>[find_if.get_traits()];
}
| 30.071429
| 100
| 0.587292
|
microblink
|
6a1bb2310ac37e47635649a2ad509a1ddd0bae43
| 1,097
|
cpp
|
C++
|
Charpter07/subset.cpp
|
zhangdan0602/DailyAlgorithm
|
2969ed143b16c5c655d39ff3a86ee5f0cabb704a
|
[
"Apache-2.0"
] | null | null | null |
Charpter07/subset.cpp
|
zhangdan0602/DailyAlgorithm
|
2969ed143b16c5c655d39ff3a86ee5f0cabb704a
|
[
"Apache-2.0"
] | null | null | null |
Charpter07/subset.cpp
|
zhangdan0602/DailyAlgorithm
|
2969ed143b16c5c655d39ff3a86ee5f0cabb704a
|
[
"Apache-2.0"
] | null | null | null |
#include <cstdio>
using namespace std;
int A[10], B[10];
//1.增量法
void print_subset1(int n, int *A, int cur)
{
for (int i = 0; i < cur; i++)
{
printf("%d ", A[i]);
}
printf("\n");
int s = cur ? A[cur - 1] + 1 : 0;
for (int i = s; i < n; i++)
{
A[cur] = i;
print_subset1(n, A, cur + 1);
}
}
//2.位向量
void print_subset2(int n, int *B, int cur)
{
if (cur == n)
{
for (int i = 0; i < cur; i++)
{
if (B[i])
{
printf("%d ", i);
}
}
printf("\n");
return;
}
B[cur] = 1;
print_subset2(n, B, cur + 1);
B[cur] = 0;
print_subset2(n, B, cur + 1);
}
//3.二进制法
void print_subset3(int n, int s)
{
for (int i = 0; i < n; i++)
{
if (s & (1 << i))
{
printf("%d ", i);
}
}
printf("\n");
}
int main()
{
int n;
scanf("%d", &n);
print_subset1(n, A, 0);
print_subset2(n, B, 0);
for (int i = 0; i < (1 << n); i++)
{
print_subset3(n, i);
}
return 0;
}
| 15.898551
| 42
| 0.386509
|
zhangdan0602
|
6a1fade24b89750740fa84b852da1337c28b7c33
| 11,830
|
cpp
|
C++
|
lib/MaskFaults.cpp
|
utahfmr/vulfi.github.io
|
6cd1a4caf3e2c556913fee55695327592b0589d6
|
[
"NCSA"
] | null | null | null |
lib/MaskFaults.cpp
|
utahfmr/vulfi.github.io
|
6cd1a4caf3e2c556913fee55695327592b0589d6
|
[
"NCSA"
] | null | null | null |
lib/MaskFaults.cpp
|
utahfmr/vulfi.github.io
|
6cd1a4caf3e2c556913fee55695327592b0589d6
|
[
"NCSA"
] | null | null | null |
#include <time.h>
#include <math.h>
#include "Common.h"
#include "MaskFaults.h"
using namespace llvm;
using namespace std;
Instruction* MaskFaults::performInstrumentation(Module *M, CLData* Cl, FunctionList* Fl, Instruction* instr, Common::VectorFSType vftype, int idxLimit){
// Clone the target instruction. This is required because when
// replaceAllUses() is applied on the target instruction \var instr,
// it does not create a self-reference loop on the call to injectSoftError()
// instruction.
vector<Value*> arglist;
// arg#2 - name of the instruction
string instrString;
llvm::raw_string_ostream rso(instrString);
instr->print(rso);
Constant *instrName = ConstantDataArray::getString(instr->getType()->getContext(),instrString,true);
GlobalVariable *instrNameGlobal = new GlobalVariable(*M,instrName->getType(),true,
GlobalValue::InternalLinkage,instrName,"instrname");
Constant *nullvalue = Constant::getNullValue(IntegerType::getInt32Ty(instr->getType()->getContext()));
vector<Constant*> gepParams;
gepParams.push_back(nullvalue);
gepParams.push_back(nullvalue);
// Constant *instrNamePtr = ConstantExpr::getGetElementPtr(instrNameGlobal,gepParams);
Constant *instrNamePtr = ConstantExpr::getGetElementPtr(instrName->getType(),instrNameGlobal,gepParams,false,NULL);
arglist.push_back(instrNamePtr);
// arg# 3
if(vftype == Common::FST_EXIDX || vftype == Common::FST_INSIDX){
Value* arg3 = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),idxLimit,false);
arglist.push_back(arg3);
} else if(vftype == Common::FST_SHUFIDX){
Value* arg3 = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),idxLimit,false);
arglist.push_back(arg3);
} else {
Value* arg3 = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),0,false);
arglist.push_back(arg3);
}
// if language in OpenCL, add the 4th, 5th, and 6th arguments
// which are the last three arguments of the OCL kernel function
string lang = Cl->getLang();
Function* parentFn = instr->getParent()->getParent();
if(parentFn->arg_empty() || parentFn->arg_size() < 4){
errs() << "Error: A target OpenCL kernel should have at least three arguments!";
errs() << "Function name: " << parentFn->getName() << "\n";
exit(-1);
}
size_t argsz = parentFn->arg_size();
unsigned counter = 0;
for(Function::arg_iterator argit = parentFn->arg_begin(); argit != parentFn->arg_end();argit++){
Value* lastarg = &*argit;
if(counter==argsz-4 || counter==argsz-3 || counter==argsz-2 || counter==argsz-1){
arglist.push_back(lastarg);
#ifdef DEBUG
errs() << "\n Found argument: " << *lastarg << "\n";
#endif
}
counter++;
}
// perform instrumentation
if(vftype == Common::FST_INSIDX || vftype == Common::FST_EXIDX){
Function* fnRef = Fl->getFiFnVectorIdx();
if(fnRef){
Instruction* instrClone = instr->clone();
instrClone->insertAfter(instr);
Value* data = instrClone;
// arg1
arglist.insert(arglist.begin(),data);
CallInst* callInst = NULL;
Instruction* nextInstr = FaultInjector::getNextInstr(M,instrClone);
if(nextInstr){
callInst = CallInst::Create(fnRef,arglist,"injectErrorVectorIdx",nextInstr);
callInst->setCallingConv(CallingConv::C);
} else {
callInst = CallInst::Create(fnRef,arglist,"injectErrorVectorIdx",instr->getParent());
callInst->setCallingConv(CallingConv::C);
}
if(!callInst){
errs() << "\nError: reference to call instruction can't be null here\n";
exit(-1);
}
instr->replaceAllUsesWith(instrClone);
instr->eraseFromParent();
return callInst;
}
}
// TODO: implementation for shufflevector
if(vftype == Common::FST_SHUFIDX){
ShuffleVectorInst* shufinstr = dyn_cast<ShuffleVectorInst>(instr);
Value *op0 = shufinstr->getOperand(0);
Constant* mask = shufinstr->getMask();
int veclen = op0->getType()->getVectorNumElements();
int masklen = (int) mask->getType()->getVectorNumElements();
// create clone
Instruction* shuffleclone = shufinstr->clone();
shuffleclone->setName("shuffclone");
shuffleclone->insertAfter(shufinstr);
// create the shufflevector which returns all the elements from both the operands inorder
vector<Constant*> constList;
for(int i=0;i<2*veclen;i++){
Constant* tempMask = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),i,false);
constList.push_back(tempMask);
}
Constant* newmask = ConstantVector::get(constList);
Instruction* newshuffle = shuffleclone->clone();
newshuffle->setOperand(2,newmask);
newshuffle->setName("shuffall");
newshuffle->insertAfter(shuffleclone);
// 1. instrument the original mask for fault injection
vector<Instruction*> corruptMaskList;
vector<Value*>::iterator it = arglist.begin();
Constant* dummy = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),0,false);
arglist.insert(it,dummy); // arg1 - a placeholder, gets updated in the loop
// arg# 3
int tempIdxLimit = (int)log2((float)2*veclen);
Constant* idxLimitVal = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),tempIdxLimit,false);
arglist[2]=idxLimitVal;
Instruction* nextInstr = FaultInjector::getNextInstr(M,newshuffle);
CallInst* callInst = NULL;
Function* fnRef = Fl->getFiFnVectorIdx();
for(int i=0;i<masklen;i++){
if(i>0 && isBroadcast(shufinstr)) continue;
int tempMaskVal = shufinstr->getMaskValue(mask,i);
Constant* tempMask = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),tempMaskVal,false);
arglist[0]=tempMask;
if(fnRef){
if(nextInstr){
callInst = CallInst::Create(fnRef,arglist,"injectErrorVectorIdx",nextInstr);
callInst->setCallingConv(CallingConv::C);
} else {
callInst = CallInst::Create(fnRef,arglist,"injectErrorVectorIdx",instr->getParent());
callInst->setCallingConv(CallingConv::C);
}
if(!callInst){
errs() << "\nError: reference to call instruction can't be null here\n";
exit(-1);
}
corruptMaskList.push_back(callInst);
}
}
// 2. extract the new element from the "allelements" based on new mask
// 3. insert the new element in the shufflevector
Instruction* insertinto = shuffleclone;
for(int i=0;i<masklen;i++){
ExtractElementInst* newextract;
if(nextInstr){
if(i>0 && isBroadcast(shufinstr)) {
newextract = \
ExtractElementInst::Create(newshuffle,corruptMaskList[0],"extractusingcorruptmask",nextInstr);
} else {
newextract = \
ExtractElementInst::Create(newshuffle,corruptMaskList[i],"extractusingcorruptmask",nextInstr);
}
Constant* idx = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),i,false);
insertinto = \
InsertElementInst::Create(insertinto,newextract,idx,"newinsert",nextInstr);
} else {
if(i>0 && isBroadcast(shufinstr)) {
newextract = \
ExtractElementInst::Create(newshuffle,corruptMaskList[0],"extractusingcorruptmask",instr->getParent());
} else {
newextract = \
ExtractElementInst::Create(newshuffle,corruptMaskList[i],"extractusingcorruptmask",instr->getParent());
}
Constant* idx = ConstantInt::get(IntegerType::getInt32Ty(instr->getType()->getContext()),i,false);
insertinto = \
InsertElementInst::Create(insertinto,newextract,idx,"newinsert",instr->getParent());
}
}
shufinstr->replaceAllUsesWith(insertinto);
shufinstr->eraseFromParent();
}
return NULL;
}
int flipBit(void* data, int bytesz, int bitPos){
long long dest = 0;
// Copy source data to a 64-bit integer
memcpy((void*)&dest,data,bytesz);
if ((dest>>bitPos)&0x1){
dest = dest & (~((long long)0x1 << (bitPos)));
} else{
dest = dest | ((long long) 0x1 << (bitPos));
}
// Copy back the data with a random bit flipped into the source
memcpy(data,(void*)&dest,bytesz);
return bitPos; // A single-bit error successfully injected!!
}
bool MaskFaults::isBroadcast(ShuffleVectorInst* shufInstr){
if(shufInstr){
if(dyn_cast<Constant>(shufInstr->getMask())){
Constant* constMask = shufInstr->getMask();
if(constMask->getType()->isVectorTy()){
int len = (int) constMask->getType()->getVectorNumElements();
int maskValatZeroIdx = shufInstr->getMaskValue(constMask,0);
for(int i=1;i<len;i++){
int maskVal = shufInstr->getMaskValue(constMask,i);
#ifdef DEBUG
errs() << "\nThe value of the mask element at position: " << i << " is: " << maskVal;
#endif
if(maskVal != maskValatZeroIdx){
return false;
}
}
}
}
}
return true;
}
void MaskFaults::processMaskInstr(Module* M, CLData* Cl, FunctionList* Fl, Instruction* instr){
srand(time(NULL));
Instruction* maskInstr = NULL;
ExtractElementInst* extractinstr=dyn_cast<ExtractElementInst>(instr);
InsertElementInst* insertinstr=dyn_cast<InsertElementInst>(instr);
ShuffleVectorInst* shufinstr=dyn_cast<ShuffleVectorInst>(instr);
if(extractinstr){
Type* OpTy = extractinstr->getOperand(0)->getType();
if(OpTy->isVectorTy()){
Value* exOpVal = extractinstr->getIndexOperand();
maskInstr = BinaryOperator::Create(BinaryOperator::Or,exOpVal,exOpVal,"extractIdx",instr);
if(maskInstr==NULL){
errs() << "\nError:Creation of Or instruction failed!\n";
exit(-1);
}
int idxLimit = (int)log2((float)OpTy->getVectorNumElements());
#ifdef DEBUG
errs () << "\nNumber of element in the ExtractElement instruction is: " << idxLimit;
#endif
Instruction* callinst = this->performInstrumentation(M,Cl,Fl,maskInstr,Common::FST_EXIDX,idxLimit);
if(callinst) extractinstr->setOperand(1,callinst);
} else {
errs() << "\nFatal Error: First operand of an ExtractElement should always be of vector type!\n";
exit(-1);
}
} else if(insertinstr){
Type* OpTy = insertinstr->getOperand(0)->getType();
if(OpTy->isVectorTy()){
Value* insOpVal = insertinstr->getOperand(2);
maskInstr = BinaryOperator::Create(BinaryOperator::Or,insOpVal,insOpVal,"insertIdx",instr);
if(maskInstr==NULL){
errs() << "\nError:Creation of Or instruction failed!\n";
exit(-1);
}
int idxLimit = (int)log2((float)OpTy->getVectorNumElements());
Instruction* callinst = this->performInstrumentation(M,Cl,Fl,maskInstr,Common::FST_INSIDX,idxLimit);
if(callinst) insertinstr->setOperand(2,callinst);
} else {
errs() << "\nFatal Error: First operand of an InsertElement should always be of vector type!\n";
exit(-1);
}
}
else if(shufinstr){
// check if it is a broadcast shuffle
this->performInstrumentation(M,Cl,Fl,instr,Common::FST_SHUFIDX,0);
}
}
bool MaskFaults::injectFaults(Module *M, set<Instruction*> instrList,
CLData* Cl, FunctionList *Fl){
errs() << "\nInitiating mask fault injection instrumentation..\n";
this->module = M;
for(set<Instruction*>::iterator si=instrList.begin();
si!=instrList.end();++si){
Instruction* currentInstr = *si;
if(dyn_cast<ExtractElementInst>(currentInstr) ||
dyn_cast<InsertElementInst>(currentInstr) ||
dyn_cast<ShuffleVectorInst>(currentInstr)){
processMaskInstr(M,Cl,Fl,currentInstr);
} else {
Type::TypeID tyID = currentInstr->getType()->getTypeID();
if(tyID==Type::IntegerTyID ||
tyID==Type::FloatTyID ||
tyID==Type::DoubleTyID){
FaultInjector::injectNonVectorFaults(M,currentInstr,Cl,Fl);
} else if(tyID==Type::VectorTyID){
FaultInjector::injectVectorFaults(M,currentInstr,Cl,Fl);
}
}
}
if(Cl->getInstMainFlag()){
FaultInjector::insertCalltoPrintinMain(Cl,Fl);
}
return true;
}
| 37.436709
| 152
| 0.688588
|
utahfmr
|
6a2193c966cc392225fa89aa9696ae19840c73d3
| 1,559
|
hpp
|
C++
|
src/net/Channel.hpp
|
Hanwn/Shoot
|
6d5277f42575c146be11d24675837d992b5c0e89
|
[
"MIT"
] | null | null | null |
src/net/Channel.hpp
|
Hanwn/Shoot
|
6d5277f42575c146be11d24675837d992b5c0e89
|
[
"MIT"
] | null | null | null |
src/net/Channel.hpp
|
Hanwn/Shoot
|
6d5277f42575c146be11d24675837d992b5c0e89
|
[
"MIT"
] | null | null | null |
#ifndef CHANNEL_H_
#define CHANNEL_H_
#include <functional>
#include <sys/epoll.h>
#include "EventLoop.hpp"
#include "logger.h"
enum class channelStatus{
NEW = 1,
ADD = 3,
DEL = 2
};
// Channel 的生命周期由TCPConnection控制
// Channel 不拥有任何资源,无需在析构函数中释放
class EventLoop;
class Channel {
public:
using callback = std::function<void()>;
Channel(EventLoop* _loop, int fd);
~Channel();
public:
void set_read_callback(callback cb) {
read_handler_ = cb;
}
void set_write_callback(callback cb) {
write_handler_ = cb;
}
void set_error_callback(callback cb) {
// LOG<<"channel error callback";
error_handler_ = cb;
}
void set_close_callback(callback cb) {
close_handler_ = cb;
}
void set_revents(int _revent) {
revent_ = _revent;
}
void enable_read();
void enable_write();
void disable_read();
void disable_write();
void disalbel_all();
public:
void set_events(int op);
int get_events();
int get_fd();
channelStatus get_status();
void set_status(channelStatus _status);
public:
void update();
void remove();
// STAR: 这个函数作为一个channel的回调,非常重要
void handle_events();
private:
EventLoop* loop_;
int event_;
int revent_;
int fd;
static const int none_event;
static const int read_event;
static const int write_event;
channelStatus status;
callback read_handler_;
callback write_handler_;
callback error_handler_;
callback close_handler_;
};
#endif
| 18.127907
| 43
| 0.652341
|
Hanwn
|
6a2a7844a72f05e8afe715612b9a6e2227941315
| 4,220
|
cpp
|
C++
|
Source/Qurses/clear.cpp
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 9
|
2016-05-27T01:00:39.000Z
|
2021-04-01T08:54:46.000Z
|
Source/Qurses/clear.cpp
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 1
|
2016-03-03T22:54:08.000Z
|
2016-03-03T22:54:08.000Z
|
Source/Qurses/clear.cpp
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 4
|
2016-05-27T01:00:43.000Z
|
2018-08-19T08:47:49.000Z
|
/* Public Domain Curses */
#include "Qurses/curspriv.h"
RCSID("$Id: clear.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $")
/*man-start**************************************************************
Name: clear
Synopsis:
int clear(void);
int wclear(WINDOW *win);
int erase(void);
int werase(WINDOW *win);
int clrtobot(void);
int wclrtobot(WINDOW *win);
int clrtoeol(void);
int wclrtoeol(WINDOW *win);
Description:
erase() and werase() copy blanks (i.e. the background chtype) to
every cell of the window.
clear() and wclear() are similar to erase() and werase(), but
they also call clearok() to ensure that the the window is
cleared on the next wrefresh().
clrtobot() and wclrtobot() clear the window from the current
cursor position to the end of the window.
clrtoeol() and wclrtoeol() clear the window from the current
cursor position to the end of the current line.
Return Value:
All functions return OK on success and ERR on error.
Portability X/Open BSD SYS V
clear Y Y Y
wclear Y Y Y
erase Y Y Y
werase Y Y Y
clrtobot Y Y Y
wclrtobot Y Y Y
clrtoeol Y Y Y
wclrtoeol Y Y Y
**man-end****************************************************************/
//------------------------------------------------------------------------------
int wclrtoeol( WINDOW* win )
{
__QCS_FCONTEXT( "wclrtoeol" );
int x, y, minx;
chtype blank, *ptr;
if( !win )
{
return ERR;
}
y = win->_cury;
x = win->_curx;
// wrs (4/10/93) account for window background
blank = win->_bkgd;
for( minx = x, ptr = &win->_y[y][x]; minx < win->_maxx; minx++, ptr++ )
{
*ptr = blank;
}
if( x < win->_firstch[ y ] || win->_firstch[ y ] == _NO_CHANGE )
{
win->_firstch[y] = x;
}
win->_lastch[ y ] = win->_maxx - 1;
PDC_sync( win );
return 0;
}
//------------------------------------------------------------------------------
int clrtoeol( void )
{
__QCS_FCONTEXT( "clrtoeol" );
return wclrtoeol( stdscr );
}
//------------------------------------------------------------------------------
int wclrtobot( WINDOW* win )
{
__QCS_FCONTEXT( "wclrtobot" );
int savey = win->_cury;
int savex = win->_curx;
if( !win )
{
return ERR;
}
// should this involve scrolling region somehow ?
if( win->_cury + 1 < win->_maxy )
{
win->_curx = 0;
win->_cury++;
for(; win->_maxy > win->_cury; win->_cury++ )
{
wclrtoeol( win );
}
win->_cury = savey;
win->_curx = savex;
}
wclrtoeol( win );
PDC_sync( win );
return 0;
}
//------------------------------------------------------------------------------
int clrtobot( void )
{
__QCS_FCONTEXT( "clrtobot" );
return wclrtobot( stdscr );
}
//------------------------------------------------------------------------------
int werase( WINDOW* win )
{
__QCS_FCONTEXT( "werase" );
if( wmove( win, 0, 0 ) == ERR )
{
return ERR;
}
return wclrtobot( win );
}
//------------------------------------------------------------------------------
int erase( void )
{
__QCS_FCONTEXT( "erase" );
return werase( stdscr);
}
//------------------------------------------------------------------------------
int wclear( WINDOW* win )
{
__QCS_FCONTEXT( "wclear" );
if( !win )
{
return ERR;
}
win->_clear = TRUE;
return werase( win );
}
//------------------------------------------------------------------------------
int clear( void )
{
__QCS_FCONTEXT( "clear" );
return wclear( stdscr );
}
| 23.977273
| 80
| 0.395972
|
mfaithfull
|
6a2e3fe1cb325410fc11897508a74112d51b4f02
| 2,195
|
cpp
|
C++
|
src/upcore/src/cuchar/u8stou32slen.cpp
|
upcaste/upcaste
|
8174a2f40e7fde022806f8d1565bb4a415ecb210
|
[
"MIT"
] | 1
|
2018-09-17T20:50:14.000Z
|
2018-09-17T20:50:14.000Z
|
src/upcore/src/cuchar/u8stou32slen.cpp
|
jwtowner/upcaste
|
8174a2f40e7fde022806f8d1565bb4a415ecb210
|
[
"MIT"
] | null | null | null |
src/upcore/src/cuchar/u8stou32slen.cpp
|
jwtowner/upcaste
|
8174a2f40e7fde022806f8d1565bb4a415ecb210
|
[
"MIT"
] | null | null | null |
//
// Upcaste Performance Libraries
// Copyright (C) 2012-2013 Jesse W. Towner
//
// 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 <up/cuchar.hpp>
#include <up/cassert.hpp>
#include "cuchar_internal.inl"
namespace up
{
LIBUPCOREAPI
size_t u8stou32slen(char const* s) noexcept {
assert(s);
unsigned char const* u8s = reinterpret_cast<unsigned char const*>(s);
unsigned char octet;
ssize_t i, length;
size_t retval = 0;
for (;;) {
// read start of next character sequence
octet = *u8s;
if (!octet) {
break;
}
++retval;
++u8s;
// ascii fast-path
length = detail::u8_sequence_length_table[octet];
if (length <= 1) {
continue;
}
// decode rest of utf-8 sequence
for (i = length - 1; i > 0; --i, ++u8s) {
octet = *u8s;
if (!detail::u8_is_trail(octet)) {
break;
}
}
}
return retval;
}
}
| 32.761194
| 77
| 0.607745
|
upcaste
|
6a317138f65aed04fb6550ceeedaffd5b64aa362
| 1,447
|
cpp
|
C++
|
plugins/sdlinput/src/mouse/translate_motion_event.cpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | 2
|
2016-01-27T13:18:14.000Z
|
2018-05-11T01:11:32.000Z
|
plugins/sdlinput/src/mouse/translate_motion_event.cpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | null | null | null |
plugins/sdlinput/src/mouse/translate_motion_event.cpp
|
cpreh/spacegameengine
|
313a1c34160b42a5135f8223ffaa3a31bc075a01
|
[
"BSL-1.0"
] | 3
|
2018-05-11T01:11:34.000Z
|
2021-04-24T19:47:45.000Z
|
// Copyright Carl Philipp Reh 2006 - 2019.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <sge/input/mouse/axis_code.hpp>
#include <sge/input/mouse/shared_ptr.hpp>
#include <sge/input/mouse/event/axis.hpp>
#include <sge/sdlinput/mouse/make_axis.hpp>
#include <sge/sdlinput/mouse/translate_motion_event.hpp>
#include <awl/event/base.hpp>
#include <awl/event/container.hpp>
#include <fcppt/make_unique_ptr.hpp>
#include <fcppt/unique_ptr_to_base.hpp>
#include <fcppt/config/external_begin.hpp>
#include <SDL_events.h>
#include <cstdint>
#include <fcppt/config/external_end.hpp>
awl::event::container sge::sdlinput::mouse::translate_motion_event(
sge::input::mouse::shared_ptr const &_mouse, SDL_MouseMotionEvent const &_event)
{
awl::event::container result{};
auto const add_event(
[&result, &_mouse](std::int32_t const _value, sge::input::mouse::axis_code const _code)
{
if (_value != 0)
{
result.push_back(fcppt::unique_ptr_to_base<awl::event::base>(
fcppt::make_unique_ptr<sge::input::mouse::event::axis>(
_mouse, sge::sdlinput::mouse::make_axis(_code), _value)));
}
});
add_event(_event.xrel, sge::input::mouse::axis_code::x);
add_event(_event.yrel, sge::input::mouse::axis_code::y);
return result;
}
| 34.452381
| 93
| 0.695232
|
cpreh
|
6a337e640e6c77c075e6715a1fdba5986ce3a14a
| 274
|
cpp
|
C++
|
Road-of-Gold/Road-of-Gold/drawPlanet.cpp
|
SKN-JP/Road_of_gold
|
f9646656662f38aa292d8b3cdb5be234eb946212
|
[
"MIT"
] | 14
|
2017-07-11T13:59:50.000Z
|
2017-09-07T01:06:24.000Z
|
Road-of-Gold/Road-of-Gold/drawPlanet.cpp
|
SKN-JP/Road_of_gold
|
f9646656662f38aa292d8b3cdb5be234eb946212
|
[
"MIT"
] | 10
|
2017-09-25T12:56:05.000Z
|
2017-10-20T07:59:06.000Z
|
Road-of-Gold/Road-of-Gold/drawPlanet.cpp
|
sknjpn/Road-of-Gold
|
f9646656662f38aa292d8b3cdb5be234eb946212
|
[
"MIT"
] | 3
|
2017-08-11T15:54:21.000Z
|
2017-08-30T10:20:42.000Z
|
#include"Planet.h"
#include"Display.h"
void drawPlanet()
{
for (int i = 0; i < 2; ++i) {
const auto transformer = tinyCamera.createTransformer(i);
planet.mapTexture.resized(360_deg, 180_deg).drawAt(0, 0);
Graphics2D::SetSamplerState(SamplerState::ClampLinear);
}
}
| 22.833333
| 59
| 0.711679
|
SKN-JP
|
6a3a0b29d80f7ac633c725bf1b85c046b31adc60
| 15,966
|
hpp
|
C++
|
lib/winss/supervise/supervise.hpp
|
taylorb-microsoft/winss
|
ede93f84a5d9585502db5190f2ec6365858f695a
|
[
"Apache-2.0"
] | 52
|
2017-01-05T23:39:38.000Z
|
2020-06-04T03:00:11.000Z
|
lib/winss/supervise/supervise.hpp
|
morganstanley/winss
|
ede93f84a5d9585502db5190f2ec6365858f695a
|
[
"Apache-2.0"
] | 24
|
2017-01-05T05:07:34.000Z
|
2018-03-09T00:50:58.000Z
|
lib/winss/supervise/supervise.hpp
|
morganstanley/winss
|
ede93f84a5d9585502db5190f2ec6365858f695a
|
[
"Apache-2.0"
] | 7
|
2016-12-27T20:55:20.000Z
|
2018-03-09T00:32:19.000Z
|
/*
* Copyright 2016-2017 Morgan Stanley
*
* 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 LIB_WINSS_SUPERVISE_SUPERVISE_HPP_
#define LIB_WINSS_SUPERVISE_SUPERVISE_HPP_
#include <windows.h>
#include <filesystem>
#include <vector>
#include <chrono>
#include <string>
#include "easylogging/easylogging++.hpp"
#include "../handle_wrapper.hpp"
#include "../windows_interface.hpp"
#include "../filesystem_interface.hpp"
#include "../wait_multiplexer.hpp"
#include "../not_owning_ptr.hpp"
#include "../environment.hpp"
#include "../path_mutex.hpp"
#include "../process.hpp"
#include "../utils.hpp"
namespace fs = std::experimental::filesystem;
namespace winss {
/**
* The state of the supervisor.
*/
struct SuperviseState {
std::chrono::system_clock::time_point time;
std::chrono::system_clock::time_point last;
bool is_run_process;
bool is_up;
bool initially_up;
int up_count;
int remaining_count;
int exit_code;
DWORD pid;
};
/**
* The supervisor events which can occur.
*/
enum SuperviseNotification {
UNKNOWN, /**< Unknown notification. */
START, /**< Supervisor starting. */
RUN, /**< Run process has started. */
END, /**< Run process has ended. */
BROKEN, /** Permanent failure. */
FINISHED, /**< Finish process has ended. */
EXIT /**< Supervisor exiting. */
};
/**
* The supervisor listener.
*/
class SuperviseListener {
public:
/**
* Supervisor listener handler.
*
* \param[in] notification The event which occurred.
* \param[in] state The current state of the supervisor.
* \return True if continue to listen otherwise false.
*/
virtual bool Notify(SuperviseNotification notification,
const SuperviseState& state) = 0;
/**
* Default virtual destructor.
*/
virtual ~SuperviseListener() {}
};
/**
* The supervisor class template.
*
* \tparam TMutex The mutex implementation type.
* \tparam TProcess The process implementation type.
*/
template<typename TMutex, typename TProcess>
class SuperviseTmpl {
protected:
/** The event multiplexer for the supervisor. */
winss::NotOwningPtr<winss::WaitMultiplexer> multiplexer;
TMutex mutex; /**< The supervisor global mutex. */
TProcess process; /**< The supervised process. */
fs::path service_dir; /**< The service directory. */
SuperviseState state{}; /**< The current supervised state. */
/** The supervisor listeners. */
std::vector<winss::NotOwningPtr<winss::SuperviseListener>> listeners;
int exiting = 0; /**< The exiting state. */
bool waiting = false; /**< The waiting state. */
/**
* Initializes the supervisor.
*/
virtual void Init() {
if (mutex.HasLock()) {
return;
}
if (!FILESYSTEM.ChangeDirectory(service_dir)) {
LOG(ERROR)
<< "The directory '"
<< service_dir
<< "' does not exist.";
multiplexer->Stop(kFatalExitCode);
return;
}
if (!mutex.Lock()) {
multiplexer->Stop(kMutexTaken);
return;
}
state.time = std::chrono::system_clock::now();
state.last = state.time;
if (FILESYSTEM.FileExists(kDownFile)) {
state.initially_up = false;
state.remaining_count = 0;
}
NotifyAll(START);
Triggered(false);
}
/**
* Gets the finish timeout value.
*
* This will read the finish-timeout file if it exists.
*
* \return The finish timeout in milliseconds.
*/
virtual DWORD GetFinishTimeout() const {
std::string timeout_finish = FILESYSTEM.Read(kTimeoutFinishFile);
if (timeout_finish.empty()) {
return kCommandTimeout;
}
return std::strtoul(timeout_finish.data(), nullptr, 10);
}
/**
* Starts the process defined in the given file.
*
* \param[in] file_name The file which contains the process and arguments.
* \return True if the process started otherwise false.
*/
virtual bool Start(const std::string& file_name) {
process.Close();
std::string cmd = FILESYSTEM.Read(file_name);
if (cmd.empty()) {
return false;
}
std::string expanded = winss::Utils::ExpandEnvironmentVariables(cmd);
winss::EnvironmentDir env_dir(service_dir / fs::path(kEnvDir));
winss::ProcessParams params{ expanded, true };
params.env = &env_dir;
bool created = process.Create(params);
state.pid = process.GetProcessId();
return created;
}
/**
* Starts the run file process.
*
* \return True if the process started otherwise false.
*/
virtual bool StartRun() {
if (state.remaining_count == 0) {
// Return true to prevent false positive unable to spawn message.
return true;
}
VLOG(2) << "Starting run process";
state.up_count++;
state.is_run_process = true;
WINDOWS.SetEnvironmentVariable(kRunExitCodeEnvName, nullptr);
if (Start(kRunFile)) {
multiplexer->AddTriggeredCallback(process.GetHandle(), [this](
winss::WaitMultiplexer& m, const winss::HandleWrapper& handle) {
this->Triggered(false);
});
state.is_run_process = true;
state.is_up = true;
state.exit_code = 0;
if (state.remaining_count > 0) {
state.remaining_count--;
}
NotifyAll(RUN);
return true;
}
return false;
}
/**
* Starts the finish file process.
*
* \return True if the process started otherwise false.
*/
virtual bool StartFinish() {
VLOG(2) << "Starting finish process";
state.is_run_process = false;
WINDOWS.SetEnvironmentVariable(kRunExitCodeEnvName,
std::to_string(state.exit_code).c_str());
if (Start(kFinishFile)) {
multiplexer->AddTriggeredCallback(process.GetHandle(), [this](
winss::WaitMultiplexer& m, const winss::HandleWrapper& handle) {
this->Triggered(false);
});
DWORD timeout = GetFinishTimeout();
if (timeout > 0) {
multiplexer->AddTimeoutCallback(timeout,
[this](winss::WaitMultiplexer&) {
Triggered(true);
}, kTimeoutGroup);
waiting = true;
}
state.is_up = true;
return true;
}
return false;
}
/**
* Notify all the listeners with the given event.
*
* \param[in] notification The notification event.
*/
virtual void NotifyAll(winss::SuperviseNotification notification) {
state.time = std::chrono::system_clock::now();
switch (notification) {
case RUN:
state.last = state.time;
break;
case END:
state.last = state.time;
break;
}
auto it = listeners.begin();
while (it != listeners.end()) {
if ((*it)->Notify(notification, state)) {
++it;
} else {
it = listeners.erase(it);
}
}
}
/**
* Event triggered handler.
*
* This will step the state machine forward.
*
* \param[in] timeout If the event was a timeout event.
*/
virtual void Triggered(bool timeout) {
if (waiting && !timeout) {
multiplexer->RemoveTimeoutCallback(kTimeoutGroup);
}
waiting = false;
int restart = 0;
DWORD wait = kBusyWait;
if (state.is_up) {
if (state.is_run_process) {
VLOG(2) << "Run process ended";
state.is_up = false;
state.pid = 0;
NotifyAll(END);
if (exiting) {
state.exit_code = kSignaledExitCode;
} else {
state.exit_code = process.GetExitCode();
}
if (!StartFinish()) {
restart = 2;
}
} else {
if (timeout) {
process.Terminate();
return;
}
VLOG(2) << "Finish process ended";
state.is_up = false;
state.pid = 0;
if (process.GetExitCode() == kDownExitCode) {
state.remaining_count = 0;
NotifyAll(BROKEN);
}
restart = 2;
}
} else if (!Complete()) {
if (!StartRun()) {
restart = 1;
wait = kRunFailedWait;
LOG(WARNING) << "Unable to spawn ./run - waiting 10 seconds";
}
}
if (restart > 1) {
NotifyAll(FINISHED);
}
if (restart && !Complete() && state.remaining_count != 0) {
VLOG(2) << "Waiting for: " << wait;
waiting = true;
multiplexer->AddTimeoutCallback(wait,
[this](winss::WaitMultiplexer&) {
Triggered(true);
}, kTimeoutGroup);
}
}
/**
* Tests exiting value.
*
* When the exiting value is 1 it will signal the multiplexer to stop
* and notify the listeners that the supervisor is about exit.
*
* \return True if exiting otherwise false.
*/
virtual bool Complete() {
switch (exiting) {
case 0:
return false;
case 1:
++exiting;
if (!multiplexer->IsStopping()) {
multiplexer->Stop(0);
}
NotifyAll(EXIT);
default:
return true;
}
}
/**
* Signal the supervisor to exit.
*/
virtual void Stop() {
if (exiting) {
return;
}
exiting = 1;
Down();
}
public:
static const int kMutexTaken = 100; /**< Service dir in use error. */
static const int kFatalExitCode = 111; /**< Something went wrong. */
static const int kSignaledExitCode = 256; /**< Signaled to exit. */
static const int kDownExitCode = 125; /**< Signal down. */
static const DWORD kCommandTimeout = 5000; /**< Default timeout 5s. */
static const DWORD kBusyWait = 1000; /**< Busy wait 1s. */
static const DWORD kRunFailedWait = 10000; /**< Run failed wait 10s. */
/** Mutex name. */
static constexpr const char kMutexName[10] = "supervise";
static constexpr const char kRunFile[4] = "run"; /**< Run file. */
/** Finish file. */
static constexpr const char kFinishFile[7] = "finish";
static constexpr const char kDownFile[5] = "down"; /**< Down file. */
static constexpr const char kEnvDir[4] = "env"; /**< Env directory. */
/** Timeout finish file. */
static constexpr const char kTimeoutFinishFile[15] = "timeout-finish";
/** The timeout group for the multiplexer. */
static constexpr const char kTimeoutGroup[10] = "supervise";
/** The environment variable to set with the exit code. */
static constexpr const char kRunExitCodeEnvName[24] =
"SUPERVISE_RUN_EXIT_CODE";
/**
* Supervise constructor.
*
* \param multiplexer The shared multiplexer.
* \param service_dir The service directory.
*/
SuperviseTmpl(winss::NotOwningPtr<winss::WaitMultiplexer> multiplexer,
const fs::path& service_dir) : multiplexer(multiplexer),
mutex(service_dir, kMutexName), service_dir(service_dir) {
state.is_run_process = true;
state.is_up = false;
state.initially_up = true;
state.up_count = 0;
state.remaining_count = -1;
state.exit_code = 0;
state.pid = 0;
multiplexer->AddInitCallback([this](winss::WaitMultiplexer&) {
this->Init();
});
multiplexer->AddStopCallback([this](winss::WaitMultiplexer&) {
this->Stop();
});
}
SuperviseTmpl(const SuperviseTmpl&) = delete; /**< No copy. */
SuperviseTmpl(SuperviseTmpl&&) = delete; /**< No move. */
/**
* Gets the current supervisor state.
*
* \return The supervisor state.
*/
virtual const SuperviseState& GetState() const {
return state;
}
/**
* Adds a supervisor listener to the list of listeners.
*
* \param[in] listener The listener to add.
*/
virtual void AddListener(
winss::NotOwningPtr<winss::SuperviseListener> listener) {
listeners.push_back(listener);
}
/**
* Signals the supervisor to go into the up state.
*/
virtual void Up() {
if (!mutex.HasLock() || exiting) {
return;
}
VLOG(3) << "Start supervised process if not started";
state.remaining_count = -1;
if (!state.is_up) {
Triggered(false);
}
}
/**
* Signals the supervisor to be in the up state and when the process
* exits then leave it down.
*/
virtual void Once() {
if (!mutex.HasLock() || exiting) {
return;
}
VLOG(3) << "Run supervised process once";
if (!state.is_up) {
state.remaining_count = 1;
Triggered(false);
} else {
state.remaining_count = 0;
}
}
/**
* Signals the supervisor to only run one if it is already running.
*/
virtual void OnceAtMost() {
if (!mutex.HasLock() || exiting) {
return;
}
VLOG(3) << "Run supervised process at least once";
state.remaining_count = 0;
}
/**
* Signals the supervisor to be in the down state.
*/
virtual void Down() {
if (!mutex.HasLock()) {
return;
}
state.remaining_count = 0;
Term();
}
/**
* Kills the supervised process.
*/
virtual void Kill() {
if (!mutex.HasLock()) {
return;
}
VLOG(3) << "Kill supervised process if not stopped";
if (state.is_up && state.is_run_process) {
process.Terminate();
}
}
/**
* Sends a CTRL+BREAK to the supervised process.
*/
virtual void Term() {
if (!mutex.HasLock()) {
return;
}
VLOG(3) << "Stop supervised process if not stopped";
if (state.is_up && state.is_run_process) {
process.SendBreak();
}
}
/**
* Signals the supervisor to exit.
*/
virtual void Exit() {
if (!mutex.HasLock() || exiting) {
return;
}
VLOG(3) << "Exit supervisor when supervised process goes down";
state.remaining_count = 0;
exiting = 1;
if (!state.is_up) {
Triggered(false);
}
}
SuperviseTmpl& operator=(const SuperviseTmpl&) = delete; /**< No copy. */
SuperviseTmpl& operator=(SuperviseTmpl&&) = delete; /**< No move. */
};
/**
* Concrete supervise implementation.
*/
typedef SuperviseTmpl<winss::PathMutex, winss::Process> Supervise;
} // namespace winss
#endif // LIB_WINSS_SUPERVISE_SUPERVISE_HPP_
| 27.766957
| 80
| 0.557748
|
taylorb-microsoft
|
6a3d291603d7b54addce65bfcfe98989d397fc48
| 876
|
hpp
|
C++
|
ares/ares/node/debug/tracer.hpp
|
moon-chilled/Ares
|
909fb098c292f8336d0502dc677050312d8b5c81
|
[
"0BSD"
] | 7
|
2020-07-25T11:44:39.000Z
|
2021-01-29T13:21:31.000Z
|
ares/ares/node/debug/tracer.hpp
|
jchw-forks/ares
|
d78298a1e95fd0ce65feabfd4f13b60e31210a7a
|
[
"0BSD"
] | null | null | null |
ares/ares/node/debug/tracer.hpp
|
jchw-forks/ares
|
d78298a1e95fd0ce65feabfd4f13b60e31210a7a
|
[
"0BSD"
] | 1
|
2021-03-22T16:15:30.000Z
|
2021-03-22T16:15:30.000Z
|
struct Tracer : Object {
DeclareClass(Tracer, "Tracer")
Tracer(string name = {}, string component = {}) : Object(name) {
_component = component;
}
auto component() const -> string { return _component; }
auto enabled() const -> bool { return _enabled; }
auto setComponent(string component) -> void { _component = component; }
auto setEnabled(bool enabled) -> void { _enabled = enabled; }
auto serialize(string& output, string depth) -> void override {
Object::serialize(output, depth);
output.append(depth, " component: ", _component, "\n");
output.append(depth, " enabled: ", _enabled, "\n");
}
auto unserialize(Markup::Node node) -> void override {
Object::unserialize(node);
_component = node["component"].string();
_enabled = node["enabled"].boolean();
}
protected:
string _component;
bool _enabled = false;
};
| 29.2
| 73
| 0.658676
|
moon-chilled
|
6a3de8ee0b8da113e28041f2ab5d60e5d927afe8
| 1,699
|
cpp
|
C++
|
Class 16 - solve class 7/A.cpp
|
pioneerAlpha/CP_Beginner_B1
|
fd743b956188e927ac999e108df2f081d4f5fcb2
|
[
"Apache-2.0"
] | 4
|
2020-07-10T06:37:52.000Z
|
2022-01-03T17:14:21.000Z
|
Class 16 - solve class 7/A.cpp
|
pioneerAlpha/CP_Beginner_B1
|
fd743b956188e927ac999e108df2f081d4f5fcb2
|
[
"Apache-2.0"
] | null | null | null |
Class 16 - solve class 7/A.cpp
|
pioneerAlpha/CP_Beginner_B1
|
fd743b956188e927ac999e108df2f081d4f5fcb2
|
[
"Apache-2.0"
] | 4
|
2020-11-23T16:58:45.000Z
|
2021-01-06T20:20:57.000Z
|
#include<bits/stdc++.h>
#define ll long long
#define N ((int)1e3 + 5)
#define MOD ((int)1e9 + 7)
#define thr 1e-8
#define pi acos(-1) /// pi = acos ( -1 )
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
using namespace std;
int arr[105][105];
int dxx[] = {0,0,1,-1};
int dyy[] = {1,-1,0,0};
bool vis[105][105];
int main()
{
fastio;
int t;
cin>>t;
while(t--){
int n , m;
cin>>n>>m;
for(int i = 1 ; i<=n ; i++){
for(int j = 1 ; j<=m ; j++){
cin>>arr[i][j];
vis[i][j] = 0;
}
}
priority_queue < pair < int , pair < int , int > > > pqq;
for(int i = 1 ; i<=n ; i++){
pqq.push({-arr[i][1],{i,1}});
vis[i][1] = 1;
pqq.push({-arr[i][m],{i,m}});
vis[i][m] = 1;
}
for(int j = 1 ; j<=m ; j++){
pqq.push({-arr[1][j],{1,j}});
vis[1][j] = 1;
pqq.push({-arr[n][j],{n,j}});
vis[n][j] = 1;
}
int ans = 0;
while(!pqq.empty()){
pair < int , pair < int , int > > p = pqq.top();
pqq.pop();
int x = p.second.first, y = p.second.second , hig = -p.first;
for(int i = 0 ; i<4 ; i++){
int a = x + dxx[i] , b = y + dyy[i];
if(min(a,b) < 1 || a > n || b > m || vis[a][b] == 1) continue;
vis[a][b] = 1;
if(arr[a][b] < hig){
ans += hig - arr[a][b];
arr[a][b] = hig;
}
pqq.push({-arr[a][b],{a,b}});
}
}
cout<<ans<<endl;
}
return 0;
}
| 25.742424
| 78
| 0.366686
|
pioneerAlpha
|
6a411c116f7bebb186f5a0a9d693ce59e9ea3e29
| 7,658
|
cpp
|
C++
|
src/karri-vivek/karri-vivek.cpp
|
VivekReddy98/LidarFilter
|
9233d3a9eb08ae773b8e7f35f6cb7a7d7ae306c1
|
[
"MIT"
] | null | null | null |
src/karri-vivek/karri-vivek.cpp
|
VivekReddy98/LidarFilter
|
9233d3a9eb08ae773b8e7f35f6cb7a7d7ae306c1
|
[
"MIT"
] | null | null | null |
src/karri-vivek/karri-vivek.cpp
|
VivekReddy98/LidarFilter
|
9233d3a9eb08ae773b8e7f35f6cb7a7d7ae306c1
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <queue>
#include <cmath>
#include <algorithm>
#include "karri-vivek.h"
/** RangeFilter Constructor:
Purpose: Input checking and variable initialization
Args: Max and Min Thresholds as floats
*/
LSF::RangeFilter::RangeFilter(float max, float min){
if (max < min) {
throw std::runtime_error("Maximum is less than Minumum while initializing the Range Filter");
}
range_max = max;
range_min = min;
}
/** RangeFilter Update Method:
Purpose: To filter the inout sequence of the array by clipping the max and min thresholds
Args: Input Sequence as a float vector
Working: Loops over all the values of the sequences and clip the residuals.
Nuances: OpenMP will Paralellize the execution among four threads
and therefore has performance benefits for larger arrays
*/
void LSF::RangeFilter::update(std::vector<float>& input_scan){
// auto start = chrono::steady_clock::now();
int i;
#pragma omp parallel for default(shared) private(i)
for (i = 0; i < input_scan.size(); i++){
if (input_scan[i] > range_max) {
input_scan[i] = range_max;
}
else if (input_scan[i] < range_min){
input_scan[i] = range_min;
}
}
}
/** MedianFilter Constructor:
Purpose: Input checking and variable initialization
Args: D: The Number of Previous Scans, the filter is dependent upon
N: Length of the Sequences.
Working: Dval is set D+1, because the matrix has to have a size of (D+1)*(N).
*/
LSF::MedianFilter::MedianFilter(int D, int N){
if (D < 0){
throw std::runtime_error("D Must be >= 0");
}
Dval = D+1;
currentTimeStamp = 0;
rangeMeasure = N;
}
/** MedianFilter Destructor:
Purpose: Freeing Up the Heap allocated Memory before dying
Args: None
Working: freeCheck gives the count of the allocated elements.
Using that information, the memory is freed up sequentially.
*/
LSF::MedianFilter::~MedianFilter(){
int limit = freeCheck.size();
for(int i = 0; i<limit; i++){
free(Db[i]);
}
}
/** MedianFilter Update Method:
Purpose: Update the Input Sequence Based on Definition imposed by Temporal Median Filter
Args: Input Scan Sequence
Working: If currentTimeStamp = 0, intialization code is run to set up the matrix and necessary variables.
(For More Info, look at initSetUp() function)
Then store the newscan sequence in the already defined matrix at the last index
(i.e. without allocating any new memory) (how?? look into storeNewScan method)
Once Stored, Compute the median based on temporal relatives, using findMedian method.
Time-Complexity: O(NDLog(D) + D + N) for one timeStep
*/
void LSF::MedianFilter::update(std::vector<float>& input_scan){
if(input_scan.size() != rangeMeasure) return;
if(currentTimeStamp == 0) { initSetUp(input_scan);}
storeNewScan(input_scan);
findMedian(input_scan);
}
/**
MedianFilter findMedian Method:
Purpose: Given an input sequence and D previous Scans find, the median.
Args: input Scan and the matrix
Working: Sort the elements in the matrix for every column and then find the median, Update in the corresponding location of input_scan;
Time-Complexity: O(DLog(D))*N
*/
void LSF::MedianFilter::findMedian(std::vector<float>& input_scan){
int numElemBother = currentTimeStamp > Dval ? Dval : currentTimeStamp;
int i, j;
std::vector<float> tempVector(numElemBother, 0.0);
#pragma omp parallel for default(shared) private(i, j, tempVector)
for (i = 0; i < rangeMeasure; i++){
for (j = 0; j < numElemBother; j++){
tempVector[j] = Db[j][i];
}
std::sort(tempVector.begin(), tempVector.end());
input_scan[i] = medianHelper(tempVector);
}
}
/** MedianFilter medianHelper Method:
Purpose: Given a Sorted Array, return the median.
Args: Sorted Array
Working: If the length is odd, return the middle one, else return the avg of the mid two elements
Time-Complexity: O(1)
*/
float LSF::MedianFilter::medianHelper(std::vector<float>& tempVector){
int length = tempVector.size();
if(length%2 != 0) {
int index = (int)std::floor(length/2);
return tempVector[index];
}
else {
int indexR = (int)floor(length/2);
int indexL = indexR - 1;
//std::cout << indexR << " " << indexL << std::endl;
return (tempVector[indexR] + tempVector[indexL])/2;
}
}
/** MedianFilter storeNewScan Method:
Purpose: Implements a way of maintaining a constant space requirement and efficiently accomodating a new sequence.
Args: Input Scan Sequence
Working: Circular Rotation of Pointers. So, every sequence is a continuos allocation in memory i.e. a row in the matrix and thus has a pointer to the head.
For Eg: When a new sequence comes in, the oldest have to be kicked out,
i.e. in simplest case, the new array has to be put in the location of oldest location but an index has to be maintained and this circular rotation so that the last pointer still points to the location which has the latest array.
Time-Complexity: O(Dval + N) (D pointer exchanges and N data copy operations)
*/
void LSF::MedianFilter::storeNewScan(std::vector<float>& input_scan){
/// When currentTimeStamp is still less that Dval, the matrix still has space to accomodate new sequences and thus this is easy to understand//
if (currentTimeStamp < Dval){
int k;
#pragma omp parallel for default(shared) private(k)
for(k = 0; k < input_scan.size(); k++){
Db[currentTimeStamp][k] = input_scan[k];
}
}
// However, when the matrix is filled up and a new sequence comes in, the last one has to be kicked off
else{
// Circular pointer transfer code //
float *temp = Db[0];
int l = 0;
while(l < Dval-1){
Db[l] = Db[l+1];
l++;
}
Db[Dval-1] = temp;
// ------------------------------//
/// Once a location is freed for the new sequce then it is pretty obvious//
int k;
#pragma omp parallel for default(shared) private(k)
for(k = 0; k < input_scan.size(); k++){
Db[Dval-1][k] = input_scan[k];
}
}
currentTimeStamp++;
}
/** MedianFilter initSetUp Method:
Purpose: Create a Matrix of dimensions (Dval * rangeMeasure), where every row is a continuos allocated memory.
Also, checks and breaks the execution, if the initialization is not proper.
Args: Input Scan Sequence
Working: Simply Loop over Dval times and evertime allocate an array of size rangeMeasure.
Nuances: Why isn't OpenMP used here? Well, Because heap allocation is process specific
and threads have to be queued anyway.
Time-Complexity: O(Dval*N)
*/
void LSF::MedianFilter::initSetUp(std::vector<float>& input_scan){
float *arr;
int i = 0;
while (i < Dval){
arr = (float *)calloc(rangeMeasure, sizeof(float));
if (arr == NULL) throw std::runtime_error("Cannot Allocate Requested Memory");
freeCheck.push_back(1);
Db.push_back(arr);
i++;
}
if(Db.size() != Dval) throw std::runtime_error("Something wrong With Memory Allocation in the Vector Datatype");
}
| 39.678756
| 245
| 0.635545
|
VivekReddy98
|
6a4519b34fd1383d26ef46df2e3cf32cde56494b
| 34,479
|
cpp
|
C++
|
samples/5_helloTessellation/main.cpp
|
shineyruan/Vulkan-Samples-Tutorial
|
4599104bcb6b8f71c6a77ee7321ea07e3ef2b5c7
|
[
"MIT"
] | null | null | null |
samples/5_helloTessellation/main.cpp
|
shineyruan/Vulkan-Samples-Tutorial
|
4599104bcb6b8f71c6a77ee7321ea07e3ef2b5c7
|
[
"MIT"
] | null | null | null |
samples/5_helloTessellation/main.cpp
|
shineyruan/Vulkan-Samples-Tutorial
|
4599104bcb6b8f71c6a77ee7321ea07e3ef2b5c7
|
[
"MIT"
] | null | null | null |
#include <vulkan/vulkan.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <iostream>
#include <stdexcept>
#include "camera.h"
#include "vulkan_buffer.h"
#include "vulkan_instance.h"
#include "vulkan_shader_module.h"
#include "window.h"
VulkanInstance* instance;
VulkanDevice* device;
VulkanSwapChain* swapchain;
Camera* camera;
glm::mat4* mappedCameraView;
namespace {
bool buttons[GLFW_MOUSE_BUTTON_LAST + 1] = {0};
void mouseButtonCallback(GLFWwindow*, int button, int action, int) {
buttons[button] = (action == GLFW_PRESS);
}
void cursorPosCallback(GLFWwindow*, double mouseX, double mouseY) {
static double oldX, oldY;
float dX = static_cast<float>(mouseX - oldX);
float dY = static_cast<float>(mouseY - oldY);
oldX = mouseX;
oldY = mouseY;
if (buttons[2] || (buttons[0] && buttons[1])) {
camera->pan(-dX * 0.002f, dY * -0.002f);
memcpy(mappedCameraView, &camera->view(), sizeof(glm::mat4));
} else if (buttons[0]) {
camera->rotate(dX * -0.01f, dY * -0.01f);
memcpy(mappedCameraView, &camera->view(), sizeof(glm::mat4));
} else if (buttons[1]) {
camera->zoom(dY * -0.005f);
memcpy(mappedCameraView, &camera->view(), sizeof(glm::mat4));
}
}
void scrollCallback(GLFWwindow*, double, double yoffset) {
camera->zoom(static_cast<float>(yoffset) * 0.04f);
memcpy(mappedCameraView, &camera->view(), sizeof(glm::mat4));
}
} // namespace
struct Vertex {
glm::vec4 position;
glm::vec4 color;
};
struct CameraUBO {
glm::mat4 viewMatrix;
glm::mat4 projectionMatrix;
};
struct ModelUBO {
glm::mat4 modelMatrix;
};
VkRenderPass CreateRenderPass() {
// Color buffer attachment represented by one of the images from the swap
// chain
VkAttachmentDescription colorAttachment = {};
colorAttachment.format = swapchain->GetImageFormat();
colorAttachment.samples = VK_SAMPLE_COUNT_1_BIT;
colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
colorAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
colorAttachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
colorAttachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
colorAttachment.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
// Create an attachment reference to be used with subpass
VkAttachmentReference colorAttachmentRef = {};
colorAttachmentRef.attachment = 0;
colorAttachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
// Create subpass description
VkSubpassDescription subpass = {};
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = 1;
subpass.pColorAttachments = &colorAttachmentRef;
// Specify subpass dependency
VkSubpassDependency dependency = {};
dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
dependency.dstSubpass = 0;
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.srcAccessMask = 0;
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
// Create render pass
VkRenderPassCreateInfo renderPassInfo = {};
renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
renderPassInfo.attachmentCount = 1;
renderPassInfo.pAttachments = &colorAttachment;
renderPassInfo.subpassCount = 1;
renderPassInfo.pSubpasses = &subpass;
renderPassInfo.dependencyCount = 1;
renderPassInfo.pDependencies = &dependency;
VkRenderPass renderPass;
if (vkCreateRenderPass(device->GetVulkanDevice(), &renderPassInfo, nullptr,
&renderPass) != VK_SUCCESS) {
throw std::runtime_error("Failed to create render pass");
}
return renderPass;
}
VkDescriptorSetLayout CreateDescriptorSetLayout(
std::vector<VkDescriptorSetLayoutBinding> layoutBindings) {
VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo = {};
descriptorSetLayoutCreateInfo.sType =
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
descriptorSetLayoutCreateInfo.pNext = nullptr;
descriptorSetLayoutCreateInfo.bindingCount =
static_cast<uint32_t>(layoutBindings.size());
descriptorSetLayoutCreateInfo.pBindings = layoutBindings.data();
VkDescriptorSetLayout descriptorSetLayout;
vkCreateDescriptorSetLayout(device->GetVulkanDevice(),
&descriptorSetLayoutCreateInfo, nullptr,
&descriptorSetLayout);
return descriptorSetLayout;
}
VkDescriptorPool CreateDescriptorPool() {
// Info for the types of descriptors that can be allocated from this pool
VkDescriptorPoolSize poolSizes[3];
poolSizes[0].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
poolSizes[0].descriptorCount = 1;
poolSizes[1].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
poolSizes[1].descriptorCount = 1;
poolSizes[2].type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
poolSizes[2].descriptorCount = 1;
VkDescriptorPoolCreateInfo descriptorPoolInfo = {};
descriptorPoolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
descriptorPoolInfo.pNext = nullptr;
descriptorPoolInfo.poolSizeCount = 3;
descriptorPoolInfo.pPoolSizes = poolSizes;
descriptorPoolInfo.maxSets = 3;
VkDescriptorPool descriptorPool;
vkCreateDescriptorPool(device->GetVulkanDevice(), &descriptorPoolInfo,
nullptr, &descriptorPool);
return descriptorPool;
}
VkDescriptorSet CreateDescriptorSet(VkDescriptorPool descriptorPool,
VkDescriptorSetLayout descriptorSetLayout) {
VkDescriptorSetAllocateInfo allocInfo = {};
allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
allocInfo.descriptorPool = descriptorPool;
allocInfo.descriptorSetCount = 1;
allocInfo.pSetLayouts = &descriptorSetLayout;
VkDescriptorSet descriptorSet;
vkAllocateDescriptorSets(device->GetVulkanDevice(), &allocInfo,
&descriptorSet);
return descriptorSet;
}
VkPipelineLayout CreatePipelineLayout(
std::vector<VkDescriptorSetLayout> descriptorSetLayouts) {
VkPipelineLayoutCreateInfo pipelineLayoutInfo = {};
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount =
static_cast<uint32_t>(descriptorSetLayouts.size());
pipelineLayoutInfo.pSetLayouts = descriptorSetLayouts.data();
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = 0;
VkPipelineLayout pipelineLayout;
if (vkCreatePipelineLayout(device->GetVulkanDevice(), &pipelineLayoutInfo,
nullptr, &pipelineLayout) != VK_SUCCESS) {
throw std::runtime_error("Failed to create pipeline layout");
}
return pipelineLayout;
}
VkPipeline CreateGraphicsPipeline(VkPipelineLayout pipelineLayout,
VkRenderPass renderPass,
unsigned int subpass) {
VkShaderModule vertShaderModule = createShaderModule(
"5_helloTessellation/shaders/shader.vert.spv", device->GetVulkanDevice());
VkShaderModule tescShaderModule = createShaderModule(
"5_helloTessellation/shaders/shader.tesc.spv", device->GetVulkanDevice());
VkShaderModule teseShaderModule = createShaderModule(
"5_helloTessellation/shaders/shader.tese.spv", device->GetVulkanDevice());
VkShaderModule fragShaderModule = createShaderModule(
"5_helloTessellation/shaders/shader.frag.spv", device->GetVulkanDevice());
// Assign each shader module to the appropriate stage in the pipeline
VkPipelineShaderStageCreateInfo vertShaderStageInfo = {};
vertShaderStageInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
vertShaderStageInfo.stage = VK_SHADER_STAGE_VERTEX_BIT;
vertShaderStageInfo.module = vertShaderModule;
vertShaderStageInfo.pName = "main";
VkPipelineShaderStageCreateInfo tescShaderStageInfo = {};
tescShaderStageInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
tescShaderStageInfo.stage = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
tescShaderStageInfo.module = tescShaderModule;
tescShaderStageInfo.pName = "main";
VkPipelineShaderStageCreateInfo teseShaderStageInfo = {};
teseShaderStageInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
teseShaderStageInfo.stage = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
teseShaderStageInfo.module = teseShaderModule;
teseShaderStageInfo.pName = "main";
VkPipelineShaderStageCreateInfo fragShaderStageInfo = {};
fragShaderStageInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
fragShaderStageInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT;
fragShaderStageInfo.module = fragShaderModule;
fragShaderStageInfo.pName = "main";
VkPipelineShaderStageCreateInfo shaderStages[] = {
vertShaderStageInfo, tescShaderStageInfo, teseShaderStageInfo,
fragShaderStageInfo};
// --- Set up fixed-function stages ---
// Vertex input binding
VkVertexInputBindingDescription vertexInputBinding = {};
vertexInputBinding.binding = 0;
vertexInputBinding.stride = sizeof(Vertex);
vertexInputBinding.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
// Inpute attribute bindings describe shader attribute locations and memory
// layouts
std::array<VkVertexInputAttributeDescription, 2> vertexInputAttributes;
// Attribute location 0: Position
vertexInputAttributes[0].binding = 0;
vertexInputAttributes[0].location = 0;
// Position attribute is three 32 bit signed (SFLOAT) floats (R32 G32 B32)
vertexInputAttributes[0].format = VK_FORMAT_R32G32B32_SFLOAT;
vertexInputAttributes[0].offset = offsetof(Vertex, position);
// Attribute location 1: Color
vertexInputAttributes[1].binding = 0;
vertexInputAttributes[1].location = 1;
// Color attribute is three 32 bit signed (SFLOAT) floats (R32 G32 B32)
vertexInputAttributes[1].format = VK_FORMAT_R32G32B32_SFLOAT;
vertexInputAttributes[1].offset = offsetof(Vertex, color);
// Vertex input
VkPipelineVertexInputStateCreateInfo vertexInputInfo = {};
vertexInputInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
vertexInputInfo.vertexBindingDescriptionCount = 1;
vertexInputInfo.pVertexBindingDescriptions = &vertexInputBinding;
vertexInputInfo.vertexAttributeDescriptionCount = 2;
vertexInputInfo.pVertexAttributeDescriptions = vertexInputAttributes.data();
// Input assembly
VkPipelineInputAssemblyStateCreateInfo inputAssembly = {};
inputAssembly.sType =
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
inputAssembly.primitiveRestartEnable = VK_FALSE;
// Tessellation state
VkPipelineTessellationStateCreateInfo tessellationInfo = {};
tessellationInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
tessellationInfo.pNext = NULL;
tessellationInfo.flags = 0;
tessellationInfo.patchControlPoints = 1;
// Viewports and Scissors (rectangles that define in which regions pixels are
// stored)
VkViewport viewport = {};
viewport.x = 0.0f;
viewport.y = 0.0f;
viewport.width = static_cast<float>(swapchain->GetExtent().width);
viewport.height = static_cast<float>(swapchain->GetExtent().height);
viewport.minDepth = 0.0f;
viewport.maxDepth = 1.0f;
VkRect2D scissor = {};
scissor.offset = {0, 0};
scissor.extent = swapchain->GetExtent();
VkPipelineViewportStateCreateInfo viewportState = {};
viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
viewportState.viewportCount = 1;
viewportState.pViewports = &viewport;
viewportState.scissorCount = 1;
viewportState.pScissors = &scissor;
// Rasterizer
VkPipelineRasterizationStateCreateInfo rasterizer = {};
rasterizer.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
rasterizer.depthClampEnable = VK_FALSE;
rasterizer.rasterizerDiscardEnable = VK_FALSE;
rasterizer.polygonMode = VK_POLYGON_MODE_LINE;
rasterizer.lineWidth = 1.0f;
rasterizer.cullMode = VK_CULL_MODE_BACK_BIT;
rasterizer.frontFace = VK_FRONT_FACE_CLOCKWISE;
rasterizer.depthBiasEnable = VK_FALSE;
rasterizer.depthBiasConstantFactor = 0.0f;
rasterizer.depthBiasClamp = 0.0f;
rasterizer.depthBiasSlopeFactor = 0.0f;
// Multisampling (turned off here)
VkPipelineMultisampleStateCreateInfo multisampling = {};
multisampling.sType =
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
multisampling.sampleShadingEnable = VK_FALSE;
multisampling.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
multisampling.minSampleShading = 1.0f;
multisampling.pSampleMask = nullptr;
multisampling.alphaToCoverageEnable = VK_FALSE;
multisampling.alphaToOneEnable = VK_FALSE;
// Color blending (turned off here, but showing options for learning)
// --> Configuration per attached framebuffer
VkPipelineColorBlendAttachmentState colorBlendAttachment = {};
colorBlendAttachment.colorWriteMask =
VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
colorBlendAttachment.blendEnable = VK_FALSE;
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
colorBlendAttachment.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
colorBlendAttachment.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
colorBlendAttachment.alphaBlendOp = VK_BLEND_OP_ADD;
// --> Global color blending settings
VkPipelineColorBlendStateCreateInfo colorBlending = {};
colorBlending.sType =
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
colorBlending.logicOpEnable = VK_FALSE;
colorBlending.logicOp = VK_LOGIC_OP_COPY;
colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment;
colorBlending.blendConstants[0] = 0.0f;
colorBlending.blendConstants[1] = 0.0f;
colorBlending.blendConstants[2] = 0.0f;
colorBlending.blendConstants[3] = 0.0f;
// --- Create graphics pipeline ---
VkGraphicsPipelineCreateInfo pipelineInfo = {};
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pipelineInfo.stageCount = 4;
pipelineInfo.pStages = shaderStages;
pipelineInfo.pVertexInputState = &vertexInputInfo;
pipelineInfo.pInputAssemblyState = &inputAssembly;
pipelineInfo.pTessellationState = &tessellationInfo;
pipelineInfo.pViewportState = &viewportState;
pipelineInfo.pRasterizationState = &rasterizer;
pipelineInfo.pMultisampleState = &multisampling;
pipelineInfo.pDepthStencilState = nullptr;
pipelineInfo.pColorBlendState = &colorBlending;
pipelineInfo.pDynamicState = nullptr;
pipelineInfo.layout = pipelineLayout;
pipelineInfo.renderPass = renderPass;
pipelineInfo.subpass = subpass;
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
pipelineInfo.basePipelineIndex = -1;
VkPipeline pipeline;
if (vkCreateGraphicsPipelines(device->GetVulkanDevice(), VK_NULL_HANDLE, 1,
&pipelineInfo, nullptr,
&pipeline) != VK_SUCCESS) {
throw std::runtime_error("Failed to create pipeline");
}
// No need for the shader modules anymore
vkDestroyShaderModule(device->GetVulkanDevice(), vertShaderModule, nullptr);
vkDestroyShaderModule(device->GetVulkanDevice(), tescShaderModule, nullptr);
vkDestroyShaderModule(device->GetVulkanDevice(), teseShaderModule, nullptr);
vkDestroyShaderModule(device->GetVulkanDevice(), fragShaderModule, nullptr);
return pipeline;
}
VkPipeline CreateComputePipeline(VkPipelineLayout pipelineLayout) {
VkShaderModule compShaderModule = createShaderModule(
"5_helloTessellation/shaders/shader.comp.spv", device->GetVulkanDevice());
VkPipelineShaderStageCreateInfo compShaderStageInfo = {};
compShaderStageInfo.sType =
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
compShaderStageInfo.stage = VK_SHADER_STAGE_COMPUTE_BIT;
compShaderStageInfo.module = compShaderModule;
compShaderStageInfo.pName = "main";
VkComputePipelineCreateInfo pipelineInfo = {};
pipelineInfo.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
pipelineInfo.stage = compShaderStageInfo;
pipelineInfo.layout = pipelineLayout;
VkPipeline pipeline;
if (vkCreateComputePipelines(device->GetVulkanDevice(), VK_NULL_HANDLE, 1,
&pipelineInfo, nullptr,
&pipeline) != VK_SUCCESS) {
throw std::runtime_error("Failed to create pipeline");
}
vkDestroyShaderModule(device->GetVulkanDevice(), compShaderModule, nullptr);
return pipeline;
}
std::vector<VkFramebuffer> CreateFrameBuffers(VkRenderPass renderPass) {
std::vector<VkFramebuffer> frameBuffers(swapchain->GetCount());
for (uint32_t i = 0; i < swapchain->GetCount(); i++) {
VkImageView attachments[] = {swapchain->GetImageView(i)};
VkFramebufferCreateInfo framebufferInfo = {};
framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
framebufferInfo.renderPass = renderPass;
framebufferInfo.attachmentCount = 1;
framebufferInfo.pAttachments = attachments;
framebufferInfo.width = swapchain->GetExtent().width;
framebufferInfo.height = swapchain->GetExtent().height;
framebufferInfo.layers = 1;
if (vkCreateFramebuffer(device->GetVulkanDevice(), &framebufferInfo,
nullptr, &frameBuffers[i]) != VK_SUCCESS) {
throw std::runtime_error("Failed to create framebuffer");
}
}
return frameBuffers;
}
int main(int argc, char** argv) {
static constexpr char* applicationName = "Hello Tessellation";
InitializeWindow(640, 480, applicationName);
unsigned int glfwExtensionCount = 0;
const char** glfwExtensions =
glfwGetRequiredInstanceExtensions(&glfwExtensionCount);
instance =
new VulkanInstance(applicationName, glfwExtensionCount, glfwExtensions);
VkSurfaceKHR surface;
if (glfwCreateWindowSurface(instance->GetVkInstance(), GetGLFWWindow(),
nullptr, &surface) != VK_SUCCESS) {
throw std::runtime_error("Failed to create window surface");
}
instance->PickPhysicalDevice(
{VK_KHR_SWAPCHAIN_EXTENSION_NAME},
QueueFlagBit::GraphicsBit | QueueFlagBit::TransferBit |
QueueFlagBit::ComputeBit | QueueFlagBit::PresentBit,
surface);
// --- Specify the set of device features used ---
VkPhysicalDeviceFeatures deviceFeatures = {};
deviceFeatures.tessellationShader = VK_TRUE;
deviceFeatures.fillModeNonSolid = VK_TRUE;
device = instance->CreateDevice(
QueueFlagBit::GraphicsBit | QueueFlagBit::TransferBit |
QueueFlagBit::ComputeBit | QueueFlagBit::PresentBit,
deviceFeatures);
swapchain = device->CreateSwapChain(surface);
VkCommandPoolCreateInfo poolInfo = {};
poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
poolInfo.queueFamilyIndex =
instance->GetQueueFamilyIndices()[QueueFlags::Graphics];
poolInfo.flags = 0;
VkCommandPool commandPool;
if (vkCreateCommandPool(device->GetVulkanDevice(), &poolInfo, nullptr,
&commandPool) != VK_SUCCESS) {
throw std::runtime_error("Failed to create command pool");
}
CameraUBO cameraTransforms;
camera = new Camera(&cameraTransforms.viewMatrix);
cameraTransforms.projectionMatrix = glm::perspective(
static_cast<float>(45 * M_PI / 180), 640.f / 480.f, 0.1f, 1000.f);
ModelUBO modelTransforms;
modelTransforms.modelMatrix =
glm::mat4(1.0); // glm::rotate(glm::mat4(1.f), static_cast<float>(15 *
// M_PI / 180), glm::vec3(0.f, 0.f, 1.f));
std::vector<Vertex> vertices = {
{{0.0f, 1.0f, 0.0f, 1.f}, {0.0f, 1.0f, 0.0f, 1.f}},
};
unsigned int vertexBufferSize =
static_cast<uint32_t>(vertices.size() * sizeof(vertices[0]));
// Create vertex and index buffers
VkBuffer vertexBuffer = CreateBuffer(
device,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
vertexBufferSize);
unsigned int vertexBufferOffsets[1];
VkDeviceMemory vertexBufferMemory =
AllocateMemoryForBuffers(device, {vertexBuffer},
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
vertexBufferOffsets);
// Copy data to buffer memory
{
char* data;
vkMapMemory(device->GetVulkanDevice(), vertexBufferMemory, 0,
vertexBufferSize, 0, reinterpret_cast<void**>(&data));
memcpy(data + vertexBufferOffsets[0], vertices.data(), vertexBufferSize);
vkUnmapMemory(device->GetVulkanDevice(), vertexBufferMemory);
}
// Bind the memory to the buffers
BindMemoryForBuffers(device, vertexBufferMemory, {vertexBuffer},
vertexBufferOffsets);
// Create uniform buffers
VkBuffer cameraBuffer = CreateBuffer(
device, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, sizeof(CameraUBO));
VkBuffer modelBuffer = CreateBuffer(
device, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, sizeof(ModelUBO));
unsigned int uniformBufferOffsets[2];
VkDeviceMemory uniformBufferMemory =
AllocateMemoryForBuffers(device, {cameraBuffer, modelBuffer},
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
uniformBufferOffsets);
// Copy data to uniform memory
{
char* data;
vkMapMemory(device->GetVulkanDevice(), uniformBufferMemory, 0,
uniformBufferOffsets[1] + sizeof(ModelUBO), 0,
reinterpret_cast<void**>(&data));
memcpy(data + uniformBufferOffsets[0], &cameraTransforms,
sizeof(CameraUBO));
memcpy(data + uniformBufferOffsets[1], &modelTransforms, sizeof(ModelUBO));
vkUnmapMemory(device->GetVulkanDevice(), uniformBufferMemory);
}
// Bind the memory to the buffers
BindMemoryForBuffers(device, uniformBufferMemory, {cameraBuffer, modelBuffer},
uniformBufferOffsets);
VkDescriptorPool descriptorPool = CreateDescriptorPool();
VkDescriptorSetLayout computeSetLayout = CreateDescriptorSetLayout({
{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT,
nullptr},
});
VkDescriptorSetLayout cameraSetLayout = CreateDescriptorSetLayout({
{0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1,
VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, nullptr},
});
VkDescriptorSetLayout modelSetLayout = CreateDescriptorSetLayout({
{0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT,
nullptr},
});
VkDescriptorSet computeSet =
CreateDescriptorSet(descriptorPool, computeSetLayout);
VkDescriptorSet cameraSet =
CreateDescriptorSet(descriptorPool, cameraSetLayout);
VkDescriptorSet modelSet =
CreateDescriptorSet(descriptorPool, modelSetLayout);
// Initialize descriptor sets
{
VkDescriptorBufferInfo computeBufferInfo = {};
computeBufferInfo.buffer = vertexBuffer;
computeBufferInfo.offset = 0;
computeBufferInfo.range = vertexBufferSize;
VkWriteDescriptorSet writeComputeInfo = {};
writeComputeInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeComputeInfo.dstSet = computeSet;
writeComputeInfo.dstBinding = 0;
writeComputeInfo.descriptorCount = 1;
writeComputeInfo.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
writeComputeInfo.pBufferInfo = &computeBufferInfo;
VkDescriptorBufferInfo cameraBufferInfo = {};
cameraBufferInfo.buffer = cameraBuffer;
cameraBufferInfo.offset = 0;
cameraBufferInfo.range = sizeof(CameraUBO);
VkWriteDescriptorSet writeCameraInfo = {};
writeCameraInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeCameraInfo.dstSet = cameraSet;
writeCameraInfo.dstBinding = 0;
writeCameraInfo.descriptorCount = 1;
writeCameraInfo.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
writeCameraInfo.pBufferInfo = &cameraBufferInfo;
VkDescriptorBufferInfo modelBufferInfo = {};
modelBufferInfo.buffer = modelBuffer;
modelBufferInfo.offset = 0;
modelBufferInfo.range = sizeof(ModelUBO);
VkWriteDescriptorSet writeModelInfo = {};
writeModelInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeModelInfo.dstSet = modelSet;
writeModelInfo.dstBinding = 0;
writeModelInfo.descriptorCount = 1;
writeModelInfo.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
writeModelInfo.pBufferInfo = &modelBufferInfo;
VkWriteDescriptorSet writeDescriptorSets[] = {
writeComputeInfo, writeCameraInfo, writeModelInfo};
vkUpdateDescriptorSets(device->GetVulkanDevice(), 3, writeDescriptorSets, 0,
nullptr);
}
VkRenderPass renderPass = CreateRenderPass();
VkPipelineLayout computePipelineLayout =
CreatePipelineLayout({computeSetLayout});
VkPipelineLayout graphicsPipelineLayout =
CreatePipelineLayout({cameraSetLayout, modelSetLayout});
VkPipeline computePipeline = CreateComputePipeline(computePipelineLayout);
VkPipeline graphicsPipeline =
CreateGraphicsPipeline(graphicsPipelineLayout, renderPass, 0);
// Create one framebuffer for each frame of the swap chain
std::vector<VkFramebuffer> frameBuffers = CreateFrameBuffers(renderPass);
// Create one command buffer for each frame of the swap chain
std::vector<VkCommandBuffer> commandBuffers(swapchain->GetCount());
// Specify the command pool and number of buffers to allocate
VkCommandBufferAllocateInfo commandBufferAllocateInfo = {};
commandBufferAllocateInfo.sType =
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
commandBufferAllocateInfo.commandPool = commandPool;
commandBufferAllocateInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
commandBufferAllocateInfo.commandBufferCount =
(uint32_t)commandBuffers.size();
if (vkAllocateCommandBuffers(device->GetVulkanDevice(),
&commandBufferAllocateInfo,
commandBuffers.data()) != VK_SUCCESS) {
throw std::runtime_error("Failed to allocate command buffers");
}
// Record command buffers, one for each frame of the swapchain
for (unsigned int i = 0; i < commandBuffers.size(); ++i) {
VkCommandBufferBeginInfo beginInfo = {};
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
beginInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT;
beginInfo.pInheritanceInfo = nullptr;
vkBeginCommandBuffer(commandBuffers[i], &beginInfo);
VkRenderPassBeginInfo renderPassInfo = {};
renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
renderPassInfo.renderPass = renderPass;
renderPassInfo.framebuffer = frameBuffers[i];
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapchain->GetExtent();
VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;
// Bind the compute pipeline
vkCmdBindPipeline(commandBuffers[i], VK_PIPELINE_BIND_POINT_COMPUTE,
computePipeline);
// Bind descriptor sets for compute
vkCmdBindDescriptorSets(commandBuffers[i], VK_PIPELINE_BIND_POINT_COMPUTE,
computePipelineLayout, 0, 1, &computeSet, 0,
nullptr);
// Dispatch the compute kernel, with one thread for each vertex
vkCmdDispatch(commandBuffers[i], vertices.size(), 1, 1);
// Define a memory barrier to transition the vertex buffer from a compute
// storage object to a vertex input
VkBufferMemoryBarrier computeToVertexBarrier = {};
computeToVertexBarrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
computeToVertexBarrier.srcAccessMask =
VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT;
computeToVertexBarrier.dstAccessMask = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT;
computeToVertexBarrier.srcQueueFamilyIndex =
device->GetQueueIndex(QueueFlags::Compute);
computeToVertexBarrier.dstQueueFamilyIndex =
device->GetQueueIndex(QueueFlags::Graphics);
computeToVertexBarrier.buffer = vertexBuffer;
computeToVertexBarrier.offset = 0;
computeToVertexBarrier.size = vertexBufferSize;
vkCmdPipelineBarrier(commandBuffers[i],
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, 0, nullptr, 1,
&computeToVertexBarrier, 0, nullptr);
vkCmdBeginRenderPass(commandBuffers[i], &renderPassInfo,
VK_SUBPASS_CONTENTS_INLINE);
// Bind camera descriptor set
vkCmdBindDescriptorSets(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS,
graphicsPipelineLayout, 0, 1, &cameraSet, 0,
nullptr);
// Bind the graphics pipeline
vkCmdBindPipeline(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS,
graphicsPipeline);
// Bind model descriptor set
vkCmdBindDescriptorSets(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS,
graphicsPipelineLayout, 1, 1, &modelSet, 0,
nullptr);
VkDeviceSize offsets[1] = {0};
vkCmdBindVertexBuffers(commandBuffers[i], 0, 1, &vertexBuffer, offsets);
// Draw single point which will tessellate to a triangle
vkCmdDraw(commandBuffers[i], 1, 1, 0, 1);
vkCmdEndRenderPass(commandBuffers[i]);
if (vkEndCommandBuffer(commandBuffers[i]) != VK_SUCCESS) {
throw std::runtime_error("Failed to record command buffer");
}
}
glfwSetMouseButtonCallback(GetGLFWWindow(), mouseButtonCallback);
glfwSetCursorPosCallback(GetGLFWWindow(), cursorPosCallback);
glfwSetScrollCallback(GetGLFWWindow(), scrollCallback);
int frameNumber = 0;
// Map the part of the buffer referring the camera view matrix so it can be
// updated when the camera moves
vkMapMemory(device->GetVulkanDevice(), uniformBufferMemory,
uniformBufferOffsets[0] + offsetof(CameraUBO, viewMatrix),
sizeof(glm::mat4), 0,
reinterpret_cast<void**>(&mappedCameraView));
while (!ShouldQuit()) {
swapchain->Acquire();
// Submit the command buffer
VkSubmitInfo submitInfo = {};
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
VkSemaphore waitSemaphores[] = {swapchain->GetImageAvailableSemaphore()};
VkPipelineStageFlags waitStages[] = {
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT};
submitInfo.waitSemaphoreCount = 1;
submitInfo.pWaitSemaphores = waitSemaphores;
submitInfo.pWaitDstStageMask = waitStages;
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &commandBuffers[swapchain->GetIndex()];
VkSemaphore signalSemaphores[] = {swapchain->GetRenderFinishedSemaphore()};
submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = signalSemaphores;
if (vkQueueSubmit(device->GetQueue(QueueFlags::Graphics), 1, &submitInfo,
VK_NULL_HANDLE) != VK_SUCCESS) {
throw std::runtime_error("Failed to submit draw command buffer");
}
swapchain->Present();
glfwPollEvents();
}
vkUnmapMemory(device->GetVulkanDevice(), uniformBufferMemory);
// Wait for the device to finish executing before cleanup
vkDeviceWaitIdle(device->GetVulkanDevice());
delete camera;
vkDestroyBuffer(device->GetVulkanDevice(), vertexBuffer, nullptr);
vkFreeMemory(device->GetVulkanDevice(), vertexBufferMemory, nullptr);
vkDestroyBuffer(device->GetVulkanDevice(), cameraBuffer, nullptr);
vkDestroyBuffer(device->GetVulkanDevice(), modelBuffer, nullptr);
vkFreeMemory(device->GetVulkanDevice(), uniformBufferMemory, nullptr);
vkDestroyDescriptorSetLayout(device->GetVulkanDevice(), computeSetLayout,
nullptr);
vkDestroyDescriptorSetLayout(device->GetVulkanDevice(), cameraSetLayout,
nullptr);
vkDestroyDescriptorSetLayout(device->GetVulkanDevice(), modelSetLayout,
nullptr);
vkDestroyDescriptorPool(device->GetVulkanDevice(), descriptorPool, nullptr);
vkDestroyPipeline(device->GetVulkanDevice(), computePipeline, nullptr);
vkDestroyPipelineLayout(device->GetVulkanDevice(), computePipelineLayout,
nullptr);
vkDestroyPipeline(device->GetVulkanDevice(), graphicsPipeline, nullptr);
vkDestroyPipelineLayout(device->GetVulkanDevice(), graphicsPipelineLayout,
nullptr);
vkDestroyRenderPass(device->GetVulkanDevice(), renderPass, nullptr);
vkFreeCommandBuffers(device->GetVulkanDevice(), commandPool,
static_cast<uint32_t>(commandBuffers.size()),
commandBuffers.data());
for (size_t i = 0; i < frameBuffers.size(); i++) {
vkDestroyFramebuffer(device->GetVulkanDevice(), frameBuffers[i], nullptr);
}
delete swapchain;
vkDestroyCommandPool(device->GetVulkanDevice(), commandPool, nullptr);
vkDestroySurfaceKHR(instance->GetVkInstance(), surface, nullptr);
delete device;
delete instance;
DestroyWindow();
}
| 41.490975
| 80
| 0.722846
|
shineyruan
|
6a46a53e9ae0a95a72473b1e86f7df98b7ff901d
| 1,626
|
cpp
|
C++
|
src/tracker/tracking/object_factory.cpp
|
anuranbaka/Vulcan
|
56339f77f6cf64b5fda876445a33e72cd15ce028
|
[
"MIT"
] | 3
|
2020-03-05T23:56:14.000Z
|
2021-02-17T19:06:50.000Z
|
src/tracker/tracking/object_factory.cpp
|
anuranbaka/Vulcan
|
56339f77f6cf64b5fda876445a33e72cd15ce028
|
[
"MIT"
] | 1
|
2021-03-07T01:23:47.000Z
|
2021-03-07T01:23:47.000Z
|
src/tracker/tracking/object_factory.cpp
|
anuranbaka/Vulcan
|
56339f77f6cf64b5fda876445a33e72cd15ce028
|
[
"MIT"
] | 1
|
2021-03-03T07:54:16.000Z
|
2021-03-03T07:54:16.000Z
|
/* Copyright (C) 2010-2019, The Regents of The University of Michigan.
All rights reserved.
This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab
under the direction of Benjamin Kuipers, kuipers@umich.edu. Use of this code is governed by an
MIT-style License that can be found at "https://github.com/h2ssh/Vulcan".
*/
/**
* \file object_factory.cpp
* \author Collin Johnson
*
* Definition of TrackingObjectFactory.
*/
#include "tracker/tracking/object_factory.h"
#include "tracker/motions/classifier.h"
#include "tracker/tracking/data_association.h"
#include "tracker/tracking/object.h"
#include "tracker/tracking/object_set.h"
#include <iostream>
namespace vulcan
{
namespace tracker
{
TrackingObjectFactory::TrackingObjectFactory(std::unique_ptr<ObjectMotionClassifier> classifier,
std::unique_ptr<DataAssociationStrategy> associationStrategy)
: classifier_(std::move(classifier))
, associationStrategy_(std::move(associationStrategy))
{
}
TrackingObjectFactory::~TrackingObjectFactory(void)
{
// For std::unique_ptr
}
std::unique_ptr<TrackingObject> TrackingObjectFactory::createTrackingObject(const LaserObject& object)
{
++nextId_;
return std::make_unique<TrackingObject>(nextId_, object, std::make_unique<ObjectMotionClassifier>(*classifier_));
}
std::unique_ptr<TrackingObjectSet> TrackingObjectFactory::createTrackingObjectSet(void) const
{
return std::unique_ptr<TrackingObjectSet>(new TrackingObjectSet(associationStrategy_->clone()));
}
} // namespace tracker
} // namespace vulcan
| 28.526316
| 117
| 0.758303
|
anuranbaka
|
c69a2985dd157976ade85bc503681ea8997536be
| 9,543
|
cpp
|
C++
|
src/painter/extended_char.cpp
|
RyanDraves/CPPurses
|
19cbdae2d18e702144659187ec989c486c714a0f
|
[
"MIT"
] | null | null | null |
src/painter/extended_char.cpp
|
RyanDraves/CPPurses
|
19cbdae2d18e702144659187ec989c486c714a0f
|
[
"MIT"
] | null | null | null |
src/painter/extended_char.cpp
|
RyanDraves/CPPurses
|
19cbdae2d18e702144659187ec989c486c714a0f
|
[
"MIT"
] | null | null | null |
#include <cppurses/painter/detail/extended_char.hpp>
#include <map>
#include <limits>
#include <ncurses.h>
namespace {
const std::map<wchar_t, chtype> extended_chars {
{L'┌', ACS_ULCORNER}, {L'┍', ACS_ULCORNER}, {L'┎', ACS_ULCORNER},
{L'┏', ACS_ULCORNER}, {L'╒', ACS_ULCORNER}, {L'╓', ACS_ULCORNER},
{L'╔', ACS_ULCORNER}, {L'╭', ACS_ULCORNER},
{L'└', ACS_LLCORNER}, {L'┕', ACS_LLCORNER}, {L'┖', ACS_LLCORNER},
{L'┗', ACS_LLCORNER}, {L'╘', ACS_LLCORNER}, {L'╙', ACS_LLCORNER},
{L'╚', ACS_LLCORNER}, {L'╰', ACS_LLCORNER},
{L'┐', ACS_URCORNER}, {L'┑', ACS_URCORNER}, {L'┒', ACS_URCORNER},
{L'┓', ACS_URCORNER}, {L'╕', ACS_URCORNER}, {L'╖', ACS_URCORNER},
{L'╗', ACS_URCORNER}, {L'╮', ACS_URCORNER},
{L'┘', ACS_LRCORNER}, {L'┙', ACS_LRCORNER}, {L'┚', ACS_LRCORNER},
{L'┛', ACS_LRCORNER}, {L'╛', ACS_LRCORNER}, {L'╜', ACS_LRCORNER},
{L'╝', ACS_LRCORNER}, {L'╯', ACS_LRCORNER},
{L'├', ACS_LTEE}, {L'┝', ACS_LTEE}, {L'┞', ACS_LTEE},
{L'┟', ACS_LTEE}, {L'┠', ACS_LTEE}, {L'┡', ACS_LTEE},
{L'┢', ACS_LTEE}, {L'┣', ACS_LTEE}, {L'╞', ACS_LTEE},
{L'╟', ACS_LTEE}, {L'╠', ACS_LTEE},
{L'┤', ACS_RTEE}, {L'┥', ACS_RTEE}, {L'┦', ACS_RTEE},
{L'┧', ACS_RTEE}, {L'┨', ACS_RTEE}, {L'┩', ACS_RTEE},
{L'┪', ACS_RTEE}, {L'┫', ACS_RTEE}, {L'╡', ACS_RTEE},
{L'╢', ACS_RTEE}, {L'╣', ACS_RTEE},
{L'┴', ACS_BTEE}, {L'┵', ACS_BTEE}, {L'┶', ACS_BTEE},
{L'┷', ACS_BTEE}, {L'┸', ACS_BTEE}, {L'┹', ACS_BTEE},
{L'┺', ACS_BTEE}, {L'┻', ACS_BTEE}, {L'╧', ACS_BTEE},
{L'╨', ACS_BTEE}, {L'╩', ACS_BTEE},
{L'┬', ACS_TTEE}, {L'┭', ACS_TTEE}, {L'┮', ACS_TTEE},
{L'┯', ACS_TTEE}, {L'┰', ACS_TTEE}, {L'┱', ACS_TTEE},
{L'┲', ACS_TTEE}, {L'┳', ACS_TTEE}, {L'╤', ACS_TTEE},
{L'╥', ACS_TTEE}, {L'╦', ACS_TTEE},
{L'─', ACS_HLINE}, {L'━', ACS_HLINE}, {L'┄', ACS_HLINE},
{L'┅', ACS_HLINE}, {L'┈', ACS_HLINE}, {L'┉', ACS_HLINE},
{L'╌', ACS_HLINE}, {L'╍', ACS_HLINE}, {L'═', ACS_HLINE},
{L'╼', ACS_HLINE}, {L'╾', ACS_HLINE}, {L'╸', ACS_HLINE},
{L'╺', ACS_HLINE}, {L'╶', ACS_HLINE}, {L'╴', ACS_HLINE},
{L'│', ACS_VLINE}, {L'┃', ACS_VLINE}, {L'┆', ACS_VLINE},
{L'┇', ACS_VLINE}, {L'┊', ACS_VLINE}, {L'┋', ACS_VLINE},
{L'╎', ACS_VLINE}, {L'╏', ACS_VLINE}, {L'║', ACS_VLINE},
{L'╵', ACS_VLINE}, {L'╷', ACS_VLINE}, {L'╹', ACS_VLINE},
{L'╻', ACS_VLINE}, {L'╽', ACS_VLINE}, {L'╿', ACS_VLINE},
{L'┼', ACS_PLUS}, {L'┽', ACS_PLUS}, {L'┾', ACS_PLUS},
{L'┿', ACS_PLUS}, {L'╀', ACS_PLUS}, {L'╁', ACS_PLUS},
{L'╂', ACS_PLUS}, {L'╃', ACS_PLUS}, {L'╄', ACS_PLUS},
{L'╅', ACS_PLUS}, {L'╆', ACS_PLUS}, {L'╇', ACS_PLUS},
{L'╈', ACS_PLUS}, {L'╉', ACS_PLUS}, {L'╊', ACS_PLUS},
{L'╋', ACS_PLUS}, {L'╪', ACS_PLUS}, {L'╫', ACS_PLUS},
{L'╬', ACS_PLUS},
{L'◆', ACS_DIAMOND}, {L'⋄', ACS_DIAMOND}, {L'⌺', ACS_DIAMOND},
{L'⍚', ACS_DIAMOND}, {L'◇', ACS_DIAMOND}, {L'◈', ACS_DIAMOND},
{L'♢', ACS_DIAMOND}, {L'♦', ACS_DIAMOND}, {L'⛋', ACS_DIAMOND},
{L'❖', ACS_DIAMOND}, {L'⬖', ACS_DIAMOND}, {L'⬗', ACS_DIAMOND},
{L'⬘', ACS_DIAMOND}, {L'⬙', ACS_DIAMOND}, {L'⬥', ACS_DIAMOND},
{L'⬦', ACS_DIAMOND}, {L'⬩', ACS_DIAMOND}, {L'⯁', ACS_DIAMOND},
{L'🞜', ACS_DIAMOND}, {L'🞛', ACS_DIAMOND}, {L'🞚', ACS_DIAMOND},
{L'🞙', ACS_DIAMOND},
{L'▒', ACS_CKBOARD}, {L'░', ACS_CKBOARD}, {L'▓', ACS_CKBOARD},
{L'°', ACS_DEGREE}, {L'±', ACS_PLMINUS}, {L'·', ACS_BULLET},
{L'⎺', ACS_S1}, {L'⎻', ACS_S3}, {L'⎼', ACS_S7},
{L'⎽', ACS_S9},
{L'←', ACS_LARROW}, {L'◀', ACS_LARROW}, {L'↩', ACS_LARROW},
{L'↞', ACS_LARROW}, {L'↢', ACS_LARROW}, {L'↤', ACS_LARROW},
{L'↫', ACS_LARROW}, {L'↰', ACS_LARROW}, {L'↵', ACS_LARROW},
{L'↼', ACS_LARROW}, {L'↽', ACS_LARROW}, {L'⇐', ACS_LARROW},
{L'⇚', ACS_LARROW}, {L'⇠', ACS_LARROW}, {L'⇜', ACS_LARROW},
{L'⇦', ACS_LARROW}, {L'⇷', ACS_LARROW}, {L'⇺', ACS_LARROW},
{L'⇺', ACS_LARROW}, {L'⇽', ACS_LARROW}, {L'⟵', ACS_LARROW},
{L'⟸', ACS_LARROW}, {L'⟽', ACS_LARROW}, {L'⤆', ACS_LARROW},
{L'⤌', ACS_LARROW}, {L'⤎', ACS_LARROW}, {L'⤶', ACS_LARROW},
{L'⬅', ACS_LARROW}, {L'⏎', ACS_LARROW}, {L'⍃', ACS_LARROW},
{L'⍇', ACS_LARROW}, {L'⏴', ACS_LARROW},
{L'→', ACS_RARROW}, {L'▶', ACS_RARROW}, {L'➔', ACS_RARROW},
{L'➙', ACS_RARROW}, {L'➛', ACS_RARROW}, {L'➜', ACS_RARROW},
{L'➝', ACS_RARROW}, {L'➟', ACS_RARROW}, {L'➡', ACS_RARROW},
{L'➢', ACS_RARROW}, {L'➣', ACS_RARROW}, {L'➤', ACS_RARROW},
{L'➥', ACS_RARROW}, {L'➦', ACS_RARROW}, {L'↪', ACS_RARROW},
{L'↠', ACS_RARROW}, {L'↣', ACS_RARROW}, {L'↦', ACS_RARROW},
{L'↬', ACS_RARROW}, {L'↱', ACS_RARROW}, {L'↳', ACS_RARROW},
{L'⇀', ACS_RARROW}, {L'⇁', ACS_RARROW}, {L'⇒', ACS_RARROW},
{L'⇛', ACS_RARROW}, {L'⇝', ACS_RARROW}, {L'⇢', ACS_RARROW},
{L'⇥', ACS_RARROW}, {L'⇨', ACS_RARROW}, {L'⇰', ACS_RARROW},
{L'⇶', ACS_RARROW}, {L'⇸', ACS_RARROW}, {L'⇻', ACS_RARROW},
{L'⇾', ACS_RARROW}, {L'⟶', ACS_RARROW}, {L'⟹', ACS_RARROW},
{L'⟾', ACS_RARROW}, {L'⟼', ACS_RARROW}, {L'⤃', ACS_RARROW},
{L'⤅', ACS_RARROW}, {L'⤁', ACS_RARROW}, {L'⟿', ACS_RARROW},
{L'⤀', ACS_RARROW}, {L'⤇', ACS_RARROW}, {L'⤍', ACS_RARROW},
{L'⤏', ACS_RARROW}, {L'⤐', ACS_RARROW}, {L'⤑', ACS_RARROW},
{L'⤔', ACS_RARROW}, {L'⤕', ACS_RARROW}, {L'⤖', ACS_RARROW},
{L'⤘', ACS_RARROW}, {L'⤗', ACS_RARROW}, {L'⤷', ACS_RARROW},
{L'➧', ACS_RARROW}, {L'➳', ACS_RARROW}, {L'➲', ACS_RARROW},
{L'➱', ACS_RARROW}, {L'➯', ACS_RARROW}, {L'➮', ACS_RARROW},
{L'➭', ACS_RARROW}, {L'➬', ACS_RARROW}, {L'➫', ACS_RARROW},
{L'➪', ACS_RARROW}, {L'➩', ACS_RARROW}, {L'➨', ACS_RARROW},
{L'➵', ACS_RARROW}, {L'➸', ACS_RARROW}, {L'➺', ACS_RARROW},
{L'➾', ACS_RARROW}, {L'➽', ACS_RARROW}, {L'➼', ACS_RARROW},
{L'➻', ACS_RARROW}, {L'⍄', ACS_RARROW}, {L'⍈', ACS_RARROW},
{L'⏵', ACS_RARROW},
{L'▼', ACS_DARROW}, {L'↓', ACS_DARROW}, {L'↡', ACS_DARROW},
{L'↧', ACS_DARROW}, {L'↴', ACS_DARROW}, {L'⤵', ACS_DARROW},
{L'⇂', ACS_DARROW}, {L'⇃', ACS_DARROW}, {L'⇓', ACS_DARROW},
{L'⇓', ACS_DARROW}, {L'⇣', ACS_DARROW}, {L'⇩', ACS_DARROW},
{L'⤋', ACS_DARROW}, {L'⬇', ACS_DARROW}, {L'⬎', ACS_DARROW},
{L'⬐', ACS_DARROW}, {L'⍗', ACS_DARROW}, {L'⍌', ACS_DARROW},
{L'↑', ACS_UARROW}, {L'▲', ACS_UARROW}, {L'↟', ACS_UARROW},
{L'↥', ACS_UARROW}, {L'↾', ACS_UARROW}, {L'↿', ACS_UARROW},
{L'⇑', ACS_UARROW}, {L'⇞', ACS_UARROW}, {L'⇡', ACS_UARROW},
{L'⇪', ACS_UARROW}, {L'⇧', ACS_UARROW}, {L'⇮', ACS_UARROW},
{L'⇯', ACS_UARROW}, {L'⇭', ACS_UARROW}, {L'⇬', ACS_UARROW},
{L'⇫', ACS_UARROW}, {L'⤉', ACS_UARROW}, {L'⤊', ACS_UARROW},
{L'⤒', ACS_UARROW}, {L'⤴', ACS_UARROW}, {L'⥔', ACS_UARROW},
{L'⥘', ACS_UARROW}, {L'⥜', ACS_UARROW}, {L'⥠', ACS_UARROW},
{L'⬆', ACS_UARROW}, {L'⬏', ACS_UARROW}, {L'⬑', ACS_UARROW},
{L'⍐', ACS_UARROW}, {L'⍓', ACS_UARROW}, {L'⍍', ACS_UARROW},
{L'▚', ACS_BOARD}, {L'▞', ACS_BOARD}, {L'␋', ACS_LANTERN},
{L'█', ACS_BLOCK}, {L'≤', ACS_LEQUAL}, {L'≥', ACS_GEQUAL},
{L'π', ACS_PI}, {L'≠', ACS_NEQUAL}, {L'£', ACS_STERLING},
{L'×', 'x'}, {L'╳', 'X'}, {L'☓', 'x'},
{L'✕', 'X'}, {L'✖', 'X'}, {L'⨉', 'X'},
{L'⨯', 'X'}, {L'🗙', 'X'}, {L'🗴', 'X'},
{L'🞩', 'X'},
{L'✓', 'x'}, {L'✔', 'x'}, {L'🗸', 'x'},
{L'🗹', 'x'}, {L'☑', 'x'}, {L'☒', 'x'},
{L'⊠', 'x'}, {L'⊗', 'x'}, {L'⛒', 'x'},
{L'◉', 'x'}, {L'■', 'x'}, {L'▣', 'x'},
{L'☐', ACS_BLOCK}, {L'⊙', ACS_BLOCK}, {L'○', ACS_BLOCK},
{L'▢', ACS_BLOCK}, {L'□', ACS_BLOCK},
{L'♝', 'B'}, {L'♚', 'K'}, {L'♞','N'},
{L'♟', 'P'}, {L'♛','Q'}, {L'♜','R'},
{L'⁸', '8'}, {L'⁷', '7'}, {L'⁶', '6'},
{L'⁵', '5'}, {L'⁴', '4'}, {L'³', '3'},
{L'²', '2'}, {L'¹', '1'},
{L'ᵃ', 'a'}, {L'ᵇ', 'b'}, {L'ᶜ', 'c'},
{L'ᵈ', 'd'}, {L'ᵉ', 'e'}, {L'ᶠ', 'f'},
{L'ᵍ', 'g'}, {L'ʰ', 'h'}
};
} // namespace
namespace cppurses {
namespace detail {
/// Find a chtype representation of wchar_t \p symbol.
/** \p use_addch is set to true if ncurses addch function is needed to display
* the symbol. */
chtype get_chtype(wchar_t symbol, bool& use_addch) {
auto result = chtype{'?'};
if (symbol <= std::numeric_limits<signed char>::max()) {
result = symbol;
} else if (extended_chars.count(symbol) != 0) {
use_addch = true;
result = extended_chars.find(symbol)->second;
}
return result;
}
} // namespace detail
} // namespace cppurses
| 51.306452
| 78
| 0.432149
|
RyanDraves
|
c69ae19b3e2c7b617bd2e0cf9cb9aaa22a676e70
| 1,358
|
cpp
|
C++
|
test/tuple/get.rv.cpp
|
qicosmos/hana
|
b0f8cf2bf19d491b7b739dcb7b8d7497b0e5829f
|
[
"BSL-1.0"
] | 2
|
2015-12-06T05:10:14.000Z
|
2021-09-05T21:48:27.000Z
|
test/tuple/get.rv.cpp
|
qicosmos/hana
|
b0f8cf2bf19d491b7b739dcb7b8d7497b0e5829f
|
[
"BSL-1.0"
] | null | null | null |
test/tuple/get.rv.cpp
|
qicosmos/hana
|
b0f8cf2bf19d491b7b739dcb7b8d7497b0e5829f
|
[
"BSL-1.0"
] | 1
|
2017-06-06T10:50:17.000Z
|
2017-06-06T10:50:17.000Z
|
/*
@copyright Louis Dionne 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#include <boost/hana/assert.hpp>
#include <boost/hana/tuple.hpp>
#include <laws/base.hpp>
#include <utility>
#include <memory>
namespace hana = boost::hana;
namespace test = hana::test;
int main() {
{
using T = hana::tuple<std::unique_ptr<int>>;
T t(std::unique_ptr<int>(new int(3)));
std::unique_ptr<int> p = hana::at_c<0>(std::move(t));
BOOST_HANA_RUNTIME_CHECK(*p == 3);
}
// make sure we don't double-move and do other weird stuff
{
hana::tuple<test::Tracked, test::Tracked, test::Tracked> xs{
test::Tracked{1}, test::Tracked{2}, test::Tracked{3}
};
test::Tracked a = hana::at_c<0>(std::move(xs)); (void)a;
test::Tracked b = hana::at_c<1>(std::move(xs)); (void)b;
test::Tracked c = hana::at_c<2>(std::move(xs)); (void)c;
}
// test with nested closures
{
using Inner = hana::tuple<test::Tracked, test::Tracked>;
hana::tuple<Inner> xs{Inner{test::Tracked{1}, test::Tracked{2}}};
test::Tracked a = hana::at_c<0>(hana::at_c<0>(std::move(xs))); (void)a;
test::Tracked b = hana::at_c<1>(hana::at_c<0>(std::move(xs))); (void)b;
}
}
| 30.863636
| 79
| 0.603093
|
qicosmos
|
c6a1353a06c24b8ae10521da918d476e8681bc53
| 1,187
|
cpp
|
C++
|
0033.SearchinRotatedSortedArray/main.cpp
|
SumanSudhir/LeetCode
|
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
|
[
"MIT"
] | 1
|
2020-01-13T11:10:35.000Z
|
2020-01-13T11:10:35.000Z
|
0033.SearchinRotatedSortedArray/main.cpp
|
SumanSudhir/LeetCode
|
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
|
[
"MIT"
] | 4
|
2020-01-01T09:47:39.000Z
|
2020-04-08T08:34:29.000Z
|
0033.SearchinRotatedSortedArray/main.cpp
|
SumanSudhir/LeetCode
|
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
|
[
"MIT"
] | null | null | null |
class Solution {
public:
int binarySearch(vector<int>& nums, int start, int stop, int target){
if(stop < start) return -1;
int mid = (start+stop)/2;
if(target == nums[mid]) return mid;
else if(target < nums[mid]) return binarySearch(nums, start, mid-1, target);
return binarySearch(nums, mid+1, stop, target);
}
int pivot(vector<int>& nums, int start, int stop){
if(stop < start) return -1;
if(start == stop) return start;
int mid = (start+stop)/2;
if(mid < stop && nums[mid] > nums[mid+1]) return mid;
if(mid > start && nums[mid] < nums[mid-1]) return mid-1;
if(nums[start] >= nums[mid]) return pivot(nums, start, mid-1);
return pivot(nums, mid+1, stop);
}
int search(vector<int>& nums, int target){
int n = nums.size();
int pivot_index = pivot(nums, 0, n-1);
if(pivot_index == -1) return binarySearch(nums, 0, n-1, target);
if(nums[pivot_index] == target) return pivot_index;
if(nums[0] <= target) return binarySearch(nums, 0, pivot_index-1, target);
return binarySearch(nums, pivot_index+1, n-1, target);
}
};
| 35.969697
| 84
| 0.586352
|
SumanSudhir
|
c6a257f37229d8c91b97b3a63b8b85c638d4f429
| 1,243
|
cpp
|
C++
|
src/snake.cpp
|
hassanelshazly/snake
|
d4980d841d0346dd31c3359686922e11b89c79d3
|
[
"MIT"
] | null | null | null |
src/snake.cpp
|
hassanelshazly/snake
|
d4980d841d0346dd31c3359686922e11b89c79d3
|
[
"MIT"
] | null | null | null |
src/snake.cpp
|
hassanelshazly/snake
|
d4980d841d0346dd31c3359686922e11b89c79d3
|
[
"MIT"
] | null | null | null |
#include "include/snake.h"
Snake::Snake(int sx, int sy)
{
snakeBlocks = new int*[650];
for(int i = 0; i < 650; i++)snakeBlocks[i] = new int[2];
for(int i = 0; i < 650; i++)snakeBlocks[i][0] = -1;
for(int i = 0; i < 650; i++)snakeBlocks[i][1] = -1;
snakeBlocks[0][0] = sx;
snakeBlocks[0][1] = sy;
length = 1;
}
void Snake::update(int dir){
for(int i = 649; i > 0; i--)snakeBlocks[i][1] = snakeBlocks[i-1][1];
for(int i = 649; i > 0; i--)snakeBlocks[i][0] = snakeBlocks[i-1][0];
if(dir == 1)snakeBlocks[0][0]++; //right
if(dir == 2)snakeBlocks[0][0]--; //left
if(dir == 3)snakeBlocks[0][1]++; //down
if(dir == 4)snakeBlocks[0][1]--; //up
if(snakeBlocks[0][0] > 24)snakeBlocks[0][0] = 0;
if(snakeBlocks[0][0] < 0)snakeBlocks[0][0] = 24;
if(snakeBlocks[0][1] > 24)snakeBlocks[0][1] = 0;
if(snakeBlocks[0][1] < 0)snakeBlocks[0][1] = 24;
}
void Snake::incLength(){
length++;
}
bool Snake::checkCollision(){
bool coll = false;
for(int i = 0; i<length; i++){
for(int j = 0; j < length; j++){
if(i != j)
if(snakeBlocks[i][0] == snakeBlocks[j][0] && snakeBlocks[i][1] == snakeBlocks[j][1])coll = true;
}
}
return coll;
}
| 30.317073
| 108
| 0.536605
|
hassanelshazly
|
c6a7330c1fbfd2f40eaf0a5cfdf9232c02fd56f9
| 681
|
cpp
|
C++
|
100883/D.cpp
|
anthony-huang/wan-panchi
|
d6f3cef10c14e28dcef089c7f60113521647891a
|
[
"MIT"
] | 1
|
2019-03-18T08:27:05.000Z
|
2019-03-18T08:27:05.000Z
|
100883/D.cpp
|
anthony-huang/wan-panchi
|
d6f3cef10c14e28dcef089c7f60113521647891a
|
[
"MIT"
] | null | null | null |
100883/D.cpp
|
anthony-huang/wan-panchi
|
d6f3cef10c14e28dcef089c7f60113521647891a
|
[
"MIT"
] | null | null | null |
#include <bits/stdc++.h>
using namespace std;
int n, k;
int p[1000000];
bool can(long long m) {
int x = k;
int cnt = 0, mx = 0;
for (int i = 0; i < n; ++i) {
++cnt;
mx = max(mx, p[i]);
if ((long long) mx * cnt > m) {
--x;
cnt = 1;
mx = p[i];
}
}
return x > 0;
}
int main() {
int t;
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &k);
int mx = 0;
for (int i = 0; i < n; ++i) {
scanf("%d", p + i);
mx = max(mx, p[i]);
}
long long l = mx, r = (long long) n * mx, ans;
while (l <= r) {
long long mid = (l + r) >> 1;
if (can(mid)) {
ans = mid;
r = mid - 1;
} else l = mid + 1;
}
cout << ans << endl;
}
return 0;
}
| 15.477273
| 48
| 0.434655
|
anthony-huang
|
c6ad149dd30602133d29c3b07cb79fba74165f44
| 1,579
|
hpp
|
C++
|
shadow/operators/kernels/normalize.hpp
|
junluan/shadow
|
067d1c51d7c38bc1c985008a2e2e1599bbf11a8c
|
[
"Apache-2.0"
] | 20
|
2017-07-04T11:22:47.000Z
|
2022-01-16T03:58:32.000Z
|
shadow/operators/kernels/normalize.hpp
|
junluan/shadow
|
067d1c51d7c38bc1c985008a2e2e1599bbf11a8c
|
[
"Apache-2.0"
] | 2
|
2017-12-03T13:07:39.000Z
|
2021-01-13T11:11:52.000Z
|
shadow/operators/kernels/normalize.hpp
|
junluan/shadow
|
067d1c51d7c38bc1c985008a2e2e1599bbf11a8c
|
[
"Apache-2.0"
] | 10
|
2017-09-30T05:06:30.000Z
|
2020-11-13T05:43:44.000Z
|
#ifndef SHADOW_OPERATORS_KERNELS_NORMALIZE_HPP_
#define SHADOW_OPERATORS_KERNELS_NORMALIZE_HPP_
#include "core/kernel.hpp"
namespace Shadow {
namespace Vision {
template <DeviceType D, typename T>
void Normalize(const T* in_data, int outer_num, int dim, int inner_num,
T* val_data, float p, float eps, T* out_data, Context* context);
} // namespace Vision
} // namespace Shadow
namespace Shadow {
class NormalizeKernel : public Kernel {
public:
virtual void Run(const std::shared_ptr<Blob>& input,
std::shared_ptr<Blob>& output, Workspace* ws, float p,
int axis, float eps) = 0;
};
template <DeviceType D>
class NormalizeKernelDefault : public NormalizeKernel {
public:
void Run(const std::shared_ptr<Blob>& input, std::shared_ptr<Blob>& output,
Workspace* ws, float p, int axis, float eps) override {
int outer_num = input->count(0, axis), dim = input->shape(axis),
inner_num = input->count(axis + 1);
ws->GrowTempBuffer(outer_num * inner_num * sizeof(float));
auto scalar = ws->CreateTempBlob({outer_num, inner_num}, DataType::kF32);
Vision::Normalize<D, float>(input->data<float>(), outer_num, dim, inner_num,
scalar->mutable_data<float>(), p, eps,
output->mutable_data<float>(), ws->Ctx().get());
}
DeviceType device_type() const override { return D; }
std::string kernel_type() const override { return "Default"; }
};
} // namespace Shadow
#endif // SHADOW_OPERATORS_KERNELS_NORMALIZE_HPP_
| 30.365385
| 80
| 0.664345
|
junluan
|
c6ad6587bbaf08e1ee4cd79aa770015f6a16c54c
| 3,389
|
hh
|
C++
|
sdk/sdk/share/live555/liveMedia/WFD/WifiDisplaySource.hh
|
doyaGu/C0501Q_HWJL01
|
07a71328bd9038453cbb1cf9c276a3dd1e416d63
|
[
"MIT"
] | 1
|
2021-10-09T08:05:50.000Z
|
2021-10-09T08:05:50.000Z
|
sdk/sdk/share/live555/liveMedia/WFD/WifiDisplaySource.hh
|
doyaGu/C0501Q_HWJL01
|
07a71328bd9038453cbb1cf9c276a3dd1e416d63
|
[
"MIT"
] | null | null | null |
sdk/sdk/share/live555/liveMedia/WFD/WifiDisplaySource.hh
|
doyaGu/C0501Q_HWJL01
|
07a71328bd9038453cbb1cf9c276a3dd1e416d63
|
[
"MIT"
] | null | null | null |
/**********
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
**********/
// Copyright (c) 1996-2012, Live Networks, Inc. All rights reserved
// A subclass of "RTSPServer" that creates "ServerMediaSession"s on demand,
// based on whether or not the specified stream name exists as a file
// Header file
#ifndef _WIFI_DISPLAY_SOURCE_HH
#define _WIFI_DISPLAY_SOURCE_HH
#ifndef _RTSP_SERVER_SUPPORTING_HTTP_STREAMING_HH
#include "RTSPServerSupportingHTTPStreaming.hh"
#endif
class WifiDisplaySource: public RTSPServerSupportingHTTPStreaming {
public:
static WifiDisplaySource* createNew(UsageEnvironment& env, Port ourPort,
UserAuthenticationDatabase* authDatabase,
unsigned reclamationTestSeconds = 65);
protected:
WifiDisplaySource(UsageEnvironment& env, int ourSocket, Port ourPort,
UserAuthenticationDatabase* authDatabase, unsigned reclamationTestSeconds);
// called only by createNew();
virtual ~WifiDisplaySource();
protected: // redefined virtual functions
virtual ServerMediaSession* lookupServerMediaSession(char const* streamName);
virtual RTSPClientSession* createNewClientSession(unsigned sessionId, int clientSocket, struct sockaddr_in clientAddr);
public: // should be protected, but some old compilers complain otherwise
class WFDClientSession: public RTSPServerSupportingHTTPStreaming::RTSPClientSessionSupportingHTTPStreaming {
public:
WFDClientSession(RTSPServer& ourServer, unsigned sessionId,
int clientSocket, struct sockaddr_in clientAddr);
virtual ~WFDClientSession();
void sendM1();
void sendM3();
void sendM4();
void sendM5();
void sendM16();
protected: // redefined virtual functions
typedef void (responseHandler)(int resultCode, char* resultString);
class RequestRecord {
public:
RequestRecord(unsigned cseq, char const* commandName, responseHandler* handler, char const* contentStr = NULL);
virtual ~RequestRecord();
unsigned& cseq() { return fCSeq; }
char const* commandName() const { return fCommandName; }
char* contentStr() const { return fContentStr; }
responseHandler*& handler() { return fHandler; }
private:
unsigned fCSeq;
char const* fCommandName;
char* fContentStr;
responseHandler* fHandler;
};
protected:
virtual void handleCmd_Response(unsigned responseCode, char const* responseStr);
virtual void handleCmd_OPTIONS(char const* cseq);
unsigned sendRequest(RequestRecord* request);
void handleRequestError(RequestRecord* request);
private:
RequestRecord* fRequest;
Authenticator* fAuthenticator;
unsigned fCSeq;
};
};
#endif
| 36.44086
| 121
| 0.753615
|
doyaGu
|
c6af6b2dc0946b6cb76c14570da7c1f5a046fd95
| 8,727
|
cpp
|
C++
|
source/util.cpp
|
gouarin/binder
|
90cf5b31b6f4ecad3fe87518ca2b949dc9e8ed1a
|
[
"MIT"
] | 211
|
2017-01-28T21:55:20.000Z
|
2022-03-28T12:02:47.000Z
|
source/util.cpp
|
gouarin/binder
|
90cf5b31b6f4ecad3fe87518ca2b949dc9e8ed1a
|
[
"MIT"
] | 155
|
2017-01-06T11:36:29.000Z
|
2022-03-30T22:03:22.000Z
|
source/util.cpp
|
gouarin/binder
|
90cf5b31b6f4ecad3fe87518ca2b949dc9e8ed1a
|
[
"MIT"
] | 40
|
2017-01-30T13:36:02.000Z
|
2022-03-10T09:09:26.000Z
|
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// Copyright (c) 2016 Sergey Lyskov <sergey.lyskov@jhu.edu>
//
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.
/// @file binder/util.cpp
/// @brief Various helper functions
/// @author Sergey Lyskov
#include <util.hpp>
#include <binder.hpp>
#include <enum.hpp>
#include <type.hpp>
#include <class.hpp>
#include <clang/AST/ASTContext.h>
#include <clang/AST/ExprCXX.h>
#include <clang/Basic/SourceManager.h>
#include <clang/AST/Comment.h>
//#include <experimental/filesystem>
#include <cstdlib>
#include <fstream>
#include <cctype>
using namespace llvm;
using namespace clang;
using std::string;
using std::vector;
namespace binder {
/// Split string using given separator
vector<string> split(string const &buffer, string const & separator)
{
string line;
vector<string> lines;
for(uint i=0; i<buffer.size(); ++i) {
if( buffer.compare(i, separator.size(), separator) ) line.push_back( buffer[i] );
else {
lines.push_back(line);
line.resize(0);
}
}
if( line.size() ) lines.push_back(line);
return lines;
}
/// Replace all occurrences of string
void replace(string &r, string const & from, string const &to)
{
size_t i = r.size();
while( ( i = r.rfind(from, i) ) != string::npos) {
r.replace(i, from.size(), to);
if(i) --i; else break;
}
}
/// Replace all occurrences of string and return result as new string
string replace_(string const &s, string const & from, string const &to)
{
string r{s};
replace(r, from, to);
return r;
}
/// check if string begins with given prefix
bool begins_with(std::string const &source, std::string const &prefix)
{
return !source.compare(0, prefix.size(), prefix);
}
/// check if string ends with given prefix
bool ends_with(std::string const &source, std::string const &prefix)
{
if( prefix.size() > source.size() ) return false;
return !source.compare(source.size() - prefix.size(), prefix.size(), prefix);
}
string indent(string const &code, string const &indentation)
{
auto lines = split(code);
string r;
for(auto & l : lines) r += l.size() ? indentation + l + '\n' : l + '\n';
return r;
}
/// Try to read exisitng file and if content does not match to code - write a new version. Also create nested dirs starting from prefix if nessesary.
void update_source_file(std::string const &prefix, std::string const &file_name, std::string const &code)
{
string path = prefix;
vector<string> dirs = split(file_name, "/"); dirs.pop_back();
for(auto &d : dirs) path += "/" + d;
//std::experimental::filesystem::create_directories(path);
string command_line = "mkdir -p " + path;
system( command_line.c_str() );
string full_file_name = prefix + '/' + file_name;
std::ifstream f(full_file_name);
std::string old_code((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
if( old_code != code ) {
if( O_verbose ) outs() << "Writing " << full_file_name << "\n";
std::ofstream f(full_file_name);
if( f.fail() ) throw std::runtime_error("ERROR: Can not open file " + full_file_name + " for writing...");
f << code;
} else {
if( O_verbose ) outs() << "File " << full_file_name << " is up-to-date, skipping...\n";
}
}
string namespace_from_named_decl(NamedDecl const *decl)
{
//return decl->getOuterLexicalRecordContext()->getNameAsString();
//outs() << decl->getDeclKindName() << "\n";
string qn = standard_name( decl->getQualifiedNameAsString() );
string n = decl->getNameAsString();
int namespace_len = qn.size() - n.size();
string path = qn.substr(0, namespace_len > 1 ? namespace_len-2 : namespace_len ); // removing trailing '::'
return path;
}
/// generate unique string representation of type represented by given declaration
string typename_from_type_decl(TypeDecl const *decl)
{
return standard_name( decl->getTypeForDecl()->getCanonicalTypeInternal()/*getCanonicalType()*/.getAsString() );
}
/// Calculate base (upper) namespace for given one: core::pose::motif --> core::pose
string base_namespace(string const & ns)
{
size_t f = ns.rfind("::");
if( f == string::npos ) return "";
else return ns.substr(0, f);
}
/// Calculate last namespace for given one: core::pose::motif --> motif
string last_namespace(string const & ns)
{
size_t f = ns.rfind("::");
if( f == string::npos ) return ns;
else return ns.substr(f+2, ns.size()-f-2);
}
// replace all _Bool types with bool
void fix_boolean_types(string &type)
{
string B("_Bool");
size_t i = 0;
while( ( i = type.find(B, i) ) != string::npos ) {
if( ( i==0 or ( !std::isalpha(type[i-1]) and !std::isdigit(type[i-1]) ) ) and
( i+B.size() == type.size() or ( !std::isalpha(type[i+B.size()]) and !std::isdigit(type[i+B.size()]) ) ) ) type.replace(i, B.size(), "bool");
++i;
}
}
// Generate string representation of given expression
string expresion_to_string(clang::Expr *e)
{
std::string _;
llvm::raw_string_ostream s(_);
if(e) {
clang::LangOptions lang_opts;
lang_opts.CPlusPlus = true;
clang::PrintingPolicy Policy(lang_opts);
e->printPretty(s, 0, Policy);
}
return s.str();
}
// Generate string representation of given TemplateArgument
string template_argument_to_string(clang::TemplateArgument const &t)
{
clang::LangOptions lang_opts;
lang_opts.CPlusPlus = true;
clang::PrintingPolicy Policy(lang_opts);
std::string _;
llvm::raw_string_ostream s(_);
#if (LLVM_VERSION_MAJOR < 13)
t.print(Policy, s);
#else
t.print(Policy, s, true);
#endif
return s.str();
}
// calcualte line in source file for NamedDecl
string line_number(NamedDecl const *decl)
{
ASTContext & ast_context( decl->getASTContext() );
SourceManager & sm( ast_context.getSourceManager() );
return std::to_string( sm.getSpellingLineNumber(decl->getLocation() ) );
}
// generate string represetiong class name that could be used in python
string mangle_type_name(string const &name, bool mark_template)
{
string r;
bool mangle = true;
bool template_ = false;
for(auto & c : name) {
if(c!=' ' and c!='<' and c!='>' and c!=',' and c!=':') { r.push_back(c); mangle=false; }
else if(!mangle) { mangle = true; r.push_back('_'); }
if( c=='<' or c=='>' or c==',') template_ = true;
}
if(template_ and mark_template) r.push_back('t');
return r;
}
// generate C++ comment line for given declartion along with file path and line number: // core::scoring::vdwaals::VDWAtom file:core/scoring/vdwaals/VDWTrie.hh line:43
string generate_comment_for_declaration(clang::NamedDecl const *decl)
{
string const include = relevant_include(decl);
return "// " + standard_name( decl->getQualifiedNameAsString() ) + " file:" + (include.size() ? include.substr(1, include.size()-2) : "") + " line:" + line_number(decl) + "\n";
}
// extract text from hierarchy of comments
string get_text(comments::Comment const *C, SourceManager const & SM, SourceLocation previous)
{
if( auto tc = dyn_cast<comments::TextComment>(C) ) return string(tc->getText());
else {
string r;
if( isa<comments::ParagraphComment>(C) ) r += '\n';
for(auto i = C->child_begin(); i!=C->child_end(); ++i) {
#if (LLVM_VERSION_MAJOR < 8)
if( SM.getSpellingLineNumber(previous) != SM.getSpellingLineNumber( (*i)->getLocStart() ) ) { // getBeginLoc
previous = (*i)->getLocStart(); // getBeginLoc();
r += '\n';
}
#endif
#if (LLVM_VERSION_MAJOR >= 8)
if( SM.getSpellingLineNumber(previous) != SM.getSpellingLineNumber( (*i)->getBeginLoc() ) ) { // getBeginLoc
previous = (*i)->getBeginLoc(); // getBeginLoc();
r += '\n';
}
#endif
r += get_text(*i, SM, previous);
}
return r;
}
}
// extract doc string (Doxygen comments) for given declaration and convert it to C++ source code string
std::string generate_documentation_string_for_declaration(clang::Decl const* decl)
{
string text;
ASTContext & ast_context( decl->getASTContext() );
if( auto comment = ast_context.getLocalCommentForDeclUncached(decl) ) {
SourceManager & sm( ast_context.getSourceManager() );
//comment->dumpColor();
text = get_text(comment, sm, SourceLocation());
uint i=0;
for(; i<text.size() and (text[i]==' ' or text[i]=='\n'); ++i) {}
if(i) text = text.substr(i);
//replace(text, "\n\n\n", "\n");
//replace(text, "\n\n", "\n");
//replace(text, "\n\n\n\n", "\n\n");
//replace(text, "\n\n\n", "\n\n");
replace(text, "\\", "\\\\");
replace(text, "\"", "\\\"");
replace(text, "\n", "\\n");
//outs() << text << "\n";
}
//if( auto comment = ast_context->getLocalCommentForDeclUncached(decl) ) comment->dumpColor();
return text;
}
} // namespace binder
| 26.606707
| 177
| 0.669417
|
gouarin
|
c6b413bf7542aeb054f4e918a6a4e6012e03a188
| 1,679
|
cpp
|
C++
|
Redshift/Source/Components/Renderable.cpp
|
allogic/Redshift
|
4606267b53e3d094ba588acb9ceaa97e3289632b
|
[
"MIT"
] | null | null | null |
Redshift/Source/Components/Renderable.cpp
|
allogic/Redshift
|
4606267b53e3d094ba588acb9ceaa97e3289632b
|
[
"MIT"
] | null | null | null |
Redshift/Source/Components/Renderable.cpp
|
allogic/Redshift
|
4606267b53e3d094ba588acb9ceaa97e3289632b
|
[
"MIT"
] | null | null | null |
#include <Components/Renderable.h>
#include <Components/Transform.h>
#include <Globals/World.h>
Renderable::Renderable(
World& world,
std::string const& meshName,
std::string const& programName,
std::string const& textureAlbedoName,
std::string const& textureNormalName,
std::string const& textureSpecularName,
std::string const& textureMetallicName,
std::string const& textureRoughnessName,
std::string const& textureAmbientOcclusionName)
: Component(world)
, mMesh{ World::GetHandle<DefaultMesh>(mWorld, meshName) }
, mProgram{ World::GetHandle<RenderProgram>(mWorld, programName) }
, mTextureAlbedo{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureAlbedoName) }
, mTextureNormal{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureNormalName) }
, mTextureSpecular{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureSpecularName) }
, mTextureMetallic{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureMetallicName) }
, mTextureRoughness{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureRoughnessName) }
, mTextureAmbientOcclusion{ World::GetHandle<Texture2DR32RGBA>(mWorld, textureAmbientOcclusionName) }
{
}
void Renderable::SubmitRenderTask(Transform* transform, std::queue<DeferredRenderTask>& renderQueue) const
{
// Minimum requirements are mesh and program
if (mMesh.Get() && mProgram.Get())
{
renderQueue.emplace(DeferredRenderTask
{
transform,
mMesh.Get(),
mProgram.Get(),
mTextureAlbedo.Get(),
mTextureNormal.Get(),
mTextureSpecular.Get(),
mTextureMetallic.Get(),
mTextureRoughness.Get(),
mTextureAmbientOcclusion.Get(),
});
}
}
| 35.723404
| 106
| 0.733175
|
allogic
|
c6b4b1d50da7c4510fbccbe69768f08a4a3209e4
| 28,691
|
cpp
|
C++
|
Spike/SimulinkModel/Spike_grt_rtw/Spike_data.cpp
|
NixonCTChan/Simulink-Sim
|
d63678af48bc1e39fa30a885c1a989e31e2310c6
|
[
"BSD-3-Clause"
] | null | null | null |
Spike/SimulinkModel/Spike_grt_rtw/Spike_data.cpp
|
NixonCTChan/Simulink-Sim
|
d63678af48bc1e39fa30a885c1a989e31e2310c6
|
[
"BSD-3-Clause"
] | 2
|
2021-05-05T11:58:53.000Z
|
2021-06-01T16:34:04.000Z
|
Spike/SimulinkModel/Spike_grt_rtw/Spike_data.cpp
|
NixonCTChan/Simulink-Sim
|
d63678af48bc1e39fa30a885c1a989e31e2310c6
|
[
"BSD-3-Clause"
] | 6
|
2021-02-13T00:14:52.000Z
|
2021-11-09T22:57:56.000Z
|
/*
* Spike_data.cpp
*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* Code generation for model "Spike".
*
* Model version : 1.172
* Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
* C++ source code generated on : Thu Dec 17 00:18:38 2020
*
* Target selection: grt.tlc
* Note: GRT includes extra infrastructure and instrumentation for prototyping
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Spike.h"
#include "Spike_private.h"
/* Block parameters (default storage) */
P_Spike_T SpikeModelClass::Spike_P = {
{ 0.0, 0.0 },
16.2,
16.2,
{ 50.0, 0.0, 0.0 },
10.8,
10.8,
1.32,
1.32,
180.0,
90.0,
180.0,
180.0,
90.0,
180.0,
{ 0.0, 0.0, 0.0 },
{ 1541.0, 0.0, 0.0, 0.0, 1898.0, 0.0, 0.0, 0.0, 3199.0 },
800.0,
{ 0.0, 0.0, 0.0 },
0.0,
{ 0.0, 0.0, 150.0 },
-90.0,
-1.0,
90.0,
180.0,
-180.0,
180.0,
-180.0,
0.0,
180.0,
-90.0,
-1.0,
90.0,
360.0,
180.0,
-180.0,
360.0,
180.0,
-180.0,
-1.0,
21.322,
1.0,
6.378137E+6,
1.0,
1.0,
0.0033528106647474805,
1.0,
1.0,
1.0,
360.0,
-157.924,
180.0,
0.0,
360.0,
0.0,
-1.0,
3.1415926535897931,
-3.1415926535897931,
1.2754,
0.5,
0.0,
{ -15.0, -10.0, -5.0, -2.5, 0.0, 2.5, 5.0, 10.0, 15.0 },
343.0,
{ 0.02, 0.16, 0.3 },
{ 50.0, 150.0, 250.0 },
{ -0.076081, -0.051903, -0.025952, -0.012976, 0.0, 0.012976, 0.025952,
0.051903, 0.076081, -0.076748, -0.052358, -0.026179, -0.01309, 0.0, 0.01309,
0.026179, 0.052358, 0.076748, -0.07695, -0.052496, -0.026248, -0.013124, 0.0,
0.013124, 0.026248, 0.052496, 0.07695, -0.076078, -0.051901, -0.025951,
-0.012975, 0.0, 0.012975, 0.025951, 0.051901, 0.076078, -0.076745, -0.052356,
-0.026178, -0.013089, 0.0, 0.013089, 0.026178, 0.052356, 0.076745, -0.076947,
-0.052494, -0.026247, -0.013124, 0.0, 0.013124, 0.026247, 0.052494, 0.076947,
-0.076075, -0.0519, -0.02595, -0.012975, 0.0, 0.012975, 0.02595, 0.0519,
0.076075, -0.076742, -0.052354, -0.026177, -0.013089, 0.0, 0.013089,
0.026177, 0.052354, 0.076742, -0.076944, -0.052492, -0.026246, -0.013123,
0.0, 0.013123, 0.026246, 0.052492, 0.076944 },
{ -16.0, -12.0, -8.0, -4.0, -2.0, 0.0, 2.0, 4.0, 8.0, 12.0, 16.0, 20.0 },
{ -0.009808, -0.006878, -0.003949, -0.0012, 7.673E-5, 0.001363, 0.00272,
0.004135, 0.007089, 0.01001, 0.0119, 0.01238, -0.006691, -0.004692,
-0.002694, -0.0008185, 5.234E-5, 0.00093, 0.001856, 0.002821, 0.004836,
0.006826, 0.008115, 0.008448, -0.003345, -0.002346, -0.001347, -0.0004092,
2.617E-5, 0.000465, 0.0009278, 0.001411, 0.002418, 0.003413, 0.004058,
0.004224, -0.001673, -0.001173, -0.0006735, -0.0002046, 1.309E-5, 0.0002325,
0.0004639, 0.0007053, 0.001209, 0.001706, 0.002029, 0.002112, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001673, 0.001173, 0.0006735,
0.0002046, -1.309E-5, -0.0002325, -0.0004639, -0.0007053, -0.001209,
-0.001706, -0.002029, -0.002112, 0.003345, 0.002346, 0.001347, 0.0004092,
-2.617E-5, -0.000465, -0.0009278, -0.001411, -0.002418, -0.003413, -0.004058,
-0.004224, 0.006691, 0.004692, 0.002694, 0.0008185, -5.234E-5, -0.00093,
-0.001856, -0.002821, -0.004836, -0.006826, -0.008115, -0.008448, 0.009808,
0.006878, 0.003949, 0.0012, -7.673E-5, -0.001363, -0.00272, -0.004135,
-0.007089, -0.01001, -0.0119, -0.01238, -0.009928, -0.006976, -0.004008,
-0.001218, 7.794E-5, 0.001384, 0.002761, 0.004196, 0.00719, 0.01013, 0.01203,
0.01242, -0.006773, -0.004759, -0.002734, -0.0008311, 5.317E-5, 0.0009443,
0.001884, 0.002863, 0.004905, 0.006909, 0.008204, 0.008476, -0.003386,
-0.00238, -0.001367, -0.0004156, 2.658E-5, 0.0004722, 0.0009418, 0.001431,
0.002453, 0.003454, 0.004102, 0.004238, -0.001693, -0.00119, -0.0006835,
-0.0002078, 1.329E-5, 0.0002361, 0.0004709, 0.0007157, 0.001226, 0.001727,
0.002051, 0.002119, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.001693, 0.00119, 0.0006835, 0.0002078, -1.329E-5, -0.0002361,
-0.0004709, -0.0007157, -0.001226, -0.001727, -0.002051, -0.002119, 0.003386,
0.00238, 0.001367, 0.0004156, -2.658E-5, -0.0004722, -0.0009418, -0.001431,
-0.002453, -0.003454, -0.004102, -0.004238, 0.006773, 0.004759, 0.002734,
0.0008311, -5.317E-5, -0.0009443, -0.001884, -0.002863, -0.004905, -0.006909,
-0.008204, -0.008476, 0.009928, 0.006976, 0.004008, 0.001218, -7.794E-5,
-0.001384, -0.002761, -0.004196, -0.00719, -0.01013, -0.01203, -0.01242,
-0.00947, -0.00698, -0.004045, -0.001241, 7.977E-5, 0.00141, 0.002798,
0.004233, 0.007191, 0.009641, 0.01098, 0.006949, -0.006461, -0.004762,
-0.002759, -0.0008468, 5.442E-5, 0.0009616, 0.001909, 0.002888, 0.004906,
0.006577, 0.00749, 0.004741, -0.00323, -0.002381, -0.00138, -0.0004234,
2.721E-5, 0.0004808, 0.0009544, 0.001444, 0.002453, 0.003288, 0.003745,
0.00237, -0.001615, -0.001191, -0.0006899, -0.0002117, 1.36E-5, 0.0002404,
0.0004772, 0.0007219, 0.001226, 0.001644, 0.001872, 0.001185, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001615, 0.001191, 0.0006899,
0.0002117, -1.36E-5, -0.0002404, -0.0004772, -0.0007219, -0.001226,
-0.001644, -0.001872, -0.001185, 0.00323, 0.002381, 0.00138, 0.0004234,
-2.721E-5, -0.0004808, -0.0009544, -0.001444, -0.002453, -0.003288,
-0.003745, -0.00237, 0.006461, 0.004762, 0.002759, 0.0008468, -5.442E-5,
-0.0009616, -0.001909, -0.002888, -0.004906, -0.006577, -0.00749, -0.004741,
0.00947, 0.00698, 0.004045, 0.001241, -7.977E-5, -0.00141, -0.002798,
-0.004233, -0.007191, -0.009641, -0.01098, -0.006949, -0.009807, -0.006878,
-0.003949, -0.0012, 7.672E-5, 0.001363, 0.00272, 0.004135, 0.007089, 0.01001,
0.0119, 0.01238, -0.00669, -0.004692, -0.002694, -0.0008184, 5.234E-5,
0.0009299, 0.001856, 0.002821, 0.004836, 0.006826, 0.008115, 0.008448,
-0.003345, -0.002346, -0.001347, -0.0004092, 2.617E-5, 0.000465, 0.0009278,
0.00141, 0.002418, 0.003413, 0.004057, 0.004224, -0.001673, -0.001173,
-0.0006735, -0.0002046, 1.309E-5, 0.0002325, 0.0004639, 0.0007052, 0.001209,
0.001706, 0.002029, 0.002112, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.001673, 0.001173, 0.0006735, 0.0002046, -1.309E-5,
-0.0002325, -0.0004639, -0.0007052, -0.001209, -0.001706, -0.002029,
-0.002112, 0.003345, 0.002346, 0.001347, 0.0004092, -2.617E-5, -0.000465,
-0.0009278, -0.00141, -0.002418, -0.003413, -0.004057, -0.004224, 0.00669,
0.004692, 0.002694, 0.0008184, -5.234E-5, -0.0009299, -0.001856, -0.002821,
-0.004836, -0.006826, -0.008115, -0.008448, 0.009807, 0.006878, 0.003949,
0.0012, -7.672E-5, -0.001363, -0.00272, -0.004135, -0.007089, -0.01001,
-0.0119, -0.01238, -0.009927, -0.006976, -0.004008, -0.001218, 7.793E-5,
0.001384, 0.002761, 0.004196, 0.00719, 0.01013, 0.01203, 0.01242, -0.006772,
-0.004759, -0.002734, -0.0008311, 5.317E-5, 0.0009443, 0.001884, 0.002863,
0.004905, 0.006909, 0.008204, 0.008476, -0.003386, -0.002379, -0.001367,
-0.0004156, 2.658E-5, 0.0004721, 0.0009418, 0.001431, 0.002452, 0.003454,
0.004102, 0.004238, -0.001693, -0.00119, -0.0006835, -0.0002078, 1.329E-5,
0.0002361, 0.0004709, 0.0007157, 0.001226, 0.001727, 0.002051, 0.002119, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001693, 0.00119,
0.0006835, 0.0002078, -1.329E-5, -0.0002361, -0.0004709, -0.0007157,
-0.001226, -0.001727, -0.002051, -0.002119, 0.003386, 0.002379, 0.001367,
0.0004156, -2.658E-5, -0.0004721, -0.0009418, -0.001431, -0.002452,
-0.003454, -0.004102, -0.004238, 0.006772, 0.004759, 0.002734, 0.0008311,
-5.317E-5, -0.0009443, -0.001884, -0.002863, -0.004905, -0.006909, -0.008204,
-0.008476, 0.009927, 0.006976, 0.004008, 0.001218, -7.793E-5, -0.001384,
-0.002761, -0.004196, -0.00719, -0.01013, -0.01203, -0.01242, -0.00947,
-0.00698, -0.004045, -0.001241, 7.976E-5, 0.001409, 0.002798, 0.004233,
0.007191, 0.00964, 0.01098, 0.006949, -0.00646, -0.004762, -0.002759,
-0.0008468, 5.441E-5, 0.0009615, 0.001909, 0.002888, 0.004906, 0.006577,
0.007489, 0.00474, -0.00323, -0.002381, -0.00138, -0.0004234, 2.721E-5,
0.0004808, 0.0009543, 0.001444, 0.002453, 0.003288, 0.003745, 0.00237,
-0.001615, -0.00119, -0.0006898, -0.0002117, 1.36E-5, 0.0002404, 0.0004772,
0.0007219, 0.001226, 0.001644, 0.001872, 0.001185, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001615, 0.00119, 0.0006898, 0.0002117,
-1.36E-5, -0.0002404, -0.0004772, -0.0007219, -0.001226, -0.001644,
-0.001872, -0.001185, 0.00323, 0.002381, 0.00138, 0.0004234, -2.721E-5,
-0.0004808, -0.0009543, -0.001444, -0.002453, -0.003288, -0.003745, -0.00237,
0.00646, 0.004762, 0.002759, 0.0008468, -5.441E-5, -0.0009615, -0.001909,
-0.002888, -0.004906, -0.006577, -0.007489, -0.00474, 0.00947, 0.00698,
0.004045, 0.001241, -7.976E-5, -0.001409, -0.002798, -0.004233, -0.007191,
-0.00964, -0.01098, -0.006949, -0.009807, -0.006878, -0.003949, -0.0012,
7.672E-5, 0.001363, 0.00272, 0.004135, 0.007089, 0.01, 0.01189, 0.01238,
-0.00669, -0.004692, -0.002694, -0.0008184, 5.234E-5, 0.0009299, 0.001855,
0.002821, 0.004836, 0.006825, 0.008114, 0.008448, -0.003345, -0.002346,
-0.001347, -0.0004092, 2.617E-5, 0.000465, 0.0009277, 0.00141, 0.002418,
0.003413, 0.004057, 0.004224, -0.001673, -0.001173, -0.0006735, -0.0002046,
1.308E-5, 0.0002325, 0.0004639, 0.0007052, 0.001209, 0.001706, 0.002029,
0.002112, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.001673, 0.001173, 0.0006735, 0.0002046, -1.308E-5, -0.0002325, -0.0004639,
-0.0007052, -0.001209, -0.001706, -0.002029, -0.002112, 0.003345, 0.002346,
0.001347, 0.0004092, -2.617E-5, -0.000465, -0.0009277, -0.00141, -0.002418,
-0.003413, -0.004057, -0.004224, 0.00669, 0.004692, 0.002694, 0.0008184,
-5.234E-5, -0.0009299, -0.001855, -0.002821, -0.004836, -0.006825, -0.008114,
-0.008448, 0.009807, 0.006878, 0.003949, 0.0012, -7.672E-5, -0.001363,
-0.00272, -0.004135, -0.007089, -0.01, -0.01189, -0.01238, -0.009927,
-0.006976, -0.004007, -0.001218, 7.793E-5, 0.001384, 0.002761, 0.004196,
0.00719, 0.01013, 0.01202, 0.01242, -0.006772, -0.004759, -0.002734,
-0.0008311, 5.316E-5, 0.0009443, 0.001883, 0.002863, 0.004905, 0.006908,
0.008203, 0.008475, -0.003386, -0.002379, -0.001367, -0.0004155, 2.658E-5,
0.0004721, 0.0009417, 0.001431, 0.002452, 0.003454, 0.004102, 0.004238,
-0.001693, -0.00119, -0.0006835, -0.0002078, 1.329E-5, 0.0002361, 0.0004709,
0.0007156, 0.001226, 0.001727, 0.002051, 0.002119, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001693, 0.00119, 0.0006835, 0.0002078,
-1.329E-5, -0.0002361, -0.0004709, -0.0007156, -0.001226, -0.001727,
-0.002051, -0.002119, 0.003386, 0.002379, 0.001367, 0.0004155, -2.658E-5,
-0.0004721, -0.0009417, -0.001431, -0.002452, -0.003454, -0.004102,
-0.004238, 0.006772, 0.004759, 0.002734, 0.0008311, -5.316E-5, -0.0009443,
-0.001883, -0.002863, -0.004905, -0.006908, -0.008203, -0.008475, 0.009927,
0.006976, 0.004007, 0.001218, -7.793E-5, -0.001384, -0.002761, -0.004196,
-0.00719, -0.01013, -0.01202, -0.01242, -0.00947, -0.00698, -0.004045,
-0.001241, 7.976E-5, 0.001409, 0.002798, 0.004233, 0.007191, 0.00964,
0.01098, 0.006949, -0.00646, -0.004762, -0.002759, -0.0008468, 5.441E-5,
0.0009615, 0.001909, 0.002887, 0.004905, 0.006576, 0.007489, 0.00474,
-0.00323, -0.002381, -0.00138, -0.0004234, 2.721E-5, 0.0004807, 0.0009543,
0.001444, 0.002453, 0.003288, 0.003745, 0.00237, -0.001615, -0.00119,
-0.0006898, -0.0002117, 1.36E-5, 0.0002404, 0.0004772, 0.0007219, 0.001226,
0.001644, 0.001872, 0.001185, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.001615, 0.00119, 0.0006898, 0.0002117, -1.36E-5, -0.0002404,
-0.0004772, -0.0007219, -0.001226, -0.001644, -0.001872, -0.001185, 0.00323,
0.002381, 0.00138, 0.0004234, -2.721E-5, -0.0004807, -0.0009543, -0.001444,
-0.002453, -0.003288, -0.003745, -0.00237, 0.00646, 0.004762, 0.002759,
0.0008468, -5.441E-5, -0.0009615, -0.001909, -0.002887, -0.004905, -0.006576,
-0.007489, -0.00474, 0.00947, 0.00698, 0.004045, 0.001241, -7.976E-5,
-0.001409, -0.002798, -0.004233, -0.007191, -0.00964, -0.01098, -0.006949 },
-1.0,
{ -25.0, -16.0, -8.0, 0.0, 8.0, 16.0, 25.0 },
{ 0.017, 0.0148, 0.0125, 0.00992, 0.00856, 0.00718, 0.00578, 0.00439, 0.00154,
-0.00153, -0.00522, -0.00976, 0.0187, 0.0163, 0.0138, 0.0111, 0.00961,
0.00814, 0.00665, 0.00516, 0.00211, -0.00119, -0.00515, -0.0101, 0.0192,
0.0165, 0.0139, 0.0112, 0.00969, 0.0082, 0.0067, 0.00518, 0.00203, -0.00156,
-0.00602, -0.0129, 0.017, 0.0148, 0.0124, 0.00991, 0.00855, 0.00717, 0.00578,
0.00439, 0.00153, -0.00154, -0.00522, -0.00976, 0.0186, 0.0162, 0.0138,
0.0111, 0.0096, 0.00813, 0.00664, 0.00515, 0.0021, -0.00119, -0.00515,
-0.0101, 0.0192, 0.0165, 0.0139, 0.0112, 0.00968, 0.00819, 0.00669, 0.00517,
0.00202, -0.00156, -0.00602, -0.0129, 0.017, 0.0147, 0.0124, 0.0099, 0.00854,
0.00716, 0.00577, 0.00438, 0.00153, -0.00154, -0.00522, -0.00975, 0.0186,
0.0162, 0.0138, 0.011, 0.00959, 0.00812, 0.00663, 0.00515, 0.0021, -0.00119,
-0.00516, -0.0101, 0.0192, 0.0164, 0.0139, 0.0111, 0.00967, 0.00818, 0.00668,
0.00516, 0.00202, -0.00156, -0.00602, -0.0129, 0.0155, 0.0134, 0.0112,
0.00887, 0.00759, 0.0063, 0.005, 0.0037, 0.00103, -0.00184, -0.0053,
-0.00954, 0.017, 0.0147, 0.0124, 0.00989, 0.00852, 0.00714, 0.00575, 0.00436,
0.00151, -0.00158, -0.00529, -0.00987, 0.0175, 0.0149, 0.0126, 0.00997,
0.0086, 0.0072, 0.00579, 0.00437, 0.00143, -0.00192, -0.0061, -0.0125,
0.0155, 0.0134, 0.0112, 0.00886, 0.00758, 0.00629, 0.00499, 0.00369, 0.00103,
-0.00185, -0.00529, -0.00953, 0.017, 0.0147, 0.0124, 0.00988, 0.00851,
0.00713, 0.00574, 0.00435, 0.0015, -0.00158, -0.00529, -0.00987, 0.0175,
0.0149, 0.0125, 0.00996, 0.00859, 0.00719, 0.00579, 0.00437, 0.00142,
-0.00193, -0.0061, -0.0125, 0.0155, 0.0134, 0.0112, 0.00885, 0.00757,
0.00628, 0.00499, 0.00369, 0.00102, -0.00185, -0.00529, -0.00953, 0.0169,
0.0147, 0.0124, 0.00986, 0.0085, 0.00713, 0.00574, 0.00435, 0.0015, -0.00158,
-0.00529, -0.00986, 0.0175, 0.0149, 0.0125, 0.00995, 0.00858, 0.00719,
0.00578, 0.00436, 0.00142, -0.00193, -0.0061, -0.0125, 0.00691, 0.00578,
0.00461, 0.00332, 0.00264, 0.00194, 0.00123, 0.00053, -0.000913, -0.00247,
-0.00433, -0.00662, 0.00751, 0.0063, 0.00505, 0.00367, 0.00294, 0.00219,
0.00144, 0.000687, -0.000856, -0.00252, -0.00453, -0.00701, 0.00778, 0.00639,
0.0051, 0.00371, 0.00297, 0.00221, 0.00145, 0.000684, -0.000908, -0.00272,
-0.00498, -0.00844, 0.0069, 0.00577, 0.0046, 0.00332, 0.00263, 0.00193,
0.00123, 0.000529, -0.000913, -0.00246, -0.00433, -0.00662, 0.0075, 0.00629,
0.00504, 0.00367, 0.00293, 0.00219, 0.00144, 0.000686, -0.000857, -0.00252,
-0.00453, -0.007, 0.00777, 0.00639, 0.0051, 0.00371, 0.00296, 0.00221,
0.00145, 0.000683, -0.000908, -0.00272, -0.00498, -0.00844, 0.00689, 0.00577,
0.0046, 0.00332, 0.00263, 0.00193, 0.00123, 0.000527, -0.000913, -0.00246,
-0.00433, -0.00662, 0.00749, 0.00629, 0.00504, 0.00367, 0.00293, 0.00219,
0.00144, 0.000684, -0.000857, -0.00252, -0.00452, -0.007, 0.00777, 0.00638,
0.0051, 0.0037, 0.00296, 0.00221, 0.00145, 0.000681, -0.000908, -0.00272,
-0.00497, -0.00843, -6.47E-6, -5.06E-6, -3.6E-6, -1.99E-6, -1.13E-6,
-2.58E-7, 6.21E-7, 1.5E-6, 3.3E-6, 5.24E-6, 7.57E-6, 1.04E-5, -6.92E-6,
-5.41E-6, -3.85E-6, -2.13E-6, -1.21E-6, -2.8E-7, 6.6E-7, 1.6E-6, 3.53E-6,
5.61E-6, 8.12E-6, 1.12E-5, -7.25E-6, -5.52E-6, -3.91E-6, -2.16E-6, -1.24E-6,
-2.93E-7, 6.6E-7, 1.62E-6, 3.61E-6, 5.87E-6, 8.7E-6, 1.3E-5, -6.47E-6,
-5.06E-6, -3.6E-6, -1.99E-6, -1.13E-6, -2.58E-7, 6.21E-7, 1.5E-6, 3.3E-6,
5.24E-6, 7.57E-6, 1.04E-5, -6.92E-6, -5.41E-6, -3.84E-6, -2.13E-6, -1.21E-6,
-2.8E-7, 6.59E-7, 1.6E-6, 3.53E-6, 5.61E-6, 8.11E-6, 1.12E-5, -7.24E-6,
-5.51E-6, -3.9E-6, -2.16E-6, -1.23E-6, -2.93E-7, 6.59E-7, 1.62E-6, 3.61E-6,
5.87E-6, 8.69E-6, 1.3E-5, -6.46E-6, -5.05E-6, -3.59E-6, -1.99E-6, -1.13E-6,
-2.57E-7, 6.2E-7, 1.5E-6, 3.3E-6, 5.24E-6, 7.56E-6, 1.04E-5, -6.91E-6,
-5.4E-6, -3.84E-6, -2.13E-6, -1.21E-6, -2.79E-7, 6.59E-7, 1.6E-6, 3.52E-6,
5.6E-6, 8.11E-6, 1.12E-5, -7.24E-6, -5.51E-6, -3.9E-6, -2.16E-6, -1.23E-6,
-2.93E-7, 6.59E-7, 1.62E-6, 3.6E-6, 5.86E-6, 8.68E-6, 1.3E-5, -0.00345,
-0.00232, -0.00115, 0.000132, 0.000821, 0.00152, 0.00222, 0.00293, 0.00437,
0.00592, 0.00779, 0.0101, -0.00358, -0.00237, -0.00112, 0.000255, 0.000992,
0.00174, 0.00249, 0.00324, 0.00479, 0.00645, 0.00846, 0.0109, -0.00383,
-0.00244, -0.00115, 0.000242, 0.000985, 0.00174, 0.0025, 0.00327, 0.00486,
0.00667, 0.00893, 0.0124, -0.00345, -0.00232, -0.00115, 0.000131, 0.000819,
0.00152, 0.00222, 0.00292, 0.00436, 0.00592, 0.00778, 0.0101, -0.00358,
-0.00237, -0.00112, 0.000254, 0.00099, 0.00174, 0.00249, 0.00324, 0.00478,
0.00645, 0.00845, 0.0109, -0.00382, -0.00244, -0.00115, 0.000241, 0.000984,
0.00174, 0.0025, 0.00326, 0.00486, 0.00667, 0.00892, 0.0124, -0.00345,
-0.00232, -0.00115, 0.00013, 0.000818, 0.00152, 0.00222, 0.00292, 0.00436,
0.00591, 0.00777, 0.0101, -0.00357, -0.00237, -0.00112, 0.000253, 0.000988,
0.00173, 0.00248, 0.00323, 0.00478, 0.00644, 0.00844, 0.0109, -0.00382,
-0.00244, -0.00115, 0.00024, 0.000982, 0.00173, 0.0025, 0.00326, 0.00485,
0.00666, 0.00892, 0.0124, -0.00367, -0.00158, 0.000586, 0.00296, 0.00424,
0.00553, 0.00683, 0.00813, 0.0108, 0.0137, 0.0171, 0.0214, -0.00353,
-0.00129, 0.00102, 0.00356, 0.00492, 0.00631, 0.0077, 0.00909, 0.0119, 0.015,
0.0187, 0.0233, -0.00397, -0.0014, 0.000977, 0.00356, 0.00493, 0.00633,
0.00774, 0.00915, 0.0121, 0.0155, 0.0196, 0.026, -0.00367, -0.00158,
0.000582, 0.00296, 0.00423, 0.00552, 0.00682, 0.00812, 0.0108, 0.0137,
0.0171, 0.0213, -0.00353, -0.00129, 0.00102, 0.00356, 0.00492, 0.0063,
0.00769, 0.00908, 0.0119, 0.015, 0.0187, 0.0233, -0.00397, -0.00141,
0.000973, 0.00355, 0.00492, 0.00632, 0.00773, 0.00914, 0.0121, 0.0154,
0.0196, 0.026, -0.00367, -0.00158, 0.000579, 0.00295, 0.00422, 0.00551,
0.00681, 0.00811, 0.0108, 0.0136, 0.0171, 0.0213, -0.00353, -0.0013, 0.00102,
0.00355, 0.00491, 0.00629, 0.00768, 0.00907, 0.0119, 0.015, 0.0187, 0.0233,
-0.00397, -0.00141, 0.000969, 0.00354, 0.00492, 0.00631, 0.00772, 0.00914,
0.0121, 0.0154, 0.0196, 0.026, -0.00348, -0.00125, 0.00107, 0.00361, 0.00497,
0.00635, 0.00774, 0.00913, 0.012, 0.0151, 0.0188, 0.0233, -0.00327,
-0.000881, 0.00159, 0.00431, 0.00576, 0.00724, 0.00873, 0.0102, 0.0133,
0.0166, 0.0205, 0.0254, -0.00374, -0.001, 0.00155, 0.0043, 0.00577, 0.00727,
0.00877, 0.0103, 0.0134, 0.017, 0.0215, 0.0283, -0.00348, -0.00125, 0.00106,
0.0036, 0.00496, 0.00634, 0.00773, 0.00912, 0.012, 0.015, 0.0187, 0.0233,
-0.00328, -0.000885, 0.00159, 0.0043, 0.00576, 0.00723, 0.00872, 0.0102,
0.0133, 0.0165, 0.0205, 0.0254, -0.00375, -0.001, 0.00154, 0.0043, 0.00577,
0.00726, 0.00876, 0.0103, 0.0134, 0.017, 0.0215, 0.0283, -0.00349, -0.00126,
0.00106, 0.00359, 0.00495, 0.00633, 0.00772, 0.00911, 0.012, 0.015, 0.0187,
0.0232, -0.00328, -0.000888, 0.00158, 0.00429, 0.00575, 0.00722, 0.00871,
0.0102, 0.0132, 0.0165, 0.0205, 0.0254, -0.00375, -0.00101, 0.00154, 0.00429,
0.00576, 0.00725, 0.00875, 0.0103, 0.0134, 0.017, 0.0215, 0.0283 },
0.0,
{ -0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015, -0.016, -0.015, -0.008,
0.0, 0.008, 0.015, 0.016, -0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015,
-0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015, -0.016, -0.015, -0.008,
0.0, 0.008, 0.015, 0.016, -0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015,
-0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015, -0.016, -0.015, -0.008,
0.0, 0.008, 0.015, 0.016, -0.015, -0.014, -0.008, 0.0, 0.008, 0.014, 0.015 },
{ 0.364, 0.3354, 0.1811, -0.0002, -0.1811, -0.3354, -0.3657, 0.3859, 0.356,
0.1922, -0.0002, -0.1922, -0.356, -0.3875, 0.3865, 0.3567, 0.1925, -0.0002,
-0.1925, -0.3567, -0.3882, 0.3566, 0.3287, 0.1774, -0.0002, -0.1774, -0.3287,
-0.3583, 0.3715, 0.3426, 0.1849, -0.0002, -0.1849, -0.3426, -0.3732, 0.3596,
0.3314, 0.1789, -0.0002, -0.1789, -0.3314, -0.3613, 0.32, 0.2943, 0.1588,
-0.0002, -0.1588, -0.2943, -0.3217, 0.3253, 0.2992, 0.1614, -0.0002, -0.1614,
-0.2992, -0.3269, 0.2861, 0.2626, 0.1416, -0.0002, -0.1416, -0.2626, -0.2878
},
0.0,
{ 1.0, 1.0, 1.0 },
0.0,
{ -16.0, -12.0, -8.0, -4.0, -2.0, 0.0, 2.0, 4.0, 8.0, 12.0, 16.0, 20.0 },
{ 0.02, 0.16, 0.3 },
{ 50.0, 150.0, 250.0 },
{ 0.146, 0.098, 0.065, 0.047, 0.043, 0.043, 0.046, 0.053, 0.08, 0.123, 0.166,
0.197, 0.132, 0.085, 0.051, 0.034, 0.03, 0.03, 0.033, 0.04, 0.067, 0.109,
0.152, 0.181, 0.122, 0.081, 0.048, 0.03, 0.026, 0.026, 0.03, 0.037, 0.063,
0.099, 0.133, 0.106, 0.146, 0.098, 0.065, 0.047, 0.043, 0.043, 0.046, 0.053,
0.08, 0.123, 0.166, 0.197, 0.132, 0.085, 0.051, 0.034, 0.03, 0.03, 0.033,
0.04, 0.067, 0.109, 0.152, 0.181, 0.122, 0.081, 0.048, 0.03, 0.026, 0.026,
0.03, 0.037, 0.063, 0.099, 0.133, 0.106, 0.146, 0.098, 0.065, 0.047, 0.043,
0.043, 0.046, 0.053, 0.08, 0.123, 0.166, 0.197, 0.132, 0.085, 0.052, 0.034,
0.03, 0.03, 0.033, 0.04, 0.067, 0.109, 0.152, 0.181, 0.122, 0.081, 0.048,
0.03, 0.026, 0.026, 0.03, 0.037, 0.063, 0.099, 0.133, 0.106 },
{ -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01326, -0.01326, -0.01326, -0.01326,
-0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326,
-0.01326, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01326, -0.01326, -0.01326,
-0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326,
-0.01326, -0.01326, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01325,
-0.01325, -0.01325, -0.01325, -0.01325, -0.01325, -0.01326, -0.01326,
-0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326, -0.01326,
-0.01326, -0.01326, -0.01326 },
{ -1.405, -1.011, -0.613, -0.233, -0.053, 0.127, 0.315, 0.51, 0.918, 1.325,
1.625, 1.764, -1.411, -1.017, -0.617, -0.234, -0.053, 0.128, 0.317, 0.514,
0.924, 1.331, 1.63, 1.758, -1.353, -1.014, -0.621, -0.237, -0.054, 0.13,
0.32, 0.517, 0.923, 1.275, 1.51, 1.126, -1.405, -1.011, -0.613, -0.233,
-0.053, 0.127, 0.315, 0.51, 0.918, 1.325, 1.625, 1.764, -1.411, -1.017,
-0.617, -0.234, -0.053, 0.128, 0.317, 0.514, 0.924, 1.331, 1.63, 1.758,
-1.353, -1.014, -0.621, -0.237, -0.054, 0.13, 0.32, 0.517, 0.923, 1.275,
1.51, 1.126, -1.405, -1.011, -0.613, -0.233, -0.053, 0.127, 0.315, 0.51,
0.918, 1.325, 1.625, 1.764, -1.411, -1.017, -0.617, -0.234, -0.053, 0.128,
0.317, 0.514, 0.924, 1.331, 1.63, 1.758, -1.353, -1.014, -0.621, -0.237,
-0.054, 0.13, 0.32, 0.517, 0.923, 1.275, 1.51, 1.126 },
-1.0,
{ -1.0, -1.0, -1.0 },
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
{ -0.149, -0.207, -0.296, -0.54, -1.648, 0.371, -0.002, -0.106, -0.201, -0.265,
-0.342, -0.342, -0.146, -0.204, -0.29, -0.529, -1.61, 0.351, -0.01, -0.11,
-0.203, -0.267, -0.344, -0.344, -0.164, -0.208, -0.291, -0.526, -1.608,
0.347, -0.011, -0.112, -0.207, -0.286, -0.286, -0.286, -0.149, -0.207,
-0.296, -0.54, -1.649, 0.371, -0.002, -0.106, -0.201, -0.265, -0.342, -0.342,
-0.146, -0.204, -0.29, -0.529, -1.611, 0.351, -0.01, -0.11, -0.203, -0.267,
-0.344, -0.344, -0.164, -0.208, -0.292, -0.526, -1.608, 0.347, -0.011,
-0.112, -0.207, -0.286, -0.286, -0.286, -0.149, -0.207, -0.296, -0.54,
-1.649, 0.371, -0.002, -0.106, -0.201, -0.265, -0.342, -0.342, -0.146,
-0.204, -0.29, -0.529, -1.611, 0.351, -0.009, -0.11, -0.203, -0.267, -0.344,
-0.344, -0.164, -0.208, -0.292, -0.526, -1.609, 0.347, -0.011, -0.112,
-0.207, -0.286, -0.286, -0.286 },
1.32,
0.0,
0.0,
0.0,
{ 0.0, 0.0, 0.0 },
{ -0.002887, -0.003014, -0.00316, -0.003306, -0.003373, -0.00344, -0.00351,
-0.003583, -0.003737, -0.003881, -0.003961, -0.003964, -0.002889, -0.003016,
-0.003163, -0.00331, -0.003378, -0.003446, -0.003516, -0.00359, -0.003745,
-0.003889, -0.003969, -0.003969, -0.002928, -0.003031, -0.003173, -0.003318,
-0.003387, -0.003454, -0.003525, -0.003598, -0.003749, -0.003868, -0.003919,
-0.003715, -0.002887, -0.003014, -0.00316, -0.003306, -0.003373, -0.00344,
-0.00351, -0.003583, -0.003737, -0.003881, -0.003961, -0.003964, -0.002889,
-0.003016, -0.003163, -0.00331, -0.003378, -0.003446, -0.003516, -0.00359,
-0.003745, -0.003889, -0.003969, -0.003969, -0.002928, -0.003031, -0.003173,
-0.003318, -0.003387, -0.003454, -0.003525, -0.003598, -0.003749, -0.003868,
-0.003919, -0.003715, -0.002887, -0.003014, -0.00316, -0.003306, -0.003373,
-0.00344, -0.00351, -0.003583, -0.003737, -0.003881, -0.003961, -0.003964,
-0.002889, -0.003016, -0.003163, -0.00331, -0.003378, -0.003446, -0.003516,
-0.00359, -0.003745, -0.003889, -0.003969, -0.003969, -0.002928, -0.003031,
-0.003173, -0.003318, -0.003387, -0.003454, -0.003525, -0.003598, -0.003749,
-0.003868, -0.003919, -0.003715 },
{ 0.2065, 0.2095, 0.1822, 0.1272, 0.0894, 0.0472, -0.0008, -0.0545, -0.1847,
-0.3509, -0.5504, -0.5504, 0.203, 0.2063, 0.1797, 0.1249, 0.0872, 0.045,
-0.003, -0.0568, -0.1873, -0.3536, -0.5532, -0.5532, 0.219, 0.21, 0.1813,
0.1256, 0.0877, 0.0451, -0.0035, -0.0582, -0.1912, -0.3622, -0.3622, -0.3622,
0.2066, 0.2095, 0.1823, 0.1272, 0.0894, 0.0472, -0.0007, -0.0544, -0.1847,
-0.3509, -0.5504, -0.5504, 0.203, 0.2063, 0.1797, 0.1249, 0.0872, 0.045,
-0.003, -0.0568, -0.1873, -0.3536, -0.5532, -0.5532, 0.2191, 0.21, 0.1813,
0.1256, 0.0877, 0.0451, -0.0035, -0.0582, -0.1912, -0.3622, -0.3622, -0.3622,
0.2066, 0.2095, 0.1823, 0.1272, 0.0894, 0.0472, -0.0007, -0.0544, -0.1847,
-0.3509, -0.5504, -0.5504, 0.203, 0.2063, 0.1797, 0.1249, 0.0872, 0.045,
-0.003, -0.0568, -0.1873, -0.3536, -0.5532, -0.5532, 0.2191, 0.21, 0.1813,
0.1256, 0.0877, 0.0451, -0.0035, -0.0581, -0.1912, -0.3622, -0.3622, -0.3622
},
{ -1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5,
-1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5, -1.015E-5, -0.0002036,
-0.0002036, -0.0002036, -0.0002036, -0.0002036, -0.0002036, -0.0002036,
-0.0002036, -0.0002036, -0.0002036, -0.0002036, -0.0002036, -0.0002596,
-0.0002596, -0.0002596, -0.0002596, -0.0002596, -0.0002596, -0.0002596,
-0.0002596, -0.0002596, -0.0002596, -0.0002596, -0.0002596, -9.31E-6,
-9.31E-6, -9.31E-6, -9.31E-6, -9.31E-6, -9.31E-6, -9.31E-6, -9.31E-6,
-9.31E-6, -9.31E-6, -9.31E-6, -9.31E-6, -0.0002028, -0.0002028, -0.0002028,
-0.0002028, -0.0002028, -0.0002028, -0.0002028, -0.0002028, -0.0002028,
-0.0002028, -0.0002028, -0.0002028, -0.0002588, -0.0002588, -0.0002588,
-0.0002588, -0.0002588, -0.0002588, -0.0002588, -0.0002588, -0.0002588,
-0.0002588, -0.0002588, -0.0002588, -8.468E-6, -8.468E-6, -8.468E-6,
-8.468E-6, -8.468E-6, -8.468E-6, -8.468E-6, -8.468E-6, -8.468E-6, -8.468E-6,
-8.468E-6, -8.468E-6, -0.0002019, -0.0002019, -0.0002019, -0.0002019,
-0.0002019, -0.0002019, -0.0002019, -0.0002019, -0.0002019, -0.0002019,
-0.0002019, -0.0002019, -0.0002579, -0.0002579, -0.0002579, -0.0002579,
-0.0002579, -0.0002579, -0.0002579, -0.0002579, -0.0002579, -0.0002579,
-0.0002579, -0.0002579 },
-1.0,
{ 1U, 9U, 27U },
{ 1U, 12U, 108U, 324U },
{ 1U, 12U, 36U, 108U },
{ 1U, 7U, 21U },
{ 1U, 7U, 21U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U },
{ 1U, 12U, 36U }
};
| 56.589744
| 81
| 0.578126
|
NixonCTChan
|
c6b89f98ff6b81681242a113a6a2528005b167a9
| 2,537
|
cpp
|
C++
|
src/apps/mplayerc/StaticLink.cpp
|
chinajeffery/MPC-BE--1.2.3
|
2229fde5535f565ba4a496a7f73267bd2c1ad338
|
[
"MIT"
] | null | null | null |
src/apps/mplayerc/StaticLink.cpp
|
chinajeffery/MPC-BE--1.2.3
|
2229fde5535f565ba4a496a7f73267bd2c1ad338
|
[
"MIT"
] | 1
|
2019-11-14T04:18:32.000Z
|
2019-11-14T04:18:32.000Z
|
src/apps/mplayerc/StaticLink.cpp
|
chinajeffery/MPC-BE--1.2.3
|
2229fde5535f565ba4a496a7f73267bd2c1ad338
|
[
"MIT"
] | null | null | null |
/*
* $Id: StaticLink.cpp 2229 2013-03-08 13:27:11Z exodus8 $
*
* (C) 2003-2006 Gabest
* (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-BE.
*
* MPC-BE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* MPC-BE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "StaticLink.h"
// CStaticLink
COLORREF CStaticLink::g_colorUnvisited = RGB(0,0,255);
COLORREF CStaticLink::g_colorVisited = RGB(128,0,128);
IMPLEMENT_DYNAMIC(CStaticLink, CStatic)
BEGIN_MESSAGE_MAP(CStaticLink, CStatic)
ON_WM_NCHITTEST()
ON_WM_CTLCOLOR_REFLECT()
ON_WM_LBUTTONDOWN()
ON_WM_SETCURSOR()
END_MESSAGE_MAP()
CStaticLink::CStaticLink(LPCTSTR lpText, bool bDeleteOnDestroy)
{
m_link = lpText;
m_color = g_colorUnvisited;
m_bDeleteOnDestroy = bDeleteOnDestroy;
}
LRESULT CStaticLink::OnNcHitTest(CPoint point)
{
return HTCLIENT;
}
HBRUSH CStaticLink::CtlColor(CDC* pDC, UINT nCtlColor)
{
ASSERT(nCtlColor == CTLCOLOR_STATIC);
DWORD dwStyle = GetStyle();
HBRUSH hbr = NULL;
if ((dwStyle & 0xFF) <= SS_RIGHT) {
if (!(HFONT)m_font) {
LOGFONT lf;
GetFont()->GetObject(sizeof(lf), &lf);
lf.lfUnderline = TRUE;
m_font.CreateFontIndirect(&lf);
}
pDC->SelectObject(&m_font);
pDC->SetTextColor(m_color);
pDC->SetBkMode(TRANSPARENT);
hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
}
return hbr;
}
void CStaticLink::OnLButtonDown(UINT nFlags, CPoint point)
{
if (m_link.IsEmpty()) {
m_link.LoadString(GetDlgCtrlID()) || (GetWindowText(m_link),1);
if (m_link.IsEmpty()) {
return;
}
}
HINSTANCE h = m_link.Navigate();
if ((UINT_PTR)h > 32) {
m_color = g_colorVisited;
Invalidate();
} else {
MessageBeep(0);
TRACE(_T("*** WARNING: CStaticLink: unable to navigate link %s\n"),
(LPCTSTR)m_link);
}
}
BOOL CStaticLink::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND));
return TRUE;
}
void CStaticLink::PostNcDestroy()
{
if (m_bDeleteOnDestroy) {
delete this;
}
}
| 22.651786
| 72
| 0.713047
|
chinajeffery
|
c6ba348b641ed6208ff5d864c978642bea5cb2ab
| 2,182
|
cpp
|
C++
|
rs/test/min_test.cpp
|
dymk/rs
|
b75ab0df5f235ac12ec4da825e6bd6e1fa9e7493
|
[
"Apache-2.0"
] | 19
|
2017-05-15T08:20:00.000Z
|
2021-12-03T05:58:32.000Z
|
rs/test/min_test.cpp
|
dymk/rs
|
b75ab0df5f235ac12ec4da825e6bd6e1fa9e7493
|
[
"Apache-2.0"
] | null | null | null |
rs/test/min_test.cpp
|
dymk/rs
|
b75ab0df5f235ac12ec4da825e6bd6e1fa9e7493
|
[
"Apache-2.0"
] | 3
|
2018-01-16T18:07:30.000Z
|
2021-06-30T07:33:44.000Z
|
// Copyright 2017 Per Grön. 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.
// 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 <catch.hpp>
#include <vector>
#include <rs/empty.h>
#include <rs/from.h>
#include <rs/just.h>
#include <rs/min.h>
#include <rs/throw.h>
#include "test_util.h"
namespace shk {
TEST_CASE("Min") {
auto min = Min<int>();
static_assert(
IsPublisher<decltype(min(Just(0)))>,
"Min stream should be a publisher");
SECTION("empty") {
auto error = GetError(min(Empty()));
CHECK(
GetErrorWhat(error) ==
"ReduceWithoutInitial invoked with empty stream");
}
SECTION("default compare function") {
SECTION("single value") {
CHECK(GetOne<int>(min(Just(4))) == 4);
}
SECTION("multiple values, smallest last") {
auto values = From(std::vector<int>({ 2, 1 }));
CHECK(GetOne<int>(min(values)) == 1);
}
SECTION("multiple values, smallest first") {
auto values = From(std::vector<int>({ 1, 2 }));
CHECK(GetOne<int>(min(values)) == 1);
}
}
SECTION("custom compare function") {
auto max = Min<int>(std::greater<int>());
SECTION("multiple values, biggest last") {
auto values = From(std::vector<int>({ 1, 2 }));
CHECK(GetOne<int>(max(values)) == 2);
}
SECTION("multiple values, biggest first") {
auto values = From(std::vector<int>({ 2, 1 }));
CHECK(GetOne<int>(max(values)) == 2);
}
}
SECTION("failing input stream") {
auto exception = std::make_exception_ptr(std::runtime_error("test_error"));
auto error = GetError(min(Throw(exception)));
CHECK(GetErrorWhat(error) == "test_error");
}
}
} // namespace shk
| 27.275
| 79
| 0.642071
|
dymk
|
c6bb56fbcd8c10aa0e163051da964557ebbc5c40
| 2,883
|
cpp
|
C++
|
src/client/lib32/version.cpp
|
LowerCode/bnspatch
|
321608bb86714ee5137823ade21a81f4e0058c09
|
[
"MIT"
] | 1
|
2021-03-11T17:41:11.000Z
|
2021-03-11T17:41:11.000Z
|
src/client/lib64/version.cpp
|
LowerCode/bnspatch
|
321608bb86714ee5137823ade21a81f4e0058c09
|
[
"MIT"
] | null | null | null |
src/client/lib64/version.cpp
|
LowerCode/bnspatch
|
321608bb86714ee5137823ade21a81f4e0058c09
|
[
"MIT"
] | 1
|
2021-12-22T00:15:04.000Z
|
2021-12-22T00:15:04.000Z
|
#define DLLEXPORT DLLEXPORT
#include <Windows.h>
EXTERN_C_START
DLLEXPORT DWORD APIENTRY VerFindFileA(
DWORD uFlags,
LPCSTR szFileName,
LPCSTR szWinDir,
LPCSTR szAppDir,
LPSTR szCurDir,
PUINT puCurDirLen,
LPSTR szDestDir,
PUINT puDestDirLen)
{
return 0;
}
DLLEXPORT DWORD APIENTRY VerFindFileW(
DWORD uFlags,
LPCWSTR szFileName,
LPCWSTR szWinDir,
LPCWSTR szAppDir,
LPWSTR szCurDir,
PUINT puCurDirLen,
LPWSTR szDestDir,
PUINT puDestDirLen)
{
return 0;
}
DLLEXPORT DWORD APIENTRY VerInstallFileA(
DWORD uFlags,
LPCSTR szSrcFileName,
LPCSTR szDestFileName,
LPCSTR szSrcDir,
LPCSTR szDestDir,
LPCSTR szCurDir,
LPSTR szTmpFile,
PUINT puTmpFileLen)
{
return 0;
}
DLLEXPORT DWORD APIENTRY VerInstallFileW(
DWORD uFlags,
LPCWSTR szSrcFileName,
LPCWSTR szDestFileName,
LPCWSTR szSrcDir,
LPCWSTR szDestDir,
LPCWSTR szCurDir,
LPWSTR szTmpFile,
PUINT puTmpFileLen)
{
return 0;
}
DLLEXPORT DWORD APIENTRY GetFileVersionInfoSizeA(
LPCSTR lptstrFilename,
LPDWORD lpdwHandle)
{
return 0;
}
DLLEXPORT DWORD APIENTRY GetFileVersionInfoSizeW(
LPCWSTR lptstrFilename,
LPDWORD lpdwHandle)
{
return 0;
}
DLLEXPORT BOOL APIENTRY GetFileVersionInfoA(
LPCSTR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData)
{
return FALSE;
}
DLLEXPORT BOOL APIENTRY GetFileVersionInfoW(
LPCWSTR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData)
{
return FALSE;
}
DLLEXPORT DWORD APIENTRY GetFileVersionInfoSizeExA(
DWORD dwFlags,
LPCSTR lpwstrFilename,
LPDWORD lpdwHandle)
{
return 0;
}
DLLEXPORT DWORD APIENTRY GetFileVersionInfoSizeExW(
DWORD dwFlags,
LPCWSTR lpwstrFilename,
LPDWORD lpdwHandle)
{
return 0;
}
DLLEXPORT BOOL APIENTRY GetFileVersionInfoExA(
DWORD dwFlags,
LPCSTR lpwstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData)
{
return FALSE;
}
DLLEXPORT BOOL APIENTRY GetFileVersionInfoExW(
DWORD dwFlags,
LPCWSTR lpwstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData)
{
return FALSE;
}
DLLEXPORT BOOL APIENTRY GetFileVersionInfoByHandle(
DWORD dwFlags,
HANDLE hFile,
LPVOID *lplpBuffer,
PUINT puLen)
{
return FALSE;
}
DLLEXPORT DWORD APIENTRY VerLanguageNameA(
DWORD wLang,
LPSTR szLang,
DWORD cchLang)
{
return 0;
}
DLLEXPORT DWORD APIENTRY VerLanguageNameW(
DWORD wLang,
LPWSTR szLang,
DWORD cchLang)
{
return 0;
}
DLLEXPORT BOOL APIENTRY VerQueryValueA(
LPCVOID pBlock,
LPCSTR lpSubBlock,
LPVOID *lplpBuffer,
PUINT puLen)
{
return FALSE;
}
DLLEXPORT BOOL APIENTRY VerQueryValueW(
LPCVOID pBlock,
LPCWSTR lpSubBlock,
LPVOID *lplpBuffer,
PUINT puLen)
{
return FALSE;
}
EXTERN_C_END
| 16.958824
| 51
| 0.704475
|
LowerCode
|
c6c3929f98f2221139837b9c70e1e83e82983124
| 1,144
|
cpp
|
C++
|
src/stack_trace.cpp
|
magicmoremagic/bengine-core
|
fc9e1c309e62f5b2d7d4797d4b537ecfb3350d19
|
[
"MIT"
] | null | null | null |
src/stack_trace.cpp
|
magicmoremagic/bengine-core
|
fc9e1c309e62f5b2d7d4797d4b537ecfb3350d19
|
[
"MIT"
] | null | null | null |
src/stack_trace.cpp
|
magicmoremagic/bengine-core
|
fc9e1c309e62f5b2d7d4797d4b537ecfb3350d19
|
[
"MIT"
] | null | null | null |
#include "pch.hpp"
#include "stack_trace.hpp"
#include "console.hpp"
#include "filesystem.hpp"
#include <ostream>
#include <iomanip>
namespace be {
///////////////////////////////////////////////////////////////////////////////
std::ostream& operator<<(std::ostream& os, const StackTrace& trace) {
auto osc = get_ostream_config(os);
for (auto frame_ptr : trace.frames) {
auto info = get_stack_frame_symbol_info(frame_ptr);
os << nl << color::dark_gray << std::right << std::hex << std::setw(16) << std::setfill('0') << info.address << ' ';
if (!info.module.empty()) {
os << color::gray << info.module << color::dark_gray << '!';
}
os << color::purple << info.symbol;
if (!info.file.empty() || info.line != 0) {
os << color::dark_gray << " " << relative_source_file(info.file) << " : " << std::dec << info.line;
if (info.line_displacement > 0) {
os << " +" << info.line_displacement << 'B';
} else if (info.line_displacement < 0) {
os << " -" << -info.line_displacement << 'B';
}
}
}
return os << osc;
}
} // be
| 28.6
| 122
| 0.516608
|
magicmoremagic
|
c6c3dd1ec4c1085bfdf0a5e8f82288ca0dc48f77
| 19,551
|
cpp
|
C++
|
src/LuminoEngine/src/UI/ImGuiIntegration.cpp
|
infinnie/Lumino
|
921caabdbcb91528a2aac290e31d650628bc3bed
|
[
"MIT"
] | null | null | null |
src/LuminoEngine/src/UI/ImGuiIntegration.cpp
|
infinnie/Lumino
|
921caabdbcb91528a2aac290e31d650628bc3bed
|
[
"MIT"
] | null | null | null |
src/LuminoEngine/src/UI/ImGuiIntegration.cpp
|
infinnie/Lumino
|
921caabdbcb91528a2aac290e31d650628bc3bed
|
[
"MIT"
] | null | null | null |
#include "Internal.hpp"
#include <LuminoEngine/Platform/PlatformEvent.hpp>
#include <LuminoEngine/Platform/PlatformWindow.hpp>
#include <LuminoEngine/Graphics/VertexLayout.hpp>
#include <LuminoEngine/Graphics/VertexBuffer.hpp>
#include <LuminoEngine/Graphics/IndexBuffer.hpp>
#include <LuminoEngine/Graphics/Texture.hpp>
#include <LuminoEngine/Graphics/RenderPass.hpp>
#include <LuminoEngine/Graphics/GraphicsContext.hpp>
#include <LuminoEngine/Graphics/GraphicsCommandBuffer.hpp>
#include <LuminoEngine/Graphics/Bitmap.hpp>
#include <LuminoEngine/Shader/Shader.hpp>
#include <LuminoEngine/Shader/ShaderDescriptor.hpp>
#include <LuminoEngine/Rendering/Vertex.hpp>
#include <LuminoEngine/UI/ImGuiIntegration.hpp>
#include "../Font/FontManager.hpp"
#include "../Graphics/GraphicsManager.hpp"
#include "../Graphics/RHIs/GraphicsDeviceContext.hpp"
#include "../Rendering/RenderingManager.hpp"
namespace ln {
namespace detail {
//==============================================================================
// UIContext
bool ImGuiIntegration::init(UIFrameWindow* frameWindow)
{
m_frameWindow = frameWindow;
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
m_imgui = ImGui::CreateContext();
ImGui::SetCurrentContext(m_imgui);
ImGuiIO& io = ImGui::GetIO(); (void)io;
if (EngineDomain::graphicsManager()->deviceContext()->caps().graphicsAPI == GraphicsAPI::Vulkan) {
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
}
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
// Setup Dear ImGui style
//ImGui::StyleColorsDark();
ImGui::StyleColorsLight();
//ImGui::StyleColorsClassic();
ImGuiStyle* style = &ImGui::GetStyle();
//ImVec4* colors = style->Colors;
//colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 0.70f);
// Load Fonts
if (ByteBuffer* data = EngineDomain::fontManager()->getDefaultFontData()) {
void* file_data = IM_ALLOC(data->size());
memcpy(file_data, data->data(), data->size());
io.Fonts->AddFontFromMemoryTTF(file_data, data->size(), 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
}
else {
io.Fonts->AddFontDefault();
}
unsigned char* pixels;
int width, height, bytes_per_pixel;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height, &bytes_per_pixel);
int pitch = bytes_per_pixel * width;
assert(bytes_per_pixel == 4);
m_fontTexture = Texture2D::create(width, height);
auto bitmap = m_fontTexture->map(MapMode::Write);
detail::BitmapHelper::blitRawSimple(bitmap->data(), pixels, width, height, bytes_per_pixel, false);
//bitmap->save(u"font.png");
//byte_t* dst = m_fontTexture->map(MapMode::Write)->data();
//for (int y = 0; y < height; y++)
// memcpy(dst + pitch * y, pixels + (width * bytes_per_pixel) * y, (width * bytes_per_pixel));
//memcpy(, pixels, width * height * bytes_per_pixel);
io.Fonts->TexID = (ImTextureID)m_fontTexture;
m_vertexLayout = detail::EngineDomain::renderingManager()->standardVertexDeclaration();
m_shader = detail::EngineDomain::renderingManager()->builtinShader(BuiltinShader::Sprite);
m_renderPass = makeObject<RenderPass>();
m_renderPass->setClearFlags(ClearFlags::All);
return true;
}
void ImGuiIntegration::dispose()
{
if (m_fontTexture) {
ImGui::DestroyContext(m_imgui);
m_fontTexture = nullptr;
}
}
void ImGuiIntegration::updateFrame(float elapsedSeconds)
{
ImGui::SetCurrentContext(m_imgui);
ImGuiIO& io = ImGui::GetIO();
io.DeltaTime = elapsedSeconds;
// Set OS mouse position if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user)
if (io.WantSetMousePos)
{
LN_NOTIMPLEMENTED();
//POINT pos = { (int)io.MousePos.x, (int)io.MousePos.y };
//::ClientToScreen(g_hWnd, &pos);
//::SetCursorPos(pos.x, pos.y);
}
}
void ImGuiIntegration::prepareRender(float width, float height)
{
ImGui::SetCurrentContext(m_imgui);
ImGuiIO& io = ImGui::GetIO();
IM_ASSERT(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer back-end. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
io.DisplaySize = ImVec2(width, height);
}
void ImGuiIntegration::render(GraphicsContext* graphicsContext, RenderTargetTexture* target)
{
ImGuiIO& io = ImGui::GetIO();
ImGui::SetCurrentContext(m_imgui);
ImGui::Render();
ImDrawData* draw_data = ImGui::GetDrawData();
// Avoid rendering when minimized
if (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f)
return;
// Create and grow buffers if needed
if (!m_vertexBuffer || m_vertexBufferSize < draw_data->TotalVtxCount)
{
m_vertexBufferSize = draw_data->TotalVtxCount + 5000;
m_vertexBuffer = makeObject<VertexBuffer>(m_vertexBufferSize * sizeof(Vertex), GraphicsResourceUsage::Dynamic);
}
if (!m_indexBuffer || m_indexBufferSize < draw_data->TotalIdxCount)
{
m_indexBufferSize = draw_data->TotalIdxCount + 10000;
m_indexBuffer = makeObject<IndexBuffer>(m_indexBufferSize, IndexBufferFormat::UInt16, GraphicsResourceUsage::Dynamic);
}
Vertex* vtx_dst = static_cast<Vertex*>(m_vertexBuffer->writableData(0, draw_data->TotalVtxCount * sizeof(Vertex)));
ImDrawIdx* idx_dst = static_cast<uint16_t*>(m_indexBuffer->map(MapMode::Write));
int global_vtx_offset2 = 0;
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
const ImDrawVert* vtx_src = cmd_list->VtxBuffer.Data;
for (int i = 0; i < cmd_list->VtxBuffer.Size; i++)
{
vtx_dst->position.x = vtx_src->pos.x;
vtx_dst->position.y = vtx_src->pos.y;
vtx_dst->position.z = 0.0f;
vtx_dst->color.r = static_cast<float>((vtx_src->col & 0x000000FF)) / 255.0f;
vtx_dst->color.g = static_cast<float>((vtx_src->col & 0x0000FF00) >> 8) / 255.0f;
vtx_dst->color.b = static_cast<float>((vtx_src->col & 0x00FF0000) >> 16) / 255.0f;
vtx_dst->color.a = static_cast<float>((vtx_src->col & 0xFF000000) >> 24) / 255.0f;
vtx_dst->uv.x = vtx_src->uv.x;
vtx_dst->uv.y = vtx_src->uv.y;
vtx_dst->setNormal(Vector3::UnitZ);
vtx_dst++;
vtx_src++;
}
if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) {
memcpy(idx_dst, cmd_list->IdxBuffer.Data, cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx));
}
else {
const ImDrawIdx* s = cmd_list->IdxBuffer.Data;
ImDrawIdx* d = idx_dst;
for (int i = 0; i < cmd_list->IdxBuffer.Size; i++) {
d[i] = s[i] + global_vtx_offset2;
}
}
idx_dst += cmd_list->IdxBuffer.Size;
global_vtx_offset2 += cmd_list->VtxBuffer.Size;
}
graphicsContext->setVertexBuffer(0, m_vertexBuffer);
graphicsContext->setIndexBuffer(m_indexBuffer);
RasterizerStateDesc rasterizer;
rasterizer.cullMode = CullMode::None;
graphicsContext->setRasterizerState(rasterizer);
BlendStateDesc blend;
blend.renderTargets[0].blendEnable = true;
blend.renderTargets[0].sourceBlend = BlendFactor::SourceAlpha;
blend.renderTargets[0].destinationBlend = BlendFactor::InverseSourceAlpha;
blend.renderTargets[0].blendOp = BlendOp::Add;
blend.renderTargets[0].sourceBlendAlpha = BlendFactor::SourceAlpha;
blend.renderTargets[0].destinationBlendAlpha = BlendFactor::InverseSourceAlpha;
blend.renderTargets[0].blendOpAlpha = BlendOp::Add;
graphicsContext->setBlendState(blend);
graphicsContext->setVertexLayout(m_vertexLayout);
float L = draw_data->DisplayPos.x;
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
float T = draw_data->DisplayPos.y;
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
Matrix mat_projection(
2.0f/(R-L), 0.0f, 0.0f, 0.0f,
0.0f, 2.0f/(T-B), 0.0f, 0.0f,
0.0f, 0.0f, 0.5f, 0.0f,
(L+R)/(L-R), (T+B)/(B-T), 0.5f, 1.0f
);
//m_shader->findParameter(u"ln_WorldViewProjection")->setMatrix(mat_projection);
//m_shader->findParameter(u"ln_WorldViewIT")->setMatrix(Matrix::Identity);
graphicsContext->setShaderPass(m_shader->techniques()[0]->passes()[0]);
m_renderPass->setRenderTarget(0, target);
graphicsContext->beginRenderPass(m_renderPass);
const auto& commandList = graphicsContext->commandList();
ShaderSecondaryDescriptor* descriptor = commandList->acquireShaderDescriptor(m_shader);
{
descriptor->setUniformBuffer(0, commandList->allocateUniformBuffer(sizeof(LNRenderElementBuffer)));
LNRenderElementBuffer renderElementBuffer;
renderElementBuffer.ln_WorldViewProjection = mat_projection;
renderElementBuffer.ln_WorldViewIT = Matrix::Identity;
descriptor->setUniformBufferData(0, &renderElementBuffer, sizeof(LNRenderElementBuffer));
}
{
descriptor->setUniformBuffer(1, commandList->allocateUniformBuffer(sizeof(LNRenderElementBuffer)));
LNEffectColorBuffer buf2;
buf2.ln_ColorScale = Vector4(1.0f, 1.0f, 1.0f, 1.0f);
descriptor->setUniformBufferData(1, &buf2, sizeof(LNEffectColorBuffer));
}
{
descriptor->setUniformBuffer(2, commandList->allocateUniformBuffer(sizeof(LNRenderElementBuffer)));
LNRenderViewBuffer buf3;
descriptor->setUniformBufferData(2, &buf3, sizeof(LNRenderViewBuffer));
}
graphicsContext->setShaderDescriptor(descriptor);
//std::cout << "----" << std::endl;
//std::cout << "CmdListsCount: " << draw_data->CmdListsCount << std::endl;
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
int global_vtx_offset = 0;
int global_idx_offset = 0;
ImVec2 clip_off = draw_data->DisplayPos;
//for (int n = 0; n < std::min(draw_data->CmdListsCount, 1); n++)
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
//std::cout << "CmdBuffer.Size: " << cmd_list->CmdBuffer.Size << std::endl;
//std::cout << "VtxBuffer.Size: " << cmd_list->VtxBuffer.Size << std::endl;
//std::cout << "IdxBuffer.Size: " << cmd_list->IdxBuffer.Size << std::endl;
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback != NULL)
{
LN_NOTIMPLEMENTED();
}
else
{
auto texture = reinterpret_cast<Texture2D*>(pcmd->TextureId);
//m_shader->findParameter(u"ln_MaterialTexture")->setTexture(texture);
descriptor->setTexture(0, texture);
Rect r(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y, pcmd->ClipRect.z - clip_off.x, pcmd->ClipRect.w - clip_off.y);
graphicsContext->setScissorRect(r);
//graphicsContext->drawPrimitiveIndexed(pcmd->VtxOffset + global_vtx_offset, pcmd->ElemCount / 3);
graphicsContext->setPrimitiveTopology(PrimitiveTopology::TriangleList);
if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) {
graphicsContext->drawPrimitiveIndexed(pcmd->IdxOffset + global_idx_offset, pcmd->ElemCount / 3, 0, pcmd->VtxOffset + global_vtx_offset);
}
else {
graphicsContext->drawPrimitiveIndexed(pcmd->IdxOffset + global_idx_offset, pcmd->ElemCount / 3, 0, 0);
if (pcmd->VtxOffset != 0) {
LN_NOTIMPLEMENTED();
}
}
//std::cout << " pcmd->IdxOffset: " << pcmd->IdxOffset << std::endl;
//std::cout << " pcmd->VtxOffset: " << pcmd->VtxOffset << std::endl;
//std::cout << " pcmd->ElemCount: " << pcmd->ElemCount << std::endl;
}
}
global_idx_offset += cmd_list->IdxBuffer.Size;
global_vtx_offset += cmd_list->VtxBuffer.Size;
}
//std::cout << "----" << std::endl;
graphicsContext->endRenderPass(); // TODO: scoped
graphicsContext->setShaderDescriptor(nullptr);
graphicsContext->resetState();
}
bool ImGuiIntegration::handlePlatformEvent(const detail::PlatformEventArgs& e)
{
if (!m_imgui) return false;
ImGui::SetCurrentContext(m_imgui);
ImGuiIO& io = ImGui::GetIO();
//if (ImGui::IsWindowFocused())
//{
// printf("IsWindowFocused\n");
// ImVec2 r_min, r_max;
// if (ImGui::IsMouseHoveringRect(r_min, r_max)) {
// printf("hob\n");
// }
//}
switch (e.type)
{
case PlatformEventType::MouseDown:
{
int button = 0;
if (e.mouse.button == MouseButtons::Left) { button = 0; }
if (e.mouse.button == MouseButtons::Right) { button = 1; }
if (e.mouse.button == MouseButtons::Middle) { button = 2; }
if (e.mouse.button == MouseButtons::X1) { button = 3; }
if (e.mouse.button == MouseButtons::X2) { button = 4; }
io.MouseDown[button] = true;
//return true;
break;
}
case PlatformEventType::MouseUp:
{
int button = 0;
if (e.mouse.button == MouseButtons::Left) { button = 0; }
if (e.mouse.button == MouseButtons::Right) { button = 1; }
if (e.mouse.button == MouseButtons::Middle) { button = 2; }
if (e.mouse.button == MouseButtons::X1) { button = 3; }
if (e.mouse.button == MouseButtons::X2) { button = 4; }
io.MouseDown[button] = false;
//return true;
break;
}
case PlatformEventType::MouseMove:
{
auto clientPt = e.sender->pointFromScreen(PointI(e.mouseMove.screenX, e.mouseMove.screenY));
io.MousePos = ImVec2((float)clientPt.x, (float)clientPt.y);
//return true;
break;
}
case PlatformEventType::MouseWheel:
io.MouseWheel += e.wheel.delta;
//return true;
break;
case PlatformEventType::KeyDown:
io.KeysDown[(int)e.key.keyCode] = 1;
//return true;
break;
case PlatformEventType::KeyUp:
io.KeysDown[(int)e.key.keyCode] = 0;
//return true;
break;
case PlatformEventType::KeyChar:io.AddInputCharacter(e.key.keyChar);
//return true;
break;
default:
break;
}
//return io.WantCaptureMouse;
//if (!io.WantCaptureMouse)
// return false;
return false;
}
void ImGuiIntegration::addDock(ImGuiDockPane* pane)
{
pane->m_key = "Pane:" + std::to_string(m_dockPanes.size());
m_dockPanes.add(pane);
pane->m_imguiIntegration = this;
}
void ImGuiIntegration::updateDocks(ImGuiID mainWindowId)
{
for (const auto& pane : m_dockPanes) {
pane->update();
}
if (m_dockLayoutResetRequired) {
// BeginDockLayout
{
ImGui::DockBuilderRemoveNode(mainWindowId);
ImGui::DockBuilderAddNode(mainWindowId, ImGuiDockNodeFlags_None);
ImGui::DockBuilderSetNodeSize(mainWindowId, ImGui::GetMainViewport()->Size);
}
ImGuiID nodes1[2];
ImGui::DockBuilderSplitNode(mainWindowId, ImGuiDir_Left, 0.1f, &nodes1[0], &nodes1[1]);
ImGuiID nodes2[2];
ImGui::DockBuilderSplitNode(nodes1[1], ImGuiDir_Right, 0.25f, &nodes2[0], &nodes2[1]);
ImGuiID nodes3[2];
ImGui::DockBuilderSplitNode(nodes2[1], ImGuiDir_Down, 0.2f, &nodes3[0], &nodes3[1]);
ImGuiID nodes4[2];
ImGui::DockBuilderSplitNode(nodes3[1], ImGuiDir_Left, 0.2f, &nodes4[0], &nodes4[1]);
ImGuiID nodes5[2];
ImGui::DockBuilderSplitNode(nodes4[1], ImGuiDir_Right, 0.5f, &nodes5[0], &nodes5[1]);
ImGuiDockNodeFlags localFlags =
//ImGuiDockNodeFlags_NoDockingInCentralNode |
//ImGuiDockNodeFlags_NoSplit |
//ImGuiDockNodeFlags_NoResize |
ImGuiDockNodeFlags_AutoHideTabBar;
ImGui::DockBuilderGetNode(nodes5[0])->LocalFlags = localFlags;
ImGui::DockBuilderGetNode(nodes5[1])->LocalFlags = localFlags;
// ;
//ImGui::dockbuildersetnode
// ImGuiDockNodeFlags_KeepAliveOnly = 1 << 0, // Shared // Don't display the dockspace node but keep it alive. Windows docked into this dockspace node won't be undocked.
////ImGuiDockNodeFlags_NoCentralNode = 1 << 1, // Shared // Disable Central Node (the node which can stay empty)
//ImGuiDockNodeFlags_NoDockingInCentralNode = 1 << 2, // Shared // Disable docking inside the Central Node, which will be always kept empty.
//ImGuiDockNodeFlags_PassthruCentralNode = 1 << 3, // Shared // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details.
//ImGuiDockNodeFlags_NoSplit = 1 << 4, // Shared/Local // Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disabled to reduce confusion). Note: when turned off, existing splits will be preserved.
//ImGuiDockNodeFlags_NoResize = 1 << 5, // Shared/Local // Disable resizing node using the splitter/separators. Useful with programatically setup dockspaces.
//ImGuiDockNodeFlags_AutoHideTabBar = 1 << 6 // Shared/Local // Tab bar will automatically hide when there is a single window in the dock node.
//swig.DockNodeFlags flags = swig.DockNodeFlags.NoTabBar | swig.DockNodeFlags.HiddenTabBar | swig.DockNodeFlags.NoWindowMenuButton | swig.DockNodeFlags.NoCloseButton | swig.DockNodeFlags.NoDocking;
for (auto& pane : m_dockPanes) {
ImGuiID target = 0;
switch (pane->m_initialPlacement)
{
case ImGuiDockPlacement::MainView:
target = nodes5[1];
break;
case ImGuiDockPlacement::Left:
target = nodes1[0];
break;
case ImGuiDockPlacement::Right:
target = nodes2[0];
break;
case ImGuiDockPlacement::Bottom:
target = nodes3[0];
break;
case ImGuiDockPlacement::InnerLeft:
target = nodes4[0];
break;
case ImGuiDockPlacement::DebugView:
target = nodes5[0];
break;
case ImGuiDockPlacement::Floating:
break;
default:
LN_UNREACHABLE();
break;
}
if (target) {
ImGui::DockBuilderDockWindow(pane->m_key.c_str(), target);
}
}
// EndDockLayout
{
ImGui::DockBuilderFinish(mainWindowId);
}
m_dockLayoutResetRequired = false;
}
}
bool ImGuiIntegration::handleUIEvent(UIEventArgs* e)
{
for (const auto& pane : m_dockPanes) {
if (pane->onUIEvent(e)) {
return true;
}
}
return false;
}
} // namespace detail
//==============================================================================
// ImGuiDockPane
ImGuiDockPane::ImGuiDockPane()
: m_imguiIntegration(nullptr)
, m_key()
, m_initialPlacement(ImGuiDockPlacement::Floating)
, m_open(true)
{}
bool ImGuiDockPane::init()
{
if (!Object::init()) return false;
return true;
}
UIFrameWindow* ImGuiDockPane::frameWindow() const
{
return m_imguiIntegration->frameWindow();
}
void ImGuiDockPane::setInitialPlacement(ImGuiDockPlacement value)
{
m_initialPlacement = value;
}
void ImGuiDockPane::close()
{
m_open = false;
}
void ImGuiDockPane::onGui()
{
}
bool ImGuiDockPane::onUIEvent(UIEventArgs* e)
{
return false;
}
void ImGuiDockPane::update()
{
if (m_open) {
ImGui::SetNextWindowSize(ImVec2(320, 240), ImGuiCond_Once);
if (ImGui::Begin(m_key.c_str(), &m_open, 0/*ImGuiWindowFlags_NoMove*/)) {
onGui();
//ImGuiWindow* window = ImGui::GetCurrentWindow();
//const ImVec2 contentSize = ImGui::GetContentRegionAvail();
//if (m_renderView)
//{
// m_tools.mainViewportRenderTarget = RenderTargetTexture::realloc(m_tools.mainViewportRenderTarget, contentSize.x, contentSize.y, TextureFormat::RGBA8, false, SamplerState::pointClamp());
// m_renderView->render(m_renderingGraphicsContext, m_tools.mainViewportRenderTarget);
//}
//ImGui::Image(m_tools.mainViewportRenderTarget, contentSize);
}
ImGui::End();
}
}
} // namespace ln
| 35.100539
| 441
| 0.698941
|
infinnie
|
c6c73a200d5ae7c14a31d604a5103e85c05db1e7
| 1,789
|
hpp
|
C++
|
avoidthebug-android/app/src/main/cpp/include/GameLogic.hpp
|
dimi309/small3d-samples
|
8cccf40eb75782806fa7b9006a1cb43233ce54af
|
[
"BSD-3-Clause"
] | 2
|
2020-02-05T03:36:22.000Z
|
2020-02-05T05:04:35.000Z
|
avoidthebug-android/app/src/main/cpp/include/GameLogic.hpp
|
dimi309/gloom
|
8c1d8600c316384d005c226f0b27af4072bce5ac
|
[
"BSD-3-Clause"
] | null | null | null |
avoidthebug-android/app/src/main/cpp/include/GameLogic.hpp
|
dimi309/gloom
|
8c1d8600c316384d005c226f0b27af4072bce5ac
|
[
"BSD-3-Clause"
] | 1
|
2021-12-03T05:34:22.000Z
|
2021-12-03T05:34:22.000Z
|
/*
* GameLogic.hpp
*
* Created on: 2014/11/09
* Author: Dimitri Kourkoulis
* License: BSD 3-Clause License (see LICENSE file)
*/
#pragma once
#include <memory>
#include <small3d/SceneObject.hpp>
#include <small3d/Renderer.hpp>
#include <small3d/Sound.hpp>
#include "KeyInput.hpp"
using namespace small3d;
namespace AvoidTheBug3D {
/**
* @class GameLogic
*
* @brief The main body of the sample game.
*
*/
class GameLogic {
private:
SceneObject goat, bug, tree;
Sound bahSound;
enum GameState {
START_SCREEN, PLAYING
};
GameState gameState;
enum BugState {
FLYING_STRAIGHT, TURNING, DIVING_DOWN, DIVING_UP
};
BugState bugState, bugPreviousState;
int bugFramesInCurrentState;
float bugVerticalSpeed;
Model skyRect, groundRect, msgRect, startScreenRect;
double startSeconds;
int seconds;
double endSeconds;
void initGame();
void processGame(const KeyInput &keyInput);
void processStartScreen(const KeyInput &keyInput);
void moveGoat(const KeyInput &keyInput);
void moveBug();
public:
double currentTimeInSeconds();
Renderer *renderer;
/**
* Constructor
*/
GameLogic();
/**
* Destructor
*/
~GameLogic();
/**
* Process conditions and set up the next frame, also taking into consideration
* the input from the keyboard
*
* @param keyInput The keyboard input
*/
void process(const KeyInput &keyInput);
/**
* @fn void GameLogic::render();
*
* @brief Renders the current state of the game on the screen.
*
*/
void render();
void pause();
void resume();
float lightModifier;
};
} /* namespace AvoidTheBug3D */
| 16.564815
| 83
| 0.63052
|
dimi309
|
c6ca7762e635e30b1eb36cce801f63bedaeb0c42
| 5,823
|
cpp
|
C++
|
src/TrigBuf.cpp
|
miRackModular/ML_modules
|
c9c26bdca5c9a5a86ddb34653d856132be5d1e17
|
[
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 100
|
2017-10-04T23:06:33.000Z
|
2022-01-19T05:21:04.000Z
|
src/TrigBuf.cpp
|
miRackModular/ML_modules
|
c9c26bdca5c9a5a86ddb34653d856132be5d1e17
|
[
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 68
|
2017-10-04T15:38:16.000Z
|
2021-12-05T12:33:54.000Z
|
src/TrigBuf.cpp
|
miRackModular/ML_modules
|
c9c26bdca5c9a5a86ddb34653d856132be5d1e17
|
[
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 19
|
2017-10-05T17:19:44.000Z
|
2021-05-31T11:24:58.000Z
|
#include "ML_modules.hpp"
struct TrigBuf : Module {
enum ParamIds {
ARM1_PARAM,
ARM2_PARAM,
NUM_PARAMS
};
enum InputIds {
ARM1_INPUT,
ARM2_INPUT,
GATE1_INPUT,
GATE2_INPUT,
NUM_INPUTS
};
enum OutputIds {
OUT1_OUTPUT,
OUT2_OUTPUT,
NUM_OUTPUTS
};
enum LightIds {
ARM1_LIGHT,
ARM2_LIGHT,
NUM_LIGHTS
};
TrigBuf() {
config( NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS );
configParam(TrigBuf::ARM1_PARAM, 0, 10, 0);
configParam(TrigBuf::ARM2_PARAM, 0, 10, 0);
onReset();
};
void process(const ProcessArgs &args) override;
float arm1[PORT_MAX_CHANNELS], arm2[PORT_MAX_CHANNELS];
float out1[PORT_MAX_CHANNELS], out2[PORT_MAX_CHANNELS];
bool gate1[PORT_MAX_CHANNELS], gate2[PORT_MAX_CHANNELS];
bool delayed1[PORT_MAX_CHANNELS], delayed2[PORT_MAX_CHANNELS];
dsp::SchmittTrigger armTrigger1[PORT_MAX_CHANNELS], armTrigger2[PORT_MAX_CHANNELS];
dsp::SchmittTrigger gateTrigger1[PORT_MAX_CHANNELS], gateTrigger2[PORT_MAX_CHANNELS];
void onReset() override {
memset(arm1, 0, PORT_MAX_CHANNELS*sizeof(float));
memset(arm2, 0, PORT_MAX_CHANNELS*sizeof(float));
memset(out1, 0, PORT_MAX_CHANNELS*sizeof(float));
memset(out2, 0, PORT_MAX_CHANNELS*sizeof(float));
memset(gate1, 0, PORT_MAX_CHANNELS*sizeof(bool));
memset(gate2, 0, PORT_MAX_CHANNELS*sizeof(bool));
memset(delayed1, 0, PORT_MAX_CHANNELS*sizeof(bool));
memset(delayed2, 0, PORT_MAX_CHANNELS*sizeof(bool));
};
private:
bool neg_slope(bool gate, bool last_gate) { return (gate!=last_gate) && last_gate; }
};
void TrigBuf::process(const ProcessArgs &args) {
bool last_gate1[PORT_MAX_CHANNELS];
bool last_gate2[PORT_MAX_CHANNELS];
memcpy(last_gate1, gate1, PORT_MAX_CHANNELS * sizeof(bool));
memcpy(last_gate2, gate2, PORT_MAX_CHANNELS * sizeof(bool));
float gate1_in[PORT_MAX_CHANNELS], gate2_in[PORT_MAX_CHANNELS];
memset(gate1_in, 0, PORT_MAX_CHANNELS*sizeof(float));
memset(gate2_in, 0, PORT_MAX_CHANNELS*sizeof(float));
int arm1_channels = inputs[ARM1_INPUT].getChannels(); arm1_channels = MAX(1, arm1_channels);
int arm2_channels = inputs[ARM2_INPUT].getChannels(); arm2_channels = MAX(1, arm2_channels);
int gate1_channels = inputs[GATE1_INPUT].getChannels();
int gate2_channels = inputs[GATE2_INPUT].getChannels();
int channels_1 = arm1_channels==1?gate1_channels:MIN(arm1_channels, gate1_channels);
int channels_2 = arm2_channels==1?gate2_channels:MIN(arm2_channels, gate2_channels);
memcpy(gate1_in, inputs[GATE1_INPUT].getVoltages(), gate1_channels*sizeof(float) );
if(inputs[GATE2_INPUT].isConnected()) {
memcpy(gate2_in, inputs[GATE2_INPUT].getVoltages(), gate2_channels*sizeof(float) );
} else {
gate2_channels = gate1_channels;
memcpy(gate2_in, gate1_in, gate2_channels*sizeof(float) );
}
// if gateX_channel == 1: use same gate (clock) for all channels
// if armX_channels == 1: use same arm for all channels
// if both > 1 channels_X = MIN(gateX_channels, armX_Channels) (other channels will never be triggered)
for(int c=0; c < channels_1; c++) {
gateTrigger1[c].process(gate1_in[c]);
gate1[c] = gateTrigger1[c].isHigh();
if( armTrigger1[c].process(inputs[ARM1_INPUT].getNormalPolyVoltage(0.0f, c) + params[ARM1_PARAM].getValue() ) ) {
if (!gate1[c]) {arm1[c] = 10.0;}
else { delayed1[c] = true;}
}
if(gate1[c]) {
out1[c] = (arm1[c] > 5.0f) ? 10.0f : 0.0f;
}
else {
if(out1[c] > 5.0f) {
arm1[c] = 0.0f;
out1[c] = 0.0f;
};
};
if( delayed1[c] && neg_slope(gate1[c], last_gate1[c]) ) {
arm1[c] = 10.0;
delayed1[c] = false;
};
}
for(int c=0; c < channels_2; c++) {
gateTrigger2[c].process(gate2_in[c]);
gate2[c] = gateTrigger2[c].isHigh();
if( armTrigger2[c].process(inputs[ARM2_INPUT].getNormalPolyVoltage(inputs[ARM1_INPUT].getNormalPolyVoltage(0.0f, c), c) + params[ARM2_PARAM].getValue() ) ) {
if (!gate2[c]) {arm2[c] = 10.0f;}
else {delayed2[c] = true;};
};
if (gate2[c]) {
out2[c] = (arm2[c] > 5.0f)? 10.0f : 0.0f;
} else {
if(out2[c] > 5.0) {
arm2[c] = 0.0;
out2[c] = 0.0;
};
};
if( delayed2[c] && neg_slope(gate2[c], last_gate2[c]) ) {
arm2[c] = 10.0f;
delayed2[c] = false;
};
}
outputs[OUT1_OUTPUT].setChannels(channels_1);
outputs[OUT2_OUTPUT].setChannels(channels_2);
outputs[OUT1_OUTPUT].writeVoltages(out1);
outputs[OUT2_OUTPUT].writeVoltages(out2);
lights[ARM1_LIGHT].setBrightness(arm1[0]);
lights[ARM2_LIGHT].setBrightness(arm2[0]);
};
struct TrigBufWidget : ModuleWidget {
TrigBufWidget(TrigBuf *module);
};
TrigBufWidget::TrigBufWidget(TrigBuf *module) {
setModule(module);
box.size = Vec(15*4, 380);
{
SvgPanel *panel = new SvgPanel();
panel->box.size = box.size;
panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance,"res/TrigBuf.svg")));
addChild(panel);
}
addChild(createWidget<MLScrew>(Vec(15, 0)));
addChild(createWidget<MLScrew>(Vec(15, 365)));
addInput(createInput<MLPort>(Vec(9, 62), module, TrigBuf::ARM1_INPUT));
addInput(createInput<MLPort>(Vec(9, 105), module, TrigBuf::GATE1_INPUT));
addOutput(createOutput<MLPort>(Vec(9, 150), module, TrigBuf::OUT1_OUTPUT));
addParam(createParam<ML_SmallLEDButton>(Vec(40,66), module, TrigBuf::ARM1_PARAM));
addChild(createLight<MLSmallLight<GreenLight>>(Vec(44, 70), module, TrigBuf::ARM1_LIGHT));
addInput(createInput<MLPort>(Vec(9, 218), module, TrigBuf::ARM2_INPUT));
addInput(createInput<MLPort>(Vec(9, 263), module, TrigBuf::GATE2_INPUT));
addOutput(createOutput<MLPort>(Vec(9, 305), module, TrigBuf::OUT2_OUTPUT));
addParam(createParam<ML_SmallLEDButton>(Vec(40,222), module, TrigBuf::ARM2_PARAM));
addChild(createLight<MLSmallLight<GreenLight>>(Vec(44, 226), module, TrigBuf::ARM2_LIGHT));
}
Model *modelTrigBuf = createModel<TrigBuf, TrigBufWidget>("TrigBuf");
| 27.597156
| 160
| 0.7096
|
miRackModular
|
c6ccd8720f2a8de05349959fe3caaffe097e3ffd
| 5,704
|
hpp
|
C++
|
inc/Services/RequestVerificationService.hpp
|
ACubeSAT/ecss-services
|
92d81c1ff455d9baef9417e656388c98ec552751
|
[
"MIT"
] | null | null | null |
inc/Services/RequestVerificationService.hpp
|
ACubeSAT/ecss-services
|
92d81c1ff455d9baef9417e656388c98ec552751
|
[
"MIT"
] | null | null | null |
inc/Services/RequestVerificationService.hpp
|
ACubeSAT/ecss-services
|
92d81c1ff455d9baef9417e656388c98ec552751
|
[
"MIT"
] | null | null | null |
#ifndef ECSS_SERVICES_REQUESTVERIFICATIONSERVICE_HPP
#define ECSS_SERVICES_REQUESTVERIFICATIONSERVICE_HPP
#include "Service.hpp"
#include "Message.hpp"
#include "ErrorHandler.hpp"
#include "ECSS_Definitions.hpp"
/**
* Implementation of the ST[01] request verification service
*
* Note:For the time being, the cause(routing, acceptance, execution), that functions of ST[01]
* should be called, hasn't been implemented yet. In main.cpp there are some random calls with
* dummy values.
*
* @todo See if the deduced data defined from the standard should still be ignored. This deduced
* data exists only in reports that send failure signs(for example the TM[1,2])
*
* @ingroup Services
*/
class RequestVerificationService : public Service {
public:
inline static const uint8_t ServiceType = 1;
enum MessageType : uint8_t {
SuccessfulAcceptanceReport = 1,
FailedAcceptanceReport = 2,
SuccessfulStartOfExecution = 3,
FailedStartOfExecution = 4,
SuccessfulProgressOfExecution = 5,
FailedProgressOfExecution = 6,
SuccessfulCompletionOfExecution = 7,
FailedCompletionOfExecution = 8,
FailedRoutingReport = 10,
};
RequestVerificationService() {
serviceType = 1;
}
/**
* TM[1,1] successful acceptance verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info
* of the telecommand packet that accepted successfully
*/
void successAcceptanceVerification(const Message& request);
/**
* TM[1,2] failed acceptance verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic
* info of the telecommand packet that failed to be accepted
* @param errorCode The cause of creating this type of report
*/
void failAcceptanceVerification(const Message& request, ErrorHandler::AcceptanceErrorType errorCode);
/**
* TM[1,3] successful start of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info
* of the telecommand packet that its start of execution is successful
*/
void successStartExecutionVerification(const Message& request);
/**
* TM[1,4] failed start of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info
* of the telecommand packet that its start of execution has failed
* @param errorCode The cause of creating this type of report
*/
void failStartExecutionVerification(const Message& request, ErrorHandler::ExecutionStartErrorType errorCode);
/**
* TM[1,5] successful progress of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info
* of the telecommand packet that its progress of execution is successful
* @param stepID If the execution of a request is a long process, then we can divide
* the process into steps. Each step goes with its own definition, the stepID.
* @todo Each value,that the stepID is assigned, should be documented.
* @todo error handling for undocumented assigned values to stepID
*/
void successProgressExecutionVerification(const Message& request, uint8_t stepID);
/**
* TM[1,6] failed progress of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info
* of the telecommand packet that its progress of execution has failed
* @param errorCode The cause of creating this type of report
* @param stepID If the execution of a request is a long process, then we can divide
* the process into steps. Each step goes with its own definition, the stepID.
* @todo Each value,that the stepID is assigned, should be documented.
* @todo error handling for undocumented assigned values to stepID
*/
void failProgressExecutionVerification(const Message& request, ErrorHandler::ExecutionProgressErrorType errorCode,
uint8_t stepID);
/**
* TM[1,7] successful completion of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually data members of Message that contain the basic info of the
* telecommand packet that executed completely and successfully
*/
void successCompletionExecutionVerification(const Message& request);
/**
* TM[1,8] failed completion of execution verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info of the
* telecommand packet that failed to be executed completely
* @param errorCode The cause of creating this type of report
*/
void failCompletionExecutionVerification(const Message& request,
ErrorHandler::ExecutionCompletionErrorType errorCode);
/**
* TM[1,10] failed routing verification report
*
* @param request Contains the necessary data to send the report.
* The data is actually some data members of Message that contain the basic info of the
* telecommand packet that failed the routing
* @param errorCode The cause of creating this type of report
*/
void failRoutingVerification(const Message &request, ErrorHandler::RoutingErrorType errorCode);
};
#endif // ECSS_SERVICES_REQUESTVERIFICATIONSERVICE_HPP
| 40.742857
| 115
| 0.757188
|
ACubeSAT
|
c6cdb05f7f05b3b811b26bc2f1604c2c5c61fb05
| 257
|
cpp
|
C++
|
YorozuyaGSLib/source/_enter_world_request_wrac.cpp
|
lemkova/Yorozuya
|
f445d800078d9aba5de28f122cedfa03f26a38e4
|
[
"MIT"
] | 29
|
2017-07-01T23:08:31.000Z
|
2022-02-19T10:22:45.000Z
|
YorozuyaGSLib/source/_enter_world_request_wrac.cpp
|
kotopes/Yorozuya
|
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
|
[
"MIT"
] | 90
|
2017-10-18T21:24:51.000Z
|
2019-06-06T02:30:33.000Z
|
YorozuyaGSLib/source/_enter_world_request_wrac.cpp
|
kotopes/Yorozuya
|
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
|
[
"MIT"
] | 44
|
2017-12-19T08:02:59.000Z
|
2022-02-24T23:15:01.000Z
|
#include <_enter_world_request_wrac.hpp>
START_ATF_NAMESPACE
int _enter_world_request_wrac::size()
{
using org_ptr = int (WINAPIV*)(struct _enter_world_request_wrac*);
return (org_ptr(0x14011f240L))(this);
};
END_ATF_NAMESPACE
| 23.363636
| 74
| 0.719844
|
lemkova
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.