/* 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 ==================================================================================================== // @HEADER // *********************************************************************** // // Stokhos Package // Copyright (2009) Sandia Corporation // // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive // license for use of this work by or on behalf of the U.S. Government. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE // 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. // // Questions? Contact Eric T. Phipps (etphipp@sandia.gov). // // *********************************************************************** // @HEADER // These test cases are based on the discrete mean by Yukorov, // "Discrete Mean Function". #include "Teuchos_UnitTestHarness.hpp" #include "Teuchos_TestingHelpers.hpp" #include "Teuchos_UnitTestRepository.hpp" #include "Teuchos_ArrayRCP.hpp" #include "Teuchos_UnitTestRepository.hpp" #include "Teuchos_GlobalMPISession.hpp" #include "Tpetra_Core.hpp" #include "Tpetra_Map.hpp" #include "Tpetra_CrsMatrix.hpp" #include "Tpetra_Vector.hpp" #include "Tpetra_MultiVector.hpp" #include "Tpetra_VectorFactory.hpp" #include "Tpetra_Export.hpp" #include "Tpetra_MapFactory.hpp" #include "Tpetra_CrsGraph.hpp" #include "Tpetra_Vector.hpp" #include "Tpetra_CrsGraphFactory.hpp" #include "Tpetra_Vector_TypeNameTraits.hpp" #include "Tpetra_Version.hpp" #include "Xpetra_UnitTestHelpers.hpp" namespace { using Tpetra::global_size_t; using Teuchos::ArrayRCP; using Teuchos::ArrayView; using Teuchos::Array; using Teuchos::ArrayViewIterator; using Teuchos::Comm; using Teuchos::outArg; using Teuchos::REDUCE_SUM; using Teuchos::reduceAll; using Teuchos::RCP; using Teuchos::rcp; using Teuchos::REDUCE_MIN; using Teuchos::reduceAll; using Teuchos::Tuple; #define UNIT_TEST_GROUP( LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Classic_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Exponential_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Discrete_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Uniform_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Random_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, NDArray_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, ElementWiseDivide, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Drop_Fill_Impl, LO, GO ) \ TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( DoubleDropFactory, Drop_Fill_Fill_Array_Impl, LO, GO ) \ TEUCHOS ==================================================================================================== // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMEOS_SERVICES_MULTIDEVICE_SETUP_DEVICE_INFO_CONTROLLER_CHROMEOS_H_ #define CHROMEOS_SERVICES_MULTIDEVICE_SETUP_DEVICE_INFO_CONTROLLER_CHROMEOS_H_ #include #include #include "chromeos/services/multidevice_setup/multidevice_setup_client.h" #include "chromeos/services/multidevice_setup/multidevice_setup_client_constants.h" namespace chromeos { namespace multidevice_setup { class DeviceInfoControllerChromeOS : public MultideviceSetupClient, public chromeos::multidevice_setup::DeviceInfoControllerObserver { public: DeviceInfoControllerChromeOS(); ~DeviceInfoControllerChromeOS() override; // chromeos::multidevice_setup::DeviceInfoControllerObserver: void OnDeviceAdded( multidevice_setup::DeviceInfoPtr device, multidevice_setup::mojom::DeviceInfoPtr device_info) override; void OnDeviceRemoved(multidevice_setup::DeviceInfoPtr device, multidevice_setup::mojom::DeviceInfoPtr device_info) override; void OnDeviceChanged(multidevice_setup::DeviceInfoPtr device, multidevice_setup::mojom::DeviceInfoPtr device_info) override; // Overrides from multidevice_setup::DeviceInfoController: void HandleDeviceConnected(multidevice_setup::DeviceInfoPtr device, bool connected) override; void HandleDeviceDisconnected(multidevice_setup::DeviceInfoPtr device, bool disconnected) override; // MultideviceSetupClient: void ShowPrompt() override; void DisablePrompt() override; void SetController(multidevice_setup::DeviceInfoController* controller) override; void GetAdditionalAdapters( multidevice_setup::DeviceInfoPtr device_info, multidevice_setup::mojom::DeviceInfoPtr device_info, multidevice_setup::DeviceInfoPtr subdevice_info, multidevice_setup::mojom::NetworkInterfaces* network_interfaces, multidevice_setup::mojom::NetworkInterfaces* subnetwork_interfaces) override; private: void ShowError(multidevice_setup::mojom::NetworkInterfaces* network_interfaces, multidevice_setup::mojom::NetworkInterfaces* subnetwork_interfaces, multidevice_setup::DeviceInfoPtr device_info); void ShowDeviceError(multidevice_setup::mojom::NetworkInterfaces* network_interfaces, multidevice_setup::mojom::NetworkInterfaces* subnetwork_interfaces, multidevice_setup::DeviceInfoPtr device_info); std::string elided_device_id_; DISALLOW_COPY_AND_ASSIGN(DeviceInfoControllerChromeOS); }; } // namespace multidevice_setup } // namespace chromeos #endif // CHROMEOS_SERVICES_MULTIDEVICE_SETUP_DEVICE_INFO_CONTROLLER_CHROMEOS_H_ ==================================================================================================== /* * 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/dwi.h" #include "dwi/tractography/tracking/voxel.h" #include "dwi/tractography/tracking/matrix.h" #include "dwi/tractography/tracking/vector.h" #include "dwi/tractography/voxel.h" #include "dwi/tractography/mapping/voxel.h" #include "dwi/tractography/mapping/vector.h" #include "dwi/tractography/mapping/matrix.h" #include "dwi/tractography/mapping/draw.h" #include "dwi/tractography/mapping/dwi.h" #include "dwi/tractography/mapping/rotation.h" #include "dwi/tractography/mapping/connectivity.h" #include "dwi/tractography/mapping/gps.h" #include "dwi/tractography/mapping/drag.h" #include "dwi/tractography/mapping/tre-voxel.h" #include "dwi/tractography/mapping/tie-voxel.h" #include "dwi/tractography/mapping/voxel.h" #include "dwi/tractography/mapping/vector.h" #include "dwi/tractography/mapping/cdi.h" #include "dwi/tractography/mapping/range.h" #include "dwi/tractography/mapping/voxel.h" #include "dwi/tractography/mapping/vector.h" #include "dwi/tractography/mappings/numeric.h" #include "dwi/tractography/mappings/pdi.h" #include "dwi/tractography/properties.h" #include "dwi/tractography/dwi.h" #include "dwi/tractography/probe.h" #include "dwi/tractography/mode.h" #include "dwi/tractography/mean.h" #include "dwi/tractography/value.h" #include "dwi/tractography/normalized_cdi.h" #include "dwi/tractography/linear_to_cartesian.h" #include "dwi/tractography/cdi.h" #include "dwi/tractography/mapping/atoms.h" ==================================================================================================== /* * jdcolorsel.c * * Copyright (C) 1991, 1992, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains color quantization and dequantize code. * The purpose of this code is to quantize the input data using a 1-D * method suitable for use as an output color. If the input is not already * ordered, it is combined with the color map from this JPEG code. * This ensures that the output image will always have one band, * and there will be no false match. * This is what you would use for storing colors in a bit-mapped * manner. * * This file contains color quantization and dequantize code. * The various methods that I know of use these routines are similar * to those in jdivjdct.c. They are scaled down to maintain the * original system overall scalings. */ #define JPEG_INTERNALS #include "jinclude8.h" #include "jpeglib8.h" #include "jdhuff16.h" /* Private chunk of shared memory for jdivjdct */ typedef struct { /* These two fields are shared between different modules */ JOCTET *data; /* pointer to actual data */ JDIMENSION datasiz; /* size of data array */ JDIMENSION line; /* line number within image data */ /* Two counters */ JDIMENSION numbrushes; /* # of recolor blocks handled */ JDIMENSION maxbrushes; /* # of recolor blocks allowed */ JDIMENSION maxbrushes_limit; /* maximum number of recolor blocks */ /* Output quantizer, must be after colormap reset */ JQUANT_TBL quant_tbl; /* qtbl is derived from the other modules */ /* I suspect this isn't really necessary, but it's included in a JfifI */ struct colormap *colormap; JDIMENSION clutsize; /* These two fields are re-organized in the future. The user may fix these */ /* fields if they want to use less color quantization (i.e., if the colormap * is read-only, then a JPEG file would need to be rescanned). */ JDITHERMETHOD dither; /* see below */ JDITHERORDER dither_method; /* see below */ int ncolors; /* number of colormap entries */ JDIMENSION maxcolors; /* maximum number of colormap entries */ JDIMENSION base_colors; /* first color is this index of maxcolors */ JDIMENSION *counts; /* counts are used as clut values */ JDIMENSION *covals; /* indices are used as clut values */ int *sizes; /* sizes are used as clut values */ /* These two fields are only used during decompression: */ JDIMENSION width, height; /* width and height of image */ JDIMENSION *pixelindex; /* pixel index for colors */ unsigned int *red; /* one per pixel (red) */ unsigned int *green; /* one per pixel (green) */ unsigned int *blue; /* one per pixel (blue) */ JSAMPARRAY colormap; /* colormap entries for input image */ } my_error_mgr; /* * These array contains pointers to color quantizers we need to do * as follows: * * o quantizer_index[i] * * o quantizer_table[i][j] * * o quantizer_counts[i][j] * * o dequantize_colors[i][j] * * o dequantize_counts[i][j] * * o zero_count[i][j] * * The color map is a mapping from quantized color indices to quantized * colors. This is also the distance from quantized color indices to * quantized colors. * * quant_buffer[i] returns a pointer to a buffer of color quantizers, * and is an array of arrays of JSAMPLEs of size i * j * * JDIMENSION in size. */ /* Private color in-memory state */ typedef struct { int count; /* total number of colors for this color */ JSAMPLE *colormap; /* pointer to array of colors */ JSAMPLE *quant ==================================================================================================== /* Copyright (c) 2006 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. */ #ifndef AKONADI_SEARCHQUERY_H #define AKONADI_SEARCHQUERY_H #include #include namespace Akonadi { class SearchQueryPrivate; /** * @short Represents a search query. * * This class provides a way to retrieve the search criteria from a query. * * @author Volker Krause */ class AKONADI_EXPORT SearchQuery : public Akonadi::Item { Q_OBJECT public: /** * Creates a new search query. */ explicit SearchQuery(const QString &searchTerm); /** * Creates a new search query using the specified search term. * * @param searchTerm The search term. */ explicit SearchQuery(const QString &searchTerm, const QString &defaultSearchTerm); /** * Destroys the search query. */ ~SearchQuery(); /** * Returns the query as a QString. */ QString query() const; /** * Returns the search term, e.g. "ja:jo:qaz" */ QString term() const; /** * Returns the default search term, e.g. "ja:jo:qaz" */ QString defaultSearchTerm() const; /** * Returns the query as a QVariantList. */ QVariantList queryAsVariantList() const; /** * Sets the query as a QVariantList. * * @param queryAsVariantList the query as a QVariantList. */ void setQueryAsVariantList(const QVariantList &queryAsVariantList); /** * Sets the query as a search term. * * @param searchTerm the search term. */ void setTerm(const QString &searchTerm); /** * Sets the default search term. * * @param defaultSearchTerm the default search term. */ void setDefaultSearchTerm(const QString &defaultSearchTerm); protected: /** * Sets the item matching criteria. * * @param criteria the search criteria. */ void setTermMatches(const QStringList &criteria); private: Q_DECLARE_PRIVATE(SearchQuery) }; } #endif ==================================================================================================== /* * Copyright (C) 2016 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 "trace/Trace.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utils.h" #include "sysdeps.h" #include "procinfo.h" #include "traced_string_utils.h" #include "vm/Context.h" using std::string; namespace { struct TraceEntry { TraceEntry() : timestamp(0), pid(0), tid(0) {} TraceEntry(uint64_t timestamp, pid_t pid, tid_t tid) : timestamp(timestamp), pid(pid), tid(tid) {} TraceEntry(const TraceEntry& from) { timestamp = from.timestamp; pid = from.pid; tid = from.tid; } TraceEntry& operator=(const TraceEntry& from) { timestamp = from.timestamp; pid = from.pid; tid = from.tid; return *this; } uint64_t timestamp; pid_t pid; tid_t tid; }; static inline int compareEntries(const TraceEntry& a, const TraceEntry& b) { return a.timestamp > b.timestamp ? 1 : (a.timestamp == b.timestamp && a.pid > b.pid ? 1 : a.timestamp < b.timestamp ? -1 : 0); } static inline void compareAllEntries(TraceEntry a, TraceEntry b) { if (a.timestamp == b.timestamp) { if (a.pid == b.pid) { if (a.tid == b.tid) { return; } } else { return; } } a.timestamp = b.timestamp; a.pid = b.pid; a.tid = b.tid; } static void fillTraceEntries(const TraceEntry* entries, const TraceEntry* entries_end, std::vector* out) { for (const TraceEntry& entry : *entries) { out->push_back(entry); } while (entries < entries_end) { out->push_back(entries->timestamp); entries++; } } // Returns a new context if it has already been added and can be safely reused. TraceContext* findTraceContext(pid_t tid, pid_t pid, pid_t* out_tid) { TRACE_EVENT_INSTANT0("gpu.ipc", TRACE_DEFAULT, "begin { %p pid %d tid %d }", this, pid, *out_tid); bool traceContextInUse = false; struct { pid_t pid; pid_t tid; pid_t ctxTraceRootId; uid_t ctxTraceUid; uid_t ctxTraceUidEnd; } setPidMap[] = { { 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 ==================================================================================================== #include "gmp.h" #include "perfrate.h" #include "aprcl.h" #include "gotool.h" #include "mpn_extras.h" #include "silo.h" void silo_init_backfill(void) { ub1[0] = ub2[0] = ub3[0] = 0; for (i = 0; i < 8; i++) { mpi_init(&up[i]); mpi_init(&low[i]); } for (i = 0; i < 32; i++) { mpi_init(&low_high[i]); if (i == 0) low[0] = high[0] = 0; else { mpi_lshift(low[0], high[0], &low[0], i); mpi_lshift(low[1], high[1], &low[1], i); mpi_lshift(low[2], high[2], &low[2], i); mpi_lshift(low[3], high[3], &low[3], i); mpi_lshift(low[4], high[4], &low[4], i); mpi_lshift(low[5], high[5], &low[5], i); mpi_lshift(low[6], high[6], &low[6], i); mpi_lshift(low[7], high[7], &low[7], i); } } return; } static void bs_lshift_2(int i, unsigned char *in, unsigned char *up, int s) { mpi_mul_2exp(up, up, i, s); mpi_add_ui(up, up, 1); mpi_mul_2exp(in, in, i, s); } static void bs_lshift_4(int i, unsigned char *in, unsigned char *up, int s) { mpi_mul_2exp(up, up, i, s); mpi_lshift(up, up, 1); mpi_lshift(in, in, 1); } static unsigned char convert_byte(int n) { if (n >= 0) return n; else { unsigned char r; r = n % 256; n = n / 256; if (n >= 128) return n | 0x80; if (n >= 64) return n | 0x40; return n | 0x20; } } void silo_mich_init(void) { mich_init(64, 36, up[0]); mich_init(32, 22, up[1]); mich_init(16, 11, up[2]); mich_init(8, 4, up[3]); mich_init(4, 0, up[4]); mich_init(2, 0, up[5]); mich_init(1, 0, up[6]); mich_init(0, 8, up[7]); } unsigned char silo_mich_inp(void) { if (orig_nbits == -1) { bs_lshift_2(0, up, out, dlim); bs_lshift_2(0, low, out, dlim); bs_lshift_2(0, low_high, out, dlim); return out[0]; } else { bs_lshift_4(0, up, out, dlim); bs_lshift_4(0, low, out, dlim); bs_lshift_4(0, low_high, out, dlim); bs_lshift_2(8, low_high, out, dlim); bs_lshift_2(4, low_high, out, dlim); bs_lshift_2(2, low_high, out, dlim); bs_lshift_2(1, low_high, out, dlim); bs_lshift_2(0, low_high, out, dlim); return out[0]; } } void silo_split(unsigned ==================================================================================================== #include "allegro5/allegro.h" #include "allegro5/allegro_image.h" #include "allegro5/allegro_image_vtable.h" #include "allegro5/internal/aintern.h" #include "allegro5/internal/aintern_display.h" #include "allegro5/internal/aintern_bitmap.h" #include "allegro5/internal/aintern_system.h" #include "allegro5/internal/aintern_display_ex.h" #include "allegro5/internal/aintern_dynamic.h" #include "allegro5/internal/aintern_system_x.h" #include "allegro5/internal/aintern_xwin.h" ALLEGRO_DEBUG_CHANNEL("image") #define MAX_QUALITY 8 #define DEFAULT_QUALITY 0 ALLEGRO_EVENT_QUEUE *_events_queue = NULL; ALLEGRO_TIMER *_events_timer = NULL; ALLEGRO_MOUSE *_mouse = NULL; int _dx = 0, _dy = 0; #define _MAX_DEPTH 16 ALLEGRO_EVENT_QUEUE *_event_queue = NULL; ALLEGRO_TIMER *_event_timer = NULL; ALLEGRO_MOUSE *_mouse = NULL; ALLEGRO_BITMAP *_bitmap = NULL; ALLEGRO_BITMAP *_tmp_bitmap = NULL; /* Function pointers for the module's functions. */ ALLEGRO_COLOR_LUT *xal_color_lut = NULL; /* Function pointer for event handling functions. */ static void xal_event_handler(ALLEGRO_EVENT_SOURCE *source, const ALLEGRO_EVENT *event) { (void)source; (void)event; /* Mouse cursor motion, but not released or repeating: */ if (event->type == ALLEGRO_EVENT_MOUSE_MOTION) { if (event->mouse_state & ALLEGRO_EVENT_KEY_DOWN && event->mouse_state & ALLEGRO_EVENT_KEY_UP) { ALLEGRO_BITMAP *cursor = _mouse->hot_x; if (cursor != _bitmap) { _mouse->hot_x = NULL; _mouse->hot_y = NULL; _bitmap = cursor; _dx = _mouse->x - _bitmap->w / 2; _dy = _mouse->y - _bitmap->h / 2; } else { _mouse->hot_x = NULL; _mouse->hot_y = NULL; _bitmap = NULL; _dx = 0; _dy = 0; } _mouse->rel_x = 0; _mouse->rel_y = 0; } } } /* Function pointer for the server's event handling functions. */ static void xal_client_event_handler(ALLEGRO_DISPLAY_XDISPLAY *xdpy, const ALLEGRO_XEVENT *event) { (void)xdpy; (void)event; /* Possibly: * - User asks the X server for a new context * - Discard the event if it's not for a new context. * * Currently, most of the time this function does not deliver an * xEvent but rather a request for the next one. */ _al_event_source_lock(event->source); if (!_al_event_source_process_xevent(event->source, event)) { _al_event_source_unlock(event->source); return; } _al_event_source_unlock(event->source); /* All done: release the xServer connection to the X server. */ _al_xserver_connection_release(event->x_server); } /* Function pointer for the X-Server's event handling functions. */ static void xal_server_event_handler(ALLEGRO_DISPLAY_XDISPLAY *xdpy, const ALLEGRO_XEVENT *event) { (void)xdpy; (void)event; /* FIXME: Does the X-Server support mouse debugging? * Consider providing this to the message handler. */ } /* Function pointer for the window manager's event handler functions. */ static void xal_window_manager_event_handler(ALLEGRO_DISPLAY_XDISPLAY *xdpy, const ALLEGRO_XEVENT ==================================================================================================== /*************************************************************************** qgsvectorlayerproperties.cpp -------------------------------------- Date : July 2017 Copyright : (C) 2017 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 "qgsvectorlayerproperties.h" #include "qgsvectorlayerutils.h" #include "qgsapplication.h" #include "qgslogger.h" #include "qgsvectorlayer.h" #include "qgsfields.h" #include "qgsexpressionutils.h" #include "qgsfeatureiterator.h" #include "qgsrendercontext.h" #include "qgsvectorlayerexpressioncontext.h" #include "qgsexpressioncontextutils.h" #include "qgsvectorlayerpropertiesfilter.h" #include "qgsexpressioncontextutils.h" #include "qgsextensionmanager.h" #include "qgsrenderer.h" QgsVectorLayerProperties::QgsVectorLayerProperties( const QgsVectorLayer *layer, bool isExpression, bool isVectorLayer ) : mExpression( isExpression ) , mVectorLayer( isVectorLayer ) { switch ( layer->dataProvider()->capabilities() ) { case QgsFeatureRequest::SubsetOfAttributes: { mUseSubsetExpression = true; mUseSubsetVectorLayer = true; break; } case QgsFeatureRequest::OrderBy: { mOrderBy = true; break; } case QgsFeatureRequest::OrderByUnref: { mOrderByUnref = true; break; } case QgsFeatureRequest::Scope: { mScope = true; break; } case QgsFeatureRequest::OrderByRows: { mOrderByRows = true; break; } } mExpressionContext = QgsExpressionContextUtils::createExpressionContext(); mExpressionContext->setFeature( layer ); if ( mExpression ) mExpressionContext->setLayer( layer ); if ( isExpression ) mExpressionContext->setContainsNestedFields( true ); if ( isVectorLayer ) { mExpressionContext->setSimplifyHints( QgsVectorSimplifyMethod::NoSimplification ); mExpressionContext->setLayer( layer ); } if ( mOrderBy ) mExpressionContext->setOrderBy( QgsVectorOrderByMethod::DirectOrderBy ); mExpressionContext->setOutputLayer( mVectorLayer ); mExpressionContext->setExpressionContext( mExpressionContext ); mExpressionContext->setLayer( mVectorLayer ); mExpressionContext->setOutputLayer( nullptr ); mExpressionContext->setSource( layer->fields() ); mExpressionContext->setExpressionContext( mExpressionContext ); mExpressionContext->setLayer( mVectorLayer ); init() ; } QgsVectorLayerProperties::~QgsVectorLayerProperties() { delete mExpressionContext; delete mExpressionContext2; } bool QgsVectorLayerProperties::accept( QgsVectorLayer *layer ) { if ( !layer ) return false; switch ( layer->dataProvider()->capabilities() ) { case QgsFeatureRequest::SubsetOfAttributes: { return mUseSubsetExpression && mUseSubsetVectorLayer; } case QgsFeatureRequest::OrderBy: { return mOrderBy && mOrderByUnref && mOrderByRows; } case QgsFeatureRequest::OrderByUnref: { return mOrderBy && mOrderByUnref && mOrderByRows; } case QgsFeatureRequest::Scope: { return mScope && mScopeUnref && mScopeRows; } case QgsFeatureRequest::OrderByRows: { return mOrderBy && mOrderByRows && mOrderByUnref; } } return false; } bool QgsVectorLayerProperties::accept( const QgsFields &fields ) { if ( !fields.indexes().isEmpty() ) return true; if ( !fields.fields().isEmpty() ) return true; if ( !fields ==================================================================================================== /* { dg-do run } */ /* { dg-options "-O2 -mavx512vl" } */ /* { dg-require-effective-target avx512vl } */ #define AVX512VL #include "avx512f-helper.h" #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" static void CALC (short *r) { int i; for (i = 0; i < SIZE; i++) { r[i] = ~(((int32_t)r[i] + 127) >> 8) & 0xffff; } } void TEST (void) { UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3, src1, src2, src3; MASK_TYPE mask = MASK_VALUE; int i; for (i = 0; i < SIZE; i++) { src1.a[i] = i + 100; src2.a[i] = i + 30; src3.a[i] = i + 60; } res1.x = INTRINSIC (_mask_calc_epi32) (src1.x, src2.x); res2.x = INTRINSIC (_maskz_calc_epi32) (mask, src1.x, src2.x); res3.x = INTRINSIC (_mask_calc_epi32) (src1.x, src2.x); CALC (res1.a); CALC (res2.a); CALC (res3.a); if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res2, res3)) abort (); } ==================================================================================================== // 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 COMPONENTS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_DELEGATE_H_ #define COMPONENTS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_DELEGATE_H_ #include #include #include #include "base/callback.h" #include "base/strings/string16.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_contents_user_data_manager.h" #include "content/public/browser/web_contents_user_data_utility.h" #include "components/content_settings/core/common/content_settings.h" #include "content/public/browser/web_contents_user_data_factory.h" #include "content/public/browser/web_contents_user_data_url.h" #include "content/public/browser/web_contents_user_settings_observer.h" #include "content/public/browser/web_contents_user_visibility_observer.h" #include "content/public/browser/web_contents_user_types.h" #include "content/public/browser/web_contents_user_message_utils.h" #include "content/public/browser/web_contents_user_web_contents.h" #include "content/public/browser/web_contents_user_web_contents_url.h" #include "content/public/browser/web_contents_user_web_contents_policy.h" #include "content/public/browser/web_contents_user_web_contents_security_policy.h" #include "content/public/browser/web_contents_user_web_contents_policy_impl.h" #include "content/public/browser/web_contents_user_web_contents_result.h" #include "content/public/browser/web_contents_user_web_contents_url_loader_factory.h" #include "content/public/browser/web_contents_user_web_contents_url_loader_factory_delegate.h" #include "content/public/browser/web_contents_user_web_contents_state.h" #include "content/public/browser/web_contents_user_web_contents_type.h" #include "content/public/browser/web_contents_user_web_contents_type_client.h" #include "content/public/browser/web_contents_user_web_contents_type_service.h" #include "content/public/browser/web_contents_user_web_contents_type_manager.h" #include "content/public/browser/web_contents_user_web_contents_type_test.h" #include "content/public/browser/web_contents_user_web_contents_type_test_delegate.h" #include "content/public/browser/web_contents_user_web_contents_type_test_factory.h" #include "content/public/browser/web_contents_user_web_contents_test.h" #include "content/public/browser/web_contents_user_web_contents_test_delegate.h" #include "content/public/browser/web_contents_user_web_contents_test_factory.h" #include "content/public/browser/web_contents_user_web_contents_test_delegate.h" #include "content/public/browser/web_contents_user_web_contents_test_factory.h" #include "content/public/browser/web_contents_user_web_contents_unittest.h" #include "content/public/browser/web_contents_user_web_contents_unittest_delegate.h" #include "content/public/browser/web_contents_user_web_contents_utility_generated_test.h" #include "content/public/browser/web_contents_user_web_contents_utility_generated_test_delegate.h" # ==================================================================================================== /* Copyright (C) 2017-2018 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 static const char from_name[] = "C"; static const char to_name[] = "C"; /* Translate string ICONVNAME from locale name ICONVNAME. Return the locale-specific code, or -1 if the name cannot be translated. */ int __nl_locale_name_lookup (name, translit) const char *name; const char *translit; { const char *codeset; codeset = strchr (name, translit[0]); if (codeset == NULL || codeset[0] == '\0') return -1; return strcmp (codeset, name); } #define TEST(NAME, CONVERT) \ { \ if (strcmp_cvt (NAME, TYPE_NAME (NAME), CONVERT, NULL) != 0) \ { \ if (result != NULL) \ { \ fprintf (stderr, NAME ": %s " _NL_FHEXFMT, \ name, (unsigned int) (CONVERT)); \ result = NULL; \ } \ return -1; \ } \ } int __nl_locale_name_lookup_l (name, translit, locale, result) const char *name; const char *translit; const char *locale; const char *result; { TEST (name, CONVERT); return locale_name_lookup (locale, result, translit); } #define TEST_LOCALE(NAME, CONVERT, SPEC) \ { \ char *result_locale = NULL; \ const char *result_spec = NULL; \ TEST (name, CONVERT); \ { \ if (setlocale_hook != NULL) \ { \ locale_t c = newlocale (locale, SPEC, (locale_t) 0); \ TEST (c != NULL, SPEC); \ result_locale = c_strdup (c_locale_name (c)); \ } \ result_spec = setlocale (LC_ALL, LOCALE_S); \ } \ if (result_locale != NULL) \ { \ TEST (result_locale, SPEC); \ if (result_spec != NULL) \ result_locale = __strdup (result_spec); \ freelocale (c); \ } \ else \ { \ TEST (result_locale, C_LOCALE_NAME (locale)); \ } \ free (result_locale); \ result_locale = NULL; \ } int __nl_locale_name_lookup_l_l (name, translit, locale, result, result_locale) const char *name; const char *translit; const char *locale; const char *result; char **result_locale; { TEST (name, CONVERT); { TEST_LOCALE (name, CONVERT, _NL_CURRENT_LOCALE ()); } { const char *translit2; TEST (name, CONVERT); translit2 = locale_name (locale); if (translit2 != NULL && strcmp (translit2, translit) == 0) { *result = translit2; *result_locale = result; return 0; } TEST (translit2 == ==================================================================================================== /* * vic20v02.h * * Written by * Andre Fachat * * 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. * */ #ifndef VICE_VIC20V02_H #define VICE_VIC20V02_H #include "types.h" extern int vic20v02_model_new(void); extern void vic20v02_model_shutdown(void); extern int vic20v02_read_snapshot(const char *model, snapshot_t *s); extern int vic20v02_snapshot_read_module(snapshot_t *s); extern int vic20v02_snapshot_write_module(snapshot_t *s); extern void vic20v02_model_detach(void); extern void vic20v02_model_detach_one(void); extern int vic20v02_i5000_snapshot_read_module(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_drom(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_drom(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_dfprom(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_dfprom(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_efprom(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_efprom(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_ide(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_ide(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_none(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_none(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_svf(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_svf(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_snap(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_snap(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_pase2(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_pase2(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_pase3(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_pase3(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_space_88(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_space_88(snapshot_t *s); extern int vic20v02_i5000_snapshot_read_module_space_90(snapshot_t *s); extern int vic20v02_i5000_snapshot_write_module_space_90(snapshot_t * ==================================================================================================== /*___INFO__MARK_BEGIN__*/ /************************************************************************* * * The Contents of this file are made available subject to the terms of * the Sun Industry Standards Source License Version 1.2 * * Sun Microsystems Inc., March, 2001 * * * Sun Industry Standards Source License Version 1.2 * ================================================= * The contents of this file are subject to the Sun Industry Standards * Source License Version 1.2 (the "License"); You may not use this file * except in compliance with the License. You may obtain a copy of the * License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html * * Software provided under this License is provided on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. * See the License for the specific provisions governing your rights and * obligations concerning the Software. * * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * * Copyright: 2001 by Sun Microsystems, Inc. * * All Rights Reserved. * ************************************************************************/ /*___INFO__MARK_END__*/ #include #include #include #include #include #include #include "uti/sge_rmon.h" #include "uti/sge_unistd.h" #include "uti/sge_debug.h" #include "sgeobj/sge_object.h" #include "sgeobj/sge_job.h" #include "sgeobj/sge_answer.h" #include "sgeobj/sge_centry.h" #include "sgeobj/sge_host.h" #include "sgeobj/sge_qinstance.h" #include "sgeobj/sge_qinstance_state.h" #include "sgeobj/sge_usage.h" #include "sgeobj/sge_job.h" #include "sgeobj/sge_report.h" #include "sgeobj/sge_qinstance.h" #include "sgeobj/sge_jsv_job.h" #include "basis_types.h" #include "sge.h" #include "sched/sge_job_schedd.h" #include "sched/load_correction.h" #include "msg_common.h" #include "msg_common.h" /* Set a default, inactive, attribute for a specified job */ int set_job_attr(lListElem *jep, int attribute) { lListElem *tep = lGetElemStr(jep, JB_job_id, SGE_ATTR_JOB_ID); u_long32 job_id = lGetUlong(jep, JB_job_number); u_long32 ja_task_id = lGetUlong(jep, JB_ja_task_id); lListElem *project = NULL; lList *usage = NULL; const char *attr_name = "default"; lList *attr_list = lGetList(jep, JB_job_usage); lListElem *usage_rule = NULL; lList *rue_list = lGetList(jep, JB_master_resource_list); const char *user = NULL; const char *comment = NULL; lList *view_list = lGetList(jep, JB_master_view_list); lListElem *centry = NULL; bool has_defaults = false; int num_attributes = 0; int l; int ret = 0; DENTER(TOP_LAYER, "set_job_attr"); lSetList(jep, JB_job_usage, lCopyList("", usage_list)); lSetList(jep, JB_job_execution_time, lCopyList("", rue_list)); lSetList(jep, JB_job_hgroup_list, lCopyList("", view_list)); lSetList(jep, JB_env_list, lCopyList("", usage_list ==================================================================================================== // Copyright (c) 1997-2000 Max-Planck-Institute Saarbruecken (Germany). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL: https://github.com/CGAL/cgal/blob/v5.2/Nef_3/include/CGAL/Nef_3/SNC_decorator.h $ // $Id: SNC_decorator.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Peter Hachenberger #ifndef CGAL_NEF_3_SNC_DECORATOR_H #define CGAL_NEF_3_SNC_DECORATOR_H #include #include #include #include #include #include #include #include #include namespace CGAL { /* Decompose the angular interval, defined as the first angle and the denominator in the current interval. This version takes an interval and returns it as the current interval. */ template class SNC_decorator { public: typedef typename Rat_interval_info::Rat_info Rat_info; typedef typename Rat_info::Status_line Status_line; typedef typename Rat_info::Vector Rat_vector; typedef Rat_vector SNC_interval_vector; typedef typename Rat_info::SVertex_handle SVertex_handle; typedef typename Rat_info::SHalfedge_handle SHalfedge_handle; typedef typename Rat_info::SHalfloop_handle SHalfloop_handle; typedef typename Rat_info::SFace_handle SFace_handle; typedef typename Rat_info::SVertex_iterator SVertex_iterator; typedef typename Rat_info::SEdge_iterator SEdge_iterator; typedef typename Rat_info::SFace_iterator SFace_iterator; typedef typename Rat_info::SFace_cycle SFace_cycle; typedef typename Rat_info::NT x_coord_type; typedef typename Rat_info::SHalfedge_around_facet_circulator SHalfedge_around_facet_circulator; typedef typename Rat_info::SHalfedge_around_facet_const_circulator SHalfedge_around_facet_const_circulator; typedef typename Rat_info::SHalfedge_around_facet_const_pair_circulator SHalfedge_around_facet_const_pair_circulator; typedef typename Rat_info::SBounding_side_iterator SBounding_side_iterator; typedef typename Rat_info::SBounding_triangle_handle SBounding_triangle_handle; typedef typename Rat_info::SNC_decorator_base_3_nn_handle SNC_decorator_base_3_nn_handle; typedef typename Rat_info::SHalfedge_handle SHalfedge_handle; typedef typename Rat_info::SHalfloop_handle SHalfloop_handle; typedef typename Rat_info::SFace_handle SFace_handle; typedef typename Rat_info::SNC_decorator_base_3_nn SNC_decorator_base_3_nn; private: const SNC_decorator& operator=(const SNC_decorator&) const; public: SNC_decorator() : SNC_decorator_base_3_nn(this) {} SNC_decorator(SNC_decorator_ ==================================================================================================== /* * RTP packetization * Copyright (c) 2018-2019 The strace developers. * All rights reserved. * * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "rtp.h" #include "control.h" #include #include #include #include #include /* RFC 3628, 18.5, for deinterleaved (and not interleaved) RTP packets. * FIXME: ISO C does not define the default behaviour. It accepts * 12-bit unsigned integer (of size 2) as an unsigned short. */ #define NPACKET_TYPE_ISI(u) ((u) == NPACKET_TYPE_I) #define NPACKET_TYPE_OSI(u) ((u) == NPACKET_TYPE_O) #define NPACKET_TYPE_OUI(u) ((u) == NPACKET_TYPE_OI) #define NPACKET_TYPE_II(u) ((u) == NPACKET_TYPE_II) #define NPACKET_TYPE_III(u) ((u) == NPACKET_TYPE_III) #define NPACKET_TYPE_IV(u) ((u) == NPACKET_TYPE_IV) /* handle #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12 */ #define NPACKET_TYPE_I(u) ((u) == NPACKET_TYPE_I) #define NPACKET_TYPE_O(u) ((u) == NPACKET_TYPE_O) #define NPACKET_TYPE_OI(u) ((u) == NPACKET_TYPE_OI) #define NPACKET_TYPE_II(u) ((u) == NPACKET_TYPE_II) #define NPACKET_TYPE_III(u) ((u) == NPACKET_TYPE_III) #define NPACKET_TYPE_IV(u) ((u) == NPACKET_TYPE_IV) /* new definitions, using various endianness defined in struct definition. */ #define NPACKET_TYPE_UNUSED ((npacket_type_t)0x0FFF) #define NPACKET_TYPE_COUNT ((npacket_type_t)0xFFFF) #define NPACKET_TYPE_IPV4 ((npacket_type_t)0x1000) #define NPACKET_TYPE_IPV6 ((npacket_type_t)0x2000) #define NPACKET_TYPE_L2TP ((npacket_type_t)0x3010) #define NPACKET_TYPE_L4TP ((npacket_type_t)0x3011) #define NPACKET_TYPE_L8TP ((npacket_type_t)0x3012) #define NPACKET_TYPE_IPv4LL ((npacket_type_t)0x4000) #define NPACKET_TYPE_IPv6LL ((npacket_type_t)0x4001) #define NPACKET_TYPE_ARP ((npacket_type_t)0x4010) #define NPACKET_TYPE_LAN ((npacket_type_t)0x4000) #define NPACKET_TYPE_IRDA ((npacket_type_t)0x5000) #define NPACKET_TYPE_CLMP ((npacket_type_t)0x6000) #define NPACKET_TYPE_RMCP ((npacket_type_t)0x7000) #define NPACKET_TYPE_UDP ((npacket_type_t)0x9000) #define NPACKET_TYPE_TCP ((npacket_type_t)0xA000) #define NPACKET_TYPE_RTP ((npacket_type_t)0xB000) #define NPACKET_TYPE_SDPL ((npacket_type_t)0xD000) #define NPACKET_TYPE_RSVP ((npacket_type_t)0xE000) #define NPACKET_TYPE_RTCP ((npacket_type_t)0xF000) static inline unsigned npacket_type_from_byteorder(unsigned n) { switch(n) { case NPACKET_TYPE_I: return NPACKET_TYPE_I; case NPACKET_TYPE_O: return ==================================================================================================== /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ #ifndef _RTE_REGEX_H_ #define _RTE_REGEX_H_ /** * \file * RTE Regex Configuration * * Contains inline functions, static inline functions and data structures. * * @note * This file is intended to be included by applications that do things * like set of defines in regex.h (e.g. put full #define pattern here). * * @code * #ifndef _RTE_REGEX_H_ * #include * @endcode * * The public header file is split into several parts. The header file is * enclosed in quotes, '\', and '\[' within strings. * * We split the names of the next/previous and all the names in the structure * as: * * NAME[=VALUE]. * * The Nth component is (size - 1). * * Example: * * // "a" => "" * .[foo = "b"] * .[foo = "c"] * * We have: * * .foo = "a" * .bar = "[foo]" * .baz = "[foo]" * * We split the rest of the name in "name". Then we call this macro * substitutes the macro argument names "name" and the substitutions * "name" may be replaced by "|". */ #ifdef __cplusplus extern "C" { #endif #ifndef _RTE_REGEX_H_ #include "regex_internal.h" #endif #ifndef _RTE_REGEX_REPLACE_H_ #include "regex_replace.h" #endif /** * The arguments to the entire function are as follows: * * - No replacement is done * - Macro name is enclosed in quotes, '\', ']' and ']' are removed * - Macro value is enclosed in quotes, '\', ']' and ']' are replaced * - If the macro is enclosed in quotes, ']' or '[' is removed * - If the macro is enclosed in quotes and macro value is quoted, 'm' is * replaced with the escape character for matching values. */ #define RTE_REGEX_ARG_NO_REPLACE ((const char *)"") #define RTE_REGEX_ARG_STRING ((const char *)")" #define RTE_REGEX_ARG_LIST ((const char *)"[]") #define RTE_REGEX_ARG_ELIST ((const char *)"[]") /** * Parse a regexp string into tokens. * * The function parses the input string and returns a pointer to the * tokens. It keeps the input pointer in input string until the next * token is parsed or there are no more tokens. * * The parsed strings are re-allocated and are replaced with the strings * parsed so far. * * The memory for the tokens is NOT allocated by this function. It must * be freed by the caller. * * @param pattern * The pattern to use. * * @param pattern_len * The length of the pattern, including the terminating \0. * * @param re * The string to parse, passed to the function. * * @return * - Returns 0 on success, a negative value on failure. */ static inline int rte_regex(const char *pattern, size_t pattern_len, const char *re, char **tokens, const unsigned int num_tokens) { int ret; size_t i; *tokens = NULL; if ((pattern_len == 0) || (pattern[0] == '\0') || (pattern_len >= (1 << (CHAR_BIT - 1)))) { *tokens = calloc(1, 1); if (*tokens == NULL) return -ENOMEM; ret = rte_regex_split_string(pattern, pattern_len, tokens, num_tokens); } else { const char *first = pattern; const char *last = first + pattern_len; char *tmp = NULL; for (i = 0; i < pattern_len; i++) { if (last >= (first + i)) break; if (*first == '\\') last--; ==================================================================================================== /* @include ensdebug ******************************************************** ** ** Ensembl Debugging functions ** ** @author Copyright (C) 1999 Ensembl Developers ** @author Copyright (C) 2006 Michael K. Schuster ** @version $Revision: 1.52 $ ** @modified 2009 by Alan Bleasby for incorporation into EMBOSS core ** @modified $Date: 2013/02/17 13:20:51 $ by $Author: mks $ ** @@ ** ** 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. ** ******************************************************************************/ /* ========================================================================= */ /* ============================= include files ============================= */ /* ========================================================================= */ #include "ensdebug.h" #include "enssequenceadaptor.h" #include "enssequenceadaptorfeature.h" #include "enssequenceadaptorfeatureadaptor.h" #include "enssequenceadaptorsequence.h" #include "enssequenceadaptorfeatureadaptor.h" #include "enssequenceadaptorsequenceadaptor.h" #include "ensfeatureadaptor.h" #include "ensfeatureadaptorfeature.h" #include "ensfeatureadaptorfeatureadaptor.h" /* ========================================================================= */ /* =============================== constants =============================== */ /* ========================================================================= */ /* ========================================================================= */ /* ============================== private data ============================== */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private constants ============================ */ /* ========================================================================= */ /* ========================================================================= */ /* ============================== private macros ============================ */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private types =========================== */ /* ========================================================================= */ /* ========================================================================= */ /* ============================== private variables =========================== */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private functions =========================== */ /* ========================================================================= */ static AjBool sequenceadaptorFeatureApplyFeature (EnsPFeature feature, EnsPSlice slice); /* ========================================================================= */ /* ============================== private functions ============================ */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private variables =========================== */ /* ========================================================================= */ /* ========================================================================= */ /* ============================== private functions =========================== */ /* ========================================================================= */ static void featureadaptorSliceadaptorDel (EnsPFeatureadaptor * fea, EnsPSliceadaptor * sliceadaptor); static void featureadaptorSliceadaptorDel (EnsPFeatureadaptor * fea, EnsPSliceadaptor * sliceadaptor) { ensFeatureadaptorDel(fea, sliceadaptor); return; } /* ========================================================================= */ /* =========================== private constants =========================== */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private types =========================== */ /* ========================================================================= */ /* ========================================================================= */ /* =========================== private variables =========================== */ /* ========================================================================= */ static AjBool debug = AJFALSE; /* ========================================================================= */ /* ============================== private functions =========================== */ /* ========================================================================= */ /* @section constructors ****************************************************** ** ** All constructors return a new Ensembl Feature Adaptor by pointer. ** It is the responsibility of the user to first destroy any previous ** Feature Adaptor. The target pointer does not need to be initialised to ** NULL, but it is good programming practice to do so anyway. ** ** @fdata [EnsPFeatureadaptor] ** ** @nam3rule New Constructor ** @nam4rule Cpy Constructor with existing object ** @nam4rule Ini Constructor with initial values ** @nam4rule Ref Constructor by incrementing the reference counter ** @nam4rule Str Constructor by string ** ** @argrule Cpy rc [const EnsPFeatureadaptor] Ensembl Feature Adaptor ** @argrule Ini rc [EnsPFeatureadaptor] Ensembl Feature Adaptor ** @argrule Ini sequence [EnsPSlice] Ensembl Slice ** @argrule Ref rc [EnsPFeatureadaptor] Ensembl Feature Adaptor ** ==================================================================================================== // SPDX-License-Identifier: GPL-2.0-or-later /** @file * TODO: insert short description here *//* * Authors: * Lauris Kaplinski * * Copyright (C) 1999-2002 Authors * Copyright (C) 2001-2002 Ximian, Inc. * * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ #include #include "defs.h" #include "object/sp-object.h" #include "ui/tools-switch.h" #include "ui/tools/pressure.h" #include "ui/tools/gradient-tool.h" #include "ui/tools/point-selection.h" #include "ui/tools/vert-tool.h" #include "ui/tools/line-tool.h" #include "ui/tools/pattern-tool.h" #include "ui/tools/vect-tool.h" #include "ui/tools/path-grid-tool.h" #include "ui/tools/pattern-layer.h" #include "helper/gradient.h" #include "helper/vec.h" #include "helper/point.h" #include "helper/vector.h" #include "helper/types.h" #include "ui/selection-canvas.h" #include <2geom/bezier-curve.h> #include <2geom/point-ctrl-point.h> #include <2geom/point-ctrl-vector.h> #include "helper/d2d/line-ctrl-point.h" #include "helper/d2d/grid-ctrl-point.h" #include "live_effects/lpe-item.h" #include "live_effects/lpe-paths.h" #include "live_effects/lpe-paths-gradient.h" #include "live_effects/lpe-paths-points.h" #include "object/sp-path.h" #include "object/sp-affine.h" #include "object/sp-linear-gradient.h" #include "object/sp-linear-pattern.h" #include "ui/tools/drag.h" #include "ui/tools/desktop-tracker.h" #include "ui/tools/helper/constants.h" #include using Inkscape::SnapCandidatePoint; namespace Inkscape { namespace LivePathEffect { static const gdouble GRAVITY_DISTANCE = 5; LPEVectorPath::LPEVectorPath() : _activePath(nullptr) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); this->sp_guide_path_poly_default_pressure = false; this->sp_guide_path_poly_default_thickness = 0; this->dx = prefs->getDoubleLimited("/options/duck-vector-pressure", 0.0, 1.0, GRAVITY_DISTANCE); this->dy = prefs->getDoubleLimited("/options/duck-vector-thickness", 0.0, 1.0, GRAVITY_DISTANCE); this->start_delay = 0.0; this->end_delay = 0.0; this->change_start_delay(0.01); this->change_end_delay(0.01); this->path_x = Geom::Point(0, 0); this->path_y = Geom::Point(0, 0); } void LPEVectorPath::init() { this->path_x = Geom::Point(0, 0); this->path_y = Geom::Point(0, 0); } void LPEVectorPath::start(Geom::Point const &pos, bool set_position) { // will also stop if not active if (_activePath) { if (!set_position) { this->stop(); } Geom::Point new_start_pos(pos); bool close = false; if (SP_IS_guidepath(this->get_path())) { this->stop(); new_start_pos = Geom::Point(this->get_path_ ==================================================================================================== /* * 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 "AggregateFunctionExpression.h" #include "AggregateLabel.h" #include "Label.h" #include namespace JSC { namespace DFG { // We export this information to provide more debugging in situations where we want to plan to make // using it (like OSR: getOp() calls). If that information can be used (for example if we're // using op_get_by_id and getById() returns a weak pointer to a JSCell*), then we can avoid emitting this // information when there's something wrong with things in it. class GetByIdInfo final : public JSCell { public: static const size_t initialCapacity = 1; static const size_t sizeOfInternalField = 0; class Structure { public: Structure(const StructureInit& init) { // We can't grow this in size because that would become too much. ASSERT(init.type() == notArrayed || init.type() == notFullArrayed); sizeOfFieldsToAtLeast = sizeof(structure); } Structure(VM& vm, JSCell* owner, Structure* previous, bool isDictionary) { // We don't grow this in size because that would become too much. ASSERT(previous->structure(vm)->type() == previous->type()); sizeOfFieldsToAtLeast = sizeof(structure) + previous->sizeOfFieldsToAtLeast; sizeOfFields = sizeof(Structure) + previous->sizeOfFields; sizeOfInternalField = sizeof(Structure) + previous->sizeOfInternalField; structure = owner->m_arrayBuffer + sizeof(Structure) * (owner->m_numValuesInVector + 1); memset(structure, 0, sizeOfInternalField); ASSERT(isDictionary); m_numValuesInVector = std::min(previous->numValuesInVector(), previous->numValues()); m_type = previous->type(); } Structure(VM& vm, JSCell* owner, Structure* previous, JSType cellType) { sizeOfFieldsToAtLeast = sizeof(structure); sizeOfFields = sizeof(Structure) + previous->sizeOfFields; sizeOfInternalField = sizeof(Structure) + previous->sizeOfInternalField; structure = owner->m_arrayBuffer + sizeof(Structure) * (owner->m_numValuesInVector + 1); memset(structure, 0, sizeOfInternalField); ASSERT(cellType == cellType); m_numValuesInVector = std::min(previous->numValuesInVector(), previous->numValues()); m_type = previous->type(); } Structure(VM& vm, JSCell* owner, Structure* previous, JSType valueType, const Value& value) { sizeOfFieldsToAtLeast = sizeof(structure); sizeOfFields = sizeof(Structure) + previous->sizeOfFields; sizeOfInternalField = sizeof(Structure) + previous->sizeOfInternalField; structure = owner->m_arrayBuffer + sizeof(Structure) * (owner->m_numValuesInVector + 1); memset(structure ==================================================================================================== // SPDX-License-Identifier: GPL-2.0-only /* * Driver for Samsung LSI4100 SoC audio codec * * Copyright (C) 2017-2019 Samsung Electronics Co., Ltd */ #include #include #include #include #include #include #include #include #include #include #include #include "samsung-pltfm.h" #define PMC_I2S_SPEED_SAMPLE_RATE 20 #define PMC_I2S_SPEED_SAMPLERATE_RATIO 4 #define PMC_I2S_ENABLE_SOURCE_BIT 0x2 #define PMC_I2S_CTRL_TO_TIME(x) (((x) << 16) | ((x) << 8) | (x)) #define PMC_I2S_CK_RETRY_HZ 10 /* I2S Taps Base Address */ #define PMC_I2S_TBB_BASE (LPCM_I2S_BASE + 0x400) #define PMC_I2S_TBA_BASE (LPCM_I2S_BASE + 0x404) #define PMC_I2S_LINE_LEN (LPCM_I2S_BASE + 0x408) #define PMC_I2S_TIME_BASE (LPCM_I2S_BASE + 0x40C) #define PMC_I2S_AAD_LENGTH (LPCM_I2S_BASE + 0x410) #define PMC_I2S_CTRL_ADDR_MASK GENMASK(4, 0) /* I2S Mixed Length Control Register */ #define PMC_I2S_MFIXED_LENGTH_RESET BIT(15) /* I2S Mixed Length Control Register */ #define PMC_I2S_MISO_RESET_BIT BIT(15) #define PMC_I2S_MISO_BYPASS BIT(14) #define PMC_I2S_MISO_FMT_MASK GENMASK(1, 0) #define PMC_I2S_MISO_FMT_8 (0 << PMC_I2S_MISO_FMT_SHIFT) #define PMC_I2S_MISO_FMT_16 (1 << PMC_I2S_MISO_FMT_SHIFT) #define PMC_I2S_MISO_FMT_24 (2 << PMC_I2S_MISO_FMT_SHIFT) #define PMC_I2S_MISO_FMT_32 (3 << PMC_I2S_MISO_FMT_SHIFT) #define PMC_I2S_MISO_NUM_MASK GENMASK(1, 0) #define PMC_I2S_MISO_NUM_EN (0 << PMC_I2S_MISO_NUM_SHIFT) #define PMC_I2S_MISO_NUM_GPIO GENMASK(1, 0) #define PMC_I2S_MISO_NUM_GPIO_SHIFT 0 #define PMC_I2S_MISO_NUM_IN3 GENMASK(2, 0) #define PMC_I2S_MISO_NUM_IN3_SHIFT 1 #define PMC_I2S_MISO_NUM_IN2 GENMASK(3, 0) #define PMC_I2S_MISO_NUM_IN2_SHIFT 2 #define PMC_I2S_MISO_NUM_OUT3 GENMASK(4, 0) #define PMC_I2S_MISO_NUM_OUT3_SHIFT 3 #define PMC_I2S_MISO_FMT_SHIFT 4 #define PMC_I2S_MISO_NUM_SHIFT 5 #define PMC_I2S_MISO ==================================================================================================== // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fxfa/parser/cxfa_documenttextnode.h" #include #include "fxjs/xfa/cjx_node.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/xfa_document_layoutitem.h" CXFA_DocumentTextNode::CXFA_DocumentTextNode(CXFA_Document* pDocument) : CXFA_Node(pDocument) {} CXFA_DocumentTextNode::~CXFA_DocumentTextNode() { delete pDocument_; } void CXFA_DocumentTextNode::Copy(CXFA_DocumentText* pSrc) { CXFA_Node::Copy(pSrc); pDocument_ = pSrc->pDocument_; pNode()->SetText(pSrc->pNode()->GetText()); } bool CXFA_DocumentTextNode::ResolveDynamicProperties(CFX_WideTextBuf* pDynamic) { if (ResolveDynamicValue(pDynamic)) return true; return ResolveStaticValue(pDynamic); } CFX_WideString CXFA_DocumentTextNode::GetValue(CFX_WideStringC& wsText, FX_BOOL bUseXML) { if (HasChildValue()) return CXFA_Node::GetValue(wsText, bUseXML); wsText = L""; return wsText; } CFX_WideString CXFA_DocumentTextNode::GetValue(CFX_WideStringC& wsText, FX_BOOL bUseXML, CXFA_Node* pPattern) { if (HasChildValue()) return CXFA_Node::GetValue(wsText, bUseXML); wsText = L""; return CXFA_Node::GetValue(wsText, pPattern); } bool CXFA_DocumentTextNode::ResolveDynamicValue(CFX_WideTextBuf* pDynamic) { if (CXFA_Node* pChildValue = GetFirstChildValue()) { if (!pDynamic->GetBuffer(WideString(), pDynamic->GetSize())) return false; WideString wsValue; pDynamic->GetAt(0, wsValue); pChildValue->SetValue(wsValue); } return true; } CXFA_Node* CXFA_DocumentTextNode::ResolveStaticValue(CFX_WideTextBuf* pDynamic) { if (pNode()->GetText().IsEmpty()) { ASSERT(pDynamic->GetSize() == 0); return nullptr; } if (pDynamic->GetSize() == 0) return nullptr; CXFA_Node* pDynamicValue = pDynamic->GetBuffer(WideString(), pDynamic->GetSize()); WideString wsValue = pDynamicValue->GetValue(); pDynamicValue->SetValue(wsValue); return pDynamicValue; } CFX_WideString CXFA_DocumentTextNode::GetValue(XFA_Attribute iSort) { CXFA_Node* pPattern = nullptr; CXFA_Node* pDynamicValue = nullptr; CFX_WideString wsText; for (CXFA_Node* pNode = GetFirstChild(); pNode; pNode = pNode->GetNextSibling()) { if (pNode->GetElementType() != XFA_Element::Validation) continue; CXFA_Node* pNodeChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (pNodeChild) pPattern = pNodeChild->GetNodeItem(XFA_NODEITEM_Parent); else if (iSort != XFA_Attribute::None) pPattern = pNode->GetNodeItem(XFA_NODEITEM_Parent); else continue; if (pNodeChild) { CXFA_Node* pChildValue = pNodeChild->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildValue && pChildValue->GetElementType() == XFA_Element::Validation) { if (!pDynamicValue->GetBuffer(WideString(), pDynamicValue->GetSize())) continue; WideString wsValue; pDynamicValue->GetAt(0, wsValue); pChildValue->SetValue(wsValue); } } } if (pPattern) return pPattern->GetValue(); if (pDynamicValue) return pDynamicValue->GetValue(); return wsText; } CFX_WideString CXFA_DocumentTextNode::GetValue(XFA_Attribute iSort) { CXFA_ ==================================================================================================== // 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 ASH_WM_WORKSPACE_H_ #define ASH_WM_WORKSPACE_H_ #include #include "ash/ash_export.h" #include "ash/wm/window_types.h" #include "ash/wm/window_tree.h" #include "ash/wm/window_observer.h" #include "ash/wm/window_state_observer.h" #include "ash/wm/window_observer_observer.h" #include "ash/wm/window_tree_observer.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/compositor/layer_client_host.h" #include "ui/gfx/geometry/rect_f.h" namespace aura { class Window; } // namespace aura namespace gfx { class Rect; } // namespace gfx namespace aura { class WindowTreeHost; } // namespace aura namespace display { class Display; } // namespace display namespace ui { class AcceleratorController; class LayerTreeHost; } // namespace ui namespace views { class Widget; } // namespace views namespace ash { // The Waiter for switching workspace on any window in the session. class ASH_EXPORT Waiter : public aura::WindowObserver, public wm::WindowObserver, public aura::WindowTreeObserver { public: Waiter(); Waiter(const Waiter& other); Waiter(const aura::WindowTreeHost* window_tree_host, aura::Window* window); Waiter(aura::WindowTreeHost* window_tree_host, aura::Window* window); ~Waiter() override; void OnFirstScreenDestroyed(); void add_for_local_screen(aura::Window* local_window); // Called after first the window has been activated and the windows' stacking // order has changed. This will begin iterating over the stacking order, then // begin deleting any nested windows. void ActivateWindow(); // Starts an idle task that drives the window tree. void StartWindowTree(); // Switches the windows' stacked state. void SwitchWindowState(); // Switches the windows' |window_| from |to_refresh| state. void SwitchToRefresh(aura::Window* window, bool to_refresh); // Updates the size of the window's bounds. void UpdateBounds(); // Sets the visibility for the window. void SetWindowVisibility(aura::Window* window, bool visible); // Sets the window window type for windows created by this object. void SetWindowTypeForWindow(aura::Window* window, aura::WindowType window_type); // Sets the window's bounds for the window. void SetWindowBounds(aura::Window* window, gfx::Rect window_bounds); // Toggles the window's background activity. void ToggleBackgroundActivity(); // Sets the visibility for the window. void SetWindowVisibility(aura::Window* window, bool visible, bool has_transparent_background, bool has_glow_background); // Returns the visibility for the window, i.e. whether a top level window is // visible or not. Returns false if the window has no visibility set. bool GetWindowVisibility(aura::Window* window); // Handles window activation for some windows. void ActivateWindowForProcess(aura::Window* window, bool activated); // Handles window activation for a specific display. void ActivateWindowForDisplay(aura::Window* window, bool activated); // Handles window activation for a specific layer. void ActivateWindowForLayer(aura::Window* window, bool activated, const gfx::Rect& damage_area, const gfx::Rect& parent_clip); // Handles window activation for ==================================================================================================== /* Module for low-level data compression functions */ #include "Python.h" #include "py/obj.h" #include "py/runtime.h" #include "py/dict.h" #include "py/mperrno.h" #include "lib/unaligned.h" #include "lib/lzip.h" #include "lib/error_table.h" #if MICROPY_MODULE_USE_FASTLZ # include "module_fastlz.h" #else # error "No FastLZ support enabled" #endif #if MICROPY_MODULE_PY_LZIO static char lzio_buffer[1024]; /* FastLZIOError (lib/lzio.c) */ static int lzio_error_handler(void *handle, const char *msg) { mp_err(NULL, MP_ERR_MALFORMED, "Bad message: %s", msg); return 0; } static long lzio_read_handler(void *handle, void *buf, size_t len) { return mp_lzip_read_slow(handle, buf, len); } static int lzio_seek_handler(void *handle, long offset, int whence) { return mp_lzip_seek_slow(handle, offset, whence); } #define BUFFER_LEN 8192 /* FastLZIO (lib/lzio.c) */ static int lzio_method(void *data, const char *filename, const char *args, int n) { MPLZState *mplz = MP_LZSTATE(data); struct lz_dict *m = mplz->dict; long offset = mp_lzip_offset_slow(data, filename, args); if (mp_lzip_is_failed(handle)) { /* This method has returned 0, with the error being handled. */ mp_err(NULL, MP_ERR_UNSUPPORTED, "unsupported method: %s: %s", filename, args); return 1; } /* Ensure that an unsupported method can't cause the stream to stop or * return some error. Because many functions in this module call this * method because lzio can be used without input, and because it isn't * guaranteed that return values of methods should be possible. The worst * scenario is when you call MP_WRITE, which doesn't do anything, but just * return 0, and calling MP_READ_EOF should be a good spot (because that's * how the most other module calls the object we use). See t6039 for the * more gross reasons. */ if (n == MP_READ_EOF) { mp_err(NULL, MP_ERR_UNSUPPORTED, "no supported method"); return 0; } else if (n == MP_READ_ERROR) { mp_err(NULL, MP_ERR_UNSUPPORTED, "unsupported method: %s: %s", filename, args); return 1; } if (mp_lzip_set_dict(m, MP_LZ_DICT_USE_DEFAULT_CACHE_SIZE, 1) != MP_OKAY) { mp_err(NULL, MP_ERR_UNSUPPORTED, "cannot set dictionary"); return 1; } /* This method may fail if there isn't enough memory to be able to * load all data into. This should be rare, as it could allow us to * compress and decode when needed, but it's going to be useful * anyway. Yuck. */ if (lzio_alloc_input_buffer(mplz, BUFFER_LEN) == NULL) return 1; if (mp_lzip_load_buffer(mplz, offset, buf) != MP_OKAY) { mp_err(NULL, MP_ERR_UNSUPPORTED, "cannot load buffer"); return 1; } mp_err(NULL, MP_ERR_UNSUPPORTED, "unsupported method: %s: %s", filename, args); return 1; } /* FastLZIO (lib/lzio.c) */ static int lzio_initialize(void *data) { MPLZState *mplz = MP_LZSTATE(data); mp_err(NULL, MP_ ==================================================================================================== // SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2016 - 2018 Xilinx, Inc. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DECLARE_GLOBAL_DATA_PTR; /* DDR offset in SDRAM config space (0xFFFB8000, 0xFFFB8000) */ #define DDR_OFFSET 0xFFF8 /* DDR offset in SDRAM config space (0xFFD00000, 0xFFD00000) */ #define DDR_OFFS 0xFFD00000 /* DDR length in blocks of 32 bytes */ #define DDR_MAX_LEN 32 /* Use DDR2 PLL configured by a DDR controller */ #define CONFIG_DDR_CLKIN 0 #define CONFIG_DDR_CLKOUT 1 #define CONFIG_DDR_AHB_CLKIN 3 #define CONFIG_DDR_AHB_CLKOUT 4 #define CONFIG_DDR_FORCE_CLKIN 5 #define CONFIG_DDR_FORCE_CLKOUT 6 /* Number of reg blocks that should be accessed by common */ #define CONFIG_DDR_NUM_OF_REGS 3 #define CONFIG_DM_GPIO_PULLUP_EN IMX8_GPIO_PIN(8) #define CONFIG_GPIO_PIN_STATUS IMX8_GPIO_PIN(12) #define CONFIG_GPIO_PIN_1 IMX8_GPIO_PIN(16) #define CONFIG_GPIO_PIN_2 IMX8_GPIO_PIN(18) /* * Define BOOTSTAGE_PM_RUN_ON_SLEEP * If you want to run the boot stage on a system suspend and * run the test firmware on a sleep, then define * CONFIG_BOOTSTAGE_PM_SYSTEM_SLEEP */ #define CONFIG_BOOTSTAGE_PM_RUN_ON_SLEEP 0 #define CONFIG_BOOTSTAGE_PM_SLEEP 1 #define CONFIG_BOOTSTAGE_PM_SYSTEM_STANDBY 2 static int check_transition(int wait, int sec) { int ret = 0; if (wait) ret = sec; else ret = sec * 2; return ret; } #define CONFIG_MFLAGS 0x14 #define CONFIG_SYS_M512KHZ 1 #define CONFIG_SYS_M3M512KHZ 1 #define CONFIG_SYS_MMDC_M3M3 #define CONFIG_SYS_DDR_OCD2_BNDS 1 #define CONFIG_SYS_DDR_OCD2_CTRL 0x00000000 #define CONFIG_HAS_ETH0 #define CONFIG_HAS_ETH1 #define CONFIG_HAS_ETH2 #define CONFIG_HAS_ETH3 #define CONFIG_HAS_ETH4 #define CONFIG_HAS_ETH5 #define CONFIG_HAS_ETH6 #define CONFIG_HAS_ETH7 #ifdef CONFIG_HAS_ETH1 #define CONFIG_ETH_PNP 1 #else #define CONFIG_ETH_PNP 0 #endif #ifdef CONFIG_HAS_ETH2 #define CONFIG_ETH_PNP 2 #else #define CONFIG_ETH_PNP 0 #endif #ifdef CONFIG_HAS_ETH3 #define CONFIG_ETH_PNP 3 #else #define CONFIG_ETH_PNP 0 #endif #ifdef CONFIG_HAS ==================================================================================================== // Copyright (c) Lawrence Livermore National Security, LLC and other VisIt // Project developers. See the top-level LICENSE file for dates and other // details. No copyright assignment is required to contribute to VisIt. #ifndef VISIT_LINEARFIELD_H #define VISIT_LINEARFIELD_H #include #include // **************************************************************************** // Class: LinearField // // Purpose: // Holds a linear field from the database // // Notes: Autogenerated by xml2atts. // // Programmer: xml2atts // Creation: omitted // // Modifications: // // **************************************************************************** class DBATTS_API LinearField : public DatabaseAttribute { public: // These constructors are for objects of this class LinearField(); LinearField(const LinearField &obj); protected: // These constructors are for objects derived from this class LinearField(private_tmfs_t tmfs); LinearField(const LinearField &); public: virtual ~LinearField(); virtual LinearField *Duplicate() const; virtual LinearField *NewInstance(const std::string &baseTypeName); virtual LinearField *NewInstance(double x, double y, double z, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4); virtual LinearField *NewInstance(const std::string &baseTypeName, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5); virtual LinearField *NewInstance(const std::string &baseTypeName, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5, double x6, double y6, double z6); virtual LinearField *NewInstance(const std::string &baseTypeName, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5, double x6, double y6, double z6, double x7, double y7, double z7); virtual LinearField *NewInstance(double x, double y, double z, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5, double x6, double y6, double z6, double x7, double y7, double z7); virtual LinearField *NewInstance(const std::string &baseTypeName, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5, double x6, double y6, double z6, double x7, double y7, double z7, double x8, double y8, double z8); virtual LinearField *NewInstance(const std::string &baseTypeName, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, double x5, double y5, double z5, double x6, double y6, double z6, double x7, double y7, double z7 ==================================================================================================== /* * 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: * 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. */ #include "config.h" #include "Structure.h" #include namespace JSC { #if USE(JSVALUE64) #if CPU(X86_64) #define USE(type) type #elif CPU(X86) || CPU(X86_32) || CPU(ARM64) #define USE(type) type##Size #else #define USE(type) size_t #endif #elif CPU(ARM) #define USE(type) type #else #error "Structure should have been built with HAVE_STRUCT_VARIADIC_MACROS as it does not define USE(size_t)." #endif namespace StructureSizeInBytesConstraintCheck { #if USE(JSVALUE64) ALWAYS_INLINE void checkStructureSizeInBytes(Structure* structure, size_t requiredSize) { if (requiredSize >= sizeof(JSValue)) { JS_EXPORT_PRIVATE JSValue size = JSValue::encode(requiredSize); structure->addProperty(size); return; } size_t totalSize = requiredSize + sizeof(JSValue); size_t start = totalSize / sizeof(JSValue); size_t end = totalSize % sizeof(JSValue); while (start < end) { JS_EXPORT_PRIVATE JSValue size = JSValue::encode(start); start += sizeof(JSValue); structure->addProperty(size); } } #endif #if USE(JSVALUE64) ALWAYS_INLINE void checkStructureSizeInBytes(Structure* structure, size_t requiredSize, size_t& totalSize) { if (requiredSize >= sizeof(JSValue)) { totalSize = requiredSize; return; } size_t totalSize = requiredSize + sizeof(JSValue); size_t start = totalSize / sizeof(JSValue); size_t end = totalSize % sizeof(JSValue); while (start < end) { totalSize = totalSize + sizeof(JSValue); start += sizeof(JSValue); } } #endif } // namespace StructureSizeInBytesConstraintCheck } // namespace JSC ==================================================================================================== /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018-2019 Intel Corporation */ #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 "power_params_t.h" #include "power_q_api.h" #include "power_local.h" /* Generic hardware/driver dependent generic structures */ #include "power_q.h" #include "power_internals.h" #include "power_debug.h" #include "power_display.h" #include "power_gen.h" #include "power_generic.h" #ifdef RTE_LIBRTE_POWER_MSR #include "power_msr.h" #endif #define DRIVER_NAME "RTE Power Utilization" #define DRIVER_DESCRIPTION "Uses the generic implementation of the driver." #define INTR_FILE "/proc/interrupts" /* A power state is composed of a sequence of frames * from which we can be fed into the future, etc.. */ struct power_state { /* current power state of a particular lcore */ struct power_q_info *qinfo; /* we're in "start" state */ uint64_t total_events_done; /* number of current events done */ uint64_t total_events_suspend; /* Number of events suspended on the last call */ uint64_t nevents_suspend; /* Number of events soft suspended */ uint64_t nevents_soft_suspend; /* Last power event processed */ power_event_t event_last; /* Physical device node name of the device */ const char *name; }; /* Global list of power instances */ static LIST_HEAD(power_instances); /* Flag to store statistics */ static volatile uint64_t power_stats_active; static volatile uint64_t power_stats_tally_active; static volatile uint64_t power_stats_call_waiting; static volatile uint64_t power_stats_slow_path_to_higher_power_gating; /* Sub-commands */ enum { POWER_CMD_RESUME, POWER_CMD_RESUME_CANCEL, POWER_CMD_CHANGE_EVENT, POWER_CMD_RUN, POWER_CMD_STOP, POWER_CMD_STOP_WAIT_FOR_FINISH, }; /* Information about a power event */ struct power_event { /* Previous power state of this event */ power_event_t prev; /* Next power state of this event */ power_event_t next; /* Last power ==================================================================================================== /* BEGIN_DECLARATION_GUARD */ /* END_DECLARATION_GUARD */ ==================================================================================================== // Copyright (c) 2011 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_VIEWS_UI_PARTS_HANDLE_PICKER_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_UI_PARTS_HANDLE_PICKER_VIEW_H_ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/view.h" #include "chrome/browser/ui/views/view_observer.h" #include "content/public/browser/web_ui_message_handler.h" namespace views { class ScrollView; } namespace content { class WebContents; } // Handles the background copy of the visible views to the different buttons. class HandlePicKERView : public views::View, public content::WebContentsObserver { public: HandlePicKERView(content::WebContents* web_contents, View* focused_view, const gfx::Rect& selection_bounds); ~HandlePicKERView() override; // views::View implementation: bool HandleKeyEvent(ui::KeyEvent* event) override; void Destroy() override; private: views::View* focused_view_; const gfx::Rect selection_bounds_; base::WeakPtrFactory weak_ptr_factory_{this}; DISALLOW_COPY_AND_ASSIGN(HandlePicKERView); }; #endif // CHROME_BROWSER_UI_VIEWS_UI_PARTS_HANDLE_PICKER_VIEW_H_ ==================================================================================================== /* GStreamer * Copyright (C) <1999> Erik Walthinsen * Copyright (C) <2003> David A. Schleef * Copyright (C) <2006> Tim-Philipp Müller * * 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., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * This is based on the LiMux code for uridecode. * Copyright (c) 2002 * Copyright (c) 2002-2006 Jan Schmidt * Copyright (c) 2004 Edgar E. Iglesias * Copyright (c) 2004 Sean C. Dinge */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gstlin.h" #include "gstnovautils.h" #define DEBUG_GST 0 #include "gst-debug-utils.h" static void gst_nova_video_filter_bump_line (guint8 *pixels, int len); static void gst_nova_video_filter_bump_row (guint8 *pixels, int len); static void gst_nova_video_filter_bump_prevline (guint8 *pixels, int len); static void gst_nova_video_filter_bump_prevrow (guint8 *pixels, int len); static inline int scale_next_bits (int color, int shift) { return (color << shift) | (color >> (8 - shift)); } /* RGB color shifts */ /* bitmasks for filter color shifts */ static const int intra_matrix[] = { 0x00000000, 0x00000080, 0x00008000, 0x00c000c0, 0x00e000e0, 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0x00c00000, 0x02000000, 0x04000000, 0x08000000, 0x0c000000, 0x0e000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0xc0000000, 0x00000000, 0 ==================================================================================================== /* This file is part of the KDE project Copyright (C) 2008 David Faure 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 "KoChartShape.h" #include "KoChartShapeContainer.h" KoChartShape::KoChartShape(KoChartShapeContainer *container, const QPointF &start, const QPointF &end) : KoChartShape(container, start, end) { m_firstCall = false; } KoChartShape::KoChartShape(KoChartShapeContainer *container, const KoChartShape &other) : KoChartShape(container, other) { m_firstCall = false; } KoChartShape::~KoChartShape() { if (m_firstCall) unCall(); } bool KoChartShape::useChartTimeLineFormat() { return m_chartShape->useChartTimeLineFormat(); } void KoChartShape::setUseChartTimeLineFormat(bool use) { if (m_chartShape->useChartTimeLineFormat() != use) { m_chartShape->setUseChartTimeLineFormat(use); } } KoChartShapeContainer *KoChartShape::previousShape() const { return m_previousShape; } KoChartShape *KoChartShape::nextShape() const { return m_nextShape; } void KoChartShape::deletePrevious() { if (m_previousShape) { m_previousShape->deleteNext(); if (m_previousShape->currentSubShape() != 0) { m_previousShape = 0; } } } void KoChartShape::deleteNext() { if (m_nextShape) { m_nextShape->deletePrevious(); if (m_nextShape->currentSubShape() != 0) { m_nextShape = 0; } } } void KoChartShape::createNew() { Q_ASSERT(!m_firstCall); KoChartShape *shape = new KoChartShape(this, m_start, m_end); m_firstCall = true; shape->setUseChartTimeLineFormat(m_chartShape->useChartTimeLineFormat()); m_previousShape = shape; m_nextShape = shape; } void KoChartShape::deleteCurrentSubShape(KoChartShape *subShape) { Q_ASSERT(!m_firstCall); if (subShape) { subShape->deletePrevious(); } } ==================================================================================================== #include /* * Thanks to Christ Kall & Roy Jens * Apollo Worse! * Jan Bunde for the basic JSON stuff ;) */ /* * Copyright (C) 2002-2005 TABATA Yusuke * 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. */ /* * Code added by the YAZ toolkit (Federal Information System). */ #include #include #include #ifdef WIN32 #include #endif #include #include #include #include #include #include static void tst1_json(void) { xmlNode *node = NULL; xmlNode *root = NULL; xmlNode *term = NULL; xmlNode *r; xmlNode *result = NULL; int all_error = 0; YAZ_CHECK(tst1_extract_json_data("myString", &result)); YAZ_CHECK(yaz_oid_data_cmp("myString", yaz_oid_recsyn_oid_str(1, 2, 6, "OID", 0))); YAZ_CHECK(yaz_oid_data_cmp("myString", yaz_oid_recsyn_oid_str(1, 1, 1, "String", 0))); YAZ_CHECK(yaz_oid_data_cmp("myString", yaz_oid_recsyn_oid_str(1, 2, 1, "GTE", 0))); YAZ_CHECK(yaz_oid_data_cmp("myString", yaz_oid_recsyn_oid_str(1, 1, 0, "B", 0))); root = xmlDocGetNode(result->doc, "memo", 0); YAZ_CHECK(root); term = xmlDocGetNode(result->doc, "cat1", 0); YAZ_CHECK(term); term = xmlDocGetNode(result->doc, "cat1", 1); YAZ_CHECK(term); node = doc_parse_xml_no_args(result->doc, doc, 0); YAZ_CHECK(node); r = xmlDocGetNode(term, "node", 1); YAZ_CHECK(r); while (!all_error && r != root) { xmlNode *row_node = r->children; xmlNode *row_name = r->name; xmlNode *row_data = r->children; r = r->next; if (!all_error) { r = row_node; all_error = 1; } while (!all_error && r != row_node) { xmlNode *row_name_node = r->name; xmlNode *row_data_node = r->children; r = r->next; if (!all_error) { r = row_name_node; all_error = 1; } while (!all_error && r != row_name_node) { xmlNode *row_data_node = r->children; YAZ_CHECK(r); /* compare values */ r = row_data_node; YAZ_CHECK(r); if (!all_error) { const char *string = r->content; const char *exp = r-> ==================================================================================================== /* * Copyright (C) 2018 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(WEBGL) #include "ClientGLObject.h" #include #include namespace WebCore { class Context; namespace WebGLExtensionID { struct Ext { GLint internalformat; GLint width; GLint height; GLint depth; GLint border; }; } struct WebGLCaps { WebGLBackendProfile majorProfile, minorProfile, profile, device, isWebGL2; WebGLRenderingContextBase baseContext; Vector caps; uint32_t numCaps; bool hasDriverUnpack = false; }; } #endif ==================================================================================================== /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2019 MediaTek Inc. * Author: Bingo Zhang */ #ifndef __LINUX_TEGRA_PINCTRL_PIN_H__ #define __LINUX_TEGRA_PINCTRL_PIN_H__ /* Registers */ #define PIN_P0_EINT_CLR 0x000 #define PIN_P0_EINT_SET 0x004 #define PIN_P0_CFG 0x010 #define PIN_P0_DIR 0x014 #define PIN_P0_IOCTRL 0x018 #define PIN_P0_DATA 0x01c #define PIN_P0_PAD_CTL 0x020 #define PIN_P0_PIN 0x024 #define PIN_P0_CLKREQ_EN 0x028 #define PIN_P0_CLKREQ_DIS 0x02c #define PIN_P0_PAD_RES 0x030 #define PIN_P0_UART_TX 0x034 #define PIN_P0_UART_RX 0x038 #define PIN_P0_UART_CTS 0x03c #define PIN_P0_UART_DSR 0x040 #define PIN_P0_UART_RI 0x044 #define PIN_P0_UART_DSR_MUX (PIN_P0_UART_DSR | PIN_P0_UART_RX | \ PIN_P0_UART_CTS) #define PIN_P0_UART_RI_MUX (PIN_P0_UART_RI | PIN_P0_UART_DSR_MUX) #define PIN_P0_UART_RMSR 0x04c #define PIN_P0_UART_MII 0x050 #define PIN_P0_UART_SRX 0x054 #define PIN_P0_UART_STX 0x058 #define PIN_P0_UART_USART0 0x05c #define PIN_P0_UART_USART1 0x060 #define PIN_P0_UART_GPIO 0x064 #define PIN_P0_UART_SDAT 0x068 #define PIN_P0_UART_TX_CLK 0x06c #define PIN_P0_UART_RX_CLK 0x070 #define PIN_P0_UART_SRXD 0x074 #define PIN_P0_UART_STXD 0x078 #define PIN_P0_UART_RS 0x07c #define PIN_P0_UART_SDARX 0x080 #define PIN_P0_UART_SDARX_MUX (PIN_P0_UART_SDARX | PIN_P0_UART_RS | \ PIN_P0_UART_SDAT) #define PIN_P0_UART_SIM 0x084 #define PIN_P0_UART_SDPARX 0x088 #define PIN_P0_UART_SDPARX_MUX (PIN_P0_UART_SDPARX | PIN_P0_UART_SIM | \ PIN_P0_UART_SDAT) #define PIN_P0_UART_IR 0x08c #define PIN_P0_UART_CD 0x090 #define PIN_P0_UART_DV 0x094 #define PIN_P0_UART_DREQ0 0x098 #define PIN_P0_UART_DREQ1 0x09c #define PIN_P0_UART_X2F 0x0a0 #define PIN_P0_UART_RX_CLK 0x0a4 #define PIN_P0_UART_TXD0 0x0a8 #define PIN_P0_UART_RXD0 0x0ac #define PIN_P0_UART_BREQ0 0x0b0 #define PIN_P0_UART_TX_EN 0x0b4 #define PIN_P0_UART_RX_EN 0x0b8 #define PIN_P0_UART_DTR0 0x0bc #define PIN_P0_UART_RTS0 0x0c0 #define PIN_P0 ==================================================================================================== /* * Stellarium: Made here so you can adjust where you want to run * them in your home page when working * * Copyright (C) 2007 Fabien Chereau * Copyright (C) 2012 Albert Astals Cid * * 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. */ #ifndef MINIGAMES_HPP #define MINIGAMES_HPP #include "StelObject.hpp" #include "StelUtils.hpp" class StarObjectStar : public StelObject { public: //! Default constructor StarObjectStar(); //! Copy constructor StarObjectStar(const StarObjectStar& other); //! Operator = StarObjectStar& operator=(const StarObjectStar& other); //! @return the specified reference position Vec3f getAltAzPos() const; //! @return the specified reference frame float getAltAzSize() const; //! @return the specified bounding frame Vec3f getAltAzRad() const; //! Compute the location of the bounding frame and return it as a vector Vec3f getExtent() const; //! Get the result of the bounding frame in the given pixel location //! @param pos pixel coordinates Vec3f getBoundingBox(float pos[3]) const; //! Set the value of the bounding frame in the given pixel location //! @param pos pixel coordinates //! @param size size of the pixel void setBoundingBox(float pos[3], float size); //! Set the object center for the object //! @param pos object center //! @param size size of the object void setObjectCenter(const Vec3f& pos, float size); //! Update the bounding frame to contain the given points. The object position is //! already defined void updateBoundingBox(QVector &pt); //! Get the current values of the bounding frame //! @param pt The result is stored as a QVector //! @param vCount The number of values to retrieve //! @param vOffset The offset vector for accessing the result //! @param sortOrder the sort order used //! @param sortValues sorting values used for this object //! @param sortAtt values used for the current object //! @param sortRelations sorted relations //! @param stop when the method has stopped //! @param useEphemeris if the object is ephemeris, the cursor points are not used //! @param cacheMemoryOnly if the object is using a more general memory allocator, the //! result would be much more complicated in the future //! @return true if the result contains the results or false otherwise bool getBoundingBoxIndices(QVector &pt, int vCount, Vec3f& vOffset, int sortOrder, double sortValues, int sortAtt, int sortRelations, bool stop, bool useEphemeris, bool cacheMemoryOnly); //! Get the current values of the object positions //! @param pt The result is stored as a QVector //! @param vCount The number of values to retrieve //! @param vOffset The offset vector for accessing the result //! @param sortOrder the sort order used //! @param sortValues sorting values used for this object //! @param sortAtt values used for the current object //! @param sortRelations sorted relations //! @param stop when the method has stopped //! @param useEphemeris if the object is ephemeris, the cursor points are not used //! @param cacheMemoryOnly if the object is using a more general memory allocator, the //! result would be much more complicated in the future //! @return true if the result contains the results or false otherwise bool getObjectPositions(QVector #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * BIST is used for PCIe host controller and host controller's power * management interface. When the platform supports BIST, devices are * physically connected to a PCI host controller in both cases. * To keep things simple, PCIe controller is a continuous mode. */ #define BIST_DRIVER_NAME "pci_fw" /* * Identifiers used to differentiate adapter and device commands * via the system. */ enum pci_command_type { PCICMD_BUS_RESET, PCICMD_HOST_RESET, PCICMD_VENDOR_RESET, PCICMD_CAPABILITY_RESET, PCICMD_POWER_DOWN, PCICMD_POWER_CYCLE, PCICMD_ACPI_OPER_STATUS, PCICMD_ACPI_RESET, }; /* Return values for the pci command messages */ #define PCI_CMD_NONE 0x00 #define PCI_CMD_INVALID 0x01 #define PCI_CMD_INVARG 0x02 /* * Platform specific additional PCI data structures */ struct pci_data { /* Firmware address */ u64 fw_addr; /* Status - BIOS Version register */ u32 fw_ver; /* Firmware revision */ u16 fw_rev; /* Base I/O addresses */ u64 regs[NUM_BARS]; /* If this is a hotplug power-cycle controller, PCI device is * assigned a common BAR address which will be used as the * secondary bus for this device. */ u32 io_bar_address; /* Secondary bus where this device is bound */ int secondary_bus; /* Secondary bus address */ u64 secondary_bus_address; /* OEM data - might be used by another device */ struct acpi_table_header header; /* BIOS UUID - address of driver specific OS serial number */ u64 efi_uuid; /* Primary bus - unique ID for this device */ u32 primary_bus; /* An optional boot table */ struct boot_device_entry boot_table[BOOT_TABLE_SIZE]; /* Additional capabilities (see pci_cmd_capabilities below) */ struct acpi_table_header caps; /* Vendor specific firmware/vendor specific feature */ struct acpi_table_header fw_caps[ACPI_SYSTEM_CAPABILITIES]; /* Special-purpose interrupt-like interrupt-like region */ struct acpi_region_header intr_region[3]; /* The FW register set - BIOS - Firmware */ const struct acpi_set_pointer *fw_register; /* Firmware CPU power in/out handler */ void (*fn)(struct pci_data *d, int operation, u64 control, u64 *result); }; /* * PCIe Host controller private data */ struct pci_controller_data { /* Current device */ struct pci_device *pdev; /* State - PCI host controller state */ enum pci_state state; /* IRQ */ irqreturn_t (*irq_handler)(struct pci_controller_data *data); /* VME */ int irq; /* DMA */ int dma; /* Interrupt service routine */ irqreturn_t (* ==================================================================================================== /* * NXP Wireless LAN device driver: station * * Copyright 2011-2020 NXP * * This software file (the "File") is distributed by NXP * under the terms of the GNU General Public License Version 2, June 1991 * (the "License"). You may use, redistribute and/or modify this File in * accordance with the terms and conditions of the License, a copy of which * is available by writing to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. * * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE * ARE EXPRESSLY DISCLAIMED. The License provides additional details about * this warranty disclaimer. */ #include "main.h" #include "intf.h" #include "mac.h" #include "wmm.h" #include "11n.h" struct rtl8225_register_ctrl_mode { u8 multiple_of_two_power; u8 multiple_of_three_power; }; static void rtl8225_set_non_page_limit(u8 mode) { switch (mode) { case 0x10: case 0x11: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x1f); break; case 0x12: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0f); break; case 0x13: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x00); break; case 0x14: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x10); break; case 0x15: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x01); break; case 0x16: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0e); break; case 0x17: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0d); break; case 0x18: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0c); break; case 0x19: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0b); break; case 0x1a: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x0a); break; case 0x1b: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x09); break; case 0x1c: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x08); break; case 0x1d: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x07); break; case 0x1e: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x06); break; case 0x1f: rtl8225_write_phy_reg(PHY_WMM, 0x3c4, 0x05); break; } } static void rtl8225_enable_tx_power_tracking(u8 mode) { struct rtl8225_register_ctrl_mode mode1; rtl8225_write_phy_reg(PHY_BT_RF_CTRL, 0x0f3e, mode); if (mode == ==================================================================================================== #include "jpeg_buffer.h" #include "tjutils.h" #include "tjassert.h" #include "tjstring.h" #include "tjgeneric.h" #define JPEG_BUFFER_DEFAULT_BUFFER_SIZE 1024 // This seems to be a no-break right now. static int internalBuffering = 0; static const char* getFormatName(int format) { switch(format) { case TJ_RGB: return "RGB"; case TJ_BGR: return "BGR"; case TJ_RGBA: return "RGBA"; case TJ_GRAY: return "GRAY"; default: return "Unknown format"; } } void JpegBuffer::assign(const unsigned char* buffer, int size) { int i; assert(size > 0); // put a terminating zero at the end jsize = size; jmem = NULL; // allocate a buffer big enough for the entire image if(jasmem==NULL) { jasmem = (unsigned char *) calloc(JPEG_BUFFER_DEFAULT_BUFFER_SIZE, 1); assert(jasmem!=NULL); if(jasmem == NULL) { throw tjException(TJERR_OUT_OF_MEMORY, "Out of memory"); } // now save the buffer and zero out the memory used for the decompressor jasmem = (unsigned char *) calloc(size, 1); if(jasmem == NULL) { throw tjException(TJERR_OUT_OF_MEMORY, "Out of memory"); } } jsize = size; jmem = jasmem; // read from the beginning of the file char header[JAS_HEADER_LENGTH]; unsigned char readBuffer[JPEG_BUFFER_DEFAULT_BUFFER_SIZE]; int readBufferSize = 0; if(jas_read_header2(fhandle, header, &readBufferSize) != JAS_OK) { throw tjException(TJERR_FILE_READ, "Error reading image file"); } if(jas_read_image_from_file2(fhandle, fhandle, jasmem, &readBufferSize) != JAS_OK) { throw tjException(TJERR_FILE_READ, "Error reading image file"); } // read the image data from the first image line for(i=0; ixmlnsResolver().isEmpty()) item.asNodeMap()->setNamespace(context->namePool()->allocateNamespace(item.modelNode(), item.name().toString())); /* While we have an owning NamespaceCache, we need to ensure that it is valid. */ if(!item.asNodeMap()->namespaceResolver()) item.asNodeMap()->setNamespace(context->namePool()->allocateNamespace(item.modelNode(), item.name().toString())); return item; } Expression::Ptr Parser::parse(const Expression::Ptr &operand, const ReportContext::Ptr &context, const SourceLocationReflection *const reflection) { const int operandContextPosition(operand->indexOf(m_origin)); const int parentContextPosition(operand->lastIndexOf(m_origin)); Q_ASSERT(operandContextPosition >= 0 && parentContextPosition >= 0); Q_ASSERT(parentContextPosition >= 0 && parentContextPosition < operand->size() - 2); const DynamicContext::Ptr &sharedContext = context->context(); const Item::Ptr item(m_operands.constData() + parentContextPosition); Q_ASSERT(operandContextPosition + 1 < operand->size()); Q_ASSERT(parentContextPosition + 1 < operand->size()); Q_ASSERT(operand->context(parentContextPosition) == context); Q_ASSERT(operand->is(parentContextPosition) || parentContextPosition == -1); Q_ASSERT( ==================================================================================================== /* $Id: object_ids.hpp 591811 2015-05-06 17:54:13Z camacho $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * */ /// @file object_ids.hpp /// User-defined methods of the data storage class. /// /// This file was originally generated by application DATATOOL /// using the following specifications: /// 'ncgen.asn'. /// /// New methods or data members can be added to it if needed. /// See also: OBJECT_ID.hpp #ifndef OBJECT_IDS_HPP #define OBJECT_IDS_HPP // generated includes #include #include BEGIN_NCBI_SCOPE BEGIN_objects_SCOPE // namespace ncbi::objects:: ///////////////////////////////////////////////////////////////////////////// class NCBI_ID_EXPORT CObject_ID : public CObject { typedef CObject CParent; public: /// constructor CObject_ID(void); /// destructor ~CObject_ID(void); /// check if this id is identical bool IsIdent(const CObject_id& other) const; /// add a new record to the id void SetRecord(int type, int size, const string& name, const string& desc, const string& data); /// add a new record to the id void SetRecord(int type, const CObject_id& id); /// convert an existing record void UnsetRecord(int type); /// convert an existing record void UnsetRecord(const CObject_id& id); /// change a record to a new type bool SetRecordType(int type, int size, const string& name, const string& desc, const string& data); /// change a record to a new type bool SetRecordType(int type, const CObject_id& id); /// new class implementation virtual string GetStr(void) const override; virtual void TrimRight(const CEndingString& padding, string* trimmed, string* trimmed_extra) const override; virtual string ID2Str(void) const override; virtual void Format (IFormatter& formatter, const CObject_id& id, ESerialDataFormat format = fSerial_FastFormat) const override; virtual CObject_id Read (CNcbiIstream& in, TObjectPtr object, TTypeInfo type = eNoTypeInfo) const override; virtual bool Write(CNcbiOstream& out, const CObject_id& id, TConstObjectPtr object, TTypeInfo type = eNoTypeInfo) const override; virtual void Copy(const CObject_id& other) override; virtual bool Less(const CObject_id& id1, const CObject_id& id2) const override; virtual bool IsSameType(const CObject_id& id) const override; private: /// Which record type this object contains int m_RecordType; }; ///////////////////////////////////////////////////////////////////////////// /// /// CObject_id /// /// A class for storing user-defined ids in objects. /// /// Only the user-defined ids are stored, they can be compared using the /// same id object (see IsIdent()). /// class NCBI_ID_EXPORT CObject_id : public CObject { ==================================================================================================== /* * 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: * 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. */ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_GRAPHICS_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_GRAPHICS_H_ #include #include "third_party/blink/renderer/modules/xr/xr_common.h" #include "third_party/blink/renderer/modules/xr/xr_input_device.h" #include "third_party/blink/renderer/modules/xr/xr_security_resource.h" #include "third_party/blink/renderer/modules/xr/xr_ref_counted.h" #include "third_party/blink/renderer/modules/xr/xr_input_device_client.h" #include "third_party/blink/renderer/modules/xr/xr_display_client.h" #include "third_party/blink/renderer/modules/xr/xr_picture.h" #include "third_party/blink/renderer/modules/xr/xr_color_space.h" #include "third_party/blink/renderer/modules/xr/xr_output.h" #include "third_party/blink/renderer/modules/xr/xr_metadata.h" #include "third_party/blink/renderer/modules/xr/xr_mathml.h" #include "third_party/blink/renderer/modules/xr/xr_transform.h" #include "third_party/blink/renderer/modules/xr/xr_triple.h" #include "third_party/blink/renderer/modules/xr/xr_system_node.h" #include "third_party/blink/renderer/modules/xr/xr_pointer.h" #include "third_party/blink/renderer/modules/xr/xr_touch_lock.h" #include "third_party/blink/renderer/modules/xr/xr_item.h" #include "third_party/blink/renderer/modules/xr/xr_window.h" #include "third_party/blink/renderer/modules/xr/xr_web_input_event_params.h" #include "third_party/blink/renderer/modules/xr/xr_web_input_event.h" #include "third_party/blink/renderer/modules/xr/xr_web_widget.h" #include "third_party/blink/renderer/modules/xr/xr_web_widget_source.h" #include "third_party/blink/renderer/modules/xr/xr_web_widget_source_client.h" #include "third_party/blink/renderer/modules/xr/xr_win_event.h" #include "third_party/blink/renderer/modules/xr/xr_window_holder.h" #include "third_party/blink/renderer/modules/xr/xr_window_client.h" #include "third_party/blink/renderer/modules/xr/xr_window_view.h" #include "third_party/blink/renderer/modules/xr/xr_viewport.h" #include "third_party/blink/renderer/modules/xr/xr_system ==================================================================================================== /*************************************************************************** Copyright (C) 2019 Robby Stephenson ***************************************************************************/ /*************************************************************************** * * * 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) 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.), which shall act as a proxy * * defined in Section 14 of version 3 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, see . * * * ***************************************************************************/ #ifndef TELLICO_HPP #define TELLICO_HPP #include #include #include namespace Tellico { namespace Import { class TellicoImporter; class TellicoImporterInternal; /** * A document containing Todos tag names and valid fields. */ class TellicoImporter : public Tdocument { Q_OBJECT public: /** * Supported ways to create a new Todos object. */ enum Mode { /// Creates new Todos object in the specified mode. Mode_Create, /// Copies an existing Todos object. Mode_Copy, /// Clones an existing Todos object. Mode_Clone, /// Deletes an existing Todos object. Mode_Delete }; explicit TellicoImporter(const QString& name_, Mode mode_); ~TellicoImporter() override; /** * Returns the list of data loaded by this factory. */ virtual Data::List allData() const Q_DECL_OVERRIDE; /** * Returns a list of tagged fields from the data. */ virtual Data::FieldList allFields() const Q_DECL_OVERRIDE; /** * Returns a list of all images from the currently selected list. */ virtual QList images() const Q_DECL_OVERRIDE; /** * Returns a list of all file extensions from the currently selected list. */ virtual QList fileExtensions() const Q_DECL_OVERRIDE; /** * Returns a list of all files inside the currently selected list. */ virtual QList files() const Q_DECL_OVERRIDE; /** * Returns a list of all groups from the currently selected list. */ virtual QList groups() const Q_DECL_OVERRIDE; /** * Returns a list of all positions from the currently selected list. */ virtual QList positions() const Q_DECL_OVERRIDE; /** * Returns a list of all type from the currently selected list. */ virtual QList type() const Q_DECL_OVERRIDE; /** * Returns a list of all allowed languages from the currently selected list. */ virtual QList languages() const Q_DECL_OVERRIDE; /** * Returns a list of all extensions from the currently selected list. */ virtual QList extensions() const Q_DECL_OVERRIDE; /** * Returns a list of all supported file formats. */ virtual QList formats() const Q_DECL_OVERRIDE; /** * Returns a list of supported image formats. */ virtual QList imageFormats() const Q_DECL_OVERRIDE; /** * Returns a list of supported MIME types. */ virtual QList mimeTypes() const Q_DECL_OVERRIDE; /** * Returns the list of files that are relevant to loading this Todos object ==================================================================================================== /* -*- 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 "nsDependentString.h" #include #include // DependentStrings are per-node, but we don't want to provide them in // non-debug builds. namespace mozilla { // static void DependentString::operator()(const nsString& aStr) { const char* str = aStr.BeginWriting(); const char* end = aStr.EndWriting(); while (str != end) { printf("%s ", (const char*)str); str += strlen(str) + 1; } } // static const nsString DependentString::Empty() { static const nsString empty; return empty; } } // namespace mozilla ==================================================================================================== /* * PgBouncer - Lightweight connection pooler for PostgreSQL. * * Copyright (c) 2007-2009 Marko Kreen, Skype Technologies OÃœ * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /** * @file * Portable connection pooler API. */ #ifndef _POOLER_H #define _POOLER_H #include #include /* * Storage structures for all connection poolers */ struct pool; struct pool_poll; /* * Add new connection to the pool (timeout parameter) * * Returns -1 in case of error, else the number of connections in the pool. * * TODO(when): remove this function once MuttConnection.c is fixed. */ int pool_add(struct pool *pool, unsigned long timeout); /* * Remove connection from the pool * * Returns 0 in case of success, else the number of connections in the pool. */ int pool_del(struct pool *pool, unsigned long timeout); /* * Create an index of the connection from the pool * * Returns -1 in case of error, else the index. */ int pool_index(struct pool *pool); /* * Increment reference count of the pool */ void pool_incref(struct pool *pool); /* * Decrement reference count of the pool */ void pool_decref(struct pool *pool); /* * Remove all connections from the pool */ void pool_reset(struct pool *pool); /* * get time in milliseconds */ unsigned long pool_get_timeout(struct pool *pool); /* * get persistent connections */ struct pool_poll * pool_poll(struct pool *pool); /* * Transfer data from one connection pool to another * * Returns NULL in case of error, else connection data. */ const void * pool_transfer(struct pool *pool, int copy); /* * Send data to an existing connection. */ int pool_send(struct pool *pool, const void *data, size_t size); /* * Destroy an existing connection */ void pool_destroy(struct pool *pool); /* * Return pool handle */ struct pool * pool_handle(const char *ident, char *fmt, ...); #endif ==================================================================================================== /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_PERFETTO_TRACING_PROTO_NETWORK_H_ #define INCLUDE_PERFETTO_TRACING_PROTO_NETWORK_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include "perfetto/protozero/protobuf/rpc/stubs/tools.pbzero.h" #include "perfetto/protozero/protobuf/rpc/stubs/perfetto/util/base_types.h" #include "perfetto/protozero/proto_utils.h" #include "protos/perfetto/trace/config/perfetto_config_export.h" namespace perfetto { namespace trace { class Config; // A network has been collected. Mostly, each time a trace is // extracted, the key and value of the trace need to be saved. // The key is a string that will be returned from // PERFETTO_CONFIG_EXPORT.Config protoperfetto.tracing.network.key. struct PerfettoNetworkKey { std::string key; std::string value; }; // A unique token represents a single network that is backed by a trace. struct PerfettoNetwork { // Name of the network. Will be truncated if needed. std::string name; // Pointer to the list of nodes associated with the network. The // trace points to this list (and therefore shares memory, if // any). std::vector nodes; // Shared memory with the network. Will be stored in the PerfettoConfig. std::string serialized_mem; // Shared memory with the network. Only usable on shared memory. std::string cached_mem; }; // A structure representing a sequence of networks and provides constants to // feed them back to a perfetto server. struct PerfettoNetworkSequence { // A unique token representing a network. The order of the tokens // determines the format of the key and value. The keys correspond to the // resources available on the server. The values correspond to the nodes // on which they were found. PerfettoNetwork key; PerfettoNetworkValue value; }; // A structure representing a single network. Contains information needed // to know when to generate trace events. struct PerfettoNetwork : public perfetto::protobuf::Reflection { // Indicates the state of the network. PerfettoNetworkState state = PERFETTO_NETWORK_NONE; // Indicates the current thread. int32_t thread_id = 1; // True if the network is currently opened. bool is_open = false; // Indicates whether the trace was successfully started. bool is_started = false; // Indicates whether the network is shutting down. bool is_shutting_down = false; // This can be set in the read order (but concurrent readers can't be read). perfetto::protos::PerfettoProtobuf protobuf; // The sysex events can be captured as events received. perfetto::protos::PerfettoProtobuf sysex_events; // A special Key for the network this particular instance should use for serialization // events, so it can be set in the read order (but concurrent readers can't be read). perfetto::protos::PerfettoProtobuf key_to_serialize; ==================================================================================================== #include #include #if defined(PETSC_HAVE_FORTRAN_CAPS) #define petscfiltergettype_ PETSCFILTERGETTYPE #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) #define petscfiltergettype_ petscfiltergettype #endif PETSC_EXTERN PetscErrorCode petscfiltergettype_(PetscObject *f,char* type) { char *t; int s; PetscErrorCode ierr; PetscFunctionBegin; ierr = MPI_Type_string(type,&t);CHKERRQ(ierr); if (!t) PetscFunctionReturn(0); if (strncmp(t,"PV_",3)) { t = t + 3; ierr = PetscStrchr(t,'D');CHKERRQ(ierr); if (t[0] != '1' && t[0] != '2' && t[0] != '3' && t[0] != '4') SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Unrecognized type in filter %s: %s\n",type,t); } if (!f->setupcalled) { if (f->setupcalled) {ierr = MPI_ERR_USER; goto error;} ierr = PetscStrcpy(f->type,t);CHKERRQ(ierr); f->setupcalled = PETSC_TRUE; } if (f->setupcalled && !f->setupcalledgetype) {ierr = MPI_ERR_USER; goto error;} PetscFunctionReturn(0); error: SETERRQ(PETSC_COMM_SELF,PETSC_ERR_UNKNOWN_OPTION,"Unknown filter type"); PetscFunctionReturn(0); } ==================================================================================================== /* SPDX-License-Identifier: GPL-2.0 */ /* * VMware VMCI driver - VGA misc interfaces * * Copyright (c) 2017 Dialog Semiconductor * * Copyright (c) 2018 Linaro Ltd. * Copyright (c) 2018 Andrew Lunn */ #ifndef _VMW_VGA_H #define _VMW_VGA_H #include #include #include #include #include #include #include #include #include /* Definition of the static and debugging constants used in the 'vga' module */ /* Use the defined macros in vgaconfig.h */ #ifndef VGA_RESERVED #define VGA_RESERVED_DDC_DATA_INDEX 0 #define VGA_RESERVED_DDC_REV 0x01 #define VGA_RESERVED_DDC_IRQ_INDEX 0 #define VGA_RESERVED_DDC_IRQ_EN 0x02 #define VGA_RESERVED_DDC_CONF_INDEX 1 #define VGA_RESERVED_DDC_CONF_EN 0x04 #define VGA_RESERVED_DDC_DMA_DATA_INDEX 2 #define VGA_RESERVED_DDC_DMA_DATA_EN 0x08 #define VGA_RESERVED_DDC_DMA_ADDR_INDEX 3 #define VGA_RESERVED_DDC_DMA_ADDR_EN 0x10 #define VGA_RESERVED_DDC_STAT_INDEX 4 #define VGA_RESERVED_DDC_STAT_EN 0x40 #define VGA_RESERVED_DDC_INTR_INDEX 8 #define VGA_RESERVED_DDC_INTR_EN 0x80 #endif #ifndef VGA_RESERVED_VGA_IO_BAR #define VGA_RESERVED_VGA_IO_BAR 0x40 #endif #ifndef VGA_RESERVED_VGA_IO_INDEX #define VGA_RESERVED_VGA_IO_INDEX 0x80 #endif #ifndef VGA_IO_INDEX #define VGA_IO_INDEX 0 #endif #ifndef VGA_IO_IRQ_INDEX #define VGA_IO_IRQ_INDEX 1 #endif #ifndef VGA_IO_IRQ_EN #define VGA_IO_IRQ_EN 0 #endif /* The fourcc with which the vga is connected. */ #define DRM_FORMAT_RGB565 0x1555 #define DRM_FORMAT_XRGB1555 0x1555 #define DRM_FORMAT_XBGR1555 0x1555 #define DRM_FORMAT_BGR565 0x1555 #define DRM_FORMAT_RGBX565 0x1555 #define DRM_FORMAT_BGRX565 0x1555 #define DRM_FORMAT_RGB565_PLANAR 0x75 #define DRM_FORMAT_XRGB1555_PLANAR 0x75 #define DRM_FORMAT_XBGR1555_PLANAR 0x75 #define DRM_FORMAT_BGR565_PLANAR 0x75 #define DRM_FORMAT_RGBX565_PLANAR 0x75 #define DRM_FORMAT_BGRX565_PLANAR 0x75 /* Valid fourcc values for DMA sizes */ #define VGA_DMA_FORMAT_ATI 0x9455 #define VGA_DMA_FORMAT_FB 0x3275 #define VGA_DMA_FORMAT_YUV 0x7444 /* Number of valid fourcc values. The different formats can be listed * in the fourcc enum list above. */ #define VGA_DMA_FORMAT_NUM 3 struct drm_framebuffer; struct drm_gem_object; struct drm_gem_context; struct drm_gem_vram; struct drm_vram_obj; struct drm_vram_file; struct drm_vram_object; struct drm_file; struct drm_device; struct drm_crtc; struct drm_plane; struct drm_plane_state; struct drm_crtc_state; struct drm_buffer; struct drm_framebuffer; struct drm_gem_object; struct drm_gem_context; struct drm_gem_vram; struct drm_vram_obj; struct drm_vram_file; struct drm_vram_object; ==================================================================================================== #include #include #include #include #include #include #include #include #define HAVE_USTAT #include "imsg.h" int main(int argc, char **argv) { imsg_t *ms; int status; /* set default umask */ umask(017); /* open the gallery */ ms = ims_open(argv[0]); if (ms == NULL) { fprintf(stderr, "unable to open gallery (%s)\n", argv[0]); exit(1); } /* get root gallery info */ if (ims_info(ms, &ms->gd_root, &ms->gd_id, &ms->gd_size) != MS_SUCCESS) { fprintf(stderr, "unable to read root gallery (%s)\n", argv[0]); exit(1); } printf("root: %s\n", ms->gd_root); printf("id: %d\n", ms->gd_id); printf("size: %d\n", ms->gd_size); printf("root_file: %s\n", ms->gd_root); if (strcmp(argv[1], "batch") == 0) { if (ims_batch_start(ms, MS_FORCE) != MS_SUCCESS) { fprintf(stderr, "unable to start batch (%s)\n", argv[0]); exit(1); } } else { int i; if (ms->gd_batch_written == 0) { for (i=0; igd_batch_written++; /* write the batch */ i = ims_batch_end(ms); if (i != MS_SUCCESS) { fprintf(stderr, "unable to write batch (%s)\n", argv[0]); exit(1); } ms->gd_batch_written--; if (ms->gd_batch_written == 0) { for (i=0; i. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "testutil.hpp" #include "testutil_unity.hpp" #include "testutil_monitoring.hpp" #include "testutil_monitoring_network.hpp" #include "testutil_random.hpp" #include "testutil_sock.hpp" #include "testutil_monitoring_ipv6.hpp" #include "testutil_monitoring_ipv6_multicast.hpp" #include "testutil.hpp" #include #include // TODO: add more tests. // TODO: add more tests for IPV6 multicast to libzmq // TODO: test option names zmq::util::string_t my_test_name; static void bind_loopback (void *context_) { // bind multicast void *server = zmq_server (); void *client = zmq_client (server); zmq::options_t options; options.flags |= ZMQ_TCP_KEEPALIVE; options.value |= 2; // don't use session resync bind_loopback_ipv6 (server, client, &options); int option_loopback_ipv6_support = 0; TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (client, SOL_SOCKET, SOL_IPV6, IPV6_MULTICAST_LOOP, &option_loopback_ipv6_support, sizeof (int))); uint64_t ipv6_multicast_loop_options = 0; memset (&ipv6_multicast_loop_options, 0, sizeof (ipv6_multicast_loop_options)); int rc = zmq_setsockopt (client, SOL_IPV6, IPV6_MULTICAST_LOOP, &ipv6_multicast_loop_options, sizeof (ipv6_multicast_loop_options)); TEST_ASSERT_EQUAL_INT (-1, rc); rc = zmq_bind (server, client); TEST_ASSERT_EQUAL_INT (-1, rc); rc = zmq_recv (client, 0, &buffer, sizeof buffer, 0); TEST_ASSERT_EQUAL_INT (-1, rc); memset (&buffer, 0, sizeof buffer); // broadcast memset (&options, 0, sizeof options); options.flags |= ZMQ_IPV6; options.value = IPV6_JOIN_GROUP; options.dont_route = 1; rc = zmq_setsockopt (server, SOL_IPV6, IPV6_MULTICAST_LOOP ==================================================================================================== // // Copyright 2018 Ettus Research LLC // Copyright 2018 Ettus Research, a National Instruments Company // // SPDX-License-Identifier: GPL-3.0-or-later // #include #include #include #include #include #include #include using namespace uhd; using namespace uhd::usrp; /**************************************************************************** * IID for GUID ***************************************************************************/ static const std::string sid_name = "sid"; static const uint8_t sid_guid_offset = SID_TAG_HEADER_SIZE + 1; static const uint16_t sid_guid_t = 0; /**************************************************************************** * SID for ID + FileID ***************************************************************************/ static const std::string sid_file_id = "file_id"; static const uint8_t sid_file_offset = SID_TAG_HEADER_SIZE; static const uint8_t sid_file_size = SID_TAG_FILE_SIZE; /**************************************************************************** * SID for time ***************************************************************************/ static const uhd::time_spec_t sid_time_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_time_units = "hr"; static const std::string sid_time_units_units = "us"; static const std::string sid_time_units_mil = "m"; static const std::string sid_time_units_mil_hecto = "s"; /**************************************************************************** * SID for duration ***************************************************************************/ static const uhd::time_spec_t sid_duration_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_duration_units = "yr"; static const std::string sid_duration_units_units = "us"; static const std::string sid_duration_units_mil = "m"; static const std::string sid_duration_units_mil_hecto = "s"; /**************************************************************************** * SID for clock ***************************************************************************/ static const uhd::time_spec_t sid_clock_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_clock_units = "wc"; static const std::string sid_clock_units_units = "us"; static const std::string sid_clock_units_mil = "M"; static const std::string sid_clock_units_mil_hecto = "S"; /**************************************************************************** * SID for tone ***************************************************************************/ static const uhd::time_spec_t sid_tone_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_tone_units = "wc"; static const std::string sid_tone_units_units = "us"; static const std::string sid_tone_units_mil = "m"; static const std::string sid_tone_units_mil_hecto = "S"; /**************************************************************************** * SID for transponder ***************************************************************************/ static const uhd::time_spec_t sid_transponder_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_transponder_units = "wc"; static const std::string sid_transponder_units_units = "us"; static const std::string sid_transponder_units_mil = "M"; static const std::string sid_transponder_units_mil_hecto = "S"; /**************************************************************************** * SID for nit (event byte) ***************************************************************************/ static const uhd::time_spec_t sid_nit_spec = uhd::time_spec_t(0.0, 0.0, 0.0); static const std::string sid_nit_units = "us"; static const std::string sid_nit_units_units = "us"; static const std::string sid_nit_units_mil = "M"; static const std::string sid_nit_units_mil_hecto = "S"; /**************************************************************************** * SID for Eit (event byte) ***************************************************************************/ static const uhd::time_ ==================================================================================================== /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" #include "apr_strings.h" #include "apr_getopt.h" #include "apr_getopt_template.h" #include "apr_file_info.h" #include "apr_hash.h" #include "apr_uri.h" #include "apr_time.h" #include "apr_uri_uri.h" #include "apr_lib.h" #include "apr_hash.h" #include "apr_buckets.h" #include "apr_file_io.h" #include "apr_filename_info.h" #include "apr_getopt.h" #include "apr_env.h" #include "apr_network_io.h" #include "apr_getopt.h" #include "apr_date.h" #include "apr_private.h" #include #include #include APR_DECLARE(apr_status_t) apr_uri_merge_options(apr_uri_t **dst, apr_uri_t *src) { if (dst == src) { return APR_SUCCESS; } *dst = apr_pmemdup(dst, src, sizeof(*src)); if (!*dst) { return APR_ENOMEM; } src->protocol = src->uri ? APR_URI_PROTOCOL_UNSPECIFIED : src->uri->protocol; src->scheme = src->uri ? src->uri->scheme : NULL; src->user = src->uri ? src->uri->user : NULL; src->password = src->uri ? src->uri->password : NULL; src->host = src->uri ? src->uri->host : NULL; src->port = src->uri ? src->uri->port : 0; src->query = src->uri ? src->uri->query : NULL; src->fragment = src->uri ? src->uri->fragment : NULL; return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_uri_join(apr_pool_t *pool, apr_uri_t **dst, apr_uri_t *uri) { if (dst == uri) { return APR_SUCCESS; } if (pool == NULL) { *dst = uri; return APR_SUCCESS; } if (*dst == NULL) { *dst = apr_pmemdup(pool, uri, sizeof(*uri)); return (*dst == NULL) ? APR_ENOMEM : APR_SUCCESS; } (*dst)->pool = pool; (*dst)->uri = apr_pmemdup(pool, uri, sizeof(*uri)); (*dst)->uri->pool = pool; return APR_SUCCESS; } APR_DECLARE(const char *) apr_uri_strchr(const apr_uri_t *uri, const char c) { if (uri == NULL) { return NULL; } return uri->query ? strstr(uri->query, c) : NULL; } APR_DECLARE(int) apr_uri_strcmp(const apr_uri_t *a, const apr_uri_t *b) { return strcmp(a->uri, b->uri); } APR_DECLARE(int) apr_uri_uri_info_clean(apr_pool_t *pool, const char *uri, apr_uri_info_t *infos) { apr_ ==================================================================================================== #include "ReentrantCall_Wrapper.h" #include #include "CLucene/document/Document.h" #include "CLucene/document/FieldInfos.h" #include "CLucene/document/Field.h" #include "CLucene/document/IndexWriter.h" #include "CLucene/document/IndexReader.h" #include "CLucene/document/DocumentMerge.h" #include "CLucene/document/TermQuery.h" #include "CLucene/document/Term.h" #include "Sr.h" CL_NS_USE(document) CL_NS_USE(util) CL_NS_USE(analysis) void ReentrantCall_Wrapper::reopen(ReentrantCall::ReentrantCallMode mode) { if ( ! _indexer ) { return; } TermPositionVector * tps = _indexer->positions(); int32_t i = tps->size(); // set REUSE_INCREMENTAL_SEARCH in the case where the field contains multiple terms if (mode == REUSE_INCREMENTAL_SEARCH || tps->size() == 1 || tps->size() > 1) { // create new position vector and add terms to it tvector.addAll(_terms->clone()); // in order to reduce complexity of comparison, see if we have a specific "tentative" field, // set REUSE_INCREMENTAL_SEARCH to use the position-frequency rule and add the field to that index if (mode == REUSE_INCREMENTAL_SEARCH) { tvector.setInterval(_terms->get(0)->freq(), tvector.getInterval() + 1); tvector.setInterval(_terms->get(tps->size() - 1)->freq(), tvector.getInterval() + 1); } else { tvector.setInterval(tps->size(), _terms->get(tps->size() - 1)->freq()); } } if (mode == REUSE_INCREMENTAL_SEARCH) { _freqVector = 0; _avgFreqVector = 0; // reread input for (int32_t i = 0; i < tps->size(); i++) { Term * t = tps->get(i); if ( t->isProhibited() || t->doc() != _deletion->doc() ) { tvector.addAll(t); } } } else { _freqVector = _freqs->clone(); _avgFreqVector = _freqs->clone(); _freqs->close(); } _docs->close(); _freqs->close(); } ReentrantCall_Reopen::ReentrantCall_Reopen(const TermVectors* t, const Sort* s) { this->freqs = _freqs; this->sorts = _sorts; this->t = t; this->s = s; this->doc = _deletion->doc(); this->isDeletes = false; this->isDeletionsSort = false; this->isDocsSort = false; this->needSort(); } void ReentrantCall_Reopen::merge(int32_t doc) { this->docs->reopen(); for (int32_t i = 0; i < this->docs->size(); ++i) { FieldInfo* fi = this->docs->fieldInfo(i); if (fi->fieldName == L"id") { this->ids[i] = -1; } else if (fi->fieldName == L"field") { this->ids[i] = i; this->idFields[i] = true; } else if (fi->fieldName == L"field_str") { this->ids[i] = this->fieldInfo(i)->doc(); this->idFields[i] = true; this->idStrings[i] = 0; this->idFields[i] = false; } else if (fi->fieldName == L"doc") { this->idDocuments.push_back(i); this->idFields[i] = true; } else if (fi->fieldName == L"unmodified") { this->idDocuments.push_back(i ==================================================================================================== /* This file is part of the KDE Baloo Project SPDX-FileCopyrightText: 2014 Vishesh Handa SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #ifndef BALOO_PARTFILE_H #define BALOO_PARTFILE_H #include #include #include #include namespace Baloo { class Part; class PartFile : public KParts::ReadWritePart { public: explicit PartFile(const QByteArray& deviceName, const QString& password, QObject* parent = nullptr); explicit PartFile(const QByteArray& deviceName, QObject* parent, const QString& password); ~PartFile() override; /** * Sets the part @p part to be read. The file must exist. * @p readOnly determines whether the part should be read only. */ void setPart(const KParts::ReadOnlyPart::Ptr& part, bool readOnly); /** * @return the part that is used by this file. */ KParts::ReadOnlyPart::Ptr part() const; /** * Sets the part @p part to be read. The file must exist. * @p readOnly determines whether the part should be read only. * @param readOnly determines whether the part should be read only. */ void setPart(KParts::ReadOnlyPart::Ptr part, bool readOnly, bool ask = false); /** * Resets the part's internal state */ void clear(); /** * Returns the list of all available files */ const QStringList& files() const; /** * Returns the mimetype of this part. * Usually this is empty. * * @return the mime type */ QString mimeTypeName() const; /** * Returns the connection state */ ConnectionState connectionState() const; /** * Returns the password, after encryption */ QString password() const; /** * If the file is in the form of a password, this returns a QString with the encrypted password */ QString encryptedPassword() const; /** * If the file is in the form of a password, this returns a QStringList with the encrypted password */ QStringList encryptedPasswordList() const; /** * Returns the first one of the encrypted password lists */ QStringList encryptedPasswordList() const; /** * Returns the first one of the encrypted password lists */ const QStringList& directories() const; /** * Returns the first one of the encrypted password lists */ QStringList directories() const; /** * Returns the first one of the encrypted password lists */ const QStringList& files() const; /** * If the file is in the form of a directories, this returns a QString with the directory names */ QString dir() const; /** * If the file is in the form of a directories, this returns a QStringList with the directory names */ QStringList dirList() const; /** * If the file is in the form of a files, this returns a QStringList with the list of all available files */ QStringList fileList() const; /** * If the file is in the form of a files, this returns a QStringList with the list of all available files */ const QStringList& fileAttributes() const; /** * If the file is in the form of a directories, this returns a QString with the directories */ QString dirAttributes() const; /** * If the file is in the form of a directories, this returns a QStringList with the directories */ QStringList dirAttributesList() const; /** * Returns the mimetype of this part. * Usually this is empty. * * @return the mime type */ QString mimeTypeNameForFile(const KFileItem& fileItem) const; /** * Returns the connection state for this part */ ConnectionState connectionStateForFile(const KFileItem& fileItem) const; private: ==================================================================================================== /* * Copyright (c) 2010, 2011, 2012, 2013 Nicira, 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. */ #ifndef OVSDB_TYPES_H #define OVSDB_TYPES_H 1 /* The first part of a package of definitions of "types.h" goes here. * * (actually any thread-local in-memory representation of an enum ovs_key_type.) */ #include #include #include /* The structure of an ovs_key_type for ovs_key_type. */ struct ovs_key_type { uint8_t key_ofs; /* Offset of the key. */ uint8_t key_len; /* Length of the key. */ }; /* Keeps a list of the above. */ struct ovs_key_type key_types[OVS_KEY_TYPE_MAX + 1]; /* Per-key data in the key data. */ struct ovs_key_type_data { const struct ovs_key_type *type; /* Type of the data. */ const void *data; /* Data. */ }; /* 'key_ofs' is in bytes from the beginning of the 'type' field. * * Type of data in the key field. */ #define KEY_TYPE_OFFSET(key_ofs) ((key_ofs) << 3) /* 'key_ofs' is in bytes from the beginning of the 'type' field. * * Type of data in the key field. */ #define KEY_TYPE_TYPE(key_ofs) ((key_ofs) >> 3) /* 'key_ofs' is in bytes from the beginning of the 'type' field. * * Type of data in the key field. */ #define KEY_TYPE_DATA_OFFS(key_ofs) ((key_ofs) >> 3) /* * Type for storage in the key data. Note that the value in the type's data * field is at position KEY_TYPE_DATA_OFFS. */ struct ovs_key_type_storage { /* The offset to the data. */ uint8_t data_ofs; /* The length of the data. */ uint8_t data_len; }; /* The key data contained in the 'key_ofs' field in ovs_key_type. */ struct ovs_key_type_storage *ovs_key_type_storage_get(const struct ovs_key_type *); struct ovs_key_type_storage *ovs_key_type_storage_new(uint8_t data_ofs, uint8_t data_len); /* The struct of an ovs_key_type_storage. */ struct ovs_key_type_storage_item { /* The offset of the key's data. */ uint8_t data_ofs; /* The length of the key's data. */ uint8_t data_len; /* Pointer to the key's data. */ const void *data; }; /* * A structure which contains a pointer to a 'ovs_key_type_storage_item'. * * The struct of ovs_key_type_storage_item is the union of a ovs_key_type_storage * struct. This struct may contain pointers to structures that need to be * stored as 'ovs_key_type' fields. The struct of ovs_key_type_storage_item * consists of a number of ovs_key_type_storage pointers in the ovs_key_type * itself. * * It contains: * * struct ovs_key_type_storage_item -> ovs_key_type_storage * struct ovs_key_type_storage_item -> ovs_key_type_storage * * ==================================================================================================== /* * Seven Kingdoms: Ancient Adversaries * * Copyright 1997,1998 Enlight Software 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, see . * */ //Filename : OTALKRES.CPP //Description : Object Sprite resource #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 < ==================================================================================================== /* Copyright (C) 2014 - 2018 Evan Teran evan.teran@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 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 DIALOG_H_20140320_ #define DIALOG_H_20140320_ #include #include #include #include #include #include #include #include #include #include #include namespace Gdb { class Entry; class VariableModel; class Variable; class Dialog : public QDialog { Q_OBJECT public: explicit Dialog(QWidget *parent = nullptr); void updateHelp(); void setOkButtonText(const QString &text); void exec(); signals: void m_textChanged(QString text); public slots: void slotOk(); protected: virtual void acceptEvent(QCloseEvent *event) override; private: void updateLayout(); void init(const QString &text, const QString &error_message); void updateVariables(const VariableModel *model, const Variable *variable); QLabel *m_warningLabel; QLabel *m_okLabel; QPushButton *m_ok; QLabel *m_cancelLabel; QPushButton *m_cancel; QGridLayout *m_layout; QToolButton *m_button; QShortcut *m_shortcut; }; } // namespace Gdb #endif // DIALOG_H_20140320_ ==================================================================================================== /* Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOPE. SOPE 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, or (at your option) any later version. SOPE 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 SOPE; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NGNetAddress_H__ #define __NGNetAddress_H__ #import #import #import /* The NNetAddress class is used to refer to address in a NGS datagram. The address data is stored in an instance of the following class: \li String data: Address/String instance. \li C++ types: Represents an NSData instance and a pointer to its data. Normally, it contains pointers to primitive type data. */ @class NGRule, NGNetAddress; @interface NNetAddress : NSObject { @private unsigned short category; int mode; NGRule *firstAddress; } - (void) setCategories: (unsigned short)categories; - (unsigned short) categories; - (int) categoryCount; - (NSInteger) findByName: (NSString *)address; - (NSString *) addressByCategory: (unsigned short)category; - (int) categoryCountByAddress: (NGRule *)address; - (void) setMode: (int)mode; - (int) mode; - (void) setFirstAddress: (NGRule *)address; - (NGRule *) firstAddress; @end #endif /* __NGNetAddress_H__ */ ==================================================================================================== // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2015-2016 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_COMPLEX_MAT_H #define EIGEN_COMPLEX_MAT_H namespace Eigen { namespace internal { template class Complex : public Decomposition<_Scalar, _StorageOrder, _MaxRows, _MaxCols> { public: typedef Decomposition<_Scalar, _StorageOrder, _MaxRows, _MaxCols> Base; EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_IS_NATIVE EIGEN_STRONG_INLINE Complex() : Base() {} typedef typename internal::traits::RealScalar Scalar; EIGEN_STATIC_ASSERT_SCALAR_IS_FIXED_SIZE typedef typename Base::Index Index; typedef typename internal::traits::StorageIndex StorageIndex; typedef typename internal::traits::Scalar RealScalar; typedef typename internal::traits::RealComplex RealComplex; template EIGEN_DEVICE_FUNC const StorageIndex outerInnerStride(const OtherDerived& other) const { return other.derived().outerInnerStride(derived().size()); } template EIGEN_DEVICE_FUNC const RealScalar omega(const OtherDerived& other) const { return other.derived().omega(derived().size()); } template EIGEN_DEVICE_FUNC const RealScalar omega() const { return typename internal::traits::RealScalar(derived().size()); } template EIGEN_DEVICE_FUNC const Index outerStride(const OtherDerived& other) const { return other.derived().outerStride(derived().size()); } template EIGEN_DEVICE_FUNC const Index outerStride() const { return typename internal::traits::Index(derived().size()); } template EIGEN_DEVICE_FUNC const Index innerStride(const OtherDerived& other) const { return other.derived().innerStride(derived().size()); } template EIGEN_DEVICE_FUNC const Index innerStride() const { return typename internal::traits::Index(derived().size()); } template EIGEN_DEVICE_FUNC const Index outerIndex(const OtherDerived& other) const { return other.derived().outerIndex(derived().size()); } template EIGEN_DEVICE_FUNC const Index outerIndex() const { return typename internal::traits::Index(derived().size()); } template EIGEN_DEVICE_FUNC const Index innerIndex(const OtherDerived& other) const { return other.derived().innerIndex(derived().size()); } template EIGEN_DEVICE_FUNC const Index innerIndex() const { return typename internal::traits::Index(derived().size()); } template EIGEN_DEVICE_FUNC const Index outer(const OtherDerived& other) const { return other.derived().outer(derived().size()); } template EIGEN_DEVICE_FUNC const Index outer() const { return typename internal::traits::Index(derived().size()); } template EIGEN_DEVICE_FUNC const Index inner(const OtherDerived& other) ==================================================================================================== /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* 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 "NoteUtils.h" #include "mozilla/dom/HTMLInputElement.h" #include "nsGenericHTMLElement.h" #include "nsMathUtils.h" #include "nsJSUtils.h" #include "nsString.h" namespace mozilla { NS_IMPL_NS_NEW_HTML_ELEMENT(Barcode) Barcode::Barcode(const nsAString& aText, const nsAString& aUrl, const mozilla::dom::HTMLInputElement* aButtonElement) : mRaw(aRaw) , mText(aText) , mURL(aUrl) , mButtonElement(aButtonElement) {} Barcode::Barcode(const Barcode& aOther) : mRaw(aOther.mRaw) , mText(aOther.mText) , mURL(aOther.mURL) , mButtonElement(aOther.mButtonElement) {} Barcode::Barcode(const nsAString& aText, const mozilla::dom::HTMLInputElement* aButtonElement) : mRaw(aText) , mText(aText) , mButtonElement(aButtonElement) {} Barcode::~Barcode() = default; nsresult Barcode::SetText(const nsAString& aText, const nsPoint& aPoint, bool aIsClickable, bool aSelect) { nsresult rv = HTMLInputElement::SetText(aText, aPoint, aIsClickable, aSelect); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; } void Barcode::SetText(const nsAString& aText, const mozilla::dom::HTMLInputElement* aButtonElement) { SetText(aText, TextPositionFromPoint(aPoint, aButtonElement), true); } void Barcode::SetText(const nsAString& aText, TextPosition aPosition, bool aIsClickable, bool aSelect) { nsCOMPtr content = aPosition == TextPositionFromPoint(aPoint, aButtonElement) ? mButtonElement : nullptr; if (content) { bool wasClickable = TextEqualsASCII(textContent(), content, u"f"_ns, eIgnoreCase); if (wasClickable && aSelect) { ClearSelection(); } return; } // If the input box has no body, we should call SetText() instead if (mButtonElement) { SetText(aText, TextPositionFromPoint(aPoint, mButtonElement), true); return; } nsAutoString preStr; nsContentUtils::GetStringFromTableElement(aText, preStr); SetText(preStr, TextPositionFromPoint(aPoint, mButtonElement), aSelect); } void Barcode::SetText(const nsAString& aText, TextPosition aStart, TextPosition aEnd, bool aIsClickable, bool aSelect) { TextRange range(aStart, aEnd); int32_t start = range.GetStart(); int32_t end = range.GetEnd(); if (start > end) { NS_WARNING("start > end"); return; } if (aSelect) { bool wasClickable = TextEqualsASCII(textContent(), range.GetRangeText(), u"t"_ns, eIgnoreCase); if (wasClickable) { ClearSelection(); } return; } nsContentUtils::SetStringFromTableElement(aText, range.GetRangeText(), u"f"_ns, eIgnoreCase); SetText(range.GetText(), TextPositionFromPoint(aPoint, range.GetStart()), aSelect); } void Barcode::ClearSelection() { if (mButtonElement) { SetSelectionEnd(mButtonElement->AsElement()->GetEditableElement()); } SetSelectionStart(0); m ==================================================================================================== /* Copyright (C) 2010 William Hart 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 #include "flint.h" #include "ulong_extras.h" #include "fmpz.h" int fmpz_t_sqrt(mpz_t z, flint_rand_t state) { int i, j; FLINT_TEST_INIT(state); flint_printf("sqrt... "); fflush(stdout); mpz_init(z); for (i = 0; i < 20; i++) for (j = 0; j < 20; j++) fmpz_sqrt(z, state); mpz_clear(z); FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; } ==================================================================================================== /* Verify that the given fixed-point multiplication is equivalent. */ /* { dg-do compile } */ /* { dg-options "-O2 -mfpmath=sse" } */ /* { dg-skip-if "requires SSE" { vxworks_kernel } } */ #include extern void abort (void); double d; void foo (void) { d = -d; } int main (void) { d = 3.141592e+308; if (d != 3.141592e+308) abort (); return 0; } ==================================================================================================== /* * Unit tests for I/O Virtual Engine (VDE - Virtual Engine Adapter) * * Copyright 2008 by Choon Chen * * Based on ViSP package vboot (compile with -O), * Copyright (C) 2007 Francois Gouget. * * 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 */ #define _FILE_OFFSET_BITS 64 #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include "wine/test.h" #include "vde.h" #include "vde-ioctl.h" #include "vde-tests.h" #ifndef VDE_IOCTL_SIZE #define VDE_IOCTL_SIZE 32 #endif static void test_vde_io_init(void) { static const char _prefix[] = "vde-io-init"; int fd = _open(fd_name, O_RDWR | O_NONBLOCK); struct VDIOParameters VDI_params; VDI_params.version = VDE_IO_PARAMS_VERSION; VDI_params.fds = &fd; VDI_params.max_threads = 16; VDI_params.max_user_cmds = 64; VDI_params.user_cmds = vde_user_cmds; VDI_params.userdata_size = VDE_IOCTL_SIZE; VDI_params.total_size = (unsigned) VDE_IOCTL_SIZE; VDI_params.cache_hits = 5; VDI_params.cache_misses = 2; VDI_params.cache_misses_target = 2; VDI_params.cache_deletes = -1; VDI_params.use_host_time = 0; VDI_params.use_guest_time = 0; VDI_params.use_dev_time = 0; VDI_params.split_queue_size = 0; VDI_params.cache_id = 0; VDI_params.cache_width = 8; VDI_params.cache_height = 16; VDI_params.cache_depth = 64; VDI_params.cache_channels = 4; VDI_params.cache_data_size = 0; VDI_params.cache_timestamp_mode = 0; VDI_params.cache_cache_enabled = 0; VDI_params.use_client_io = 0; VDI_params.vde_flush = 0; VDI_params.vde_granularity = 0; VDI_params.vde_heartbeat_granularity = 0; VDI_params.timestamp_mode = 0; VDI_params.timestamp_cache_size = 0; VDI_params.client_io = NULL; VDI_params.failover = 0; VDI_params.vde_features = 0; VDI_params.connection_poll_time = 0; VDI_params.use_damage_page = 0; VDI_params.use_commit_page = 0; VDI_params.await_direct_io = 0; ==================================================================================================== #include "ZooKeeper.hpp" #include #include #include "util/log.hpp" #include "util/string.hpp" #include #include #include #include #include namespace pdalboost { namespace zkutil { /** * A zookeeper component which represents one point in a KNN ordering * (zookeeper in X), providing enough information to fulfill the * addition of the points toward the main thread/process. It is * essentially the concept of a point in a cluster to pass the * point to the dataset to zookeeper to the cluster. * * zookeeper passes points in (i) coordinate system to * boost::polygon_operators::polygon_buffer, * associated with ZooKeeper objects, * and * their visibility, and positions to record that in * the dataset. All with visible information and order * are recorded in zookeeper's spatial and local topology. * * These operations may be used to record individual vertices or * edge connectivity. */ template class zookeeper : public zkutil::zkutil::line_wrapper { public: /** zookeeper::line_wrapper initializes the * zookeeper object. * * zookeeper::line_wrapper is derived from zkutil::line_wrapper, * but does not provide access to the geometry (or topology) * of the point-cloud. * * zookeeper::line_wrapper::vertex(std::size_t vertex_index) * * zookeeper::line_wrapper::vertex() can be used to record a * point index using the zkutil::indexer::indexer (see * zookeeper::zoo_indexer). */ zookeeper(std::size_t index_index, std::size_t vertex_index); virtual ~zookeeper(); // zookeeper interface std::size_t vertex_index() const { return _index_index; } /** * Get the point at the given vertex * * @param vertex_index the vertex index. */ std::vector get_point(std::size_t vertex_index) const; /** * Get the point at the given vertex * * @param vertex_index the vertex index. * @param node the point node */ std::vector get_point(std::size_t vertex_index, const pdalboost::dynamic_cast &>& node) const; /** * Get the point at the given vertex, from the cluster's point index. */ std::vector get_point(std::size_t vertex_index) const; /** * Get the next vertex in the zookeeper */ std::size_t next_vertex() const { return _index_index++; } /** * Get the next vertex in the zookeeper * * @param vertex_index the vertex index. * * @return a vector of next vertex. */ std::vector next_vertex(std::size_t vertex_index) const; /** * Get the first point in the zookeeper */ Point get_first_point() const { return _start_point; } /** * Get the first point in the zookeeper * * @return a Point. */ Point get_first_point() const { return _start_point; } /** * Get the first point in the zookeeper * * @param vertex_index the vertex index. * * @return a Point. */ Point get_first_point(std::size_t vertex_index) const; /** * Get the first point in the zookeeper, from the cluster's point index. */ ==================================================================================================== #include "network/ssl.h" #include "network/network.h" #include "network/http-request.h" #include "network/http-response.h" #include "network/http-url.h" #include "network/http-url_builder.h" #include "network/http-url_args.h" #include "network/http-url_response.h" #include "network/http-url_util.h" #include "network/http-url_resource.h" #include "network/http-url_request.h" #include "network/http-url_server.h" #include "network/http-url_server_config.h" #include "network/http-url_url_params.h" #include "network/http-url_response_info.h" #include "network/http-url_server_ssl.h" #include "network/http-url_server_v10.h" #include "network/http-url_server_extension.h" #include "network/http-url_server_utils.h" #include "network/http-url_spec.h" #include "network/http-url_target.h" #include "network/http-url_target_info.h" #include "network/http_url_target_state.h" #include "network/http_url.h" #include "network/http_url_reference.h" #include "network/http_url_matcher.h" #include "network/http_url_chain.h" #include "network/http_url_query_options.h" #include "network/http_url_request_fragment.h" #include "network/http_url_request_utils.h" #include "network/http_url_uri_params.h" #include "network/http_url_shared_ptr.h" #include "network/http_url_validation_options.h" #include "network/http_url_http_basic_fields.h" #include "network/http_url_ssl_settings.h" #include "network/http_url_ssl_util.h" #include "network/http_url_ssl_info.h" #include "network/http_url_ssl_verify_server.h" #include "network/http_url_ssl_verify_client.h" #include "network/http_url_proxy.h" #include "network/http_url_parent_request.h" #include "network/http_url_redirect_headers.h" #include "network/http_url_redirect_url_params.h" #include "network/http_url_response_body.h" #include "network/http_url_stream_params.h" #include "network/http_url_stream_results_context.h" #include "network/http_url_url_params.h" #include "network/http_url_url_params_filters.h" #include "network/http_url_url_params_filters_context.h" #include "network/http_url_url_params_wrapper.h" #include "network/http_url_request_headers.h" #include "network/http_url_request_handler_headers.h" #include "network/http_url_response_headers.h" #include "network/http_url_server_address.h" #include "network/http_url_server_ip.h" #include "network/http_url_server_connection.h" #include "network/http_url_server_request_headers.h" #include "network/http_url_server_parameters.h" #include "network/http_url_server_parameters_wrapper.h" #include "network/http_url_server_extra_header_filters.h" #include "network/http_url_server_extra_header_filters_context.h" #include "network/http_url_server_protocol.h" #include "network/http_url_server_ssl.h" #include "network/http_url_server_ssl_verify_server.h" #include "network/http_url_server_ssl ==================================================================================================== /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #include "opal_config.h" #include #include #include #include #include #ifdef HAVE_DIRENT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "opal/runtime/opal.h" #include "opal/mca/hwloc/base/base.h" #include "opal/util/basename.h" /* * Global variable controlling output showing a list of available systems. */ opal_list_t opal_hwloc_available_libs = { 0 }; opal_hwloc_library_t *opal_hwloc_available_libs_get(void) { opal_list_item_t *item; opal_hwloc_library_t *module; /* Just get the list if we have one */ if( opal_hwloc_available_libs.opal_list_is_empty ) { module = (opal_hwloc_library_t*)opal_list_get_first_value(&opal_hwloc_available_libs); if (NULL != module) { opal_list_remove_item(&opal_hwloc_available_libs, &module->super); opal_list_append(&opal_hwloc_available_libs, &module->super); opal_list_init(&module->super, opal_list_item_t, opal_list_item_t, NULL, OPAL_PTR_LIST, NULL); return module; } } /* Then get the list again */ opal_list_for_each(item, &opal_hwloc_available_libs) { opal_list_item_t *next; opal_list_item_t *next_module = (opal_list_item_t *)opal_list_get_next(item); module = (opal_hwloc_library_t*)next_module; if (NULL == module) { opal_list_remove_item(&opal_hwloc_available_libs, &next_module); opal_list_append(&opal_hwloc_available_libs, &next_module); opal_list_init(&next_module->super, opal_list_item_t, opal_list_item_t, next_module, OPAL_PTR_LIST, next_module); opal_list_init(&next_module->super, opal_list_item_t, opal_list_item_t, next_module, OPAL_LIST_NEXT); opal_list_init(&next_module->super, opal_list_item_t, opal_list_item_t, next_module, OPAL_LIST_NEXT); opal_list_init(&next_module->super, opal_list_item_t, opal_list_item_t, next_module, OPAL_LIST_NEXT); continue; } opal_list_append(&module->super, &next_module->super); ==================================================================================================== /* * 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 Library 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. * * ArtNetInfoWidget.h * Contains the widget to display an ArtNetInfo widget. * Copyright (C) 2013 Simon Newton */ #ifndef ARTNET_INFO_WIDGET_H_ #define ARTNET_INFO_WIDGET_H_ #include #include "common/rdm/rdm.h" #include "common/rdm/method_client.h" #include "common/flat_map.h" #include "common/keyboard.h" #include "common/rdm/videomfm/connected_sender.h" #include "common/rect.h" #include "common/string.h" #include "common/util.h" namespace ola { namespace rdm { class ArtNetInfoWidget : public ConnectedSender, public ComponentInterface { public: explicit ArtNetInfoWidget( const std::string &label, const std::string &url, const std::string &graphics_mode, const std::string &lock_image, uint8_t video_format, const std::string &title, const std::string &alt_display, const std::string &lock_image_pattern); virtual ~ArtNetInfoWidget(); static const uint8_t kRendererCode; static const uint8_t kAvatarDrawCode; // Designates a widget for the ArtNetInfo. This is a result of artnet info that // might be displayed to a different version of a camera. // // |label|: The label to be displayed in the ArtNetInfo. // |url|: The URL of the ArtNetInfo. // |graphics_mode|: The graphics mode to use. Can be used to override the // display mode. // |lock_image|: The image to use for the ArtnetInfo. // |video_format|: The video format to use. // |title|: The text to use for the ArtnetInfo. // |alt_display|: The display for the ArtnetInfo. // |lock_image_pattern|: The image pattern to use for the ArtnetInfo. ArtNetInfoWidget(const std::string &label, const std::string &url, const std::string &graphics_mode, const std::string &lock_image, uint8_t video_format, const std::string &title, const std::string &alt_display, const std::string &lock_image_pattern); ArtNetInfoWidget( const std::string &label, const std::string &url, const std::string &graphics_mode, const std::string &lock_image, uint8_t video_format, const std::string &title, const std::string &alt_display, const std::string &lock_image_pattern); virtual ~ArtNetInfoWidget(); // Only the label text is shown, the artnet info window is shown. // However the label should be aligned with the controls by |alignment| // and this widget will be centered within the window. virtual void Layout(); // Connects to the HostPortController Interface, returns a pointer to the // ArtNetInfoWidget. // If the interface is not available, NULL will be returned. virtual ConnectedSender *GetConnectedTo(); // Returns true if the widget is currently enabled. This is used to see // whether a runtime assisted display is currently enabled or not. virtual bool IsEnabled() const; // Returns true if the widget is ==================================================================================================== /* * tracker/SequenceTracker.cpp * * Copyright 2009 Peter Barth * * This file is part of Milkytracker. * * Milkytracker 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. * * Milkytracker 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 Milkytracker. If not, see . * */ /* * SequenceTracker.cpp * MilkyTracker * * Created by Peter Barth on 10.08.10. * */ #include "SequenceTracker.h" #include "BasicTypes.h" #include "BasicTracker.h" #include "KeyBindings.h" #include "ModuleEditor.h" #include "PatternEditorControl.h" #include "TrackerConfig.h" #include "QuickPhraseEditorControl.h" #include "ScreenUpdateLocker.h" #include "DynamicController.h" #include "PatternEditorControlMessages.h" #include "PlayerController.h" #include "Mixer.h" #include "PianoRoll.h" #include "RadialControl.h" #include "ControlIDs.h" #include "PatternEditorControlTypes.h" #include "PatternEditorControlMacros.h" #include "PianoRollController.h" #include "KeyboardShortcutController.h" #include "PatternTools.h" #include "ModEditorControl.h" #include "Globals.h" #include "GLib", GLibPatternEditorControl.h" #include "GLibUtilities.h" #include "GraphicsAbstract.h" #include "StaticText.h" MilkyPlayModeSequenceTracker::MilkyPlayModeSequenceTracker(TrackerConfig& config) : mConfig(config) { memset(&mDefInputSyncStrings, 0, sizeof(mDefInputSyncStrings)); } void MilkyPlayModeSequenceTracker::readData() { ConfigKey notes = mConfig.getNotation("MIDI Note Numbers"); for (int i = 0; i < 8; i++) notes.setParameterValue("channel", i + 1); for (int i = 0; i < 12; i++) notes.setParameterValue("tuning", i + 1); for (int i = 0; i < 16; i++) notes.setParameterValue("pitch", i); for (int i = 0; i < 4; i++) notes.setParameterValue("program", i + 1); for (int i = 0; i < 5; i++) notes.setParameterValue("instr", i + 1); for (int i = 0; i < 6; i++) notes.setParameterValue("key", i + 1); for (int i = 0; i < 7; i++) notes.setParameterValue("control", i + 1); for (int i = 0; i < 8; i++) notes.setParameterValue("sample", i + 1); for (int i = 0; i < 9; i++) notes.setParameterValue("tempo", i + 1); for (int i = 0; i < 10; i++) notes.setParameterValue("sysex", i + 1); for (int i = 0; i < 11; i++) notes.setParameterValue("keysig", i + 1); mDefInputSyncStrings.set(notes, NoteStringsControl::NoteControlKey, keyNumStrings()); for (int i = 0; i < 16; i++) mDefInputSyncStrings.set(notes, NoteStringsControl::NoteControlChannel, channelNumStrings()); mDefInputSyncStrings.set(notes, NoteStringsControl::NoteControlProgram, programNumStrings()); mDefInputSyncStrings.set(notes, NoteStrings ==================================================================================================== /* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: call.c,v 1.3 2008/07/25 00:32:06 phargrov Exp $ * * This program outputs a C program to check for work w/ loopback/ * restarting of daemon process after every call. * * This program supports alternate commands and calls. * * Usage: * prompt [timeout [timeout secs]] * spool [FILE/[COMMAND]] * daemon_setup [FILE/[COMMAND]] * daemon_run [FILE/[COMMAND]] * daemon_restart [FILE/[COMMAND]] * * Margin are executed after calling client. * * Directory: * chdir * chown * * Explanation: * cexpl(wd) puts the file of the CEXPL environment variable. * cexpe() reads from it. * stop() puts "exit" (if applicable) and exits program. * getlist() gets one line of output from the program. * * Commands: * list (list terminal or file), [-c] * file [REGEXP] (FILE) * oskill (s) * exit (exit on failure) * * 1. file : * wait_and_exit() * exit * * 2. env 1 * list [echo "."[file]]]] * file [echo "."[file]]]] * exit * * 3. cmd 1 * daemon_setup (daemon_run, "cmd_daemon_setup") * daemon_restart (daemon_restart, "cmd_daemon_restart") * * 4. exec 1 * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list * list ==================================================================================================== /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov 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 "pair_lj_cut_tip4p_gpu.h" #include #include #include #include #include "atom.h" #include "comm.h" #include "force.h" #include "kspace.h" #include "neigh_list.h" #include "memory.h" #include "error.h" #include "neigh_request.h" #include "memory.h" #include "pair.h" #define LJ_CUT_TIP4P_DEVICE "pair_lj_cut_tip4p" #define LJ_CUT_TIP4P_ENERGY_MULTIPLIER 0.8 using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairLJCutTIP4PGPU::PairLJCutTIP4PGPU(LAMMPS *lmp) : PairLJCutTIP4P(lmp) { respa_enable = 0; cpu_time = 0.0; single_enable = 1; respa_spline_flag = 0; gpu_mode = hng->gpu_mode; _use_lrt = _use_coul = _use_bond = _use_angle = 0; _use_dihedral = _use_improper = 0; _use_ewald = 0; _use_suffix = 0; _suffix = 0; _lj_types = 0; _ntypes = 0; _cutsq = 0.0; _cut_ljsq = 0.0; _lj_greensq = 0.0; _lj_innersq = 0.0; _lj_i = 0; _lj_ji = 0; _lj_k = 0; _lj_i0 = 0; _lj_i1 = 0; _lj_i2 = 0; _lj_i3 = 0; _lj_i4 = 0; _lj_i5 = 0; _lj_i6 = 0; _lj_i7 = 0; _lj_i8 = 0; _lj_i9 = 0; _lj_i10 = 0; _lj_i11 = 0; _lj_i12 = 0; _lj_i13 = 0; _lj_i14 = 0; _lj_i15 = 0; _lj_i16 = 0; _lj_i17 = 0; _lj_i18 = 0; _lj_i19 = 0; _lj_i20 = 0; _lj_i21 = 0; _lj_i22 = 0; _lj_i23 = 0; _lj_i24 = 0; _lj_i25 = 0; _lj_i26 = 0; _lj_i27 = 0; _lj_i28 = 0; _lj_i29 = 0; _lj_i30 = 0; _lj_i31 = 0; _lj_i32 = 0; _lj_i33 = 0; _lj_i34 = 0; _lj_i35 = 0; _lj_i36 = 0; _lj_i37 = 0; _lj_i38 = 0; _lj_i39 = 0; _lj_i40 = 0; _lj_i41 = 0; _lj_i42 = 0; _lj_i43 = 0; _lj_i44 = 0; _lj_i45 = 0; _lj_i46 = 0; _lj_i47 = 0; _lj_i48 = 0; _lj_i ==================================================================================================== /* * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #define TO_RANGE(mem) ((nv_device_memory)mem) #define TO_MEDIA(mem) ((nv_device_mem_info)mem) /* I915 MMIO DVM read-only attributes */ static uint64_t i915_rdonly_read(void *ptr, size_t size, size_t offset, uint32_t flags) { return ((uint64_t)ptr) + offset; } static uint64_t i915_rdonly_write(void *ptr, size_t size, size_t offset, uint32_t flags) { return ((uint64_t)ptr) + offset; } static uint64_t i915_rdonly_read_mask(void *ptr, size_t size, size_t offset, uint32_t flags, uint64_t *values) { uint64_t ret = 0; uint64_t dword; uint64_t mask = 0; /* Some drivers seem to need to enforce that all * bits are fetched in a register, even though most drivers * have a "only 8 bits to store" style of register mode * reads from a memory (e.g. setting the direct color space * in 16-bit linear memory). * * This means we can't do a lot of validation here as * do-while loops, and this can be reduced. For now we only * validate the complete register set against the entire * DMA range. */ do { /* magic values */ dword = i915_rdonly_read(ptr, size, offset, flags); if (dword == ~0ull || dword & mask) ret |= values[dword & ~mask]; offset += dwords & ~mask; } while (offset < size && ret < 1ULL); return ret; } static void i915_disable_flags(struct device *dev, uint32_t flags, uint32_t mask) { if (flags & (ATOM_PFLAG_PIGGY_MEMORY | ATOM_PFLAG_VRAM_CACHE_ACCESS | ATOM_PFLAG_PAGE_TABLE_ACCESS)) { if (mask) DRM_DEBUG_KMS("enable PFLAG_VRAM_CACHE_ACCESS %08x\n", mask); if (mask) DRM_DEBUG_KMS("enable PFLAG_PAGE_TABLE_ACCESS %08x\n", mask); if (mask) DRM_DEBUG_KMS("enable PFLAG_VRAM_CACHE_ACCESS_INV %08x\n", mask); if (mask) DRM_DEBUG_KMS("enable PFLAG_PAGE_TABLE_ACCESS_INV %08x\n", mask); } if (flags & (ATOM_PFLAG_ATOMMEM_ACCESS ==================================================================================================== /* This file is part of KCachegrind. Copyright (c) 2002-2016 Josef Weidendorfer KCachegrind 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. 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KNCACHEUTILS_H #define KNCACHEUTILS_H #include #include #include #include #include #include #include #include #include #include #include class CacheLookupUtils { public: explicit CacheLookupUtils(const QString &cacheDir); ~CacheLookupUtils(); const QString cacheDirectory() const { return _cacheDir; } const QString tempPath() const { return _tempPath; } // helpers QString getUsedDir(const QString &dir); bool readCacheFile(const QString &path, QString &baseName, bool exclusive = false); QString readCacheFile(const QString &path); QString getTempPath(const QString &baseName); QDomDocument createTempDocs(const QString &baseName, const QString &configFile); QString readTemporaryFile(const QString &dir); private: const QString _cacheDir; const QString _tempPath; QFile _cacheFile; QTextStream _cacheStream; QDir _dir; QString _subDir; QString _currentDir; KSharedConfig::Ptr _cfg; QFile _realFile; void readTemporaryFile(const QString &dir); void initCommonBuffer(KTemporaryFile *realfile); }; #endif // KNCACHEUTILS_H ==================================================================================================== /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: set ts=8 sts=2 et sw=2 tw=80: * * Copyright 2016 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef wasm_cpp_gc_HelperThreadState_h #define wasm_cpp_gc_HelperThreadState_h #include #include "jsfriendapi.h" #include "jsfriendapi-inl.h" namespace wasm { template class InlineTypedThing; template class InlineTypedThing { friend class InlineTypedThing; T element_; bool isMarked() const { return element_ == JS_GCCellPtr; } void setIsMarked() { element_ = JS_GCCellPtr; } public: MOZ_IMPLICIT InlineTypedThing(T element) : element_(element) {} bool isMarking() const { return isMarked(); } void setIsMarked() { isMarked_ = true; } T element() const { MOZ_ASSERT(isMarked()); return element_; } bool hasAnyUnmarkedElements() const { return !isMarked() && !is(); } T* unmarkedPointer() const { MOZ_ASSERT(isMarked()); return &element_; } void resetUnmarkedPointer(T* ptr) { MOZ_ASSERT(ptr == &element_); element_ = JS_GCCellPtr; } }; } // namespace wasm #endif // wasm_cpp_gc_HelperThreadState_h ==================================================================================================== /* Authors: Jakub Hrozek Copyright (C) 2013 Red Hat SSSD tests: Verify log cache 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 "util/util.h" #include "util/util_sss_idmap.h" #include "util/util_talloc.h" #include "util/util_sss_ccache.h" #include "providers/ldap/sdap_async.h" #include "providers/ipa/ipa_id.h" #include "providers/ipa/ipa_id.h" #include "providers/ipa/ipa_idmap.h" struct test_ctx { struct sss_idmap_ctx *idmap_ctx; struct sss_sec_ctx *sec_ctx; struct sss_domain_info *domain; }; static void sss_idmap_access_access(void *pvt) { struct test_ctx *ctx = talloc_get_type_abort(pvt, struct test_ctx); struct dp_option *opts; struct map_op_result res; int ret; opts = dp_opt_new_str(ctx, "IDMAP:objectclass"); if (!opts) { DEBUG(SSSDBG_OP_FAILURE, "dp_opt_new_str failed.\n"); ret = EINVAL; goto done; } ret = sss_idmap_create_access_opts(ctx->idmap_ctx, ctx->sec_ctx, opts, &ctx->domain, &ctx->idmap_ctx, &res); talloc_free(opts); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "sss_idmap_create_access_opts " "failed [%d]: %s.\n", ret, sss_strerror(ret)); goto done; } if (res != DP_OPT_OK) { DEBUG(SSSDBG_CRIT_FAILURE, "sdap_idmap_access_access failed.\n"); ret = EIO; goto done; } /* verify the access permissions */ ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 0, 0); if (ret != EOK) { goto done; } ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 1, 0); if (ret != EOK) { goto done; } ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 2, 0); if (ret != EOK) { goto done; } ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 3, 0); if (ret != EOK) { goto done; } ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 4, 0); if (ret != EOK) { goto done; } ret = map_access(ctx->idmap_ctx, ctx->sec_ctx, ctx->domain, "objectclass", DP_OPT_MAP_ACCESS, 5, 0); if (ret != EOK) { goto done; } ret = ==================================================================================================== /* * Copyright (c) 2013, 2020, 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 CPU_S390_OR1K_OR1D_INLINE_HPP #define CPU_S390_OR1K_OR1D_INLINE_HPP #include "asm/macroAssembler.inline.hpp" #include "runtime/prefetch.hpp" #include "runtime/prefetch.inline.hpp" #include "runtime/prefetchWithPrecise.inline.hpp" #include "runtime/prefetch_utilities.hpp" #include "runtime/atomic.hpp" #include "runtime/atomicVM.hpp" #include "runtime/prefetch.inline.hpp" #include "runtime/prefetchStreaming.inline.hpp" #include "runtime/prefetchStore.inline.hpp" #include "runtime/vm_version.hpp" // Constants // These will be included by PPC since they should not be used with CPU // thread. const int ReservedRegisterSize = 0; const int MaximumPrefetchCount = 10; const int LoadPrefetchMask = 0x0007; const int StorePrefetchMask = 0x0007; #define AND "\xb1" // A == 00 or A == 04 #define OR "\xb2" // A == 010 or A == 010 #define XOR "\xc2" // A == 010 or A == 020 #define ROL "\xc3" // A == 020 or A == 030 #define ROR "\xc4" // A == 030 or A == 040 #define RLALT "\xc5" // A == 040 or A == 060 #define RR "\xc6" // A == 060 or A == 070 #define LDL "\xc7" // A == 070 or A == 090 #define FLOAD "\xc8" // A == 090 or A == 0xb0 #define FSTORE "\xc9" // A == 090 or A == 0xb0 #define FJMP "\xca" // A == 090 or A == 0xb8 #define FCALL "\xcb" // A == 090 or A == 0xb0 #define FCALL_PARM "\xcc" // A == 090 or A == 0xb0 #define FCONV "\xcd" // A == 090 or A == 0xb0 #define FCONV_PARM "\xce" // A == 090 or A == 0xb0 #define FCNT "\xcf" // A == 090 or A == 0xb0 #define FDIV "\xd0" // A == 090 or A == 0xb0 #define FMUL "\xd1" // A == 090 or A == 0xb0 #define FMOVE "\xd2" // A == 090 or A == 0xb0 #define FNEG "\xd3" // A == 090 or A == 0xb0 #define FMULX "\xd4" // A == 090 or A == 0xb8 #define FMOVE_PARM "\xd5" // A == 090 or A == 0xb0 #define FLOADX "\xd6" // A == 090 or A == 0xb0 #define FSAVE "\xd7" // A == 090 or A == 0xb0 #define FDISCARD "\xd8" // A == 090 or ==================================================================================================== /* -*- c++ -*- ---------------------------------------------------------- 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. ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS PairStyle(ewald/dipole/atom,PairEwaldDipoleAtom) #else #ifndef LMP_PAIR_EWALD_DIPOLE_ATOM_H #define LMP_PAIR_EWALD_DIPOLE_ATOM_H #include "pair.h" namespace LAMMPS_NS { class PairEwaldDipoleAtom : public Pair { public: PairEwaldDipoleAtom(class LAMMPS *); virtual ~PairEwaldDipoleAtom(); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); void init_style(); double init_one(int, int); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); void write_data(FILE *); double single(int, int, int, int, double, double, double, double &); protected: double **cut_global; // [ns+1][n+1] = global cut-off double **epsilon; // [ns+1][m+1] = epsilon-box sub-box double **sigma; // [ns+1][m+1] = sigma-box sub-box double **sigmasq; // [ns+1][m+1] = sigma-box sub-box squared double **lj1; // [ns+1][m+1] = lj1 sub-box sub-box double **lj2; // [ns+1][m+1] = lj2 sub-box sub-box double **lj3; // [ns+1][m+1] = lj3 sub-box sub-box double **lj4; // [ns+1][m+1] = lj4 sub-box sub-box double **offset; // [ns+1][m+1] = offset sub-box sub-box double **m; // [ns+1][m+1] = mask sub-box sub-box double **offsetg; // [ns+1][m+1] = offset sub-box sub-box sub-box double **ljsw1; // [ns+1][m+1] = ljsw1 sub-box sub-box double **ljsw2; // [ns+1][m+1] = ljsw2 sub-box sub-box double **ljsw3; // [ns+1][m+1] = ljsw3 sub-box sub-box double **offsetg_all; // all of the offsets sub-box sub-box virtual void allocate(); }; } #endif #endif /* ERROR/WARNING messages: E: Insufficient memory on accelerator Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. */ ==================================================================================================== /* -*- 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 "vm/NativeObject-inl.h" #include "mozilla/DebugOnly.h" #include "jsapi.h" #include "builtin/DataViewObject.h" #include "builtin/TypedObjectConstants.h" #include "vm/JSCompartment.h" #include "vm/JSObject.h" using namespace js; bool DataViewObject::construct(JSContext* cx, JS::Handle newTarget, JS::Handle proto, JS::MutableHandle desc) { // Construct native object. RootedValue wrapped(cx, ObjectOrNullValue(this)); if (!newTarget) { newTarget = &wrapped; } else { newTarget = &wrapped.toObject(); } newTarget->setReservedSlot(TypedArrayObject::BUFFER_SLOT, JS::Int32Value(0)); // If proto is nullptr, then we must get the parent's proto. if (proto) { JSObject* proto = JS::GetParent(proto); if (proto) { proto = JS_GetParent(proto); } } // Create the prototype object and create the data view. if (!proto) { desc.object().set(js::ObjectValue(*newTarget)); proto = &desc.object().toObject(); } if (proto) { desc.value().setObject(*proto); } else { desc.value().setUndefined(); } return true; } bool DataViewObject::getOwnPropertySlot(JSContext* cx, JS::Handle wrapper, const JS::PropertyDescriptor& desc, JS::MutableHandle desc) { wrapper->as().getDataViewDescriptor(desc); return true; } bool DataViewObject::defineProperty(JSContext* cx, JS::Handle wrapper, const JS::PropertyDescriptor& desc, JS::Handle descToDefine) { wrapper->as().defineDataViewDescriptor(desc); return true; } bool DataViewObject::deleteProperty(JSContext* cx, JS::Handle wrapper, JS::Handle desc) { wrapper->as().deleteDataViewDescriptor(desc); return true; } bool DataViewObject::defineProperties(JSContext* cx, JS::Handle wrapper, const JS::PropertyDescriptor& desc, JS::MutableHandle props) { wrapper->as().defineDataViewDescriptors(desc, props); return true; } bool DataViewObject::deleteProperties(JSContext* cx, JS::Handle wrapper, JS::Handle props) { wrapper->as().deleteDataViewDescriptors(props); return true; } bool DataViewObject::defineProperties(JSContext* cx, JS::Handle wrapper, const JS::PropertySpec& spec) { return wrapper->as().defineDataViewProperties(spec); } bool DataViewObject::deleteProperties(JSContext* cx, JS::Handle wrapper, JS::Handle props) { return wrapper->as().deleteDataViewProperties(props); } // --------------------------- // |DataViewObject::ReceiverMap| // --------------------------- /* static */ const JSClass DataViewObject::ReceiverMap::class_ = { "DataView", JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE, &DataViewObject::finalize, 0, JS_NULL_CLASS_SPEC, &DataViewObject::undefineProperty_, &DataViewObject::defineProperty_, &DataViewObject::deleteProperty ==================================================================================================== /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** 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. ** ** BSD License Usage ** Alternatively, you may use this file under the terms of the BSD license ** as follows: ** ** "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 Qt Company Ltd 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef CODEEDITOR_H #define CODEEDITOR_H #include #include QT_BEGIN_NAMESPACE class CodeEditor : public QWidget { Q_OBJECT public: explicit CodeEditor(QWidget *parent = nullptr); public slots: void addCode(const QString &sourceCode); void addExample(const QString &sourceCode, const QString &fileContent, const QStringList &examples); private: struct Index { int source = -1; int fileContent = -1; QStringList examples; }; void updateExamples(Index index, const QString &sourceCode); private: void init(); void initWithExamples(Index index, const QString &sourceCode); void initWithFiles(Index index, const QString &sourceCode); void updateEditor(Index index); private: // widgets QWidget *m_editor; // the widgets QSplitter *m_splitter; // the index Index m_index; }; QT_END_NAMESPACE #endif ==================================================================================================== // Copyright 2014 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_SYNC_FILE_SYSTEM_DRIVE_SYNC_INFO_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_SYNC_INFO_H_ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "content/public/browser/file_system_access_monitor.h" #include "content/public/browser/web_contents_observer.h" #include "net/cert/x509_certificate.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" namespace content { class WebContents; } // The SyncInfo API is to maintain a separate state that should be considered // part of a different download sequence. // // |WebContentAllowed| is true if WebContentHostedURLRequests should allow // storing new data. // |WebContentAccessAllowed| is true if WebContentHostedURLRequests should // allow |web_contents| to access the cache. // // In the future, it may be useful to implement a user's request handling // scheme, such as old Chrome (with more than one folder, or multiple // folders and multiple content), in which case |WebContentAllowed| can // become false. In particular, it can become true even if we need to // resolve a server cert and path (for instance, it would not be possible // to request a login instead of using a key) for a user's request. // // Implementations should consider adding an entry in |SyncInfo| that is // not considered part of a different download sequence. // // If we don't add an entry in |SyncInfo| earlier, that would be a new // state that shouldn't be considered part of any previous download sequence. // If it was required in the future to allow a server certificate // or path, it could be handled here. // // This state can not be reset by the user, it's not required in a // same snapshot yet. If this is the case, we should update the // SyncInfo (i.e. update cached information, etc) to indicate it was // already in the current state and ensure there are no new data. class SyncInfo : public content::WebContentsObserver { public: // |file_system_access_monitor| is a weak pointer that owns the // SyncInfo objects, that are owned by the syncer (via the file_system). SyncInfo(content::WebContents* web_contents, net::CertChain::RequestInfo::GlobalRef cert_chain_info, syncer::FileReferenceTracker* file_system_access_monitor); ~SyncInfo() override; // syncer::FileReferenceTracker::Observer: void OnFileReferenceCreated(const syncer::FileReference& file_reference) override; void OnFileReferenceUpdated(const syncer::FileReference& file_reference) override; void OnFileReferenceDeleted(const syncer::FileReference& file_reference) override; private: const base::FilePath file_path_; // A weak pointer to a WebContents, owned by the SyncInfo objects. content::WebContents* web_contents_; // A weak pointer to a net::CertChain::RequestInfo object, owned by the SyncInfo // objects. net::CertChain::RequestInfo::GlobalRef cert_chain_info_; // The file system access monitor for this SyncInfo object. syncer::FileReferenceTracker* file_system_access_monitor_; DISALLOW_COPY_AND_ASSIGN(SyncInfo); }; #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_SYNC_INFO_H_ ==================================================================================================== #pragma once #include #include #include #include #include #include #include #include #include #include namespace DB { /** Type of rows in a table. * Join multiple rows into one. * To avoid mixing types we need to align them with other rows. */ template class AggregateDataSelector : public IDataTypes::InnerIterator { public: using NestedTable = std::pair; using Names = std::vector; using TableElements = std::vector; using values_type = T; public: using inner_iterator = AggregateDataSelector; public: using const_iterator = AggregateDataSelector; using iterator = typename InnerIterator::InnerIterator; using ConstAggregate = AggregateDataSelector; using ConstAggregateMutable = AggregateDataSelector; using index_iterator = AggregateDataSelector; using size_type = typename InnerIterator::size_type; using iterator_category = std::bidirectional_iterator_tag; using const_iterator_category = std::bidirectional_iterator_tag; using iterator_range = std::pair; using const_iterator_range = std::pair; using IColumn = DataTypes::IColumn; using UISchema = DataTypes::UIVirtualTable; using Source = IDataTypes::ConstantSource; using set_const_iterator = std::integral_constant; using remove_const_iterator = std::integral_constant; using flat_set = std::initializer_list; using fancy_allocator = std::allocator>; using AggregatedBlockInputStream = IDataTypes::AggregatedBlockInputStream; using AggregatedBlockOutputStream = IDataTypes::AggregatedBlockOutputStream; using AggregatedDataBlockInputStream = IDataTypes::AggregatedDataBlockInputStream; using AggregatedDataBlockOutputStream = IDataTypes::AggregatedDataBlockOutputStream; using AggregatedDataIndexStorageBlockInputStream = IDataTypes::AggregatedDataIndexStorageBlockInputStream; using AggregatedDataIndexStorageBlockOutputStream = IDataTypes::AggregatedDataIndexStorageBlockOutputStream; using AggregatedDataKeyColumn = IDataTypes::AggregatedDataKeyColumn; using AggregatedDataKeyColumnPtr = IDataTypes::AggregatedDataKeyColumnPtr; using AggregatedDataBlockInputStreamPtr = IDataTypes::AggregatedDataBlockInputStreamPtr; using AggregatedDataBlockOutputStreamPtr = IDataTypes::AggregatedDataBlockOutputStreamPtr; using AggregatedDataRowInputStreamPtr = IDataTypes::AggregatedDataRowInputStreamPtr; using AggregatedIndexValues = std::vector>; using FlatAggregate = FlatAggregate; using FlatAggregateConst = FlatAggregate; using FlatAggregateVolatile = FlatAggregate; using FlatAggregate; using FlatAggregatePtr = FlatAggregate; using FlatAggregateConstPtr = FlatAggregate; using FlatAggregateVectorPtr = FlatAggregate; using ConstAggregateFlatPtr = std::shared_ptr; using ConstAggregateFlatConstPtr = std::shared_ptr; using AggregatedBlockWithColumnsKey = std::unordered_map; using AggregatedBlockWithColumns ==================================================================================================== /* * Copyright (c) 2014, 2018, 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/g1/g1Arguments.inline.hpp" #include "gc/g1/g1ConcurrentMark.inline.hpp" #include "gc/g1/g1BiasedArray.inline.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1StringDedup.inline.hpp" #include "gc/g1/g1TypeArrayKlass.inline.hpp" #include "gc/g1/g1ThreadLocalAllocBuffer.inline.hpp" #include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1Thread.inline.hpp" #include "gc/g1/g1NUMA.inline.hpp" #include "gc/g1/g1RegionNodeList.inline.hpp" #include "gc/g1/g1ParNew.inline.hpp" #include "gc/g1/g1ParScanThreadState.inline.hpp" #include "gc/g1/g1ParScanThreadStateInfo.hpp" #include "gc/g1/g1UsePriorityQueue.inline.hpp" #include "gc/g1/g1Survens.inline.hpp" #include "gc/g1/g1ParNewRatioScanThreadState.inline.hpp" #include "gc/g1/g1ConcurrentMark.inline.hpp" #include "gc/g1/g1ConcurrentMarkThread.inline.hpp" #include "gc/g1/g1Arguments.hpp" #include "gc/g1/g1BarrierSetNMethod.inline.hpp" #include "gc/g1/g1BarrierSetNMethodData.inline.hpp" #include "gc/g1/g1BiasedArray.hpp" #include "gc/g1/g1ConcurrentMarkThread.inline.hpp" #include "gc/g1/g1ConcurrentMarkThreadData.inline.hpp" #include "gc/g1/g1HashCountedSet.hpp" #include "gc/g1/g1MarkFromRoots.inline.hpp" #include "gc/g1/g1ParNewRatioScanThreadState.inline.hpp" #include "gc/g1/g1MarkFromHeap.inline.hpp" #include "gc/g1/g1ConcurrentMarkThread.inline.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1ParNewRatioScanThreadState.inline.hpp" #include "gc/g1/g1ParNewPolicy.inline.hpp" #include "gc/g1/g1ParNewPolicyData.inline.hpp" #include "gc/g1/g1PrintGCSummary.inline.hpp" #include "gc/g1/g1PolicyCounters.inline.hpp" #include "gc/g1/g1PolicyCountersCollector.inline.hpp" #include "gc/g1/g1PolicyCountersDebug.hpp" #include "gc/g1/g1RemSetIterator.inline.hpp" #include "gc/g1/g1RefProcessor.hpp" #include "gc/g1/g1RefProcessorData.inline.hpp" ==================================================================================================== /* * gnote * * Copyright (C) 2017,2019 Aurimas Cernius * * 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 . */ #ifndef __SHARP_PREFERENCES_HPP_ #define __SHARP_PREFERENCES_HPP_ #include #include #include "sharp/string.hpp" #include "sharp/enums.hpp" namespace sharp { class Preferences { public: enum Type { DLAY, PLAY_IN, PLAY_OUT, NOTE, HFR, WND, SHARP, EVENT_AREA, SHOW_NOTE_BUTTON, SHOW_SCROLL_BAR, SHOW_ADD_NOTE_BUTTON, SHOW_MOVE_NOTE_BUTTON, SHOW_REMOVE_NOTE_BUTTON, MENU, DIR, HSCALE, VSCALE, FONT, APP_FONT, PREVIEW, LAST_TYPE }; struct Entry { Type type; Glib::ustring name; Glib::ustring color; float units; float spacing; Glib::VariantBase color_base; Glib::VariantBase color_scale; Glib::VariantBase border; Glib::VariantBase padding; float slider_size; float tick_size; float ruler_width; float ruler_height; float ruler_text_color; Glib::VariantBase gap_bg; Glib::VariantBase gap_fg; Glib::VariantBase color_fg; float line_thickness; float rubberband_border_thickness; float rubberband_line_width; float rubberband_line_color; float rubberband_line_width_minimum; Glib::VariantBase color_line; Glib::VariantBase color_line_color; float line_width; float minor_tick_size; Glib::VariantBase minor_tick_size_minimum; Glib::VariantBase minor_tick_size_text; Glib::VariantBase minor_tick_size_text_color; float minor_tick_size_style; float minor_tick_size_style_color; float minor_tick_size_font_size; Glib::VariantBase minor_tick_size_text_color; float minor_tick_size_alignment; float minor_tick_size_style_alignment; float minor_tick_size_font_size; Glib::VariantBase minor_tick_size_text_alignment; float minor_tick_size_align; float minor_tick_size_baseline_offset; Glib::VariantBase minor_tick_size_base_offset; float minor_tick_size_text_baseline_offset; float minor_tick_size_justify; float minor_tick_size_justify_offset; float minor_tick_size_font_size_base_offset; float minor_tick_size_text_font_size_base_offset; float minor_tick_size_baseline_offset_text_offset; float minor_tick_size_offset_text_offset_min; float minor_tick_size_offset_text_offset_base_offset; float minor_tick_size_baseline_offset_baseline_offset_text_offset; float minor_tick_size_offset_baseline_offset_text_offset_max; float minor ==================================================================================================== /* * Copyright (C) 2017-2018 Rob Clark * * 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. * * Authors: * Rob Clark */ #include "util/ralloc.h" #include "util/ralloc-util.h" void *ralloc_free(void *mem) { if (!mem) return NULL; return (void *)mem; } void ralloc_xfree(void *mem) { free(mem); } void *ralloc_memset(void *mem, int c, size_t size) { /* Generic memset() only with mask size */ if (size > 0) { void *a = mem; for (; a; a = (void *)mem) { int c = *(int *)a; if (c & (c - 1)) c = ~c; c |= c << size; } } mem = memset(mem, c, size); return mem; } void *ralloc_memcpy(void *mem, const void *a, size_t size) { /* Generic memcpy() only with mask size */ if (size > 0) { void *b = mem; for (; b; b = (void *)mem) { int a = *(int *)a; if (a & (a - 1)) a = ~a; memcpy(b, a, size); } } return memcpy(mem, a, size); } void ralloc_memmove(void *mem, const void *a, size_t size) { /* Generic memmove() only with mask size */ if (size > 0) { void *b = mem; for (; b; b = (void *)mem) { int a = *(int *)a; if (a & (a - 1)) a = ~a; memmove(b, a, size); } } return memmove(mem, a, size); } void ralloc_memsetn(void *mem, int c, size_t count) { /* Generic memsetn() only with mask size */ if (count > 0) { void *b = mem; for (; b; b = (void *)mem) { int a = *(int *)a; if (a & (a - 1)) a = ~a; memset(b, c, count); } } } static void ralloc_force_poison(void *mem, size_t sz) { if (sz > 0) memset(mem, 0, sz); } void *ralloc_realloc(void *mem, size_t size) { /* Copy memory if requested to avoid panic */ if (size > 0) { void *b = ralloc_malloc(mem, size); if (!b) return mem; memcpy(b, mem, size); ralloc_force_poison(b, size); mem = b; ==================================================================================================== /* { dg-options "-O3 -fpic -mpower9-vector -Wno-psabi" } */ /* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target p9vector_hw } */ #define NO_WARN_X86_INTRINSICS 1 #ifndef CHECK_H #define CHECK_H "mmx-check.h" #endif #ifndef TEST #define TEST mmx_test #endif #include CHECK_H #include static __m64 __attribute__((noinline, unused)) test (__m64 X) { return _mm_cvtt_roundpi64_ss (X, _MM_FROUND_NO_EXC); } static void TEST (void) { __m64_union u; double e[4] = {0.0}; int i; u.as_m64 = _mm_set_ss (1.0, 2.0); for (i = 0; i < 4; i++) e[i] = 0.0; test (u.as_m64); } ==================================================================================================== #include #include "esymbol.h" #include "gdbtypes.h" #include "symtab.h" #include "linemap.h" #include "completer.h" static struct symbol_read_iterator *syms; static int nsyms; /* Scan the shared symbol list and delete the associated strings. Returns 1 for success, zero for error. */ static int symbol_read_iterator_next (struct symbol_read_iterator *it) { /* Only want symbols that we need. */ if (it->sym != NULL) return 0; /* Otherwise we want the first symbol. */ it->sym = syms; syms = it; return 1; } /* Scan the shared symbol list and delete the associated strings. Returns 1 for success, zero for error. */ static int symbol_read_iterator_prev (struct symbol_read_iterator *it) { struct symbol *s; /* If this symbol was not in the list. */ if (it->sym == NULL) return 0; s = it->sym; it->sym = it->sym->next; /* Remove it from the list. */ it->sym = NULL; if (syms == it) syms = it->next; if (syms == it) syms = it->prev; return 1; } /* Callback function for printing symbol info. */ static void symbol_print_symbol_info (struct symtab *symtab, const char *string, const struct block *block, void *arg) { struct symbol_info *si; char *output; output = xstrprintf ("Symbol: %s info: %s", symtab_to_shortname (symtab), string); gdb::unique_xmalloc_ptr name = target_encode_filename (block, symtab, string, NULL); si = symbol_find_or_make_symbol_info (string, block, name.get ()); if (si != NULL) { if (symbol_is_block_comment_end (si)) { /* Print the comment (required by redisplay.c:if_symbol_p). */ const char *end_name = strstr (string, "end of block"); if (end_name != NULL) end_name = strchr (end_name + 1, '"'); if (end_name != NULL) end_name++; printf_filtered (_(" %s: \"%s\" (Start: %s)"), symtabs_to_shortname (symtab), string, string); } else if (symbol_is_block_end (si)) printf_filtered (_(" %s: \"%s\" (End: %s)"), symtabs_to_shortname (symtab), string, string); } if (si != NULL && (si->flags & SYMBOL_VALID)) { if (symbol_is_block_comment_end (si)) printf_filtered (_(" (End of block)")); else printf_filtered (_(" (End of %s)")); } printf_filtered ("\n"); } /* Callback function for printing symbol values. */ static void symbol_print_symbol_values (struct symtab *symtab, const char *string, const struct block *block, void *arg) { /* No need for strings printed for blocks or functions. */ gdb::unique_xmalloc_ptr name = target_encode_filename (block, symtab, string, NULL); printf_filtered (_("Symbol: %s info: %s"), symtab_to_shortname (symtab), string); gdb::unique_xmalloc_ptr value = target_encode_addr (symbol_get_address (si)); if (symbol_is_block_end (si)) printf_filtered (_(" (End of block)")); else printf_filtered (_(" (End of %s)")); if (symbol_is_block_end (si)) printf_filtered (_(" (Start of block)")); else printf_filtered (_(" (Start of %s)")); ==================================================================================================== /**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** 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. ** ****************************************************************************/ #pragma once #include #include #include namespace clang { namespace diagnostics { class FileId { friend class FileIdEscapace; FilePathId m_filePathId; std::string m_filePathIdCStr; public: FileId(); explicit FileId(FilePathId filePathId); FilePathId filePathId() const { return m_filePathId; } bool isNull() const { return m_filePathId.isEmpty(); } bool operator==(const FileId &other) const { return m_filePathId == other.m_filePathId; } bool operator!=(const FileId &other) const { return m_filePathId != other.m_filePathId; } FileId &operator=(const FileId &other) { m_filePathId = other.m_filePathId; return *this; } bool isPrivate() const { return m_filePathId.isEmpty() || std::equal(m_filePathIdCStr.c_str(), other.m_filePathIdCStr.c_str()); } void setPrivate(bool on) { m_filePathId = on ? FilePathId() : FilePathId(filePathId()); } }; } // namespace diagnostics } // namespace clang ==================================================================================================== /* * Copyright (c) 2009 * Juergen Perlinger (juergen.perlinger@gmx.de) * Copyright (c) 2011 Jan Hambrecht (jan Hambrecht@web.de) * * 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 REVIVEPROVIDER_H #define REVIVEPROVIDER_H #include #include #include "core/WindowShowEvent.h" #include #include #include class Shape; class ShapeManager; class QModelIndex; class ReveStrategy : public QObject { Q_OBJECT public: explicit ReveStrategy(QWidget *parent = nullptr); ~ReveStrategy() override; int index() const; bool seek(int p); const Shape * shape() const; void setCurrentShape(const Shape *shape); const QList & shapes() const; // Check/catch lock, system and sample. void signalShowToolChanged(bool isShow, bool samples, double currentTime); Q_SIGNALS: void triggerShowToolChanged(bool isShow, bool samples, double currentTime); void triggerShowToolLockChanged(bool isShow, bool samples, double currentTime); private Q_SLOTS: void getVisibleRows(QList shapes, int viewIndex, bool update = false); void updateZoomGroup(int column); void updateCurrentShape(int row); void updateZoomIcon(); void setCurrentShape(const Shape *shape); void filterClicked(); void showShape(); void unblockTimer(); void startThreads(); private: void setupProgressBar(); void setupShorter(); void setupButton(); void setupShapeGroup(); void setupTableView(); void setupScrollBar(); void setupCharts(); void setupShapes(); void setupTableView(); void setupTableHeader(); void setupTableGrid(); void setupTableHeaderGroup(); void setupTableGridGroup(); void setupCornerGrid(); void setupTableColumnGroup(); void setupTableColumnGroupHeader(); void setupTableColumnGroupHeaderGroup(); void setupTableGridGroupHeader(); void setupTableGridGroupHeaderGroup(); void setupCornerGridGroup(); void setupCornerGridGroupHeader(); void setupCornerGridGroupHeaderGroup(); void setupTableHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroup(); void setupTableGridGroupHeaderGroup(); void setupCornerGridGroupHeaderGroup(); void setupCornerGridGroupHeaderGroup(); void setupVerticalHeaderGroup(); void setupTableHeaderGroup(); void setupTableHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroup(); void setupTableRowGroup(); void setupTableGroup(); void setupTableGroupHeader(); void setupTableGroupHeaderGroup(); void setupTableHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroup(); void setupTableRowGroup(); void setupTableRowGroupHeader(); void setupTableRowGroupHeaderGroup(); void setupTableRowGroupHeaderGroup(); void setupVerticalHeaderGroupHeaderGroup(); void setupTableHeaderGroupHeaderGroup(); void setupTableHeaderGroupHeaderGroup(); void setupTableHeaderGroupHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroupHeaderGroup(); void setupTableHeaderGroupHeaderGroupHeaderGroup(); void setupTableHeaderGroupHeaderGroupHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroupHeaderGroupHeader(); void setupTableHeaderGroupHeaderGroup ==================================================================================================== // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Benoit Jacob // Copyright (C) 2008-2014 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/. #include "main.h" #include template void saddTensor(Tensor &m) { for(Index i = 0; i < m.rows(); i++) { for(Index j = 0; j < m.cols(); j++) { T sum = 0; for(typename Tensor::ScalarUIndU m = 0; m < m.size(); m++) { T a = m.coeff(m); T b = m.coeff(m + 1); sum += a * (a + b) * (a + b + 1) - b * (a + b + 1) * a * a + b * b * a + b * b * b * a + b * b * b * b + a * b * b * b - a * a * b * b + b * b * b * a) + 1; } m(i,j) = sum; } } } int main() { Tensor t; std::cout << "Filling tensor with given values..." << std::endl; saddTensor(t); std::cout << "Filling tensor and values..." << std::endl; t(3,1) = 1; std::cout << "Filling tensor with specified values..." << std::endl; saddTensor(t); return 0; } ==================================================================================================== // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMEOS_SERVICES_MULTIDEVICE_SETUP_ERROR_PAGE_CONTROLLER_H_ #define CHROMEOS_SERVICES_MULTIDEVICE_SETUP_ERROR_PAGE_CONTROLLER_H_ #include #include "base/callback.h" #include "base/component_export.h" #include "base/macros.h" #include "chromeos/services/multidevice_setup/public/cpp/multidevice_setup_constants.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup_errors.mojom.h" namespace chromeos { namespace multidevice_setup { // Controller of a device error page, used for error pages in tests. class COMPONENT_EXPORT(CHROMEOS_SERVICES) ErrorPageController { public: // Called when an error page is added. This might be called multiple times to // set the status. using AddPageCallback = base::OnceCallback; using AddErrorPageCallback = base::OnceCallback; using AddPageErrorCallback = base::RepeatingCallback; using SetStatusCallback = base::RepeatingCallback; virtual ~ErrorPageController() {} // Called to get the status of an error page. If |success| is not null, an // error page may not have status information available (and would have // not be set). virtual multidevice_setup::mojom::PageErrorPageResult GetPageError( const multidevice_setup::mojom::PageErrorPageResult& page_error) = 0; virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorWithStatus( multidevice_setup::mojom::PageErrorPageResult page_error) = 0; // Called to get the set of page errors. virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrors() = 0; virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorsWithStatus( multidevice_setup::mojom::PageErrorPageResult page_error) = 0; virtual void OnAddPageDone(AddPageCallback callback) = 0; virtual void OnAddPageError(AddErrorPageCallback callback) = 0; virtual void OnAddPageErrorWithStatus(AddErrorPageCallback callback, multidevice_setup::mojom::PageErrorPageResult page_error) = 0; // Gets the result of this page. virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorResult() = 0; virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorResultWithStatus( multidevice_setup::mojom::PageErrorPageResult page_error) = 0; // Gets the set of page errors. virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorsResult() = 0; virtual multidevice_setup::mojom::PageErrorPageResult GetPageErrorsResultWithStatus( multidevice_setup::mojom::PageErrorPageResult page_error) = 0; virtual void OnPageReady() = 0; // Callback to be invoked when a page is ready. using PageReadyCallback = base::OnceCallback; virtual void OnPageReadyWithStatus(const multidevice_setup::mojom::PageErrorPageResult& page_error, multidevice_setup::mojom::PageErrorPageResult page_error_with_status, PageReadyCallback callback) = 0; virtual void OnErrorPageReady(const multidevice_setup::mojom::PageErrorPageResult& page_error, multidevice_setup::mojom::PageErrorPageResult page_error_with_status, multidevice_setup::mojom::PageErrorPageResult page_error_result) ==================================================================================================== // 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 CHROME_BROWSER_UI_VIEWS_TAB_STRIP_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_TAB_STRIP_VIEW_H_ #include "chrome/browser/ui/views/tab_strip.h" #include "ui/views/view.h" // A TabStripView is a view that shows its tips and closes when the user moves // the tab. It allows to subscribe or hide the tips, but it can only be // closed when the TabStrip becomes disclosed. class TabStripView : public views::View { public: // Returns the TabStrip view as a delegate. static TabStripView* Get(views::View* view); TabStripView(); ~TabStripView() override; // Returns true if the tab strip is currently being closed. bool IsClosing() const { return closing_; } // views::View: gfx::Size CalculatePreferredSize() const override; void Layout() override; views::Widget* GetWidget() override; private: // Closes the TabStrip if the user dismisses the tabstrip. void Close(); views::Widget* widget_; TabStrip::CloseReason close_reason_ = TabStrip::CloseReason::kOther; bool closing_ = false; DISALLOW_COPY_AND_ASSIGN(TabStripView); }; #endif // CHROME_BROWSER_UI_VIEWS_TAB_STRIP_VIEW_H_ ==================================================================================================== // 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_DRIVER_SYNC_DRIVER_UMA_H_ #define COMPONENTS_SYNC_DRIVER_SYNC_DRIVER_UMA_H_ #include #include #include "base/callback.h" #include "base/containers/flat_map.h" #include "base/macros.h" #include "base/observer_list.h" #include "components/sync/driver/sync_driver_interface.h" #include "components/sync/driver/sync_driver_observer.h" #include "components/sync/driver/sync_driver_types.h" class Profile; namespace syncer { class DeviceEventSynchronizer; class DeviceEventTestHelper; class DeviceEventDriverBinder; class DeviceEventTracker; class DeviceEventObserver; // This is a helper object that converts sync event for which SyncEvent is enabled // to the corresponding device event. class SyncDriverUMA : public SyncDriverInterface, public SyncDriverObserver { public: SyncDriverUMA(); ~SyncDriverUMA() override; // SyncDriverInterface implementation. void Initialize() override; void InitializeWithPrefSerializer(PrefSerializer* pref_serializer) override; void SetTestNoTestFilter(bool no_test_filter) override; void AddObserver(SyncDriverObserver* observer) override; void RemoveObserver(SyncDriverObserver* observer) override; void AddDeviceEventObserver(DeviceEventObserver* observer) override; void RemoveDeviceEventObserver(DeviceEventObserver* observer) override; void AddObserver( const device_event::DeviceEventID& event_id, device_event::DeviceEventObserver::DeviceEventCompletedCallback callback) override; void RemoveObserver( const device_event::DeviceEventID& event_id, device_event::DeviceEventObserver::DeviceEventCompletedCallback callback) override; // SyncDriverObserver implementation. void OnActiveSourceChanged(SyncedMediaSource* source) override; void OnDeviceEvent(const device_event::DeviceEventID& event_id, SyncedDeviceEventResult result) override; void OnWillApplySync(const device_event::DeviceEventID& event_id, bool apply) override; void OnChangedDevicesReady() override; void OnUnmappedDeviceChanged( const device_event::DeviceEventID& event_id, std::vector devices) override; void OnDeviceReset(const device_event::DeviceEventID& event_id) override; // Creates a temporary file for a unique device event. static void CreateUniqueDeviceIdEvent( const device_event::DeviceEventID& event_id, std::unique_ptr& event); // Creates a unique id for a device event. static void CreateUniqueIdEvent( const device_event::DeviceEventID& event_id, std::unique_ptr& event); // Returns the current unique id. static device_event::DeviceEventID GetCurrentUniqueId(); // Returns a mapping of all devices that have the sync event enabled. static std::map GetDevices(); // Returns a mapping of all devices that are about to be synced to the app. static std::map GetLocalDevices(); // Called when device sync starts. void OnStartingDeviceSync(); // Handles deferred device events. void HandleDeferredDeviceEvents(const device_event::DeviceEventID& event_id); // Returns true if all devices are registered with the SyncDriver. bool HasDevices() const; // Returns a string of all device events found for the sync and the app, // if any. std::string GetDeviceEventsName(const device_event::DeviceEventID& event_id); // Returns true if a device's backing device is installed. bool HasBackingDevice(const device_event:: ==================================================================================================== #ifndef _ELM_GRID_EO_H_ #define _ELM_GRID_EO_H_ #ifndef _ELM_GRID_EO_CLASS_TYPE #define _ELM_GRID_EO_CLASS_TYPE typedef Eo Elm_Grid; #endif #ifndef _ELM_GRID_EO_TYPES #define _ELM_GRID_EO_TYPES #endif /** * @brief Grid Eet class * * @ingroup Elm_Grid_Group */ #define ELM_GRID_CLASS elm_grid_class_get() EWAPI const Efl_Class *elm_grid_class_get(void) EINA_CONST; /** * @brief Grid Grid object * * This object represents a grid. * * @ingroup Elm_Grid_Group */ #define ELM_GRID_CLASS_NAME "Elm_Grid" #define ELM_GRID_OPS elm_grid_ops EWAPI const Efl_Class *elm_grid_class_get(void) EINA_CONST; /** * @brief Sets the grid type * * @param[in] obj The object. * @param[in] type The grid type. * * @ingroup Elm_Grid_Group */ EOAPI void elm_obj_grid_type_set(Eo *obj, Elm_Grid_Type type); /** * @brief Get the grid type * * @return The grid type * * @ingroup Elm_Grid_Group */ EOAPI Elm_Grid_Type elm_obj_grid_type_get(const Eo *obj); #endif ==================================================================================================== // SuperTuxKart - a fun racing game with go-kart // Copyright (C) 2009-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. #ifndef HEADER_INTEREST_HPP #define HEADER_INTEREST_HPP #include #include #include #include "utils/noncopyable.hpp" class SPNode; class Path; /** This class provides access to the interndenneh of a small model. It is used as an iterator for simple state queries. It supports the steps to be taken, walking, finding, querying, and the last step with known goal. */ class Interest { private: std::vector m_nodes; /** Interaction based on the current state and the information * of the path. * @param node Node containing the path to which the node belongs * @param goal Node being reached. */ bool resultNode(SPNode* node, Node* goal); bool resultNode(SPNode* node, const NodePath& path, const Node* goal); /** Default helper. * @param path node at which to test. */ bool resultNodePath(const NodePath& path, const Node* goal); /** Constructor. * @param node Node to determine the state of. */ Interest(SPNode* node); /** Check if the node at \p path has all its reachabilities assigned * and mark it as visited. */ bool haveReachabilities(const NodePath& path); /** Check if the node at \p path is reachable. */ bool isreachable(const NodePath& path); /** Get the last path to node at \p node (but not necessarily going towards). */ const NodePath getLastPath(const Node* node) const; /** Get the last path to node at \p node (but not necessarily going towards). */ const NodePath getLastPath(const NodePath& path) const; /** Get the last path to node at \p node (but not necessarily going towards). */ NodePath getLastPath(Node* node); public: /** Default constructor. This uses a naive implementation of * the \p getGoal method for finding a goal, returning a null * NodePath if there is no goal. */ Interest(); /** Destructor */ ~Interest(); /** Get the value of the active (real) flag of a node. * The value is between 0 and 1 if the node is a leaf node and is * reachable, or 1 if the node is a leaf node and is not reached. */ int getActivityFlag(const Node* node); /** Get the value of the leaf node index of a node. * The value is between 0 and 1 if the node is a leaf node and is * reachable, or 1 if the node is a leaf node and is not reached. */ int getLeafNodeIndex(const Node* node); /** Get the value of the last active (real) flag of a node. * The value is between 0 and 1 if the node is a leaf node and is * reachable, or 1 if the node is a leaf node and is not reached. */ int getLastActiveFlag(const Node* node); /** Get the value of the last active (real) flag of a node. * The value is between 0 and 1 if the node is a leaf node and is * reachable, or 1 if the node is ==================================================================================================== // Created on: 1992-05-28 // Created by: Gilles DEBARBOUILLE // Copyright (c) 1992-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. #ifndef _BOPAlgo_Algo_HeaderFile #define _BOPAlgo_Algo_HeaderFile #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 ==================================================================================================== #ifndef __FONTVIEW_H__ #define __FONTVIEW_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include class GG::Rect; namespace GG { class Context; class InputText; class PushButton; class DropDownList; class SetBrowseModeIcon; enum { SELECT_TOOLTIP, DRAGDROP, NUM_DROPDOWNS }; //! \name FontSelector widget //! \{ class FontSelector : public GG::Wnd { public: FontSelector(const std::string& font, const std::string& text, bool use_mousewheel = false); ~FontSelector(); void CompleteConstruction() override; //! Sets the currently selected font void SetFont(const std::string& font); //! Sets the text in the selected font void SetFont(const std::string& font, const std::string& text); //! Sets the text in the selected font void SetText(const std::string& font, const std::string& text); //! Gets the currently selected font std::string GetFont() const { return font_; } //! Gets the text in the selected font std::string GetText() const { return text_; } //! If browsing over a text node, selects the specified font. Returns false if not set. //! \param[in] text Text for which to select font //! \return true if selected font is valid, false if not //! //! \todo Setting the font to the closest available font doesn't do it, there's //! little more that way... bool GetBestFont(const std::string& text); //! Sets the font to use, possibly recalculating any style. In case of down //! arrow, the down arrow is the reverse foreground in the normal style (normal style and //! bold style are chosen above), and the unselected font will still use the same text void UseFont(const std::string& font); //! Sets the text in the selected font (or down arrow in case of simple text) void SetFont(const std::string& font, const std::string& text); //! Sets the text in the selected font void SetText(const std::string& font, const std::string& text); //! Sets the background and text of the selected font. //! \param[in] background Background color of font //! \param[in] text Text of selected font void SetBgText(const std::string& background, const std::string& text); //! Returns the currently selected font std::string GetBgText() const { return bg_text_; } //! Returns the background color of font. //! \param[out] background Background color of font. //! \param[out] text Text of selected font. void GetBgText(std::string& background, std::string& text) const; //! Updates the font setting to the default color. void SetFont(const std::string& font); //! Returns the currently selected font std::string GetFont() const; //! Updates the font setting to the default color. //! \param[in] color Background color of font //! \param[in] text Text of selected font void SetFgText(const std::string& color, const std::string& text); //! Updates the background color of the selected font (if any) void SetBgColor(const std::string& color); //! Returns the currently selected font std::string GetFgColor() const; //! Updates the background color of the selected font //! \param[in] color Background color of font void SetFgTextColor(const std::string& color); //! Updates the font setting to ==================================================================================================== /* * Copyright (C) 2011 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 "sf_fs_prerequisites.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" #include "fat.h" #include "fat_reader.h" #include "fat_writer.h" #include "boot.h" #include "dir_iter.h" #include "list.h" #include "plist.h" #include "fs_ops.h" #include "verity.h" #include "badblocks.h" #include "sideinfo.h" #include "fat_label.h" #include "fat_pt.h" #include "list_inode.h" // For directories #define DIR_MASK 0x07 #define DIRENT_MASK 0x78 #define DIRENT_TAIL 8 #define DIRENT_SIZE 4 #define DIRENT_GEN 2 #define DIRENT_SYNC 1 #define DIRENT_INLINE ((DIRENT_SIZE - 1) * 8) #define DIR_SUBNAME_SIZE 256 // Block Number #define BLOCK_NUM 0 #define BLOCK_DELTA 0xFFFF #define BLOCK_SIZE 0x10000 #define BLOCK_FLAG_ONLY 0x40000000 #define BLOCK_FLAG_DEDUP 0x80000000 #define BLOCK_FLAG_FAKE 0x80000000 // Version #define FAT_V000 0x000 // UDF V000 #define FAT_V001 0x001 // UDF V001 #define FAT_V002 0x002 // UDF V002 #define FAT_V003 0x003 // UDF V003 #define FAT_V004 0x004 // UDF V004 #define FAT_V005 0x005 // UDF V005 #define FAT_V010 0x010 // UDF V010 #define FAT_V011 0x011 // UDF V011 #define FAT_V012 0x012 // UDF V012 #define FAT_V013 0x013 // UDF V013 #define FAT_V014 0x014 // UDF V014 #define FAT_V015 0x015 // UDF V015 #define FAT_V020 0x020 // UDF V020 #define FAT_V021 0x021 // UDF V021 #define FAT_V022 0x022 ==================================================================================================== // RUN: %clang_cc1 -fsyntax-only %s -std=c++1y -verify -fsyntax-only // expected-no-diagnostics struct X { int x; }; template void g(X::x); // expected-note 2 {{declared here}} template void f(X::x) { g(); } // expected-note {{declared here}} template struct Y { X x; }; template void h(Y::x); // expected-note {{declared here}} template void h(Y::y); // expected-note {{declared here}} template struct Z { X x; }; template void i(Z::x); // expected-note 2 {{declared here}} template void i(Z::y); // expected-note {{declared here}} template struct X { Y y; }; template void j(X::y); // expected-note 2 {{declared here}} template void j(Y); // expected-note {{declared here}} template struct Y { Z z; }; template void k(Y); // expected-note {{declared here}} template void k(Z); // expected-note {{declared here}} template struct Z { X x; }; template void l(Z); // expected-note {{declared here}} template void l(X); // expected-note {{declared here}} template struct X { Y y; }; template void m(X); // expected-note {{declared here}} template void m(Y); // expected-note {{declared here}} template struct Y { Z z; }; template void n(Y); // expected-note {{declared here}} template void n(Z); // expected-note {{declared here}} void q(void); // expected-error {{a non-template type name or template parameter is not a record type, not a specialization of a class template}} template struct V; // expected-note{{declared here}} template struct W; // expected-note{{declared here}} template struct V : public T { using T::t; }; template struct W : public T::t {}; template struct T0 { constexpr T0() = default; }; template struct T1 { constexpr T1() = delete; }; template struct T2 { constexpr T2() = delete; }; template struct T3 { constexpr T3() = default; constexpr T3(const T3 &) = delete; }; template struct T4 { constexpr T4() = delete; constexpr T4(T4 &) = default; }; template struct T5 { constexpr T5() = default; constexpr T5(T5 &) = delete; constexpr T5(T4 &) = delete; }; template struct T6 { constexpr T6() = delete; constexpr T6(T4 &) = delete; constexpr T6(T3 &) = default; constexpr T6(T2 &) = default; constexpr T6(T) = default; constexpr T6(T) = delete; }; template struct U0 { T t = 0; U0() : t(0) {} U0(T t_) : t(t_) {} }; template struct U1 { T t = 0; U1() : t(0) {} U1(T t_) : t(t_) {} U1(U1 t_) : t(t_) {} }; template struct U2 { U1 t = 0; U2() : t(0) {} U2(T t_) : t(t_) {} U2( ==================================================================================================== // 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 COMPONENTS_UPDATE_CLIENT_CONFIGURABLE_UPDATE_MODEL_LOADER_H_ #define COMPONENTS_UPDATE_CLIENT_CONFIGURABLE_UPDATE_MODEL_LOADER_H_ #include #include #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/optional.h" #include "base/strings/string16.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_service.h" #include "components/update_client/prefs_collection_prefs.h" class PrefService; namespace update_client { class ConfigurabilityData; // Handles registration of a // [UpdateClientConfigurabilityRegistry] for an app. It is used as the key to // access app and not as a key to fetch and update app state. This class // keeps track of preferences for a particular |app_id|. The registry will // get cached prefs and used to find cached data. class UpdateModelLoader : public KeyedService { public: using AppId = std::string; using KeyType = const std::string; using ListChangedCallback = base::OnceCallback; using GetPreferenceCallback = base::RepeatingCallback( const char* app_id, AppId pref_name, const std::string& pref_value, bool custom); // Enumerates all preference ids in |pref_info| that are not in |ignore| // and updates them if |filter_expired| is true. Returns true if any // preference id in |pref_info| matches |filter_name|. bool FilteringExpired(const char* pref_info, const char* filter_name, bool filter_expired, const std::string& pref_name); // Convenience function that returns the matching pref id in |pref_info| // by doing a case-insensitive comparison. If |ignore| is true, ignore and // return the one whose name matches the pref_name. bool IsAppPref(const char* pref_info, const char* filter_name, bool ignore, const std::string& pref_name); // Try and return a pref matching |pref_name| and |value|. If |use_legacy| is // true, it returns legacy value, otherwise it returns an id string. std::string GetPrefByName(const char* pref_name, const char* value, bool use_legacy, bool deprecated); // Called when a new configurability data is loaded from file, or when // `configurability_data` data is loaded. Note that it can be called on // any thread. void OnConfiguredAppConfiguredAppPrefChanged( const char* app_id, AppId pref_name, const std::string& pref_value, bool is_changed, bool should_reparse, bool is_user_initiated, bool is_features_initiated, bool is_feature_unhandled, bool should_reparse); // Called when a new configurability data is loaded from local data. This // is called on any thread, so it can only be called on the main // thread. void OnConfiguredAppConfiguredAppPrefUpdated( const char* app_id, AppId pref_name, const std::string& pref_value, bool is_changed, bool should_reparse); // Called when an updated feature is added or deleted. void OnUpdateFeaturePrefChanged(const char* app_id, AppId pref_name, const std::string& pref_value, bool is_changed, bool should_reparse); // Called when a new preference data is loaded from file. void OnPrefLoaded(const char* ==================================================================================================== /* 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/debug.h" #include "common/str.h" #include "common/endian.h" #include "common/textconsole.h" #include "common/str-array.h" #include "common/util.h" #include "common/textconsole.h" #include "audio/audiostream.h" #include "audio/mixer.h" #include "audio/decoders/pcm.h" #include "audio/decoders/vorbis.h" #include "audio/decoders/vorbis_file.h" #include "audio/mididrv.h" #include "engines/util.h" #include "gob/gob.h" #include "gob/sound/sound.h" #include "engines/util.h" #include "engines/util_decoder.h" #include "image/convertTo.h" namespace Gob { #define MAX_TEMP_CHAR (14) /* ParamID Number of required parameters for decoding on a multi-dimension field of a field as used on the speech data for the whole data source. A param_id is derived from these values: */ enum { MAGIC = 0x524C5344, SEQUENCE_ID = 0x4C504348, SEQUENCE_DATA = 0x00000004, SEQUENCE_DATA_SIZE = 20 }; enum { PARAM_ID_SEQ = MKTAG('S', 'M', 'C', 'A') // 0x72FA0132 }; enum { PARAM_ID_CONST = MKTAG('C', 'H', 'S', 'T') // 0x73008320 }; enum { PARAM_ID_NAME = MKTAG('N', 'A', 'M', 'D') // 0x7B25A311 }; struct _SoundResource { byte sequence; byte parameter; byte data_size; byte data[20]; }; struct _CompressedSongRecord { Common::String _name; byte offset; byte data_size; uint16 _dataSize; byte *data; Common::String _file; }; /* * This class is used by Music on the CD which * is used by the MIDI CD player. It is compiled as an engine * module and registered as a music module (synthesizer), * then redefined to be a real CD player module. */ typedef Common::HashMap #include #include #include #include #include #include #include "OCGroup.h" #include "OCInfo.h" #include "Stats.h" #include "StatsOptions.h" struct TimeVal { double time; char buf[GPATH_MAX]; }; static void D(struct TimeVal *av, double t) { char buf[GPATH_MAX]; buf[0] = '\0'; G_chop(buf); snprintf(buf, sizeof(buf), "%lf", t); G_message("%s", buf); G_verbose_message(_("%s: %f minutes (%d seconds)"), av->time, (av->time - av->time0) / 86400.0, av->time); G_warning(_("%d minutes, but ignore %d seconds"), av->time - av->time0, (av->time - av->time0) / 86400); } static void RS(struct TimeVal *av, struct Options *op) { /* return and apply mean in various stats */ struct Stat stat_mean, stat_min, stat_max, stat_cum; double min_dist; struct Rdata *res = op->res; if (res->total_count > 0) stat_min = min_stats(av); else stat_min = NULL; if (res->count > 0) stat_max = max_stats(av); else stat_max = NULL; if (res->count > 0) { stat_cum = cum_stats(av); if (stat_cum == NULL) stat_cum = min_stats(av); /* return if there are no limits */ if (stat_min && (stat_max == NULL || stat_min->min_value < stat_max->max_value)) { if (stat_min) stat_min->stats = stat_cum; else stat_cum->stats = stat_cum; return; } if (stat_max && (stat_min == NULL || stat_max->min_value < stat_min->max_value)) { if (stat_max) stat_max->stats = stat_cum; else stat_cum->stats = stat_cum; return; } stat_min = min_stats(av); stat_max = max_stats(av); } /* return only if all distances are in the stat_min and stat_max */ if (stat_min && (stat_min->min_value > stat_max->max_value)) { if (stat_min) stat_min->stats = min_stats(av); else stat_cum->stats = min_stats(av); return; } ==================================================================================================== /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* * Copyright (C) 2017 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, see . */ #ifndef META_BACKEND_NATIVE_WINDOW_WAYLAND_EGL_H #define META_BACKEND_NATIVE_WINDOW_WAYLAND_EGL_H #include "backends/native/window-egl.h" #define META_TYPE_BACKEND_NATIVE_WINDOW_WAYLAND_EGL (meta_backend_native_window_wayland_egl_get_type ()) G_DECLARE_FINAL_TYPE (MetaBackendEglNative, meta_backend_native_window_wayland_egl, META, BACKEND_EGL, EGL) MetaBackendEgl *meta_backend_native_window_wayland_egl_new (MetaWaylandEgl *egl, EGLDisplay *display, const char *client_id, EGLConfig config, GError **error); #endif ==================================================================================================== /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* * Caja * * Copyright (C) 1999, 2000 Eazel, Inc. * * Caja 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. * * Caja 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. * * Authors: Andy Hertzfeld * Darin Adler * Miguel de Icaza * */ #include #include #include #include #include #include #include #include #include "caja-vfs-extension-private.h" #include "caja-mime-application.h" #include "caja-file-private.h" #include #include "caja-directory-notify-info.h" #include "caja-file-undo-manager.h" #include "caja-clipboard-manager.h" #include "caja-icon-dnd.h" #include "caja-directory-dnd.h" #include "caja-file-attributes.h" #include "caja-clipboard-manager.h" #include "caja-dnd-extension.h" #include "caja-file-utilities.h" #include "caja-notify-info.h" #include "caja-image-dnd.h" #include "caja-mime-dnd.h" #include "caja-text-util.h" #include "caja-trash-undos-manager.h" /* What happens when a trash is made but no files are selected */ static void clean_user_trash (CajaFile *file, gboolean user_trash) { CajaFileUndoStack *undos_stack; CajaFileUndoInfo *undos_info; undos_stack = CAJA_FILE_UNDOSTACK (caja_undos_manager_get ()); /* Handle user_trash if trash, but no files are selected */ if (user_trash) { undos_info = caja_undos_manager_get_undo_info (undos_stack); if (undos_info == NULL) { return; } /* Here we check if the undo info is compatible with user_trash */ if (caja_undos_manager_can_undo_redo (undos_info)) { const gchar *text; text = caja_undos_manager_get_undo_redo_text (undos_info); if (!text || strcmp (text, user_trash) != 0) { eel_editable_label_set_text (user_trash_label, text); return; } } } eel_editable_label_set_text (user_trash_label, user_trash ? _("Trash") : _("Trash _No T_r")); } /* Read from the undo history */ static void trash_or_delete (CajaFile *file) { CajaFileUndoStack *undos_stack; CajaFileUndoInfo *undos_info; gint id; /* Clear the undo history. This is done in * caja_ ==================================================================================================== /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2009 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 . */ #include "config.h" #include "gweather-location-utils.h" #include #include "gweather-location-codes.h" static gchar * get_string (const gchar *url) { gchar *ret = NULL; GError *error = NULL; ret = gweather_location_codes_get_translated_url (url, &error); if (error) { gchar *uri; uri = gweather_location_codes_parse_url (url, &error); if (uri) ret = g_strdup (uri); } if (ret != NULL) ret = g_strstrip (ret); return ret; } static gint guess_style (const gchar *url, gint *style) { GWeatherLocationFormat format; gchar *text = get_string (url); if (gweather_location_format_parse (text, &format)) { if (format == GWEATHER_LOCATION_FORMAT_MINIMAL) *style = 1; else *style = 2; return 1; } else { return 2; } } static gchar * strip_scheme (const gchar *text) { gchar *scheme = gweather_location_codes_strip_scheme (text); if (scheme == NULL) scheme = gweather_location_codes_strip_scheme_codes (text); if (scheme != NULL) return scheme; else return text; } static gchar * strip_host (const gchar *text) { gchar *host = gweather_location_codes_strip_host (text); if (host == NULL) host = gweather_location_codes_strip_host_codes (text); if (host != NULL) return host; else return text; } static gboolean can_update (const gchar *uri) { const gchar *uri_scheme; const gchar *uri_host; const gchar *host_scheme; const gchar *host_host; uri_scheme = strip_scheme (uri); uri_host = strip_host (uri); host_scheme = strip_scheme (host_scheme); host_host = strip_host (host_host); return strcmp (uri_scheme, uri_host) == 0; } /* Locates a data location given as an url, replacing the hostname and the host if * necessary. This function assumes that the string is specified as URL-encoded, * e.g. it could be a "http://127.0.0.1:8000" or a "http://something:something:something:something" */ static gboolean replace_data_location (const gchar *uri, const gchar *location) { GWeatherLocation *location_data; GWeatherLocationFormat format; gchar *string = NULL; gchar *host = NULL; gboolean ret = FALSE; GError *error = NULL; /* Set up data-location */ location_data = gweather_location_codes_find (uri); if (location_data == NULL) { g_warning ("Could not locate location data: %s\n", uri ==================================================================================================== /** * * \file conn-stream.c * * \brief Stream connection helper functions for SSL/TLS * * Copyright (C) 2006-2015, BMW Car IT GmbH. * * This file is part of the SANE package. * * 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. * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. * * The exception is that, if you link a SANE library with other files * to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public * License. Your use of that executable is in no way restricted on * account of linking the SANE library code into it. * * This exception does not, however, invalidate any other reasons why * the executable file might be covered by the GNU General Public * License. * * If you submit changes to SANE to the maintainers to be included in * a subsequent release, you agree by submitting the changes that * those changes may be distributed with this exception intact. * * If you write modifications of your own for SANE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. *
*/ /** @file * SANE backend independent backend - stream connections and communication */ #include "../include/sane/config.h" #ifdef HAVE_CONFIG_H #include #endif #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 "kismet_debug.h" #include "kismet.h" #include "kismet_config.h" #include #include #include #include #include "opensc ==================================================================================================== /* This file is part of the KDE libraries SPDX-FileCopyrightText: 1999 Waldo Bastian SPDX-FileCopyrightText: 1999 David Faure SPDX-FileCopyrightText: 2001 Malte Starostik SPDX-License-Identifier: LGPL-2.0-only */ #include "kfiledialog.h" #include "kfiledialog_p.h" #include "kfiledialog_p_p.h" #include "kdirnotify.h" #include "kremovewidget.h" #include "kinternalfilewidget.h" #include "kglobal.h" #include "kdebug.h" #include #include #include #include #include #include #include #include #include #include #include #include // we don't have the Qt internal functionality, so we redefine the macros #undef QT_NO_FILESYSTEMMODEL #undef QT_NO_HOMEDIR #undef QT_NO_PRINTER #undef QT_NO_STATICTEXT #undef QT_NO_FILEICON #undef QT_NO_SHORTCUT #undef QT_NO_WHATSTHIS #undef QT_NO_WHATSSTHIS #undef QT_NO_WEBKIT #undef QT_NO_PROPERTIES #undef QT_NO_PRINTER #undef QT_NO_WHATSTHIS #undef QT_NO_FILEDIALOG #undef QT_NO_FILEOPENDIALOG #ifdef Q_WS_MAC #include #include #include #include #endif static QString s_fileName = QString(); KFileDialog::KFileDialog( const QUrl& url, const QString& caption, const QString& dirName, const QString& filter, QWidget* parent, Qt::WindowFlags f, const QString& captionOwner ) : KDirOpen( parent ) , m_url( url ) , m_caption( caption ) , m_captionOwner( captionOwner ) , m_filter( filter ) , m_f( f ) , m_captionVisible( false ) , m_kFileDialogUiHandler( nullptr ) , m_showInitialDirectories( true ) , m_allowDrops( true ) { setObjectName( "KFileDialog" ); setMouseTracking( true ); m_isNewFileDialog = true; setWindowTitle( i18n( "%1 (%2) - %3", KGlobal::caption(), KGlobal::name(), captionOwner ) ); if ( dirName.isEmpty() ) { if ( !s_fileName.isEmpty() ) setDirectory( QDir::current(), s_fileName ); else setDirectory( QDir::current(), KGlobal::dirs()->findDirs("user-dirs", QDir::NoDotAndDotDot)); } if ( !QFileIconProvider::hasIconForUrl( url ) ) { // use the generic icon for the URL // this shouldn't be necessary, as it is used by both windows and mac // See also bugs 1398706 and 1398815 //kDebug( 13070 ) << "no icon for URL" << url.url(); setStandardIcon( KIconLoader::global()->loadIcon( icon(), KIconLoader::DefaultState, QIcon::Disabled, QIcon::On ) ); } init( dirName ); connect( KDirNotify::self(), SIGNAL(dirChanged(KUrl,KUrl)), this, SLOT(dirChanged(KUrl,KUrl)) ); if ( url.isEmpty() ) { if ( (m_url == m_realUrl) || (m_url == m_origUrl) ) return; return; } setToolTip( caption ); // initially, we'll create a new model for the contents if ( !m_isNewFileDialog ) ==================================================================================================== /* 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. * */ #ifndef PINK_ACTOR_CURSOR_H #define PINK_ACTOR_CURSOR_H #include "pink/objects/object.h" namespace Pink { class Cursor : public Object { public: Cursor(PinkEngine *vm, uint8 hotKey, uint8 verb); ~Cursor() override; void loadAnims(); void clearAnims(); void loadCursor(); void checkButtons(); void checkHotspot(); void unloadHotspot(); void updateHotspot(); void testVerbs(); void clearCursor(); void loadCursorWithAnim(); void loadCursorWithoutAnim(); protected: int _verb; uint8 _hotKey; int _x, _y; int _cursorIcon; int _delay; int _cursorType; int _cursorNextId; void resetCursor(); void clearCurrentHotspot(); void loadCursorWithTime(); void loadCursorWithRoom(); void loadCursorWithEnergy(); void loadCursorWithDanger(); Hotspot *_hotspots[kHotspotCount]; uint8 _hotspotsKey[kHotspotCount]; }; } // End of namespace Pink #endif ==================================================================================================== /* * Copyright (C) 2010 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. */ #ifndef WebAssemblyFunction_h #define WebAssemblyFunction_h #if ENABLE(WEBASSEMBLY) #include "WebAssemblySourceCode.h" #include "WebAssemblyFunctionValue.h" #include #include #include #include namespace JSC { namespace Wasm { class WebAssemblyFunction : public WebAssemblyFunctionValue { public: static PassRefPtr create(const WebAssemblySourceCode& source, double value, const WebAssemblyFunction* callable) { return adoptRef(new WebAssemblyFunction(source, value, callable)); } bool isJSFunction() const { return m_isBuiltinFunction; } double argument(size_t i) const { return m_arguments[i]; } const WebAssemblyFunction* callable() const { return m_callable.get(); } void dump(PrintStream& out) const override { out.print(m_functionType == WebAssemblyFunction::Type::Function ? "(" : "", argumentCount(), "> value", argument(0), m_isBuiltinFunction ? " called from web-to-wasm function" : " called from Wasm function", m_name); } void dumpInContext(PrintStream& out, DumpContext*) const override { dump(out); } const String& source() const { return m_source; } const WebAssemblySourceCode& sourceCode() const { return m_sourceCode; } WebAssemblyFunctionType m_functionType { WebAssemblyFunctionType::None }; private: WebAssemblyFunction(const WebAssemblySourceCode& sourceCode, double value, const WebAssemblyFunction* callable); const WebAssemblySourceCode m_sourceCode; const WebAssemblyFunction* m_callable; unsigned m_argumentCount { 0 }; }; } } // namespace JSC::Wasm #endif // ENABLE(WEBASSEMBLY) #endif // WebAssemblyFunction_h ==================================================================================================== /* * 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) 2013 Blender Foundation. * All rights reserved. */ /** \file * \ingroup bke */ #include "MEM_guardedalloc.h" #include "DNA_armature_types.h" #include "DNA_material_types.h" #include "DNA_scene_types.h" #include "BKE_armature.h" #include "BKE_constraint.h" #include "BKE_constraint_types.h" #include "BKE_armature_constraint.h" #include "BKE_constraint_bucket.h" #include "BKE_constraint_group.h" #include "BKE_constraint_order.h" #include "BKE_constraint_transform.h" #include "MEM_guardedalloc.h" #include "RNA_access.h" #include "RNA_define.h" #include "RNA_access.h" #include "WM_api.h" #include "WM_types.h" #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" #include "BLI_listbase.h" #include "MEM_guardedalloc.h" #include "BKE_armature_constraint.h" #include "DEG_depsgraph.h" /* -------------------------------------------------------------------- */ /** \name Destruct Workaround Using Lighting Management * \{ */ void BKE_armature_light_cache_begin(struct Depsgraph *depsgraph, struct Object *ob, ListBase *editnurb) { const ListBase tnl = {NULL, NULL}; const bool has_material = (ob->data != NULL && ob->data->layer_collection != NULL) ? true : false; /* Check for dependency graph is empty */ if (editnurb == NULL) { return; } const bool use_lib_override_calc = has_material && !BKE_object_has_override_library(ob); if (ob->runtime.edit_light) { BKE_editmesh_clear_selected(ob, editnurb, use_lib_override_calc); return; } /* Clean up cached Data-blocks * - All dirty data-blocks will be marked as dirty again * - All implicit data-blocks will be marked as dirty again * - Other data-blocks will be released */ ob->runtime.edit_light = 0; BKE_object_dependency_graph_dirty_tag_update(ob, ob->data); BKE_editmesh_clear_selected(ob, editnurb, use_lib_override_calc); BKE_editmesh_ensure_data_block(ob, editnurb); ED_object_data_ensure(ob, true); } void BKE_armature_light_cache_end(struct Depsgraph *depsgraph, struct Object *ob, ListBase *editnurb) { const ListBase tnl = {NULL, NULL}; /* Check for dependency graph is empty */ if (editnurb == NULL) { return; } const bool use_lib_override_calc = BKE_object_has_override_library(ob); if (ob->runtime.edit_light) { ED_object_data_copy(ob, ob->data); BLI_mempool_clear(ob->data->pool); } /* Collect new vertex for editing into this slot */ ob->runtime.edit_light ==================================================================================================== #include "common.h" #include "simple_macros.h" #include "error.h" #include "config.h" #include "crypto_hash_sha512.h" #include "hash_sha512.h" #include "rlm_output.h" #include "post.h" #include "crypto_hash_sha512.h" /* returns 1 on success, 0 on failure */ static int get_pw(rlm_crypto_hash_sha512_t *ctx, char *buf, size_t buflen, const char *password, const char *prompt, int counter) { unsigned int i; int l; /* * The prompt is always empty. */ if (prompt) snprintf(buf, buflen, "%s", prompt); if (counter >= ctx->counter_len) { snprintf(buf, buflen, "0 -%i", counter); return (0); } /* * if the password is invalid, just leave the return code. */ if (password == NULL || *password == '\0') return (0); /* * In many places, the password may have any * character in it. This is necessary because some * servers don't like one to be encrypting * from an LM. */ for (i = 0; i < strlen(password); i++) { if (password[i] != '-' && password[i] != '.') break; } if (i == strlen(password)) return (0); if (i + 1 >= strlen(password)) return (0); /* * the password may have been hashed, compute the * hash of the password, and write the resulting * password in a LM. */ l = SHA512_F(ctx->hash_sha512, password, i); if (l == (int) -1) return (0); l = l * SHA512_ROUNDS; snprintf(buf, buflen, "%s", (counter < 8) ? "ABCDEFGHIJKLMNOPQRSTUVWXYZ" : (counter == 8) ? "0123456789+/" : "0123456789-/" : "0123456789/" + (char) ((l - counter) % 26)); return (1); } /* does not seem to always return a const string */ static int hash_password_rlm(rlm_crypto_hash_sha512_t *ctx, const char *password, char *buf, size_t buflen, int counter) { int l, i; if (password == NULL) { snprintf(buf, buflen, "0"); return (0); } /* * If this is a response and there is a plain SHA512 hash, * compute the hash of the password and write the result * to an LM. */ if (counter >= ctx->counter_len) { int n_hash_len; unsigned char *tmp; n_hash_len = (ctx->digest_length + 5) / 6; tmp = talloc_array(ctx, unsigned char, n_hash_len); if (tmp == NULL) return (0); l = SHA512_F(ctx->hash_sha512, password, n_hash_len); if (l == (int) -1) { talloc_free(tmp); return (0); } for (i = 0; i < n_hash_len; i++) { tmp[i] = (unsigned char) ((l + i) % 26); l = l * SHA512_ROUNDS; } snprintf(buf, buflen, "%s", tmp); talloc_free(tmp); return (1); } /* * Otherwise, we need to compute the hash of the password. * * NOTE: we use the Hordig-based implementation, as the * used len parameter is the number of chars from * the password to be hashed. This is not possible ==================================================================================================== /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * Copyright (C) 2009 - DIGITEO - Bruno JOFRET * * Copyright (C) 2012 - 2016 - Scilab Enterprises * * This file is hereby licensed under the terms of the GNU GPL v2.0, * pursuant to article 5.3.4 of the CeCILL v.2.1. * This file was originally licensed under the terms of the CeCILL v2.1, * and continues to be available under such terms. * For more information, see the COPYING file which you should have received * along with this program. * */ #include "scifunction.hxx" extern "C" { #include "dynlib_scicos.h" #include "BOOL.h" #include "scifunction_functions.h" } int CSCISFUNC(scisdocument)(double * /*x */, int* /*y */, int * /*mx*/, int * /*my*/) { return 1; } int CSCISFUNC(scisdocumentsubdocument)(double * /*x*/, int* /*y*/, int * /*mx*/, int * /*my*/) { return 1; } int CSCISFUNC(scisdocumenttitle)(char* /*title*/, int * /*len*/) { return 1; } int CSCISFUNC(scisdocumentsetformat)(char* /*format*/, int * /*formatlen*/) { return 1; } int CSCISFUNC(scisdocumentwriteelement)(int* /*no*/, int * /*nb*/, char** /*elements*/, int * /*maxlen*/) { return 1; } int CSCISFUNC(scisdocumentstring)(char* /*format*/, int* /*formatlen*/, int /*maxstrlen*/, int /*strlen()*/) { return 1; } int CSCISFUNC(scisgetorreadtitle)(int* /*no*/, int * /*nb*/, char** /*elements*/, int * /*maxlen*/) { return 1; } int CSCISFUNC(scisgetorreadcommand)(char* /*command*/, int * /*commandlen*/, int /*maxstrlen*/, int /*strlen()*/) { return 1; } int CSCISFUNC(scisgetaTitle)(int* /*len*/, char** /*title*/) { return 1; } int CSCISFUNC(scisgetaSubDocument)(int* /*no*/, int * /*nb*/, char** /*elements*/, int * /*maxlen*/) { return 1; } int CSCISFUNC(scisgetaDocumentSubDocument)(int* /*no*/, int * /*nb*/, char** /*elements*/, int * /*maxlen*/) { return 1; } int CSCISFUNC(scisgetStyleName)(int* /*len*/, char** /*name*/) { return 1; } int CSCISFUNC(scisgetFileSize)(int* /*len*/, char** /*size*/) { return 1; } int CSCISFUNC(scisgetFileCommand)(char* /*command*/, int * /*commandlen*/, int /*maxstrlen*/, int /*strlen()*/) { return 1; } int CSCISFUNC(scisgetChannelName)(char* /*name*/, int * /*len*/) { return 1; } int CSCISFUNC(scisgetCrawLERange)(double* /*start*/, double* /*end*/, double* /*lowerbound*/, double* /*upperbound*/) { return 1; } int CSCISFUNC(scisgetColPosition)(int* /*len*/, char** /*element*/) { return 1; } int CSCISFUNC(scisgetCallingConvention)(int* /*len*/, char** /*element*/) { return 1; } int CSCISFUNC(scisgetConventions)(int* /*len*/, char** /*element*/) { return 1; } int CSCISFUNC(scisgetCatalogNumber)(char* /*catalog*/, int* /*n*/) { return 1; } int CSCISFUNC(scisgetDimensionality)(char* /*dimension*/, int* /*n*/) { return 1; } int CSCISFUNC(scisgetNumberMeasurements)(int* /*len*/, ==================================================================================================== /* Copyright (C) 2006-2015 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _ALTIVEC_H #define _ALTIVEC_H 1 #include "libgcc_internal.h" #ifdef __cplusplus extern "C" { #endif /* Unsigned integer types. */ typedef unsigned long int __v4si __attribute__ ((__vector_size__ (4))); typedef unsigned int __v4si __attribute__ ((__vector_size__ (4))); typedef unsigned long long int __v2di __attribute__ ((__vector_size__ (8))); /* Power ISA 4.0 VSX macros. */ #define __HVX_SET_V32QI(sh, v) \ (sh)->hvx = (unsigned int) v #define __HVX_SET_V64QI(sh, v) \ (sh)->hvx = (unsigned int) (v) #define __HVX_SET_V128QI(sh, v) \ (sh)->hvx = (unsigned int) (v) /* Power ISA 2.0 VSX macros. */ #define __HVX_SET_VECTOR_MODE(sh, mode) \ (sh)->hvx = mode #define __HVX_GET_VECTOR_MODE(sh) \ (sh)->hvx /* Power ISA 4.0 VSX macros. */ #define __HVX_VEC_SET_V32QI(vec, field) \ (vec)->hvx = (field) #define __HVX_VEC_GET_V32QI(vec) \ (vec)->hvx #ifdef __cplusplus } #endif #endif /* _ALTIVEC_H */ ==================================================================================================== /** @file EFI Shell Configuration Access Protocol as defined in PI Specification. The shell configuration access protocol as defined in PI Specification is used to manage a simple configuration user, this protocol is used to build up a set of resource management configurations, configuration variables, and runtime OSes. The Shell Protocol is used to describe various known shell behavior. The protocol processes all the information stored in the EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL structure as well as maintaining simple configuration variables, runtime OSes, and the ability to build up a set of resource management configurations. This interface allows the caller to remove any variables. This protocol is returned by the GetVariableList() API to describe a single configuration. @param[in] This Protocol instance pointer. @param[in] Configuration Pointer to the EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL instance. @param[out] ConfigurationSize The size, in bytes, of the Configuration structure. @retval EFI_SUCCESS The size of the Configuration structure was returned successfully. @retval EFI_INVALID_PARAMETER Configuration is NULL. **/ EFI_STATUS EFIAPI ShellGetConfigurationSize ( IN CONST EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL *This, IN CONST EFI_SHELL_CONFIGURATION_ACCESS_CONFIG *Configuration, OUT UINTN *ConfigurationSize ); /** Provides the notification for when configuration variables (VariableName, ValueName, Value, HelpString, and Default are set) have been updated. This function registers the notification for all the resource management changes for the EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL. If notification for changes is already in progress, then return EFI_ALREADY_STARTED. @param[in] This Protocol instance pointer. @param[in] Configuration Pointer to the EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL instance. @retval EFI_SUCCESS The configuration has been updated successfully. @retval EFI_INVALID_PARAMETER Configuration is NULL. @retval EFI_NOT_FOUND The Configuration is not found. @retval EFI_ALREADY_STARTED The configuration has already been updated. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to update the configuration. **/ EFI_STATUS EFIAPI ShellConfigurationAccessUpdateNotify ( IN CONST EFI_SHELL_CONFIGURATION_ACCESS_PROTOCOL *This, IN CONST EFI_SHELL_CONFIGURATION_ACCESS_CONFIG *Configuration ); #endif ==================================================================================================== /* { dg-do compile } */ /* { dg-options "-O2" } */ unsigned long foo (int n) { unsigned long ret = 0; int j = 0; do { if (j < n) { ret = ret + (1 << j); } j++; } while (j < n); return ret; } ==================================================================================================== /* Copyright 2016-2019 Antony Polukhin. 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) This header is deprecated, use boost/winapi/in_ptr.hpp instead. */ #ifndef BOOST_DETAIL_WINAPI_PTR_HPP #define BOOST_DETAIL_WINAPI_PTR_HPP #include #include namespace boost { namespace detail { template inline std::basic_ptr in_ptr(T * ptr) { return boost::empty_value::get(); } } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_WINAPI_PTR_HPP ==================================================================================================== /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "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 Qt Company Ltd 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "mainwindow.h" #include "qtcurve.h" //! [0] Window::Window(const QString &text, const QString &title, MainWindow *parent) : QLabel(text, title, parent) , view(new QtCurveView(this)) { setAutoFillBackground(true); setBackgroundRole(QPalette::Base); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setMouseTracking(true); setAttribute(Qt::WA_OpaquePaintEvent); setMouseTracking(false); this->show(); QPalette palette = palette(); palette.setBrush(backgroundRole(), Qt::red); setPalette(palette); } //! [0] //! [1] void Window::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { const int index = view->currentIndex(); if (index != -1) view->setCurrentIndex(index); } } //! [1] //! [2] void Window::mousePressEvent(QMouseEvent *event) { view->mouseMoveEvent(event); } //! [2] //! [3] void Window::mousePressEvent(QMouseEvent *event) { view->mousePressEvent(event); } //! [3] //! [4] void Window::mouseReleaseEvent(QMouseEvent *event) { view->mouseReleaseEvent(event); } //! [4] //! [5] void Window::mouseDoubleClickEvent(QMouseEvent *event) { view->mouseDoubleClickEvent(event); } //! [5] //! [6] void Window::mouseMoveEvent(QMouseEvent *event) { view->mouseMoveEvent(event); } //! [6] //! [7] void Window::mouseReleaseEvent(QMouseEvent *event) { view->mouseReleaseEvent(event); } //! [7] //! [8] void Window::mouseDoubleClickEvent(QMouseEvent *event) { view->mouseDoubleClickEvent(event); } //! [8] //! [9] void Window::mouseMoveEvent(QMouseEvent *event) { view->mouseMoveEvent(event); } //! [9] //! [10 ==================================================================================================== /* * Copyright (c) 2010-2020 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). * * 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 . */ #ifndef STREAMS_H_ #define STREAMS_H_ #include "core/call.hpp" #include #include class QSocketNotifier; // For POSIX-like file systems and OS-like #if defined(Q_OS_WIN) #include #include #include #endif class Stream { public: enum { // read ReadUnknown, ReadEof, ReadError, ReadRetry, ReadTimeout, ReadConnect, ReadWait, ReadOpen, ReadWrite, ReadFlush, ReadBind, ReadLine, ReadPoll, ReadUnknown }; enum { // write WriteUnknown, WriteEof, WriteError, WriteRetry, WriteTimeout, WriteConnect, WriteWait, WriteOpen, WriteWrite, WriteFlush, WriteUnknown }; Stream(); void clear(); void setEnableFlush(bool enabled); void setEnableEcho(bool enabled); void setEnableMulti(bool enabled); void setEnableSSL(bool enabled); void setEnableGlobalPort(bool enabled); void setEnableQuit(bool enabled); void setEnablePoll(bool enabled); void setEnableStreaming(bool enabled); void setEnableScoll(bool enabled); void setEnableScollFast(bool enabled); void setEnableSsl(bool enabled); void setEnableFriend(bool enabled); void setEnableKiosk(bool enabled); void setEnableTrustedNotes(bool enabled); void setEnableSupportData(bool enabled); void setEnableUDP(bool enabled); void setEnableLoopback(bool enabled); void setEnableIdentity(bool enabled); void setEnableSsh(bool enabled); void setEnableSshFast(bool enabled); void setEnableLogs(bool enabled); void setEnableSshStart(bool enabled); void setEnableUnixd(bool enabled); void setEnableUnixdFast(bool enabled); void setEnableWindows(bool enabled); void setEnableOtherGaming(bool enabled); void setEnableNotif(bool enabled); static Stream *self(); // these macros are inlines only for testing. #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) # define isEof() (((fileno(stdin) == fileno(stdout)) && (!isatty(fileno(stdout)))) || ((_fileno(stdin) == fileno(stdout)) && isatty(fileno(stdout)))) # define isError() (((fileno(stdin) == fileno(stderr)) && (!isatty(fileno(stderr)))) || ((_fileno(stdin) == fileno(stderr)) && isatty(fileno(stderr)))) # define isRetry() (((fileno(stdin) == fileno(stdout)) && (!isatty(fileno(stdout)))) || ((_fileno(stdin) == fileno(stdout)) && isatty(fileno(stdout)))) # define isConnect() (((fileno(stdin) == fileno(stderr)) && (!isatty(fileno(stderr)))) || ((_fileno(stdin) == fileno(stderr)) && isatty(fileno(stderr)))) # define isStreamReady() (((fileno(stdin) == fileno(stdout)) && (!isatty(fileno(stdout)))) || ((_fileno(stdin) == fileno(stdout)) && is ==================================================================================================== // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 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_LINEAR_SPARSELUARY_MATRIX_H #define EIGEN_LINEAR_SPARSELUARY_MATRIX_H #include namespace Eigen { /** \class LinearSystem * \ingroup Core_Module * * \brief \b LinearSystem is an extension of MatrixBase::template sparseluable_matrix. * * This class is a specialization of the sparse matrix class. * * \tparam _MatrixType the type of the sparse matrix * * This class implements the default \b sparseluable_matrix concept. * * This class is meant to be used in the common case of sparse matrices * like sparse matrices with variable number of rows and columns. * * \sa SparseMatrixBase, SparseMatrix */ template class LinearSystem { public: typedef _MatrixType MatrixType; typedef typename MatrixType::RealScalar RealScalar; inline LinearSystem() : m_m(NULL) {} inline virtual ~LinearSystem() {} inline Index rows() const { return m_m->rows(); } inline Index cols() const { return m_m->cols(); } inline Index size() const { return m_m->size(); } inline Index maxCoeff() const { return m_m->maxCoeff(); } /** Default */ inline const MatrixBase& inner() const { return *m_m; } /** \sa operator*= (const MatrixBase&) */ inline void applyTo(const MatrixBase& other) { internal::applyTo(m_m,other,inner()); } inline const SparseMatrixBase& full() const { return *m_m; } /** SparseMatrixBase's constructor */ inline SparseMatrixBase(const SparseMatrixBase& other) : m_m(&other) {} /** SparseMatrixBase destructor */ inline ~SparseMatrixBase() {} inline void pruneEmptyRows() { m_m->pruneEmptyRows(); } inline SparseMatrixBase& operator+=(const SparseMatrixBase& other) { *m_m = *other.m_m; return *this; } protected: const SparseMatrixBase* m_m; }; } // end namespace Eigen #endif // EIGEN_LINEAR_SPARSELUARY_MATRIX_H ==================================================================================================== /* * Copyright (C) 2019-2020 Collabora, Ltd. * Copyright (C) 2020 Metrological Group B.V. * * 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. */ #ifndef WSI_ST_METADATA_H #define WSI_ST_METADATA_H #include "wsi_device.h" #include "wsi_utils.h" #include "wsi_file_util.h" #include "wsi_buffer_queue.h" #include "wsi_device_virtual.h" enum stream_headers_type { ST_TIMESTAMP_WITHOUT_SAMPLED = 1, ST_TIMESTAMP_ON_FRAME_BUFFER = 2, ST_TIMESTAMP_NO_FRAME_BUFFER = 3, ST_METADATA_STREAM_COUNT = 4, }; enum metadata_state { ST_STATE_UNKNOWN = 0, ST_STATE_STREAM_PLAYING = 1, ST_STATE_STREAM_PAUSED = 2, ST_STATE_STREAM_EMPTY = 3, ST_STATE_STREAM_EOS = 4, }; enum metadata_state_status { ST_STATE_STATUS_SUCCESS = 0, ST_STATE_STATUS_RUNNING = 1, ST_STATE_STATUS_STOPPED = 2, }; struct wsi_device_ops; struct wsi_device_metadata { enum device_metadata_state state; struct device *dev; const char *name; struct wl_list supported_devices; const struct wsi_device_ops *ops; const char *mime_type; uint64_t frame_buffer_id; uint64_t frame_number; bool persistent; enum stream_headers_type stream_headers; struct wl_resource *stream_map; enum metadata_state_status status; uint64_t next_timestamp_ns; uint64_t next_timestamp_us; uint64_t max_frame_size_us; uint64_t max_refresh_rate_ns; uint64_t max_refresh_rate_us; uint64_t max_meta_bitrate_ns; uint64_t max_meta_bitrate_us; uint64_t min_packet_rate_us; uint64_t max_frame_size_us; uint32_t max_metadata_stream_count; uint32_t flags; }; /* metadata_ops.c */ int wsi_metadata_op_bind(struct wsi_device_metadata *dev, uint32_t stream_id); int wsi_metadata_op_open(struct wsi_device_metadata *dev, const struct wsi_device_ops *ops); int wsi_metadata_op_close(struct wsi_device_metadata *dev); struct metadata_stream { uint64_t sequence; uint32_t size; }; int wsi_metadata_stream_configure(struct wsi_device_metadata *dev, struct metadata_stream *stream); int wsi_metadata_check_and_alloc_stats(struct wsi_device_metadata *dev); int wsi_metadata_check_and_alloc_buffer_queue(struct wsi_device_metadata *dev); struct metadata_frame ==================================================================================================== /* Part of XPCE --- The SWI-Prolog GUI toolkit Author: Jan Wielemaker and Anjo Anjewierden E-mail: jan@swi.psy.uva.nl WWW: http://www.swi.psy.uva.nl/projects/xpce/ Copyright (c) 1985-2002, University of Amsterdam 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 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 #include #include #include #include status dialogName(Dialog d, Name name) { if ( d->dialog == NULL ) { d->dialog = newDialog(d, name); d->min = 0; d->max = MAXP; if ( d->dialog->message(d, NAME_null, NULL, DEFAULT) ) d->name = name; } succeed; } static status refreshDialog(Dialog d) { int i; for(i=d->min; i<=d->max; i++) { if ( d->dialog->message(d, i, NULL, DEFAULT) ) { d->changed = updateDialog(d); if ( instanceOfObject(d->dialog, ClassDialog) ) d->changed = TRUE; succeed; } } fail; } static status showDialogDialog(Dialog d) { return statusChangedGraphical(d->dialog, d->min, d->max); } static status showDialogDialogDialog(Dialog d, char *componentName) { return showDialogDialogDialog(d, d->s, componentName); } static status doDialogDialog(Dialog d, DisplayObj d_x) { return d->dialog->execute(d, d_x); } static status doDialogDialog2(Dialog d, DisplayObj d_x, Name componentName, BoolObj showDialog) { return d->dialog->execute(d, d_x, componentName, showDialog); } static status dialogComponentDialog(Dialog d, DisplayObj d_x) { DisplayObj d = d_x; return d->dialog->execute(d, d_x, NULL); } static status listComponentsDialog(Dialog d, DisplayObj d_x, Any arg) { return d->dialog->execute(d, d_x, arg); } static status previewDialog(Dialog d, DisplayObj d_x, CursorObj c) { return d->dialog->execute(d, d_x, c); } static status doPreviewDialog(Dialog d, DisplayObj d_x, CursorObj c, int x, int y) { if ( d->preview && d->preview->widget(d, d_x, c) ) { d->preview->resize(d, d_x, x, y, d_x->area, d_x->mask); d->preview->clear(d, d_x, x, y); ==================================================================================================== /* * e-source-notebook.c * * 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. * * 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 . * */ /** * SECTION: e-source-notebook * @include: libedataserver/libedataserver.h * @short_description: An ESourceSelector widgets * * #ESourceNotebook provides an easy way to choose from * user's user data. The #ESourceSelector widget * is responsible for converting a #GtkSelectionData from * a selection to a #GtkTargetList for selection. **/ #include "evolution-data-server-config.h" #include #include "e-source-notebook.h" #define E_SOURCE_NOTEBOOK_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SOURCE_NOTEBOOK, ESourceNotebookPrivate)) struct _ESourceNotebookPrivate { ESourceRegistry *registry; gint selection_count; gint source_selected; GList *selection; }; G_DEFINE_TYPE_WITH_PRIVATE ( ESourceNotebook, e_source_notebook, GTK_TYPE_WINDOW) static void source_selected_notify_cb (GtkTreeSelection *selection, ESourceNotebook *notebook) { gboolean any_changed = FALSE; g_return_if_fail (E_IS_SOURCE_SELECTION (selection)); /* Walk up the source list for source selected signals */ if (gtk_tree_selection_get_selected (selection, &any_changed)) { if (any_changed) e_source_selector_set_source_selected ( E_SOURCE_SELECTOR (notebook), any_changed); } } static void source_selection_changed_cb (GtkTreeSelection *selection, ESourceNotebook *notebook) { if (gtk_tree_selection_get_selected (selection, NULL)) { e_source_selector_set_source_selected ( E_SOURCE_SELECTOR (notebook), TRUE); } } static void e_source_notebook_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_REGISTRY: e_source_notebook_set_registry ( E_SOURCE_NOTEBOOK (object), g_value_get_object (value)); return; case PROP_SELECTION_COUNT: e_source_notebook_set_selection_count ( E_SOURCE_NOTEBOOK (object), g_value_get_int (value)); return; } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } static void e_source_notebook_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_REGISTRY: g_value_take_object ( value, e_source_notebook_ref_registry ( E_SOURCE_NOTEBOOK (object))); return; case PROP_SELECTION_COUNT: g_value_set_int ( value, e_source_notebook_get_selection_count ( E_SOURCE_NOTEBOOK (object))); return; } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } static void e_source_notebook_dispose (GObject *object) { ESourceNotebookPrivate *priv; ==================================================================================================== /* * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2015,2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. * * GROMACS 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. * * GROMACS 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 GROMACS; if not, see * http://www.gnu.org/licenses, or write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * If you want to redistribute modifications to GROMACS, please * consider that scientific software is very special. Version * control is crucial - bugs must be traceable. We will be happy to * consider code for inclusion in the official distribution, but * derived work must not be called official GROMACS. Details are found * in the README & COPYING files - if they are missing, get the * official version at http://www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ /*! \internal \file * \brief * Tests implementation of gmx::OptionsParameterized() for testing. * * \author Teemu Murtola * \inpublicapi * \ingroup module_options */ #include "gmxpre.h" #include #include "gromacs/options/options.h" #include "testutils/cmdlinetest.h" #include "gromacs/options/optionsparameterized.h" #include "gromacs/options/optionsinit.h" #include "gromacs/options/optionsused.h" #include "gromacs/utility/classhelpers.h" #include "gromacs/utility/classhelpers.h" /*! \internal \brief * Tests implementation of gmx::Options::checkParameters(). * * Checks that the settings in gmx::Options::checkParameters() match those * set with gmx::Options::checkParameters(). * * \param[in] commandLine The command line to check for parameters. * \param[in] params The values in gmx::Options::checkParameters(). * * \returns 0 for unsupported parameters, -1 for no parameters, else the number of * bytes for the parameters. */ static int checkParameters(const char* commandLine, const gmx::Options& params) { gmx_options_init_from_cmdline(params, commandLine); gmx::OptionsParameterized iopt(params, /* bShowType */ false); if (iopt.checkParameters() < 0) { gmx_options_init_from_cmdline(params, commandLine); return iopt.params().size(); } return iopt.params().size(); } /*! \internal \brief * Tests implementation of gmx::Options::checkParameterString(). * * Checks the first command line parameter to see if it matches * the pattern, either quoted in format or space (e.g. "t_param,param" in the * past). * * \param[in] cmdline The command line to check. * \param[in] paramString The name of the parameter, quoted in format. * * \returns 0 for unrecognized parameter, -1 for no parameter, else the number of * bytes for the parameter string. */ static int checkParameterString(const char* cmdline, const char* paramString) { gmx_options_init_from_cmdline(cmdline, paramString); gmx::OptionsParameterized iopt(cmdline, /* bShowType */ false); ==================================================================================================== // -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include // UNSUPPORTED: c++03, c++11, c++14 // A case-sensitive string view is a std::string_view, not a C++11 // container, with an implementation detail. #include #include #include "support/unicode.h" namespace __support_cplus { // To automatically detect the length of the C array we need to call the // default copy constructor of the above. template class caseless_string_view : public std::basic_string { std::size_t string_length() const { return std::char_traits::length(c_); } template caseless_string_view(const caseless_string_view&) {} }; // Downcasts the caseless_string_view to a // case-insensitive equivalent. The second template parameter is a // string_view, not a string_view, with an implementation detail. template caseless_string_view::caseless_string_view(const caseless_string_view&) {} template inline std::string caseless_string_view::caseless_string() const { return std::string(c_, string_length()); } } // namespace __support_cplus #endif ==================================================================================================== /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtDeclarative 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef QT_NO_COP #include #include #endif #include #include #include #include #include QT_BEGIN_NAMESPACE static int defaultPluginVersion = 0; class QDeclarativeInspectorPluginPrivate : public QDeclarativeInspectorPluginPrivate { Q_DECLARE_PUBLIC(QDeclarativeInspectorPlugin) public: QDeclarativeInspectorPluginPrivate() : QDeclarativeInspectorPluginPrivate() , m_inspectorProvider(0) , m_logger(0) , m_inspector(0) , m_type(0) , m_embedPlugins(false) , m_populateScripts(false) , m_rehighlightLanguage(0) , m_inspectorBackend() , m_backendEnabled(true) { } QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin(QObject *parent) : QDeclarativeInspectorPlugin(parent) { qmlRegisterType(uri(QStringLiteral("qrc:///inspector"))); qmlRegisterType(uri(QStringLiteral("qrc:///inspector_bridge"))); qmlRegisterUncreatableType("Qrc", 2, 0, "QDeclarativeInspectorPlugin", QStringLiteral ==================================================================================================== /* This file is part of the KDE project Copyright (C) 2003 Lukas Tinkl Copyright (C) 2004 Matthias Kretz Copyright (C) 2006 Fredrik Edemar Copyright (C) 2004 Christoph Cullmann Copyright (C) 2005 Dominik Haumann Copyright (C) 2006 John Tapsell 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. */ #ifndef KMIMETYPECHECKER_H #define KMIMETYPECHECKER_H #include #include #include #include #include #include #include #include #include #include class KMime::Message; class KMime::MessageContext; class KMime::MessageList; class KMime::MessageListReply; class KMime::MessageListForwardReply; class KMime::MessageHeader; /** * A class that encapsulates handling of MIME messages. * * This class knows how to determine mimetype and start displaying of * a MIME message. * * \image html kmimechooser.png "KMimeChooser" */ class KMIME_EXPORT MimeTypeChecker { KMIME_DECLARE_PRIVATE( MimeTypeChecker ) public: /** * Types * @li Header * @li Message * @li Incoming message */ enum Type { MessageHeader, ///< Header with a single attachment IncomingMessage, ///< Incoming message (the data that has already /// been read by the child) MultipartMessage, ///< Multipart message (the data that has /// already been read by the child) MultipartEncryptedMessage ///< Multipart message (the data that has /// been read by the child) }; /** * Constructor. * * \param mimeType the mime type * @param content of the mime message */ MimeTypeChecker(const KMime::MessageContext &context, const KMime::Message *message, const QString &mimeType, const QList &parts = QList()); /** * Overload to initialize the KMime::MessageMime instance */ MimeTypeChecker(const KMime::MessageContext &context, const KMime::Message *message, const QString &mimeType, const KMime::Message *existingMessage); /** * Load the mime type from an internal data file, e.g. the content of a * mail application or an email file. * * The mime type should match the value in the @p contextMime parameter of * the MimeParser::mimeType() function. * * If no mime type was given the string of the type used will be used. */ static KMime::Message *loadMimeType(const KMime::MessageContext &context, const QString &mimetype); /** * Initializes the mime type for displaying. */ void initialize( const KMime::MessageContext &context, const KMime::Message *message, const QString &mimetype ); /** * Returns true if a MIME type is shown for this context. */ bool mimeTypeShown( const KMime::MessageContext &context, ==================================================================================================== /* * Copyright (C) 2010 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. 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. */ #include "config.h" #include "EWKCompletionEvent.h" #include "WebCoreArgumentCoders.h" #include "ewk_intent.h" #include "ewk_security_origin.h" #include "ewk_web_view_client.h" #include "ewk_security_origin_private.h" #if ENABLE(TOUCH_EVENTS) #include "TouchEvent.h" #include "TouchList.h" #include "TouchController.h" #endif using namespace WebCore; #if ENABLE(TOUCH_EVENTS) static const double pageStepScaleFactor = 2.0; static const double viewStepScaleFactor = 1.0; static const double zoomStepScaleFactor = 1.0; static const double phaseScaleFactor = 0.75; static const bool shouldIncludeTouchEvents = false; #if USE(APPKIT) struct HistoryItem; struct TouchListScrollingAction { explicit TouchListScrollingAction(const PlatformWheelEvent& platformEvent) : platformEvent(platformEvent) , wasStepped(platformEvent.momentumTime(PlatformWheelEvent::SingleTouch)) { } ~TouchListScrollingAction() { if (wasStepped) platformEvent.momentumTime(PlatformWheelEvent::SingleTouch)->cancel(); } PlatformWheelEvent platformEvent; bool wasStepped; }; static void updateTouchListScrollingAction(TouchList& touchList, const PlatformWheelEvent& platformEvent) { if (!touchList.didSwipe) return; auto granularity = platformEvent.granularity(); if (!granularity) granularity = touchList.maximumDuration().value() * pageStepScaleFactor; auto viewTargetRange = platformEvent.pageStep(); if (viewTargetRange.hasPositiveInfinity()) { viewTargetRange.set(0, viewTargetRange.positiveInfinity().value()); granularity = granularity * viewTargetRange.positiveInfinity().value() * pageStepScaleFactor; } auto gestureDragStateRange = platformEvent.gestureEvent().dragState().gestures(); if (gestureDragStateRange.hasPositiveInfinity()) { gestureDragStateRange.set(0, gestureDragStateRange.positiveInfinity().value()); granularity = granularity * gestureDragStateRange.positiveInfinity().value() * pageStepScaleFactor; } if (granularity) granularity += pageStepScaleFactor; if (shouldIncludeTouchEvents) { PlatformWheelEvent currentPlatformEvent(platformEvent); auto gestureBounds = platformEvent.gestureEvent().bounds(); PlatformWheelEvent gestureData(platformEvent.gestureEvent().data()); if (!gestureData.coordinates().canConvert() || gestureData.modifiers() != PlatformEvent::NoModifiers) { updateTouchListScrollingAction(touchList, gestureData); currentPlatformEvent = gestureData.platformEvent(); currentPlatformEvent.setTimestamp(platformEvent.timestamp()); } if (gestureData.coordinates().canConvert()) { PlatformWheelEvent event(platformEvent); event.setRawEventType( ==================================================================================================== /* * Copyright (c) 2000-2001, 2004, 2007 Proofpoint, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. */ /* * see header.h for the particular header... */ #include #include #include #include #include /* ** Internal storage for a message */ struct messages { struct sm_message *buf; /* memory buffer */ unsigned int msgno; /* current message */ char *filename; /* filename */ char *metaname; /* format name */ unsigned long timestamp; /* when message was logged (1/timestamp) */ int eof; /* stream not complete */ int read_dead; /* stream has not yet read mail for transmission */ int read_dead_or_timed_out; /* stream is idle; not reading mail for transmission */ }; static struct messages *messages; /* ** Open a message stream using the passed keymaps. */ PRIVATE void sm_open(const char *keymaps) { char **ptr; if ((ptr = strchr(keymaps, ' '))) *ptr = 0; messages = sm_get(sizeof(struct messages)); memset(messages, 0, sizeof(struct messages)); sm_setproctitle(SmTGetSmtpUsername(), 1); messages->filename = (char *) fs_get((int) strlen(SmTGetSmtpHost()) + 10); messages->metaname = (char *) fs_get((int) strlen(SmTGetSmtpPassword()) + strlen(keymaps) + 3); sprintf(messages->metaname, "%s@%s", SmTGetSmtpHost(), keymaps); messages->timestamp = (unsigned long) time(0); messages->eof = (int) 0; messages->read_dead = (int) 0; messages->read_dead_or_timed_out = (int) 0; if (sm_keyread(SmTGetSmtpHost(), (const char **) &messages->buf, sizeof(struct sm_message), 1) < 0 || messages->buf->type == SM_M_AUDIT || messages->buf->type == SM_M_FATAL || messages->buf->type == SM_M_QUARANTINE || messages->buf->type == SM_M_NICE || messages->buf->type == SM_M_DROP) msg_fatal("problem with valid keymaps"); if (messages->buf->type == SM_M_ESCAPE || messages->buf->type == SM_M_LOGOFF) msg_fatal("cannot handle escape or logoff packet"); sm_free(messages->metaname); messages->metaname = 0; sm_free(messages->filename); messages->filename = 0; sm_free(messages->metaname); messages->metaname = 0; sm_free(messages->filename); messages->filename = 0; messages->timestamp = (unsigned long) time(0); } /* ** Free all storage allocated by a message stream */ PRIVATE void sm_free(void) { while (messages != 0) { struct messages *next = messages; messages = messages->next; sm_free(messages); next = 0; return; } } /* ** Return the next message available for reading from a message stream */ PRIVATE void sm_next(void) { struct messages *next = messages; if (next == 0) return; messages = next->next; sm_free(next->metaname); sm_free(next->filename); sm_free(next); } /* ** Return an array with a message objects */ PRIVATE void * sm_get(int count) { int