blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
799a1107cf8d632b715990f51e4d1eb7802422b2 | dc4415e694afc549eaf2cfa3173c275e28482dc8 | /TMVAtreeReader.h | 91347db47ef3261664de25521e19a11a168f9666 | [] | no_license | swagata87/h2gglobe | 00b8cf882610c97dddeb7887aeab248031c218ad | 8bcbff1f4c6e53196ed24cf7fd3f2b7473bb0400 | refs/heads/master | 2021-01-14T11:44:53.957677 | 2015-02-06T06:45:57 | 2015-02-06T06:45:57 | 28,657,435 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,481 | h | //////////////////////////////////////////////////////////
// This class has been automatically generated on
// Mon Mar 24 11:13:56 2014 by ROOT version 5.34/03
// from TTree TrainTree/TrainTree
// found on file: TMVA_photonid.root
//////////////////////////////////////////////////////////
#ifndef TMVAtreeReader_h
#define TMVAtreeReader_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
// Header file for the classes stored in the TTree if any.
// Fixed size dimensions of array or collections stored in the TTree if any.
class TMVAtreeReader {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain
// Declaration of leaf types
Int_t classID;
Char_t className[11];
Float_t r9_pho;
Float_t r9_cleaned_pho;
Float_t pT_pho;
Float_t hoe_pho;
Float_t sieie_pho;
Float_t sieip_pho;
Float_t sieie_cleaned_pho;
Float_t E2byE5_pho;
Float_t E2byE5_cleaned_pho;
Float_t sieip_cleaned_pho;
Float_t scRaw_pho;
Float_t etawidth_pho;
Float_t phiwidth_pho;
Float_t sc_eta_pho;
Float_t itype;
Float_t genmatched_pho;
Float_t nPho;
Float_t nvtx;
Float_t Gradient_cat1;
Float_t Gradient_cat2;
Float_t weight;
Float_t Gradient;
Float_t trkiso03_pho;
Float_t sipip_pho;
Float_t pf_charged_iso_chosenvtx;
Float_t pf_charged_iso_vtx1;
Float_t pf_charged_iso_vtx2;
Float_t pf_charged_iso_badvtx;
Float_t pf_pho_iso;
Float_t pf_pho_iso_eta030;
Float_t pf_pho_iso_eta045;
Float_t pf_pho_iso_eta060;
Float_t pf_pho_iso_eta075;
Float_t pf_pho_iso_eta090;
Float_t pf_pho_iso_dR070;
Float_t rho;
// List of branches
TBranch *b_classID; //!
TBranch *b_className; //!
TBranch *b_r9_cleaned_pho; //!
TBranch *b_r9_pho; //!
TBranch *b_pT_pho; //!
TBranch *b_hoe_pho; //!
TBranch *b_sieie_cleaned_pho; //!
TBranch *b_sieip_cleaned_pho; //!
TBranch *b_sieie_pho; //!
TBranch *b_sieip_pho; //!
TBranch *b_scRaw_pho; //!
TBranch *b_etawidth_pho; //!
TBranch *b_phiwidth_pho; //!
TBranch *b_E2byE5_pho;
TBranch *b_E2byE5_cleaned_pho;
TBranch *b_sc_eta_pho; //!
TBranch *b_itype; //!
TBranch *b_genmatched_pho; //!
TBranch *b_nPho; //!
TBranch *b_nvtx; //!
TBranch *b_Gradient_cat1; //!
TBranch *b_Gradient_cat2; //!
TBranch *b_weight; //!
TBranch *b_Gradient; //!
TBranch *b_sipip_pho; //!
TBranch *b_pf_charged_iso_chosenvtx; //!
TBranch *b_pf_charged_iso_vtx1;
TBranch *b_pf_charged_iso_vtx2;
TBranch *b_pf_charged_iso_badvtx; //!
TBranch *b_pf_pho_iso; //!
TBranch *b_pf_pho_iso_eta030; //!
TBranch *b_pf_pho_iso_eta045; //!
TBranch *b_pf_pho_iso_eta060; //!
TBranch *b_pf_pho_iso_eta075; //!
TBranch *b_pf_pho_iso_eta090; //!
TBranch *b_pf_pho_iso_dR070; //!
TBranch *b_trkiso03_pho; //!
TBranch *b_rho; //!
TMVAtreeReader(TTree *tree=0);
virtual ~TMVAtreeReader();
virtual Int_t Cut(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry);
virtual Long64_t LoadTree(Long64_t entry);
virtual void Init(TTree *tree);
virtual void Loop();
virtual Bool_t Notify();
virtual void Show(Long64_t entry = -1);
};
#endif
#ifdef TMVAtreeReader_cxx
TMVAtreeReader::TMVAtreeReader(TTree *tree) : fChain(0)
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
if (tree == 0) {
///// TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("TMVA_photonid_General.root");
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("TMVA_GJet_14TeV_General_Jan13.root");
if (!f || !f->IsOpen()) {
////// f = new TFile("TMVA_photonid_General.root");
f = new TFile("TMVA_GJet_14TeV_General_Jan13.root");
}
f->GetObject("TrainTree",tree);
//// f->GetObject("TestTree",tree);
}
Init(tree);
}
TMVAtreeReader::~TMVAtreeReader()
{
if (!fChain) return;
delete fChain->GetCurrentFile();
}
Int_t TMVAtreeReader::GetEntry(Long64_t entry)
{
// Read contents of entry.
if (!fChain) return 0;
return fChain->GetEntry(entry);
}
Long64_t TMVAtreeReader::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
if (!fChain) return -5;
Long64_t centry = fChain->LoadTree(entry);
if (centry < 0) return centry;
if (fChain->GetTreeNumber() != fCurrent) {
fCurrent = fChain->GetTreeNumber();
Notify();
}
return centry;
}
void TMVAtreeReader::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses and branch
// pointers of the tree will be set.
// It is normally not necessary to make changes to the generated
// code, but the routine can be extended by the user if needed.
// Init() will be called many times when running on PROOF
// (once per file to be processed).
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fCurrent = -1;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("classID", &classID, &b_classID);
fChain->SetBranchAddress("className", className, &b_className);
fChain->SetBranchAddress("r9_cleaned_pho", &r9_cleaned_pho, &b_r9_cleaned_pho);
fChain->SetBranchAddress("r9_pho", &r9_pho, &b_r9_pho);
fChain->SetBranchAddress("hoe_pho", &hoe_pho, &b_hoe_pho);
fChain->SetBranchAddress("pT_pho", &pT_pho, &b_pT_pho);
fChain->SetBranchAddress("sieie_cleaned_pho", &sieie_cleaned_pho, &b_sieie_cleaned_pho);
fChain->SetBranchAddress("sieip_cleaned_pho", &sieip_cleaned_pho, &b_sieip_cleaned_pho);
fChain->SetBranchAddress("sieie_pho", &sieie_pho, &b_sieie_pho);
fChain->SetBranchAddress("sieip_pho", &sieip_pho, &b_sieip_pho);
fChain->SetBranchAddress("scRaw_pho", &scRaw_pho, &b_scRaw_pho);
fChain->SetBranchAddress("etawidth_pho", &etawidth_pho, &b_etawidth_pho);
fChain->SetBranchAddress("phiwidth_pho", &phiwidth_pho, &b_phiwidth_pho);
fChain->SetBranchAddress("sipip_pho", &sipip_pho, &b_sipip_pho);
fChain->SetBranchAddress("pf_charged_iso_chosenvtx", &pf_charged_iso_chosenvtx, &b_pf_charged_iso_chosenvtx);
fChain->SetBranchAddress("pf_charged_iso_vtx1", &pf_charged_iso_vtx1, &b_pf_charged_iso_vtx1);
fChain->SetBranchAddress("pf_charged_iso_vtx2", &pf_charged_iso_vtx2, &b_pf_charged_iso_vtx2);
fChain->SetBranchAddress("pf_charged_iso_badvtx", &pf_charged_iso_badvtx, &b_pf_charged_iso_badvtx);
fChain->SetBranchAddress("pf_pho_iso", &pf_pho_iso, &b_pf_pho_iso);
fChain->SetBranchAddress("pf_pho_iso_eta030", &pf_pho_iso_eta030, &b_pf_pho_iso_eta030);
fChain->SetBranchAddress("pf_pho_iso_eta045", &pf_pho_iso_eta045, &b_pf_pho_iso_eta045);
fChain->SetBranchAddress("pf_pho_iso_eta060", &pf_pho_iso_eta060, &b_pf_pho_iso_eta060);
fChain->SetBranchAddress("pf_pho_iso_eta075", &pf_pho_iso_eta075, &b_pf_pho_iso_eta075);
fChain->SetBranchAddress("pf_pho_iso_eta090", &pf_pho_iso_eta090, &b_pf_pho_iso_eta090);
fChain->SetBranchAddress("pf_pho_iso_dR070", &pf_pho_iso_dR070, &b_pf_pho_iso_dR070);
fChain->SetBranchAddress("E2byE5_pho", &E2byE5_pho, &b_E2byE5_pho);
fChain->SetBranchAddress("E2byE5_cleaned_pho", &E2byE5_cleaned_pho, &b_E2byE5_cleaned_pho);
fChain->SetBranchAddress("trkiso03_pho", &trkiso03_pho, &b_trkiso03_pho);
fChain->SetBranchAddress("sc_eta_pho", &sc_eta_pho, &b_sc_eta_pho);
fChain->SetBranchAddress("itype", &itype, &b_itype);
fChain->SetBranchAddress("genmatched_pho", &genmatched_pho, &b_genmatched_pho);
fChain->SetBranchAddress("nPho", &nPho, &b_nPho);
fChain->SetBranchAddress("nvtx", &nvtx, &b_nvtx);
fChain->SetBranchAddress("Gradient_cat1", &Gradient_cat1, &b_Gradient_cat1);
fChain->SetBranchAddress("Gradient_cat2", &Gradient_cat2, &b_Gradient_cat2);
fChain->SetBranchAddress("weight", &weight, &b_weight);
fChain->SetBranchAddress("Gradient", &Gradient, &b_Gradient);
fChain->SetBranchAddress("rho", &rho, &b_rho);
Notify();
}
Bool_t TMVAtreeReader::Notify()
{
// The Notify() function is called when a new file is opened. This
// can be either for a new TTree in a TChain or when when a new TTree
// is started when using PROOF. It is normally not necessary to make changes
// to the generated code, but the routine can be extended by the
// user if needed. The return value is currently not used.
return kTRUE;
}
void TMVAtreeReader::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
if (!fChain) return;
fChain->Show(entry);
}
Int_t TMVAtreeReader::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns 1 if entry is accepted.
// returns -1 otherwise.
return 1;
}
#endif // #ifdef TMVAtreeReader_cxx
| [
"s.mukherjee@cern.ch"
] | s.mukherjee@cern.ch |
12ac4e66ace2f811257d7f4fcc1db1421bc8ba25 | 5d3e0178d8cf295e10c64e236c56685b74f90b92 | /TurnserverTest/dbdriver/dbdriver.cpp | 5ed849d429369e4f0c30bfac935af7a0d7213ab0 | [] | no_license | fucora/Turnserver | 728967f3dc738a3cf33c4062a3394c2d0f4b622f | 79fe5ba340b59ceb7c2b88a78bb24fe57ee464b2 | refs/heads/master | 2020-05-19T12:24:15.642105 | 2019-05-03T14:52:17 | 2019-05-03T14:52:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,388 | cpp | /*
* Copyright (C) 2011, 2012, 2013 Citrix Systems
* Copyright (C) 2014 Vivocha S.p.A.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "../ns_turn_defs.h"
#include "../mainheader.h"
#include "../common/apputils.h"
#include "dbdriver.h"
#include "dbd_sqlite.h"
#include "dbd_pgsql.h"
#include "dbd_mysql.h"
#include "dbd_mongo.h"
#include "dbd_redis.h"
#include "../server/userdb.h"
static void make_connection_key(void)
{
(void) pthread_key_create(&connection_key, NULL);
}
pthread_key_t connection_key;
pthread_once_t connection_key_once = PTHREAD_ONCE_INIT;
int convert_string_key_to_binary(char* keysource, hmackey_t key, size_t sz) {
char is[3];
size_t i;
unsigned int v;
is[2]=0;
for(i=0;i<sz;i++) {
is[0]=keysource[i*2];
is[1]=keysource[i*2+1];
sscanf(is,"%02x",&v);
key[i]=(unsigned char)v;
}
return 0;
}
persistent_users_db_t * get_persistent_users_db(void) {
return &(turn_params.default_users_db.persistent_users_db);
}
const turn_dbdriver_t * get_dbdriver()
{
if (turn_params.default_users_db.userdb_type == TURN_USERDB_TYPE_UNKNOWN)
return NULL;
(void) pthread_once(&connection_key_once, make_connection_key);
static const turn_dbdriver_t * _driver = NULL;
if (_driver == NULL) {
switch (turn_params.default_users_db.userdb_type){
#if !defined(TURN_NO_SQLITE)
case TURN_USERDB_TYPE_SQLITE:
_driver = get_sqlite_dbdriver();
break;
#endif
#if !defined(TURN_NO_PQ)
case TURN_USERDB_TYPE_PQ:
_driver = get_pgsql_dbdriver();
break;
#endif
#if !defined(TURN_NO_MYSQL)
case TURN_USERDB_TYPE_MYSQL:
_driver = get_mysql_dbdriver();
break;
#endif
#if !defined(TURN_NO_MONGO)
case TURN_USERDB_TYPE_MONGO:
//_driver = get_mongo_dbdriver();
_driver = NULL;
break;
#endif
#if !defined(TURN_NO_HIREDIS)
case TURN_USERDB_TYPE_REDIS:
_driver = get_redis_dbdriver();
break;
#endif
default:
break;
}
}
return _driver;
}
| [
"742923150@qq.com"
] | 742923150@qq.com |
7bd6ee7e4c6c389d6a0e7151ac5b883da9b0c7f0 | 3dab5ebfa1165d7e5a43034ea6e6164dab7797f0 | /TP3/2/src/Fille.hpp | 75c4b30a031d45b3008709963d3ae4a93faf8ca8 | [] | no_license | CavaniNicolas/CppZZ2_TPs | 2fef8e881baf4c62ad07113bfd0400c14d98af73 | 72869685da09c3e919627e9262b8412e648a5ddf | refs/heads/main | 2023-01-18T19:22:44.040487 | 2020-11-22T19:50:22 | 2020-11-22T19:50:22 | 303,212,153 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 187 | hpp |
#ifndef FILLE_H
#define FILLE_H
#include "Mere.hpp"
class Fille : public Mere {
private:
public:
Fille(std::string = "None");
~Fille();
void afficher();
};
#endif | [
"cavani.nicolas6@gmail.com"
] | cavani.nicolas6@gmail.com |
ab10ba87203971c78012ad3001eb2af54a2921ad | 5470644b5f0834b9646649da365c96101a2f9b2a | /Sources/Elastos/Frameworks/Droid/Base/Test-runner/src/droid/test/TestFilePrinter.cpp | e08cd0347de4de7bdd29b02ea08224c3630ce0b3 | [] | no_license | dothithuy/ElastosRDK5_0 | 42372da3c749170581b5ee9b3884f4a27ae81608 | 2cf231e9f09f8b3b8bcacb11080b4a87d047833f | refs/heads/master | 2021-05-13T15:02:22.363934 | 2015-05-25T01:54:38 | 2015-05-25T01:54:38 | 116,755,452 | 1 | 0 | null | 2018-01-09T02:33:06 | 2018-01-09T02:33:06 | null | UTF-8 | C++ | false | false | 5,359 | cpp | #include "droid/test/TestFilePrinter.h"
#include <elastos/StringBuilder.h>
#include <elastos/StringUtils.h>
#include <elastos/Logger.h>
using Elastos::Core::StringBuilder;
using Elastos::Core::StringUtils;
using Elastos::IO::IOutputStream;
using Elastos::IO::CFileOutputStream;
using Elastos::IO::CDataOutputStream;
using Elastos::IO::IFlushable;
using Elastos::Utility::Logging::Logger;
using Libcore::IO::ILibcore;
using Libcore::IO::CLibcore;
using Libcore::IO::IOs;
using Eunit::Framework::EIID_ITestListener;
namespace Elastos {
namespace Droid {
namespace Test {
const String TestFilePrinter::PATH("/data/data/com.elastos.runtime/elastos/data/");
TestFilePrinter::TestFilePrinter(
/* [in] */ const String& tag,
/* [in] */ const String& packageName,
/* [in] */ Boolean onlyFailures)
: mTag(tag)
, mOnlyFailures(onlyFailures)
{
AutoPtr<ILibcore> libcore;
CLibcore::AcquireSingleton((ILibcore**)&libcore);
AutoPtr<IOs> os;
libcore->GetOs((IOs**)&os);
Int32 pid;
os->Getpid(&pid);
StringBuilder sb;
sb += "\nI/";
sb += mTag;
sb += "(";
sb += pid;
sb += "): ";
mPrefix = sb.ToString();
}
TestFilePrinter::~TestFilePrinter()
{
if (mFileOut != NULL) {
mFileOut->Close();
}
}
CAR_INTERFACE_IMPL_2(TestFilePrinter, ITestListener, ITestRunnerListener)
ECode TestFilePrinter::Started(
/* [in] */ const String& className)
{
if (mOutput == NULL) return NOERROR;
if (!mOnlyFailures) {
mOutput->WriteUTF(mPrefix + "started: " + className);
}
return NOERROR;
}
ECode TestFilePrinter::Finished(
/* [in] */ const String& className)
{
if (mOutput == NULL) return NOERROR;
if (!mOnlyFailures) {
mOutput->WriteUTF(mPrefix + "finished: " + className);
}
return NOERROR;
}
ECode TestFilePrinter::Performance(
/* [in] */ const String& className,
/* [in] */ Int64 itemTimeNS,
/* [in] */ Int32 iterations,
/* [in] */ IList* itermediates)
{
if (mOutput == NULL) return NOERROR;
mPrefix.AppendFormat("perf: %s = %lldns/op (done %d times)",
className.string(), itemTimeNS, iterations);
mOutput->WriteUTF(mPrefix);
if (itermediates != NULL) {
Int32 N;
itermediates->GetSize(&N);
for (Int32 i = 0; i < N; i++) {
assert(0);
// TestRunner.IntermediateTime time = intermediates.get(i);
// Log.i(mTag, " intermediate: " + time.name + " = "
// + time.timeInNS + "ns");
}
}
return NOERROR;
}
ECode TestFilePrinter::Passed(
/* [in] */ const String& className)
{
if (mOutput == NULL) return NOERROR;
if (!mOnlyFailures) {
mOutput->WriteUTF(mPrefix + "passed: " + className);
mOutput->WriteUTF(String("\n"));
}
return NOERROR;
}
ECode TestFilePrinter::Failed(
/* [in] */ const String& className,
/* [in] */ ITestFailure* failure)
{
if (mOutput == NULL) return NOERROR;
mOutput->WriteUTF(mPrefix + "failed: " + className);
String message;
failure->ExceptionMessage(&message);
mOutput->WriteUTF(mPrefix + message);
mOutput->WriteUTF(mPrefix + String("----- begin exception -----"));
String trace;
failure->Trace(&trace);
AutoPtr< ArrayOf<String> > lines;
StringUtils::Split(trace, "\n", (ArrayOf<String>**)&lines);
for (Int32 i = 0; i < lines->GetLength(); ++i) {
mOutput->WriteUTF(mPrefix + (*lines)[i]);
}
mOutput->WriteUTF(mPrefix + String("----- end exception -----"));
return NOERROR;
}
void TestFilePrinter::Failed(
/* [in] */ ITest* test,
/* [in] */ ITestFailure* failure)
{
String testStr;
IObject::Probe(test)->ToString(&testStr);
mFailedTests.Insert(testStr);
Failed(testStr, failure);
}
ECode TestFilePrinter::AddError(
/* [in] */ ITest* test,
/* [in] */ ECode ec)
{
assert(0);
// Failed(test, ec);
return NOERROR;
}
ECode TestFilePrinter::AddFailure(
/* [in] */ ITest* test,
/* [in] */ ITestFailure* failure)
{
Failed(test, failure);
return NOERROR;
}
ECode TestFilePrinter::EndTest(
/* [in] */ ITest* test)
{
String testStr;
IObject::Probe(test)->ToString(&testStr);
Finished(testStr);
if (mFailedTests.Find(testStr) == mFailedTests.End()) {
Passed(testStr);
}
mFailedTests.Erase(testStr);
if (mOutput != NULL) {
IFlushable::Probe(mOutput)->Flush();
mFileOut->Close();
mFileOut = NULL;
}
return NOERROR;
}
ECode TestFilePrinter::StartTest(
/* [in] */ ITest* test)
{
String testStr;
IObject::Probe(test)->ToString(&testStr);
Int32 startIndex = testStr.LastIndexOf("(");
Int32 endIndex = testStr.LastIndexOf(")");
String className = testStr.Substring(startIndex + 1, endIndex);
endIndex = startIndex;
String methodName = testStr.Substring(0, endIndex);
String path = PATH + className + "_" + methodName + ".out";
ECode ec = CFileOutputStream::New(path, (IFileOutputStream**)&mFileOut);
if (SUCCEEDED(ec)) {
CDataOutputStream::New(IOutputStream::Probe(mFileOut), (IDataOutput**)&mOutput);
}
else {
Logger::E(mTag, "Create file %s failed(ec = 0x%08x).", path.string(), ec);
}
return Started(testStr);
}
} // namespace Test
} // namespace Droid
} // namespace Elastos
| [
"chen.yunzhi@kortide.com"
] | chen.yunzhi@kortide.com |
87c98a9921ce02a503d02932d1cf8fecde59e37e | 1678793e3e3c119ff4479110d23fb58752c76540 | /src/runtime/eval/debugger/debugger_base.cpp | e929bc29aebba144500df316795fb712a0bad6da | [
"Zend-2.0",
"PHP-3.01"
] | permissive | param108/hiphop-php | bef29ed13f10d356ca4a74e03c6e197466597911 | ae8e479c249f2a7c52919f4153b45a914ff9325a | refs/heads/master | 2021-01-23T22:37:01.627128 | 2011-12-15T11:57:10 | 2011-12-15T11:57:10 | 775,162 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,020 | cpp | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include <runtime/eval/debugger/debugger_base.h>
#include <runtime/eval/debugger/debugger_client.h>
#include <runtime/eval/parser/scanner.h>
#include <runtime/eval/parser/parser.h>
#include <runtime/eval/debugger/break_point.h>
#include <util/util.h>
using namespace std;
namespace HPHP { namespace Eval {
///////////////////////////////////////////////////////////////////////////////
const std::string &DSandboxInfo::id() const {
if (m_cached_id.empty() && !m_user.empty()) {
m_cached_id = m_user + "\t" + m_name;
}
return m_cached_id;
}
const std::string DSandboxInfo::desc() const {
string ret = m_user + "'s " + m_name + " sandbox";
if (!m_path.empty()) {
ret += " at " + m_path;
}
return ret;
}
void DSandboxInfo::set(const std::string &id) {
m_cached_id.clear();
m_user.clear();
m_name.clear();
m_path.clear();
if (!id.empty()) {
vector<string> tokens;
Util::split('\t', id.c_str(), tokens);
if (tokens.size() == 2) {
m_user = tokens[0];
m_name = tokens[1];
}
}
}
void DSandboxInfo::update(const DSandboxInfo &src) {
if (!src.m_path.empty() && m_path.empty()) {
m_path = src.m_path;
}
}
void DSandboxInfo::sendImpl(ThriftBuffer &thrift) {
thrift.write(m_user);
thrift.write(m_name);
thrift.write(m_path);
}
void DSandboxInfo::recvImpl(ThriftBuffer &thrift) {
thrift.read(m_user);
thrift.read(m_name);
thrift.read(m_path);
}
///////////////////////////////////////////////////////////////////////////////
void DThreadInfo::sendImpl(ThriftBuffer &thrift) {
thrift.write(m_id);
thrift.write(m_desc);
thrift.write(m_type);
thrift.write(m_url);
}
void DThreadInfo::recvImpl(ThriftBuffer &thrift) {
thrift.read(m_id);
thrift.read(m_desc);
thrift.read(m_type);
thrift.read(m_url);
}
///////////////////////////////////////////////////////////////////////////////
void DFunctionInfo::sendImpl(ThriftBuffer &thrift) {
thrift.write(m_namespace);
thrift.write(m_class);
thrift.write(m_function);
}
void DFunctionInfo::recvImpl(ThriftBuffer &thrift) {
thrift.read(m_namespace);
thrift.read(m_class);
thrift.read(m_function);
}
std::string DFunctionInfo::site(std::string &preposition) const {
string ret;
preposition = "at ";
if (!m_class.empty()) {
if (!m_namespace.empty()) {
ret = m_namespace + "::";
}
ret += m_class;
if (!m_function.empty()) {
ret += "::" + m_function + "()";
} else {
ret = "class " + ret;
preposition = "in ";
}
} else {
if (!m_function.empty()) {
ret = m_function + "()";
if (!m_namespace.empty()) {
ret += " in namespace " + m_namespace;
}
} else if (!m_namespace.empty()) {
ret = "namespace " + m_namespace;
preposition = "in ";
}
}
return ret;
}
std::string DFunctionInfo::desc(const BreakPointInfo *bpi) const {
string ret;
if (!m_class.empty()) {
string cls;
if (!m_namespace.empty()) {
cls = bpi->regex(m_namespace) + "::";
}
cls += bpi->regex(m_class);
if (!m_function.empty()) {
ret += cls + "::" + bpi->regex(m_function) + "()";
} else {
ret += "any functions in class " + cls;
}
} else {
if (!m_function.empty()) {
ret += bpi->regex(m_function) + "()";
if (!m_namespace.empty()) {
ret += " in namespace " + bpi->regex(m_namespace);
}
} else {
ret += "any functions in namespace " + bpi->regex(m_namespace);
}
}
return ret;
}
///////////////////////////////////////////////////////////////////////////////
std::string Macro::desc(const char *indent) {
string ret;
for (unsigned int i = 0; i < m_cmds.size(); i++) {
if (indent) ret += indent;
ret += m_cmds[i];
ret += "\n";
}
return ret;
}
void Macro::load(Hdf node) {
m_name = node["name"].getString();
node["cmds"].get(m_cmds);
}
void Macro::save(Hdf node) {
node["name"] = m_name;
for (unsigned int i = 0; i < m_cmds.size(); i++) {
node["cmds"][i] = m_cmds[i];
}
}
///////////////////////////////////////////////////////////////////////////////
const char *PHP_KEYWORDS[] = {
"require_once",
"require",
"eval",
"include_once",
"include",
"print",
"instanceof",
"bool",
"object",
"string",
"double",
"int",
"clone",
"new",
"exit",
"if",
"elseif",
"else",
"endif",
"echo",
"do",
"while",
"endwhile",
"for",
"endfor",
"foreach",
"endforeach",
"declare",
"enddeclare",
"as",
"switch",
"endswitch",
"case",
"default",
"break",
"continue",
"function",
"const",
"return",
"try",
"catch",
"throw",
"use",
"global",
"public",
"protected",
"private",
"final",
"abstract",
"static",
"var",
"unset",
"isset",
"empty",
"halt_compiler",
"class",
"interface",
"extends",
"implements",
"list",
"array",
"__CLASS__",
"__METHOD__",
"__FUNCTION__",
"__LINE__",
"__FILE__",
"parent",
"self",
NULL
};
///////////////////////////////////////////////////////////////////////////////
#define COLOR_ENTRY(number, name, type) (char)(CodeColor ## type * 2)
static void get_color(int tokid, int prev, int next,
const char *&color, const char *&end,
const char **palette =
DebuggerClient::DefaultCodeColors) {
static const char code[] = {
COLOR_ENTRY(258, T_REQUIRE_ONCE, Keyword ),
COLOR_ENTRY(259, T_REQUIRE, Keyword ),
COLOR_ENTRY(260, T_EVAL, Keyword ),
COLOR_ENTRY(261, T_INCLUDE_ONCE, Keyword ),
COLOR_ENTRY(262, T_INCLUDE, Keyword ),
COLOR_ENTRY(263, T_LOGICAL_OR, Keyword ),
COLOR_ENTRY(264, T_LOGICAL_XOR, Keyword ),
COLOR_ENTRY(265, T_LOGICAL_AND, Keyword ),
COLOR_ENTRY(266, T_PRINT, Keyword ),
COLOR_ENTRY(267, T_SR_EQUAL, None ),
COLOR_ENTRY(268, T_SL_EQUAL, None ),
COLOR_ENTRY(269, T_XOR_EQUAL, None ),
COLOR_ENTRY(270, T_OR_EQUAL, None ),
COLOR_ENTRY(271, T_AND_EQUAL, None ),
COLOR_ENTRY(272, T_MOD_EQUAL, None ),
COLOR_ENTRY(273, T_CONCAT_EQUAL, None ),
COLOR_ENTRY(274, T_DIV_EQUAL, None ),
COLOR_ENTRY(275, T_MUL_EQUAL, None ),
COLOR_ENTRY(276, T_MINUS_EQUAL, None ),
COLOR_ENTRY(277, T_PLUS_EQUAL, None ),
COLOR_ENTRY(278, T_BOOLEAN_OR, None ),
COLOR_ENTRY(279, T_BOOLEAN_AND, None ),
COLOR_ENTRY(280, T_IS_NOT_IDENTICAL, None ),
COLOR_ENTRY(281, T_IS_IDENTICAL, None ),
COLOR_ENTRY(282, T_IS_NOT_EQUAL, None ),
COLOR_ENTRY(283, T_IS_EQUAL, None ),
COLOR_ENTRY(284, T_IS_GREATER_OR_EQUAL, None ),
COLOR_ENTRY(285, T_IS_SMALLER_OR_EQUAL, None ),
COLOR_ENTRY(286, T_SR, None ),
COLOR_ENTRY(287, T_SL, None ),
COLOR_ENTRY(288, T_INSTANCEOF, Keyword ),
COLOR_ENTRY(289, T_UNSET_CAST, Keyword ),
COLOR_ENTRY(290, T_BOOL_CAST, Keyword ),
COLOR_ENTRY(291, T_OBJECT_CAST, Keyword ),
COLOR_ENTRY(292, T_ARRAY_CAST, Keyword ),
COLOR_ENTRY(293, T_STRING_CAST, Keyword ),
COLOR_ENTRY(294, T_DOUBLE_CAST, Keyword ),
COLOR_ENTRY(295, T_INT_CAST, Keyword ),
COLOR_ENTRY(296, T_DEC, None ),
COLOR_ENTRY(297, T_INC, None ),
COLOR_ENTRY(298, T_CLONE, Keyword ),
COLOR_ENTRY(299, T_NEW, Keyword ),
COLOR_ENTRY(300, T_EXIT, Keyword ),
COLOR_ENTRY(301, T_IF, Keyword ),
COLOR_ENTRY(302, T_ELSEIF, Keyword ),
COLOR_ENTRY(303, T_ELSE, Keyword ),
COLOR_ENTRY(304, T_ENDIF, Keyword ),
COLOR_ENTRY(305, T_LNUMBER, None ),
COLOR_ENTRY(306, T_DNUMBER, None ),
COLOR_ENTRY(307, T_STRING, None ),
COLOR_ENTRY(308, T_STRING_VARNAME, Variable ),
COLOR_ENTRY(309, T_VARIABLE, Variable ),
COLOR_ENTRY(310, T_NUM_STRING, None ),
COLOR_ENTRY(311, T_INLINE_HTML, Html ),
COLOR_ENTRY(312, T_CHARACTER, Keyword ),
COLOR_ENTRY(313, T_BAD_CHARACTER, Keyword ),
COLOR_ENTRY(314, T_ENCAPSED_AND_WHITESPACE, String ),
COLOR_ENTRY(315, T_CONSTANT_ENCAPSED_STRING, String ),
COLOR_ENTRY(316, T_ECHO, Keyword ),
COLOR_ENTRY(317, T_DO, Keyword ),
COLOR_ENTRY(318, T_WHILE, Keyword ),
COLOR_ENTRY(319, T_ENDWHILE, Keyword ),
COLOR_ENTRY(320, T_FOR, Keyword ),
COLOR_ENTRY(321, T_ENDFOR, Keyword ),
COLOR_ENTRY(322, T_FOREACH, Keyword ),
COLOR_ENTRY(323, T_ENDFOREACH, Keyword ),
COLOR_ENTRY(324, T_DECLARE, Keyword ),
COLOR_ENTRY(325, T_ENDDECLARE, Keyword ),
COLOR_ENTRY(326, T_AS, Keyword ),
COLOR_ENTRY(327, T_SWITCH, Keyword ),
COLOR_ENTRY(328, T_ENDSWITCH, Keyword ),
COLOR_ENTRY(329, T_CASE, Keyword ),
COLOR_ENTRY(330, T_DEFAULT, Keyword ),
COLOR_ENTRY(331, T_BREAK, Keyword ),
COLOR_ENTRY(332, T_CONTINUE, Keyword ),
COLOR_ENTRY(333, T_FUNCTION, Keyword ),
COLOR_ENTRY(334, T_CONST, Keyword ),
COLOR_ENTRY(335, T_RETURN, Keyword ),
COLOR_ENTRY(336, T_TRY, Keyword ),
COLOR_ENTRY(337, T_CATCH, Keyword ),
COLOR_ENTRY(338, T_THROW, Keyword ),
COLOR_ENTRY(339, T_USE, Keyword ),
COLOR_ENTRY(340, T_GLOBAL, Keyword ),
COLOR_ENTRY(341, T_PUBLIC, Keyword ),
COLOR_ENTRY(342, T_PROTECTED, Keyword ),
COLOR_ENTRY(343, T_PRIVATE, Keyword ),
COLOR_ENTRY(344, T_FINAL, Keyword ),
COLOR_ENTRY(345, T_ABSTRACT, Keyword ),
COLOR_ENTRY(346, T_STATIC, Keyword ),
COLOR_ENTRY(347, T_VAR, Keyword ),
COLOR_ENTRY(348, T_UNSET, Keyword ),
COLOR_ENTRY(349, T_ISSET, Keyword ),
COLOR_ENTRY(350, T_EMPTY, Keyword ),
COLOR_ENTRY(351, T_HALT_COMPILER, Keyword ),
COLOR_ENTRY(352, T_CLASS, Keyword ),
COLOR_ENTRY(353, T_INTERFACE, Keyword ),
COLOR_ENTRY(354, T_EXTENDS, Keyword ),
COLOR_ENTRY(355, T_IMPLEMENTS, Keyword ),
COLOR_ENTRY(356, T_OBJECT_OPERATOR, None ),
COLOR_ENTRY(357, T_DOUBLE_ARROW, None ),
COLOR_ENTRY(358, T_LIST, Keyword ),
COLOR_ENTRY(359, T_ARRAY, Keyword ),
COLOR_ENTRY(360, T_CLASS_C, Constant ),
COLOR_ENTRY(361, T_METHOD_C, Constant ),
COLOR_ENTRY(362, T_FUNC_C, Constant ),
COLOR_ENTRY(363, T_LINE, Constant ),
COLOR_ENTRY(364, T_FILE, Constant ),
COLOR_ENTRY(365, T_COMMENT, Comment ),
COLOR_ENTRY(366, T_DOC_COMMENT, Comment ),
COLOR_ENTRY(367, T_OPEN_TAG, Tag ),
COLOR_ENTRY(368, T_OPEN_TAG_WITH_ECHO, Tag ),
COLOR_ENTRY(369, T_CLOSE_TAG, Tag ),
COLOR_ENTRY(370, T_WHITESPACE, None ),
COLOR_ENTRY(371, T_START_HEREDOC, Keyword ),
COLOR_ENTRY(372, T_END_HEREDOC, Keyword ),
COLOR_ENTRY(373, T_DOLLAR_OPEN_CURLY_BRACES, None ),
COLOR_ENTRY(374, T_CURLY_OPEN, None ),
COLOR_ENTRY(375, T_PAAMAYIM_NEKUDOTAYIM, None ),
};
if (tokid == 307 /* T_STRING */) {
int type = CodeColorConstant;
if (prev == '$') {
type = CodeColorVariable;
} else if (prev == 333 /* T_FUNCTION */ ||
prev == 352 /* T_CLASS */ ||
prev == 353 /* T_INTERFACE */) {
type = CodeColorDeclaration;
} else if (next == '(') {
type = CodeColorNone;
}
color = palette[type * 2];
end = palette[type * 2 + 1];
} else if (tokid >= 258 && tokid <= 375) {
tokid -= 258;
char c = code[tokid];
color = palette[(int)c];
end = palette[(int)(c+1)];
} else {
color = end = NULL;
}
}
static void color_line_no(StringBuffer &sb, int line, int lineFocus0,
int lineFocus1, const char *color) {
if (((line == lineFocus0 && lineFocus1 == 0) ||
(line >= lineFocus0 && line <= lineFocus1)) &&
DebuggerClient::HighlightBgColor) {
sb.append(Util::add_bgcolor(DebuggerClient::HighlightForeColor,
DebuggerClient::HighlightBgColor));
} else {
sb.append(color);
}
}
static void append_line_no(StringBuffer &sb, const char *text,
int &line, const char *color, const char *end,
int lineFocus0, int charFocus0, int lineFocus1,
int charFocus1, const char **palette =
DebuggerClient::DefaultCodeColors) {
const char *colorLineNo = palette[CodeColorLineNo * 2];
const char *endLineNo = palette[CodeColorLineNo * 2 + 1];
// beginning
if (line && sb.empty()) {
if (colorLineNo) color_line_no(sb, line, lineFocus0, lineFocus1,
colorLineNo);
sb.printf(DebuggerClient::LineNoFormat, line);
if (endLineNo) sb.append(endLineNo);
}
// ending
if (text == NULL) {
if (line) {
if (colorLineNo) color_line_no(sb, line, lineFocus0, lineFocus1,
colorLineNo);
sb.append("(END)\n");
if (endLineNo) sb.append(endLineNo);
}
return;
}
if (color) sb.append(color);
if (line == 0) {
sb.append(text);
} else {
const char *begin = text;
const char *p = begin;
for (; *p; p++) {
if (*p == '\n') {
++line;
sb.append(begin, p - begin);
sb.append(ANSI_COLOR_END);
sb.append('\n');
if (colorLineNo) color_line_no(sb, line, lineFocus0, lineFocus1,
colorLineNo);
sb.printf(DebuggerClient::LineNoFormat, line);
if (endLineNo) sb.append(endLineNo);
if (color) sb.append(color);
begin = p + 1;
}
}
if (p - begin > 0) {
sb.append(begin, p - begin);
}
}
if (end) sb.append(end);
}
String highlight_code(CStrRef source, int line /* = 0 */,
int lineFocus0 /* = 0 */, int charFocus0 /* = 0 */,
int lineFocus1 /* = 0 */, int charFocus1 /* = 0 */) {
String prepended = "<?php\n";
prepended += source;
String highlighted = highlight_php(prepended, line, lineFocus0, charFocus0,
lineFocus1, charFocus1);
int pos = highlighted.find("\n");
return highlighted.substr(pos + 1);
}
string check_char_highlight(int lineFocus0, int charFocus0,
int lineFocus1, int charFocus1,
ylmm::basic_location loc) {
if (DebuggerClient::HighlightBgColor &&
lineFocus0 && charFocus0 && lineFocus1 && charFocus1 &&
loc.first_line() * 1000 + loc.first_column()
>= lineFocus0 * 1000 + charFocus0 &&
loc.last_line() * 1000 + loc.last_column()
<= lineFocus1 * 1000 + charFocus1) {
return Util::add_bgcolor(DebuggerClient::HighlightForeColor,
DebuggerClient::HighlightBgColor);
}
return "";
}
String highlight_php(CStrRef source, int line /* = 0 */,
int lineFocus0 /* = 0 */, int charFocus0 /* = 0 */,
int lineFocus1 /* = 0 */, int charFocus1 /* = 0 */) {
Lock lock(Eval::Parser::s_lock);
const char *input = source.data();
istringstream iss(input);
StringBuffer res;
Eval::Scanner scanner(new ylmm::basic_buffer(iss, false, true),
true, false, true);
Eval::Token tok1, tok2;
std::vector<pair<int, string> > ahead_tokens;
ylmm::basic_location loc1, loc2;
const char *colorComment = NULL, *endComment = NULL;
get_color(365 /* T_COMMENT */, 0, 0, colorComment, endComment);
int prev = 0;
int tokid = scanner.getNextToken(tok1, loc1);
int next = 0;
while (tokid) {
// look ahead
next = scanner.getNextToken(tok2, loc2);
while (next == 370 /* T_WHITESPACE */ ||
next == 365 /* T_COMMENT */ ||
next == 366 /* T_DOC_COMMENT */) {
string text = tok2.getText();
string hcolor = check_char_highlight(lineFocus0, charFocus0,
lineFocus1, charFocus1, loc2);
if (!hcolor.empty()) {
text = hcolor + text + ANSI_COLOR_END;
}
ahead_tokens.push_back(pair<int, string>(next, text));
next = scanner.getNextToken(tok2, loc2);
}
string hcolor = check_char_highlight(lineFocus0, charFocus0,
lineFocus1, charFocus1, loc1);
if (tokid < 256) {
if (!hcolor.empty()) {
res.append(hcolor);
res.append((char)tokid);
res.append(ANSI_COLOR_END);
} else {
res.append((char)tokid);
}
} else {
const char *color = NULL, *end = NULL;
get_color(tokid, prev, next, color, end);
if (!hcolor.empty()) {
color = hcolor.c_str();
end = ANSI_COLOR_END;
}
const std::string &text = tok1.getText();
int offset = 0;
if (text[0] == '$') {
if (!hcolor.empty()) {
res.append(hcolor);
res.append('$');
res.append(ANSI_COLOR_END);
} else {
res.append('$');
}
offset = 1;
}
append_line_no(res, text.c_str() + offset, line, color, end,
lineFocus0, charFocus0, lineFocus1, charFocus1);
}
if (!ahead_tokens.empty()) {
for (unsigned int i = 0; i < ahead_tokens.size(); i++) {
bool comment = ahead_tokens[i].first != 370 /* T_WHITESPACE */;
append_line_no(res, ahead_tokens[i].second.c_str(), line,
comment ? colorComment : NULL,
comment ? endComment : NULL,
lineFocus0, charFocus0, lineFocus1, charFocus1);
}
ahead_tokens.clear();
}
if (!(tokid == 370 /* T_WHITESPACE */ ||
tokid == 365 /* T_COMMENT */ ||
tokid == 366 /* T_DOC_COMMENT */)) {
prev = tokid;
}
tok1 = tok2;
loc1 = loc2;
tokid = next;
}
append_line_no(res, NULL, line, NULL, NULL,
lineFocus0, charFocus0, lineFocus1, charFocus1);
return res.detach();
}
///////////////////////////////////////////////////////////////////////////////
}}
| [
"macvicar@facebook.com"
] | macvicar@facebook.com |
1d4d75b10ac1d0e8b4ac4f9b90df9467fc7e8589 | 16b0d7683396e0d1d5cffa228e7f823b91d91a31 | /lib/usd/translators/mayaReferenceUpdater.h | b2c4717c9c15e9ca1402250cd5bf4e7d02ac7864 | [
"DOC"
] | permissive | sshanmanian/maya-usd | 8700ac8be0b768c657d7fcbc8a18251ce78cc566 | 41409295ec063d4f72d49cd6894f03595fa8abc2 | refs/heads/master | 2022-07-28T09:49:28.717782 | 2020-03-20T14:45:54 | 2020-03-20T14:45:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,340 | h | //
// Copyright 2016 Pixar
//
// 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 PXRUSDTRANSLATORS_MAYAREFERENCE_UPDATER_H
#define PXRUSDTRANSLATORS_MAYAREFERENCE_UPDATER_H
/// \file pxrUsdTranslators/mayaReferenceUpdater.h
#include "pxr/pxr.h"
#include "../../fileio/primUpdater.h"
#include <maya/MFnDependencyNode.h>
PXR_NAMESPACE_OPEN_SCOPE
class SdfPath;
/// Exports Maya cameras to UsdGeomCamera.
class PxrUsdTranslators_MayaReferenceUpdater : public UsdMayaPrimUpdater
{
public:
PxrUsdTranslators_MayaReferenceUpdater(
const MFnDependencyNode& depNodeFn,
const SdfPath& usdPath);
bool Pull(UsdMayaPrimUpdaterContext* context) override;
void Clear(UsdMayaPrimUpdaterContext* context) override;
protected:
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| [
"krystian.ligenza@autodesk.com"
] | krystian.ligenza@autodesk.com |
870c513c5f542ca80c69ee7ef4885899eaa0480e | a8adbc872e4638ce3e210eb8ef0fe372418c1bba | /fmt.cc | bc068bc8520cc61685fbcd5dda2065447505d143 | [
"MIT"
] | permissive | Novynn/libfmt-php | 43415818aadf6d9a70b5d1a4b78000d36472a59c | 77a0654990950b3440601666cd89f8919ea6cf28 | refs/heads/master | 2022-12-19T12:57:59.062883 | 2020-09-25T03:52:19 | 2020-09-25T03:52:19 | 297,524,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,024 | cc | #ifdef HAVE_CONFIG_H
#include "config.h"
#endif
extern "C" {
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_fmt.h"
#include "fmt_arginfo.h"
#include "ext/spl/spl_exceptions.h"
}
#define FMT_HEADER_ONLY
#include "fmt/format.h"
PHP_MINIT_FUNCTION(fmt)
{
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(fmt)
{
return SUCCESS;
}
PHP_MINFO_FUNCTION(fmt)
{
php_info_print_table_start();
php_info_print_table_header(2, "fmt support", "enabled");
php_info_print_table_end();
}
PHP_FUNCTION(fmt)
{
char* format = nullptr;
size_t format_length = 0;
zval *args = nullptr;
int argc = 0;
ZEND_PARSE_PARAMETERS_START(1, -1)
Z_PARAM_STRING(format, format_length)
Z_PARAM_VARIADIC('*', args, argc)
ZEND_PARSE_PARAMETERS_END();
fmt::dynamic_format_arg_store<fmt::format_context> store;
std::vector<std::shared_ptr<zend_string>> tmp_str_list;
for (int i = 0; i < argc; ++i)
{
zval* tmp = &args[i];
loop:
ZVAL_DEREF(tmp);
switch (Z_TYPE_P(tmp)) {
case IS_UNDEF:
case IS_NULL:
store.push_back("");
case IS_FALSE:
store.push_back(false);
case IS_TRUE:
store.push_back(true);
case IS_LONG:
store.push_back(Z_LVAL_P(tmp));
break;
case IS_DOUBLE:
store.push_back(Z_DVAL_P(tmp));
break;
case IS_STRING:
store.push_back(Z_STRVAL_P(tmp));
break;
case IS_ARRAY:
store.push_back("array");
break;
case IS_OBJECT: {
// NOTE(rory): Resolve object to a string
std::shared_ptr<zend_string> tmp_str(_zval_get_string_func(tmp), [](zend_string* s) {
zend_string_release(s);
});
store.push_back(ZSTR_VAL(tmp_str));
tmp_str_list.push_back(tmp_str);
}
break;
case IS_RESOURCE:
store.push_back("resource");
break;
case IS_REFERENCE:
goto loop;
break;
default:
store.push_back("unknown");
break;
}
}
try {
std::string result = fmt::vformat(format, store);
RETURN_STRING(result.c_str());
} catch (const fmt::format_error& ex) {
zend_throw_error(spl_ce_InvalidArgumentException, ex.what());
return;
}
}
static const zend_module_dep fmt_deps[] = {
ZEND_MOD_REQUIRED("spl")
ZEND_MOD_END
};
zend_module_entry fmt_module_entry = {
STANDARD_MODULE_HEADER_EX,
NULL,
fmt_deps,
"fmt",
ext_functions,
PHP_MINIT(fmt),
PHP_MSHUTDOWN(fmt),
NULL,
NULL,
PHP_MINFO(fmt),
PHP_FMT_VERSION,
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_FMT
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_GET_MODULE(fmt)
#endif
| [
"roryv@grindinggear.com"
] | roryv@grindinggear.com |
966919e77010fc943265a5ec102b70715471610b | 10d5cf32719829f75bb45f4e0396e35a760818a3 | /algorithms/imported/ufndmq4.cpp | 9505b88d3d7befab9902ce0aa7708eed63c4576f | [] | no_license | vireninterviewkit/PatternMatchingAlgorithmsTester | 2a73cfdd66cf71188f4dbd49dae02e707aba3661 | 2b04aeed9d3d651dea0f8181e052c6327fa1cc4c | refs/heads/master | 2023-02-24T22:46:51.622868 | 2021-02-04T11:59:53 | 2021-02-04T11:59:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,869 | cpp | /*
* SMART: string matching algorithms research tool.
* Copyright (C) 2012 Simone Faro and Thierry Lecroq
*
* 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 3 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, see <http://www.gnu.org/licenses/>
*
* contact the authors at: faro@dmi.unict.it, thierry.lecroq@univ-rouen.fr
* download the tool at: http://www.dmi.unict.it/~faro/smart/
*
* This is an implementation of the Shift Or with q-grams algorithm
* in B. Durian and J. Holub and H. Peltola and J. Tarhio.
* Tuning BNDM with q-Grams. Proceedings of the Workshop on Algorithm Engineering and Experiments,
* ALENEX 2009, pp.29--37, SIAM, New York, New York, USA, (2009).
*/
#include "algorithms/consts.h"
#include "include/main.h"
#define GRAM4(i) ( (B[y[i-3]]<<3) | (B[y[i-2]]<<2) | (B[y[i-1]]<<1) | B[y[i]] )
int search_large_ufndmq4(unsigned char *x, int m, unsigned char *y, int n);
int search_ufndmq4(unsigned char *x, int m, unsigned char *y, int n) {
unsigned int D, F, mm, mask, B[MAX_SIGMA], S;
int i, j, k, mq, q;
int count = 0;
q = 4;
if(m<q) return -1;
if(m+q > WORD) return search_large_ufndmq4(x,m,y,n);
/* Preprocessing */
S = ~((unsigned char)7 << m);
for (j = 0; j < SIGMA; ++j) B[j] = S;
for (j = 0; j < m; ++j) B[x[j]] &= ~((unsigned char)1<<j);
for (i=0; i<m; i++) y[n+i]=y[n+m+i]=x[i];
mm = (unsigned char)1 << (m+q-2);
mask = ((unsigned char)1 << (m-1)) - 1;
mq = m+q-1;
/* Searching */
if( !memcmp(x,y,m) ) OUTPUT(0);
i = 0;
D = ~0;
while (1) {
while ( (D|7) == ~0 ) {
i += m;
D = (D<<m) | GRAM4(i);
}
if (F=~(D|mask)) {
for (k=i-mq+1; F; F<<=1, k++)
if (F >= mm) {
for (j=0; j<m; j++)
if (y[k+j]!=x[j]) goto mismatch;
if (k+m > n) return(count);
OUTPUT(k);
mismatch:
F -= mm;
}
}
i += q;
D = (D<<q) | GRAM4(i);
}
abort();
}
/*
* Shift Or with q-grams algorithm designed for large patterns
* The present implementation searches for prefixes of the pattern of length 32.
* When an occurrence is found the algorithm tests for the whole occurrence of the pattern
*/
int search_large_ufndmq4(unsigned char *x, int m, unsigned char *y, int n)
{
unsigned int D, F, mm, mask, B[MAX_SIGMA], S;
int i, j, k, mq, q, p_len;
int count = 0;
q = 4;
if (m<q) return 0;
for (i=0; i<m; i++) y[n+i]=y[n+m+i]=x[i];
p_len = m;
m = 32-q;
/* Preprocessing */
S = ~((unsigned char)7 << m);
for (j = 0; j < SIGMA; ++j) B[j] = S;
for (j = 0; j < m; ++j) B[x[j]] &= ~((unsigned char)1<<j);
mm = (unsigned char)1 << (m+q-2);
mask = ((unsigned char)1 << (m-1)) - 1;
mq = m+q-1;
/* Searching */
if( !memcmp(x,y,p_len) ) OUTPUT(0);
i = 0;
D = ~0;
while (1) {
while ( (D|7) == ~0 ) {
i += m;
D = (D<<m) | GRAM4(i);
}
if (F=~(D|mask)) {
for (k=i-mq+1; F; F<<=1, k++)
if (F >= mm) {
for (j=0; j<p_len; j++)
if (y[k+j]!=x[j]) goto mismatch;
if (k+m > n) return(count);
OUTPUT(k);
mismatch:
F -= mm;
}
}
i += q;
D = (D<<q) | GRAM4(i);
}
abort();
}
| [
"toha1806@gmail.com"
] | toha1806@gmail.com |
e5a26d98ae5bf69404c581a4c5fff7569e931631 | eb3353df54552b26169a66a3332bac727f70a2a8 | /从零开始学C++程序设计/chap12类的高级应用/chap12section01e02.cpp | 4ccd675077778f3ec15d17a22a90fb359e79c8b4 | [] | no_license | wolflion/Code2019 | 9f7f981f7ddc3e32ebdd70e4071fca8b88397de7 | a514a2cea5363ef9407f28fe9ec77f3ed48bf281 | refs/heads/master | 2021-06-22T23:31:39.012937 | 2020-12-11T15:08:26 | 2020-12-11T15:08:26 | 165,491,640 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 729 | cpp | //12-1-2友元函数
#include <iostream>
#include <cstdlib>
using namespace std;
class Student
{
friend float add_score(Student); // 友元函数不是类中的成员,可以在类内部任意位置声明,通常置于首行
public:
Student(int id, float E, float M) :StuID(id), Score_E(E), Score_M(M)
{
Score_T = Score_M + Score_E;
cout << "学生学号:" << StuID << "" << endl;
cout << "总分是" << Score_T << "分" << endl;
}
private:
int StuID;
float Score_E, Score_M, Score_T;
};
float add_score(Student a)
{
a.Score_T += 30;
return a.Score_T;
}
int main()
{
Student stud1(920101, 80, 90);
cout << "加30分后,总分为:" << add_score(stud1) << "分" << endl;
system("pause");
return 0;
} | [
"successwolf@163.com"
] | successwolf@163.com |
c4dabf7b61e25dac4e5ae6fad86d7a943498d35d | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/base/wmi/bmoflocparser/dllvars.h | 6cf4fe560b19e1260c5ab6b28cee97c6c7676a07 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,048 | h | //-----------------------------------------------------------------------------
//
// File: dllvars.h
//
// Global variables and functions for the parser DLL
//
// Copyright (c) 1995 - 1997, Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
#ifndef __DLLVARS_H
#define __DLLVARS_H
void IncrementClassCount(void);
void DecrementClassCount(void);
void ReportException(CException* pExcep, C32File* p32File, CLocItem* pItem, //May be null
CReporter* pReporter);
void ThrowItemSetException();
class CItemSetException : public CException
{
DECLARE_DYNAMIC(CItemSetException)
public:
// Constructors
CItemSetException();
CItemSetException(BOOL bAutoDelete);
// Operations
virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError,
PUINT pnHelpContext = NULL);
protected:
CLString m_strMsg;
};
#ifdef __DLLENTRY_CPP
#define __DLLENTRY_EXTERN
#else
#define __DLLENTRY_EXTERN extern
#endif
__DLLENTRY_EXTERN HMODULE g_hDll;
#endif //__DLLVARS_H
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
6029771b9c3d2f65c57f75c124f4ebb9d6e1e1d3 | eda56d3f769d10adfe885ade53e3eb73ca20e831 | /ngui/property.h | 6b8672e8ee2a99bde5c9b859718d15f93a08b024 | [
"BSD-3-Clause"
] | permissive | jfms/ngui | 19a677c581c409023c777230813ceb0be78b2664 | eca7073e9e84ce454eef816fbb139134985969b4 | refs/heads/master | 2021-09-09T08:40:18.021690 | 2018-03-14T12:15:06 | 2018-03-14T12:15:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,237 | h | /* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2015, xuewen.chu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of xuewen.chu nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL xuewen.chu BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __ngui__property__
#define __ngui__property__
#include "base/util.h"
#include "base/map.h"
XX_NS(ngui)
class View;
#define XX_EACH_PROPERTY_TABLE(F) \
F(PROPERTY_X, float, x) /*view*/ \
F(PROPERTY_Y, float, y) \
F(PROPERTY_SCALE_X, float, scale_x) \
F(PROPERTY_SCALE_Y, float, scale_y) \
F(PROPERTY_SKEW_X, float, skew_x) \
F(PROPERTY_SKEW_Y, float, skew_y) \
F(PROPERTY_ROTATE_Z, float, rotate_z) \
F(PROPERTY_ORIGIN_X, float, origin_x) \
F(PROPERTY_ORIGIN_Y, float, origin_y) \
F(PROPERTY_OPACITY, float, opacity) \
F(PROPERTY_VISIBLE, bool, visible) \
F(PROPERTY_WIDTH, Value, width) /* box / Value */ \
F(PROPERTY_HEIGHT, Value, height) /* Value */ \
F(PROPERTY_MARGIN_LEFT, Value, margin_left) \
F(PROPERTY_MARGIN_TOP, Value, margin_top) \
F(PROPERTY_MARGIN_RIGHT, Value, margin_right) \
F(PROPERTY_MARGIN_BOTTOM, Value, margin_bottom) \
F(PROPERTY_BORDER_LEFT, Border, border_left) \
F(PROPERTY_BORDER_TOP, Border, border_top) \
F(PROPERTY_BORDER_RIGHT, Border, border_right) \
F(PROPERTY_BORDER_BOTTOM, Border, border_bottom) \
F(PROPERTY_BORDER_LEFT_WIDTH, float, border_left_width) \
F(PROPERTY_BORDER_TOP_WIDTH, float, border_top_width) \
F(PROPERTY_BORDER_RIGHT_WIDTH, float, border_right_width) \
F(PROPERTY_BORDER_BOTTOM_WIDTH, float, border_bottom_width) \
F(PROPERTY_BORDER_LEFT_COLOR, Color, border_left_color) \
F(PROPERTY_BORDER_TOP_COLOR, Color, border_top_color) \
F(PROPERTY_BORDER_RIGHT_COLOR, Color, border_right_color) \
F(PROPERTY_BORDER_BOTTOM_COLOR, Color, border_bottom_color) \
F(PROPERTY_BORDER_RADIUS_LEFT_TOP, float, border_radius_left_top) \
F(PROPERTY_BORDER_RADIUS_RIGHT_TOP, float, border_radius_right_top) \
F(PROPERTY_BORDER_RADIUS_RIGHT_BOTTOM, float, border_radius_right_bottom) \
F(PROPERTY_BORDER_RADIUS_LEFT_BOTTOM, float, border_radius_left_bottom) \
F(PROPERTY_BACKGROUND_COLOR, Color, background_color) \
F(PROPERTY_NEWLINE, bool, newline) \
F(PROPERTY_CONTENT_ALIGN, ContentAlign, content_align) /* div*/ \
F(PROPERTY_TEXT_ALIGN, TextAlign, text_align) /* text / label */ \
F(PROPERTY_MAX_WIDTH, Value, max_width) /* limit-div / limit-text / limit-indep */ \
F(PROPERTY_MAX_HEIGHT, Value, max_height) \
F(PROPERTY_WIDTH2, float, width2) /* sprite // float value */ \
F(PROPERTY_HEIGHT2, float, height2) /* float value */ \
F(PROPERTY_START_X, float, start_x) \
F(PROPERTY_START_Y, float, start_y) \
F(PROPERTY_RATIO_X, float, ratio_x) \
F(PROPERTY_RATIO_Y, float, ratio_y) \
F(PROPERTY_REPEAT, Repeat, repeat) \
F(PROPERTY_TEXT_BACKGROUND_COLOR, TextColor, text_background_color) /* text-font */ \
F(PROPERTY_TEXT_COLOR, TextColor, text_color) \
F(PROPERTY_TEXT_SIZE, TextSize, text_size) \
F(PROPERTY_TEXT_STYLE, TextStyle, text_style) \
F(PROPERTY_TEXT_FAMILY, TextFamily, text_family) \
F(PROPERTY_TEXT_LINE_HEIGHT, TextLineHeight, text_line_height) \
F(PROPERTY_TEXT_SHADOW, TextShadow, text_shadow) \
F(PROPERTY_TEXT_DECORATION, TextDecoration, text_decoration) \
F(PROPERTY_TEXT_OVERFLOW, TextOverflow, text_overflow) \
F(PROPERTY_TEXT_WHITE_SPACE, TextWhiteSpace, text_white_space) \
F(PROPERTY_ALIGN_X, Align, align_x) /* free-div */ \
F(PROPERTY_ALIGN_Y, Align, align_y) \
F(PROPERTY_SHADOW, Shadow, shadow) /* shadow-div */ \
F(PROPERTY_SRC, String, src) /* image */ \
F(PROPERTY_BACKGROUND_IMAGE, String, background_image) \
/**
* @func PropertyName
*/
enum PropertyName: uint {
#define xx_def_enum(ENUM, TYPE, NAME) ENUM,
XX_EACH_PROPERTY_TABLE(xx_def_enum)
#undef xx_def_enum
};
template<> inline uint
Compare<PropertyName>::hash(const PropertyName& key) {
return key;
}
template<> inline bool
Compare<PropertyName>::equals(const PropertyName& a,
const PropertyName& b, uint ha, uint hb) {
return a == b;
}
/**
* @class PropertysAccessor
*/
class XX_EXPORT PropertysAccessor: public Object {
public:
typedef void (View::*Func)();
typedef int ViewType;
struct XX_EXPORT Accessor {
inline Accessor(): get_accessor(nullptr), set_accessor(nullptr) { }
template<typename T, typename T2>
inline Accessor(T get, T2 set)
: get_accessor(Func(get)), set_accessor(Func(set)) { }
Func get_accessor;
Func set_accessor;
};
PropertysAccessor();
/**
* @func accessor
*/
Accessor accessor(ViewType type, PropertyName name);
/**
* @func has_accessor
*/
bool has_accessor(ViewType type, PropertyName name);
/**
* @func shared
*/
static PropertysAccessor* shared();
private:
Map<ViewType, Map<PropertyName, Accessor>> m_property_func_table;
};
XX_END
#endif
| [
"louistru@hotmail.com"
] | louistru@hotmail.com |
c22ab04cc503bb99a90e499e5874fa9f3f9a2ae0 | 5d22e1e62ae305110741d3ebef739a0c0da344b1 | /headerFiles/FrogBase.h | 72058b39e10291aa61232a45c9b8c997a0cb2725 | [] | no_license | dannywong1997/FroggerClone | e0cb75b3722f1963fa305279a6dfc00b1d5627b3 | 47d5564ee9e5684da3b5b36e163bd136e17bb146 | refs/heads/master | 2021-04-06T01:08:58.083332 | 2018-03-11T23:11:08 | 2018-03-11T23:11:08 | 124,807,689 | 0 | 0 | null | 2018-03-11T23:10:36 | 2018-03-11T23:00:52 | null | UTF-8 | C++ | false | false | 406 | h | #pragma once
#include <SFML\Graphics.hpp>
class FrogBase : public sf::RectangleShape
{
public:
FrogBase();
~FrogBase();
bool checkIntersect(sf::RectangleShape Shape);
bool isFrogBaseAvailable();
void setFrogBaseAvailable(bool TF);
void LoadTexture();
void ResetTexture();
void setTextureToFrogOnTop();
private:
bool bFrogBaseAvailableForFrog;
sf::Texture textuFrogBase, textuLilyPadWithFrog;
};
| [
"dannywong1997@gmail.com"
] | dannywong1997@gmail.com |
9d2256518876bbb8c2c4f3ee6aa881d0643f8899 | e3813f8d1048f5f7764d306770d716d95b5c57fa | /58_C++/58_C++/10_18.cpp | 1a57694c4d269f19cfba7d5280afcc0656d33b4b | [] | no_license | sh2268411762/-C-_SYL | ea2194d8630ea4cc3776edfd2b1b4842140dbffd | 8dd86b25de74418bae2d6ab14adbacdeae0ebec8 | refs/heads/master | 2023-02-21T09:58:58.733099 | 2021-01-28T15:39:05 | 2021-01-28T15:39:05 | 297,322,054 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,543 | cpp | //#include <iostream>
//#include <string>
//using namespace std;
//
////统计该类创建了多少个变量
//class Date
//{
//public:
// Date(int _year = 1900, int _month = 1, int _day =1) // 多参数构造函数
// :year(_year)
// , month(_month)
// , day(_day)
// {
// count++;
//// cout << "Date(int,int,int):" << this << endl;
// }
//
// Date(const Date& d) // 拷贝构造函数
// :year(d.year)
// , month(d.month)
// , day(d.day)
// {
// count++;
// cout << "Date(const Date& d):" << this << endl;
// }
//
//
// void printDate()
// {
// cout << this->year << "," << this->month << "," << this->day << endl;
// }
//
// ~Date() // 析构函数
// {
// count--;
//// cout << "析构函数,不能重载,无参,无返回值" << this << endl;
// }
//
//
// Date& operator=(const Date& d)
// {
// cout << this << "=" << &d << endl;
// if (this != &d)
// {
// year = d.year;
// month = d.month;
// day = d.day;
// }
// return *this;
// }
//
//
//
// int year;
// int month;
// int day;
// static int count;
//};
//
//ostream& operator<<(ostream& _cout, const Date& d)
//{
// _cout << d.year << "," << d.month << "," << d.day;
// return _cout;
//}
//int Date::count = 0;
//int main()
//{
// Date d1(2020, 10, 18);
// d1.printDate();
// cout << d1;
// cout << d1 << "\t" << 10 << endl;
//
// //Date d2(d1);
// //d1.printDate();
// //d2.printDate();
// //cout << sizeof(d1) << endl; //12
// return 0;
//}
//
//
//
//
//#if 0
//class Date1
//{
//public:
// int year;
// int month;
// int day;
//
// explicit Date1(int _year = 1900)
// :year(_year)
// , month(1)
// , day(1)
// {
//
// }
//
// void printDate1()
// {
// cout << this->year << "," << this->month << "," << this->year << endl;
// }
//};
//
//int main()
//{
// Date1 d(2020);
// d.printDate1();
// return 0;
//}
//#endif
//
//
//# if 0
//class Time
//{
//public:
// Time(int _hour = 0, int _minute = 0, int _second = 0)
// :hours(_hour)
// ,minute(_minute)
// ,second(_second)
// {
//
// }
//
// int hours;
// int minute;
// int second;
//};
//class Date
//{
//public:
// Date(int _year, int _month, int _day) // 多参数构造函数
// :year(_year)
// , month(_month)
// , day(_day)
// {
// cout << "Date(int,int,int):" << this << endl;
// }
//
// Date(const Date& d) // 拷贝构造函数
// :year(d.year)
// ,month(d.month)
// ,day(d.day)
// {
// cout << "Date(const Date& d):" << this << endl;
// }
//
// void printDate()
// {
// cout << this->year << "," << this->month << "," << this->day << "," << this->t.hours << "," << this->t.minute << "," << this->t.second << endl;
// }
//
// ~Date() // 析构函数
// {
// cout << "析构函数,不能重载,无参,无返回值" << this << endl;
// }
//
//
// Date& operator=(const Date& d)
// {
// cout << this << "=" << &d << endl;
// if (this != &d)
// {
// year = d.year;
// month = d.month;
// day = d.day;
// }
// return *this;
// }
//
// int year;
// int month;
// int day;
// Time t;
//};
//Date Test1(Date d);
//Date& Test2(Date& d);
//Date Test3(Date d);
//void Test();
//
//int main()
//{
// Date d1(2020, 10, 18);
// d1.printDate();
// return 0;
//}
//
//#endif
//
//
//
//# if 0
//int main1()
//{
// Test();
// return 0;
//}
//Date Test1(Date d)
//{
// Date temp(d);
// temp = d;
// return temp;
//}
//
//Date& Test2(Date& d)
//{
// Date temp(d);
// temp = d;
// return d;
//}
//
//Date Test3(Date d)
//{
// return d;
//}
//
//void Test()
//{
// Date d1(2020, 10, 14);
// Date d2(d1);
//
// // d2 = Test1(d1);
// d2 = Test2(d1);
//}
//
//#endif
| [
"2268411762@qq.com"
] | 2268411762@qq.com |
755fcf0bf842d85380c80b5c3c35666e84ea5613 | a754da405bc3d2d2d1d8940d7d277c63bf2b7768 | /graphics/opengl/geometry_renderer.cpp | 9a9d1bbc09c10279d7f5b95465fb0dac52ea3a8d | [
"Apache-2.0"
] | permissive | icyleaf/omim | 3a5a4f07890e6ad0155447ed39563a710178ec35 | a1a299eb341603337bf4a22b92518d9575498c97 | refs/heads/master | 2020-12-28T22:53:52.624975 | 2015-10-09T16:30:46 | 2015-10-09T16:30:46 | 43,995,093 | 0 | 0 | Apache-2.0 | 2019-12-12T03:19:59 | 2015-10-10T05:08:38 | C++ | UTF-8 | C++ | false | false | 19,154 | cpp | #include "graphics/opengl/geometry_renderer.hpp"
#include "graphics/resource.hpp"
#include "graphics/opengl/base_texture.hpp"
#include "graphics/opengl/texture.hpp"
#include "graphics/opengl/buffer_object.hpp"
#include "graphics/opengl/managed_texture.hpp"
#include "graphics/opengl/vertex.hpp"
#include "graphics/opengl/opengl.hpp"
#include "graphics/opengl/gl_render_context.hpp"
#include "graphics/opengl/defines_conv.hpp"
#include "graphics/opengl/route_vertex.hpp"
#include "base/logging.hpp"
#include "base/shared_buffer_manager.hpp"
#include "base/math.hpp"
#include "std/bind.hpp"
namespace graphics
{
namespace gl
{
typedef Texture<DATA_TRAITS, true> TDynamicTexture;
GeometryRenderer::GeometryRenderer(base_t::Params const & params)
: base_t(params)
{}
GeometryRenderer::UploadData::UploadData(shared_ptr<Resource> const * resources,
size_t count,
shared_ptr<BaseTexture> const & texture)
: m_texture(texture)
{
m_uploadQueue.reserve(count);
copy(resources, resources + count, back_inserter(m_uploadQueue));
}
GeometryRenderer::UploadData::UploadData()
{}
void GeometryRenderer::UploadData::perform()
{
if (!m_texture)
{
LOG(LDEBUG, ("no texture on upload"));
return;
}
if (m_uploadQueue.empty())
return;
size_t ranges[4];
ranges[0] = 0;
ranges[1] = ranges[2] = ranges[3] = m_uploadQueue.size();
m2::RectU maxRects[3];
size_t maxIndex = 1;
m2::RectU currentMaxRect = m_uploadQueue[0]->m_texRect;
for (size_t i = 1; i < m_uploadQueue.size(); ++i)
{
shared_ptr<Resource> const & resource = m_uploadQueue[i];
if (resource->m_texRect.minY() >= currentMaxRect.maxY())
{
ranges[maxIndex] = i;
if (resource->m_texRect.minX() < currentMaxRect.minX())
{
maxRects[maxIndex - 1] = currentMaxRect;
maxIndex++;
}
else
maxRects[maxIndex - 1].Add(currentMaxRect);
currentMaxRect = resource->m_texRect;
}
else
currentMaxRect.Add(resource->m_texRect);
}
if (ranges[maxIndex] != m_uploadQueue.size())
maxIndex++;
maxRects[maxIndex - 1] = currentMaxRect;
static_cast<ManagedTexture*>(m_texture.get())->lock();
TDynamicTexture * dynTexture = static_cast<TDynamicTexture*>(m_texture.get());
for (size_t rangesIt = 1; rangesIt < maxIndex + 1; ++rangesIt)
{
m2::RectU const & maxRect = maxRects[rangesIt - 1];
TDynamicTexture::view_t v = dynTexture->view(maxRect.SizeX(),
maxRect.SizeY());
for (size_t resourceIt = ranges[rangesIt - 1]; resourceIt < ranges[rangesIt]; ++resourceIt)
{
shared_ptr<Resource> const & resource = m_uploadQueue[resourceIt];
m2::RectU currentRect = resource->m_texRect;
currentRect.setMinY(currentRect.minY() - maxRect.minY());
currentRect.setMaxY(currentRect.maxY() - maxRect.minY());
currentRect.setMinX(currentRect.minX() - maxRect.minX());
currentRect.setMaxX(currentRect.maxX() - maxRect.minX());
size_t renderBufferSize = my::NextPowOf2(currentRect.SizeX() *
currentRect.SizeY() *
sizeof(TDynamicTexture::pixel_t));
SharedBufferManager::shared_buffer_ptr_t buffer = SharedBufferManager::instance().reserveSharedBuffer(renderBufferSize);
TDynamicTexture::view_t bufferView = gil::interleaved_view(currentRect.SizeX(),
currentRect.SizeY(),
(TDynamicTexture::pixel_t *)&((*buffer)[0]),
currentRect.SizeX() * sizeof(TDynamicTexture::pixel_t));
resource->render(&bufferView(0, 0));
TDynamicTexture::view_t subImage = gil::subimage_view(v, currentRect.minX(), currentRect.minY(),
currentRect.SizeX(), currentRect.SizeY());
gil::copy_pixels(bufferView, subImage);
SharedBufferManager::instance().freeSharedBuffer(renderBufferSize, buffer);
}
dynTexture->upload(&v(0,0), maxRect);
}
/// In multithreaded resource usage scenarios the suggested way to see
/// resource update made in one thread to the another thread is
/// to call the glFlush in thread, which modifies resource and then rebind
/// resource in another threads that is using this resource, if any.
OGLCHECK(glFlushFn());
static_cast<ManagedTexture*>(m_texture.get())->unlock();
}
void GeometryRenderer::UploadData::cancel()
{
perform();
}
void GeometryRenderer::UploadData::dump()
{
m2::RectU r(0, 0, 0, 0);
if (!m_uploadQueue.empty())
r = m_uploadQueue[0]->m_texRect;
LOG(LDEBUG, ("UploadData: texture", m_texture->id(), ", count=", m_uploadQueue.size(), ", first=", r));
}
void GeometryRenderer::uploadResources(shared_ptr<Resource> const * resources,
size_t count,
shared_ptr<BaseTexture> const & texture)
{
processCommand(make_shared<UploadData>(resources, count, texture));
}
GeometryRenderer::DrawGeometry::DrawGeometry()
: m_alfa(1.0)
{
}
bool GeometryRenderer::DrawGeometry::isNeedAdditionalUniforms() const
{
gl::RenderContext const * rc = static_cast<gl::RenderContext const *>(renderContext());
shared_ptr<Program> const & prg = rc->program();
return prg->isParamExist(ETransparency);
}
void GeometryRenderer::DrawGeometry::setAdditionalUniforms(const UniformsHolder & holder)
{
VERIFY(holder.getValue(ETransparency, m_alfa), ());
}
void GeometryRenderer::DrawGeometry::resetAdditionalUniforms()
{
m_alfa = 1.0;
}
void GeometryRenderer::DrawGeometry::perform()
{
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
shared_ptr<Program> const & prg = rc->program();
prg->setParam(ESemModelView, rc->matrix(EModelView));
prg->setParam(ESemProjection, rc->matrix(EProjection));
prg->setParam(ESemSampler0, 0);
if (prg->isParamExist(ETransparency))
prg->setParam(ETransparency, m_alfa);
prg->setStorage(m_storage);
prg->setVertexDecl(Vertex::getVertexDecl());
/// When the binders leave the scope the buffer object will be unbound.
gl::BufferObject::Binder verticesBufBinder, indicesBufBinder;
prg->makeCurrent(verticesBufBinder, indicesBufBinder);
if (m_texture)
m_texture->makeCurrent();
else
LOG(LDEBUG, ("null texture used in DrawGeometry"));
unsigned glPrimType;
convert(m_primitiveType, glPrimType);
OGLCHECK(glDrawElements(
glPrimType,
m_indicesCount,
GL_UNSIGNED_SHORT,
((unsigned char*)m_storage.m_indices->glPtr()) + m_indicesOffs));
}
void GeometryRenderer::DrawGeometry::dump()
{
LOG(LDEBUG, ("DrawGeometry, texture=", m_texture->id(), ", indicesCount=", m_indicesCount));
}
GeometryRenderer::DrawRouteGeometry::DrawRouteGeometry()
: m_indicesCount(0)
{
ResetUniforms();
}
bool GeometryRenderer::DrawRouteGeometry::isNeedAdditionalUniforms() const
{
return true;
}
void GeometryRenderer::DrawRouteGeometry::setAdditionalUniforms(UniformsHolder const & holder)
{
holder.getValue(ERouteHalfWidth, m_halfWidth[0], m_halfWidth[1]);
holder.getValue(ERouteColor, m_color[0], m_color[1], m_color[2], m_color[3]);
holder.getValue(ERouteClipLength, m_clipLength);
holder.getValue(ERouteTextureRect, m_textureRect[0], m_textureRect[1], m_textureRect[2], m_textureRect[3]);
}
void GeometryRenderer::DrawRouteGeometry::ResetUniforms()
{
m_halfWidth[0] = 0.0f;
m_halfWidth[1] = 0.0f;
m_color[0] = 0.0f;
m_color[1] = 0.0f;
m_color[2] = 0.0f;
m_color[3] = 0.0f;
m_clipLength = 0.0f;
m_textureRect[0] = 0.0f;
m_textureRect[1] = 0.0f;
m_textureRect[2] = 0.0f;
m_textureRect[3] = 0.0f;
m_arrowBorders = math::Zero<float, 4>();
}
void GeometryRenderer::DrawRouteGeometry::resetAdditionalUniforms()
{
ResetUniforms();
}
bool GeometryRenderer::DrawRouteGeometry::isNeedIndicesCount() const
{
return true;
}
void GeometryRenderer::DrawRouteGeometry::setIndicesCount(size_t indicesCount)
{
m_indicesCount = indicesCount;
}
void GeometryRenderer::DrawRouteGeometry::perform()
{
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
shared_ptr<Program> const & prg = rc->program();
prg->setParam(ESemModelView, rc->matrix(EModelView));
prg->setParam(ESemProjection, rc->matrix(EProjection));
prg->setParam(ERouteHalfWidth, m_halfWidth[0], m_halfWidth[1]);
if (prg->isParamExist(ESemSampler0))
prg->setParam(ESemSampler0, 0);
if (prg->isParamExist(ERouteColor))
prg->setParam(ERouteColor, m_color[0], m_color[1], m_color[2], m_color[3]);
if (prg->isParamExist(ERouteClipLength))
prg->setParam(ERouteClipLength, m_clipLength);
if (prg->isParamExist(ERouteTextureRect))
prg->setParam(ERouteTextureRect, m_textureRect[0], m_textureRect[1], m_textureRect[2], m_textureRect[3]);
prg->setStorage(m_storage);
prg->setVertexDecl(RouteVertex::getVertexDecl());
/// When the binders leave the scope the buffer object will be unbound.
gl::BufferObject::Binder verticesBufBinder, indicesBufBinder;
prg->makeCurrent(verticesBufBinder, indicesBufBinder);
if (m_texture)
m_texture->makeCurrent();
else
LOG(LDEBUG, ("null texture used in DrawGeometry"));
OGLCHECK(glDrawElements(
GL_TRIANGLES,
m_indicesCount,
GL_UNSIGNED_SHORT,
(unsigned char*)m_storage.m_indices->glPtr()));
}
void GeometryRenderer::DrawRouteGeometry::dump()
{
LOG(LDEBUG, ("DrawRouteGeometry, texture=", m_texture->id(), ", indicesCount=", m_indicesCount));
}
void GeometryRenderer::drawGeometry(shared_ptr<BaseTexture> const & texture,
Storage const & storage,
size_t indicesCount,
size_t indicesOffs,
EPrimitives primType)
{
shared_ptr<DrawGeometry> command(new DrawGeometry());
command->m_texture = texture;
command->m_storage = storage;
command->m_indicesCount = indicesCount;
command->m_indicesOffs = indicesOffs;
command->m_primitiveType = primType;
processCommand(command);
}
void GeometryRenderer::drawRouteGeometry(shared_ptr<BaseTexture> const & texture,
Storage const & storage)
{
shared_ptr<DrawRouteGeometry> command(new DrawRouteGeometry());
command->m_texture = texture;
command->m_storage = storage;
processCommand(command);
}
void GeometryRenderer::clearRouteGeometry()
{
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
ProgramManager * pm = rc->programManager();
shared_ptr<Program> prg = pm->getProgram(EVxRoute, EFrgRoute);
prg->setStorage(gl::Storage());
prg = pm->getProgram(EVxRoute, EFrgRouteArrow);
prg->setStorage(gl::Storage());
}
void GeometryRenderer::FreeStorage::perform()
{
if (m_storagePool->IsCancelled())
return;
m_storagePool->Free(m_storage);
}
void GeometryRenderer::FreeStorage::cancel()
{
perform();
}
void GeometryRenderer::freeStorage(Storage const & storage, TStoragePool * storagePool)
{
shared_ptr<FreeStorage> command(new FreeStorage());
command->m_storage = storage;
command->m_storagePool = storagePool;
processCommand(command);
}
void GeometryRenderer::FreeTexture::perform()
{
if (m_texturePool->IsCancelled())
return;
m_texturePool->Free(m_texture);
}
void GeometryRenderer::FreeTexture::dump()
{
LOG(LDEBUG, ("FreeTexture, texture=", m_texture->id(), ", pool=", m_texturePool->ResName()));
}
void GeometryRenderer::FreeTexture::cancel()
{
perform();
}
void GeometryRenderer::freeTexture(shared_ptr<BaseTexture> const & texture, TTexturePool * texturePool)
{
shared_ptr<FreeTexture> command(new FreeTexture());
command->m_texture = texture;
command->m_texturePool = texturePool;
processCommand(command);
}
void GeometryRenderer::UnlockStorage::perform()
{
if (m_storage.m_vertices && m_storage.m_indices)
{
m_storage.m_vertices->unlock();
m_storage.m_indices->unlock();
/// In multithreaded resource usage scenarios the suggested way to see
/// resource update made in one thread to the another thread is
/// to call the glFlush in thread, which modifies resource and then rebind
/// resource in another threads that is using this resource, if any.
OGLCHECK(glFlushFn());
}
else
LOG(LDEBUG, ("no storage to unlock"));
}
void GeometryRenderer::UnlockStorage::cancel()
{
perform();
}
void GeometryRenderer::unlockStorage(Storage const & storage)
{
shared_ptr<UnlockStorage> command(new UnlockStorage());
command->m_storage = storage;
processCommand(command);
}
void GeometryRenderer::DiscardStorage::perform()
{
if (m_storage.m_vertices && m_storage.m_indices)
{
m_storage.m_vertices->discard();
m_storage.m_indices->discard();
}
else
LOG(LDEBUG, ("no storage to discard"));
}
void GeometryRenderer::DiscardStorage::cancel()
{
perform();
}
void GeometryRenderer::discardStorage(Storage const & storage)
{
shared_ptr<DiscardStorage> command(new DiscardStorage());
command->m_storage = storage;
processCommand(command);
}
void GeometryRenderer::ApplyStates::perform()
{
// Disable dither to fix 4-bit textures "grid" issue on Nvidia Tegra cards
OGLCHECK(glDisable(GL_DITHER));
OGLCHECK(glActiveTextureFn(GL_TEXTURE0));
OGLCHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
OGLCHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
OGLCHECK(glEnable(GL_DEPTH_TEST));
OGLCHECK(glDepthFunc(GL_LEQUAL));
OGLCHECK(glEnable(GL_BLEND));
OGLCHECK(glDepthMask(GL_TRUE));
if (graphics::gl::g_isSeparateBlendFuncSupported)
OGLCHECK(glBlendFuncSeparateFn(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA,
GL_ZERO,
GL_ONE));
else
OGLCHECK(glBlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA));
/// Applying program
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
ProgramManager * pm = rc->programManager();
shared_ptr<Program> prg = pm->getProgram(EVxTextured, EFrgAlphaTest);
if (m_type == AlfaVaringProgram)
prg = pm->getProgram(EVxTextured, EFrgVarAlfa);
else if (m_type == RouteProgram)
prg = pm->getProgram(EVxRoute, EFrgRoute);
else if (m_type == RouteArrowProgram)
prg = pm->getProgram(EVxRoute, EFrgRouteArrow);
if (m_type == DefaultProgram || m_type == AlfaVaringProgram)
{
prg->setParam(ESemModelView, rc->matrix(EModelView));
prg->setParam(ESemProjection, rc->matrix(EProjection));
prg->setParam(ESemSampler0, 0);
}
rc->setProgram(prg);
}
void GeometryRenderer::applyStates()
{
processCommand(make_shared<ApplyStates>());
}
void GeometryRenderer::applyVarAlfaStates()
{
processCommand(make_shared<ApplyStates>(ApplyStates::AlfaVaringProgram));
}
void GeometryRenderer::applyRouteStates()
{
processCommand(make_shared<ApplyStates>(ApplyStates::RouteProgram));
}
void GeometryRenderer::applyRouteArrowStates()
{
processCommand(make_shared<ApplyStates>(ApplyStates::RouteArrowProgram));
}
void GeometryRenderer::ApplyBlitStates::perform()
{
OGLCHECK(glEnable(GL_DEPTH_TEST));
OGLCHECK(glDepthFunc(GL_LEQUAL));
OGLCHECK(glDepthMask(GL_TRUE));
/// Applying program
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
ProgramManager * pm = rc->programManager();
shared_ptr<Program> prg = pm->getProgram(EVxTextured, EFrgNoAlphaTest);
prg->setParam(ESemModelView, rc->matrix(EModelView));
prg->setParam(ESemProjection, rc->matrix(EProjection));
prg->setParam(ESemSampler0, 0);
rc->setProgram(prg);
}
void GeometryRenderer::applyBlitStates()
{
processCommand(make_shared<ApplyBlitStates>());
}
void GeometryRenderer::ApplySharpStates::perform()
{
// Disable dither to fix 4-bit textures "grid" issue on Nvidia Tegra cards
OGLCHECK(glDisable(GL_DITHER));
OGLCHECK(glActiveTextureFn(GL_TEXTURE0));
OGLCHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
OGLCHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
OGLCHECK(glEnable(GL_DEPTH_TEST));
OGLCHECK(glDepthFunc(GL_LEQUAL));
OGLCHECK(glEnable(GL_BLEND));
OGLCHECK(glDepthMask(GL_TRUE));
if (graphics::gl::g_isSeparateBlendFuncSupported)
OGLCHECK(glBlendFuncSeparateFn(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA,
GL_ZERO,
GL_ONE));
else
OGLCHECK(glBlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA));
/// Applying program
gl::RenderContext * rc = static_cast<gl::RenderContext*>(renderContext());
ProgramManager * pm = rc->programManager();
shared_ptr<Program> prg = pm->getProgram(EVxSharp, EFrgAlphaTest);
prg->setParam(ESemModelView, rc->matrix(EModelView));
prg->setParam(ESemProjection, rc->matrix(EProjection));
prg->setParam(ESemSampler0, 0);
rc->setProgram(prg);
}
void GeometryRenderer::applySharpStates()
{
processCommand(make_shared<ApplySharpStates>());
}
}
}
| [
"alex@maps.me"
] | alex@maps.me |
82c0f3b8cbf16bcf2f2eacb61cef77995e7fa68d | 0493369b110494be619f3df88ce476fc926fbe89 | /src/demo.cpp | 4fe6aede30d9e91ba9316f8d4a12e30c0f9ef490 | [] | no_license | lwluckystar/Mis-matching-Elimination | e7cdf5ecb358e5d5780e5b0e2c3851114ba4d25c | f200d4c6ce60c76172d493b407fba363121fdb99 | refs/heads/master | 2020-03-19T17:52:19.544391 | 2018-06-11T02:38:18 | 2018-06-11T02:38:18 | 136,775,092 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,045 | cpp | // GridMatch.cpp : Defines the entry point for the console application.
//#define USE_GPU
#include "Header.h"
#include "Mis_matcherE.h"
void GmsMatch(Mat &img1, Mat &img2);
//读入图像,对图片大小进行缩放
void runImagePair(){
Mat img1 = imread("P1010517.JPG");
Mat img2 = imread("P1010520.JPG");
//调用imresize函数,对图片大小进行改变
imresize(img1, 680);
imresize(img2, 680);
//调用GmsMatch函数,对图片进行特征点检测和特征点匹配
GmsMatch(img1, img2);
}
int main()
{
#ifdef USE_GPU
int flag = cuda::getCudaEnabledDeviceCount();
if (flag != 0){ cuda::setDevice(0); }
#endif // USE_GPU
runImagePair();
return 0;
}
void GmsMatch(Mat &img1, Mat &img2){
double t3 = (double)getTickCount(); //状态:新加。存储算法总的运行时间
double t1 = getTickCount();//状态:新加。存储orb算法的计算时间
vector<KeyPoint> kp1, kp2;//存储检测到的特征点,数据结构为KeyPoint
Mat d1, d2;
vector<DMatch> matches_all, matches_gms;//DMatch主要用来储存匹配信息的结构体
Ptr<ORB> orb = ORB::create(3000);//调用ORB检测图片中的特征点,检测特征点数量为1000
//Ptr<DescriptorMatcher> descriptor_matcher = DescriptorMatcher::create("BruteForce"); //新加,创建特征匹配器
orb->setFastThreshold(0);
orb->detectAndCompute(img1, Mat(), kp1, d1);
orb->detectAndCompute(img2, Mat(), kp2, d2);
t1 = ((double)getTickCount() - t1) / getTickFrequency();//状态:新加。orb算法计算时间公式
cout << "ORB算法用时:" << t1 << "秒" << endl;//状态:新加
cout << "图像1特征点个数:" << kp1.size() << endl;//状态:新加
cout << "图像2特征点个数:" << kp2.size() << endl;//状态:新加
cout << "图像1特征描述矩阵大小:" << d1.size()//状态:新加
<< ",特征向量个数:" << d1.rows << ",维数:" << d1.cols << endl;//状态:新加
cout << "图像2特征描述矩阵大小:" << d2.size()//状态:新加
<< ",特征向量个数:" << d2.rows << ",维数:" << d2.cols << endl;//状态:新加
//Mat descriptors1,descriptors2;//新加,
//descriptor_extractor->compute( img1, kp1, descriptors1 ); //新加,
//descriptor_extractor->compute( img2, kp2, descriptors2 ); //新加,
#ifdef USE_GPU
GpuMat gd1(d1), gd2(d2);
Ptr<cuda::DescriptorMatcher> matcher = cv::cuda::DescriptorMatcher::createBFMatcher(NORM_HAMMING);
matcher->match(gd1, gd2, matches_all);
#else
BFMatcher matcher(NORM_HAMMING);
matcher.match(d1, d2, matches_all);
Mat imgMatch;//状态:新加。
imgMatch= DrawInlier(img1, img2, kp1, kp2, matches_all, 1);//状态:新加。
imwrite("粗匹配10000.jpg", imgMatch);
namedWindow("imgMatch", CV_WINDOW_FREERATIO);//新加,
imshow("imgMatch", imgMatch);//新加,
waitKey(10);
#endif
// GMS filter ,GMS过滤误配准点对
int num_inliers = 0;
std::vector<bool> vbInliers;
//调用
double t2 = getTickCount();//状态:新加。存储GMS剔除误匹配时间
gms_matcher gms(kp1,img1.size(), kp2,img2.size(), matches_all);
num_inliers = gms.GetInlierMask(vbInliers, false, false);
t2 = ((double)getTickCount() - t2) / getTickFrequency();//状态:新加。GMS剔除误匹配时间
cout << "GMS剔除误匹配时间:" << t2 << "秒" << endl;//状态:新加
cout << "Get total " << num_inliers << " matches." << endl;
// draw matches,画出配准点之间的线
for (size_t i = 0; i < vbInliers.size(); ++i)
{
if (vbInliers[i] == true)
{
matches_gms.push_back(matches_all[i]);
}
}
cout << "goodMatch个数:" << matches_gms.size() << endl;//状态:新加。剩余的优秀的匹配点
Mat show = DrawInlier(img1, img2, kp1, kp2, matches_gms, 1);
imwrite("Result_1_10000.jpg", show);
namedWindow("show", CV_WINDOW_FREERATIO);
imshow("show", show);
t3 = double((getTickCount() - t3) / getTickFrequency()); //状态:存储算法总的运行时间
cout << "算法总的运行时间:" << t3 << "秒" << endl;//状态:新加
waitKey();
}
| [
"240895644@qq.com"
] | 240895644@qq.com |
b20962ed6b47e37179b1088b89cfa053cfce6985 | e4ec5b6cf3cfe2568ef0b5654c019e398b4ecc67 | /aws-sdk-cpp/1.2.10/include/aws/ds/model/DirectoryDescription.h | 7c158f7554133d7a79bf98e985892806d6f53b0e | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | EnjoyLifeFund/macHighSierra-cellars | 59051e496ed0e68d14e0d5d91367a2c92c95e1fb | 49a477d42f081e52f4c5bdd39535156a2df52d09 | refs/heads/master | 2022-12-25T19:28:29.992466 | 2017-10-10T13:00:08 | 2017-10-10T13:00:08 | 96,081,471 | 3 | 1 | null | 2022-12-17T02:26:21 | 2017-07-03T07:17:34 | null | UTF-8 | C++ | false | false | 30,431 | h | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/ds/DirectoryService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ds/model/DirectorySize.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ds/model/DirectoryStage.h>
#include <aws/core/utils/DateTime.h>
#include <aws/ds/model/DirectoryType.h>
#include <aws/ds/model/DirectoryVpcSettingsDescription.h>
#include <aws/ds/model/DirectoryConnectSettingsDescription.h>
#include <aws/ds/model/RadiusSettings.h>
#include <aws/ds/model/RadiusStatus.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace DirectoryService
{
namespace Model
{
/**
* <p>Contains information about an AWS Directory Service directory.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DirectoryDescription">AWS
* API Reference</a></p>
*/
class AWS_DIRECTORYSERVICE_API DirectoryDescription
{
public:
DirectoryDescription();
DirectoryDescription(const Aws::Utils::Json::JsonValue& jsonValue);
DirectoryDescription& operator=(const Aws::Utils::Json::JsonValue& jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The directory identifier.</p>
*/
inline const Aws::String& GetDirectoryId() const{ return m_directoryId; }
/**
* <p>The directory identifier.</p>
*/
inline void SetDirectoryId(const Aws::String& value) { m_directoryIdHasBeenSet = true; m_directoryId = value; }
/**
* <p>The directory identifier.</p>
*/
inline void SetDirectoryId(Aws::String&& value) { m_directoryIdHasBeenSet = true; m_directoryId = std::move(value); }
/**
* <p>The directory identifier.</p>
*/
inline void SetDirectoryId(const char* value) { m_directoryIdHasBeenSet = true; m_directoryId.assign(value); }
/**
* <p>The directory identifier.</p>
*/
inline DirectoryDescription& WithDirectoryId(const Aws::String& value) { SetDirectoryId(value); return *this;}
/**
* <p>The directory identifier.</p>
*/
inline DirectoryDescription& WithDirectoryId(Aws::String&& value) { SetDirectoryId(std::move(value)); return *this;}
/**
* <p>The directory identifier.</p>
*/
inline DirectoryDescription& WithDirectoryId(const char* value) { SetDirectoryId(value); return *this;}
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline DirectoryDescription& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline DirectoryDescription& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
/**
* <p>The fully-qualified name of the directory.</p>
*/
inline DirectoryDescription& WithName(const char* value) { SetName(value); return *this;}
/**
* <p>The short name of the directory.</p>
*/
inline const Aws::String& GetShortName() const{ return m_shortName; }
/**
* <p>The short name of the directory.</p>
*/
inline void SetShortName(const Aws::String& value) { m_shortNameHasBeenSet = true; m_shortName = value; }
/**
* <p>The short name of the directory.</p>
*/
inline void SetShortName(Aws::String&& value) { m_shortNameHasBeenSet = true; m_shortName = std::move(value); }
/**
* <p>The short name of the directory.</p>
*/
inline void SetShortName(const char* value) { m_shortNameHasBeenSet = true; m_shortName.assign(value); }
/**
* <p>The short name of the directory.</p>
*/
inline DirectoryDescription& WithShortName(const Aws::String& value) { SetShortName(value); return *this;}
/**
* <p>The short name of the directory.</p>
*/
inline DirectoryDescription& WithShortName(Aws::String&& value) { SetShortName(std::move(value)); return *this;}
/**
* <p>The short name of the directory.</p>
*/
inline DirectoryDescription& WithShortName(const char* value) { SetShortName(value); return *this;}
/**
* <p>The directory size.</p>
*/
inline const DirectorySize& GetSize() const{ return m_size; }
/**
* <p>The directory size.</p>
*/
inline void SetSize(const DirectorySize& value) { m_sizeHasBeenSet = true; m_size = value; }
/**
* <p>The directory size.</p>
*/
inline void SetSize(DirectorySize&& value) { m_sizeHasBeenSet = true; m_size = std::move(value); }
/**
* <p>The directory size.</p>
*/
inline DirectoryDescription& WithSize(const DirectorySize& value) { SetSize(value); return *this;}
/**
* <p>The directory size.</p>
*/
inline DirectoryDescription& WithSize(DirectorySize&& value) { SetSize(std::move(value)); return *this;}
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline const Aws::String& GetAlias() const{ return m_alias; }
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAlias(const Aws::String& value) { m_aliasHasBeenSet = true; m_alias = value; }
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAlias(Aws::String&& value) { m_aliasHasBeenSet = true; m_alias = std::move(value); }
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAlias(const char* value) { m_aliasHasBeenSet = true; m_alias.assign(value); }
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAlias(const Aws::String& value) { SetAlias(value); return *this;}
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAlias(Aws::String&& value) { SetAlias(std::move(value)); return *this;}
/**
* <p>The alias for the directory. If no alias has been created for the directory,
* the alias is the directory identifier, such as <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAlias(const char* value) { SetAlias(value); return *this;}
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline const Aws::String& GetAccessUrl() const{ return m_accessUrl; }
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAccessUrl(const Aws::String& value) { m_accessUrlHasBeenSet = true; m_accessUrl = value; }
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAccessUrl(Aws::String&& value) { m_accessUrlHasBeenSet = true; m_accessUrl = std::move(value); }
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline void SetAccessUrl(const char* value) { m_accessUrlHasBeenSet = true; m_accessUrl.assign(value); }
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAccessUrl(const Aws::String& value) { SetAccessUrl(value); return *this;}
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAccessUrl(Aws::String&& value) { SetAccessUrl(std::move(value)); return *this;}
/**
* <p>The access URL for the directory, such as
* <code>http://<alias>.awsapps.com</code>. If no alias has been created for
* the directory, <code><alias></code> is the directory identifier, such as
* <code>d-XXXXXXXXXX</code>.</p>
*/
inline DirectoryDescription& WithAccessUrl(const char* value) { SetAccessUrl(value); return *this;}
/**
* <p>The textual description for the directory.</p>
*/
inline const Aws::String& GetDescription() const{ return m_description; }
/**
* <p>The textual description for the directory.</p>
*/
inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }
/**
* <p>The textual description for the directory.</p>
*/
inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }
/**
* <p>The textual description for the directory.</p>
*/
inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }
/**
* <p>The textual description for the directory.</p>
*/
inline DirectoryDescription& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}
/**
* <p>The textual description for the directory.</p>
*/
inline DirectoryDescription& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}
/**
* <p>The textual description for the directory.</p>
*/
inline DirectoryDescription& WithDescription(const char* value) { SetDescription(value); return *this;}
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline const Aws::Vector<Aws::String>& GetDnsIpAddrs() const{ return m_dnsIpAddrs; }
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline void SetDnsIpAddrs(const Aws::Vector<Aws::String>& value) { m_dnsIpAddrsHasBeenSet = true; m_dnsIpAddrs = value; }
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline void SetDnsIpAddrs(Aws::Vector<Aws::String>&& value) { m_dnsIpAddrsHasBeenSet = true; m_dnsIpAddrs = std::move(value); }
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline DirectoryDescription& WithDnsIpAddrs(const Aws::Vector<Aws::String>& value) { SetDnsIpAddrs(value); return *this;}
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline DirectoryDescription& WithDnsIpAddrs(Aws::Vector<Aws::String>&& value) { SetDnsIpAddrs(std::move(value)); return *this;}
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline DirectoryDescription& AddDnsIpAddrs(const Aws::String& value) { m_dnsIpAddrsHasBeenSet = true; m_dnsIpAddrs.push_back(value); return *this; }
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline DirectoryDescription& AddDnsIpAddrs(Aws::String&& value) { m_dnsIpAddrsHasBeenSet = true; m_dnsIpAddrs.push_back(std::move(value)); return *this; }
/**
* <p>The IP addresses of the DNS servers for the directory. For a Simple AD or
* Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft
* AD directory servers. For an AD Connector directory, these are the IP addresses
* of the DNS servers or domain controllers in the on-premises directory to which
* the AD Connector is connected.</p>
*/
inline DirectoryDescription& AddDnsIpAddrs(const char* value) { m_dnsIpAddrsHasBeenSet = true; m_dnsIpAddrs.push_back(value); return *this; }
/**
* <p>The current stage of the directory.</p>
*/
inline const DirectoryStage& GetStage() const{ return m_stage; }
/**
* <p>The current stage of the directory.</p>
*/
inline void SetStage(const DirectoryStage& value) { m_stageHasBeenSet = true; m_stage = value; }
/**
* <p>The current stage of the directory.</p>
*/
inline void SetStage(DirectoryStage&& value) { m_stageHasBeenSet = true; m_stage = std::move(value); }
/**
* <p>The current stage of the directory.</p>
*/
inline DirectoryDescription& WithStage(const DirectoryStage& value) { SetStage(value); return *this;}
/**
* <p>The current stage of the directory.</p>
*/
inline DirectoryDescription& WithStage(DirectoryStage&& value) { SetStage(std::move(value)); return *this;}
/**
* <p>Specifies when the directory was created.</p>
*/
inline const Aws::Utils::DateTime& GetLaunchTime() const{ return m_launchTime; }
/**
* <p>Specifies when the directory was created.</p>
*/
inline void SetLaunchTime(const Aws::Utils::DateTime& value) { m_launchTimeHasBeenSet = true; m_launchTime = value; }
/**
* <p>Specifies when the directory was created.</p>
*/
inline void SetLaunchTime(Aws::Utils::DateTime&& value) { m_launchTimeHasBeenSet = true; m_launchTime = std::move(value); }
/**
* <p>Specifies when the directory was created.</p>
*/
inline DirectoryDescription& WithLaunchTime(const Aws::Utils::DateTime& value) { SetLaunchTime(value); return *this;}
/**
* <p>Specifies when the directory was created.</p>
*/
inline DirectoryDescription& WithLaunchTime(Aws::Utils::DateTime&& value) { SetLaunchTime(std::move(value)); return *this;}
/**
* <p>The date and time that the stage was last updated.</p>
*/
inline const Aws::Utils::DateTime& GetStageLastUpdatedDateTime() const{ return m_stageLastUpdatedDateTime; }
/**
* <p>The date and time that the stage was last updated.</p>
*/
inline void SetStageLastUpdatedDateTime(const Aws::Utils::DateTime& value) { m_stageLastUpdatedDateTimeHasBeenSet = true; m_stageLastUpdatedDateTime = value; }
/**
* <p>The date and time that the stage was last updated.</p>
*/
inline void SetStageLastUpdatedDateTime(Aws::Utils::DateTime&& value) { m_stageLastUpdatedDateTimeHasBeenSet = true; m_stageLastUpdatedDateTime = std::move(value); }
/**
* <p>The date and time that the stage was last updated.</p>
*/
inline DirectoryDescription& WithStageLastUpdatedDateTime(const Aws::Utils::DateTime& value) { SetStageLastUpdatedDateTime(value); return *this;}
/**
* <p>The date and time that the stage was last updated.</p>
*/
inline DirectoryDescription& WithStageLastUpdatedDateTime(Aws::Utils::DateTime&& value) { SetStageLastUpdatedDateTime(std::move(value)); return *this;}
/**
* <p>The directory size.</p>
*/
inline const DirectoryType& GetType() const{ return m_type; }
/**
* <p>The directory size.</p>
*/
inline void SetType(const DirectoryType& value) { m_typeHasBeenSet = true; m_type = value; }
/**
* <p>The directory size.</p>
*/
inline void SetType(DirectoryType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); }
/**
* <p>The directory size.</p>
*/
inline DirectoryDescription& WithType(const DirectoryType& value) { SetType(value); return *this;}
/**
* <p>The directory size.</p>
*/
inline DirectoryDescription& WithType(DirectoryType&& value) { SetType(std::move(value)); return *this;}
/**
* <p>A <a>DirectoryVpcSettingsDescription</a> object that contains additional
* information about a directory. This member is only present if the directory is a
* Simple AD or Managed AD directory.</p>
*/
inline const DirectoryVpcSettingsDescription& GetVpcSettings() const{ return m_vpcSettings; }
/**
* <p>A <a>DirectoryVpcSettingsDescription</a> object that contains additional
* information about a directory. This member is only present if the directory is a
* Simple AD or Managed AD directory.</p>
*/
inline void SetVpcSettings(const DirectoryVpcSettingsDescription& value) { m_vpcSettingsHasBeenSet = true; m_vpcSettings = value; }
/**
* <p>A <a>DirectoryVpcSettingsDescription</a> object that contains additional
* information about a directory. This member is only present if the directory is a
* Simple AD or Managed AD directory.</p>
*/
inline void SetVpcSettings(DirectoryVpcSettingsDescription&& value) { m_vpcSettingsHasBeenSet = true; m_vpcSettings = std::move(value); }
/**
* <p>A <a>DirectoryVpcSettingsDescription</a> object that contains additional
* information about a directory. This member is only present if the directory is a
* Simple AD or Managed AD directory.</p>
*/
inline DirectoryDescription& WithVpcSettings(const DirectoryVpcSettingsDescription& value) { SetVpcSettings(value); return *this;}
/**
* <p>A <a>DirectoryVpcSettingsDescription</a> object that contains additional
* information about a directory. This member is only present if the directory is a
* Simple AD or Managed AD directory.</p>
*/
inline DirectoryDescription& WithVpcSettings(DirectoryVpcSettingsDescription&& value) { SetVpcSettings(std::move(value)); return *this;}
/**
* <p>A <a>DirectoryConnectSettingsDescription</a> object that contains additional
* information about an AD Connector directory. This member is only present if the
* directory is an AD Connector directory.</p>
*/
inline const DirectoryConnectSettingsDescription& GetConnectSettings() const{ return m_connectSettings; }
/**
* <p>A <a>DirectoryConnectSettingsDescription</a> object that contains additional
* information about an AD Connector directory. This member is only present if the
* directory is an AD Connector directory.</p>
*/
inline void SetConnectSettings(const DirectoryConnectSettingsDescription& value) { m_connectSettingsHasBeenSet = true; m_connectSettings = value; }
/**
* <p>A <a>DirectoryConnectSettingsDescription</a> object that contains additional
* information about an AD Connector directory. This member is only present if the
* directory is an AD Connector directory.</p>
*/
inline void SetConnectSettings(DirectoryConnectSettingsDescription&& value) { m_connectSettingsHasBeenSet = true; m_connectSettings = std::move(value); }
/**
* <p>A <a>DirectoryConnectSettingsDescription</a> object that contains additional
* information about an AD Connector directory. This member is only present if the
* directory is an AD Connector directory.</p>
*/
inline DirectoryDescription& WithConnectSettings(const DirectoryConnectSettingsDescription& value) { SetConnectSettings(value); return *this;}
/**
* <p>A <a>DirectoryConnectSettingsDescription</a> object that contains additional
* information about an AD Connector directory. This member is only present if the
* directory is an AD Connector directory.</p>
*/
inline DirectoryDescription& WithConnectSettings(DirectoryConnectSettingsDescription&& value) { SetConnectSettings(std::move(value)); return *this;}
/**
* <p>A <a>RadiusSettings</a> object that contains information about the RADIUS
* server configured for this directory.</p>
*/
inline const RadiusSettings& GetRadiusSettings() const{ return m_radiusSettings; }
/**
* <p>A <a>RadiusSettings</a> object that contains information about the RADIUS
* server configured for this directory.</p>
*/
inline void SetRadiusSettings(const RadiusSettings& value) { m_radiusSettingsHasBeenSet = true; m_radiusSettings = value; }
/**
* <p>A <a>RadiusSettings</a> object that contains information about the RADIUS
* server configured for this directory.</p>
*/
inline void SetRadiusSettings(RadiusSettings&& value) { m_radiusSettingsHasBeenSet = true; m_radiusSettings = std::move(value); }
/**
* <p>A <a>RadiusSettings</a> object that contains information about the RADIUS
* server configured for this directory.</p>
*/
inline DirectoryDescription& WithRadiusSettings(const RadiusSettings& value) { SetRadiusSettings(value); return *this;}
/**
* <p>A <a>RadiusSettings</a> object that contains information about the RADIUS
* server configured for this directory.</p>
*/
inline DirectoryDescription& WithRadiusSettings(RadiusSettings&& value) { SetRadiusSettings(std::move(value)); return *this;}
/**
* <p>The status of the RADIUS MFA server connection.</p>
*/
inline const RadiusStatus& GetRadiusStatus() const{ return m_radiusStatus; }
/**
* <p>The status of the RADIUS MFA server connection.</p>
*/
inline void SetRadiusStatus(const RadiusStatus& value) { m_radiusStatusHasBeenSet = true; m_radiusStatus = value; }
/**
* <p>The status of the RADIUS MFA server connection.</p>
*/
inline void SetRadiusStatus(RadiusStatus&& value) { m_radiusStatusHasBeenSet = true; m_radiusStatus = std::move(value); }
/**
* <p>The status of the RADIUS MFA server connection.</p>
*/
inline DirectoryDescription& WithRadiusStatus(const RadiusStatus& value) { SetRadiusStatus(value); return *this;}
/**
* <p>The status of the RADIUS MFA server connection.</p>
*/
inline DirectoryDescription& WithRadiusStatus(RadiusStatus&& value) { SetRadiusStatus(std::move(value)); return *this;}
/**
* <p>Additional information about the directory stage.</p>
*/
inline const Aws::String& GetStageReason() const{ return m_stageReason; }
/**
* <p>Additional information about the directory stage.</p>
*/
inline void SetStageReason(const Aws::String& value) { m_stageReasonHasBeenSet = true; m_stageReason = value; }
/**
* <p>Additional information about the directory stage.</p>
*/
inline void SetStageReason(Aws::String&& value) { m_stageReasonHasBeenSet = true; m_stageReason = std::move(value); }
/**
* <p>Additional information about the directory stage.</p>
*/
inline void SetStageReason(const char* value) { m_stageReasonHasBeenSet = true; m_stageReason.assign(value); }
/**
* <p>Additional information about the directory stage.</p>
*/
inline DirectoryDescription& WithStageReason(const Aws::String& value) { SetStageReason(value); return *this;}
/**
* <p>Additional information about the directory stage.</p>
*/
inline DirectoryDescription& WithStageReason(Aws::String&& value) { SetStageReason(std::move(value)); return *this;}
/**
* <p>Additional information about the directory stage.</p>
*/
inline DirectoryDescription& WithStageReason(const char* value) { SetStageReason(value); return *this;}
/**
* <p>Indicates if single-sign on is enabled for the directory. For more
* information, see <a>EnableSso</a> and <a>DisableSso</a>.</p>
*/
inline bool GetSsoEnabled() const{ return m_ssoEnabled; }
/**
* <p>Indicates if single-sign on is enabled for the directory. For more
* information, see <a>EnableSso</a> and <a>DisableSso</a>.</p>
*/
inline void SetSsoEnabled(bool value) { m_ssoEnabledHasBeenSet = true; m_ssoEnabled = value; }
/**
* <p>Indicates if single-sign on is enabled for the directory. For more
* information, see <a>EnableSso</a> and <a>DisableSso</a>.</p>
*/
inline DirectoryDescription& WithSsoEnabled(bool value) { SetSsoEnabled(value); return *this;}
/**
* <p>The desired number of domain controllers in the directory if the directory is
* Microsoft AD.</p>
*/
inline int GetDesiredNumberOfDomainControllers() const{ return m_desiredNumberOfDomainControllers; }
/**
* <p>The desired number of domain controllers in the directory if the directory is
* Microsoft AD.</p>
*/
inline void SetDesiredNumberOfDomainControllers(int value) { m_desiredNumberOfDomainControllersHasBeenSet = true; m_desiredNumberOfDomainControllers = value; }
/**
* <p>The desired number of domain controllers in the directory if the directory is
* Microsoft AD.</p>
*/
inline DirectoryDescription& WithDesiredNumberOfDomainControllers(int value) { SetDesiredNumberOfDomainControllers(value); return *this;}
private:
Aws::String m_directoryId;
bool m_directoryIdHasBeenSet;
Aws::String m_name;
bool m_nameHasBeenSet;
Aws::String m_shortName;
bool m_shortNameHasBeenSet;
DirectorySize m_size;
bool m_sizeHasBeenSet;
Aws::String m_alias;
bool m_aliasHasBeenSet;
Aws::String m_accessUrl;
bool m_accessUrlHasBeenSet;
Aws::String m_description;
bool m_descriptionHasBeenSet;
Aws::Vector<Aws::String> m_dnsIpAddrs;
bool m_dnsIpAddrsHasBeenSet;
DirectoryStage m_stage;
bool m_stageHasBeenSet;
Aws::Utils::DateTime m_launchTime;
bool m_launchTimeHasBeenSet;
Aws::Utils::DateTime m_stageLastUpdatedDateTime;
bool m_stageLastUpdatedDateTimeHasBeenSet;
DirectoryType m_type;
bool m_typeHasBeenSet;
DirectoryVpcSettingsDescription m_vpcSettings;
bool m_vpcSettingsHasBeenSet;
DirectoryConnectSettingsDescription m_connectSettings;
bool m_connectSettingsHasBeenSet;
RadiusSettings m_radiusSettings;
bool m_radiusSettingsHasBeenSet;
RadiusStatus m_radiusStatus;
bool m_radiusStatusHasBeenSet;
Aws::String m_stageReason;
bool m_stageReasonHasBeenSet;
bool m_ssoEnabled;
bool m_ssoEnabledHasBeenSet;
int m_desiredNumberOfDomainControllers;
bool m_desiredNumberOfDomainControllersHasBeenSet;
};
} // namespace Model
} // namespace DirectoryService
} // namespace Aws
| [
"Raliclo@gmail.com"
] | Raliclo@gmail.com |
d0aaa8ddcde5b6a010a4e6fb5fdc772bc758ef12 | 28dba754ddf8211d754dd4a6b0704bbedb2bd373 | /AtCoder/AtCoder Beginner Contest 236/A/main.cpp | 45029ce661c73f81aa048cdd30c27c5c8a05db3d | [] | no_license | zjsxzy/algo | 599354679bd72ef20c724bb50b42fce65ceab76f | a84494969952f981bfdc38003f7269e5c80a142e | refs/heads/master | 2023-08-31T17:00:53.393421 | 2023-08-19T14:20:31 | 2023-08-19T14:20:31 | 10,140,040 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 424 | cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define SZ(v) ((int)(v).size())
#define abs(x) ((x) > 0 ? (x) : -(x))
typedef long long LL;
void solve() {
string s;
cin >> s;
int a, b;
cin >> a >> b;
a--; b--;
char c = s[a]; s[a] = s[b]; s[b] = c;
cout << s << endl;
}
int main() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
solve();
return 0;
}
| [
"zjsxzy@gmail.com"
] | zjsxzy@gmail.com |
2e4447e9e5ad67dc5879a13d881e7ea97fc7fec1 | cbb4d2a9844212ed1088a6aab6ae696558777cc1 | /MAX7/v0_0/Arduino/testSensors/testSensors.ino | 45c9fb056189280291b8b5cf473ab9f90f31af1c | [] | no_license | dtgmariano/STRP17_Project | cc561cff596ec2c7cb5bcd5b6f0cf79c448df545 | bf65b110d322f5b8951efe76af640b2aa24c31f6 | refs/heads/master | 2021-01-20T04:29:02.914616 | 2017-01-19T11:40:04 | 2017-01-19T11:40:04 | 78,626,749 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,470 | ino | /*
Analog input, analog output, serial output
Reads an analog input pin, maps the result to a range from 0 to 255
and uses the result to set the pulsewidth modulation (PWM) of an output pin.
Also prints the results to the serial monitor.
The circuit:
* potentiometer connected to analog pin 0.
Center pin of the potentiometer goes to the analog pin.
side pins of the potentiometer go to +5V and ground
* LED connected from digital pin 9 to ground
created 29 Dec. 2008
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/
// These constants won't change. They're used to give names
// to the pins used:
const int analogInPin0 = A0; // Analog input pin that the potentiometer is attached to
const int analogInPin1 = A1; // Analog input pin that the potentiometer is attached to
int s0Value = 0; // value read from the pot
int s1Value = 0; // value read from the tilt
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
s0Value = analogRead(analogInPin0);
delay(10);
s1Value = analogRead(analogInPin1);
delay(10);
// print the results to the serial monitor:
Serial.print("POT = ");
Serial.print(s0Value);
Serial.print("\t TILT = ");
Serial.println(s1Value);
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(2);
}
| [
"dtgm@uol.com.br"
] | dtgm@uol.com.br |
28d370fd4bad3270a76acafa4f9211f301f1603a | 17dd5b165700f7128ee3a174dc67d5b68c4bd139 | /CHESS-0.3-hess-pp-qt-40/Source/Kernel/Classes/String_Matrices.cc | 5745d281bc14c319c76b8765e8ccb2a51eca9049 | [] | no_license | Bayesian-Omics/CHESS | f3da2714431268287cc882172bc47f91ed89deb2 | c9b884004b57220e301d416d5d4f83f0937bccaa | refs/heads/master | 2016-09-11T02:15:27.690918 | 2014-12-02T22:29:57 | 2014-12-02T22:29:57 | 27,103,199 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,094 | cc | /* This file is part of CHESS.
* Copyright (c) Habib Saadi (h.saadi@imperial.ac.uk)
* 2013
*
* The file is copied from String_Matrices.cc in the ESS++ program
* Copyright (c) Marc Chadeau (m.chadeau@imperial.ac.uk)
* Leonardo Bottolo (l.bottolo@imperial.ac.uk)
* David Hastie (d.hastie@imperial.ac.uk)
* 2010
*
* CHESS 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.
*
* CHESS 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 CHESS. If not, see <http://www.gnu.org/licenses/>.
*/
#include "String_Matrices.h"
#define DEBUG 0
using namespace std;
String_Matrices::String_Matrices()
{
nb_rows=0;
nb_columns=0;
}
void String_Matrices::Alloc_string_matrix(int Rows,
int Columns)
{
nb_rows=Rows;
nb_columns=Columns;
matrix=new string*[Rows];
for(int row=0;row<Rows;row++){
matrix[row]=new string[Columns];
}
}
void String_Matrices::Free_string_matrix()
{
for(int row=0;row<nb_rows;row++){
delete[] matrix[row];
}
delete[] matrix;
}
void String_Matrices::Read_from_file(char *filename)
{
ifstream INFILE;
INFILE.open(filename, ios::in);
//Checking the file path
if(INFILE.fail()){
cout << "Invalid Path and/or permission rights for " << filename << " -- run stopped." << endl;
exit(1);
}
// Reading the first element: nb_rows
INFILE >> nb_rows;
// Reading the second element: nb_columns
INFILE >> nb_columns;
cout << "Reading file : " << filename
<< " -- #rows: " << nb_rows
<< " -- #cols: " << nb_columns << endl;
//Allocating memory for the Matrix
Alloc_string_matrix(nb_rows,
nb_columns);
//Storing the map file in the matrix.
for(int current_line=0;current_line<nb_rows;current_line++){
for(int current_column=0;current_column<nb_columns;current_column++){
if(!INFILE.eof()){
if(DEBUG){
cout << " ligne " << current_line
<< " -- colonne " << current_column
<< " --Test " << INFILE.eof() << endl;
}
INFILE>>matrix[current_line][current_column];
}
else{
cout << "Missing element at line " << current_line
<< " and column " << current_column
<< " in file " << filename << "." << endl
<< "!!!!Run Stopped!!!!" << endl;
exit(1);
}
}
}
}
void String_Matrices::Display_matrix()
{
for(int current_line=0;current_line<nb_rows;current_line++){
for(int current_column=0;current_column<nb_columns;current_column++){
cout << matrix[current_line][current_column] << " ";
}
cout << endl;
}
cout << endl;
}
void String_Matrices::Display_matrix_header()
{
cout << nb_rows << endl;
cout << nb_columns << endl;
for(int current_line=0;current_line<nb_rows;current_line++){
for(int current_column=0;current_column<nb_columns;current_column++){
cout << matrix[current_line][current_column] << " ";
}
cout << endl;
}
cout << endl;
}
void String_Matrices::Write_to_file(char *filename)
{
ofstream OUTFILE;
OUTFILE.open(filename, ios::out);
//Checking the file path
if(OUTFILE.fail()){
cout << "Invalid Path and/or permission rights for " << filename << " -- run stopped." << endl;
exit(1);
}
//Writing the first element: nb_rows
OUTFILE << nb_rows << endl;
//Writing the second element: nb_columns
OUTFILE << nb_columns << endl;
//Writing the core of the matrix.
for(int current_line=0;current_line<nb_rows;current_line++){
for(int current_column=0;current_column<nb_columns;current_column++){
OUTFILE << matrix[current_line][current_column] << " ";
}
OUTFILE << endl;
}
OUTFILE.close();
}
| [
"saadi@crans.org"
] | saadi@crans.org |
77075dd04defb93c38c880851c4ef85b7dd4d7dd | 3410cd0e269a8933ddf57202e17ee83d9ef8804c | /4009.cpp | d51a6fef2871f16b23e8aae0eb3693e06177258a | [] | no_license | GJ-Lin/SJTUOJ | d2b34af4ddfbc5be662f6e66e71c606c087a2678 | a5ef3044bdfdbe20243ea563a2da126538905f74 | refs/heads/master | 2022-10-10T06:11:31.850409 | 2019-05-28T08:23:32 | 2019-05-28T08:23:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 877 | cpp | #include <iostream>
#include <cstring>
using namespace std;
const int MAXNUM = 105;
char cipher[MAXNUM];
char solution[MAXNUM];
int main()
{
cin >> cipher >> solution;
int l = strlen(cipher);
if (l != strlen(solution))
{
cout << "No Solution";
return 0;
}
for (int a = 2; a <= l; ++a)
{
int cnt = 0;
bool flag = true;
if (l % a != 0) continue;
for (int i = 0; i < a && flag; ++i)
{
for (int j = 0; j < l / a; ++j)
{
if (cipher[j * a + i] != solution[cnt++])
{
flag = false;
break;
}
}
}
if (flag)
{
cout << a;
return 0;
}
}
cout << "No Solution";
return 0;
} | [
"1426955281@qq.com"
] | 1426955281@qq.com |
e4cec8458db728a11357f4b1b45701b7bede8229 | 498474967e1480acf5cc0f25756e1d748c677195 | /mmdetection3d/mmdet3d/ops/spconv/include/tensorview/helper_kernel.cu.h | dbfa006fe025bc3ada3cdaac32167f02024fca61 | [
"MIT",
"Apache-2.0"
] | permissive | hustvl/MapTR | adc37f78cbae9d8c909dd8648088a4930bf55377 | feb0664e64684d3207859279f047fa54a1a806f6 | refs/heads/main | 2023-08-25T17:44:47.672149 | 2023-08-14T13:31:17 | 2023-08-14T13:31:17 | 518,672,305 | 643 | 95 | MIT | 2023-09-14T03:30:23 | 2022-07-28T02:20:43 | Python | UTF-8 | C++ | false | false | 2,323 | h | #pragma once
// from tensorflow
namespace tv {
namespace detail {
template <typename T>
class KernelLoop {
struct Iterator {
__forceinline__ __device__ Iterator(T index, T delta)
: index_(index), delta_(delta) {}
__forceinline__ __device__ T operator*() const { return index_; }
__forceinline__ __device__ Iterator &operator++() {
index_ += delta_;
return *this;
}
__forceinline__ __device__ bool operator!=(const Iterator &other) const {
bool greater = index_ > other.index_;
bool less = index_ < other.index_;
// Anything past an end iterator (delta_ == 0) is equal.
// In range-based for loops, this optimizes to 'return less'.
if (!other.delta_) {
return less;
}
if (!delta_) {
return greater;
}
return less || greater;
}
private:
T index_;
const T delta_;
};
public:
__forceinline__ __device__ KernelLoop(T begin, T delta, T end)
: begin_(begin), delta_(delta), end_(end) {}
__forceinline__ __device__ Iterator begin() const {
return Iterator{begin_, delta_};
}
__forceinline__ __device__ Iterator end() const { return Iterator{end_, 0}; }
private:
T begin_;
T delta_;
T end_;
};
} // namespace detail
template <typename T, int NumILP = 1>
__forceinline__ __device__ detail::KernelLoop<T> KernelLoopX(T count) {
return detail::KernelLoop<T>(blockIdx.x * blockDim.x + threadIdx.x,
gridDim.x * blockDim.x * NumILP, count);
}
// Helper to visit indices in the range 0 <= i < count using the y-coordinate.
// Usage: for(int i : KernelLoopY(count)) { visit(i); }
template <typename T, int NumILP = 1>
__forceinline__ __device__ detail::KernelLoop<T> KernelLoopY(T count) {
return detail::KernelLoop<T>(blockIdx.y * blockDim.y + threadIdx.y,
gridDim.y * blockDim.y * NumILP, count);
}
// Helper to visit indices in the range 0 <= i < count using the z-coordinate.
// Usage: for(int i : KernelLoopZ(count)) { visit(i); }
template <typename T, int NumILP = 1>
__forceinline__ __device__ detail::KernelLoop<T> KernelLoopZ(T count) {
return detail::KernelLoop<T>(blockIdx.z * blockDim.z + threadIdx.z,
gridDim.z * blockDim.z * NumILP, count);
}
} // namespace tv
| [
"cnliao62@gmail.com"
] | cnliao62@gmail.com |
4d008f5054d83170dfbe22b9d5488571f2a12db7 | aa61d31bb858db5881e087d0c922e61b2b7bc7c8 | /UnitTestSrc/CSM/Test_CArgoConfigurator.cpp | da1c9b0ad2fad13202439f34e2b2d6761b09b798 | [] | no_license | pawelwojtowicz/ecuApp | 2e680fb83b62f637c31bb437e6c9a773934a073b | 970467da422c8188e9a863253b721c28850b03c1 | refs/heads/master | 2021-01-17T15:07:49.141885 | 2016-11-25T22:21:27 | 2016-11-25T22:21:27 | 28,879,102 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,975 | cpp | #include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <CSM/CArgoConfigurator.h>
#include <CSM/ICSMBuilder.h>
#include <UCL/SystemEnvironment.h>
#include "CCSMBuilderMock.h"
TEST( CArgoConfigurator, TestScenario_1)
{
CCSMBuilderMock mockInstance;
CCSMBuilderIF mockInterface(&mockInstance);
std::string configFile(UCL::SystemEnvironment::ResolveEnvironmentVariable("${UNITTEST_DIR}/CSM/CSM_testConfig_1.xmi"));
std::string smName("TestScenario_1");
EXPECT_CALL(mockInstance, AddState( std::string(""), // parent,
std::string("top"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("top"), // parent,
std::string("Parent1"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("Parent1"), // parent,
std::string("Child1"), // stateName,
std::string("A_EnterChild1"), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("Parent1"), // parent,
std::string("Child2"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("A_ExitChild2") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("top"), // parent,
std::string("Parent2"), // stateName,
std::string(""), // enterActionName,
std::string("A_DoParent2"), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddTransition(std::string("E_GoToParent2"), // eventName,
std::string("Parent1"), // sourceStateName,
std::string("Parent2"), // destinationStateName,
std::string(""), // conditionName,
std::string("A_WeAreLeaving") // actionName);
)).Times(1);
EXPECT_CALL(mockInstance, AddTransition(std::string("E_GoToChild1"), // eventName,
std::string("Parent2"), // sourceStateName,
std::string("Child1"), // destinationStateName,
std::string("C_CanGoBack"), // conditionName,
std::string("") // actionName);
)).Times(1);
EXPECT_CALL(mockInstance, AddTransition(std::string("E_GoToChild2"), // eventName,
std::string("Child1"), // sourceStateName,
std::string("Child2"), // destinationStateName,
std::string(""), // conditionName,
std::string("") // actionName);
)).Times(1);
EXPECT_CALL(mockInstance, AddTransition(std::string("E_GoToChild1"), // eventName,
std::string("Child2"), // sourceStateName,
std::string("Child1"), // destinationStateName,
std::string(""), // conditionName,
std::string("") // actionName);
)).Times(1);
EXPECT_CALL(mockInstance, SetInitialState( std::string("Child1")));
CSM::CArgoConfigurator configurator(configFile, smName);
configurator.InitializeStateMachine(&mockInterface);
}
TEST( CArgoConfigurator, TestScenario_2)
{
CCSMBuilderMock mockInstance;
CCSMBuilderIF mockInterface(&mockInstance);
std::string configFile(UCL::SystemEnvironment::ResolveEnvironmentVariable("${UNITTEST_DIR}/CSM/CSM_testConfig_1.xmi"));
std::string smName("TestScenario_2");
EXPECT_CALL(mockInstance, AddState( std::string(""), // parent,
std::string("top"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("top"), // parent,
std::string("OneState"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddState( std::string("top"), // parent,
std::string("SecondState"), // stateName,
std::string(""), // enterActionName,
std::string(""), // leafActionName,
std::string("") // exitActioName
)).Times(1);
EXPECT_CALL(mockInstance, AddTransition(std::string("E_ToSecond"),// eventName,
std::string("OneState"), // sourceStateName,
std::string("SecondState"),// destinationStateName,
std::string(""), // conditionName,
std::string("") // actionName);
)).Times(1);
EXPECT_CALL(mockInstance, SetInitialState( std::string("OneState")));
CSM::CArgoConfigurator configurator(configFile, smName);
configurator.InitializeStateMachine(&mockInterface);
}
| [
"elendil@konto.pl"
] | elendil@konto.pl |
4af4bfd179608055359e97f8d11432dfc2fe9ca0 | d4aa0e3097d723c7a17baf5475db307660c074ad | /src/Geometry/InstancedGeometry.h | dbd6982062c57b02215be4a3c68df8553afabcf4 | [] | no_license | tychi/Flewnit | f0ef2803629d97b214371183d08c84ef91d925d0 | 4bb0bb6bd3f2f55c37dee66f81642c94dee6bcf1 | refs/heads/master | 2020-05-17T00:11:28.704426 | 2011-07-15T10:05:28 | 2011-07-15T10:05:28 | 1,081,973 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,324 | h | /*
* InstancedGeometry.h
*
* Created on: Jan 26, 2011
* Author: tychi
*/
#pragma once
#include "Geometry.h"
//#include "WorldObject/InstanceManager.h"
namespace Flewnit
{
class InstancedGeometry
: public Geometry
{
FLEWNIT_BASIC_OBJECT_DECLARATIONS;
public:
virtual ~InstancedGeometry();
inline InstanceManager* getInstanceManager()const{return mInstanceManager;}
virtual void draw(
//SimulationPipelineStage* currentStage, SubObject* currentUsingSuboject,
unsigned int numInstances,
GeometryRepresentation desiredGeomRep);
inline ID getInstanceID()const{return mInstanceID;}
private:
friend class InstanceManager;
//only InstanceManager may create objects of this type;
InstancedGeometry(String name,InstanceManager* instanceManager, ID instanceID);
//hen-egg-problem enforces the backtracking setting after construction ;(
void setOwningSubObject(SubObject* owningSubObject);
InstanceManager* mInstanceManager;
//the InstancedGeometry class is the only class with a backtrack to a SubObject;
//"real" Geometry can have many users, hence a backtrack would be senseless, but this
//kind of proxy geometry is strongly associated to one single SubObject and hence WorldObject
//(where we get the transformation matrices from)
SubObject* mOwningSubObject;
ID mInstanceID;
};
}
| [
"markusschlueter@uni-koblenz.de"
] | markusschlueter@uni-koblenz.de |
57f4e73ec6611aa916f8c0d09389ccdb5a63b6a0 | af6521347672e305704651814ac24b31cc23c935 | /02-class/dm12_静态成员变量和静态成员函数.cpp | 1809e54f549d93329c1b12ea3735c4f71d79efd6 | [] | no_license | yanhai307/cpp_study | 08f4203055115aff50f6479c4e8299adf99d916f | ef40b56815bb51cc1f170643807a3f5b8638139b | refs/heads/master | 2020-05-14T12:17:46.835407 | 2020-02-17T01:21:15 | 2020-02-17T01:21:15 | 181,791,053 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,336 | cpp | //
// Created by YANHAI on 2019/5/26.
//
// 每个变量,拥有属性。有没有一些属性,归所有对象拥有?
/**
* 1. 定义静态成员变量
* > 关键字 static 可以用于说明一个类的成员,静态成员提供了一个同类对象的共享机制。
* > 把一个类的成员说明为static时,这个类无论有多少个对象被创建,这些对象共享这个static成员
* > 静态成员作用于类,他不是对象成员
*/
#include <iostream>
using namespace std;
class Test{
public:
void printC()
{
cout << "c: "<< c << endl;
}
void addC()
{
c +=1;
}
/*
* 在静态成员函数中,
* 不可以调用普通(非静态)成员属性
* 不可以调用普通(非静态)成员方法
*/
static void getC() // 静态成员函数
{
cout << "c: "<< c << endl;
// cout << "a: "<< a << endl; // error
}
private:
int a;
int b;
static int c; // 静态成员变量
};
// 这里定义变量并初始化,类里面只是声明
int Test::c = 10;
int main()
{
Test t1, t2, t3;
t1.printC(); // 10
t2.addC(); // 11
t3.printC(); // 11
// 静态成员函数的调用方法
t1.getC(); // 用对象
Test::getC(); // 类::
return 0;
}
| [
"yanhaigz@163.com"
] | yanhaigz@163.com |
641f63f55c4a28ffffc2ebf4e8bd50d29b05dabb | 0fa1152e1e434ce9fe9e2db95f43f25675bf7d27 | /src/lib/pid_design/pid_design_test.cpp | c9b9339cae3037b391f1dfd6ea3cb0756b2e920f | [
"BSD-3-Clause"
] | permissive | PX4/PX4-Autopilot | 4cc90dccc9285ca4db7f595ac5a7547df02ca92e | 3d61ab84c42ff8623bd48ff0ba74f9cf26bb402b | refs/heads/main | 2023-08-30T23:58:35.398450 | 2022-03-26T01:29:03 | 2023-08-30T15:40:01 | 5,298,790 | 3,146 | 3,798 | BSD-3-Clause | 2023-09-14T17:22:04 | 2012-08-04T21:19:36 | C++ | UTF-8 | C++ | false | false | 2,388 | cpp | /****************************************************************************
*
* Copyright (C) 2020-2021 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* Test code for pid_design functions
* Run this test only using make tests TESTFILTER=pid_design
*/
#include <gtest/gtest.h>
#include <matrix/matrix/math.hpp>
#include "pid_design.hpp"
using namespace pid_design;
using namespace matrix;
TEST(PidDesignTest, testImpl)
{
const Vector3f num(.0098f, -0.162f, .147f);
const Vector3f den(1.f, -1.814f, .822f);
const float dt = 0.004f;
const Vector3f kid = computePidGmvc(num, den, dt, 0.1f, 1.f, 0.5f);
// Compare with values generated from the python implementation
EXPECT_NEAR(kid(0), 0.129f, .001f);
EXPECT_NEAR(kid(1), 11.911f / 5.f, .001f);
EXPECT_NEAR(kid(2), 0.0463f, .0001f);
}
| [
"daniel@agar.ca"
] | daniel@agar.ca |
7406b8428502cdce5e361fad37c0ebd50127b3f3 | 88601d8bd944e876a61468f5e7e4bb896dc0ce65 | /Modules/Rendering/vaStandardShapes.h | 55042221a814729818154f8a0e7d272e4773999b | [
"MIT"
] | permissive | KakCAT/ASSAO | 493609eddc2d572762057c477911643caa140c0c | 06881a1632576468b9816d3d28aa06b49a06afa8 | refs/heads/master | 2022-10-16T06:30:20.717443 | 2020-06-13T21:50:01 | 2020-06-13T21:50:01 | 272,085,924 | 0 | 0 | MIT | 2020-06-13T21:07:30 | 2020-06-13T21:07:29 | null | UTF-8 | C++ | false | false | 5,958 | h | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016, Intel Corporation
// 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.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// File changes (yyyy-mm-dd)
// 2016-09-07: filip.strugar@intel.com: first commit (extracted from VertexAsylum codebase, 2006-2016 by Filip Strugar)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
////////////////////////////////////////////////////////////////////////////////////////////////
// Code in vaStandardShapes.h/cpp uses ideas from Microsoft's DXUTShapes.cpp and Assimp library
// ( http://assimp.sourceforge.net/, 3.1.1 )
// Please find Assimp license at the bottom of header file
////////////////////////////////////////////////////////////////////////////////////////////////
#include "Core/vaCoreIncludes.h"
#include "vaTriangleMesh.h"
namespace VertexAsylum
{
class vaStandardShapes
{
vaStandardShapes( ) {}
public:
// all of these produce shapes with center in (0, 0, 0) and each vertex magnitude of 1 (normalized), except where specified otherwise
// front faces are counter-clockwise
static void CreatePlane( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, float sizeX, float sizeY );
static void CreateTetrahedron( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, bool shareVertices );
static void CreateCube( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, bool shareVertices, float edgeHalfLength = 0.7071067811865475f );
static void CreateOctahedron( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, bool shareVertices );
static void CreateIcosahedron( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, bool shareVertices );
static void CreateDodecahedron( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, bool shareVertices );
static void CreateSphere( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, int tessellationLevel, bool shareVertices );
static void CreateCylinder( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices, float height, float radiusBottom, float radiusTop, int tessellation, bool openTopBottom, bool shareVertices );
static void CreateTeapot( std::vector<vaVector3> & outVertices, std::vector<uint32> & outIndices );
};
}
////////////////////////////////////////////////////////////////////////////////////////////////
// Code in vaStandardShapes.h/cpp uses ideas from Assimp library, http://assimp.sourceforge.net/, 3.1.1
// Please refer to Assimp license below
////////////////////////////////////////////////////////////////////////////////////////////////
//
// /*
// Open Asset Import Library (assimp)
// ----------------------------------------------------------------------
//
// Copyright (c) 2006-2012, assimp team
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms,
// with or without modification, are permitted provided that the
// following conditions are met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the
// following disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// * Neither the name of the assimp team, nor the names of its
// contributors may be used to endorse or promote products
// derived from this software without specific prior
// written permission of the assimp team.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ----------------------------------------------------------------------
// */
//////////////////////////////////////////////////////////////////////////
| [
"filip.strugar@intel.com"
] | filip.strugar@intel.com |
a75a3d72c82655b3eaead9115e9cb7720e1387fd | 996c3c2d547eea137e6b282aa2e766aa16d20815 | /Source/FPSGame/Public/FPSGameState.h | f6257a4d4dd4e7aef8cc94ba039c6199992efbd2 | [] | no_license | Lenovezhou/StealthGame | c85f4eb5660e8fabec66c5e8e7f15f1c06fceaa1 | 5b4231184430f4d6254a5a3e42baf629991afe19 | refs/heads/master | 2020-03-28T16:58:12.474826 | 2018-09-14T06:38:10 | 2018-09-14T06:38:10 | 148,746,120 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 403 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameStateBase.h"
#include "FPSGameState.generated.h"
/**
*
*/
UCLASS()
class FPSGAME_API AFPSGameState : public AGameStateBase
{
GENERATED_BODY()
public:
UFUNCTION(NetMulticast,Reliable)
void GamestateComplete(APawn* _ins,bool issuccessful);
};
| [
"1042030742@qq.com"
] | 1042030742@qq.com |
24d33659c4d90bf03331d93f1bdd0e0bdb209d83 | acd92f081599799a46f88201747ee29fab305801 | /engine/rendering/backend/ImGuiImplGLFW.cpp | a721d7195d2fa3e96510b2bca87e82273dc925e8 | [] | no_license | shadow-lr/VulkanRenderer | 7d538cf07b8e1dd126cbe6b9c29838656b2b626e | 63ab42b0f48b768271472f4ce05371fe566144de | refs/heads/master | 2022-10-12T06:54:09.773120 | 2020-06-15T05:34:08 | 2020-06-15T05:34:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,171 | cpp | // dear imgui: Platform Binding for GLFW
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs,
// OpenGL/Vulkan graphics context creation, etc.) (Requires: GLFW 3.1+)
// Implemented features:
// [X] Platform: Clipboard support.
// [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [x] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: 3 cursors types are missing from GLFW.
// [X] Platform: Keyboard arrays indexed using GLFW_KEY_* codes, e.g. ImGui::IsKeyPressed(GLFW_KEY_SPACE).
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example
// of using this. If you are new to dear imgui, read examples/README.txt and read the documentation
// at the top of imgui.cpp. https://github.com/ocornut/imgui
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2019-10-18: Misc: Previously installed user callbacks are now restored on shutdown.
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
// 2019-05-11: Inputs: Don't filter value from character callback before calling
// AddInputCharacter(). 2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is
// minimized. 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the
// About Window. 2018-11-07: Inputs: When installing our GLFW callbacks, we save user's previously
// installed ones - if any - and chain call them. 2018-08-01: Inputs: Workaround for Emscripten
// which doesn't seem to handle focus related calls. 2018-06-29: Inputs: Added support for the
// ImGuiMouseCursor_Hand cursor. 2018-06-08: Misc: Extracted imgui_impl_glfw.cpp/.h away from the
// old combined GLFW+OpenGL/Vulkan examples. 2018-03-20: Misc: Setup io.BackendFlags
// ImGuiBackendFlags_HasMouseCursors flag + honor ImGuiConfigFlags_NoMouseCursorChange flag.
// 2018-02-20: Inputs: Added support for mouse cursors (ImGui::GetMouseCursor() value, passed to glfwSetCursor()).
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user
// needs to call CreateContext/DestroyContext themselves. 2018-02-06: Inputs: Added mapping for
// ImGuiKey_Space. 2018-01-25: Inputs: Added gamepad support if ImGuiConfigFlags_NavEnableGamepad
// is set. 2018-01-25: Inputs: Honoring the io.WantSetMousePos by repositioning the mouse (when
// using navigation and ImGuiConfigFlags_NavMoveMouse is set). 2018-01-20: Inputs: Added Horizontal
// Mouse Wheel support. 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert. 2017-08-25: Inputs:
// MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).
// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
#include "imgui.hpp"
#include "ImGuiImplGLFW.h"
// GLFW
#include <GLFW/glfw3.h>
#ifdef _WIN32
#undef APIENTRY
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h> // for glfwGetWin32Window
#endif
#define GLFW_HAS_WINDOW_TOPMOST \
(GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3200) // 3.2+ GLFW_FLOATING
#define GLFW_HAS_WINDOW_HOVERED \
(GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3300) // 3.3+ GLFW_HOVERED
#define GLFW_HAS_WINDOW_ALPHA \
(GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3300) // 3.3+ glfwSetWindowOpacity
#define GLFW_HAS_PER_MONITOR_DPI \
(GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3300) // 3.3+ glfwGetMonitorContentScale
#define GLFW_HAS_VULKAN \
(GLFW_VERSION_MAJOR * 1000 + GLFW_VERSION_MINOR * 100 >= 3200) // 3.2+ glfwCreateWindowSurface
// Data
enum GlfwClientApi
{
GlfwClientApi_Unknown,
GlfwClientApi_OpenGL,
GlfwClientApi_Vulkan
};
static GLFWwindow* g_Window = NULL; // Main window
static GlfwClientApi g_ClientApi = GlfwClientApi_Unknown;
static double g_Time = 0.0;
static bool g_MouseJustPressed[5] = { false, false, false, false, false };
static GLFWcursor* g_MouseCursors[ImGuiMouseCursor_COUNT] = {};
static bool g_InstalledCallbacks = false;
// Chain GLFW callbacks: our callbacks will call the user's previously installed callbacks, if any.
static GLFWmousebuttonfun g_PrevUserCallbackMousebutton = NULL;
static GLFWscrollfun g_PrevUserCallbackScroll = NULL;
static GLFWkeyfun g_PrevUserCallbackKey = NULL;
static GLFWcharfun g_PrevUserCallbackChar = NULL;
static const char* ImGui_ImplGlfw_GetClipboardText (void* user_data)
{
return glfwGetClipboardString ((GLFWwindow*)user_data);
}
static void ImGui_ImplGlfw_SetClipboardText (void* user_data, const char* text)
{
glfwSetClipboardString ((GLFWwindow*)user_data, text);
}
void ImGui_ImplGlfw_MouseButtonCallback (GLFWwindow* window, int button, int action, int mods)
{
if (g_PrevUserCallbackMousebutton != NULL)
g_PrevUserCallbackMousebutton (window, button, action, mods);
if (action == GLFW_PRESS && button >= 0 && button < IM_ARRAYSIZE (g_MouseJustPressed))
g_MouseJustPressed[button] = true;
}
void ImGui_ImplGlfw_ScrollCallback (GLFWwindow* window, double xoffset, double yoffset)
{
if (g_PrevUserCallbackScroll != NULL) g_PrevUserCallbackScroll (window, xoffset, yoffset);
ImGuiIO& io = ImGui::GetIO ();
io.MouseWheelH += (float)xoffset;
io.MouseWheel += (float)yoffset;
}
void ImGui_ImplGlfw_KeyCallback (GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (g_PrevUserCallbackKey != NULL) g_PrevUserCallbackKey (window, key, scancode, action, mods);
ImGuiIO& io = ImGui::GetIO ();
if (action == GLFW_PRESS) io.KeysDown[key] = true;
if (action == GLFW_RELEASE) io.KeysDown[key] = false;
// Modifiers are not reliable across systems
io.KeyCtrl = io.KeysDown[GLFW_KEY_LEFT_CONTROL] || io.KeysDown[GLFW_KEY_RIGHT_CONTROL];
io.KeyShift = io.KeysDown[GLFW_KEY_LEFT_SHIFT] || io.KeysDown[GLFW_KEY_RIGHT_SHIFT];
io.KeyAlt = io.KeysDown[GLFW_KEY_LEFT_ALT] || io.KeysDown[GLFW_KEY_RIGHT_ALT];
io.KeySuper = io.KeysDown[GLFW_KEY_LEFT_SUPER] || io.KeysDown[GLFW_KEY_RIGHT_SUPER];
}
void ImGui_ImplGlfw_CharCallback (GLFWwindow* window, unsigned int c)
{
if (g_PrevUserCallbackChar != NULL) g_PrevUserCallbackChar (window, c);
ImGuiIO& io = ImGui::GetIO ();
io.AddInputCharacter (c);
}
static bool ImGui_ImplGlfw_Init (GLFWwindow* window, bool install_callbacks, GlfwClientApi client_api)
{
g_Window = window;
g_Time = 0.0;
// Setup back-end capabilities flags
ImGuiIO& io = ImGui::GetIO ();
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
io.BackendPlatformName = "imgui_impl_glfw";
// Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
io.KeyMap[ImGuiKey_Tab] = GLFW_KEY_TAB;
io.KeyMap[ImGuiKey_LeftArrow] = GLFW_KEY_LEFT;
io.KeyMap[ImGuiKey_RightArrow] = GLFW_KEY_RIGHT;
io.KeyMap[ImGuiKey_UpArrow] = GLFW_KEY_UP;
io.KeyMap[ImGuiKey_DownArrow] = GLFW_KEY_DOWN;
io.KeyMap[ImGuiKey_PageUp] = GLFW_KEY_PAGE_UP;
io.KeyMap[ImGuiKey_PageDown] = GLFW_KEY_PAGE_DOWN;
io.KeyMap[ImGuiKey_Home] = GLFW_KEY_HOME;
io.KeyMap[ImGuiKey_End] = GLFW_KEY_END;
io.KeyMap[ImGuiKey_Insert] = GLFW_KEY_INSERT;
io.KeyMap[ImGuiKey_Delete] = GLFW_KEY_DELETE;
io.KeyMap[ImGuiKey_Backspace] = GLFW_KEY_BACKSPACE;
io.KeyMap[ImGuiKey_Space] = GLFW_KEY_SPACE;
io.KeyMap[ImGuiKey_Enter] = GLFW_KEY_ENTER;
io.KeyMap[ImGuiKey_Escape] = GLFW_KEY_ESCAPE;
io.KeyMap[ImGuiKey_KeyPadEnter] = GLFW_KEY_KP_ENTER;
io.KeyMap[ImGuiKey_A] = GLFW_KEY_A;
io.KeyMap[ImGuiKey_C] = GLFW_KEY_C;
io.KeyMap[ImGuiKey_V] = GLFW_KEY_V;
io.KeyMap[ImGuiKey_X] = GLFW_KEY_X;
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
io.ClipboardUserData = g_Window;
g_MouseCursors[ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR);
g_MouseCursors[ImGuiMouseCursor_TextInput] = glfwCreateStandardCursor (GLFW_IBEAM_CURSOR);
g_MouseCursors[ImGuiMouseCursor_ResizeAll] =
glfwCreateStandardCursor (GLFW_ARROW_CURSOR); // FIXME: GLFW doesn't have this.
g_MouseCursors[ImGuiMouseCursor_ResizeNS] = glfwCreateStandardCursor (GLFW_VRESIZE_CURSOR);
g_MouseCursors[ImGuiMouseCursor_ResizeEW] = glfwCreateStandardCursor (GLFW_HRESIZE_CURSOR);
g_MouseCursors[ImGuiMouseCursor_ResizeNESW] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR); // FIXME: GLFW doesn't have this.
g_MouseCursors[ImGuiMouseCursor_ResizeNWSE] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR); // FIXME: GLFW doesn't have this.
g_MouseCursors[ImGuiMouseCursor_Hand] = glfwCreateStandardCursor (GLFW_HAND_CURSOR);
// Chain GLFW callbacks: our callbacks will call the user's previously installed callbacks, if any.
g_PrevUserCallbackMousebutton = NULL;
g_PrevUserCallbackScroll = NULL;
g_PrevUserCallbackKey = NULL;
g_PrevUserCallbackChar = NULL;
if (install_callbacks)
{
g_InstalledCallbacks = true;
g_PrevUserCallbackMousebutton = glfwSetMouseButtonCallback (window, ImGui_ImplGlfw_MouseButtonCallback);
g_PrevUserCallbackScroll = glfwSetScrollCallback (window, ImGui_ImplGlfw_ScrollCallback);
g_PrevUserCallbackKey = glfwSetKeyCallback (window, ImGui_ImplGlfw_KeyCallback);
g_PrevUserCallbackChar = glfwSetCharCallback (window, ImGui_ImplGlfw_CharCallback);
}
g_ClientApi = client_api;
return true;
}
bool ImGui_ImplGlfw_InitForOpenGL (GLFWwindow* window, bool install_callbacks)
{
return ImGui_ImplGlfw_Init (window, install_callbacks, GlfwClientApi_OpenGL);
}
bool ImGui_ImplGlfw_InitForVulkan (GLFWwindow* window, bool install_callbacks)
{
return ImGui_ImplGlfw_Init (window, install_callbacks, GlfwClientApi_Vulkan);
}
void ImGui_ImplGlfw_Shutdown ()
{
if (g_InstalledCallbacks)
{
glfwSetMouseButtonCallback (g_Window, g_PrevUserCallbackMousebutton);
glfwSetScrollCallback (g_Window, g_PrevUserCallbackScroll);
glfwSetKeyCallback (g_Window, g_PrevUserCallbackKey);
glfwSetCharCallback (g_Window, g_PrevUserCallbackChar);
g_InstalledCallbacks = false;
}
for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
{
glfwDestroyCursor (g_MouseCursors[cursor_n]);
g_MouseCursors[cursor_n] = NULL;
}
g_ClientApi = GlfwClientApi_Unknown;
}
static void ImGui_ImplGlfw_UpdateMousePosAndButtons ()
{
// Update buttons
ImGuiIO& io = ImGui::GetIO ();
for (int i = 0; i < IM_ARRAYSIZE (io.MouseDown); i++)
{
// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MouseDown[i] = g_MouseJustPressed[i] || glfwGetMouseButton (g_Window, i) != 0;
g_MouseJustPressed[i] = false;
}
// Update mouse position
const ImVec2 mouse_pos_backup = io.MousePos;
io.MousePos = ImVec2 (-FLT_MAX, -FLT_MAX);
#ifdef __EMSCRIPTEN__
const bool focused = true; // Emscripten
#else
const bool focused = glfwGetWindowAttrib (g_Window, GLFW_FOCUSED) != 0;
#endif
if (focused)
{
if (io.WantSetMousePos)
{
glfwSetCursorPos (g_Window, (double)mouse_pos_backup.x, (double)mouse_pos_backup.y);
}
else
{
double mouse_x, mouse_y;
glfwGetCursorPos (g_Window, &mouse_x, &mouse_y);
io.MousePos = ImVec2 ((float)mouse_x, (float)mouse_y);
}
}
}
static void ImGui_ImplGlfw_UpdateMouseCursor ()
{
ImGuiIO& io = ImGui::GetIO ();
if ((io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ||
glfwGetInputMode (g_Window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
return;
ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor ();
if (imgui_cursor == ImGuiMouseCursor_None || io.MouseDrawCursor)
{
// Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
glfwSetInputMode (g_Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
}
else
{
// Show OS mouse cursor
// FIXME-PLATFORM: Unfocused windows seems to fail changing the mouse cursor with GLFW 3.2, but 3.3 works here.
glfwSetCursor (g_Window,
g_MouseCursors[imgui_cursor] ? g_MouseCursors[imgui_cursor] : g_MouseCursors[ImGuiMouseCursor_Arrow]);
glfwSetInputMode (g_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
}
}
static void ImGui_ImplGlfw_UpdateGamepads ()
{
ImGuiIO& io = ImGui::GetIO ();
memset (io.NavInputs, 0, sizeof (io.NavInputs));
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) return;
// Update gamepad inputs
#define MAP_BUTTON(NAV_NO, BUTTON_NO) \
{ \
if (buttons_count > BUTTON_NO && buttons[BUTTON_NO] == GLFW_PRESS) \
io.NavInputs[NAV_NO] = 1.0f; \
}
#define MAP_ANALOG(NAV_NO, AXIS_NO, V0, V1) \
{ \
float v = (axes_count > AXIS_NO) ? axes[AXIS_NO] : V0; \
v = (v - V0) / (V1 - V0); \
if (v > 1.0f) v = 1.0f; \
if (io.NavInputs[NAV_NO] < v) io.NavInputs[NAV_NO] = v; \
}
int axes_count = 0, buttons_count = 0;
const float* axes = glfwGetJoystickAxes (GLFW_JOYSTICK_1, &axes_count);
const unsigned char* buttons = glfwGetJoystickButtons (GLFW_JOYSTICK_1, &buttons_count);
MAP_BUTTON (ImGuiNavInput_Activate, 0); // Cross / A
MAP_BUTTON (ImGuiNavInput_Cancel, 1); // Circle / B
MAP_BUTTON (ImGuiNavInput_Menu, 2); // Square / X
MAP_BUTTON (ImGuiNavInput_Input, 3); // Triangle / Y
MAP_BUTTON (ImGuiNavInput_DpadLeft, 13); // D-Pad Left
MAP_BUTTON (ImGuiNavInput_DpadRight, 11); // D-Pad Right
MAP_BUTTON (ImGuiNavInput_DpadUp, 10); // D-Pad Up
MAP_BUTTON (ImGuiNavInput_DpadDown, 12); // D-Pad Down
MAP_BUTTON (ImGuiNavInput_FocusPrev, 4); // L1 / LB
MAP_BUTTON (ImGuiNavInput_FocusNext, 5); // R1 / RB
MAP_BUTTON (ImGuiNavInput_TweakSlow, 4); // L1 / LB
MAP_BUTTON (ImGuiNavInput_TweakFast, 5); // R1 / RB
MAP_ANALOG (ImGuiNavInput_LStickLeft, 0, -0.3f, -0.9f);
MAP_ANALOG (ImGuiNavInput_LStickRight, 0, +0.3f, +0.9f);
MAP_ANALOG (ImGuiNavInput_LStickUp, 1, +0.3f, +0.9f);
MAP_ANALOG (ImGuiNavInput_LStickDown, 1, -0.3f, -0.9f);
#undef MAP_BUTTON
#undef MAP_ANALOG
if (axes_count > 0 && buttons_count > 0)
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
else
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
}
void ImGui_ImplGlfw_NewFrame ()
{
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().");
// Setup display size (every frame to accommodate for window resizing)
int w, h;
int display_w, display_h;
glfwGetWindowSize (g_Window, &w, &h);
glfwGetFramebufferSize (g_Window, &display_w, &display_h);
io.DisplaySize = ImVec2 ((float)w, (float)h);
if (w > 0 && h > 0)
io.DisplayFramebufferScale = ImVec2 ((float)display_w / w, (float)display_h / h);
// Setup time step
double current_time = glfwGetTime ();
io.DeltaTime = g_Time > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f / 60.0f);
g_Time = current_time;
ImGui_ImplGlfw_UpdateMousePosAndButtons ();
ImGui_ImplGlfw_UpdateMouseCursor ();
// Update game controllers (if enabled and available)
ImGui_ImplGlfw_UpdateGamepads ();
}
| [
"cdgiessen@gmail.com"
] | cdgiessen@gmail.com |
89c62a6c6275fb05e4881090ee1b1e795b08e0a9 | cd25223a7ec61085967b6824600686c0a416e375 | /The_Journalist/The_Journalist/sources/Classes projet/Camera.h | 8ac4c3416ed6514b004009fcfb36f69ee9ad1b5c | [] | no_license | richerarc/Projet-SIM | 2385564a125f26cbb83f4cd16ba3525839ffac97 | d33bd2a79baeaecbea757e9f6f51b6a1716e84b5 | refs/heads/master | 2020-12-24T15:40:13.218097 | 2018-08-22T12:13:06 | 2018-08-22T12:13:06 | 30,276,558 | 1 | 7 | null | 2018-06-05T14:56:32 | 2015-02-04T02:15:50 | C | UTF-8 | C++ | false | false | 4,365 | h | #pragma once
#include <math.h>
#include "Maths.h"
#include "GestionnaireEvenements.h"
#include "Vecteur3.h"
namespace gfx{
class Camera{
protected:
Vecteur3d position,
cible,
haut,
cote,
devant;
double sensibilite;
double valeurx;
double valeury;
double hAngle;
double vAngle;
double matriceVue[4][4];
bool pause;
bool changement;
double dernierHAngle;
double dernierVAngle;
void construireMatrice(){
matriceVue[0][0] = cote.x;
matriceVue[1][0] = cote.y;
matriceVue[2][0] = cote.z;
matriceVue[0][1] = haut.x;
matriceVue[1][1] = haut.y;
matriceVue[2][1] = haut.z;
matriceVue[0][2] = -devant.x;
matriceVue[1][2] = -devant.y;
matriceVue[2][2] = -devant.z;
}
void calculerVecteurs(){
if (vAngle > 89)
vAngle = 89;
if (vAngle < -89)
vAngle = -89;
if (hAngle < 0)
hAngle += 360;
if (hAngle > 360)
hAngle -= 360;
double vAngleRadian = vAngle * MATHS_PI / 180;
double hAngleRadian = hAngle * MATHS_PI / 180;
double cos_vAngle = cos(vAngleRadian);
devant.x = cos_vAngle * sin(hAngleRadian);
devant.y = sin(vAngleRadian);
devant.z = cos_vAngle * cos(hAngleRadian);
devant.normaliser();
haut = Vecteur3d(0, 1, 0);
cote = devant.produitVectoriel(haut);
cote.normaliser();
haut = cote.produitVectoriel(devant);
haut.normaliser();
construireMatrice();
}
void defCible(Vecteur3d& cible){
this->cible = cible;
construireMatrice();
}
void defHaut(Vecteur3d& haut){
this->haut = haut;
construireMatrice();
}
Vecteur3d obtCible(){ return cible; }
public:
Camera(Vecteur3d position, Vecteur3d cible, Vecteur3d haut){
this->valeurx = 0;
this->valeury = 0;
this->position = position;
this->cible = cible;
this->haut = haut;
matriceVue[3][0] = matriceVue[3][1] = matriceVue[3][2] = matriceVue[0][3] = matriceVue[1][3] = matriceVue[2][3] = 0;
matriceVue[3][3] = 1;
construireMatrice();
this->sensibilite = 0.15;
this->hAngle = 0;
this->vAngle = 0;
this->dernierHAngle = hAngle;
this->dernierVAngle = vAngle;
this->pause = false;
calculerVecteurs();
GestionnaireEvenements::obtInstance().ajouterUnRappel(SDL_MOUSEMOTION, std::bind(&Camera::surMouvementSouris, this, std::placeholders::_1));
GestionnaireEvenements::obtInstance().ajouterUnRappel(SDL_CONTROLLERAXISMOTION, std::bind(&Camera::surMouvementManette, this, std::placeholders::_1));
SDL_SetRelativeMouseMode(SDL_TRUE);
SDL_ShowCursor(SDL_DISABLE);
}
Camera() : Camera(Vecteur3d(), Vecteur3d(), Vecteur3d()){}
~Camera(){
SDL_SetRelativeMouseMode(SDL_FALSE);
SDL_ShowCursor(SDL_ENABLE);
}
void surMouvementSouris(SDL_Event &event){
if (!pause) {
hAngle -= event.motion.xrel * sensibilite;
vAngle -= event.motion.yrel * sensibilite;
calculerVecteurs();
}
}
void surMouvementManette(SDL_Event& event){
if (!pause) {
if ((event.caxis.axis == SDL_CONTROLLER_AXIS_RIGHTX || event.caxis.axis == SDL_CONTROLLER_AXIS_RIGHTY)){
Manette::mettreAJourControleDroite(event);
valeurx = (Manette::obtenirPositionDroiteX());
valeury = (Manette::obtenirPositionDroiteY());
}
else{
valeurx = 0;
valeury = 0;
}
}
}
void rafraichir(){
hAngle -= valeurx;
vAngle -= valeury;
changement = dernierHAngle != hAngle || dernierVAngle != vAngle;
dernierHAngle = hAngle;
dernierVAngle = vAngle;
calculerVecteurs();
}
void appliquer(){
glMultMatrixd(&matriceVue[0][0]);
glTranslated(-position.x, -position.y, -position.z);
}
bool obtChangement(){ return this->changement; }
void bloquer() { pause = true; }
void deBloquer(){ pause = false; }
bool obtBloquer() { return pause; }
double obtHAngle(){ return hAngle; }
double obtVAngle() { return vAngle; }
void defHAngle(double hAngle){ this->hAngle = hAngle; calculerVecteurs(); }
void defVAngle(double vAngle) { this->vAngle = vAngle; calculerVecteurs(); }
void defDevant(Vecteur3d devant){ this->devant = devant; }
Vecteur3d obtHaut(){ return this->haut; }
Vecteur3d obtDevant(){ return this->devant; }
Vecteur3d obtCote(){ return this->cote; }
Vecteur3d obtPosition(){ return position; }
void defPosition(Vecteur3d position){
this->position = position;
construireMatrice();
}
};
} | [
"kev.pantelakis@gmail.com"
] | kev.pantelakis@gmail.com |
97d269b4f025cb7cf2c875fe6f35ba686de3bd39 | 18d8b08a2e8519979dc2b99c8540a005dd30d475 | /cpp/TemplateClass/Organization.h | 0fcaf05570efeaefd42001e6c626cec693ed8ab0 | [] | no_license | aMahanna/sandbox | 64cc332954f916a5ae62f1abfd0a0d1646e72d5f | 3aa2d7916ad485a032ee5d8fc5faf17e50d1879c | refs/heads/master | 2023-08-16T08:26:06.831246 | 2021-09-25T21:00:11 | 2021-09-25T21:00:11 | 323,756,388 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 688 | h |
#ifndef OrganizationH
#define OrganizationH
#include "PList.h"
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
class Person;
class Organization {
string name;
PList<Person> members;
public:
Organization(std::string n = "default");
Organization(const Organization& registered);
virtual ~Organization();
void addMember(Person* person);
void removeMember(Person* person);
int getSize() const;
int getDim() const;
// NOTE: Method 'getPersons(int i)' is no longer a 'const' because method getItem() modifies the PList "current" index of this object
Person* getPersons(int i);
string getName();
};
#endif | [
"anthony.mahanna@gmail.com"
] | anthony.mahanna@gmail.com |
ec5518ae4300c8e04503e0d1f5f7edbd374e7ad5 | f49738785b2f02d933b0c55ebd1a7f4562820f66 | /OldSrc/NodeVisitor.cpp | be92a13c2bcae662ab64c0b67d72cbc0fc7ece65 | [] | no_license | PowerTravel/vis | def2ec3a2369ef1105f655c2d13bf0df9fee342e | b54c9303300150697bb014987ff2216a12aaec36 | refs/heads/master | 2021-01-19T12:39:11.816296 | 2015-04-08T13:57:05 | 2015-04-08T13:57:05 | 32,884,556 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,464 | cpp | #include "NodeVisitor.hpp"
#include "Geometry.hpp"
#include "Group.hpp"
#include "Transform.hpp"
NodeVisitor::NodeVisitor(){}
NodeVisitor::~NodeVisitor(){}
/*
* Name: traverse
* Purpose: Given a node it will traverse its sub-tree depth first
* recursively. For each node it encounters it will call
* the nodes "accept visitor" method.
* Input: Node* node: the 'root node' to be traversed.
* Output: -
* Misc: -
*/
void NodeVisitor::traverse(Node* node)
{
init();
doTraverse(node);
cleanup();
}
void NodeVisitor::init()
{
}
void NodeVisitor::cleanup()
{
}
void NodeVisitor::doTraverse(Node* node)
{
// Inject itself into the node
node->acceptVisitor(*this);
// If the node is of type GROUP we traverse it's subtree if it
// is a GROUP
if(node->getType() == Node::GROUP )
{
Group* grpPtr =(Group*) node;
NodeList childList = grpPtr->childList;
for(NodeList::const_iterator ci = childList.begin(); ci != childList.end(); ci++)
{
doTraverse(*ci);
}
}
}
void NodeVisitor::apply(RenderToTexture* tex)
{
printf("Visiting RenderToTexture from NodeVisitor \n");
}
void NodeVisitor::apply(Geometry* g)
{
printf("Visiting Geometry from NodeVisitor \n");
}
void NodeVisitor::apply(Group* grp)
{
printf("Visiting Group from NodeVisitor\n");
}
void NodeVisitor::apply(Transform* t)
{
printf("Visiting Transform from NodeVisitor \n");
}
void NodeVisitor::apply(Camera* cam)
{
printf("Visiting Camera from NodeVisitor \n");
}
| [
"Jakob.Hariz@gmail.com"
] | Jakob.Hariz@gmail.com |
d6590bb844979cebaed68e017659bcc399ff2d61 | 6e87234e17265e147230ca030c86359949280a43 | /arduino/main/Thread.h | 53bdbc99ad89a15fd6a05fa464a34726d18bd3d3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | kurt-stolle/tue-dbl-venus | eadf0c4bc53b5ef01291fedcfd440e19b069005f | 3703a4ad293a271f7783bb5e5c7f91be246b1005 | refs/heads/master | 2021-05-31T23:34:07.536621 | 2016-06-19T15:01:10 | 2016-06-19T15:01:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | h | /*
* TU/e Venus OGO
* Thread
* Header
*/
#ifndef Thread_h
#define Thread_h
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include <inttypes.h>
class Thread{
protected:
// Desired interval between runs
unsigned long interval;
// Last runned time in Ms
unsigned long last_run;
// Scheduled run in Ms (MUST BE CACHED)
unsigned long _cached_next_run;
void runned(unsigned long time);
// Default is to mark it runned "now"
void runned() { runned(millis()); }
// Callback for run() if not implemented
void (*_onRun)(void);
public:
// If the current Thread is enabled or not
bool enabled;
// ID of the Thread (initialized from memory adr.)
int ThreadID;
#ifdef USE_THREAD_NAMES
// Thread Name (used for better UI).
String ThreadName;
#endif
Thread(void (*callback)(void) = NULL, unsigned long _interval = 0);
// Set the desired interval for calls, and update _cached_next_run
virtual void setInterval(unsigned long _interval);
// Return if the Thread should be runned or not
virtual bool shouldRun(unsigned long time);
// Default is to check whether it should run "now"
bool shouldRun() { return shouldRun(millis()); }
// Callback set
void onRun(void (*callback)(void));
// Runs Thread
virtual void run();
};
#endif
| [
"kurt@casualbananas.com"
] | kurt@casualbananas.com |
f9fa41a5e0ae124d08a3a238eec4afc02ca67c87 | 80a6dcd8e0e55b1ec225e4e82d8b1bed100fdcd5 | /DSA BITS/Tut 4 Searching/Tutorial Practice/stealing_galub_jamun.cpp | 9470ab20201dd414603f3c36bea927bd8b6a172e | [] | no_license | arnabs542/competitive-programming-1 | 58b54f54cb0b009f1dac600ca1bac5a4c1d7a523 | 3fa3a62277e5cd8a94d1baebb9ac26fe89211da3 | refs/heads/master | 2023-08-14T23:53:22.941834 | 2021-10-14T11:26:21 | 2021-10-14T11:26:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 796 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll m;
ll getWays(ll x){
ll ans = 0;
// for (ll i = 1; i <= x/8; i++)
// {
// ans += max((ll)0, (ll)floor(cbrt(x/i))-1);
// }
for (ll r = 2; r*r*r <= x; r++)
{
ans += (x/(r*r*r));
}
return ans;
}
void solve(){
cin>>m;
ll high = 1e18, low = 0, mid;
while(low<=high){
mid = low + (high-low)/2;
if(getWays(mid) < m){
low = mid+1;
} else{
high = mid-1;
}
}
if(getWays(low) == m){
cout<<low<<endl;
} else {
cout<<-1<<endl;
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
while(t--){
solve();
}
return 0;
} | [
"nandanwar.adarsh@gmail.com"
] | nandanwar.adarsh@gmail.com |
9d88050b58fe48a0ab4035de3b97289e3dfb8931 | e5dad8e72f6c89011ae030f8076ac25c365f0b5f | /caret_gui/GuiApplyDeformationMapDialog.h | 3979088b87e9735f1571e40589ab992be7ca3921 | [] | no_license | djsperka/caret | f9a99dc5b88c4ab25edf8b1aa557fe51588c2652 | 153f8e334e0cbe37d14f78c52c935c074b796370 | refs/heads/master | 2023-07-15T19:34:16.565767 | 2020-03-07T00:29:29 | 2020-03-07T00:29:29 | 122,994,146 | 0 | 1 | null | 2018-02-26T16:06:03 | 2018-02-26T16:06:03 | null | UTF-8 | C++ | false | false | 5,395 | h | /*LICENSE_START*/
/*
* Copyright 1995-2002 Washington University School of Medicine
*
* http://brainmap.wustl.edu
*
* This file is part of CARET.
*
* CARET 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.
*
* CARET 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 CARET; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*LICENSE_END*/
#ifndef __GUI_APPLY_DEFORMATION_MAP_DIALOG_H__
#define __GUI_APPLY_DEFORMATION_MAP_DIALOG_H__
#include <QString>
#include "WuQDialog.h"
#include "DeformationMapFile.h"
class BrainSet;
class DeformationMapFile;
class QCheckBox;
class QComboBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QDoubleSpinBox;
/// Class for dialog that applies a deformation map
class GuiApplyDeformationMapDialog : public WuQDialog {
Q_OBJECT
public:
/// Constructor
GuiApplyDeformationMapDialog(QWidget* parent, Qt::WindowFlags = 0);
/// Destructor
~GuiApplyDeformationMapDialog();
private slots:
/// called when apply button is pressed
void slotApplyButton();
/// called when deformation map button is pressed
void slotDeformationMapButton();
/// called when file pushbutton is pressed
void slotFileButton();
/// called when deformed file pushbutton is pressed
void slotDeformedFileButton();
/// called when source directory pushbutton is pressed
void slotSourceDirectoryButton();
/// called when target directory pushbutton is pressed
void slotTargetDirectoryButton();
/// called when atlas topo file button is pressed
void slotAtlasTopoFileButton();
/// called when iniv topo file button is pressed
void slotIndivTopoFileButton();
/// called when deformed topo file button is pressed
void slotDeformedTopoFileButton();
/// called when a file type is selected
void slotFileTypeComboBox(int item);
private:
enum FILE_DIALOG_TYPE {
FILE_DIALOG_ATLAS_TOPO_FILE,
FILE_DIALOG_DATA_FILE,
FILE_DIALOG_DEFORMED_FILE,
FILE_DIALOG_INDIV_TOPO_FILE,
FILE_DIALOG_DEFORMED_TOPO_FILE
};
/// data file dialog for data file and deformed file
void dataFileDialog(const FILE_DIALOG_TYPE fdt);
/// set the deformed file name
void setDeformedFileName(const FILE_DIALOG_TYPE fdt);
/// read the spec files
bool readBrains(QString& errorMessage);
/// deformation map file name line edit
QLineEdit* deformationMapFileLineEdit;
/// deformed column name prefix line edit
QLineEdit* deformedColumnNamePrefixLineEdit;
/// date file name line edit
QLineEdit* dataFileNameLineEdit;
/// deformed file name line edit
QLineEdit* deformedFileNameLineEdit;
/// file type combo box
QComboBox* fileTypeComboBox;
/// the File push button
QPushButton* filePushButton;
/// the deformed file push button
QPushButton* deformedFilePushButton;
/// the source brain set needed for some deformations
BrainSet* sourceBrainSet;
/// the target brain set needed for some deformations
BrainSet* targetBrainSet;
/// the deformation map file
DeformationMapFile deformationMapFile;
/// source directory pushbutton
QPushButton* sourceDirectoryPushButton;
/// target directory pushbutton
QPushButton* targetDirectoryPushButton;
/// directory line edit;
QLineEdit* sourceDirectoryLineEdit;
/// directory line edit;
QLineEdit* targetDirectoryLineEdit;
/// atlas topo file push button
QPushButton* atlasTopoFilePushButton;
/// atlas topo file line edit
QLineEdit* atlasTopoFileLineEdit;
/// indiv topo file push button
QPushButton* indivTopoFilePushButton;
/// indiv topo file line edit
QLineEdit* indivTopoFileLineEdit;
/// deformed topo file push button
QPushButton* deformedTopoFilePushButton;
/// deformed topo file line edit
QLineEdit* deformedTopoFileLineEdit;
/// flat coord max edge length
QDoubleSpinBox* flatCoordMaxEdgeLengthDoubleSpinBox;
/// flat coord max edge length label
QLabel* flatCoordMaxEdgeLengthLabel;
/// metric nearest node radio button
QRadioButton* metricNearestNodeRadioButton;
/// metric average tile nodes radio button
QRadioButton* metricAverageTileNodesRadioButton;
/// smooth deformed coord files
QCheckBox* smoothCoordsOneIterationCheckBox;
};
#endif // __GUI_APPLY_DEFORMATION_MAP_DIALOG_H__
| [
"michael.hanke@gmail.com"
] | michael.hanke@gmail.com |
afb55badf54c6d068d54f171381a349b1ba17d35 | 2a57de57d9613575fc6fe1ca385bc720ada9cfc0 | /AST/LabelStatement.h | 8b24db3498aa1cb11ea57650785e62d770c1f127 | [] | no_license | crappy-coder/mochica-js-llvm-compiler | a869e292ecfe080b061dfb515725b7aba48514fa | a44b4f8e80eb3855b88c2387502bb8b9734012f7 | refs/heads/master | 2021-05-31T02:39:38.962060 | 2016-01-26T07:16:06 | 2016-01-26T07:16:06 | 47,358,240 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 502 | h | #ifndef MOENJIN_AST_LABELSTATEMENT_H
#define MOENJIN_AST_LABELSTATEMENT_H
#include "Platform/Configuration.h"
#include "AST/Statement.h"
#include "AST/ThrowableExpression.h"
namespace MoEnjin
{
class LabelStatement : public Statement, public ThrowableExpression
{
public:
LabelStatement(mo_int32 lineNumber, const UTF8String& name, Statement* statement);
virtual const NodeType GetType() const { return NODE_LABEL; }
private:
UTF8String mName;
Statement* mStatement;
};
}
#endif | [
"justin.thomas@am.sony.com"
] | justin.thomas@am.sony.com |
f38eb3d38f7014a4408169635b847a386e210c45 | 4eb4242f67eb54c601885461bac58b648d91d561 | /third_part/indri5.6/ExtentDescendantNode.hpp | ecb1ef343474a59e1ef96774edc0a03aa4d03eb2 | [] | no_license | biebipan/coding | 630c873ecedc43a9a8698c0f51e26efb536dabd1 | 7709df7e979f2deb5401d835d0e3b119a7cd88d8 | refs/heads/master | 2022-01-06T18:52:00.969411 | 2018-07-18T04:30:02 | 2018-07-18T04:30:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,109 | hpp | /*==========================================================================
* Copyright (c) 2006 Carnegie Mellon University. All Rights Reserved.
*
* Use of the Lemur Toolkit for Language Modeling and Information Retrieval
* is subject to the terms of the software license set forth in the LICENSE
* file included with this software (and below), and also available at
* http://www.lemurproject.org/license.html
*
*==========================================================================
*/
//
// ExtentDescendantNode
//
// 31 Jan 2006 - pto
//
//
// Checks to make sure the inner node has an extent that matches the extent
// of a descendant of nodes whose extents matching the outer extent
//
#ifndef INDRI_EXTENTDESCENDANTNODE_HPP
#define INDRI_EXTENTDESCENDANTNODE_HPP
#include "ListIteratorNode.hpp"
#include "DocumentStructureHolderNode.hpp"
#include "greedy_vector"
#include "Extent.hpp"
namespace indri
{
namespace infnet
{
class ExtentDescendantNode : public ListIteratorNode {
ListIteratorNode* _inner;
ListIteratorNode* _outer;
DocumentStructureHolderNode & _docStructHolder;
indri::utility::greedy_vector<indri::index::Extent> _extents;
std::string _name;
std::set<int> _ancestors;
std::set<int> _leafs;
public:
ExtentDescendantNode( const std::string& name,
ListIteratorNode* inner,
ListIteratorNode* outer,
DocumentStructureHolderNode & documentStructureHolderNode );
void prepare( lemur::api::DOCID_T documentID );
const indri::utility::greedy_vector<indri::index::Extent>& extents();
lemur::api::DOCID_T nextCandidateDocument();
void indexChanged( indri::index::Index& index );
const std::string& getName() const;
void annotate( class Annotator& annotator, lemur::api::DOCID_T documentID, indri::index::Extent &extent );
const indri::utility::greedy_vector<indri::index::Extent>& matches( indri::index::Extent &extent );
};
}
}
#endif // INDRI_EXTENTDESCENDANTNODE_HPP
| [
"guoliqiang2006@126.com"
] | guoliqiang2006@126.com |
b49147ff69310dc0099e8f85cdcbe3a334765add | 501591e4268ad9a5705012cd93d36bac884847b7 | /src/server/scripts/Outland/terokkar_forest.cpp | 7c416c1657cfe038d6f29821e24feba16aad8755 | [] | no_license | CryNet/MythCore | f550396de5f6e20c79b4aa0eb0a78e5fea9d86ed | ffc5fa1c898d25235cec68c76ac94c3279df6827 | refs/heads/master | 2020-07-11T10:09:31.244662 | 2013-06-29T19:06:43 | 2013-06-29T19:06:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 37,472 | cpp | /*
* Copyright (C) 2008 - 2011 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2012 Myth Project <http://mythprojectnetwork.blogspot.com/>
*
* Myth Project's source is based on the Trinity Project source, you can find the
* link to that easily in Trinity Copyrights. Myth Project is a private community.
* To get access, you either have to donate or pass a developer test.
* You may not share Myth Project's sources! For personal use only.
*/
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
enum eCaptive
{
GO_VEIL_SKITH_CAGE = 185202,
GO_VEIL_SKITH_CAGE2 = 185203,
GO_VEIL_SKITH_CAGE3 = 185204,
GO_VEIL_SKITH_CAGE4 = 185205
};
class npc_captive_child : public CreatureScript
{
public:
npc_captive_child() : CreatureScript("npc_captive_child") { }
struct npc_captive_childAI : public ScriptedAI
{
npc_captive_childAI(Creature* pCreature) : ScriptedAI(pCreature) { }
uint32 FleeTimer;
void Reset()
{
FleeTimer = 0;
if(GameObject* cage = me->FindNearestGameObject(GO_VEIL_SKITH_CAGE, 5.0f))
{
if(cage)
cage->ResetDoorOrButton();
} else {
if(GameObject* cage = me->FindNearestGameObject(GO_VEIL_SKITH_CAGE2, 5.0f))
{
if(cage)
cage->ResetDoorOrButton();
} else {
if(GameObject* cage = me->FindNearestGameObject(GO_VEIL_SKITH_CAGE3, 5.0f))
{
if(cage)
cage->ResetDoorOrButton();
} else {
if(GameObject* cage = me->FindNearestGameObject(GO_VEIL_SKITH_CAGE4, 5.0f))
{
if(cage)
cage->ResetDoorOrButton();
}
}
}
}
}
void UpdateAI(const uint32 diff)
{
if(FleeTimer)
{
if(FleeTimer <= diff)
me->ForcedDespawn();
else
FleeTimer -= diff;
}
}
};
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_captive_childAI(pCreature);
}
};
enum SPrisoner
{
SAY_START = -1000716,
SAY_DONT_LIKE = -1000717,
SAY_COMPLETE = -1000718,
GO_PRISONER_CAGE = 185952,
QUEST_ESCAPE_FROM_SKETTIS = 11085
};
class npc_skyguard_prisoner : public CreatureScript
{
public:
npc_skyguard_prisoner(): CreatureScript ("npc_skyguard_prisoner") { }
bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const * pQuest)
{
if(pQuest->GetQuestId() == QUEST_ESCAPE_FROM_SKETTIS)
{
if(GameObject* pGo = pCreature->FindNearestGameObject(GO_PRISONER_CAGE, 10.0f))
pGo->UseDoorOrButton();
if(npc_skyguard_prisoner::npc_skyguard_prisonerAI* pEscortAI = CAST_AI(npc_skyguard_prisoner::npc_skyguard_prisonerAI, pCreature->AI()))
pEscortAI->StartEvent(pPlayer, pQuest);
}
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_skyguard_prisonerAI(pCreature);
}
struct npc_skyguard_prisonerAI : public npc_escortAI
{
npc_skyguard_prisonerAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void Reset() { }
uint32 CalculateWaypointID()
{
switch(me->GetGUIDLow())
{
case 1189307:
return 1;
break;
case 1189309:
return 2;
break;
default:
return 3;
break;
}
}
void StartEvent(Player* pPlayer, const Quest* pQuest)
{
switch(CalculateWaypointID())
{
case 1:
AddWaypoint(0, -4108.25f, 3032.18f, 344.799f, 3000);
AddWaypoint(1, -4114.41f, 3036.73f, 344.039f);
AddWaypoint(2, -4126.41f, 3026.07f, 344.156f);
AddWaypoint(3, -4145.17f, 3029.69f, 337.423f);
AddWaypoint(4, -4173.69f, 3035.72f, 343.346f);
AddWaypoint(5, -4173.70f, 3047.37f, 343.888f);
AddWaypoint(6, -4183.47f, 3060.62f, 344.157f, 3000);
AddWaypoint(7, -4179.13f, 3090.20f, 323.971f, 30000);
Start(false, false, pPlayer->GetGUID(), pQuest);
break;
case 2:
AddWaypoint(0, -3718.81f, 3787.24f, 302.890f, 3000);
AddWaypoint(1, -3714.44f, 3780.35f, 302.075f);
AddWaypoint(2, -3698.33f, 3788.04f, 302.171f);
AddWaypoint(3, -3679.36f, 3780.25f, 295.077f);
AddWaypoint(4, -3654.82f, 3770.43f, 301.291f);
AddWaypoint(5, -3656.07f, 3757.31f, 301.985f);
AddWaypoint(6, -3648.83f, 3743.07f, 302.173f, 3000);
AddWaypoint(7, -3659.16f, 3714.94f, 281.576f, 30000);
Start(false, false, pPlayer->GetGUID(), pQuest);
break;
case 3:
AddWaypoint(0, -3671.51f, 3385.36f, 312.956f, 3000);
AddWaypoint(1, -3677.74f, 3379.05f, 312.136f);
AddWaypoint(2, -3667.52f, 3366.45f, 312.233f);
AddWaypoint(3, -3672.87f, 3343.52f, 304.994f);
AddWaypoint(4, -3679.35f, 3319.01f, 311.419f);
AddWaypoint(5, -3692.93f, 3318.69f, 312.081f);
AddWaypoint(6, -3704.08f, 3309.56f, 312.233f, 3000);
AddWaypoint(7, -3733.99f, 3315.77f, 292.093f, 30000);
Start(false, false, pPlayer->GetGUID(), pQuest);
break;
}
return;
}
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
if(pPlayer)
switch(uiPointId)
{
case 0:
DoScriptText(SAY_START, me);
break;
case 6:
DoScriptText(SAY_DONT_LIKE, me);
break;
case 7:
DoScriptText(SAY_COMPLETE, me);
pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM_SKETTIS, me);
break;
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if(!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
enum NpcLetoll
{
SAY_LE_START = -1000725,
SAY_LE_KEEP_SAFE = -1000726,
SAY_LE_NORTH = -1000727,
SAY_LE_ARRIVE = -1000728,
SAY_LE_BURIED = -1000729,
SAY_LE_ALMOST = -1000730,
SAY_LE_DRUM = -1000731,
SAY_LE_DRUM_REPLY = -1000732,
SAY_LE_DISCOVERY = -1000733,
SAY_LE_DISCOVERY_REPLY = -1000734,
SAY_LE_NO_LEAVE = -1000735,
SAY_LE_NO_LEAVE_REPLY1 = -1000736,
SAY_LE_NO_LEAVE_REPLY2 = -1000737,
SAY_LE_NO_LEAVE_REPLY3 = -1000738,
SAY_LE_NO_LEAVE_REPLY4 = -1000739,
SAY_LE_SHUT = -1000740,
SAY_LE_REPLY_HEAR = -1000741,
SAY_LE_IN_YOUR_FACE = -1000742,
SAY_LE_HELP_HIM = -1000743,
EMOTE_LE_PICK_UP = -1000744,
SAY_LE_THANKS = -1000745,
QUEST_DIGGING_BONES = 10922,
NPC_RESEARCHER = 22464,
NPC_BONE_SIFTER = 22466,
MAX_RESEARCHER = 4
};
class npc_letoll : public CreatureScript
{
public:
npc_letoll() : CreatureScript("npc_letoll") { }
bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if(pQuest->GetQuestId() == QUEST_DIGGING_BONES)
{
if(npc_letollAI* pEscortAI = dynamic_cast<npc_letollAI*>(pCreature->AI()))
{
DoScriptText(SAY_LE_START, pCreature);
pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE);
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest, true);
}
}
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_letollAI(pCreature);
}
struct npc_letollAI : public npc_escortAI
{
npc_letollAI(Creature* pCreature) : npc_escortAI(pCreature)
{
m_uiEventTimer = 5000;
m_uiEventCount = 0;
Reset();
}
std::list<Creature*> m_lResearchersList;
uint32 m_uiEventTimer;
uint32 m_uiEventCount;
void Reset() { }
void SetFormation()
{
uint32 uiCount = 0;
for(std::list<Creature*>::iterator itr = m_lResearchersList.begin(); itr != m_lResearchersList.end(); ++itr)
{
float fAngle = uiCount < MAX_RESEARCHER ? M_PI/MAX_RESEARCHER - (uiCount*2*M_PI/MAX_RESEARCHER) : 0.0f;
if((*itr)->isAlive() && !(*itr)->isInCombat())
(*itr)->GetMotionMaster()->MoveFollow(me, 2.5f, fAngle);
++uiCount;
}
}
Creature* GetAvailableResearcher(uint8 uiListNum)
{
if(!m_lResearchersList.empty())
{
uint8 uiNum = 1;
for(std::list<Creature*>::iterator itr = m_lResearchersList.begin(); itr != m_lResearchersList.end(); ++itr)
{
if(uiListNum && uiListNum != uiNum)
{
++uiNum;
continue;
}
if((*itr)->isAlive() && (*itr)->IsWithinDistInMap(me, 20.0f))
return (*itr);
}
}
return NULL;
}
void JustStartedEscort()
{
m_uiEventTimer = 5000;
m_uiEventCount = 0;
m_lResearchersList.clear();
float x, y, z;
me->GetPosition(x, y, z);
CellPair pair(Trinity::ComputeCellPair(x, y));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(me, NPC_RESEARCHER, 25);
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me,m_lResearchersList, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()));
if(!m_lResearchersList.empty())
SetFormation();
}
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
if(!pPlayer)
return;
switch(uiPointId)
{
case 0:
if(pPlayer)
DoScriptText(SAY_LE_KEEP_SAFE, me, pPlayer);
break;
case 1:
DoScriptText(SAY_LE_NORTH, me);
break;
case 10:
DoScriptText(SAY_LE_ARRIVE, me);
break;
case 12:
DoScriptText(SAY_LE_BURIED, me);
SetEscortPaused(true);
break;
case 13:
DoScriptText(EMOTE_LE_PICK_UP, me);
if(pPlayer)
{
DoScriptText(SAY_LE_THANKS, me, pPlayer);
pPlayer->GroupEventHappens(QUEST_DIGGING_BONES, me);
}
SetRun();
break;
}
}
void Aggro(Unit* pWho)
{
if(pWho->isInCombat() && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_BONE_SIFTER)
DoScriptText(SAY_LE_HELP_HIM, me);
}
void JustSummoned(Creature* pSummoned)
{
Player* pPlayer = GetPlayerForEscort();
if(pPlayer && pPlayer->isAlive())
pSummoned->AI()->AttackStart(pPlayer);
else
pSummoned->AI()->AttackStart(me);
}
void UpdateEscortAI(const uint32 diff)
{
if(!UpdateVictim())
{
if(HasEscortState(STATE_ESCORT_PAUSED))
{
if(m_uiEventTimer < diff)
{
m_uiEventTimer = 7000;
switch(m_uiEventCount)
{
case 0:
DoScriptText(SAY_LE_ALMOST, me);
break;
case 1:
DoScriptText(SAY_LE_DRUM, me);
break;
case 2:
if(Creature* pResearcher = GetAvailableResearcher(0))
DoScriptText(SAY_LE_DRUM_REPLY, pResearcher);
break;
case 3:
DoScriptText(SAY_LE_DISCOVERY, me);
break;
case 4:
if(Creature* pResearcher = GetAvailableResearcher(0))
DoScriptText(SAY_LE_DISCOVERY_REPLY, pResearcher);
break;
case 5:
DoScriptText(SAY_LE_NO_LEAVE, me);
break;
case 6:
if(Creature* pResearcher = GetAvailableResearcher(1))
DoScriptText(SAY_LE_NO_LEAVE_REPLY1, pResearcher);
break;
case 7:
if(Creature* pResearcher = GetAvailableResearcher(2))
DoScriptText(SAY_LE_NO_LEAVE_REPLY2, pResearcher);
break;
case 8:
if(Creature* pResearcher = GetAvailableResearcher(3))
DoScriptText(SAY_LE_NO_LEAVE_REPLY3, pResearcher);
break;
case 9:
if(Creature* pResearcher = GetAvailableResearcher(4))
DoScriptText(SAY_LE_NO_LEAVE_REPLY4, pResearcher);
break;
case 10:
DoScriptText(SAY_LE_SHUT, me);
break;
case 11:
if(Creature* pResearcher = GetAvailableResearcher(0))
DoScriptText(SAY_LE_REPLY_HEAR, pResearcher);
break;
case 12:
DoScriptText(SAY_LE_IN_YOUR_FACE, me);
me->SummonCreature(NPC_BONE_SIFTER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 13:
SetEscortPaused(false);
break;
}
++m_uiEventCount;
} else m_uiEventTimer -= diff;
}
return;
}
DoMeleeAttackIfReady();
}
};
};
#define SAY_SUBMIT -1000194
#define FACTION_HOSTILE 45
#define FACTION_FRIENDLY 35
#define QUEST_DONTKILLTHEFATONE 9889
#define SPELL_PULVERIZE 2676
class item_terrokkar_fumper : public ItemScript
{
public:
item_terrokkar_fumper() : ItemScript("item_terrokkar_fumper") { }
bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
player->CastSpell(player, 39238, false);
if(player->GetQuestStatus(10929) == QUEST_STATUS_INCOMPLETE)
player->SummonCreature(22482, player->GetPositionX(), player->GetPositionY() - 1.2f, player->GetPositionZ() + 1.0f, 0.0, TEMPSUMMON_DEAD_DESPAWN, 120000);
return true;
}
};
class item_terrokkar_fumper_tbbw : public ItemScript
{
public:
item_terrokkar_fumper_tbbw() : ItemScript("item_terrokkar_fumper_tbbw") { }
bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
player->CastSpell(player, 39246, false);
if(player->GetQuestStatus(10930) == QUEST_STATUS_INCOMPLETE)
{
if(urand(0, 1))
player->SummonCreature(22038, player->GetPositionX(), player->GetPositionY() - 5.0f, player->GetPositionZ() + 1.0f, 0.0, TEMPSUMMON_DEAD_DESPAWN, 120000);
else
player->SummonCreature(22483, player->GetPositionX(), player->GetPositionY() - 1.2f, player->GetPositionZ() + 1.0f, 0.0, TEMPSUMMON_DEAD_DESPAWN, 120000);
}
return true;
}
};
class mob_unkor_the_ruthless : public CreatureScript
{
public:
mob_unkor_the_ruthless() : CreatureScript("mob_unkor_the_ruthless") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_unkor_the_ruthlessAI(pCreature);
}
struct mob_unkor_the_ruthlessAI : public ScriptedAI
{
mob_unkor_the_ruthlessAI(Creature* pCreature) : ScriptedAI(pCreature) { }
bool CanDoQuest;
uint32 UnkorUnfriendly_Timer;
uint32 Pulverize_Timer;
void Reset()
{
CanDoQuest = false;
UnkorUnfriendly_Timer = 0;
Pulverize_Timer = 3000;
me->SetStandState(UNIT_STAND_STATE_STAND);
me->setFaction(FACTION_HOSTILE);
}
void EnterCombat(Unit* /*pWho*/) { }
void DoNice()
{
DoScriptText(SAY_SUBMIT, me);
me->setFaction(FACTION_FRIENDLY);
me->SetStandState(UNIT_STAND_STATE_SIT);
me->RemoveAllAuras();
me->DeleteThreatList();
me->CombatStop(true);
UnkorUnfriendly_Timer = 60000;
}
void DamageTaken(Unit* done_by, uint32 &damage)
{
if(done_by->GetTypeId() == TYPEID_PLAYER)
if(me->HealthBelowPctDamaged(30, damage))
{
if(Group* pGroup = CAST_PLR(done_by)->GetGroup())
{
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupie = itr->getSource();
if(pGroupie &&
pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
{
pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
if(!CanDoQuest)
CanDoQuest = true;
}
}
} else if(CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
{
CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
CanDoQuest = true;
}
}
}
void UpdateAI(const uint32 diff)
{
if(CanDoQuest)
{
if(!UnkorUnfriendly_Timer)
DoNice();
else
{
if(UnkorUnfriendly_Timer <= diff)
{
EnterEvadeMode();
return;
} else UnkorUnfriendly_Timer -= diff;
}
}
if(!UpdateVictim())
return;
if(Pulverize_Timer <= diff)
{
DoCast(me, SPELL_PULVERIZE);
Pulverize_Timer = 9000;
} else Pulverize_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
class mob_infested_root_walker : public CreatureScript
{
public:
mob_infested_root_walker() : CreatureScript("mob_infested_root_walker") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_infested_root_walkerAI(pCreature);
}
struct mob_infested_root_walkerAI : public ScriptedAI
{
mob_infested_root_walkerAI(Creature* pCreature) : ScriptedAI(pCreature) { }
void Reset() { }
void EnterCombat(Unit* /*pWho*/) { }
void DamageTaken(Unit* done_by, uint32 &damage)
{
if(done_by && done_by->GetTypeId() == TYPEID_PLAYER)
if(me->GetHealth() <= damage)
if(rand()%100 < 75)
//Summon Wood Mites
DoCast(me, 39130, true);
}
};
};
class npc_skywing : public CreatureScript
{
public:
npc_skywing() : CreatureScript("npc_skywing") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_skywingAI(pCreature);
}
struct npc_skywingAI : public npc_escortAI
{
public:
npc_skywingAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if(!player)
return;
switch(i)
{
case 8:
player->AreaExploredOrEventHappens(10898);
break;
}
}
void EnterCombat(Unit* /*pWho*/) { }
void MoveInLineOfSight(Unit* who)
{
if(HasEscortState(STATE_ESCORT_ESCORTING))
return;
if(who->GetTypeId() == TYPEID_PLAYER)
{
if(CAST_PLR(who)->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0f;
if(me->IsWithinDistInMap(who, Radius))
{
Start(false, false, who->GetGUID());
}
}
}
}
void Reset() { }
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
};
class mob_rotting_forest_rager : public CreatureScript
{
public:
mob_rotting_forest_rager() : CreatureScript("mob_rotting_forest_rager") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_rotting_forest_ragerAI(pCreature);
}
struct mob_rotting_forest_ragerAI : public ScriptedAI
{
mob_rotting_forest_ragerAI(Creature* pCreature) : ScriptedAI(pCreature) { }
void Reset() { }
void EnterCombat(Unit* /*pWho*/) { }
void DamageTaken(Unit* done_by, uint32 &damage)
{
if(done_by->GetTypeId() == TYPEID_PLAYER)
if(me->GetHealth() <= damage)
if(rand()%100 < 75)
//Summon Lots of Wood Mights
DoCast(me, 39134, true);
}
};
};
#define QUEST_TARGET 22459
const uint32 netherwebVictims[6] =
{
18470, 16805, 21242, 18452, 22482, 21285
};
class mob_netherweb_victim : public CreatureScript
{
public:
mob_netherweb_victim() : CreatureScript("mob_netherweb_victim") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_netherweb_victimAI(pCreature);
}
struct mob_netherweb_victimAI : public ScriptedAI
{
mob_netherweb_victimAI(Creature* pCreature) : ScriptedAI(pCreature) { }
void Reset() { }
void EnterCombat(Unit* /*pWho*/) { }
void MoveInLineOfSight(Unit* /*pWho*/) { }
void JustDied(Unit* Killer)
{
if(Killer->GetTypeId() == TYPEID_PLAYER)
{
if(CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE)
{
if(rand()%100 < 25)
{
me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, 0);
}
else
me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
if(rand()%100 < 75)
me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
}
}
};
};
#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
#define GOSSIP_FLOON2 "Hand over the money or die...again!"
enum eFloon
{
SAY_FLOON_ATTACK = -1000195,
SPELL_SILENCE = 6726,
SPELL_FROSTBOLT = 9672,
SPELL_FROST_NOVA = 11831,
FACTION_HOSTILE_FL = 1738,
QUEST_CRACK_SKULLS = 10009
};
class npc_floon : public CreatureScript
{
public:
npc_floon() : CreatureScript("npc_floon") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if(uiAction == GOSSIP_ACTION_INFO_DEF)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9443, creature->GetGUID());
}
if(uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
creature->setFaction(FACTION_HOSTILE_FL);
DoScriptText(SAY_FLOON_ATTACK, creature, player);
creature->AI()->AttackStart(player);
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if(player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(9442, creature->GetGUID());
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_floonAI(pCreature);
}
struct npc_floonAI : public ScriptedAI
{
npc_floonAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_uiNormFaction = pCreature->getFaction();
}
uint32 m_uiNormFaction;
uint32 Silence_Timer;
uint32 Frostbolt_Timer;
uint32 FrostNova_Timer;
void Reset()
{
Silence_Timer = 2000;
Frostbolt_Timer = 4000;
FrostNova_Timer = 9000;
if(me->getFaction() != m_uiNormFaction)
me->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit* /*pWho*/) { }
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
if(Silence_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 30000;
} else Silence_Timer -= diff;
if(FrostNova_Timer <= diff)
{
DoCast(me, SPELL_FROST_NOVA);
FrostNova_Timer = 20000;
} else FrostNova_Timer -= diff;
if(Frostbolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 5000;
} else Frostbolt_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
enum eIslaStarmaneData
{
SAY_PROGRESS_1 = -1000571,
SAY_PROGRESS_2 = -1000572,
SAY_PROGRESS_3 = -1000573,
SAY_PROGRESS_4 = -1000574,
QUEST_EFTW_H = 10052,
QUEST_EFTW_A = 10051,
GO_CAGE = 182794,
SPELL_CAT = 32447,
};
class npc_isla_starmane : public CreatureScript
{
public:
npc_isla_starmane() : CreatureScript("npc_isla_starmane") { }
struct npc_isla_starmaneAI : public npc_escortAI
{
npc_isla_starmaneAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if(!player)
return;
switch(i)
{
case 0:
{
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10);
if(Cage)
Cage->SetGoState(GO_STATE_ACTIVE);
}
break;
case 2: DoScriptText(SAY_PROGRESS_1, me, player); break;
case 5: DoScriptText(SAY_PROGRESS_2, me, player); break;
case 6: DoScriptText(SAY_PROGRESS_3, me, player); break;
case 29:DoScriptText(SAY_PROGRESS_4, me, player);
if(player)
{
if(player->GetTeam() == ALLIANCE)
player->GroupEventHappens(QUEST_EFTW_A, me);
else if(player->GetTeam() == HORDE)
player->GroupEventHappens(QUEST_EFTW_H, me);
}
me->SetInFront(player); break;
case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case 31: DoCast(me, SPELL_CAT);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
}
}
void Reset()
{
me->RestoreFaction();
}
void JustDied(Unit* /*pKiller*/)
{
if(Player* player = GetPlayerForEscort())
{
if(player->GetTeam() == ALLIANCE)
player->FailQuest(QUEST_EFTW_A);
else if(player->GetTeam() == HORDE)
player->FailQuest(QUEST_EFTW_H);
}
}
};
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{
if(quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
{
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
creature->setFaction(113);
}
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_isla_starmaneAI(pCreature);
}
};
#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai"
#define GOSSIP_S_KARROG "Summon Karrog"
#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress"
#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager"
class go_skull_pile : public GameObjectScript
{
public:
go_skull_pile() : GameObjectScript("go_skull_pile") { }
bool OnGossipSelect(Player* player, GameObject* pGo, uint32 uiSender, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch(uiSender)
{
case GOSSIP_SENDER_MAIN: SendActionMenu(player, pGo, uiAction); break;
}
return true;
}
bool OnGossipHello(Player* player, GameObject* pGo)
{
if((player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(11885))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
}
player->SEND_GOSSIP_MENU(pGo->GetGOInfo()->questgiver.gossipID, pGo->GetGUID());
return true;
}
void SendActionMenu(Player* player, GameObject* /*pGo*/, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
player->CastSpell(player, 40642, false);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
player->CastSpell(player, 40640, false);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
player->CastSpell(player, 40632, false);
break;
case GOSSIP_ACTION_INFO_DEF + 4:
player->CastSpell(player, 40644, false);
break;
}
}
};
enum eSlim
{
FACTION_CONSORTIUM = 933
};
class npc_slim : public CreatureScript
{
public:
npc_slim() : CreatureScript("npc_slim") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if(uiAction == GOSSIP_ACTION_TRADE)
player->GetSession()->SendListInventory(creature->GetGUID());
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if(creature->isVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
player->SEND_GOSSIP_MENU(9896, creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(9895, creature->GetGUID());
return true;
}
};
enum eAkuno
{
QUEST_ESCAPING_THE_TOMB = 10887,
NPC_CABAL_SKRIMISHER = 21661
};
class npc_akuno : public CreatureScript
{
public:
npc_akuno() : CreatureScript("npc_akuno") { }
bool OnQuestAccept(Player* player, Creature* creature, Quest const* pQuest)
{
if(pQuest->GetQuestId() == QUEST_ESCAPING_THE_TOMB)
{
if(npc_akunoAI* pEscortAI = CAST_AI(npc_akuno::npc_akunoAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID());
if(player->GetTeamId() == TEAM_ALLIANCE)
creature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
else
creature->setFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE);
}
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_akunoAI(pCreature);
}
struct npc_akunoAI : public npc_escortAI
{
npc_akunoAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if(!player)
return;
switch(i)
{
case 3:
me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 11:
if(player && player->GetTypeId() == TYPEID_PLAYER)
player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me);
break;
}
}
void JustSummoned(Creature* summon)
{
summon->AI()->AttackStart(me);
}
};
};
class go_mana_bomb : public GameObjectScript
{
public:
go_mana_bomb() : GameObjectScript("go_mana_bomb") { }
bool OnGossipHello(Player* pPlayer, GameObject* /*pGo*/)
{
if(pPlayer->GetQuestStatus(10446) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10447) == QUEST_STATUS_INCOMPLETE)
pPlayer->KilledMonsterCredit(21039, 0);
return true;
}
};
void AddSC_terokkar_forest()
{
new npc_letoll;
new npc_captive_child;
new npc_skyguard_prisoner;
new item_terrokkar_fumper;
new item_terrokkar_fumper_tbbw;
new mob_unkor_the_ruthless;
new mob_infested_root_walker;
new mob_rotting_forest_rager;
new mob_netherweb_victim;
new npc_floon;
new npc_isla_starmane;
new go_skull_pile;
new npc_skywing;
new npc_slim;
new npc_akuno;
new go_mana_bomb;
}
| [
"vitasic-pokataev@yandex.ru"
] | vitasic-pokataev@yandex.ru |
3aa93db9b2ac304a29d229442c7303e8eb83646a | 75b2a3741dc81df4d4db11600b1b1d3186a51d47 | /DataStructur&Algorithm/Recursion/Last Index of Number.cpp | baafcc9c0bc5e3aaaa496e6528a158fcad7af413 | [] | no_license | shivdeep1/CodingNinja | c397bcdaa6ed7c4aafbf78db2407c9005e26c5d7 | 76c4aff8f94c7953f83f29f201a830e95539931b | refs/heads/master | 2020-07-22T10:49:51.215559 | 2019-10-10T13:53:35 | 2019-10-10T13:53:35 | 207,173,548 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,117 | cpp | Ques::
Given an array of length N and an integer x, you need to find and return the last index of integer x present in the array. Return -1 if it is not present in the array.
Last index means - if x is present multiple times in the array, return the index at which x comes last in the array.
You should start traversing your array from 0, not from (N - 1).
Do this recursively. Indexing in the array starts from 0.
Input Format :
Line 1 : An Integer N i.e. size of array
Line 2 : N integers which are elements of the array, separated by spaces
Line 3 : Integer x
Output Format :
last index or -1
Constraints :
1 <= N <= 10^3
Sample Input :
4
9 8 10 8
8
Sample Output :
3
SOl::
int lastIndex(int input[], int size, int x) {
/* Don't write main().
Don't read input, it is passed as function argument.
Return output and don't print it.
Taking input and printing output is handled automatically.
*/
if(size==0)
return -1;
int first=lastIndex(input+1,size-1,x);
if(first != -1)
return first +1;
if(input[0]==x)
return 0;
else
return -1;
}
| [
"shivdeepsachdeva@gmail.com"
] | shivdeepsachdeva@gmail.com |
314b7ea13c1152b3631b00af8fda28dd36809767 | b2ad8c27e10aa305c5118fe48a356b19c71a40df | /src/framework/Network/SHReleaseMgr.inl | 5ca48810b7cc8ff59c9240e9388ebe095afd6d95 | [] | no_license | gogo111007/Server | 4972f8244873e097daf7a3021bd2f5fef1f41070 | dddf41985c8b4990c5196bb930d876afda9d49a4 | refs/heads/master | 2021-01-01T16:40:39.862652 | 2013-06-25T13:15:44 | 2013-06-25T13:15:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 582 | inl | template <typename T>
SHReleaseMgr<T>::SHReleaseMgr(void (*pReleaseFunction)(T*)):
m_pReleaseFunction(pReleaseFunction)
{
}
template <typename T>
SHReleaseMgr<T>::~SHReleaseMgr()
{
for (uint32 i = 0; i < (uint32)m_pReleaseQueue.size(); ++i)
{
if (*m_pReleaseQueue.at(i))
{
if (m_pReleaseFunction)
m_pReleaseFunction(*m_pReleaseQueue.at(i));
else
delete *m_pReleaseQueue.at(i);
}
}
}
template <typename T>
void SHReleaseMgr<T>::add(T **ppVar)
{
m_pReleaseQueue.push_back(ppVar);
}
| [
"chglove@live.cn"
] | chglove@live.cn |
796ac3cd92996159d75aa5b6f34e2c4614422e27 | 7893b297dd2cee6c06cdab3398e59440338e4a24 | /cpp-Programare2/lab9/Carte.h | 481578a2423c44a160507f3a4d5edbd0f38956e2 | [] | no_license | zaticpetru/learnGit | 5fbf8b41c9f16eb540cdaf716db9c8fd710a3d67 | 96f9bca5661898906bd24d1afd8041cfdd900ba2 | refs/heads/main | 2023-06-03T18:51:58.343891 | 2021-06-21T20:26:05 | 2021-06-21T20:26:05 | 344,741,379 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | h | #ifndef CARTE_H
#define CARTE_H
#include <iostream>
#include <cstring>
using namespace std;
class Carte{
char *autor = nullptr;
public:
char *titlu = nullptr;
Carte(char * = nullptr, char * = nullptr);
Carte(const Carte &);
~Carte();
Carte &operator=(const Carte &);
friend istream &operator>>(istream &, Carte &);
friend ostream &operator<<(ostream &, Carte &);
};
#endif | [
"zatic.petru@outlook.com"
] | zatic.petru@outlook.com |
1c0e16bf7e3ead8cceb8700a75d61ffb532c9d1a | 6ed471f36e5188f77dc61cca24daa41496a6d4a0 | /SDK/DmgType_Melee_DmgMetal_classes.h | ce365fe85484e65e22a1c72246029310de222711 | [] | no_license | zH4x-SDK/zARKSotF-SDK | 77bfaf9b4b9b6a41951ee18db88f826dd720c367 | 714730f4bb79c07d065181caf360d168761223f6 | refs/heads/main | 2023-07-16T22:33:15.140456 | 2021-08-27T13:40:06 | 2021-08-27T13:40:06 | 400,521,086 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h | #pragma once
// Name: ARKSotF, Version: 178.8.0
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass DmgType_Melee_DmgMetal.DmgType_Melee_DmgMetal_C
// 0x0000 (0x00E8 - 0x00E8)
class UDmgType_Melee_DmgMetal_C : public UShooterDamageType
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass DmgType_Melee_DmgMetal.DmgType_Melee_DmgMetal_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
f0f834413f4ac3d263f42103e8cddb59d5dff71e | a3b426c756f88a7816d1b84df1909e77dad30b49 | /D2DFrame/D2DGraphicsList.h | 9a17ad469405b5275c532aca20165cdc207b56b1 | [] | no_license | Lin-Guanguo/D2DFrame | 8a1ae6954cc951601d257973b93fc7b75c038aca | 72733eb142b03a8483cede7cf70f4d381aa4b957 | refs/heads/master | 2023-02-25T00:46:41.831341 | 2021-01-29T06:25:39 | 2021-01-29T11:29:48 | 333,745,930 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,555 | h | #pragma once
#include "WeakPtrList.h"
namespace LGG
{
class ID2DGraphics;
class D2DGraphicsList : public WeakPtrList<ID2DGraphics>
{
private:
CComPtr<ID2D1Factory> mFactory;
CComPtr<ID2D1HwndRenderTarget> mRenderTarget;
D2D1_SIZE_U mSizeofRenderTarget;
public:
D2DGraphicsList(D2D1_SIZE_U renderTargetSize = {100u, 100u});
~D2DGraphicsList();
//建立 工厂 和 设备无关资源
void initialization();
//改变renderTarget的大小
//renderTarget会自动拉伸至覆盖整个窗口,
//若不希望有拉伸效果可在 WM_SIZE 中调用该方法 resize
void resize(D2D1_SIZE_U size);
void render(HWND hwnd);
//根据 DPI 和 窗口大小与渲染目标大小比例 转换坐标
//使用场景: 渲染目标 相比于 窗口 有拉伸
D2D1_POINT_2F pointWindowToRenderTargetRate(HWND hwnd);
//根据 DPI 转换坐标
//使用场景: 渲染目标大小和窗口大小一致, 坐标转换只关乎DPI
static float dpiWindowToRenderTargetRate(HWND hwnd);
private:
//建立 设备无关的资源, 只会被initialization()调用一次
void createDeviceIndependentResources();
//释放 设备无关的资源, 只会被~D2DGraphicsList()调用一次
void discardDeviceIndependentResources();
//建立 设备依赖的资源, 当设备变化时(初始化时)被调用
void createDeviceDependentResources(HWND hwnd);
//释放 设备依赖的资源, 当设备变化时(析构时)被调用
void discardDeviceDependentResources();
};
}
| [
"lin.guanguo@foxmail.com"
] | lin.guanguo@foxmail.com |
b401e3554c790202aa9ce420bc20d8d2814e03eb | 15419e6b114d5b89e78648dbae52a0aae276b673 | /UVa/Comptitive Programming/Ch-06 String Processing/01 - Cryptography/UVa 213 - Message Decoding - AC.cpp | 63d30013c970a0e6c7138143d9c44a63196bda49 | [] | no_license | ImnIrdst/ICPC-Practice-2015-TiZii | 7cde07617d8ebf90dc8a4baec4d9faec49f79d13 | 73bb0f84e7a003e154d685fa598002f8b9498878 | refs/heads/master | 2021-01-10T16:29:34.490848 | 2016-04-08T04:13:37 | 2016-04-08T04:13:37 | 55,749,815 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,241 | cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
int pow2[11] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 };
string genSeq(int n, int len){
string seq = "";
if (!n) seq += "0";
while (n){
seq = char('0' + n % 2) + seq; n /= 2;
}
while (seq.length() != len) seq = "0" + seq;
return seq;
}
int isAllOne(const string& str){
for (int i = 0; i < str.length(); i++){
if (str[i] == '0') return false;
}
return true;
}
int main(){
string line;
while (getline(cin, line)){
map<string, char> mp;
string seq = "0"; mp[seq] = line[0];
int i = 0;
for (int len = 1; len <= 7 && i<line.length(); len++){
for (int j = 0; j < pow2[len] - 1 && i<line.length(); j++){
mp[genSeq(j, len)] = line[i]; i++;
}
}
string ans;
char dig;
while (true){
int len = 0;
cin >> dig; len = len * 2 + (dig - '0');
cin >> dig; len = len * 2 + (dig - '0');
cin >> dig; len = len * 2 + (dig - '0');
if (len == 0) break;
while (true){
string seq;
for (int i = 0; i < len; i++){
cin >> dig; seq += dig;
}
if (isAllOne(seq)) break;
ans+=mp[seq];
}
}
cout << ans << endl;
getline(cin, line);
}
} | [
"imn.irdst@gmail.com"
] | imn.irdst@gmail.com |
b055a298bf8f656963d33d8a486fa49b578be8d6 | bb53b2a844e9cc0d2554e6a12dd99de79ddc40ca | /NES/Mapper/Mapper164.cpp | 432f7228d0f1df6096513a0445cb8125ae986a09 | [] | no_license | Chunde/VirtualNES | f71512f75e63582893206efb3f83dc09e63a5166 | 55264b0d0add97b4e3d425f14ec113e214068f1b | refs/heads/master | 2020-04-17T16:01:41.688505 | 2019-01-21T00:14:58 | 2019-01-21T00:14:58 | 166,723,369 | 8 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,679 | cpp | //////////////////////////////////////////////////////////////////////////
// Mapper164 Pocket Monster Gold //
//////////////////////////////////////////////////////////////////////////
void Mapper164::Reset()
{
reg5000 = 0;
reg5100 = 0;
SetBank_CPU();
SetBank_PPU();
nes->ppu->SetExtLatchMode( TRUE );
}
void Mapper164::WriteLow(WORD addr, BYTE data)
{
if(addr==0x5000){
p_mode = data>>7;
reg5000 = data;
SetBank_CPU();
SetBank_PPU();
}else if(addr==0x5100){
reg5100 = data;
SetBank_CPU();
SetBank_PPU();
}else if(addr>=0x6000){
CPU_MEM_BANK[addr>>13][addr&0x1FFF] = data;
}else{
DEBUGOUT("write to %04x:%02x\n", addr, data);
}
}
void Mapper164::SetBank_CPU()
{
int mode, base, bank;
base = (reg5100&1)<<5;
mode = (reg5000>>4)&0x07;
switch(mode){
case 0:
case 2:
case 4:
case 6: /* NORMAL MODE */
bank = (reg5000&0x0f);
bank += (reg5000&0x20)>>1;
SetPROM_16K_Bank(4, bank+base);
SetPROM_16K_Bank(6, base+0x1f);
DEBUGOUT("-- normal mode: mode=%d, bank=%d --\n", mode, bank);
break;
case 1:
case 3: /* REG MODE */
DEBUGOUT("-- reg mode --\n");
break;
case 5: /* 32K MODE */
bank = (reg5000&0x0f);
SetPROM_32K_Bank(bank+(base>>1));
// DEBUGOUT("-- 32K MODE: bank=%02x --\n", bank);
break;
case 7: /* HALF MODE */
bank = (reg5000&0x0f);
bank += (bank&0x08)<<1;
SetPROM_16K_Bank(4, bank+base);
bank = (bank&0x10)+0x0f;
SetPROM_16K_Bank(6, base+0x1f);
DEBUGOUT("-- half mode --\n");
break;
default:
break;
};
}
void Mapper164::SetBank_PPU()
{
SetCRAM_8K_Bank(0);
}
void Mapper164::PPU_ExtLatchX( INT x )
{
a3 = (x&1)<<3;
}
void Mapper164::PPU_ExtLatch( WORD ntbladr, BYTE& chr_l, BYTE& chr_h, BYTE& attr )
{
INT loopy_v = nes->ppu->GetPPUADDR();
INT loopy_y = nes->ppu->GetTILEY();
INT tileofs = (PPUREG[0]&PPU_BGTBL_BIT)<<8;
INT attradr = 0x23C0+(loopy_v&0x0C00)+((loopy_v&0x0380)>>4);
INT attrsft = (ntbladr&0x0040)>>4;
LPBYTE pNTBL = PPU_MEM_BANK[ntbladr>>10];
INT ntbl_x = ntbladr&0x001F;
INT tileadr;
attradr &= 0x3FF;
attr = ((pNTBL[attradr+(ntbl_x>>2)]>>((ntbl_x&2)+attrsft))&3)<<2;
tileadr = tileofs+pNTBL[ntbladr&0x03FF]*0x10+loopy_y;
if(p_mode){
tileadr = (tileadr&0xfff7)|a3;
chr_l = chr_h = PPU_MEM_BANK[tileadr>>10][ tileadr&0x03FF ];
}else{
chr_l = PPU_MEM_BANK[tileadr>>10][ tileadr&0x03FF ];
chr_h = PPU_MEM_BANK[tileadr>>10][(tileadr&0x03FF)+8];
}
}
void Mapper164::SaveState( LPBYTE p )
{
p[0] = reg5000;
p[1] = reg5100;
p[2] = a3;
p[3] = p_mode;
}
void Mapper164::LoadState( LPBYTE p )
{
reg5000 = p[0];
reg5100 = p[1];
a3 = p[2];
p_mode = p[3];
}
| [
"xmuhcd@msn.com"
] | xmuhcd@msn.com |
dc44f731f96136dad5cf08efa06c2be12d897aaa | dc378b4ef06191c7cde2b8d24ab5771bd6a8b7be | /MTTStudies/MTTDigiProducer/interface/MTTSimTriv.h | 7bb14abe158bbfeda8404d6f7d0a0c0d3444f264 | [] | no_license | Yerdogan/UserCode | a367e69a831a897b298dffbe58cbd0ffccf69ddc | 1e7331c3e78fb3e199d8fc11c7c139c4202a4114 | refs/heads/master | 2021-01-11T11:03:09.084760 | 2013-03-27T15:23:58 | 2013-03-27T15:23:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 659 | h | #ifndef MTTDigitizer_MTTSimTriv_h
#define MTTDigitizer_MTTSimTriv_h
#include "MTTStudies/MTTDigiProducer/interface/MTTSim.h"
class MTTGeometry;
namespace CLHEP {
class HepRandomEngine;
class RandFlat;
class RandPoissonQ;
}
class MTTSimTriv: public MTTSim {
public:
MTTSimTriv(const edm::ParameterSet& config);
~MTTSimTriv();
void simulate(const MTTTile* tile, const edm::PSimHitContainer& mttHits);
void setRandomEngine(CLHEP::HepRandomEngine& eng);
private:
void init() {
}
;
// CLHEP::HepRandomEngine* rndEngine;
CLHEP::RandFlat* flatDistribution1;
CLHEP::RandFlat* flatDistribution2;
CLHEP::RandPoissonQ *poissonDistribution;
};
#endif
| [
""
] | |
162be84abb8c6fc099a052001da8fad979ec2469 | ad280cce328d196eb11e16b2740ea971ad6aa9f0 | /math/poj2409.cpp | a31cb29fcb0a583e7cbf6ab89cd2a5596b82723d | [] | no_license | elite-sheep/icpcarchive | 3ea6869e50b5df54cb37ef6ed0cd15f725cf982d | caa090aec363220efafe7b77a2c64b1d4c0f3869 | refs/heads/master | 2022-03-28T10:10:35.276417 | 2020-01-01T04:57:53 | 2020-01-01T04:57:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 908 | cpp | /*************************************************************************
> File Name: poj2409.cpp
> Author: Yuchen Wang
> Mail: wyc8094@gmail.com
> Created Time: Sat Feb 25 20:49:28 2017
************************************************************************/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
int n,m;
int gcd(int a,int b)
{
if(!b)return a;
else return gcd(b,a%b);
}
LL quickpow(int a,int b)
{
LL res = 1;
while(b){
if(b&1)res *= a;
a = a*a;
b = b>>1;
}
return res;
}
int main()
{
LL ans;
int i;
while(scanf("%d%d",&m,&n)!=EOF){
if(!n && !m)break;
ans = 0;
for(i=0;i<n;i++)
ans += quickpow(m,gcd(n,i));
if(n&1)
ans += n*quickpow(m,(n+1)/2);
else{
ans += (n>>1)*quickpow(m,n/2);
ans += (n>>1)*quickpow(m,(n+2)/2);
}
ans /= 2*n;
cout << ans << endl;
}
}
| [
"wyc8094@gmail.com"
] | wyc8094@gmail.com |
a771ae718f087bf04383fa67befb15329b82ee75 | a21fa6a50e28fb7e25f06a39dab474095c5eb7f0 | /SDL_Project/Scene0.cpp | e6b32145b447b0c795a30472d47c32fe3b19a122 | [] | no_license | WarnockN/GameProductionsSDLPlatformer | 595ff4e6dedc2de1b46bb9fb463f171728ce686d | 8e1589cca9a0fdc8f99100269ae0a7b9315a5ab7 | refs/heads/master | 2020-12-22T16:38:21.798681 | 2020-01-28T23:52:42 | 2020-01-28T23:52:42 | 236,860,848 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,693 | cpp | #include "Scene0.h"
#include <SDL.h>
#include <SDL_Image.h>
#include "Body.h"
#include "Ball.h"
Scene0::Scene0(SDL_Window* sdlWindow_){
window = sdlWindow_;
}
Scene0::~Scene0(){}
bool Scene0::OnCreate() {
int w, h;
SDL_GetWindowSize(window,&w,&h);
Matrix4 ndc = MMath::viewportNDC(w,h);
Matrix4 ortho = MMath::orthographic(0.0, 200.0, 0.0, 50.0, 0.0, 1.0);
projection = ndc * ortho;
jetski = new Body(Vec3(0.0f, 20.0f, 0.0f), Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 0.0f, 0.0f), 200.0f, 0.0f, 1.0f);
jetskiImage = IMG_Load("jetski.png");
return true;
}
void Scene0::OnDestroy() {
delete jetski;
jetski = nullptr;
}
void Scene0::HandleEvents(const SDL_Event& event) {
}
void Scene0::Update(const float time) {
jetski->Update(time);
timer += time;
if (timer < 5.5f) {
jetski->ApplyForce(Vec3(500.0f, 0.0f, 0.0f));
}
else if (timer >= 5.5f && timer < 10.0f) {
jetski->ApplyForce(Vec3(0.0f, 0.0f, 0.0f));
}
else if (timer >= 10.0f && timer < 13.5f) {
jetski->ApplyForce(Vec3(-625.0f, 0.0f, 0.0f));
}
else if (timer >= 19.19 && timer < 10.03f) {
jetski ->ApplyForce(Vec3(0.0f, 0.0f, 0.0f));
}
else if (jetski->GetVel().x <= 0.0f) {
jetski->ApplyForce(Vec3(0.0f, 0.0f, 0.0f));
jetski->SetVel(0.0f);
}
}
void Scene0::Render() {
Vec3 pos = jetski->GetPos();
Vec3 screenPos = projection * pos;
SDL_Rect dstrect;
dstrect.x = static_cast<int>(screenPos.x);
dstrect.y = static_cast<int>(screenPos.y);
SDL_Surface* screenSurface = SDL_GetWindowSurface(window);
SDL_FillRect(screenSurface, nullptr, SDL_MapRGB(screenSurface->format, 255, 142, 26));
SDL_BlitSurface(jetskiImage, nullptr, screenSurface, &dstrect);
SDL_UpdateWindowSurface(window);
}
| [
"54872390+WarnockN@users.noreply.github.com"
] | 54872390+WarnockN@users.noreply.github.com |
ae0522cd204528b7f64c8701e15ea97ba53588e1 | 23c3927ce1b8500f75eed7cc7f6d377684197f51 | /apps/forward_renderer/Light.hpp | 1e69710ae6589f97ab55ed2bc35ae551ea469244 | [] | no_license | quentinCo/opengl-avance | 5d3cbd0c1c369f2c9384f074db359c201026c110 | 3e31bfecbd90aac23e6d688d0e88b095c2ad4229 | refs/heads/master | 2021-04-29T04:37:45.760459 | 2017-01-17T20:50:35 | 2017-01-17T20:50:35 | 77,994,289 | 0 | 0 | null | 2017-01-04T09:04:39 | 2017-01-04T07:57:39 | C++ | UTF-8 | C++ | false | false | 545 | hpp | #pragma once
#include <glmlv/GLProgram.hpp>
#include <glmlv/simple_geometry.hpp>
namespace qc
{
class Light
{
public:
Light() {};
Light(const glm::vec3& pos, float intensity)
: lightPosition(pos), lightIntensity(intensity)
{}
const glm::vec3& getLightPosition() const
{return lightPosition;}
glm::vec3& getLightPosition()
{return lightPosition;}
float getLightIntensity() const
{return lightIntensity;}
float& getLightIntensity()
{return lightIntensity;}
private:
glm::vec3 lightPosition;
float lightIntensity;
};
} | [
"quentin.couillard@gmail.com"
] | quentin.couillard@gmail.com |
9ee81876f27e8dcb8074cad67ba21d02439f515f | 6006085975601a021ba2177071b286c1225ece6a | /Game.cpp | 6e78fac178a91fea441161fb2d3cc1d19cb65bc9 | [] | no_license | RyanSwann1/PongSDL2 | d5d1967bf34e45019c5ef1d67ee10ca1b11c9c33 | b580d184487e1b6b061ad310496776d0bc24de5c | refs/heads/master | 2021-01-01T04:46:12.203125 | 2016-04-16T13:29:36 | 2016-04-16T13:29:36 | 56,355,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,616 | cpp | #include "Game.h"
#include "InputHandler.h"
#include "GameStateMachine.h"
#include "MenuState.h"
#include "PlayState.h"
#include "TextureManager.h"
#include "Player.h"
#include "Opponent.h"
#include "Ball.h"
#include <assert.h>
#include <iostream>
Game* Game::m_instance = nullptr;
Game::Game()
{
std::cout << "Game Running.";
}
Game::~Game()
{
}
Game * Game::instance()
{
if (m_instance == nullptr) {
m_instance = new Game();
}
return m_instance;
}
bool Game::init(const char* title, int sizeWidth, int sizeHeight)
{
//Initialize SDL Video
SDL_INIT_VIDEO;
//Initialize SDL Window
m_window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, sizeWidth, sizeHeight, SDL_WINDOW_SHOWN);
assert(m_window != nullptr);
//Create window surface
m_windowSurface = SDL_GetWindowSurface(m_window);
assert(m_windowSurface != nullptr);
//Initialize Renderer
m_renderer = SDL_CreateRenderer(m_window, -1, SDL_RENDERER_PRESENTVSYNC);
assert(m_renderer != nullptr);
//Set current state to the menu state
m_currentGameState = GameStates::MENU;
std::cout << "Before INIT State.\n";
//Initialize the menu state
m_gameStateMachine = new GameStateMachine();
m_gameStateMachine->changeState(new MenuState());
std::cout << "After INIT State.\n";
//Load all game textures
TextureManager::instance()->load("Player", "Paddle.BMP");
TextureManager::instance()->load("Ball", "Ball.BMP");
TextureManager::instance()->load("Opponent", "Paddle.BMP");
//Initiazzation has been successful
m_running = true;
return true;
}
void Game::handleEvents()
{
InputHandler::instance()->update();
if (InputHandler::instance()->isKeyDown(SDL_SCANCODE_RETURN)) {
m_gameStateMachine->changeState(new PlayState());
}
else if (InputHandler::instance()->isKeyDown(SDL_SCANCODE_ESCAPE)) {
m_gameStateMachine->changeState(new MenuState());
}
}
void Game::update()
{
m_gameStateMachine->update();
}
void Game::render()
{
SDL_RenderClear(m_renderer);
SDL_SetRenderDrawColor(m_renderer, 0, 0, 0, 0);
//m_gameStateMachine
//Render Under Game State
m_gameStateMachine->render();
//Apply all rendering
SDL_RenderPresent(m_renderer);
}
void Game::addGameObjects()
{
m_gameObjects.push_back(new Player());
m_gameObjects.push_back(new Opponent());
m_gameObjects.push_back(new Ball());
}
void Game::clearGameObjects()
{
m_gameObjects.clear();
}
void Game::resetGameObjects()
{
for (auto &gameObject : m_gameObjects)
{
gameObject->reset();
}
}
| [
"RyanSwann1992@gmail.com"
] | RyanSwann1992@gmail.com |
89908f422fc0dd7fa3f7aa78777951e86571b9df | 88ae8695987ada722184307301e221e1ba3cc2fa | /third_party/grpc/src/tools/doxygen/Doxyfile.c++ | 24856971d774120dcddc142da6066514770d5d66 | [
"Apache-2.0",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"BSD-3-Clause",
"MPL-2.0"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 115,337 |
# Doxyfile 1.8.9.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "GRPC C++"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.54.0-dev
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/ref/c++
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
# putting all generated files in the same directory would otherwise causes
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = NO
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
# characters to appear in the names of generated files. If set to NO, non-ASCII
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
# U+3044.
# The default value is: NO.
ALLOW_UNICODE_NAMES = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
# Ukrainian and Vietnamese.
# The default value is: English.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
# as the leading text of the brief description, will be stripped from the text
# and the result, after processing the whole list, is used as the annotated
# text. Otherwise, the brief description is used as-is. If left blank, the
# following values are used ($name is automatically replaced with the name of
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
# description.
# The default value is: NO.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
# The default value is: NO.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = YES
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
# part of the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the path to
# strip.
#
# Note that you can specify absolute paths here, but also relative paths, which
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
# header file to include in order to use a class. If left blank only the name of
# the header file containing the class definition is used. Otherwise one should
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
# a brief description. This used to be the default behavior. The new default is
# to treat a multi-line C++ comment block as a detailed description. Set this
# tag to YES if you prefer the old behavior instead.
#
# Note that setting this tag to YES also means that rational rose comments are
# not recognized any more.
# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
# page for each member. If set to NO, the documentation of a member will be part
# of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 2
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
# for that language. For instance, namespaces will be presented as packages,
# qualified scopes will look different, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources. Doxygen will then generate output that is tailored for Fortran.
# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for VHDL.
# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
# globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# The default value is: NO.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
# getter and setter methods for a property. Setting this option to YES will make
# doxygen to replace the get and set methods by a property in the documentation.
# This will only work if the methods are indeed getting or setting a simple
# type. If this is not the case, or you want to show the methods anyway, you
# should set this option to NO.
# The default value is: YES.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
# subgrouping. Alternatively, this can be done per class using the
# \nosubgrouping command.
# The default value is: YES.
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
# are shown inside the group in which they are included (e.g. using \ingroup)
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
# and RTF).
#
# Note that this feature does not work in combination with
# SEPARATE_MEMBER_PAGES.
# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
# with only public data fields or simple typedef fields will be shown inline in
# the documentation of the scope in which they are defined (i.e. file,
# namespace, or group documentation), provided this scope is documented. If set
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
# Man pages) or section (for LaTeX and RTF).
# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
# an expensive process and often the same symbol appears multiple times in the
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
# doxygen will become slower. If the cache is too large, memory is wasted. The
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
# symbols. At the end of a run doxygen will report the cache usage and suggest
# the optimal cache size from a speed point of view.
# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. If set to YES, local methods,
# which are defined in the implementation section but not in the interface are
# included in the documentation. If set to NO, only methods in the interface are
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base name of
# the file that contains the anonymous namespace. By default anonymous namespace
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO, these classes will be included in the various overviews. This option
# has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO, these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
# documentation blocks found inside the body of a function. If set to NO, these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES, the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
# append additional text to a page's title, such as Class Reference. If set to
# YES the compound reference will be hidden.
# The default value is: NO.
HIDE_COMPOUND_REFERENCE= NO
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
# which file to include in order to use the member.
# The default value is: NO.
SHOW_GROUPED_MEMB_INC = NO
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
# files with double quotes in the documentation rather than with sharp brackets.
# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
# documentation for inline members.
# The default value is: YES.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
# name. If set to NO, the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
# name. If set to NO, the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
# destructors are listed first. If set to NO the constructors will appear in the
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
# member documentation.
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
# appear in their defined order.
# The default value is: NO.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
# fully-qualified names, including namespaces. If set to NO, the class list will
# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the alphabetical
# list.
# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
# type resolution of all parameters of a function it will reject a match between
# the prototype and the implementation of a member function even if there is
# only one candidate or it is obvious which candidate to choose by doing a
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
# accept a match between prototype and implementation in such cases.
# The default value is: NO.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
# list. This list is created by putting \todo commands in the documentation.
# The default value is: YES.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
# list. This list is created by putting \test commands in the documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
# documentation. If the initializer consists of more lines than specified here
# it will be hidden. Use a value of 0 to hide initializers completely. The
# appearance of the value of individual variables and macros / defines can be
# controlled using \showinitializer or \hideinitializer command in the
# documentation regardless of this setting.
# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command command input-file, where command is the value of the
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
# The default value is: YES.
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO, doxygen will only warn about wrong or incomplete
# parameter documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
# and the warning text. Optionally the format may contain $version, which will
# be replaced by the version of the file (if it could be obtained via
# FILE_VERSION_FILTER)
# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
doc/compression.md \
doc/compression_cookbook.md \
doc/connection-backoff-interop-test-description.md \
doc/connection-backoff.md \
doc/connectivity-semantics-and-api.md \
doc/cpp-style-guide.md \
doc/cpp/pending_api_cleanups.md \
doc/cpp/perf_notes.md \
doc/environment_variables.md \
doc/fail_fast.md \
doc/fork_support.md \
doc/g_stands_for.md \
doc/grpc_release_schedule.md \
doc/grpc_xds_features.md \
doc/health-checking.md \
doc/http-grpc-status-mapping.md \
doc/http2-interop-test-descriptions.md \
doc/internationalization.md \
doc/interop-test-descriptions.md \
doc/keepalive.md \
doc/load-balancing.md \
doc/naming.md \
doc/security_audit.md \
doc/server-reflection.md \
doc/server_reflection_tutorial.md \
doc/server_side_auth.md \
doc/service_config.md \
doc/ssl-performance.md \
doc/status_ordering.md \
doc/statuscodes.md \
doc/unit_testing.md \
doc/versioning.md \
doc/wait-for-ready.md \
doc/workarounds.md \
doc/xds-test-descriptions.md \
include/grpc++/alarm.h \
include/grpc++/channel.h \
include/grpc++/client_context.h \
include/grpc++/completion_queue.h \
include/grpc++/create_channel.h \
include/grpc++/create_channel_posix.h \
include/grpc++/ext/health_check_service_server_builder_option.h \
include/grpc++/generic/async_generic_service.h \
include/grpc++/generic/generic_stub.h \
include/grpc++/grpc++.h \
include/grpc++/health_check_service_interface.h \
include/grpc++/impl/call.h \
include/grpc++/impl/channel_argument_option.h \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/codegen/async_stream.h \
include/grpc++/impl/codegen/async_unary_call.h \
include/grpc++/impl/codegen/byte_buffer.h \
include/grpc++/impl/codegen/call.h \
include/grpc++/impl/codegen/call_hook.h \
include/grpc++/impl/codegen/channel_interface.h \
include/grpc++/impl/codegen/client_context.h \
include/grpc++/impl/codegen/client_unary_call.h \
include/grpc++/impl/codegen/completion_queue.h \
include/grpc++/impl/codegen/completion_queue_tag.h \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/config_protobuf.h \
include/grpc++/impl/codegen/create_auth_context.h \
include/grpc++/impl/codegen/metadata_map.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/proto_utils.h \
include/grpc++/impl/codegen/rpc_method.h \
include/grpc++/impl/codegen/rpc_service_method.h \
include/grpc++/impl/codegen/security/auth_context.h \
include/grpc++/impl/codegen/serialization_traits.h \
include/grpc++/impl/codegen/server_context.h \
include/grpc++/impl/codegen/server_interface.h \
include/grpc++/impl/codegen/service_type.h \
include/grpc++/impl/codegen/slice.h \
include/grpc++/impl/codegen/status.h \
include/grpc++/impl/codegen/status_code_enum.h \
include/grpc++/impl/codegen/string_ref.h \
include/grpc++/impl/codegen/stub_options.h \
include/grpc++/impl/codegen/sync_stream.h \
include/grpc++/impl/codegen/time.h \
include/grpc++/impl/grpc_library.h \
include/grpc++/impl/method_handler_impl.h \
include/grpc++/impl/rpc_method.h \
include/grpc++/impl/rpc_service_method.h \
include/grpc++/impl/serialization_traits.h \
include/grpc++/impl/server_builder_option.h \
include/grpc++/impl/server_builder_plugin.h \
include/grpc++/impl/server_initializer.h \
include/grpc++/impl/service_type.h \
include/grpc++/resource_quota.h \
include/grpc++/security/auth_context.h \
include/grpc++/security/auth_metadata_processor.h \
include/grpc++/security/credentials.h \
include/grpc++/security/server_credentials.h \
include/grpc++/server.h \
include/grpc++/server_builder.h \
include/grpc++/server_context.h \
include/grpc++/server_posix.h \
include/grpc++/support/async_stream.h \
include/grpc++/support/async_unary_call.h \
include/grpc++/support/byte_buffer.h \
include/grpc++/support/channel_arguments.h \
include/grpc++/support/config.h \
include/grpc++/support/slice.h \
include/grpc++/support/status.h \
include/grpc++/support/status_code_enum.h \
include/grpc++/support/string_ref.h \
include/grpc++/support/stub_options.h \
include/grpc++/support/sync_stream.h \
include/grpc++/support/time.h \
include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \
include/grpc/census.h \
include/grpc/compression.h \
include/grpc/event_engine/endpoint_config.h \
include/grpc/event_engine/event_engine.h \
include/grpc/event_engine/internal/memory_allocator_impl.h \
include/grpc/event_engine/internal/slice_cast.h \
include/grpc/event_engine/memory_allocator.h \
include/grpc/event_engine/memory_request.h \
include/grpc/event_engine/port.h \
include/grpc/event_engine/slice.h \
include/grpc/event_engine/slice_buffer.h \
include/grpc/fork.h \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
include/grpc/grpc_security.h \
include/grpc/grpc_security_constants.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/byte_buffer.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
include/grpc/impl/codegen/fork.h \
include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/grpc_types.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/propagation_bits.h \
include/grpc/impl/codegen/slice.h \
include/grpc/impl/codegen/status.h \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_abseil.h \
include/grpc/impl/codegen/sync_custom.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/compression_types.h \
include/grpc/impl/connectivity_state.h \
include/grpc/impl/grpc_types.h \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
include/grpc/support/alloc.h \
include/grpc/support/atm.h \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
include/grpc/support/port_platform.h \
include/grpc/support/string_util.h \
include/grpc/support/sync.h \
include/grpc/support/sync_abseil.h \
include/grpc/support/sync_custom.h \
include/grpc/support/sync_generic.h \
include/grpc/support/sync_posix.h \
include/grpc/support/sync_windows.h \
include/grpc/support/thd_id.h \
include/grpc/support/time.h \
include/grpc/support/workaround_list.h \
include/grpcpp/alarm.h \
include/grpcpp/channel.h \
include/grpcpp/client_context.h \
include/grpcpp/completion_queue.h \
include/grpcpp/create_channel.h \
include/grpcpp/create_channel_binder.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/ext/call_metric_recorder.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/ext/server_metric_recorder.h \
include/grpcpp/generic/async_generic_service.h \
include/grpcpp/generic/generic_stub.h \
include/grpcpp/grpcpp.h \
include/grpcpp/health_check_service_interface.h \
include/grpcpp/impl/call.h \
include/grpcpp/impl/call_hook.h \
include/grpcpp/impl/call_op_set.h \
include/grpcpp/impl/call_op_set_interface.h \
include/grpcpp/impl/channel_argument_option.h \
include/grpcpp/impl/channel_interface.h \
include/grpcpp/impl/client_unary_call.h \
include/grpcpp/impl/codegen/async_generic_service.h \
include/grpcpp/impl/codegen/async_stream.h \
include/grpcpp/impl/codegen/async_unary_call.h \
include/grpcpp/impl/codegen/byte_buffer.h \
include/grpcpp/impl/codegen/call.h \
include/grpcpp/impl/codegen/call_hook.h \
include/grpcpp/impl/codegen/call_op_set.h \
include/grpcpp/impl/codegen/call_op_set_interface.h \
include/grpcpp/impl/codegen/callback_common.h \
include/grpcpp/impl/codegen/channel_interface.h \
include/grpcpp/impl/codegen/client_callback.h \
include/grpcpp/impl/codegen/client_context.h \
include/grpcpp/impl/codegen/client_interceptor.h \
include/grpcpp/impl/codegen/client_unary_call.h \
include/grpcpp/impl/codegen/completion_queue.h \
include/grpcpp/impl/codegen/completion_queue_tag.h \
include/grpcpp/impl/codegen/config.h \
include/grpcpp/impl/codegen/config_protobuf.h \
include/grpcpp/impl/codegen/create_auth_context.h \
include/grpcpp/impl/codegen/delegating_channel.h \
include/grpcpp/impl/codegen/intercepted_channel.h \
include/grpcpp/impl/codegen/interceptor.h \
include/grpcpp/impl/codegen/interceptor_common.h \
include/grpcpp/impl/codegen/message_allocator.h \
include/grpcpp/impl/codegen/metadata_map.h \
include/grpcpp/impl/codegen/method_handler.h \
include/grpcpp/impl/codegen/method_handler_impl.h \
include/grpcpp/impl/codegen/proto_buffer_reader.h \
include/grpcpp/impl/codegen/proto_buffer_writer.h \
include/grpcpp/impl/codegen/proto_utils.h \
include/grpcpp/impl/codegen/rpc_method.h \
include/grpcpp/impl/codegen/rpc_service_method.h \
include/grpcpp/impl/codegen/security/auth_context.h \
include/grpcpp/impl/codegen/serialization_traits.h \
include/grpcpp/impl/codegen/server_callback.h \
include/grpcpp/impl/codegen/server_callback_handlers.h \
include/grpcpp/impl/codegen/server_context.h \
include/grpcpp/impl/codegen/server_interceptor.h \
include/grpcpp/impl/codegen/server_interface.h \
include/grpcpp/impl/codegen/service_type.h \
include/grpcpp/impl/codegen/slice.h \
include/grpcpp/impl/codegen/status.h \
include/grpcpp/impl/codegen/status_code_enum.h \
include/grpcpp/impl/codegen/string_ref.h \
include/grpcpp/impl/codegen/stub_options.h \
include/grpcpp/impl/codegen/sync.h \
include/grpcpp/impl/codegen/sync_stream.h \
include/grpcpp/impl/codegen/time.h \
include/grpcpp/impl/completion_queue_tag.h \
include/grpcpp/impl/create_auth_context.h \
include/grpcpp/impl/delegating_channel.h \
include/grpcpp/impl/grpc_library.h \
include/grpcpp/impl/intercepted_channel.h \
include/grpcpp/impl/interceptor_common.h \
include/grpcpp/impl/metadata_map.h \
include/grpcpp/impl/method_handler_impl.h \
include/grpcpp/impl/proto_utils.h \
include/grpcpp/impl/rpc_method.h \
include/grpcpp/impl/rpc_service_method.h \
include/grpcpp/impl/serialization_traits.h \
include/grpcpp/impl/server_builder_option.h \
include/grpcpp/impl/server_builder_plugin.h \
include/grpcpp/impl/server_callback_handlers.h \
include/grpcpp/impl/server_initializer.h \
include/grpcpp/impl/service_type.h \
include/grpcpp/impl/status.h \
include/grpcpp/impl/sync.h \
include/grpcpp/resource_quota.h \
include/grpcpp/security/auth_context.h \
include/grpcpp/security/auth_metadata_processor.h \
include/grpcpp/security/authorization_policy_provider.h \
include/grpcpp/security/binder_credentials.h \
include/grpcpp/security/binder_security_policy.h \
include/grpcpp/security/credentials.h \
include/grpcpp/security/server_credentials.h \
include/grpcpp/security/tls_certificate_provider.h \
include/grpcpp/security/tls_certificate_verifier.h \
include/grpcpp/security/tls_credentials_options.h \
include/grpcpp/server.h \
include/grpcpp/server_builder.h \
include/grpcpp/server_context.h \
include/grpcpp/server_interface.h \
include/grpcpp/server_posix.h \
include/grpcpp/support/async_stream.h \
include/grpcpp/support/async_unary_call.h \
include/grpcpp/support/byte_buffer.h \
include/grpcpp/support/callback_common.h \
include/grpcpp/support/channel_arguments.h \
include/grpcpp/support/client_callback.h \
include/grpcpp/support/client_interceptor.h \
include/grpcpp/support/config.h \
include/grpcpp/support/interceptor.h \
include/grpcpp/support/message_allocator.h \
include/grpcpp/support/method_handler.h \
include/grpcpp/support/proto_buffer_reader.h \
include/grpcpp/support/proto_buffer_writer.h \
include/grpcpp/support/server_callback.h \
include/grpcpp/support/server_interceptor.h \
include/grpcpp/support/slice.h \
include/grpcpp/support/status.h \
include/grpcpp/support/status_code_enum.h \
include/grpcpp/support/string_ref.h \
include/grpcpp/support/stub_options.h \
include/grpcpp/support/sync_stream.h \
include/grpcpp/support/time.h \
include/grpcpp/support/validate_service_config.h \
include/grpcpp/version_info.h \
include/grpcpp/xds_server_builder.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS =
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
# irrespective of the value of the RECURSIVE tag.
# The default value is: NO.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or directories
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command:
#
# <filter> <input-file>
#
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
# name of an input file. Doxygen will then use the output that the filter
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
# will be ignored.
#
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
# filter if there is a match. The filters are a list of the form: pattern=filter
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
# it is also possible to disable source filtering for a specific pattern using
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
# generated. Documented entities will be cross-referenced with these sources.
#
# Note: To get rid of all source code in the generated output, make sure that
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
# The default value is: NO.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
# special comment blocks from generated source code fragments. Normal C, C++ and
# Fortran comments will always remain visible.
# The default value is: YES.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
# brief description and links to the definition and documentation. Since this
# will make the HTML file larger and loading of large files a bit slower, you
# can opt to disable this feature.
# The default value is: YES.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
# tools must be available from the command line (i.e. in the search path).
#
# The result: instead of the source browser generated by doxygen, the links to
# source code will now point to the output of htags.
# The default value is: NO.
# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
# verbatim copy of the header file for each class for which an include is
# specified. Set to NO to disable this.
# See also: Section \class.
# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
# compounds will be generated. Enable this if the project contains a lot of
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# The default value is: .html.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
# each generated HTML page. If the tag is left blank doxygen will generate a
# standard header.
#
# To get valid HTML the header file that includes any scripts and style sheets
# that doxygen needs, which is dependent on the configuration options used (e.g.
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
# default header using
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
# YourConfigFile
# and then modify the file new_header.html. See also section "Doxygen usage"
# for information on how to generate the default header that doxygen normally
# uses.
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. For a description
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
# footer. See HTML_HEADER for more information on how to generate a default
# footer and what special commands can be used inside the footer. See also
# section "Doxygen usage" for information on how to generate the default footer
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
# the HTML output. If left blank doxygen will generate a default style sheet.
# See also section "Doxygen usage" for information on how to generate the style
# sheet that doxygen normally uses.
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
# standard style sheet and is therefore more robust against future updates.
# Doxygen will copy the style sheet files to the output directory.
# Note: The order of the extra style sheet files is of importance (e.g. the last
# style sheet in the list overrules the setting of the previous ones in the
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
# gradually make the output lighter, whereas values above 100 make the output
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
# change the gamma.
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
# and collapse entries dynamically later on. Doxygen will expand the tree to
# such a level that at most the specified number of entries are visible (unless
# a fully collapsed tree already exceeds this amount). So setting the number of
# entries 1 will produce a full collapsed tree by default. 0 is a special value
# representing an infinite number of entries and will result in a full expanded
# tree by default.
# Minimum value: 0, maximum value: 9999, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
# This tag determines the name of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# The default value is: Doxygen generated docs.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
# The default value is: org.doxygen.Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
# The default value is: Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
# files are now used as the Windows 98 help format, and will replace the old
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
# HTML files also contain an index, a table of contents, and you can search for
# words in the documentation. The HTML workshop also contains a viewer for
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated
# (YES) or that it should be included in the master .chm file (NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated
# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
# the table of contents of the HTML help documentation and to the tree view.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
# (.qch) of the generated HTML documentation.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
# install this plugin and make it available under the help contents menu in
# Eclipse, the contents of the directory containing the HTML and XML files needs
# to be copied into the plugins directory of eclipse. The name of the directory
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
# After copying Eclipse needs to be restarted before the help appears.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the Eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have this
# name. Each documentation set should have its own identifier.
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
# of each HTML page. A value of NO enables the index and the value YES disables
# it. Since the tabs in the index contain the same information as the navigation
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
# value is set to YES, a side panel will be generated containing a tree-like
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
# Note that a value of 0 will completely suppress the enum values from appearing
# in the overview section.
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
# Minimum value: 0, maximum value: 1500, default value: 250.
# This tag requires that the tag GENERATE_HTML is set to YES.
TREEVIEW_WIDTH = 250
# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
# output directory to force them to be regenerated.
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_FORMAT = HTML-CSS
# When MathJax is enabled you need to specify the location relative to the HTML
# output directory using the MATHJAX_RELPATH option. The destination directory
# should contain the MathJax.js script. For instance, if the mathjax directory
# is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
# should work on any modern browser. Note that when using HTML help
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
# there is already a search function so this one should typically be disabled.
# For large projects the javascript based search engine can be slow, then
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
# search using the keyboard; to jump to the search box use <access key> + S
# (what the <access key> is depends on the OS and browser, but it is typically
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
# key> to jump into the search results window, the results can be navigated
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
# the search. The filter options can be selected when the cursor is inside the
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
# to select a filter and <Enter> or <escape> to activate or cancel the filter
# option.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
# and searching needs to be provided by external tools. See the section
# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
# The default file is: searchdata.xml.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
# to a relative location where the documentation can be found. The format is:
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used by the
# printer.
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
# 14 inches) and executive (7.25 x 10.5 inches).
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
# string, for the replacement values of the other commands the user is referred
# to HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# LaTeX style sheets that are included after the standard style sheets created
# by doxygen. Using this option one can overrule certain style aspects. Doxygen
# will copy the style sheet files to the output directory.
# Note: The order of the extra style sheet files is of importance (e.g. the last
# style sheet in the list overrules the setting of the previous ones in the
# list).
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_STYLESHEET =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
# contain links (just like the HTML output) instead of page references. This
# makes the output suitable for online browsing using a PDF viewer.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES, to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
# index chapters (such as File Index, Compound Index, etc.) in the output.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: rtf.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
# contain hyperlink fields. The RTF file will contain links (just like the HTML
# output) instead of page references. This makes the output suitable for online
# browsing using Word or some other Word compatible readers that support those
# fields.
#
# Note: WordPad (write) and others do not support links.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
# with syntax highlighting in the RTF output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
# classes and files.
# The default value is: NO.
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it. A directory man3 will be created inside the directory specified by
# MAN_OUTPUT.
# The default directory is: man.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to the generated
# man pages. In case the manual section does not start with a number, the number
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
# optional.
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
# them the man command would be unable to find the correct page.
# The default value is: NO.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
# The default value is: YES.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
GENERATE_DOCBOOK = NO
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
# front of it.
# The default directory is: docbook.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
# AutoGen Definitions (see http://autogen.sf.net) file that captures the
# structure of the code including all documentation. Note that this feature is
# still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
# understand what is going on. On the other hand, if this tag is set to NO, the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file are
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
# so different doxyrules.make files included by the same Makefile don't
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
# in the source code. If set to NO, only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
# gcc). The argument of the tag is a list of macros of the form: name or
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
# is assumed. To prevent a macro definition from being undefined via #undef or
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = GRPC_FINAL= GRPC_OVERIDE=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
# macro definition that is found in the sources will be used. Use the PREDEFINED
# tag if you want to use a different macro definition that overrules the
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
# an all uppercase name, and do not end with a semicolon. Such function macros
# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tag files. For each tag
# file the location of the external documentation should be added. The format of
# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
# listed.
# The default value is: NO.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = YES
# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.
HAVE_DOT = YES
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
# processors available in the system. You can set it explicitly to a value
# larger than 0 to get control over the balance between CPU load and processing
# speed.
# Minimum value: 0, maximum value: 32, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = NO
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
# graph for each documented class showing the direct and indirect implementation
# dependencies (inheritance, containment, and class references variables) of the
# class with other documented classes.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = NO
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
# groups, showing the direct groups dependencies.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = NO
# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
# number of items for each type to make the size more manageable. Set this to 0
# for no limit. Note that the threshold may be exceeded by 50% before the limit
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
# YES then doxygen will generate a graph for each documented file showing the
# direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = NO
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
# set to YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other documented
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = NO
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
# dependencies a directory has on other directories in a graphical way. The
# dependency relations are determined by the #include relations between the
# files in the directories.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = NO
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
#
# Note that this requires a modern browser other than Internet Explorer. Tested
# and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
# the SVG files visible. Older versions of IE do not have SVG support.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
PLANTUML_JAR_PATH =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.
PLANTUML_INCLUDE_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
# by representing a node as a red box. Note that doxygen if the number of direct
# children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
# Minimum value: 0, maximum value: 10000, default value: 50.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
# generated by dot. A depth value of 3 means that only nodes reachable from the
# root by following a path via at most 3 edges will be shown. Nodes that lay
# further from the root node will be omitted. Note that setting this option to 1
# or 2 may greatly reduce the computation time needed for large code bases. Also
# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
# Minimum value: 0, maximum value: 1000, default value: 0.
# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
| [
"jengelh@inai.de"
] | jengelh@inai.de | |
dbee99fee8e51b14ee7e99dfe8f447bf7dcf283c | 73bfad0687c4df96a7dbec54b8b90e35fe460069 | /src/Math/Line2D.h | e75cd6bb02d6dab1d16c50398ace0de740112384 | [] | no_license | brieucdnl/JV-IN | fb42d3cf7eab6a353714915a226a53d63465dd84 | 00381a6276e4eb04084bdbff44cf125f05412c4c | refs/heads/master | 2016-08-11T19:43:59.254902 | 2016-03-09T22:06:57 | 2016-03-09T22:06:57 | 49,319,928 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,136 | h | #ifndef _Math_Line2D_H
#define _Math_Line2D_H
#include <math.h>
#include <Math/Vector2.h>
#include <Math/Line.h>
namespace Math
{
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \class Line2D
///
/// \brief Line in 2D.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
////////////////////////////////////////////////////////////////////////////////////////////////////
template <class Float>
class Line2D : public Line<Float,2>
{
public:
typedef enum { negativeSide = -1, onLine = 0, positiveSide = 1 } Side ;
protected:
//! the normal vector.
//Math::Vector<Float,2> m_normal ;
//! value such as m_normal*(x,y)+m_c is the line equation.
Float m_c ;
//! The second point defining the line.
Math::Vector2<Float> m_p2 ;
inline Float factor(Line2D const & l) const ;
public:
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Line2D()
///
/// \brief Default constructor.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Line2D() ; // x-y=0 i.e. y=x
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Line2D(Math::Vector2<Float> const & p1, Math::Vector2<Float> const & p2)
///
/// \brief Constructor.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] p1 the first point.
/// \param [in,out] p2 the second point.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Line2D(Math::Vector2<Float> const & p1, Math::Vector2<Float> const & p2) ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Float a() const
///
/// \brief Returns a such as a*x+b*y+c=0 is the line equation.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Float a() const { return normal()[0] ; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Float b() const
///
/// \brief Returns b such as a*x+b*y+c=0 is the line equation.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Float b() const { return normal()[1] ; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Float c() const
///
/// \brief Returns c such as a*x+b*y+c=0 is the line equation.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Float c() const { return m_c ; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Math::Vector<Float, 2> const & p1() const
///
/// \brief Returns the origin of the line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Math::Vector<Float, 2> const & p1() const
{ return m_origin ; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Math::Vector<Float, 2> const & p2() const
///
/// \brief Returns the second point of the line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Math::Vector<Float, 2> const & p2() const
{ return m_p2 ; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Math::Vector2<Float> normal() const
///
/// \brief Returns the normal vector of this line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return Return the normal vector of this line.
////////////////////////////////////////////////////////////////////////////////////////////////////
Math::Vector2<Float> normal() const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Side classify(Math::Vector2<Float> const & point) const
///
/// \brief Classifies the point in its half space or on line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 01/06/2010
///
/// \param [in,out] point the point to classify.
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
Side classify(Math::Vector2<Float> const & point) const
{
Float val = (point-m_origin)*normal() ;
if(val>0) { return positiveSide ; }
else if(val<0) { return negativeSide ; }
return onLine ;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn void setPositiveSide(Math::Vector2<Float> const & point)
///
/// \brief Sets a positive side of the line i.e. forces the po.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 01/06/2010
///
/// \param [in,out] point the point.
////////////////////////////////////////////////////////////////////////////////////////////////////
void setPositiveSide(Math::Vector2<Float> const & point)
{
if(classify(point)==negativeSide)
{
invertDirection() ;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Math::Vector2<Float> colinear() const
///
/// \brief Return the opposite of the normal.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Math::Vector2<Float> colinear() const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline bool intersect(Line2D const & l) const
///
/// \brief Tests if the two lines intersect.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] l the.
///
/// \return true if it succeeds, false if it fails.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline bool intersect(Line2D const & l) const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Math::Vector2<Float> operator*(Line2D const & l) const
///
/// \brief Computes the intersection of the two lines.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] l the.
///
/// \return The result of the operation.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Math::Vector2<Float> operator*(Line2D const & l) const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Float distance(Math::Vector2<Float> const & v) const
///
/// \brief Computes the distance between a point and this line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] v the v.
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Float distance(Math::Vector2<Float> const & v) const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Math::Vector2<Float> project(Math::Vector2<Float> const & v) const
///
/// \brief Projects the point on this line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] v the v.
///
/// \return The projection of 'v'.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Math::Vector2<Float> project(Math::Vector2<Float> const & v) const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline Math::Vector2<Float> projectionNormal(Math::Vector2<Float> const & v) const
///
/// \brief Returns the vector 'v2' such as project(v)+v2==v.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] v the v.
///
/// \return .
////////////////////////////////////////////////////////////////////////////////////////////////////
inline Math::Vector2<Float> projectionNormal(Math::Vector2<Float> const & v) const ;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn inline bool belongs(Math::Vector2<Float> const & v) const
///
/// \brief Tests if 'v' belongs to the line.
///
/// \author Fabrice Lamarche, University Of Rennes 1
/// \date 20/12/2009
///
/// \param [in,out] v the v.
///
/// \return true if it succeeds, false if it fails.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline bool belongs(Math::Vector2<Float> const & v) const ;
void invertDirection()
{
Line<Float,2>::invertDirection() ;
m_c=-(normal()*m_origin) ;
}
} ;
template <class Float>
Line2D<Float>::Line2D()
: /*m_normal(Math::Vector2<Float>((Float)sqrt(2.0), -(Float)sqrt(2.0))), */m_c(0.0), m_p2(1,1)
{}
template <class Float>
Line2D<Float>::Line2D(Math::Vector2<Float> const & p1, Math::Vector2<Float> const & p2)
: Line<Float,2>(p1, p2-p1), m_p2(p2)
{
//m_normal = Math::Vector2<Float>(p2-p1).rotate90() ;
m_c=-(normal()*p1) ;
Float vectorNorm = (p1-p2).norm() ;
//m_normal = m_normal/vectorNorm ;
//m_c = m_c/vectorNorm ;
}
template <class Float>
Float Line2D<Float>::factor(Line2D<Float> const & l) const
{
Math::Vector2<Float> thisNormal = normal() ;
Math::Vector2<Float> thatNormal = l.normal() ;
return thisNormal[0]*thatNormal[1]-thisNormal[1]*thatNormal[0] ;
}
template <class Float>
bool Line2D<Float>::intersect(Line2D<Float> const & l) const
{
return factor(l)!=0.0 ;
}
template <class Float>
Math::Vector2<Float> Line2D<Float>::operator*(Line2D<Float> const & s) const
{
Float f = Float(1.0)/factor(s) ;
Math::Vector2<Float> v1(s.normal()[1], -normal()[1]) ;
Math::Vector2<Float> v2(-s.normal()[0], normal()[0]) ;
Math::Vector2<Float> p(-m_c, -s.m_c) ;
return Math::Vector2<Float>((v1*p)*f, (v2*p)*f) ;
}
template <class Float>
Math::Vector2<Float> Line2D<Float>::normal() const
{
return Math::Vector2<Float>(m_direction).rotate90() ;
}
template <class Float>
Math::Vector2<Float> Line2D<Float>::colinear() const
{
return normal().rotate270() ;
}
template <class Float>
Float Line2D<Float>::distance(Math::Vector2<Float> const & v) const
{
return normal()*v+m_c ;
}
template <class Float>
Math::Vector2<Float> Line2D<Float>::project(Math::Vector2<Float> const & v) const
{
return v-normal()*distance(v) ;
}
template <class Float>
Math::Vector2<Float> Line2D<Float>::projectionNormal(Math::Vector2<Float> const & v) const
{
return normal()*distance(v) ;
}
template <class Float>
bool Line2D<Float>::belongs(Math::Vector2<Float> const & v) const
{
return distance(v)==0.0 ;
}
}
#endif
| [
"brieuc@bdaniel.fr"
] | brieuc@bdaniel.fr |
0b3c0669ccc5948ade59289f750e0c9686c835dd | f856ad2e96263a38a6c717eca995f8a3f66b3f2f | /tools/compiler/pb/src/cpp_plugin.cpp | 5e55b5e271c1b35464535b49eccc403bfd28d90e | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | permissive | xiake-1024/Pebble | befaee5868905fb804c50d895e80d3489d464200 | 283310f67f5b30adaed5a21df97f706560b3617f | refs/heads/master | 2022-12-09T14:24:51.785830 | 2020-09-26T03:05:05 | 2020-09-26T03:05:05 | 296,327,254 | 0 | 0 | NOASSERTION | 2020-09-17T13:00:05 | 2020-09-17T13:00:04 | null | UTF-8 | C++ | false | false | 10,450 | cpp | /*
* Tencent is pleased to support the open source community by making Pebble available.
* Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* 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 <memory>
#include <sstream>
#include "cpp_generator.h"
#include "cpp_generator_helpers.h"
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/compiler/plugin.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/printer.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
namespace pebble {
class ProtoBufMethod : public Method {
public:
ProtoBufMethod(const google::protobuf::MethodDescriptor* method) : method_(method) {}
std::string name() const { return method_->name(); }
std::string input_type_name() const {
return ClassName(method_->input_type(), true);
}
std::string output_type_name() const {
return ClassName(method_->output_type(), true);
}
// PB v3 支持4种请求响应模型: 一对一、一对多、多对一、多对多
bool NoStreaming() const { // 一对一
// return !method_->client_streaming() && !method_->server_streaming();
return true; // default
}
bool ClientOnlyStreaming() const { // 多对一
// return method_->client_streaming() && !method_->server_streaming();
return false; // pb 2.x unsupport
}
bool ServerOnlyStreaming() const { // 一对多
// return !method_->client_streaming() && method_->server_streaming();
return false; // pb 2.x unsupport
}
bool BidiStreaming() const { // 多对多
// return method_->client_streaming() && method_->server_streaming();
return false; // pb 2.x unsupport
}
std::string GetLeadingComments() const {
return GetCppComments(method_, true);
}
std::string GetTrailingComments() const {
return GetCppComments(method_, false);
}
std::string timeout_ms() const {
// 使用扩展google.protobuf.MethodOptions的方式使用起来比较麻烦
// 增加用户使用成本,直接在client增加设置超时接口
return "-1";
}
private:
const google::protobuf::MethodDescriptor* method_;
};
class ProtoBufService : public Service {
public:
ProtoBufService(const google::protobuf::ServiceDescriptor* service) : service_(service) {}
std::string name() const { return service_->name(); }
int method_count() const { return service_->method_count(); }
cxx::shared_ptr<const Method> method(int i) const {
return cxx::shared_ptr<const Method>(new ProtoBufMethod(service_->method(i)));
}
std::string GetLeadingComments() const {
return GetCppComments(service_, true);
}
std::string GetTrailingComments() const {
return GetCppComments(service_, false);
}
private:
const google::protobuf::ServiceDescriptor* service_;
};
class ProtoBufPrinter : public Printer {
public:
ProtoBufPrinter(std::string* str)
: output_stream_(str), printer_(&output_stream_, '$') {}
void Print(const std::map<std::string, std::string>& vars, const char* string_template) {
printer_.Print(vars, string_template);
}
void Print(const char* string) { printer_.Print(string); }
void Indent() { printer_.Indent(); printer_.Indent(); }
void Outdent() { printer_.Outdent(); printer_.Outdent(); }
private:
google::protobuf::io::StringOutputStream output_stream_;
google::protobuf::io::Printer printer_;
};
class ProtoBufFile : public File {
public:
ProtoBufFile(const google::protobuf::FileDescriptor* file) : file_(file) {}
std::string filename() const { return file_->name(); }
std::string filename_without_ext() const {
return StripProto(filename());
}
std::string filename_without_path() const {
std::string fn(filename());
size_t pos = fn.find_last_of('/');
if (pos > 0) {
fn = fn.substr(pos + 1);
}
return StripProto(fn);
}
std::string message_header_ext() const { return ".pb.h"; }
std::string service_header_ext() const { return ".rpc.pb.h"; }
std::string service_imp_header_ext() const { return ".rpc.pb.inh"; }
std::string package() const { return file_->package(); }
std::vector<std::string> package_parts() const {
std::vector<std::string> tmp;
StringUtility::Split(package(), ".", &tmp);
return tmp;
}
std::string additional_headers() const { return ""; }
int service_count() const { return file_->service_count(); };
cxx::shared_ptr<const Service> service(int i) const {
return cxx::shared_ptr<const Service>(new ProtoBufService(file_->service(i)));
}
cxx::shared_ptr<Printer> CreatePrinter(std::string *str) const {
return cxx::shared_ptr<Printer>(new ProtoBufPrinter(str));
}
std::string GetLeadingComments() const {
return "";
}
std::string GetTrailingComments() const {
return "";
}
private:
const google::protobuf::FileDescriptor *file_;
};
class CppServiceGenerator : public google::protobuf::compiler::CodeGenerator {
public:
CppServiceGenerator() {}
virtual ~CppServiceGenerator() {}
virtual bool Generate(const google::protobuf::FileDescriptor* file,
const std::string& parameter,
google::protobuf::compiler::GeneratorContext* context,
std::string* error) const {
if (file->options().cc_generic_services()) {
*error = "cpp pebble proto compiler plugin does not work with generic service."
"To generate pebble service, please set \"cc_generic_service = false\".";
return false;
}
Parameters generator_parameters;
generator_parameters.use_system_headers = false;
ProtoBufFile pbfile(file);
if (!parameter.empty()) {
std::vector<std::string> parameters_list;
StringUtility::Split(parameter, ",", ¶meters_list);
for (std::vector<std::string>::iterator it = parameters_list.begin();
it != parameters_list.end(); it++) {
std::vector<std::string> param;
StringUtility::Split(*it, "=", ¶m);
if (param[0] == "services_namespace") {
generator_parameters.services_namespace = param[1];
} else if (param[0] == "use_system_headers") {
if (param[1] == "true") {
generator_parameters.use_system_headers = true;
} else if (param[1] == "false") {
generator_parameters.use_system_headers = false;
} else {
*error = std::string("Invalid parameter: ") + *it;
return false;
}
} else if (param[0] == "search_path") {
generator_parameters.search_path = param[1];
} else {
*error = std::string("Unknown parameter: ") + *it;
return false;
}
}
}
std::string file_name = StripProto(file->name());
std::string inheader_code =
GetHeaderPrologue(&pbfile, generator_parameters, "inh") +
GetINHeaderIncludes(&pbfile, generator_parameters) +
GetINHeaderService(&pbfile, generator_parameters) +
GetHeaderEpilogue(&pbfile, generator_parameters, "inh");
cxx::shared_ptr<google::protobuf::io::ZeroCopyOutputStream> inheader_output(
context->Open(file_name + ".rpc.pb.inh"));
google::protobuf::io::CodedOutputStream inheader_coded_out(inheader_output.get());
inheader_coded_out.WriteRaw(inheader_code.data(), inheader_code.size());
std::string header_code =
GetHeaderPrologue(&pbfile, generator_parameters, "h") +
GetHeaderIncludes(&pbfile, generator_parameters) +
GetHeaderServices(&pbfile, generator_parameters) +
GetHeaderEpilogue(&pbfile, generator_parameters, "h");
cxx::shared_ptr<google::protobuf::io::ZeroCopyOutputStream> header_output(
context->Open(file_name + ".rpc.pb.h"));
google::protobuf::io::CodedOutputStream header_coded_out(header_output.get());
header_coded_out.WriteRaw(header_code.data(), header_code.size());
std::string source_code =
GetSourcePrologue(&pbfile, generator_parameters) +
GetSourceIncludes(&pbfile, generator_parameters) +
GetSourceServices(&pbfile, generator_parameters) +
GetSourceEpilogue(&pbfile, generator_parameters);
cxx::shared_ptr<google::protobuf::io::ZeroCopyOutputStream> source_output(
context->Open(file_name + ".rpc.pb.cc"));
google::protobuf::io::CodedOutputStream source_coded_out(source_output.get());
source_coded_out.WriteRaw(source_code.data(), source_code.size());
return true;
}
private:
// Insert the given code into the given file at the given insertion point.
void Insert(google::protobuf::compiler::GeneratorContext* context,
const std::string& filename, const std::string& insertion_point,
const std::string& code) const {
cxx::shared_ptr<google::protobuf::io::ZeroCopyOutputStream> output(
context->OpenForInsert(filename, insertion_point));
google::protobuf::io::CodedOutputStream coded_out(output.get());
coded_out.WriteRaw(code.data(), code.size());
}
};
} // namespace pebble
int main(int argc, char *argv[]) {
pebble::CppServiceGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
| [
"23899212@qq.com"
] | 23899212@qq.com |
0cdb9bf7a12c541bcd607e46abf80bddf793ef66 | ae76326dfababa1bc0023f7e583575716efa27fe | /UnrealPakViewer/Private/Widgets/SAssetSummaryView.cpp | 3057fbde668b71c7b46da35cedcdb56d000fb2f4 | [] | no_license | Winux1062/UnrealPakViewer | 344385e9aec757f650667df735c10434cadb3339 | 65b1bf0990d178402b710ecd7f4b324585fd5132 | refs/heads/master | 2023-07-08T23:09:22.678967 | 2021-08-05T09:24:16 | 2021-08-05T09:24:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,518 | cpp | #include "SAssetSummaryView.h"
#include "EditorStyle.h"
#include "Widgets/Input/SComboBox.h"
#include "Widgets/Layout/SBorder.h"
#include "Widgets/Layout/SBox.h"
#include "Widgets/Layout/SExpandableArea.h"
#include "Widgets/Layout/SScrollBar.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Views/SHeaderRow.h"
#include "Widgets/Views/STableRow.h"
#include "Widgets/Views/STableViewBase.h"
#include "SKeyValueRow.h"
#include "UnrealPakViewerStyle.h"
#define LOCTEXT_NAMESPACE "SAssetSummaryView"
#define DEFINE_GET_MEMBER_FUNCTION_NUMBER(MemberName) \
FORCEINLINE FText SAssetSummaryView::Get##MemberName() const \
{ \
return ViewingPackage.IsValid() ? FText::AsNumber(ViewingPackage->AssetSummary->PackageSummary.MemberName) : FText(); \
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// SImportObjectRow
////////////////////////////////////////////////////////////////////////////////////////////////////
class SImportObjectRow : public SMultiColumnTableRow<FObjectImportPtrType>
{
SLATE_BEGIN_ARGS(SImportObjectRow) {}
SLATE_END_ARGS()
public:
void Construct(const FArguments& InArgs, FObjectImportPtrType InObject, const TSharedRef<STableViewBase>& InOwnerTableView)
{
if (!InObject.IsValid())
{
return;
}
WeakObject = MoveTemp(InObject);
SMultiColumnTableRow<FObjectImportPtrType>::Construct(FSuperRowType::FArguments().Padding(FMargin(0.f, 2.f)), InOwnerTableView);
}
virtual TSharedRef<SWidget> GenerateWidgetForColumn(const FName& ColumnName) override
{
static const float LeftMargin = 4.f;
FObjectImportPtrType Object = WeakObject.Pin();
if (!Object.IsValid())
{
return SNew(STextBlock).Text(LOCTEXT("NullColumn", "Null")).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
if (ColumnName == "Index")
{
return SNew(STextBlock).Text(FText::AsNumber(Object->Index));
}
else if (ColumnName == "ClassPackage")
{
return SNew(STextBlock).Text(FText::FromName(Object->ClassPackage)).ToolTipText(FText::FromName(Object->ClassPackage)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "ClassName")
{
return SNew(STextBlock).Text(FText::FromName(Object->ClassName)).ToolTipText(FText::FromName(Object->ClassName)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "ObjectName")
{
return SNew(STextBlock).Text(FText::FromName(Object->ObjectName)).ToolTipText(FText::FromName(Object->ObjectName)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "FullPath")
{
return SNew(STextBlock).Text(FText::FromString(Object->ObjectPath)).ToolTipText(FText::FromString(Object->ObjectPath)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else
{
return SNew(STextBlock).Text(LOCTEXT("UnknownColumn", "Unknown Column")).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
}
protected:
TWeakPtr<FObjectImportEx> WeakObject;
};
class SExportObjectRow : public SMultiColumnTableRow<FObjectExportPtrType>
{
SLATE_BEGIN_ARGS(SExportObjectRow) {}
SLATE_END_ARGS()
public:
void Construct(const FArguments& InArgs, FObjectExportPtrType InObject, const TSharedRef<STableViewBase>& InOwnerTableView)
{
if (!InObject.IsValid())
{
return;
}
for (FPackageInfoPtr Dependency : InObject->DependencyList)
{
Dependencies.Add(MakeShared<FString>(Dependency->ExtraInfo + TEXT(": ") + Dependency->PackageName));
}
WeakObject = MoveTemp(InObject);
SMultiColumnTableRow<FObjectExportPtrType>::Construct(FSuperRowType::FArguments().Padding(FMargin(0.f, 2.f)), InOwnerTableView);
}
virtual TSharedRef<SWidget> GenerateWidgetForColumn(const FName& ColumnName) override
{
static const float LeftMargin = 4.f;
FObjectExportPtrType Object = WeakObject.Pin();
if (!Object.IsValid())
{
return SNew(STextBlock).Text(LOCTEXT("NullColumn", "Null")).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
TSharedRef<SWidget> RowContent = SNullWidget::NullWidget;
if (ColumnName == "Index")
{
RowContent = SNew(STextBlock).Text(FText::AsNumber(Object->Index));
}
else if (ColumnName == "ObjectName")
{
RowContent = SNew(STextBlock).Text(FText::FromName(Object->ObjectName)).ToolTipText(FText::FromName(Object->ObjectName)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "SerialSize")
{
RowContent = SNew(STextBlock).Text(FText::AsMemory(Object->SerialSize, EMemoryUnitStandard::IEC)).ToolTipText(FText::AsNumber(Object->SerialSize)).Justification(ETextJustify::Center);
}
else if (ColumnName == "SerialOffset")
{
RowContent = SNew(STextBlock).Text(FText::AsNumber(Object->SerialOffset)).Justification(ETextJustify::Center);
}
else if (ColumnName == "bIsAsset")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->bIsAsset ? TEXT("true") : TEXT("false"))).Justification(ETextJustify::Center);
}
else if (ColumnName == "bNotForClient")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->bNotForClient ? TEXT("true") : TEXT("false"))).Justification(ETextJustify::Center);
}
else if (ColumnName == "bNotForServer")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->bNotForServer ? TEXT("true") : TEXT("false"))).Justification(ETextJustify::Center);
}
else if (ColumnName == "ClassIndex")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->ClassName)).ToolTipText(FText::FromString(Object->ClassName)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "SuperIndex")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->Super)).ToolTipText(FText::FromString(Object->Super)).Justification(ETextJustify::Right).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "TemplateIndex")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->TemplateObject)).ToolTipText(FText::FromString(Object->TemplateObject)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "FullPath")
{
RowContent = SNew(STextBlock).Text(FText::FromString(Object->ObjectPath)).ToolTipText(FText::FromString(Object->ObjectPath)).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
else if (ColumnName == "Dependencies")
{
RowContent = SNew(SComboBox<TSharedPtr<FString>>)
.ContentPadding(FMargin(6.0f, 2.0f))
.OptionsSource(&Dependencies)
.OnGenerateWidget_Lambda([](TSharedPtr<FString> Item)
{
return SNew(STextBlock).Text(FText::FromString(*Item)).ToolTipText(FText::FromString(*Item)).Margin(FMargin(2.f, 2.f, 2.f, 2.f));
})
.Content()
[
SNew(STextBlock).Text(LOCTEXT("Dependencies", "Dependencies"))
];
}
else
{
RowContent = SNew(STextBlock).Text(LOCTEXT("UnknownColumn", "Unknown Column")).Margin(FMargin(LeftMargin, 0.f, 0.f, 0.f));
}
return SNew(SBox).VAlign(VAlign_Center)
[
RowContent
];
}
protected:
TWeakPtr<FObjectExportEx> WeakObject;
TArray<TSharedPtr<FString>> Dependencies;
};
SAssetSummaryView::SAssetSummaryView()
{
}
SAssetSummaryView::~SAssetSummaryView()
{
}
void SAssetSummaryView::Construct(const FArguments& InArgs)
{
ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 4.f)
[
SNew(STextBlock).Text(LOCTEXT("Tree_View_Summary", "Asset Summary:"))
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Guid", "Guid:")).ValueText(this, &SAssetSummaryView::GetGuid)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_bUnversioned", "bUnversioned:")).ValueText(this, &SAssetSummaryView::GetIsUnversioned)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_FileVersionUE4", "FileVersionUE4:")).ValueText(this, &SAssetSummaryView::GetFileVersionUE4)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_FileVersionLicenseeUE4", "FileVersionLicenseeUE4:")).ValueText(this, &SAssetSummaryView::GetFileVersionLicenseeUE4)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_TotalHeaderSize", "TotalHeaderSize:")).ValueText(this, &SAssetSummaryView::GetTotalHeaderSize)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_PackageFlags", "PackageFlags:")).ValueText(this, &SAssetSummaryView::GetPackageFlags)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_BulkDataStartOffset", "BulkDataStartOffset:")).ValueText(this, &SAssetSummaryView::GetBulkDataStartOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_GatherableTextDataCount", "GatherableTextDataCount:")).ValueText(this, &SAssetSummaryView::GetGatherableTextDataCount)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_GatherableTextDataOffset", "GatherableTextDataOffset:")).ValueText(this, &SAssetSummaryView::GetGatherableTextDataOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_DependsOffset", "DependsOffset:")).ValueText(this, &SAssetSummaryView::GetDependsOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_SoftPackageReferencesCount", "SoftPackageReferencesCount:")).ValueText(this, &SAssetSummaryView::GetSoftPackageReferencesCount)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_SoftPackageReferencesOffset", "SoftPackageReferencesOffset:")).ValueText(this, &SAssetSummaryView::GetSoftPackageReferencesOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_SearchableNamesOffset", "SearchableNamesOffset:")).ValueText(this, &SAssetSummaryView::GetSearchableNamesOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_ThumbnailTableOffset", "ThumbnailTableOffset:")).ValueText(this, &SAssetSummaryView::GetThumbnailTableOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_AssetRegistryDataOffset", "AssetRegistryDataOffset:")).ValueText(this, &SAssetSummaryView::GetAssetRegistryDataOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_WorldTileInfoDataOffset", "WorldTileInfoDataOffset:")).ValueText(this, &SAssetSummaryView::GetWorldTileInfoDataOffset)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SExpandableArea)
.InitiallyCollapsed(false)
.HeaderContent()
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_ImportObjects", "ImportObjects:"))
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetImportCount)
]
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Offset", "Offset:")).ValueText(this, &SAssetSummaryView::GetImportOffset)
]
]
]
.BodyContent()
[
SAssignNew(ImportObjectListView, SListView<FObjectImportPtrType>)
.ItemHeight(25.f)
.SelectionMode(ESelectionMode::Multi)
.ListItemsSource(&ImportObjects)
.OnGenerateRow(this, &SAssetSummaryView::OnGenerateImportObjectRow)
.HeaderRow
(
SAssignNew(ImportObjectHeaderRow, SHeaderRow).Visibility(EVisibility::Visible)
)
]
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SExpandableArea)
.InitiallyCollapsed(false)
.HeaderContent()
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_ExportObjects", "ExportObjects:"))
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetExportCount)
]
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Offset", "Offset:")).ValueText(this, &SAssetSummaryView::GetExportOffset)
]
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Size", "Size:")).ValueText(this, &SAssetSummaryView::GetExportSize).ValueToolTipText(this, &SAssetSummaryView::GetExportSizeTooltip)
]
]
]
.BodyContent()
[
SAssignNew(ExportObjectListView, SListView<FObjectExportPtrType>)
.ItemHeight(25.f)
.SelectionMode(ESelectionMode::Multi)
.ListItemsSource(&ExportObjects)
.OnGenerateRow(this, &SAssetSummaryView::OnGenerateExportObjectRow)
.HeaderRow
(
SAssignNew(ExportObjectHeaderRow, SHeaderRow).Visibility(EVisibility::Visible)
)
]
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SExpandableArea)
.InitiallyCollapsed(false)
.HeaderContent()
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Dependency", "Dependency packages:")).KeyToolTipText(LOCTEXT("Tree_View_Summary_DependencyTip", "Packages that this package depends on"))
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetDependencyCount)
]
]
]
.BodyContent()
[
SAssignNew(DependencyListView, SListView<FPackageInfoPtr>)
.ItemHeight(25.f)
.SelectionMode(ESelectionMode::Multi)
.ListItemsSource(&DependencyList)
.OnGenerateRow(this, &SAssetSummaryView::OnGenerateDependsRow)
.HeaderRow
(
SNew(SHeaderRow).Visibility(EVisibility::Visible)
+ SHeaderRow::Column(FName("Package"))
.FillWidth(1.f)
.DefaultLabel(LOCTEXT("Tree_View_Summary_Package", "Package"))
)
]
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SExpandableArea)
.InitiallyCollapsed(false)
.HeaderContent()
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Dependent", "Dependent packages:")).KeyToolTipText(LOCTEXT("Tree_View_Summary_DependentTip", "Packages that depends on this package. May be incorrect due to multi paks!"))
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetDependentCount)
]
]
]
.BodyContent()
[
SAssignNew(DependentListView, SListView<FPackageInfoPtr>)
.ItemHeight(25.f)
.SelectionMode(ESelectionMode::Multi)
.ListItemsSource(&DependentList)
.OnGenerateRow(this, &SAssetSummaryView::OnGenerateDependsRow)
.HeaderRow
(
SNew(SHeaderRow).Visibility(EVisibility::Visible)
+ SHeaderRow::Column(FName("Package"))
.FillWidth(1.f)
.DefaultLabel(LOCTEXT("Tree_View_Summary_Package", "Package"))
)
]
]
//+ SVerticalBox::Slot()
//.AutoHeight()
//.Padding(0.f, 2.f)
//[
// SNew(SExpandableArea)
// .InitiallyCollapsed(true)
// .HeaderContent()
// [
// SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_PreloadDependency", "PreloadDependency:"))
// .ValueContent()
// [
// SNew(SHorizontalBox)
// + SHorizontalBox::Slot()
// .FillWidth(1.f)
// [
// SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetPreloadDependencyCount)
// ]
// + SHorizontalBox::Slot()
// .FillWidth(1.f)
// [
// SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Offset", "Offset:")).ValueText(this, &SAssetSummaryView::GetPreloadDependencyOffset)
// ]
// ]
// ]
// .BodyContent()
// [
// SAssignNew(PreloadDependencyListView, SListView<FPackageIndexPtrType>)
// .ItemHeight(25.f)
// .SelectionMode(ESelectionMode::Multi)
// .ListItemsSource(&PreloadDependency)
// .OnGenerateRow(this, &SAssetSummaryView::OnGeneratePreloadDependencyRow)
// .HeaderRow
// (
// SNew(SHeaderRow).Visibility(EVisibility::Visible)
// + SHeaderRow::Column(FName("DependencyPackage"))
// .FillWidth(1.f)
// .DefaultLabel(LOCTEXT("Tree_View_Summary_PackageIndex", "PackageIndex"))
// )
// ]
//]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.f, 2.f)
[
SNew(SExpandableArea)
.InitiallyCollapsed(true)
.HeaderContent()
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Names", "Names:"))
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Count", "Count:")).ValueText(this, &SAssetSummaryView::GetNameCount)
]
+ SHorizontalBox::Slot()
.FillWidth(1.f)
[
SNew(SKeyValueRow).KeyText(LOCTEXT("Tree_View_Summary_Offset", "Offset:")).ValueText(this, &SAssetSummaryView::GetNameOffset)
]
]
]
.BodyContent()
[
SAssignNew(NamesListView, SListView<FNamePtrType>)
.ItemHeight(25.f)
.SelectionMode(ESelectionMode::Multi)
.ListItemsSource(&PackageNames)
.OnGenerateRow(this, &SAssetSummaryView::OnGenerateNameRow)
.HeaderRow
(
SNew(SHeaderRow).Visibility(EVisibility::Visible)
+ SHeaderRow::Column(FName("Name"))
.FillWidth(1.f)
.DefaultLabel(LOCTEXT("Tree_View_Summary_Name", "Name"))
)
]
]
];
InsertColumn(ImportObjectHeaderRow, "Index");
InsertColumn(ImportObjectHeaderRow, "ObjectName");
InsertColumn(ImportObjectHeaderRow, "ClassName");
InsertColumn(ImportObjectHeaderRow, "ClassPackage");
InsertColumn(ImportObjectHeaderRow, "FullPath");
InsertColumn(ExportObjectHeaderRow, "Index");
InsertColumn(ExportObjectHeaderRow, "ObjectName");
InsertColumn(ExportObjectHeaderRow, "ClassIndex", TEXT("ClassName"));
InsertSortableColumn(ExportObjectHeaderRow, "SerialSize");
InsertSortableColumn(ExportObjectHeaderRow, "SerialOffset");
InsertColumn(ExportObjectHeaderRow, "FullPath");
InsertColumn(ExportObjectHeaderRow, "bIsAsset");
InsertColumn(ExportObjectHeaderRow, "bNotForClient");
InsertColumn(ExportObjectHeaderRow, "bNotForServer");
InsertColumn(ExportObjectHeaderRow, "TemplateIndex", TEXT("TemplateObject"));
InsertColumn(ExportObjectHeaderRow, "SuperIndex", TEXT("Super"));
InsertColumn(ExportObjectHeaderRow, "Dependencies");
}
void SAssetSummaryView::SetViewingPackage(FPakFileEntryPtr InPackage)
{
ViewingPackage = InPackage;
PackageNames = InPackage->AssetSummary->Names;
ImportObjects = InPackage->AssetSummary->ObjectImports;
ExportObjects = InPackage->AssetSummary->ObjectExports;
//PreloadDependency = InPackage->AssetSummary->PreloadDependency;
DependencyList = InPackage->AssetSummary->DependencyList;
DependentList = InPackage->AssetSummary->DependentList;
TotalExportSize = 0;
for (FObjectExportPtrType ExportObject : ExportObjects)
{
if (ExportObject.IsValid())
{
TotalExportSize += ExportObject->SerialSize;
}
}
OnSortExportObjects();
NamesListView->RebuildList();
ImportObjectListView->RebuildList();
ExportObjectListView->RebuildList();
//PreloadDependencyListView->RebuildList();
DependencyListView->RebuildList();
DependentListView->RebuildList();
}
TSharedRef<ITableRow> SAssetSummaryView::OnGenerateNameRow(FNamePtrType InName, const TSharedRef<class STableViewBase>& OwnerTable)
{
return SNew(STableRow<FNamePtrType>, OwnerTable).Padding(FMargin(0.f, 2.f))
[
SNew(STextBlock).Text(FText::FromName(*InName))
];
}
TSharedRef<ITableRow> SAssetSummaryView::OnGenerateImportObjectRow(FObjectImportPtrType InObject, const TSharedRef<class STableViewBase>& OwnerTable)
{
return SNew(SImportObjectRow, InObject, OwnerTable);
}
TSharedRef<ITableRow> SAssetSummaryView::OnGenerateExportObjectRow(FObjectExportPtrType InObject, const TSharedRef<class STableViewBase>& OwnerTable)
{
return SNew(SExportObjectRow, InObject, OwnerTable);
}
TSharedRef<ITableRow> SAssetSummaryView::OnGeneratePreloadDependencyRow(FPackageIndexPtrType InPackageIndex, const TSharedRef<class STableViewBase>& OwnerTable)
{
return SNew(STableRow<FNamePtrType>, OwnerTable).Padding(FMargin(0.f, 2.f))
[
SNew(STextBlock).Text(FText::AsNumber(InPackageIndex->ForDebugging()))
];
}
TSharedRef<ITableRow> SAssetSummaryView::OnGenerateDependsRow(FPackageInfoPtr InDepends, const TSharedRef<class STableViewBase>& OwnerTable)
{
return SNew(STableRow<FPackageInfoPtr>, OwnerTable).Padding(FMargin(0.f, 2.f))
[
SNew(STextBlock).Text(FText::FromString(InDepends->PackageName)).ToolTipText(FText::FromString(InDepends->PackageName))
];
}
void SAssetSummaryView::InsertColumn(TSharedPtr<SHeaderRow> InHeader, FName InId, const FString& InCloumnName)
{
SHeaderRow::FColumn::FArguments ColumnArgs;
ColumnArgs
.ColumnId(InId)
.DefaultLabel(InCloumnName.IsEmpty() ? FText::FromName(InId) : FText::FromString(InCloumnName))
.HAlignHeader(HAlign_Fill)
.VAlignHeader(VAlign_Fill)
.HeaderContentPadding(FMargin(2.f))
.HAlignCell(HAlign_Fill)
.VAlignCell(VAlign_Fill);
InHeader->AddColumn(ColumnArgs);
}
void SAssetSummaryView::InsertSortableColumn(TSharedPtr<SHeaderRow> InHeader, FName InId, const FString& InCloumnName)
{
SHeaderRow::FColumn::FArguments ColumnArgs;
ColumnArgs
.ColumnId(InId)
.DefaultLabel(InCloumnName.IsEmpty() ? FText::FromName(InId) : FText::FromString(InCloumnName))
.HAlignHeader(HAlign_Fill)
.VAlignHeader(VAlign_Fill)
.HeaderContentPadding(FMargin(2.f))
.HAlignCell(HAlign_Fill)
.VAlignCell(VAlign_Fill)
.SortMode(this, &SAssetSummaryView::GetSortModeForColumn, InId)
.OnSort(this, &SAssetSummaryView::OnSortModeChanged);
InHeader->AddColumn(ColumnArgs);
}
void SAssetSummaryView::OnSortModeChanged(const EColumnSortPriority::Type SortPriority, const FName& ColumnId, const EColumnSortMode::Type SortMode)
{
if (ColumnId != "SerialSize" && ColumnId != "SerialOffset")
{
return;
}
LastSortColumn = ColumnId;
LastSortMode = SortMode;
OnSortExportObjects();
ExportObjectListView->RebuildList();
}
EColumnSortMode::Type SAssetSummaryView::GetSortModeForColumn(const FName ColumnId) const
{
if (ColumnId != LastSortColumn)
{
return EColumnSortMode::None;
}
return LastSortMode;
}
void SAssetSummaryView::OnSortExportObjects()
{
if (ExportObjects.Num() <= 0)
{
return;
}
if (LastSortColumn == "SerialSize")
{
ExportObjects.Sort([this](const FObjectExportPtrType& Lhs, const FObjectExportPtrType& Rhs) -> bool
{
if (LastSortMode == EColumnSortMode::Ascending)
{
return Lhs->SerialSize < Rhs->SerialSize;
}
else
{
return Lhs->SerialSize > Rhs->SerialSize;
}
});
}
else if (LastSortColumn == "SerialOffset")
{
ExportObjects.Sort([this](const FObjectExportPtrType& Lhs, const FObjectExportPtrType& Rhs) -> bool
{
if (LastSortMode == EColumnSortMode::Ascending)
{
return Lhs->SerialOffset < Rhs->SerialOffset;
}
else
{
return Lhs->SerialOffset > Rhs->SerialOffset;
}
});
}
}
FORCEINLINE FText SAssetSummaryView::GetGuid() const
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
return ViewingPackage.IsValid() ? FText::FromString(ViewingPackage->AssetSummary->PackageSummary.Guid.ToString()) : FText();
PRAGMA_ENABLE_DEPRECATION_WARNINGS
}
FORCEINLINE FText SAssetSummaryView::GetIsUnversioned() const
{
return ViewingPackage.IsValid() ? FText::FromString(ViewingPackage->AssetSummary->PackageSummary.bUnversioned ? TEXT("true") : TEXT("false")) : FText();
}
FORCEINLINE FText SAssetSummaryView::GetFileVersionUE4() const
{
return ViewingPackage.IsValid() ? FText::AsNumber(ViewingPackage->AssetSummary->PackageSummary.GetFileVersionUE4()) : FText();
}
FORCEINLINE FText SAssetSummaryView::GetFileVersionLicenseeUE4() const
{
return ViewingPackage.IsValid() ? FText::AsNumber(ViewingPackage->AssetSummary->PackageSummary.GetFileVersionLicenseeUE4()) : FText();
}
FORCEINLINE FText SAssetSummaryView::GetPackageFlags() const
{
return ViewingPackage.IsValid() ? FText::FromString(FString::Printf(TEXT("0x%X"), ViewingPackage->AssetSummary->PackageSummary.PackageFlags)) : FText();
}
FORCEINLINE FText SAssetSummaryView::GetExportSize() const
{
return FText::AsMemory(TotalExportSize, EMemoryUnitStandard::IEC);
}
FORCEINLINE FText SAssetSummaryView::GetExportSizeTooltip() const
{
return FText::AsNumber(TotalExportSize);
}
FORCEINLINE FText SAssetSummaryView::GetDependencyCount() const
{
return ViewingPackage.IsValid() ? FText::AsNumber(ViewingPackage->AssetSummary->DependencyList.Num()) : FText();
}
FORCEINLINE FText SAssetSummaryView::GetDependentCount() const
{
return ViewingPackage.IsValid() ? FText::AsNumber(ViewingPackage->AssetSummary->DependentList.Num()) : FText();
}
DEFINE_GET_MEMBER_FUNCTION_NUMBER(TotalHeaderSize)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(NameCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(NameOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(ExportCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(ExportOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(ImportCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(ImportOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(GatherableTextDataCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(GatherableTextDataOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(DependsOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(SoftPackageReferencesCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(SoftPackageReferencesOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(SearchableNamesOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(ThumbnailTableOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(AssetRegistryDataOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(BulkDataStartOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(WorldTileInfoDataOffset)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(PreloadDependencyCount)
DEFINE_GET_MEMBER_FUNCTION_NUMBER(PreloadDependencyOffset)
#undef LOCTEXT_NAMESPACE
| [
"newzeadev@gmail.com"
] | newzeadev@gmail.com |
e7dbc7acbf7b915f2f21c74069d9f0b58b6e3efb | 2c148e207664a55a5809a3436cbbd23b447bf7fb | /src/chrome/browser/vr/elements/text_input.cc | af7a6bcb30eb585f67e3286313ec1e4a29e0610d | [
"BSD-3-Clause"
] | permissive | nuzumglobal/Elastos.Trinity.Alpha.Android | 2bae061d281ba764d544990f2e1b2419b8e1e6b2 | 4c6dad6b1f24d43cadb162fb1dbec4798a8c05f3 | refs/heads/master | 2020-05-21T17:30:46.563321 | 2018-09-03T05:16:16 | 2018-09-03T05:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,835 | cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/vr/elements/text_input.h"
#include <memory>
#include "chrome/browser/vr/elements/rect.h"
#include "chrome/browser/vr/elements/text.h"
#include "chrome/browser/vr/elements/ui_texture.h"
#include "ui/gfx/geometry/rect.h"
namespace {
constexpr int kCursorBlinkHalfPeriodMs = 600;
}
namespace vr {
TextInput::TextInput(float font_height_meters,
OnInputEditedCallback input_edit_callback)
: input_edit_callback_(input_edit_callback) {
auto text = std::make_unique<Text>(font_height_meters);
text->SetType(kTypeTextInputHint);
text->SetDrawPhase(kPhaseForeground);
text->set_focusable(false);
text->set_x_anchoring(LEFT);
text->set_x_centering(LEFT);
text->SetSize(1, 1);
text->SetLayoutMode(TextLayoutMode::kSingleLineFixedWidth);
text->SetAlignment(UiTexture::kTextAlignmentLeft);
hint_element_ = text.get();
this->AddChild(std::move(text));
text = std::make_unique<Text>(font_height_meters);
text->SetType(kTypeTextInputText);
text->SetDrawPhase(kPhaseForeground);
text->set_hit_testable(true);
text->set_focusable(false);
text->set_x_anchoring(LEFT);
text->set_x_centering(LEFT);
text->set_bubble_events(true);
text->SetSize(1, 1);
text->SetLayoutMode(TextLayoutMode::kSingleLineFixedWidth);
text->SetAlignment(UiTexture::kTextAlignmentLeft);
text->SetCursorEnabled(true);
text_element_ = text.get();
this->AddChild(std::move(text));
auto cursor = std::make_unique<Rect>();
cursor->SetVisible(false);
cursor->SetType(kTypeTextInputCursor);
cursor->SetDrawPhase(kPhaseForeground);
cursor->set_focusable(false);
cursor->set_x_anchoring(LEFT);
cursor->set_y_anchoring(BOTTOM);
cursor->SetColor(SK_ColorBLUE);
cursor_element_ = cursor.get();
text_element_->AddChild(std::move(cursor));
}
TextInput::~TextInput() {}
void TextInput::SetTextInputDelegate(TextInputDelegate* text_input_delegate) {
delegate_ = text_input_delegate;
}
void TextInput::OnButtonDown(const gfx::PointF& position) {
// Reposition the cursor based on click position.
int cursor_position = text_element_->GetCursorPositionFromPoint(position);
TextInputInfo new_info(edited_text_.current);
new_info.selection_start = cursor_position;
new_info.selection_end = cursor_position;
if (new_info != edited_text_.current) {
EditedText new_edited_text(edited_text_);
new_edited_text.Update(new_info);
UpdateInput(new_edited_text);
ResetCursorBlinkCycle();
}
}
void TextInput::OnButtonUp(const gfx::PointF& position) {
RequestFocus();
}
void TextInput::OnFocusChanged(bool focused) {
focused_ = focused;
// Update the keyboard with the current text.
if (delegate_ && focused)
delegate_->UpdateInput(edited_text_.current);
if (event_handlers_.focus_change)
event_handlers_.focus_change.Run(focused);
}
void TextInput::RequestFocus() {
if (!delegate_ || focused_)
return;
delegate_->RequestFocus(id());
}
void TextInput::RequestUnfocus() {
if (!delegate_ || !focused_)
return;
delegate_->RequestUnfocus(id());
}
void TextInput::SetHintText(const base::string16& text) {
hint_element_->SetText(text);
}
void TextInput::OnInputEdited(const EditedText& info) {
if (input_edit_callback_)
input_edit_callback_.Run(info);
}
void TextInput::OnInputCommitted(const EditedText& info) {
if (input_commit_callback_)
input_commit_callback_.Run(info);
}
void TextInput::SetTextColor(SkColor color) {
text_element_->SetColor(color);
}
void TextInput::SetHintColor(SkColor color) {
hint_element_->SetColor(color);
}
void TextInput::SetSelectionColors(const TextSelectionColors& colors) {
cursor_element_->SetColor(colors.cursor);
text_element_->SetSelectionColors(colors);
}
void TextInput::UpdateInput(const EditedText& info) {
if (edited_text_ == info)
return;
OnUpdateInput(info);
edited_text_ = info;
if (delegate_ && focused_) {
delegate_->UpdateInput(info.current);
}
text_element_->SetText(info.current.text);
text_element_->SetSelectionIndices(info.current.selection_start,
info.current.selection_end);
hint_element_->SetVisible(info.current.text.empty());
}
bool TextInput::OnBeginFrame(const gfx::Transform& head_pose) {
return SetCursorBlinkState(last_frame_time());
}
void TextInput::OnSetSize(const gfx::SizeF& size) {
hint_element_->SetFieldWidth(size.width());
text_element_->SetFieldWidth(size.width());
}
void TextInput::OnSetName() {
hint_element_->set_owner_name_for_test(name());
text_element_->set_owner_name_for_test(name());
cursor_element_->set_owner_name_for_test(name());
}
void TextInput::LayOutChildren() {
// To avoid re-rendering a texture when the cursor blinks, the texture is a
// separate element. Once the text has been laid out, we can position the
// cursor appropriately relative to the text field.
gfx::RectF bounds = text_element_->GetCursorBounds();
cursor_element_->SetTranslate(bounds.x(), bounds.y(), 0);
cursor_element_->SetSize(bounds.width(), bounds.height());
}
bool TextInput::SetCursorBlinkState(const base::TimeTicks& time) {
base::TimeDelta delta = time - cursor_blink_start_ticks_;
bool visible = focused_ && edited_text_.current.SelectionSize() == 0 &&
(delta.InMilliseconds() / kCursorBlinkHalfPeriodMs + 1) % 2;
if (cursor_visible_ == visible)
return false;
cursor_visible_ = visible;
cursor_element_->SetVisible(visible);
return true;
}
void TextInput::ResetCursorBlinkCycle() {
cursor_blink_start_ticks_ = base::TimeTicks::Now();
}
void TextInput::OnUpdateInput(const EditedText& info) {}
} // namespace vr
| [
"jiawang.yu@spreadtrum.com"
] | jiawang.yu@spreadtrum.com |
3e6e2857aa6722fa27073ec61680e4cf02be91f4 | ffcc850625b8590866a36d0a607e3a73cf37598d | /test/doc/ieee/modf.cpp | eee66e01631016714106b9ee134af0c07f108c50 | [
"BSL-1.0"
] | permissive | remymuller/boost.simd | af7e596f17294d35ddcd8f859c4a12cb3276254d | c6614f67be94be2608342bf5d753917b6968e821 | refs/heads/develop | 2021-01-02T09:00:18.137281 | 2017-07-06T14:23:04 | 2017-07-06T14:23:04 | 99,120,027 | 6 | 7 | null | 2017-08-02T13:34:55 | 2017-08-02T13:34:55 | null | UTF-8 | C++ | false | false | 1,298 | cpp | //==================================================================================================
/*
Copyright 2017 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//==================================================================================================
//! [modf]
#include <boost/simd/ieee.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft px = {1.0f, 2.0f, -1.0f, 0.5f};
pack_ft pe, pf;
std::tie(pe, pf) = bs::modf(pf);
std::cout
<< "---- simd" << '\n'
<< "<- px = " << px << '\n'
<< "-> std::tie(pe, pf) = bs::modf(px) = " << '\n'
<< "-> pe = " << pe << '\n'
<< "-> pf = " << pf << '\n';
float x = 2.0f;
float e, f;
std::tie(e, f) = bs::modf(x);
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << x << '\n'
<< "-> std::tie(e, f) = bs::modf(x) = " << '\n'
<< "-> e = " << e << '\n'
<< "-> f = " << f << '\n';
return 0;
}
//! [modf]
| [
"joel.falcou@lri.fr"
] | joel.falcou@lri.fr |
d32f0276faef2490a651e22608ddc2626c8ec088 | dd267038685dcefd5f89016c63f72c2ad4aa7fdf | /src/media/neva/media_platform_api_stub.h | 09e1897b6f7e5a3b62036f2af3091b60fd0a4399 | [
"BSD-3-Clause"
] | permissive | webosose/chromium87 | 044d5c74ae9c2815cf096fd98bf9ea4e7e2fe6b3 | 75729b78817d49249cd004ef734c032269f06e53 | refs/heads/master | 2022-11-05T07:23:21.710708 | 2021-10-06T11:24:51 | 2021-10-08T08:30:55 | 392,617,373 | 4 | 2 | null | 2022-11-01T02:23:21 | 2021-08-04T08:54:03 | null | UTF-8 | C++ | false | false | 2,321 | h | // Copyright 2019 LG Electronics, Inc.
//
// 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.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef MEDIA_NEVA_MEDIA_PLATFORM_API_STUB_H_
#define MEDIA_NEVA_MEDIA_PLATFORM_API_STUB_H_
#include "media/neva/media_platform_api.h"
namespace media {
class MEDIA_EXPORT MediaPlatformAPIStub : public MediaPlatformAPI {
public:
MediaPlatformAPIStub();
void Initialize(const AudioDecoderConfig& audio_config,
const VideoDecoderConfig& video_config,
const PipelineStatusCB& init_cb) override;
// rect and in_rect should not empty.
void SetDisplayWindow(const gfx::Rect& rect,
const gfx::Rect& in_rect,
bool fullscreen) override;
bool Feed(const scoped_refptr<DecoderBuffer>& buffer, FeedType type) override;
void Seek(base::TimeDelta time) override;
void Suspend(SuspendReason reason) override;
void Resume(base::TimeDelta paused_time,
RestorePlaybackMode restore_playback_mode) override;
void SetPlaybackRate(float playback_rate) override;
void SetPlaybackVolume(double volume) override;
bool AllowedFeedVideo() override;
bool AllowedFeedAudio() override;
void Finalize() override;
void SetKeySystem(const std::string& key_system) override;
bool IsEOSReceived() override;
void UpdateVideoConfig(const VideoDecoderConfig& video_config) override;
void SetVisibility(bool visible) override;
void SwitchToAutoLayout() override;
void SetDisableAudio(bool disable) override;
bool HaveEnoughData() override;
private:
~MediaPlatformAPIStub() override;
friend class base::RefCountedThreadSafe<MediaPlatformAPIStub>;
DISALLOW_COPY_AND_ASSIGN(MediaPlatformAPIStub);
};
} // namespace media
#endif // MEDIA_NEVA_MEDIA_PLATFORM_API_STUB_H_
| [
"youngsoo.choi@lge.com"
] | youngsoo.choi@lge.com |
b1dbcd36c757f57dc6863fe08a21bff55555f2f7 | 0f1510c57ef15588f8fb6e4c444b075d43340887 | /remesher/src/quad.cpp | fba5da3ec921987918e253956db571b7803f5d68 | [] | no_license | graphics-rpi/oasis_dependencies | c553ee678ad9ccccb8b223afcc6c9ed4851d43a8 | 384553df4842c1b2868db344c48b1d7e88bfe873 | refs/heads/master | 2021-10-08T13:23:00.351524 | 2018-12-12T16:37:53 | 2018-12-12T16:37:53 | 123,350,193 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,287 | cpp | #include <cstdio>
#include "utils.h"
#include "mesh.h"
#include "element.h"
#include "quad.h"
#include "vertex.h"
#include "triangle.h"
extern int VERBOSE_FLAG;
extern char LAST_ACTION[200];
Quad::Quad(int a, int b, int c, int d, Mesh *mesh, std::string mat) : Element(mesh,mat) {
assert (a >= 0 && b >= 0 && c >= 0 && d >= 0);
assert (a != b && b != c && a != c && a != d && b != d && c != d);
verts[0] = a;
verts[1] = b;
verts[2] = c;
verts[3] = d;
Vec3f va = mesh->getVertex((*this)[0])->get();
Vec3f vb = mesh->getVertex((*this)[1])->get();
Vec3f vc = mesh->getVertex((*this)[2])->get();
::computeNormal(va,vb,vc,normal);
}
Quad::~Quad() {
}
bool Quad::IntersectsSegment
(const Vec3f &q1, const Vec3f &q2, const Vec3f &q3, const Vec3f &q4, const Vec3f &normal,
const Vec3f &s1, const Vec3f &s2) {
Vec3f _N_;
::computeNormal(q1,q2,q3,_N_);
//double tmp_dot = _N_.Dot3(normal);
// std::cout << "tmp_dot " << tmp_dot << " " << std::endl;
if (_N_.Dot3(normal) < 0.9) return false;
if (_N_.Dot3(normal) < 0.99) {
//std::cout << "FIX Intersectssegment for ramps" << std::endl;
return false;
}
assert (_N_.Dot3(normal) > 0.99);
double d = normal.Dot3(q1);
double d1 = normal.Dot3(s1) - d;
double d2 = normal.Dot3(s2) - d;
if ((d1 >= -EPSILON && d2 >= -EPSILON) ||
(d1 <= EPSILON && d2 <= EPSILON))
return false;
// compute intersection point
double tmp = fabs(d1 - d2);
assert (tmp > EPSILON);
d1 = fabs(d1/tmp);
d2 = fabs(d2/tmp);
Vec3f pt = s1 * d2 + s2 * d1;
return PointInside(q1,q2,q3,q4,normal,pt);
}
bool Quad::PointInside
(const Vec3f &q1, const Vec3f &q2, const Vec3f &q3, const Vec3f &q4, const Vec3f &normal,
const Vec3f &pt) {
// if the intersection point is interior to the quad
// they intersect
Vec3f v12 = q2-q1; //v12.Normalize();
Vec3f v1 = pt-q1; //v1.Normalize();
Vec3f c1; Vec3f::Cross3(c1, v12, v1); //c1.Normalize();
double dot1 = normal.Dot3(c1);
if (dot1 < 0) return false;
Vec3f v23 = q3-q2; //v23.Normalize();
Vec3f v2 = pt-q2; //v2.Normalize();
Vec3f c2; Vec3f::Cross3(c2, v23, v2); //c2.Normalize();
double dot2 = normal.Dot3(c2);
if (dot2 < 0) return false;
Vec3f v34 = q4-q3; //v34.Normalize();
Vec3f v3 = pt-q3; //v3.Normalize();
Vec3f c3; Vec3f::Cross3(c3, v34, v3); //c3.Normalize();
double dot3 = normal.Dot3(c3);
if (dot3 < 0) return false;
Vec3f v41 = q1-q4; //v41.Normalize();
Vec3f v4 = pt-q4; //v4.Normalize();
Vec3f c4; Vec3f::Cross3(c4, v41, v4); //c4.Normalize();
double dot4 = normal.Dot3(c4);
if (dot4 < 0) return false;
return true;
}
void Quad::Check() const {
for (int i = 0; i < 4; i++) {
//Element *e = getNeighbor(i);
std::vector<Element*> vec = getNeighbors(i);
for (unsigned int j = 0; j < vec.size(); j++) {
Element *e = vec[j];
//assert (e->isAQuad());
//Quad *q = (Quad*)e;
//int j = t->WhichVertex((*this)[(i+1)%3]);
//assert (j >= 0 && j < 3);
//assert ((Quad*)t->getNeighbor(j) == this);
assert (e->hasNeighbor(this));
}
}
}
/*
void Quad::WeightedNormalAtVertex(int vert, Vec3f &normal) {
assert (HasVertex(vert));
Mesh *m = getMesh();
Vec3f a = m->getVertex((*this)[0])->get();
Vec3f b = m->getVertex((*this)[1])->get();
Vec3f c = m->getVertex((*this)[2])->get();
computeNormal(normal);
double angle;
Vec3f vab(b,a); vab.Normalize();
Vec3f vbc(c,b); vbc.Normalize();
Vec3f vca(a,c); vca.Normalize();
static Vec3f zero(0,0,0);
Vec3f _vab(zero,vab);
Vec3f _vbc(zero,vbc);
Vec3f _vca(zero,vca);
if (vert == (*this)[0])
angle = AngleBetweenNormalized(vca,_vab);
else if (vert == (*this)[1])
angle = AngleBetweenNormalized(vab,_vbc);
else {
assert (vert == (*this)[2]);
angle = AngleBetweenNormalized(vbc,_vca);
}
normal *= angle;
}
*/
void Quad::Print(const char *s) const {
printf ("%s QUAD %4d: %4d %4d %4d %4d", s, (int)this->getID(),
verts[0],verts[1],verts[2],verts[3]);
printf ("\n");
getMesh()->getVertex((*this)[0])->get().Print(" 0");
getMesh()->getVertex((*this)[1])->get().Print(" 1");
getMesh()->getVertex((*this)[2])->get().Print(" 2");
getMesh()->getVertex((*this)[3])->get().Print(" 3");
std::cout << " material " << getRealMaterialName() << std::endl;
}
void Quad::PrintLots(const char *s) const {
Print(s);
Vec3f center; computeCentroid(center);
center.Print("center");
for (int i = 0; i < 4; i++) {
std::vector<Element*> vec = getNeighbors(i);
printf ("neighbors %d: \n",i);
for (unsigned int j = 0; j < vec.size(); j++) {
vec[j]->Print();
}
}
}
bool Quad::IntersectsSegment(const Vec3f &s1, const Vec3f &s2) const {
Mesh *m = getMesh();
return IntersectsSegment(m->getVertex(verts[0])->get(),
m->getVertex(verts[1])->get(),
m->getVertex(verts[2])->get(),
m->getVertex(verts[3])->get(),
normal,
s1,s2);
}
double Quad::Area() const {
Mesh *m = getMesh();
return Area(m->getVertex(verts[0])->get(),
m->getVertex(verts[1])->get(),
m->getVertex(verts[2])->get(),
m->getVertex(verts[3])->get());
}
/*
void Quad::computeMovedNormal(Vec3f &normal) const {
Mesh *m = getMesh();
::computeNormal(m->getVertex(verts[0])->getPositionOrMovedPosition(),
m->getVertex(verts[1])->getPositionOrMovedPosition(),
m->getVertex(verts[2])->getPositionOrMovedPosition(),
//m->getVertex(verts[3])->getPositionOrMovedPosition(),
normal);
}
double Quad::MovedPositionArea() const {
Mesh *m = getMesh();
return Area(m->getVertex(verts[0])->getPositionOrMovedPosition(),
m->getVertex(verts[1])->getPositionOrMovedPosition(),
m->getVertex(verts[2])->getPositionOrMovedPosition(),
m->getVertex(verts[3])->getPositionOrMovedPosition());
}
double Quad::ShortestMovedEdge() const {
Vec3f a = getMesh()->getVertex((*this)[0])->getPositionOrMovedPosition();
Vec3f b = getMesh()->getVertex((*this)[1])->getPositionOrMovedPosition();
Vec3f c = getMesh()->getVertex((*this)[2])->getPositionOrMovedPosition();
Vec3f d = getMesh()->getVertex((*this)[3])->getPositionOrMovedPosition();
return min4(DistanceBetweenTwoPoints(a,b),
DistanceBetweenTwoPoints(b,c),
DistanceBetweenTwoPoints(c,d),
DistanceBetweenTwoPoints(d,a));
}
*/
double Quad::Area(const Vec3f &a, const Vec3f &b, const Vec3f &c, const Vec3f &d) {
return ::AreaOfTriangle(a,b,c) + ::AreaOfTriangle(a,c,d);
}
int Quad::ShortestEdgeIndex() const {
Vec3f a = getMesh()->getVertex((*this)[0])->get();
Vec3f b = getMesh()->getVertex((*this)[1])->get();
Vec3f c = getMesh()->getVertex((*this)[2])->get();
Vec3f d = getMesh()->getVertex((*this)[3])->get();
double ab = DistanceBetweenTwoPoints(a,b);
double bc = DistanceBetweenTwoPoints(b,c);
double cd = DistanceBetweenTwoPoints(c,d);
double da = DistanceBetweenTwoPoints(d,a);
if (ab <= bc && ab <= cd && ab <= da) return 0;
if (bc <= ab && bc <= cd && bc <= da) return 1;
if (cd <= ab && cd <= bc && cd <= da) return 2;
assert (da <= ab && da <= bc && da <= cd);
return 3;
}
/*
void Quad::setBlendWeight(unsigned int i, unsigned int j, double weight) {
assert (i >= 0 && i < 4);
while (j >= blend_weights[0].size()) {
blend_weights[0].push_back(0.0);
blend_weights[1].push_back(0.0);
blend_weights[2].push_back(0.0);
blend_weights[3].push_back(0.0);
}
assert (j < blend_weights[i].size());
blend_weights[i][j] = weight;
}
*/
/*
void Quad::normalizeBlendWeights() {
for (int i = 0; i < 4; i++) {
double total = 0;
unsigned int num = blend_weights[i].size();
for (unsigned int j = 0; j < num; j++) {
if (blend_weights[i][j] < 0.001) continue;
//assert (blend_weights[j] > 0.999);
total += blend_weights[i][j];
}
if (total < 0.001) continue;
for (unsigned int j = 0; j < num; j++) {
setBlendWeight(i,j,blend_weights[i][j]/total);
}
/ *
total = 0;
for (unsigned int j = 0; j < num; j++) {
total += blend_weights[j];
}
if (fabs(total-1) > 0.0001) return 0; // ? this shouldn't be necessary
assert (fabs(total-1) < 0.0001);
return 1;
* /
}
}
*/
| [
"sensen.chen7@gmail.com"
] | sensen.chen7@gmail.com |
deddb09b385bdc4aee64280b0a639231554f7296 | 744af52470a8d8d63df0da99587ec99e21e1926c | /game/physics/math.h | 5e69631161878c2f654874b971347f80c3f7f624 | [] | no_license | TTeun/SDL | 5bfe9267c241a907ad15d874d3beaa00db6c5f0c | fb16f2ba291fb376f03b727c5b673c4f4021b161 | refs/heads/master | 2021-01-25T06:17:51.431276 | 2017-07-07T14:54:56 | 2017-07-07T14:54:56 | 93,547,541 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 144 | h | #ifndef __MATH__H
#define __MATH__H
namespace Math {
template<typename T>
inline T max(T a, T b){
return a > b ? a : b;
}
}
#endif
| [
"teunverstraaten@gmail.com"
] | teunverstraaten@gmail.com |
18df1ef6a24cb32c53a4cd374b1d7b4e89161fe8 | 7eea3d8510b5ded6c1bd1d04edfde67ac3dd6624 | /sketch/sketch.ino | 99c8c565151cf828a64f2ca8f49e4e324f5b1c69 | [
"MIT"
] | permissive | just4chill/RFNode | 5419db444af7d0aa5fb46fcff4c213256c3663d0 | b2d9ddec477b7ec1c1c64397d851657b3abbfebc | refs/heads/master | 2021-01-16T01:08:05.335122 | 2015-03-27T02:39:11 | 2015-03-27T02:39:11 | 32,963,962 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 540 | ino |
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
#define __ADDR "clie2"
void setup(){
Serial.begin(9600);
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
Mirf.setRADDR((byte *)__ADDR);
Mirf.payload = sizeof(unsigned long);
Mirf.config();
Serial.println(__ADDR);
}
unsigned long time = 12345;
void loop()
{
byte data[Mirf.payload];
while(!Mirf.dataReady())
{
;
}
Serial.println("Got Data");
Mirf.getData(data);
Serial.print((char *)data);
}
| [
"stonrmind@gmail.com"
] | stonrmind@gmail.com |
0517fe3de2dfb32a7968ebd3c4d4e465f7e81d7c | 94c81d3dc008f9cc7844c4c949d9e8c387307524 | /algorithm/1504번 특정한 최단 경로.cpp | b6f19afdcda2bb8dc50e6e15b662b4c8c6d1c281 | [] | no_license | JunJun0411/Algorithm | 237fd0a040b4957878e08c674cbd9a4c9260dada | c6205f102e1baada2f7443abb7a32dead45c2ee8 | refs/heads/master | 2021-06-26T18:10:33.632374 | 2020-11-12T10:15:59 | 2020-11-12T10:15:59 | 162,801,959 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,603 | cpp | #include <iostream>
#include <queue>
#include <vector>
#define INF 987654321
using namespace std;
vector<pair<int, int> > grape[801];
vector<int> dijkstra(int src, int n) {
vector<int> dist(n + 1, INF);
dist[src] = 0;
priority_queue<pair<int, int> > pq;
pq.push({ 0, src });
while (!pq.empty()) {
int cost = -pq.top().first;
int here = pq.top().second;
pq.pop();
// 더 짧은 경로 있다면 패스
if (dist[here] < cost ) continue;
for (int i = 0; i < grape[here].size(); i++) {
int nextDist = cost + grape[here][i].first;
int there = grape[here][i].second;
if (dist[there] > nextDist ) {
dist[there] = nextDist;
pq.push({ -nextDist, there });
}
}
}
return dist;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N, E;
cin >> N >> E;
for (int i = 0; i < E; i++) {
// a번 정점에서 b번 정점까지 양방향 길이 c
int a, b, c;
cin >> a >> b >> c;
grape[a].push_back({ c, b });
grape[b].push_back({ c, a });
}
// 반드시 거쳐야 하는 정점 번호
int V1, V2;
cin >> V1 >> V2;
vector<int> first = dijkstra(1, N);
vector<int> second = dijkstra(V1, N);
vector<int> third = dijkstra(V2, N);
int R1 = first[V1] + second[V2] + third[N];
int R2 = first[V2] + third[V1] + second[N];
if (R1 < 0 || R1 >= INF) R1 = INF;
if (R2 < 0 || R2 >= INF) R2 = INF;
if (R1 == INF || R2 == INF) {
if (R1 == INF && R2 == INF) cout << "-1" << '\n';
else if (R1 == INF) cout << R2 << "\n";
else cout << R1 << '\n';
}
else {
if (R1 <= R2) cout << R1 << '\n';
else cout << R2 << '\n';
}
return 0;
} | [
"wnsgudrnrn@naver.com"
] | wnsgudrnrn@naver.com |
5f6d081bd7aaa748518fbc97ee5ad752da1daff1 | 0de6275df97934352289d5bf561650330ac0f269 | /src/mruby_SDL_Color.cpp | 11bba89f4b5bbf3f9d680da32ad6a15df84f62a9 | [] | no_license | jbreeden/mruby-sdl2 | 595cffa1dbf3000d995a57d36a456e4e573c55a6 | a60f9a02aba000e136b1c65b3e3f11331fab6631 | refs/heads/master | 2021-01-10T08:55:33.929138 | 2015-12-05T07:44:00 | 2015-12-05T07:44:00 | 45,621,888 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,600 | cpp | /*
* struct SDL_Color
* Defined in file SDL_pixels.h @ line 254
*/
/*
* TODO: INCLUDES
*/
#include "mruby_SDL.h"
#if BIND_SDLColor_TYPE
/*
* Class Methods
*/
#if BIND_SDLColor_INITIALIZE
mrb_value
mrb_SDL_SDLColor_initialize(mrb_state* mrb, mrb_value self) {
struct SDL_Color* native_object = (struct SDL_Color*)malloc(sizeof(struct SDL_Color));
mruby_gift_SDL_Color_data_ptr(self, native_object);
return self;
}
#endif
mrb_value
mrb_SDL_SDLColor_disown(mrb_state* mrb, mrb_value self) {
mrb_value ruby_object;
mrb_get_args(mrb, "o", &ruby_object);
if (!mrb_obj_is_kind_of(mrb, ruby_object, mrb_class_ptr(self))) {
mrb_raise(mrb, E_TYPE_ERROR, "SDL::SDLColor.disown only accepts objects of type SDL::SDLColor");
return mrb_nil_value();
}
((mruby_to_native_ref*)(DATA_PTR(ruby_object)))->belongs_to_ruby = FALSE;
return mrb_nil_value();
}
mrb_value
mrb_SDL_SDLColor_belongs_to_ruby(mrb_state* mrb, mrb_value self) {
mrb_value ruby_object;
mrb_get_args(mrb, "o", &ruby_object);
if (!mrb_obj_is_kind_of(mrb, ruby_object, mrb_class_ptr(self))) {
mrb_raise(mrb, E_TYPE_ERROR, "SDL::SDLColor.belongs_to_ruby only accepts objects of type SDL::SDLColor");
return mrb_nil_value();
}
if ( ((mruby_to_native_ref*)(DATA_PTR(ruby_object)))->belongs_to_ruby ) {
return mrb_true_value();
} else {
return mrb_false_value();
}
}
/*
* Fields
*/
#if BIND_SDLColor_r_FIELD_READER
/* get_r
*
* Return Type: Uint8
*/
mrb_value
mrb_SDL_SDLColor_get_r(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
Uint8 native_field = native_self->r;
mrb_value ruby_field = mrb_fixnum_value(native_field);
return ruby_field;
}
#endif
#if BIND_SDLColor_r_FIELD_WRITER
/* set_r
*
* Parameters:
* - value: Uint8
*/
mrb_value
mrb_SDL_SDLColor_set_r(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
mrb_value ruby_field;
mrb_get_args(mrb, "o", &ruby_field);
/* type checking */
if (!mrb_obj_is_kind_of(mrb, ruby_field, mrb->fixnum_class)) { mrb_raise(mrb, E_TYPE_ERROR, "Fixnum expected"); return mrb_nil_value(); }
Uint8 native_field = mrb_fixnum(ruby_field);
native_self->r = native_field;
return ruby_field;
}
#endif
#if BIND_SDLColor_g_FIELD_READER
/* get_g
*
* Return Type: Uint8
*/
mrb_value
mrb_SDL_SDLColor_get_g(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
Uint8 native_field = native_self->g;
mrb_value ruby_field = mrb_fixnum_value(native_field);
return ruby_field;
}
#endif
#if BIND_SDLColor_g_FIELD_WRITER
/* set_g
*
* Parameters:
* - value: Uint8
*/
mrb_value
mrb_SDL_SDLColor_set_g(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
mrb_value ruby_field;
mrb_get_args(mrb, "o", &ruby_field);
/* type checking */
if (!mrb_obj_is_kind_of(mrb, ruby_field, mrb->fixnum_class)) { mrb_raise(mrb, E_TYPE_ERROR, "Fixnum expected"); return mrb_nil_value(); }
Uint8 native_field = mrb_fixnum(ruby_field);
native_self->g = native_field;
return ruby_field;
}
#endif
#if BIND_SDLColor_b_FIELD_READER
/* get_b
*
* Return Type: Uint8
*/
mrb_value
mrb_SDL_SDLColor_get_b(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
Uint8 native_field = native_self->b;
mrb_value ruby_field = mrb_fixnum_value(native_field);
return ruby_field;
}
#endif
#if BIND_SDLColor_b_FIELD_WRITER
/* set_b
*
* Parameters:
* - value: Uint8
*/
mrb_value
mrb_SDL_SDLColor_set_b(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
mrb_value ruby_field;
mrb_get_args(mrb, "o", &ruby_field);
/* type checking */
if (!mrb_obj_is_kind_of(mrb, ruby_field, mrb->fixnum_class)) { mrb_raise(mrb, E_TYPE_ERROR, "Fixnum expected"); return mrb_nil_value(); }
Uint8 native_field = mrb_fixnum(ruby_field);
native_self->b = native_field;
return ruby_field;
}
#endif
#if BIND_SDLColor_a_FIELD_READER
/* get_a
*
* Return Type: Uint8
*/
mrb_value
mrb_SDL_SDLColor_get_a(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
Uint8 native_field = native_self->a;
mrb_value ruby_field = mrb_fixnum_value(native_field);
return ruby_field;
}
#endif
#if BIND_SDLColor_a_FIELD_WRITER
/* set_a
*
* Parameters:
* - value: Uint8
*/
mrb_value
mrb_SDL_SDLColor_set_a(mrb_state* mrb, mrb_value self) {
struct SDL_Color * native_self = mruby_unbox_SDL_Color(self);
mrb_value ruby_field;
mrb_get_args(mrb, "o", &ruby_field);
/* type checking */
if (!mrb_obj_is_kind_of(mrb, ruby_field, mrb->fixnum_class)) { mrb_raise(mrb, E_TYPE_ERROR, "Fixnum expected"); return mrb_nil_value(); }
Uint8 native_field = mrb_fixnum(ruby_field);
native_self->a = native_field;
return ruby_field;
}
#endif
void mrb_SDL_SDLColor_init(mrb_state* mrb) {
RClass* SDLColor_class = mrb_define_class_under(mrb, SDL_module(mrb), "Color", mrb->object_class);
MRB_SET_INSTANCE_TT(SDLColor_class, MRB_TT_DATA);
#if BIND_SDLColor_INITIALIZE
mrb_define_method(mrb, SDLColor_class, "initialize", mrb_SDL_SDLColor_initialize, MRB_ARGS_NONE());
#endif
mrb_define_class_method(mrb, SDLColor_class, "disown", mrb_SDL_SDLColor_disown, MRB_ARGS_ARG(1, 0));
mrb_define_class_method(mrb, SDLColor_class, "belongs_to_ruby?", mrb_SDL_SDLColor_belongs_to_ruby, MRB_ARGS_ARG(1, 0));
/*
* Fields
*/
#if BIND_SDLColor_r_FIELD_READER
mrb_define_method(mrb, SDLColor_class, "r", mrb_SDL_SDLColor_get_r, MRB_ARGS_ARG(0, 0));
#endif
#if BIND_SDLColor_r_FIELD_WRITER
mrb_define_method(mrb, SDLColor_class, "r=", mrb_SDL_SDLColor_set_r, MRB_ARGS_ARG(1, 0));
#endif
#if BIND_SDLColor_g_FIELD_READER
mrb_define_method(mrb, SDLColor_class, "g", mrb_SDL_SDLColor_get_g, MRB_ARGS_ARG(0, 0));
#endif
#if BIND_SDLColor_g_FIELD_WRITER
mrb_define_method(mrb, SDLColor_class, "g=", mrb_SDL_SDLColor_set_g, MRB_ARGS_ARG(1, 0));
#endif
#if BIND_SDLColor_b_FIELD_READER
mrb_define_method(mrb, SDLColor_class, "b", mrb_SDL_SDLColor_get_b, MRB_ARGS_ARG(0, 0));
#endif
#if BIND_SDLColor_b_FIELD_WRITER
mrb_define_method(mrb, SDLColor_class, "b=", mrb_SDL_SDLColor_set_b, MRB_ARGS_ARG(1, 0));
#endif
#if BIND_SDLColor_a_FIELD_READER
mrb_define_method(mrb, SDLColor_class, "a", mrb_SDL_SDLColor_get_a, MRB_ARGS_ARG(0, 0));
#endif
#if BIND_SDLColor_a_FIELD_WRITER
mrb_define_method(mrb, SDLColor_class, "a=", mrb_SDL_SDLColor_set_a, MRB_ARGS_ARG(1, 0));
#endif
}
#endif
| [
"jared.breeden@gmail.com"
] | jared.breeden@gmail.com |
c0e052d7bb84a8a863e409dca8864f06e5bdc1a8 | 9b90289fb5c8e07857cac667208d385402c02096 | /chapter04/08/StudentGrade.cpp | de5dd760e2399981f22e740184073ff8f7869909 | [] | no_license | MaxEntroy/accelerated-cpp | d93615d4880b4e6244835af881266380e755c073 | 799ee0a3d0cef3981e89f8144900d7e1fc3e2b14 | refs/heads/master | 2020-04-05T04:20:02.217896 | 2019-09-27T06:04:24 | 2019-09-27T06:04:24 | 156,546,992 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,970 | cpp | /*************************************************************************
> File Name: StudentGrade.cpp
> Author: kang
> Mail: likang@tju.edu.cn
> Created Time: 2017年11月28日 星期二 20时40分23秒
************************************************************************/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdexcept>
#include <ios>
#include <iomanip>
struct StudentInfo {
std::string name;
double midterm_grade;
double final_grade;
double total_grade;
std::vector<double> hw;
StudentInfo() : midterm_grade(0.0), final_grade(0.0), total_grade(0.0) { }
};
bool compare( const StudentInfo&, const StudentInfo& );
double get_grade( double, double, const std::vector<double>& );
double get_grade( double, double, double );
double get_median( std::vector<double> );
std::istream& read_stu( std::istream&, StudentInfo& );
std::istream& read_stu_hw( std::istream&, std::vector<double>& );
int main(void) {
const char* input_path = "grade.dat";
std::ifstream fin;
fin.open(input_path);
if( !fin.is_open() ) {
std::cerr << "fin.open()";
return -1;
}
std::vector<StudentInfo> vec_stu;
int max_len = -1;
try{
StudentInfo s;
while(read_stu(fin, s)) {
s.total_grade = get_grade( s.midterm_grade, s.final_grade, s.hw );
vec_stu.push_back(s);
int name_sz = s.name.size();
max_len = (name_sz > max_len)?name_sz:max_len;
}
}
catch( std::domain_error e ) {
std::cout << e.what();
fin.close();
}
std::sort( vec_stu.begin(), vec_stu.end(), compare );
int sz = vec_stu.size();
std::streamsize prec = std::cout.precision();
std::cout << std::setprecision(3);
for( int i = 0; i < sz; ++i ) {
std::string spaces( max_len - vec_stu[i].name.size() + 1, ' ' );
std::cout << vec_stu[i].name << spaces << vec_stu[i].total_grade << std::endl;
}
std::cout << std::setprecision(prec);
fin.close();
return 0;
}
double get_grade( double midterm_grade, double final_grade, const std::vector<double>& hw ) {
if( !hw.size() )
throw std::domain_error( "hw is empty!" );
double median = get_median( hw );
return get_grade( midterm_grade, final_grade, median );
}
double get_grade( double mid, double fin, double med ) {
return mid*0.2 + fin*0.4 + med*0.4;
}
double get_median( std::vector<double> hw) {
if( !hw.size() )
throw std::domain_error( "hw is empty!" );
std::sort( hw.begin(), hw.end() );
int sz = hw.size();
return (sz&1)?hw[sz/2]:1.0/2*(hw[sz/2] + hw[sz/2-1]);
}
std::istream& read_stu( std::istream& is, StudentInfo& s ) {
if(is) {
is >> s.name >> s.midterm_grade >> s.final_grade;
read_stu_hw( is, s.hw );
}
return is;
}
std::istream& read_stu_hw( std::istream& is, std::vector<double>& hw ) {
if( is ) {
hw.clear();
double x = 0.0;
while( is >> x ) {
hw.push_back(x);
}
is.clear();
}
return is;
}
bool compare( const StudentInfo& a, const StudentInfo& b ) {
return a.name < b.name;
}
| [
"likang@tju.edu.cn"
] | likang@tju.edu.cn |
bc3f9f7425353be8e74941436337fe97d97b29b2 | 31fb0637247e423776ea25986a2a23efaacafece | /Unit 12. Classes and dynamic allocation memory/Stack.cpp | 247ce72e6d16d238f574c9fa32ba0ed1b4407bf5 | [] | no_license | Cordylidae/Exercises | 0b8a6bcc8c3493ef81653d99185027de0c4825b7 | 4fe4658e807f0c55afcbe6441739c2dc4929e597 | refs/heads/main | 2023-02-07T09:20:08.117163 | 2020-12-29T18:35:44 | 2020-12-29T18:35:44 | 325,356,588 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,270 | cpp | #include"Stack.h"
Stack::Stack(int n)
{
pitems = new Item[n];
size = n;
top = n;
for (int i = 0; i < n; i++)
{
pitems[i]=i;
}
}
Stack::~Stack()
{
delete [] pitems;
}
bool Stack::isempty() const
{
return top == 0;
}
bool Stack::isfull() const
{
return top == MAX;
}
bool Stack::push(const Item& item)
{
if (top < MAX)
{
Stack temp = (*this);
size++;
top++;
delete [] pitems;
pitems = new Item[size];
for (int i = 0; i < size - 1; i++)
{
pitems[i] = temp.pitems[i];
}
pitems[top - 1] = item;
return true;
}
else
return false;
}
bool Stack::pop(Item& item)
{
if (top > 0)
{
Stack temp = (*this);
size--;
top--;
item = pitems[top];
delete[] pitems;
if (size != 0)pitems = new Item[size];
else pitems = nullptr;
for (int i = 0; i < size; i++)
{
pitems[i] = temp.pitems[i];
}
return true;
}
else
return false;
}
Stack::Stack(const Stack& st)
{
size = st.size;
pitems = new Item[size];
for (int i = 0; i < size; i++)
{
pitems[i] = st.pitems[i];
}
top = st.top;
}
Stack& Stack::operator=(const Stack& st)
{
size = st.size;
delete[] pitems;
pitems = new Item[size];
for (int i = 0; i < size; i++)
{
pitems[i] = st.pitems[i];
}
top = st.top;
return *this;
}
| [
"nsbeketov@gmail.com"
] | nsbeketov@gmail.com |
6f447d68712933addf49351ab6e9d3821c4a4981 | a92d820846a0db824c93598b12fd74ddd2a6539d | /airplaneFight/Classes/Combat/Scene/GameLayer.cpp | 53b3742f359ab5c9ce2e9a39366dc68f07f17c1b | [
"Apache-2.0"
] | permissive | 82488059/AirPlane | 617a7bc8a04fbf26e51e20e3280395de5b53937c | a27965632ea282ff28e594a65083c9f301db4a3d | refs/heads/master | 2021-01-13T09:56:31.135369 | 2015-10-27T09:07:10 | 2015-10-27T09:07:10 | 44,507,293 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 8,412 | cpp | #include "GameLayer.h"
#include "Hero.h"
#include "PlaneEnemy.h"
#include "CombatManager.h"
#include "Bullet.h"
GameLayer::GameLayer()
: m_pHero(NULL),
m_nKeyPressed(0),
m_bIsPressed(false),
m_nbgSpeed(1)
{
}
GameLayer::~GameLayer()
{
}
bool GameLayer::init()
{
if (!Layer::init())
{
return false;
}
m_pHero = Hero::create();
m_pHero->setPosition(Director::getInstance()->getVisibleSize().width / 2, 50);
addChild(m_pHero, 2);
m_pHero->SetLayer(this);
GetCombatManager()->SetRunGameLayer(this);
//在基类场景增加键盘按键移动飞机和飞机射出子弹的控制
auto keyboardEventListener = EventListenerKeyboard::create();
keyboardEventListener->onKeyPressed = CC_CALLBACK_2(GameLayer::onKeyPressed, this);
keyboardEventListener->onKeyReleased = CC_CALLBACK_2(GameLayer::onKeyReleased, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(keyboardEventListener, m_pHero);
return true;
}
void GameLayer::Update(float dt)
{
UpdateHero(dt);
UpdateEnemy(dt);
UpdateBullet(dt);
ProductEnemy(dt);
}
void GameLayer::UpdateHero(float dt)
{
m_pHero->Update(dt);
}
void GameLayer::UpdateEnemy(float dt)
{
for (auto it = m_enemyList.begin(); it != m_enemyList.end(); /*++it*/)
{
if ((*it)->IsDeath() || !IsInMap(**it))
{
(*it)->removeFromParent();
m_enemyList.erase(it++);
}
else
{
(*it)->Update(dt);
++it;
}
}
}
void GameLayer::UpdateBullet(float dt)
{
// m_heroBulletList;
for (auto it = m_heroBulletList.begin(); it != m_heroBulletList.end(); /*++it*/)
{
for (auto enemy = m_enemyList.begin(); enemy != m_enemyList.end(); ++enemy)
{
if (!(*enemy)->IsDeath() || !IsInMap(**it))
{
if ((*it)->HitTest(*enemy, dt))
{
break;
}
}
}
// (*it)->Update(dt);
++it;
}
for (auto it = m_heroBulletList.begin(); it != m_heroBulletList.end(); /*++it*/)
{
if ((*it)->IsDeath() || !IsInMap(**it))
{
(*it)->removeFromParent();
m_heroBulletList.erase(it++);
}
else
{
(*it)->Update(dt);
++it;
}
}
// m_enemyBulletList;
for (auto it = m_enemyBulletList.begin(); it != m_enemyBulletList.end(); ++it)
{
(*it)->HitTest(m_pHero, dt);
}
for (auto it = m_enemyBulletList.begin(); it != m_enemyBulletList.end(); /*++it*/)
{
if ((*it)->IsDeath() || !IsInMap (**it))
{
(*it)->removeFromParent();
m_enemyBulletList.erase(it++);
}
else
{
// (*it)->HitTest(m_pHero, dt);
(*it)->Update(dt);
++it;
}
}
}
void GameLayer::ProductEnemy(float dt)
{
if (m_enemyList.empty())
{
AirPlane* pAP = PlaneEnemy::create();
pAP->setPosition(Director::getInstance()->getVisibleSize().width / 2, 300);
addChild(pAP, 1, "enemy");
pAP->SetLayer(this);
m_enemyList.push_back(pAP);
}
}
bool GameLayer::IsInMap(const SceneNode& node)
{
static Size size = Director::getInstance()->getVisibleSize();
Rect rect = node.getTextureRect();
Point p = node.getPosition();
rect.origin = p;
if (rect.getMaxX () < 0 || rect.getMinX () > size.width
|| rect.getMinY() > size.height || rect.getMaxY () < 0)
{
return false;
}
return true;
}
void GameLayer::AddHeroBullet(Bullet* pB)
{
this->addChild(pB, 3);
this->m_heroBulletList.push_back(pB);
}
void GameLayer::AddEnemyBullet(Bullet* pB)
{
this->addChild(pB, 3);
this->m_enemyBulletList.push_back(pB);
}
// 键盘触摸回调事件
void GameLayer::onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event)
{
if (keyCode == EventKeyboard::KeyCode::KEY_LEFT_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_UP_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_RIGHT_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_DOWN_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_A
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_W
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_D
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_S
|| keyCode == EventKeyboard::KeyCode::KEY_A
|| keyCode == EventKeyboard::KeyCode::KEY_W
|| keyCode == EventKeyboard::KeyCode::KEY_D
|| keyCode == EventKeyboard::KeyCode::KEY_S)
{
m_bIsPressed = true;
switch (keyCode)
{
case cocos2d::EventKeyboard::KeyCode::KEY_RIGHT_ARROW:
{
m_pHero->SetSpeed(Point(300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_UP_ARROW:
{
m_pHero->SetSpeed(Point(0, 300));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_DOWN_ARROW:
{
m_pHero->SetSpeed(Point(0, -300));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_LEFT_ARROW:
{
m_pHero->SetSpeed(Point(-300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_CAPITAL_A:
{
m_pHero->SetSpeed(Point(-300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_CAPITAL_D:
{
m_pHero->SetSpeed(Point(300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_CAPITAL_S:
{
m_pHero->SetSpeed(Point(0, -300));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_CAPITAL_W:
{
m_pHero->SetSpeed(Point(0, 300));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_A:
{
m_pHero->SetSpeed(Point(-300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_D:
{
m_pHero->SetSpeed(Point(300, 0));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_S:
{
m_pHero->SetSpeed(Point(0, -300));
}
break;
case cocos2d::EventKeyboard::KeyCode::KEY_W:
{
m_pHero->SetSpeed(Point(0, 300));
}
break;
default:
return;
}
m_nKeyPressed++;
m_bIsPressed = true;
schedule(CC_SCHEDULE_SELECTOR(GameLayer::HeroMove));
}
}
void GameLayer::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event)
{
if (keyCode == EventKeyboard::KeyCode::KEY_LEFT_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_UP_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_RIGHT_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_DOWN_ARROW
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_A
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_W
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_D
|| keyCode == EventKeyboard::KeyCode::KEY_CAPITAL_S
|| keyCode == EventKeyboard::KeyCode::KEY_A
|| keyCode == EventKeyboard::KeyCode::KEY_W
|| keyCode == EventKeyboard::KeyCode::KEY_D
|| keyCode == EventKeyboard::KeyCode::KEY_S)
{
if (m_bIsPressed)
{
m_nKeyPressed--;
if (m_nKeyPressed <= 0)
{
m_bIsPressed = false;
unschedule(CC_SCHEDULE_SELECTOR(GameLayer::HeroMove));
}
}
}
}
void GameLayer::HeroMove(float dt)
{
auto heroCurrentPos = m_pHero->getPosition();
auto size = Director::getInstance()->getVisibleSize();
auto heroSize = m_pHero->getContentSize();
if (m_pHero->GetSpeed().x <= 0 && m_pHero->GetSpeed().y <= 0)
{
if (heroCurrentPos.x - heroSize.width / 2 < 0 || heroCurrentPos.y - heroSize.height / 2 < 0)
{
return;
}
}
else if(m_pHero->GetSpeed().x <= 0 && m_pHero->GetSpeed().y > 0)
{
if (heroCurrentPos.x - heroSize.width / 2 < 0 || heroCurrentPos.y + heroSize.height / 2 > size.height)
{
return;
}
}
else if (m_pHero->GetSpeed().x > 0 && m_pHero->GetSpeed().y <= 0)
{
if (heroCurrentPos.x + heroSize.width / 2 > size.width || heroCurrentPos.y - heroSize.height / 2 < 0)
{
return;
}
}
else if (m_pHero->GetSpeed().x > 0 && m_pHero->GetSpeed().y > 0)
{
if (heroCurrentPos.x + heroSize.width / 2 > size.width || heroCurrentPos.y + heroSize.height / 2 > size.height)
{
return;
}
}
else
{
return;
}
m_pHero->Moving(dt);
}
Hero *GameLayer::GetHero()
{
if (NULL != m_pHero)
{
return m_pHero;
}
else
{
return NULL;
}
}
void GameLayer::RockerMoveHero()
{
schedule(CC_SCHEDULE_SELECTOR(GameLayer::HeroMove));
}
void GameLayer::RockerStopMoveHero()
{
unschedule(CC_SCHEDULE_SELECTOR(GameLayer::HeroMove));
}
| [
"zhangtuo-vip@163.com"
] | zhangtuo-vip@163.com |
7c573c3cc534bfce5ae9b238b5f4f3c647d12a35 | 6fe17c32ba5bb492e276e13128c516a3f85f01ff | /new/vasya&cubes.cpp | 2a4d1e6b758fe2ff59b21884a72952c3a0044df7 | [] | no_license | YaminArafat/Codeforces | 35c5c527c8edd51c7f591bfe6474060934241d86 | 3d72ba0b5c9408a8e2491b25b5b643e9f9be728b | refs/heads/master | 2023-08-17T03:12:04.596632 | 2021-10-06T14:49:29 | 2021-10-06T14:49:29 | 351,042,898 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 387 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,sum=0,j=1,count=0,k;
cin>>n;
int arr[n];
for(i=1,k=0;i<=n;i+=j,k++)
{
arr[k]=i;
sum+=arr[k];
if(sum>n)
{
break;
}
count++;
if(sum==n)
{
break;
}
j++;
}
cout<<count<<endl;
return 0;
}
| [
"yaminarafat032@gmail.com"
] | yaminarafat032@gmail.com |
f9d3ec5d5fd9b3b035dbc6c544f636960b7eb61a | e65e6b345e98633cccc501ad0d6df9918b2aa25e | /Codeforces/Global/4/B.cpp | 3fbf678073eca3ce119690f4abc5cd72ab0007a2 | [] | no_license | wcysai/CodeLibrary | 6eb99df0232066cf06a9267bdcc39dc07f5aab29 | 6517cef736f1799b77646fe04fb280c9503d7238 | refs/heads/master | 2023-08-10T08:31:58.057363 | 2023-07-29T11:56:38 | 2023-07-29T11:56:38 | 134,228,833 | 5 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,000 | cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
ll n,k,a[MAXN];
string str;
int main()
{
cin>>str;
n=(int)str.size();
bool last=false;
ll lastw=0,lastwo=0;
ll ans=0;
for(ll i=0;i<n;i++)
{
if(str[i]=='v')
{
if(last)
{
ans+=lastwo;
lastw++;
}
last=true;
}
else
{
lastwo+=lastw;
last=false;
}
}
printf("%lld\n",ans);
return 0;
}
| [
"wcysai@foxmail.com"
] | wcysai@foxmail.com |
5279dd84b59e91bba4e741bb0ec8796896185453 | 2d952eb3b99582750b256726d2a2a3a809a94a81 | /SparseMatrix/SparseMatrix.cpp | 9ccb08eac54e9ad4652db346a77574cac1ef2831 | [] | no_license | Harikeshi/Sparse-Matrix | dd8f71c4aa4fa8aa3a2425b5d073ffd79e897ed1 | 0841c15c395a6d570a59f3a15fab7edcce6ab895 | refs/heads/master | 2020-05-01T06:11:05.939269 | 2019-04-27T20:01:31 | 2019-04-27T20:01:31 | 177,323,476 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 2,342 | cpp | #include "pch.h"
#include <iostream>
#include <iomanip>
#include <vector>
#include "Matrix.h"
#include "Chang.h"
#include <time.h>
#include <locale.h>
#include <stdlib.h>
using namespace std;
void matrixShow(int **a, int nr, int nc) {
for (int i = 0; i < nr; i++) {
cout << endl;
for (int j = 0; j < nc; j++)
cout << setw(4) << a[i][j] << " ";
}
cout << endl;
}
void matrixShow(int **a, int **b, int nr, int nc) {
for (int i = 0; i < nr; i++) {
cout << endl; {
for (int j = 0; j < nc; j++)
cout << setw(4) << a[i][j] << " ";
cout << "\t";
for (int k = 0; k < nc; k++)
cout << setw(4) << b[i][k] << " ";
}
}
cout << endl;
}
int** matrixInit(int nr, int nc, int array[]) {
int** matrix = new int *[nr];
for (int i = 0; i < nr; i++)
{
matrix[i] = new int[nc];
}
for (int i = 0, k = 0; i < nr; i++)
for (int j = 0; j < nc; j++) {
matrix[i][j] = array[k];
k++;
}
return matrix;
}
int** matrixInit(int nr, int nc) {
int** matrix;
matrix = new int *[nr];
for (int i = 0; i < nr; i++) {
matrix[i] = new int[nc];
}
for (int i = 0; i < nr; i++)
for (int j = 0; j < nc; j++) {
matrix[i][j] = 0;
}
return matrix;
}
int** matrixInitRand(int nr, int nc) {
int** matrix;
matrix = new int *[nr];
for (int i = 0; i < nr; i++) {
matrix[i] = new int[nc];
}
for (int i = 0; i < nr; i++)
for (int j = 0; j < nc; j++) {
//matrix[i][j]=(((rand() % 2) == 0) ? (rand() % 10) : 0);
matrix[i][j] = rand() % 100;
}
return matrix;
}
int main() {
setlocale(LC_ALL, "rus");
int array[30] = { 0,10,0,20,0,0,11,100,0,12,30,0,0,0,13,0,0,0,15,0,0,0,0,0,0,40,14,0,0,10 };//10->0
int array1[40] = { 0,12,8,0,7,14,0,0,0,43,11,0,9,0,0,19,0,0,15,10,0,0,0,15,11,0,0,28,0,0,0,0,13,5,100,0,0,22,0,90 };
int arr[30] = { 0,0,1,3,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,4,0,3,0,0,7,0,1,0,2 };
double a = 0;
//Werner C. Rheinboldt, Charles K. Mesztenyi
//Схема Чанга и Густавсона
int** mat0 = matrixInit(3,10,arr);
int** mat1 = matrixInit(3,10,arr);//тест array
Chang matrix0 = Chang(mat0, 3, 10);
Chang matrix1 = Chang(mat1, 3, 10);
matrix0.UnboxingShow();
cout << endl;
matrix0.BoxingShow();
matrix1.UnboxingShow();
cout << endl;
matrix1.BoxingShow();
Chang mat=matrix0.addmatr(matrix1);
mat.UnboxingShow();
cout << endl;
mat.BoxingShow();
return 0;
}
| [
"sshchegolikhin@gmail.com"
] | sshchegolikhin@gmail.com |
f764f4dcc55d77165fb6d1a398868643bfc0b4a6 | 7640f96511cdff5a649078089e833cfade9c36bf | /src/mime_types.hpp | 8bae6fd60f564e504f66ff276f65fca61d841e55 | [] | no_license | gburd/xqd | accfe7a4ea6bbee979a79f8e5b63273c9e5b7f72 | 30753a928d2ccc90eaa836fd7a61fce424add297 | refs/heads/master | 2020-12-25T16:25:11.553069 | 2010-11-14T16:14:34 | 2010-11-14T16:14:34 | 17,171 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 648 | hpp | //
// mime_types.hpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
//
#ifndef HTTP_SERVER4_MIME_TYPES_HPP
#define HTTP_SERVER4_MIME_TYPES_HPP
#include <string>
namespace xqd {
namespace http {
namespace mime_types {
/// Convert a file extension into a MIME type.
std::string extension_to_type(const std::string& extension);
} // namespace mime_types
} // namespace server4
} // namespace http
#endif // HTTP_SERVER4_MIME_TYPES_HPP
| [
"gburd@ossus.com"
] | gburd@ossus.com |
b7f91be60aeaedf2c62c6a57260700fde0f0f1b2 | 601990aa21531eb7c333c714583fdad0685759f7 | /cpp/leap/leap.cpp | 7b76f174af210a49f05d4444b0497d459476e02f | [
"MIT"
] | permissive | henrique-tavares/My-Exercism | 606ecd63ec23222239a2f14f78b8d9ecb4135f43 | 47dc5dc1d97135f31ac66b7dd7c1c0dfd16cf615 | refs/heads/master | 2023-01-02T18:30:38.828173 | 2020-10-18T13:05:59 | 2020-10-18T13:05:59 | 276,142,497 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 172 | cpp | #include "leap.h"
namespace leap
{
bool is_leap_year(int year)
{
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}
} // namespace leap
| [
"ricktavares76@gmail.com"
] | ricktavares76@gmail.com |
44cec53c40e39d5067594bc0d5de0365254e42a8 | 9272a3b6e73a5472c4e64a17cea00220a80c80a2 | /mcmc_kde.cpp | cc4aab5dcd55a75c435a4e53b720b28da919c365 | [] | no_license | schmidta87/eg2_analysis | 23b9b157a5609c4cb91982725fb12038973fe7e3 | 3808ee1e995a7d0e3de089c618c6cea2841cd7eb | refs/heads/master | 2020-07-06T12:59:05.220321 | 2019-08-12T22:13:20 | 2019-08-12T22:13:20 | 203,024,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,841 | cpp | #include <iostream>
#include <vector>
#include <cmath>
#include "TFile.h"
#include "TTree.h"
#include "TVector3.h"
#include "TRandom3.h"
#include "TMath.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TVectorT.h"
#include "constants.h"
#include "helpers.h"
using namespace std;
// Useful math
double logGaus(double x, double s, double m);
// Global variables for the parameters
int n_epp_events;
int n_ep_events;
int this_sample;
double * current_params;
double * new_params;
double * random_gauss;
// Vectors which describe all of the useful info for the e'p events
vector<TVector3> ep_pmiss_list;
vector<TVector3> ep_lon_list;
vector<TVector3> ep_inp_list;
vector<TVector3> ep_oop_list;
// Vectors which describe all of the useful info for the e'pp events
vector <double> epp_pmiss_list;
vector <double> epp_pcm_lon_list;
vector <double> epp_pcm_oop_list;
vector <double> epp_pcm_inp_list;
// Acceptance histograms
TH3D * genHist;
TH3D * accHist;
// Random number generator
TRandom3 * prand;
double jumpscale;
//Starting values for a1, a2, etc
const double a1_bound = .4;
const double a2_bound = .8;
const double b1_bound = .4;
const double b2_bound = .4;
const double sigPerp_bound = .4;
const double pcm_bound = 1.;
// Helper functions
long double posterior(double * param_set, double &recoil_acc);
void pick_new_step();
double acceptance_map(TVector3 p);
inline double acceptance(TVector3 p);
double acceptance_fake(TVector3 p);
void initialize_params();
int main(int argc, char ** argv)
{
if (argc != 7)
{
cerr << "Wrong number of arguments. Instead use\n"
<< "/path/to/1p/file /path/to/2p/file /path/to/map/file /path/to/output/file [# iter] [jump-scale]\n\n";
return -1;
}
// Read in the important info
TFile * outfile = new TFile(argv[4],"RECREATE");
int samples = atoi(argv[5]);
jumpscale = atoi(argv[6]);
// Initialize some histograms
TH2D * hist_ep_events = new TH2D("ep","ep events;p_miss [GeV];angle between p_miss and q [deg];Counts",n_slices,0.3,1.,30,90.,180.);
TH2D * hist_epp_events = new TH2D("epp","epp events;p_miss [GeV];angle between p_miss and q [deg];Counts",n_slices,0.3,1.,30,90.,180.);
TH2D * hist_epp_recoils = new TH2D("epp_rec","epp events;p_rec [GeV];angle between p_rec and q [deg];Counts",n_slices,0.3,1.,30,0.,180.);
TH2D * hist_epp_cm_lon = new TH2D("cm_lon","epp events;p_miss [GeV];p_cm_lon [GeV];Counts",7,0.3,1.,24,-1.2,1.2);
TH2D * hist_epp_cm_inp = new TH2D("cm_inp","epp events;p_miss [GeV];p_cm_inp [GeV];Counts",7,0.3,1.,24,-1.2,1.2);
TH2D * hist_epp_cm_oop = new TH2D("cm_oop","epp events;p_miss [GeV];p_cm_oop [GeV];Counts",7,0.3,1.,24,-1.2,1.2);
// Initialize random guess
// int seed=0;
int seed = 777766;
prand = new TRandom3(seed);
//prand = new TRandom3(0);
//seed = prand->Rndm()*1000000;
//prand->SetSeed(seed);
cout << "Chosen seed is " << seed << "\n";
// Read in e'p events
cerr << "Loading 1p data file " << argv[1] << " ...\n";
TFile * fep = new TFile(argv[1]);
TTree * tep = (TTree*)fep->Get("T");
Float_t pPVec[2][3]; // Proton momenta
Float_t qVec[3]; // q
Float_t pMissVec[2][3];
Float_t vertices[2][3]; // position 3 vectors of proton vertices
tep->SetBranchAddress("q",qVec);
tep->SetBranchAddress("Pmiss",pMissVec);
tep->SetBranchAddress("Rp",vertices);
tep->SetBranchAddress("Pp",pPVec);
for (int i=0 ; i<tep->GetEntries() ; i++)
{
tep->GetEvent(i);
TVector3 pLead(pPVec[0][0],pPVec[0][1], pPVec[0][2]);
TVector3 pmiss(pMissVec[0][0],pMissVec[0][1],pMissVec[0][2]);
TVector3 q(qVec[0],qVec[1],qVec[2]);
// Make Or's cuts on vertex position
if(!((fabs(vertices[0][2]+22.25)<2.25) && (pLead.Mag() < 2.4)))
continue;
ep_pmiss_list.push_back(pmiss);
// Form the rotated basis
TVector3 lon = pmiss.Unit();
TVector3 oop = q.Cross(lon).Unit();
TVector3 inp = oop.Cross(lon).Unit();
ep_lon_list.push_back(lon);
ep_inp_list.push_back(inp);
ep_oop_list.push_back(oop);
hist_ep_events->Fill(pmiss.Mag(),pmiss.Angle(q)*180./M_PI);
}
fep->Close();
// Read in epp file
cerr << "Loading 2p data file " << argv[2] << " ...\n";
TFile *fepp = new TFile(argv[2]);
TTree *tepp = (TTree*)fepp->Get("T");
tepp->SetBranchAddress("q",qVec);
tepp->SetBranchAddress("Pmiss",pMissVec);
tepp->SetBranchAddress("Rp",vertices);
tepp->SetBranchAddress("Pp",pPVec);
for (int i=0 ; i<tepp->GetEntries() ; i++)
{
tepp->GetEvent(i);
TVector3 plead(pPVec[0][0],pPVec[0][1], pPVec[0][2]);
TVector3 pmiss(pMissVec[0][0],pMissVec[0][1],pMissVec[0][2]);
TVector3 q(qVec[0],qVec[1],qVec[2]);
// Make Or's cut on vertex position
if (!((fabs(vertices[0][2]+22.25)<2.25) && (plead.Mag() < 2.4)))
continue;
ep_pmiss_list.push_back(pmiss);
double pmiss_mag = pmiss.Mag();
// Form the rotated basis
TVector3 lon = pmiss.Unit();
TVector3 oop = q.Cross(lon).Unit();
TVector3 inp = oop.Cross(lon).Unit();
ep_lon_list.push_back(lon);
ep_inp_list.push_back(inp);
ep_oop_list.push_back(oop);
hist_ep_events->Fill(pmiss_mag,pmiss.Angle(q)*180./M_PI);
// Now address recoils
TVector3 prec(pPVec[1][0],pPVec[1][1], pPVec[1][2]);
// Make Or's cut on recoil vertex position
if (!((fabs(vertices[1][2]+22.25)<2.25) && (prec.Mag() > 0.35)))
{
cout << "epp fail\n";
continue;
}
TVector3 pcm = prec + pmiss;
double pcm_lon = pcm.Dot(lon);
double pcm_inp = pcm.Dot(inp);
double pcm_oop = pcm.Dot(oop);
epp_pmiss_list.push_back(pmiss_mag);
epp_pcm_lon_list.push_back(pcm_lon);
epp_pcm_inp_list.push_back(pcm_inp);
epp_pcm_oop_list.push_back(pcm_oop);
hist_epp_cm_lon->Fill(pmiss_mag,pcm_lon);
hist_epp_cm_inp->Fill(pmiss_mag,pcm_inp);
hist_epp_cm_oop->Fill(pmiss_mag,pcm_oop);
hist_epp_events->Fill(pmiss_mag,pmiss.Angle(q)*180./M_PI);
hist_epp_recoils->Fill(prec.Mag(),prec.Angle(q)*180./M_PI);
}
fepp->Close();
n_ep_events = ep_pmiss_list.size();
n_epp_events = epp_pmiss_list.size();
cerr << "Done reading input data.\n";
cerr << "Read in " << n_ep_events << " ep events.\n";
cerr << "Read in " << n_epp_events << " epp events.\n";
TH1D * hist_ep_pmiss = hist_ep_events->ProjectionX("ep_pmiss");
// Load the acceptance maps
TFile * mapFile = new TFile(argv[3]);
genHist = (TH3D*)mapFile->Get("solid_p_gen");
accHist = (TH3D*)mapFile->Get("solid_p_acc");
if ((!genHist)||(!accHist))
{
cerr << "The acceptance maps were not loaded properly. Check the histogram names.\n";
return -2;
}
// Create new memory for parameter guesses
new_params = new double[5];
current_params = new double[5];
random_gauss = new double[3 * n_ep_events * n_pseudo];
for (int i=0 ; i<3*n_ep_events*n_pseudo ; i++)
random_gauss[i] = prand->Gaus();
// Create output rootfile and output tree
double log_current_post, recoil_acc;
outfile->cd();
TTree * outtree = new TTree("mcmc","MCMC Samples");
outtree->Branch("a1",current_params,"a1/D");
outtree->Branch("a2",current_params+1,"a2/D");
outtree->Branch("b1",current_params+2,"b1/D");
outtree->Branch("b2",current_params+3,"b2/D");
outtree->Branch("sigPerp",current_params+4,"sigPerp/D");
outtree->Branch("logposterior",&log_current_post,"logposterior/D");
outtree->Branch("recoil_acc",&recoil_acc,"recoil_acc/D");
cerr << "Initializing parameters...\n";
long double current_post;
this_sample=-1000;
do
{
initialize_params();
current_post = posterior(current_params,recoil_acc);
cout << "Attempted initialization: posterior = " << current_post << "\n";
} while((current_post <= 0) || (isnan(current_post) == true));
// Loop through MCMC
int count_true =0;
for (this_sample=0; this_sample<samples; this_sample++)
{
if (this_sample%5 == 0)
cerr << "Working on iteration " << this_sample << endl;
pick_new_step();
double new_recoil_acc;
long double new_post = posterior(new_params,new_recoil_acc);
long double post_ratio = new_post/current_post;
long double proposal_ratio = 1.;
if (post_ratio*proposal_ratio >= prand->Rndm())
{
// Accept this new step
count_true++;
recoil_acc = new_recoil_acc;
current_post = new_post;
for (int i = 0; i<5; i++)
current_params[i] = new_params[i];
}
log_current_post = log(current_post);
outtree->Fill();
}
cerr << "Accept % = " << 100.*count_true/samples << "\n";
TVectorT <double> acc_pct(1);
acc_pct[0] = 100.*((double)count_true)/((double)samples);
acc_pct.Write("acc_pct");
// Write out histograms
outfile->cd();
hist_ep_events->Write();
hist_epp_cm_lon->Write();
hist_epp_cm_inp->Write();
hist_epp_cm_oop->Write();
hist_epp_events->Write();
hist_epp_recoils->Write();
outtree->Write();
outfile->Close();
// Clean up
mapFile->Close();
delete prand;
delete[] new_params;
delete[] current_params;
delete[] random_gauss;
return 0;
}
double logGaus(double x, double m, double s)
{
return -0.5 * sq((x-m)/s);
}
long double posterior(double * param_set, double &recoil_acc)
{
recoil_acc = 0.;
// Safe guard in case a1 or a2 are incorrect
if((-0.3*param_set[0] + param_set[1]<=0.)||(0.4*param_set[0]+param_set[1]<=0.))
return 0.;
vector<double> pcm_lon_list;
vector<double> pcm_inp_list;
vector<double> pcm_oop_list;
vector<double> pmiss_list;
vector<double> weight_list;
for (int i=0 ; i<n_ep_events ; i++)
{
// Establish sigma and mu for the pcm distributions
const double pmiss = ep_pmiss_list[i].Mag();
const double sig_par = param_set[0] * (pmiss - 0.6) + param_set[1];
const double mu_par = param_set[2] * (pmiss - 0.6) + param_set[3];
const double mu_perp = 0.;
const double sig_perp = param_set[4];
for (int j=0 ; j<n_pseudo ; j++)
{
double pcm_lon = mu_par + sig_par*random_gauss[3*n_pseudo*i + 3*j + 0];
double pcm_inp = mu_perp+sig_perp*random_gauss[3*n_pseudo*i + 3*j + 1];
double pcm_oop = mu_perp+sig_perp*random_gauss[3*n_pseudo*i + 3*j + 2];
TVector3 pcm = pcm_lon * ep_lon_list[i] + pcm_inp * ep_inp_list[i] + pcm_oop * ep_oop_list[i];
TVector3 prec = pcm - ep_pmiss_list[i];
// Calculate the weight, makin sure the recoils have sufficient momentum
double weight;
if (prec.Mag()<0.35)
weight=0;
else
weight = acceptance(prec);
// Store the pseudo-events in the lists
pcm_lon_list.push_back(pcm_lon);
pcm_inp_list.push_back(pcm_inp);
pcm_oop_list.push_back(pcm_oop);
pmiss_list.push_back(pmiss);
weight_list.push_back(weight);
recoil_acc += weight;
}
}
recoil_acc = recoil_acc / (n_ep_events*n_pseudo);
long double sums[n_epp_events];
#pragma omp parallel for
for (int i=0 ; i<n_epp_events ; i++)
{
sums[i] = 0.;
for (int j=0; j<n_pseudo*n_ep_events; j++)
{
// Don't waste time on the exponential if out of acceptance
if (weight_list[j] <= 0.)
continue;
//Gaussian KDE. No cutoff.
sums[i] += weight_list[j]*(exp(logGaus(epp_pmiss_list[i],pmiss_list[j],kde_width) +
logGaus(epp_pcm_lon_list[i],pcm_lon_list[j],kde_width) +
logGaus(epp_pcm_inp_list[i],pcm_inp_list[j],kde_width) +
logGaus(epp_pcm_oop_list[i],pcm_oop_list[j],kde_width)));
}
}
// Assemble the result from the product of the sums
long double result = 1.;
for (int i=0 ; i<n_epp_events ; i++)
result *= sums[i];
return result;
}
void pick_new_step()
{
new_params[0] = prand->Gaus(current_params[0], a1_bound/jumpscale);
new_params[1] = prand->Gaus(current_params[1], a2_bound/jumpscale);
new_params[2] = prand->Gaus(current_params[2], b1_bound/jumpscale);
new_params[3] = prand->Gaus(current_params[3], b2_bound/jumpscale);
new_params[4] = prand->Gaus(current_params[4], sigPerp_bound/jumpscale);
}
double acceptance_map(TVector3 p)
{
double mom = p.Mag();
double cosTheta = p.CosTheta();
double phi = p.Phi() * 180./M_PI;
if (phi < -30.)
phi += 360.;
int momBin = genHist->GetXaxis()->FindBin(mom);
int cosBin = genHist->GetYaxis()->FindBin(cosTheta);
int phiBin = genHist->GetZaxis()->FindBin(phi);
double gen=0.;
double acc=0.;
int exp_size=-1;
while ((gen <= 0.)&&(exp_size<3))
{
exp_size++;
gen = acc = 0.;
for (int mB = momBin-exp_size; mB<=momBin+exp_size ; mB++)
for (int cB = cosBin-exp_size; cB<=cosBin+exp_size ; cB++)
for (int pB = phiBin-exp_size; pB<=phiBin+exp_size ; pB++)
{
gen += genHist->GetBinContent(mB,cB,pB);
acc += accHist->GetBinContent(mB,cB,pB);
}
}
if (gen>0.)
return acc/gen;
else
return 1.;
}
double acceptance_fake(TVector3 p)
{
double phi = p.Phi();
if (phi < -M_PI/6.)
phi += 2.*M_PI;
int sector = int(phi/60.);
double san_phi = phi - 60.*sector;
if (fabs(san_phi)<15.)
return 1.;
else
return 0.;
}
inline double acceptance(TVector3 p)
{
//return acceptance_map(p);
//return acceptance_fake(p);
return 1.;
}
void initialize_params()
{
current_params[0] = prand->Uniform(a1_bound);
current_params[1] = prand->Uniform(a2_bound);
current_params[2] = prand->Uniform(b1_bound);
current_params[3] = prand->Uniform(b2_bound);
current_params[4] = prand->Uniform(sigPerp_bound);
// First make sure that a1 and a2 are reasonable values
while((-0.3*current_params[0] + current_params[1]<=0.)||(0.4*current_params[0]+current_params[1]<=0.))
{
current_params[0] = prand->Uniform(a1_bound);
current_params[1] = prand->Uniform(a2_bound);
}
}
| [
"schmidta@mit.edu"
] | schmidta@mit.edu |
fef1351dd28fa4d8799f333090816885443ed081 | a1df4de1ee24a686515433c223b94c99b80af9e4 | /lib/Sema/SemaChecking.cpp | 2ed8eaae771a076a037cf5be758863c002866376 | [
"NCSA"
] | permissive | SwarmArch/Swarm-Clang | ae3c7478869a5d30fc0ead53ae3bb82be7e9aff2 | fded118a6254ccce54d90b5798899bd5a02b4597 | refs/heads/master | 2023-06-11T04:51:32.157145 | 2021-07-05T15:05:22 | 2021-07-05T15:10:10 | 266,575,065 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 458,578 | cpp | //===--- SemaChecking.cpp - Extra Semantic Checking -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements extra semantic analysis beyond what is enforced
// by the C type system.
//
//===----------------------------------------------------------------------===//
#include "clang/AST/ASTContext.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ExprOpenMP.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtObjC.h"
#include "clang/Analysis/Analyses/FormatString.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Lexer.h" // TODO: Extract static functions to fix layering.
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Locale.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
using namespace sema;
SourceLocation Sema::getLocationOfStringLiteralByte(const StringLiteral *SL,
unsigned ByteNo) const {
return SL->getLocationOfByte(ByteNo, getSourceManager(), LangOpts,
Context.getTargetInfo());
}
/// Checks that a call expression's argument count is the desired number.
/// This is useful when doing custom type-checking. Returns true on error.
static bool checkArgCount(Sema &S, CallExpr *call, unsigned desiredArgCount) {
unsigned argCount = call->getNumArgs();
if (argCount == desiredArgCount) return false;
if (argCount < desiredArgCount)
return S.Diag(call->getLocEnd(), diag::err_typecheck_call_too_few_args)
<< 0 /*function call*/ << desiredArgCount << argCount
<< call->getSourceRange();
// Highlight all the excess arguments.
SourceRange range(call->getArg(desiredArgCount)->getLocStart(),
call->getArg(argCount - 1)->getLocEnd());
return S.Diag(range.getBegin(), diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << desiredArgCount << argCount
<< call->getArg(1)->getSourceRange();
}
/// Check that the first argument to __builtin_annotation is an integer
/// and the second argument is a non-wide string literal.
static bool SemaBuiltinAnnotation(Sema &S, CallExpr *TheCall) {
if (checkArgCount(S, TheCall, 2))
return true;
// First argument should be an integer.
Expr *ValArg = TheCall->getArg(0);
QualType Ty = ValArg->getType();
if (!Ty->isIntegerType()) {
S.Diag(ValArg->getLocStart(), diag::err_builtin_annotation_first_arg)
<< ValArg->getSourceRange();
return true;
}
// Second argument should be a constant string.
Expr *StrArg = TheCall->getArg(1)->IgnoreParenCasts();
StringLiteral *Literal = dyn_cast<StringLiteral>(StrArg);
if (!Literal || !Literal->isAscii()) {
S.Diag(StrArg->getLocStart(), diag::err_builtin_annotation_second_arg)
<< StrArg->getSourceRange();
return true;
}
TheCall->setType(Ty);
return false;
}
/// Check that the argument to __builtin_addressof is a glvalue, and set the
/// result type to the corresponding pointer type.
static bool SemaBuiltinAddressof(Sema &S, CallExpr *TheCall) {
if (checkArgCount(S, TheCall, 1))
return true;
ExprResult Arg(TheCall->getArg(0));
QualType ResultType = S.CheckAddressOfOperand(Arg, TheCall->getLocStart());
if (ResultType.isNull())
return true;
TheCall->setArg(0, Arg.get());
TheCall->setType(ResultType);
return false;
}
static bool SemaBuiltinOverflow(Sema &S, CallExpr *TheCall) {
if (checkArgCount(S, TheCall, 3))
return true;
// First two arguments should be integers.
for (unsigned I = 0; I < 2; ++I) {
Expr *Arg = TheCall->getArg(I);
QualType Ty = Arg->getType();
if (!Ty->isIntegerType()) {
S.Diag(Arg->getLocStart(), diag::err_overflow_builtin_must_be_int)
<< Ty << Arg->getSourceRange();
return true;
}
}
// Third argument should be a pointer to a non-const integer.
// IRGen correctly handles volatile, restrict, and address spaces, and
// the other qualifiers aren't possible.
{
Expr *Arg = TheCall->getArg(2);
QualType Ty = Arg->getType();
const auto *PtrTy = Ty->getAs<PointerType>();
if (!(PtrTy && PtrTy->getPointeeType()->isIntegerType() &&
!PtrTy->getPointeeType().isConstQualified())) {
S.Diag(Arg->getLocStart(), diag::err_overflow_builtin_must_be_ptr_int)
<< Ty << Arg->getSourceRange();
return true;
}
}
return false;
}
static void SemaBuiltinMemChkCall(Sema &S, FunctionDecl *FDecl,
CallExpr *TheCall, unsigned SizeIdx,
unsigned DstSizeIdx) {
if (TheCall->getNumArgs() <= SizeIdx ||
TheCall->getNumArgs() <= DstSizeIdx)
return;
const Expr *SizeArg = TheCall->getArg(SizeIdx);
const Expr *DstSizeArg = TheCall->getArg(DstSizeIdx);
llvm::APSInt Size, DstSize;
// find out if both sizes are known at compile time
if (!SizeArg->EvaluateAsInt(Size, S.Context) ||
!DstSizeArg->EvaluateAsInt(DstSize, S.Context))
return;
if (Size.ule(DstSize))
return;
// confirmed overflow so generate the diagnostic.
IdentifierInfo *FnName = FDecl->getIdentifier();
SourceLocation SL = TheCall->getLocStart();
SourceRange SR = TheCall->getSourceRange();
S.Diag(SL, diag::warn_memcpy_chk_overflow) << SR << FnName;
}
static bool SemaBuiltinCallWithStaticChain(Sema &S, CallExpr *BuiltinCall) {
if (checkArgCount(S, BuiltinCall, 2))
return true;
SourceLocation BuiltinLoc = BuiltinCall->getLocStart();
Expr *Builtin = BuiltinCall->getCallee()->IgnoreImpCasts();
Expr *Call = BuiltinCall->getArg(0);
Expr *Chain = BuiltinCall->getArg(1);
if (Call->getStmtClass() != Stmt::CallExprClass) {
S.Diag(BuiltinLoc, diag::err_first_argument_to_cwsc_not_call)
<< Call->getSourceRange();
return true;
}
auto CE = cast<CallExpr>(Call);
if (CE->getCallee()->getType()->isBlockPointerType()) {
S.Diag(BuiltinLoc, diag::err_first_argument_to_cwsc_block_call)
<< Call->getSourceRange();
return true;
}
const Decl *TargetDecl = CE->getCalleeDecl();
if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl))
if (FD->getBuiltinID()) {
S.Diag(BuiltinLoc, diag::err_first_argument_to_cwsc_builtin_call)
<< Call->getSourceRange();
return true;
}
if (isa<CXXPseudoDestructorExpr>(CE->getCallee()->IgnoreParens())) {
S.Diag(BuiltinLoc, diag::err_first_argument_to_cwsc_pdtor_call)
<< Call->getSourceRange();
return true;
}
ExprResult ChainResult = S.UsualUnaryConversions(Chain);
if (ChainResult.isInvalid())
return true;
if (!ChainResult.get()->getType()->isPointerType()) {
S.Diag(BuiltinLoc, diag::err_second_argument_to_cwsc_not_pointer)
<< Chain->getSourceRange();
return true;
}
QualType ReturnTy = CE->getCallReturnType(S.Context);
QualType ArgTys[2] = { ReturnTy, ChainResult.get()->getType() };
QualType BuiltinTy = S.Context.getFunctionType(
ReturnTy, ArgTys, FunctionProtoType::ExtProtoInfo());
QualType BuiltinPtrTy = S.Context.getPointerType(BuiltinTy);
Builtin =
S.ImpCastExprToType(Builtin, BuiltinPtrTy, CK_BuiltinFnToFnPtr).get();
BuiltinCall->setType(CE->getType());
BuiltinCall->setValueKind(CE->getValueKind());
BuiltinCall->setObjectKind(CE->getObjectKind());
BuiltinCall->setCallee(Builtin);
BuiltinCall->setArg(1, ChainResult.get());
return false;
}
static bool SemaBuiltinSEHScopeCheck(Sema &SemaRef, CallExpr *TheCall,
Scope::ScopeFlags NeededScopeFlags,
unsigned DiagID) {
// Scopes aren't available during instantiation. Fortunately, builtin
// functions cannot be template args so they cannot be formed through template
// instantiation. Therefore checking once during the parse is sufficient.
if (SemaRef.inTemplateInstantiation())
return false;
Scope *S = SemaRef.getCurScope();
while (S && !S->isSEHExceptScope())
S = S->getParent();
if (!S || !(S->getFlags() & NeededScopeFlags)) {
auto *DRE = cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
SemaRef.Diag(TheCall->getExprLoc(), DiagID)
<< DRE->getDecl()->getIdentifier();
return true;
}
return false;
}
static inline bool isBlockPointer(Expr *Arg) {
return Arg->getType()->isBlockPointerType();
}
/// OpenCL C v2.0, s6.13.17.2 - Checks that the block parameters are all local
/// void*, which is a requirement of device side enqueue.
static bool checkOpenCLBlockArgs(Sema &S, Expr *BlockArg) {
const BlockPointerType *BPT =
cast<BlockPointerType>(BlockArg->getType().getCanonicalType());
ArrayRef<QualType> Params =
BPT->getPointeeType()->getAs<FunctionProtoType>()->getParamTypes();
unsigned ArgCounter = 0;
bool IllegalParams = false;
// Iterate through the block parameters until either one is found that is not
// a local void*, or the block is valid.
for (ArrayRef<QualType>::iterator I = Params.begin(), E = Params.end();
I != E; ++I, ++ArgCounter) {
if (!(*I)->isPointerType() || !(*I)->getPointeeType()->isVoidType() ||
(*I)->getPointeeType().getQualifiers().getAddressSpace() !=
LangAS::opencl_local) {
// Get the location of the error. If a block literal has been passed
// (BlockExpr) then we can point straight to the offending argument,
// else we just point to the variable reference.
SourceLocation ErrorLoc;
if (isa<BlockExpr>(BlockArg)) {
BlockDecl *BD = cast<BlockExpr>(BlockArg)->getBlockDecl();
ErrorLoc = BD->getParamDecl(ArgCounter)->getLocStart();
} else if (isa<DeclRefExpr>(BlockArg)) {
ErrorLoc = cast<DeclRefExpr>(BlockArg)->getLocStart();
}
S.Diag(ErrorLoc,
diag::err_opencl_enqueue_kernel_blocks_non_local_void_args);
IllegalParams = true;
}
}
return IllegalParams;
}
/// OpenCL C v2.0, s6.13.17.6 - Check the argument to the
/// get_kernel_work_group_size
/// and get_kernel_preferred_work_group_size_multiple builtin functions.
static bool SemaOpenCLBuiltinKernelWorkGroupSize(Sema &S, CallExpr *TheCall) {
if (checkArgCount(S, TheCall, 1))
return true;
Expr *BlockArg = TheCall->getArg(0);
if (!isBlockPointer(BlockArg)) {
S.Diag(BlockArg->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "block";
return true;
}
return checkOpenCLBlockArgs(S, BlockArg);
}
/// Diagnose integer type and any valid implicit conversion to it.
static bool checkOpenCLEnqueueIntType(Sema &S, Expr *E,
const QualType &IntType);
static bool checkOpenCLEnqueueLocalSizeArgs(Sema &S, CallExpr *TheCall,
unsigned Start, unsigned End) {
bool IllegalParams = false;
for (unsigned I = Start; I <= End; ++I)
IllegalParams |= checkOpenCLEnqueueIntType(S, TheCall->getArg(I),
S.Context.getSizeType());
return IllegalParams;
}
/// OpenCL v2.0, s6.13.17.1 - Check that sizes are provided for all
/// 'local void*' parameter of passed block.
static bool checkOpenCLEnqueueVariadicArgs(Sema &S, CallExpr *TheCall,
Expr *BlockArg,
unsigned NumNonVarArgs) {
const BlockPointerType *BPT =
cast<BlockPointerType>(BlockArg->getType().getCanonicalType());
unsigned NumBlockParams =
BPT->getPointeeType()->getAs<FunctionProtoType>()->getNumParams();
unsigned TotalNumArgs = TheCall->getNumArgs();
// For each argument passed to the block, a corresponding uint needs to
// be passed to describe the size of the local memory.
if (TotalNumArgs != NumBlockParams + NumNonVarArgs) {
S.Diag(TheCall->getLocStart(),
diag::err_opencl_enqueue_kernel_local_size_args);
return true;
}
// Check that the sizes of the local memory are specified by integers.
return checkOpenCLEnqueueLocalSizeArgs(S, TheCall, NumNonVarArgs,
TotalNumArgs - 1);
}
/// OpenCL C v2.0, s6.13.17 - Enqueue kernel function contains four different
/// overload formats specified in Table 6.13.17.1.
/// int enqueue_kernel(queue_t queue,
/// kernel_enqueue_flags_t flags,
/// const ndrange_t ndrange,
/// void (^block)(void))
/// int enqueue_kernel(queue_t queue,
/// kernel_enqueue_flags_t flags,
/// const ndrange_t ndrange,
/// uint num_events_in_wait_list,
/// clk_event_t *event_wait_list,
/// clk_event_t *event_ret,
/// void (^block)(void))
/// int enqueue_kernel(queue_t queue,
/// kernel_enqueue_flags_t flags,
/// const ndrange_t ndrange,
/// void (^block)(local void*, ...),
/// uint size0, ...)
/// int enqueue_kernel(queue_t queue,
/// kernel_enqueue_flags_t flags,
/// const ndrange_t ndrange,
/// uint num_events_in_wait_list,
/// clk_event_t *event_wait_list,
/// clk_event_t *event_ret,
/// void (^block)(local void*, ...),
/// uint size0, ...)
static bool SemaOpenCLBuiltinEnqueueKernel(Sema &S, CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
if (NumArgs < 4) {
S.Diag(TheCall->getLocStart(), diag::err_typecheck_call_too_few_args);
return true;
}
Expr *Arg0 = TheCall->getArg(0);
Expr *Arg1 = TheCall->getArg(1);
Expr *Arg2 = TheCall->getArg(2);
Expr *Arg3 = TheCall->getArg(3);
// First argument always needs to be a queue_t type.
if (!Arg0->getType()->isQueueT()) {
S.Diag(TheCall->getArg(0)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << S.Context.OCLQueueTy;
return true;
}
// Second argument always needs to be a kernel_enqueue_flags_t enum value.
if (!Arg1->getType()->isIntegerType()) {
S.Diag(TheCall->getArg(1)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "'kernel_enqueue_flags_t' (i.e. uint)";
return true;
}
// Third argument is always an ndrange_t type.
if (Arg2->getType().getUnqualifiedType().getAsString() != "ndrange_t") {
S.Diag(TheCall->getArg(2)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "'ndrange_t'";
return true;
}
// With four arguments, there is only one form that the function could be
// called in: no events and no variable arguments.
if (NumArgs == 4) {
// check that the last argument is the right block type.
if (!isBlockPointer(Arg3)) {
S.Diag(Arg3->getLocStart(), diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "block";
return true;
}
// we have a block type, check the prototype
const BlockPointerType *BPT =
cast<BlockPointerType>(Arg3->getType().getCanonicalType());
if (BPT->getPointeeType()->getAs<FunctionProtoType>()->getNumParams() > 0) {
S.Diag(Arg3->getLocStart(),
diag::err_opencl_enqueue_kernel_blocks_no_args);
return true;
}
return false;
}
// we can have block + varargs.
if (isBlockPointer(Arg3))
return (checkOpenCLBlockArgs(S, Arg3) ||
checkOpenCLEnqueueVariadicArgs(S, TheCall, Arg3, 4));
// last two cases with either exactly 7 args or 7 args and varargs.
if (NumArgs >= 7) {
// check common block argument.
Expr *Arg6 = TheCall->getArg(6);
if (!isBlockPointer(Arg6)) {
S.Diag(Arg6->getLocStart(), diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "block";
return true;
}
if (checkOpenCLBlockArgs(S, Arg6))
return true;
// Forth argument has to be any integer type.
if (!Arg3->getType()->isIntegerType()) {
S.Diag(TheCall->getArg(3)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee() << "integer";
return true;
}
// check remaining common arguments.
Expr *Arg4 = TheCall->getArg(4);
Expr *Arg5 = TheCall->getArg(5);
// Fifth argument is always passed as a pointer to clk_event_t.
if (!Arg4->isNullPointerConstant(S.Context,
Expr::NPC_ValueDependentIsNotNull) &&
!Arg4->getType()->getPointeeOrArrayElementType()->isClkEventT()) {
S.Diag(TheCall->getArg(4)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee()
<< S.Context.getPointerType(S.Context.OCLClkEventTy);
return true;
}
// Sixth argument is always passed as a pointer to clk_event_t.
if (!Arg5->isNullPointerConstant(S.Context,
Expr::NPC_ValueDependentIsNotNull) &&
!(Arg5->getType()->isPointerType() &&
Arg5->getType()->getPointeeType()->isClkEventT())) {
S.Diag(TheCall->getArg(5)->getLocStart(),
diag::err_opencl_builtin_expected_type)
<< TheCall->getDirectCallee()
<< S.Context.getPointerType(S.Context.OCLClkEventTy);
return true;
}
if (NumArgs == 7)
return false;
return checkOpenCLEnqueueVariadicArgs(S, TheCall, Arg6, 7);
}
// None of the specific case has been detected, give generic error
S.Diag(TheCall->getLocStart(),
diag::err_opencl_enqueue_kernel_incorrect_args);
return true;
}
/// Returns OpenCL access qual.
static OpenCLAccessAttr *getOpenCLArgAccess(const Decl *D) {
return D->getAttr<OpenCLAccessAttr>();
}
/// Returns true if pipe element type is different from the pointer.
static bool checkOpenCLPipeArg(Sema &S, CallExpr *Call) {
const Expr *Arg0 = Call->getArg(0);
// First argument type should always be pipe.
if (!Arg0->getType()->isPipeType()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_first_arg)
<< Call->getDirectCallee() << Arg0->getSourceRange();
return true;
}
OpenCLAccessAttr *AccessQual =
getOpenCLArgAccess(cast<DeclRefExpr>(Arg0)->getDecl());
// Validates the access qualifier is compatible with the call.
// OpenCL v2.0 s6.13.16 - The access qualifiers for pipe should only be
// read_only and write_only, and assumed to be read_only if no qualifier is
// specified.
switch (Call->getDirectCallee()->getBuiltinID()) {
case Builtin::BIread_pipe:
case Builtin::BIreserve_read_pipe:
case Builtin::BIcommit_read_pipe:
case Builtin::BIwork_group_reserve_read_pipe:
case Builtin::BIsub_group_reserve_read_pipe:
case Builtin::BIwork_group_commit_read_pipe:
case Builtin::BIsub_group_commit_read_pipe:
if (!(!AccessQual || AccessQual->isReadOnly())) {
S.Diag(Arg0->getLocStart(),
diag::err_opencl_builtin_pipe_invalid_access_modifier)
<< "read_only" << Arg0->getSourceRange();
return true;
}
break;
case Builtin::BIwrite_pipe:
case Builtin::BIreserve_write_pipe:
case Builtin::BIcommit_write_pipe:
case Builtin::BIwork_group_reserve_write_pipe:
case Builtin::BIsub_group_reserve_write_pipe:
case Builtin::BIwork_group_commit_write_pipe:
case Builtin::BIsub_group_commit_write_pipe:
if (!(AccessQual && AccessQual->isWriteOnly())) {
S.Diag(Arg0->getLocStart(),
diag::err_opencl_builtin_pipe_invalid_access_modifier)
<< "write_only" << Arg0->getSourceRange();
return true;
}
break;
default:
break;
}
return false;
}
/// Returns true if pipe element type is different from the pointer.
static bool checkOpenCLPipePacketType(Sema &S, CallExpr *Call, unsigned Idx) {
const Expr *Arg0 = Call->getArg(0);
const Expr *ArgIdx = Call->getArg(Idx);
const PipeType *PipeTy = cast<PipeType>(Arg0->getType());
const QualType EltTy = PipeTy->getElementType();
const PointerType *ArgTy = ArgIdx->getType()->getAs<PointerType>();
// The Idx argument should be a pointer and the type of the pointer and
// the type of pipe element should also be the same.
if (!ArgTy ||
!S.Context.hasSameType(
EltTy, ArgTy->getPointeeType()->getCanonicalTypeInternal())) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_invalid_arg)
<< Call->getDirectCallee() << S.Context.getPointerType(EltTy)
<< ArgIdx->getType() << ArgIdx->getSourceRange();
return true;
}
return false;
}
// \brief Performs semantic analysis for the read/write_pipe call.
// \param S Reference to the semantic analyzer.
// \param Call A pointer to the builtin call.
// \return True if a semantic error has been found, false otherwise.
static bool SemaBuiltinRWPipe(Sema &S, CallExpr *Call) {
// OpenCL v2.0 s6.13.16.2 - The built-in read/write
// functions have two forms.
switch (Call->getNumArgs()) {
case 2: {
if (checkOpenCLPipeArg(S, Call))
return true;
// The call with 2 arguments should be
// read/write_pipe(pipe T, T*).
// Check packet type T.
if (checkOpenCLPipePacketType(S, Call, 1))
return true;
} break;
case 4: {
if (checkOpenCLPipeArg(S, Call))
return true;
// The call with 4 arguments should be
// read/write_pipe(pipe T, reserve_id_t, uint, T*).
// Check reserve_id_t.
if (!Call->getArg(1)->getType()->isReserveIDT()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_invalid_arg)
<< Call->getDirectCallee() << S.Context.OCLReserveIDTy
<< Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange();
return true;
}
// Check the index.
const Expr *Arg2 = Call->getArg(2);
if (!Arg2->getType()->isIntegerType() &&
!Arg2->getType()->isUnsignedIntegerType()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_invalid_arg)
<< Call->getDirectCallee() << S.Context.UnsignedIntTy
<< Arg2->getType() << Arg2->getSourceRange();
return true;
}
// Check packet type T.
if (checkOpenCLPipePacketType(S, Call, 3))
return true;
} break;
default:
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_arg_num)
<< Call->getDirectCallee() << Call->getSourceRange();
return true;
}
return false;
}
// \brief Performs a semantic analysis on the {work_group_/sub_group_
// /_}reserve_{read/write}_pipe
// \param S Reference to the semantic analyzer.
// \param Call The call to the builtin function to be analyzed.
// \return True if a semantic error was found, false otherwise.
static bool SemaBuiltinReserveRWPipe(Sema &S, CallExpr *Call) {
if (checkArgCount(S, Call, 2))
return true;
if (checkOpenCLPipeArg(S, Call))
return true;
// Check the reserve size.
if (!Call->getArg(1)->getType()->isIntegerType() &&
!Call->getArg(1)->getType()->isUnsignedIntegerType()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_invalid_arg)
<< Call->getDirectCallee() << S.Context.UnsignedIntTy
<< Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange();
return true;
}
return false;
}
// \brief Performs a semantic analysis on {work_group_/sub_group_
// /_}commit_{read/write}_pipe
// \param S Reference to the semantic analyzer.
// \param Call The call to the builtin function to be analyzed.
// \return True if a semantic error was found, false otherwise.
static bool SemaBuiltinCommitRWPipe(Sema &S, CallExpr *Call) {
if (checkArgCount(S, Call, 2))
return true;
if (checkOpenCLPipeArg(S, Call))
return true;
// Check reserve_id_t.
if (!Call->getArg(1)->getType()->isReserveIDT()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_invalid_arg)
<< Call->getDirectCallee() << S.Context.OCLReserveIDTy
<< Call->getArg(1)->getType() << Call->getArg(1)->getSourceRange();
return true;
}
return false;
}
// \brief Performs a semantic analysis on the call to built-in Pipe
// Query Functions.
// \param S Reference to the semantic analyzer.
// \param Call The call to the builtin function to be analyzed.
// \return True if a semantic error was found, false otherwise.
static bool SemaBuiltinPipePackets(Sema &S, CallExpr *Call) {
if (checkArgCount(S, Call, 1))
return true;
if (!Call->getArg(0)->getType()->isPipeType()) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_pipe_first_arg)
<< Call->getDirectCallee() << Call->getArg(0)->getSourceRange();
return true;
}
return false;
}
// \brief OpenCL v2.0 s6.13.9 - Address space qualifier functions.
// \brief Performs semantic analysis for the to_global/local/private call.
// \param S Reference to the semantic analyzer.
// \param BuiltinID ID of the builtin function.
// \param Call A pointer to the builtin call.
// \return True if a semantic error has been found, false otherwise.
static bool SemaOpenCLBuiltinToAddr(Sema &S, unsigned BuiltinID,
CallExpr *Call) {
if (Call->getNumArgs() != 1) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_to_addr_arg_num)
<< Call->getDirectCallee() << Call->getSourceRange();
return true;
}
auto RT = Call->getArg(0)->getType();
if (!RT->isPointerType() || RT->getPointeeType()
.getAddressSpace() == LangAS::opencl_constant) {
S.Diag(Call->getLocStart(), diag::err_opencl_builtin_to_addr_invalid_arg)
<< Call->getArg(0) << Call->getDirectCallee() << Call->getSourceRange();
return true;
}
RT = RT->getPointeeType();
auto Qual = RT.getQualifiers();
switch (BuiltinID) {
case Builtin::BIto_global:
Qual.setAddressSpace(LangAS::opencl_global);
break;
case Builtin::BIto_local:
Qual.setAddressSpace(LangAS::opencl_local);
break;
default:
Qual.removeAddressSpace();
}
Call->setType(S.Context.getPointerType(S.Context.getQualifiedType(
RT.getUnqualifiedType(), Qual)));
return false;
}
ExprResult
Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
CallExpr *TheCall) {
ExprResult TheCallResult(TheCall);
// Find out if any arguments are required to be integer constant expressions.
unsigned ICEArguments = 0;
ASTContext::GetBuiltinTypeError Error;
Context.GetBuiltinType(BuiltinID, Error, &ICEArguments);
if (Error != ASTContext::GE_None)
ICEArguments = 0; // Don't diagnose previously diagnosed errors.
// If any arguments are required to be ICE's, check and diagnose.
for (unsigned ArgNo = 0; ICEArguments != 0; ++ArgNo) {
// Skip arguments not required to be ICE's.
if ((ICEArguments & (1 << ArgNo)) == 0) continue;
llvm::APSInt Result;
if (SemaBuiltinConstantArg(TheCall, ArgNo, Result))
return true;
ICEArguments &= ~(1 << ArgNo);
}
switch (BuiltinID) {
case Builtin::BI__builtin___CFStringMakeConstantString:
assert(TheCall->getNumArgs() == 1 &&
"Wrong # arguments to builtin CFStringMakeConstantString");
if (CheckObjCString(TheCall->getArg(0)))
return ExprError();
break;
case Builtin::BI__builtin_ms_va_start:
case Builtin::BI__builtin_stdarg_start:
case Builtin::BI__builtin_va_start:
if (SemaBuiltinVAStart(BuiltinID, TheCall))
return ExprError();
break;
case Builtin::BI__va_start: {
switch (Context.getTargetInfo().getTriple().getArch()) {
case llvm::Triple::arm:
case llvm::Triple::thumb:
if (SemaBuiltinVAStartARM(TheCall))
return ExprError();
break;
default:
if (SemaBuiltinVAStart(BuiltinID, TheCall))
return ExprError();
break;
}
break;
}
case Builtin::BI__builtin_isgreater:
case Builtin::BI__builtin_isgreaterequal:
case Builtin::BI__builtin_isless:
case Builtin::BI__builtin_islessequal:
case Builtin::BI__builtin_islessgreater:
case Builtin::BI__builtin_isunordered:
if (SemaBuiltinUnorderedCompare(TheCall))
return ExprError();
break;
case Builtin::BI__builtin_fpclassify:
if (SemaBuiltinFPClassification(TheCall, 6))
return ExprError();
break;
case Builtin::BI__builtin_isfinite:
case Builtin::BI__builtin_isinf:
case Builtin::BI__builtin_isinf_sign:
case Builtin::BI__builtin_isnan:
case Builtin::BI__builtin_isnormal:
if (SemaBuiltinFPClassification(TheCall, 1))
return ExprError();
break;
case Builtin::BI__builtin_shufflevector:
return SemaBuiltinShuffleVector(TheCall);
// TheCall will be freed by the smart pointer here, but that's fine, since
// SemaBuiltinShuffleVector guts it, but then doesn't release it.
case Builtin::BI__builtin_prefetch:
if (SemaBuiltinPrefetch(TheCall))
return ExprError();
break;
case Builtin::BI__builtin_alloca_with_align:
if (SemaBuiltinAllocaWithAlign(TheCall))
return ExprError();
break;
case Builtin::BI__assume:
case Builtin::BI__builtin_assume:
if (SemaBuiltinAssume(TheCall))
return ExprError();
break;
case Builtin::BI__builtin_assume_aligned:
if (SemaBuiltinAssumeAligned(TheCall))
return ExprError();
break;
case Builtin::BI__builtin_object_size:
if (SemaBuiltinConstantArgRange(TheCall, 1, 0, 3))
return ExprError();
break;
case Builtin::BI__builtin_longjmp:
if (SemaBuiltinLongjmp(TheCall))
return ExprError();
break;
case Builtin::BI__builtin_setjmp:
if (SemaBuiltinSetjmp(TheCall))
return ExprError();
break;
case Builtin::BI_setjmp:
case Builtin::BI_setjmpex:
if (checkArgCount(*this, TheCall, 1))
return true;
break;
case Builtin::BI__builtin_classify_type:
if (checkArgCount(*this, TheCall, 1)) return true;
TheCall->setType(Context.IntTy);
break;
case Builtin::BI__builtin_constant_p:
if (checkArgCount(*this, TheCall, 1)) return true;
TheCall->setType(Context.IntTy);
break;
case Builtin::BI__sync_fetch_and_add:
case Builtin::BI__sync_fetch_and_add_1:
case Builtin::BI__sync_fetch_and_add_2:
case Builtin::BI__sync_fetch_and_add_4:
case Builtin::BI__sync_fetch_and_add_8:
case Builtin::BI__sync_fetch_and_add_16:
case Builtin::BI__sync_fetch_and_sub:
case Builtin::BI__sync_fetch_and_sub_1:
case Builtin::BI__sync_fetch_and_sub_2:
case Builtin::BI__sync_fetch_and_sub_4:
case Builtin::BI__sync_fetch_and_sub_8:
case Builtin::BI__sync_fetch_and_sub_16:
case Builtin::BI__sync_fetch_and_or:
case Builtin::BI__sync_fetch_and_or_1:
case Builtin::BI__sync_fetch_and_or_2:
case Builtin::BI__sync_fetch_and_or_4:
case Builtin::BI__sync_fetch_and_or_8:
case Builtin::BI__sync_fetch_and_or_16:
case Builtin::BI__sync_fetch_and_and:
case Builtin::BI__sync_fetch_and_and_1:
case Builtin::BI__sync_fetch_and_and_2:
case Builtin::BI__sync_fetch_and_and_4:
case Builtin::BI__sync_fetch_and_and_8:
case Builtin::BI__sync_fetch_and_and_16:
case Builtin::BI__sync_fetch_and_xor:
case Builtin::BI__sync_fetch_and_xor_1:
case Builtin::BI__sync_fetch_and_xor_2:
case Builtin::BI__sync_fetch_and_xor_4:
case Builtin::BI__sync_fetch_and_xor_8:
case Builtin::BI__sync_fetch_and_xor_16:
case Builtin::BI__sync_fetch_and_nand:
case Builtin::BI__sync_fetch_and_nand_1:
case Builtin::BI__sync_fetch_and_nand_2:
case Builtin::BI__sync_fetch_and_nand_4:
case Builtin::BI__sync_fetch_and_nand_8:
case Builtin::BI__sync_fetch_and_nand_16:
case Builtin::BI__sync_add_and_fetch:
case Builtin::BI__sync_add_and_fetch_1:
case Builtin::BI__sync_add_and_fetch_2:
case Builtin::BI__sync_add_and_fetch_4:
case Builtin::BI__sync_add_and_fetch_8:
case Builtin::BI__sync_add_and_fetch_16:
case Builtin::BI__sync_sub_and_fetch:
case Builtin::BI__sync_sub_and_fetch_1:
case Builtin::BI__sync_sub_and_fetch_2:
case Builtin::BI__sync_sub_and_fetch_4:
case Builtin::BI__sync_sub_and_fetch_8:
case Builtin::BI__sync_sub_and_fetch_16:
case Builtin::BI__sync_and_and_fetch:
case Builtin::BI__sync_and_and_fetch_1:
case Builtin::BI__sync_and_and_fetch_2:
case Builtin::BI__sync_and_and_fetch_4:
case Builtin::BI__sync_and_and_fetch_8:
case Builtin::BI__sync_and_and_fetch_16:
case Builtin::BI__sync_or_and_fetch:
case Builtin::BI__sync_or_and_fetch_1:
case Builtin::BI__sync_or_and_fetch_2:
case Builtin::BI__sync_or_and_fetch_4:
case Builtin::BI__sync_or_and_fetch_8:
case Builtin::BI__sync_or_and_fetch_16:
case Builtin::BI__sync_xor_and_fetch:
case Builtin::BI__sync_xor_and_fetch_1:
case Builtin::BI__sync_xor_and_fetch_2:
case Builtin::BI__sync_xor_and_fetch_4:
case Builtin::BI__sync_xor_and_fetch_8:
case Builtin::BI__sync_xor_and_fetch_16:
case Builtin::BI__sync_nand_and_fetch:
case Builtin::BI__sync_nand_and_fetch_1:
case Builtin::BI__sync_nand_and_fetch_2:
case Builtin::BI__sync_nand_and_fetch_4:
case Builtin::BI__sync_nand_and_fetch_8:
case Builtin::BI__sync_nand_and_fetch_16:
case Builtin::BI__sync_val_compare_and_swap:
case Builtin::BI__sync_val_compare_and_swap_1:
case Builtin::BI__sync_val_compare_and_swap_2:
case Builtin::BI__sync_val_compare_and_swap_4:
case Builtin::BI__sync_val_compare_and_swap_8:
case Builtin::BI__sync_val_compare_and_swap_16:
case Builtin::BI__sync_bool_compare_and_swap:
case Builtin::BI__sync_bool_compare_and_swap_1:
case Builtin::BI__sync_bool_compare_and_swap_2:
case Builtin::BI__sync_bool_compare_and_swap_4:
case Builtin::BI__sync_bool_compare_and_swap_8:
case Builtin::BI__sync_bool_compare_and_swap_16:
case Builtin::BI__sync_lock_test_and_set:
case Builtin::BI__sync_lock_test_and_set_1:
case Builtin::BI__sync_lock_test_and_set_2:
case Builtin::BI__sync_lock_test_and_set_4:
case Builtin::BI__sync_lock_test_and_set_8:
case Builtin::BI__sync_lock_test_and_set_16:
case Builtin::BI__sync_lock_release:
case Builtin::BI__sync_lock_release_1:
case Builtin::BI__sync_lock_release_2:
case Builtin::BI__sync_lock_release_4:
case Builtin::BI__sync_lock_release_8:
case Builtin::BI__sync_lock_release_16:
case Builtin::BI__sync_swap:
case Builtin::BI__sync_swap_1:
case Builtin::BI__sync_swap_2:
case Builtin::BI__sync_swap_4:
case Builtin::BI__sync_swap_8:
case Builtin::BI__sync_swap_16:
return SemaBuiltinAtomicOverloaded(TheCallResult);
case Builtin::BI__builtin_nontemporal_load:
case Builtin::BI__builtin_nontemporal_store:
return SemaBuiltinNontemporalOverloaded(TheCallResult);
#define BUILTIN(ID, TYPE, ATTRS)
#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \
case Builtin::BI##ID: \
return SemaAtomicOpsOverloaded(TheCallResult, AtomicExpr::AO##ID);
#include "clang/Basic/Builtins.def"
case Builtin::BI__builtin_annotation:
if (SemaBuiltinAnnotation(*this, TheCall))
return ExprError();
break;
case Builtin::BI__builtin_addressof:
if (SemaBuiltinAddressof(*this, TheCall))
return ExprError();
break;
case Builtin::BI__builtin_add_overflow:
case Builtin::BI__builtin_sub_overflow:
case Builtin::BI__builtin_mul_overflow:
if (SemaBuiltinOverflow(*this, TheCall))
return ExprError();
break;
case Builtin::BI__builtin_operator_new:
case Builtin::BI__builtin_operator_delete:
if (!getLangOpts().CPlusPlus) {
Diag(TheCall->getExprLoc(), diag::err_builtin_requires_language)
<< (BuiltinID == Builtin::BI__builtin_operator_new
? "__builtin_operator_new"
: "__builtin_operator_delete")
<< "C++";
return ExprError();
}
// CodeGen assumes it can find the global new and delete to call,
// so ensure that they are declared.
DeclareGlobalNewDelete();
break;
// check secure string manipulation functions where overflows
// are detectable at compile time
case Builtin::BI__builtin___memcpy_chk:
case Builtin::BI__builtin___memmove_chk:
case Builtin::BI__builtin___memset_chk:
case Builtin::BI__builtin___strlcat_chk:
case Builtin::BI__builtin___strlcpy_chk:
case Builtin::BI__builtin___strncat_chk:
case Builtin::BI__builtin___strncpy_chk:
case Builtin::BI__builtin___stpncpy_chk:
SemaBuiltinMemChkCall(*this, FDecl, TheCall, 2, 3);
break;
case Builtin::BI__builtin___memccpy_chk:
SemaBuiltinMemChkCall(*this, FDecl, TheCall, 3, 4);
break;
case Builtin::BI__builtin___snprintf_chk:
case Builtin::BI__builtin___vsnprintf_chk:
SemaBuiltinMemChkCall(*this, FDecl, TheCall, 1, 3);
break;
case Builtin::BI__builtin_call_with_static_chain:
if (SemaBuiltinCallWithStaticChain(*this, TheCall))
return ExprError();
break;
case Builtin::BI__exception_code:
case Builtin::BI_exception_code:
if (SemaBuiltinSEHScopeCheck(*this, TheCall, Scope::SEHExceptScope,
diag::err_seh___except_block))
return ExprError();
break;
case Builtin::BI__exception_info:
case Builtin::BI_exception_info:
if (SemaBuiltinSEHScopeCheck(*this, TheCall, Scope::SEHFilterScope,
diag::err_seh___except_filter))
return ExprError();
break;
case Builtin::BI__GetExceptionInfo:
if (checkArgCount(*this, TheCall, 1))
return ExprError();
if (CheckCXXThrowOperand(
TheCall->getLocStart(),
Context.getExceptionObjectType(FDecl->getParamDecl(0)->getType()),
TheCall))
return ExprError();
TheCall->setType(Context.VoidPtrTy);
break;
// OpenCL v2.0, s6.13.16 - Pipe functions
case Builtin::BIread_pipe:
case Builtin::BIwrite_pipe:
// Since those two functions are declared with var args, we need a semantic
// check for the argument.
if (SemaBuiltinRWPipe(*this, TheCall))
return ExprError();
TheCall->setType(Context.IntTy);
break;
case Builtin::BIreserve_read_pipe:
case Builtin::BIreserve_write_pipe:
case Builtin::BIwork_group_reserve_read_pipe:
case Builtin::BIwork_group_reserve_write_pipe:
case Builtin::BIsub_group_reserve_read_pipe:
case Builtin::BIsub_group_reserve_write_pipe:
if (SemaBuiltinReserveRWPipe(*this, TheCall))
return ExprError();
// Since return type of reserve_read/write_pipe built-in function is
// reserve_id_t, which is not defined in the builtin def file , we used int
// as return type and need to override the return type of these functions.
TheCall->setType(Context.OCLReserveIDTy);
break;
case Builtin::BIcommit_read_pipe:
case Builtin::BIcommit_write_pipe:
case Builtin::BIwork_group_commit_read_pipe:
case Builtin::BIwork_group_commit_write_pipe:
case Builtin::BIsub_group_commit_read_pipe:
case Builtin::BIsub_group_commit_write_pipe:
if (SemaBuiltinCommitRWPipe(*this, TheCall))
return ExprError();
break;
case Builtin::BIget_pipe_num_packets:
case Builtin::BIget_pipe_max_packets:
if (SemaBuiltinPipePackets(*this, TheCall))
return ExprError();
TheCall->setType(Context.UnsignedIntTy);
break;
case Builtin::BIto_global:
case Builtin::BIto_local:
case Builtin::BIto_private:
if (SemaOpenCLBuiltinToAddr(*this, BuiltinID, TheCall))
return ExprError();
break;
// OpenCL v2.0, s6.13.17 - Enqueue kernel functions.
case Builtin::BIenqueue_kernel:
if (SemaOpenCLBuiltinEnqueueKernel(*this, TheCall))
return ExprError();
break;
case Builtin::BIget_kernel_work_group_size:
case Builtin::BIget_kernel_preferred_work_group_size_multiple:
if (SemaOpenCLBuiltinKernelWorkGroupSize(*this, TheCall))
return ExprError();
break;
case Builtin::BI__builtin_os_log_format:
case Builtin::BI__builtin_os_log_format_buffer_size:
if (SemaBuiltinOSLogFormat(TheCall)) {
return ExprError();
}
break;
}
// Since the target specific builtins for each arch overlap, only check those
// of the arch we are compiling for.
if (Context.BuiltinInfo.isTSBuiltin(BuiltinID)) {
switch (Context.getTargetInfo().getTriple().getArch()) {
case llvm::Triple::arm:
case llvm::Triple::armeb:
case llvm::Triple::thumb:
case llvm::Triple::thumbeb:
if (CheckARMBuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_be:
if (CheckAArch64BuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
case llvm::Triple::mips:
case llvm::Triple::mipsel:
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
if (CheckMipsBuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
case llvm::Triple::systemz:
if (CheckSystemZBuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
case llvm::Triple::x86:
case llvm::Triple::x86_64:
if (CheckX86BuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
case llvm::Triple::ppc:
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
if (CheckPPCBuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
default:
break;
}
}
return TheCallResult;
}
// Get the valid immediate range for the specified NEON type code.
static unsigned RFT(unsigned t, bool shift = false, bool ForceQuad = false) {
NeonTypeFlags Type(t);
int IsQuad = ForceQuad ? true : Type.isQuad();
switch (Type.getEltType()) {
case NeonTypeFlags::Int8:
case NeonTypeFlags::Poly8:
return shift ? 7 : (8 << IsQuad) - 1;
case NeonTypeFlags::Int16:
case NeonTypeFlags::Poly16:
return shift ? 15 : (4 << IsQuad) - 1;
case NeonTypeFlags::Int32:
return shift ? 31 : (2 << IsQuad) - 1;
case NeonTypeFlags::Int64:
case NeonTypeFlags::Poly64:
return shift ? 63 : (1 << IsQuad) - 1;
case NeonTypeFlags::Poly128:
return shift ? 127 : (1 << IsQuad) - 1;
case NeonTypeFlags::Float16:
assert(!shift && "cannot shift float types!");
return (4 << IsQuad) - 1;
case NeonTypeFlags::Float32:
assert(!shift && "cannot shift float types!");
return (2 << IsQuad) - 1;
case NeonTypeFlags::Float64:
assert(!shift && "cannot shift float types!");
return (1 << IsQuad) - 1;
}
llvm_unreachable("Invalid NeonTypeFlag!");
}
/// getNeonEltType - Return the QualType corresponding to the elements of
/// the vector type specified by the NeonTypeFlags. This is used to check
/// the pointer arguments for Neon load/store intrinsics.
static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context,
bool IsPolyUnsigned, bool IsInt64Long) {
switch (Flags.getEltType()) {
case NeonTypeFlags::Int8:
return Flags.isUnsigned() ? Context.UnsignedCharTy : Context.SignedCharTy;
case NeonTypeFlags::Int16:
return Flags.isUnsigned() ? Context.UnsignedShortTy : Context.ShortTy;
case NeonTypeFlags::Int32:
return Flags.isUnsigned() ? Context.UnsignedIntTy : Context.IntTy;
case NeonTypeFlags::Int64:
if (IsInt64Long)
return Flags.isUnsigned() ? Context.UnsignedLongTy : Context.LongTy;
else
return Flags.isUnsigned() ? Context.UnsignedLongLongTy
: Context.LongLongTy;
case NeonTypeFlags::Poly8:
return IsPolyUnsigned ? Context.UnsignedCharTy : Context.SignedCharTy;
case NeonTypeFlags::Poly16:
return IsPolyUnsigned ? Context.UnsignedShortTy : Context.ShortTy;
case NeonTypeFlags::Poly64:
if (IsInt64Long)
return Context.UnsignedLongTy;
else
return Context.UnsignedLongLongTy;
case NeonTypeFlags::Poly128:
break;
case NeonTypeFlags::Float16:
return Context.HalfTy;
case NeonTypeFlags::Float32:
return Context.FloatTy;
case NeonTypeFlags::Float64:
return Context.DoubleTy;
}
llvm_unreachable("Invalid NeonTypeFlag!");
}
bool Sema::CheckNeonBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
llvm::APSInt Result;
uint64_t mask = 0;
unsigned TV = 0;
int PtrArgNum = -1;
bool HasConstPtr = false;
switch (BuiltinID) {
#define GET_NEON_OVERLOAD_CHECK
#include "clang/Basic/arm_neon.inc"
#undef GET_NEON_OVERLOAD_CHECK
}
// For NEON intrinsics which are overloaded on vector element type, validate
// the immediate which specifies which variant to emit.
unsigned ImmArg = TheCall->getNumArgs()-1;
if (mask) {
if (SemaBuiltinConstantArg(TheCall, ImmArg, Result))
return true;
TV = Result.getLimitedValue(64);
if ((TV > 63) || (mask & (1ULL << TV)) == 0)
return Diag(TheCall->getLocStart(), diag::err_invalid_neon_type_code)
<< TheCall->getArg(ImmArg)->getSourceRange();
}
if (PtrArgNum >= 0) {
// Check that pointer arguments have the specified type.
Expr *Arg = TheCall->getArg(PtrArgNum);
if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg))
Arg = ICE->getSubExpr();
ExprResult RHS = DefaultFunctionArrayLvalueConversion(Arg);
QualType RHSTy = RHS.get()->getType();
llvm::Triple::ArchType Arch = Context.getTargetInfo().getTriple().getArch();
bool IsPolyUnsigned = Arch == llvm::Triple::aarch64 ||
Arch == llvm::Triple::aarch64_be;
bool IsInt64Long =
Context.getTargetInfo().getInt64Type() == TargetInfo::SignedLong;
QualType EltTy =
getNeonEltType(NeonTypeFlags(TV), Context, IsPolyUnsigned, IsInt64Long);
if (HasConstPtr)
EltTy = EltTy.withConst();
QualType LHSTy = Context.getPointerType(EltTy);
AssignConvertType ConvTy;
ConvTy = CheckSingleAssignmentConstraints(LHSTy, RHS);
if (RHS.isInvalid())
return true;
if (DiagnoseAssignmentResult(ConvTy, Arg->getLocStart(), LHSTy, RHSTy,
RHS.get(), AA_Assigning))
return true;
}
// For NEON intrinsics which take an immediate value as part of the
// instruction, range check them here.
unsigned i = 0, l = 0, u = 0;
switch (BuiltinID) {
default:
return false;
#define GET_NEON_IMMEDIATE_CHECK
#include "clang/Basic/arm_neon.inc"
#undef GET_NEON_IMMEDIATE_CHECK
}
return SemaBuiltinConstantArgRange(TheCall, i, l, u + l);
}
bool Sema::CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall,
unsigned MaxWidth) {
assert((BuiltinID == ARM::BI__builtin_arm_ldrex ||
BuiltinID == ARM::BI__builtin_arm_ldaex ||
BuiltinID == ARM::BI__builtin_arm_strex ||
BuiltinID == ARM::BI__builtin_arm_stlex ||
BuiltinID == AArch64::BI__builtin_arm_ldrex ||
BuiltinID == AArch64::BI__builtin_arm_ldaex ||
BuiltinID == AArch64::BI__builtin_arm_strex ||
BuiltinID == AArch64::BI__builtin_arm_stlex) &&
"unexpected ARM builtin");
bool IsLdrex = BuiltinID == ARM::BI__builtin_arm_ldrex ||
BuiltinID == ARM::BI__builtin_arm_ldaex ||
BuiltinID == AArch64::BI__builtin_arm_ldrex ||
BuiltinID == AArch64::BI__builtin_arm_ldaex;
DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
// Ensure that we have the proper number of arguments.
if (checkArgCount(*this, TheCall, IsLdrex ? 1 : 2))
return true;
// Inspect the pointer argument of the atomic builtin. This should always be
// a pointer type, whose element is an integral scalar or pointer type.
// Because it is a pointer type, we don't have to worry about any implicit
// casts here.
Expr *PointerArg = TheCall->getArg(IsLdrex ? 0 : 1);
ExprResult PointerArgRes = DefaultFunctionArrayLvalueConversion(PointerArg);
if (PointerArgRes.isInvalid())
return true;
PointerArg = PointerArgRes.get();
const PointerType *pointerType = PointerArg->getType()->getAs<PointerType>();
if (!pointerType) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer)
<< PointerArg->getType() << PointerArg->getSourceRange();
return true;
}
// ldrex takes a "const volatile T*" and strex takes a "volatile T*". Our next
// task is to insert the appropriate casts into the AST. First work out just
// what the appropriate type is.
QualType ValType = pointerType->getPointeeType();
QualType AddrType = ValType.getUnqualifiedType().withVolatile();
if (IsLdrex)
AddrType.addConst();
// Issue a warning if the cast is dodgy.
CastKind CastNeeded = CK_NoOp;
if (!AddrType.isAtLeastAsQualifiedAs(ValType)) {
CastNeeded = CK_BitCast;
Diag(DRE->getLocStart(), diag::ext_typecheck_convert_discards_qualifiers)
<< PointerArg->getType()
<< Context.getPointerType(AddrType)
<< AA_Passing << PointerArg->getSourceRange();
}
// Finally, do the cast and replace the argument with the corrected version.
AddrType = Context.getPointerType(AddrType);
PointerArgRes = ImpCastExprToType(PointerArg, AddrType, CastNeeded);
if (PointerArgRes.isInvalid())
return true;
PointerArg = PointerArgRes.get();
TheCall->setArg(IsLdrex ? 0 : 1, PointerArg);
// In general, we allow ints, floats and pointers to be loaded and stored.
if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
!ValType->isBlockPointerType() && !ValType->isFloatingType()) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer_intfltptr)
<< PointerArg->getType() << PointerArg->getSourceRange();
return true;
}
// But ARM doesn't have instructions to deal with 128-bit versions.
if (Context.getTypeSize(ValType) > MaxWidth) {
assert(MaxWidth == 64 && "Diagnostic unexpectedly inaccurate");
Diag(DRE->getLocStart(), diag::err_atomic_exclusive_builtin_pointer_size)
<< PointerArg->getType() << PointerArg->getSourceRange();
return true;
}
switch (ValType.getObjCLifetime()) {
case Qualifiers::OCL_None:
case Qualifiers::OCL_ExplicitNone:
// okay
break;
case Qualifiers::OCL_Weak:
case Qualifiers::OCL_Strong:
case Qualifiers::OCL_Autoreleasing:
Diag(DRE->getLocStart(), diag::err_arc_atomic_ownership)
<< ValType << PointerArg->getSourceRange();
return true;
}
if (IsLdrex) {
TheCall->setType(ValType);
return false;
}
// Initialize the argument to be stored.
ExprResult ValArg = TheCall->getArg(0);
InitializedEntity Entity = InitializedEntity::InitializeParameter(
Context, ValType, /*consume*/ false);
ValArg = PerformCopyInitialization(Entity, SourceLocation(), ValArg);
if (ValArg.isInvalid())
return true;
TheCall->setArg(0, ValArg.get());
// __builtin_arm_strex always returns an int. It's marked as such in the .def,
// but the custom checker bypasses all default analysis.
TheCall->setType(Context.IntTy);
return false;
}
bool Sema::CheckARMBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
if (BuiltinID == ARM::BI__builtin_arm_ldrex ||
BuiltinID == ARM::BI__builtin_arm_ldaex ||
BuiltinID == ARM::BI__builtin_arm_strex ||
BuiltinID == ARM::BI__builtin_arm_stlex) {
return CheckARMBuiltinExclusiveCall(BuiltinID, TheCall, 64);
}
if (BuiltinID == ARM::BI__builtin_arm_prefetch) {
return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 1);
}
if (BuiltinID == ARM::BI__builtin_arm_rsr64 ||
BuiltinID == ARM::BI__builtin_arm_wsr64)
return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 3, false);
if (BuiltinID == ARM::BI__builtin_arm_rsr ||
BuiltinID == ARM::BI__builtin_arm_rsrp ||
BuiltinID == ARM::BI__builtin_arm_wsr ||
BuiltinID == ARM::BI__builtin_arm_wsrp)
return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 5, true);
if (CheckNeonBuiltinFunctionCall(BuiltinID, TheCall))
return true;
// For intrinsics which take an immediate value as part of the instruction,
// range check them here.
unsigned i = 0, l = 0, u = 0;
switch (BuiltinID) {
default: return false;
case ARM::BI__builtin_arm_ssat: i = 1; l = 1; u = 31; break;
case ARM::BI__builtin_arm_usat: i = 1; u = 31; break;
case ARM::BI__builtin_arm_vcvtr_f:
case ARM::BI__builtin_arm_vcvtr_d: i = 1; u = 1; break;
case ARM::BI__builtin_arm_dmb:
case ARM::BI__builtin_arm_dsb:
case ARM::BI__builtin_arm_isb:
case ARM::BI__builtin_arm_dbg: l = 0; u = 15; break;
}
// FIXME: VFP Intrinsics should error if VFP not present.
return SemaBuiltinConstantArgRange(TheCall, i, l, u + l);
}
bool Sema::CheckAArch64BuiltinFunctionCall(unsigned BuiltinID,
CallExpr *TheCall) {
if (BuiltinID == AArch64::BI__builtin_arm_ldrex ||
BuiltinID == AArch64::BI__builtin_arm_ldaex ||
BuiltinID == AArch64::BI__builtin_arm_strex ||
BuiltinID == AArch64::BI__builtin_arm_stlex) {
return CheckARMBuiltinExclusiveCall(BuiltinID, TheCall, 128);
}
if (BuiltinID == AArch64::BI__builtin_arm_prefetch) {
return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 2) ||
SemaBuiltinConstantArgRange(TheCall, 3, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 4, 0, 1);
}
if (BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
BuiltinID == AArch64::BI__builtin_arm_wsr64)
return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 5, true);
if (BuiltinID == AArch64::BI__builtin_arm_rsr ||
BuiltinID == AArch64::BI__builtin_arm_rsrp ||
BuiltinID == AArch64::BI__builtin_arm_wsr ||
BuiltinID == AArch64::BI__builtin_arm_wsrp)
return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 5, true);
if (CheckNeonBuiltinFunctionCall(BuiltinID, TheCall))
return true;
// For intrinsics which take an immediate value as part of the instruction,
// range check them here.
unsigned i = 0, l = 0, u = 0;
switch (BuiltinID) {
default: return false;
case AArch64::BI__builtin_arm_dmb:
case AArch64::BI__builtin_arm_dsb:
case AArch64::BI__builtin_arm_isb: l = 0; u = 15; break;
}
return SemaBuiltinConstantArgRange(TheCall, i, l, u + l);
}
// CheckMipsBuiltinFunctionCall - Checks the constant value passed to the
// intrinsic is correct. The switch statement is ordered by DSP, MSA. The
// ordering for DSP is unspecified. MSA is ordered by the data format used
// by the underlying instruction i.e., df/m, df/n and then by size.
//
// FIXME: The size tests here should instead be tablegen'd along with the
// definitions from include/clang/Basic/BuiltinsMips.def.
// FIXME: GCC is strict on signedness for some of these intrinsics, we should
// be too.
bool Sema::CheckMipsBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
unsigned i = 0, l = 0, u = 0, m = 0;
switch (BuiltinID) {
default: return false;
case Mips::BI__builtin_mips_wrdsp: i = 1; l = 0; u = 63; break;
case Mips::BI__builtin_mips_rddsp: i = 0; l = 0; u = 63; break;
case Mips::BI__builtin_mips_append: i = 2; l = 0; u = 31; break;
case Mips::BI__builtin_mips_balign: i = 2; l = 0; u = 3; break;
case Mips::BI__builtin_mips_precr_sra_ph_w: i = 2; l = 0; u = 31; break;
case Mips::BI__builtin_mips_precr_sra_r_ph_w: i = 2; l = 0; u = 31; break;
case Mips::BI__builtin_mips_prepend: i = 2; l = 0; u = 31; break;
// MSA instrinsics. Instructions (which the intrinsics maps to) which use the
// df/m field.
// These intrinsics take an unsigned 3 bit immediate.
case Mips::BI__builtin_msa_bclri_b:
case Mips::BI__builtin_msa_bnegi_b:
case Mips::BI__builtin_msa_bseti_b:
case Mips::BI__builtin_msa_sat_s_b:
case Mips::BI__builtin_msa_sat_u_b:
case Mips::BI__builtin_msa_slli_b:
case Mips::BI__builtin_msa_srai_b:
case Mips::BI__builtin_msa_srari_b:
case Mips::BI__builtin_msa_srli_b:
case Mips::BI__builtin_msa_srlri_b: i = 1; l = 0; u = 7; break;
case Mips::BI__builtin_msa_binsli_b:
case Mips::BI__builtin_msa_binsri_b: i = 2; l = 0; u = 7; break;
// These intrinsics take an unsigned 4 bit immediate.
case Mips::BI__builtin_msa_bclri_h:
case Mips::BI__builtin_msa_bnegi_h:
case Mips::BI__builtin_msa_bseti_h:
case Mips::BI__builtin_msa_sat_s_h:
case Mips::BI__builtin_msa_sat_u_h:
case Mips::BI__builtin_msa_slli_h:
case Mips::BI__builtin_msa_srai_h:
case Mips::BI__builtin_msa_srari_h:
case Mips::BI__builtin_msa_srli_h:
case Mips::BI__builtin_msa_srlri_h: i = 1; l = 0; u = 15; break;
case Mips::BI__builtin_msa_binsli_h:
case Mips::BI__builtin_msa_binsri_h: i = 2; l = 0; u = 15; break;
// These intrinsics take an unsigned 5 bit immedate.
// The first block of intrinsics actually have an unsigned 5 bit field,
// not a df/n field.
case Mips::BI__builtin_msa_clei_u_b:
case Mips::BI__builtin_msa_clei_u_h:
case Mips::BI__builtin_msa_clei_u_w:
case Mips::BI__builtin_msa_clei_u_d:
case Mips::BI__builtin_msa_clti_u_b:
case Mips::BI__builtin_msa_clti_u_h:
case Mips::BI__builtin_msa_clti_u_w:
case Mips::BI__builtin_msa_clti_u_d:
case Mips::BI__builtin_msa_maxi_u_b:
case Mips::BI__builtin_msa_maxi_u_h:
case Mips::BI__builtin_msa_maxi_u_w:
case Mips::BI__builtin_msa_maxi_u_d:
case Mips::BI__builtin_msa_mini_u_b:
case Mips::BI__builtin_msa_mini_u_h:
case Mips::BI__builtin_msa_mini_u_w:
case Mips::BI__builtin_msa_mini_u_d:
case Mips::BI__builtin_msa_addvi_b:
case Mips::BI__builtin_msa_addvi_h:
case Mips::BI__builtin_msa_addvi_w:
case Mips::BI__builtin_msa_addvi_d:
case Mips::BI__builtin_msa_bclri_w:
case Mips::BI__builtin_msa_bnegi_w:
case Mips::BI__builtin_msa_bseti_w:
case Mips::BI__builtin_msa_sat_s_w:
case Mips::BI__builtin_msa_sat_u_w:
case Mips::BI__builtin_msa_slli_w:
case Mips::BI__builtin_msa_srai_w:
case Mips::BI__builtin_msa_srari_w:
case Mips::BI__builtin_msa_srli_w:
case Mips::BI__builtin_msa_srlri_w:
case Mips::BI__builtin_msa_subvi_b:
case Mips::BI__builtin_msa_subvi_h:
case Mips::BI__builtin_msa_subvi_w:
case Mips::BI__builtin_msa_subvi_d: i = 1; l = 0; u = 31; break;
case Mips::BI__builtin_msa_binsli_w:
case Mips::BI__builtin_msa_binsri_w: i = 2; l = 0; u = 31; break;
// These intrinsics take an unsigned 6 bit immediate.
case Mips::BI__builtin_msa_bclri_d:
case Mips::BI__builtin_msa_bnegi_d:
case Mips::BI__builtin_msa_bseti_d:
case Mips::BI__builtin_msa_sat_s_d:
case Mips::BI__builtin_msa_sat_u_d:
case Mips::BI__builtin_msa_slli_d:
case Mips::BI__builtin_msa_srai_d:
case Mips::BI__builtin_msa_srari_d:
case Mips::BI__builtin_msa_srli_d:
case Mips::BI__builtin_msa_srlri_d: i = 1; l = 0; u = 63; break;
case Mips::BI__builtin_msa_binsli_d:
case Mips::BI__builtin_msa_binsri_d: i = 2; l = 0; u = 63; break;
// These intrinsics take a signed 5 bit immediate.
case Mips::BI__builtin_msa_ceqi_b:
case Mips::BI__builtin_msa_ceqi_h:
case Mips::BI__builtin_msa_ceqi_w:
case Mips::BI__builtin_msa_ceqi_d:
case Mips::BI__builtin_msa_clti_s_b:
case Mips::BI__builtin_msa_clti_s_h:
case Mips::BI__builtin_msa_clti_s_w:
case Mips::BI__builtin_msa_clti_s_d:
case Mips::BI__builtin_msa_clei_s_b:
case Mips::BI__builtin_msa_clei_s_h:
case Mips::BI__builtin_msa_clei_s_w:
case Mips::BI__builtin_msa_clei_s_d:
case Mips::BI__builtin_msa_maxi_s_b:
case Mips::BI__builtin_msa_maxi_s_h:
case Mips::BI__builtin_msa_maxi_s_w:
case Mips::BI__builtin_msa_maxi_s_d:
case Mips::BI__builtin_msa_mini_s_b:
case Mips::BI__builtin_msa_mini_s_h:
case Mips::BI__builtin_msa_mini_s_w:
case Mips::BI__builtin_msa_mini_s_d: i = 1; l = -16; u = 15; break;
// These intrinsics take an unsigned 8 bit immediate.
case Mips::BI__builtin_msa_andi_b:
case Mips::BI__builtin_msa_nori_b:
case Mips::BI__builtin_msa_ori_b:
case Mips::BI__builtin_msa_shf_b:
case Mips::BI__builtin_msa_shf_h:
case Mips::BI__builtin_msa_shf_w:
case Mips::BI__builtin_msa_xori_b: i = 1; l = 0; u = 255; break;
case Mips::BI__builtin_msa_bseli_b:
case Mips::BI__builtin_msa_bmnzi_b:
case Mips::BI__builtin_msa_bmzi_b: i = 2; l = 0; u = 255; break;
// df/n format
// These intrinsics take an unsigned 4 bit immediate.
case Mips::BI__builtin_msa_copy_s_b:
case Mips::BI__builtin_msa_copy_u_b:
case Mips::BI__builtin_msa_insve_b:
case Mips::BI__builtin_msa_splati_b: i = 1; l = 0; u = 15; break;
case Mips::BI__builtin_msa_sldi_b: i = 2; l = 0; u = 15; break;
// These intrinsics take an unsigned 3 bit immediate.
case Mips::BI__builtin_msa_copy_s_h:
case Mips::BI__builtin_msa_copy_u_h:
case Mips::BI__builtin_msa_insve_h:
case Mips::BI__builtin_msa_splati_h: i = 1; l = 0; u = 7; break;
case Mips::BI__builtin_msa_sldi_h: i = 2; l = 0; u = 7; break;
// These intrinsics take an unsigned 2 bit immediate.
case Mips::BI__builtin_msa_copy_s_w:
case Mips::BI__builtin_msa_copy_u_w:
case Mips::BI__builtin_msa_insve_w:
case Mips::BI__builtin_msa_splati_w: i = 1; l = 0; u = 3; break;
case Mips::BI__builtin_msa_sldi_w: i = 2; l = 0; u = 3; break;
// These intrinsics take an unsigned 1 bit immediate.
case Mips::BI__builtin_msa_copy_s_d:
case Mips::BI__builtin_msa_copy_u_d:
case Mips::BI__builtin_msa_insve_d:
case Mips::BI__builtin_msa_splati_d: i = 1; l = 0; u = 1; break;
case Mips::BI__builtin_msa_sldi_d: i = 2; l = 0; u = 1; break;
// Memory offsets and immediate loads.
// These intrinsics take a signed 10 bit immediate.
case Mips::BI__builtin_msa_ldi_b: i = 0; l = -128; u = 255; break;
case Mips::BI__builtin_msa_ldi_h:
case Mips::BI__builtin_msa_ldi_w:
case Mips::BI__builtin_msa_ldi_d: i = 0; l = -512; u = 511; break;
case Mips::BI__builtin_msa_ld_b: i = 1; l = -512; u = 511; m = 16; break;
case Mips::BI__builtin_msa_ld_h: i = 1; l = -1024; u = 1022; m = 16; break;
case Mips::BI__builtin_msa_ld_w: i = 1; l = -2048; u = 2044; m = 16; break;
case Mips::BI__builtin_msa_ld_d: i = 1; l = -4096; u = 4088; m = 16; break;
case Mips::BI__builtin_msa_st_b: i = 2; l = -512; u = 511; m = 16; break;
case Mips::BI__builtin_msa_st_h: i = 2; l = -1024; u = 1022; m = 16; break;
case Mips::BI__builtin_msa_st_w: i = 2; l = -2048; u = 2044; m = 16; break;
case Mips::BI__builtin_msa_st_d: i = 2; l = -4096; u = 4088; m = 16; break;
}
if (!m)
return SemaBuiltinConstantArgRange(TheCall, i, l, u);
return SemaBuiltinConstantArgRange(TheCall, i, l, u) ||
SemaBuiltinConstantArgMultiple(TheCall, i, m);
}
bool Sema::CheckPPCBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
unsigned i = 0, l = 0, u = 0;
bool Is64BitBltin = BuiltinID == PPC::BI__builtin_divde ||
BuiltinID == PPC::BI__builtin_divdeu ||
BuiltinID == PPC::BI__builtin_bpermd;
bool IsTarget64Bit = Context.getTargetInfo()
.getTypeWidth(Context
.getTargetInfo()
.getIntPtrType()) == 64;
bool IsBltinExtDiv = BuiltinID == PPC::BI__builtin_divwe ||
BuiltinID == PPC::BI__builtin_divweu ||
BuiltinID == PPC::BI__builtin_divde ||
BuiltinID == PPC::BI__builtin_divdeu;
if (Is64BitBltin && !IsTarget64Bit)
return Diag(TheCall->getLocStart(), diag::err_64_bit_builtin_32_bit_tgt)
<< TheCall->getSourceRange();
if ((IsBltinExtDiv && !Context.getTargetInfo().hasFeature("extdiv")) ||
(BuiltinID == PPC::BI__builtin_bpermd &&
!Context.getTargetInfo().hasFeature("bpermd")))
return Diag(TheCall->getLocStart(), diag::err_ppc_builtin_only_on_pwr7)
<< TheCall->getSourceRange();
switch (BuiltinID) {
default: return false;
case PPC::BI__builtin_altivec_crypto_vshasigmaw:
case PPC::BI__builtin_altivec_crypto_vshasigmad:
return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 15);
case PPC::BI__builtin_tbegin:
case PPC::BI__builtin_tend: i = 0; l = 0; u = 1; break;
case PPC::BI__builtin_tsr: i = 0; l = 0; u = 7; break;
case PPC::BI__builtin_tabortwc:
case PPC::BI__builtin_tabortdc: i = 0; l = 0; u = 31; break;
case PPC::BI__builtin_tabortwci:
case PPC::BI__builtin_tabortdci:
return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
case PPC::BI__builtin_vsx_xxpermdi:
case PPC::BI__builtin_vsx_xxsldwi:
return SemaBuiltinVSX(TheCall);
}
return SemaBuiltinConstantArgRange(TheCall, i, l, u);
}
bool Sema::CheckSystemZBuiltinFunctionCall(unsigned BuiltinID,
CallExpr *TheCall) {
if (BuiltinID == SystemZ::BI__builtin_tabort) {
Expr *Arg = TheCall->getArg(0);
llvm::APSInt AbortCode(32);
if (Arg->isIntegerConstantExpr(AbortCode, Context) &&
AbortCode.getSExtValue() >= 0 && AbortCode.getSExtValue() < 256)
return Diag(Arg->getLocStart(), diag::err_systemz_invalid_tabort_code)
<< Arg->getSourceRange();
}
// For intrinsics which take an immediate value as part of the instruction,
// range check them here.
unsigned i = 0, l = 0, u = 0;
switch (BuiltinID) {
default: return false;
case SystemZ::BI__builtin_s390_lcbb: i = 1; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_verimb:
case SystemZ::BI__builtin_s390_verimh:
case SystemZ::BI__builtin_s390_verimf:
case SystemZ::BI__builtin_s390_verimg: i = 3; l = 0; u = 255; break;
case SystemZ::BI__builtin_s390_vfaeb:
case SystemZ::BI__builtin_s390_vfaeh:
case SystemZ::BI__builtin_s390_vfaef:
case SystemZ::BI__builtin_s390_vfaebs:
case SystemZ::BI__builtin_s390_vfaehs:
case SystemZ::BI__builtin_s390_vfaefs:
case SystemZ::BI__builtin_s390_vfaezb:
case SystemZ::BI__builtin_s390_vfaezh:
case SystemZ::BI__builtin_s390_vfaezf:
case SystemZ::BI__builtin_s390_vfaezbs:
case SystemZ::BI__builtin_s390_vfaezhs:
case SystemZ::BI__builtin_s390_vfaezfs: i = 2; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vfisb:
case SystemZ::BI__builtin_s390_vfidb:
return SemaBuiltinConstantArgRange(TheCall, 1, 0, 15) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 15);
case SystemZ::BI__builtin_s390_vftcisb:
case SystemZ::BI__builtin_s390_vftcidb: i = 1; l = 0; u = 4095; break;
case SystemZ::BI__builtin_s390_vlbb: i = 1; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vpdi: i = 2; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vsldb: i = 2; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vstrcb:
case SystemZ::BI__builtin_s390_vstrch:
case SystemZ::BI__builtin_s390_vstrcf:
case SystemZ::BI__builtin_s390_vstrczb:
case SystemZ::BI__builtin_s390_vstrczh:
case SystemZ::BI__builtin_s390_vstrczf:
case SystemZ::BI__builtin_s390_vstrcbs:
case SystemZ::BI__builtin_s390_vstrchs:
case SystemZ::BI__builtin_s390_vstrcfs:
case SystemZ::BI__builtin_s390_vstrczbs:
case SystemZ::BI__builtin_s390_vstrczhs:
case SystemZ::BI__builtin_s390_vstrczfs: i = 3; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vmslg: i = 3; l = 0; u = 15; break;
case SystemZ::BI__builtin_s390_vfminsb:
case SystemZ::BI__builtin_s390_vfmaxsb:
case SystemZ::BI__builtin_s390_vfmindb:
case SystemZ::BI__builtin_s390_vfmaxdb: i = 2; l = 0; u = 15; break;
}
return SemaBuiltinConstantArgRange(TheCall, i, l, u);
}
/// SemaBuiltinCpuSupports - Handle __builtin_cpu_supports(char *).
/// This checks that the target supports __builtin_cpu_supports and
/// that the string argument is constant and valid.
static bool SemaBuiltinCpuSupports(Sema &S, CallExpr *TheCall) {
Expr *Arg = TheCall->getArg(0);
// Check if the argument is a string literal.
if (!isa<StringLiteral>(Arg->IgnoreParenImpCasts()))
return S.Diag(TheCall->getLocStart(), diag::err_expr_not_string_literal)
<< Arg->getSourceRange();
// Check the contents of the string.
StringRef Feature =
cast<StringLiteral>(Arg->IgnoreParenImpCasts())->getString();
if (!S.Context.getTargetInfo().validateCpuSupports(Feature))
return S.Diag(TheCall->getLocStart(), diag::err_invalid_cpu_supports)
<< Arg->getSourceRange();
return false;
}
// Check if the rounding mode is legal.
bool Sema::CheckX86BuiltinRoundingOrSAE(unsigned BuiltinID, CallExpr *TheCall) {
// Indicates if this instruction has rounding control or just SAE.
bool HasRC = false;
unsigned ArgNum = 0;
switch (BuiltinID) {
default:
return false;
case X86::BI__builtin_ia32_vcvttsd2si32:
case X86::BI__builtin_ia32_vcvttsd2si64:
case X86::BI__builtin_ia32_vcvttsd2usi32:
case X86::BI__builtin_ia32_vcvttsd2usi64:
case X86::BI__builtin_ia32_vcvttss2si32:
case X86::BI__builtin_ia32_vcvttss2si64:
case X86::BI__builtin_ia32_vcvttss2usi32:
case X86::BI__builtin_ia32_vcvttss2usi64:
ArgNum = 1;
break;
case X86::BI__builtin_ia32_cvtps2pd512_mask:
case X86::BI__builtin_ia32_cvttpd2dq512_mask:
case X86::BI__builtin_ia32_cvttpd2qq512_mask:
case X86::BI__builtin_ia32_cvttpd2udq512_mask:
case X86::BI__builtin_ia32_cvttpd2uqq512_mask:
case X86::BI__builtin_ia32_cvttps2dq512_mask:
case X86::BI__builtin_ia32_cvttps2qq512_mask:
case X86::BI__builtin_ia32_cvttps2udq512_mask:
case X86::BI__builtin_ia32_cvttps2uqq512_mask:
case X86::BI__builtin_ia32_exp2pd_mask:
case X86::BI__builtin_ia32_exp2ps_mask:
case X86::BI__builtin_ia32_getexppd512_mask:
case X86::BI__builtin_ia32_getexpps512_mask:
case X86::BI__builtin_ia32_rcp28pd_mask:
case X86::BI__builtin_ia32_rcp28ps_mask:
case X86::BI__builtin_ia32_rsqrt28pd_mask:
case X86::BI__builtin_ia32_rsqrt28ps_mask:
case X86::BI__builtin_ia32_vcomisd:
case X86::BI__builtin_ia32_vcomiss:
case X86::BI__builtin_ia32_vcvtph2ps512_mask:
ArgNum = 3;
break;
case X86::BI__builtin_ia32_cmppd512_mask:
case X86::BI__builtin_ia32_cmpps512_mask:
case X86::BI__builtin_ia32_cmpsd_mask:
case X86::BI__builtin_ia32_cmpss_mask:
case X86::BI__builtin_ia32_cvtss2sd_round_mask:
case X86::BI__builtin_ia32_getexpsd128_round_mask:
case X86::BI__builtin_ia32_getexpss128_round_mask:
case X86::BI__builtin_ia32_maxpd512_mask:
case X86::BI__builtin_ia32_maxps512_mask:
case X86::BI__builtin_ia32_maxsd_round_mask:
case X86::BI__builtin_ia32_maxss_round_mask:
case X86::BI__builtin_ia32_minpd512_mask:
case X86::BI__builtin_ia32_minps512_mask:
case X86::BI__builtin_ia32_minsd_round_mask:
case X86::BI__builtin_ia32_minss_round_mask:
case X86::BI__builtin_ia32_rcp28sd_round_mask:
case X86::BI__builtin_ia32_rcp28ss_round_mask:
case X86::BI__builtin_ia32_reducepd512_mask:
case X86::BI__builtin_ia32_reduceps512_mask:
case X86::BI__builtin_ia32_rndscalepd_mask:
case X86::BI__builtin_ia32_rndscaleps_mask:
case X86::BI__builtin_ia32_rsqrt28sd_round_mask:
case X86::BI__builtin_ia32_rsqrt28ss_round_mask:
ArgNum = 4;
break;
case X86::BI__builtin_ia32_fixupimmpd512_mask:
case X86::BI__builtin_ia32_fixupimmpd512_maskz:
case X86::BI__builtin_ia32_fixupimmps512_mask:
case X86::BI__builtin_ia32_fixupimmps512_maskz:
case X86::BI__builtin_ia32_fixupimmsd_mask:
case X86::BI__builtin_ia32_fixupimmsd_maskz:
case X86::BI__builtin_ia32_fixupimmss_mask:
case X86::BI__builtin_ia32_fixupimmss_maskz:
case X86::BI__builtin_ia32_rangepd512_mask:
case X86::BI__builtin_ia32_rangeps512_mask:
case X86::BI__builtin_ia32_rangesd128_round_mask:
case X86::BI__builtin_ia32_rangess128_round_mask:
case X86::BI__builtin_ia32_reducesd_mask:
case X86::BI__builtin_ia32_reducess_mask:
case X86::BI__builtin_ia32_rndscalesd_round_mask:
case X86::BI__builtin_ia32_rndscaless_round_mask:
ArgNum = 5;
break;
case X86::BI__builtin_ia32_vcvtsd2si64:
case X86::BI__builtin_ia32_vcvtsd2si32:
case X86::BI__builtin_ia32_vcvtsd2usi32:
case X86::BI__builtin_ia32_vcvtsd2usi64:
case X86::BI__builtin_ia32_vcvtss2si32:
case X86::BI__builtin_ia32_vcvtss2si64:
case X86::BI__builtin_ia32_vcvtss2usi32:
case X86::BI__builtin_ia32_vcvtss2usi64:
ArgNum = 1;
HasRC = true;
break;
case X86::BI__builtin_ia32_cvtsi2sd64:
case X86::BI__builtin_ia32_cvtsi2ss32:
case X86::BI__builtin_ia32_cvtsi2ss64:
case X86::BI__builtin_ia32_cvtusi2sd64:
case X86::BI__builtin_ia32_cvtusi2ss32:
case X86::BI__builtin_ia32_cvtusi2ss64:
ArgNum = 2;
HasRC = true;
break;
case X86::BI__builtin_ia32_cvtdq2ps512_mask:
case X86::BI__builtin_ia32_cvtudq2ps512_mask:
case X86::BI__builtin_ia32_cvtpd2ps512_mask:
case X86::BI__builtin_ia32_cvtpd2qq512_mask:
case X86::BI__builtin_ia32_cvtpd2uqq512_mask:
case X86::BI__builtin_ia32_cvtps2qq512_mask:
case X86::BI__builtin_ia32_cvtps2uqq512_mask:
case X86::BI__builtin_ia32_cvtqq2pd512_mask:
case X86::BI__builtin_ia32_cvtqq2ps512_mask:
case X86::BI__builtin_ia32_cvtuqq2pd512_mask:
case X86::BI__builtin_ia32_cvtuqq2ps512_mask:
case X86::BI__builtin_ia32_sqrtpd512_mask:
case X86::BI__builtin_ia32_sqrtps512_mask:
ArgNum = 3;
HasRC = true;
break;
case X86::BI__builtin_ia32_addpd512_mask:
case X86::BI__builtin_ia32_addps512_mask:
case X86::BI__builtin_ia32_divpd512_mask:
case X86::BI__builtin_ia32_divps512_mask:
case X86::BI__builtin_ia32_mulpd512_mask:
case X86::BI__builtin_ia32_mulps512_mask:
case X86::BI__builtin_ia32_subpd512_mask:
case X86::BI__builtin_ia32_subps512_mask:
case X86::BI__builtin_ia32_addss_round_mask:
case X86::BI__builtin_ia32_addsd_round_mask:
case X86::BI__builtin_ia32_divss_round_mask:
case X86::BI__builtin_ia32_divsd_round_mask:
case X86::BI__builtin_ia32_mulss_round_mask:
case X86::BI__builtin_ia32_mulsd_round_mask:
case X86::BI__builtin_ia32_subss_round_mask:
case X86::BI__builtin_ia32_subsd_round_mask:
case X86::BI__builtin_ia32_scalefpd512_mask:
case X86::BI__builtin_ia32_scalefps512_mask:
case X86::BI__builtin_ia32_scalefsd_round_mask:
case X86::BI__builtin_ia32_scalefss_round_mask:
case X86::BI__builtin_ia32_getmantpd512_mask:
case X86::BI__builtin_ia32_getmantps512_mask:
case X86::BI__builtin_ia32_cvtsd2ss_round_mask:
case X86::BI__builtin_ia32_sqrtsd_round_mask:
case X86::BI__builtin_ia32_sqrtss_round_mask:
case X86::BI__builtin_ia32_vfmaddpd512_mask:
case X86::BI__builtin_ia32_vfmaddpd512_mask3:
case X86::BI__builtin_ia32_vfmaddpd512_maskz:
case X86::BI__builtin_ia32_vfmaddps512_mask:
case X86::BI__builtin_ia32_vfmaddps512_mask3:
case X86::BI__builtin_ia32_vfmaddps512_maskz:
case X86::BI__builtin_ia32_vfmaddsubpd512_mask:
case X86::BI__builtin_ia32_vfmaddsubpd512_mask3:
case X86::BI__builtin_ia32_vfmaddsubpd512_maskz:
case X86::BI__builtin_ia32_vfmaddsubps512_mask:
case X86::BI__builtin_ia32_vfmaddsubps512_mask3:
case X86::BI__builtin_ia32_vfmaddsubps512_maskz:
case X86::BI__builtin_ia32_vfmsubpd512_mask3:
case X86::BI__builtin_ia32_vfmsubps512_mask3:
case X86::BI__builtin_ia32_vfmsubaddpd512_mask3:
case X86::BI__builtin_ia32_vfmsubaddps512_mask3:
case X86::BI__builtin_ia32_vfnmaddpd512_mask:
case X86::BI__builtin_ia32_vfnmaddps512_mask:
case X86::BI__builtin_ia32_vfnmsubpd512_mask:
case X86::BI__builtin_ia32_vfnmsubpd512_mask3:
case X86::BI__builtin_ia32_vfnmsubps512_mask:
case X86::BI__builtin_ia32_vfnmsubps512_mask3:
case X86::BI__builtin_ia32_vfmaddsd3_mask:
case X86::BI__builtin_ia32_vfmaddsd3_maskz:
case X86::BI__builtin_ia32_vfmaddsd3_mask3:
case X86::BI__builtin_ia32_vfmaddss3_mask:
case X86::BI__builtin_ia32_vfmaddss3_maskz:
case X86::BI__builtin_ia32_vfmaddss3_mask3:
ArgNum = 4;
HasRC = true;
break;
case X86::BI__builtin_ia32_getmantsd_round_mask:
case X86::BI__builtin_ia32_getmantss_round_mask:
ArgNum = 5;
HasRC = true;
break;
}
llvm::APSInt Result;
// We can't check the value of a dependent argument.
Expr *Arg = TheCall->getArg(ArgNum);
if (Arg->isTypeDependent() || Arg->isValueDependent())
return false;
// Check constant-ness first.
if (SemaBuiltinConstantArg(TheCall, ArgNum, Result))
return true;
// Make sure rounding mode is either ROUND_CUR_DIRECTION or ROUND_NO_EXC bit
// is set. If the intrinsic has rounding control(bits 1:0), make sure its only
// combined with ROUND_NO_EXC.
if (Result == 4/*ROUND_CUR_DIRECTION*/ ||
Result == 8/*ROUND_NO_EXC*/ ||
(HasRC && Result.getZExtValue() >= 8 && Result.getZExtValue() <= 11))
return false;
return Diag(TheCall->getLocStart(), diag::err_x86_builtin_invalid_rounding)
<< Arg->getSourceRange();
}
// Check if the gather/scatter scale is legal.
bool Sema::CheckX86BuiltinGatherScatterScale(unsigned BuiltinID,
CallExpr *TheCall) {
unsigned ArgNum = 0;
switch (BuiltinID) {
default:
return false;
case X86::BI__builtin_ia32_gatherpfdpd:
case X86::BI__builtin_ia32_gatherpfdps:
case X86::BI__builtin_ia32_gatherpfqpd:
case X86::BI__builtin_ia32_gatherpfqps:
case X86::BI__builtin_ia32_scatterpfdpd:
case X86::BI__builtin_ia32_scatterpfdps:
case X86::BI__builtin_ia32_scatterpfqpd:
case X86::BI__builtin_ia32_scatterpfqps:
ArgNum = 3;
break;
case X86::BI__builtin_ia32_gatherd_pd:
case X86::BI__builtin_ia32_gatherd_pd256:
case X86::BI__builtin_ia32_gatherq_pd:
case X86::BI__builtin_ia32_gatherq_pd256:
case X86::BI__builtin_ia32_gatherd_ps:
case X86::BI__builtin_ia32_gatherd_ps256:
case X86::BI__builtin_ia32_gatherq_ps:
case X86::BI__builtin_ia32_gatherq_ps256:
case X86::BI__builtin_ia32_gatherd_q:
case X86::BI__builtin_ia32_gatherd_q256:
case X86::BI__builtin_ia32_gatherq_q:
case X86::BI__builtin_ia32_gatherq_q256:
case X86::BI__builtin_ia32_gatherd_d:
case X86::BI__builtin_ia32_gatherd_d256:
case X86::BI__builtin_ia32_gatherq_d:
case X86::BI__builtin_ia32_gatherq_d256:
case X86::BI__builtin_ia32_gather3div2df:
case X86::BI__builtin_ia32_gather3div2di:
case X86::BI__builtin_ia32_gather3div4df:
case X86::BI__builtin_ia32_gather3div4di:
case X86::BI__builtin_ia32_gather3div4sf:
case X86::BI__builtin_ia32_gather3div4si:
case X86::BI__builtin_ia32_gather3div8sf:
case X86::BI__builtin_ia32_gather3div8si:
case X86::BI__builtin_ia32_gather3siv2df:
case X86::BI__builtin_ia32_gather3siv2di:
case X86::BI__builtin_ia32_gather3siv4df:
case X86::BI__builtin_ia32_gather3siv4di:
case X86::BI__builtin_ia32_gather3siv4sf:
case X86::BI__builtin_ia32_gather3siv4si:
case X86::BI__builtin_ia32_gather3siv8sf:
case X86::BI__builtin_ia32_gather3siv8si:
case X86::BI__builtin_ia32_gathersiv8df:
case X86::BI__builtin_ia32_gathersiv16sf:
case X86::BI__builtin_ia32_gatherdiv8df:
case X86::BI__builtin_ia32_gatherdiv16sf:
case X86::BI__builtin_ia32_gathersiv8di:
case X86::BI__builtin_ia32_gathersiv16si:
case X86::BI__builtin_ia32_gatherdiv8di:
case X86::BI__builtin_ia32_gatherdiv16si:
case X86::BI__builtin_ia32_scatterdiv2df:
case X86::BI__builtin_ia32_scatterdiv2di:
case X86::BI__builtin_ia32_scatterdiv4df:
case X86::BI__builtin_ia32_scatterdiv4di:
case X86::BI__builtin_ia32_scatterdiv4sf:
case X86::BI__builtin_ia32_scatterdiv4si:
case X86::BI__builtin_ia32_scatterdiv8sf:
case X86::BI__builtin_ia32_scatterdiv8si:
case X86::BI__builtin_ia32_scattersiv2df:
case X86::BI__builtin_ia32_scattersiv2di:
case X86::BI__builtin_ia32_scattersiv4df:
case X86::BI__builtin_ia32_scattersiv4di:
case X86::BI__builtin_ia32_scattersiv4sf:
case X86::BI__builtin_ia32_scattersiv4si:
case X86::BI__builtin_ia32_scattersiv8sf:
case X86::BI__builtin_ia32_scattersiv8si:
case X86::BI__builtin_ia32_scattersiv8df:
case X86::BI__builtin_ia32_scattersiv16sf:
case X86::BI__builtin_ia32_scatterdiv8df:
case X86::BI__builtin_ia32_scatterdiv16sf:
case X86::BI__builtin_ia32_scattersiv8di:
case X86::BI__builtin_ia32_scattersiv16si:
case X86::BI__builtin_ia32_scatterdiv8di:
case X86::BI__builtin_ia32_scatterdiv16si:
ArgNum = 4;
break;
}
llvm::APSInt Result;
// We can't check the value of a dependent argument.
Expr *Arg = TheCall->getArg(ArgNum);
if (Arg->isTypeDependent() || Arg->isValueDependent())
return false;
// Check constant-ness first.
if (SemaBuiltinConstantArg(TheCall, ArgNum, Result))
return true;
if (Result == 1 || Result == 2 || Result == 4 || Result == 8)
return false;
return Diag(TheCall->getLocStart(), diag::err_x86_builtin_invalid_scale)
<< Arg->getSourceRange();
}
bool Sema::CheckX86BuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
if (BuiltinID == X86::BI__builtin_cpu_supports)
return SemaBuiltinCpuSupports(*this, TheCall);
// If the intrinsic has rounding or SAE make sure its valid.
if (CheckX86BuiltinRoundingOrSAE(BuiltinID, TheCall))
return true;
// If the intrinsic has a gather/scatter scale immediate make sure its valid.
if (CheckX86BuiltinGatherScatterScale(BuiltinID, TheCall))
return true;
// For intrinsics which take an immediate value as part of the instruction,
// range check them here.
int i = 0, l = 0, u = 0;
switch (BuiltinID) {
default:
return false;
case X86::BI_mm_prefetch:
i = 1; l = 0; u = 3;
break;
case X86::BI__builtin_ia32_sha1rnds4:
case X86::BI__builtin_ia32_shuf_f32x4_256_mask:
case X86::BI__builtin_ia32_shuf_f64x2_256_mask:
case X86::BI__builtin_ia32_shuf_i32x4_256_mask:
case X86::BI__builtin_ia32_shuf_i64x2_256_mask:
i = 2; l = 0; u = 3;
break;
case X86::BI__builtin_ia32_vpermil2pd:
case X86::BI__builtin_ia32_vpermil2pd256:
case X86::BI__builtin_ia32_vpermil2ps:
case X86::BI__builtin_ia32_vpermil2ps256:
i = 3; l = 0; u = 3;
break;
case X86::BI__builtin_ia32_cmpb128_mask:
case X86::BI__builtin_ia32_cmpw128_mask:
case X86::BI__builtin_ia32_cmpd128_mask:
case X86::BI__builtin_ia32_cmpq128_mask:
case X86::BI__builtin_ia32_cmpb256_mask:
case X86::BI__builtin_ia32_cmpw256_mask:
case X86::BI__builtin_ia32_cmpd256_mask:
case X86::BI__builtin_ia32_cmpq256_mask:
case X86::BI__builtin_ia32_cmpb512_mask:
case X86::BI__builtin_ia32_cmpw512_mask:
case X86::BI__builtin_ia32_cmpd512_mask:
case X86::BI__builtin_ia32_cmpq512_mask:
case X86::BI__builtin_ia32_ucmpb128_mask:
case X86::BI__builtin_ia32_ucmpw128_mask:
case X86::BI__builtin_ia32_ucmpd128_mask:
case X86::BI__builtin_ia32_ucmpq128_mask:
case X86::BI__builtin_ia32_ucmpb256_mask:
case X86::BI__builtin_ia32_ucmpw256_mask:
case X86::BI__builtin_ia32_ucmpd256_mask:
case X86::BI__builtin_ia32_ucmpq256_mask:
case X86::BI__builtin_ia32_ucmpb512_mask:
case X86::BI__builtin_ia32_ucmpw512_mask:
case X86::BI__builtin_ia32_ucmpd512_mask:
case X86::BI__builtin_ia32_ucmpq512_mask:
case X86::BI__builtin_ia32_vpcomub:
case X86::BI__builtin_ia32_vpcomuw:
case X86::BI__builtin_ia32_vpcomud:
case X86::BI__builtin_ia32_vpcomuq:
case X86::BI__builtin_ia32_vpcomb:
case X86::BI__builtin_ia32_vpcomw:
case X86::BI__builtin_ia32_vpcomd:
case X86::BI__builtin_ia32_vpcomq:
i = 2; l = 0; u = 7;
break;
case X86::BI__builtin_ia32_roundps:
case X86::BI__builtin_ia32_roundpd:
case X86::BI__builtin_ia32_roundps256:
case X86::BI__builtin_ia32_roundpd256:
i = 1; l = 0; u = 15;
break;
case X86::BI__builtin_ia32_roundss:
case X86::BI__builtin_ia32_roundsd:
case X86::BI__builtin_ia32_rangepd128_mask:
case X86::BI__builtin_ia32_rangepd256_mask:
case X86::BI__builtin_ia32_rangepd512_mask:
case X86::BI__builtin_ia32_rangeps128_mask:
case X86::BI__builtin_ia32_rangeps256_mask:
case X86::BI__builtin_ia32_rangeps512_mask:
case X86::BI__builtin_ia32_getmantsd_round_mask:
case X86::BI__builtin_ia32_getmantss_round_mask:
i = 2; l = 0; u = 15;
break;
case X86::BI__builtin_ia32_cmpps:
case X86::BI__builtin_ia32_cmpss:
case X86::BI__builtin_ia32_cmppd:
case X86::BI__builtin_ia32_cmpsd:
case X86::BI__builtin_ia32_cmpps256:
case X86::BI__builtin_ia32_cmppd256:
case X86::BI__builtin_ia32_cmpps128_mask:
case X86::BI__builtin_ia32_cmppd128_mask:
case X86::BI__builtin_ia32_cmpps256_mask:
case X86::BI__builtin_ia32_cmppd256_mask:
case X86::BI__builtin_ia32_cmpps512_mask:
case X86::BI__builtin_ia32_cmppd512_mask:
case X86::BI__builtin_ia32_cmpsd_mask:
case X86::BI__builtin_ia32_cmpss_mask:
i = 2; l = 0; u = 31;
break;
case X86::BI__builtin_ia32_xabort:
i = 0; l = -128; u = 255;
break;
case X86::BI__builtin_ia32_pshufw:
case X86::BI__builtin_ia32_aeskeygenassist128:
i = 1; l = -128; u = 255;
break;
case X86::BI__builtin_ia32_vcvtps2ph:
case X86::BI__builtin_ia32_vcvtps2ph256:
case X86::BI__builtin_ia32_rndscaleps_128_mask:
case X86::BI__builtin_ia32_rndscalepd_128_mask:
case X86::BI__builtin_ia32_rndscaleps_256_mask:
case X86::BI__builtin_ia32_rndscalepd_256_mask:
case X86::BI__builtin_ia32_rndscaleps_mask:
case X86::BI__builtin_ia32_rndscalepd_mask:
case X86::BI__builtin_ia32_reducepd128_mask:
case X86::BI__builtin_ia32_reducepd256_mask:
case X86::BI__builtin_ia32_reducepd512_mask:
case X86::BI__builtin_ia32_reduceps128_mask:
case X86::BI__builtin_ia32_reduceps256_mask:
case X86::BI__builtin_ia32_reduceps512_mask:
case X86::BI__builtin_ia32_prold512_mask:
case X86::BI__builtin_ia32_prolq512_mask:
case X86::BI__builtin_ia32_prold128_mask:
case X86::BI__builtin_ia32_prold256_mask:
case X86::BI__builtin_ia32_prolq128_mask:
case X86::BI__builtin_ia32_prolq256_mask:
case X86::BI__builtin_ia32_prord128_mask:
case X86::BI__builtin_ia32_prord256_mask:
case X86::BI__builtin_ia32_prorq128_mask:
case X86::BI__builtin_ia32_prorq256_mask:
case X86::BI__builtin_ia32_fpclasspd128_mask:
case X86::BI__builtin_ia32_fpclasspd256_mask:
case X86::BI__builtin_ia32_fpclassps128_mask:
case X86::BI__builtin_ia32_fpclassps256_mask:
case X86::BI__builtin_ia32_fpclassps512_mask:
case X86::BI__builtin_ia32_fpclasspd512_mask:
case X86::BI__builtin_ia32_fpclasssd_mask:
case X86::BI__builtin_ia32_fpclassss_mask:
i = 1; l = 0; u = 255;
break;
case X86::BI__builtin_ia32_palignr:
case X86::BI__builtin_ia32_insertps128:
case X86::BI__builtin_ia32_dpps:
case X86::BI__builtin_ia32_dppd:
case X86::BI__builtin_ia32_dpps256:
case X86::BI__builtin_ia32_mpsadbw128:
case X86::BI__builtin_ia32_mpsadbw256:
case X86::BI__builtin_ia32_pcmpistrm128:
case X86::BI__builtin_ia32_pcmpistri128:
case X86::BI__builtin_ia32_pcmpistria128:
case X86::BI__builtin_ia32_pcmpistric128:
case X86::BI__builtin_ia32_pcmpistrio128:
case X86::BI__builtin_ia32_pcmpistris128:
case X86::BI__builtin_ia32_pcmpistriz128:
case X86::BI__builtin_ia32_pclmulqdq128:
case X86::BI__builtin_ia32_vperm2f128_pd256:
case X86::BI__builtin_ia32_vperm2f128_ps256:
case X86::BI__builtin_ia32_vperm2f128_si256:
case X86::BI__builtin_ia32_permti256:
i = 2; l = -128; u = 255;
break;
case X86::BI__builtin_ia32_palignr128:
case X86::BI__builtin_ia32_palignr256:
case X86::BI__builtin_ia32_palignr512_mask:
case X86::BI__builtin_ia32_vcomisd:
case X86::BI__builtin_ia32_vcomiss:
case X86::BI__builtin_ia32_shuf_f32x4_mask:
case X86::BI__builtin_ia32_shuf_f64x2_mask:
case X86::BI__builtin_ia32_shuf_i32x4_mask:
case X86::BI__builtin_ia32_shuf_i64x2_mask:
case X86::BI__builtin_ia32_dbpsadbw128_mask:
case X86::BI__builtin_ia32_dbpsadbw256_mask:
case X86::BI__builtin_ia32_dbpsadbw512_mask:
i = 2; l = 0; u = 255;
break;
case X86::BI__builtin_ia32_fixupimmpd512_mask:
case X86::BI__builtin_ia32_fixupimmpd512_maskz:
case X86::BI__builtin_ia32_fixupimmps512_mask:
case X86::BI__builtin_ia32_fixupimmps512_maskz:
case X86::BI__builtin_ia32_fixupimmsd_mask:
case X86::BI__builtin_ia32_fixupimmsd_maskz:
case X86::BI__builtin_ia32_fixupimmss_mask:
case X86::BI__builtin_ia32_fixupimmss_maskz:
case X86::BI__builtin_ia32_fixupimmpd128_mask:
case X86::BI__builtin_ia32_fixupimmpd128_maskz:
case X86::BI__builtin_ia32_fixupimmpd256_mask:
case X86::BI__builtin_ia32_fixupimmpd256_maskz:
case X86::BI__builtin_ia32_fixupimmps128_mask:
case X86::BI__builtin_ia32_fixupimmps128_maskz:
case X86::BI__builtin_ia32_fixupimmps256_mask:
case X86::BI__builtin_ia32_fixupimmps256_maskz:
case X86::BI__builtin_ia32_pternlogd512_mask:
case X86::BI__builtin_ia32_pternlogd512_maskz:
case X86::BI__builtin_ia32_pternlogq512_mask:
case X86::BI__builtin_ia32_pternlogq512_maskz:
case X86::BI__builtin_ia32_pternlogd128_mask:
case X86::BI__builtin_ia32_pternlogd128_maskz:
case X86::BI__builtin_ia32_pternlogd256_mask:
case X86::BI__builtin_ia32_pternlogd256_maskz:
case X86::BI__builtin_ia32_pternlogq128_mask:
case X86::BI__builtin_ia32_pternlogq128_maskz:
case X86::BI__builtin_ia32_pternlogq256_mask:
case X86::BI__builtin_ia32_pternlogq256_maskz:
i = 3; l = 0; u = 255;
break;
case X86::BI__builtin_ia32_gatherpfdpd:
case X86::BI__builtin_ia32_gatherpfdps:
case X86::BI__builtin_ia32_gatherpfqpd:
case X86::BI__builtin_ia32_gatherpfqps:
case X86::BI__builtin_ia32_scatterpfdpd:
case X86::BI__builtin_ia32_scatterpfdps:
case X86::BI__builtin_ia32_scatterpfqpd:
case X86::BI__builtin_ia32_scatterpfqps:
i = 4; l = 2; u = 3;
break;
case X86::BI__builtin_ia32_pcmpestrm128:
case X86::BI__builtin_ia32_pcmpestri128:
case X86::BI__builtin_ia32_pcmpestria128:
case X86::BI__builtin_ia32_pcmpestric128:
case X86::BI__builtin_ia32_pcmpestrio128:
case X86::BI__builtin_ia32_pcmpestris128:
case X86::BI__builtin_ia32_pcmpestriz128:
i = 4; l = -128; u = 255;
break;
case X86::BI__builtin_ia32_rndscalesd_round_mask:
case X86::BI__builtin_ia32_rndscaless_round_mask:
i = 4; l = 0; u = 255;
break;
}
return SemaBuiltinConstantArgRange(TheCall, i, l, u);
}
/// Given a FunctionDecl's FormatAttr, attempts to populate the FomatStringInfo
/// parameter with the FormatAttr's correct format_idx and firstDataArg.
/// Returns true when the format fits the function and the FormatStringInfo has
/// been populated.
bool Sema::getFormatStringInfo(const FormatAttr *Format, bool IsCXXMember,
FormatStringInfo *FSI) {
FSI->HasVAListArg = Format->getFirstArg() == 0;
FSI->FormatIdx = Format->getFormatIdx() - 1;
FSI->FirstDataArg = FSI->HasVAListArg ? 0 : Format->getFirstArg() - 1;
// The way the format attribute works in GCC, the implicit this argument
// of member functions is counted. However, it doesn't appear in our own
// lists, so decrement format_idx in that case.
if (IsCXXMember) {
if(FSI->FormatIdx == 0)
return false;
--FSI->FormatIdx;
if (FSI->FirstDataArg != 0)
--FSI->FirstDataArg;
}
return true;
}
/// Checks if a the given expression evaluates to null.
///
/// \brief Returns true if the value evaluates to null.
static bool CheckNonNullExpr(Sema &S, const Expr *Expr) {
// If the expression has non-null type, it doesn't evaluate to null.
if (auto nullability
= Expr->IgnoreImplicit()->getType()->getNullability(S.Context)) {
if (*nullability == NullabilityKind::NonNull)
return false;
}
// As a special case, transparent unions initialized with zero are
// considered null for the purposes of the nonnull attribute.
if (const RecordType *UT = Expr->getType()->getAsUnionType()) {
if (UT->getDecl()->hasAttr<TransparentUnionAttr>())
if (const CompoundLiteralExpr *CLE =
dyn_cast<CompoundLiteralExpr>(Expr))
if (const InitListExpr *ILE =
dyn_cast<InitListExpr>(CLE->getInitializer()))
Expr = ILE->getInit(0);
}
bool Result;
return (!Expr->isValueDependent() &&
Expr->EvaluateAsBooleanCondition(Result, S.Context) &&
!Result);
}
static void CheckNonNullArgument(Sema &S,
const Expr *ArgExpr,
SourceLocation CallSiteLoc) {
if (CheckNonNullExpr(S, ArgExpr))
S.DiagRuntimeBehavior(CallSiteLoc, ArgExpr,
S.PDiag(diag::warn_null_arg) << ArgExpr->getSourceRange());
}
bool Sema::GetFormatNSStringIdx(const FormatAttr *Format, unsigned &Idx) {
FormatStringInfo FSI;
if ((GetFormatStringType(Format) == FST_NSString) &&
getFormatStringInfo(Format, false, &FSI)) {
Idx = FSI.FormatIdx;
return true;
}
return false;
}
/// \brief Diagnose use of %s directive in an NSString which is being passed
/// as formatting string to formatting method.
static void
DiagnoseCStringFormatDirectiveInCFAPI(Sema &S,
const NamedDecl *FDecl,
Expr **Args,
unsigned NumArgs) {
unsigned Idx = 0;
bool Format = false;
ObjCStringFormatFamily SFFamily = FDecl->getObjCFStringFormattingFamily();
if (SFFamily == ObjCStringFormatFamily::SFF_CFString) {
Idx = 2;
Format = true;
}
else
for (const auto *I : FDecl->specific_attrs<FormatAttr>()) {
if (S.GetFormatNSStringIdx(I, Idx)) {
Format = true;
break;
}
}
if (!Format || NumArgs <= Idx)
return;
const Expr *FormatExpr = Args[Idx];
if (const CStyleCastExpr *CSCE = dyn_cast<CStyleCastExpr>(FormatExpr))
FormatExpr = CSCE->getSubExpr();
const StringLiteral *FormatString;
if (const ObjCStringLiteral *OSL =
dyn_cast<ObjCStringLiteral>(FormatExpr->IgnoreParenImpCasts()))
FormatString = OSL->getString();
else
FormatString = dyn_cast<StringLiteral>(FormatExpr->IgnoreParenImpCasts());
if (!FormatString)
return;
if (S.FormatStringHasSArg(FormatString)) {
S.Diag(FormatExpr->getExprLoc(), diag::warn_objc_cdirective_format_string)
<< "%s" << 1 << 1;
S.Diag(FDecl->getLocation(), diag::note_entity_declared_at)
<< FDecl->getDeclName();
}
}
/// Determine whether the given type has a non-null nullability annotation.
static bool isNonNullType(ASTContext &ctx, QualType type) {
if (auto nullability = type->getNullability(ctx))
return *nullability == NullabilityKind::NonNull;
return false;
}
static void CheckNonNullArguments(Sema &S,
const NamedDecl *FDecl,
const FunctionProtoType *Proto,
ArrayRef<const Expr *> Args,
SourceLocation CallSiteLoc) {
assert((FDecl || Proto) && "Need a function declaration or prototype");
// Check the attributes attached to the method/function itself.
llvm::SmallBitVector NonNullArgs;
if (FDecl) {
// Handle the nonnull attribute on the function/method declaration itself.
for (const auto *NonNull : FDecl->specific_attrs<NonNullAttr>()) {
if (!NonNull->args_size()) {
// Easy case: all pointer arguments are nonnull.
for (const auto *Arg : Args)
if (S.isValidPointerAttrType(Arg->getType()))
CheckNonNullArgument(S, Arg, CallSiteLoc);
return;
}
for (unsigned Val : NonNull->args()) {
if (Val >= Args.size())
continue;
if (NonNullArgs.empty())
NonNullArgs.resize(Args.size());
NonNullArgs.set(Val);
}
}
}
if (FDecl && (isa<FunctionDecl>(FDecl) || isa<ObjCMethodDecl>(FDecl))) {
// Handle the nonnull attribute on the parameters of the
// function/method.
ArrayRef<ParmVarDecl*> parms;
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(FDecl))
parms = FD->parameters();
else
parms = cast<ObjCMethodDecl>(FDecl)->parameters();
unsigned ParamIndex = 0;
for (ArrayRef<ParmVarDecl*>::iterator I = parms.begin(), E = parms.end();
I != E; ++I, ++ParamIndex) {
const ParmVarDecl *PVD = *I;
if (PVD->hasAttr<NonNullAttr>() ||
isNonNullType(S.Context, PVD->getType())) {
if (NonNullArgs.empty())
NonNullArgs.resize(Args.size());
NonNullArgs.set(ParamIndex);
}
}
} else {
// If we have a non-function, non-method declaration but no
// function prototype, try to dig out the function prototype.
if (!Proto) {
if (const ValueDecl *VD = dyn_cast<ValueDecl>(FDecl)) {
QualType type = VD->getType().getNonReferenceType();
if (auto pointerType = type->getAs<PointerType>())
type = pointerType->getPointeeType();
else if (auto blockType = type->getAs<BlockPointerType>())
type = blockType->getPointeeType();
// FIXME: data member pointers?
// Dig out the function prototype, if there is one.
Proto = type->getAs<FunctionProtoType>();
}
}
// Fill in non-null argument information from the nullability
// information on the parameter types (if we have them).
if (Proto) {
unsigned Index = 0;
for (auto paramType : Proto->getParamTypes()) {
if (isNonNullType(S.Context, paramType)) {
if (NonNullArgs.empty())
NonNullArgs.resize(Args.size());
NonNullArgs.set(Index);
}
++Index;
}
}
}
// Check for non-null arguments.
for (unsigned ArgIndex = 0, ArgIndexEnd = NonNullArgs.size();
ArgIndex != ArgIndexEnd; ++ArgIndex) {
if (NonNullArgs[ArgIndex])
CheckNonNullArgument(S, Args[ArgIndex], CallSiteLoc);
}
}
/// Handles the checks for format strings, non-POD arguments to vararg
/// functions, NULL arguments passed to non-NULL parameters, and diagnose_if
/// attributes.
void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto,
const Expr *ThisArg, ArrayRef<const Expr *> Args,
bool IsMemberFunction, SourceLocation Loc,
SourceRange Range, VariadicCallType CallType) {
// FIXME: We should check as much as we can in the template definition.
if (CurContext->isDependentContext())
return;
// Printf and scanf checking.
llvm::SmallBitVector CheckedVarArgs;
if (FDecl) {
for (const auto *I : FDecl->specific_attrs<FormatAttr>()) {
// Only create vector if there are format attributes.
CheckedVarArgs.resize(Args.size());
CheckFormatArguments(I, Args, IsMemberFunction, CallType, Loc, Range,
CheckedVarArgs);
}
}
// Refuse POD arguments that weren't caught by the format string
// checks above.
auto *FD = dyn_cast_or_null<FunctionDecl>(FDecl);
if (CallType != VariadicDoesNotApply &&
(!FD || FD->getBuiltinID() != Builtin::BI__noop)) {
unsigned NumParams = Proto ? Proto->getNumParams()
: FDecl && isa<FunctionDecl>(FDecl)
? cast<FunctionDecl>(FDecl)->getNumParams()
: FDecl && isa<ObjCMethodDecl>(FDecl)
? cast<ObjCMethodDecl>(FDecl)->param_size()
: 0;
for (unsigned ArgIdx = NumParams; ArgIdx < Args.size(); ++ArgIdx) {
// Args[ArgIdx] can be null in malformed code.
if (const Expr *Arg = Args[ArgIdx]) {
if (CheckedVarArgs.empty() || !CheckedVarArgs[ArgIdx])
checkVariadicArgument(Arg, CallType);
}
}
}
if (FDecl || Proto) {
CheckNonNullArguments(*this, FDecl, Proto, Args, Loc);
// Type safety checking.
if (FDecl) {
for (const auto *I : FDecl->specific_attrs<ArgumentWithTypeTagAttr>())
CheckArgumentWithTypeTag(I, Args.data());
}
}
if (FD)
diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc);
}
/// CheckConstructorCall - Check a constructor call for correctness and safety
/// properties not enforced by the C type system.
void Sema::CheckConstructorCall(FunctionDecl *FDecl,
ArrayRef<const Expr *> Args,
const FunctionProtoType *Proto,
SourceLocation Loc) {
VariadicCallType CallType =
Proto->isVariadic() ? VariadicConstructor : VariadicDoesNotApply;
checkCall(FDecl, Proto, /*ThisArg=*/nullptr, Args, /*IsMemberFunction=*/true,
Loc, SourceRange(), CallType);
}
/// CheckFunctionCall - Check a direct function call for various correctness
/// and safety properties not strictly enforced by the C type system.
bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall,
const FunctionProtoType *Proto) {
bool IsMemberOperatorCall = isa<CXXOperatorCallExpr>(TheCall) &&
isa<CXXMethodDecl>(FDecl);
bool IsMemberFunction = isa<CXXMemberCallExpr>(TheCall) ||
IsMemberOperatorCall;
VariadicCallType CallType = getVariadicCallType(FDecl, Proto,
TheCall->getCallee());
Expr** Args = TheCall->getArgs();
unsigned NumArgs = TheCall->getNumArgs();
Expr *ImplicitThis = nullptr;
if (IsMemberOperatorCall) {
// If this is a call to a member operator, hide the first argument
// from checkCall.
// FIXME: Our choice of AST representation here is less than ideal.
ImplicitThis = Args[0];
++Args;
--NumArgs;
} else if (IsMemberFunction)
ImplicitThis =
cast<CXXMemberCallExpr>(TheCall)->getImplicitObjectArgument();
checkCall(FDecl, Proto, ImplicitThis, llvm::makeArrayRef(Args, NumArgs),
IsMemberFunction, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
IdentifierInfo *FnInfo = FDecl->getIdentifier();
// None of the checks below are needed for functions that don't have
// simple names (e.g., C++ conversion functions).
if (!FnInfo)
return false;
CheckAbsoluteValueFunction(TheCall, FDecl);
CheckMaxUnsignedZero(TheCall, FDecl);
if (getLangOpts().ObjC1)
DiagnoseCStringFormatDirectiveInCFAPI(*this, FDecl, Args, NumArgs);
unsigned CMId = FDecl->getMemoryFunctionKind();
if (CMId == 0)
return false;
// Handle memory setting and copying functions.
if (CMId == Builtin::BIstrlcpy || CMId == Builtin::BIstrlcat)
CheckStrlcpycatArguments(TheCall, FnInfo);
else if (CMId == Builtin::BIstrncat)
CheckStrncatArguments(TheCall, FnInfo);
else
CheckMemaccessArguments(TheCall, CMId, FnInfo);
return false;
}
bool Sema::CheckObjCMethodCall(ObjCMethodDecl *Method, SourceLocation lbrac,
ArrayRef<const Expr *> Args) {
VariadicCallType CallType =
Method->isVariadic() ? VariadicMethod : VariadicDoesNotApply;
checkCall(Method, nullptr, /*ThisArg=*/nullptr, Args,
/*IsMemberFunction=*/false, lbrac, Method->getSourceRange(),
CallType);
return false;
}
bool Sema::CheckPointerCall(NamedDecl *NDecl, CallExpr *TheCall,
const FunctionProtoType *Proto) {
QualType Ty;
if (const auto *V = dyn_cast<VarDecl>(NDecl))
Ty = V->getType().getNonReferenceType();
else if (const auto *F = dyn_cast<FieldDecl>(NDecl))
Ty = F->getType().getNonReferenceType();
else
return false;
if (!Ty->isBlockPointerType() && !Ty->isFunctionPointerType() &&
!Ty->isFunctionProtoType())
return false;
VariadicCallType CallType;
if (!Proto || !Proto->isVariadic()) {
CallType = VariadicDoesNotApply;
} else if (Ty->isBlockPointerType()) {
CallType = VariadicBlock;
} else { // Ty->isFunctionPointerType()
CallType = VariadicFunction;
}
checkCall(NDecl, Proto, /*ThisArg=*/nullptr,
llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
/*IsMemberFunction=*/false, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
return false;
}
/// Checks function calls when a FunctionDecl or a NamedDecl is not available,
/// such as function pointers returned from functions.
bool Sema::CheckOtherCall(CallExpr *TheCall, const FunctionProtoType *Proto) {
VariadicCallType CallType = getVariadicCallType(/*FDecl=*/nullptr, Proto,
TheCall->getCallee());
checkCall(/*FDecl=*/nullptr, Proto, /*ThisArg=*/nullptr,
llvm::makeArrayRef(TheCall->getArgs(), TheCall->getNumArgs()),
/*IsMemberFunction=*/false, TheCall->getRParenLoc(),
TheCall->getCallee()->getSourceRange(), CallType);
return false;
}
static bool isValidOrderingForOp(int64_t Ordering, AtomicExpr::AtomicOp Op) {
if (!llvm::isValidAtomicOrderingCABI(Ordering))
return false;
auto OrderingCABI = (llvm::AtomicOrderingCABI)Ordering;
switch (Op) {
case AtomicExpr::AO__c11_atomic_init:
llvm_unreachable("There is no ordering argument for an init");
case AtomicExpr::AO__c11_atomic_load:
case AtomicExpr::AO__atomic_load_n:
case AtomicExpr::AO__atomic_load:
return OrderingCABI != llvm::AtomicOrderingCABI::release &&
OrderingCABI != llvm::AtomicOrderingCABI::acq_rel;
case AtomicExpr::AO__c11_atomic_store:
case AtomicExpr::AO__atomic_store:
case AtomicExpr::AO__atomic_store_n:
return OrderingCABI != llvm::AtomicOrderingCABI::consume &&
OrderingCABI != llvm::AtomicOrderingCABI::acquire &&
OrderingCABI != llvm::AtomicOrderingCABI::acq_rel;
default:
return true;
}
}
ExprResult Sema::SemaAtomicOpsOverloaded(ExprResult TheCallResult,
AtomicExpr::AtomicOp Op) {
CallExpr *TheCall = cast<CallExpr>(TheCallResult.get());
DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
// All these operations take one of the following forms:
enum {
// C __c11_atomic_init(A *, C)
Init,
// C __c11_atomic_load(A *, int)
Load,
// void __atomic_load(A *, CP, int)
LoadCopy,
// void __atomic_store(A *, CP, int)
Copy,
// C __c11_atomic_add(A *, M, int)
Arithmetic,
// C __atomic_exchange_n(A *, CP, int)
Xchg,
// void __atomic_exchange(A *, C *, CP, int)
GNUXchg,
// bool __c11_atomic_compare_exchange_strong(A *, C *, CP, int, int)
C11CmpXchg,
// bool __atomic_compare_exchange(A *, C *, CP, bool, int, int)
GNUCmpXchg
} Form = Init;
const unsigned NumArgs[] = { 2, 2, 3, 3, 3, 3, 4, 5, 6 };
const unsigned NumVals[] = { 1, 0, 1, 1, 1, 1, 2, 2, 3 };
// where:
// C is an appropriate type,
// A is volatile _Atomic(C) for __c11 builtins and is C for GNU builtins,
// CP is C for __c11 builtins and GNU _n builtins and is C * otherwise,
// M is C if C is an integer, and ptrdiff_t if C is a pointer, and
// the int parameters are for orderings.
static_assert(AtomicExpr::AO__c11_atomic_init == 0 &&
AtomicExpr::AO__c11_atomic_fetch_xor + 1 ==
AtomicExpr::AO__atomic_load,
"need to update code for modified C11 atomics");
bool IsC11 = Op >= AtomicExpr::AO__c11_atomic_init &&
Op <= AtomicExpr::AO__c11_atomic_fetch_xor;
bool IsN = Op == AtomicExpr::AO__atomic_load_n ||
Op == AtomicExpr::AO__atomic_store_n ||
Op == AtomicExpr::AO__atomic_exchange_n ||
Op == AtomicExpr::AO__atomic_compare_exchange_n;
bool IsAddSub = false;
switch (Op) {
case AtomicExpr::AO__c11_atomic_init:
Form = Init;
break;
case AtomicExpr::AO__c11_atomic_load:
case AtomicExpr::AO__atomic_load_n:
Form = Load;
break;
case AtomicExpr::AO__atomic_load:
Form = LoadCopy;
break;
case AtomicExpr::AO__c11_atomic_store:
case AtomicExpr::AO__atomic_store:
case AtomicExpr::AO__atomic_store_n:
Form = Copy;
break;
case AtomicExpr::AO__c11_atomic_fetch_add:
case AtomicExpr::AO__c11_atomic_fetch_sub:
case AtomicExpr::AO__atomic_fetch_add:
case AtomicExpr::AO__atomic_fetch_sub:
case AtomicExpr::AO__atomic_add_fetch:
case AtomicExpr::AO__atomic_sub_fetch:
IsAddSub = true;
// Fall through.
case AtomicExpr::AO__c11_atomic_fetch_and:
case AtomicExpr::AO__c11_atomic_fetch_or:
case AtomicExpr::AO__c11_atomic_fetch_xor:
case AtomicExpr::AO__atomic_fetch_and:
case AtomicExpr::AO__atomic_fetch_or:
case AtomicExpr::AO__atomic_fetch_xor:
case AtomicExpr::AO__atomic_fetch_nand:
case AtomicExpr::AO__atomic_and_fetch:
case AtomicExpr::AO__atomic_or_fetch:
case AtomicExpr::AO__atomic_xor_fetch:
case AtomicExpr::AO__atomic_nand_fetch:
Form = Arithmetic;
break;
case AtomicExpr::AO__c11_atomic_exchange:
case AtomicExpr::AO__atomic_exchange_n:
Form = Xchg;
break;
case AtomicExpr::AO__atomic_exchange:
Form = GNUXchg;
break;
case AtomicExpr::AO__c11_atomic_compare_exchange_strong:
case AtomicExpr::AO__c11_atomic_compare_exchange_weak:
Form = C11CmpXchg;
break;
case AtomicExpr::AO__atomic_compare_exchange:
case AtomicExpr::AO__atomic_compare_exchange_n:
Form = GNUCmpXchg;
break;
}
// Check we have the right number of arguments.
if (TheCall->getNumArgs() < NumArgs[Form]) {
Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
<< 0 << NumArgs[Form] << TheCall->getNumArgs()
<< TheCall->getCallee()->getSourceRange();
return ExprError();
} else if (TheCall->getNumArgs() > NumArgs[Form]) {
Diag(TheCall->getArg(NumArgs[Form])->getLocStart(),
diag::err_typecheck_call_too_many_args)
<< 0 << NumArgs[Form] << TheCall->getNumArgs()
<< TheCall->getCallee()->getSourceRange();
return ExprError();
}
// Inspect the first argument of the atomic operation.
Expr *Ptr = TheCall->getArg(0);
ExprResult ConvertedPtr = DefaultFunctionArrayLvalueConversion(Ptr);
if (ConvertedPtr.isInvalid())
return ExprError();
Ptr = ConvertedPtr.get();
const PointerType *pointerType = Ptr->getType()->getAs<PointerType>();
if (!pointerType) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
// For a __c11 builtin, this should be a pointer to an _Atomic type.
QualType AtomTy = pointerType->getPointeeType(); // 'A'
QualType ValType = AtomTy; // 'C'
if (IsC11) {
if (!AtomTy->isAtomicType()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_atomic)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
if (AtomTy.isConstQualified()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_non_const_atomic)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
ValType = AtomTy->getAs<AtomicType>()->getValueType();
} else if (Form != Load && Form != LoadCopy) {
if (ValType.isConstQualified()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_non_const_pointer)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
}
// For an arithmetic operation, the implied arithmetic must be well-formed.
if (Form == Arithmetic) {
// gcc does not enforce these rules for GNU atomics, but we do so for sanity.
if (IsAddSub && !ValType->isIntegerType() && !ValType->isPointerType()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_atomic_int_or_ptr)
<< IsC11 << Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
if (!IsAddSub && !ValType->isIntegerType()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_bitwise_needs_atomic_int)
<< IsC11 << Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
if (IsC11 && ValType->isPointerType() &&
RequireCompleteType(Ptr->getLocStart(), ValType->getPointeeType(),
diag::err_incomplete_type)) {
return ExprError();
}
} else if (IsN && !ValType->isIntegerType() && !ValType->isPointerType()) {
// For __atomic_*_n operations, the value type must be a scalar integral or
// pointer type which is 1, 2, 4, 8 or 16 bytes in length.
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_atomic_int_or_ptr)
<< IsC11 << Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) &&
!AtomTy->isScalarType()) {
// For GNU atomics, require a trivially-copyable type. This is not part of
// the GNU atomics specification, but we enforce it for sanity.
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_trivial_copy)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();
}
switch (ValType.getObjCLifetime()) {
case Qualifiers::OCL_None:
case Qualifiers::OCL_ExplicitNone:
// okay
break;
case Qualifiers::OCL_Weak:
case Qualifiers::OCL_Strong:
case Qualifiers::OCL_Autoreleasing:
// FIXME: Can this happen? By this point, ValType should be known
// to be trivially copyable.
Diag(DRE->getLocStart(), diag::err_arc_atomic_ownership)
<< ValType << Ptr->getSourceRange();
return ExprError();
}
// atomic_fetch_or takes a pointer to a volatile 'A'. We shouldn't let the
// volatile-ness of the pointee-type inject itself into the result or the
// other operands. Similarly atomic_load can take a pointer to a const 'A'.
ValType.removeLocalVolatile();
ValType.removeLocalConst();
QualType ResultType = ValType;
if (Form == Copy || Form == LoadCopy || Form == GNUXchg || Form == Init)
ResultType = Context.VoidTy;
else if (Form == C11CmpXchg || Form == GNUCmpXchg)
ResultType = Context.BoolTy;
// The type of a parameter passed 'by value'. In the GNU atomics, such
// arguments are actually passed as pointers.
QualType ByValType = ValType; // 'CP'
if (!IsC11 && !IsN)
ByValType = Ptr->getType();
// The first argument --- the pointer --- has a fixed type; we
// deduce the types of the rest of the arguments accordingly. Walk
// the remaining arguments, converting them to the deduced value type.
for (unsigned i = 1; i != NumArgs[Form]; ++i) {
QualType Ty;
if (i < NumVals[Form] + 1) {
switch (i) {
case 1:
// The second argument is the non-atomic operand. For arithmetic, this
// is always passed by value, and for a compare_exchange it is always
// passed by address. For the rest, GNU uses by-address and C11 uses
// by-value.
assert(Form != Load);
if (Form == Init || (Form == Arithmetic && ValType->isIntegerType()))
Ty = ValType;
else if (Form == Copy || Form == Xchg)
Ty = ByValType;
else if (Form == Arithmetic)
Ty = Context.getPointerDiffType();
else {
Expr *ValArg = TheCall->getArg(i);
// Treat this argument as _Nonnull as we want to show a warning if
// NULL is passed into it.
CheckNonNullArgument(*this, ValArg, DRE->getLocStart());
unsigned AS = 0;
// Keep address space of non-atomic pointer type.
if (const PointerType *PtrTy =
ValArg->getType()->getAs<PointerType>()) {
AS = PtrTy->getPointeeType().getAddressSpace();
}
Ty = Context.getPointerType(
Context.getAddrSpaceQualType(ValType.getUnqualifiedType(), AS));
}
break;
case 2:
// The third argument to compare_exchange / GNU exchange is a
// (pointer to a) desired value.
Ty = ByValType;
break;
case 3:
// The fourth argument to GNU compare_exchange is a 'weak' flag.
Ty = Context.BoolTy;
break;
}
} else {
// The order(s) are always converted to int.
Ty = Context.IntTy;
}
InitializedEntity Entity =
InitializedEntity::InitializeParameter(Context, Ty, false);
ExprResult Arg = TheCall->getArg(i);
Arg = PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid())
return true;
TheCall->setArg(i, Arg.get());
}
// Permute the arguments into a 'consistent' order.
SmallVector<Expr*, 5> SubExprs;
SubExprs.push_back(Ptr);
switch (Form) {
case Init:
// Note, AtomicExpr::getVal1() has a special case for this atomic.
SubExprs.push_back(TheCall->getArg(1)); // Val1
break;
case Load:
SubExprs.push_back(TheCall->getArg(1)); // Order
break;
case LoadCopy:
case Copy:
case Arithmetic:
case Xchg:
SubExprs.push_back(TheCall->getArg(2)); // Order
SubExprs.push_back(TheCall->getArg(1)); // Val1
break;
case GNUXchg:
// Note, AtomicExpr::getVal2() has a special case for this atomic.
SubExprs.push_back(TheCall->getArg(3)); // Order
SubExprs.push_back(TheCall->getArg(1)); // Val1
SubExprs.push_back(TheCall->getArg(2)); // Val2
break;
case C11CmpXchg:
SubExprs.push_back(TheCall->getArg(3)); // Order
SubExprs.push_back(TheCall->getArg(1)); // Val1
SubExprs.push_back(TheCall->getArg(4)); // OrderFail
SubExprs.push_back(TheCall->getArg(2)); // Val2
break;
case GNUCmpXchg:
SubExprs.push_back(TheCall->getArg(4)); // Order
SubExprs.push_back(TheCall->getArg(1)); // Val1
SubExprs.push_back(TheCall->getArg(5)); // OrderFail
SubExprs.push_back(TheCall->getArg(2)); // Val2
SubExprs.push_back(TheCall->getArg(3)); // Weak
break;
}
if (SubExprs.size() >= 2 && Form != Init) {
llvm::APSInt Result(32);
if (SubExprs[1]->isIntegerConstantExpr(Result, Context) &&
!isValidOrderingForOp(Result.getSExtValue(), Op))
Diag(SubExprs[1]->getLocStart(),
diag::warn_atomic_op_has_invalid_memory_order)
<< SubExprs[1]->getSourceRange();
}
AtomicExpr *AE = new (Context) AtomicExpr(TheCall->getCallee()->getLocStart(),
SubExprs, ResultType, Op,
TheCall->getRParenLoc());
if ((Op == AtomicExpr::AO__c11_atomic_load ||
(Op == AtomicExpr::AO__c11_atomic_store)) &&
Context.AtomicUsesUnsupportedLibcall(AE))
Diag(AE->getLocStart(), diag::err_atomic_load_store_uses_lib) <<
((Op == AtomicExpr::AO__c11_atomic_load) ? 0 : 1);
return AE;
}
/// checkBuiltinArgument - Given a call to a builtin function, perform
/// normal type-checking on the given argument, updating the call in
/// place. This is useful when a builtin function requires custom
/// type-checking for some of its arguments but not necessarily all of
/// them.
///
/// Returns true on error.
static bool checkBuiltinArgument(Sema &S, CallExpr *E, unsigned ArgIndex) {
FunctionDecl *Fn = E->getDirectCallee();
assert(Fn && "builtin call without direct callee!");
ParmVarDecl *Param = Fn->getParamDecl(ArgIndex);
InitializedEntity Entity =
InitializedEntity::InitializeParameter(S.Context, Param);
ExprResult Arg = E->getArg(0);
Arg = S.PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid())
return true;
E->setArg(ArgIndex, Arg.get());
return false;
}
/// SemaBuiltinAtomicOverloaded - We have a call to a function like
/// __sync_fetch_and_add, which is an overloaded function based on the pointer
/// type of its first argument. The main ActOnCallExpr routines have already
/// promoted the types of arguments because all of these calls are prototyped as
/// void(...).
///
/// This function goes through and does final semantic checking for these
/// builtins,
ExprResult
Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
CallExpr *TheCall = (CallExpr *)TheCallResult.get();
DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
// Ensure that we have at least one argument to do type inference from.
if (TheCall->getNumArgs() < 1) {
Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least)
<< 0 << 1 << TheCall->getNumArgs()
<< TheCall->getCallee()->getSourceRange();
return ExprError();
}
// Inspect the first argument of the atomic builtin. This should always be
// a pointer type, whose element is an integral scalar or pointer type.
// Because it is a pointer type, we don't have to worry about any implicit
// casts here.
// FIXME: We don't allow floating point scalars as input.
Expr *FirstArg = TheCall->getArg(0);
ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg);
if (FirstArgResult.isInvalid())
return ExprError();
FirstArg = FirstArgResult.get();
TheCall->setArg(0, FirstArg);
const PointerType *pointerType = FirstArg->getType()->getAs<PointerType>();
if (!pointerType) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer)
<< FirstArg->getType() << FirstArg->getSourceRange();
return ExprError();
}
QualType ValType = pointerType->getPointeeType();
if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
!ValType->isBlockPointerType()) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer_intptr)
<< FirstArg->getType() << FirstArg->getSourceRange();
return ExprError();
}
switch (ValType.getObjCLifetime()) {
case Qualifiers::OCL_None:
case Qualifiers::OCL_ExplicitNone:
// okay
break;
case Qualifiers::OCL_Weak:
case Qualifiers::OCL_Strong:
case Qualifiers::OCL_Autoreleasing:
Diag(DRE->getLocStart(), diag::err_arc_atomic_ownership)
<< ValType << FirstArg->getSourceRange();
return ExprError();
}
// Strip any qualifiers off ValType.
ValType = ValType.getUnqualifiedType();
// The majority of builtins return a value, but a few have special return
// types, so allow them to override appropriately below.
QualType ResultType = ValType;
// We need to figure out which concrete builtin this maps onto. For example,
// __sync_fetch_and_add with a 2 byte object turns into
// __sync_fetch_and_add_2.
#define BUILTIN_ROW(x) \
{ Builtin::BI##x##_1, Builtin::BI##x##_2, Builtin::BI##x##_4, \
Builtin::BI##x##_8, Builtin::BI##x##_16 }
static const unsigned BuiltinIndices[][5] = {
BUILTIN_ROW(__sync_fetch_and_add),
BUILTIN_ROW(__sync_fetch_and_sub),
BUILTIN_ROW(__sync_fetch_and_or),
BUILTIN_ROW(__sync_fetch_and_and),
BUILTIN_ROW(__sync_fetch_and_xor),
BUILTIN_ROW(__sync_fetch_and_nand),
BUILTIN_ROW(__sync_add_and_fetch),
BUILTIN_ROW(__sync_sub_and_fetch),
BUILTIN_ROW(__sync_and_and_fetch),
BUILTIN_ROW(__sync_or_and_fetch),
BUILTIN_ROW(__sync_xor_and_fetch),
BUILTIN_ROW(__sync_nand_and_fetch),
BUILTIN_ROW(__sync_val_compare_and_swap),
BUILTIN_ROW(__sync_bool_compare_and_swap),
BUILTIN_ROW(__sync_lock_test_and_set),
BUILTIN_ROW(__sync_lock_release),
BUILTIN_ROW(__sync_swap)
};
#undef BUILTIN_ROW
// Determine the index of the size.
unsigned SizeIndex;
switch (Context.getTypeSizeInChars(ValType).getQuantity()) {
case 1: SizeIndex = 0; break;
case 2: SizeIndex = 1; break;
case 4: SizeIndex = 2; break;
case 8: SizeIndex = 3; break;
case 16: SizeIndex = 4; break;
default:
Diag(DRE->getLocStart(), diag::err_atomic_builtin_pointer_size)
<< FirstArg->getType() << FirstArg->getSourceRange();
return ExprError();
}
// Each of these builtins has one pointer argument, followed by some number of
// values (0, 1 or 2) followed by a potentially empty varags list of stuff
// that we ignore. Find out which row of BuiltinIndices to read from as well
// as the number of fixed args.
unsigned BuiltinID = FDecl->getBuiltinID();
unsigned BuiltinIndex, NumFixed = 1;
bool WarnAboutSemanticsChange = false;
switch (BuiltinID) {
default: llvm_unreachable("Unknown overloaded atomic builtin!");
case Builtin::BI__sync_fetch_and_add:
case Builtin::BI__sync_fetch_and_add_1:
case Builtin::BI__sync_fetch_and_add_2:
case Builtin::BI__sync_fetch_and_add_4:
case Builtin::BI__sync_fetch_and_add_8:
case Builtin::BI__sync_fetch_and_add_16:
BuiltinIndex = 0;
break;
case Builtin::BI__sync_fetch_and_sub:
case Builtin::BI__sync_fetch_and_sub_1:
case Builtin::BI__sync_fetch_and_sub_2:
case Builtin::BI__sync_fetch_and_sub_4:
case Builtin::BI__sync_fetch_and_sub_8:
case Builtin::BI__sync_fetch_and_sub_16:
BuiltinIndex = 1;
break;
case Builtin::BI__sync_fetch_and_or:
case Builtin::BI__sync_fetch_and_or_1:
case Builtin::BI__sync_fetch_and_or_2:
case Builtin::BI__sync_fetch_and_or_4:
case Builtin::BI__sync_fetch_and_or_8:
case Builtin::BI__sync_fetch_and_or_16:
BuiltinIndex = 2;
break;
case Builtin::BI__sync_fetch_and_and:
case Builtin::BI__sync_fetch_and_and_1:
case Builtin::BI__sync_fetch_and_and_2:
case Builtin::BI__sync_fetch_and_and_4:
case Builtin::BI__sync_fetch_and_and_8:
case Builtin::BI__sync_fetch_and_and_16:
BuiltinIndex = 3;
break;
case Builtin::BI__sync_fetch_and_xor:
case Builtin::BI__sync_fetch_and_xor_1:
case Builtin::BI__sync_fetch_and_xor_2:
case Builtin::BI__sync_fetch_and_xor_4:
case Builtin::BI__sync_fetch_and_xor_8:
case Builtin::BI__sync_fetch_and_xor_16:
BuiltinIndex = 4;
break;
case Builtin::BI__sync_fetch_and_nand:
case Builtin::BI__sync_fetch_and_nand_1:
case Builtin::BI__sync_fetch_and_nand_2:
case Builtin::BI__sync_fetch_and_nand_4:
case Builtin::BI__sync_fetch_and_nand_8:
case Builtin::BI__sync_fetch_and_nand_16:
BuiltinIndex = 5;
WarnAboutSemanticsChange = true;
break;
case Builtin::BI__sync_add_and_fetch:
case Builtin::BI__sync_add_and_fetch_1:
case Builtin::BI__sync_add_and_fetch_2:
case Builtin::BI__sync_add_and_fetch_4:
case Builtin::BI__sync_add_and_fetch_8:
case Builtin::BI__sync_add_and_fetch_16:
BuiltinIndex = 6;
break;
case Builtin::BI__sync_sub_and_fetch:
case Builtin::BI__sync_sub_and_fetch_1:
case Builtin::BI__sync_sub_and_fetch_2:
case Builtin::BI__sync_sub_and_fetch_4:
case Builtin::BI__sync_sub_and_fetch_8:
case Builtin::BI__sync_sub_and_fetch_16:
BuiltinIndex = 7;
break;
case Builtin::BI__sync_and_and_fetch:
case Builtin::BI__sync_and_and_fetch_1:
case Builtin::BI__sync_and_and_fetch_2:
case Builtin::BI__sync_and_and_fetch_4:
case Builtin::BI__sync_and_and_fetch_8:
case Builtin::BI__sync_and_and_fetch_16:
BuiltinIndex = 8;
break;
case Builtin::BI__sync_or_and_fetch:
case Builtin::BI__sync_or_and_fetch_1:
case Builtin::BI__sync_or_and_fetch_2:
case Builtin::BI__sync_or_and_fetch_4:
case Builtin::BI__sync_or_and_fetch_8:
case Builtin::BI__sync_or_and_fetch_16:
BuiltinIndex = 9;
break;
case Builtin::BI__sync_xor_and_fetch:
case Builtin::BI__sync_xor_and_fetch_1:
case Builtin::BI__sync_xor_and_fetch_2:
case Builtin::BI__sync_xor_and_fetch_4:
case Builtin::BI__sync_xor_and_fetch_8:
case Builtin::BI__sync_xor_and_fetch_16:
BuiltinIndex = 10;
break;
case Builtin::BI__sync_nand_and_fetch:
case Builtin::BI__sync_nand_and_fetch_1:
case Builtin::BI__sync_nand_and_fetch_2:
case Builtin::BI__sync_nand_and_fetch_4:
case Builtin::BI__sync_nand_and_fetch_8:
case Builtin::BI__sync_nand_and_fetch_16:
BuiltinIndex = 11;
WarnAboutSemanticsChange = true;
break;
case Builtin::BI__sync_val_compare_and_swap:
case Builtin::BI__sync_val_compare_and_swap_1:
case Builtin::BI__sync_val_compare_and_swap_2:
case Builtin::BI__sync_val_compare_and_swap_4:
case Builtin::BI__sync_val_compare_and_swap_8:
case Builtin::BI__sync_val_compare_and_swap_16:
BuiltinIndex = 12;
NumFixed = 2;
break;
case Builtin::BI__sync_bool_compare_and_swap:
case Builtin::BI__sync_bool_compare_and_swap_1:
case Builtin::BI__sync_bool_compare_and_swap_2:
case Builtin::BI__sync_bool_compare_and_swap_4:
case Builtin::BI__sync_bool_compare_and_swap_8:
case Builtin::BI__sync_bool_compare_and_swap_16:
BuiltinIndex = 13;
NumFixed = 2;
ResultType = Context.BoolTy;
break;
case Builtin::BI__sync_lock_test_and_set:
case Builtin::BI__sync_lock_test_and_set_1:
case Builtin::BI__sync_lock_test_and_set_2:
case Builtin::BI__sync_lock_test_and_set_4:
case Builtin::BI__sync_lock_test_and_set_8:
case Builtin::BI__sync_lock_test_and_set_16:
BuiltinIndex = 14;
break;
case Builtin::BI__sync_lock_release:
case Builtin::BI__sync_lock_release_1:
case Builtin::BI__sync_lock_release_2:
case Builtin::BI__sync_lock_release_4:
case Builtin::BI__sync_lock_release_8:
case Builtin::BI__sync_lock_release_16:
BuiltinIndex = 15;
NumFixed = 0;
ResultType = Context.VoidTy;
break;
case Builtin::BI__sync_swap:
case Builtin::BI__sync_swap_1:
case Builtin::BI__sync_swap_2:
case Builtin::BI__sync_swap_4:
case Builtin::BI__sync_swap_8:
case Builtin::BI__sync_swap_16:
BuiltinIndex = 16;
break;
}
// Now that we know how many fixed arguments we expect, first check that we
// have at least that many.
if (TheCall->getNumArgs() < 1+NumFixed) {
Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least)
<< 0 << 1+NumFixed << TheCall->getNumArgs()
<< TheCall->getCallee()->getSourceRange();
return ExprError();
}
if (WarnAboutSemanticsChange) {
Diag(TheCall->getLocEnd(), diag::warn_sync_fetch_and_nand_semantics_change)
<< TheCall->getCallee()->getSourceRange();
}
// Get the decl for the concrete builtin from this, we can tell what the
// concrete integer type we should convert to is.
unsigned NewBuiltinID = BuiltinIndices[BuiltinIndex][SizeIndex];
const char *NewBuiltinName = Context.BuiltinInfo.getName(NewBuiltinID);
FunctionDecl *NewBuiltinDecl;
if (NewBuiltinID == BuiltinID)
NewBuiltinDecl = FDecl;
else {
// Perform builtin lookup to avoid redeclaring it.
DeclarationName DN(&Context.Idents.get(NewBuiltinName));
LookupResult Res(*this, DN, DRE->getLocStart(), LookupOrdinaryName);
LookupName(Res, TUScope, /*AllowBuiltinCreation=*/true);
assert(Res.getFoundDecl());
NewBuiltinDecl = dyn_cast<FunctionDecl>(Res.getFoundDecl());
if (!NewBuiltinDecl)
return ExprError();
}
// The first argument --- the pointer --- has a fixed type; we
// deduce the types of the rest of the arguments accordingly. Walk
// the remaining arguments, converting them to the deduced value type.
for (unsigned i = 0; i != NumFixed; ++i) {
ExprResult Arg = TheCall->getArg(i+1);
// GCC does an implicit conversion to the pointer or integer ValType. This
// can fail in some cases (1i -> int**), check for this error case now.
// Initialize the argument.
InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
ValType, /*consume*/ false);
Arg = PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid())
return ExprError();
// Okay, we have something that *can* be converted to the right type. Check
// to see if there is a potentially weird extension going on here. This can
// happen when you do an atomic operation on something like an char* and
// pass in 42. The 42 gets converted to char. This is even more strange
// for things like 45.123 -> char, etc.
// FIXME: Do this check.
TheCall->setArg(i+1, Arg.get());
}
ASTContext& Context = this->getASTContext();
// Create a new DeclRefExpr to refer to the new decl.
DeclRefExpr* NewDRE = DeclRefExpr::Create(
Context,
DRE->getQualifierLoc(),
SourceLocation(),
NewBuiltinDecl,
/*enclosing*/ false,
DRE->getLocation(),
Context.BuiltinFnTy,
DRE->getValueKind());
// Set the callee in the CallExpr.
// FIXME: This loses syntactic information.
QualType CalleePtrTy = Context.getPointerType(NewBuiltinDecl->getType());
ExprResult PromotedCall = ImpCastExprToType(NewDRE, CalleePtrTy,
CK_BuiltinFnToFnPtr);
TheCall->setCallee(PromotedCall.get());
// Change the result type of the call to match the original value type. This
// is arbitrary, but the codegen for these builtins ins design to handle it
// gracefully.
TheCall->setType(ResultType);
return TheCallResult;
}
/// SemaBuiltinNontemporalOverloaded - We have a call to
/// __builtin_nontemporal_store or __builtin_nontemporal_load, which is an
/// overloaded function based on the pointer type of its last argument.
///
/// This function goes through and does final semantic checking for these
/// builtins.
ExprResult Sema::SemaBuiltinNontemporalOverloaded(ExprResult TheCallResult) {
CallExpr *TheCall = (CallExpr *)TheCallResult.get();
DeclRefExpr *DRE =
cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
unsigned BuiltinID = FDecl->getBuiltinID();
assert((BuiltinID == Builtin::BI__builtin_nontemporal_store ||
BuiltinID == Builtin::BI__builtin_nontemporal_load) &&
"Unexpected nontemporal load/store builtin!");
bool isStore = BuiltinID == Builtin::BI__builtin_nontemporal_store;
unsigned numArgs = isStore ? 2 : 1;
// Ensure that we have the proper number of arguments.
if (checkArgCount(*this, TheCall, numArgs))
return ExprError();
// Inspect the last argument of the nontemporal builtin. This should always
// be a pointer type, from which we imply the type of the memory access.
// Because it is a pointer type, we don't have to worry about any implicit
// casts here.
Expr *PointerArg = TheCall->getArg(numArgs - 1);
ExprResult PointerArgResult =
DefaultFunctionArrayLvalueConversion(PointerArg);
if (PointerArgResult.isInvalid())
return ExprError();
PointerArg = PointerArgResult.get();
TheCall->setArg(numArgs - 1, PointerArg);
const PointerType *pointerType = PointerArg->getType()->getAs<PointerType>();
if (!pointerType) {
Diag(DRE->getLocStart(), diag::err_nontemporal_builtin_must_be_pointer)
<< PointerArg->getType() << PointerArg->getSourceRange();
return ExprError();
}
QualType ValType = pointerType->getPointeeType();
// Strip any qualifiers off ValType.
ValType = ValType.getUnqualifiedType();
if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
!ValType->isBlockPointerType() && !ValType->isFloatingType() &&
!ValType->isVectorType()) {
Diag(DRE->getLocStart(),
diag::err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector)
<< PointerArg->getType() << PointerArg->getSourceRange();
return ExprError();
}
if (!isStore) {
TheCall->setType(ValType);
return TheCallResult;
}
ExprResult ValArg = TheCall->getArg(0);
InitializedEntity Entity = InitializedEntity::InitializeParameter(
Context, ValType, /*consume*/ false);
ValArg = PerformCopyInitialization(Entity, SourceLocation(), ValArg);
if (ValArg.isInvalid())
return ExprError();
TheCall->setArg(0, ValArg.get());
TheCall->setType(Context.VoidTy);
return TheCallResult;
}
/// CheckObjCString - Checks that the argument to the builtin
/// CFString constructor is correct
/// Note: It might also make sense to do the UTF-16 conversion here (would
/// simplify the backend).
bool Sema::CheckObjCString(Expr *Arg) {
Arg = Arg->IgnoreParenCasts();
StringLiteral *Literal = dyn_cast<StringLiteral>(Arg);
if (!Literal || !Literal->isAscii()) {
Diag(Arg->getLocStart(), diag::err_cfstring_literal_not_string_constant)
<< Arg->getSourceRange();
return true;
}
if (Literal->containsNonAsciiOrNull()) {
StringRef String = Literal->getString();
unsigned NumBytes = String.size();
SmallVector<llvm::UTF16, 128> ToBuf(NumBytes);
const llvm::UTF8 *FromPtr = (const llvm::UTF8 *)String.data();
llvm::UTF16 *ToPtr = &ToBuf[0];
llvm::ConversionResult Result =
llvm::ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, &ToPtr,
ToPtr + NumBytes, llvm::strictConversion);
// Check for conversion failure.
if (Result != llvm::conversionOK)
Diag(Arg->getLocStart(),
diag::warn_cfstring_truncated) << Arg->getSourceRange();
}
return false;
}
/// CheckObjCString - Checks that the format string argument to the os_log()
/// and os_trace() functions is correct, and converts it to const char *.
ExprResult Sema::CheckOSLogFormatStringArg(Expr *Arg) {
Arg = Arg->IgnoreParenCasts();
auto *Literal = dyn_cast<StringLiteral>(Arg);
if (!Literal) {
if (auto *ObjcLiteral = dyn_cast<ObjCStringLiteral>(Arg)) {
Literal = ObjcLiteral->getString();
}
}
if (!Literal || (!Literal->isAscii() && !Literal->isUTF8())) {
return ExprError(
Diag(Arg->getLocStart(), diag::err_os_log_format_not_string_constant)
<< Arg->getSourceRange());
}
ExprResult Result(Literal);
QualType ResultTy = Context.getPointerType(Context.CharTy.withConst());
InitializedEntity Entity =
InitializedEntity::InitializeParameter(Context, ResultTy, false);
Result = PerformCopyInitialization(Entity, SourceLocation(), Result);
return Result;
}
/// Check that the user is calling the appropriate va_start builtin for the
/// target and calling convention.
static bool checkVAStartABI(Sema &S, unsigned BuiltinID, Expr *Fn) {
const llvm::Triple &TT = S.Context.getTargetInfo().getTriple();
bool IsX64 = TT.getArch() == llvm::Triple::x86_64;
bool IsAArch64 = TT.getArch() == llvm::Triple::aarch64;
bool IsWindows = TT.isOSWindows();
bool IsMSVAStart = BuiltinID == Builtin::BI__builtin_ms_va_start;
if (IsX64 || IsAArch64) {
clang::CallingConv CC = CC_C;
if (const FunctionDecl *FD = S.getCurFunctionDecl())
CC = FD->getType()->getAs<FunctionType>()->getCallConv();
if (IsMSVAStart) {
// Don't allow this in System V ABI functions.
if (CC == CC_X86_64SysV || (!IsWindows && CC != CC_Win64))
return S.Diag(Fn->getLocStart(),
diag::err_ms_va_start_used_in_sysv_function);
} else {
// On x86-64/AArch64 Unix, don't allow this in Win64 ABI functions.
// On x64 Windows, don't allow this in System V ABI functions.
// (Yes, that means there's no corresponding way to support variadic
// System V ABI functions on Windows.)
if ((IsWindows && CC == CC_X86_64SysV) ||
(!IsWindows && CC == CC_Win64))
return S.Diag(Fn->getLocStart(),
diag::err_va_start_used_in_wrong_abi_function)
<< !IsWindows;
}
return false;
}
if (IsMSVAStart)
return S.Diag(Fn->getLocStart(), diag::err_builtin_x64_aarch64_only);
return false;
}
static bool checkVAStartIsInVariadicFunction(Sema &S, Expr *Fn,
ParmVarDecl **LastParam = nullptr) {
// Determine whether the current function, block, or obj-c method is variadic
// and get its parameter list.
bool IsVariadic = false;
ArrayRef<ParmVarDecl *> Params;
DeclContext *Caller = S.CurContext;
if (auto *Block = dyn_cast<BlockDecl>(Caller)) {
IsVariadic = Block->isVariadic();
Params = Block->parameters();
} else if (auto *FD = dyn_cast<FunctionDecl>(Caller)) {
IsVariadic = FD->isVariadic();
Params = FD->parameters();
} else if (auto *MD = dyn_cast<ObjCMethodDecl>(Caller)) {
IsVariadic = MD->isVariadic();
// FIXME: This isn't correct for methods (results in bogus warning).
Params = MD->parameters();
} else if (isa<CapturedDecl>(Caller)) {
// We don't support va_start in a CapturedDecl.
S.Diag(Fn->getLocStart(), diag::err_va_start_captured_stmt);
return true;
} else {
// This must be some other declcontext that parses exprs.
S.Diag(Fn->getLocStart(), diag::err_va_start_outside_function);
return true;
}
if (!IsVariadic) {
S.Diag(Fn->getLocStart(), diag::err_va_start_fixed_function);
return true;
}
if (LastParam)
*LastParam = Params.empty() ? nullptr : Params.back();
return false;
}
/// Check the arguments to '__builtin_va_start' or '__builtin_ms_va_start'
/// for validity. Emit an error and return true on failure; return false
/// on success.
bool Sema::SemaBuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
Expr *Fn = TheCall->getCallee();
if (checkVAStartABI(*this, BuiltinID, Fn))
return true;
if (TheCall->getNumArgs() > 2) {
Diag(TheCall->getArg(2)->getLocStart(),
diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< Fn->getSourceRange()
<< SourceRange(TheCall->getArg(2)->getLocStart(),
(*(TheCall->arg_end()-1))->getLocEnd());
return true;
}
if (TheCall->getNumArgs() < 2) {
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs();
}
// Type-check the first argument normally.
if (checkBuiltinArgument(*this, TheCall, 0))
return true;
// Check that the current function is variadic, and get its last parameter.
ParmVarDecl *LastParam;
if (checkVAStartIsInVariadicFunction(*this, Fn, &LastParam))
return true;
// Verify that the second argument to the builtin is the last argument of the
// current function or method.
bool SecondArgIsLastNamedArgument = false;
const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts();
// These are valid if SecondArgIsLastNamedArgument is false after the next
// block.
QualType Type;
SourceLocation ParamLoc;
bool IsCRegister = false;
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Arg)) {
if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) {
SecondArgIsLastNamedArgument = PV == LastParam;
Type = PV->getType();
ParamLoc = PV->getLocation();
IsCRegister =
PV->getStorageClass() == SC_Register && !getLangOpts().CPlusPlus;
}
}
if (!SecondArgIsLastNamedArgument)
Diag(TheCall->getArg(1)->getLocStart(),
diag::warn_second_arg_of_va_start_not_last_named_param);
else if (IsCRegister || Type->isReferenceType() ||
Type->isSpecificBuiltinType(BuiltinType::Float) || [=] {
// Promotable integers are UB, but enumerations need a bit of
// extra checking to see what their promotable type actually is.
if (!Type->isPromotableIntegerType())
return false;
if (!Type->isEnumeralType())
return true;
const EnumDecl *ED = Type->getAs<EnumType>()->getDecl();
return !(ED &&
Context.typesAreCompatible(ED->getPromotionType(), Type));
}()) {
unsigned Reason = 0;
if (Type->isReferenceType()) Reason = 1;
else if (IsCRegister) Reason = 2;
Diag(Arg->getLocStart(), diag::warn_va_start_type_is_undefined) << Reason;
Diag(ParamLoc, diag::note_parameter_type) << Type;
}
TheCall->setType(Context.VoidTy);
return false;
}
bool Sema::SemaBuiltinVAStartARM(CallExpr *Call) {
// void __va_start(va_list *ap, const char *named_addr, size_t slot_size,
// const char *named_addr);
Expr *Func = Call->getCallee();
if (Call->getNumArgs() < 3)
return Diag(Call->getLocEnd(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << 3 << Call->getNumArgs();
// Type-check the first argument normally.
if (checkBuiltinArgument(*this, Call, 0))
return true;
// Check that the current function is variadic.
if (checkVAStartIsInVariadicFunction(*this, Func))
return true;
const struct {
unsigned ArgNo;
QualType Type;
} ArgumentTypes[] = {
{ 1, Context.getPointerType(Context.CharTy.withConst()) },
{ 2, Context.getSizeType() },
};
for (const auto &AT : ArgumentTypes) {
const Expr *Arg = Call->getArg(AT.ArgNo)->IgnoreParens();
if (Arg->getType().getCanonicalType() == AT.Type.getCanonicalType())
continue;
Diag(Arg->getLocStart(), diag::err_typecheck_convert_incompatible)
<< Arg->getType() << AT.Type << 1 /* different class */
<< 0 /* qualifier difference */ << 3 /* parameter mismatch */
<< AT.ArgNo + 1 << Arg->getType() << AT.Type;
}
return false;
}
/// SemaBuiltinUnorderedCompare - Handle functions like __builtin_isgreater and
/// friends. This is declared to take (...), so we have to check everything.
bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 2)
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
<< 0 << 2 << TheCall->getNumArgs()/*function call*/;
if (TheCall->getNumArgs() > 2)
return Diag(TheCall->getArg(2)->getLocStart(),
diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< SourceRange(TheCall->getArg(2)->getLocStart(),
(*(TheCall->arg_end()-1))->getLocEnd());
ExprResult OrigArg0 = TheCall->getArg(0);
ExprResult OrigArg1 = TheCall->getArg(1);
// Do standard promotions between the two arguments, returning their common
// type.
QualType Res = UsualArithmeticConversions(OrigArg0, OrigArg1, false);
if (OrigArg0.isInvalid() || OrigArg1.isInvalid())
return true;
// Make sure any conversions are pushed back into the call; this is
// type safe since unordered compare builtins are declared as "_Bool
// foo(...)".
TheCall->setArg(0, OrigArg0.get());
TheCall->setArg(1, OrigArg1.get());
if (OrigArg0.get()->isTypeDependent() || OrigArg1.get()->isTypeDependent())
return false;
// If the common type isn't a real floating type, then the arguments were
// invalid for this operation.
if (Res.isNull() || !Res->isRealFloatingType())
return Diag(OrigArg0.get()->getLocStart(),
diag::err_typecheck_call_invalid_ordered_compare)
<< OrigArg0.get()->getType() << OrigArg1.get()->getType()
<< SourceRange(OrigArg0.get()->getLocStart(), OrigArg1.get()->getLocEnd());
return false;
}
/// SemaBuiltinSemaBuiltinFPClassification - Handle functions like
/// __builtin_isnan and friends. This is declared to take (...), so we have
/// to check everything. We expect the last argument to be a floating point
/// value.
bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) {
if (TheCall->getNumArgs() < NumArgs)
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
<< 0 << NumArgs << TheCall->getNumArgs()/*function call*/;
if (TheCall->getNumArgs() > NumArgs)
return Diag(TheCall->getArg(NumArgs)->getLocStart(),
diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << NumArgs << TheCall->getNumArgs()
<< SourceRange(TheCall->getArg(NumArgs)->getLocStart(),
(*(TheCall->arg_end()-1))->getLocEnd());
Expr *OrigArg = TheCall->getArg(NumArgs-1);
if (OrigArg->isTypeDependent())
return false;
// This operation requires a non-_Complex floating-point number.
if (!OrigArg->getType()->isRealFloatingType())
return Diag(OrigArg->getLocStart(),
diag::err_typecheck_call_invalid_unary_fp)
<< OrigArg->getType() << OrigArg->getSourceRange();
// If this is an implicit conversion from float -> float or double, remove it.
if (ImplicitCastExpr *Cast = dyn_cast<ImplicitCastExpr>(OrigArg)) {
// Only remove standard FloatCasts, leaving other casts inplace
if (Cast->getCastKind() == CK_FloatingCast) {
Expr *CastArg = Cast->getSubExpr();
if (CastArg->getType()->isSpecificBuiltinType(BuiltinType::Float)) {
assert((Cast->getType()->isSpecificBuiltinType(BuiltinType::Double) ||
Cast->getType()->isSpecificBuiltinType(BuiltinType::Float)) &&
"promotion from float to either float or double is the only expected cast here");
Cast->setSubExpr(nullptr);
TheCall->setArg(NumArgs-1, CastArg);
}
}
}
return false;
}
// Customized Sema Checking for VSX builtins that have the following signature:
// vector [...] builtinName(vector [...], vector [...], const int);
// Which takes the same type of vectors (any legal vector type) for the first
// two arguments and takes compile time constant for the third argument.
// Example builtins are :
// vector double vec_xxpermdi(vector double, vector double, int);
// vector short vec_xxsldwi(vector short, vector short, int);
bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
unsigned ExpectedNumArgs = 3;
if (TheCall->getNumArgs() < ExpectedNumArgs)
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs()
<< TheCall->getSourceRange();
if (TheCall->getNumArgs() > ExpectedNumArgs)
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs()
<< TheCall->getSourceRange();
// Check the third argument is a compile time constant
llvm::APSInt Value;
if(!TheCall->getArg(2)->isIntegerConstantExpr(Value, Context))
return Diag(TheCall->getLocStart(),
diag::err_vsx_builtin_nonconstant_argument)
<< 3 /* argument index */ << TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(2)->getLocStart(),
TheCall->getArg(2)->getLocEnd());
QualType Arg1Ty = TheCall->getArg(0)->getType();
QualType Arg2Ty = TheCall->getArg(1)->getType();
// Check the type of argument 1 and argument 2 are vectors.
SourceLocation BuiltinLoc = TheCall->getLocStart();
if ((!Arg1Ty->isVectorType() && !Arg1Ty->isDependentType()) ||
(!Arg2Ty->isVectorType() && !Arg2Ty->isDependentType())) {
return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getLocStart(),
TheCall->getArg(1)->getLocEnd());
}
// Check the first two arguments are the same type.
if (!Context.hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getLocStart(),
TheCall->getArg(1)->getLocEnd());
}
// When default clang type checking is turned off and the customized type
// checking is used, the returning type of the function must be explicitly
// set. Otherwise it is _Bool by default.
TheCall->setType(Arg1Ty);
return false;
}
/// SemaBuiltinShuffleVector - Handle __builtin_shufflevector.
// This is declared to take (...), so we have to check everything.
ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 2)
return ExprError(Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< TheCall->getSourceRange());
// Determine which of the following types of shufflevector we're checking:
// 1) unary, vector mask: (lhs, mask)
// 2) binary, scalar mask: (lhs, rhs, index, ..., index)
QualType resType = TheCall->getArg(0)->getType();
unsigned numElements = 0;
if (!TheCall->getArg(0)->isTypeDependent() &&
!TheCall->getArg(1)->isTypeDependent()) {
QualType LHSType = TheCall->getArg(0)->getType();
QualType RHSType = TheCall->getArg(1)->getType();
if (!LHSType->isVectorType() || !RHSType->isVectorType())
return ExprError(Diag(TheCall->getLocStart(),
diag::err_vec_builtin_non_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getLocStart(),
TheCall->getArg(1)->getLocEnd()));
numElements = LHSType->getAs<VectorType>()->getNumElements();
unsigned numResElements = TheCall->getNumArgs() - 2;
// Check to see if we have a call with 2 vector arguments, the unary shuffle
// with mask. If so, verify that RHS is an integer vector type with the
// same number of elts as lhs.
if (TheCall->getNumArgs() == 2) {
if (!RHSType->hasIntegerRepresentation() ||
RHSType->getAs<VectorType>()->getNumElements() != numElements)
return ExprError(Diag(TheCall->getLocStart(),
diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(1)->getLocStart(),
TheCall->getArg(1)->getLocEnd()));
} else if (!Context.hasSameUnqualifiedType(LHSType, RHSType)) {
return ExprError(Diag(TheCall->getLocStart(),
diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getLocStart(),
TheCall->getArg(1)->getLocEnd()));
} else if (numElements != numResElements) {
QualType eltType = LHSType->getAs<VectorType>()->getElementType();
resType = Context.getVectorType(eltType, numResElements,
VectorType::GenericVector);
}
}
for (unsigned i = 2; i < TheCall->getNumArgs(); i++) {
if (TheCall->getArg(i)->isTypeDependent() ||
TheCall->getArg(i)->isValueDependent())
continue;
llvm::APSInt Result(32);
if (!TheCall->getArg(i)->isIntegerConstantExpr(Result, Context))
return ExprError(Diag(TheCall->getLocStart(),
diag::err_shufflevector_nonconstant_argument)
<< TheCall->getArg(i)->getSourceRange());
// Allow -1 which will be translated to undef in the IR.
if (Result.isSigned() && Result.isAllOnesValue())
continue;
if (Result.getActiveBits() > 64 || Result.getZExtValue() >= numElements*2)
return ExprError(Diag(TheCall->getLocStart(),
diag::err_shufflevector_argument_too_large)
<< TheCall->getArg(i)->getSourceRange());
}
SmallVector<Expr*, 32> exprs;
for (unsigned i = 0, e = TheCall->getNumArgs(); i != e; i++) {
exprs.push_back(TheCall->getArg(i));
TheCall->setArg(i, nullptr);
}
return new (Context) ShuffleVectorExpr(Context, exprs, resType,
TheCall->getCallee()->getLocStart(),
TheCall->getRParenLoc());
}
/// SemaConvertVectorExpr - Handle __builtin_convertvector
ExprResult Sema::SemaConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc) {
ExprValueKind VK = VK_RValue;
ExprObjectKind OK = OK_Ordinary;
QualType DstTy = TInfo->getType();
QualType SrcTy = E->getType();
if (!SrcTy->isVectorType() && !SrcTy->isDependentType())
return ExprError(Diag(BuiltinLoc,
diag::err_convertvector_non_vector)
<< E->getSourceRange());
if (!DstTy->isVectorType() && !DstTy->isDependentType())
return ExprError(Diag(BuiltinLoc,
diag::err_convertvector_non_vector_type));
if (!SrcTy->isDependentType() && !DstTy->isDependentType()) {
unsigned SrcElts = SrcTy->getAs<VectorType>()->getNumElements();
unsigned DstElts = DstTy->getAs<VectorType>()->getNumElements();
if (SrcElts != DstElts)
return ExprError(Diag(BuiltinLoc,
diag::err_convertvector_incompatible_vector)
<< E->getSourceRange());
}
return new (Context)
ConvertVectorExpr(E, TInfo, DstTy, VK, OK, BuiltinLoc, RParenLoc);
}
/// SemaBuiltinPrefetch - Handle __builtin_prefetch.
// This is declared to take (const void*, ...) and can take two
// optional constant int args.
bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
if (NumArgs > 3)
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /*function call*/ << 3 << NumArgs
<< TheCall->getSourceRange();
// Argument 0 is checked for us and the remaining arguments must be
// constant integers.
for (unsigned i = 1; i != NumArgs; ++i)
if (SemaBuiltinConstantArgRange(TheCall, i, 0, i == 1 ? 1 : 3))
return true;
return false;
}
/// SemaBuiltinAssume - Handle __assume (MS Extension).
// __assume does not evaluate its arguments, and should warn if its argument
// has side effects.
bool Sema::SemaBuiltinAssume(CallExpr *TheCall) {
Expr *Arg = TheCall->getArg(0);
if (Arg->isInstantiationDependent()) return false;
if (Arg->HasSideEffects(Context))
Diag(Arg->getLocStart(), diag::warn_assume_side_effects)
<< Arg->getSourceRange()
<< cast<FunctionDecl>(TheCall->getCalleeDecl())->getIdentifier();
return false;
}
/// Handle __builtin_alloca_with_align. This is declared
/// as (size_t, size_t) where the second size_t must be a power of 2 greater
/// than 8.
bool Sema::SemaBuiltinAllocaWithAlign(CallExpr *TheCall) {
// The alignment must be a constant integer.
Expr *Arg = TheCall->getArg(1);
// We can't check the value of a dependent argument.
if (!Arg->isTypeDependent() && !Arg->isValueDependent()) {
if (const auto *UE =
dyn_cast<UnaryExprOrTypeTraitExpr>(Arg->IgnoreParenImpCasts()))
if (UE->getKind() == UETT_AlignOf)
Diag(TheCall->getLocStart(), diag::warn_alloca_align_alignof)
<< Arg->getSourceRange();
llvm::APSInt Result = Arg->EvaluateKnownConstInt(Context);
if (!Result.isPowerOf2())
return Diag(TheCall->getLocStart(),
diag::err_alignment_not_power_of_two)
<< Arg->getSourceRange();
if (Result < Context.getCharWidth())
return Diag(TheCall->getLocStart(), diag::err_alignment_too_small)
<< (unsigned)Context.getCharWidth()
<< Arg->getSourceRange();
if (Result > INT32_MAX)
return Diag(TheCall->getLocStart(), diag::err_alignment_too_big)
<< INT32_MAX
<< Arg->getSourceRange();
}
return false;
}
/// Handle __builtin_assume_aligned. This is declared
/// as (const void*, size_t, ...) and can take one optional constant int arg.
bool Sema::SemaBuiltinAssumeAligned(CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
if (NumArgs > 3)
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /*function call*/ << 3 << NumArgs
<< TheCall->getSourceRange();
// The alignment must be a constant integer.
Expr *Arg = TheCall->getArg(1);
// We can't check the value of a dependent argument.
if (!Arg->isTypeDependent() && !Arg->isValueDependent()) {
llvm::APSInt Result;
if (SemaBuiltinConstantArg(TheCall, 1, Result))
return true;
if (!Result.isPowerOf2())
return Diag(TheCall->getLocStart(),
diag::err_alignment_not_power_of_two)
<< Arg->getSourceRange();
}
if (NumArgs > 2) {
ExprResult Arg(TheCall->getArg(2));
InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
Context.getSizeType(), false);
Arg = PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid()) return true;
TheCall->setArg(2, Arg.get());
}
return false;
}
bool Sema::SemaBuiltinOSLogFormat(CallExpr *TheCall) {
unsigned BuiltinID =
cast<FunctionDecl>(TheCall->getCalleeDecl())->getBuiltinID();
bool IsSizeCall = BuiltinID == Builtin::BI__builtin_os_log_format_buffer_size;
unsigned NumArgs = TheCall->getNumArgs();
unsigned NumRequiredArgs = IsSizeCall ? 1 : 2;
if (NumArgs < NumRequiredArgs) {
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
<< 0 /* function call */ << NumRequiredArgs << NumArgs
<< TheCall->getSourceRange();
}
if (NumArgs >= NumRequiredArgs + 0x100) {
return Diag(TheCall->getLocEnd(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /* function call */ << (NumRequiredArgs + 0xff) << NumArgs
<< TheCall->getSourceRange();
}
unsigned i = 0;
// For formatting call, check buffer arg.
if (!IsSizeCall) {
ExprResult Arg(TheCall->getArg(i));
InitializedEntity Entity = InitializedEntity::InitializeParameter(
Context, Context.VoidPtrTy, false);
Arg = PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid())
return true;
TheCall->setArg(i, Arg.get());
i++;
}
// Check string literal arg.
unsigned FormatIdx = i;
{
ExprResult Arg = CheckOSLogFormatStringArg(TheCall->getArg(i));
if (Arg.isInvalid())
return true;
TheCall->setArg(i, Arg.get());
i++;
}
// Make sure variadic args are scalar.
unsigned FirstDataArg = i;
while (i < NumArgs) {
ExprResult Arg = DefaultVariadicArgumentPromotion(
TheCall->getArg(i), VariadicFunction, nullptr);
if (Arg.isInvalid())
return true;
CharUnits ArgSize = Context.getTypeSizeInChars(Arg.get()->getType());
if (ArgSize.getQuantity() >= 0x100) {
return Diag(Arg.get()->getLocEnd(), diag::err_os_log_argument_too_big)
<< i << (int)ArgSize.getQuantity() << 0xff
<< TheCall->getSourceRange();
}
TheCall->setArg(i, Arg.get());
i++;
}
// Check formatting specifiers. NOTE: We're only doing this for the non-size
// call to avoid duplicate diagnostics.
if (!IsSizeCall) {
llvm::SmallBitVector CheckedVarArgs(NumArgs, false);
ArrayRef<const Expr *> Args(TheCall->getArgs(), TheCall->getNumArgs());
bool Success = CheckFormatArguments(
Args, /*HasVAListArg*/ false, FormatIdx, FirstDataArg, FST_OSLog,
VariadicFunction, TheCall->getLocStart(), SourceRange(),
CheckedVarArgs);
if (!Success)
return true;
}
if (IsSizeCall) {
TheCall->setType(Context.getSizeType());
} else {
TheCall->setType(Context.VoidPtrTy);
}
return false;
}
/// SemaBuiltinConstantArg - Handle a check if argument ArgNum of CallExpr
/// TheCall is a constant expression.
bool Sema::SemaBuiltinConstantArg(CallExpr *TheCall, int ArgNum,
llvm::APSInt &Result) {
Expr *Arg = TheCall->getArg(ArgNum);
DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
if (Arg->isTypeDependent() || Arg->isValueDependent()) return false;
if (!Arg->isIntegerConstantExpr(Result, Context))
return Diag(TheCall->getLocStart(), diag::err_constant_integer_arg_type)
<< FDecl->getDeclName() << Arg->getSourceRange();
return false;
}
/// SemaBuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr
/// TheCall is a constant expression in the range [Low, High].
bool Sema::SemaBuiltinConstantArgRange(CallExpr *TheCall, int ArgNum,
int Low, int High) {
llvm::APSInt Result;
// We can't check the value of a dependent argument.
Expr *Arg = TheCall->getArg(ArgNum);
if (Arg->isTypeDependent() || Arg->isValueDependent())
return false;
// Check constant-ness first.
if (SemaBuiltinConstantArg(TheCall, ArgNum, Result))
return true;
if (Result.getSExtValue() < Low || Result.getSExtValue() > High)
return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range)
<< Low << High << Arg->getSourceRange();
return false;
}
/// SemaBuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr
/// TheCall is a constant expression is a multiple of Num..
bool Sema::SemaBuiltinConstantArgMultiple(CallExpr *TheCall, int ArgNum,
unsigned Num) {
llvm::APSInt Result;
// We can't check the value of a dependent argument.
Expr *Arg = TheCall->getArg(ArgNum);
if (Arg->isTypeDependent() || Arg->isValueDependent())
return false;
// Check constant-ness first.
if (SemaBuiltinConstantArg(TheCall, ArgNum, Result))
return true;
if (Result.getSExtValue() % Num != 0)
return Diag(TheCall->getLocStart(), diag::err_argument_not_multiple)
<< Num << Arg->getSourceRange();
return false;
}
/// SemaBuiltinARMSpecialReg - Handle a check if argument ArgNum of CallExpr
/// TheCall is an ARM/AArch64 special register string literal.
bool Sema::SemaBuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall,
int ArgNum, unsigned ExpectedFieldNum,
bool AllowName) {
bool IsARMBuiltin = BuiltinID == ARM::BI__builtin_arm_rsr64 ||
BuiltinID == ARM::BI__builtin_arm_wsr64 ||
BuiltinID == ARM::BI__builtin_arm_rsr ||
BuiltinID == ARM::BI__builtin_arm_rsrp ||
BuiltinID == ARM::BI__builtin_arm_wsr ||
BuiltinID == ARM::BI__builtin_arm_wsrp;
bool IsAArch64Builtin = BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
BuiltinID == AArch64::BI__builtin_arm_wsr64 ||
BuiltinID == AArch64::BI__builtin_arm_rsr ||
BuiltinID == AArch64::BI__builtin_arm_rsrp ||
BuiltinID == AArch64::BI__builtin_arm_wsr ||
BuiltinID == AArch64::BI__builtin_arm_wsrp;
assert((IsARMBuiltin || IsAArch64Builtin) && "Unexpected ARM builtin.");
// We can't check the value of a dependent argument.
Expr *Arg = TheCall->getArg(ArgNum);
if (Arg->isTypeDependent() || Arg->isValueDependent())
return false;
// Check if the argument is a string literal.
if (!isa<StringLiteral>(Arg->IgnoreParenImpCasts()))
return Diag(TheCall->getLocStart(), diag::err_expr_not_string_literal)
<< Arg->getSourceRange();
// Check the type of special register given.
StringRef Reg = cast<StringLiteral>(Arg->IgnoreParenImpCasts())->getString();
SmallVector<StringRef, 6> Fields;
Reg.split(Fields, ":");
if (Fields.size() != ExpectedFieldNum && !(AllowName && Fields.size() == 1))
return Diag(TheCall->getLocStart(), diag::err_arm_invalid_specialreg)
<< Arg->getSourceRange();
// If the string is the name of a register then we cannot check that it is
// valid here but if the string is of one the forms described in ACLE then we
// can check that the supplied fields are integers and within the valid
// ranges.
if (Fields.size() > 1) {
bool FiveFields = Fields.size() == 5;
bool ValidString = true;
if (IsARMBuiltin) {
ValidString &= Fields[0].startswith_lower("cp") ||
Fields[0].startswith_lower("p");
if (ValidString)
Fields[0] =
Fields[0].drop_front(Fields[0].startswith_lower("cp") ? 2 : 1);
ValidString &= Fields[2].startswith_lower("c");
if (ValidString)
Fields[2] = Fields[2].drop_front(1);
if (FiveFields) {
ValidString &= Fields[3].startswith_lower("c");
if (ValidString)
Fields[3] = Fields[3].drop_front(1);
}
}
SmallVector<int, 5> Ranges;
if (FiveFields)
Ranges.append({IsAArch64Builtin ? 1 : 15, 7, 15, 15, 7});
else
Ranges.append({15, 7, 15});
for (unsigned i=0; i<Fields.size(); ++i) {
int IntField;
ValidString &= !Fields[i].getAsInteger(10, IntField);
ValidString &= (IntField >= 0 && IntField <= Ranges[i]);
}
if (!ValidString)
return Diag(TheCall->getLocStart(), diag::err_arm_invalid_specialreg)
<< Arg->getSourceRange();
} else if (IsAArch64Builtin && Fields.size() == 1) {
// If the register name is one of those that appear in the condition below
// and the special register builtin being used is one of the write builtins,
// then we require that the argument provided for writing to the register
// is an integer constant expression. This is because it will be lowered to
// an MSR (immediate) instruction, so we need to know the immediate at
// compile time.
if (TheCall->getNumArgs() != 2)
return false;
std::string RegLower = Reg.lower();
if (RegLower != "spsel" && RegLower != "daifset" && RegLower != "daifclr" &&
RegLower != "pan" && RegLower != "uao")
return false;
return SemaBuiltinConstantArgRange(TheCall, 1, 0, 15);
}
return false;
}
/// SemaBuiltinLongjmp - Handle __builtin_longjmp(void *env[5], int val).
/// This checks that the target supports __builtin_longjmp and
/// that val is a constant 1.
bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
if (!Context.getTargetInfo().hasSjLjLowering())
return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_unsupported)
<< SourceRange(TheCall->getLocStart(), TheCall->getLocEnd());
Expr *Arg = TheCall->getArg(1);
llvm::APSInt Result;
// TODO: This is less than ideal. Overload this to take a value.
if (SemaBuiltinConstantArg(TheCall, 1, Result))
return true;
if (Result != 1)
return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_invalid_val)
<< SourceRange(Arg->getLocStart(), Arg->getLocEnd());
return false;
}
/// SemaBuiltinSetjmp - Handle __builtin_setjmp(void *env[5]).
/// This checks that the target supports __builtin_setjmp.
bool Sema::SemaBuiltinSetjmp(CallExpr *TheCall) {
if (!Context.getTargetInfo().hasSjLjLowering())
return Diag(TheCall->getLocStart(), diag::err_builtin_setjmp_unsupported)
<< SourceRange(TheCall->getLocStart(), TheCall->getLocEnd());
return false;
}
namespace {
class UncoveredArgHandler {
enum { Unknown = -1, AllCovered = -2 };
signed FirstUncoveredArg;
SmallVector<const Expr *, 4> DiagnosticExprs;
public:
UncoveredArgHandler() : FirstUncoveredArg(Unknown) { }
bool hasUncoveredArg() const {
return (FirstUncoveredArg >= 0);
}
unsigned getUncoveredArg() const {
assert(hasUncoveredArg() && "no uncovered argument");
return FirstUncoveredArg;
}
void setAllCovered() {
// A string has been found with all arguments covered, so clear out
// the diagnostics.
DiagnosticExprs.clear();
FirstUncoveredArg = AllCovered;
}
void Update(signed NewFirstUncoveredArg, const Expr *StrExpr) {
assert(NewFirstUncoveredArg >= 0 && "Outside range");
// Don't update if a previous string covers all arguments.
if (FirstUncoveredArg == AllCovered)
return;
// UncoveredArgHandler tracks the highest uncovered argument index
// and with it all the strings that match this index.
if (NewFirstUncoveredArg == FirstUncoveredArg)
DiagnosticExprs.push_back(StrExpr);
else if (NewFirstUncoveredArg > FirstUncoveredArg) {
DiagnosticExprs.clear();
DiagnosticExprs.push_back(StrExpr);
FirstUncoveredArg = NewFirstUncoveredArg;
}
}
void Diagnose(Sema &S, bool IsFunctionCall, const Expr *ArgExpr);
};
enum StringLiteralCheckType {
SLCT_NotALiteral,
SLCT_UncheckedLiteral,
SLCT_CheckedLiteral
};
} // end anonymous namespace
static void sumOffsets(llvm::APSInt &Offset, llvm::APSInt Addend,
BinaryOperatorKind BinOpKind,
bool AddendIsRight) {
unsigned BitWidth = Offset.getBitWidth();
unsigned AddendBitWidth = Addend.getBitWidth();
// There might be negative interim results.
if (Addend.isUnsigned()) {
Addend = Addend.zext(++AddendBitWidth);
Addend.setIsSigned(true);
}
// Adjust the bit width of the APSInts.
if (AddendBitWidth > BitWidth) {
Offset = Offset.sext(AddendBitWidth);
BitWidth = AddendBitWidth;
} else if (BitWidth > AddendBitWidth) {
Addend = Addend.sext(BitWidth);
}
bool Ov = false;
llvm::APSInt ResOffset = Offset;
if (BinOpKind == BO_Add)
ResOffset = Offset.sadd_ov(Addend, Ov);
else {
assert(AddendIsRight && BinOpKind == BO_Sub &&
"operator must be add or sub with addend on the right");
ResOffset = Offset.ssub_ov(Addend, Ov);
}
// We add an offset to a pointer here so we should support an offset as big as
// possible.
if (Ov) {
assert(BitWidth <= UINT_MAX / 2 && "index (intermediate) result too big");
Offset = Offset.sext(2 * BitWidth);
sumOffsets(Offset, Addend, BinOpKind, AddendIsRight);
return;
}
Offset = ResOffset;
}
namespace {
// This is a wrapper class around StringLiteral to support offsetted string
// literals as format strings. It takes the offset into account when returning
// the string and its length or the source locations to display notes correctly.
class FormatStringLiteral {
const StringLiteral *FExpr;
int64_t Offset;
public:
FormatStringLiteral(const StringLiteral *fexpr, int64_t Offset = 0)
: FExpr(fexpr), Offset(Offset) {}
StringRef getString() const {
return FExpr->getString().drop_front(Offset);
}
unsigned getByteLength() const {
return FExpr->getByteLength() - getCharByteWidth() * Offset;
}
unsigned getLength() const { return FExpr->getLength() - Offset; }
unsigned getCharByteWidth() const { return FExpr->getCharByteWidth(); }
StringLiteral::StringKind getKind() const { return FExpr->getKind(); }
QualType getType() const { return FExpr->getType(); }
bool isAscii() const { return FExpr->isAscii(); }
bool isWide() const { return FExpr->isWide(); }
bool isUTF8() const { return FExpr->isUTF8(); }
bool isUTF16() const { return FExpr->isUTF16(); }
bool isUTF32() const { return FExpr->isUTF32(); }
bool isPascal() const { return FExpr->isPascal(); }
SourceLocation getLocationOfByte(
unsigned ByteNo, const SourceManager &SM, const LangOptions &Features,
const TargetInfo &Target, unsigned *StartToken = nullptr,
unsigned *StartTokenByteOffset = nullptr) const {
return FExpr->getLocationOfByte(ByteNo + Offset, SM, Features, Target,
StartToken, StartTokenByteOffset);
}
SourceLocation getLocStart() const LLVM_READONLY {
return FExpr->getLocStart().getLocWithOffset(Offset);
}
SourceLocation getLocEnd() const LLVM_READONLY { return FExpr->getLocEnd(); }
};
} // end anonymous namespace
static void CheckFormatString(Sema &S, const FormatStringLiteral *FExpr,
const Expr *OrigFormatExpr,
ArrayRef<const Expr *> Args,
bool HasVAListArg, unsigned format_idx,
unsigned firstDataArg,
Sema::FormatStringType Type,
bool inFunctionCall,
Sema::VariadicCallType CallType,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg);
// Determine if an expression is a string literal or constant string.
// If this function returns false on the arguments to a function expecting a
// format string, we will usually need to emit a warning.
// True string literals are then checked by CheckFormatString.
static StringLiteralCheckType
checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef<const Expr *> Args,
bool HasVAListArg, unsigned format_idx,
unsigned firstDataArg, Sema::FormatStringType Type,
Sema::VariadicCallType CallType, bool InFunctionCall,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg,
llvm::APSInt Offset) {
tryAgain:
assert(Offset.isSigned() && "invalid offset");
if (E->isTypeDependent() || E->isValueDependent())
return SLCT_NotALiteral;
E = E->IgnoreParenCasts();
if (E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull))
// Technically -Wformat-nonliteral does not warn about this case.
// The behavior of printf and friends in this case is implementation
// dependent. Ideally if the format string cannot be null then
// it should have a 'nonnull' attribute in the function prototype.
return SLCT_UncheckedLiteral;
switch (E->getStmtClass()) {
case Stmt::BinaryConditionalOperatorClass:
case Stmt::ConditionalOperatorClass: {
// The expression is a literal if both sub-expressions were, and it was
// completely checked only if both sub-expressions were checked.
const AbstractConditionalOperator *C =
cast<AbstractConditionalOperator>(E);
// Determine whether it is necessary to check both sub-expressions, for
// example, because the condition expression is a constant that can be
// evaluated at compile time.
bool CheckLeft = true, CheckRight = true;
bool Cond;
if (C->getCond()->EvaluateAsBooleanCondition(Cond, S.getASTContext())) {
if (Cond)
CheckRight = false;
else
CheckLeft = false;
}
// We need to maintain the offsets for the right and the left hand side
// separately to check if every possible indexed expression is a valid
// string literal. They might have different offsets for different string
// literals in the end.
StringLiteralCheckType Left;
if (!CheckLeft)
Left = SLCT_UncheckedLiteral;
else {
Left = checkFormatStringExpr(S, C->getTrueExpr(), Args,
HasVAListArg, format_idx, firstDataArg,
Type, CallType, InFunctionCall,
CheckedVarArgs, UncoveredArg, Offset);
if (Left == SLCT_NotALiteral || !CheckRight) {
return Left;
}
}
StringLiteralCheckType Right =
checkFormatStringExpr(S, C->getFalseExpr(), Args,
HasVAListArg, format_idx, firstDataArg,
Type, CallType, InFunctionCall, CheckedVarArgs,
UncoveredArg, Offset);
return (CheckLeft && Left < Right) ? Left : Right;
}
case Stmt::ImplicitCastExprClass: {
E = cast<ImplicitCastExpr>(E)->getSubExpr();
goto tryAgain;
}
case Stmt::OpaqueValueExprClass:
if (const Expr *src = cast<OpaqueValueExpr>(E)->getSourceExpr()) {
E = src;
goto tryAgain;
}
return SLCT_NotALiteral;
case Stmt::PredefinedExprClass:
// While __func__, etc., are technically not string literals, they
// cannot contain format specifiers and thus are not a security
// liability.
return SLCT_UncheckedLiteral;
case Stmt::DeclRefExprClass: {
const DeclRefExpr *DR = cast<DeclRefExpr>(E);
// As an exception, do not flag errors for variables binding to
// const string literals.
if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
bool isConstant = false;
QualType T = DR->getType();
if (const ArrayType *AT = S.Context.getAsArrayType(T)) {
isConstant = AT->getElementType().isConstant(S.Context);
} else if (const PointerType *PT = T->getAs<PointerType>()) {
isConstant = T.isConstant(S.Context) &&
PT->getPointeeType().isConstant(S.Context);
} else if (T->isObjCObjectPointerType()) {
// In ObjC, there is usually no "const ObjectPointer" type,
// so don't check if the pointee type is constant.
isConstant = T.isConstant(S.Context);
}
if (isConstant) {
if (const Expr *Init = VD->getAnyInitializer()) {
// Look through initializers like const char c[] = { "foo" }
if (const InitListExpr *InitList = dyn_cast<InitListExpr>(Init)) {
if (InitList->isStringLiteralInit())
Init = InitList->getInit(0)->IgnoreParenImpCasts();
}
return checkFormatStringExpr(S, Init, Args,
HasVAListArg, format_idx,
firstDataArg, Type, CallType,
/*InFunctionCall*/ false, CheckedVarArgs,
UncoveredArg, Offset);
}
}
// For vprintf* functions (i.e., HasVAListArg==true), we add a
// special check to see if the format string is a function parameter
// of the function calling the printf function. If the function
// has an attribute indicating it is a printf-like function, then we
// should suppress warnings concerning non-literals being used in a call
// to a vprintf function. For example:
//
// void
// logmessage(char const *fmt __attribute__ (format (printf, 1, 2)), ...){
// va_list ap;
// va_start(ap, fmt);
// vprintf(fmt, ap); // Do NOT emit a warning about "fmt".
// ...
// }
if (HasVAListArg) {
if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(VD)) {
if (const NamedDecl *ND = dyn_cast<NamedDecl>(PV->getDeclContext())) {
int PVIndex = PV->getFunctionScopeIndex() + 1;
for (const auto *PVFormat : ND->specific_attrs<FormatAttr>()) {
// adjust for implicit parameter
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(ND))
if (MD->isInstance())
++PVIndex;
// We also check if the formats are compatible.
// We can't pass a 'scanf' string to a 'printf' function.
if (PVIndex == PVFormat->getFormatIdx() &&
Type == S.GetFormatStringType(PVFormat))
return SLCT_UncheckedLiteral;
}
}
}
}
}
return SLCT_NotALiteral;
}
case Stmt::CallExprClass:
case Stmt::CXXMemberCallExprClass: {
const CallExpr *CE = cast<CallExpr>(E);
if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(CE->getCalleeDecl())) {
if (const FormatArgAttr *FA = ND->getAttr<FormatArgAttr>()) {
unsigned ArgIndex = FA->getFormatIdx();
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(ND))
if (MD->isInstance())
--ArgIndex;
const Expr *Arg = CE->getArg(ArgIndex - 1);
return checkFormatStringExpr(S, Arg, Args,
HasVAListArg, format_idx, firstDataArg,
Type, CallType, InFunctionCall,
CheckedVarArgs, UncoveredArg, Offset);
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)) {
unsigned BuiltinID = FD->getBuiltinID();
if (BuiltinID == Builtin::BI__builtin___CFStringMakeConstantString ||
BuiltinID == Builtin::BI__builtin___NSStringMakeConstantString) {
const Expr *Arg = CE->getArg(0);
return checkFormatStringExpr(S, Arg, Args,
HasVAListArg, format_idx,
firstDataArg, Type, CallType,
InFunctionCall, CheckedVarArgs,
UncoveredArg, Offset);
}
}
}
return SLCT_NotALiteral;
}
case Stmt::ObjCMessageExprClass: {
const auto *ME = cast<ObjCMessageExpr>(E);
if (const auto *ND = ME->getMethodDecl()) {
if (const auto *FA = ND->getAttr<FormatArgAttr>()) {
unsigned ArgIndex = FA->getFormatIdx();
const Expr *Arg = ME->getArg(ArgIndex - 1);
return checkFormatStringExpr(
S, Arg, Args, HasVAListArg, format_idx, firstDataArg, Type,
CallType, InFunctionCall, CheckedVarArgs, UncoveredArg, Offset);
}
}
return SLCT_NotALiteral;
}
case Stmt::ObjCStringLiteralClass:
case Stmt::StringLiteralClass: {
const StringLiteral *StrE = nullptr;
if (const ObjCStringLiteral *ObjCFExpr = dyn_cast<ObjCStringLiteral>(E))
StrE = ObjCFExpr->getString();
else
StrE = cast<StringLiteral>(E);
if (StrE) {
if (Offset.isNegative() || Offset > StrE->getLength()) {
// TODO: It would be better to have an explicit warning for out of
// bounds literals.
return SLCT_NotALiteral;
}
FormatStringLiteral FStr(StrE, Offset.sextOrTrunc(64).getSExtValue());
CheckFormatString(S, &FStr, E, Args, HasVAListArg, format_idx,
firstDataArg, Type, InFunctionCall, CallType,
CheckedVarArgs, UncoveredArg);
return SLCT_CheckedLiteral;
}
return SLCT_NotALiteral;
}
case Stmt::BinaryOperatorClass: {
llvm::APSInt LResult;
llvm::APSInt RResult;
const BinaryOperator *BinOp = cast<BinaryOperator>(E);
// A string literal + an int offset is still a string literal.
if (BinOp->isAdditiveOp()) {
bool LIsInt = BinOp->getLHS()->EvaluateAsInt(LResult, S.Context);
bool RIsInt = BinOp->getRHS()->EvaluateAsInt(RResult, S.Context);
if (LIsInt != RIsInt) {
BinaryOperatorKind BinOpKind = BinOp->getOpcode();
if (LIsInt) {
if (BinOpKind == BO_Add) {
sumOffsets(Offset, LResult, BinOpKind, RIsInt);
E = BinOp->getRHS();
goto tryAgain;
}
} else {
sumOffsets(Offset, RResult, BinOpKind, RIsInt);
E = BinOp->getLHS();
goto tryAgain;
}
}
}
return SLCT_NotALiteral;
}
case Stmt::UnaryOperatorClass: {
const UnaryOperator *UnaOp = cast<UnaryOperator>(E);
auto ASE = dyn_cast<ArraySubscriptExpr>(UnaOp->getSubExpr());
if (UnaOp->getOpcode() == clang::UO_AddrOf && ASE) {
llvm::APSInt IndexResult;
if (ASE->getRHS()->EvaluateAsInt(IndexResult, S.Context)) {
sumOffsets(Offset, IndexResult, BO_Add, /*RHS is int*/ true);
E = ASE->getBase();
goto tryAgain;
}
}
return SLCT_NotALiteral;
}
default:
return SLCT_NotALiteral;
}
}
Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
return llvm::StringSwitch<FormatStringType>(Format->getType()->getName())
.Case("scanf", FST_Scanf)
.Cases("printf", "printf0", FST_Printf)
.Cases("NSString", "CFString", FST_NSString)
.Case("strftime", FST_Strftime)
.Case("strfmon", FST_Strfmon)
.Cases("kprintf", "cmn_err", "vcmn_err", "zcmn_err", FST_Kprintf)
.Case("freebsd_kprintf", FST_FreeBSDKPrintf)
.Case("os_trace", FST_OSLog)
.Case("os_log", FST_OSLog)
.Default(FST_Unknown);
}
/// CheckFormatArguments - Check calls to printf and scanf (and similar
/// functions) for correct use of format strings.
/// Returns true if a format string has been fully checked.
bool Sema::CheckFormatArguments(const FormatAttr *Format,
ArrayRef<const Expr *> Args,
bool IsCXXMember,
VariadicCallType CallType,
SourceLocation Loc, SourceRange Range,
llvm::SmallBitVector &CheckedVarArgs) {
FormatStringInfo FSI;
if (getFormatStringInfo(Format, IsCXXMember, &FSI))
return CheckFormatArguments(Args, FSI.HasVAListArg, FSI.FormatIdx,
FSI.FirstDataArg, GetFormatStringType(Format),
CallType, Loc, Range, CheckedVarArgs);
return false;
}
bool Sema::CheckFormatArguments(ArrayRef<const Expr *> Args,
bool HasVAListArg, unsigned format_idx,
unsigned firstDataArg, FormatStringType Type,
VariadicCallType CallType,
SourceLocation Loc, SourceRange Range,
llvm::SmallBitVector &CheckedVarArgs) {
// CHECK: printf/scanf-like function is called with no format string.
if (format_idx >= Args.size()) {
Diag(Loc, diag::warn_missing_format_string) << Range;
return false;
}
const Expr *OrigFormatExpr = Args[format_idx]->IgnoreParenCasts();
// CHECK: format string is not a string literal.
//
// Dynamically generated format strings are difficult to
// automatically vet at compile time. Requiring that format strings
// are string literals: (1) permits the checking of format strings by
// the compiler and thereby (2) can practically remove the source of
// many format string exploits.
// Format string can be either ObjC string (e.g. @"%d") or
// C string (e.g. "%d")
// ObjC string uses the same format specifiers as C string, so we can use
// the same format string checking logic for both ObjC and C strings.
UncoveredArgHandler UncoveredArg;
StringLiteralCheckType CT =
checkFormatStringExpr(*this, OrigFormatExpr, Args, HasVAListArg,
format_idx, firstDataArg, Type, CallType,
/*IsFunctionCall*/ true, CheckedVarArgs,
UncoveredArg,
/*no string offset*/ llvm::APSInt(64, false) = 0);
// Generate a diagnostic where an uncovered argument is detected.
if (UncoveredArg.hasUncoveredArg()) {
unsigned ArgIdx = UncoveredArg.getUncoveredArg() + firstDataArg;
assert(ArgIdx < Args.size() && "ArgIdx outside bounds");
UncoveredArg.Diagnose(*this, /*IsFunctionCall*/true, Args[ArgIdx]);
}
if (CT != SLCT_NotALiteral)
// Literal format string found, check done!
return CT == SLCT_CheckedLiteral;
// Strftime is particular as it always uses a single 'time' argument,
// so it is safe to pass a non-literal string.
if (Type == FST_Strftime)
return false;
// Do not emit diag when the string param is a macro expansion and the
// format is either NSString or CFString. This is a hack to prevent
// diag when using the NSLocalizedString and CFCopyLocalizedString macros
// which are usually used in place of NS and CF string literals.
SourceLocation FormatLoc = Args[format_idx]->getLocStart();
if (Type == FST_NSString && SourceMgr.isInSystemMacro(FormatLoc))
return false;
// If there are no arguments specified, warn with -Wformat-security, otherwise
// warn only with -Wformat-nonliteral.
if (Args.size() == firstDataArg) {
Diag(FormatLoc, diag::warn_format_nonliteral_noargs)
<< OrigFormatExpr->getSourceRange();
switch (Type) {
default:
break;
case FST_Kprintf:
case FST_FreeBSDKPrintf:
case FST_Printf:
Diag(FormatLoc, diag::note_format_security_fixit)
<< FixItHint::CreateInsertion(FormatLoc, "\"%s\", ");
break;
case FST_NSString:
Diag(FormatLoc, diag::note_format_security_fixit)
<< FixItHint::CreateInsertion(FormatLoc, "@\"%@\", ");
break;
}
} else {
Diag(FormatLoc, diag::warn_format_nonliteral)
<< OrigFormatExpr->getSourceRange();
}
return false;
}
namespace {
class CheckFormatHandler : public analyze_format_string::FormatStringHandler {
protected:
Sema &S;
const FormatStringLiteral *FExpr;
const Expr *OrigFormatExpr;
const Sema::FormatStringType FSType;
const unsigned FirstDataArg;
const unsigned NumDataArgs;
const char *Beg; // Start of format string.
const bool HasVAListArg;
ArrayRef<const Expr *> Args;
unsigned FormatIdx;
llvm::SmallBitVector CoveredArgs;
bool usesPositionalArgs;
bool atFirstArg;
bool inFunctionCall;
Sema::VariadicCallType CallType;
llvm::SmallBitVector &CheckedVarArgs;
UncoveredArgHandler &UncoveredArg;
public:
CheckFormatHandler(Sema &s, const FormatStringLiteral *fexpr,
const Expr *origFormatExpr,
const Sema::FormatStringType type, unsigned firstDataArg,
unsigned numDataArgs, const char *beg, bool hasVAListArg,
ArrayRef<const Expr *> Args, unsigned formatIdx,
bool inFunctionCall, Sema::VariadicCallType callType,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg)
: S(s), FExpr(fexpr), OrigFormatExpr(origFormatExpr), FSType(type),
FirstDataArg(firstDataArg), NumDataArgs(numDataArgs), Beg(beg),
HasVAListArg(hasVAListArg), Args(Args), FormatIdx(formatIdx),
usesPositionalArgs(false), atFirstArg(true),
inFunctionCall(inFunctionCall), CallType(callType),
CheckedVarArgs(CheckedVarArgs), UncoveredArg(UncoveredArg) {
CoveredArgs.resize(numDataArgs);
CoveredArgs.reset();
}
void DoneProcessing();
void HandleIncompleteSpecifier(const char *startSpecifier,
unsigned specifierLen) override;
void HandleInvalidLengthModifier(
const analyze_format_string::FormatSpecifier &FS,
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen,
unsigned DiagID);
void HandleNonStandardLengthModifier(
const analyze_format_string::FormatSpecifier &FS,
const char *startSpecifier, unsigned specifierLen);
void HandleNonStandardConversionSpecifier(
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen);
void HandlePosition(const char *startPos, unsigned posLen) override;
void HandleInvalidPosition(const char *startSpecifier,
unsigned specifierLen,
analyze_format_string::PositionContext p) override;
void HandleZeroPosition(const char *startPos, unsigned posLen) override;
void HandleNullChar(const char *nullCharacter) override;
template <typename Range>
static void
EmitFormatDiagnostic(Sema &S, bool inFunctionCall, const Expr *ArgumentExpr,
const PartialDiagnostic &PDiag, SourceLocation StringLoc,
bool IsStringLocation, Range StringRange,
ArrayRef<FixItHint> Fixit = None);
protected:
bool HandleInvalidConversionSpecifier(unsigned argIndex, SourceLocation Loc,
const char *startSpec,
unsigned specifierLen,
const char *csStart, unsigned csLen);
void HandlePositionalNonpositionalArgs(SourceLocation Loc,
const char *startSpec,
unsigned specifierLen);
SourceRange getFormatStringRange();
CharSourceRange getSpecifierRange(const char *startSpecifier,
unsigned specifierLen);
SourceLocation getLocationOfByte(const char *x);
const Expr *getDataArg(unsigned i) const;
bool CheckNumArgs(const analyze_format_string::FormatSpecifier &FS,
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen,
unsigned argIndex);
template <typename Range>
void EmitFormatDiagnostic(PartialDiagnostic PDiag, SourceLocation StringLoc,
bool IsStringLocation, Range StringRange,
ArrayRef<FixItHint> Fixit = None);
};
} // end anonymous namespace
SourceRange CheckFormatHandler::getFormatStringRange() {
return OrigFormatExpr->getSourceRange();
}
CharSourceRange CheckFormatHandler::
getSpecifierRange(const char *startSpecifier, unsigned specifierLen) {
SourceLocation Start = getLocationOfByte(startSpecifier);
SourceLocation End = getLocationOfByte(startSpecifier + specifierLen - 1);
// Advance the end SourceLocation by one due to half-open ranges.
End = End.getLocWithOffset(1);
return CharSourceRange::getCharRange(Start, End);
}
SourceLocation CheckFormatHandler::getLocationOfByte(const char *x) {
return FExpr->getLocationOfByte(x - Beg, S.getSourceManager(),
S.getLangOpts(), S.Context.getTargetInfo());
}
void CheckFormatHandler::HandleIncompleteSpecifier(const char *startSpecifier,
unsigned specifierLen){
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_incomplete_specifier),
getLocationOfByte(startSpecifier),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
}
void CheckFormatHandler::HandleInvalidLengthModifier(
const analyze_format_string::FormatSpecifier &FS,
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen, unsigned DiagID) {
using namespace analyze_format_string;
const LengthModifier &LM = FS.getLengthModifier();
CharSourceRange LMRange = getSpecifierRange(LM.getStart(), LM.getLength());
// See if we know how to fix this length modifier.
Optional<LengthModifier> FixedLM = FS.getCorrectedLengthModifier();
if (FixedLM) {
EmitFormatDiagnostic(S.PDiag(DiagID) << LM.toString() << CS.toString(),
getLocationOfByte(LM.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
S.Diag(getLocationOfByte(LM.getStart()), diag::note_format_fix_specifier)
<< FixedLM->toString()
<< FixItHint::CreateReplacement(LMRange, FixedLM->toString());
} else {
FixItHint Hint;
if (DiagID == diag::warn_format_nonsensical_length)
Hint = FixItHint::CreateRemoval(LMRange);
EmitFormatDiagnostic(S.PDiag(DiagID) << LM.toString() << CS.toString(),
getLocationOfByte(LM.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen),
Hint);
}
}
void CheckFormatHandler::HandleNonStandardLengthModifier(
const analyze_format_string::FormatSpecifier &FS,
const char *startSpecifier, unsigned specifierLen) {
using namespace analyze_format_string;
const LengthModifier &LM = FS.getLengthModifier();
CharSourceRange LMRange = getSpecifierRange(LM.getStart(), LM.getLength());
// See if we know how to fix this length modifier.
Optional<LengthModifier> FixedLM = FS.getCorrectedLengthModifier();
if (FixedLM) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard)
<< LM.toString() << 0,
getLocationOfByte(LM.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
S.Diag(getLocationOfByte(LM.getStart()), diag::note_format_fix_specifier)
<< FixedLM->toString()
<< FixItHint::CreateReplacement(LMRange, FixedLM->toString());
} else {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard)
<< LM.toString() << 0,
getLocationOfByte(LM.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
}
}
void CheckFormatHandler::HandleNonStandardConversionSpecifier(
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen) {
using namespace analyze_format_string;
// See if we know how to fix this conversion specifier.
Optional<ConversionSpecifier> FixedCS = CS.getStandardSpecifier();
if (FixedCS) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard)
<< CS.toString() << /*conversion specifier*/1,
getLocationOfByte(CS.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
CharSourceRange CSRange = getSpecifierRange(CS.getStart(), CS.getLength());
S.Diag(getLocationOfByte(CS.getStart()), diag::note_format_fix_specifier)
<< FixedCS->toString()
<< FixItHint::CreateReplacement(CSRange, FixedCS->toString());
} else {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard)
<< CS.toString() << /*conversion specifier*/1,
getLocationOfByte(CS.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
}
}
void CheckFormatHandler::HandlePosition(const char *startPos,
unsigned posLen) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_positional_arg),
getLocationOfByte(startPos),
/*IsStringLocation*/true,
getSpecifierRange(startPos, posLen));
}
void
CheckFormatHandler::HandleInvalidPosition(const char *startPos, unsigned posLen,
analyze_format_string::PositionContext p) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_invalid_positional_specifier)
<< (unsigned) p,
getLocationOfByte(startPos), /*IsStringLocation*/true,
getSpecifierRange(startPos, posLen));
}
void CheckFormatHandler::HandleZeroPosition(const char *startPos,
unsigned posLen) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_zero_positional_specifier),
getLocationOfByte(startPos),
/*IsStringLocation*/true,
getSpecifierRange(startPos, posLen));
}
void CheckFormatHandler::HandleNullChar(const char *nullCharacter) {
if (!isa<ObjCStringLiteral>(OrigFormatExpr)) {
// The presence of a null character is likely an error.
EmitFormatDiagnostic(
S.PDiag(diag::warn_printf_format_string_contains_null_char),
getLocationOfByte(nullCharacter), /*IsStringLocation*/true,
getFormatStringRange());
}
}
// Note that this may return NULL if there was an error parsing or building
// one of the argument expressions.
const Expr *CheckFormatHandler::getDataArg(unsigned i) const {
return Args[FirstDataArg + i];
}
void CheckFormatHandler::DoneProcessing() {
// Does the number of data arguments exceed the number of
// format conversions in the format string?
if (!HasVAListArg) {
// Find any arguments that weren't covered.
CoveredArgs.flip();
signed notCoveredArg = CoveredArgs.find_first();
if (notCoveredArg >= 0) {
assert((unsigned)notCoveredArg < NumDataArgs);
UncoveredArg.Update(notCoveredArg, OrigFormatExpr);
} else {
UncoveredArg.setAllCovered();
}
}
}
void UncoveredArgHandler::Diagnose(Sema &S, bool IsFunctionCall,
const Expr *ArgExpr) {
assert(hasUncoveredArg() && DiagnosticExprs.size() > 0 &&
"Invalid state");
if (!ArgExpr)
return;
SourceLocation Loc = ArgExpr->getLocStart();
if (S.getSourceManager().isInSystemMacro(Loc))
return;
PartialDiagnostic PDiag = S.PDiag(diag::warn_printf_data_arg_not_used);
for (auto E : DiagnosticExprs)
PDiag << E->getSourceRange();
CheckFormatHandler::EmitFormatDiagnostic(
S, IsFunctionCall, DiagnosticExprs[0],
PDiag, Loc, /*IsStringLocation*/false,
DiagnosticExprs[0]->getSourceRange());
}
bool
CheckFormatHandler::HandleInvalidConversionSpecifier(unsigned argIndex,
SourceLocation Loc,
const char *startSpec,
unsigned specifierLen,
const char *csStart,
unsigned csLen) {
bool keepGoing = true;
if (argIndex < NumDataArgs) {
// Consider the argument coverered, even though the specifier doesn't
// make sense.
CoveredArgs.set(argIndex);
}
else {
// If argIndex exceeds the number of data arguments we
// don't issue a warning because that is just a cascade of warnings (and
// they may have intended '%%' anyway). We don't want to continue processing
// the format string after this point, however, as we will like just get
// gibberish when trying to match arguments.
keepGoing = false;
}
StringRef Specifier(csStart, csLen);
// If the specifier in non-printable, it could be the first byte of a UTF-8
// sequence. In that case, print the UTF-8 code point. If not, print the byte
// hex value.
std::string CodePointStr;
if (!llvm::sys::locale::isPrint(*csStart)) {
llvm::UTF32 CodePoint;
const llvm::UTF8 **B = reinterpret_cast<const llvm::UTF8 **>(&csStart);
const llvm::UTF8 *E =
reinterpret_cast<const llvm::UTF8 *>(csStart + csLen);
llvm::ConversionResult Result =
llvm::convertUTF8Sequence(B, E, &CodePoint, llvm::strictConversion);
if (Result != llvm::conversionOK) {
unsigned char FirstChar = *csStart;
CodePoint = (llvm::UTF32)FirstChar;
}
llvm::raw_string_ostream OS(CodePointStr);
if (CodePoint < 256)
OS << "\\x" << llvm::format("%02x", CodePoint);
else if (CodePoint <= 0xFFFF)
OS << "\\u" << llvm::format("%04x", CodePoint);
else
OS << "\\U" << llvm::format("%08x", CodePoint);
OS.flush();
Specifier = CodePointStr;
}
EmitFormatDiagnostic(
S.PDiag(diag::warn_format_invalid_conversion) << Specifier, Loc,
/*IsStringLocation*/ true, getSpecifierRange(startSpec, specifierLen));
return keepGoing;
}
void
CheckFormatHandler::HandlePositionalNonpositionalArgs(SourceLocation Loc,
const char *startSpec,
unsigned specifierLen) {
EmitFormatDiagnostic(
S.PDiag(diag::warn_format_mix_positional_nonpositional_args),
Loc, /*isStringLoc*/true, getSpecifierRange(startSpec, specifierLen));
}
bool
CheckFormatHandler::CheckNumArgs(
const analyze_format_string::FormatSpecifier &FS,
const analyze_format_string::ConversionSpecifier &CS,
const char *startSpecifier, unsigned specifierLen, unsigned argIndex) {
if (argIndex >= NumDataArgs) {
PartialDiagnostic PDiag = FS.usesPositionalArg()
? (S.PDiag(diag::warn_printf_positional_arg_exceeds_data_args)
<< (argIndex+1) << NumDataArgs)
: S.PDiag(diag::warn_printf_insufficient_data_args);
EmitFormatDiagnostic(
PDiag, getLocationOfByte(CS.getStart()), /*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
// Since more arguments than conversion tokens are given, by extension
// all arguments are covered, so mark this as so.
UncoveredArg.setAllCovered();
return false;
}
return true;
}
template<typename Range>
void CheckFormatHandler::EmitFormatDiagnostic(PartialDiagnostic PDiag,
SourceLocation Loc,
bool IsStringLocation,
Range StringRange,
ArrayRef<FixItHint> FixIt) {
EmitFormatDiagnostic(S, inFunctionCall, Args[FormatIdx], PDiag,
Loc, IsStringLocation, StringRange, FixIt);
}
/// \brief If the format string is not within the funcion call, emit a note
/// so that the function call and string are in diagnostic messages.
///
/// \param InFunctionCall if true, the format string is within the function
/// call and only one diagnostic message will be produced. Otherwise, an
/// extra note will be emitted pointing to location of the format string.
///
/// \param ArgumentExpr the expression that is passed as the format string
/// argument in the function call. Used for getting locations when two
/// diagnostics are emitted.
///
/// \param PDiag the callee should already have provided any strings for the
/// diagnostic message. This function only adds locations and fixits
/// to diagnostics.
///
/// \param Loc primary location for diagnostic. If two diagnostics are
/// required, one will be at Loc and a new SourceLocation will be created for
/// the other one.
///
/// \param IsStringLocation if true, Loc points to the format string should be
/// used for the note. Otherwise, Loc points to the argument list and will
/// be used with PDiag.
///
/// \param StringRange some or all of the string to highlight. This is
/// templated so it can accept either a CharSourceRange or a SourceRange.
///
/// \param FixIt optional fix it hint for the format string.
template <typename Range>
void CheckFormatHandler::EmitFormatDiagnostic(
Sema &S, bool InFunctionCall, const Expr *ArgumentExpr,
const PartialDiagnostic &PDiag, SourceLocation Loc, bool IsStringLocation,
Range StringRange, ArrayRef<FixItHint> FixIt) {
if (InFunctionCall) {
const Sema::SemaDiagnosticBuilder &D = S.Diag(Loc, PDiag);
D << StringRange;
D << FixIt;
} else {
S.Diag(IsStringLocation ? ArgumentExpr->getExprLoc() : Loc, PDiag)
<< ArgumentExpr->getSourceRange();
const Sema::SemaDiagnosticBuilder &Note =
S.Diag(IsStringLocation ? Loc : StringRange.getBegin(),
diag::note_format_string_defined);
Note << StringRange;
Note << FixIt;
}
}
//===--- CHECK: Printf format string checking ------------------------------===//
namespace {
class CheckPrintfHandler : public CheckFormatHandler {
public:
CheckPrintfHandler(Sema &s, const FormatStringLiteral *fexpr,
const Expr *origFormatExpr,
const Sema::FormatStringType type, unsigned firstDataArg,
unsigned numDataArgs, bool isObjC, const char *beg,
bool hasVAListArg, ArrayRef<const Expr *> Args,
unsigned formatIdx, bool inFunctionCall,
Sema::VariadicCallType CallType,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg)
: CheckFormatHandler(s, fexpr, origFormatExpr, type, firstDataArg,
numDataArgs, beg, hasVAListArg, Args, formatIdx,
inFunctionCall, CallType, CheckedVarArgs,
UncoveredArg) {}
bool isObjCContext() const { return FSType == Sema::FST_NSString; }
/// Returns true if '%@' specifiers are allowed in the format string.
bool allowsObjCArg() const {
return FSType == Sema::FST_NSString || FSType == Sema::FST_OSLog ||
FSType == Sema::FST_OSTrace;
}
bool HandleInvalidPrintfConversionSpecifier(
const analyze_printf::PrintfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) override;
bool HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) override;
bool checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
const char *StartSpecifier,
unsigned SpecifierLen,
const Expr *E);
bool HandleAmount(const analyze_format_string::OptionalAmount &Amt, unsigned k,
const char *startSpecifier, unsigned specifierLen);
void HandleInvalidAmount(const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalAmount &Amt,
unsigned type,
const char *startSpecifier, unsigned specifierLen);
void HandleFlag(const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalFlag &flag,
const char *startSpecifier, unsigned specifierLen);
void HandleIgnoredFlag(const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalFlag &ignoredFlag,
const analyze_printf::OptionalFlag &flag,
const char *startSpecifier, unsigned specifierLen);
bool checkForCStrMembers(const analyze_printf::ArgType &AT,
const Expr *E);
void HandleEmptyObjCModifierFlag(const char *startFlag,
unsigned flagLen) override;
void HandleInvalidObjCModifierFlag(const char *startFlag,
unsigned flagLen) override;
void HandleObjCFlagsWithNonObjCConversion(const char *flagsStart,
const char *flagsEnd,
const char *conversionPosition)
override;
};
} // end anonymous namespace
bool CheckPrintfHandler::HandleInvalidPrintfConversionSpecifier(
const analyze_printf::PrintfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) {
const analyze_printf::PrintfConversionSpecifier &CS =
FS.getConversionSpecifier();
return HandleInvalidConversionSpecifier(FS.getArgIndex(),
getLocationOfByte(CS.getStart()),
startSpecifier, specifierLen,
CS.getStart(), CS.getLength());
}
bool CheckPrintfHandler::HandleAmount(
const analyze_format_string::OptionalAmount &Amt,
unsigned k, const char *startSpecifier,
unsigned specifierLen) {
if (Amt.hasDataArgument()) {
if (!HasVAListArg) {
unsigned argIndex = Amt.getArgIndex();
if (argIndex >= NumDataArgs) {
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_asterisk_missing_arg)
<< k,
getLocationOfByte(Amt.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
// Don't do any more checking. We will just emit
// spurious errors.
return false;
}
// Type check the data argument. It should be an 'int'.
// Although not in conformance with C99, we also allow the argument to be
// an 'unsigned int' as that is a reasonably safe case. GCC also
// doesn't emit a warning for that case.
CoveredArgs.set(argIndex);
const Expr *Arg = getDataArg(argIndex);
if (!Arg)
return false;
QualType T = Arg->getType();
const analyze_printf::ArgType &AT = Amt.getArgType(S.Context);
assert(AT.isValid());
if (!AT.matchesType(S.Context, T)) {
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_asterisk_wrong_type)
<< k << AT.getRepresentativeTypeName(S.Context)
<< T << Arg->getSourceRange(),
getLocationOfByte(Amt.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen));
// Don't do any more checking. We will just emit
// spurious errors.
return false;
}
}
}
return true;
}
void CheckPrintfHandler::HandleInvalidAmount(
const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalAmount &Amt,
unsigned type,
const char *startSpecifier,
unsigned specifierLen) {
const analyze_printf::PrintfConversionSpecifier &CS =
FS.getConversionSpecifier();
FixItHint fixit =
Amt.getHowSpecified() == analyze_printf::OptionalAmount::Constant
? FixItHint::CreateRemoval(getSpecifierRange(Amt.getStart(),
Amt.getConstantLength()))
: FixItHint();
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_nonsensical_optional_amount)
<< type << CS.toString(),
getLocationOfByte(Amt.getStart()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen),
fixit);
}
void CheckPrintfHandler::HandleFlag(const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalFlag &flag,
const char *startSpecifier,
unsigned specifierLen) {
// Warn about pointless flag with a fixit removal.
const analyze_printf::PrintfConversionSpecifier &CS =
FS.getConversionSpecifier();
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_nonsensical_flag)
<< flag.toString() << CS.toString(),
getLocationOfByte(flag.getPosition()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen),
FixItHint::CreateRemoval(
getSpecifierRange(flag.getPosition(), 1)));
}
void CheckPrintfHandler::HandleIgnoredFlag(
const analyze_printf::PrintfSpecifier &FS,
const analyze_printf::OptionalFlag &ignoredFlag,
const analyze_printf::OptionalFlag &flag,
const char *startSpecifier,
unsigned specifierLen) {
// Warn about ignored flag with a fixit removal.
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_ignored_flag)
<< ignoredFlag.toString() << flag.toString(),
getLocationOfByte(ignoredFlag.getPosition()),
/*IsStringLocation*/true,
getSpecifierRange(startSpecifier, specifierLen),
FixItHint::CreateRemoval(
getSpecifierRange(ignoredFlag.getPosition(), 1)));
}
// void EmitFormatDiagnostic(PartialDiagnostic PDiag, SourceLocation StringLoc,
// bool IsStringLocation, Range StringRange,
// ArrayRef<FixItHint> Fixit = None);
void CheckPrintfHandler::HandleEmptyObjCModifierFlag(const char *startFlag,
unsigned flagLen) {
// Warn about an empty flag.
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_empty_objc_flag),
getLocationOfByte(startFlag),
/*IsStringLocation*/true,
getSpecifierRange(startFlag, flagLen));
}
void CheckPrintfHandler::HandleInvalidObjCModifierFlag(const char *startFlag,
unsigned flagLen) {
// Warn about an invalid flag.
auto Range = getSpecifierRange(startFlag, flagLen);
StringRef flag(startFlag, flagLen);
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_invalid_objc_flag) << flag,
getLocationOfByte(startFlag),
/*IsStringLocation*/true,
Range, FixItHint::CreateRemoval(Range));
}
void CheckPrintfHandler::HandleObjCFlagsWithNonObjCConversion(
const char *flagsStart, const char *flagsEnd, const char *conversionPosition) {
// Warn about using '[...]' without a '@' conversion.
auto Range = getSpecifierRange(flagsStart, flagsEnd - flagsStart + 1);
auto diag = diag::warn_printf_ObjCflags_without_ObjCConversion;
EmitFormatDiagnostic(S.PDiag(diag) << StringRef(conversionPosition, 1),
getLocationOfByte(conversionPosition),
/*IsStringLocation*/true,
Range, FixItHint::CreateRemoval(Range));
}
// Determines if the specified is a C++ class or struct containing
// a member with the specified name and kind (e.g. a CXXMethodDecl named
// "c_str()").
template<typename MemberKind>
static llvm::SmallPtrSet<MemberKind*, 1>
CXXRecordMembersNamed(StringRef Name, Sema &S, QualType Ty) {
const RecordType *RT = Ty->getAs<RecordType>();
llvm::SmallPtrSet<MemberKind*, 1> Results;
if (!RT)
return Results;
const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl());
if (!RD || !RD->getDefinition())
return Results;
LookupResult R(S, &S.Context.Idents.get(Name), SourceLocation(),
Sema::LookupMemberName);
R.suppressDiagnostics();
// We just need to include all members of the right kind turned up by the
// filter, at this point.
if (S.LookupQualifiedName(R, RT->getDecl()))
for (LookupResult::iterator I = R.begin(), E = R.end(); I != E; ++I) {
NamedDecl *decl = (*I)->getUnderlyingDecl();
if (MemberKind *FK = dyn_cast<MemberKind>(decl))
Results.insert(FK);
}
return Results;
}
/// Check if we could call '.c_str()' on an object.
///
/// FIXME: This returns the wrong results in some cases (if cv-qualifiers don't
/// allow the call, or if it would be ambiguous).
bool Sema::hasCStrMethod(const Expr *E) {
typedef llvm::SmallPtrSet<CXXMethodDecl*, 1> MethodSet;
MethodSet Results =
CXXRecordMembersNamed<CXXMethodDecl>("c_str", *this, E->getType());
for (MethodSet::iterator MI = Results.begin(), ME = Results.end();
MI != ME; ++MI)
if ((*MI)->getMinRequiredArguments() == 0)
return true;
return false;
}
// Check if a (w)string was passed when a (w)char* was needed, and offer a
// better diagnostic if so. AT is assumed to be valid.
// Returns true when a c_str() conversion method is found.
bool CheckPrintfHandler::checkForCStrMembers(
const analyze_printf::ArgType &AT, const Expr *E) {
typedef llvm::SmallPtrSet<CXXMethodDecl*, 1> MethodSet;
MethodSet Results =
CXXRecordMembersNamed<CXXMethodDecl>("c_str", S, E->getType());
for (MethodSet::iterator MI = Results.begin(), ME = Results.end();
MI != ME; ++MI) {
const CXXMethodDecl *Method = *MI;
if (Method->getMinRequiredArguments() == 0 &&
AT.matchesType(S.Context, Method->getReturnType())) {
// FIXME: Suggest parens if the expression needs them.
SourceLocation EndLoc = S.getLocForEndOfToken(E->getLocEnd());
S.Diag(E->getLocStart(), diag::note_printf_c_str)
<< "c_str()"
<< FixItHint::CreateInsertion(EndLoc, ".c_str()");
return true;
}
}
return false;
}
bool
CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier
&FS,
const char *startSpecifier,
unsigned specifierLen) {
using namespace analyze_format_string;
using namespace analyze_printf;
const PrintfConversionSpecifier &CS = FS.getConversionSpecifier();
if (FS.consumesDataArgument()) {
if (atFirstArg) {
atFirstArg = false;
usesPositionalArgs = FS.usesPositionalArg();
}
else if (usesPositionalArgs != FS.usesPositionalArg()) {
HandlePositionalNonpositionalArgs(getLocationOfByte(CS.getStart()),
startSpecifier, specifierLen);
return false;
}
}
// First check if the field width, precision, and conversion specifier
// have matching data arguments.
if (!HandleAmount(FS.getFieldWidth(), /* field width */ 0,
startSpecifier, specifierLen)) {
return false;
}
if (!HandleAmount(FS.getPrecision(), /* precision */ 1,
startSpecifier, specifierLen)) {
return false;
}
if (!CS.consumesDataArgument()) {
// FIXME: Technically specifying a precision or field width here
// makes no sense. Worth issuing a warning at some point.
return true;
}
// Consume the argument.
unsigned argIndex = FS.getArgIndex();
if (argIndex < NumDataArgs) {
// The check to see if the argIndex is valid will come later.
// We set the bit here because we may exit early from this
// function if we encounter some other error.
CoveredArgs.set(argIndex);
}
// FreeBSD kernel extensions.
if (CS.getKind() == ConversionSpecifier::FreeBSDbArg ||
CS.getKind() == ConversionSpecifier::FreeBSDDArg) {
// We need at least two arguments.
if (!CheckNumArgs(FS, CS, startSpecifier, specifierLen, argIndex + 1))
return false;
// Claim the second argument.
CoveredArgs.set(argIndex + 1);
// Type check the first argument (int for %b, pointer for %D)
const Expr *Ex = getDataArg(argIndex);
const analyze_printf::ArgType &AT =
(CS.getKind() == ConversionSpecifier::FreeBSDbArg) ?
ArgType(S.Context.IntTy) : ArgType::CPointerTy;
if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
EmitFormatDiagnostic(
S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
<< AT.getRepresentativeTypeName(S.Context) << Ex->getType()
<< false << Ex->getSourceRange(),
Ex->getLocStart(), /*IsStringLocation*/false,
getSpecifierRange(startSpecifier, specifierLen));
// Type check the second argument (char * for both %b and %D)
Ex = getDataArg(argIndex + 1);
const analyze_printf::ArgType &AT2 = ArgType::CStrTy;
if (AT2.isValid() && !AT2.matchesType(S.Context, Ex->getType()))
EmitFormatDiagnostic(
S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
<< AT2.getRepresentativeTypeName(S.Context) << Ex->getType()
<< false << Ex->getSourceRange(),
Ex->getLocStart(), /*IsStringLocation*/false,
getSpecifierRange(startSpecifier, specifierLen));
return true;
}
// Check for using an Objective-C specific conversion specifier
// in a non-ObjC literal.
if (!allowsObjCArg() && CS.isObjCArg()) {
return HandleInvalidPrintfConversionSpecifier(FS, startSpecifier,
specifierLen);
}
// %P can only be used with os_log.
if (FSType != Sema::FST_OSLog && CS.getKind() == ConversionSpecifier::PArg) {
return HandleInvalidPrintfConversionSpecifier(FS, startSpecifier,
specifierLen);
}
// %n is not allowed with os_log.
if (FSType == Sema::FST_OSLog && CS.getKind() == ConversionSpecifier::nArg) {
EmitFormatDiagnostic(S.PDiag(diag::warn_os_log_format_narg),
getLocationOfByte(CS.getStart()),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen));
return true;
}
// Only scalars are allowed for os_trace.
if (FSType == Sema::FST_OSTrace &&
(CS.getKind() == ConversionSpecifier::PArg ||
CS.getKind() == ConversionSpecifier::sArg ||
CS.getKind() == ConversionSpecifier::ObjCObjArg)) {
return HandleInvalidPrintfConversionSpecifier(FS, startSpecifier,
specifierLen);
}
// Check for use of public/private annotation outside of os_log().
if (FSType != Sema::FST_OSLog) {
if (FS.isPublic().isSet()) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_invalid_annotation)
<< "public",
getLocationOfByte(FS.isPublic().getPosition()),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen));
}
if (FS.isPrivate().isSet()) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_invalid_annotation)
<< "private",
getLocationOfByte(FS.isPrivate().getPosition()),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen));
}
}
// Check for invalid use of field width
if (!FS.hasValidFieldWidth()) {
HandleInvalidAmount(FS, FS.getFieldWidth(), /* field width */ 0,
startSpecifier, specifierLen);
}
// Check for invalid use of precision
if (!FS.hasValidPrecision()) {
HandleInvalidAmount(FS, FS.getPrecision(), /* precision */ 1,
startSpecifier, specifierLen);
}
// Precision is mandatory for %P specifier.
if (CS.getKind() == ConversionSpecifier::PArg &&
FS.getPrecision().getHowSpecified() == OptionalAmount::NotSpecified) {
EmitFormatDiagnostic(S.PDiag(diag::warn_format_P_no_precision),
getLocationOfByte(startSpecifier),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen));
}
// Check each flag does not conflict with any other component.
if (!FS.hasValidThousandsGroupingPrefix())
HandleFlag(FS, FS.hasThousandsGrouping(), startSpecifier, specifierLen);
if (!FS.hasValidLeadingZeros())
HandleFlag(FS, FS.hasLeadingZeros(), startSpecifier, specifierLen);
if (!FS.hasValidPlusPrefix())
HandleFlag(FS, FS.hasPlusPrefix(), startSpecifier, specifierLen);
if (!FS.hasValidSpacePrefix())
HandleFlag(FS, FS.hasSpacePrefix(), startSpecifier, specifierLen);
if (!FS.hasValidAlternativeForm())
HandleFlag(FS, FS.hasAlternativeForm(), startSpecifier, specifierLen);
if (!FS.hasValidLeftJustified())
HandleFlag(FS, FS.isLeftJustified(), startSpecifier, specifierLen);
// Check that flags are not ignored by another flag
if (FS.hasSpacePrefix() && FS.hasPlusPrefix()) // ' ' ignored by '+'
HandleIgnoredFlag(FS, FS.hasSpacePrefix(), FS.hasPlusPrefix(),
startSpecifier, specifierLen);
if (FS.hasLeadingZeros() && FS.isLeftJustified()) // '0' ignored by '-'
HandleIgnoredFlag(FS, FS.hasLeadingZeros(), FS.isLeftJustified(),
startSpecifier, specifierLen);
// Check the length modifier is valid with the given conversion specifier.
if (!FS.hasValidLengthModifier(S.getASTContext().getTargetInfo()))
HandleInvalidLengthModifier(FS, CS, startSpecifier, specifierLen,
diag::warn_format_nonsensical_length);
else if (!FS.hasStandardLengthModifier())
HandleNonStandardLengthModifier(FS, startSpecifier, specifierLen);
else if (!FS.hasStandardLengthConversionCombination())
HandleInvalidLengthModifier(FS, CS, startSpecifier, specifierLen,
diag::warn_format_non_standard_conversion_spec);
if (!FS.hasStandardConversionSpecifier(S.getLangOpts()))
HandleNonStandardConversionSpecifier(CS, startSpecifier, specifierLen);
// The remaining checks depend on the data arguments.
if (HasVAListArg)
return true;
if (!CheckNumArgs(FS, CS, startSpecifier, specifierLen, argIndex))
return false;
const Expr *Arg = getDataArg(argIndex);
if (!Arg)
return true;
return checkFormatExpr(FS, startSpecifier, specifierLen, Arg);
}
static bool requiresParensToAddCast(const Expr *E) {
// FIXME: We should have a general way to reason about operator
// precedence and whether parens are actually needed here.
// Take care of a few common cases where they aren't.
const Expr *Inside = E->IgnoreImpCasts();
if (const PseudoObjectExpr *POE = dyn_cast<PseudoObjectExpr>(Inside))
Inside = POE->getSyntacticForm()->IgnoreImpCasts();
switch (Inside->getStmtClass()) {
case Stmt::ArraySubscriptExprClass:
case Stmt::CallExprClass:
case Stmt::CharacterLiteralClass:
case Stmt::CXXBoolLiteralExprClass:
case Stmt::DeclRefExprClass:
case Stmt::FloatingLiteralClass:
case Stmt::IntegerLiteralClass:
case Stmt::MemberExprClass:
case Stmt::ObjCArrayLiteralClass:
case Stmt::ObjCBoolLiteralExprClass:
case Stmt::ObjCBoxedExprClass:
case Stmt::ObjCDictionaryLiteralClass:
case Stmt::ObjCEncodeExprClass:
case Stmt::ObjCIvarRefExprClass:
case Stmt::ObjCMessageExprClass:
case Stmt::ObjCPropertyRefExprClass:
case Stmt::ObjCStringLiteralClass:
case Stmt::ObjCSubscriptRefExprClass:
case Stmt::ParenExprClass:
case Stmt::StringLiteralClass:
case Stmt::UnaryOperatorClass:
return false;
default:
return true;
}
}
static std::pair<QualType, StringRef>
shouldNotPrintDirectly(const ASTContext &Context,
QualType IntendedTy,
const Expr *E) {
// Use a 'while' to peel off layers of typedefs.
QualType TyTy = IntendedTy;
while (const TypedefType *UserTy = TyTy->getAs<TypedefType>()) {
StringRef Name = UserTy->getDecl()->getName();
QualType CastTy = llvm::StringSwitch<QualType>(Name)
.Case("CFIndex", Context.LongTy)
.Case("NSInteger", Context.LongTy)
.Case("NSUInteger", Context.UnsignedLongTy)
.Case("SInt32", Context.IntTy)
.Case("UInt32", Context.UnsignedIntTy)
.Default(QualType());
if (!CastTy.isNull())
return std::make_pair(CastTy, Name);
TyTy = UserTy->desugar();
}
// Strip parens if necessary.
if (const ParenExpr *PE = dyn_cast<ParenExpr>(E))
return shouldNotPrintDirectly(Context,
PE->getSubExpr()->getType(),
PE->getSubExpr());
// If this is a conditional expression, then its result type is constructed
// via usual arithmetic conversions and thus there might be no necessary
// typedef sugar there. Recurse to operands to check for NSInteger &
// Co. usage condition.
if (const ConditionalOperator *CO = dyn_cast<ConditionalOperator>(E)) {
QualType TrueTy, FalseTy;
StringRef TrueName, FalseName;
std::tie(TrueTy, TrueName) =
shouldNotPrintDirectly(Context,
CO->getTrueExpr()->getType(),
CO->getTrueExpr());
std::tie(FalseTy, FalseName) =
shouldNotPrintDirectly(Context,
CO->getFalseExpr()->getType(),
CO->getFalseExpr());
if (TrueTy == FalseTy)
return std::make_pair(TrueTy, TrueName);
else if (TrueTy.isNull())
return std::make_pair(FalseTy, FalseName);
else if (FalseTy.isNull())
return std::make_pair(TrueTy, TrueName);
}
return std::make_pair(QualType(), StringRef());
}
bool
CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
const char *StartSpecifier,
unsigned SpecifierLen,
const Expr *E) {
using namespace analyze_format_string;
using namespace analyze_printf;
// Now type check the data expression that matches the
// format specifier.
const analyze_printf::ArgType &AT = FS.getArgType(S.Context, isObjCContext());
if (!AT.isValid())
return true;
QualType ExprTy = E->getType();
while (const TypeOfExprType *TET = dyn_cast<TypeOfExprType>(ExprTy)) {
ExprTy = TET->getUnderlyingExpr()->getType();
}
analyze_printf::ArgType::MatchKind match = AT.matchesType(S.Context, ExprTy);
if (match == analyze_printf::ArgType::Match) {
return true;
}
// Look through argument promotions for our error message's reported type.
// This includes the integral and floating promotions, but excludes array
// and function pointer decay; seeing that an argument intended to be a
// string has type 'char [6]' is probably more confusing than 'char *'.
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
if (ICE->getCastKind() == CK_IntegralCast ||
ICE->getCastKind() == CK_FloatingCast) {
E = ICE->getSubExpr();
ExprTy = E->getType();
// Check if we didn't match because of an implicit cast from a 'char'
// or 'short' to an 'int'. This is done because printf is a varargs
// function.
if (ICE->getType() == S.Context.IntTy ||
ICE->getType() == S.Context.UnsignedIntTy) {
// All further checking is done on the subexpression.
if (AT.matchesType(S.Context, ExprTy))
return true;
}
}
} else if (const CharacterLiteral *CL = dyn_cast<CharacterLiteral>(E)) {
// Special case for 'a', which has type 'int' in C.
// Note, however, that we do /not/ want to treat multibyte constants like
// 'MooV' as characters! This form is deprecated but still exists.
if (ExprTy == S.Context.IntTy)
if (llvm::isUIntN(S.Context.getCharWidth(), CL->getValue()))
ExprTy = S.Context.CharTy;
}
// Look through enums to their underlying type.
bool IsEnum = false;
if (auto EnumTy = ExprTy->getAs<EnumType>()) {
ExprTy = EnumTy->getDecl()->getIntegerType();
IsEnum = true;
}
// %C in an Objective-C context prints a unichar, not a wchar_t.
// If the argument is an integer of some kind, believe the %C and suggest
// a cast instead of changing the conversion specifier.
QualType IntendedTy = ExprTy;
if (isObjCContext() &&
FS.getConversionSpecifier().getKind() == ConversionSpecifier::CArg) {
if (ExprTy->isIntegralOrUnscopedEnumerationType() &&
!ExprTy->isCharType()) {
// 'unichar' is defined as a typedef of unsigned short, but we should
// prefer using the typedef if it is visible.
IntendedTy = S.Context.UnsignedShortTy;
// While we are here, check if the value is an IntegerLiteral that happens
// to be within the valid range.
if (const IntegerLiteral *IL = dyn_cast<IntegerLiteral>(E)) {
const llvm::APInt &V = IL->getValue();
if (V.getActiveBits() <= S.Context.getTypeSize(IntendedTy))
return true;
}
LookupResult Result(S, &S.Context.Idents.get("unichar"), E->getLocStart(),
Sema::LookupOrdinaryName);
if (S.LookupName(Result, S.getCurScope())) {
NamedDecl *ND = Result.getFoundDecl();
if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(ND))
if (TD->getUnderlyingType() == IntendedTy)
IntendedTy = S.Context.getTypedefType(TD);
}
}
}
// Special-case some of Darwin's platform-independence types by suggesting
// casts to primitive types that are known to be large enough.
bool ShouldNotPrintDirectly = false; StringRef CastTyName;
if (S.Context.getTargetInfo().getTriple().isOSDarwin()) {
QualType CastTy;
std::tie(CastTy, CastTyName) = shouldNotPrintDirectly(S.Context, IntendedTy, E);
if (!CastTy.isNull()) {
IntendedTy = CastTy;
ShouldNotPrintDirectly = true;
}
}
// We may be able to offer a FixItHint if it is a supported type.
PrintfSpecifier fixedFS = FS;
bool success =
fixedFS.fixType(IntendedTy, S.getLangOpts(), S.Context, isObjCContext());
if (success) {
// Get the fix string from the fixed format specifier
SmallString<16> buf;
llvm::raw_svector_ostream os(buf);
fixedFS.toString(os);
CharSourceRange SpecRange = getSpecifierRange(StartSpecifier, SpecifierLen);
if (IntendedTy == ExprTy && !ShouldNotPrintDirectly) {
unsigned diag = diag::warn_format_conversion_argument_type_mismatch;
if (match == analyze_format_string::ArgType::NoMatchPedantic) {
diag = diag::warn_format_conversion_argument_type_mismatch_pedantic;
}
// In this case, the specifier is wrong and should be changed to match
// the argument.
EmitFormatDiagnostic(S.PDiag(diag)
<< AT.getRepresentativeTypeName(S.Context)
<< IntendedTy << IsEnum << E->getSourceRange(),
E->getLocStart(),
/*IsStringLocation*/ false, SpecRange,
FixItHint::CreateReplacement(SpecRange, os.str()));
} else {
// The canonical type for formatting this value is different from the
// actual type of the expression. (This occurs, for example, with Darwin's
// NSInteger on 32-bit platforms, where it is typedef'd as 'int', but
// should be printed as 'long' for 64-bit compatibility.)
// Rather than emitting a normal format/argument mismatch, we want to
// add a cast to the recommended type (and correct the format string
// if necessary).
SmallString<16> CastBuf;
llvm::raw_svector_ostream CastFix(CastBuf);
CastFix << "(";
IntendedTy.print(CastFix, S.Context.getPrintingPolicy());
CastFix << ")";
SmallVector<FixItHint,4> Hints;
if (!AT.matchesType(S.Context, IntendedTy))
Hints.push_back(FixItHint::CreateReplacement(SpecRange, os.str()));
if (const CStyleCastExpr *CCast = dyn_cast<CStyleCastExpr>(E)) {
// If there's already a cast present, just replace it.
SourceRange CastRange(CCast->getLParenLoc(), CCast->getRParenLoc());
Hints.push_back(FixItHint::CreateReplacement(CastRange, CastFix.str()));
} else if (!requiresParensToAddCast(E)) {
// If the expression has high enough precedence,
// just write the C-style cast.
Hints.push_back(FixItHint::CreateInsertion(E->getLocStart(),
CastFix.str()));
} else {
// Otherwise, add parens around the expression as well as the cast.
CastFix << "(";
Hints.push_back(FixItHint::CreateInsertion(E->getLocStart(),
CastFix.str()));
SourceLocation After = S.getLocForEndOfToken(E->getLocEnd());
Hints.push_back(FixItHint::CreateInsertion(After, ")"));
}
if (ShouldNotPrintDirectly) {
// The expression has a type that should not be printed directly.
// We extract the name from the typedef because we don't want to show
// the underlying type in the diagnostic.
StringRef Name;
if (const TypedefType *TypedefTy = dyn_cast<TypedefType>(ExprTy))
Name = TypedefTy->getDecl()->getName();
else
Name = CastTyName;
EmitFormatDiagnostic(S.PDiag(diag::warn_format_argument_needs_cast)
<< Name << IntendedTy << IsEnum
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation=*/false,
SpecRange, Hints);
} else {
// In this case, the expression could be printed using a different
// specifier, but we've decided that the specifier is probably correct
// and we should cast instead. Just use the normal warning message.
EmitFormatDiagnostic(
S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
<< AT.getRepresentativeTypeName(S.Context) << ExprTy << IsEnum
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/false,
SpecRange, Hints);
}
}
} else {
const CharSourceRange &CSR = getSpecifierRange(StartSpecifier,
SpecifierLen);
// Since the warning for passing non-POD types to variadic functions
// was deferred until now, we emit a warning for non-POD
// arguments here.
switch (S.isValidVarArgType(ExprTy)) {
case Sema::VAK_Valid:
case Sema::VAK_ValidInCXX11: {
unsigned diag = diag::warn_format_conversion_argument_type_mismatch;
if (match == analyze_printf::ArgType::NoMatchPedantic) {
diag = diag::warn_format_conversion_argument_type_mismatch_pedantic;
}
EmitFormatDiagnostic(
S.PDiag(diag) << AT.getRepresentativeTypeName(S.Context) << ExprTy
<< IsEnum << CSR << E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/ false, CSR);
break;
}
case Sema::VAK_Undefined:
case Sema::VAK_MSVCUndefined:
EmitFormatDiagnostic(
S.PDiag(diag::warn_non_pod_vararg_with_format_string)
<< S.getLangOpts().CPlusPlus11
<< ExprTy
<< CallType
<< AT.getRepresentativeTypeName(S.Context)
<< CSR
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/false, CSR);
checkForCStrMembers(AT, E);
break;
case Sema::VAK_Invalid:
if (ExprTy->isObjCObjectType())
EmitFormatDiagnostic(
S.PDiag(diag::err_cannot_pass_objc_interface_to_vararg_format)
<< S.getLangOpts().CPlusPlus11
<< ExprTy
<< CallType
<< AT.getRepresentativeTypeName(S.Context)
<< CSR
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/false, CSR);
else
// FIXME: If this is an initializer list, suggest removing the braces
// or inserting a cast to the target type.
S.Diag(E->getLocStart(), diag::err_cannot_pass_to_vararg_format)
<< isa<InitListExpr>(E) << ExprTy << CallType
<< AT.getRepresentativeTypeName(S.Context)
<< E->getSourceRange();
break;
}
assert(FirstDataArg + FS.getArgIndex() < CheckedVarArgs.size() &&
"format string specifier index out of range");
CheckedVarArgs[FirstDataArg + FS.getArgIndex()] = true;
}
return true;
}
//===--- CHECK: Scanf format string checking ------------------------------===//
namespace {
class CheckScanfHandler : public CheckFormatHandler {
public:
CheckScanfHandler(Sema &s, const FormatStringLiteral *fexpr,
const Expr *origFormatExpr, Sema::FormatStringType type,
unsigned firstDataArg, unsigned numDataArgs,
const char *beg, bool hasVAListArg,
ArrayRef<const Expr *> Args, unsigned formatIdx,
bool inFunctionCall, Sema::VariadicCallType CallType,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg)
: CheckFormatHandler(s, fexpr, origFormatExpr, type, firstDataArg,
numDataArgs, beg, hasVAListArg, Args, formatIdx,
inFunctionCall, CallType, CheckedVarArgs,
UncoveredArg) {}
bool HandleScanfSpecifier(const analyze_scanf::ScanfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) override;
bool HandleInvalidScanfConversionSpecifier(
const analyze_scanf::ScanfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) override;
void HandleIncompleteScanList(const char *start, const char *end) override;
};
} // end anonymous namespace
void CheckScanfHandler::HandleIncompleteScanList(const char *start,
const char *end) {
EmitFormatDiagnostic(S.PDiag(diag::warn_scanf_scanlist_incomplete),
getLocationOfByte(end), /*IsStringLocation*/true,
getSpecifierRange(start, end - start));
}
bool CheckScanfHandler::HandleInvalidScanfConversionSpecifier(
const analyze_scanf::ScanfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) {
const analyze_scanf::ScanfConversionSpecifier &CS =
FS.getConversionSpecifier();
return HandleInvalidConversionSpecifier(FS.getArgIndex(),
getLocationOfByte(CS.getStart()),
startSpecifier, specifierLen,
CS.getStart(), CS.getLength());
}
bool CheckScanfHandler::HandleScanfSpecifier(
const analyze_scanf::ScanfSpecifier &FS,
const char *startSpecifier,
unsigned specifierLen) {
using namespace analyze_scanf;
using namespace analyze_format_string;
const ScanfConversionSpecifier &CS = FS.getConversionSpecifier();
// Handle case where '%' and '*' don't consume an argument. These shouldn't
// be used to decide if we are using positional arguments consistently.
if (FS.consumesDataArgument()) {
if (atFirstArg) {
atFirstArg = false;
usesPositionalArgs = FS.usesPositionalArg();
}
else if (usesPositionalArgs != FS.usesPositionalArg()) {
HandlePositionalNonpositionalArgs(getLocationOfByte(CS.getStart()),
startSpecifier, specifierLen);
return false;
}
}
// Check if the field with is non-zero.
const OptionalAmount &Amt = FS.getFieldWidth();
if (Amt.getHowSpecified() == OptionalAmount::Constant) {
if (Amt.getConstantAmount() == 0) {
const CharSourceRange &R = getSpecifierRange(Amt.getStart(),
Amt.getConstantLength());
EmitFormatDiagnostic(S.PDiag(diag::warn_scanf_nonzero_width),
getLocationOfByte(Amt.getStart()),
/*IsStringLocation*/true, R,
FixItHint::CreateRemoval(R));
}
}
if (!FS.consumesDataArgument()) {
// FIXME: Technically specifying a precision or field width here
// makes no sense. Worth issuing a warning at some point.
return true;
}
// Consume the argument.
unsigned argIndex = FS.getArgIndex();
if (argIndex < NumDataArgs) {
// The check to see if the argIndex is valid will come later.
// We set the bit here because we may exit early from this
// function if we encounter some other error.
CoveredArgs.set(argIndex);
}
// Check the length modifier is valid with the given conversion specifier.
if (!FS.hasValidLengthModifier(S.getASTContext().getTargetInfo()))
HandleInvalidLengthModifier(FS, CS, startSpecifier, specifierLen,
diag::warn_format_nonsensical_length);
else if (!FS.hasStandardLengthModifier())
HandleNonStandardLengthModifier(FS, startSpecifier, specifierLen);
else if (!FS.hasStandardLengthConversionCombination())
HandleInvalidLengthModifier(FS, CS, startSpecifier, specifierLen,
diag::warn_format_non_standard_conversion_spec);
if (!FS.hasStandardConversionSpecifier(S.getLangOpts()))
HandleNonStandardConversionSpecifier(CS, startSpecifier, specifierLen);
// The remaining checks depend on the data arguments.
if (HasVAListArg)
return true;
if (!CheckNumArgs(FS, CS, startSpecifier, specifierLen, argIndex))
return false;
// Check that the argument type matches the format specifier.
const Expr *Ex = getDataArg(argIndex);
if (!Ex)
return true;
const analyze_format_string::ArgType &AT = FS.getArgType(S.Context);
if (!AT.isValid()) {
return true;
}
analyze_format_string::ArgType::MatchKind match =
AT.matchesType(S.Context, Ex->getType());
if (match == analyze_format_string::ArgType::Match) {
return true;
}
ScanfSpecifier fixedFS = FS;
bool success = fixedFS.fixType(Ex->getType(), Ex->IgnoreImpCasts()->getType(),
S.getLangOpts(), S.Context);
unsigned diag = diag::warn_format_conversion_argument_type_mismatch;
if (match == analyze_format_string::ArgType::NoMatchPedantic) {
diag = diag::warn_format_conversion_argument_type_mismatch_pedantic;
}
if (success) {
// Get the fix string from the fixed format specifier.
SmallString<128> buf;
llvm::raw_svector_ostream os(buf);
fixedFS.toString(os);
EmitFormatDiagnostic(
S.PDiag(diag) << AT.getRepresentativeTypeName(S.Context)
<< Ex->getType() << false << Ex->getSourceRange(),
Ex->getLocStart(),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen),
FixItHint::CreateReplacement(
getSpecifierRange(startSpecifier, specifierLen), os.str()));
} else {
EmitFormatDiagnostic(S.PDiag(diag)
<< AT.getRepresentativeTypeName(S.Context)
<< Ex->getType() << false << Ex->getSourceRange(),
Ex->getLocStart(),
/*IsStringLocation*/ false,
getSpecifierRange(startSpecifier, specifierLen));
}
return true;
}
static void CheckFormatString(Sema &S, const FormatStringLiteral *FExpr,
const Expr *OrigFormatExpr,
ArrayRef<const Expr *> Args,
bool HasVAListArg, unsigned format_idx,
unsigned firstDataArg,
Sema::FormatStringType Type,
bool inFunctionCall,
Sema::VariadicCallType CallType,
llvm::SmallBitVector &CheckedVarArgs,
UncoveredArgHandler &UncoveredArg) {
// CHECK: is the format string a wide literal?
if (!FExpr->isAscii() && !FExpr->isUTF8()) {
CheckFormatHandler::EmitFormatDiagnostic(
S, inFunctionCall, Args[format_idx],
S.PDiag(diag::warn_format_string_is_wide_literal), FExpr->getLocStart(),
/*IsStringLocation*/true, OrigFormatExpr->getSourceRange());
return;
}
// Str - The format string. NOTE: this is NOT null-terminated!
StringRef StrRef = FExpr->getString();
const char *Str = StrRef.data();
// Account for cases where the string literal is truncated in a declaration.
const ConstantArrayType *T =
S.Context.getAsConstantArrayType(FExpr->getType());
assert(T && "String literal not of constant array type!");
size_t TypeSize = T->getSize().getZExtValue();
size_t StrLen = std::min(std::max(TypeSize, size_t(1)) - 1, StrRef.size());
const unsigned numDataArgs = Args.size() - firstDataArg;
// Emit a warning if the string literal is truncated and does not contain an
// embedded null character.
if (TypeSize <= StrRef.size() &&
StrRef.substr(0, TypeSize).find('\0') == StringRef::npos) {
CheckFormatHandler::EmitFormatDiagnostic(
S, inFunctionCall, Args[format_idx],
S.PDiag(diag::warn_printf_format_string_not_null_terminated),
FExpr->getLocStart(),
/*IsStringLocation=*/true, OrigFormatExpr->getSourceRange());
return;
}
// CHECK: empty format string?
if (StrLen == 0 && numDataArgs > 0) {
CheckFormatHandler::EmitFormatDiagnostic(
S, inFunctionCall, Args[format_idx],
S.PDiag(diag::warn_empty_format_string), FExpr->getLocStart(),
/*IsStringLocation*/true, OrigFormatExpr->getSourceRange());
return;
}
if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
Type == Sema::FST_FreeBSDKPrintf || Type == Sema::FST_OSLog ||
Type == Sema::FST_OSTrace) {
CheckPrintfHandler H(
S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
(Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str,
HasVAListArg, Args, format_idx, inFunctionCall, CallType,
CheckedVarArgs, UncoveredArg);
if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
S.getLangOpts(),
S.Context.getTargetInfo(),
Type == Sema::FST_FreeBSDKPrintf))
H.DoneProcessing();
} else if (Type == Sema::FST_Scanf) {
CheckScanfHandler H(S, FExpr, OrigFormatExpr, Type, firstDataArg,
numDataArgs, Str, HasVAListArg, Args, format_idx,
inFunctionCall, CallType, CheckedVarArgs, UncoveredArg);
if (!analyze_format_string::ParseScanfString(H, Str, Str + StrLen,
S.getLangOpts(),
S.Context.getTargetInfo()))
H.DoneProcessing();
} // TODO: handle other formats
}
bool Sema::FormatStringHasSArg(const StringLiteral *FExpr) {
// Str - The format string. NOTE: this is NOT null-terminated!
StringRef StrRef = FExpr->getString();
const char *Str = StrRef.data();
// Account for cases where the string literal is truncated in a declaration.
const ConstantArrayType *T = Context.getAsConstantArrayType(FExpr->getType());
assert(T && "String literal not of constant array type!");
size_t TypeSize = T->getSize().getZExtValue();
size_t StrLen = std::min(std::max(TypeSize, size_t(1)) - 1, StrRef.size());
return analyze_format_string::ParseFormatStringHasSArg(Str, Str + StrLen,
getLangOpts(),
Context.getTargetInfo());
}
//===--- CHECK: Warn on use of wrong absolute value function. -------------===//
// Returns the related absolute value function that is larger, of 0 if one
// does not exist.
static unsigned getLargerAbsoluteValueFunction(unsigned AbsFunction) {
switch (AbsFunction) {
default:
return 0;
case Builtin::BI__builtin_abs:
return Builtin::BI__builtin_labs;
case Builtin::BI__builtin_labs:
return Builtin::BI__builtin_llabs;
case Builtin::BI__builtin_llabs:
return 0;
case Builtin::BI__builtin_fabsf:
return Builtin::BI__builtin_fabs;
case Builtin::BI__builtin_fabs:
return Builtin::BI__builtin_fabsl;
case Builtin::BI__builtin_fabsl:
return 0;
case Builtin::BI__builtin_cabsf:
return Builtin::BI__builtin_cabs;
case Builtin::BI__builtin_cabs:
return Builtin::BI__builtin_cabsl;
case Builtin::BI__builtin_cabsl:
return 0;
case Builtin::BIabs:
return Builtin::BIlabs;
case Builtin::BIlabs:
return Builtin::BIllabs;
case Builtin::BIllabs:
return 0;
case Builtin::BIfabsf:
return Builtin::BIfabs;
case Builtin::BIfabs:
return Builtin::BIfabsl;
case Builtin::BIfabsl:
return 0;
case Builtin::BIcabsf:
return Builtin::BIcabs;
case Builtin::BIcabs:
return Builtin::BIcabsl;
case Builtin::BIcabsl:
return 0;
}
}
// Returns the argument type of the absolute value function.
static QualType getAbsoluteValueArgumentType(ASTContext &Context,
unsigned AbsType) {
if (AbsType == 0)
return QualType();
ASTContext::GetBuiltinTypeError Error = ASTContext::GE_None;
QualType BuiltinType = Context.GetBuiltinType(AbsType, Error);
if (Error != ASTContext::GE_None)
return QualType();
const FunctionProtoType *FT = BuiltinType->getAs<FunctionProtoType>();
if (!FT)
return QualType();
if (FT->getNumParams() != 1)
return QualType();
return FT->getParamType(0);
}
// Returns the best absolute value function, or zero, based on type and
// current absolute value function.
static unsigned getBestAbsFunction(ASTContext &Context, QualType ArgType,
unsigned AbsFunctionKind) {
unsigned BestKind = 0;
uint64_t ArgSize = Context.getTypeSize(ArgType);
for (unsigned Kind = AbsFunctionKind; Kind != 0;
Kind = getLargerAbsoluteValueFunction(Kind)) {
QualType ParamType = getAbsoluteValueArgumentType(Context, Kind);
if (Context.getTypeSize(ParamType) >= ArgSize) {
if (BestKind == 0)
BestKind = Kind;
else if (Context.hasSameType(ParamType, ArgType)) {
BestKind = Kind;
break;
}
}
}
return BestKind;
}
enum AbsoluteValueKind {
AVK_Integer,
AVK_Floating,
AVK_Complex
};
static AbsoluteValueKind getAbsoluteValueKind(QualType T) {
if (T->isIntegralOrEnumerationType())
return AVK_Integer;
if (T->isRealFloatingType())
return AVK_Floating;
if (T->isAnyComplexType())
return AVK_Complex;
llvm_unreachable("Type not integer, floating, or complex");
}
// Changes the absolute value function to a different type. Preserves whether
// the function is a builtin.
static unsigned changeAbsFunction(unsigned AbsKind,
AbsoluteValueKind ValueKind) {
switch (ValueKind) {
case AVK_Integer:
switch (AbsKind) {
default:
return 0;
case Builtin::BI__builtin_fabsf:
case Builtin::BI__builtin_fabs:
case Builtin::BI__builtin_fabsl:
case Builtin::BI__builtin_cabsf:
case Builtin::BI__builtin_cabs:
case Builtin::BI__builtin_cabsl:
return Builtin::BI__builtin_abs;
case Builtin::BIfabsf:
case Builtin::BIfabs:
case Builtin::BIfabsl:
case Builtin::BIcabsf:
case Builtin::BIcabs:
case Builtin::BIcabsl:
return Builtin::BIabs;
}
case AVK_Floating:
switch (AbsKind) {
default:
return 0;
case Builtin::BI__builtin_abs:
case Builtin::BI__builtin_labs:
case Builtin::BI__builtin_llabs:
case Builtin::BI__builtin_cabsf:
case Builtin::BI__builtin_cabs:
case Builtin::BI__builtin_cabsl:
return Builtin::BI__builtin_fabsf;
case Builtin::BIabs:
case Builtin::BIlabs:
case Builtin::BIllabs:
case Builtin::BIcabsf:
case Builtin::BIcabs:
case Builtin::BIcabsl:
return Builtin::BIfabsf;
}
case AVK_Complex:
switch (AbsKind) {
default:
return 0;
case Builtin::BI__builtin_abs:
case Builtin::BI__builtin_labs:
case Builtin::BI__builtin_llabs:
case Builtin::BI__builtin_fabsf:
case Builtin::BI__builtin_fabs:
case Builtin::BI__builtin_fabsl:
return Builtin::BI__builtin_cabsf;
case Builtin::BIabs:
case Builtin::BIlabs:
case Builtin::BIllabs:
case Builtin::BIfabsf:
case Builtin::BIfabs:
case Builtin::BIfabsl:
return Builtin::BIcabsf;
}
}
llvm_unreachable("Unable to convert function");
}
static unsigned getAbsoluteValueFunctionKind(const FunctionDecl *FDecl) {
const IdentifierInfo *FnInfo = FDecl->getIdentifier();
if (!FnInfo)
return 0;
switch (FDecl->getBuiltinID()) {
default:
return 0;
case Builtin::BI__builtin_abs:
case Builtin::BI__builtin_fabs:
case Builtin::BI__builtin_fabsf:
case Builtin::BI__builtin_fabsl:
case Builtin::BI__builtin_labs:
case Builtin::BI__builtin_llabs:
case Builtin::BI__builtin_cabs:
case Builtin::BI__builtin_cabsf:
case Builtin::BI__builtin_cabsl:
case Builtin::BIabs:
case Builtin::BIlabs:
case Builtin::BIllabs:
case Builtin::BIfabs:
case Builtin::BIfabsf:
case Builtin::BIfabsl:
case Builtin::BIcabs:
case Builtin::BIcabsf:
case Builtin::BIcabsl:
return FDecl->getBuiltinID();
}
llvm_unreachable("Unknown Builtin type");
}
// If the replacement is valid, emit a note with replacement function.
// Additionally, suggest including the proper header if not already included.
static void emitReplacement(Sema &S, SourceLocation Loc, SourceRange Range,
unsigned AbsKind, QualType ArgType) {
bool EmitHeaderHint = true;
const char *HeaderName = nullptr;
const char *FunctionName = nullptr;
if (S.getLangOpts().CPlusPlus && !ArgType->isAnyComplexType()) {
FunctionName = "std::abs";
if (ArgType->isIntegralOrEnumerationType()) {
HeaderName = "cstdlib";
} else if (ArgType->isRealFloatingType()) {
HeaderName = "cmath";
} else {
llvm_unreachable("Invalid Type");
}
// Lookup all std::abs
if (NamespaceDecl *Std = S.getStdNamespace()) {
LookupResult R(S, &S.Context.Idents.get("abs"), Loc, Sema::LookupAnyName);
R.suppressDiagnostics();
S.LookupQualifiedName(R, Std);
for (const auto *I : R) {
const FunctionDecl *FDecl = nullptr;
if (const UsingShadowDecl *UsingD = dyn_cast<UsingShadowDecl>(I)) {
FDecl = dyn_cast<FunctionDecl>(UsingD->getTargetDecl());
} else {
FDecl = dyn_cast<FunctionDecl>(I);
}
if (!FDecl)
continue;
// Found std::abs(), check that they are the right ones.
if (FDecl->getNumParams() != 1)
continue;
// Check that the parameter type can handle the argument.
QualType ParamType = FDecl->getParamDecl(0)->getType();
if (getAbsoluteValueKind(ArgType) == getAbsoluteValueKind(ParamType) &&
S.Context.getTypeSize(ArgType) <=
S.Context.getTypeSize(ParamType)) {
// Found a function, don't need the header hint.
EmitHeaderHint = false;
break;
}
}
}
} else {
FunctionName = S.Context.BuiltinInfo.getName(AbsKind);
HeaderName = S.Context.BuiltinInfo.getHeaderName(AbsKind);
if (HeaderName) {
DeclarationName DN(&S.Context.Idents.get(FunctionName));
LookupResult R(S, DN, Loc, Sema::LookupAnyName);
R.suppressDiagnostics();
S.LookupName(R, S.getCurScope());
if (R.isSingleResult()) {
FunctionDecl *FD = dyn_cast<FunctionDecl>(R.getFoundDecl());
if (FD && FD->getBuiltinID() == AbsKind) {
EmitHeaderHint = false;
} else {
return;
}
} else if (!R.empty()) {
return;
}
}
}
S.Diag(Loc, diag::note_replace_abs_function)
<< FunctionName << FixItHint::CreateReplacement(Range, FunctionName);
if (!HeaderName)
return;
if (!EmitHeaderHint)
return;
S.Diag(Loc, diag::note_include_header_or_declare) << HeaderName
<< FunctionName;
}
template <std::size_t StrLen>
static bool IsStdFunction(const FunctionDecl *FDecl,
const char (&Str)[StrLen]) {
if (!FDecl)
return false;
if (!FDecl->getIdentifier() || !FDecl->getIdentifier()->isStr(Str))
return false;
if (!FDecl->isInStdNamespace())
return false;
return true;
}
// Warn when using the wrong abs() function.
void Sema::CheckAbsoluteValueFunction(const CallExpr *Call,
const FunctionDecl *FDecl) {
if (Call->getNumArgs() != 1)
return;
unsigned AbsKind = getAbsoluteValueFunctionKind(FDecl);
bool IsStdAbs = IsStdFunction(FDecl, "abs");
if (AbsKind == 0 && !IsStdAbs)
return;
QualType ArgType = Call->getArg(0)->IgnoreParenImpCasts()->getType();
QualType ParamType = Call->getArg(0)->getType();
// Unsigned types cannot be negative. Suggest removing the absolute value
// function call.
if (ArgType->isUnsignedIntegerType()) {
const char *FunctionName =
IsStdAbs ? "std::abs" : Context.BuiltinInfo.getName(AbsKind);
Diag(Call->getExprLoc(), diag::warn_unsigned_abs) << ArgType << ParamType;
Diag(Call->getExprLoc(), diag::note_remove_abs)
<< FunctionName
<< FixItHint::CreateRemoval(Call->getCallee()->getSourceRange());
return;
}
// Taking the absolute value of a pointer is very suspicious, they probably
// wanted to index into an array, dereference a pointer, call a function, etc.
if (ArgType->isPointerType() || ArgType->canDecayToPointerType()) {
unsigned DiagType = 0;
if (ArgType->isFunctionType())
DiagType = 1;
else if (ArgType->isArrayType())
DiagType = 2;
Diag(Call->getExprLoc(), diag::warn_pointer_abs) << DiagType << ArgType;
return;
}
// std::abs has overloads which prevent most of the absolute value problems
// from occurring.
if (IsStdAbs)
return;
AbsoluteValueKind ArgValueKind = getAbsoluteValueKind(ArgType);
AbsoluteValueKind ParamValueKind = getAbsoluteValueKind(ParamType);
// The argument and parameter are the same kind. Check if they are the right
// size.
if (ArgValueKind == ParamValueKind) {
if (Context.getTypeSize(ArgType) <= Context.getTypeSize(ParamType))
return;
unsigned NewAbsKind = getBestAbsFunction(Context, ArgType, AbsKind);
Diag(Call->getExprLoc(), diag::warn_abs_too_small)
<< FDecl << ArgType << ParamType;
if (NewAbsKind == 0)
return;
emitReplacement(*this, Call->getExprLoc(),
Call->getCallee()->getSourceRange(), NewAbsKind, ArgType);
return;
}
// ArgValueKind != ParamValueKind
// The wrong type of absolute value function was used. Attempt to find the
// proper one.
unsigned NewAbsKind = changeAbsFunction(AbsKind, ArgValueKind);
NewAbsKind = getBestAbsFunction(Context, ArgType, NewAbsKind);
if (NewAbsKind == 0)
return;
Diag(Call->getExprLoc(), diag::warn_wrong_absolute_value_type)
<< FDecl << ParamValueKind << ArgValueKind;
emitReplacement(*this, Call->getExprLoc(),
Call->getCallee()->getSourceRange(), NewAbsKind, ArgType);
}
//===--- CHECK: Warn on use of std::max and unsigned zero. r---------------===//
void Sema::CheckMaxUnsignedZero(const CallExpr *Call,
const FunctionDecl *FDecl) {
if (!Call || !FDecl) return;
// Ignore template specializations and macros.
if (inTemplateInstantiation()) return;
if (Call->getExprLoc().isMacroID()) return;
// Only care about the one template argument, two function parameter std::max
if (Call->getNumArgs() != 2) return;
if (!IsStdFunction(FDecl, "max")) return;
const auto * ArgList = FDecl->getTemplateSpecializationArgs();
if (!ArgList) return;
if (ArgList->size() != 1) return;
// Check that template type argument is unsigned integer.
const auto& TA = ArgList->get(0);
if (TA.getKind() != TemplateArgument::Type) return;
QualType ArgType = TA.getAsType();
if (!ArgType->isUnsignedIntegerType()) return;
// See if either argument is a literal zero.
auto IsLiteralZeroArg = [](const Expr* E) -> bool {
const auto *MTE = dyn_cast<MaterializeTemporaryExpr>(E);
if (!MTE) return false;
const auto *Num = dyn_cast<IntegerLiteral>(MTE->GetTemporaryExpr());
if (!Num) return false;
if (Num->getValue() != 0) return false;
return true;
};
const Expr *FirstArg = Call->getArg(0);
const Expr *SecondArg = Call->getArg(1);
const bool IsFirstArgZero = IsLiteralZeroArg(FirstArg);
const bool IsSecondArgZero = IsLiteralZeroArg(SecondArg);
// Only warn when exactly one argument is zero.
if (IsFirstArgZero == IsSecondArgZero) return;
SourceRange FirstRange = FirstArg->getSourceRange();
SourceRange SecondRange = SecondArg->getSourceRange();
SourceRange ZeroRange = IsFirstArgZero ? FirstRange : SecondRange;
Diag(Call->getExprLoc(), diag::warn_max_unsigned_zero)
<< IsFirstArgZero << Call->getCallee()->getSourceRange() << ZeroRange;
// Deduce what parts to remove so that "std::max(0u, foo)" becomes "(foo)".
SourceRange RemovalRange;
if (IsFirstArgZero) {
RemovalRange = SourceRange(FirstRange.getBegin(),
SecondRange.getBegin().getLocWithOffset(-1));
} else {
RemovalRange = SourceRange(getLocForEndOfToken(FirstRange.getEnd()),
SecondRange.getEnd());
}
Diag(Call->getExprLoc(), diag::note_remove_max_call)
<< FixItHint::CreateRemoval(Call->getCallee()->getSourceRange())
<< FixItHint::CreateRemoval(RemovalRange);
}
//===--- CHECK: Standard memory functions ---------------------------------===//
/// \brief Takes the expression passed to the size_t parameter of functions
/// such as memcmp, strncat, etc and warns if it's a comparison.
///
/// This is to catch typos like `if (memcmp(&a, &b, sizeof(a) > 0))`.
static bool CheckMemorySizeofForComparison(Sema &S, const Expr *E,
IdentifierInfo *FnName,
SourceLocation FnLoc,
SourceLocation RParenLoc) {
const BinaryOperator *Size = dyn_cast<BinaryOperator>(E);
if (!Size)
return false;
// if E is binop and op is >, <, >=, <=, ==, &&, ||:
if (!Size->isComparisonOp() && !Size->isEqualityOp() && !Size->isLogicalOp())
return false;
SourceRange SizeRange = Size->getSourceRange();
S.Diag(Size->getOperatorLoc(), diag::warn_memsize_comparison)
<< SizeRange << FnName;
S.Diag(FnLoc, diag::note_memsize_comparison_paren)
<< FnName << FixItHint::CreateInsertion(
S.getLocForEndOfToken(Size->getLHS()->getLocEnd()), ")")
<< FixItHint::CreateRemoval(RParenLoc);
S.Diag(SizeRange.getBegin(), diag::note_memsize_comparison_cast_silence)
<< FixItHint::CreateInsertion(SizeRange.getBegin(), "(size_t)(")
<< FixItHint::CreateInsertion(S.getLocForEndOfToken(SizeRange.getEnd()),
")");
return true;
}
/// \brief Determine whether the given type is or contains a dynamic class type
/// (e.g., whether it has a vtable).
static const CXXRecordDecl *getContainedDynamicClass(QualType T,
bool &IsContained) {
// Look through array types while ignoring qualifiers.
const Type *Ty = T->getBaseElementTypeUnsafe();
IsContained = false;
const CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
RD = RD ? RD->getDefinition() : nullptr;
if (!RD || RD->isInvalidDecl())
return nullptr;
if (RD->isDynamicClass())
return RD;
// Check all the fields. If any bases were dynamic, the class is dynamic.
// It's impossible for a class to transitively contain itself by value, so
// infinite recursion is impossible.
for (auto *FD : RD->fields()) {
bool SubContained;
if (const CXXRecordDecl *ContainedRD =
getContainedDynamicClass(FD->getType(), SubContained)) {
IsContained = true;
return ContainedRD;
}
}
return nullptr;
}
/// \brief If E is a sizeof expression, returns its argument expression,
/// otherwise returns NULL.
static const Expr *getSizeOfExprArg(const Expr *E) {
if (const UnaryExprOrTypeTraitExpr *SizeOf =
dyn_cast<UnaryExprOrTypeTraitExpr>(E))
if (SizeOf->getKind() == clang::UETT_SizeOf && !SizeOf->isArgumentType())
return SizeOf->getArgumentExpr()->IgnoreParenImpCasts();
return nullptr;
}
/// \brief If E is a sizeof expression, returns its argument type.
static QualType getSizeOfArgType(const Expr *E) {
if (const UnaryExprOrTypeTraitExpr *SizeOf =
dyn_cast<UnaryExprOrTypeTraitExpr>(E))
if (SizeOf->getKind() == clang::UETT_SizeOf)
return SizeOf->getTypeOfArgument();
return QualType();
}
/// \brief Check for dangerous or invalid arguments to memset().
///
/// This issues warnings on known problematic, dangerous or unspecified
/// arguments to the standard 'memset', 'memcpy', 'memmove', and 'memcmp'
/// function calls.
///
/// \param Call The call expression to diagnose.
void Sema::CheckMemaccessArguments(const CallExpr *Call,
unsigned BId,
IdentifierInfo *FnName) {
assert(BId != 0);
// It is possible to have a non-standard definition of memset. Validate
// we have enough arguments, and if not, abort further checking.
unsigned ExpectedNumArgs =
(BId == Builtin::BIstrndup || BId == Builtin::BIbzero ? 2 : 3);
if (Call->getNumArgs() < ExpectedNumArgs)
return;
unsigned LastArg = (BId == Builtin::BImemset || BId == Builtin::BIbzero ||
BId == Builtin::BIstrndup ? 1 : 2);
unsigned LenArg =
(BId == Builtin::BIbzero || BId == Builtin::BIstrndup ? 1 : 2);
const Expr *LenExpr = Call->getArg(LenArg)->IgnoreParenImpCasts();
if (CheckMemorySizeofForComparison(*this, LenExpr, FnName,
Call->getLocStart(), Call->getRParenLoc()))
return;
// We have special checking when the length is a sizeof expression.
QualType SizeOfArgTy = getSizeOfArgType(LenExpr);
const Expr *SizeOfArg = getSizeOfExprArg(LenExpr);
llvm::FoldingSetNodeID SizeOfArgID;
// Although widely used, 'bzero' is not a standard function. Be more strict
// with the argument types before allowing diagnostics and only allow the
// form bzero(ptr, sizeof(...)).
QualType FirstArgTy = Call->getArg(0)->IgnoreParenImpCasts()->getType();
if (BId == Builtin::BIbzero && !FirstArgTy->getAs<PointerType>())
return;
for (unsigned ArgIdx = 0; ArgIdx != LastArg; ++ArgIdx) {
const Expr *Dest = Call->getArg(ArgIdx)->IgnoreParenImpCasts();
SourceRange ArgRange = Call->getArg(ArgIdx)->getSourceRange();
QualType DestTy = Dest->getType();
QualType PointeeTy;
if (const PointerType *DestPtrTy = DestTy->getAs<PointerType>()) {
PointeeTy = DestPtrTy->getPointeeType();
// Never warn about void type pointers. This can be used to suppress
// false positives.
if (PointeeTy->isVoidType())
continue;
// Catch "memset(p, 0, sizeof(p))" -- needs to be sizeof(*p). Do this by
// actually comparing the expressions for equality. Because computing the
// expression IDs can be expensive, we only do this if the diagnostic is
// enabled.
if (SizeOfArg &&
!Diags.isIgnored(diag::warn_sizeof_pointer_expr_memaccess,
SizeOfArg->getExprLoc())) {
// We only compute IDs for expressions if the warning is enabled, and
// cache the sizeof arg's ID.
if (SizeOfArgID == llvm::FoldingSetNodeID())
SizeOfArg->Profile(SizeOfArgID, Context, true);
llvm::FoldingSetNodeID DestID;
Dest->Profile(DestID, Context, true);
if (DestID == SizeOfArgID) {
// TODO: For strncpy() and friends, this could suggest sizeof(dst)
// over sizeof(src) as well.
unsigned ActionIdx = 0; // Default is to suggest dereferencing.
StringRef ReadableName = FnName->getName();
if (const UnaryOperator *UnaryOp = dyn_cast<UnaryOperator>(Dest))
if (UnaryOp->getOpcode() == UO_AddrOf)
ActionIdx = 1; // If its an address-of operator, just remove it.
if (!PointeeTy->isIncompleteType() &&
(Context.getTypeSize(PointeeTy) == Context.getCharWidth()))
ActionIdx = 2; // If the pointee's size is sizeof(char),
// suggest an explicit length.
// If the function is defined as a builtin macro, do not show macro
// expansion.
SourceLocation SL = SizeOfArg->getExprLoc();
SourceRange DSR = Dest->getSourceRange();
SourceRange SSR = SizeOfArg->getSourceRange();
SourceManager &SM = getSourceManager();
if (SM.isMacroArgExpansion(SL)) {
ReadableName = Lexer::getImmediateMacroName(SL, SM, LangOpts);
SL = SM.getSpellingLoc(SL);
DSR = SourceRange(SM.getSpellingLoc(DSR.getBegin()),
SM.getSpellingLoc(DSR.getEnd()));
SSR = SourceRange(SM.getSpellingLoc(SSR.getBegin()),
SM.getSpellingLoc(SSR.getEnd()));
}
DiagRuntimeBehavior(SL, SizeOfArg,
PDiag(diag::warn_sizeof_pointer_expr_memaccess)
<< ReadableName
<< PointeeTy
<< DestTy
<< DSR
<< SSR);
DiagRuntimeBehavior(SL, SizeOfArg,
PDiag(diag::warn_sizeof_pointer_expr_memaccess_note)
<< ActionIdx
<< SSR);
break;
}
}
// Also check for cases where the sizeof argument is the exact same
// type as the memory argument, and where it points to a user-defined
// record type.
if (SizeOfArgTy != QualType()) {
if (PointeeTy->isRecordType() &&
Context.typesAreCompatible(SizeOfArgTy, DestTy)) {
DiagRuntimeBehavior(LenExpr->getExprLoc(), Dest,
PDiag(diag::warn_sizeof_pointer_type_memaccess)
<< FnName << SizeOfArgTy << ArgIdx
<< PointeeTy << Dest->getSourceRange()
<< LenExpr->getSourceRange());
break;
}
}
} else if (DestTy->isArrayType()) {
PointeeTy = DestTy;
}
if (PointeeTy == QualType())
continue;
// Always complain about dynamic classes.
bool IsContained;
if (const CXXRecordDecl *ContainedRD =
getContainedDynamicClass(PointeeTy, IsContained)) {
unsigned OperationType = 0;
// "overwritten" if we're warning about the destination for any call
// but memcmp; otherwise a verb appropriate to the call.
if (ArgIdx != 0 || BId == Builtin::BImemcmp) {
if (BId == Builtin::BImemcpy)
OperationType = 1;
else if(BId == Builtin::BImemmove)
OperationType = 2;
else if (BId == Builtin::BImemcmp)
OperationType = 3;
}
DiagRuntimeBehavior(
Dest->getExprLoc(), Dest,
PDiag(diag::warn_dyn_class_memaccess)
<< (BId == Builtin::BImemcmp ? ArgIdx + 2 : ArgIdx)
<< FnName << IsContained << ContainedRD << OperationType
<< Call->getCallee()->getSourceRange());
} else if (PointeeTy.hasNonTrivialObjCLifetime() &&
BId != Builtin::BImemset)
DiagRuntimeBehavior(
Dest->getExprLoc(), Dest,
PDiag(diag::warn_arc_object_memaccess)
<< ArgIdx << FnName << PointeeTy
<< Call->getCallee()->getSourceRange());
else
continue;
DiagRuntimeBehavior(
Dest->getExprLoc(), Dest,
PDiag(diag::note_bad_memaccess_silence)
<< FixItHint::CreateInsertion(ArgRange.getBegin(), "(void*)"));
break;
}
}
// A little helper routine: ignore addition and subtraction of integer literals.
// This intentionally does not ignore all integer constant expressions because
// we don't want to remove sizeof().
static const Expr *ignoreLiteralAdditions(const Expr *Ex, ASTContext &Ctx) {
Ex = Ex->IgnoreParenCasts();
for (;;) {
const BinaryOperator * BO = dyn_cast<BinaryOperator>(Ex);
if (!BO || !BO->isAdditiveOp())
break;
const Expr *RHS = BO->getRHS()->IgnoreParenCasts();
const Expr *LHS = BO->getLHS()->IgnoreParenCasts();
if (isa<IntegerLiteral>(RHS))
Ex = LHS;
else if (isa<IntegerLiteral>(LHS))
Ex = RHS;
else
break;
}
return Ex;
}
static bool isConstantSizeArrayWithMoreThanOneElement(QualType Ty,
ASTContext &Context) {
// Only handle constant-sized or VLAs, but not flexible members.
if (const ConstantArrayType *CAT = Context.getAsConstantArrayType(Ty)) {
// Only issue the FIXIT for arrays of size > 1.
if (CAT->getSize().getSExtValue() <= 1)
return false;
} else if (!Ty->isVariableArrayType()) {
return false;
}
return true;
}
// Warn if the user has made the 'size' argument to strlcpy or strlcat
// be the size of the source, instead of the destination.
void Sema::CheckStrlcpycatArguments(const CallExpr *Call,
IdentifierInfo *FnName) {
// Don't crash if the user has the wrong number of arguments
unsigned NumArgs = Call->getNumArgs();
if ((NumArgs != 3) && (NumArgs != 4))
return;
const Expr *SrcArg = ignoreLiteralAdditions(Call->getArg(1), Context);
const Expr *SizeArg = ignoreLiteralAdditions(Call->getArg(2), Context);
const Expr *CompareWithSrc = nullptr;
if (CheckMemorySizeofForComparison(*this, SizeArg, FnName,
Call->getLocStart(), Call->getRParenLoc()))
return;
// Look for 'strlcpy(dst, x, sizeof(x))'
if (const Expr *Ex = getSizeOfExprArg(SizeArg))
CompareWithSrc = Ex;
else {
// Look for 'strlcpy(dst, x, strlen(x))'
if (const CallExpr *SizeCall = dyn_cast<CallExpr>(SizeArg)) {
if (SizeCall->getBuiltinCallee() == Builtin::BIstrlen &&
SizeCall->getNumArgs() == 1)
CompareWithSrc = ignoreLiteralAdditions(SizeCall->getArg(0), Context);
}
}
if (!CompareWithSrc)
return;
// Determine if the argument to sizeof/strlen is equal to the source
// argument. In principle there's all kinds of things you could do
// here, for instance creating an == expression and evaluating it with
// EvaluateAsBooleanCondition, but this uses a more direct technique:
const DeclRefExpr *SrcArgDRE = dyn_cast<DeclRefExpr>(SrcArg);
if (!SrcArgDRE)
return;
const DeclRefExpr *CompareWithSrcDRE = dyn_cast<DeclRefExpr>(CompareWithSrc);
if (!CompareWithSrcDRE ||
SrcArgDRE->getDecl() != CompareWithSrcDRE->getDecl())
return;
const Expr *OriginalSizeArg = Call->getArg(2);
Diag(CompareWithSrcDRE->getLocStart(), diag::warn_strlcpycat_wrong_size)
<< OriginalSizeArg->getSourceRange() << FnName;
// Output a FIXIT hint if the destination is an array (rather than a
// pointer to an array). This could be enhanced to handle some
// pointers if we know the actual size, like if DstArg is 'array+2'
// we could say 'sizeof(array)-2'.
const Expr *DstArg = Call->getArg(0)->IgnoreParenImpCasts();
if (!isConstantSizeArrayWithMoreThanOneElement(DstArg->getType(), Context))
return;
SmallString<128> sizeString;
llvm::raw_svector_ostream OS(sizeString);
OS << "sizeof(";
DstArg->printPretty(OS, nullptr, getPrintingPolicy());
OS << ")";
Diag(OriginalSizeArg->getLocStart(), diag::note_strlcpycat_wrong_size)
<< FixItHint::CreateReplacement(OriginalSizeArg->getSourceRange(),
OS.str());
}
/// Check if two expressions refer to the same declaration.
static bool referToTheSameDecl(const Expr *E1, const Expr *E2) {
if (const DeclRefExpr *D1 = dyn_cast_or_null<DeclRefExpr>(E1))
if (const DeclRefExpr *D2 = dyn_cast_or_null<DeclRefExpr>(E2))
return D1->getDecl() == D2->getDecl();
return false;
}
static const Expr *getStrlenExprArg(const Expr *E) {
if (const CallExpr *CE = dyn_cast<CallExpr>(E)) {
const FunctionDecl *FD = CE->getDirectCallee();
if (!FD || FD->getMemoryFunctionKind() != Builtin::BIstrlen)
return nullptr;
return CE->getArg(0)->IgnoreParenCasts();
}
return nullptr;
}
// Warn on anti-patterns as the 'size' argument to strncat.
// The correct size argument should look like following:
// strncat(dst, src, sizeof(dst) - strlen(dest) - 1);
void Sema::CheckStrncatArguments(const CallExpr *CE,
IdentifierInfo *FnName) {
// Don't crash if the user has the wrong number of arguments.
if (CE->getNumArgs() < 3)
return;
const Expr *DstArg = CE->getArg(0)->IgnoreParenCasts();
const Expr *SrcArg = CE->getArg(1)->IgnoreParenCasts();
const Expr *LenArg = CE->getArg(2)->IgnoreParenCasts();
if (CheckMemorySizeofForComparison(*this, LenArg, FnName, CE->getLocStart(),
CE->getRParenLoc()))
return;
// Identify common expressions, which are wrongly used as the size argument
// to strncat and may lead to buffer overflows.
unsigned PatternType = 0;
if (const Expr *SizeOfArg = getSizeOfExprArg(LenArg)) {
// - sizeof(dst)
if (referToTheSameDecl(SizeOfArg, DstArg))
PatternType = 1;
// - sizeof(src)
else if (referToTheSameDecl(SizeOfArg, SrcArg))
PatternType = 2;
} else if (const BinaryOperator *BE = dyn_cast<BinaryOperator>(LenArg)) {
if (BE->getOpcode() == BO_Sub) {
const Expr *L = BE->getLHS()->IgnoreParenCasts();
const Expr *R = BE->getRHS()->IgnoreParenCasts();
// - sizeof(dst) - strlen(dst)
if (referToTheSameDecl(DstArg, getSizeOfExprArg(L)) &&
referToTheSameDecl(DstArg, getStrlenExprArg(R)))
PatternType = 1;
// - sizeof(src) - (anything)
else if (referToTheSameDecl(SrcArg, getSizeOfExprArg(L)))
PatternType = 2;
}
}
if (PatternType == 0)
return;
// Generate the diagnostic.
SourceLocation SL = LenArg->getLocStart();
SourceRange SR = LenArg->getSourceRange();
SourceManager &SM = getSourceManager();
// If the function is defined as a builtin macro, do not show macro expansion.
if (SM.isMacroArgExpansion(SL)) {
SL = SM.getSpellingLoc(SL);
SR = SourceRange(SM.getSpellingLoc(SR.getBegin()),
SM.getSpellingLoc(SR.getEnd()));
}
// Check if the destination is an array (rather than a pointer to an array).
QualType DstTy = DstArg->getType();
bool isKnownSizeArray = isConstantSizeArrayWithMoreThanOneElement(DstTy,
Context);
if (!isKnownSizeArray) {
if (PatternType == 1)
Diag(SL, diag::warn_strncat_wrong_size) << SR;
else
Diag(SL, diag::warn_strncat_src_size) << SR;
return;
}
if (PatternType == 1)
Diag(SL, diag::warn_strncat_large_size) << SR;
else
Diag(SL, diag::warn_strncat_src_size) << SR;
SmallString<128> sizeString;
llvm::raw_svector_ostream OS(sizeString);
OS << "sizeof(";
DstArg->printPretty(OS, nullptr, getPrintingPolicy());
OS << ") - ";
OS << "strlen(";
DstArg->printPretty(OS, nullptr, getPrintingPolicy());
OS << ") - 1";
Diag(SL, diag::note_strncat_wrong_size)
<< FixItHint::CreateReplacement(SR, OS.str());
}
//===--- CHECK: Return Address of Stack Variable --------------------------===//
static const Expr *EvalVal(const Expr *E,
SmallVectorImpl<const DeclRefExpr *> &refVars,
const Decl *ParentDecl);
static const Expr *EvalAddr(const Expr *E,
SmallVectorImpl<const DeclRefExpr *> &refVars,
const Decl *ParentDecl);
/// CheckReturnStackAddr - Check if a return statement returns the address
/// of a stack variable.
static void
CheckReturnStackAddr(Sema &S, Expr *RetValExp, QualType lhsType,
SourceLocation ReturnLoc) {
const Expr *stackE = nullptr;
SmallVector<const DeclRefExpr *, 8> refVars;
// Perform checking for returned stack addresses, local blocks,
// label addresses or references to temporaries.
if (lhsType->isPointerType() ||
(!S.getLangOpts().ObjCAutoRefCount && lhsType->isBlockPointerType())) {
stackE = EvalAddr(RetValExp, refVars, /*ParentDecl=*/nullptr);
} else if (lhsType->isReferenceType()) {
stackE = EvalVal(RetValExp, refVars, /*ParentDecl=*/nullptr);
}
if (!stackE)
return; // Nothing suspicious was found.
// Parameters are initialized in the calling scope, so taking the address
// of a parameter reference doesn't need a warning.
for (auto *DRE : refVars)
if (isa<ParmVarDecl>(DRE->getDecl()))
return;
SourceLocation diagLoc;
SourceRange diagRange;
if (refVars.empty()) {
diagLoc = stackE->getLocStart();
diagRange = stackE->getSourceRange();
} else {
// We followed through a reference variable. 'stackE' contains the
// problematic expression but we will warn at the return statement pointing
// at the reference variable. We will later display the "trail" of
// reference variables using notes.
diagLoc = refVars[0]->getLocStart();
diagRange = refVars[0]->getSourceRange();
}
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(stackE)) {
// address of local var
S.Diag(diagLoc, diag::warn_ret_stack_addr_ref) << lhsType->isReferenceType()
<< DR->getDecl()->getDeclName() << diagRange;
} else if (isa<BlockExpr>(stackE)) { // local block.
S.Diag(diagLoc, diag::err_ret_local_block) << diagRange;
} else if (isa<AddrLabelExpr>(stackE)) { // address of label.
S.Diag(diagLoc, diag::warn_ret_addr_label) << diagRange;
} else { // local temporary.
// If there is an LValue->RValue conversion, then the value of the
// reference type is used, not the reference.
if (auto *ICE = dyn_cast<ImplicitCastExpr>(RetValExp)) {
if (ICE->getCastKind() == CK_LValueToRValue) {
return;
}
}
S.Diag(diagLoc, diag::warn_ret_local_temp_addr_ref)
<< lhsType->isReferenceType() << diagRange;
}
// Display the "trail" of reference variables that we followed until we
// found the problematic expression using notes.
for (unsigned i = 0, e = refVars.size(); i != e; ++i) {
const VarDecl *VD = cast<VarDecl>(refVars[i]->getDecl());
// If this var binds to another reference var, show the range of the next
// var, otherwise the var binds to the problematic expression, in which case
// show the range of the expression.
SourceRange range = (i < e - 1) ? refVars[i + 1]->getSourceRange()
: stackE->getSourceRange();
S.Diag(VD->getLocation(), diag::note_ref_var_local_bind)
<< VD->getDeclName() << range;
}
}
/// EvalAddr - EvalAddr and EvalVal are mutually recursive functions that
/// check if the expression in a return statement evaluates to an address
/// to a location on the stack, a local block, an address of a label, or a
/// reference to local temporary. The recursion is used to traverse the
/// AST of the return expression, with recursion backtracking when we
/// encounter a subexpression that (1) clearly does not lead to one of the
/// above problematic expressions (2) is something we cannot determine leads to
/// a problematic expression based on such local checking.
///
/// Both EvalAddr and EvalVal follow through reference variables to evaluate
/// the expression that they point to. Such variables are added to the
/// 'refVars' vector so that we know what the reference variable "trail" was.
///
/// EvalAddr processes expressions that are pointers that are used as
/// references (and not L-values). EvalVal handles all other values.
/// At the base case of the recursion is a check for the above problematic
/// expressions.
///
/// This implementation handles:
///
/// * pointer-to-pointer casts
/// * implicit conversions from array references to pointers
/// * taking the address of fields
/// * arbitrary interplay between "&" and "*" operators
/// * pointer arithmetic from an address of a stack variable
/// * taking the address of an array element where the array is on the stack
static const Expr *EvalAddr(const Expr *E,
SmallVectorImpl<const DeclRefExpr *> &refVars,
const Decl *ParentDecl) {
if (E->isTypeDependent())
return nullptr;
// We should only be called for evaluating pointer expressions.
assert((E->getType()->isAnyPointerType() ||
E->getType()->isBlockPointerType() ||
E->getType()->isObjCQualifiedIdType()) &&
"EvalAddr only works on pointers");
E = E->IgnoreParens();
// Our "symbolic interpreter" is just a dispatch off the currently
// viewed AST node. We then recursively traverse the AST by calling
// EvalAddr and EvalVal appropriately.
switch (E->getStmtClass()) {
case Stmt::DeclRefExprClass: {
const DeclRefExpr *DR = cast<DeclRefExpr>(E);
// If we leave the immediate function, the lifetime isn't about to end.
if (DR->refersToEnclosingVariableOrCapture())
return nullptr;
if (const VarDecl *V = dyn_cast<VarDecl>(DR->getDecl()))
// If this is a reference variable, follow through to the expression that
// it points to.
if (V->hasLocalStorage() &&
V->getType()->isReferenceType() && V->hasInit()) {
// Add the reference variable to the "trail".
refVars.push_back(DR);
return EvalAddr(V->getInit(), refVars, ParentDecl);
}
return nullptr;
}
case Stmt::UnaryOperatorClass: {
// The only unary operator that make sense to handle here
// is AddrOf. All others don't make sense as pointers.
const UnaryOperator *U = cast<UnaryOperator>(E);
if (U->getOpcode() == UO_AddrOf)
return EvalVal(U->getSubExpr(), refVars, ParentDecl);
return nullptr;
}
case Stmt::BinaryOperatorClass: {
// Handle pointer arithmetic. All other binary operators are not valid
// in this context.
const BinaryOperator *B = cast<BinaryOperator>(E);
BinaryOperatorKind op = B->getOpcode();
if (op != BO_Add && op != BO_Sub)
return nullptr;
const Expr *Base = B->getLHS();
// Determine which argument is the real pointer base. It could be
// the RHS argument instead of the LHS.
if (!Base->getType()->isPointerType())
Base = B->getRHS();
assert(Base->getType()->isPointerType());
return EvalAddr(Base, refVars, ParentDecl);
}
// For conditional operators we need to see if either the LHS or RHS are
// valid DeclRefExpr*s. If one of them is valid, we return it.
case Stmt::ConditionalOperatorClass: {
const ConditionalOperator *C = cast<ConditionalOperator>(E);
// Handle the GNU extension for missing LHS.
// FIXME: That isn't a ConditionalOperator, so doesn't get here.
if (const Expr *LHSExpr = C->getLHS()) {
// In C++, we can have a throw-expression, which has 'void' type.
if (!LHSExpr->getType()->isVoidType())
if (const Expr *LHS = EvalAddr(LHSExpr, refVars, ParentDecl))
return LHS;
}
// In C++, we can have a throw-expression, which has 'void' type.
if (C->getRHS()->getType()->isVoidType())
return nullptr;
return EvalAddr(C->getRHS(), refVars, ParentDecl);
}
case Stmt::BlockExprClass:
if (cast<BlockExpr>(E)->getBlockDecl()->hasCaptures())
return E; // local block.
return nullptr;
case Stmt::AddrLabelExprClass:
return E; // address of label.
case Stmt::ExprWithCleanupsClass:
return EvalAddr(cast<ExprWithCleanups>(E)->getSubExpr(), refVars,
ParentDecl);
// For casts, we need to handle conversions from arrays to
// pointer values, and pointer-to-pointer conversions.
case Stmt::ImplicitCastExprClass:
case Stmt::CStyleCastExprClass:
case Stmt::CXXFunctionalCastExprClass:
case Stmt::ObjCBridgedCastExprClass:
case Stmt::CXXStaticCastExprClass:
case Stmt::CXXDynamicCastExprClass:
case Stmt::CXXConstCastExprClass:
case Stmt::CXXReinterpretCastExprClass: {
const Expr* SubExpr = cast<CastExpr>(E)->getSubExpr();
switch (cast<CastExpr>(E)->getCastKind()) {
case CK_LValueToRValue:
case CK_NoOp:
case CK_BaseToDerived:
case CK_DerivedToBase:
case CK_UncheckedDerivedToBase:
case CK_Dynamic:
case CK_CPointerToObjCPointerCast:
case CK_BlockPointerToObjCPointerCast:
case CK_AnyPointerToBlockPointerCast:
return EvalAddr(SubExpr, refVars, ParentDecl);
case CK_ArrayToPointerDecay:
return EvalVal(SubExpr, refVars, ParentDecl);
case CK_BitCast:
if (SubExpr->getType()->isAnyPointerType() ||
SubExpr->getType()->isBlockPointerType() ||
SubExpr->getType()->isObjCQualifiedIdType())
return EvalAddr(SubExpr, refVars, ParentDecl);
else
return nullptr;
default:
return nullptr;
}
}
case Stmt::MaterializeTemporaryExprClass:
if (const Expr *Result =
EvalAddr(cast<MaterializeTemporaryExpr>(E)->GetTemporaryExpr(),
refVars, ParentDecl))
return Result;
return E;
// Everything else: we simply don't reason about them.
default:
return nullptr;
}
}
/// EvalVal - This function is complements EvalAddr in the mutual recursion.
/// See the comments for EvalAddr for more details.
static const Expr *EvalVal(const Expr *E,
SmallVectorImpl<const DeclRefExpr *> &refVars,
const Decl *ParentDecl) {
do {
// We should only be called for evaluating non-pointer expressions, or
// expressions with a pointer type that are not used as references but
// instead
// are l-values (e.g., DeclRefExpr with a pointer type).
// Our "symbolic interpreter" is just a dispatch off the currently
// viewed AST node. We then recursively traverse the AST by calling
// EvalAddr and EvalVal appropriately.
E = E->IgnoreParens();
switch (E->getStmtClass()) {
case Stmt::ImplicitCastExprClass: {
const ImplicitCastExpr *IE = cast<ImplicitCastExpr>(E);
if (IE->getValueKind() == VK_LValue) {
E = IE->getSubExpr();
continue;
}
return nullptr;
}
case Stmt::ExprWithCleanupsClass:
return EvalVal(cast<ExprWithCleanups>(E)->getSubExpr(), refVars,
ParentDecl);
case Stmt::DeclRefExprClass: {
// When we hit a DeclRefExpr we are looking at code that refers to a
// variable's name. If it's not a reference variable we check if it has
// local storage within the function, and if so, return the expression.
const DeclRefExpr *DR = cast<DeclRefExpr>(E);
// If we leave the immediate function, the lifetime isn't about to end.
if (DR->refersToEnclosingVariableOrCapture())
return nullptr;
if (const VarDecl *V = dyn_cast<VarDecl>(DR->getDecl())) {
// Check if it refers to itself, e.g. "int& i = i;".
if (V == ParentDecl)
return DR;
if (V->hasLocalStorage()) {
if (!V->getType()->isReferenceType())
return DR;
// Reference variable, follow through to the expression that
// it points to.
if (V->hasInit()) {
// Add the reference variable to the "trail".
refVars.push_back(DR);
return EvalVal(V->getInit(), refVars, V);
}
}
}
return nullptr;
}
case Stmt::UnaryOperatorClass: {
// The only unary operator that make sense to handle here
// is Deref. All others don't resolve to a "name." This includes
// handling all sorts of rvalues passed to a unary operator.
const UnaryOperator *U = cast<UnaryOperator>(E);
if (U->getOpcode() == UO_Deref)
return EvalAddr(U->getSubExpr(), refVars, ParentDecl);
return nullptr;
}
case Stmt::ArraySubscriptExprClass: {
// Array subscripts are potential references to data on the stack. We
// retrieve the DeclRefExpr* for the array variable if it indeed
// has local storage.
const auto *ASE = cast<ArraySubscriptExpr>(E);
if (ASE->isTypeDependent())
return nullptr;
return EvalAddr(ASE->getBase(), refVars, ParentDecl);
}
case Stmt::OMPArraySectionExprClass: {
return EvalAddr(cast<OMPArraySectionExpr>(E)->getBase(), refVars,
ParentDecl);
}
case Stmt::ConditionalOperatorClass: {
// For conditional operators we need to see if either the LHS or RHS are
// non-NULL Expr's. If one is non-NULL, we return it.
const ConditionalOperator *C = cast<ConditionalOperator>(E);
// Handle the GNU extension for missing LHS.
if (const Expr *LHSExpr = C->getLHS()) {
// In C++, we can have a throw-expression, which has 'void' type.
if (!LHSExpr->getType()->isVoidType())
if (const Expr *LHS = EvalVal(LHSExpr, refVars, ParentDecl))
return LHS;
}
// In C++, we can have a throw-expression, which has 'void' type.
if (C->getRHS()->getType()->isVoidType())
return nullptr;
return EvalVal(C->getRHS(), refVars, ParentDecl);
}
// Accesses to members are potential references to data on the stack.
case Stmt::MemberExprClass: {
const MemberExpr *M = cast<MemberExpr>(E);
// Check for indirect access. We only want direct field accesses.
if (M->isArrow())
return nullptr;
// Check whether the member type is itself a reference, in which case
// we're not going to refer to the member, but to what the member refers
// to.
if (M->getMemberDecl()->getType()->isReferenceType())
return nullptr;
return EvalVal(M->getBase(), refVars, ParentDecl);
}
case Stmt::MaterializeTemporaryExprClass:
if (const Expr *Result =
EvalVal(cast<MaterializeTemporaryExpr>(E)->GetTemporaryExpr(),
refVars, ParentDecl))
return Result;
return E;
default:
// Check that we don't return or take the address of a reference to a
// temporary. This is only useful in C++.
if (!E->isTypeDependent() && E->isRValue())
return E;
// Everything else: we simply don't reason about them.
return nullptr;
}
} while (true);
}
void
Sema::CheckReturnValExpr(Expr *RetValExp, QualType lhsType,
SourceLocation ReturnLoc,
bool isObjCMethod,
const AttrVec *Attrs,
const FunctionDecl *FD) {
CheckReturnStackAddr(*this, RetValExp, lhsType, ReturnLoc);
// Check if the return value is null but should not be.
if (((Attrs && hasSpecificAttr<ReturnsNonNullAttr>(*Attrs)) ||
(!isObjCMethod && isNonNullType(Context, lhsType))) &&
CheckNonNullExpr(*this, RetValExp))
Diag(ReturnLoc, diag::warn_null_ret)
<< (isObjCMethod ? 1 : 0) << RetValExp->getSourceRange();
// C++11 [basic.stc.dynamic.allocation]p4:
// If an allocation function declared with a non-throwing
// exception-specification fails to allocate storage, it shall return
// a null pointer. Any other allocation function that fails to allocate
// storage shall indicate failure only by throwing an exception [...]
if (FD) {
OverloadedOperatorKind Op = FD->getOverloadedOperator();
if (Op == OO_New || Op == OO_Array_New) {
const FunctionProtoType *Proto
= FD->getType()->castAs<FunctionProtoType>();
if (!Proto->isNothrow(Context, /*ResultIfDependent*/true) &&
CheckNonNullExpr(*this, RetValExp))
Diag(ReturnLoc, diag::warn_operator_new_returns_null)
<< FD << getLangOpts().CPlusPlus11;
}
}
}
//===--- CHECK: Floating-Point comparisons (-Wfloat-equal) ---------------===//
/// Check for comparisons of floating point operands using != and ==.
/// Issue a warning if these are no self-comparisons, as they are not likely
/// to do what the programmer intended.
void Sema::CheckFloatComparison(SourceLocation Loc, Expr* LHS, Expr *RHS) {
Expr* LeftExprSansParen = LHS->IgnoreParenImpCasts();
Expr* RightExprSansParen = RHS->IgnoreParenImpCasts();
// Special case: check for x == x (which is OK).
// Do not emit warnings for such cases.
if (DeclRefExpr* DRL = dyn_cast<DeclRefExpr>(LeftExprSansParen))
if (DeclRefExpr* DRR = dyn_cast<DeclRefExpr>(RightExprSansParen))
if (DRL->getDecl() == DRR->getDecl())
return;
// Special case: check for comparisons against literals that can be exactly
// represented by APFloat. In such cases, do not emit a warning. This
// is a heuristic: often comparison against such literals are used to
// detect if a value in a variable has not changed. This clearly can
// lead to false negatives.
if (FloatingLiteral* FLL = dyn_cast<FloatingLiteral>(LeftExprSansParen)) {
if (FLL->isExact())
return;
} else
if (FloatingLiteral* FLR = dyn_cast<FloatingLiteral>(RightExprSansParen))
if (FLR->isExact())
return;
// Check for comparisons with builtin types.
if (CallExpr* CL = dyn_cast<CallExpr>(LeftExprSansParen))
if (CL->getBuiltinCallee())
return;
if (CallExpr* CR = dyn_cast<CallExpr>(RightExprSansParen))
if (CR->getBuiltinCallee())
return;
// Emit the diagnostic.
Diag(Loc, diag::warn_floatingpoint_eq)
<< LHS->getSourceRange() << RHS->getSourceRange();
}
//===--- CHECK: Integer mixed-sign comparisons (-Wsign-compare) --------===//
//===--- CHECK: Lossy implicit conversions (-Wconversion) --------------===//
namespace {
/// Structure recording the 'active' range of an integer-valued
/// expression.
struct IntRange {
/// The number of bits active in the int.
unsigned Width;
/// True if the int is known not to have negative values.
bool NonNegative;
IntRange(unsigned Width, bool NonNegative)
: Width(Width), NonNegative(NonNegative)
{}
/// Returns the range of the bool type.
static IntRange forBoolType() {
return IntRange(1, true);
}
/// Returns the range of an opaque value of the given integral type.
static IntRange forValueOfType(ASTContext &C, QualType T) {
return forValueOfCanonicalType(C,
T->getCanonicalTypeInternal().getTypePtr());
}
/// Returns the range of an opaque value of a canonical integral type.
static IntRange forValueOfCanonicalType(ASTContext &C, const Type *T) {
assert(T->isCanonicalUnqualified());
if (const VectorType *VT = dyn_cast<VectorType>(T))
T = VT->getElementType().getTypePtr();
if (const ComplexType *CT = dyn_cast<ComplexType>(T))
T = CT->getElementType().getTypePtr();
if (const AtomicType *AT = dyn_cast<AtomicType>(T))
T = AT->getValueType().getTypePtr();
// For enum types, use the known bit width of the enumerators.
if (const EnumType *ET = dyn_cast<EnumType>(T)) {
EnumDecl *Enum = ET->getDecl();
if (!Enum->isCompleteDefinition())
return IntRange(C.getIntWidth(QualType(T, 0)), false);
unsigned NumPositive = Enum->getNumPositiveBits();
unsigned NumNegative = Enum->getNumNegativeBits();
if (NumNegative == 0)
return IntRange(NumPositive, true/*NonNegative*/);
else
return IntRange(std::max(NumPositive + 1, NumNegative),
false/*NonNegative*/);
}
const BuiltinType *BT = cast<BuiltinType>(T);
assert(BT->isInteger());
return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger());
}
/// Returns the "target" range of a canonical integral type, i.e.
/// the range of values expressible in the type.
///
/// This matches forValueOfCanonicalType except that enums have the
/// full range of their type, not the range of their enumerators.
static IntRange forTargetOfCanonicalType(ASTContext &C, const Type *T) {
assert(T->isCanonicalUnqualified());
if (const VectorType *VT = dyn_cast<VectorType>(T))
T = VT->getElementType().getTypePtr();
if (const ComplexType *CT = dyn_cast<ComplexType>(T))
T = CT->getElementType().getTypePtr();
if (const AtomicType *AT = dyn_cast<AtomicType>(T))
T = AT->getValueType().getTypePtr();
if (const EnumType *ET = dyn_cast<EnumType>(T))
T = C.getCanonicalType(ET->getDecl()->getIntegerType()).getTypePtr();
const BuiltinType *BT = cast<BuiltinType>(T);
assert(BT->isInteger());
return IntRange(C.getIntWidth(QualType(T, 0)), BT->isUnsignedInteger());
}
/// Returns the supremum of two ranges: i.e. their conservative merge.
static IntRange join(IntRange L, IntRange R) {
return IntRange(std::max(L.Width, R.Width),
L.NonNegative && R.NonNegative);
}
/// Returns the infinum of two ranges: i.e. their aggressive merge.
static IntRange meet(IntRange L, IntRange R) {
return IntRange(std::min(L.Width, R.Width),
L.NonNegative || R.NonNegative);
}
};
IntRange GetValueRange(ASTContext &C, llvm::APSInt &value, unsigned MaxWidth) {
if (value.isSigned() && value.isNegative())
return IntRange(value.getMinSignedBits(), false);
if (value.getBitWidth() > MaxWidth)
value = value.trunc(MaxWidth);
// isNonNegative() just checks the sign bit without considering
// signedness.
return IntRange(value.getActiveBits(), true);
}
IntRange GetValueRange(ASTContext &C, APValue &result, QualType Ty,
unsigned MaxWidth) {
if (result.isInt())
return GetValueRange(C, result.getInt(), MaxWidth);
if (result.isVector()) {
IntRange R = GetValueRange(C, result.getVectorElt(0), Ty, MaxWidth);
for (unsigned i = 1, e = result.getVectorLength(); i != e; ++i) {
IntRange El = GetValueRange(C, result.getVectorElt(i), Ty, MaxWidth);
R = IntRange::join(R, El);
}
return R;
}
if (result.isComplexInt()) {
IntRange R = GetValueRange(C, result.getComplexIntReal(), MaxWidth);
IntRange I = GetValueRange(C, result.getComplexIntImag(), MaxWidth);
return IntRange::join(R, I);
}
// This can happen with lossless casts to intptr_t of "based" lvalues.
// Assume it might use arbitrary bits.
// FIXME: The only reason we need to pass the type in here is to get
// the sign right on this one case. It would be nice if APValue
// preserved this.
assert(result.isLValue() || result.isAddrLabelDiff());
return IntRange(MaxWidth, Ty->isUnsignedIntegerOrEnumerationType());
}
QualType GetExprType(const Expr *E) {
QualType Ty = E->getType();
if (const AtomicType *AtomicRHS = Ty->getAs<AtomicType>())
Ty = AtomicRHS->getValueType();
return Ty;
}
/// Pseudo-evaluate the given integer expression, estimating the
/// range of values it might take.
///
/// \param MaxWidth - the width to which the value will be truncated
IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth) {
E = E->IgnoreParens();
// Try a full evaluation first.
Expr::EvalResult result;
if (E->EvaluateAsRValue(result, C))
return GetValueRange(C, result.Val, GetExprType(E), MaxWidth);
// I think we only want to look through implicit casts here; if the
// user has an explicit widening cast, we should treat the value as
// being of the new, wider type.
if (const auto *CE = dyn_cast<ImplicitCastExpr>(E)) {
if (CE->getCastKind() == CK_NoOp || CE->getCastKind() == CK_LValueToRValue)
return GetExprRange(C, CE->getSubExpr(), MaxWidth);
IntRange OutputTypeRange = IntRange::forValueOfType(C, GetExprType(CE));
bool isIntegerCast = CE->getCastKind() == CK_IntegralCast ||
CE->getCastKind() == CK_BooleanToSignedIntegral;
// Assume that non-integer casts can span the full range of the type.
if (!isIntegerCast)
return OutputTypeRange;
IntRange SubRange
= GetExprRange(C, CE->getSubExpr(),
std::min(MaxWidth, OutputTypeRange.Width));
// Bail out if the subexpr's range is as wide as the cast type.
if (SubRange.Width >= OutputTypeRange.Width)
return OutputTypeRange;
// Otherwise, we take the smaller width, and we're non-negative if
// either the output type or the subexpr is.
return IntRange(SubRange.Width,
SubRange.NonNegative || OutputTypeRange.NonNegative);
}
if (const auto *CO = dyn_cast<ConditionalOperator>(E)) {
// If we can fold the condition, just take that operand.
bool CondResult;
if (CO->getCond()->EvaluateAsBooleanCondition(CondResult, C))
return GetExprRange(C, CondResult ? CO->getTrueExpr()
: CO->getFalseExpr(),
MaxWidth);
// Otherwise, conservatively merge.
IntRange L = GetExprRange(C, CO->getTrueExpr(), MaxWidth);
IntRange R = GetExprRange(C, CO->getFalseExpr(), MaxWidth);
return IntRange::join(L, R);
}
if (const auto *BO = dyn_cast<BinaryOperator>(E)) {
switch (BO->getOpcode()) {
// Boolean-valued operations are single-bit and positive.
case BO_LAnd:
case BO_LOr:
case BO_LT:
case BO_GT:
case BO_LE:
case BO_GE:
case BO_EQ:
case BO_NE:
return IntRange::forBoolType();
// The type of the assignments is the type of the LHS, so the RHS
// is not necessarily the same type.
case BO_MulAssign:
case BO_DivAssign:
case BO_RemAssign:
case BO_AddAssign:
case BO_SubAssign:
case BO_XorAssign:
case BO_OrAssign:
// TODO: bitfields?
return IntRange::forValueOfType(C, GetExprType(E));
// Simple assignments just pass through the RHS, which will have
// been coerced to the LHS type.
case BO_Assign:
// TODO: bitfields?
return GetExprRange(C, BO->getRHS(), MaxWidth);
// Operations with opaque sources are black-listed.
case BO_PtrMemD:
case BO_PtrMemI:
return IntRange::forValueOfType(C, GetExprType(E));
// Bitwise-and uses the *infinum* of the two source ranges.
case BO_And:
case BO_AndAssign:
return IntRange::meet(GetExprRange(C, BO->getLHS(), MaxWidth),
GetExprRange(C, BO->getRHS(), MaxWidth));
// Left shift gets black-listed based on a judgement call.
case BO_Shl:
// ...except that we want to treat '1 << (blah)' as logically
// positive. It's an important idiom.
if (IntegerLiteral *I
= dyn_cast<IntegerLiteral>(BO->getLHS()->IgnoreParenCasts())) {
if (I->getValue() == 1) {
IntRange R = IntRange::forValueOfType(C, GetExprType(E));
return IntRange(R.Width, /*NonNegative*/ true);
}
}
// fallthrough
case BO_ShlAssign:
return IntRange::forValueOfType(C, GetExprType(E));
// Right shift by a constant can narrow its left argument.
case BO_Shr:
case BO_ShrAssign: {
IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth);
// If the shift amount is a positive constant, drop the width by
// that much.
llvm::APSInt shift;
if (BO->getRHS()->isIntegerConstantExpr(shift, C) &&
shift.isNonNegative()) {
unsigned zext = shift.getZExtValue();
if (zext >= L.Width)
L.Width = (L.NonNegative ? 0 : 1);
else
L.Width -= zext;
}
return L;
}
// Comma acts as its right operand.
case BO_Comma:
return GetExprRange(C, BO->getRHS(), MaxWidth);
// Black-list pointer subtractions.
case BO_Sub:
if (BO->getLHS()->getType()->isPointerType())
return IntRange::forValueOfType(C, GetExprType(E));
break;
// The width of a division result is mostly determined by the size
// of the LHS.
case BO_Div: {
// Don't 'pre-truncate' the operands.
unsigned opWidth = C.getIntWidth(GetExprType(E));
IntRange L = GetExprRange(C, BO->getLHS(), opWidth);
// If the divisor is constant, use that.
llvm::APSInt divisor;
if (BO->getRHS()->isIntegerConstantExpr(divisor, C)) {
unsigned log2 = divisor.logBase2(); // floor(log_2(divisor))
if (log2 >= L.Width)
L.Width = (L.NonNegative ? 0 : 1);
else
L.Width = std::min(L.Width - log2, MaxWidth);
return L;
}
// Otherwise, just use the LHS's width.
IntRange R = GetExprRange(C, BO->getRHS(), opWidth);
return IntRange(L.Width, L.NonNegative && R.NonNegative);
}
// The result of a remainder can't be larger than the result of
// either side.
case BO_Rem: {
// Don't 'pre-truncate' the operands.
unsigned opWidth = C.getIntWidth(GetExprType(E));
IntRange L = GetExprRange(C, BO->getLHS(), opWidth);
IntRange R = GetExprRange(C, BO->getRHS(), opWidth);
IntRange meet = IntRange::meet(L, R);
meet.Width = std::min(meet.Width, MaxWidth);
return meet;
}
// The default behavior is okay for these.
case BO_Mul:
case BO_Add:
case BO_Xor:
case BO_Or:
break;
}
// The default case is to treat the operation as if it were closed
// on the narrowest type that encompasses both operands.
IntRange L = GetExprRange(C, BO->getLHS(), MaxWidth);
IntRange R = GetExprRange(C, BO->getRHS(), MaxWidth);
return IntRange::join(L, R);
}
if (const auto *UO = dyn_cast<UnaryOperator>(E)) {
switch (UO->getOpcode()) {
// Boolean-valued operations are white-listed.
case UO_LNot:
return IntRange::forBoolType();
// Operations with opaque sources are black-listed.
case UO_Deref:
case UO_AddrOf: // should be impossible
return IntRange::forValueOfType(C, GetExprType(E));
default:
return GetExprRange(C, UO->getSubExpr(), MaxWidth);
}
}
if (const auto *OVE = dyn_cast<OpaqueValueExpr>(E))
return GetExprRange(C, OVE->getSourceExpr(), MaxWidth);
if (const auto *BitField = E->getSourceBitField())
return IntRange(BitField->getBitWidthValue(C),
BitField->getType()->isUnsignedIntegerOrEnumerationType());
return IntRange::forValueOfType(C, GetExprType(E));
}
IntRange GetExprRange(ASTContext &C, const Expr *E) {
return GetExprRange(C, E, C.getIntWidth(GetExprType(E)));
}
/// Checks whether the given value, which currently has the given
/// source semantics, has the same value when coerced through the
/// target semantics.
bool IsSameFloatAfterCast(const llvm::APFloat &value,
const llvm::fltSemantics &Src,
const llvm::fltSemantics &Tgt) {
llvm::APFloat truncated = value;
bool ignored;
truncated.convert(Src, llvm::APFloat::rmNearestTiesToEven, &ignored);
truncated.convert(Tgt, llvm::APFloat::rmNearestTiesToEven, &ignored);
return truncated.bitwiseIsEqual(value);
}
/// Checks whether the given value, which currently has the given
/// source semantics, has the same value when coerced through the
/// target semantics.
///
/// The value might be a vector of floats (or a complex number).
bool IsSameFloatAfterCast(const APValue &value,
const llvm::fltSemantics &Src,
const llvm::fltSemantics &Tgt) {
if (value.isFloat())
return IsSameFloatAfterCast(value.getFloat(), Src, Tgt);
if (value.isVector()) {
for (unsigned i = 0, e = value.getVectorLength(); i != e; ++i)
if (!IsSameFloatAfterCast(value.getVectorElt(i), Src, Tgt))
return false;
return true;
}
assert(value.isComplexFloat());
return (IsSameFloatAfterCast(value.getComplexFloatReal(), Src, Tgt) &&
IsSameFloatAfterCast(value.getComplexFloatImag(), Src, Tgt));
}
void AnalyzeImplicitConversions(Sema &S, Expr *E, SourceLocation CC);
bool IsZero(Sema &S, Expr *E) {
// Suppress cases where we are comparing against an enum constant.
if (const DeclRefExpr *DR =
dyn_cast<DeclRefExpr>(E->IgnoreParenImpCasts()))
if (isa<EnumConstantDecl>(DR->getDecl()))
return false;
// Suppress cases where the '0' value is expanded from a macro.
if (E->getLocStart().isMacroID())
return false;
llvm::APSInt Value;
return E->isIntegerConstantExpr(Value, S.Context) && Value == 0;
}
bool HasEnumType(Expr *E) {
// Strip off implicit integral promotions.
while (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
if (ICE->getCastKind() != CK_IntegralCast &&
ICE->getCastKind() != CK_NoOp)
break;
E = ICE->getSubExpr();
}
return E->getType()->isEnumeralType();
}
void CheckTrivialUnsignedComparison(Sema &S, BinaryOperator *E) {
// Disable warning in template instantiations.
if (S.inTemplateInstantiation())
return;
BinaryOperatorKind op = E->getOpcode();
if (E->isValueDependent())
return;
if (op == BO_LT && IsZero(S, E->getRHS())) {
S.Diag(E->getOperatorLoc(), diag::warn_lunsigned_always_true_comparison)
<< "< 0" << "false" << HasEnumType(E->getLHS())
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
} else if (op == BO_GE && IsZero(S, E->getRHS())) {
S.Diag(E->getOperatorLoc(), diag::warn_lunsigned_always_true_comparison)
<< ">= 0" << "true" << HasEnumType(E->getLHS())
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
} else if (op == BO_GT && IsZero(S, E->getLHS())) {
S.Diag(E->getOperatorLoc(), diag::warn_runsigned_always_true_comparison)
<< "0 >" << "false" << HasEnumType(E->getRHS())
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
} else if (op == BO_LE && IsZero(S, E->getLHS())) {
S.Diag(E->getOperatorLoc(), diag::warn_runsigned_always_true_comparison)
<< "0 <=" << "true" << HasEnumType(E->getRHS())
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
}
}
void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E, Expr *Constant,
Expr *Other, const llvm::APSInt &Value,
bool RhsConstant) {
// Disable warning in template instantiations.
if (S.inTemplateInstantiation())
return;
// TODO: Investigate using GetExprRange() to get tighter bounds
// on the bit ranges.
QualType OtherT = Other->getType();
if (const auto *AT = OtherT->getAs<AtomicType>())
OtherT = AT->getValueType();
IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT);
unsigned OtherWidth = OtherRange.Width;
bool OtherIsBooleanType = Other->isKnownToHaveBooleanValue();
// 0 values are handled later by CheckTrivialUnsignedComparison().
if ((Value == 0) && (!OtherIsBooleanType))
return;
BinaryOperatorKind op = E->getOpcode();
bool IsTrue = true;
// Used for diagnostic printout.
enum {
LiteralConstant = 0,
CXXBoolLiteralTrue,
CXXBoolLiteralFalse
} LiteralOrBoolConstant = LiteralConstant;
if (!OtherIsBooleanType) {
QualType ConstantT = Constant->getType();
QualType CommonT = E->getLHS()->getType();
if (S.Context.hasSameUnqualifiedType(OtherT, ConstantT))
return;
assert((OtherT->isIntegerType() && ConstantT->isIntegerType()) &&
"comparison with non-integer type");
bool ConstantSigned = ConstantT->isSignedIntegerType();
bool CommonSigned = CommonT->isSignedIntegerType();
bool EqualityOnly = false;
if (CommonSigned) {
// The common type is signed, therefore no signed to unsigned conversion.
if (!OtherRange.NonNegative) {
// Check that the constant is representable in type OtherT.
if (ConstantSigned) {
if (OtherWidth >= Value.getMinSignedBits())
return;
} else { // !ConstantSigned
if (OtherWidth >= Value.getActiveBits() + 1)
return;
}
} else { // !OtherSigned
// Check that the constant is representable in type OtherT.
// Negative values are out of range.
if (ConstantSigned) {
if (Value.isNonNegative() && OtherWidth >= Value.getActiveBits())
return;
} else { // !ConstantSigned
if (OtherWidth >= Value.getActiveBits())
return;
}
}
} else { // !CommonSigned
if (OtherRange.NonNegative) {
if (OtherWidth >= Value.getActiveBits())
return;
} else { // OtherSigned
assert(!ConstantSigned &&
"Two signed types converted to unsigned types.");
// Check to see if the constant is representable in OtherT.
if (OtherWidth > Value.getActiveBits())
return;
// Check to see if the constant is equivalent to a negative value
// cast to CommonT.
if (S.Context.getIntWidth(ConstantT) ==
S.Context.getIntWidth(CommonT) &&
Value.isNegative() && Value.getMinSignedBits() <= OtherWidth)
return;
// The constant value rests between values that OtherT can represent
// after conversion. Relational comparison still works, but equality
// comparisons will be tautological.
EqualityOnly = true;
}
}
bool PositiveConstant = !ConstantSigned || Value.isNonNegative();
if (op == BO_EQ || op == BO_NE) {
IsTrue = op == BO_NE;
} else if (EqualityOnly) {
return;
} else if (RhsConstant) {
if (op == BO_GT || op == BO_GE)
IsTrue = !PositiveConstant;
else // op == BO_LT || op == BO_LE
IsTrue = PositiveConstant;
} else {
if (op == BO_LT || op == BO_LE)
IsTrue = !PositiveConstant;
else // op == BO_GT || op == BO_GE
IsTrue = PositiveConstant;
}
} else {
// Other isKnownToHaveBooleanValue
enum CompareBoolWithConstantResult { AFals, ATrue, Unkwn };
enum ConstantValue { LT_Zero, Zero, One, GT_One, SizeOfConstVal };
enum ConstantSide { Lhs, Rhs, SizeOfConstSides };
static const struct LinkedConditions {
CompareBoolWithConstantResult BO_LT_OP[SizeOfConstSides][SizeOfConstVal];
CompareBoolWithConstantResult BO_GT_OP[SizeOfConstSides][SizeOfConstVal];
CompareBoolWithConstantResult BO_LE_OP[SizeOfConstSides][SizeOfConstVal];
CompareBoolWithConstantResult BO_GE_OP[SizeOfConstSides][SizeOfConstVal];
CompareBoolWithConstantResult BO_EQ_OP[SizeOfConstSides][SizeOfConstVal];
CompareBoolWithConstantResult BO_NE_OP[SizeOfConstSides][SizeOfConstVal];
} TruthTable = {
// Constant on LHS. | Constant on RHS. |
// LT_Zero| Zero | One |GT_One| LT_Zero| Zero | One |GT_One|
{ { ATrue, Unkwn, AFals, AFals }, { AFals, AFals, Unkwn, ATrue } },
{ { AFals, AFals, Unkwn, ATrue }, { ATrue, Unkwn, AFals, AFals } },
{ { ATrue, ATrue, Unkwn, AFals }, { AFals, Unkwn, ATrue, ATrue } },
{ { AFals, Unkwn, ATrue, ATrue }, { ATrue, ATrue, Unkwn, AFals } },
{ { AFals, Unkwn, Unkwn, AFals }, { AFals, Unkwn, Unkwn, AFals } },
{ { ATrue, Unkwn, Unkwn, ATrue }, { ATrue, Unkwn, Unkwn, ATrue } }
};
bool ConstantIsBoolLiteral = isa<CXXBoolLiteralExpr>(Constant);
enum ConstantValue ConstVal = Zero;
if (Value.isUnsigned() || Value.isNonNegative()) {
if (Value == 0) {
LiteralOrBoolConstant =
ConstantIsBoolLiteral ? CXXBoolLiteralFalse : LiteralConstant;
ConstVal = Zero;
} else if (Value == 1) {
LiteralOrBoolConstant =
ConstantIsBoolLiteral ? CXXBoolLiteralTrue : LiteralConstant;
ConstVal = One;
} else {
LiteralOrBoolConstant = LiteralConstant;
ConstVal = GT_One;
}
} else {
ConstVal = LT_Zero;
}
CompareBoolWithConstantResult CmpRes;
switch (op) {
case BO_LT:
CmpRes = TruthTable.BO_LT_OP[RhsConstant][ConstVal];
break;
case BO_GT:
CmpRes = TruthTable.BO_GT_OP[RhsConstant][ConstVal];
break;
case BO_LE:
CmpRes = TruthTable.BO_LE_OP[RhsConstant][ConstVal];
break;
case BO_GE:
CmpRes = TruthTable.BO_GE_OP[RhsConstant][ConstVal];
break;
case BO_EQ:
CmpRes = TruthTable.BO_EQ_OP[RhsConstant][ConstVal];
break;
case BO_NE:
CmpRes = TruthTable.BO_NE_OP[RhsConstant][ConstVal];
break;
default:
CmpRes = Unkwn;
break;
}
if (CmpRes == AFals) {
IsTrue = false;
} else if (CmpRes == ATrue) {
IsTrue = true;
} else {
return;
}
}
// If this is a comparison to an enum constant, include that
// constant in the diagnostic.
const EnumConstantDecl *ED = nullptr;
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Constant))
ED = dyn_cast<EnumConstantDecl>(DR->getDecl());
SmallString<64> PrettySourceValue;
llvm::raw_svector_ostream OS(PrettySourceValue);
if (ED)
OS << '\'' << *ED << "' (" << Value << ")";
else
OS << Value;
S.DiagRuntimeBehavior(
E->getOperatorLoc(), E,
S.PDiag(diag::warn_out_of_range_compare)
<< OS.str() << LiteralOrBoolConstant
<< OtherT << (OtherIsBooleanType && !OtherT->isBooleanType()) << IsTrue
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange());
}
/// Analyze the operands of the given comparison. Implements the
/// fallback case from AnalyzeComparison.
void AnalyzeImpConvsInComparison(Sema &S, BinaryOperator *E) {
AnalyzeImplicitConversions(S, E->getLHS(), E->getOperatorLoc());
AnalyzeImplicitConversions(S, E->getRHS(), E->getOperatorLoc());
}
/// \brief Implements -Wsign-compare.
///
/// \param E the binary operator to check for warnings
void AnalyzeComparison(Sema &S, BinaryOperator *E) {
// The type the comparison is being performed in.
QualType T = E->getLHS()->getType();
// Only analyze comparison operators where both sides have been converted to
// the same type.
if (!S.Context.hasSameUnqualifiedType(T, E->getRHS()->getType()))
return AnalyzeImpConvsInComparison(S, E);
// Don't analyze value-dependent comparisons directly.
if (E->isValueDependent())
return AnalyzeImpConvsInComparison(S, E);
Expr *LHS = E->getLHS()->IgnoreParenImpCasts();
Expr *RHS = E->getRHS()->IgnoreParenImpCasts();
bool IsComparisonConstant = false;
// Check whether an integer constant comparison results in a value
// of 'true' or 'false'.
if (T->isIntegralType(S.Context)) {
llvm::APSInt RHSValue;
bool IsRHSIntegralLiteral =
RHS->isIntegerConstantExpr(RHSValue, S.Context);
llvm::APSInt LHSValue;
bool IsLHSIntegralLiteral =
LHS->isIntegerConstantExpr(LHSValue, S.Context);
if (IsRHSIntegralLiteral && !IsLHSIntegralLiteral)
DiagnoseOutOfRangeComparison(S, E, RHS, LHS, RHSValue, true);
else if (!IsRHSIntegralLiteral && IsLHSIntegralLiteral)
DiagnoseOutOfRangeComparison(S, E, LHS, RHS, LHSValue, false);
else
IsComparisonConstant =
(IsRHSIntegralLiteral && IsLHSIntegralLiteral);
} else if (!T->hasUnsignedIntegerRepresentation())
IsComparisonConstant = E->isIntegerConstantExpr(S.Context);
// We don't do anything special if this isn't an unsigned integral
// comparison: we're only interested in integral comparisons, and
// signed comparisons only happen in cases we don't care to warn about.
//
// We also don't care about value-dependent expressions or expressions
// whose result is a constant.
if (!T->hasUnsignedIntegerRepresentation() || IsComparisonConstant)
return AnalyzeImpConvsInComparison(S, E);
// Check to see if one of the (unmodified) operands is of different
// signedness.
Expr *signedOperand, *unsignedOperand;
if (LHS->getType()->hasSignedIntegerRepresentation()) {
assert(!RHS->getType()->hasSignedIntegerRepresentation() &&
"unsigned comparison between two signed integer expressions?");
signedOperand = LHS;
unsignedOperand = RHS;
} else if (RHS->getType()->hasSignedIntegerRepresentation()) {
signedOperand = RHS;
unsignedOperand = LHS;
} else {
CheckTrivialUnsignedComparison(S, E);
return AnalyzeImpConvsInComparison(S, E);
}
// Otherwise, calculate the effective range of the signed operand.
IntRange signedRange = GetExprRange(S.Context, signedOperand);
// Go ahead and analyze implicit conversions in the operands. Note
// that we skip the implicit conversions on both sides.
AnalyzeImplicitConversions(S, LHS, E->getOperatorLoc());
AnalyzeImplicitConversions(S, RHS, E->getOperatorLoc());
// If the signed range is non-negative, -Wsign-compare won't fire,
// but we should still check for comparisons which are always true
// or false.
if (signedRange.NonNegative)
return CheckTrivialUnsignedComparison(S, E);
// For (in)equality comparisons, if the unsigned operand is a
// constant which cannot collide with a overflowed signed operand,
// then reinterpreting the signed operand as unsigned will not
// change the result of the comparison.
if (E->isEqualityOp()) {
unsigned comparisonWidth = S.Context.getIntWidth(T);
IntRange unsignedRange = GetExprRange(S.Context, unsignedOperand);
// We should never be unable to prove that the unsigned operand is
// non-negative.
assert(unsignedRange.NonNegative && "unsigned range includes negative?");
if (unsignedRange.Width < comparisonWidth)
return;
}
S.DiagRuntimeBehavior(E->getOperatorLoc(), E,
S.PDiag(diag::warn_mixed_sign_comparison)
<< LHS->getType() << RHS->getType()
<< LHS->getSourceRange() << RHS->getSourceRange());
}
/// Analyzes an attempt to assign the given value to a bitfield.
///
/// Returns true if there was something fishy about the attempt.
bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init,
SourceLocation InitLoc) {
assert(Bitfield->isBitField());
if (Bitfield->isInvalidDecl())
return false;
// White-list bool bitfields.
QualType BitfieldType = Bitfield->getType();
if (BitfieldType->isBooleanType())
return false;
if (BitfieldType->isEnumeralType()) {
EnumDecl *BitfieldEnumDecl = BitfieldType->getAs<EnumType>()->getDecl();
// If the underlying enum type was not explicitly specified as an unsigned
// type and the enum contain only positive values, MSVC++ will cause an
// inconsistency by storing this as a signed type.
if (S.getLangOpts().CPlusPlus11 &&
!BitfieldEnumDecl->getIntegerTypeSourceInfo() &&
BitfieldEnumDecl->getNumPositiveBits() > 0 &&
BitfieldEnumDecl->getNumNegativeBits() == 0) {
S.Diag(InitLoc, diag::warn_no_underlying_type_specified_for_enum_bitfield)
<< BitfieldEnumDecl->getNameAsString();
}
}
if (Bitfield->getType()->isBooleanType())
return false;
// Ignore value- or type-dependent expressions.
if (Bitfield->getBitWidth()->isValueDependent() ||
Bitfield->getBitWidth()->isTypeDependent() ||
Init->isValueDependent() ||
Init->isTypeDependent())
return false;
Expr *OriginalInit = Init->IgnoreParenImpCasts();
unsigned FieldWidth = Bitfield->getBitWidthValue(S.Context);
llvm::APSInt Value;
if (!OriginalInit->EvaluateAsInt(Value, S.Context,
Expr::SE_AllowSideEffects)) {
// The RHS is not constant. If the RHS has an enum type, make sure the
// bitfield is wide enough to hold all the values of the enum without
// truncation.
if (const auto *EnumTy = OriginalInit->getType()->getAs<EnumType>()) {
EnumDecl *ED = EnumTy->getDecl();
bool SignedBitfield = BitfieldType->isSignedIntegerType();
// Enum types are implicitly signed on Windows, so check if there are any
// negative enumerators to see if the enum was intended to be signed or
// not.
bool SignedEnum = ED->getNumNegativeBits() > 0;
// Check for surprising sign changes when assigning enum values to a
// bitfield of different signedness. If the bitfield is signed and we
// have exactly the right number of bits to store this unsigned enum,
// suggest changing the enum to an unsigned type. This typically happens
// on Windows where unfixed enums always use an underlying type of 'int'.
unsigned DiagID = 0;
if (SignedEnum && !SignedBitfield) {
DiagID = diag::warn_unsigned_bitfield_assigned_signed_enum;
} else if (SignedBitfield && !SignedEnum &&
ED->getNumPositiveBits() == FieldWidth) {
DiagID = diag::warn_signed_bitfield_enum_conversion;
}
if (DiagID) {
S.Diag(InitLoc, DiagID) << Bitfield << ED;
TypeSourceInfo *TSI = Bitfield->getTypeSourceInfo();
SourceRange TypeRange =
TSI ? TSI->getTypeLoc().getSourceRange() : SourceRange();
S.Diag(Bitfield->getTypeSpecStartLoc(), diag::note_change_bitfield_sign)
<< SignedEnum << TypeRange;
}
// Compute the required bitwidth. If the enum has negative values, we need
// one more bit than the normal number of positive bits to represent the
// sign bit.
unsigned BitsNeeded = SignedEnum ? std::max(ED->getNumPositiveBits() + 1,
ED->getNumNegativeBits())
: ED->getNumPositiveBits();
// Check the bitwidth.
if (BitsNeeded > FieldWidth) {
Expr *WidthExpr = Bitfield->getBitWidth();
S.Diag(InitLoc, diag::warn_bitfield_too_small_for_enum)
<< Bitfield << ED;
S.Diag(WidthExpr->getExprLoc(), diag::note_widen_bitfield)
<< BitsNeeded << ED << WidthExpr->getSourceRange();
}
}
return false;
}
unsigned OriginalWidth = Value.getBitWidth();
if (!Value.isSigned() || Value.isNegative())
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(OriginalInit))
if (UO->getOpcode() == UO_Minus || UO->getOpcode() == UO_Not)
OriginalWidth = Value.getMinSignedBits();
if (OriginalWidth <= FieldWidth)
return false;
// Compute the value which the bitfield will contain.
llvm::APSInt TruncatedValue = Value.trunc(FieldWidth);
TruncatedValue.setIsSigned(BitfieldType->isSignedIntegerType());
// Check whether the stored value is equal to the original value.
TruncatedValue = TruncatedValue.extend(OriginalWidth);
if (llvm::APSInt::isSameValue(Value, TruncatedValue))
return false;
// Special-case bitfields of width 1: booleans are naturally 0/1, and
// therefore don't strictly fit into a signed bitfield of width 1.
if (FieldWidth == 1 && Value == 1)
return false;
std::string PrettyValue = Value.toString(10);
std::string PrettyTrunc = TruncatedValue.toString(10);
S.Diag(InitLoc, diag::warn_impcast_bitfield_precision_constant)
<< PrettyValue << PrettyTrunc << OriginalInit->getType()
<< Init->getSourceRange();
return true;
}
/// Analyze the given simple or compound assignment for warning-worthy
/// operations.
void AnalyzeAssignment(Sema &S, BinaryOperator *E) {
// Just recurse on the LHS.
AnalyzeImplicitConversions(S, E->getLHS(), E->getOperatorLoc());
// We want to recurse on the RHS as normal unless we're assigning to
// a bitfield.
if (FieldDecl *Bitfield = E->getLHS()->getSourceBitField()) {
if (AnalyzeBitFieldAssignment(S, Bitfield, E->getRHS(),
E->getOperatorLoc())) {
// Recurse, ignoring any implicit conversions on the RHS.
return AnalyzeImplicitConversions(S, E->getRHS()->IgnoreParenImpCasts(),
E->getOperatorLoc());
}
}
AnalyzeImplicitConversions(S, E->getRHS(), E->getOperatorLoc());
}
/// Diagnose an implicit cast; purely a helper for CheckImplicitConversion.
void DiagnoseImpCast(Sema &S, Expr *E, QualType SourceType, QualType T,
SourceLocation CContext, unsigned diag,
bool pruneControlFlow = false) {
if (pruneControlFlow) {
S.DiagRuntimeBehavior(E->getExprLoc(), E,
S.PDiag(diag)
<< SourceType << T << E->getSourceRange()
<< SourceRange(CContext));
return;
}
S.Diag(E->getExprLoc(), diag)
<< SourceType << T << E->getSourceRange() << SourceRange(CContext);
}
/// Diagnose an implicit cast; purely a helper for CheckImplicitConversion.
void DiagnoseImpCast(Sema &S, Expr *E, QualType T, SourceLocation CContext,
unsigned diag, bool pruneControlFlow = false) {
DiagnoseImpCast(S, E, E->getType(), T, CContext, diag, pruneControlFlow);
}
/// Diagnose an implicit cast from a floating point value to an integer value.
void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T,
SourceLocation CContext) {
const bool IsBool = T->isSpecificBuiltinType(BuiltinType::Bool);
const bool PruneWarnings = S.inTemplateInstantiation();
Expr *InnerE = E->IgnoreParenImpCasts();
// We also want to warn on, e.g., "int i = -1.234"
if (UnaryOperator *UOp = dyn_cast<UnaryOperator>(InnerE))
if (UOp->getOpcode() == UO_Minus || UOp->getOpcode() == UO_Plus)
InnerE = UOp->getSubExpr()->IgnoreParenImpCasts();
const bool IsLiteral =
isa<FloatingLiteral>(E) || isa<FloatingLiteral>(InnerE);
llvm::APFloat Value(0.0);
bool IsConstant =
E->EvaluateAsFloat(Value, S.Context, Expr::SE_AllowSideEffects);
if (!IsConstant) {
return DiagnoseImpCast(S, E, T, CContext,
diag::warn_impcast_float_integer, PruneWarnings);
}
bool isExact = false;
llvm::APSInt IntegerValue(S.Context.getIntWidth(T),
T->hasUnsignedIntegerRepresentation());
if (Value.convertToInteger(IntegerValue, llvm::APFloat::rmTowardZero,
&isExact) == llvm::APFloat::opOK &&
isExact) {
if (IsLiteral) return;
return DiagnoseImpCast(S, E, T, CContext, diag::warn_impcast_float_integer,
PruneWarnings);
}
unsigned DiagID = 0;
if (IsLiteral) {
// Warn on floating point literal to integer.
DiagID = diag::warn_impcast_literal_float_to_integer;
} else if (IntegerValue == 0) {
if (Value.isZero()) { // Skip -0.0 to 0 conversion.
return DiagnoseImpCast(S, E, T, CContext,
diag::warn_impcast_float_integer, PruneWarnings);
}
// Warn on non-zero to zero conversion.
DiagID = diag::warn_impcast_float_to_integer_zero;
} else {
if (IntegerValue.isUnsigned()) {
if (!IntegerValue.isMaxValue()) {
return DiagnoseImpCast(S, E, T, CContext,
diag::warn_impcast_float_integer, PruneWarnings);
}
} else { // IntegerValue.isSigned()
if (!IntegerValue.isMaxSignedValue() &&
!IntegerValue.isMinSignedValue()) {
return DiagnoseImpCast(S, E, T, CContext,
diag::warn_impcast_float_integer, PruneWarnings);
}
}
// Warn on evaluatable floating point expression to integer conversion.
DiagID = diag::warn_impcast_float_to_integer;
}
// FIXME: Force the precision of the source value down so we don't print
// digits which are usually useless (we don't really care here if we
// truncate a digit by accident in edge cases). Ideally, APFloat::toString
// would automatically print the shortest representation, but it's a bit
// tricky to implement.
SmallString<16> PrettySourceValue;
unsigned precision = llvm::APFloat::semanticsPrecision(Value.getSemantics());
precision = (precision * 59 + 195) / 196;
Value.toString(PrettySourceValue, precision);
SmallString<16> PrettyTargetValue;
if (IsBool)
PrettyTargetValue = Value.isZero() ? "false" : "true";
else
IntegerValue.toString(PrettyTargetValue);
if (PruneWarnings) {
S.DiagRuntimeBehavior(E->getExprLoc(), E,
S.PDiag(DiagID)
<< E->getType() << T.getUnqualifiedType()
<< PrettySourceValue << PrettyTargetValue
<< E->getSourceRange() << SourceRange(CContext));
} else {
S.Diag(E->getExprLoc(), DiagID)
<< E->getType() << T.getUnqualifiedType() << PrettySourceValue
<< PrettyTargetValue << E->getSourceRange() << SourceRange(CContext);
}
}
std::string PrettyPrintInRange(const llvm::APSInt &Value, IntRange Range) {
if (!Range.Width) return "0";
llvm::APSInt ValueInRange = Value;
ValueInRange.setIsSigned(!Range.NonNegative);
ValueInRange = ValueInRange.trunc(Range.Width);
return ValueInRange.toString(10);
}
bool IsImplicitBoolFloatConversion(Sema &S, Expr *Ex, bool ToBool) {
if (!isa<ImplicitCastExpr>(Ex))
return false;
Expr *InnerE = Ex->IgnoreParenImpCasts();
const Type *Target = S.Context.getCanonicalType(Ex->getType()).getTypePtr();
const Type *Source =
S.Context.getCanonicalType(InnerE->getType()).getTypePtr();
if (Target->isDependentType())
return false;
const BuiltinType *FloatCandidateBT =
dyn_cast<BuiltinType>(ToBool ? Source : Target);
const Type *BoolCandidateType = ToBool ? Target : Source;
return (BoolCandidateType->isSpecificBuiltinType(BuiltinType::Bool) &&
FloatCandidateBT && (FloatCandidateBT->isFloatingPoint()));
}
void CheckImplicitArgumentConversions(Sema &S, CallExpr *TheCall,
SourceLocation CC) {
unsigned NumArgs = TheCall->getNumArgs();
for (unsigned i = 0; i < NumArgs; ++i) {
Expr *CurrA = TheCall->getArg(i);
if (!IsImplicitBoolFloatConversion(S, CurrA, true))
continue;
bool IsSwapped = ((i > 0) &&
IsImplicitBoolFloatConversion(S, TheCall->getArg(i - 1), false));
IsSwapped |= ((i < (NumArgs - 1)) &&
IsImplicitBoolFloatConversion(S, TheCall->getArg(i + 1), false));
if (IsSwapped) {
// Warn on this floating-point to bool conversion.
DiagnoseImpCast(S, CurrA->IgnoreParenImpCasts(),
CurrA->getType(), CC,
diag::warn_impcast_floating_point_to_bool);
}
}
}
void DiagnoseNullConversion(Sema &S, Expr *E, QualType T, SourceLocation CC) {
if (S.Diags.isIgnored(diag::warn_impcast_null_pointer_to_integer,
E->getExprLoc()))
return;
// Don't warn on functions which have return type nullptr_t.
if (isa<CallExpr>(E))
return;
// Check for NULL (GNUNull) or nullptr (CXX11_nullptr).
const Expr::NullPointerConstantKind NullKind =
E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull);
if (NullKind != Expr::NPCK_GNUNull && NullKind != Expr::NPCK_CXX11_nullptr)
return;
// Return if target type is a safe conversion.
if (T->isAnyPointerType() || T->isBlockPointerType() ||
T->isMemberPointerType() || !T->isScalarType() || T->isNullPtrType())
return;
SourceLocation Loc = E->getSourceRange().getBegin();
// Venture through the macro stacks to get to the source of macro arguments.
// The new location is a better location than the complete location that was
// passed in.
while (S.SourceMgr.isMacroArgExpansion(Loc))
Loc = S.SourceMgr.getImmediateMacroCallerLoc(Loc);
while (S.SourceMgr.isMacroArgExpansion(CC))
CC = S.SourceMgr.getImmediateMacroCallerLoc(CC);
// __null is usually wrapped in a macro. Go up a macro if that is the case.
if (NullKind == Expr::NPCK_GNUNull && Loc.isMacroID()) {
StringRef MacroName = Lexer::getImmediateMacroNameForDiagnostics(
Loc, S.SourceMgr, S.getLangOpts());
if (MacroName == "NULL")
Loc = S.SourceMgr.getImmediateExpansionRange(Loc).first;
}
// Only warn if the null and context location are in the same macro expansion.
if (S.SourceMgr.getFileID(Loc) != S.SourceMgr.getFileID(CC))
return;
S.Diag(Loc, diag::warn_impcast_null_pointer_to_integer)
<< (NullKind == Expr::NPCK_CXX11_nullptr) << T << clang::SourceRange(CC)
<< FixItHint::CreateReplacement(Loc,
S.getFixItZeroLiteralForType(T, Loc));
}
void checkObjCArrayLiteral(Sema &S, QualType TargetType,
ObjCArrayLiteral *ArrayLiteral);
void checkObjCDictionaryLiteral(Sema &S, QualType TargetType,
ObjCDictionaryLiteral *DictionaryLiteral);
/// Check a single element within a collection literal against the
/// target element type.
void checkObjCCollectionLiteralElement(Sema &S, QualType TargetElementType,
Expr *Element, unsigned ElementKind) {
// Skip a bitcast to 'id' or qualified 'id'.
if (auto ICE = dyn_cast<ImplicitCastExpr>(Element)) {
if (ICE->getCastKind() == CK_BitCast &&
ICE->getSubExpr()->getType()->getAs<ObjCObjectPointerType>())
Element = ICE->getSubExpr();
}
QualType ElementType = Element->getType();
ExprResult ElementResult(Element);
if (ElementType->getAs<ObjCObjectPointerType>() &&
S.CheckSingleAssignmentConstraints(TargetElementType,
ElementResult,
false, false)
!= Sema::Compatible) {
S.Diag(Element->getLocStart(),
diag::warn_objc_collection_literal_element)
<< ElementType << ElementKind << TargetElementType
<< Element->getSourceRange();
}
if (auto ArrayLiteral = dyn_cast<ObjCArrayLiteral>(Element))
checkObjCArrayLiteral(S, TargetElementType, ArrayLiteral);
else if (auto DictionaryLiteral = dyn_cast<ObjCDictionaryLiteral>(Element))
checkObjCDictionaryLiteral(S, TargetElementType, DictionaryLiteral);
}
/// Check an Objective-C array literal being converted to the given
/// target type.
void checkObjCArrayLiteral(Sema &S, QualType TargetType,
ObjCArrayLiteral *ArrayLiteral) {
if (!S.NSArrayDecl)
return;
const auto *TargetObjCPtr = TargetType->getAs<ObjCObjectPointerType>();
if (!TargetObjCPtr)
return;
if (TargetObjCPtr->isUnspecialized() ||
TargetObjCPtr->getInterfaceDecl()->getCanonicalDecl()
!= S.NSArrayDecl->getCanonicalDecl())
return;
auto TypeArgs = TargetObjCPtr->getTypeArgs();
if (TypeArgs.size() != 1)
return;
QualType TargetElementType = TypeArgs[0];
for (unsigned I = 0, N = ArrayLiteral->getNumElements(); I != N; ++I) {
checkObjCCollectionLiteralElement(S, TargetElementType,
ArrayLiteral->getElement(I),
0);
}
}
/// Check an Objective-C dictionary literal being converted to the given
/// target type.
void checkObjCDictionaryLiteral(Sema &S, QualType TargetType,
ObjCDictionaryLiteral *DictionaryLiteral) {
if (!S.NSDictionaryDecl)
return;
const auto *TargetObjCPtr = TargetType->getAs<ObjCObjectPointerType>();
if (!TargetObjCPtr)
return;
if (TargetObjCPtr->isUnspecialized() ||
TargetObjCPtr->getInterfaceDecl()->getCanonicalDecl()
!= S.NSDictionaryDecl->getCanonicalDecl())
return;
auto TypeArgs = TargetObjCPtr->getTypeArgs();
if (TypeArgs.size() != 2)
return;
QualType TargetKeyType = TypeArgs[0];
QualType TargetObjectType = TypeArgs[1];
for (unsigned I = 0, N = DictionaryLiteral->getNumElements(); I != N; ++I) {
auto Element = DictionaryLiteral->getKeyValueElement(I);
checkObjCCollectionLiteralElement(S, TargetKeyType, Element.Key, 1);
checkObjCCollectionLiteralElement(S, TargetObjectType, Element.Value, 2);
}
}
// Helper function to filter out cases for constant width constant conversion.
// Don't warn on char array initialization or for non-decimal values.
bool isSameWidthConstantConversion(Sema &S, Expr *E, QualType T,
SourceLocation CC) {
// If initializing from a constant, and the constant starts with '0',
// then it is a binary, octal, or hexadecimal. Allow these constants
// to fill all the bits, even if there is a sign change.
if (auto *IntLit = dyn_cast<IntegerLiteral>(E->IgnoreParenImpCasts())) {
const char FirstLiteralCharacter =
S.getSourceManager().getCharacterData(IntLit->getLocStart())[0];
if (FirstLiteralCharacter == '0')
return false;
}
// If the CC location points to a '{', and the type is char, then assume
// assume it is an array initialization.
if (CC.isValid() && T->isCharType()) {
const char FirstContextCharacter =
S.getSourceManager().getCharacterData(CC)[0];
if (FirstContextCharacter == '{')
return false;
}
return true;
}
void CheckImplicitConversion(Sema &S, Expr *E, QualType T,
SourceLocation CC, bool *ICContext = nullptr) {
if (E->isTypeDependent() || E->isValueDependent()) return;
const Type *Source = S.Context.getCanonicalType(E->getType()).getTypePtr();
const Type *Target = S.Context.getCanonicalType(T).getTypePtr();
if (Source == Target) return;
if (Target->isDependentType()) return;
// If the conversion context location is invalid don't complain. We also
// don't want to emit a warning if the issue occurs from the expansion of
// a system macro. The problem is that 'getSpellingLoc()' is slow, so we
// delay this check as long as possible. Once we detect we are in that
// scenario, we just return.
if (CC.isInvalid())
return;
// Diagnose implicit casts to bool.
if (Target->isSpecificBuiltinType(BuiltinType::Bool)) {
if (isa<StringLiteral>(E))
// Warn on string literal to bool. Checks for string literals in logical
// and expressions, for instance, assert(0 && "error here"), are
// prevented by a check in AnalyzeImplicitConversions().
return DiagnoseImpCast(S, E, T, CC,
diag::warn_impcast_string_literal_to_bool);
if (isa<ObjCStringLiteral>(E) || isa<ObjCArrayLiteral>(E) ||
isa<ObjCDictionaryLiteral>(E) || isa<ObjCBoxedExpr>(E)) {
// This covers the literal expressions that evaluate to Objective-C
// objects.
return DiagnoseImpCast(S, E, T, CC,
diag::warn_impcast_objective_c_literal_to_bool);
}
if (Source->isPointerType() || Source->canDecayToPointerType()) {
// Warn on pointer to bool conversion that is always true.
S.DiagnoseAlwaysNonNullPointer(E, Expr::NPCK_NotNull, /*IsEqual*/ false,
SourceRange(CC));
}
}
// Check implicit casts from Objective-C collection literals to specialized
// collection types, e.g., NSArray<NSString *> *.
if (auto *ArrayLiteral = dyn_cast<ObjCArrayLiteral>(E))
checkObjCArrayLiteral(S, QualType(Target, 0), ArrayLiteral);
else if (auto *DictionaryLiteral = dyn_cast<ObjCDictionaryLiteral>(E))
checkObjCDictionaryLiteral(S, QualType(Target, 0), DictionaryLiteral);
// Strip vector types.
if (isa<VectorType>(Source)) {
if (!isa<VectorType>(Target)) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_vector_scalar);
}
// If the vector cast is cast between two vectors of the same size, it is
// a bitcast, not a conversion.
if (S.Context.getTypeSize(Source) == S.Context.getTypeSize(Target))
return;
Source = cast<VectorType>(Source)->getElementType().getTypePtr();
Target = cast<VectorType>(Target)->getElementType().getTypePtr();
}
if (auto VecTy = dyn_cast<VectorType>(Target))
Target = VecTy->getElementType().getTypePtr();
// Strip complex types.
if (isa<ComplexType>(Source)) {
if (!isa<ComplexType>(Target)) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_complex_scalar);
}
Source = cast<ComplexType>(Source)->getElementType().getTypePtr();
Target = cast<ComplexType>(Target)->getElementType().getTypePtr();
}
const BuiltinType *SourceBT = dyn_cast<BuiltinType>(Source);
const BuiltinType *TargetBT = dyn_cast<BuiltinType>(Target);
// If the source is floating point...
if (SourceBT && SourceBT->isFloatingPoint()) {
// ...and the target is floating point...
if (TargetBT && TargetBT->isFloatingPoint()) {
// ...then warn if we're dropping FP rank.
// Builtin FP kinds are ordered by increasing FP rank.
if (SourceBT->getKind() > TargetBT->getKind()) {
// Don't warn about float constants that are precisely
// representable in the target type.
Expr::EvalResult result;
if (E->EvaluateAsRValue(result, S.Context)) {
// Value might be a float, a float vector, or a float complex.
if (IsSameFloatAfterCast(result.Val,
S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)),
S.Context.getFloatTypeSemantics(QualType(SourceBT, 0))))
return;
}
if (S.SourceMgr.isInSystemMacro(CC))
return;
DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_float_precision);
}
// ... or possibly if we're increasing rank, too
else if (TargetBT->getKind() > SourceBT->getKind()) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_double_promotion);
}
return;
}
// If the target is integral, always warn.
if (TargetBT && TargetBT->isInteger()) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
DiagnoseFloatingImpCast(S, E, T, CC);
}
// Detect the case where a call result is converted from floating-point to
// to bool, and the final argument to the call is converted from bool, to
// discover this typo:
//
// bool b = fabs(x < 1.0); // should be "bool b = fabs(x) < 1.0;"
//
// FIXME: This is an incredibly special case; is there some more general
// way to detect this class of misplaced-parentheses bug?
if (Target->isBooleanType() && isa<CallExpr>(E)) {
// Check last argument of function call to see if it is an
// implicit cast from a type matching the type the result
// is being cast to.
CallExpr *CEx = cast<CallExpr>(E);
if (unsigned NumArgs = CEx->getNumArgs()) {
Expr *LastA = CEx->getArg(NumArgs - 1);
Expr *InnerE = LastA->IgnoreParenImpCasts();
if (isa<ImplicitCastExpr>(LastA) &&
InnerE->getType()->isBooleanType()) {
// Warn on this floating-point to bool conversion
DiagnoseImpCast(S, E, T, CC,
diag::warn_impcast_floating_point_to_bool);
}
}
}
return;
}
DiagnoseNullConversion(S, E, T, CC);
S.DiscardMisalignedMemberAddress(Target, E);
if (!Source->isIntegerType() || !Target->isIntegerType())
return;
// TODO: remove this early return once the false positives for constant->bool
// in templates, macros, etc, are reduced or removed.
if (Target->isSpecificBuiltinType(BuiltinType::Bool))
return;
IntRange SourceRange = GetExprRange(S.Context, E);
IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target);
if (SourceRange.Width > TargetRange.Width) {
// If the source is a constant, use a default-on diagnostic.
// TODO: this should happen for bitfield stores, too.
llvm::APSInt Value(32);
if (E->EvaluateAsInt(Value, S.Context, Expr::SE_AllowSideEffects)) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
std::string PrettySourceValue = Value.toString(10);
std::string PrettyTargetValue = PrettyPrintInRange(Value, TargetRange);
S.DiagRuntimeBehavior(E->getExprLoc(), E,
S.PDiag(diag::warn_impcast_integer_precision_constant)
<< PrettySourceValue << PrettyTargetValue
<< E->getType() << T << E->getSourceRange()
<< clang::SourceRange(CC));
return;
}
// People want to build with -Wshorten-64-to-32 and not -Wconversion.
if (S.SourceMgr.isInSystemMacro(CC))
return;
if (TargetRange.Width == 32 && S.Context.getIntWidth(E->getType()) == 64)
return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_integer_64_32,
/* pruneControlFlow */ true);
return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_integer_precision);
}
if (TargetRange.Width == SourceRange.Width && !TargetRange.NonNegative &&
SourceRange.NonNegative && Source->isSignedIntegerType()) {
// Warn when doing a signed to signed conversion, warn if the positive
// source value is exactly the width of the target type, which will
// cause a negative value to be stored.
llvm::APSInt Value;
if (E->EvaluateAsInt(Value, S.Context, Expr::SE_AllowSideEffects) &&
!S.SourceMgr.isInSystemMacro(CC)) {
if (isSameWidthConstantConversion(S, E, T, CC)) {
std::string PrettySourceValue = Value.toString(10);
std::string PrettyTargetValue = PrettyPrintInRange(Value, TargetRange);
S.DiagRuntimeBehavior(
E->getExprLoc(), E,
S.PDiag(diag::warn_impcast_integer_precision_constant)
<< PrettySourceValue << PrettyTargetValue << E->getType() << T
<< E->getSourceRange() << clang::SourceRange(CC));
return;
}
}
// Fall through for non-constants to give a sign conversion warning.
}
if ((TargetRange.NonNegative && !SourceRange.NonNegative) ||
(!TargetRange.NonNegative && SourceRange.NonNegative &&
SourceRange.Width == TargetRange.Width)) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
unsigned DiagID = diag::warn_impcast_integer_sign;
// Traditionally, gcc has warned about this under -Wsign-compare.
// We also want to warn about it in -Wconversion.
// So if -Wconversion is off, use a completely identical diagnostic
// in the sign-compare group.
// The conditional-checking code will
if (ICContext) {
DiagID = diag::warn_impcast_integer_sign_conditional;
*ICContext = true;
}
return DiagnoseImpCast(S, E, T, CC, DiagID);
}
// Diagnose conversions between different enumeration types.
// In C, we pretend that the type of an EnumConstantDecl is its enumeration
// type, to give us better diagnostics.
QualType SourceType = E->getType();
if (!S.getLangOpts().CPlusPlus) {
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
if (EnumConstantDecl *ECD = dyn_cast<EnumConstantDecl>(DRE->getDecl())) {
EnumDecl *Enum = cast<EnumDecl>(ECD->getDeclContext());
SourceType = S.Context.getTypeDeclType(Enum);
Source = S.Context.getCanonicalType(SourceType).getTypePtr();
}
}
if (const EnumType *SourceEnum = Source->getAs<EnumType>())
if (const EnumType *TargetEnum = Target->getAs<EnumType>())
if (SourceEnum->getDecl()->hasNameForLinkage() &&
TargetEnum->getDecl()->hasNameForLinkage() &&
SourceEnum != TargetEnum) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
return DiagnoseImpCast(S, E, SourceType, T, CC,
diag::warn_impcast_different_enum_types);
}
}
void CheckConditionalOperator(Sema &S, ConditionalOperator *E,
SourceLocation CC, QualType T);
void CheckConditionalOperand(Sema &S, Expr *E, QualType T,
SourceLocation CC, bool &ICContext) {
E = E->IgnoreParenImpCasts();
if (isa<ConditionalOperator>(E))
return CheckConditionalOperator(S, cast<ConditionalOperator>(E), CC, T);
AnalyzeImplicitConversions(S, E, CC);
if (E->getType() != T)
return CheckImplicitConversion(S, E, T, CC, &ICContext);
}
void CheckConditionalOperator(Sema &S, ConditionalOperator *E,
SourceLocation CC, QualType T) {
AnalyzeImplicitConversions(S, E->getCond(), E->getQuestionLoc());
bool Suspicious = false;
CheckConditionalOperand(S, E->getTrueExpr(), T, CC, Suspicious);
CheckConditionalOperand(S, E->getFalseExpr(), T, CC, Suspicious);
// If -Wconversion would have warned about either of the candidates
// for a signedness conversion to the context type...
if (!Suspicious) return;
// ...but it's currently ignored...
if (!S.Diags.isIgnored(diag::warn_impcast_integer_sign_conditional, CC))
return;
// ...then check whether it would have warned about either of the
// candidates for a signedness conversion to the condition type.
if (E->getType() == T) return;
Suspicious = false;
CheckImplicitConversion(S, E->getTrueExpr()->IgnoreParenImpCasts(),
E->getType(), CC, &Suspicious);
if (!Suspicious)
CheckImplicitConversion(S, E->getFalseExpr()->IgnoreParenImpCasts(),
E->getType(), CC, &Suspicious);
}
/// CheckBoolLikeConversion - Check conversion of given expression to boolean.
/// Input argument E is a logical expression.
void CheckBoolLikeConversion(Sema &S, Expr *E, SourceLocation CC) {
if (S.getLangOpts().Bool)
return;
CheckImplicitConversion(S, E->IgnoreParenImpCasts(), S.Context.BoolTy, CC);
}
/// AnalyzeImplicitConversions - Find and report any interesting
/// implicit conversions in the given expression. There are a couple
/// of competing diagnostics here, -Wconversion and -Wsign-compare.
void AnalyzeImplicitConversions(Sema &S, Expr *OrigE, SourceLocation CC) {
QualType T = OrigE->getType();
Expr *E = OrigE->IgnoreParenImpCasts();
if (E->isTypeDependent() || E->isValueDependent())
return;
// For conditional operators, we analyze the arguments as if they
// were being fed directly into the output.
if (isa<ConditionalOperator>(E)) {
ConditionalOperator *CO = cast<ConditionalOperator>(E);
CheckConditionalOperator(S, CO, CC, T);
return;
}
// Check implicit argument conversions for function calls.
if (CallExpr *Call = dyn_cast<CallExpr>(E))
CheckImplicitArgumentConversions(S, Call, CC);
// Go ahead and check any implicit conversions we might have skipped.
// The non-canonical typecheck is just an optimization;
// CheckImplicitConversion will filter out dead implicit conversions.
if (E->getType() != T)
CheckImplicitConversion(S, E, T, CC);
// Now continue drilling into this expression.
if (PseudoObjectExpr *POE = dyn_cast<PseudoObjectExpr>(E)) {
// The bound subexpressions in a PseudoObjectExpr are not reachable
// as transitive children.
// FIXME: Use a more uniform representation for this.
for (auto *SE : POE->semantics())
if (auto *OVE = dyn_cast<OpaqueValueExpr>(SE))
AnalyzeImplicitConversions(S, OVE->getSourceExpr(), CC);
}
// Skip past explicit casts.
if (isa<ExplicitCastExpr>(E)) {
E = cast<ExplicitCastExpr>(E)->getSubExpr()->IgnoreParenImpCasts();
return AnalyzeImplicitConversions(S, E, CC);
}
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
// Do a somewhat different check with comparison operators.
if (BO->isComparisonOp())
return AnalyzeComparison(S, BO);
// And with simple assignments.
if (BO->getOpcode() == BO_Assign)
return AnalyzeAssignment(S, BO);
}
// These break the otherwise-useful invariant below. Fortunately,
// we don't really need to recurse into them, because any internal
// expressions should have been analyzed already when they were
// built into statements.
if (isa<StmtExpr>(E)) return;
// Don't descend into unevaluated contexts.
if (isa<UnaryExprOrTypeTraitExpr>(E)) return;
// Now just recurse over the expression's children.
CC = E->getExprLoc();
BinaryOperator *BO = dyn_cast<BinaryOperator>(E);
bool IsLogicalAndOperator = BO && BO->getOpcode() == BO_LAnd;
for (Stmt *SubStmt : E->children()) {
Expr *ChildExpr = dyn_cast_or_null<Expr>(SubStmt);
if (!ChildExpr)
continue;
if (IsLogicalAndOperator &&
isa<StringLiteral>(ChildExpr->IgnoreParenImpCasts()))
// Ignore checking string literals that are in logical and operators.
// This is a common pattern for asserts.
continue;
AnalyzeImplicitConversions(S, ChildExpr, CC);
}
if (BO && BO->isLogicalOp()) {
Expr *SubExpr = BO->getLHS()->IgnoreParenImpCasts();
if (!IsLogicalAndOperator || !isa<StringLiteral>(SubExpr))
::CheckBoolLikeConversion(S, SubExpr, BO->getExprLoc());
SubExpr = BO->getRHS()->IgnoreParenImpCasts();
if (!IsLogicalAndOperator || !isa<StringLiteral>(SubExpr))
::CheckBoolLikeConversion(S, SubExpr, BO->getExprLoc());
}
if (const UnaryOperator *U = dyn_cast<UnaryOperator>(E))
if (U->getOpcode() == UO_LNot)
::CheckBoolLikeConversion(S, U->getSubExpr(), CC);
}
} // end anonymous namespace
/// Diagnose integer type and any valid implicit convertion to it.
static bool checkOpenCLEnqueueIntType(Sema &S, Expr *E, const QualType &IntT) {
// Taking into account implicit conversions,
// allow any integer.
if (!E->getType()->isIntegerType()) {
S.Diag(E->getLocStart(),
diag::err_opencl_enqueue_kernel_invalid_local_size_type);
return true;
}
// Potentially emit standard warnings for implicit conversions if enabled
// using -Wconversion.
CheckImplicitConversion(S, E, IntT, E->getLocStart());
return false;
}
// Helper function for Sema::DiagnoseAlwaysNonNullPointer.
// Returns true when emitting a warning about taking the address of a reference.
static bool CheckForReference(Sema &SemaRef, const Expr *E,
const PartialDiagnostic &PD) {
E = E->IgnoreParenImpCasts();
const FunctionDecl *FD = nullptr;
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
if (!DRE->getDecl()->getType()->isReferenceType())
return false;
} else if (const MemberExpr *M = dyn_cast<MemberExpr>(E)) {
if (!M->getMemberDecl()->getType()->isReferenceType())
return false;
} else if (const CallExpr *Call = dyn_cast<CallExpr>(E)) {
if (!Call->getCallReturnType(SemaRef.Context)->isReferenceType())
return false;
FD = Call->getDirectCallee();
} else {
return false;
}
SemaRef.Diag(E->getExprLoc(), PD);
// If possible, point to location of function.
if (FD) {
SemaRef.Diag(FD->getLocation(), diag::note_reference_is_return_value) << FD;
}
return true;
}
// Returns true if the SourceLocation is expanded from any macro body.
// Returns false if the SourceLocation is invalid, is from not in a macro
// expansion, or is from expanded from a top-level macro argument.
static bool IsInAnyMacroBody(const SourceManager &SM, SourceLocation Loc) {
if (Loc.isInvalid())
return false;
while (Loc.isMacroID()) {
if (SM.isMacroBodyExpansion(Loc))
return true;
Loc = SM.getImmediateMacroCallerLoc(Loc);
}
return false;
}
/// \brief Diagnose pointers that are always non-null.
/// \param E the expression containing the pointer
/// \param NullKind NPCK_NotNull if E is a cast to bool, otherwise, E is
/// compared to a null pointer
/// \param IsEqual True when the comparison is equal to a null pointer
/// \param Range Extra SourceRange to highlight in the diagnostic
void Sema::DiagnoseAlwaysNonNullPointer(Expr *E,
Expr::NullPointerConstantKind NullKind,
bool IsEqual, SourceRange Range) {
if (!E)
return;
// Don't warn inside macros.
if (E->getExprLoc().isMacroID()) {
const SourceManager &SM = getSourceManager();
if (IsInAnyMacroBody(SM, E->getExprLoc()) ||
IsInAnyMacroBody(SM, Range.getBegin()))
return;
}
E = E->IgnoreImpCasts();
const bool IsCompare = NullKind != Expr::NPCK_NotNull;
if (isa<CXXThisExpr>(E)) {
unsigned DiagID = IsCompare ? diag::warn_this_null_compare
: diag::warn_this_bool_conversion;
Diag(E->getExprLoc(), DiagID) << E->getSourceRange() << Range << IsEqual;
return;
}
bool IsAddressOf = false;
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E)) {
if (UO->getOpcode() != UO_AddrOf)
return;
IsAddressOf = true;
E = UO->getSubExpr();
}
if (IsAddressOf) {
unsigned DiagID = IsCompare
? diag::warn_address_of_reference_null_compare
: diag::warn_address_of_reference_bool_conversion;
PartialDiagnostic PD = PDiag(DiagID) << E->getSourceRange() << Range
<< IsEqual;
if (CheckForReference(*this, E, PD)) {
return;
}
}
auto ComplainAboutNonnullParamOrCall = [&](const Attr *NonnullAttr) {
bool IsParam = isa<NonNullAttr>(NonnullAttr);
std::string Str;
llvm::raw_string_ostream S(Str);
E->printPretty(S, nullptr, getPrintingPolicy());
unsigned DiagID = IsCompare ? diag::warn_nonnull_expr_compare
: diag::warn_cast_nonnull_to_bool;
Diag(E->getExprLoc(), DiagID) << IsParam << S.str()
<< E->getSourceRange() << Range << IsEqual;
Diag(NonnullAttr->getLocation(), diag::note_declared_nonnull) << IsParam;
};
// If we have a CallExpr that is tagged with returns_nonnull, we can complain.
if (auto *Call = dyn_cast<CallExpr>(E->IgnoreParenImpCasts())) {
if (auto *Callee = Call->getDirectCallee()) {
if (const Attr *A = Callee->getAttr<ReturnsNonNullAttr>()) {
ComplainAboutNonnullParamOrCall(A);
return;
}
}
}
// Expect to find a single Decl. Skip anything more complicated.
ValueDecl *D = nullptr;
if (DeclRefExpr *R = dyn_cast<DeclRefExpr>(E)) {
D = R->getDecl();
} else if (MemberExpr *M = dyn_cast<MemberExpr>(E)) {
D = M->getMemberDecl();
}
// Weak Decls can be null.
if (!D || D->isWeak())
return;
// Check for parameter decl with nonnull attribute
if (const auto* PV = dyn_cast<ParmVarDecl>(D)) {
if (getCurFunction() &&
!getCurFunction()->ModifiedNonNullParams.count(PV)) {
if (const Attr *A = PV->getAttr<NonNullAttr>()) {
ComplainAboutNonnullParamOrCall(A);
return;
}
if (const auto *FD = dyn_cast<FunctionDecl>(PV->getDeclContext())) {
auto ParamIter = llvm::find(FD->parameters(), PV);
assert(ParamIter != FD->param_end());
unsigned ParamNo = std::distance(FD->param_begin(), ParamIter);
for (const auto *NonNull : FD->specific_attrs<NonNullAttr>()) {
if (!NonNull->args_size()) {
ComplainAboutNonnullParamOrCall(NonNull);
return;
}
for (unsigned ArgNo : NonNull->args()) {
if (ArgNo == ParamNo) {
ComplainAboutNonnullParamOrCall(NonNull);
return;
}
}
}
}
}
}
QualType T = D->getType();
const bool IsArray = T->isArrayType();
const bool IsFunction = T->isFunctionType();
// Address of function is used to silence the function warning.
if (IsAddressOf && IsFunction) {
return;
}
// Found nothing.
if (!IsAddressOf && !IsFunction && !IsArray)
return;
// Pretty print the expression for the diagnostic.
std::string Str;
llvm::raw_string_ostream S(Str);
E->printPretty(S, nullptr, getPrintingPolicy());
unsigned DiagID = IsCompare ? diag::warn_null_pointer_compare
: diag::warn_impcast_pointer_to_bool;
enum {
AddressOf,
FunctionPointer,
ArrayPointer
} DiagType;
if (IsAddressOf)
DiagType = AddressOf;
else if (IsFunction)
DiagType = FunctionPointer;
else if (IsArray)
DiagType = ArrayPointer;
else
llvm_unreachable("Could not determine diagnostic.");
Diag(E->getExprLoc(), DiagID) << DiagType << S.str() << E->getSourceRange()
<< Range << IsEqual;
if (!IsFunction)
return;
// Suggest '&' to silence the function warning.
Diag(E->getExprLoc(), diag::note_function_warning_silence)
<< FixItHint::CreateInsertion(E->getLocStart(), "&");
// Check to see if '()' fixit should be emitted.
QualType ReturnType;
UnresolvedSet<4> NonTemplateOverloads;
tryExprAsCall(*E, ReturnType, NonTemplateOverloads);
if (ReturnType.isNull())
return;
if (IsCompare) {
// There are two cases here. If there is null constant, the only suggest
// for a pointer return type. If the null is 0, then suggest if the return
// type is a pointer or an integer type.
if (!ReturnType->isPointerType()) {
if (NullKind == Expr::NPCK_ZeroExpression ||
NullKind == Expr::NPCK_ZeroLiteral) {
if (!ReturnType->isIntegerType())
return;
} else {
return;
}
}
} else { // !IsCompare
// For function to bool, only suggest if the function pointer has bool
// return type.
if (!ReturnType->isSpecificBuiltinType(BuiltinType::Bool))
return;
}
Diag(E->getExprLoc(), diag::note_function_to_function_call)
<< FixItHint::CreateInsertion(getLocForEndOfToken(E->getLocEnd()), "()");
}
/// Diagnoses "dangerous" implicit conversions within the given
/// expression (which is a full expression). Implements -Wconversion
/// and -Wsign-compare.
///
/// \param CC the "context" location of the implicit conversion, i.e.
/// the most location of the syntactic entity requiring the implicit
/// conversion
void Sema::CheckImplicitConversions(Expr *E, SourceLocation CC) {
// Don't diagnose in unevaluated contexts.
if (isUnevaluatedContext())
return;
// Don't diagnose for value- or type-dependent expressions.
if (E->isTypeDependent() || E->isValueDependent())
return;
// Check for array bounds violations in cases where the check isn't triggered
// elsewhere for other Expr types (like BinaryOperators), e.g. when an
// ArraySubscriptExpr is on the RHS of a variable initialization.
CheckArrayAccess(E);
// This is not the right CC for (e.g.) a variable initialization.
AnalyzeImplicitConversions(*this, E, CC);
}
/// CheckBoolLikeConversion - Check conversion of given expression to boolean.
/// Input argument E is a logical expression.
void Sema::CheckBoolLikeConversion(Expr *E, SourceLocation CC) {
::CheckBoolLikeConversion(*this, E, CC);
}
/// Diagnose when expression is an integer constant expression and its evaluation
/// results in integer overflow
void Sema::CheckForIntOverflow (Expr *E) {
// Use a work list to deal with nested struct initializers.
SmallVector<Expr *, 2> Exprs(1, E);
do {
Expr *E = Exprs.pop_back_val();
if (isa<BinaryOperator>(E->IgnoreParenCasts())) {
E->IgnoreParenCasts()->EvaluateForOverflow(Context);
continue;
}
if (auto InitList = dyn_cast<InitListExpr>(E))
Exprs.append(InitList->inits().begin(), InitList->inits().end());
if (isa<ObjCBoxedExpr>(E))
E->IgnoreParenCasts()->EvaluateForOverflow(Context);
} while (!Exprs.empty());
}
namespace {
/// \brief Visitor for expressions which looks for unsequenced operations on the
/// same object.
class SequenceChecker : public EvaluatedExprVisitor<SequenceChecker> {
typedef EvaluatedExprVisitor<SequenceChecker> Base;
/// \brief A tree of sequenced regions within an expression. Two regions are
/// unsequenced if one is an ancestor or a descendent of the other. When we
/// finish processing an expression with sequencing, such as a comma
/// expression, we fold its tree nodes into its parent, since they are
/// unsequenced with respect to nodes we will visit later.
class SequenceTree {
struct Value {
explicit Value(unsigned Parent) : Parent(Parent), Merged(false) {}
unsigned Parent : 31;
unsigned Merged : 1;
};
SmallVector<Value, 8> Values;
public:
/// \brief A region within an expression which may be sequenced with respect
/// to some other region.
class Seq {
explicit Seq(unsigned N) : Index(N) {}
unsigned Index;
friend class SequenceTree;
public:
Seq() : Index(0) {}
};
SequenceTree() { Values.push_back(Value(0)); }
Seq root() const { return Seq(0); }
/// \brief Create a new sequence of operations, which is an unsequenced
/// subset of \p Parent. This sequence of operations is sequenced with
/// respect to other children of \p Parent.
Seq allocate(Seq Parent) {
Values.push_back(Value(Parent.Index));
return Seq(Values.size() - 1);
}
/// \brief Merge a sequence of operations into its parent.
void merge(Seq S) {
Values[S.Index].Merged = true;
}
/// \brief Determine whether two operations are unsequenced. This operation
/// is asymmetric: \p Cur should be the more recent sequence, and \p Old
/// should have been merged into its parent as appropriate.
bool isUnsequenced(Seq Cur, Seq Old) {
unsigned C = representative(Cur.Index);
unsigned Target = representative(Old.Index);
while (C >= Target) {
if (C == Target)
return true;
C = Values[C].Parent;
}
return false;
}
private:
/// \brief Pick a representative for a sequence.
unsigned representative(unsigned K) {
if (Values[K].Merged)
// Perform path compression as we go.
return Values[K].Parent = representative(Values[K].Parent);
return K;
}
};
/// An object for which we can track unsequenced uses.
typedef NamedDecl *Object;
/// Different flavors of object usage which we track. We only track the
/// least-sequenced usage of each kind.
enum UsageKind {
/// A read of an object. Multiple unsequenced reads are OK.
UK_Use,
/// A modification of an object which is sequenced before the value
/// computation of the expression, such as ++n in C++.
UK_ModAsValue,
/// A modification of an object which is not sequenced before the value
/// computation of the expression, such as n++.
UK_ModAsSideEffect,
UK_Count = UK_ModAsSideEffect + 1
};
struct Usage {
Usage() : Use(nullptr), Seq() {}
Expr *Use;
SequenceTree::Seq Seq;
};
struct UsageInfo {
UsageInfo() : Diagnosed(false) {}
Usage Uses[UK_Count];
/// Have we issued a diagnostic for this variable already?
bool Diagnosed;
};
typedef llvm::SmallDenseMap<Object, UsageInfo, 16> UsageInfoMap;
Sema &SemaRef;
/// Sequenced regions within the expression.
SequenceTree Tree;
/// Declaration modifications and references which we have seen.
UsageInfoMap UsageMap;
/// The region we are currently within.
SequenceTree::Seq Region;
/// Filled in with declarations which were modified as a side-effect
/// (that is, post-increment operations).
SmallVectorImpl<std::pair<Object, Usage> > *ModAsSideEffect;
/// Expressions to check later. We defer checking these to reduce
/// stack usage.
SmallVectorImpl<Expr *> &WorkList;
/// RAII object wrapping the visitation of a sequenced subexpression of an
/// expression. At the end of this process, the side-effects of the evaluation
/// become sequenced with respect to the value computation of the result, so
/// we downgrade any UK_ModAsSideEffect within the evaluation to
/// UK_ModAsValue.
struct SequencedSubexpression {
SequencedSubexpression(SequenceChecker &Self)
: Self(Self), OldModAsSideEffect(Self.ModAsSideEffect) {
Self.ModAsSideEffect = &ModAsSideEffect;
}
~SequencedSubexpression() {
for (auto &M : llvm::reverse(ModAsSideEffect)) {
UsageInfo &U = Self.UsageMap[M.first];
auto &SideEffectUsage = U.Uses[UK_ModAsSideEffect];
Self.addUsage(U, M.first, SideEffectUsage.Use, UK_ModAsValue);
SideEffectUsage = M.second;
}
Self.ModAsSideEffect = OldModAsSideEffect;
}
SequenceChecker &Self;
SmallVector<std::pair<Object, Usage>, 4> ModAsSideEffect;
SmallVectorImpl<std::pair<Object, Usage> > *OldModAsSideEffect;
};
/// RAII object wrapping the visitation of a subexpression which we might
/// choose to evaluate as a constant. If any subexpression is evaluated and
/// found to be non-constant, this allows us to suppress the evaluation of
/// the outer expression.
class EvaluationTracker {
public:
EvaluationTracker(SequenceChecker &Self)
: Self(Self), Prev(Self.EvalTracker), EvalOK(true) {
Self.EvalTracker = this;
}
~EvaluationTracker() {
Self.EvalTracker = Prev;
if (Prev)
Prev->EvalOK &= EvalOK;
}
bool evaluate(const Expr *E, bool &Result) {
if (!EvalOK || E->isValueDependent())
return false;
EvalOK = E->EvaluateAsBooleanCondition(Result, Self.SemaRef.Context);
return EvalOK;
}
private:
SequenceChecker &Self;
EvaluationTracker *Prev;
bool EvalOK;
} *EvalTracker;
/// \brief Find the object which is produced by the specified expression,
/// if any.
Object getObject(Expr *E, bool Mod) const {
E = E->IgnoreParenCasts();
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E)) {
if (Mod && (UO->getOpcode() == UO_PreInc || UO->getOpcode() == UO_PreDec))
return getObject(UO->getSubExpr(), Mod);
} else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
if (BO->getOpcode() == BO_Comma)
return getObject(BO->getRHS(), Mod);
if (Mod && BO->isAssignmentOp())
return getObject(BO->getLHS(), Mod);
} else if (MemberExpr *ME = dyn_cast<MemberExpr>(E)) {
// FIXME: Check for more interesting cases, like "x.n = ++x.n".
if (isa<CXXThisExpr>(ME->getBase()->IgnoreParenCasts()))
return ME->getMemberDecl();
} else if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
// FIXME: If this is a reference, map through to its value.
return DRE->getDecl();
return nullptr;
}
/// \brief Note that an object was modified or used by an expression.
void addUsage(UsageInfo &UI, Object O, Expr *Ref, UsageKind UK) {
Usage &U = UI.Uses[UK];
if (!U.Use || !Tree.isUnsequenced(Region, U.Seq)) {
if (UK == UK_ModAsSideEffect && ModAsSideEffect)
ModAsSideEffect->push_back(std::make_pair(O, U));
U.Use = Ref;
U.Seq = Region;
}
}
/// \brief Check whether a modification or use conflicts with a prior usage.
void checkUsage(Object O, UsageInfo &UI, Expr *Ref, UsageKind OtherKind,
bool IsModMod) {
if (UI.Diagnosed)
return;
const Usage &U = UI.Uses[OtherKind];
if (!U.Use || !Tree.isUnsequenced(Region, U.Seq))
return;
Expr *Mod = U.Use;
Expr *ModOrUse = Ref;
if (OtherKind == UK_Use)
std::swap(Mod, ModOrUse);
SemaRef.Diag(Mod->getExprLoc(),
IsModMod ? diag::warn_unsequenced_mod_mod
: diag::warn_unsequenced_mod_use)
<< O << SourceRange(ModOrUse->getExprLoc());
UI.Diagnosed = true;
}
void notePreUse(Object O, Expr *Use) {
UsageInfo &U = UsageMap[O];
// Uses conflict with other modifications.
checkUsage(O, U, Use, UK_ModAsValue, false);
}
void notePostUse(Object O, Expr *Use) {
UsageInfo &U = UsageMap[O];
checkUsage(O, U, Use, UK_ModAsSideEffect, false);
addUsage(U, O, Use, UK_Use);
}
void notePreMod(Object O, Expr *Mod) {
UsageInfo &U = UsageMap[O];
// Modifications conflict with other modifications and with uses.
checkUsage(O, U, Mod, UK_ModAsValue, true);
checkUsage(O, U, Mod, UK_Use, false);
}
void notePostMod(Object O, Expr *Use, UsageKind UK) {
UsageInfo &U = UsageMap[O];
checkUsage(O, U, Use, UK_ModAsSideEffect, true);
addUsage(U, O, Use, UK);
}
public:
SequenceChecker(Sema &S, Expr *E, SmallVectorImpl<Expr *> &WorkList)
: Base(S.Context), SemaRef(S), Region(Tree.root()),
ModAsSideEffect(nullptr), WorkList(WorkList), EvalTracker(nullptr) {
Visit(E);
}
void VisitStmt(Stmt *S) {
// Skip all statements which aren't expressions for now.
}
void VisitExpr(Expr *E) {
// By default, just recurse to evaluated subexpressions.
Base::VisitStmt(E);
}
void VisitCastExpr(CastExpr *E) {
Object O = Object();
if (E->getCastKind() == CK_LValueToRValue)
O = getObject(E->getSubExpr(), false);
if (O)
notePreUse(O, E);
VisitExpr(E);
if (O)
notePostUse(O, E);
}
void VisitBinComma(BinaryOperator *BO) {
// C++11 [expr.comma]p1:
// Every value computation and side effect associated with the left
// expression is sequenced before every value computation and side
// effect associated with the right expression.
SequenceTree::Seq LHS = Tree.allocate(Region);
SequenceTree::Seq RHS = Tree.allocate(Region);
SequenceTree::Seq OldRegion = Region;
{
SequencedSubexpression SeqLHS(*this);
Region = LHS;
Visit(BO->getLHS());
}
Region = RHS;
Visit(BO->getRHS());
Region = OldRegion;
// Forget that LHS and RHS are sequenced. They are both unsequenced
// with respect to other stuff.
Tree.merge(LHS);
Tree.merge(RHS);
}
void VisitBinAssign(BinaryOperator *BO) {
// The modification is sequenced after the value computation of the LHS
// and RHS, so check it before inspecting the operands and update the
// map afterwards.
Object O = getObject(BO->getLHS(), true);
if (!O)
return VisitExpr(BO);
notePreMod(O, BO);
// C++11 [expr.ass]p7:
// E1 op= E2 is equivalent to E1 = E1 op E2, except that E1 is evaluated
// only once.
//
// Therefore, for a compound assignment operator, O is considered used
// everywhere except within the evaluation of E1 itself.
if (isa<CompoundAssignOperator>(BO))
notePreUse(O, BO);
Visit(BO->getLHS());
if (isa<CompoundAssignOperator>(BO))
notePostUse(O, BO);
Visit(BO->getRHS());
// C++11 [expr.ass]p1:
// the assignment is sequenced [...] before the value computation of the
// assignment expression.
// C11 6.5.16/3 has no such rule.
notePostMod(O, BO, SemaRef.getLangOpts().CPlusPlus ? UK_ModAsValue
: UK_ModAsSideEffect);
}
void VisitCompoundAssignOperator(CompoundAssignOperator *CAO) {
VisitBinAssign(CAO);
}
void VisitUnaryPreInc(UnaryOperator *UO) { VisitUnaryPreIncDec(UO); }
void VisitUnaryPreDec(UnaryOperator *UO) { VisitUnaryPreIncDec(UO); }
void VisitUnaryPreIncDec(UnaryOperator *UO) {
Object O = getObject(UO->getSubExpr(), true);
if (!O)
return VisitExpr(UO);
notePreMod(O, UO);
Visit(UO->getSubExpr());
// C++11 [expr.pre.incr]p1:
// the expression ++x is equivalent to x+=1
notePostMod(O, UO, SemaRef.getLangOpts().CPlusPlus ? UK_ModAsValue
: UK_ModAsSideEffect);
}
void VisitUnaryPostInc(UnaryOperator *UO) { VisitUnaryPostIncDec(UO); }
void VisitUnaryPostDec(UnaryOperator *UO) { VisitUnaryPostIncDec(UO); }
void VisitUnaryPostIncDec(UnaryOperator *UO) {
Object O = getObject(UO->getSubExpr(), true);
if (!O)
return VisitExpr(UO);
notePreMod(O, UO);
Visit(UO->getSubExpr());
notePostMod(O, UO, UK_ModAsSideEffect);
}
void VisitCilkSpawnExpr(CilkSpawnExpr *E) {
Object O = getObject(E->getSpawnedExpr(), true);
if (!O)
return VisitExpr(E);
// Cilk_spawn removes sequencing of the spawned expression.
// notePreUse(O, E);
Visit(E->getSpawnedExpr());
// notePostUse(O, E);
}
/// Don't visit the RHS of '&&' or '||' if it might not be evaluated.
void VisitBinLOr(BinaryOperator *BO) {
// The side-effects of the LHS of an '&&' are sequenced before the
// value computation of the RHS, and hence before the value computation
// of the '&&' itself, unless the LHS evaluates to zero. We treat them
// as if they were unconditionally sequenced.
EvaluationTracker Eval(*this);
{
SequencedSubexpression Sequenced(*this);
Visit(BO->getLHS());
}
bool Result;
if (Eval.evaluate(BO->getLHS(), Result)) {
if (!Result)
Visit(BO->getRHS());
} else {
// Check for unsequenced operations in the RHS, treating it as an
// entirely separate evaluation.
//
// FIXME: If there are operations in the RHS which are unsequenced
// with respect to operations outside the RHS, and those operations
// are unconditionally evaluated, diagnose them.
WorkList.push_back(BO->getRHS());
}
}
void VisitBinLAnd(BinaryOperator *BO) {
EvaluationTracker Eval(*this);
{
SequencedSubexpression Sequenced(*this);
Visit(BO->getLHS());
}
bool Result;
if (Eval.evaluate(BO->getLHS(), Result)) {
if (Result)
Visit(BO->getRHS());
} else {
WorkList.push_back(BO->getRHS());
}
}
// Only visit the condition, unless we can be sure which subexpression will
// be chosen.
void VisitAbstractConditionalOperator(AbstractConditionalOperator *CO) {
EvaluationTracker Eval(*this);
{
SequencedSubexpression Sequenced(*this);
Visit(CO->getCond());
}
bool Result;
if (Eval.evaluate(CO->getCond(), Result))
Visit(Result ? CO->getTrueExpr() : CO->getFalseExpr());
else {
WorkList.push_back(CO->getTrueExpr());
WorkList.push_back(CO->getFalseExpr());
}
}
void VisitCallExpr(CallExpr *CE) {
// C++11 [intro.execution]p15:
// When calling a function [...], every value computation and side effect
// associated with any argument expression, or with the postfix expression
// designating the called function, is sequenced before execution of every
// expression or statement in the body of the function [and thus before
// the value computation of its result].
SequencedSubexpression Sequenced(*this);
Base::VisitCallExpr(CE);
// FIXME: CXXNewExpr and CXXDeleteExpr implicitly call functions.
}
void VisitCXXConstructExpr(CXXConstructExpr *CCE) {
// This is a call, so all subexpressions are sequenced before the result.
SequencedSubexpression Sequenced(*this);
if (!CCE->isListInitialization())
return VisitExpr(CCE);
// In C++11, list initializations are sequenced.
SmallVector<SequenceTree::Seq, 32> Elts;
SequenceTree::Seq Parent = Region;
for (CXXConstructExpr::arg_iterator I = CCE->arg_begin(),
E = CCE->arg_end();
I != E; ++I) {
Region = Tree.allocate(Parent);
Elts.push_back(Region);
Visit(*I);
}
// Forget that the initializers are sequenced.
Region = Parent;
for (unsigned I = 0; I < Elts.size(); ++I)
Tree.merge(Elts[I]);
}
void VisitInitListExpr(InitListExpr *ILE) {
if (!SemaRef.getLangOpts().CPlusPlus11)
return VisitExpr(ILE);
// In C++11, list initializations are sequenced.
SmallVector<SequenceTree::Seq, 32> Elts;
SequenceTree::Seq Parent = Region;
for (unsigned I = 0; I < ILE->getNumInits(); ++I) {
Expr *E = ILE->getInit(I);
if (!E) continue;
Region = Tree.allocate(Parent);
Elts.push_back(Region);
Visit(E);
}
// Forget that the initializers are sequenced.
Region = Parent;
for (unsigned I = 0; I < Elts.size(); ++I)
Tree.merge(Elts[I]);
}
};
} // end anonymous namespace
void Sema::CheckUnsequencedOperations(Expr *E) {
SmallVector<Expr *, 8> WorkList;
WorkList.push_back(E);
while (!WorkList.empty()) {
Expr *Item = WorkList.pop_back_val();
SequenceChecker(*this, Item, WorkList);
}
}
void Sema::CheckCompletedExpr(Expr *E, SourceLocation CheckLoc,
bool IsConstexpr) {
CheckImplicitConversions(E, CheckLoc);
if (!E->isInstantiationDependent())
CheckUnsequencedOperations(E);
if (!IsConstexpr && !E->isValueDependent())
CheckForIntOverflow(E);
DiagnoseMisalignedMembers();
}
void Sema::CheckBitFieldInitialization(SourceLocation InitLoc,
FieldDecl *BitField,
Expr *Init) {
(void) AnalyzeBitFieldAssignment(*this, BitField, Init, InitLoc);
}
static void diagnoseArrayStarInParamType(Sema &S, QualType PType,
SourceLocation Loc) {
if (!PType->isVariablyModifiedType())
return;
if (const auto *PointerTy = dyn_cast<PointerType>(PType)) {
diagnoseArrayStarInParamType(S, PointerTy->getPointeeType(), Loc);
return;
}
if (const auto *ReferenceTy = dyn_cast<ReferenceType>(PType)) {
diagnoseArrayStarInParamType(S, ReferenceTy->getPointeeType(), Loc);
return;
}
if (const auto *ParenTy = dyn_cast<ParenType>(PType)) {
diagnoseArrayStarInParamType(S, ParenTy->getInnerType(), Loc);
return;
}
const ArrayType *AT = S.Context.getAsArrayType(PType);
if (!AT)
return;
if (AT->getSizeModifier() != ArrayType::Star) {
diagnoseArrayStarInParamType(S, AT->getElementType(), Loc);
return;
}
S.Diag(Loc, diag::err_array_star_in_function_definition);
}
/// CheckParmsForFunctionDef - Check that the parameters of the given
/// function are appropriate for the definition of a function. This
/// takes care of any checks that cannot be performed on the
/// declaration itself, e.g., that the types of each of the function
/// parameters are complete.
bool Sema::CheckParmsForFunctionDef(ArrayRef<ParmVarDecl *> Parameters,
bool CheckParameterNames) {
bool HasInvalidParm = false;
for (ParmVarDecl *Param : Parameters) {
// C99 6.7.5.3p4: the parameters in a parameter type list in a
// function declarator that is part of a function definition of
// that function shall not have incomplete type.
//
// This is also C++ [dcl.fct]p6.
if (!Param->isInvalidDecl() &&
RequireCompleteType(Param->getLocation(), Param->getType(),
diag::err_typecheck_decl_incomplete_type)) {
Param->setInvalidDecl();
HasInvalidParm = true;
}
// C99 6.9.1p5: If the declarator includes a parameter type list, the
// declaration of each parameter shall include an identifier.
if (CheckParameterNames &&
Param->getIdentifier() == nullptr &&
!Param->isImplicit() &&
!getLangOpts().CPlusPlus)
Diag(Param->getLocation(), diag::err_parameter_name_omitted);
// C99 6.7.5.3p12:
// If the function declarator is not part of a definition of that
// function, parameters may have incomplete type and may use the [*]
// notation in their sequences of declarator specifiers to specify
// variable length array types.
QualType PType = Param->getOriginalType();
// FIXME: This diagnostic should point the '[*]' if source-location
// information is added for it.
diagnoseArrayStarInParamType(*this, PType, Param->getLocation());
// MSVC destroys objects passed by value in the callee. Therefore a
// function definition which takes such a parameter must be able to call the
// object's destructor. However, we don't perform any direct access check
// on the dtor.
if (getLangOpts().CPlusPlus && Context.getTargetInfo()
.getCXXABI()
.areArgsDestroyedLeftToRightInCallee()) {
if (!Param->isInvalidDecl()) {
if (const RecordType *RT = Param->getType()->getAs<RecordType>()) {
CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(RT->getDecl());
if (!ClassDecl->isInvalidDecl() &&
!ClassDecl->hasIrrelevantDestructor() &&
!ClassDecl->isDependentContext()) {
CXXDestructorDecl *Destructor = LookupDestructor(ClassDecl);
MarkFunctionReferenced(Param->getLocation(), Destructor);
DiagnoseUseOfDecl(Destructor, Param->getLocation());
}
}
}
}
// Parameters with the pass_object_size attribute only need to be marked
// constant at function definitions. Because we lack information about
// whether we're on a declaration or definition when we're instantiating the
// attribute, we need to check for constness here.
if (const auto *Attr = Param->getAttr<PassObjectSizeAttr>())
if (!Param->getType().isConstQualified())
Diag(Param->getLocation(), diag::err_attribute_pointers_only)
<< Attr->getSpelling() << 1;
}
return HasInvalidParm;
}
/// A helper function to get the alignment of a Decl referred to by DeclRefExpr
/// or MemberExpr.
static CharUnits getDeclAlign(Expr *E, CharUnits TypeAlign,
ASTContext &Context) {
if (const auto *DRE = dyn_cast<DeclRefExpr>(E))
return Context.getDeclAlign(DRE->getDecl());
if (const auto *ME = dyn_cast<MemberExpr>(E))
return Context.getDeclAlign(ME->getMemberDecl());
return TypeAlign;
}
/// CheckCastAlign - Implements -Wcast-align, which warns when a
/// pointer cast increases the alignment requirements.
void Sema::CheckCastAlign(Expr *Op, QualType T, SourceRange TRange) {
// This is actually a lot of work to potentially be doing on every
// cast; don't do it if we're ignoring -Wcast_align (as is the default).
if (getDiagnostics().isIgnored(diag::warn_cast_align, TRange.getBegin()))
return;
// Ignore dependent types.
if (T->isDependentType() || Op->getType()->isDependentType())
return;
// Require that the destination be a pointer type.
const PointerType *DestPtr = T->getAs<PointerType>();
if (!DestPtr) return;
// If the destination has alignment 1, we're done.
QualType DestPointee = DestPtr->getPointeeType();
if (DestPointee->isIncompleteType()) return;
CharUnits DestAlign = Context.getTypeAlignInChars(DestPointee);
if (DestAlign.isOne()) return;
// Require that the source be a pointer type.
const PointerType *SrcPtr = Op->getType()->getAs<PointerType>();
if (!SrcPtr) return;
QualType SrcPointee = SrcPtr->getPointeeType();
// Whitelist casts from cv void*. We already implicitly
// whitelisted casts to cv void*, since they have alignment 1.
// Also whitelist casts involving incomplete types, which implicitly
// includes 'void'.
if (SrcPointee->isIncompleteType()) return;
CharUnits SrcAlign = Context.getTypeAlignInChars(SrcPointee);
if (auto *CE = dyn_cast<CastExpr>(Op)) {
if (CE->getCastKind() == CK_ArrayToPointerDecay)
SrcAlign = getDeclAlign(CE->getSubExpr(), SrcAlign, Context);
} else if (auto *UO = dyn_cast<UnaryOperator>(Op)) {
if (UO->getOpcode() == UO_AddrOf)
SrcAlign = getDeclAlign(UO->getSubExpr(), SrcAlign, Context);
}
if (SrcAlign >= DestAlign) return;
Diag(TRange.getBegin(), diag::warn_cast_align)
<< Op->getType() << T
<< static_cast<unsigned>(SrcAlign.getQuantity())
<< static_cast<unsigned>(DestAlign.getQuantity())
<< TRange << Op->getSourceRange();
}
/// \brief Check whether this array fits the idiom of a size-one tail padded
/// array member of a struct.
///
/// We avoid emitting out-of-bounds access warnings for such arrays as they are
/// commonly used to emulate flexible arrays in C89 code.
static bool IsTailPaddedMemberArray(Sema &S, const llvm::APInt &Size,
const NamedDecl *ND) {
if (Size != 1 || !ND) return false;
const FieldDecl *FD = dyn_cast<FieldDecl>(ND);
if (!FD) return false;
// Don't consider sizes resulting from macro expansions or template argument
// substitution to form C89 tail-padded arrays.
TypeSourceInfo *TInfo = FD->getTypeSourceInfo();
while (TInfo) {
TypeLoc TL = TInfo->getTypeLoc();
// Look through typedefs.
if (TypedefTypeLoc TTL = TL.getAs<TypedefTypeLoc>()) {
const TypedefNameDecl *TDL = TTL.getTypedefNameDecl();
TInfo = TDL->getTypeSourceInfo();
continue;
}
if (ConstantArrayTypeLoc CTL = TL.getAs<ConstantArrayTypeLoc>()) {
const Expr *SizeExpr = dyn_cast<IntegerLiteral>(CTL.getSizeExpr());
if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
return false;
}
break;
}
const RecordDecl *RD = dyn_cast<RecordDecl>(FD->getDeclContext());
if (!RD) return false;
if (RD->isUnion()) return false;
if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) {
if (!CRD->isStandardLayout()) return false;
}
// See if this is the last field decl in the record.
const Decl *D = FD;
while ((D = D->getNextDeclInContext()))
if (isa<FieldDecl>(D))
return false;
return true;
}
void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr,
const ArraySubscriptExpr *ASE,
bool AllowOnePastEnd, bool IndexNegated) {
IndexExpr = IndexExpr->IgnoreParenImpCasts();
if (IndexExpr->isValueDependent())
return;
const Type *EffectiveType =
BaseExpr->getType()->getPointeeOrArrayElementType();
BaseExpr = BaseExpr->IgnoreParenCasts();
const ConstantArrayType *ArrayTy =
Context.getAsConstantArrayType(BaseExpr->getType());
if (!ArrayTy)
return;
llvm::APSInt index;
if (!IndexExpr->EvaluateAsInt(index, Context, Expr::SE_AllowSideEffects))
return;
if (IndexNegated)
index = -index;
const NamedDecl *ND = nullptr;
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(BaseExpr))
ND = dyn_cast<NamedDecl>(DRE->getDecl());
if (const MemberExpr *ME = dyn_cast<MemberExpr>(BaseExpr))
ND = dyn_cast<NamedDecl>(ME->getMemberDecl());
if (index.isUnsigned() || !index.isNegative()) {
llvm::APInt size = ArrayTy->getSize();
if (!size.isStrictlyPositive())
return;
const Type *BaseType = BaseExpr->getType()->getPointeeOrArrayElementType();
if (BaseType != EffectiveType) {
// Make sure we're comparing apples to apples when comparing index to size
uint64_t ptrarith_typesize = Context.getTypeSize(EffectiveType);
uint64_t array_typesize = Context.getTypeSize(BaseType);
// Handle ptrarith_typesize being zero, such as when casting to void*
if (!ptrarith_typesize) ptrarith_typesize = 1;
if (ptrarith_typesize != array_typesize) {
// There's a cast to a different size type involved
uint64_t ratio = array_typesize / ptrarith_typesize;
// TODO: Be smarter about handling cases where array_typesize is not a
// multiple of ptrarith_typesize
if (ptrarith_typesize * ratio == array_typesize)
size *= llvm::APInt(size.getBitWidth(), ratio);
}
}
if (size.getBitWidth() > index.getBitWidth())
index = index.zext(size.getBitWidth());
else if (size.getBitWidth() < index.getBitWidth())
size = size.zext(index.getBitWidth());
// For array subscripting the index must be less than size, but for pointer
// arithmetic also allow the index (offset) to be equal to size since
// computing the next address after the end of the array is legal and
// commonly done e.g. in C++ iterators and range-based for loops.
if (AllowOnePastEnd ? index.ule(size) : index.ult(size))
return;
// Also don't warn for arrays of size 1 which are members of some
// structure. These are often used to approximate flexible arrays in C89
// code.
if (IsTailPaddedMemberArray(*this, size, ND))
return;
// Suppress the warning if the subscript expression (as identified by the
// ']' location) and the index expression are both from macro expansions
// within a system header.
if (ASE) {
SourceLocation RBracketLoc = SourceMgr.getSpellingLoc(
ASE->getRBracketLoc());
if (SourceMgr.isInSystemHeader(RBracketLoc)) {
SourceLocation IndexLoc = SourceMgr.getSpellingLoc(
IndexExpr->getLocStart());
if (SourceMgr.isWrittenInSameFile(RBracketLoc, IndexLoc))
return;
}
}
unsigned DiagID = diag::warn_ptr_arith_exceeds_bounds;
if (ASE)
DiagID = diag::warn_array_index_exceeds_bounds;
DiagRuntimeBehavior(BaseExpr->getLocStart(), BaseExpr,
PDiag(DiagID) << index.toString(10, true)
<< size.toString(10, true)
<< (unsigned)size.getLimitedValue(~0U)
<< IndexExpr->getSourceRange());
} else {
unsigned DiagID = diag::warn_array_index_precedes_bounds;
if (!ASE) {
DiagID = diag::warn_ptr_arith_precedes_bounds;
if (index.isNegative()) index = -index;
}
DiagRuntimeBehavior(BaseExpr->getLocStart(), BaseExpr,
PDiag(DiagID) << index.toString(10, true)
<< IndexExpr->getSourceRange());
}
if (!ND) {
// Try harder to find a NamedDecl to point at in the note.
while (const ArraySubscriptExpr *ASE =
dyn_cast<ArraySubscriptExpr>(BaseExpr))
BaseExpr = ASE->getBase()->IgnoreParenCasts();
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(BaseExpr))
ND = dyn_cast<NamedDecl>(DRE->getDecl());
if (const MemberExpr *ME = dyn_cast<MemberExpr>(BaseExpr))
ND = dyn_cast<NamedDecl>(ME->getMemberDecl());
}
if (ND)
DiagRuntimeBehavior(ND->getLocStart(), BaseExpr,
PDiag(diag::note_array_index_out_of_bounds)
<< ND->getDeclName());
}
void Sema::CheckArrayAccess(const Expr *expr) {
int AllowOnePastEnd = 0;
while (expr) {
expr = expr->IgnoreParenImpCasts();
switch (expr->getStmtClass()) {
case Stmt::ArraySubscriptExprClass: {
const ArraySubscriptExpr *ASE = cast<ArraySubscriptExpr>(expr);
CheckArrayAccess(ASE->getBase(), ASE->getIdx(), ASE,
AllowOnePastEnd > 0);
return;
}
case Stmt::OMPArraySectionExprClass: {
const OMPArraySectionExpr *ASE = cast<OMPArraySectionExpr>(expr);
if (ASE->getLowerBound())
CheckArrayAccess(ASE->getBase(), ASE->getLowerBound(),
/*ASE=*/nullptr, AllowOnePastEnd > 0);
return;
}
case Stmt::UnaryOperatorClass: {
// Only unwrap the * and & unary operators
const UnaryOperator *UO = cast<UnaryOperator>(expr);
expr = UO->getSubExpr();
switch (UO->getOpcode()) {
case UO_AddrOf:
AllowOnePastEnd++;
break;
case UO_Deref:
AllowOnePastEnd--;
break;
default:
return;
}
break;
}
case Stmt::ConditionalOperatorClass: {
const ConditionalOperator *cond = cast<ConditionalOperator>(expr);
if (const Expr *lhs = cond->getLHS())
CheckArrayAccess(lhs);
if (const Expr *rhs = cond->getRHS())
CheckArrayAccess(rhs);
return;
}
case Stmt::CXXOperatorCallExprClass: {
const auto *OCE = cast<CXXOperatorCallExpr>(expr);
for (const auto *Arg : OCE->arguments())
CheckArrayAccess(Arg);
return;
}
default:
return;
}
}
}
//===--- CHECK: Objective-C retain cycles ----------------------------------//
namespace {
struct RetainCycleOwner {
RetainCycleOwner() : Variable(nullptr), Indirect(false) {}
VarDecl *Variable;
SourceRange Range;
SourceLocation Loc;
bool Indirect;
void setLocsFrom(Expr *e) {
Loc = e->getExprLoc();
Range = e->getSourceRange();
}
};
} // end anonymous namespace
/// Consider whether capturing the given variable can possibly lead to
/// a retain cycle.
static bool considerVariable(VarDecl *var, Expr *ref, RetainCycleOwner &owner) {
// In ARC, it's captured strongly iff the variable has __strong
// lifetime. In MRR, it's captured strongly if the variable is
// __block and has an appropriate type.
if (var->getType().getObjCLifetime() != Qualifiers::OCL_Strong)
return false;
owner.Variable = var;
if (ref)
owner.setLocsFrom(ref);
return true;
}
static bool findRetainCycleOwner(Sema &S, Expr *e, RetainCycleOwner &owner) {
while (true) {
e = e->IgnoreParens();
if (CastExpr *cast = dyn_cast<CastExpr>(e)) {
switch (cast->getCastKind()) {
case CK_BitCast:
case CK_LValueBitCast:
case CK_LValueToRValue:
case CK_ARCReclaimReturnedObject:
e = cast->getSubExpr();
continue;
default:
return false;
}
}
if (ObjCIvarRefExpr *ref = dyn_cast<ObjCIvarRefExpr>(e)) {
ObjCIvarDecl *ivar = ref->getDecl();
if (ivar->getType().getObjCLifetime() != Qualifiers::OCL_Strong)
return false;
// Try to find a retain cycle in the base.
if (!findRetainCycleOwner(S, ref->getBase(), owner))
return false;
if (ref->isFreeIvar()) owner.setLocsFrom(ref);
owner.Indirect = true;
return true;
}
if (DeclRefExpr *ref = dyn_cast<DeclRefExpr>(e)) {
VarDecl *var = dyn_cast<VarDecl>(ref->getDecl());
if (!var) return false;
return considerVariable(var, ref, owner);
}
if (MemberExpr *member = dyn_cast<MemberExpr>(e)) {
if (member->isArrow()) return false;
// Don't count this as an indirect ownership.
e = member->getBase();
continue;
}
if (PseudoObjectExpr *pseudo = dyn_cast<PseudoObjectExpr>(e)) {
// Only pay attention to pseudo-objects on property references.
ObjCPropertyRefExpr *pre
= dyn_cast<ObjCPropertyRefExpr>(pseudo->getSyntacticForm()
->IgnoreParens());
if (!pre) return false;
if (pre->isImplicitProperty()) return false;
ObjCPropertyDecl *property = pre->getExplicitProperty();
if (!property->isRetaining() &&
!(property->getPropertyIvarDecl() &&
property->getPropertyIvarDecl()->getType()
.getObjCLifetime() == Qualifiers::OCL_Strong))
return false;
owner.Indirect = true;
if (pre->isSuperReceiver()) {
owner.Variable = S.getCurMethodDecl()->getSelfDecl();
if (!owner.Variable)
return false;
owner.Loc = pre->getLocation();
owner.Range = pre->getSourceRange();
return true;
}
e = const_cast<Expr*>(cast<OpaqueValueExpr>(pre->getBase())
->getSourceExpr());
continue;
}
// Array ivars?
return false;
}
}
namespace {
struct FindCaptureVisitor : EvaluatedExprVisitor<FindCaptureVisitor> {
FindCaptureVisitor(ASTContext &Context, VarDecl *variable)
: EvaluatedExprVisitor<FindCaptureVisitor>(Context),
Context(Context), Variable(variable), Capturer(nullptr),
VarWillBeReased(false) {}
ASTContext &Context;
VarDecl *Variable;
Expr *Capturer;
bool VarWillBeReased;
void VisitDeclRefExpr(DeclRefExpr *ref) {
if (ref->getDecl() == Variable && !Capturer)
Capturer = ref;
}
void VisitObjCIvarRefExpr(ObjCIvarRefExpr *ref) {
if (Capturer) return;
Visit(ref->getBase());
if (Capturer && ref->isFreeIvar())
Capturer = ref;
}
void VisitBlockExpr(BlockExpr *block) {
// Look inside nested blocks
if (block->getBlockDecl()->capturesVariable(Variable))
Visit(block->getBlockDecl()->getBody());
}
void VisitOpaqueValueExpr(OpaqueValueExpr *OVE) {
if (Capturer) return;
if (OVE->getSourceExpr())
Visit(OVE->getSourceExpr());
}
void VisitBinaryOperator(BinaryOperator *BinOp) {
if (!Variable || VarWillBeReased || BinOp->getOpcode() != BO_Assign)
return;
Expr *LHS = BinOp->getLHS();
if (const DeclRefExpr *DRE = dyn_cast_or_null<DeclRefExpr>(LHS)) {
if (DRE->getDecl() != Variable)
return;
if (Expr *RHS = BinOp->getRHS()) {
RHS = RHS->IgnoreParenCasts();
llvm::APSInt Value;
VarWillBeReased =
(RHS && RHS->isIntegerConstantExpr(Value, Context) && Value == 0);
}
}
}
};
} // end anonymous namespace
/// Check whether the given argument is a block which captures a
/// variable.
static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) {
assert(owner.Variable && owner.Loc.isValid());
e = e->IgnoreParenCasts();
// Look through [^{...} copy] and Block_copy(^{...}).
if (ObjCMessageExpr *ME = dyn_cast<ObjCMessageExpr>(e)) {
Selector Cmd = ME->getSelector();
if (Cmd.isUnarySelector() && Cmd.getNameForSlot(0) == "copy") {
e = ME->getInstanceReceiver();
if (!e)
return nullptr;
e = e->IgnoreParenCasts();
}
} else if (CallExpr *CE = dyn_cast<CallExpr>(e)) {
if (CE->getNumArgs() == 1) {
FunctionDecl *Fn = dyn_cast_or_null<FunctionDecl>(CE->getCalleeDecl());
if (Fn) {
const IdentifierInfo *FnI = Fn->getIdentifier();
if (FnI && FnI->isStr("_Block_copy")) {
e = CE->getArg(0)->IgnoreParenCasts();
}
}
}
}
BlockExpr *block = dyn_cast<BlockExpr>(e);
if (!block || !block->getBlockDecl()->capturesVariable(owner.Variable))
return nullptr;
FindCaptureVisitor visitor(S.Context, owner.Variable);
visitor.Visit(block->getBlockDecl()->getBody());
return visitor.VarWillBeReased ? nullptr : visitor.Capturer;
}
static void diagnoseRetainCycle(Sema &S, Expr *capturer,
RetainCycleOwner &owner) {
assert(capturer);
assert(owner.Variable && owner.Loc.isValid());
S.Diag(capturer->getExprLoc(), diag::warn_arc_retain_cycle)
<< owner.Variable << capturer->getSourceRange();
S.Diag(owner.Loc, diag::note_arc_retain_cycle_owner)
<< owner.Indirect << owner.Range;
}
/// Check for a keyword selector that starts with the word 'add' or
/// 'set'.
static bool isSetterLikeSelector(Selector sel) {
if (sel.isUnarySelector()) return false;
StringRef str = sel.getNameForSlot(0);
while (!str.empty() && str.front() == '_') str = str.substr(1);
if (str.startswith("set"))
str = str.substr(3);
else if (str.startswith("add")) {
// Specially whitelist 'addOperationWithBlock:'.
if (sel.getNumArgs() == 1 && str.startswith("addOperationWithBlock"))
return false;
str = str.substr(3);
}
else
return false;
if (str.empty()) return true;
return !isLowercase(str.front());
}
static Optional<int> GetNSMutableArrayArgumentIndex(Sema &S,
ObjCMessageExpr *Message) {
bool IsMutableArray = S.NSAPIObj->isSubclassOfNSClass(
Message->getReceiverInterface(),
NSAPI::ClassId_NSMutableArray);
if (!IsMutableArray) {
return None;
}
Selector Sel = Message->getSelector();
Optional<NSAPI::NSArrayMethodKind> MKOpt =
S.NSAPIObj->getNSArrayMethodKind(Sel);
if (!MKOpt) {
return None;
}
NSAPI::NSArrayMethodKind MK = *MKOpt;
switch (MK) {
case NSAPI::NSMutableArr_addObject:
case NSAPI::NSMutableArr_insertObjectAtIndex:
case NSAPI::NSMutableArr_setObjectAtIndexedSubscript:
return 0;
case NSAPI::NSMutableArr_replaceObjectAtIndex:
return 1;
default:
return None;
}
return None;
}
static
Optional<int> GetNSMutableDictionaryArgumentIndex(Sema &S,
ObjCMessageExpr *Message) {
bool IsMutableDictionary = S.NSAPIObj->isSubclassOfNSClass(
Message->getReceiverInterface(),
NSAPI::ClassId_NSMutableDictionary);
if (!IsMutableDictionary) {
return None;
}
Selector Sel = Message->getSelector();
Optional<NSAPI::NSDictionaryMethodKind> MKOpt =
S.NSAPIObj->getNSDictionaryMethodKind(Sel);
if (!MKOpt) {
return None;
}
NSAPI::NSDictionaryMethodKind MK = *MKOpt;
switch (MK) {
case NSAPI::NSMutableDict_setObjectForKey:
case NSAPI::NSMutableDict_setValueForKey:
case NSAPI::NSMutableDict_setObjectForKeyedSubscript:
return 0;
default:
return None;
}
return None;
}
static Optional<int> GetNSSetArgumentIndex(Sema &S, ObjCMessageExpr *Message) {
bool IsMutableSet = S.NSAPIObj->isSubclassOfNSClass(
Message->getReceiverInterface(),
NSAPI::ClassId_NSMutableSet);
bool IsMutableOrderedSet = S.NSAPIObj->isSubclassOfNSClass(
Message->getReceiverInterface(),
NSAPI::ClassId_NSMutableOrderedSet);
if (!IsMutableSet && !IsMutableOrderedSet) {
return None;
}
Selector Sel = Message->getSelector();
Optional<NSAPI::NSSetMethodKind> MKOpt = S.NSAPIObj->getNSSetMethodKind(Sel);
if (!MKOpt) {
return None;
}
NSAPI::NSSetMethodKind MK = *MKOpt;
switch (MK) {
case NSAPI::NSMutableSet_addObject:
case NSAPI::NSOrderedSet_setObjectAtIndex:
case NSAPI::NSOrderedSet_setObjectAtIndexedSubscript:
case NSAPI::NSOrderedSet_insertObjectAtIndex:
return 0;
case NSAPI::NSOrderedSet_replaceObjectAtIndexWithObject:
return 1;
}
return None;
}
void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) {
if (!Message->isInstanceMessage()) {
return;
}
Optional<int> ArgOpt;
if (!(ArgOpt = GetNSMutableArrayArgumentIndex(*this, Message)) &&
!(ArgOpt = GetNSMutableDictionaryArgumentIndex(*this, Message)) &&
!(ArgOpt = GetNSSetArgumentIndex(*this, Message))) {
return;
}
int ArgIndex = *ArgOpt;
Expr *Arg = Message->getArg(ArgIndex)->IgnoreImpCasts();
if (OpaqueValueExpr *OE = dyn_cast<OpaqueValueExpr>(Arg)) {
Arg = OE->getSourceExpr()->IgnoreImpCasts();
}
if (Message->getReceiverKind() == ObjCMessageExpr::SuperInstance) {
if (DeclRefExpr *ArgRE = dyn_cast<DeclRefExpr>(Arg)) {
if (ArgRE->isObjCSelfExpr()) {
Diag(Message->getSourceRange().getBegin(),
diag::warn_objc_circular_container)
<< ArgRE->getDecl()->getName() << StringRef("super");
}
}
} else {
Expr *Receiver = Message->getInstanceReceiver()->IgnoreImpCasts();
if (OpaqueValueExpr *OE = dyn_cast<OpaqueValueExpr>(Receiver)) {
Receiver = OE->getSourceExpr()->IgnoreImpCasts();
}
if (DeclRefExpr *ReceiverRE = dyn_cast<DeclRefExpr>(Receiver)) {
if (DeclRefExpr *ArgRE = dyn_cast<DeclRefExpr>(Arg)) {
if (ReceiverRE->getDecl() == ArgRE->getDecl()) {
ValueDecl *Decl = ReceiverRE->getDecl();
Diag(Message->getSourceRange().getBegin(),
diag::warn_objc_circular_container)
<< Decl->getName() << Decl->getName();
if (!ArgRE->isObjCSelfExpr()) {
Diag(Decl->getLocation(),
diag::note_objc_circular_container_declared_here)
<< Decl->getName();
}
}
}
} else if (ObjCIvarRefExpr *IvarRE = dyn_cast<ObjCIvarRefExpr>(Receiver)) {
if (ObjCIvarRefExpr *IvarArgRE = dyn_cast<ObjCIvarRefExpr>(Arg)) {
if (IvarRE->getDecl() == IvarArgRE->getDecl()) {
ObjCIvarDecl *Decl = IvarRE->getDecl();
Diag(Message->getSourceRange().getBegin(),
diag::warn_objc_circular_container)
<< Decl->getName() << Decl->getName();
Diag(Decl->getLocation(),
diag::note_objc_circular_container_declared_here)
<< Decl->getName();
}
}
}
}
}
/// Check a message send to see if it's likely to cause a retain cycle.
void Sema::checkRetainCycles(ObjCMessageExpr *msg) {
// Only check instance methods whose selector looks like a setter.
if (!msg->isInstanceMessage() || !isSetterLikeSelector(msg->getSelector()))
return;
// Try to find a variable that the receiver is strongly owned by.
RetainCycleOwner owner;
if (msg->getReceiverKind() == ObjCMessageExpr::Instance) {
if (!findRetainCycleOwner(*this, msg->getInstanceReceiver(), owner))
return;
} else {
assert(msg->getReceiverKind() == ObjCMessageExpr::SuperInstance);
owner.Variable = getCurMethodDecl()->getSelfDecl();
owner.Loc = msg->getSuperLoc();
owner.Range = msg->getSuperLoc();
}
// Check whether the receiver is captured by any of the arguments.
for (unsigned i = 0, e = msg->getNumArgs(); i != e; ++i)
if (Expr *capturer = findCapturingExpr(*this, msg->getArg(i), owner))
return diagnoseRetainCycle(*this, capturer, owner);
}
/// Check a property assign to see if it's likely to cause a retain cycle.
void Sema::checkRetainCycles(Expr *receiver, Expr *argument) {
RetainCycleOwner owner;
if (!findRetainCycleOwner(*this, receiver, owner))
return;
if (Expr *capturer = findCapturingExpr(*this, argument, owner))
diagnoseRetainCycle(*this, capturer, owner);
}
void Sema::checkRetainCycles(VarDecl *Var, Expr *Init) {
RetainCycleOwner Owner;
if (!considerVariable(Var, /*DeclRefExpr=*/nullptr, Owner))
return;
// Because we don't have an expression for the variable, we have to set the
// location explicitly here.
Owner.Loc = Var->getLocation();
Owner.Range = Var->getSourceRange();
if (Expr *Capturer = findCapturingExpr(*this, Init, Owner))
diagnoseRetainCycle(*this, Capturer, Owner);
}
static bool checkUnsafeAssignLiteral(Sema &S, SourceLocation Loc,
Expr *RHS, bool isProperty) {
// Check if RHS is an Objective-C object literal, which also can get
// immediately zapped in a weak reference. Note that we explicitly
// allow ObjCStringLiterals, since those are designed to never really die.
RHS = RHS->IgnoreParenImpCasts();
// This enum needs to match with the 'select' in
// warn_objc_arc_literal_assign (off-by-1).
Sema::ObjCLiteralKind Kind = S.CheckLiteralKind(RHS);
if (Kind == Sema::LK_String || Kind == Sema::LK_None)
return false;
S.Diag(Loc, diag::warn_arc_literal_assign)
<< (unsigned) Kind
<< (isProperty ? 0 : 1)
<< RHS->getSourceRange();
return true;
}
static bool checkUnsafeAssignObject(Sema &S, SourceLocation Loc,
Qualifiers::ObjCLifetime LT,
Expr *RHS, bool isProperty) {
// Strip off any implicit cast added to get to the one ARC-specific.
while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) {
if (cast->getCastKind() == CK_ARCConsumeObject) {
S.Diag(Loc, diag::warn_arc_retained_assign)
<< (LT == Qualifiers::OCL_ExplicitNone)
<< (isProperty ? 0 : 1)
<< RHS->getSourceRange();
return true;
}
RHS = cast->getSubExpr();
}
if (LT == Qualifiers::OCL_Weak &&
checkUnsafeAssignLiteral(S, Loc, RHS, isProperty))
return true;
return false;
}
bool Sema::checkUnsafeAssigns(SourceLocation Loc,
QualType LHS, Expr *RHS) {
Qualifiers::ObjCLifetime LT = LHS.getObjCLifetime();
if (LT != Qualifiers::OCL_Weak && LT != Qualifiers::OCL_ExplicitNone)
return false;
if (checkUnsafeAssignObject(*this, Loc, LT, RHS, false))
return true;
return false;
}
void Sema::checkUnsafeExprAssigns(SourceLocation Loc,
Expr *LHS, Expr *RHS) {
QualType LHSType;
// PropertyRef on LHS type need be directly obtained from
// its declaration as it has a PseudoType.
ObjCPropertyRefExpr *PRE
= dyn_cast<ObjCPropertyRefExpr>(LHS->IgnoreParens());
if (PRE && !PRE->isImplicitProperty()) {
const ObjCPropertyDecl *PD = PRE->getExplicitProperty();
if (PD)
LHSType = PD->getType();
}
if (LHSType.isNull())
LHSType = LHS->getType();
Qualifiers::ObjCLifetime LT = LHSType.getObjCLifetime();
if (LT == Qualifiers::OCL_Weak) {
if (!Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, Loc))
getCurFunction()->markSafeWeakUse(LHS);
}
if (checkUnsafeAssigns(Loc, LHSType, RHS))
return;
// FIXME. Check for other life times.
if (LT != Qualifiers::OCL_None)
return;
if (PRE) {
if (PRE->isImplicitProperty())
return;
const ObjCPropertyDecl *PD = PRE->getExplicitProperty();
if (!PD)
return;
unsigned Attributes = PD->getPropertyAttributes();
if (Attributes & ObjCPropertyDecl::OBJC_PR_assign) {
// when 'assign' attribute was not explicitly specified
// by user, ignore it and rely on property type itself
// for lifetime info.
unsigned AsWrittenAttr = PD->getPropertyAttributesAsWritten();
if (!(AsWrittenAttr & ObjCPropertyDecl::OBJC_PR_assign) &&
LHSType->isObjCRetainableType())
return;
while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) {
if (cast->getCastKind() == CK_ARCConsumeObject) {
Diag(Loc, diag::warn_arc_retained_property_assign)
<< RHS->getSourceRange();
return;
}
RHS = cast->getSubExpr();
}
}
else if (Attributes & ObjCPropertyDecl::OBJC_PR_weak) {
if (checkUnsafeAssignObject(*this, Loc, Qualifiers::OCL_Weak, RHS, true))
return;
}
}
}
//===--- CHECK: Empty statement body (-Wempty-body) ---------------------===//
namespace {
bool ShouldDiagnoseEmptyStmtBody(const SourceManager &SourceMgr,
SourceLocation StmtLoc,
const NullStmt *Body) {
// Do not warn if the body is a macro that expands to nothing, e.g:
//
// #define CALL(x)
// if (condition)
// CALL(0);
//
if (Body->hasLeadingEmptyMacro())
return false;
// Get line numbers of statement and body.
bool StmtLineInvalid;
unsigned StmtLine = SourceMgr.getPresumedLineNumber(StmtLoc,
&StmtLineInvalid);
if (StmtLineInvalid)
return false;
bool BodyLineInvalid;
unsigned BodyLine = SourceMgr.getSpellingLineNumber(Body->getSemiLoc(),
&BodyLineInvalid);
if (BodyLineInvalid)
return false;
// Warn if null statement and body are on the same line.
if (StmtLine != BodyLine)
return false;
return true;
}
} // end anonymous namespace
void Sema::DiagnoseEmptyStmtBody(SourceLocation StmtLoc,
const Stmt *Body,
unsigned DiagID) {
// Since this is a syntactic check, don't emit diagnostic for template
// instantiations, this just adds noise.
if (CurrentInstantiationScope)
return;
// The body should be a null statement.
const NullStmt *NBody = dyn_cast<NullStmt>(Body);
if (!NBody)
return;
// Do the usual checks.
if (!ShouldDiagnoseEmptyStmtBody(SourceMgr, StmtLoc, NBody))
return;
Diag(NBody->getSemiLoc(), DiagID);
Diag(NBody->getSemiLoc(), diag::note_empty_body_on_separate_line);
}
void Sema::DiagnoseEmptyLoopBody(const Stmt *S,
const Stmt *PossibleBody) {
assert(!CurrentInstantiationScope); // Ensured by caller
SourceLocation StmtLoc;
const Stmt *Body;
unsigned DiagID;
if (const ForStmt *FS = dyn_cast<ForStmt>(S)) {
StmtLoc = FS->getRParenLoc();
Body = FS->getBody();
DiagID = diag::warn_empty_for_body;
} else if (const WhileStmt *WS = dyn_cast<WhileStmt>(S)) {
StmtLoc = WS->getCond()->getSourceRange().getEnd();
Body = WS->getBody();
DiagID = diag::warn_empty_while_body;
} else
return; // Neither `for' nor `while'.
// The body should be a null statement.
const NullStmt *NBody = dyn_cast<NullStmt>(Body);
if (!NBody)
return;
// Skip expensive checks if diagnostic is disabled.
if (Diags.isIgnored(DiagID, NBody->getSemiLoc()))
return;
// Do the usual checks.
if (!ShouldDiagnoseEmptyStmtBody(SourceMgr, StmtLoc, NBody))
return;
// `for(...);' and `while(...);' are popular idioms, so in order to keep
// noise level low, emit diagnostics only if for/while is followed by a
// CompoundStmt, e.g.:
// for (int i = 0; i < n; i++);
// {
// a(i);
// }
// or if for/while is followed by a statement with more indentation
// than for/while itself:
// for (int i = 0; i < n; i++);
// a(i);
bool ProbableTypo = isa<CompoundStmt>(PossibleBody);
if (!ProbableTypo) {
bool BodyColInvalid;
unsigned BodyCol = SourceMgr.getPresumedColumnNumber(
PossibleBody->getLocStart(),
&BodyColInvalid);
if (BodyColInvalid)
return;
bool StmtColInvalid;
unsigned StmtCol = SourceMgr.getPresumedColumnNumber(
S->getLocStart(),
&StmtColInvalid);
if (StmtColInvalid)
return;
if (BodyCol > StmtCol)
ProbableTypo = true;
}
if (ProbableTypo) {
Diag(NBody->getSemiLoc(), DiagID);
Diag(NBody->getSemiLoc(), diag::note_empty_body_on_separate_line);
}
}
//===--- CHECK: Warn on self move with std::move. -------------------------===//
/// DiagnoseSelfMove - Emits a warning if a value is moved to itself.
void Sema::DiagnoseSelfMove(const Expr *LHSExpr, const Expr *RHSExpr,
SourceLocation OpLoc) {
if (Diags.isIgnored(diag::warn_sizeof_pointer_expr_memaccess, OpLoc))
return;
if (inTemplateInstantiation())
return;
// Strip parens and casts away.
LHSExpr = LHSExpr->IgnoreParenImpCasts();
RHSExpr = RHSExpr->IgnoreParenImpCasts();
// Check for a call expression
const CallExpr *CE = dyn_cast<CallExpr>(RHSExpr);
if (!CE || CE->getNumArgs() != 1)
return;
// Check for a call to std::move
const FunctionDecl *FD = CE->getDirectCallee();
if (!FD || !FD->isInStdNamespace() || !FD->getIdentifier() ||
!FD->getIdentifier()->isStr("move"))
return;
// Get argument from std::move
RHSExpr = CE->getArg(0);
const DeclRefExpr *LHSDeclRef = dyn_cast<DeclRefExpr>(LHSExpr);
const DeclRefExpr *RHSDeclRef = dyn_cast<DeclRefExpr>(RHSExpr);
// Two DeclRefExpr's, check that the decls are the same.
if (LHSDeclRef && RHSDeclRef) {
if (!LHSDeclRef->getDecl() || !RHSDeclRef->getDecl())
return;
if (LHSDeclRef->getDecl()->getCanonicalDecl() !=
RHSDeclRef->getDecl()->getCanonicalDecl())
return;
Diag(OpLoc, diag::warn_self_move) << LHSExpr->getType()
<< LHSExpr->getSourceRange()
<< RHSExpr->getSourceRange();
return;
}
// Member variables require a different approach to check for self moves.
// MemberExpr's are the same if every nested MemberExpr refers to the same
// Decl and that the base Expr's are DeclRefExpr's with the same Decl or
// the base Expr's are CXXThisExpr's.
const Expr *LHSBase = LHSExpr;
const Expr *RHSBase = RHSExpr;
const MemberExpr *LHSME = dyn_cast<MemberExpr>(LHSExpr);
const MemberExpr *RHSME = dyn_cast<MemberExpr>(RHSExpr);
if (!LHSME || !RHSME)
return;
while (LHSME && RHSME) {
if (LHSME->getMemberDecl()->getCanonicalDecl() !=
RHSME->getMemberDecl()->getCanonicalDecl())
return;
LHSBase = LHSME->getBase();
RHSBase = RHSME->getBase();
LHSME = dyn_cast<MemberExpr>(LHSBase);
RHSME = dyn_cast<MemberExpr>(RHSBase);
}
LHSDeclRef = dyn_cast<DeclRefExpr>(LHSBase);
RHSDeclRef = dyn_cast<DeclRefExpr>(RHSBase);
if (LHSDeclRef && RHSDeclRef) {
if (!LHSDeclRef->getDecl() || !RHSDeclRef->getDecl())
return;
if (LHSDeclRef->getDecl()->getCanonicalDecl() !=
RHSDeclRef->getDecl()->getCanonicalDecl())
return;
Diag(OpLoc, diag::warn_self_move) << LHSExpr->getType()
<< LHSExpr->getSourceRange()
<< RHSExpr->getSourceRange();
return;
}
if (isa<CXXThisExpr>(LHSBase) && isa<CXXThisExpr>(RHSBase))
Diag(OpLoc, diag::warn_self_move) << LHSExpr->getType()
<< LHSExpr->getSourceRange()
<< RHSExpr->getSourceRange();
}
//===--- Layout compatibility ----------------------------------------------//
namespace {
bool isLayoutCompatible(ASTContext &C, QualType T1, QualType T2);
/// \brief Check if two enumeration types are layout-compatible.
bool isLayoutCompatible(ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) {
// C++11 [dcl.enum] p8:
// Two enumeration types are layout-compatible if they have the same
// underlying type.
return ED1->isComplete() && ED2->isComplete() &&
C.hasSameType(ED1->getIntegerType(), ED2->getIntegerType());
}
/// \brief Check if two fields are layout-compatible.
bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1, FieldDecl *Field2) {
if (!isLayoutCompatible(C, Field1->getType(), Field2->getType()))
return false;
if (Field1->isBitField() != Field2->isBitField())
return false;
if (Field1->isBitField()) {
// Make sure that the bit-fields are the same length.
unsigned Bits1 = Field1->getBitWidthValue(C);
unsigned Bits2 = Field2->getBitWidthValue(C);
if (Bits1 != Bits2)
return false;
}
return true;
}
/// \brief Check if two standard-layout structs are layout-compatible.
/// (C++11 [class.mem] p17)
bool isLayoutCompatibleStruct(ASTContext &C,
RecordDecl *RD1,
RecordDecl *RD2) {
// If both records are C++ classes, check that base classes match.
if (const CXXRecordDecl *D1CXX = dyn_cast<CXXRecordDecl>(RD1)) {
// If one of records is a CXXRecordDecl we are in C++ mode,
// thus the other one is a CXXRecordDecl, too.
const CXXRecordDecl *D2CXX = cast<CXXRecordDecl>(RD2);
// Check number of base classes.
if (D1CXX->getNumBases() != D2CXX->getNumBases())
return false;
// Check the base classes.
for (CXXRecordDecl::base_class_const_iterator
Base1 = D1CXX->bases_begin(),
BaseEnd1 = D1CXX->bases_end(),
Base2 = D2CXX->bases_begin();
Base1 != BaseEnd1;
++Base1, ++Base2) {
if (!isLayoutCompatible(C, Base1->getType(), Base2->getType()))
return false;
}
} else if (const CXXRecordDecl *D2CXX = dyn_cast<CXXRecordDecl>(RD2)) {
// If only RD2 is a C++ class, it should have zero base classes.
if (D2CXX->getNumBases() > 0)
return false;
}
// Check the fields.
RecordDecl::field_iterator Field2 = RD2->field_begin(),
Field2End = RD2->field_end(),
Field1 = RD1->field_begin(),
Field1End = RD1->field_end();
for ( ; Field1 != Field1End && Field2 != Field2End; ++Field1, ++Field2) {
if (!isLayoutCompatible(C, *Field1, *Field2))
return false;
}
if (Field1 != Field1End || Field2 != Field2End)
return false;
return true;
}
/// \brief Check if two standard-layout unions are layout-compatible.
/// (C++11 [class.mem] p18)
bool isLayoutCompatibleUnion(ASTContext &C,
RecordDecl *RD1,
RecordDecl *RD2) {
llvm::SmallPtrSet<FieldDecl *, 8> UnmatchedFields;
for (auto *Field2 : RD2->fields())
UnmatchedFields.insert(Field2);
for (auto *Field1 : RD1->fields()) {
llvm::SmallPtrSet<FieldDecl *, 8>::iterator
I = UnmatchedFields.begin(),
E = UnmatchedFields.end();
for ( ; I != E; ++I) {
if (isLayoutCompatible(C, Field1, *I)) {
bool Result = UnmatchedFields.erase(*I);
(void) Result;
assert(Result);
break;
}
}
if (I == E)
return false;
}
return UnmatchedFields.empty();
}
bool isLayoutCompatible(ASTContext &C, RecordDecl *RD1, RecordDecl *RD2) {
if (RD1->isUnion() != RD2->isUnion())
return false;
if (RD1->isUnion())
return isLayoutCompatibleUnion(C, RD1, RD2);
else
return isLayoutCompatibleStruct(C, RD1, RD2);
}
/// \brief Check if two types are layout-compatible in C++11 sense.
bool isLayoutCompatible(ASTContext &C, QualType T1, QualType T2) {
if (T1.isNull() || T2.isNull())
return false;
// C++11 [basic.types] p11:
// If two types T1 and T2 are the same type, then T1 and T2 are
// layout-compatible types.
if (C.hasSameType(T1, T2))
return true;
T1 = T1.getCanonicalType().getUnqualifiedType();
T2 = T2.getCanonicalType().getUnqualifiedType();
const Type::TypeClass TC1 = T1->getTypeClass();
const Type::TypeClass TC2 = T2->getTypeClass();
if (TC1 != TC2)
return false;
if (TC1 == Type::Enum) {
return isLayoutCompatible(C,
cast<EnumType>(T1)->getDecl(),
cast<EnumType>(T2)->getDecl());
} else if (TC1 == Type::Record) {
if (!T1->isStandardLayoutType() || !T2->isStandardLayoutType())
return false;
return isLayoutCompatible(C,
cast<RecordType>(T1)->getDecl(),
cast<RecordType>(T2)->getDecl());
}
return false;
}
} // end anonymous namespace
//===--- CHECK: pointer_with_type_tag attribute: datatypes should match ----//
namespace {
/// \brief Given a type tag expression find the type tag itself.
///
/// \param TypeExpr Type tag expression, as it appears in user's code.
///
/// \param VD Declaration of an identifier that appears in a type tag.
///
/// \param MagicValue Type tag magic value.
bool FindTypeTagExpr(const Expr *TypeExpr, const ASTContext &Ctx,
const ValueDecl **VD, uint64_t *MagicValue) {
while(true) {
if (!TypeExpr)
return false;
TypeExpr = TypeExpr->IgnoreParenImpCasts()->IgnoreParenCasts();
switch (TypeExpr->getStmtClass()) {
case Stmt::UnaryOperatorClass: {
const UnaryOperator *UO = cast<UnaryOperator>(TypeExpr);
if (UO->getOpcode() == UO_AddrOf || UO->getOpcode() == UO_Deref) {
TypeExpr = UO->getSubExpr();
continue;
}
return false;
}
case Stmt::DeclRefExprClass: {
const DeclRefExpr *DRE = cast<DeclRefExpr>(TypeExpr);
*VD = DRE->getDecl();
return true;
}
case Stmt::IntegerLiteralClass: {
const IntegerLiteral *IL = cast<IntegerLiteral>(TypeExpr);
llvm::APInt MagicValueAPInt = IL->getValue();
if (MagicValueAPInt.getActiveBits() <= 64) {
*MagicValue = MagicValueAPInt.getZExtValue();
return true;
} else
return false;
}
case Stmt::BinaryConditionalOperatorClass:
case Stmt::ConditionalOperatorClass: {
const AbstractConditionalOperator *ACO =
cast<AbstractConditionalOperator>(TypeExpr);
bool Result;
if (ACO->getCond()->EvaluateAsBooleanCondition(Result, Ctx)) {
if (Result)
TypeExpr = ACO->getTrueExpr();
else
TypeExpr = ACO->getFalseExpr();
continue;
}
return false;
}
case Stmt::BinaryOperatorClass: {
const BinaryOperator *BO = cast<BinaryOperator>(TypeExpr);
if (BO->getOpcode() == BO_Comma) {
TypeExpr = BO->getRHS();
continue;
}
return false;
}
default:
return false;
}
}
}
/// \brief Retrieve the C type corresponding to type tag TypeExpr.
///
/// \param TypeExpr Expression that specifies a type tag.
///
/// \param MagicValues Registered magic values.
///
/// \param FoundWrongKind Set to true if a type tag was found, but of a wrong
/// kind.
///
/// \param TypeInfo Information about the corresponding C type.
///
/// \returns true if the corresponding C type was found.
bool GetMatchingCType(
const IdentifierInfo *ArgumentKind,
const Expr *TypeExpr, const ASTContext &Ctx,
const llvm::DenseMap<Sema::TypeTagMagicValue,
Sema::TypeTagData> *MagicValues,
bool &FoundWrongKind,
Sema::TypeTagData &TypeInfo) {
FoundWrongKind = false;
// Variable declaration that has type_tag_for_datatype attribute.
const ValueDecl *VD = nullptr;
uint64_t MagicValue;
if (!FindTypeTagExpr(TypeExpr, Ctx, &VD, &MagicValue))
return false;
if (VD) {
if (TypeTagForDatatypeAttr *I = VD->getAttr<TypeTagForDatatypeAttr>()) {
if (I->getArgumentKind() != ArgumentKind) {
FoundWrongKind = true;
return false;
}
TypeInfo.Type = I->getMatchingCType();
TypeInfo.LayoutCompatible = I->getLayoutCompatible();
TypeInfo.MustBeNull = I->getMustBeNull();
return true;
}
return false;
}
if (!MagicValues)
return false;
llvm::DenseMap<Sema::TypeTagMagicValue,
Sema::TypeTagData>::const_iterator I =
MagicValues->find(std::make_pair(ArgumentKind, MagicValue));
if (I == MagicValues->end())
return false;
TypeInfo = I->second;
return true;
}
} // end anonymous namespace
void Sema::RegisterTypeTagForDatatype(const IdentifierInfo *ArgumentKind,
uint64_t MagicValue, QualType Type,
bool LayoutCompatible,
bool MustBeNull) {
if (!TypeTagForDatatypeMagicValues)
TypeTagForDatatypeMagicValues.reset(
new llvm::DenseMap<TypeTagMagicValue, TypeTagData>);
TypeTagMagicValue Magic(ArgumentKind, MagicValue);
(*TypeTagForDatatypeMagicValues)[Magic] =
TypeTagData(Type, LayoutCompatible, MustBeNull);
}
namespace {
bool IsSameCharType(QualType T1, QualType T2) {
const BuiltinType *BT1 = T1->getAs<BuiltinType>();
if (!BT1)
return false;
const BuiltinType *BT2 = T2->getAs<BuiltinType>();
if (!BT2)
return false;
BuiltinType::Kind T1Kind = BT1->getKind();
BuiltinType::Kind T2Kind = BT2->getKind();
return (T1Kind == BuiltinType::SChar && T2Kind == BuiltinType::Char_S) ||
(T1Kind == BuiltinType::UChar && T2Kind == BuiltinType::Char_U) ||
(T1Kind == BuiltinType::Char_U && T2Kind == BuiltinType::UChar) ||
(T1Kind == BuiltinType::Char_S && T2Kind == BuiltinType::SChar);
}
} // end anonymous namespace
void Sema::CheckArgumentWithTypeTag(const ArgumentWithTypeTagAttr *Attr,
const Expr * const *ExprArgs) {
const IdentifierInfo *ArgumentKind = Attr->getArgumentKind();
bool IsPointerAttr = Attr->getIsPointer();
const Expr *TypeTagExpr = ExprArgs[Attr->getTypeTagIdx()];
bool FoundWrongKind;
TypeTagData TypeInfo;
if (!GetMatchingCType(ArgumentKind, TypeTagExpr, Context,
TypeTagForDatatypeMagicValues.get(),
FoundWrongKind, TypeInfo)) {
if (FoundWrongKind)
Diag(TypeTagExpr->getExprLoc(),
diag::warn_type_tag_for_datatype_wrong_kind)
<< TypeTagExpr->getSourceRange();
return;
}
const Expr *ArgumentExpr = ExprArgs[Attr->getArgumentIdx()];
if (IsPointerAttr) {
// Skip implicit cast of pointer to `void *' (as a function argument).
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(ArgumentExpr))
if (ICE->getType()->isVoidPointerType() &&
ICE->getCastKind() == CK_BitCast)
ArgumentExpr = ICE->getSubExpr();
}
QualType ArgumentType = ArgumentExpr->getType();
// Passing a `void*' pointer shouldn't trigger a warning.
if (IsPointerAttr && ArgumentType->isVoidPointerType())
return;
if (TypeInfo.MustBeNull) {
// Type tag with matching void type requires a null pointer.
if (!ArgumentExpr->isNullPointerConstant(Context,
Expr::NPC_ValueDependentIsNotNull)) {
Diag(ArgumentExpr->getExprLoc(),
diag::warn_type_safety_null_pointer_required)
<< ArgumentKind->getName()
<< ArgumentExpr->getSourceRange()
<< TypeTagExpr->getSourceRange();
}
return;
}
QualType RequiredType = TypeInfo.Type;
if (IsPointerAttr)
RequiredType = Context.getPointerType(RequiredType);
bool mismatch = false;
if (!TypeInfo.LayoutCompatible) {
mismatch = !Context.hasSameType(ArgumentType, RequiredType);
// C++11 [basic.fundamental] p1:
// Plain char, signed char, and unsigned char are three distinct types.
//
// But we treat plain `char' as equivalent to `signed char' or `unsigned
// char' depending on the current char signedness mode.
if (mismatch)
if ((IsPointerAttr && IsSameCharType(ArgumentType->getPointeeType(),
RequiredType->getPointeeType())) ||
(!IsPointerAttr && IsSameCharType(ArgumentType, RequiredType)))
mismatch = false;
} else
if (IsPointerAttr)
mismatch = !isLayoutCompatible(Context,
ArgumentType->getPointeeType(),
RequiredType->getPointeeType());
else
mismatch = !isLayoutCompatible(Context, ArgumentType, RequiredType);
if (mismatch)
Diag(ArgumentExpr->getExprLoc(), diag::warn_type_safety_type_mismatch)
<< ArgumentType << ArgumentKind
<< TypeInfo.LayoutCompatible << RequiredType
<< ArgumentExpr->getSourceRange()
<< TypeTagExpr->getSourceRange();
}
void Sema::AddPotentialMisalignedMembers(Expr *E, RecordDecl *RD, ValueDecl *MD,
CharUnits Alignment) {
MisalignedMembers.emplace_back(E, RD, MD, Alignment);
}
void Sema::DiagnoseMisalignedMembers() {
for (MisalignedMember &m : MisalignedMembers) {
const NamedDecl *ND = m.RD;
if (ND->getName().empty()) {
if (const TypedefNameDecl *TD = m.RD->getTypedefNameForAnonDecl())
ND = TD;
}
Diag(m.E->getLocStart(), diag::warn_taking_address_of_packed_member)
<< m.MD << ND << m.E->getSourceRange();
}
MisalignedMembers.clear();
}
void Sema::DiscardMisalignedMemberAddress(const Type *T, Expr *E) {
E = E->IgnoreParens();
if (!T->isPointerType() && !T->isIntegerType())
return;
if (isa<UnaryOperator>(E) &&
cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf) {
auto *Op = cast<UnaryOperator>(E)->getSubExpr()->IgnoreParens();
if (isa<MemberExpr>(Op)) {
auto MA = std::find(MisalignedMembers.begin(), MisalignedMembers.end(),
MisalignedMember(Op));
if (MA != MisalignedMembers.end() &&
(T->isIntegerType() ||
(T->isPointerType() &&
Context.getTypeAlignInChars(T->getPointeeType()) <= MA->Alignment)))
MisalignedMembers.erase(MA);
}
}
}
void Sema::RefersToMemberWithReducedAlignment(
Expr *E,
llvm::function_ref<void(Expr *, RecordDecl *, FieldDecl *, CharUnits)>
Action) {
const auto *ME = dyn_cast<MemberExpr>(E);
if (!ME)
return;
// No need to check expressions with an __unaligned-qualified type.
if (E->getType().getQualifiers().hasUnaligned())
return;
// For a chain of MemberExpr like "a.b.c.d" this list
// will keep FieldDecl's like [d, c, b].
SmallVector<FieldDecl *, 4> ReverseMemberChain;
const MemberExpr *TopME = nullptr;
bool AnyIsPacked = false;
do {
QualType BaseType = ME->getBase()->getType();
if (ME->isArrow())
BaseType = BaseType->getPointeeType();
RecordDecl *RD = BaseType->getAs<RecordType>()->getDecl();
if (RD->isInvalidDecl())
return;
ValueDecl *MD = ME->getMemberDecl();
auto *FD = dyn_cast<FieldDecl>(MD);
// We do not care about non-data members.
if (!FD || FD->isInvalidDecl())
return;
AnyIsPacked =
AnyIsPacked || (RD->hasAttr<PackedAttr>() || MD->hasAttr<PackedAttr>());
ReverseMemberChain.push_back(FD);
TopME = ME;
ME = dyn_cast<MemberExpr>(ME->getBase()->IgnoreParens());
} while (ME);
assert(TopME && "We did not compute a topmost MemberExpr!");
// Not the scope of this diagnostic.
if (!AnyIsPacked)
return;
const Expr *TopBase = TopME->getBase()->IgnoreParenImpCasts();
const auto *DRE = dyn_cast<DeclRefExpr>(TopBase);
// TODO: The innermost base of the member expression may be too complicated.
// For now, just disregard these cases. This is left for future
// improvement.
if (!DRE && !isa<CXXThisExpr>(TopBase))
return;
// Alignment expected by the whole expression.
CharUnits ExpectedAlignment = Context.getTypeAlignInChars(E->getType());
// No need to do anything else with this case.
if (ExpectedAlignment.isOne())
return;
// Synthesize offset of the whole access.
CharUnits Offset;
for (auto I = ReverseMemberChain.rbegin(); I != ReverseMemberChain.rend();
I++) {
Offset += Context.toCharUnitsFromBits(Context.getFieldOffset(*I));
}
// Compute the CompleteObjectAlignment as the alignment of the whole chain.
CharUnits CompleteObjectAlignment = Context.getTypeAlignInChars(
ReverseMemberChain.back()->getParent()->getTypeForDecl());
// The base expression of the innermost MemberExpr may give
// stronger guarantees than the class containing the member.
if (DRE && !TopME->isArrow()) {
const ValueDecl *VD = DRE->getDecl();
if (!VD->getType()->isReferenceType())
CompleteObjectAlignment =
std::max(CompleteObjectAlignment, Context.getDeclAlign(VD));
}
// Check if the synthesized offset fulfills the alignment.
if (Offset % ExpectedAlignment != 0 ||
// It may fulfill the offset it but the effective alignment may still be
// lower than the expected expression alignment.
CompleteObjectAlignment < ExpectedAlignment) {
// If this happens, we want to determine a sensible culprit of this.
// Intuitively, watching the chain of member expressions from right to
// left, we start with the required alignment (as required by the field
// type) but some packed attribute in that chain has reduced the alignment.
// It may happen that another packed structure increases it again. But if
// we are here such increase has not been enough. So pointing the first
// FieldDecl that either is packed or else its RecordDecl is,
// seems reasonable.
FieldDecl *FD = nullptr;
CharUnits Alignment;
for (FieldDecl *FDI : ReverseMemberChain) {
if (FDI->hasAttr<PackedAttr>() ||
FDI->getParent()->hasAttr<PackedAttr>()) {
FD = FDI;
Alignment = std::min(
Context.getTypeAlignInChars(FD->getType()),
Context.getTypeAlignInChars(FD->getParent()->getTypeForDecl()));
break;
}
}
assert(FD && "We did not find a packed FieldDecl!");
Action(E, FD->getParent(), FD, Alignment);
}
}
void Sema::CheckAddressOfPackedMember(Expr *rhs) {
using namespace std::placeholders;
RefersToMemberWithReducedAlignment(
rhs, std::bind(&Sema::AddPotentialMisalignedMembers, std::ref(*this), _1,
_2, _3, _4));
}
| [
"victory@csail.mit.edu"
] | victory@csail.mit.edu |
cadda2110c3aa464d80a650e1b460e674aa2ce3d | 76171660651f1c680d5b5a380c07635de5b2367c | /SH6_43mps/0.16/T | 39f4d25548bb5c804257f88a2ff554ae51cff8cb | [] | no_license | lisegaAM/SH_Paper1 | 3cd0cac0d95cc60d296268e65e2dd6fed4cc6127 | 12ceadba5c58c563ccac236b965b4b917ac47551 | refs/heads/master | 2021-04-27T19:44:19.527187 | 2018-02-21T16:16:50 | 2018-02-21T16:16:50 | 122,360,661 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 110,269 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.16";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField nonuniform List<scalar>
13800
(
773.084
773.084
773.086
773.086
773.085
773.084
773.084
773.085
773.085
773.087
773.088
773.09
773.092
773.094
773.095
773.096
773.097
773.099
773.1
773.102
773.104
773.107
773.109
773.111
773.114
773.116
773.119
773.121
773.123
773.126
773.128
773.13
773.132
773.134
773.136
773.138
773.139
773.14
773.142
773.142
773.143
773.144
773.144
773.144
773.143
773.143
773.142
773.141
773.14
773.138
773.137
773.135
773.133
773.131
773.128
773.126
773.124
773.121
773.118
773.116
773.113
773.11
773.108
773.105
773.103
773.1
773.098
773.095
773.093
773.091
773.089
773.087
773.086
773.084
773.082
773.081
773.08
773.079
773.078
773.077
773.076
773.075
773.075
773.074
773.074
773.073
773.073
773.072
773.072
773.072
773.072
773.071
773.071
773.071
773.071
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.071
773.071
773.071
773.071
773.071
773.072
773.072
773.072
773.073
773.073
773.073
773.074
773.075
773.075
773.076
773.077
773.078
773.079
773.08
773.081
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.096
773.098
773.101
773.103
773.105
773.108
773.11
773.113
773.116
773.118
773.125
773.129
773.243
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.114
773.116
773.123
773.127
773.257
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.114
773.116
773.123
773.126
773.254
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.114
773.116
773.122
773.126
773.222
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.114
773.116
773.121
773.122
773.185
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.114
773.116
773.119
773.118
773.104
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.109
773.111
773.113
773.117
773.114
773.114
772.997
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.108
773.111
773.113
773.117
773.112
773.124
772.842
773.081
773.082
773.083
773.083
773.083
773.082
773.082
773.082
773.083
773.084
773.086
773.088
773.09
773.092
773.093
773.094
773.095
773.097
773.098
773.1
773.103
773.105
773.107
773.11
773.112
773.115
773.117
773.119
773.122
773.124
773.126
773.129
773.131
773.133
773.134
773.136
773.138
773.139
773.14
773.141
773.141
773.142
773.142
773.142
773.142
773.141
773.14
773.139
773.138
773.137
773.135
773.133
773.131
773.129
773.127
773.124
773.122
773.119
773.117
773.114
773.111
773.109
773.106
773.103
773.101
773.098
773.096
773.094
773.092
773.089
773.087
773.086
773.084
773.082
773.081
773.079
773.078
773.077
773.076
773.075
773.074
773.074
773.073
773.072
773.072
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.067
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.068
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.071
773.071
773.071
773.072
773.072
773.073
773.074
773.074
773.075
773.076
773.077
773.078
773.079
773.08
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.097
773.099
773.101
773.104
773.106
773.108
773.111
773.113
773.117
773.111
773.132
772.766
773.084
773.084
773.086
773.086
773.085
773.084
773.084
773.085
773.085
773.087
773.088
773.09
773.092
773.094
773.095
773.096
773.097
773.099
773.1
773.102
773.104
773.107
773.109
773.111
773.114
773.116
773.119
773.121
773.123
773.126
773.128
773.13
773.132
773.134
773.136
773.138
773.139
773.14
773.142
773.142
773.143
773.144
773.144
773.144
773.143
773.143
773.142
773.141
773.14
773.138
773.137
773.135
773.133
773.131
773.128
773.126
773.124
773.121
773.118
773.116
773.113
773.11
773.108
773.105
773.103
773.1
773.098
773.095
773.093
773.091
773.089
773.087
773.086
773.084
773.082
773.081
773.08
773.079
773.078
773.077
773.076
773.075
773.075
773.074
773.074
773.073
773.073
773.072
773.072
773.072
773.072
773.071
773.071
773.071
773.071
773.071
773.071
773.071
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.069
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.07
773.071
773.071
773.071
773.071
773.071
773.072
773.072
773.072
773.073
773.073
773.073
773.074
773.075
773.075
773.076
773.077
773.078
773.079
773.08
773.081
773.082
773.083
773.085
773.087
773.088
773.09
773.092
773.094
773.096
773.098
773.1
773.103
773.105
773.108
773.11
773.113
773.115
773.118
773.111
773.141
772.693
773.225
773.245
773.258
773.262
773.265
773.266
773.268
773.269
773.27
773.271
773.271
773.272
773.272
773.271
773.27
773.267
773.262
773.255
773.243
773.219
773.223
773.236
773.244
773.246
773.247
773.247
773.247
773.247
773.247
773.247
773.247
773.247
773.246
773.245
773.243
773.24
773.236
773.228
773.217
773.195
773.221
773.236
773.245
773.248
773.249
773.251
773.252
773.252
773.252
773.252
773.252
773.252
773.251
773.249
773.246
773.242
773.236
773.227
773.213
773.192
773.197
773.204
773.208
773.209
773.209
773.21
773.211
773.212
773.214
773.216
773.218
773.22
773.222
773.225
773.226
773.227
773.225
773.221
773.211
773.198
773.168
773.178
773.186
773.192
773.196
773.199
773.2
773.198
773.197
773.194
773.19
773.184
773.178
773.171
773.163
773.155
773.148
773.14
773.134
773.129
773.113
773.109
773.102
773.097
773.093
773.091
773.091
773.092
773.095
773.099
773.105
773.112
773.122
773.131
773.142
773.152
773.163
773.171
773.181
773.183
773.046
773.041
773.041
773.043
773.044
773.042
773.04
773.035
773.03
773.022
773.014
773.003
772.994
772.983
772.975
772.967
772.966
772.969
772.978
772.987
772.955
772.932
772.91
772.897
772.891
772.887
772.886
772.887
772.891
772.898
772.908
772.92
772.935
772.951
772.969
772.986
773.012
773.03
773.063
773.09
772.896
772.872
772.849
772.832
772.821
772.811
772.803
772.796
772.792
772.789
772.789
772.79
772.795
772.803
772.813
772.824
772.839
772.863
772.893
772.933
772.862
772.828
772.788
772.774
772.762
772.762
772.766
772.771
772.781
772.794
772.807
772.827
772.845
772.87
772.892
772.917
772.945
772.978
773.02
773.065
773.15
773.128
773.122
773.122
773.123
773.124
773.124
773.125
773.125
773.125
773.126
773.127
773.127
773.127
773.126
773.125
773.12
773.117
773.114
773.112
773.111
773.111
773.116
773.146
773.295
773.926
775.711
777.612
778.904
779.527
779.654
779.487
778.402
775.887
773.837
772.559
771.935
771.746
771.757
771.954
772.36
772.653
772.836
772.943
773.001
773.032
773.047
773.055
773.058
773.059
773.059
773.059
773.058
773.057
773.056
773.055
773.054
773.053
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.046
773.045
773.045
773.044
773.044
773.043
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.04
773.04
773.039
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.024
773.038
772.669
773.134
773.113
773.108
773.109
773.109
773.11
773.11
773.111
773.111
773.112
773.113
773.113
773.113
773.112
773.111
773.111
773.11
773.109
773.108
773.105
773.097
773.076
773.055
773.04
773.03
773.027
773.035
773.089
773.283
773.554
773.766
773.894
773.938
773.93
773.83
773.538
773.274
773.112
773.032
773.005
773.003
773.009
773.026
773.04
773.049
773.054
773.056
773.058
773.058
773.058
773.058
773.057
773.056
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.033
773.033
773.023
773.031
772.722
773.136
773.117
773.112
773.111
773.112
773.113
773.114
773.114
773.115
773.115
773.115
773.115
773.116
773.116
773.116
773.115
773.114
773.112
773.11
773.108
773.106
773.105
773.102
773.092
773.056
772.942
772.796
772.689
772.627
772.607
772.609
772.65
772.822
773.061
773.218
773.29
773.309
773.306
773.271
773.197
773.139
773.103
773.082
773.07
773.064
773.061
773.059
773.059
773.059
773.058
773.058
773.057
773.057
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.033
773.033
773.024
773.026
772.792
773.16
773.146
773.146
773.146
773.147
773.148
773.15
773.151
773.151
773.151
773.151
773.151
773.151
773.151
773.151
773.15
773.149
773.146
773.143
773.14
773.138
773.136
773.134
773.127
773.108
773.039
772.892
772.764
772.682
772.644
772.639
772.655
772.745
772.9
773.015
773.084
773.114
773.122
773.121
773.11
773.091
773.079
773.072
773.067
773.064
773.063
773.062
773.061
773.061
773.06
773.059
773.058
773.057
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.033
773.033
773.029
773.023
772.926
773.115
773.111
773.108
773.106
773.105
773.105
773.105
773.105
773.105
773.106
773.106
773.106
773.107
773.107
773.107
773.107
773.107
773.107
773.107
773.107
773.107
773.108
773.108
773.108
773.107
773.102
773.082
773.017
772.937
772.883
772.855
772.847
772.851
772.877
772.937
772.987
773.02
773.041
773.053
773.06
773.063
773.065
773.065
773.065
773.065
773.064
773.064
773.063
773.062
773.061
773.059
773.058
773.057
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.033
773.032
773.029
773.017
773.195
773.204
773.211
773.216
773.219
773.221
773.222
773.222
773.223
773.223
773.223
773.223
773.222
773.221
773.219
773.218
773.215
773.212
773.209
773.206
773.204
773.201
773.199
773.195
773.187
773.162
773.101
773.033
772.977
772.938
772.914
772.905
772.905
772.914
772.947
772.987
773.017
773.039
773.054
773.063
773.068
773.071
773.071
773.071
773.07
773.069
773.067
773.065
773.064
773.062
773.06
773.059
773.058
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.036
773.038
773.085
773.033
773.048
773.051
773.05
773.05
773.051
773.052
773.052
773.052
773.053
773.053
773.054
773.054
773.054
773.054
773.054
773.054
773.054
773.055
773.057
773.058
773.058
773.059
773.061
773.068
773.078
773.083
773.083
773.08
773.06
772.997
772.936
772.9
772.888
772.889
772.905
772.951
772.995
773.026
773.047
773.059
773.067
773.07
773.071
773.07
773.069
773.068
773.066
773.064
773.062
773.061
773.059
773.058
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.035
773.038
773.044
773.117
773.185
773.206
773.213
773.216
773.217
773.218
773.219
773.219
773.219
773.219
773.219
773.218
773.218
773.218
773.218
773.218
773.219
773.219
773.219
773.218
773.218
773.221
773.234
773.252
773.26
773.261
773.259
773.244
773.189
773.101
773.032
772.988
772.965
772.958
772.959
772.972
773.004
773.032
773.051
773.064
773.071
773.074
773.075
773.075
773.074
773.072
773.069
773.067
773.065
773.063
773.061
773.059
773.058
773.057
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.035
773.039
773.045
773.146
773.072
773.105
773.114
773.117
773.119
773.119
773.12
773.121
773.122
773.122
773.123
773.123
773.124
773.125
773.126
773.127
773.127
773.127
773.128
773.132
773.141
773.146
773.147
773.148
773.152
773.182
773.275
773.357
773.393
773.4
773.397
773.378
773.318
773.252
773.201
773.165
773.141
773.124
773.112
773.103
773.096
773.09
773.085
773.08
773.077
773.073
773.07
773.067
773.065
773.063
773.061
773.06
773.058
773.057
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.045
773.045
773.044
773.044
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.035
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.034
773.035
773.039
773.045
773.149
773.208
773.229
773.235
773.237
773.238
773.238
773.239
773.24
773.24
773.241
773.24
773.24
773.24
773.24
773.239
773.237
773.227
773.182
773.078
773.006
772.977
772.977
773.01
773.194
773.713
774.249
774.642
774.888
775.005
775.036
775.027
774.937
774.63
774.255
773.945
773.698
773.51
773.372
773.274
773.206
773.16
773.129
773.108
773.094
773.085
773.079
773.074
773.07
773.067
773.065
773.063
773.061
773.06
773.058
773.057
773.056
773.055
773.054
773.053
773.052
773.051
773.05
773.049
773.048
773.048
773.047
773.046
773.046
773.045
773.045
773.044
773.044
773.043
773.043
773.042
773.042
773.041
773.041
773.041
773.04
773.04
773.04
773.04
773.039
773.039
773.039
773.039
773.038
773.038
773.038
773.038
773.038
773.038
773.038
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.037
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.036
773.035
773.035
773.035
773.035
773.036
773.036
773.037
773.041
773.048
773.135
772.791
772.754
772.713
772.695
772.683
772.679
772.683
772.687
772.695
772.708
772.72
772.74
772.756
772.782
772.803
772.828
772.856
772.888
772.93
772.976
772.816
772.792
772.767
772.748
772.735
772.723
772.715
772.707
772.703
772.699
772.698
772.699
772.704
772.712
772.719
772.733
772.747
772.771
772.801
772.842
772.872
772.849
772.825
772.811
772.803
772.798
772.796
772.796
772.8
772.806
772.815
772.826
772.841
772.857
772.874
772.893
772.917
772.936
772.968
772.995
772.956
772.95
772.948
772.949
772.949
772.946
772.945
772.939
772.934
772.925
772.917
772.906
772.897
772.886
772.878
772.87
772.868
772.871
772.881
772.889
773.02
773.015
773.007
773.001
772.996
772.993
772.993
772.994
772.996
773
773.006
773.013
773.022
773.031
773.041
773.051
773.061
773.069
773.078
773.081
773.074
773.083
773.091
773.097
773.101
773.103
773.104
773.103
773.101
773.098
773.094
773.088
773.081
773.074
773.066
773.058
773.05
773.042
773.035
773.03
773.104
773.11
773.114
773.115
773.116
773.117
773.118
773.119
773.121
773.122
773.124
773.126
773.128
773.13
773.131
773.131
773.128
773.124
773.114
773.1
773.13
773.143
773.153
773.156
773.158
773.159
773.161
773.161
773.161
773.161
773.16
773.159
773.158
773.155
773.152
773.147
773.141
773.131
773.118
773.096
773.131
773.143
773.152
773.155
773.156
773.157
773.157
773.157
773.157
773.156
773.156
773.154
773.154
773.152
773.15
773.146
773.142
773.133
773.122
773.1
773.132
773.152
773.166
773.171
773.174
773.176
773.177
773.178
773.179
773.179
773.18
773.18
773.179
773.178
773.176
773.173
773.168
773.16
773.148
773.123
773.115
773.135
773.14
773.142
773.142
773.142
773.142
773.142
773.142
773.142
773.142
773.141
773.141
773.142
773.141
773.14
773.137
773.118
773.042
772.938
772.879
772.862
772.868
772.927
773.199
773.782
774.293
774.661
774.883
774.984
775.007
774.992
774.876
774.536
774.166
773.86
773.618
773.434
773.299
773.203
773.137
773.092
773.062
773.043
773.03
773.022
773.017
773.014
773.011
773.01
773.009
773.008
773.007
773.007
773.007
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.005
773.004
772.994
773.006
772.648
772.978
773.009
773.018
773.02
773.021
773.021
773.021
773.021
773.021
773.021
773.022
773.022
773.022
773.022
773.024
773.025
773.026
773.027
773.028
773.032
773.039
773.045
773.048
773.048
773.048
773.05
773.069
773.143
773.223
773.262
773.272
773.271
773.257
773.208
773.15
773.106
773.075
773.056
773.043
773.035
773.029
773.024
773.021
773.018
773.015
773.013
773.011
773.01
773.008
773.007
773.007
773.006
773.005
773.005
773.005
773.005
773.005
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.003
772.993
773
772.697
773.088
773.108
773.114
773.116
773.116
773.117
773.117
773.116
773.116
773.115
773.115
773.115
773.115
773.115
773.116
773.116
773.117
773.118
773.119
773.119
773.119
773.119
773.12
773.127
773.139
773.145
773.146
773.145
773.131
773.076
772.994
772.931
772.891
772.873
772.869
772.871
772.888
772.923
772.953
772.975
772.99
773
773.005
773.008
773.009
773.01
773.01
773.009
773.008
773.007
773.006
773.006
773.005
773.005
773.005
773.005
773.005
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.003
772.994
772.994
772.767
772.933
772.948
772.948
772.947
772.947
772.947
772.946
772.946
772.946
772.946
772.946
772.946
772.946
772.946
772.947
772.948
772.948
772.949
772.95
772.952
772.954
772.956
772.957
772.958
772.962
772.972
772.98
772.984
772.984
772.981
772.96
772.897
772.838
772.807
772.798
772.8
772.818
772.869
772.915
772.949
772.972
772.988
772.997
773.002
773.005
773.006
773.007
773.007
773.007
773.006
773.006
773.005
773.005
773.005
773.005
773.005
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.003
772.999
772.992
772.899
773.092
773.099
773.104
773.108
773.111
773.112
773.112
773.112
773.113
773.113
773.112
773.112
773.112
773.111
773.11
773.109
773.108
773.106
773.103
773.101
773.099
773.098
773.097
773.095
773.091
773.08
773.043
772.978
772.917
772.867
772.833
772.815
772.809
772.81
772.823
772.863
772.905
772.938
772.962
772.978
772.99
772.997
773.002
773.004
773.006
773.006
773.006
773.006
773.006
773.006
773.005
773.005
773.005
773.005
773.005
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.003
772.999
772.988
773.015
773.01
773.005
773.002
772.999
772.998
772.998
772.997
772.997
772.997
772.997
772.998
772.998
772.998
772.998
772.998
772.999
773
773.001
773.001
773.003
773.004
773.006
773.007
773.007
773.006
773
772.97
772.887
772.805
772.752
772.729
772.724
772.731
772.77
772.842
772.899
772.938
772.963
772.978
772.987
772.993
772.996
772.998
773
773.001
773.002
773.003
773.003
773.003
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.005
773.007
773.008
773.055
773.061
773.047
773.043
773.043
773.043
773.044
773.044
773.045
773.045
773.045
773.044
773.044
773.044
773.044
773.044
773.044
773.044
773.043
773.041
773.039
773.038
773.037
773.036
773.034
773.027
772.999
772.9
772.725
772.582
772.494
772.457
772.453
772.476
772.587
772.768
772.903
772.986
773.029
773.044
773.046
773.04
773.025
773.013
773.006
773.002
773.001
773.001
773.001
773.002
773.002
773.003
773.003
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.005
773.009
773.015
773.085
773.04
773.019
773.013
773.01
773.01
773.01
773.01
773.011
773.01
773.01
773.01
773.01
773.01
773.01
773.01
773.01
773.01
773.01
773.009
773.008
773.008
773.007
773.007
773.004
772.99
772.934
772.768
772.583
772.449
772.375
772.352
772.355
772.404
772.607
772.894
773.093
773.197
773.232
773.234
773.213
773.146
773.084
773.043
773.019
773.007
773.001
772.999
772.999
772.999
773
773.001
773.002
773.003
773.003
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.005
773.005
773.01
773.016
773.114
773.039
773.017
773.01
773.008
773.008
773.009
773.009
773.008
773.008
773.008
773.008
773.008
773.008
773.008
773.007
773.007
773.007
773.007
773.007
773.007
773.005
772.998
772.978
772.953
772.932
772.916
772.91
772.913
772.953
773.119
773.403
773.641
773.797
773.862
773.863
773.796
773.54
773.253
773.068
772.972
772.938
772.933
772.937
772.954
772.971
772.982
772.99
772.994
772.998
773
773.001
773.002
773.003
773.003
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.004
773.005
773.006
773.01
773.016
773.118
773.055
773.031
773.024
773.022
773.022
773.023
773.023
773.023
773.022
773.022
773.022
773.022
773.022
773.023
773.023
773.022
773.021
773.018
773.015
773.014
773.014
773.014
773.016
773.03
773.093
773.374
774.449
776.67
778.592
779.856
780.433
780.529
780.309
779.017
776.236
774.003
772.579
771.857
771.613
771.606
771.765
772.181
772.513
772.725
772.852
772.923
772.962
772.982
772.993
772.998
773.001
773.003
773.004
773.005
773.005
773.005
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.006
773.007
773.011
773.018
773.104
772.763
772.726
772.685
772.666
772.655
772.651
772.654
772.66
772.664
772.679
772.691
772.711
772.728
772.753
772.774
772.799
772.827
772.859
772.901
772.946
772.787
772.763
772.738
772.719
772.706
772.694
772.686
772.678
772.674
772.669
772.669
772.67
772.674
772.683
772.689
772.703
772.718
772.741
772.771
772.812
772.843
772.82
772.796
772.782
772.774
772.769
772.767
772.767
772.77
772.776
772.786
772.797
772.811
772.828
772.844
772.864
772.887
772.907
772.938
772.965
772.926
772.921
772.918
772.919
772.919
772.917
772.915
772.909
772.904
772.895
772.887
772.876
772.867
772.856
772.848
772.84
772.838
772.841
772.851
772.859
772.99
772.985
772.977
772.971
772.966
772.963
772.963
772.964
772.966
772.97
772.976
772.983
772.992
773.001
773.011
773.02
773.031
773.039
773.048
773.051
773.044
773.053
773.061
773.067
773.071
773.074
773.074
773.073
773.072
773.068
773.064
773.058
773.052
773.044
773.037
773.028
773.02
773.013
773.006
773
773.074
773.081
773.085
773.086
773.087
773.088
773.089
773.09
773.091
773.093
773.094
773.096
773.098
773.1
773.101
773.102
773.099
773.095
773.084
773.071
773.101
773.113
773.123
773.127
773.129
773.13
773.131
773.132
773.132
773.131
773.131
773.13
773.129
773.126
773.123
773.118
773.112
773.102
773.089
773.067
773.102
773.114
773.123
773.125
773.127
773.127
773.128
773.127
773.127
773.127
773.126
773.125
773.125
773.123
773.121
773.117
773.113
773.104
773.093
773.07
773.102
773.122
773.137
773.141
773.145
773.147
773.148
773.149
773.15
773.15
773.15
773.15
773.15
773.149
773.147
773.144
773.139
773.131
773.119
773.094
773.087
773.107
773.111
773.112
773.113
773.113
773.113
773.114
773.114
773.113
773.113
773.112
773.112
773.112
773.111
773.109
773.099
773.051
772.946
772.874
772.848
772.848
772.886
773.085
773.63
774.181
774.584
774.834
774.954
774.985
774.974
774.874
774.548
774.164
773.848
773.598
773.409
773.27
773.173
773.105
773.06
773.031
773.012
773
772.992
772.987
772.984
772.981
772.98
772.979
772.978
772.978
772.977
772.977
772.977
772.977
772.977
772.977
772.977
772.977
772.977
772.977
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.976
772.98
772.987
773.075
772.95
772.981
772.989
772.991
772.991
772.991
772.991
772.991
772.992
772.992
772.993
772.993
772.994
772.995
772.995
772.996
772.996
772.997
772.999
773.007
773.014
773.018
773.019
773.019
773.021
773.039
773.113
773.2
773.244
773.256
773.255
773.242
773.192
773.129
773.083
773.051
773.03
773.016
773.007
773
772.995
772.991
772.988
772.985
772.983
772.981
772.98
772.979
772.978
772.977
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.974
772.974
772.975
772.979
772.985
773.089
773.06
773.079
773.085
773.086
773.087
773.087
773.087
773.087
773.087
773.087
773.087
773.086
773.086
773.086
773.086
773.086
773.088
773.089
773.09
773.09
773.09
773.091
773.095
773.104
773.109
773.109
773.107
773.093
773.038
772.957
772.895
772.857
772.84
772.837
772.84
772.86
772.897
772.926
772.948
772.962
772.971
772.977
772.979
772.98
772.98
772.98
772.979
772.978
772.977
772.977
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.974
772.974
772.975
772.979
772.985
773.085
772.904
772.918
772.918
772.917
772.917
772.916
772.916
772.916
772.916
772.916
772.916
772.917
772.917
772.917
772.918
772.918
772.918
772.919
772.921
772.924
772.925
772.926
772.928
772.932
772.941
772.949
772.953
772.954
772.951
772.93
772.866
772.806
772.775
772.766
772.768
772.79
772.843
772.889
772.922
772.945
772.96
772.969
772.973
772.976
772.977
772.977
772.977
772.977
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.974
772.975
772.978
772.984
773.056
773.062
773.069
773.075
773.078
773.081
773.082
773.083
773.083
773.083
773.083
773.082
773.082
773.081
773.08
773.079
773.078
773.077
773.075
773.072
773.07
773.069
773.068
773.066
773.063
773.054
773.023
772.957
772.892
772.839
772.802
772.782
772.776
772.778
772.791
772.833
772.876
772.909
772.933
772.95
772.961
772.969
772.973
772.975
772.976
772.977
772.977
772.977
772.976
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.974
772.974
772.976
772.977
773.025
772.985
772.98
772.975
772.972
772.97
772.969
772.968
772.968
772.968
772.968
772.968
772.968
772.968
772.968
772.969
772.969
772.97
772.971
772.971
772.973
772.974
772.976
772.977
772.977
772.976
772.971
772.945
772.865
772.78
772.726
772.701
772.696
772.703
772.742
772.814
772.871
772.909
772.934
772.949
772.958
772.963
772.967
772.969
772.971
772.972
772.973
772.973
772.974
772.974
772.974
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.973
772.973
772.972
772.969
772.957
773.031
773.017
773.014
773.014
773.014
773.014
773.014
773.014
773.014
773.015
773.015
773.015
773.015
773.015
773.015
773.014
773.013
773.011
773.01
773.009
773.008
773.007
773.005
772.999
772.976
772.886
772.711
772.566
772.476
772.439
772.435
772.459
772.573
772.751
772.882
772.961
773
773.013
773.014
773.007
772.992
772.981
772.975
772.973
772.972
772.972
772.972
772.973
772.973
772.974
772.974
772.974
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.973
772.973
772.972
772.968
772.963
772.866
773.01
772.99
772.984
772.981
772.981
772.98
772.98
772.98
772.98
772.98
772.98
772.981
772.981
772.982
772.982
772.981
772.981
772.979
772.979
772.978
772.978
772.978
772.976
772.965
772.918
772.764
772.573
772.435
772.36
772.337
772.341
772.396
772.613
772.897
773.086
773.18
773.209
773.208
773.179
773.106
773.047
773.009
772.987
772.976
772.971
772.97
772.97
772.97
772.971
772.972
772.973
772.974
772.974
772.974
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.973
772.973
772.972
772.963
772.965
772.731
773.009
772.987
772.981
772.98
772.979
772.978
772.978
772.978
772.978
772.979
772.979
772.979
772.979
772.979
772.978
772.978
772.978
772.978
772.978
772.977
772.972
772.956
772.932
772.91
772.894
772.886
772.888
772.923
773.077
773.36
773.595
773.744
773.801
773.798
773.713
773.438
773.169
773.004
772.925
772.9
772.898
772.907
772.928
772.945
772.955
772.962
772.966
772.969
772.971
772.972
772.973
772.974
772.974
772.974
772.974
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.974
772.973
772.973
772.973
772.973
772.973
772.972
772.963
772.971
772.661
773.025
773.002
772.995
772.993
772.993
772.993
772.993
772.993
772.993
772.993
772.993
772.993
772.994
772.994
772.993
772.992
772.989
772.987
772.985
772.985
772.985
772.987
772.998
773.051
773.294
774.258
776.436
778.383
779.658
780.235
780.326
780.089
778.729
775.971
773.831
772.501
771.853
771.654
771.662
771.855
772.261
772.556
772.741
772.849
772.909
772.94
772.957
772.966
772.97
772.973
772.974
772.975
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.976
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.975
772.974
772.963
772.978
772.609
773.071
773.091
773.105
773.11
773.113
773.114
773.116
773.117
773.118
773.119
773.119
773.12
773.119
773.118
773.116
773.113
773.109
773.101
773.089
773.065
773.071
773.083
773.091
773.093
773.094
773.095
773.096
773.095
773.096
773.095
773.095
773.094
773.094
773.092
773.091
773.087
773.082
773.074
773.063
773.041
773.07
773.082
773.092
773.095
773.097
773.098
773.099
773.1
773.1
773.1
773.1
773.099
773.098
773.095
773.093
773.088
773.082
773.072
773.059
773.038
773.044
773.05
773.054
773.054
773.055
773.056
773.057
773.058
773.059
773.061
773.063
773.065
773.067
773.069
773.071
773.071
773.069
773.065
773.056
773.042
773.014
773.022
773.03
773.036
773.04
773.042
773.043
773.041
773.04
773.037
773.033
773.027
773.021
773.013
773.006
772.998
772.99
772.983
772.976
772.971
772.96
772.955
772.947
772.94
772.935
772.933
772.932
772.933
772.935
772.939
772.945
772.952
772.96
772.969
772.98
772.989
773
773.008
773.018
773.022
772.895
772.89
772.887
772.889
772.889
772.886
772.884
772.878
772.873
772.864
772.856
772.845
772.835
772.824
772.816
772.808
772.805
772.807
772.816
772.824
772.811
772.788
772.764
772.75
772.742
772.738
772.736
772.736
772.739
772.745
772.754
772.765
772.779
772.795
772.812
772.829
772.853
772.871
772.903
772.928
772.755
772.731
772.706
772.687
772.675
772.663
772.655
772.647
772.642
772.638
772.637
772.638
772.641
772.648
772.658
772.669
772.683
772.705
772.732
772.77
772.73
772.693
772.653
772.634
772.623
772.619
772.622
772.627
772.634
772.647
772.659
772.678
772.695
772.719
772.741
772.764
772.792
772.822
772.861
772.904
772.986
772.967
772.962
772.961
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.956
772.954
772.951
772.949
772.95
772.959
773.02
773.348
774.672
776.797
778.254
778.908
779.003
778.705
777.13
774.77
773.221
772.426
772.143
772.116
772.219
772.489
772.685
772.798
772.858
772.889
772.904
772.911
772.914
772.916
772.916
772.916
772.916
772.917
772.917
772.917
772.917
772.917
772.918
772.918
772.919
772.92
772.92
772.921
772.922
772.923
772.924
772.926
772.927
772.928
772.93
772.931
772.932
772.934
772.935
772.937
772.938
772.939
772.941
772.942
772.943
772.945
772.946
772.947
772.948
772.949
772.95
772.951
772.952
772.953
772.954
772.954
772.955
772.956
772.956
772.957
772.957
772.958
772.958
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.957
772.957
772.956
772.956
772.955
772.955
772.954
772.953
772.953
772.952
772.951
772.95
772.949
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.938
772.937
772.936
772.936
772.936
772.936
772.936
772.936
772.936
772.936
772.937
772.938
772.939
772.94
772.941
772.943
772.945
772.947
772.949
772.951
772.954
772.957
772.959
772.962
772.966
772.969
772.973
772.976
772.98
772.984
772.989
772.993
772.997
773.002
773.006
773.011
773.016
773.021
773.026
773.031
773.037
773.042
773.048
773.053
773.059
773.065
773.071
773.077
773.083
773.089
773.095
773.101
773.108
773.114
773.121
773.128
773.134
773.141
773.148
773.155
773.163
773.17
773.177
773.185
773.192
773.2
773.208
773.215
773.223
773.232
773.24
773.248
773.257
773.266
773.274
773.284
773.293
773.302
773.312
773.322
773.332
773.342
773.353
773.364
773.375
773.386
773.398
773.409
773.422
773.434
773.447
773.46
773.473
773.487
773.501
773.515
773.53
773.545
773.56
773.575
773.591
773.606
773.623
773.639
773.655
773.672
773.689
773.706
773.724
773.741
773.759
773.777
773.795
773.813
773.832
773.85
773.869
773.888
773.907
773.926
773.945
773.964
773.983
774.003
774.023
774.042
774.062
774.082
774.102
774.123
774.143
774.163
774.184
774.205
774.226
774.247
774.268
774.289
774.31
774.332
774.353
774.375
774.397
774.419
774.441
774.464
774.486
774.509
774.532
774.555
774.578
774.601
774.624
774.648
774.672
774.695
774.719
774.744
774.768
774.792
774.817
774.842
774.866
774.891
774.916
774.942
774.967
774.993
775.018
775.044
775.07
775.096
775.123
775.149
775.175
775.202
775.229
775.256
775.283
775.31
775.337
775.365
775.392
775.42
775.448
775.475
775.503
775.532
775.56
775.588
775.617
775.645
775.674
775.703
775.732
775.761
775.79
775.819
775.849
775.878
775.908
775.937
775.967
775.997
776.027
776.057
776.087
776.117
776.147
776.178
776.208
776.239
776.269
776.3
776.33
776.361
776.391
776.422
776.453
776.484
776.514
776.545
776.576
776.607
776.637
776.668
776.699
776.73
776.761
776.792
776.823
776.854
776.885
776.916
776.947
776.978
777.009
777.041
777.072
777.104
777.135
777.167
777.199
777.231
777.263
777.296
777.328
777.361
777.393
777.426
777.459
777.492
777.526
777.559
777.593
777.627
777.661
777.695
777.729
777.763
777.797
777.832
777.866
777.901
777.935
777.97
778.005
778.039
778.074
778.109
778.144
778.178
778.213
778.247
778.282
778.316
778.351
778.385
778.42
778.454
778.488
778.522
778.556
778.59
778.624
778.658
778.692
778.725
778.759
778.792
778.826
778.859
778.892
778.925
778.958
778.991
779.024
779.057
779.09
779.123
779.155
779.188
779.22
779.253
779.285
779.318
779.35
779.382
779.414
779.446
779.478
779.51
779.542
779.573
779.605
779.637
779.668
779.7
779.731
779.762
779.794
779.825
779.856
779.887
779.918
779.948
779.979
780.01
780.04
780.071
780.101
780.131
780.162
780.192
780.222
780.251
780.281
780.311
780.341
780.37
780.399
780.429
780.458
780.487
780.516
780.545
780.573
780.602
780.631
780.659
780.687
780.715
780.743
780.771
780.799
780.827
780.854
780.882
780.909
780.936
780.964
780.99
781.017
781.044
781.07
781.097
781.123
781.149
781.175
781.201
781.227
781.253
781.278
781.303
781.329
781.354
781.378
781.403
781.428
781.452
781.477
781.501
781.525
781.549
781.572
781.596
781.619
781.642
781.666
781.688
781.712
781.733
781.758
781.777
781.803
781.82
781.848
781.863
781.892
781.905
781.935
781.947
781.977
781.989
782.018
782.029
772.97
772.953
772.948
772.946
772.947
772.947
772.947
772.947
772.945
772.944
772.944
772.944
772.944
772.944
772.942
772.933
772.909
772.886
772.871
772.869
772.887
772.999
773.277
773.5
773.612
773.633
773.592
773.385
773.121
772.964
772.891
772.869
772.867
772.875
772.891
772.901
772.907
772.911
772.913
772.914
772.914
772.915
772.915
772.915
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
772.972
772.956
772.952
772.95
772.949
772.949
772.949
772.949
772.949
772.949
772.948
772.946
772.946
772.946
772.946
772.946
772.943
772.931
772.871
772.697
772.533
772.443
772.417
772.425
772.507
772.749
772.955
773.061
773.093
773.092
773.067
773.007
772.963
772.937
772.924
772.918
772.915
772.914
772.914
772.914
772.915
772.915
772.915
772.915
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
772.997
772.985
772.983
772.983
772.983
772.983
772.983
772.983
772.983
772.982
772.981
772.98
772.978
772.977
772.976
772.975
772.973
772.965
772.933
772.812
772.648
772.541
772.494
772.488
772.512
772.626
772.775
772.87
772.92
772.939
772.941
772.938
772.93
772.923
772.919
772.917
772.916
772.916
772.916
772.916
772.916
772.916
772.915
772.915
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
772.953
772.947
772.943
772.94
772.938
772.937
772.937
772.937
772.936
772.936
772.937
772.937
772.937
772.938
772.939
772.941
772.941
772.941
772.94
772.93
772.886
772.795
772.729
772.697
772.689
772.696
772.735
772.8
772.847
772.878
772.896
772.906
772.912
772.915
772.916
772.917
772.917
772.917
772.917
772.917
772.916
772.916
772.916
772.915
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
773.035
773.041
773.046
773.05
773.051
773.051
773.051
773.051
773.05
773.048
773.047
773.045
773.043
773.04
773.038
773.036
773.033
773.03
773.02
772.987
772.91
772.836
772.784
772.756
772.746
772.747
772.763
772.809
772.851
772.881
772.9
772.912
772.918
772.922
772.923
772.922
772.922
772.921
772.919
772.918
772.917
772.917
772.916
772.916
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
772.878
772.885
772.885
772.884
772.884
772.884
772.883
772.883
772.883
772.883
772.883
772.883
772.884
772.886
772.887
772.888
772.889
772.893
772.902
772.908
772.909
772.906
772.888
772.824
772.763
772.733
772.726
772.733
772.771
772.827
772.867
772.892
772.908
772.916
772.92
772.921
772.921
772.921
772.92
772.918
772.918
772.917
772.916
772.916
772.915
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
773.035
773.048
773.052
773.053
773.053
773.054
773.054
773.053
773.052
773.052
773.052
773.053
773.054
773.053
773.052
773.053
773.056
773.058
773.059
773.058
773.048
773.008
772.924
772.857
772.818
772.801
772.799
772.806
772.836
772.872
772.897
772.912
772.921
772.925
772.926
772.926
772.924
772.923
772.921
772.919
772.918
772.917
772.916
772.916
772.916
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
772.925
772.949
772.955
772.955
772.956
772.956
772.957
772.957
772.958
772.958
772.957
772.958
772.958
772.962
772.967
772.969
772.969
772.966
772.966
772.977
773.036
773.117
773.158
773.167
773.165
773.149
773.1
773.05
773.014
772.988
772.97
772.957
772.947
772.94
772.934
772.93
772.926
772.924
772.921
772.92
772.918
772.917
772.916
772.916
772.916
772.915
772.915
772.915
772.916
772.916
772.917
772.917
772.918
772.919
772.92
772.921
772.922
772.923
772.924
772.925
772.927
772.928
772.929
772.931
772.932
772.934
772.935
772.936
772.938
772.939
772.94
772.942
772.943
772.944
772.945
772.946
772.948
772.949
772.949
772.95
772.951
772.952
772.953
772.953
772.954
772.955
772.955
772.956
772.956
772.957
772.957
772.957
772.958
772.958
772.958
772.958
772.958
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.958
772.957
772.957
772.957
772.957
772.957
772.956
772.956
772.956
772.955
772.955
772.954
772.954
772.953
772.952
772.952
772.951
772.95
772.95
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.937
772.937
772.936
772.935
772.935
772.934
772.934
772.934
772.934
772.934
772.934
772.935
772.935
772.936
772.937
772.938
772.94
772.941
772.943
772.945
772.947
772.95
772.952
772.955
772.958
772.961
772.964
772.968
772.971
772.975
772.979
772.983
772.987
772.991
772.996
773
773.005
773.01
773.014
773.019
773.025
773.03
773.035
773.041
773.046
773.052
773.057
773.063
773.069
773.075
773.081
773.087
773.093
773.1
773.106
773.113
773.119
773.126
773.133
773.14
773.147
773.154
773.161
773.168
773.175
773.183
773.19
773.198
773.206
773.214
773.222
773.23
773.238
773.247
773.255
773.264
773.273
773.282
773.291
773.301
773.31
773.32
773.33
773.34
773.351
773.362
773.373
773.384
773.396
773.408
773.42
773.433
773.445
773.458
773.472
773.485
773.499
773.514
773.528
773.543
773.558
773.573
773.589
773.605
773.621
773.637
773.654
773.671
773.688
773.705
773.722
773.74
773.758
773.775
773.794
773.812
773.83
773.849
773.867
773.886
773.905
773.924
773.943
773.962
773.982
774.001
774.021
774.041
774.061
774.081
774.101
774.121
774.141
774.162
774.182
774.203
774.224
774.245
774.266
774.287
774.309
774.33
774.352
774.374
774.396
774.418
774.44
774.462
774.485
774.507
774.53
774.553
774.576
774.599
774.623
774.646
774.67
774.694
774.718
774.742
774.766
774.791
774.815
774.84
774.865
774.89
774.915
774.94
774.966
774.991
775.017
775.043
775.069
775.095
775.121
775.147
775.174
775.2
775.227
775.254
775.281
775.308
775.336
775.363
775.391
775.418
775.446
775.474
775.502
775.53
775.558
775.587
775.615
775.644
775.673
775.701
775.73
775.759
775.789
775.818
775.847
775.877
775.906
775.936
775.966
775.996
776.025
776.055
776.086
776.116
776.146
776.176
776.207
776.237
776.268
776.298
776.329
776.359
776.39
776.421
776.451
776.482
776.513
776.544
776.574
776.605
776.636
776.667
776.698
776.728
776.759
776.79
776.821
776.852
776.883
776.914
776.945
776.977
777.008
777.039
777.071
777.102
777.134
777.166
777.198
777.23
777.262
777.294
777.327
777.359
777.392
777.425
777.458
777.491
777.524
777.558
777.592
777.625
777.659
777.693
777.727
777.762
777.796
777.83
777.865
777.899
777.934
777.969
778.003
778.038
778.073
778.107
778.142
778.177
778.211
778.246
778.281
778.315
778.35
778.384
778.418
778.453
778.487
778.521
778.555
778.589
778.623
778.657
778.69
778.724
778.757
778.791
778.824
778.858
778.891
778.924
778.957
778.99
779.023
779.056
779.089
779.121
779.154
779.187
779.219
779.252
779.284
779.316
779.349
779.381
779.413
779.445
779.477
779.509
779.541
779.572
779.604
779.636
779.667
779.699
779.73
779.761
779.792
779.824
779.855
779.886
779.916
779.947
779.978
780.009
780.039
780.07
780.1
780.13
780.16
780.19
780.22
780.25
780.28
780.31
780.339
780.369
780.398
780.428
780.457
780.486
780.515
780.544
780.572
780.601
780.63
780.658
780.686
780.714
780.742
780.77
780.798
780.826
780.853
780.881
780.908
780.935
780.962
780.989
781.016
781.043
781.069
781.096
781.122
781.148
781.174
781.2
781.226
781.252
781.277
781.302
781.328
781.353
781.378
781.402
781.427
781.451
781.476
781.5
781.524
781.548
781.571
781.595
781.619
781.642
781.665
781.687
781.711
781.732
781.757
781.776
781.803
781.819
781.847
781.862
781.891
781.905
781.934
781.947
781.976
781.988
782.017
782.028
773.06
773.072
773.076
773.077
773.078
773.078
773.077
773.077
773.077
773.077
773.076
773.072
773.05
772.992
772.953
772.943
772.951
773.029
773.367
773.938
774.373
774.639
774.758
774.782
774.758
774.602
774.207
773.838
773.551
773.339
773.191
773.091
773.026
772.985
772.96
772.944
772.934
772.928
772.925
772.922
772.92
772.919
772.918
772.918
772.917
772.917
772.917
772.917
772.917
772.918
772.918
772.919
772.92
772.92
772.921
772.922
772.923
772.924
772.926
772.927
772.928
772.93
772.931
772.932
772.934
772.935
772.937
772.938
772.939
772.941
772.942
772.943
772.945
772.946
772.947
772.948
772.949
772.95
772.951
772.952
772.953
772.954
772.954
772.955
772.956
772.956
772.957
772.957
772.958
772.958
772.959
772.959
772.959
772.959
772.96
772.96
772.96
772.96
772.96
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.961
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.96
772.959
772.959
772.959
772.959
772.959
772.959
772.958
772.958
772.958
772.958
772.957
772.957
772.956
772.956
772.955
772.955
772.954
772.953
772.953
772.952
772.951
772.95
772.949
772.949
772.948
772.947
772.946
772.945
772.944
772.943
772.942
772.941
772.94
772.939
772.938
772.938
772.937
772.936
772.936
772.936
772.936
772.936
772.936
772.936
772.936
772.937
772.938
772.939
772.94
772.941
772.943
772.945
772.947
772.949
772.951
772.954
772.957
772.959
772.962
772.966
772.969
772.973
772.976
772.98
772.984
772.989
772.993
772.997
773.002
773.006
773.011
773.016
773.021
773.026
773.031
773.037
773.042
773.048
773.053
773.059
773.065
773.071
773.077
773.083
773.089
773.095
773.101
773.108
773.114
773.121
773.128
773.134
773.141
773.148
773.155
773.163
773.17
773.177
773.185
773.192
773.2
773.208
773.215
773.223
773.232
773.24
773.248
773.257
773.266
773.274
773.284
773.293
773.302
773.312
773.322
773.332
773.342
773.353
773.364
773.375
773.386
773.398
773.409
773.422
773.434
773.447
773.46
773.473
773.487
773.501
773.515
773.53
773.545
773.56
773.575
773.591
773.606
773.623
773.639
773.655
773.672
773.689
773.706
773.724
773.741
773.759
773.777
773.795
773.813
773.832
773.85
773.869
773.888
773.907
773.926
773.945
773.964
773.983
774.003
774.023
774.042
774.062
774.082
774.102
774.123
774.143
774.163
774.184
774.205
774.226
774.247
774.268
774.289
774.31
774.332
774.353
774.375
774.397
774.419
774.441
774.464
774.486
774.509
774.532
774.555
774.578
774.601
774.624
774.648
774.672
774.695
774.719
774.744
774.768
774.792
774.817
774.842
774.866
774.891
774.916
774.942
774.967
774.993
775.018
775.044
775.07
775.096
775.123
775.149
775.175
775.202
775.229
775.256
775.283
775.31
775.337
775.365
775.392
775.42
775.448
775.475
775.503
775.532
775.56
775.588
775.617
775.645
775.674
775.703
775.732
775.761
775.79
775.819
775.849
775.878
775.908
775.937
775.967
775.997
776.027
776.057
776.087
776.117
776.147
776.178
776.208
776.239
776.269
776.3
776.33
776.361
776.391
776.422
776.453
776.484
776.514
776.545
776.576
776.607
776.637
776.668
776.699
776.73
776.761
776.792
776.823
776.854
776.885
776.916
776.947
776.978
777.009
777.041
777.072
777.104
777.135
777.167
777.199
777.231
777.263
777.296
777.328
777.361
777.393
777.426
777.459
777.492
777.526
777.559
777.593
777.627
777.661
777.695
777.729
777.763
777.797
777.832
777.866
777.901
777.935
777.97
778.005
778.039
778.074
778.109
778.144
778.178
778.213
778.247
778.282
778.316
778.351
778.385
778.42
778.454
778.488
778.522
778.556
778.59
778.624
778.658
778.692
778.725
778.759
778.792
778.826
778.859
778.892
778.925
778.958
778.991
779.024
779.057
779.09
779.123
779.155
779.188
779.22
779.253
779.285
779.318
779.35
779.382
779.414
779.446
779.478
779.51
779.542
779.573
779.605
779.637
779.668
779.7
779.731
779.762
779.794
779.825
779.856
779.887
779.918
779.948
779.979
780.01
780.04
780.071
780.101
780.131
780.162
780.192
780.222
780.251
780.281
780.311
780.341
780.37
780.399
780.429
780.458
780.487
780.516
780.545
780.573
780.602
780.631
780.659
780.687
780.715
780.743
780.771
780.799
780.827
780.854
780.882
780.909
780.936
780.964
780.99
781.017
781.044
781.07
781.097
781.123
781.149
781.175
781.201
781.227
781.253
781.278
781.303
781.329
781.354
781.378
781.403
781.428
781.452
781.477
781.501
781.525
781.549
781.572
781.596
781.619
781.642
781.666
781.688
781.712
781.733
781.758
781.777
781.803
781.82
781.848
781.863
781.892
781.905
781.935
781.947
781.977
781.989
782.018
782.029
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
sides
{
type empty;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //
| [
"alexmayes@gmail.com"
] | alexmayes@gmail.com | |
67a847b1b52808f28eef8b74f5f3174bcf999d4c | 87d4f0499a8d792446d10753c088cb635188f47c | /PRO1/P73501_ca/S012-AC.cc | cdc1f63ad6615b5b6dfd308f149de79a589d8f67 | [] | no_license | lladruc/FIB | e08265cc6231aab8983ee0ff1343ac2266237427 | da03b6aa0acce04fa61d52a51f3c7934b2d84820 | refs/heads/master | 2022-05-03T04:02:08.073880 | 2022-04-11T12:03:31 | 2022-04-11T12:03:31 | 33,666,272 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 320 | cc | #include <iostream>
using namespace std;
int main(){
int n;
for(cin >> n;n>0;--n){
int n1,n2,contador=0;
cin >> n1;
if(n1!=0){
cin >> n2;
}
while(n2 !=0){
if(n1<n2){
++contador;
}
n1=n2;
cin >> n2;
}
cout << contador << endl;
contador=0;
} //end for
}
| [
"Lladruc@Dru-MacBooks-Air-2.local"
] | Lladruc@Dru-MacBooks-Air-2.local |
32f54a113a01d685e1f1c6d50cc7718d3de460bc | 17baf4c5955e17646e4eeb8f74ed3ebc304c3cc2 | /ClassMeleeWeapon.h | 0d9b5c872a1072c0a7c4886fcbd53202b9199a80 | [] | no_license | michael-hentz/Text-RPG-Game | 3bebe9879251ea6521f8be305bd06a965527b255 | 6a380a42a61997f801f45cf2f2104fc1e006a1e8 | refs/heads/master | 2022-09-23T05:01:45.151377 | 2020-06-02T18:46:10 | 2020-06-02T18:46:10 | 268,882,055 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 157 | h | #pragma once
class meleeWeapon {
public:
void setDamage(int d);
int getDamage();
void setTime(int t);
int getTime();
private:
int damage;
int time;
}; | [
"mthe229@uky.edu"
] | mthe229@uky.edu |
32f3d8df322b243e3b194310b64fb0e3254dab9b | 18c2ae29292555e473f4ec92561647418ecb8ef0 | /src/widget/event/generator/idle.hpp | f30aaa9f9f3861a56843296d333bc4e42afc4459 | [] | no_license | dmilos/widget | ea93e9de4817eb96627bebbe56aedf9ef0c353d1 | 3889f64ac968ac591f97006c83ea3a6dcd557f18 | refs/heads/master | 2021-05-04T20:18:36.756051 | 2019-01-22T10:51:45 | 2019-01-22T11:44:49 | 69,472,785 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 801 | hpp | #ifndef widget_event_generator_idle
#define widget_event_generator_idle
// ::widget::event::generator::idle
#include "./pure.hpp"
namespace widget
{
namespace event
{
namespace generator
{
class idle
: public widget::event::generator::pure
{
public:
typedef widget::event::pure event_type;
public:
idle()
{
}
~idle()
{
this->stop();
}
public:
bool run()
{
this->active_protected().store( true );
return true;
}
void stop()
{
this->active_protected().store( false );
}
};
}
}
}
#endif
| [
"dmilos@gmail.com"
] | dmilos@gmail.com |
305e1b814656e08cdb3b486133d8acc6024d271d | fa74bc6adcd0dc151c8e0e078cb50967c8ad32c3 | /ScheduleConfig.cpp | 65106ff2fdb1daafd3a3674630fc9d4339da0714 | [] | no_license | crw-xiix/EvapCooler | 98607d379dbd76d738ef22b543cf4ca3167bc1df | da1e6619ccd681f6b641d344c2fe260d915a5163 | refs/heads/master | 2020-06-06T18:09:34.723053 | 2019-07-20T00:21:41 | 2019-07-20T00:21:41 | 192,817,211 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,246 | cpp |
#include "ScheduleConfig.h"
#include <EEPROM.h>
#include "nettime.h"
#include "8266IO.h"
char DevicePassword[32];
ScheduleConfig ScheduleConfig::LoadFromEEPROM() {
bool fail = false;
uint8_t ecrc = 0;
int esize;
ScheduleConfig sc;
int size = sizeof(ScheduleConfig) + 8;
EEPROM.begin(size);
EEPROM.get(0, sc);
EEPROM.get(sizeof(ScheduleConfig), ecrc);
EEPROM.get(sizeof(ScheduleConfig) + 1, esize);
EEPROM.end();
uint8_t crc = crcSlow((uint8_t*)(&sc), sizeof(ScheduleConfig));
if (crc != ecrc) {
webLog.println("CRC Error, Invalid EEPROM DATA");
sc.ResetDefault();
}
if (esize != sizeof(ScheduleConfig)) {
webLog.println("Size mismatch, Invalid EEPROM DATA");
sc.ResetDefault();
}
webLog.println("Loaded EEPROM DATA");
return sc;
}
bool ScheduleConfig::SaveToEEPROM() {
int size = sizeof(ScheduleConfig) + 8;
int esize = sizeof(ScheduleConfig);
uint8_t ecrc = 0;
ScheduleConfig sc = *this;
uint8_t crc = crcSlow((uint8_t*)(&sc), sizeof(ScheduleConfig));
EEPROM.begin(size);
EEPROM.put(0, sc);
EEPROM.put(sizeof(ScheduleConfig), crc);
EEPROM.put(sizeof(ScheduleConfig) + 1, esize);
EEPROM.commit();
EEPROM.get(sizeof(ScheduleConfig), ecrc);
if (crc != ecrc) {
webLog.println("On Save: Invalid EEPROM DATA");
}
else {
webLog.println("Verified EEPROM data");
}
EEPROM.end();
}
//Only stores a pointer to the value.....
void ScheduleConfig::SetPassword(const char *val) {
strncpy(DevicePassword, val,32);
DevicePassword[31] = 0;
}
void ScheduleConfig::OutputJson(Stream* dev) {
dev->printf("{\n");
dev->printf("\"Title\": \"%s\",\n", sConfig.Title);
dev->printf("\"Version\": \"%s\",\n", sConfig.Version);
dev->printf("\"DST\": %s,\n", sConfig.DST ? "true" : "false");
dev->printf("\"DayTemp\": %.1f,\n", DayTemp);
dev->printf("\"NightMax\": %.1f,\n", NightMax);
dev->printf("\"NightMin\": %.1f,\n", NightMin);
dev->printf("\"FanMode\" : %d,\n", (int)FanMode);
dev->printf("\"PumpMode\" : %d,\n", (int)PumpMode);
dev->printf("\"VacationMode\" : %d\n", (int)VacationMode);
dev->println("}");
}
void ScheduleConfig::ResetDefault() {
DST = false;
strcpy(Title, "New Remote Action Unit");
strcpy(Version, "Enter something here");
DayTemp = 78.0;
NightMax = 76.0;
NightMin = 65.0;
FanMode = TriState::Automatic;
PumpMode = TriState::Automatic;
VacationMode = false;
}
float getFloatDefault(const char *src, float dft) {
float v;
if (sscanf(src, "%f", &v) > 0) return v;
return dft;
}
TriState getTriStateDefault(const char *src, TriState val) {
int v;
if (sscanf(src, "%d", &v) > 0) if ((v>=0)&&(v<=2)) return TriState(v);
return val;
}
bool getBoolDefault(const char *src, bool val) {
int v;
if (sscanf(src, "%d", &v) > 0) {
if (v == 0) return false;
if (v == 1) return true;
}
if (strstr(src, "true")) return true;
if (strstr(src, "false")) return false;
return val;
}
bool isPresent(const char *search, const char *phrase, const char *before) {
const char *tmp = strstr(search, phrase);
if (tmp == NULL) return false;
if (tmp >= before) return false;
return true;
}
//Returns true if good data, false to block
bool ScheduleConfig::HandlePostData(WiFiClient& client) {
char password[80];
password[0] = 0;
//read till 2 line feeds
char buffer[120];
char decoded[100];
const char *ptr;
int lastLen = 119;
bool okay = true;
bool firstTask = true;
while (true) {
if (!client.connected()) break;
bool val = readBytesUntil(client,buffer, '\n', 120,500);
Serial.print(buffer);
//Something failed, too long, timeout, something, loop.
if (!val) continue;
int v;
ptr = strstr(buffer, "=");
if (!ptr) {
if (strstr(buffer, "END") == buffer) break;
continue;
}
//End it at the comma
if (char *pcomma = strstr(buffer, ",")) *pcomma = 0;
ptr++;
//Password first......
if (isPresent(buffer, "Password=", ptr)) {
strncpy(password, ptr, 32);
webLog.println(password);
if (strcmp(password, DevicePassword) != 0) break;
}
if (password[0] == 0) continue;
if (isPresent(buffer, "Title", ptr)) strncpy(sConfig.Title, ptr, sizeof(sConfig.Title));
if (isPresent(buffer, "Version", ptr)) strncpy(sConfig.Version, ptr, sizeof(sConfig.Version));
if (isPresent(buffer, "DST", ptr)) if (sscanf(ptr, "%d", &v) > 0) sConfig.DST = (v != 0);
if (isPresent(buffer, "DayTemp", ptr)) DayTemp = getFloatDefault(ptr, DayTemp);
if (isPresent(buffer, "NightMax", ptr)) NightMax = getFloatDefault(ptr, NightMax);
if (isPresent(buffer, "NightMin", ptr)) NightMin = getFloatDefault(ptr, NightMin);
if (isPresent(buffer, "DayTemp", ptr)) DayTemp = getFloatDefault(ptr, DayTemp);
if (isPresent(buffer, "FanMode", ptr)) FanMode = getTriStateDefault(ptr, FanMode);
if (isPresent(buffer, "PumpMode", ptr)) PumpMode = getTriStateDefault(ptr, PumpMode);
if (isPresent(buffer, "VacationMode", ptr)) VacationMode = getBoolDefault(ptr, VacationMode);
}
client.flush();
if (strcmp(password, DevicePassword) != 0) {
sprintf(buffer, "Actual: %s Tried: %s", DevicePassword, password);
webLog.println("Invalid Password");
webLog.println(buffer);
return false;
}
else {
sConfig.SaveToEEPROM();
webLog.println("EEPROM Saved");
return true;
}
}
ScheduleConfig sConfig = ScheduleConfig(); | [
"charles@loneaspen.com"
] | charles@loneaspen.com |
554fc8112f8a49ace8dfea3247c08f50c4087ddc | 695a9df8527fa0bd068c29c7be00c7b8a05df8c8 | /ALG_Labs/mainwindow.cpp | 33888e695f4c8531f0e620036f4e5541cbabfc77 | [] | no_license | AntonGorielikov/ALG_Labs_2Year | c229e70507cc8bb9a3ff371307bf493ca78ff482 | 52226acf8b75eae21e4299844208c1f0a0cb891a | refs/heads/master | 2021-08-29T10:51:15.550269 | 2017-12-13T19:30:28 | 2017-12-13T19:30:28 | 103,264,179 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,858 | cpp | #include "mainwindow.h"
#include <QFile>
#include <QPushButton>
#include <QComboBox>
#include <QLabel>
#include <QGridLayout>
#include <QSpinBox>
#include <ctime>
#include <QProgressDialog>
#include <QTextStream>
#include <QMessageBox>
#include <QApplication>
#include <QTime>
#include <cmath>
#include <typeinfo>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
manual_data_sort_ = new QPushButton();
manual_data_sort_->setText(tr("&Test"));
auto_num_label_ = new QLabel(tr("Array &size:"));
auto_num_spinbox_ = new QSpinBox();
auto_num_label_->setBuddy(auto_num_spinbox_);
auto_num_spinbox_->setMinimum(0);
auto_num_spinbox_->setMaximum(10000000);
auto_num_spinbox_->setValue(10000);
QGridLayout *layout = new QGridLayout();
layout->addWidget(auto_num_label_, 0, 0, 1, 1);
layout->addWidget(auto_num_spinbox_, 0, 1, 1, 2);
layout->addWidget(manual_data_sort_, 2, 0, 1, 2);
QWidget *main_widget = new QWidget();
main_widget->setLayout(layout);
this->setCentralWidget(main_widget);
setFixedSize(minimumSizeHint());
connect(manual_data_sort_, &QPushButton::clicked, this, &MainWindow::manualDataSort);
}
void MainWindow::manualDataSort()
{
autoDataSort();
}
void MainWindow::autoDataSort()
{
QVector<int> values(auto_num_spinbox_->value());
srand(time(NULL));
for(int i = 0; i < values.size(); ++i)
values[i] = rand() % 100;
sort(values);
}
void MainWindow::dump_array(QVector<int> &values, QTextStream &stream)
{
for(int i = 0; i < values.size(); ++i)
stream << "array["<<i<<"]="<<values.at(i)<<ENDL;
}
void MainWindow::sort(QVector<int> &values)
{
QFile file("output.txt");
if (!file.open(QIODevice::WriteOnly))
return;
QTextStream stream(&file);
QProgressDialog dialog(this);
dialog.setLabelText(tr("Sorting array..."));
dialog.setCancelButtonText(tr("Cancel"));
dialog.setWindowModality(Qt::WindowModal);
dialog.show();
stream << "Running tests with array size = " << values.size() << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
QTime time_before, time_after;
/*dialog.setLabelText(tr("Sorting array... (bubble)"));
time_before = QTime::currentTime();
bubbleSort(values, dialog, stream);
time_after = QTime::currentTime();
stream << "Bubble sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
dialog.setLabelText(tr("Sorting array... (selection)"));
time_before = QTime::currentTime();
selectionSort(values, dialog, stream);
time_after = QTime::currentTime();
stream << "Selection sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}*/
dialog.setLabelText(tr("Sorting array... (shell)"));
time_before = QTime::currentTime();
shellSort(values, dialog, stream);
time_after = QTime::currentTime();
stream << "Shell sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
dialog.setLabelText(tr("Sorting array... (merge)"));
time_before = QTime::currentTime();
QVector<int> values_cpy = values;
mergeSort(values_cpy, dialog, stream);
dump_array(values_cpy, stream);
time_after = QTime::currentTime();
stream << "Merge sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
dialog.setLabelText(tr("Sorting array... (quick)"));
time_before = QTime::currentTime();
values_cpy = values;
quick_Sort(values, 0, values.size() - 1, dialog, stream);
dump_array(values_cpy, stream);
time_after = QTime::currentTime();
stream << "Quick sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
dialog.setLabelText(tr("Sorting array... (counting)"));
time_before = QTime::currentTime();
counting_Sort(values, 0, 99, dialog, stream);
time_after = QTime::currentTime();
stream << "Counting sort: " << time_before.msecsTo(time_after) << " msec" << ENDL;
if (dialog.wasCanceled())
{
stream << "Test was canceled, results may be invalid" << ENDL;
return;
}
dialog.hide();
QMessageBox::information(this,tr("Sort tests completed"),
tr("Output is in output.txt file in exe dir."));
}
void MainWindow::counting_Sort(QVector<int> values, int lower_limit, int upper_limit, QProgressDialog &dialog, QTextStream &s)
{
if(upper_limit < lower_limit)
return;
QVector<int> key_occurances;
key_occurances.resize(upper_limit - lower_limit + 1);
for(int i = 0; i < key_occurances.size(); ++i)
key_occurances[i] = 0;
for(int i = 0; i < values.size(); ++i)
{
if (dialog.wasCanceled())
return;
QApplication::processEvents();
key_occurances[values.at(i) - lower_limit] += 1;
}
values.clear();
for(int i = 0; i < key_occurances.size(); ++i)
for(int j = 0; j < key_occurances.at(i); ++j)
{
if (dialog.wasCanceled())
return;
QApplication::processEvents();
values.append(i + lower_limit);
}
dump_array(values, s);
}
| [
"gorelikov.anton@gmail.com"
] | gorelikov.anton@gmail.com |
b8c86f1e37f72ac61ff6c00204599246d831ece8 | e94803674c150940d4a5cee91bd7c4956dfce509 | /Source/Dodge the F Grade/grade.h | eaeb59f4ac85610a5a7c486d78273c11d283526b | [] | no_license | JINHYEOK-YOO/Dodge_the_F_Grade | a29e6eb9e6cffe80243923ebace21908e903f002 | 0fdf88e172f52ac5067fed90a568dfc9b950636f | refs/heads/master | 2022-06-11T05:01:03.823985 | 2020-05-11T13:02:28 | 2020-05-11T13:02:28 | 263,043,291 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 168 | h | #pragma once
class Grade
{
public:
void appear(int); // 학점 생성 좌표와 종류(A+ ~ D) 랜덤으로 지정 후 표시
private:
int _xPos, _yPos;
}; | [
"yujh703@gmail.com"
] | yujh703@gmail.com |
49a9256df0d6e93e06639a914c81009c783189e2 | 0f7a4119185aff6f48907e8a5b2666d91a47c56b | /sstd_utility/windows_boost/boost/poly_collection/detail/is_invocable.hpp | 35cf4b4c01e2f8f0cf77b7cab44638b33ffb2aed | [] | no_license | jixhua/QQmlQuickBook | 6636c77e9553a86f09cd59a2e89a83eaa9f153b6 | 782799ec3426291be0b0a2e37dc3e209006f0415 | refs/heads/master | 2021-09-28T13:02:48.880908 | 2018-11-17T10:43:47 | 2018-11-17T10:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,267 | hpp | /* Copyright 2016-2017 Joaquin M Lopez Munoz.
* 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)
*
* See http://www.boost.org/libs/poly_collection for library home page.
*/
#ifndef BOOST_POLY_COLLECTION_DETAIL_IS_INVOCABLE_HPP
#define BOOST_POLY_COLLECTION_DETAIL_IS_INVOCABLE_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <functional>
#include <type_traits>
/* technique explained at
* http://bannalia.blogspot.com/2016/09/compile-time-checking-existence-of.html
*/
namespace boost{
namespace poly_collection{
namespace detail{
namespace is_invocable_fallback{
template <typename F,typename... Args>
struct is_invocable:
std::is_constructible<
std::function<void(Args...)>,
std::reference_wrapper<typename std::remove_reference<F>::type>
>
{};
template <typename R,typename F,typename... Args>
struct is_invocable_r:
std::is_constructible<
std::function<R(Args...)>,
std::reference_wrapper<typename std::remove_reference<F>::type>
>
{};
struct hook{};
}}}}
namespace std{
template<>
struct is_void< ::boost::poly_collection::detail::is_invocable_fallback::hook>:
std::false_type
{
template<typename F,typename... Args>
static constexpr bool is_invocable_f()
{
using namespace ::boost::poly_collection::detail::is_invocable_fallback;
return is_invocable<F,Args...>::value;
}
template<typename R,typename F,typename... Args>
static constexpr bool is_invocable_r_f()
{
using namespace ::boost::poly_collection::detail::is_invocable_fallback;
return is_invocable_r<R,F,Args...>::value;
}
};
} /* namespace std */
namespace boost{
namespace poly_collection{
namespace detail{
template<typename F,typename... Args>
struct is_invocable:std::integral_constant<
bool,
std::is_void<is_invocable_fallback::hook>::template
is_invocable_f<F,Args...>()
>{};
template<typename R,typename F,typename... Args>
struct is_invocable_r:std::integral_constant<
bool,
std::is_void<is_invocable_fallback::hook>::template
is_invocable_r_f<R,F,Args...>()
>{};
} /* namespace poly_collection::detail */
} /* namespace poly_collection */
} /* namespace boost */
#endif
| [
"nanguazhude@vip.qq.com"
] | nanguazhude@vip.qq.com |
dbd11906769ef4db13afc8f60b74b0f5a950af70 | 7d9abd7826ddc59bfcf1663f3b30ec71548b4668 | /289. Game of Life.cpp | aefff51e801652d9a3ce62248466c8a9389c6383 | [] | no_license | Hongze-Wang/LeetCode_Java | 988f0873d98f8386e0c1cd19dd60f626b2f75c64 | 4f2dce821af679bf0d1e24e2e5cdb92c0a5d9a13 | refs/heads/master | 2021-06-28T16:47:59.202156 | 2021-01-21T02:06:44 | 2021-01-21T02:06:44 | 207,439,327 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,552 | cpp | // 289. Game of Life
// 双百解法
// 解法中注释了不需要更改的代码是为了辅助思考
// 在思考阶段就应该想到 只需要处理改变的情况就可以
// // 活的细胞死去 需要更改
// if(board[r][c] == 1 && (count < 2 || count > 3)) {
// board[r][c] = -1; // 别的位置仍需要考虑该位置细胞是存活的 因为改成-1 绝对值为1 和 等于1的情况等价
// }
// // 死的细胞活了 需要更改
// if(board[r][c] == 0 && count == 3) {
// board[r][c] = 2;
// }
// // 活的细胞还活着 不需要更改
// // if(board[r][c] == 1 && (count == 2 || count == 3)) {
// // board[r][c] = 1;
// // }
// // 同理 死的细胞没有活也不需要更改
class Solution {
public:
void gameOfLife(vector<vector<int>>& board) {
int neighbors[3] = {-1, 0, 1};
int rows = board.size();
int cols = board[0].size();
for(int r=0; r<rows; r++) {
for(int c=0; c<cols; c++) {
int count = 0;
for(int i=0; i<3; i++) {
for(int j=0; j<3; j++) {
if(neighbors[i] != 0 || neighbors[j] != 0) {
int x = r + neighbors[i];
int y = c + neighbors[j];
if(x<rows && x >= 0 && y<cols && y>=0 && abs(board[x][y]) == 1) {
count++;
}
}
}
}
// 活的细胞死去 需要更改
if(board[r][c] == 1 && (count < 2 || count > 3)) {
board[r][c] = -1; // 别的位置仍需要考虑该位置细胞是活的 因此改成-1 绝对值为1 和 等于1的情况等价
}
// 死的细胞活了 需要更改
if(board[r][c] == 0 && count == 3) {
board[r][c] = 2; // 别的位置仍需要考虑该位置细胞是死的 因此改成2 绝对值为2 和 等于1的情况区分
}
}
}
for(int r=0; r<rows; r++) {
for(int c=0; c<cols; c++) {
if(board[r][c] > 0) {
board[r][c] = 1;
} else {
board[r][c] = 0;
}
}
}
}
}; | [
"wanghongzecn@qq.com"
] | wanghongzecn@qq.com |
7d83cbcd8fcb1517cea02f63e491c07c497bb8bc | 4352b5c9e6719d762e6a80e7a7799630d819bca3 | /tutorials/eulerVortex.twitch/eulerVortex.cyclic.twitch/2.8/U | 471cacec87755448192aa01e781a0f3088f9fedd | [] | no_license | dashqua/epicProject | d6214b57c545110d08ad053e68bc095f1d4dc725 | 54afca50a61c20c541ef43e3d96408ef72f0bcbc | refs/heads/master | 2022-02-28T17:20:20.291864 | 2019-10-28T13:33:16 | 2019-10-28T13:33:16 | 184,294,390 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 201,020 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "2.8";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
10000
(
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.447198 0)
(0.894402 0.447197 0)
(0.894402 0.447196 0)
(0.894403 0.447195 0)
(0.894403 0.447193 0)
(0.894403 0.447191 0)
(0.894403 0.447189 0)
(0.894402 0.447188 0)
(0.894401 0.447187 0)
(0.8944 0.447186 0)
(0.894399 0.447187 0)
(0.894397 0.447188 0)
(0.894396 0.447191 0)
(0.894395 0.447194 0)
(0.894394 0.447198 0)
(0.894394 0.447202 0)
(0.894395 0.447206 0)
(0.894396 0.447209 0)
(0.894397 0.447212 0)
(0.894398 0.447213 0)
(0.894399 0.447214 0)
(0.894401 0.447214 0)
(0.894402 0.447213 0)
(0.894402 0.447212 0)
(0.894403 0.44721 0)
(0.894403 0.447208 0)
(0.894402 0.447206 0)
(0.894402 0.447205 0)
(0.894402 0.447204 0)
(0.894401 0.447203 0)
(0.894401 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447199 0)
(0.894401 0.447198 0)
(0.894402 0.447198 0)
(0.894403 0.447196 0)
(0.894403 0.447194 0)
(0.894404 0.447192 0)
(0.894404 0.447189 0)
(0.894405 0.447186 0)
(0.894404 0.447184 0)
(0.894403 0.447181 0)
(0.894402 0.447179 0)
(0.8944 0.447179 0)
(0.894397 0.44718 0)
(0.894395 0.447182 0)
(0.894393 0.447186 0)
(0.894391 0.447191 0)
(0.89439 0.447197 0)
(0.89439 0.447203 0)
(0.894391 0.447209 0)
(0.894393 0.447214 0)
(0.894395 0.447218 0)
(0.894397 0.447221 0)
(0.894399 0.447222 0)
(0.894401 0.447222 0)
(0.894403 0.44722 0)
(0.894404 0.447218 0)
(0.894404 0.447216 0)
(0.894404 0.447213 0)
(0.894404 0.44721 0)
(0.894403 0.447208 0)
(0.894403 0.447206 0)
(0.894402 0.447204 0)
(0.894402 0.447203 0)
(0.894401 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.447199 0)
(0.894402 0.447198 0)
(0.894403 0.447196 0)
(0.894404 0.447194 0)
(0.894405 0.447191 0)
(0.894406 0.447188 0)
(0.894407 0.447184 0)
(0.894407 0.447179 0)
(0.894406 0.447175 0)
(0.894405 0.447172 0)
(0.894402 0.44717 0)
(0.8944 0.447169 0)
(0.894396 0.447171 0)
(0.894392 0.447174 0)
(0.894389 0.44718 0)
(0.894386 0.447188 0)
(0.894385 0.447197 0)
(0.894385 0.447206 0)
(0.894386 0.447215 0)
(0.894388 0.447222 0)
(0.894392 0.447228 0)
(0.894395 0.447232 0)
(0.894399 0.447233 0)
(0.894402 0.447233 0)
(0.894404 0.447231 0)
(0.894406 0.447228 0)
(0.894407 0.447224 0)
(0.894407 0.447219 0)
(0.894406 0.447215 0)
(0.894405 0.447211 0)
(0.894405 0.447208 0)
(0.894404 0.447206 0)
(0.894403 0.447204 0)
(0.894402 0.447202 0)
(0.894401 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.447199 0)
(0.894402 0.447199 0)
(0.894403 0.447197 0)
(0.894405 0.447195 0)
(0.894406 0.447191 0)
(0.894408 0.447187 0)
(0.89441 0.447182 0)
(0.894411 0.447176 0)
(0.894411 0.44717 0)
(0.89441 0.447164 0)
(0.894407 0.447159 0)
(0.894403 0.447156 0)
(0.894399 0.447156 0)
(0.894393 0.447159 0)
(0.894387 0.447165 0)
(0.894382 0.447174 0)
(0.894378 0.447185 0)
(0.894376 0.447198 0)
(0.894376 0.447211 0)
(0.894378 0.447224 0)
(0.894382 0.447235 0)
(0.894387 0.447243 0)
(0.894393 0.447248 0)
(0.894398 0.44725 0)
(0.894403 0.447249 0)
(0.894406 0.447246 0)
(0.894409 0.447241 0)
(0.89441 0.447235 0)
(0.89441 0.447229 0)
(0.89441 0.447223 0)
(0.894409 0.447217 0)
(0.894407 0.447212 0)
(0.894406 0.447209 0)
(0.894404 0.447206 0)
(0.894403 0.447204 0)
(0.894402 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.447199 0)
(0.894403 0.447198 0)
(0.894405 0.447196 0)
(0.894407 0.447193 0)
(0.89441 0.447188 0)
(0.894412 0.447182 0)
(0.894414 0.447174 0)
(0.894416 0.447166 0)
(0.894416 0.447157 0)
(0.894414 0.447149 0)
(0.89441 0.447143 0)
(0.894404 0.447139 0)
(0.894397 0.447139 0)
(0.894388 0.447144 0)
(0.894379 0.447154 0)
(0.894372 0.447167 0)
(0.894366 0.447184 0)
(0.894363 0.447203 0)
(0.894363 0.447222 0)
(0.894367 0.44724 0)
(0.894372 0.447255 0)
(0.89438 0.447266 0)
(0.894389 0.447273 0)
(0.894397 0.447276 0)
(0.894404 0.447274 0)
(0.89441 0.447268 0)
(0.894414 0.447261 0)
(0.894416 0.447252 0)
(0.894416 0.447242 0)
(0.894415 0.447233 0)
(0.894413 0.447225 0)
(0.894411 0.447218 0)
(0.894409 0.447212 0)
(0.894406 0.447208 0)
(0.894405 0.447205 0)
(0.894403 0.447203 0)
(0.894402 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894401 0.4472 0)
(0.894403 0.447199 0)
(0.894405 0.447197 0)
(0.894407 0.447194 0)
(0.894411 0.44719 0)
(0.894414 0.447183 0)
(0.894418 0.447175 0)
(0.894421 0.447164 0)
(0.894423 0.447153 0)
(0.894423 0.447141 0)
(0.89442 0.447131 0)
(0.894414 0.447123 0)
(0.894404 0.447119 0)
(0.894393 0.44712 0)
(0.89438 0.447128 0)
(0.894367 0.447143 0)
(0.894356 0.447163 0)
(0.894348 0.447187 0)
(0.894344 0.447214 0)
(0.894344 0.447241 0)
(0.894349 0.447266 0)
(0.894358 0.447287 0)
(0.89437 0.447302 0)
(0.894383 0.44731 0)
(0.894395 0.447312 0)
(0.894406 0.447309 0)
(0.894415 0.4473 0)
(0.89442 0.447288 0)
(0.894423 0.447275 0)
(0.894424 0.447261 0)
(0.894422 0.447247 0)
(0.89442 0.447235 0)
(0.894416 0.447225 0)
(0.894413 0.447217 0)
(0.89441 0.447211 0)
(0.894407 0.447207 0)
(0.894405 0.447204 0)
(0.894403 0.447202 0)
(0.894402 0.447201 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.894401 0.447201 0)
(0.894402 0.4472 0)
(0.894404 0.447199 0)
(0.894407 0.447197 0)
(0.89441 0.447193 0)
(0.894416 0.447187 0)
(0.894421 0.447178 0)
(0.894426 0.447166 0)
(0.89443 0.447152 0)
(0.894433 0.447137 0)
(0.894432 0.447122 0)
(0.894426 0.447108 0)
(0.894417 0.447099 0)
(0.894403 0.447096 0)
(0.894385 0.447101 0)
(0.894366 0.447115 0)
(0.894348 0.447137 0)
(0.894332 0.447167 0)
(0.89432 0.447202 0)
(0.894315 0.44724 0)
(0.894317 0.447278 0)
(0.894325 0.447311 0)
(0.894338 0.447338 0)
(0.894356 0.447357 0)
(0.894375 0.447367 0)
(0.894393 0.447367 0)
(0.894409 0.447359 0)
(0.894422 0.447345 0)
(0.89443 0.447327 0)
(0.894435 0.447307 0)
(0.894435 0.447286 0)
(0.894433 0.447267 0)
(0.894429 0.44725 0)
(0.894424 0.447235 0)
(0.894419 0.447224 0)
(0.894414 0.447215 0)
(0.89441 0.447209 0)
(0.894407 0.447205 0)
(0.894404 0.447203 0)
(0.894403 0.447201 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447202 0)
(0.894401 0.447202 0)
(0.894403 0.447201 0)
(0.894406 0.4472 0)
(0.89441 0.447197 0)
(0.894415 0.447191 0)
(0.894422 0.447183 0)
(0.89443 0.447171 0)
(0.894437 0.447156 0)
(0.894442 0.447138 0)
(0.894444 0.447119 0)
(0.894442 0.4471 0)
(0.894433 0.447085 0)
(0.894418 0.447076 0)
(0.894397 0.447076 0)
(0.894371 0.447087 0)
(0.894343 0.447111 0)
(0.894316 0.447146 0)
(0.894294 0.44719 0)
(0.894278 0.447241 0)
(0.894272 0.447294 0)
(0.894276 0.447344 0)
(0.894289 0.447388 0)
(0.89431 0.447422 0)
(0.894336 0.447444 0)
(0.894364 0.447452 0)
(0.894391 0.447448 0)
(0.894415 0.447433 0)
(0.894433 0.44741 0)
(0.894445 0.447382 0)
(0.894451 0.447351 0)
(0.894451 0.447321 0)
(0.894448 0.447293 0)
(0.894442 0.447268 0)
(0.894435 0.447248 0)
(0.894427 0.447232 0)
(0.89442 0.44722 0)
(0.894414 0.447212 0)
(0.89441 0.447206 0)
(0.894406 0.447203 0)
(0.894404 0.447201 0)
(0.894402 0.4472 0)
(0.894401 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894399 0.447201 0)
(0.894399 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447203 0)
(0.894401 0.447203 0)
(0.894403 0.447202 0)
(0.894407 0.447201 0)
(0.894413 0.447197 0)
(0.894421 0.44719 0)
(0.89443 0.44718 0)
(0.89444 0.447165 0)
(0.89445 0.447145 0)
(0.894456 0.447123 0)
(0.894458 0.4471 0)
(0.894452 0.447079 0)
(0.894437 0.447064 0)
(0.894414 0.447059 0)
(0.894382 0.447067 0)
(0.894343 0.44709 0)
(0.894303 0.44713 0)
(0.894265 0.447185 0)
(0.894234 0.447251 0)
(0.894214 0.447323 0)
(0.894208 0.447396 0)
(0.894216 0.447464 0)
(0.894238 0.44752 0)
(0.89427 0.44756 0)
(0.894309 0.447581 0)
(0.89435 0.447584 0)
(0.894389 0.44757 0)
(0.894423 0.447542 0)
(0.894448 0.447504 0)
(0.894465 0.44746 0)
(0.894473 0.447414 0)
(0.894474 0.447369 0)
(0.894469 0.447328 0)
(0.894461 0.447293 0)
(0.89445 0.447265 0)
(0.894439 0.447242 0)
(0.894429 0.447226 0)
(0.89442 0.447215 0)
(0.894413 0.447207 0)
(0.894408 0.447203 0)
(0.894405 0.4472 0)
(0.894402 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447202 0)
(0.894399 0.447202 0)
(0.894399 0.447203 0)
(0.894399 0.447205 0)
(0.894401 0.447206 0)
(0.894404 0.447205 0)
(0.89441 0.447203 0)
(0.894418 0.447199 0)
(0.894428 0.447191 0)
(0.89444 0.447177 0)
(0.894454 0.447159 0)
(0.894465 0.447136 0)
(0.894472 0.44711 0)
(0.894471 0.447085 0)
(0.89446 0.447064 0)
(0.894435 0.447054 0)
(0.894398 0.447059 0)
(0.894349 0.447083 0)
(0.894293 0.447128 0)
(0.894235 0.447195 0)
(0.894182 0.447281 0)
(0.89414 0.447379 0)
(0.894115 0.447483 0)
(0.89411 0.447583 0)
(0.894127 0.447672 0)
(0.894162 0.44774 0)
(0.894212 0.447784 0)
(0.894271 0.447801 0)
(0.894331 0.447791 0)
(0.894388 0.447757 0)
(0.894436 0.447706 0)
(0.894472 0.447642 0)
(0.894495 0.447572 0)
(0.894506 0.447502 0)
(0.894506 0.447436 0)
(0.894499 0.447377 0)
(0.894486 0.447327 0)
(0.89447 0.447286 0)
(0.894455 0.447256 0)
(0.89444 0.447233 0)
(0.894428 0.447218 0)
(0.894418 0.447208 0)
(0.894411 0.447202 0)
(0.894406 0.447199 0)
(0.894403 0.447198 0)
(0.894401 0.447197 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447202 0)
(0.894398 0.447203 0)
(0.894398 0.447204 0)
(0.894398 0.447206 0)
(0.894399 0.447207 0)
(0.8944 0.447209 0)
(0.894405 0.447209 0)
(0.894412 0.447208 0)
(0.894423 0.447203 0)
(0.894437 0.447193 0)
(0.894453 0.447177 0)
(0.894469 0.447156 0)
(0.894482 0.44713 0)
(0.894488 0.447103 0)
(0.894481 0.447079 0)
(0.894458 0.447066 0)
(0.894418 0.447068 0)
(0.894358 0.447095 0)
(0.894284 0.447149 0)
(0.894202 0.447232 0)
(0.894119 0.447343 0)
(0.894046 0.447477 0)
(0.89399 0.447624 0)
(0.893961 0.447772 0)
(0.893961 0.44791 0)
(0.893992 0.448024 0)
(0.89405 0.448106 0)
(0.894128 0.448149 0)
(0.894216 0.44815 0)
(0.894306 0.448114 0)
(0.894388 0.448045 0)
(0.894456 0.447953 0)
(0.894506 0.447847 0)
(0.894538 0.447737 0)
(0.894552 0.447629 0)
(0.894551 0.44753 0)
(0.894539 0.447444 0)
(0.89452 0.447372 0)
(0.894498 0.447315 0)
(0.894476 0.447272 0)
(0.894455 0.447241 0)
(0.894438 0.447221 0)
(0.894425 0.447208 0)
(0.894415 0.4472 0)
(0.894408 0.447196 0)
(0.894404 0.447195 0)
(0.894401 0.447195 0)
(0.8944 0.447196 0)
(0.894399 0.447197 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894399 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894398 0.447202 0)
(0.894397 0.447204 0)
(0.894397 0.447206 0)
(0.894396 0.447209 0)
(0.894397 0.447211 0)
(0.894399 0.447214 0)
(0.894405 0.447215 0)
(0.894414 0.447214 0)
(0.894428 0.447209 0)
(0.894445 0.447199 0)
(0.894466 0.447182 0)
(0.894484 0.447159 0)
(0.894497 0.447134 0)
(0.894497 0.44711 0)
(0.894479 0.447096 0)
(0.894437 0.447099 0)
(0.894369 0.44713 0)
(0.894276 0.447196 0)
(0.894164 0.447302 0)
(0.894042 0.447448 0)
(0.893924 0.447629 0)
(0.893822 0.447836 0)
(0.89375 0.448055 0)
(0.893717 0.448267 0)
(0.893729 0.448456 0)
(0.893786 0.448604 0)
(0.89388 0.448698 0)
(0.894001 0.448731 0)
(0.894135 0.448703 0)
(0.894268 0.448619 0)
(0.894388 0.44849 0)
(0.894486 0.448332 0)
(0.894557 0.448157 0)
(0.8946 0.447981 0)
(0.894617 0.447815 0)
(0.894614 0.447665 0)
(0.894595 0.447538 0)
(0.894567 0.447434 0)
(0.894535 0.447354 0)
(0.894504 0.447294 0)
(0.894475 0.447252 0)
(0.894451 0.447224 0)
(0.894432 0.447206 0)
(0.894419 0.447197 0)
(0.89441 0.447193 0)
(0.894404 0.447192 0)
(0.8944 0.447192 0)
(0.894399 0.447194 0)
(0.894398 0.447195 0)
(0.894398 0.447196 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894399 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894398 0.447202 0)
(0.894397 0.447204 0)
(0.894395 0.447206 0)
(0.894395 0.447209 0)
(0.894394 0.447213 0)
(0.894395 0.447217 0)
(0.894397 0.447221 0)
(0.894405 0.447225 0)
(0.894416 0.447225 0)
(0.894433 0.44722 0)
(0.894454 0.44721 0)
(0.894478 0.447194 0)
(0.894497 0.447174 0)
(0.894505 0.447154 0)
(0.894492 0.447143 0)
(0.894452 0.44715 0)
(0.894376 0.447189 0)
(0.894264 0.447272 0)
(0.894118 0.447406 0)
(0.893948 0.447596 0)
(0.893769 0.447841 0)
(0.893599 0.44813 0)
(0.893459 0.448447 0)
(0.893366 0.448771 0)
(0.893332 0.449075 0)
(0.893365 0.449334 0)
(0.893464 0.449526 0)
(0.893617 0.449632 0)
(0.893806 0.449644 0)
(0.894011 0.449563 0)
(0.894211 0.4494 0)
(0.894388 0.449174 0)
(0.894529 0.448909 0)
(0.894629 0.448626 0)
(0.894687 0.448348 0)
(0.894709 0.448091 0)
(0.894701 0.447865 0)
(0.894672 0.447675 0)
(0.894631 0.447524 0)
(0.894586 0.447408 0)
(0.894541 0.447324 0)
(0.894501 0.447265 0)
(0.894468 0.447227 0)
(0.894442 0.447204 0)
(0.894424 0.447192 0)
(0.894411 0.447187 0)
(0.894404 0.447186 0)
(0.894399 0.447188 0)
(0.894397 0.44719 0)
(0.894397 0.447192 0)
(0.894397 0.447195 0)
(0.894398 0.447196 0)
(0.894398 0.447198 0)
(0.894399 0.447198 0)
(0.894399 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894398 0.447202 0)
(0.894397 0.447203 0)
(0.894395 0.447205 0)
(0.894393 0.447208 0)
(0.894391 0.447213 0)
(0.89439 0.447219 0)
(0.894391 0.447225 0)
(0.894394 0.447232 0)
(0.894402 0.447237 0)
(0.894416 0.44724 0)
(0.894437 0.447238 0)
(0.894461 0.447231 0)
(0.894485 0.44722 0)
(0.8945 0.447207 0)
(0.894495 0.447203 0)
(0.894458 0.447218 0)
(0.894377 0.447268 0)
(0.894245 0.447371 0)
(0.894062 0.44754 0)
(0.893835 0.447784 0)
(0.893577 0.448107 0)
(0.893313 0.448501 0)
(0.893069 0.448948 0)
(0.892874 0.449425 0)
(0.892752 0.449899 0)
(0.892721 0.450332 0)
(0.892791 0.450691 0)
(0.892956 0.450941 0)
(0.8932 0.45106 0)
(0.893496 0.451036 0)
(0.893812 0.450873 0)
(0.894115 0.450589 0)
(0.894379 0.450214 0)
(0.894586 0.449784 0)
(0.89473 0.449336 0)
(0.894811 0.448902 0)
(0.894838 0.448505 0)
(0.894824 0.448162 0)
(0.89478 0.447879 0)
(0.89472 0.447656 0)
(0.894654 0.447487 0)
(0.894591 0.447367 0)
(0.894535 0.447284 0)
(0.894489 0.447232 0)
(0.894454 0.447201 0)
(0.894429 0.447185 0)
(0.894413 0.447179 0)
(0.894403 0.447179 0)
(0.894397 0.447182 0)
(0.894395 0.447185 0)
(0.894395 0.447189 0)
(0.894395 0.447192 0)
(0.894396 0.447195 0)
(0.894397 0.447196 0)
(0.894398 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894398 0.447201 0)
(0.894397 0.447202 0)
(0.894395 0.447204 0)
(0.894393 0.447207 0)
(0.89439 0.447212 0)
(0.894387 0.447218 0)
(0.894385 0.447226 0)
(0.894384 0.447236 0)
(0.894388 0.447246 0)
(0.894397 0.447255 0)
(0.894413 0.447263 0)
(0.894436 0.447266 0)
(0.894462 0.447265 0)
(0.894481 0.447264 0)
(0.894483 0.44727 0)
(0.894452 0.447295 0)
(0.894369 0.44736 0)
(0.89422 0.447485 0)
(0.893999 0.447691 0)
(0.893705 0.447997 0)
(0.893352 0.44841 0)
(0.892964 0.448927 0)
(0.892574 0.449536 0)
(0.89222 0.450208 0)
(0.891945 0.450908 0)
(0.891781 0.451589 0)
(0.891757 0.452202 0)
(0.891881 0.452698 0)
(0.892149 0.453031 0)
(0.892532 0.453169 0)
(0.892992 0.453096 0)
(0.893478 0.452816 0)
(0.893941 0.452358 0)
(0.894342 0.451765 0)
(0.894653 0.451094 0)
(0.894865 0.4504 0)
(0.894983 0.449732 0)
(0.895019 0.449127 0)
(0.894994 0.448608 0)
(0.894929 0.448184 0)
(0.894842 0.447853 0)
(0.894748 0.447607 0)
(0.894658 0.447432 0)
(0.89458 0.447315 0)
(0.894517 0.447241 0)
(0.894469 0.447198 0)
(0.894436 0.447177 0)
(0.894414 0.447169 0)
(0.894401 0.447169 0)
(0.894394 0.447173 0)
(0.894392 0.447179 0)
(0.894392 0.447184 0)
(0.894393 0.447189 0)
(0.894394 0.447192 0)
(0.894396 0.447195 0)
(0.894397 0.447197 0)
(0.894398 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894397 0.447202 0)
(0.894396 0.447203 0)
(0.894393 0.447206 0)
(0.89439 0.44721 0)
(0.894385 0.447216 0)
(0.894381 0.447225 0)
(0.894377 0.447236 0)
(0.894375 0.447249 0)
(0.894379 0.447265 0)
(0.894388 0.44728 0)
(0.894406 0.447294 0)
(0.894428 0.447306 0)
(0.89445 0.447317 0)
(0.894457 0.447336 0)
(0.894431 0.447376 0)
(0.89435 0.447455 0)
(0.894189 0.447602 0)
(0.89393 0.447845 0)
(0.893567 0.448212 0)
(0.893104 0.44872 0)
(0.892563 0.449374 0)
(0.89198 0.450164 0)
(0.891404 0.451066 0)
(0.890889 0.45204 0)
(0.890493 0.453036 0)
(0.890267 0.453994 0)
(0.890246 0.454848 0)
(0.890447 0.455532 0)
(0.890862 0.455985 0)
(0.891452 0.45616 0)
(0.892158 0.456032 0)
(0.892905 0.455605 0)
(0.893618 0.454914 0)
(0.894233 0.454023 0)
(0.89471 0.453012 0)
(0.895034 0.451966 0)
(0.895212 0.45096 0)
(0.895267 0.450051 0)
(0.895231 0.449274 0)
(0.895136 0.448641 0)
(0.89501 0.448151 0)
(0.894877 0.447788 0)
(0.89475 0.447534 0)
(0.894642 0.447364 0)
(0.894554 0.447258 0)
(0.894489 0.447197 0)
(0.894443 0.447167 0)
(0.894414 0.447156 0)
(0.894397 0.447157 0)
(0.894389 0.447162 0)
(0.894387 0.44717 0)
(0.894387 0.447178 0)
(0.894389 0.447184 0)
(0.894392 0.447189 0)
(0.894394 0.447193 0)
(0.894396 0.447195 0)
(0.894397 0.447197 0)
(0.894398 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894398 0.447201 0)
(0.894396 0.447203 0)
(0.894394 0.447205 0)
(0.894391 0.447208 0)
(0.894385 0.447214 0)
(0.894379 0.447222 0)
(0.894372 0.447234 0)
(0.894366 0.447249 0)
(0.894362 0.447268 0)
(0.894364 0.447289 0)
(0.894373 0.447312 0)
(0.89439 0.447336 0)
(0.894408 0.447362 0)
(0.894417 0.447395 0)
(0.894397 0.447448 0)
(0.894319 0.447542 0)
(0.894152 0.447709 0)
(0.893864 0.447984 0)
(0.893433 0.448406 0)
(0.892853 0.449004 0)
(0.892137 0.449794 0)
(0.89132 0.450773 0)
(0.890455 0.45192 0)
(0.889606 0.453196 0)
(0.888852 0.454551 0)
(0.888273 0.455918 0)
(0.88794 0.457225 0)
(0.887909 0.458388 0)
(0.888206 0.459324 0)
(0.888822 0.459952 0)
(0.889708 0.460204 0)
(0.890776 0.460039 0)
(0.891916 0.459451 0)
(0.893013 0.45848 0)
(0.893965 0.457207 0)
(0.894709 0.455747 0)
(0.895218 0.454221 0)
(0.895503 0.452745 0)
(0.895598 0.451404 0)
(0.895555 0.450256 0)
(0.895422 0.449322 0)
(0.895244 0.448599 0)
(0.895054 0.448067 0)
(0.894877 0.447693 0)
(0.894726 0.447445 0)
(0.894605 0.447291 0)
(0.894515 0.447203 0)
(0.894454 0.447159 0)
(0.894415 0.447142 0)
(0.894393 0.447142 0)
(0.894382 0.447149 0)
(0.89438 0.447159 0)
(0.894381 0.44717 0)
(0.894384 0.447178 0)
(0.894388 0.447185 0)
(0.894391 0.44719 0)
(0.894394 0.447194 0)
(0.894396 0.447196 0)
(0.894397 0.447198 0)
(0.894398 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894397 0.447202 0)
(0.894395 0.447203 0)
(0.894392 0.447206 0)
(0.894387 0.447211 0)
(0.894379 0.447219 0)
(0.89437 0.447229 0)
(0.89436 0.447245 0)
(0.894351 0.447265 0)
(0.894345 0.447291 0)
(0.894343 0.447321 0)
(0.89435 0.447354 0)
(0.894361 0.447392 0)
(0.894367 0.447439 0)
(0.894349 0.447507 0)
(0.894278 0.447614 0)
(0.894111 0.447795 0)
(0.893805 0.448092 0)
(0.893319 0.448555 0)
(0.892628 0.449228 0)
(0.891729 0.45014 0)
(0.890647 0.451298 0)
(0.889434 0.452684 0)
(0.888161 0.454261 0)
(0.886918 0.455976 0)
(0.88581 0.457767 0)
(0.884947 0.459562 0)
(0.884434 0.461277 0)
(0.884352 0.462818 0)
(0.884749 0.464083 0)
(0.885621 0.464967 0)
(0.886909 0.465375 0)
(0.888494 0.465232 0)
(0.890214 0.464512 0)
(0.891894 0.463246 0)
(0.893375 0.461531 0)
(0.894548 0.459515 0)
(0.895366 0.457372 0)
(0.89584 0.455269 0)
(0.896021 0.453342 0)
(0.895985 0.451678 0)
(0.89581 0.450319 0)
(0.895564 0.449265 0)
(0.8953 0.448486 0)
(0.895053 0.44794 0)
(0.894842 0.447577 0)
(0.894675 0.447351 0)
(0.894552 0.44722 0)
(0.894468 0.447154 0)
(0.894415 0.447128 0)
(0.894386 0.447125 0)
(0.894373 0.447134 0)
(0.89437 0.447147 0)
(0.894372 0.44716 0)
(0.894377 0.447171 0)
(0.894382 0.44718 0)
(0.894387 0.447187 0)
(0.894391 0.447192 0)
(0.894394 0.447195 0)
(0.894396 0.447197 0)
(0.894398 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894398 0.447201 0)
(0.894396 0.447202 0)
(0.894393 0.447204 0)
(0.894388 0.447208 0)
(0.894382 0.447215 0)
(0.894372 0.447224 0)
(0.894359 0.447238 0)
(0.894345 0.447258 0)
(0.894331 0.447285 0)
(0.89432 0.447318 0)
(0.894314 0.447359 0)
(0.894313 0.447407 0)
(0.894312 0.447465 0)
(0.894293 0.447544 0)
(0.894227 0.447662 0)
(0.894068 0.447851 0)
(0.893758 0.448159 0)
(0.893237 0.448644 0)
(0.892454 0.449366 0)
(0.891384 0.450371 0)
(0.890031 0.451679 0)
(0.888436 0.453276 0)
(0.886669 0.455121 0)
(0.884824 0.457159 0)
(0.883017 0.459324 0)
(0.881386 0.461554 0)
(0.880083 0.463782 0)
(0.879257 0.465932 0)
(0.879035 0.467907 0)
(0.879501 0.469589 0)
(0.880672 0.470847 0)
(0.882481 0.471541 0)
(0.884776 0.471553 0)
(0.887329 0.470807 0)
(0.889878 0.469306 0)
(0.892173 0.467146 0)
(0.894033 0.464507 0)
(0.895365 0.461623 0)
(0.896171 0.458732 0)
(0.896524 0.456038 0)
(0.896536 0.453686 0)
(0.896325 0.451747 0)
(0.895999 0.450232 0)
(0.895638 0.449108 0)
(0.895296 0.448315 0)
(0.895004 0.447786 0)
(0.894773 0.447454 0)
(0.894604 0.447261 0)
(0.89449 0.447161 0)
(0.894418 0.447118 0)
(0.894379 0.447109 0)
(0.894361 0.447117 0)
(0.894358 0.447132 0)
(0.894361 0.447148 0)
(0.894368 0.447163 0)
(0.894376 0.447174 0)
(0.894382 0.447183 0)
(0.894388 0.447189 0)
(0.894392 0.447193 0)
(0.894395 0.447196 0)
(0.894397 0.447198 0)
(0.894398 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.447201 0)
(0.894397 0.447201 0)
(0.894395 0.447203 0)
(0.89439 0.447206 0)
(0.894384 0.44721 0)
(0.894375 0.447219 0)
(0.894362 0.44723 0)
(0.894345 0.447248 0)
(0.894325 0.447274 0)
(0.894306 0.447308 0)
(0.894288 0.447351 0)
(0.894273 0.447405 0)
(0.89426 0.447472 0)
(0.894235 0.447559 0)
(0.894172 0.447683 0)
(0.894024 0.447874 0)
(0.893725 0.44818 0)
(0.893195 0.448665 0)
(0.892356 0.449402 0)
(0.891146 0.450461 0)
(0.889543 0.451873 0)
(0.887567 0.453635 0)
(0.885276 0.455696 0)
(0.882757 0.45798 0)
(0.880124 0.460414 0)
(0.877522 0.462938 0)
(0.875125 0.465511 0)
(0.873141 0.468098 0)
(0.871784 0.470652 0)
(0.871252 0.473092 0)
(0.871693 0.475295 0)
(0.873165 0.47709 0)
(0.875611 0.478284 0)
(0.878844 0.47868 0)
(0.882556 0.478128 0)
(0.886365 0.476568 0)
(0.889888 0.474067 0)
(0.89282 0.470822 0)
(0.894991 0.467126 0)
(0.896374 0.463308 0)
(0.897057 0.45967 0)
(0.897201 0.456436 0)
(0.896986 0.453734 0)
(0.896575 0.451601 0)
(0.896094 0.450004 0)
(0.89563 0.44887 0)
(0.895229 0.448107 0)
(0.894912 0.447623 0)
(0.89468 0.447338 0)
(0.894523 0.447185 0)
(0.894425 0.447116 0)
(0.894371 0.447095 0)
(0.894348 0.447101 0)
(0.894342 0.447117 0)
(0.894347 0.447136 0)
(0.894357 0.447153 0)
(0.894367 0.447168 0)
(0.894376 0.447179 0)
(0.894384 0.447186 0)
(0.894389 0.447191 0)
(0.894393 0.447195 0)
(0.894396 0.447197 0)
(0.894397 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.447201 0)
(0.894396 0.447202 0)
(0.894393 0.447204 0)
(0.894388 0.447207 0)
(0.894379 0.447213 0)
(0.894366 0.447223 0)
(0.894349 0.447238 0)
(0.894327 0.44726 0)
(0.8943 0.447292 0)
(0.894273 0.447334 0)
(0.894246 0.447388 0)
(0.894218 0.447459 0)
(0.894182 0.44755 0)
(0.894119 0.447676 0)
(0.893983 0.447862 0)
(0.893706 0.448155 0)
(0.893195 0.448619 0)
(0.892342 0.44934 0)
(0.891048 0.4504 0)
(0.889248 0.451861 0)
(0.88693 0.453726 0)
(0.884132 0.455936 0)
(0.880927 0.458382 0)
(0.877415 0.460953 0)
(0.873721 0.463569 0)
(0.870009 0.466205 0)
(0.866502 0.468881 0)
(0.863476 0.471639 0)
(0.861245 0.474501 0)
(0.860116 0.477423 0)
(0.860338 0.480276 0)
(0.862045 0.482844 0)
(0.865215 0.484849 0)
(0.869635 0.485988 0)
(0.874903 0.485993 0)
(0.880481 0.4847 0)
(0.885797 0.48211 0)
(0.890362 0.478406 0)
(0.893865 0.473931 0)
(0.896211 0.469115 0)
(0.897494 0.464384 0)
(0.897932 0.460079 0)
(0.897789 0.456415 0)
(0.897312 0.453481 0)
(0.896697 0.451259 0)
(0.896081 0.449665 0)
(0.895539 0.448581 0)
(0.895108 0.447885 0)
(0.89479 0.447468 0)
(0.894574 0.447238 0)
(0.89444 0.447128 0)
(0.894366 0.447088 0)
(0.894333 0.447086 0)
(0.894325 0.447102 0)
(0.894331 0.447123 0)
(0.894343 0.447143 0)
(0.894356 0.44716 0)
(0.894368 0.447174 0)
(0.894378 0.447183 0)
(0.894385 0.447189 0)
(0.894391 0.447194 0)
(0.894394 0.447196 0)
(0.894397 0.447198 0)
(0.894398 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.4472 0)
(0.894397 0.447201 0)
(0.894395 0.447203 0)
(0.894391 0.447205 0)
(0.894384 0.447209 0)
(0.894373 0.447216 0)
(0.894356 0.447228 0)
(0.894333 0.447246 0)
(0.894305 0.447273 0)
(0.89427 0.447311 0)
(0.894232 0.447362 0)
(0.894191 0.44743 0)
(0.894143 0.44752 0)
(0.894074 0.447643 0)
(0.893947 0.447819 0)
(0.893698 0.448089 0)
(0.893229 0.448516 0)
(0.892409 0.449188 0)
(0.8911 0.450203 0)
(0.889186 0.451646 0)
(0.886606 0.453544 0)
(0.883367 0.455832 0)
(0.87953 0.458362 0)
(0.875172 0.46095 0)
(0.870381 0.463456 0)
(0.865276 0.465831 0)
(0.860037 0.468135 0)
(0.854938 0.470515 0)
(0.850354 0.473152 0)
(0.846742 0.47618 0)
(0.844571 0.479613 0)
(0.844246 0.483314 0)
(0.846027 0.486992 0)
(0.849956 0.490247 0)
(0.855811 0.492624 0)
(0.863087 0.493697 0)
(0.871058 0.493154 0)
(0.878898 0.490886 0)
(0.885853 0.487026 0)
(0.891391 0.481943 0)
(0.895285 0.476165 0)
(0.897601 0.470261 0)
(0.898614 0.464728 0)
(0.898696 0.45991 0)
(0.898214 0.45598 0)
(0.89747 0.45296 0)
(0.896676 0.450765 0)
(0.89596 0.449255 0)
(0.89538 0.448273 0)
(0.894949 0.447673 0)
(0.894654 0.447335 0)
(0.894469 0.447164 0)
(0.894366 0.447093 0)
(0.894318 0.447077 0)
(0.894305 0.447089 0)
(0.894311 0.44711 0)
(0.894326 0.447133 0)
(0.894343 0.447153 0)
(0.894359 0.447168 0)
(0.894371 0.447179 0)
(0.894381 0.447187 0)
(0.894388 0.447192 0)
(0.894392 0.447195 0)
(0.894396 0.447197 0)
(0.894397 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.447201 0)
(0.894397 0.447201 0)
(0.894394 0.447203 0)
(0.894388 0.447206 0)
(0.894379 0.44721 0)
(0.894365 0.447219 0)
(0.894344 0.447233 0)
(0.894315 0.447255 0)
(0.894278 0.447287 0)
(0.894233 0.447332 0)
(0.894181 0.447393 0)
(0.894122 0.447476 0)
(0.894044 0.44759 0)
(0.893923 0.447751 0)
(0.893702 0.447993 0)
(0.893287 0.44837 0)
(0.892539 0.448969 0)
(0.891288 0.449896 0)
(0.889363 0.451257 0)
(0.88664 0.45311 0)
(0.883076 0.455405 0)
(0.878713 0.457958 0)
(0.873618 0.460492 0)
(0.867848 0.462747 0)
(0.861442 0.464587 0)
(0.854486 0.466058 0)
(0.847167 0.467392 0)
(0.839824 0.468948 0)
(0.832974 0.471115 0)
(0.827274 0.474186 0)
(0.823432 0.478246 0)
(0.822083 0.483122 0)
(0.823665 0.488403 0)
(0.828326 0.493502 0)
(0.835847 0.497755 0)
(0.845619 0.500527 0)
(0.856694 0.501329 0)
(0.867936 0.499909 0)
(0.878237 0.496323 0)
(0.886744 0.490934 0)
(0.893004 0.484351 0)
(0.896994 0.477292 0)
(0.899029 0.470436 0)
(0.899606 0.464301 0)
(0.899252 0.459187 0)
(0.89842 0.455187 0)
(0.897439 0.452237 0)
(0.896515 0.450178 0)
(0.895749 0.448821 0)
(0.895171 0.447977 0)
(0.894772 0.447489 0)
(0.894518 0.447232 0)
(0.894375 0.447115 0)
(0.894306 0.447078 0)
(0.894285 0.44708 0)
(0.89429 0.4471 0)
(0.894307 0.447123 0)
(0.894328 0.447145 0)
(0.894348 0.447163 0)
(0.894364 0.447176 0)
(0.894376 0.447185 0)
(0.894384 0.447191 0)
(0.89439 0.447195 0)
(0.894394 0.447197 0)
(0.894397 0.447198 0)
(0.894398 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.447201 0)
(0.894395 0.447201 0)
(0.894392 0.447203 0)
(0.894385 0.447207 0)
(0.894374 0.447212 0)
(0.894356 0.447222 0)
(0.89433 0.447239 0)
(0.894293 0.447264 0)
(0.894246 0.4473 0)
(0.894189 0.447353 0)
(0.89412 0.447425 0)
(0.894036 0.447524 0)
(0.893915 0.447666 0)
(0.893718 0.447874 0)
(0.893361 0.448197 0)
(0.89271 0.448709 0)
(0.891578 0.449516 0)
(0.889749 0.450739 0)
(0.887026 0.45247 0)
(0.883298 0.454696 0)
(0.878564 0.457225 0)
(0.872896 0.459688 0)
(0.866343 0.461662 0)
(0.858882 0.462836 0)
(0.85046 0.463152 0)
(0.841096 0.462851 0)
(0.830978 0.462442 0)
(0.820544 0.462599 0)
(0.810506 0.463993 0)
(0.801809 0.46711 0)
(0.795491 0.472094 0)
(0.792497 0.47869 0)
(0.79351 0.486281 0)
(0.798816 0.494006 0)
(0.808216 0.500906 0)
(0.820983 0.50609 0)
(0.835923 0.508865 0)
(0.85154 0.508839 0)
(0.866295 0.505984 0)
(0.878906 0.500648 0)
(0.888585 0.493497 0)
(0.895127 0.485388 0)
(0.898834 0.47719 0)
(0.900332 0.469625 0)
(0.900343 0.463163 0)
(0.899526 0.458006 0)
(0.89838 0.454137 0)
(0.897227 0.451397 0)
(0.896238 0.449563 0)
(0.895477 0.448405 0)
(0.894942 0.447719 0)
(0.894598 0.447345 0)
(0.894399 0.447163 0)
(0.894301 0.447092 0)
(0.894266 0.447079 0)
(0.894268 0.447093 0)
(0.894287 0.447116 0)
(0.894311 0.447139 0)
(0.894335 0.447158 0)
(0.894354 0.447172 0)
(0.89437 0.447182 0)
(0.89438 0.447189 0)
(0.894388 0.447194 0)
(0.894393 0.447196 0)
(0.894396 0.447198 0)
(0.894398 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894397 0.447201 0)
(0.894395 0.447202 0)
(0.89439 0.447204 0)
(0.894381 0.447208 0)
(0.894367 0.447214 0)
(0.894346 0.447225 0)
(0.894313 0.447244 0)
(0.894269 0.447271 0)
(0.89421 0.447313 0)
(0.894138 0.447371 0)
(0.894048 0.447455 0)
(0.893929 0.447573 0)
(0.89375 0.447746 0)
(0.893446 0.448012 0)
(0.892899 0.448433 0)
(0.891926 0.449104 0)
(0.890283 0.450149 0)
(0.887709 0.45169 0)
(0.884003 0.453766 0)
(0.879096 0.45622 0)
(0.873052 0.458635 0)
(0.865953 0.460408 0)
(0.857762 0.460979 0)
(0.848304 0.460066 0)
(0.837374 0.457798 0)
(0.824902 0.454737 0)
(0.81109 0.451796 0)
(0.796516 0.450059 0)
(0.782173 0.450548 0)
(0.769397 0.453952 0)
(0.759659 0.460441 0)
(0.754304 0.469593 0)
(0.754322 0.480475 0)
(0.760165 0.491825 0)
(0.771648 0.502287 0)
(0.787911 0.510638 0)
(0.807483 0.51597 0)
(0.828469 0.517777 0)
(0.848844 0.515996 0)
(0.866814 0.510988 0)
(0.88114 0.503478 0)
(0.891321 0.494442 0)
(0.897565 0.484928 0)
(0.900591 0.475867 0)
(0.901342 0.467926 0)
(0.90073 0.461453 0)
(0.899487 0.456507 0)
(0.898105 0.452949 0)
(0.896864 0.450531 0)
(0.895882 0.448978 0)
(0.895178 0.44804 0)
(0.894718 0.447513 0)
(0.894446 0.447243 0)
(0.894307 0.447125 0)
(0.894252 0.447089 0)
(0.894247 0.447092 0)
(0.894266 0.447112 0)
(0.894293 0.447134 0)
(0.894321 0.447154 0)
(0.894344 0.447169 0)
(0.894363 0.44718 0)
(0.894376 0.447188 0)
(0.894385 0.447193 0)
(0.894391 0.447196 0)
(0.894395 0.447198 0)
(0.894397 0.447199 0)
(0.894398 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894397 0.447201 0)
(0.894394 0.447202 0)
(0.894388 0.447204 0)
(0.894377 0.447208 0)
(0.89436 0.447216 0)
(0.894334 0.447228 0)
(0.894295 0.447248 0)
(0.894241 0.447279 0)
(0.894171 0.447323 0)
(0.89408 0.447388 0)
(0.893963 0.447483 0)
(0.893799 0.447621 0)
(0.89354 0.44783 0)
(0.89309 0.448162 0)
(0.89229 0.448696 0)
(0.890893 0.449545 0)
(0.888596 0.450845 0)
(0.885107 0.45269 0)
(0.880254 0.455001 0)
(0.874059 0.457384 0)
(0.866647 0.459107 0)
(0.858049 0.459324 0)
(0.848049 0.457408 0)
(0.836232 0.453225 0)
(0.822194 0.447229 0)
(0.805769 0.440438 0)
(0.7872 0.434284 0)
(0.767276 0.43036 0)
(0.747373 0.43008 0)
(0.729333 0.434338 0)
(0.715176 0.44326 0)
(0.706733 0.456148 0)
(0.705342 0.471608 0)
(0.711634 0.487822 0)
(0.72542 0.502901 0)
(0.745673 0.515207 0)
(0.770608 0.52359 0)
(0.797902 0.527482 0)
(0.825012 0.526874 0)
(0.849582 0.52223 0)
(0.86984 0.514388 0)
(0.884872 0.504446 0)
(0.894686 0.493608 0)
(0.900024 0.482994 0)
(0.902034 0.473467 0)
(0.901927 0.465537 0)
(0.900722 0.459369 0)
(0.899148 0.454858 0)
(0.89764 0.451746 0)
(0.896404 0.449716 0)
(0.895496 0.448467 0)
(0.89489 0.447747 0)
(0.894523 0.447364 0)
(0.894329 0.447182 0)
(0.894246 0.447113 0)
(0.894229 0.4471 0)
(0.894245 0.447112 0)
(0.894274 0.447132 0)
(0.894306 0.447151 0)
(0.894333 0.447167 0)
(0.894355 0.447179 0)
(0.894371 0.447187 0)
(0.894382 0.447192 0)
(0.894389 0.447195 0)
(0.894394 0.447197 0)
(0.894396 0.447199 0)
(0.894398 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894396 0.447201 0)
(0.894392 0.447202 0)
(0.894385 0.447205 0)
(0.894373 0.447209 0)
(0.894352 0.447217 0)
(0.894321 0.44723 0)
(0.894275 0.447251 0)
(0.894212 0.447283 0)
(0.894127 0.44733 0)
(0.894016 0.447401 0)
(0.893865 0.447506 0)
(0.893644 0.447665 0)
(0.893278 0.447913 0)
(0.892638 0.448319 0)
(0.891508 0.448977 0)
(0.889574 0.450017 0)
(0.886473 0.451563 0)
(0.881914 0.453639 0)
(0.875814 0.455958 0)
(0.868317 0.457776 0)
(0.859577 0.457995 0)
(0.849463 0.455569 0)
(0.837459 0.449936 0)
(0.822844 0.441251 0)
(0.804995 0.43043 0)
(0.783657 0.419071 0)
(0.759163 0.409238 0)
(0.732597 0.403103 0)
(0.705838 0.402509 0)
(0.681366 0.408531 0)
(0.661851 0.421173 0)
(0.649676 0.439317 0)
(0.646544 0.460937 0)
(0.653256 0.483485 0)
(0.669594 0.504383 0)
(0.694316 0.52147 0)
(0.725278 0.53332 0)
(0.759693 0.539348 0)
(0.794494 0.539717 0)
(0.826754 0.535138 0)
(0.854128 0.526678 0)
(0.87521 0.515613 0)
(0.889691 0.503297 0)
(0.898241 0.491005 0)
(0.902163 0.479767 0)
(0.902967 0.470248 0)
(0.902014 0.462721 0)
(0.900331 0.457132 0)
(0.898565 0.453219 0)
(0.897051 0.450629 0)
(0.895906 0.449009 0)
(0.895124 0.448055 0)
(0.894639 0.447531 0)
(0.894373 0.447268 0)
(0.894251 0.447154 0)
(0.894216 0.447118 0)
(0.894227 0.447119 0)
(0.894257 0.447133 0)
(0.894291 0.447151 0)
(0.894322 0.447166 0)
(0.894347 0.447178 0)
(0.894366 0.447186 0)
(0.894379 0.447192 0)
(0.894387 0.447195 0)
(0.894392 0.447197 0)
(0.894396 0.447199 0)
(0.894398 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894395 0.447201 0)
(0.894391 0.447202 0)
(0.894383 0.447205 0)
(0.894368 0.44721 0)
(0.894345 0.447217 0)
(0.894308 0.447231 0)
(0.894255 0.447251 0)
(0.894181 0.447285 0)
(0.894081 0.447334 0)
(0.893946 0.447408 0)
(0.893754 0.447521 0)
(0.893459 0.447702 0)
(0.892958 0.447993 0)
(0.892075 0.448476 0)
(0.89053 0.449263 0)
(0.887941 0.450485 0)
(0.883898 0.452234 0)
(0.878161 0.454387 0)
(0.870809 0.456344 0)
(0.86212 0.456907 0)
(0.852178 0.454615 0)
(0.84054 0.448344 0)
(0.82629 0.437751 0)
(0.808375 0.423416 0)
(0.785956 0.406829 0)
(0.758714 0.390271 0)
(0.727124 0.376525 0)
(0.692667 0.368419 0)
(0.657852 0.368259 0)
(0.625928 0.377272 0)
(0.600298 0.395232 0)
(0.583913 0.42044 0)
(0.578834 0.450043 0)
(0.586008 0.480577 0)
(0.605155 0.508614 0)
(0.634778 0.531353 0)
(0.672322 0.547047 0)
(0.714502 0.555126 0)
(0.757715 0.556034 0)
(0.798488 0.550893 0)
(0.833917 0.541168 0)
(0.862072 0.528433 0)
(0.882243 0.514237 0)
(0.894918 0.49999 0)
(0.901471 0.486842 0)
(0.90368 0.475574 0)
(0.903269 0.46655 0)
(0.901612 0.459762 0)
(0.899628 0.454948 0)
(0.897826 0.451719 0)
(0.896417 0.44967 0)
(0.895429 0.44844 0)
(0.894802 0.447747 0)
(0.894446 0.447385 0)
(0.894273 0.447215 0)
(0.894212 0.447148 0)
(0.894213 0.447133 0)
(0.894241 0.44714 0)
(0.894277 0.447153 0)
(0.894311 0.447167 0)
(0.894339 0.447178 0)
(0.89436 0.447186 0)
(0.894375 0.447192 0)
(0.894385 0.447195 0)
(0.894391 0.447197 0)
(0.894395 0.447198 0)
(0.894397 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894397 0.4472 0)
(0.894395 0.447201 0)
(0.894389 0.447203 0)
(0.89438 0.447205 0)
(0.894363 0.447209 0)
(0.894336 0.447217 0)
(0.894296 0.44723 0)
(0.894235 0.447251 0)
(0.894149 0.447283 0)
(0.894034 0.447333 0)
(0.89387 0.447408 0)
(0.893629 0.447528 0)
(0.893244 0.447729 0)
(0.892575 0.448062 0)
(0.891391 0.448622 0)
(0.889344 0.449532 0)
(0.885985 0.450909 0)
(0.880892 0.452762 0)
(0.873952 0.454747 0)
(0.865467 0.455822 0)
(0.855811 0.454281 0)
(0.844837 0.448382 0)
(0.831643 0.43708 0)
(0.814868 0.420397 0)
(0.793142 0.399431 0)
(0.765433 0.376331 0)
(0.73138 0.35414 0)
(0.691659 0.336447 0)
(0.648251 0.326817 0)
(0.604436 0.328064 0)
(0.564329 0.341531 0)
(0.532103 0.366629 0)
(0.51124 0.400896 0)
(0.504121 0.44046 0)
(0.511823 0.480752 0)
(0.533996 0.517322 0)
(0.568855 0.546616 0)
(0.613386 0.566518 0)
(0.66376 0.576499 0)
(0.715832 0.577372 0)
(0.76561 0.570822 0)
(0.809685 0.558893 0)
(0.845627 0.543624 0)
(0.872291 0.526856 0)
(0.889893 0.510159 0)
(0.899775 0.494768 0)
(0.903914 0.481525 0)
(0.904384 0.470841 0)
(0.902934 0.462731 0)
(0.900804 0.45692 0)
(0.898724 0.45298 0)
(0.897031 0.450447 0)
(0.895811 0.448903 0)
(0.895016 0.448015 0)
(0.894552 0.447535 0)
(0.894315 0.447297 0)
(0.89422 0.447192 0)
(0.894205 0.447156 0)
(0.894228 0.447151 0)
(0.894265 0.447159 0)
(0.894301 0.44717 0)
(0.894332 0.447179 0)
(0.894355 0.447187 0)
(0.894372 0.447192 0)
(0.894383 0.447195 0)
(0.89439 0.447197 0)
(0.894394 0.447199 0)
(0.894397 0.447199 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894397 0.447201 0)
(0.894394 0.447201 0)
(0.894388 0.447202 0)
(0.894377 0.447204 0)
(0.894359 0.447209 0)
(0.894329 0.447216 0)
(0.894283 0.447228 0)
(0.894215 0.447247 0)
(0.894119 0.447277 0)
(0.893986 0.447325 0)
(0.893792 0.447399 0)
(0.893491 0.447524 0)
(0.892997 0.447744 0)
(0.892127 0.448116 0)
(0.890582 0.448744 0)
(0.887949 0.449756 0)
(0.883725 0.451229 0)
(0.877529 0.453036 0)
(0.869464 0.454504 0)
(0.860094 0.454058 0)
(0.849773 0.449497 0)
(0.837933 0.438924 0)
(0.823124 0.421536 0)
(0.803565 0.397812 0)
(0.777614 0.369435 0)
(0.744064 0.339255 0)
(0.702524 0.311144 0)
(0.653925 0.289594 0)
(0.600861 0.279012 0)
(0.547496 0.282782 0)
(0.498871 0.302297 0)
(0.45987 0.336455 0)
(0.434429 0.381852 0)
(0.425217 0.433426 0)
(0.433475 0.485318 0)
(0.458805 0.531864 0)
(0.499102 0.568617 0)
(0.55083 0.59306 0)
(0.609572 0.604749 0)
(0.670633 0.604963 0)
(0.729544 0.596068 0)
(0.782459 0.580841 0)
(0.826514 0.561953 0)
(0.860143 0.541679 0)
(0.883242 0.521815 0)
(0.897024 0.503684 0)
(0.903579 0.488141 0)
(0.905275 0.475588 0)
(0.90424 0.466017 0)
(0.902062 0.459113 0)
(0.899731 0.454393 0)
(0.897746 0.451328 0)
(0.896272 0.449437 0)
(0.895288 0.44833 0)
(0.894696 0.447717 0)
(0.894381 0.4474 0)
(0.894243 0.44725 0)
(0.894206 0.447188 0)
(0.894221 0.447169 0)
(0.894255 0.447169 0)
(0.894292 0.447175 0)
(0.894325 0.447182 0)
(0.89435 0.447188 0)
(0.894368 0.447193 0)
(0.894381 0.447196 0)
(0.894389 0.447197 0)
(0.894394 0.447199 0)
(0.894396 0.447199 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894397 0.4472 0)
(0.894393 0.447202 0)
(0.894386 0.447202 0)
(0.894375 0.447204 0)
(0.894355 0.447207 0)
(0.894322 0.447214 0)
(0.894272 0.447225 0)
(0.894198 0.447241 0)
(0.89409 0.447266 0)
(0.89394 0.447311 0)
(0.893713 0.447381 0)
(0.893342 0.447506 0)
(0.892719 0.447741 0)
(0.891615 0.448146 0)
(0.889653 0.448825 0)
(0.886359 0.449901 0)
(0.881211 0.451379 0)
(0.873936 0.452929 0)
(0.864937 0.453454 0)
(0.855025 0.450802 0)
(0.844362 0.442342 0)
(0.831807 0.426166 0)
(0.815345 0.401823 0)
(0.792856 0.370314 0)
(0.762486 0.333925 0)
(0.722847 0.296233 0)
(0.673522 0.262 0)
(0.615745 0.23674 0)
(0.552822 0.225842 0)
(0.489874 0.233293 0)
(0.432816 0.260447 0)
(0.387105 0.305544 0)
(0.357046 0.364122 0)
(0.345653 0.429811 0)
(0.354436 0.495244 0)
(0.382974 0.553265 0)
(0.42877 0.598351 0)
(0.487672 0.627566 0)
(0.554634 0.64067 0)
(0.624436 0.639543 0)
(0.692194 0.627344 0)
(0.753714 0.607696 0)
(0.805781 0.584026 0)
(0.846459 0.559177 0)
(0.875308 0.535273 0)
(0.893347 0.51376 0)
(0.902683 0.495487 0)
(0.905907 0.480795 0)
(0.905488 0.469598 0)
(0.903369 0.461501 0)
(0.900829 0.455938 0)
(0.898554 0.452299 0)
(0.896811 0.450032 0)
(0.895618 0.448687 0)
(0.894881 0.447928 0)
(0.894474 0.447523 0)
(0.894283 0.447321 0)
(0.894219 0.447228 0)
(0.89422 0.447192 0)
(0.89425 0.447182 0)
(0.894286 0.447182 0)
(0.89432 0.447186 0)
(0.894346 0.447191 0)
(0.894366 0.447194 0)
(0.894379 0.447196 0)
(0.894388 0.447198 0)
(0.894393 0.447199 0)
(0.894396 0.447199 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894397 0.4472 0)
(0.894393 0.447201 0)
(0.894385 0.447201 0)
(0.894373 0.447203 0)
(0.894352 0.447206 0)
(0.894316 0.44721 0)
(0.894262 0.447218 0)
(0.894185 0.447231 0)
(0.894065 0.447249 0)
(0.893896 0.447289 0)
(0.893635 0.447354 0)
(0.893185 0.447473 0)
(0.892414 0.447718 0)
(0.891045 0.448145 0)
(0.88862 0.448846 0)
(0.88461 0.449929 0)
(0.878525 0.451291 0)
(0.870284 0.452327 0)
(0.860638 0.451452 0)
(0.850566 0.445946 0)
(0.839874 0.43284 0)
(0.826763 0.410321 0)
(0.808711 0.378362 0)
(0.783369 0.338517 0)
(0.748719 0.293678 0)
(0.703175 0.248145 0)
(0.64628 0.207638 0)
(0.579617 0.17884 0)
(0.507259 0.168249 0)
(0.435245 0.18045 0)
(0.370197 0.216651 0)
(0.317982 0.274385 0)
(0.283293 0.348152 0)
(0.269653 0.430185 0)
(0.27896 0.511281 0)
(0.310745 0.582379 0)
(0.361961 0.63661 0)
(0.427704 0.670649 0)
(0.50229 0.684669 0)
(0.580071 0.681377 0)
(0.655877 0.664876 0)
(0.725276 0.639707 0)
(0.784793 0.610123 0)
(0.832181 0.579622 0)
(0.866676 0.550747 0)
(0.889054 0.525128 0)
(0.901356 0.503619 0)
(0.906307 0.486465 0)
(0.906664 0.47345 0)
(0.904703 0.464051 0)
(0.901999 0.457583 0)
(0.899443 0.453337 0)
(0.897422 0.450673 0)
(0.896004 0.449076 0)
(0.895107 0.448162 0)
(0.894596 0.447662 0)
(0.894342 0.447403 0)
(0.894244 0.447277 0)
(0.894228 0.447221 0)
(0.894249 0.447199 0)
(0.894283 0.447192 0)
(0.894317 0.447192 0)
(0.894344 0.447194 0)
(0.894364 0.447196 0)
(0.894378 0.447197 0)
(0.894387 0.447198 0)
(0.894392 0.447199 0)
(0.894396 0.447199 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894396 0.4472 0)
(0.894393 0.4472 0)
(0.894385 0.447201 0)
(0.894372 0.447202 0)
(0.89435 0.447204 0)
(0.894312 0.447206 0)
(0.894257 0.447211 0)
(0.894175 0.44722 0)
(0.894045 0.447228 0)
(0.893858 0.44726 0)
(0.893561 0.447318 0)
(0.893024 0.447424 0)
(0.892085 0.447669 0)
(0.89043 0.448107 0)
(0.887509 0.448796 0)
(0.882755 0.449805 0)
(0.875776 0.450903 0)
(0.866761 0.451154 0)
(0.856812 0.448453 0)
(0.846956 0.43956 0)
(0.836537 0.421249 0)
(0.823096 0.391855 0)
(0.803709 0.351821 0)
(0.775897 0.303281 0)
(0.73752 0.249707 0)
(0.686785 0.196108 0)
(0.623172 0.149232 0)
(0.548623 0.117074 0)
(0.467934 0.107304 0)
(0.387885 0.125035 0)
(0.315578 0.171308 0)
(0.257265 0.243116 0)
(0.218191 0.334084 0)
(0.202511 0.43488 0)
(0.212529 0.533969 0)
(0.247605 0.619815 0)
(0.303931 0.683906 0)
(0.375708 0.722604 0)
(0.45667 0.736798 0)
(0.540946 0.73033 0)
(0.623311 0.708445 0)
(0.699258 0.67668 0)
(0.765143 0.640134 0)
(0.818455 0.602987 0)
(0.85811 0.568259 0)
(0.884604 0.537817 0)
(0.899835 0.512544 0)
(0.906575 0.492578 0)
(0.907793 0.477538 0)
(0.906058 0.466724 0)
(0.903225 0.459295 0)
(0.900401 0.454413 0)
(0.898096 0.45134 0)
(0.896442 0.449485 0)
(0.895372 0.44841 0)
(0.894747 0.447813 0)
(0.894422 0.447495 0)
(0.894282 0.447333 0)
(0.894244 0.447254 0)
(0.894255 0.447219 0)
(0.894284 0.447204 0)
(0.894316 0.447199 0)
(0.894342 0.447198 0)
(0.894363 0.447198 0)
(0.894377 0.447199 0)
(0.894386 0.447199 0)
(0.894392 0.447199 0)
(0.894396 0.4472 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894398 0.4472 0)
(0.894396 0.4472 0)
(0.894392 0.447201 0)
(0.894385 0.4472 0)
(0.894371 0.4472 0)
(0.894349 0.447201 0)
(0.894311 0.4472 0)
(0.894253 0.447201 0)
(0.894171 0.447206 0)
(0.894033 0.447203 0)
(0.893824 0.447222 0)
(0.893495 0.447275 0)
(0.892866 0.44736 0)
(0.891744 0.447589 0)
(0.889788 0.448022 0)
(0.886361 0.448657 0)
(0.880867 0.449496 0)
(0.873088 0.45017 0)
(0.86355 0.449391 0)
(0.853648 0.444532 0)
(0.844352 0.431885 0)
(0.834523 0.408012 0)
(0.821119 0.371421 0)
(0.800897 0.323062 0)
(0.771344 0.265663 0)
(0.730259 0.203246 0)
(0.67564 0.141502 0)
(0.606882 0.0882661 0)
(0.526214 0.0529084 0)
(0.438968 0.0442081 0)
(0.35239 0.0677362 0)
(0.273991 0.124579 0)
(0.210621 0.211625 0)
(0.168166 0.321792 0)
(0.151206 0.443819 0)
(0.162275 0.563196 0)
(0.200497 0.66535 0)
(0.261163 0.739878 0)
(0.337458 0.782933 0)
(0.422666 0.79645 0)
(0.511027 0.785734 0)
(0.597598 0.75738 0)
(0.67802 0.718009 0)
(0.748589 0.673575 0)
(0.806551 0.628933 0)
(0.850486 0.587593 0)
(0.880558 0.551692 0)
(0.898443 0.522171 0)
(0.90687 0.499066 0)
(0.908937 0.481802 0)
(0.907446 0.469468 0)
(0.904502 0.461031 0)
(0.901414 0.455497 0)
(0.898824 0.452011 0)
(0.896926 0.449898 0)
(0.895674 0.448664 0)
(0.894925 0.44797 0)
(0.894522 0.447592 0)
(0.894335 0.447393 0)
(0.89427 0.447291 0)
(0.894267 0.447242 0)
(0.894289 0.447218 0)
(0.894318 0.447208 0)
(0.894343 0.447203 0)
(0.894363 0.447201 0)
(0.894377 0.4472 0)
(0.894386 0.4472 0)
(0.894392 0.4472 0)
(0.894395 0.4472 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894396 0.4472 0)
(0.894392 0.4472 0)
(0.894385 0.447199 0)
(0.894371 0.447198 0)
(0.89435 0.447198 0)
(0.894312 0.447195 0)
(0.894252 0.447189 0)
(0.894173 0.44719 0)
(0.894031 0.447176 0)
(0.893799 0.447179 0)
(0.893437 0.447223 0)
(0.892721 0.447285 0)
(0.891401 0.447476 0)
(0.889137 0.447884 0)
(0.885223 0.448428 0)
(0.879029 0.448989 0)
(0.870579 0.449077 0)
(0.860794 0.447089 0)
(0.851267 0.43988 0)
(0.842834 0.423288 0)
(0.833963 0.393702 0)
(0.82114 0.349819 0)
(0.800858 0.293105 0)
(0.770638 0.226898 0)
(0.728318 0.155748 0)
(0.671735 0.0860031 0)
(0.600144 0.026575 0)
(0.515879 -0.011888 0)
(0.424496 -0.0196834 0)
(0.333519 0.00926664 0)
(0.251128 0.0766308 0)
(0.185066 0.179757 0)
(0.14141 0.310799 0)
(0.124335 0.456018 0)
(0.136452 0.597396 0)
(0.177022 0.717028 0)
(0.240518 0.802453 0)
(0.318995 0.849655 0)
(0.405402 0.861839 0)
(0.494482 0.846041 0)
(0.581997 0.810372 0)
(0.664037 0.762612 0)
(0.736963 0.709586 0)
(0.797794 0.656815 0)
(0.844727 0.608294 0)
(0.877523 0.566448 0)
(0.897548 0.532301 0)
(0.907391 0.505793 0)
(0.910183 0.486148 0)
(0.908892 0.472215 0)
(0.905825 0.462741 0)
(0.902471 0.456551 0)
(0.899592 0.452659 0)
(0.897446 0.450297 0)
(0.896006 0.448912 0)
(0.895126 0.448124 0)
(0.894639 0.447689 0)
(0.894401 0.447454 0)
(0.894307 0.44733 0)
(0.894287 0.447266 0)
(0.894299 0.447233 0)
(0.894323 0.447217 0)
(0.894345 0.447208 0)
(0.894364 0.447204 0)
(0.894377 0.447202 0)
(0.894386 0.447201 0)
(0.894392 0.4472 0)
(0.894396 0.4472 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894396 0.447199 0)
(0.894393 0.4472 0)
(0.894386 0.447199 0)
(0.894372 0.447196 0)
(0.894352 0.447195 0)
(0.894318 0.447189 0)
(0.894256 0.447177 0)
(0.89418 0.447171 0)
(0.894039 0.447151 0)
(0.893783 0.447129 0)
(0.893389 0.447164 0)
(0.892596 0.447203 0)
(0.891074 0.447331 0)
(0.8885 0.447688 0)
(0.884144 0.448109 0)
(0.877327 0.448287 0)
(0.868353 0.447645 0)
(0.85858 0.444362 0)
(0.849715 0.43477 0)
(0.842422 0.414223 0)
(0.834945 0.37898 0)
(0.823437 0.327952 0)
(0.804123 0.263101 0)
(0.774605 0.18837 0)
(0.732916 0.108859 0)
(0.676833 0.0315571 0)
(0.605398 -0.0336794 0)
(0.520755 -0.0752237 0)
(0.428349 -0.0827036 0)
(0.336073 -0.0492611 0)
(0.253309 0.0281072 0)
(0.18862 0.147576 0)
(0.146842 0.30015 0)
(0.130411 0.469129 0)
(0.142398 0.633009 0)
(0.183335 0.770735 0)
(0.247311 0.867602 0)
(0.325049 0.919131 0)
(0.409065 0.929822 0)
(0.494883 0.908631 0)
(0.579429 0.865313 0)
(0.659596 0.808839 0)
(0.731992 0.746901 0)
(0.793445 0.685683 0)
(0.841723 0.629675 0)
(0.876097 0.58161 0)
(0.897523 0.542614 0)
(0.908344 0.512549 0)
(0.911632 0.490435 0)
(0.910431 0.474871 0)
(0.907197 0.464361 0)
(0.903561 0.457534 0)
(0.900388 0.453257 0)
(0.897991 0.450664 0)
(0.896361 0.449141 0)
(0.895348 0.448269 0)
(0.894773 0.447781 0)
(0.89448 0.447513 0)
(0.894352 0.447368 0)
(0.894313 0.44729 0)
(0.894314 0.447248 0)
(0.894331 0.447226 0)
(0.89435 0.447214 0)
(0.894366 0.447207 0)
(0.894379 0.447204 0)
(0.894387 0.447202 0)
(0.894392 0.447201 0)
(0.894396 0.447201 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894396 0.447199 0)
(0.894393 0.447199 0)
(0.894387 0.447198 0)
(0.894374 0.447194 0)
(0.894355 0.447191 0)
(0.894326 0.447183 0)
(0.894265 0.447164 0)
(0.894192 0.447152 0)
(0.894061 0.447126 0)
(0.893783 0.447079 0)
(0.893353 0.447096 0)
(0.892499 0.447117 0)
(0.890782 0.447161 0)
(0.887904 0.447429 0)
(0.88317 0.447709 0)
(0.875843 0.447421 0)
(0.866485 0.445926 0)
(0.85694 0.441357 0)
(0.848978 0.429518 0)
(0.843086 0.405189 0)
(0.837493 0.364559 0)
(0.82818 0.306799 0)
(0.811071 0.234293 0)
(0.783836 0.151569 0)
(0.744894 0.0643554 0)
(0.692162 -0.0197131 0)
(0.624383 -0.0900921 0)
(0.543173 -0.13465 0)
(0.453644 -0.142573 0)
(0.364371 -0.105789 0)
(0.286389 -0.0193443 0)
(0.228242 0.115663 0)
(0.1913 0.288525 0)
(0.175129 0.479595 0)
(0.184283 0.664875 0)
(0.222241 0.820906 0)
(0.283551 0.930188 0)
(0.35745 0.986876 0)
(0.4356 0.996514 0)
(0.514249 0.97018 0)
(0.591799 0.919452 0)
(0.666353 0.854506 0)
(0.735024 0.78385 0)
(0.794545 0.714299 0)
(0.842234 0.650844 0)
(0.876802 0.596552 0)
(0.8987 0.552687 0)
(0.909922 0.519055 0)
(0.913374 0.494485 0)
(0.912095 0.477323 0)
(0.908617 0.46582 0)
(0.904671 0.458399 0)
(0.901197 0.453774 0)
(0.898549 0.45098 0)
(0.896729 0.449338 0)
(0.895583 0.448395 0)
(0.89492 0.447864 0)
(0.89457 0.447568 0)
(0.894407 0.447404 0)
(0.894345 0.447313 0)
(0.894334 0.447263 0)
(0.894342 0.447235 0)
(0.894357 0.44722 0)
(0.89437 0.447211 0)
(0.894381 0.447206 0)
(0.894388 0.447203 0)
(0.894393 0.447202 0)
(0.894396 0.447201 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894397 0.447199 0)
(0.894394 0.447199 0)
(0.894389 0.447197 0)
(0.894378 0.447192 0)
(0.89436 0.447186 0)
(0.894337 0.447178 0)
(0.89428 0.447155 0)
(0.894208 0.447131 0)
(0.894092 0.447104 0)
(0.893801 0.447031 0)
(0.89333 0.447019 0)
(0.892435 0.44703 0)
(0.890551 0.446976 0)
(0.887375 0.44711 0)
(0.882336 0.44724 0)
(0.874642 0.446444 0)
(0.865026 0.444004 0)
(0.855853 0.438229 0)
(0.84899 0.424441 0)
(0.844747 0.396707 0)
(0.841529 0.351172 0)
(0.835375 0.287354 0)
(0.821843 0.207958 0)
(0.798575 0.118021 0)
(0.764563 0.0240224 0)
(0.718145 -0.0656916 0)
(0.65776 -0.140192 0)
(0.584215 -0.187366 0)
(0.502139 -0.19616 0)
(0.421018 -0.156963 0)
(0.353472 -0.0627577 0)
(0.306625 0.0855188 0)
(0.27668 0.274956 0)
(0.260053 0.483789 0)
(0.263323 0.687679 0)
(0.294022 0.861933 0)
(0.348515 0.985226 0)
(0.415122 1.04869 0)
(0.484293 1.05828 0)
(0.552485 1.02744 0)
(0.61951 0.969917 0)
(0.684954 0.897194 0)
(0.746756 0.818505 0)
(0.801721 0.741201 0)
(0.846767 0.670735 0)
(0.880012 0.610528 0)
(0.901327 0.562015 0)
(0.912267 0.52498 0)
(0.91548 0.498088 0)
(0.913904 0.479439 0)
(0.910081 0.467038 0)
(0.905785 0.459098 0)
(0.902001 0.454182 0)
(0.899104 0.451226 0)
(0.897099 0.449493 0)
(0.895824 0.448497 0)
(0.895074 0.447931 0)
(0.894667 0.447614 0)
(0.894468 0.447435 0)
(0.894383 0.447334 0)
(0.894357 0.447277 0)
(0.894357 0.447244 0)
(0.894366 0.447225 0)
(0.894376 0.447214 0)
(0.894384 0.447208 0)
(0.89439 0.447204 0)
(0.894394 0.447202 0)
(0.894397 0.447201 0)
(0.894398 0.447201 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.894398 0.447199 0)
(0.894395 0.447198 0)
(0.894392 0.447196 0)
(0.894382 0.447191 0)
(0.894367 0.447183 0)
(0.89435 0.447172 0)
(0.894302 0.447147 0)
(0.894229 0.44711 0)
(0.89413 0.447081 0)
(0.893841 0.446995 0)
(0.893323 0.446937 0)
(0.8924 0.446939 0)
(0.890402 0.446795 0)
(0.886945 0.446741 0)
(0.881662 0.446711 0)
(0.873762 0.445425 0)
(0.864014 0.441991 0)
(0.85527 0.435114 0)
(0.849631 0.419821 0)
(0.847268 0.38929 0)
(0.846865 0.339536 0)
(0.844796 0.27056 0)
(0.836263 0.185331 0)
(0.818653 0.0892189 0)
(0.7916 -0.0104617 0)
(0.754222 -0.104484 0)
(0.704823 -0.181711 0)
(0.643238 -0.230478 0)
(0.573394 -0.239726 0)
(0.505434 -0.198426 0)
(0.452812 -0.0980478 0)
(0.420218 0.0598844 0)
(0.399233 0.260106 0)
(0.383654 0.480187 0)
(0.380304 0.698018 0)
(0.399691 0.88941 0)
(0.44177 1.02839 0)
(0.496202 1.10092 0)
(0.552844 1.11208 0)
(0.607731 1.07771 0)
(0.661431 1.01422 0)
(0.714894 0.93465 0)
(0.767071 0.848951 0)
(0.815059 0.764865 0)
(0.855481 0.688207 0)
(0.885882 0.622723 0)
(0.905522 0.570041 0)
(0.915449 0.529964 0)
(0.917974 0.501018 0)
(0.915856 0.481084 0)
(0.91157 0.467933 0)
(0.906882 0.459582 0)
(0.90278 0.454451 0)
(0.89964 0.451385 0)
(0.89746 0.449594 0)
(0.896062 0.448565 0)
(0.89523 0.44798 0)
(0.894769 0.447648 0)
(0.894533 0.447459 0)
(0.894426 0.447351 0)
(0.894384 0.447288 0)
(0.894374 0.447251 0)
(0.894376 0.447229 0)
(0.894382 0.447217 0)
(0.894388 0.447209 0)
(0.894392 0.447205 0)
(0.894395 0.447203 0)
(0.894397 0.447201 0)
(0.894398 0.447201 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.447199 0)
(0.894396 0.447197 0)
(0.894394 0.447196 0)
(0.894387 0.44719 0)
(0.894374 0.44718 0)
(0.894364 0.447167 0)
(0.894328 0.447142 0)
(0.894257 0.447094 0)
(0.894173 0.447059 0)
(0.893903 0.44697 0)
(0.893343 0.446861 0)
(0.892391 0.446844 0)
(0.890342 0.446629 0)
(0.886655 0.44635 0)
(0.881156 0.44613 0)
(0.873211 0.44443 0)
(0.863473 0.440016 0)
(0.855131 0.432127 0)
(0.850738 0.415865 0)
(0.850444 0.383394 0)
(0.853194 0.330324 0)
(0.855968 0.257254 0)
(0.853777 0.167502 0)
(0.843454 0.0665244 0)
(0.825081 -0.0376231 0)
(0.798879 -0.134607 0)
(0.763425 -0.212966 0)
(0.717617 -0.261636 0)
(0.664273 -0.26987 0)
(0.613339 -0.225962 0)
(0.577784 -0.120931 0)
(0.560113 0.042539 0)
(0.550421 0.247361 0)
(0.540862 0.471443 0)
(0.534355 0.69646 0)
(0.54053 0.901297 0)
(0.564073 1.05619 0)
(0.599695 1.14002 0)
(0.638904 1.15499 0)
(0.677317 1.11865 0)
(0.715349 1.05031 0)
(0.754654 0.965004 0)
(0.79506 0.873511 0)
(0.834068 0.783881 0)
(0.868139 0.702157 0)
(0.894309 0.63233 0)
(0.911238 0.576211 0)
(0.919441 0.533643 0)
(0.920831 0.50305 0)
(0.917922 0.482124 0)
(0.913055 0.46843 0)
(0.907932 0.459809 0)
(0.90351 0.454558 0)
(0.900139 0.451443 0)
(0.897798 0.449633 0)
(0.89629 0.448596 0)
(0.895382 0.448006 0)
(0.894871 0.447669 0)
(0.894601 0.447475 0)
(0.89447 0.447362 0)
(0.894413 0.447296 0)
(0.894392 0.447256 0)
(0.894388 0.447233 0)
(0.894389 0.447219 0)
(0.894392 0.447211 0)
(0.894395 0.447206 0)
(0.894397 0.447203 0)
(0.894398 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.447199 0)
(0.894397 0.447197 0)
(0.894397 0.447195 0)
(0.894393 0.44719 0)
(0.894384 0.447179 0)
(0.894378 0.447162 0)
(0.894357 0.447139 0)
(0.894293 0.447087 0)
(0.894216 0.447037 0)
(0.893979 0.446954 0)
(0.893398 0.446802 0)
(0.892406 0.446742 0)
(0.89037 0.446484 0)
(0.886541 0.44597 0)
(0.880835 0.445513 0)
(0.872955 0.443507 0)
(0.863403 0.438216 0)
(0.855396 0.429377 0)
(0.852123 0.412671 0)
(0.853994 0.379349 0)
(0.860113 0.324121 0)
(0.868201 0.248119 0)
(0.873443 0.155309 0)
(0.871903 0.0510586 0)
(0.863592 -0.0562176 0)
(0.849901 -0.155015 0)
(0.830255 -0.233133 0)
(0.802918 -0.279829 0)
(0.769208 -0.284944 0)
(0.737618 -0.237266 0)
(0.719027 -0.128742 0)
(0.714802 0.0366906 0)
(0.717458 0.241426 0)
(0.718959 0.463642 0)
(0.71514 0.688144 0)
(0.710117 0.899467 0)
(0.712025 1.06732 0)
(0.723217 1.16318 0)
(0.739838 1.18415 0)
(0.758282 1.14794 0)
(0.778469 1.07638 0)
(0.802009 0.986729 0)
(0.829158 0.890839 0)
(0.857737 0.797087 0)
(0.88412 0.711642 0)
(0.904926 0.63864 0)
(0.918261 0.580028 0)
(0.924108 0.535693 0)
(0.923961 0.503984 0)
(0.920036 0.482444 0)
(0.914486 0.468465 0)
(0.908901 0.459747 0)
(0.904165 0.454485 0)
(0.900583 0.451391 0)
(0.898099 0.449605 0)
(0.896496 0.448586 0)
(0.895524 0.448006 0)
(0.894969 0.447674 0)
(0.894668 0.447481 0)
(0.894516 0.447368 0)
(0.894443 0.4473 0)
(0.894412 0.447259 0)
(0.8944 0.447235 0)
(0.894397 0.44722 0)
(0.894397 0.447211 0)
(0.894397 0.447206 0)
(0.894398 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.894399 0.447197 0)
(0.894399 0.447195 0)
(0.894399 0.447189 0)
(0.894395 0.447178 0)
(0.894393 0.447161 0)
(0.894385 0.447136 0)
(0.894337 0.447084 0)
(0.894262 0.447021 0)
(0.894063 0.446942 0)
(0.893495 0.446767 0)
(0.892455 0.446646 0)
(0.890464 0.446356 0)
(0.886623 0.445635 0)
(0.880731 0.444893 0)
(0.872942 0.442677 0)
(0.86376 0.436709 0)
(0.856057 0.426979 0)
(0.853617 0.410241 0)
(0.857567 0.377275 0)
(0.867135 0.321364 0)
(0.880664 0.243699 0)
(0.893978 0.149271 0)
(0.902458 0.0435515 0)
(0.905342 -0.0652724 0)
(0.904767 -0.164933 0)
(0.901461 -0.242099 0)
(0.893638 -0.285652 0)
(0.881096 -0.286011 0)
(0.869757 -0.233577 0)
(0.866879 -0.122616 0)
(0.873192 0.0420224 0)
(0.885725 0.243951 0)
(0.898286 0.46127 0)
(0.900698 0.679603 0)
(0.889592 0.889566 0)
(0.872762 1.06434 0)
(0.858996 1.17014 0)
(0.850675 1.19789 0)
(0.846803 1.16371 0)
(0.847539 1.09089 0)
(0.85428 0.99861 0)
(0.867335 0.899924 0)
(0.884643 0.803621 0)
(0.902486 0.715948 0)
(0.917135 0.641102 0)
(0.926215 0.581103 0)
(0.929219 0.535862 0)
(0.927217 0.503674 0)
(0.922103 0.481964 0)
(0.915802 0.468 0)
(0.909745 0.459377 0)
(0.904715 0.454225 0)
(0.90095 0.451226 0)
(0.898351 0.449509 0)
(0.896673 0.448535 0)
(0.895651 0.447981 0)
(0.895059 0.447663 0)
(0.894732 0.447478 0)
(0.89456 0.447368 0)
(0.894474 0.447301 0)
(0.894432 0.44726 0)
(0.894413 0.447235 0)
(0.894405 0.447221 0)
(0.894402 0.447212 0)
(0.8944 0.447206 0)
(0.8944 0.447204 0)
(0.8944 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.4472 0)
(0.894401 0.447197 0)
(0.894402 0.447195 0)
(0.894405 0.44719 0)
(0.894406 0.447179 0)
(0.89441 0.447161 0)
(0.894411 0.447135 0)
(0.894386 0.447089 0)
(0.894314 0.447016 0)
(0.894143 0.446935 0)
(0.893628 0.446753 0)
(0.892555 0.446574 0)
(0.890601 0.446246 0)
(0.886888 0.445359 0)
(0.880895 0.444316 0)
(0.87313 0.441955 0)
(0.864442 0.435565 0)
(0.857112 0.425058 0)
(0.855135 0.408524 0)
(0.860786 0.37704 0)
(0.873691 0.322212 0)
(0.8925 0.244384 0)
(0.913917 0.149642 0)
(0.933141 0.0442133 0)
(0.948158 -0.0642547 0)
(0.960929 -0.16369 0)
(0.973381 -0.23982 0)
(0.984332 -0.280446 0)
(0.992623 -0.276138 0)
(1.00118 -0.219488 0)
(1.0127 -0.10786 0)
(1.02676 0.0536756 0)
(1.04445 0.25131 0)
(1.06299 0.463152 0)
(1.07028 0.673605 0)
(1.05745 0.877076 0)
(1.02867 1.0521 0)
(0.994829 1.16334 0)
(0.963542 1.19654 0)
(0.937616 1.16525 0)
(0.918683 1.09291 0)
(0.908451 0.999853 0)
(0.907277 0.900132 0)
(0.913098 0.802959 0)
(0.922066 0.714648 0)
(0.930161 0.639387 0)
(0.934605 0.579204 0)
(0.934462 0.534006 0)
(0.930407 0.502039 0)
(0.924006 0.480649 0)
(0.916927 0.467023 0)
(0.910418 0.458699 0)
(0.905132 0.453783 0)
(0.901224 0.450952 0)
(0.898542 0.449347 0)
(0.896813 0.448443 0)
(0.895755 0.447931 0)
(0.895137 0.447637 0)
(0.89479 0.447464 0)
(0.894602 0.447361 0)
(0.894503 0.447297 0)
(0.894452 0.447258 0)
(0.894426 0.447235 0)
(0.894413 0.44722 0)
(0.894407 0.447211 0)
(0.894403 0.447206 0)
(0.894402 0.447203 0)
(0.894401 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.447199 0)
(0.894402 0.4472 0)
(0.894402 0.447198 0)
(0.894406 0.447195 0)
(0.894411 0.44719 0)
(0.894416 0.447181 0)
(0.894426 0.447163 0)
(0.894436 0.447137 0)
(0.894432 0.447094 0)
(0.894375 0.447025 0)
(0.894219 0.446936 0)
(0.893777 0.446753 0)
(0.892722 0.446534 0)
(0.89078 0.44617 0)
(0.887287 0.445148 0)
(0.881367 0.443814 0)
(0.873531 0.441358 0)
(0.8653 0.434806 0)
(0.858514 0.423714 0)
(0.856713 0.407474 0)
(0.863372 0.378299 0)
(0.879153 0.326424 0)
(0.902853 0.250324 0)
(0.931849 0.156538 0)
(0.961746 0.0527949 0)
(0.98941 -0.0533451 0)
(1.0157 -0.150939 0)
(1.04289 -0.225823 0)
(1.07062 -0.264703 0)
(1.09771 -0.257759 0)
(1.12451 -0.199577 0)
(1.14912 -0.090133 0)
(1.16941 0.0664173 0)
(1.18889 0.258984 0)
(1.20796 0.465456 0)
(1.21594 0.668473 0)
(1.20232 0.863618 0)
(1.16734 1.0339 0)
(1.11998 1.14558 0)
(1.07031 1.1816 0)
(1.02486 1.15297 0)
(0.987633 1.08231 0)
(0.961313 0.99023 0)
(0.946552 0.891273 0)
(0.941303 0.794952 0)
(0.941584 0.707621 0)
(0.943134 0.633406 0)
(0.94286 0.574281 0)
(0.939475 0.530108 0)
(0.933308 0.499088 0)
(0.92561 0.478519 0)
(0.917785 0.465557 0)
(0.910876 0.457734 0)
(0.905391 0.453173 0)
(0.901389 0.450579 0)
(0.898663 0.449126 0)
(0.896909 0.448315 0)
(0.895834 0.447858 0)
(0.8952 0.447596 0)
(0.894839 0.447441 0)
(0.894639 0.447348 0)
(0.894529 0.44729 0)
(0.89447 0.447255 0)
(0.894438 0.447232 0)
(0.894421 0.447219 0)
(0.894411 0.447211 0)
(0.894406 0.447206 0)
(0.894403 0.447203 0)
(0.894402 0.447202 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.447199 0)
(0.894404 0.447198 0)
(0.894408 0.447195 0)
(0.894416 0.447191 0)
(0.894425 0.447182 0)
(0.894443 0.447169 0)
(0.89446 0.447143 0)
(0.894473 0.447101 0)
(0.894443 0.447041 0)
(0.894295 0.446954 0)
(0.893921 0.446762 0)
(0.892953 0.44652 0)
(0.891016 0.446144 0)
(0.887753 0.445016 0)
(0.882135 0.4434 0)
(0.874223 0.440899 0)
(0.866221 0.434435 0)
(0.860104 0.422995 0)
(0.858438 0.407063 0)
(0.865282 0.380621 0)
(0.882961 0.333326 0)
(0.91085 0.261203 0)
(0.946558 0.169957 0)
(0.986217 0.0688877 0)
(1.02621 -0.033453 0)
(1.06599 -0.127263 0)
(1.107 -0.199771 0)
(1.14925 -0.237552 0)
(1.19215 -0.230417 0)
(1.23425 -0.174281 0)
(1.26995 -0.0700122 0)
(1.29566 0.0803572 0)
(1.31603 0.26719 0)
(1.33314 0.46723 0)
(1.33853 0.66216 0)
(1.32285 0.847835 0)
(1.28425 1.01004 0)
(1.22836 1.11805 0)
(1.16503 1.1543 0)
(1.1035 1.12773 0)
(1.0504 1.05962 0)
(1.00978 0.97007 0)
(0.982811 0.873617 0)
(0.967506 0.779847 0)
(0.959776 0.69508 0)
(0.955179 0.623336 0)
(0.9504 0.566479 0)
(0.943891 0.52429 0)
(0.935697 0.494922 0)
(0.926785 0.475654 0)
(0.918301 0.463662 0)
(0.911078 0.456525 0)
(0.905469 0.452425 0)
(0.901432 0.450128 0)
(0.898705 0.448859 0)
(0.896957 0.448158 0)
(0.895883 0.447767 0)
(0.895247 0.447543 0)
(0.894879 0.44741 0)
(0.89467 0.44733 0)
(0.894552 0.44728 0)
(0.894486 0.447248 0)
(0.894449 0.447229 0)
(0.894428 0.447217 0)
(0.894416 0.44721 0)
(0.894409 0.447205 0)
(0.894405 0.447203 0)
(0.894403 0.447202 0)
(0.894401 0.447201 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.894402 0.4472 0)
(0.894403 0.447199 0)
(0.894405 0.447199 0)
(0.89441 0.447196 0)
(0.894421 0.447192 0)
(0.894433 0.447185 0)
(0.894458 0.447172 0)
(0.894484 0.447154 0)
(0.894505 0.447113 0)
(0.894508 0.447057 0)
(0.89438 0.446988 0)
(0.894049 0.446793 0)
(0.89322 0.446517 0)
(0.891343 0.446167 0)
(0.888242 0.444998 0)
(0.883111 0.443084 0)
(0.875295 0.440556 0)
(0.867206 0.434438 0)
(0.861649 0.422927 0)
(0.860305 0.407257 0)
(0.866734 0.383601 0)
(0.88489 0.341977 0)
(0.915678 0.276082 0)
(0.956962 0.189512 0)
(1.00496 0.0921617 0)
(1.05596 -0.00567726 0)
(1.10843 -0.0943065 0)
(1.16234 -0.162676 0)
(1.21727 -0.198487 0)
(1.27299 -0.19207 0)
(1.32662 -0.140142 0)
(1.37033 -0.0425745 0)
(1.40042 0.100911 0)
(1.42196 0.280088 0)
(1.43704 0.47048 0)
(1.43878 0.654502 0)
(1.41991 0.828501 0)
(1.37814 0.979834 0)
(1.31656 1.08103 0)
(1.24354 1.11547 0)
(1.16962 1.09053 0)
(1.10364 1.02576 0)
(1.05119 0.94018 0)
(1.01399 0.847872 0)
(0.990159 0.758259 0)
(0.975515 0.677546 0)
(0.965507 0.6096 0)
(0.956695 0.556131 0)
(0.94737 0.516808 0)
(0.937368 0.489728 0)
(0.927416 0.472187 0)
(0.918418 0.46143 0)
(0.910996 0.455132 0)
(0.905353 0.451576 0)
(0.901347 0.44962 0)
(0.898665 0.448558 0)
(0.896953 0.447981 0)
(0.895901 0.447663 0)
(0.895273 0.447481 0)
(0.894906 0.447374 0)
(0.894694 0.447308 0)
(0.894571 0.447267 0)
(0.8945 0.447241 0)
(0.894458 0.447224 0)
(0.894434 0.447214 0)
(0.894419 0.447208 0)
(0.894411 0.447205 0)
(0.894406 0.447202 0)
(0.894403 0.447201 0)
(0.894402 0.447201 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.4472 0)
(0.894403 0.447199 0)
(0.894407 0.447198 0)
(0.894412 0.447197 0)
(0.894425 0.447194 0)
(0.89444 0.447189 0)
(0.894468 0.447177 0)
(0.894506 0.447164 0)
(0.894534 0.447133 0)
(0.894559 0.447075 0)
(0.894472 0.447025 0)
(0.894164 0.446857 0)
(0.893486 0.446531 0)
(0.891768 0.446205 0)
(0.888767 0.445117 0)
(0.884166 0.442921 0)
(0.876765 0.440275 0)
(0.868402 0.434744 0)
(0.862976 0.423535 0)
(0.862116 0.408047 0)
(0.868018 0.386889 0)
(0.885245 0.351389 0)
(0.916925 0.293511 0)
(0.96207 0.21406 0)
(1.01673 0.122072 0)
(1.07683 0.0292097 0)
(1.14018 -0.0538797 0)
(1.20542 -0.116996 0)
(1.27146 -0.149337 0)
(1.33741 -0.142777 0)
(1.39871 -0.0947315 0)
(1.44724 -0.00344634 0)
(1.48082 0.132115 0)
(1.5042 0.299878 0)
(1.51783 0.476114 0)
(1.51585 0.645846 0)
(1.4932 0.805773 0)
(1.44807 0.94382 0)
(1.3822 1.03562 0)
(1.30261 1.06653 0)
(1.22004 1.04286 0)
(1.14472 0.982145 0)
(1.08344 0.901832 0)
(1.03849 0.81515 0)
(1.00805 0.731145 0)
(0.987915 0.655819 0)
(0.973489 0.592845 0)
(0.961322 0.54374 0)
(0.949646 0.508032 0)
(0.938168 0.483771 0)
(0.927421 0.4683 0)
(0.918095 0.458978 0)
(0.910617 0.453627 0)
(0.90504 0.450672 0)
(0.901137 0.449083 0)
(0.898546 0.448242 0)
(0.8969 0.447794 0)
(0.895888 0.447551 0)
(0.895281 0.447414 0)
(0.894921 0.447333 0)
(0.89471 0.447283 0)
(0.894584 0.447252 0)
(0.89451 0.447232 0)
(0.894465 0.447219 0)
(0.894438 0.447211 0)
(0.894422 0.447207 0)
(0.894413 0.447204 0)
(0.894407 0.447202 0)
(0.894404 0.447201 0)
(0.894402 0.447201 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447199 0)
(0.894402 0.4472 0)
(0.894403 0.4472 0)
(0.894408 0.447199 0)
(0.894413 0.447198 0)
(0.894428 0.447196 0)
(0.894445 0.447193 0)
(0.894476 0.447184 0)
(0.894522 0.447172 0)
(0.894558 0.447156 0)
(0.894597 0.447101 0)
(0.894561 0.447055 0)
(0.894281 0.446942 0)
(0.893714 0.446589 0)
(0.89226 0.44623 0)
(0.889377 0.445331 0)
(0.885194 0.443001 0)
(0.878522 0.440056 0)
(0.870008 0.435173 0)
(0.86413 0.424787 0)
(0.863561 0.40952 0)
(0.869196 0.390251 0)
(0.884707 0.360647 0)
(0.915006 0.311852 0)
(0.961381 0.241726 0)
(1.02044 0.157297 0)
(1.08753 0.0704361 0)
(1.15937 -0.00719193 0)
(1.23372 -0.0651421 0)
(1.30896 -0.0934995 0)
(1.38252 -0.0857433 0)
(1.44822 -0.0400475 0)
(1.49956 0.0457648 0)
(1.53661 0.17142 0)
(1.56234 0.323833 0)
(1.57474 0.482485 0)
(1.56896 0.635799 0)
(1.54227 0.780217 0)
(1.49366 0.90337 0)
(1.42435 0.98385 0)
(1.34058 1.00975 0)
(1.25285 0.986942 0)
(1.17191 0.930787 0)
(1.10519 0.856777 0)
(1.05529 0.776941 0)
(1.02043 0.699756 0)
(0.996413 0.630929 0)
(0.978724 0.573892 0)
(0.964008 0.529933 0)
(0.95055 0.49842 0)
(0.938004 0.477366 0)
(0.926761 0.464198 0)
(0.917323 0.456438 0)
(0.909942 0.452094 0)
(0.904539 0.449761 0)
(0.900807 0.448547 0)
(0.898352 0.447925 0)
(0.896799 0.447606 0)
(0.895845 0.447438 0)
(0.895269 0.447345 0)
(0.894924 0.447291 0)
(0.894717 0.447257 0)
(0.894593 0.447236 0)
(0.894517 0.447222 0)
(0.89447 0.447213 0)
(0.894442 0.447208 0)
(0.894425 0.447205 0)
(0.894414 0.447202 0)
(0.894408 0.447201 0)
(0.894404 0.447201 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894402 0.4472 0)
(0.894404 0.4472 0)
(0.894408 0.4472 0)
(0.894414 0.447199 0)
(0.894429 0.447198 0)
(0.894449 0.447197 0)
(0.894481 0.447191 0)
(0.894532 0.447182 0)
(0.894581 0.447175 0)
(0.894624 0.447137 0)
(0.894633 0.447082 0)
(0.894407 0.447024 0)
(0.893903 0.446705 0)
(0.892747 0.446263 0)
(0.890108 0.445545 0)
(0.886182 0.443354 0)
(0.880361 0.440032 0)
(0.872117 0.435549 0)
(0.865402 0.42645 0)
(0.864473 0.411799 0)
(0.870009 0.393717 0)
(0.883834 0.369067 0)
(0.911098 0.3295 0)
(0.95554 0.27026 0)
(1.01573 0.195626 0)
(1.08702 0.116406 0)
(1.16482 0.0446206 0)
(1.24598 -0.00864817 0)
(1.328 -0.0335949 0)
(1.40623 -0.0246471 0)
(1.47411 0.0190998 0)
(1.52791 0.0987617 0)
(1.56859 0.212317 0)
(1.59612 0.347412 0)
(1.60661 0.487474 0)
(1.59696 0.623817 0)
(1.56655 0.752128 0)
(1.51496 0.859516 0)
(1.4433 0.927566 0)
(1.35752 0.947547 0)
(1.26782 0.925313 0)
(1.18486 0.874068 0)
(1.1161 0.807097 0)
(1.06411 0.735004 0)
(1.02706 0.66555 0)
(1.00082 0.604062 0)
(0.981059 0.553675 0)
(0.964651 0.515412 0)
(0.950025 0.488475 0)
(0.936858 0.470856 0)
(0.925443 0.460104 0)
(0.916124 0.453946 0)
(0.908997 0.450611 0)
(0.903869 0.448891 0)
(0.900374 0.448038 0)
(0.898095 0.447625 0)
(0.896659 0.447427 0)
(0.895776 0.44733 0)
(0.89524 0.447279 0)
(0.894915 0.447249 0)
(0.894717 0.447231 0)
(0.894596 0.44722 0)
(0.89452 0.447212 0)
(0.894473 0.447207 0)
(0.894444 0.447204 0)
(0.894426 0.447202 0)
(0.894415 0.447201 0)
(0.894408 0.447201 0)
(0.894405 0.4472 0)
(0.894403 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447199 0)
(0.8944 0.447201 0)
(0.894402 0.447199 0)
(0.894404 0.447201 0)
(0.894408 0.4472 0)
(0.894414 0.4472 0)
(0.89443 0.447199 0)
(0.894451 0.4472 0)
(0.894485 0.447198 0)
(0.894537 0.447193 0)
(0.894596 0.447191 0)
(0.894645 0.447175 0)
(0.894679 0.447119 0)
(0.894532 0.44708 0)
(0.894072 0.446857 0)
(0.893164 0.446357 0)
(0.890926 0.445709 0)
(0.88721 0.443868 0)
(0.882096 0.440373 0)
(0.874601 0.435888 0)
(0.86716 0.428134 0)
(0.865053 0.414781 0)
(0.87013 0.397592 0)
(0.882686 0.376459 0)
(0.906447 0.345134 0)
(0.946394 0.297361 0)
(1.00379 0.23429 0)
(1.07533 0.164496 0)
(1.15591 0.099563 0)
(1.2414 0.0510417 0)
(1.32747 0.0289159 0)
(1.40779 0.0379851 0)
(1.47697 0.07821 0)
(1.53343 0.149871 0)
(1.57695 0.250239 0)
(1.60445 0.368086 0)
(1.61204 0.490069 0)
(1.59895 0.609686 0)
(1.56584 0.72169 0)
(1.51239 0.812964 0)
(1.43994 0.868289 0)
(1.3545 0.882169 0)
(1.26593 0.860541 0)
(1.18435 0.814479 0)
(1.11677 0.754998 0)
(1.06538 0.691205 0)
(1.02822 0.630065 0)
(1.0013 0.576457 0)
(0.980591 0.533158 0)
(0.963313 0.500895 0)
(0.948126 0.478699 0)
(0.934785 0.464572 0)
(0.923521 0.456224 0)
(0.914546 0.451625 0)
(0.90782 0.449252 0)
(0.903061 0.448102 0)
(0.899857 0.447579 0)
(0.897785 0.447355 0)
(0.896485 0.447265 0)
(0.895685 0.44723 0)
(0.895196 0.447217 0)
(0.894896 0.447211 0)
(0.89471 0.447207 0)
(0.894594 0.447205 0)
(0.89452 0.447203 0)
(0.894474 0.447202 0)
(0.894445 0.447201 0)
(0.894426 0.447201 0)
(0.894415 0.4472 0)
(0.894409 0.4472 0)
(0.894405 0.4472 0)
(0.894403 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894404 0.4472 0)
(0.894407 0.447201 0)
(0.894416 0.447201 0)
(0.894428 0.447202 0)
(0.894452 0.447202 0)
(0.894485 0.447204 0)
(0.894536 0.447203 0)
(0.894603 0.447206 0)
(0.89466 0.447204 0)
(0.894705 0.447171 0)
(0.894633 0.447125 0)
(0.894246 0.446992 0)
(0.893492 0.446534 0)
(0.89173 0.445862 0)
(0.888351 0.444378 0)
(0.883699 0.441087 0)
(0.877167 0.436435 0)
(0.86956 0.429599 0)
(0.86583 0.418009 0)
(0.869576 0.402061 0)
(0.880954 0.383224 0)
(0.901645 0.358204 0)
(0.936062 0.321101 0)
(0.98741 0.270339 0)
(1.05468 0.211484 0)
(1.13384 0.154804 0)
(1.22006 0.111777 0)
(1.30695 0.0920947 0)
(1.38753 0.0995531 0)
(1.45778 0.134206 0)
(1.51636 0.196832 0)
(1.56068 0.284147 0)
(1.58625 0.385356 0)
(1.59086 0.489998 0)
(1.57572 0.593378 0)
(1.54149 0.689161 0)
(1.48772 0.764498 0)
(1.41634 0.807595 0)
(1.33373 0.815893 0)
(1.24927 0.795197 0)
(1.1722 0.754499 0)
(1.10862 0.702667 0)
(1.06013 0.647384 0)
(1.02462 0.594813 0)
(0.998307 0.549323 0)
(0.977619 0.513271 0)
(0.960195 0.487057 0)
(0.945002 0.469555 0)
(0.931905 0.458811 0)
(0.921094 0.452739 0)
(0.912665 0.449579 0)
(0.906468 0.448073 0)
(0.902153 0.447426 0)
(0.899282 0.447189 0)
(0.89744 0.447126 0)
(0.896288 0.447127 0)
(0.895577 0.447145 0)
(0.895139 0.447163 0)
(0.894867 0.447176 0)
(0.894696 0.447185 0)
(0.894587 0.447191 0)
(0.894518 0.447195 0)
(0.894473 0.447197 0)
(0.894444 0.447198 0)
(0.894426 0.447199 0)
(0.894415 0.447199 0)
(0.894409 0.4472 0)
(0.894405 0.4472 0)
(0.894403 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894402 0.4472 0)
(0.894404 0.4472 0)
(0.894407 0.447201 0)
(0.894414 0.447201 0)
(0.894429 0.447203 0)
(0.894449 0.447205 0)
(0.894482 0.447209 0)
(0.894535 0.447214 0)
(0.894599 0.447219 0)
(0.894666 0.447229 0)
(0.894718 0.447218 0)
(0.894699 0.447177 0)
(0.894412 0.447092 0)
(0.893764 0.446744 0)
(0.892413 0.446073 0)
(0.889561 0.444818 0)
(0.885289 0.441987 0)
(0.879578 0.437389 0)
(0.87241 0.430972 0)
(0.86731 0.421002 0)
(0.868895 0.406848 0)
(0.878507 0.389859 0)
(0.896582 0.369129 0)
(0.925799 0.34057 0)
(0.969642 0.301347 0)
(1.02921 0.254202 0)
(1.1025 0.207157 0)
(1.18477 0.170503 0)
(1.26869 0.152692 0)
(1.34755 0.157199 0)
(1.4178 0.185775 0)
(1.47667 0.239638 0)
(1.51954 0.314022 0)
(1.54243 0.398906 0)
(1.54548 0.487182 0)
(1.5303 0.575127 0)
(1.49668 0.655061 0)
(1.44428 0.71515 0)
(1.37605 0.747188 0)
(1.29873 0.750943 0)
(1.22104 0.731677 0)
(1.15104 0.69639 0)
(1.09367 0.652084 0)
(1.04981 0.60521 0)
(1.01724 0.561164 0)
(0.992504 0.523746 0)
(0.972575 0.494832 0)
(0.955598 0.474478 0)
(0.940873 0.461424 0)
(0.928385 0.453807 0)
(0.918287 0.449781 0)
(0.910573 0.447881 0)
(0.905006 0.447113 0)
(0.901186 0.446885 0)
(0.898674 0.446878 0)
(0.897075 0.446943 0)
(0.896076 0.447015 0)
(0.895458 0.447075 0)
(0.895074 0.447118 0)
(0.894832 0.447147 0)
(0.894677 0.447167 0)
(0.894577 0.447179 0)
(0.894512 0.447187 0)
(0.89447 0.447193 0)
(0.894442 0.447196 0)
(0.894425 0.447197 0)
(0.894415 0.447199 0)
(0.894408 0.447199 0)
(0.894405 0.4472 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.4472 0)
(0.894403 0.4472 0)
(0.894407 0.447201 0)
(0.894413 0.447202 0)
(0.894428 0.447204 0)
(0.894445 0.447207 0)
(0.894479 0.447213 0)
(0.894529 0.447221 0)
(0.894589 0.447232 0)
(0.894665 0.447246 0)
(0.894725 0.447256 0)
(0.894729 0.447235 0)
(0.894546 0.447172 0)
(0.894021 0.44693 0)
(0.892941 0.446348 0)
(0.890698 0.445235 0)
(0.886948 0.442884 0)
(0.881829 0.438687 0)
(0.875362 0.43254 0)
(0.869601 0.423685 0)
(0.868828 0.411437 0)
(0.875804 0.396386 0)
(0.891106 0.378663 0)
(0.915823 0.356156 0)
(0.952435 0.326431 0)
(1.00303 0.290439 0)
(1.06733 0.253493 0)
(1.14138 0.223488 0)
(1.2185 0.207336 0)
(1.29293 0.20938 0)
(1.36078 0.23294 0)
(1.41732 0.278185 0)
(1.45713 0.33923 0)
(1.47812 0.408593 0)
(1.48159 0.482133 0)
(1.46795 0.555575 0)
(1.4361 0.62018 0)
(1.38663 0.666202 0)
(1.32362 0.688872 0)
(1.25384 0.689376 0)
(1.18506 0.672009 0)
(1.12396 0.641997 0)
(1.07422 0.604868 0)
(1.03605 0.56607 0)
(1.00718 0.530268 0)
(0.984616 0.500631 0)
(0.965953 0.478507 0)
(0.949873 0.463607 0)
(0.936001 0.454584 0)
(0.924423 0.449714 0)
(0.915245 0.44743 0)
(0.908373 0.446569 0)
(0.9035 0.44639 0)
(0.900206 0.446483 0)
(0.898062 0.446649 0)
(0.896706 0.446807 0)
(0.89586 0.446932 0)
(0.895334 0.447022 0)
(0.895003 0.447084 0)
(0.894792 0.447125 0)
(0.894654 0.447152 0)
(0.894564 0.44717 0)
(0.894504 0.447182 0)
(0.894465 0.447189 0)
(0.89444 0.447193 0)
(0.894424 0.447196 0)
(0.894414 0.447198 0)
(0.894408 0.447199 0)
(0.894404 0.447199 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894402 0.4472 0)
(0.894402 0.447201 0)
(0.894407 0.447201 0)
(0.894411 0.447202 0)
(0.894426 0.447205 0)
(0.894441 0.447208 0)
(0.894474 0.447216 0)
(0.894518 0.447226 0)
(0.894579 0.447241 0)
(0.894653 0.447262 0)
(0.894719 0.447284 0)
(0.894741 0.447283 0)
(0.894633 0.447248 0)
(0.894249 0.447077 0)
(0.893366 0.446627 0)
(0.891644 0.445668 0)
(0.888584 0.443717 0)
(0.884037 0.440119 0)
(0.878228 0.434423 0)
(0.872424 0.426315 0)
(0.869785 0.415594 0)
(0.873678 0.402463 0)
(0.885619 0.387165 0)
(0.906121 0.368887 0)
(0.93647 0.346294 0)
(0.978526 0.31955 0)
(1.03267 0.29162 0)
(1.09604 0.26792 0)
(1.1637 0.254269 0)
(1.23121 0.255585 0)
(1.2938 0.274917 0)
(1.34539 0.31108 0)
(1.38157 0.359253 0)
(1.40188 0.41519 0)
(1.40674 0.475759 0)
(1.39485 0.535286 0)
(1.36532 0.585316 0)
(1.32017 0.619047 0)
(1.26421 0.634387 0)
(1.20372 0.632911 0)
(1.14524 0.61773 0)
(1.094 0.592677 0)
(1.0525 0.562227 0)
(1.02036 0.531026 0)
(0.995461 0.50301 0)
(0.975338 0.480662 0)
(0.958244 0.464771 0)
(0.943387 0.454738 0)
(0.930667 0.44919 0)
(0.920229 0.446604 0)
(0.91212 0.445712 0)
(0.906167 0.445645 0)
(0.902017 0.445898 0)
(0.899251 0.446218 0)
(0.89747 0.446501 0)
(0.896348 0.44672 0)
(0.895648 0.446877 0)
(0.895209 0.446986 0)
(0.89493 0.44706 0)
(0.894749 0.447109 0)
(0.894629 0.447142 0)
(0.894549 0.447164 0)
(0.894495 0.447178 0)
(0.894459 0.447186 0)
(0.894436 0.447192 0)
(0.894422 0.447195 0)
(0.894413 0.447197 0)
(0.894407 0.447199 0)
(0.894404 0.447199 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894403 0.447201 0)
(0.894404 0.447201 0)
(0.894412 0.447202 0)
(0.89442 0.447205 0)
(0.89444 0.447209 0)
(0.894465 0.447219 0)
(0.894507 0.447227 0)
(0.894564 0.447249 0)
(0.894633 0.447272 0)
(0.894706 0.447302 0)
(0.894737 0.447322 0)
(0.894686 0.447312 0)
(0.894414 0.447197 0)
(0.89373 0.446867 0)
(0.892391 0.446093 0)
(0.890021 0.444496 0)
(0.886188 0.44152 0)
(0.88104 0.436507 0)
(0.875484 0.42912 0)
(0.871675 0.419483 0)
(0.872747 0.407907 0)
(0.88098 0.394649 0)
(0.89717 0.379556 0)
(0.921922 0.362091 0)
(0.956296 0.342143 0)
(1.00055 0.321334 0)
(1.05294 0.303444 0)
(1.11052 0.293167 0)
(1.16947 0.294563 0)
(1.22427 0.309566 0)
(1.26935 0.337129 0)
(1.30215 0.37466 0)
(1.32205 0.419599 0)
(1.3275 0.468206 0)
(1.31664 0.514294 0)
(1.28991 0.551237 0)
(1.25047 0.575084 0)
(1.20298 0.585181 0)
(1.15278 0.582728 0)
(1.1051 0.569783 0)
(1.06379 0.549275 0)
(1.03034 0.524973 0)
(1.00402 0.500829 0)
(0.98294 0.480018 0)
(0.965272 0.46429 0)
(0.949906 0.453895 0)
(0.936499 0.447995 0)
(0.92515 0.445275 0)
(0.91601 0.44446 0)
(0.909055 0.444594 0)
(0.904047 0.445083 0)
(0.900615 0.445618 0)
(0.898357 0.446075 0)
(0.896916 0.446423 0)
(0.896012 0.446674 0)
(0.895447 0.446847 0)
(0.895089 0.446966 0)
(0.894858 0.447046 0)
(0.894705 0.4471 0)
(0.894602 0.447136 0)
(0.894532 0.447159 0)
(0.894485 0.447175 0)
(0.894453 0.447185 0)
(0.894433 0.447191 0)
(0.894419 0.447195 0)
(0.894411 0.447197 0)
(0.894406 0.447198 0)
(0.894404 0.447199 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894401 0.4472 0)
(0.894404 0.4472 0)
(0.894403 0.447202 0)
(0.894412 0.447202 0)
(0.894417 0.447205 0)
(0.894435 0.44721 0)
(0.894457 0.447217 0)
(0.894496 0.447231 0)
(0.894547 0.447251 0)
(0.894609 0.447279 0)
(0.894683 0.447312 0)
(0.894726 0.44735 0)
(0.894703 0.447357 0)
(0.894526 0.447295 0)
(0.894023 0.447064 0)
(0.892995 0.44647 0)
(0.891174 0.445206 0)
(0.888133 0.442809 0)
(0.883778 0.43861 0)
(0.878653 0.432106 0)
(0.874242 0.42338 0)
(0.873157 0.41292 0)
(0.877905 0.401228 0)
(0.889713 0.388526 0)
(0.909058 0.374623 0)
(0.936419 0.35943 0)
(0.971855 0.344063 0)
(1.0145 0.331134 0)
(1.06234 0.32384 0)
(1.11163 0.32498 0)
(1.15743 0.3361 0)
(1.19604 0.357041 0)
(1.22554 0.386388 0)
(1.2438 0.421681 0)
(1.24832 0.458871 0)
(1.23823 0.492783 0)
(1.21529 0.519085 0)
(1.18273 0.535664 0)
(1.14441 0.542225 0)
(1.1046 0.539395 0)
(1.06731 0.528581 0)
(1.03524 0.51223 0)
(1.00907 0.493604 0)
(0.987901 0.475959 0)
(0.970252 0.46166 0)
(0.954917 0.451727 0)
(0.941352 0.445943 0)
(0.929551 0.44334 0)
(0.919716 0.442753 0)
(0.911958 0.443195 0)
(0.906176 0.444006 0)
(0.902092 0.444828 0)
(0.899339 0.445515 0)
(0.89755 0.446034 0)
(0.896418 0.446405 0)
(0.895708 0.446663 0)
(0.895262 0.446839 0)
(0.894977 0.446959 0)
(0.894789 0.447041 0)
(0.894662 0.447096 0)
(0.894575 0.447133 0)
(0.894515 0.447158 0)
(0.894474 0.447174 0)
(0.894447 0.447184 0)
(0.894429 0.447191 0)
(0.894417 0.447195 0)
(0.89441 0.447197 0)
(0.894406 0.447198 0)
(0.894403 0.447199 0)
(0.894402 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894404 0.4472 0)
(0.894403 0.447201 0)
(0.894409 0.447202 0)
(0.894416 0.447205 0)
(0.894429 0.44721 0)
(0.894449 0.447217 0)
(0.894485 0.447231 0)
(0.894526 0.44725 0)
(0.894585 0.447281 0)
(0.894655 0.447317 0)
(0.894699 0.447361 0)
(0.894705 0.447389 0)
(0.894589 0.447365 0)
(0.894234 0.447218 0)
(0.893472 0.446778 0)
(0.892082 0.445819 0)
(0.889752 0.44395 0)
(0.886278 0.440568 0)
(0.881801 0.435103 0)
(0.877284 0.42739 0)
(0.874779 0.41785 0)
(0.876614 0.407248 0)
(0.884277 0.396134 0)
(0.898447 0.384591 0)
(0.919469 0.37272 0)
(0.947355 0.361323 0)
(0.981434 0.351956 0)
(1.01984 0.346645 0)
(1.05941 0.347513 0)
(1.09683 0.355963 0)
(1.12951 0.371991 0)
(1.15483 0.394348 0)
(1.16991 0.420723 0)
(1.17299 0.447763 0)
(1.1645 0.471829 0)
(1.14638 0.490238 0)
(1.12113 0.5017 0)
(1.09174 0.505851 0)
(1.06156 0.502964 0)
(1.03357 0.494202 0)
(1.00948 0.481761 0)
(0.989419 0.468414 0)
(0.97255 0.456666 0)
(0.957847 0.448051 0)
(0.944686 0.44293 0)
(0.932958 0.440759 0)
(0.92286 0.440577 0)
(0.914605 0.441441 0)
(0.908232 0.442661 0)
(0.903583 0.443842 0)
(0.900359 0.444815 0)
(0.898219 0.445548 0)
(0.896846 0.44607 0)
(0.895982 0.446433 0)
(0.895441 0.44668 0)
(0.895098 0.446849 0)
(0.894874 0.446964 0)
(0.894724 0.447043 0)
(0.894621 0.447097 0)
(0.894549 0.447133 0)
(0.894499 0.447158 0)
(0.894464 0.447174 0)
(0.89444 0.447184 0)
(0.894425 0.447191 0)
(0.894415 0.447195 0)
(0.894409 0.447197 0)
(0.894405 0.447198 0)
(0.894403 0.447199 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.4472 0)
(0.894402 0.447201 0)
(0.894408 0.447202 0)
(0.894412 0.447204 0)
(0.894426 0.447211 0)
(0.894441 0.447216 0)
(0.894472 0.447229 0)
(0.894508 0.44725 0)
(0.89456 0.447278 0)
(0.894623 0.447317 0)
(0.894666 0.447363 0)
(0.894692 0.447405 0)
(0.894618 0.447409 0)
(0.894371 0.447325 0)
(0.893827 0.447023 0)
(0.89279 0.446318 0)
(0.891036 0.4449 0)
(0.888375 0.442278 0)
(0.88472 0.437901 0)
(0.880553 0.431388 0)
(0.877332 0.42287 0)
(0.876986 0.413123 0)
(0.881107 0.402981 0)
(0.89067 0.392888 0)
(0.906106 0.383136 0)
(0.927325 0.37423 0)
(0.953578 0.367095 0)
(0.983321 0.363162 0)
(1.01443 0.363972 0)
(1.04458 0.370336 0)
(1.07121 0.382067 0)
(1.09146 0.398215 0)
(1.10315 0.417047 0)
(1.10566 0.436085 0)
(1.09971 0.452842 0)
(1.08663 0.465592 0)
(1.06818 0.47341 0)
(1.04671 0.475894 0)
(1.02483 0.473262 0)
(1.00459 0.466643 0)
(0.986936 0.457998 0)
(0.971709 0.449531 0)
(0.958269 0.442947 0)
(0.946067 0.439014 0)
(0.934944 0.437595 0)
(0.925065 0.437995 0)
(0.916698 0.439384 0)
(0.910003 0.441084 0)
(0.90495 0.442681 0)
(0.901338 0.443989 0)
(0.89888 0.444972 0)
(0.897273 0.445674 0)
(0.896252 0.44616 0)
(0.895613 0.446492 0)
(0.895212 0.446717 0)
(0.894954 0.446871 0)
(0.894784 0.446978 0)
(0.894666 0.447051 0)
(0.894584 0.447102 0)
(0.894525 0.447137 0)
(0.894483 0.44716 0)
(0.894454 0.447175 0)
(0.894434 0.447185 0)
(0.894421 0.447191 0)
(0.894412 0.447195 0)
(0.894407 0.447197 0)
(0.894404 0.447199 0)
(0.894402 0.447199 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.447201 0)
(0.894402 0.447199 0)
(0.894401 0.4472 0)
(0.894404 0.447202 0)
(0.894405 0.447201 0)
(0.89441 0.447206 0)
(0.894421 0.447207 0)
(0.894436 0.447215 0)
(0.894457 0.447227 0)
(0.894491 0.447244 0)
(0.894536 0.447273 0)
(0.894585 0.44731 0)
(0.894636 0.44736 0)
(0.894661 0.447403 0)
(0.894623 0.447434 0)
(0.894456 0.447395 0)
(0.894074 0.447198 0)
(0.893316 0.446704 0)
(0.892024 0.445658 0)
(0.89004 0.443688 0)
(0.887209 0.440339 0)
(0.883706 0.435103 0)
(0.880401 0.427836 0)
(0.878719 0.419075 0)
(0.880167 0.409695 0)
(0.885899 0.400417 0)
(0.896457 0.391738 0)
(0.911758 0.384134 0)
(0.931191 0.378295 0)
(0.953668 0.375162 0)
(0.977638 0.375545 0)
(1.00109 0.379794 0)
(1.02168 0.387833 0)
(1.03728 0.39907 0)
(1.04662 0.412154 0)
(1.04944 0.425244 0)
(1.04609 0.436691 0)
(1.03737 0.445391 0)
(1.02461 0.450654 0)
(1.0097 0.452163 0)
(0.994522 0.450227 0)
(0.98034 0.445954 0)
(0.967564 0.44097 0)
(0.955982 0.436825 0)
(0.945245 0.434461 0)
(0.935211 0.434052 0)
(0.926021 0.435172 0)
(0.91796 0.437149 0)
(0.911271 0.439363 0)
(0.90604 0.441403 0)
(0.902178 0.443071 0)
(0.899473 0.444331 0)
(0.897664 0.445233 0)
(0.896499 0.445857 0)
(0.895766 0.446282 0)
(0.895309 0.44657 0)
(0.895021 0.446767 0)
(0.894833 0.446903 0)
(0.894705 0.446998 0)
(0.894614 0.447064 0)
(0.894549 0.44711 0)
(0.894502 0.447142 0)
(0.894468 0.447163 0)
(0.894444 0.447177 0)
(0.894428 0.447186 0)
(0.894417 0.447192 0)
(0.89441 0.447195 0)
(0.894406 0.447197 0)
(0.894403 0.447199 0)
(0.894402 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894402 0.4472 0)
(0.894402 0.447201 0)
(0.894406 0.447202 0)
(0.894408 0.447203 0)
(0.894416 0.447207 0)
(0.894429 0.447214 0)
(0.894447 0.447223 0)
(0.894474 0.447242 0)
(0.894512 0.447265 0)
(0.894555 0.447301 0)
(0.894595 0.447347 0)
(0.89463 0.447395 0)
(0.894608 0.447436 0)
(0.894503 0.447431 0)
(0.894233 0.447314 0)
(0.893692 0.446983 0)
(0.892763 0.446236 0)
(0.89131 0.444804 0)
(0.889194 0.442314 0)
(0.886452 0.438303 0)
(0.883521 0.432456 0)
(0.881304 0.424967 0)
(0.881023 0.416494 0)
(0.883823 0.407817 0)
(0.890372 0.399646 0)
(0.900761 0.392596 0)
(0.914583 0.387247 0)
(0.931012 0.384122 0)
(0.948801 0.383616 0)
(0.966333 0.385977 0)
(0.981867 0.391196 0)
(0.993965 0.398728 0)
(1.00177 0.40747 0)
(1.00496 0.416179 0)
(1.00361 0.423867 0)
(0.998271 0.429812 0)
(0.990014 0.433486 0)
(0.980223 0.434716 0)
(0.970107 0.433924 0)
(0.960347 0.432096 0)
(0.951086 0.430409 0)
(0.94221 0.42976 0)
(0.933657 0.43048 0)
(0.925558 0.432372 0)
(0.918193 0.434936 0)
(0.911851 0.437644 0)
(0.906706 0.440107 0)
(0.902774 0.442127 0)
(0.899933 0.443665 0)
(0.897982 0.444772 0)
(0.8967 0.445541 0)
(0.895887 0.446064 0)
(0.895381 0.446417 0)
(0.895067 0.446657 0)
(0.894866 0.446823 0)
(0.894732 0.446939 0)
(0.894638 0.447021 0)
(0.89457 0.447079 0)
(0.894519 0.44712 0)
(0.894482 0.447148 0)
(0.894455 0.447167 0)
(0.894436 0.44718 0)
(0.894422 0.447188 0)
(0.894414 0.447193 0)
(0.894408 0.447196 0)
(0.894405 0.447198 0)
(0.894403 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.447201 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894403 0.447201 0)
(0.894403 0.447201 0)
(0.894408 0.447204 0)
(0.894412 0.447206 0)
(0.894422 0.44721 0)
(0.894439 0.447222 0)
(0.894459 0.447235 0)
(0.894489 0.447257 0)
(0.894526 0.447291 0)
(0.894563 0.44733 0)
(0.894589 0.44738 0)
(0.894586 0.447424 0)
(0.894515 0.447439 0)
(0.894336 0.447383 0)
(0.893948 0.447169 0)
(0.893291 0.446651 0)
(0.892245 0.445642 0)
(0.890711 0.443847 0)
(0.888668 0.440884 0)
(0.886301 0.436424 0)
(0.884124 0.430402 0)
(0.882993 0.423135 0)
(0.883867 0.415272 0)
(0.887449 0.407583 0)
(0.893987 0.40077 0)
(0.90328 0.395374 0)
(0.914754 0.391778 0)
(0.927492 0.390282 0)
(0.9403 0.391066 0)
(0.951921 0.394027 0)
(0.961323 0.398642 0)
(0.967832 0.404148 0)
(0.971095 0.40981 0)
(0.971098 0.415023 0)
(0.968254 0.419256 0)
(0.963345 0.422134 0)
(0.957269 0.423642 0)
(0.950709 0.424229 0)
(0.943999 0.424635 0)
(0.937216 0.425553 0)
(0.930395 0.427338 0)
(0.923677 0.429935 0)
(0.917325 0.433001 0)
(0.911636 0.436112 0)
(0.906841 0.438925 0)
(0.903039 0.441247 0)
(0.900197 0.443032 0)
(0.898186 0.444331 0)
(0.896834 0.445239 0)
(0.895963 0.445856 0)
(0.895419 0.446272 0)
(0.895085 0.446553 0)
(0.894876 0.446746 0)
(0.894742 0.44688 0)
(0.894649 0.446976 0)
(0.894582 0.447045 0)
(0.894532 0.447095 0)
(0.894493 0.44713 0)
(0.894465 0.447155 0)
(0.894443 0.447172 0)
(0.894428 0.447182 0)
(0.894418 0.447189 0)
(0.894411 0.447194 0)
(0.894407 0.447196 0)
(0.894404 0.447198 0)
(0.894402 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.447201 0)
(0.894402 0.447201 0)
(0.894407 0.447203 0)
(0.894408 0.447205 0)
(0.894419 0.44721 0)
(0.894429 0.447217 0)
(0.894446 0.447231 0)
(0.894472 0.447249 0)
(0.894499 0.447277 0)
(0.89453 0.447315 0)
(0.894554 0.447356 0)
(0.894557 0.447405 0)
(0.894512 0.447431 0)
(0.894386 0.447408 0)
(0.894122 0.44728 0)
(0.893658 0.44694 0)
(0.892918 0.44624 0)
(0.891821 0.444978 0)
(0.890351 0.442861 0)
(0.888564 0.4396 0)
(0.886725 0.435016 0)
(0.885383 0.429174 0)
(0.885223 0.422476 0)
(0.886841 0.415562 0)
(0.890574 0.409094 0)
(0.896443 0.403615 0)
(0.904123 0.399533 0)
(0.91296 0.397147 0)
(0.922078 0.396583 0)
(0.930601 0.3977 0)
(0.937793 0.400123 0)
(0.943108 0.403391 0)
(0.94621 0.407062 0)
(0.947049 0.41071 0)
(0.945902 0.413946 0)
(0.943271 0.416547 0)
(0.939666 0.418597 0)
(0.935439 0.420448 0)
(0.930769 0.42253 0)
(0.925762 0.42512 0)
(0.920569 0.428224 0)
(0.915429 0.431619 0)
(0.910622 0.434977 0)
(0.9064 0.438009 0)
(0.902919 0.440536 0)
(0.900219 0.442505 0)
(0.898246 0.443957 0)
(0.896881 0.44498 0)
(0.895984 0.44568 0)
(0.895419 0.44615 0)
(0.895073 0.446465 0)
(0.894863 0.446679 0)
(0.894732 0.446829 0)
(0.894646 0.446936 0)
(0.894584 0.447014 0)
(0.894537 0.44707 0)
(0.894501 0.447112 0)
(0.894472 0.447141 0)
(0.89445 0.447162 0)
(0.894434 0.447176 0)
(0.894422 0.447185 0)
(0.894414 0.447191 0)
(0.894409 0.447195 0)
(0.894405 0.447197 0)
(0.894403 0.447198 0)
(0.894402 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447201 0)
(0.894401 0.4472 0)
(0.894403 0.447201 0)
(0.894403 0.447202 0)
(0.894408 0.447205 0)
(0.894414 0.447207 0)
(0.894421 0.447215 0)
(0.894437 0.447224 0)
(0.894455 0.447242 0)
(0.894476 0.447265 0)
(0.894502 0.447294 0)
(0.894523 0.447336 0)
(0.894524 0.447375 0)
(0.894497 0.447407 0)
(0.894412 0.44741 0)
(0.894229 0.447335 0)
(0.893906 0.447117 0)
(0.893382 0.446653 0)
(0.892619 0.445778 0)
(0.891581 0.444304 0)
(0.890288 0.442003 0)
(0.888878 0.438666 0)
(0.887659 0.434238 0)
(0.88708 0.428911 0)
(0.887589 0.423101 0)
(0.889528 0.41732 0)
(0.893028 0.412077 0)
(0.897929 0.407816 0)
(0.90381 0.404852 0)
(0.910101 0.403304 0)
(0.916212 0.403092 0)
(0.921604 0.40401 0)
(0.925824 0.405804 0)
(0.928578 0.408182 0)
(0.929804 0.410832 0)
(0.929657 0.413485 0)
(0.928412 0.41603 0)
(0.926322 0.418548 0)
(0.923566 0.421229 0)
(0.920274 0.424223 0)
(0.916592 0.427538 0)
(0.912726 0.431017 0)
(0.908923 0.434415 0)
(0.905425 0.437495 0)
(0.902415 0.440095 0)
(0.899987 0.442153 0)
(0.898146 0.443695 0)
(0.896832 0.444796 0)
(0.895945 0.445555 0)
(0.895378 0.446065 0)
(0.895032 0.446406 0)
(0.894825 0.446635 0)
(0.894702 0.446793 0)
(0.894625 0.446906 0)
(0.894572 0.446988 0)
(0.894533 0.447048 0)
(0.894501 0.447094 0)
(0.894475 0.447127 0)
(0.894454 0.447152 0)
(0.894438 0.447169 0)
(0.894426 0.44718 0)
(0.894417 0.447188 0)
(0.894411 0.447193 0)
(0.894407 0.447196 0)
(0.894404 0.447198 0)
(0.894402 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.447201 0)
(0.894403 0.447202 0)
(0.894406 0.447203 0)
(0.894409 0.447206 0)
(0.894418 0.447211 0)
(0.894427 0.447222 0)
(0.894441 0.44723 0)
(0.894458 0.447254 0)
(0.894477 0.447278 0)
(0.894493 0.44731 0)
(0.894498 0.447348 0)
(0.89448 0.447378 0)
(0.894418 0.447393 0)
(0.894291 0.447353 0)
(0.894065 0.447216 0)
(0.893704 0.44691 0)
(0.893173 0.446327 0)
(0.892455 0.445321 0)
(0.891544 0.443729 0)
(0.89052 0.441389 0)
(0.889555 0.438198 0)
(0.888916 0.434206 0)
(0.888917 0.42964 0)
(0.88983 0.424853 0)
(0.8918 0.42026 0)
(0.894783 0.416258 0)
(0.89856 0.41315 0)
(0.902788 0.411088 0)
(0.907067 0.410095 0)
(0.91099 0.4101 0)
(0.914205 0.410967 0)
(0.916487 0.412502 0)
(0.917766 0.414484 0)
(0.918098 0.41674 0)
(0.917595 0.419201 0)
(0.916372 0.421889 0)
(0.914535 0.424841 0)
(0.912203 0.428026 0)
(0.909539 0.431321 0)
(0.906745 0.434536 0)
(0.904032 0.437478 0)
(0.901583 0.440001 0)
(0.899518 0.442036 0)
(0.897889 0.44359 0)
(0.896685 0.444718 0)
(0.895848 0.445503 0)
(0.8953 0.446033 0)
(0.894963 0.446384 0)
(0.894766 0.446619 0)
(0.894653 0.446778 0)
(0.894588 0.44689 0)
(0.894547 0.446972 0)
(0.894518 0.447033 0)
(0.894494 0.44708 0)
(0.894473 0.447116 0)
(0.894455 0.447142 0)
(0.89444 0.447161 0)
(0.894428 0.447175 0)
(0.894419 0.447184 0)
(0.894412 0.44719 0)
(0.894408 0.447194 0)
(0.894405 0.447196 0)
(0.894403 0.447198 0)
(0.894402 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.447202 0)
(0.894404 0.447202 0)
(0.894407 0.447205 0)
(0.894413 0.447209 0)
(0.894419 0.447215 0)
(0.89443 0.447227 0)
(0.894444 0.44724 0)
(0.894456 0.447263 0)
(0.894468 0.447288 0)
(0.894472 0.447319 0)
(0.894461 0.447347 0)
(0.894418 0.447363 0)
(0.894325 0.447347 0)
(0.89417 0.447265 0)
(0.893919 0.447065 0)
(0.893554 0.446677 0)
(0.893055 0.446005 0)
(0.892432 0.44493 0)
(0.891718 0.44333 0)
(0.891014 0.441111 0)
(0.890471 0.438263 0)
(0.890292 0.434889 0)
(0.890671 0.431204 0)
(0.891738 0.427501 0)
(0.893511 0.424091 0)
(0.895884 0.421242 0)
(0.898653 0.419129 0)
(0.901555 0.417844 0)
(0.904309 0.417401 0)
(0.906664 0.417735 0)
(0.908445 0.41872 0)
(0.909572 0.420218 0)
(0.910037 0.422118 0)
(0.909871 0.424353 0)
(0.909125 0.42688 0)
(0.907874 0.429635 0)
(0.906233 0.432506 0)
(0.90435 0.435339 0)
(0.902393 0.437974 0)
(0.900524 0.44028 0)
(0.89887 0.442181 0)
(0.897506 0.443663 0)
(0.896455 0.44476 0)
(0.8957 0.445534 0)
(0.895193 0.44606 0)
(0.894877 0.446408 0)
(0.894692 0.446637 0)
(0.894591 0.446789 0)
(0.894539 0.446894 0)
(0.894511 0.44697 0)
(0.894493 0.447027 0)
(0.894478 0.447072 0)
(0.894464 0.447107 0)
(0.894451 0.447134 0)
(0.894439 0.447154 0)
(0.894429 0.44717 0)
(0.89442 0.44718 0)
(0.894414 0.447188 0)
(0.894409 0.447192 0)
(0.894406 0.447195 0)
(0.894404 0.447197 0)
(0.894402 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.894402 0.447202 0)
(0.894403 0.447202 0)
(0.894406 0.447203 0)
(0.894408 0.447206 0)
(0.894415 0.447212 0)
(0.894422 0.44722 0)
(0.894429 0.447232 0)
(0.894442 0.447248 0)
(0.89445 0.44727 0)
(0.894453 0.447291 0)
(0.894443 0.447318 0)
(0.894412 0.447334 0)
(0.894347 0.447326 0)
(0.894235 0.447276 0)
(0.894061 0.44715 0)
(0.893808 0.446893 0)
(0.89347 0.446447 0)
(0.893048 0.445734 0)
(0.892563 0.444659 0)
(0.892069 0.443158 0)
(0.891662 0.441203 0)
(0.891465 0.438829 0)
(0.891606 0.436157 0)
(0.892183 0.433375 0)
(0.893227 0.430709 0)
(0.89469 0.42837 0)
(0.896465 0.426527 0)
(0.898385 0.425295 0)
(0.900262 0.424719 0)
(0.901919 0.424783 0)
(0.903229 0.425422 0)
(0.904112 0.42655 0)
(0.904532 0.428091 0)
(0.904484 0.429972 0)
(0.903999 0.432111 0)
(0.903137 0.434404 0)
(0.901996 0.436721 0)
(0.900697 0.438927 0)
(0.899367 0.440905 0)
(0.89812 0.442579 0)
(0.897039 0.443916 0)
(0.896169 0.444926 0)
(0.895518 0.445651 0)
(0.895067 0.446149 0)
(0.894779 0.446477 0)
(0.89461 0.44669 0)
(0.894522 0.446828 0)
(0.894482 0.446919 0)
(0.894466 0.446984 0)
(0.89446 0.447033 0)
(0.894455 0.447072 0)
(0.89445 0.447104 0)
(0.894443 0.44713 0)
(0.894435 0.44715 0)
(0.894427 0.447165 0)
(0.89442 0.447177 0)
(0.894414 0.447185 0)
(0.89441 0.44719 0)
(0.894407 0.447194 0)
(0.894404 0.447196 0)
(0.894403 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894401 0.4472 0)
(0.894401 0.447202 0)
(0.894405 0.447203 0)
(0.894406 0.447205 0)
(0.89441 0.44721 0)
(0.894415 0.447214 0)
(0.894423 0.447225 0)
(0.894429 0.447236 0)
(0.894434 0.447251 0)
(0.894438 0.447273 0)
(0.894426 0.447288 0)
(0.894406 0.447303 0)
(0.89436 0.447302 0)
(0.894278 0.44727 0)
(0.894153 0.447186 0)
(0.893981 0.44702 0)
(0.893753 0.446726 0)
(0.893465 0.446249 0)
(0.89314 0.445543 0)
(0.892812 0.44455 0)
(0.892531 0.443239 0)
(0.892371 0.44163 0)
(0.89242 0.439783 0)
(0.892737 0.437816 0)
(0.893353 0.435876 0)
(0.89426 0.434118 0)
(0.895388 0.432682 0)
(0.896634 0.431671 0)
(0.897878 0.431144 0)
(0.899004 0.43111 0)
(0.899917 0.431541 0)
(0.900547 0.432386 0)
(0.900857 0.433582 0)
(0.900834 0.435058 0)
(0.900497 0.436724 0)
(0.899899 0.438475 0)
(0.899115 0.440199 0)
(0.898235 0.441792 0)
(0.897352 0.443179 0)
(0.896542 0.444317 0)
(0.895857 0.445198 0)
(0.895322 0.445843 0)
(0.894937 0.446291 0)
(0.894683 0.446587 0)
(0.894532 0.446775 0)
(0.894455 0.446892 0)
(0.894424 0.446966 0)
(0.894418 0.447016 0)
(0.894421 0.447054 0)
(0.894427 0.447084 0)
(0.894431 0.447109 0)
(0.894431 0.44713 0)
(0.894428 0.447148 0)
(0.894424 0.447163 0)
(0.894419 0.447174 0)
(0.894414 0.447183 0)
(0.89441 0.447189 0)
(0.894407 0.447193 0)
(0.894404 0.447196 0)
(0.894403 0.447197 0)
(0.894402 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.447201 0)
(0.894402 0.447201 0)
(0.894402 0.447202 0)
(0.894405 0.447204 0)
(0.894406 0.447206 0)
(0.894411 0.447212 0)
(0.894415 0.447217 0)
(0.89442 0.447227 0)
(0.894423 0.447239 0)
(0.894423 0.447251 0)
(0.894418 0.447267 0)
(0.894398 0.447275 0)
(0.894363 0.447276 0)
(0.894307 0.447257 0)
(0.894219 0.447199 0)
(0.894098 0.447086 0)
(0.893939 0.44689 0)
(0.893748 0.44658 0)
(0.893536 0.446115 0)
(0.893318 0.445462 0)
(0.893133 0.444606 0)
(0.893028 0.443544 0)
(0.893048 0.442313 0)
(0.893235 0.440985 0)
(0.893615 0.439652 0)
(0.894178 0.438421 0)
(0.894891 0.437394 0)
(0.895693 0.436656 0)
(0.896505 0.436258 0)
(0.897247 0.436219 0)
(0.897852 0.436528 0)
(0.898268 0.437155 0)
(0.898464 0.43805 0)
(0.898431 0.439147 0)
(0.898184 0.440365 0)
(0.897765 0.441617 0)
(0.89723 0.442818 0)
(0.896644 0.443901 0)
(0.896069 0.444817 0)
(0.895554 0.445545 0)
(0.895132 0.44609 0)
(0.894814 0.446473 0)
(0.894596 0.446726 0)
(0.894464 0.446884 0)
(0.894396 0.446977 0)
(0.894371 0.447031 0)
(0.894371 0.447064 0)
(0.894383 0.447086 0)
(0.894396 0.447104 0)
(0.894407 0.447121 0)
(0.894414 0.447136 0)
(0.894417 0.447151 0)
(0.894417 0.447163 0)
(0.894415 0.447173 0)
(0.894412 0.447181 0)
(0.894409 0.447187 0)
(0.894407 0.447192 0)
(0.894405 0.447195 0)
(0.894403 0.447197 0)
(0.894402 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447201 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894402 0.447201 0)
(0.894403 0.447203 0)
(0.894404 0.447204 0)
(0.894407 0.447208 0)
(0.89441 0.447213 0)
(0.894413 0.447219 0)
(0.894417 0.447227 0)
(0.894415 0.447238 0)
(0.894409 0.447247 0)
(0.894396 0.447255 0)
(0.89437 0.447253 0)
(0.894327 0.447238 0)
(0.894265 0.447201 0)
(0.894178 0.447122 0)
(0.894069 0.446992 0)
(0.893942 0.446782 0)
(0.893801 0.446476 0)
(0.893662 0.446053 0)
(0.893547 0.445498 0)
(0.893481 0.444812 0)
(0.893498 0.444015 0)
(0.89362 0.443148 0)
(0.893863 0.442275 0)
(0.894225 0.441463 0)
(0.894681 0.440784 0)
(0.895192 0.440295 0)
(0.895711 0.440037 0)
(0.896187 0.440028 0)
(0.896572 0.440266 0)
(0.896829 0.440728 0)
(0.896936 0.441376 0)
(0.896889 0.442156 0)
(0.896702 0.443005 0)
(0.896406 0.443858 0)
(0.896041 0.444654 0)
(0.895653 0.445352 0)
(0.895283 0.445922 0)
(0.894963 0.446359 0)
(0.89471 0.446671 0)
(0.894529 0.446878 0)
(0.894414 0.447004 0)
(0.894353 0.447073 0)
(0.894332 0.447106 0)
(0.894334 0.447122 0)
(0.894349 0.447129 0)
(0.894368 0.447135 0)
(0.894384 0.447141 0)
(0.894397 0.447149 0)
(0.894405 0.447157 0)
(0.894409 0.447166 0)
(0.89441 0.447174 0)
(0.894409 0.447181 0)
(0.894408 0.447187 0)
(0.894406 0.447191 0)
(0.894404 0.447194 0)
(0.894403 0.447196 0)
(0.894402 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894402 0.447201 0)
(0.8944 0.447201 0)
(0.894402 0.447201 0)
(0.894401 0.447201 0)
(0.894403 0.447203 0)
(0.894405 0.447206 0)
(0.894406 0.447209 0)
(0.89441 0.447214 0)
(0.894408 0.447219 0)
(0.894411 0.447226 0)
(0.894403 0.447232 0)
(0.894395 0.447236 0)
(0.894374 0.447236 0)
(0.894342 0.447225 0)
(0.894296 0.447194 0)
(0.894236 0.447141 0)
(0.894162 0.447049 0)
(0.894073 0.446907 0)
(0.89398 0.446705 0)
(0.893893 0.446428 0)
(0.893823 0.446069 0)
(0.893788 0.445632 0)
(0.893808 0.445126 0)
(0.893894 0.444582 0)
(0.894059 0.444032 0)
(0.894296 0.443522 0)
(0.894591 0.4431 0)
(0.894921 0.442804 0)
(0.895251 0.442664 0)
(0.895549 0.442692 0)
(0.895785 0.442886 0)
(0.895933 0.443229 0)
(0.895979 0.443689 0)
(0.895922 0.444226 0)
(0.895777 0.444796 0)
(0.895566 0.445353 0)
(0.895319 0.445859 0)
(0.895065 0.446287 0)
(0.894829 0.446622 0)
(0.894631 0.446866 0)
(0.894482 0.447027 0)
(0.894383 0.447121 0)
(0.894327 0.447167 0)
(0.894305 0.447184 0)
(0.894307 0.447184 0)
(0.894323 0.447178 0)
(0.894343 0.447171 0)
(0.894363 0.447167 0)
(0.89438 0.447166 0)
(0.894392 0.447168 0)
(0.8944 0.447172 0)
(0.894404 0.447178 0)
(0.894405 0.447183 0)
(0.894405 0.447187 0)
(0.894405 0.447191 0)
(0.894404 0.447194 0)
(0.894403 0.447196 0)
(0.894402 0.447197 0)
(0.894401 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.894402 0.447201 0)
(0.894402 0.447202 0)
(0.894403 0.447204 0)
(0.894405 0.447206 0)
(0.894404 0.447209 0)
(0.894407 0.447213 0)
(0.894404 0.447218 0)
(0.894403 0.447222 0)
(0.894391 0.447224 0)
(0.894379 0.447222 0)
(0.894355 0.447212 0)
(0.894322 0.447192 0)
(0.894278 0.447149 0)
(0.894225 0.447085 0)
(0.894166 0.446989 0)
(0.894105 0.44685 0)
(0.894048 0.446668 0)
(0.894008 0.446437 0)
(0.893994 0.446158 0)
(0.894015 0.445842 0)
(0.894082 0.445504 0)
(0.894195 0.44517 0)
(0.894355 0.444867 0)
(0.894551 0.444624 0)
(0.894764 0.444466 0)
(0.894976 0.444409 0)
(0.895161 0.444462 0)
(0.895298 0.444623 0)
(0.895375 0.444877 0)
(0.895386 0.445201 0)
(0.89533 0.445567 0)
(0.895218 0.445939 0)
(0.895066 0.446291 0)
(0.894895 0.446599 0)
(0.894727 0.446847 0)
(0.894577 0.447031 0)
(0.894458 0.447153 0)
(0.894372 0.447223 0)
(0.89432 0.447253 0)
(0.894297 0.447255 0)
(0.894296 0.447244 0)
(0.894308 0.447226 0)
(0.894327 0.447209 0)
(0.894347 0.447196 0)
(0.894365 0.447187 0)
(0.894379 0.447182 0)
(0.89439 0.447182 0)
(0.894397 0.447183 0)
(0.894401 0.447186 0)
(0.894403 0.447189 0)
(0.894403 0.447192 0)
(0.894403 0.447194 0)
(0.894403 0.447196 0)
(0.894402 0.447197 0)
(0.894401 0.447198 0)
(0.894401 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.447201 0)
(0.894399 0.4472 0)
(0.894401 0.447201 0)
(0.8944 0.447201 0)
(0.894401 0.447201 0)
(0.894402 0.447203 0)
(0.894402 0.447203 0)
(0.894403 0.447206 0)
(0.894403 0.447209 0)
(0.894403 0.447211 0)
(0.894398 0.447214 0)
(0.894394 0.447215 0)
(0.894381 0.447213 0)
(0.894365 0.447204 0)
(0.894342 0.447186 0)
(0.894311 0.447158 0)
(0.894272 0.447109 0)
(0.89423 0.44704 0)
(0.89419 0.446946 0)
(0.894155 0.446823 0)
(0.894131 0.446672 0)
(0.894126 0.446495 0)
(0.894148 0.446298 0)
(0.894199 0.446093 0)
(0.894283 0.445895 0)
(0.894395 0.445725 0)
(0.894526 0.445596 0)
(0.894664 0.445524 0)
(0.894798 0.44552 0)
(0.894911 0.445588 0)
(0.894992 0.445722 0)
(0.895028 0.44591 0)
(0.895018 0.446136 0)
(0.894966 0.446381 0)
(0.89488 0.446622 0)
(0.894772 0.446839 0)
(0.894656 0.447021 0)
(0.894544 0.447157 0)
(0.894448 0.447248 0)
(0.894375 0.447299 0)
(0.894327 0.447317 0)
(0.894302 0.447312 0)
(0.894296 0.447294 0)
(0.894303 0.447269 0)
(0.894318 0.447245 0)
(0.894336 0.447225 0)
(0.894354 0.447209 0)
(0.89437 0.447199 0)
(0.894382 0.447193 0)
(0.89439 0.44719 0)
(0.894396 0.44719 0)
(0.894399 0.447191 0)
(0.894401 0.447193 0)
(0.894401 0.447195 0)
(0.894401 0.447196 0)
(0.894401 0.447197 0)
(0.894401 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894402 0.447201 0)
(0.894402 0.447203 0)
(0.894402 0.447204 0)
(0.894402 0.447206 0)
(0.894401 0.447207 0)
(0.894398 0.447209 0)
(0.894394 0.447208 0)
(0.894387 0.447206 0)
(0.894373 0.447199 0)
(0.894355 0.447186 0)
(0.894333 0.447163 0)
(0.894309 0.447127 0)
(0.894279 0.447078 0)
(0.894251 0.447012 0)
(0.894229 0.446928 0)
(0.894216 0.446827 0)
(0.894216 0.446712 0)
(0.894235 0.44659 0)
(0.894277 0.446468 0)
(0.894337 0.446355 0)
(0.894415 0.446261 0)
(0.894505 0.4462 0)
(0.894599 0.44618 0)
(0.894685 0.446205 0)
(0.894753 0.446275 0)
(0.894797 0.446385 0)
(0.894812 0.446527 0)
(0.894796 0.446687 0)
(0.894751 0.446849 0)
(0.894685 0.447002 0)
(0.894606 0.447134 0)
(0.894525 0.447236 0)
(0.894452 0.447306 0)
(0.894391 0.447346 0)
(0.894347 0.447359 0)
(0.89432 0.447351 0)
(0.894309 0.44733 0)
(0.89431 0.447303 0)
(0.894319 0.447275 0)
(0.894334 0.44725 0)
(0.894349 0.44723 0)
(0.894363 0.447215 0)
(0.894375 0.447205 0)
(0.894385 0.447199 0)
(0.894391 0.447196 0)
(0.894396 0.447195 0)
(0.894399 0.447195 0)
(0.8944 0.447196 0)
(0.894401 0.447197 0)
(0.894401 0.447198 0)
(0.894401 0.447198 0)
(0.894401 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894401 0.447201 0)
(0.894401 0.447202 0)
(0.894401 0.447202 0)
(0.894401 0.447203 0)
(0.8944 0.447204 0)
(0.894399 0.447205 0)
(0.894395 0.447205 0)
(0.894389 0.447202 0)
(0.89438 0.447197 0)
(0.894368 0.447187 0)
(0.894352 0.447168 0)
(0.894332 0.447142 0)
(0.894314 0.447106 0)
(0.894295 0.447059 0)
(0.894278 0.447 0)
(0.894272 0.446933 0)
(0.894276 0.446858 0)
(0.894292 0.44678 0)
(0.894321 0.446706 0)
(0.894365 0.446642 0)
(0.894422 0.446596 0)
(0.894483 0.446575 0)
(0.894546 0.446581 0)
(0.894601 0.446616 0)
(0.894644 0.44668 0)
(0.894668 0.446768 0)
(0.894671 0.446873 0)
(0.894652 0.446985 0)
(0.894616 0.447095 0)
(0.894568 0.447193 0)
(0.894513 0.447272 0)
(0.894457 0.447328 0)
(0.894408 0.447361 0)
(0.894368 0.447372 0)
(0.894341 0.447366 0)
(0.894326 0.447348 0)
(0.894322 0.447323 0)
(0.894327 0.447296 0)
(0.894336 0.44727 0)
(0.894348 0.447247 0)
(0.89436 0.447229 0)
(0.894371 0.447216 0)
(0.894381 0.447207 0)
(0.894388 0.447202 0)
(0.894393 0.447199 0)
(0.894396 0.447198 0)
(0.894399 0.447197 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.894401 0.447198 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.894401 0.447201 0)
(0.894401 0.447202 0)
(0.8944 0.447203 0)
(0.894398 0.447203 0)
(0.894396 0.447202 0)
(0.894392 0.447201 0)
(0.894385 0.447195 0)
(0.894377 0.447187 0)
(0.894365 0.447174 0)
(0.894354 0.447155 0)
(0.894339 0.447128 0)
(0.894327 0.447094 0)
(0.894317 0.447054 0)
(0.894313 0.447007 0)
(0.894315 0.446957 0)
(0.894328 0.446908 0)
(0.894352 0.446863 0)
(0.894384 0.446827 0)
(0.894423 0.446805 0)
(0.894466 0.446802 0)
(0.894508 0.446819 0)
(0.894544 0.446856 0)
(0.894569 0.446912 0)
(0.894583 0.446982 0)
(0.894581 0.44706 0)
(0.894566 0.447139 0)
(0.894538 0.447212 0)
(0.894501 0.447275 0)
(0.894462 0.447322 0)
(0.894424 0.447353 0)
(0.894391 0.447366 0)
(0.894366 0.447364 0)
(0.89435 0.447351 0)
(0.894341 0.44733 0)
(0.89434 0.447306 0)
(0.894345 0.447282 0)
(0.894352 0.447259 0)
(0.894361 0.447241 0)
(0.89437 0.447226 0)
(0.894379 0.447215 0)
(0.894386 0.447208 0)
(0.894391 0.447203 0)
(0.894395 0.447201 0)
(0.894397 0.447199 0)
(0.894398 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894401 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.894397 0.447201 0)
(0.894394 0.447199 0)
(0.89439 0.447196 0)
(0.894383 0.44719 0)
(0.894376 0.447179 0)
(0.894367 0.447165 0)
(0.894358 0.447147 0)
(0.894349 0.447122 0)
(0.894342 0.447093 0)
(0.89434 0.44706 0)
(0.894343 0.447027 0)
(0.894353 0.446995 0)
(0.894369 0.446967 0)
(0.894391 0.446948 0)
(0.894419 0.446939 0)
(0.894448 0.446944 0)
(0.894476 0.446963 0)
(0.894501 0.446997 0)
(0.894518 0.447042 0)
(0.894525 0.447095 0)
(0.894521 0.447151 0)
(0.894507 0.447207 0)
(0.894487 0.447257 0)
(0.894462 0.447298 0)
(0.894434 0.447326 0)
(0.894408 0.447341 0)
(0.894386 0.447344 0)
(0.894369 0.447338 0)
(0.894359 0.447324 0)
(0.894355 0.447305 0)
(0.894355 0.447285 0)
(0.894359 0.447266 0)
(0.894365 0.447248 0)
(0.894372 0.447233 0)
(0.894379 0.447221 0)
(0.894385 0.447213 0)
(0.894389 0.447207 0)
(0.894393 0.447203 0)
(0.894396 0.447201 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.894398 0.447201 0)
(0.894399 0.4472 0)
(0.894395 0.447198 0)
(0.894392 0.447196 0)
(0.894389 0.447191 0)
(0.894383 0.447185 0)
(0.894377 0.447174 0)
(0.894372 0.44716 0)
(0.894365 0.447143 0)
(0.894362 0.447122 0)
(0.894359 0.447101 0)
(0.894361 0.447077 0)
(0.894368 0.447056 0)
(0.89438 0.447039 0)
(0.894396 0.447027 0)
(0.894415 0.447025 0)
(0.894435 0.447033 0)
(0.894455 0.44705 0)
(0.894469 0.447077 0)
(0.894479 0.447111 0)
(0.894484 0.447152 0)
(0.89448 0.447193 0)
(0.894471 0.447233 0)
(0.894456 0.447267 0)
(0.894437 0.447293 0)
(0.894418 0.44731 0)
(0.894401 0.447318 0)
(0.894387 0.447317 0)
(0.894376 0.447309 0)
(0.89437 0.447297 0)
(0.894368 0.447282 0)
(0.894368 0.447265 0)
(0.894371 0.44725 0)
(0.894376 0.447236 0)
(0.89438 0.447225 0)
(0.894385 0.447217 0)
(0.894389 0.44721 0)
(0.894393 0.447206 0)
(0.894395 0.447203 0)
(0.894397 0.447201 0)
(0.894398 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.894399 0.447199 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894398 0.4472 0)
(0.894397 0.447199 0)
(0.894396 0.447197 0)
(0.894392 0.447194 0)
(0.894389 0.447188 0)
(0.894384 0.447181 0)
(0.894381 0.447171 0)
(0.894376 0.447159 0)
(0.894373 0.447146 0)
(0.894372 0.44713 0)
(0.894375 0.447114 0)
(0.89438 0.4471 0)
(0.894387 0.447088 0)
(0.894398 0.447083 0)
(0.89441 0.447083 0)
(0.894424 0.44709 0)
(0.894437 0.447104 0)
(0.894449 0.447125 0)
(0.894455 0.447151 0)
(0.894456 0.447179 0)
(0.894453 0.447209 0)
(0.894446 0.447236 0)
(0.894436 0.447259 0)
(0.894424 0.447276 0)
(0.894411 0.447287 0)
(0.894399 0.44729 0)
(0.894389 0.447288 0)
(0.894383 0.447282 0)
(0.894378 0.447272 0)
(0.894377 0.44726 0)
(0.894378 0.447248 0)
(0.89438 0.447237 0)
(0.894383 0.447227 0)
(0.894387 0.447219 0)
(0.89439 0.447212 0)
(0.894393 0.447208 0)
(0.894395 0.447205 0)
(0.894397 0.447203 0)
(0.894398 0.447201 0)
(0.894399 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.894399 0.447199 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.894398 0.447199 0)
(0.894396 0.447197 0)
(0.894395 0.447195 0)
(0.894393 0.447192 0)
(0.89439 0.447187 0)
(0.894387 0.44718 0)
(0.894385 0.447172 0)
(0.894383 0.447162 0)
(0.894383 0.447151 0)
(0.894383 0.447141 0)
(0.894386 0.447131 0)
(0.894392 0.447124 0)
(0.894399 0.44712 0)
(0.894408 0.447121 0)
(0.894417 0.447127 0)
(0.894424 0.447137 0)
(0.894431 0.447153 0)
(0.894435 0.447172 0)
(0.894436 0.447193 0)
(0.894435 0.447213 0)
(0.89443 0.447231 0)
(0.894422 0.447247 0)
(0.894414 0.447258 0)
(0.894406 0.447265 0)
(0.894398 0.447267 0)
(0.894392 0.447264 0)
(0.894388 0.447259 0)
(0.894386 0.447252 0)
(0.894385 0.447243 0)
(0.894385 0.447234 0)
(0.894387 0.447226 0)
(0.894389 0.447219 0)
(0.894391 0.447213 0)
(0.894393 0.447209 0)
(0.894395 0.447206 0)
(0.894397 0.447203 0)
(0.894398 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.447201 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.894398 0.447199 0)
(0.894397 0.447196 0)
(0.894395 0.447194 0)
(0.894394 0.447191 0)
(0.894391 0.447187 0)
(0.89439 0.44718 0)
(0.894388 0.447174 0)
(0.894388 0.447168 0)
(0.894389 0.44716 0)
(0.894391 0.447154 0)
(0.894395 0.447149 0)
(0.894399 0.447147 0)
(0.894405 0.447148 0)
(0.894411 0.447152 0)
(0.894417 0.44716 0)
(0.894421 0.447171 0)
(0.894423 0.447184 0)
(0.894424 0.447197 0)
(0.894422 0.447211 0)
(0.894419 0.447224 0)
(0.894415 0.447235 0)
(0.894409 0.447242 0)
(0.894404 0.447246 0)
(0.894399 0.447247 0)
(0.894395 0.447245 0)
(0.894392 0.447241 0)
(0.89439 0.447235 0)
(0.89439 0.44723 0)
(0.89439 0.447224 0)
(0.894391 0.447218 0)
(0.894393 0.447213 0)
(0.894394 0.447209 0)
(0.894396 0.447206 0)
(0.894397 0.447204 0)
(0.894398 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447199 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894397 0.447196 0)
(0.894396 0.447194 0)
(0.894395 0.447191 0)
(0.894394 0.447187 0)
(0.894393 0.447183 0)
(0.894393 0.447178 0)
(0.894394 0.447173 0)
(0.894395 0.447169 0)
(0.894396 0.447166 0)
(0.8944 0.447165 0)
(0.894403 0.447165 0)
(0.894407 0.447168 0)
(0.89441 0.447174 0)
(0.894413 0.447181 0)
(0.894415 0.44719 0)
(0.894415 0.4472 0)
(0.894414 0.447209 0)
(0.894412 0.447217 0)
(0.894408 0.447224 0)
(0.894405 0.447229 0)
(0.894402 0.447232 0)
(0.894399 0.447232 0)
(0.894397 0.44723 0)
(0.894395 0.447228 0)
(0.894394 0.447224 0)
(0.894394 0.44722 0)
(0.894394 0.447216 0)
(0.894395 0.447212 0)
(0.894396 0.447209 0)
(0.894397 0.447206 0)
(0.894397 0.447204 0)
(0.894398 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447199 0)
(0.894399 0.447198 0)
(0.894398 0.447198 0)
(0.894398 0.447196 0)
(0.894397 0.447194 0)
(0.894396 0.447192 0)
(0.894396 0.447189 0)
(0.894395 0.447186 0)
(0.894395 0.447183 0)
(0.894396 0.447181 0)
(0.894397 0.447178 0)
(0.8944 0.447177 0)
(0.894402 0.447178 0)
(0.894404 0.44718 0)
(0.894406 0.447184 0)
(0.894408 0.447188 0)
(0.894409 0.447194 0)
(0.89441 0.4472 0)
(0.894409 0.447206 0)
(0.894407 0.447212 0)
(0.894405 0.447216 0)
(0.894403 0.447219 0)
(0.894401 0.447221 0)
(0.894399 0.447221 0)
(0.894397 0.44722 0)
(0.894396 0.447218 0)
(0.894396 0.447215 0)
(0.894396 0.447213 0)
(0.894396 0.44721 0)
(0.894397 0.447208 0)
(0.894397 0.447206 0)
(0.894398 0.447204 0)
(0.894398 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.894399 0.447199 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894398 0.447196 0)
(0.894398 0.447195 0)
(0.894397 0.447193 0)
(0.894397 0.447191 0)
(0.894398 0.447189 0)
(0.894398 0.447187 0)
(0.894399 0.447186 0)
(0.894399 0.447185 0)
(0.894401 0.447186 0)
(0.894402 0.447187 0)
(0.894404 0.447189 0)
(0.894405 0.447193 0)
(0.894405 0.447196 0)
(0.894405 0.4472 0)
(0.894405 0.447204 0)
(0.894404 0.447208 0)
(0.894403 0.447211 0)
(0.894402 0.447212 0)
(0.894401 0.447213 0)
(0.894399 0.447214 0)
(0.894399 0.447213 0)
(0.894398 0.447212 0)
(0.894398 0.44721 0)
(0.894398 0.447208 0)
(0.894398 0.447206 0)
(0.894398 0.447205 0)
(0.894398 0.447204 0)
(0.894399 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894399 0.447197 0)
(0.894399 0.447196 0)
(0.894399 0.447194 0)
(0.894398 0.447193 0)
(0.894399 0.447193 0)
(0.894399 0.447192 0)
(0.8944 0.447191 0)
(0.8944 0.447191 0)
(0.894402 0.447192 0)
(0.894402 0.447193 0)
(0.894403 0.447196 0)
(0.894404 0.447198 0)
(0.894404 0.447201 0)
(0.894403 0.447203 0)
(0.894403 0.447205 0)
(0.894402 0.447207 0)
(0.894401 0.447208 0)
(0.8944 0.447208 0)
(0.894399 0.447208 0)
(0.894399 0.447208 0)
(0.894399 0.447207 0)
(0.894399 0.447206 0)
(0.894399 0.447205 0)
(0.894399 0.447204 0)
(0.894399 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.447198 0)
(0.894399 0.447197 0)
(0.894399 0.447196 0)
(0.8944 0.447196 0)
(0.894399 0.447195 0)
(0.8944 0.447194 0)
(0.8944 0.447194 0)
(0.8944 0.447194 0)
(0.894401 0.447195 0)
(0.894401 0.447196 0)
(0.894402 0.447197 0)
(0.894402 0.447199 0)
(0.894402 0.4472 0)
(0.894402 0.447202 0)
(0.894401 0.447203 0)
(0.894401 0.447204 0)
(0.8944 0.447205 0)
(0.8944 0.447205 0)
(0.8944 0.447206 0)
(0.8944 0.447205 0)
(0.894399 0.447205 0)
(0.894399 0.447204 0)
(0.894399 0.447203 0)
(0.894399 0.447202 0)
(0.894399 0.447202 0)
(0.894399 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.894399 0.447199 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.894399 0.447198 0)
(0.8944 0.447197 0)
(0.8944 0.447197 0)
(0.8944 0.447197 0)
(0.894401 0.447197 0)
(0.8944 0.447197 0)
(0.894401 0.447198 0)
(0.894401 0.447198 0)
(0.894401 0.447199 0)
(0.894401 0.4472 0)
(0.894401 0.447201 0)
(0.894401 0.447202 0)
(0.894401 0.447202 0)
(0.894401 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447199 0)
(0.894401 0.4472 0)
(0.894401 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894399 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.8944 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.8944 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.447198 0)
(0.894401 0.447198 0)
(0.894401 0.447197 0)
(0.894401 0.447197 0)
(0.8944 0.447197 0)
(0.8944 0.447197 0)
(0.8944 0.447197 0)
(0.894399 0.447197 0)
(0.894399 0.447198 0)
(0.894399 0.447198 0)
(0.894399 0.447199 0)
(0.894399 0.4472 0)
(0.894399 0.447201 0)
(0.894399 0.447202 0)
(0.894399 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447203 0)
(0.8944 0.447203 0)
(0.894401 0.447203 0)
(0.894401 0.447202 0)
(0.894401 0.447202 0)
(0.894401 0.447202 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.447198 0)
(0.894401 0.447198 0)
(0.894401 0.447197 0)
(0.894401 0.447196 0)
(0.894401 0.447196 0)
(0.894401 0.447195 0)
(0.8944 0.447195 0)
(0.8944 0.447194 0)
(0.8944 0.447195 0)
(0.894399 0.447195 0)
(0.894398 0.447196 0)
(0.894398 0.447197 0)
(0.894398 0.447199 0)
(0.894398 0.4472 0)
(0.894398 0.447202 0)
(0.894398 0.447203 0)
(0.894399 0.447204 0)
(0.894399 0.447205 0)
(0.8944 0.447205 0)
(0.8944 0.447205 0)
(0.894401 0.447205 0)
(0.894401 0.447205 0)
(0.894401 0.447204 0)
(0.894401 0.447203 0)
(0.894401 0.447203 0)
(0.894401 0.447202 0)
(0.894401 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.894401 0.447199 0)
(0.894401 0.447199 0)
(0.894401 0.447198 0)
(0.894401 0.447198 0)
(0.894401 0.447196 0)
(0.894402 0.447196 0)
(0.894402 0.447194 0)
(0.894402 0.447193 0)
(0.894401 0.447192 0)
(0.894401 0.447191 0)
(0.8944 0.447191 0)
(0.894399 0.447191 0)
(0.894398 0.447192 0)
(0.894397 0.447194 0)
(0.894397 0.447196 0)
(0.894396 0.447198 0)
(0.894396 0.447201 0)
(0.894397 0.447204 0)
(0.894397 0.447206 0)
(0.894398 0.447207 0)
(0.894399 0.447208 0)
(0.8944 0.447209 0)
(0.894401 0.447209 0)
(0.894401 0.447208 0)
(0.894401 0.447207 0)
(0.894402 0.447206 0)
(0.894402 0.447205 0)
(0.894401 0.447204 0)
(0.894401 0.447203 0)
(0.894401 0.447202 0)
(0.894401 0.447202 0)
(0.894401 0.447201 0)
(0.8944 0.447201 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
(0.8944 0.4472 0)
)
;
boundaryField
{
emptyPatches_empt
{
type empty;
}
top_cyc
{
type cyclic;
}
bottom_cyc
{
type cyclic;
}
inlet_cyc
{
type cyclic;
}
outlet_cyc
{
type cyclic;
}
}
// ************************************************************************* //
| [
"tdg@debian"
] | tdg@debian | |
fc2517e43126f82c870fcc19626a8f1edcb9efbc | d83724c96fe82d41bf0e22370ee869febd50e8a3 | /ipp-UIC.7.1.1.013/sources/uic/application/uic_transcoder_con/src/dicom.cpp | 39a67e401be888c6fe545215ab1ef82894aad508 | [] | no_license | vinnie38170/klImageCore | e06b79b61d51d0952a4dca68ad23e40daeff40c3 | 3514aef281f635c7f48699dbfe2a1844f142e03f | refs/heads/master | 2021-01-20T23:03:52.131054 | 2014-07-12T17:52:39 | 2014-07-12T17:52:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 40,373 | cpp | /*
//
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 2001-2012 Intel Corporation. All Rights Reserved.
//
*/
#if defined(_WIN32) && defined(_MSC_VER)
#pragma warning ( disable : 4127 4201 )
#endif
#ifdef WIN32
#ifdef _DEBUG
#include <crtdbg.h>
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#ifndef __IPPDEFS_H__
#include "ippdefs.h"
#endif
#ifndef __IPPCC_H__
#include "ippcc.h"
#endif
#ifndef __STDFILEIN_H__
#include "stdfilein.h"
#endif
#ifndef __MEMBUFFIN_H__
#include "membuffin.h"
#endif
#ifndef __JPEGBASE_H__
#include "jpegbase.h"
#endif
#ifndef __JPEG_H__
#include "jpeg.h"
#endif
#ifndef __JPEG2K_H__
#include "jpeg2k.h"
#endif
#ifndef __DICOM_H__
#include "dicom.h"
#endif
using namespace UIC;
#define DICOM_PREAMBLE 128
#define MAKE_VR(a,b) (((a) << 8) | (b))
typedef enum
{
VR_AE = MAKE_VR('A','E'),
VR_AS = MAKE_VR('A','S'),
VR_AT = MAKE_VR('A','T'),
VR_CS = MAKE_VR('C','S'),
VR_DA = MAKE_VR('D','A'),
VR_DS = MAKE_VR('D','S'),
VR_DT = MAKE_VR('D','T'),
VR_FL = MAKE_VR('F','L'),
VR_FD = MAKE_VR('F','D'),
VR_IS = MAKE_VR('I','S'),
VR_LO = MAKE_VR('L','O'),
VR_LT = MAKE_VR('L','T'),
VR_OB = MAKE_VR('O','B'),
VR_OF = MAKE_VR('O','F'),
VR_OW = MAKE_VR('O','W'),
VR_PN = MAKE_VR('P','N'),
VR_SH = MAKE_VR('S','H'),
VR_SL = MAKE_VR('S','L'),
VR_SQ = MAKE_VR('S','Q'),
VR_SS = MAKE_VR('S','S'),
VR_ST = MAKE_VR('S','T'),
VR_TM = MAKE_VR('T','M'),
VR_UI = MAKE_VR('U','I'),
VR_UL = MAKE_VR('U','L'),
VR_UN = MAKE_VR('U','N'),
VR_US = MAKE_VR('U','S'),
VR_UT = MAKE_VR('U','T'),
VR_OX = MAKE_VR(0,0)
} DICOM_VR;
typedef enum
{
DPC_PIXEL = 0,
DPC_PLANE = 1
} DICOM_ORDER;
typedef union
{
struct
{
unsigned short group;
unsigned short element;
};
unsigned int u;
} DICOM_TAG;
typedef union
{
DICOM_TAG* VR_AT;
double* VR_FD;
float* VR_FL;
unsigned int* VR_UL;
int* VR_SL;
unsigned char* VR_OB;
unsigned short* VR_OW;
float* VR_OF;
unsigned short* VR_US;
short* VR_SS;
char** VR_AE;
char** VR_AS;
char** VR_CS;
char** VR_DA;
char** VR_DS;
char** VR_DT;
char** VR_IS;
char** VR_LO;
char** VR_LT;
char** VR_PN;
char** VR_SH;
char** VR_ST;
char** VR_TM;
char** VR_UI;
char** VR_UT;
void* VR_SQ;
void* VR_UN;
} DICOM_VALUE;
typedef struct
{
DICOM_TAG tag;
DICOM_VR vr;
unsigned int length;
DICOM_VALUE value;
} DICOM_ELEMENT;
typedef struct
{
DICOM_TAG tag;
unsigned int length;
DICOM_VALUE value;
} DICOM_SEQ_ITEM;
const char* vr2str(DICOM_VR vr)
{
const char* str;
switch(vr)
{
case VR_AE: str = "AE"; break;
case VR_AS: str = "AS"; break;
case VR_AT: str = "AT"; break;
case VR_CS: str = "CS"; break;
case VR_DA: str = "DA"; break;
case VR_DS: str = "DS"; break;
case VR_DT: str = "DT"; break;
case VR_FL: str = "FL"; break;
case VR_FD: str = "FD"; break;
case VR_IS: str = "IS"; break;
case VR_LO: str = "LO"; break;
case VR_LT: str = "LT"; break;
case VR_OB: str = "OB"; break;
case VR_OF: str = "OF"; break;
case VR_OW: str = "OW"; break;
case VR_PN: str = "PN"; break;
case VR_SH: str = "SH"; break;
case VR_SL: str = "SL"; break;
case VR_SQ: str = "SQ"; break;
case VR_SS: str = "SS"; break;
case VR_ST: str = "ST"; break;
case VR_TM: str = "TM"; break;
case VR_UI: str = "UI"; break;
case VR_UL: str = "UL"; break;
case VR_UN: str = "UN"; break;
case VR_US: str = "US"; break;
case VR_UT: str = "UT"; break;
default: str = "unknown"; break;
}
return str;
} // vr2str()
BaseStream::TStatus read_dicom_i32(
BaseStreamInput& in,
int* val)
{
BaseStream::TSize cnt;
return in.Read(val,4,cnt);
} // read_dicom_i32()
BaseStream::TStatus read_dicom_tag(
BaseStreamInput& in,
DICOM_TAG* tag)
{
BaseStream::TSize cnt;
BaseStream::TStatus status;
status = in.Read(&tag->group,2,cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
status = in.Read(&tag->element,2,cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
#ifdef __LOG__
printf("TAG: 0x%04X, {group:element:0x%02X:0x%02X}\n",tag->u,tag->group,tag->element);
#endif
return BaseStream::StatusOk;
} // read_dicom_tag()
BaseStream::TStatus read_dicom_vr(
BaseStreamInput& in,
DICOM_VR* vr)
{
unsigned char bh;
unsigned char bl;
BaseStream::TSize cnt;
BaseStream::TStatus status;
*vr = (DICOM_VR)0;
status = in.Read(&bh,1,cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
status = in.Read(&bl,1,cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
*vr = (DICOM_VR)((bh << 8) | bl);
#ifdef __LOG__
printf(" VR: 0x%02X, {%s}\n",*vr,vr2str(*vr));
#endif
return BaseStream::StatusOk;
} // read_dicom_vr()
BaseStream::TStatus read_dicom_len(
BaseStreamInput& in,
DICOM_VR vr,
int* length)
{
int sz;
short tmp;
BaseStream::TSize cnt;
BaseStream::TStatus status;
*length = 0;
switch(vr)
{
case VR_OB:
case VR_OW:
case VR_SQ:
case VR_UN:
case VR_UT:
// skip 2 bytes
status = in.Read(&tmp,2,cnt);
if(BaseStream::StatusOk != status)
return status;
sz = 4;
break;
default:
sz = 2;
}
status = in.Read(length,sz,cnt);
if(BaseStream::StatusOk != status)
return status;
#ifdef __LOG__
printf(" length: 0x%04X\n",*length);
#endif
return BaseStream::StatusOk;
} // read_dicom_len()
BaseStream::TStatus read_dicom_val(
BaseStreamInput& in,
DICOM_VR vr,
int* len,
DICOM_VALUE* value)
{
#ifdef __LOG__
int i;
#endif
int sz;
int length;
char* str = 0;
BaseStream::TSize cnt;
BaseStream::TStatus status;
length = *len;
sz = length;
if(length == 0)
return BaseStream::StatusOk;
if((unsigned int)length != 0xffffffff)
{
if((unsigned int)length < sizeof(Ipp8u*))
sz = sizeof(Ipp8u*);
str = (char*)ippMalloc(sz);
if(NULL == str)
{
return BaseStream::StatusFail;
}
status = in.Read(str,length,cnt);
if(BaseStream::StatusOk != status)
return status;
}
switch(vr)
{
case VR_AE:
case VR_AS:
case VR_AT:
case VR_CS:
case VR_DA:
case VR_DS:
case VR_DT:
case VR_IS:
case VR_LO:
case VR_LT:
case VR_PN:
case VR_SH:
case VR_ST:
case VR_TM:
case VR_UI:
case VR_UT: value->VR_AE = (char**)str; break;
case VR_FL: value->VR_FL = (float*)str; break;
case VR_FD: value->VR_FD = (double*)str; break;
case VR_OF: value->VR_OF = (float*)str; break;
case VR_SS: value->VR_SS = (short*)str; break;
case VR_UL: value->VR_UL = (unsigned int*)str; break;
case VR_UN: value->VR_UN = str; break;
case VR_US: value->VR_US = (unsigned short*)str; break;
case VR_SL: value->VR_SL = (int*)str; break;
case VR_OB:
if((unsigned int)length == 0xffffffff)
{
DICOM_ELEMENT item;
do
{
status = read_dicom_tag(in, &item.tag);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in,(int*)&item.length);
if(BaseStream::StatusOk != status)
return status;
if(item.tag.u == 0xe00dfffe || item.tag.u == 0xe0ddfffe)
{
break;
}
if(item.length == 0xffffffff)
{
DICOM_ELEMENT seq_element;
while(1)
{
status = read_dicom_tag(in, &seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
if(seq_element.tag.u == 0xe00dfffe)
{
status = read_dicom_i32(in, (int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
break;
}
status = read_dicom_vr(in, &seq_element.vr);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_len(in, seq_element.vr, (int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_val(in, seq_element.vr, (int*)&seq_element.length, &seq_element.value);
if(BaseStream::StatusOk != status)
return status;
}
status = read_dicom_tag(in, &seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in, (int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
}
else
{
if(item.length != 0)
{
str = (char*)ippMalloc(item.length);
if(NULL == str)
{
return UIC::BaseStream::StatusFail;
}
value->VR_OB = (unsigned char*)str;
status = in.Read(value->VR_OB,item.length, cnt);
if(BaseStream::StatusOk != status)
return status;
*len = item.length;
}
else
{
value->VR_OB = 0;
*len = 0;
}
}
} while(1);
}
else
{
value->VR_OB = (unsigned char*)str;
}
break;
case VR_OW:
if((unsigned int)length == 0xffffffff)
{
DICOM_ELEMENT item;
do
{
status = read_dicom_tag(in,&item.tag);
if(UIC::BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in,(int*)&item.length);
if(item.tag.u == 0xe00dfffe || item.tag.u == 0xe0ddfffe)
{
break;
}
if(item.length == 0xffffffff)
{
DICOM_ELEMENT seq_element;
while(1)
{
status = read_dicom_tag(in,&seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
if(seq_element.tag.u == 0xe00dfffe)
{
status = read_dicom_i32(in,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
break;
}
status = read_dicom_vr(in,&seq_element.vr);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_len(in,seq_element.vr,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_val(in,seq_element.vr,(int*)&seq_element.length,&seq_element.value);
if(BaseStream::StatusOk != status)
return status;
}
status = read_dicom_tag(in,&seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
}
else
{
if(item.length != 0)
{
str = (char*)ippMalloc(item.length);
if(NULL == str)
{
return BaseStream::StatusFail;
}
value->VR_OW = (unsigned short*)str;
status = in.Read(value->VR_OW,item.length,cnt);
if(BaseStream::StatusOk != status)
return status;
*len = item.length;
}
else
{
value->VR_OW = 0;
*len = 0;
}
}
} while(1);
}
else
{
value->VR_OW = (unsigned short*)str;
}
break;
case VR_SQ:
if((unsigned int)length == 0xffffffff)
{
DICOM_ELEMENT item;
status = read_dicom_tag(in,&item.tag);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in,(int*)&item.length);
if(BaseStream::StatusOk != status)
return status;
do
{
if(item.length == 0)
break;
if(item.length == 0xffffffff)
{
DICOM_ELEMENT seq_element;
seq_element.length = 0;
seq_element.tag.u = 0;
seq_element.value.VR_UN = 0;
seq_element.vr = VR_OX;
while(1)
{
status = read_dicom_tag(in,&seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
if(seq_element.tag.u == 0xe00dfffe || seq_element.tag.u == 0xe0ddfffe)
{
status = read_dicom_i32(in,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
break;
}
status = read_dicom_vr(in,&seq_element.vr);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_len(in,seq_element.vr,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_val(in,seq_element.vr,(int*)&seq_element.length,&seq_element.value);
if(BaseStream::StatusOk != status)
return status;
ippFree(seq_element.value.VR_UN);
seq_element.value.VR_UI = 0;
} // while(1)
status = read_dicom_tag(in,&seq_element.tag);
if(BaseStream::StatusOk != status)
return status;
status = read_dicom_i32(in,(int*)&seq_element.length);
if(BaseStream::StatusOk != status)
return status;
if(seq_element.tag.u == 0xe0ddfffe)
{
break;
}
} // if(item.length == 0xffffffff)
}while(1);
}
break;
default:
break;
}
return BaseStream::StatusOk;
} // read_dicom_val()
UIC::BaseStream::TStatus skip_dicom_data(
BaseStreamInput& in,
DICOM_ELEMENT* element)
{
return in.Seek(element->length,UIC::BaseStreamInput::Current);
} // skip_dicom_data()
BaseStream::TStatus ReadImageRLE(
BaseStreamInput& in,
CIppImage& image,
int rleSize)
{
int j, i;
int size;
int bsSize;
int index;
int width;
int height;
int step;
int nchanels;
int precision;
Ipp8u* ptr = 0;
Ipp8u* bs = 0;
Ipp8u* decData = 0;
Ipp8u* pRLE = 0;
IppiSize roi;
IppStatus st;
UIC::BaseStream::TSize cnt;
UIC::BaseStream::TStatus status;
int curPos;
int numberOfSegments;
long* segmentOffset;
int rleSegSize;
step = image.Step();
roi = image.Size();
nchanels = image.NChannels();
width = image.Width();
height = image.Height();
precision = image.Precision();
ptr = (Ipp8u*)ippMalloc(rleSize);
if(NULL == ptr)
{
return UIC::BaseStream::StatusFail;
}
status = in.Read((Ipp8u*)ptr, rleSize, cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
numberOfSegments = (long)*ptr;
segmentOffset = (long*)ippMalloc(numberOfSegments * sizeof(long));
if(0 == segmentOffset)
{
return UIC::BaseStream::StatusFail;
}
size = width * height * numberOfSegments;
decData = (Ipp8u*)ippMalloc(size);
if(0 == decData)
{
return UIC::BaseStream::StatusFail;
}
bsSize = width * height;
bs = (Ipp8u*)ippMalloc(bsSize);
if(0 == bs)
{
return UIC::BaseStream::StatusFail;
}
for(j = 0; j < numberOfSegments; j++)
{
segmentOffset[j] = *((long*)ptr + j + 1);
}
for(j = 0; j < numberOfSegments; j++)
{
pRLE = ptr + segmentOffset[j];
if(numberOfSegments == 1)
{
rleSegSize = rleSize - 64;
}
else if(j < (numberOfSegments - 1))
{
rleSegSize = segmentOffset[j + 1] - segmentOffset[j];
}
else
{
rleSegSize = rleSize - segmentOffset[j];
}
curPos = 0;
st = ippiUnpackBitsRow_TIFF_8u_C1((const Ipp8u*)pRLE, &curPos, rleSegSize, bs, bsSize);
if(ippStsNoErr != st)
{
return UIC::BaseStream::StatusFail;
}
for(i = 0; i < bsSize; i++)
{
index = j + i * numberOfSegments;
decData[index] = bs[i];
}
} // for (number of RLE Segment)
if(precision > 8)
{
ippsSwapBytes_16u_I((Ipp16u*)decData, width * height);
image.CopyFrom((Ipp16s*)decData, step, roi);
}
else
image.CopyFrom(decData, step, roi);
ippFree(ptr);
ippFree(bs);
ippFree(decData);
ippFree(segmentOffset);
return BaseStream::StatusOk;
} // ReadImageRLE()
BaseStream::TStatus ReadImageRAW(
BaseStreamInput& in,
CIppImage& image)
{
int r;
int size;
int width;
int height;
int step;
int nchannels;
IM_COLOR color;
IM_SAMPLING sampling;
Ipp8u* ptr = 0;
IppiSize roi;
IppStatus st;
UIC::BaseStream::TSize cnt;
UIC::BaseStream::TStatus status;
cnt = 0;
status = UIC::BaseStream::StatusOk;
sampling = image.Sampling();
color = image.Color();
step = image.Step();
roi = image.Size();
nchannels = image.NChannels();
width = image.Width();
height = image.Height();
if(sampling ==IS_422)
{
size = width * height * 2;
}
else
{
size = width * height * nchannels;
}
ptr = (Ipp8u*)ippMalloc(size);
if(NULL == ptr)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
status = in.Read((Ipp8u*)ptr, size, cnt);
if(UIC::BaseStream::StatusOk != status)
return status;
switch (color)
{
case IC_GRAY:
case IC_RGB:
case IC_UNKNOWN:
{
r = image.CopyFrom(ptr, step, roi);
if(r != 0)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
}
break;
case IC_YCBCR:
{
if(nchannels != 3)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
if(sampling == IS_444)
{
st = ippiYCbCrToRGB_8u_C3R(ptr, 3*width, image, step, roi);
if(ippStsNoErr != st)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
}
else if(sampling == IS_422)
{
int i;
Ipp8u* row422_c2;
Ipp8u* rowRGB;
IppiSize sz;
IppiSize sz2;
sz.width = width;
sz.height = 1;
sz2.width = width >> 1;
sz2.height = 1;
for(i = 0; i < height; i++)
{
const int dorder[4] = { 0, 1, 3, 2 };
row422_c2 = ptr + i*width*2;
// convert to YUY2
st = ippiSwapChannels_8u_C4IR(row422_c2,width,sz2,dorder);
if(ippStsNoErr != st)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
rowRGB = (Ipp8u*)image + i*step;
st = ippiYCbCr422ToRGB_JPEG_8u_C2C3R(row422_c2,width,rowRGB,step,sz);
if(ippStsNoErr != st)
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
}
}
else
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
}
break;
default:
{
status = UIC::BaseStream::StatusFail;
goto Exit;
}
}
Exit:
if(0 != ptr)
ippFree(ptr);
return status;
} // ReadImageRAW()
void map2palette(
CIppImage* paletteSrc,
CIppImage* image,
DICOM_LUT* lut)
{
int i, j;
int width;
int height;
int paletteIndex;
Ipp8u* src = 0;
Ipp8u* dst = 0;
src = *paletteSrc;
dst = *image;
width = paletteSrc->Width();
height = paletteSrc->Height();
for(i = 0; i < height; i++)
{
for(j = 0; j < width; j ++)
{
paletteIndex = src[j];
dst[3*j] = (Ipp8u)(lut->RedLUT [paletteIndex] >> 8);
dst[3*j + 1] = (Ipp8u)(lut->GreenLUT[paletteIndex] >> 8);
dst[3*j + 2] = (Ipp8u)(lut->BlueLUT [paletteIndex] >> 8);
}
src += paletteSrc->Step();
dst += image->Step();
}
return;
} // map2palette()
IM_ERROR ReadImageDICOM(BaseStreamInput& in, PARAMS_DICOM& param, CIppImage& image, bool printDiagn)
{
int end;
int nchannels;
int precision;
int signature;
unsigned int readSize = 0;
char transfer_syntax[128];
UIC::BaseStream::TSize cnt;
DICOM_ORDER planar;
DICOM_PHOTOMETRIC photometric;
DICOM_ELEMENT element;
DICOM_TSYNTAX syntax;
IppiSize roi;
IM_ERROR im_err = IE_OK;
nchannels = 1;
precision = 0;
planar = (DICOM_ORDER)0;
photometric = (DICOM_PHOTOMETRIC)0;
syntax = DTS_UNSUPPORTED;
roi.width = 0;
roi.height = 0;
element.length = 0;
element.tag.u = 0;
element.value.VR_UN = 0;
element.vr = VR_OX;
param.nFrames = 1;
param.frameSeek = 0;
if(UIC::BaseStream::StatusOk != in.Seek(DICOM_PREAMBLE,UIC::BaseStreamInput::Beginning))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != in.Read(&signature,sizeof(Ipp32s), cnt))
return IE_FREAD;
#ifdef __LOG__
printf("FILE: %s\n",lpszPathName);
printf("DICOM signature: 0x%04X\n",signature);
#endif
end = 0;
do
{
if(UIC::BaseStream::StatusFail == read_dicom_tag(in, &element.tag))
{
im_err = IE_OK;
goto Exit;
}
if(IE_OK != im_err)
goto Exit;
if(UIC::BaseStream::StatusOk != read_dicom_vr(in,&element.vr))
{
im_err = IE_FREAD;
break;
}
if(UIC::BaseStream::StatusOk != read_dicom_len(in,element.vr,(int*)&element.length))
{
im_err = IE_FREAD;
break;
}
if(element.length == 0)
continue;
switch(element.tag.u)
{
case 0xfffcfffc:
{
if(UIC::BaseStream::StatusOk != in.Seek(element.length,UIC::BaseStreamInput::Current))
{
im_err = IE_FSEEK;
break;
}
}
break;
case 0x00107FE0:
{
if(param.nFrames == 1)
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
readSize = element.length;
}
else
{
if(precision <= 8)
readSize = roi.width*roi.height*nchannels*sizeof(Ipp8u);
else
readSize = roi.width*roi.height*nchannels*sizeof(Ipp16u);
if(0xFFFFFFFF == element.length) // enable BASIC OFFSET TABLE ???
{
if(UIC::BaseStream::StatusOk != in.Seek(2*sizeof(Ipp32s), UIC::BaseStreamInput::Current))
{
im_err = IE_FSEEK;
break;
}
param.frameSeek = (Ipp32s*)ippMalloc(param.nFrames*sizeof(Ipp32s));
if(0 == param.frameSeek)
{
im_err = IE_ALLOC;
break;
}
if(UIC::BaseStream::StatusOk != in.Read(param.frameSeek, param.nFrames*sizeof(Ipp32s),cnt))
{
im_err = IE_FREAD;
break;
}
in.Position((UIC::BaseStream::TPosition&)param.firstFramePos);
if(UIC::BaseStream::StatusOk != in.Seek(2*sizeof(Ipp32s), UIC::BaseStreamInput::Current))
{
im_err = IE_FSEEK;
break;
}
readSize = param.frameSeek[1] - 2*sizeof(Ipp32s);
}
else
in.Position((UIC::BaseStream::TPosition&)param.firstFramePos);
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&readSize,&element.value))
{
im_err = IE_FREAD;
break;
}
}
image.NChannels(nchannels);
switch(photometric)
{
case DPM_MONOCHROME1: image.Color(IC_GRAY); image.Sampling(IS_444); break;
case DPM_MONOCHROME2: image.Color(IC_GRAY); image.Sampling(IS_444); break;
case DPM_RGB: image.Color(IC_RGB); image.Sampling(IS_444); break;
case DPM_YBR_FULL: image.Color(IC_YCBCR); image.Sampling(IS_444); break;
case DPM_YBR_FULL_422: image.Color(IC_YCBCR); image.Sampling(IS_422); break;
case DPM_YBR_PART_422: image.Color(IC_YCBCR); image.Sampling(IS_422); break;
case DPM_PALETTE_COLOR:
{
if(DTS_RLE != syntax && precision > 8)
return IE_UNSUP;
}
break;
default:
image.Color(IC_UNKNOWN);
image.Sampling(IS_444);
break;
}
// got image
switch(syntax)
{
case DTS_JPEG_BASELINE:
case DTS_JPEG_EXTENDED:
case DTS_JPEG_LOSSLESS1:
{
CMemBuffInput mem;
param.fmt = IT_JPEG;
if(UIC::BaseStream::StatusOk != mem.Open((Ipp8u*)element.value.VR_UI,readSize))
{
im_err = IE_FOPEN;
break;
}
im_err = ReadImageJPEG(mem,param.param_jpeg,image);
if(IE_OK != im_err)
return im_err;
}
break;
case DTS_RAW_LE:
{
int r;
int step;
CMemBuffInput mem;
if(planar == DPC_PLANE)
return IE_UNSUP;
if(0 != image.Alloc(roi,nchannels,precision))
return IE_ALLOC;
step = image.Step();
if(precision <= 8)
{
if(UIC::BaseStream::StatusOk != mem.Open((Ipp8u*)element.value.VR_UI,readSize))
return IE_FOPEN;
if(UIC::BaseStream::StatusOk != ReadImageRAW(mem, image))
return IE_FREAD;
}
else
{
Ipp16s* ptr = (Ipp16s*)element.value.VR_UI;
r = image.CopyFrom(ptr,step,roi);
}
goto Exit;
}
break;
case DTS_RLE:
{
CMemBuffInput mem;
if(0 != image.Alloc(roi,nchannels,precision))
return IE_ALLOC;
if(UIC::BaseStream::StatusOk != mem.Open((Ipp8u*)element.value.VR_UI,readSize))
return IE_FOPEN;
if(DPM_PALETTE_COLOR != photometric)
{
if(UIC::BaseStream::StatusOk != ReadImageRLE(mem, image, readSize))
return IE_FREAD;
}
else
{
CIppImage paletteImage;
if(0 != paletteImage.Alloc(roi,1,precision))
return IE_ALLOC;
if(UIC::BaseStream::StatusOk != ReadImageRLE(mem, paletteImage, readSize))
return IE_FREAD;
map2palette(&paletteImage, &image, ¶m.lut);
paletteImage.Free();
}
}
break;
case DTS_JPEG2K_LOSSLESS:
case DTS_JPEG2K:
{
CMemBuffInput mem;
param.fmt = IT_JPEG2000;
if(UIC::BaseStream::StatusOk != mem.Open((Ipp8u*)element.value.VR_UI,readSize))
return IE_FOPEN;
im_err = ReadImageJPEG2000(mem, param.param_jpeg2k,image, printDiagn);
if(IE_OK != im_err)
return im_err;
}
break;
default:
return IE_UNSUP;
}
}
break;
case 0x00080028:
{
// multi-frame images -> number of frames
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
param.nFrames = atoi((char*)element.value.VR_OB);
}
break;
case 0x00060028:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
planar = (DICOM_ORDER)*element.value.VR_US;
}
break;
case 0x00040028:
{
char buf[32];
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
char* str = (char*)element.value.VR_CS;
memcpy(buf,str,element.length);
buf[element.length] = 0;
if(strstr(buf,"MONOCHROME1"))
{
photometric = DPM_MONOCHROME1;
}
else if(strstr(buf,"MONOCHROME2"))
{
photometric = DPM_MONOCHROME2;
}
else if(strstr(buf,"PALETTE COLOR"))
{
photometric = DPM_PALETTE_COLOR;
nchannels = 3;
}
else if(strstr(buf,"RGB"))
{
photometric = DPM_RGB;
}
else if(strstr(buf,"YBR_PART_422"))
{
photometric = DPM_YBR_PART_422;
}
else if(strstr(buf,"YBR_FULL_422"))
{
photometric = DPM_YBR_FULL_422;
}
else if(strstr(buf,"YBR_FULL"))
{
photometric = DPM_YBR_FULL;
}
else if(strstr(buf,"YBR_ICT"))
{
photometric = DPM_ICT;
}
else if(strstr(buf,"YBR_RCT"))
{
photometric = DPM_RCT;
}
else
{
photometric = DPM_UNKNOWN;
}
param.photometric = photometric;
}
break;
case 0x00020028:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
nchannels = *element.value.VR_US;
}
break;
case 0x01000028:
{
// bits allocated
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
}
break;
case 0x00100028:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
roi.height = *element.value.VR_US;
}
break;
case 0x00110028:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
roi.width = *element.value.VR_US;
}
break;
case 0x00100002:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
ippsCopy_8u((Ipp8u*)element.value.VR_UI,(Ipp8u*)transfer_syntax,element.length);
transfer_syntax[element.length] = 0;
if(!strcmp(transfer_syntax,"1.2.840.10008.1.2.5"))
{
// RLE compression
syntax = DTS_RLE;
}
else if(!strcmp(transfer_syntax,"1.2.840.10008.1.2"))
{
// RAW LE
syntax = DTS_RAW_LE;
}
else if(!strcmp(transfer_syntax,"1.2.840.10008.1.2.1"))
{
// RAW LE
syntax = DTS_RAW_LE;
}
else if(!strcmp(transfer_syntax,"1.2.840.10008.1.2.2"))
{
// RAW BE
syntax = DTS_RAW_BE;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.50"))
{
// JPEG 8-bit Lossy
syntax = DTS_JPEG_BASELINE;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.51"))
{
// JPEG 12-bit Lossy
syntax = DTS_JPEG_EXTENDED;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.57"))
{
// JPEG Lossless
syntax = DTS_JPEG_LOSSLESS;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.70"))
{
// JPEG Lossless 1-st predictor
syntax = DTS_JPEG_LOSSLESS1;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.80"))
{
// JPEG-LS Lossless
syntax = DTS_JPEGLS_LOSSLESS;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.81"))
{
// JPEG-LS Near Lossless
syntax = DTS_JPEGLS_NEARLOSS;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.90"))
{
// JPEG2000 Lossless
syntax = DTS_JPEG2K_LOSSLESS;
}
else if(!strcmp(transfer_syntax, "1.2.840.10008.1.2.4.91"))
{
// JPEG2000
syntax = DTS_JPEG2K;
}
param.syntax = syntax;
if(DTS_UNSUPPORTED == syntax)
{
im_err = IE_UNSUP;
goto Exit;
}
}
break;
case 0x01010028:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
// bits stored
precision = *element.value.VR_US;
}
break;
case 0x11010028: // RED LUT Descriptor
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
memcpy(param.lut.redDescriptor,element.value.VR_US, 3*sizeof(unsigned short));
}
break;
case 0x11020028: // GREEN LUT Descriptor
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
memcpy(param.lut.greenDescriptor,element.value.VR_US, 3*sizeof(unsigned short));
}
break;
case 0x11030028: // BLUE LUT Descriptor
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
memcpy(param.lut.blueDescriptor, element.value.VR_US, 3*sizeof(unsigned short));
}
break;
case 0x12010028: // RED LUT data
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
param.lut.RedLUT = (unsigned short*)ippMalloc(param.lut.redDescriptor[0]*sizeof(unsigned short));
if(0 == param.lut.RedLUT)
{
im_err = IE_ALLOC;
break;
}
memcpy(param.lut.RedLUT ,element.value.VR_OW, param.lut.redDescriptor[0]*sizeof(unsigned short));
}
break;
case 0x12020028: // GREEN LUT data
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
param.lut.GreenLUT = (unsigned short*)ippMalloc(param.lut.greenDescriptor[0]*sizeof(unsigned short));
if(0 == param.lut.GreenLUT)
{
im_err = IE_ALLOC;
break;
}
memcpy(param.lut.GreenLUT ,element.value.VR_OW, param.lut.greenDescriptor[0]*sizeof(unsigned short));
}
break;
case 0x12030028: // BLUE LUT data
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
param.lut.BlueLUT = (unsigned short*)ippMalloc(param.lut.blueDescriptor[0]*sizeof(unsigned short));
if(0 == param.lut.BlueLUT)
{
im_err = IE_ALLOC;
break;
}
memcpy(param.lut.BlueLUT ,element.value.VR_OW, param.lut.blueDescriptor[0]*sizeof(unsigned short));
}
break;
case 0x01030028: // Pixel Representation: 0 - unsigned data; 1 - signed data
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
param.isSigned = *element.value.VR_US;
(param.isSigned == 0) ? image.Format(IF_UNSIGNED) : image.Format(IF_SIGNED);
}
break;
case 0x00000002:
case 0x00010002:
case 0x00020002:
case 0x00030002:
case 0x00120002:
case 0x00130002:
case 0x00160002:
case 0x00120028:
case 0x01020028:
case 0x01060028:
case 0x01070028:
case 0x01200028:
default:
{
if(UIC::BaseStream::StatusOk != read_dicom_val(in,element.vr,(int*)&element.length,&element.value))
{
im_err = IE_FREAD;
break;
}
}
break;
}
ippFree(element.value.VR_UI);
element.value.VR_UI = 0;
} while(!end);
Exit:
if(0 != element.value.VR_UI)
{
ippFree(element.value.VR_UI);
}
return im_err;
} // ReadImageDICOM()
IM_ERROR GetFrameDICOM(
BaseStreamInput& in,
PARAMS_DICOM& param,
int numFrame,
CIppImage& image)
{
int width;
int height;
int dstOrder[3] = { 2, 1, 0 };
int precision;
int frameSize;
Ipp64u frameStep;
IM_ERROR im_err = IE_OK;
UIC::BaseStream::TSize cnt;
width = image.Width();
height = image.Height();
precision = image.Precision();
switch(param.syntax)
{
case DTS_RAW_LE:
{
if(precision <= 8)
{
frameSize = width * height * image.NChannels();
frameStep = param.firstFramePos + numFrame * frameSize;
if(UIC::BaseStream::StatusOk != in.Seek(frameStep,UIC::BaseStreamInput::Beginning))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != ReadImageRAW(in, image))
return IE_FREAD;
}
else
{
frameSize = width * height * sizeof(Ipp16s) * image.NChannels();
frameStep = param.firstFramePos + numFrame * frameSize;
if(UIC::BaseStream::StatusOk != in.Seek(frameStep,UIC::BaseStreamInput::Beginning))
return IE_FSEEK;
Ipp16s* ptr = image;
if(UIC::BaseStream::StatusOk != in.Read(ptr, frameSize, cnt))
return IE_FREAD;
}
}
break;
case DTS_JPEG_BASELINE:
case DTS_JPEG_EXTENDED:
case DTS_JPEG_LOSSLESS1:
case DTS_JPEG_LOSSLESS:
{
Ipp32s readSize = 0;
param.fmt = IT_JPEG;
frameStep = param.firstFramePos + param.frameSeek[numFrame];
if(UIC::BaseStream::StatusOk != in.Seek(frameStep,UIC::BaseStreamInput::Beginning))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != in.Seek(sizeof(Ipp32s),UIC::BaseStreamInput::Current))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != in.Read(&readSize, sizeof(Ipp32s), cnt))
return IE_FREAD;
im_err = ReadImageJPEG(in,param.param_jpeg,image);
if(IE_OK != im_err)
return im_err;
}
break;
case DTS_RLE:
{
int readSize = 0;
frameStep = param.firstFramePos + param.frameSeek[numFrame];
if(UIC::BaseStream::StatusOk != in.Seek(frameStep,UIC::BaseStreamInput::Beginning))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != in.Seek(sizeof(Ipp32s),UIC::BaseStreamInput::Current))
return IE_FSEEK;
if(UIC::BaseStream::StatusOk != in.Read(&readSize, sizeof(Ipp32s), cnt))
return IE_FREAD;
if(DPM_PALETTE_COLOR != param.photometric)
{
if(UIC::BaseStream::StatusOk != ReadImageRLE(in, image, readSize))
return IE_FREAD;
}
else
{
CIppImage paletteImage;
if(0 != paletteImage.Alloc(image.Size(),1,precision))
return IE_ALLOC;
if(UIC::BaseStream::StatusOk != ReadImageRLE(in, paletteImage, readSize))
return IE_FREAD;
map2palette(&paletteImage, &image, ¶m.lut);
paletteImage.Free();
}
if(image.NChannels() == 3)
image.SwapChannels(dstOrder);
}
break;
default:
return IE_UNSUP;
}
return im_err;
} // GetFrameDICOM()
| [
"wavescholar@gmail.com"
] | wavescholar@gmail.com |
b6a4675428fb655db2fe9c6f0e3403c7c88828f3 | 8872f21601fdbb9be0a5a4945aa3d0e839e5118c | /Juego/NonSolum/Nivel5.h | cf6c14dc8ea7bd06be4cb02e0669c0737fc3c472 | [] | no_license | borjacano97/Serious-Train | 4ec7456c1d87074a48b570e7e957890f4b5e1547 | 18a580cea93a68ccd005926736a64cdbbd7679a2 | refs/heads/master | 2021-01-19T09:10:53.812704 | 2017-05-30T22:24:45 | 2017-05-30T22:24:45 | 82,072,570 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 427 | h | #ifndef H_NIVEL5_H
#define H_NIVEL5_H
#include "play.h"
class Nivel5 :
public Play
{
public:
Nivel5(Game * j, std::vector <Game::Vagon_t> v, Game::Bala_t a);
virtual ~Nivel5() { }
void dispara(bool shoot) { disparando = shoot; }
void update(Uint32 delta);
private:
int shootTimer, spawnTimer, cadencia, spawnRonda;
bool created = false;
bool slender = false;
Game::Bala_t arma;
bool disparando = false;
};
#endif | [
"alejor01@ucm.es"
] | alejor01@ucm.es |
abec05bfe772ef9616889610a867340995cf63dc | 35db90319158ae695cb59b576d1f8d722c0c76f4 | /cit-284/project/bills/management/list_credits/qcreditlist.h | 8187add750878ddba5c7cebe2aeb722ef6467c85 | [] | no_license | mmchix/BillsManagementProject | a313e88fad6bca5e045a3333d499588040318cfa | 2863f9c4a20ad473d499fd8dc4fd3b48080e40db | refs/heads/master | 2023-04-29T09:01:19.135402 | 2021-05-12T23:33:15 | 2021-05-12T23:33:15 | 365,568,558 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 689 | h | //
// Created by Mohamed MCHICH on 9/5/2021.
//
#ifndef BILLSMANAGEMENTPROJECT_QCREDITLIST_H
#define BILLSMANAGEMENTPROJECT_QCREDITLIST_H
#include <QDialog>
#include "../../models/creditor/Creditor.h"
QT_BEGIN_NAMESPACE
namespace Ui { class QCreditList; }
QT_END_NAMESPACE
class QCreditList : public QDialog {
Q_OBJECT
public:
explicit QCreditList(QWidget *parent = nullptr);
public:
QCreditList(QWidget *parent,Creditor creditor);
~QCreditList() override;
public slots:
void on_btnDeleteCredit_clicked();
void on_btnAddPayment_clicked();
void on_btnPaymentList_clicked();
private:
Ui::QCreditList *ui;
};
#endif //BILLSMANAGEMENTPROJECT_QCREDITLIST_H
| [
"mmchich@bhcc.edu"
] | mmchich@bhcc.edu |
e6856ed9cfb19673ead52a7beb2f23197cb496f8 | 252dd2b3a4a3e65c4ef7cb81c97320ae60f98132 | /后缀数组.cpp | 8aaa26ccf4f2041d8f69fda13e3834856a0b9496 | [] | no_license | sspeng/Algorithm-Template | 1ac362079b0e735c407260d489c9e5359a605004 | 188ea322650df314c9c10a4386c9ea96eabd10ee | refs/heads/master | 2020-04-06T09:34:36.336976 | 2017-06-28T16:43:43 | 2017-06-28T16:43:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,916 | cpp | /*
找出一个字符串中至少重复出现两次的字串的个数,注意重复出现时不能有重叠的现象
*/
#include<cstdio>
#include<cstring>
#include<cstdlib>
#define rep(i,a,b) for (int i=a;i<=b;i++)
#define dto(i,a,b) for (int i=a;i>=b;i--)
#define maxn 1205
int n,r[maxn],wr[maxn],rs[maxn],h[maxn],a[maxn],y[maxn],sa[maxn];
char str[maxn];
int minn(int x,int y){return x>y?y:x;}
int maxx(int x,int y){return x>y?x:y;}
bool cmp(int k1,int k2,int ln){return wr[k1]==wr[k2]&&wr[k1+ln]==wr[k2+ln];}
void get_sa(int m)
{ memcpy(r,a,sizeof(a));
rep(i,0,m)rs[i]=0;
rep(i,1,n)rs[r[i]]++;
rep(i,1,m)rs[i]+=rs[i-1];
dto(i,n,1)sa[rs[r[i]]--]=i;
int p=0,ln=1,k;
while (p<n){k=0;
rep(i,n-ln+1,n)y[++k]=i;
rep(i,1,n)if (sa[i]>ln)y[++k]=sa[i]-ln;
rep(i,1,n)wr[i]=r[y[i]];
rep(i,0,m)rs[i]=0;
rep(i,1,n)rs[wr[i]]++;
rep(i,1,m)rs[i]+=rs[i-1];
dto(i,n,1)sa[rs[wr[i]]--]=y[i];
memcpy(wr,r,sizeof(r));
p=1;r[sa[1]]=1;
rep(i,2,n){
if (!cmp(sa[i-1],sa[i],ln))p++;
r[sa[i]]=p;
}
m=p;ln*=2;
}
}
void makeheight()
{ int k=0,j;
rep(i,1,n){
j=sa[r[i]-1];
if (k)k--;
while (a[i+k]==a[j+k])k++;
h[r[i]]=k;
}
}
int main()
{ int ans;
while (1)
{ scanf("%s",str+1);if (str[1]=='#')break;
n=strlen(str+1);int l,r;
rep(i,1,n)a[i]=str[i];a[n+1]=0;
get_sa(256);makeheight();ans=0;
rep(i,1,n/2){
l=1200;r=-1;
rep(j,1,n){
if (h[j]>=i){
l=minn(l,sa[j-1]);r=maxx(r,sa[j-1]);
l=minn(l,sa[j]);r=maxx(r,sa[j]);
}
else {if (r!=-1&&l+i<=r)ans++;l=1200;r=-1;}
}
if (r!=-1&&l+i<=r)ans++;
}
printf("%d\n",ans);
}
return 0;
} | [
"709075442@qq.com"
] | 709075442@qq.com |
2725c107c387d4e9e267f456d041ff5451665aae | dc7ba2a2eb5f6eb721074e25dbf16b5e15a3b298 | /src/global/gui/src/MGUIEEntry.cxx | 021c7d0ac1d845f62cad4fd2ebd5aaed4cd7b6c4 | [] | no_license | markbandstra/megalib | 094fc75debe3cff24a79ba8c3485180c92d70858 | 078f4d23813d8185a75414e1cdb2099d73f17a65 | refs/heads/master | 2021-01-17T08:34:07.177308 | 2013-11-15T22:17:10 | 2013-11-15T22:17:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,648 | cxx | /*
* MGUIEEntry.cxx
*
*
* Copyright (C) by Andreas Zoglauer.
* All rights reserved.
*
*
* This code implementation is the intellectual property of
* Andreas Zoglauer.
*
* By copying, distributing or modifying the Program (or any work
* based on the Program) you indicate your acceptance of this statement,
* and all its terms.
*
*/
////////////////////////////////////////////////////////////////////////////////
//
// MGUIEEntry
//
//
// This class is an elementary GUI-widget:
// It contains a text-label and a input-field.
// It can be checked, if the input is within a preselected range of values.
//
// If the user changes the content the entry the message
// kC_ENTRY - kET_CHANGED - m_Id is sent to the message window,
// which must have been set via Associate(...) before.
//
// Example:
//
// m_Layout = new TGLayoutHints(kLHintsExpandX | kLHintsTop, 20, 20, 7, 0);
// m_Isotopes = new MGUIEEntry(this,
// MString("Source Name:"),
// m_Data->GetRSSourceName());
// m_Isotopes->SetEntryFieldSize(150);
// m_Isotopes->Associate(this, e_IsotopesId);
// AddFrame(m_Isotopes, m_Layout);
//
// in ProcessMessage(...):
//
// mlog<<m_Isotopes->GetAsString()<<endl;;
//
//
//
//
////////////////////////////////////////////////////////////////////////////////
// Include the header:
#include "MGUIEEntry.h"
// Standard libs:
// ROOT libs:
#include <TGMsgBox.h>
// MEGAlib libs:
#include "MAssert.h"
#include "MStreams.h"
////////////////////////////////////////////////////////////////////////////////
MGUIEEntry::MGUIEEntry(const TGWindow* Parent, MString Label, bool Emphasize, MString Value) :
MGUIElement(Parent, kHorizontalFrame)
{
// Creates a frame containing a label and an entry-box
//
// Parent: parent Window, where this frame is contained
// Label: text of the label
// Value: default entry
m_IsEmphasized = Emphasize;
m_Label = Label;
m_Value = Value;
m_Type = e_String;
m_Limits = false;
Init();
}
////////////////////////////////////////////////////////////////////////////////
MGUIEEntry::MGUIEEntry(const TGWindow* Parent, MString Label, bool Emphasize,
double Value, bool Limits, double Min, double Max) :
MGUIElement(Parent, kHorizontalFrame)
{
// Creates a frame containing a label and an entry-box
//
// Parent: parent Window, where this frame is contained
// Label: text of the label
// Value: default entry
m_IsEmphasized = Emphasize;
m_Label = Label;
m_ValueAsDouble = Value;
m_Value = MakeSmartString(Value);
m_Type = e_Double;
m_Limits = Limits;
m_Min = Min;
m_Max = Max;
Init();
}
////////////////////////////////////////////////////////////////////////////////
MGUIEEntry::MGUIEEntry(const TGWindow* Parent, MString Label, bool Emphasize,
int Value, bool Limits, int Min, int Max) :
MGUIElement(Parent, kHorizontalFrame)
{
// Creates a frame containing a label and an entry-box
//
// Parent: parent Window, where this frame is contained
// Label: text of the label
// Value: default entry
m_IsEmphasized = Emphasize;
m_Label = Label;
m_ValueAsDouble = Value;
m_Value = MakeSmartString(Value);
m_Type = e_Integer;
m_Limits = Limits;
m_Min = Min;
m_Max = Max;
Init();
}
////////////////////////////////////////////////////////////////////////////////
MGUIEEntry::~MGUIEEntry()
{
// Destruct this instance of MGUIEEntry
if (MustCleanup() == kNoCleanup) {
delete m_TextLabel;
delete m_TextLabelLayout;
delete m_InputLayout;
delete m_Input;
delete m_NumberInput;
}
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::Init()
{
// Initilizations common to all constructors:
m_Input = 0;
m_NumberInput = 0;
m_MessageWindow = 0;
m_Id = -1;
m_IsEnabled = true;
m_Size = 85;
m_IsModified = false;
Create();
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::Associate(TGCompositeFrame* w, int Id)
{
// Set a window to which all messages are sent
m_MessageWindow = w;
m_Id = Id;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::Create()
{
// Create the label and the input-field.
// Label:
m_TextLabel = new TGLabel(this, new TGString(m_Label));
if (m_IsEmphasized == true) {
m_TextLabel->SetTextFont(m_EmphasizedFont);
}
m_TextLabelLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsCenterY, 0, 0, 0, 0);
AddFrame(m_TextLabel, m_TextLabelLayout);
// Input field:
m_InputLayout = new TGLayoutHints(kLHintsRight | kLHintsTop | kLHintsCenterY, 5, 0, 0, 0);
if (m_Limits == false) {
m_InputBuffer = new TGTextBuffer(10);
m_InputBuffer->AddText(0, m_Value);
m_Input = new TGTextEntry(this, m_InputBuffer);
m_Input->Resize(m_Size, m_Input->GetDefaultHeight());
m_Input->Associate(this);
AddFrame(m_Input, m_InputLayout);
m_Input->Layout();
} else {
if (m_Type == e_Integer) {
m_NumberInput = new TGNumberEntry(this, m_ValueAsDouble, 9, -1, TGNumberFormat::kNESInteger);
} else {
m_NumberInput = new TGNumberEntry(this, m_ValueAsDouble, 12, -1, TGNumberFormat::kNESReal);
}
m_NumberInput->SetLimits(TGNumberFormat::kNELLimitMinMax, m_Min, m_Max);
m_NumberInput->Associate(this);
m_NumberInput->Resize(m_Size, m_NumberInput->GetDefaultHeight());
m_NumberInput->Associate(this);
AddFrame(m_NumberInput, m_InputLayout);
m_NumberInput->Layout();
}
// Give this element the default size of its content:
Resize(GetDefaultWidth(), GetDefaultHeight());
m_IsModified = false;
return;
}
////////////////////////////////////////////////////////////////////////////////
bool MGUIEEntry::ProcessMessage(long Message, long Parameter1,
long Parameter2)
{
// Process the messages for this application, mainly the scollbar moves:
// cout<<"Entry Msg: "<<GET_MSG(Message)<<"!"<<GET_SUBMSG(Message)<<"!"<<Parameter1<<"!"<<Parameter2<<endl;
switch (GET_MSG(Message)) {
case kC_TEXTENTRY:
switch (GET_SUBMSG(Message)) {
case kTE_TEXTCHANGED:
case kTE_ENTER:
case kTE_TAB:
if (m_MessageWindow != 0) {
SendMessage(m_MessageWindow, MK_MSG((EWidgetMessageTypes) kC_ENTRY,
(EWidgetMessageTypes) kET_CHANGED), m_Id, 0);
}
m_IsModified = true;
//cout<<"Modified: "<<m_Label<<": "<<m_NumberInput->GetNumber()<<endl;
break;
default:
break;
}
default:
break;
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetValue(double Value)
{
m_ValueAsDouble = Value;
m_Value = MakeSmartString(Value);
if (m_Limits == false) {
m_Input->SetText(m_Value);
} else {
m_NumberInput->SetNumber(m_ValueAsDouble);
}
Layout();
m_IsModified = false;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetValue(int Value)
{
m_ValueAsDouble = Value;
m_Value = MakeSmartString(Value);
if (m_Limits == false) {
m_Input->SetText(m_Value);
} else {
m_NumberInput->SetNumber(m_ValueAsDouble);
}
Layout();
m_IsModified = false;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetValue(unsigned int Value)
{
m_ValueAsDouble = double(Value);
m_Value = MakeSmartString(Value);
if (m_Limits == false) {
m_Input->SetText(m_Value);
} else {
m_NumberInput->SetNumber(m_ValueAsDouble);
}
Layout();
m_IsModified = false;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetValue(MString Value)
{
m_Value = Value;
if (m_Limits == false) {
m_Input->SetText(m_Value);
} else {
m_NumberInput->SetNumber(m_ValueAsDouble);
}
Layout();
m_IsModified = false;
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetEntryFieldSize(int Size)
{
// Set the size of the entry field
m_Size = Size;
if (m_Limits == false) {
m_Input->Resize(m_Size, m_Input->GetDefaultHeight());
m_Input->Layout();
} else {
m_NumberInput->Resize(m_Size, m_NumberInput->GetDefaultHeight());
m_NumberInput->Layout();
}
}
////////////////////////////////////////////////////////////////////////////////
void MGUIEEntry::SetEnabled(bool flag)
{
m_IsEnabled = flag;
if (m_Limits == false) {
m_Input->SetEnabled(m_IsEnabled);
} else {
m_NumberInput->SetState(m_IsEnabled);
}
}
////////////////////////////////////////////////////////////////////////////////
MString MGUIEEntry::GetAsString()
{
// Return the value entered in the input-field.
return m_Input->GetText();
}
////////////////////////////////////////////////////////////////////////////////
double MGUIEEntry::GetAsDouble()
{
// Return the value entered in the input-field. Its recommended, to check the
// type and range before!!
if (m_Type != e_Double) {
merr<<m_Label<<": Internal data type is not double!"<<endl;
massert(false);
}
if (m_Limits == false) {
return ToNumber(m_Input->GetText());
} else {
return m_NumberInput->GetNumber();
}
}
////////////////////////////////////////////////////////////////////////////////
int MGUIEEntry::GetAsInt()
{
// Return the value entered in the input-field. Its recommended, to check the
// type and range before!!
if (m_Type != e_Integer) {
merr<<m_Label<<": Internal data type is not integer!"<<endl;
massert(false);
}
if (m_Limits == false) {
return (int) ToNumber(m_Input->GetText());
} else {
return m_NumberInput->GetIntNumber();
}
}
////////////////////////////////////////////////////////////////////////////////
bool MGUIEEntry::IsInt(int Min, int Max)
{
// Check if the input-field contains an integer and that it is within the range
ostringstream S;
if (m_Limits == true) {
if (m_Type == e_Integer) {
return CheckRange(m_NumberInput->GetNumber(), Min, Max);
} else {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Field does not contain an integer!";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Type error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
}
// Check if it is a number:
if (CheckForNumber(m_Input->GetText()) == false) {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Field does not contain a number!";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Type error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
// Check if it is an integer:
if (atoi(m_Input->GetText()) != atof(m_Input->GetText())) {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Field does not contain an integer!";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Type error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
// Check if its within the range
return CheckRange(ToNumber(m_Input->GetText()), Min, Max);
}
////////////////////////////////////////////////////////////////////////////////
bool MGUIEEntry::IsDouble(double Min, double Max)
{
// Check if the input-field contains a double and that it is within the range
ostringstream S;
if (m_Limits == true) {
if (m_Type == e_Double || e_Integer) {
return CheckRange(m_NumberInput->GetNumber(), Min, Max);
} else {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Field does not contain a double!";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Type error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
}
// Check if it is a number:
if (CheckForNumber(m_Input->GetText()) == false) {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Field does not contain a number!";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Type error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
// Check if its within the range
return CheckRange(ToNumber(m_Input->GetText()), Min, Max);
}
////////////////////////////////////////////////////////////////////////////////
bool MGUIEEntry::CheckRange(double Value, double Min, double Max)
{
// Check if the input-field contains numbers, and that they are within [Min;Max]
ostringstream S;
if (Value < Min) {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Value \""<<Value<<"\" is below its minimum value \""<<Min<<"\"";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Limit error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
if (Value > Max) {
S<<"Error in input field of \""<<m_Label<<"\""<<endl
<<"Value \""<<Value<<"\" is above its maximum value \""<<Max<<"\"";
new TGMsgBox(gClient->GetRoot(), GetParent(), "Limit error",
S.str().c_str(),
kMBIconStop, kMBOk);
return false;
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
MString MGUIEEntry::MakeSmartString(double Number)
{
// Make a smart string, i.e. cut of zeros, etc.
ostringstream out;
out.precision(12); // Not too high to avoid the round-off errors
out<<Number;
MString S(out);
S.StripBack('0');
return S;
}
////////////////////////////////////////////////////////////////////////////////
bool MGUIEEntry::CheckForNumber(MString Number)
{
// Return true if Number is a ... number!
Number.ReplaceAll(".", "");
Number.ReplaceAll("E", "");
Number.ReplaceAll("e", "");
Number.ReplaceAll("+", "");
Number.ReplaceAll("-", "");
if (Number.IsEmpty() == true) {
return false;
}
Number.ReplaceAll("1", "");
Number.ReplaceAll("2", "");
Number.ReplaceAll("3", "");
Number.ReplaceAll("4", "");
Number.ReplaceAll("5", "");
Number.ReplaceAll("6", "");
Number.ReplaceAll("7", "");
Number.ReplaceAll("8", "");
Number.ReplaceAll("9", "");
Number.ReplaceAll("0", "");
return Number.IsEmpty();
}
////////////////////////////////////////////////////////////////////////////////
double MGUIEEntry::ToNumber(MString Number)
{
// Convert a string to a number
return atof(Number);
}
// MGUIEEntry.cxx: the end...
////////////////////////////////////////////////////////////////////////////////
| [
"andreas@megalibtoolkit.com"
] | andreas@megalibtoolkit.com |
30cce214a98ea9d5bb36b50c4472de48c1acf391 | 5f4499c0c77cdc8478a6048a0ff661b9266a9ae4 | /Patcher/include/patcher/Maj.hpp | 4ea3a7198109ed380da3eea68a544ed231d9a394 | [
"BSD-2-Clause"
] | permissive | Krozark/Patcher-client | 64086350d88eb1211277f903b29ba0917cbdffef | a8018688c041f1a6b7f4697fd00e58be716c8069 | refs/heads/master | 2019-01-02T06:32:59.703565 | 2015-02-20T10:16:57 | 2015-02-20T10:16:57 | 17,898,187 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,245 | hpp | #ifndef PATCHER_MAJ_HPP
#define PATCHER_MAJ_HPP
#include <string>
#include <iostream>
namespace patcher
{
class Maj
{
public:
Maj(const Maj&) = delete;
Maj& operator=(const Maj&) = delete;
Maj(int action,std::string filename,std::string url="");
const int action; ///<choices=[(0,"unknow"),(1,"New"),(2,"Maj"),(3,"Deleted")]
const std::string filename;///<the real file name
const std::string url;///<the url to get the file (relative to Config::getUrl)
bool isDone() const;///< if done (with success)
bool apply(); ///< make the maj. return isDone()
friend std::ostream& operator<<(std::ostream& output,const Maj& self);
private:
bool done;///< is done?
/**
* \brief download to download/filename
*/
bool download();
/**
* \brief rm filename
*/
bool erase();
/**
* \brief download + erase + write
*/
bool replace();
/**
* \brief mv filename.tmp filename
*/
bool write();
};
}
#endif
| [
"maxime.barbier1991@gmail.com"
] | maxime.barbier1991@gmail.com |
95760422644d8caba943daa4b42c883fdef47567 | 367dba9ad08197f3873a094504d7788fbb55d142 | /ZGGame/Classes/Player.h | 3fb107605a81bbf54bfa7c5ac8c39924ea6778b6 | [] | no_license | ganbin6617/Test | 56c5298c12e7bb4cc70a04fbbf996a9eb17dfd92 | 20f4683dd400bf6bdc2fea46fe8f33a45e97311e | refs/heads/master | 2021-01-10T11:14:25.306945 | 2016-04-01T10:18:03 | 2016-04-01T10:18:03 | 52,883,991 | 0 | 0 | null | 2016-03-01T15:14:14 | 2016-03-01T14:45:00 | null | UTF-8 | C++ | false | false | 1,219 | h | //
// Player.h
// ZGGame
//
// Created by Thesy on 16/3/10.
//
//
#ifndef __ZGGame__Player__
#define __ZGGame__Player__
#include <stdio.h>
#include <cocos/cocos2d.h>
USING_NS_CC;
typedef enum {
MJAction_Peng,
MJAction_Chi,
MJAction_Hu,
MJAction_Gang,
MJAction_Out,
}MJAction;
typedef void (Ref::*SEL_CallFun9)(int i, int j);
#define think_selector(_SELECTOR) (SEL_CallFun9)(&_SELECTOR)
class Player : public Ref
{
public:
virtual bool init ();
virtual void think(MJAction action, int zi);
virtual void outMJ();
CREATE_FUNC(Player);
public:
bool isZ; //庄
int delayTime; //延时
bool isAI;
void setIsAI(bool);
// __Array *handMJList; //手牌
CC_SYNTHESIZE_RETAIN(__Array *, handMJList, HandMJList);
// __Array *disCardList; //弃牌堆
CC_SYNTHESIZE_RETAIN(__Array *, disCardList, DisCardList);
// 回调的执行者
// Ref *m_pListen;
CC_SYNTHESIZE(Ref *, delegate, Delegate);
// 回调函数指针
// SEL_CallFun9 m_pfnSelectior;
CC_SYNTHESIZE(SEL_CallFun9, m_pfnSelectior, M_pfnSelectior);
};
#endif /* defined(__ZGGame__Player__) */
| [
"ganbin_136079817@qq.com"
] | ganbin_136079817@qq.com |
8a330038812935f02d84f76297379b4bb9a17db8 | aa947d9d8f518215974cab4957d47bfe22b2fb39 | /Osiris/Libraries/Ausar/Game/Camera.cpp | eaafc3a51e5717575600d286c902a62975fba42d | [
"MIT"
] | permissive | XeCREATURE/Osiris | b41a96f9ae47c98cc2fd5a503591c7704bb9068d | 8c98dd930d48418673262c0257a31bf13208c482 | refs/heads/master | 2020-05-29T11:37:05.366119 | 2016-09-29T22:24:43 | 2016-09-29T22:24:43 | 68,486,509 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 67 | cpp | #include "Camera.hpp"
namespace Ausar
{
namespace Game
{
}
} | [
"mdavis.virtual@gmail.com"
] | mdavis.virtual@gmail.com |
c743c38f2faf2fc96be9a227057637c39a155dea | d624e14c8d466d6efdd3f8b328ba782833a908b0 | /HDOJ/HDOJ1133/1133.cpp | 6703d37ea62a98d8a7c321845753ebc1d055ca19 | [] | no_license | Oozwding/helloworld | e2408852fc609cbdddd3e49b09ca449b4bc4d6f4 | 224703c43a1e0c7865639cb31512cb42ce4eabfe | refs/heads/master | 2020-02-26T15:44:25.338786 | 2016-06-16T04:51:41 | 2016-06-16T04:51:41 | 54,907,706 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 6,936 | cpp | /**
* Filename:HDOJ1133
* Date :2016/3/19
* @Author :zwding
* Describe:大数类模板 (m+n)! * (m-n+1) / (m+1)
*/
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
using namespace std;
#define MAXN 9999
#define MAXSIZE 10
#define DLEN 4
class BigNum
{
private:
int a[10000]; //可以控制大数的位数
int len; //大数长度
public:
BigNum(){ len = 1;memset(a,0,sizeof(a)); } //构造函数
BigNum(const int); //将一个int类型的变量转化为大数
BigNum(const char*); //将一个字符串类型的变量转化为大数
BigNum(const BigNum &); //拷贝构造函数
BigNum &operator=(const BigNum &); //重载赋值运算符,大数之间进行赋值运算
friend istream& operator>>(istream&, BigNum&); //重载输入运算符
friend ostream& operator<<(ostream&, BigNum&); //重载输出运算符
BigNum operator+(const BigNum &) const; //重载加法运算符,两个大数之间的相加运算
BigNum operator-(const BigNum &) const; //重载减法运算符,两个大数之间的相减运算
BigNum operator*(const BigNum &) const; //重载乘法运算符,两个大数之间的相乘运算
BigNum operator/(const int &) const; //重载除法运算符,大数对一个整数进行相除运算
BigNum operator^(const int &) const; //大数的n次方运算
int operator%(const int &) const; //大数对一个int类型的变量进行取模运算
bool operator>(const BigNum & T)const; //大数和另一个大数的大小比较
bool operator>(const int & t)const; //大数和一个int类型的变量的大小比较
void print(); //输出大数
};
BigNum::BigNum(const int b) //将一个int类型的变量转化为大数
{
int c,d = b;
len = 0;
memset(a,0,sizeof(a));
while(d > MAXN)
{
c = d - (d / (MAXN + 1)) * (MAXN + 1);
d = d / (MAXN + 1);
a[len++] = c;
}
a[len++] = d;
}
BigNum::BigNum(const char*s) //将一个字符串类型的变量转化为大数
{
int t,k,index,l,i;
memset(a,0,sizeof(a));
l=strlen(s);
len=l/DLEN;
if(l%DLEN)
len++;
index=0;
for(i=l-1;i>=0;i-=DLEN)
{
t=0;
k=i-DLEN+1;
if(k<0)
k=0;
for(int j=k;j<=i;j++)
t=t*10+s[j]-'0';
a[index++]=t;
}
}
BigNum::BigNum(const BigNum & T) : len(T.len) //拷贝构造函数
{
int i;
memset(a,0,sizeof(a));
for(i = 0 ; i < len ; i++)
a[i] = T.a[i];
}
BigNum & BigNum::operator=(const BigNum & n) //重载赋值运算符,大数之间进行赋值运算
{
int i;
len = n.len;
memset(a,0,sizeof(a));
for(i = 0 ; i < len ; i++)
a[i] = n.a[i];
return *this;
}
istream& operator>>(istream & in, BigNum & b) //重载输入运算符
{
char ch[MAXSIZE*4];
int i = -1;
in>>ch;
int l=strlen(ch);
int count=0,sum=0;
for(i=l-1;i>=0;)
{
sum = 0;
int t=1;
for(int j=0;j<4&&i>=0;j++,i--,t*=10)
{
sum+=(ch[i]-'0')*t;
}
b.a[count]=sum;
count++;
}
b.len =count++;
return in;
}
ostream& operator<<(ostream& out, BigNum& b) //重载输出运算符
{
int i;
cout << b.a[b.len - 1];
for(i = b.len - 2 ; i >= 0 ; i--)
{
cout.width(DLEN);
cout.fill('0');
cout << b.a[i];
}
return out;
}
BigNum BigNum::operator+(const BigNum & T) const //两个大数之间的相加运算
{
BigNum t(*this);
int i,big; //位数
big = T.len > len ? T.len : len;
for(i = 0 ; i < big ; i++)
{
t.a[i] +=T.a[i];
if(t.a[i] > MAXN)
{
t.a[i + 1]++;
t.a[i] -=MAXN+1;
}
}
if(t.a[big] != 0)
t.len = big + 1;
else
t.len = big;
return t;
}
BigNum BigNum::operator-(const BigNum & T) const //两个大数之间的相减运算
{
int i,j,big;
bool flag;
BigNum t1,t2;
if(*this>T)
{
t1=*this;
t2=T;
flag=0;
}
else
{
t1=T;
t2=*this;
flag=1;
}
big=t1.len;
for(i = 0 ; i < big ; i++)
{
if(t1.a[i] < t2.a[i])
{
j = i + 1;
while(t1.a[j] == 0)
j++;
t1.a[j--]--;
while(j > i)
t1.a[j--] += MAXN;
t1.a[i] += MAXN + 1 - t2.a[i];
}
else
t1.a[i] -= t2.a[i];
}
t1.len = big;
while(t1.a[t1.len - 1] == 0 && t1.len > 1)
{
t1.len--;
big--;
}
if(flag)
t1.a[big-1]=0-t1.a[big-1];
return t1;
}
BigNum BigNum::operator*(const BigNum & T) const //两个大数之间的相乘运算
{
BigNum ret;
int i,j,up;
int temp,temp1;
for(i = 0 ; i < len ; i++)
{
up = 0;
for(j = 0 ; j < T.len ; j++)
{
temp = a[i] * T.a[j] + ret.a[i + j] + up;
if(temp > MAXN)
{
temp1 = temp - temp / (MAXN + 1) * (MAXN + 1);
up = temp / (MAXN + 1);
ret.a[i + j] = temp1;
}
else
{
up = 0;
ret.a[i + j] = temp;
}
}
if(up != 0)
ret.a[i + j] = up;
}
ret.len = i + j;
while(ret.a[ret.len - 1] == 0 && ret.len > 1)
ret.len--;
return ret;
}
BigNum BigNum::operator/(const int & b) const //大数对一个整数进行相除运算
{
BigNum ret;
int i,down = 0;
for(i = len - 1 ; i >= 0 ; i--)
{
ret.a[i] = (a[i] + down * (MAXN + 1)) / b;
down = a[i] + down * (MAXN + 1) - ret.a[i] * b;
}
ret.len = len;
while(ret.a[ret.len - 1] == 0 && ret.len > 1)
ret.len--;
return ret;
}
int BigNum::operator %(const int & b) const //大数对一个int类型的变量进行取模运算
{
int i,d=0;
for (i = len-1; i>=0; i--)
{
d = ((d * (MAXN+1))% b + a[i])% b;
}
return d;
}
BigNum BigNum::operator^(const int & n) const //大数的n次方运算
{
BigNum t,ret(1);
int i;
if(n<0)
exit(-1);
if(n==0)
return 1;
if(n==1)
return *this;
int m=n;
while(m>1)
{
t=*this;
for( i=1;i<<1<=m;i<<=1)
{
t=t*t;
}
m-=i;
ret=ret*t;
if(m==1)
ret=ret*(*this);
}
return ret;
}
bool BigNum::operator>(const BigNum & T) const //大数和另一个大数的大小比较
{
int ln;
if(len > T.len)
return true;
else if(len == T.len)
{
ln = len - 1;
while(a[ln] == T.a[ln] && ln >= 0)
ln--;
if(ln >= 0 && a[ln] > T.a[ln])
return true;
else
return false;
}
else
return false;
}
bool BigNum::operator >(const int & t) const //大数和一个int类型的变量的大小比较
{
BigNum b(t);
return *this>b;
}
void BigNum::print() //输出大数
{
int i;
cout << a[len - 1];
for(i = len - 2 ; i >= 0 ; i--)
{
cout.width(DLEN);
cout.fill('0');
cout << a[i];
}
cout << endl /*<< "位数:" << len*4 << endl;*/;
}
BigNum jiecheng(int n){
if(n == 0){
//cout << 1 << endl;
return 1;
}
BigNum num(1);
for(int i=1;i<=n;i++){
num = num * i;
}
//num.print();
return num;
}
int main(void){
int n,m;
int count=1;
BigNum x = 1;
while(scanf("%d%d",&n,&m) && (n || m)){
if(n<m){
printf("Test #%d:\n",count++);
printf("%d\n",0);
}else{
BigNum num1 = n;
BigNum num2 = m;
BigNum num3 = jiecheng(n+m) * (num1 - num2 + x) / (n + 1);
printf("Test #%d:\n",count++);
num3.print();
}
//jiecheng(n);
}
}
| [
"zwdingcoder@gmail.com"
] | zwdingcoder@gmail.com |
3ba6cea0b9ee35ab0f8aced73ee2686c1093c151 | 53a322606fe5e6dbd0492d2075c14d1410834379 | /include/internal/routines/level1/xaxpy.h | 4b9da890e997f6f574acc41caa235fb0b171bd74 | [
"Apache-2.0"
] | permissive | mikeseven/CLBlast | 3422d3618f1379ace67b7051f7548357f8071dae | a41744da14ceecbbd65a444f974a3d2c4bed9e47 | refs/heads/master | 2021-01-17T22:37:44.517255 | 2015-08-22T10:47:19 | 2015-08-22T10:47:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,853 | h |
// =================================================================================================
// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
// width of 100 characters per line.
//
// Author(s):
// Cedric Nugteren <www.cedricnugteren.nl>
//
// This file implements the Xaxpy routine. The precision is implemented using a template argument.
//
// =================================================================================================
#ifndef CLBLAST_ROUTINES_XAXPY_H_
#define CLBLAST_ROUTINES_XAXPY_H_
#include "internal/routine.h"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
class Xaxpy: public Routine<T> {
public:
// Members and methods from the base class
using Routine<T>::db_;
using Routine<T>::source_string_;
using Routine<T>::queue_;
using Routine<T>::GetProgramFromCache;
using Routine<T>::TestVectorX;
using Routine<T>::TestVectorY;
using Routine<T>::RunKernel;
using Routine<T>::ErrorIn;
// Constructor
Xaxpy(Queue &queue, Event &event);
// Templated-precision implementation of the routine
StatusCode DoAxpy(const size_t n, const T alpha,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
private:
// Static variable to get the precision
const static Precision precision_;
};
// =================================================================================================
} // namespace clblast
// CLBLAST_ROUTINES_XAXPY_H_
#endif
| [
"web@cedricnugteren.nl"
] | web@cedricnugteren.nl |
7f1c90a1eb93dd04cf133e00a98b50b7d377860d | b4d726a0321649f907923cc57323942a1e45915b | /CODE/HUD/hudtargetbox.cpp | 33e36342e51b2b8b3b5eb9ebeaa57563d5b4e2b4 | [] | no_license | chief1983/Imperial-Alliance | f1aa664d91f32c9e244867aaac43fffdf42199dc | 6db0102a8897deac845a8bd2a7aa2e1b25086448 | refs/heads/master | 2016-09-06T02:40:39.069630 | 2010-10-06T22:06:24 | 2010-10-06T22:06:24 | 967,775 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 72,008 | cpp | /*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
* $Revision: 1.1.1.1 $
* $Date: 2004/08/13 22:47:41 $
* $Author: Spearhawk $
*
* C module for drawing the target monitor box on the HUD
*
* $Log: hudtargetbox.cpp,v $
* Revision 1.1.1.1 2004/08/13 22:47:41 Spearhawk
* no message
*
* Revision 1.1.1.1 2004/08/13 20:49:54 Darkhill
* no message
*
* Revision 2.36 2004/04/07 17:20:24 phreak
* changed around the order of some function calls to get the target model
* properly rendering in the hud targetbox
*
* Revision 2.35 2004/04/06 03:09:53 phreak
* added a control config option for the wireframe hud targetbox i enabled ages ago
*
* Revision 2.34 2004/03/17 04:07:30 bobboau
* new fighter beam code
* fixed old after burner trails
* had to bump a few limits, working on some dynamic solutions
* a few fixed to background POF rendering
* fixing asorted bugs
*
* Revision 2.33 2004/03/05 09:02:04 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.32 2004/02/15 06:02:32 bobboau
* fixed sevral asorted matrix errors,
* OGL people make sure I didn't break anything,
* most of what I did was replaceing falses with (if graphicts_mode == D3D)
*
* Revision 2.31 2004/02/10 05:07:38 matt
* Fixed issue with ships being rendered off center
* in the HUD target box. Much easier than I
* thought
* -- Sticks
*
* Revision 2.30 2004/02/07 05:11:08 Goober5000
* fix for undestroyable subsystems
* --Goober5000
*
* Revision 2.29 2004/02/06 23:17:43 Goober5000
* tweakage
* --Goober5000
*
* Revision 2.28 2004/02/04 09:02:45 Goober5000
* got rid of unnecessary double semicolons
* --Goober5000
*
* Revision 2.27 2004/02/04 08:41:04 Goober5000
* made code more uniform and simplified some things,
* specifically shield percentage and quadrant stuff
* --Goober5000
*
* Revision 2.26 2004/01/30 07:39:07 Goober5000
* whew - I just went through all the code I ever added (or at least, that I could
* find that I commented with a Goober5000 tag) and added a bunch of Asserts
* and error-checking
* --Goober5000
*
* Revision 2.25 2003/12/16 20:46:37 phreak
* made gr_set_proj_matrix use the MIN/MAX_DRAW_DISTANCE constants
*
* Revision 2.24 2003/12/04 20:39:09 randomtiger
* Added DDS image support for D3D
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
* Hopefully have fixed D3D text batching bug that caused old values to appear
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
* Fixed jump nodes not showing
*
* Revision 2.23 2003/11/16 04:09:23 Goober5000
* language
*
* Revision 2.22 2003/11/11 03:56:11 bobboau
* lots of bug fixing, much of it in nebula and bitmap drawing
*
* Revision 2.21 2003/11/09 06:31:39 Kazan
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
* conflicts in cmdline and timerbar.h log entries
* cvs stopped acting like it was on crack obviously
*
* Revision 2.20 2003/11/06 22:47:02 phreak
* added gr_start_**_matrix() and gr_end_**_matrix() around where ships are rendered
*
* Revision 2.19 2003/09/13 08:27:29 Goober5000
* added some minor things, such as code cleanup and the following:
* --turrets will not fire at cargo
* --MAX_SHIELD_SECTIONS substituted for the number 4 in many places
* --supercaps have their own default message bitfields (distinguished from capships)
* --turrets are allowed on fighters
* --jump speed capped at 65m/s, to avoid ship travelling too far
* --non-huge weapons now scale their damage, instead of arbitrarily cutting off
* ----Goober5000
*
* Revision 2.18 2003/09/13 06:02:05 Goober5000
* clean rollback of all of argv's stuff
* --Goober5000
*
* Revision 2.15 2003/08/21 08:31:24 Goober5000
* fixed turret text display for non-laser weapons
* --Goober5000
*
* Revision 2.14 2003/04/29 01:03:23 Goober5000
* implemented the custom hitpoints mod
* --Goober5000
*
* Revision 2.13 2003/01/27 07:46:33 Goober5000
* finished up my fighterbay code - ships will not be able to arrive from or depart into
* fighterbays that have been destroyed (but you have to explicitly say in the tables
* that the fighterbay takes damage in order to enable this)
* --Goober5000
*
* Revision 2.12 2003/01/17 07:59:09 Goober5000
* fixed some really strange behavior with strings not being truncated at the
* # symbol
* --Goober5000
*
* Revision 2.11 2003/01/17 01:48:50 Goober5000
* added capability to the $Texture replace code to substitute the textures
* without needing and extra model, however, this way you can't substitute
* transparent or animated textures
* --Goober5000
*
* Revision 2.10 2003/01/15 20:49:10 Goober5000
* did the XSTR for the turret thing
* --Goober5000
*
* Revision 2.9 2003/01/15 16:52:27 Goober5000
* oops, that'll introduce a bug - naming it just plain "Turret" instead
* --Goober5000
*
* Revision 2.8 2003/01/15 16:48:59 Goober5000
* capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
* --Goober5000
*
* Revision 2.7 2003/01/15 07:09:09 Goober5000
* changed most references to modelnum to use ship instead of ship_info --
* this will help with the change-model sexp and any other instances of model
* changing
* --Goober5000
*
* Revision 2.6 2002/12/14 17:09:28 Goober5000
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
* --Goober5000
*
* Revision 2.5 2002/12/14 01:55:04 Goober5000
* added mission flag to show subsystem damage for fighterbays
* ~Goober5000~
*
* Revision 2.4 2002/10/22 23:02:40 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.3 2002/09/20 20:01:30 phreak
* extra effects during cargo scan
*
* Revision 2.2 2002/08/06 16:50:44 phreak
* added wireframe targetbox feature
*
* Revision 2.2 2002/08/04 23:17:40 phreak
* Did the toggling code for wireframes -> CTRL+SHIFT+Q
*
* Revision 2.2 2002/08/04 21:53:13 phreak
* Changed hud_render_target_asteroid, ...weapon, ...ship to render in wireframe
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.3 2002/05/13 21:09:28 mharris
* I think the last of the networking code has ifndef NO_NETWORK...
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 31 11/02/99 3:22p Jefff
* translation of targetbox text
*
* 30 10/29/99 10:41p Jefff
* more subsystem fixes
*
* 29 10/28/99 11:17p Jefff
* used escape seqs for some special German chars
*
* 28 10/28/99 2:02a Jefff
* revised the subsystem localization
*
* 27 9/14/99 11:03p Jefff
* dont draw target names from # on (weapons case)
*
* 26 9/04/99 5:17p Andsager
* Make event log record name of destroyed subsytem, and use this name for
* different types of turrets
*
* 25 8/25/99 11:35a Andsager
* Move hud render ship subsystem target box for ships with Autocenter
*
* 24 8/17/99 7:32p Jefff
* models use autocenter in target view
*
* 23 8/01/99 12:39p Dave
* Added HUD contrast control key (for nebula).
*
* 22 7/31/99 4:15p Dave
* Fixed supernova particle velocities. Handle OBJ_NONE in target
* monitoring view. Properly use objectives notify gauge colors.
*
* 21 7/28/99 2:49p Andsager
* Make hud target speed use vm_vec_mag (not vm_vec_mag_quick)
*
* 20 7/15/99 9:20a Andsager
* FS2_DEMO initial checkin
*
* 19 7/02/99 10:56a Andsager
* Put in big ship - big ship attack mode. Modify stealth sweep ai.
*
* 18 6/29/99 3:16p Andsager
* Debug stuff.
*
* 17 6/10/99 3:43p Dave
* Do a better job of syncing text colors to HUD gauges.
*
* 16 6/09/99 2:55p Andsager
* Allow multiple asteroid subtypes (of large, medium, small) and follow
* family.
*
* 15 6/07/99 4:20p Andsager
* Add HUD color for tagged object. Apply to target and radar.
*
* 14 6/03/99 11:43a Dave
* Added the ability to use a different model when rendering to the HUD
* target box.
*
* 13 5/24/99 9:02a Andsager
* Remove Int3() in turret subsys name code when turret has no weapon.
*
* 12 5/21/99 1:42p Andsager
* Added error checking for HUD turret name
*
* 11 5/20/99 7:00p Dave
* Added alternate type names for ships. Changed swarm missile table
* entries.
*
* 10 5/19/99 3:50p Andsager
* Show type of debris is debris field (species debris or asteroid). Show
* type of subsystem turret targeted (laser, missile, flak, beam).
*
* 9 5/14/99 4:22p Andsager
* Modify hud_render_target_ship to show damaged subsystems in their
* actual state. Now also shows rotation of subsystems.
*
* 8 4/16/99 5:54p Dave
* Support for on/off style "stream" weapons. Real early support for
* target-painting lasers.
*
* 7 1/07/99 9:08a Jasen
* HUD coords
*
* 6 12/28/98 3:17p Dave
* Support for multiple hud bitmap filenames for hi-res mode.
*
* 5 12/21/98 5:03p Dave
* Modified all hud elements to be multi-resolution friendly.
*
* 4 11/05/98 4:18p Dave
* First run nebula support. Beefed up localization a bit. Removed all
* conditional compiles for foreign versions. Modified mission file
* format.
*
* 3 10/13/98 9:28a Dave
* Started neatening up freespace.h. Many variables renamed and
* reorganized. Added AlphaColors.[h,cpp]
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:49a Dave
*
* 108 8/28/98 3:28p Dave
* EMP effect done. AI effects may need some tweaking as required.
*
* 107 8/25/98 1:48p Dave
* First rev of EMP effect. Player side stuff basically done. Next comes
* AI code.
*
* 106 6/19/98 3:49p Lawrance
* localization tweaks
*
* 105 6/17/98 11:04a Lawrance
* localize subsystem names that appear on the HUD
*
* 104 6/09/98 5:18p Lawrance
* French/German localization
*
* 103 6/09/98 10:31a Hoffoss
* Created index numbers for all xstr() references. Any new xstr() stuff
* added from here on out should be added to the end if the list. The
* current list count can be found in FreeSpace.cpp (search for
* XSTR_SIZE).
*
* 102 6/01/98 11:43a John
* JAS & MK: Classified all strings for localization.
*
* 101 5/20/98 3:52p Allender
* fixed compiler warnings
*
* 100 5/20/98 12:59p John
* Turned optimizations on for debug builds. Also turning on automatic
* function inlining. Turned off the unreachable code warning.
*
* 99 5/15/98 8:36p Lawrance
* Add 'target ship that last sent transmission' target key
*
* 98 5/14/98 11:26a Lawrance
* ensure fighter bays are drawn with correct bracket color
*
* 97 5/08/98 5:32p Lawrance
* Allow cargo scanning even if target gauge is disabled
*
* 96 5/04/98 10:51p Lawrance
* remove unused local
*
* 95 5/04/98 9:17p Lawrance
* Truncate ship class names at # char when displaying debris on target
* moniter
*
* 94 5/04/98 6:12p Lawrance
* Write generic function hud_end_string_at_first_hash_symbol(), to use in
* various spots on the HUD
*
* 93 4/15/98 12:55a Lawrance
* Show time to impact for bombs
*
* 92 4/02/98 6:31p Lawrance
* remove asteroid references if DEMO defined
*
* 91 3/31/98 5:18p John
* Removed demo/save/restore. Made NDEBUG defined compile. Removed a
* bunch of debug stuff out of player file. Made model code be able to
* unload models and malloc out only however many models are needed.
*
*
* 90 3/30/98 1:08a Lawrance
* Implement "blast" icon. Blink HUD icon when player ship is hit by a
* blast.
*
* $NoKeywords: $
*/
#include "hud/hudtargetbox.h"
#include "render/3dinternal.h"
#include "object/object.h"
#include "hud/hud.h"
#include "hud/hudbrackets.h"
#include "model/model.h"
#include "mission/missionparse.h"
#include "debris/debris.h"
#include "playerman/player.h"
#include "gamesnd/gamesnd.h"
#include "freespace2/freespace.h"
#include "io/timer.h"
#include "ship/subsysdamage.h"
#include "graphics/font.h"
#include "asteroid/asteroid.h"
#include "jumpnode/jumpnode.h"
#include "network/multi.h"
#include "weapon/emp.h"
#include "localization/localize.h"
#include "cmdline/cmdline.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#include "parse/parselo.h"
#ifndef NDEBUG
#include "hud/hudets.h"
#endif
int Target_window_coords[GR_NUM_RESOLUTIONS][4] =
{
{ // GR_640
187,368,131,112//8, 362, 131, 112
},
{ // GR_1024
8, 629, 131, 112
}
};
object *Enemy_attacker = NULL;
static int Target_static_next;
static int Target_static_playing;
int Target_static_looping;
#ifndef NDEBUG
extern int Show_target_debug_info;
extern int Show_target_weapons;
#endif
// used to print out + or - after target distance and speed
char* modifiers[] = {
//XSTR:OFF
"+",
"-",
""
//XSTR:ON
};
/*char Target_view_fname[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] = {
"targetview1",
"targetview1"
};
char Target_integ_fname[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] = {
"targetview2",
"targetview2"
};
char Target_extra_fname[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] = {
"targetview3",
"targetview3"
};*/
// animation frames for the target view monitor
// frames: 0 => background of target monitor
// 1 => foreground of target monitor
hud_frames Target_view_gauge;
int Target_view_gauge_loaded = 0;
// animation frames for the extended target information
// frames: 0 => normal gague
hud_frames Target_view_extra;
int Target_view_extra_loaded = 0;
// animation frames for the target view monitor integrity bar
// frames: 0 => dark bar
// 1 => bright bar
hud_frames Target_view_integrity_gauge;
int Target_view_integrity_gauge_loaded = 0;
#define NUM_TBOX_COORDS 13 // keep up to date
#define TBOX_BACKGROUND 0
#define TBOX_NAME 1
#define TBOX_CLASS 2
#define TBOX_DIST 3
#define TBOX_SPEED 4
#define TBOX_CARGO 5
#define TBOX_HULL 6
#define TBOX_EXTRA 7
#define TBOX_EXTRA_ORDERS 8
#define TBOX_EXTRA_TIME 9
#define TBOX_EXTRA_DOCK 10
#define TBOX_SYSTEM 11
#define TBOX_SHIELD 12
int Targetbox_coords[GR_NUM_RESOLUTIONS][NUM_TBOX_COORDS][2] =
{
{ // GR_640
{220,351},//{5,319},
{260,363},//{13,316},
{320,377},//{13,325},
{380,419},//{13,337},
{380,433},//{90,337},
{330,471},//{13,349},
{400,378},//{139,361},
{5,283},
{13,280},
{13,290},
{13,299},
{400,404},
{400,391}
},
{ // GR_1024
{5,590},
{13,587},
{13,597},
{13,608},
{90,608},
{13,620},
{139,632},
{5,555},
{13,552},
{13,561},
{13,570},
{400,391},
{365,465}
}
};
/*int Integrity_bar_coords[GR_NUM_RESOLUTIONS][4] = {
{ // GR_640
320,384, 4, 88//138, 371, 4, 88
},
{ // GR_1024
138, 642, 4, 88
}
};*/
int Integrity_string_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
405,378//112, 372
},
{ // GR_1024
112, 643
}
};
int System_string_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
405, 404
},
{ // GR-1024
405, 391
}
};
int Shield_string_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
405, 391
},
{ // GR-1024
405, 391
}
};
// cargo scanning extents
int Cargo_scan_coords[GR_NUM_RESOLUTIONS][4] = {
{ // GR_640
188,369, 130, 109 //7, 364, 130, 109
},
{ // GR_1024
7, 635, 130, 109
}
};
// first element is time flashing expires, second element is time of next flash
int Targetbox_flash_timers[NUM_TBOX_FLASH_TIMERS][2];
int Targetbox_flash_flags;
// flag to indicate whether to show the extra information about a target
// The HUD_config controls whether this can be shown... but the player can still toggle it on/off
// during the game.
int Targetbox_show_extra_info = 1;
int Targetbox_wire=0;
// Different target states. This drives the text display right below the hull integrity on the targetbox.
#define TS_DIS 0
#define TS_OK 1
#define TS_DMG 2
#define TS_CRT 3
static int Last_ts; // holds last target status.
void hud_blit_target_integrity(int disabled,int force_obj_num = -1);
// cut down long subsystem names to a more manageable length
char *hud_targetbox_truncate_subsys_name(char *outstr)
{
if ( strstr(outstr, XSTR( "communication", 333))) {
strcpy( outstr, XSTR( "comm", 334) );
} else if ( strstr(outstr, XSTR( "navigation", 335))) {
strcpy( outstr, XSTR( "nav", 336) );
} else if (!stricmp(outstr, "Gas Collector")) {
strcpy(outstr, "collector");
}
return outstr;
}
//swich through the valid targetbox modes
void hud_targetbox_switch_wireframe_mode()
{
//0==standard
//1==wireframe only
//2==wireframe with textures
Targetbox_wire++;
if (Targetbox_wire==3)
Targetbox_wire=0;
}
// init a specific targetbox timer
void hud_targetbox_init_flash_timer(int index)
{
Targetbox_flash_timers[index][0] = 1;
Targetbox_flash_timers[index][1] = 1;
Targetbox_flash_flags &= ~(1<<index);
}
// init the timers used to flash different parts of the targetbox. This needs to get called whenever
// the current target changes.
void hud_targetbox_init_flash()
{
hud_targetbox_init_flash_timer(TBOX_FLASH_NAME);
hud_targetbox_init_flash_timer(TBOX_FLASH_CARGO);
hud_targetbox_init_flash_timer(TBOX_FLASH_HULL);
hud_targetbox_init_flash_timer(TBOX_FLASH_STATUS);
hud_targetbox_init_flash_timer(TBOX_FLASH_SUBSYS);
hud_targetbox_init_flash_timer(TBOX_FLASH_DOCKED);
hud_targetbox_init_flash_timer(TBOX_FLASH_SHIELD);
Last_ts = -1;
}
// set the color for flashing text
// input: index => item to flash
// flash_fast => optional param (default value 0), flash twice as fast
// exit: 1 => set bright color
// 0 => set default color
int hud_targetbox_maybe_flash(int index, int flash_fast)
{
int draw_bright=0;
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
if ( !timestamp_elapsed(Targetbox_flash_timers[index][0]) ) {
if ( timestamp_elapsed(Targetbox_flash_timers[index][1]) ) {
if ( flash_fast ) {
Targetbox_flash_timers[index][1] = timestamp(fl2i(TBOX_FLASH_INTERVAL/2.0f));
} else {
Targetbox_flash_timers[index][1] = timestamp(TBOX_FLASH_INTERVAL);
}
Targetbox_flash_flags ^= (1<<index); // toggle between default and bright frames
}
if ( Targetbox_flash_flags & (1<<index) ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
draw_bright=1;
} else {
// hud_set_dim_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_DIM);
}
}
return draw_bright;
}
// init all targetbox flash timers
void hud_targetbox_init_all_timers()
{
int i;
for ( i = 0; i < NUM_TBOX_FLASH_TIMERS; i++ ) {
hud_targetbox_init_flash_timer(i);
}
Last_ts = -1;
}
float Hud_target_object_factor = 1;
// Initialize the data needed for the target view. This is called from HUD_init() once per mission
void hud_targetbox_init()
{
// This scales zoomout views in HTL mode to be similar to the original
if(!Cmdline_nohtl)
Hud_target_object_factor = 2.2f;
/*if (!Target_view_gauge_loaded) {
Target_view_gauge.first_frame = bm_load_animation(Target_view_fname[gr_screen.res], &Target_view_gauge.num_frames);
if ( Target_view_gauge.first_frame < 0 ) {
Warning(LOCATION,"Cannot load hud ani: %s\n", Target_view_fname[gr_screen.res]);
}
Target_view_gauge_loaded = 1;
}
/if (!Target_view_integrity_gauge_loaded) {
Target_view_integrity_gauge.first_frame = bm_load_animation(Target_integ_fname[gr_screen.res], &Target_view_integrity_gauge.num_frames);
if ( Target_view_integrity_gauge.first_frame < 0 ) {
Warning(LOCATION,"Cannot load hud ani: %s\n", Target_integ_fname[gr_screen.res]);
}
Target_view_integrity_gauge_loaded = 1;
}
if (!Target_view_extra_loaded) {
Target_view_extra.first_frame = bm_load_animation(Target_extra_fname[gr_screen.res], &Target_view_extra.num_frames);
if ( Target_view_extra.first_frame < 0 ) {
Warning(LOCATION,"Cannot load hud ani: %s\n", Target_extra_fname[gr_screen.res]);
}
Target_view_extra_loaded = 1;
}*/
hud_targetbox_init_all_timers();
}
// -------------------------------------------------------------------------------------
// hud_save_restore_camera_data()
//
// Called to save and restore the 3D camera settings.
//
void hud_save_restore_camera_data(int save)
{
static vector save_view_position;
static float save_view_zoom;
static matrix save_view_matrix;
static matrix save_eye_matrix;
static vector save_eye_position;
// save global view variables, so we can restore them
if ( save ) {
save_view_position = View_position;
save_view_zoom = View_zoom;
save_view_matrix = View_matrix;
save_eye_matrix = Eye_matrix;
save_eye_position = Eye_position;
}
else {
// restore global view variables
View_position = save_view_position;
View_zoom = save_view_zoom;
View_matrix = save_view_matrix;
Eye_matrix = save_eye_matrix;
Eye_position = save_eye_position;
}
}
// -------------------------------------------------------------------------------------
// hud_render_target_background()
//
// Common set up for drawing the background of the target monitor, for ships/debris/missiles
//
void hud_render_target_background()
{
// blit the background frame
hud_set_gauge_color(HUD_TARGET_MONITOR);
GR_AABITMAP(Target_view_gauge.first_frame, Targetbox_coords[gr_screen.res][TBOX_BACKGROUND][0],Targetbox_coords[gr_screen.res][TBOX_BACKGROUND][1]);
// blit the extra targeting info frame
hud_set_gauge_color(HUD_TARGET_MONITOR_EXTRA_DATA);
}
// -------------------------------------------------------------------------------------
// hud_render_target_setup()
//
// Common set up for the 3d code for drawing the target monitor, for ships/debris/missiles
//
void hud_render_target_setup(vector *camera_eye, matrix *camera_orient, float zoom)
{
// JAS: g3_start_frame uses clip_width and clip_height to determine the
// size to render to. Normally, you would set this by using gr_set_clip,
// but because of the hacked in hud jittering, I couldn't. So come talk
// to me before modifying or reusing the following code. Thanks.
gr_screen.clip_width = Target_window_coords[gr_screen.res][2];
gr_screen.clip_height = Target_window_coords[gr_screen.res][3];
g3_start_frame(1); // Turn on zbuffering
hud_save_restore_camera_data(1);
g3_set_view_matrix( camera_eye, camera_orient, zoom);
model_set_detail_level(1); // use medium detail level
HUD_set_clip(Target_window_coords[gr_screen.res][0],Target_window_coords[gr_screen.res][1],Target_window_coords[gr_screen.res][2],Target_window_coords[gr_screen.res][3]);
if (!Cmdline_nohtl) gr_set_proj_matrix( 0.5f*(4.0f/9.0f) * 3.14159f * zoom, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, MIN_DRAW_DISTANCE, MAX_DRAW_DISTANCE);
if (!Cmdline_nohtl) gr_set_view_matrix(&Eye_position, &Eye_matrix);
}
// -------------------------------------------------------------------------------------
// hud_render_target_close()
//
// Common clean-up after drawing the target monitor, for ships/debris/missiles
//
void hud_render_target_close()
{
if(!Cmdline_nohtl)
{
gr_end_view_matrix();
gr_end_proj_matrix();
}
g3_end_frame();
hud_save_restore_camera_data(0);
}
// -------------------------------------------------------------------------------------
// hud_blit_target_foreground()
//
void hud_blit_target_foreground()
{
hud_set_gauge_color(HUD_TARGET_MONITOR);
GR_AABITMAP(Target_view_gauge.first_frame+1, Targetbox_coords[gr_screen.res][TBOX_BACKGROUND][0],Targetbox_coords[gr_screen.res][TBOX_BACKGROUND][1]);
}
// -------------------------------------------------------------------------------------
// hud_get_target_strength()
//
// Get the shield and hull percentages for a given ship object
//
// input: *objp => pointer to ship object that you want strength values for
// shields => OUTPUT parameter: percentage value of shields (0->1.0)
// integrity => OUTPUT parameter: percentage value of integrity (0->1.0)
//
// Goober5000 - simplified
void hud_get_target_strength(object *objp, float *shields, float *integrity, float *system)
{
*shields = get_shield_pct(objp);
*integrity = get_hull_pct(objp);
*system = get_system_pct(objp);
}
// maybe draw the extra targeted ship information above the target monitor
void hud_targetbox_show_extra_ship_info(ship *target_shipp, ai_info *target_aip)
{
char outstr[256], tmpbuf[256];
int has_orders = 0;
int not_training;
int extra_data_shown=0;
hud_set_gauge_color(HUD_TARGET_MONITOR_EXTRA_DATA);
not_training = !(The_mission.game_type & MISSION_TYPE_TRAINING);
if ( not_training && (hud_gauge_active(HUD_TARGET_MONITOR_EXTRA_DATA)) && (Targetbox_show_extra_info) ) {
// Print out current orders if the targeted ship is friendly
// AL 12-26-97: only show orders and time to target for friendly ships
if ( (Player_ship->team == target_shipp->team) && !(ship_get_SIF(target_shipp) & SIF_NOT_FLYABLE) ) {
extra_data_shown=1;
if ( ship_return_orders(outstr, target_shipp) ) {
gr_force_fit_string(outstr, 255, 350);
has_orders = 1;
} else {
strcpy(outstr, "no orders");
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_EXTRA_ORDERS][0], Targetbox_coords[gr_screen.res][TBOX_EXTRA_ORDERS][1], EG_TBOX_EXTRA1, outstr);
}
if ( has_orders ) {
sprintf(outstr, XSTR( "time to: ", 338));
if ( ship_return_time_to_goal(tmpbuf, target_shipp) ) {
strcat(outstr, tmpbuf);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_EXTRA_TIME][0], Targetbox_coords[gr_screen.res][TBOX_EXTRA_TIME][1], EG_TBOX_EXTRA2, outstr);
}
}
}
// Print out dock status
if ( target_aip->ai_flags & AIF_DOCKED ) {
if ( target_aip->dock_objnum >= 0 ) {
sprintf(outstr, XSTR( "Docked: %s", 339), Ships[Objects[target_aip->dock_objnum].instance].ship_name);
gr_force_fit_string(outstr, 255, 173);
hud_targetbox_maybe_flash(TBOX_FLASH_DOCKED);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_EXTRA_DOCK][0], Targetbox_coords[gr_screen.res][TBOX_EXTRA_DOCK][1], EG_TBOX_EXTRA3, outstr);
extra_data_shown=1;
}
}
if ( extra_data_shown ) {
// hud_set_default_color();
GR_AABITMAP(Target_view_extra.first_frame, Targetbox_coords[gr_screen.res][TBOX_EXTRA][0],Targetbox_coords[gr_screen.res][TBOX_EXTRA][1]);
}
}
// Render a jump node on the target monitor
void hud_render_target_jump_node(object *target_objp)
{
char outstr[256];
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
vector orient_vec, up_vector;
float factor, dist;
int hx, hy, w, h;
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);
factor = target_objp->radius*4.0f;
// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.vec.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);
// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
jumpnode_render( target_objp, &obj_pos );
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, Jump_nodes[target_objp->instance].name);
dist = vm_vec_dist_quick(&target_objp->pos, &Player_obj->pos);
// account for hud shaking
hx = fl2i(HUD_offset_x);
hy = fl2i(HUD_offset_y);
sprintf(outstr,XSTR( "d: %.0f", 340), dist);
hud_num_make_mono(outstr);
gr_get_string_size(&w,&h,outstr);
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_DIST][0]+hx, Targetbox_coords[gr_screen.res][TBOX_DIST][1]+hy, EG_TBOX_DIST, outstr);
}
// -------------------------------------------------------------------------------------
// hud_render_target_asteroid()
//
// Render a piece of asteroid on the target monitor
//
void hud_render_target_asteroid(object *target_objp)
{
#ifndef FS2_DEMO
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
asteroid *asteroidp;
vector orient_vec, up_vector;
int target_team;
float time_to_impact, factor;
int subtype;
int flags=0; //draw flags for wireframe
asteroidp = &Asteroids[target_objp->instance];
target_team = obj_team(target_objp);
subtype = asteroidp->asteroid_subtype;
time_to_impact = asteroid_time_to_impact(target_objp);
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);
factor = 2*target_objp->radius;
// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.vec.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);
// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f * Hud_target_object_factor);
model_clear_instance(Asteroid_info[asteroidp->type].model_num[subtype]);
if (Targetbox_wire!=0)
{
if (time_to_impact>=0)
model_set_outline_color(255,255,255);
else
model_set_outline_color(64,64,0);
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, flags |MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
// hud print type of Asteroid (debris)
char hud_name[64];
switch (asteroidp->type) {
case ASTEROID_TYPE_SMALL:
case ASTEROID_TYPE_MEDIUM:
case ASTEROID_TYPE_BIG:
strcpy(hud_name, NOX("asteroid"));
break;
case DEBRIS_TERRAN_SMALL:
case DEBRIS_TERRAN_MEDIUM:
case DEBRIS_TERRAN_LARGE:
strcpy(hud_name, NOX("debris"));
break;
case DEBRIS_VASUDAN_SMALL:
case DEBRIS_VASUDAN_MEDIUM:
case DEBRIS_VASUDAN_LARGE:
strcpy(hud_name, NOX("vasudan debris"));
break;
case DEBRIS_SHIVAN_SMALL:
case DEBRIS_SHIVAN_MEDIUM:
case DEBRIS_SHIVAN_LARGE:
strcpy(hud_name, NOX("shivan debris"));
break;
default:
Int3();
}
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, hud_name);
if ( time_to_impact >= 0.0f ) {
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, NOX("impact: %.1f sec"), time_to_impact);
}
#endif
}
void get_turret_subsys_name(model_subsystem *system_info, char *outstr)
{
Assert(system_info); // Goober5000
Assert(system_info->type == SUBSYSTEM_TURRET);
if (system_info->turret_weapon_type >= 0) {
// check if beam or flak using weapon flags
if (Weapon_info[system_info->turret_weapon_type].wi_flags & WIF_FLAK) {
sprintf(outstr, "%s", XSTR("Flak turret", 1566));
} else if (Weapon_info[system_info->turret_weapon_type].wi_flags & WIF_BEAM) {
sprintf(outstr, "%s", XSTR("Beam turret", 1567));
} else {
if (Weapon_info[system_info->turret_weapon_type].subtype == WP_LASER) {
// ballistic too! - Goober5000
if (Weapon_info[system_info->turret_weapon_type].wi_flags2 & WIF2_BALLISTIC)
{
sprintf(outstr, "%s", XSTR("Turret", 1487));
}
// the TVWP has some primaries flagged as bombs
else if (Weapon_info[system_info->turret_weapon_type].wi_flags & WIF_BOMB)
{
sprintf(outstr, "%s", XSTR("Missile lnchr", 1569));
}
else
{
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
}
} else if (Weapon_info[system_info->turret_weapon_type].subtype == WP_MISSILE) {
sprintf(outstr, "%s", XSTR("Missile lnchr", 1569));
} else {
// Illegal subtype
Int3();
sprintf(outstr, "%s", XSTR("Turret", 1487));
}
}
} else {
// This should not happen
sprintf(outstr, "%s", NOX("Unused"));
}
}
// -------------------------------------------------------------------------------------
// hud_render_target_ship_info()
//
// Render the data for a ship on the target monitor. Called by hud_render_target_ship().
//
void hud_render_target_ship_info(object *target_objp)
{
ship *target_shipp;
ship_info *target_sip;
ai_info *target_aip;
int w,h,screen_integrity=1, base_index;
char outstr[256];
float ship_integrity, shield_strength, ship_system;
Assert(target_objp); // Goober5000
Assert(target_objp->type == OBJ_SHIP);
target_shipp = &Ships[target_objp->instance];
target_sip = &Ship_info[target_shipp->ship_info_index];
target_aip = &Ai_info[target_shipp->ai_index];
strcpy( outstr, target_shipp->ship_name );
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
hud_set_iff_color(target_objp, 1);
} else {
// Print out ship name, with wing name if it exists
if ( hud_targetbox_maybe_flash(TBOX_FLASH_NAME) ) {
hud_set_iff_color(target_objp, 1);
} else {
hud_set_iff_color(target_objp);
}
}
// take ship "copies" into account before printing ship class name.
base_index = target_shipp->ship_info_index;
if ( target_sip->flags & SIF_SHIP_COPY )
base_index = ship_info_base_lookup( target_shipp->ship_info_index );
// maybe do some translation
if (Lcl_gr) {
lcl_translate_targetbox_name(outstr);
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);
// print out ship class
char temp_name[NAME_LENGTH+2] = "";
// if this ship has an alternate type name
if(target_shipp->alt_type_index >= 0){
mission_parse_lookup_alt_index(target_shipp->alt_type_index, temp_name);
} else {
strcpy(temp_name, Ship_info[base_index].short_name);
end_string_at_first_hash_symbol(temp_name);
}
if (Lcl_gr) {
lcl_translate_targetbox_name(temp_name);
}
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, temp_name);
ship_integrity = 1.0f;
shield_strength = 1.0f;
ship_system = 1.0f;
hud_get_target_strength(target_objp, &shield_strength, &ship_integrity, &ship_system);
// convert to values of 0->100
shield_strength *= 100.0f;
ship_integrity *= 100.0f;
ship_system *= 100.0f;
screen_integrity = fl2i(ship_integrity+0.5f);
if ( screen_integrity == 0 ) {
if ( ship_integrity > 0 ) {
screen_integrity = 1;
}
}
// Print out right-justified integrity
sprintf(outstr,XSTR( "%d%%", 341), screen_integrity);
gr_get_string_size(&w,&h,outstr);
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
} else {
hud_targetbox_maybe_flash(TBOX_FLASH_HULL);
}
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_HULL][0]-w, Targetbox_coords[gr_screen.res][TBOX_HULL][1], EG_TBOX_HULL, "%s", outstr);
hud_set_gauge_color(HUD_TARGET_MONITOR);
screen_integrity = fl2i(ship_system);
sprintf(outstr, "%d%%", screen_integrity);
gr_get_string_size(&w,&h,outstr);
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_SYSTEM][0]-w, Targetbox_coords[gr_screen.res][TBOX_SYSTEM][1], EG_TBOX_SYSTEM, "%s", outstr);
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
} else {
hud_targetbox_maybe_flash(TBOX_FLASH_SYSTEM);
}
screen_integrity = fl2i(shield_strength);
sprintf(outstr, "%d%%", screen_integrity);
gr_get_string_size(&w,&h,outstr);
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_SHIELD][0]-w, Targetbox_coords[gr_screen.res][TBOX_SHIELD][1], EG_TBOX_SHIELD, "%s", outstr);
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
} else {
hud_targetbox_maybe_flash(TBOX_FLASH_SHIELD);
}
// print out the targeted sub-system and % integrity
if (Player_ai->targeted_subsys != NULL) {
shield_strength = Player_ai->targeted_subsys->current_hits/Player_ai->targeted_subsys->max_hits * 100.0f;
screen_integrity = fl2i(shield_strength+0.5f);
if ( screen_integrity < 0 ) {
screen_integrity = 0;
}
if ( screen_integrity == 0 ) {
if ( shield_strength > 0 ) {
screen_integrity = 1;
}
}
// Goober5000 - don't flash if this subsystem can't be destroyed
if ( ship_subsys_takes_damage(Player_ai->targeted_subsys) )
{
if ( screen_integrity <= 0 ){
hud_targetbox_start_flash(TBOX_FLASH_SUBSYS); // need to flash 0% continuously
hud_targetbox_maybe_flash(TBOX_FLASH_SUBSYS);
}
}
// PRINT SUBSYS NAME
// hud_set_default_color();
// get turret subsys name
if (Player_ai->targeted_subsys->system_info->type == SUBSYSTEM_TURRET) {
get_turret_subsys_name(Player_ai->targeted_subsys->system_info, outstr);
} else {
sprintf(outstr, "%s", Player_ai->targeted_subsys->system_info->name);
}
hud_targetbox_truncate_subsys_name(outstr);
gr_printf(Target_window_coords[gr_screen.res][0]+2, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3]-h, outstr);
// AL 23-3-98: Fighter bays are a special case. Player cannot destroy them, so don't
// show the subsystem strength
// Goober5000: don't display any strength if we can't destroy this subsystem - but sometimes
// fighterbays can be destroyed
if ( ship_subsys_takes_damage(Player_ai->targeted_subsys) )
{
sprintf(outstr,XSTR( "%d%%", 341),screen_integrity);
gr_get_string_size(&w,&h,outstr);
gr_printf(Target_window_coords[gr_screen.res][0]+Target_window_coords[gr_screen.res][2]-w-1, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3] - h, "%s", outstr);
}
hud_set_gauge_color(HUD_TARGET_MONITOR);
}
// print out 'disabled' on the monitor if the target is disabled
if (target_shipp->flags2 & SF2_DISABLED) {//|| (ship_subsys_disrupted(target_shipp, SUBSYSTEM_ENGINE)) ) {
if ( target_shipp->flags2 & SF2_DISABLED ) {
sprintf(outstr, XSTR( "DISABLED", 342));
} else {
sprintf(outstr, XSTR( "DISRUPTED", 343));
}
gr_get_string_size(&w,&h,outstr);
gr_printf(Target_window_coords[gr_screen.res][0]+Target_window_coords[gr_screen.res][2]/2 - w/2 - 1, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3] - 2*h, "%s", outstr);
}
hud_targetbox_show_extra_ship_info(target_shipp, target_aip);
}
// call to draw the integrity bar that is on the right of the target monitor
void hud_blit_target_integrity(int disabled,int force_obj_num)
{
object *objp;
// int clip_h;
char buf[16];
int current_ts;
if ( Target_view_integrity_gauge.first_frame == -1 )
return;
/* if ( disabled ) {
GR_AABITMAP(Target_view_integrity_gauge.first_frame, Integrity_bar_coords[gr_screen.res][0], Integrity_bar_coords[gr_screen.res][1]);
return;
}*/
if(force_obj_num == -1){
Assert(Player_ai->target_objnum >= 0 );
objp = &Objects[Player_ai->target_objnum];
} else {
// Goober5000: what the... this probably should be changed
//objp = &Objects[Player_ai->target_objnum];
objp = &Objects[force_obj_num];
}
// clip_h = fl2i( (1 - Pl_target_integrity) * Integrity_bar_coords[gr_screen.res][3] );
// print out status of ship
if ( (Ships[objp->instance].flags & SF_ENGINES_DISABLED) || (ship_subsys_disrupted(&Ships[objp->instance], SUBSYSTEM_ENGINE)) ) {
sprintf(buf,"eg dis");
current_ts = TS_DIS;
} else {
if ( Pl_target_integrity > 0.9 ) {
sprintf(buf,"hull");
current_ts = TS_OK;
} else if ( Pl_target_integrity > 0.2 ) {
sprintf(buf,XSTR( "dmg", 346));
current_ts = TS_DMG;
} else {
sprintf(buf,XSTR( "crt", 347));
current_ts = TS_CRT;
}
}
if ( Last_ts != -1 && current_ts != Last_ts ) {
hud_targetbox_start_flash(TBOX_FLASH_STATUS);
}
Last_ts = current_ts;
hud_targetbox_maybe_flash(TBOX_FLASH_STATUS);
emp_hud_string(Integrity_string_coords[gr_screen.res][0], Integrity_string_coords[gr_screen.res][1], EG_TBOX_INTEG, buf);
if ( (Ships[objp->instance].flags2 & SF2_DISABLED) ) {
sprintf(buf, "sys");
current_ts = TS_CRT;
} else {
sprintf(buf, "sys");
current_ts = TS_OK;
}
emp_hud_string(System_string_coords[gr_screen.res][0], System_string_coords[gr_screen.res][1], EG_TBOX_SYSTEM, buf);
emp_hud_string(Shield_string_coords[gr_screen.res][0], Shield_string_coords[gr_screen.res][1], EG_TBOX_SHIELD, "shd");
//hud_set_gauge_color(HUD_TARGET_MONITOR);
//bm_get_info(Target_view_integrity_gauge.first_frame,&w,&h);
/*if ( clip_h > 0 ) {
// draw the dark portion
GR_AABITMAP_EX(Target_view_integrity_gauge.first_frame, Integrity_bar_coords[gr_screen.res][0], Integrity_bar_coords[gr_screen.res][1], w, clip_h,0,0);
}
if ( clip_h <= Integrity_bar_coords[gr_screen.res][3] ) {
// draw the bright portion
GR_AABITMAP_EX(Target_view_integrity_gauge.first_frame+1, Integrity_bar_coords[gr_screen.res][0], Integrity_bar_coords[gr_screen.res][1]+clip_h,w,h-clip_h,0,clip_h);
}*/
}
// determine if the subsystem is in line-of sight, without taking into accout whether the player ship is
// facing the subsystem
int hud_targetbox_subsystem_in_view(object *target_objp, int *sx, int *sy)
{
ship_subsys *subsys;
vector subobj_pos;
vertex subobj_vertex;
int rval = -1;
polymodel *pm;
subsys = Player_ai->targeted_subsys;
if (subsys != NULL ) {
vm_vec_unrotate(&subobj_pos, &subsys->system_info->pnt, &target_objp->orient);
vm_vec_add2(&subobj_pos, &target_objp->pos);
// is it subsystem in view
if ( Player->subsys_in_view == -1 ) {
rval = ship_subsystem_in_sight(target_objp, subsys, &View_position, &subobj_pos, 0);
} else {
rval = Player->subsys_in_view;
}
// get screen coords, adjusting for autocenter
Assert(target_objp->type == OBJ_SHIP);
if (target_objp->type == OBJ_SHIP) {
pm = model_get(Ships[target_objp->instance].modelnum);
if (pm->flags & PM_FLAG_AUTOCEN) {
vector temp, delta;
vm_vec_copy_scale(&temp, &pm->autocenter, -1.0f);
vm_vec_unrotate(&delta, &temp, &target_objp->orient);
vm_vec_add2(&subobj_pos, &delta);
}
}
g3_rotate_vertex(&subobj_vertex, &subobj_pos);
g3_project_vertex(&subobj_vertex);
*sx = (int) subobj_vertex.sx;
*sy = (int) subobj_vertex.sy;
}
return rval;
}
void hud_update_cargo_scan_sound()
{
if ( Player->cargo_inspect_time <= 0 ) {
player_stop_cargo_scan_sound();
return;
}
player_maybe_start_cargo_scan_sound();
}
// If the player is scanning for cargo, draw some cool scanning lines on the target monitor
void hud_maybe_render_cargo_scan(ship_info *target_sip)
{
int x1, y1, x2, y2;
int scan_time; // time required to scan ship
if ( Player->cargo_inspect_time <= 0 ) {
return;
}
scan_time = target_sip->scan_time;
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
// draw horizontal scan line
x1 = Cargo_scan_coords[gr_screen.res][0];
y1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][1] + ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][3] ));
x2 = x1 + Cargo_scan_coords[gr_screen.res][2];
gr_line(x1, y1, x2, y1);
// RT Changed this to be optional
//if(Cmdline_phreak) {
// added 2nd horizontal scan line - phreak
y1 = fl2i(Cargo_scan_coords[gr_screen.res][1] + Cargo_scan_coords[gr_screen.res][3] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][3] ));
gr_line(x1, y1, x2, y1);
//}
// draw vertical scan line
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][0] + ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
y1 = Cargo_scan_coords[gr_screen.res][1];
y2 = y1 + Cargo_scan_coords[gr_screen.res][3];
gr_line(x1, y1-3, x1, y2-1);
// RT Changed this to be optional
//if(Cmdline_phreak) {
// added 2nd vertical scan line - phreak
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][2] + Cargo_scan_coords[gr_screen.res][0] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
gr_line(x1, y1-3, x1, y2-1);
//}
}
// Get the eye position for an object at the origin, called from hud_render_target_ship()
// input: eye_pos => Global pos for eye (output parameter)
// orient => Orientation of object at the origin
void hud_targetbox_get_eye(vector *eye_pos, matrix *orient, int ship_num)
{
ship *shipp;
polymodel *pm;
eye *ep;
vector origin = {0.0f, 0.0f, 0.0f};
shipp = &Ships[ship_num];
pm = model_get( shipp->modelnum );
// If there is no eye, don't do anything
if ( pm->n_view_positions == 0 ) {
return;
}
ep = &(pm->view_positions[0] );
model_find_world_point( eye_pos, &ep->pnt, shipp->modelnum, ep->parent, orient, &origin );
}
// -------------------------------------------------------------------------------------
// hud_render_target_ship()
//
// Render a ship to the target monitor
//
void hud_render_target_ship(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
ship *target_shipp;
ship_info *target_sip;
vector orient_vec, up_vector;
int sx, sy;
int subsys_in_view;
float factor;
target_shipp = &Ships[target_objp->instance];
target_sip = &Ship_info[target_shipp->ship_info_index];
int flags=0;
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);
factor = -target_sip->closeup_pos.xyz.z;
// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.vec.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);
// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
// set camera eye to eye of ship relative to origin
// hud_targetbox_get_eye(&camera_eye, &camera_orient, Player_obj->instance);
// RT, changed scaling here
hud_render_target_setup(&camera_eye, &camera_orient, target_sip->closeup_zoom * Hud_target_object_factor);
// model_clear_instance(target_shipp->modelnum);
ship_model_start( target_objp );
if (Targetbox_wire!=0)
{
//set team colors
if (target_shipp->team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_shipp->team==TEAM_FRIENDLY)) ||
(target_shipp->team==TEAM_HOSTILE) || (target_shipp->team==TEAM_NEUTRAL))
{
model_set_outline_color(255,0,0);
}
else if (target_shipp->team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}
else
{
model_set_outline_color(255,255,255);
}
//if a ship is tagged, it overrides team colors
if (ship_is_tagged(target_objp))
{
model_set_outline_color(255,255,0);
}
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
// maybe render a special hud-target-only model
if(target_sip->modelnum_hud >= 0){
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
} else {
model_render( target_shipp->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, target_shipp->replacement_textures);
}
ship_model_stop( target_objp );
sx = 0;
sy = 0;
// check if subsystem target has changed
if ( Player_ai->targeted_subsys == Player_ai->last_subsys_target ) {
vector save_pos;
save_pos = target_objp->pos;
target_objp->pos = obj_pos;
subsys_in_view = hud_targetbox_subsystem_in_view(target_objp, &sx, &sy);
target_objp->pos = save_pos;
if ( subsys_in_view != -1 ) {
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
// Goober5000 - hm, caught a tricky bug for destroyable fighterbays
if ( (Player_ai->targeted_subsys->current_hits <= 0) && ship_subsys_takes_damage(Player_ai->targeted_subsys) ) {
gr_set_color_fast(&IFF_colors[IFF_COLOR_MESSAGE][1]);
} else {
hud_set_iff_color( target_objp, 1 );
}
if ( subsys_in_view ) {
draw_brackets_square_quick(sx - 10, sy - 10, sx + 10, sy + 10);
} else {
draw_brackets_diamond_quick(sx - 10, sy - 10, sx + 10, sy + 10);
}
}
}
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(0,OBJ_INDEX(target_objp));
hud_set_gauge_color(HUD_TARGET_MONITOR);
hud_render_target_ship_info(target_objp);
hud_maybe_render_cargo_scan(target_sip);
}
// -------------------------------------------------------------------------------------
// hud_render_target_debris()
//
// Render a piece of debris on the target monitor
//
void hud_render_target_debris(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
debris *debrisp;
vector orient_vec, up_vector;
int target_team, base_index;
float factor;
int flags=0;
debrisp = &Debris[target_objp->instance];
//target_sip = &Ship_info[debrisp->ship_info_index];
target_team = obj_team(target_objp);
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);
factor = 2*target_objp->radius;
// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.vec.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);
// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
if (Targetbox_wire!=0)
{
model_set_outline_color(255,255,255);
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f * Hud_target_object_factor);
model_clear_instance(debrisp->model_num);
// This calls the colour that doesnt get reset
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// take ship "copies" into account before printing out ship class information
base_index = debrisp->ship_info_index;
if ( Ship_info[base_index].flags & SIF_SHIP_COPY )
base_index = ship_info_base_lookup( debrisp->ship_info_index );
Assert(base_index >= 0); // Goober5000
// print out ship class that debris came from
char printable_ship_class[NAME_LENGTH];
strcpy(printable_ship_class, Ship_info[base_index].name);
end_string_at_first_hash_symbol(printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, XSTR( "debris", 348));
}
// -------------------------------------------------------------------------------------
// hud_render_target_weapon()
//
// Render a missile or a missile view to the target monitor
//
void hud_render_target_weapon(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
vector orient_vec, up_vector;
weapon_info *target_wip = NULL;
weapon *wp = NULL;
object *viewer_obj, *viewed_obj;
int *replacement_textures = NULL;
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
float factor;
char outstr[100]; // temp buffer
int flags=0;
target_team = obj_team(target_objp);
wp = &Weapons[target_objp->instance];
target_wip = &Weapon_info[wp->weapon_info_index];
is_homing = FALSE;
if ( target_wip->wi_flags & WIF_HOMING && wp->homing_object != &obj_used_list )
is_homing = TRUE;
is_player_missile = FALSE;
if ( target_objp->parent_sig == Player_obj->signature ) {
is_player_missile = TRUE;
}
if ( Detail.targetview_model ) {
viewer_obj = Player_obj;
viewed_obj = target_objp;
missile_view = FALSE;
viewed_model_num = target_wip->model_num;
if ( is_homing && is_player_missile ) {
viewer_obj = target_objp;
viewed_obj = wp->homing_object;
missile_view = TRUE;
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
replacement_textures = Ships[wp->homing_object->instance].replacement_textures;
}
if (Targetbox_wire!=0)
{
if (target_team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_team==TEAM_FRIENDLY)) ||
(target_team==TEAM_HOSTILE) || (target_team==TEAM_NEUTRAL))
{
model_set_outline_color(128,128,0);
}
else if (target_team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}
else
{
model_set_outline_color(255,255,255);
}
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &viewed_obj->pos, &viewer_obj->pos);
vm_vec_normalize(&orient_vec);
if ( missile_view == FALSE )
factor = 2*target_objp->radius;
else
factor = vm_vec_dist_quick(&viewer_obj->pos, &viewed_obj->pos);
// use the viewer's up vector, and construct the viewers orientation matrix
up_vector = viewer_obj->orient.vec.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);
// normalize the vector from the viewer to the viwed target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3 * Hud_target_object_factor);
model_clear_instance(viewed_model_num);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, replacement_textures);
hud_render_target_close();
}
HUD_reset_clip();
if ( is_homing == TRUE ) {
hud_blit_target_foreground();
} else {
hud_blit_target_foreground();
}
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
// print out the weapon class name
sprintf( outstr,"%s", target_wip->name );
gr_get_string_size(&w,&h,outstr);
// drop name past the # sign
end_string_at_first_hash_symbol(outstr);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);
// If a homing weapon, show time to impact
if ( is_homing ) {
float dist, speed;
dist = vm_vec_dist(&target_objp->pos, &wp->homing_object->pos);
speed = vm_vec_mag(&target_objp->phys_info.vel);
if ( speed > 0 ) {
sprintf(outstr, NOX("impact: %.1f sec"), dist/speed);
} else {
sprintf(outstr, XSTR( "unknown", 349));
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, outstr);
}
}
// -------------------------------------------------------------------------------------
// hud_render_target_model() will render the target in the small targetting box. The box
// is then shaded to give a monochrome effect
//
void hud_render_target_model()
{
object *target_objp;
if ( !hud_gauge_active(HUD_TARGET_MONITOR) )
return;
if ( Player_ai->target_objnum == -1)
return;
if ( Target_static_playing )
return;
target_objp = &Objects[Player_ai->target_objnum];
// Draw the background frame
hud_render_target_background();
switch ( target_objp->type ) {
case OBJ_SHIP:
hud_render_target_ship(target_objp);
break;
case OBJ_DEBRIS:
hud_render_target_debris(target_objp);
break;
case OBJ_WEAPON:
hud_render_target_weapon(target_objp);
break;
case OBJ_ASTEROID:
hud_render_target_asteroid(target_objp);
break;
case OBJ_JUMP_NODE:
hud_render_target_jump_node(target_objp);
break;
default:
// Error(LOCATION, "Trying to show object type %d on target monitor\n", target_objp->type);
hud_cease_targeting();
break;
} // end switch
}
void hud_cargo_scan_update(object *targetp, float frametime)
{
char outstr[256]; // temp buffer for sprintf'ing hud output
int hx, hy;
// Account for HUD shaking
hx = fl2i(HUD_offset_x);
hy = fl2i(HUD_offset_y);
// display cargo inspection status
if ( targetp->type == OBJ_SHIP ) {
if ( player_inspect_cargo(frametime, outstr) ) {
if ( hud_gauge_active(HUD_TARGET_MONITOR) ) {
if ( Player->cargo_inspect_time > 0 ) {
hud_targetbox_start_flash(TBOX_FLASH_CARGO);
}
// Print out what the cargo is
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_TARGET_MONITOR, HUD_C_BRIGHT);
} else {
hud_targetbox_maybe_flash(TBOX_FLASH_CARGO);
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CARGO][0]+hx, Targetbox_coords[gr_screen.res][TBOX_CARGO][1]+hy, EG_TBOX_CARGO, outstr);
hud_set_gauge_color(HUD_TARGET_MONITOR);
}
}
} // end if (is_ship)
}
// -----------------------------------------------------------------------------------
// hud_show_target_data() will display the data about the target in and
// around the targetting window
//
void hud_show_target_data(float frametime)
{
char outstr[256]; // temp buffer for sprintf'ing hud output
int w,h; // width and height of string about to print
object *target_objp;
ship *shipp = NULL;
debris *debrisp = NULL;
ship_info *sip = NULL;
int is_ship = 0;
hud_set_gauge_color(HUD_TARGET_MONITOR);
target_objp = &Objects[Player_ai->target_objnum];
switch( Objects[Player_ai->target_objnum].type ) {
case OBJ_SHIP:
shipp = &Ships[target_objp->instance];
sip = &Ship_info[shipp->ship_info_index];
is_ship = 1;
break;
case OBJ_DEBRIS:
debrisp = &Debris[target_objp->instance];
sip = &Ship_info[debrisp->ship_info_index];
break;
case OBJ_WEAPON:
sip = NULL;
break;
case OBJ_ASTEROID:
sip = NULL;
break;
case OBJ_JUMP_NODE:
return;
default:
Int3(); // can't happen
break;
}
int hx, hy;
// Account for HUD shaking
hx = fl2i(HUD_offset_x);
hy = fl2i(HUD_offset_y);
// print out the target distance and speed
sprintf(outstr,XSTR( "d: %.0f%s", 350), Player_ai->current_target_distance, modifiers[Player_ai->current_target_dist_trend]);
hud_num_make_mono(outstr);
gr_get_string_size(&w,&h,outstr);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_DIST][0]+hx, Targetbox_coords[gr_screen.res][TBOX_DIST][1]+hy, EG_TBOX_DIST, outstr);
float spd;
#if 0
spd = vm_vec_dist(&target_objp->pos, &target_objp->last_pos) / frametime;
#endif
// 7/28/99 DKA: Do not use vec_mag_quick -- the error is too big
spd = vm_vec_mag(&target_objp->phys_info.vel);
// spd = target_objp->phys_info.fspeed;
if ( spd < 0.1 ) {
spd = 0.0f;
}
// if the speed is 0, determine if we are docked with something -- if so, get the velocity from
// our docked object instead
if ( (spd == 0.0f) && is_ship ) {
ai_info *aip;
object *other_objp;
aip = &Ai_info[shipp->ai_index];
if ( aip->ai_flags & AIF_DOCKED ) {
Assert( aip->dock_objnum != -1 );
other_objp = &Objects[aip->dock_objnum];
spd = other_objp->phys_info.fspeed;
if ( spd < 0.1 )
spd = 0.0f;
}
}
sprintf(outstr, XSTR( "s: %.0f%s", 351), spd, (spd>1)?modifiers[Player_ai->current_target_speed_trend]:"");
hud_num_make_mono(outstr);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_SPEED][0]+hx, Targetbox_coords[gr_screen.res][TBOX_SPEED][1]+hy, EG_TBOX_SPEED, outstr);
//
// output target info for debug purposes only, this will be removed later
//
#ifndef NDEBUG
//XSTR:OFF
char outstr2[256];
if ( Show_target_debug_info && (is_ship == 1) ) {
int sx, sy, dy;
sx = 5;
dy = gr_get_font_height() + 1;
sy = 300 - 7*dy;
gr_set_color_fast(&HUD_color_debug);
if ( shipp->ai_index >= 0 ) {
ai_info *aip = &Ai_info[shipp->ai_index];
sprintf(outstr,"AI: %s",Ai_behavior_names[aip->mode]);
switch (aip->mode) {
case AIM_CHASE:
Assert(aip->submode <= SM_BIG_PARALLEL); // Must be <= largest chase submode value.
// sprintf(outstr,"AI: %s",Submode_text[aip->submode]);
sprintf(outstr2," / %s",Submode_text[aip->submode]);
strcat(outstr,outstr2);
break;
case AIM_STRAFE:
Assert(aip->submode <= AIS_STRAFE_POSITION); // Must be <= largest chase submode value.
// sprintf(outstr,"AI: %s",Strafe_submode_text[aip->submode-AIS_STRAFE_ATTACK]);
sprintf(outstr2," / %s",Strafe_submode_text[aip->submode-AIS_STRAFE_ATTACK]);
strcat(outstr,outstr2);
break;
case AIM_WAYPOINTS:
// gr_printf(sx, sy, "Wpnum: %i",aip->wp_index);
sprintf(outstr2," / Wpnum: %i",aip->wp_index);
strcat(outstr,outstr2);
break;
default:
break;
}
gr_printf(sx, sy, outstr);
sy += dy;
gr_printf(sx, sy, "Max speed = %d, (%d%%)", (int) shipp->current_max_speed, (int) (100.0f * vm_vec_mag(&target_objp->phys_info.vel)/shipp->current_max_speed));
sy += dy;
// data can be found in target montior
// gr_printf(TARGET_WINDOW_X1+TARGET_WINDOW_WIDTH+3, TARGET_WINDOW_Y1+5*h, "Shields: %d", (int) Players[Player_num].current_target->ship_initial_shield_strength);
if (aip->target_objnum != -1) {
char target_str[32];
float dot, dist;
vector v2t;
if (aip->target_objnum == Player_obj-Objects)
strcpy(target_str, "Player!");
else
sprintf(target_str, "%s", Ships[Objects[aip->target_objnum].instance].ship_name);
// gr_printf(TARGET_WINDOW_X1+TARGET_WINDOW_WIDTH+2, TARGET_WINDOW_Y1+4*h, "Target: %s", target_str);
gr_printf(sx, sy, "Targ: %s", target_str);
sy += dy;
dist = vm_vec_dist_quick(&Objects[Player_ai->target_objnum].pos, &Objects[aip->target_objnum].pos);
vm_vec_normalized_dir(&v2t,&Objects[aip->target_objnum].pos, &Objects[Player_ai->target_objnum].pos);
dot = vm_vec_dot(&v2t, &Objects[Player_ai->target_objnum].orient.vec.fvec);
// data can be found in target montior
// gr_printf(TARGET_WINDOW_X1+TARGET_WINDOW_WIDTH+3, TARGET_WINDOW_Y1+6*h, "Targ dist: %5.1f", dist);
// gr_printf(TARGET_WINDOW_X1+TARGET_WINDOW_WIDTH+2, TARGET_WINDOW_Y1+5*h, "Targ dot: %3.2f", dot);
gr_printf(sx, sy, "Targ dot: %3.2f", dot);
sy += dy;
// gr_printf(TARGET_WINDOW_X1+TARGET_WINDOW_WIDTH+2, TARGET_WINDOW_Y1+6*h, "Targ dst: %3.2f", dist);
gr_printf(sx, sy, "Targ dst: %3.2f", dist);
sy += dy;
if ( aip->targeted_subsys != NULL ) {
sprintf(outstr, "Subsys: %s", aip->targeted_subsys->system_info->name);
gr_printf(sx, sy, outstr);
}
sy += dy;
}
// print out energy transfer information on the ship
sy = 70;
sprintf(outstr,"MAX G/E: %.0f/%.0f",shipp->weapon_energy,shipp->current_max_speed);
gr_printf(sx, sy, outstr);
sy += dy;
sprintf(outstr,"G/S/E: %.2f/%.2f/%.2f",Energy_levels[shipp->weapon_recharge_index],Energy_levels[shipp->shield_recharge_index],Energy_levels[shipp->engine_recharge_index]);
gr_printf(sx, sy, outstr);
sy += dy;
// Show information about attacker.
{
int found = 0;
if (Enemy_attacker != NULL)
if (Enemy_attacker->type == OBJ_SHIP) {
ship *eshipp;
ai_info *eaip;
float dot, dist;
vector v2t;
eshipp = &Ships[Enemy_attacker->instance];
eaip = &Ai_info[eshipp->ai_index];
if (eaip->target_objnum == Player_obj-Objects) {
found = 1;
dist = vm_vec_dist_quick(&Enemy_attacker->pos, &Player_obj->pos);
vm_vec_normalized_dir(&v2t,&Objects[eaip->target_objnum].pos, &Enemy_attacker->pos);
dot = vm_vec_dot(&v2t, &Enemy_attacker->orient.vec.fvec);
gr_printf(sx, sy, "#%i: %s", Enemy_attacker-Objects, Ships[Enemy_attacker->instance].ship_name);
sy += dy;
gr_printf(sx, sy, "Targ dist: %5.1f", dist);
sy += dy;
gr_printf(sx, sy, "Targ dot: %3.2f", dot);
sy += dy;
}
}
if (Player_ai->target_objnum == Enemy_attacker - Objects)
found = 0;
if (!found) {
int i;
Enemy_attacker = NULL;
for (i=0; i<MAX_OBJECTS; i++)
if (Objects[i].type == OBJ_SHIP) {
int enemy;
if (i != Player_ai->target_objnum) {
enemy = Ai_info[Ships[Objects[i].instance].ai_index].target_objnum;
if (enemy == Player_obj-Objects) {
Enemy_attacker = &Objects[i];
break;
}
}
}
}
}
// Show target size
// hud_target_w
gr_printf(sx, sy, "Targ size: %dx%d", Hud_target_w, Hud_target_h );
sy += dy;
polymodel *pm = model_get( shipp->modelnum );
gr_printf(sx, sy, "POF:%s", pm->filename );
sy += dy;
gr_printf(sx, sy, "Mass: %.2f\n", pm->mass);
sy += dy;
}
}
// display the weapons for the target on the HUD. Include ammo counts.
if ( Show_target_weapons && (is_ship == 1) ) {
int sx, sy, dy, i;
ship_weapon *swp;
swp = &shipp->weapons;
sx = 400;
sy = 100;
dy = gr_get_font_height();
sprintf(outstr,"Num primaries: %d", swp->num_primary_banks);
gr_printf(sx,sy,outstr);
sy += dy;
for ( i = 0; i < swp->num_primary_banks; i++ ) {
sprintf(outstr,"%d. %s", i+1, Weapon_info[swp->primary_bank_weapons[i]].name);
gr_printf(sx,sy,outstr);
sy += dy;
}
sy += dy;
sprintf(outstr,"Num secondaries: %d", swp->num_secondary_banks);
gr_printf(sx,sy,outstr);
sy += dy;
for ( i = 0; i < swp->num_secondary_banks; i++ ) {
sprintf(outstr,"%d. %s", i+1, Weapon_info[swp->secondary_bank_weapons[i]].name);
gr_printf(sx,sy,outstr);
sy += dy;
}
}
//XSTR:ON
#endif
}
// called at the start of each level
void hud_targetbox_static_init()
{
Target_static_next = 0;
Target_static_playing = 0;
}
// determine if we should draw static on top of the target box
int hud_targetbox_static_maybe_blit(float frametime)
{
float sensors_str;
// on lowest skill level, don't show static on target monitor
if ( Game_skill_level == 0 )
return 0;
#ifndef NO_NETWORK
// if multiplayer observer, don't show static
if((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER)){
return 0;
}
#endif
sensors_str = ship_get_subsystem_strength( Player_ship, SUBSYSTEM_SENSORS );
if ( ship_subsys_disrupted(Player_ship, SUBSYSTEM_SENSORS) ) {
sensors_str = SENSOR_STR_TARGET_NO_EFFECTS-1;
}
if ( sensors_str > SENSOR_STR_TARGET_NO_EFFECTS ) {
Target_static_playing = 0;
Target_static_next = 0;
} else {
if ( Target_static_next == 0 )
Target_static_next = 1;
}
if ( timestamp_elapsed(Target_static_next) ) {
Target_static_playing ^= 1;
Target_static_next = timestamp_rand(50, 750);
}
if ( Target_static_playing ) {
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
hud_anim_render(&Target_static, frametime, 1);
if ( Target_static_looping == -1 ) {
Target_static_looping = snd_play_looping(&Snds[SND_STATIC]);
}
} else {
if ( Target_static_looping != -1 ) {
snd_stop(Target_static_looping);
Target_static_looping = -1;
}
}
return Target_static_playing;
}
// start the targetbox item flashing for duration ms
// input: index => TBOX_FLASH_ #define
// duration => optional param (default value TBOX_FLASH_DURATION), how long to flash in ms
void hud_targetbox_start_flash(int index, int duration)
{
Targetbox_flash_timers[index][0] = timestamp(duration);
}
// stop flashing a specific targetbox item
void hud_targetbox_end_flash(int index)
{
Targetbox_flash_timers[index][0] = 1;
}
// determine if a given flashing index is bright or not
int hud_targetbox_is_bright(int index)
{
return (Targetbox_flash_flags & (1<<index));
}
// determine if the flashing has expired
int hud_targetbox_flash_expired(int index)
{
if ( timestamp_elapsed(Targetbox_flash_timers[index][0]) ) {
return 1;
}
return 0;
}
void hudtargetbox_page_in()
{
bm_page_in_aabitmap( Target_view_gauge.first_frame, Target_view_gauge.num_frames);
bm_page_in_aabitmap( Target_view_integrity_gauge.first_frame, Target_view_integrity_gauge.num_frames );
bm_page_in_aabitmap( Target_view_extra.first_frame, Target_view_extra.num_frames );
}
| [
"chief1983@yahoo.com"
] | chief1983@yahoo.com |
2254394a5057cb440ba65b05c1c10ac9df8af90c | 9850f4a8d9e326b906f22f97659b5a61bac441a9 | /CPP_Pool/cpp_d14m_2018/ex00/Lemon.hpp | 1b45b9e3cd65c2a78df6b1da5c852b17c78bff1f | [] | no_license | Nymrinae/EPITECH-Projects | 67d77e9d98177e5045dbd9868ddb993b08f0c763 | 9cad4819c086d5004e2325d5a416dc5ff1cfafe0 | refs/heads/master | 2022-02-14T02:12:44.177840 | 2022-02-03T11:48:08 | 2022-02-03T11:48:08 | 205,130,787 | 3 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 444 | hpp | /*
** EPITECH PROJECT, 2018
** Lemon.cpp
** File description:
** Exersice 0 - Fruits
*/
#ifndef _LEMON_H
#define _LEMON_H
#include <iostream>
#include <string>
#include "Fruit.hpp"
class Lemon : public Fruit {
public:
Lemon();
Lemon(Lemon const &Lemon);
~Lemon() { };
Lemon &operator=(Lemon const &Lemon);
virtual std::string getName() const;
virtual int getVitamins() const;
};
#endif
| [
"nymrinaedev@gmail.com"
] | nymrinaedev@gmail.com |
2cab8560234b763b9b55f3c178c7824a96761bad | 8a113790fed21a9d6f8ecf9a6457a21e90f250a7 | /trunk/MusicSynthesizer/source/main/nwappcmd.cpp | f21e31bb8820adf9e06da9ad0a12eb667b6b021c | [] | no_license | SteveZiZi/Effector | 8df91818c5b034ce486cc6664253e6ce3eac43ad | 12d9177daffd8def9e2ff51d31c708f525280650 | refs/heads/master | 2020-05-20T21:25:54.461085 | 2017-03-10T06:47:08 | 2017-03-10T06:47:08 | 84,527,223 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,957 | cpp | /** @file
* @brief 南网命令定义
* @author Steven Wan
* @date 2015-01/30
* @version 0.1
* @see appcmd.h
* @note
* 1、南网命令继承自多进程框架
* 2、本文件定义南网特色命令及服务功能
*/
#include "nwappcmd.h"
#include "cfg_proc.h"
#include "htrace.h"
#include "basebver.h"
//#include "nwbver.h"
#include "nwdaemon.h"
#include "httx.h"
#include "dbcj.h"
#include "ppp.h"
#include "lcd.h"
#include "jlcy.h"
#include "fhkz.h"
#include "dspdevice.h"
C_NwAppCmd::C_NwAppCmd(int argc, char *argv[]):C_AppCmd(argc, argv)
{
}
C_NwAppCmd::~C_NwAppCmd()
{
}
C_SERVER *C_NwAppCmd::GetServer(const char *pServerName)
{
static C_SERVER *pDaemonServ = NULL;
static C_SERVER *phttx1Serv = NULL;
static C_SERVER *phttx2Serv = NULL;
static C_SERVER *phttx3Serv = NULL;
static C_SERVER *pdbcjServ = NULL;
static C_SERVER *pPppServ = NULL;
static C_SERVER *pLcdServ = NULL;
static C_SERVER *pJlcyServ = NULL;
static C_SERVER *pFhkzServ = NULL;
if (strcasecmp(MP_PROCESS_HTTX1, pServerName) == 0)
{
if (phttx1Serv == NULL)
phttx1Serv = new C_Httx1Server;
return phttx1Serv;
}
if (strcasecmp(MP_PROCESS_HTTX2, pServerName) == 0)
{
if (phttx2Serv == NULL)
phttx2Serv = new C_Httx2Server;
return phttx2Serv;
}
if (strcasecmp(MP_PROCESS_HTTX3, pServerName) == 0)
{
if (phttx3Serv == NULL)
phttx3Serv = new C_Httx3Server;
return phttx3Serv;
}
if (strcasecmp(MP_PROCESS_DBCJ, pServerName) == 0)
{
if (pdbcjServ == NULL)
pdbcjServ = new C_DbcjServer;
return pdbcjServ;
}
if (strcasecmp(MP_PROCESS_PPP, pServerName) == 0)
{
if (pPppServ == NULL)
pPppServ = new C_PppServer;
return pPppServ;
}
if (strcasecmp(MP_PROCESS_LCD, pServerName) == 0)
{
if (pLcdServ == NULL)
pLcdServ = new C_LcdServer;
return pLcdServ;
}
if (strcasecmp(MP_PROCESS_JLCY, pServerName) == 0)
{
if (pJlcyServ == NULL)
pJlcyServ = new C_JlcyServer;
return pJlcyServ;
}
if (strcasecmp(MP_PROCESS_FHKZ, pServerName) == 0)
{
if (pFhkzServ == NULL)
pFhkzServ = new C_FhkzServer;
return pFhkzServ;
}
if (strcasecmp(MP_PROCESS_DAEMON, pServerName) == 0)
{
if (pDaemonServ == NULL)
pDaemonServ = new C_NwDaemonServer;
return pDaemonServ;
}
return C_AppCmd::GetServer(pServerName);
}
int C_NwAppCmd::ListVersion(void)
{
C_AppCmd::ListVersion();
logn<<"基础业务库版本:"<<BASEB_GetVersion()<<endl;
logn<<"基础业务库发布日期:"<<BASEB_GetReleaseDate()<<endl;
// logn<<"南网业务库版本:"<<NWB_GetVersion()<<endl;
// logn<<"南网业务库发布日期:"<<NWB_GetReleaseDate()<<endl;
logn<<"配置文件包版本:"<<"unknow"<<endl;
logn<<"配置文件包发布日期:"<<"unknow"<<endl;
logn<<"主程序版本:"<<MP_GetSoftwareVersion()<<endl;
logn<<"主程序发布日期:"<<MP_GetSoftwareReleaseDate()<<endl;
logn<<"硬件版本:"<<MP_GetHardwareVersion()<<endl;
logn<<"硬件发布日期:"<<MP_GetHardwareReleaseDate()<<endl;
return 0;
}
| [
"383789599@qq.com"
] | 383789599@qq.com |
7e626143570c67225949441367275001aaef5ef1 | 171e084cad3fb6efa46a7246ab6b5dc9751f7864 | /Project-Euler/project_euler_problem_7.cpp | 761d4bab313d6156934de29782ef4b5efed5e2e8 | [] | no_license | T-R0D/JustForFun | f3d0fc5f428b0b46b0bda1bd32d306a15cee0c34 | a4137f3ba212d30971c23a0c21f616b826fde96f | refs/heads/master | 2023-03-06T17:28:08.999350 | 2023-02-23T04:38:34 | 2023-02-23T04:38:34 | 29,168,190 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,056 | cpp | /**
@file project_euler_problem_7.cpp
@author Terence Henriod
Project Euler Problem 7
@brief Solves the following problem for the general case of any required
number of primes (withing system limitations):
"By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see
that the 6th prime is 13.
What is the 10 001st prime number?"
@version Original Code 1.00 (12/29/2013) - T. Henriod
*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HEADER FILES / NAMESPACES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#include <cassert>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <list>
using namespace std;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GLOBAL CONSTANTS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
const int kFirstPrime = 2;
const int kMoreNumbers = 10;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTION PROTOTYPES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/**
FunctionName
A short description
@param
@return
@pre
-#
@post
-#
@detail @bAlgorithm
-#
@exception
@code
@endcode
*/
long long findNthPrime(const unsigned int nth);
list<long long> generateListOfPrimes(const int num_primes);
void removeNonPrimes(list<long long>::iterator& old_list_end,
list<long long>& primes_list);
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MAIN FUNCTION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
int main() {
// variables
unsigned int nth = 10001;
long long nth_prime = 0;
int counter = 1;
list<long long> list_of_primes;
list<long long>::iterator ith_prime;
// get the nth prime the user wants to know
printf("Enter the nth prime to be found: ");
scanf("%u", &nth);
printf("\n");
// find the nth prime
nth_prime = findNthPrime(nth);
/*
// get a suitable list of primes
list_of_primes = generateListOfPrimes(nth);
// retrieve the nth prime from the list
for (counter = 1, ith_prime = list_of_primes.begin(); counter < nth_prime;
counter++, ++ith_prime) {
}
*/
// state the result for the user
printf("The %uth prime number is: %d \n", nth, nth_prime);
// return 0 on successful completion
return 0;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTION IMPLEMENTATIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
long long findNthPrime(const unsigned int nth) {
// variables
long long nth_prime = 0;
long long temp = 3;
long long temp_root = ceil(sqrt(temp));
long long* primes = NULL;
int found_prime = 0;
int last_found_prime = 0;
// allocate memory for the list
primes = new long long [nth];
// prime the search with the first prime
primes[0] = 2;
last_found_prime = 1;
// successively check numbers as they are generated for prime-ness
while (last_found_prime < nth) {
// check the next attempted number against the previously found primes
while (((temp % primes[found_prime]) != 0) &&
((primes[found_prime] <= temp_root) ||
(found_prime < last_found_prime))) {
// move to the next found prime
found_prime++;
}
// case: the temporary number passed the test
if (found_prime >= last_found_prime) {
// store it
primes[last_found_prime] = temp;
last_found_prime++;
if ((last_found_prime % 1000) == 0) {
printf("Another 1000th has appeared: %i!\n", temp);
}
}
// either way, move on to the next number
temp++;
temp_root = ceil(sqrt(temp));
// start over at the beginning
found_prime = 0;
}
// save the nth prime
nth_prime = primes[nth - 1];
// create a prime number file
ofstream fout;
fout.clear();
fout.open("z_primes.h");
fout << "#ifndef __Z_PRIMES_H__" << endl
<< "#define __Z_PRIMES_H__" << endl << endl
<< "const unsigned int kNumPrimes = " << nth << ';' << endl << endl
<< "const unsigned long long kPrimes[] = {" << endl;
for (int i = 0; i < nth; ) {
for (int j = 0; j < 5; i++, j++) {
fout << primes[i] << ',';
}
fout << '\n';
}
fout << "\b\b\n};" << endl << endl;
fout << "#endif" << endl;
fout.close();
// return the dynamic memory
delete [] primes;
// return the nth prime that was found
return nth_prime;
}
list<long long> generateListOfPrimes(const int num_primes) {
// variables
list<long long> primes_list;
list<long long>::iterator old_list_end;
long long last_number_added = 2;
long long new_last_number = 0;
long long multiple_of_more_numbers = 1;
// prime the list with the first prime number
primes_list.push_back(kFirstPrime);
// continue adding numbers to the list until the list is of requisite size
while (primes_list.size() <= num_primes) {
// track the end of the last set of progress
old_list_end = primes_list.end();
--old_list_end;
// add more numbers to the list
for(last_number_added = last_number_added + 1,
new_last_number = multiple_of_more_numbers * kMoreNumbers;
last_number_added <= new_last_number;
last_number_added++) {
// add the number to the end of the list
primes_list.push_back(last_number_added);
}
// sift out the non-primes using a sieve method
removeNonPrimes(old_list_end, primes_list);
// do housekeeping for the next loop
last_number_added = new_last_number;
multiple_of_more_numbers++;
}
// return the generated list
return primes_list;
}
void removeNonPrimes(list<long long>::iterator& old_list_end,
list<long long>& primes_list) {
// variables
list<long long>::iterator current_prime = primes_list.begin();
list<long long>::iterator last_prime = old_list_end;
// check all the newly added numbers against the previously found primes
while (last_prime != primes_list.end()) {
// start at the beginning of the list
current_prime = primes_list.begin();
// move on to the next possibile prime in the list
++last_prime;
// check to see if each newly added element is prime
while ((last_prime != primes_list.end()) &&
(current_prime != last_prime)) {
// case: the possibility is a multiple of one of the prime numbers
if ((*last_prime % *current_prime) == 0) {
// the number is not prime, throw it out
last_prime = primes_list.erase(last_prime);
// start at the beginning of the list
current_prime = primes_list.begin();
}
// case: the possibility was not a multiple of a particular prime
else {
// try again with the next established prime
current_prime++;
}
}
}
// no return - void
}
| [
"thenriod@gmail.com"
] | thenriod@gmail.com |
39d36d69abf4ef2ba46b2ca75cbd37696dbcc408 | 735373173234e2d23e9966ffcdeb636aba10bf00 | /Plugins/Wwise/Intermediate/Build/Win64/UE4Editor/Inc/AkAudio/AkAmbientSound.generated.h | 12958ef85460240644ebd1646808da58879c10f0 | [] | no_license | Phodonut/UE4_Wwise_Demo | 4e3c6eafc423eed69409f798f7bb79eeacfb0cec | b0552c699f1e89c755e792f8ecca4a72f279a75c | refs/heads/master | 2020-03-19T03:49:58.871204 | 2018-06-01T22:05:12 | 2018-06-01T22:05:12 | 135,766,942 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,512 | h | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "ObjectMacros.h"
#include "ScriptMacros.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#ifdef AKAUDIO_AkAmbientSound_generated_h
#error "AkAmbientSound.generated.h already included, missing '#pragma once' in AkAmbientSound.h"
#endif
#define AKAUDIO_AkAmbientSound_generated_h
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_17_GENERATED_BODY \
friend AKAUDIO_API class UScriptStruct* Z_Construct_UScriptStruct_FAkAmbSoundCheckpointRecord(); \
AKAUDIO_API static class UScriptStruct* StaticStruct();
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_RPC_WRAPPERS \
\
DECLARE_FUNCTION(execStopAmbientSound) \
{ \
P_FINISH; \
P_NATIVE_BEGIN; \
this->StopAmbientSound(); \
P_NATIVE_END; \
} \
\
DECLARE_FUNCTION(execStartAmbientSound) \
{ \
P_FINISH; \
P_NATIVE_BEGIN; \
this->StartAmbientSound(); \
P_NATIVE_END; \
}
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_RPC_WRAPPERS_NO_PURE_DECLS \
\
DECLARE_FUNCTION(execStopAmbientSound) \
{ \
P_FINISH; \
P_NATIVE_BEGIN; \
this->StopAmbientSound(); \
P_NATIVE_END; \
} \
\
DECLARE_FUNCTION(execStartAmbientSound) \
{ \
P_FINISH; \
P_NATIVE_BEGIN; \
this->StartAmbientSound(); \
P_NATIVE_END; \
}
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_INCLASS_NO_PURE_DECLS \
private: \
static void StaticRegisterNativesAAkAmbientSound(); \
friend AKAUDIO_API class UClass* Z_Construct_UClass_AAkAmbientSound(); \
public: \
DECLARE_CLASS(AAkAmbientSound, AActor, COMPILED_IN_FLAGS(0), 0, TEXT("/Script/AkAudio"), NO_API) \
DECLARE_SERIALIZER(AAkAmbientSound) \
enum {IsIntrinsic=COMPILED_IN_INTRINSIC};
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_INCLASS \
private: \
static void StaticRegisterNativesAAkAmbientSound(); \
friend AKAUDIO_API class UClass* Z_Construct_UClass_AAkAmbientSound(); \
public: \
DECLARE_CLASS(AAkAmbientSound, AActor, COMPILED_IN_FLAGS(0), 0, TEXT("/Script/AkAudio"), NO_API) \
DECLARE_SERIALIZER(AAkAmbientSound) \
enum {IsIntrinsic=COMPILED_IN_INTRINSIC};
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_STANDARD_CONSTRUCTORS \
/** Standard constructor, called after all reflected properties have been initialized */ \
NO_API AAkAmbientSound(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); \
DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(AAkAmbientSound) \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AAkAmbientSound); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AAkAmbientSound); \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API AAkAmbientSound(AAkAmbientSound&&); \
NO_API AAkAmbientSound(const AAkAmbientSound&); \
public:
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_ENHANCED_CONSTRUCTORS \
/** Standard constructor, called after all reflected properties have been initialized */ \
NO_API AAkAmbientSound(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()) : Super(ObjectInitializer) { }; \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API AAkAmbientSound(AAkAmbientSound&&); \
NO_API AAkAmbientSound(const AAkAmbientSound&); \
public: \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AAkAmbientSound); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AAkAmbientSound); \
DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(AAkAmbientSound)
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_PRIVATE_PROPERTY_OFFSET
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_34_PROLOG
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_GENERATED_BODY_LEGACY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_PRIVATE_PROPERTY_OFFSET \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_RPC_WRAPPERS \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_INCLASS \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_STANDARD_CONSTRUCTORS \
public: \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#define UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_GENERATED_BODY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_PRIVATE_PROPERTY_OFFSET \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_RPC_WRAPPERS_NO_PURE_DECLS \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_INCLASS_NO_PURE_DECLS \
UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h_37_ENHANCED_CONSTRUCTORS \
static_assert(false, "Unknown access specifier for GENERATED_BODY() macro in class AkAmbientSound."); \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#undef CURRENT_FILE_ID
#define CURRENT_FILE_ID UE4_Wwise_Startup_Plugins_Wwise_Source_AkAudio_Classes_AkAmbientSound_h
PRAGMA_ENABLE_DEPRECATION_WARNINGS
| [
"rharker7@gmail.com"
] | rharker7@gmail.com |
f106e16ec78eb8121fbeec351ae18b25e052f629 | 4bb59a04ce5821980460e0f974419d14626aef5e | /08.TestSet/src/01.Media/my/VideoCapture.cpp | 1aaf192820f54a71561f5620358f20bcc70388a5 | [] | no_license | xt9852/TestSet | 587d5251e234ffc8fc477426dd9ff4b0cecce1eb | 5d0dcb72ab9867e488ad9bfd437aef782a5abca7 | refs/heads/master | 2021-01-10T01:20:27.906424 | 2016-03-16T09:11:49 | 2016-03-16T09:11:49 | 44,855,424 | 3 | 1 | null | null | null | null | GB18030 | C++ | false | false | 8,306 | cpp |
#include "stdafx.h"
#include "VideoCapture.h"
#pragma comment(lib,"vfw32")
/*
*\fn void YUV2_RGB(BYTE *yuv, BYTE *rgb, UINT cx, UINT cy)
*\brief 将yuv2转成rgb,并将图像水平翻转
*\param[in] BYTE * yuv yuv格式数据
*\param[out] BYTE * rgb rgb格式数据
*\param[in] UINT cx 图像宽
*\param[in] UINT cy 图像高
*\return void 无
*/
void YUV2_RGB(BYTE *yuv, BYTE *rgb, UINT cx, UINT cy)
{
BYTE *pos = NULL;
long x = 0, y = 0;
long R = 0, G = 0, B = 0;
long Y0 = 0, U = 0, Y1 = 0, V = 0;
for (y = cy - 1; y >= 0; y--)
{
for (x = 0; x < cx; x += 2)
{
pos = yuv + (y * cx + x) * 2;
Y0 = *pos;
U = *(pos+1);
Y1 = *(pos+2);
V = *(pos+3);
R = 1.164383 * (Y0 - 16) + 1.596027 * (V - 128);
G = 1.164383 * (Y0 - 16) - 0.812968 * (V - 128) - 0.391762 * (U - 128);
B = 1.164383 * (Y0 - 16) + 2.017232 * (U - 128);
if (R < 0) R = 0;
if (R > 255) R = 255;
if (G < 0) G = 0;
if (G > 255) G = 255;
if (B < 0) B = 0;
if (B > 255) B = 255;
*rgb++ = (BYTE)B;
*rgb++ = (BYTE)G;
*rgb++ = (BYTE)R;
R = 1.164383 * (Y1 - 16) + 1.596027 * (V - 128);
G = 1.164383 * (Y1 - 16) - 0.812968 * (V - 128) - 0.391762 * (U - 128);
B = 1.164383 * (Y1 - 16) + 2.017232 * (U - 128);
if (R < 0) R = 0;
if (R > 255) R = 255;
if (G < 0) G = 0;
if (G > 255) G = 255;
if (B < 0) B = 0;
if (B > 255) B = 255;
*rgb++ = (BYTE)B;
*rgb++ = (BYTE)G;
*rgb++ = (BYTE)R;
}
}
}
/**
*\fn LRESULT CALLBACK OnCaptureVideo(HWND wnd, LPVIDEOHDR lphdr)
*\brief 设备回调
*\param[in] HWND wnd 用户自定义数据
*\param[in] LPVIDEOHDR lphdr 视频数据
*\return LRESULT CALLBACK 0成功,其它失败
*/
LRESULT CALLBACK OnCaptureVideo(HWND wnd, LPVIDEOHDR lphdr)
{
try
{
VideoCapture *pThis = (VideoCapture*)capGetUserData(wnd);
if (NULL != pThis && !pThis->isStop())
{
FRAMEINFO frame = {0};
frame.len = lphdr->dwBytesUsed;
frame.data = lphdr->lpData;
pThis->send(&frame);
}
}
catch(...)
{
TRACE(_T("VideoCapture.OnCaptureVideo Error %d\n"), ::GetLastError());
return FALSE;
}
return TRUE;
}
VideoCapture::VideoCapture()
:wndCap_(NULL),
isStop_(FALSE)
{
buf_ = new BYTE[1024*1024];
memset(&bmpInfo_, 0, sizeof(bmpInfo_));
}
VideoCapture::~VideoCapture()
{
delete[] buf_;
uninit();
}
/**
*\fn int init(int cx, int cy)
*\brief 初始化视频捕获
*\param[in] int cx 宽
*\param[in] int cy 高
*\return int 0成功,其它失败
*/
int VideoCapture::init(int cx, int cy)
{
int index = 0;
TCHAR devName[100] = _T("");
TCHAR devVersion[100] = _T("");
if (NULL != wndCap_)
{
return E_VC_INITED;
}
wndCap_ = capCreateCaptureWindow(_T("Capture"), WS_POPUP, 0, 0, 1, 1, 0, 0);
if (NULL == wndCap_)
{
return E_VC_CREATECAPTURE;
}
//stopCapture();
// 设置回调参数
capSetUserData(wndCap_, this);
// 设置回调函数
capSetCallbackOnVideoStream(wndCap_, OnCaptureVideo);
// 得到设置信息
capGetDriverDescription(index, devName, sizeof(devName)/sizeof(devName[0]),
devVersion, sizeof(devVersion)/sizeof(devVersion[0]));
// 连接设备
if (!capDriverConnect(wndCap_, index))
{
TRACE("%s capDriverConnect=%d\n", __FUNCTION__, GetLastError());
return E_VC_DRIVERCONNECT;
}
// 设置参数
if (0 != setCaptureParam(cx, cy))
{
capDriverDisconnect(wndCap_);
return E_VC_SETCAPTUREPARAM;
}
return 0;
}
/**
*\fn int setCaptureParam(int cx, int cy)
*\brief 设置参数
*\param[in] int cx 宽
*\param[in] int cy 高
*\return int 0成功,其它失败
*/
int VideoCapture::setCaptureParam(int cx, int cy)
{
CAPTUREPARMS capParms = {0};
capCaptureGetSetup(wndCap_, &capParms, sizeof(capParms));
capParms.wStepCaptureAverageFrames = 100;
capParms.dwRequestMicroSecPerFrame = 1000000/6;// 每秒6帧;
capParms.fAbortLeftMouse = FALSE;
capParms.fAbortRightMouse = FALSE;
capParms.fYield = TRUE;
capParms.fCaptureAudio = FALSE;
capParms.wPercentDropForError = 50;
if (!capCaptureSetSetup(wndCap_, &capParms, sizeof(capParms)))
{
return E_VC_SETCAPTUREPARAM;
}
capGetVideoFormat(wndCap_, &bmpInfo_, sizeof(BITMAPINFO));
bmpInfo_.bmiHeader.biWidth = cx;
bmpInfo_.bmiHeader.biHeight = cy;
bmpInfo_.bmiHeader.biBitCount = 16;
bmpInfo_.bmiHeader.biSizeImage = cx * cy * 2;
bmpInfo_.bmiHeader.biCompression = 844715353; // YUV2
if (!capSetVideoFormat(wndCap_, &bmpInfo_.bmiHeader, sizeof(BITMAPINFOHEADER)))
{
return E_VC_SETCAPTUREPARAM;
}
return 0;
}
/**
*\fn void Uninit()
*\brief 返初始化
*\return void 无
*/
void VideoCapture::uninit()
{
if (NULL == wndCap_) return;
stopCapture();
Sleep(300);
// 设置回调
capSetCallbackOnVideoStream(wndCap_, NULL);
Sleep(300);
capDriverDisconnect(wndCap_);
wndCap_ = NULL;
}
/**
*\fn int startCapture()
*\brief 开始捕获视频
*\return int 0成功,其它失败
*/
int VideoCapture::startCapture()
{
if (capCaptureSequenceNoFile(wndCap_) == FALSE)
{
return E_VC_STARTCAPTURE;
}
isStop_ = false;
return 0;
}
/**
*\fn int stopCapture()
*\brief 停止捕获视频
*\return int 0成功,其它失败
*/
int VideoCapture::stopCapture()
{
capCaptureStop(wndCap_);
capCaptureAbort(wndCap_);
isStop_ = true;
return 0;
}
/**
*\fn int send(void *data)
*\brief 发送数据
*\param[in] void * data 视频数据
*\return int 0成功,其它失败
*/
int VideoCapture::send(void *data)
{
FRAMEINFO out = {0};
PFRAMEINFO frame = (PFRAMEINFO)data;
if (NULL == frame || NULL == frame->data || 0 == frame->len) return E_VC_PARAM_NULL;
out.data = buf_;
out.len = bmpInfo_.bmiHeader.biWidth * bmpInfo_.bmiHeader.biHeight * 3;
//saveBmp(".\\VideoCapture.bmp", getBmpInfoHeader(), (LPBYTE)frame->data);
YUV2_RGB((BYTE*)frame->data, (BYTE*)out.data, bmpInfo_.bmiHeader.biWidth, bmpInfo_.bmiHeader.biHeight);
return MeidaLayout::send(&out);
}
/**
*\fn BITMAPINFOHEADER* getBmpInfoHeader()
*\brief 得到位图信息
*\return BITMAPINFOHEADER* 位图信息
*/
BITMAPINFOHEADER* VideoCapture::getBmpInfoHeader()
{
return &(bmpInfo_.bmiHeader);
}
/**
*\fn int saveBmp(LPCSTR fileName, BITMAPINFOHEADER *bitInfo, LPBYTE data)
*\brief 保存bmp图像
*\param[in] LPCSTR fileName 文件名
*\param[in] BITMAPINFOHEADER * bitInfo 图片信息
*\param[in] LPBYTE data 图片数据
*\return int 0成功,其它失败
*/
int VideoCapture::saveBmp(LPCSTR fileName, BITMAPINFOHEADER *bitInfo, LPBYTE data)
{
if (NULL == fileName || NULL == bitInfo || NULL == data) return E_VC_PARAM_NULL;
BITMAPINFOHEADER bmih = *bitInfo;
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = 3 * bmih.biHeight * bmih.biWidth;
BITMAPFILEHEADER bmfh = {0};
bmfh.bfType = 0x4D42; // "BM"
bmfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
bmfh.bfSize = bmfh.bfOffBits + bitInfo->biSizeImage;
BYTE *buf = new BYTE[bmih.biSizeImage];
// vfw得到的是yuv2的,将其转为RGB
YUV2_RGB(data, buf, bmih.biWidth, bmih.biHeight);
FILE *file = fopen(fileName, "w+b");
if (NULL == file)
{
delete[] buf;
return E_VC_OPENFILE;
}
fwrite(&bmfh, 1, sizeof(BITMAPFILEHEADER), file);
fwrite(&bmih, 1, sizeof(BITMAPINFOHEADER), file);
fwrite(buf, 1, bmih.biSizeImage, file);
fclose(file);
delete[] buf;
return 0;
}
| [
"xt_666@163.com"
] | xt_666@163.com |
ae9a76738be7d3705ca3a2f21e0a7e680c01e47c | 8f3d9eb1d632282a55ea5a5c3dfe6f23e6d1b76c | /Wawaji-Server-Windows/wwj_demo/tool_kits/ui_component/ui_kit/module/session/ring.cpp | 2df549bbb841cf91bd804100aa778b9481db8ed6 | [
"MIT"
] | permissive | jzsplk/Wawaji | 086580efb5ecf952b990a36bb5cd8a6a9a1fc6f7 | 45c51c3cd1b49a4a926b76b6e4e31a331ede66ee | refs/heads/master | 2020-03-12T15:29:40.437612 | 2018-04-23T12:03:00 | 2018-04-23T12:03:00 | 130,691,413 | 1 | 0 | null | 2018-04-23T12:13:28 | 2018-04-23T12:13:28 | null | UTF-8 | C++ | false | false | 2,033 | cpp | #include "ring.h"
static const std::wstring kNewMessage = L"new_message.wav";
static const std::wstring kVoipConnecting = L"voip_connecting.mp3";
static const std::wstring kVoipNoResponse = L"voip_no_response.mp3";
static const std::wstring kVoipPeerBusy = L"voip_peer_busy.mp3";
static const std::wstring kVoipPeerReject = L"voip_peer_reject.mp3";
static const std::wstring kVoipRing = L"voip_ring.mp3";
namespace nim_comp
{
Ring::Ring()
{
hwnd_ = NULL;
}
Ring::~Ring()
{
Destroy();
}
bool Ring::Init(HWND hwnd)
{
hwnd_ = MCIWndCreateW(hwnd, NULL, WS_POPUP | MCIWNDF_NOERRORDLG | MCIWNDF_NOTIFYMODE, NULL);
if (hwnd_ == NULL)
{
QLOG_ERR(L"MCIWndCreateW error {0}") << GetLastError();
return false;
}
return true;
}
void Ring::Play(RingType type, bool replay)
{
assert(hwnd_);
if (hwnd_ == NULL)
return;
Stop();
replay_ = replay;
std::wstring dir = QPath::GetAppPath() + L"res\\audio\\";
switch (type)
{
case RING_NEW_MESSAGE:
dir.append(kNewMessage);
break;
case RING_VOIP_CONNTETING:
dir.append(kVoipConnecting);
break;
case RING_VOIP_NORESPONSE:
dir.append(kVoipNoResponse);
break;
case RING_VOIP_PEERBUSY:
dir.append(kVoipPeerBusy);
break;
case RING_VOIP_PEERREJECT:
dir.append(kVoipPeerReject);
break;
case RING_VOIP_RING:
dir.append(kVoipRing);
break;
}
DWORD ret = MCIWndOpen(hwnd_, dir.c_str(), 0);
if (ret == 0)
MCIWndPlay(hwnd_);
else
QLOG_ERR(L"MCIWndOpen error {0}") << ret;
}
void Ring::Replay()
{
if (hwnd_ != NULL && MCIWndCanPlay(hwnd_))
{
MCIWndSeek(hwnd_, 0);
MCIWndPlay(hwnd_);
}
}
void Ring::Stop()
{
replay_ = false;
if (hwnd_)
{
MCIWndStop(hwnd_);
MCIWndClose(hwnd_);
}
}
void Ring::Destroy()
{
if (hwnd_)
{
Stop();
MCIWndDestroy(hwnd_);
}
}
LRESULT Ring::Notify(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == MCIWNDM_NOTIFYMODE)
{
if (lParam == MCI_MODE_STOP && replay_)
{
Replay();
}
}
return 0;
}
} | [
"hzgaoqi1@corp.netease.com"
] | hzgaoqi1@corp.netease.com |
2f37ad4d7d8973ec9a8c2f0464be9397687d80be | 153bd5717eea68a197e1f388cd17ab292749448d | /Proj2/graph.cpp | 09b64a2b32a70ce22b10926e64b442ea82ae7524 | [] | no_license | tonywang1990/ECEN654 | ed4ef1f253092c9328803f7b9548116b85df3a7d | 67c6169195ee63041ba0c2a9a59852b85e18606f | refs/heads/master | 2021-01-10T01:56:46.521981 | 2016-02-04T04:30:51 | 2016-02-04T04:30:51 | 51,051,678 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,940 | cpp | #include "graph.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include "assert.h"
graph::graph( ):
module_size(100),
net_size(30),
pio_size(30)
{
module = new int* [100];
for (int i = 0; i < module_size; i++){
module[i] = new int [4];
for (int j = 0; j < 4; j++){
module[i][j] = 0;
}
}
net = new std::set<int> [net_size];
}
void graph::clear(){
for (int i = 0; i < module_size; i++){
delete []module[i];
}
delete []module;
delete []net;
pio.clear();
}
void graph::import_data(std::string Module, std::string Net, std::string Pio){
std::ifstream input;
std::string line;
std::istringstream iss;
int count = 0;
// read Module
input.open(Module.c_str());
while (std::getline(input, line)){
iss.clear();
iss.str(line);
int dummy;
iss >> dummy;
for (int j = 0; j < 4; j++){
iss >> module[count][j];
}
count++;
}
assert(count == module_size);
input.close();
/*
for (int i = 0; i < 100; i++){
for (int j = 0; j < 4; j++){
std::cout<<module[i][j]<<" ";
}
std::cout<<std::endl;
}
*/
// read net
input.open(Net.c_str());
count = 0;
while (std::getline(input, line)){
iss.clear();
iss.str(line);
int snet;
// discard the first number
iss >> snet;
while (iss >> snet){
net[count].insert(snet);
}
count++;
}
assert(count == net_size);
input.close();
/*
std::set<int>::iterator it;
for (int i = 0; i < net_size; i++){
for (it = net[i].begin(); it != net[i].end(); it++){
std::cout<<" "<<*it;
}
std::cout<<std::endl;
}
*/
// read pio
input.open(Net.c_str());
count = 0;
while (std::getline(input, line)){
iss.clear();
iss.str(line);
int n;
iss >> n;
pio.insert(n);
count++;
}
assert(count == pio_size);
input.close();
}
int graph::get_module(int n, int m){
assert(n < 100 && m < 4);
return module[n][m];
}
std::set<int>* graph::get_net(){
return net;
}
std::set<int> graph::get_pio(){
return pio;
}
| [
"tonybestrong@gmail.com"
] | tonybestrong@gmail.com |
122e5664f9cf52760149cc912d060a67bdc2b716 | 99a466aba71f86a69fe38b47e87d9333d6251454 | /contest/611/d/g.cpp | 671aeb68e8d9f8199cf6b3a4c212f87de400458c | [] | no_license | m-nny/Codeforces | ca84be67110c5c5ba0f986652b3b195f964a5026 | fbd5918f567a907005bb65b283595a2f0974e412 | refs/heads/master | 2021-09-04T20:37:02.533540 | 2018-01-22T07:47:39 | 2018-01-22T07:47:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,408 | cpp |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map <int, int> mii;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
int const maxn = int(1e5 + 12);
int const maxb = int(2e6 + 12);
int const inf = int(1e9 + 7);
ll const linf = ll(1e18 + 12);
double const eps = 1e-7;
double const pi = acos(-1);
#ifdef _WIN32
#define I64 "%I64d"
#else
#define I64 "%lld"
#endif
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define fn "d"
#define next MyLittleNext
//#define end MyLittleEnd
#define all(x) x.begin(), x.end()
vector <int> shuf(int n)
{
vector <int> v;
for (int i = 1; i <= n; i++)
v.pb(i);
for (int i = n - 1; i > 0; i--)
swap(v[i], v[rand() % n]);
return v;
}
int main()
{
#ifdef fn
//freopen(fn".in", "r", stdin);
//freopen(fn".out", "w", stdout);
#endif
srand(time(0));
ofstream out;
ifstream normf, ansf;
for (int step = 0; step < 1; step++)
{
out.open(fn".in");
int N = 1000;
int a = rand() % 100;
out << N <<'\n';
for (int i = 0; i < N; i++)
out << 1;
out << '\n';
out.close();
/*
system("a.exe");
system("b.exe");
normf.open(fn"n.out");
ansf.open(fn".out");
if (system("fc " fn ".out " fn "n.out"))
{
puts("!!");
return 0;
}
printf("OK %d\n", step);
*/
}
}
| [
"Alibek.manabayev@gmail.com"
] | Alibek.manabayev@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.