Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 2 new columns ({'status', 'current_contents'}) and 6 missing columns ({'repos', 'license', 'incomplete_new_contents', 'lang', 'diff', 'subject'}).

This happened while the json dataset builder was generating data using

hf://datasets/lurf21/NextEditPrediction/data/test.jsonl (at revision 3769eeb29fed82088166f80358b2a5b8445f9a9e)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 644, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              commit: string
              message: string
              old_file: string
              new_file: string
              status: string
              old_contents: string
              new_contents: string
              text: string
              current_contents: string
              to
              {'commit': Value('string'), 'old_file': Value('string'), 'new_file': Value('string'), 'old_contents': Value('string'), 'new_contents': Value('string'), 'subject': Value('string'), 'message': Value('string'), 'lang': Value('string'), 'license': Value('string'), 'repos': Value('string'), 'diff': Value('string'), 'incomplete_new_contents': Value('string'), 'text': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1456, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1055, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 894, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 970, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 2 new columns ({'status', 'current_contents'}) and 6 missing columns ({'repos', 'license', 'incomplete_new_contents', 'lang', 'diff', 'subject'}).
              
              This happened while the json dataset builder was generating data using
              
              hf://datasets/lurf21/NextEditPrediction/data/test.jsonl (at revision 3769eeb29fed82088166f80358b2a5b8445f9a9e)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

commit
string
old_file
string
new_file
string
old_contents
string
new_contents
string
subject
string
message
string
lang
string
license
string
repos
string
diff
string
incomplete_new_contents
string
text
string
c91029f2fd832db64d88ce996a42ac52616ec07d
src/utils/mapped_file.cpp
src/utils/mapped_file.cpp
#include "mapped_file.h" #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }}
#include "mapped_file.h" #include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if (buf.st_size == 0) throw sasm::exception::elf(_path.c_str(), "invalid ELF file"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }}
Handle a little bug with empty files.
Handle a little bug with empty files. When giving a length of 0 to mmap(2) we get an EINVAL so the exception thrown was not accurate.
C++
bsd-2-clause
sas/sasm,sas/sasm
--- src/utils/mapped_file.cpp +++ src/utils/mapped_file.cpp @@ -1,5 +1,6 @@ #include "mapped_file.h" +#include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> @@ -26,6 +27,9 @@ if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); + if (buf.st_size == 0) + throw sasm::exception::elf(_path.c_str(), "invalid ELF file"); + if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap");
#include "mapped_file.h" #include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }}
<|original_code|> #include "mapped_file.h" #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }} <|edits_diff|> --- src/utils/mapped_file.cpp +++ src/utils/mapped_file.cpp @@ -1,5 +1,6 @@ #include "mapped_file.h" +#include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> <|current_version|> #include "mapped_file.h" #include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }} <|next_version|> #include "mapped_file.h" #include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O_RDONLY)) == -1) throw sasm::exception::os("open", get_path()); if (fstat(fd, &buf) == -1) throw sasm::exception::os("fstat"); if (buf.st_size == 0) throw sasm::exception::elf(_path.c_str(), "invalid ELF file"); if ((begin = (char*) mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) throw sasm::exception::os("mmap"); close(fd); _is_mapped = true; _begin = begin; _size = buf.st_size; } void mapped_file::unmap() { if (munmap((void*) _begin, _size) == -1) throw sasm::exception::os("munmap"); _is_mapped = false; } const char* mapped_file::get_path() const { return _path.c_str(); } }}
a625de351c3b129f11faf26330dafdb16f10b855
test/iterator_concepts_ordering.cpp
test/iterator_concepts_ordering.cpp
/** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>));
/** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::ForwardIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::ForwardIterator>));
Add more iterator concept ordering tests.
Add more iterator concept ordering tests.
C++
mit
ldionne/duck
--- test/iterator_concepts_ordering.cpp +++ test/iterator_concepts_ordering.cpp @@ -15,6 +15,10 @@ duck::IncrementableIterator, duck::RandomAccessIterator>)); +BOOST_MPL_ASSERT((duck::is_more_specific_than< + duck::ForwardIterator, + duck::RandomAccessIterator>)); + BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, @@ -27,3 +31,7 @@ BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>)); + +BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< + duck::RandomAccessIterator, + duck::ForwardIterator>));
/** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::ForwardIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>));
<|original_code|> /** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>)); <|edits_diff|> --- test/iterator_concepts_ordering.cpp +++ test/iterator_concepts_ordering.cpp @@ -15,6 +15,10 @@ duck::IncrementableIterator, duck::RandomAccessIterator>)); +BOOST_MPL_ASSERT((duck::is_more_specific_than< + duck::ForwardIterator, + duck::RandomAccessIterator>)); + BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, <|current_version|> /** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::ForwardIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>)); <|next_version|> /** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::IncrementableIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::ForwardIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::BidirectionalIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::IncrementableIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::ForwardIterator, duck::ForwardIterator>)); BOOST_MPL_ASSERT_NOT((duck::is_more_specific_than< duck::RandomAccessIterator, duck::ForwardIterator>));
dbf2bac7fed179f25956d8783ab619de31131288
main.cpp
main.cpp
#include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
#include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName(APP_ORGNAME); QCoreApplication::setApplicationName(APP_APPNAME); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
Set org name and app name
Set org name and app name
C++
mit
jslick/PepperNote,jslick/PepperNote
--- main.cpp +++ main.cpp @@ -1,8 +1,14 @@ #include <QApplication> #include "mainwindow.h" +const QString APP_ORGNAME = "PepperNote"; +const QString APP_APPNAME = "PepperNote"; + int main(int argc, char *argv[]) { + QCoreApplication::setOrganizationName(APP_ORGNAME); + QCoreApplication::setApplicationName(APP_APPNAME); + QApplication a(argc, argv); MainWindow w; w.show();
#include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
<|original_code|> #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } <|edits_diff|> --- main.cpp +++ main.cpp @@ -1,5 +1,8 @@ #include <QApplication> #include "mainwindow.h" + +const QString APP_ORGNAME = "PepperNote"; +const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { <|current_version|> #include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } <|next_version|> #include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName(APP_ORGNAME); QCoreApplication::setApplicationName(APP_APPNAME); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
7dc394773390abe56a0024f1f113a6f644c8e083
engine/src/level.cpp
engine/src/level.cpp
#include "level.hpp" using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ game_object->draw(); } } }
#include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ if(game_object->name == "arm_left"){ game_object->set_actual_animation(game_object->animations["left_arm"]); } game_object->draw(); } } }
Fix wrong animation of boss arm
Fix wrong animation of boss arm Signed-off-by: Matheus Miranda <[email protected]>
C++
mit
mind-scape/mindscape,mind-scape/mindscape
--- engine/src/level.cpp +++ engine/src/level.cpp @@ -1,4 +1,5 @@ #include "level.hpp" +#include <iostream> using namespace engine; @@ -23,6 +24,10 @@ void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ + if(game_object->name == "arm_left"){ + game_object->set_actual_animation(game_object->animations["left_arm"]); + } + game_object->draw(); } }
#include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ game_object->draw(); } } }
<|original_code|> #include "level.hpp" using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ game_object->draw(); } } } <|edits_diff|> --- engine/src/level.cpp +++ engine/src/level.cpp @@ -1,4 +1,5 @@ #include "level.hpp" +#include <iostream> using namespace engine; <|current_version|> #include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ game_object->draw(); } } } <|next_version|> #include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object : objects){ std::cout << "Freeing" << game_object->name << std::endl; game_object->free(); } EventHandler::listeners.clear(); } void Level::draw(){ for(auto game_object : objects){ if(game_object->is_active()){ if(game_object->name == "arm_left"){ game_object->set_actual_animation(game_object->animations["left_arm"]); } game_object->draw(); } } }
2b5eb8f79e75bd7fab3221acf806e70d468ce48a
stub/src/qtfirebase.cpp
stub/src/qtfirebase.cpp
#include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif
#include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_MESSAGING QtFirebaseMessaging *QtFirebaseMessaging::self = nullptr; #endif
Fix build with stub implementation
Fix build with stub implementation
C++
mit
Larpon/QtFirebase,Larpon/QtFirebase,Larpon/QtFirebase
--- stub/src/qtfirebase.cpp +++ stub/src/qtfirebase.cpp @@ -3,6 +3,7 @@ #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" +#include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; @@ -23,3 +24,7 @@ #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif + +#ifdef QTFIREBASE_BUILD_MESSAGING +QtFirebaseMessaging *QtFirebaseMessaging::self = nullptr; +#endif
#include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif
<|original_code|> #include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif <|edits_diff|> --- stub/src/qtfirebase.cpp +++ stub/src/qtfirebase.cpp @@ -3,6 +3,7 @@ #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" +#include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; <|current_version|> #include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif <|next_version|> #include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemoteConfig* QtFirebaseRemoteConfig::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_ADMOB QtFirebaseAdMob *QtFirebaseAdMob::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_AUTH QtFirebaseAuth *QtFirebaseAuth::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_DATABASE QtFirebaseDatabase *QtFirebaseDatabase::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_MESSAGING QtFirebaseMessaging *QtFirebaseMessaging::self = nullptr; #endif
5b362013706f78b84bf205c6cf04e31065f7b732
src/main.cpp
src/main.cpp
/* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" int main(int argc, char **argv){ try{ initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } }
/* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" #include <QImageReader> int main(int argc, char **argv){ try{ //Set the limit to 1 GiB. QImageReader::setAllocationLimit(1024); initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } }
Increase the QImageReader allocation limit.
Increase the QImageReader allocation limit.
C++
bsd-2-clause
Helios-vmg/Borderless,Helios-vmg/Borderless,Helios-vmg/Borderless,Helios-vmg/Borderless
--- src/main.cpp +++ src/main.cpp @@ -6,9 +6,12 @@ */ #include "ImageViewerApplication.h" +#include <QImageReader> int main(int argc, char **argv){ try{ + //Set the limit to 1 GiB. + QImageReader::setAllocationLimit(1024); initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec();
/* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" #include <QImageReader> int main(int argc, char **argv){ try{ initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } }
<|original_code|> /* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" int main(int argc, char **argv){ try{ initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } } <|edits_diff|> --- src/main.cpp +++ src/main.cpp @@ -6,6 +6,7 @@ */ #include "ImageViewerApplication.h" +#include <QImageReader> int main(int argc, char **argv){ try{ <|current_version|> /* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" #include <QImageReader> int main(int argc, char **argv){ try{ initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } } <|next_version|> /* Copyright (c), Helios All rights reserved. Distributed under a permissive license. See COPYING.txt for details. */ #include "ImageViewerApplication.h" #include <QImageReader> int main(int argc, char **argv){ try{ //Set the limit to 1 GiB. QImageReader::setAllocationLimit(1024); initialize_supported_extensions(); ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_unique_id()); return app.exec(); }catch (ApplicationAlreadyRunningException &){ return 0; }catch (NoWindowsException &){ return 0; } }
905cba4c0107520616c2b95515042b283aab28c4
JasonType.cpp
JasonType.cpp
#include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::Object: return "object"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; }
#include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; case JasonType::ObjectLong: return "object_long"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; }
Add long types to names.
Add long types to names.
C++
apache-2.0
arangodb/velocypack,arangodb/Jason,arangodb/Jason,arangodb/velocypack,arangodb/Jason,arangodb/Jason,arangodb/velocypack,arangodb/velocypack
--- JasonType.cpp +++ JasonType.cpp @@ -15,7 +15,9 @@ case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; + case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; + case JasonType::ObjectLong: return "object_long"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id";
#include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; }
<|original_code|> #include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::Object: return "object"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; } <|edits_diff|> --- JasonType.cpp +++ JasonType.cpp @@ -15,6 +15,7 @@ case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; + case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; case JasonType::External: return "external"; case JasonType::ID: return "id"; <|current_version|> #include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; } <|next_version|> #include "JasonType.h" using JasonType = triagens::basics::JasonType; //////////////////////////////////////////////////////////////////////////////// /// @brief get the name for a Jason type //////////////////////////////////////////////////////////////////////////////// char const* triagens::basics::JasonTypeName (JasonType type) { switch (type) { case JasonType::None: return "none"; case JasonType::Null: return "null"; case JasonType::Bool: return "bool"; case JasonType::Double: return "double"; case JasonType::String: return "string"; case JasonType::Array: return "array"; case JasonType::ArrayLong: return "array_long"; case JasonType::Object: return "object"; case JasonType::ObjectLong: return "object_long"; case JasonType::External: return "external"; case JasonType::ID: return "id"; case JasonType::ArangoDB_id: return "arangodb_id"; case JasonType::UTCDate: return "utc-date"; case JasonType::Int: return "int"; case JasonType::UInt: return "uint"; case JasonType::Binary: return "binary"; } return "unknown"; }
961d8ba3e631d3fbbbb6de91e98f63d5a9a7bbb5
opencog/atoms/core/Checkers.cc
opencog/atoms/core/Checkers.cc
/* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; bool check_evaluatable(const Handle& bool_atom) { return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); }
/* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; /// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { for (const Handle& h: bool_atom->getOutgoingSet()) { if (not h->is_type(EVALUATABLE_LINK)) return false; } return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); }
Add type checking for boolean link types.
Add type checking for boolean link types.
C++
agpl-3.0
misgeatgit/atomspace,AmeBel/atomspace,misgeatgit/atomspace,rTreutlein/atomspace,AmeBel/atomspace,misgeatgit/atomspace,misgeatgit/atomspace,rTreutlein/atomspace,misgeatgit/atomspace,AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace
--- opencog/atoms/core/Checkers.cc +++ opencog/atoms/core/Checkers.cc @@ -25,8 +25,13 @@ using namespace opencog; +/// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { + for (const Handle& h: bool_atom->getOutgoingSet()) + { + if (not h->is_type(EVALUATABLE_LINK)) return false; + } return true; }
/* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; /// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); }
<|original_code|> /* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; bool check_evaluatable(const Handle& bool_atom) { return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); } <|edits_diff|> --- opencog/atoms/core/Checkers.cc +++ opencog/atoms/core/Checkers.cc @@ -25,6 +25,7 @@ using namespace opencog; +/// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { return true; <|current_version|> /* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; /// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); } <|next_version|> /* * opencog/atoms/core/Checkers.cc * * Copyright (C) 2017 Linas Vepstas * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <opencog/atoms/base/Atom.h> #include <opencog/atoms/base/ClassServer.h> using namespace opencog; /// Check to see if every input atom is of Evaluatable type. bool check_evaluatable(const Handle& bool_atom) { for (const Handle& h: bool_atom->getOutgoingSet()) { if (not h->is_type(EVALUATABLE_LINK)) return false; } return true; } /* This runs when the shared lib is loaded. */ static __attribute__ ((constructor)) void init(void) { classserver().addValidator(BOOLEAN_LINK, check_evaluatable); }
100bc306dd15532dbbb2b353170aea47e8173a13
testbed/windows/runner/main.cpp
testbed/windows/runner/main.cpp
#include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); return EXIT_SUCCESS; }
#include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } // Initialize COM, so that it is available for use in the library and/or plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); ::CoUninitialize(); return EXIT_SUCCESS; }
Update Windows runner from template
Update Windows runner from template Picks up the recently add CoInitialize fix.
C++
apache-2.0
google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding
--- testbed/windows/runner/main.cpp +++ testbed/windows/runner/main.cpp @@ -18,6 +18,9 @@ ::AllocConsole(); } + // Initialize COM, so that it is available for use in the library and/or plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + RunLoop run_loop; flutter::DartProject project(L"data"); @@ -35,5 +38,6 @@ run_loop.Run(); + ::CoUninitialize(); return EXIT_SUCCESS; }
#include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } // Initialize COM, so that it is available for use in the library and/or plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); return EXIT_SUCCESS; }
<|original_code|> #include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); return EXIT_SUCCESS; } <|edits_diff|> --- testbed/windows/runner/main.cpp +++ testbed/windows/runner/main.cpp @@ -18,6 +18,9 @@ ::AllocConsole(); } + // Initialize COM, so that it is available for use in the library and/or plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + RunLoop run_loop; flutter::DartProject project(L"data"); <|current_version|> #include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } // Initialize COM, so that it is available for use in the library and/or plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); return EXIT_SUCCESS; } <|next_version|> #include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <windows.h> #include <vector> #include "flutter_window.h" #include "run_loop.h" #include "window_configuration.h" int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, _In_ wchar_t* command_line, _In_ int show_command) { // Attach to console when present (e.g., 'flutter run') or create a // new console when running with a debugger. if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { ::AllocConsole(); } // Initialize COM, so that it is available for use in the library and/or plugins. ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); RunLoop run_loop; flutter::DartProject project(L"data"); #ifndef _DEBUG project.SetEngineSwitches({"--disable-dart-asserts"}); #endif FlutterWindow window(&run_loop, project); Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); run_loop.Run(); ::CoUninitialize(); return EXIT_SUCCESS; }
e8fb48684147d54f5088194d644a1966c5421b86
src/insert_mode.cc
src/insert_mode.cc
#include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } }
#include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; }
Edit ``contents.is_inserting`` in insert modes
Edit ``contents.is_inserting`` in insert modes
C++
mpl-2.0
czipperz/vick-insert-mode
--- src/insert_mode.cc +++ src/insert_mode.cc @@ -6,6 +6,7 @@ void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; + contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); @@ -13,10 +14,12 @@ print_contents(get_contents()); } } + contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; + contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); @@ -27,4 +30,5 @@ print_contents(get_contents()); } } + contents.is_inserting = false; }
#include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } }
<|original_code|> #include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } } <|edits_diff|> --- src/insert_mode.cc +++ src/insert_mode.cc @@ -6,6 +6,7 @@ void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; + contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); @@ -13,10 +14,12 @@ print_contents(get_contents()); } } + contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; + contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); <|current_version|> #include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } } <|next_version|> #include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[contents.y].insert(contents.x, 1, ch); mvf(contents); if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; } void enter_replace_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { if(contents.x >= contents.cont[contents.y].size()) { contents.cont[contents.y].push_back(ch); } else { contents.cont[contents.y][contents.x] = ch; } if(get_contents().refresh) { print_contents(get_contents()); } } contents.is_inserting = false; }
af7ba3b71fcbda1ee1bef496c712da65712574d3
logicTest.cpp
logicTest.cpp
#include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); delete b1; } return 1; }
#include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); std::cout << i << " {" << std::endl; printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); std::cout << "}" << std::endl; delete b1; } return 1; }
Add identifying block number in rotation test
Add identifying block number in rotation test
C++
apache-2.0
MarkMcCaskey/tetrinos
--- logicTest.cpp +++ logicTest.cpp @@ -27,6 +27,8 @@ { auto b1 = new block( i ); + std::cout << i << " {" << std::endl; + printCoords( b1 ); b1->rotate(); printCoords( b1 ); @@ -37,6 +39,8 @@ b1->rotate(); printCoords( b1 ); + std::cout << "}" << std::endl; + delete b1; }
#include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); std::cout << i << " {" << std::endl; printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); delete b1; } return 1; }
<|original_code|> #include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); delete b1; } return 1; } <|edits_diff|> --- logicTest.cpp +++ logicTest.cpp @@ -27,6 +27,8 @@ { auto b1 = new block( i ); + std::cout << i << " {" << std::endl; + printCoords( b1 ); b1->rotate(); printCoords( b1 ); <|current_version|> #include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); std::cout << i << " {" << std::endl; printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); delete b1; } return 1; } <|next_version|> #include "logic.cpp" #include <iostream> #include <cstdlib> int main( void ); void printCoords( block* b ); int rotationTest( void ); int main( void ) { std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n"; exit( EXIT_SUCCESS ); } void printCoords( block *b ) { for( int i = 0; i < 4; ++i ) { std::cout << i << "(" << b->coord[i].x << "," << b->coord[i].y << ")" << std::endl; } std::cout << std::endl; } int rotationTest( void ) { for( int i = 0; i < 5; ++i ) { auto b1 = new block( i ); std::cout << i << " {" << std::endl; printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); b1->rotate(); printCoords( b1 ); std::cout << "}" << std::endl; delete b1; } return 1; }
250a86dc4041f75488d78653d9566b348e1b70c9
src/searchclient/dlgfilters.cpp
src/searchclient/dlgfilters.cpp
#include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); }
#include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> #include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(explanation); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); }
Add small explanation to the filter dialog.
Add small explanation to the filter dialog. svn path=/trunk/playground/base/strigi/; revision=609264
C++
lgpl-2.1
KDE/strigi
--- src/searchclient/dlgfilters.cpp +++ src/searchclient/dlgfilters.cpp @@ -4,11 +4,14 @@ #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> +#include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); + QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); + explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); @@ -17,6 +20,7 @@ QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); + layout->addWidget(explanation); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl);
#include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> #include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); }
<|original_code|> #include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); } <|edits_diff|> --- src/searchclient/dlgfilters.cpp +++ src/searchclient/dlgfilters.cpp @@ -4,11 +4,14 @@ #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> +#include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); + QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); + explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); <|current_version|> #include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> #include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); } <|next_version|> #include "dlgfilters.h" #include "filterwidget.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> #include <QLabel> DlgFilters::DlgFilters(const QList<QPair<bool,QString> >& filters, QWidget *parent) : QDialog(parent, Qt::Dialog) { setWindowTitle(tr("strigiclient - Edit filters")); QLabel* explanation = new QLabel(tr("Define filters that determine which files will be included and which will be excluded from the index, e.g. '*.html' or '.svn/' (do not index directories called '.svn').")); explanation->setWordWrap(true); filterwidget = new FilterWidget(); filterwidget->setFilters(filters); QPushButton* ok = new QPushButton(tr("&Ok")); ok->setDefault(true); QPushButton* cancel = new QPushButton(tr("&Cancel")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); layout->addWidget(explanation); layout->addWidget(filterwidget); QHBoxLayout* hl = new QHBoxLayout(); layout->addLayout(hl); hl->addStretch(); hl->addWidget(ok); hl->addWidget(cancel); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); } const QList<QPair<bool,QString> >& DlgFilters::getFilters() const { return filterwidget->getFilters(); }
9709d7c0d15f61f6df20c6614476ed725da9b5bc
src/floaxietest.cpp
src/floaxietest.cpp
#include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie);
#if __cplusplus >= 201402L #include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie); #endif
Fix building for pre-C++14 standards
Fix building for pre-C++14 standards Skip `floaxie` test in this case, as it requires at least C++14.
C++
mit
miloyip/dtoa-benchmark,miloyip/dtoa-benchmark,miloyip/dtoa-benchmark,miloyip/dtoa-benchmark,miloyip/dtoa-benchmark
--- src/floaxietest.cpp +++ src/floaxietest.cpp @@ -1,3 +1,5 @@ +#if __cplusplus >= 201402L + #include "test.h" #include "floaxie/ftoa.h" @@ -7,3 +9,5 @@ } REGISTER_TEST(floaxie); + +#endif
#if __cplusplus >= 201402L #include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie);
<|original_code|> #include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie); <|edits_diff|> --- src/floaxietest.cpp +++ src/floaxietest.cpp @@ -1,3 +1,5 @@ +#if __cplusplus >= 201402L + #include "test.h" #include "floaxie/ftoa.h" <|current_version|> #if __cplusplus >= 201402L #include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie); <|next_version|> #if __cplusplus >= 201402L #include "test.h" #include "floaxie/ftoa.h" void dtoa_floaxie(double v, char* buffer) { floaxie::ftoa(v, buffer); } REGISTER_TEST(floaxie); #endif
739b903d8e5444d8dc19361fb1057f6821382c37
notebooktree.cpp
notebooktree.cpp
#include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); }
#include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" #include <QHeaderView> NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); this->header()->hide(); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); }
Remove header from notebook tree
Remove header from notebook tree
C++
mit
jslick/PepperNote,jslick/PepperNote
--- notebooktree.cpp +++ notebooktree.cpp @@ -3,10 +3,13 @@ #include "treenotebookpageitem.h" #include "notebookexception.h" +#include <QHeaderView> + NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); + this->header()->hide(); } void NotebookTree::addNotebook(Notebook& notebook)
#include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" #include <QHeaderView> NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); }
<|original_code|> #include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); } <|edits_diff|> --- notebooktree.cpp +++ notebooktree.cpp @@ -2,6 +2,8 @@ #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" + +#include <QHeaderView> NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) <|current_version|> #include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" #include <QHeaderView> NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); } <|next_version|> #include "notebooktree.h" #include "treenotebookitem.h" #include "treenotebookpageitem.h" #include "notebookexception.h" #include <QHeaderView> NotebookTree::NotebookTree(QWidget* parent) : QTreeWidget(parent) { this->setColumnCount(1); this->header()->hide(); } void NotebookTree::addNotebook(Notebook& notebook) { TreeNotebookItem* treeItem = new TreeNotebookItem(notebook); if (this->notebookTrees.find(&notebook) == this->notebookTrees.end()) { this->notebookTrees[&notebook] = treeItem; this->addTopLevelItem(treeItem); } else { delete treeItem; throw NotebookException("Cannot add a notebook multiple times to the tree"); } } void NotebookTree::selectPage(Notebook* notebook, NotebookPage* page) { auto notebookTreeIter = this->notebookTrees.find(notebook); if (notebookTreeIter == this->notebookTrees.end()) throw NotebookException("Could not find tree node for the page to select"); TreeNotebookItem* notebookTree = *notebookTreeIter; QTreeWidgetItem* sectionTree = 0; TreeNotebookPageItem* pageNode = 0; notebookTree->getPathToPage(page, sectionTree, pageNode); if (!sectionTree) throw NotebookException("Result from getPathToPage; sectionTree is null"); if (!pageNode) throw NotebookException("Result from getPathToPage; pageNode is null"); notebookTree->setExpanded(true); sectionTree->setExpanded(true); pageNode->setSelected(true); }
d40a92f3ad086b71d0df4bca5a2d615c8b8cb380
Podrios.cpp
Podrios.cpp
/* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> using namespace std; int main() { cout << "Show Message." << endl; return 0; }
/* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> #include <stdlib.h> using namespace std; int main() { cout << "Show Message." << endl; system("pause"); return 0; }
Add system command for holding command console
Add system command for holding command console
C++
apache-2.0
NemoChenTW/PodriosCPP,NemoChenTW/PodriosCPP,NemoChenTW/PodriosCPP,NemoChenTW/PodriosCPP
--- Podrios.cpp +++ Podrios.cpp @@ -6,6 +6,8 @@ */ #include <iostream> +#include <stdlib.h> + using namespace std; @@ -14,5 +16,6 @@ { cout << "Show Message." << endl; + system("pause"); return 0; }
/* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> #include <stdlib.h> using namespace std; int main() { cout << "Show Message." << endl; return 0; }
<|original_code|> /* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> using namespace std; int main() { cout << "Show Message." << endl; return 0; } <|edits_diff|> --- Podrios.cpp +++ Podrios.cpp @@ -6,6 +6,8 @@ */ #include <iostream> +#include <stdlib.h> + using namespace std; <|current_version|> /* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> #include <stdlib.h> using namespace std; int main() { cout << "Show Message." << endl; return 0; } <|next_version|> /* * Podrios.cpp * * Created on: 2014年10月23日 * Author: nemo */ #include <iostream> #include <stdlib.h> using namespace std; int main() { cout << "Show Message." << endl; system("pause"); return 0; }
86b112bfa96f8e2b1771f708c3f4aabc4a0b1e94
libeve-api-proxy/source/Error.cpp
libeve-api-proxy/source/Error.cpp
#include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif
#include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; #ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; #else return strerror_r(err, buffer, sizeof(buffer)); #endif } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif
Use strerror_r instead of strerror_s for GCC/Linux
Use strerror_r instead of strerror_s for GCC/Linux
C++
mit
SyncViews/eve-api-proxy
--- libeve-api-proxy/source/Error.cpp +++ libeve-api-proxy/source/Error.cpp @@ -6,8 +6,12 @@ std::string errno_string(int err) { char buffer[1024]; +#ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; +#else + return strerror_r(err, buffer, sizeof(buffer)); +#endif } #ifdef _WIN32
#include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; #ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif
<|original_code|> #include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif <|edits_diff|> --- libeve-api-proxy/source/Error.cpp +++ libeve-api-proxy/source/Error.cpp @@ -6,6 +6,7 @@ std::string errno_string(int err) { char buffer[1024]; +#ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; } <|current_version|> #include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; #ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif <|next_version|> #include "Precompiled.hpp" #include "Error.hpp" #include "SmartPtr.hpp" #include "String.hpp" std::string errno_string(int err) { char buffer[1024]; #ifdef _WIN32 if (!strerror_s(buffer, sizeof(buffer), err)) throw std::runtime_error("strerror_s failed"); return buffer; #else return strerror_r(err, buffer, sizeof(buffer)); #endif } #ifdef _WIN32 std::string win_error_string(int err) { std::unique_ptr<wchar_t[], LocalFreeDeleter> buffer; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)(wchar_t**)unique_out_ptr(buffer), 0, nullptr); return utf16_to_utf8(buffer.get()); } #endif
b6c95361843cea1a16e6a1287ce247987b668b2b
main.cpp
main.cpp
#include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; }
#include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> #include <iostream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; if ( !task_stream.is_open() ) { cout << "Can`t open <" << task_fname << ">, break." << endl; return 1; } TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; }
Break if task file don`t exists
Break if task file don`t exists
C++
mit
dvetutnev/Ecwid-Console-downloader
--- main.cpp +++ main.cpp @@ -3,6 +3,7 @@ #include "on_tick_simple.h" #include <fstream> +#include <iostream> using namespace std; @@ -12,6 +13,11 @@ const size_t concurrency = 2; ifstream task_stream{task_fname}; + if ( !task_stream.is_open() ) + { + cout << "Can`t open <" << task_fname << ">, break." << endl; + return 1; + } TaskListSimple task_list{task_stream, "./"}; JobList job_list;
#include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> #include <iostream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; }
<|original_code|> #include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; } <|edits_diff|> --- main.cpp +++ main.cpp @@ -3,6 +3,7 @@ #include "on_tick_simple.h" #include <fstream> +#include <iostream> using namespace std; <|current_version|> #include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> #include <iostream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; } <|next_version|> #include "task_simple.h" #include "factory_simple.h" #include "on_tick_simple.h" #include <fstream> #include <iostream> using namespace std; int main(int argc, char *argv[]) { const string task_fname = "task_list.txt"; const size_t concurrency = 2; ifstream task_stream{task_fname}; if ( !task_stream.is_open() ) { cout << "Can`t open <" << task_fname << ">, break." << endl; return 1; } TaskListSimple task_list{task_stream, "./"}; JobList job_list; auto loop = AIO_UVW::Loop::getDefault(); auto factory = make_shared<FactorySimple>(loop); auto on_tick = make_shared< OnTickSimple<JobList> >(job_list, factory, task_list); factory->set_OnTick(on_tick); for (size_t i = 1; i <= concurrency; i++) { auto task = task_list.get(); if (!task) break; auto downloader = factory->create(*task); if (!downloader) continue; job_list.emplace_back(task, downloader); } loop->run(); return 0; }
40d965d75defd95662f70a3ed24d99ed7fa343aa
ouzel/android/WindowAndroid.cpp
ouzel/android/WindowAndroid.cpp
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { return Window::init(); } }
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" #include "Engine.h" #include "opengl/RendererOGL.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { std::shared_ptr<graphics::RendererOGL> rendererOGL = std::static_pointer_cast<graphics::RendererOGL>(sharedEngine->getRenderer()); rendererOGL->setAPIVersion(2); return Window::init(); } }
Set OpenGL ES version to 2 on Android
Set OpenGL ES version to 2 on Android
C++
unlicense
elvman/ouzel,Hotspotmar/ouzel,Hotspotmar/ouzel,elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,elnormous/ouzel
--- ouzel/android/WindowAndroid.cpp +++ ouzel/android/WindowAndroid.cpp @@ -2,6 +2,8 @@ // This file is part of the Ouzel engine. #include "WindowAndroid.h" +#include "Engine.h" +#include "opengl/RendererOGL.h" namespace ouzel { @@ -18,6 +20,10 @@ bool WindowAndroid::init() { + std::shared_ptr<graphics::RendererOGL> rendererOGL = std::static_pointer_cast<graphics::RendererOGL>(sharedEngine->getRenderer()); + + rendererOGL->setAPIVersion(2); + return Window::init(); } }
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" #include "Engine.h" #include "opengl/RendererOGL.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { return Window::init(); } }
<|original_code|> // Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { return Window::init(); } } <|edits_diff|> --- ouzel/android/WindowAndroid.cpp +++ ouzel/android/WindowAndroid.cpp @@ -2,6 +2,8 @@ // This file is part of the Ouzel engine. #include "WindowAndroid.h" +#include "Engine.h" +#include "opengl/RendererOGL.h" namespace ouzel { <|current_version|> // Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" #include "Engine.h" #include "opengl/RendererOGL.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { return Window::init(); } } <|next_version|> // Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "WindowAndroid.h" #include "Engine.h" #include "opengl/RendererOGL.h" namespace ouzel { WindowAndroid::WindowAndroid(const Size2& pSize, bool pResizable, bool pFullscreen, uint32_t pSampleCount, const std::string& pTitle): Window(pSize, pResizable, pFullscreen, pSampleCount, pTitle) { } WindowAndroid::~WindowAndroid() { } bool WindowAndroid::init() { std::shared_ptr<graphics::RendererOGL> rendererOGL = std::static_pointer_cast<graphics::RendererOGL>(sharedEngine->getRenderer()); rendererOGL->setAPIVersion(2); return Window::init(); } }
a7b06e5ad2147752b7e0a82c0c37778c72def66e
PlasMOUL/Messages/SimulationMsg.cpp
PlasMOUL/Messages/SimulationMsg.cpp
/****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { m_world.write(stream); }
/****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { MOUL::Message::read(stream); m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { MOUL::Message::write(stream); m_world.write(stream); }
Fix missing write call in SubWorldMsg
Fix missing write call in SubWorldMsg
C++
agpl-3.0
H-uru/dirtsand,H-uru/dirtsand,GehnShard/dirtsand,GehnShard/dirtsand
--- PlasMOUL/Messages/SimulationMsg.cpp +++ PlasMOUL/Messages/SimulationMsg.cpp @@ -19,10 +19,12 @@ void MOUL::SubWorldMsg::read(DS::Stream* stream) { + MOUL::Message::read(stream); m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { + MOUL::Message::write(stream); m_world.write(stream); }
/****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { MOUL::Message::read(stream); m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { m_world.write(stream); }
<|original_code|> /****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { m_world.write(stream); } <|edits_diff|> --- PlasMOUL/Messages/SimulationMsg.cpp +++ PlasMOUL/Messages/SimulationMsg.cpp @@ -19,6 +19,7 @@ void MOUL::SubWorldMsg::read(DS::Stream* stream) { + MOUL::Message::read(stream); m_world.read(stream); } <|current_version|> /****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { MOUL::Message::read(stream); m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { m_world.write(stream); } <|next_version|> /****************************************************************************** * This file is part of dirtsand. * * * * dirtsand is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * * dirtsand 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with dirtsand. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include "SimulationMsg.h" void MOUL::SubWorldMsg::read(DS::Stream* stream) { MOUL::Message::read(stream); m_world.read(stream); } void MOUL::SubWorldMsg::write(DS::Stream* stream) const { MOUL::Message::write(stream); m_world.write(stream); }
cbb0fd9cff4a5b73f3b2498e4ca21831892c723e
server/analyzer.cpp
server/analyzer.cpp
#include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; auto ctxs = dal->getFacts(premises); kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } return dirty; }); } }
#include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; DLOG(INFO) << "Starting analysis " << name; DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } DLOG(INFO) << "Finished analysis " << name; return dirty; }); } }
Add logging to analysis for profiling
Add logging to analysis for profiling
C++
mit
maurer/holmes,maurer/holmes,tempbottle/holmes,chubbymaggie/holmes,BinaryAnalysisPlatform/holmes
--- server/analyzer.cpp +++ server/analyzer.cpp @@ -9,7 +9,10 @@ kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; + DLOG(INFO) << "Starting analysis " << name; + DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); + DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { @@ -36,6 +39,7 @@ for (auto v : x) { dirty |= v; } + DLOG(INFO) << "Finished analysis " << name; return dirty; }); }
#include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; DLOG(INFO) << "Starting analysis " << name; DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } return dirty; }); } }
<|original_code|> #include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; auto ctxs = dal->getFacts(premises); kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } return dirty; }); } } <|edits_diff|> --- server/analyzer.cpp +++ server/analyzer.cpp @@ -9,7 +9,10 @@ kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; + DLOG(INFO) << "Starting analysis " << name; + DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); + DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { <|current_version|> #include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; DLOG(INFO) << "Starting analysis " << name; DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } return dirty; }); } } <|next_version|> #include "analyzer.h" #include "dal.h" #include "glog.h" #include <iostream> namespace holmes { kj::Promise<bool> Analyzer::run(DAL *dal) { std::vector<Holmes::Fact::Reader> searchedFacts; DLOG(INFO) << "Starting analysis " << name; DLOG(INFO) << "Getting facts for " << name; auto ctxs = dal->getFacts(premises); DLOG(INFO) << "Got facts for " << name; kj::Array<kj::Promise<bool>> analResults = KJ_MAP(ctx, ctxs) { if (cache.miss(ctx)) { auto req = analysis.analyzeRequest(); auto ctxBuilder = req.initContext(ctx.size()); auto dex = 0; for (auto&& val : ctx) { ctxBuilder.setWithCaveats(dex++, val); } return req.send().then([this, dal, ctx = kj::mv(ctx)](Holmes::Analysis::AnalyzeResults::Reader res){ auto dfs = res.getDerived(); bool dirty = false; if (dal->setFacts(dfs) != 0) { dirty = true; } cache.add(ctx); return dirty; }); } return kj::Promise<bool>(false); }; return kj::joinPromises(kj::mv(analResults)).then([this](kj::Array<bool> x){ bool dirty = false; for (auto v : x) { dirty |= v; } DLOG(INFO) << "Finished analysis " << name; return dirty; }); } }
c75d6bd0fad60e1ab6421b481d5eb575f4a5ce3e
src/gtest/main.cpp
src/gtest/main.cpp
#include "gtest/gtest.h" int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
#include "gtest/gtest.h" #include "sodium.h" int main(int argc, char **argv) { assert(sodium_init() != -1); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
Initialize libsodium in the gtest suite.
Initialize libsodium in the gtest suite.
C++
mit
aniemerg/zcash,loxal/zcash,bitcoinsSG/zcash,aniemerg/zcash,loxal/zcash,CTRoundTable/Encrypted.Cash,aniemerg/zcash,bitcoinsSG/zcash,aniemerg/zcash,bitcoinsSG/zcash,aniemerg/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,loxal/zcash,bitcoinsSG/zcash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,aniemerg/zcash,loxal/zcash,bitcoinsSG/zcash,loxal/zcash,loxal/zcash,CTRoundTable/Encrypted.Cash
--- src/gtest/main.cpp +++ src/gtest/main.cpp @@ -1,6 +1,8 @@ #include "gtest/gtest.h" +#include "sodium.h" int main(int argc, char **argv) { + assert(sodium_init() != -1); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
#include "gtest/gtest.h" #include "sodium.h" int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
<|original_code|> #include "gtest/gtest.h" int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } <|edits_diff|> --- src/gtest/main.cpp +++ src/gtest/main.cpp @@ -1,4 +1,5 @@ #include "gtest/gtest.h" +#include "sodium.h" int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); <|current_version|> #include "gtest/gtest.h" #include "sodium.h" int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } <|next_version|> #include "gtest/gtest.h" #include "sodium.h" int main(int argc, char **argv) { assert(sodium_init() != -1); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
7b91b2c561c2cfbd28e465a29837db272a6b5137
windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp
windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... return steps; } } } }
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" #include "WorldPinVisibility.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... m_messageBus.Publish(WorldPins::WorldPinsVisibilityMessage(WorldPins::SdkModel::WorldPinVisibility::All)); return steps; } } } }
Fix for missing Hovercards in Windows. Buddy: Mark
Fix for missing Hovercards in Windows. Buddy: Mark
C++
bsd-2-clause
eegeo/eegeo-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app
--- windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp +++ windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp @@ -4,6 +4,7 @@ #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" +#include "WorldPinVisibility.h" namespace ExampleApp { @@ -35,6 +36,8 @@ // TODO: Recreate MEA initial experience steps for windows... + m_messageBus.Publish(WorldPins::WorldPinsVisibilityMessage(WorldPins::SdkModel::WorldPinVisibility::All)); + return steps; } }
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" #include "WorldPinVisibility.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... return steps; } } } }
<|original_code|> // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... return steps; } } } } <|edits_diff|> --- windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp +++ windows/src/InitialExperience/SdkModel/WindowsInitialExperienceModule.cpp @@ -4,6 +4,7 @@ #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" +#include "WorldPinVisibility.h" namespace ExampleApp { <|current_version|> // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" #include "WorldPinVisibility.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... return steps; } } } } <|next_version|> // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WindowsInitialExperienceModule.h" #include "WindowsInitialExperiencePreLoadModel.h" #include "InitialExperienceIntroStep.h" //#include "InitialExperienceSearchResultAttractModeModel.h" #include "WorldPinVisibility.h" namespace ExampleApp { namespace InitialExperience { namespace SdkModel { WindowsInitialExperienceModule::WindowsInitialExperienceModule( WindowsNativeState& nativeState, PersistentSettings::IPersistentSettingsModel& persistentSettings, ExampleAppMessaging::TMessageBus& messageBus ) : InitialExperienceModuleBase(persistentSettings) , m_nativeState(nativeState) , m_messageBus(messageBus) //, m_pInitialExperienceSearchResultAttractModeModule(NULL) { } WindowsInitialExperienceModule::~WindowsInitialExperienceModule() { //Eegeo_DELETE m_pInitialExperienceSearchResultAttractModeModule; } std::vector<IInitialExperienceStep*> WindowsInitialExperienceModule::CreateSteps(WorldAreaLoader::SdkModel::IWorldAreaLoaderModel &worldAreaLoaderModel) { std::vector<IInitialExperienceStep*> steps; // TODO: Recreate MEA initial experience steps for windows... m_messageBus.Publish(WorldPins::WorldPinsVisibilityMessage(WorldPins::SdkModel::WorldPinVisibility::All)); return steps; } } } }
88281950eed0e9fadba9d13fc68707068b5b5628
media/base/run_all_unittests.cc
media/base/run_all_unittests.cc
// Copyright (c) 2012 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 "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { return TestSuiteNoAtExit(argc, argv).Run(); }
// Copyright (c) 2012 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 "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { MainHook hook(main, argc, argv); return TestSuiteNoAtExit(argc, argv).Run(); }
Add MainHook to media unittests.
Add MainHook to media unittests. MainHooks are in particular used on iOS to prevent the system from killing the test application at startup. See https://chromiumcodereview.appspot.com/10690161/ for more context. BUG=b/6754065 Review URL: https://chromiumcodereview.appspot.com/10915061 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@154946 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
M4sse/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,anirudhSK/chromium,patrickm/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,anirudhSK/chromium,markYoungH/chromium.src,Jonekee/chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,ChromiumWebApps/chromium,Just-D/chromium-1,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,dushu1203/chromium.src,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,ondra-novak/chromium.src,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,ltilve/chromium,anirudhSK/chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,anirudhSK/chromium,patrickm/chromium.src,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,M4sse/chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,ltilve/chromium,dushu1203/chromium.src,ChromiumWebApps/chromium,zcbenz/cefode-chromium,ltilve/chromium,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,anirudhSK/chromium,jaruba/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,zcbenz/cefode-chromium,Jonekee/chromium.src,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,patrickm/chromium.src,littlstar/chromium.src,jaruba/chromium.src,dednal/chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,littlstar/chromium.src,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,Just-D/chromium-1,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,ltilve/chromium,Just-D/chromium-1,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,dednal/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,ondra-novak/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,anirudhSK/chromium,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,Fireblend/chromium-crosswalk,littlstar/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,M4sse/chromium.src,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,littlstar/chromium.src,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,nacl-webkit/chrome_deps,ltilve/chromium,pozdnyakov/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,ondra-novak/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,Just-D/chromium-1,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium
--- media/base/run_all_unittests.cc +++ media/base/run_all_unittests.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" @@ -22,5 +23,6 @@ } int main(int argc, char** argv) { + MainHook hook(main, argc, argv); return TestSuiteNoAtExit(argc, argv).Run(); }
// Copyright (c) 2012 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 "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { return TestSuiteNoAtExit(argc, argv).Run(); }
<|original_code|> // Copyright (c) 2012 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 "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { return TestSuiteNoAtExit(argc, argv).Run(); } <|edits_diff|> --- media/base/run_all_unittests.cc +++ media/base/run_all_unittests.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" <|current_version|> // Copyright (c) 2012 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 "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { return TestSuiteNoAtExit(argc, argv).Run(); } <|next_version|> // Copyright (c) 2012 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 "base/test/main_hook.h" #include "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} protected: virtual void Initialize(); }; void TestSuiteNoAtExit::Initialize() { // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); // Run this here instead of main() to ensure an AtExitManager is already // present. media::InitializeMediaLibraryForTesting(); } int main(int argc, char** argv) { MainHook hook(main, argc, argv); return TestSuiteNoAtExit(argc, argv).Run(); }
16e678cc1869afdcffa0adffadfa4d6ce7b78d20
Day2/Day2.cpp
Day2/Day2.cpp
// Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; system("pause"); return 0; }
// Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; uint64_t Ribbon = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; std::cout << "Ribbon: " << Ribbon << std::endl; system("pause"); return 0; }
Add solution for Day 2 part two
Add solution for Day 2 part two
C++
mit
jloehr/AdventOfCode,jloehr/AdventOfCode,jloehr/AdventOfCode
--- Day2/Day2.cpp +++ Day2/Day2.cpp @@ -15,6 +15,7 @@ std::string Line; uint64_t WrappingPaper = 0; + uint64_t Ribbon = 0; while (std::getline(Input, Line)) { @@ -35,13 +36,16 @@ uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); + uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; + Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; + std::cout << "Ribbon: " << Ribbon << std::endl; system("pause");
// Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; uint64_t Ribbon = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; system("pause"); return 0; }
<|original_code|> // Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; system("pause"); return 0; } <|edits_diff|> --- Day2/Day2.cpp +++ Day2/Day2.cpp @@ -15,6 +15,7 @@ std::string Line; uint64_t WrappingPaper = 0; + uint64_t Ribbon = 0; while (std::getline(Input, Line)) { @@ -35,8 +36,10 @@ uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); + uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; + Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); <|current_version|> // Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; uint64_t Ribbon = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; system("pause"); return 0; } <|next_version|> // Day2.cpp : Defines the entry point for the console application. // #include "stdafx.h" int main() { std::ifstream Input("Input.txt"); if (!Input.is_open()) { std::cout << "Error opening File!" << std::endl; return 0; } std::string Line; uint64_t WrappingPaper = 0; uint64_t Ribbon = 0; while (std::getline(Input, Line)) { std::stringstream LineStream(Line); uint32_t l; uint32_t h; uint32_t w; LineStream >> l; LineStream.get(); LineStream >> h; LineStream.get(); LineStream >> w; uint32_t Side1 = l * w; uint32_t Side2 = h * w; uint32_t Side3 = l * h; uint32_t SmallestSide = std::min({ Side1, Side2, Side3 }); uint32_t LargestDimension = std::max({ l, w, h }); WrappingPaper += SmallestSide + 2 * Side1 + 2 * Side2 + 2 * Side3; Ribbon += l * w * h + 2 * l + 2 * w + 2 * h - 2 * LargestDimension; } Input.close(); std::cout << "Wrapping Paper: " << WrappingPaper << std::endl; std::cout << "Ribbon: " << Ribbon << std::endl; system("pause"); return 0; }
0fa689e5f7c4164088f9a3d474da286f0250a81c
testing/test_single_agent_async_execute.cpp
testing/test_single_agent_async_execute.cpp
#include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; }
#include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); assert(exec.valid()); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); assert(exec.valid()); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; }
Validate the executor as part of the test
Validate the executor as part of the test
C++
bsd-3-clause
egaburov/agency,egaburov/agency
--- testing/test_single_agent_async_execute.cpp +++ testing/test_single_agent_async_execute.cpp @@ -24,6 +24,7 @@ f.wait(); assert(set_me_to_thirteen == 13); + assert(exec.valid()); } { @@ -37,6 +38,7 @@ }); assert(f.get() == 13); + assert(exec.valid()); } }
#include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); assert(exec.valid()); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; }
<|original_code|> #include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; } <|edits_diff|> --- testing/test_single_agent_async_execute.cpp +++ testing/test_single_agent_async_execute.cpp @@ -24,6 +24,7 @@ f.wait(); assert(set_me_to_thirteen == 13); + assert(exec.valid()); } { <|current_version|> #include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); assert(exec.valid()); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; } <|next_version|> #include <agency/new_executor_traits.hpp> #include <cassert> #include <iostream> #include "test_executors.hpp" template<class Executor> void test() { using executor_type = Executor; { // returning void executor_type exec; int set_me_to_thirteen = 0; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [&] { set_me_to_thirteen = 13; }); f.wait(); assert(set_me_to_thirteen == 13); assert(exec.valid()); } { // returning int executor_type exec; auto f = agency::new_executor_traits<executor_type>::async_execute(exec, [] { return 13; }); assert(f.get() == 13); assert(exec.valid()); } } int main() { using namespace test_executors; test<empty_executor>(); test<single_agent_when_all_execute_and_select_executor>(); test<multi_agent_when_all_execute_and_select_executor>(); test<single_agent_then_execute_executor>(); test<multi_agent_execute_returning_user_defined_container_executor>(); test<multi_agent_execute_returning_default_container_executor>(); test<multi_agent_execute_returning_void_executor>(); std::cout << "OK" << std::endl; return 0; }
a2a02703e2f3b3bb26081b605af62ac7309562a2
config.tests/sensord/main.cpp
config.tests/sensord/main.cpp
#include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); return 0; }
#include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> #include <abstractsensor.h> #include <abstractsensor_i.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); QList<DataRange> (AbstractSensorChannelInterface::*func)() = &AbstractSensorChannelInterface::getAvailableIntervals; return 0; }
Update the sensord config test
Update the sensord config test Pulse seems to have an old version so it's breaking. Update the test to use the same code the plugin uses so that this isn't allowed.
C++
lgpl-2.1
KDE/android-qt-mobility,enthought/qt-mobility,KDE/android-qt-mobility,qtproject/qt-mobility,kaltsi/qt-mobility,qtproject/qt-mobility,tmcguire/qt-mobility,kaltsi/qt-mobility,enthought/qt-mobility,qtproject/qt-mobility,kaltsi/qt-mobility,qtproject/qt-mobility,qtproject/qt-mobility,enthought/qt-mobility,tmcguire/qt-mobility,enthought/qt-mobility,tmcguire/qt-mobility,tmcguire/qt-mobility,tmcguire/qt-mobility,KDE/android-qt-mobility,kaltsi/qt-mobility,enthought/qt-mobility,kaltsi/qt-mobility,qtproject/qt-mobility,kaltsi/qt-mobility,KDE/android-qt-mobility,enthought/qt-mobility
--- config.tests/sensord/main.cpp +++ config.tests/sensord/main.cpp @@ -1,10 +1,13 @@ #include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> +#include <abstractsensor.h> +#include <abstractsensor_i.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); + QList<DataRange> (AbstractSensorChannelInterface::*func)() = &AbstractSensorChannelInterface::getAvailableIntervals; return 0; }
#include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> #include <abstractsensor.h> #include <abstractsensor_i.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); return 0; }
<|original_code|> #include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); return 0; } <|edits_diff|> --- config.tests/sensord/main.cpp +++ config.tests/sensord/main.cpp @@ -1,5 +1,7 @@ #include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> +#include <abstractsensor.h> +#include <abstractsensor_i.h> int main() { <|current_version|> #include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> #include <abstractsensor.h> #include <abstractsensor_i.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); return 0; } <|next_version|> #include <sensormanagerinterface.h> #include <datatypes/magneticfield.h> #include <abstractsensor.h> #include <abstractsensor_i.h> int main() { SensorManagerInterface* m_remoteSensorManager; m_remoteSensorManager = &SensorManagerInterface::instance(); QList<DataRange> (AbstractSensorChannelInterface::*func)() = &AbstractSensorChannelInterface::getAvailableIntervals; return 0; }
End of preview.

No dataset card yet

Downloads last month
16