text
stringlengths
4
6.14k
#ifndef SYNTAX_H_ #define SYNTAX_H_ /*----------------------------------------------------------------------*\ syntax \*----------------------------------------------------------------------*/ /* IMPORTS */ #include "types.h" #include "memory.h" /* CONSTANTS */ /* TYPES */ /* DATA */ extern SyntaxEntry *stxs; /* Syntax table pointer */ /* FUNCTIONS */ extern ElementEntry *elementTreeOf(SyntaxEntry *stx); extern char *parameterNameInSyntax(int syntaxNumber, int parameterNumber); extern SyntaxEntry *findSyntaxTreeForVerb(int verbCode); #endif /* SYNTAX_H_ */
/* $Xorg: StCols.c,v 1.3 2000/08/17 19:44:56 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * All Rights Reserved * * This file is a component of an X Window System-specific implementation * of Xcms based on the TekColor Color Management System. Permission is * hereby granted to use, copy, modify, sell, and otherwise distribute this * software and its documentation for any purpose and without fee, provided * that this copyright, permission, and disclaimer notice is reproduced in * all copies of this software and in supporting documentation. TekColor * is a trademark of Tektronix, Inc. * * Tektronix makes no representation about the suitability of this software * for any purpose. It is provided "as is" and with all faults. * * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. * * * NAME * XcmsStCols.c * * DESCRIPTION * Source for XcmsStoreColors * * */ /* $XFree86: xc/lib/X11/StCols.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" /************************************************************************ * * * PUBLIC ROUTINES * * * ************************************************************************/ /* * NAME * XcmsStoreColors - Store Colors * * SYNOPSIS */ Status XcmsStoreColors( Display *dpy, Colormap colormap, XcmsColor *pColors_in, unsigned int nColors, Bool *pCompressed) /* * DESCRIPTION * Given device-dependent or device-independent color * specifications, this routine will convert them to X RGB * values then use it in a call to XStoreColors. * * RETURNS * XcmsFailure if failed; * XcmsSuccess if it succeeded without gamut compression; * XcmsSuccessWithCompression if it succeeded with gamut * compression; * * Since XStoreColors has no return value, this routine * does not return color specifications of the colors actually * stored. */ { XcmsColor Color1; XcmsColor *pColors_tmp; Status retval; /* * Make copy of array of color specifications so we don't * overwrite the contents. */ if (nColors > 1) { pColors_tmp = (XcmsColor *) Xmalloc(nColors * sizeof(XcmsColor)); } else { pColors_tmp = &Color1; } memcpy((char *)pColors_tmp, (char *)pColors_in, nColors * sizeof(XcmsColor)); /* * Call routine to store colors using the copied color structures */ retval = _XcmsSetGetColors (XStoreColors, dpy, colormap, pColors_tmp, nColors, XcmsRGBFormat, pCompressed); /* * Free copies as needed. */ if (nColors > 1) { Xfree((char *)pColors_tmp); } /* * Ah, finally return. */ return(retval); }
//#define NUM 10 #define SUM (3*NUM) #define NX 1 #define NY (2*NUM) int x=0; int y=0; #include "seq_inv.h" void * t1() { for(int i =0; i<NUM; i++) { int t; t = read_y4(); write_y(t + 1); } write_x(1); } void * t2() { int t; while (read_xo() != 1) {} t = read_yo(); for(int i =0; i<NUM; i++) { write_y(t + 2); t = read_y4(); } } int main(int argc, char **argv) { /* pthread_t id1, id2; */ /* pthread_create(&id1, NULL, t1, NULL); */ /* pthread_create(&id2, NULL, t2, NULL); */ /* pthread_join(id1, (void *)0); */ /* pthread_join(id2, (void *)0); */ sysinit(); procinit(); t1(); procend(); procinit(); t2(); procend(); sysend(); assert(y > 0); return 0; }
#ifndef _HAXWELL_H_ #define _HAXWELL_H_ #include "HAXWell_Utils.h" namespace HAXWell { typedef void* ShaderHandle; typedef void* BufferHandle; typedef void* TimerHandle; typedef void* FenceHandle; typedef unsigned int timer_t; struct ShaderArgs { size_t nDispatchThreadCount; ///< Number of EU HW threads to dispatch per thread group. Maximum is 64 size_t nSIMDMode; ///< Must be 8, 16, or 32 const void* pIsa; ///< Pointer to the instructions size_t nIsaLength; ///< Length of instruction stream in bytes size_t nCURBEAllocsPerThread; ///< Number of 256-bit constant vectors per dispatched thread ///< Each thread's N constant vecotrs are pre-loaded into GPRs 1-N const void* pCURBE; ///< Pointer to the constant data }; enum { MAX_DISPATCH_COUNT = 64, ///< Thread counts higher than this have led to instability MAX_BUFFERS = 6, BIND_TABLE_BASE = 0x38, // Shader storage buffers start at this bind table index }; bool Init( bool bCreateGLContext ); BufferHandle CreateBuffer( const void* pOptionalInitialData, size_t nDataSize ); void* MapBuffer( BufferHandle h ); void UnmapBuffer( BufferHandle h ); void ReleaseBuffer( BufferHandle hBuffer ); ShaderHandle CreateShader( const ShaderArgs& rShader ); ShaderHandle CreateGLSLShader( const char* pGLSL ); void ReleaseShader( ShaderHandle hShader ); // Timer usage: // t = BeginTimer() // .. do stuff.... // EndTimer(t) // ReadTimer(t) // t is deallocated // TimerHandle BeginTimer(); void EndTimer( TimerHandle hTimer ); timer_t ReadTimer( TimerHandle hTimer ); void DispatchShader( ShaderHandle hShader, BufferHandle* pBuffers, size_t nBuffers, size_t nThreadGroups ); void Flush(); void Finish(); FenceHandle BeginFence(); void WaitFence( FenceHandle hFence ); /// Compile GLSL and extract its ISA bool RipIsaFromGLSL( Blob& blob, const char* pGLSL ); } #endif
/* Copyright 2013-2017 Matt Tytel * * helm 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. * * helm 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 helm. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #ifndef UPDATE_CHECK_SECTION_H #define UPDATE_CHECK_SECTION_H #include "JuceHeader.h" class UpdateMemory : public DeletedAtShutdown { public: UpdateMemory(); virtual ~UpdateMemory(); bool shouldCheck() const { return needs_check_; } void check() { needs_check_ = false; } JUCE_DECLARE_SINGLETON(UpdateMemory, false) private: bool needs_check_; }; class UpdateCheckSection : public Component, public Button::Listener { public: UpdateCheckSection(String name); ~UpdateCheckSection() { } void paint(Graphics& g) override; void resized() override; void buttonClicked(Button* clicked_button) override; void mouseUp(const MouseEvent& e) override; void checkUpdate(); Rectangle<int> getUpdateCheckRect(); private: ScopedPointer<TextButton> download_button_; ScopedPointer<TextButton> nope_button_; String version_; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UpdateCheckSection) }; #endif // UPDATE_CHECK_SECTION_H
/* * twtw-graphicscache-maemo.c * TwentyTwenty * * Copyright 2008 Pauli Olavi Ojala. All rights reserved. * */ /* This file is part of TwentyTwenty. TwentyTwenty 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. TwentyTwenty 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 TwentyTwenty. If not, see <http://www.gnu.org/licenses/>. */ #include "twtw-maemo.h" #include "twtw-graphicscache.h" struct _TwtwCacheSurface { GdkPixmap *pixmap; gint w; gint h; cairo_t *activeCairoCtx; }; static TwtwCacheSurface g_mainCanvas = { NULL, 0, 0, NULL }; static void recreatePixmap(TwtwCacheSurface *surf, int w, int h, GdkDrawable *parentDrawable) { if (surf->pixmap) { g_object_unref(surf->pixmap); surf->pixmap = NULL; } surf->w = w; surf->h = h; if (w < 1 || h < 1) return; surf->pixmap = gdk_pixmap_new(parentDrawable, w, h, -1); cairo_t *cr = gdk_cairo_create( GDK_DRAWABLE(surf->pixmap) ); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 1, 1, 0.7, 1); cairo_paint(cr); cairo_destroy(cr); cr = NULL; ///printf("%s: created pixmap (%i, %i, parent %p)\n", __func__, w, h, parentDrawable); } void twtw_set_size_and_parent_for_shared_canvas_cache_surface (gint w, gint h, GdkDrawable *drawable) { if (w != g_mainCanvas.w || h != g_mainCanvas.h) { recreatePixmap(&g_mainCanvas, w, h, drawable); } } // surface used by the main canvas TwtwCacheSurface *twtw_shared_canvas_cache_surface () { return &g_mainCanvas; } // w/h can be -1 to create a surface with the same size as "surf" TwtwCacheSurface *twtw_cache_surface_create_similar (TwtwCacheSurface *surf, gint w, gint h) { g_return_val_if_fail(surf, NULL); g_return_val_if_fail(surf->pixmap, NULL); if (w < 0 && surf) w = surf->w; if (h < 0 && surf) h = surf->h; TwtwCacheSurface *newsurf = g_new0(TwtwCacheSurface, 1); recreatePixmap(newsurf, w, h, surf->pixmap); return newsurf; } void twtw_cache_surface_destroy(TwtwCacheSurface *surf) { if ( !surf) return; recreatePixmap(surf, 0, 0, NULL); g_free(surf); } gint twtw_cache_surface_get_width (TwtwCacheSurface *surf) { g_return_val_if_fail(surf, 0); return surf->w; } gint twtw_cache_surface_get_height (TwtwCacheSurface *surf) { g_return_val_if_fail(surf, 0); return surf->h; } void twtw_cache_surface_clear_rect (TwtwCacheSurface *surf, gint x, gint y, gint w, gint h) { g_return_if_fail(surf); g_return_if_fail(surf->pixmap); //printf("%s: %i, %i, %i, %i", __func__, x, y, w, h); if (w == 0 || h == 0) return; cairo_t *cr = gdk_cairo_create( GDK_DRAWABLE(surf->pixmap) ); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); //cairo_set_source_rgba(cr, 1, 1, 0.7, 1); cairo_set_source_rgba(cr, 1, 1, 1, 1); cairo_paint(cr); cairo_destroy(cr); cr = NULL; } // returns a platform-specific context (e.g. a cairo_t *) void *twtw_cache_surface_begin_drawing (TwtwCacheSurface *surf) { g_return_val_if_fail(surf, NULL); g_return_val_if_fail(surf->pixmap, NULL); g_return_val_if_fail(surf->activeCairoCtx == NULL, NULL); surf->activeCairoCtx = gdk_cairo_create( GDK_DRAWABLE(surf->pixmap) ); g_return_val_if_fail(surf->activeCairoCtx, NULL); return surf->activeCairoCtx; } void twtw_cache_surface_end_drawing (TwtwCacheSurface *surf) { g_return_if_fail(surf); g_return_if_fail(surf->activeCairoCtx); cairo_destroy(surf->activeCairoCtx); surf->activeCairoCtx = NULL; } void *twtw_cache_surface_get_sourceable (TwtwCacheSurface *surf) { g_return_val_if_fail(surf, NULL); g_return_val_if_fail(surf->pixmap, NULL); return surf->pixmap; }
//------------------------------------------------------------------------------ // // This file is part of AnandamideAPI Script // // copyright: (c) 2010 - 2016 // author: Alexey Egorov (FadeToBlack aka EvilSpirit) // mailto: anandamide@mail.ru // anandamide.script@gmail.com // // AnandamideAPI 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. // // AnandamideAPI 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 AnandamideAPI. If not, see <http://www.gnu.org/licenses/>. // //------------------------------------------------------------------------------ #ifndef ANANDAMIDEINPUT_H #define ANANDAMIDEINPUT_H //------------------------------------------------------------------------------ #include "AnandamideLibAPI.h" #include "AnandamideVariable.h" //------------------------------------------------------------------------------ namespace Anandamide { class Output; class Neurone; class TypeDef; ///------------------------------------------------------------------------- /// /// \class Input /// /// \brief Класс входных параметров блоков /// ///------------------------------------------------------------------------- class ANANDAMIDE_API Input { friend class Neurone; Variable default_value; Output *source; Neurone *neurone; void setNeurone(Neurone *neurone); float pos_x; float pos_y; float dir_x; float dir_y; public: Input(const Variable &default_value_); /// /// \brief Получение значения входного параметра /// \return значение переменной по умолчанию в случае, если не задан выходной параметр, иначе значение выходного параметра /// const Variable &getValue() const; /// /// \brief Установка значения по умолчанию, которое будет получено в случае, если данный входной параметр не связан с выходным параметром /// \param default_value_ /// void setValue(const Variable &default_value_); /// /// \brief Получение переменной /// \return переменная /// Variable &getVariable(); /// /// \brief Получение переменной-значения по умолчанию /// \return переменная-значение по умолчанию /// Variable &getDefaultValue(); /// /// \brief Константная версия получения переменной-значения по умолчанию /// \return переменная-значение по умолчанию /// const Variable &getDefaultValue() const; /// /// \brief Получение источника (выходного параметра), с которым связан данный входной параметр /// \return выходной параметр, с которым связан данный входной параметр /// Output *getSource(); /// /// \brief Константная версия получения источника (выходного параметра), с которым связан данный входной параметр /// \return выходной параметр, с которым связан данный входной параметр /// const Output *getSource() const; /// /// \brief setSource /// \param source_ /// void setSource(Output *source_); /// /// \brief Получение имени данного входного параметра /// \return имя входного параметра /// const char *getName() const; /// /// \brief Получение блока, в котором содержится данный входной параметр /// \return указатель на блок, в которм содержится данный входной параметр /// Neurone *getNeurone(); /// /// \brief Константная версия получения блока, в котором содержится данный входной параметр /// \return указатель на блок, в которм содержится данный входной параметр /// const Neurone *getNeurone() const; /// /// \brief Получение определения типа для переменной данного входного параметра /// \return определение типа /// const TypeDef *getTypeDef() const; float getPosX() const; float getPosY() const; void setPos(float x, float y); float getDirX() const; float getDirY() const; void setDir(float x, float y); }; } #endif // ANANDAMIDEINPUT_H
/* * window___.h * * Created on: 2012-8-7 * Author: zzzzzzzzzzz */ #ifndef WINDOW____H_ #define WINDOW____H_ #include <map> #include "view___.h" #include "container___.h" class window_flag___ { public: GtkWindowType wt_; bool is_app_paintable_; window_flag___() { wt_ = GTK_WINDOW_TOPLEVEL; is_app_paintable_ = false; } void copy__(window_flag___* wf) { is_app_paintable_ = wf->is_app_paintable_; } }; class window___ { private: GtkWidget* window_; string name_; window_flag___ flag_; container___* c_; bool is_main_; GtkWidget* scrolled_; GtkWidget *box_, *box2_, *box3_, *box4_, *event_box_; public: string code_; map<int, string> codes_; GdkCursor *cursor_; static bool add_event_box_; bool is_destroy_; window___(const char* name, bool is_main = false); const string& name__(){return name_;} void name2__(string& name2, GtkWidget *sw); bool can_set__(){return window_!=NULL;} bool is_main__() {return is_main_;} container___* c__() {return c_;} GtkWidget* widget__(){return window_;} GtkWindow* window__(){return GTK_WINDOW (window_);} GtkWidget* scrolled__() {return scrolled_;} GtkWidget* box__(){return box_;} GtkWidget* box2__(){return box2_;} GtkWidget* box3__(){return box3_;} GtkWidget* box4__(){return box4_;} GtkWidget* event_box__(){ //return event_box_; return window_; } static window___* from__(GtkWidget* widget); GtkWidget* new__(window_flag___* flag, container___* c); void destroy__(); void hide__(); bool is_app_paintable__() {return flag_.is_app_paintable_;} view___* view__(int page_num) {return c__()->view__(page_num);} }; #endif /* WINDOW____H_ */
/* Solucao para o problema "Número de Envelopes" da OBI 2009 por: Igor Ribeiro de Assis */ #include <stdio.h> #include <string.h> /* memset() */ #define MAXK 1010 int qtd[MAXK]; int main() { int N, K, menor; int i, x; scanf("%d%d", &N, &K); /* conta quantos rótulos de cada tipo Aldo tem */ memset(qtd, 0, sizeof(qtd)); for (i = 0; i < N; i++) { scanf("%d", &x); qtd[x]++; } /* o máximo de envelopes é igual ao numero de rótulos em menor quantidade */ menor = qtd[1]; for (i = 2; i <= K; i++) if (qtd[i] < menor) menor = qtd[i]; printf("%d\n", menor); return 0; }
/* ** CONIO.H ** Low level console functions ** ** (c) 1997, SOLID MSX C * * * SDCC port 2015 * Uses BIOS only. Very basis, small code. * */ extern char getch (); /* read char from console */ extern char getche (); /* read and display char from console */ extern void putch (char c); /* display char */ extern void cputs (char *s); /* display string */ extern void gohome (); /* set cursor to 0,0 */ extern void gotoxy (int x, int y); /* set cursor to x,y */ extern void clrscr (); /* clear screen */ extern char kbhit(); /* checks keypress */ extern void putdec(int num); /* displays signed integer value */ /* -32768 to 32767 (larges code) */ extern void Mode80(); /* sets MODE 80 */ extern void Mode40(); /* sets MODE 40 */ /* sets colors */ extern void SetColor( int foreground, int background, int border );
#pragma once #include "afx.h" #include "Geometry.h" namespace OldGraphElement { #include "../CommonFiles/GraphElement.h" } class GraphElement : public OldGraphElement::GraphElement { public: GraphElement(Color color = Color::White) : OldGraphElement::GraphElement(color) {} virtual void paintPerspective(Graphics &graphics, PointF center, Geometry::GPointF viewPoint) {}; };
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: android/libcore/luni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java // // Created by tball on 11/23/13. // #ifndef _JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_H_ #define _JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_H_ @class IOSClass; @class SunMiscUnsafe; #import "JreEmulation.h" @interface JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater : NSObject { } + (JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater *)newUpdaterWithIOSClass:(IOSClass *)tclass withIOSClass:(IOSClass *)vclass withNSString:(NSString *)fieldName OBJC_METHOD_FAMILY_NONE; - (id)init; - (BOOL)compareAndSetWithId:(id)obj withId:(id)expect withId:(id)update; - (BOOL)weakCompareAndSetWithId:(id)obj withId:(id)expect withId:(id)update; - (void)setWithId:(id)obj withId:(id)newValue; - (void)lazySetWithId:(id)obj withId:(id)newValue; - (id)getWithId:(id)obj; - (id)getAndSetWithId:(id)obj withId:(id)newValue; @end @interface JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_AtomicReferenceFieldUpdaterImpl : JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater { @public long long int offset_; IOSClass *tclass_; IOSClass *vclass_; IOSClass *cclass_; } + (SunMiscUnsafe *)unsafe; - (id)initWithIOSClass:(IOSClass *)tclass withIOSClass:(IOSClass *)vclass withNSString:(NSString *)fieldName; - (void)targetCheckWithId:(id)obj; - (void)updateCheckWithId:(id)obj withId:(id)update; - (BOOL)compareAndSetWithId:(id)obj withId:(id)expect withId:(id)update; - (BOOL)weakCompareAndSetWithId:(id)obj withId:(id)expect withId:(id)update; - (void)setWithId:(id)obj withId:(id)newValue; - (void)lazySetWithId:(id)obj withId:(id)newValue; - (id)getWithId:(id)obj; - (void)ensureProtectedAccessWithId:(id)obj; - (void)copyAllFieldsTo:(JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_AtomicReferenceFieldUpdaterImpl *)other; @end J2OBJC_FIELD_SETTER(JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_AtomicReferenceFieldUpdaterImpl, tclass_, IOSClass *) J2OBJC_FIELD_SETTER(JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_AtomicReferenceFieldUpdaterImpl, vclass_, IOSClass *) J2OBJC_FIELD_SETTER(JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_AtomicReferenceFieldUpdaterImpl, cclass_, IOSClass *) #endif // _JavaUtilConcurrentAtomicAtomicReferenceFieldUpdater_H_
#include <stdio.h> #include <stdlib.h> /*Ejemplo de condicionales*/ int main() { int n,v; printf("Ingrese un numero.\n"); scanf("%d", &n); /* Si n sea igual a cero, le asigno 1 a la variable V e imprimo. En cualquier otro caso, le asigno 0 a V e imprimo. */ v = n==0 ? 1 : 0; printf("El valor de la variable v es: %d\n\n", v); /*Cambio la forma en que imprimo*/ printf("Otra forma de imprimir...!\n"); printf("El valor de la variable n es: %d\n", n==0 ? 1 : 0); printf("\n\n"); printf("Ahora lo imprimo como tipo String\n"); printf("El valor de la variable n es: %s\n", n==0 ? "1" : "0"); return 0; }
#ifndef __VEGA_RENDER_GRAPH_VIEW__ #define __VEGA_RENDER_GRAPH_VIEW__ #include "common.h" #include "../data/volume.h" #include "../common/model_view_controller.h" namespace vega { namespace render { class graph_view : public mvc::i_view { public: graph_view() : myRenderFlag(false), myPrimitiveIsLine(true), myVerticesAreIndexed(false) { } virtual bool create(); virtual void update(); void mst_kruskal(); virtual void render() const; void toggle_render_flag() { myRenderFlag = !myRenderFlag; } void toggle_render_primitive() { myPrimitiveIsLine = !myPrimitiveIsLine; } private: bool myRenderFlag; bool myPrimitiveIsLine; bool myVerticesAreIndexed; std::vector<math::vector3d> myVertices; std::vector<uint32> myIndices; std::vector<math::vector4d> myColors; }; class graph_controller : public mvc::i_controller { public: virtual void handle_keyboard( unsigned char key, int x, int y ); }; } } #endif // __VEGA_RENDER_GRAPH_VIEW__
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://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 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. ** ** In addition, 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. ** ****************************************************************************/ #ifndef EXTERNALTOOLMANAGER_H #define EXTERNALTOOLMANAGER_H #include "core_global.h" #include <QObject> #include <QMap> #include <QList> #include <QString> namespace Core { namespace Internal { class ExternalTool; } class CORE_EXPORT ExternalToolManager : public QObject { Q_OBJECT public: ExternalToolManager(); ~ExternalToolManager(); static ExternalToolManager *instance(); static QMap<QString, QList<Internal::ExternalTool *> > toolsByCategory(); static QMap<QString, Internal::ExternalTool *> toolsById(); static void setToolsByCategory(const QMap<QString, QList<Internal::ExternalTool *> > &tools); static void emitReplaceSelectionRequested(const QString &output); signals: void replaceSelectionRequested(const QString &text); }; } // namespace Core #endif // EXTERNALTOOLMANAGER_H
/* * Copyright (C) 2011-2012 DarkCore <http://www.darkpeninsula.eu/> * Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2012 MaNGOS <http://getmangos.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 <http://www.gnu.org/licenses/>. */ #ifndef MODEL_H #define MODEL_H #include "loadlib/loadlib.h" #include "vec3d.h" //#include "mpq.h" #include "modelheaders.h" #include <vector> class Model; class WMOInstance; class MPQFile; Vec3D fixCoordSystem(Vec3D v); class Model { public: ModelHeader header; uint32 offsBB_vertices, offsBB_indices; Vec3D *BB_vertices, *vertices; uint16 *BB_indices, *indices; size_t nIndices; bool open(); bool ConvertToVMAPModel(char * outfilename); bool ok; Model(std::string &filename); ~Model(); private: std::string filename; char outfilename; }; class ModelInstance { public: Model *model; uint32 id; Vec3D pos, rot; unsigned int d1, scale; float w, sc; ModelInstance() {} ModelInstance(MPQFile &f, const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile); }; #endif
#include "MEM.h" static void dump_buffer(unsigned char *buf, int size) { int i; for (i = 0; i < size; i++) { printf("%02x ", buf[i]); if (i % 16 == 15) { printf("\n"); } } printf("\n"); } static void fill_buffer(unsigned char *buf, int size) { int i; for (i = 0; i < size; i++) { buf[i] = i; } } int main(void) { unsigned char *p1; unsigned char *p2; unsigned char *p3; p1 = MEM_malloc(10); dump_buffer(p1, 10); fill_buffer(p1, 10); dump_buffer(p1, 10); MEM_dump_blocks(stdout); p2 = MEM_malloc(10); p2 = MEM_realloc(p2, 15); dump_buffer(p2, 15); MEM_dump_blocks(stdout); p2 = MEM_realloc(p2, 8); dump_buffer(p2, 8); MEM_dump_blocks(stdout); p3 = NULL; p3 = MEM_realloc(p3, 10); dump_buffer(p3, 10); fill_buffer(p3, 10); dump_buffer(p3, 10); MEM_dump_blocks(stdout); MEM_free(p2); dump_buffer(p2, 8); MEM_free(p1); dump_buffer(p1, 10); MEM_free(p3); dump_buffer(p3, 10); fprintf(stderr, "final dump\n"); MEM_dump_blocks(stdout); return 0; }
/******************************************************************************* * * 2009-2010 Nico Schottelius (nico-ceofhack at schottelius.org) * * This file is part of ceofhack. * ceofhack 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. * * ceofhack 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 ceofhack. If not, see <http://www.gnu.org/licenses/>. * * Initialise the ID "generator" * */ #include <eof.h> /* EOF* */ unsigned long eof_id; int eof_id_init() { eof_id = 0; return 1; }
/*! \file Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from U.S. Dept. of Energy) All rights reserved. The source code is distributed under BSD license, see the file License.txt at the top-level directory. */ #include "slu_mt_ddefs.h" void pxgstrf_relax_snode( const int_t n, /* number of columns in the matrix */ superlumt_options_t* superlumt_options, pxgstrf_relax_t* pxgstrf_relax /* relaxed s-nodes */ ) { /* * -- SuperLU MT routine (version 2.0) -- * Lawrence Berkeley National Lab, Univ. of California Berkeley, * and Xerox Palo Alto Research Center. * September 10, 2007 * * Purpose * ======= * pxgstrf_relax_snode() identifes the initial relaxed supernodes, * assuming that the matrix has been reordered according to the postorder * of the etree. * */ register int_t j, parent, rs; register int_t fcol; /* beginning of a snode */ int_t* desc; /* no of descendants of each etree node. */ int_t* etree = superlumt_options->etree; /* column elimination tree */ int_t relax = superlumt_options->relax; /* maximum no of columns allowed in a relaxed s-node */ desc = intCalloc(n + 1); /* Compute the number of descendants of each node in the etree */ for(j = 0; j < n; j++) { parent = etree[j]; desc[parent] += desc[j] + 1; } rs = 1; /* Identify the relaxed supernodes by postorder traversal of the etree. */ for(j = 0; j < n;) { parent = etree[j]; fcol = j; while(parent != n && desc[parent] < relax) { j = parent; parent = etree[j]; } /* found a supernode with j being the last column. */ pxgstrf_relax[rs].fcol = fcol; pxgstrf_relax[rs].size = j - fcol + 1; #ifdef DOMAINS for (i = fcol; i <= j; ++i) in_domain[i] = RELAXED_SNODE; #endif j++; rs++; /* Search for a new leaf */ while(desc[j] != 0 && j < n) j++; } pxgstrf_relax[rs].fcol = n; pxgstrf_relax[0].size = rs - 1; /* number of relaxed supernodes */ #if (PRNTlevel==1) printf(".. No of relaxed s-nodes %d\n", pxgstrf_relax[0].size); #endif SUPERLU_FREE(desc); }
/* Copyright 2011, 2012 David Malcolm <dmalcolm@redhat.com> Copyright 2011, 2012 Red Hat, Inc. This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <Python.h> #include "gcc-python.h" #include "gcc-python-wrappers.h" /* Wrapper for GCC's "location_t" GCC's input.h has: typedef source_location location_t; GCC's line-map.h has: A logical line/column number, i.e. an "index" into a line_map: typedef unsigned int source_location; */ PyObject * gcc_Location_repr(struct PyGccLocation * self) { return gcc_python_string_from_format("gcc.Location(file='%s', line=%i)", LOCATION_FILE(self->loc), LOCATION_LINE(self->loc)); } PyObject * gcc_Location_str(struct PyGccLocation * self) { return gcc_python_string_from_format("%s:%i", LOCATION_FILE(self->loc), LOCATION_LINE(self->loc)); } PyObject * gcc_Location_richcompare(PyObject *o1, PyObject *o2, int op) { struct PyGccLocation *locobj1; struct PyGccLocation *locobj2; int cond; PyObject *result_obj; assert(Py_TYPE(o1) == (PyTypeObject*)&gcc_LocationType); if (Py_TYPE(o1) != (PyTypeObject*)&gcc_LocationType) { result_obj = Py_NotImplemented; goto out; } locobj1 = (struct PyGccLocation *)o1; locobj2 = (struct PyGccLocation *)o2; switch (op) { case Py_EQ: cond = (locobj1->loc == locobj2->loc); break; case Py_NE: cond = (locobj1->loc != locobj2->loc); break; default: result_obj = Py_NotImplemented; goto out; } result_obj = cond ? Py_True : Py_False; out: Py_INCREF(result_obj); return result_obj; } PyObject * gcc_python_make_wrapper_location(location_t loc) { struct PyGccLocation *location_obj = NULL; if (UNKNOWN_LOCATION == loc) { Py_RETURN_NONE; } location_obj = PyGccWrapper_New(struct PyGccLocation, &gcc_LocationType); if (!location_obj) { goto error; } location_obj->loc = loc; return (PyObject*)location_obj; error: return NULL; } void wrtp_mark_for_PyGccLocation(PyGccLocation *wrapper) { /* empty */ } /* PEP-7 Local variables: c-basic-offset: 4 indent-tabs-mode: nil End: */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <Foundation/Foundation.h> @class NSError, WAVideoPreviewViewController; @protocol WAVideoPreviewViewControllerDelegate <NSObject> - (void)videoPreviewViewControllerDidCancel:(WAVideoPreviewViewController *)arg1; - (void)videoPreviewViewController:(WAVideoPreviewViewController *)arg1 didFailWithError:(NSError *)arg2; - (void)videoPreviewViewControllerDidConfirmVideo:(WAVideoPreviewViewController *)arg1; @end
/** * @file * * @brief Endgame utils module. * * @par endgame_utils.c * <tt> * This file is part of the reversi program * http://github.com/rcrr/reversi * </tt> * @author Roberto Corradini mailto:rob_corradini@yahoo.it * @copyright 2021 Roberto Corradini. All rights reserved. * * @par License * <tt> * 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, or (at your option) any * later version. * \n * 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. * \n * 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 * or visit the site <http://www.gnu.org/licenses/>. * </tt> */ #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "endgame_utils.h"
/* SQUID - A C function library for biological sequence analysis * Copyright (C) 1992-1996 Sean R. Eddy * * This source code is distributed under terms of the * GNU General Public License. See the files COPYING * and GNULICENSE for further details. * */ /* msf.c * SRE, Sun Jul 11 16:17:32 1993 * * Export of GCG MSF multiple sequence alignment * formatted files. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "squid.h" #ifdef MEMDEBUG #include "dbmalloc.h" #endif /* Function: WriteMSF() * * Purpose: Write aseqs, names, weights to an open fp, * in GCG MSF format. The alignment must * be flushed (all aseqs the same length, padded * with gaps) * * Returns 1 on success. Returns 0 on failure, and sets * squid_errno to indicate the cause. */ int WriteMSF(FILE *fp, /* open fp for writing */ char **aseqs, /* aligned sequences */ int num, struct aliinfo_s *ainfo) { int still_going; /* True if writing another block */ int idx; /* counter for sequences */ int pos; /* position counter */ int namelen; /* maximum name length used */ int len; /* tmp variable for name lengths */ char buffer[51]; /* buffer for writing seq */ char **sqptr; /* ptrs into each sequence */ int charcount; /* num. symbols we're writing */ float weight; /* allocate seq pointers that we'll move across each sequence */ if ((sqptr = (char **) malloc (num * sizeof(char *))) == NULL) { squid_errno = SQERR_MEM; return 0; } /* set sqptrs to start of each seq */ for (idx = 0; idx < num; idx++) sqptr[idx] = aseqs[idx]; /* calculate max namelen used */ namelen = 0; for (idx = 0; idx < num; idx++) if ((len = strlen(ainfo->sqinfo[idx].name)) > namelen) namelen = len; /***************************************************** * Write the title line *****************************************************/ fprintf(fp, "\n"); /* ack! we're writing bullshit here */ fprintf(fp, " MSF: 000 Type: X Check: 0000 ..\n"); fprintf(fp, "\n"); /***************************************************** * Write the names *****************************************************/ for (idx = 0; idx < num; idx++) { weight = 1.0; if (ainfo->sqinfo[idx].flags & SQINFO_WGT) weight = ainfo->sqinfo[idx].weight; fprintf(fp, " Name: %-*.*s Len: %5d Check: %5d Weight: %.4f\n", namelen, namelen, ainfo->sqinfo[idx].name, ainfo->alen, GCGchecksum(aseqs[idx], ainfo->alen), weight); } fprintf(fp, "\n"); fprintf(fp, "//\n"); fprintf(fp, "\n"); /***************************************************** * Write the sequences *****************************************************/ still_going = 1; while (still_going) { still_going = 0; for (idx = 0; idx < num; idx++) { fprintf(fp, "%-*.*s ", namelen, namelen, ainfo->sqinfo[idx].name); /* get next line's worth of 50 from seq */ strncpy(buffer, sqptr[idx], 50); buffer[50] = '\0'; charcount = strlen(buffer); /* is there still more to go? */ if (charcount == 50 && sqptr[idx][50] != '\0') still_going = 1; /* shift the seq ptr by a line */ sqptr[idx] += charcount; /* draw the sequence line */ pos = 0; while (pos < charcount) { if (isgap(buffer[pos])) fputc('.', fp); else fputc(buffer[pos], fp); pos++; if (!(pos % 10)) fputc(' ', fp); } fputc('\n', fp); } /* put blank line between blocks */ fputc('\n', fp); } free(sqptr); return 1; } void FlushAlignment(char **aseqs, int num, int *ret_alen) { int len, alen; int idx; int apos; alen = strlen(aseqs[0]); for (idx = 1; idx < num; idx++) if ((len = strlen(aseqs[idx])) > alen) alen = len; for (idx = 0; idx < num; idx++) { if ((aseqs[idx] = (char *) realloc (aseqs[idx], sizeof(char) * (alen+1))) == NULL) Die("realloc failed"); for (apos = strlen(aseqs[idx]); apos < alen; apos++) aseqs[idx][apos] = '.'; aseqs[idx][apos] = '\0'; } *ret_alen = alen; }
#include "header.h" #include "log.h" #include <time.h> void LogDateTime() { time_t t = time(NULL); struct tm tm = *localtime(&t); printf("%04d/%02d/%02d %02d:%02d:%02d ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); } void LogText(char* message) { printf("%s\n"); } void LogMessage(int status, char* message, int address) { LogDateTime(); if (!status) printf("%s on %#02x: error.\n", message, address); else printf("%s on %#02x: done.\n", message, address); } void LogMessageAddress(int status, char* message, int address, int data) { LogDateTime(); if (!status) printf("%s on %#02x to %#02x: error.\n", message, address, data); else printf("%s on %#02x to %#02x: done.\n", message, address, data); } void LogMessageInt(int status, char* message, int address, int data) { LogDateTime(); if (!status) printf("%s on %#02x to %d: error.\n", message, address, data); else printf("%s on %#02x to %d: done.\n", message, address, data); } void LogMessageText(int status, char* message, int address, char* data) { LogDateTime(); if (!status) printf("%s on %#02x to %s: error.\n", message, address, data); else printf("%s on %#02x to %s: done.\n", message, address, data); }
/****************************************************************************** * * (C) Copyright 2007 * Panda Xiong, yaxi1984@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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * History: * 2007.03.27 Panda Xiong Create * ******************************************************************************/ #include "cli_api.h" /****************************************************************************** * FUNCTION NAME: * CLI_PAR_ParseCmd * DESCRIPTION: * Parse command. * INPUT: * ptr : The input command to be parsed. * OUTPUT: * ptr : The new command which is parsed. * param : All the parsed parameters' start address. * RETURN: * The number of parameters. * NOTES: * This function will directly modify the command in 'ptr'. * HISTORY: * Ver1.00 2007.02.14 Panda Xiong Create ******************************************************************************/ CLI_CMD_PARAM_T CLI_PAR_ParseCmd(IN OUT UINT8 *ptr, OUT UINT8 *param[]) { CLI_CMD_PARAM_T n = 0; if (ptr == NULL) { return 0; } while (*ptr != '\0') { /* skip spaces */ while (*ptr == ' ') { ptr++; } if (*ptr == '\0') { return n; } param[n++] = ptr; while (*ptr != ' ') { if (*ptr == '\0') { return n; } ptr++; } /* add end character to this parameter */ *ptr++ = '\0'; } return n; }
/* pal.c */ /* OBI2004 */ /* Ulisses */ #include <stdio.h> #define NMAX 2002 #define INF NMAX*NMAX char str[NMAX], pal[NMAX][NMAX]; int n, partes[NMAX]; int main(void) { int i, j, menor, val, teste = 1; while (scanf("%d", &n)==1 && n) { scanf(" %s", str); memset(pal, 0, sizeof(pal)); for (i=0; i<n; i++) pal[i][i] = 1; for (j=1; j<n; j++) for (i=j-1; i>=0; i--) pal[i][j] = ((str[i]==str[j]) && (i+1>=j-1 || pal[i+1][j-1])); for (j=0; j<n; j++) { if (pal[0][j]) { partes[j] = 1; } else { menor = INF; for (i=1; i<=j; i++) { if (pal[i][j] && partes[i-1]+1<menor) menor = partes[i-1]+1; } partes[j] = menor; } } printf("Teste %d\n", teste++); printf("%d\n\n", partes[n-1]); } return 0; }
#pragma once #include "MCLTProxy.h" #include <io/inputs/InputManagerBase.h> template <typename data_type> class MCLTInputProxy : public MCLTProxy<data_type>, public InputManagerBase<data_type> { using InputManagerBase<data_type>::channels; using InputManagerBase<data_type>::frames; using MCLTProxy<data_type>::mclt; using complex_type = typename Parameters<data_type>::complex_type; private: Input_p inputImpl = nullptr; public: MCLTInputProxy(Input_p input, Parameters<data_type>& cfg): MCLTProxy<data_type>(cfg), InputManagerBase<data_type>(nullptr, cfg), inputImpl(input) { } virtual ~MCLTInputProxy() = default; virtual Audio_p getNextBuffer() final override { // 1. On get le buffer. Audio_p tmp = inputImpl->getNextBuffer(); if(tmp == nullptr) return tmp; auto& buf = getSpectrum<data_type>(tmp); for(auto& channel : buf) mclt.forward(channel); return tmp; } };
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class JNIlearn_JNIMath */ #ifndef _Included_JNIlearn_JNIMath #define _Included_JNIlearn_JNIMath #ifdef __cplusplus extern "C" { #endif /* * Class: JNIlearn_JNIMath * Method: jiecheng * Signature: (I)I */ JNIEXPORT jint JNICALL Java_JNIlearn_JNIMath_jiecheng (JNIEnv *, jclass, jint); #ifdef __cplusplus } #endif #endif
/* This file is part of DxTer. DxTer is a prototype using the Design by Transformation (DxT) approach to program generation. Copyright (C) 2015, The University of Texas and Bryan Marker DxTer 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. DxTer 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 DxTer. If not, see <http://www.gnu.org/licenses/>. */ #include "LLDLA.h" #include "transform.h" #if DOLLDLA class VAddSplitToMainAndResidual : public SingleTrans { private: Layer m_fromLayer, m_toLayer; VecType m_vecType; public: VAddSplitToMainAndResidual(Layer fromLayer, Layer toLayer, VecType vecType); virtual string GetType() const { return "VAddSplitToMainAndResidual" + std::to_string((long long int) m_vecType); } virtual bool IsRef() const { return true; } virtual bool CanApply(const Node* node) const; virtual void Apply(Node* node) const; }; #endif // DOLLDLA
/*# ######################## Presentation and License ########################## **# # **# Development started in 3/2016 by: # **# Regis Moura Dantas <dantas.regis.m@gmail.com> # **# # **# This file is part of smart workbench library directed to arm # **# microcontrollers hosted by github at: # **# # **# https://github.com/regisdantas/smart_wb # **# # **# Smart Workbench 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. # **# # **# Smart Workbench 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 Smart Workbench library. # **# If not, see <http://www.gnu.org/licenses/>. # **# _____ _ __ __ ____ # **# / ____| | | \ \ / /| _ \ # **# | (___ _ __ ___ __ _ _ __ | |_ \ \ /\ / / | |_) | # **# \___ \ | '_ ` _ \ / _` || '__|| __| \ \/ \/ / | _ < # **# ____) || | | | | || (_| || | | |_ \ /\ / | |_) | # **# |_____/ |_| |_| |_| \__,_||_| \__| \/ \/ |____/ # **# _ # **# | | # **# | |__ _ _ # **# | '_ \ | | | | # **# | |_) || |_| | # **# |_.__/ \__, | # **# __/ | # **# |___/ # **# _____ _ _____ _ # **# | __ \ (_) | __ \ | | # **# | |__) | ___ __ _ _ ___ | | | | __ _ _ __ | |_ __ _ ___ # **# | _ / / _ \ / _` || |/ __| | | | | / _` || '_ \ | __|/ _` |/ __| # **# | | \ \| __/| (_| || |\__ \ | |__| || (_| || | | || |_| (_| |\__ \ # **# |_| \_\\___| \__, ||_||___/ |_____/ \__,_||_| |_| \__|\__,_||___/ # **# __/ | # **# |___/ # **# ############################################################################ */ #ifndef __SDI12 #define __SDI12 #define SD_DEBUG_SEMAPHORE #define SDI_MIN_PACKET_WITH_CRC_SIZE 4 #define SDI_MIN_PACKET_SIZE 3 #define SDI_BUFF_SIZE 100 #ifndef member_size #define member_size(type, member) sizeof(((type *)0)->member) #endif #include "stdint.h" #include "pt\pt.h" #include "ringbuffer.h" #include "main.h" #if defined(SWO_PRINTF_ENABLE) && defined(SD_DEBUG_SEMAPHORE) #define SDI12_DEBUG printf("SDI12 L:%d\n", __LINE__) #define SDI12_DEBUG_TEXT(text) printf("SDI12 %s L:%d\n", text, __LINE__) #else #define SDI12_DEBUG #define SDI12_DEBUG_TEXT(text) #endif #define SDI_NRETRIES_FAILEDCRC 3 /* SDI12 HARDWARE DEFINES */ #define SDI_VOUT_ON GPIO_WriteBit(GPIOB, ENVOUT, Bit_SET) #define SDI_VOUT_OFF GPIO_WriteBit(GPIOB, ENVOUT, Bit_RESET) //#define SDI_VOUT_OFF #define sdi_assert_en_pin() GPIO_WriteBit(GPIOB, SDIEN, Bit_RESET) #define sdi_deassert_en_pin() GPIO_WriteBit(GPIOB, SDIEN, Bit_SET) struct X_SDI_DATA{ uint8_t ucAddress; uint8_t ucWarmup; uint8_t ucCmd; uint8_t ucParam; }; typedef struct { uint8_t ucBuffer[SDI_BUFF_SIZE]; uint8_t ucCounter; }X_SDI12Packet; /* those timers must be decremented at every 1ms */ typedef struct { volatile uint16_t uiRetryTimer; volatile uint16_t ucTimer; volatile uint8_t ucBreakTimer; volatile uint8_t ucTimerMeasure; volatile uint8_t ucWarmupTimer; }X_SDI12Pub; typedef struct { struct pt thread; uint8_t ucInnerLoop; uint8_t ucOuterLoop; uint8_t ucReceivedSB; STRUCT_RB rbRX; uint8_t ucRXBuffer[10]; struct X_SDI_DATA sdiData; }X_SDI12; extern X_SDI12Pub xSDIP; void vInitSDI12(); PT_THREAD(ptSDIEnableBus(struct pt* pt, uint8_t ucWarmup)); PT_THREAD(ptSDIMeasure(struct pt* pt, struct X_SDI_DATA *sdiData, uint8_t* pStatus, float* pReturn)); PT_THREAD(ptSDIDisableBus(struct pt* pt)); #endif
#include <mcf5282.h> #include "config.h" #include "network/udp.h" #include "dect.h" #include "dect-server.h" static void dect_serv_recv_lapc(struct msg_lapc_data *pkt, uint16 len) { int i, j; mbc_inst_t *mbc; uint8 *pdata, plen; pdata = (uint8 *)pkt + sizeof(struct msg_lapc_data); plen = len - sizeof(struct msg_lapc_data); for (i = 0; i < DECT_MBC_MAX; i++) { if ( (dect->mbc[i].pmid == pkt->pmid) && (dect->mbc[i].ecn == pkt->ecn) ) { /* MBC found*/ mbc = &dect->mbc[i]; mbc->uplane = pkt->uplane; /* Free space check */ if ((DECT_CS_MAX_FLEN - mbc->cs_send_len) < len) return; if (plen % 5) return; /* Copy data packet */ for (j = 0; j < plen; j++) mbc->cs_send[mbc->cs_send_len+j] = pdata[j]; mbc->cs_send_len += plen; break; } } } static void dect_serv_recv_paging(uint8 *data, uint16 len) { if (len < 3) return; dect->ptail[0] = data[0]; dect->ptail[1] = data[1]; dect->ptail[2] = data[2]; dect->ptail[4] = 7; term_log_all("DECT: Paging message %X %X %X\r\n", data[0], data[1], data[2]); } static void dect_serv_recv_voice(uint8 *data, uint16 len) { struct msg_voice_data *msg; uint8 *voice; msg = (struct msg_voice_data *)data; voice = (uint8 *)data + sizeof(struct msg_voice_data); dect_mbc_voice_recv(msg->pmid, msg->ecn, voice, len - sizeof(struct msg_voice_data)); } /* dect_serv_handler() * Called when received UDP packed from DECT server. */ void dect_serv_handler(uint32 server_ip, uint8 *data, uint16 len) { struct dect_packet *pkt; void *pdata; uint16 plen; /* Check if module is initialized */ if (!dect) return; pkt = (struct dect_packet *)data; if (len < sizeof(struct dect_packet)) return; /* Check sign */ if (pkt->sign[0] != 'D') return; if (pkt->sign[1] != 'S') return; pdata = (uint8 *)pkt + sizeof(struct dect_packet); plen = pkt->len; switch (pkt->type) { case DECT_MSG_LAPC_DATA: dect_serv_recv_lapc((struct msg_lapc_data *)pdata, plen); break; case DECT_MSG_PAGING: dect_serv_recv_paging(pdata, plen); break; case DECT_MSG_VOICE: dect_serv_recv_voice(pdata, plen); break; } } void dect_serv_send(uint8 *data, uint16 len) { struct dect_packet pkt; IF_BUFFER if_hdr, if_data; if (!dect->config.dect_server) return; /* Packet header */ pkt.sign[0] = 'F'; pkt.sign[1] = 'P'; pkt.fpid = dect->config.fpid; pkt.rfpi[0] = dect->rfpi[0]; pkt.rfpi[1] = dect->rfpi[1]; pkt.rfpi[2] = dect->rfpi[2]; pkt.rfpi[3] = dect->rfpi[3]; pkt.rfpi[4] = dect->rfpi[4]; pkt.rfpi[5] = dect->rfpi[5]; /* Send packet */ if_hdr.data = (uint8 *)&pkt; if_hdr.size = sizeof(pkt) - 4; if_hdr.next = &if_data; if_data.data = data; if_data.size = len; if_data.next = NULL; udp_send(0, DECT_CLIENT_PORT, dect->config.dect_server, DECT_SERVER_PORT, &if_hdr); } void dect_serv_buffer_add(dect_buf_t *buffer, uint16 cmd, uint16 size, void *data) { uint16 *hdr = (uint16 *)(buffer->packet + buffer->size); /* Store packet header */ hdr[0] = cmd; hdr[1] = size; buffer->size += 4; /* Copy packet data */ if (size && data) { memcpy(buffer->packet + buffer->size, data, size); buffer->size += size; } } void dect_serv_send_ping() { int i, mbc_count; uint8 buf[100]; dect_buf_t buffer; struct msg_sysinfo m_sysinfo; /* Prepare buffer */ buffer.packet = buf; buffer.size = 0; /* PING message */ dect_serv_buffer_add(&buffer, DECT_MSG_PING, 0, NULL); /* SYSINFO message */ mbc_count = 0; for (i = 0; i < DECT_MBC_MAX; i++) { if (dect->mbc[i].pmid) mbc_count++; } m_sysinfo.v_mbclist = 0; m_sysinfo.mbc_count = mbc_count; m_sysinfo.hlcap = 0; dect_serv_buffer_add(&buffer, DECT_MSG_SYSINFO, sizeof(m_sysinfo), &m_sysinfo); /* Send packet */ dect_serv_send(buffer.packet, buffer.size); } void dect_serv_send_lapc(uint32 pmid, uint8 ecn, uint8 *data, uint8 len) { uint16 buf[64]; struct msg_lapc_data *msg; uint8 *sdata; int i; msg = (struct msg_lapc_data *)&buf[2]; sdata = (uint8 *)msg + sizeof(struct msg_lapc_data); buf[0] = DECT_MSG_LAPC_DATA; buf[1] = sizeof(struct msg_lapc_data) + len; msg->pmid = pmid; msg->ecn = ecn; for (i = 0; i < len; i++) *sdata++ = data[i]; dect_serv_send((uint8 *)buf, buf[1] + 4); } void dect_serv_send_voice(uint32 pmid, uint8 ecn, uint8 *data, uint8 len) { uint16 buf[128]; struct msg_voice_data *msg; uint8 *sdata; int i; buf[0] = DECT_MSG_VOICE; buf[1] = len + sizeof(struct msg_voice_data); msg = (struct msg_voice_data *)&buf[2]; sdata = (uint8 *)msg + sizeof(struct msg_voice_data); msg->pmid = pmid; msg->ecn = ecn; msg->seq = dect->frame + 16 * dect->mframe; for (i = 0; i < len; i++) *sdata++ = data[i]; dect_serv_send((uint8 *)buf, buf[1] + 4); }
/* This file is part of bbflash. Copyright (C) 2013, Hao Liu and Robert L. Thompson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LPC_H_ #define LPC_H_ #include "gpio.h" typedef struct LPC_s { PIN *nibble; PIN *clock; PIN *lframe_; PIN *init_; } LPC; bool lpc_init(LPC *lpc); void lpc_cleanup(LPC *lpc); bool lpc_read_address(LPC *lpc, uint32_t addr, uint8_t *byte); bool lpc_write_address(LPC *lpc, uint32_t addr, uint8_t byte); #endif /* LPC_H_ */
#ifndef BASIC_AUTHENTICATION_H__ #define BASIC_AUTHENTICATION_H__ #include "AbstractAuthentication.h" namespace Interceptor::Authentication { class BasicAuthentication : public AbstractAuthentication { public: BasicAuthentication(AuthenticationCPtr config); virtual ~BasicAuthentication() = default; virtual bool authenticate(HttpRequestPtr request) const; }; } #endif // BASIC_AUTHENTICATION_H__
#include <prool.h> #include <conf.c> #include "kernel.h" void vec (int argc,char far *argv[]) {int i; if (argc==2) { i=htoi(argv[1]); OutIntVector(i); return; } else { More=2; NLine=1; for (i=0;i<256;i++) if (OutIntVector(i)==EOF) break; puts(""); More=0; NLine=1; } }
/************************************************************************** This file is part of Minimalist Casio Assembler (MCA). MCA 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. MCA 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 MCA. If not, see <http://www.gnu.org/licenses/>. *************************************************************************/ #ifndef MCA_LINKER_PRIVATE_H #define MCA_LINKER_PRIVATE_H #define ERROR_LOOP(errornum) error = (errornum); \ continue // For memories mapping struct _MemoryMap { char *name; unsigned int begin_address; unsigned int size; }; // For sections mapping struct _SectionMap { char *name; int memory_id; // N° in the _MemoryMap array to use //int priority; // The higer it's, the less this section's priority is int flags; }; // _SectionMap flags : // NB: <section_name> is the name of the section with every non-alphanum char replaced by '_' #define GEN_BEGIN_SYMBOL 0x01 // Generate <section_name>_begin symbol #define GEN_END_SYMBOL 0x02 // Generate <section_name>_end symbol #define GEN_SIZE_SYMBOL 0x04 // Generate <section_name>_size symbol #define DONT_GEN_SECTION 0x08 // Process section's symbols but dont put it in the final file #define REMOVE_SECTION 0x10 // Don't process the section at all (act as if the section doesn't exist) #define DATA_TYPE_SECTION 0x20 // Dirty flag for .data section... // generate a <section_name>_rom_begin symbol // Representation of a MOF file content struct _FileContent { int format_version; int sections_number; char **sections_name; unsigned int *sections_size; int *sections_abs_number; // unsigned int **abs_address; // unsigned char **abs_address_section; int imported_number; // char **imported_name; // int *imported_occurences_number; // unsigned char **imported_occurences_section; // unsigned int **imported_occurences_address; int exported_number; char **exported_name; unsigned char *exported_section; int *exported_value; // The followings fields aren't filled when the file is reading, but are here for convenience : unsigned int *sections_org; // .org of each section unsigned int *sections_file_pos; // position in the output file of each section unsigned char *sections_global_id; // corresponding section ID in the _SectionMap array }; // read an integer (32 bits) from buffer at position (pos to pos+3) in big-endian convention // <char*> buffer // <int> pos // <int> integer #define READ_INTEGER(buffer, pos, integer) integer = ((buffer)[(pos)]<<24) + (((unsigned char*)(buffer))[(pos)+1]<<16) + (((unsigned char*)(buffer))[(pos)+2]<<8) + ((unsigned char*)(buffer))[(pos)+3] // write integer in the buffer at position (pos to pos+3) in big-endian convention // <int> integer // <char*> buffer // <int> pos #define WRITE_INTEGER(integer, buffer, pos) (buffer)[(pos)] = (char)((integer)>>24); \ (buffer)[(pos)+1] = (char)((integer)>>16); \ (buffer)[(pos)+2] = (char)((integer)>>8); \ (buffer)[(pos)+3] = (char)(integer) #endif //MCA_LINKER_PRIVATE_H
#ifndef IMPROVEDPT_H #define IMPROVEDPT_H #include "Common.h" #include "GrowthFunction.h" #include "MonteCarlo.h" #include "PowerSpectrum.h" #include "Spline.h" #include "array.h" /****************************************************************************** * ImprovedPT * * Improved redshift-space PT predictions from * Taruya, Nishimichi, & Saito, "Baryon Acoustic Oscillations in 2D: Modeling * Redshift-space Power Spectrum from Perturbation Theory", arXiv:1006.0699 . * ******************************************************************************/ class ImprovedPT { public: ImprovedPT(const Cosmology& C, const PowerSpectrum& P_i, real z_i, real z, int Neta, int Nk = 1000, real kcut = 10.); ~ImprovedPT(); static real U(real x); /* Nonlinear propagator */ void ComputeG_ab(real k, real eta1, real eta2, real& g11, real& g12, real& g21, real& g22) const; /* Accessor functions for interpolated propagator */ real G_11(real k, int t = -1, int tp = 0) const; real G_12(real k, int t = -1, int tp = 0) const; real G_21(real k, int t = -1, int tp = 0) const; real G_22(real k, int t = -1, int tp = 0) const; real G_1(real k, int t = -1) const; real G_2(real k, int t = -1) const; /* Tree-level power spectrum */ real P1(real k, int a = 1, int b = 1) const; real P1_11(real k) const; real P1_12(real k) const; real P1_22(real k) const; /* 1-loop contribution to PS */ real P2(real k, int a = 1, int b = 1) const; real P2_11(real k) const; real P2_12(real k) const; real P2_22(real k) const; /* Linear PS */ real P_L(real k) const; protected: const Cosmology& C; const PowerSpectrum& P_i; // linear PS at z = z_i real z_i; // initial redshift real z; // redshift at which to evaluate PS GrowthFunction D; int Neta; // number of time divisions for interpolated propagators int Nk; // number of k-values for interpolated propagators vector<Spline> g11, g12, g21, g22; // nonlinear propagator real deta; real kcut; void PrecomputePropagator(); /* Renormalized propagator factors */ real G_alpha(real eta, real etap = 0) const; real G_beta_g(real eta, real etap = 0) const; real G_beta_d(real eta, real etap = 0) const; real G_gamma_g(real eta, real etap = 0) const; real G_gamma_d(real eta, real etap = 0) const; real G_delta(real eta, real etap = 0) const; real G_f(real k) const; real G_g(real k) const; real G_h(real k) const; real G_i(real k) const; /* Vertices */ static real alpha(real k, real q, real r); static real beta(real k, real q, real r); /* Mode-coupling integrands */ // real f2_11(real k, real q, real x) const; // real f2_12(real k, real q, real x) const; // real f2_22(real k, real q, real x) const; real F2_11(real k, real x, real y) const; real F2_12(real k, real x, real y) const; real F2_22(real k, real x, real y) const; /* Mode-coupling integral factors */ real I_1(real k, real q, real kq, int t = -1) const; real J_1(real k, real p, real kp, real q, real pq, int t = -1) const; }; #endif // IMPROVEDPT_H
#ifndef GLUTEN_GLUTEN_H #define GLUTEN_GLUTEN_H #ifndef AMALGAMATION #include "config.h" #include "Widget.h" #include "Container.h" #include "Anchor.h" #include "Position.h" #include "Form.h" #include "Button.h" #include "Label.h" #include "Image.h" #include "Font.h" #include "Event.h" #include "Object.h" #include <vector.h> #endif #ifdef USE_SDL #include <SDL/SDL.h> #endif #ifdef USE_X11 #include <X11/Xlib.h> #endif struct GnInternal { int running; vector(GnWidget *) *forms; GnImage *mediumMono; GnFont *mediumMonoFont; GnWidget *activeForm; GnImage *buffer; GnImage *lastBuffer; }; extern struct GnInternal GnInternal; struct GnUnsafe { int dummy; unsigned char *pngData; #ifdef USE_SDL SDL_Surface *screen; SDL_Surface *buffer; #endif #ifdef USE_X11 Display *display; int screen; Window window; GC gc; Colormap cmap; XColor color; #endif }; extern struct GnUnsafe GnUnsafe; int GnInit(int argc, char **argv, char *layout); void GnRun(); void GnCleanup(); struct GnClick { int clickEventStuff; }; #endif
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2013, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC and Weta Digital Ltd // // 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 Industrial Light & Magic 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. // /////////////////////////////////////////////////////////////////////////// void testFuzzDeepScanLines (const char* file);
/************************************************************************************ ** ** ** mcHF QRP Transceiver ** ** K Atanassov - M0NKA 2014 ** ** ** **---------------------------------------------------------------------------------** ** ** ** File name: ** ** Description: ** ** Last Modified: ** ** Licence: CC BY-NC-SA 3.0 ** ************************************************************************************/ #ifndef __IQ_RX_FILTER_AM_5KHZ_H #define __IQ_RX_FILTER_AM_5KHZ_H #define Q_BLOCK_SIZE 1 #define Q_NUM_TAPS 89 /* * 89 tap FIR lowpass filter for AM demodulation * 5 kHz lowpass * Fc = 2.30 kHz (0.096) * BW = 5.09 kHz (0.212) * Phase = 0.0 Deg * * -6dB @ 5.0 kHz * -20dB @ 5.6 kHz * -40dB @ 6.0 kHz * -60dB > 6.2 kHz * * 20150724 by KA7OEI using Iowa Hills Hilbert Filter Designer * */ const float iq_rx_am_5k_coeffs[Q_NUM_TAPS] = { -0.000045392289047881, -0.000004812442917794, 0.000068727674699516, 0.000141963927224663, 0.000157520248119967, 0.000060286967439699, -0.000162970122246712, -0.000451252675540791, -0.000669397068852781, -0.000655786056558042, -0.000308946001031250, 0.000323862987296878, 0.001009151276280870, 0.001383767648753940, 0.001108841899531180, 0.000068694704026995, -0.001482086048715270, -0.002923873990383000, -0.003478042196892240, -0.002567012208450240, -0.000183058152703148, 0.002927838581731980, 0.005419014927265250, 0.005850957020138160, 0.003392366775186750, -0.001589789749145610, -0.007378579320778290, -0.011384168739919100, -0.011175196307323000, -0.005700279233064870, 0.003842132441622350, 0.013983598060774900, 0.020024993830604200, 0.017901468392382700, 0.006217999161870360, -0.012402093620729800, -0.031370988485890300, -0.041832006141384800, -0.035588597131400500, -0.008295098525339310, 0.038292174335735300, 0.095971206103503100, 0.151982896902598000, 0.192635286648254000, 0.207485090950182000, 0.192635286648256000, 0.151982896902602000, 0.095971206103507900, 0.038292174335739900, -0.008295098525336090, -0.035588597131399000, -0.041832006141385000, -0.031370988485891600, -0.012402093620731500, 0.006217999161868930, 0.017901468392382000, 0.020024993830604300, 0.013983598060775600, 0.003842132441623320, -0.005700279233064020, -0.011175196307322600, -0.011384168739919100, -0.007378579320778620, -0.001589789749146100, 0.003392366775186310, 0.005850957020137900, 0.005419014927265200, 0.002927838581732100, -0.000183058152702952, -0.002567012208450050, -0.003478042196892130, -0.002923873990382970, -0.001482086048715290, 0.000068694704026947, 0.001108841899531140, 0.001383767648753930, 0.001009151276280870, 0.000323862987296896, -0.000308946001031235, -0.000655786056558038, -0.000669397068852788, -0.000451252675540803, -0.000162970122246723, 0.000060286967439694, 0.000157520248119968, 0.000141963927224668, 0.000068727674699521, -0.000004812442917792, -0.000045392289047882 }; #endif
/* * mpatrol * A library for controlling and tracing dynamic memory allocations. * Copyright (C) 1997-2008 Graeme S. Roy <graemeroy@users.sourceforge.net> * * 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 <http://www.gnu.org/licenses/>. */ /* * Allocates 16 floats and then resizes the allocation to 8 floats and * frees them. Then allocates 16 integers and resizes the allocation * to 32 integers before freeing them. Finally, duplicates a string * and then frees it. */ #include "mpatrol.h" int main(void) { float *f; int *i; char *s; MP_MALLOC(f, 16, float); MP_REALLOC(f, 8, float); MP_FREE(f); MP_CALLOC(i, 16, int); MP_REALLOC(i, 32, int); MP_FREE(i); MP_STRDUP(s, "test"); MP_FREE(s); return EXIT_SUCCESS; }
/****************************************************************************** * * Copyright (C) 2009-2012 Broadcom Corporation * * This program is the proprietary software of Broadcom Corporation and/or its * licensors, and may only be used, duplicated, modified or distributed * pursuant to the terms and conditions of a separate, written license * agreement executed between you and Broadcom (an "Authorized License"). * Except as set forth in an Authorized License, Broadcom grants no license * (express or implied), right to use, or waiver of any kind with respect to * the Software, and Broadcom expressly reserves all rights in and to the * Software and all intellectual property rights therein. * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE * ALL USE OF THE SOFTWARE. * * Except as expressly set forth in the Authorized License, * * 1. This program, including its structure, sequence and organization, * constitutes the valuable trade secrets of Broadcom, and you shall * use all reasonable efforts to protect the confidentiality thereof, * and to use this information only in connection with your use of * Broadcom integrated circuit products. * * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING * OUT OF USE OR PERFORMANCE OF THE SOFTWARE. * * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM * OR ITS LICENSORS BE LIABLE FOR * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. * *****************************************************************************/ /***************************************************************************** * * Filename: btif_fm.h * * Description: Main API header file for all BTIF FM functions accessed * from internal stack. * *****************************************************************************/ #ifndef BTIF_FM_H #define BTIF_FM_H #include "bta_fm_api.h" #include "bta_rds_api.h" /***************************************************************************** ** Constants & Macros ******************************************************************************/ #define BTIF_RDS_APP_ID 1 /***************************************************************************** ** Type definitions for callback functions ******************************************************************************/ /***************************************************************************** ** Type definitions and return values ******************************************************************************/ /***************************************************************************** ** Extern variables and functions ******************************************************************************/ extern void btif_fm_rdsp_cback(tBTA_RDS_EVT event, tBTA_FM_RDS *p_data, UINT8 app_id); /***************************************************************************** ** Functions ******************************************************************************/ /***************************************************************************** ** BTIF CORE API ******************************************************************************/ /***************************************************************************** ** BTIF AV API ******************************************************************************/ #endif /* BTIF_FM_H */
#ifndef DTWCLUST_UNDIRECTEDGRAPH_HPP_ #define DTWCLUST_UNDIRECTEDGRAPH_HPP_ #include <cstddef> // std::size_t #include <functional> // std::unary_function #include <memory> #include <unordered_map> #include <vector> namespace dtwclust { class UndirectedGraph { public: UndirectedGraph(const unsigned int max_size); bool areNeighbors(const int i, const int j); void linkVertices(const int i, const int j, const bool deeply = false); bool isComplete(); bool isConnected(); private: struct Vertex; struct VertexHash : public std::unary_function<std::weak_ptr<Vertex>, std::size_t> { std::size_t operator()(const std::weak_ptr<Vertex>& vertex_wp) const; }; struct VertexEqual : public std::unary_function<std::weak_ptr<Vertex>, bool> { bool operator()(const std::weak_ptr<Vertex>& left, const std::weak_ptr<Vertex>& right) const; }; void dfs(const std::shared_ptr<Vertex>& vertex); std::unordered_map<int, std::shared_ptr<Vertex>> vertices_; std::vector<bool> visited_; unsigned int max_size_; bool complete_, connected_; }; } // namespace dtwclust #endif // DTWCLUST_UNDIRECTEDGRAPH_HPP_
//================================= // include guard #ifndef __MOVINGPLANE_H_INCLUDED__ #define __MOVINGPLANE_H_INCLUDED__ #include "cube.h" #include "Delay.h" #include "LinkedList.h" #include "plane.h" void movingPlane(int, int = 350); #endif
/* ** ** The C code is generated by ATS/Anairiats ** The compilation time is: 2011-10-15: 19h:52m ** */ /* include some .h files */ #ifndef _ATS_HEADER_NONE #include "ats_config.h" #include "ats_basics.h" #include "ats_types.h" #include "ats_exception.h" #include "ats_memory.h" #endif /* _ATS_HEADER_NONE */ /* prologues from statically loaded files */ #include "ats_intinf.cats" #include "ats_counter.cats" #include "ats_counter.cats" #include "ats_intinf.cats" #include "ats_counter.cats" /* external codes at top */ /* type definitions */ /* external typedefs */ /* sum constructor declarations */ /* exn constructor declarations */ /* static load function */ extern ats_void_type ATS_2d0_2e2_2e6_2src_2ats_location_2esats__staload (void) ; extern ats_void_type ATS_2d0_2e2_2e6_2src_2ats_dynexp2_2esats__staload (void) ; ats_void_type ATS_2d0_2e2_2e6_2src_2ats_macro2_2esats__staload () { static int ATS_2d0_2e2_2e6_2src_2ats_macro2_2esats__staload_flag = 0 ; if (ATS_2d0_2e2_2e6_2src_2ats_macro2_2esats__staload_flag) return ; ATS_2d0_2e2_2e6_2src_2ats_macro2_2esats__staload_flag = 1 ; ATS_2d0_2e2_2e6_2src_2ats_location_2esats__staload () ; ATS_2d0_2e2_2e6_2src_2ats_dynexp2_2esats__staload () ; return ; } /* staload function */ /* external codes at mid */ /* external codes at bot */ /* ****** ****** */ /* end of [ats_macro2_sats.c] */
#ifndef INCLUDED_volk_32f_accumulator_s32f_a16_H #define INCLUDED_volk_32f_accumulator_s32f_a16_H #include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #ifdef LV_HAVE_SSE #include <xmmintrin.h> /*! \brief Accumulates the values in the input buffer \param result The accumulated result \param inputBuffer The buffer of data to be accumulated \param num_points The number of values in inputBuffer to be accumulated */ static inline void volk_32f_accumulator_s32f_a16_sse(float* result, const float* inputBuffer, unsigned int num_points){ float returnValue = 0; unsigned int number = 0; const unsigned int quarterPoints = num_points / 4; const float* aPtr = inputBuffer; __VOLK_ATTR_ALIGNED(16) float tempBuffer[4]; __m128 accumulator = _mm_setzero_ps(); __m128 aVal = _mm_setzero_ps(); for(;number < quarterPoints; number++){ aVal = _mm_load_ps(aPtr); accumulator = _mm_add_ps(accumulator, aVal); aPtr += 4; } _mm_store_ps(tempBuffer,accumulator); // Store the results back into the C container returnValue = tempBuffer[0]; returnValue += tempBuffer[1]; returnValue += tempBuffer[2]; returnValue += tempBuffer[3]; number = quarterPoints * 4; for(;number < num_points; number++){ returnValue += (*aPtr++); } *result = returnValue; } #endif /* LV_HAVE_SSE */ #ifdef LV_HAVE_GENERIC /*! \brief Accumulates the values in the input buffer \param result The accumulated result \param inputBuffer The buffer of data to be accumulated \param num_points The number of values in inputBuffer to be accumulated */ static inline void volk_32f_accumulator_s32f_a16_generic(float* result, const float* inputBuffer, unsigned int num_points){ const float* aPtr = inputBuffer; unsigned int number = 0; float returnValue = 0; for(;number < num_points; number++){ returnValue += (*aPtr++); } *result = returnValue; } #endif /* LV_HAVE_GENERIC */ #endif /* INCLUDED_volk_32f_accumulator_s32f_a16_H */
#include "../../../../../src/webchannel/signalhandler_p.h"
#pragma once #include "../NIF/utils/Object3d.h" #include <memory> struct IntersectResult; struct AABB { Vector3 min; Vector3 max; AABB() {} AABB(const Vector3& newMin, const Vector3& newMax); AABB(Vector3* points, int nPoints); AABB(Vector3* points, ushort* indices, int nPoints); void AddBoxToMesh(std::vector<Vector3>& verts, std::vector<Edge>& edges); void Merge(Vector3* points, ushort* indices, int nPoints); void Merge(AABB& other); bool IntersectAABB(AABB& other); bool IntersectRay(Vector3& Origin, Vector3& Direction, Vector3* outCoord); bool IntersectSphere(Vector3& Origin, float radius); }; class AABBTree { int max_depth = 100; int min_facets = 2; Vector3* vertexRef = nullptr; Triangle* triRef = nullptr; public: bool bFlag = false; int depthCounter = 0; int sentinel = 0; class AABBTreeNode { std::unique_ptr<AABBTreeNode> N; std::unique_ptr<AABBTreeNode> P; AABBTreeNode* parent = nullptr; AABB mBB; AABBTree* tree = nullptr; std::unique_ptr<int[]> mIFacets; int nFacets = 0; public: AABBTreeNode() {} // Recursively generates AABB Tree nodes using the referenced data. AABBTreeNode(std::vector<int>& facetIndices, AABBTree* treeRef, AABBTreeNode* parentRef, int depth); // As above, but facetIndices is modified with in-place sorting rather than using vector::push_back to generate sub lists. // Sorting swaps from front of list to end when pos midpoints are found at the beginning of the list. AABBTreeNode(std::vector<int>& facetIndices, int start, int end, AABBTree* treeRef, AABBTreeNode* parentRef, int depth); Vector3 Center(); void AddDebugFrames(std::vector<Vector3>& verts, std::vector<Edge>& edges, int maxdepth = 0, int curdepth = 0); void AddRayIntersectFrames(Vector3& origin, Vector3& direction, std::vector<Vector3>& verts, std::vector<Edge>& edges); bool IntersectRay(Vector3& origin, Vector3& direction, std::vector<IntersectResult>* results); bool IntersectSphere(Vector3& origin, float radius, std::vector<IntersectResult>* results); void UpdateAABB(AABB* childBB = nullptr); }; std::unique_ptr<AABBTreeNode> root; public: AABBTree() {} AABBTree(Vector3* vertices, Triangle* facets, int nFacets, int maxDepth, int minFacets); int MinFacets(); int MaxDepth(); Vector3 Center(); // Calculate bounding box and geometric average. void CalcAABBandGeoAvg(std::vector<int>& forFacets, AABB& outBB, Vector3& outAxisAvg); // Calculate bounding box and geometric average for sub list. void CalcAABBandGeoAvg(std::vector<int>& forFacets, int start, int end, AABB& outBB, Vector3& outAxisAvg); void CalcAABBandGeoAvg(int forFacets[], int start, int end, AABB& outBB, Vector3& outAxisAvg); void BuildDebugFrames(Vector3** outVerts, int* outNumVerts, Edge** outEdges, int* outNumEdges); void BuildRayIntersectFrames(Vector3& origin, Vector3& direction, Vector3** outVerts, int* outNumVerts, Edge** outEdges, int* outNumEdges); bool IntersectRay(Vector3& origin, Vector3& direction, std::vector<IntersectResult>* results = nullptr); bool IntersectSphere(Vector3& origin, float radius, std::vector<IntersectResult>* results = nullptr); }; struct IntersectResult { int HitFacet = 0; float HitDistance = 0.0f; Vector3 HitCoord; AABBTree::AABBTreeNode* bvhNode = nullptr; };
/* * linux/fs/binfmt_script.c * * Copyright (C) 1996 Martin von L?wis * original #!-checking implemented by tytso. */ #include <linux/module.h> #include <linux/string.h> #include <linux/stat.h> #include <linux/malloc.h> #include <linux/binfmts.h> static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs) { char *cp, *interp, *i_name, *i_arg; int retval; if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang)) return -ENOEXEC; /* * This section does the #! interpretation. * Sorta complicated, but hopefully it will work. -TYT */ bprm->sh_bang++; iput(bprm->inode); bprm->dont_iput=1; bprm->buf[127] = '\0'; if ((cp = strchr(bprm->buf, '\n')) == NULL) cp = bprm->buf+127; *cp = '\0'; while (cp > bprm->buf) { cp--; if ((*cp == ' ') || (*cp == '\t')) *cp = '\0'; else break; } for (cp = bprm->buf+2; (*cp == ' ') || (*cp == '\t'); cp++); if (!cp || *cp == '\0') return -ENOEXEC; /* No interpreter name found */ interp = i_name = cp; i_arg = 0; for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++) { if (*cp == '/') i_name = cp+1; } while ((*cp == ' ') || (*cp == '\t')) *cp++ = '\0'; if (*cp) i_arg = cp; /* * OK, we've parsed out the interpreter name and * (optional) argument. * Splice in (1) the interpreter's name for argv[0] * (2) (optional) argument to interpreter * (3) filename of shell script (replace argv[0]) * * This is done in reverse order, because of how the * user environment and arguments are stored. */ remove_arg_zero(bprm); bprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2); bprm->argc++; if (i_arg) { bprm->p = copy_strings(1, &i_arg, bprm->page, bprm->p, 2); bprm->argc++; } bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2); bprm->argc++; if ((long)bprm->p < 0) return (long)bprm->p; /* * OK, now restart the process with the interpreter's inode. * Note that we use open_namei() as the name is now in kernel * space, and we don't need to copy it. */ retval = open_namei(interp, 0, 0, &bprm->inode, NULL); if (retval) return retval; bprm->dont_iput=0; retval=prepare_binprm(bprm); if(retval<0) return retval; return search_binary_handler(bprm,regs); } static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) { int retval; MOD_INC_USE_COUNT; retval = do_load_script(bprm,regs); MOD_DEC_USE_COUNT; return retval; } struct linux_binfmt script_format = { #ifndef MODULE NULL, 0, load_script, NULL, NULL #else NULL, &mod_use_count_, load_script, NULL, NULL #endif }; int init_script_binfmt(void) { return register_binfmt(&script_format); } #ifdef MODULE int init_module(void) { return init_script_binfmt(); } void cleanup_module( void) { unregister_binfmt(&script_format); } #endif
/* Episodic Notes: A personal wiki, note taking app for Mac OSX. Create notes through any application on your computer and keep them in one place. Copyright (C) 2014. Dante Bortone 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. */ //--------------------------------------------- #import <Cocoa/Cocoa.h> //--------------------------------------------- #import "DBEnterEnabledButton.h" //--------------------------------------------- @interface DBSelectButtonAfterEditTextFieldView : NSTextField{ IBOutlet DBEnterEnabledButton * buttonToSelect; } @end
// MediaHandler.h: Base class for media handlers // // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef GNASH_MEDIAHANDLER_H #define GNASH_MEDIAHANDLER_H #include "MediaParser.h" // for videoCodecType and audioCodecType enums #include "dsodefs.h" // DSOEXPORT #include "VideoConverter.h" #include "GnashFactory.h" #include <vector> #include <memory> #include <map> #include <string> // Forward declarations namespace gnash { class IOChannel; namespace media { class VideoDecoder; class AudioDecoder; class AudioInfo; class VideoInfo; class VideoInput; class AudioInput; class MediaHandler; } } namespace gnash { /// Gnash %media handling subsystem (libmedia) // /// The core Gnash lib will delegate any parsing decoding and encoding /// of %media files to the %media subsystem. /// /// The subsystem's entry point is a MediaHandler instance, which acts /// as a factory for parsers, decoders and encoders. /// /// @todo fix http://wiki.gnashdev.org/wiki/index.php/Libmedia, is obsoleted namespace media { struct DSOEXPORT RegisterAllHandlers { RegisterAllHandlers(); }; typedef GnashFactory<MediaHandler, RegisterAllHandlers> MediaFactory; /// The MediaHandler class acts as a factory to provide parser and decoders class DSOEXPORT MediaHandler { public: virtual ~MediaHandler() {} /// Return a description of this media handler. virtual std::string description() const = 0; /// Return an appropriate MediaParser for given input // /// @param stream /// Input stream, ownership transferred /// /// @return 0 if no parser could be created for the input /// /// NOTE: the default implementation returns an FLVParser for FLV input /// or 0 for others. /// virtual std::auto_ptr<MediaParser> createMediaParser(std::auto_ptr<IOChannel> stream); /// Create a VideoDecoder for decoding what's specified in the VideoInfo // /// @param info VideoInfo class with all the info needed to decode /// the image stream correctly. /// @return Will always return a valid VideoDecoder or throw a /// gnash::MediaException if a fatal error occurs. virtual std::auto_ptr<VideoDecoder> createVideoDecoder(const VideoInfo& info)=0; /// Create an AudioDecoder for decoding what's specified in the AudioInfo // /// @param info AudioInfo class with all the info needed to decode /// the sound correctly. /// @return Will always return a valid AudioDecoder or throw a /// gnash::MediaException if a fatal error occurs. virtual std::auto_ptr<AudioDecoder> createAudioDecoder(const AudioInfo& info)=0; /// Create an VideoConverter for converting between color spaces. // /// @param srcFormat The source image color space /// @param dstFormat The destination image color space /// /// @return A valid VideoConverter or a NULL auto_ptr if a fatal error /// occurs. virtual std::auto_ptr<VideoConverter> createVideoConverter(ImgBuf::Type4CC srcFormat, ImgBuf::Type4CC dstFormat)=0; /// Return a VideoInput // /// This is always owned by the MediaHandler, but will remain alive /// as long as it is referenced by a Camera object. // /// @param index The index of the VideoInput to return. /// @return A Video Input corresponding to the specified index /// or null if it is not available. virtual VideoInput* getVideoInput(size_t index) = 0; virtual AudioInput* getAudioInput(size_t index) = 0; /// Return a list of available cameras. // /// This is re-generated every time the function is called. virtual void cameraNames(std::vector<std::string>& names) const = 0; /// Return the number of bytes padding needed for input buffers // /// Bitstream readers are optimized to read several bytes at a time, /// and this should be used to allocate a large enough input buffer. virtual size_t getInputPaddingSize() const { return 0; } protected: /// Base constructor // /// This is an abstract base class, so not instantiable anyway. MediaHandler() {} /// Create an AudioDecoder for CODEC_TYPE_FLASH codecs // /// This method is attempted as a fallback in case /// a mediahandler-specific audio decoder couldn't be created /// for a CODEC_TYPE_FLASH codec. /// /// @throws a MediaException if it can't create a decoder /// /// @param info /// Informations about the audio. It is *required* /// for info.type to be media::CODEC_TYPE_FLASH (caller should check /// that before calling this). /// std::auto_ptr<AudioDecoder> createFlashAudioDecoder(const AudioInfo& info); /// Return true if input stream is an FLV // /// If this cannot read the necessary 3 bytes, it throws an IOException. bool isFLV(IOChannel& stream) throw (IOException); }; } // gnash.media namespace } // namespace gnash #endif
// // GTMNSColor+Luminance.h // // Copyright 2009 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. // #import <Cocoa/Cocoa.h> #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 enum { GTMColorationBaseHighlight, GTMColorationBaseMidtone, GTMColorationBaseShadow, GTMColorationBasePenumbra, GTMColorationLightHighlight, GTMColorationLightMidtone, GTMColorationLightShadow, GTMColorationLightPenumbra, GTMColorationDarkHighlight, GTMColorationDarkMidtone, GTMColorationDarkShadow, GTMColorationDarkPenumbra }; typedef NSUInteger GTMColorationUse; @interface NSColorSpace (GTMNSColorSpaceLuminanceHelpers) + (NSColorSpace *)gtm_labColorSpace; @end @interface NSColor (GTMLuminanceAdditions) - (CGFloat)gtm_luminance; // Create a color modified by lightening or darkening it (-1.0 to 1.0) - (NSColor *)gtm_colorByAdjustingLuminance:(CGFloat)luminance; // Create a color modified by lightening or darkening it (-1.0 to 1.0) - (NSColor *)gtm_colorByAdjustingLuminance:(CGFloat)luminance saturation:(CGFloat)saturation; // Returns a color adjusted for a specific usage - (NSColor *)gtm_colorAdjustedFor:(GTMColorationUse)use; - (NSColor *)gtm_colorAdjustedFor:(GTMColorationUse)use faded:(BOOL)fade; // Returns whether the color is in the dark half of the spectrum - (BOOL)gtm_isDarkColor; // Returns a color that is legible on this color. (Nothing to do with textColor) - (NSColor *)gtm_legibleTextColor; @end #endif
/** * This header is generated by class-dump-z 0.2-0. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/Symbolication.framework/Symbolication */ #import <Foundation/NSObject.h> @class NSMapTable, VMUSymbolicator, NSMutableSet, NSHashTable; @interface VMUObjectIdentifier : NSObject { unsigned _task; VMUSymbolicator* _symbolicator; NSMapTable* _isaToClassInfo; NSHashTable* _classAddresses; NSMutableSet* _objcRuntimeMallocBlocks; unsigned _cfTypeCount; unsigned _objcClassCount; unsigned _cPlusPlusClassCount; } -(instancetype)initWithTask:(unsigned)task symbolicator:(id)symbolicator; // inherited: -(void)dealloc; -(unsigned)CFTypeCount; -(unsigned)ObjCclassCount; -(unsigned)CPlusPlusClassCount; -(id)objcRuntimeMallocBlocks; -(id)readClassNameString:(unsigned)string; -(id)classInfoForObject:(unsigned)object; -(id)typeInfoForObject:(unsigned)object; -(void)findCFTypes; -(void)findObjCclasses; @end
#ifndef __ASM_MACH_LOONGSON64_IRQ_H_ #define __ASM_MACH_LOONGSON64_IRQ_H_ #include <boot_param.h> #ifdef CONFIG_CPU_LOONGSON3 /* cpu core interrupt numbers */ #define MIPS_CPU_IRQ_BASE 56 #define LOONGSON_UART_IRQ (MIPS_CPU_IRQ_BASE + 2) /* UART */ #define LOONGSON_HT1_IRQ (MIPS_CPU_IRQ_BASE + 3) /* HT1 */ #define LOONGSON_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 7) /* CPU Timer */ #define LOONGSON_HT1_CFG_BASE loongson_sysconf.ht_control_base #define LOONGSON_HT1_INT_VECTOR_BASE (LOONGSON_HT1_CFG_BASE + 0x80) #define LOONGSON_HT1_INT_EN_BASE (LOONGSON_HT1_CFG_BASE + 0xa0) #define LOONGSON_HT1_INT_VECTOR(n) \ LOONGSON3_REG32(LOONGSON_HT1_INT_VECTOR_BASE, 4 * (n)) #define LOONGSON_HT1_INTN_EN(n) \ LOONGSON3_REG32(LOONGSON_HT1_INT_EN_BASE, 4 * (n)) #define LOONGSON_INT_ROUTER_OFFSET 0x1400 #define LOONGSON_INT_ROUTER_INTEN \ LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x24) #define LOONGSON_INT_ROUTER_INTENSET \ LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x28) #define LOONGSON_INT_ROUTER_INTENCLR \ LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x2c) #define LOONGSON_INT_ROUTER_ENTRY(n) \ LOONGSON3_REG8(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + n) #define LOONGSON_INT_ROUTER_LPC LOONGSON_INT_ROUTER_ENTRY(0x0a) #define LOONGSON_INT_ROUTER_HT1(n) LOONGSON_INT_ROUTER_ENTRY(n + 0x18) #define LOONGSON_INT_COREx_INTy(x, y) (1<<(x) | 1<<(y+4)) /* route to int y of core x */ #endif extern void fixup_irqs(void); extern void loongson3_ipi_interrupt(struct pt_regs *regs); #include_next <irq.h> #endif /* __ASM_MACH_LOONGSON64_IRQ_H_ */
// Copyright (c) 2005 - 2015 Settlers Freaks (sf-team at siedler25.org) // // This file is part of Return To The Roots. // // Return To The Roots 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. // // Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>. #ifndef GAMEREPLAY_H_INCLUDED #define GAMEREPLAY_H_INCLUDED #pragma once #include "BinaryFile.h" #include "GameSavedFile.h" #include "GameProtocol.h" #include "gameTypes/MapTypes.h" #include "Point.h" class Savegame; /// Klasse für geladene bzw. zu speichernde Replays class Replay : public SavedFile { public: /// Replay-Command-Art enum ReplayCommand { RC_REPLAYEND = 0, RC_CHAT, RC_GAME }; public: Replay(); ~Replay(); /// Räumt auf, schließt datei void StopRecording(); /// Replaydatei gültig? bool IsValid() const { return file.IsValid(); } /// Beginnt die Save-Datei und schreibt den Header bool WriteHeader(const std::string& filename); /// Lädt den Header bool LoadHeader(const std::string& filename, const bool load_extended_header); /// Fügt ein Chat-Kommando hinzu (schreibt) void AddChatCommand(const unsigned gf, const unsigned char player, const unsigned char dest, const std::string& str); /// Fügt ein Spiel-Kommando hinzu (schreibt) void AddGameCommand(const unsigned gf, const unsigned short length, const unsigned char* const data); /// Fügt Pathfinding-Result hinzu void AddPathfindingResult(const unsigned char data, const unsigned* const length, const MapPoint * const next_harbor); /// Liest RC-Type aus, liefert false, wenn das Replay zu Ende ist bool ReadGF(unsigned* gf); /// RC-Type aus, liefert false ReplayCommand ReadRCType(); /// Liest ein Chat-Command aus void ReadChatCommand(unsigned char* player, unsigned char* dest, std::string& str); void ReadGameCommand(unsigned short* length, unsigned char** data); bool ReadPathfindingResult(unsigned char* data, unsigned* length, MapPoint * next_harbor); /// Aktualisiert den End-GF, schreibt ihn in die Replaydatei (nur beim Spielen bzw. Schreiben verwenden!) void UpdateLastGF(const unsigned last_gf); const std::string& GetFileName() const { return fileName_; } BinaryFile* GetFile() { return &file; } public: /// NWF-Länge unsigned short nwf_length; /// Zufallsgeneratorinitialisierung unsigned random_init; /// Bestimmt, ob Pathfinding-Ergebnisse in diesem Replay gespeichert sind bool pathfinding_results; /// Gespeichertes Spiel, Zufallskarte, normale Karte...? MapType map_type; /// Gepackte Map - Daten (für alte Karte) unsigned map_length, map_zip_length; unsigned char* map_data; /// Savegame (für gespeichertes Spiel) Savegame* savegame; /// End-GF unsigned lastGF_; /// Position des End-GF in der Datei unsigned last_gf_file_pos; /// Position des GFs fürs nächste Command -> muss gleich hinter /// bestehendes beschrieben werden unsigned gf_file_pos; private: /// Replayformat-Version und Signaturen static const unsigned short REPLAY_VERSION; static const char REPLAY_SIGNATURE[6]; /// Dateihandle BinaryFile file; /// File handle for pathfinding results BinaryFile pf_file; /// File path + name std::string fileName_; }; #endif //!GAMEREPLAY_H_INCLUDED
/* FS_IOC_FIEMAP ioctl infrastructure. Some portions copyright (C) 2007 Cluster File Systems, Inc Authors: Mark Fasheh <mfasheh@suse.com> Kalpak Shah <kalpak.shah@sun.com> Andreas Dilger <adilger@sun.com>. */ /* Copy from kernel, modified to respect GNU code style by Jie Liu. */ #ifndef _LINUX_FIEMAP_H # define _LINUX_FIEMAP_H # include <stdint.h> struct fiemap_extent { /* Logical offset in bytes for the start of the extent from the beginning of the file. */ uint64_t fe_logical; /* Physical offset in bytes for the start of the extent from the beginning of the disk. */ uint64_t fe_physical; /* Length in bytes for this extent. */ uint64_t fe_length; uint64_t fe_reserved64[2]; /* FIEMAP_EXTENT_* flags for this extent. */ uint32_t fe_flags; uint32_t fe_reserved[3]; }; struct fiemap { /* Logical offset(inclusive) at which to start mapping(in). */ uint64_t fm_start; /* Logical length of mapping which userspace wants(in). */ uint64_t fm_length; /* FIEMAP_FLAG_* flags for request(in/out). */ uint32_t fm_flags; /* Number of extents that were mapped(out). */ uint32_t fm_mapped_extents; /* Size of fm_extents array(in). */ uint32_t fm_extent_count; uint32_t fm_reserved; /* Array of mapped extents(out). */ struct fiemap_extent fm_extents[0]; }; /* The maximum offset can be mapped for a file. */ # define FIEMAP_MAX_OFFSET (~0ULL) /* Sync file data before map. */ # define FIEMAP_FLAG_SYNC 0x00000001 /* Map extented attribute tree. */ # define FIEMAP_FLAG_XATTR 0x00000002 # define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR) /* Last extent in file. */ # define FIEMAP_EXTENT_LAST 0x00000001 /* Data location unknown. */ # define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Location still pending, Sets EXTENT_UNKNOWN. */ # define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Data can not be read while fs is unmounted. */ # define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data is encrypted by fs. Sets EXTENT_NO_BYPASS. */ # define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Extent offsets may not be block aligned. */ # define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Data mixed with metadata. Sets EXTENT_NOT_ALIGNED. */ # define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Multiple files in block. Set EXTENT_NOT_ALIGNED. */ # define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Space allocated, but not data (i.e. zero). */ # define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* File does not natively support extents. Result merged for efficiency. */ # define FIEMAP_EXTENT_MERGED 0x00001000 /* Space shared with other files. */ # define FIEMAP_EXTENT_SHARED 0x00002000 #endif
// // virtualgpiopin.h // // Circle - A C++ bare metal environment for Raspberry Pi // Copyright (C) 2016 R. Stange <rsta2@o2online.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 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef _virtualgpiopin_h #define _virtualgpiopin_h #include "../../../Pi-OS/include/circle/spinlock.h" #include "../../../Pi-OS/include/circle/types.h" #define VIRTUAL_GPIO_PINS 2 class CVirtualGPIOPin { public: CVirtualGPIOPin (unsigned nPin); // can be used for output only virtual ~CVirtualGPIOPin (void); void Write (unsigned nValue); #define LOW 0 #define HIGH 1 void Invert (void); private: unsigned m_nPin; unsigned m_nValue; u16 m_nEnableCount; u16 m_nDisableCount; static u32 s_nGPIOBaseAddress; static CSpinLock s_SpinLock; }; #endif
#ifndef NODESANDATTACHMENTSGRAFICEELEMENTS_H #define NODESANDATTACHMENTSGRAFICEELEMENTS_H // /* This file is part of project pdb. pdb 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. pdb 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 pdb. If not, see <http://www.gnu.org/licenses/>. */ // #include <QObject> //#include <QGroupBox> #include <QLabel> #include <QLineEdit> #include <QCheckBox> #include <QPushButton> #include <QGridLayout> //#include <QComboBox> #include "abstractgraficeelements.h" class NodesAndAttachmentsGraficeElements : public AbstractGraficeElements { Q_OBJECT public: explicit NodesAndAttachmentsGraficeElements(QGroupBox* ptr_parent_frame, QGridLayout* ptr_layout, QObject *parent = 0); virtual ~NodesAndAttachmentsGraficeElements(); public: void writeData (); signals: public slots: private slots: void onChooseExportPath (); void onChooseImportPath (); void onChooseTmpPath (); void onClickDeleteAll (int i_state); void onClickDeleteAfterAttach (int i_state); void onClickDeleteTmpOnExit (int i_state); private: void createLayout (); void readData (); void updateData (bool b_from_dialog, bool b_data_changed = true); //exchange between dialog and variables void createLinks (); QString getActualAppPath() const; void normalizePath (QString& str_path) const; private: // QLabel* m_pLabelAttachMaxSize; QLineEdit* m_pLineAttachSMaxize; // QLabel* m_pLabelExportPath; QLineEdit* m_pLineExportPath; QPushButton* m_pExportPathChoose; // QLabel* m_pLabelImportPath; QLineEdit* m_pLineImportPath; QPushButton* m_pImportPathChoose; // QLabel* m_pLabelTmpPath; QLineEdit* m_pLineTmpPath; QPushButton* m_pTmpPathChoose; // QCheckBox* m_ptrDeleteTmpOnExit; // add: delete marked attachments on exit QCheckBox* m_ptrDeleteAttachmentsOnExit; // add: delete market attachments and nodes on exit QCheckBox* m_ptrDeleteAttachmentsAndNodesOnExit; // QCheckBox* m_ptrDeleteAfterAttach; //-------------------------------------------- unsigned int m_uiMaxAttachmentSizeMB; // QString m_strDefaultExportPath; QString m_strDefaultImportPath; QString m_strTmpPath; // bool m_bDelTmpOnExit; bool m_bDelAttachOnExit; bool m_bDelAttachAndNodesOnExit; // bool m_bDeleteAfterAttach; }; #endif // NODESANDATTACHMENTSGRAFICEELEMENTS_H
#pragma once #include "../monitor/monitor.h" #include <common/memory.h> #include <boost/property_tree/ptree_fwd.hpp> #include <boost/thread/future.hpp> namespace caspar { namespace core { class port : public monitor::observable { port(const port&); port& operator=(const port&); public: // Static Members // Constructors port(int index, int channel_index, spl::shared_ptr<class frame_consumer> consumer); port(port&& other); ~port(); // Member Functions port& operator=(port&& other); boost::unique_future<bool> send(class const_frame frame); // monitor::observable void subscribe(const monitor::observable::observer_ptr& o) override; void unsubscribe(const monitor::observable::observer_ptr& o) override; // Properties void video_format_desc(const struct video_format_desc& format_desc); int buffer_depth() const; bool has_synchronization_clock() const; boost::property_tree::wptree info() const; private: struct impl; std::unique_ptr<impl> impl_; }; }}
#import "MGLVectorSource.h" NS_ASSUME_NONNULL_BEGIN namespace mbgl { namespace style { class VectorSource; } } @interface MGLVectorSource (Private) - (instancetype)initWithRawSource:(mbgl::style::VectorSource *)rawSource; @end NS_ASSUME_NONNULL_END
#ifndef base_common_h #define base_common_h #include "cholmod.h" #include <string> #include <ostream> #include <iostream> #include "base_tools.h" /* ============================================== * Class base_common * * This class in a wraper for cholmod_common. * Since cholmod_start(&c) must be the first call to solve * cholesky by CHOLMOD, then it is in the constructor. * Also, since cholmod_finish(&c) must be the last call, * then it is in the destructor. * Note that base_common will be the first variable created * because the others will have to point to it. * ============================================== */ namespace base_matrices { class base_sparse; class base_common { public: base_common (); base_common (const base_common &); //Copy not allowed virtual ~base_common (); void operator= (const base_common &); //Copy not allowed //CHOLMOD Check functions int check () const; int print (std::string) const; int get_status () const { return common->status; }; //End //CHOLMOD Core functions int defaults (); size_t maxrank (size_t); int allocate_work (size_t, size_t, size_t); int free_work (); long clear_flag (); int error (int, const std::string, int, const std::string) const; //End //Other functions void set_error_handler (void (*eh)(int, const char*, int, const char*)); void useSimplicial () { common->supernodal = CHOLMOD_SIMPLICIAL; } void useSupernodal () { common->supernodal = CHOLMOD_SUPERNODAL; } friend class base_sparse; friend class base_dense; friend class base_factor; friend class base_triplet; friend base_sparse add (const base_sparse &, const base_sparse &, double[2], double[2], int, int); protected: cholmod_common *common; }; } #endif
/** * || ____ _ __ * +------+ / __ )(_) /_______________ _____ ___ * | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ * +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ * || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ * * Crazyflie control firmware * * Copyright (C) 2012-2019 BitCraze AB * * 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, in version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * mem.h - Memory sub system */ #ifndef __MEM_H__ #define __MEM_H__ #include <stdbool.h> /* Public functions */ void memInit(void); bool memTest(void); #endif /* __MEM_H__ */
//---------------------------------------------------------------------------- // XC program; finite element analysis code // for structural analysis and design. // // Copyright (C) Luis Claudio Pérez Tato // // This program derives from OpenSees <http://opensees.berkeley.edu> // developed by the «Pacific earthquake engineering research center». // // Except for the restrictions that may arise from the copyright // of the original program (see copyright_opensees.txt) // XC 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 software is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // // You should have received a copy of the GNU General Public License // along with this program. // If not, see <http://www.gnu.org/licenses/>. //---------------------------------------------------------------------------- //BeamMecLoad.h #ifndef BeamMecLoad_h #define BeamMecLoad_h #include <domain/load/beam_loads/BeamLoad.h> #include "xc_utils/src/geom/pos_vec/Pos3d.h" class SlidingVectorsSystem3d; namespace XC { class Matrix; class FVector; class CrossSectionProperties2d; class CrossSectionProperties3d; //! @ingroup ElemLoads // //! @brief Mechanical loads (forces) over beam elements. class BeamMecLoad : public BeamLoad { protected: double Trans; //!< Transverse load. double Axial; //!< Axial load. int sendData(CommParameters &cp); int recvData(const CommParameters &cp); public: BeamMecLoad(int tag, int classTag,const double &Trans,const double &Axial,const ID &theElementTags); BeamMecLoad(int tag, int classTag); inline double getTransComponent(void) const { return Trans; } inline double getAxialComponent(void) const { return Axial; } inline void setTransComponent(const double &t) { Trans= t; } inline void setAxialComponent(const double &a) { Axial= a; } virtual const Matrix &getAppliedSectionForces(const double &L,const Matrix &xi,const double &loadFactor) const; virtual void addReactionsInBasicSystem(const double &,const double &,FVector &) const; virtual void addFixedEndForcesInBasicSystem(const double &,const double &,FVector &) const; void addElasticDeformations(const double &L,const CrossSectionProperties3d &ctes_scc,const double &lpI,const double &lpJ,const double &loadFactor,FVector &v0); void addElasticDeformations(const double &L,const CrossSectionProperties2d &ctes_scc,const double &lpI,const double &lpJ,const double &loadFactor,FVector &v0); virtual size_t getForceVectorDimension(void) const; virtual size_t getMomentVectorDimension(void) const; virtual Vector getLocalForce(void) const; virtual Vector getLocalMoment(void) const; virtual const Matrix &getLocalForces(void) const; virtual const Matrix &getLocalMoments(void) const; virtual const Matrix &getGlobalVectors(const Matrix &) const; virtual const Matrix &getGlobalForces(void) const; virtual const Matrix &getGlobalMoments(void) const; virtual SlidingVectorsSystem3d getResultant(const Pos3d &p= Pos3d(), bool initialGeometry= true) const; void Print(std::ostream &s, int flag =0) const; }; } // end of XC namespace #endif
#pragma once #ifndef __SERVER_H__ #define __SERVER_H__ void ser_Send(int index, void * data, int len); int ser_Start(); #endif
#ifndef IMAGE_MANIPULATOR_H #define IMAGE_MANIPULATOR_H #include <SDL2/SDL_endian.h> #include "utils/image_typedefs.h" #if SDL_BYTEORDER == SDL_BIG_ENDIAN static const Uint8 Rshift = 24; static const Uint8 Gshift = 16; static const Uint8 Bshift = 8; static const Uint8 Ashift = 0; #else static const Uint8 Rshift = 0; static const Uint8 Gshift = 8; static const Uint8 Bshift = 16; static const Uint8 Ashift = 24; #endif class ImageManipulator { public: static void init(); static void save(const std::string &imageStr, const std::string &path, const std::string &width, const std::string &height); static void saveSurface(const SurfacePtr &image, const std::string &path, const std::string &width, const std::string &height, bool now = false); static SurfacePtr getNewNotClear(int w, int h, Uint32 format = SDL_PIXELFORMAT_UNKNOWN); static void loadImage(const std::string &desc); static SurfacePtr getImage(std::string desc, bool formatRGBA32 = true); }; #endif // IMAGE_MANIPULATOR_H
#ifndef VieportBufferStretch_h #define VieportBufferStretch_h #include "ViewportBufferAction.h" class QRect; namespace Isis { /** * @author ????-??-?? Unknown * * @internal */ class ViewportBufferStretch : public ViewportBufferAction { public: ViewportBufferStretch(); ~ViewportBufferStretch(); virtual ViewportBufferAction::ActionType getActionType() { return ViewportBufferAction::stretch; }; }; } #endif
// -*- mode: C++; c-basic-offset: 4 -*- // Copyright (C) 2011-2012 Joerg Faschingbauer // 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA #ifndef HAVE_JF_LINUXTOOLS_NET_TESTS_UNIX_SUITE_H #define HAVE_JF_LINUXTOOLS_NET_TESTS_UNIX_SUITE_H #include <jf/unittest/suite.h> namespace jf { namespace linuxtools { class UNIXSuite : public jf::unittest::TestSuite { public: UNIXSuite(); }; } } #endif
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org) // // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include <sstream> #include <string> #include <vector> inline std::vector<std::string> explode(std::string const& line, const char delim, const unsigned max = 0xFFFFFFFF) { std::istringstream in(line); std::vector<std::string> result; std::string token; size_t len = 0; while(std::getline(in, token, delim) && result.size() < max - 1) { len += token.size() + 1; result.push_back(token); } if(len < in.str().length()) result.push_back(in.str().substr(len)); return result; }
#pragma once #include "NDArray.h" #include "Index.h" #include <vector> #include <numeric> #include <cassert> #include <iostream> int32_t maxAbsElement(const std::vector<int32_t>& r); std::vector<int32_t> diff(const std::vector<uint32_t>& x, const std::vector<uint32_t>& y); std::vector<double> diff(const std::vector<double>& x, const std::vector<double>& y); template<typename T, typename U> void diff(const NDArray<T>& x, const NDArray<U>& y, NDArray<double>& d) { // TODO check x y and d sizes match for (Index index(x.sizes()); !index.end(); ++index) { d[index] = x[index] - y[index]; } } bool allZeros(const std::vector<std::vector<int32_t>>& r); template<typename T> T sum(const std::vector<T>& v) { return std::accumulate(v.begin(), v.end(), T(0)); } template<typename T> T product(const std::vector<T>& v) { return std::accumulate(v.begin(), v.end(), T(1), std::multiplies<T>()); } template<typename T> T sum(const NDArray<T>& a) { return std::accumulate(a.rawData(), a.rawData() + a.storageSize(), T(0)); } template<typename T> T min(const NDArray<T>& a) { T minVal = std::numeric_limits<T>::max(); for (Index i(a.sizes()); !i.end(); ++i) { minVal = std::min(minVal, a[i]); } return minVal; } template<typename T> T max(const NDArray<T>& a) { T minVal = std::numeric_limits<T>::max(); for (Index i(a.sizes()); !i.end(); ++i) { minVal = std::min(minVal, a[i]); } return minVal; } // TODO move printing somehwere else template<typename T> void print(const std::vector<T>& v, std::ostream& ostr = std::cout) { for (size_t i = 0; i < v.size(); ++i) { ostr << v[i] << ", "; } ostr << std::endl; } template<typename T> void print(T* p, size_t n, size_t breakAt = 1000000, std::ostream& ostr = std::cout) { for (size_t i = 0; i < n; ++i) { ostr << p[i] << ", "; if (!((i+1) % breakAt)) ostr << std::endl; } ostr << std::endl; } template<typename T> bool isZero(const std::vector<T>& v) { for (size_t i = 0; i < v.size(); ++i) { if (v[i] != 0) return false; } return true; } template<typename T> T marginalProduct(const std::vector<std::vector<T>>& m, const std::vector<int64_t>& idx) { assert(m.size() == idx.size()); T p = T(1); for (size_t d = 0; d < m.size(); ++d) { p *= m[d][idx[d]]; } return p; } // Reduce n-D array to 1-D sums template<typename T> std::vector<T> reduce(const NDArray<T>& input, size_t orient) { // return reduced; // check valid orientation assert(orient < input.dim()); std::vector<T> sums(input.size(orient), 0); // Index indexer(input.sizes(), std::make_pair(orient, 0)); // for (; !indexer.end(); ++indexer) // { // // Pass index in directly to avoid // typename NDArray<T>::ConstIterator it(input, orient, indexer); // for(size_t i = 0; !it.end(); ++it, ++i) // { // sums[i] += *it; // } // } // this is MUCH slower!!! Index indexer(input.sizes()); for (; !indexer.end(); ++indexer) { sums[indexer[orient]] += input[indexer]; } return sums; } // // Reduce n-D array to 1-D sums // template<typename T> // std::vector<T> reduce(const NDArray<T>& input, size_t orient) // { // const size_t n = input.size(orient); // assert(orient < input.dim()); // std::vector<T> sums(n, T(0)); // // Loop over elements in the orient dimension // for (size_t i = 0; i < n; ++i) // { // // sum over elements in all orther dims // for (Index index(input.sizes(), { orient, i }); !index.end(); ++index) // { // sums[i] += input[index]; // } // } // return sums; // } // // Reduce n-D array to 1-D sums // template<typename T> // std::vector<T> reduce(const NDArray<T>& input, size_t orient) // { // const size_t n = input.size(orient); // assert(orient < input.dim()); // std::vector<T> sums(n, T(0)); // Index index(input.sizes()); // const int64_t& k = index[orient]; // for (; !index.end(); ++index) // { // sums[k] += input[index]; // } // return sums; // } // Reduce n-D array to m-D sums (where m<n) template<typename T> NDArray<T> reduce(const NDArray<T>& input, const std::vector<int64_t>& preservedDims) { const size_t reducedDim = preservedDims.size(); // check valid orientation assert(reducedDim < input.dim()); std::vector<int64_t> preservedSizes(reducedDim); for (size_t d = 0; d < reducedDim; ++d) { preservedSizes[d] = input.sizes()[preservedDims[d]]; } NDArray<T> reduced(preservedSizes); reduced.assign(T(0)); Index index(input.sizes()); MappedIndex rIndex(index, preservedDims); for (; !index.end(); ++index) { reduced[rIndex] += input[index]; } return reduced; } // take a D-1 dimensional slice at element index in orientation O template<typename T> NDArray<T> slice(const NDArray<T>& input, std::pair<int64_t, int64_t> index) { if ((size_t)index.first >= input.dim()) throw std::runtime_error("dimension out of bounds in slice"); if (index.second >= input.sizes()[index.first]) throw std::runtime_error("index out of bounds in slice"); std::vector<int64_t> remainingSizes; remainingSizes.reserve(input.dim() - 1); for (size_t i = 0; i < input.dim(); ++i) { if (i != (size_t)index.first) { remainingSizes.push_back(input.sizes()[i]); } } NDArray<T> output(remainingSizes); Index inputIndex(input.sizes(), index); Index outputIndex(output.sizes()); for(;!inputIndex.end(); ++inputIndex, ++outputIndex) { output[outputIndex] = input[inputIndex]; } return output; } // Converts a D-dimensional population array into a list with D columns and pop rows template<typename T> std::vector<std::vector<int>> listify(const size_t pop, const NDArray<T>& t) { std::vector<std::vector<int>> list(t.dim(), std::vector<int>(pop)); Index index(t.sizes()); size_t pindex = 0; while (!index.end()) { for (T i = 0; i < t[index]; ++i) { const std::vector<int64_t>& ref = index; for (size_t j = 0; j < t.dim(); ++j) { list[j][pindex] = ref[j]; } ++pindex; } ++index; } return list; }
/* DPX/Cineon shader by Loadus ( http://www.loadusfx.net/virtualdub/DPX.fx ) Version 1.0 Ported to SweetFX by CeeJay.dk Version 1.1 Improved performance */ static const float3x3 RGB = float3x3 ( 2.67147117265996,-1.26723605786241,-0.410995602172227, -1.02510702934664,1.98409116241089,0.0439502493584124, 0.0610009456429445,-0.223670750812863,1.15902104167061 ); static const float3x3 XYZ = float3x3 ( 0.500303383543316,0.338097573222739,0.164589779545857, 0.257968894274758,0.676195259144706,0.0658358459823868, 0.0234517888692628,0.1126992737203,0.866839673124201 ); float4 DPXPass(float4 InputColor){ float DPXContrast = 0.1; float DPXGamma = 1.0; float RedCurve = Red; float GreenCurve = Green; float BlueCurve = Blue; float3 RGB_Curve = float3(Red,Green,Blue); float3 RGB_C = float3(RedC,GreenC,BlueC); float3 B = InputColor.rgb; //float3 Bn = B; // I used InputColor.rgb instead. B = pow(abs(B), 1.0/DPXGamma); B = B * (1.0 - DPXContrast) + (0.5 * DPXContrast); //B = (1.0 /(1.0 + exp(- RGB_Curve * (B - RGB_C))) - (1.0 / (1.0 + exp(RGB_Curve / 2.0))))/(1.0 - 2.0 * (1.0 / (1.0 + exp(RGB_Curve / 2.0)))); float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0)); //TODO use faster code for conversion between RGB/HSV - see http://www.chilliant.com/rgb2hsv.html float value = max(max(B.r, B.g), B.b); float3 color = B / value; color = pow(abs(color), 1.0/ColorGamma); float3 c0 = color * value; c0 = mul(XYZ, c0); float luma = dot(c0, float3(0.30, 0.59, 0.11)); //Use BT 709 instead? //float3 chroma = c0 - luma; //c0 = chroma * DPXSaturation + luma; c0 = (1.0 - DPXSaturation) * luma + DPXSaturation * c0; c0 = mul(RGB, c0); InputColor.rgb = lerp(InputColor.rgb, c0, Blend); return InputColor; }
#ifndef StartingTreeSimulator_H #define StartingTreeSimulator_H #include <vector> #include <set> namespace RevBayesCore { class Clade; class Taxon; class TopologyNode; class Tree; /** * This class represents the writer object of character data objects into files in Fasta format. * * This class currently has only one functionality, * to write character data objects into a file in Fasta format. * * @copyright Copyright 2009- * @author The RevBayes Development Core Team (Sebastian Hoehna) * @since 2013-04-15, version 1.0 */ class StartingTreeSimulator { public: // enum SIM_CONDITION { TIME, SURVIVAL, ROOT }; StartingTreeSimulator(); Tree* simulateTree( const std::vector<Taxon> &taxa, const std::vector<Clade> &constraints ) const; private: void simulateClade( std::set<TopologyNode*> &nodes) const; }; } #endif
#include <errno.h> #include <ftw.h> int ftw(const char* path, int (*fn)(const char*, const struct stat*, int), int fd_limit) { return ENOSYS; } int nftw(const char* path, int (*fn)(const char*, const struct stat*, int, struct FTW*), int fd_limit, int flags) { return ENOSYS; }
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "common/axis.h" #include "common/time.h" #include "pg/pg.h" #include "drivers/bus.h" #include "drivers/sensor.h" typedef enum { GYRO_NONE = 0, GYRO_DEFAULT, GYRO_MPU6050, GYRO_L3G4200D, GYRO_MPU3050, GYRO_L3GD20, GYRO_MPU6000, GYRO_MPU6500, GYRO_MPU9250, GYRO_ICM20601, GYRO_ICM20602, GYRO_ICM20608G, GYRO_ICM20649, GYRO_ICM20689, GYRO_BMI160, GYRO_FAKE } gyroSensor_e; typedef struct gyro_s { uint32_t targetLooptime; float gyroADCf[XYZ_AXIS_COUNT]; } gyro_t; extern gyro_t gyro; typedef enum { GYRO_OVERFLOW_CHECK_NONE = 0, GYRO_OVERFLOW_CHECK_YAW, GYRO_OVERFLOW_CHECK_ALL_AXES } gyroOverflowCheck_e; #define GYRO_CONFIG_USE_GYRO_1 0 #define GYRO_CONFIG_USE_GYRO_2 1 #define GYRO_CONFIG_USE_GYRO_BOTH 2 typedef struct gyroConfig_s { sensor_align_e gyro_align; // gyro alignment uint8_t gyroMovementCalibrationThreshold; // people keep forgetting that moving model while init results in wrong gyro offsets. and then they never reset gyro. so this is now on by default. uint8_t gyro_sync_denom; // Gyro sample divider uint8_t gyro_lpf; // gyro LPF setting - values are driver specific, in case of invalid number, a reasonable default ~30-40HZ is chosen. uint8_t gyro_soft_lpf_type; uint8_t gyro_soft_lpf_hz; bool gyro_high_fsr; bool gyro_use_32khz; uint8_t gyro_to_use; uint16_t gyro_soft_lpf2_hz; uint16_t gyro_soft_notch_hz_1; uint16_t gyro_soft_notch_cutoff_1; uint16_t gyro_soft_notch_hz_2; uint16_t gyro_soft_notch_cutoff_2; gyroOverflowCheck_e checkOverflow; uint16_t gyro_filter_q; uint16_t gyro_filter_r; uint16_t gyro_filter_p; int16_t gyro_offset_yaw; uint8_t gyro_soft_lpf2_order; } gyroConfig_t; #define GYRO_LPF2_ORDER_MAX 6 PG_DECLARE(gyroConfig_t, gyroConfig); bool gyroInit(void); void gyroInitFilters(void); void gyroUpdate(timeUs_t currentTimeUs); bool gyroGetAccumulationAverage(float *accumulation); const busDevice_t *gyroSensorBus(void); struct mpuConfiguration_s; const struct mpuConfiguration_s *gyroMpuConfiguration(void); struct mpuDetectionResult_s; const struct mpuDetectionResult_s *gyroMpuDetectionResult(void); void gyroStartCalibration(bool isFirstArmingCalibration); bool isFirstArmingGyroCalibrationRunning(void); bool isGyroCalibrationComplete(void); void gyroReadTemperature(void); int16_t gyroGetTemperature(void); int16_t gyroRateDps(int axis); bool gyroOverflowDetected(void); uint16_t gyroAbsRateDps(int axis);
/** * Marlin 3D Printer Firmware * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once // Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE #include "../core/millis_t.h" /** * @brief Stopwatch class * @details This class acts as a timer proving stopwatch functionality including * the ability to pause the running time counter. */ class Stopwatch { private: enum State : char { STOPPED, RUNNING, PAUSED }; static Stopwatch::State state; static millis_t accumulator; static millis_t startTimestamp; static millis_t stopTimestamp; public: /** * @brief Initialize the stopwatch */ FORCE_INLINE static void init() { reset(); } /** * @brief Stop the stopwatch * @details Stop the running timer, it will silently ignore the request if * no timer is currently running. * @return true on success */ static bool stop(); /** * @brief Pause the stopwatch * @details Pause the running timer, it will silently ignore the request if * no timer is currently running. * @return true on success */ static bool pause(); /** * @brief Start the stopwatch * @details Start the timer, it will silently ignore the request if the * timer is already running. * @return true on success */ static bool start(); /** * @brief Resume the stopwatch * @details Resume a timer from a given duration */ static void resume(const millis_t with_time); /** * @brief Reset the stopwatch * @details Reset all settings to their default values. */ static void reset(); /** * @brief Check if the timer is running * @details Return true if the timer is currently running, false otherwise. * @return true if stopwatch is running */ FORCE_INLINE static bool isRunning() { return state == RUNNING; } /** * @brief Check if the timer is paused * @details Return true if the timer is currently paused, false otherwise. * @return true if stopwatch is paused */ FORCE_INLINE static bool isPaused() { return state == PAUSED; } /** * @brief Get the running time * @details Return the total number of seconds the timer has been running. * @return the delta since starting the stopwatch */ static millis_t duration(); #ifdef DEBUG_STOPWATCH /** * @brief Print a debug message * @details Print a simple debug message "Stopwatch::function" */ static void debug(const char func[]); #endif };
/************************************************************************** * * Copyright 2007 VMware, Inc. * 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, sub license, 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 NON-INFRINGEMENT. * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 ST_DEBUG_H #define ST_DEBUG_H #include "pipe/p_compiler.h" #include "util/u_debug.h" extern void st_print_current(void); #define DEBUG_MESA 0x1 #define DEBUG_TGSI 0x2 #define DEBUG_CONSTANTS 0x4 #define DEBUG_PIPE 0x8 #define DEBUG_TEX 0x10 #define DEBUG_FALLBACK 0x20 #define DEBUG_QUERY 0x40 #define DEBUG_SCREEN 0x80 #define DEBUG_DRAW 0x100 #define DEBUG_BUFFER 0x200 #define DEBUG_WIREFRAME 0x400 #define DEBUG_PRECOMPILE 0x800 #ifdef DEBUG extern int ST_DEBUG; #define DBSTR(x) x #else #define ST_DEBUG 0 #define DBSTR(x) "" #endif void st_debug_init( void ); static inline void ST_DBG( unsigned flag, const char *fmt, ... ) { if (ST_DEBUG & flag) { va_list args; va_start( args, fmt ); debug_vprintf( fmt, args ); va_end( args ); } } #endif /* ST_DEBUG_H */
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "rh4n.h" #include "rh4n_utils.h" #include "rh4n_nat.h" #include "rh4n_nat_varhandling.h" int rh4nnatStringHandler(RH4nNatVarHandleParms *args) { int strlength = 0, varlibret = 0, nniret = 0; char *tmpbuff = NULL; if(args->desc->dimensions > 0) { return(rh4nnatStringArrayHandler(args)); } strlength = args->desc->length + 1; if((tmpbuff = malloc(sizeof(char)*strlength)) == NULL) return(RH4N_RET_MEMORY_ERR); memset(tmpbuff, 0x00, sizeof(char)*strlength); if(strlength > 1) { if((nniret = args->nnifuncs->pf_nni_get_parm(args->nnifuncs, args->parmindex, args->parmhandle, strlength-1, tmpbuff)) != NNI_RC_OK) { free(tmpbuff); sprintf(args->errorstr, "Could not get parm %d. NNI ret: %d", args->parmindex, nniret); return(RH4N_RET_NNI_ERR); } } rh4nUtilsTrimSpaces(tmpbuff); if((varlibret = rh4nvarCreateNewString(args->varlist, NULL, args->tmpname, tmpbuff)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not create new string: %d", varlibret); free(tmpbuff); return(varlibret); } free(tmpbuff); return(RH4N_RET_OK); } int rh4nnatStringArrayHandler(RH4nNatVarHandleParms *args) { int x = 0, y = 0, z = 0, varlibret = 0, arrindex[3] = {0, 0, 0}; if((varlibret = rh4nvarCreateNewStringArray(args->varlist, NULL, args->tmpname, args->desc->dimensions, args->desc->occurrences)) != RH4N_RET_OK) { sprintf(args->errorstr, "Error while creating String Array: %d", varlibret); return(varlibret); } for(; x < args->desc->occurrences[0]; x++) { arrindex[0] = x; arrindex[1] = arrindex[2] = -1; if(args->desc->dimensions == 1) { if((varlibret = rh4nnatSaveStringArrayEntry(args, arrindex)) != RH4N_RET_OK) return(varlibret); } else { for(y = 0; y < args->desc->occurrences[1]; y++) { arrindex[1] = y; arrindex[2] = -1; if(args->desc->dimensions == 2) { if((varlibret = rh4nnatSaveStringArrayEntry(args, arrindex)) != RH4N_RET_OK) return(varlibret); } else { for(z = 0; z < args->desc->occurrences[2]; z++) { arrindex[2] = z; if((varlibret = rh4nnatSaveStringArrayEntry(args, arrindex)) != RH4N_RET_OK) return(varlibret); } } } } } return(RH4N_RET_OK); } int rh4nnatSaveStringArrayEntry(RH4nNatVarHandleParms *args, int index[3]) { int strlength = 0, nniret = 0, varlibret = 0, varlibindex[3] = { -1, -1, -1}; char *tmpbuff = NULL; if(args->desc->flags & NNI_FLG_DYNVAR) { if((nniret = args->nnifuncs->pf_nni_get_parm_array_length(args->nnifuncs, args->parmindex, args->parmhandle, &strlength, index)) != NNI_RC_OK) { sprintf(args->errorstr, "Could not get array length from parm %d (x: %d, y:%d, z: %d) NNI err: %d", args->parmindex, index[0], index[1], index[2], nniret); return(RH4N_RET_NNI_ERR); } } else { strlength = args->desc->length; } rh4n_log_debug(args->props->logging, "Got strlen [%d] for index x: %d y: %d z: %d", strlength, index[0], index[1], index[3]); if(strlength == 0) { return(RH4N_RET_OK); } if((tmpbuff = malloc(sizeof(char)*(strlength+1))) == NULL) { sprintf(args->errorstr, "Could not allocate memory for tmp buffer."); return(RH4N_RET_MEMORY_ERR); } memset(tmpbuff, 0x00, sizeof(char)*(strlength+1)); if((nniret = args->nnifuncs->pf_nni_get_parm_array(args->nnifuncs, args->parmindex, args->parmhandle, strlength, tmpbuff, index)) != NNI_RC_OK) { sprintf(args->errorstr, "Could not get array entry from parm %d (x: %d, y:%d, z: %d) NNI err: %d", args->parmindex, index[0], index[1], index[2], nniret); rh4n_log_error(args->props->logging, "%s", args->errorstr); free(tmpbuff); return(RH4N_RET_NNI_ERR); } if(args->desc->dimensions == 1) varlibindex[0] = index[0]; else if(args->desc->dimensions == 2) { varlibindex[0] = index[0]; varlibindex[1] = index[1]; } else if(args->desc->dimensions == 3) { varlibindex[0] = index[0]; varlibindex[1] = index[1]; varlibindex[2] = index[2]; } rh4nUtilsTrimSpaces(tmpbuff); if((varlibret = rh4nvarSetStringArrayEntry(args->varlist, NULL, args->tmpname, varlibindex, tmpbuff)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not set Array Entry x: %d y: %d z: %d", varlibindex[0], varlibindex[1], varlibindex[2]); free(tmpbuff); return(varlibret); } free(tmpbuff); return(RH4N_RET_OK); }
#ifndef INFOPISTE_H #define INFOPISTE_H #include <QString> #include <QApplication> #include "lecteur.h" #include "conversion.h" class InfoPiste { public: InfoPiste(const QString _chemin="", const qint64 _finPiste=0, const int _frequence=0, const int _debit=0); //Nom et chemin void cheminPiste(QString val); QString retourNom(){return nom;} QString retourChemin(){return chemin;} QString retourExtension(){return extension;} //Touche de lancement void definirTouche(QString val){touche=val;} QString retourTouche(){return touche;} //Définition des temps void changerDebut(qint64 val){valDebut=val;affDebut=msToQString(val);} void changerFin(qint64 val){valFin=val;affFin=msToQString(val);} void definirFinPiste(qint64 val){finPiste=val;affPiste=msToQString(val);} //Debut défini qint64 retourDebutI(){return valDebut;} QString retourDebutQ(){return affDebut;} //Fin définie qint64 retourFinI(){return valFin;} QString retourFinQ(){return affFin;} //Fin Piste qint64 retourFinPisteI(){return finPiste;} QString retourFinPisteQ(){return affPiste;} //Frequence void definirFrequence(int val){frequence=val;} int retourFrequenceI(){return frequence;} QString retourFrequenceQ(){return QString::number(frequence)+" Hz";} //Echantillonage void definirEchantillonage(int val){echantillonage=val;} int retourEchantillonageI(){return echantillonage;} QString retourEchantillonageQ(){return QString::number(echantillonage)+" Bits";} //Debit void definirDebit(int val){debit=val;} int retourDebitI(){return debit;} QString retourDebitQ(){return QString::number(debit)+" Kbits/s";} //Valeur moyenne void definirValMoyenne(int val){valMoyenne=val;} int retourValMoyenne(){return valMoyenne;} //Analyse void analyseWAV(); void analyseAIFF(); //Bouclage void definirBouclage(bool etat){boucler=etat;} bool retourBouclage(){return boucler;} private: //Noms QString nom; QString chemin; QString extension; //Touche lancement QString touche; //Temps qint64 valDebut; QString affDebut; qint64 valFin; QString affFin; qint64 finPiste; QString affPiste; //Données int frequence; int debit; int echantillonage; int tailleFichier; int nbCanaux; int valMoyenne; //Bouclage bool boucler; }; #endif // INFOPISTE_H
#ifndef WHITENOISEGENERATOR_H #define WHITENOISEGENERATOR_H #include "generator.h" namespace BoostDSP { namespace Generators { class WhiteNoiseGenerator : public Generator { public: WhiteNoiseGenerator(); bool initialize(); bool compute(); }; } } #endif // WHITENOISEGENERATOR_H
/* * include/acpi/rsdp.h * Copyright (C) 2016-2017 Alexei Frolov * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ACPI_RSDP_H #define ACPI_RSDP_H #include <radix/types.h> /* ACPI Root System Description Pointer descriptor. */ struct acpi_rsdp { char signature[8]; uint8_t checksum; char oem_id[6]; uint8_t revision; uint32_t rsdt_addr; }; /* Extended descriptor introduced in ACPI 2.0 (x86_64 support) */ struct acpi_rsdp_2 { struct acpi_rsdp rsdp; uint32_t length; uint64_t xsdt_addr; uint8_t ext_checksum; uint8_t reserved[3]; }; #endif /* ACPI_RSDP_H */
/** * \file * * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * 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 Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef _SAM4CP_CMCC0_INSTANCE_ #define _SAM4CP_CMCC0_INSTANCE_ /* ========== Register definition for CMCC0 peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_CMCC0_TYPE (0x4007C000U) /**< \brief (CMCC0) Cache Type Register */ #define REG_CMCC0_CTRL (0x4007C008U) /**< \brief (CMCC0) Cache Control Register */ #define REG_CMCC0_SR (0x4007C00CU) /**< \brief (CMCC0) Cache Status Register */ #define REG_CMCC0_MAINT0 (0x4007C020U) /**< \brief (CMCC0) Cache Maintenance Register 0 */ #define REG_CMCC0_MAINT1 (0x4007C024U) /**< \brief (CMCC0) Cache Maintenance Register 1 */ #define REG_CMCC0_MCFG (0x4007C028U) /**< \brief (CMCC0) Cache Monitor Configuration Register */ #define REG_CMCC0_MEN (0x4007C02CU) /**< \brief (CMCC0) Cache Monitor Enable Register */ #define REG_CMCC0_MCTRL (0x4007C030U) /**< \brief (CMCC0) Cache Monitor Control Register */ #define REG_CMCC0_MSR (0x4007C034U) /**< \brief (CMCC0) Cache Monitor Status Register */ #else #define REG_CMCC0_TYPE (*(__I uint32_t*)0x4007C000U) /**< \brief (CMCC0) Cache Type Register */ #define REG_CMCC0_CTRL (*(__O uint32_t*)0x4007C008U) /**< \brief (CMCC0) Cache Control Register */ #define REG_CMCC0_SR (*(__I uint32_t*)0x4007C00CU) /**< \brief (CMCC0) Cache Status Register */ #define REG_CMCC0_MAINT0 (*(__O uint32_t*)0x4007C020U) /**< \brief (CMCC0) Cache Maintenance Register 0 */ #define REG_CMCC0_MAINT1 (*(__O uint32_t*)0x4007C024U) /**< \brief (CMCC0) Cache Maintenance Register 1 */ #define REG_CMCC0_MCFG (*(__IO uint32_t*)0x4007C028U) /**< \brief (CMCC0) Cache Monitor Configuration Register */ #define REG_CMCC0_MEN (*(__IO uint32_t*)0x4007C02CU) /**< \brief (CMCC0) Cache Monitor Enable Register */ #define REG_CMCC0_MCTRL (*(__O uint32_t*)0x4007C030U) /**< \brief (CMCC0) Cache Monitor Control Register */ #define REG_CMCC0_MSR (*(__I uint32_t*)0x4007C034U) /**< \brief (CMCC0) Cache Monitor Status Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAM4CP_CMCC0_INSTANCE_ */
//Rabsg - Real time Strategy game // Copyright (C) 2013 Thomas Kamps anubis1@linux-ecke.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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef TEST_H #define TEST_H class Test { public: Test(); static void doTest(); }; #endif // TEST_H
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers /***************************************************************************** * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. * * OpenRCT2 is the work of many authors, a full list can be found in contributors.md * For more information, visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 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. * * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion #pragma once #include <string> #include <vector> #include "../common.h" extern "C" { #include "../scenario/scenario.h" #include "../object_list.h" } struct ObjectRepositoryItem; int scenario_save_network(SDL_RWops* rw, const std::vector<const ObjectRepositoryItem *> &objects); int scenario_write_packed_objects(SDL_RWops* rw, std::vector<const ObjectRepositoryItem *> &objects); std::vector<const ObjectRepositoryItem *> scenario_get_packable_objects(); /** * Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6). */ class S6Exporter final { public: bool RemoveTracklessRides; std::vector<const ObjectRepositoryItem *> ExportObjectsList; S6Exporter(); void SaveGame(const utf8 * path); void SaveGame(SDL_RWops *rw); void SaveScenario(const utf8 * path); void SaveScenario(SDL_RWops *rw); void Export(); private: rct_s6_data _s6; void Save(SDL_RWops *rw, bool isScenario); static uint32 GetLoanHash(money32 initialCash, money32 bankLoan, uint32 maxBankLoan); };
/********************************************************** * Version $Id$ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // User Interface // // // // Program: SAGA // // // //-------------------------------------------------------// // // // INFO_Messages.h // // // // Copyright (C) 2005 by Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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. // // // // SAGA 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, 5th Floor, Boston, MA 02110-1301, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef _HEADER_INCLUDED__SAGA_GUI__INFO_Messages_H #define _HEADER_INCLUDED__SAGA_GUI__INFO_Messages_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include <wx/textctrl.h> /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CINFO_Messages : public wxTextCtrl { public: CINFO_Messages(wxWindow *pParent); void Add_Time (bool bNewLine = true); void Add_Line (void); void Add_String (wxString sMessage, bool bNewLine = true, bool bTime = false, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL); private: int m_MaxLength; void On_Context_Menu (wxMouseEvent &event); void On_Copy (wxCommandEvent &event); void On_Clear (wxCommandEvent &event); void On_SelectAll (wxCommandEvent &event); void _Add_Text (wxString Text); void _Set_Style (TSG_UI_MSG_STYLE Style); //--------------------------------------------------------- wxDECLARE_EVENT_TABLE(); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__INFO_Messages_H
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_pushButton_clicked(); void on_actionHakk_nda_triggered(); void on_pushButton_2_clicked(); void on_actionFormu_Temizle_triggered(); void on_actionKullan_m_triggered(); void on_comboBox_activated(int index); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H
/* Categories of Unicode characters. Copyright (C) 2002, 2006-2007, 2009-2014 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. 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 <http://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include "unictype.h" /* Define u_categ_So table. */ #include "categ_So.h" const uc_general_category_t UC_CATEGORY_So = { UC_CATEGORY_MASK_So, 0, { &u_categ_So } };
#ifndef MODELVAR_H_ #define MODELVAR_H_ #include "ModelAbsVar.h" class ModelVar : public ModelAbsVar { public: ModelVar(); virtual ~ModelVar(); void setValue(double value_); }; #endif /* MODELVAR_H_ */
/* * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * The contents of this file constitute Original Code as defined in and * are subject to the Apple Public Source License Version 1.1 (the * "License"). You may not use this file except in compliance with the * License. Please obtain a copy of the License at * http://www.apple.com/publicsource and read it before using this file. * * This Original Code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License. * * @APPLE_LICENSE_HEADER_END@ */ #include <inttypes.h> #include "libtop.h" #include "threads.h" #include "generic.h" #include "preferences.h" #include "uinteger.h" /* Return true if an error occurred. */ static bool threadcount_insert_cell(struct statistic *s, const void *sample) { const libtop_psamp_t *psamp = sample; char thbuf[GENERIC_INT_SIZE]; char runbuf[GENERIC_INT_SIZE]; char buf[GENERIC_INT_SIZE * 2 + 1]; struct top_uinteger thtotal, thrun; thtotal = top_uinteger_calc_result(psamp->th, psamp->p_th, 0ULL); thrun = top_uinteger_calc_result(psamp->running_th, psamp->p_running_th, 0ULL); if(top_sprint_uinteger(thbuf, sizeof(thbuf), thtotal)) return true; if(top_sprint_uinteger(runbuf, sizeof(runbuf), thrun)) return true; if(-1 == (thrun.value > 0 ? snprintf(buf, sizeof(buf), "%s/%s", thbuf, runbuf) : snprintf(buf, sizeof(buf), "%s", thbuf))) return true; return generic_insert_cell(s, buf); } static struct statistic_callbacks callbacks = { .draw = generic_draw, .resize_cells = generic_resize_cells, .move_cells = generic_move_cells, .get_request_size = generic_get_request_size, .get_minimum_size = generic_get_minimum_size, .insert_cell = threadcount_insert_cell, .reset_insertion = generic_reset_insertion }; struct statistic *top_threadcount_create(WINDOW *parent, const char *name) { return create_statistic(STATISTIC_THREADS, parent, NULL, &callbacks, name); }
/* * basetransform.h * * Created on: Jun 30, 2015 * Author: root */ #ifndef SRC_CORE_JET_BASETRANSFORM_H_ #define SRC_CORE_JET_BASETRANSFORM_H_ #include <jet/jet.h> #include <jet/element.h> struct jbasetransform_s { jelement_t parent; }; struct jbasetransform_class_s { jelement_class_t parent; }; J_DECLARE_CLASS(jbasetransform); #endif /* SRC_CORE_JET_BASETRANSFORM_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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * If you have any questions, comments, suggestions, or fixes please * email me at: imre.leber@worldonline.be */ #include <stdio.h> #include "misc\version.h" #include "specific\recover.h" int HasAllFloppyForm (char* drive); void Usage(void) { printf("RECOVER " VERSION "\n" "Copyright 2003, Imre Leber\n" "\n" "Syntax:\n" "\tRECOVER [d:][path]filename\n" "\tRECOVER d:\n" "\n" "Purpose: Resolves sector problems on a file or a disk\n" "\n" "When entering a file this program will clean that file of any bad clusters.\n" "\n" "When entering a disk all files on the disk will be cleared of bad clusters.\n" "WARNING: when entering a disk all the file names on the disk will dissapear!\n" "\n" "Note:\n" "\tYou should *NOT* be using this utility\n" "\tThis utility only works on FAT12 and FAT16\n"); } int main(int argc, char** argv) { char drive[3]; if ((argc != 2) || (argv[1][0] == SwitchChar()) || (argv[1][0] == '/')) { Usage(); return 0; } memcpy(drive, argv[1], 2); drive[2] = 0; if (HasAllFloppyForm(drive) && ((argv[1][2] == '\0') || ((argv[1][2] == '\\') && (argv[1][3] == '\0')))) /* Disk entered */ { RecoverDisk(drive); } else { RecoverFile(argv[1]); } printf("Done"); return 0; }
/** * health.c * This will hold the functionality for health it will * contain the query_has_health, query_health, * receive_damage, receive_healing, do_tick, and some * other things which should be encapsulated in this * function and executed each heartbeat * @author Hymael */ # include <game/body.h> private int max_hp, cur_hp; void init_health(){ cur_hp = max_hp = 250;/* for now */ } void set_health(int hp){/* mainly for monsters */ cur_hp = max_hp = hp; } /** * this may be unncessary */ int query_has_health(){ return 1; } /** * this returns our current health, * later to be in abstract form */ int query_health(){ return cur_hp; } int query_max_health(){ return max_hp; } /** * receive sent damage, attack if need be, resist - stuff of that nature * @retval return of 1 denotes damage taken, 0 denotes no damage, 2 denotes resisted some * @todo May change this over to just return amount of damage done */ int receive_damage(int damage, object dealer, varargs string type){ /* this will eventually mask damage against a body's given resists */ if(damage < 0 || cur_hp < 0)return 0; cur_hp -= damage; /* possibly this will be where death occurs */ if(cur_hp < 0){ call_out("die", 0); } return 1; } /** * and its brother function */ int receive_healing(int healing){ if(healing < 0 || cur_hp == max_hp)return 0; cur_hp += healing; if(cur_hp > max_hp)cur_hp = max_hp; return 1; } /** * this heals us up, may also add other per heart beat things * this will eventually become race specific and such */ void do_tick(){ receive_healing(2); /** @todo do other things, like empty stomachs */ } string query_xa(){ switch(cur_hp * 100 / max_hp){/* percentage of */ /* is ... */ case 95..100: return "%^BOLD%^%^GREEN%^perfect condition%^RESET%^"; case 65..94: return "%^BOLD%^%^YELLOW%^stunned%^RESET%^"; case 45..64: return "%^YELLOW%^battered%^RESET%^"; case 25..44: return "%^BOLD%^%^RED%^bloody and bleeding%^RESET%^"; case 10..24: return "%^RED%^about to fall%^RESET%^"; default: return "%^BOLD%^%^BLACK%^almost dead%^RESET%^"; } } void refresh_health(){ cur_hp = max_hp; } /** wrapper for dropping corpse, @todo error checking */ static void _die(){ int i, sz; object *inv, corpse; if(!find_object(CORPSE))compile_object(CORPSE); corpse = clone_object(CORPSE); catch{ inv = this_object()->query_inventory(); for(i=sizeof(inv) ; --i >= 0; ){ inv->move(corpse); /* move items onto corpse */ } } corpse->move(this_object()->query_environment()); corpse->set_name(this_object()->query_name()); } void die(){ event("death", this_object()); /* drop corpse and all that good stuff */ _die(); this_object()->pacify(); this_object()->message("%^BOLD%^%^BLACK%^You have died.%^RESET%^\n"); this_object()->query_environment()->message(this_object()->query_Name()+" has died.\n", ({this_object()})); this_object()->move(ROOMD->query_labyrinth(), "", 1, 1); refresh_health(); /** @todo print death message to them */ LOGD->log(this_object()->query_Name()+" died", "combat"); }
/* Copyright (c) 2014-2019 AscEmu Team <http://www.ascemu.org> This file is released under the MIT license. See README-MIT for more information. */ #pragma once #include <cstdint> #include "ManagedPacket.h" #include "WorldPacket.h" namespace AscEmu::Packets { class CmsgDestroyItem : public ManagedPacket { public: int8_t srcInventorySlot; int8_t srcSlot; CmsgDestroyItem() : CmsgDestroyItem(0, 0) { } CmsgDestroyItem(int8_t srcInventorySlot, int8_t srcSlot) : ManagedPacket(CMSG_DESTROYITEM, 2), srcInventorySlot(srcInventorySlot), srcSlot(srcSlot) { } protected: bool internalSerialise(WorldPacket& /*packet*/) override { return false; } bool internalDeserialise(WorldPacket& packet) override { packet >> srcInventorySlot >> srcSlot; return true; } }; }
#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include <math.h> #include <GL/glew.h> #include <GL/glx.h> #include <GL/glu.h> #include "c3dlas/c3dlas.h" #include "utilities.h" #include "shader.h" #include "texture.h" #include "renderer.h" static void render_DrawArraysInstanced(RC_DrawArraysInstanced* cb) { glBindVertexArray(rc->vao); glBindBuffer(GL_ARRAY_BUFFER, rc->vbo1); if(rc->vbo2) glBindBuffer(GL_ARRAY_BUFFER, rc->vbo2); glexit(""); glDrawArraysInstanced(rc->mode, rc->first, rc->count, rc->primcount); glexit("glDrawArraysInstanced"); } void render_RenderCommandQueue(DrawCommand* rc, int length) { int i; DrawCommand* cur, *prev; prev = NULL; cur = rc; for(i = 0; i < length; i++) { // shader if(!prev || prev->prog != cur->prog) glUseProgram(cur->prog); // vertex info if(!prev || prev->vao != cur->vao) glBindVertexArray(cur->vao); if(!prev || prev->vbo1 != cur->vbo1) glBindVertexArray(cur->vbo1); if(!prev || prev->vbo2 != cur->vbo2) glBindVertexArray(cur->vbo2); if(!prev || prev->patchVertices != cur->patchVertices) glPatchParameteri(GL_PATCH_VERTICES, cur->patchVertices); // depth testing if(!prev || prev->depthEnable != cur->depthEnable) { if(cur->depthEnable) glEnable(GL_DEPTH_TEST); else glDisable(GL_DEPTH_TEST); } if(!prev || prev->depthMask != cur->depthMask) glDepthMask(cur->depthMask); // alpha blending if(!prev || prev->blendEnable != cur->blendEnable) { if(cur->blendEnable) glEnable(GL_BLEND); else glDisable(GL_BLEND); } if(!prev || prev->blendFuncSrc != cur->blendFuncSrc || prev->blendFuncDst != cur->blendFuncDst) { glBlendFunc (cur->blendFuncSrc, cur->blendFuncDst); } #define CASE_TYPE_CALL(x) case RCT_##x: render_##x(&cur->x); break switch(cur->type) { CASE_TYPE_CALL(DrawArraysInstanced); default: fprint(stderr, "Invalid Draw Command: %d\n", cur->type); } #undef CASE_TYPE_CALL(x) prev = cur; cur++; } } RenderCommandQueue* render_AllocCommandQueue(int size) { RenderCommandQueue* rcq; rcq = malloc(sizeof(RenderCommandQueue)); rcq->alloc_len = size; rcq->next_index = 0; rcq->cmds = calloc(1, sizeof(RenderCommand) * size); return rcq; } RenderCommand* render_GetCommandSlot(RenderCommandQueue* rcq) { if(rcq->next_index >= rcq->alloc_len) return NULL; return &rcq->cmds[rcq->next_index++]; }
/* * Summary: interface for the memory allocator * Description: provides interfaces for the memory allocator, * including debugging capabilities. * * Copy: See Copyright for the status of this software. * * Author: Daniel Veillard */ #ifndef __DEBUG_MEMORY_ALLOC__ #define __DEBUG_MEMORY_ALLOC__ /** * DEBUG_MEMORY: * * DEBUG_MEMORY replaces the allocator with a collect and debug * shell to the libc allocator. * DEBUG_MEMORY should only be activated when debugging * libxml i.e. if libxml has been configured with --with-debug-mem too. */ /* #define DEBUG_MEMORY_FREED */ /* #define DEBUG_MEMORY_LOCATION */ #ifndef NDEBUG #ifndef DEBUG_MEMORY #define DEBUG_MEMORY #endif #endif /** * DEBUG_MEMORY_LOCATION: * * DEBUG_MEMORY_LOCATION should be activated only when debugging * libxml i.e. if libxml has been configured with --with-debug-mem too. */ #ifdef DEBUG_MEMORY_LOCATION #endif #ifdef __cplusplus extern "C" { #endif /* * The XML memory wrapper support 4 basic overloadable functions. */ /** * xmlFreeFunc: * @mem: an already allocated block of memory * * Signature for a SAlloc::F() implementation. */ typedef void (XMLCALL *xmlFreeFunc)(void *mem); /** * xmlMallocFunc: * @size: the size requested in bytes * * Signature for a malloc() implementation. * * Returns a pointer to the newly allocated block or NULL in case of error. */ typedef void *(LIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); /** * xmlReallocFunc: * @mem: an already allocated block of memory * @size: the new size requested in bytes * * Signature for a realloc() implementation. * * Returns a pointer to the newly reallocated block or NULL in case of error. */ typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size); /** * xmlStrdupFunc: * @str: a zero terminated string * * Signature for an strdup() implementation. * * Returns the copy of the string or NULL in case of error. */ typedef char *(XMLCALL *xmlStrdupFunc)(const char *str); /* * The 4 interfaces used for all memory handling within libxml. // @sobolev LIBXML_DLL_IMPORT xmlFreeFunc xmlFree_; LIBXML_DLL_IMPORT xmlMallocFunc xmlMalloc_; LIBXML_DLL_IMPORT xmlMallocFunc xmlMallocAtomic_; LIBXML_DLL_IMPORT xmlReallocFunc xmlRealloc_; LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup_Removed; */ /* * The way to overload the existing functions. * The xmlGc function have an extra entry for atomic block * allocations useful for garbage collected memory allocators */ //XMLPUBFUN int XMLCALL xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc); //XMLPUBFUN int XMLCALL xmlMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlReallocFunc *reallocFunc, xmlStrdupFunc *strdupFunc); //XMLPUBFUN int XMLCALL xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlMallocFunc mallocAtomicFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc); //XMLPUBFUN int XMLCALL xmlGcMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlMallocFunc *mallocAtomicFunc, xmlReallocFunc *reallocFunc, xmlStrdupFunc *strdupFunc); /* * Initialization of the memory layer. */ XMLPUBFUN int XMLCALL xmlInitMemory(); /* * Cleanup of the memory layer. */ XMLPUBFUN void XMLCALL xmlCleanupMemory(); /* * These are specific to the XML debug memory wrapper. */ XMLPUBFUN int XMLCALL xmlMemUsed(); XMLPUBFUN int XMLCALL xmlMemBlocks(); XMLPUBFUN void XMLCALL xmlMemDisplay(FILE *fp); XMLPUBFUN void XMLCALL xmlMemDisplayLast(FILE *fp, long nbBytes); XMLPUBFUN void XMLCALL xmlMemShow(FILE *fp, int nr); XMLPUBFUN void XMLCALL xmlMemoryDump(); XMLPUBFUN void * XMLCALL xmlMemMalloc(size_t size) LIBXML_ATTR_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlMemRealloc(void *ptr,size_t size); XMLPUBFUN void XMLCALL xmlMemFree(void *ptr); XMLPUBFUN char * XMLCALL xmlMemoryStrdup(const char *str); XMLPUBFUN void * XMLCALL xmlMallocLoc(size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlReallocLoc(void *ptr, size_t size, const char *file, int line); XMLPUBFUN void * XMLCALL xmlMallocAtomicLoc(size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); XMLPUBFUN char * XMLCALL xmlMemStrdupLoc(const char *str, const char *file, int line); #ifdef DEBUG_MEMORY_LOCATION /** * @size: number of bytes to allocate * * Wrapper for the malloc() function used in the XML library. * * Returns the pointer to the allocated area or NULL in case of error. */ #define xmlMalloc_(size) xmlMallocLoc((size), __FILE__, __LINE__) /** * xmlMallocAtomic: * @size: number of bytes to allocate * * Wrapper for the malloc() function used in the XML library for allocation * of block not containing pointers to other areas. * * Returns the pointer to the allocated area or NULL in case of error. */ #define SAlloc::M(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__) /** * xmlRealloc: * @ptr: pointer to the existing allocated area * @size: number of bytes to allocate * * Wrapper for the realloc() function used in the XML library. * * Returns the pointer to the allocated area or NULL in case of error. */ #define SAlloc::R(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) /** * xmlMemStrdup: * @str: pointer to the existing string * * Wrapper for the strdup() function, xmlStrdup() is usually preferred. * * Returns the pointer to the allocated area or NULL in case of error. */ //#define xmlMemStrdup_Removed(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) #endif /* DEBUG_MEMORY_LOCATION */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __DEBUG_MEMORY_ALLOC__ */
/**************************************************************** * * * Copyright 2003, 2011 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gtm_stdio.h" #include "compiler.h" #include "opcode.h" #include "mdq.h" #include "cgp.h" #include "gtmdbglvl.h" #include "cdbg_dump.h" #include <emit_code.h> #include "rtnhdr.h" #include "obj_file.h" #if defined(USHBIN_SUPPORTED) || defined(VMS) GBLREF int4 curr_addr, code_size; GBLREF char cg_phase; /* code generation phase */ GBLREF triple t_orig; /* head of triples */ GBLREF uint4 gtmDebugLevel; LITREF octabstruct oc_tab[]; /* op-code table */ /* Certain triples need to have their expansions shrunk down to be optimal. Current * triples that are eligible for shrinking are: * <triples of type OCT_JUMP> * OC_LDADDR * OC_FORLOOP * literal argument references (either one) for given triple * Many of the jump triples start out life as long jumps because of the assumped jump offset * in the first pass before the offsets are known. This is where we shrink them. * * For the literal referencess, if the offset into the literal table exceeds that which can be * addressed by the immediate operand of a load address instruction, a long form is generated. * But this long form is initially assumed. This is where we will shrink it if we can which * should be the normal case. */ void shrink_trips(void) { int new_size, old_size, shrink; boolean_t first_pass; triple *ct; /* current triple */ DCL_THREADGBL_ACCESS; SETUP_THREADGBL_ACCESS; # ifdef DEBUG /* If debug and compiler debugging enabled, run through triples again to show where we are just before we modify them. */ if (gtmDebugLevel & GDL_DebugCompiler) { PRINTF(" \n\n\n\n************************************ Begin pre-shrink_trips dump *****************************\n"); dqloop(&t_orig, exorder, ct) { PRINTF(" ************************ Triple Start **********************\n"); cdbg_dump_triple(ct, 0); } PRINTF(" \n\n\n\n************************************ Begin shrink_trips scan *****************************\n"); } # endif first_pass = TRUE; assert(CGP_ADDR_OPT == cg_phase); /* Follows address optimization phase */ do { shrink = 0; dqloop(&t_orig, exorder, ct) { if ((oc_tab[ct->opcode].octype & OCT_JUMP) || (OC_LDADDR == ct->opcode) || (OC_FORLOOP == ct->opcode)) { old_size = ct->exorder.fl->rtaddr - ct->rtaddr; curr_addr = 0; if (ct->operand[0].oprval.tref->rtaddr - ct->rtaddr < 0) { ct->rtaddr -= shrink; trip_gen(ct); } else { trip_gen(ct); ct->rtaddr -= shrink; } new_size = curr_addr; /* size of operand 0 */ assert(old_size >= new_size); COMPDBG(if (0 != (old_size - new_size)) cdbg_dump_shrunk_triple(ct, old_size, new_size);); shrink += old_size - new_size; } else if (first_pass && !(oc_tab[ct->opcode].octype & OCT_CGSKIP) && (litref_triple_oprcheck(&ct->operand[0]) || litref_triple_oprcheck(&ct->operand[1]))) { old_size = ct->exorder.fl->rtaddr - ct->rtaddr; curr_addr = 0; trip_gen(ct); ct->rtaddr -= shrink; new_size = curr_addr; /* size of operand 0 */ assert(old_size >= new_size); COMPDBG(if (0 != (old_size - new_size)) cdbg_dump_shrunk_triple(ct, old_size, new_size);); shrink += old_size - new_size; } else ct->rtaddr -= shrink; if (0 == shrink && OC_TRIPSIZE == ct->opcode) { /* This triple is a reference to another triple whose codegen size we want to compute for an * argument to another triple. We will only do this on what appears to (thus far) be * the last pass through the triples). */ curr_addr = 0; trip_gen(ct->operand[0].oprval.tsize->ct); ct->operand[0].oprval.tsize->size = curr_addr; } } /* dqloop */ code_size -= shrink; first_pass = FALSE; } while (0 != shrink); /* Do until no more shrinking occurs */ /* Now that the code has been strunk, we may have to adjust the pad length of the code segment. Compute * this by now subtracting out the size of the pad length from the code size and recomputing the pad length * and readjusting the code size. (see similar computation in code_gen(). */ code_size -= TREF(codegen_padlen); TREF(codegen_padlen) = PADLEN(code_size, SECTION_ALIGN_BOUNDARY); /* Length to pad to align next section */ code_size += TREF(codegen_padlen); # ifdef DEBUG /* If debug and compiler debuggingenabled, run through the triples again to show what we did to them */ if (gtmDebugLevel & GDL_DebugCompiler) { dqloop(&t_orig, exorder, ct) { PRINTF(" ************************ Triple Start **********************\n"); cdbg_dump_triple(ct, 0); } } # endif } /* Check if this operand or any it may be chained to are literals in the literal section (not immediate operands) */ boolean_t litref_triple_oprcheck(oprtype *operand) { if (TRIP_REF == operand->oprclass) { /* We are referring to another triple */ if (OC_LIT == operand->oprval.tref->opcode) /* It is a literal section reference.. done */ return TRUE; if (OC_PARAMETER == operand->oprval.tref->opcode) { /* There are two more parameters to check. Call recursively */ if (litref_triple_oprcheck(&operand->oprval.tref->operand[0])) return TRUE; return litref_triple_oprcheck(&operand->oprval.tref->operand[1]); } } return FALSE; /* Uninteresting triple .. not our type */ } #endif /* USHBIN_SUPPORTED or VMS */
/** * @brief Static driver, test case for Bug #123, test try counter exceeded limit * * @file xabackend_s-tryfail.c */ /* ----------------------------------------------------------------------------- * Enduro/X Middleware Platform for Distributed Transaction Processing * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved. * Copyright (C) 2017-2019, Mavimax, Ltd. All Rights Reserved. * This software is released under one of the following licenses: * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use. * See LICENSE file for full text. * ----------------------------------------------------------------------------- * AGPL license: * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License, version 3 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 Affero General Public License, version 3 * for more details. * * You should have received a copy of the GNU Affero 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 * * ----------------------------------------------------------------------------- * A commercial use license is available from Mavimax, Ltd * contact@mavimax.com * ----------------------------------------------------------------------------- */ #include <string.h> #include <stdio.h> #include <stdlib.h> #include <memory.h> #include <math.h> #include <errno.h> #include <atmi.h> #include <ubf.h> #include <ndebug.h> #include <test.fd.h> #include <ndrstandard.h> #include <nstopwatch.h> #include <xa.h> #include <atmi_int.h> #include "xabackend_common.h" /*---------------------------Externs------------------------------------*/ /*---------------------------Macros-------------------------------------*/ /*---------------------------Enums--------------------------------------*/ /*---------------------------Typedefs-----------------------------------*/ /*---------------------------Globals------------------------------------*/ /*---------------------------Statics------------------------------------*/ /*---------------------------Prototypes---------------------------------*/ struct xa_switch_t *ndrx_get_xa_switch(void) { return ndrx_get_xa_switch_int("ndrxstatswtryfail", "Loading XA_Test Static " "XA driver (Bug #123) - commit tries failed"); } /* vim: set ts=4 sw=4 et smartindent: */
/* * Generated by util/mkerr.pl DO NOT EDIT * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/err.h> #include "e_ossltest_err.h" #ifndef OPENSSL_NO_ERR static ERR_STRING_DATA OSSLTEST_str_reasons[] = { {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"}, {0, NULL} }; #endif static int lib_code = 0; static int error_loaded = 0; static int ERR_load_OSSLTEST_strings(void) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); if (!error_loaded) { #ifndef OPENSSL_NO_ERR ERR_load_strings(lib_code, OSSLTEST_str_reasons); #endif error_loaded = 1; } return 1; } static void ERR_unload_OSSLTEST_strings(void) { if (error_loaded) { #ifndef OPENSSL_NO_ERR ERR_unload_strings(lib_code, OSSLTEST_str_reasons); #endif error_loaded = 0; } } static void ERR_OSSLTEST_error(int function, int reason, char *file, int line) { if (lib_code == 0) lib_code = ERR_get_next_error_library(); ERR_raise(lib_code, reason); ERR_set_debug(file, line, NULL); }
#ifndef UNSUBSCRIBE_CONTEXT_AVAILABILITY_REQUEST_H #define UNSUBSCRIBE_CONTEXT_AVAILABILITY_REQUEST_H /* * * Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U * * This file is part of Orion Context Broker. * * Orion Context Broker is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * Orion Context Broker is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero * General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. * * For those usages not covered by this license please contact with * iot_support at tid dot es * * Author: Ken Zangelin */ #include <string> #include "common/Format.h" #include "ngsi/Request.h" #include "ngsi/SubscriptionId.h" /* **************************************************************************** * * UnsubscribeContextAvailabilityRequest - */ typedef struct UnsubscribeContextAvailabilityRequest { SubscriptionId subscriptionId; // Mandatory - optional according to OMA (bug in spec?) UnsubscribeContextAvailabilityRequest(); UnsubscribeContextAvailabilityRequest(SubscriptionId& _subscriptionId); std::string check(RequestType requestType, const std::string& indent, const std::string& predetectedError, int counter); void release(void); void fill(const std::string& _subscriptionId); } UnsubscribeContextAvailabilityRequest; #endif
/**************************************************************** * * * Copyright 2001, 2011 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ /* * gtcm_main.c --- * * Main routine for the GTCM server. Initialize everything and * then run forever. * */ #include "mdef.h" #include "gtm_stdio.h" #include "gtm_stdlib.h" /* for exit() */ #include "gtm_time.h" /* for time() */ #include "gt_timer.h" /* for set_blocksig() */ #include <sys/types.h> #include <signal.h> #include <errno.h> #include "gtcm.h" #include "error.h" #include "gtm_env_init.h" /* for gtm_env_init() prototype */ #include "gtm_threadgbl_init.h" #ifndef lint static char rcsid[] = "$Header:$"; #endif GBLDEF short gtcm_ast_avail; GBLDEF int4 gtcm_exi_condition; /* image_id....allows you to determine info about the server * by using the strings command, or running dbx */ GBLDEF char image_id[256]= "image_id"; GBLDEF char *omi_service = (char *)0; GBLDEF FILE *omi_debug = (FILE *)0; GBLDEF char *omi_pklog = (char *)0; GBLDEF char *omi_pklog_addr = (char *)0; GBLDEF int omi_pkdbg = 0; GBLDEF omi_conn_ll *omi_conns = (omi_conn_ll *)0; GBLDEF int omi_exitp = 0; GBLDEF int omi_pid = 0; GBLDEF int4 omi_errno = 0; GBLDEF int4 omi_nxact = 0; /* # of transactions */ GBLDEF int4 omi_nxact2 = 0; /* transactions since last stat dump */ GBLDEF int4 omi_nerrs = 0; GBLDEF int4 omi_brecv = 0; GBLDEF int4 omi_bsent = 0; GBLDEF int4 gtcm_stime = 0; /* start time for GT.CM */ GBLDEF int4 gtcm_ltime = 0; /* last time stats were dumped */ GBLDEF int one_conn_per_inaddr = -1; GBLDEF int authenticate = 0; /* authenticate OMI connections */ GBLDEF int psock = -1; /* pinging socket */ GBLDEF int ping_keepalive = 0; /* check connections using ping */ GBLDEF int conn_timeout = TIMEOUT_INTERVAL; GBLDEF int history = 0; GBLREF int rc_server_id; /* On OSF/1 (Digital Unix), pointers are 64 bits wide; the only exception to this is C programs for which one may * specify compiler and link editor options in order to use (and allocate) 32-bit pointers. However, since C is * the only exception and, in particular because the operating system does not support such an exception, the argv * array passed to the main program is an array of 64-bit pointers. Thus the C program needs to declare argv[] * as an array of 64-bit pointers and needs to do the same for any pointer it sets to an element of argv[]. */ int main(int argc, char_ptr_t argv[]) { omi_conn_ll conns; bool set_pset(); int ret_val; DCL_THREADGBL_ACCESS; GTM_THREADGBL_INIT; ctxt = NULL; set_blocksig(); gtm_env_init(); /* read in all environment variables before calling any function particularly malloc (from err_init below)*/ SPRINTF(image_id,"%s=gtcm_server", image_id); #ifdef SEQUOIA if (!set_pset()) exit(-1); #endif /* Initialize everything but the network */ err_init(gtcm_exit_ch); omi_errno = OMI_ER_NO_ERROR; ctxt = ctxt; ESTABLISH_RET(omi_dbms_ch, -1); /* any return value to signify error return */ gtcm_init(argc, argv); gtcm_ltime = gtcm_stime = (int4)time(0); #ifdef GTCM_RC rc_create_cpt(); #endif REVERT; if (omi_errno != OMI_ER_NO_ERROR) exit(omi_errno); /* Initialize the network interface */ if ((ret_val = gtcm_bgn_net(&conns)) != 0) { gtcm_rep_err("Error initializing TCP", ret_val); gtcm_exi_condition = ret_val; gtcm_exit(); } SPRINTF(image_id,"%s(pid=%d) %s %s %s -id %d -service %s", image_id, omi_pid, ( history ? "-hist" : "" ), ( authenticate ? "-auth" : "" ), ( ping_keepalive ? "-ping" : "" ), rc_server_id, omi_service ); omi_conns = &conns; /* Should be forever, unless an error occurs */ gtcm_loop(&conns); /* Clean up */ gtcm_end_net(&conns); gtcm_exit(); return 0; }
#include "f2c.h" #include "blaswrap.h" doublereal dzasum_(integer *n, doublecomplex *zx, integer *incx) { /* System generated locals */ integer i__1; doublereal ret_val; /* Local variables */ integer i__, ix; doublereal stemp; extern doublereal dcabs1_(doublecomplex *); /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* takes the sum of the absolute values. */ /* jack dongarra, 3/11/78. */ /* modified 3/93 to return if incx .le. 0. */ /* modified 12/3/93, array(1) declarations changed to array(*) */ /* .. Local Scalars .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* Parameter adjustments */ --zx; /* Function Body */ ret_val = 0.; stemp = 0.; if (*n <= 0 || *incx <= 0) { return ret_val; } if (*incx == 1) { goto L20; } /* code for increment not equal to 1 */ ix = 1; i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { stemp += dcabs1_(&zx[ix]); ix += *incx; /* L10: */ } ret_val = stemp; return ret_val; /* code for increment equal to 1 */ L20: i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { stemp += dcabs1_(&zx[i__]); /* L30: */ } ret_val = stemp; return ret_val; } /* dzasum_ */
/* Copyright © 2001-2014, Canal TP and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. Hope you'll enjoy and contribute to this project, powered by Canal TP (www.canaltp.fr). Help us simplify mobility and open public transport: a non ending quest to the responsive locomotion way of traveling! LICENCE: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Stay tuned using twitter @navitia IRC #navitia on freenode https://groups.google.com/d/forum/navitia www.navitia.io */ #pragma once #include "type/pt_data.h" #include "type/datetime.h" #include "routing/raptor_utils.h" #include "utils/idx_map.h" #include "routing/next_stop_time.h" #include "routing/journey_pattern_container.h" #include <boost/foreach.hpp> #include <boost/dynamic_bitset.hpp> namespace navitia { namespace routing { /** Données statiques qui ne sont pas modifiées pendant le calcul */ struct dataRAPTOR { // cache friendly access to the connections struct Connections { struct Connection { DateTime duration; SpIdx sp_idx; }; void load(const navitia::type::PT_Data&); // for a stop point, get the corresponding forward connections IdxMap<type::StopPoint, std::vector<Connection>> forward_connections; // for a stop point, get the corresponding backward connections IdxMap<type::StopPoint, std::vector<Connection>> backward_connections; }; Connections connections; DateTime min_connection_time; // cache friendly access to JourneyPatternPoints from a StopPoint struct JppsFromSp { // compressed JourneyPatternPoint struct Jpp { JppIdx idx; // index JpIdx jp_idx; // corresponding JourneyPattern index uint16_t order; // order of the jpp in its jp }; inline const std::vector<Jpp>& operator[](const SpIdx& sp) const { return jpps_from_sp[sp]; } void load(const type::PT_Data&, const JourneyPatternContainer&); void filter_jpps(const boost::dynamic_bitset<>& valid_jpps); inline IdxMap<type::StopPoint, std::vector<Jpp>>::const_iterator begin() const { return jpps_from_sp.begin(); } inline IdxMap<type::StopPoint, std::vector<Jpp>>::const_iterator end() const { return jpps_from_sp.end(); } private: IdxMap<type::StopPoint, std::vector<Jpp>> jpps_from_sp; }; JppsFromSp jpps_from_sp; // cache friendly access to in order JourneyPatternPoints from a JourneyPattern struct JppsFromJp { // compressed JourneyPatternPoint struct Jpp { JppIdx idx; SpIdx sp_idx; bool has_freq; }; inline const std::vector<Jpp>& operator[](const JpIdx& jp) const { return jpps_from_jp[jp]; } void load(const JourneyPatternContainer&); private: IdxMap<JourneyPattern, std::vector<Jpp>> jpps_from_jp; }; JppsFromJp jpps_from_jp; NextStopTimeData next_stop_time_data; std::unique_ptr<CachedNextStopTimeManager> cached_next_st_manager; JourneyPatternContainer jp_container; // blank labels, to fast init labels with a memcpy Labels labels_const; Labels labels_const_reverse; // jp_validity_patterns[date][jp_idx] == any(vj.validity_pattern->check2(date) for vj in jp) flat_enum_map<type::RTLevel, std::vector<boost::dynamic_bitset<>>> jp_validity_patterns; dataRAPTOR() {} void load(const navitia::type::PT_Data&, size_t cache_size = 10); }; }}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef CL_INTERFACE_EXPR_NODE_H #define CL_INTERFACE_EXPR_NODE_H #include "interface_expr.h" /** Base node of an interface expression parse tree * \author Nicolas Vizerie * \author Nevrax France * \date 2003 */ class CInterfaceExprNode { public: virtual ~CInterfaceExprNode() {} // eval result of expression, and eventually get the nodes the epression depends on virtual void eval(CInterfaceExprValue &result) = 0; // The same, but get db nodes the expression depends on (appended to vector) virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes) = 0; // Get dependencies of the node (appended to vector) virtual void getDepends(std::vector<ICDBNode *> &nodes) = 0; }; // ******************************************************************************************************* /** A constant value already parsed by interface (in a interface expr parse tree) */ class CInterfaceExprNodeValue : public CInterfaceExprNode { public: CInterfaceExprValue Value; public: virtual void eval(CInterfaceExprValue &result); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<ICDBNode *> &nodes); }; // ******************************************************************************************************* /** A fct call (in a interface expr parse tree) */ class CInterfaceExprNodeValueFnCall : public CInterfaceExprNode { public: CInterfaceExpr::TUserFct Func; // list of parameters std::vector<CInterfaceExprNode *> Params; public: virtual void eval(CInterfaceExprValue &result); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual ~CInterfaceExprNodeValueFnCall(); }; // ******************************************************************************************************* /** A db leaf read (in a interface expr parse tree) */ class CInterfaceExprNodeDBLeaf : public CInterfaceExprNode { public: class CCDBNodeLeaf *Leaf; public: virtual void eval(CInterfaceExprValue &result); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<ICDBNode *> &nodes); }; // ******************************************************************************************************* /** A db branch read (in a interface expr parse tree) */ class CInterfaceExprNodeDBBranch : public CInterfaceExprNode { public: class CCDBNodeBranch *Branch; public: virtual void eval(CInterfaceExprValue &result); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<ICDBNode *> &nodes); }; // ******************************************************************************************************* /** A dependant db read (in a interface expr parse tree) * This is rarely used so no real optim there.. */ class CInterfaceExprNodeDependantDBRead : public CInterfaceExprNode { public: std::string Expr; public: virtual void eval(CInterfaceExprValue &result); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<ICDBNode *> &nodes); }; #endif