commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
8518e74f3e24b136c627534e30b0068836785575
include/llvm/Support/ValueHolder.h
include/llvm/Support/ValueHolder.h
//===-- llvm/Support/ValueHolder.h - Wrapper for Value's --------*- C++ -*-===// // // This class defines a simple subclass of User, which keeps a pointer to a // Value, which automatically updates when Value::replaceAllUsesWith is called. // This is useful when you have pointers to Value's in your pass, but the // pointers get invalidated when some other portion of the algorithm is // replacing Values with other Values. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_VALUEHOLDER_H #define LLVM_SUPPORT_VALUEHOLDER_H #include "llvm/User.h" struct ValueHolder : public User { ValueHolder(Value *V = 0); // Getters... const Value *get() const { return getOperand(0); } operator const Value*() const { return getOperand(0); } Value *get() { return getOperand(0); } operator Value*() { return getOperand(0); } // Setters... const ValueHolder &operator=(Value *V) { setOperand(0, V); return *this; } virtual void print(std::ostream& OS) const { OS << "ValueHolder"; } }; #endif
//===-- llvm/Support/ValueHolder.h - Wrapper for Value's --------*- C++ -*-===// // // This class defines a simple subclass of User, which keeps a pointer to a // Value, which automatically updates when Value::replaceAllUsesWith is called. // This is useful when you have pointers to Value's in your pass, but the // pointers get invalidated when some other portion of the algorithm is // replacing Values with other Values. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_VALUEHOLDER_H #define LLVM_SUPPORT_VALUEHOLDER_H #include "llvm/User.h" struct ValueHolder : public User { ValueHolder(Value *V = 0); ValueHolder(const ValueHolder &VH) : User(VH.getType(), Value::TypeVal) {} // Getters... const Value *get() const { return getOperand(0); } operator const Value*() const { return getOperand(0); } Value *get() { return getOperand(0); } operator Value*() { return getOperand(0); } // Setters... const ValueHolder &operator=(Value *V) { setOperand(0, V); return *this; } const ValueHolder &operator=(ValueHolder &VH) { setOperand(0, VH); return *this; } virtual void print(std::ostream& OS) const { OS << "ValueHolder"; } }; #endif
Add more methods to be more value-like
Add more methods to be more value-like git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@8074 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm
999de3c3fd59c197df0b12e3c11581560a07bfd4
tls/gnutls/gnutls-module.c
tls/gnutls/gnutls-module.c
/* GIO - GLib Input, Output and Streaming Library * * Copyright 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, see * <http://www.gnu.org/licenses/>. */ #include "config.h" #include <gio/gio.h> #include "gtlsbackend-gnutls.h" #include "gtlsbackend-gnutls-pkcs11.h" void g_io_module_load (GIOModule *module) { g_tls_backend_gnutls_register (module); g_tls_backend_gnutls_pkcs11_register (module); } void g_io_module_unload (GIOModule *module) { } gchar ** g_io_module_query (void) { gchar *eps[] = { G_TLS_BACKEND_EXTENSION_POINT_NAME, NULL }; return g_strdupv (eps); }
/* GIO - GLib Input, Output and Streaming Library * * Copyright 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, see * <http://www.gnu.org/licenses/>. */ #include "config.h" #include <gio/gio.h> #include "gtlsbackend-gnutls.h" #include "gtlsbackend-gnutls-pkcs11.h" void g_io_module_load (GIOModule *module) { g_tls_backend_gnutls_register (module); #ifdef HAVE_PKCS11 g_tls_backend_gnutls_pkcs11_register (module); #endif } void g_io_module_unload (GIOModule *module) { } gchar ** g_io_module_query (void) { gchar *eps[] = { G_TLS_BACKEND_EXTENSION_POINT_NAME, NULL }; return g_strdupv (eps); }
Fix unresolved symbol when pkcs11 is disabled
gnutls: Fix unresolved symbol when pkcs11 is disabled * Error would occur: libgiognutls.so: undefined symbol: \ g_tls_backend_gnutls_pkcs11_register
C
lgpl-2.1
Distrotech/glib-networking,GNOME/glib-networking,Distrotech/glib-networking,GNOME/glib-networking,GNOME/glib-networking,Distrotech/glib-networking
f34ee1e4aa493b3192226c77f6c7041efc47c6df
project/include/ByteArray.h
project/include/ByteArray.h
#ifndef NME_BYTE_ARRAY_H #define NME_BYTE_ARRAY_H #include <nme/Object.h> #include <nme/QuickVec.h> #include "Utils.h" namespace nme { // If you put this structure on the stack, then you do not have to worry about GC. // If you store this in a heap structure, then you will need to use GC roots for mValue... struct ByteArray { ByteArray(int inSize); ByteArray(const ByteArray &inRHS); ByteArray(); ByteArray(struct _value *Value); ByteArray(const QuickVec<unsigned char> &inValue); ByteArray(const char *inResourceName); void Resize(int inSize); int Size() const; unsigned char *Bytes(); const unsigned char *Bytes() const; bool Ok() { return mValue!=0; } struct _value *mValue; static ByteArray FromFile(const OSChar *inFilename); #ifdef HX_WINDOWS static ByteArray FromFile(const char *inFilename); #endif }; #ifdef ANDROID ByteArray AndroidGetAssetBytes(const char *); struct FileInfo { int fd; off_t offset; off_t length; }; FileInfo AndroidGetAssetFD(const char *); #endif } #endif
#ifndef NME_BYTE_ARRAY_H #define NME_BYTE_ARRAY_H #include <nme/Object.h> #include <nme/QuickVec.h> #include "Utils.h" #include <hx/CFFI.h> namespace nme { // If you put this structure on the stack, then you do not have to worry about GC. // If you store this in a heap structure, then you will need to use GC roots for mValue... struct ByteArray { ByteArray(int inSize); ByteArray(const ByteArray &inRHS); ByteArray(); ByteArray(value Value); ByteArray(const QuickVec<unsigned char> &inValue); ByteArray(const char *inResourceName); void Resize(int inSize); int Size() const; unsigned char *Bytes(); const unsigned char *Bytes() const; bool Ok() { return mValue!=0; } value mValue; static ByteArray FromFile(const OSChar *inFilename); #ifdef HX_WINDOWS static ByteArray FromFile(const char *inFilename); #endif }; #ifdef ANDROID ByteArray AndroidGetAssetBytes(const char *); struct FileInfo { int fd; off_t offset; off_t length; }; FileInfo AndroidGetAssetFD(const char *); #endif } #endif
Use correct cffi type for 'value'
Use correct cffi type for 'value'
C
mit
thomasuster/NME,haxenme/nme,haxenme/nme,haxenme/nme,haxenme/nme,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme,thomasuster/NME,madrazo/nme,madrazo/nme,haxenme/nme,madrazo/nme
122eaf409a0203d8f6e565e4cf361b7ca8f2844a
tests/sv-comp/observer/path_nofun_true-unreach-call.c
tests/sv-comp/observer/path_nofun_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; } // ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --set phases '[{}, {"ana": {"activated": ["base", "observer"], "path_sens": ["observer"]}}]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c // ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; } // ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c
Remove phases command line from SV-COMP observer example
Remove phases command line from SV-COMP observer example
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
4cc782bd715a9202b2b6eb1190fbf66eaab3d8f1
yalex/src/demo.c
yalex/src/demo.c
#include <stdio.h> #include <string.h> #include "yalex.h" void replMessageCallback(const char* ptr) { if (ptr && strlen(ptr)>0) { printf("%s\n", ptr); } } int yalex(void) { yalex_world world; yalex_init(&world, replMessageCallback); replMessageCallback("welcome"); char word[256]; /**/ yalex_repl(&world, ":fibstep (R1R R2R + R3S R2R R1S R3R R2S R4R 1 + R4S rec)"); yalex_repl(&world, ":rec (R0R R4R 1 + < 'fibstep R3R select)"); yalex_repl(&world, ":fib (R0S 0 R1S 1 R2S 0 R3S 1 R4S rec)"); while (1) { word[0] = 0; fgets(word, sizeof(word), stdin); yalex_repl(&world, word); } return 0; } int main() { yalex(); return 0; }
#include <stdio.h> #include <string.h> #include "yalex.h" void replMessageCallback(const char* ptr) { if (ptr && strlen(ptr)>0) { printf("%s\n", ptr); } } int yalex(void) { yalex_world world; yalex_init(&world, replMessageCallback); replMessageCallback("welcome"); char word[256]; /**/ yalex_repl(&world, ":nset (R0S)"); yalex_repl(&world, ":n (R0R)"); yalex_repl(&world, ":t1set (R1S)"); yalex_repl(&world, ":t1 (R1R)"); yalex_repl(&world, ":t2set (R2S)"); yalex_repl(&world, ":t2 (R2R)"); yalex_repl(&world, ":resset (R3S)"); yalex_repl(&world, ":res (R3R)"); yalex_repl(&world, ":iset (R4S)"); yalex_repl(&world, ":i (R4R)"); yalex_repl(&world, ":fibstep (t1 t2 + resset t2 t1set res t2set i 1 + iset rec)"); yalex_repl(&world, ":rec (n i 1 + < 'fibstep res select)"); yalex_repl(&world, ":fib (nset 0 t1set 1 t2set 0 resset 1 iset rec)"); while (1) { word[0] = 0; fgets(word, sizeof(word), stdin); yalex_repl(&world, word); } return 0; } int main() { yalex(); return 0; }
Add register alias for verbosity and readability?
Add register alias for verbosity and readability?
C
mit
AlexanderBrevig/yalex
f2d28e13a2ddc7dba28f53e9a7e9dfe4edd85859
Runtime/Rendering/ConstantBufferDX11.h
Runtime/Rendering/ConstantBufferDX11.h
#pragma once #include "Rendering/BufferDX11.h" #include "Rendering/ShaderDX11.h" namespace Mile { class MEAPI ConstantBufferDX11 : public BufferDX11 { public: ConstantBufferDX11(RendererDX11* renderer); ~ConstantBufferDX11(); bool Init(unsigned int size); template <typename Buffer> bool Init() { return Init(sizeof(Buffer)); } virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; } virtual void* Map(ID3D11DeviceContext& deviceContext) override; template <typename BufferType> BufferType* Map(ID3D11DeviceContext& deviceContext) { return reinterpret_cast<BufferType*>(Map(deviceContext)); } virtual bool UnMap(ID3D11DeviceContext& deviceContext) override; bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType); void Unbind(ID3D11DeviceContext& deviceContext); FORCEINLINE bool IsBound() const { return m_bIsBound; } FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; } FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; } private: bool m_bIsBound; unsigned int m_boundSlot; EShaderType m_boundShader; }; }
#pragma once #include "Rendering/BufferDX11.h" #include "Rendering/ShaderDX11.h" namespace Mile { class MEAPI ConstantBufferDX11 : public BufferDX11 { public: ConstantBufferDX11(RendererDX11* renderer); ~ConstantBufferDX11(); bool Init(unsigned int size); template <typename BufferType> bool Init() { return Init(sizeof(BufferType)); } virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; } virtual void* Map(ID3D11DeviceContext& deviceContext) override; template <typename BufferType> BufferType* Map(ID3D11DeviceContext& deviceContext) { return reinterpret_cast<BufferType*>(Map(deviceContext)); } virtual bool UnMap(ID3D11DeviceContext& deviceContext) override; bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType); void Unbind(ID3D11DeviceContext& deviceContext); FORCEINLINE bool IsBound() const { return m_bIsBound; } FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; } FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; } private: bool m_bIsBound; unsigned int m_boundSlot; EShaderType m_boundShader; }; }
Modify constant buffer init method template type name
Modify constant buffer init method template type name
C
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
dd3ef21ed70fa4d34f6713f83089c821b2707a60
Application.h
Application.h
#pragma once #include <SDL2/SDL.h> #include <string> class Application { private: // Main loop flag bool quit; // The window SDL_Window* window; // The window renderer SDL_Renderer* renderer; // The background color SDL_Color backgroundColor; // Window properties std::string title; unsigned int windowWidth; unsigned int windowHeight; bool isFullscreen; bool init(); void close(); void draw(); protected: // Event called after initialized virtual void on_init(); // Event called when before drawing the screen in the loop virtual void on_update(); // Event called when drawing the screen in the loop virtual void on_draw(SDL_Renderer* renderer); void set_background_color(SDL_Color color); public: Application(); Application(std::string title); Application(std::string title, unsigned int width, unsigned int height); Application(std::string title, unsigned int width, unsigned int height, bool fullscreen); ~Application(); void Run(); };
#pragma once #include <SDL2/SDL.h> #include <string> class Application { private: // Main loop flag bool quit; // The window SDL_Window* window; // The window renderer SDL_Renderer* renderer; // The background color SDL_Color backgroundColor; // Window properties std::string title; unsigned int windowWidth; unsigned int windowHeight; bool isFullscreen; bool init(); void close(); void draw(); protected: // Event called after initialized virtual void on_init(); // Event called when before drawing the screen in the loop virtual void on_update(); // Event called when drawing the screen in the loop virtual void on_draw(SDL_Renderer* renderer); void set_background_color(SDL_Color color); unsigned int get_window_height() { return windowHeight; } unsigned int get_window_width() { return windowWidth; } bool is_fullscreen() { return isFullscreen; } public: Application(); Application(std::string title); Application(std::string title, unsigned int width, unsigned int height); Application(std::string title, unsigned int width, unsigned int height, bool fullscreen); ~Application(); void Run(); };
Add getters for window constants
Add getters for window constants
C
mit
gldraphael/SdlTemplate
76f99cdff282275195f86b132b2daab6470900df
CreamMonkey.h
CreamMonkey.h
#import <Cocoa/Cocoa.h> @interface CreamMonkey : NSObject { } @end
/* * Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info> * This source code is released under the MIT license. */ #import <Cocoa/Cocoa.h> @interface CreamMonkey : NSObject { } @end
Add copyright and license header.
Add copyright and license header.
C
mit
kzys/greasekit,sohocoke/greasekit,tbodt/greasekit,chrismessina/greasekit
181aa9e0febf808f95718c3eea1f74d9fdc0086c
QtVmbViewer.h
QtVmbViewer.h
#ifndef QTVMBVIEWER_H #define QTVMBVIEWER_H // Qt dependencies #include <QWidget> #include <QLabel> #include <QSlider> // Local dependency #include "VmbCamera.h" // Qt widget to display the images from an Allied Vision camera through the Vimba SDK class QtVmbViewer : public QWidget { // Macro to use Qt signals and slots Q_OBJECT // Public members public : // Constructor QtVmbViewer( QWidget *parent = 0 ); // Destructor ~QtVmbViewer(); // Qt slots public slots : // Slot to get the image from the camera and update the widget void UpdateImage(); // Slot to update the camera exposure void SetExposure(); // Private members private : // Label to display the camera image QLabel* label; // Slider to set the camera exposure time QSlider* slider; // Allied Vision camera VmbCamera* camera; }; #endif // QTVMBVIEWER_H
#ifndef QTVMBVIEWER_H #define QTVMBVIEWER_H // Qt dependencies #include <QWidget> #include <QLabel> #include <QSlider> // Local dependency #include "VmbCamera.h" // Qt widget to display the images from an Allied Vision camera through the Vimba SDK class QtVmbViewer : public QWidget { // Macro to use Qt signals and slots Q_OBJECT // Public members public : // Constructor QtVmbViewer( QWidget *parent = 0 ); // Destructor ~QtVmbViewer(); // Qt slots private slots : // Slot to get the image from the camera and update the widget void UpdateImage(); // Slot to update the camera exposure void SetExposure(); // Private members private : // Label to display the camera image QLabel* label; // Slider to set the camera exposure time QSlider* slider; // Allied Vision camera VmbCamera* camera; }; #endif // QTVMBVIEWER_H
Change to private Qt slots.
Change to private Qt slots.
C
mit
microy/QtVmbViewer
0374498753335e45920f20c1a3b224f430bb82f1
Sources/Faraday.h
Sources/Faraday.h
/* Faraday Faraday.h * * Copyright © 2015, 2016, Roy Ratcliffe, Pioneering Software, United Kingdom * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the “Software”), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO * EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * ******************************************************************************/ #import <Foundation/Foundation.h> FOUNDATION_EXPORT double FaradayVersionNumber; FOUNDATION_EXPORT const unsigned char FaradayVersionString[];
/* Faraday Faraday.h * * Copyright © 2015, 2016, Roy Ratcliffe, Pioneering Software, United Kingdom * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the “Software”), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO * EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * ******************************************************************************/ @import Foundation; FOUNDATION_EXPORT double FaradayVersionNumber; FOUNDATION_EXPORT const unsigned char FaradayVersionString[];
Use @import in Objective-C header
Use @import in Objective-C header
C
mit
royratcliffe/Faraday,royratcliffe/Faraday
bae6f787c319c9b2cafba0e5fd0027c5d3903fc6
src/gluonvarianttypes.h
src/gluonvarianttypes.h
/* <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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/>. */ ///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;) #ifndef GLUON_VARIANTTYPES #define GLUON_VARIANTTYPES #ifndef EIGEN_CORE_H #warning This needs to be included AFTER Eigen and friends #endif #include <QVariant> #include <Eigen/Geometry> Q_DECLARE_METATYPE(Eigen::Vector3d) //qRegisterMetatype<Eigen::Vector3d>("Eigen::Vector3d"); #endif
/* <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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/>. */ ///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;) #ifndef GLUON_VARIANTTYPES #define GLUON_VARIANTTYPES #include <QVariant> #include <QMetaType> #include <Eigen/Geometry> Q_DECLARE_METATYPE(Eigen::Vector3d) namespace { struct GluonVariantTypes { public: GluonVariantTypes() { qRegisterMetaType<Eigen::Vector3d>("Eigen::Vector3d"); } }; GluonVariantTypes gluonVariantTypes; } #endif
Make the varianttypes work more pleasantly - now you simply include the file, and stuff happens magically! (that is, Eigen::Vector3d is registered as a QVariant now... more to come!)
Make the varianttypes work more pleasantly - now you simply include the file, and stuff happens magically! (that is, Eigen::Vector3d is registered as a QVariant now... more to come!)
C
lgpl-2.1
pranavrc/example-gluon,cgaebel/gluon,cgaebel/gluon,cgaebel/gluon,pranavrc/example-gluon,KDE/gluon,KDE/gluon,KDE/gluon,pranavrc/example-gluon,pranavrc/example-gluon,cgaebel/gluon,KDE/gluon
64dfbcfad0d2b4820c53110f9622ab6ca726a123
gram/rsl_assist/source/globus_rsl_assist.h
gram/rsl_assist/source/globus_rsl_assist.h
/****************************************************************************** globus_rsl_assist.h Description: This header contains the interface prototypes for the rsl_assist library. CVS Information: $Source$ $Date$ $Revision$ $Author$ ******************************************************************************/ #ifndef _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_ #define _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_ #ifndef EXTERN_C_BEGIN #ifdef __cplusplus #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } #else #define EXTERN_C_BEGIN #define EXTERN_C_END #endif #endif #include "globus_common.h" #include "globus_rsl.h" char* globus_rsl_assist_get_rm_contact(char* resource); int globus_rsl_assist_replace_manager_name(globus_rsl_t * rsl); #endif
/* * globus_rsl_assist.h * * Description: * * This header contains the interface prototypes for the rsl_assist library. * * CVS Information: * * $Source$ * $Date$ * $Revision$ * $Author$ ******************************************************************************/ #ifndef _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_ #define _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_ #ifndef EXTERN_C_BEGIN #ifdef __cplusplus #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } #else #define EXTERN_C_BEGIN #define EXTERN_C_END #endif #endif #include "globus_common.h" #include "globus_rsl.h" char* globus_rsl_assist_get_rm_contact(char* resource); int globus_rsl_assist_replace_manager_name(globus_rsl_t * rsl); #endif
Make comment conform to coding standard...
Make comment conform to coding standard...
C
apache-2.0
gridcf/gct,globus/globus-toolkit,globus/globus-toolkit,gridcf/gct,globus/globus-toolkit,globus/globus-toolkit,globus/globus-toolkit,ellert/globus-toolkit,gridcf/gct,gridcf/gct,ellert/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit,gridcf/gct,globus/globus-toolkit,gridcf/gct,globus/globus-toolkit,globus/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit,ellert/globus-toolkit
593c4ae13535e52dab15af80618dbee90a4f818c
tests/regression/29-svcomp/04-lustre-minimal.c
tests/regression/29-svcomp/04-lustre-minimal.c
// PARAM: --enable ana.int.interval --enable ana.int.def_exc // issue #120 #include <assert.h> int main() { // should be LP64 unsigned long n = 16; unsigned long size = 4912; assert(!(0xffffffffffffffffUL / size < n)); // UNKNOWN (for now) }
// PARAM: --enable ana.int.interval --enable ana.int.def_exc // issue #120 #include <assert.h> int main() { // should be LP64 unsigned long n = 16; unsigned long size = 4912; assert(!(0xffffffffffffffffUL / size < n)); }
Remove UNKNOWN annotation from assert that now succeeds
Testcase: Remove UNKNOWN annotation from assert that now succeeds
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
84d607040b1df3b151aabb226122bc2d29f2d74a
document/src/vespa/document/repo/document_type_repo_factory.h
document/src/vespa/document/repo/document_type_repo_factory.h
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <memory> #include <mutex> #include <map> namespace document { namespace internal { class InternalDocumenttypesType; } class DocumentTypeRepo; /* * Factory class for document type repos. Same instance is returned * for equal config. */ class DocumentTypeRepoFactory { using DocumenttypesConfig = const internal::InternalDocumenttypesType; struct DocumentTypeRepoEntry { std::weak_ptr<const DocumentTypeRepo> repo; std::unique_ptr<const DocumenttypesConfig> config; DocumentTypeRepoEntry(std::weak_ptr<const DocumentTypeRepo> repo_in, std::unique_ptr<const DocumenttypesConfig> config_in) : repo(std::move(repo_in)), config(std::move(config_in)) { } }; using DocumentTypeRepoMap = std::map<const void *, DocumentTypeRepoEntry>; class Deleter; static std::mutex _mutex; static DocumentTypeRepoMap _repos; static void deleteRepo(DocumentTypeRepo *repoRawPtr) noexcept; public: static std::shared_ptr<const DocumentTypeRepo> make(const DocumenttypesConfig &config); }; }
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <memory> #include <mutex> #include <map> namespace document { namespace internal { class InternalDocumenttypesType; } class DocumentTypeRepo; /* * Factory class for document type repos. Same instance is returned * for equal config. */ class DocumentTypeRepoFactory { using DocumenttypesConfig = const internal::InternalDocumenttypesType; struct DocumentTypeRepoEntry { std::weak_ptr<const DocumentTypeRepo> repo; std::unique_ptr<const DocumenttypesConfig> config; DocumentTypeRepoEntry(std::weak_ptr<const DocumentTypeRepo> repo_in, std::unique_ptr<const DocumenttypesConfig> config_in) : repo(std::move(repo_in)), config(std::move(config_in)) { } }; using DocumentTypeRepoMap = std::map<const void *, DocumentTypeRepoEntry>; class Deleter; static std::mutex _mutex; static DocumentTypeRepoMap _repos; static void deleteRepo(DocumentTypeRepo *repoRawPtr) noexcept; public: /* * Since same instance is returned for equal config, we return a shared * pointer to a const repo. The repo should be considered immutable. */ static std::shared_ptr<const DocumentTypeRepo> make(const DocumenttypesConfig &config); }; }
Add comment for document::DocumentTypeRepoFactory::make method.
Add comment for document::DocumentTypeRepoFactory::make method.
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
0ed54c92c849c3c62f6a61877472f1495ecd2025
Demo/ARM7_LPC2368_Eclipse/RTOSDemo/webserver/EMAC_ISR.c
Demo/ARM7_LPC2368_Eclipse/RTOSDemo/webserver/EMAC_ISR.c
#include "FreeRTOS.h" #include "Semphr.h" #include "task.h" /* The interrupt entry point. */ void vEMAC_ISR_Wrapper( void ) __attribute__((naked)); /* The handler that does the actual work. */ void vEMAC_ISR_Handler( void ); extern xSemaphoreHandle xEMACSemaphore; void vEMAC_ISR_Handler( void ) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* Clear the interrupt. */ MAC_INTCLEAR = 0xffff; VICVectAddr = 0; /* Ensure the uIP task is not blocked as data has arrived. */ xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) { /* Giving the semaphore woke a task. */ portYIELD_FROM_ISR(); } } /*-----------------------------------------------------------*/ void vEMAC_ISR_Wrapper( void ) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Call the handler. This must be a separate function unless you can guarantee that no stack will be used. */ vEMAC_ISR_Handler(); /* Restore the context of whichever task is going to run next. */ portRESTORE_CONTEXT(); }
#include "FreeRTOS.h" #include "semphr.h" #include "task.h" /* The interrupt entry point. */ void vEMAC_ISR_Wrapper( void ) __attribute__((naked)); /* The handler that does the actual work. */ void vEMAC_ISR_Handler( void ); extern xSemaphoreHandle xEMACSemaphore; void vEMAC_ISR_Handler( void ) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* Clear the interrupt. */ MAC_INTCLEAR = 0xffff; VICVectAddr = 0; /* Ensure the uIP task is not blocked as data has arrived. */ xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) { /* Giving the semaphore woke a task. */ portYIELD_FROM_ISR(); } } /*-----------------------------------------------------------*/ void vEMAC_ISR_Wrapper( void ) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Call the handler. This must be a separate function unless you can guarantee that no stack will be used. */ vEMAC_ISR_Handler(); /* Restore the context of whichever task is going to run next. */ portRESTORE_CONTEXT(); }
Correct case of include file to build on Linux.
Correct case of include file to build on Linux. git-svn-id: 43aea61533866f88f23079d48f4f5dc2d5288937@402 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
C
apache-2.0
Psykar/kubos,Psykar/kubos,Psykar/kubos,kubostech/KubOS,Psykar/kubos,Psykar/kubos,kubostech/KubOS,Psykar/kubos,Psykar/kubos
e77d038d2bed3605d18c83152402a5ddfd7255dd
Classes/SloppySwiper.h
Classes/SloppySwiper.h
// // SloppySwiper.h // // Created by Arkadiusz on 29-05-14. // #import <Foundation/Foundation.h> @interface SloppySwiper : NSObject <UINavigationControllerDelegate> // Designated initializer if the class isn't set in the Interface Builder. - (instancetype)initWithNavigationController:(UINavigationController *)navigationController; @end
// // SloppySwiper.h // // Created by Arkadiusz on 29-05-14. // #import <Foundation/Foundation.h> @interface SloppySwiper : NSObject <UINavigationControllerDelegate> /// Gesture recognizer used to recognize swiping to the right. @property (weak, nonatomic) UIPanGestureRecognizer *panRecognizer; /// Designated initializer if the class isn't used from the Interface Builder. - (instancetype)initWithNavigationController:(UINavigationController *)navigationController; @end
Improve comments in the header file
Improve comments in the header file
C
mit
toc2menow/SloppySwiper,ssowonny/SloppySwiper,stephenbalaban/SloppySwiper,fastred/SloppySwiper,msdgwzhy6/SloppySwiper,igroomgrim/SloppySwiper,barrettj/SloppySwiper,yusuga/SloppySwiper,xuvw/SloppySwiper
ab734ec5a64b364fcf8aff3d91eea860887afc42
onnxruntime/core/framework/tensor_external_data_info.h
onnxruntime/core/framework/tensor_external_data_info.h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include <string> #include "core/common/status.h" #include "core/graph/onnx_protobuf.h" #include "core/session/onnxruntime_c_api.h" namespace onnxruntime { class ExternalDataInfo { private: std::basic_string<ORTCHAR_T> rel_path_; //-1 means doesn't exist ptrdiff_t offset_; //-1 means doesn't exist ptrdiff_t length_; std::string checksum_; public: const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; } ptrdiff_t GetOffset() const { return offset_; } ptrdiff_t GetLength() const { return length_; } const std::string& GetChecksum() const { return checksum_; } // If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a // wrong value and return FAIL. static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input, std::unique_ptr<ExternalDataInfo>& out); }; } // namespace onnxruntime
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include <string> #include "core/common/status.h" #include "core/graph/onnx_protobuf.h" #include "core/session/onnxruntime_c_api.h" namespace onnxruntime { class ExternalDataInfo { private: std::basic_string<ORTCHAR_T> rel_path_; ptrdiff_t offset_ = 0; ptrdiff_t length_ = 0; std::string checksum_; public: const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; } ptrdiff_t GetOffset() const { return offset_; } ptrdiff_t GetLength() const { return length_; } const std::string& GetChecksum() const { return checksum_; } // If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a // wrong value and return FAIL. static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input, std::unique_ptr<ExternalDataInfo>& out); }; } // namespace onnxruntime
Fix a bug in ExternalDataInfo
Fix a bug in ExternalDataInfo
C
mit
microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime
ec2bf942662f8a8f1049b80208192691b64da6a5
React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h
React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import <UIKit/UIKit.h> #import <React/RCTViewComponentView.h> NS_ASSUME_NONNULL_BEGIN /** * UIView class for root <ShimmeringView> component. */ @interface RCTActivityIndicatorViewComponentView : RCTViewComponentView @end NS_ASSUME_NONNULL_END
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import <UIKit/UIKit.h> #import <React/RCTViewComponentView.h> NS_ASSUME_NONNULL_BEGIN /** * UIView class for root <ActivityIndicator> component. */ @interface RCTActivityIndicatorViewComponentView : RCTViewComponentView @end NS_ASSUME_NONNULL_END
Fix incorrect information in comment
Fix incorrect information in comment Summary: `RCTActivityIndicatorViewComponentView` is a component for `ActivityIndicator` not for `ShimmeringView`. Reviewed By: cpojer Differential Revision: D16360505 fbshipit-source-id: d6f7685eea24060c9e1b43d5782a65396d6c375e
C
bsd-3-clause
exponentjs/react-native,javache/react-native,arthuralee/react-native,janicduplessis/react-native,janicduplessis/react-native,hoangpham95/react-native,javache/react-native,facebook/react-native,hammerandchisel/react-native,janicduplessis/react-native,facebook/react-native,myntra/react-native,exponent/react-native,facebook/react-native,hammerandchisel/react-native,facebook/react-native,janicduplessis/react-native,exponentjs/react-native,exponent/react-native,pandiaraj44/react-native,exponent/react-native,exponent/react-native,exponentjs/react-native,hoangpham95/react-native,exponentjs/react-native,janicduplessis/react-native,pandiaraj44/react-native,exponentjs/react-native,javache/react-native,myntra/react-native,exponent/react-native,hammerandchisel/react-native,hoangpham95/react-native,hammerandchisel/react-native,javache/react-native,hammerandchisel/react-native,hammerandchisel/react-native,exponentjs/react-native,hammerandchisel/react-native,myntra/react-native,pandiaraj44/react-native,hoangpham95/react-native,myntra/react-native,exponent/react-native,arthuralee/react-native,arthuralee/react-native,myntra/react-native,javache/react-native,pandiaraj44/react-native,myntra/react-native,hammerandchisel/react-native,hoangpham95/react-native,javache/react-native,exponentjs/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,hoangpham95/react-native,myntra/react-native,facebook/react-native,facebook/react-native,exponent/react-native,myntra/react-native,javache/react-native,arthuralee/react-native,myntra/react-native,hoangpham95/react-native,hoangpham95/react-native,facebook/react-native,pandiaraj44/react-native,facebook/react-native,arthuralee/react-native,exponent/react-native,facebook/react-native,pandiaraj44/react-native,janicduplessis/react-native,exponentjs/react-native,pandiaraj44/react-native,janicduplessis/react-native,pandiaraj44/react-native
817f72d680828bb848099adf69fd35c14ff2e182
arch/m68k/include/asm/virtconvert.h
arch/m68k/include/asm/virtconvert.h
#ifndef __VIRT_CONVERT__ #define __VIRT_CONVERT__ /* * Macros used for converting between virtual and physical mappings. */ #ifdef __KERNEL__ #include <linux/compiler.h> #include <linux/mmzone.h> #include <asm/setup.h> #include <asm/page.h> /* * Change virtual addresses to physical addresses and vv. */ static inline unsigned long virt_to_phys(void *address) { return __pa(address); } static inline void *phys_to_virt(unsigned long address) { return __va(address); } /* Permanent address of a page. */ #ifdef CONFIG_MMU #ifdef CONFIG_SINGLE_MEMORY_CHUNK #define page_to_phys(page) \ __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) #else #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #endif #else #define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) #endif /* * IO bus memory addresses are 1:1 with the physical address, */ #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt #endif #endif
#ifndef __VIRT_CONVERT__ #define __VIRT_CONVERT__ /* * Macros used for converting between virtual and physical mappings. */ #ifdef __KERNEL__ #include <linux/compiler.h> #include <linux/mmzone.h> #include <asm/setup.h> #include <asm/page.h> /* * Change virtual addresses to physical addresses and vv. */ static inline unsigned long virt_to_phys(void *address) { return __pa(address); } static inline void *phys_to_virt(unsigned long address) { return __va(address); } /* Permanent address of a page. */ #if defined(CONFIG_MMU) && defined(CONFIG_SINGLE_MEMORY_CHUNK) #define page_to_phys(page) \ __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) #else #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #endif /* * IO bus memory addresses are 1:1 with the physical address, */ #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt #endif #endif
Correct page_to_phys when PAGE_OFFSET is non-zero.
m68knommu: Correct page_to_phys when PAGE_OFFSET is non-zero. The definition of page_to_phys for nommu produces an incorrect value when PAGE_OFFSET is non-zero. The nommu version of page_to_pfn works correctly for non-zero PAGE_OFFSET, so use that instead. Signed-off-by: Steven King <a01a09c207e33d02e60d4b67c9ce2ea5390b7812@fdwdc.com> Signed-off-by: Greg Ungerer <ed22c22dbde360207569092e60b4298397efb8da@uclinux.org>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
ff7f701a95cc88bd107de6b9082e398106482111
include/Support/DataTypes.h
include/Support/DataTypes.h
//===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=// // // This file contains definitions to figure out the size of _HOST_ data types. // This file is important because different host OS's define different macros, // which makes portability tough. This file exports the following definitions: // // LITTLE_ENDIAN: is #define'd if the host is little endian // int64_t : is a typedef for the signed 64 bit system type // uint64_t : is a typedef for the unsigned 64 bit system type // // No library is required when using these functinons. // //===----------------------------------------------------------------------===// // TODO: This file sucks. Not only does it not work, but this stuff should be // autoconfiscated anyways. Major FIXME #ifndef LLVM_SUPPORT_DATATYPES_H #define LLVM_SUPPORT_DATATYPES_H #include <inttypes.h> #ifdef LINUX #define __STDC_LIMIT_MACROS 1 #include <stdint.h> // Defined by ISO C 99 #include <endian.h> #else #include <sys/types.h> #ifdef _LITTLE_ENDIAN #define LITTLE_ENDIAN 1 #endif #endif #endif
//===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=// // // This file contains definitions to figure out the size of _HOST_ data types. // This file is important because different host OS's define different macros, // which makes portability tough. This file exports the following definitions: // // LITTLE_ENDIAN: is #define'd if the host is little endian // int64_t : is a typedef for the signed 64 bit system type // uint64_t : is a typedef for the unsigned 64 bit system type // // No library is required when using these functinons. // //===----------------------------------------------------------------------===// // TODO: This file sucks. Not only does it not work, but this stuff should be // autoconfiscated anyways. Major FIXME #ifndef LLVM_SUPPORT_DATATYPES_H #define LLVM_SUPPORT_DATATYPES_H #include <inttypes.h> #ifdef __linux__ #define __STDC_LIMIT_MACROS 1 #include <stdint.h> // Defined by ISO C 99 #include <endian.h> #else #include <sys/types.h> #ifdef _LITTLE_ENDIAN #define LITTLE_ENDIAN 1 #endif #endif #endif
Add better linux support by using the right macro. This still should be autoconfiscated, but for now this is sufficient.
Add better linux support by using the right macro. This still should be autoconfiscated, but for now this is sufficient. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3701 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm
b5ba1b31c793185d6e0ee62c1928c84bcff9818e
include/asm-sparc64/setup.h
include/asm-sparc64/setup.h
/* * Just a place holder. */ #ifndef _SPARC64_SETUP_H #define _SPARC64_SETUP_H #define COMMAND_LINE_SIZE 256 #endif /* _SPARC64_SETUP_H */
/* * Just a place holder. */ #ifndef _SPARC64_SETUP_H #define _SPARC64_SETUP_H #define COMMAND_LINE_SIZE 2048 #endif /* _SPARC64_SETUP_H */
Increase command line size to 2048 like other arches.
[SPARC64]: Increase command line size to 2048 like other arches. Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
ccf1eb48c779fc3ebeda4fdd90eef1132f8a9734
include/ygo/data/CardData.h
include/ygo/data/CardData.h
#ifndef YGO_DATA_CARDDATA_H #define YGO_DATA_CARDDATA_H #include <string> #include "CardType.h" namespace ygo { namespace data { struct StaticCardData { std::string name; CardType cardType; // monster only Attribute attribute; MonsterType monsterType; Type type; MonsterType monsterAbility; int level; int attack; int defense; int lpendulum; int rpendulum; // spell and trap only SpellType spellType; TrapType trapType; std::string text; }; } } #endif
#ifndef YGO_DATA_CARDDATA_H #define YGO_DATA_CARDDATA_H #include <string> #include "CardType.h" namespace ygo { namespace data { struct StaticCardData { std::string name; CardType cardType; // monster only Attribute attribute; MonsterType monsterType; Type type; MonsterType monsterAbility; int level; int attack; int defense; int lpendulum; int rpendulum; // spell and trap only SpellType spellType; TrapType trapType; // card text std::string text; }; } } #endif
Clarify data in static card data
Clarify data in static card data
C
mit
DeonPoncini/ygodata
1d76413d676c592f8d0bd1eb288f0e69fff61f7e
pq-crypto/pq-random.c
pq-crypto/pq-random.c
/* * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <sys/param.h> #include "pq-crypto/pq-random.h" #include "utils/s2n_mem.h" static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data; int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *)) { if (generator_ptr == NULL) { return -1; } random_data_generator = generator_ptr; return 0; } int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes) { struct s2n_blob out = {.data = buffer,.size = num_bytes }; return random_data_generator(&out); }
/* * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <stdlib.h> #include <sys/param.h> #include "pq-crypto/pq-random.h" #include "utils/s2n_mem.h" static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data; int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *)) { if (generator_ptr == NULL) { return -1; } random_data_generator = generator_ptr; return 0; } int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes) { struct s2n_blob out = {.data = buffer,.size = num_bytes }; return random_data_generator(&out); }
Enable compiling with older versions of GCC
Enable compiling with older versions of GCC
C
apache-2.0
awslabs/s2n,colmmacc/s2n,wcs1only/s2n,colmmacc/s2n,PKRoma/s2n,gibson-compsci/s2n,wcs1only/s2n,awslabs/s2n,alexeblee/s2n,raycoll/s2n,PKRoma/s2n,wcs1only/s2n,gibson-compsci/s2n,raycoll/s2n,colmmacc/s2n,gibson-compsci/s2n,raycoll/s2n,awslabs/s2n,PKRoma/s2n,wcs1only/s2n,colmmacc/s2n,PKRoma/s2n,awslabs/s2n,raycoll/s2n,alexeblee/s2n,alexeblee/s2n,alexeblee/s2n,wcs1only/s2n,raycoll/s2n,awslabs/s2n,alexeblee/s2n,PKRoma/s2n,PKRoma/s2n,wcs1only/s2n,colmmacc/s2n,colmmacc/s2n,alexeblee/s2n,raycoll/s2n,wcs1only/s2n,gibson-compsci/s2n,awslabs/s2n,gibson-compsci/s2n,gibson-compsci/s2n,wcs1only/s2n,PKRoma/s2n,PKRoma/s2n
de0afa4fa188b5659acf2859848e644e0864cdc5
hal1.h
hal1.h
#ifndef HAL1_H #define HAL1_H // Configurable constants extern int const MAIN_MOTOR_PWM_TOP; extern int const MAIN_MOTOR_BRAKE_SPEED; extern int const MAIN_MOTOR_MIN_SPEED; extern int const MAIN_MOTOR_MED_SPEED; extern int const MAIN_MOTOR_MAX_SPEED; extern int const MAGNET_OPEN_WAIT; void init(void); void main_motor_stop(); void main_motor_cw_open(uint8_t speed); void main_motor_ccw_close(uint8_t speed); void aux_motor_stop(); void aux_motor_cw_close(); void aux_motor_ccw_open(); void magnet_off(); void magnet_on(); bool door_nearly_open(); bool door_fully_open(); bool door_fully_closed(); bool sensor_proximity(); bool button_openclose(); bool button_stop(); bool main_encoder(); bool aux_outdoor_limit(); bool aux_indoor_limit(); bool door_nearly_closed(); bool aux_encoder(); // Private functions static void set_main_motor_speed(int speed); #endif
#ifndef HAL1_H #define HAL1_H // Configurable constants extern int const MAIN_MOTOR_PWM_TOP; extern int const MAIN_MOTOR_BRAKE_SPEED; extern int const MAIN_MOTOR_MIN_SPEED; extern int const MAIN_MOTOR_MED_SPEED; extern int const MAIN_MOTOR_MAX_SPEED; extern int const MAGNET_OPEN_WAIT; void init(void); void main_motor_stop(); void main_motor_cw_open(uint8_t speed); void main_motor_ccw_close(uint8_t speed); void aux_motor_stop(); void aux_motor_cw_close(uint8_t speed); void aux_motor_ccw_open(uint8_t speed); void magnet_off(); void magnet_on(); bool door_nearly_open(); bool door_fully_open(); bool door_fully_closed(); bool sensor_proximity(); bool button_openclose(); bool button_stop(); bool main_encoder(); bool aux_outdoor_limit(); bool aux_indoor_limit(); bool door_nearly_closed(); bool aux_encoder(); // Private functions static void set_main_motor_speed(int speed); #endif
Add speed to aux motor functions.
Add speed to aux motor functions.
C
unlicense
plzz/ovisysteemi,plzz/ovisysteemi
ebf93089a14d4ee802a317a78225361f6c61fe14
base_sheet.h
base_sheet.h
#include "helper.h" #include <string> // string #include <stdlib.h> // srand, rand #include <time.h> // time - for rand seed #include <algorithm> // sort using namespace std; class BaseSheet { protected: int _level; int _str; int _dex; int _con; int _int; int _wis; int _cha; int _speed ; // All of these others have enums and a string // The string is to print out - maybe not the best way Size _size; string _size_text; Alignment_0 _alignment_0; Alignment_1 _alignment_1; string _alignment_text; Race _race; string _race_text; DndClass _class; string _class_text; void set_class(DndClass myClass); public: BaseSheet(DndClass myClass); void print_stats(); void level_up(); virtual void check_for_abilities(); void roll_stats(int[]); virtual void assign_stats(int[]); };
#include "helper.h" #include <string> // string #include <stdlib.h> // srand, rand #include <time.h> // time - for rand seed #include <algorithm> // sort #include <functional> // std::greater for mac osx using namespace std; class BaseSheet { protected: int _level; int _str; int _dex; int _con; int _int; int _wis; int _cha; int _speed ; // All of these others have enums and a string // The string is to print out - maybe not the best way Size _size; string _size_text; Alignment_0 _alignment_0; Alignment_1 _alignment_1; string _alignment_text; Race _race; string _race_text; DndClass _class; string _class_text; void set_class(DndClass myClass); public: BaseSheet(DndClass myClass); void print_stats(); void level_up(); virtual void check_for_abilities(); void roll_stats(int[]); virtual void assign_stats(int[]); };
Add include <functional> for osx
Add include <functional> for osx
C
mit
golddiamonds/character
245dbbfe13b1a31e5955106d58687c3b384dca66
dev/ic/i8237reg.h
dev/ic/i8237reg.h
/* $OpenBSD: i8237reg.h,v 1.2 1996/04/18 23:47:19 niklas Exp $ */ /* $NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $ */ /* * Intel 8237 DMA Controller */ #define DMA37MD_WRITE 0x04 /* read the device, write memory operation */ #define DMA37MD_READ 0x08 /* write the device, read memory operation */ #define DMA37MD_LOOP 0x10 /* auto-initialize mode */ #define DMA37MD_SINGLE 0x40 /* single pass mode */ #define DMA37MD_CASCADE 0xc0 /* cascade mode */ #define DMA37SM_CLEAR 0x00 /* clear mask bit */ #define DMA37SM_SET 0x04 /* set mask bit */
/* $OpenBSD: i8237reg.h,v 1.3 1999/08/04 23:07:49 niklas Exp $ */ /* $NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $ */ /* * Intel 8237 DMA Controller */ #define DMA37MD_DEMAND 0x00 /* demand mode */ #define DMA37MD_WRITE 0x04 /* read the device, write memory operation */ #define DMA37MD_READ 0x08 /* write the device, read memory operation */ #define DMA37MD_LOOP 0x10 /* auto-initialize mode */ #define DMA37MD_SINGLE 0x40 /* single pass mode */ #define DMA37MD_CASCADE 0xc0 /* cascade mode */ #define DMA37SM_CLEAR 0x00 /* clear mask bit */ #define DMA37SM_SET 0x04 /* set mask bit */
Add new manifest constant for demand mode DMA; form NetBSD
Add new manifest constant for demand mode DMA; form NetBSD
C
isc
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
1ca47e1e88457d9bd9998e2cc2aae19495d4668b
examples/rmc-test.c
examples/rmc-test.c
#include "rmc.h" // Some test cases that required some bogosity to not have the branches get // optimized away. // // Also, if r doesn't get used usefully, that load gets optimized away. // I can't decide whether that is totally fucked or not. int global_p, global_q; int bogus_ctrl_dep1() { XEDGE(read, write); L(read, int r = global_p); if (r == r) { L(write, global_q = 1); } return r; } // Do basically the same thing in each branch int bogus_ctrl_dep2() { XEDGE(read, write); L(read, int r = global_p); if (r) { L(write, global_q = 1); } else { L(write, global_q = 1); } return r; } // Have a bogus ctrl dep int bogus_ctrl_dep3() { XEDGE(read, write); L(read, int r = global_p); if (r) {}; L(write, global_q = 1); return r; }
#include "rmc.h" // Some test cases that required some bogosity to not have the branches get // optimized away. // // Also, if r doesn't get used usefully, that load gets optimized away. // I can't decide whether that is totally fucked or not. int global_p, global_q; int bogus_ctrl_dep1() { XEDGE(read, write); L(read, int r = global_p); if (r == r) { L(write, global_q = 1); } return r; } // Do basically the same thing in each branch int bogus_ctrl_dep2() { XEDGE(read, write); L(read, int r = global_p); if (r) { L(write, global_q = 1); } else { L(write, global_q = 1); } return r; } // Have a totally ignored ctrl dep int bogus_ctrl_dep3() { XEDGE(read, write); L(read, int r = global_p); if (r) {}; L(write, global_q = 1); return r; } // Have a ctrl dep that is redundant int bogus_ctrl_dep4() { XEDGE(read, write); L(read, int r = global_p); if (r || 1) { L(write, global_q = 1); } return r; }
Add another ctrl dep test that we get right!
Add another ctrl dep test that we get right!
C
mit
msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler
50dd6a56970747d566d2ce3eee4305e2e530a16d
src/bin/e_error.c
src/bin/e_error.c
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n" "%s\n", txt); } /* local subsystem functions */
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n%s\n", txt); } /* local subsystem functions */
Fix formatting. (Really ??? 3 lines for something that can fit on one ?)
E: Fix formatting. (Really ??? 3 lines for something that can fit on one ?) SVN revision: 61614
C
bsd-2-clause
tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment
b54503d351bf638969a5dd9e7113f8bc419ee24f
tmcd/decls.h
tmcd/decls.h
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2002 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14443 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the software cause problems. Starting with version 3, the client * will tell tmcd what version they are. If no version is included, * assume its DEFAULT_VERSION. * * Be sure to update the versions as the TMCD changes. Both the * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to * install new versions of each binary when the current version * changes. libsetup.pm module also encodes a current version, so be * sure to change it there too! * * Note, this is assumed to be an integer. No need for 3.23.479 ... * NB: See ron/libsetup.pm. That is version 4! I'll merge that in. */ #define DEFAULT_VERSION 2 #define CURRENT_VERSION 6
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2002 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14447 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the software cause problems. Starting with version 3, the client * will tell tmcd what version they are. If no version is included, * assume its DEFAULT_VERSION. * * Be sure to update the versions as the TMCD changes. Both the * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to * install new versions of each binary when the current version * changes. libsetup.pm module also encodes a current version, so be * sure to change it there too! * * Note, this is assumed to be an integer. No need for 3.23.479 ... * NB: See ron/libsetup.pm. That is version 4! I'll merge that in. */ #define DEFAULT_VERSION 2 #define CURRENT_VERSION 6
Change alternate port number; seemed to be taken already!
Change alternate port number; seemed to be taken already!
C
agpl-3.0
nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome
de7f24245a2b51af5ff3489d897ed490d8a0e776
BRScroller/BRScrollerUtilities.h
BRScroller/BRScrollerUtilities.h
// // BRScrollerUtilities.h // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #ifndef BRScroller_BRScrollerUtilities_h #define BRScroller_BRScrollerUtilities_h #include <CoreFoundation/CoreFoundation.h> #include <QuartzCore/QuartzCore.h> bool BRFloatsAreEqual(CGFloat a, CGFloat b); CGSize BRAspectSizeToFit(CGSize size, CGSize maxSize); #endif
// // BRScrollerUtilities.h // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #ifndef BRScroller_BRScrollerUtilities_h #define BRScroller_BRScrollerUtilities_h #include <CoreGraphics/CoreGraphics.h> bool BRFloatsAreEqual(CGFloat a, CGFloat b); CGSize BRAspectSizeToFit(CGSize size, CGSize maxSize); #endif
Fix import to what's actually needed.
Fix import to what's actually needed.
C
apache-2.0
Blue-Rocket/BRScroller,Blue-Rocket/BRScroller
4c22fc7c302ac0e6a26c7113bef5c6d23cc1625a
test/studies/filerator/direnthelp.h
test/studies/filerator/direnthelp.h
#include "dirent.h" typedef DIR* DIRptr; typedef struct dirent* direntptr; #define chpl_rt_direntptr_getname(x) ((x)->d_name) // // Note: This is not portable; more generally, need to use lstat() or similar; // see the readdir() man page for notes // #define chpl_rt_direntptr_isDir(x) ((x)->d_type == DT_DIR)
#include "dirent.h" typedef DIR* DIRptr; #ifndef __USE_FILE_OFFSET64 typedef struct dirent* direntptr; #else #ifdef __REDIRECT typedef struct dirent* direntptr; #else typedef struct dirent64* direntptr; #endif #endif #define chpl_rt_direntptr_getname(x) ((x)->d_name) // // Note: This is not portable; more generally, need to use lstat() or similar; // see the readdir() man page for notes // #define chpl_rt_direntptr_isDir(x) ((x)->d_type == DT_DIR)
Make the filerator test more portable
Make the filerator test more portable For some reason that I haven't been able to determine, the return type of readdir() is sometimes dirent64* rather than dirent* as all the man pages and documentation that I can find suggest. This happens with prgenv-pgi and prgenv-cray compilers for example. Here, I'm guarding our typedef of 'direntptr' for Chapel's use with a similar #ifndef structure as the /usr/lib/dirent.h file to make this test work on our current systems. This is likely be something that we need to understand and resolve better before putting a filerator into our standard libraries, though... :( git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@23824 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
C
apache-2.0
CoryMcCartan/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,hildeth/chapel,sungeunchoi/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,hildeth/chapel,hildeth/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel
d60caada8b9cad01a953981954856f26805674ec
include/llvm/TableGen/TableGenBackend.h
include/llvm/TableGen/TableGenBackend.h
//===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Useful utilities for TableGen backends. // //===----------------------------------------------------------------------===// #ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H #define LLVM_TABLEGEN_TABLEGENBACKEND_H #include "llvm/ADT/StringRef.h" namespace llvm { class raw_ostream; /// emitSourceFileHeader - Output an LLVM style file header to the specified /// raw_ostream. void emitSourceFileHeader(StringRef Desc, raw_ostream &OS); } // End llvm namespace #endif
//===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Useful utilities for TableGen backends. // //===----------------------------------------------------------------------===// #ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H #define LLVM_TABLEGEN_TABLEGENBACKEND_H namespace llvm { class StringRef; class raw_ostream; /// emitSourceFileHeader - Output an LLVM style file header to the specified /// raw_ostream. void emitSourceFileHeader(StringRef Desc, raw_ostream &OS); } // End llvm namespace #endif
Remove unnecessary include and just forward declare. NFC
[TableGen] Remove unnecessary include and just forward declare. NFC git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@238179 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap
351c01d249e0b93f4d2805f5b93d6cb52fae8894
UIKitExtensions/UIView/Framing.h
UIKitExtensions/UIView/Framing.h
// UIKitExtensions // // UIKitExtensions/UIView/Framing.h // // Copyright (c) 2013 Stanislaw Pankevich // Released under the MIT license // // Inspired by FrameAccessor // https://github.com/AlexDenisov/FrameAccessor/ #import <UIKit/UIKit.h> @interface UIView (Framing) @property CGPoint viewOrigin; @property CGSize viewSize; @property CGFloat x; @property CGFloat y; @property CGFloat height; @property CGFloat width; @property CGFloat centerX; @property CGFloat centerY; @end
// UIKitExtensions // // UIKitExtensions/UIView/Framing.h // // Copyright (c) 2013 Stanislaw Pankevich // Released under the MIT license // // Inspired by FrameAccessor // https://github.com/AlexDenisov/FrameAccessor/ #import <UIKit/UIKit.h> @interface UIView (Framing) // http://stackoverflow.com/questions/16118106/uitextview-strange-text-clipping // https://github.com/genericspecific/CKUITools/issues/8 @property CGPoint viewOrigin; @property CGSize viewSize; @property CGFloat x; @property CGFloat y; @property CGFloat height; @property CGFloat width; @property CGFloat centerX; @property CGFloat centerY; @end
Add links to original problem
Add links to original problem
C
mit
stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions
5422ab894dc9c35d94656d6879879e076fc9d0e0
hw/vpi/tenyr_vpi.h
hw/vpi/tenyr_vpi.h
#ifndef TENYR_VPI_ #define TENYR_VPI_ #include <vpi_user.h> struct tenyr_sim_state; typedef int tenyr_sim_cb(p_cb_data data); typedef int tenyr_sim_call(struct tenyr_sim_state *state, void *userdata); struct tenyr_sim_state { struct { tenyr_sim_call *genesis; ///< beginning of sim tenyr_sim_call *posedge; ///< rising edge of clock tenyr_sim_call *negedge; ///< falling edge of clock tenyr_sim_call *apocalypse; ///< end of sim } cb; struct { struct { vpiHandle genesis, apocalypse; } cb; struct { vpiHandle tenyr_load; vpiHandle tenyr_putchar; #if 0 // XXX this code is not tenyr-correct -- it can block vpiHandle tenyr_getchar; #endif } tf; } handle; void *extstate; ///< external state possibly used by tenyr_sim_cb's }; #endif
#ifndef TENYR_VPI_ #define TENYR_VPI_ #include <vpi_user.h> struct tenyr_sim_state; typedef int tenyr_sim_cb(p_cb_data data); typedef int tenyr_sim_call(struct tenyr_sim_state *state, void *userdata); struct tenyr_sim_state { struct { tenyr_sim_call *genesis; ///< beginning of sim tenyr_sim_call *posedge; ///< rising edge of clock tenyr_sim_call *negedge; ///< falling edge of clock tenyr_sim_call *apocalypse; ///< end of sim } cb; struct { struct { vpiHandle genesis, apocalypse; } cb; struct { vpiHandle tenyr_load; vpiHandle tenyr_putchar; #if 0 // XXX this code is not tenyr-correct -- it can block vpiHandle tenyr_getchar; #endif } tf; } handle; void *extstate; ///< external state possibly used by tenyr_sim_cb's }; #endif
Mend incorrect whitespace from 3103a58
Mend incorrect whitespace from 3103a58
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
7d6b667ae70747e9f111eedb98f66fca20c9f43e
value.h
value.h
#pragma once #include <stdio.h> #ifdef __cplusplus extern "C" { #endif enum Turbo_Type {TJ_Error, TJ_String, TJ_Number, TJ_Object, TJ_Array, TJ_Boolean, TJ_Null}; struct Turbo_Value{ enum Turbo_Type type; unsigned length; union{ double number; int boolean; const char *string; struct Turbo_Value *array; struct Turbo_Property *object; struct Turbo_Error *error; } value; }; const char *Turbo_Value(struct Turbo_Value * __restrict__ to, const char *in, const char *const end); void Turbo_WriteValue(struct Turbo_Value *that, FILE *out, int level); #ifdef __cplusplus } #endif
#pragma once #include <stdio.h> #ifdef _MSC_VER #define __restrict__ __restrict #elif defined __WATCOMC__ #define __restrict__ #endif #ifdef __cplusplus extern "C" { #endif enum Turbo_Type {TJ_Error, TJ_String, TJ_Number, TJ_Object, TJ_Array, TJ_Boolean, TJ_Null}; struct Turbo_Value{ enum Turbo_Type type; unsigned length; union{ double number; int boolean; const char *string; struct Turbo_Value *array; struct Turbo_Property *object; struct Turbo_Error *error; } value; }; const char *Turbo_Value(struct Turbo_Value * __restrict__ to, const char *in, const char *const end); void Turbo_WriteValue(struct Turbo_Value *that, FILE *out, int level); #ifdef __cplusplus } #endif
Handle restrict on Windows compilers
Handle restrict on Windows compilers
C
bsd-3-clause
FlyingJester/TurboJSON,FlyingJester/TurboJSON,FlyingJester/TurboJSON
7e3f73b484dce568b5cee7f4e3209181efdf5cc7
ppapi/tests/arch_dependent_sizes_64.h
ppapi/tests/arch_dependent_sizes_64.h
/* Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * * This file has compile assertions for the sizes of types that are dependent * on the architecture for which they are compiled (i.e., 32-bit vs 64-bit). */ #ifndef PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ #define PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ #include "ppapi/tests/test_struct_sizes.c" PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLintptr, 8); PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLsizeiptr, 8); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CompletionCallback_Func, 8); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLLoaderTrusted_StatusCallback, 8); PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_CompletionCallback, 24); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_VideoDecoder_Dev, 64); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPP_VideoDecoder_Dev, 32); #endif /* PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ */
/* Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * * This file has compile assertions for the sizes of types that are dependent * on the architecture for which they are compiled (i.e., 32-bit vs 64-bit). */ #ifndef PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ #define PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ #include "ppapi/tests/test_struct_sizes.c" // TODO(jschuh): Resolve ILP64 to LLP64 issue. crbug.com/177779 #if !defined(_WIN64) PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLintptr, 8); PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLsizeiptr, 8); #endif PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CompletionCallback_Func, 8); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLLoaderTrusted_StatusCallback, 8); PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_CompletionCallback, 24); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_VideoDecoder_Dev, 64); PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPP_VideoDecoder_Dev, 32); #endif /* PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ */
Disable GL sizes PPAPI tests
Disable GL sizes PPAPI tests The wrong size is defined for Win64. It needs a real fix, but first I need to unblock the builder. BUG=177779 Review URL: https://chromiumcodereview.appspot.com/12310080 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@184296 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
markYoungH/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Jonekee/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,timopulkkinen/BubbleFish,ondra-novak/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,jaruba/chromium.src,anirudhSK/chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,ChromiumWebApps/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,Chilledheart/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,hujiajie/pa-chromium,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,anirudhSK/chromium,jaruba/chromium.src,Jonekee/chromium.src,dednal/chromium.src,anirudhSK/chromium,jaruba/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,anirudhSK/chromium,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,littlstar/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,jaruba/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Jonekee/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Just-D/chromium-1,jaruba/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,patrickm/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,dednal/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,patrickm/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,zcbenz/cefode-chromium,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,hujiajie/pa-chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,markYoungH/chromium.src,littlstar/chromium.src,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,Just-D/chromium-1,ltilve/chromium,dushu1203/chromium.src,hujiajie/pa-chromium,Just-D/chromium-1,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,patrickm/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src
4c54e21bfaf52047e4d0790623197df84a7410e4
src/sys/utsname.c
src/sys/utsname.c
/* $Id$ */ /* Copyright (c) 2006 The DeforaOS Project */ #include "../syscalls.h" #include "sys/utsname.h" /* uname */ #ifndef __NetBSD__ syscall1(int, uname, struct utsname *, utsname); #endif
/* $Id$ */ /* Copyright (c) 2007 The DeforaOS Project */ #include "../syscalls.h" #include "sys/utsname.h" /* uname */ #if !defined(__NetBSD__) || defined(NETBSD_USE_LINUX_EMULATION) syscall1(int, uname, struct utsname *, utsname); #endif
Allow uname() with linux emulation on NetBSD
Allow uname() with linux emulation on NetBSD
C
bsd-2-clause
DeforaOS/libc,DeforaOS/libc
3e23ab61c6fe1bfd219f94bae2857985ef50da69
Pod/Classes/CMHLoginViewController.h
Pod/Classes/CMHLoginViewController.h
#import <ResearchKit/ResearchKit.h> @class CMHLoginViewController; @protocol CMHLoginViewControllerDelegate <NSObject> @optional - (void)loginViewControllerCancelled:(CMHLoginViewController *_Nonnull)viewController; - (void)loginViewController:(CMHLoginViewController *_Nonnull)viewController didLogin:(BOOL)success error:(NSError *_Nullable)error; @end @interface CMHLoginViewController : ORKTaskViewController - (_Nonnull instancetype)initWithTitle:(NSString *_Nullable)title text:(NSString *_Nullable)text delegate:(id<CMHLoginViewControllerDelegate>)delegate; @property (weak, nonatomic, nullable) id<CMHLoginViewControllerDelegate> loginDelegate; - (instancetype)initWithTask:(nullable id<ORKTask>)task taskRunUUID:(nullable NSUUID *)taskRunUUID NS_UNAVAILABLE; - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE; - (instancetype)initWithTask:(nullable id<ORKTask>)task restorationData:(nullable NSData *)data delegate:(nullable id<ORKTaskViewControllerDelegate>)delegate NS_UNAVAILABLE; @end
#import <ResearchKit/ResearchKit.h> @class CMHLoginViewController; @protocol CMHLoginViewControllerDelegate <NSObject> @optional - (void)loginViewControllerCancelled:(CMHLoginViewController *_Nonnull)viewController; - (void)loginViewController:(CMHLoginViewController *_Nonnull)viewController didLogin:(BOOL)success error:(NSError *_Nullable)error; @end @interface CMHLoginViewController : ORKTaskViewController - (_Nonnull instancetype)initWithTitle:(NSString *_Nullable)title text:(NSString *_Nullable)text delegate:(_Nullable id<CMHLoginViewControllerDelegate>)delegate; @property (weak, nonatomic, nullable) id<CMHLoginViewControllerDelegate> loginDelegate; - (_Null_unspecified instancetype)initWithTask:(nullable id<ORKTask>)task taskRunUUID:(nullable NSUUID *)taskRunUUID NS_UNAVAILABLE; - (_Null_unspecified instancetype)initWithCoder:(NSCoder *_Null_unspecified)aDecoder NS_UNAVAILABLE; - (_Null_unspecified instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE; - (_Null_unspecified instancetype)initWithTask:(nullable id<ORKTask>)task restorationData:(nullable NSData *)data delegate:(nullable id<ORKTaskViewControllerDelegate>)delegate NS_UNAVAILABLE; @end
Add nullability annotations to the custom login view controller's public interface
Add nullability annotations to the custom login view controller's public interface
C
mit
cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK
5cc6bfb2caca2ecd95d4e152d70fc6c261cd31e1
ionCore/ionStandardLibrary.h
ionCore/ionStandardLibrary.h
#pragma once #include "ionTypes.h" #include <algorithm> #include <numeric> #include <iomanip> #include <iostream> #include <fstream> #include <sstream> using std::move; using std::ifstream; template <typename T, typename U> U * ConditionalMapAccess(map<T, U *> & Map, T const Key) { auto Iterator = Map.find(Key); if (Iterator != Map.end()) return Iterator->second; return 0; } class File { public: static bool Exists(string const & FileName) { ifstream ifile(FileName); return ifile.good(); } static string && ReadAsString(string const & FileName) { std::ifstream t(FileName); std::string str; t.seekg(0, std::ios::end); str.reserve((uint) t.tellg()); t.seekg(0, std::ios::beg); str.assign((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>()); return move(str); } };
#pragma once #include "ionTypes.h" #include <algorithm> #include <numeric> #include <iomanip> #include <iostream> #include <fstream> #include <sstream> using std::move; using std::ifstream; template <typename T, typename U> U * ConditionalMapAccess(map<T, U *> & Map, T const Key) { auto Iterator = Map.find(Key); if (Iterator != Map.end()) return Iterator->second; return 0; } class File { public: static bool Exists(string const & FileName) { ifstream ifile(FileName); return ifile.good(); } static string ReadAsString(string const & FileName) { std::ifstream t(FileName); std::string str; t.seekg(0, std::ios::end); str.reserve((uint) t.tellg()); t.seekg(0, std::ios::beg); str.assign((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>()); return str; } };
Fix inappropriate move in ReadAsString
Fix inappropriate move in ReadAsString --HG-- branch : SceneOverhaul
C
mit
iondune/ionEngine,iondune/ionEngine
1f62a70bbf4f45f26c04145a5ad25e90b578db9b
lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h
lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- // NOTE: If there is a merge conflict the correct fix is to make a new GUID. // This file was generated with tools\update_bytecode_version.ps1 // {81AEEA4B-AE4E-40C0-848F-6DB7C5F49F55} const GUID byteCodeCacheReleaseFileVersion = { 0x81AEEA4B, 0xAE4E, 0x40C0, { 0x84, 0x8F, 0x6D, 0xB7, 0xC5, 0xF4, 0x9F, 0x55 } };
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- // NOTE: If there is a merge conflict the correct fix is to make a new GUID. // This file was generated with tools\update_bytecode_version.ps1 // {2C341884-72E5-4799-923C-DB8EDAFEEA89} const GUID byteCodeCacheReleaseFileVersion = { 0x2C341884, 0x72E5, 0x4799, { 0x92, 0x3C, 0xDB, 0x8E, 0xDA, 0xFE, 0xEA, 0x89 } };
Update byte code ID for InitConst change
Update byte code ID for InitConst change
C
mit
Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore
b3fbc27c7a4130904f3cae41eb161832304b6b9d
src/condor_syscall_lib/syscall_mode.c
src/condor_syscall_lib/syscall_mode.c
/******************************************************************* ** ** Manage system call mode and do remote system calls. ** *******************************************************************/ #define _POSIX_SOURCE #include <stdio.h> #include "condor_syscall_mode.h" static int SyscallMode = 1; /* LOCAL and UNMAPPED */ int SetSyscalls( int mode ) { int answer; answer = SyscallMode; SyscallMode = mode; return answer; } BOOL LocalSysCalls() { return SyscallMode & SYS_LOCAL; } BOOL RemoteSysCalls() { return (SyscallMode & SYS_LOCAL) == 0; } BOOL MappingFileDescriptors() { return (SyscallMode & SYS_MAPPED); } #if defined(AIX32) /* Just to test linking */ int syscall( int num, ... ) { return 0; } #endif
/******************************************************************* ** ** Manage system call mode and do remote system calls. ** *******************************************************************/ #define _POSIX_SOURCE #include "condor_common.h" #include "condor_debug.h" #include "condor_syscall_mode.h" static int SyscallMode = 1; /* LOCAL and UNMAPPED */ int SetSyscalls( int mode ) { int answer; answer = SyscallMode; SyscallMode = mode; return answer; } BOOL LocalSysCalls() { return SyscallMode & SYS_LOCAL; } BOOL RemoteSysCalls() { return (SyscallMode & SYS_LOCAL) == 0; } BOOL MappingFileDescriptors() { return (SyscallMode & SYS_MAPPED); } void DisplaySyscallMode() { dprintf( D_ALWAYS, "Syscall Mode is: %s %s\n", RemoteSysCalls() ? "REMOTE" : "LOCAL", MappingFileDescriptors() ? "MAPPED" : "UNMAPPED" ); } #if defined(AIX32) /* Just to test linking */ int syscall( int num, ... ) { return 0; } #endif
Add DisplaySyscallMode() routine for debugging.
Add DisplaySyscallMode() routine for debugging.
C
apache-2.0
zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco
d9041156f999342aab312dfb7ea6dfc21f7cbd08
SWXMLDateMapping.h
SWXMLDateMapping.h
// // SWXMLDateMapping.h // This file is part of the "SWXMLMapping" project, and is distributed under the MIT License. // // Created by Samuel Williams on 13/11/05. // Copyright 2005 Samuel Williams. All rights reserved. // #import "SWXMLMemberMapping.h" @class SWXMLMemberMapping; @interface SWXMLDateMapping : SWXMLMemberMapping { } @end
// // SWXMLDateMapping.h // This file is part of the "SWXMLMapping" project, and is distributed under the MIT License. // // Created by Samuel Williams on 13/11/05. // Copyright 2005 Samuel Williams. All rights reserved. // #import "SWXMLMemberMapping.h" @class SWXMLMemberMapping; // Formats value attribute according to ISO8601 (http://www.w3.org/TR/NOTE-datetime) @interface SWXMLDateMapping : SWXMLMemberMapping { } @end
Comment regarding value serialization of date.
Comment regarding value serialization of date.
C
mit
oriontransfer/SWXMLMapping
44ff99d3d8e9bb89f9084fc0d6586f1a7f0e1277
ann.c
ann.c
#include <stdio.h> #define INPUTS 3 #define HIDDEN 5 #define OUTPUTS 2 #define ROWS 5 typedef struct { double input[HIDDEN][INPUTS]; double hidden[ROWS - 3][HIDDEN][HIDDEN]; double output[OUTPUTS][HIDDEN]; } Links; typedef struct { Links weights; } ANN; int main(void) { return 0; }
#include <stdio.h> #define INPUTS 3 #define HIDDEN 5 #define OUTPUTS 2 #define ROWS 5 typedef struct { double input[HIDDEN][INPUTS]; double hidden[ROWS - 3][HIDDEN][HIDDEN]; double output[OUTPUTS][HIDDEN]; } Links; typedef struct { int input[INPUTS]; int hidden[HIDDEN]; int output[OUTPUTS]; } Neurons; typedef struct { Links weights; Neurons values; } ANN; int main(void) { return 0; }
Allow neuron values (outputs) to be stored
Allow neuron values (outputs) to be stored
C
mit
tysonzero/c-ann
a998d0fcb5626b90c4b2cc92a25982b5407eba03
free.h
free.h
/* * free.h * Memory usage utility for Darwin & MacOS X (similar to 'free' under Linux) * * by: David Cantrell <david.l.cantrell@gmail.com> * Copyright (C) 2008, David Cantrell, Honolulu, HI, USA. * * Licensed under the GNU Lesser General Public License version 2.1 or later. * See COPYING.LIB for licensing details. */ #define FREE_USAGE "Usage: %s [-b|-k|-m] [-s delay] [-V] [-h|-?]\n" #define COMBINED_UNIT_OPTIONS "You may only use one of the unit options: -b, -k, or -m\n" enum { BYTES, KILOBYTES, MEGABYTES }; typedef struct mem { uint64_t total; uint64_t used; uint64_t free; uint64_t active; uint64_t inactive; uint64_t wired; } mem_t;
/* * free.h * Memory usage utility for Darwin & MacOS X (similar to 'free' under Linux) * * by: David Cantrell <david.l.cantrell@gmail.com> * Copyright (C) 2008, David Cantrell, Honolulu, HI, USA. * * Licensed under the GNU Lesser General Public License version 2.1 or later. * See COPYING.LIB for licensing details. */ #define FREE_USAGE "Usage: %s [-b|-k|-m] [-s delay] [-V] [-h|-?]\n" #define COMBINED_UNIT_OPTIONS "You may only use one of the unit options: -b, -k, or -m\n" enum { UNUSED_UNIT, BYTES, KILOBYTES, MEGABYTES }; typedef struct mem { uint64_t total; uint64_t used; uint64_t free; uint64_t active; uint64_t inactive; uint64_t wired; } mem_t;
Make sure used unit constants are non-zero
Make sure used unit constants are non-zero
C
lgpl-2.1
dcantrell/darwin-free
47bf9fbde1fffc46171cdf225dbd685a5e0a7526
gtksourceview2.h
gtksourceview2.h
#include "gtk2hs_macros.h" #include <gtksourceview/gtksourcebuffer.h> #if GTK_MAJOR_VERSION < 3 #include <gtksourceview/gtksourceiter.h> #endif #include <gtksourceview/gtksourcelanguage.h> #include <gtksourceview/gtksourcelanguagemanager.h> #include <gtksourceview/gtksourcestyle.h> #include <gtksourceview/gtksourcestylescheme.h> #include <gtksourceview/gtksourcestyleschememanager.h> #include <gtksourceview/gtksourceview.h> #include <gtksourceview/gtksourceview-typebuiltins.h> #include <gtksourceview/gtksourceundomanager.h> #include <gtksourceview/gtksourcecompletionitem.h> #include <gtksourceview/gtksourcegutter.h> #include <gtksourceview/gtksourcecompletionprovider.h> #include <gtksourceview/gtksourcecompletionproposal.h> #include <gtksourceview/gtksourcemark.h> #include <gtksourceview/gtksourcecompletioninfo.h>
#ifdef __BLOCKS__ #undef __BLOCKS__ #endif #include "gtk2hs_macros.h" #include <gtksourceview/gtksourcebuffer.h> #if GTK_MAJOR_VERSION < 3 #include <gtksourceview/gtksourceiter.h> #endif #include <gtksourceview/gtksourcelanguage.h> #include <gtksourceview/gtksourcelanguagemanager.h> #include <gtksourceview/gtksourcestyle.h> #include <gtksourceview/gtksourcestylescheme.h> #include <gtksourceview/gtksourcestyleschememanager.h> #include <gtksourceview/gtksourceview.h> #include <gtksourceview/gtksourceview-typebuiltins.h> #include <gtksourceview/gtksourceundomanager.h> #include <gtksourceview/gtksourcecompletionitem.h> #include <gtksourceview/gtksourcegutter.h> #include <gtksourceview/gtksourcecompletionprovider.h> #include <gtksourceview/gtksourcecompletionproposal.h> #include <gtksourceview/gtksourcemark.h> #include <gtksourceview/gtksourcecompletioninfo.h>
Fix CPP issue on OS X
Fix CPP issue on OS X
C
lgpl-2.1
gtk2hs/gtksourceview,gtk2hs/gtksourceview
504d69fb848c13a69d7747f85f541b3ac3cf8019
UIforETW/Version.h
UIforETW/Version.h
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.47f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.48f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
Increase version to 1.48 in preparation for new release
Increase version to 1.48 in preparation for new release
C
apache-2.0
ariccio/UIforETW,google/UIforETW,mwinterb/UIforETW,google/UIforETW,google/UIforETW,mwinterb/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,mwinterb/UIforETW,google/UIforETW
ce2df60e506865768215d05489c5a52cbb6febcb
Classes/JLNRGravityImageView.h
Classes/JLNRGravityImageView.h
// // JLNRGravityImageView.h // JLNRGravityImageViewExample // // Created by Julian Raschke on 17.02.15. // Copyright (c) 2015 Julian Raschke. All rights reserved. // #import <UIKit/UIKit.h> IB_DESIGNABLE @interface JLNRGravityImageView : UIImageView @property (nonatomic) IBInspectable BOOL alignTop; @property (nonatomic) IBInspectable BOOL alignBottom; @property (nonatomic) IBInspectable BOOL alignLeft; @property (nonatomic) IBInspectable BOOL alignRight; @end
// // JLNRGravityImageView.h // JLNRGravityImageViewExample // // Created by Julian Raschke on 17.02.15. // Copyright (c) 2015 Julian Raschke. All rights reserved. // #import <UIKit/UIKit.h> // IB_DESIGNABLE does not work by default with CocoaPods: // https://github.com/CocoaPods/CocoaPods/issues/2792 #ifndef COCOAPODS IB_DESIGNABLE #endif @interface JLNRGravityImageView : UIImageView @property (nonatomic) IBInspectable BOOL alignTop; @property (nonatomic) IBInspectable BOOL alignBottom; @property (nonatomic) IBInspectable BOOL alignLeft; @property (nonatomic) IBInspectable BOOL alignRight; @end
Disable IB_DESIGNABLE when using CocoaPods
Disable IB_DESIGNABLE when using CocoaPods
C
mit
jlnr/JLNRGravityImageView,lurado/LDOAlignedImageView
526b09b014c8219cfe3747170c6021fe92fb65d5
firmware/lm32/config.h
firmware/lm32/config.h
#ifndef __CONFIG_H #define __CONFIG_H enum { CONFIG_KEY_RESOLUTION = 0, CONFIG_KEY_BLEND_USER1, CONFIG_KEY_BLEND_USER2, CONFIG_KEY_BLEND_USER3, CONFIG_KEY_BLEND_USER4, CONFIG_KEY_COUNT }; #define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 } void config_init(void); void config_write_all(void); unsigned char config_get(unsigned char key); void config_set(unsigned char key, unsigned char value); #endif /* __CONFIG_H */
#ifndef __CONFIG_H #define __CONFIG_H enum { CONFIG_KEY_RESOLUTION = 0, CONFIG_KEY_BLEND_USER1, CONFIG_KEY_BLEND_USER2, CONFIG_KEY_BLEND_USER3, CONFIG_KEY_BLEND_USER4, CONFIG_KEY_COUNT }; #ifdef BOARD_MINISPARTAN6 #define CONFIG_DEFAULTS { 5, 1, 2, 3, 4 } #else #define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 } #endif void config_init(void); void config_write_all(void); unsigned char config_get(unsigned char key); void config_set(unsigned char key, unsigned char value); #endif /* __CONFIG_H */
Make 800x600 the default mode for the minispartan6+
firmware/lm32: Make 800x600 the default mode for the minispartan6+
C
bsd-2-clause
mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware
9603de4489d4fb7b057e55402080544db0d75d99
src/lang-dutch.c
src/lang-dutch.c
#include "num2words.h" // Language strings for Dutch const Language LANG_DUTCH = { .hours = { "een", "twee", "drie", "vier", "vijf", "zes", "zeven", "acht", "negen", "tien", "elf", "twaalf" }, .phrases = { "*$1 uur ", "vijf over *$1 ", "tien over *$1 ", "kwart over *$1 ", "tien voor half *$2 ", "vijf voor half *$2 ", "half *$2 ", "vijf over half *$2 ", "tien over half *$2 ", "kwart voor *$2 ", "tien voor *$2 ", "vijf voor *$2 " }, #ifdef PBL_PLATFORM_CHALK .greetings = { "Goede- morgen ", "Goede- middag ", "Goede- avond ", "Goede- nacht " }, #else .greetings = { "Goede- mor- gen ", "Goede- middag ", "Goede- avond ", "Goede- nacht " }, #endif .connection_lost = "Waar is je tele- foon? " };
#include "num2words.h" // Language strings for Dutch const Language LANG_DUTCH = { .hours = { "een", "twee", "drie", "vier", "vijf", "zes", "zeven", "acht", "negen", "tien", "elf", "twaalf" }, .phrases = { "*$1 uur ", "vijf over *$1 ", "tien over *$1 ", "kwart over *$1 ", "tien voor half *$2 ", "vijf voor half *$2 ", "half *$2 ", "vijf over half *$2 ", "tien over half *$2 ", "kwart voor *$2 ", "tien voor *$2 ", "vijf voor *$2 " }, #ifdef PBL_PLATFORM_CHALK .greetings = { "Goede morgen ", "Goede middag ", "Goede avond ", "Goede nacht " }, #else .greetings = { "Goede mor- gen ", "Goede middag ", "Goede avond ", "Goede nacht " }, #endif .connection_lost = "Waar is je tele- foon? " };
Remove hyphens from dutch greetings as per recommendation from @eddyh
Remove hyphens from dutch greetings as per recommendation from @eddyh
C
mit
Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Fuzzy-Text-Watch-Plus
d496a2cb613d41095a25d1f8a8cf73fac2dd55b3
ouzel/Settings.h
ouzel/Settings.h
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include "CompileConfig.h" namespace ouzel { struct Settings { video::Renderer::Driver driver = #if defined(OUZEL_PLATFORM_OSX) || defined(OUZEL_PLATFORM_IOS) || defined(OUZEL_PLATFORM_TVOS) || defined(OUZEL_PLATFORM_ANDROID) || defined(OUZEL_PLATFORM_LINUX) video::Renderer::Driver::OPENGL; #elif defined(SUPPORTS_DIRECT3D11) video::Renderer::Driver::DIRECT3D11; #endif Size2 size; bool resizable = false; bool fullscreen = false; float targetFPS = 60.0f; std::string title = "ouzel"; }; }
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include "CompileConfig.h" namespace ouzel { struct Settings { video::Renderer::Driver driver = #if defined(OUZEL_PLATFORM_OSX) || defined(OUZEL_PLATFORM_IOS) || defined(OUZEL_PLATFORM_TVOS) || defined(OUZEL_PLATFORM_ANDROID) || defined(OUZEL_PLATFORM_LINUX) video::Renderer::Driver::OPENGL; #elif defined(SUPPORTS_DIRECT3D11) video::Renderer::Driver::DIRECT3D11; #endif Size2 size; uint32_t sampleCount = 1; // MSAA sample count bool resizable = false; bool fullscreen = false; float targetFPS = 60.0f; std::string title = "ouzel"; }; }
Add setting for MSAA sample count
Add setting for MSAA sample count
C
unlicense
elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elvman/ouzel
c03ade8e87b3848bbb1d30d6e8a09633fbe22a7c
thcrap/src/log.h
thcrap/src/log.h
/** * Touhou Community Reliant Automatic Patcher * Main DLL * * ---- * * Logging functions. * Log to both a file and, if requested, an on-screen console. * * As of now, we do not enforce char strings to be in UTF-8. */ #pragma once /// --------------- /// Standard output /// --------------- // Basic void log_print(const char *text); // Specific length void log_nprint(const char *text, size_t n); // Formatted void log_vprintf(const char *text, va_list va); void log_printf(const char *text, ...); #define log_func_printf(text, ...) \ log_printf("["__FUNCTION__"]: "##text, __VA_ARGS__) /// --------------- /// ------------- /// Message boxes // Technically not a "logging function", but hey, it has variable arguments. /// ------------- // Basic int log_mbox(const char *caption, const UINT type, const char *text); // Formatted int log_vmboxf(const char *caption, const UINT type, const char *text, va_list va); int log_mboxf(const char *caption, const UINT type, const char *text, ...); /// ------------- void log_init(int console); void log_exit(void);
/** * Touhou Community Reliant Automatic Patcher * Main DLL * * ---- * * Logging functions. * Log to both a file and, if requested, an on-screen console. * * As of now, we do not enforce char strings to be in UTF-8. */ #pragma once /// --------------- /// Standard output /// --------------- // Basic void log_print(const char *text); // Specific length void log_nprint(const char *text, size_t n); // Formatted void log_vprintf(const char *text, va_list va); void log_printf(const char *text, ...); #ifdef _MSC_VER # define log_func_printf(text, ...) \ log_printf("["__FUNCTION__"]: "text, __VA_ARGS__) #else # define log_func_printf(text, ...) \ log_printf("[%s]: "text, __func__, ##__VA_ARGS__) #endif /// --------------- /// ------------- /// Message boxes // Technically not a "logging function", but hey, it has variable arguments. /// ------------- // Basic int log_mbox(const char *caption, const UINT type, const char *text); // Formatted int log_vmboxf(const char *caption, const UINT type, const char *text, va_list va); int log_mboxf(const char *caption, const UINT type, const char *text, ...); /// ------------- void log_init(int console); void log_exit(void);
Use C99 __func__ instead of __FUNCTION__ when not compiling with Visual C++.
Use C99 __func__ instead of __FUNCTION__ when not compiling with Visual C++. Couldn't they standardize __FUNCTION__ instead? A string literal that can be concatenated with other string literals is much more flexible than a char[] variable.
C
unlicense
thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap
c3a6cadc3df8702f1f195f6cda53f023dfe7e6ae
robot_module.h
robot_module.h
/* * File: robots.h * Author: m79lol * */ #ifndef ROBOT_MODULE_H #define ROBOT_MODULE_H #define ROBOT_COMMAND_FREE 0 #define ROBOT_COMMAND_HAND_CONTROL_BEGIN -1 #define ROBOT_COMMAND_HAND_CONTROL_END -2 class Robot { protected: Robot() {} public: virtual FunctionResult* executeFunction(regval command_index, regval *args) = 0; virtual void axisControl(regval axis_index, regval value) = 0; virtual ~Robot() {} }; class RobotModule { protected: RobotModule() {} public: virtual const char *getUID() = 0; virtual int init() = 0; virtual FunctionData** getFunctions(int *count_functions) = 0; virtual AxisData** getAxis(int *count_axis) = 0; virtual Robot* robotRequire() = 0; virtual void robotFree(Robot *robot) = 0; virtual void final() = 0; virtual void destroy() = 0; virtual ~RobotModule() {} }; typedef RobotModule* (*getRobotModuleObject_t)(); extern "C" { __declspec(dllexport) RobotModule* getRobotModuleObject(); } #endif /* ROBOT_MODULE_H */
/* * File: robots.h * Author: m79lol * */ #ifndef ROBOT_MODULE_H #define ROBOT_MODULE_H #define ROBOT_COMMAND_FREE 0 #define ROBOT_COMMAND_HAND_CONTROL_BEGIN -1 #define ROBOT_COMMAND_HAND_CONTROL_END -2 typedef std::function<void(unsigned short int, const char*, va_list)> t_printf_color_module; class Robot { protected: Robot() {} public: virtual FunctionResult* executeFunction(regval command_index, regval *args) = 0; virtual void axisControl(regval axis_index, regval value) = 0; virtual ~Robot() {} }; class RobotModule { protected: RobotModule() {} public: virtual const char *getUID() = 0; virtual void prepare(t_printf_color_module f_printf) = 0; virtual int init() = 0; virtual FunctionData** getFunctions(int *count_functions) = 0; virtual AxisData** getAxis(int *count_axis) = 0; virtual Robot* robotRequire() = 0; virtual void robotFree(Robot *robot) = 0; virtual void final() = 0; virtual void destroy() = 0; virtual ~RobotModule() {} }; typedef RobotModule* (*getRobotModuleObject_t)(); extern "C" { __declspec(dllexport) RobotModule* getRobotModuleObject(); } #endif /* ROBOT_MODULE_H */
Prepare function added for Robot modules.
Prepare function added for Robot modules.
C
apache-2.0
RobotControlTechnologies/module_headers,iskinmike/module_headers
accec546d710228b9b2a5cc84557cde6624d7a89
include/tiramisu/MainPage.h
include/tiramisu/MainPage.h
/** \file * This file only exists to contain the front-page of the documentation */ /** \mainpage Documentation of the API if the Tiramisu Compiler * * Tiramisu provides few classes to enable users to represent their program: * - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C. * - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar. * - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function. * - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain. * - The \ref tiramisu::buffer class: a class to represent memory buffers. * */
/** \file * This file only exists to contain the front-page of the documentation */ /** \mainpage Documentation of the API if the Tiramisu Compiler * * Tiramisu provides few classes to enable users to represent their program: * - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C. * - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar. * - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function. * - The \ref tiramisu::var class: used to represent loop iterators. Usually we declare a var (a loop iterator) and then use it for the declaration of computations. The range of that variable defines the loop range. When use witha buffer it defines the buffer size and when used with an input it defines the input size. * - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain. * - The \ref tiramisu::buffer class: a class to represent memory buffers. */
Fix the documentation main page
Fix the documentation main page
C
mit
rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/ISIR,rbaghdadi/ISIR,rbaghdadi/COLi
edee7c36a226e74f53d66b57a1907bb148799599
targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.c
targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.c
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cmsis_nvic.h" void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { //static volatile uint32_t *vectors = (uint32_t *) NVIC_RAM_VECTOR_ADDRESS; // Put the vectors in SRAM //vectors[IRQn + 16] = vector; } uint32_t NVIC_GetVector(IRQn_Type IRQn) { uint32_t *vectors = (uint32_t*) NVIC_FLASH_VECTOR_ADDRESS; // Return the vector return vectors[IRQn + 16]; }
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cmsis_nvic.h" #include "platform/mbed_error.h" void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { // NOTE: On NANO130, relocating vector table is not supported due to just 16KB small SRAM. // Add guard code to prevent from unsupported relocating. uint32_t vector_static = NVIC_GetVector(IRQn); if (vector_static != vector) { error("No support for relocating vector table"); } } uint32_t NVIC_GetVector(IRQn_Type IRQn) { uint32_t *vectors = (uint32_t*) NVIC_FLASH_VECTOR_ADDRESS; // Return the vector return vectors[IRQn + 16]; }
Add guard code to prevent from relocating vector table
[NANO130] Add guard code to prevent from relocating vector table
C
apache-2.0
kjbracey-arm/mbed,svogl/mbed-os,karsev/mbed-os,ryankurte/mbed-os,svogl/mbed-os,CalSol/mbed,infinnovation/mbed-os,karsev/mbed-os,betzw/mbed-os,betzw/mbed-os,catiedev/mbed-os,HeadsUpDisplayInc/mbed,andcor02/mbed-os,c1728p9/mbed-os,ryankurte/mbed-os,catiedev/mbed-os,svogl/mbed-os,ryankurte/mbed-os,mbedmicro/mbed,catiedev/mbed-os,nRFMesh/mbed-os,andcor02/mbed-os,karsev/mbed-os,mbedmicro/mbed,catiedev/mbed-os,CalSol/mbed,nRFMesh/mbed-os,nRFMesh/mbed-os,CalSol/mbed,HeadsUpDisplayInc/mbed,kjbracey-arm/mbed,betzw/mbed-os,c1728p9/mbed-os,CalSol/mbed,CalSol/mbed,c1728p9/mbed-os,infinnovation/mbed-os,YarivCol/mbed-os,svogl/mbed-os,ryankurte/mbed-os,Archcady/mbed-os,mbedmicro/mbed,Archcady/mbed-os,nRFMesh/mbed-os,YarivCol/mbed-os,YarivCol/mbed-os,mazimkhan/mbed-os,catiedev/mbed-os,c1728p9/mbed-os,karsev/mbed-os,svogl/mbed-os,infinnovation/mbed-os,mazimkhan/mbed-os,nRFMesh/mbed-os,HeadsUpDisplayInc/mbed,infinnovation/mbed-os,infinnovation/mbed-os,Archcady/mbed-os,HeadsUpDisplayInc/mbed,mbedmicro/mbed,YarivCol/mbed-os,andcor02/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,mazimkhan/mbed-os,mazimkhan/mbed-os,YarivCol/mbed-os,Archcady/mbed-os,betzw/mbed-os,Archcady/mbed-os,andcor02/mbed-os,HeadsUpDisplayInc/mbed,catiedev/mbed-os,svogl/mbed-os,mbedmicro/mbed,mazimkhan/mbed-os,YarivCol/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,HeadsUpDisplayInc/mbed,Archcady/mbed-os,ryankurte/mbed-os,c1728p9/mbed-os,mazimkhan/mbed-os,andcor02/mbed-os,karsev/mbed-os,ryankurte/mbed-os,betzw/mbed-os,c1728p9/mbed-os,karsev/mbed-os,nRFMesh/mbed-os,CalSol/mbed,infinnovation/mbed-os
a394a676b804449c2c939a26ee394a025f7c325c
src/cpu/register.h
src/cpu/register.h
#ifndef EMULATOR_REGISTER_H #define EMULATOR_REGISTER_H #include <cstdint> template <typename T> class Register { public: Register() {}; void set(const T new_value) { val = new_value; }; T value() const { return val; }; void increment() { val += 1; }; void decrement() { val -= 1; }; private: T val; }; typedef Register<uint8_t> ByteRegister; typedef Register<uint16_t> WordRegister; class RegisterPair { public: RegisterPair(ByteRegister& low, ByteRegister& high); void set_low(const uint8_t byte); void set_high(const uint8_t byte); void set_low(const ByteRegister& byte); void set_high(const ByteRegister& byte); void set(const uint16_t word); uint8_t low() const; uint8_t high() const; uint16_t value() const; void increment(); void decrement(); private: ByteRegister& low_byte; ByteRegister& high_byte; }; #endif
#ifndef EMULATOR_REGISTER_H #define EMULATOR_REGISTER_H #include <cstdint> template <typename T> class Register { public: Register() {}; void set(const T new_value) { val = new_value; }; T value() const { return val; }; void increment() { val += 1; }; void decrement() { val -= 1; }; private: T val; }; typedef Register<uint8_t> ByteRegister; typedef Register<uint16_t> WordRegister; class RegisterPair { public: RegisterPair(ByteRegister& low, ByteRegister& high); void set_low(const uint8_t byte); void set_high(const uint8_t byte); void set_low(const ByteRegister& byte); void set_high(const ByteRegister& byte); void set(const uint16_t word); uint8_t low() const; uint8_t high() const; uint16_t value() const; void increment(); void decrement(); private: ByteRegister& low_byte; ByteRegister& high_byte; }; class Offset { public: Offset(uint8_t val) : val(val) {}; Offset(ByteRegister& reg) : val(reg.value()) {}; uint8_t value() { return val; } private: uint8_t val; }; #endif
Add the mini offset utility class
Add the mini offset utility class
C
bsd-3-clause
jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator
c02cabaab61367862776ad1d612161d4d623f7a0
src/DynamicMemory.h
src/DynamicMemory.h
// // Created by James Telfer on 30/07/2017. // #ifndef C_11_FEATURE_DEMO_DYNAMICMEMORY_H #define C_11_FEATURE_DEMO_DYNAMICMEMORY_H #include "Thing.h" class DynamicMemory { public: DynamicMemory(); void uniquePointers(); void sharedPointers(); void makeShared(); private: void outputThing(const Thing* thing) const; void outputSharedPtr(std::shared_ptr<Thing> thing) const; std::unique_ptr<Thing> uniquePtrMember; std::shared_ptr<Thing> sharedPtrMember; }; #endif //C_11_FEATURE_DEMO_DYNAMICMEMORY_H
// // Created by James Telfer on 30/07/2017. // #ifndef C_11_FEATURE_DEMO_DYNAMICMEMORY_H #define C_11_FEATURE_DEMO_DYNAMICMEMORY_H #include <memory> #include "Thing.h" class DynamicMemory { public: DynamicMemory(); void uniquePointers(); void sharedPointers(); void makeShared(); private: void outputThing(const Thing* thing) const; void outputSharedPtr(std::shared_ptr<Thing> thing) const; std::unique_ptr<Thing> uniquePtrMember; std::shared_ptr<Thing> sharedPtrMember; }; #endif //C_11_FEATURE_DEMO_DYNAMICMEMORY_H
Add header for smart pointers
Add header for smart pointers
C
apache-2.0
jameswtelfer/c11_feature_demo
3f627077a9f2a5fd13234c208525aa61f645ae94
lesson10/app/src/main/jni/GLES2Lesson.h
lesson10/app/src/main/jni/GLES2Lesson.h
// // Created by monty on 23/11/15. // #ifndef LESSON02_GLES2LESSON_H #define LESSON02_GLES2LESSON_H namespace odb { class GLES2Lesson { void fetchShaderLocations(); void setPerspective(); void prepareShaderProgram(); void clearBuffers(); void resetTransformMatrices(); void printVerboseDriverInformation(); GLuint createProgram(const char *pVertexSource, const char *pFragmentSource); GLuint loadShader(GLenum shaderType, const char *pSource); void drawTrig(Trig &trig, const glm::mat4 &transform); glm::mat4 projectionMatrix; glm::mat4 viewMatrix; GLuint vertexAttributePosition; GLuint modelMatrixAttributePosition; GLuint viewMatrixAttributePosition; GLuint samplerUniformPosition; GLuint textureCoordinatesAttributePosition; GLuint projectionMatrixAttributePosition; GLuint gProgram; GLuint textureId; int *textureData; int textureWidth; int textureHeight; std::vector<Trig> mTrigs; glm::vec3 camera; public: GLES2Lesson(); ~GLES2Lesson(); bool init(float w, float h, const std::string &vertexShader, const std::string &fragmentShader); void setTexture(int *bitmapData, int width, int height, int format); void render(); void shutdown(); void tick(); void reset(); void addTrigs(std::vector<Trig> vector); }; } #endif //LESSON02_GLES2LESSON_H
// // Created by monty on 23/11/15. // #ifndef LESSON02_GLES2LESSON_H #define LESSON02_GLES2LESSON_H namespace odb { class GLES2Lesson { void fetchShaderLocations(); void setPerspective(); void prepareShaderProgram(); void clearBuffers(); void resetTransformMatrices(); void printVerboseDriverInformation(); GLuint createProgram(const char *pVertexSource, const char *pFragmentSource); GLuint loadShader(GLenum shaderType, const char *pSource); void drawTrig(Trig &trig, const glm::mat4 &transform); glm::mat4 projectionMatrix; glm::mat4 viewMatrix; GLuint vertexAttributePosition; GLuint modelMatrixAttributePosition; GLuint viewMatrixAttributePosition; GLuint samplerUniformPosition; GLuint textureCoordinatesAttributePosition; GLuint projectionMatrixAttributePosition; GLuint gProgram; GLuint textureId; int *textureData; int textureWidth; int textureHeight; std::vector<Trig> mTrigs; glm::vec3 camera; public: explicit GLES2Lesson(); ~GLES2Lesson(); bool init(float w, float h, const std::string &vertexShader, const std::string &fragmentShader); void setTexture(int *bitmapData, int width, int height, int format); void render(); void shutdown(); void tick(); void reset(); void addTrigs(std::vector<Trig> vector); }; } #endif //LESSON02_GLES2LESSON_H
Make the constructor for the Lesson 10 explicit
Make the constructor for the Lesson 10 explicit While this has little effect here, it's a good practice worth getting used to. I still have to do the same with all the other classes.
C
bsd-2-clause
TheFakeMontyOnTheRun/nehe-ndk-gles20,TheFakeMontyOnTheRun/nehe-ndk-gles20,TheFakeMontyOnTheRun/nehe-ndk-gles20
346e095d25d70cd81ece89e08a241b4f77ab9582
src/file/keydb.h
src/file/keydb.h
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { }, }; static const uint8_t internal_pk_list[][16] = { { }, }; static const uint8_t internal_hc_list[][112] = { { }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { 0 }, }; static const uint8_t internal_pk_list[][16] = { { 0 }, }; static const uint8_t internal_hc_list[][112] = { { 0 }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
C
lgpl-2.1
mwgoldsmith/aacs,mwgoldsmith/aacs
5d6e6d2e8f0edf69301bddd76ae3e0f651d037f1
src/native/log.h
src/native/log.h
#include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "const.h" extern void logop(int32_t, int32_t); extern void dbg_trace(void); #define dbg_log(...) { if(DEBUG) { printf(__VA_ARGS__); } } #define dbg_assert(condition) { if(DEBUG) { if(!(condition)) dbg_log(#condition); assert(condition); } } #define dbg_assert_message(condition, message) { if(DEBUG && !(condition)) { dbg_log(message); assert(false); } }
#include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "const.h" extern void logop(int32_t, int32_t); extern void dbg_trace(void); #define dbg_log(...) { if(DEBUG) { printf(__VA_ARGS__); } } #define dbg_trace(...) { if(DEBUG) { dbg_trace(__VA_ARGS__); } } #define dbg_assert(condition) { if(DEBUG) { if(!(condition)) dbg_log(#condition); assert(condition); } } #define dbg_assert_message(condition, message) { if(DEBUG && !(condition)) { dbg_log(message); assert(false); } }
Remove dbg_trace from non-debug builds
Remove dbg_trace from non-debug builds
C
bsd-2-clause
copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86
57f0cb6232cef023a352bd120a328c520da9f211
test2/inline/static_local.c
test2/inline/static_local.c
// RUN: %check %s // extern extern inline int f() { static int i; return i++; } // static static inline int h() { static int i; return i++; } // neither inline int g() { static int i; // CHECK: warning: static variable in pure-inline function - may differ per file return i++; } // neither, but const inline int g2() { static const int i = 3; // CHECK: !/warn/ return i; } main() { return f() + g() + h(); }
// RUN: %check %s // extern extern inline int f() { static int i; return i++; } // static static inline int h() { static int i; return i++; } // neither inline int g() { static int i; // CHECK: warning: mutable static variable in pure-inline function - may differ per file return i++; } // neither, but const inline int g2() { static const int i = 3; // CHECK: !/warn/ return i; } main() { return f() + g() + h(); }
Fix inline static local warning
Fix inline static local warning
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
b05adaf03b8889da09568b8cf9f1f93d90445f30
src/shared/log.h
src/shared/log.h
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton 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. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug(...) buxton_log(__VA_ARGS__) #else #define buxton_debug(...) do {} while(0); #endif /* DEBUG */ void buxton_log(const char *fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton 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. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug(...) do { \ buxton_log("%s():[%d]: %s", __func__, __LINE__ , __VA_ARGS__); \ } while(0); #else #define buxton_debug(...) do {} while(0); #endif /* DEBUG */ void buxton_log(const char *fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
Add line and function details to buxton_debug()
Add line and function details to buxton_debug()
C
lgpl-2.1
sofar/buxton,sofar/buxton
40cb4828db633619fe71b721fa6440d26e0347bc
src/configuration.h
src/configuration.h
#ifndef QGC_CONFIGURATION_H #define QGC_CONFIGURATION_H #include <QString> /** @brief Polling interval in ms */ #define SERIAL_POLL_INTERVAL 9 /** @brief Heartbeat emission rate, in Hertz (times per second) */ #define MAVLINK_HEARTBEAT_DEFAULT_RATE 1 #define WITH_TEXT_TO_SPEECH 1 #define QGC_APPLICATION_NAME "APM Planner" #define QGC_APPLICATION_VERSION "v2.0.0 (beta)" namespace QGC { const QString APPNAME = "APMPLANNER"; const QString COMPANYNAME = "3DROBOTICS"; const int APPLICATIONVERSION = 200; // 1.0.9 } #endif // QGC_CONFIGURATION_H
#ifndef QGC_CONFIGURATION_H #define QGC_CONFIGURATION_H #include <QString> /** @brief Polling interval in ms */ #define SERIAL_POLL_INTERVAL 9 /** @brief Heartbeat emission rate, in Hertz (times per second) */ #define MAVLINK_HEARTBEAT_DEFAULT_RATE 1 #define WITH_TEXT_TO_SPEECH 1 #define QGC_APPLICATION_NAME "APM Planner" #define QGC_APPLICATION_VERSION "v2.0.0 (beta)" namespace QGC { const QString APPNAME = "APMPLANNER2"; const QString COMPANYNAME = "DIYDRONES"; const int APPLICATIONVERSION = 200; // 1.0.9 } #endif // QGC_CONFIGURATION_H
Change from 3drobotics to diydrones for COMPANYNAME
Change from 3drobotics to diydrones for COMPANYNAME
C
agpl-3.0
hejunbok/apm_planner,sutherlandm/apm_planner,LIKAIMO/apm_planner,sutherlandm/apm_planner,mirkix/apm_planner,abcdelf/apm_planner,xros/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,mirkix/apm_planner,diydrones/apm_planner,LittleBun/apm_planner,labtoast/apm_planner,LittleBun/apm_planner,gpaes/apm_planner,381426068/apm_planner,chen0510566/apm_planner,chen0510566/apm_planner,mrpilot2/apm_planner,abcdelf/apm_planner,gpaes/apm_planner,kellyschrock/apm_planner,abcdelf/apm_planner,xros/apm_planner,LittleBun/apm_planner,abcdelf/apm_planner,mirkix/apm_planner,LIKAIMO/apm_planner,xros/apm_planner,labtoast/apm_planner,gpaes/apm_planner,dcarpy/apm_planner,diydrones/apm_planner,mrpilot2/apm_planner,381426068/apm_planner,Icenowy/apm_planner,mirkix/apm_planner,LIKAIMO/apm_planner,WorkerBees/apm_planner,duststorm/apm_planner,abcdelf/apm_planner,duststorm/apm_planner,duststorm/apm_planner,sutherlandm/apm_planner,diydrones/apm_planner,dcarpy/apm_planner,LittleBun/apm_planner,labtoast/apm_planner,381426068/apm_planner,Icenowy/apm_planner,sutherlandm/apm_planner,chen0510566/apm_planner,duststorm/apm_planner,381426068/apm_planner,mrpilot2/apm_planner,hejunbok/apm_planner,LIKAIMO/apm_planner,chen0510566/apm_planner,Icenowy/apm_planner,kellyschrock/apm_planner,hejunbok/apm_planner,Icenowy/apm_planner,dcarpy/apm_planner,LittleBun/apm_planner,diydrones/apm_planner,dcarpy/apm_planner,sutherlandm/apm_planner,labtoast/apm_planner,mrpilot2/apm_planner,chen0510566/apm_planner,WorkerBees/apm_planner,hejunbok/apm_planner,duststorm/apm_planner,gpaes/apm_planner,381426068/apm_planner,xros/apm_planner,mirkix/apm_planner,hejunbok/apm_planner,WorkerBees/apm_planner,diydrones/apm_planner,mirkix/apm_planner,labtoast/apm_planner,mrpilot2/apm_planner,LIKAIMO/apm_planner,chen0510566/apm_planner,gpaes/apm_planner,abcdelf/apm_planner,Icenowy/apm_planner,dcarpy/apm_planner,381426068/apm_planner,hejunbok/apm_planner,sutherlandm/apm_planner,diydrones/apm_planner,mrpilot2/apm_planner,gpaes/apm_planner,LIKAIMO/apm_planner,xros/apm_planner,xros/apm_planner,Icenowy/apm_planner,LittleBun/apm_planner,duststorm/apm_planner,labtoast/apm_planner,dcarpy/apm_planner,WorkerBees/apm_planner
8c968d0d3bcd83c42b056b290aae5aba9d229c1d
test/periodic/NdbRadioMult.h
test/periodic/NdbRadioMult.h
#ifndef RADIOMULT_H #define RADIOMULT_H #include "NdbMF.h" /* ========= NdbRadioMult ============ */ class NdbRad ioMult : public NdbMF { protected: public: NdbRadioMult() : NdbMF(9, "Multiplicities for radioactive nuclide production") {} ~NdbRadioMult() {} ClassDef(NdbRadioMult,1) }; // NdbRadioMult #endif
#ifndef RADIOMULT_H #define RADIOMULT_H #include "NdbMF.h" /* ========= NdbRadioMult ============ */ class NdbRadioMult : public NdbMF { protected: public: NdbRadioMult() : NdbMF(9, "Multiplicities for radioactive nuclide production") {} ~NdbRadioMult() {} ClassDef(NdbRadioMult,1) }; // NdbRadioMult #endif
Fix typo in tab removal
Fix typo in tab removal
C
lgpl-2.1
CristinaCristescu/root,dfunke/root,abhinavmoudgil95/root,beniz/root,abhinavmoudgil95/root,jrtomps/root,zzxuanyuan/root,mhuwiler/rootauto,nilqed/root,0x0all/ROOT,pspe/root,buuck/root,gbitzes/root,esakellari/root,BerserkerTroll/root,abhinavmoudgil95/root,mkret2/root,satyarth934/root,omazapa/root,CristinaCristescu/root,mattkretz/root,zzxuanyuan/root-compressor-dummy,Y--/root,zzxuanyuan/root,pspe/root,bbockelm/root,mkret2/root,pspe/root,pspe/root,olifre/root,buuck/root,Y--/root,bbockelm/root,mhuwiler/rootauto,root-mirror/root,dfunke/root,simonpf/root,CristinaCristescu/root,jrtomps/root,simonpf/root,omazapa/root-old,mattkretz/root,Y--/root,perovic/root,olifre/root,CristinaCristescu/root,pspe/root,esakellari/my_root_for_test,zzxuanyuan/root,pspe/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,evgeny-boger/root,jrtomps/root,sbinet/cxx-root,davidlt/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,Duraznos/root,root-mirror/root,nilqed/root,satyarth934/root,olifre/root,lgiommi/root,sawenzel/root,mkret2/root,jrtomps/root,karies/root,davidlt/root,evgeny-boger/root,georgtroska/root,karies/root,simonpf/root,karies/root,davidlt/root,jrtomps/root,agarciamontoro/root,veprbl/root,esakellari/root,krafczyk/root,bbockelm/root,Y--/root,gganis/root,krafczyk/root,georgtroska/root,krafczyk/root,vukasinmilosevic/root,smarinac/root,pspe/root,sawenzel/root,lgiommi/root,zzxuanyuan/root,thomaskeck/root,arch1tect0r/root,nilqed/root,satyarth934/root,jrtomps/root,0x0all/ROOT,dfunke/root,vukasinmilosevic/root,veprbl/root,perovic/root,lgiommi/root,omazapa/root-old,satyarth934/root,arch1tect0r/root,evgeny-boger/root,gbitzes/root,sawenzel/root,nilqed/root,simonpf/root,Y--/root,arch1tect0r/root,sawenzel/root,buuck/root,thomaskeck/root,smarinac/root,omazapa/root-old,perovic/root,gganis/root,agarciamontoro/root,bbockelm/root,esakellari/my_root_for_test,beniz/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,georgtroska/root,CristinaCristescu/root,omazapa/root,sbinet/cxx-root,mattkretz/root,esakellari/my_root_for_test,mkret2/root,vukasinmilosevic/root,Y--/root,sawenzel/root,mhuwiler/rootauto,pspe/root,CristinaCristescu/root,karies/root,sirinath/root,jrtomps/root,gbitzes/root,mhuwiler/rootauto,sirinath/root,agarciamontoro/root,georgtroska/root,olifre/root,abhinavmoudgil95/root,zzxuanyuan/root,veprbl/root,abhinavmoudgil95/root,sawenzel/root,gbitzes/root,veprbl/root,evgeny-boger/root,root-mirror/root,sirinath/root,esakellari/my_root_for_test,perovic/root,gganis/root,simonpf/root,omazapa/root,arch1tect0r/root,olifre/root,omazapa/root-old,Duraznos/root,zzxuanyuan/root-compressor-dummy,beniz/root,georgtroska/root,zzxuanyuan/root,Y--/root,veprbl/root,lgiommi/root,satyarth934/root,buuck/root,simonpf/root,davidlt/root,pspe/root,perovic/root,thomaskeck/root,karies/root,omazapa/root,krafczyk/root,mattkretz/root,CristinaCristescu/root,BerserkerTroll/root,olifre/root,beniz/root,olifre/root,Y--/root,smarinac/root,krafczyk/root,jrtomps/root,sbinet/cxx-root,mattkretz/root,davidlt/root,dfunke/root,gganis/root,lgiommi/root,thomaskeck/root,krafczyk/root,mhuwiler/rootauto,Duraznos/root,gbitzes/root,dfunke/root,vukasinmilosevic/root,evgeny-boger/root,satyarth934/root,gganis/root,mhuwiler/rootauto,perovic/root,thomaskeck/root,thomaskeck/root,agarciamontoro/root,esakellari/root,evgeny-boger/root,davidlt/root,karies/root,beniz/root,mattkretz/root,dfunke/root,sirinath/root,vukasinmilosevic/root,0x0all/ROOT,zzxuanyuan/root,evgeny-boger/root,smarinac/root,vukasinmilosevic/root,esakellari/root,Duraznos/root,sbinet/cxx-root,CristinaCristescu/root,dfunke/root,sirinath/root,olifre/root,CristinaCristescu/root,omazapa/root-old,CristinaCristescu/root,mhuwiler/rootauto,smarinac/root,mhuwiler/rootauto,zzxuanyuan/root,abhinavmoudgil95/root,mkret2/root,esakellari/my_root_for_test,arch1tect0r/root,evgeny-boger/root,gbitzes/root,lgiommi/root,evgeny-boger/root,root-mirror/root,Duraznos/root,agarciamontoro/root,mkret2/root,bbockelm/root,agarciamontoro/root,sbinet/cxx-root,Duraznos/root,omazapa/root-old,satyarth934/root,mattkretz/root,0x0all/ROOT,omazapa/root,arch1tect0r/root,gganis/root,vukasinmilosevic/root,esakellari/root,mkret2/root,georgtroska/root,georgtroska/root,olifre/root,satyarth934/root,krafczyk/root,abhinavmoudgil95/root,0x0all/ROOT,buuck/root,Duraznos/root,mattkretz/root,Duraznos/root,krafczyk/root,arch1tect0r/root,agarciamontoro/root,root-mirror/root,omazapa/root-old,krafczyk/root,root-mirror/root,esakellari/root,omazapa/root,simonpf/root,0x0all/ROOT,dfunke/root,esakellari/my_root_for_test,bbockelm/root,esakellari/my_root_for_test,davidlt/root,olifre/root,beniz/root,agarciamontoro/root,esakellari/root,nilqed/root,davidlt/root,georgtroska/root,root-mirror/root,sawenzel/root,Y--/root,omazapa/root,sirinath/root,zzxuanyuan/root,mkret2/root,BerserkerTroll/root,bbockelm/root,beniz/root,perovic/root,evgeny-boger/root,BerserkerTroll/root,sbinet/cxx-root,veprbl/root,karies/root,krafczyk/root,arch1tect0r/root,mkret2/root,krafczyk/root,evgeny-boger/root,zzxuanyuan/root-compressor-dummy,agarciamontoro/root,simonpf/root,lgiommi/root,lgiommi/root,mattkretz/root,mhuwiler/rootauto,BerserkerTroll/root,root-mirror/root,satyarth934/root,davidlt/root,karies/root,sbinet/cxx-root,omazapa/root,vukasinmilosevic/root,sawenzel/root,bbockelm/root,BerserkerTroll/root,0x0all/ROOT,sawenzel/root,mattkretz/root,esakellari/root,satyarth934/root,omazapa/root,buuck/root,bbockelm/root,veprbl/root,gbitzes/root,root-mirror/root,sirinath/root,georgtroska/root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,nilqed/root,esakellari/root,esakellari/my_root_for_test,nilqed/root,BerserkerTroll/root,esakellari/root,smarinac/root,karies/root,gbitzes/root,beniz/root,gganis/root,BerserkerTroll/root,smarinac/root,zzxuanyuan/root,dfunke/root,BerserkerTroll/root,gganis/root,buuck/root,BerserkerTroll/root,Duraznos/root,esakellari/root,sawenzel/root,nilqed/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,nilqed/root,Duraznos/root,sirinath/root,mkret2/root,pspe/root,veprbl/root,beniz/root,Y--/root,pspe/root,sirinath/root,sirinath/root,dfunke/root,vukasinmilosevic/root,vukasinmilosevic/root,buuck/root,mattkretz/root,0x0all/ROOT,davidlt/root,karies/root,zzxuanyuan/root,perovic/root,beniz/root,Y--/root,gbitzes/root,gbitzes/root,gganis/root,jrtomps/root,BerserkerTroll/root,abhinavmoudgil95/root,sirinath/root,dfunke/root,thomaskeck/root,nilqed/root,sbinet/cxx-root,sbinet/cxx-root,sbinet/cxx-root,satyarth934/root,veprbl/root,sawenzel/root,mhuwiler/rootauto,davidlt/root,thomaskeck/root,zzxuanyuan/root-compressor-dummy,lgiommi/root,zzxuanyuan/root-compressor-dummy,simonpf/root,arch1tect0r/root,georgtroska/root,esakellari/my_root_for_test,veprbl/root,vukasinmilosevic/root,lgiommi/root,georgtroska/root,0x0all/ROOT,omazapa/root-old,omazapa/root-old,lgiommi/root,karies/root,buuck/root,Duraznos/root,smarinac/root,omazapa/root-old,nilqed/root,sbinet/cxx-root,esakellari/my_root_for_test,omazapa/root,CristinaCristescu/root,thomaskeck/root,gbitzes/root,omazapa/root,simonpf/root,bbockelm/root,veprbl/root,bbockelm/root,smarinac/root,agarciamontoro/root,olifre/root,perovic/root,arch1tect0r/root,beniz/root,jrtomps/root,buuck/root,abhinavmoudgil95/root,smarinac/root,simonpf/root,root-mirror/root,arch1tect0r/root,root-mirror/root,buuck/root,mkret2/root,perovic/root,perovic/root,gganis/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,gganis/root,jrtomps/root
428dd80dfb94c20ce6a69138f32c9727b4490a14
src/qt/modaloverlay.h
src/qt/modaloverlay.h
// Copyright (c) 2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_MODALOVERLAY_H #define BITCOIN_QT_MODALOVERLAY_H #include <QDateTime> #include <QWidget> //! The required delta of headers to the estimated number of available headers until we show the IBD progress static constexpr int HEADER_HEIGHT_SYNC_DELTA = 24; namespace Ui { class ModalOverlay; } /** Modal overlay to display information about the chain-sync state */ class ModalOverlay : public QWidget { Q_OBJECT public: explicit ModalOverlay(QWidget *parent); ~ModalOverlay(); public Q_SLOTS: void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress); void setKnownBestHeight(int count, const QDateTime &blockDate); // will show or hide the modal layer void showHide(bool hide = false, bool userRequested = false); void closeClicked(); protected: bool eventFilter(QObject *obj, QEvent *ev); bool event(QEvent *ev); private: Ui::ModalOverlay *ui; std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers) QVector<QPair<qint64, double> > blockProcessTime; bool layerIsVisible; bool userClosed; }; #endif // BITCOIN_QT_MODALOVERLAY_H
// Copyright (c) 2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_MODALOVERLAY_H #define BITCOIN_QT_MODALOVERLAY_H #include <QDateTime> #include <QWidget> #include <atomic> //! The required delta of headers to the estimated number of available headers until we show the IBD progress static constexpr int HEADER_HEIGHT_SYNC_DELTA = 24; namespace Ui { class ModalOverlay; } /** Modal overlay to display information about the chain-sync state */ class ModalOverlay : public QWidget { Q_OBJECT public: explicit ModalOverlay(QWidget *parent); ~ModalOverlay(); public Q_SLOTS: void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress); void setKnownBestHeight(int count, const QDateTime &blockDate); // will show or hide the modal layer void showHide(bool hide = false, bool userRequested = false); void closeClicked(); protected: bool eventFilter(QObject *obj, QEvent *ev); bool event(QEvent *ev); private: Ui::ModalOverlay *ui; std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers) QVector<QPair<qint64, double> > blockProcessTime; bool layerIsVisible; bool userClosed; }; #endif // BITCOIN_QT_MODALOVERLAY_H
Add a missing atomic include
Add a missing atomic include This prevent this error in Ubuntu xenial and trusty while compling bitcoin-qt: In file included from qt/modaloverlay.cpp:5:0: qt/modaloverlay.h:42:10: error: ‘atomic’ in namespace ‘std’ does not name a template type std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers) ^
C
mit
BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited
85c15fe657b4bc21a1e39f192e03bc06a759f15d
ipcrypt.h
ipcrypt.h
#ifndef ipcrypt_H #define ipcrypt_H #define IPCRYPT_BYTES 4 #define IPCRYPT_KEYBYTES 16 int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES], const unsigned char in[IPCRYPT_BYTES], const unsigned char key[IPCRYPT_KEYBYTES]); int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES], const unsigned char in[IPCRYPT_BYTES], const unsigned char key[IPCRYPT_KEYBYTES]); #endif
#ifndef ipcrypt_H #define ipcrypt_H #define IPCRYPT_BYTES 4 #define IPCRYPT_KEYBYTES 16 #ifdef __cplusplus extern "C" { #endif int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES], const unsigned char in[IPCRYPT_BYTES], const unsigned char key[IPCRYPT_KEYBYTES]); int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES], const unsigned char in[IPCRYPT_BYTES], const unsigned char key[IPCRYPT_KEYBYTES]); #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif #endif
Make inclusion from C++ projects easier
Make inclusion from C++ projects easier This code adds a conditional extern "C" statement - which most C libraries do as a courtesy for C++ users.
C
isc
jedisct1/c-ipcrypt
1a6015e73fbbfef228b0aa91827a0ad2da3deba0
vm/vm_internal.h
vm/vm_internal.h
#ifndef _INCLUDE_VM_INTERNAL_H #define _INCLUDE_VM_INTERNAL_H #include "vm.h" #include "defs.h" #include "heap.h" typedef struct { vm_value reg[num_regs]; int return_address; int result_register; //TODO type for this should be heap_address int spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
#ifndef _INCLUDE_VM_INTERNAL_H #define _INCLUDE_VM_INTERNAL_H #include "vm.h" #include "defs.h" #include "heap.h" typedef struct { vm_value reg[num_regs]; int return_address; int result_register; heap_address spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
Fix type for spilled arguments
Fix type for spilled arguments
C
mit
arne-schroppe/dash,arne-schroppe/dash
aaa0a5cd4e401bde4fb3691dd4e6c70a5c61e031
include/version.h
include/version.h
/* * Author: Brendan Le Foll <brendan.le.foll@intel.com> * Copyright (c) 2014 Intel Corporation. * * SPDX-License-Identifier: MIT */ #pragma once #ifdef __cplusplus extern "C" { #endif const char* gVERSION; const char* gVERSION_SHORT; #ifdef __cplusplus } #endif
/* * Author: Brendan Le Foll <brendan.le.foll@intel.com> * Copyright (c) 2014 Intel Corporation. * * SPDX-License-Identifier: MIT */ #pragma once #ifdef __cplusplus extern "C" { #endif extern const char* gVERSION; extern const char* gVERSION_SHORT; #ifdef __cplusplus } #endif
Declare gVERSION global as 'extern'.
include: Declare gVERSION global as 'extern'. Fixes build with '-fno-common'. Signed-off-by: Thomas Ingleby <bb80a585db4bdbe09547a7483d1a31841fd0e0e8@intel.com>
C
mit
g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa
13d6d4e18d98f7c2d496f3454216d96a4d8e95d1
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "testLaysOutProperly_9.2_RTL@2x.png"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyView((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection]); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "testLaysOutProperly_9.2_RTL@2x.png"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyViewWithOptions((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection], FBSnapshotTestCaseDefaultSuffixes(), 0.1); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
Add slight tolerance for image differences to visual test macro.
Add slight tolerance for image differences to visual test macro.
C
mit
wikimedia/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios
1b91e278ae59e4f4f1f6a8fe37bd20e527a4975e
Analytics/Integrations/GoogleAnalytics/SEGGoogleAnalyticsIntegration.h
Analytics/Integrations/GoogleAnalytics/SEGGoogleAnalyticsIntegration.h
// GoogleAnalyticsIntegration.h // Copyright (c) 2014 Segment.io. All rights reserved. #import <Foundation/Foundation.h> #import "SEGAnalyticsIntegration.h" @interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration @property(nonatomic, copy) NSString *name; @property(nonatomic, assign) BOOL valid; @property(nonatomic, assign) BOOL initialized; @property(nonatomic, copy) NSDictionary *settings; @end
// GoogleAnalyticsIntegration.h // Copyright (c) 2014 Segment.io. All rights reserved. #import <Foundation/Foundation.h> #import "SEGAnalyticsIntegration.h" #import "SEGEcommerce.h" @interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration <SEGEcommerce> @property(nonatomic, copy) NSString *name; @property(nonatomic, assign) BOOL valid; @property(nonatomic, assign) BOOL initialized; @property(nonatomic, copy) NSDictionary *settings; @end
Add ecommerce protocol to ga
Add ecommerce protocol to ga
C
mit
jtomson-mdsol/analytics-ios,jtomson-mdsol/analytics-ios,rudywen/analytics-ios,dbachrach/analytics-ios,graingert/analytics-ios,jonathannorris/analytics-ios,orta/analytics-ios,segmentio/analytics-ios,operator/analytics-ios,graingert/analytics-ios,djfink-carglass/analytics-ios,jonathannorris/analytics-ios,jlandon/analytics-ios,orta/analytics-ios,operator/analytics-ios,orta/analytics-ios,string-team/analytics-ios,segmentio/analytics-ios,operator/analytics-ios,lumoslabs/analytics-ios,lumoslabs/analytics-ios,jtomson-mdsol/analytics-ios,dcaunt/analytics-ios,graingert/analytics-ios,cfraz89/analytics-ios,jlandon/analytics-ios,abodo-dev/analytics-ios,abodo-dev/analytics-ios,hzalaz/analytics-ios,ldiqual/analytics-ios,cfraz89/analytics-ios,dbachrach/analytics-ios,rudywen/analytics-ios,jlandon/analytics-ios,djfink-carglass/analytics-ios,hzalaz/analytics-ios,abodo-dev/analytics-ios,vinod1988/analytics-ios,lumoslabs/analytics-ios,dbachrach/analytics-ios,dcaunt/analytics-ios,djfink-carglass/analytics-ios,cfraz89/analytics-ios,string-team/analytics-ios,vinod1988/analytics-ios,dcaunt/analytics-ios,jonathannorris/analytics-ios,segmentio/analytics-ios,ldiqual/analytics-ios,string-team/analytics-ios,hzalaz/analytics-ios,vinod1988/analytics-ios,ldiqual/analytics-ios,segmentio/analytics-ios,rudywen/analytics-ios
bafe09faaffee154ccc9225bacb526517e555882
process.h
process.h
// // process.h // Project3 // // Created by Stratton Aguilar on 7/3/14. // Copyright (c) 2014 Stratton Aguilar. All rights reserved. // #ifndef Project3_process_h #define Project3_process_h typedef struct { int processNum; int arrivalTime; int lifeTime; int memReq; } PROCESS; #endif
// // process.h // Project3 // // Created by Stratton Aguilar on 7/3/14. // Copyright (c) 2014 Stratton Aguilar. All rights reserved. // #ifndef Project3_process_h #define Project3_process_h typedef struct { int processNum; int arrivalTime; int lifeTime; int memReq; int time_left; int is_active; } PROCESS; #endif
Add time_left and is_active to the proc struct
Add time_left and is_active to the proc struct
C
mit
ciarand/operating-systems-memory-management-assignment
f0daba127006281d2ff843f88a7e93928e336350
src/greuh_liberation.Default/meta/classnames/support/ammobox_nato_pacific.h
src/greuh_liberation.Default/meta/classnames/support/ammobox_nato_pacific.h
["Box_T_NATO_Wps_F",5,0,0], ["Box_T_NATO_WpsSpecial_F",5,0,0],
["Box_T_NATO_Wps_F",0,0,0], ["Box_T_NATO_WpsSpecial_F",0,0,0],
Remove cost from empty ammoboxes till they can be recycled
Remove cost from empty ammoboxes till they can be recycled
C
mit
fparma/liberation,fparma/liberation,fparma/liberation
1776b4704a26b3cf388e66e2e9f945dde1ba57cb
src/clock_posix.c
src/clock_posix.c
#include <time.h> #include "clock.h" #include "clock_type.h" extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator) { struct timespec res; if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) { /* unknown clock or insufficient resolution */ return -1; } return clock_init_base(clockp, allocator, 1, 1000); } extern uint64_t clock_ticks(struct SPDR_Clock const *const clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock; return ts.tv_sec * 1000000000LL + ts.tv_nsec; }
#include <time.h> #include "clock.h" #include "clock_type.h" extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator) { struct timespec res; if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) { /* unknown clock or insufficient resolution */ return -1; } return clock_init_base(clockp, allocator, 1, 1000); } extern uint64_t clock_ticks(struct SPDR_Clock const *const clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock; return ts.tv_sec * 1000000000LL + ts.tv_nsec; }
Fix signature of clock_init for posix
Fix signature of clock_init for posix
C
mit
uucidl/uu.spdr,uucidl/uu.spdr,uucidl/uu.spdr
0f4982691eaf60f6b23e9f7d02c63ee3b9cb0460
xlat.h
xlat.h
#ifndef STRACE_XLAT_H struct xlat { unsigned int val; const char *str; }; # define XLAT(val) { (unsigned)(val), #val } # define XLAT_PAIR(val, str) { (unsigned)(val), str } # define XLAT_END { 0, 0 } #endif
#ifndef STRACE_XLAT_H struct xlat { unsigned int val; const char *str; }; # define XLAT(val) { (unsigned)(val), #val } # define XLAT_PAIR(val, str) { (unsigned)(val), str } # define XLAT_TYPE(type, val) { (type)(val), #val } # define XLAT_TYPE_PAIR(val, str) { (type)(val), str } # define XLAT_END { 0, 0 } #endif
Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros
Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts to the specified type instead of unsigned int. (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts to the specified type instead of unsigned int.
C
bsd-3-clause
Saruta/strace,Saruta/strace,cuviper/strace,Saruta/strace,Saruta/strace,cuviper/strace,Saruta/strace,cuviper/strace,cuviper/strace,cuviper/strace
37656881f6360da03ecf7c4cbcc51f7a0eae883c
Sensorama/Sensorama/SRDataModel.h
Sensorama/Sensorama/SRDataModel.h
// // SRDataModel.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 19/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #import <Foundation/Foundation.h> #import "Realm/Realm.h" @interface SRDataPoint : RLMObject @property NSNumber<RLMInt> *accX; @property NSNumber<RLMInt> *accY; @property NSNumber<RLMInt> *accZ; @property NSNumber<RLMInt> *magX; @property NSNumber<RLMInt> *magY; @property NSNumber<RLMInt> *magZ; @property NSNumber<RLMInt> *gyroX; @property NSNumber<RLMInt> *gyroY; @property NSNumber<RLMInt> *gyroZ; @property NSInteger fileId; @property NSInteger curTime; @end @interface SRDataFile : RLMObject @property NSString *username; @property NSString *desc; @property NSString *timezone; /* need to do something about device_info */ @property NSInteger sampleInterval; @property BOOL accEnabled; @property BOOL magEnabled; @property BOOL gyroEnabled; @property NSDate *dateStart; @property NSDate *dateEnd; @property NSInteger fileId; @end
// // SRDataModel.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 19/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #import <Foundation/Foundation.h> #import "Realm/Realm.h" @interface SRDataPoint : RLMObject @property NSNumber<RLMInt> *accX; @property NSNumber<RLMInt> *accY; @property NSNumber<RLMInt> *accZ; @property NSNumber<RLMInt> *magX; @property NSNumber<RLMInt> *magY; @property NSNumber<RLMInt> *magZ; @property NSNumber<RLMInt> *gyroX; @property NSNumber<RLMInt> *gyroY; @property NSNumber<RLMInt> *gyroZ; @property NSInteger fileId; @property NSInteger curTime; @end RLM_ARRAY_TYPE(SRDataPoint) @interface SRDataFile : RLMObject @property NSString *username; @property NSString *desc; @property NSString *timezone; /* need to do something about device_info */ @property NSInteger sampleInterval; @property BOOL accEnabled; @property BOOL magEnabled; @property BOOL gyroEnabled; @property NSDate *dateStart; @property NSDate *dateEnd; @property NSInteger fileId; @property RLMArray<SRDataPoint> *dataPoints; @end RLM_ARRAY_TYPE(SRDataFile)
Add arrays to the data model.
Add arrays to the data model.
C
bsd-2-clause
wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios
fa8de09edc9ec4e6d171df80f746174a0ec58afb
src/util/result.h
src/util/result.h
// Copyright (c) 2022 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTIL_RESULT_H #define BITCOIN_UTIL_RESULT_H #include <util/translation.h> #include <variant> /* * 'BResult' is a generic class useful for wrapping a return object * (in case of success) or propagating the error cause. */ template<class T> class BResult { private: std::variant<bilingual_str, T> m_variant; public: BResult() : m_variant(Untranslated("")) {} BResult(const T& _obj) : m_variant(_obj) {} BResult(const bilingual_str& error) : m_variant(error) {} /* Whether the function succeeded or not */ bool HasRes() const { return std::holds_alternative<T>(m_variant); } /* In case of success, the result object */ const T& GetObj() const { assert(HasRes()); return std::get<T>(m_variant); } /* In case of failure, the error cause */ const bilingual_str& GetError() const { assert(!HasRes()); return std::get<bilingual_str>(m_variant); } explicit operator bool() const { return HasRes(); } }; #endif // BITCOIN_UTIL_RESULT_H
// Copyright (c) 2022 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTIL_RESULT_H #define BITCOIN_UTIL_RESULT_H #include <util/translation.h> #include <variant> /* * 'BResult' is a generic class useful for wrapping a return object * (in case of success) or propagating the error cause. */ template<class T> class BResult { private: std::variant<bilingual_str, T> m_variant; public: BResult() : m_variant{Untranslated("")} {} BResult(T obj) : m_variant{std::move(obj)} {} BResult(bilingual_str error) : m_variant{std::move(error)} {} /* Whether the function succeeded or not */ bool HasRes() const { return std::holds_alternative<T>(m_variant); } /* In case of success, the result object */ const T& GetObj() const { assert(HasRes()); return std::get<T>(m_variant); } T ReleaseObj() { assert(HasRes()); return std::move(std::get<T>(m_variant)); } /* In case of failure, the error cause */ const bilingual_str& GetError() const { assert(!HasRes()); return std::get<bilingual_str>(m_variant); } explicit operator bool() const { return HasRes(); } }; #endif // BITCOIN_UTIL_RESULT_H
Prepare BResult for non-copyable types
Prepare BResult for non-copyable types
C
mit
fujicoin/fujicoin,lateminer/bitcoin,lateminer/bitcoin,jamesob/bitcoin,namecoin/namecore,lateminer/bitcoin,kallewoof/bitcoin,fujicoin/fujicoin,AkioNak/bitcoin,mruddy/bitcoin,jamesob/bitcoin,ajtowns/bitcoin,bitcoin/bitcoin,fanquake/bitcoin,sipsorcery/bitcoin,ajtowns/bitcoin,namecoin/namecoin-core,fujicoin/fujicoin,particl/particl-core,tecnovert/particl-core,tecnovert/particl-core,mruddy/bitcoin,jambolo/bitcoin,kallewoof/bitcoin,tecnovert/particl-core,kallewoof/bitcoin,fanquake/bitcoin,jamesob/bitcoin,bitcoin/bitcoin,ajtowns/bitcoin,bitcoinsSG/bitcoin,mruddy/bitcoin,jamesob/bitcoin,fujicoin/fujicoin,sipsorcery/bitcoin,bitcoinsSG/bitcoin,particl/particl-core,bitcoin/bitcoin,sstone/bitcoin,fanquake/bitcoin,Xekyo/bitcoin,AkioNak/bitcoin,sstone/bitcoin,namecoin/namecoin-core,Xekyo/bitcoin,fanquake/bitcoin,namecoin/namecoin-core,jambolo/bitcoin,bitcoinsSG/bitcoin,mruddy/bitcoin,mruddy/bitcoin,tecnovert/particl-core,AkioNak/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,sipsorcery/bitcoin,namecoin/namecore,bitcoinsSG/bitcoin,kallewoof/bitcoin,sstone/bitcoin,namecoin/namecore,fanquake/bitcoin,namecoin/namecoin-core,namecoin/namecoin-core,sipsorcery/bitcoin,fujicoin/fujicoin,kallewoof/bitcoin,ajtowns/bitcoin,sipsorcery/bitcoin,fanquake/bitcoin,particl/particl-core,Xekyo/bitcoin,Xekyo/bitcoin,sipsorcery/bitcoin,namecoin/namecore,particl/particl-core,lateminer/bitcoin,sstone/bitcoin,namecoin/namecore,jambolo/bitcoin,bitcoin/bitcoin,bitcoinsSG/bitcoin,jamesob/bitcoin,sstone/bitcoin,namecoin/namecoin-core,namecoin/namecore,Xekyo/bitcoin,bitcoinsSG/bitcoin,kallewoof/bitcoin,jambolo/bitcoin,jambolo/bitcoin,jamesob/bitcoin,mruddy/bitcoin,fujicoin/fujicoin,jambolo/bitcoin,ajtowns/bitcoin,tecnovert/particl-core,lateminer/bitcoin,particl/particl-core,AkioNak/bitcoin,AkioNak/bitcoin,tecnovert/particl-core,bitcoin/bitcoin,bitcoin/bitcoin,sstone/bitcoin,particl/particl-core,ajtowns/bitcoin,Xekyo/bitcoin
2788f282bbd2e945c1e77c94bc45b8ece5f9b4db
src/Subtitles/paletteinfo.h
src/Subtitles/paletteinfo.h
/* * BDSup2Sub++ (C) 2012 Adam T. * Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef) * and Copyright 2012 Miklos Juhasz (mjuhasz) * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PALETTEINFO_H #define PALETTEINFO_H class PaletteInfo { public: PaletteInfo(); PaletteInfo(const PaletteInfo* other); PaletteInfo(const PaletteInfo& other); int paletteOffset() { return offset; } void setPaletteOffset(int paletteOffset) { offset = paletteOffset; } int paletteSize() { return size; } void setPaletteSize(int paletteSize) { size = paletteSize; } private: int offset = 0; int size = 0; }; #endif // PALETTEINFO_H
/* * BDSup2Sub++ (C) 2012 Adam T. * Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef) * and Copyright 2012 Miklos Juhasz (mjuhasz) * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PALETTEINFO_H #define PALETTEINFO_H class PaletteInfo { public: PaletteInfo(); PaletteInfo(const PaletteInfo* other); PaletteInfo(const PaletteInfo& other); int paletteOffset() { return offset; } void setPaletteOffset(int paletteOffset) { offset = paletteOffset; } int paletteSize() { return size; } void setPaletteSize(int paletteSize) { size = paletteSize; } private: int offset = -1; int size = -1; }; #endif // PALETTEINFO_H
Change default values to -1.
Change default values to -1.
C
apache-2.0
darealshinji/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,darealshinji/BDSup2SubPlusPlus
f94c619e73b934b8f32edf303cc8998670f7cc64
chrome/common/all_messages.h
chrome/common/all_messages.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. // Inclusion of all message files present in the system. Keep this file // up-to-date when adding a new value to enum IPCMessageStart in // ipc/ipc_message_utils.h to include the corresponding message file. #include "chrome/browser/importer/profile_import_process_messages.h" #include "chrome/common/automation_messages.h" #include "chrome/common/common_message_generator.h" #include "chrome/common/nacl_messages.h" #include "content/common/content_message_generator.h" #include "ppapi/proxy/ppapi_messages.h"
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. // Inclusion of all message files present in the system. Keep this file // up-to-date when adding a new value to enum IPCMessageStart in // ipc/ipc_message_utils.h to include the corresponding message file. #include "chrome/browser/importer/profile_import_process_messages.h" #include "chrome/common/common_message_generator.h" #include "chrome/common/nacl_messages.h" #include "content/common/content_message_generator.h" #include "content/common/pepper_messages.h" #include "ppapi/proxy/ppapi_messages.h"
Fix build break from bad merge
Fix build break from bad merge git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@106741 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
hujiajie/pa-chromium,timopulkkinen/BubbleFish,dushu1203/chromium.src,dushu1203/chromium.src,robclark/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,keishi/chromium,littlstar/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,Chilledheart/chromium,timopulkkinen/BubbleFish,Chilledheart/chromium,dednal/chromium.src,ondra-novak/chromium.src,keishi/chromium,markYoungH/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,ChromiumWebApps/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,zcbenz/cefode-chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,littlstar/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,Fireblend/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,patrickm/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,ChromiumWebApps/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,dednal/chromium.src,robclark/chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,keishi/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,keishi/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,robclark/chromium,timopulkkinen/BubbleFish,dednal/chromium.src,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,rogerwang/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,hujiajie/pa-chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,robclark/chromium,ChromiumWebApps/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,keishi/chromium,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,rogerwang/chromium,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,rogerwang/chromium,zcbenz/cefode-chromium,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,patrickm/chromium.src,rogerwang/chromium,robclark/chromium,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,ChromiumWebApps/chromium,keishi/chromium,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,jaruba/chromium.src,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,markYoungH/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,jaruba/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,ltilve/chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,rogerwang/chromium,hujiajie/pa-chromium,jaruba/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,ChromiumWebApps/chromium,ltilve/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,Just-D/chromium-1,dednal/chromium.src,patrickm/chromium.src,Chilledheart/chromium,littlstar/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,rogerwang/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,M4sse/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,rogerwang/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,robclark/chromium,Chilledheart/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,rogerwang/chromium,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,robclark/chromium,M4sse/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,patrickm/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,littlstar/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src
2c5ea3c7a451cf4c0e4612be05ed67bdf6ae86e6
src/main/c/src/DeviceList.c
src/main/c/src/DeviceList.c
/* * Copyright (C) 2013 Klaus Reimer (k@ailis.de) * See COPYING file for copying conditions */ #include "DeviceList.h" #include "Device.h" void setDeviceList(JNIEnv* env, libusb_device** list, int size, jobject object) { SET_POINTER(env, list, object, "deviceListPointer"); jclass cls = (*env)->GetObjectClass(env, object); jfieldID field = (*env)->GetFieldID(env, cls, "size", "I"); (*env)->SetIntField(env, object, field, size); } libusb_device** unwrapDeviceList(JNIEnv* env, jobject list) { UNWRAP_POINTER(env, list, libusb_device**, "deviceListPointer"); } void resetDeviceList(JNIEnv* env, jobject obj) { RESET_POINTER(env, obj, "deviceListPointer"); } /** * Device get(index) */ JNIEXPORT jobject JNICALL METHOD_NAME(DeviceList, get) ( JNIEnv *env, jobject this, jint index ) { jclass cls = (*env)->GetObjectClass(env, this); jfieldID field = (*env)->GetFieldID(env, cls, "size", "I"); int size = (*env)->GetIntField(env, this, field); if (index < 0 || index >= size) return NULL; return wrapDevice(env, unwrapDeviceList(env, this)[index]); }
/* * Copyright (C) 2013 Klaus Reimer (k@ailis.de) * See COPYING file for copying conditions */ #include "DeviceList.h" #include "Device.h" void setDeviceList(JNIEnv* env, libusb_device** list, int size, jobject object) { SET_POINTER(env, list, object, "deviceListPointer"); jclass cls = (*env)->GetObjectClass(env, object); jfieldID field = (*env)->GetFieldID(env, cls, "size", "I"); (*env)->SetIntField(env, object, field, size); } libusb_device** unwrapDeviceList(JNIEnv* env, jobject list) { UNWRAP_POINTER(env, list, libusb_device**, "deviceListPointer"); } void resetDeviceList(JNIEnv* env, jobject obj) { RESET_POINTER(env, obj, "deviceListPointer"); // Reset size to zero too. jclass cls = (*env)->GetObjectClass(env, obj); jfieldID field = (*env)->GetFieldID(env, cls, "size", "I"); (*env)->SetIntField(env, object, field, 0); } /** * Device get(index) */ JNIEXPORT jobject JNICALL METHOD_NAME(DeviceList, get) ( JNIEnv *env, jobject this, jint index ) { jclass cls = (*env)->GetObjectClass(env, this); jfieldID field = (*env)->GetFieldID(env, cls, "size", "I"); int size = (*env)->GetIntField(env, this, field); if (index < 0 || index >= size) return NULL; return wrapDevice(env, unwrapDeviceList(env, this)[index]); }
Set size to zero on reset. Else getting the size is incorrect, and later when checking in get() it would pass the check and you'd access a NULL ptr.
Set size to zero on reset. Else getting the size is incorrect, and later when checking in get() it would pass the check and you'd access a NULL ptr.
C
mit
zodsoft/usb4java,usb4java/usb4java
5b6d5b3f4b105ca4a7229e76895304e038457dcb
sys/dev/advansys/advmcode.h
sys/dev/advansys/advmcode.h
/* * Exported interface to downloadable microcode for AdvanSys SCSI Adapters * * $FreeBSD$ * * Obtained from: * * Copyright (c) 1995-1999 Advanced System Products, Inc. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that redistributions of source * code retain the above copyright notice and this comment without * modification. */ extern u_int16_t adv_mcode[]; extern u_int16_t adv_mcode_size; extern u_int32_t adv_mcode_chksum;
/* * Exported interface to downloadable microcode for AdvanSys SCSI Adapters * * $FreeBSD$ * * Obtained from: * * Copyright (c) 1995-1999 Advanced System Products, Inc. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that redistributions of source * code retain the above copyright notice and this comment without * modification. */ extern u_int8_t adv_mcode[]; extern u_int16_t adv_mcode_size; extern u_int32_t adv_mcode_chksum;
Make the extern for adv_mcode match the reality: it's u_int8_t, but probably unendiansafely used as u_int16_t.
Make the extern for adv_mcode match the reality: it's u_int8_t, but probably unendiansafely used as u_int16_t.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
715c5e6ae0e5c693c168c8f65eb375c85b682887
append_seek_write.c
append_seek_write.c
/* Exercise 5-2 */ #include <unistd.h> #include <fcntl.h> #include "tlpi_hdr.h" int main (int argc, char *argv[]) { if (argc != 2) { usageErr("%s filename", argv[0]); } int fd = open(argv[1], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); if (fd == -1) { errExit("open"); } char s[] = "abcdefghi"; char t[] = "jklmnopqr"; if (write(fd, s, strlen(s)) != strlen(s)) { errExit("write 1"); } if (lseek(fd, 0, SEEK_SET) == -1) { errExit("seeking"); } if (write(fd, t, strlen(t)) != strlen(t)) { errExit("write 2"); } exit(EXIT_SUCCESS); }
/* Exercise 5-2 */ #include <unistd.h> #include <fcntl.h> #include "tlpi_hdr.h" int main (int argc, char *argv[]) { if (argc != 2) { usageErr("%s filename", argv[0]); } int fd = open(argv[1], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); if (fd == -1) { errExit("open"); } char s[] = "abcdefghi"; char t[] = "jklmnopqr"; if (write(fd, s, strlen(s)) != strlen(s)) { errExit("write 1"); } if (lseek(fd, 0, SEEK_SET) == -1) { errExit("seeking"); } if (write(fd, t, strlen(t)) != strlen(t)) { errExit("write 2"); } if (close(fd) == -1) { errExit("close output"); } exit(EXIT_SUCCESS); }
Add missing close for file descriptor
Add missing close for file descriptor
C
mit
timjb/tlpi-exercises,timjb/tlpi-exercises,dalleng/tlpi-exercises,dalleng/tlpi-exercises
b14ece116ed3e4b18d59b645e77b3449fac51137
tests/unit/test-unit-main.c
tests/unit/test-unit-main.c
#include <config.h> #include <dlfcn.h> #include <test-fixtures/test-unit.h> int main (int argc, char **argv) { const CoglUnitTest *unit_test; int i; if (argc != 2) { g_printerr ("usage %s UNIT_TEST\n", argv[0]); exit (1); } /* Just for convenience in case people try passing the wrapper * filenames for the UNIT_TEST argument we normalize '-' characters * to '_' characters... */ for (i = 0; argv[1][i]; i++) { if (argv[1][i] == '-') argv[1][i] = '_'; } unit_test = dlsym (RTLD_DEFAULT, argv[1]); if (!unit_test) { g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; } test_utils_init (unit_test->requirement_flags, unit_test->known_failure_flags); unit_test->run (); test_utils_fini (); return 0; }
#include <config.h> #include <gmodule.h> #include <test-fixtures/test-unit.h> int main (int argc, char **argv) { GModule *main_module; const CoglUnitTest *unit_test; int i; if (argc != 2) { g_printerr ("usage %s UNIT_TEST\n", argv[0]); exit (1); } /* Just for convenience in case people try passing the wrapper * filenames for the UNIT_TEST argument we normalize '-' characters * to '_' characters... */ for (i = 0; argv[1][i]; i++) { if (argv[1][i] == '-') argv[1][i] = '_'; } main_module = g_module_open (NULL, /* use main module */ 0 /* flags */); if (!g_module_symbol (main_module, argv[1], (void **) &unit_test)) { g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; } test_utils_init (unit_test->requirement_flags, unit_test->known_failure_flags); unit_test->run (); test_utils_fini (); return 0; }
Use GModule instead of libdl to load unit test symbols
Use GModule instead of libdl to load unit test symbols Previously the unit tests were using libdl without directly linking to it. It looks like this ends up working because one of Cogl's dependencies ends up pulling adding -ldl via libtool. However in some configurations it looks like this wasn't happening. To avoid this problem we can just use GModule to resolve the symbols. g_module_open is documented to return a handle to the ‘main program’ when NULL is passed as the filename and looking at the code it seems that this ends up using RTLD_DEFAULT so it will have the same effect. The in-tree copy of glib already has the code for gmodule so this shouldn't cause problems for --disable-glib. Reviewed-by: Robert Bragg <12e9293ec6b30c7fa8a0926af42807e929c1684f@linux.intel.com>
C
lgpl-2.1
gcampax/cogl,gcampax/cogl,djdeath/cogl,gcampax/cogl,djdeath/cogl,djdeath/cogl,gcampax/cogl
2354e794031cec8bcb654e676338bc0ddcbb71d6
storageapi/src/vespa/storageapi/mbusprot/protobuf_includes.h
storageapi/src/vespa/storageapi/mbusprot/protobuf_includes.h
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. // Disable warnings emitted by protoc generated files #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-override" #include "feed.pb.h" #include "visiting.pb.h" #include "maintenance.pb.h" #pragma GCC diagnostic pop
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once // Disable warnings emitted by protoc generated files #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-override" #include "feed.pb.h" #include "visiting.pb.h" #include "maintenance.pb.h" #pragma GCC diagnostic pop
Add missing header pragma directive
Add missing header pragma directive
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
ca35f85329122c44b55c97ffb99caac7fcff818d
chrome/app/scoped_ole_initializer.h
chrome/app/scoped_ole_initializer.h
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #include "base/logging.h" #include "build/build_config.h" // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
Make ScopedOleInitializer work on windows if you aren't including build_config already.
Make ScopedOleInitializer work on windows if you aren't including build_config already. BUG=none TEST=none Review URL: http://codereview.chromium.org/19640 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@8835 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
ChromiumWebApps/chromium,rogerwang/chromium,M4sse/chromium.src,rogerwang/chromium,ondra-novak/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,robclark/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,ltilve/chromium,Jonekee/chromium.src,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,rogerwang/chromium,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,hujiajie/pa-chromium,robclark/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,robclark/chromium,ltilve/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,robclark/chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,dednal/chromium.src,ChromiumWebApps/chromium,keishi/chromium,Just-D/chromium-1,ondra-novak/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,markYoungH/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,Just-D/chromium-1,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,rogerwang/chromium,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,keishi/chromium,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,Chilledheart/chromium,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,jaruba/chromium.src,axinging/chromium-crosswalk,robclark/chromium,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,robclark/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,keishi/chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,jaruba/chromium.src,robclark/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,keishi/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,markYoungH/chromium.src,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,Just-D/chromium-1,robclark/chromium,markYoungH/chromium.src,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,ltilve/chromium,patrickm/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,robclark/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,Chilledheart/chromium,rogerwang/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,markYoungH/chromium.src,keishi/chromium,ChromiumWebApps/chromium,patrickm/chromium.src,rogerwang/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,patrickm/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,keishi/chromium,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,Just-D/chromium-1,dednal/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,littlstar/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,littlstar/chromium.src,chuan9/chromium-crosswalk,keishi/chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,robclark/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,keishi/chromium,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,rogerwang/chromium,timopulkkinen/BubbleFish,Jonekee/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,keishi/chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,jaruba/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,keishi/chromium,hgl888/chromium-crosswalk
b311550d076fae4341d8ea73cd6227f1c37c3732
Headers/breakout.h
Headers/breakout.h
/* The Breakout class holds all of the game logic. It is derived from the QWidget class to allow it to display in a Qt window. It handles all input events, game updates, and painting events. It also handles the current game state. */ #ifndef BREAKOUT_H #define BREAKOUT_H #include "ball.h" #include "brick.h" #include "paddle.h" #include <QWidget> #include <QKeyEvent> class Breakout : public QWidget { Q_OBJECT public: //Constructor and Destructor Breakout(QWidget *parent = 0); ~Breakout(); protected: //Events void paintEvent(QPaintEvent* event); void timerEvent(QTimerEvent* event); void keyPressEvent(QKeyEvent* event); //Functions dependent on the current game state void startGame(); void pauseGame(); void stopGame(); void victory(); //Function to check for collision of GameObjects void checkCollision(); private: //Variable to keep track of QTimerId int timerId; //The GameObjects Ball* ball; Paddle* paddle; Brick* bricks[30]; //The game states bool gameOver, gameWon, gameStarted, paused; }; #endif // BREAKOUT_H
/* The Breakout class holds all of the game logic. It is derived from the QWidget class to allow it to display in a Qt window. It handles all input events, game updates, and painting events. It also handles the current game state. */ #ifndef BREAKOUT_H #define BREAKOUT_H #include "ball.h" #include "brick.h" #include "paddle.h" #include <QWidget> #include <QKeyEvent> class Breakout : public QWidget { Q_OBJECT public: //Constructor and Destructor Breakout(QWidget *parent = 0); ~Breakout(); protected: //Events void paintEvent(QPaintEvent* event); void timerEvent(QTimerEvent* event); void keyPressEvent(QKeyEvent* event); //Functions dependent on the current game state void startGame(); void pauseGame(); void stopGame(); void victory(); //Function to check for collision of GameObjects void checkCollision(); private: //Variable to keep track of QTimerId int timerId; //The GameObjects Ball* ball; Paddle* paddle; std::vector<Brick*> bricks; //The game states bool gameOver, gameWon, gameStarted, paused; }; #endif // BREAKOUT_H
Convert bricks to a std::vector
Convert bricks to a std::vector
C
mit
maytim/Basic-Qt-Collision-Example
272ae9518abe3815f1651a730f14b8c1316f96f3
C/header.h
C/header.h
/*! * @brief Template C-header file * * This is a template C-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H #if defined(_MSC_VER) # define <+FILE_CAPITAL+>_DLLEXPORT __declspec(dllexport) #elif defined(__GNUC__) # define <+FILE_CAPITAL+>_DLLEXPORT __attribute__((dllexport)) #else # define DLLEXPORT #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ <+CURSOR+> #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #endif /* <+FILE_CAPITAL+>_H */
/*! * @brief Template C-header file * * This is a template C-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H #if defined(_MSC_VER) # define <+FILE_CAPITAL+>_DLLEXPORT __declspec(dllexport) #elif defined(__GNUC__) # define <+FILE_CAPITAL+>_DLLEXPORT __attribute__((dllexport)) #else # define <+FILE_CAPITAL+>_DLLEXPORT #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ <+CURSOR+> #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #undef <+FILE_CAPITAL+>_DLLEXPORT #endif /* <+FILE_CAPITAL+>_H */
Add macro for DLL exportation
Add macro for DLL exportation
C
mit
koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate
713c8327fadf0ea96a82a9f0216042e8b88609c0
eval/src/vespa/eval/instruction/simple_join_count.h
eval/src/vespa/eval/instruction/simple_join_count.h
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/eval/eval/tensor_function.h> namespace vespalib::eval { /** * Tensor function that will count the number of cells in the result * of a join between two tensors with full mapped overlap consisting * of a single dimension. **/ class SimpleJoinCount : public tensor_function::Op2 { private: uint64_t _dense_factor; public: SimpleJoinCount(const TensorFunction &lhs_in, const TensorFunction &rhs_in, size_t dense_factor_in); InterpretedFunction::Instruction compile_self(const ValueBuilderFactory &factory, Stash &stash) const override; bool result_is_mutable() const override { return true; } uint64_t dense_factor() const { return _dense_factor; } static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash); }; } // namespace
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/eval/eval/tensor_function.h> namespace vespalib::eval { /** * Tensor function that will count the number of cells in the result * of a join between two tensors with full mapped overlap consisting * of a single dimension. **/ class SimpleJoinCount : public tensor_function::Op2 { private: uint64_t _dense_factor; public: SimpleJoinCount(const TensorFunction &lhs_in, const TensorFunction &rhs_in, uint64_t dense_factor_in); InterpretedFunction::Instruction compile_self(const ValueBuilderFactory &factory, Stash &stash) const override; bool result_is_mutable() const override { return true; } uint64_t dense_factor() const { return _dense_factor; } static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash); }; } // namespace
Adjust SimpleJoinCount constructor argument type.
Adjust SimpleJoinCount constructor argument type.
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
eaac4a2d7dd7663451775f0eeb72a800ad1f99f5
include/config/SkUserConfigManual.h
include/config/SkUserConfigManual.h
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Legacy flags #define SK_IGNORE_GPU_DITHER #define SK_SUPPORT_DEPRECATED_CLIPOPS // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #endif // SkUserConfigManual_DEFINED
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Legacy flags #define SK_IGNORE_GPU_DITHER #define SK_SUPPORT_DEPRECATED_CLIPOPS // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT #define SK_SUPPORT_LEGACY_MATRIX_IMAGEFILTER // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #endif // SkUserConfigManual_DEFINED
Add flag to stage api change am: f83df73740
Add flag to stage api change am: f83df73740 Original change: https://googleplex-android-review.googlesource.com/c/platform/external/skia/+/13451544 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2856cdd8b51312e17468c6b5c5cdd98798d72f60
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
af37feed18a95f15ca5ec798ab29e4351c8b335c
k-means/main.c
k-means/main.c
// // main.c // k-means // // Created by Jamie Bullock on 24/08/2014. // Copyright (c) 2014 Jamie Bullock. All rights reserved. // #include "km.h" #include <stdio.h> int main(int argc, const char * argv[]) { km_textfile textfile = km_textfile_new(); RETURN_ON_ERROR(km_textfile_init(textfile)); RETURN_ON_ERROR(km_textfile_read(textfile, "input-2.csv")); km_pointlist pointlist = km_pointlist_new(km_textfile_num_lines(textfile)); RETURN_ON_ERROR(km_pointlist_fill(pointlist, textfile)); km_pointlist_delete(pointlist); km_textfile_delete(textfile); return 0; }
// // main.c // k-means // // Created by Jamie Bullock on 24/08/2014. // Copyright (c) 2014 Jamie Bullock. All rights reserved. // #include "km.h" #include <stdio.h> enum cluster_id { Adam, Bob, Charley, David, Edward, km_num_cluster_ids_ }; void set_initial_cluster_centroids(km_pointlist pointlist) { km_pointlist_update(pointlist, 0, Adam, -0.357, -0.253); km_pointlist_update(pointlist, 1, Bob, -0.055, 4.392); km_pointlist_update(pointlist, 2, Charley, 2.674, -0.001); km_pointlist_update(pointlist, 3, David, 1.044, -1.251); km_pointlist_update(pointlist, 3, Edward, -1.495, -0.090); } int main(int argc, const char * argv[]) { km_textfile textfile = km_textfile_new(); RETURN_ON_ERROR(km_textfile_init(textfile)); RETURN_ON_ERROR(km_textfile_read(textfile, "input-2.csv")); km_pointlist pointlist = km_pointlist_new(km_textfile_num_lines(textfile)); km_pointlist centroids = km_pointlist_new(km_num_cluster_ids_); RETURN_ON_ERROR(km_pointlist_fill(pointlist, textfile)); set_initial_cluster_centroids(centroids); km_pointlist_delete(pointlist); km_textfile_delete(textfile); return 0; }
Add setup code for initial centroids
Add setup code for initial centroids
C
mit
jamiebullock/k-means,jamiebullock/k-means
5251cdd753a244ce7e1b55d397831d31ad75934c
Matrix2D.h
Matrix2D.h
/* Copyright 2011 Michael Fortin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef MATRIX2D #define MATRIX2D #include "Coord2D.h" #include "Angle.h" //! Basic 2D matrix class Matrix2D { public: //! First row Coord2D row1; //! Second row Coord2D row2; //! Initialize as rotation matrix Matrix2D(const Angle &in_angle) : row1(cosf(in_angle.radians()), -sinf(in_angle.radians())) , row2(sinf(in_angle.radians()), cosf(in_angle.radians())) {} }; //! Basic multiplication Coord2D operator*(const Matrix2D &in_mat, const Coord2D &in_c2d) { return Coord2D(dot(in_mat.row1, in_c2d), dot(in_mat.row2, in_c2d)); } #endif
/* Copyright 2011 Michael Fortin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef MATRIX2D #define MATRIX2D #include "Coord2D.h" #include "Angle.h" //! Basic 2D matrix class Matrix2D { public: //! First row Coord2D row1; //! Second row Coord2D row2; //! Initialize as rotation matrix Matrix2D(const Angle &in_angle) : row1(cosf(in_angle.radians()), -sinf(in_angle.radians())) , row2(sinf(in_angle.radians()), cosf(in_angle.radians())) {} //! Basic multiplication Coord2D operator*(const Coord2D &in_c2d) const { return Coord2D(dot(row1, in_c2d), dot(row2, in_c2d)); } }; #endif
Multiply now member of class - link errors when included in multiple cpp files
Multiply now member of class - link errors when included in multiple cpp files
C
apache-2.0
mifortin/AgilePod,mifortin/AgilePod
31f6b273a304341c71bbae34ba4b665d59b3ab72
include/platform/time_mach.h
include/platform/time_mach.h
#ifndef __TIME_MACH_H__ #define __TIME_MACH_H__ #include "config.h" // macros, bool, uint[XX]_t #include <mach/clock.h> // clock_serv_t, mach_timespec_t, etc. #include <mach/mach.h> // mach_port_deallocate static inline uint64_t get_time(void) { static float adj_const = 0.0F; // Cache the value (it doesn't change) if(adj_const == 0.0F) { mach_timebase_info_data_t ti; mach_timebase_info(&ti); adj_const = ti.numer / ti.denom; } return (uint64_t)mach_absolute_time() * adj_const; } #endif /*__TIME_MACH_H__*/
#ifndef __TIME_MACH_H__ #define __TIME_MACH_H__ #include "config.h" // macros, bool, uint[XX]_t #include <mach/clock.h> // clock_serv_t, mach_timespec_t, etc. #include <mach/mach.h> // mach_port_deallocate #include <mach/mach_time.h> static inline uint64_t get_time(void) { static float adj_const = 0.0F; // Cache the value (it doesn't change) if(adj_const == 0.0F) { mach_timebase_info_data_t ti; mach_timebase_info(&ti); adj_const = ti.numer / ti.denom; } return (uint64_t)mach_absolute_time() * adj_const; } #endif /*__TIME_MACH_H__*/
Fix build on OS X.
Fix build on OS X.
C
bsd-3-clause
foxkit-us/supergameherm,supergameherm/supergameherm
905628048f5306cb5cc96e24eda40e86c6b44c62
src/dialogwindow.h
src/dialogwindow.h
#pragma once #include <nanogui/screen.h> #include <nanogui/window.h> #include <nanogui/theme.h> class EditorGUI; class Structure; class DialogWindow : public nanogui::Window { public: DialogWindow(EditorGUI *screen, nanogui::Theme *theme); nanogui::Window *getWindow() { return this; } Structure *structure() { return current_structure; } void setStructure( Structure *s); void loadStructure( Structure *s); void clear(); private: EditorGUI *gui; Structure *current_structure; };
#pragma once #include <nanogui/screen.h> #include <nanogui/window.h> #include <nanogui/theme.h> class EditorGUI; class Structure; class DialogWindow : public nanogui::Window { public: DialogWindow(EditorGUI *screen, nanogui::Theme *theme); nanogui::Window *getWindow() { return this; } Structure *structure() { return current_structure; } void setStructure( Structure *s); void loadStructure( Structure *s); void clear(); private: EditorGUI *gui = nullptr; Structure *current_structure = nullptr; };
Fix crash due to uninitialised pointer when displaying a dialog
Fix crash due to uninitialised pointer when displaying a dialog
C
bsd-3-clause
latproc/humid,latproc/humid
576dcaaa52ba9ca3550d887e358faa0e31c8cf6b
OrbitCaptureGgpClient/include/OrbitCaptureGgpClient/OrbitCaptureGgpClient.h
OrbitCaptureGgpClient/include/OrbitCaptureGgpClient/OrbitCaptureGgpClient.h
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ #define ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ #include <string> #include <vector> class CaptureClientGgpClient { public: CaptureClientGgpClient(std::string grpc_server_address); ~CaptureClientGgpClient(); CaptureClientGgpClient(CaptureClientGgpClient&&); CaptureClientGgpClient& operator=(CaptureClientGgpClient&&); int StartCapture(); int StopAndSaveCapture(); int UpdateSelectedFunctions(std::vector<std::string> capture_functions); void ShutdownService(); private: class CaptureClientGgpClientImpl; std::unique_ptr<CaptureClientGgpClientImpl> pimpl; }; #endif // ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ #define ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ #include <memory> #include <string> #include <vector> class CaptureClientGgpClient { public: CaptureClientGgpClient(std::string grpc_server_address); ~CaptureClientGgpClient(); CaptureClientGgpClient(CaptureClientGgpClient&&); CaptureClientGgpClient& operator=(CaptureClientGgpClient&&); int StartCapture(); int StopAndSaveCapture(); int UpdateSelectedFunctions(std::vector<std::string> capture_functions); void ShutdownService(); private: class CaptureClientGgpClientImpl; std::unique_ptr<CaptureClientGgpClientImpl> pimpl; }; #endif // ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
Solve build error in presubmit
Solve build error in presubmit Missing include in file.
C
bsd-2-clause
google/orbit,google/orbit,google/orbit,google/orbit
b08be4f10886231672844974d8671ddd47276dc7
generic/include/clc/clcfunc.h
generic/include/clc/clcfunc.h
#define _CLC_OVERLOAD __attribute__((overloadable)) #define _CLC_DECL #define _CLC_DEF __attribute__((always_inline)) #define _CLC_INLINE __attribute__((always_inline)) static inline
#define _CLC_OVERLOAD __attribute__((overloadable)) #define _CLC_DECL #define _CLC_DEF __attribute__((always_inline)) #define _CLC_INLINE __attribute__((always_inline)) inline
Remove the static keyword from the _CLC_INLINE macro
Remove the static keyword from the _CLC_INLINE macro static functions are not allowed in OpenCL C git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@184986 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc
686d82dc92be619255669c99ad2d67eb3f8850b0
src/math/p_sinh.c
src/math/p_sinh.c
#include <pal.h> /* * sinh z = (exp z - exp(-z)) / 2 */ static inline float _p_sinh(const float z) { float exp_z; p_exp_f32(&z, &exp_z, 1); return 0.5f * (exp_z - 1.f / exp_z); } /** * * Calculates the hyperbolic sine of the vector 'a'. Angles are specified * in radians. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ void p_sinh_f32(const float *a, float *c, int n) { int i; for (i = 0; i < n; i++) { c[i] = _p_sinh(a[i]); } }
#include <pal.h> #include "p_exp.h" /* * sinh z = (exp z - exp(-z)) / 2 */ static inline float _p_sinh(const float z) { float exp_z = _p_exp(z); return 0.5f * (exp_z - 1.f / exp_z); } /** * * Calculates the hyperbolic sine of the vector 'a'. Angles are specified * in radians. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ void p_sinh_f32(const float *a, float *c, int n) { int i; for (i = 0; i < n; i++) { c[i] = _p_sinh(a[i]); } }
Use the inline exponential function.
math:sinh: Use the inline exponential function. Signed-off-by: Mansour Moufid <ac5f6b12fab5e0d4efa7215e6c2dac9d55ab77dc@gmail.com>
C
apache-2.0
debug-de-su-ka/pal,mateunho/pal,Adamszk/pal3,olajep/pal,Adamszk/pal3,eliteraspberries/pal,aolofsson/pal,8l/pal,parallella/pal,eliteraspberries/pal,8l/pal,aolofsson/pal,aolofsson/pal,8l/pal,Adamszk/pal3,parallella/pal,aolofsson/pal,Adamszk/pal3,mateunho/pal,olajep/pal,olajep/pal,debug-de-su-ka/pal,olajep/pal,debug-de-su-ka/pal,eliteraspberries/pal,debug-de-su-ka/pal,parallella/pal,eliteraspberries/pal,eliteraspberries/pal,mateunho/pal,parallella/pal,8l/pal,mateunho/pal,parallella/pal,debug-de-su-ka/pal,mateunho/pal
f3f4b0e1ab4904f6a1d9011d9abc7735e65b458c
nbdump.c
nbdump.c
#include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <net/ethernet.h> #include <unistd.h> #include <arpa/inet.h> // The default size is enought to hold a whole ethernet frame (< 1524 bytes) #ifndef PACKET_BUFFER_SIZE #define PACKET_BUFFER_SIZE 2048 #endif static void print_packet(const unsigned char *pkt, size_t pktlen) { while (pktlen--) { printf("%02x", *pkt++); } putchar('\n'); } int main(int argc, char *argv[]) { unsigned char pktbuf[PACKET_BUFFER_SIZE]; int sockfd, res = 0; sockfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (-1 == sockfd) { perror("socket"); goto error; } while (1) { ssize_t pktlen = read(sockfd, pktbuf, sizeof(pktbuf)); if (pktlen < 0) { perror("read"); continue; } if (pktlen > 0) { print_packet(pktbuf, pktlen); } } close(sockfd); out: return res; error: res = 1; goto out; }
#include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <net/ethernet.h> #include <unistd.h> #include <arpa/inet.h> // The default size is enought to hold a whole ethernet frame (< 1524 bytes) #ifndef PACKET_BUFFER_SIZE #define PACKET_BUFFER_SIZE 2048 #endif static void print_packet(const unsigned char *pkt, size_t pktlen) { while (pktlen--) { printf("%02x", *pkt++); } putchar('\n'); } int main(int argc, char *argv[]) { unsigned char pktbuf[PACKET_BUFFER_SIZE]; int sockfd, res = 0; sockfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (-1 == sockfd) { perror("socket"); goto error; } while (1) { ssize_t pktlen = read(sockfd, pktbuf, sizeof(pktbuf)); if (pktlen < 0) { perror("read"); continue; } if (pktlen > 0) { print_packet(pktbuf, pktlen); } } close(sockfd); out: return res; error: res = 1; goto out; }
Fix indentation by using tabs only
Fix indentation by using tabs only
C
mit
grn/netbox,grn/netbox
d4441a0e7d10767b97776fd3046382492132f407
src/Article.h
src/Article.h
#ifndef _ARTICLE_H #define _ARTICLE_H #include <string> #include <vector> /*! * represents a Wikipedia (Mediawiki) and its links */ class Article { public: typedef std::vector<Article*> ArticleLinkStorage; typedef std::vector<Article*>::const_iterator ArticleLinkIterator; /*! Create a new article from a title * \param title The title of the article */ Article(std::string title) : title(title) {}; //! Get the title of the article std::string getTitle() const { return title; } //! get the number of links the article has size_t getNumLinks() const; /*! Add a link to another article * \param[in] article Pointer to the article this article links * to */ void addLink(Article* article) { links.push_back(article); } /*! Get const_iterator to first linked article */ ArticleLinkIterator linkBegin() const { return links.cbegin(); } /*! Get const_iterator to last linked article */ ArticleLinkIterator linkEnd() const { return links.cend(); } private: std::string title; ArticleLinkStorage links; }; #endif //_ARTICLE_H
#ifndef _ARTICLE_H #define _ARTICLE_H #include <string> #include <vector> /*! * represents a Wikipedia (Mediawiki) and its links */ class Article { public: //! representation of links to other articles typedef std::vector<Article*> ArticleLinkStorage; //! representation of iterator over links typedef std::vector<Article*>::iterator ArticleLinkIterator; //! representation of const iterator over links typedef std::vector<Article*>::const_iterator ArticleLinkConstIterator; /*! Create a new article from a title * \param title The title of the article */ Article(std::string title) : title(title) {}; //! Get the title of the article std::string getTitle() const { return title; } //! get the number of links the article has size_t getNumLinks() const; /*! Add a link to another article * \param[in] article Pointer to the article this article links * to */ void addLink(Article* article) { links.push_back(article); } /*! Get const_iterator to first linked article */ ArticleLinkConstIterator linkBegin() const { return links.cbegin(); } /*! Get const_iterator to last linked article */ ArticleLinkConstIterator linkEnd() const { return links.cend(); } private: std::string title; ArticleLinkStorage links; }; #endif //_ARTICLE_H
Add modifying article link iterator typedef
Add modifying article link iterator typedef
C
mit
dueringa/WikiWalker
6b3e11bc4cf463b18cd091b5e083d80ec8458e78
src/logging.c
src/logging.c
#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <sys/time.h> void rsp_log(char* format, ...) { char without_ms[64]; char with_ms[64]; struct timeval tv; struct tm *tm; gettimeofday(&tv, NULL); if ((tm = localtime(&tv.tv_sec)) != NULL) { strftime(without_ms, sizeof(without_ms), "%Y-%m-%d %H:%M:%S.%%06u %z", tm); snprintf(with_ms, sizeof(with_ms), without_ms, tv.tv_usec); fprintf(stdout, "[%s] ", with_ms); } va_list argptr; va_start(argptr, format); vfprintf(stdout, format, argptr); va_end(argptr); fflush(stdout); } void rsp_log_error(char* message) { char* error = strerror(errno); char* full_message = malloc(strlen(message) + 3 + strlen(error)); sprintf(full_message, "%s: %s", message, error); rsp_log(full_message); free(full_message); }
#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <sys/time.h> void rsp_log(char* format, ...) { char without_ms[64]; char with_ms[64]; struct timeval tv; struct tm *tm; gettimeofday(&tv, NULL); if ((tm = localtime(&tv.tv_sec)) != NULL) { strftime(without_ms, sizeof(without_ms), "%Y-%m-%d %H:%M:%S.%%06u %z", tm); snprintf(with_ms, sizeof(with_ms), without_ms, tv.tv_usec); fprintf(stdout, "[%s] ", with_ms); } va_list argptr; va_start(argptr, format); vfprintf(stdout, format, argptr); va_end(argptr); fprintf(stdout, "\n"); fflush(stdout); } void rsp_log_error(char* message) { char* error = strerror(errno); char* full_message = malloc(strlen(message) + 3 + strlen(error)); sprintf(full_message, "%s: %s", message, error); rsp_log(full_message); free(full_message); }
Add a newline to the end of our log messages
Add a newline to the end of our log messages
C
mit
gpjt/rsp,gpjt/rsp,gpjt/rsp
95ee667503b8b3123951242e3f7b93598cb9f9b9
test/CodeGen/2003-08-18-SigSetJmp.c
test/CodeGen/2003-08-18-SigSetJmp.c
// RUN: %clang -S -emit-llvm %s -o /dev/null // XFAIL: mingw,win32 #include <setjmp.h> sigjmp_buf B; int foo() { sigsetjmp(B, 1); bar(); }
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o /dev/null #define _JBLEN ((9 * 2) + 3 + 16) typedef int sigjmp_buf[_JBLEN + 1]; int sigsetjmp(sigjmp_buf env, int savemask); sigjmp_buf B; int foo() { sigsetjmp(B, 1); bar(); }
Remove the need for a header and specify a triple so that the type sizes make sense.
Remove the need for a header and specify a triple so that the type sizes make sense. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136309 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
9be47d768eb967add11f6ac218ccb49973f9d5ee
src/main.c
src/main.c
int main() { return 0; }
#include <fcntl.h> #include <stdio.h> #include <unistd.h> const char usage[] = "Usage: %s <filenname>\n"; #define READ_SIZE 2048 int main(int argc, char *argv[]) { if (argc != 2) { printf(usage, argv[0]); return 1; } //FILE *file = fopen(argv[1], "r"); int fd = open(argv[1], O_RDONLY); char buf[READ_SIZE]; ssize_t bytes; do { bytes = read(fd, buf, READ_SIZE); if (bytes == -1) { perror("error reading file"); return 1; } write(STDOUT_FILENO, buf, bytes); } while (bytes == READ_SIZE); return 0; }
Read file passed as argv[1]
Read file passed as argv[1]
C
mit
orodley/imgprint
070f63791af1c9190388ee715a2c9c0b68bc9b2c
machine/include/diag.h
machine/include/diag.h
#ifndef KERN_DIAG #define KERN_DIAG #include <stdarg.h> void panic(const char* diagnostic_message, ...); void shutdown() __attribute__((noreturn)); extern void hang_machine() __attribute__((noreturn)); #ifdef DEBUG #define assert(x) if (!(x)) panic("Assertion failed: " __FILE__ ":%u: " #x, __LINE__) #else #define assert(x) (void) 0 #endif #endif /* KERN_DIAG */
#ifndef KERN_DIAG #define KERN_DIAG #include <stdarg.h> void panic(const char* diagnostic_message, ...) __attribute__((noreturn)); void shutdown() __attribute__((noreturn)); extern void hang_machine() __attribute__((noreturn)); #ifdef DEBUG #define assert(x) if (!(x)) panic("Assertion failed: " __FILE__ ":%u: " #x, __LINE__) #else #define assert(x) (void) 0 #endif #endif /* KERN_DIAG */
Declare panic function as noreturn
machine: Declare panic function as noreturn
C
bsd-2-clause
cksystemsteaching/selfie,cksystemsteaching/selfie,cksystemsteaching/selfie