commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
be7f76e0718737cf7db3506572d8b933a3da0296
firmware/common/Motor/Motor.h
firmware/common/Motor/Motor.h
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{1000000}; static constexpr uint16_t kPwmPeriod{125}; // TODO: change direction security, not too often Motor(PWMDriver* _driver, const uint8_t _channel, bool _isComplementaryChannel = false); void begin(); void stop(); void pwm(int16_t _percentage); void pwmI(int16_t _percentage); virtual void brake() = 0; virtual void changeDirection(eDirection _direction) = 0; virtual void setOutputPinsMode() = 0; protected: PWMDriver* m_driver; uint8_t m_channel; bool m_isComplementaryChannel; PWMConfig m_pwmCfg; };
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{10000}; static constexpr uint16_t kPwmPeriod{20}; Motor(PWMDriver* _driver, const uint8_t _channel, bool _isComplementaryChannel = false); void begin(); void stop(); void pwm(int16_t _percentage); void pwmI(int16_t _percentage); virtual void brake() = 0; virtual void changeDirection(eDirection _direction) = 0; virtual void setOutputPinsMode() = 0; protected: PWMDriver* m_driver; uint8_t m_channel; bool m_isComplementaryChannel; PWMConfig m_pwmCfg; };
Reduce PWM frequency to 500 Hz.
Reduce PWM frequency to 500 Hz.
C
apache-2.0
romainreignier/robot2017,romainreignier/robot2017,romainreignier/robot2017,romainreignier/robot2017
f7efdfd7b740d8d59015e14cb62ac6b3e68743da
Source/PureLayout.h
Source/PureLayout.h
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // #ifndef PureLayout_h #define PureLayout_h #import "ALView+PureLayout.h" #import "NSArray+PureLayout.h" #import "NSLayoutConstraint+PureLayout.h" #endif /* PureLayout_h */
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // #ifndef PureLayout_h #define PureLayout_h #import "ALView+PureLayout.h" #import "NSArray+PureLayout.h" #import "NSLayoutConstraint+PureLayout.h" #endif /* PureLayout_h */
Add newline to end of file
Add newline to end of file
C
mit
k214k/PureLayout,12207480/PureLayout,liuyujing/PureLayout,PureWiki/PureLayout,Joneze/PureLayout,pivotal-oscar/PureLayout,fhchina/PureLayout,FiftyThree/PureLayout,jiamaozheng/PureLayout,adachic/PureLayout,ppamorim/PureLayout,PureWiki/PureLayout,smileyborg/PureLayout,smileyborg/PureLayout,eleostech/PureLayout,lijie121210/PureLayout,abhilashreddykallepu/PureLayout,sandyway/PureLayout,kompozer/PureLayout,FiftyThree/PureLayout,openaphid/PureLayout,shnuzxw/PureLayout,foxswang/PureLayout,Chunyulo/PureLayout,ethan-fang/PureLayout,imjerrybao/PureLayout,12207480/PureLayout,imjerrybao/PureLayout,tangwei6423471/PureLayout,ernestopino/PureLayout,neonaldo/PureLayout,TongKuo/PureLayout,yushuyi/PureLayout,FelixMLians/PureLayout,tangwei6423471/PureLayout,neonaldo/PureLayout,abhilashreddykallepu/PureLayout,Joneze/PureLayout,k214k/PureLayout,bruce-wmm/PureLayout,ernestopino/PureLayout,lijie121210/PureLayout,foxswang/PureLayout,itper/PureLayout,pfleiner/PureLayout,eugenevinitsky/PureLayout,kompozer/PureLayout,fhchina/PureLayout,bruce-wmm/PureLayout,pivotal-oscar/PureLayout,adachic/PureLayout,yuanhoujun/PureLayout,ppamorim/PureLayout,jiamaozheng/PureLayout,cnbin/PureLayout,sandyway/PureLayout,TongKuo/PureLayout,liuyujing/PureLayout,yushuyi/PureLayout,cnbin/PureLayout,openaphid/PureLayout,Chunyulo/PureLayout
9e8a570d53cb8c545ec0c5fe296bcd6e0f657862
Source/config_lui.h
Source/config_lui.h
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" // It is convenient to put these here for now. // #if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) // #ifdef BUILDING_LUI // #define EXPCL_LUI __declspec(dllexport) // #define EXPTP_LUI // #else // #define EXPCL_LUI __declspec(dllimport) // #define EXPTP_LUI extern // #endif // #else // #endif #define EXPCL_LUI #define EXPTP_LUI ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI); NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI); extern EXPCL_LUI void init_lui(); #endif
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" #define EXPCL_LUI EXPORT_CLASS #define EXPTP_LUI EXPORT_TEMPL ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI); NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI); extern EXPCL_LUI void init_lui(); #endif
Fix compilation on Linux with latest 1.10
Fix compilation on Linux with latest 1.10
C
mit
tobspr/LUI,tobspr/LUI,tobspr/LUI
a2cbe2b176bc027d46b9c17046e8df49c247c7bd
core/base/inc/TVersionCheck.h
core/base/inc/TVersionCheck.h
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TVersionCheck #define ROOT_TVersionCheck ////////////////////////////////////////////////////////////////////////// // // // TVersionCheck // // // // Used to check if the shared library or plugin is compatible with // // the current version of ROOT. // // // ////////////////////////////////////////////////////////////////////////// #ifdef R__CXXMODULES #ifndef ROOT_TObject #error "Building with modules currently requires this file to be #included through TObject.h" #endif #endif // R__CXXMODULES #include "RVersion.h" class TVersionCheck { public: TVersionCheck(int versionCode); // implemented in TSystem.cxx }; // FIXME: Due to a modules bug: https://llvm.org/bugs/show_bug.cgi?id=31056 // our .o files get polluted with the gVersionCheck symbol despite it was not // visible in this TU. #ifndef R__CXXMODULES #ifndef __CINT__ static TVersionCheck gVersionCheck(ROOT_VERSION_CODE); #endif #endif #endif
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TVersionCheck #define ROOT_TVersionCheck ////////////////////////////////////////////////////////////////////////// // // // TVersionCheck // // // // Used to check if the shared library or plugin is compatible with // // the current version of ROOT. // // // ////////////////////////////////////////////////////////////////////////// #ifdef R__CXXMODULES #ifndef ROOT_TObject #error "Building with modules currently requires this file to be #included through TObject.h" #endif #endif // R__CXXMODULES #include "RVersion.h" class TVersionCheck { public: TVersionCheck(int versionCode); // implemented in TSystem.cxx }; // FIXME: Due to a modules bug: https://llvm.org/bugs/show_bug.cgi?id=31056 // our .o files get polluted with the gVersionCheck symbol despite it was not // visible in this TU. #ifndef R__CXXMODULES #ifndef __CINT__ namespace ROOT { static TVersionCheck gVersionCheck(ROOT_VERSION_CODE); } #endif #endif #endif
Move gVersionCheck into `ROOT::` (ROOT-10426):
Move gVersionCheck into `ROOT::` (ROOT-10426): This avoids deserializing the declaration when iterating over globals, which in turn avoids jitting the global needed by static init.
C
lgpl-2.1
olifre/root,karies/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,karies/root,olifre/root,olifre/root,root-mirror/root,karies/root,karies/root,karies/root,root-mirror/root,karies/root,karies/root,karies/root,root-mirror/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,olifre/root,karies/root,root-mirror/root,olifre/root,olifre/root,olifre/root,karies/root,root-mirror/root,olifre/root,karies/root
20f3fbf3c7a108b75c5dc92f0fe1108cc3e9bab5
Josh_Zane_Sebastian/src/main.h
Josh_Zane_Sebastian/src/main.h
struct stack_node { struct stack_node *cdr; int data; char type; } struct subroutine { struct stack_node *nodes; int num_nodes; }
#define T_INT 0 #define T_CHAR 1 #define T_SBRTN 2 struct stack_node { struct stack_node *cdr; union node_data data; } union node_data { struct subroutine srtine; int numval; char type; } struct subroutine { struct stack_node *nodes; int num_nodes; }
Add types, allow for subroutines.
Add types, allow for subroutines.
C
mit
aacoppa/final,aacoppa/final
a8eed7df4a04d3a002a04f517efe46a7f9b5c603
src/compiler_llvm/utils_llvm.h
src/compiler_llvm/utils_llvm.h
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ART_SRC_UTILS_LLVM_H_ #define ART_SRC_UTILS_LLVM_H_ #include "stringprintf.h" #include <llvm/Analysis/Verifier.h> #include <stdint.h> #include <string> namespace art { #ifndef NDEBUG #define VERIFY_LLVM_FUNCTION(func) llvm::verifyFunction(func, llvm::PrintMessageAction) #else #define VERIFY_LLVM_FUNCTION(func) #endif inline static std::string ElfFuncName(uint16_t idx) { return StringPrintf("Art%u", static_cast<unsigned int>(idx)); } class CStringLessThanComparator { public: bool operator()(const char* lhs, const char* rhs) const { return (strcmp(lhs, rhs) < 0); } }; } // namespace art #endif // ART_SRC_UTILS_LLVM_H_
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ART_SRC_UTILS_LLVM_H_ #define ART_SRC_UTILS_LLVM_H_ #include "stringprintf.h" #include <llvm/Analysis/Verifier.h> #include <stdint.h> #include <string> namespace art { #ifndef NDEBUG #define VERIFY_LLVM_FUNCTION(func) llvm::verifyFunction(func, llvm::PrintMessageAction) #else #define VERIFY_LLVM_FUNCTION(func) #endif inline static std::string ElfFuncName(uint32_t idx) { return StringPrintf("Art%u", static_cast<unsigned int>(idx)); } class CStringLessThanComparator { public: bool operator()(const char* lhs, const char* rhs) const { return (strcmp(lhs, rhs) < 0); } }; } // namespace art #endif // ART_SRC_UTILS_LLVM_H_
Use uint32_t for compilation unit index instead of uint16_t.
Use uint32_t for compilation unit index instead of uint16_t. Change-Id: If89246e35c16a6b50942e0fe7dcc289234bbdfad
C
apache-2.0
treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst
fac8751ad9ac6eab7f5b86fe5fc82d1ca59a7b2a
src/ehl/isr_written_variable.h
src/ehl/isr_written_variable.h
#ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #include "rvalue.h" namespace ehl { template<typename T> class isr_written_variable { private: mutable volatile bool modified; volatile T value; public: isr_written_variable() = default; isr_written_variable(T initial_value) :value{as_rvalue(initial_value)} { } isr_written_variable& operator=(isr_written_variable const& other) { value = other.value; modified = true; return *this; } isr_written_variable<T>& operator=(T new_value) { value = as_rvalue(new_value); modified = true; return *this; } operator T() const { modified = false; T v = value; while(modified) { modified = false; v = value; } return v; } }; } #endif //EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #include "rvalue.h" namespace ehl { template<typename T> class isr_written_variable { private: mutable volatile bool modified; volatile T value; public: isr_written_variable() = default; isr_written_variable(T initial_value) :value{as_rvalue(initial_value)} { } isr_written_variable& operator=(isr_written_variable const& other) { value = other.value; modified = true; return *this; } isr_written_variable<T>& operator=(T new_value) { value = as_rvalue(new_value); modified = true; return *this; } operator T() const { while(true) { modified = false; T v = value; if(!modified) return v; } } }; } #endif //EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
Refactor to clean up isr written variable
Refactor to clean up isr written variable
C
mit
hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary
03951137c1867d52a47b69466ffb9986f60bd9af
wire.h
wire.h
#ifndef OPTITRACK_WIRE_H_ #define OPTITRACK_WIRE_H_ #include <stdint.h> typedef enum { NAT_PING = 0, NAT_PINGRESPONSE = 1, NAT_REQUEST = 2, NAT_RESPONSE = 3, NAT_REQUEST_MODELDEF = 4, NAT_MODELDEF = 5, NAT_REQUEST_FRAMEOFDATA = 6, NAT_FRAMEOFDATA = 7, NAT_MESSAGESTRING = 8, NAT_UNRECOGNIZED_REQUEST = 100 } natnet_msg_id_t; typedef struct { uint16_t type; uint16_t sz; } natnet_msg_header_t; #define MAX_NAMELENGTH 256 typedef struct { char name[MAX_NAMELENGTH]; char app_version[4]; char natnet_version[4]; } natnet_sender_t; #endif//OPTITRACK_WIRE_H_
#ifndef OPTITRACK_WIRE_H_ #define OPTITRACK_WIRE_H_ #include <stdint.h> typedef enum { NAT_PING = 0, NAT_PINGRESPONSE = 1, NAT_REQUEST = 2, NAT_RESPONSE = 3, NAT_REQUEST_MODELDEF = 4, NAT_MODELDEF = 5, NAT_REQUEST_FRAMEOFDATA = 6, NAT_FRAMEOFDATA = 7, NAT_MESSAGESTRING = 8, NAT_UNRECOGNIZED_REQUEST = 100 } natnet_msg_id_t; typedef struct { uint16_t type; uint16_t sz; } natnet_msg_header_t; #define MAX_NAMELENGTH 256 #define MAX_PACKETSIZE 100000 typedef struct { char name[MAX_NAMELENGTH]; unsigned char app_version[4]; unsigned char natnet_version[4]; } natnet_sender_t; typedef struct { natnet_msg_header_t header; union { unsigned char byteData [MAX_PACKETSIZE]; unsigned int intData [MAX_PACKETSIZE / sizeof(unsigned int)]; float floatData[MAX_PACKETSIZE / sizeof(float)]; natnet_sender_t sender; } data; } natnet_packet_t; #endif//OPTITRACK_WIRE_H_
Fix uchar vs. char in natnet_sender_t; add natnet_packet_t
Fix uchar vs. char in natnet_sender_t; add natnet_packet_t
C
bsd-2-clause
cg123/optitrack-depack,cg123/optitrack-depack
3d49470ecd745e1b9eee54a6f4dfdc507029a66b
Pod/Classes/LumberjackLogger.h
Pod/Classes/LumberjackLogger.h
// // LumberjackLogger.h // Pods // // Created by jiakai lian on 29/09/2015. // // #import <Foundation/Foundation.h> #import <CocoaLumberjack/CocoaLumberjack.h> //If you set the log level to DDLogLevelError, then you will only see Error statements. //If you set the log level to DDLogLevelWarn, then you will only see Error and Warn statements. //If you set the log level to DDLogLevelInfo, you'll see Error, Warn and Info statements. //If you set the log level to DDLogLevelDebug, you'll see Error, Warn, Info and Debug statements. //If you set the log level to DDLogLevelVerbose, you'll see all DDLog statements. //If you set the log level to DDLogLevelOff, you won't see any DDLog statements. #ifdef DEBUG static const DDLogLevel ddLogLevel = DDLogLevelVerbose; #else static const DDLogLevel ddLogLevel = DDLogLevelWarn; #endif @interface LumberjackLogger : NSObject @end
// // LumberjackLogger.h // Pods // // Created by jiakai lian on 29/09/2015. // // #import <Foundation/Foundation.h> #import <CocoaLumberjack/CocoaLumberjack.h> //If you set the log level to DDLogLevelError, then you will only see Error statements. //If you set the log level to DDLogLevelWarn, then you will only see Error and Warn statements. //If you set the log level to DDLogLevelInfo, you'll see Error, Warn and Info statements. //If you set the log level to DDLogLevelDebug, you'll see Error, Warn, Info and Debug statements. //If you set the log level to DDLogLevelVerbose, you'll see all DDLog statements. //If you set the log level to DDLogLevelOff, you won't see any DDLog statements. #ifdef DEBUG static const DDLogLevel ddLogLevel = DDLogLevelVerbose; #else static const DDLogLevel ddLogLevel = DDLogLevelWarning; #endif @interface LumberjackLogger : NSObject @end
Update the release log level
Update the release log level
C
mit
jiakai-lian/LumberjackLogger
0f10a72294d653b458fe7a72604a61e155d67904
include/scratch/bits/algorithm/counted-copying-iterator.h
include/scratch/bits/algorithm/counted-copying-iterator.h
#pragma once #include <cstddef> namespace scratch { template<class T> struct counted_copying_iterator { using value_type = T; using difference_type = ptrdiff_t; using pointer = const T *; using reference = const T&; using iterator_category = random_access_iterator_tag; explicit counted_copying_iterator() noexcept = default; explicit counted_copying_iterator(size_t c, const T& t) noexcept : m_count(c), m_t(&t) {} const T& operator*() const noexcept { return *m_t; } const T *operator->() const noexcept { return m_t; } const T& operator[](difference_type) const noexcept { return m_t; } auto& operator+=(int i) noexcept { m_count -= i; return *this; } auto& operator++() noexcept { return *this += 1; } auto operator++(int) noexcept { auto old = *this; ++*this; return old; } auto& operator-=(int i) noexcept { m_count += i; return *this; } auto& operator--() noexcept { return *this -= 1; } auto operator--(int) noexcept { auto old = *this; --*this; return old; } difference_type operator-(const counted_copying_iterator& rhs) const noexcept { return rhs.m_count - m_count; } bool operator==(const counted_copying_iterator& rhs) const noexcept { return m_count == rhs.m_count; } bool operator!=(const counted_copying_iterator& rhs) const noexcept { return m_count != rhs.m_count; } private: size_t m_count = 0; const T *m_t = nullptr; }; template<class T> auto operator-(counted_copying_iterator<T> a, ptrdiff_t b) noexcept { a -= b; return a; } template<class T> auto operator+(counted_copying_iterator<T> a, ptrdiff_t b) noexcept { a += b; return a; } template<class T> auto operator+(ptrdiff_t b, counted_copying_iterator<T> a) noexcept { a += b; return a; } } // namespace scratch
Add a "counted copying iterator".
Add a "counted copying iterator". Most STL containers have a method `assign(size_t, const T&)` and another method `assign(It, It)` that works with input iterators. By creating an iterator that yields exactly `n` copies of a `const T&`, we can make it really easy to implement the former in terms of the latter.
C
mit
Quuxplusone/from-scratch,Quuxplusone/from-scratch,Quuxplusone/from-scratch
a89923742aac5c342714a6acb1e6da887e945cf3
src/commons.h
src/commons.h
#ifndef __COMMONS_H #define __COMMONS_H #ifdef __APPLE__ #define ENDLINE '\r' #else #define ENDLINE '\n' #endif #endif
Add line endings for Mac OS.
Add line endings for Mac OS.
C
mit
tomaszwojcik/git-ec,tomaszwojcik/git-ec
09461ff2d6756f990eac8d26fd94b2d0bbe15e78
core/rgb_color.h
core/rgb_color.h
#ifndef TRN_RGB_COLOR_H #define TRN_RGB_COLOR_H #include <stdbool.h> typedef struct { float red; float green; float blue; } TrnColor; extern TrnColor const TRN_WHITE; extern TrnColor const TRN_RED; extern TrnColor const TRN_GREEN; extern TrnColor const TRN_BLUE; extern TrnColor const TRN_YELLOW; extern TrnColor const TRN_ORANGE; extern TrnColor const TRN_TURQUOISE; extern TrnColor const TRN_PURPLE; extern TrnColor const TRN_CYAN; bool trn_color_equal(TrnColor const left, TrnColor const right); #endif
#ifndef TRN_COLOR_H #define TRN_COLOR_H #include <stdbool.h> typedef struct { float red; float green; float blue; } TrnColor; extern TrnColor const TRN_WHITE; extern TrnColor const TRN_RED; extern TrnColor const TRN_GREEN; extern TrnColor const TRN_BLUE; extern TrnColor const TRN_YELLOW; extern TrnColor const TRN_ORANGE; extern TrnColor const TRN_TURQUOISE; extern TrnColor const TRN_PURPLE; extern TrnColor const TRN_CYAN; bool trn_color_equal(TrnColor const left, TrnColor const right); #endif
Make include guard name for color.h be compliant with our standard
Make include guard name for color.h be compliant with our standard
C
bsd-3-clause
sed-pro-inria/tetrinria,sed-pro-inria/tetrinria,sed-pro-inria/tetrinria
89bbc645af1622ffc4a7f1cc7e4509f2ca663139
adsbus/resolve.c
adsbus/resolve.c
#include <netdb.h> #include "asyncaddrinfo.h" #include "peer.h" #include "resolve.h" void resolve_init() { asyncaddrinfo_init(2); } void resolve_cleanup() { asyncaddrinfo_cleanup(); } void resolve(struct peer *peer, const char *node, const char *service, int flags) { struct addrinfo hints = { .ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | flags, .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, }; peer->fd = asyncaddrinfo_resolve(node, service, &hints); peer_epoll_add(peer, EPOLLIN); } int resolve_result(struct peer *peer, struct addrinfo **addrs) { int err = asyncaddrinfo_result(peer->fd, addrs); peer->fd = -1; return err; }
#include <netdb.h> #include "asyncaddrinfo.h" #include "peer.h" #include "resolve.h" void resolve_init() { asyncaddrinfo_init(2); } void resolve_cleanup() { asyncaddrinfo_cleanup(); } void resolve(struct peer *peer, const char *node, const char *service, int flags) { struct addrinfo hints = { .ai_flags = AI_V4MAPPED | flags, .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, }; peer->fd = asyncaddrinfo_resolve(node, service, &hints); peer_epoll_add(peer, EPOLLIN); } int resolve_result(struct peer *peer, struct addrinfo **addrs) { int err = asyncaddrinfo_result(peer->fd, addrs); peer->fd = -1; return err; }
Remove AI_ADDRCONFIG, since the netlink socket is missing CLOEXEC and gets inherited by children.
Remove AI_ADDRCONFIG, since the netlink socket is missing CLOEXEC and gets inherited by children.
C
apache-2.0
flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools
66e579500ec1d670e6ea638f93f3fea72aabb6bf
pratica-07/local.h
pratica-07/local.h
#include <stdlib.h> #include <stdio.h> #include <math.h> #define PI 3.14 float soluc (float, float); float radians_degrees (float); float degrees_radians (float);
Add cabecalho para as funcoes (modularizando)
Add cabecalho para as funcoes (modularizando)
C
mit
tonussi/freezing-dubstep,tonussi/freezing-dubstep,tonussi/freezing-dubstep
1253b6a192299bdb1b8d7ff1d50d4718ae0a9957
mudlib/mud/home/Verb/sys/verb/core/wiz/ooc/system/bstat.c
mudlib/mud/home/Verb/sys/verb/core/wiz/ooc/system/bstat.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/kotaka.h> #include <kotaka/paths/string.h> #include <kotaka/paths/system.h> #include <kotaka/paths/verb.h> #include <kotaka/paths/thing.h> inherit LIB_VERB; string *query_parse_methods() { return ({ "raw" }); } void main(object actor, mapping roles) { object user; float interval; user = query_user(); if (user->query_class() < 2) { send_out("You do not have sufficient access rights to query the bulk sync system.\n"); return; } send_out(BULKD->query_pending() + " objects pending.\n"); return; }
Add command to check bulk sync stats
Add command to check bulk sync stats
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
506d8e88ab8c28f052697127fb6ccdcc5a44649a
libedataserverui/gtk-compat.h
libedataserverui/gtk-compat.h
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.22 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if !GTK_CHECK_VERSION(2, 21, 0) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif /* GTK_CHECK_VERSION(2, 21, 0) */ #endif /* __GTK_COMPAT_H__ */
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.22 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if !GTK_CHECK_VERSION(2,21,2) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif /* GTK_CHECK_VERSION(2, 21, 0) */ #endif /* __GTK_COMPAT_H__ */
Set the GTK+ backward compatibility check to 2.21.2.
Set the GTK+ backward compatibility check to 2.21.2.
C
lgpl-2.1
Distrotech/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,Distrotech/evolution-data-server,gcampax/evolution-data-server,matzipan/evolution-data-server,gcampax/evolution-data-server,tintou/evolution-data-server,gcampax/evolution-data-server,Distrotech/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,gcampax/evolution-data-server
cc884148c3ba9903d9d2355cfd31ddbba3a2b77d
MatrixSDK/Data/ReplyEvent/Parser/MXReplyEventParser.h
MatrixSDK/Data/ReplyEvent/Parser/MXReplyEventParser.h
/* Copyright 2019 The Matrix.org Foundation C.I.C Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <Foundation/Foundation.h> #import "MXReplyEventParts.h" #import "MXEvent.h" NS_ASSUME_NONNULL_BEGIN /** Reply event parser. */ @interface MXReplyEventParser : NSObject - (MXReplyEventParts*)parse:(MXEvent*)replyEvent; @end NS_ASSUME_NONNULL_END
/* Copyright 2019 The Matrix.org Foundation C.I.C Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <Foundation/Foundation.h> #import "MXReplyEventParts.h" #import "MXEvent.h" NS_ASSUME_NONNULL_BEGIN /** Reply event parser. */ @interface MXReplyEventParser : NSObject - (nullable MXReplyEventParts*)parse:(MXEvent*)replyEvent; @end NS_ASSUME_NONNULL_END
Make reply parser result optional
Make reply parser result optional
C
apache-2.0
matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk
5c02865845248547ea33362877291f5b70c876c4
Perspective/Perspective/Perspective-Bridging-Header.h
Perspective/Perspective/Perspective-Bridging-Header.h
// // Use this file to import your target's public headers that you would like to expose to Swift. //
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import <Parse/Parse.h> #import <Bolts/Bolts.h> #import <AWSiOSSDKv2/AWSCore.h> #import <AWSiOSSDKv2/S3.h> #import <AWSiOSSDKv2/DynamoDB.h> #import <AWSiOSSDKv2/SQS.h> #import <AWSiOSSDKv2/SNS.h>
Add imports to Bridging Header.
Add imports to Bridging Header.
C
mit
dlrifkin/Perspective-1.0,thedanpan/Perspective
262b514264325253e8e3c180f2f9b91a0a6ff4a6
tests/regression/13-privatized/24-multiple-protecting.c
tests/regression/13-privatized/24-multiple-protecting.c
// Copied & modified from 28/42. #include <pthread.h> #include <assert.h> int g1,g2; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t __global_lock = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); g1++; pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&__global_lock); g1--; pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex1); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); g2++; pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&__global_lock); g2--; pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); assert(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); assert(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&__global_lock); assert(g2 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&__global_lock); assert(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex1); pthread_join(id, NULL); return 0; }
Add privatization test where mutex-oplus fails
Add privatization test where mutex-oplus fails Previously mutex-oplus failed on 28/42, which uses trylock. Apparently the problem isn't trylock but multiple protecting mutexes.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
c938d475630c08a0d695f29b863250ae0ea73b5d
src/qt/macdockiconhandler.h
src/qt/macdockiconhandler.h
#ifndef MACDOCKICONHANDLER_H #define MACDOCKICONHANDLER_H #include <QtCore/QObject> class QMenu; class QIcon; class QWidget; class objc_object; /** Macintosh-specific dock icon handler. */ class MacDockIconHandler : public QObject { Q_OBJECT public: ~MacDockIconHandler(); QMenu *dockMenu(); void setIcon(const QIcon &icon); static MacDockIconHandler *instance(); void handleDockIconClickEvent(); signals: void dockIconClicked(); public slots: private: MacDockIconHandler(); objc_object *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; }; #endif // MACDOCKICONCLICKHANDLER_H
#ifndef MACDOCKICONHANDLER_H #define MACDOCKICONHANDLER_H #include <QtCore/QObject> class QMenu; class QIcon; class QWidget; #ifdef __OBJC__ @class DockIconClickEventHandler; #else class DockIconClickEventHandler; #endif /** Macintosh-specific dock icon handler. */ class MacDockIconHandler : public QObject { Q_OBJECT public: ~MacDockIconHandler(); QMenu *dockMenu(); void setIcon(const QIcon &icon); static MacDockIconHandler *instance(); void handleDockIconClickEvent(); signals: void dockIconClicked(); public slots: private: MacDockIconHandler(); DockIconClickEventHandler *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; }; #endif // MACDOCKICONCLICKHANDLER_H
Fix for legacy QT compatibility
Fix for legacy QT compatibility
C
mit
koharjidan/sexcoin,lavajumper/sexcoin,lavajumper/sexcoin,koharjidan/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,lavajumper/sexcoin,koharjidan/sexcoin,lavajumper/sexcoin,sexcoin-project/sexcoin,lavajumper/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,koharjidan/sexcoin,lavajumper/sexcoin
77d8b067bf60caa27bddb974a4e1841287334a8c
features/cryptocell/FEATURE_CRYPTOCELL310/mbedtls_device.h
features/cryptocell/FEATURE_CRYPTOCELL310/mbedtls_device.h
/* * mbedtls_device.h * * Copyright (C) 2018, Arm Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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 __MBEDTLS_DEVICE__ #define __MBEDTLS_DEVICE__ #define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT #define MBEDTLS_SHA1_ALT #define MBEDTLS_SHA256_ALT #define MBEDTLS_CCM_ALT #define MBEDTLS_CMAC_ALT #define MBEDTLS_ECDSA_VERIFY_ALT #define MBEDTLS_ECDSA_SIGN_ALT #define MBEDTLS_ECDSA_GENKEY_ALT #define MBEDTLS_ECDH_GEN_PUBLIC_ALT #define MBEDTLS_ECDH_COMPUTE_SHARED_ALT #endif //__MBEDTLS_DEVICE__
/* * mbedtls_device.h * * Copyright (C) 2018-2019, Arm Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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 __MBEDTLS_DEVICE__ #define __MBEDTLS_DEVICE__ #define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT #define MBEDTLS_SHA1_ALT #define MBEDTLS_SHA256_ALT #define MBEDTLS_CCM_ALT //#define MBEDTLS_CMAC_ALT #define MBEDTLS_ECDSA_VERIFY_ALT #define MBEDTLS_ECDSA_SIGN_ALT #define MBEDTLS_ECDSA_GENKEY_ALT #define MBEDTLS_ECDH_GEN_PUBLIC_ALT #define MBEDTLS_ECDH_COMPUTE_SHARED_ALT #endif //__MBEDTLS_DEVICE__
Make the alternative cmac optional
Make the alternative cmac optional Have the alternative cmac undefined by default, in order not to break backwards compatability.
C
apache-2.0
andcor02/mbed-os,mbedmicro/mbed,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,kjbracey-arm/mbed
fbb9d30f44ad3373b96ef0319a4fb404b60be5de
critical-mutex.c
critical-mutex.c
#include <stdio.h> #include <assert.h> #include <unistd.h> #include "uv.h" static uv_mutex_t mutex; static uv_thread_t thread; static int crit_data = 0; static void thread_cb(void* arg) { uv_mutex_lock(&mutex); printf("thread mutex start\n"); crit_data = 2; printf("thread mutex end\n"); uv_mutex_unlock(&mutex); } int main() { assert(0 == uv_mutex_init(&mutex)); assert(0 == uv_thread_create(&thread, thread_cb, NULL)); uv_mutex_lock(&mutex); printf("main mutex start\n"); sleep(1); crit_data = 1; printf("main mutex end\n"); uv_mutex_unlock(&mutex); uv_thread_join(&thread); uv_mutex_destroy(&mutex); return 0; }
#include <stdio.h> #include <assert.h> #include <unistd.h> #include "uv.h" static uv_mutex_t mutex; static uv_thread_t thread; static void thread_cb(void* arg) { printf("thread_cb\n"); uv_mutex_lock(&mutex); printf("thread mutex\n"); uv_mutex_unlock(&mutex); } int main() { assert(0 == uv_mutex_init(&mutex)); assert(0 == uv_thread_create(&thread, thread_cb, NULL)); uv_mutex_lock(&mutex); printf("main mutex start\n"); sleep(1); printf("main mutex end\n"); uv_mutex_unlock(&mutex); uv_thread_join(&thread); uv_mutex_destroy(&mutex); return 0; }
Make use of mutex easier to see
Make use of mutex easier to see With the access to the data, the use of the actual mutex could have been confused. By simply using the mutex the example is a lot more clear.
C
mit
trevnorris/libuv-examples
c79489d69b73dc523442fa797b5cc38a8c841f35
src/kernel/thread/signal/sigstd_stub.h
src/kernel/thread/signal/sigstd_stub.h
/** * @file * @brief Stubs for standard signals. * * @date 07.10.2013 * @author Eldar Abusalimov */ #ifndef KERNEL_THREAD_SIGSTD_STUB_H_ #define KERNEL_THREAD_SIGSTD_STUB_H_ #include <errno.h> #define SIGSTD_MIN 0 #define SIGSTD_MAX -1 struct sigstd_data { }; /* stub */ static inline struct sigstd_data * sigstd_data_init( struct sigstd_data *sigstd_data) { return sigstd_data; } static inline int sigstd_raise(struct sigstd_data *data, int sig) { return -ENOSYS; } static inline void sigstd_handle(struct sigstd_data *data, struct sigaction *sig_table) { /* no-op */ } #endif /* KERNEL_THREAD_SIGSTD_STUB_H_ */
/** * @file * @brief Stubs for standard signals. * * @date 07.10.2013 * @author Eldar Abusalimov */ #ifndef KERNEL_THREAD_SIGSTD_STUB_H_ #define KERNEL_THREAD_SIGSTD_STUB_H_ #include <errno.h> #include <signal.h> #define SIGSTD_MIN 0 #define SIGSTD_MAX -1 struct sigstd_data { }; /* stub */ static inline struct sigstd_data * sigstd_data_init( struct sigstd_data *sigstd_data) { return sigstd_data; } static inline int sigstd_raise(struct sigstd_data *data, int sig) { return -ENOSYS; } static inline void sigstd_handle(struct sigstd_data *data, struct sigaction *sig_table) { /* no-op */ } #endif /* KERNEL_THREAD_SIGSTD_STUB_H_ */
Fix stub implementation (add missing sigaction decl)
signal: Fix stub implementation (add missing sigaction decl)
C
bsd-2-clause
mike2390/embox,Kefir0192/embox,mike2390/embox,Kakadu/embox,embox/embox,embox/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,Kefir0192/embox,Kefir0192/embox,embox/embox,abusalimov/embox,vrxfile/embox-trik,abusalimov/embox,mike2390/embox,Kefir0192/embox,gzoom13/embox,Kakadu/embox,vrxfile/embox-trik,Kakadu/embox,embox/embox,gzoom13/embox,mike2390/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,gzoom13/embox,abusalimov/embox,embox/embox,Kakadu/embox,mike2390/embox,vrxfile/embox-trik,gzoom13/embox,Kefir0192/embox,embox/embox,abusalimov/embox,gzoom13/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,gzoom13/embox,abusalimov/embox,abusalimov/embox,mike2390/embox,Kefir0192/embox
99255bdc27f95eec652b0895fd63ed2aed9a619d
tests/checkTable.c
tests/checkTable.c
/* liblouis Braille Translation and Back-Translation Library Copyright (C) 2012 James Teh <[email protected]> Copyright (C) 2015 Davy Kager <[email protected]> Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "liblouis.h" int main(int argc, char **argv) { const char *goodTable = "en-us-g1.ctb"; const char *badTable = "bad.ctb"; int result = 0; if (lou_checkTable(goodTable) == 0) { printf("Getting %s failed, expected success\n", goodTable); result = 1; } if (lou_checkTable(badTable) != 0) { printf("Getting %s succeeded, expected failure\n", badTable); result = 1; } if (lou_checkTable(goodTable) == 0) { printf("Getting %s failed, expected success\n", goodTable); result = 1; } lou_free(); return result; }
Add test based on getTable.c.
Add test based on getTable.c.
C
lgpl-2.1
liblouis/liblouis,hammera/liblouis,liblouis/liblouis,vsmontalvao/liblouis,liblouis/liblouis,IndexBraille/liblouis,BueVest/liblouis,BueVest/liblouis,liblouis/liblouis,IndexBraille/liblouis,liblouis/liblouis,vsmontalvao/liblouis,liblouis/liblouis,hammera/liblouis,BueVest/liblouis,BueVest/liblouis,BueVest/liblouis,IndexBraille/liblouis,vsmontalvao/liblouis,hammera/liblouis,hammera/liblouis,hammera/liblouis,vsmontalvao/liblouis,IndexBraille/liblouis,BueVest/liblouis,vsmontalvao/liblouis,IndexBraille/liblouis,hammera/liblouis
e971b9bcafa2d73d310a94ee1793163d6e1de14f
libsel4/include/sel4/macros.h
libsel4/include/sel4/macros.h
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef __LIBSEL4_MACROS_H #define __LIBSEL4_MACROS_H #include <autoconf.h> /* * Some compilers attempt to pack enums into the smallest possible type. * For ABI compatability with the kernel, we need to ensure they remain * the same size as an 'int'. */ #define SEL4_FORCE_LONG_ENUM(type) \ _enum_pad_ ## type = (1U << ((sizeof(int)*8) - 1)) - 1 #ifndef CONST #define CONST __attribute__((__const__)) #endif #ifndef PURE #define PURE __attribute__((__pure__)) #endif #define SEL4_OFFSETOF(type, member) __builtin_offsetof(type, member) #ifdef CONFIG_LIB_SEL4_INLINE_INVOCATIONS #define LIBSEL4_INLINE static inline #else #define LIBSEL4_INLINE __attribute__((noinline)) __attribute__((unused)) __attribute__((weak)) #endif #endif
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef __LIBSEL4_MACROS_H #define __LIBSEL4_MACROS_H #include <autoconf.h> /* * Some compilers attempt to pack enums into the smallest possible type. * For ABI compatability with the kernel, we need to ensure they remain * the same size as a 'long'. */ #define SEL4_FORCE_LONG_ENUM(type) \ _enum_pad_ ## type = (1ULL << ((sizeof(long)*8) - 1)) - 1 #ifndef CONST #define CONST __attribute__((__const__)) #endif #ifndef PURE #define PURE __attribute__((__pure__)) #endif #define SEL4_OFFSETOF(type, member) __builtin_offsetof(type, member) #ifdef CONFIG_LIB_SEL4_INLINE_INVOCATIONS #define LIBSEL4_INLINE static inline #else #define LIBSEL4_INLINE __attribute__((noinline)) __attribute__((unused)) __attribute__((weak)) #endif #endif
Make FORCE_LONG_ENUM actually force a long instead of an int
libsel4: Make FORCE_LONG_ENUM actually force a long instead of an int
C
bsd-2-clause
cmr/seL4,zhicheng/seL4,cmr/seL4,cmr/seL4,zhicheng/seL4,zhicheng/seL4
893b75e2bf2784f5b38837371cbcb33f884fee04
c/src/base/ByteStream.h
c/src/base/ByteStream.h
#ifndef C_BYTESTREAM_H #define C_BYTESTREAM_H #include "ByteListener.h" #include "ByteProducer.h" #include "ByteSubscription.h" typedef struct ByteStream { void (*add_listener) (struct ByteStream *self, ByteListener *listener); void (*remove_listener) (struct ByteStream *self, ByteListener *listener); void *(*subscribe) (struct ByteStream *self, ByteListener *listener); ByteSubscription *(*unsubscribe) (struct ByteStream *self, ByteListener *listener); } ByteStream; ByteStream *byte_stream_create (ByteProducer *producer); #endif // C_BYTESTREAM_H
#ifndef C_BYTESTREAM_H #define C_BYTESTREAM_H #include "ByteListener.h" #include "ByteProducer.h" #include "ByteSubscription.h" #include "ByteListenerInternal.h" #include "ByteProducerInternal.h" #include "VariableLengthArray.h" typedef uint8_t Boolean; typedef Byte (*byte_steam_map_function) (Byte value); typedef Boolean (*byte_steam_filter_function) (Byte value); typedef struct ByteStream { void (*add_listener) (struct ByteStream *self, ByteListener *listener); void (*remove_listener) (struct ByteStream *self, ByteListener *listener); void *(*subscribe) (struct ByteStream *self, ByteListener *listener); ByteSubscription *(*unsubscribe) (struct ByteStream *self, ByteListener *listener); ByteListenerInternal *_internal_listener; ByteProducerInternal *_producer; VariableLengthArray *_internal_listeners; int _stop_id; int _error; void (*_teardown) (struct ByteStream *self); void (*_stop_now) (struct ByteStream *self); void (*_add) (struct ByteStream *self, ByteListenerInternal *listener); void (*_remove) (struct ByteStream *self, ByteListenerInternal *listener); struct ByteStream *(*map) (struct ByteStream *self, byte_steam_map_function map); struct ByteStream *(*mapTo) (struct ByteStream *self, Byte value); struct ByteStream *(*filter) (struct ByteStream *self, byte_steam_filter_function filter); struct ByteStream *(*take) (struct ByteStream *self, int count); struct ByteStream *(*drop) (struct ByteStream *self, int count); struct ByteStream *(*last) (struct ByteStream *self); } ByteStream; ByteStream *byte_stream_create (ByteProducer *producer); ByteStream *byte_stream_never (); ByteStream *byte_stream_empty (); ByteStream *byte_stream_throw (); ByteStream *byte_stream_from_array (Byte array[]); ByteStream *byte_stream_periodic (int milliseconds); ByteStream *byte_stream_merge (ByteStream streams[]); #endif // C_BYTESTREAM_H
Add fuller definition of Stream<Byte>
Add fuller definition of Stream<Byte>
C
mit
artfuldev/RIoT
2c68ddc27ccc965b15ebc50159cae4d76ed5af2b
cbits/gradient_decent.c
cbits/gradient_decent.c
#include "gradient_decent.h" void decend_cpu(int len, double rate, double momentum, double regulariser, const double* weights, const double* gradient, const double* last, double* outputWeights, double* outputMomentum) { for (int i = 0; i <= len; i++) { outputMomentum[i] = momentum * last[i] - rate * gradient[i]; outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i]; } }
#include "gradient_decent.h" void decend_cpu(int len, double rate, double momentum, double regulariser, const double* weights, const double* gradient, const double* last, double* outputWeights, double* outputMomentum) { for (int i = 0; i < len; i++) { outputMomentum[i] = momentum * last[i] - rate * gradient[i]; outputWeights[i] = weights[i] + outputMomentum[i] - (rate * regulariser) * weights[i]; } }
Fix off-by-one error in C code
Fix off-by-one error in C code
C
bsd-2-clause
HuwCampbell/grenade,HuwCampbell/grenade
0aedae3932bef0b8d4bcd83e9681489073a0beb9
android_webview/common/devtools_instrumentation.h
android_webview/common/devtools_instrumentation.h
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_ #define ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_ #include "base/debug/trace_event.h" namespace android_webview { namespace devtools_instrumentation { namespace internal { const char kCategory[] = "Java,devtools"; const char kEmbedderCallback[] = "EmbedderCallback"; const char kCallbackNameArgument[] = "callbackName"; } // namespace internal class ScopedEmbedderCallbackTask { public: ScopedEmbedderCallbackTask(const char* callback_name) { TRACE_EVENT_BEGIN1(internal::kCategory, internal::kEmbedderCallback, internal::kCallbackNameArgument, callback_name); } ~ScopedEmbedderCallbackTask() { TRACE_EVENT_END0(internal::kCategory, internal::kEmbedderCallback); } private: DISALLOW_COPY_AND_ASSIGN(ScopedEmbedderCallbackTask); }; } // namespace devtools_instrumentation } // namespace android_webview #endif // ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_ #define ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_ #include "base/debug/trace_event.h" namespace android_webview { namespace devtools_instrumentation { namespace internal { const char kCategory[] = "Java,devtools,disabled-by-default-devtools.timeline"; const char kEmbedderCallback[] = "EmbedderCallback"; const char kCallbackNameArgument[] = "callbackName"; } // namespace internal class ScopedEmbedderCallbackTask { public: ScopedEmbedderCallbackTask(const char* callback_name) { TRACE_EVENT_BEGIN1(internal::kCategory, internal::kEmbedderCallback, internal::kCallbackNameArgument, callback_name); } ~ScopedEmbedderCallbackTask() { TRACE_EVENT_END0(internal::kCategory, internal::kEmbedderCallback); } private: DISALLOW_COPY_AND_ASSIGN(ScopedEmbedderCallbackTask); }; } // namespace devtools_instrumentation } // namespace android_webview #endif // ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
Add devtools trace events for Timeline EmbedderCallback notification
Add devtools trace events for Timeline EmbedderCallback notification This events will be used instead of existing implementation in InspectorTimelineAgent.cpp after switching Timeline to trace events as backend. BUG=361045 Review URL: https://codereview.chromium.org/254313002 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@268152 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
PeterWangIntel/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,ltilve/chromium,dednal/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,jaruba/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,M4sse/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,ltilve/chromium,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,krieger-od/nwjs_chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,littlstar/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dednal/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,dednal/chromium.src,Chilledheart/chromium,Chilledheart/chromium,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,littlstar/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,ltilve/chromium,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,littlstar/chromium.src,dednal/chromium.src
0049997b699676539caf7d2ae52f690ba374123c
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 "QGroundControl" #define QGC_APPLICATION_VERSION "v. 1.0.9 (beta)" namespace QGC { const QString APPNAME = "QGROUNDCONTROL"; const QString COMPANYNAME = "QGROUNDCONTROL"; const int APPLICATIONVERSION = 109; // 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 "QGroundControl" #define QGC_APPLICATION_VERSION "v. 1.0.10 (beta)" namespace QGC { const QString APPNAME = "QGROUNDCONTROL"; const QString COMPANYNAME = "QGROUNDCONTROL"; const int APPLICATIONVERSION = 109; // 1.0.9 } #endif // QGC_CONFIGURATION_H
Increment version number, since the new AHRS would break setting loading
Increment version number, since the new AHRS would break setting loading
C
agpl-3.0
hejunbok/apm_planner,mihadyuk/qgroundcontrol,josephlewis42/UDenverQGC2,gpaes/apm_planner,iidioter/qgroundcontrol,ethz-asl/qgc_asl,dcarpy/apm_planner,TheIronBorn/qgroundcontrol,381426068/apm_planner,jy723/qgroundcontrol,BMP-TECH/qgroundcontrol,caoxiongkun/qgroundcontrol,labtoast/apm_planner,gpaes/apm_planner,duststorm/apm_planner,LIKAIMO/qgroundcontrol,LIKAIMO/apm_planner,sutherlandm/apm_planner,gpaes/apm_planner,BMP-TECH/qgroundcontrol,duststorm/apm_planner,sutherlandm/apm_planner,mihadyuk/qgroundcontrol,dcarpy/apm_planner,ethz-asl/qgc_asl,duststorm/apm_planner,BMP-TECH/qgroundcontrol,Icenowy/apm_planner,RedoXyde/PX4_qGCS,LittleBun/apm_planner,gpaes/apm_planner,lis-epfl/qgroundcontrol,catch-twenty-two/qgroundcontrol,381426068/apm_planner,LIKAIMO/apm_planner,mirkix/apm_planner,LIKAIMO/qgroundcontrol,jy723/qgroundcontrol,mirkix/apm_planner,LittleBun/apm_planner,LittleBun/apm_planner,cfelipesouza/qgroundcontrol,Icenowy/apm_planner,diydrones/apm_planner,mrpilot2/apm_planner,hejunbok/apm_planner,381426068/apm_planner,TheIronBorn/qgroundcontrol,LittleBun/apm_planner,kd0aij/qgroundcontrol,caoxiongkun/qgroundcontrol,mirkix/apm_planner,fizzaly/qgroundcontrol,LIKAIMO/qgroundcontrol,diydrones/apm_planner,jy723/qgroundcontrol,fizzaly/qgroundcontrol,UAVenture/qgroundcontrol,devbharat/qgroundcontrol,381426068/apm_planner,dagoodma/qgroundcontrol,CornerOfSkyline/qgroundcontrol,scott-eddy/qgroundcontrol,catch-twenty-two/qgroundcontrol,sverling/qgc_asl,CornerOfSkyline/qgroundcontrol,Hunter522/qgroundcontrol,Hunter522/qgroundcontrol,greenoaktree/qgroundcontrol,kellyschrock/apm_planner,sutherlandm/apm_planner,caoxiongkun/qgroundcontrol,cfelipesouza/qgroundcontrol,TheIronBorn/qgroundcontrol,mirkix/apm_planner,greenoaktree/qgroundcontrol,mihadyuk/qgroundcontrol,WorkerBees/apm_planner,hejunbok/qgroundcontrol,CornerOfSkyline/qgroundcontrol,hejunbok/qgroundcontrol,diydrones/apm_planner,duststorm/apm_planner,catch-twenty-two/qgroundcontrol,caoxiongkun/qgroundcontrol,Icenowy/apm_planner,sutherlandm/apm_planner,chen0510566/apm_planner,xros/apm_planner,josephlewis42/UDenverQGC2,jy723/qgroundcontrol,devbharat/qgroundcontrol,greenoaktree/qgroundcontrol,abcdelf/apm_planner,Hunter522/qgroundcontrol,mihadyuk/qgroundcontrol,kd0aij/qgroundcontrol,dcarpy/apm_planner,dcarpy/apm_planner,kd0aij/qgroundcontrol,sutherlandm/apm_planner,diydrones/apm_planner,labtoast/apm_planner,abcdelf/apm_planner,dcarpy/apm_planner,iidioter/qgroundcontrol,lis-epfl/qgroundcontrol,hejunbok/qgroundcontrol,greenoaktree/qgroundcontrol,kd0aij/qgroundcontrol,TheIronBorn/qgroundcontrol,UAVenture/qgroundcontrol,RedoXyde/PX4_qGCS,gpaes/apm_planner,Icenowy/apm_planner,LIKAIMO/qgroundcontrol,jy723/qgroundcontrol,sverling/qgc_asl,381426068/apm_planner,WorkerBees/apm_planner,hejunbok/qgroundcontrol,sverling/qgc_asl,TheIronBorn/qgroundcontrol,devbharat/qgroundcontrol,diydrones/apm_planner,xros/apm_planner,remspoor/qgroundcontrol,hejunbok/apm_planner,chen0510566/apm_planner,LIKAIMO/qgroundcontrol,LIKAIMO/apm_planner,remspoor/qgroundcontrol,labtoast/apm_planner,devbharat/qgroundcontrol,abcdelf/apm_planner,CornerOfSkyline/qgroundcontrol,chen0510566/apm_planner,abcdelf/apm_planner,greenoaktree/qgroundcontrol,UAVenture/qgroundcontrol,dagoodma/qgroundcontrol,devbharat/qgroundcontrol,diydrones/apm_planner,LIKAIMO/apm_planner,catch-twenty-two/qgroundcontrol,Icenowy/apm_planner,catch-twenty-two/qgroundcontrol,iidioter/qgroundcontrol,dagoodma/qgroundcontrol,xros/apm_planner,scott-eddy/qgroundcontrol,WorkerBees/apm_planner,kellyschrock/apm_planner,hejunbok/apm_planner,scott-eddy/qgroundcontrol,LIKAIMO/qgroundcontrol,BMP-TECH/qgroundcontrol,Icenowy/apm_planner,mrpilot2/apm_planner,gpaes/apm_planner,mihadyuk/qgroundcontrol,remspoor/qgroundcontrol,nado1688/qgroundcontrol,remspoor/qgroundcontrol,scott-eddy/qgroundcontrol,UAVenture/qgroundcontrol,cfelipesouza/qgroundcontrol,RedoXyde/PX4_qGCS,kellyschrock/apm_planner,lis-epfl/qgroundcontrol,fizzaly/qgroundcontrol,dagoodma/qgroundcontrol,xros/apm_planner,caoxiongkun/qgroundcontrol,381426068/apm_planner,LIKAIMO/apm_planner,UAVenture/qgroundcontrol,greenoaktree/qgroundcontrol,duststorm/apm_planner,fizzaly/qgroundcontrol,remspoor/qgroundcontrol,catch-twenty-two/qgroundcontrol,lis-epfl/qgroundcontrol,kd0aij/qgroundcontrol,cfelipesouza/qgroundcontrol,kellyschrock/apm_planner,CornerOfSkyline/qgroundcontrol,TheIronBorn/qgroundcontrol,hejunbok/apm_planner,iidioter/qgroundcontrol,mirkix/apm_planner,dagoodma/qgroundcontrol,josephlewis42/UDenverQGC2,hejunbok/qgroundcontrol,LittleBun/apm_planner,chen0510566/apm_planner,Hunter522/qgroundcontrol,Hunter522/qgroundcontrol,RedoXyde/PX4_qGCS,ethz-asl/qgc_asl,fizzaly/qgroundcontrol,hejunbok/qgroundcontrol,dagoodma/qgroundcontrol,abcdelf/apm_planner,lis-epfl/qgroundcontrol,mrpilot2/apm_planner,nado1688/qgroundcontrol,scott-eddy/qgroundcontrol,labtoast/apm_planner,labtoast/apm_planner,mrpilot2/apm_planner,dcarpy/apm_planner,chen0510566/apm_planner,labtoast/apm_planner,cfelipesouza/qgroundcontrol,xros/apm_planner,caoxiongkun/qgroundcontrol,kellyschrock/apm_planner,LIKAIMO/apm_planner,duststorm/apm_planner,xros/apm_planner,josephlewis42/UDenverQGC2,WorkerBees/apm_planner,nado1688/qgroundcontrol,abcdelf/apm_planner,UAVenture/qgroundcontrol,chen0510566/apm_planner,nado1688/qgroundcontrol,RedoXyde/PX4_qGCS,mrpilot2/apm_planner,hejunbok/apm_planner,BMP-TECH/qgroundcontrol,iidioter/qgroundcontrol,sutherlandm/apm_planner,mirkix/apm_planner,kellyschrock/apm_planner,scott-eddy/qgroundcontrol,mihadyuk/qgroundcontrol,ethz-asl/qgc_asl,remspoor/qgroundcontrol,CornerOfSkyline/qgroundcontrol,RedoXyde/PX4_qGCS,kd0aij/qgroundcontrol,ethz-asl/qgc_asl,iidioter/qgroundcontrol,nado1688/qgroundcontrol,fizzaly/qgroundcontrol,sverling/qgc_asl,jy723/qgroundcontrol,nado1688/qgroundcontrol,BMP-TECH/qgroundcontrol,Hunter522/qgroundcontrol,devbharat/qgroundcontrol,LittleBun/apm_planner,sverling/qgc_asl,mrpilot2/apm_planner,cfelipesouza/qgroundcontrol
57d1526e288953b4a419bcd2f32da885cdbebcf6
src/cpp2/expr_tok.h
src/cpp2/expr_tok.h
#ifndef EXPR_TOK_H #define EXPR_TOK_H extern expr_n tok_cur_num; extern enum tok { tok_ident = -1, tok_num = -2, tok_eof = 0, tok_lparen = '(', tok_rparen = ')', /* operators returned as char-value, * except for double-char ops */ /* binary */ tok_multiply = '*', tok_divide = '/', tok_modulus = '%', tok_plus = '+', tok_minus = '-', tok_xor = '^', tok_or = '|', tok_and = '&', tok_orsc = -1, tok_andsc = -2, tok_shiftl = -3, tok_shiftr = -4, /* unary - TODO */ tok_not = '!', tok_bnot = '~', /* comparison */ tok_eq = -5, tok_ne = -6, tok_le = -7, tok_lt = '<', tok_ge = -8, tok_gt = '>', /* ternary */ tok_question = '?', tok_colon = ':', #define MIN_OP -8 } tok_cur; void tok_next(void); void tok_begin(char *); const char *tok_last(void); #endif
#ifndef EXPR_TOK_H #define EXPR_TOK_H extern expr_n tok_cur_num; extern enum tok { tok_ident = -1, tok_num = -2, tok_eof = 0, tok_lparen = '(', tok_rparen = ')', /* operators returned as char-value, * except for double-char ops */ /* binary */ tok_multiply = '*', tok_divide = '/', tok_modulus = '%', tok_plus = '+', tok_minus = '-', tok_xor = '^', tok_or = '|', tok_and = '&', tok_orsc = -3, tok_andsc = -4, tok_shiftl = -5, tok_shiftr = -6, /* unary - TODO */ tok_not = '!', tok_bnot = '~', /* comparison */ tok_eq = -7, tok_ne = -8, tok_le = -9, tok_lt = '<', tok_ge = -10, tok_gt = '>', /* ternary */ tok_question = '?', tok_colon = ':', #define MIN_OP -10 } tok_cur; void tok_next(void); void tok_begin(char *); const char *tok_last(void); #endif
Fix clash in cpp tokens
Fix clash in cpp tokens
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
c4187c9c4b352f48252afe0ee30fa93d84e692a5
include/lib/cpus/aarch64/neoverse_e1.h
include/lib/cpus/aarch64/neoverse_e1.h
/* * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef NEOVERSE_E1_H #define NEOVERSE_E1_H #include <lib/utils_def.h> #define NEOVERSE_E1_MIDR U(0x410FD060) /******************************************************************************* * CPU Extended Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_ECTLR_EL1 S3_0_C15_C1_4 /******************************************************************************* * CPU Auxiliary Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_CPUACTLR_EL1 S3_0_C15_C1_0 /******************************************************************************* * CPU Power Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_CPUPWRCTLR_EL1 S3_0_C15_C2_7 #define NEOVERSE_E1_CPUPWRCTLR_EL1_CORE_PWRDN_BIT (U(1) << 0) #endif /* NEOVERSE_E1_H */
/* * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef NEOVERSE_E1_H #define NEOVERSE_E1_H #include <lib/utils_def.h> #define NEOVERSE_E1_MIDR U(0x410FD4A0) /******************************************************************************* * CPU Extended Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_ECTLR_EL1 S3_0_C15_C1_4 /******************************************************************************* * CPU Auxiliary Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_CPUACTLR_EL1 S3_0_C15_C1_0 /******************************************************************************* * CPU Power Control register specific definitions. ******************************************************************************/ #define NEOVERSE_E1_CPUPWRCTLR_EL1 S3_0_C15_C2_7 #define NEOVERSE_E1_CPUPWRCTLR_EL1_CORE_PWRDN_BIT (U(1) << 0) #endif /* NEOVERSE_E1_H */
Fix wrong MIDR_EL1 value for Neoverse E1
Fix wrong MIDR_EL1 value for Neoverse E1 Change-Id: I75ee39d78c81ecb528a671c0cfadfc2fe7b5d818 Signed-off-by: John Tsichritzis <[email protected]>
C
bsd-3-clause
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
e6b9ebba53038ac4d1e2377ebdd15359c28368cb
lib/asan/interception/interception_linux.h
lib/asan/interception/interception_linux.h
//===-- interception_linux.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Linux-specific interception methods. //===----------------------------------------------------------------------===// #ifdef __linux__ #if !defined(INCLUDED_FROM_INTERCEPTION_LIB) # error "interception_mac.h should be included from interception library only" #endif #ifndef INTERCEPTION_LINUX_H #define INTERCEPTION_LINUX_H namespace __interception { // returns true if a function with the given name was found. bool GetRealFunctionAddress(const char *func_name, void **func_addr); } // namespace __interception #define INTERCEPT_FUNCTION_LINUX(func) \ ::__interception::GetRealFunctionAddress(#func, (void**)&REAL(func)) #endif // INTERCEPTION_LINUX_H #endif // __linux__
//===-- interception_linux.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Linux-specific interception methods. //===----------------------------------------------------------------------===// #ifdef __linux__ #if !defined(INCLUDED_FROM_INTERCEPTION_LIB) # error "interception_linux.h should be included from interception library only" #endif #ifndef INTERCEPTION_LINUX_H #define INTERCEPTION_LINUX_H namespace __interception { // returns true if a function with the given name was found. bool GetRealFunctionAddress(const char *func_name, void **func_addr); } // namespace __interception #define INTERCEPT_FUNCTION_LINUX(func) \ ::__interception::GetRealFunctionAddress(#func, (void**)&REAL(func)) #endif // INTERCEPTION_LINUX_H #endif // __linux__
Fix a wrong filename mentioned in a comment
[ASan] Fix a wrong filename mentioned in a comment git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@151145 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
d202d7b2059eb440c044477993a6e0d6aa4d5086
app/tests/test_device_msg_deserialize.c
app/tests/test_device_msg_deserialize.c
#include <assert.h> #include <string.h> #include "device_msg.h" #include <stdio.h> static void test_deserialize_clipboard(void) { const unsigned char input[] = { DEVICE_MSG_TYPE_CLIPBOARD, 0x00, 0x03, // text length 0x41, 0x42, 0x43, // "ABC" }; struct device_msg msg; ssize_t r = device_msg_deserialize(input, sizeof(input), &msg); assert(r == 6); assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD); assert(msg.clipboard.text); assert(!strcmp("ABC", msg.clipboard.text)); device_msg_destroy(&msg); } int main(void) { test_deserialize_clipboard(); return 0; }
#include <assert.h> #include <string.h> #include "device_msg.h" #include <stdio.h> static void test_deserialize_clipboard(void) { const unsigned char input[] = { DEVICE_MSG_TYPE_CLIPBOARD, 0x00, 0x03, // text length 0x41, 0x42, 0x43, // "ABC" }; struct device_msg msg; ssize_t r = device_msg_deserialize(input, sizeof(input), &msg); assert(r == 6); assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD); assert(msg.clipboard.text); assert(!strcmp("ABC", msg.clipboard.text)); device_msg_destroy(&msg); } static void test_deserialize_clipboard_big(void) { unsigned char input[DEVICE_MSG_SERIALIZED_MAX_SIZE]; input[0] = DEVICE_MSG_TYPE_CLIPBOARD; input[1] = DEVICE_MSG_TEXT_MAX_LENGTH >> 8; // MSB input[2] = DEVICE_MSG_TEXT_MAX_LENGTH & 0xff; // LSB memset(input + 3, 'a', DEVICE_MSG_TEXT_MAX_LENGTH); struct device_msg msg; ssize_t r = device_msg_deserialize(input, sizeof(input), &msg); assert(r == DEVICE_MSG_SERIALIZED_MAX_SIZE); assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD); assert(msg.clipboard.text); assert(strlen(msg.clipboard.text) == DEVICE_MSG_TEXT_MAX_LENGTH); assert(msg.clipboard.text[0] == 'a'); device_msg_destroy(&msg); } int main(void) { test_deserialize_clipboard(); test_deserialize_clipboard_big(); return 0; }
Add unit test for big clipboard device message
Add unit test for big clipboard device message Test clipboard synchronization from the device to the computer.
C
apache-2.0
Genymobile/scrcpy,Genymobile/scrcpy,Genymobile/scrcpy
89f7600802d05329facf46d92910ad8b1bdc642d
libmue/tests/test_guest_tuple_iterator.h
libmue/tests/test_guest_tuple_iterator.h
#ifndef TEST_GUEST_TUPLE_ITERATOR_H #define TEST_GUEST_TUPLE_ITERATOR_H #include <cxxtest/TestSuite.h> #include <unordered_set> #include <vector> #include "teams.h" #include "guest_tuple_iterator.h" class TestSeenTable : public CxxTest::TestSuite { private: std::vector<mue::Team> make_testteams(int num) { std::vector<mue::Team> teams; for (mue::Team_id i = 0; i < num; ++i) teams.push_back(mue::Team(i)); return teams; } public: void testFooBar(void) { } }; #endif
#ifndef TEST_GUEST_TUPLE_ITERATOR_H #define TEST_GUEST_TUPLE_ITERATOR_H #include <cxxtest/TestSuite.h> #include <unordered_set> #include <vector> #include "teams.h" #include "guest_tuple_iterator.h" class TestSeenTable : public CxxTest::TestSuite { public: void testFooBar(void) { } }; #endif
Clean skel for guest tuple iterator tests
Clean skel for guest tuple iterator tests Signed-off-by: Jan Losinski <[email protected]>
C
bsd-3-clause
janLo/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool
a7bbc288ca4149eb804a9e5152c33dbe07f431fe
src/rtcmix/funderflow.c
src/rtcmix/funderflow.c
#ifdef sgi #include <sys/fpu.h> /* THE FOLLOWING FUNCTION sets the special "flush zero" but (FS, bit 24) in the Control Status Register of the FPU of R4k and beyond so that the result of any underflowing operation will be clamped to zero, and no exception of any kind will be generated on the CPU. This has no effect on an R3000. */ void flush_all_underflows_to_zero() { union fpc_csr f; f.fc_word = get_fpc_csr(); f.fc_struct.flush = 1; set_fpc_csr(f.fc_word); } #endif #ifdef LINUX #include <stdio.h> #include <signal.h> #include <unistd.h> void sigfpe_handler(int sig) { fprintf(stderr, "\nRTcmix FATAL ERROR: floating point exception halted process.\n"); exit(1); } #endif
#ifdef sgi #include <sys/fpu.h> /* THE FOLLOWING FUNCTION sets the special "flush zero" but (FS, bit 24) in the Control Status Register of the FPU of R4k and beyond so that the result of any underflowing operation will be clamped to zero, and no exception of any kind will be generated on the CPU. This has no effect on an R3000. */ void flush_all_underflows_to_zero() { union fpc_csr f; f.fc_word = get_fpc_csr(); f.fc_struct.flush = 1; set_fpc_csr(f.fc_word); } #endif #ifdef LINUX #include <stdio.h> #include <stdlib.h> #include <signal.h> void sigfpe_handler(int sig) { fprintf(stderr, "\nRTcmix FATAL ERROR: floating point exception halted process.\n"); exit(1); } #endif
Fix include from last checkin.
Fix include from last checkin.
C
apache-2.0
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
a8037f55854706a8d4c66e71ab14f8f3628ae4ee
cc1/tests/test061.c
cc1/tests/test061.c
/* name: TEST061 description: Test for macros without arguments but with parenthesis error: output: G3 I F "main { \ h #I1 } */ #define X (2) #define L (0) #define H (1) #define Q(x) x int main(void) { return X == L + H + Q(1); }
Add test for non macro alike functions with paranthesis
[cc1] Add test for non macro alike functions with paranthesis
C
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
6541894e50b82b4f2f2dd5a875ee37c5645f6c85
JTFadingInfoViewController/JTFadingInfoViewController.h
JTFadingInfoViewController/JTFadingInfoViewController.h
// // JTFadingInfoViewController.h // JTFadingInfoViewController // // Created by DCL_JT on 2015/07/29. // Copyright (c) 2015年 Junichi Tsurukawa. All rights reserved. // #import <UIKit/UIKit.h> @interface JTFadingInfoViewController : UIViewController @end
// // JTFadingInfoViewController.h // JTFadingInfoViewController // // Created by DCL_JT on 2015/07/29. // Copyright (c) 2015年 Junichi Tsurukawa. All rights reserved. // #import <UIKit/UIKit.h> #pragma mark - Fade in/out options typedef enum { FadeInFromAbove = 1, FadeInFromBelow, FadeInFromLeft, FadeInFromRight } FadeInType; typedef enum { FadeOutToAbove = 1, FadeOutToBelow, FadeOutToLeft, FadeOutToRight } FadeOutType; @interface JTFadingInfoViewController : UIViewController #pragma mark - Functions /* * Add subView with Selected Type of Fading in. * * @param view A view to be added. * @param fadeType A Type of Fading when appering. * */ - (void)addSubView:(UIView *)view WithFade:(FadeInType)fadeType; /* * Remove subView from SuperView with Selected Type of Fading out. * * @param fadeType A Type of Fading when disappering. * */ - (void)removeFromSuperViewWithFade: (FadeInType)fadeType; /* * ~SOME DESCRIPTION GOES HERE~ * * @param fadeInType A Type of Fading when appering. * * @param duration Time for displaying the view. * * @param fadeOutType A Type of Fading when disappering. */ - (void)showSubView: (UIView *)view withAppearType: (FadeInType)fadeInType showDuration: (float)duration withDisapperType: (FadeOutType)fadeOutType; #pragma mark - Properties #pragma Shadow /** A Boolean value for whether the shadow effect is enabled or not. */ @property BOOL isShadowEnabled; #pragma Animatoins /** A float represeting the time for displaying this view itself. If 0, view will not disapper */ @property float displayDuration; /** A float representing the time the view is appeared by. */ @property float appearingDuration; /** A float representing the time the view is disappeared by. */ @property float disappearingDuration; @end
Determine initial properties and functions
Determine initial properties and functions
C
mit
mohsinalimat/JTFadingInfoView,JunichiT/JTFadingInfoView,machelix/JTFadingInfoView,gaurav1981/JTFadingInfoView,carabina/JTFadingInfoView
1a10f81750d935eaf84b6ea02d39201471b5fa84
pmpa_internals.h
pmpa_internals.h
/* * pmpa_internals.h * Part of pmpa * Copyright (c) 2014 Philip Wernersbach * * Dual-Licensed under the Public Domain and the Unlicense. * Choose the one that you prefer. */ #ifndef HAVE_PMPA_INTERNALS_H #include <stdbool.h> #include <pmpa.h> typedef struct { pmpa_memory_int size; bool allocated; char data; } pmpa_memory_block; #define PMPA_MEMORY_BLOCK_HEADER_SIZE ( sizeof(pmpa_memory_int) + sizeof(bool) ) #ifdef PMPA_UNIT_TEST #define PMPA_STATIC_UNLESS_TESTING extern PMPA_STATIC_UNLESS_TESTING __thread pmpa_memory_block *master_memory_block; extern PMPA_STATIC_UNLESS_TESTING __thread pmpa_memory_int master_memory_block_size; #else #define PMPA_STATIC_UNLESS_TESTING static #endif #define HAVE_PMPA_INTERNALS_H #endif
/* * pmpa_internals.h * Part of pmpa * Copyright (c) 2014 Philip Wernersbach * * Dual-Licensed under the Public Domain and the Unlicense. * Choose the one that you prefer. */ #ifndef HAVE_PMPA_INTERNALS_H #include <stddef.h> #include <stdbool.h> #include <pmpa.h> typedef struct { pmpa_memory_int size; bool allocated; char data; } pmpa_memory_block; #define PMPA_MEMORY_BLOCK_HEADER_SIZE ( offsetof(pmpa_memory_block, data) ) #ifdef PMPA_UNIT_TEST #define PMPA_STATIC_UNLESS_TESTING extern PMPA_STATIC_UNLESS_TESTING __thread pmpa_memory_block *master_memory_block; extern PMPA_STATIC_UNLESS_TESTING __thread pmpa_memory_int master_memory_block_size; #else #define PMPA_STATIC_UNLESS_TESTING static #endif #define HAVE_PMPA_INTERNALS_H #endif
Use offsetof() to compute the memory block header size.
Use offsetof() to compute the memory block header size. On compilers that don’t pad structs to alignment, this is equivalent to using the sizeof() method. On compilers that do pad structs to alignment, the sizeof() method will yield the wrong size, whereas this method will work.
C
unlicense
philip-wernersbach/memory-pool-allocator
de3c64e26ebd118771a85932b964a52acd7c7287
payload/Bmp180.h
payload/Bmp180.h
#ifndef RCR_LEVEL1PAYLOAD_BMP180_H_ #define RCR_LEVEL1PAYLOAD_BMP180_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_BMP180_H_
Add header for Bmp custom type
Add header for Bmp custom type
C
mit
nolanholden/geovis,nolanholden/geovis,nolanholden/geovis,nolanholden/payload-level1-rocket
a6b11e049ace86d58eb016015b598c5b8ed1655c
MagicalRecord/Categories/DataImport/MagicalImportFunctions.h
MagicalRecord/Categories/DataImport/MagicalImportFunctions.h
// // MagicalImportFunctions.h // Magical Record // // Created by Saul Mora on 3/7/12. // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. // #import <Foundation/Foundation.h> #import <MagicalRecord/MagicalRecordXcode7CompatibilityMacros.h> NSDateFormatter * __MR_nonnull MR_dateFormatterWithFormat(NSString *format); NSDate * __MR_nonnull MR_adjustDateForDST(NSDate *__MR_nonnull date); NSDate * __MR_nonnull MR_dateFromString(NSString *__MR_nonnull value, NSString *__MR_nonnull format); NSDate * __MR_nonnull MR_dateFromNumber(NSNumber *__MR_nonnull value, BOOL milliseconds); NSNumber * __MR_nonnull MR_numberFromString(NSString *__MR_nonnull value); NSString * __MR_nonnull MR_attributeNameFromString(NSString *__MR_nonnull value); NSString * __MR_nonnull MR_primaryKeyNameFromString(NSString *__MR_nonnull value); #if TARGET_OS_IPHONE #import <UIKit/UIKit.h> UIColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor); #else #import <AppKit/AppKit.h> NSColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor); #endif NSInteger * __MR_nullable MR_newColorComponentsFromString(NSString *__MR_nonnull serializedColor);
// // MagicalImportFunctions.h // Magical Record // // Created by Saul Mora on 3/7/12. // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. // #import <Foundation/Foundation.h> #import <MagicalRecord/MagicalRecordXcode7CompatibilityMacros.h> NSDateFormatter * __MR_nonnull MR_dateFormatterWithFormat(NSString *__MR_nonnull format); NSDate * __MR_nonnull MR_adjustDateForDST(NSDate *__MR_nonnull date); NSDate * __MR_nonnull MR_dateFromString(NSString *__MR_nonnull value, NSString *__MR_nonnull format); NSDate * __MR_nonnull MR_dateFromNumber(NSNumber *__MR_nonnull value, BOOL milliseconds); NSNumber * __MR_nonnull MR_numberFromString(NSString *__MR_nonnull value); NSString * __MR_nonnull MR_attributeNameFromString(NSString *__MR_nonnull value); NSString * __MR_nonnull MR_primaryKeyNameFromString(NSString *__MR_nonnull value); #if TARGET_OS_IPHONE #import <UIKit/UIKit.h> UIColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor); #else #import <AppKit/AppKit.h> NSColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor); #endif NSInteger * __MR_nullable MR_newColorComponentsFromString(NSString *__MR_nonnull serializedColor);
Add the missing nullability annotation
Add the missing nullability annotation
C
mit
yiplee/MagicalRecord,yiplee/MagicalRecord
9ebc8db0a72fd67a73e7a1e0c371d41b2b1f6bdf
main/main_gpio.c
main/main_gpio.c
#include <stdio.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include "esp_wifi.h" #include "esp_system.h" void app_main(void) { gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT); int level = 0; while (true) { printf("Hello, world.\n"); gpio_set_level(GPIO_NUM_5, level); level = !level; vTaskDelay(1000 / portTICK_PERIOD_MS); } }
#include <stdio.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include "esp_wifi.h" #include "esp_system.h" void app_main(void) { gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT); int level = 0; while (true) { printf("Hello, world.\n"); gpio_set_level(GPIO_NUM_5, level); level = !level; vTaskDelay(500 / portTICK_PERIOD_MS); } }
Speed up default blink to disambiguate from default program on Sparkfun board.
Speed up default blink to disambiguate from default program on Sparkfun board.
C
apache-2.0
cmason1978/esp32-examples,cmason1978/esp32-examples
279443da2f3938554c2e99abf77ff00acb3ec889
test/Driver/at_file_missing.c
test/Driver/at_file_missing.c
// Make sure that arguments that begin with @ are left as is in the argument // stream, and also that @file arguments continue to be processed. // RUN: echo "%s -D FOO" > %t.args // RUN: %clang -rpath @executable_path/../lib @%t.args -### 2>&1 | FileCheck %s // CHECK: "-D" "FOO" // CHECK: "-rpath" "@executable_path/../lib"
Check that @ arguments that aren't files are handled
test/Driver: Check that @ arguments that aren't files are handled This tests the bug fix in llvm r196620. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196621 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
ab28a98e50d0b686a4e4f2343459b2ff4a1812ec
include/aerial_autonomy/actions_guards/land_functors.h
include/aerial_autonomy/actions_guards/land_functors.h
#pragma once #include <aerial_autonomy/actions_guards/base_functors.h> #include <aerial_autonomy/logic_states/base_state.h> #include <aerial_autonomy/robot_systems/uav_system.h> #include <aerial_autonomy/basic_events.h> #include <aerial_autonomy/types/completed_event.h> #include <parsernode/common.h> using namespace basic_events; template <class LogicStateMachineT> struct LandTransitionActionFunctor_ : ActionFunctor<Land, UAVSystem, LogicStateMachineT> { void run(const Land &, UAVSystem &robot_system, LogicStateMachineT &) { robot_system.land(); } }; // TODO (Gowtham) How to abort Land?? template <class LogicStateMachineT> struct LandInternalActionFunctor_ : InternalActionFunctor<UAVSystem, LogicStateMachineT> { void run(const InternalTransitionEvent &, UAVSystem &robot_system, LogicStateMachineT &logic_state_machine) { parsernode::common::quaddata data = robot_system.getUAVData(); // Can also use uav status here TODO (Gowtham) if (data.altitude < 0.1) { logic_state_machine.process_event(Completed()); } } }; template <class LogicStateMachineT> using Landing_ = BaseState<UAVSystem, LogicStateMachineT, LandInternalActionFunctor_<LogicStateMachineT>>;
#pragma once #include <aerial_autonomy/actions_guards/base_functors.h> #include <aerial_autonomy/logic_states/base_state.h> #include <aerial_autonomy/robot_systems/uav_system.h> #include <aerial_autonomy/basic_events.h> #include <aerial_autonomy/types/completed_event.h> #include <parsernode/common.h> using namespace basic_events; template <class LogicStateMachineT> struct LandTransitionActionFunctor_ : ActionFunctor<Land, UAVSystem, LogicStateMachineT> { void run(const Land &, UAVSystem &robot_system, LogicStateMachineT &) { robot_system.land(); } }; // TODO (Gowtham) How to abort Land?? template <class LogicStateMachineT> struct LandInternalActionFunctor_ : InternalActionFunctor<UAVSystem, LogicStateMachineT> { void run(const InternalTransitionEvent &, UAVSystem &robot_system, LogicStateMachineT &logic_state_machine) { parsernode::common::quaddata data = robot_system.getUAVData(); std::cout << data.altitude << std::endl; // Can also use uav status here TODO (Gowtham) if (data.altitude < 0.1) { logic_state_machine.process_event(Completed()); } } }; template <class LogicStateMachineT> using Landing_ = BaseState<UAVSystem, LogicStateMachineT, LandInternalActionFunctor_<LogicStateMachineT>>;
Add tests for land, takeoff, position control funs
Add tests for land, takeoff, position control funs
C
mpl-2.0
jhu-asco/aerial_autonomy,jhu-asco/aerial_autonomy,jhu-asco/aerial_autonomy,jhu-asco/aerial_autonomy,jhu-asco/aerial_autonomy,jhu-asco/aerial_autonomy
68165f179e1e617702fe640ccbeccf2e9eb7b6c3
src/aker_mem.c
src/aker_mem.c
/** * Copyright 2017 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <stdio.h> void *aker_malloc(size_t size) { return aker_malloc(size); } void aker_free (void *ptr) { aker_free(ptr); }
/** * Copyright 2017 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <stdio.h> void *aker_malloc(size_t size) { return malloc(size); } void aker_free (void *ptr) { free(ptr); }
Correct error on previous commit.
Correct error on previous commit.
C
apache-2.0
Comcast/aker,Comcast/aker
dc8b63122e4941d7b80e524b95884f390319eb9e
tests/regression/32-loop-termination/08-counter_for.c
tests/regression/32-loop-termination/08-counter_for.c
// PARAM: --enable dbg.debug --enable ana.int.interval int main() { int t1 = 0, t2 = 0; int i; for (i = 0; i < 5; i++) { t1++; t2--; } assert(t1 == i); //SUCCESS! t1 = 5; t2 = 5; for (i = 5; i > 0; i--) { t1++; t2--; } assert(t2 == i); //SUCCESS! t1 = 0; t2 = 0; for (i = 0; i < 5; i--) { t1++; t2--; } assert(t1 == i); //FAIL! return 0; }
Add an example for simple loops
Add an example for simple loops
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
32c7bf1139fd00449de620d569c0b717cdeeb927
BDSKDragImageView.h
BDSKDragImageView.h
// // BDSKDragImageView.h // Bibdesk // // Created by Christiaan Hofman on 28/11/05. /* This software is Copyright (c) 2005,2006,2007 Christiaan Hofman. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Christiaan Hofman nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import <Cocoa/Cocoa.h> @interface BDSKDragImageView : NSImageView { id delegate; BOOL highlight; } - (id)delegate; - (void)setDelegate:(id)newDelegate; @end @interface NSObject (BDSKDragImageViewDelegate) - (NSDragOperation)dragImageView:(BDSKDragImageView *)view validateDrop:(id <NSDraggingInfo>)sender; - (BOOL)dragImageView:(BDSKDragImageView *)view acceptDrop:(id <NSDraggingInfo>)sender; - (BOOL)dragImageView:(BDSKDragImageView *)view writeDataToPasteboard:(NSPasteboard *)pasteboard; - (NSArray *)dragImageView:(BDSKDragImageView *)view namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination; - (NSImage *)dragImageForDragImageView:(BDSKDragImageView *)view; @end
Copy dragImageView from bibdesk to skim
Copy dragImageView from bibdesk to skim
C
bsd-3-clause
JackieXie168/skim,JackieXie168/skim,JackieXie168/skim,JackieXie168/skim,JackieXie168/skim
0dc22e80a2b29f468249fc77945611a7283b8a32
tests/regression/27-inv_invariants/02-bot-during-condition.c
tests/regression/27-inv_invariants/02-bot-during-condition.c
int main () { int tmp; int p_9 = 60; tmp = (p_9 +1) % 0; if ((p_9 +1) % 0) { tmp = 1; } return (0); }
Add problematic example, bot in invariant
Add problematic example, bot in invariant
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
fad2a3cf8fd4c75268dc46bbc7dddb48baeddf14
src/datetime.c
src/datetime.c
/** * Copyright (c) 2015, Chao Wang <[email protected]> */ #include <time.h> #include <sys/time.h> /* Get timestamp (in milliseconds) for now. */ double datetime_stamp_now(void) { struct timeval tv; gettimeofday(&tv, NULL); return (1000000 * tv.tv_sec + tv.tv_usec) / 1000.0; }
/** * Copyright (c) 2015, Chao Wang <[email protected]> */ #include <assert.h> #include <time.h> #include <sys/time.h> /* Get timestamp (in milliseconds) for now. */ double datetime_stamp_now(void) { #if defined CLOCK_REALTIME struct timespec ts; int rc = clock_gettime(CLOCK_REALTIME, &ts); assert(rc == 0); return ts.tv_sec * 1000 + ts.tv_nsec / 1000000.0; #else struct timeval tv; gettimeofday(&tv, NULL); return (1000000 * tv.tv_sec + tv.tv_usec) / 1000.0; #endif }
Use clock_gettime if have (linux/bsd but not apple)
Use clock_gettime if have (linux/bsd but not apple)
C
bsd-2-clause
hit9/C-Snip,hit9/C-Snip
d494380487e6ed926ea0ef8a74ec2772022e9bed
content/common/child_process_messages.h
content/common/child_process_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. // Common IPC messages used for child processes. // Multiply-included message file, hence no include guard. #include "googleurl/src/gurl.h" #include "ipc/ipc_message_macros.h" #define IPC_MESSAGE_START ChildProcessMsgStart // Messages sent from the browser to the child process. // Tells the child process it should stop. IPC_MESSAGE_CONTROL0(ChildProcessMsg_AskBeforeShutdown) // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child // process that it's safe to shutdown. IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) #if defined(IPC_MESSAGE_LOG_ENABLED) // Tell the child process to begin or end IPC message logging. IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetIPCLoggingEnabled, bool /* on or off */) #endif // Messages sent from the child process to the browser. IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) // Get the list of proxies to use for |url|, as a semicolon delimited list // of "<TYPE> <HOST>:<PORT>" | "DIRECT". IPC_SYNC_MESSAGE_CONTROL1_2(ChildProcessHostMsg_ResolveProxy, GURL /* url */, int /* network error */, std::string /* proxy list */)
// 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. // Common IPC messages used for child processes. // Multiply-included message file, hence no include guard. #include "googleurl/src/gurl.h" #include "ipc/ipc_message_macros.h" #define IPC_MESSAGE_START ChildProcessMsgStart // Messages sent from the browser to the child process. // Tells the child process it should stop. IPC_MESSAGE_CONTROL0(ChildProcessMsg_AskBeforeShutdown) // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child // process that it's safe to shutdown. IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) #if defined(IPC_MESSAGE_LOG_ENABLED) // Tell the child process to begin or end IPC message logging. IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetIPCLoggingEnabled, bool /* on or off */) #endif // Messages sent from the child process to the browser. IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) // Get the list of proxies to use for |url|, as a semicolon delimited list // of "<TYPE> <HOST>:<PORT>" | "DIRECT". IPC_SYNC_MESSAGE_CONTROL1_2(ChildProcessHostMsg_ResolveProxy, GURL /* url */, int /* network error */, std::string /* proxy list */)
Add newline at end of file
Add newline at end of file git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@78227 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
adobe/chromium,ropik/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium
1b74f41ca76ba09230cdc8d4196a7c6e98092ca9
testmud/mud/home/Game/sys/bulkd.c
testmud/mud/home/Game/sys/bulkd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ object queue; static void create() { }
Add bulk sync daemon back again
Add bulk sync daemon back again
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
b2a8283ef2108adcb67e40c8abd5283b59d2b14f
Source/MMMarkdown.h
Source/MMMarkdown.h
// // MMMarkdown.h // MMMarkdown // // Copyright (c) 2012 Matt Diephouse. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Foundation/Foundation.h> @interface MMMarkdown : NSObject + (NSString *)HTMLStringWithMarkdown:(NSString *)string error:(__autoreleasing NSError **)error __attribute__((nonnull(1))); @end
// // MMMarkdown.h // MMMarkdown // // Copyright (c) 2012 Matt Diephouse. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Foundation/Foundation.h> @interface MMMarkdown : NSObject /*! Converts a Markdown string to HTML. * * @param string A Markdown string. Must not be nil. * @param error Out parameter used if an error occurs while parsing the Markdown. May be NULL. * @return An HTML string. */ + (NSString *)HTMLStringWithMarkdown:(NSString *)string error:(__autoreleasing NSError **)error __attribute__((nonnull(1))); @end
Add documentation that Xcode can find
Add documentation that Xcode can find
C
mit
jonesgithub/MMMarkdown,isaacroldan/MMMarkdown,mobilejazz/MMMarkdown,isaacroldan/AttributedMarkdown,albertbori/MMMarkdown,iosdev-republicofapps/MMMarkdown,gonefish/MMMarkdown,1aurabrown/MMMarkdown,1aurabrown/MMMarkdown,mdiep/MMMarkdown,isaacroldan/AttributedMarkdown,mobilejazz/MMMarkdown,AgileBits/MMMarkdown,isaacroldan/AttributedMarkdown,gonefish/MMMarkdown,iosdev-republicofapps/MMMarkdown,albertbori/MMMarkdown,jonesgithub/MMMarkdown,cnbin/MMMarkdown,AgileBits/MMMarkdown,isaacroldan/MMMarkdown,albertbori/MMMarkdown,mjzac/MMMarkdown,isaacroldan/AttributedMarkdown,isaacroldan/AttributedMarkdown,babbage/MMMarkdown,mdiep/MMMarkdown,babbage/MMMarkdown,cnbin/MMMarkdown,mjzac/MMMarkdown
ac59c3f410a9fbebed551cb0c05bfcf047adb2c4
TDTChocolate/TestingAdditions/XCTAssert+TDTAdditions.h
TDTChocolate/TestingAdditions/XCTAssert+TDTAdditions.h
#import <Foundation/Foundation.h> /** Custom asserts that provide better error messages when the assert fails. */ /** Assert that @p array contains @p object */ #define TDTXCTAssertContains(array, object) \ XCTAssertTrue([(array) containsObject:(object)], @"Expected %@ to contain %@", (array), (object)) /** Assert that @p string contains @p substring */ #define TDTXCTAssertContainsString(string, substring) \ XCTAssertTrue([(string) tdt_containsString:(substring)], @"Expected %@ to contain %@", (string), (substring)) /** Assert that @p a is <= @p b. */ #define TDTXCTAssertEarlierEqualDate(a, b) \ XCTAssertTrue([(a) tdt_isEarlierThanOrEqualToDate:(b)], @"Expected %@ to be earlier than or same as %@", (a), (b))
#import <Foundation/Foundation.h> /** Custom asserts that provide better error messages when the assert fails. */ /** Assert that @p array contains @p object */ #define TDTXCTAssertContains(array, object) \ XCTAssertTrue([(array) containsObject:(object)], @"Expected %@ to contain %@", (array), (object)) /** Assert that @p string contains @p substring */ #define TDTXCTAssertContainsString(string, substring) \ XCTAssertTrue([(string) tdt_containsString:(substring)], @"Expected %@ to contain %@", (string), (substring)) /** Assert that @p a is <= @p b. */ #define TDTXCTAssertEarlierThanOrEqualToDate(a, b) \ XCTAssertTrue([(a) tdt_isEarlierThanOrEqualToDate:(b)], @"Expected %@ to be earlier than or equal to %@", (a), (b))
Rename the custom assert name to reflect the underlying method
Rename the custom assert name to reflect the underlying method
C
bsd-3-clause
talk-to/Chocolate,talk-to/Chocolate
c72770ef3ba510bd83746aadbc3aa1b7e6b328bf
src/math/p_inv.c
src/math/p_inv.c
#include <pal.h> /** * * Element wise inversion (reciprocal) of elements in 'a'. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ #include <math.h> void p_inv_f32(const float *a, float *c, int n, int p, p_team_t team) { int i; float cur; for (i = 0; i < n; i++) { cur = *(a + i); union { float f; uint32_t x; } u = {cur}; /* First approximation */ u.x = 0x7EF312AC - u.x; /* Refine */ u.f = u.f * (2 - u.f * cur); u.f = u.f * (2 - u.f * cur); *(c + i) = u.f; } }
#include <pal.h> /** * * Element wise inversion (reciprocal) of elements in 'a'. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ #include <math.h> void p_inv_f32(const float *a, float *c, int n, int p, p_team_t team) { int i; float cur; for (i = 0; i < n; i++) { cur = *(a + i); union { float f; uint32_t x; } u = {cur}; /* First approximation */ u.x = 0x7EF312AC - u.x; /* Refine */ u.f = u.f * (2 - u.f * cur); u.f = u.f * (2 - u.f * cur); *(c + i) = u.f; } }
Use spaces instead of tabs
Use spaces instead of tabs
C
apache-2.0
debug-de-su-ka/pal,parallella/pal,Adamszk/pal3,Adamszk/pal3,olajep/pal,Adamszk/pal3,parallella/pal,mateunho/pal,8l/pal,aolofsson/pal,RafaelRMA/pal,debug-de-su-ka/pal,eliteraspberries/pal,mateunho/pal,mateunho/pal,aolofsson/pal,mateunho/pal,eliteraspberries/pal,debug-de-su-ka/pal,aolofsson/pal,eliteraspberries/pal,parallella/pal,RafaelRMA/pal,olajep/pal,8l/pal,debug-de-su-ka/pal,8l/pal,RafaelRMA/pal,parallella/pal,parallella/pal,Adamszk/pal3,eliteraspberries/pal,olajep/pal,8l/pal,aolofsson/pal,olajep/pal,debug-de-su-ka/pal,eliteraspberries/pal,RafaelRMA/pal,mateunho/pal
0cd7de8ba17d298d89e6dd8680982607c49239b7
include/orvibo.h
include/orvibo.h
#ifndef ORVIBO_H #define ORVIBO_H #include <net/ethernet.h> #include <stdbool.h> enum orvibo_event { ORVIBO_EVENT_DISCOVER, ORVIBO_EVENT_SUBSCRIBE, ORVIBO_EVENT_UNSUBSCRIBE, ORVIBO_EVENT_OFF, ORVIBO_EVENT_ON }; enum orvibo_state { ORVIBO_STATE_UNKNOWN, ORVIBO_STATE_OFF, ORVIBO_STATE_ON }; struct orvibo_socket; typedef void (*ORVIBO_EVENT_HANDLER) (struct orvibo_socket *, enum orvibo_event); bool orvibo_start(ORVIBO_EVENT_HANDLER handler); bool orvibo_stop(void); struct orvibo_socket * orvibo_socket_create(const unsigned char mac[static ETHER_ADDR_LEN]); void orvibo_socket_destroy(struct orvibo_socket *socket); const unsigned char * orvibo_socket_mac(const struct orvibo_socket *socket); const char * orvibo_socket_ip(const struct orvibo_socket *socket); bool orvibo_socket_subscribed(const struct orvibo_socket *socket); enum orvibo_state orvibo_socket_state(const struct orvibo_socket *socket); bool orvibo_socket_discover(struct orvibo_socket *socket); bool orvibo_socket_subscribe(struct orvibo_socket *socket); bool orvibo_socket_unsubscribe(struct orvibo_socket *socket); bool orvibo_socket_off(struct orvibo_socket *socket); bool orvibo_socket_on(struct orvibo_socket *socket); #endif
Add header file for public interface
Add header file for public interface
C
bsd-3-clause
OllieDay/orvibo,OllieDay/orvibo
7ca370ebec19fe07ddee0dbea32c99c386ac7078
Sources/SPTPersistentCacheFileManager+Private.h
Sources/SPTPersistentCacheFileManager+Private.h
#import "SPTPersistentCacheFileManager.h" #import <SPTPersistentCache/SPTPersistentCacheOptions.h> NS_ASSUME_NONNULL_BEGIN /// Private interface exposed for testability. @interface SPTPersistentCacheFileManager () @property (nonatomic, copy, readonly) SPTPersistentCacheOptions *options; @property (nonatomic, copy, readonly, nullable) SPTPersistentCacheDebugCallback debugOutput; @property (nonatomic, strong, readonly) NSFileManager *fileManager; @end NS_ASSUME_NONNULL_END
/* * Copyright (c) 2016 Spotify AB. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #import "SPTPersistentCacheFileManager.h" #import <SPTPersistentCache/SPTPersistentCacheOptions.h> NS_ASSUME_NONNULL_BEGIN /// Private interface exposed for testability. @interface SPTPersistentCacheFileManager () @property (nonatomic, copy, readonly) SPTPersistentCacheOptions *options; @property (nonatomic, copy, readonly, nullable) SPTPersistentCacheDebugCallback debugOutput; @property (nonatomic, strong, readonly) NSFileManager *fileManager; @end NS_ASSUME_NONNULL_END
Add license header to private file manager header
Add license header to private file manager header
C
apache-2.0
FootballAddicts/SPTPersistentCache,FootballAddicts/SPTPersistentCache,chrisbtreats/SPTPersistentCache,chrisbtreats/SPTPersistentCache,spotify/SPTPersistentCache,FootballAddicts/SPTPersistentCache,spotify/SPTPersistentCache,spotify/SPTPersistentCache,chrisbtreats/SPTPersistentCache,FootballAddicts/SPTPersistentCache,chrisbtreats/SPTPersistentCache
00e405ede61e419754bb4a82f0c4c384301db9d1
runtime/test/ompt/misc/unset_callback.c
runtime/test/ompt/misc/unset_callback.c
// RUN: %libomp-compile-and-run | FileCheck %s // REQUIRES: ompt #include "callback.h" #include <omp.h> int main() { #pragma omp parallel num_threads(1) { } ompt_set_callback(ompt_callback_parallel_begin, NULL); #pragma omp parallel num_threads(1) { } // Check if libomp supports the callbacks for this test. // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_idle' // CHECK: 0: NULL_POINTER=[[NULL:.*$]] // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_parallel_begin: // CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end: // CHECK-NOT: {{^}}[[THREAD_ID]]: ompt_event_parallel_begin: // CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end: return 0; }
Add missing test case from D41171 commit
Add missing test case from D41171 commit git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@321270 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp
c4551d3d21053281cb36d89796948c9957b708b4
include/llvm/System/Atomic.h
include/llvm/System/Atomic.h
//===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares the llvm::sys atomic operations. // //===----------------------------------------------------------------------===// #ifndef LLVM_SYSTEM_ATOMIC_H #define LLVM_SYSTEM_ATOMIC_H #include <stdint.h> namespace llvm { namespace sys { void MemoryFence(); typedef uint32_t cas_flag; cas_flag CompareAndSwap(volatile cas_flag* ptr, cas_flag new_value, cas_flag old_value); } } #endif
//===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares the llvm::sys atomic operations. // //===----------------------------------------------------------------------===// #ifndef LLVM_SYSTEM_ATOMIC_H #define LLVM_SYSTEM_ATOMIC_H #include "llvm/Support/DataTypes.h" namespace llvm { namespace sys { void MemoryFence(); typedef uint32_t cas_flag; cas_flag CompareAndSwap(volatile cas_flag* ptr, cas_flag new_value, cas_flag old_value); } } #endif
Use DataTypes.h instead of stdint.h.
Use DataTypes.h instead of stdint.h. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@72201 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm
7c043e3049a6ec1b718208221ea4eed0d74e1ecd
bindings/f95/plflt.c
bindings/f95/plflt.c
/* Auxiliary program: write the include file for determining PLplot's floating-point type */ #include <stdio.h> #include <stdlib.h> #include "plConfig.h" main(int argc, char *argv[] ) { FILE *outfile; char *kind; outfile = fopen( "plflt.inc", "w" ) ; #ifdef PL_DOUBLE kind = "1.0d0"; #else kind = "1.0"; #endif fprintf( outfile, "C NOTE: Generated code\n"); fprintf( outfile, "C\n"); fprintf( outfile, "C Type of floating-point numbers in PLplot\n"); fprintf( outfile, "C\n"); fprintf( outfile, " integer, parameter :: plf = kind(%s)\n", kind); fprintf( outfile, " integer, parameter :: plflt = plf\n"); fclose( outfile); }
/* Auxiliary program: write the include file for determining PLplot's floating-point type */ #include <stdio.h> #include <stdlib.h> #include "plConfig.h" main(int argc, char *argv[] ) { FILE *outfile; char *kind; outfile = fopen( "plflt.inc", "w" ) ; #ifdef PL_DOUBLE kind = "1.0d0"; #else kind = "1.0"; #endif fprintf( outfile, "! NOTE: Generated code\n"); fprintf( outfile, "!\n"); fprintf( outfile, "! Type of floating-point numbers in PLplot\n"); fprintf( outfile, "!\n"); fprintf( outfile, " integer, parameter :: plf = kind(%s)\n", kind); fprintf( outfile, " integer, parameter :: plflt = plf\n"); fclose( outfile); }
Transform the fortran result of this executable to free form.
Transform the fortran result of this executable to free form. svn path=/trunk/; revision=6513
C
lgpl-2.1
FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot
9ed71f0c0945ecdfc7f49919ab4168a48b08cd94
ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h
ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h
#define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21" #define MICROPY_HW_MCU_NAME "samd21g18" #define MICROPY_HW_LED_TX &pin_PA27 #define MICROPY_HW_LED_RX &pin_PB03 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) #define DEFAULT_SPI_BUS_SCK (&pin_PB11) #define DEFAULT_SPI_BUS_MOSI (&pin_PB10) #define DEFAULT_SPI_BUS_MISO (&pin_PA12) #define DEFAULT_UART_BUS_RX (&pin_PA11) #define DEFAULT_UART_BUS_TX (&pin_PA10) // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 // Connected to a crystal #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 // SWD-only #define IGNORE_PIN_PA30 1 #define IGNORE_PIN_PA31 1
Add Cytron Maker Zero SAMD21
Add Cytron Maker Zero SAMD21
C
mit
adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython
5394589f53072a71942a11695470d7ca97ab7a70
tests/testTime.c
tests/testTime.c
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <sys/time.h> #include <time.h> #include <unistd.h> int main(int argc, char **argv) { struct timeval tv; struct timezone tz; struct tm *tm; gettimeofday(&tv, &tz); tm = localtime(&tv.tv_sec); char timestr[128]; size_t length = strftime(timestr, 128, "%F %T", tm); snprintf(timestr+length, 128-length, ".%ld", tv.tv_usec/1000); printf("Time string: %s\n", timestr); }
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <sys/time.h> #include <time.h> #include <unistd.h> #include "../../bluez-5.28/lib/bluetooth.h" int main(int argc, char **argv) { struct timeval tv; struct timezone tz; struct tm *tm; gettimeofday(&tv, &tz); tm = localtime(&tv.tv_sec); char timestr[128]; size_t length = strftime(timestr, 128, "%F %T", tm); snprintf(timestr+length, 128-length, ".%ld", tv.tv_usec/1000); printf("Time string: %s\n", timestr); long ms = htobl(tv.tv_sec)*1000 + htobl(tv.tv_usec)/1000; int64_t ms64 = htobl(tv.tv_sec)*1000 + htobl(tv.tv_usec)/1000; printf("Sizeof(long) = %d, ms=%ld, ms64=%ld\n", sizeof(ms), ms, ms64); }
Test long size and timeval to long conversion
Test long size and timeval to long conversion
C
apache-2.0
starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser
53ed2c4576f6e25c3c409d61c1f59b7221631554
Source/Core/Helpers/HCReturnTypeHandler.h
Source/Core/Helpers/HCReturnTypeHandler.h
// // OCHamcrest - HCReturnTypeHandler.h // Copyright 2014 hamcrest.org. See LICENSE.txt // // Created by: Jon Reid, http://qualitycoding.org/ // Docs: http://hamcrest.github.com/OCHamcrest/ // Source: https://github.com/hamcrest/OCHamcrest // #import <Foundation/Foundation.h> @interface HCReturnTypeHandler : NSObject @property (nonatomic, strong) HCReturnTypeHandler *successor; - (instancetype)initWithType:(char const *)handlerType; - (id)valueForReturnType:(char const *)type fromInvocation:(NSInvocation *)invocation; @end
// // OCHamcrest - HCReturnTypeHandler.h // Copyright 2014 hamcrest.org. See LICENSE.txt // // Created by: Jon Reid, http://qualitycoding.org/ // Docs: http://hamcrest.github.com/OCHamcrest/ // Source: https://github.com/hamcrest/OCHamcrest // #import <Foundation/Foundation.h> /** Chain-of-responsibility for handling NSInvocation return types. */ @interface HCReturnTypeHandler : NSObject @property (nonatomic, strong) HCReturnTypeHandler *successor; - (instancetype)initWithType:(char const *)handlerType; - (id)valueForReturnType:(char const *)type fromInvocation:(NSInvocation *)invocation; @end
Add comment to explicitly identify Chain of Responsibility
Add comment to explicitly identify Chain of Responsibility
C
bsd-2-clause
hamcrest/OCHamcrest,hamcrest/OCHamcrest,klundberg/OCHamcrest,klundberg/OCHamcrest,hamcrest/OCHamcrest
f90bb76d0ea96d1a6115fec0f5a922832b02759c
Interfaces/WorldLogicInterface.h
Interfaces/WorldLogicInterface.h
/** * For conditions of distribution and use, see copyright notice in license.txt * * @file WorldLogicInterface.h * @brief */ #include "ServiceInterface.h" #ifndef incl_Interfaces_WorldLogicInterface_h #define incl_Interfaces_WorldLogicInterface_h #include "ForwardDefines.h" #include <QObject> class QString; namespace Foundation { class WorldLogicInterface : public QObject, public ServiceInterface { Q_OBJECT public: /// Default constructor. WorldLogicInterface() {} /// Destructor. virtual ~WorldLogicInterface() {} /// Returns user's avatar entity. virtual Scene::EntityPtr GetUserAvatarEntity() const = 0; /// Returns currently active camera entity. virtual Scene::EntityPtr GetCameraEntity() const = 0; /// Returns entity with certain entity component in it or null if not found. /// @param entity_id Entity ID. /// @param component Type name of the component. virtual Scene::EntityPtr GetEntityWithComponent(uint entity_id, const QString &component) const = 0; /// Hack function for getting EC_AvatarAppearance info to UiModule virtual const QString &GetAvatarAppearanceProperty(const QString &name) const = 0; signals: /// Emitted just before we start to delete world (scene). void AboutToDeleteWorld(); }; } #endif
/** * For conditions of distribution and use, see copyright notice in license.txt * * @file WorldLogicInterface.h * @brief */ #ifndef incl_Interfaces_WorldLogicInterface_h #define incl_Interfaces_WorldLogicInterface_h #include "ServiceInterface.h" #include "ForwardDefines.h" #include <QObject> class QString; namespace Foundation { class WorldLogicInterface : public QObject, public ServiceInterface { Q_OBJECT public: /// Default constructor. WorldLogicInterface() {} /// Destructor. virtual ~WorldLogicInterface() {} /// Returns user's avatar entity. virtual Scene::EntityPtr GetUserAvatarEntity() const = 0; /// Returns currently active camera entity. virtual Scene::EntityPtr GetCameraEntity() const = 0; /// Returns entity with certain entity component in it or null if not found. /// @param entity_id Entity ID. /// @param component Type name of the component. virtual Scene::EntityPtr GetEntityWithComponent(uint entity_id, const QString &component) const = 0; /// Hack function for getting EC_AvatarAppearance info to UiModule virtual const QString &GetAvatarAppearanceProperty(const QString &name) const = 0; signals: /// Emitted just before we start to delete world (scene). void AboutToDeleteWorld(); }; } #endif
Move include within include guards.
Move include within include guards.
C
apache-2.0
antont/tundra,jesterKing/naali,antont/tundra,realXtend/tundra,BogusCurry/tundra,realXtend/tundra,pharos3d/tundra,pharos3d/tundra,BogusCurry/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,jesterKing/naali,antont/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,jesterKing/naali,realXtend/tundra,BogusCurry/tundra,pharos3d/tundra,antont/tundra,jesterKing/naali,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,BogusCurry/tundra,realXtend/tundra,antont/tundra,jesterKing/naali,pharos3d/tundra,AlphaStaxLLC/tundra,jesterKing/naali,realXtend/tundra,pharos3d/tundra,antont/tundra,pharos3d/tundra,realXtend/tundra,AlphaStaxLLC/tundra,antont/tundra,jesterKing/naali
b6656313eafd4a1742b9449c9886624f5a83d5aa
content/browser/renderer_host/quota_dispatcher_host.h
content/browser/renderer_host/quota_dispatcher_host.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. #ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ #define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ #include "base/basictypes.h" #include "content/browser/browser_message_filter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h" class GURL; class QuotaDispatcherHost : public BrowserMessageFilter { public: ~QuotaDispatcherHost(); bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); private: void OnQueryStorageUsageAndQuota( int request_id, const GURL& origin_url, WebKit::WebStorageQuotaType type); void OnRequestStorageQuota( int request_id, const GURL& origin_url, WebKit::WebStorageQuotaType type, int64 requested_size); }; #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_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. #ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ #define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ #include "base/basictypes.h" #include "content/browser/browser_message_filter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h" class GURL; class QuotaDispatcherHost : public BrowserMessageFilter { public: ~QuotaDispatcherHost(); virtual bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); private: void OnQueryStorageUsageAndQuota( int request_id, const GURL& origin_url, WebKit::WebStorageQuotaType type); void OnRequestStorageQuota( int request_id, const GURL& origin_url, WebKit::WebStorageQuotaType type, int64 requested_size); }; #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
Fix clang build that have been broken by 81364.
Fix clang build that have been broken by 81364. BUG=none TEST=green tree TBR=jam Review URL: http://codereview.chromium.org/6838008 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@81368 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium
27cf500cbbf4672c98f4d31442bfba689cd0d508
stag.c
stag.c
// stdio for file I/O #include <stdio.h> int main(int argc, char *argv[]) { int status = 1; float value; while(status != EOF) { status = fscanf(stdin, "%f\n", &value); if(status == 1) fprintf(stdout, "%f\n", value); else fprintf(stdout, "Error reading data (%d)\n", status); } }
// stdio for file I/O #include <stdio.h> #define HISTORY_SIZE 5 void print_values(float *values, int current_i) { // Print values to stdout, starting from one after newest (oldest) and // circle around to newest int i = current_i; for(i = current_i; i < current_i + HISTORY_SIZE; i++) { fprintf(stdout, "%.1f, ", values[i%HISTORY_SIZE]); } fprintf(stdout, "\n"); } int main(int argc, char *argv[]) { int status = 1; int values_i = 0; float v; float values[HISTORY_SIZE]; // Read floats to values, circle around after filling buffer while(status != EOF) { status = fscanf(stdin, "%f\n", &v); if(status == 1) { values[values_i] = v; values_i = (values_i+1) % HISTORY_SIZE; print_values(values, values_i); //fprintf(stdout, "%f\n", v); } else { fprintf(stdout, "Error reading data (%d)\n", status);\ } } }
Save value history as circular array, print function for debug
Save value history as circular array, print function for debug
C
bsd-3-clause
seenaburns/stag
a07bd876a0486a1adfcf319dc39001d73183db9f
grantlee_defaultfilters/join.h
grantlee_defaultfilters/join.h
/* Copyright (c) 2009 Stephen Kelly <[email protected]> */ #ifndef JOINFILTER_H #define JOINFILTER_H #include "filter.h" using namespace Grantlee; class GRANTLEE_EXPORT JoinFilter : public Filter { Q_OBJECT public: JoinFilter(QObject *parent = 0); Grantlee::SafeString doFilter(const QVariant &input, const Grantlee::SafeString &argument = QString(), bool autoescape=false) const; }; #endif
/* Copyright (c) 2009 Stephen Kelly <[email protected]> */ #ifndef JOINFILTER_H #define JOINFILTER_H #include "filter.h" using namespace Grantlee; class GRANTLEE_EXPORT JoinFilter : public Filter { Q_OBJECT public: JoinFilter(QObject *parent = 0); Grantlee::SafeString doFilter(const QVariant &input, const Grantlee::SafeString &argument = QString(), bool autoescape=false) const; bool isSafe() { return true; } }; #endif
Join is a safe filter.
Join is a safe filter.
C
lgpl-2.1
simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,simonwagner/grantlee
e0891a9816316b5e05fd5b0453ffe9fd6a56f489
include/asm-generic/getorder.h
include/asm-generic/getorder.h
#ifndef __ASM_GENERIC_GETORDER_H #define __ASM_GENERIC_GETORDER_H #ifndef __ASSEMBLY__ #include <linux/compiler.h> /* Pure 2^n version of get_order */ static inline __attribute_const__ int get_order(unsigned long size) { int order; size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1; order++; } while (size); return order; } #endif /* __ASSEMBLY__ */ #endif /* __ASM_GENERIC_GETORDER_H */
#ifndef __ASM_GENERIC_GETORDER_H #define __ASM_GENERIC_GETORDER_H #ifndef __ASSEMBLY__ #include <linux/compiler.h> /** * get_order - Determine the allocation order of a memory size * @size: The size for which to get the order * * Determine the allocation order of a particular sized block of memory. This * is on a logarithmic scale, where: * * 0 -> 2^0 * PAGE_SIZE and below * 1 -> 2^1 * PAGE_SIZE to 2^0 * PAGE_SIZE + 1 * 2 -> 2^2 * PAGE_SIZE to 2^1 * PAGE_SIZE + 1 * 3 -> 2^3 * PAGE_SIZE to 2^2 * PAGE_SIZE + 1 * 4 -> 2^4 * PAGE_SIZE to 2^3 * PAGE_SIZE + 1 * ... * * The order returned is used to find the smallest allocation granule required * to hold an object of the specified size. * * The result is undefined if the size is 0. * * This function may be used to initialise variables with compile time * evaluations of constants. */ static inline __attribute_const__ int get_order(unsigned long size) { int order; size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1; order++; } while (size); return order; } #endif /* __ASSEMBLY__ */ #endif /* __ASM_GENERIC_GETORDER_H */
Adjust the comment on get_order() to describe the size==0 case
bitops: Adjust the comment on get_order() to describe the size==0 case Adjust the comment on get_order() to note that the result of passing a size of 0 results in an undefined value. Signed-off-by: David Howells <[email protected]> Link: [email protected] Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
bb1883ff25f52e7f65b31ea9582842b18af0c336
file4.c
file4.c
file4.c - r1 Test checkin in master1-updated Test checkin in master2
file4.c - r1 Test checkin in master1-updated - updated_by_master Test checkin in master2 Test checkin in master3 Test checkin in master4
Test commit in master4 branch
Test commit in master4 branch
C
apache-2.0
shahedmolla/test
410ddc6b7c4c652769e924bb66fa9d5fd1221cea
PDKTModelBuilder/CoreData/NSManagedObject+PDKTModelBuilder.h
PDKTModelBuilder/CoreData/NSManagedObject+PDKTModelBuilder.h
// // NSManagedObject+PDKTUtils.h // PDKTModelBuilder // // Created by Daniel García García on 31/08/14. // Copyright (c) 2014 Produkt. All rights reserved. // #import <CoreData/CoreData.h> #import "PDKTModelBuilderEntity.h" @protocol PDKTModelBuilderCoreDataEntity <PDKTModelBuilderEntity> @optional @property (strong, nonatomic) NSDate *entityUpdateDate; @end @class PDKTEntityDataParser; @interface NSManagedObject (PDKTModelBuilderEntityDefault) + (NSString *)defaultEntityIdPropertyName; @end @interface NSManagedObject (PDKTModelBuilder) + (instancetype)updateOrInsertIntoManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withDictionary:(NSDictionary *)dictionary; + (instancetype)insertIntoManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withDictionary:(NSDictionary *)dictionary; + (instancetype)fetchObjectWithValue:(id)value forKey:(NSString *)key inManagedObjectContext:(NSManagedObjectContext *)managedObjectContext; + (NSString *)objectIdWithDictionary:(NSDictionary *)dictionary; @end
// // NSManagedObject+PDKTUtils.h // PDKTModelBuilder // // Created by Daniel García García on 31/08/14. // Copyright (c) 2014 Produkt. All rights reserved. // #import <CoreData/CoreData.h> #import "PDKTModelBuilderEntity.h" @protocol PDKTModelBuilderCoreDataEntity <PDKTModelBuilderEntity> @optional @property (strong, nonatomic) NSDate *entityUpdateDate; @property (strong, nonatomic) NSNumber *order; @end @class PDKTEntityDataParser; @interface NSManagedObject (PDKTModelBuilderEntityDefault) + (NSString *)defaultEntityIdPropertyName; @end @interface NSManagedObject (PDKTModelBuilder) + (instancetype)updateOrInsertIntoManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withDictionary:(NSDictionary *)dictionary; + (instancetype)insertIntoManagedObjectContext:(NSManagedObjectContext *)managedObjectContext withDictionary:(NSDictionary *)dictionary; + (instancetype)fetchObjectWithValue:(id)value forKey:(NSString *)key inManagedObjectContext:(NSManagedObjectContext *)managedObjectContext; + (NSString *)objectIdWithDictionary:(NSDictionary *)dictionary; @end
Add order property to protocol
Add order property to protocol
C
mit
antjimar/PDKTModelBuilder
2f0d82a50ba16300dff596f6ddc7c957f803179a
ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h
ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h
#define MICROPY_HW_BOARD_NAME "Challenger NB RP2040 WiFi" #define MICROPY_HW_MCU_NAME "rp2040" #define DEFAULT_UART_BUS_TX (&pin_GPIO16) #define DEFAULT_UART_BUS_RX (&pin_GPIO17) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) #define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO24)
#define MICROPY_HW_BOARD_NAME "Challenger NB RP2040 WiFi" #define MICROPY_HW_MCU_NAME "rp2040" #define DEFAULT_UART_BUS_TX (&pin_GPIO16) #define DEFAULT_UART_BUS_RX (&pin_GPIO17) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO1)
Disable board.SPI() for Challenger NB RP2040 WiFi
Disable board.SPI() for Challenger NB RP2040 WiFi This was done as a result of an issue with the SPI pin mappings. Please refer to the following for additional information: https://ilabs.se/challenger-rp2040-wifi-spi-bug
C
mit
adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython
a8904687f65f794ab5d01c58c6f9beeda5742325
kernel/libc/newlib/newlib_isatty.c
kernel/libc/newlib/newlib_isatty.c
/* KallistiOS ##version## newlib_isatty.c Copyright (C)2004 Dan Potter */ #include <sys/reent.h> int isatty(int fd) { return 0; } int _isatty_r(struct _reent *reent, int fd) { return 0; }
/* KallistiOS ##version## newlib_isatty.c Copyright (C) 2004 Dan Potter Copyright (C) 2012 Lawrence Sebald */ #include <sys/reent.h> int isatty(int fd) { /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise they won't be set as line-buffered. */ if(fd >= 0 && fd <= 2) { return 1; } return 0; } int _isatty_r(struct _reent *reent, int fd) { /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise they won't be set as line-buffered.*/ if(fd >= 0 && fd <= 2) { return 1; } return 0; }
Make it so that stdin/stdout/stderr will be set as line buffered (newlib has to think they're ttys if we have fcntl, which we do now).
Make it so that stdin/stdout/stderr will be set as line buffered (newlib has to think they're ttys if we have fcntl, which we do now).
C
bsd-3-clause
DreamcastSDK/kos,DreamcastSDK/kos,DreamcastSDK/kos
3cc120b985c7134fd6c3d2a40bab85711b2da4ee
Runtime/Rendering/LightingPass.h
Runtime/Rendering/LightingPass.h
#pragma once #include "Rendering/RenderingPass.h" #include "Math/Vector3.h" namespace Mile { class GBuffer; class BlendState; class MEAPI LightingPass : public RenderingPass { DEFINE_CONSTANT_BUFFER(CameraParamsConstantBuffer) { Vector3 CameraPos; }; DEFINE_CONSTANT_BUFFER(LightParamsConstantBuffer) { Vector3 LightPos; Vector3 LightRadiance; Vector3 LightDirection; UINT32 LightType; }; public: LightingPass(class RendererDX11* renderer); ~LightingPass(); virtual bool Init(const String& shaderPath) override; virtual bool Bind(ID3D11DeviceContext& deviceContext) override; virtual bool Unbind(ID3D11DeviceContext& deviceContext) override; void SetGBuffer(GBuffer* gBuffer); void UpdateCameraParamsBuffer(ID3D11DeviceContext& deviceContext, CameraParamsConstantBuffer buffer); void UpdateLightParamsBuffer(ID3D11DeviceContext& deviceContext, LightParamsConstantBuffer buffer); private: GBuffer* m_gBuffer; CBufferPtr m_cameraParamsBuffer; CBufferPtr m_lightParamsBuffer; BlendState* m_additiveBlendState; }; }
#pragma once #include "Rendering/RenderingPass.h" #include "Math/Vector3.h" namespace Mile { class GBuffer; class BlendState; class MEAPI LightingPass : public RenderingPass { DEFINE_CONSTANT_BUFFER(CameraParamsConstantBuffer) { Vector3 CameraPos; }; DEFINE_CONSTANT_BUFFER(LightParamsConstantBuffer) { Vector3 LightPos; Vector3 LightDirection; Vector3 LightRadiance; UINT32 LightType; }; public: LightingPass(class RendererDX11* renderer); ~LightingPass(); virtual bool Init(const String& shaderPath) override; virtual bool Bind(ID3D11DeviceContext& deviceContext) override; virtual bool Unbind(ID3D11DeviceContext& deviceContext) override; void SetGBuffer(GBuffer* gBuffer); void UpdateCameraParamsBuffer(ID3D11DeviceContext& deviceContext, CameraParamsConstantBuffer buffer); void UpdateLightParamsBuffer(ID3D11DeviceContext& deviceContext, LightParamsConstantBuffer buffer); private: GBuffer* m_gBuffer; CBufferPtr m_cameraParamsBuffer; CBufferPtr m_lightParamsBuffer; BlendState* m_additiveBlendState; }; }
Reorder light params buffer struct
Reorder light params buffer struct
C
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
e9148261b2105762119d5fecae3ef88d653d519f
src/condor_includes/condor_fix_timeval.h
src/condor_includes/condor_fix_timeval.h
#ifndef TIMEVAL_H #define TIMEVAL_H #if defined(ULTRIX42) || defined(ULTRIX43) || defined(HPUX9) #if !defined(_ALL_SOURCE) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; #endif /* _ALL_SOURCE */ #else #include <sys/time.h> #endif #endif
#ifndef TIMEVAL_H #define TIMEVAL_H #if defined(ULTRIX43) && !defined(_ALL_SOURCE) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; #else # include <sys/time.h> #endif #endif
Simplify a bit as special treatment is no longer needed for HPUX.
Simplify a bit as special treatment is no longer needed for HPUX.
C
apache-2.0
zhangzhehust/htcondor,htcondor/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,htcondor/htcondor,neurodebian/htcondor,neurodebian/htcondor,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/condor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,djw8605/condor,htcondor/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,bbockelm/condor-network-accounting
c0d5cbad61bdde819a3d6c04e5b174fc85384343
src/modules/conf_randr/e_smart_monitor.h
src/modules/conf_randr/e_smart_monitor.h
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H Evas_Object *e_smart_monitor_add(Evas *evas); void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch); void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output); void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord gx, Evas_Coord gy, Evas_Coord gw, Evas_Coord gh); void e_smart_monitor_virtual_size_set(Evas_Object *obj, Evas_Coord vw, Evas_Coord vh); void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H Evas_Object *e_smart_monitor_add(Evas *evas); void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch); void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output); void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord gx, Evas_Coord gy, Evas_Coord gw, Evas_Coord gh); void e_smart_monitor_grid_virtual_size_set(Evas_Object *obj, Evas_Coord vw, Evas_Coord vh); void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy); void e_smart_monitor_current_geometry_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); # endif #endif
Add function prototype for setting current geometry. Rename function prototype for grid virtual size set.
Add function prototype for setting current geometry. Rename function prototype for grid virtual size set. Signed-off-by: Christopher Michael <[email protected]> SVN revision: 84195
C
bsd-2-clause
FlorentRevest/Enlightenment,rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment
6ce734489e2bef9002541cc45c29aad582e08f32
Analytics/SEGEcommerce.h
Analytics/SEGEcommerce.h
// // SEGEcommerce.h // Analytics // // Created by Travis Jeffery on 7/17/14. // Copyright (c) 2014 Segment.io. All rights reserved. // #import <Foundation/Foundation.h> @protocol SEGEcommerce <NSObject> - (void)viewedProduct; - (void)removedProduct; - (void)addedProduct; - (void)completedOrder; @end
// // SEGEcommerce.h // Analytics // // Created by Travis Jeffery on 7/17/14. // Copyright (c) 2014 Segment.io. All rights reserved. // #import <Foundation/Foundation.h> @protocol SEGEcommerce <NSObject> @optional - (void)viewedProduct:(NSDictionary *)properties; - (void)removedProduct:(NSDictionary *)properties; - (void)addedProduct:(NSDictionary *)properties; - (void)completedOrder:(NSDictionary *)properties; @end
Fix ecommerce methods to take properties dictionary
Fix ecommerce methods to take properties dictionary Acked-by: Travis Jeffery <[email protected]>
C
mit
rudywen/analytics-ios,jlandon/analytics-ios,jtomson-mdsol/analytics-ios,hzalaz/analytics-ios,cfraz89/analytics-ios,jlandon/analytics-ios,operator/analytics-ios,orta/analytics-ios,hzalaz/analytics-ios,abodo-dev/analytics-ios,segmentio/analytics-ios,dbachrach/analytics-ios,dcaunt/analytics-ios,string-team/analytics-ios,lumoslabs/analytics-ios,dcaunt/analytics-ios,vinod1988/analytics-ios,rudywen/analytics-ios,cfraz89/analytics-ios,abodo-dev/analytics-ios,jonathannorris/analytics-ios,abodo-dev/analytics-ios,cfraz89/analytics-ios,djfink-carglass/analytics-ios,rudywen/analytics-ios,graingert/analytics-ios,jonathannorris/analytics-ios,ldiqual/analytics-ios,jonathannorris/analytics-ios,operator/analytics-ios,dcaunt/analytics-ios,string-team/analytics-ios,vinod1988/analytics-ios,ldiqual/analytics-ios,lumoslabs/analytics-ios,lumoslabs/analytics-ios,djfink-carglass/analytics-ios,jtomson-mdsol/analytics-ios,vinod1988/analytics-ios,segmentio/analytics-ios,graingert/analytics-ios,hzalaz/analytics-ios,segmentio/analytics-ios,orta/analytics-ios,dbachrach/analytics-ios,jtomson-mdsol/analytics-ios,string-team/analytics-ios,segmentio/analytics-ios,ldiqual/analytics-ios,orta/analytics-ios,dbachrach/analytics-ios,operator/analytics-ios,jlandon/analytics-ios,djfink-carglass/analytics-ios,graingert/analytics-ios
0ae1522b36e4f7fbea3770d108a10d4bc784d26f
include/franka/lowpass_filter.h
include/franka/lowpass_filter.h
// Copyright (c) 2017 Franka Emika GmbH // Use of this source code is governed by the Apache-2.0 license, see LICENSE #pragma once #include <cmath> /** * @file lowpass_filter.h * Contains functions for filtering signals with a low-pass filter. */ namespace franka { /** * Maximum cutoff frequency */ constexpr double kMaxCutoffFrequency = 1000.0; /** * Default cutoff frequency */ constexpr double kDefaultCutoffFrequency = 100.0; /** * Applies a first-order low-pass filter * * @param[in] sample_time Sample time constant * @param[in] y Current value of the signal to be filtered * @param[in] y_last Value of the signal to be filtered in the previous time step * @param[in] cutoff_frequency Cutoff frequency of the low-pass filter * * @return Filtered value. */ inline double lowpassFilter(double sample_time, double y, double y_last, double cutoff_frequency) { double gain = sample_time / (sample_time + (1.0 / (2.0 * M_PI * cutoff_frequency))); return gain * y + (1 - gain) * y_last; } } // namespace franka
// Copyright (c) 2017 Franka Emika GmbH // Use of this source code is governed by the Apache-2.0 license, see LICENSE #pragma once #include <cmath> /** * @file lowpass_filter.h * Contains functions for filtering signals with a low-pass filter. */ namespace franka { /** * Maximum cutoff frequency */ constexpr double kMaxCutoffFrequency = 1000.0; /** * Default cutoff frequency */ constexpr double kDefaultCutoffFrequency = 100.0; /** * Applies a first-order low-pass filter * * @param[in] sample_time Sample time constant * @param[in] y Current value of the signal to be filtered * @param[in] y_last Value of the signal to be filtered in the previous time step * @param[in] cutoff_frequency Cutoff frequency of the low-pass filter * @throw std::invalid_argument if y is infinite or NaN. * * @return Filtered value. */ inline double lowpassFilter(double sample_time, double y, double y_last, double cutoff_frequency) { if (!std::isfinite(y)){ throw std::invalid_argument("Commanding value is infinite or NaN."); } double gain = sample_time / (sample_time + (1.0 / (2.0 * M_PI * cutoff_frequency))); return gain * y + (1 - gain) * y_last; } } // namespace franka
Add NaN/Inf check for low-pass filter.
Add NaN/Inf check for low-pass filter.
C
apache-2.0
frankaemika/libfranka,frankaemika/libfranka,frankaemika/libfranka
22a04f32bae2446bd7ca32386592b386cbc5fe38
lib/gibber/gibber-namespaces.h
lib/gibber/gibber-namespaces.h
#define GIBBER_XMPP_NS_STREAM \ (const gchar *)"http://etherx.jabber.org/streams" #define GIBBER_XMPP_NS_TLS \ (const gchar *)"urn:ietf:params:xml:ns:xmpp-tls" #define GIBBER_XMPP_NS_SASL_AUTH \ (const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl"
#define GIBBER_XMPP_NS_STREAM \ (const gchar *)"http://etherx.jabber.org/streams" #define GIBBER_XMPP_NS_TLS \ (const gchar *)"urn:ietf:params:xml:ns:xmpp-tls" #define GIBBER_XMPP_NS_SASL_AUTH \ (const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl" #define GIBBER_XMPP_NS_XHTML_IM \ (const gchar *)"http://jabber.org/protocol/xhtml-im" #define GIBBER_W3C_NS_XHTML \ (const gchar *)"http://www.w3.org/1999/xhtml"
Add xhtml-im and w3c xhtml namespace
Add xhtml-im and w3c xhtml namespace 20070316212630-93b9a-bcdbd042585561b0f20076b5e7f5f1c41c1e2867.gz
C
lgpl-2.1
freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut
53da162a421fb6135dad4cfc197397bf527a9d6a
tests/regression/36-octapron/27-combine-forget-fun-lval.c
tests/regression/36-octapron/27-combine-forget-fun-lval.c
// SKIP PARAM: --sets ana.activated[+] octApron #include <assert.h> int f(int x) { return x + 1; } int main(void) { int y = 42; y = f(y); // combine should forget callee's y after substituting arg vars with args to avoid bottom in #ret substitute assert(y); return 0; }
Add test for octApron combine forgetting return assign in function
Add test for octApron combine forgetting return assign in function
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
7798b4a999726f6804a9968bc24f61365da7b1e0
ext/cap2/cap2.c
ext/cap2/cap2.c
#include <ruby.h> #include <errno.h> #include <sys/capability.h> static VALUE cap2_getpcaps(VALUE self, VALUE pid) { cap_t cap_d; ssize_t length; char *caps; VALUE result; Check_Type(pid, T_FIXNUM); cap_d = cap_get_pid(FIX2INT(pid)); if (cap_d == NULL) { rb_raise( rb_eRuntimeError, "Failed to get cap's for proccess %d: (%s)\n", FIX2INT(pid), strerror(errno) ); } else { caps = cap_to_text(cap_d, &length); result = rb_str_new(caps, length); cap_free(caps); cap_free(cap_d); } return result; } void Init_cap2(void) { VALUE rb_mCap2; rb_mCap2 = rb_define_module("Cap2"); rb_define_module_function(rb_mCap2, "getpcaps", cap2_getpcaps, 1); }
#include <ruby.h> #include <errno.h> #include <sys/capability.h> static VALUE cap2_getpcaps(VALUE self, VALUE pid) { cap_t cap_d; ssize_t length; char *caps; VALUE result; Check_Type(pid, T_FIXNUM); cap_d = cap_get_pid(FIX2INT(pid)); if (cap_d == NULL) { rb_raise( rb_eRuntimeError, "Failed to get capabilities for proccess %d: (%s)\n", FIX2INT(pid), strerror(errno) ); } else { caps = cap_to_text(cap_d, &length); result = rb_str_new(caps, length); cap_free(caps); cap_free(cap_d); } return result; } void Init_cap2(void) { VALUE rb_mCap2; rb_mCap2 = rb_define_module("Cap2"); rb_define_module_function(rb_mCap2, "getpcaps", cap2_getpcaps, 1); }
Update error text in Cap2.getpcaps
Update error text in Cap2.getpcaps
C
mit
lmars/cap2,lmars/cap2
0a604550e4f39b0d40732bf6cefe143ddcd00091
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> #include <string.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; do { for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); char chute; scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } while(!acertou && !enforcou); }
#include <stdio.h> #include <string.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; do { for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); char chute; printf("Qual letra? "); scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } while(!acertou && !enforcou); }
Update files, Alura, Introdução a C - Parte 2, Aula 2.6
Update files, Alura, Introdução a C - Parte 2, Aula 2.6
C
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
4b62610ef39e999c1328e884b01cc14c7dcd9591
core/alsp_src/generic/fpbasis.c
core/alsp_src/generic/fpbasis.c
/*===========================================================================* | fpbasis.c | Copyright (c) 1996-97 Applied Logic Systems, Inc. | | -- Floating point math abstractions | *===========================================================================*/ #include "defs.h" #include "fpbasis.h" #ifdef MacOS #include <fp.h> #endif int is_ieee_nan PARAMS( (double) ); int is_ieee_inf PARAMS( (double) ); int is_ieee_nan(v) double v; { return isnan(v); } int is_ieee_inf(v) double v; { #ifdef SOLARIS switch (fpclass(v)) { case FP_NINF: return(1); case FP_PINF: return(1); default: return(0); } #elif defined(WIN32) || defined(AIX) return !finite(v); #elif defined(MacOS) return !isfinite(v); #elif (defined(__sgi) && defined(__mips)) return(!finite(v)); #else return isinf(v); #endif }
/*===========================================================================* | fpbasis.c | Copyright (c) 1996-97 Applied Logic Systems, Inc. | | -- Floating point math abstractions | *===========================================================================*/ #include "defs.h" #include "fpbasis.h" #ifdef MacOS #include <fp.h> #endif int is_ieee_nan PARAMS( (double) ); int is_ieee_inf PARAMS( (double) ); int is_ieee_nan(v) double v; { return isnan(v); } int is_ieee_inf(v) double v; { #if defined(SOLARIS) || defined(UNIX_SOLARIS) switch (fpclass(v)) { case FP_NINF: return(1); case FP_PINF: return(1); default: return(0); } #elif defined(WIN32) || defined(AIX) return !finite(v); #elif defined(MacOS) return !isfinite(v); #elif (defined(__sgi) && defined(__mips)) return(!finite(v)); #else return isinf(v); #endif }
Change for new config system
Change for new config system
C
mit
AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog
2baa46afd5b7156da9087010d41f05031d121dd8
conceitos/basicos/gerais/0x07_loops/while/example_while.c
conceitos/basicos/gerais/0x07_loops/while/example_while.c
/* * Author: Jhonatan Casale (jhc) * * Contact : [email protected] * : [email protected] * : https://github.com/jhonatancasale * : https://twitter.com/jhonatancasale * : http://jhonatancasale.github.io/ * * Create date Wed 1 Mar 01:51:51 BRT 2017 * */ #include <stdlib.h> #include <stdio.h> #include <ctype.h> int main (int argc, char **argv) { char str[] = "Hello, world!"; int i = 0; while ( str[i] != '\0' ) { printf ("%c\n", str[i]); i++; } printf ("\n"); i = 0; while ( str[i] != '\0' ) printf ("%c", toupper(str[i++])); printf ("\n"); return (EXIT_SUCCESS); }
Add while loop examples, really
Add while loop examples, really
C
apache-2.0
jhonatancasale/learning-c,jhonatancasale/learning-c,klaussjhc/learning-c
c5949064707026e60dd7f370870fd76be5f2c78a
gpu/include/GrGLConfig_chrome.h
gpu/include/GrGLConfig_chrome.h
#ifndef GrGLConfig_chrome_DEFINED #define GrGLConfig_chrome_DEFINED #define GR_SUPPORT_GLES2 1 // gl2ext.h will define these extensions macros but Chrome doesn't provide // prototypes. #define GL_OES_mapbuffer 0 #define GL_IMG_multisampled_render_to_texture 0 #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #define GR_GL_FUNC #define GR_GL_PROC_ADDRESS(X) &X // chrome always assumes BGRA #define GR_GL_32BPP_COLOR_FORMAT GR_BGRA // glGetError() forces a sync with gpu process on chrome #define GR_GL_CHECK_ERROR_START 0 #endif
#ifndef GrGLConfig_chrome_DEFINED #define GrGLConfig_chrome_DEFINED #define GR_SUPPORT_GLES2 1 // gl2ext.h will define these extensions macros but Chrome doesn't provide // prototypes. #define GL_OES_mapbuffer 0 #define GL_IMG_multisampled_render_to_texture 0 #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #define GR_GL_FUNC #define GR_GL_PROC_ADDRESS(X) &X // chrome always assumes BGRA #define GR_GL_32BPP_COLOR_FORMAT GR_BGRA // glGetError() forces a sync with gpu process on chrome #define GR_GL_CHECK_ERROR_START 0 // Using the static vb precludes batching rect-to-rect draws // because there are matrix changes between each one. // Chrome was getting top performance on Windows with // batched rect-to-rect draws. But there seems to be some // regression that now causes any dynamic VB data to perform // very poorly. In any event the static VB seems to get equal // perf to what batching was producing and it always seems to // be better on Linux. #define GR_STATIC_RECT_VB 1 #endif
Make chrome use the static square vb when drawing rects.
Make chrome use the static square vb when drawing rects. Review URL: http://codereview.appspot.com/4280053/
C
bsd-3-clause
csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia
f749ea43d24a3ee328ee77c6de3838f3fef11d30
beaksh.c
beaksh.c
#include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include "linenoise.h" char* findPrompt(); void executeCommand(const char *text); int main() { int childPid; int child_status; char *line; char *prompt; prompt = findPrompt(); while((line = linenoise(prompt)) != NULL) { if (line[0] != '\0') { linenoiseHistoryAdd(line); childPid = fork(); if(childPid == 0) { executeCommand(line); } else { wait(&child_status); } } free(line); } return 0; } char* findPrompt() { return "$ "; } void executeCommand(const char *text) { execlp(text, text, NULL); }
#include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <sys/param.h> #include "linenoise.h" #define HISTORY_FILE ".beaksh_history" char* findPrompt(); char* getHistoryPath(); void executeCommand(const char *text); int main() { int childPid; int child_status; char *line; char *prompt; prompt = findPrompt(); char *historyPath = getHistoryPath(); linenoiseHistoryLoad(historyPath); while((line = linenoise(prompt)) != NULL) { if (line[0] != '\0') { linenoiseHistoryAdd(line); linenoiseHistorySave(historyPath); childPid = fork(); if(childPid == 0) { executeCommand(line); } else { wait(&child_status); } } free(line); } if(historyPath) free(historyPath); return EXIT_SUCCESS; } char* findPrompt() { return "$ "; } /* Resolve dotfile path for history. Returns NULL if file can't be resolved. */ char* getHistoryPath() { char *home = getenv("HOME"); if(!home) return NULL; int home_path_len = strnlen(home, MAXPATHLEN); int history_path_len = home_path_len + strlen(HISTORY_FILE) + 1; char *result; if((result = malloc(history_path_len + 1)) == NULL) { fprintf(stderr, "Problem resolving path for history file, no history will be recorded\n"); return NULL; } strncpy(result, home, home_path_len); strncat(result, "/", 1); strncat(result, HISTORY_FILE, strlen(HISTORY_FILE)); return result; } void executeCommand(const char *text) { execlp(text, text, NULL); }
Add persistent history to shell
Add persistent history to shell Closes #3.
C
mit
futureperfect/beaksh
df0776acc394cf21bac9f0d67d01250d04ba2f1a
Epicness.c
Epicness.c
#pragma config(Sensor, dgtl4, LeftEncoder, sensorQuadEncoder) #pragma config(Sensor, dgtl11, RightEncoder, sensorQuadEncoder) #pragma config(Motor, port8, Shooter8, tmotorVex393_MC29, openLoop) #pragma config(Motor, port9, Shooter9, tmotorVex393_MC29, openLoop, reversed) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// task Shooting() { int last_clicks_left = 0; int last_clicks_right = 0; while(true) { motor[Shooter8] = 50; motor[Shooter9] = 50; //get current int current_right_clicks = SensorValue[RightEncoder]; int current_left_clicks = SensorValue[LeftEncoder]; //calculate elapsed int elapsed_right_clicks = current_right_clicks - last_clicks_right; int elapsed_left_clicks = current_left_clicks - last_clicks_left; //print writeDebugStreamLine("elapsed_right_clicks: %d", elapsed_right_clicks); writeDebugStreamLine("elapese_left_clicks: %d", elapsed_left_clicks); //save current to last last_clicks_left = current_left_clicks; last_clicks_right = current_right_clicks; delay(100); } } task main() { startTask(Shooting); }
Add a shooter program, and speed reader.
Add a shooter program, and speed reader.
C
mit
UpperPerkRobotics/test-repo
43c33cfb95bd6b94e459b1ee64449a787b92a0aa
test/com/facebook/buck/features/rust/testdata/cxx_with_rust_dep/main.c
test/com/facebook/buck/features/rust/testdata/cxx_with_rust_dep/main.c
#include <stdio.h> extern void helloer(void); int main() { printf("Calling helloer\n"); helloer(); printf("Helloer called\n"); }
#include <stdio.h> extern void helloer(void); int main() { printf("Calling helloer\n"); helloer(); printf("Helloer called\n"); return 0; }
Fix test failures with GCC
rust: Fix test failures with GCC Summary: GCC 4.8.5 (and likely other versions of GCC) compiles C code as C89 (-std=gnu89) by default. In C89, if main does not explicitly return, the program's exit code is unspecified. This means the hello program in cxx_with_rust_dep can return non-zero on success. Many of Buck's tests assert that the hello program exits with a zero exit code. When these tests use GCC 4.8.5, the tests often fail, since the exit code is non-zero. Fix the test failures by making the hello program explicitly return zero on success. (Some other compilers compile C code as C99 or C11 by default. Since C99, if main does not explicitly return, the program's exit code is zero. This means the hello program always returns zero on success.) Reviewed By: styurin fbshipit-source-id: 46c4dd6f68
C
apache-2.0
brettwooldridge/buck,romanoid/buck,brettwooldridge/buck,SeleniumHQ/buck,facebook/buck,JoelMarcey/buck,Addepar/buck,SeleniumHQ/buck,romanoid/buck,rmaz/buck,romanoid/buck,brettwooldridge/buck,nguyentruongtho/buck,zpao/buck,facebook/buck,JoelMarcey/buck,nguyentruongtho/buck,Addepar/buck,brettwooldridge/buck,rmaz/buck,SeleniumHQ/buck,facebook/buck,Addepar/buck,nguyentruongtho/buck,brettwooldridge/buck,JoelMarcey/buck,rmaz/buck,romanoid/buck,zpao/buck,Addepar/buck,rmaz/buck,brettwooldridge/buck,kageiit/buck,kageiit/buck,Addepar/buck,rmaz/buck,JoelMarcey/buck,romanoid/buck,brettwooldridge/buck,zpao/buck,romanoid/buck,rmaz/buck,nguyentruongtho/buck,shs96c/buck,zpao/buck,SeleniumHQ/buck,romanoid/buck,rmaz/buck,SeleniumHQ/buck,kageiit/buck,JoelMarcey/buck,rmaz/buck,JoelMarcey/buck,Addepar/buck,romanoid/buck,nguyentruongtho/buck,Addepar/buck,shs96c/buck,brettwooldridge/buck,facebook/buck,SeleniumHQ/buck,Addepar/buck,kageiit/buck,SeleniumHQ/buck,JoelMarcey/buck,brettwooldridge/buck,rmaz/buck,brettwooldridge/buck,SeleniumHQ/buck,romanoid/buck,facebook/buck,nguyentruongtho/buck,SeleniumHQ/buck,romanoid/buck,JoelMarcey/buck,SeleniumHQ/buck,SeleniumHQ/buck,shs96c/buck,rmaz/buck,kageiit/buck,JoelMarcey/buck,SeleniumHQ/buck,rmaz/buck,shs96c/buck,Addepar/buck,shs96c/buck,JoelMarcey/buck,shs96c/buck,brettwooldridge/buck,rmaz/buck,SeleniumHQ/buck,zpao/buck,shs96c/buck,JoelMarcey/buck,romanoid/buck,Addepar/buck,kageiit/buck,brettwooldridge/buck,kageiit/buck,Addepar/buck,nguyentruongtho/buck,romanoid/buck,JoelMarcey/buck,shs96c/buck,shs96c/buck,JoelMarcey/buck,rmaz/buck,Addepar/buck,facebook/buck,zpao/buck,romanoid/buck,facebook/buck,shs96c/buck,brettwooldridge/buck,zpao/buck,shs96c/buck,Addepar/buck,shs96c/buck,shs96c/buck
06be45bd2a250ccba120c46c673b7e4a5242947e
api/inc/tour.h
api/inc/tour.h
#ifndef __TOURH__ #define __TOURH__ #include <stdio.h> #include <stdlib.h> #define tour int* #define city int //initializes a new tour tour create_tour(int ncities); //returns true if the tour t is shorter than //a distance indicated by dist int is_shtr(tour t, int dist); //defines the starter point of a tour void strt_point(tour t, city c); //defines a new tour changing the order of two cities void swap_cities(tour* t, city c1, city c2); #endif
#ifndef __TOURH__ #define __TOURH__ #include <stdio.h> #include <stdlib.h> typedef int* tour; typedef int city; //inicializa um tour tour create_tour(int ncities); //popula um tour pre-definido com cidades void populate_tour(tour t, int ncities); //retorna true se a distancia total do //tour t for menor que dist int is_shoter(tour t, int dist); //define a cidade inicial de um tour void start_point(tour t, city c); //inverte a posição de duas cidades no tour void swap_cities(tour t, int c1, int c2); #endif
Change type creation from define to typedef.
Change type creation from define to typedef.
C
apache-2.0
frila/caixeiro
53c85fb989a60ef015bbbe3a2541b9ff1020ef15
components/libc/dlib/sys/types.h
components/libc/dlib/sys/types.h
#ifndef __TYPES_H__ #define __TYPES_H__ #include <stdint.h> #include <rtthread.h> typedef rt_int32_t clockid_t; typedef rt_int32_t key_t; /* Used for interprocess communication. */ typedef rt_int32_t pid_t; /* Used for process IDs and process group IDs. */ typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ #endif
#ifndef __TYPES_H__ #define __TYPES_H__ #include <stdint.h> #include <rtthread.h> typedef rt_int32_t clockid_t; typedef rt_int32_t key_t; /* Used for interprocess communication. */ typedef rt_int32_t pid_t; /* Used for process IDs and process group IDs. */ typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef int mode_t; #endif
Add missing definition of mode_t
[libc][dlib] Add missing definition of mode_t For using pthread with IAR tool chain
C
apache-2.0
ArdaFu/rt-thread,ArdaFu/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread,FlyLu/rt-thread,FlyLu/rt-thread,yongli3/rt-thread,yongli3/rt-thread,FlyLu/rt-thread,gbcwbz/rt-thread,FlyLu/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,weety/rt-thread,AubrCool/rt-thread,AubrCool/rt-thread,AubrCool/rt-thread,yongli3/rt-thread,gbcwbz/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,gbcwbz/rt-thread,armink/rt-thread,zhaojuntao/rt-thread,ArdaFu/rt-thread,weiyuliang/rt-thread,wolfgangz2013/rt-thread,weiyuliang/rt-thread,yongli3/rt-thread,weety/rt-thread,weiyuliang/rt-thread,weiyuliang/rt-thread,nongxiaoming/rt-thread,wolfgangz2013/rt-thread,hezlog/rt-thread,AubrCool/rt-thread,armink/rt-thread,AubrCool/rt-thread,yongli3/rt-thread,ArdaFu/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,hezlog/rt-thread,yongli3/rt-thread,zhaojuntao/rt-thread,nongxiaoming/rt-thread,igou/rt-thread,wolfgangz2013/rt-thread,igou/rt-thread,gbcwbz/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,igou/rt-thread,armink/rt-thread,gbcwbz/rt-thread,nongxiaoming/rt-thread,armink/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread,igou/rt-thread,RT-Thread/rt-thread,AubrCool/rt-thread,wolfgangz2013/rt-thread,weety/rt-thread,yongli3/rt-thread,weety/rt-thread,weety/rt-thread,armink/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,ArdaFu/rt-thread,geniusgogo/rt-thread,hezlog/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread,armink/rt-thread,igou/rt-thread,ArdaFu/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,armink/rt-thread,geniusgogo/rt-thread,gbcwbz/rt-thread,zhaojuntao/rt-thread,igou/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,igou/rt-thread,geniusgogo/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,weety/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,RT-Thread/rt-thread,AubrCool/rt-thread,hezlog/rt-thread
3059f29d3aca2555583bd8c15e94a5840eaba11b
src/condor_includes/condor_fix_stdio.h
src/condor_includes/condor_fix_stdio.h
#ifndef FIX_STDIO_H #define FIX_STDIO_H #include <stdio.h> /* For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype for pclose() if _POSIX_SOURCE is defined - even though it does provide a prototype for popen(). */ #if defined(ULTRIX43) #if defined(__cplusplus) extern "C" { #endif #if defined(__STDC__) || defined(__cplusplus) int pclose( FILE *__stream ); #else int pclose(); #endif #if defined(__cplusplus) } #endif #endif /* ULTRIX43 */ #endif
#ifndef FIX_STDIO_H #define FIX_STDIO_H #include <stdio.h> #if defined(__cplusplus) extern "C" { #endif /* For some reason the stdio.h on OSF1 fails to provide prototypes for popen() and pclose() if _POSIX_SOURCE is defined. */ #if defined(OSF1) #if defined(__STDC__) || defined(__cplusplus) FILE *popen( char *, char * ); int pclose( FILE *__stream ); #else FILE *popen(); int pclose(); #endif #endif /* OSF1 */ /* For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype for pclose() if _POSIX_SOURCE is defined - even though it does provide a prototype for popen(). */ #if defined(ULTRIX43) #if defined(__STDC__) || defined(__cplusplus) int pclose( FILE *__stream ); #else int pclose(); #endif #endif /* ULTRIX43 */ #if defined(__cplusplus) } #endif #endif
Add prototypes for popen()/pclose() for OSF1 machines.
Add prototypes for popen()/pclose() for OSF1 machines.
C
apache-2.0
djw8605/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/condor,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,htcondor/htcondor,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor
7f4192ca175b3d5fc718d4d9c49ce658bc8f3deb
src/auth/userdb-passwd.c
src/auth/userdb-passwd.c
/* Copyright (C) 2002-2003 Timo Sirainen */ #include "config.h" #undef HAVE_CONFIG_H #ifdef USERDB_PASSWD #include "common.h" #include "userdb.h" #include <pwd.h> static void passwd_lookup(const char *user, userdb_callback_t *callback, void *context) { struct user_data data; struct passwd *pw; pw = getpwnam(user); if (pw == NULL) { if (errno != 0) i_error("getpwnam(%s) failed: %m", user); else if (verbose) i_info("passwd(%s): unknown user", user); callback(NULL, context); return; } memset(&data, 0, sizeof(data)); data.uid = pw->pw_uid; data.gid = pw->pw_gid; data.virtual_user = data.system_user = pw->pw_name; data.home = pw->pw_dir; callback(&data, context); } struct userdb_module userdb_passwd = { NULL, NULL, passwd_lookup }; #endif
/* Copyright (C) 2002-2003 Timo Sirainen */ #include "config.h" #undef HAVE_CONFIG_H #ifdef USERDB_PASSWD #include "common.h" #include "userdb.h" #include <pwd.h> static void passwd_lookup(const char *user, userdb_callback_t *callback, void *context) { struct user_data data; struct passwd *pw; size_t len; pw = getpwnam(user); if (pw == NULL) { if (errno != 0) i_error("getpwnam(%s) failed: %m", user); else if (verbose) i_info("passwd(%s): unknown user", user); callback(NULL, context); return; } memset(&data, 0, sizeof(data)); data.uid = pw->pw_uid; data.gid = pw->pw_gid; data.virtual_user = data.system_user = pw->pw_name; len = strlen(pw->pw_dir); if (len < 3 || strcmp(pw->pw_dir + len - 3, "/./") != 0) data.home = pw->pw_dir; else { /* wu-ftpd uses <chroot>/./<dir>. We don't support the dir after chroot, but this should work well enough. */ data.home = t_strndup(pw->pw_dir, len-3); data.chroot = TRUE; } callback(&data, context); } struct userdb_module userdb_passwd = { NULL, NULL, passwd_lookup }; #endif
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with "/./", it's chrooted to.
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with "/./", it's chrooted to.
C
mit
Distrotech/dovecot,LTD-Beget/dovecot,Distrotech/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,damoxc/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot,LTD-Beget/dovecot
e16b6dec212a86fb65db026ddcfcdd89efd30ec5
master.c
master.c
#include "master.h" //Master configurations MODBUSMasterStatus MODBUSMaster; void MODBUSParseResponse( uint8_t *Frame, uint8_t FrameLength ) { //This function parses response from master //Calling it will lead to losing all data and exceptions stored in MODBUSMaster (space will be reallocated) //Allocate memory for union and copy frame to it union MODBUSParser *Parser = malloc( FrameLength ); memcpy( ( *Parser ).Frame, Frame, FrameLength ); if ( MODBUS_MASTER_BASIC ) MODBUSParseResponseBasic( Parser ); //Free used memory free( Parser ); } void MODBUSMasterInit( ) { //Very basic init of master side MODBUSMaster.Request.Frame = malloc( 8 ); MODBUSMaster.Request.Length = 0; MODBUSMaster.Data = malloc( sizeof( MODBUSData ) ); MODBUSMaster.DataLength = 0; }
#include "master.h" //Master configurations MODBUSMasterStatus MODBUSMaster; void MODBUSParseException( union MODBUSParser *Parser ) { //Parse exception frame and write data to MODBUSMaster structure //Allocate memory for exception parser union MODBUSException *Exception = malloc( sizeof( union MODBUSException ) ); memcpy( ( *Exception ).Frame, ( *Parser ).Frame, sizeof( union MODBUSException ) ); //Check CRC if ( MODBUSCRC16( ( *Exception ).Frame, 3 ) != ( *Exception ).Exception.CRC ) { free( Exception ); return; } //Copy data MODBUSMaster.Exception.Address = ( *Exception ).Exception.Address; MODBUSMaster.Exception.Function = ( *Exception ).Exception.Function; MODBUSMaster.Exception.Code = ( *Exception ).Exception.ExceptionCode; MODBUSMaster.Error = 1; free( Exception ); } void MODBUSParseResponse( uint8_t *Frame, uint8_t FrameLength ) { //This function parses response from master //Calling it will lead to losing all data and exceptions stored in MODBUSMaster (space will be reallocated) //Allocate memory for union and copy frame to it union MODBUSParser *Parser = malloc( FrameLength ); memcpy( ( *Parser ).Frame, Frame, FrameLength ); //Check if frame is exception response if ( ( *Parser ).Base.Function & 128 ) { MODBUSParseException( Parser ); } else { if ( MODBUS_MASTER_BASIC ) MODBUSParseResponseBasic( Parser ); } //Free used memory free( Parser ); } void MODBUSMasterInit( ) { //Very basic init of master side MODBUSMaster.Request.Frame = malloc( 8 ); MODBUSMaster.Request.Length = 0; MODBUSMaster.Data = malloc( sizeof( MODBUSData ) ); MODBUSMaster.DataLength = 0; }
Add exceptions parsing (not tested yet)
Add exceptions parsing (not tested yet)
C
mit
Jacajack/modlib
687d7dd560c87624776c33d62b4646b6824bf3c4
Arduino/libraries/MavlinkForArduino/MavlinkForArduino.h
Arduino/libraries/MavlinkForArduino/MavlinkForArduino.h
//Move this directory to ~/sketchbook/libraries // and clone https://github.com/mavlink/c_library.git inside // git clone https://github.com/mavlink/c_library.git ~/sketchbook/libraries/MavlinkForArduino #include "c_library/ardupilotmega/mavlink.h"
//Move this directory to ~/sketchbook/libraries // and clone https://github.com/mavlink/c_library_v2.git inside // git clone https://github.com/mavlink/c_library_V2.git ~/Arduino/libraries/MavlinkForArduino/c_library_v2 #include "c_library_v2/ardupilotmega/mavlink.h"
Use updated mavlink library v2
Use updated mavlink library v2
C
mit
baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite
04ebbdd9ecb46461d3a04c4c5c010136aeb6a3ba
Include/allobjects.h
Include/allobjects.h
/* "allobjects.c" -- Source for precompiled header "allobjects.h" */ #include <stdio.h> #include "string.h" #include "PROTO.h" #include "object.h" #include "objimpl.h" #include "intobject.h" #include "floatobject.h" #include "stringobject.h" #include "tupleobject.h" #include "listobject.h" #include "dictobject.h" #include "methodobject.h" #include "moduleobject.h" #include "funcobject.h" #include "classobject.h" #include "fileobject.h" #include "errors.h" #include "malloc.h" extern char *strdup PROTO((const char *));
/* "allobjects.c" -- Source for precompiled header "allobjects.h" */ #include <stdio.h> #include <string.h> #include "PROTO.h" #include "object.h" #include "objimpl.h" #include "intobject.h" #include "floatobject.h" #include "stringobject.h" #include "tupleobject.h" #include "listobject.h" #include "dictobject.h" #include "methodobject.h" #include "moduleobject.h" #include "funcobject.h" #include "classobject.h" #include "fileobject.h" #include "errors.h" #include "malloc.h" extern char *strdup PROTO((const char *));
Include <string.h> instead of "string.h".
Include <string.h> instead of "string.h".
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
d02f1c16e441c48e450d05ac145c53282ebd4aa4
mordor/streams/limited.h
mordor/streams/limited.h
#ifndef __MORDOR_LIMITED_STREAM_H__ #define __MORDOR_LIMITED_STREAM_H__ // Copyright (c) 2009 - Mozy, Inc. #include "filter.h" namespace Mordor { class LimitedStream : public MutatingFilterStream { public: typedef boost::shared_ptr<LimitedStream> ptr; public: LimitedStream(Stream::ptr parent, long long size, bool own = true); bool strict() { return m_strict; } void strict(bool strict) { m_strict = strict; } bool supportsSeek() { return parent()->supportsSeek(); } bool supportsTell() { return true; } bool supportsSize() { return true; } bool supportsTruncate() { return false; } size_t read(Buffer &b, size_t len); size_t write(const Buffer &b, size_t len); long long seek(long long offset, Anchor anchor = BEGIN); long long size(); void truncate(long long size); void unread(const Buffer &b, size_t len); private: long long m_pos, m_size; bool m_strict; }; } #endif
#ifndef __MORDOR_LIMITED_STREAM_H__ #define __MORDOR_LIMITED_STREAM_H__ // Copyright (c) 2009 - Mozy, Inc. #include "filter.h" namespace Mordor { class LimitedStream : public MutatingFilterStream { public: typedef boost::shared_ptr<LimitedStream> ptr; public: LimitedStream(Stream::ptr parent, long long size, bool own = true); void reset() { m_pos = 0; } void reset(long long size) { m_pos = 0; m_size = size; } bool strict() { return m_strict; } void strict(bool strict) { m_strict = strict; } bool supportsSeek() { return parent()->supportsSeek(); } bool supportsTell() { return true; } bool supportsSize() { return true; } bool supportsTruncate() { return false; } size_t read(Buffer &b, size_t len); size_t write(const Buffer &b, size_t len); long long seek(long long offset, Anchor anchor = BEGIN); long long size(); void truncate(long long size); void unread(const Buffer &b, size_t len); private: long long m_pos, m_size; bool m_strict; }; } #endif
Support for resetting a LimitedStream
Support for resetting a LimitedStream Both current position, and total length. Change-Id: Ia484e8b91e98d8cd2153496cbb1d5b183dacb14f Reviewed-on: https://gerrit.dechocorp.com/8980 Reviewed-by: Punky Brewster (labs admin) <[email protected]> Reviewed-by: Jeremy Stanley <[email protected]>
C
bsd-3-clause
mozy/mordor,cgaebel/mordor,ccutrer/mordor,cgaebel/mordor,adfin/mordor,ccutrer/mordor,mtanski/mordor,mozy/mordor,mtanski/mordor,adfin/mordor,ccutrer/mordor,mtanski/mordor,mozy/mordor,adfin/mordor
cd6ab8cc43ee0171d90bf6a0b94b19e12fb831c5
test/CodeGen/2004-02-13-Memset.c
test/CodeGen/2004-02-13-Memset.c
// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3 #ifndef memset void *memset(void*, int, unsigned long); #endif #ifndef bzero void bzero(void*, unsigned long); #endif void test(int* X, char *Y) { // CHECK: call i8* llvm.memset memset(X, 4, 1000); // CHECK: call void bzero bzero(Y, 100); }
// RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3 typedef __SIZE_TYPE__ size_t; void *memset(void*, int, size_t); void bzero(void*, size_t); void test(int* X, char *Y) { // CHECK: call i8* llvm.memset memset(X, 4, 1000); // CHECK: call void bzero bzero(Y, 100); }
Use the correct definition for memset.
Use the correct definition for memset. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136188 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
d3e7c3a0a39b8214b7c015566b67acba8ae3bfa7
src/ufrn_bti_itp/recursividade_e_modularizacao/q3_occurrences.c
src/ufrn_bti_itp/recursividade_e_modularizacao/q3_occurrences.c
#include <stdio.h> int ssearch(int number, int target){ if (number == 0) if (target == 0) return 1; else return 0; else return ssearch(number/10, target) + (number % 10 == target); } int main(){ printf("%d\n", ssearch(762021192, 2)); return 0; }
Resolve q3 (pythonic way? so close)
Resolve q3 (pythonic way? so close)
C
unknown
Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs
32e9ffa0d946ff15494526ef91a3c6ca6dd5b4e4
Pod/VOKAlertHelper/VOKAlertHelper.h
Pod/VOKAlertHelper/VOKAlertHelper.h
// // VOKAlertHelper.h // VOKUtilities // // Created by Rachel Hyman on 6/15/15. // Copyright (c) 2015 Vokal. All rights reserved. // #import <UIKit/UIKit.h> #import <VOKAlertAction.h> typedef void(^VOKAlertHelperActionBlock)(void); NS_ASSUME_NONNULL_BEGIN @interface VOKAlertHelper : NSObject /** * Displays an alert in the OS-appropriate fashion. * * @param viewController View controller responsible for presenting the alert. * @param title Title for the alert. * @param message Message for the alert. * @param buttons Array of VOKAlertAction objects that correspond to button(s). Must have at least one object. */ + (void)showAlertFromViewController:(UIViewController *)viewController withTitle:(nullable NSString *)title message:(nullable NSString *)message buttons:(NSArray<VOKAlertAction *> *)buttons; @end NS_ASSUME_NONNULL_END
// // VOKAlertHelper.h // VOKUtilities // // Created by Rachel Hyman on 6/15/15. // Copyright (c) 2015 Vokal. All rights reserved. // #import <UIKit/UIKit.h> #import "VOKAlertAction.h" typedef void(^VOKAlertHelperActionBlock)(void); NS_ASSUME_NONNULL_BEGIN @interface VOKAlertHelper : NSObject /** * Displays an alert in the OS-appropriate fashion. * * @param viewController View controller responsible for presenting the alert. * @param title Title for the alert. * @param message Message for the alert. * @param buttons Array of VOKAlertAction objects that correspond to button(s). Must have at least one object. */ + (void)showAlertFromViewController:(UIViewController *)viewController withTitle:(nullable NSString *)title message:(nullable NSString *)message buttons:(NSArray<VOKAlertAction *> *)buttons; @end NS_ASSUME_NONNULL_END
Use quotes for local include
Use quotes for local include
C
mit
designatednerd/VOKUtilities,vokal/VOKUtilities,designatednerd/VOKUtilities,designatednerd/VOKUtilities,brockboland/VOKUtilities,brockboland/VOKUtilities,vokal/VOKUtilities,vokal/VOKUtilities,brockboland/VOKUtilities
8d066a64a7a835e3b5b173fa637b2d66e2c3e2c2
WikipediaUnitTests/Code/WMFDisambiguationPagesViewController.h
WikipediaUnitTests/Code/WMFDisambiguationPagesViewController.h
#import "WMFArticleListTableViewController.h" @interface WMFDisambiguationPagesViewController : WMFArticleListTableViewController @property (nonatomic, strong, readonly) MWKArticle* article; - (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore; @end
#import "WMFArticleListDataSourceTableViewController.h" @interface WMFDisambiguationPagesViewController : WMFArticleListDataSourceTableViewController @property (nonatomic, strong, readonly) MWKArticle* article; - (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore; @end
Update disambiguation VC base class
Update disambiguation VC base class
C
mit
montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia
63257791efa4c36b614386ab3e32f8d5f0e3a715
DataSet.h
DataSet.h
#ifndef DATASET_H #define DATASET_H #include "Record.h" #include "Filter.h" #include "RIVVector.h" #include <map> #include <string> #include <vector> template<typename... Ts> class RIVDataSet { public: RIVVector<RIVRecord<Ts...>> records; RIVVector<Filter*> filters; }; //class RIVDataSet //{ //private : // //map<string,vector<int>> int_records; // std::vector<RIVRecord<float>> float_records; // // std::vector<Filter*> filters; // // std::map<int,bool> filtered_values; //Whether or not the value was filtered by any applied filters // //vector<int> filtered_value_indices; //Record value indices that do not pass the filters. //CAUTION: Obsolete, not efficient // //public: // RIVDataSet(void); // ~RIVDataSet(void); // //void AddData(string name,vector<int>); // void AddRecord(RIVRecord<float>); // std::pair<float,float>* MinMax(int); // size_t NumberOfRecords(); // size_t NumberOfValuesPerRecord(); // RIVRecord<float>* GetRecord(int); // float* GetRecordValue(int,int); // void AddFilter(Filter*); // bool HasFilters(); // void ClearFilters(); // void ApplyFilters(); //}; #endif
#ifndef DATASET_H #define DATASET_H #include "Record.h" #include "Filter.h" #include "RIVVector.h" #include <map> #include <string> #include <vector> template<typename... Ts> class RIVDataSet { public: RIVVector<RIVRecord<Ts...>> records; }; //class RIVDataSet //{ //private : // //map<string,vector<int>> int_records; // std::vector<RIVRecord<float>> float_records; // // std::vector<Filter*> filters; // // std::map<int,bool> filtered_values; //Whether or not the value was filtered by any applied filters // //vector<int> filtered_value_indices; //Record value indices that do not pass the filters. //CAUTION: Obsolete, not efficient // //public: // RIVDataSet(void); // ~RIVDataSet(void); // //void AddData(string name,vector<int>); // void AddRecord(RIVRecord<float>); // std::pair<float,float>* MinMax(int); // size_t NumberOfRecords(); // size_t NumberOfValuesPerRecord(); // RIVRecord<float>* GetRecord(int); // float* GetRecordValue(int,int); // void AddFilter(Filter*); // bool HasFilters(); // void ClearFilters(); // void ApplyFilters(); //}; #endif
Revert "Introduced a neat vector class"
Revert "Introduced a neat vector class" This reverts commit 15b0b1147ad0f2f77ae9b485ceb323c84f8d439f.
C
mit
gerardsimons/pbr-visualizer,gerardsimons/pbr-visualizer,gerardsimons/pbr-visualizer,gerardsimons/pbr-visualizer
46033b0be1cce8f444eb8e80e1b26677f161194f
test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c
test/FrontendC/2011-03-08-ZeroFieldUnionInitializer.c
typedef struct { union { struct { } __attribute((packed)); }; } fenv_t; const fenv_t _FE_DFL_ENV = {{{ 0, 0, 0, 0 }}};
// RUN: %llvmgcc -S %s typedef struct { union { struct { } __attribute((packed)); }; } fenv_t; const fenv_t _FE_DFL_ENV = {{{ 0, 0, 0, 0 }}};
Add a RUN line to the test case to make it functional. <rdar://problem/9055247>
Add a RUN line to the test case to make it functional. <rdar://problem/9055247> git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@127312 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm
571d83314ae9424b23d35ef1b7c3efce6403aad3
sha/sha.h
sha/sha.h
/***************************************************************************/ /* sha.h */ /* */ /* SHA-1 code header file. */ /* Taken from the public domain implementation by Peter C. Gutmann */ /* on 2 Sep 1992, modified by Carl Ellison to be SHA-1. */ /***************************************************************************/ #ifndef _SHA_H_ #define _SHA_H_ /* Define APG_LITTLE_ENDIAN if the machine is little-endian */ #define APG_LITTLE_ENDIAN /* Useful defines/typedefs */ typedef unsigned char BYTE ; typedef unsigned long LONG ; /* The SHA block size and message digest sizes, in bytes */ #define SHA_BLOCKSIZE 64 #define SHA_DIGESTSIZE 20 /* The structure for storing SHA info */ typedef struct { LONG digest[ 5 ] ; /* Message digest */ LONG countLo, countHi ; /* 64-bit bit count */ LONG data[ 16 ] ; /* SHA data buffer */ LONG slop ; /* # of bytes saved in data[] */ } apg_SHA_INFO ; void apg_shaInit( apg_SHA_INFO *shaInfo ) ; void apg_shaUpdate( apg_SHA_INFO *shaInfo, BYTE *buffer, int count ) ; void apg_shaFinal( apg_SHA_INFO *shaInfo, BYTE hash[SHA_DIGESTSIZE] ) ; #endif /* _SHA_H_ */
/***************************************************************************/ /* sha.h */ /* */ /* SHA-1 code header file. */ /* Taken from the public domain implementation by Peter C. Gutmann */ /* on 2 Sep 1992, modified by Carl Ellison to be SHA-1. */ /***************************************************************************/ #ifndef _SHA_H_ #define _SHA_H_ #include <stdint.h> /* Define APG_LITTLE_ENDIAN if the machine is little-endian */ #define APG_LITTLE_ENDIAN /* Useful defines/typedefs */ typedef uint8_t BYTE ; typedef uint32_t LONG ; /* The SHA block size and message digest sizes, in bytes */ #define SHA_BLOCKSIZE 64 #define SHA_DIGESTSIZE 20 /* The structure for storing SHA info */ typedef struct { LONG digest[ 5 ] ; /* Message digest */ LONG countLo, countHi ; /* 64-bit bit count */ LONG data[ 16 ] ; /* SHA data buffer */ LONG slop ; /* # of bytes saved in data[] */ } apg_SHA_INFO ; void apg_shaInit( apg_SHA_INFO *shaInfo ) ; void apg_shaUpdate( apg_SHA_INFO *shaInfo, BYTE *buffer, int count ) ; void apg_shaFinal( apg_SHA_INFO *shaInfo, BYTE hash[SHA_DIGESTSIZE] ) ; #endif /* _SHA_H_ */
Use uint8_t and uint32_t in SHA-1 implementation.
Use uint8_t and uint32_t in SHA-1 implementation.
C
bsd-3-clause
wilx/apg,wilx/apg,rogerapras/apg,rogerapras/apg,wilx/apg,rogerapras/apg,rogerapras/apg,wilx/apg