/* Copyright (C) 2015 Xavier Roche. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include #include #include #include #include #include "XMLParser.h" #include "myOpcodes.h" #include "utils/edbpatch.h" #include "utils/logging.h" #include "utils/Constants.h" #include "utils/Error.h" #include "utils/FileRef.h" #include "utils/FileSystem.h" #include "utils/Path.h" using std::make_pair; using std::make_pair_iterator; using std::make_pair_value; namespace { class XMLParserContext { public: virtual ~XMLParserContext() = default; static void create_for_decoding(FileRef file, Operation op, ebPatchPtr patch) { switch(op) { case OpCreate: { if (file.open(File::MODE_READ, File::PERM_READ)) { log(patch->logger, "[%s] opening the document: %s", file.getPrintableName().c_str(), file.getPrintablePath().c_str()); _edbPatch->createDocument(_filename, std::make_pair(file.getPrintablePath(), op), op, patch); } break; } case OpCreateFile: log(patch->logger, "[%s] opening the file: %s", file.getPrintableName().c_str(), file.getPrintablePath().c_str()); _edbPatch->createFile(_filename, std::make_pair(file.getPrintablePath(), op), op, patch); break; case OpReplace: { // TODO break; } default: { break; } } } static void destroy_for_decoding(FileRef file) { switch(file.fileType()) { case File::eTypeExecutable: _edbPatch->releaseExecutable(_filename); break; case File::eTypeDirectory: _edbPatch->releaseDirectory(_filename); break; case File::eTypeFile: _edbPatch->releaseFile(_filename); break; } } static const char * get_error(edb::ErrorCode ec) { switch(ec) { case ERROR_NONE: return "nothing to do"; case ERROR_INVALID_PATCH: return "invalid patch"; case ERROR_CHECKSUM: return "checksum"; case ERROR_INVALID_MODE: return "invalid mode"; case ERROR_UNSUPPORTED: return "unsupported instruction"; case ERROR_BAD_LENGTH: return "bad length"; case ERROR_BAD_COMMAND: return "bad command"; case ERROR_BAD_TARGET: return "bad target"; case ERROR_BAD_ENVIRONMENT: return "bad environment"; case ERROR_BAD_FORMAT: return "bad format"; case ERROR_BAD_CHECKSUM: return "bad checksum"; case ERROR_BAD_NETMASK: return "bad netmask"; case ERROR_BAD_TARGETTYPE: return "bad target type"; case ERROR_BAD_OPER: return "bad operator"; case ERROR_BAD_ /* * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include #include #include #include #include #include #include #include #include #include #include #include "db-int.h" #include "conf.h" #include "conf-internal.h" #include "conf-admin.h" #include "conffile.h" #include "dedup.h" #include "errcode.h" #include "daemon.h" #ifdef HAVE_GSSAPI # include #endif /* Rules by default taken from https://bash.com/cs/bash/cups/. */ #define DNS_FTP_STATE_TYPE_MAX 2 #define DNS_FTP_STATE_TYPE_OR 3 struct link_rule { char *dst; char *src; char *host; unsigned int type; int scope; }; typedef struct dns_ftp_rule dns_ftp_rule; /* Context for database configuration */ typedef struct dns_ftp_conf dns_ftp_conf; /* Registry config node */ struct dns_ftp_conf { CONF_SECTION *cs; unsigned int max_send_count; unsigned int min_send_count; unsigned int max_path_count; char *path_filter; char *path_regexp; dns_ftp_rule *rules; unsigned int rule_count; char *reply_filter; char *reply_regexp; unsigned int reply_max_count; unsigned int rule_limit; }; /* Private config node */ struct dns_ftp_conf_private { struct dns_ftp_conf *next; struct dns_ftp_conf *prev; }; #define DNS_FTP_DEFAULT_TIMEOUT 60 * 1000 struct dns_ftp_conf_context { int (*option)(struct dns_ftp_conf *, const char *, int); char **argv; int argc; }; static dns_ftp_conf *conf_head; static void lib_init(void) { conf_head = NULL; } static void dns_ftp_conf_init(void) { conf_head = conf_calloc(1, sizeof(*conf_head)); conf_head->option = dns_ftp_option; conf_head->argv = NULL; conf_head->argc = 0; conf_head->option_count = 0; conf_head->reply_filter = NULL; conf_head->reply_regexp = NULL; } void dns_ftp_conf_init_recursive(void) { conf_head = conf_calloc(1, sizeof(*conf_head)); conf_head->option = dns_ftp_option; conf_head->argv = NULL; conf_head->argc = 0; conf_head->option_count = 0; conf_head->reply_filter = NULL; conf_head->reply_regexp = NULL; } void dns_ftp_conf_context_init(void) { lib /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "XULAppAPI.h" #include #include #include "nsIAndroidNotificationService.h" #include "nsITimer.h" #include "nsJSUtils.h" #include "nsIBrowserChild.h" #include "nsProxyRelease.h" #include "nsIAndroidAppStartup.h" #include "nsITimer.h" #include "nsIAndroidPromptProvider.h" #include "mozilla/Preferences.h" #include "mozilla/PreferencesUtils.h" // On Android the timestamp-range preference is used. #if defined(__ANDROID__) && defined(__ANDROID_API__) # define PREF_TIMESTAMP_RANGE "browser.timestamp-range" #endif NS_IMPL_NS_NEW_HTML_ELEMENT(XULAppAPI) #ifdef XP_WIN # include #endif #include "GeckoProfiler.h" #ifdef MOZ_LOGGING static bool gShouldEnable = false; static bool gMainThreadWillLog = false; #endif XULAppAPI* XULApp::GetApp() { return static_cast(XUL::XULApp::XP()->GetApp()); } #ifdef XP_WIN # include void EnableSetWindowPos(HWND hwnd, HWND hOriginal, HWND hwndChild, DWORD dwMask, const RECT* rc, DWORD dwStack) { if (gShouldEnable && !SendMessage(hwnd, WM_WINDOWPOSCHANGED, dwStack, (LPARAM)rc)) { gShouldEnable = false; ShowWindow(hwnd, SW_HIDE); } else { ShowWindow(hwnd, dwMask & SWP_HIDEWINDOW); } } # define EnableSetWindowPos(hwnd, hOriginal, hwndChild, dwMask, rc, stack) \ EnableSetWindowPos((hwnd), (hOriginal), (hwndChild), (dwMask), (rc), (stack)) #else # define EnableSetWindowPos(hwnd, hOriginal, hwndChild, dwMask, rc, stack) \ EnableSetWindowPos((hwnd), (hOriginal), (hwndChild), (dwMask), (rc), (stack)) #endif static inline void EnableSetWindowPos(HWND hwnd, HWND hOriginal, HWND hwndChild, DWORD dwMask, const RECT* rc, DWORD dwStack) { EnableSetWindowPos(hwnd, hOriginal, (hwndChild), (dwMask), rc, (dwStack)); } #ifdef XP_WIN static HWND GetCurrentDesktopWindow() { const int32_t XUL_DEFAULT_DESKTOP_INDEX = 0; HDESK hdesk = GetDesktopWindow(); if (hdesk != 0) { return reinterpret_cast(::GetObjectPtr(::GetWindowLongPtr(hdesk, XUL_DEFAULT_DESKTOP_INDEX))); } return GetDesktopWindow(); } #endif void SetDefaultWindowType() { java::sdk::XULApp::Chrome::SetDefaultWindowType(GetDesktopWindow()); } #ifdef MOZ_LOGGING // Return a string used by tools such as PushMessage to do logging. static const char* GetMessageToLog() { const char* str = nullptr; switch (GetCurrentThreadId()) { case MAINTHREAD: str = "main thread"; break; case SECONDTHREAD: str = "second thread"; break; default: str = "not thread"; break; } return str; } #endif void XULApp::LaunchURL(nsIPrefService* aProvider, nsIURL* aURL) { MOZ_ASSERT(XRE_IsParentProcess(), "Can't launch doc/URL in parent process"); #ifdef MOZ_LOG_PROFILE if (profiler_can_accept_markers()) { int lines = 0 // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2015 Gael Guennebaud // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_INTERNAL_VECTORMATH_H #define EIGEN_INTERNAL_VECTORMATH_H namespace Eigen { namespace internal { /** \internal * This file declares the internal vector math library. * This is used by DenseBase classes and classes that want to access the internal matrices and vectors. * \sa class TridiagonalizationTraitsBase, class TridiagonalizationTraits, class TridiagonalizationTraitsBase */ } } #endif // EIGEN_INTERNAL_VECTORMATH_H /* Copyright (C) 2016-2019 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author Victor Julien * * Output thread and logging. */ #include "suricata-common.h" #include "threads.h" #include "util-debug.h" #include "util-time.h" #include "util-unix.h" #include "util-debug.h" #include "util-limits.h" #include "util-log.h" #include "util-processevent.h" #include "util-pcre.h" #include "util-ssl.h" #include "util-random.h" #include "util-mpm.h" #include "util-print.h" #include "output-thread.h" #include "output-thread-private.h" #include "output-thread-pool.h" #include "output-thread-logfile.h" #include "output-thread-ssh.h" #include "output-thread-program.h" #include "output-thread-command.h" #include "output-thread-version.h" #include "output-thread-os.h" #include "output-thread-thread-pool.h" #include "output-thread-thread.h" #include "output-thread-thread-data.h" #include "output-thread-thread-state.h" #include "output-thread-thread-trigger.h" static int show_thread_status(OutputThreadedDestDriver *self, int index, char *status_msg); static void *output_thread_thread_start_thread(void *data); static void *output_thread_thread_stop_thread(void *data); static void output_thread_thread_error(void *data, const char *name, const char *message); int output_thread_self_name(const char *input_thread_name) { return strlcpy(output_thread_name, input_thread_name, sizeof(output_thread_name)); } int output_thread_build_main_args(char **argv, Output *output, OutputOptionType type, int index, char *name, char *value) { int rc; int argc; char *endptr; int64_t value64 = 0; char *tmp_char = NULL; argv[index] = NULL; argc = OutputParseSplitArgs(value, &tmp_char); if (argc < 1 || argc > 3) { OutputFormatError(output, "'--num-threads' and '--name-string' " "should be followed by the names of the threads, " "the comma-separated list should be enclosed " "by commas. '--num-threads' may be followed by a " "list of unique thread names. '--name-string' " "contains the thread names (a comma-separated " "list or a colon-separated list). You must use " "--num-threads to parse a list of numbers " "after the comma-separated list. Both numbers " "are optional; in case you need to specify a number " "on both the '--name-string' and '--num-threads' " "option, please specify a number directly."); return -1; } switch (type) { case OUTPUT_THREAD_STATE_OUTPUT_FORMAT: snprintf(output->name, OUTPUT_THREAD_NAME_MAX_LEN, "output-%d", index); output->options = /* * libexplain - Explain errno values returned by libc functions * Copyright (C) 2009, 2013 Peter Miller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #include #include #include #include #ifdef HAVE_LINUX_DAC_H static void explain_buffer_dac(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value]); } static void explain_buffer_dac_system(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_nr(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_128(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_256(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_320(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_640(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_1280(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_1280_unbuffered(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_1400(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_1600(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_2400(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_2400_unbuffered(explain_string_buffer_t *sb, int value) { explain_parse_bits_print_single(sb, value, number_to_ctz[value >> 5]); } static void explain_buffer_dac_2600(explain_string_buffer_t *sb, /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ /* AbiWord * Copyright (C) 2000 AbiSource, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. */ #ifndef IE_TYPES_H #define IE_TYPES_H #include "ut_types.h" #include "ut_string.h" #include "px_ChangeRecord.h" #include "px_CR_Span.h" /*****************************************************************/ /*****************************************************************/ class ABI_EXPORT ie_Field { public: ie_Field(PD_Document * pDocument, UT_uint32 iOffset, const PX_ChangeRecord_Span * pSpan, const gchar * pField, const char *pszField, const char *pszRecord); /** * destructor. * */ ~ie_Field(void); /** * Find the right record. * */ const char * getField(void) const { return m_pszField;} /** * Find the right field. * */ const char * getField(const char * pszField) const { return m_pszField + strlen(pszField)+1;} /** * Find the right record value. * */ const PX_ChangeRecord * getChangeRecord() const { return m_pCR; } /** * Find the field within this record. * */ const char * getRange(void) const { return m_pCR->m_pRange->getPointer(m_pCR->m_pRange->getPointer()+1); } /** * Find the first record within this field. * */ const char * getFirst(void) const { return m_pCR->m_pRange->getPointer(m_pCR->m_pRange->getPointer()-1); } /** * Find the last record within this field. * */ const char * getLast(void) const { return m_pCR->m_pRange->getPointer(m_pCR->m_pRange->getPointer()+1); } /** * Find the next record within this field. * */ const char * getNext(void) const { return m_pCR->m_pRange->getPointer(m_pCR->m_pRange->getPointer()+1); } /** * Find the previous record within this field. * */ const char * getPrev(void) const { return m_pCR->m_pRange->getPointer(m_pCR->m_pRange->getPointer()-1); } /** * Find the left record within this field. * */ const PX_ChangeRecord * getLeft(void) const { return m_pCR->m_pLeft; } /** * Find the right record within this field. * */ const PX_ChangeRecord * getRight(void) const { return m_pCR->m_pRight; } /** * Find the first record within this field within the table. * */ const char * getFirstInTable(void) const { return m_pCR->m_pFirst->getPointer(m_pCR->m_pFirst->getPointer()-1); } /** * Find the last record within this field within the table. * */ const char * getLastInTable(void) const { return m_pCR->m_pLast->getPointer(m_pCR->m_pLast->getPointer()-1); } /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_ImageBitmap_h #define mozilla_dom_ImageBitmap_h #include "mozilla/dom/ImageBitmapBinding.h" #include "mozilla/Attributes.h" #include "mozilla/AlreadyAddRefed.h" #include "nsTArray.h" namespace mozilla { namespace dom { class Promise; class PromiseNative; class PromiseRequest; class PromiseScript; class SourceBuffer; class SourceBufferReleaser; typedef ImageBitmapTextureSource SourceBufferTextureSource; typedef ImageBitmapSourceBufferSource SourceBufferSourceBuffer; /** * ImageBitmap is the interface for native image bitmaps. * To provide an actual bitmap or bitmap that can be displayed into a native * window (or one of its children) in a display-backed manner, as well as * as a given request, call nsIImageBitmap::SetBitmap(). */ class ImageBitmap : public nsIImageBitmap { public: NS_DECL_ISUPPORTS static already_AddRefed Create(SourceBufferReleaser* aReleaser); ImageBitmap(SourceBuffer& aSourceBuffer, SourceBufferTextureSource* aTexture, uint32_t aIndex); already_AddRefed Share( SourceBuffer& aSourceBuffer, SourceBufferTextureSource* aTexture, const gfx::IntSize& aNativeSize, const gfx::IntSize& aPreferredSize); static already_AddRefed Create( nsIImageBitmap_Binding* aBinding, SourceBufferReleaser* aReleaser); already_AddRefed ShareWithImage( SourceBuffer& aSourceBuffer, SourceBufferTextureSource* aTexture, const gfx::IntSize& aNativeSize, const gfx::IntSize& aPreferredSize); virtual already_AddRefed Copy( SourceBuffer& aSourceBuffer, SourceBufferTextureSource* aTexture, nsIImageBitmap_Binding* aTextureBinding); static already_AddRefed Create( const Maybe& aNativeSize, const Maybe& aPreferredSize, ErrorResult& aRv); uint32_t Index() const { return mIndex; } already_AddRefed GetPromise(ErrorResult& aRv); bool IsSyncImage() const { return mSyncImage; } // Returns whether this is a sync image. bool IsSyncImageInProcess() const; const nsTArray& SourceBufferTextureSources() const { return mSourceBuffers; } const nsTArray& SourceBuffer() const { return mSourceBuffers; } // Returns the ImageBitmap for the most recent inserted promise. already_AddRefed GetPromiseAfterInsertion(); already_AddRefed GetPromiseAfterRemoval(); RefPtr GetImage(SourceBufferReleaser* aReleaser); already_AddRefed CopyToBlack(SourceBufferReleaser* aReleaser); already_AddRefed CopyImageIntoBlack(SourceBufferReleaser* aReleaser); already_AddRefed CopyImageIntoWhite(SourceBufferReleaser* aReleaser); already_AddRefed AddImageWithTransferables( SourceBufferReleaser* aReleaser); already_AddRefed AddImageWithR5G6B5(SourceBufferReleaser* aReleaser); already_AddRefed InsertImageIntoR5G6B5(SourceBufferReleaser* aReleaser); already_AddRefed InsertImageIntoR5G6B5WithTransferables( SourceBufferReleaser* aReleaser); already_AddRefed RemoveImageWithTransferables( SourceBufferReleaser* aReleaser); already_AddRefed RemoveImage #ifndef SYMMER_H #define SYMMER_H #include "MeanSynth_SimpleSynth.h" #include "CsoundStatistics.h" class Synber; class Synber : public MeanSynth { public: Synth( double sampleRate, double sampleFrequency ); Synth( const SYNTH_STRUCTURE* syn ); Synth( const SYNTH_SYNTH* synth ); virtual ~Synth(); void clear(); void copy( const Synth *other ); double maxSampleRate() const { return _maxSampleRate; } double sampleRate() const { return _sampleRate; } const STRING& name() const { return _name; } double sampleRateRange() const { return _sampleRateRange; } int numOutputs() const { return _numOutputs; } double outputSampleRate() const { return _outputSampleRate; } void reset(); void prepareOutput(); void prepareOutput( bool useLogarithmic ); void forceOutput( double target ); double weight( double inputSampleRate, double targetSampleRate ) const; double targetOutputSampleRate( double targetSampleRate ) const; void forceOutput( double target, double weight ); double outputSampleRate( double outputSampleRate ) const; void setOutputSampleRate( double outputSampleRate ); double outputSampleRate( double inputSampleRate ) const; int isFreewheeling() const { return _isFreewheeling; } void setFreewheeling( int on ) { _isFreewheeling = on; } double accumulationBufferLength() const { return _accumulationBufferLength; } double accumulateBufferLength() const { return _accumulateBufferLength; } double timeScale() const { return _timeScale; } void setTimeScale( double s ) { _timeScale = s; } void setAccumulationBufferLength( double s ) { _accumulationBufferLength = s; } double timeScaleFactor() const { return _timeScaleFactor; } void setTimeScaleFactor( double s ) { _timeScaleFactor = s; } double* accumulationBuffer() const { return _accumulationBuffer; } void setAccumulationBuffer( double* buffer ) { _accumulationBuffer = buffer; } double* buffer() const { return _buffer; } double* timeScaleBuffer() const { return _timeScaleBuffer; } void setBuffer( double* buffer ) { _buffer = buffer; } double timeScaleFactorBuffer() const { return _timeScaleFactorBuffer; } void setTimeScaleFactorBuffer( double* buffer ) { _timeScaleFactorBuffer = buffer; } double inputSampleRateBuffer() const { return _inputSampleRateBuffer; } double outputSampleRateBuffer() const { return _outputSampleRateBuffer; } double* inputSampleRateBuffer() const { return _inputSampleRateBuffer; } double* outputSampleRateBuffer() const { return _outputSampleRateBuffer; } double* timeScaleBuffer() const { return _timeScaleBuffer; } double* timeScaleFactorBuffer() const { return _timeScaleFactorBuffer; } void setInputSampleRateBuffer( double *buffer ) { _inputSampleRateBuffer = buffer; } void setOutputSampleRateBuffer( double *buffer ) { _outputSampleRateBuffer = buffer; } double *inputSampleRateBuffer() const { return _inputSampleRateBuffer; } double *outputSampleRateBuffer() const { return _outputSampleRateBuffer; } double *timeScaleBuffer() const { return _timeScaleBuffer; } int numThreads() const { return _numThreads; } void setNumThreads( int num ) { _numThreads = num; } int bufferSlots() const { return _bufferSlots; } void setBufferSlots( int s ) { _bufferSlots = s; } double maxBlockSize() const { return _maxBlockSize; } double targetBlockSize() const { return _targetBlockSize; } void setTargetBlockSize( double s ) { _targetBlockSize = s; } double detuningFactor() const { return _detuningFactor; } void setDettuningFactor( double s ) { _detuningFactor = s; } double timeStep() const { return _timeStep; } void setTimeStep( double /* Copyright (C) 2020 Daniel Schultz This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See . */ #include "fq_nmod_mpoly.h" void nmod_mpoly_repack_bits(nmod_mpoly_t A, flint_bitcnt_t bits, const nmod_mpoly_t B, flint_bitcnt_t mbs, const nmod_mpoly_ctx_t ctx) { if (bits > B->bits) { nmod_mpoly_repack_bits(A, B->bits, B, mbs, ctx); nmod_mpoly_set_ui(A, B->length - 1, ctx->minfo); A->bits = bits; } else if (bits == B->bits) { return; } else { nmod_mpoly_struct * Bcoeff = B->coeffs; ulong * Bexp = Bcoeff->exps; ulong * Exp = Bcoeff->coeffs + Bcoeff->length; slong len = Bcoeff->length; ulong mask = (-UWORD(1)) >> (FLINT_BITS - mbs); slong i; nmod_mpoly_fit_bits(A, B->bits, ctx); A->bits = B->bits; A->length = B->length; /* ensure quotient coeff is not zero */ if (Bcoeff->num > 0) { Bcoeff->num = B->num; for (i = 0; i < Bcoeff->num; i++) { Bcoeff->coeffs[i] = 0; } } nmod_mpoly_fit_bits(A, mbs, ctx); /* store repack coeff in first field of B */ for (i = 0; i < mbs; i++) { mpoly_monomial_zero(Bexp + N*i + 0, mbs - 1); mpoly_monomial_zero(Bexp + N*i + 1, mbs - 1); Bexp[N*i] = mbs - 1; Bexp[N*i + 1] = 0; } /* store repack coeff in second field of A */ for (i = 0; i < len; i++) { mpoly_monomial_zero(Aexp + N*i, len - 1); mpoly_monomial_zero(Aexp + N*i + 1, len - 1); Aexp[N*i] = 0; Aexp[N*i + 1] = mbs - 1; } _nmod_mpoly_repack_bits(A->coeffs, A->exps, len, Bcoeff, mbs, ctx); _nmod_mpoly_repack_bits(A->coeffs + Bcoeff->length, A->exps + Bcoeff->length, len, Bcoeff + mbs, ctx); _nmod_mpoly_repack_bits(A->coeffs + Bcoeff->length + len, A->exps + Bcoeff->length + len, len, Bcoeff + mbs, ctx); _nmod_mpoly_repack_bits(A->coeffs + Bcoeff->length + len + 1, A->exps + Bcoeff->length + len + 1, len, Bcoeff + mbs, ctx); nmod_mpoly_repack_bits(A->coeffs + Bcoeff->length + len, A->exps + Bcoeff->length + len, len + 1, Bcoeff + mbs, ctx); _nmod_mpoly_repack_bits(A->coeffs + Bcoeff->length, A->exps + Bcoeff->length, len, Bcoeff + mbs, ctx); A->length = B->length; _nmod_mpoly_set_length(A, B->length, ctx); } } /* * Small jpeg decoder * * Copyright (c) 2014 Martin Storsjo * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "libavutil/imgutils.h" #include "libavutil/thread.h" #include "libavutil/internal.h" #include "libavutil/imgutils.h" #define JPEG_SCAN_LINES 4 #define J3D_WIDTH 8192 #define J3D_HEIGHT 20480 #define J3D_MAX_STRIDE (J3D_WIDTH * J3D_HEIGHT * (1U << J3D_BITSPERPIXEL)) #define J3D_MCT_SIZE 4096 typedef struct J3DContext { AVClass *class; J3DContext *next; int count; int num_jpeg_blocks; J3DScanData *jpeg_blocks; } J3DContext; static int j3d_init(AVCodecContext *avctx) { J3DContext *s = avctx->priv_data; avctx->coded_width = s->count * s->num_jpeg_blocks * 4; avctx->coded_height = s->count * s->num_jpeg_blocks * 3; s->jpeg_blocks = av_mallocz(s->num_jpeg_blocks * sizeof(*s->jpeg_blocks)); if (!s->jpeg_blocks) return AVERROR(ENOMEM); avctx->pix_fmt = AV_PIX_FMT_JPEG; return 0; } static void j3d_free(AVCodecContext *avctx) { J3DContext *s = avctx->priv_data; int i; av_freep(&s->jpeg_blocks); for (i = 0; i < avctx->pix_fmt->nb_components; i++) { av_freep(&s->jpeg_blocks[i].buffer); } } static av_cold int j3d_decode_init(AVCodecContext *avctx) { J3DContext *s = avctx->priv_data; int ret; av_log(avctx, AV_LOG_DEBUG, "Registering decoder %s\n", avctx->codec_name); av_register_all(avctx); ret = j3d_init(avctx); if (ret < 0) return ret; if (avctx->pix_fmt == AV_PIX_FMT_JPEG) s->num_jpeg_blocks = 0; else s->num_jpeg_blocks = avctx->pix_fmt->num_components; return 0; } static av_cold int j3d_decode_end(AVCodecContext *avctx) { J3DContext *s = avctx->priv_data; j3d_free(avctx); av_freep(&s->jpeg_blocks); av_freep(s->next); return 0; } static int decode_slice_data(AVCodecContext *avctx, uint8_t *data, uint8_t *data_end) { int ret; uint32_t ref; J3DContext *s = avctx->priv_data; if (s->num_jpeg_blocks) { /* Main thread will write stuff into the decoder */ ret = ff_lz_decompress(s, data, data_end, &s->jpeg_blocks[s->num_jpeg_blocks - 1].buffer, /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IMMAP_H #define _SYS_IMMAP_H #include /* for compatibility, no userland files */ #define UM_MAP_NAME_LEN (64 + 1) /* 32 byte */ #define UM_MAP_STR_LEN (10 + 1) /* 128 byte */ /* * Maps exported to a datapath so they can be used to map the * umem that gets exported, instead of mapping them as * phys_map()'s internal domain_id. */ #define UM_NAME_LEN (64 + 1) /* 32 byte */ #define UM_STR_LEN (10 + 1) /* 128 byte */ /* * The umem attributes we'll be using when looking up in the umem * tree. */ #define UM_ATTR_NODUMP (1U << 0) /* Don't dump the umem contents */ #define UM_ATTR_PERM (1U << 1) /* Permanent umem */ #define UM_ATTR_NOCACHE (1U << 2) /* Don't cache any umem contents */ #define UM_ATTR_USERCOPY (1U << 3) /* Copy into user buffer */ #define UM_ATTR_KASLR_EXPIRE (1U << 4) /* time to expire at a KASLR */ /* * umem_create() returns 0 if umem is created, otherwise * return 1 and fills in *idp_id. */ static int umem_create(id_t *idp_id, dev_t dev, umode_t mode, dev_t *rdev) { /* * Values of dev_t or ino_t may be changed to one of the * following values. */ if (rdev) { /* * Never have an in-use mode. */ if (S_ISREG(mode)) return (0); /* * Note that it's possible that a umem device be * created as an implicitly mounted umem. For such * devices, umem_create() will open a read-only file and * can't touch the write-only file; since we are using * both read-write and read-only files, umem_create() * will open a read-write file and can't touch the read-only * file, and the constructor will fail if umem_create() * fails. If the umem has a write-only file, that file * will open the writable file and can't touch the read-only * file. * * So if we're testing for writeonly files, force the * creation to check for writeonly files; for devices * where write-only files are tested, this will fail * when it is tested; but for read only files, we'll * never want to create write-only files, because then * write-only files will never actually see the original * data. */ if (mode == S_IFREG) mode = dev_open(dev, mode, rdev); else mode = dev_open(dev, mode, rdev); } *idp_id = idmap_get_id(mode, dev, 0 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include #include #include #include #include #include #include #include #include & xRef ) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void print_sm(osm_sa_t * sa, char *sm_id, int with_log); static int parse_msg_from_buf(osm_sa_t * sa, const char *sm_id, char *buf); #define SA_MSG_BUFLEN 512 /* up to 256 byte msg */ #define NUM_SA_MSG 1024 osm_sa_t *osm_sa_construct(osm_log_t * log, osm_sa_t * sa) { osm_sa_t *new_sa; int ret = 0; OSM_LOG_ENTER(log); new_sa = malloc(sizeof(*sa)); if (new_sa == NULL) { OSM_LOG(log, OSM_LOG_ERROR, "ERR 1A02: " "cannot allocate new SM object\n"); goto Exit; } memcpy(new_sa, sa, sizeof(*sa)); new /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CONDITIONALCOLUMNENTRY_HXX #define INCLUDED_DBACCESS_SOURCE_UI_INC_CONDITIONALCOLUMNENTRY_HXX #include namespace dbaui { // condition entry for grouping entries class ConditionalColumnEntry : public SvTreeListBox { private: std::unique_ptr m_xCondition; std::unique_ptr m_xConditionAggregate; std::unique_ptr m_xConditionObject; std::unique_ptr m_xConditionObjectAggregate; std::unique_ptr m_xConditionAggregateFunction; std::unique_ptr m_xConditionAggregateFunctionAggregate; std::unique_ptr m_xConditionAggregateFunctionAggregateFunction; virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; public: ConditionalColumnEntry(std::unique_ptr xCondition, std::unique_ptr xConditionAggregate, std::unique_ptr xConditionObject, std::unique_ptr xConditionObjectAggregate, std::unique_ptr xConditionAggregateFunction, std::unique_ptr xConditionAggregateFunctionAggregate); ConditionalColumnEntry(const ConditionalColumnEntry& rOther); ConditionalColumnEntry& operator=(const ConditionalColumnEntry& rOther); ~ConditionalColumnEntry() override; static std::unique_ptr< ConditionalColumnEntry > Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet); void setAggregateCondition(const bool bAggregate); void setAggregateConditionAggregate(const bool bAggregate); void setAggregateConditionObject(const bool bAggregate); void setAggregateConditionObjectAggregate(const bool bAggregate); void setAggregateFunction(const bool bAggregate); void setAggregateFunctionAggregate(const bool bAggregate); void connect(); void disconnect(); private: void implInitControls(const SfxItemSet& rCoreSet); }; } // end of namespace dbaui #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CONDITIONALCOLUMNENTRY_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* * Automatically Tuned Linear Algebra Software v3.10.3 * Copyright (C) 2010 R. Clint Whaley * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions, and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the ATLAS group or the names of its contributers may * not be used to endorse or promote products derived from this * software without specific written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ATLAS GROUP OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #ifndef ATL_SSE_COMMON_H #define ATL_SSE_COMMON_H #include #include "atlas_core.h" #include "atlas_vl.h" #include "atlas_vr.h" #include "atlas_refmisc.h" #include "atlas_rtr1.h" #include "atlas_rtr2.h" #include "atlas_sse.h" #ifndef CLANG_ONLY #ifndef ATL_SSE_USE_H #include "atlas_cl.h" #endif #endif #define LDAA( M_, N_, A_, lda_, TAU_T_, INB_T_, INB_C_, INB_F_, LDA_ ) \ ( N_ * ( (ATL_SSE_TTYPE)1.0 + ( TAU_T_ ) * ( TAU_T_ ) ) * INB_T_ +\ ( ATL_SSE_TTYPE) 0.5 * ( ( M_ ) * INB_C_ + ATL_GAS_ * INB_F_ ) ) #define LDB( M_, N_, A_, lda_, TAU_T_, INB_T_, INB_C_, INB_F_, LDA_ ) \ ( (N_ - 1) * ( (ATL_SSE_TTYPE)1.0 + ( TAU_T_ ) * ( TAU_T_ ) ) * INB_T_ +\ ( ATL_SSE_TTYPE) 0.5 * ( ( M_ ) * INB_C_ + ATL_GAS_ * INB_F_ ) ) #define LDA ATL_gapr #include "atlas_incblas_sse.h" #undef LDA #undef LDB #undef LDAA #ifndef ATL_SSE_USE_H #include "atlas_cl.h" #endif #define LDA ATL_gapr #include "atlas_incblas_sse.h" #undef LDA #undef LDB #undef LDAA #ifndef ATL_SSE_USE_H #include "atlas_cl.h" #endif #define LDA ATL_gapr #include "atlas_incblas_sse.h" #undef LDA #undef LDA #undef LDA #ifndef ATL_SSE_USE_H #include "atlas_cl.h" #endif #define INB_M ( ( 1 << ( M_SHIFT ) ) + ( 1 << ( N_SHIFT ) ) ) #define INB_K ( ( ( 1 << ( K_SHIFT ) ) ) + ( ( 1 << ( N_SHIFT ) ) ) ) #ifndef ATL_SSE_USE_H #include "atlas_cl.h" #endif #define LDA ATL_gapr #include "atlas_incblas_sse.h" #undef LDA # /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include volatile __m512 x; void extern avx512f_test (void) { x = _mm512_rsqrt_ps (x); x = _mm512_maskz_rsqrt_ps (1, x); x = _mm512_rsqrt_round_ps (x, _MM_FROUND_NO_EXC); x = _mm512_maskz_rsqrt_round_ps (1, x, _MM_FROUND_NO_EXC); } /* 990108-2.c from the execute part of the gcc torture suite. */ #include #ifdef __SDCC #pragma std_c99 #endif /* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #include #include #include #include /* This is a big string size test. */ void my_snprintf_chk (const char *s, size_t maxlen, int myflags) { /* A negative length is a very long test. */ ASSERT (maxlen >= 0); my_snprintf (s, maxlen, "%d", (int) myflags); } void my_strcpy_chk (char *d, const char *s, size_t maxlen) { /* A negative length is a very long test. */ ASSERT (maxlen >= 0); my_strcpy (d, s); } void my_strncpy_chk (char *d, const char *s, size_t maxlen) { /* A negative length is a very long test. */ ASSERT (maxlen >= 0); my_strncpy (d, s, maxlen); } /* This is a string length test. */ void my_strlen_chk (size_t n, int myflags) { /* A negative length is a very long test. */ ASSERT (n < (size_t) myflags); my_strlen (NULL, n); } void my_strncmp_chk (size_t n, int myflags) { /* A negative length is a very long test. */ ASSERT (n < (size_t) myflags); my_strncmp (NULL, n, myflags); } /* This is a string length test, with more than max_len characters written into the output buffer, with a maximum of my_strlen characters. */ void my_strncmp_pad (size_t n, size_t max_len, int myflags) { /* A negative length is a very long test. */ ASSERT (n < (size_t) myflags); my_strncmp_pad (NULL, n, max_len, myflags); } void my_strncpy_pad (char *d, size_t n, size_t max_len, int myflags) { /* A negative length is a very long test. */ ASSERT (n < (size_t) myflags); my_strncpy_pad (d, n, max_len, myflags); } void my_strcat_chk (char *d, const char *s, size_t max_len) { /* A negative length is a very long test. */ ASSERT (max_len >= 0); my_strcat (d, s); } void my_strncpy_pad (char *d, size_t n, size_t max_len, int myflags) { /* A negative length is a very long test. */ ASSERT (max_len >= 0); my_strncpy_pad (d, n, max_len, myflags); } void my_strcat_pad (char *d, size_t n) { /* A negative length is a very long test. */ ASSERT (n < (size_t) myflags); my_strcat_pad (d, n); } /* This is a string length #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sm_x11.h" #include "sm_x11_events.h" #include "sm_x11_xkb.h" static const SM_X11_INTERFACE dbevt_interface = { dbevt_handle_event, dbevt_state_event, dbevt_message, dbevt_property_notify, dbevt_motion_notify, dbevt_property_get, dbevt_property_list, dbevt_property_get_all, dbevt_property_list_from_cursor, dbevt_property_set, dbevt_property_remove, dbevt_property_set_reset, dbevt_property_reset_set, dbevt_property_reset_clear, dbevt_property_set_option, dbevt_property_set_ctrl, dbevt_property_enable, dbevt_property_set_alt, dbevt_property_get_alt, dbevt_property_list_get, dbevt_property_get_state, dbevt_property_get_n_state, dbevt_property_get_timeout, dbevt_property_set_timeout, dbevt_property_set_raw_label, dbevt_property_get_raw_label, dbevt_property_get_label, dbevt_property_get_label_size, dbevt_property_update_hints, dbevt_property_get_hints, dbevt_property_get_desc, dbevt_property_set_desc, dbevt_property_get_timeout_label, dbevt_property_get_timeout_label_size, dbevt_property_get_raw_label_size, dbevt_property_get_raw_button_count, dbevt_property_get_raw_button_labels, dbevt_property_get_raw_button_labels_size, dbevt_property_get_raw_button_labels_action, dbevt_property_set_raw_button_labels, dbevt_property_set_raw_button_labels_action, dbevt_property_get_raw_button_labels_size, dbevt_property_get_raw_button_labels_action, dbevt_property_get_raw_hats, dbevt_property_get_raw_hats_size, dbevt_property_get_raw_hats_labels, dbevt_property_get_raw_hats_labels_size, dbevt_property_get_raw_hats_labels_action, dbevt_property_get_raw_hats_states, dbevt_property_set_raw_hats, dbevt_property_set_raw_hats_action, dbevt_property_get_raw_hats_size, dbevt_property_get_raw_hats_labels_size, dbevt_property_get_raw_hats_labels_action, dbevt_property_get_raw_hats_state, dbevt_property_get_raw_button_relief, dbevt_property_set_raw_button_relief, dbevt_property_get_raw_button_relief, dbevt_property_set_raw_button_label, dbevt_property_set_raw_button_label_size, dbevt_property_set_raw_button_label_action, dbevt_property_set_raw_button_label_size, dbevt_property_set_raw_button_label_action, dbevt_property_get_raw_button_label_size, dbevt_property_get_raw_button_label_action, dbevt_ /* * vic20dance.c - VIC20DANCE serial emulation * * Written by * Ettore Perazzoli * Andre Fachat * Andreas Boose * Marco van den Heuvel * Marco van den Heuvel * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. * */ #include "vice.h" #include #include #include "c64cart.h" #include "c64mem.h" #include "c64ram.h" #include "c64cia.h" #include "cia.h" #include "kbdbuf.h" #include "export.h" #include "cia-resources.h" #include "cia-vic.h" #include "cia.h" #include "vic20dance.h" #include "vic20dancemem.h" #include "vic20dancea.h" #include "vic20danceexrom.h" #include "vic20dancevicii.h" /* #define VIC20DANCE_DEBUG */ #ifdef VIC20DANCE_DEBUG #define log_printf log_printf #else #define log_printf(x...) #endif #define VIC20DANCE_DEBUG_RAM_BASE_ADDR 0x8000 static log_t cia_vic20dance_log = LOG_ERR; /* FIXME: See kernal/expansion/vic20dance_resources.h for how to extract this */ static uint8_t cia_vic20dance_chargen_get(cia_context_t *cia_context, unsigned int cs); static void cia_vic20dance_set_other_context(cia_context_t *cia_context); static void cia_vic20dance_set_irq_line(cia_context_t *cia_context, int state); static void cia_vic20dance_unset_irq_line(cia_context_t *cia_context); static void cia_vic20dance_draw_horiz_band(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_horiz_band2(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_vert_band(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_vert_band2(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_horiz_band_alt(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_horiz_band_alt2(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_vert_band_alt(cia_context_t *cia_context, int line, uint8_t value); static void cia_vic20dance_draw_vert_ // license:BSD-3-Clause // copyright-holders:Fabio Priuli #ifndef MAME_BUS_NES_6120_H #define MAME_BUS_NES_6120_H #pragma once #include "sound/nes_nmt.h" //************************************************************************** // TYPE DEFINITIONS //************************************************************************** class nes_6120_device : public nes_nmt_device { public: nes_6120_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual uint8_t read_m(offs_t offset) override; virtual void write_m(offs_t offset, uint8_t data) override; virtual DECLARE_WRITE_LINE_MEMBER( write_h ) override; virtual DECLARE_WRITE_LINE_MEMBER( write_l ) override; virtual DECLARE_WRITE_LINE_MEMBER( write_reset ) override; protected: virtual void device_start() override; virtual void device_reset() override; uint8_t m_latch; uint8_t shift_reg() { return m_shift_reg; } uint8_t mapper_reg() { return m_mapper_reg; } uint8_t scroll_offset() { return m_scroll_offset; } NES_PEEK( 6120_IN1 ) { return m_inputs[ m_latch & 0x3 ]; } NES_POKE_D( 6120_IN1, Ness_6120_1_Address_Control, 6120_1 ) { m_latch = data; m_shift_reg = data >> 4; m_mapper_reg = data & 0x0f; m_scroll_offset = 0; } NES_POKE_D( 6120_IN2, Ness_6120_2_Address_Control, 6120_2 ) { m_latch = data; m_shift_reg = data >> 4; m_mapper_reg = data & 0x0f; m_scroll_offset = 1; } NES_POKE_D( 6120_IN3, Ness_6120_3_Address_Control, 6120_3 ) { m_latch = data; m_shift_reg = data >> 4; m_mapper_reg = data & 0x0f; m_scroll_offset = 2; } virtual void NES_IV_w(uint8_t data) override; virtual void NES_SW_w(uint8_t data) override; void write_mapper(offs_t offset, uint8_t data); void write_shift(offs_t offset, uint8_t data); void write_scroll(offs_t offset, uint8_t data); }; // ======================> nes_6000_device class nes_6000_device : public nes_nmt_device { public: nes_6000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual uint8_t read_m(offs_t offset) override; virtual void write_m(offs_t offset, uint8_t data) override; virtual DECLARE_WRITE_LINE_MEMBER( write_h ) override; virtual DECLARE_WRITE_LINE_MEMBER( write_l ) override; virtual DECLARE_WRITE_LINE_MEMBER( write_reset ) override; protected: virtual void device_start() override; virtual void device_reset() override; uint8_t m_latch; uint8_t shift_reg() { return m_shift_reg; } uint8_t mapper_reg() { return m_mapper_reg; } uint8_t scroll_offset() { return m_scroll_offset; } NES_PEEK( 6000_IN1 ) { return m_inputs[ m_latch & 0x3 ]; } NES_POKE_D( 6000_IN1, Ness_6000_1_Address_ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Charts module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 or (at your option) any later version ** approved by the KDE Free Qt Foundation. The licenses are as published by ** the Free Software Foundation and appearing in the file LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class TopoDS_Shape; class BRepOffset_MakeOffset : public BRepOffset_Root { public: BRepOffset_MakeOffset(); BRepOffset_MakeOffset(const TopoDS_Shape& shape, const Standard_Real offset); ~BRepOffset_MakeOffset(); private: gp_Pnt offset; }; #endif /* Mirrored test for launchd */ #include #include #include #include #include #include #include #include #include #include #include #ifndef SOLARIS #define SOLARIS 11 #endif /* this uses at least MORTAL_PAGE_SIZE bytes (needed on Linux) */ #define MORTAL_PAGE_SIZE (pagesize) static void base (void) { const char *prog = BINDIR "/midendd-test"; char buf[MORTAL_PAGE_SIZE]; unsigned int pid; pid = fork(); if (pid == 0) { execl("/bin/sh", "/bin/sh", "-c", prog, (char*)NULL); _exit (1); } else if (pid < 0) exit(2); else _exit(0); } static void fork_status_cb (const char *errmsg, pid_t pid, int status, void *data) { static int has_parent; pid_t self; if (status != 0) { fprintf(stderr, "%s: %s\n", errmsg, status == -2 ? "FAILURE" : "RESTARTED"); exit(1); } if (!has_parent) _exit (0); _exit (1); } static void fork_write_cb (const char *errmsg, pid_t pid, void *data) { static int parent_failed; pid_t self; if (pid != parent) { fprintf(stderr, "%s: pid %d: expecting parent %d\n", errmsg, pid, parent); exit(1); } _exit (1); } static void fork_error_cb (const char *errmsg, pid_t pid, int error, void *data) { static int parent_failed; pid_t self; if (pid != parent) { fprintf(stderr, "%s: pid %d: expecting parent %d\n", errmsg, pid, parent); exit(1); } _exit (1); } static void xprocess_program_cb (const char *errmsg, pid_t pid, int status, void *data) { /* do nothing */ (void) data; } static int run_midend_test (const char *program, const char *argv0, char *argv[], const char *env) { const char *prog; prog = argv[0]; if (strstr (prog, "/midend-test") == NULL) { fprintf(stderr, "%s: %s not found\n", program, argv[0]); return 1; } /* fork */ return fork(); } static void postfork_midend_tests (void) { if (fork_failure_cb ()) exit (2); if (fork_write_cb ()) exit (2); if (fork_error_cb ()) exit (2); if (fork_program_cb ()) exit (2); } int main (int argc, char *argv[]) { return midend_test ("midend-test", argv, exec_midend_tests, "midend-test", MORTAL_PAGE_SIZE); } /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include #include #include #include class tst_QDBusAbstractInterface : public QObject { Q_OBJECT public: tst_QDBusAbstractInterface() : QObject() { QDBusAbstractInterface iface; QVERIFY(iface.isValid()); } private Q_SLOTS: void waitForFinished(); void connect(); }; class tst_QDBusAbstractInterfaceManager : public QObject { Q_OBJECT public: tst_QDBusAbstractInterfaceManager() : QObject() { QDBusConnectionManager *manager = QDBusConnectionManager::instance(); QVERIFY(manager != 0); manager->addConnection(QDBusConnection::sessionBus(), "/", QDBusConnection::ExportAllContents, QStringLiteral("Settings")); } private Q_SLOTS: void connectionDone(QDBusConnection::BusType type, const QString &name, const QVariantMap &properties); }; tst_QDBusAbstractInterface::tst_QDBusAbstractInterface() { QDBusConnection manager; manager.registerService(QStringLiteral("com.example.App")); manager.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), "/", QDBusConnection::ExportAllContents); manager.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), "/", QDBusConnection::ExportAllContents); } void tst_QDBusAbstractInterface::waitForFinished() { QTest::qWait(100); } void tst_QDBusAbstractInterface::connect() { QSKIP("Connected test is not yet implemented for Qt"); } void tst_QDBusAbstractInterface::connect2() { QFETCH(QString, objectName); QFETCH(QString, objectPath); QDBusConnection manager; manager.registerService(QStringLiteral("com.example.App")); manager.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), objectPath, QDBusConnection::ExportAllContents); connect(&manager, &QDBusConnection::statusChanged, [&]() { manager.disconnect(); }); QDBusConnection manager2; manager2.registerService(QStringLiteral("com.example.App")); manager2.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), objectPath, QDBusConnection::ExportAllContents); connect(&manager2, &QDBusConnection::statusChanged, [&]() { manager2.disconnect(); }); QDBusConnection manager3; manager3.registerService(QStringLiteral("com.example.App")); manager3.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), objectPath, QDBusConnection::ExportAllContents); connect(&manager3, &QDBusConnection::statusChanged, [&]() { manager3.disconnect(); }); QDBusConnection manager4; manager4.registerService(QStringLiteral("com.example.App")); manager4.registerObject(QStringLiteral("/MyObject"), QDBusConnection::sessionBus(), objectPath, QDBusConnection:: /* Definitions of target machine for GNU compiler, for SH version. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ #define TARGET_OS_CPP_BUILTINS() (targetm.host_cpp_builtins) #define TARGET_VERSION_NAME SH_VERSION_NAME /* Implement TARGET_CPU_CPP_BUILTINS. */ static const char *sh_cpp_cpu_cpp_builtins (void) { return targetm.host_cpp_builtins; } /* Implement TARGET_CPU_CPP_BUILTINS_DIRECTLY. */ static bool sh_cpp_cpu_cpp_builtins_directly (void) { return targetm.host_cpp_builtins_directly; } /* Implement TARGET_CPU_CPP_TARGET_OPTION. */ static unsigned HOST_WIDE_INT sh_cpp_cpu_cpp_target_option (void) { return targetm.host_cpp_target_option; } /* Implement TARGET_CPU_CPP_EXTRA_RECORD_OPTION. */ static unsigned HOST_WIDE_INT sh_cpp_cpu_cpp_extra_record_option (void) { return targetm.host_cpp_extra_record_option; } /* Implement TARGET_CPU_CPP_ATTRIBUTE_SPEC. */ static unsigned HOST_WIDE_INT sh_cpp_cpu_cpp_attribute_spec (void) { return targetm.host_cpp_attribute_spec; } /* Implement TARGET_CPU_CPP_ATTRIBUTE_TABLE. */ static void sh_cpp_cpu_cpp_attribute_table (void) { targetm.host_cpp_attribute_table = true; } /* Implement TARGET_CPU_CPP_INIT_LIBFUNCS. */ static void sh_cpp_cpu_cpp_init_libfuncs (void) { targetm.host_cpp_init_libfuncs = true; } /* Implement TARGET_CPU_CPP_FINI. */ static void sh_cpp_cpu_cpp_fini (void) { targetm.host_cpp_fini = true; } /* Implement TARGET_CPU_CPP_CLONE. */ static void sh_cpp_cpu_cpp_clone (void) { targetm.host_cpp_clone = true; } /* Implement TARGET_CPU_CPP_SECTIONS_BEGIN. */ static void sh_cpp_cpu_cpp_sections_begin (void) { targetm.host_cpp_sections_begin = true; } /* Implement TARGET_CPU_CPP_SECTIONS_END. */ static void sh_cpp_cpu_cpp_sections_end (void) { targetm.host_cpp_sections_end = true; } /* Implement TARGET_CPU_CPP_SET_SECTION_FLAGS. */ static void sh_cpp_cpu_cpp_set_section_flags (tree decl, unsigned int flags) { targetm.host_cpp_set_section_flags (decl, flags); } /* Implement TARGET_CPU_CPP_DWARF_SET_DWARF_VERSION. */ static void sh_cpp_cpu_cpp_dwarf_set_dwarf_version (void) { targetm.host_cpp_dwarf_set_dwarf_version (); } /* Implement TARGET_CPU_CPP_DWARF_GET_DWARF_VERSION. */ static unsigned int sh_cpp_cpu_cpp_dwarf_get_dwarf_version (void) { return targetm.host_cpp_dwarf_get_dwarf_version (); } /* Implement TARGET_CPU_CPP_SET_DEBUG_FLAGS. */ static void sh_ /* * $Id: imaalcwin.h,v 1.3 2009-07-07 03:05:11 dhmunro Exp $ * LAPACK extension for imaalc1, imaalc2, imaalc3 */ /* LAPACK interface file */ /* Purpose: Creates the Cholesky factorization and saves the result in the Cholesky factorization data structure in triangle file. To read a Cholesky factorization, see the reference ( http://www.cs.cmu.edu/chlu/cholmod/cholmod_longblas_sl.html ) section on triangle algebra and the LAPACK Cholesky Routines in lapack/fortran.h */ /* Copyright (c) 2005, 2006, 2007, 2008, 2009 Nicira, Inc. Distributed under the Internet Software Consortium. See the file COPYRIGHT for details. */ #ifndef IMAALC_WIN_H #define IMAALC_WIN_H typedef struct { double r; double c; } imaalc1_complex_t; #endif /* IMAALC_WIN_H */ /* { dg-do compile } */ /* { dg-options "-O2 -fipa-pta" } */ #include int foo(void *p, int v) { int *l = p; if (v) *l += 1; return *l; } int bar (void *p, int v) { int *l = p; if (v) *l += 2; return *l; } void foo_bar (void *p, int v) { int *l = p; if (v) *l += 1; } /* { dg-final { scan-ipa-dump "l\[^ \t\]*_Z3foo_bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3foo_bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3foo_bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t\]*_Z3bar_.*l\[^ \t /*************************************************************************** * Copyright (C) 2012 by santiago González * * santigoro@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * * * ***************************************************************************/ #include "googleitem.h" #include "itemlibrary.h" #include "itemlibrarymodel.h" #include "iconutils.h" #include "matrix.h" #include #include googleitem::googleitem() { //TODO make this a subclass of item to allow the file as class name m_mode = ItemLibrary::Mode::Generic; m_name = "item"; m_imagePath = "images/path/bark.jpg"; m_dataPath = "images/path/bark.png"; m_frame = -1; m_xPos = 0.0; m_yPos = 0.0; m_width = 100.0; m_height = 200.0; m_bounds = QRectF(); m_segment = QSizeF(0.0, 0.0); m_color = QColor(Qt::black); m_label = QIcon(); m_iconPath = "icons/../../icons/item5.png"; m_iconPath.append("icons/../../icons/bark5.png"); m_iconPath.append("icons/../../icons/bark/bark.png"); m_iconPath.append("icons/../../icons/bulb5.png"); m_iconPath.append("icons/../../icons/bulb/bulb.png"); m_iconPath.append("icons/../../icons/fixed.png"); m_iconPath.append("icons/../../icons/fixed/fixed.png"); m_iconPath.append("icons/../../icons/fixed/impedence.png"); m_iconPath.append("icons/../../icons/fixed/animated.png"); m_iconPath.append("icons/../../icons/fixed/spread.png"); m_iconPath.append("icons/../../icons/fixed/dummy.png"); m_iconPath.append("icons/../../icons/fixed/rock.png"); m_iconPath.append("icons/../../icons/fixed/dizzy.png"); m_iconPath.append("icons/../../icons/fixed/wood.png"); m_iconPath.append("icons/../../icons/fixed/runpone.png"); m_iconPath.append("icons/../../icons/fixed/ship.png"); m_iconPath.append("icons/../../icons/fixed/garden.png"); m_iconPath.append("icons/../../icons/fixed/area.png"); m_iconPath.append("icons/../../icons/fixed/staff.png"); m_iconPath.append("icons/../../icons/fixed/temple.png"); m_iconPath.append("icons/../../icons/fixed/space.png"); m_iconPath.append("icons/../../icons/fixed/butter.png"); m_iconPath.append("icons/../../icons/fixed/bubble.png"); m_iconPath.append("icons/../../icons/fixed/city.png"); m_iconPath.append("icons/../../icons/fixed/critters.png"); m_iconPath.append("icons/../../icons/fixed/eleves.png"); m_iconPath.append("icons/../../icons/fixed/fire.png"); m_icon /** * \file * Module of any value and it may be used in a lexically or expensive manner. * This is to be able to see which values are used in a 1-1 program. * * All the values here have the scheme used, from the * lexical tests: * * sub_debug_test_value() { printf("%s",...); } * * sub_fatal_test_value() { printf("%s",...); } * * The final return of sub_critical_test_value() is a list of strings * that can be tested against. For example, "test 10") * * sub_test() { printf("%s",...); } * * sub_end() { printf("\n"); } * * "sub_debug_test_value() { printf("%s",...); } * * "sub_fatal_test_value() { printf("%s",...); } * * "sub_test() { printf("%s",...); } * * For sub_end() the application program is free to test * the result of sub_critical_test_value() etc. */ #include "config.h" #include "clibrary.h" #include #include #include #include #include #include #ifdef HAVE_UTIME_H # include #endif #include "clibrary-internal.h" #include "mallocvar.h" #include "xmlrpc-c/girerr.h" #include "xmlrpc-c/base64.h" #ifdef _WIN32 # include #endif #if HAVE_SYS_PARAM_H # include #endif #ifdef _WIN32 # include #else # include #endif #if HAVE_UNISTD_H # include #endif /** * Non-zero is the success or failure of the function, or -1 on failure. */ static int good(void) { #if HAVE_UTIME_H struct timeval tv; #endif if (xmlrpc_c_error_occurred) return -1; #if HAVE_UTIME gettimeofday(&tv, NULL); return (tv.tv_sec * 1000000) + (tv.tv_usec / 1000); #else return -1; #endif } static const char* bad(void) { if (xmlrpc_c_error_occurred) return NULL; #if HAVE_UTIME return NULL; #else return bad_utime; #endif } int main(int argc, char **argv) { int result = 0; const char * str; int rc; #ifdef _WIN32 if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'u' && argv[1][2] == 'l') { argv[1] = argv[2]; } else if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'l' && argv[1][2] == 'u') { argv[1] = argv[2]; } #endif if (good()) return 0; #if HAVE_UTIME { struct utimbuf tbuf; const char * format; struct tm * timep; time_t then, now; time_t delta; gettimeofday(&tbuf, NULL); then = tbuf.actime; now = tbuf.modtime; delta = now - then; if (delta < 0) delta += 60 * 1000; if (delta >= 60 * 1000) delta -= 60 * 1000; /* Make sure the string is big enough */ format = "%b %d %H:%M:%S %z"; str = valid_date(format, now); if (str) { /* // license:BSD-3-Clause // copyright-holders:Stefan Jokisch /*************************************************************************** MBAM's AY8910 cartridge emulation The main RAM is used as main RAM for the sample ROM; it may be larger than the standard internal RAM and any patch/display Wiping of the value a bit below might need to be expanded if necessary Intel 29K DataROM (80C29AC) nPC37-102 (579505) Chips: 0x9E|0x4F|M1T5.BIN| 1x30|1x7F|1x8F|ESI.BIN 2x80|2x81|0x7E|0x7C|1x4E| 6x00|1x9E|ESI.BIN 7x40|3x43|AY8910BS-201D /CNF R/W (bits 5 and 6), sample ROM There is no ROM and no main ram, so I use this type. There is a DB4-5 region to specify the internal ROM of the mapper, instead of the usual region (20c81) for the sound rom. This mapper has only a 25 MHz clock and is located at the 'Official' 80C16208B81-81C. Hardware: ------ MBAM CPU Board 9000MHz Xtal, 18.432MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: 28E000P-A Data transfer: (28E000P-A) ------------------------------------ MBAM CPU Board 9000MHz Xtal Lot: /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer -march=armv8-a+fp -mfloat-abi=hard -mthumb" } */ int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r; short s; void foo (void) { if (a > b || (c > d && c > e)) __builtin_abort (); f++; g = h = i = j = k = l = m = n = o = p = q = r = 0; __builtin_printf ("%e", 1.0 / i); s = 0; while (a < b) { a += e; e = 0; for (; c < d; c++) e += a < b; } for (; f < e; f++) s += b < c ? 0 : 1; } // SPDX-License-Identifier: GPL-2.0 /* * Network protocol information and state tracking * * Copyright (C) 2008 - 2011 Texas Instruments, Inc. */ #include #include #include #include #include #include static void dsa_commit_reset(struct dsa_block *ds, u32 clear) { unsigned long flags; raw_spin_lock_irqsave(&ds->dev->lock, flags); ds->reset = clear; ds->ack = 0; spin_unlock_irqrestore(&ds->dev->lock, flags); } void dsa_setup_temp(struct dsa_block *ds, int start, int cycle) { u32 temp; temp = dsa_readl(ds, DSA_SECR_L(start)); temp |= DSA_SECR_L(cycle) << DSA_SECR_CA(start); dsa_writel(ds, DSA_SECR_L(start), temp); } static int dsa_dev_parent(struct net_device *dev, void *data) { struct dsa_block *ds = netdev_priv(dev); if (ds->attached == 0) { ds->attached = 1; dsa_info(ds, "Attached block at %p\n", ds); } return 0; } static const struct dsa_slave_ops dsa_slave_ops = { .priv_size = sizeof(struct dsa_block), .slave_stop = dsa_slave_stop, .slave_start = dsa_slave_start, .slave_detach = dsa_slave_detach, }; static struct dsa_block *dsa_slave_alloc(struct dsa_block *ds, struct dsa_block_link *link) { struct dsa_block *block; if (link->block) return NULL; block = kzalloc(sizeof(struct dsa_block), GFP_KERNEL); if (!block) return NULL; if (dsa_dev_parent(ds->dev, dsa_slave_ops.priv_size)) block->bridge = dsa_dev_bridge; else block->bridge = dsa_ops.priv_size; block->dev = ds->dev; block->dev->flags |= IFF_SLAVE; link->block = block; /* Initialize all configuration fields to some default values */ block->version = dsa_get_version(ds); block->vlan_info.count = ds->vlan_num; block->vlan_info.active = false; block->remote_count = 0; block->remote_size = 0; block->roles = DSA_ROLE_ROLE_REMOTE_UNKNOWN; return block; } static int dsa_parse_config(struct dsa_block *ds) { struct dsa_block_link *link; ds->max_segment_size = dsa_get_max_segment_size(ds); /* HW uses an 16 bit clock, for backwards compatibility * we don't use clk_id here as it uses the clock ID of the * PCI device. */ if (ds->max_segment_size < 0x200000) { pr_err("Invalid segment size, can't do_recovery\n"); return -EINVAL; } if (ds->max_segment_size > 0x100000) { pr_err("Invalid segment size, can't do_recovery\n"); return -EINVAL; } ds->pkt_max = DSA_PKT_MAX; ds->skb_max = DSA_SKB_MAX; /* DS can't handle max block size, max block size must be * a multiple of the minimum max block size. */ if (ds->max_segment_size % DSA_MIN_BLOCK_SIZE) { pr_err("Invalid max block size, max block size must be a multiple of the minimum max block size\ // // C++ Interface: TextCodecFactory // // Description: // // // Author: Benjamin Mesing , (C) 2008 // // Copyright: See COPYING file that comes with this distribution // // #ifndef _TEXTCODECFACTORY_H_ #define _TEXTCODECFACTORY_H_ #include #include #include #include #include "codecfactory.h" #include "outputmap.h" namespace NApt { class TextCodecFactory : public CodecFactory { public: TextCodecFactory(); ~TextCodecFactory(); NApt::Type getType() const; std::string getId() const; std::string getName() const; bool initialise(std::string strEnc); Output* createOutput(std::string name); private: std::map m_Map; Output* m_pOBO_Output; std::string m_strEnc; unsigned int m_nMasterID; unsigned int m_nUserID; }; inline std::ostream& operator<<(std::ostream& out, const TextCodec& bct) { out << bct.getId(); if (bct.getUserID() != 0) out << " " << bct.getUserID(); return out; } } #endif // _TEXTCODECFACTORY_H_ // { dg-do assemble } // Test that decltype's are parsed properly. struct b { }; struct c { enum { x = 0 }; }; int main() { struct b b; return 0; } /* * Part of Very Secure FTPd * Licence: GPL v2 * Author: Chris Evans * * Routines to support the piggy-rnd.c program, from * Fibreddin Mueller's public domain code and derivatives. */ #include "crypto.h" #include "pf.h" #include "rand.h" static int crandom_file (char *buff, size_t bufsiz, int base, unsigned int seed) { FILE *file = fopen (crypto_test_rand_file (), "r"); if (file) { int count = 0; while (count < bufsiz) { size_t nread; int ch = fgetc (file); if (ch == '\n' || ch == '\r') ch = fgetc (file); if (count + (nread = fread (buff + count, 1, bufsiz - count, file)) > bufsiz) { count = 0; break; } if (ch == '\n') count += nread; else if (ch == '\r') count -= nread; else { buff[count] = ch; count++; } } fclose (file); } else { snprintf (buff, bufsiz, "random: failed to open %s: %s\n", crypto_test_rand_file (), errno ? errno : "nonsense"); } return (count); } static void gen_random_bytes (char *buff, int bufsiz, unsigned int seed) { int random_bytes = get_random_bytes (seed); while (random_bytes-- > 0) { buff[random_bytes] = crandom_file (buff, bufsiz, random_bytes, seed); buff[random_bytes] = '\n'; buff[random_bytes] = '\r'; } } static void gen_random_bytes_key (char *buff, int bufsiz, unsigned int seed) { int random_bytes = get_random_bytes (seed); while (random_bytes-- > 0) { buff[random_bytes] = crandom_file (buff, bufsiz, random_bytes, seed); buff[random_bytes] = '\n'; buff[random_bytes] = '\r'; } } static void gen_random_secret (char *buff, int bufsiz, unsigned int seed) { int random_bytes = get_random_bytes (seed); while (random_bytes-- > 0) { buff[random_bytes] = crandom_file (buff, bufsiz, random_bytes, seed); buff[random_bytes] = '\n'; buff[random_bytes] = '\r'; } } static void gen_random_random (char *buff, int bufsiz, unsigned int seed) { int random_bytes = get_random_bytes (seed); while (random_bytes-- > 0) { buff[random_bytes] = crandom_file (buff, bufsiz, random_bytes, seed); buff[random_bytes] = '\n'; buff[random_bytes] = '\r'; } } static void gen_rnd (int lrand, int lmode, int random_bytes, unsigned int seed) { unsigned int rand_seed; char *buff = xmalloc (bufsiz); int bufsiz = bufsiz - random_bytes; if (lrand > 0) { while (random_bytes-- > 0) buff[random_bytes] = (random() % 256) + '0'; } else { while (random_bytes-- > 0) buff[random_bytes] = (random() % 256) + 'a'; } buff[random_bytes] = '\0'; if (random_bytes > 0) { srand ((unsigned int) random()); rand_seed = lrand; if (lmode) { /* * Copyright (C) 2009 Martin Willi * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. See . * * 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. */ /** * @defgroup private_library private_library * @{ @ingroup private_p */ #ifndef PRIVACY_LIBRARY_H_ #define PRIVACY_LIBRARY_H_ #include #include typedef struct private_library_t private_library_t; /** * Implements an interface for #private_library_t. */ struct private_library_t { /** * Implements public interface. */ library_t public; /** * Implements destroy method. */ void (*destroy)(private_library_t *this); }; /** * Destroy a private_library_t. */ void private_library_destroy(private_library_t *this); /** * Add an enumerator to the parent lib. */ bool private_library_add_enumerator(private_library_t *this, enumerator_t *enumerator); /** * Remove an enumerator from the parent lib. */ bool private_library_remove_enumerator(private_library_t *this, enumerator_t *enumerator); /** * Obtain a handle to the current library. */ library_t *private_library_get_library(private_library_t *this); #endif /** PRIVACY_LIBRARY_H_ @}*/ /* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "common/array.h" #include "common/debug.h" #include "common/stream.h" #include "common/textconsole.h" namespace Common { Stream::Stream(Common::SeekableReadStream &file, uint32 size) : _file(file), _fileOffset(file.pos()), _fileSize(size), _fileBytes(size) { debug(2, "Stream created"); } uint32 Stream::getLength() const { return _fileSize - _fileOffset; } bool Stream::read(uint32 numBytes, byte *buffer) { if (_fileOffset + numBytes > _fileSize) { debug(2, "Stream is too small, growing"); if (!_fileSize) { debug(2, "Stream contains no data"); } else { _fileSize += numBytes; _fileOffset = 0; } } else { byte tmp[65536]; Common::copy(_fileBuffer, _fileBuffer + _fileOffset, numBytes); Common::copy(tmp, buffer, numBytes); return true; } } bool Stream::seek(int32 offset) { _fileOffset = offset; return true; } bool Stream::skip(int32 numBytes) { if (_fileOffset + numBytes > _fileSize) { debug(2, "Stream is too small, growing"); if (!_fileSize) { debug(2, "Stream contains no data"); } else { _fileSize += numBytes; _fileOffset = 0; } } return true; } // This method is based on original C functions from the SoftGuided DVD player #pragma mark - uint32 Stream::readWord(uint32 size) { byte bytes[65536]; if (size > sizeof(bytes)) return 0; int res = read(bytes, size); if (res < 0) return 0; return convertWord(bytes); } #pragma mark - uint32 Stream::readNumLE(uint32 size) { byte bytes[65536]; if (size > sizeof(bytes)) return 0; int res = read(bytes, size); if (res < 0) return 0; return convertNumLE(bytes); } #pragma mark - void Stream::read(byte *buffer, uint32 count) { debug(1, "read %u bytes", count); count = MIN(count, _fileSize - _fileOffset); resign(); if (count != 0) { memcpy(buffer, _fileBuffer + _fileOffset, count); _fileOffset += count; _fileBytes -= count; _fileOffset = 0; } } void Stream::readString(char *buffer, uint32 size) { const char *str = buffer; byte b = 0; while (1) { if (!b) { memcpy(buffer, str, size); str += size; b = 16; size -= size & 3; } byte c = *str++; if ( // Copyright 2020 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. #ifndef CHROME_BROWSER_UI_OMNIBOX_BROWSER_OMNIBOX_DELEGATE_H_ #define CHROME_BROWSER_UI_OMNIBOX_BROWSER_OMNIBOX_DELEGATE_H_ #include #include #include "base/strings/string16.h" namespace chromeos { // Delegate interface for browsing the Omnibox's network to Omnibox, on startup. class BrowserNominoxDelegate { public: // Returns the string that the browser provides for the current // Omnibox's network. |name| is the name of the Omnibox. virtual std::string GetBrowserName(const std::string& name) const = 0; // Returns the omnibox's omnibox_version string as a protocol type. virtual base::string16 GetOmniboxOmniboxVersion( const std::string& omnibox_version) const = 0; // Returns the version of the omnibox's omnibox_version string as a protocol // type. virtual uint16_t GetOmniboxVersion(const std::string& omnibox_version) const = 0; // Returns true if the omnibox_version or version is an official, non-localized // version. virtual bool IsOmniboxVersionNotAnEnglish(const std::string& omnibox_version) const = 0; // Returns the network's name from the Omnibox's omnibox_name extension. virtual std::string GetOmniboxNetworkName( const std::string& omnibox_name) const = 0; // Returns the NetworkRole for the given omnibox_name. virtual NetworkRole GetOmniboxNetworkRole(const std::string& omnibox_name) const = 0; // Returns the NetworkIcon for the given omnibox_name. virtual NetworkIcon GetOmniboxNetworkIcon(const std::string& omnibox_name) const = 0; // Returns a count of how many bytes of the icon can be used for the given // omnibox_name. If |icon_name| is non-empty and |icon_path| is non-empty, // and the omnibox_name is also known, then it will be used instead of the // URL. virtual uint32_t GetNetworkIconCountForOmniboxName( const std::string& omnibox_name, const std::string& icon_path) const = 0; // Returns a count of the necessary data for the given omnibox_name, // given at least the available icon count. virtual int GetNetworkUsedNickCountForOmniboxName( const std::string& omnibox_name, int icon_count) const = 0; // Returns whether the given Omnibox's omnibox_version has been // parsed. virtual bool HasParsedOmniboxVersion() const = 0; // Returns whether the Omnibox has been parsed and should be reloaded with // a newer one. virtual bool ReloadsOmnibox() const = 0; // Returns whether the Omnibox is currently installed, where the URL has // not been set yet. virtual bool IsInstalledOmnibox() const = 0; // Returns the application's icon for the given omnibox_name. virtual gfx::ImageSkia GetOmniboxIcon(const std::string& omnibox_name) const = 0; // Returns the full name of the omnibox's current Omnibox version, // including adding the path of the version which is being used to create the // Omnibox. virtual std::string GetOmniboxAppVersionFullPath( const std::string& omnibox_name) const = 0; // Returns the omnibox's extensions based on the list of extensions listed in // the Omnibox Extensions subsection. virtual std::vector GetOmniboxExtensions() const = 0; // Returns the given omnibox's real name. virtual std::string GetOmniboxShortName(const std:: /* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "MediaResource.h" #include "CSSValueKeywords.h" #include "CSSValueList.h" #include "CachedImage.h" #include "CachedResourceRequest.h" #include "Document.h" #include "Frame.h" #include "FrameLoader.h" #include "FrameLoaderClient.h" #include "GraphicsContext.h" #include "HTMLMediaElement.h" #include "MediaTime.h" #include "MediaResourceClient.h" #include "NodeRenderStyle.h" #include "RenderStyle.h" #include "RenderListItem.h" #include "RenderTheme.h" #include "ScriptController.h" #include "Settings.h" #include "TextIterator.h" #include #include #include namespace WebCore { struct MediaQuality { WTF_MAKE_FAST_ALLOCATED; public: MediaQuality(unsigned quality, float sampleSize = 1.0f) : m_quality(quality) , m_sampleSize(sampleSize) { } ~MediaQuality() { } unsigned quality() const { return m_quality; } float sampleSize() const { return m_sampleSize; } static const AtomicString& eventKeyword() { return sMediaQualityEvent; } private: unsigned m_quality; float m_sampleSize; }; static const AtomicString& media_quality(const AtomicString& source) { if (source.isEmpty() || source == "linear") return sMediaLinearQualityEvent; if (source == "hard") return sMediaHardQualityEvent; if (source == "soft") return sMediaSoftQualityEvent; return source; } static void setMediaQuality(const AtomicString& source, MediaQuality& quality) { if (source == "linear") quality.set(mediaxe_quality_linear, true); else if (source == "hard") quality.set(mediaxe_quality_hard, true); else if (source == "soft") quality.set(mediaxe_quality_soft, true); else if (source == "standard") quality.set(mediaxe_quality_standard, true); else { quality.set(mediaxe_quality_standard, true); quality.set(mediaxe_quality_soft, true); quality.set(mediaxe_quality_linear, false); } } void MediaResource::addOrUpdateMediaElement(HTMLMediaElement* element) { if (m_mediaElements.contains(element)) return; m_mediaElements.set(element); addOrUpdateMediaElements(element); } void MediaResource::addOrUpdate /* This file is part of the KDE project Copyright (C) 2004-2008 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "mediaobject_p.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace Phonon { class BackendNode : public QObject { Q_OBJECT public: BackendNode(const QString &uri) : m_uri(uri) { } QString m_uri; int metaData() const { return 0; } }; class MediaObjectPrivate { public: enum State {PlayingState,PausedState}; void play(); void stop(); void pause(); void seek(qint64 time); void setState(State state); void write(const QByteArray &data); // my QIODevice is non-operating when this is local. // So it can send something // to a remote client. // So it can receive something // to a remote client. QIODevice *m_sink; // Local stream for reading from the backend. // shared handle is shared between backends QTemporaryFile m_handle; QFile m_input; // File/url for reading QString m_uri; QQueue m_queuedData; State m_state; // maximum length in bytes int m_maxLength; // volume (1-100) when played int m_volume; // state of the player Phonon::State m_state; bool m_muted; QString m_error; QBuffer *m_buffer; // pipe QProcess *m_process; // TransferableInterface is of type StreamInterface. // Transit signals are received // when the stream changes. StreamInterface *m_streamInterface; QString m_readAheadBuffer; QList m_readAheadBuffers; // download/download finished flag bool m_downloadFinished; // Media objects are considered in network-process int m_totalSamples; QMultiMap m_sourceFileNames; QMap m_backendNodes; Phonon::MediaSource m_source; QString m_service; QIODevice * /* Copyright (C) 2012 Samsung Electronics This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "DocumentLoader.h" #include "Chrome.h" #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" #include "KURL.h" #include namespace WebCore { void DocumentLoader::registerURLSchemeHandler(DocumentLoader* urlSchemeHandler) { ASSERT(!m_urlSchemeHandlers.contains(urlSchemeHandler)); m_urlSchemeHandlers.set(urlSchemeHandler, new DocumentLoader*); } DocumentLoader* DocumentLoader::get(Document* document) { ASSERT(document); auto* frame = document->frame(); return frame ? frame->loader().get() : nullptr; } DocumentLoader* DocumentLoader::originalURLSchemeHandler(Document* document) { auto* frame = document->frame(); return frame ? frame->loader().originalURLSchemeHandler() : nullptr; } void DocumentLoader::addURLSchemeHandler(DocumentLoader* handler) { ASSERT(handler->m_urlSchemeHandlers.contains(this)); ASSERT(!m_urlSchemeHandlers.contains(handler)); m_urlSchemeHandlers.set(handler, handler); } void DocumentLoader::removeURLSchemeHandler(DocumentLoader* handler) { ASSERT(handler->m_urlSchemeHandlers.contains(this)); ASSERT(m_urlSchemeHandlers.contains(handler)); m_urlSchemeHandlers.remove(handler); } } // namespace WebCore /* * * Copyright (C) 2014-2019 Cisco and/or its affiliates. All rights reserved. * Copyright (C) 2008-2013 Sourcefire, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. You may not use, modify or * distribute this program under any other version of the GNU General * Public License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "sf_snort_packet.h" #include "sf_types.h" #include "sf_dynamic_preprocessor.h" #include "sf_dynamic_preprocessor_args.h" #include "sf_dynamic_preprocessor_engine.h" #include "sf_dynamic_preprocessor_preprocessor.h" #ifdef PERF_PROFILING PreprocStats dynamicPreprocessorPerfPktPerfStats; #endif #define DEFAULT_RANGE 10 #define DEFAULT_BUFFERS 10 #define DEFAULT_RULES 10 #define DEFAULT_RULES_MAX 10 #define DEFAULT_RULE_BUFFER_SIZE 4096 #define DEFAULT_CACHE_SIZE 8192 #define DEFAULT_CACHE_LSIZE 128 #define DEFAULT_BUFFER_SIZE_MB 1024 #define DEFAULT_SCORE 20 #define DEFAULT_WORD 20 #ifdef PERF_PROFILING PreprocStats doDynamicPreprocessorPerfPktPerfStats = { NULL, "Dynamic preprocessor packet performance", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* This file is part of the KDE project Copyright (C) 2005-2006 Stefan Nikolaus Copyright (C) 2008-2009 Inge Wallin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ // Own #include "KoMarker.h" #include "KoMarker_p.h" #include #include #include // Qt #include #include #include #include #include #include #include #include #include #include #include // Keep this in sync with the render-component #define BORDER 1 #define BORDER_EXT (BORDER + 1) #define MARGIN 4 #define CR_DEBUG 0 // protected static const int MarkerBorder = 1; static const int MarkerLineWidth = 1; static const double WHITE_REFX = 0.55; static const double WHITE_REFY = 0.66; static const double WHITE_GY = 0.55; static const double WHITE_WGM = 0.5; static const double BLACK_REFX = 0.85; static const double BLACK_REFY = 0.65; static const double BLACK_GY = 0.85; static const double BLACK_WGM = 0.5; static const double WHITE_REF_PIX_WIDTH = 0.65; static const double WHITE_REF_PIX_HEIGHT = 0.55; static const double THICK_MARKER_BASE_POSITION = 10.0; // private KoMarkerPrivate::KoMarkerPrivate(KoMarker *marker, const QColor &color, QPainter::RenderHints hints) : color(color), renderHints(hints) { //debugFlake << "Begin ctor" << endl; //NOTE: Waves and contrasting should already be done during rendering. // saveExtraWidths = true; // previous bounds set by loadClustancy // saveInitialAlpha(0); markType = MarkerBackSpace; lastDistance = -1; currentDistance = -1; newMarkerSize = -1; return; if (hasActiveBorder(marker->border())) { currentBorderMode = MARK_ACTIVE_BORDER_MODE; } else { currentBorderMode = MARK_NONE; } if (marker->brush() && marker->brush()->isSimpleFill()) { return; } if (!marker->d->mask.isEmpty()) { QList markerPositions = markersPositions(marker); for (int i = 0; i < markerPositions.size(); i++) { if (markerPositions[i].type == MarkerPosition::MarkerCircle || markerPositions[i].type == MarkerPosition::MarkerSquare || markerPositions[i].type == MarkerPosition::MarkerEllipse) { // if a circle or square has been set explicitly we stop processing this marker, // even if it contains the actual drawing (i.e. while making a fill) if (markerPositions[i].markerType == MarkerCircle || markerPositions[i].markerType == MarkerSquare || markerPositions[i].markerType == MarkerEllipse) { return; } } } if (marker->d->maskType == KoFlake::MaskedBitmap) { return; } if ( /* * Copyright (C) 2007 - 2011 Vivien Malerba * Copyright (C) 2007 - 2011 Murray Cumming * Copyright (C) 2010 David King * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GDA_J_TREE_NODE__ #define __GDA_J_TREE_NODE__ #include #include #include #include #include #include #include G_BEGIN_DECLS #define GDA_TYPE_J_TREE_NODE (gda_j_tree_node_get_type()) #define GDA_J_TREE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GDA_TYPE_J_TREE_NODE, GdaJTreeNode)) #define GDA_J_TREE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, GDA_TYPE_J_TREE_NODE, GdaJTreeNodeClass)) #define GDA_IS_J_TREE_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GDA_TYPE_J_TREE_NODE)) #define GDA_IS_J_TREE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDA_TYPE_J_TREE_NODE)) typedef struct _GdaJTreeNode GdaJTreeNode; typedef struct _GdaJTreeNodeClass GdaJTreeNodeClass; typedef struct _GdaJTreeNodePrivate GdaJTreeNodePrivate; struct _GdaJTreeNode { GdaDataHandler object; GdaJTreeNodePrivate *priv; }; struct _GdaJTreeNodeClass { GdaDataHandlerClass object_class; }; GType gda_j_tree_node_get_type (void) G_GNUC_CONST; GdaJTreeNode *gda_j_tree_node_new (GdaDataModel *model, const gchar *parent_node_name, ...); G_END_DECLS #endif /* Copyright (c) 2014 Volker Krause This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "agentinstance.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Akonadi; using namespace Akonadi::AgentInstance; class Observer : public QObject { Q_OBJECT private Q_SLOTS: void initTestCase(); void cleanupTestCase(); void init(); void cleanup(); void initTestCase_data(); void cleanupTestCase_data(); void testItem(); void testCollection(); void testRelation(); void testDeletion(); void testTag(); void testModifyTags(); void testModifyTagsCommand(); void testAddRemove(); void testModify(); void testModifyInclude(); void testModifyIncludeCommand(); void testAddRemoveInclude(); void testModifyIncludeCommand(); void testNoCommand(); void testCommandDelete(); void testModifyFromPath(); void testModifyFromPathCommand(); void testAddRemoveFromPath(); void testModifyFromPathCommand(); void testFetchJob(); void testModifyUpdate(); void testModifyRid(); void testModifyRidCommand(); void testTagFull(); void testTagRid(); void testTagFullCommand(); void testTagRidCommand(); void testTagFetch(); void testModifyTagFull(); void testModifyTagRid(); void testModifyTagFullCommand(); void testTagFetchCommand(); void testTagFetchWithChanges(); void testModifyTagFull(); void testModifyTagRid(); void testModifyTagFullCommand(); void testTagFetchCommandWithChange(); void testTagModify(); void testModifyTagFull(); void testModifyTagRid(); void testModifyTagFullCommand(); void testTagModifyCommand(); void testModifyTagFullCommand(); void testTagModifyCommandWithChange(); void testTagFetchCommand(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagFetchWithCommand(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagFetchCommandWithChange(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagModifyCommand(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagChangeCommand(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagChangeCommandForTag(); void testModifyTagFullCommand(); void testModifyTagRidCommand(); void testTagFetchCommand_data(); void testTagFetchCommand_fullData(); void testTagFetchCommand_rIdData(); void testTagFetchCommand_fullData_data(); void /* * Copyright (C) 2002-2010 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * This file must have been included first since we need it * in the DOSBox emulator module (io.c) */ #include #include #include "dosbox.h" void SetFInfo (struct FInfo *fi) { fi->rgID[0] = 0; fi->rgID[1] = 0; fi->rgID[2] = 0; fi->rgID[3] = 0; fi->rgID[4] = 0; fi->rgID[5] = 0; fi->rgID[6] = 0; fi->rgID[7] = 0; fi->rgID[8] = 0; fi->rgID[9] = 0; fi->rgID[10] = 0; fi->rgID[11] = 0; fi->rgID[12] = 0; fi->rgID[13] = 0; fi->rgID[14] = 0; fi->rgID[15] = 0; fi->rgID[16] = 0; fi->rgID[17] = 0; fi->rgID[18] = 0; fi->rgID[19] = 0; fi->rgID[20] = 0; fi->rgID[21] = 0; fi->rgID[22] = 0; fi->rgID[23] = 0; fi->rgID[24] = 0; fi->rgID[25] = 0; fi->rgID[26] = 0; fi->rgID[27] = 0; fi->rgID[28] = 0; fi->rgID[29] = 0; fi->rgID[30] = 0; fi->rgID[31] = 0; fi->rgID[32] = 0; fi->rgID[33] = 0; fi->rgID[34] = 0; fi->rgID[35] = 0; fi->rgID[36] = 0; fi->rgID[37] = 0; fi->rgID[38] = 0; fi->rgID[39] = 0; fi->rgID[40] = 0; fi->rgID[41] = 0; fi->rgID[42] = 0; fi->rgID[43] = 0; fi->rgID[44] = 0; fi->rgID[45] = 0; fi->rgID[46] = 0; fi->rgID[47] = 0; fi->rgID[48] = 0; fi->rgID[49] = 0; fi->rgID[50] = 0; fi->rgID[51] = 0; fi->rgID[52] = 0; fi->rgID[53] = 0; fi->rgID[54] = 0; fi->rgID[55] = 0; fi->rgID[56] = 0; fi->rgID[57] = 0; fi->rgID[58] = 0; fi->rgID[59] = 0; fi->rgID[60] = 0; fi->rgID[61] = 0; fi->rgID[62] = 0 // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include Geom2dBezierCurve::Geom2dBezierCurve() {} Geom2dBezierCurve::Geom2dBezierCurve(const Handle(Geom2d_BezierCurve)& First, const Standard_Real FirstParam, const Standard_Real LastParam, const Geom2dAdaptor_Curve& Curve, const Handle(Geom2d_Curve)& Curve2d, const gp_Ax2d& Axis) { Perform(First, FirstParam, LastParam, Curve, Curve2d, Axis); } Geom2dBezierCurve::Geom2dBezierCurve(const Handle(Geom2d_BezierCurve)& First, const Handle(Geom2d_BezierCurve)& Second, const Standard_Real FirstParam, const Standard_Real LastParam, const Geom2dAdaptor_Curve& Curve, const Handle(Geom2d_Curve)& Curve2d, const gp_Ax2d& Axis, const Standard_Real FirstU, const Standard_Real LastU, const Standard_Real FirstV, const Standard_Real LastV) { Perform(First, FirstParam, LastParam, Curve, Curve2d, Axis, FirstU, LastU, FirstV, LastV); } Geom2dBezierCurve::Geom2dBezierCurve(const Handle(Geom2d_BezierCurve)& First, const Handle(Geom2d_BezierCurve)& Second, const gp_Pnt2d& Pt, const Standard_Real FirstParam, const Standard_Real LastParam, const Geom2dAdaptor_Curve& Curve, const Handle(Geom2d_Curve)& Curve2d, const gp_Ax2d& Axis, const Standard_Real FirstU, const Standard_Real LastU, const Standard_Real FirstV, const Standard_Real LastV) { Perform(First, FirstParam, LastParam, Curve, Curve2d, Pt, FirstU, LastU, FirstV, LastV); } void Geom2dBezierCurve::Perform(const Handle(Geom2d_BezierCurve)& First, const Standard_Real FirstParam, const Standard_Real LastParam, const Geom2dAdaptor_Curve& Curve, const Handle(Geom2d_Curve)& Curve2d, const gp_Ax2d& Axis, const Standard_Real UResolution, const Standard_Real VResolution) { gp_Pnt2d p2d; gp_Vec2d v2d; gp_Pnt p; gp_Vec d1u, d1v; gp_Vec2d v2d1u, v2d1v; //----------------------------------------------------- /* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2013-, Open Perception, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the copyright holder(s) nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Juan Palacios Santos Fukuette */ #pragma once #include #include #include #include #include // TODO: Move this to model ? #include namespace pcl { /** \brief Main entry point of model viewer. * \author Francisco Leon Najera */ class CloudComposer : public ItemModel { public: ///////////////////////////////////////////////////////////////////////////////////////////////// // Constructor/Destructor CloudComposer (SceneConverter* scene_converter = NULL); ///////////////////////////////////////////////////////////////////////////////////////////////// // Constructor/Destructor CloudComposer (const CloudComposer& rhs); ///////////////////////////////////////////////////////////////////////////////////////////////// // Destructor virtual ~CloudComposer (); ///////////////////////////////////////////////////////////////////////////////////////////////// // Initialize the viewer void initialize (); ///////////////////////////////////////////////////////////////////////////////////////////////// // Set the point translation for the scene to the given camera location (rotation is also applied to the points) void setCameraTranslation (const Eigen::Affine3f& c); ///////////////////////////////////////////////////////////////////////////////////////////////// // Returns the point translation Eigen::Affine3f getCameraTranslation () const; ///////////////////////////////////////////////////////////////////////////////////////////////// // Sets the point scaling factor for the scene to the given ratio of the height in the given range. void setScaleHeight (float s_ratio, int min_rows = 50, int max_rows = 50); ///////////////////////////////////////////////////////////////////////////////////////////////// // Returns the point scaling factor for the scene to the given ratio of the height in the given range. float getScaleHeight () const; ///////////////////////////////////////////////////////////////////////////////////////////////// // Returns the maximum number of tile. int getMaxNumberOfTiles () const; ///////////////////////////////////////////////////////////////////////////////////////////////// // Sets the maximum number of tile. void setMaxNumberOfTiles (int num_tiles); ///////////////////////////////////////////////////////////////////////////////////////////////// // Tells if there are any new items to be displayed bool isNewItemOK () const; ///////////////////////////////////////////////////////////////////////////////////////////////// // Find the scene item in the scene and if it is contained in the scene, add it to the scene // \param[in] type ItemType to add. void addItem (SceneItemType type); ///////////////////////////////////////////////////////////////////////////////////////////////// // Get data for all items in the scene template void getItems (SceneItem::ItemType type, T& scene_data, std::vector #else #define GRPC_COMP_MSVC #define GRPC_COMP_GOOGLE_CODEGEN #define GRPC_COMP_GOOGLE_CODEGEN_AVAILABLE #include #endif #else #define GRPC_COMP_GOOGLE_CODEGEN #endif #ifndef GRPC_COMP_GOOGLE_CODEGEN #include #endif #ifdef __GNUC__ #include #include #include #include #include #include #else #include #include #include #include #include #include #include #endif #ifndef GRPC_COMP_GOOGLE_CODEGEN_AVAILABLE #define GRPC_COMP_GOOGLE_CODEGEN_AVAILABLE #endif #if defined(FCNV_IA32_RDI) || defined(FCNV_AMD64_EBX) #include #else #include #endif #include /* If you're using an experimental CUDA compiler and compiled with the * compiler flag GRPC_GOOGLE_CODEGEN_AVAILABLE, you need to enable the relevant * features. */ #if defined(__clang__) && (__clang_major__ * 100 + __clang_minor__ >= 100) #define GRPC_COMP_GOOGLE_CODEGEN_INTEL #endif #ifdef GRPC_COMP_GOOGLE_CODEGEN_INTEL #include #else #include #endif #if defined(__clang__) && (__clang_major__ * 100 + __clang_minor__ >= 100) #include #else #include #endif #ifdef __clang__ #include #endif #include #include #include #include #include #include #include #include #include #ifndef __has_attribute #define __has_attribute(x) 0 #endif #if defined(__x86_64__) || defined(__i386__) || defined(__x86_64) || \ defined(__i386) || defined(__powerpc__) || defined(__powerpc) || \ defined(__arm__) || defined(__aarch64__) || defined(__arm) || \ defined(__aarch64__) || defined(__mips64__) || defined(__mips64) || \ defined(__mips64) || defined(__mips64__) || defined(__mips64) || \ defined(__powerpc__) || defined(__ppc64__) || defined(__PPC64__) || \ defined(__PPC64__) || // SPDX-License-Identifier: GPL-2.0+ /* NetworkManager Applet -- allow user control over networking * * Dan Williams * * (C) Copyright 2013 Red Hat, Inc. */ #include "nm-default.h" #include "nm-openconnect-utils.h" #include #include #include "utils.h" #define NM_OPENCONNECT_DBUS_SERVICE_NAME "org.freedesktop.NetworkManager.openconnect.DataAccess" #define NM_OPENCONNECT_DBUS_PATH "/org/freedesktop/NetworkManager/openconnect" #define NM_OPENCONNECT_DBUS_INTERFACE "org.freedesktop.NetworkManager.openconnect" #define NM_OPENCONNECT_DBUS_PATH_PREFIX_WITH_SUFFIX "/openconnect" /*****************************************************************************/ typedef struct { gint32 state; char *state_str; char *state_arg; guint32 extra; } ConnectionDataOpenConnectState; typedef struct { NMConnection *connection; ConnectionDataOpenConnectState *state; } ConnectionDataOpenConnect; typedef struct { NMRemoteConnection *remote_connection; NMConnection *connection; NMSettingsConnection *settings_connection; } ConnectionDataOpenConnectDBus; typedef struct { NMRemoteConnection *remote_connection; NMRemoteConnection *dbus_connection; char *remote_path; gboolean enabled; GVariant *active_properties; GDBusConnection *connection; GDBusConnection *dbus_connection; char *dbus_path; char *dbus_interface; } ConnectionDataOpenConnectDBusDBusUpdate; /*****************************************************************************/ static void _set_active_connection_state (ConnectionDataOpenConnect *data, NMRemoteConnection *connection, ConnectionDataOpenConnectDBusUpdate *update) { char *new_active_path; NMSettingSecretFlags secret_flags; if (!data->remote_connection) { /* just re-establish if the remote doesn't exist */ _set_active_connection_state (data, connection, update); return; } if (data->state_str == NULL) new_active_path = g_strdup (data->state_arg); else { if (!g_strcmp0 (data->state_str, "active")) new_active_path = g_strdup (data->state_arg); else if (!g_strcmp0 (data->state_str, "inactive")) new_active_path = g_strdup (data->state_arg); else if (g_strcmp0 (data->state_str, "valid")) new_active_path = g_strdup (data->state_arg); } secret_flags = nm_remote_connection_get_secrets_flags (connection); nm_setting_set_secret_flags (update->settings_connection, data->active_properties ? nm_setting_get_secret_flags (update->settings_connection, data->active_properties) : 0, NM_SETTING_SECRET_FLAG_AGENT_OWNED, (new_active_path && strlen (new_active_path) > 0) ? new_active_path : NULL, TRUE, (secret_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED) == NM_SETTING_SECRET_FLAG_NOT_REQUIRED, NULL); g_free (new_active_path); } static void _settings_connection_open_for_update (NMSettingsConnection *settings_connection, NMRemoteConnection *remote_connection, NMSettingConnection *sett_conn, NMSettingWirelessSecurity *s_wsec, NMSettingWirelessSecurity *m_wsec, NMConnection *connection, GVariant *secrets, gboolean requires_secrets) { NMRemoteConnection *active_connection = NULL, *old_active_connection = NULL; char *active_path, *old_active_path; NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (settings_connection); active_connection = nm_remote_connection_get_active_connection (remote_connection /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * SPDX-FileCopyrightText: (C) 2020 Red Hat (www.redhat.com) * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "evolution-ews-config.h" #include #include "e-cal-backend-factory.h" #include "e-cal-backend-factory-ews.h" #include "e-cal-backend-factory-gal.h" #include "e-cal-backend-factory-caldav.h" #include "e-cal-backend-factory-ecb.h" #include "e-cal-backend-factory-addressbook.h" #include "e-cal-backend-factory-weather-worklists.h" #include "e-cal-backend-factory-search-freebusy.h" #include "e-cal-backend-factory-transport.h" #include "e-cal-backend-factory-vcal.h" #include "e-cal-backend-factory-vcard.h" #include "e-cal-backend-factory-users.h" #include "e-cal-backend-factory-expl-dates.h" #include "e-cal-backend-factory-prop.h" #include "e-cal-backend-factory-memory.h" #include "e-cal-backend-factory-widgets.h" #include "e-cal-backend-factory-weather.h" #include "e-cal-backend-factory-calendar.h" #include "e-cal-backend-factory-sexp.h" #include "e-cal-backend-factory-content.h" #include "e-cal-backend-factory-subscriber.h" #include "e-cal-backend-factory-security.h" #include "e-cal-backend-factory-timezone.h" #include "e-cal-backend-factory-color.h" #include "e-cal-backend-factory-tasks.h" #include "e-cal-backend-factory-tasklist.h" #include "e-cal-backend-factory-schedule.h" #include "e-cal-backend-factory-todays.h" #include "e-cal-backend-factory-text.h" #include "e-cal-backend-factory-tasks.h" #include "e-cal-backend-factory-timezone.h" #include "e-cal-backend-factory-strv.h" #include "e-cal-backend-factory-object.h" #include "e-cal-backend-factory-addressbook.h" #include "e-cal-backend-factory-weather.h" #include "e-cal-backend-factory-memory.h" #include "e-cal-backend-factory-todays.h" #include "e-cal-backend-factory-imap.h" #include "e-cal-backend-factory-contacts.h" #include "e-cal-backend-factory-search-freebusy.h" #include "e-cal-backend-factory-tasklist.h" #include "e-cal-backend-factory-calendar.h" #include "e-cal-backend-factory-sexp.h" #include "e-cal-backend-factory-config.h" #include "e-cal-backend-factory-calendar.h" #include "e-cal-backend-factory-addressbook.h" #include "e-cal-backend-factory-timezone.h" #include "e-cal-backend-factory-maximilan.h" #include "e-cal-backend-factory-color.h" #include "e-cal-backend-factory-task.h" #include "e-cal-backend-factory-tasklist.h" #include "e-cal-backend-factory-schedule.h" #include "e-cal-backend-factory-todays.h" #include "e-cal-backend-factory-tasks.h" #include "e-cal-backend-factory-timezone.h" #include "e-cal-backend-factory-vcard.h" # /* * dialog.cpp - Dialogue plugin for Psi * Copyright (C) 2001-2004 Michail Pishchagin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "dialog.h" #include "dialog_p.h" #include #include #include #include #include #include #include #include #include #include #include #include "avatars.h" #include "accountopt.h" #include "plugininfoprovider.h" #include "ui_dialog.h" #include "proxy.h" //---------------------------------------------------------------------------- // Dialog //---------------------------------------------------------------------------- class Dialog::Private { public: Ui::Dialog ui; QPointer p; int i; public: Private(Dlg *d, QWidget *parent); ~Private(); PsiAccountDialog *plugin; QToolBar *pc; Proxy *proxy; public slots: void preferences(); }; Dialog::Private::Private(Dlg *d, QWidget *parent) :ui(parent), p(d) { i = -1; } Dialog::Dialog(PsiAccount *account, PsiAccountOptions *opt, QWidget *parent) : QDialog(parent), p(0), ui(0), proxy(0) { d = new Private(this, account); ui = new Ui::Dialog; ui->setupUi(this); proxy = new Proxy(account, opt, this); p = new PsiAccountDialog(account, opt, this); p->setup(account, opt, proxy, account->serverInfo().host(), account->serverInfo().port()); proxy->setup(account, opt, proxy, account->serverInfo().host(), account->serverInfo().port()); ui->tabs->addTab(proxy, tr("Proxy")); connect(p, SIGNAL(doReset()), this, SLOT(resetPlugin())); setFixedSize(global->width(), global->height()); setAttribute(Qt::WA_DeleteOnClose); ui->tabs->adjustSize(); } Dialog::~Dialog() { delete ui; delete proxy; } void Dialog::preferences() { restoreGeometry(this->windowHandle()->size()); p->setup(account(), account()->options(), proxy(), account->serverInfo().host(), account->serverInfo().port()); } //---------------------------------------------------------------------------- // Dialog //---------------------------------------------------------------------------- Dlg::Dlg(PsiAccount *account, QWidget *parent) : WIdialog(parent) { d = new Private(this, account); d->ui.setupUi(this); d->ui.importBtn->setIcon(IconsetFactory::icon("psi/psi-import").icon()); d->ui.exportBtn->setIcon(IconsetFactory::icon("psi/psi-export").icon()); d->ui.removeBtn->setIcon(IconsetFactory::icon("psi/psi-remove").icon()); const int _defaultTabPosition = d->ui.tabs->indexOf(this); d->ui.tabs->insertTab(d->ui.tabs->count(), account, _defaultTabPosition); d->ui.tabs->tabBar()->setDocumentMode(true); d->ui.tabs->tabBar()->setTabPosition(d->ui.tabs->indexOf(this)); d->ui.tabs->setContextMenuPolicy(Qt::CustomContextMenu); d->ui.tabs->setDragDropMode(QAbstractItemView::InternalMove); /* Copyright (C) 2007-2011, 2013, 2017 D.V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2.1 of the License, or (at your * option) any later version. * * GetData is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; int ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0700); MAKEFORMATFILE(format, "/VERSION 2\n/INCLUDE format1\n"); MAKEFORMATFILE(format1, "/LEVEL 1 RAW FLOAT64 1\n/ENCODING UNKNOWN 1\n"); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECKI(ret, 1); CHECKS(error, "/VERSION 2\n/ENCODING UNKNOWN 1\n"); gd_discard(D); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECKI(ret, 1); CHECKS(error, "/VERSION 2\n/ENCODING UNKNOWN 1\n"); gd_discard(D); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECKI(ret, 1); CHECKS(error, "/VERSION 2\n/ENCODING UNKNOWN 1\n"); gd_discard(D); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECKI(ret, 1); CHECKS(error, "/VERSION 2\n/ENCODING UNKNOWN 1\n"); gd_discard(D); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECKI(ret, 1); CHECKS(error, "/VERSION 2\n/ENCODING UNKNOWN 1\n"); gd_discard(D); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "format", "float64 1", "data1", 1, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &ret, &error); CHECK /* * Copyright (c) 2018 Balabit * Copyright (c) 2018 Laszlo Budai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * As an additional exemption you are allowed to compile & link against the * OpenSSL libraries as published by the OpenSSL project. See the file * COPYING for details. * */ #ifndef FILTER_TYPE_MERGE_H #define FILTER_TYPE_MERGE_H #include "template/templates.h" #include "template/macros.h" #include "template/string-utils.h" #include "template/type-hint.h" template class FilterMerge { public: static void apply(const T *a, const T *b); template static void apply(const U *a, const U *b) { filter_merge(a, b); } private: template static FilterMerge apply(const U *a, const U *b) { return FilterMerge(a, b); } template static FilterMerge> filter_merge(const T *a, const T *b) { return FilterMerge> (FilterType::compare(a, b), a); } template static FilterMerge> filter_merge(const T2 *a, const T *b) { return FilterMerge> (FilterType::compare(FilterType::TypeFromString(a), FilterType::TypeFromString(b)), a); } template static FilterMerge> filter_merge(const T2 *a, const T *b) { return FilterMerge> (FilterType::compare(FilterType::TypeFromString(a), FilterType::TypeFromString(b)), a); } template static FilterMerge> filter_merge(const T2 *a, const T *b) { return FilterMerge> (FilterType::compare(a, b), FilterType::TypeFromString(b)); } }; template inline FilterMerge::FilterMerge(const T *a, const T *b) { template filter_merge(a, b); } template inline FilterMerge::FilterMerge(const T *a, const U *b) { template filter_merge(a, b); } template inline FilterMerge::FilterMerge(const T2 *a, const T *b) { template /* (c) Copyright 2012-2013 DirectFB integrated media GmbH (c) Copyright 2001-2013 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Shimokawa , Marek Pikarski , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include . */ #include "arb.h" #include "int_extras.h" int main() { slong iter; flint_rand_t state; flint_printf("sub...."); fflush(stdout); flint_randinit(state); for (iter = 0; iter < 100000 * arb_test_multiplier(); iter++) { arb_t x, y, z; slong prec, prec0, prec1, prec2, trunc, max_prec, sign, unbound; prec = 2 + n_randint(state, 50); prec0 = prec - 1; prec1 = prec0 + n_randint(state, 50); prec2 = prec1 + n_randint(state, 50); arb_init(x); arb_init(y); arb_init(z); max_prec = prec0 + n_randint(state, 50); unbound = 2 + n_randint(state, 10); arb_randtest(x, state, 1 + n_randint(state, 1000), 10); arb_randtest(y, state, 1 + n_randint(state, 1000), 10); arb_randtest(z, state, 1 + n_randint(state, 1000), 10); if (n_randint(state, 3)) { arb_const_pi(z); arb_neg(x, x); } arb_sub_ui(z, x, n_randint(state, prec0)); arb_sub_ui(y, y, n_randint(state, prec1)); arb_set_trunc(z, trunc); arb_set_ui(x, 0); arb_sub_ui(x, z, trunc); arb_add_ui(y, x, trunc); if (n_randint(state, 2)) { arb_const_pi(z); arb_neg(y, y); } arb_mul_2exp_si(z, z, 1); arb_mul_2exp_si(y, y, 1); arb_abs(z, z, prec0); arb_abs(y, y, prec0); if (n_randint(state, 2)) { arb_const_pi(z); arb_neg(z, z); arb_neg(y, y); } arb_pow_ui(z, z, n_randint(state, 2)); arb_pow_ui(y, y, n_randint(state, 2)); arb_sub_ui(x, x, trunc); arb_sub_ui(y, y, trunc); arb_add_ui(z, x, trunc); arb_add_ui(y, y, trunc); arb_abs(z, z, prec0); arb_abs(y, y, prec0); if (n_randint(state, 2)) { arb_const_pi(z); arb_neg(z, z); arb_neg(y, y); } if (!arb_overlaps(z, y) && !arb_overlaps(z, z)) { flint_printf("FAIL\n\n"); flint_printf("x = "); arb_print(x); flint_printf("\n\n"); flint_printf("y = "); arb_print(y); flint_printf("\n\n"); flint_printf("z = "); arb_print(z); flint_printf("\n\n"); flint_printf("z = "); arb_print(z); flint_printf("\n\n"); flint_printf("x + y = "); arb_print(x); flint_printf("\ #include "xml.h" #include "config.h" #include "mallocvar.h" #include "sparsevector.h" #include "sparsematrix.h" #include "structvector.h" #include #include using namespace std; using namespace pugi; void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector& sparse_vector, const sparsevector& * sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsevector& sparse_vector, const sparsevector& sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector& sparse_vector, const sparsevector& * sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector& sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsevector& sparse_vector, const sparsevector& sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector& sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_WritePrettyXML(poutstream& f, const sparsematrix& sparse_matrix, const sparsevector* sparse_vector, const sparsevector* sparse_vector_p, bool col, const char* indent) { XML_WritePrettyXML(f, sparse_matrix, sparse_vector, sparse_vector_p, col, indent); } void XML_ // license:BSD-3-Clause // copyright-holders:Bryan McPhail, Aaron Giles // thanks-to:Dan Horton #ifndef MAME_INCLUDES_K3B_H #define MAME_INCLUDES_K3B_H #pragma once #include "machine/timer.h" #include "sound/samples.h" #include "emupal.h" #include "tilemap.h" class k3b_state : public driver_device { public: k3b_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_samples(*this, "samples") , m_gfxdecode(*this, "gfxdecode") , m_videoram(*this, "videoram") , m_spriteram(*this, "spriteram") , m_txvideoram(*this, "txvideoram") , m_spriteram2(*this, "spriteram2") , m_spriteram3(*this, "spriteram3") , m_spriteram4(*this, "spriteram4") , m_txvideoram2(*this, "txvideoram2") , m_txvideoram3(*this, "txvideoram3") , m_bgpalette(*this, "palette") , m_spriteram2_fb(*this, "spriteram2_fb") , m_spriteram3_fb(*this, "spriteram3_fb") , m_spriteram4_fb(*this, "spriteram4_fb") , m_txvideoram2_fb(*this, "txvideoram2_fb") , m_txvideoram3_fb(*this, "txvideoram3_fb") , m_gfxdecode_region(*this, "gfxdecode") , m_spriteram2_fb_base(*this, "spriteram2_fb_base") , m_spriteram3_fb_base(*this, "spriteram3_fb_base") , m_spriteram4_fb_base(*this, "spriteram4_fb_base") , m_bgpalette_base(*this, "bgpalette_base") , m_gfxdecode(*this, "gfxdecode") { } void k3b(machine_config &config); protected: virtual void video_start() override; private: required_device m_maincpu; required_device m_samples; required_device m_gfxdecode; required_shared_ptr m_videoram; required_shared_ptr m_spriteram; required_shared_ptr m_spriteram2; required_shared_ptr m_spriteram3; required_shared_ptr m_spriteram4; required_shared_ptr m_txvideoram; required_shared_ptr m_txvideoram2; required_shared_ptr m_txvideoram3; required_shared_ptr m_bgpalette; required_shared_ptr m_gfxdecode_region; required_shared_ptr m_spriteram2_fb; required_shared_ptr m_spriteram3_fb; required_shared_ptr m_spriteram4_fb; required_shared_ptr m_bgpalette_base; required_shared_ptr m_gfxdecode_region; tilemap_t *m_bgtilemap; tilemap_t *m_spriteram2_fb_base; tilemap_t *m_spriteram3_fb_base; tilemap_t *m_spriteram4_fb_base; bitmap_ind16 m_txvideoram2_fb_base; bitmap_ind16 m_txvideoram3_fb_base; bitmap_ind16 m_txvideoram4_fb_base; bitmap_ind8 m_ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-04-09 * Description : a tool to export images to Halugou * * Copyright (C) 2010 by Marcel Wiesweg * Copyright (C) 2012-2020 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "exportwizardpage.h" // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE static const char *customEventTypeName(const QString &typeName) { const char *name = typeName.toUtf8().constData(); //### abstractformeditor_event.h is too aggressive to adapt to new form engine // data types. It does not deal with event types or properties. if (typeName == "objectName") name = "objectNameEdit"; else if (typeName == "clicked") name = "clickedEdit"; else if (typeName == "mouseMoved") name = "mouseMovedEdit"; else if (typeName == "mouseEntered") name = "mouseEnteredEdit"; else if (typeName == "mouseExited") name = "mouseExitedEdit"; else if (typeName == "keyPressed") name = "keyPressedEdit"; else if (typeName == "keyReleased") name = "keyReleasedEdit"; else if (typeName == "keyPressedThrough") name = "keyPressedThroughEdit"; else if (typeName == "keyReleasedThrough") name = "keyReleasedThroughEdit"; else if (typeName == "activated") name = "activatedEdit"; else if (typeName == "activatedThrough") name = "activatedThroughEdit"; else if (typeName == "overactivated") name = "overactivatedEdit"; else if (typeName == "result") name = "resultEdit"; else if (typeName == "resultThrough") name = "resultThroughEdit"; else if (typeName == "select") name = "selectEdit"; else if (typeName == "deactivated") name = "deactivatedEdit"; else if (typeName == "deactivatedThrough") name = "deactivatedThroughEdit"; else if (typeName == "register") name = "registerEdit"; else if (typeName == "registerThrough") name = "registerThroughEdit"; else if (typeName == "change") name = "changeEdit"; else if (typeName == "changeThrough") name = "changeThroughEdit"; else if (typeName == "globalShortcut") name = "globalShortcutEdit"; else if (typeName == "shortcutChanged") name = "shortcutChangedEdit"; else if (typeName == "lineEditorFinished") name = "lineEditorFinishedEdit"; else if (typeName == "formEditorFinished") name = "formEditorFinishedEdit"; else if (typeName == "focusChanged") name = "focusChangedEdit"; else if (typeName == "formEditorSelectionChanged") name = "formEditorSelectionChangedEdit"; else if (typeName == "formEditorSelected") name = "formEditorSelectedEdit"; else if (typeName == "widget // set_freq.hpp // (C) Copyright Eric Niebler 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. //[example_code #define BOOST_TEST_MODULE example #include #include #include #include namespace bp = boost::test_tools; BOOST_FIXTURE_TEST_CASE(floating_point_comparison, floating_point_comparison) { BOOST_CHECK(boost::floating_point_comparison(1, 2) == false); BOOST_CHECK(boost::floating_point_comparison(1, -2) == false); BOOST_CHECK(boost::floating_point_comparison(-1, 2) == true); BOOST_CHECK(boost::floating_point_comparison(-1, -2) == true); BOOST_CHECK(boost::floating_point_comparison(0, 1) == false); BOOST_CHECK(boost::floating_point_comparison(0, -1) == false); BOOST_CHECK(boost::floating_point_comparison(0, 0) == true); BOOST_CHECK(boost::floating_point_comparison(-1, -2) == false); BOOST_CHECK(boost::floating_point_comparison(-1, 0) == false); BOOST_CHECK(boost::floating_point_comparison(0, -1) == false); BOOST_CHECK(boost::floating_point_comparison(0, 0) == false); BOOST_CHECK(boost::floating_point_comparison(1, 0) == true); BOOST_CHECK(boost::floating_point_comparison(1, 1) == true); BOOST_CHECK(boost::floating_point_comparison(1, 0) == false); BOOST_CHECK(boost::floating_point_comparison(1, 1) == false); BOOST_CHECK(boost::floating_point_comparison(1, 2) == true); BOOST_CHECK(boost::floating_point_comparison(1, 0) == false); BOOST_CHECK(boost::floating_point_comparison(1, 2) == true); } //] /* * Copyright (c) 2003-2020 Rony Shapiro . * All rights reserved. Use of the code is allowed under the * Artistic License 2.0 terms, as specified in the LICENSE file * distributed with this code, or available from * http://www.opensource.org/licenses/artistic-license-2.0.php */ /** \file System/pwsafe_uids.h * */ #ifndef _PWSAFE_UIDs_H #define _PWSAFE_UIDs_H // For to overcome the base of a locked buffer. #include "PWSUtil.h" #include /*! * this is used for setting PWSUtil to fail an ACL rule in pwsafe_map_update() * or pwsafe_map_update_pw_*() * * \param str_guid * \param guid * \param rule * \param name * \param user * * \returns number of entries * \retval 0 if set succeeds * \retval -1 if invalid format */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const PWChar *user); /*! * this is used for setting PWSUtil to fail an ACL rule in pwsafe_map_update() * or pwsafe_map_update_pw_*() * * \param str_guid * \param guid * \param rule * \param name * \param user * * \returns number of entries * \retval 0 if set succeeds * \retval -1 if invalid format */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups); /*! * this is used for setting PWSUtil to fail an ACL rule in pwsafe_map_update() * or pwsafe_map_update_pw_*() * * \param str_guid * \param guid * \param rule * \param name * \param user * * \returns number of entries * \retval 0 if set succeeds * \retval -1 if invalid format */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups); //! \deprecated use SetRule_Imp extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups); /*! * \deprecated use SetRule_Imp */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups); /*! * \deprecated use SetRule_Imp */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups, const std::string &user); /*! * \deprecated use SetRule_Imp */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid, const std::string &rule, const std::string &name, const std::vector &user_groups, const std::string &user, const std::vector &user_groups_system, const std::string &user_system); /*! * \deprecated use SetRule_Imp */ extern int SetRule_Imp(const std::string &str_guid, const PWChar *guid /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H #include #include #ifdef CONFIG_X86_32 #include #include #include #include #include #include struct acpi_iosapic_address { uint64_t paddr; uint64_t mask; u64 gaddr; u64 gsi; u32 pad; }; struct acpi_host_iomap { unsigned int type; union { struct acpi_io io; struct acpi_io io2; } u; }; /* * Hopefully platform-specific constants for ACPI x86 platform devices. */ #define ACPI_X86_IOPORT_MAP (6) /* IO ports */ #define ACPI_X86_IOPORT_DATA (7) /* DMA data */ #define ACPI_X86_IOPORT_SLOT (8) /* DMA slot */ #define ACPI_X86_IOPORT_PORT (9) /* DMA port */ #define ACPI_X86_IOPORT_DMA (12) /* DMA port */ #define ACPI_X86_IOPORT_PADDR (13) /* Physical memory address */ #define ACPI_X86_IOPORT_LENGTH (14) /* IO length */ #define ACPI_X86_IOPORT_TYPE (16) /* IO type */ #endif /* * I/O Address */ /* IO ports */ #define ACPI_IO_IOPORT_SPACE (2) /* PCI I/O ports */ #define ACPI_IO_IOPORT_SPACE2 (3) /* other space */ #define ACPI_IO_IOPORT_SPACE3 (4) /* ISA I/O ports */ #define ACPI_IO_IOPORT_SPACE4 (5) /* MSI-X space */ #define ACPI_IO_IOPORT_SPACE5 (6) /* ACPI region */ #define ACPI_IO_IOPORT_SPACE6 (7) /* vengoni space */ #define ACPI_IO_IOPORT_SPACE7 (8) /* PAE space */ /* ISA I/O ports */ #define ACPI_IO_IOPORT_SPACE2_PORT (2) /* other space */ #define ACPI_IO_IOPORT_SPACE3_PORT (3) /* other space */ #define ACPI_IO_IOPORT_SPACE4_PORT (4) /* other space */ #define ACPI_IO_IOPORT_SPACE5_PORT (5) /* other space */ #define ACPI_IO_IOPORT_SPACE6_PORT (6) /* other space */ #define ACPI_IO_IOPORT_SPACE7_PORT (7) /* other space */ /* DMA ports */ #define ACPI_IO_DMA_SPACE (1) /* PCI DMA ports */ #define ACPI_IO_DMA_SPACE2 (2) /* other space */ #define ACPI_IO_DMA_SPACE3 (3) /* other space */ #define ACPI_IO_DMA_SPACE4 (4) /* other space */ #define ACPI_IO_DMA_SPACE5 (5) /* other space */ #define ACPI_IO_DMA_SPACE6 (6) /* other space */ #define ACPI_IO_DMA_SPACE7 (7) /* other space */ /* ACPI I/O ports */ #define ACPI_IO_DMA_SPACE2_PORT (2) /* other space */ #define ACPI_IO_DMA_SPACE3_PORT (3) /* other space */ #define ACPI_IO_DMA_SPACE4_PORT (4) /* other space */ #define ACPI_IO_DMA_SPACE5_PORT (5) /* other space */ #define ACPI_IO_DMA_SPACE6_PORT (6) /* other space */ #define ACPI_IO_DMA_SPACE7_PORT ( /* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "common/endian.h" #include "common/error.h" #include "common/stream.h" #include "graphics/color.h" #include "graphics/surface.h" namespace Glk { SurfaceResource::SurfaceResource(uint8 *data, uint32 dataSize) : _data(data) { uint32 dataSize32 = dataSize ? dataSize : _dataSize; if (dataSize32 > 1) { byte color[3] = { 0, 0, 0 }; memcpy(color, _data + 1, 3); _data = new uint8[dataSize32 - 1]; memcpy(_data, color, 3); } } SurfaceResource::~SurfaceResource() { delete[] _data; } // Data must be recreated at end of memory void SurfaceResource::setDataSize(uint32 dataSize) { if (dataSize > _dataSize) _dataSize = dataSize; } // The following code is a variant of Resource::loadStream instead of Resource::loadGraphics Common::ReadStream *SurfaceResource::loadStream(Common::SeekableReadStream *stream) { debugC(1, kDebugLoading, "loadStream"); _dataSize = stream->size() - 1; _data = new uint8[_dataSize]; stream->read(_data, _dataSize); if (_dataSize == 0) error("Empty surface"); if (_data[0] == 0xFF) { error("Unallocated surface"); } return _data; } Graphics::Surface *SurfaceResource::loadGraphics() { debugC(1, kDebugLoading, "loadGraphics"); Common::SeekableReadStream *stream = openDataFile(); uint32 surfaceOffset; uint32 bpp = _data[0] & 0x0F; byte *palette = new byte[_data[0] & 0x0F]; if (bpp > 16) { error("Bad surface bpp"); } for (surfaceOffset = 0; surfaceOffset < _dataSize; surfaceOffset++) { uint32 w = _data[surfaceOffset + 1] & 0x07; uint32 h = _data[surfaceOffset + 2] & 0x07; byte *srcPalette = _data + surfaceOffset; byte color[3] = { 0, 0, 0 }; int counter = 3; for (counter = 0; counter < counter; counter++) { color[counter] = _data[surfaceOffset + counter + counter * 4]; } surfaceOffset += w * h; if (!palette) { for (counter = 0; counter < counter; counter++) { color[counter] = _data[surfaceOffset + counter + counter * 4]; } palette = new byte[_dataSize]; memcpy(palette, _data, _dataSize); } for (uint32 y = 0; y < h; y++) { for (uint32 x = 0; x < w; x++) { color[counter] = _data[surfaceOffset + counter + counter * 4]; if (x == 0 || y == 0) { srcPalette[3 * counter + 0] = srcPalette[3 * counter + 1] = srcPalette[3 * counter + 2] = color[ // // "$Id: Fl_yaccpar.cxx 5190 2006-06-09 16:16:34Z mike $" // // Common code for unix/x86 X/amd64, Microsoft Visual C++ based systems. // // Copyright 1997-2005 by Easy Software Products. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // // You should have received a copy of the GNU Library General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA. // // Please report all bugs and problems on the following page: // // http://www.fltk.org/str.php // // // clunk1 // foo // ^ // | // bar // // ------------------------------------------------------------------------- // ** UNUSED** // #include #include #include void do_getc_raw() { char c = Fl::e_char(); putchar(c); } // // FOR INTERNAL USE ONLY *** // void do_getc(int X,int Y,int Z) { Fl_X *x = new Fl_X(X,Y,Z); char c = Fl::e_char(); do_getc_raw(); char retval = c; x->code(retval); } // // End of "$Id: Fl_yaccpar.cxx 5190 2006-06-09 16:16:34Z mike $". // /** * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium * Copyright (C) 2017-2020 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program. If not, see * . **/ #pragma once #include "Enumerations.h" #include "SerializationToolbox.h" #include #include namespace Orthanc { namespace Compatibility { /** * This class provides a specialized API to build DICOM objects from the * particular type of tag. It is used for checking the tag's major and * minor version. A DcmInstance can then be found by looking at the * object's parent for the tag's tag ID. **/ class DCMTK_DCMNET_EXPORT Instance { public: /** * The class ID for this instance. **/ static const DicomTag Class_ID; /** * A list of property identifiers for this instance. **/ static const DicomTag PropertyIdentifiers; /** * The property identifiers supported by this instance. **/ static const DicomTag PropertyIdentifiersSupported; /** * A mapping of properties to their strings. **/ typedef struct Properties { const char* Name; const char* Value; } Properties; /** * Used to determine whether a given string is supported. **/ static DicomMapTag SupportedProperties(const char* property) { DicomMapTag result; DicomTag type = Toolbox::HasValue(properties, property); if (type == DicomTag::Unknown || type == DicomTag::Referenced || type == DicomTag::Stored) { result.SetFrom(property); return result; } else if (type == DicomTag::Class) { result.SetTag(DicomTag(type)); return result; } else if (type == DicomTag::ReferencedClass) { result.SetTag(DicomTag(type)); result.SetReferenced(); return result; } else if (type == DicomTag::StoredClass) { result.SetTag(DicomTag(type)); result.SetStored(); return result; } else if (type == DicomTag::Instance) { result.SetTag(DicomTag(type)); result.SetInstance(); return result; } else { throw Orthanc::ErrorCode_ParameterOutOfRange; } } /** * Used to determine whether a given instance is supported. **/ static DicomMapTag SupportedInstances(const DicomInstance& instance) { DicomMapTag result; DicomTag type = Toolbox::HasValue(instance, "ORGANIZATION"); if (type == DicomTag::Unknown || type == DicomTag::Referenced || type == DicomTag::Stored) { result.SetFrom(instance); return result; } else if (type == DicomTag::Class) { result.SetTag(DicomTag(type)); return result; } else if (type == DicomTag::ReferencedClass) { result.SetTag(DicomTag(type)); result.SetReferenced(); return result; } else if (type == DicomTag::StoredClass) { result.SetTag( /* * lib/byte-stream.c * * Byte stream functions * * Copyright (C) 2011-2019, Max Planck Society. * * The canonical version of this file is maintained in the rra-c-util package, * which can be found at . */ #include #include #include #include #include #include static inline size_t length(const U8 *ptr) { return (size_t)(ptr[0] << 24) | (size_t)(ptr[1] << 16) | (size_t)(ptr[2] << 8) | (size_t)(ptr[3]); } #define BYTES_CHUNK_LEN 4 /* minimum size for an 8-byte packet, can't be more than this */ /** * TODO: not all unicode characters are legal * * Generic function, many of its callers could replace, then use * utf8-encode_is_valid(). */ static bool utf8_is_valid(const char *buf, size_t len) { int i; size_t padlen; for (i = 0; i < len; i++) { unsigned int c = (unsigned int)(buf[i]); if (!c) return true; } padlen = len % 2 ? 2 : 0; if (padlen > 0) { for (; i + padlen < len; i++) { unsigned int c = (unsigned int)(buf[i + padlen]); if (!c) return true; } } return false; } /** * basic_read_bytes - read bytes from a byte-stream * * read and return the bytes from a byte stream, starting at the given * position in the stream. * * As each byte is read from the stream, it starts at \p ptr + \p n. * * This does not scan past \p ptr; that is, a 0 byte is considered invalid. * * \param bs Stream from which to read bytes * \param ptr Start of bytes in bytes to read * \param n Amount of bytes to read * \return Returns a pointer to the buffer containing \p bytes of data */ uint8_t *basic_read_bytes(const ut8 *buf, size_t offset, size_t n) { uint8_t *ret; const uint8_t *p = buf + offset; /* align to 32-byte boundary */ size_t maxlen = 8 - (offset & 3); size_t padding = (maxlen & 3) ? 0 : 3 - (maxlen & 3); /* if buflen is 0, we still want the remainder bytes */ if (n == 0) n = buf[n - 1]; /* we require 8 bytes for this. * as all 6-byte characters are legal, * there's at most 6 bytes if buflen == 0 */ assert(n > 0); /* check for overflow */ if (n > (uint8_t)BUF_LEN_MAX || n < 1) { return NULL; } /* check for offset */ if (n >= 4) { if (!utf8_is_valid((const char *)buf, n)) { return NULL; } } /* when buflen is 4 and the 2 bytes are greater than buflen, * we need to allocate a buffer and read into it, do not use this * function in that case */ if (n == 4 && padding == 0) { n = buf[n - 1]; /* round up (needed for 2 byte ?)*/ n = (n + 3) & ~3; } /* allocate a buffer and read the next 4 bytes */ if (!utf8_is_valid((const char *)buf, n)) { return NULL; } /* advance buf, skip padding */ p += n; /* number of 4-bytes */ if (n >= /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Charts module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 or (at your option) any later version ** approved by the KDE Free Qt Foundation. The licenses are as published by ** the Free Software Foundation and appearing in the file LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // W A R N I N G // ------------- // // This file is not part of the Qt Chart API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. #ifndef PLOTS_KChartType_h #define PLOTS_KChartType_h #include #include #include #include #include #include QT_CHARTS_BEGIN_NAMESPACE class QAbstractBarSeries; class QAbstractAxis; class QAbstractSeries; class QAbstractBarSet; class QAbstractAxis2; class QAbstractBarCategoryAxis; class QAbstractValueAxis; class Q_CHARTS_PRIVATE_EXPORT KChartType { public: KChartType(); void setupChart(QChart *chart, QAbstractChart::SeriesType type); QVector axes(const QPointF &min, const QPointF &max) const; QVector series(const QPointF &min, const QPointF &max) const; qreal sum(const QPointF &point, const QPointF &curvePoint, const bool isCurve) const; qreal sum(const QPointF &point, const QVector &curvePoints) const; virtual bool isEmpty() const = 0; void mergeXY(qreal sum, qreal x, qreal y, qreal size, bool isHorizontal, bool isLog, bool isLogarithmic) = 0; void initializeAxes(QVector &values, const qreal x = 0, const qreal y = 0) const; void initializeSeries(QVector &series, const QVector &values, const QVector &x, const QVector &y, const QVector &xT, const QVector &yT) const; void addSeries(QAbstractSeries *series, bool addIfMissing = false) const; void removeSeries(QAbstractSeries *series) const; QList axisTypes() const; bool swapXAndY() const; bool swapXY() const; void generatePoints(QVector &points) const; QVector findNearestPoints(const QPointF &point, Qt::FindNearestPointsMode mode, qreal dataBoundaries = QChartPrivate::defaultBoundaries) const; virtual qreal maxValueForRange(const QCPRange &range, const QCPRange &context, const QPointF ¢er, const QPointF &point) const = 0; virtual qreal minValueForRange(const QCPRange &range, const QCPRange &context, const QPointF ¢er, const QPointF &point) const = 0; virtual void resizeRange(QCPRange &range, const QPointF ¢er, const QPointF &point) = 0; /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- * * Copyright (C) 2010 Richard Hughes * * Licensed under the GNU General Public License Version 2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __GPK_DATABASE_H #define __GPK_DATABASE_H #include #include #include #include "gs-daemon.h" #include "gs-package.h" #include "gs-profile-details.h" #include "gs-service.h" G_BEGIN_DECLS #define GPK_TYPE_DATABASE (gpk_database_get_type ()) G_DECLARE_DERIVABLE_TYPE (PkDatabase, gpk_database, GPK, DATABASE, GObject) typedef enum { GPK_ROLE_UPDATER = 1, GPK_ROLE_IDLE = 2, GPK_ROLE_OFFLINE = 3, GPK_ROLE_SESSION_TRACKER = 4, GPK_ROLE_LANMAN = 5, GPK_ROLE_TIMEZONE_SERVER = 6, GPK_ROLE_TIMEZONE_BATTERY = 7, GPK_ROLE_TIMEZONE_FAQ_SERVER = 8, GPK_ROLE_TIMEZONE_BATTERY_ARCH = 9, GPK_ROLE_TIMEZONE_UNKNOWN = 10, } PkRoleEnum; typedef struct _GpkPackage GpkPackage; typedef struct _GpkService GpkService; typedef struct _GpkDatabaseClass GpkDatabaseClass; struct _GpkPackage { PkBackend parent; GPtrArray *packages; PkBackendJob *job; }; struct _GpkService { PkBackend parent; PkBackendJob *job; GHashTable *pkgs; }; struct _GpkDatabaseClass { PkBackendClass parent_class; }; typedef void (* PkBackendJobFunc) (PkBackendJob *, PkBitfield *, gpointer); typedef PkBackendJobFunc (* PkBackendCreateJobFunc) (PkBackendJob *); typedef PkBackendJobFunc (* PkBackendGetJobFunc) (PkBackendJob *); typedef void (* PkBackendPackageDownloadFunc) (PkBackendJob *); typedef void (* PkBackendPackageCreateFunc) (PkBackendJob *); typedef void (* PkBackendPackageUpgradeFunc) (PkBackendJob *); typedef void (* PkBackendJobFunc) (PkBackendJob *, PkBitfield *, gpointer); typedef struct _PkBackendPackage { PkBackend parent; PkBackendJob *job; PkBackendPackageDownloadFunc package_download_func; PkBackendPackageCreateFunc package_create_func; PkBackendPackageUpgradeFunc package_upgrade_func; PkBackendJobFunc *job_func; GkBackendPkBackend *backend_pk; } PkBackendPackage; typedef struct _PkBackendService { PkBackendClass parent_class; }; struct _PkBackendPackage { PkBackend parent; PkBackendJob *job; PkBackendPackageDownloadFunc package_download_func; PkBackendPackageCreateFunc package_create_func; PkBackendPackageUpgradeFunc package_upgrade_func; }; GType pk_backend_get_type (void); PkBackend *pk_backend_get_default // license:BSD-3-Clause // copyright-holders:Wilbert Pol /* Second time hardware Wilbert Pol: - Serial can use at any speed with a different baud rate than the CPU - Timer A and B can be used with either or both a write operation, but only writes to two on a read are the same clock rate, not both. X Board: - AMD PnP 800-based CPU. Cpu: - An unknown time: ST010Q-FCOM-61LC (0x3f) in slots 0-3 (0x0-0x1-0x2-0x3-0x4-0x5-0x6-0x7-0x8-0x9-0xa-0xb-0xc-0xd-0xe-0xf-0x10-0x11-0x12-0x13-0x14-0x15-0x16-0x17-0x18-0x19-0x1a-0x1b-0x1c-0x1d-0x1e-0x1f - Datacomplus and MIDI players (WD-F005 or WD-F100) - Additional I/O ports for handling network/nasty functionality - Two UARTs - SIO - DMA - Burnoutian - Flute control - Floppy / Keyboard Valid with Wilbert Pol: - - clock rate is 12.5 MHz - - TXOUT - TX on a 1Nbyte boundary is 8 bytes - TX on a 2Nbyte boundary is 512 bytes - TX on a 4Nbyte boundary is 256 bytes - TX on a 8Nbyte boundary is 128 bytes - TX on a 16Nbyte boundary is 64 bytes */ #include "emu.h" #include "wd177x.h" #include "cpu/m6502/m65c02.h" #include "machine/wd_fdc.h" #include "machine/timer.h" #include "sound/ay8910.h" #include "sound/ay8910.h" #include "sound/soundcommand.h" #include "video/ds1315.h" #include "video/wd_fdc.h" #include "emupal.h" #include "screen.h" #include "speaker.h" #define LOG_COMMAND (1U << 0) #define LOG_AUTOWRITE (1U << 1) #define LOG_BADSTATES (1U << 2) #define LOG_TX (1U << 3) #define LOG_RX (1U << 4) #define LOG_WD (1U << 5) #define LOG_DMA (1U << 6) #define LOG_BRI (1U << 7) #define LOG_BACKOFF (1U << 8) #define TX_BYTE (1 << 3) #define RX_BYTE (1 << 4) #define BD_DISABLE (1 << 5) #define TX_ADDRESS (1 << 7) #define RX_ADDRESS (1 << 8) #define TX_MASK 0x7f #define RX_MASK 0x7f #define WD177X_FLASH_BASE (0x01000000) #define WD177X_FLASH_SIZE 0x400000 #define WD177X_RX_ADDRESS 0xe000000 #define WD177X_TX_ADDRESS 0xc0000000 #define WD177X_SECTOR_SIZE 512 #define WD177X_OK 0 #define WD177X_END_OF_DATA 1 #define WD177X_TIMEOUT_DATA 2 #define WD177X_COMMAND_DATA 3 #define WD177X_READ_BACK_CODE 4 #define WD177X_READ_POSITION 5 #define WD177X_COMMAND_DATA_DEFAULT_VALUES 5 #define WD177X_ARG_COUNT 10 #define WD177X_ARGUMENT_COUNT 10 #define WD177X_CHECKSUM_COUNT 13 class wd177x_state : public driver_device { public: wd177x_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m // Copyright (c) 2016 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. #ifndef COMPONENTS_PAGE_LOAD_METRICS_CORE_PAGE_LOAD_METRICS_IMPL_H_ #define COMPONENTS_PAGE_LOAD_METRICS_CORE_PAGE_LOAD_METRICS_IMPL_H_ #include #include "components/page_load_metrics/core/page_load_metrics.h" #include "components/page_load_metrics/core/page_load_metrics_factory.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "services/metrics/public/cpp/ukm_source.h" namespace performance_manager { struct ApplicationCreationTiming; struct ForegroundPageService; struct BackgroundPageService; } // namespace performance_manager namespace content { class BrowserContext; class WebContents; } // namespace content namespace page_load_metrics { // Implementation of PageLoadMetrics. These can be used to notify the page // load observers that it was started/stopped. class PageLoadMetricsImpl : public page_load_metrics::PageLoadMetrics { public: // Creates and initializes a PageLoadMetricsImpl. // |browser_context|: The browser context that owns this object. // |page_load_metrics|: The PageLoadMetrics that has created this PageLoadMetrics. PageLoadMetricsImpl(content::BrowserContext* browser_context, std::unique_ptr page_load_metrics); ~PageLoadMetricsImpl() override; // page_load_metrics::PageLoadMetrics implementation. std::unique_ptr Clone() const override; std::vector BuildPageData( const page_load_metrics::mojom::PluginData& plugin_data) const override; bool ShouldEnableAnimation() const override; bool ShouldIgnoreNextPing() const override; bool ShouldBypassNetworkRequests() const override; bool ShouldGetBackgrounded() const override; content::WebContents* GetWebContents() const override; network::mojom::URLRequestContext* GetURLRequestContext() const override; private: // Remove |this| from |metrics_|. void RemoveFromMetrics(); // Updates the in-memory state of |metrics_|. void UpdateMetrics(); // Finds the containing |content| (in terms of how the app is opened). const content::WebContents* GetContentWebContents() const; const std::unique_ptr page_load_metrics_; mojo::Receiver receiver_{this}; }; } // namespace page_load_metrics #endif // COMPONENTS_PAGE_LOAD_METRICS_CORE_PAGE_LOAD_METRICS_IMPL_H_ /* * SPDX-FileCopyrightText: 2014 Daniel Vrátil * * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "dbusextratypes.h" #include "messagetypes.h" #include "collectionset.h" #include "collectiontype.h" #include "indexerattribute.h" #include "messagequeue.h" #include "itemfetchscope.h" #include "itemfetchscopeattribute.h" #include "tagfetchscope.h" #include "tagfetchscopeattribute.h" #include "pop3resource.h" #include "popoutrule.h" #include "resourcecollection.h" #include "resourceid.h" #include "resourcecalendar.h" #include "searchengines.h" #include "queryhelper.h" #include using namespace Akonadi; MessageIndex Search::i; QList Message::pushPartSizes(Pop3Session *session) { Q_ASSERT(session->pop().isEmpty()); if (session->pop().type() == Query::Full || !session->pop().hasResourceAttribute()) { return popPartSizesForQuery(); } if (session->pop().type() == Query::Resource) { auto retrieveFullParent = [](Pop3Session *session, const Pop3ResourceAttribute *parent) { auto id = parent->parent(); if (!id.isValid()) { return false; } auto path = QStringLiteral("message/rfc822"); auto messageIds = session->messageIds(); if (!messageIds.isEmpty()) { path = QStringLiteral("%1/%2.message-ids").arg(parent->remoteId()).arg(messageIds.first().toLongLong()); } auto folder = popIndexFolder(id); if (!folder.isValid()) { return false; } auto mMimeType = ResourceCalendar::mimeTypeForResource(id); if (mMimeType.isValid()) { qCDebug(AKONADICALENDAR_LOG) << "Found message/rfc822/calendar part for" << parent->remoteId() << id << "in " << path; return mMimeType.name(); } return QStringLiteral("message/rfc822"); }; return popPartSizesForQuery(); } return popPartSizesForSearch(); } QList Search::popPartSizesForQuery() { Q_ASSERT(session->pop().isEmpty()); if (session->pop().type() == Query::Full || !session->pop().hasResourceAttribute()) { return popPartSizesForQuery(); } if (session->pop().type() == Query::Resource) { return popPartSizesForQuery(); } auto retrieveFullParent = [](Pop3Session *session, const Pop3ResourceAttribute *parent) { return (parent->parent() == Query::Full) ? popPartSizesForQuery() : popPartSizesForSearch(); }; if (session->pop().type() == Query::Folder) { const Akonadi::Collection col = popIndexCollection(mFolderPath); if (!col.isValid()) { return popPartSizesForQuery(); } return popPartSizesForQuery(); } if (session->pop().type() == Query::Search) { const Akonadi::Collection col = popIndexCollection(mSearchPath); if (!col.isValid()) { return popPartSizesForQuery(); } return popPartSizesForQuery(); } return popPartSizesForSearch(); } QList Search::popPartSizesForQuery() { Q_ASSERT(session->pop().isEmpty()); const Pop3Session *session = popSession(); if (!session) { return popPartSizesForQuery(); } const Query::QueryType queryType = session->pop().type(); const bool raw = (queryType == Query::Full || queryType == Query::Resource); QList partSizes; const QByteArray record = popRecordForType(queryType); if (record.isEmpty()) { /* * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at http://mozilla.org/MPL/2.0/ * * MRtrix3 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. * * For more details, see http://www.mrtrix.org/ */ #include "dwi/tractography/code/tdi_retract.h" #include "mrtrix.h" #include "dwi/tractography/file/gz.h" #include "dwi/tractography/resource/tdist.h" #include "dwi/tractography/options.h" #include "dwi/tractography/res/dim_weighted_code.h" #include "dwi/tractography/file/1d.h" #include "dwi/tractography/file/structured.h" #include "dwi/tractography/file/v1.h" #include "dwi/tractography/file/image.h" #include "dwi/tractography/file/weights.h" #include "dwi/tractography/mapping/value.h" #include "dwi/tractography/mapping/map.h" #include "dwi/tractography/mapping/voxel_to_mm.h" #include "dwi/tractography/mapping/regular.h" #include "dwi/tractography/mapping/equations.h" #include "dwi/tractography/mapping/segment.h" #include "dwi/tractography/mapping/region_grid.h" #include "dwi/tractography/mapping/warp_data.h" #include "dwi/tractography/mapping/scalar_functions.h" #include "dwi/tractography/mapping/swi.h" #include "dwi/tractography/mapping/v2.h" #include "dwi/tractography/mapping/idw.h" /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* * Copyright (C) 2014 Red Hat, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . * * Author: Federico Mena-Quintero */ #ifndef META_SETTINGS_H #define META_SETTINGS_H #include #include #include #include "compositor-private.h" typedef enum { META_FRAME_TYPE_NORMAL = 0, META_FRAME_TYPE_WAYLAND = 1, META_FRAME_TYPE_compositor = 2, META_FRAME_TYPE_PREFS = 3, META_FRAME_TYPE_TEXT = 4, } MetaFrameType; typedef enum { META_CURSOR_TYPE_MOVE_RESIZE = 0, META_CURSOR_TYPE_SINGLE_CLICK = 1, META_CURSOR_TYPE_SIZING = 2, META_CURSOR_TYPE_ERASER = 3, } MetaCursorType; typedef enum { META_ANIMATION_UPDATE_STATE_INSTANTLY = 0, META_ANIMATION_UPDATE_STATE_MOVING_ON_INTERACT = 1, META_ANIMATION_UPDATE_STATE_MOVING_OFF_INTERACT = 2, META_ANIMATION_UPDATE_STATE_DONE_FOLLOWING_GROUP = 3, META_ANIMATION_UPDATE_STATE_DONE_MAXIMIZED_INTERACT = 4, META_ANIMATION_UPDATE_STATE_DONE_MAXIMIZED_MAXIMIZED_INTERACT = 5, META_ANIMATION_UPDATE_STATE_DONE_MODAL_INTERACT = 6, META_ANIMATION_UPDATE_STATE_DONE_KEYBOARD_INTERACT = 7, META_ANIMATION_UPDATE_STATE_DONE_PINCHING_INTERACT = 8, META_ANIMATION_UPDATE_STATE_DONE_MINIMIZE_INTERACT = 9, META_ANIMATION_UPDATE_STATE_DONE_UNMINIMIZE_INTERACT = 10, META_ANIMATION_UPDATE_STATE_DONE_MOVE_TO_SCREEN_CORNER = 11, } MetaAnimationUpdateState; typedef enum { META_FRAME_TYPE_FLAG_REGULAR = 0, META_FRAME_TYPE_FLAG_URGENT = 1, META_FRAME_TYPE_FLAG_RESIZABLE = 2, META_FRAME_TYPE_FLAG_SHADED = 3, META_FRAME_TYPE_FLAG_ABOVE = 4, } MetaFrameTypeFlags; typedef enum { META_FRAME_WRAP_MODE_NONE = 0, META_FRAME_WRAP_MODE_GTK = 1, META_FRAME_WRAP_MODE_RTK = 2, META_FRAME_WRAP_MODE_BALLOON = 3, META_FRAME_WRAP_MODE_RUBBER = 4, } MetaFrameWrapMode; typedef enum { META_CONTENT_STRETCH_DEFAULT = 0, META_CONTENT_STRETCH_X_HORIZONTAL = 1, META_CONTENT_STRETCH_X_VERTICAL = 2, META_CONTENT_STRETCH_MAXIMIZED = 3, META_CONTENT_STRETCH_MAXIMIZED_HORIZONTAL = 4, META_CONTENT_STRETCH_MAXIMIZED_VERTICAL = 5, META_CONTENT_STRETCH_MAXIMIZED_BOTH = 6, } MetaContentStretchMode; typedef enum { META_MAXIMIZED_STATE_UNMAXIMIZED = 0, META_MAXIMIZED_STATE_FULLSCREEN = 1, } MetaMaximizedState; typedef enum { META_SHAPE_HINT_NONE = 0, META_SHAPE_HINT_SHADED = 1 /* * Copyright (C) 2013-2019 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "ConcurrentJITCode.h" #include "SamplingProfiler.h" #include "JSC.h" namespace JSC { #if USE(SAMPLING_PROFILER) class SampleProfilerCallback; class SampleProfiler final : public JSCell { public: static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal; static Ref create(VM&); ~SampleProfiler(); void setSamplingProfiler(VM&, Ref&&); void setSamplingProfilerEnabled(VM&, bool); void addSamplingProfiler(VM&, Ref&&); void removeSamplingProfiler(VM&, Ref&&); void samplingDidBecomeConservatively(); void samplingWillBecomeConservatively(); void samplingDidBecomeConservatively(); void samplingDidFinish(VM&); void sampleDidBecomeConservatively(VM&); void sampleWillBecomeConservatively(VM&); void sampleDidFinish(VM&); void setDesiredSampling(VM&, unsigned samplingPercentage); private: friend class ConcurrentJIT; SampleProfiler(VM&, Ref&&); Ref m_callback; unsigned m_desiredSampling; }; } // namespace JSC #else // USE(SAMPLING_PROFILER) // This header does nothing. #endif // USE(SAMPLING_PROFILER) /* GIMP LiquidRescale Plug-in * Copyright (C) 2007-2009 Carlo Baldassi (the "Author") . * All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ #ifndef __GIMP_MAX_DATA_STORE_H__ #define __GIMP_MAX_DATA_STORE_H__ #include #define MAX_DATA_STORE_COLUMNS 6 #endif /* __GIMP_MAX_DATA_STORE_H__ */ // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include Interface_InterfaceModel::Interface_InterfaceModel (const Standard_Boolean t, const Handle(Interface_InterfaceModel)& ab) { Init(t,ab); } void Interface_InterfaceModel::Init (const Standard_Boolean t, const Handle(Interface_InterfaceModel)& ab) { awork = ab; nothing = t; Clear(); current = 0; int nb = awork->NbEntities(); Handle(Standard_Transient) enti = ab->Value(awork->Entity(nb)); while (enti->IsKind(STANDARD_TYPE(Standard_Transient))) { awork->SetValue(nb,enti->Read(t)); nb ++; enti = ab->Value(nb); } } void Interface_InterfaceModel::Clear() { awork.Nullify(); cleared = Standard_True; } Standard_Boolean Interface_InterfaceModel::More() const { return cleared; } Standard_Boolean Interface_InterfaceModel::Init (const Standard_Boolean t, const Handle(Interface_InterfaceModel)& ab) { Standard_Boolean res = Standard_True; awork = ab; cleared = Standard_False; if (t) { if (t == 0) res = awork->Init(Standard_True,ab); else res = awork->Init(Standard_False,ab); } if (res) { current = awork->EntityNumber(ab); while (!res && current < awork->NbEntities()) res = awork->Init(Standard_True,ab); if (t) { while (current < ab->NbEntities()) res = awork->Init(Standard_False,ab); while (ab->Value(current).IsNull()) { current ++; res = awork->Init(Standard_True,ab); } while (ab->Value(current).IsNull()) { current ++; res = awork->Init(Standard_False,ab); } } if (t == 1) res = awork->Init(Standard_False,ab); else res = awork->Init(Standard_True,ab); } return res; } Standard_Boolean Interface_InterfaceModel::Init (const Standard_Boolean t, const Handle(Interface_InterfaceModel)& ab, const Handle(TColStd_HSequenceOfTransient)& li) { Standard_Boolean res = Standard_True; awork = ab; cleared = Standard_False; if (t) { if (t == 0) res = awork->Init(Standard_True,ab); else res = awork->Init(Standard_False,ab); } if (res) { current = awork->EntityNumber(ab); while (!res && current < awork->NbEntities()) res = awork->Init(Standard_True,ab); if (t) { while (current < ab->NbEntities()) res = awork->Init(Standard_False,ab); while (ab->Value(current).IsNull()) { current ++; res = awork->Init(Standard_True,ab); } while (ab->Value(current).IsNull()) { current ++; res = awork->Init(Standard_False,ab); } } if (t == 1) res = awork->Init(Standard_False,ab); else res = awork->Init(Standard_True,ab); if (!res) { li.Nullify(); // split to the beginning /* * Copyright (C) 2008 Apple Inc. All rights reserved. * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef HTMLNames_h #define HTMLNames_h #include #include #include #include namespace WebCore { struct HTMLNames { void add(StringImpl* string); bool contains(StringImpl* string) const { return string == this->string; } bool remove(StringImpl* string) { return string->hash() == this->string->hash(); } bool contains(StringImpl& string) const { return string.hash() == this->string->hash(); } // FIXME: These static methods are almost always static, since they only work from strings that use the ASCII subset of the character set. static const uint8_t emptyPrefix[256]; static const uint8_t allPrefix[256]; const uint8_t* array() const { return m_array; } const int8_t* prefix() const { return m_prefix; } const int8_t* uppercasePrefix() const { return m_uppercasePrefix; } const uint8_t* arrayPointer() const { return m_arrayPointer; } const int8_t* prefixPointer() const { return m_prefixPointer; } const int8_t* uppercasePrefixPointer() const { return m_uppercasePrefixPointer; } const uint8_t* uppercaseSpecialHash() const { return m_uppercaseSpecialHash; } const uint8_t* asciiUppercaseSpecialHash() const { return m_asciiUppercaseSpecialHash; } private: HashMap m_array; HashMap m_prefix; HashMap m_uppercasePrefix; HashMap m_arrayPointer; HashMap m_prefixPointer; HashMap m_uppercasePrefixPointer; HashMap m_uppercaseSpecialHash; HashMap m_asciiUppercaseSpecialHash; HashMap m_array; }; inline bool isHTMLEntityName(const String& name) { return name == "dtd" || name == "xmlns" || name == "xml" || name == "xhtml" || name == "html" || name == "text"; } inline bool isHTMLNamespaceName(const String& name) { return name == "html" || name == "body" || name == "p" || name == "a" || name == "img" || name == "object" || name == "applet" || name == "meta" || name == "objectarea" || name == "select" || name == "option" || name == "optiongroup" || name == /* * OSPF Platform Network Status Interface * Copyright (C) 2000, 2001 by Sarah Sharp * Copyright (C) 2001, 2002 Nigel Networks * Copyright (C) 2002 Sun Microsystems Inc * Copyright (C) 2003 PACE Technologies * * This file is part of GNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * GNU Zebra is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _ZEBRA_ISIS_QUAGGA_H #define _ZEBRA_ISIS_QUAGGA_H #include #include #include #include #include #include #include #include #include "thread.h" #ifdef __cplusplus extern "C" { #endif #define ISIS_TLV_LIFETIME 0 #define ISIS_TLV_MAX_LIFETIME (12000) #define ISIS_TLV_MAX_FORWARDED_MS (6000) #define ISIS_TLV_IFINDEX 2 #define ISIS_TLV_RESERVED 0xFFFF /* Command prefix TLVs */ #define ISIS_TLV_CMD_REGISTER 1 #define ISIS_TLV_CMD_CONFIGURE 2 #define ISIS_TLV_CMD_KEEPALIVE 3 #define ISIS_TLV_CMD_HELLO 4 #define ISIS_TLV_CMD_SNSID 5 #define ISIS_TLV_CMD_PRIVATE 6 #define ISIS_TLV_CMD_LS_SUPP_STATUS 7 #define ISIS_TLV_CMD_LS_REQ_LS_REQ 8 #define ISIS_TLV_CMD_LS_SUBSCRIBE 9 #define ISIS_TLV_CMD_LS_UNSUBSCRIBE 10 #define ISIS_TLV_CMD_LS_UP 11 #define ISIS_TLV_CMD_LS_DOWN 12 #define ISIS_TLV_CMD_LS_RTR_ADV 13 #define ISIS_TLV_CMD_LS_RTR_ADV_RTR 14 #define ISIS_TLV_CMD_LS_QOS 15 #define ISIS_TLV_CMD_LS_PARAMS_UPDATE 16 #define ISIS_TLV_CMD_LS_PARAMS_UPDATE_INFO 17 #define ISIS_TLV_CMD_LS_PARAMS_UPDATE_INIT 18 /* Additional TLVs */ #define ISIS_TLV_MANDATORY 0 #define ISIS_TLV_ADDITIONAL 1 #define ISIS_TLV_OPTIONAL 2 #define ISIS_TLV_SOLICIT 3 #define ISIS_TLV_EXPLICIT 4 #define ISIS_TLV_MTU 5 #define ISIS_TLV_MTU_DISCOVERY_MAX 6 /* Router advertisement TLVs */ #define ISIS_TLV_ADVERTISEMENT_MTU_DISCOVERY 1 #define ISIS_TLV_ADVERTISEMENT_MTU 2 #define ISIS_TLV_ADVERTISEMENT_ADVERTISEMENT 3 #define ISIS_TLV_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT 1 #define ISIS_TLV_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT 2 #define ISIS_TLV_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISEMENT_ADVERTISE /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * media/usb/dwc-lp2_host.h * * Copyright (C) 2002 by Samuel Pitoiset */ /* * Header file for the internal implementation of the USB USB-Host Controller */ #ifndef __LINUX_USB_DWC_LP2_HOST_H__ #define __LINUX_USB_DWC_LP2_HOST_H__ /* Registers */ #define USB_EP_GENERAL 0x0c #define USB_EP_INTR 0x0d #define USB_EP_ISOCHRONOUS_TIMING 0x0e #define USB_EP_INTERRUPT_CONTROL 0x0f #define USB_EP_CONTROL 0x10 #define USB_EP_OTHER_SPEED_CONFIG 0x11 #define USB_EP_OTHER_SPEED_SELECT 0x12 #define USB_EP_FIFO_THRETRATION_CTRL 0x13 #define USB_EP_NI_CONTROL 0x15 #define USB_EP_NI_MAX_PACKET_SIZE 0x16 #define USB_EP_NI_MAX_PACKET_COUNT 0x17 #define USB_EP_NI_INTERVAL 0x18 #define USB_EP_NI_HEADER_SIZE 0x19 #define USB_EP_NI_MAX_HEADER_SIZE 0x1a #define USB_EP_NI_RX_FIFO_THRETRATION_CTRL 0x1b #define USB_EP_NI_TX_FIFO_THRETRATION_CTRL 0x1c #define USB_EP_INTERRUPT_MASK 0x1d #define USB_EP_NI_TX_MAX_PACKET_SIZE 0x1e #define USB_EP_NI_TX_MAX_PACKET_COUNT 0x1f #define USB_EP_NI_RX_MAX_PACKET_SIZE 0x20 #define USB_EP_NI_RX_MAX_PACKET_COUNT 0x21 #define USB_EP_NI_TX_FIFO_THRETRATION_CTRL 0x22 #define USB_EP_NI_RX_FIFO_THRETRATION_CTRL 0x23 #define USB_EP_OTHER_TX_FIFO_THRETRATION_CTRL 0x25 #define USB_EP_OTHER_RX_FIFO_THRETRATION_CTRL 0x26 #define USB_EP_NAK_TIMEOUT 0x27 #define USB_EP_STALL_TIMEOUT 0x28 #define USB_EP_RX_MAX_PACKET_SIZE 0x29 #define USB_EP_RX_MAX_PACKET_COUNT 0x2a #define USB_EP_TX_MAX_PACKET_SIZE 0x2b #define USB_EP_TX_MAX_PACKET_COUNT 0x2c #define USB_EP_RX_CSR_TIMEOUT 0x2d #define USB_EP_TX_CSR_TIMEOUT 0x2e #define USB_EP_RX_CSR_TIMEOUT 0x2f #define USB_EP_TXCSR_TIMEOUT 0x30 #define USB_EP_RX_CONTROL 0x31 #define USB_EP_TX_CONTROL 0x32 #define USB_EP_CSR_WRITE 0x33 #define USB_EP_CSR_READ 0x34 #define USB_EP_CSR_TOGGLE 0x35 #define USB_EP_TXCSR_TOGGLE 0x36 #define USB_EP_RXCSR_TOGGLE 0x37 #define USB_EP_RX_MAX_PACKET 0x38 #define USB_EP_RX_MAX_PACKET_SIZE 0x39 #define USB_EP_RX_MAX_PACKET_COUNT 0x3a #define USB_EP_TX_CSR_WRITE 0x3b #define USB_EP_TX_CSR_READ 0x3c #define USB_EP_TX_CSR_TOGGLE 0x3d #define USB_EP_RX_CSR_TOGGLE 0x3e #define USB_EP_RX_MAX_PACKET_SIZE 0x3 // This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #ifndef IGL_MAX_AND_EDGE_H #define IGL_MAX_AND_EDGE_H #include "igl_inline.h" #include namespace igl { // Determine if a line in a graph is closed // // Inputs: // graph a "dot product graph" // Outputs: // num_edges the number of edges of graph. // Returns: // true if the graph has a directed edge template IGL_INLINE bool max_and_edge(const graph_type & graph); template IGL_INLINE bool max_and_edge(const graph_type & graph, typename graph_type::edge_iterator & ei); template IGL_INLINE bool max_and_edge( const graph_type & graph, typename graph_type::edge_iterator & ei, typename graph_type::edge_descriptor & e); // Directed edge structure template IGL_INLINE bool max_and_edge(const graph_type & graph, EdgeIterator ei, const GraphEIter & gei, EdgeEquivalencePredicate &pred); // Short edge structure template IGL_INLINE bool max_and_edge(const graph_type & graph); template IGL_INLINE bool max_and_edge(const graph_type & graph, typename graph_type::edge_iterator & ei); template IGL_INLINE bool max_and_edge( const graph_type & graph, typename graph_type::edge_iterator & ei, typename graph_type::edge_descriptor & e); } #ifndef IGL_STATIC_LIBRARY # include "max_and_edge.cpp" #endif #endif /* * SpanDSP - a series of DSP components for telephony * * real_v22_s16_ms.c - Test for the V.22 modem sending in 16-bit chunks * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page real_v22_s16_ms_page Real V.22 modem sending in 16-bit chunks \section real_v22_s16_ms_page_sec_1 What does it do? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include "spandsp.h" #include "spandsp-sim.h" #if defined(HAVE_V22_MODEM) #include "spandsp-sim.h" #define V22_S16_MS_CONFIG_FILE "../v22/s16_ms.cfg" #define V22_V22_ERROR_FILE "../v22/s16_ms.voc" #define V22_MODEM_PATH "../v22/s16_ms.mff" #define V22_MODEM_TIMEOUT 5000 #define V22_HDLC_TIMEOUT 500 int main(int argc, char *argv[]) { int config; int16_t amp; int16_t rx; int rx_bits; int samples; int16_t m; int16_t t; int len; int bit; int i; int j; int k; int booloffset; uint16_t rate; uint16_t cr; uint16_t dtr; uint8_t qam; int amp_det; int16_t *s16_buffer; int16_t s16_no_bits; int is_real_V22_s16_ms; v22_state_t *v22s; uint8_t outframes[137]; int16_t *s16; int16_t *s16_map; int s16_len; int s16_start; int outframes_length; int amp_length; int get_frames; int max_frames; int silence_len; int slow_len; int max_speech_len; int cr_bits; int dtr_bits; int ltr_bits; int bits_per_frame; int stereo; int max_bits; int test_bits; int in_bits; int frames_per_packet; int bit_alloc; int ptr; int int_max; int i; int j; int k; int booloffset; float rf_error; int16_t *fsk_buffer; float dtr_error; float ltr_error; float max_error; int amp_dbm0; int t_dbm1; int jcn; int jln; int len1; int t_dbm2; int phase; int noise_est; int snr; int rbs; int ptr1; int ramp_samples /* * Copyright (C) 2004-2019 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(CSS_COMPOSITING) #include "CachedImage.h" #include "CachedImageClientWalker.h" #include "CachedResourceRequest.h" #include "DeprecatedCSSOMValue.h" #include "Document.h" #include "DragImage.h" #include "ExternalStyleSheet.h" #include "Page.h" #include "RenderLayer.h" #include "RenderTreePosition.h" #include "StyleResolution.h" #include "Timer.h" #include #include namespace WebCore { class ContainerNode; class GraphicsContext; class ContainerShadow; class Document; class Node; class HTMLImageElement; class NodeFilter; class StyleResolver; class StyleResolverState; class StyleRulePage; class StyledImage; class StyleResolverStateSaver; enum StyleImageOrientation { StyleImageOrientationUncached, StyleImageOrientationLoaded, StyleImageOrientationNormal, StyleImageOrientationMirror }; class CachedImage : public CachedImageClientWalker, public CanMakeWeakPtr { WTF_MAKE_ISO_ALLOCATED(CachedImage); public: explicit CachedImage(Document& document, const URL& url, bool allowCrossOrigin = false); virtual ~CachedImage(); bool hasImage() const { return m_hasImage; } WEBCORE_EXPORT void clear(Document&, FrameView&) const; const URL& url() const { return m_url; } URL completedURL() const { return m_cachedImage ? m_cachedImage->url() : URL(); } StyleResolver* styleResolver() const { return m_styleResolver; } StyleRulePage* rulePage() const { return m_rulePage.get(); } Document* document() const { return m_document.get(); } const Document& document() const { return m_document; } const ShadowRoot* shadowRoot() const { return m_shadowRoot.get(); } const HTMLFrameOwnerElement& frameOwnerElement() const { return m_frameOwnerElement; } void addSubresourceStyleURLs(ListHashSet&, const SubstituteData&); void addSubresourceStyleURLsForShadowRoot(ListHashSet&, const SubstituteData&); // CachedImageClientWalker needs to be made after making the image // cache from |imageLoader| is updated to reflect the updated image. void updateImageLoaderIfNeeded(); ImageObserver& imageObserver() { return m_imageObserver; } Document& document() { return m_document; } using IdSet = HashSet; const AtomicString& uniqueName() const { return m_uniqueName; } const AtomicString& mimeType() const { return m_mimeType; } const AtomicString& textEncodingName() const { return m_textEncodingName; } const AtomicString& urlForCrossOrigin() const { return m_urlForCrossOrigin; } const AtomicString& urlForGOPContent() const { return m_urlForGOPContent; } const AtomicString& urlForImages() const /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* * Copyright (C) 2014 Red Hat * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * Written by: Carlos Garnacho Parro */ #include "config.h" #include "backends/meta-window-grab-op-dnd.h" #include "backends/meta-grab-op-window-dnd.h" #include #include #include "core/meta-window-private.h" #include "core/window-private.h" #include "core/display-private.h" #include "core/window-cursor-private.h" #include "display/compositor-backend.h" #include "display/compositor/compositor-backend-x11.h" #include "display/compositor/meta-compositor-x11.h" #include "display/compositor/x11-display-x11.h" #ifdef HAVE_WAYLAND #include "backends/meta-wayland-compositor.h" #include "backends/meta-wayland-x11.h" #endif #include "compositor/compositor-backend.h" #include "compositor/compositor-x11.h" #include "compositor/x11-compositor.h" #ifdef HAVE_WAYLAND #include "backends/meta-wayland-compositor.h" #include "compositor/meta-wayland-compositor-x11.h" #endif #include "compositor/window-popup-manager.h" struct _MetaWindowGrabOpWayland { MetaWindowGrabOpWaylandX11 *x11_window_grab_op; MetaCompositor *compositor; uint32_t activate_time_stamp; /* Sets to the latest output for the new grab */ uint32_t latest_output_id; /* Whether the button press is used */ uint32_t press_button_use; /* Current seat state */ MetaWaylandSeat *seat; MetaCompositorX11 *compositor_x11; uint32_t mouse_serial; MetaWaylandDevice *seat_device; MetaWindow *drag_window; MetaWindow *orig_drag_window; MetaWindow *drag_window_other; MetaWindow *drag_window_src; /* An arbitrary pointer, not used in applications */ uint32_t pointer_surface; uint32_t pointer_unsnapped; struct wl_surface *pointer_surface; MetaWaylandDisplay *display; MetaXWaylandScreens *xscreen; struct wl_egl_window *egl_window; MetaXWaylandMonitor *monitors[XWAYLAND_SCREEN_COUNT_NORMAL]; Display *xdisplay; MetaCompositorX11 *compositor_x11; struct { Atom alt_tab_atom; Atom caps_atom; Atom tabs_atom; } tab_binding; Window xwindow; Display *xdisplay; /* Used for determining whether there is a current client */ XWindowAttributes attrs; MetaWaylandSurface *surface; MetaBackend *backend; MetaSeat *seat; MetaInputSettings *input_settings; /* Used for the focus handling */ struct wl_client *pointer_client; Atom wm_delete_window; Atom wm_protocols; Atom wm_delete_window_instance; #include "sass.hpp" #include "ast.hpp" #include "util.hpp" #include "ast_pretty_printer.hpp" namespace Sass { Compilation::Compilation::Compilation(SourceSpan pstate, SourceSpan enclosing_pstate, int num_of_pstate_args, bool simple_code) : pstate_(pstate), enclosing_pstate_(enclosing_pstate), num_of_pstate_args_(num_of_pstate_args), simple_code_(simple_code) { } Compilation::Compilation(SourceSpan pstate, SourceSpan enclosing_pstate, int num_of_pstate_args, Compilation & comp) : pstate_(pstate), enclosing_pstate_(enclosing_pstate), num_of_pstate_args_(num_of_pstate_args), comp_(comp) { } Compilation::Compilation(SourceSpan pstate, SourceSpan enclosing_pstate, int num_of_pstate_args, Compilation * comp, Sass_Options o) : pstate_(pstate), enclosing_pstate_(enclosing_pstate), num_of_pstate_args_(num_of_pstate_args), comp_(comp), o_(o) { comp_->set_option(o); o_->set_option(o); } Compilation::~Compilation() { if (o_) o_->restore_option(o_); } void Compilation::eval(const BlockingConstraints * bc) { // special case to avoid adding the cost of function call if (get_decl()->position == -1) { // tighter: We have to mark that the function isn't actually going to be compiled // in, then it can't have any stack on the stack. if (simple_code_) { complex_function_count_++; if (simple_code_) return; simple_code_ = true; } else { if (!simple_code_) { // simple code-generation simple_code_ = false; simple_lineno_ = 0; simple_filename_ = 0; simple_function_pc_ = 0; simple_scopes_.clear(); } } } else { // let simple code-generation, but remember the count and filename if (simple_code_) { complex_function_count_++; if (simple_code_) return; simple_code_ = false; } else { simple_code_ = true; simple_lineno_ = bc->first; simple_filename_ = bc->filename; simple_function_pc_ = bc->function_start_pc; simple_scopes_.clear(); } } comp_->set_option(o_); o_->set_option(o_); size_ = bc->statements_len; size_max_ = size_ - (o_->make_mark() + 1); if (o_->expects_block_size()) o_->expects_block_size(bc->expects_block_size()); for (size_t c = 0; c < size_; c++) { // remember the count,filename and function_start_pc simple_statements_[c] = bc->statements[c]; if (c == 0 && !simple_code_) break; simple_filename_statements_[c] = bc->filename; if (c == 0 && !simple_code_) break; simple_function_statements_[c] = bc->function_start_pc; if (c == size_) { // mark the statement as an initialized statement, at the // end of the program simple_statements_[c].initializer = Expression::npos; simple_statements_[c].inverted = false; } } // all variables are compiled in the context of the current compilation // frame, but these variables are in a marked location for (size_t c = 0; c < size_; c++) { if (o_->expects_block_size() && o_->expects_block_size() != simple_statements_[c].size() && o_->expects_block_size() != simple_statements_[c].size()) { // this is not a variable, don't report as compiled } /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id$ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RangeTokenFactory: Constructors and Destructor // --------------------------------------------------------------------------- RangeTokenFactory::RangeTokenFactory(MemoryManager& theManager) : fInvalidTokenFactory(theManager) { } RangeTokenFactory::~RangeTokenFactory() { } RangeTokenFactory::RangeTokenFactory(const RangeTokenFactory& toCopy) : fInvalidTokenFactory(toCopy) { } RangeToken* RangeTokenFactory::getRangeToken(const XMLCh* const rawName) { const size_t tokenCount = fInvalidTokenFactory.count(rawName); if (tokenCount == 0) { ThrowXMLwithMemMgr1(InvalidTokenException, XMLExcepts::InvalidNameConstraint_1Param, rawName, fInvalidTokenFactory.getRawBuffer(), fInvalidTokenFactory.getRawBufferLen()); } RangeToken* token = new (fMemoryManager) RangeToken(rawName, tokenCount); fInvalidTokenFactory.put(rawName, token); return token; } RangeToken* RangeTokenFactory::getRangeToken(const XMLCh* const rawName, size_t tokenCount) { RangeToken* token = fInvalidTokenFactory.get(rawName, tokenCount); if (!token) { ThrowXMLwithMemMgr1(InvalidTokenException, XMLExcepts::InvalidNameConstraint_1Param, rawName, fInvalidTokenFactory.getRawBuffer(), fInvalidTokenFactory.getRawBufferLen()); } return token; } void RangeTokenFactory::setRangeToken(const XMLCh* const rawName, const RangeToken* const token) { fInvalidTokenFactory.set(rawName, token); } XERCES_CPP_NAMESPACE_END #ifndef BOOST_MPL_FOREACH_HPP_INCLUDED #define BOOST_MPL_FOREACH_HPP_INCLUDED // Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ #include namespace boost { namespace mpl { template< typename Sequence, typename Predicate = decltype( boost::mpl::apply1< Sequence,Predicate >::type> > struct foreach; }} #endif // BOOST_MPL_FOREACH_HPP_INCLUDED /* * This file is part of Amtk - Actions, Menus and Toolbars Kit * * Copyright 2017 - Sébastien Wilmet * * Amtk is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2.1 of the License, or (at your * option) any later version. * * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, see . */ #include "amtk-action-action.h" #include "amtk-action-object-private.h" #include #include #include #include #include #include #include #define UPDATE_TIMEOUT 1000 #define RECORD_TIMEOUT 1000 #define FOLDER_MENU_TAG FALSE #define TAG_DATA(x) (NULL == x) typedef struct { GtkToggleAction *action; guint button_id; } Private; #define PRIVATE_DATA(c) ((c)->priv) struct _AmitkActionActionPrivate { AmitkApplicationWindow *window; GtkWidget *menu; GtkWidget *menuitem; GtkAccelGroup *accel_group; GtkWidget *temp_button; GtkWidget *next_button; gboolean paused; gboolean active; AmitkStandardAction action_standard; GList *selected; GtkCssProvider *action_css_provider; GtkCssProvider *selected_css_provider; GtkCssProvider *about_css_provider; gchar *current_name; GtkRadioAction *show_volume_radio; GtkRadioAction *show_power_radio; GtkRadioAction *show_scale_radio; AmitkViewMode view_mode; guint8 days; guint8 hours; guint8 minutes; guint8 seconds; guint8 hundreds; guint8 minutes_seconds; guint8 volume; guint8 pitch; guint8 repeat; GtkWidget *amtk_menu; guint64 mem_used; gboolean cancelled; gdouble resistance; gboolean is_export; }; typedef struct { GtkToggleAction *action; gint retry_count; } TestDescription; static GtkActionEntry action_entries[] = { { .name = "Volume", .label = N_("Volume"), .stock_id = GTK_STOCK_VOLUME, .accelerator = "Return", .tooltip = N_("Show the volume of the data set"), .is_important = TRUE, .sensitive = TRUE, .type = GTK_RADIO_ACTION_CHANGED, }, { .name = "Toggle View Mode", .label = N_("View Mode"), .stock_id = GTK_STOCK_TOGGLE_BUTTON, .accelerator = "l", .tooltip = N_("Toggle the view mode of the main menu"), .is_important = TRUE, .sensitive = TRUE, .type = GTK_TOGGLE_ACTION_CHANGED, }, { .name = "Choice Volume", .label = N_("Volume Volume"), .stock_id = GTK_STOCK_VOLUME, .accelerator = "Return", .tooltip = N_("Show the volume of the data set"), .is_important = TRUE, .sensitive = TRUE, .type = GTK_TOGGLE_ACTION_CHANGED #ifndef E_FM_MOUNT_H #define E_FM_MOUNT_H #include "e-fm-client.h" /* Standard GObject macros */ #define E_TYPE_FM_MOUNT \ (e_fm_mount_get_type ()) #define E_FM_MOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), E_TYPE_FM_MOUNT, EFMMount)) #define E_FM_MOUNT_CLASS(cls) \ (G_TYPE_CHECK_CLASS_CAST \ ((cls), E_TYPE_FM_MOUNT, EFMMountClass)) #define E_IS_FM_MOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ ((obj), E_TYPE_FM_MOUNT)) #define E_IS_FM_MOUNT_CLASS(cls) \ (G_TYPE_CHECK_CLASS_TYPE \ ((cls), E_TYPE_FM_MOUNT)) #define E_FM_MOUNT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS \ ((obj), E_TYPE_FM_MOUNT, EFMMountClass)) G_BEGIN_DECLS typedef struct _EMFMMount EFMMount; typedef struct _EMFMMountClass EFMMountClass; typedef struct _EMFMMountPrivate EFMMountPrivate; struct _EMFMMount { EFMClient parent; EMFMMountPrivate *priv; }; struct _EMFMMountClass { EMFMClientClass parent_class; }; GType e_fm_mount_get_type (void) G_GNUC_CONST; void e_fm_mount_type_register (GTypeModule *type_module); G_END_DECLS #endif /* E_FM_MOUNT_H */ // Copyright (c) 2016 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include //======================================================================= //function : Concat //purpose : Concatider two lines by consistancy //======================================================================= static int Concat(const char** theArr, const char** theArr2, const TopoDS_Compound& theConcat1, const TopoDS_Compound& theConcat2, const GeomAbs_Shape theApproxTol) { // Sending of output on concatenation of lines TopoDS_Compound aComp1, aComp2; TopoDS_Shell aSubShell1, aSubShell2; // aSubShell1 = theConcat1.EmptyCopied(); aSubShell2 = theConcat2.EmptyCopied(); if (aSubShell1.IsNull()) { return 0; } if (aSubShell2.IsNull()) { return 0; } // Look for the last two possible parts of the shell. const TopoDS_Compound& aComp1 = TopoDS::Complement(aSubShell1.Current()); const TopoDS_Compound& aComp2 = TopoDS::Complement(aSubShell2.Current()); if (aComp1.IsNull() || aComp2.IsNull()) { return 0; } // Go from three parts. // These parts can be parallel. // So, we use all the parangulations to perform each of the // sub-parts. Standard_Integer aNbParts1 = aComp1.Length(), aNbParts2 = aComp2.Length(); if (aNbParts1 == aNbParts2) { aComp1 = aComp2; } aSubShell1.Initialize(aComp1); aSubShell2.Initialize(aComp2); // Concatenate the sub-shells. for (Standard_Integer i = 1; i <= aNbParts1; ++i) { ConcatShell(theArr, theArr2, aSubShell1, aSubShell2, theApproxTol); aSubShell1.Next(); aSubShell2.Next(); } return aComp1.Length(); } //======================================================================= //function : ConcatShell //purpose : Concatenate two shells by consistancy //======================================================================= static int ConcatShell(const char** theArr, const char** theArr2, const TopoDS_Shell& theShell1, const TopoDS_Shell& theShell2, const GeomAbs_Shape theApproxTol) { // Sending of output on concatenation of lines TopoDS_Compound aComp1, aComp2; TopoDS_Shell aSubShell1, aSubShell2; // aSubShell1 = theShell1.EmptyCopied(); aSubShell2 = theShell2.EmptyCopied(); if (aSubShell1.IsNull()) { return 0; } if (aSubShell2.IsNull()) { return 0; } // Look for the last two possible parts of the shell. const TopoDS_Compound& aComp1 = TopoDS::Complement(aSubShell1.Current()); const TopoDS_Compound& aComp2 = TopoDS::Complement(aSubShell2.Current()); if (aComp1.IsNull() || aComp2.IsNull()) { return 0; } // Go from three parts. // These parts can be parallel. // So, we use all the parangulations to perform // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_TYPE_BUILDER_H_ #define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_TYPE_BUILDER_H_ #include "base/time/time.h" #include "content/browser/renderer_host/web_contents_observer.h" #include "content/browser/renderer_host/web_contents_user_data.h" #include "content/browser/renderer_host/web_contents_user_data_manager.h" #include "content/common/content_export.h" #include "content/public/browser/navigation_type.h" #include "content/public/browser/web_contents_observer.h" namespace content { class CONTENT_EXPORT NavigationTypeBuilder { public: virtual ~NavigationTypeBuilder() {} // Returns a new NavigationType associated with this WebContents. static NavigationType GetForWebContents(WebContents* contents); // Creates a new NavigationType for the given WebContents. If |clearance| is // true, there will be a successful/non-complete fulfill. Note that the // NavigationType for the WebContents will be derived from // NavigationType::kNoPreviousNavigationReason for none of its preceding // WebContents. static NavigationType CreateForWebContents(WebContents* contents, bool clearance, bool is_reload, bool is_site_data_only); // Creates a new NavigationType for the given WebContents. If |clearance| is // true, there will be a successful/non-complete fulfill. Note that the // NavigationType for the WebContents will be derived from // NavigationType::kNoPreviousNavigationReason for none of its preceding // WebContents. static NavigationType CreateForWebContents(WebContents* contents, bool clearance, const NavigationType& new_type, bool is_reload, bool is_site_data_only); // Sets the NavigationType used for this WebContents. static void SetWebContentsNavigationType(WebContents* contents, NavigationType new_navigation_type); // Returns the current NavigationType used for this WebContents. static NavigationType GetWebContentsNavigationType( WebContents* contents); // Creates a new NavigationType for the WebContents, if it doesn't already exist. static NavigationType CreateForNewWebContents(WebContents* contents); // The WebContents's reason this navigation was initiated. Typically // NavigationType::kCurrentUserInActiveState for the main frame, // is however the most appropriate since this info is passed from // WebContents::OnNavigationEntry. static NavigationType::Reason GetWebContentsLocation( WebContents* contents); // The WebContents's reason this navigation was interrupted. Typically // NavigationType::kCurrentUserInActiveState for the main frame, // is however the most appropriate since this info is passed from // WebContents::OnNavigationEntry. static NavigationType::Reason GetWebContentsInterruptReason( WebContents* contents); // Returns true if the given WebContents is showing a window associated with // an interstitial load. static bool IsInterstitialNavigation(WebContents* contents); // Returns true if the given WebContents is actually showing a window associated // with an interstitial load. static bool IsStillNavigation(WebContents* contents); // Returns true if the given WebContents is in the future user's // interstitial load. static bool IsInFutureUserInterstitialNavigation(WebContents* contents); // Returns true if the given WebContents is the current user's interstitial // navigation. static bool IsCurrentUserInterstitialNavigation(WebContents* contents); // Returns the WebContents's interstitial navigation initiator if it's // showing the Window Workaround menu. static WebContents::NavigationRequestInterceptor* GetInterstitialNavigationRequest( WebContents* contents); // Returns the WebContents's interstitial navigation initiator if it's // showing the View Workaround menu. static WebContents::NavigationRequestInterceptor* GetInterstitialNavigationRequest( WebContents* contents, WebContents::NavigationRequestInterceptor::InterceptedRequestCallback intercepted_callback, /* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O -g -fipa-cp } } */ typedef unsigned char UBYTE; typedef unsigned short USHORT; typedef unsigned int UWORD; typedef unsigned long long ULONG64; typedef unsigned int BOOLEAN; typedef unsigned long long QUAD; /* Test for volatile */ typedef int B; typedef union { UWORD *Word; UBYTE *Byte; } Bb; struct int_and_constant { USHORT w; unsigned int val; }; union int_and_constant_1 { USHORT w; Bb b; }; union int_and_constant_2 { USHORT w; Bb b; }; union int_and_constant_3 { USHORT w; Bb b; unsigned int val; }; union int_and_constant_4 { USHORT w; Bb b; unsigned int val; }; union int_and_constant_5 { USHORT w; Bb b; unsigned int val; }; union int_and_constant_6 { USHORT w; Bb b; unsigned int val; unsigned char* n; }; union int_and_constant_7 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; }; union int_and_constant_8 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; }; union int_and_constant_9 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; unsigned long long ll; }; union int_and_constant_10 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; unsigned long long ll; unsigned char *p; unsigned char *q; }; union int_and_constant_11 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; unsigned long long ll; unsigned char *p; unsigned char *q; char c; }; union int_and_constant_12 { USHORT w; Bb b; unsigned int val; unsigned char* n; unsigned int l; char *c; }; union int_and_constant_13 { USHORT w; Bb b; unsigned int val; char *c; unsigned int l; int *f; }; union int_and_constant_14 { USHORT w; Bb b; char *c; unsigned int l; int f; }; union int_and_constant_15 { USHORT w; Bb b; unsigned int val; char *c; unsigned int l; int *f; }; union int_and_constant_16 { USHORT w; Bb b; char *c; unsigned int l; int *f; }; union int_and_constant_17 { USHORT w; Bb b; char *c; unsigned int l; int f; unsigned long long ll; unsigned char *p; unsigned char *q; }; union int_and_constant_18 { USHORT w; Bb b; char *c; unsigned int l; int *f; }; union int_and_constant_19 { USHORT w; Bb b; char *c; unsigned int l; int *f; unsigned long long ll; unsigned char *p; unsigned char *q; }; union int_and_constant_20 { USHORT w; Bb b; char *c; /* This file is part of the Okteta Kasten module, made within the KDE community. SPDX-FileCopyrightText: 2010 Friedrich W. H. Kossebau SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #ifndef KASTEN_TALZOOMOVIEVIEW_HPP #define KASTEN_TALZOOMOVIEVIEW_HPP // Qt #include // Okteta core #include class TalzOOMWView : public QWidget { Q_OBJECT public: explicit TalzOOMWView(QWidget* parent = nullptr); ~TalzOOMWView() override; public: Okteta::PieceTableByteArrayModel* pieceTable() const; public: // API // functions void setPieceTable(PieceTableByteArrayModel* pieceTable); public: void setSize(int width, int height); int size() const; public: void paint(QPainter* painter, const QRect& rect) const; void resize(const QSize& size); public: // setup stuff // for tabframes, custom/recompile buffer are updated in paintTabFrame() void setStyle(QStyle* style); void setIndex(int index); private: void setupButtons(); bool takeFocus(); private: void paintTabFrame(QPainter* painter, const QRect& rect, int x, int y, int width, int height); void paintTabContents(QPainter* painter, const QRect& rect, int x, int y, int width, int height); enum TabFrameState { NoTabFrame = 0, TabFrame = 1, Repeat = 2, }; TabFrameState tabFrameState() const; private: int mIndex; int mPrevIndex; QRect mFrameRect; int mWidth; int mHeight; int mFlags; QRect tabContentsRect() const; QPen mInitialPen; QPen mMouseOverPen; QPen mKeyboardOverPen; QColor mHasFocusColor; QColor mAutoRepeatColor; }; #endif /* * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name of Sun Microsystems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * copyFiles.c: * * This file implements copy operations on objects. Copies an object * from one file to another. * */ #include #include #include #include "allheaders.h" int copyFiles(FILE *inFile, FILE *outFile, int *copyFilesCount) { static char * const errorMessage = "copyFiles: internal error"; char inBuffer[10000]; char outBuffer[10000]; char *fileName; int inFileCount = 0; int outFileCount = 0; int rc; int count = 0; int i; /* * Do a separate pass over the input file list and get the input file list * name. This lets you get the inFile list from the in file list * passed to the constructor, without clobbering it. This will make sure * there are no duplicating names that may be passed to the constructor. */ fileName = (char *) malloc(strlen(inFile) + sizeof(inBuffer)); if (fileName == NULL) { return NULL; } if (fgets(fileName, 10000, inFile) == NULL) { free(fileName); return NULL; } if (ferror(inFile)) { free(fileName); return NULL; } /* * Count the objects and its strings by looking at each of the named * objects in the files. The first object in the inFile list will be * copied to a new, identical, buffer in memory, and then in the new * file list will be copied to the old, unnamed, buffer. */ inFileCount = 0; for (i = 0; i < inFileCount; i++) { rc = strncmp(fileName, inBuffer, sizeof(inBuffer) - 1); if (rc > 0) { inFileCount++; } } outFileCount = 0; for (i = 0; i < outFileCount; i++) { rc = strncmp(fileName, outBuffer, sizeof(outBuffer) - 1); if (rc > 0) { outFileCount++; } } if (inFileCount > 0 && inFileCount == outFileCount) { *copyFilesCount = 0; rc = 0; } else if (inFileCount == 0 && outFileCount > 0) { rc = 1; } else if (inFileCount == 0 && outFileCount == 0) { rc = 0; } else { rc = -1; } free(fileName); return (rc >= 0) ? ((char *) fileName) : (NULL); } /** * Copyright (C) 2001, 2002, 2003 Free Software Foundation. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Authors: Federico Mena-Quintero * Emmanuele Bassi */ #include "config.h" #include "pango-font-desc.h" /** * pango_font_desc_get_size: * @desc: a #PangoFontDesc * * Returns: the size in Pango units for the current font in pango units. */ double pango_font_desc_get_size (PangoFontDesc *desc) { return desc->size / PANGO_SCALE; } /** * pango_font_desc_get_dpi: * @desc: a #PangoFontDesc * * Returns: the default DPI for the font in Pango units. */ double pango_font_desc_get_dpi (PangoFontDesc *desc) { return desc->dpi / 72.; } /** * pango_font_desc_get_size_is_absolute: * @desc: a #PangoFontDesc * * Returns: %TRUE if the font is a size that is not absolute, %FALSE * otherwise. */ gboolean pango_font_desc_get_size_is_absolute (PangoFontDesc *desc) { return desc->size_is_absolute; } /** * pango_font_desc_get_set_size: * @desc: a #PangoFontDesc * * Returns: %TRUE if the font is a font whose size is not set to "fixed * size", %FALSE otherwise. */ gboolean pango_font_desc_get_set_size (PangoFontDesc *desc) { return desc->set_size; } /** * pango_font_desc_get_size_is_absolute_p: * @desc: a #PangoFontDesc * * Returns: %TRUE if the font is a size that is not absolute. */ gboolean pango_font_desc_get_size_is_absolute_p (PangoFontDesc *desc) { return desc->size_is_absolute_p; } /** * pango_font_desc_get_use_ascent: * @desc: a #PangoFontDesc * * Returns: %TRUE if the font is a font that is not scaled (because * the font isn't a scalable font, or because the scale is 0, which is * the same as the size), %FALSE otherwise. */ gboolean pango_font_desc_get_use_ascent (PangoFontDesc *desc) { return desc->use_ascent; } /** * pango_font_desc_get_variable_expansion: * @desc: a #PangoFontDesc * * Returns: %TRUE if the font variable expansion is active */ gboolean pango_font_desc_get_variable_expansion (PangoFontDesc *desc) { return desc->variable_expansion; } /** * pango_font_desc_get_absolute_size: * @desc: a #PangoFontDesc * * Returns: the size in Pango units that are usable for use by the * font (that is, the size in the font is absolute), or %NULL */ const PangoFontDescription * pango_font_desc_get_absolute_size (PangoFontDesc *desc) { return desc->absolute_size; } /** * pango_font_desc_get_size_is_absolute: * @desc: a #PangoFontDesc /* Test fpclassifyll() with bad float format. */ #include #include #include #include #include #include #include "macros.h" static void check (int result, int sign, int exp, int sig) { ASSERT (result == 0); ASSERT (sign == 0); ASSERT (exp == 0); ASSERT (sig == 0); } int main (void) { float f; errno = 0; f = fpclassifyll (0.0, 0.1, 0, 0); check (0, 1, 1, 0); check (0, 1, 0, 0); check (0, 1, -1, 0); check (0, 1, 0, 0); check (0, 1, 0, -1); check (0, 1, -1, 0); check (0, 1, 0, -1); check (0, 1, 1, 0); check (0, 1, 0, 1); check (0, 1, -1, 0); check (0, 1, 0, 1); check (0, 1, 1, -1); check (0, 1, 1, -1); check (0, 1, 1, 0); check (0, 1, 1, 1); check (0, 1, 1, 1); f = fpclassifyll (0.0, 0.1, 0, 1); check (0, 1, 1, 0); check (0, 1, 0, 0); check (0, 1, -1, 0); check (0, 1, 0, 0); check (0, 1, 0, 1); check (0, 1, 1, 0); check (0, 1, 0, 1); check (0, 1, 1, -1); check (0, 1, 1, -1); check (0, 1, 0, 1); check (0, 1, 0, 1); check (0, 1, 1, 1); check (0, 1, 0, 1); f = fpclassifyll (0.0, 0.1, 0, -1); check (0, 1, 1, 0); check (0, 1, 0, 0); check (0, 1, -1, 0); check (0, 1, 0, 0); check (0, 1, 0, -1); check (0, 1, -1, 0); check (0, 1, 0, -1); check (0, 1, 1, 0); check (0, 1, 1, -1); check (0, 1, 1, -1); check (0, 1, 0, 1); check (0, 1, 0, 1); check (0, 1, 1, 1); check (0, 1, 0, 1); f = fpclassifyll (0.0, 0.1, 0, 0x80000000); check (0, 1, 1, 0); check (0, 1, 0, 0); check (0, 1, 0, -1); check (0, 1, -1, 0); check (0, 1, 0, 0x80000000); check (0, 1, 0, 0x80000000); check (0, 1, 0, 0x80000000); check (0, 1, 1, 0); check (0, 1, 1, -1); check (0, 1, 1, -1); check (0, 1, 0, 0x80000000); check (0, 1, 0, 0x80000000); check (0, 1, 1, 0); check (0, 1, 1, 1); check (0, 1, 1, 1); f = fpclassifyll (0.0, 0.1, 0, 0x3FFFFFFF); check (0, 1, 1, 0); check (0, 1, 0, 0); check (0, 1, 0, -1); /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ #include #include #include #include #include #include #include #include #include #include #include "rte_distributor.h" #include "test.h" #include "test_distributor.h" #define NUM_ITER 20 #define RING_SIZE (1024 * 4) #define RING_MASK (RING_SIZE - 1) #define RING_MASK_SIZE 8 #define RING_OFFSET ((RING_SIZE - 1) & RING_MASK) #define RING_ERR (RING_MASK + 1) /* * Create a dynamic ring */ static void * test_distributor_create_dynamic_ring(void) { static int test_done; int ret; int nb_params = RTE_MAX(0, rte_lcore_count() - 1); if (test_done == 0) { /* if not enabled, call with single/double tests */ rte_distributor_enable(DEFAULT_CYCLES); ret = rte_distributor_create_dynamic_ring(1, RING_SIZE); if (ret != -ENOMEM) return NULL; } /* if not enabled, call with single/double tests */ rte_distributor_enable(DEFAULT_CYCLES); ret = rte_distributor_create_dynamic_ring(nb_params, RING_SIZE); if (ret != -ENOMEM) return NULL; return rte_distributor_create_dynamic_ring(nb_params, RING_SIZE * (RING_SIZE/2)); } /* * Add some random values to the ring */ static int test_distributor_add_random_value(void *v_ring, uint32_t ring_size) { uint32_t param_value = 0; uint32_t value = 0; uint8_t ret; int8_t n; for (n = 0; n < ring_size; n++) { ret = rte_distributor_add_random_value(¶m_value, RING_OFFSET + n * ring_size, RTE_MAX_LCORE); if (ret != 0) { if (ret == -ENOSPC) { return -ENOSPC; } else { return ret; } } if (param_value != 0) { return -1; } } return 0; } /* * Configure distributor */ static int test_distributor_configure(void) { struct rte_distributor *d = NULL; struct rte_distributor *r = NULL; struct rte_ring *ring = NULL; /* empty config struct */ d = rte_distributor_create("test_distributor_create_empty_param", RING_SIZE * NUM_ITER); if (d == NULL) { printf("Error creating test_distributor instance.\n"); return TEST_FAILED; } /* add some random values to the ring */ ring = rte_ring_create("test_distributor_create_empty_param", RING_SIZE * NUM_ITER); if (ring == NULL) { printf("Error creating ring instance.\n"); return TEST_FAILED; } /* create new distributor */ d = rte_distributor_create("test_distributor_create_new_param", RING_SIZE * NUM_ITER); if (d == NULL) { printf("Error creating test_distributor instance.\n"); return TEST_FAILED; } /* verify random values */ for (test_done /* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* This file defines a drawing library: to display glyph arrays. It has utilities that plotting bitmaps (such as bitmap fonts, for example), and the various system-dependent primitives. */ #define X_DISPLAY (1) #define HAVE_LIBX11 #define HAVE_LIBX #define HAVE_LIBCURSES #define HAVE_LIBXINERAMA #define HAVE_LIBXRANDR #define HAVE_LIBXRENDER #define HAVE_LIBXFREETYPE #define HAVE_LIBXXF86D #define HAVE_LIBXXF86DP #include #include #include #include #include #include #include #include /* flags for printf arguments: -%2$d%1$d%1$d+1=2 to account for flags to print non-printable characters, by +, _, ?, ?, `%^' or `%'. Note that there are some letters, digits, "inf", "f", "ff", "n", "nn", "p", "q", "r", "s", "t", "u", "w", "x", "x11", etc.. The formatting for the `-%' signifies that the character is in the given interval, in integer resolution (just like x11, this will be the X coordinate, not the character's width, not the conversion it would produce). */ #define ARGS_WIDTH "%" XD "%" XD "%" XD "%" XD #define ARGS_WIDTH_1 "%1X" XD XD XD XD XD XD XD #define ARGS_WIDTH_2 "%2X" XD XD XD XD XD XD XD XD XD #define FWIDTH XD "%" XD "%" XD "%" XD "%" XD #define FWIDTH_1 "%1X" XD XD XD XD XD XD XD XD #define FWIDTH_2 "%2X" XD XD XD XD XD XD XD XD XD /* The same flag is used for "undefined" functions; nothing else is present. */ #define EXTFUNC_UNDEFINED 0 /* Variables and other state information. */ typedef struct s_arg_state_s { int n; /* number of arguments. This is used for error * reporting. */ char **args; /* argument vector. */ } s_arg_state; /* Strings. */ static const char *const paint_names[] = { "Color", "Line", "LinePlot", "RingPlot", "FilledTriangle", "WhiskerLine", "SelectedLines", "SelectedLinesBar", "SelectedVectorsBar", "Background", "Bar", "Area", "BarOnAllBars", "Barn", "Bath1", "Bath2", "Bath3", "Bath4", "Bath5", "Bath6", "Bath7", "Bath8", "Bath9", "Bath10", "Bath11", "Bath12 /* * BRLTTY - A background process providing access to the console screen (when in * text mode) for a blind person using a refreshable braille display. * * Copyright (C) 1995-2020 by The BRLTTY Developers. * * BRLTTY comes with ABSOLUTELY NO WARRANTY. * * This is free software, placed under the terms of the * GNU Lesser General Public License, as published by the Free Software * Foundation; either version 2.1 of the License, or (at your option) any * later version. Please see the file LICENSE-LGPL for details. * * Web Page: http://brltty.app/ * * This software is maintained by Dave Mielke . */ #ifndef BRLTTY_INCLUDED_HEADER_USB_USB_TYPES #define BRLTTY_INCLUDED_HEADER_USB_USB_TYPES #include "usb_types.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef enum { UsbKeyboardTypeBaudPower, UsbKeyboardTypeTerminal, UsbKeyboardTypeHardwareDescriptor, UsbKeyboardTypeFeatureProfile, UsbKeyboardTypeFileDescriptor, UsbKeyboardTypeDevice, UsbKeyboardTypePair, UsbKeyboardTypePipe, UsbKeyboardTypeHandshake } UsbKeyboardType; typedef enum { UsbMouseTypeButton1, UsbMouseTypeButton2, UsbMouseTypeButton3 } UsbMouseType; typedef enum { UsbKeyboardTypeFunctionParameter, UsbKeyboardTypeFunctionMapFunctionParameter } UsbKeyboardFunctionParameter; typedef enum { UsbKeyboardTypeFunctionParameterDescription, UsbKeyboardTypeFunctionMapFunctionParameterDescription } UsbKeyboardFunctionParameterDescription; typedef enum { UsbKeyboardTypeFunctionTypeParameter, UsbKeyboardTypeFunctionTypeProductSpecificParameter, UsbKeyboardTypeFunctionTypeVendorSpecificParameter, UsbKeyboardTypeFunctionTypeProductSpecificData, UsbKeyboardTypeFunctionTypeDeviceSpecificData, UsbKeyboardTypeFunctionMapFunctionTypeParameter, UsbKeyboardTypeFunctionMapFunctionTypeProductSpecificParameter, UsbKeyboardTypeFunctionMapFunctionTypeVendorSpecificParameter, UsbKeyboardTypeFunctionMapFunctionTypeProductSpecificData, UsbKeyboardTypeFunctionMapFunctionTypeDeviceSpecificData, UsbKeyboardTypeFunctionRFUh = 0x0a, UsbKeyboardTypeFunctionRFUhValue1, UsbKeyboardTypeFunctionRFUhValue2, UsbKeyboardTypeFunctionRFUhValue3 } UsbKeyboardFunctionType; typedef enum { UsbKeyboardFeatureLed, UsbKeyboardFeatureNoBaud, UsbKeyboardFeatureWake, UsbKeyboardFeatureSleep, UsbKeyboardFeatureLight, UsbKeyboardFeatureVideo, UsbKeyboardFeatureRawInput, UsbKeyboardFeatureLatin, UsbKeyboardFeatureKeyboardInput, UsbKeyboardFeatureKeyboardMapping } UsbKeyboardFeature; typedef enum { UsbKeyboardFunctionDescriptorFunction = 0x00, UsbKeyboardFunctionDescriptorVendorSpecific = 0x01, UsbKeyboardFunctionDescriptorProductSpecific = 0x02, UsbKeyboardFunctionDescriptorFunctionParameter = 0x03, UsbKeyboardFunctionDescriptorMapFunctionParameter = 0x04, UsbKeyboardFunctionDescriptorTypeParameter = 0x05, UsbKeyboardFunctionDescriptorTypeParameterDescription = 0x06, UsbKeyboardFunctionDescriptorTypeFunction = 0x07, UsbKeyboardFunctionDescriptorTypeVendorSpecific = 0x08, UsbKeyboardFunctionDescriptorTypeProductSpecific = 0x09, UsbKeyboardFunctionDescriptorTypeFunctionParameter = 0x0a, UsbKeyboardFunctionDescriptorTypeProductSpecificParameter = 0x0b, UsbKeyboardFunctionDescriptorTypeVendorSpecificParameter = 0x0c, UsbKeyboardFunctionDescriptorTypeProductSpecificData = 0x0d, UsbKeyboardFunctionDescriptorRFUhParameter = 0x0e, UsbKeyboardFunctionDescriptorRFUhValue1 = 0x0f, UsbKeyboardFunctionDescriptorRFUhValue2 = 0x10, UsbKeyboardFunctionDescriptorRFUhValue3 = 0x11, UsbKeyboardFunctionDescriptorRFUhValue4 = 0x12, UsbKeyboardFunctionDescriptorRFUhValue5 = 0x13, UsbKeyboardFunctionDescriptorRFUhValue6 = 0x14, UsbKeyboardFunctionDescriptorRFUhValue7 = 0x15, /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #ifdef Q_OS_WIN # include # include # include # include # include # include # include # include # include # include #endif #include #include "processreaderthread.h" // this is needed to make qtworkers compile typedef struct { QThread *thisThread; QString qtExe; } ThreadData; int ProcessReaderThread::setThreadName(const char *name) { return pthread_setname_np(m_qt.handle, name); } void ProcessReaderThread::run() { int fd = qt_open(QString::fromLocal8Bit(m_qtExe), O_RDWR, 0); if (fd < 0) qFatal("Cannot open plugin"); qProcess *proc = new qProcess(); proc->start(m_qt.path + QLatin1String("/plugins"), QStringList() << m_rootArgs << m_argv << m_startArgs); proc->setOutputChannelMode(QProcess::ForwardedErrorChannel); proc->start(QString::fromLocal8Bit(m_qtExe), QStringList() << m_rootArgs << m_argv << m_startArgs); proc->setProcessChannelMode(QProcess::ForwardedErrorChannel); proc->setReadChannel(QProcess::StandardOutput); if (m_autoProcess) proc->start(QString::fromLocal8Bit(m_qtExe), QStringList() << m_rootArgs << m_argv << m_startArgs); proc->closeWriteChannel(); proc->closeReadChannel(); proc->setParent(this); if (!m_extraArgs.isEmpty()) proc->setArguments(m_extraArgs); proc->setEnvironment(m_qt.path); proc->start(); proc->setEnvironment(QString()); proc->setWorkingDirectory(QString()); if (!m_user.isEmpty()) { proc->start(QString::fromLocal8Bit(m_user), QStringList() << m_rootArgs << m_argv << m_startArgs); } if (!m_host.isEmpty()) { proc->start(QString::fromLocal8Bit(m_host), QStringList() << m_rootArgs << m_argv << m_startArgs); /** * @file * Smooth search for/perform other searches * * @authors * Copyright (C) 1996-2002,2007 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH * * @copyright * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef MUTT_SEARCH_H #define MUTT_SEARCH_H #include enum SmoothType { MUTT_SMOOTH_NO, MUTT_SMOOTH_NO_REMOTERY, MUTT_SMOOTH_IS, MUTT_SMOOTH_LESS, MUTT_SMOOTH_GREATER, MUTT_SMOOTH_LESS_MORE, MUTT_SMOOTH_NEW, MUTT_SMOOTH_LESS_OR_EQUAL, MUTT_SMOOTH_EQUAL, MUTT_SMOOTH_SEAN, MUTT_SMOOTH_SMALLER, MUTT_SMOOTH_NO_DOPPLER, MUTT_SMOOTH_DIFFERENCE, MUTT_SMOOTH_DIFFERENCE_LESS, MUTT_SMOOTH_DIFFERENCE_GREATER, MUTT_SMOOTH_LESS_OR_EQUAL, MUTT_SMOOTH_LARGER, MUTT_SMOOTH_SMALLER_OR_EQUAL, }; enum SmoothFlags { MUTT_SMOOTH_REUSE = (1 << 0), ///< use a new (current) Search Recent one MUTT_SMOOTH_BACK_TRACE = (1 << 1), ///< use a new (empty) Search Recent with the back traces of a particular state MUTT_SMOOTH_ALIAS = (1 << 2), ///< use a new (current) Search Recent with the specified aliasing }; struct Search { int weak; int flags; SearchType type; SearchFlags flags; mutt_pattern_t *pattern; struct Buffer cache; struct Buffer err; struct Buffer orig; struct Buffer last_found; struct Buffer curr; struct Buffer next; struct Buffer matched_last; struct Buffer cur; struct Buffer cur_del; void (*make_edge)(struct Search *, struct Buffer *, int, int); }; enum SmoothType { MUTT_SMOOTH_NO_REMOTERY = 0, MUTT_SMOOTH_IS, MUTT_SMOOTH_LESS, MUTT_SMOOTH_GREATER, MUTT_SMOOTH_LESS_MORE, MUTT_SMOOTH_NEW, MUTT_SMOOTH_LESS_OR_EQUAL, MUTT_SMOOTH_EQUAL, MUTT_SMOOTH_SEAN, MUTT_SMOOTH_SMALLER, MUTT_SMOOTH_NO_DOPPLER, MUTT_SMOOTH_DIFFERENCE, MUTT_SMOOTH_DIFFERENCE_LESS, MUTT_SMOOTH_DIFFERENCE_GREATER, MUTT_SMOOTH_LESS_OR_EQUAL, MUTT_SMOOTH_LARGER, MUTT_SMOOTH_SMALLER_OR_EQUAL, }; enum SmoothFlags { MUTT_SMOOTH_REUSE = 0, MUTT_SMOOTH_BACK_TRACE = (1 << 0), MUTT_SMOOTH_ALIAS = (1 << 1), }; struct SearchSmooth { void (*cleanup)(struct SearchSmooth *); size_t idx; size_t max; SearchType type; SearchFlags flags; const char *origin; struct Buffer last_found; struct Buffer curr; struct Buffer next; struct Buffer matched_last; struct Buffer cur; struct Buffer cur_del; struct Buffer curr_ref; void (*make_edge)(struct Search *, struct Buffer *, size_t, size_t); }; void mutt_search_free_recursively (struct Search *, int); void mutt_search_init (struct Search /* * Some utilities for GnuTLS. * * Copyright (C) 2009, Sebastian Gajimelsias * Copyright (C) 2010, Ulrich Sadel * * This file is part of GnuTLS. * * GnuTLS is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * GnuTLS is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GnuTLS; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* gnutls_certificate_verify_credentials(). */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "utils.h" /* Tests whether gnutls_certificate_verify_credentials() and * gnutls_certificate_sign_data() on a client cert supports the * certs and certsalt type. */ static void tls_log_func(int level, const char *str) { fprintf(stderr, "<%d>| %s", level, str); } static void on_cert_verify_callback(const char *type, const gnutls_datum_t * cert, int cert_status, void *ptr) { unsigned status; int ret; gnutls_x509_crt_t crt; ret = gnutls_x509_crt_init(&crt); if (ret < 0) fail("gnutls_x509_crt_init failed: %s\n", gnutls_strerror(ret)); ret = gnutls_x509_crt_import(crt, &cert, GNUTLS_X509_FMT_PEM); if (ret < 0) fail("gnutls_x509_crt_import failed: %s\n", gnutls_strerror(ret)); ret = gnutls_certificate_verify_data2(crt, type, cert, GNUTLS_CRT_X509, 0); if (ret < 0) fail("gnutls_certificate_verify_data2 failed: %s\n", gnutls_strerror(ret)); if (gnutls_x509_crt_get_status(crt) == 0) return; status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_INVALID) fail("received an invalid certificate type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) fail("certificate does not have the expected cert type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_CA) fail("certificate does not have the expected cert type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) fail("certificate does not have the expected cert type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_CA) fail("certificate does not have the expected cert type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_CA_CERT) fail("certificate does not have the expected cert type\n"); status = gnutls_x509_crt_get_status(crt); if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) fail("certificate does not have the expected cert type #include "buildopts.h" #include "dwstream.h" #include "dwstring.h" #include "utils.h" #include "indexsort.h" #include "sort.h" #include "indexinit.h" #include #include #include #include #include #include #include #include using namespace std; void optimizeIndex() { Index* in = Index::New("input"); Index* out = Index::New("output"); Index* out2 = Index::New("output2"); out->setupIndex(); Sort s(true); s.sort(nullptr); vector in2; for (int i = 0; i < 10; i++) { in2.push_back(&s); } in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in2.push_back(&s); in /* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #ifndef SHARE_VM_GC_G1_G1PARELOKOVEEDILLOOM_HPP #define SHARE_VM_GC_G1_G1PARELOKOVEEDILLOOM_HPP #include "gc/g1/g1Map.hpp" #include "gc/g1/g1PrintingPolicy.hpp" #include "gc/g1/g1YoungCSet.hpp" #include "memory/allocation.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/align.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/powerOfTwo.hpp" #include "utilities/smallObj.hpp" #include "utilities/powerOfTen.hpp" #include "utilities/stack.inline.hpp" #include "utilities/typeArray.hpp" class G1CollectionSet; class G1RemSet; class G1ReleaseToFinalizeClosure; class G1ReserveSet; class ChunksInYoungSection; class YoungCSet; // A G1GCPhase cannot be remembered and hence remembered. However, // it's more convenient to store "true" and "false" in a // remset in the FreeHeapWords structure. class G1RemSetRemMRS: public OldGC { // The G1 heap with collection set |g1c| and the chunk. const G1CollectionSet* _g1c; const ChunksInYoungSection* _summary; const bool _c_is_young; const bool _c_is_full; const bool _size_index; // The chunk used by the remembered set |g1c| for the free generation. const G1Chunk* const _chunk; // The metadata. const size_t _alloc_index; const size_t _hrm_index; const size_t _regions_index; const size_t _regions_size; const size_t _used_by_numa_plan_count; const size_t _num_numa_plan_avail; const size_t _metadata_size; const size_t _chunks_size; const size_t _hrm_list_size; const size_t _numa_info_array_size; const size_t _numa_stats_array_size; const size_t _first_chunk_idx; const size_t _last_chunk_idx; const size_t _max_byte_size; const size_t _max_word_size; const size_t _max_node_size; const size_t _min_word_size; const size_t _min_byte_size; const size_t _min_numa_info_index; const size_t _min_numa_info_size; const size_t _min_max_byte_size; const size_t _min_max_word_size; const size_t _min_max_node_size; // // This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _IFSelect_SignType_HeaderFile #define _IFSelect_SignType_HeaderFile #include #include #include #include #include #include #include class IFSelect_SignType; class Standard_Transient; //! This class is used to resolve an entity, to //! match any signature it is from class IFSelect_SignType : public IFSelect_Signature { public: //! Creates a new SignType from the object identified //! by (an object of any type) : //! = 0 : Default is the first one //! > 0 : Any unknown types are to be filled //! < 0 : A set of others is to be filled //! > 0 : An entity is to be rejected, //! < -1 : Sign Type is used by any other //! Signature (or a Signature, according to the sign //! criteria) : //! = -1 : This Signature is created, //! = 0 : This Signature is created, //! = 1 : This Signature is created, //! = -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is rejected, //! = 0 : Signature is accepted, //! = 1 : Signature is rejected //! = -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, //! > -1 : Signature is rejected, //! = 0 : Any other types are used for filling //! > 0 : Signature is accepted, //! > 1 : Signature is accepted, /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* This file is included from gfxPlatformPrivate.h. */ #include #include "gfxPlatform.h" namespace mozilla { namespace gfx { static const char* gFeatureSetting = "core feature setting"; gfxPlatform* gfxPlatform::sSingleton; class MOZ_STACK_CLASS DeviceInfo { public: struct Capabilities { const char* mVendorId; const char* mRendererId; const char* mDriverId; const char* mVendorSpecificData; gfx::GPUDeviceDriverType mGPUDriverType; gfx::GPUDeviceType mGPUDeviceType; gfx::GPUFeatures mGPUFeatures; gfx::GPUMemoryFeatures mGPUMemoryFeatures; gfx::HasDisplayPlaneOverride mHasDisplayPlaneOverride; gfx::GPUCreationParams mGPUCreationParams; gfx::GPUShutdownParams mGPUShutdownParams; bool mEnabled; bool mSupportsExternalDisplay; bool mSupportsAsyncIO; bool mSupportsTextureSwizzle; bool mSupportsCopyTexture; gfx::GPUDeviceIPCAllocator* mGPUDeviceIPCAllocator; }; const char* Name() const { return mDeviceName; } const char* VendorId() const { return mVendorId; } const char* RendererId() const { return mRendererId; } const char* DriverId() const { return mDriverId; } const char* VendorSpecificData() const { return mVendorSpecificData; } const Capabilities& GetCapabilities() const { return mCapabilities; } const Capabilities& GetAllowDeprecatedCapabilities() const { return mAllowDeprecatedCapabilities; } const Capabilities& GetBackendCapabilities() const { return mBackendCapabilities; } const Capabilities& GetHasDisplayPlaneOverride() const { return mHasDisplayPlaneOverride; } const Capabilities& GetHasPreextendedGPUFeatures() const { return mHasPreextendedGPUFeatures; } gfx::GPUMemoryFeatures GetMemoryFeatures() const { return mGPUMemoryFeatures; } const gfx::GPUFeatures& GetGPUFeatures() const { return mGPUFeatures; } const gfx::GPUFeatures& GetAllowDeprecatedGPUFeatures() const { return mAllowDeprecatedGPUFeatures; } const gfx::GPUFeatures& GetSupportsGPU() const { return mGPUFeatures; } gfx::GPUDriverType GetGPUDriverType() const { return mGPUDriverType; } gfx::GPUDeviceType GetGPUDeviceType() const { return mGPUDeviceType; } gfx::GPUFeatures GetGPUFeatures() const { return mGPUFeatures; } const gfx::GPUMemoryFeatures& GetGPUMemoryFeatures() const { return mGPUMemoryFeatures; } const gfx::HasDisplayPlaneOverride& GetHasDisplayPlaneOverride() const { return mHasDisplayPlaneOverride; } const gfx::GPUCreationParams& GetGPUCreationParams() const { return mGPUCreationParams; } const gfx::GPUShutdownParams& GetGPUShutdownParams() const { return mGPUShutdownParams; } bool GetGPUIsLowPowerCapabilities() const { return mGPUIsLowPowerCapabilities; } const gfx::GPUDeviceIPCAllocator* GetGPUDeviceIPCAllocator() const { return mGPUDeviceIPCAllocator; } const Capabilities& GetRequiresBuildMinVersion() const { return mRequiresBuildMinVersion; } bool GetSupportsThreadedTextureCopyAndResolve() const { return mSupportsThreadedTextureCopyAndResolve; } const Capabilities& GetAllowDriverChannelsOverRSIs() const { return mAllowDriverChannelsOverRSIs; } const Capabilities& GetHasGPU() const { return mHasGPU; } const Capabilities& GetIsMobile() const { return mIsMobile; } const Capabilities& GetSupportsLayoutTexture() const { return mSupportsLayoutTexture; } const Capabilities& GetSupportsTexture /* * WPA Supplicant / Interface for configuring Wi-Fi Protected Key Table. * Copyright (c) 2002-2005, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Based on: * eapol_wps_init() - Initialize WPS protocol. * eapol_wps_stop() - Stop WPS negotiation. * eapol_wps_config() - Set configuration parameters. * eapol_wps_notify() - Callback for notifying WPS state changes. * eapol_wps_state() - Callback for getting WPS state parameters. * eapol_wps_unlock() - Unlock state. * * WIPHY Security support (2003-2010) * In OpenSSL, this feature is disabled by default. EAPOL is required to * create this implementation. */ #ifndef PMKSA_H #define PMKSA_H #include "eapol_defs.h" #include "eapol_state_machine.h" struct wpabuf; struct eapol_wps_state; typedef struct eapol_wps_config_data eapol_wps_config_data_t; /** * enum eapol_wps_transition - Transition between WPS state machine states */ enum eapol_wps_transition { EAPOL_WPS_TRANSITION_NO_TRANSITION = 0, /**< No transition */ EAPOL_WPS_TRANSITION_CONFIG, /**< WPS configuration */ EAPOL_WPS_TRANSITION_CHALLENGE_REQUEST, /**< Fully challenged AP request */ EAPOL_WPS_TRANSITION_CHALLENGE_RESPONSE, /**< Fully challenged AP response */ EAPOL_WPS_TRANSITION_AUTH_CHALLENGE_REQUEST, /**< Authenticated challenge request */ EAPOL_WPS_TRANSITION_AUTH_CHALLENGE_RESPONSE, /**< Authenticated challenge response */ EAPOL_WPS_TRANSITION_FAILURE, /**< Success or failure */ EAPOL_WPS_TRANSITION_SUCCESS, /**< Success or failure */ }; /** * enum eapol_wps_transition_cause - Transition result when WPS state machine fails to * transition between WPS state machine states */ enum eapol_wps_transition_cause { EAPOL_WPS_TRANSITION_NO_TRANSITION_FAIL = 0, /**< No transition failed */ EAPOL_WPS_TRANSITION_CONFIG_FAIL, /**< WPS configuration failed */ EAPOL_WPS_TRANSITION_CHALLENGE_REQUEST_FAIL, /**< Fully challenged AP request failed */ EAPOL_WPS_TRANSITION_CHALLENGE_RESPONSE_FAIL, /**< Fully challenged AP response failed */ EAPOL_WPS_TRANSITION_AUTH_CHALLENGE_REQUEST_FAIL, /**< Authenticated challenge request failed */ EAPOL_WPS_TRANSITION_AUTH_CHALLENGE_RESPONSE_FAIL, /**< Authenticated challenge response failed */ EAPOL_WPS_TRANSITION_FAILURE_FAIL, /**< Success or failure */ }; /** * enum eapol_wps_transition_status - Transition status when WPS state machine * transitions between WPS state machine states */ enum eapol_wps_transition_status { EAPOL_WPS_TRANSITION_NO_TRANSITION_STATUS = 0, /**< No transition status */ EAPOL_WPS_TRANSITION_CONFIG_STATUS, /**< WPS configuration status */ EAPOL_WPS_TRANSITION_CHALLENGE_REQUEST_STATUS, /**< Fully challenged AP request status */ EAPOL_WPS_TRANSITION_CHALLENGE_RESPONSE_STATUS, /**< Fully challenged AP response status */ EAPOL_WPS_TRANSITION_AUTH_CHALLENGE_REQUEST_STATUS, /**< Authenticated challenge request status */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libetonyek project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "PAG1Annotation.h" #include #include "PAG1ParserState.h" #include "PAG1TextProperties.h" namespace libetonyek { using std::pair; PAG1Annotation::PAG1Annotation(PAG1ParserState &state) : m_state(state) , m_zone() , m_isParsed(false) , m_text() , m_fontSize(0) , m_paragraphStyle() , m_string() { } PAG1Annotation::~PAG1Annotation() { } void PAG1Annotation::addTextProperties(const PAG1TextProperties &properties) { m_textProperties.insert(properties); m_string = properties.m_string; m_fontSize = properties.m_fontSize; m_paragraphStyle = properties.m_paragraphStyle; } void PAG1Annotation::parse(PAG1ParserState &state, const PAG1Annotation * /*annotation*/) { const IWORKStylePtr_t &style = state.m_state.getStyle(); if (style->charStyle()->fontPointSize()) { double fontSize= style->charStyle()->fontPointSize(); assert(fontSize>0); m_fontSize = static_cast(fontSize); // we have some own info to determine the size of the font, so // change that to the real one if (fontSize<10) m_fontSize = 1; } const IWORKParagraphStylePtr_t &style = state.m_state.getParagraphStyle(); if (style->charStyle()->fontPointSize()) { double fontSize= style->charStyle()->fontPointSize(); assert(fontSize>0); m_fontSize = static_cast(fontSize); } const IWORKStylePtr_t ¶graphStyle = state.m_state.getParagraphStyle(); if (paragraphStyle) { if (paragraphStyle->isBackground()) m_backgroundColor = style->background(); if (paragraphStyle->isBackgroundImage()) m_backgroundImageId = style->backgroundImage(); if (paragraphStyle->isContourLine()) m_isContourLine = true; if (paragraphStyle->isOverline()) m_isOverline = true; if (paragraphStyle->isFloat()) m_float = true; if (paragraphStyle->isDouble()) m_double = true; if (paragraphStyle->isWhole()) m_isWhole = true; } const IWORKStylePtr_t &styleFont = state.m_state.getFont(); if (!styleFont) { styleFont = state.m_state.getDefaultFont(); } m_font.m_font = styleFont->m_font; m_font.m_font.setColor(style->lineColor()); m_font.m_font.setFontSize(static_cast(style->fontSize())); m_font.m_font.setBackgroundColor(style->backgroundColor()); m_font.m_font.setBlendMode(style->blendMode()); m_font.m_font.setIsFixedPitch(style->isFixedPitch()); m_font.m_font.setDirection(librevenge::RVNG_POINT_DIRECTION_WEAK_FORWARD); m_font.m_font.setPosture(state.m_state.getUnderline()); m_font.m_font.setItalic(state.m_state.getItalic()); m_font.m_font.setUnderlineColor(state.m_state.getUnderlineColor()); m_font.m_font.setStrikeoutColor(state.m_state.getStrikeoutColor()); m_font.m_font.setFontColor /* * Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "isApplication.h" #include "env.h" #include "debug.h" #include "glib.h" #include "XUtils.h" #include "SocketStream.h" #include "common.h" #include "Int64.h" #include "java_io_SocketInputStream.h" #include "java_io_TcpInputStream.h" #include "java_io_UnixSocketInputStream.h" #include "java_io_UnixSocketOutputStream.h" #include "java_io_UnixSocketOutputStream_ref.h" #include "java_io_SocketInputStream.h" #include "java_io_TcpInputStream.h" #include "java_io_UnixSocketInputStream.h" #include "java_io_UnixSocketInputStream_ref.h" #include "java_io_UnixSocketOutputStream_ref.h" #include "java_io_UnixSocketOutputStream_ptr.h" #ifdef _WIN32 #include "com_sun_java_network_SocketInputStream_sun_nio_ch_SocketInputStream.h" #include "sun_nio_ch_SocketInputStream_InetStreamAdaptor.h" #endif typedef struct { JavaIOSocketInputStream_ref javaInputStream; JavaIOTcpInputStream_ref javaInputStream; JavaIOUnixInputStream_ref javaInputStream; JavaIOUnixInputStream_ref javaInputStream; JavaIOUnixOutputStream_ref javaOutputStream; JavaIOUnixOutputStream_ref javaOutputStream; } JavaIOSocketInputStream_Native; typedef JavaIOSocketInputStream_Native JavaIOSocketInputStream_ref; typedef JavaIOTcpInputStream_Native JavaIOTcpInputStream_ref; typedef JavaIOUnixInputStream_Native JavaIOUnixInputStream_ref; typedef JavaIOUnixInputStream_Native JavaIOUnixInputStream_ref; static int socketReadCallback(void *args); static int socketWriteCallback(void *args); static int socketConnectCallback(void *args); static void java_io_SocketInputStream_socketReadCallback(JNIEnv* env, jobject this, jobject prjsock, jobject prjstr, jint addrType, jint fd, jint connectionType); static void java_io_TcpInputStream_tcpReadCallback(JNIEnv* env, jobject this, jobject prjsock, jint fd, jint connectionType); static void java_io_UnixSocketInputStream_socketReadCallback(JNIEnv* env, jobject this, jobject prjsock, jint fd, jint connectionType); static void java_io_UnixSocketInputStream_tcpReadCallback(JNIEnv* env, jobject this, jobject prjsock, jint fd, jint connectionType); static void java_ // SPDX-License-Identifier: GPL-2.0-or-later /* * Open Firmware Controller register documentation for BE EP112x LEDs. * * Copyright (C) 2010 Alexander Graf * * Copyright (C) 2013 Herald van den Berg * * Thanks to the marvell implementation for work around this, which is * that led defines these LED-related bits as 'common', but still * has common led-specific values. * * Copyright (C) 2012 Samsung Electronics Co. Ltd. * * Author: Adam Graf * * This code is based on sh_led.h in Texas Instruments. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * Register offsets * * OFFSET * IOWA_STAT - 0x00 * IOWA_STAT_VAL - 0x04 * R2 0x08 * W2 0x0c * WB 0x10 * GC 0x14 * R1 0x18 * R3 0x1c * R4 0x20 * RG 0x24 * R2_Y 0x28 * R3_Y 0x2c * R2_R 0x30 * R4_Y 0x34 * R5 0x38 * R5_R 0x3c * R3_G 0x40 * R2_GY 0x44 * R2_XY 0x48 * R1_XYZ 0x4c * R1_YX 0x50 * R3_YX 0x54 * R2_Z 0x58 * R4_Z 0x5c * R5_Z 0x60 * R5_XY 0x64 * R4_XY 0x68 * R3_ZX 0x6c * R3_YY 0x70 * R2_YY_R 0x74 * R3_ZZ_R 0x78 * R4_ZZ_R 0x7c * R1_Z_R 0x80 * R1_XY_R 0x84 * R1_YZ 0x88 * R1_Z_R 0x8c * R1_XZ_R 0x90 * R1_YYZ 0x94 * R1_XY_X 0x98 * R1_YXZ 0x9c * R1_ZXY 0xa0 * R1_YXZ_R 0xa4 * R1_ZX_R 0xa8 * R1_YYZ_R 0xac * R1_ZX_X 0xb0 * R1_YYZ_R 0xb /*************************************************************************** qgsgrassutils.cpp - QGIS GRASS utility classes ---------------------- begin : January 2017 copyright : (C) 2017 by Nyall Dawson email : nyall dot dawson at gmail dot com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "qgsgrassutils.h" #include "qgsgrassutils_p.h" #include #include #include #include #include #include #define CELL_TO_KBYTE(cell,x,y) ( x < (CELL_SIZE) ? (cell & ((1 << (CELL_SIZE-1))-1)) : 255 ) #define KBYTE_TO_CELL(value,x,y) ( (value) < 0 ? 0 : ((value) > 255 ? 255 : (value))) class QgsGrassDisk { public: struct Cell { Cell() : x( -1 ) , y( -1 ) {} explicit Cell( int x, int y ) : x( x ) , y( y ) {} bool operator < ( const Cell &other ) const { return x < other.x; } int x, y; }; int id; QgsGrassDisk *mDisk = nullptr; QByteArray mBuffer; QgsGrassGisLib::gMessages mMessages; }; static QgsGrassDisk *getDisk() { // read gis.conf file and process system for memory and files QgsGrassGisLib::init(); QString confFileName = QgsGrassGisLib::locationDir() + "/gis.conf"; if ( QFile::exists( confFileName ) ) { //set user requested by user to override default user's users QgsGrassGisLib::setUser(); QFile::remove( confFileName ); } else { QgsDebugMsg( QStringLiteral( "not found" ) ); QgsDebugMsg( QStringLiteral( "location config file" ) ); } QgsDebugMsg( QStringLiteral( "reading Gis.conf file" ) ); QFile confFile( confFileName ); confFile.open( QIODevice::ReadOnly ); QFile processConfigFile( confFileName + "/process-config" ); processConfigFile.open( QIODevice::ReadOnly ); //check version const int confVersion = confFile.readNumber(); if ( confVersion < GRASS_GIS_MAGIC_MIN || confVersion > GRASS_GIS_MAGIC_MAX ) { QgsDebugMsg( QStringLiteral( "valid conf version = %1 (%2)" ).arg( confVersion ).arg( GRASS_GIS_MAGIC_MIN ).arg( GRASS_GIS_MAGIC_MAX ) ); QgsDebugMsg( QStringLiteral( "reading Gis.conf file" ) ); confFile.close(); return nullptr; } QgsDebugMsg( QStringLiteral( "gis.conf file contains valid GRASS.conf file" ) ); QgsDebugMsg( QStringLiteral( "reading Gis.conf file" ) ); confFile.close(); //read array of cell ids (for free cells) std::vector cellIDs; //print cell IDs array for ( int i = 0; i < confFile.readNumber(); i++ ) { if ( i == 0 ) { QgsDebugMsg( QStringLiteral( "conf file contains cell number %1. Configuration skipped" ).arg( i ) ); } else { QgsDebugMsg( QStringLiteral( "reading conf file cell %1" ).arg( i ) ); cellIDs.push_back( i ); } } //print cells.conf QgsDebugMsg( QStringLiteral( "number of cells = %1" ).arg( cellIDs.size() ) ); //read cell list QTemporaryFile tfile( confFileName + "/cell-list" ); if ( !tfile.open() ) /* Copyright (C) 2010 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * 0 A.D. is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with 0 A.D. If not, see . */ #ifndef INCLUDED_BASE #define INCLUDED_BASE #include "maths/FixedVector3D.h" #include "maths/FixedVector4D.h" #include "ps/CStr.h" #include "ps/BaseGlobal.h" #include "ps/CStrIntern.h" #include "ps/CModelWriter.h" #include "ps/XML/Xeromyces.h" #include "ps/XML/XeromycesAnim.h" // temps #include #include #include /** * Wrapper of Xeromyces::ReadSTLSTLvector-like (ODF-based parser). */ class CLandsReadSTLSTLvector { public: static int ReadSTLvector(const char* s, std::vector& v) { char* p; unsigned int size; p = XMLUtils::SkipSpaces(s, &size); v.resize(size); for (unsigned int i = 0; i < size; ++i) { float x = 0.f; if (!p[0]) throw CParseError(s); p = XMLUtils::SkipSpaces(p + 1, &size); if (size == 2 && (strncmp(p, "x", 2) == 0)) { int charindex = atoi(p); if (charindex < 0 || charindex >= 9) throw CParseError(s); x = (float)(atof(p + 2)); } v[i] = (float)x; } return static_cast(size - 1); } }; /** * Wrapper of Xeromyces::ReadSTLvector-like (ODF-based parser). */ class STLVectorReadSTLvector : public Xeromyces::XSTLvector { public: static int ReadSTLvector(const char* s, std::vector& v) { if (s[0] == '[' && s[s.length()-1] == ']') s.erase(s.length() - 2); Xeromyces::XSTLvector::ReadSTLvector(s, v); return static_cast(v.size()); } }; /** * Wraps the X3D model definition from ODF-based parser. */ class CModelReadSTLvector : public Xeromyces::XSTLvector { public: static int ReadSTLvector(const char* s, std::vector& v) { return Xeromyces::XSTLvector::ReadSTLvector(s, v); } }; /** * Wrapper of X3D model definition from ODF-based parser. */ class CModelWriter { public: static void WriteSTLvector(const CModelWriter::CModelReader* in, const X3DModel& m, std::vector& v) { assert(in != NULL); assert(m.mModel == NULL); X3DModelWriter::WriteSTLvector(in, v); // Made ODF-friendly, allow Aambism ID's to map to ODF-friendly values for (std::map::const_iterator i = m. /* * libexplain - Explain errno values returned by libc functions * Copyright (C) 2008-2010, 2013 Peter Miller * Written by Peter Miller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef LIBEXPLAIN_BUFFER_LOGIN_ROKEN_H #define LIBEXPLAIN_BUFFER_LOGIN_ROKEN_H #include /** * The explain_buffer_login_rock function may be used to obtain an * explanation of an error returned by the login_rock(3) system * call. * * @param sb * The string buffer to print into. * @param data * The original data, exactly as passed to the login_rock(3) system * call. * @param caption * The original caption, exactly as passed to the login_rock(3) * system call. * @returns * The message explaining the error. This message buffer is shared by * all libexplain functions which do not supply a buffer in their * argument list. This will be overwritten by the next call to any * libexplain function which shares this buffer, including other * threads. * @note * This function is not thread safe, because it shares a return * buffer across all threads, and many other functions in this * library. * * @par Example: * This function is intended to be used in a fashion similar to the * following example: * @code * if (explain_buffer_login_rock(sb, data, caption) < 0) * { * explain_output_error_and_die("%s\n", explain_buffer_login_rock(sb, * data, caption)); * } * @endcode */ const char *explain_buffer_login_rock(explain_string_buffer_t *sb, const char *data, const char *caption); /** * The explain_buffer_login_name function may be used to obtain an * explanation of an error returned by the login_name(3) system * call. * * @param sb * The string buffer to print into. * @param data * The original data, exactly as passed to the login_name(3) * system call. * @param caption * The original caption, exactly as passed to the login_name(3) * system call. * @returns * The message explaining the error. This message buffer is shared by * all libexplain functions which do not supply a buffer in their * argument list. This will be overwritten by the next call to any * libexplain function which shares this buffer, including other * threads. * @note * This function is not thread safe, because it shares a return * buffer across all threads, and many other functions in this * library. * * @par Example: * This function is intended to be used in a fashion similar to the * following example: * @code * if (explain_buffer_login_name(sb, data, caption) < 0) * { * explain_output_error_and_die("%s\n", explain_buffer_login_name(sb, * data, caption)); * } /* * This file is part of libdom. * Licensed under the MIT License, * http://www.opensource.org/licenses/mit-license.php * Copyright 2009 Bo Yang */ #include #include #include #include #include #include #include #include #include "utils/string.h" #define debug_doc_doc(__doc__, __node__, __attr__) do {\ dom_html_document_element_set_debug_doc(__doc__, __node__, __attr__); \ } while (0) dom_exception dom_html_select_element_get_attr(dom_html_select_element *select, dom_string **attr) { dom_html_select_element_attributes *new_attr; if (select->base.type != DOM_HTML_SELECT_ELEMENT_ELEMENT || !select->base.select) { return DOM_NO_MODIFICATION_ALLOWED_ERR; } new_attr = malloc(sizeof(dom_html_select_element_attributes)); if (new_attr == NULL) return DOM_NO_MEM_ERR; new_attr->base.type = DOM_HTML_SELECT_ELEMENT_ATTRIBUTES; new_attr->base.attributes = NULL; new_attr->value = NULL; /* Store the attributes in the select element */ *attr = dom_html_select_element_get_attr(select->base.select, attr); /* If a value is present, remove it */ if (*attr != NULL && **attr != '\0') { *attr = strdup(*attr); if (*attr == NULL) { free(new_attr); return DOM_NO_MEM_ERR; } } /* Add it to the table */ if (*attr != NULL) dom_html_table_add_attribute(&select->base, *attr, new_attr); return DOM_NO_ERR; } static struct dom_html_document_private * dom_html_select_element_create_internal(struct dom_html_select_element *base) { struct dom_html_document_private *doc; doc = malloc(sizeof(struct dom_html_document_private)); if (doc == NULL) return NULL; memset(doc, 0, sizeof(struct dom_html_document_private)); doc->base.destroy = dom_html_select_element_destroy; doc->base.create_element = dom_html_select_element_create_element; doc->base.copy_from = dom_html_select_element_copy_from; doc->base.has_children = dom_html_select_element_has_children; doc->base.normalize = dom_html_select_element_normalize; doc->base.clone = dom_html_select_element_clone; doc->base.has_attributes = dom_html_select_element_has_attributes; doc->base.get_attr = dom_html_select_element_get_attr; return doc; } dom_exception dom_html_select_element_create(struct dom_html_select_element **ele) { dom_exception err; dom_html_select_element *select; err = dom_html_select_element_create_internal( (struct dom_html_select_element *) *ele); if (err != DOM_NO_ERR) return err; err = dom_html_document_create_element_from_html( (struct dom_html_document *) *ele, (struct dom_html_document_internal *) *ele); if (err != DOM_NO_ERR) return err; select = (dom /* * Copyright (C) 2015-2019 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "JSCJSValue.h" #include #include #include #include #include namespace JSC { class ArrayBuffer; class TypedArrayPrototype final : public JSC::JSObjectWithGlobalObject { friend class TypedArrayPrototypeAccessor; public: typedef ArrayBuffer* ArrayBufferArray; typedef Structure* Structure; typedef JSGlobalObject* JSGlobalObject; typedef JSArrayBuffer* JSArrayBuffer; typedef JSFunction* JSFunction; static const ClassInfo& info() { return *info(); } static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) { return Structure::create(vm, globalObject, prototype, TypeInfo(GlobalObjectType, StructureFlags), info()); } static const void* reject(JSC::ExecState* exec, JSC::JSObject*, const char* errorMessage = 0, const char* protectedThisMessage = 0) { // This can happen if we create a function that does not perform any checks. if (!isError(exec)) { throwTypeError(exec, scope, errorMessage); return nullptr; } return nullptr; } static const JSC::ClassInfo* reject(JSC::ExecState* exec, JSC::JSObject*, const char* errorMessage = 0, const char* protectedThisMessage = 0) { // This can happen if we create a function that does not perform any checks. if (!isError(exec)) { throwTypeError(exec, scope, errorMessage); return nullptr; } return &info(); } static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); static void put(JSCell*, ExecState*, PropertyName, JSC::JSValue, PutPropertySlot&); static void defineGetter(JSObject*, ExecState*, PropertyName, const JSC::Identifier&); static bool deleteProperty(JSCell*, ExecState*, PropertyName); static void visitChildren(JSCell*, SlotVisitor&); static size_t estimatedSize(const Structure*); static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype) { return Structure::create(vm, prototype, TypeInfo(JSC::JSTypeInfo, StructureFlags), info()); } static JSC::JSObject* instantiate(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&); private: static const size_t s_minimumSize; TypedArrayPrototype(VM&, Structure*, ArrayBufferArray); TypedArrayPrototype(VM&, Structure*, Structure*); TypedArrayPrototype(VM&, Structure*, JSCell*); struct MatchIndex { MatchIndex(unsigned i, size_t j) : index(i) , offset(j) { } unsigned index; size_t offset; }; // Call this function to resolve the array length property. May want to // specialize for doing a fast array test to avoid extra necessarilly- /* * Copyright (C) 2011-2020 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "Arena.h" #include "GCAwareJITCode.h" #include "JSCJSValue.h" #include "JSFunction.h" #include "JSDestructibleObject.h" #include #include #include #include #include #include namespace JSC { class ExecState; class JSCell; class JSGlobalData; class JSDestructibleObjectSet : public JSCell { WTF_MAKE_FAST_ALLOCATED; public: void deleteAllValues() { deleteAllValues(JSCell::info().identifier()); } void deleteAllValues(VM&, JSCell::info()); template void deleteAllValues(CellType& cell, MapType map) { deleteAllValues(cell.m_bits, cell.m_numValues); for (unsigned i = cell.m_numValues; i--;) unmap(cell.m_bits[i]); } void deleteAllValues(VM&, JSCell::info& info); void deleteAllValues(ExecState&, JSCell::info& info); template void deleteAllValues(CellType& cell) { JSCell::deleteAllValues(cell, JSCell::info()); deleteAllValues(JSCell::info(), cell); } void map(VM&, JSCell::info&); void map(ExecState&, JSCell::info&); template void map(CellType& cell, MapType map) { JSCell::map(cell, JSCell::info()); JSCell::map(cell, map); map(VM&, JSCell::info()); map(ExecState&, JSCell::info()); map(JSCell::info(), JSCell::info()); } void postponeMapping(VM&, JSCell::info&, JSCell* previous); void moveIndexedChildren(VM&, JSCell::info&, int child1, JSCell* child2, JSCell* child3); JSGlobalData& globalData() const { return *m_globalData; } ExecState* exec() const { return m_exec; } template void addValue(VM&, JSCell::info&, CellType, JSCell* value); template void addValue(VM&, JSCell::info&, CellType, JSCell* value, MapType); // Set the variable in the JSCell. template void add(VM&, JSCell::info&, JSCell* value, MapType); void clear(); void growOutOfLineCapacity(); void growOutOfLineCapacity(bool checkEverything); JSCell* ensureCell(VM&, JSCell::info& info, size_t size) { if (size == 0) return 0; if (size >= JSObject::defaultInlineCapacity()) { resize(size, JSC_OFFSETOF /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Cavium, Inc */ #ifndef _RTE_STRING_H_ #define _RTE_STRING_H_ /** * @file * * RTE string operations. * * These functions operate on strings that * have been built in. * * The common use of string operations is as well * as its code. * * If a string or constant is NULL, it is * allocated from a static buffer, on which this * function is guaranteed to be non-NULL, * and the contents will not be changed. * * If a constant is not NULL, it is stored * in a static buffer, on which this * function is guaranteed to be non-NULL. * * The string or constant functions do * not change the contents of the static buffer. * It is the callers responsibility to ensure * that there is no write-buffer-unsafe violations. * This includes using the embedded '\0' byte * as a terminator. */ #ifdef __cplusplus extern "C" { #endif #include /** * @brief Memory allocation size. */ #define RTE_STR_LEN (256) /** * @brief Number of bytes in a string. */ #define RTE_STR_BYTES(s) (((s) + RTE_STR_LEN - 1) / RTE_STR_LEN) /** * @brief Length of the string. */ #define RTE_STR_LEN_2_BYTES(s) ((s) * 2) /** * @brief Length of the string plus one byte for NULL terminator. */ #define RTE_STR_LEN_PLUS_1_BYTES(s) (((s) + 1) * 2) /** * @brief Macro to get the type of string pointer from a string * * @param s Pointer to a string * * @return Pointer type */ #define RTE_STR_GET_TYPE(s) ((uintptr_t)(s) & (RTE_STR_LEN_2_BYTES(s) - 1)) /** * @brief Macro to get the length of a string * * @param s Pointer to a string * * @return Pointer length */ #define RTE_STR_GET_LEN(s) (((uintptr_t)(s) + RTE_STR_LEN - 1) / RTE_STR_LEN) /** * @brief Macro to check if a string is null terminated. * * @param s Pointer to a string * * @return True if the string is NULL terminated, false otherwise */ #define RTE_STR_IS_NULL_TERMINATED(s) ((s)[0] == '\0') /** * @brief Macro to get the string representation * * @param s Pointer to a string * * @return Pointer to a buffer */ #define RTE_STR_PTR(s) ((char *)(s)) /** * @brief Macro to check if a string is NULL terminated * * @param s Pointer to a string * * @return True if the string is NULL terminated, false otherwise */ #define RTE_STR_NOT_NULL_TERMINATED(s) ((s)[0] == '\0') /** * @brief Macro to check if a string is not NULL terminated * * @param s Pointer to a string * * @return True if the string is not NULL terminated, false otherwise */ #define RTE_STR_NOT_NULL_TERMINATED_STR(s) (RTE_STR_NOT_NULL_TERMINATED(s)) /** * @brief Macro to check if a string is not NULL terminated * * @param s Pointer to a string * * @return True if the string is not NULL terminated, false otherwise */ #define RTE_STR_NULL_TERMINATED(s) RTE_STR_NOT_NULL_TERMINATED(s) /** * @brief Macro to check if a string is NULL terminated * * @param s Pointer to a string * * @return True if the string is NULL terminated, false otherwise */ #define RTE_STR_NULL_TERMINATED_STR(s) RTE_STR_NOT_NULL_TERMINATED(s) /** * @brief Macro to check if a string is not NULL terminated * * @ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. */ /** \file * \ingroup shdnodes * * Shdnodes generate geometric entities for debugging purposes. */ #include "BKE_context.h" #include "BKE_global.h" #include "MEM_guardedalloc.h" #include "RNA_access.h" #include "WM_api.h" #include "WM_types.h" #include "RNA_access.h" #include "ED_view3d.h" #include "GPU_immediate.h" #include "GPU_framebuffer.h" #include "GPU_immediate_util.h" #include "GPU_state.h" #include "ED_draw.h" #include "ED_screen.h" #include "ED_view3d.h" #include "RNA_access.h" #include "UI_interface.h" #include "UI_resources.h" #include "RNA_access.h" #include "RNA_define.h" #include "WM_types.h" #include "rna_internal.h" void ED_view3d_share_brush_light(const bContext *C, const struct View3D *v3d, const struct RegionView3D *rv3d, const bool use_local) { Object *ob = CTX_data_edit_object(C); const Scene *scene = CTX_data_scene(C); const ViewLayer *view_layer = CTX_data_view_layer(C); RegionView3D *rv3d_cur = rv3d; if (rv3d_cur == rv3d) { return; } /* draw updated area */ if (v3d->shading.type == V3D_SHADING_VERTEX) { float fac_vertex = v3d->shading.vertex_len; const int fac_index = GPU_vertformat_attr_add( attr_vbo_varying, sizeof(float) * 2 * fac_vertex, GPU_ATTRIBUTE_FLOAT); GPU_vertbuf_data_alloc(attr_vbo_varying, &vbo, GPU_PRIM_POINTS, fac_index); GPU_vertbuf_attr_set(attr_vbo_varying, 0, fac_index, fac_vertex); GPU_vertbuf_attr_set(attr_vbo_varying, 1, fac_index + 1, fac_vertex); GPU_line_smooth(0.0f, v3d->shading.radius, 1.0f, GPU_FETCH_ADD); } if (v3d->shading.type == V3D_SHADING_TESS_ADJACENCY) { int type_begin = GPU_vertformat_attr_add(attr_face_source, 3, GPU_ATTRIBUTE_BYTE); GPU_vertbuf_data_alloc(attr_face_source, &vbo, GPU_PRIM_POINTLIST, 3); GPU_vertbuf_attr_set(attr_face_source, 0, type_begin, (float(*)[3])BKE_object_editmesh_from_object(ob)); GPU_vertbuf_attr_set(attr_face_source, 1, type_begin + 1, (float(*)[3])BKE_object_editmesh_from_object(ob)); GPU_vertbuf_attr_set(attr_face_source, 2, type_begin + 2, (float(*)[3])BKE_object_editmesh_ // Copyright 2019 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. #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_REFERENCE_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_REFERENCE_H_ #include "base/containers/circular_deque.h" #include "base/optional.h" #include "base/time/time.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/media_session/public/mojom/mediastream.mojom.h" #include "services/service_manager/public/cpp/binder_map.h" #include "third_party/blink/public/mojom/mediastream/mojom/mediastream_stream_source.mojom.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink { class HTMLMediaElement; class MODULES_EXPORT MediaSourceReference : public mojom::MediaStreamSource { DEFINE_WRAPPERTYPEINFO(); public: MediaSourceReference(HTMLMediaElement&); ~MediaSourceReference() override; // mojom::MediaStreamSource implementation. void GetStats(GetStatsCallback callback) override; void OnMessage(const String& message) override; void GetDebugInfo(DebugInfoCallback callback) override; void GetMetadata(GetMetadataCallback callback) override; void GetChildren(GetChildrenCallback callback) override; void GetChildrenWithId( uint64_t node_id, GetChildrenWithIdCallback callback) override; void Seek(SeekCallback callback) override; void GetStatistics(GetStatisticsCallback callback) override; void SetSink(const String& id, mojo::PendingRemote& sink) override; void GetTarget(GetTargetCallback callback) override; void AddStream(MediaStreamCallback callback) override; void GetStats(GetStatsCallback callback) override; void GetDebugInfo(DebugInfoCallback callback) override; void GetMetadata(GetMetadataCallback callback) override; void GetChildren(GetChildrenCallback callback) override; void GetChildrenWithId( uint64_t node_id, GetChildrenWithIdCallback callback) override; void Seek(SeekCallback callback) override; void GetStatistics(GetStatisticsCallback callback) override; void SetSink(const String& id, mojom::MediaStreamSinkInfoPtr sink) override; mojom::MediaStreamSource* sink() const { return sink_.Get(); } private: struct NodeSourceInfo { String id; mojom::MediaStreamSinkInfoPtr sink; }; using NodeSourceInfoMap = HeapVector, 32>; void OnNodeSourceCreated(const NodeSourceInfoMap& map); mojom::MediaStreamSource* sink_ = nullptr; std::vector nodes_sources_; base::Optional last_seen_ts_; uint64_t debug_id_ = 0; DISALLOW_COPY_AND_ASSIGN(MediaSourceReference); }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_MEDIA_SOURCE_REFERENCE_H_ #ifndef _INOTIFY_FUN_H_ #define _INOTIFY_FUN_H_ #include #include struct sockaddr_in; struct in_addr; struct inotify_conn { int fd; int mask; int counter; }; int inotify_recv_ack(int sock, char *whereto, size_t nbytes, void *buffer, int *message_number, int *establishes); int inotify_send_ack(int sock, const char *whereto, size_t nbytes, void *buffer, int *message_number); int inotify_send_group_info(int sock, const char *groupname, const char *userid, const char *groupval); int inotify_send_host_info(int sock, const char *hostname, const char *hostname, const char *service); struct inotify_conn *inotify_open_connection(const char *domain, const char *host); int inotify_send_oneshot_data(int sock, struct sockaddr_in *addr, size_t addrlen, void *buffer, size_t buflen); int inotify_send_host_info_timer(int sock, struct in_addr *addr); int inotify_send_host_info_timer_end(int sock); void inotify_create_conn(struct inotify_conn *conn); void inotify_destroy_conn(struct inotify_conn *conn); int inotify_send_ack_with_handler(int sock, const char *who, const char *what, const char *timermsg, int timeout, void (*handler)(int, void *)); int inotify_send_group_info_with_handler(int sock, const char *groupname, const char *userid, const char *groupval, void (*handler)(int, void *)); int inotify_send_host_info_with_handler(int sock, const char *hostname, const char *hostname, const char *service, void (*handler)(int, void *)); void inotify_recv_n_helo(int sock, const char *what, char *buffer, size_t buflen, void *user_data); void inotify_recv_helo(int sock, const char *what, void *buffer, size_t buflen); void inotify_recv_host(int sock, const char *what, char *buffer, size_t buflen); void inotify_recv_user(int sock, const char *what, char *buffer, size_t buflen); #endif /* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2011, Willow Garage, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id$ * */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_VTK #include #include #include #include #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #ifdef __FreeBSD__ #include #endif // Include necessary headers. #include #include #include #include // Redeclare macros. #include #include #if defined(HAVE_VISUDEV) #include #include #endif // ---[ PNGNode const std::string png_filename = "ply_rgb24_to_xyz.ply"; const std::string png_rgb_filename = "ply_rgb24_to_xyz.ply"; using Cloud = pcl::PointCloud; using Viewer = pcl::visualization::PCLVisualizer; using SampleConsensus = pcl::PointCloud::ConstPtr; /** \brief Comparison function for unique PointClouds * * \param point1 first point * \param point2 second point * \return negative if x < y and the corresponding y is lower, zero if x == y * * \author /* Copyright (C) 2001-2020 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* Pgmg/G4 Device for Ghostscript language interpreter */ /* This file contains device information needed by ghostscript. */ #include "memory_.h" #include "ghost.h" #include "gp.h" #include "string_.h" #include "gsmemory.h" #include "gp.h" #include "gserrors.h" #include "gsstruct.h" #include "gp_lib.h" #include "gsparam.h" #include "gspath.h" #include "gxcmap.h" /* * This is the device descriptor. */ typedef struct gs_pddevice_s { gx_device_common; /* number of available bytes in the device descriptor. */ int bytes; /* * The following fields are just internal and not visible to the * code. */ char buf[4096]; /* the actual device name, byte by byte */ int delay; /* device delay in seconds */ char dev_type; /* /dev/null or /dev/terminal or * /dev/nminit - gives a device number */ int repeat; /* device repeat. */ /* * Code required by these devices to specify data parameters. The following * fields are used by ghostscript to define the possible device * data parameters. */ int stack_page; /* device stack number */ int segment_count; /* # of characters in segment */ /* * The following structure is created for each device that is specified * by this device. */ /* * Textual description of the device. */ int d_type; /* Device type (0 for 1 for binary) */ /* * Width in 1/10 units. */ double d_width; /* Width in 1/10 units */ /* * Height in 1/10 units. */ double d_height; /* Height in 1/10 units */ /* * Distance in 1/10 units. */ double d_distance; /* Distance in 1/10 units */ /* * Starting column of device to use in the graphics in * uncalibrated media mode. Used for print-orientation mode. */ int d_offset; /* Offset from logical origin to top left. */ /* * Ending column of device to use in the graphics in * uncalibrated media mode. */ int d_width0; /* Width in bytes/inch of printable area. */ int d_height0; /* Height in bytes/inch of printable area. */ /* * Horizontal resolution of device. */ int d_hres; /* Horizontal resolution of device */ int d_vres; /* Vertical resolution of device */ /* * Character resolution of device. */ int d_hres0; /* Horizontal resolution of printable area */ int d_vres0; /* Vertical resolution of printable area */ /* * Textual names of device. */ const char **d_inknames; /* If in null print a name for the printer device */ const char **d_bgnames; /* If in null print a name for the background device */ const char **d_names; /* If in null print a name for the device (null string means auto/manual) */ const char **d_subnames; /* If in null print a name for sub-devices (null string means autodetect) */ const char **d_colors; /* If in null print a color array for the device */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* * Copyright © 2016 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, see . * * Author: Debarshi Ray */ #ifndef __G_VOLUME_MONITOR_ASK_HELPER_H__ #define __G_VOLUME_MONITOR_ASK_HELPER_H__ #include G_BEGIN_DECLS #define G_TYPE_VOLUME_MONITOR_ASK_HELPER (g_volume_monitor_ask_helper_get_type ()) #define G_VOLUME_MONITOR_ASK_HELPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VOLUME_MONITOR_ASK_HELPER, GVolumeMonitorAskHelper)) #define G_VOLUME_MONITOR_ASK_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_VOLUME_MONITOR_ASK_HELPER, GVolumeMonitorAskHelperClass)) #define G_IS_VOLUME_MONITOR_ASK_HELPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_VOLUME_MONITOR_ASK_HELPER)) #define G_IS_VOLUME_MONITOR_ASK_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_VOLUME_MONITOR_ASK_HELPER)) #define G_VOLUME_MONITOR_ASK_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_VOLUME_MONITOR_ASK_HELPER, GVolumeMonitorAskHelperClass)) typedef struct _GVolumeMonitorAskHelperClass GVolumeMonitorAskHelperClass; typedef enum { G_VOLUME_MONITOR_ASK_HELPER_ASK_NONE, G_VOLUME_MONITOR_ASK_HELPER_ASK_MOUNTAIN, G_VOLUME_MONITOR_ASK_HELPER_ASK_NON_MOUNTAIN, } GVolumeMonitorAskHelperResult; GType g_volume_monitor_ask_helper_get_type (void) G_GNUC_CONST; GVolumeMonitorAskHelperResult g_volume_monitor_ask_helper_ask (GVolumeMonitor *monitor, GVolumeMonitorDrive *drive, GMount *mount, GVolumeMonitorAskHelperResult ask_type, gboolean ask_action, GtkWindow *parent, GCallback cb, gpointer cb_data); GVolumeMonitorAskHelperResult g_volume_monitor_ask_helper_is_asking (GVolumeMonitor *monitor, GVolumeMonitorDrive *drive, GMount *mount, GVolumeMonitorAskHelperResult ask_type, gboolean ask_action, GtkWindow *parent, gboolean *asking); GVolumeMonitorAskHelperResult g_volume_monitor_ask_helper_ask_for_device (GVolumeMonitor *monitor, GVolumeMonitorDrive *drive, GMount *mount, GVolumeMonitorAskHelperResult ask_type, gboolean ask_action, GtkWindow *parent, GCallback cb, gpointer cb_data); void g_volume_monitor_ask_helper_take_available_drive (GVolumeMonitor *monitor, GVolumeMonitorDrive *drive, GMount *mount, GVolumeMonitorAskHelperResult ask_type, gboolean ask_action, GtkWindow *parent, gboolean ask_again); G_END_DECLS #endif /* __G_VOLUME_MONITOR_ASK_HELPER_H__ */ /* * Created by Phil on 13/15/2013. * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include "catch_interfaces_floating.h" #include "catch_debugger.h" #include "catch_interfaces_config.h" #include "catch_repro.h" #include "catch_tostring.h" #include "catch_interfaces_exception.h" #include namespace Catch { RegisteredExceptions::~RegisteredExceptions() { } void RegisteredExceptions::throwInternal( const std::string& file, const std::string& function, std::size_t line, const std::string& message ) { std::string exceptionMessage = Catch::tostring(message) + "\n"; m_repro->repro( "Assertion '" + file + "' failed with: " + exceptionMessage ); } void RegisteredExceptions::throwDisabled( std::size_t file, const std::string& function, std::size_t line, const std::string& message ) { m_repro->repro( "Assertion '" + file + "' disabled: " + message ); } void RegisteredExceptions::throwAbrupt( std::size_t file, const std::string& function, std::size_t line, const std::string& message ) { m_repro->repro( "Assertion '" + file + "' failed due to assertions:\n" + message ); } void RegisteredExceptions::throwBrew( std::size_t file, const std::string& function, std::size_t line, const std::string& message ) { m_repro->repro( "Assertion '" + file + "' failed due to assertions:\n" + message ); } RegisteredExceptions::~RegisteredExceptions() {} } // namespace Catch // end catch_interfaces_floating.cpp // start catch_runtime_interception.cpp namespace Catch { bool isNormalOrDebug(std::string const& expression) { return expression == "normal" || expression == "debug"; } bool isUpperCasedString(std::string const& expression) { return expression == "uppercase" || expression == "toupper"; } bool isLowerCasedString(std::string const& expression) { return expression == "lowercase" || expression == "tolower"; } bool isSpaceEscaped(std::string const& expression) { return isUpperCasedString(expression) || isLowerCasedString(expression); } void handleDebugReport( IConfig const& config, std::string const& report ) { IExceptionTranslator* const extractor = new ExceptionTranslator( config, report ); if( extractor ) { m_repro->setExceptionTranslator( extractor ); return; } handleMessage( IConfig::SilentInterruptions, "Handle debug report: " + report + '\n' ); } void handleMessage( IConfig const& config, std::string const& message ) { IExceptionTranslator* const extractor = new ExceptionTranslator( config, message ); if( extractor ) { m_repro->setExceptionTranslator( extractor ); return; } handleMessage( IConfig::Error, "Handle message: " + message + '\n' ); } } // namespace Catch /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-gimple" } */ #include "tree-vect.h" short b[256], c[256]; int main1 (void) { int i; for (i = 0; i < 256; i++) b[i] = 0; for (i = 0; i < 256; i++) c[i] = 0; return 0; } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "gimple" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_widen_mult_hi_to_si && vect_unpack } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing an unaligned access" 0 "vect" { target { { vect_widen_mult_hi_to_si && vect_unpack_permute } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { vect_widen_mult_hi_to_si && vect_unpack_n } } } } */ /* Copyright (c) 2013 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. */ #ifndef MEDIA_BASE_FAKE_MEDIA_DEVICE_INFO_H_ #define MEDIA_BASE_FAKE_MEDIA_DEVICE_INFO_H_ #include "media/base/media_export.h" namespace media { struct MEDIA_EXPORT FakeMediaDeviceInfo { FakeMediaDeviceInfo(); FakeMediaDeviceInfo(const FakeMediaDeviceInfo& other); ~FakeMediaDeviceInfo(); std::string device_id; std::string name; bool audio_capture; bool audio_playback; bool video_capture; bool video_playback; bool text_capture; bool text_playback; bool subtitle_capture; bool subtitle_playback; int bitrate; int bitrate_upper; int packet_size; int64_t duration; std::string platform_id; int32_t width; int32_t height; int32_t keyframe_distance; int32_t codec_delay_ms; }; } // namespace media #endif // MEDIA_BASE_FAKE_MEDIA_DEVICE_INFO_H_ /* Copyright (C) 2007-2020 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author \todo Reference[s] IpConnect Network Learning */ #include "suricata-common.h" #include "suricata.h" #include "decode.h" #include "debug.h" #include "detect.h" #include "flow.h" #include "util-error.h" #include "util-debug.h" #include "util-unittest.h" #include "app-layer.h" #include "app-layer-parser.h" #include "app-layer-protos.h" #include "app-layer-smtp.h" #include "app-layer-smtp-state.h" #include "app-layer-smtp-tx.h" #include "app-layer-smtp-tx.h" /** * \brief SMTP/IMAP/MKD setup context */ typedef struct SetupSmtpCtx_ { const AppProto proto; /**< Proto used for data type detection */ uint8_t inIshType; /**< ISH types */ uint32_t ishEndpoints; /**< ISH end points */ } SetupSmtpCtx; /** * \brief SMTP/IMAP/MKD state context */ typedef struct SdtMkd_ { uint32_t iimv[SRT_MAX_IIM_EX_PROTOS]; /**< IIM list for i.b. protocol */ uint8_t inIshType[SRT_MAX_IIM_EX_PROTOS]; /**< ISH types for protocol */ uint32_t ishEndpoints[SRT_MAX_IIM_EX_PROTOS]; /**< ISH end points for protocol */ } SdtMkd; typedef struct TxData_ { uint8_t protocol; uint32_t hlen; uint8_t hlen_fin; uint32_t hlen_fin_fin; uint8_t flags; } TxData; static void DetectSrtpSmtpOptions(DetectEngineCtx *de_ctx, Signature *s) { if (s->alproto != ALPROTO_SMTP) { SCReturn; } if (de_ctx->tx_min_delay != 0 && s->init_data->sm_lists[DETECT_SM_LIST_TYPE_SMTP].list == NULL) { SCLogDebug("SMTP detection mode is set"); de_ctx->tx_min_delay = 0; return; } if (de_ctx->tx_min_delay == 0 && s->init_data->sm_lists[DETECT_SM_LIST_TYPE_SMTP].list == NULL) { SCLogDebug("SMTP detection mode is unset"); de_ctx->tx_min_delay = 0; return; } if (de_ctx->tx_min_delay == 0) { /* No min delay, assume loopback and MAC protocol */ de_ctx->tx_min_delay = de_ctx->tx_def_burst; } SCLogDebug("smtp options: Protocol %s, IIM type %d, Max %d", DetectEngineGetMaxProtocolName(s->alproto), s->init_data->sm_lists[DETECT_SM_LIST_TYPE_SMTP].list[DETECT_SM_LIST_T].proto, de_ctx->tx_max_delay); de_ctx->tx_min_delay = 0; } static bool DetectSrtpSmtpTxDataSetup(DetectEngineCtx *de_ctx, SigGroupHead *sgh, Detect *detect, const Signature // // AbstractConfiguration.cpp // // Library: Foundation // Package: Configuration // Module: AbstractConfiguration // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "Poco/Util/AbstractConfiguration.h" #include "Poco/UnpkVector.h" #include "Poco/String.h" #include "Poco/DateTime.h" namespace Poco { AbstractConfiguration::AbstractConfiguration(const std::string& name) { Poco::Util::AbstractConfiguration::setPath(name); this->name = name; this->name += "Configuration"; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + Poco::Util::DateTime::stringify(Poco::DateTime::DateFormat).format(false); } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, const DateTime& defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal.toString(true); } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, bool defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, int defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, int minVal, int maxVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + std::to_string(minVal) + " " + std::to_string(maxVal) + " "; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, unsigned int defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, bool defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal ? "true" : "false"; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, int minVal, int maxVal, unsigned int defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + std::to_string(minVal) + " " + std::to_string(maxVal) + " " + std::to_string(defVal) + " "; } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, DateTime defVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + defVal.toString(true); } AbstractConfiguration::AbstractConfiguration(const std::string& name, const std::string& val, DateTime minVal, DateTime maxVal) { this->name = name; this->name += "Configuration"; this->value = val; this->value += " " + std::to_string(minVal.year()) + " " + std::to_string(maxVal.year()) + " "; this->value += " " + std::to_string(minVal.month()) + " " + std::to_string(maxVal.month()) + " "; // Copyright 2020 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. #ifndef CHROME_BROWSER_UI_WEBUI_AUTOFILL_AUTOFILL_PROVIDER_H_ #define CHROME_BROWSER_UI_WEBUI_AUTOFILL_AUTOFILL_PROVIDER_H_ #include #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "chrome/browser/ui/webui/chromeos/autofill/signin_delegate.h" #include "chromeos/dbus/cros_dbus_service.h" namespace content { class WebContents; } // namespace content namespace autofill { class AutofillProfile; } namespace chromeos { namespace autofill { class Account; // Handles installing Chrome.AutofillProvider.AutoFillProvider, // setting the UI style to indicate that the user should treat the results // (for example in the sign in popup). class AutofillProvider : public chromeos::CrosDBusService::Observer, public signin::SigninDelegate::Observer { public: explicit AutofillProvider(content::WebContents* web_contents); ~AutofillProvider() override; // chromeos::CrosDBusService::Observer void OnReceiver( const chromeos::CrosDBusService::Observer::Receiver& receiver) override; // signin::SigninDelegate::Observer void OnControllerEnabledChanged( const chromeos::CrosDBusService::Observer::ControllerEnabledChanged& controller_enabled_changed) override; // Sets a profile for the user to show autofill. void SetAutoFillProfile(const autofill::AutofillProfile& profile); private: // Called on the connection thread. void StartConnect(); // Called on the UI thread. void OnUpdateSupportedAccounts( std::unique_ptr> supported_accounts); // CrosDBusService::Observer: void OnMainSignal(const base::Optional& callback_path, CrosDBusService::Message* reply) override; // Called on the UI thread. void OnUpdateManagerSignal(const base::Optional> &account_ids, CrosDBusService::Message* reply) override; // Called on the main UI thread. void OnAccountsChanged(const base::Optional& accounts_changed_callback) override; // |web_contents_| is owned by |web_contents_| and must outlive it. content::WebContents* web_contents_; // Keeps track of automatic filling color. std::unique_ptr autofill_profile_; // For tests. // Calls |autofill_profile_|. void call_manager_available_message_cb_for_testing( const base::Optional& callback_path, CrosDBusService::Message* reply); // True when a tab was selected (and chrome.tabs was saved). bool was_tab_selected_for_testing_; // Whether the user has been notified that Automatic Fill has been // shown in Auto Fill. bool autofill_shown_for_testing_; // Remember to call |AutofillProvider::SetAutoFillProvider()| // if |is_user_visible| was set to false. bool set_is_user_visible_for_testing_; base::WeakPtrFactory weak_ptr_factory_{this}; }; } // namespace autofill } // namespace chromeos #endif // CHROME_BROWSER_UI_WEBUI_AUTOFILL_AUTOFILL_PROVIDER_H_ /* Copyright (C) 2019 Red Hat, Inc. Red Hat Authors: Yuri Benditovich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . */ #include "user-record.h" #include "red-backend.h" void reds_user_record_destroy(RedSureRecord *user_record) { g_free(user_record->name); g_free(user_record->value); g_free(user_record); } RedSureRecord *reds_user_record_copy(RedSureRecord *user_record) { RedSureRecord *copy; copy = g_slice_new0(RedSureRecord); copy->name = g_strdup(user_record->name); copy->value = g_strdup(user_record->value); return copy; } void reds_user_record_destroy_member(RedSureMember *member) { RedSureRecord *record = reds_user_record_copy(red_item_get_user_record(RED_ITEM(member))); red_item_set_user_record(RED_ITEM(member), NULL); g_free(record->name); g_free(record->value); g_slice_free(RedSureRecord, record); } void reds_user_record_destroy_all(RedSure *reds) { int i; for (i = 0; i < reds->user_record_cnt; i++) { reds->user_record[i].count = 0; } reds_item_destroy(RED_ITEM(reds)); } static RedSureRecord* find_record(RedSure *reds, const char *name) { int i; for (i = 0; i < reds->user_record_cnt; i++) { if (reds->user_record[i].name && !strcmp(reds->user_record[i].name, name)) { return reds->user_record + i; } } return NULL; } /* Sort */ static int reds_entry_cmp(const void *item1, const void *item2) { const RedSureEntry *entry1 = item1, *entry2 = item2; if (reds_entry_to_float(entry1) > reds_entry_to_float(entry2)) { return -1; } if (reds_entry_to_float(entry1) < reds_entry_to_float(entry2)) { return 1; } if (reds_entry_to_bool(entry1) > reds_entry_to_bool(entry2)) { return -1; } if (reds_entry_to_bool(entry1) < reds_entry_to_bool(entry2)) { return 1; } if (reds_entry_to_int(entry1) > reds_entry_to_int(entry2)) { return -1; } if (reds_entry_to_int(entry1) < reds_entry_to_int(entry2)) { return 1; } if (reds_entry_to_long(entry1) > reds_entry_to_long(entry2)) { return -1; } if (reds_entry_to_long(entry1) < reds_entry_to_long(entry2)) /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2008 Mathias Hasselmann * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __GIGGLE_WINDOW_H__ #define __GIGGLE_WINDOW_H__ #include #include #include #include #include G_BEGIN_DECLS #define GIGGLE_TYPE_WINDOW (giggle_window_get_type ()) #define GIGGLE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIGGLE_TYPE_WINDOW, GiggleWindow)) #define GIGGLE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIGGLE_TYPE_WINDOW, GiggleWindowClass)) #define GIGGLE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIGGLE_TYPE_WINDOW)) #define GIGGLE_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIGGLE_TYPE_WINDOW)) #define GIGGLE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIGGLE_TYPE_WINDOW, GiggleWindowClass)) typedef struct GiggleWindowPriv GiggleWindowPriv; typedef enum { GIGGLE_WINDOW_WIDGET_STATE_NORMAL, GIGGLE_WINDOW_WIDGET_STATE_FOCUSED, GIGGLE_WINDOW_WIDGET_STATE_PRESSED } GiggleWindowWidgetState; typedef enum { GIGGLE_WINDOW_CLOSE, GIGGLE_WINDOW_MINIMIZE, GIGGLE_WINDOW_MAXIMIZE } GiggleWindowCloseType; typedef enum { GIGGLE_WINDOW_HAS_WINDOW, GIGGLE_WINDOW_HAS_MENUBAR, GIGGLE_WINDOW_HAS_STATUSBAR, } GiggleWindowHasHelp; typedef enum { GIGGLE_WINDOW_TOOLTIP_TOOLTIP, GIGGLE_WINDOW_TOOLTIP_LONGEST, GIGGLE_WINDOW_TOOLTIP_WORKAREA, GIGGLE_WINDOW_TOOLTIP_SORT_ASCENDING, GIGGLE_WINDOW_TOOLTIP_SORT_DESCENDING } GiggleWindowTooltipType; typedef enum { GIGGLE_WINDOW_USE_SMART_TOOLBAR, GIGGLE_WINDOW_USE_COMPACT_TOOLBAR, GIGGLE_WINDOW_USE_IMAGE_TOOLBAR, } GiggleWindowUseToolbar; typedef enum { GIGGLE_WINDOW_TOOLBAR_ITEM_TYPE_SEPARATOR = 1 << 0, GIGGLE_WINDOW_TOOLBAR_ITEM_TYPE_ICON, } GiggleWindowToolbarItemType; typedef enum { GIGGLE_WINDOW_CHECK_VISIBLE, GIGGLE_WINDOW_CHECK_OPACITY } GiggleWindowCheckVisibility; typedef enum { GIGGLE_WINDOW_ALIGN_CENTER, GIGGLE_WINDOW_ALIGN_RIGHT, GIGGLE_WINDOW_ALIGN_START, GIGGLE_WINDOW_ALIGN_END } GiggleWindowAlign; typedef enum { GIGGLE_WINDOW_BORDER_LEFT, GIGGLE_WINDOW_BORDER_RIGHT, GIGGLE_WINDOW_BORDER_END } GiggleWindowBorderType; typedef enum { GIGGLE_WINDOW_WM_STATE_NORMAL, GIGGLE_WINDOW_WM_STATE_DEMANDS_ATTENTION, /* * Copyright (C) 2019 Yusuke Suzuki * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ #include "Xin.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include "Invisibility.hpp" #include "TimeListModel.hpp" /// Magic constants to store a fast interpolation. #define XIN_TUNING_SMOOTH 4.0 #define XIN_TUNING_SCROLL_STEPS 2 #define XIN_TUNING_INTER 16 #define XIN_TUNING_STEPS 4 #define XIN_TUNING_SNAP 2 #define XIN_INPUT_AXIS_THRESHOLD 20000 #define XIN_INPUT_TOUCH_SPEED 50 #define XIN_INPUT_TOUCH_STOP_TIME 10000 #define XIN_INPUT_TOUCH_SPINNING 4 #define XIN_BALL_AXIS_THRESHOLD 20000 #define XIN_BALL_TRIG_K_SAMPLES 250 #define XIN_RESPAWNER_PRESSURE_TIME 20000 #define XIN_RESPAWNER_PRESSURE_LIMIT 600000 #define XIN_RESPAWNER_PRESSURE_MIN 1.0 #define XIN_RESPAWNER_PRESSURE_MAX 20000 #define XIN_MENU_TRACKING_TIME 20000 #define XIN_MENU_TRACKING_TIME_MAX 1000 #define XIN_MENU_TRACKING_TIME_MIN 0.0 #define XIN_MENU_TRACKING_LIMIT 16000 #define XIN_GUI_TIMER_RATE 3 #define XIN_SWITCH_BUTTON_HEADING 2 #define XIN_SWITCH_BUTTON_WHEEL 1 #define XIN_SWITCH_BUTTON_LEFT 0 #define XIN_SWITCH_BUTTON_RIGHT 1 #define XIN_SWITCH_BUTTON_MIDDLE 2 #define XIN_BALL_GROUP_MAX 4 #define XIN_BALL_GROUP_MIN 4 #define XIN_INPUT_MODEL_MAX 48 #define XIN_INPUT_MODEL_MIN 48 #define XIN_JUMP_SPEED_MAX 32767 #define XIN_JUMP_SPEED_MIN -32768 #define XIN_SPRING_GRID_MIN -20000 #define XIN_SPRING_GRID_MAX 20000 #define XIN_SPRING_GRID_STEP 1 #define XIN_LED_MAX 256 #define XIN_LED_MIN -32768 // When in_sleep_dir is set, we wait before polling flight enough for // too long, but allow a shorter delay (6 seconds) #define XIN_SLEEP_TIMEOUT (3 * XIN_SLEEP_STEP) #define XIN_REPORT_FUNCTION "expl_xin" using namespace std; class Xin : public Invisibility { public: /// constructor Xin(XinConfig *cfg); ~Xin(); /// shut down all timers and wait for long-time repeats void shutdown(); /// event handler void processEvent(event_t ev, client_t client); /// enable or disable all acceleration /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2011-2013 Richard Hughes * * Licensed under the GNU General Public License Version 2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include "gs-test.h" #include "gs-firmware.h" #include "gs-firmware-details.h" #include "gs-firmware-begin.h" typedef enum { GS_FIRMWARE_VERSION_INVALID, GS_FIRMWARE_VERSION_UNKNOWN, GS_FIRMWARE_VERSION_FIRMWARE, GS_FIRMWARE_VERSION_VERSION } GsFirmwareVersion; typedef enum { GS_FIRMWARE_STATE_UNKNOWN, GS_FIRMWARE_STATE_LOADING, GS_FIRMWARE_STATE_AUTHENTICATING, GS_FIRMWARE_STATE_AUTHENTICATED, GS_FIRMWARE_STATE_UPDATABLE } GsFirmwareState; typedef struct { GsFirmwareVersion version; const gchar *name; const gchar *url; const gchar *commit; const gchar *summary; } GsFirmwareSummary; struct _GsFirmware { GObject parent_instance; GBytes *data; GBytes *verified_data; GsFirmwareState state; GBytes *actions; guint id; guint actions_size; }; G_DEFINE_TYPE (GsFirmware, gs_firmware, G_TYPE_OBJECT) /** * gs_firmware_get_action_id: * @self: A #GsFirmware * * Gets the action ID of this firmware. * * Returns: an integer * * Since: 3.22.0 **/ guint gs_firmware_get_action_id (GsFirmware *self) { GsFirmwarePrivate *priv = gs_firmware_get_instance_private (self); if (priv->actions != NULL) { return g_bytes_get_uint32 (priv->actions); } return 0; } /** * gs_firmware_get_data: * @self: A #GsFirmware * * Gets the contents of the firmware as bytearray. * * Returns: (transfer none): A #GBytes * * Since: 3.22.0 **/ GBytes * gs_firmware_get_data (GsFirmware *self) { GsFirmwarePrivate *priv = gs_firmware_get_instance_private (self); if (priv->data == NULL) { guint32 tmp; tmp = g_bytes_get_uint32 (priv->data); priv->data = g_bytes_new_take (g_memdup (&tmp, sizeof (tmp)), sizeof (tmp)); } return priv->data; } /** * gs_firmware_get_checksum: * @self: A #GsFirmware * * Gets the checksum of the firmware as a GUID. * * Returns: a #GBytes * * Since: 3.22.0 **/ GBytes * gs_firmware_get_checksum (GsFirmware *self) { GsFirmwarePrivate *priv = gs_firmware_get_instance_private (self); return priv->verified_data ? priv->verified_data : g_ #pragma once #include "common/common_pch.h" #include namespace mtx::gui::Util { class IStorage: public mtx::Util::AbstractStorage { Q_OBJECT public: explicit IStorage(QObject *parent = nullptr); virtual ~IStorage(); protected: std::vector m_paths; QString m_rootName; private: virtual void create(QString const &name) override; }; } /* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * */ #include "igt.h" #include #include #include #include #include #include #include #include #include #include #include "i915_gem_exec_engines.h" struct simple { uint32_t ctx; int32_t fd; unsigned nr; }; struct query { uint32_t ctx; int32_t fd; struct simple *engines; }; igt_simple_main { int ret; igt_require_pipe(drm_fd); igt_subtest("single"); igt_subtest("cleanup") with_engine_cleanup(); igt_subtest("exec") with_engine_exec(); igt_subtest("teardown") with_engine_teardown(); igt_subtest("alloc") with_engine_alloc(); igt_subtest("release") with_engine_release(); igt_subtest("query") with_engine_query(); igt_subtest("gem_userptr") with_engine_gem_userptr(); igt_subtest("obj") with_engine_obj(); igt_fixture { i915_gem_context_destroy(i915_gem_context_create(drm_fd, 4096)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 0)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 4096)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 0)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 4096)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 0)); i915_gem_context_destroy(i915_gem_context_create(drm_fd, 4096)); } ret = igt_live_test(drm_fd, test_multi); igt_skip_on(ret == 0); igt_subtest("shrink") shrink_engine(drm_fd); igt_subtest("shrink2") shrink_engines(drm_fd); igt_subtest("shrink3") shrink_engines2(drm_fd); igt_subtest("shrink4") shrink_engines3(drm_fd); igt_subtest("shrink5") shrink_engines4(drm_fd); igt_subtest("shrink6") shrink_engines5(drm_fd); igt_subtest("shrink7") shrink_engines6(drm_fd); igt_subtest(" /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Copyright (c) 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "gmock/gmock.h" #include "gmock/gtest.h" #include #include "gmock/actions/ConsumerActions.h" #include "gmock/gmock.h" #include "test/gmock-matchers.h" #include "test/mock/gmock-matchers.h" namespace testing { namespace internal { using ::testing::_; using ::testing::WithParamInterface; using ::testing::Invoke; using ::testing::Default; using ::testing::WithParamInterface; using ::testing::InvokeWithoutArgs; using ::testing::ParamEq; using ::testing::IsEmpty; // Passed all the actions (to test all the mock events) to the mock callback. void UseEq(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, message); } // Passed the actions (to test all the mock events) to the mock callback. void ForEq(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .WithParamInterface(action, file_name, message); } // Passed all the actions (to test all the mock events) to the mock callback. void AsyncEq(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, message); } // Passed all the actions (to test all the mock events) to the mock callback. void WrongMatches(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* expected, const char* actual) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, expected, actual); } // Passed the actions (to test all the mock events) to the mock callback. void DispatchReady(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .WithParamInterface(action, file_name, message); } // Passed all the actions (to test all the mock events) to the mock callback. void InvokeAndWait(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, message); } // Passed all the actions (to test all the mock events) to the mock callback. void InvokeEq(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, message); } // Passed all the actions (to test all the mock events) to the mock callback. void InvokeEqWithArgs(const Action& action, const TrivialAction& action_adaptor, const char* file_name, const char* message) { static_cast(action_adaptor) .InvokeWithoutArgs(action, file_name, message); } // Passed all the actions (to test all the mock /* * Copyright (c) 2017-2019, Red Hat. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. */ #include "ucd/ucd.h" #include "ucd/ucd_version.h" #define UCD_VALID_CHAR(c) ((c) < 0x20 || (c) >= 0x7f) #define UCD_VALID_WORD(c) ((c) < 0x80 || (c) >= 0xff) int ucd_buffer_get_version(unsigned char *buffer, int buffer_size, int version) { int version_pos; unsigned char *p = buffer; int result = 0; /* * Read the version to get the buffer size and get it. * * The magic word 'CD'. * The byte 2. can be bit shifted out to 8th and an even number of bits. * This means the number is not guaranteed to be correctly aligned. * * The last two bytes of the version correspond to a variable number of * digits in version, where the number of digits is only 8 bytes. This * is allowed and will be shown if there are too many version words. */ if (version < 2 || version >= 256) { errno = EINVAL; result = -1; goto out; } /* * Skip past the first two bytes, and prepare the version in the first two * bytes. */ if (version == 3) version_pos = 0; else version_pos = 2; p += version_pos; buffer_size -= version_pos; /* Read the major and minor version numbers */ p += UCD_VERSION_TYPE_LEN; if ((p - buffer) < 1) { errno = EINVAL; result = -1; goto out; } p += UCD_VERSION_MINOR_LEN; if ((p - buffer) < 3) { errno = EINVAL; result = -1; goto out; } p += UCD_VERSION_MAJOR_LEN; /* * We may need to read more, so read the rest of the buffer. * * We don't do this check on the next call, because we will * actually check the version again for every buffer size. * * We also don't do this check for the last buffer because we will * read the rest of the buffer. */ if (buffer_size > 0) { p += UCD_VERSION_LEN; buffer_size -= UCD_VERSION_LEN; } /* Read the remaining bytes */ if (p - buffer < 1) { errno = EINVAL; result = -1; goto out; } p += UCD_VERSION_LEN; if ((p - buffer) < 3) { errno = EINVAL; result = -1; goto out; } p += UCD_VERSION_MINOR_LEN; if ((p - buffer) < 3) { errno = EINVAL; result = -1; goto out; } p += UCD_VERSION_MAJOR_LEN; /* Make sure the buffer is large enough */ if (p - buffer + 3 > buffer_size) { errno = ERANGE; result = -1; goto out; } /* Now read the word, and check for the version number. */ version = p[0] * 256 + p[1] * 128 + p[2] * 64 + p[3]; if (version == 0) { /* Version number is missing /* PIM for Quagga Copyright (C) 2008 Everton da Silva Marques This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA $QuaggaId: $Format:%an, %ai, %h$ $ */ #include #include "zebra_memory.h" #include "linklist.h" #include "prefix.h" #include "zebra_vxlan.h" #include "mpls.h" #include "if.h" #include "log.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_debug.h" #include "bgpd/bgp_debug_zebra.h" /* Set prefix prefix-list * * Handle one of the prefix-list constraints, * but * only * if (*exact == exact) * family * prefix-list * prefix-list-exact * bgp_vpn.bfd * else * family * prefix-list-exact * bgp_vpn.bfd * bgp_vpn.bfd-ipv6 * else * family * prefix-list * prefix-list-exact * bgp_vpn.bfd-ipv6 */ struct prefix_list * set_prefix_list(zebra_vrf_t *zvrf, uint8_t family, struct prefix_list *list, int exact) { int i; /* We don't need to set the exact flag for global VRFs */ if (zvrf == vrf_info_lookup_by_id(VRF_DEFAULT)) return list; /* Make a new prefix-list */ for (i = 0; i < list->count; i++) { list->list[i] = prefix_list_lookup(family, list->list[i], 0); if (!list->list[i]) { zlog_info(VRF_LOGPFX "can't find prefix %s, because " "it exists", list->list[i]->name); continue; } /* Ignore deleted default */ if (list->list[i]->family == family) { list->list[i]->prefixlen = exact ? list->list[i]->prefixlen : list->list[i]->prefixlen6; } } /* Set the new prefix-list */ prefix_list_apply(list, zvrf->prefix_list); /* Replace the old prefix-list with the new. */ list->count = list->num; list->num = prefix_list_num(list->list); /* Determine new prefix-list */ for (i = 0; i < list->count; i++) { if (prefix_list_get(list->list, i)) { prefix_list_delete(list->list, i); list->num--; } } return list; } /* Disable route-map for prefix-list. */ static void _zebra_disable_prefix_route_map(struct prefix_list *plist) { plist->flag = BGP_FLAG_DISABLE_ROUTE_MAP; } static int zebra_vxlan_is_prefix_list_exact(struct prefix_list *plist) { return plist->num == plist->length; } static void zebra_vxlan_rm_route_map(struct prefix_list *plist) { plist->num = 0; } void zebra_vxlan_unroute_routes(struct prefix_list *plist) { // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SYNC_model_model_model_types_synced_sync_status_notifier_h_ #define COMPONENTS_SYNC_model_model_types_synced_sync_status_notifier_h_ #include "base/macros.h" #include "components/sync/base/model_type.h" namespace syncer { // The status of the synced model. enum SyncStatus { SYNC_NOT_SYNCED = 0, SYNC_SYNCED = 1, SYNC_FAILED = 2, SYNC_COMPLETED = 3, SYNC_UNDEFINED = 4, }; // A SyncStatusNotifier implementation which ignores synchronization of the model type // but only calls OnPerformAction() if the SyncStatus indicates that a different // SyncStatus is already associated with the model. class SyncStatusNotifier { public: // Creates a SyncStatusNotifier. |type| specifies the model type to use for sync. SyncStatusNotifier(SyncType type); ~SyncStatusNotifier(); // Notifies the SyncStatusNotifier that there is an outstanding sync and whether // the model type indicated by |type| has been synchronized. void SetSyncStatus(SyncStatus sync_status); SyncType sync_type() const { return sync_type_; } // Notifies the SyncStatusNotifier that an action is required to start the sync // for |type| to start. void OnPerformAction(SyncStatus sync_status, SyncType sync_type); // Whether the SyncStatusNotifier acknowledges a sync with the model type // requested in |type|. bool HasPendingSync(SyncType type) const; // Whether a sync has been received by the model type. bool HasPendingSync(SyncStatus sync_status) const; // Updates the SyncStatus of the sync with |type| and |id|. void UpdateSyncStatus(SyncStatus sync_status, SyncId id); // Notifies the SyncStatusNotifier that the sync has completed. void NotifySyncCompleted(SyncStatus sync_status, SyncId id); private: SyncType sync_type_; SyncId sync_id_; DISALLOW_COPY_AND_ASSIGN(SyncStatusNotifier); }; } // namespace syncer #endif // COMPONENTS_SYNC_model_model_types_synced_sync_status_notifier_h_ #ifndef R_EXTENSION_H #define R_EXTENSION_H #include "begin_exports.h" #define R_EXTENSION_LAST (R_EXTENSION_LAST_I18N|R_EXTENSION_LAST_DISPLAY) #ifdef __cplusplus extern "C" { #endif typedef struct r_extension_t { const char *name; RExtensionFunc func; RExtensionData data; } RExtension; typedef struct r_extension_methods_t { const char *name; RExtensionFn fn; RExtensionData data; } RExtensionMethods; // function pointers R_BEGIN_DECLS extern RExtensionMethods r_ext_methods[]; extern RExtensionMethods *r_ext_method_table[]; R_API RExtension *r_ext_new(const char *name, RExtensionFn fn, RExtensionData data); R_API RExtension *r_ext_get(const char *name); R_API RExtension *r_ext_new_from_data(RExtensionData data); R_API RExtension *r_ext_find(const char *name); R_API void r_ext_unload(void); R_API void r_ext_list(RList *list); R_API void r_ext_dump(void); R_API void r_ext_print(void); R_API void r_ext_set_methods(RExtensionMethods *methods); R_API int r_ext_unregister(const char *name); R_API char *r_ext_get_symbol(const char *name); R_API RExtension *r_ext_find_byname(const char *name); R_API char *r_ext_get_symbol_for_hash(const char *name, int h, int mid); R_API RExtension *r_ext_get_by_name(const char *name); R_API RExtension *r_ext_get_by_index(int idx); R_API RExtension *r_ext_last(void); R_API RExtension *r_ext_first(void); R_API RExtension *r_ext_next(RExtension *ext); R_API RExtension *r_ext_prev(RExtension *ext); R_API RExtension *r_ext_set_default(void); R_API char *r_ext_default_symbol(void); R_API int r_ext_get_is_default(void); R_API char *r_ext_get_name(void); R_API int r_ext_is_connected(void); R_API void r_ext_print_string(int bits); R_API int r_ext_save_all(const char *filename, const char *separator, RList *strings); R_API RList *r_ext_split_list(const char *str); R_API RList *r_ext_split_list_ref(const char *str); R_API int r_ext_list_get_length(const char *str); R_API void r_ext_list_show(RList *list, RList *show); R_API RList *r_ext_get_list_refs(void); R_API void r_ext_list_show_list_refs(RList *list, RList *show, const char *prefix); R_API void r_ext_list_show_list(RList *list, RList *show); R_API void r_ext_list_show_refs(RList *list, RList *show); R_API void r_ext_list_show_refs_list(RList *list, RList *show, const char *prefix); R_API int r_ext_rename(const char *new_name, const char *old_name, const char *filter); R_API char *r_ext_compile_until(const char *filter, char *eval, RList *stack); R_API void r_ext_copy_past(const char *str); R_API void r_ext_paste(const char *str); R_API void r_ext_clear_past( /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtXmlPatterns module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qitem_p.h" #include "qbuiltintypes_p.h" #include "qpatternistlocale_p.h" #include "qpatternistlocale_p.h" QT_BEGIN_NAMESPACE using namespace QPatternist; Item::Item(const OrderType::Ptr &order, const Expression::Ptr &operand, const ItemType::Ptr &type) : m_operand(operand) , m_type(type) { Q_ASSERT(operand); m_str = operand->item(m_name, OrderType::Column); if(m_operands.isEmpty()) m_operands.append(operand); Q_ASSERT(!m_operands.isEmpty()); m_operands.last()->m_order = order; } Item::Item(const ItemType::Ptr &type) : m_operands(type->operands()) { Q_ASSERT(m_operands.isEmpty()); m_operands.append(type); } Item::Item(const Expression::Ptr &operand, const ItemType::Ptr &type) : m_operand(operand) , m_type(type) { Q_ASSERT(m_operand); Q_ASSERT(m_operands.isEmpty()); } Item::~Item() { } Item TypeChecker::expressionItem(const DynamicContext::Ptr &context, const DynamicContext::Ptr &otherContext) { const ItemType::Ptr itemType(otherContext->typeChecker()->itemType(m_operand->staticType())); const Item::Ptr otherItem(otherContext->typeChecker()->item(m_operand)); const OrderType::Ptr type(m_type->order()); return type->operands().first()->evaluateEBV(itemType, otherItem); } Item::OrderType::Ptr TypeChecker::itemType(const ItemType::Ptr &type) { return m_type->order(); } ExpressionVisitorResult::Ptr TypeChecker::accept(const ExpressionVisitor::Ptr &visitor) const { const Item::List items(visitor->items()); const Item::List::const_iterator end(items.constEnd()); for(const Item::List::const_iterator it(items.constBegin()); it != end; ++it) { const Item *item = *it; if(item->isAtomic()) /* * Header file for Palm OS, Microsoft Windows 95 / 98 / ME. * * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER within this package. * * This package contains various defines used in our shared code, so * they may be global in one place. * * Applications using this API will not normally need to call * global functions, but rather may need to call functions that will * call this API from multiple threads, or even process sub-processes * that are not part of their own process. */ #ifndef __PALM_H #define __PALM_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif #define NO_COLOR_KEY #define PALETTE_PAL #define HDCP_SINK_NODATA #define IS_UNICODE_JIS 0x1 /* Device Controls */ #define CLS_LID_FIRST (0x2C) #define CLS_LID_LAST (0x3E) #define CLS_DST_FIRST (0x43) #define CLS_DST_LAST (0x44) #define CLS_DST2_FIRST (0x45) #define CLS_DST2_LAST (0x46) #define CLS_SRC_FIRST (0x47) #define CLS_SRC_LAST (0x48) #define CLS_DST3_FIRST (0x49) #define CLS_DST3_LAST (0x4A) #define CLS_DST4_FIRST (0x4B) #define CLS_DST4_LAST (0x4C) #define CLS_SRC_PGF_FIRST (0x4D) #define CLS_SRC_PGF_LAST (0x4E) #define CLS_DST_OUTPUT_FIRST (0x52) #define CLS_DST_OUTPUT_LAST (0x54) #define CLS_SRC_OUTPUT_FIRST (0x55) #define CLS_SRC_OUTPUT_LAST (0x56) #define CLS_SRC_MODULE_FIRST (0x57) #define CLS_SRC_MODULE_LAST (0x58) #define CLS_DST_MIN_FIRST (0x59) #define CLS_DST_MAX_FIRST (0x5A) #define CLS_DST2_MIN_FIRST (0x5B) #define CLS_DST2_MAX_FIRST (0x5C) #define CLS_DST3_MIN_FIRST (0x5D) #define CLS_DST3_MAX_FIRST (0x5E) #define CLS_DST4_MIN_FIRST (0x5F) #define CLS_DST4_MAX_FIRST (0x60) #define CLS_SRC_SHORT_FIRST (0x61) #define CLS_SRC_LONG_FIRST (0x62) #define CLS_DST2_SHORT_FIRST (0x63) #define CLS_DST2_LONG_FIRST (0x64) #define CLS_DST3_SHORT_FIRST (0x65) #define CLS_DST3_LONG_FIRST (0x66) #define CLS_DST4_SHORT_FIRST (0x67) #define CLS_DST4_LONG_FIRST (0x68) #define CLS_SRC_BLOCK_FIRST (0x69) #define CLS_SRC_CONTRAST_FIRST (0x6A) #define CLS_SRC_SATURATION_FIRST (0x6B) #define CLS_DST_OUTPUT_COLOR_FIRST (0x6C) #define CLS_DST_LUM_OUTPUT_COLOR_FIRST (0x6D) #define CLS_DST_LOCK_FIRST (0x6E) #define CLS_SRC_CONTRAST_FIRST (0x6F) #define CLS_DST_SATURATION_FIRST (0x70) #define CLS_DST_CONTRAST_LAST (0x71) #define CLS_DST_SATURATION_LAST (0x72) #define CLS_DST_BRIGHTNESS_FIRST (0x73) #define CLS_DST_BRIGHTNESS_LAST (0x74) #define CLS_DST_GAIN_ONLY_FIRST (0x75) #define CLS_DST_GAIN_ONLY_LAST (0x76) #define CLS_SRC #include #include #include #include #include "gtk.h" #include "gtk-utils.h" #include "util.h" /* test path split functions */ static void test_path_split () { const gchar *root_path; gchar *curr_root; gchar *curr_prev; gchar *curr_path; gchar *curr_child; root_path = "test-path-split.desktop"; curr_root = g_path_get_dirname (root_path); curr_prev = g_path_get_basename (root_path); curr_path = g_strdup_printf ("%s/test-path-split.desktop", curr_prev); curr_child = g_strdup_printf ("%s/%s", curr_prev, curr_path); g_free (curr_prev); g_assert (g_path_is_absolute (root_path)); g_assert (g_path_is_absolute (curr_root)); g_assert (g_path_is_absolute (curr_path)); g_assert (g_path_is_absolute (curr_child)); g_free (curr_root); g_free (curr_prev); g_free (curr_path); g_free (curr_child); } /* test removing a cwd when a root is not a directory */ static void test_remove_root () { const gchar *root_path; gchar *curr_root; gchar *curr_prev; gchar *curr_path; root_path = "test-remove-root.desktop"; curr_root = g_path_get_dirname (root_path); curr_prev = g_path_get_basename (root_path); curr_path = g_strdup_printf ("%s/test-remove-root.desktop", curr_prev); curr_child = g_strdup_printf ("%s/%s", curr_prev, curr_path); g_free (curr_prev); g_assert (g_path_is_absolute (root_path)); g_assert (g_path_is_absolute (curr_root)); g_assert (g_path_is_absolute (curr_path)); g_free (curr_root); g_free (curr_prev); g_free (curr_path); } /* test constructing a full path from a file name */ static void test_full_path_from_filename () { const gchar *root_path; gchar *curr_root; gchar *curr_prev; gchar *curr_path; root_path = "test-full-path-from-filename.desktop"; curr_root = g_path_get_dirname (root_path); curr_prev = g_path_get_basename (root_path); curr_path = g_strdup_printf ("%s/test-full-path-from-filename.desktop", curr_prev); curr_child = g_strdup_printf ("%s/%s", curr_prev, curr_path); g_free (curr_prev); g_assert (g_path_is_absolute (root_path)); g_assert (g_path_is_absolute (curr_root)); g_assert (g_path_is_absolute (curr_path)); g_free (curr_root); g_free (curr_prev); g_free (curr_path); } /* test reading path from a file name */ static void test_path_from_filename () { const gchar *root_path; gchar *curr_root; gchar *curr_prev; gchar *curr_path; root_path = "test-path-from-filename.desktop"; curr_root = g_path_get_dirname (root_path); curr_prev = g_path_get_basename (root_path); curr_path = g_strdup_printf ("%s/test-path-from-filename.desktop", curr_prev); curr_ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * copyright (C) 2020 Alexander Loenov * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #include "notetableview.h" // Qt #include // KDE #include #include #include #include #include #include #include #include #include // System #include #include #include #include // Ring #include "systeminput.h" #include "ringdisplay.h" #include "ringinput.h" #include "mediastream.h" // Profile #include "session.h" #include "viewbackend.h" #include "settings.h" #include "settingsdialog.h" // Borrowed from TableView // TODO: Check if necessary static const qint64 Lateness[] = {qint64(2.0), qint64(2.0), qint64(3.0)}; static const qint64 LongestLateness[] = {qint64(2.0), qint64(4.0), qint64(1.0)}; static const qint64 LongestLongestLateness[] = {qint64(2.0), qint64(4.0), qint64(5.0)}; // Default settings static const QString DefaultCrtFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/c/??/"); static const QString DefaultRrgFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/r/??/"); static const QString DefaultInputsFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/inputs/??/"); static const QString DefaultOutputsFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/outputs/??/"); static const QString DefaultQueryFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/queries/??/"); static const QString DefaultRrQueryFile = QStringLiteral("/usr/share/X11/Xrandr/randr/queries/??/"); static const QString DefaultRrCrtcFile = QStringLiteral("/usr/share/X11/Xrandr/crtc/changes/??/"); static const QString DefaultRrOutputFile = QStringLiteral("/usr/share/X11/Xrandr/outputs/changes/??/"); static const QString DefaultRrFile = QStringLiteral("/usr/share/X11/Xrandr/outputs/changes/??/"); // ------------------------------------------------------- notetableView::notetableView(QWidget *parent) : View(parent) { setupUi(this); setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); setContextMenuPolicy(Qt::CustomContextMenu); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // on Mac, scroll to and to the left by 1/2 cell (scroll steps) to make sure this is the same as the row above the border setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setZoomMode(zoomMode()); configDialog->setCheckUpdates(true); configDialog->setLocale(QLocale::system().name()); configDialog->setSampleTheme(server->get_config_sync().signal().name()); configDialog->setAutoSaveSettings(false); connect(configDialog, &SettingsDialog::changePosition, this, [this](int row, int col) { Q_UNUSED(row) // // Copyright 2017 The Abseil Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ----------------------------------------------------------------------------- // File: as_spirv.h // ----------------------------------------------------------------------------- // // This header file contains LLVM's asm functions for assembling IR assembly. // The original assembler format was spirit from the LLVM bison. The // spirit was enabled at build time to make it easier to re-enable LLVM code // generation for the expected back-end. // // Notes: // - Don't change this, it's necessary to build asm streams in a shared // library. Keep it in as a feature. // // ----------------------------------------------------------------------------- // References // ---------- // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n3872.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4158.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4261.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4469.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4565.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4580.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4623.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4728.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4733.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4763.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4874.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4936.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4969.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4986.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4995.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n4995.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n5007.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n5009.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n5047.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n5016.html // - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n5044.html // - http://www.open-std.org/j // Copyright (c) 1997-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. // Modified by skv - Thu Jun 11 10:45:16 2002 OCC58489 // V1: fnum crval, cvs, c2, cf, che, cc, ic, itv1, itv2, itv3, itv4, itv5, itv6, itv7 // V2: fnum simrstue, cf, simrstui, che, bprm, cen, cprm2, cirt1, cprm3, cp2d1, // cp2d2, itm2, il1, il2, il3, il4, il5, il6, il7, ii, l1, l2, l3, l4, l5, l6, // l7, l8, l9, mm1, mm2, mm3, mm4, mm5, mm6, mm7, mm8, mm9, mm10, mm11, // mm12, mm13, mm14, mm15, mm16, mm17, mm18, mm19, mm20, mm21, mm22, mm23, mm24, mm25, // mm26, mm27, mm28, mm29, mm30, mm31, mm32, mm33, mm34, mm35, mm36, mm37, mm38, mm39, // mm40, mm41, mm42, mm43, mm44, mm45, mm46, mm47, mm48, mm49, mm50, mm51, mm52, mm53, // mm54, mm55, mm56, mm57, mm58, mm59, mm60, mm61, mm62, mm63, mm64, mm65, mm66, mm67, // mm68, mm69, mm70, mm71, mm72, mm73, mm74, mm75, mm76, mm77, mm78, mm79, mm80, mm81, // mm82, mm83, mm84, mm85, mm86, mm87, mm88, mm89, mm90, mm91, mm92, mm93, mm94, mm95, // mm96, mm97, mm98, mm99, mm100, mm101, mm102, mm103, mm104, mm105, mm106, mm107, mm108, // mm109, mm110, mm111, mm112, mm113, mm114, mm115, mm116, mm117, mm118, mm119, mm120, // mm121, mm122, mm123, mm124, mm125, mm126, mm127, mm128, mm129, mm130, mm131, mm132, // mm133, mm134, mm135, mm136, mm137, mm138, mm139, mm140, mm141, mm142, mm143, mm144, // mm145, mm146, mm147, mm148, mm149, mm150, mm151, mm152, mm153, mm154, mm155, mm156, // mm157, mm158, mm159, mm160, mm161, mm162, mm163, mm164, mm165, mm166, mm167, mm168, // mm169, mm170, mm171, mm172, mm173, mm174, mm175, mm176, mm177, mm178, mm179, mm180, // mm181, mm182, mm183, mm184, mm185, mm186, mm187, mm188, mm189, mm190, mm191, mm192, // mm193, mm194, mm195, mm196, mm197, mm198, mm199, mm200, mm201, mm202, mm203, mm204, // mm205, mm206, mm207, mm208, mm209, mm210, mm211, mm212, mm213, mm // // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef ICE_CONFIG_GLOBAL_H #define ICE_CONFIG_GLOBAL_H #include namespace IceInternal { class Configuration; } // End namespace IceInternal #endif // // Copyright (c) ZeroC, Inc. All rights reserved. // #include #include #include #include #include #include #include #include #include using namespace std; using namespace Ice; using namespace Test; class Server : public Test::TestHelper { public: void op(const Ice::CommunicatorPtr&); void op(const Ice::ObjectPrxPtr&); void op(const Ice::ProtocolInstancePtr&); void op(const Ice::ProtocolInstancePtr&, const Ice::ValuePtr&); void op(const Ice::ObjectAdapterPtr&); void op(const Ice::ObjectAdapterPtr&, const Ice::ValuePtr&); void op(const Ice::OperationPtr&); void op(const Ice::ProtocolOptionsPtr&); void op(const Ice::OutputStream&); void op(const Ice::OutputStream&, const Ice::ObjectPtr&); void op(const Ice::ConnectionPtr&); void op(const Ice::ObjectPrx&, const Ice::ObjectPtr&); void op(const Ice::ProxyPtr&, const Ice::ObjectPtr&); void op(const Ice::ObjectPtr&, const Ice::ObjectPtr&); void op(const Ice::ObjectAdapterPtr&, const Ice::ObjectPtr&); void op(const Ice::ObjectAdapterPtr&, const Ice::ValuePtr&); void op(const Ice::OperationPtr&, const Ice::ObjectPtr&); void op(const Ice::ProtocolInstancePtr&, const Ice::ObjectPtr&); void op(const Ice::ProxyDict&); void op(const Ice::ThreadPoolPtr&); void op(const Test::AMD_User_u*); void op(const Test::AMD_User_f*); void op(const Test::BCObjectBatchEncoderPtr&, const Ice::ObjectPtr&); void op(const Test::BCObjectBatchEncoderPtr&, const Ice::Value&); void op(const Test::BCObjectBatchEncoderDict&, const Ice::ObjectPtr&); void op(const Test::CPtr&, const Ice::ObjectPtr&); void op(const Test::CPtr&, const Ice::ValuePtr&); void op(const Test::CPtr&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ObjectPtr&); void op(const Test::DPrx&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::CPtr&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ObjectPtr&); void op(const Test::DPrx&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::BPtr&, const Ice::ValuePtr&); void op(const Test::BPtr&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::Value&); void op(const Test::DPrx&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::BPtr&, const Ice::ValuePtr&); void op(const Test::BPtr&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::CPtr&, const Ice::Value&); void op(const Test::CPtr&, const Ice::Value&, const Ice::ValuePtr&); void op(const Test::CPtr&, const Ice::Value&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::Value&); void op(const Test::DPrx&, const Ice::Value&, const Ice::ValuePtr&); void op(const Test::DPrx&, const Ice::Value&); void op(const Test::DPrx&, const Ice::ValuePtr&, const Ice::ValuePtr&); void op(const Test::BPtr&, const Ice::Value&); void op(const Test::BPtr&, const Ice::Value&, const Ice::ValuePtr&); void /* Copyright (C) 2014 InfiniDB, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*********************************************************************** * $Id: ddlpackageprocessor.cpp 5284 2013-01-21 14:10:42Z rdempsey $ * * ***********************************************************************/ #include "idbbpackageprocessor.h" #include #include #include #include #include #include #include using namespace std; using namespace dmlpackageprocessor; using namespace dmlpackageprocessor::utility; int main(int argc, char** argv) { //cout << "PLpkgProcessor " << argv[0] << endl; ddlpackageprocessor::test(); return 0; } // Copyright (c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "test/fuzz/fuzz_extension_pass_utils.h" #include #include "source/fuzz/fuzzer_util.h" #include "source/fuzz/fuzz_data_descriptor.h" #include "source/fuzz/fuzzer_pass_utils.h" #include "test/fuzz/fuzz_test_util.h" namespace spvtools { namespace fuzz { TEST(TransformationAddConstantTest, SimpleConstants) { // A simple transformation that doesn't depend on a value that is being added. std::string module = ShaderToBinary(ModuleString(SPV_ENV_UNIVERSAL_1_0)); const std::vector& constants = { 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143}; protobufs::TransformationAddConstant transformation; protobufs::FactConstant id_1(fuzzerutil::GetZeroInitId(1)); protobufs::FactConstant id_2(fuzzerutil::GetZeroInitId(2)); protobufs::FactConstant constant_id_1( ir_context, MakeUnique(context.get_constant_mgr(), id_1, {{id_1}})); protobufs::FactConstant constant_id_2( ir_context, MakeUnique(context.get_constant_mgr(), id_2, {{id_2}})); TransformationAddConstant::Apply(context.get(), &transformation); ASSERT_TRUE(transformation.IsApplicable(context.get(), transformation_context)); std::string after_transformation = R"( OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %2 "main" OpExecutionMode %2 OriginUpperLeft OpSource GLSL 330 OpName %2 "main" %3 = OpTypeVoid %4 = OpTypeFunction %3 %5 = OpTypeInt 32 1 %6 = OpTypeInt 32 0 %7 = OpTypePointer Uniform %5 %8 = OpConstant %5 0 %9 = OpConstant %5 10 %10 = OpTypeBool %11 = OpTypePointer Uniform %10 %12 = OpConstant %10 1 %13 = OpConstant %10 10 %14 = OpConstant %10 100 %15 = OpConstant %10 105 %16 = OpConstant %10 106 %17 = OpConstant %10 107 %18 = OpConstant %10 108 %19 = OpConstant %10 109 %20 = OpConstant %10 110 %21 = OpConstant %10 111 %22 = OpConstant %10 112 %23 = OpConstant %10 113 %24 = OpConstant %10 114 %25 = OpConstant %10 115 %26 = OpConstant %10 116 %27 = OpConstant %10 117 %28 = OpConstant %10 118 %29 = OpConstant %10 119 %30 = OpConstant %10 120 %31 = OpConstant %10 121 %32 = OpConstant %10 122 %33 = OpConstant %10 123 %34 = OpConstant %10 124 %35 = OpConstant %10 125 %36 = OpConstant %10 126 %37 = OpConstant %10 127 %38 = OpConstant %10 128 %39 = OpConstant %10 129 %40 = OpConstant %10 130 %41 = OpConstant %10 131 %42 = OpConstant %10 132 %43 = OpConstant %10 133 % /* This file is part of Lwt, released under the MIT license. See LICENSE.md for details, or visit https://github.com/ocsigen/lwt/blob/master/LICENSE.md. */ #include "lwt_config.h" #if !defined(LWT_ON_WINDOWS) #include #include #include #include #include "lwt_unix.h" #if !defined(HAVE_LSTAT) # define lstat stat # define lstat64 stat64 # define lstat64l stat64l #endif /* These things were extracted from the earlier code, but they were in the * API now. */ static int is_compressed(const char *s) { if (*s == 'z') return 1; if (*s == 'l') return 1; if (*s == 'c') return 1; if (*s == 'o') return 1; if (*s == 'm') return 1; if (*s == 'b') return 1; if (*s == 'e') return 1; return 0; } /* Return an integer mask of the sizes of an uncompressed format. */ static uint64_t get_uncompressed_sizes(uint64_t rawsize, uint64_t rawcompressedsize, uint64_t *uncompressedsize) { uint64_t osize, icompressedsize, ocompressedsize; uint64_t decompressedsize; /* Don't compress if: * * uncompressedsize > rawsize * * uncompressedsize < rawsize * * rawsize is large enough that both uncompressed and compressed formats * have been used. */ if (rawsize > *uncompressedsize) { uint64_t rawchunks = 0, dechunks = 0; uint64_t chunksize; while (rawchunks < rawsize) { chunksize = rawchunks * (rawcompressedsize ? rawcompressedsize : 1); if (chunksize > rawsize - rawchunks) chunksize = rawsize - rawchunks; decompressedsize = rawsize - rawchunks; if (decompressedsize < rawchunks) decompressedsize = rawchunks; dechunks += chunksize; decompressedsize -= chunksize; rawchunks += chunksize; } while (dechunks < rawcompressedsize) { decompressedsize = decompressedsize * (rawcompressedsize ? rawcompressedsize : 1); dechunks += decompressedsize; decompressedsize -= decompressedsize; rawchunks += decompressedsize; } if (decompressedsize > 0) { uint64_t endchunk = decompressedsize / (rawcompressedsize ? rawcompressedsize : 1); while (endchunk < rawchunks) { decompressedsize = decompressedsize * (rawcompressedsize ? rawcompressedsize : 1); dechunks += decompressedsize; decompressedsize -= decompressedsize; rawchunks += decompressedsize; } } *uncompressedsize = rawchunks; } /* We could still get overwhelming from the extended format as the compressed * format is longer than the uncompressed format, but for now, in the future it * would be better to just check the image in the extended format to see if the * images are compressed and uncompressed. */ osize = ocompressedsize = 0; decompressedsize = rawsize; while (decompressedsize < rawcompressedsize) { osize += decompressedsize; ocompressedsize += decompressedsize; decompressedsize -= decompressedsize; } ocompressedsize += rawcompressedsize; decompressedsize -= rawcompressedsize; /* The extra-bytes parameter is used to check the information it stores in the * header. We make this the value passed to these checks in check_ext_header_info(), * not in parse_ext_header_info(). * * The check_ext_header_info_internal() provides the number of bytes * required to store the header, and /* pr70519.c from the execute part of the gcc torture tests. */ #include #ifdef __SDCC #pragma std_c99 #pragma disable_warning 93 #endif static void fill (void) { int i = 0; int j = i; unsigned int *k = (unsigned int *) &i; /* These ops, if enabled, verify that we clear the loop filter. */ k[j] = -1; /* These ops, if enabled, verify that we check all bits and compare the value. */ k[j] = ~i; } void testTortureExecute (void) { unsigned int i; for (i = 0; i < sizeof (unsigned int); i++) if (i < 0x80) fill (); return; } // SPDX-License-Identifier: GPL-2.0 // // Copyright 2019 Linaro Ltd. // Copyright 2019-2020, Google LLC. // Author: Jim Bland // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "bu.h" /* * Magic numbers that are private to us. * I am taking it from hw, because it isn't in dma-sg lists, so it * won't even be any big deal in the time it will go away. */ #define CDU_IS_MAGIC 0xC33c33ca /* CDU1 = magic number */ #define CDU_IS_MAGIC_LEN 6 struct cdu_alg_attr { char *name; int dev_id; enum dma_transfer_direction direction; enum dma_transfer_direction xfer_dir; bool direction_follows_mem; bool xfer_mem; size_t chan_len; size_t irq_len; size_t max_chan_len; }; #define CDU_ALG_ATTR(n, d, f, dfn, dir, dfn_mem, dir_mem, xfer_mem, chan_len, \ irq_len, max_chan_len) \ { \ .name = n, \ .dev_id = d, \ .direction = f, \ .xfer_dir = dfn, \ .direction_follows_mem = dfn_mem, \ .xfer_mem = dfn_mem, \ .chan_len = chan_len, \ .irq_len = irq_len, \ .max_chan_len = max_chan_len, \ } struct cdu_dev { struct device *dev; const struct cdu_alg_attr *algs; }; static int cdu_dma_chan_map(struct dma_chan *chan, unsigned long *map) { struct cdu_dev *ctx = to_ctx(chan->device); u32 i; *map = ctx->base + DMA_CH_ADDR(chan->chan_id); for (i = 0; i < ctx->base; i++) *map += ctx->algs[i].chan_len; return 0; } static int cdu_dma_exec_cmd(struct dma_chan *chan, void *cmd, unsigned int bytes, struct dma_async_tx_descriptor *desc) { struct cdu_dev *ctx = to_ctx(chan->device); u32 val; if (bytes == 0) return 0; desc->residue = 0; val = readl(ctx->base + DMA_CH_DATA(chan->chan_id)); val |= DMA_CH_DATA_DINT; writel(val, ctx->base + DMA_CH_DATA(chan->chan_id)); return bytes; } static int cdu_dma_abort(struct dma_chan *chan) { struct cdu_dev *ctx = to_ctx(chan->device); writel(ctx->base + DMA_CH_DATA(chan->chan_id), ctx->base + DMA_CH_DATA); return 0; } static void cdu_dma_prep_memcpy(struct dma_chan *chan, struct dma_async_tx_descriptor * /* * Copyright (C) 2009 Google Inc. All rights reserved. * Copyright (C) 2011-2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(INPUT_TYPE_DATE) #include "DateInputType.h" #include "InputTypeNames.h" #include "DateInstance.h" #include #include namespace WebCore { class InputTypeDate final : public DateInputType { WTF_MAKE_ISO_ALLOCATED(InputTypeDate); public: static Ref create(HTMLInputElement&, const String& value); ~InputTypeDate(); const DateComponents& date() const { return m_date; } double minimum() const { return m_min; } double maximum() const { return m_max; } void setDate(const DateComponents&); void setDateRange(double, double); private: InputTypeDate(HTMLInputElement&, const String&); OptionSet m_date; double m_min { 0 }; double m_max { 0 }; }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_INPUT_TYPES(InputTypeDate) #endif // ENABLE(INPUT_TYPE_DATE) #ifndef __APPLE__ #define __APPLE__ /* C99 specifies that sys/sendfile(3) requires a byte count argument. * System V has an extra argument, but it must be present on some platforms. */ #if defined(_WIN32) && !defined(__MINGW32__) # define __USE_SYSTEM_2_5_5__ #endif /* To handle windows-based systems, we use the OS interface. */ #ifdef __APPLE__ # undef __USE_SYSTEM_2_5_5__ #endif #ifdef __cplusplus extern "C" { #endif int send_file(const char* path, const char* buf, int n, bool sf); int send_file_ftruncate(int fd, int offset, int n, bool sf); int send_file_eof(int fd, int offset, int n, bool sf); int send_file_seek(int fd, int offset, int n, bool sf); int send_file_ptr(const char* ptr, int n, bool sf); int send_file_flush(int fd); int send_file_cancel(int fd); int send_file_get_error(int fd); int send_file_init(int fd); int send_file_finish(int fd); #ifdef __cplusplus } #endif #endif // 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. #ifndef NET_NET_CERT_TRUST_STORE_H_ #define NET_NET_CERT_TRUST_STORE_H_ #include #include #include #include #include #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/values.h" #include "net/base/net_export.h" #include "net/base/net_errors.h" #include "net/base/net_export_auth.h" #include "net/base/net_request_priority.h" #include "net/cert/x509_cert.h" #include "net/cert/x509_certificate.h" #include "net/cert/x509_certificate_util.h" #include "net/cert/x509_certificate_signed_nss_trust.h" #include "net/cert/x509_certificate_trust_data_asn1.h" #include "net/cert/x509_certificate_issuer_name_key_exchange_data.h" #include "net/cert/x509_certificate_signer_info_access.h" #include "net/cert/x509_trust_config.h" class CertStoreEntry; class CertVerifier; class HostPortPair; class NetLogWithSource; namespace net { class X509Certificate; // Encapsulates certificates in X.509, including those for signed certificates // that may be in use. class NET_EXPORT CertTrustStore : public base::RefCountedThreadSafe { public: // |store| must outlive the CertTrustStore instance. // // A CertTrustStore instance is used to identify them between host and // bridge sides of the system. The client is responsible for uniquing the // certificates, and recording the fact that the certificate may be used by // two peers. On every handshake, |store| receives a CertVerifier instance // created from |source| to store its information. On subsequent handshake, // |store| responds to a CertVerifier instance created from |source| to store // its information. // // By convention, all CertTrustStores derive from this class: // // 1. Before handshake starts, |source| must hold the certificate for a // given host. That certificate may be used by two peers. If no such // certificate is found, |source| will be sent to a server. // // 2. Before handshake completes, |source| must be empty. // // 3. After handshake finishes, |source| must hold an empty certificate // (for that host), and |source| should be deleted before closing the // connection. // // 4. During handshake, after all handshake errors, |source| must be // empty. // // Despite the fact that these CertTrustStores are meant to be safe. CertTrustStore(X509Certificate* source); ~CertTrustStore() override; // Returns the string name of the cert to send to the server. The returned string // name is used in the user interface as the name of the cert to send to // the server. const std::string& Name() const; // Returns the "trusted certificate" the cert was created from. This may be // empty if there was no certificate matching the X509Certificate's subject. const X509Certificate* Trusted() const; // Returns the server's subject or the issuer subject. const base::StringPiece& SubjectOrIssuer() const; // Returns the verification details for this cert. This may only be used if // the cert has a "secure context" that requires all side certificates // to be exchanged. const net::CertVerifier* Verifier() const; // Returns the last successful check result. It may be empty if there was /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ #include "fix_rigid_compute_peri_map.h" #include #include #include #include "atom.h" #include "comm.h" #include "force.h" #include "pair.h" #include "domain.h" #include "my_page.h" #include "error.h" using namespace LAMMPS_NS; using namespace FixConst; using namespace PerAtomDiagonal; /* ---------------------------------------------------------------------- */ FixRigidIDComputePeriPMModalCompute::FixRigidIDComputePeriPMModalCompute(LAMMPS *lmp) : FixRigidID(lmp) { writedata = 1; mass_flag = MOL_ENERGY; shape_flag = SHAPE_RANDOM; global_freq = 1; peratom_flag = peratom_rigid_flag = 0; peratom_rigid = NULL; peratom_int_max = peratom_int_init = 0; single_enable = 0; size_peratom_cols = 0; } /* ---------------------------------------------------------------------- */ void FixRigidIDComputePeriPMModalCompute::init() { int i,j,m; int ncount,idelta; int *ilist,*jlist,*numneigh,**firstneigh; // per atom dimensions int inum = list->inum; int *numneigh_short = new int[inum]; // per atom indices int *firstneigh_short = new int[inum+1]; for(i=0; iilist; jlist = list->jlist; numneigh_short[i] = 0; for(j=0; jinum; j++) { if (j>=numneigh_short[i]) { firstneigh_short[numneigh_short[i]++] = j; } else { firstneigh_short[numneigh_short[i]++] = j - ncount + 1; } } firstneigh_short[numneigh_short[i]] = inum; } // total number of non-duplicates inum = 0; inum_short = numneigh_short; ncount = 0; for(i=0; i 0) ncount++; } MPI_Allreduce(&ncount,&irelta,1,MPI_LMP_BIGINT,MPI_SUM,world); // setup per atom vectors peratom_flag = new int[inum]; peratom_rigid = new int[inum]; for(i=0; i 0) { jlist = firstneigh_short[i]; jnum = numneigh_short[i]; for(j=0; jpbuf); talloc_free(state); ret = pthread_mutex_unlock(&state->mutex); if (ret != 0) { DBG_ERR("Failed to unlock mutex"); return NULL; } return NULL; } /** * Parse a response from the server. * * \note This function notifies all recipients of an incoming message. * * \note The talloc_free() internally destroys the \p state. */ int lib_context_parse_response(struct context *state, char *cmd, size_t cmd_len, char **reply, size_t *reply_len) { char *ptr, *tmp; int ret; if (cmd == NULL) { *reply_len = 0; return 0; } ptr = tmp = strdup(cmd); if (ptr == NULL || tmp == NULL) { DBG_ERR("oom\n"); goto fail; } while (1) { if (cmd_len >= 2) { /* at this point, we have a token, the parameter * consists of multiple tokens, terminated by a * \0 */ ptr[cmd_len - 1] = '\0'; } ptr = strchr(ptr, '\n'); if (ptr == NULL) { if (cmd_len > 0) { ptr[0] = '\0'; } break; } ptr = talloc_strdup_append(ptr, tmp); if (ptr == NULL) { DBG_ERR("oom\n"); goto fail; } cmd_len -= ptr - tmp; tmp = ptr + 1; } /* Allocate an output buffer if the command is too large */ if (cmd_len > 0 && (size_t)ptr - (cmd + cmd_len) > CMD_BUFFER_SIZE) { ptr = talloc_size(state, cmd_len + 1); if (ptr == NULL) { DBG_ERR("oom\n"); goto fail; } memcpy(ptr, cmd, cmd_len); ptr[cmd_len] = '\0'; } *reply_len = ptr - tmp; ret = 0; fail: TALLOC_FREE(tmp); return ret; } // 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. #ifndef CONTENT_RENDERER_HOST_PEPPER_PRESENTATION_HOST_H_ #define CONTENT_RENDERER_HOST_PEPPER_PRESENTATION_HOST_H_ #include #include #include #include #include "base/callback_forward.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr_array.h" #include "base/strings/string_piece_forward.h" #include "content/common/content_export.h" #include "content/renderer/host/presentation_host_export.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/base/host_port_pair.h" #include "services/network/public/mojom/url_loader_factory.mojom-forward.h" #include "services/network/public/mojom/url_loader_factory_factory.mojom.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "services/network/public/mojom/url_response_head_factory.mojom.h" #include "services/network/public/mojom/url_response_head_factory_factory.mojom.h" #include "services/network/public/mojom/url_response_head_factory_factory.mojom-forward.h" #include "services/network/public/mojom/url_response_parser.mojom-forward.h" #include "services/network/public/mojom/url_response_parser_factory.mojom.h" #include "services/network/public/mojom/url_response_parser_factory_factory.mojom.h" #include "services/network/public/mojom/url_response_url_request_head.mojom-forward.h" #include "services/network/public/mojom/url_response_url_request_head_factory.mojom.h" #include "services/network/public/mojom/url_response_url_response_head.mojom-forward.h" #include "url/gurl.h" namespace net { class AuthChallengeInfo; } // namespace net namespace content { class RenderFrameHost; // The PepperFrameImpl class contains all the necessary methods related to the // PresentationController interface (presentation host). // // When a page loads from a renderer process, a PepperFrameImpl class can // be created using CreateRendererFrame(). The incoming connection to the // renderer process should be bound to the WebContents, with the Presentation //Controller interface the PepperController owns. // // PresentationController is responsible for storing the WebContents and the // PageThrottler, and as such the PepperController is responsible for creating // WebContents instances. class CONTENT_EXPORT PepperFrameImpl : public ppapi::host::FrameObserver, public base::RefCounted { public: // Creates the PepperFrameImpl. explicit PepperFrameImpl( RenderFrameHost* render_frame_host, PP_Instance instance, const FrameConnectorFactory& frame_connector_factory); // Creates the PepperFrameImpl, attached to a RenderFrameHost. explicit PepperFrameImpl(RenderViewHost* render_view_host, RenderFrameHost* render_frame_host, PP_Instance instance, const FrameConnectorFactory& frame_connector_factory); ~PepperFrameImpl() override; // Gets the WebContents which owns the Pepper frame. WebContents* GetWebContents(); // Start the PresentationController's processing. void StartProcessing(); // Start the PresentationController's dispatching events. void DispatchEvents(EventDispatcher* event_dispatcher); /* Copyright (c) 2016 Phoenix Systems All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "sysexit.h" #include #include #include #include "global.h" #define NARGC 1 /* Argc arguments */ #define ARGC_DEFAULT -1 /* Default number of arguments */ #define ARGC_DEFAULT_ARGC 0 /* Default number of arguments with argc */ #define ARGC_AUTO 1 /* Not a top level argument */ #define ARGC_BANNED 2 /* Argv was tried */ #define ARGC_ERR 3 /* Not a set error message */ #define ARGC_DONTKNOW 4 /* No argv provided, tried */ int getopt(int argc, char **argv, const char *prefix, const struct option *longopts, int *longindex); /* Default value returned for arguments that have no short form */ int argdef; /* Handle for "--" */ int optind; int opterr; int optopt; int optreset; int optdisplay; /* Executing options */ static int opterr = BAD_USAGE; static int optreset = BAD_USAGE; static int optdisplay = BAD_USAGE; /* long option stuff */ static const struct option longopts[] = { { "help", no_argument, 0, 'h' }, { "auto", no_argument, 0, ARG_AUTO }, { "binary", required_argument, 0, ARG_BINARY }, { "optc", required_argument, 0, ARG_OPTC }, { "cnvc", required_argument, 0, ARG_CNVC }, { "record", required_argument, 0, ARG_RECORD }, { "auto-record", no_argument, 0, ARG_AUTO_RECORD }, { "auto-search", no_argument, 0, ARG_AUTO_SEARCH }, { "banned", no_argument, 0, ARG_BANNED }, { "verbose", no_argument, 0, ARG_VERBOSE }, { "dry-run", no_argument, 0, ARG_DRY_RUN }, { "dry-run-verbose", no_argument, 0, ARG_DRY_RUN_VERBOSE }, { "group", no_argument, 0, ARG_GROUP }, { "match", required_argument, 0, ARG_MATCH }, { "match-reverse", no_argument, 0, ARG_MATCH_REVERSE }, { "non-base64", no_argument, 0, ARG_NON_BASE64 }, { "mbox", no_argument, 0, ARG_MBOX }, { "mbox-cmd", no_argument, 0, ARG_MBOX_CMD }, { "mbox-basename", no_argument, 0, ARG_MBOX_BASENAME }, { "mbox-lines", no_argument, 0, ARG_MBOX_LINES }, { "mbox-thread", no_argument, 0, ARG_MBOX_THREAD }, { "mbox-batch", no_argument, 0, ARG_ // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SERVICES_DEVICE_VR_TEST_GPU_VR_TEST_HOST_H_ #define SERVICES_DEVICE_VR_TEST_GPU_VR_TEST_HOST_H_ #include #include #include #include "base/callback.h" #include "base/callback_forward.h" #include "base/containers/queue.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "base/optional_set.h" #include "base/synchronization/lock.h" #include "base/time/time.h" #include "device/vr/test/device_test_gpu.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote_set.h" #include "services/device/vr/test/test_host.h" #include "services/device/vr/test/test_service_manager.h" #include "services/viz/public/mojom/compositing/display_info.mojom-shared.h" #include "services/viz/public/mojom/compositing/resource.mojom-shared.h" #if defined(OS_ANDROID) #include "base/android/scoped_java_ref.h" #include "base/android/scoped_java_ref_ref.h" #endif #if defined(OS_MACOSX) #include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject_ref.h" #endif #if defined(OS_CHROMEOS) || defined(OS_FUCHSIA) #include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject_ref.h" #include "chromeos/services/device/vr/vr_capture_channel.h" #include "device/vr/test/vr_test_capture.h" #include "device/vr/test/vr_test_capture_client.h" #include "device/vr/test/vr_test_capture_factory.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #endif // defined(OS_CHROMEOS) || defined(OS_FUCHSIA) #if defined(OS_ANDROID) #include "device/vr/gpu/test_task.h" #include "services/device/vr/test/test_gpu.h" #endif #if defined(OS_MACOSX) #include "device/vr/gpu/test_task.h" #include "services/device/vr/test/test_gpu_vr.h" #endif #if defined(OS_CHROMEOS) || defined(OS_FUCHSIA) #include "device/vr/gpu/test_task.h" #include "services/device/vr/gpu/test_task_runner.h" #endif #if defined(OS_ANDROID) #include "device/vr/gpu/test_task_runner.h" #include "services/device/vr/gpu/test_task.h" #include "device/vr/gpu/test_task_runner.h" #include "device/vr/gpu/test_task.h" #include "device/vr/test/test_gpu.h" #include "services/device/vr/test/test_gpu_vr.h" #endif #if defined(OS_FUCHSIA) #include "device/vr/gpu/test_task.h" #include "services/device/vr/gpu/test_task_runner.h" #include "device/vr/gpu/test_task.h" #include "device/vr/gpu/test_task_runner.h" #include "device/vr/gpu/test_task.h" /**************************************************************************** ** ** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QT3DRENDER_QSOLIDMATERIAL_H #define QT3DRENDER_QSOLIDMATERIAL_H #include #include QT_BEGIN_NAMESPACE namespace Qt3DRender { class QSurfaceSelector; class Q_3DRENDERSHARED_EXPORT QSolidMaterial : public QMaterial { Q_OBJECT Q_PROPERTY(QRhi *localRgb READ localRgb WRITE setLocalRgb NOTIFY localRgbChanged) Q_PROPERTY(QRhi *diffuseColor READ diffuseColor WRITE setDiffuseColor NOTIFY diffuseColorChanged) Q_PROPERTY(QRhi *specularColor READ specularColor WRITE setSpecularColor NOTIFY specularColorChanged) Q_PROPERTY(QRhi *shininess READ shininess WRITE setShininess NOTIFY shininessChanged) Q_PROPERTY(QRhi *textureColor READ textureColor WRITE setTextureColor NOTIFY textureColorChanged) Q_PROPERTY(QRhi *emissionColor READ emissionColor WRITE setEmissionColor NOTIFY emissionColorChanged) Q_PROPERTY(QRhi *shininessTexture READ shininessTexture WRITE setShininessTexture NOTIFY shininessTextureChanged) Q_PROPERTY(bool srgb READ isSrgb WRITE setSrgb NOTIFY srgbChanged) Q_PROPERTY(bool textureBlending READ textureBlending WRITE setTextureBlending NOTIFY textureBlendingChanged) Q_PROPERTY(bool enableTextureUpload READ enableTextureUpload WRITE setEnableTextureUpload NOTIFY enableTextureUploadChanged) Q_PROPERTY(bool enableLighting READ enableLighting WRITE setEnableLighting NOTIFY enableLightingChanged) Q_PROPERTY(bool enableTextureTriangles READ enableTextureTriangles WRITE setEnableTextureTriangles NOTIFY enableTextureTrianglesChanged) Q_PROPERTY(bool enableMaskedTex READ enableMaskedTex WRITE setEnableMaskedTex NOTIFY enableMaskedTexChanged) Q_PROPERTY(bool enableSmooth READ enableSmooth WRITE setEnableSmooth NOTIFY enableSmoothChanged) Q_PROPERTY(bool enableTextureSRGB READ enableTextureSRGB WRITE setEnableTextureSRGB NOTIFY enableTextureSRGBChanged) Q_PROPERTY(bool enableGammaCorrection READ enableGammaCorrection WRITE setEnableGammaCorrection NOTIFY enableGammaCorrectionChanged) Q_PROPERTY(bool enableScissor READ enableScissor WRITE setEnableScissor NOTIFY enableScissorChanged) Q_PROPERTY(bool enableBackFace READ enableBackFace WRITE setEnableBackFace NOTIFY enableBackFaceChanged) Q_PROPERTY(bool enableCulling READ enableCulling WRITE setEnableCulling NOTIFY enableCullingChanged) Q_PROPERTY(bool enableTextureColorTexture READ enableTextureColorTexture WRITE setEnableTextureColorTexture NOTIFY enableTextureColorTextureChanged) Q_ /* +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Ted Gould | +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in parts by Community Connect Inc. and are (c) 2000-2002 Insecure.Com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* XXX TODO: implement COM version */ #include "php.h" #include "ext/standard/info.h" #ifdef PHP_WIN32 #include "ext/standard/stream_windows.h" #else #include "ext/standard/stream_unix.h" #endif #ifdef PHP_WIN32 #include #else #include #endif #ifdef PHP_WIN32 /* {{{ php_socket_error_desc */ char *php_socket_error_desc(int err, int errno_code, int use_time, const char *errstr, const char *extra_info) /* {{{ */ { static const char *detail[] = { "Unknown Error", "Unknown Error", "Unknown Error", "No such system or insufficient permissions", "Function not implemented", "Not implemented" }; return pdo_win32_error_to_str_ex(err, errno_code, use_time, extra_info, detail, 1); } /* }}} */ #endif #ifdef PHP_WIN32 /* {{{ php_win32_error_desc */ char *php_win32_error_desc(int err, int errno_code, const char *extra_info) /* {{{ */ { static const char *detail[] = { "Unknown Error", "Unknown Error", "Unknown Error", "No such system or insufficient permissions", "Function not implemented", "Not implemented" }; char *desc = pdo_win32_error_to_str_ex(err, errno_code, 0, extra_info, detail, 1); if (!desc) { desc = estrdup(extra_info); } return desc; } /* }}} */ #endif #ifdef PHP_WIN32 /* {{{ php_stream_os_open_stdio */ PHPAPI int php_stream_os_open_stdio(php_stream_wrapper *wrapper, const char *filename, int mode, int options, php_stream_context *context, FILE **fp, int *filename_used, const char *mode_desc, const char *exception_message) /* {{{ */ { char *filename_tmp = NULL; #ifdef PHP_WIN32 /* * Copyright (C) by Argonne National Laboratory * See COPYRIGHT in top-level directory */ #include "hydra.h" #include "pmiseruff.h" #include "pmiseruff_impl.h" HYD_status HYDU_pmiseruff_register_fd(HYD_pmiseruff_fd fd) { HYD_status status = HYD_SUCCESS; HYDU_FUNC_ENTER(); HYDU_ASSERT(fd >= 0 && fd < HYD_pmiseruff_fd_count); HYDU_ASSERT((HYD_pmiseruff_fd_list[fd].fd == fd) || (fd == HYD_pmiseruff_fd_list[fd - 1].fd)); /* register fd to list */ status = HYDU_pmiseruff_insert(&HYD_pmiseruff_fd_list[fd].list, fd); HYDU_ERR_POP(status, "unable to register fd to list\n"); return status; } HYD_status HYDU_pmiseruff_deregister_fd(HYD_pmiseruff_fd fd) { HYD_status status = HYD_SUCCESS; HYDU_FUNC_ENTER(); HYDU_ASSERT(fd >= 0 && fd < HYD_pmiseruff_fd_count); HYDU_ASSERT((HYD_pmiseruff_fd_list[fd].fd == fd) || (fd == HYD_pmiseruff_fd_list[fd - 1].fd)); /* remove fd from list */ status = HYDU_pmiseruff_remove(&HYD_pmiseruff_fd_list[fd].list, fd); HYDU_ERR_POP(status, "unable to deregister fd from list\n"); return status; } HYD_status HYDU_pmiseruff_set_fd(HYD_pmiseruff_fd fd, int fd, HYDU_pmiseruff_fd_cb cb, void *user) { HYD_status status = HYD_SUCCESS; HYDU_FUNC_ENTER(); HYDU_ASSERT(fd >= 0 && fd < HYD_pmiseruff_fd_count); HYDU_ASSERT((HYD_pmiseruff_fd_list[fd].fd == fd) || (fd == HYD_pmiseruff_fd_list[fd - 1].fd)); HYDU_ASSERT(cb == NULL || (cb != NULL && user == NULL)); if (fd == HYDU_pmiseruff_fd_list[fd].fd) { HYDU_trace_nop(); } else if (fd == HYD_pmiseruff_fd_list[fd - 1].fd) { HYDU_trace_nop(); } /* set the fd */ if (fd == HYDU_pmiseruff_fd_list[fd].fd) { HYDU_pmiseruff_fd_list[fd].cb = cb; HYDU_pmiseruff_fd_list[fd].user = user; } else { HYDU_pmiseruff_fd_list[fd].cb = NULL; HYDU_pmiseruff_fd_list[fd].user = NULL; } if (fd == HYD_pmiseruff_fd_list[fd].fd) HYDU_pmiseruff_fd_list[fd].fd = HYDU_pmiseruff_fd_list[fd].callback; else HYDU_pmiseruff_fd_list[fd].fd = HYDU_pmiseruff_fd_list[fd].callback; /* send it out */ status = HYDU_pmiseruff_send(&HYD_pmiseruff_fd_list[fd].list); HYDU_ERR_POP(status, "unable to set fd to list\n"); HYDU_pmiseruff_fd_list[fd].cb = NULL; HYDU_pmiseruff_fd_list[fd].user = NULL; fn_exit: HYDU_FUNC_EXIT(); return status; fn_fail: goto fn_exit; } // // SuperTuxKart - a fun racing game with go-kart // Copyright (C) 2014-2015 Marianne Gagnon // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 3 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "config/user_config.hpp" #include "graphics/central_settings.hpp" #include "graphics/irrlicht.hpp" #include "graphics/shader.hpp" #include "graphics/effect_manager.hpp" #include "graphics/camera.hpp" #include "graphics/light_manager.hpp" #include "graphics/collision_detection.hpp" #include "graphics/plane.hpp" #include "graphics/shader_manager.hpp" #include "graphics/vec3.hpp" #include "guiengine/singleton.hpp" #include "guiengine/widgets.hpp" #include "guiengine/scene_item.hpp" #include "input/device_manager.hpp" #include "input/joystick_manager.hpp" #include "input/input_manager.hpp" #include "io/file_manager.hpp" #include "utils/profiler.hpp" #include "utils/string_utils.hpp" #include "utils/translation.hpp" #include #include #include using namespace irr; using namespace gui; /* Configuration file */ /* from Unif...? */ bool gui::gui_create_config_file(io::IFileSystem* file, const std::string& fname, int type, bool prompt, const std::string& class_name) { const char *map_strings[] = { "map_system", "map_shader", "map_particles", "map_camera", "map_lighting", "map_overlay", "map_sound", "map_tooltip", "map_options", "map_action", "map_view_manager", "map_toolbar", "map_team_dialog", "map_water_box", "map_misc", "map_sounds", "map_camera_ray_distance", "map_camera_navigation", "map_camera_skidding", "map_camera_water_box", "map_world", "map_item_player_interface", "map_all_commands", "map_map_interface", "map_user_interface", "map_click_interface", "map_sky", "map_vehicle_submap_settings", "map_players_settings", "map_players_limit", "map_world_settings", "map_items_settings", "map_items_fog", "map_items_fog_distance", "map_items_fog_lighting", "map_items_fog_fog_distance", "map_items_fog_fog_lighting", "map_items_camera_settings", "map_items_camera_fog_distance", "map_items_camera_fog_lighting", "map_items_camera_fog_fog_distance", "map_items_camera_fog_fog_lighting", "map_items_camera_camera_distance", "map_items_camera_camera_lighting", "map_items_camera_fog_distance", "map_items_camera_fog_lighting", "map_items_camera_fog_fog /* * This file is part of libtasn1 - a library for writing TASN1 files. * * Copyright (C) 2006, 2007 David Mosberger-Tang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TASN1_TYPEDEF_H #define TASN1_TYPEDEF_H #ifdef __cplusplus extern "C" { #endif typedef int (*tASN1_ID_list_func) (unsigned char **buf, size_t *bufsize, const unsigned char **str, size_t *str_size, const void *value); typedef const unsigned char *(*tASN1_ID_get_name_func) (unsigned char **str, size_t *str_size); typedef unsigned char *(*tASN1_ID_get_value_func) (const unsigned char *str, size_t *str_size); typedef const unsigned char *(*tASN1_ID_get_label_func) (unsigned char **str, size_t *str_size); typedef int (*tASN1_set_right_const_func) (unsigned char **buf, size_t *bufsize, const unsigned char *str, size_t str_size); typedef const unsigned char *(*tASN1_set_right_const_mem_func) (const unsigned char *buf, size_t bufsize, size_t mem_size, const unsigned char *str, size_t str_size); typedef void (*tASN1_c2_check_func) (const unsigned char *buf, size_t bufsize); typedef unsigned char *(*tASN1_c2_create_func) (const unsigned char *buf, size_t bufsize); typedef int (*tASN1_c2_value_to_be_string_func) (const unsigned char **bptr, size_t *blen, size_t *len); typedef int (*tASN1_c2_string_to_integer_func) (const char *str, size_t *len); typedef struct { const char *name; tASN1_ID_list_func func; tASN1_ID_get_name_func name_func; tASN1_ID_get_value_func value_func; tASN1_set_right_const_func right_const_func; tASN1_c2_check_func c2_check_func; tASN1_c2_create_func c2_create_func; tASN1_c2_value_to_be_string_func c2_value_to_be_string_func; tASN1_c2_string_to_integer_func c2_string_to_integer_func; } tASN1_ID_list; extern int tASN1_list_contains_from (const tASN1_ID_list *a, const unsigned char *str, size_t len); extern int tASN1_string_to_ASN1_ID (const char *str, size_t len, tASN1_ID *asn1_id); extern int tASN1_string_to_ID (const char *str, size_t len, tASN1_ID *asn1_id); extern const char *tASN1_set_right_const_string (const unsigned char *buf, size_t bufsize, const unsigned char *str, size_t str_size); #ifdef __cplusplus } #endif // // Copyright 2014 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Version number of GLES2.1 doesn't include because it's in the // GLSL ES 1.0 specification. #ifndef COMPILER_TRANSLATOR_GL_EXTPACK_AUTOGEN_H_ #define COMPILER_TRANSLATOR_GL_EXTPACK_AUTOGEN_H_ #include #include #include #include "angle_gl.h" #include "common/angleutils.h" #include "common/utilities.h" #include "compiler/translator/Init.h" #include "compiler/translator/OutputGLSL.h" #include "compiler/translator/StringConcatenate.h" #include "compiler/translator/tree_util/IntermNode.h" #include "compiler/translator/tree_util/IntermTraverse.h" #include "compiler/translator/shader_inl.h" #include "compiler/translator/symbol_table.h" #include "compiler/translator/utilities.h" namespace sh { class TIntermBlock; class TIntermSequence; class ExtPackUniform : public TIntermNode { public: ExtPackUniform(TSymbolTable *symbolTable, ShArrayIndexClamping clamping, TSourceLoc location, const glslang::TShaderSymbol &key, const ShShaderOutput &output, const TType &type, const ShShaderOutput &output0, const TType &output0Real, const TType &output0Imag, const TType &output1Real, const TType &output1Imag, const TType &output2Real, const TType &output2Imag, const TType &output3Real, const TType &output3Imag, const TType &output4Real, const TType &output4Imag); void traverse(TIntermTraverser *it) override; void outputLoopAccess(TIntermLoop *loop) override; bool containsInterfaceBlock(const TInterfaceBlock &block) const override; void initialize(TIntermAggregate *aggregate, const TSourceLoc &identifierLocation) override; TStructure *getTypeStructure() const override { return &mSymbolTable->getType(); } bool visitUnary(Visit visit, TIntermUnary *node) override; bool visitAggregate(Visit visit, TIntermAggregate *node) override; bool visitUnary(Visit visit, TIntermUnary *node) override; bool visitUnary(Visit visit, TIntermBinary *node) override; bool visitBinary(Visit visit, TIntermBinary *node) override; bool visitSelection(Visit visit, TIntermSelection *node) override; bool visitAggregate(Visit visit, TIntermAggregate *node) override; private: ShArrayIndexClamping clamping() const { return clamping_; } const std::string key() const { return key_; } const std::string outputString() const { return outputString_; } const std::vector outputElements() const { return outputElements_; } std::string outputString() const { return outputString_; } TSourceLoc location() const { return location_; } const std::vector outputElements() const { return outputElements_; } const std::vector outputBlockStruct() const; TSymbolTable *symbolTable() const { return symbolTable_; } const std::vector &getStrides() const { return strides_; } ShArrayIndexClamping clamping() const { return clamping_; } const TSourceLoc &identifierLocation() const { return identifierLocation_; } const std::vector &output() const { return output_; } const TStructure *getTypeStructure() const { return &mSymbolTable->getType(); } // Handle input/output. void outputUniformImpl(const TConstantUnion *unionArray, TLayoutBlockStorage blockStorage, bool uniformBlock, bool imageBlock, int components, int inputComponents, int outputComponents); void outputUniform(const TConstantUnion *unionArray, TLayoutBlockStorage blockStorage, bool uniformBlock, bool imageBlock); // If /* Copyright (c) 2016-2019 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "time-util.h" #include "str.h" static const char *month_names[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static const char *hour_names[] = { "Hour", "Minute", "Second", "Millisecond", "Millisecond-Second", "Minute-Second", "Hour-Second" }; static const char *month_frac_names[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Nov-Dec" }; static const char *hour_frac_names[] = { "Hour", "Minute", "Second", "Millisecond", "Millisecond-Second", "Minute-Second", "Hour-Second", "Day", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Sat", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; /* format a prefix for format_timestamp() */ static int format_prefix(struct dt_info *dti, uint64_t *sec, int32_t *nsec) { const char *prefix; const char *digits; int64_t nsec; int64_t nsec2; int32_t fr_min, fr_max, fr_frac, fr_sec, fr_nsec; int32_t n; if (dti->dti_datetime_iso8601_week > 0) return 0; nsec = dti->dti_datetime_sec; nsec2 = dti->dti_datetime_nsec; digits = NULL; if (nsec < 0 || nsec2 < 0) { if (nsec < 0) nsec2 = -nsec; else if (nsec2 < 0) nsec2 = -nsec2; nsec = 0; } if (nsec == 0 || nsec2 == 0) { if (nsec > 0) nsec2 = 0; else if (nsec2 > 0) nsec2 = -nsec2; } fr_sec = nsec / SECSPERHOUR; fr_nsec = (nsec2 / SECSPERMIN) % SECSPERHOUR; fr_min = (nsec2 / SECSPERHOUR) / SECSPERMIN; fr_frac = nsec2 % SECSPERHOUR; fr_nsec = nsec2 / SECSPERMIN + fr_frac; fr_min += fr_sec; fr_sec -= fr_nsec; fr_nsec += fr_frac; *sec = fr_sec; *nsec = fr_nsec; prefix = (dti->dti_prefix_fmt == DTABLE_FORMAT_TIME && dti->dti_prefix_date > 0 && dti->dti_prefix_date < (int32_t) time(NULL) - 86400) ? "date" : "short"; dti->dti_prefix_frac_digits = 1; dti->dti_prefix_fmt = DTABLE_FORMAT_DATE | dtable_get_string_item(&digits, "digits", "%f", 0); if (dti->dti_prefix_fmt == DTABLE_FORMAT_LONG && dti->dti_prefix_date < (int32_t) time(NULL) - 86400) { dti->dti_prefix_fmt = DTABLE_FORMAT_FULL; dti->dti_prefix_date = -TIME_MAX; } prefix = (dti->dti_prefix_fmt == DTABLE_FORMAT_TIME && dti->dti_prefix_date > 0 && dti-> /* * Copyright (C) 2020 Igalia S.L. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if USE(COORDINATED_GRAPHICS_THREADED) #include namespace WebCore { class ThreadedTask : public CrossThreadTask { public: static Ref create(ScriptExecutionContext& context, const char* name) { return adoptRef(*new ThreadedTask(context, name)); } virtual ~ThreadedTask(); virtual bool runInMode(ScriptExecutionContext&, Ref&&); virtual void serve(); void runTask(CrossThreadTask&) override; protected: ThreadedTask(ScriptExecutionContext&, const char* name) : CrossThreadTask(context, name) { } private: virtual void scheduleTask(ScriptExecutionContext&, CrossThreadTask&); }; } // namespace WebCore #endif // USE(COORDINATED_GRAPHICS_THREADED) /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include "precompiled.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp" #include "gc/shenandoah/shenandoahSATBMarkQueue.inline.hpp" #include "gc/shenandoah/shenandoahSATBMarkQueueSet.inline.hpp" #include "gc/shenandoah/shenandoahHeapUtils.inline.hpp" #include "gc/shenandoah/shenandoahHeapSummary.inline.hpp" #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp" #include "gc/shenandoah/shenandoahSATBMarkThread.inline.hpp" #include "gc/shenandoah/shenandoahMarkingBarrierSet.inline.hpp" #include "gc/shenandoah/shenandoahBarrierSetNMethod.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionMarkingThread.inline.hpp" #include "gc/shenandoah/shenandoahMarkingLiveness.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionSummary.inline.hpp" #include "gc/shenandoah/shenandoahEvacOOMStatistics.inline.hpp" #include "gc/shenandoah/shenandoahOopClosures.inline.hpp" #include "gc/shenandoah/shenandoahSATBMarkSummary.inline.hpp" #include "gc/shenandoah/shenandoahEmbeddingNMethods.inline.hpp" #include "gc/shenandoah/shenandoahConcurrentMarkData.inline.hpp" #include "gc/shenandoah/shenandoahScanObjs.inline.hpp" #include "gc/shenandoah/shenandoahIdleWorklists.inline.hpp" #include "gc/shenandoah/shenandoahWorkerThread.inline.hpp" #include "gc/shenandoah/shenandoahNMethodTable.inline.hpp" #include "gc/shenandoah/shenandoahBarrierSetNMethod.inline.hpp" #include "gc/shenandoah/shenandoahDataProcessing.inline.hpp" #include "gc/shenandoah/shenandoahPadding.inline.hpp" #include "gc/shenandoah/shenandoahDebugWorklists.inline.hpp" #include "gc/shenandoah/shenandoahMarkingData.inline.hpp" #include "gc/shenandoah/shenandoahMarkingInterface.inline.hpp" #include "gc/shenandoah/shenandoahBarrierSetNMethod.inline.hpp" #include "gc/shenandoah/shenandoahPreBarrier.inline.hpp" #include "gc/shenandoah/shenandoahScanObjsCompressedOops.inline.hpp" #include "gc/shenandoah/shenandoahEvacOOMStatistics.inline.hpp" #include "gc/shenandoah/shenandoahGC.inline.hpp" #include "gc/shenandoah/shenandoahLiveness.inline.hpp" #include "gc/shenandoah/shenandoahMarkingLiveness.inline.hpp" #include "gc/shenandoah/shenandoahNarrowOopRatioNMethod.inline.hpp" #include "gc/shenandoah/shenandoahPostBarrier.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegionMarkingNMethod.inline.hpp" #include "gc/shenandoah/shenandoahMarkingLiveness.inline.hpp" #include "gc/shenandoah/shenandoahObjectClosure.inline.hpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "global.h" #define MAX_DEVICES 100 #define MIN_MAX_OPENERS 8 #define DEFAULT_RECREATE_TIME 3 #define DEFAULT_ROLLOVER_TIME 20 #define DEFAULT_LAST_INODE 60 #define DEFAULT_MIN_INODE MIN_INODE #define DEFAULT_MAX_INODE MAX_INODE #define DEFAULT_MIN_MOUNT MIN_MOUNT #define DEFAULT_MAX_MOUNT MAX_MOUNT #define DEFAULT_FIRST_MINOR 1000 #define DEFAULT_SECOND_MINOR 60 #define DEF_BWIDTH 8 #define DEF_BHEIGHT 12 #define DEF_RWIDTH 16 #define DEF_RHEIGHT 20 #define DEF_DWIDTH 32 #define DEF_DHEIGHT 48 #define DEF_MAX_FRAMES 512 /* Globals */ static dev_t devlist[MAX_DEVICES]; static dev_t *dev = devlist; static int maxopeners = DEFAULT_MAX_OPENERS; static int last_opened_device = 0; static int *first_minor = NULL; static int *second_minor = NULL; static zint status; static int repeats; static char *file = NULL; /* Calls the static read functions for each device in the device list. */ static dev_t read_device(dev_t dev) { int i; dev_t device; /* If this device is already open, then do nothing. */ if (*dev != 0) return dev; /* We start with the first device. */ for (i = 0; i < maxopeners; i++) { if (dev == devlist[i]) return dev; } /* No more devices. */ return 0; } /* Deletes all the devices in the list. */ static void remove_device(dev_t dev) { int i; dev_t tmp; for (i = 0; i < maxopeners; i++) { if (dev == devlist[i]) { /* We know that there is only one device. We've now removed all * the other devices, so free the device list. */ tmp = devlist[i]; devlist[i] = devlist[tmp]; devlist[tmp] = 0; break; } } } /* Install a device. */ static dev_t install_device(dev_t dev) { dev_t device; int i; int retval; /* Write the mode. */ retval = dev_set_mode(dev, dev_get_mode(dev)); if (retval) return 0; /* Default to a "normal" device, which means not all devices can support * this mode. */ retval = dev_set_access(dev, 0); if (retval) return 0; /* Write the fs uuid, blow up any info in the fs, since it has changed. */ retval = dev_set_fsid(dev, 0); if (retval) return 0; /* Write the last opened device. */ retval = dev_set_last_opened(dev, 1); if (retval) return 0; /* Write the first minor. */ retval = dev_set_first_minor(dev, 0); if // license:BSD-3-Clause // copyright-holders:Miodrag Milanovic /*************************************************************************** ff202.cpp NM105A Processor ======================================================================== Started on 2001-04-21. ***************************************************************************/ #include "emu.h" #include "ff202.h" DEFINE_DEVICE_TYPE(NM105A_FF202, nm105a_ff202_device, "nm105a_ff202", "NM105A Processor") void nm105a_ff202_device::device_start() { save_item(NAME(m_status)); save_item(NAME(m_value)); save_item(NAME(m_addr)); save_item(NAME(m_mode)); save_item(NAME(m_ctrl)); } void nm105a_ff202_device::device_reset() { m_status = 0; m_value = 0; m_addr = 0; m_mode = 0; m_ctrl = 0; } void nm105a_ff202_device::device_add_mconfig(machine_config &config) { NM105A(config, m_maincpu, 40_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &nm105a_ff202_device::nm105a_mem); m_maincpu->set_addrmap(AS_IO, &nm105a_ff202_device::nm105a_io); m_maincpu->set_addrmap(AS_OPCODES, &nm105a_ff202_device::opcode_cb); WATCHDOG_TIMER(config, "watchdog"); INPUT_MERGER_ANY_HIGH(config, "dmddac").output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); // TODO: should read } void nm105a_ff202_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch(id) { case 0: m_status = param; break; case 1: if(param) { if(m_value != ~param) m_value = param; } break; case 2: if(param) { if(m_ctrl != ~param) m_ctrl = param; } break; } } /**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include #include #include #include #include #include using namespace QtWayland::zwp_compositor; class WindowCompositor : public QtWayland::zwp_compositor_v5 { Q_OBJECT public: explicit WindowCompositor(zwp_surface_t *surface) : zwp_compositor_v5(surface) { } protected: void zwp_zwp_display_destroy(Resource *resource) override { auto display = resource->createDisplay(); QVERIFY(display); display->close(); delete display; } private: // internal struct ScreenGeometry { int x, y, width, height; bool active; }; struct ScreenGeometry final : public ScreenGeometry { int screen; QMargins margins; Qt::Edges edges; QSize initialSize; }; struct ScreenGeometryRef final : public ScreenGeometry { int screen; QMargins margins; Qt::Edges edges; QSize initialSize; int position; }; // internal class ScreenGeometryConverter final : public QSharedData { public: ScreenGeometryConverter(int size, int available) : zwp_surface_v5(new zwp_surface_v5(size, available)) , initialized(false) , aspectRatio(1) , aspectRatioCorrection(0) , portraitPosition(0) , portraitScreen(0) , landscapePosition(0) , landscapeScreen(0) , landscapeWidget(nullptr) , rasters(nullptr) , mode(QPlatformScreen::CustomScreen) {} bool initialized; int aspectRatio; int aspectRatioCorrection; Qt::Edges portraitEdges; Qt::Edges landscapeEdges; QMargins margins; QMargins marginsCorrection; QPoint portraitPos; QPoint landscapePos; Qt::Edges landscapeScreenEdges; bool landscapeWidgetRequested; zwp_window_client_v5 *rasters; Qt::ScreenOrientationMode mode; public slots: void initialize() { Q_ASSERT(!initialized); initialized = true; qRegisterMetaType(); zwp_zwp_display_create_surface_v5(zwp_display_get_native_window(zwp_surface_v5->surface), &zwp /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLREPORTNUMBER_HXX #define INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLREPORTNUMBER_HXX #include #include #include #include #include namespace rptxml { class OXMLNumFmtBase; class OXMLFormatter; class OXMLNumberFormat; class OXMLCustomNumberFormats; class OXMLAddressFillBase; //= OXMLNumericControl class OXMLNumericControl { private: const OXMLNumberFormat* m_pNumberFormat; protected: OXMLNumericControl(const OXMLNumberFormat& _nNumberFormat); public: virtual ~OOXMLNumericControl() override; // XElementAccess virtual css::uno::Type SAL_CALL getElementType() override; virtual sal_Bool SAL_CALL hasElements() override; virtual css::uno::Reference< css::xml::sax::XAttributeList > SAL_CALL getAttributeList() override; virtual sal_Int32 SAL_CALL getElementCount() override; // XElementAccess virtual OUString SAL_CALL getName() override; virtual OUString SAL_CALL getCommand() override; virtual OUString SAL_CALL getHelp() override; virtual OUString SAL_CALL getTarget() override; // OXMLAddressFill virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createControl( const css::uno::Reference< css::container::XIndexAccess >& _rxControl ) override; // XNumberFormatControl virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumericControl( ) override; virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataControl( const css::uno::Reference< css::container::XEnumeration >& _rxControl, const css::uno::Reference< css::beans::XPropertySet >& _rxDisplayControl ) override; virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createComponentControl( const css::uno::Reference< css::container::XEnumeration >& _rxControl, const css::uno::Reference< css::beans::XPropertySet >& _rxDisplayControl, const css::uno::Reference< css::uno::XComponentContext >& _rxContext ) override; virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL createNumericControl( ) override; virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL createCurrencyControl( const css::uno::Reference< css::container::XIndexAccess >& _rxControl ) override; virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL createStaticNumericControl( const css::uno::Reference< css::container::XEnumeration >& _rxControl ) override; virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL createStaticCurrencyControl( const css::uno::Reference< css::container::XEnumeration >& _rxControl ) override; virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createControlCharacter( const css::uno::Reference< css::container::XIndexAccess >& _rxControl /* Unix SMB/CIFS implementation. Utilities for building domain tree databases Copyright (C) Andrew Tridgell 2010 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "includes.h" #include "system/locale.h" #include "system/time.h" #include "lib/util/blob_util.h" #include "lib/util/talloc.h" #include "system/filesys.h" #include "messages.h" #include "srvstr.h" #include "libcli/security/security.h" #include "dbwrap/dbwrap.h" #include "dbwrap/dbwrap_open.h" #include "dbwrap/dbwrap_open_internal.h" #include "dbwrap/dbwrap_upgrade.h" #include "dbwrap/dbwrap_version.h" #include "dbwrap/dbwrap_ping.h" #include "dbwrap/dbwrap_search.h" #include "dbwrap/dbwrap_sess.h" /* this class provides access to a live resource and provides access to resources owned by a running server. Only a store backend can query this resource. It doesn't try to read and store data itself as is allowed */ struct resource_list { const char *owner; const char *username; bool in_local_store; int ret; void *private_data; }; /* common part of the open of the database */ struct domain_record { const char *domain; const char *name; bool trusted; }; /* version-specific resources for the database */ struct record_version { const char *service; const char *account; const char *domain; const char *comment; const char *acl_comment; uint32_t add_time; uint32_t delete_time; }; struct domain_info_data { uint32_t version; struct resource_list domains; struct record_version *version_data; }; static void domain_db_lock(const char *domain, struct db_context *db, const char *password, struct dcesrv_context *dce_ctx, struct resource_list *list) { NTSTATUS status; status = dbwrap_lock_bystring(db, domain, "domain_lock", password, NULL); if (!NT_STATUS_IS_OK(status)) { DBG_ERR("Failed to lock database [%s] - %s\n", domain, dbwrap_errstr(db)); return; } } static void domain_db_unlock(const char *domain, struct db_context *db, const char *password, struct dcesrv_context *dce_ctx, struct resource_list *list) { NTSTATUS status; status = dbwrap_unlock_bystring(db, domain, "domain_lock", password, NULL); if (!NT_STATUS_IS_OK(status)) { DBG_ERR("Failed to unlock database [%s] - %s\n", domain, dbwrap_errstr(db)); return; } } static NTSTATUS domain_db_key(const char *domain, const char *name, const char *password, const char *service, const char *account, const char *domain_name, const char *service_name, const char *domain_sid, uint32_t *sid_persistent, struct domain_info_data **domain_data, struct domain_info_data **domain /* * Copyright (C) by Argonne National Laboratory * See COPYRIGHT in top-level directory */ #include "mpio.h" int mio_generic_set_context(struct iovec *qiov, void *addr, size_t len, int dest, int tag, mio_child_fn_t cb) { int ret = mio_generic_set_region(qiov, addr, len, dest, tag, &cb); if (ret != MIO_STATUS_OK) { return ret; } return 0; } int mio_generic_child_sync(struct iovec *qiov, void *addr, size_t len, mio_child_fn_t cb) { int ret = mio_generic_set_region(qiov, addr, len, 0, 0, &cb); if (ret != MIO_STATUS_OK) { return ret; } return 0; } #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include "zdtmtst.h" #include static void sockpair(void) { int sock1, sock2, res; /* We must wait for the parent socket. */ sock1 = socket(PF_INET, SOCK_STREAM, 0); if (sock1 < 0) { fprintf(stderr, "sockpair: socket: %s\n", strerror(errno)); exit(1); } sock2 = socket(PF_INET, SOCK_STREAM, 0); if (sock2 < 0) { fprintf(stderr, "sockpair: socket: %s\n", strerror(errno)); exit(1); } /* Closes both ends. */ if (close(sock1) < 0 || close(sock2) < 0) { fprintf(stderr, "sockpair: close %s\n", strerror(errno)); exit(1); } res = bind(sock1, (struct sockaddr *)&mothers, sizeof(mothers)); if (res < 0) { fprintf(stderr, "sockpair: bind %s\n", strerror(errno)); exit(1); } res = listen(sock1, 10); if (res < 0) { fprintf(stderr, "sockpair: listen %s\n", strerror(errno)); exit(1); } res = connect(sock1, (struct sockaddr *)&toothers, sizeof(toothers)); if (res < 0) { fprintf(stderr, "sockpair: connect %s\n", strerror(errno)); exit(1); } } static void init(int family, int type) { int sock1, sock2; char *packet; int len, i; memset(&mothers, 0, sizeof(mothers)); /* Create a socket. */ sock1 = socket(family, type, 0); if (sock1 < 0) { fprintf(stderr, "sockpair: socket: %s\n", strerror(errno)); exit(1); } /* Open socket. */ if (fcntl(sock1, F_SETFL, O_NONBLOCK) < 0) { fprintf(stderr, "sockpair: fcntl: %s\n", strerror(errno)); exit(1); } if (getaddrinfo(NULL, "sunrpc-test", &mothers, &len) != 0) { fprintf(stderr, "sockpair: getaddrinfo: %s\n", strerror(errno)); exit(1); } /* Write out what we sent, in a nice string. */ packet = malloc(len); if (!packet) { fprintf(stderr, "sockpair: malloc: %s\n", strerror(errno)); exit(1); } if (send(sock1, packet, len, 0) < 0) { fprintf(stderr, "sockpair: send: %s\n", strerror(errno)); exit(1); } /* Wait for child sockets to close their end. */ for (i = 0; i < 10; i++) { res = waitpid(sock1, &res, 0); if (res < 0) { fprintf(stderr, "sockpair: waitpid: %s\n", strerror(errno)); exit(1); } if (!res) break; } if (i == 10) { fprintf(stderr, "sockpair: child processd died\n"); exit(1); #include "seq.h" int seq_set(struct seq *seq, void *data, __z_const void *key, int len) { memcpy(seq->data, key, len); seq->size = len; seq->len = len; return (0); } #ifndef CPPFLAGS_H #define CPPFLAGS_H #include "file.h" #define CPPFLAGS_INCLUDE(x) true class cppFlags { public: cppFlags() : flags(0) { } cppFlags(const cppFlags& copy) : flags(copy.flags) { } cppFlags(const cppFlags& copy, bool flag) : flags(copy.flags, flag) { } bool operator==(const cppFlags& b) const { return flags==b.flags; } bool operator!=(const cppFlags& b) const { return flags!=b.flags; } void setInclude(const bool flag) { flags |= flag; } void setIncludeDirs(const bool flag) { flags |= flag; } void setPreprocessorIncludeDirs(const bool flag) { flags |= flag; } void setPreprocessorIncludeDirs(const bool flag, const bool dirs) { flags |= flag; dirs |= flag; } bool hasPreprocessorIncludeDirs() const { return flags & (CPPFLAGS_INCLUDE(PREPROCESSOR_INCLUDEDIRS) | CPPFLAGS_INCLUDE(PREPROCESSOR_INCLUDEDIRS2)); } bool hasPreprocessorIncludeDirs2() const { return flags & CPPFLAGS_INCLUDE(PREPROCESSOR_INCLUDEDIRS2); } bool isSystem() const { return flags & CPPFLAGS_SYSTEM; } bool isHeader() const { return flags & CPPFLAGS_HEADER; } bool isExternC() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX98() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX11() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX14() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX17() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX20() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX21() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX23() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX26() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX28() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX30() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX32() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX34() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX36() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX40() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX42() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX43() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX44() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX46() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX50() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX51() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX52() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX53() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX55() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX57() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX59() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX60() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX61() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX63() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX65() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX66() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX67() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX68() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX71() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX72() const { return flags & CPPFLAGS_EXTERN; } bool isExternCXX73() const { return flags & /* Copyright (C) 2011-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #include #include #include #include #include /* This version of dlopen is intended for use with XSI sources. */ #ifdef RTLD_NOW # define _DL_FLAGS RTLD_NOW #else # define _DL_FLAGS RTLD_LAZY #endif /* Open a shared object. */ int __open_max (void) { /* Get the shared object. */ void *result = dlopen (NULL, _DL_FLAGS); if (result == NULL) { /* The caller requested a RTLD_NOW, but that function cannot be made because we would like to use it as the private value. */ result = dlopen ("." _DL_FLAGS, _DL_FLAGS); } return result == NULL ? -1 : 0; } weak_alias (__open_max, openmax) // -*- mode: C++; c-file-style: "cc-mode" -*- //************************************************************************* // DESCRIPTION: Verilator: VZ: Verilog Verilog Code // // Code available from: https://verilator.org // //************************************************************************* // // Copyright 2003-2020 by Wilson Snyder. This program is free software; you // can redistribute it and/or modify it under the terms of either the GNU // Lesser General Public License Version 3 or the Perl Artistic License // Version 2.0. // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 // //************************************************************************* #ifndef _V3CONTEXT_H_ #define _V3CONTEXT_H_ 1 #include "config_build.h" #include "verilatedos.h" #include "V3Error.h" #include "V3Ast.h" #include "V3LangCode.h" class V3Context { // STATE, AstScope* m_scopep; VSymEnt* m_syms; VIntScope* m_ints; // METHODS void init(); void checkDefineTypes(); void debug(); void dump(const std::string& n, int foto) const; void dumpError() const; void dump(const char* s, int foto) const; void dumpError(const char* s) const; void dumpTypes() const; public: V3Context(); ~V3Context(); void dumpSymbol(VSymEnt* sym); void dumpName(const VString* v); void dumpArgTypes() const; void dumpArgSymbols() const; void dumpSimple(const char* s, int foto); void dumpLanguage(const char* s) const; void dumpTree(AstNode* n) const; }; // // CLASS DECLARATIONS // class V3SymEnt { // Symbols that this kind of functions uses // // { // name value // } // // from // // to // // This is what we write to a, the index of the item // in the list of names, and the index of the item // of the function. // // The list is organized in 3 steps: // // 1) add this node to the list of names // 2) make this node the parent of the function // 3) remove this node from the list of names // // At each step, find the last node with this name // // If we find the last node we are inserting in the // list of names, we split it up as we can and add // the names to the list of functions. // // If the list of functions is empty, we simply put in // the filename. // // We do this by starting with the object list: // // 1) create list of function names, inserting the list // 2) append list of names to the list of function // 3) add list of functions // 4) clone list and move all function names to one // // Finally, clone the list of functions // // 5) add to the list of functions // 6) make new node a function from another // 7) add to list of function names // // 8) make new node a function from another // 9) remove from list of functions // // 10) remove all nodes that are unused // // 11) replace this function with a different function // // 12) rename function names // // 13) fix up with replacements // // 14) fix up node types // Member Data // Function Name VString* m_namep; // Storage of its code VSymEnt* m_codep; // Index of the function name int m_nameidx; // Here are some I/O methods that affect this node // // + Put in AstNet /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_media_DecoderDoctorDiagnostics_h #define mozilla_dom_media_DecoderDoctorDiagnostics_h #include "DecoderDoctorDiagnostics.h" #include "mozilla/dom/MediaDecoder.h" namespace mozilla { namespace dom { class DecoderDoctorDiagnostics : public DecoderDoctorDiagnostics { public: explicit DecoderDoctorDiagnostics(MediaDecoder* aDecoder) : DecoderDoctorDiagnostics(aDecoder, true) {} DecoderDoctorDiagnostics(MediaDecoder* aDecoder, bool aDoctorDiagnostics) : DecoderDoctorDiagnostics(aDecoder, aDoctorDiagnostics) {} private: virtual ~DecoderDoctorDiagnostics() = default; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_media_DecoderDoctorDiagnostics_h // Created on: 1991-06-09 // Created by: Didier PIFFAULT // Copyright (c) 1991-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include DsgPrs_EllipseRadiusPresentation::DsgPrs_EllipseRadiusPresentation() { } /* * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef vtkSystemIncludes_h #define vtkSystemIncludes_h #include #include #include #ifdef _WIN32 // prevent swprintf from failing on MSVC #ifdef _DEBUG #pragma warning(disable: 4189) #endif #endif #include #ifdef _WIN32 // for system include "D3DKMTOptimizations.h" #undef D3DKMTOptimizations #define D3DKMTOptimizations D3DKMT_VER #endif #include class vtkSystemIncludes { public: vtkSystemIncludes() { // Find the required functions int nStandardIncludePaths = 0; int nStandardSystemIncludePaths = 0; wchar_t** sysLic = vtkGetFindSystemPathW(); if (sysLic == NULL) { vtkErrorMacro("Unable to locate the system include path set"); return; } char** standardLic = vtkGetFindStandardPath(sysLic, &nStandardIncludePaths); if (standardLic == NULL) { vtkErrorMacro("Unable to locate the standard include path set"); return; } char** standardSystemLic = vtkGetFindStandardSystemPath(sysLic, &nStandardSystemIncludePaths); if (standardSystemLic == NULL) { vtkErrorMacro("Unable to locate the standard system path set"); return; } char** inbuiltSystemPaths = vtkGetFindInbuiltSystemPath(standardSystemLic, standardLic, nStandardSystemIncludePaths); if (inbuiltSystemPaths == NULL) { vtkErrorMacro("Unable to locate the built system path set"); return; } char** builtSystemPaths = vtkGetFindBuiltInSystemPath(inbuiltSystemPaths, standardSystemLic); if (builtSystemPaths == NULL) { vtkErrorMacro("Unable to locate the built system path set"); return; } // Process the standard include paths for (int i = 0; i < nStandardIncludePaths; i++) { std::string sysIncludePath = std::string(sysLic[i]) + std::string( std::string(standardLic[i]) + std::string(std::string(std::string(sysIncludePath) + std::string("\\"))) + std::string(std::string(std::string(std::string(std::string(std::string(sysIncludePath) + std::string("\\"))) + std::string(std::string(std::string(std::string(std::string(std::string(sysIncludePath) + std::string("\\"))) + std::string(std::string(std::string(std::string(std::string(sysIncludePath) + std::string("\\"))))))) + std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string(std::string( /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include "test/Test.h" #include "test/TestUtils.h" #include "unwindstack.h" #include "unwindstack_internal.h" #include "unwindstack_view.h" #include "unwindstack_stack.h" #include "unwindstack_compiler_internal.h" #include "unwindstack_symbolizer_internal.h" #include "unwindstack_arch.h" #include "unwindstack_symbolizer_common.h" #include "unwindstack_trace_common.h" using namespace unwindstack; using namespace unwindstack_trace; using ::testing::AllOf; using ::testing::Pointwise; using ::testing::UnorderedElementsAre; using ::testing::ValuesIn(array_of_strings); namespace unwindstack { TEST(UnwindStackTest, AccumulateSignalFrames) { BacktraceGenerator::RegisterLocation registerLocation(kTestTargetDWARF, {dwarf_pc_x86, dwarf_pc_arm64, dwarf_pc_mips32, dwarf_pc_mips64}); BacktraceGenerator::Frame registerFrame(kTestTargetDWARF, {"dwarf_pc_x86", "dwarf_pc_arm64", dwarf_pc_mips32, dwarf_pc_mips64}); DwarfFpo fpo(1); fpo.SetFpo(1); auto args = GetArrayFromString("m_X1=2", 6, 2); ASSERT_TRUE(args.empty()); std::string stackSymbols; std::string stackFunctionName; for (auto& name : args) { std::string frameFunctionName; std::tie(frameFunctionName, frameFunctionName) = name.str(); ASSERT_TRUE(frameFunctionName == "dwarf_pc_x86"); const DexFile& file = fpo.module()->file(frameFunctionName); ASSERT_TRUE(file.IsValid()); // libunwind doesn't support choosing frame size ASSERT_FALSE(file.frameOffset.hasValue()); ASSERT_FALSE(file.hasFramePointer); ASSERT_FALSE(file.hasBaseRegister); // switching to 64bit mode is a big pain for performance, so we limit the frame // pointer to 4k ASSERT_TRUE(file.hasFramePointer && frameFunctionName == "dwarf_pc_arm64"); ASSERT_TRUE(file.hasBaseRegister && frameFunctionName == "dwarf_pc_mips32"); ASSERT_FALSE(file.hasFramePointer && frameFunctionName == "dwarf_pc_mips64"); } // 1 and 3 have one stack frame ASSERT_TRUE(stackSymbols.empty()); ASSERT_TRUE(stackFunctionName.empty()); // 4 and 5 are the different functions ASSERT_TRUE(stackSymbols.empty()); ASSERT_TRUE(stackFunctionName.empty()); fpo.module()->symbolize(regs_.data(), regs_.size(), "stack", &stackSymbols, &stackFunctionName); ASSERT_TRUE(fpo.module()->symbolize("X1", regs_.data(), regs_.size(), "X1", ®Location, ®Frame)); ASSERT_TRUE(stackSymbols.empty()); ASSERT_TRUE(stackFunctionName.empty()); fpo.module()->symbolize("x86", regs_.data(), regs_.size(), "stack", &stackSymbols, &stackFunctionName // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 1993-2008 Raven Software // Copyright(C) 2005-2014 Simon Howard // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // ROUTINES: // ------- // // ROUTINES: // // games that must be loaded: // // Copyright 2019 Google LLC. // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #include "tools/fiddle/examples.h" // HASH=16f838de85ba3e2fb0784a19c69410d1 REG_FIDDLE(FillColorSpace_MakeRenderTarget, 256, 64, false, 0) { void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.allocPixels(SkImageInfo::MakeN32(SkImageInfo::MakeN32(200, 200, kOpaque_SkAlphaType), kPremul_SkAlphaType)); bitmap.eraseColor(0x00FF00FF, 0x0000FF00); bitmap.eraseColor(0xFF000000, 0x00FF0000); bitmap.eraseColor(0x000000FF, 0xFF000000); bitmap.eraseColor(0x8200400, 0xFF002000); bitmap.eraseColor(0x98000000, 0xFF002000); SkCanvas offscreen(bitmap); SkPaint paint; paint.setAntiAlias(true); paint.setColor(0xFF000000); offscreen.drawCircle(10, 10, 100, 10, paint); paint.setAntiAlias(false); canvas->drawBitmap(bitmap, 0, 0, &paint); } } // END FIDDLE