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
|
---|---|---|---|---|---|---|---|---|---|
d8aba3bf19073a4a95a31525d049f3675f0b54ff | lib/fnv_1a.c | lib/fnv_1a.c | #include <assert.h>
#include "fnv_1a.h"
uint128_t fnv_1a(const void * restrict const buf,
const size_t len,
const size_t skip_pos,
const size_t skip_len)
{
assert((skip_pos <= len) && (skip_pos + skip_len <= len));
static const uint128_t prime =
(((uint128_t)0x0000000001000000) << 64) | 0x000000000000013B;
uint128_t hash =
(((uint128_t)0x6C62272E07BB0142) << 64) | 0x62B821756295C58D;
// two consecutive loops should be faster than one loop with an "if"
const uint8_t * restrict const bytes = buf;
for (size_t i = 0; i < skip_pos; i++) {
hash ^= bytes[i];
hash *= prime;
}
for (size_t i = skip_pos + skip_len; i < len; i++) {
hash ^= bytes[i];
hash *= prime;
}
return hash;
}
| #include "fnv_1a.h"
#include "debug.h"
uint128_t fnv_1a(const void * restrict const buf,
const size_t len,
const size_t skip_pos,
const size_t skip_len)
{
assert((skip_pos <= len) && (skip_pos + skip_len <= len),
"len %zu, skip_pos %zu, skip_len %zu", len, skip_pos, skip_len);
static const uint128_t prime =
(((uint128_t)0x0000000001000000) << 64) | 0x000000000000013B;
uint128_t hash =
(((uint128_t)0x6C62272E07BB0142) << 64) | 0x62B821756295C58D;
// two consecutive loops should be faster than one loop with an "if"
const uint8_t * restrict const bytes = buf;
for (size_t i = 0; i < skip_pos; i++) {
hash ^= bytes[i];
hash *= prime;
}
for (size_t i = skip_pos + skip_len; i < len; i++) {
hash ^= bytes[i];
hash *= prime;
}
return hash;
}
| Use the new assert() macro | Use the new assert() macro
| C | bsd-2-clause | NTAP/quant,NTAP/quant,NTAP/quant |
19738ff61fecd49c45e9002bb79ea8c62d58bacb | Code/Support/Parsers/XML/RKXMLParserLibXML.h | Code/Support/Parsers/XML/RKXMLParserLibXML.h | //
// RKXMLParser.h
//
// Created by Jeremy Ellison on 2011-02-28.
// Copyright 2011 RestKit
//
// 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 "../../RKParser.h"
/**
This is a dead simple XML parser that uses libxml2 to parse an XML document
into a dictionary. It is designed specifically for use with RestKit. It
does not support any fanciness like Namespaces, DTDs, or other nonsense.
It does not save attributes on tags, it only cares about nested content and text.
*/
@interface RKXMLParserLibXML : NSObject <RKParser> {
}
- (NSDictionary*)parseXML:(NSString*)XML;
@end
| //
// RKXMLParser.h
//
// Created by Jeremy Ellison on 2011-02-28.
// Copyright 2011 RestKit
//
// 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 "../../RKParser.h"
/**
This is a dead simple XML parser that uses libxml2 to parse an XML document
into a dictionary. It is designed specifically for use with RestKit. It
does not support any fanciness like Namespaces, DTDs, or other nonsense.
It handles text nodes, attributes, and nesting structures and builds key-value
coding compliant representations of the XML structure.
It currently does not support XML generation -- only parsing.
*/
@interface RKXMLParserLibXML : NSObject <RKParser> {
}
- (NSDictionary *)parseXML:(NSString *)XML;
@end
| Update outdated comments in the XML parser header | Update outdated comments in the XML parser header
| C | apache-2.0 | qingsong-xu/RestKit,dx285/RestKit,fhchina/RestKit,0dayZh/RestKit,pbogdanv/RestKit,zilaiyedaren/RestKit,common2015/RestKit,timbodeit/RestKit,fhchina/RestKit,erichedstrom/RestKit,CodewareTechnology/RestKit,HYPERHYPER/RestKit2,concreteinteractive/RestKit,braindata/RestKit-1,TimeIncOSS/RestKit,naqi/RestKit,oligriffiths/RestKit,oye-lionel/GithubTest,TwinEngineLabs-Engineering/RestKit-TEL,wuxsoft/RestKit,djz-code/RestKit,sachin-khard/NucleusRestKit,LiuShulong/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,StasanTelnov/RestKit,Gaantz/RestKit,TheFarm/RestKit,justinyaoqi/RestKit,damiannz/RestKit,cryptojuice/RestKit,braindata/RestKit-1,hejunbinlan/RestKit,cnbin/RestKit,Meihualu/RestKit,aleufms/RestKit,ChinaPicture/RestKit,jrtaal/RestKit,wireitcollege/RestKit,ppierson/RestKit,sandyway/RestKit,nphkh/RestKit,cfis/RestKit,QLGu/RestKit,margarina/RestKit-latest,TwinEngineLabs-Engineering/RestKit-TEL,adozenlines/RestKit,jrtaal/RestKit,antondarki/RestKit,mcfedr/RestKit,gumdal/RestKit,Papercloud/RestKit,zilaiyedaren/RestKit,ForrestAlfred/RestKit,money-alex2006hw/RestKit,nalindz/pulpfiction-RestKit,gank0326/restkit,wireitcollege/RestKit,antondarki/RestKit,youssman/RestKit,qingsong-xu/RestKit,HYPERHYPER/RestKit2,coderChrisLee/RestKit,nalindz/pulpfiction-RestKit,apontador/RestKit,jrtaal/RestKit,REXLabsInc/RestKit,ipmobiletech/RestKit,jonesgithub/RestKit,sandyway/RestKit,agworld/RestKit,SuPair/RestKit,wuxsoft/RestKit,moneytree/RestKit,timbodeit/RestKit,sachin-khard/NucleusRestKit,hanangellove/RestKit,braindata/RestKit,QLGu/RestKit,samanalysis/RestKit,gank0326/restkit,nphkh/RestKit,nett55/RestKit,lucasecf/RestKit,margarina/RestKit-latest,cryptojuice/RestKit,mumer92/RestKit,concreteinteractive/RestKit,SuPair/RestKit,moritzh/RestKit,moritzh/RestKit,oye-lionel/GithubTest,ChinaPicture/RestKit,money-alex2006hw/RestKit,hejunbinlan/RestKit,zhenlove/RestKit,PonderProducts/RestKit,percysnoodle/RestKit,naqi/RestKit,kevmeyer/RestKit,lmirosevic/RestKit,oye-lionel/GithubTest,SinnerSchraderMobileMirrors/RestKit,baumatron/RestKit,cfis/RestKit,Livestream/RestKit,hejunbinlan/RestKit,fedegasp/RestKit,sachin-khard/NucRestKit,moneytree/RestKit,gank0326/restkit,hanangellove/RestKit,ppierson/RestKit,hejunbinlan/RestKit,zaichang/RestKit,lmirosevic/RestKit,dx285/RestKit,Papercloud/RestKit,sandyway/RestKit,moneytree/RestKit,Livestream/RestKit,0x73/RestKit,oligriffiths/RestKit,Flutterbee/RestKit,sachin-khard/NucleusRestKit,timbodeit/RestKit,mberube09/RestKit,braindata/RestKit,zhenlove/RestKit,cryptojuice/RestKit,taptaptap/RestKit,zjh171/RestKit,jonesgithub/RestKit,paperlesspost/RestKit,pbogdanv/RestKit,REXLabsInc/RestKit,lucasecf/RestKit,lucasecf/RestKit,oligriffiths/RestKit,zjh171/RestKit,wireitcollege/RestKit,mavericksunny/RestKit,cryptojuice/RestKit,adozenlines/RestKit,Juraldinio/RestKit,aleufms/RestKit,ForrestAlfred/RestKit,LiuShulong/RestKit,coderChrisLee/RestKit,adozenlines/RestKit,LiuShulong/RestKit,cnbin/RestKit,CenterDevice/RestKit,vilinskiy-playdayteam/RestKit,REXLabsInc/RestKit,baumatron/RestKit,canaydogan/RestKit,loverbabyz/RestKit,DocuSignDev/RestKit,SuPair/RestKit,RyanCodes/RestKit,justinyaoqi/RestKit,ipmobiletech/RestKit,percysnoodle/RestKit,CodewareTechnology/RestKit,loverbabyz/RestKit,pat2man/RestKit,nett55/RestKit,SinnerSchraderMobileMirrors/RestKit,apontador/RestKit,lmirosevic/RestKit,gumdal/RestKit,braindata/RestKit-1,gauravstomar/RestKit,mikarun/RestKit,lmirosevic/RestKit,moritzh/RestKit,antondarki/RestKit,DejaMi/RestKit,Bogon/RestKit,apontador/RestKit,imton/RestKit,gumdal/RestKit,wireitcollege/RestKit,SuPair/RestKit,hanangellove/RestKit,ppierson/RestKit,loverbabyz/RestKit,money-alex2006hw/RestKit,CodewareTechnology/RestKit,canaydogan/RestKit,taptaptap/RestKit,cnbin/RestKit,DocuSignDev/RestKit,youssman/RestKit,Bogon/RestKit,Juraldinio/RestKit,lucasecf/RestKit,goldstar/RestKit,nalindz/pulpfiction-RestKit,thomaschristensen/RestKit,CenterDevice/RestKit,sachin-khard/NucRestKit,DejaMi/RestKit,0dayZh/RestKit,canaydogan/RestKit,caamorales/RestKit,caamorales/RestKit,CenterDevice/RestKit,apontador/RestKit,common2015/RestKit,gauravstomar/RestKit,qingsong-xu/RestKit,vilinskiy-playdayteam/RestKit,Bogon/RestKit,Juraldinio/RestKit,ForrestAlfred/RestKit,adozenlines/RestKit,thomaschristensen/RestKit,zilaiyedaren/RestKit,kevmeyer/RestKit,imton/RestKit,nalindz/pulpfiction-RestKit,0x73/RestKit,0dayZh/RestKit,mikarun/RestKit,gauravstomar/RestKit,agworld/RestKit,dx285/RestKit,samanalysis/RestKit,mikarun/RestKit,qingsong-xu/RestKit,SinnerSchraderMobileMirrors/RestKit,taptaptap/RestKit,wuxsoft/RestKit,pbogdanv/RestKit,fedegasp/RestKit,oye-lionel/GithubTest,pat2man/RestKit,Flutterbee/RestKit,common2015/RestKit,djz-code/RestKit,djz-code/RestKit,Meihualu/RestKit,jonesgithub/RestKit,goldstar/RestKit,sachin-khard/NucRestKit,taptaptap/RestKit,concreteinteractive/RestKit,braindata/RestKit,QLGu/RestKit,damiannz/RestKit,wangjiangwen/RestKit,nett55/RestKit,ipmobiletech/RestKit,samkrishna/RestKit,fedegasp/RestKit,djz-code/RestKit,canaydogan/RestKit,Gaantz/RestKit,forcedotcom/RestKit,LiuShulong/RestKit,money-alex2006hw/RestKit,Juraldinio/RestKit,justinyaoqi/RestKit,cnbin/RestKit,hejunbinlan/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,wuxsoft/RestKit,Juraldinio/RestKit,HarrisLee/RestKit,QLGu/RestKit,ChinaPicture/RestKit,adozenlines/RestKit,coderChrisLee/RestKit,Meihualu/RestKit,coderChrisLee/RestKit,nphkh/RestKit,jrtaal/RestKit,cryptojuice/RestKit,mberube09/RestKit,money-alex2006hw/RestKit,HYPERHYPER/RestKit2,wyzzarz/RestKit,RyanCodes/RestKit,0x73/RestKit,TheFarm/RestKit,orta/RestKit,HYPERHYPER/RestKit2,braindata/RestKit-1,fhchina/RestKit,oligriffiths/RestKit,zhenlove/RestKit,RestKit/RestKit,aleufms/RestKit,mberube09/RestKit,ipmobiletech/RestKit,jonesgithub/RestKit,dx285/RestKit,percysnoodle/RestKit,dx285/RestKit,Gaantz/RestKit,apontador/RestKit,margarina/RestKit-latest,vilinskiy-playdayteam/RestKit,TimeIncOSS/RestKit,wyzzarz/RestKit,Flutterbee/RestKit,imton/RestKit,sachin-khard/NucleusRestKit,Gaantz/RestKit,RyanCodes/RestKit,LiuShulong/RestKit,CodewareTechnology/RestKit,hanangellove/RestKit,fhchina/RestKit,DocuSignDev/RestKit,zjh171/RestKit,wangjiangwen/RestKit,PonderProducts/RestKit,damiannz/RestKit,lmirosevic/RestKit,mikarun/RestKit,aleufms/RestKit,lucasecf/RestKit,moritzh/RestKit,baumatron/RestKit,orta/RestKit,Livestream/RestKit,paperlesspost/RestKit,youssman/RestKit,thomaschristensen/RestKit,mavericksunny/RestKit,zjh171/RestKit,gauravstomar/RestKit,TheFarm/RestKit,moneytree/RestKit,0x73/RestKit,kevmeyer/RestKit,caamorales/RestKit,HarrisLee/RestKit,imton/RestKit,PonderProducts/RestKit,forcedotcom/RestKit,samkrishna/RestKit,sachin-khard/NucleusRestKit,caamorales/RestKit,qingsong-xu/RestKit,mcfedr/RestKit,baumatron/RestKit,DejaMi/RestKit,HarrisLee/RestKit,wireitcollege/RestKit,timbodeit/RestKit,baumatron/RestKit,ChinaPicture/RestKit,loverbabyz/RestKit,antondarki/RestKit,zjh171/RestKit,jrtaal/RestKit,mavericksunny/RestKit,wuxsoft/RestKit,kevmeyer/RestKit,Meihualu/RestKit,nphkh/RestKit,gank0326/restkit,braindata/RestKit,cnbin/RestKit,forcedotcom/RestKit,loverbabyz/RestKit,sachin-khard/NucRestKit,RestKit/RestKit,pbogdanv/RestKit,moritzh/RestKit,zilaiyedaren/RestKit,TimeIncOSS/RestKit,0x73/RestKit,agworld/RestKit,CenterDevice/RestKit,samanalysis/RestKit,gank0326/restkit,damiannz/RestKit,antondarki/RestKit,coderChrisLee/RestKit,Flutterbee/RestKit,kevmeyer/RestKit,goldstar/RestKit,sandyway/RestKit,Bogon/RestKit,naqi/RestKit,paperlesspost/RestKit,PonderProducts/RestKit,margarina/RestKit-latest,HarrisLee/RestKit,oye-lionel/GithubTest,common2015/RestKit,thomaschristensen/RestKit,zilaiyedaren/RestKit,fhchina/RestKit,wangjiangwen/RestKit,zaichang/RestKit,canaydogan/RestKit,pat2man/RestKit,CodewareTechnology/RestKit,SuPair/RestKit,HYPERHYPER/RestKit2,aleufms/RestKit,mikarun/RestKit,ppierson/RestKit,StasanTelnov/RestKit,pat2man/RestKit,zhenlove/RestKit,wangjiangwen/RestKit,ipmobiletech/RestKit,ForrestAlfred/RestKit,nett55/RestKit,DejaMi/RestKit,paperlesspost/RestKit,wyzzarz/RestKit,sachin-khard/NucRestKit,pat2man/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,wangjiangwen/RestKit,Meihualu/RestKit,fedegasp/RestKit,Gaantz/RestKit,HarrisLee/RestKit,mumer92/RestKit,vilinskiy-playdayteam/RestKit,mumer92/RestKit,ForrestAlfred/RestKit,nphkh/RestKit,jonesgithub/RestKit,erichedstrom/RestKit,mumer92/RestKit,justinyaoqi/RestKit,0dayZh/RestKit,Papercloud/RestKit,concreteinteractive/RestKit,justinyaoqi/RestKit,percysnoodle/RestKit,naqi/RestKit,common2015/RestKit,braindata/RestKit-1,nett55/RestKit,QLGu/RestKit,Livestream/RestKit,erichedstrom/RestKit,RestKit/RestKit,youssman/RestKit,forcedotcom/RestKit,gauravstomar/RestKit,timbodeit/RestKit,fedegasp/RestKit,imton/RestKit,zhenlove/RestKit,Bogon/RestKit,hanangellove/RestKit,Papercloud/RestKit,DejaMi/RestKit,Papercloud/RestKit,mumer92/RestKit,pbogdanv/RestKit,agworld/RestKit,ChinaPicture/RestKit,samanalysis/RestKit,concreteinteractive/RestKit,RyanCodes/RestKit,samkrishna/RestKit,wyzzarz/RestKit,StasanTelnov/RestKit,mavericksunny/RestKit,RyanCodes/RestKit,ppierson/RestKit,mberube09/RestKit,sandyway/RestKit,caamorales/RestKit,oligriffiths/RestKit,zaichang/RestKit,SinnerSchraderMobileMirrors/RestKit,zaichang/RestKit,damiannz/RestKit,goldstar/RestKit,cfis/RestKit,samanalysis/RestKit,moneytree/RestKit,REXLabsInc/RestKit,youssman/RestKit |
1429550f5d9b6df0693b7cc10de4258982b6251d | include/core/SkMilestone.h | include/core/SkMilestone.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 58
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 59
#endif
| Update Skia milestone to 59 | Update Skia milestone to 59
BUG=skia:
Change-Id: Ifa8fa20a838b2899a1230bf51cea7c4cf28971d8
Reviewed-on: https://skia-review.googlesource.com/9139
Reviewed-by: Heather Miller <[email protected]>
| C | bsd-3-clause | Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc |
d7347c0f845d280f8fdb65d08fffeb2f79903be8 | src/include/libbad_base.h | src/include/libbad_base.h | /**
* @file include/libbad_base.h
* @author Bryce Davis
* @date 19 November 2015
* @brief Header file for internal libbad declarations
* @copyright Copyright (c) 2015, Bryce Davis. Released under the MIT License.
* See LICENSE.txt for details.
*/
#ifndef _LIBBAD_BASE_H
#define _LIBBAD_BASE_H
/**
* @typedef A convenience typedef for long long ints.
*/
typedef long long int llint;
/**
* @typedef A convenience typedef for long doubles.
*/
typedef long double ldouble;
/**
* @union DATA
* @brief A data value for libbad data structures.
*
* A DATA can hold either a long long int, a long double, or a pointer. Takes
* up 16 bytes.
*/
typedef union libbad_data_t {
llint data_int;
ldouble data_dbl;
void* data_ptr;
} DATA;
#endif
| /**
* @file include/libbad_base.h
* @author Bryce Davis
* @date 19 November 2015
* @brief Header file for internal libbad declarations
* @copyright Copyright (c) 2015, Bryce Davis. Released under the MIT License.
* See LICENSE.txt for details.
*/
#ifndef _LIBBAD_BASE_H
#define _LIBBAD_BASE_H
/**
* A convenience typedef for long long ints.
*/
typedef long long int llint;
/**
* A convenience typedef for long doubles.
*/
typedef long double ldouble;
/**
* @union libbad_data_t
* @brief A data value for libbad data structures.
*
* An instance of libbad_data_t can hold either a long long int, a long double,
* or a pointer. Takes up 16 bytes.
*/
union libbad_data_t {
llint data_int; /**< A long long integer value (8 bytes) */
ldouble data_dbl; /**< A long double value (16 bytes) */
void* data_ptr; /**< A pointer value (8 bytes) */
};
/**
* Use DATA instead of "union libbad_data_t"
*/
typedef union libbad_data_t DATA;
#endif
| Restructure implementation and documentation of DATA/libbad_data_t | Restructure implementation and documentation of DATA/libbad_data_t
| C | mit | mahimahi42/libbad |
6f24862a543587f12ad33612ac4c8b29b61ab556 | include/objects.h | include/objects.h | #include <vector>
#include <map>
#include <string>
using namespace std;
#ifndef OBJECTS_H
#define OBJECTS_H
union DataValue {
string val_s;
long int val_i;
float val_f;
double val_d;
};
typedef map<string, DataValue> DataMap;
typedef map<string, DataValue>::iterator DataIterator;
class DataInstance {
private:
int weight;
DataMap dataStore;
public:
DataInstance();
~DataInstance();
};
class DataObject {
private:
vector<DataInstance> instances;
public:
DataObject();
~DataObject();
};
#endif | #ifndef OBJECTS_H
#define OBJECTS_H
#include <vector>
#include <map>
#include <string>
using namespace std;
class IntDataValue : public DataValue
{
private:
public:
IntDataValue(int val): value(val);
void compareWith(DataValue &I) {
if(I.value < this->value) return -1;
else if(I.value == this->value) return 0;
return 1;
}
void updateTo(DataValue &I) {
this->value = I.value;
}
int value;
};
class DoubleDataValue : public DataValue
{
private:
public:
DoubleDataValue(double val): value(val);
void compareWith(DataValue &I) {
if(this->value < I.value) return -1;
else if(I.value == this->value) return 0;
return 1;
}
void updateTo(DataValue &I) {
this->value = I.value;
}
double value;
};
class DataValue {
public:
DataValue();
// CompareWith(I): return -1 if lesser, 0 if equal, 1 if greater
virtual void compareWith(DataValue &I) = 0;
// UpdateTo(I): updates value of current object to match I
virtual void updateTo(DataValue &I) = 0;
void updateIfLargerThan(DataValue &I) {
/*Implement : check for typeId matching*/
if(this->compareWith(I)==1)
this->updateTo(I);
}
~DataValue();
};
typedef map<string, DataValue> DataMap;
typedef map<string, DataValue>::iterator DataIterator;
class DataInstance {
private:
int weight;
DataMap dataStore;
public:
DataInstance();
DataInstance(DataInstance &instance);
~DataInstance();
};
class DataObject {
private:
vector<DataInstance> instances;
public:
DataObject();
~DataObject();
};
#endif | Make an abstract DataValue class, and implement Double and IntegerValues | Make an abstract DataValue class, and implement Double and IntegerValues
| C | mit | Akshay809/kopSkylines,Akshay809/kopSkylines |
5d4d638f39d42ef3b1288038f319fc50d254a903 | user_modules.h | user_modules.h | // [email protected]
// branch=master
#ifndef __USER_MODULES_H__
#define __USER_MODULES_H__
#define LUA_USE_BUILTIN_STRING // for string.xxx()
#define LUA_USE_BUILTIN_TABLE // for table.xxx()
#define LUA_USE_BUILTIN_COROUTINE // for coroutine.xxx()
#define LUA_USE_BUILTIN_MATH // for math.xxx(), partially work
// #define LUA_USE_BUILTIN_IO // for io.xxx(), partially work
// #define LUA_USE_BUILTIN_OS // for os.xxx(), not work
// #define LUA_USE_BUILTIN_DEBUG // for debug.xxx(), not work
#define LUA_USE_MODULES
#ifdef LUA_USE_MODULES
#define LUA_USE_MODULES_NODE
#define LUA_USE_MODULES_FILE
#define LUA_USE_MODULES_GPIO
#define LUA_USE_MODULES_WIFI
#define LUA_USE_MODULES_NET
#define LUA_USE_MODULES_PWM
#define LUA_USE_MODULES_I2C
#define LUA_USE_MODULES_SPI
#define LUA_USE_MODULES_TMR
#define LUA_USE_MODULES_ADC
#define LUA_USE_MODULES_UART
#define LUA_USE_MODULES_OW
#define LUA_USE_MODULES_BIT
#define LUA_USE_MODULES_MQTT
#define LUA_USE_MODULES_COAP
#define LUA_USE_MODULES_U8G
#define LUA_USE_MODULES_WS2812
#define LUA_USE_MODULES_CJSON
#endif /* LUA_USE_MODULES */
#endif /* __USER_MODULES_H__ */
| // [email protected]
// branch=master
#ifndef __USER_MODULES_H__
#define __USER_MODULES_H__
#define LUA_USE_BUILTIN_STRING // for string.xxx()
#define LUA_USE_BUILTIN_TABLE // for table.xxx()
#define LUA_USE_BUILTIN_COROUTINE // for coroutine.xxx()
#define LUA_USE_BUILTIN_MATH // for math.xxx(), partially work
// #define LUA_USE_BUILTIN_IO // for io.xxx(), partially work
// #define LUA_USE_BUILTIN_OS // for os.xxx(), not work
// #define LUA_USE_BUILTIN_DEBUG // for debug.xxx(), not work
#define LUA_USE_MODULES
#ifdef LUA_USE_MODULES
// user modules
#endif /* LUA_USE_MODULES */
#endif /* __USER_MODULES_H__ */
| Replace all user modules with token | Replace all user modules with token
| C | mit | marcelstoer/nodemcu-custom-build |
7ac07664b96c582b40fe43149d9f7d46a22af147 | test/Analysis/std-c-library-functions-inlined.c | test/Analysis/std-c-library-functions-inlined.c | // RUN: %clang_analyze_cc1 -analyzer-checker=unix.StdCLibraryFunctions -verify %s
// RUN: %clang_analyze_cc1 -triple i686-unknown-linux -analyzer-checker=unix.StdCLibraryFunctions -verify %s
// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux -analyzer-checker=unix.StdCLibraryFunctions -verify %s
// RUN: %clang_analyze_cc1 -triple armv7-a15-linux -analyzer-checker=unix.StdCLibraryFunctions -verify %s
// RUN: %clang_analyze_cc1 -triple thumbv7-a15-linux -analyzer-checker=unix.StdCLibraryFunctions -verify %s
// This test tests crashes that occur when standard functions are available
// for inlining.
// expected-no-diagnostics
int isdigit(int _) { return !0; }
void test_redefined_isdigit(int x) {
int (*func)(int) = isdigit;
for (; func(x);) // no-crash
;
}
| Add a test forgotten in r339088. | [analyzer] Add a test forgotten in r339088.
Differential Revision: https://reviews.llvm.org/D50363
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@339726 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
|
cf3299b4a7621128279ec8a6ab928e95fd5848b3 | ldso/ldso/sh/dl-syscalls.h | ldso/ldso/sh/dl-syscalls.h | /* We can't use the real errno in ldso, since it has not yet
* been dynamicly linked in yet. */
#include "sys/syscall.h"
extern int _dl_errno;
#undef __set_errno
#define __set_errno(X) {(_dl_errno) = (X);}
| /* We can't use the real errno in ldso, since it has not yet
* been dynamicly linked in yet. */
#include "sys/syscall.h"
extern int _dl_errno;
#undef __set_errno
#define __set_errno(X) {(_dl_errno) = (X);}
#warning !!! __always_inline redefined waiting for the fixed gcc
#ifdef __always_inline
#undef __always_inline
#define __always_inline inline
#endif
| Make sh4 build works again adding a temporary work-around iby redefining __always_inline to inline until gcc 4.x.x will get fixed. | Make sh4 build works again adding a temporary work-around
iby redefining __always_inline to inline until gcc 4.x.x will get
fixed.
Signed-off-by: Carmelo Amoroso <[email protected]>
| C | lgpl-2.1 | hjl-tools/uClibc,kraj/uClibc,waweber/uclibc-clang,foss-xtensa/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,gittup/uClibc,kraj/uClibc,m-labs/uclibc-lm32,mephi42/uClibc,groundwater/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,ysat0/uClibc,brgl/uclibc-ng,ysat0/uClibc,ndmsystems/uClibc,groundwater/uClibc,mephi42/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,groundwater/uClibc,foss-xtensa/uClibc,hwoarang/uClibc,majek/uclibc-vx32,hjl-tools/uClibc,atgreen/uClibc-moxie,hjl-tools/uClibc,groundwater/uClibc,OpenInkpot-archive/iplinux-uclibc,brgl/uclibc-ng,m-labs/uclibc-lm32,kraj/uClibc,skristiansson/uClibc-or1k,mephi42/uClibc,brgl/uclibc-ng,kraj/uclibc-ng,m-labs/uclibc-lm32,atgreen/uClibc-moxie,wbx-github/uclibc-ng,majek/uclibc-vx32,majek/uclibc-vx32,ddcc/klee-uclibc-0.9.33.2,skristiansson/uClibc-or1k,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,ddcc/klee-uclibc-0.9.33.2,ddcc/klee-uclibc-0.9.33.2,foss-for-synopsys-dwc-arc-processors/uClibc,waweber/uclibc-clang,skristiansson/uClibc-or1k,kraj/uclibc-ng,groundwater/uClibc,kraj/uClibc,skristiansson/uClibc-or1k,kraj/uclibc-ng,waweber/uclibc-clang,kraj/uclibc-ng,mephi42/uClibc,hwoarang/uClibc,foss-xtensa/uClibc,hjl-tools/uClibc,gittup/uClibc,ffainelli/uClibc,ffainelli/uClibc,czankel/xtensa-uclibc,ndmsystems/uClibc,ddcc/klee-uclibc-0.9.33.2,hjl-tools/uClibc,ysat0/uClibc,czankel/xtensa-uclibc,m-labs/uclibc-lm32,foss-xtensa/uClibc,ffainelli/uClibc,czankel/xtensa-uclibc,wbx-github/uclibc-ng,gittup/uClibc,ysat0/uClibc,wbx-github/uclibc-ng,ndmsystems/uClibc,hwoarang/uClibc,czankel/xtensa-uclibc,ffainelli/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,hwoarang/uClibc,ndmsystems/uClibc,waweber/uclibc-clang,wbx-github/uclibc-ng,gittup/uClibc,majek/uclibc-vx32 |
3a80b2f52f5d1e9466b378124d6ebb638734270e | source/x86/source_moss/kernel/interrupt/misc.h | source/x86/source_moss/kernel/interrupt/misc.h | #pragma once
#include "../../includes.h"
namespace MOSS { namespace Interrupts {
void disable_hw_int(void) {
__asm__ __volatile__("cli");
}
void enable_hw_int(void) {
__asm__ __volatile__("sti");
}
/*void fire(int n) {
//Adapted from http://www.brokenthorn.com/Resources/OSDev15.html
//Self-modifying code!
asm(
" movb al, [%0]"
" movb [genint+1], al"
" jmp genint"
"genint:"
" int 0"
: //out
:"n"(n) //in
:"%al" //clobbered
);
}*/
void fire_int13h(void) {
__asm__ __volatile__("int $0x13");
}
}}
| #pragma once
#include "../../includes.h"
namespace MOSS { namespace Interrupts {
inline void disable_hw_int(void) {
__asm__ __volatile__("cli");
}
inline void enable_hw_int(void) {
__asm__ __volatile__("sti");
}
/*inline void fire(int n) {
//Adapted from http://www.brokenthorn.com/Resources/OSDev15.html
//Self-modifying code!
asm(
" movb al, [%0]"
" movb [genint+1], al"
" jmp genint"
"genint:"
" int 0"
: //out
:"n"(n) //in
:"%al" //clobbered
);
}*/
inline void fire_int13h(void) {
__asm__ __volatile__("int $0x13");
}
}}
| Make a few things `inline`. | Make a few things `inline`.
| C | mit | imallett/MOSS,imallett/MOSS,imallett/MOSS,imallett/MOSS |
2b42cc5ae4eba734498484d54e898a9925bea45e | src/zt_path.h | src/zt_path.h | /*!
* Filename: zt_path.h
* Description: path utils
*
* Author: Jason L. Shiffer <[email protected]>
* Copyright:
* Copyright (C) 2010-2011, Jason L. Shiffer.
* See file COPYING for details
*/
#ifndef _ZT_PATH_
#define _ZT_PATH_
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
#include <zt.h>
BEGIN_C_DECLS
typedef enum {
zt_mkdir_create_parent = 1,
}zt_mkdir_flags;
int zt_mkdir(char * path, mode_t mode, zt_mkdir_flags flags);
END_C_DECLS
#endif /* _ZT_PATH_ */
| /*!
* Filename: zt_path.h
* Description: path utils
*
* Author: Jason L. Shiffer <[email protected]>
* Copyright:
* Copyright (C) 2010-2011, Jason L. Shiffer.
* See file COPYING for details
*/
#ifndef _ZT_PATH_
#define _ZT_PATH_
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
# else
typedef unsigned int mode_t;
#endif /* HAVE_SYS_STAT_H */
#include <zt.h>
BEGIN_C_DECLS
typedef enum {
zt_mkdir_create_parent = 1,
}zt_mkdir_flags;
int zt_mkdir(char * path, mode_t mode, zt_mkdir_flags flags);
END_C_DECLS
#endif /* _ZT_PATH_ */
| Add mode_t typedef when missing | Add mode_t typedef when missing
| C | mit | zerotao/libzt,zerotao/libzt,zerotao/libzt,zerotao/libzt |
5d23eae107c60bd48fb495950ea6da7d2176e4c0 | src/version.c | src/version.c | #include "system.h"
#include "sccs.h"
#include "logging.h"
extern int test_release;
extern unsigned build_timet;
int
version_main(int ac, char **av)
{
char buf[100];
float exp;
if (ac == 2 && streq("--help", av[1])) {
system("bk help version");
return (0);
}
if (sccs_cd2root(0, 0) == -1) {
getMsg("version", " ", 0, 0, stdout);
return (0);
}
getMsg("version", bk_model(buf, sizeof(buf)), 0, 0, stdout);
if (test_release) {
exp = ((time_t)build_timet - time(0)) / (24*3600.0) + 14;
if (exp > 0) {
printf("Expires in: %.1f days (test release).\n", exp);
} else {
printf("Expired (test release).\n");
}
}
return (0);
}
| #include "system.h"
#include "sccs.h"
#include "logging.h"
extern int test_release;
extern unsigned build_timet;
int
version_main(int ac, char **av)
{
char buf[100];
float exp;
if (ac == 2 && streq("--help", av[1])) {
system("bk help version");
return (0);
}
lease_check(0); /* disable lease check */
if (sccs_cd2root(0, 0) == -1) {
getMsg("version", " ", 0, 0, stdout);
return (0);
}
getMsg("version", bk_model(buf, sizeof(buf)), 0, 0, stdout);
if (test_release) {
exp = ((time_t)build_timet - time(0)) / (24*3600.0) + 14;
if (exp > 0) {
printf("Expires in: %.1f days (test release).\n", exp);
} else {
printf("Expired (test release).\n");
}
}
return (0);
}
| Add some minor cleanups to the lease code. | Add some minor cleanups to the lease code.
bk: 3ea98875Om5jc1nUdXM9io0xhbkArA | C | apache-2.0 | bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper |
98c01545822d41366efc6d0af96dbdc6a4ec75e7 | src/theft_call_internal.h | src/theft_call_internal.h | #ifndef THEFT_CALL_INTERNAL_H
#define THEFT_CALL_INTERNAL_H
#include "theft_call.h"
#include "theft_bloom.h"
#include <assert.h>
#include <unistd.h>
#include <sys/wait.h>
#include <poll.h>
#include <signal.h>
#include <errno.h>
static enum theft_trial_res
theft_call_inner(struct theft_run_info *run_info, void **args);
static enum theft_trial_res
parent_handle_child_call(struct theft_run_info *run_info,
pid_t pid, int fd);
#endif
| #ifndef THEFT_CALL_INTERNAL_H
#define THEFT_CALL_INTERNAL_H
#include "theft_call.h"
#include "theft_bloom.h"
#include <assert.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <poll.h>
#include <signal.h>
#include <errno.h>
static enum theft_trial_res
theft_call_inner(struct theft_run_info *run_info, void **args);
static enum theft_trial_res
parent_handle_child_call(struct theft_run_info *run_info,
pid_t pid, int fd);
#endif
| Add `sys/types.h` include for `pid_t`. | Add `sys/types.h` include for `pid_t`.
| C | isc | silentbicycle/theft |
01bf9c3502d0292abb5cbe54af6b787ce17a660d | src/win32/auth_file_win.c | src/win32/auth_file_win.c | /*
*The MIT License (MIT)
*
* Copyright (c) <2017> <Stephan Gatzka>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stddef.h>
#include "json/cJSON.h"
const cJSON *credentials_ok(const char *user_name, char *passwd)
{
return NULL;
}
cJSON *change_password(const struct peer *p, const cJSON *request, const char *user_name, char *passwd)
{
return NULL;
} | Add stub for windows file authentication implementation. | Add stub for windows file authentication implementation.
| C | mit | gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,mloy/cjet |
|
c45ae4a7d8a7e637ef7e344139b727ab12e9cca7 | nwg_common_socket_include.h | nwg_common_socket_include.h | #ifndef NWG_COMMON_SOCKET_INCLUDE_H_
#define NWG_COMMON_SOCKET_INCLUDE_H_
#ifdef __unix__
#include <netinet/in.h>
#include <sys/socket.h>
#endif /* __unix__ */
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
typedef int socklen_t;
#undef FD_SETSIZE
#define FD_SETSIZE 2048
#endif /* _WIN32 */
#include <fcntl.h>
#include <unistd.h>
#endif /* NWG_COMMON_SOCKET_INCLUDE_H_ */
| #ifndef NWG_COMMON_SOCKET_INCLUDE_H_
#define NWG_COMMON_SOCKET_INCLUDE_H_
#if !defined(__unix__) && (defined(__APPLE__) && defined(__MACH__))
#define __unix__ 1
#endif
#ifdef __unix__
#include <netinet/in.h>
#include <sys/socket.h>
#endif /* __unix__ */
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
typedef int socklen_t;
#undef FD_SETSIZE
#define FD_SETSIZE 2048
#endif /* _WIN32 */
#include <fcntl.h>
#include <unistd.h>
#endif /* NWG_COMMON_SOCKET_INCLUDE_H_ */
| Add macro to identify apple mac os x as unix | Add macro to identify apple mac os x as unix
| C | mit | ynov/nwg,ynov/nwg |
fa33394bb70481412493fcf40d53ebdb2e738058 | test/CodeGen/ffp-contract-option.c | test/CodeGen/ffp-contract-option.c | // RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s
// REQUIRES: powerpc-registered-target
float fma_test1(float a, float b, float c) {
// CHECK: fmadds
float x = a * b;
float y = x + c;
return y;
}
| // RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s
// REQUIRES: aarch64-registered-target
float fma_test1(float a, float b, float c) {
// CHECK: fmadd
float x = a * b;
float y = x + c;
return y;
}
| Change -ffp-contract=fast test to run on Aarch64 | Change -ffp-contract=fast test to run on Aarch64
(I don't have powerpc enabled in my build and I am changing
how -ffp-contract=fast works.)
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@298468 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
3949c3ba8cec129241ce6c47534f417d619c34e3 | ios/OAuthManager/OAuthManager.h | ios/OAuthManager/OAuthManager.h | //
// OAuthManager.h
//
// Created by Ari Lerner on 5/31/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
#if __has_include("RCTLinkingManager.h")
#import "RCTLinkingManager.h"
#else
#import <React/RCTLinkingManager.h>
#endif
@class OAuthClient;
static NSString *kAuthConfig = @"OAuthManager";
@interface OAuthManager : NSObject <RCTBridgeModule, UIWebViewDelegate>
+ (instancetype) sharedManager;
+ (BOOL)setupOAuthHandler:(UIApplication *)application;
+ (BOOL)handleOpenUrl:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
- (BOOL) _configureProvider:(NSString *) name andConfig:(NSDictionary *) config;
- (NSDictionary *) getConfigForProvider:(NSString *)name;
@property (nonatomic, strong) NSDictionary *providerConfig;
@property (nonatomic, strong) NSArray *callbackUrls;
@end
| //
// OAuthManager.h
//
// Created by Ari Lerner on 5/31/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
#if __has_include(<React/RCTLinkingManager.h>)
#import <React/RCTLinkingManager.h>
#else
#import "RCTLinkingManager.h"
#endif
@class OAuthClient;
static NSString *kAuthConfig = @"OAuthManager";
@interface OAuthManager : NSObject <RCTBridgeModule, UIWebViewDelegate>
+ (instancetype) sharedManager;
+ (BOOL)setupOAuthHandler:(UIApplication *)application;
+ (BOOL)handleOpenUrl:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
- (BOOL) _configureProvider:(NSString *) name andConfig:(NSDictionary *) config;
- (NSDictionary *) getConfigForProvider:(NSString *)name;
@property (nonatomic, strong) NSDictionary *providerConfig;
@property (nonatomic, strong) NSArray *callbackUrls;
@end
| Fix duplicate React library import error conflict w/certain pods | Fix duplicate React library import error conflict w/certain pods
| C | mit | fullstackreact/react-native-oauth,fullstackreact/react-native-oauth,fullstackreact/react-native-oauth |
1d5cce6d3ac1458119383effedabc27876ab398c | A/02/09/task2.c | A/02/09/task2.c | #include <stdio.h>
#include <string.h>
#define MAX_LENGTH 400
char* find(char*, char);
int main() {
char input[MAX_LENGTH], symbol, *found;
fgets(input, MAX_LENGTH + 1, stdin);
scanf("%c", &symbol);
found = find(input, symbol);
printf("%d", (int)(found ? found - input : -1));
return 0;
}
char* find(char *haystack, char needle) {
int length = strlen(haystack);
for (int i = 0; i < length; i++) {
if (haystack[i] == needle) {
return &haystack[i];
}
}
return NULL;
} | Add Task 02 for Homework 02 | Add Task 02 for Homework 02
| C | mit | elsys/po-homework |
|
9feb800985250c12ed35c3934cde0ef00dc3867e | drivers/tty/serial/uart/uart_driver.c | drivers/tty/serial/uart/uart_driver.c | #include <mikoto/char_driver.h>
#include <mikoto/uart.h>
static int uart_write(const char *s);
static struct char_driver_operations uart_ops = {
.write = uart_write,
};
static struct char_driver uart_driver = {
.name = "UART",
};
void uart_init(void)
{
struct char_driver *uart = get_uart_driver_instance();
uart->ops = &uart_ops;
}
struct char_driver *
get_uart_driver_instance(void)
{
if (!uart_driver.ops)
uart_init();
return &uart_driver;
}
static int
uart_write(const char *s)
{
while (*s) {
while (*(UART0 + UARTFR) & UARTFR_TXFF)
;
*UART0 = *s;
s++;
}
return 0;
}
| #include <mikoto/char_driver.h>
#include <mikoto/uart.h>
static int uart_write(const char *s);
static struct char_driver_operations uart_ops = {
.write = uart_write,
};
static struct char_driver uart_driver = {
.name = "UART",
};
static void
uart_init(void)
{
uart_driver.ops = &uart_ops;
}
struct char_driver *
get_uart_driver_instance(void)
{
if (!uart_driver.ops)
uart_init();
return &uart_driver;
}
static int
uart_write(const char *s)
{
while (*s) {
while (*(UART0 + UARTFR) & UARTFR_TXFF)
;
*UART0 = *s;
s++;
}
return 0;
}
| Fix circular reference but in uart_init() | Fix circular reference but in uart_init()
Don't call get_uart_driver_instance() from uart_init().
| C | bsd-3-clause | masami256/mini-arm-kernel |
1f5340c307e094c62534db260290f4b6044200c2 | boards/common/stm32/include/cfg_usb_otg_hs_fs.h | boards/common/stm32/include/cfg_usb_otg_hs_fs.h | /*
* Copyright (C) 2019 Koen Zandberg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_common_stm32
* @{
*
* @file
* @brief Common configuration for STM32 OTG HS peripheral with FS phy
*
* @author Koen Zandberg <[email protected]>
*/
#ifndef CFG_USB_OTG_HS_FS_H
#define CFG_USB_OTG_HS_FS_H
#include "periph_cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enable the full speed USB OTG peripheral
*/
#define STM32_USB_OTG_HS_ENABLED
/**
* @name common USB OTG FS configuration
* @{
*/
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = {
{
.periph = (uint8_t *)USB_OTG_HS_PERIPH_BASE,
.rcc_mask = RCC_AHB1ENR_OTGHSEN,
.phy = STM32_USB_OTG_PHY_BUILTIN,
.type = STM32_USB_OTG_HS,
.irqn = OTG_HS_IRQn,
.ahb = AHB1,
.dm = GPIO_PIN(PORT_B, 14),
.dp = GPIO_PIN(PORT_B, 15),
.af = GPIO_AF12,
}
};
/** @} */
/**
* @brief Number of available USB OTG peripherals
*/
#define USBDEV_NUMOF ARRAY_SIZE(stm32_usb_otg_fshs_config)
#ifdef __cplusplus
}
#endif
#endif /* CFG_USB_OTG_HS_FS_H */
/** @} */
| Add default config for USB OTG HS peripheral | boards/stm32: Add default config for USB OTG HS peripheral
| C | lgpl-2.1 | jasonatran/RIOT,smlng/RIOT,miri64/RIOT,RIOT-OS/RIOT,smlng/RIOT,kaspar030/RIOT,jasonatran/RIOT,OlegHahm/RIOT,kYc0o/RIOT,kaspar030/RIOT,OlegHahm/RIOT,RIOT-OS/RIOT,smlng/RIOT,miri64/RIOT,basilfx/RIOT,authmillenon/RIOT,yogo1212/RIOT,miri64/RIOT,kaspar030/RIOT,basilfx/RIOT,yogo1212/RIOT,authmillenon/RIOT,OlegHahm/RIOT,ant9000/RIOT,OTAkeys/RIOT,RIOT-OS/RIOT,ant9000/RIOT,OTAkeys/RIOT,yogo1212/RIOT,RIOT-OS/RIOT,yogo1212/RIOT,OlegHahm/RIOT,ant9000/RIOT,jasonatran/RIOT,jasonatran/RIOT,jasonatran/RIOT,OTAkeys/RIOT,kaspar030/RIOT,miri64/RIOT,miri64/RIOT,smlng/RIOT,authmillenon/RIOT,authmillenon/RIOT,kYc0o/RIOT,kYc0o/RIOT,basilfx/RIOT,ant9000/RIOT,smlng/RIOT,kYc0o/RIOT,OlegHahm/RIOT,authmillenon/RIOT,basilfx/RIOT,ant9000/RIOT,basilfx/RIOT,yogo1212/RIOT,RIOT-OS/RIOT,kaspar030/RIOT,authmillenon/RIOT,kYc0o/RIOT,yogo1212/RIOT,OTAkeys/RIOT,OTAkeys/RIOT |
|
6d1b716753c1cc8a2f5c26338020941aa58ce9d7 | unknown.c | unknown.c | #ifdef NO_PORT
#include "mono/interpreter/interp.h"
MonoPIFunc
mono_create_trampoline (MonoMethod *method)
{
g_error ("Unsupported arch");
return NULL;
}
void *
mono_create_method_pointer (MonoMethod *method)
{
g_error ("Unsupported arch");
return NULL;
}
#endif
| #ifdef NO_PORT
#include "mono/interpreter/interp.h"
MonoPIFunc
mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
g_error ("Unsupported arch");
return NULL;
}
void *
mono_create_method_pointer (MonoMethod *method)
{
g_error ("Unsupported arch");
return NULL;
}
#endif
| Update to the API change of a while ago. | Update to the API change of a while ago.
svn path=/trunk/mono/; revision=10545
| C | bsd-3-clause | biotrump/ffts-tec,linkotec/mono_arch,linkotec/mono_arch,biotrump/ffts-tec,linkotec/mono_arch,biotrump/ffts-tec,biotrump/ffts-tec |
33db8cda15b9aa8004078577063c3ea50c80b102 | ui/message_center/base_format_view.h | ui/message_center/base_format_view.h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#define UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#include "ui/message_center/message_view.h"
#include "ui/message_center/notification_list.h"
namespace views {
class ImageView;
}
namespace message_center {
// A comprehensive message view.
class BaseFormatView : public MessageView {
public:
BaseFormatView(NotificationList::Delegate* list_delegate,
const NotificationList::Notification& notification);
virtual ~BaseFormatView();
// MessageView
virtual void SetUpView() OVERRIDE;
// views::ButtonListener
virtual void ButtonPressed(views::Button* sender, const ui::Event& event);
protected:
BaseFormatView();
DISALLOW_COPY_AND_ASSIGN(BaseFormatView);
};
} // namespace message_center
#endif // UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
| // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#define UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#include "ui/message_center/message_view.h"
#include "ui/message_center/notification_list.h"
namespace views {
class ImageView;
}
namespace message_center {
// A comprehensive message view.
class BaseFormatView : public MessageView {
public:
BaseFormatView(NotificationList::Delegate* list_delegate,
const NotificationList::Notification& notification);
virtual ~BaseFormatView();
// MessageView
virtual void SetUpView() OVERRIDE;
// views::ButtonListener
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
protected:
BaseFormatView();
DISALLOW_COPY_AND_ASSIGN(BaseFormatView);
};
} // namespace message_center
#endif // UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
| Add a missing override from r167851. Hopefully this unbreaks the CrOS Clang build. | Add a missing override from r167851. Hopefully this unbreaks the CrOS Clang build.
TBR=miket
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@167854 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | dushu1203/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,M4sse/chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,nacl-webkit/chrome_deps,Just-D/chromium-1,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,hujiajie/pa-chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,dushu1203/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,anirudhSK/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,dushu1203/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,hujiajie/pa-chromium,littlstar/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,timopulkkinen/BubbleFish,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,ltilve/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ltilve/chromium,littlstar/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,dednal/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,dednal/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,ondra-novak/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,patrickm/chromium.src,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,ltilve/chromium,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,jaruba/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,jaruba/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,Chilledheart/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,Chilledheart/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,patrickm/chromium.src,jaruba/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,markYoungH/chromium.src,littlstar/chromium.src,patrickm/chromium.src,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,Just-D/chromium-1,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,anirudhSK/chromium,Chilledheart/chromium,dushu1203/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk |
f96642de25cc145286bc35825c3f4ecc4dcb248b | ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c | ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c | #include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
| #include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
| Add A0 as alias to pot pin. | Add A0 as alias to pot pin.
| C | mit | adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython |
05a03b02ca0a0d80542a74d1e9cc55d794dca595 | src/chrono/core/ChChrono.h | src/chrono/core/ChChrono.h | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
#ifndef CHCHRONO_H
#define CHCHRONO_H
// Definition of the main module and sub-modules in the main Chrono library
/**
@defgroup chrono Chrono::Engine
@brief Core Functionality
@{
@defgroup chrono_physics Physics objects
@defgroup chrono_geometry Geometric objects
@defgroup chrono_collision Collision objects
@defgroup chrono_assets Asset objects
@defgroup chrono_solver Solver
@defgroup chrono_timestepper Time integrators
@defgroup chrono_functions Function objects
@defgroup chrono_particles Particle factory
@defgroup chrono_serialization Serialization
@defgroup chrono_utils Utility classes
@defgroup chrono_fea Finite Element Analysis
@{
@defgroup fea_nodes Nodes
@defgroup fea_elements Elements
@defgroup fea_constraints Constraints
@defgroup fea_contact Contact
@defgroup fea_math Mathematical support
@defgroup fea_utils Utility classes
@}
@}
*/
/// @addtogroup chrono
/// @{
/// This is the main namespace for the Chrono package.
namespace chrono {}
/// @} chrono
#endif
| // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
#ifndef CHCHRONO_H
#define CHCHRONO_H
// Definition of the main module and sub-modules in the main Chrono library
/**
@defgroup chrono Chrono::Engine
@brief Core Functionality
@{
@defgroup chrono_physics Physics objects
@defgroup chrono_geometry Geometric objects
@defgroup chrono_collision Collision objects
@defgroup chrono_assets Asset objects
@defgroup chrono_solver Solver
@defgroup chrono_timestepper Time integrators
@defgroup chrono_functions Function objects
@defgroup chrono_particles Particle factory
@defgroup chrono_serialization Serialization
@defgroup chrono_utils Utility classes
@defgroup chrono_fea Finite Element Analysis
@{
@defgroup fea_nodes Nodes
@defgroup fea_elements Elements
@defgroup fea_constraints Constraints
@defgroup fea_contact Contact
@defgroup fea_math Mathematical support
@defgroup fea_utils Utility classes
@}
@}
*/
/// @addtogroup chrono
/// @{
/// Main namespace for the Chrono package.
namespace chrono {
/// Namespace for FEA classes.
namespace fea {}
}
/// @} chrono
#endif
| Add description of the `chrono::fea` namespace | Add description of the `chrono::fea` namespace
| C | bsd-3-clause | rserban/chrono,projectchrono/chrono,projectchrono/chrono,Milad-Rakhsha/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,dariomangoni/chrono,rserban/chrono,projectchrono/chrono,rserban/chrono,rserban/chrono,rserban/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,dariomangoni/chrono,rserban/chrono,projectchrono/chrono,dariomangoni/chrono,projectchrono/chrono,Milad-Rakhsha/chrono,projectchrono/chrono,rserban/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,Milad-Rakhsha/chrono |
77db605eec03df2e12b713639d63c9777161b309 | testmud/mud/home/Text/sys/verb/wiz/pset.c | testmud/mud/home/Text/sys/verb/wiz/pset.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 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.h>
#include <account/paths.h>
#include <game/paths.h>
#include <text/paths.h>
inherit LIB_VERB;
void main(object actor, string args)
{
string *users;
object user;
object obj;
string oname;
string pname;
mixed pvalue;
user = query_user();
if (user->query_class() < 2) {
send_out("You do not have sufficient access rights to set object properties.\n");
return;
}
if (sscanf(args, "%s %s %s", oname, pname, pvalue) != 3) {
send_out("Usage: pset <object> <property name> <value>\n");
return;
}
obj = find_object(oname);
if (!obj) {
send_out(oname + ": No such object.\n");
return;
}
pvalue = PARSE_VALUE->parse(pvalue);
obj->set_property(pname, pvalue);
}
| Add prototype for property set command | Add prototype for property set command
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
811907fb84d45caad1376698b43316a18b96ed00 | src/main.c | src/main.c | /*
*****************************************************************************
* ___ _ _ _ _
* / _ \ __ _| |_| |__(_) |_ ___
* | (_) / _` | / / '_ \ | _(_-<
* \___/\__,_|_\_\_.__/_|\__/__/
* Copyright (c) 2015 Romain Picard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*****************************************************************************/
#include <stdio.h>
#include "sysflake.h"
int main(void)
{
printf("%016llX", sysflake_generate());
return 0;
}
| /*
*****************************************************************************
* ___ _ _ _ _
* / _ \ __ _| |_| |__(_) |_ ___
* | (_) / _` | / / '_ \ | _(_-<
* \___/\__,_|_\_\_.__/_|\__/__/
* Copyright (c) 2015 Romain Picard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*****************************************************************************/
#include <stdio.h>
#include "sysflake.h"
int main(void)
{
printf("%016llX\n", sysflake_generate());
return 0;
}
| Add newline after printing flake | Add newline after printing flake
| C | mit | MainRo/sysflake,MainRo/sysflake,MainRo/sysflake |
bcfea9f14002e5a0746ff75469219beb785e3117 | src/node.h | src/node.h | #ifndef SRC_NODE_H_
#define SRC_NODE_H_
#include "./render_data.h"
/**
* \brief
*
*
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(const RenderData &renderData) = 0;
protected:
Node()
{
}
};
#endif // SRC_NODE_H_
| #ifndef SRC_NODE_H_
#define SRC_NODE_H_
#include "./render_data.h"
#include <boost/serialization/serialization.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/nvp.hpp>
/**
* \brief
*
*
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(const RenderData &renderData) = 0;
protected:
Node()
{
}
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const {};
};
#endif // SRC_NODE_H_
| Add serialization to Node class. | Add serialization to Node class.
| C | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
331895c3947e67098189232b689c7943703988ac | CoconutKit/Sources/View/HLSTextView.h | CoconutKit/Sources/View/HLSTextView.h | //
// HLSTextView.h
// CoconutKit
//
// Created by Samuel Défago on 03.11.11.
// Copyright (c) 2011 Hortis. All rights reserved.
//
// TODO: - move automatically with the keyboard
// - dismiss when tapping outside
@interface HLSTextView : UITextView
/**
* The text to be displayed when the text view is empty. Default is nil
*/
@property (nonatomic, retain) NSString *placeholderText;
/**
* The color of the placeholder text. Default is light gray
*/
@property (nonatomic, retain) UIColor *placeholderTextColor;
@end
| //
// HLSTextView.h
// CoconutKit
//
// Created by Samuel Défago on 03.11.11.
// Copyright (c) 2011 Hortis. All rights reserved.
//
/**
* Lightweight UITextView subclass providing more functionalities
*/
@interface HLSTextView : UITextView
/**
* The text to be displayed when the text view is empty. Default is nil
*/
@property (nonatomic, retain) NSString *placeholderText;
/**
* The color of the placeholder text. Default is light gray
*/
@property (nonatomic, retain) UIColor *placeholderTextColor;
@end
| Add a small bit of documentation | Add a small bit of documentation
| C | mit | cbdr/CoconutKit,cbdr/CoconutKit,cbdr/CoconutKit,cbdr/CoconutKit,cbdr/CoconutKit |
fdc2808e4c51f5a1126af8906f596d6eb31cf996 | arch/sgi/dev/iockbcvar.h | arch/sgi/dev/iockbcvar.h | /* $OpenBSD: iockbcvar.h,v 1.3 2010/12/03 18:29:56 shadchin Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int iockbc_cnattach();
| /* $OpenBSD: iockbcvar.h,v 1.4 2010/12/04 11:23:43 jsing Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int iockbc_cnattach(void);
| Make sgi port compile again. | Make sgi port compile again.
| C | isc | orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars |
efc87d57b802c892907bcadeaf23cd65d597c7ce | cbits/fakekey.c | cbits/fakekey.c | ////////////////////////////////////////////////////////////////////////////////
#ifdef __linux__
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/extensions/XTest.h>
Display *fakekey_dis;
void fakekey_init(void) {
fakekey_dis = XOpenDisplay(NULL);
}
void fakekey_press(int code) {
XTestFakeKeyEvent(fakekey_dis, code, True, 0);
XFlush(fakekey_dis);
}
void fakekey_release(int code) {
XTestFakeKeyEvent(fakekey_dis, code, False, 0);
XFlush(fakekey_dis);
}
#else
void fakekey_init(void) {
}
void fakekey_press(int code) {
}
void fakekey_release(int code) {
}
#endif
| ////////////////////////////////////////////////////////////////////////////////
#ifdef __linux__
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/extensions/XTest.h>
Display *fakekey_dis;
void fakekey_init(void) {
fakekey_dis = XOpenDisplay(NULL);
}
void fakekey_press(int keysym) {
XTestFakeKeyEvent(fakekey_dis, XKeysymToKeycode(fakekey_dis, keysym), True, 0);
XFlush(fakekey_dis);
}
void fakekey_release(int keysym) {
XTestFakeKeyEvent(fakekey_dis, XKeysymToKeycode(fakekey_dis, keysym), False, 0);
XFlush(fakekey_dis);
}
#else
void fakekey_init(void) {
}
void fakekey_press(int keysym) {
}
void fakekey_release(int keysym) {
}
#endif
| Use keysym to keycode mapping in C | Use keysym to keycode mapping in C
| C | bsd-3-clause | bitonic/zurihac-plays,bitonic/zurihac-plays |
d1c6a8062577f5ce58105afff2d0a1887bfff957 | include/tgbot/net/TgLongPoll.h | include/tgbot/net/TgLongPoll.h | #ifndef TGBOT_TGLONGPOLL_H
#define TGBOT_TGLONGPOLL_H
#include "tgbot/Bot.h"
#include "tgbot/Api.h"
#include "tgbot/EventHandler.h"
namespace TgBot {
/**
* @brief This class handles long polling and updates parsing.
*
* @ingroup net
*/
class TgLongPoll {
public:
TgLongPoll(const Api* api, const EventHandler* eventHandler, int32_t, int32_t, const std::shared_ptr<std::vector<std::string>>&);
TgLongPoll(const Bot& bot, int32_t = 100, int32_t = 60, const std::shared_ptr<std::vector<std::string>>& = nullptr);
/**
* @brief Starts long poll. After new update will come, this method will parse it and send to EventHandler which invokes your listeners. Designed to be executed in a loop.
*/
void start();
private:
const Api* _api;
const EventHandler* _eventHandler;
int32_t _lastUpdateId = 0;
int32_t _limit;
int32_t _timeout;
std::shared_ptr<std::vector<std::string>> _allowupdates;
};
}
#endif //TGBOT_TGLONGPOLL_H
| #ifndef TGBOT_TGLONGPOLL_H
#define TGBOT_TGLONGPOLL_H
#include "tgbot/Bot.h"
#include "tgbot/Api.h"
#include "tgbot/EventHandler.h"
namespace TgBot {
/**
* @brief This class handles long polling and updates parsing.
*
* @ingroup net
*/
class TgLongPoll {
public:
TgLongPoll(const Api* api, const EventHandler* eventHandler, int32_t, int32_t, const std::shared_ptr<std::vector<std::string>>&);
TgLongPoll(const Bot& bot, int32_t = 100, int32_t = 10, const std::shared_ptr<std::vector<std::string>>& = nullptr);
/**
* @brief Starts long poll. After new update will come, this method will parse it and send to EventHandler which invokes your listeners. Designed to be executed in a loop.
*/
void start();
private:
const Api* _api;
const EventHandler* _eventHandler;
int32_t _lastUpdateId = 0;
int32_t _limit;
int32_t _timeout;
std::shared_ptr<std::vector<std::string>> _allowupdates;
};
}
#endif //TGBOT_TGLONGPOLL_H
| Fix too big timeout in long poller. | Fix too big timeout in long poller.
Make it 10 seconds instead of 60. Old timeout made bots irresponsible. | C | mit | reo7sp/tgbot-cpp,JellyBrick/tgbot-cpp,JellyBrick/tgbot-cpp,reo7sp/tgbot-cpp,JellyBrick/tgbot-cpp,reo7sp/tgbot-cpp |
bf63a3f52e6e47d50b74e9b770d839b2e56f6368 | ios/RNS3/RNS3TransferUtility.h | ios/RNS3/RNS3TransferUtility.h | #import "RCTBridgeModule.h"
#import "RCTEventDispatcher.h"
#import <AWSCore/AWSCore.h>
#import <AWSS3/AWSS3.h>
typedef enum {
BASIC, COGNITO
} CredentialType;
@interface RNS3TransferUtility : NSObject <RCTBridgeModule>
+ (NSMutableDictionary*)nativeCredentialsOptions;
+ (CredentialType)credentialType: (NSString *)type;
+ (void)interceptApplication: (UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)())completionHandler;
@end
| #import "RCTBridgeModule.h"
#import "RCTEventDispatcher.h"
#import <AWSCore/AWSCore.h>
#import <AWSS3/AWSS3.h>
typedef NS_ENUM(NSInteger, CredentialType) {
BASIC,
COGNITO
};
@interface RNS3TransferUtility : NSObject <RCTBridgeModule>
+ (NSMutableDictionary*)nativeCredentialsOptions;
+ (CredentialType)credentialType: (NSString *)type;
+ (void)interceptApplication: (UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)())completionHandler;
@end
| Define enum as NSInteger to fix a warning. | Define enum as NSInteger to fix a warning.
| C | mit | nharlow89/react-native-s3,mybigday/react-native-s3,mybigday/react-native-s3,nharlow89/react-native-s3,mybigday/react-native-s3,mybigday/react-native-s3,nharlow89/react-native-s3,nharlow89/react-native-s3 |
bcd8289a0eb5e4005a2ad4e70216839291896c47 | MOAspects/MOAspects.h | MOAspects/MOAspects.h | //
// MOAspects.h
// MOAspects
//
// Created by Hiromi Motodera on 2015/03/15.
// Copyright (c) 2015年 MOAI. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, MOAspectsPosition)
{
MOAspectsPositionBefore,
MOAspectsPositionAfter
};
typedef NS_ENUM(NSInteger, MOAspectsHookRange)
{
MOAspectsHookRangeAll = -1,
MOAspectsHookRangeTargetOnly = -2
};
@interface MOAspects : NSObject
+ (BOOL)hookInstanceMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
usingBlock:(id)block;
+ (BOOL)hookInstanceMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
hookLevel:(MOAspectsHookRange)hookLevel
usingBlock:(id)block;
+ (BOOL)hookClassMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
usingBlock:(id)block;
+ (BOOL)hookClassMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
hookLevel:(MOAspectsHookRange)hookLevel
usingBlock:(id)block;
@end
| //
// MOAspects.h
// MOAspects
//
// Created by Hiromi Motodera on 2015/03/15.
// Copyright (c) 2015年 MOAI. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, MOAspectsPosition)
{
MOAspectsPositionBefore,
MOAspectsPositionAfter
};
typedef NS_ENUM(NSInteger, MOAspectsHookRange)
{
MOAspectsHookRangeAll = -1,
MOAspectsHookRangeTargetOnly = -2
};
@interface MOAspects : NSObject
+ (BOOL)hookInstanceMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
usingBlock:(id)block;
+ (BOOL)hookInstanceMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
hookLevel:(MOAspectsHookRange)hookRange
usingBlock:(id)block;
+ (BOOL)hookClassMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
usingBlock:(id)block;
+ (BOOL)hookClassMethodForClass:(Class)clazz
selector:(SEL)selector
aspectsPosition:(MOAspectsPosition)aspectsPosition
hookLevel:(MOAspectsHookRange)hookRange
usingBlock:(id)block;
@end
| Change hook level parameter name to hookRange | Change hook level parameter name to hookRange
| C | mit | MO-AI/MOAspects,MO-AI/MOAspects |
8dcc2a8ce26fd3f97cc818ebf536bb0fe563d835 | arduino/OpenROV/Settings.h | arduino/OpenROV/Settings.h |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3
//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (1)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define MIDPOINT 1500
#define LOGGING (1)
class Settings : public Device {
public:
static int smoothingIncriment; //How aggressive the throttle changes
static int deadZone_min;
static int deadZone_max;
static int capability_bitarray;
Settings():Device(){};
void device_setup();
void device_loop(Command cmd);
};
#endif
|
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3
//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define MIDPOINT 1500
#define LOGGING (1)
class Settings : public Device {
public:
static int smoothingIncriment; //How aggressive the throttle changes
static int deadZone_min;
static int deadZone_max;
static int capability_bitarray;
Settings():Device(){};
void device_setup();
void device_loop(Command cmd);
};
#endif
| Reset default settings to stock kit configuration | Reset default settings to stock kit configuration
| C | mit | bmvakili/openrov-software,MysteriousChanger/burrito-cockpid,codewithpassion/openrov-software,bmvakili/openrov-software,BrianAdams/openrov-software,codewithpassion/openrov-software,LeeCheongAh/openrov-software,ZonaElka/testOpenROV,bmvakili/openrov-software,MysteriousChanger/burrito-cockpid,bmvakili/openrov-software,bmvakili/openrov-software,codewithpassion/openrov-software,MysteriousChanger/burrito-cockpid,BrianAdams/openrov-software,ChangerR/burrito-cockpid,ChangerR/burrito-cockpid,BrianAdams/openrov-software,ZonaElka/testOpenROV,codewithpassion/openrov-software,ZonaElka/testOpenROV,BrianAdams/openrov-software,ChangerR/burrito-cockpid,LeeCheongAh/openrov-software |
5f44348e2126e13d50cf4f9f3195ae4979ab63c9 | include/ethernet.h | include/ethernet.h | struct eth_hdr
{
unsigned char dst_mac[6];
unsigned char src_mac[6];
short ethertype;
char* payload;
};
struct eth_hdr* init_eth_hdr(char* buf);
void print_eth_hdr(struct eth_hdr *ehdr);
| #ifndef ETHERNET_H_
#define ETHERNET_H_
#include <linux/if_ether.h>
struct eth_hdr
{
unsigned char dst_mac[6];
unsigned char src_mac[6];
unsigned short ethertype;
unsigned char* payload;
};
struct eth_hdr* init_eth_hdr(char* buf);
void print_eth_hdr(struct eth_hdr *ehdr);
#endif
| Make eth header fields unsigned | Make eth header fields unsigned
| C | mit | saminiir/level-ip,saminiir/level-ip |
88c8743809cccd5d855599a9c37d3b19a849b465 | percolation/io_helpers.c | percolation/io_helpers.c | #include "io_helpers.h"
#include <stdio.h>
void print_lattice(int * lattice, int rows, int columns, int with_borders)
{
int i, j;
for (i = 0; i < rows; i++) {
if (with_borders) {
for (j = 0; j < columns; j++) {
printf("------");
}
printf("-\n");
}
for (j = 0; j < columns; j++) {
if (with_borders) {
putchar('|');
putchar(' ');
}
if (lattice[i*columns + j] == 1) {
printf(" x ");
} else if (lattice[i*columns + j] > 1) {
printf("%03d", lattice[i*columns + j]);
} else {
if (with_borders) {
putchar(' ');
putchar(' ');
putchar(' ');
} else {
printf(" o ");
}
}
if (with_borders) {
putchar(' ');
if (j == columns - 1) {
putchar('|');
}
} else {
if (j < columns - 1) {
putchar(' ');
}
}
}
putchar('\n');
}
if (with_borders) {
for (j = 0; j < columns; j++) {
printf("------");
}
printf("-\n");
}
}
| #include "io_helpers.h"
#include <stdio.h>
void print_lattice(int * lattice, int rows, int columns, int with_borders)
{
int i, j;
for (i = 0; i < rows; i++) {
if (with_borders) {
for (j = 0; j < columns; j++) {
printf("------");
}
printf("-\n");
}
for (j = 0; j < columns; j++) {
if (with_borders) {
putchar('|');
putchar(' ');
}
if (lattice[i*columns + j] == 1) {
printf(" x ");
} else if (lattice[i*columns + j] > 1) {
printf("%03d", lattice[i*columns + j]);
} else {
if (with_borders) {
putchar(' ');
putchar(' ');
putchar(' ');
} else {
printf(" o ");
}
}
if (with_borders) {
putchar(' ');
if (j == columns - 1) {
putchar('|');
}
} else {
if (j < columns - 1) {
putchar(' ');
}
}
}
putchar('\n');
}
if (with_borders) {
for (j = 0; j < columns; j++) {
printf("------");
}
printf("-\n");
} else {
putchar('\n');
}
}
| Add a newline after printing the lattice | [percolation] Add a newline after printing the lattice
| C | mit | cerisola/fiscomp,cerisola/fiscomp,cerisola/fiscomp |
be4979026d5f3b966e1a7121f59714e1979cbf9d | tests/regression/02-base/50-unknown_func_array.c | tests/regression/02-base/50-unknown_func_array.c | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#define LENGTH 10
typedef struct arr {
int *ptrs[LENGTH];
} arr_t;
// int mutate_array(arr_t a){
// int t = rand();
// for(int i=0; i<LENGTH; i++) {
// *(a.ptrs[i]) = t;
// }
// }
int main(){
arr_t a;
int xs[LENGTH];
for(int i=0; i<LENGTH; i++){
xs[i] = 0;
a.ptrs[i] = &xs[0];
}
// When passing an arrays to an unknown function, reachable memory should be invalidated
mutate_array(a);
assert(xs[0] == 0); //UNKNOWN!
return 0;
}
| Add test case where array is passed to unknown function. | Add test case where array is passed to unknown function.
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
bef226437c591b50a40e01b905ce47131d9e1c30 | tutorials/users/tutorial_01/wrapper_tutorial_01.h | tutorials/users/tutorial_01/wrapper_tutorial_01.h | #ifndef HALIDE__generated_pgm_h
#define HALIDE__generated_pgm_h
#include <tiramisu/utils.h>
#ifdef __cplusplus
extern "C" {
#endif
int function0(halide_buffer_t *_p0_buffer);
#ifdef __cplusplus
} // extern "C"
#endif
#endif
| Add wrapper for user tuto 01 | Add wrapper for user tuto 01
| C | mit | rbaghdadi/ISIR,rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/ISIR,rbaghdadi/tiramisu,rbaghdadi/tiramisu |
|
476e707cf2b5192866827e532b10f25f58082a0b | src/GSvar/SequencingRunWidget.h | src/GSvar/SequencingRunWidget.h | #ifndef SEQUENCINGRUNWIDGET_H
#define SEQUENCINGRUNWIDGET_H
#include <QWidget>
#include "NGSD.h"
namespace Ui {
class SequencingRunWidget;
}
class SequencingRunWidget : public QWidget
{
Q_OBJECT
public:
SequencingRunWidget(QWidget* parent, QString run_id);
~SequencingRunWidget();
signals:
void openProcessedSampleTab(QString ps_name);
protected slots:
void updateGUI();
void openSelectedSamples();
private:
Ui::SequencingRunWidget* ui_;
QString run_id_;
NGSD db_;
};
#endif // SEQUENCINGRUNWIDGET_H
| #ifndef SEQUENCINGRUNWIDGET_H
#define SEQUENCINGRUNWIDGET_H
#include <QWidget>
#include <QAction>
#include "NGSD.h"
namespace Ui {
class SequencingRunWidget;
}
class SequencingRunWidget : public QWidget
{
Q_OBJECT
public:
SequencingRunWidget(QWidget* parent, QString run_id);
~SequencingRunWidget();
signals:
void openProcessedSampleTab(QString ps_name);
protected slots:
void updateGUI();
void openSelectedSamples();
private:
Ui::SequencingRunWidget* ui_;
QString run_id_;
NGSD db_;
};
#endif // SEQUENCINGRUNWIDGET_H
| Fix missing include under OSX | [GSvar] Fix missing include under OSX
| C | mit | imgag/ngs-bits,imgag/ngs-bits,imgag/ngs-bits,imgag/ngs-bits,imgag/ngs-bits,imgag/ngs-bits |
829d693e3d1e519b837587adc51c940871666c13 | decoder/dict.h | decoder/dict.h | #ifndef DICT_H_
#define DICT_H_
#include <cassert>
#include <cstring>
#include <tr1/unordered_map>
#include <string>
#include <vector>
#include <boost/functional/hash.hpp>
#include "wordid.h"
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
| #ifndef DICT_H_
#define DICT_H_
#include <cassert>
#include <cstring>
#include <tr1/unordered_map>
#include <string>
#include <vector>
#include <boost/functional/hash.hpp>
#include "wordid.h"
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) {
std::string word= "";
for (std::vector<std::string>::const_iterator it=words.begin();
it != words.end(); ++it) {
if (it != words.begin()) word += "__";
word += *it;
}
return Convert(word, frozen);
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
| Update utility functions to work with pyp-topics. | Update utility functions to work with pyp-topics.
git-svn-id: 357248c53bdac2d7b36f7ee045286eb205fcf757@49 ec762483-ff6d-05da-a07a-a48fb63a330f
| C | apache-2.0 | carhaas/cdec-semparse,m5w/atools,redpony/cdec,veer66/cdec,veer66/cdec,veer66/cdec,redpony/cdec,carhaas/cdec-semparse,carhaas/cdec-semparse,veer66/cdec,redpony/cdec,m5w/atools,veer66/cdec,pks/cdec-dtrain,pks/cdec-dtrain,carhaas/cdec-semparse,pks/cdec-dtrain,redpony/cdec,redpony/cdec,redpony/cdec,veer66/cdec,pks/cdec-dtrain,pks/cdec-dtrain,carhaas/cdec-semparse,pks/cdec-dtrain,carhaas/cdec-semparse,m5w/atools |
4e3d4683fedb59f6cdeaeefb04c96fa124463ed4 | src/abuf.h | src/abuf.h | #ifndef ABUF_H
#define ABUF_H
#include <string.h>
#define ABUF_INIT { NULL, 0}
struct abuf{
char *b;
int len;
};
void abAppend(struct abuf*, const char*, int);
void abFree(struct abuf*);
#endif
| #ifndef ABUF_H
#define ABUF_H
#include <stdlib.h>
#include <string.h>
#define ABUF_INIT { NULL, 0}
struct abuf{
char *b;
int len;
};
void abAppend(struct abuf*, const char*, int);
void abFree(struct abuf*);
#endif
| Include stdlib for free and realloc | Include stdlib for free and realloc
| C | bsd-2-clause | JordanMajd/t |
74ba99eab5d87b36e1c7809b395725d83d0ab1d6 | src/scan.c | src/scan.c | /*
scan: Esitmate length of a mpeg file and compare to length from exact scan.
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#include "mpg123.h"
int main(int argc, char **argv)
{
mpg123_handle *m;
int i;
mpg123_init();
m = mpg123_new(NULL, NULL);
for(i = 1; i < argc; ++i)
{
off_t a, b;
mpg123_open(m, argv[i]);
a = mpg123_length(m);
mpg123_scan(m);
b = mpg123_length(m);
printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b);
}
mpg123_delete(m);
mpg123_exit();
return 0;
}
| /*
scan: Estimate length (sample count) of a mpeg file and compare to length from exact scan.
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
/* Note the lack of error checking here.
While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc.
You just jet invalid results on invalid operations... */
#include <stdio.h>
#include "mpg123.h"
int main(int argc, char **argv)
{
mpg123_handle *m;
int i;
mpg123_init();
m = mpg123_new(NULL, NULL);
for(i = 1; i < argc; ++i)
{
off_t a, b;
mpg123_open(m, argv[i]);
a = mpg123_length(m);
mpg123_scan(m);
b = mpg123_length(m);
printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b);
}
mpg123_delete(m);
mpg123_exit();
return 0;
}
| Add a note about error checking, fix description and include stdio.h . | Add a note about error checking, fix description and include stdio.h .
git-svn-id: 793bb72743a407948e3701719c462b6a765bc435@1145 35dc7657-300d-0410-a2e5-dc2837fedb53
| C | lgpl-2.1 | Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123 |
0c617bdade524779a41ecffc85cfb9d261700318 | dev/database_connection.h | dev/database_connection.h | #pragma once
#include <string> // std::string
#include <sqlite3.h>
#include <system_error> // std::error_code, std::system_error
#include "error_code.h"
namespace sqlite_orm {
namespace internal {
inline sqlite3 *open_db(std::string const&filename)
{
sqlite3 *result {nullptr};
if(sqlite3_open(filename.c_str(), &result) != SQLITE_OK){
throw std::system_error(std::error_code(sqlite3_errcode(result), get_sqlite_error_category()), get_error_message(result, "opening '", filename, "'. "));
}
return result;
}
struct database_connection {
explicit database_connection(const std::string &filename):
db {open_db(filename) }
{
}
~database_connection() {
sqlite3_close(this->db);
}
sqlite3* get_db() {
return this->db;
}
protected:
sqlite3 *db;
};
}
}
| #pragma once
#include <string> // std::string
#include <sqlite3.h>
#include <system_error> // std::error_code, std::system_error
#include "error_code.h"
namespace sqlite_orm {
namespace internal {
inline sqlite3 *open_db(std::string const&filename)
{
sqlite3 *result {nullptr};
if(sqlite3_open(filename.c_str(), &result) != SQLITE_OK){
throw_error(result, "opening '", filename, "'. ");
}
return result;
}
struct database_connection {
explicit database_connection(const std::string &filename):
db {open_db(filename) }
{}
~database_connection() {
sqlite3_close(this->db);
}
sqlite3* get_db() {
return this->db;
}
protected:
sqlite3 *db;
};
}
}
| Use the new throw function | Use the new throw function | C | agpl-3.0 | fnc12/sqlite_orm,fnc12/sqlite_orm |
1c719512a25876346c28ebaf0ecdad007fce0a99 | src/Output/Output_def.h | src/Output/Output_def.h | /* $Id: Output_def.h,v 1.16 2007-10-18 20:30:58 phruksar Exp $ */
#ifndef _OUTPUT_DEF_H
#define _OUTPUT_DEF_H
#define OUTFMT_HEAD 0
#define OUTFMT_UNITS 1
#define OUTFMT_COMP 2
#define OUTFMT_NUM 4
#define OUTFMT_ACT 8
#define OUTFMT_HEAT 16
#define OUTFMT_ALPHA 32
#define OUTFMT_BETA 64
#define OUTFMT_GAMMA 128
#define OUTFMT_SRC 256
#define OUTFMT_CDOSE 512
#define OUTFMT_ADJ 1024
#define OUTFMT_EXP 2048
#define OUTFMT_WDR 4096
#define OUTNORM_KG -2
#define OUTNORM_G -1
#define OUTNORM_NULL 0
#define OUTNORM_CM3 1
#define OUTNORM_M3 2
#define OUTNORM_VOL_INT 100
#define BQ_CI 2.7027e-11
#define CM3_M3 1e-6
#define G_KG 1e-3
#endif
| /* $Id: Output_def.h,v 1.17 2008-07-31 18:08:50 phruksar Exp $ */
#ifndef _OUTPUT_DEF_H
#define _OUTPUT_DEF_H
#define OUTFMT_HEAD 0
#define OUTFMT_UNITS 1
#define OUTFMT_COMP 2
#define OUTFMT_NUM 4
#define OUTFMT_ACT 8
#define OUTFMT_HEAT 16
#define OUTFMT_ALPHA 32
#define OUTFMT_BETA 64
#define OUTFMT_GAMMA 128
#define OUTFMT_SRC 256
#define OUTFMT_CDOSE 512
#define OUTFMT_ADJ 1024
#define OUTFMT_EXP 2048
#define OUTFMT_EXP_CYL_VOL 4096
#define OUTFMT_WDR 8192
#define OUTNORM_KG -2
#define OUTNORM_G -1
#define OUTNORM_NULL 0
#define OUTNORM_CM3 1
#define OUTNORM_M3 2
#define OUTNORM_VOL_INT 100
#define BQ_CI 2.7027e-11
#define CM3_M3 1e-6
#define G_KG 1e-3
#endif
| Define new number for new exposure rate calc | Define new number for new exposure rate calc
| C | bsd-3-clause | elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA,elliottbiondo/ALARA |
22ecd57dc0d2fa3e82dc0d2a39250ac0f2a5db4b | rand.h | rand.h | /**
* Copyright (c) 2013-2014 Tomas Dzetkulic
* Copyright (c) 2013-2014 Pavol Rusnak
*
* 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 __RAND_H__
#define __RAND_H__
#include <stdint.h>
void init_rand(void);
int finalize_rand(void);
uint32_t random32(void);
void random_buffer(uint8_t *buf, size_t len);
#endif
| /**
* Copyright (c) 2013-2014 Tomas Dzetkulic
* Copyright (c) 2013-2014 Pavol Rusnak
*
* 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 __RAND_H__
#define __RAND_H__
#include <stdlib.h>
#include <stdint.h>
void init_rand(void);
int finalize_rand(void);
uint32_t random32(void);
void random_buffer(uint8_t *buf, size_t len);
#endif
| Add stdlib.h to header. Needed for size_t | Add stdlib.h to header. Needed for size_t
| C | mit | BWallet/bwallet-crypto,BWallet/bwallet-crypto,BWallet/bwallet-crypto,BWallet/bwallet-crypto,BWallet/bwallet-crypto |
a7df3bb7cc898224bc9844fb160164ca29a237ef | scanner/scanner.h | scanner/scanner.h | #ifndef SCANNER_H
#define SCANNER_H
#include <QString>
#include <QChar>
#include <QVector>
#include "token.h"
/**
* @class Scanner
* @brief Class representing a scanner (lexical analyzer). It takes a file path as input and generates tokens, either lazily or as a QVector.
*/
class Scanner
{
public:
Scanner(const QString& sourcePath);
/**
* @brief Accessor to the vecotr of tokens parsed at construction time.
* @return const reference to the vector of tokens.
*/
const QVector<Token>& tokens() const {return _tokens;}
private:
QChar peek() const; //Current character
QChar next() const; //Read next character
void advance();
Token nextToken();
//Utility functions for nextToken().
Token parseAlphaNum(); //Parse an expression that starts with a letter : identifiers, reserved words, bool literals
Token parseStringLiteral();
Token parseCharLiteral();
Token parseNumberLiteral();
void skipComment();
QString fileContent;
QVector<Token> _tokens;
int currentChar = 0;
int currentLine = 1;
int currentRow = 1;
};
#endif // SCANNER_H
| #ifndef SCANNER_H
#define SCANNER_H
#include <QString>
#include <QChar>
#include <QVector>
#include "token.h"
/**
* @class Scanner
* @brief Class representing a scanner (lexical analyzer). It takes a file path as input and generates tokens, either lazily or as a QVector.
*/
class Scanner
{
public:
Scanner(const QString& sourcePath);
Scanner() = delete;
Scanner(const Scanner& src) = delete;
Scanner(Scanner &&src) = delete;
Scanner& operator= (const Scanner& src) = delete;
Scanner& operator= (Scanner&& src) = delete;
/**
* @brief Accessor to the vecotr of tokens parsed at construction time.
* @return const reference to the vector of tokens.
*/
const QVector<Token>& tokens() const {return _tokens;}
private:
QChar peek() const; //Current character
QChar next() const; //Read next character
void advance();
Token nextToken();
//Utility functions for nextToken().
Token parseAlphaNum(); //Parse an expression that starts with a letter : identifiers, reserved words, bool literals
Token parseStringLiteral();
Token parseCharLiteral();
Token parseNumberLiteral();
void skipComment();
QString fileContent;
QVector<Token> _tokens;
int currentChar = 0;
int currentLine = 1;
int currentRow = 1;
};
#endif // SCANNER_H
| Set copy/move constructors to deleted | Set copy/move constructors to deleted
| C | mit | bisthebis/Boboscript,bisthebis/Boboscript |
501db4b8473b4906f8a78e18f97c9a7c66b180ee | Stripe/PublicHeaders/UINavigationBar+Stripe_Theme.h | Stripe/PublicHeaders/UINavigationBar+Stripe_Theme.h | //
// UINavigationBar+Stripe_Theme.h
// Stripe
//
// Created by Jack Flintermann on 5/17/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "STPTheme.h"
NS_ASSUME_NONNULL_BEGIN
/**
* This allows quickly setting the appearance of a `UINavigationBar` to match your application. This is useful if you're presenting an `STPAddCardViewController` or `STPPaymentMethodsViewController` inside a `UINavigationController`.
*/
@interface UINavigationBar (Stripe_Theme)
/**
* Sets the navigation bar's appearance to the desired theme. This will affect the bar's `tintColor` and `barTintColor` properties, as well as the color of the single-pixel line at the bottom of the navbar.
*
* @param theme the theme to use to style the navigation bar. @see STPTheme.h
*/
- (void)stp_setTheme:(STPTheme *)theme __attribute__((deprecated));
@property (nonatomic, nullable, retain) STPTheme *stp_theme;
@end
NS_ASSUME_NONNULL_END
void linkUINavigationBarThemeCategory(void);
| //
// UINavigationBar+Stripe_Theme.h
// Stripe
//
// Created by Jack Flintermann on 5/17/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "STPTheme.h"
NS_ASSUME_NONNULL_BEGIN
/**
* This allows quickly setting the appearance of a `UINavigationBar` to match your application. This is useful if you're presenting an `STPAddCardViewController` or `STPPaymentMethodsViewController` inside a `UINavigationController`.
*/
@interface UINavigationBar (Stripe_Theme)
/**
* Sets the navigation bar's appearance to the desired theme. This will affect the bar's `tintColor` and `barTintColor` properties, as well as the color of the single-pixel line at the bottom of the navbar.
*
* @param theme the theme to use to style the navigation bar. @see STPTheme.h
* @deprecated Use the `stp_theme` property instead
*/
- (void)stp_setTheme:(STPTheme *)theme __attribute__((deprecated));
/**
* Sets the navigation bar's appearance to the desired theme. This will affect the bar's `tintColor` and `barTintColor` properties, as well as the color of the single-pixel line at the bottom of the navbar.
* Stripe view controllers will use their navigation bar's theme for their UIBarButtonItems instead of their own theme if it is not nil.
*
* @see STPTheme.h
*/
@property (nonatomic, nullable, retain) STPTheme *stp_theme;
@end
NS_ASSUME_NONNULL_END
void linkUINavigationBarThemeCategory(void);
| Add documentation for new stp_theme property | Add documentation for new stp_theme property
| C | mit | stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,NewAmsterdamLabs/stripe-ios,fbernardo/stripe-ios,fbernardo/stripe-ios,fbernardo/stripe-ios,NewAmsterdamLabs/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,fbernardo/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,NewAmsterdamLabs/stripe-ios |
93873731f73e905d8714556f1ebe23acb32de0e1 | src/math/numbertheory/reducer.h | src/math/numbertheory/reducer.h | /*
* Modular Reducer
* (C) 1999-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_MODULAR_REDUCER_H__
#define BOTAN_MODULAR_REDUCER_H__
#include <botan/numthry.h>
namespace Botan {
/*
* Modular Reducer
*/
class BOTAN_DLL Modular_Reducer
{
public:
BigInt reduce(const BigInt& x) const;
/**
* Multiply mod p
*/
BigInt multiply(const BigInt& x, const BigInt& y) const
{ return reduce(x * y); }
/**
* Square mod p
*/
BigInt square(const BigInt& x) const
{ return reduce(Botan::square(x)); }
/**
* Cube mod p
*/
BigInt cube(const BigInt& x) const
{ return multiply(x, this->square(x)); }
bool initialized() const { return (mod_words != 0); }
Modular_Reducer() { mod_words = 0; }
Modular_Reducer(const BigInt& mod);
private:
BigInt modulus, modulus_2, mu;
u32bit mod_words, mod2_words, mu_words;
};
}
#endif
| /*
* Modular Reducer
* (C) 1999-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_MODULAR_REDUCER_H__
#define BOTAN_MODULAR_REDUCER_H__
#include <botan/numthry.h>
namespace Botan {
/*
* Modular Reducer
*/
class BOTAN_DLL Modular_Reducer
{
public:
const BigInt& get_modulus() const { return modulus; }
BigInt reduce(const BigInt& x) const;
/**
* Multiply mod p
*/
BigInt multiply(const BigInt& x, const BigInt& y) const
{ return reduce(x * y); }
/**
* Square mod p
*/
BigInt square(const BigInt& x) const
{ return reduce(Botan::square(x)); }
/**
* Cube mod p
*/
BigInt cube(const BigInt& x) const
{ return multiply(x, this->square(x)); }
bool initialized() const { return (mod_words != 0); }
Modular_Reducer() { mod_words = 0; }
Modular_Reducer(const BigInt& mod);
private:
BigInt modulus, modulus_2, mu;
u32bit mod_words, mod2_words, mu_words;
};
}
#endif
| Make the modulus visible in Modular_Reducer | Make the modulus visible in Modular_Reducer
| C | bsd-2-clause | randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan |
64d3e89f9b9a25d56aa4a4f77f56656b14d7e03a | test/CodeGen/avx-cmp-builtins.c | test/CodeGen/avx-cmp-builtins.c | // RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H
#include <immintrin.h>
//
// Test LLVM IR codegen of cmpXY instructions
//
__m128d test_cmp_pd(__m128d a, __m128d b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.sse2.cmp.pd({{.*}}, i8 13)
return _mm_cmp_pd(a, b, _CMP_GE_OS);
}
__m128d test_cmp_ps(__m128 a, __m128 b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.sse.cmp.ps({{.*}}, i8 13)
return _mm_cmp_ps(a, b, _CMP_GE_OS);
}
__m256d test_cmp_pd256(__m256d a, __m256d b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.avx.cmp.pd.256({{.*}}, i8 13)
return _mm256_cmp_pd(a, b, _CMP_GE_OS);
}
__m256d test_cmp_ps256(__m256 a, __m256 b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.avx.cmp.ps.256({{.*}}, i8 13)
return _mm256_cmp_ps(a, b, _CMP_GE_OS);
}
__m128d test_cmp_sd(__m128d a, __m128d b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.sse2.cmp.sd({{.*}}, i8 13)
return _mm_cmp_sd(a, b, _CMP_GE_OS);
}
__m128d test_cmp_ss(__m128 a, __m128 b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 13)
return _mm_cmp_ss(a, b, _CMP_GE_OS);
}
| Test case for some AVX builtins. Patch by Syoyo Fujita! | Test case for some AVX builtins. Patch by Syoyo Fujita!
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@132518 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang |
|
16f44fcb1fabd5f79e3a508f467a7ba9aff71293 | dashboard.h | dashboard.h | #ifndef DASHBOARD_H
#define DASHBOARD_H
#include <sys/types.h>
#include "src/process/process.h"
typedef struct {
char *fieldbar;
int max_x;
int max_y;
int prev_x;
int prev_y;
proc_t *process_list;
} board_t;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void get_process_stats(proc_t *process_list, uid_t euid, long memtotal);
#endif
| #ifndef DASHBOARD_H
#define DASHBOARD_H
#include <sys/types.h>
#include "src/process/process.h"
#define STAT_PATHMAX 32
typedef struct {
uid_t euid;
int max_x;
int max_y;
int prev_x;
int prev_y;
char path[STAT_PATHMAX];
char *fieldbar;
long memtotal;
proc_t *process_list;
} board_t;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void get_process_stats(board_t *dashboard);
#endif
| Add in path field in board_t | Add in path field in board_t
| C | mit | tijko/dashboard |
88a704e430bbbc5d6f179a87e84a498b0d0529e1 | master/mtypes.h | master/mtypes.h | #define _MASTERTYPES
#include <inttypes.h>
//Declarations for master types
typedef enum
{
Register = 0,
Coil = 1
} MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.)
typedef struct
{
uint8_t Address; //Device address
uint8_t Function; //Function called, in which exception occured
uint8_t Code; //Exception code
} MODBUSException; //Parsed exception data
typedef struct
{
uint8_t Address; //Device address
MODBUSDataType DataType; //Data type
uint16_t Register; //Register, coil, input ID
uint16_t Value; //Value of data
} MODBUSData;
typedef struct
{
uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready
uint8_t *Frame; //Request frame content
} MODBUSRequestStatus; //Type containing information about frame that is set up at master side
typedef struct
{
MODBUSData *Data; //Data read from slave
MODBUSException Exception; //Optional exception read
MODBUSRequestStatus Request; //Formatted request for slave
uint8_t DataLength; //Count of data type instances read from slave
uint8_t Error; //Have any error occured?
uint8_t Finished; //Is parsing finished?
} MODBUSMasterStatus; //Type containing master device configuration data
| #define _MASTERTYPES
#include <inttypes.h>
//Declarations for master types
typedef enum
{
Register = 0,
Coil = 1,
DiscreteInput = 2
} MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.)
typedef struct
{
uint8_t Address; //Device address
uint8_t Function; //Function called, in which exception occured
uint8_t Code; //Exception code
} MODBUSException; //Parsed exception data
typedef struct
{
uint8_t Address; //Device address
MODBUSDataType DataType; //Data type
uint16_t Register; //Register, coil, input ID
uint16_t Value; //Value of data
} MODBUSData;
typedef struct
{
uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready
uint8_t *Frame; //Request frame content
} MODBUSRequestStatus; //Type containing information about frame that is set up at master side
typedef struct
{
MODBUSData *Data; //Data read from slave
MODBUSException Exception; //Optional exception read
MODBUSRequestStatus Request; //Formatted request for slave
uint8_t DataLength; //Count of data type instances read from slave
uint8_t Error; //Have any error occured?
uint8_t Finished; //Is parsing finished?
} MODBUSMasterStatus; //Type containing master device configuration data
| Add 'DiscreteImput' Modbus data type | Add 'DiscreteImput' Modbus data type
| C | mit | Jacajack/modlib |
7b40aa94c5dbe1f583687cf3b03604893b1d3ff1 | src/tagger.h | src/tagger.h | #ifndef __TAGGER_H__
#define __TAGGER_H__
#include <v8.h>
#include <node.h>
#include <node_events.h>
#include <mecab.h>
#include <stdio.h>
using namespace v8;
namespace MeCabBinding {
class Tagger : node::ObjectWrap {
public:
static void Initialize(const Handle<Object> target);
bool initialized();
const char* Parse(const char* input);
const mecab_node_t* ParseToNode(const char* input);
Tagger(const char* arg);
~Tagger();
protected:
static Handle<Value> New(const Arguments& args);
static Handle<Value> Parse(const Arguments& args);
static Handle<Value> ParseToNode(const Arguments& args);
static Handle<Value> Version(const Arguments& args);
private:
mecab_t* mecab;
mecab_node_t* mecabNode;
};
} // namespace MeCabBinding
#endif // __TAGGER_H__ | #ifndef __TAGGER_H__
#define __TAGGER_H__
#include <v8.h>
#include <node.h>
#include <mecab.h>
#include <stdio.h>
using namespace v8;
namespace MeCabBinding {
class Tagger : node::ObjectWrap {
public:
static void Initialize(const Handle<Object> target);
bool initialized();
const char* Parse(const char* input);
const mecab_node_t* ParseToNode(const char* input);
Tagger(const char* arg);
~Tagger();
protected:
static Handle<Value> New(const Arguments& args);
static Handle<Value> Parse(const Arguments& args);
static Handle<Value> ParseToNode(const Arguments& args);
static Handle<Value> Version(const Arguments& args);
private:
mecab_t* mecab;
mecab_node_t* mecabNode;
};
} // namespace MeCabBinding
#endif // __TAGGER_H__
| Remove dependency to node_events.h. Because it removed from Node since v0.5.2 | Remove dependency to node_events.h. Because it removed from Node since v0.5.2
| C | mit | hakobera/node-mecab-binding,hakobera/node-mecab-binding,hakobera/node-mecab-binding |
97849a174221f7adc9906e97c0dddf4ee4296615 | ios/RNSoundPlayer.h | ios/RNSoundPlayer.h | //
// RNSoundPlayer
//
// Created by Johnson Su on 2018-07-10.
//
#import <React/RCTBridgeModule.h>
#import <AVFoundation/AVFoundation.h>
#import <React/RCTEventEmitter.h>
@interface RNSoundPlayer : RCTEventEmitter <RCTBridgeModule, AVAudioPlayerDelegate>
@property (nonatomic, strong) AVAudioPlayer *player;
@property (nonatomic, strong) AVPlayer *avPlayer;
@property (nonatomic, strong) int loopCount;
@end
| //
// RNSoundPlayer
//
// Created by Johnson Su on 2018-07-10.
//
#import <React/RCTBridgeModule.h>
#import <AVFoundation/AVFoundation.h>
#import <React/RCTEventEmitter.h>
@interface RNSoundPlayer : RCTEventEmitter <RCTBridgeModule, AVAudioPlayerDelegate>
@property (nonatomic, strong) AVAudioPlayer *player;
@property (nonatomic, strong) AVPlayer *avPlayer;
@property (nonatomic) int loopCount;
@end
| Remove strong declaration from primitive type | Remove strong declaration from primitive type | C | mit | johnsonsu/react-native-sound-player,johnsonsu/react-native-sound-player,johnsonsu/react-native-sound-player |
a7a006d248135451d1187aa3fe14162159e173a5 | include/quid.h | include/quid.h | #ifndef QUID_H_INCLUDED
#define QUID_H_INCLUDED
#define UIDS_PER_TICK 1024 /* Generate identifiers per tick interval */
#define EPOCH_DIFF 11644473600LL /* Conversion needed for EPOCH to UTC */
#define RND_SEED_CYCLE 4096 /* Generate new random seed after interval */
/*
* Identifier structure
*/
struct quid {
unsigned long time_low; /* Time lover half */
unsigned short time_mid; /* Time middle half */
unsigned short time_hi_and_version; /* Time upper half and structure version */
unsigned char clock_seq_hi_and_reserved; /* Clock sequence */
unsigned char clock_seq_low; /* Clock sequence lower half */
unsigned char node[6]; /* Node allocation, filled with random memory data */
} __attribute__((packed));
typedef unsigned long long int cuuid_time_t;
/*
* Create new QUID
*/
void quid_create(struct quid *);
int quidcmp(const struct quid *a, const struct quid *b);
void quidtostr(char *s, struct quid *u);
#endif // QUID_H_INCLUDED
| #ifndef QUID_H_INCLUDED
#define QUID_H_INCLUDED
#define UIDS_PER_TICK 1024 /* Generate identifiers per tick interval */
#define EPOCH_DIFF 11644473600LL /* Conversion needed for EPOCH to UTC */
#define RND_SEED_CYCLE 4096 /* Generate new random seed after interval */
/*
* Identifier structure
*/
struct quid {
unsigned long time_low; /* Time lover half */
unsigned short time_mid; /* Time middle half */
unsigned short time_hi_and_version; /* Time upper half and structure version */
unsigned char clock_seq_hi_and_reserved; /* Clock sequence */
unsigned char clock_seq_low; /* Clock sequence lower half */
unsigned char node[6]; /* Node allocation, filled with random memory data */
} __attribute__((packed));
typedef unsigned long long int cuuid_time_t;
/*
* Create new QUID
*/
void quid_create(struct quid *);
/*
* Compare to QUID keys
*/
int quidcmp(const struct quid *a, const struct quid *b);
/*
* Convert QUID key to string
*/
void quidtostr(char *s, struct quid *u);
#endif // QUID_H_INCLUDED
| Add comment to public QUID functions | Add comment to public QUID functions
| C | bsd-3-clause | yorickdewid/Quantica,yorickdewid/Quantica,yorickdewid/Quantica,yorickdewid/Quantica |
af86cde8375d92cc310f16fd4bb0c2a87d6c4eb7 | includes/LinearAllocator.h | includes/LinearAllocator.h | #include "Allocator.h"
#ifndef LINEARALLOCATOR_H
#define LINEARALLOCATOR_H
class LinearAllocator : public Allocator {
private:
/* Offset from the start of the memory block */
long m_offset;
public:
/* Allocation of real memory */
LinearAllocator(const long totalSize);
/* Frees all memory */
virtual ~LinearAllocator();
/* Allocate virtual memory */
virtual void* Allocate(const std::size_t size, const std::size_t alignment) override;
/* Frees virtual memory */
virtual void Free(void* ptr) override;
/* Frees all virtual memory */
virtual void Reset() override;
};
#endif /* LINEARALLOCATOR_H */
| #include "Allocator.h"
#ifndef LINEARALLOCATOR_H
#define LINEARALLOCATOR_H
class LinearAllocator : public Allocator {
protected:
/* Offset from the start of the memory block */
long m_offset;
public:
/* Allocation of real memory */
LinearAllocator(const long totalSize);
/* Frees all memory */
virtual ~LinearAllocator();
/* Allocate virtual memory */
virtual void* Allocate(const std::size_t size, const std::size_t alignment) override;
/* Frees virtual memory */
virtual void Free(void* ptr) override;
/* Frees all virtual memory */
virtual void Reset() override;
};
#endif /* LINEARALLOCATOR_H */
| Make offset a protected var. | Make offset a protected var.
| C | mit | mtrebi/memory-allocators |
f673eab257109c23f290e22d472a8c156c2ef340 | math/vecops/inc/LinkDef.h | math/vecops/inc/LinkDef.h | /*************************************************************************
* Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* Author: Danilo Piparo - CERN *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifdef __CLING__
#pragma link C++ namespace ROOT::VecOps;
#pragma link C++ class ROOT::VecOps::RVec<bool>-;
#pragma link C++ class ROOT::VecOps::RVec<float>-;
#pragma link C++ class ROOT::VecOps::RVec<double>-;
#pragma link C++ class ROOT::VecOps::RVec<char>-;
#pragma link C++ class ROOT::VecOps::RVec<short>-;
#pragma link C++ class ROOT::VecOps::RVec<int>-;
#pragma link C++ class ROOT::VecOps::RVec<long>-;
#pragma link C++ class ROOT::VecOps::RVec<long long>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned char>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned short>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned int>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned long>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned long long>-;
#endif
| /*************************************************************************
* Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* Author: Danilo Piparo - CERN *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifdef __CLING__
#pragma link C++ namespace ROOT::VecOps;
#pragma link C++ class ROOT::VecOps::RVec<bool>-;
#pragma link C++ class ROOT::VecOps::RVec<float>-;
#pragma link C++ class ROOT::VecOps::RVec<double>-;
#pragma link C++ class ROOT::VecOps::RVec<char>-;
#pragma link C++ class ROOT::VecOps::RVec<short>-;
#pragma link C++ class ROOT::VecOps::RVec<int>-;
#pragma link C++ class ROOT::VecOps::RVec<long>-;
#pragma link C++ class ROOT::VecOps::RVec<long long>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned char>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned short>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned int>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned long>-;
#pragma link C++ class ROOT::VecOps::RVec<unsigned long long>-;
#endif
| Update year in a copyright notice | [VecOps][NFC] Update year in a copyright notice
| C | lgpl-2.1 | olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root |
ca0d17277fd101ce4878f92b398b6ab71fb2c287 | arch/sh/include/asm/ftrace.h | arch/sh/include/asm/ftrace.h | #ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H
#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#ifndef __ASSEMBLY__
extern void mcount(void);
#define MCOUNT_ADDR ((long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALLER_ADDR ((long)(ftrace_caller))
#define STUB_ADDR ((long)(ftrace_stub))
#define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALLER_ADDR) >> 1)
struct dyn_arch_ftrace {
/* No extra data needed on sh */
};
#endif /* CONFIG_DYNAMIC_FTRACE */
static inline unsigned long ftrace_call_adjust(unsigned long addr)
{
/* 'addr' is the memory table address. */
return addr;
}
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */
#endif /* __ASM_SH_FTRACE_H */
| #ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H
#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#ifndef __ASSEMBLY__
extern void mcount(void);
#define MCOUNT_ADDR ((long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALL_ADDR ((long)(ftrace_call))
#define STUB_ADDR ((long)(ftrace_stub))
#define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4)
struct dyn_arch_ftrace {
/* No extra data needed on sh */
};
#endif /* CONFIG_DYNAMIC_FTRACE */
static inline unsigned long ftrace_call_adjust(unsigned long addr)
{
/* 'addr' is the memory table address. */
return addr;
}
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */
#endif /* __ASM_SH_FTRACE_H */
| Fix the value of MCOUNT_INSN_OFFSET | sh: Fix the value of MCOUNT_INSN_OFFSET
It seems that MCOUNT_INSN_OFFSET was calculating the distance between
the wrong functions. The value that should have actually been computed
is the distance between ftrace_call and ftrace_stub. I discovered this
when I added some code to ftrace_caller.
Signed-off-by: Matt Fleming <[email protected]>
Signed-off-by: Paul Mundt <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
d9b05e6ae11c5f17590d493ef7bff52239bed3bb | test2/type_propagation/expr_if_noreturn.c | test2/type_propagation/expr_if_noreturn.c | // RUN: %ocheck 0 %s
_Noreturn void exit(int);
void g(int i)
{
}
int f(int p)
{
(p == 5 ? exit : g)(2);
// this shouldn't be thought of as unreachable
return 7;
}
main()
{
f(4);
return 0;
}
| // RUN: %ucc -fsyntax-only %s
_Noreturn void exit(int);
__attribute((noreturn)) void exit2(int);
void g(int i);
_Static_assert(
!__builtin_has_attribute(g, noreturn),
"");
_Static_assert(
__builtin_has_attribute(exit, noreturn),
"");
_Static_assert(
__builtin_has_attribute(exit2, noreturn),
"");
_Static_assert(
!__builtin_has_attribute(
(1 ? exit : g),
noreturn),
"");
_Static_assert(
!__builtin_has_attribute(
(1 ? exit2 : g),
noreturn),
"");
| Change noreturn attribute tests into static asserts | Change noreturn attribute tests into static asserts
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
46b69e3de1b7817f4d8ed46fe1975f4bf630f0ec | plat/arm/common/arm_err.c | plat/arm/common/arm_err.c | /*
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <board_arm_def.h>
#include <console.h>
#include <debug.h>
#include <errno.h>
#include <norflash.h>
#include <platform.h>
#include <stdint.h>
/*
* ARM common implementation for error handler
*/
void plat_error_handler(int err)
{
int ret;
switch (err) {
case -ENOENT:
case -EAUTH:
/* Image load or authentication error. Erase the ToC */
INFO("Erasing FIP ToC from flash...\n");
nor_unlock(PLAT_ARM_FIP_BASE);
ret = nor_word_program(PLAT_ARM_FIP_BASE, 0);
if (ret != 0) {
ERROR("Cannot erase ToC\n");
} else {
INFO("Done\n");
}
break;
default:
/* Unexpected error */
break;
}
(void)console_flush();
/* Loop until the watchdog resets the system */
for (;;)
wfi();
}
| /*
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <console.h>
#include <debug.h>
#include <errno.h>
#include <norflash.h>
#include <platform.h>
#include <platform_def.h>
#include <stdint.h>
/*
* ARM common implementation for error handler
*/
void plat_error_handler(int err)
{
int ret;
switch (err) {
case -ENOENT:
case -EAUTH:
/* Image load or authentication error. Erase the ToC */
INFO("Erasing FIP ToC from flash...\n");
nor_unlock(PLAT_ARM_FIP_BASE);
ret = nor_word_program(PLAT_ARM_FIP_BASE, 0);
if (ret != 0) {
ERROR("Cannot erase ToC\n");
} else {
INFO("Done\n");
}
break;
default:
/* Unexpected error */
break;
}
(void)console_flush();
/* Loop until the watchdog resets the system */
for (;;)
wfi();
}
| Include board_arm_def.h through the platform's header | Include board_arm_def.h through the platform's header
The board_arm_def.h header file needs to be included via the platform
definition header. Not doing so, results in a redefinition error of
PLAT_ARM_MAX_BL31_SIZE macro, if defined in the platform definition
file.
Change-Id: I1d178f6e8a6a41461e7fbcab9f6813a2faa2d82b
Signed-off-by: Sughosh Ganu <[email protected]>
| C | bsd-3-clause | achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware |
aae7b4f35980df99477fb0ad43995610bc9a0b60 | Clue/Classes/Protocols/CLUViewRecordableProperties.h | Clue/Classes/Protocols/CLUViewRecordableProperties.h | //
// CLUViewRecordableProperties.h
// Clue
//
// Created by Ahmed Sulaiman on 5/27/16.
// Copyright © 2016 Ahmed Sulaiman. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol CLUViewRecordableProperties <NSObject>
@required
- (NSMutableDictionary *)clue_viewPropertiesDictionary;
@end
| Add protocol for view to return readable properties dictionary (CLURecordableProperties) for View Structure recordable module | Add protocol for view to return readable properties dictionary (CLURecordableProperties) for View Structure recordable module
| C | mit | Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue |
|
e4be4b7b996cc7fb279d74b5001ab0817b22b6c4 | audio/null_audio_poller.h | audio/null_audio_poller.h | /*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_NULL_AUDIO_POLLER_H_
#define AUDIO_NULL_AUDIO_POLLER_H_
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/messagehandler.h"
#include "rtc_base/thread_checker.h"
namespace webrtc {
namespace internal {
class NullAudioPoller final : public rtc::MessageHandler {
public:
explicit NullAudioPoller(AudioTransport* audio_transport);
~NullAudioPoller();
protected:
void OnMessage(rtc::Message* msg) override;
private:
rtc::ThreadChecker thread_checker_;
AudioTransport* const audio_transport_;
int64_t reschedule_at_;
};
} // namespace internal
} // namespace webrtc
#endif // AUDIO_NULL_AUDIO_POLLER_H_
| /*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_NULL_AUDIO_POLLER_H_
#define AUDIO_NULL_AUDIO_POLLER_H_
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/messagehandler.h"
#include "rtc_base/thread_checker.h"
namespace webrtc {
namespace internal {
class NullAudioPoller final : public rtc::MessageHandler {
public:
explicit NullAudioPoller(AudioTransport* audio_transport);
~NullAudioPoller();
protected:
void OnMessage(rtc::Message* msg) override;
private:
const rtc::ThreadChecker thread_checker_;
AudioTransport* const audio_transport_;
int64_t reschedule_at_;
};
} // namespace internal
} // namespace webrtc
#endif // AUDIO_NULL_AUDIO_POLLER_H_
| Revert "Remove const from ThreadChecker in NullAudioPoller." | Revert "Remove const from ThreadChecker in NullAudioPoller."
This reverts commit 54e41dd08a06f978a6d123f19f5bbe39370f04ea.
Reason for revert: We are reverting also https://webrtc-review.googlesource.com/c/src/+/16180, so this CL will be included in the re-land of https://webrtc-review.googlesource.com/c/src/+/16180.
Original change's description:
> Remove const from ThreadChecker in NullAudioPoller.
>
> [email protected],[email protected]
>
> Bug: webrtc:8482
> Change-Id: Ib2738224e776618c692db95cd9473335bc17be15
> Reviewed-on: https://webrtc-review.googlesource.com/17540
> Commit-Queue: Björn Terelius <[email protected]>
> Reviewed-by: Björn Terelius <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#20505}
[email protected]
Change-Id: I27c70ce331043ffdfec676c7e1a51e741d2fe770
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8482
Reviewed-on: https://webrtc-review.googlesource.com/17700
Reviewed-by: Mirko Bonadei <[email protected]>
Commit-Queue: Mirko Bonadei <[email protected]>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#20511} | C | bsd-3-clause | ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc |
3759e834f356d5de1f047d85d18ab401d653a7d5 | source/Loader.h | source/Loader.h | #include <string>
#include <fstream>
#ifndef LOADER
#define LOADER
namespace lyrics
{
using std::string;
using std::istream;
class Loader
{
public:
bool Load( const string name, char *&data, unsigned int &size )
{
using std::ifstream;
using std::ios;
using std::ios_base;
ifstream input( name, ios::in | ios::binary );
if ( !input )
{
// TODO:
return false;
}
if ( !IStreamSize( input, size ) )
{
// TODO:
return false;
}
data = new char [size];
if ( data == nullptr )
{
// TODO:
return false;
}
input.read( data , size );
input.close();
return true;
}
private:
bool IStreamSize( istream &input, unsigned int &size )
{
using std::ios_base;
using std::streamoff;
streamoff off;
input.seekg( 0, ios_base::end );
off = input.tellg();
input.seekg( 0, ios_base::beg );
if ( off == -1 )
{
return false;
}
size = off;
return true;
}
};
}
#endif
| #include <string>
#include <fstream>
#ifndef LOADER
#define LOADER
namespace lyrics
{
using std::string;
using std::istream;
class Loader
{
public:
bool Load( const string name, char *&data, unsigned int &size )
{
using std::ifstream;
using std::ios;
using std::ios_base;
ifstream input( name, ios::in | ios::binary );
if ( !input )
{
// TODO:
return false;
}
if ( !IStreamSize( input, size ) )
{
// TODO:
return false;
}
data = new char [size];
if ( data == nullptr )
{
// TODO:
return false;
}
input.read( data , size );
input.close();
return true;
}
private:
bool IStreamSize( istream &input, unsigned int &size )
{
using std::ios_base;
input.seekg( 0, ios_base::end );
auto off = input.tellg();
input.seekg( 0, ios_base::beg );
if ( off == decltype( off )( -1 ) )
{
return false;
}
size = off;
return true;
}
};
}
#endif
| Return type of tellg() is implementation defined | Return type of tellg() is implementation defined
| C | artistic-2.0 | fullnessfruit/Lyrics |
4430925e23e7f2f38b89047512461eb08a520b2c | ATK/Dynamic/GainExpanderFilter.h | ATK/Dynamic/GainExpanderFilter.h | /**
* \file GainExpanderFilter.h
*/
#ifndef ATK_DYNAMIC_GAINEXPANDERFILTER_H
#define ATK_DYNAMIC_GAINEXPANDERFILTER_H
#include <vector>
#include <ATK/Dynamic/GainFilter.h>
#include "config.h"
namespace ATK
{
/**
* Gain "expander". Computes a new amplitude/volume gain based on threshold, slope and the power of the input signal
*/
template<typename DataType_>
class ATK_DYNAMIC_EXPORT GainExpanderFilter : public GainFilter<DataType_>
{
protected:
typedef GainFilter<DataType_> Parent;
using typename Parent::DataType;
using Parent::ratio;
using Parent::softness;
using Parent::recomputeFuture;
using Parent::recomputeLUT;
public:
GainExpanderFilter(int nb_channels = 1, size_t LUTsize = 128*1024, size_t LUTprecision = 64);
~GainExpanderFilter();
protected:
DataType_ computeGain(DataType_ value) const override final;
};
}
#endif
| /**
* \file GainExpanderFilter.h
*/
#ifndef ATK_DYNAMIC_GAINEXPANDERFILTER_H
#define ATK_DYNAMIC_GAINEXPANDERFILTER_H
#include <vector>
#include <ATK/Dynamic/GainFilter.h>
#include "config.h"
namespace ATK
{
/**
* Gain "expander". Computes a new amplitude/volume gain based on threshold, slope and the power of the input signal
*/
template<typename DataType_>
class ATK_DYNAMIC_EXPORT GainExpanderFilter : public GainFilter<DataType_>
{
protected:
typedef GainFilter<DataType_> Parent;
using typename Parent::DataType;
using Parent::ratio;
using Parent::softness;
using Parent::recomputeFuture;
using Parent::recomputeLUT;
public:
GainExpanderFilter(int nb_channels = 1, size_t LUTsize = 128*1024, size_t LUTprecision = 1024);
~GainExpanderFilter();
protected:
DataType_ computeGain(DataType_ value) const override final;
};
}
#endif
| Fix default LUT size and precision for expander | Fix default LUT size and precision for expander
| C | bsd-3-clause | mbrucher/AudioTK,mbrucher/AudioTK,mbrucher/AudioTK,mbrucher/AudioTK |
8732619871bdd054e80e53b3adaa563bf4cb26d9 | thrift/lib/cpp2/security/FizzPeeker.h | thrift/lib/cpp2/security/FizzPeeker.h | /*
* Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <thrift/lib/cpp/async/TAsyncFizzServer.h>
#include <wangle/acceptor/FizzAcceptorHandshakeHelper.h>
namespace apache {
namespace thrift {
class ThriftFizzAcceptorHandshakeHelper
: public wangle::FizzAcceptorHandshakeHelper {
public:
using FizzAcceptorHandshakeHelper::FizzAcceptorHandshakeHelper;
protected:
fizz::server::AsyncFizzServer::UniquePtr createFizzServer(
folly::AsyncSSLSocket::UniquePtr sslSock,
const std::shared_ptr<fizz::server::FizzServerContext>& fizzContext,
const std::shared_ptr<fizz::ServerExtensions>& /*extensions*/) override {
folly::AsyncSocket::UniquePtr asyncSock(
new apache::thrift::async::TAsyncSocket(std::move(sslSock)));
asyncSock->cacheAddresses();
return fizz::server::AsyncFizzServer::UniquePtr(
new apache::thrift::async::TAsyncFizzServer(
std::move(asyncSock), fizzContext, extension_));
}
folly::AsyncSSLSocket::UniquePtr createSSLSocket(
const std::shared_ptr<folly::SSLContext>& sslContext,
folly::EventBase* evb,
int fd) override {
return folly::AsyncSSLSocket::UniquePtr(
new apache::thrift::async::TAsyncSSLSocket(
sslContext,
evb,
fd));
}
};
class FizzPeeker : public wangle::DefaultToFizzPeekingCallback {
public:
using DefaultToFizzPeekingCallback::DefaultToFizzPeekingCallback;
wangle::AcceptorHandshakeHelper::UniquePtr getHelper(
const std::vector<uint8_t>& /* bytes */,
const folly::SocketAddress& clientAddr,
std::chrono::steady_clock::time_point acceptTime,
wangle::TransportInfo& tinfo) override {
if (!context_) {
return nullptr;
}
return wangle::AcceptorHandshakeHelper::UniquePtr(
new ThriftFizzAcceptorHandshakeHelper(context_,
clientAddr,
acceptTime,
tinfo,
loggingCallback_,
tokenBindingContext_));
}
};
} // namespace thrift
} // namespace apache
| Add fizz peeker to thrift | Add fizz peeker to thrift
Summary: Support fizz in `Cpp2Worker`; this is one step in the process.
Reviewed By: yfeldblum
Differential Revision: D10246496
fbshipit-source-id: 2f655ff49641a91338d2e0e2ab362886754f2ec2
| C | apache-2.0 | facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift |
|
daaf5d744b26d5ead5c1dce175efbc0603f70655 | csrc/main.c | csrc/main.c | /**
* Main Program to shutdown the raspberry pi. This process needs to be run as root to allow this.
* All this program does is to run the shutdown command. If the process has the setuid bit enabled and belongs to root this should work.
*/
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
/* Disable output */
system("i2cset -y 1 0x10 0x07 0x20");
system("i2cset -y 1 0x10 0x08 0x20");
system("i2cset -y 1 0x11 0x07 0x20");
system("i2cset -y 1 0x11 0x08 0x20");
system("i2cset -y 1 0x12 0x07 0x20");
system("i2cset -y 1 0x12 0x08 0x20");
system("i2cset -y 1 0x13 0x07 0x20");
system("i2cset -y 1 0x13 0x08 0x20");
/* Shutdown */
system("shutdown -h -P now");
}
| Add c program for shutting down the board. | Add c program for shutting down the board.
The program disables the output and then shuts down the system
| C | mit | bigdisp/scoreboard-php-api,bigdisp/scoreboard-php-api,bigdisp/scoreboard-php-api,bigdisp/scoreboard-php-api |
|
ed49a4fc89281608f41bebd3d09b8e0e1f2ea4c8 | Classes/Network/PonyDebugger/FLEXNetworkObserver.h | Classes/Network/PonyDebugger/FLEXNetworkObserver.h | //
// FLEXNetworkObserver.h
// Derived from:
//
// PDAFNetworkDomainController.h
// PonyDebugger
//
// Created by Mike Lewis on 2/27/12.
//
// Licensed to Square, Inc. under one or more contributor license agreements.
// See the LICENSE file distributed with this work for the terms under
// which Square, Inc. licenses this file to you.
//
#import <Foundation/Foundation.h>
extern NSString *const kFLEXNetworkObserverEnabledStateChangedNotification;
/// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system.
/// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
@interface FLEXNetworkObserver : NSObject
/// Swizzling occurs when the observer is enabled for the first time.
/// This reduces the impact of FLEX if network debugging is not desired.
/// NOTE: this setting persists between launches of the app.
+ (void)setEnabled:(BOOL)enabled;
+ (BOOL)isEnabled;
@end
| //
// FLEXNetworkObserver.h
// Derived from:
//
// PDAFNetworkDomainController.h
// PonyDebugger
//
// Created by Mike Lewis on 2/27/12.
//
// Licensed to Square, Inc. under one or more contributor license agreements.
// See the LICENSE file distributed with this work for the terms under
// which Square, Inc. licenses this file to you.
//
#import <Foundation/Foundation.h>
FOUNDATION_EXTERN NSString *const kFLEXNetworkObserverEnabledStateChangedNotification;
/// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system.
/// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
@interface FLEXNetworkObserver : NSObject
/// Swizzling occurs when the observer is enabled for the first time.
/// This reduces the impact of FLEX if network debugging is not desired.
/// NOTE: this setting persists between launches of the app.
+ (void)setEnabled:(BOOL)enabled;
+ (BOOL)isEnabled;
@end
| Use FOUNDATION_EXTERN for global variable | Use FOUNDATION_EXTERN for global variable
Global variables that can be accessed from both C (or Objective-C) and
C++ (or Objective-C++) source files should be marked `extern "C"` when
in C++ mode (which is what `FOUNDATION_EXTERN` does), to ensure
consistent access across languages.
| C | bsd-3-clause | Flipboard/FLEX,NSExceptional/FLEX,Xiaobin0860/FLEX,Flipboard/FLEX,NSExceptional/FLEX |
01b2b933f6ec5dcfa72db6c3d338bbdeaf518f92 | test/include/scheduler_mock.h | test/include/scheduler_mock.h | /**
* @file testUtils.h
* @author Konrad Zemek
* @copyright (C) 2014 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in 'LICENSE.txt'
*/
#ifndef VEILHELPERS_SCHEDULER_MOCK_H
#define VEILHELPERS_SCHEDULER_MOCK_H
#include "scheduler.h"
#include <gmock/gmock.h>
class MockScheduler: public veil::Scheduler
{
public:
MockScheduler()
: veil::Scheduler{0}
{
}
MOCK_METHOD1(post, void(const std::function<void()>&));
MOCK_METHOD2(schedule, std::function<void()>(const std::chrono::milliseconds,
std::function<void()>));
};
#endif // VEILHELPERS_SCHEDULER_MOCK_H
| /**
* @file testUtils.h
* @author Konrad Zemek
* @copyright (C) 2014 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in 'LICENSE.txt'
*/
#ifndef ONEHELPERS_SCHEDULER_MOCK_H
#define ONEHELPERS_SCHEDULER_MOCK_H
#include "scheduler.h"
#include <gmock/gmock.h>
class MockScheduler: public one::Scheduler
{
public:
MockScheduler()
: one::Scheduler{0}
{
}
MOCK_METHOD1(post, void(const std::function<void()>&));
MOCK_METHOD2(schedule, std::function<void()>(const std::chrono::milliseconds,
std::function<void()>));
};
#endif // ONEHELPERS_SCHEDULER_MOCK_H
| Rename namespaces in scheduler mock. | Rename namespaces in scheduler mock.
Former-commit-id: 9f4df2e43ea192309775d59d00e2a0e2179b8664 | C | mit | onedata/oneclient,onedata/oneclient,onedata/helpers,onedata/helpers,onedata/oneclient,onedata/oneclient |
da8596b60b1c90a870c9610c2cef7f06a03b6cdc | SDKs/darwin/usr/include/string.h | SDKs/darwin/usr/include/string.h | /* ===-- string.h - stub SDK header for compiler-rt -------------------------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===-----------------------------------------------------------------------===
*
* This is a stub SDK header file. This file is not part of the interface of
* this library nor an official version of the appropriate SDK header. It is
* intended only to stub the features of this header required by compiler-rt.
*
* ===-----------------------------------------------------------------------===
*/
#ifndef __STRING_H__
#define __STRING_H__
typedef __SIZE_TYPE__ size_t;
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t);
void *memset(void *, int, size_t);
char *strcat(char *, const char *);
char *strcpy(char *, const char *);
char *strdup(const char *);
size_t strlen(const char *);
char *strncpy(char *, const char *, size_t);
#endif /* __STRING_H__ */
| /* ===-- string.h - stub SDK header for compiler-rt -------------------------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===-----------------------------------------------------------------------===
*
* This is a stub SDK header file. This file is not part of the interface of
* this library nor an official version of the appropriate SDK header. It is
* intended only to stub the features of this header required by compiler-rt.
*
* ===-----------------------------------------------------------------------===
*/
#ifndef __STRING_H__
#define __STRING_H__
typedef __SIZE_TYPE__ size_t;
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t);
void *memset(void *, int, size_t);
char *strcat(char *, const char *);
char *strcpy(char *, const char *);
char *strdup(const char *);
size_t strlen(const char *);
char *strncpy(char *, const char *, size_t);
/* Determine the appropriate strerror() function. */
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
# if defined(__i386)
# define __STRERROR_NAME "_strerror$UNIX2003"
# elif defined(__x86_64__) || defined(__arm)
# define __STRERROR_NAME "_strerror"
# else
# error "unrecognized architecture for targetting OS X"
# endif
#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
# if defined(__i386) || defined (__x86_64) || defined(__arm)
# define __STRERROR_NAME "_strerror"
# else
# error "unrecognized architecture for targetting iOS"
# endif
#else
# error "unrecognized architecture for targetting Darwin"
#endif
char *strerror(int) __asm(__STRERROR_NAME);
#endif /* __STRING_H__ */
| Declare 'strerror' so that we can use it with errno. | Declare 'strerror' so that we can use it with errno.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@185105 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 |
4145de6df7bd46ab56c4be5edb302c0f52a26d63 | broadcaster.c | broadcaster.c | #include <arpa/inet.h>
#include <errno.h>
#include <sys/socket.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <unistd.h>
#define BROADCAST_ADDRESS "255.255.255.255"
void print_error(const char* message) {
size_t message_length = strlen(message);
char error_message[message_length + 7];
strcpy(error_message, message);
strcpy(error_message + message_length, " (%s)\n");
fprintf(stderr, error_message, strerror(errno));
}
int main() {
int broadcasting_socket = socket(PF_INET, SOCK_DGRAM, 0);
if (broadcasting_socket == -1) {
print_error("Failed to create broadcasting socket");
exit(1);
}
int turn_on_broadcasting = 1;
int setsockopt_status = setsockopt(broadcasting_socket, SOL_SOCKET, SO_BROADCAST,
&turn_on_broadcasting, sizeof(turn_on_broadcasting));
if (setsockopt_status == -1) {
print_error("Failed to turn on broadcasting on");
}
struct sockaddr_in broadcast_address;
int broadcast_port = 54545;
memset(&broadcast_address, 0, sizeof(broadcast_address));
broadcast_address.sin_family = AF_INET;
broadcast_address.sin_addr.s_addr = inet_addr(BROADCAST_ADDRESS);
broadcast_address.sin_port = htons(broadcast_port);
ssize_t sent_bytes_count = sendto(broadcasting_socket, "", 1, 0,
(struct sockaddr*) &broadcast_address, sizeof(broadcast_address));
if (sent_bytes_count == -1) {
print_error("Failed to send broadcast message");
}
int close_status = close(broadcasting_socket);
if (close_status == -1) {
print_error("Failed to close broadcast socket");
}
return 0;
}
| Add C version of broadcast client | Add C version of broadcast client
| C | unlicense | mmurdoch/disco,mmurdoch/disco |
|
71ba3bbdf668b4f6bff2c189395b913b79870002 | test/oldstyle.c | test/oldstyle.c | // Copyright 2012 Rui Ueyama <[email protected]>
// This program is free software licensed under the MIT license.
#include "test.h"
#ifdef __8cc__
#pragma disable_warning
#endif
void testmain(void) {
print("K&R");
expect(3, no_declaration());
}
int no_declaration() {
return 3;
}
| Add tests for K&R-style functions. | Add tests for K&R-style functions.
| C | mit | andrewchambers/8cc,rui314/8cc,andrewchambers/8cc,cpjreynolds/8cc,gergo-/8cc,abc00/8cc,rui314/8cc,vastin/8cc,8l/8cc,jtramm/8cc,cpjreynolds/8cc,8l/8cc,cpjreynolds/8cc,abc00/8cc,rui314/8cc,nobody1986/8cc,8l/8cc,andrewchambers/8cc,jtramm/8cc,jtramm/8cc,cpjreynolds/8cc,andrewchambers/8cc,gergo-/8cc,abc00/8cc,vastin/8cc,abc00/8cc,jtramm/8cc,gergo-/8cc,nobody1986/8cc,rui314/8cc,vastin/8cc,8l/8cc,nobody1986/8cc,nobody1986/8cc,vastin/8cc |
|
bf647d807ab6770a831e0ef4fc09c870b756dd4a | src/argparse.c | src/argparse.c | #include "argparse.h"
args *args_new() {
args *args = NULL;
args = malloc(sizeof(args));
if (!args)
return NULL;
args->opts = NULL;
args->operandsc = 0;
args->operands = NULL;
return args;
}
void args_free(args *args) {
if (args->opts)
option_free(args->opts);
args->opts = NULL;
if (args->operands)
operand_free(args->operands);
args->operands = NULL;
free(args);
}
int args_add_option(args *args, option *opt) {
if (!args || !opt)
return EXIT_FAILURE;
if (!opt->short_opt && !opt->long_opt)
return EXIT_FAILURE;
option *last = args->opts;
if (last != NULL) {
while (last->next != NULL)
last = last->next;
last->next = opt;
} else
args->opts = opt;
return EXIT_SUCCESS;
}
int args_help(args *args, FILE *stream) {
if (!args || !stream || !args->opts)
return EXIT_FAILURE;
option *opt = args->opts;
while (opt) {
option_help(opt, stream);
opt = opt->next;
}
return EXIT_SUCCESS;
}
| #include "argparse.h"
args *args_new() {
args *args = NULL;
args = malloc(sizeof(args));
if (!args)
return NULL;
args->opts = NULL;
args->operandsc = 0;
args->operands = NULL;
return args;
}
void args_free(args *args) {
if (args->opts)
option_free(args->opts);
args->opts = NULL;
if (args->operands)
operand_free(args->operands);
args->operands = NULL;
free(args);
}
int args_add_option(args *args, option *opt) {
if (!args || !opt)
return EXIT_FAILURE;
if (strcmp("", opt->short_opt) == 0
&& strcmp("", opt->long_opt) == 0)
return EXIT_FAILURE;
option *last = args->opts;
if (last != NULL) {
while (last->next != NULL)
last = last->next;
last->next = opt;
} else
args->opts = opt;
return EXIT_SUCCESS;
}
int args_help(args *args, FILE *stream) {
if (!args || !stream || !args->opts)
return EXIT_FAILURE;
option *opt = args->opts;
while (opt) {
option_help(opt, stream);
opt = opt->next;
}
return EXIT_SUCCESS;
}
| Use strcmp instead of checking for pointer | Use strcmp instead of checking for pointer
| C | mit | ntnn/libargparse,ntnn/libargparse |
6274b10a9783f5c7e36bd43f25f5ceeb5b691a81 | src/nanotime.h | src/nanotime.h | #ifndef NANOTIME_H
#define NANOTIME_H
#include <time.h>
#ifdef __MACH__
#define NANO extern
#else
#define NANO
#endif
typedef enum {
NANO_FAILURE = -1,
NANO_SUCCESS = 0
} nano_return_t;
#define NANO_EXPECTED(X) X == NANO_SUCCESS
#define NANO_UNEXPECTED(X) X == NANO_FAILURE
NANO nano_return_t nano_second(unsigned long *second);
NANO nano_return_t nano_time(long double *time);
NANO nano_return_t nano_timespec(struct timespec *now);
#endif
| #ifndef NANOTIME_H
#define NANOTIME_H
#include <time.h>
#ifdef __MACH__
#define NANO extern
#else
#define NANO
#endif
typedef enum {
NANO_FAILURE = -1,
NANO_SUCCESS = 0
} nano_return_t;
#define NANO_EXPECTED(X) (X) == NANO_SUCCESS
#define NANO_UNEXPECTED(X) (X) != NANO_SUCCESS
NANO nano_return_t nano_second(unsigned long *second);
NANO nano_return_t nano_time(long double *time);
NANO nano_return_t nano_timespec(struct timespec *now);
#endif
| Allow for further room in the return enum | Allow for further room in the return enum
| C | mit | lstrojny/nanotime,lstrojny/nanotime |
9a320dc49927cbcc910232dbeabb8999d3fb2896 | core/editline/src/rlcurses.h | core/editline/src/rlcurses.h | // @(#)root/editline:$Id$
// Author: Axel Naumann, 2009
/*************************************************************************
* Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifdef __sun
# include R__CURSESHDR
extern "C" {
// cannot #include term.fH because it #defines move() etc
char *tparm(char*, long, long, long, long, long, long, long, long, long);
char *tigetstr(char*);
char *tgoto(char*, int, int);
int tputs(char*, int, int (*)(int));
int tgetflag(char*);
int tgetnum(char*);
char* tgetstr(char*, char**);
int tgetent(char*, const char*);
}
// un-be-lievable.
# undef erase
# undef move
# undef clear
# undef del
# undef key_end
# undef key_clear
# undef key_print
#else
# include R__CURSESHDR
# include <termcap.h>
# include <termcap.h>
extern "C" int setupterm(const char* term, int fd, int* perrcode);
#endif
| // @(#)root/editline:$Id$
// Author: Axel Naumann, 2009
/*************************************************************************
* Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifdef __sun
# include R__CURSESHDR
extern "C" {
// cannot #include term.h because it #defines move() etc
char *tparm(char*, long, long, long, long, long, long, long, long, long);
char *tigetstr(char*);
int tigetnum(char*);
char *tgoto(char*, int, int);
int tputs(char*, int, int (*)(int));
int tgetflag(char*);
int tgetnum(char*);
char* tgetstr(char*, char**);
int tgetent(char*, const char*);
}
// un-be-lievable.
# undef erase
# undef move
# undef clear
# undef del
# undef key_end
# undef key_clear
# undef key_print
#else
# include R__CURSESHDR
# include <termcap.h>
# include <termcap.h>
extern "C" int setupterm(const char* term, int fd, int* perrcode);
#endif
| Fix for solaris: declare tigetnum | Fix for solaris: declare tigetnum
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@30238 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | tc3t/qoot,zzxuanyuan/root-compressor-dummy,simonpf/root,ffurano/root5,veprbl/root,zzxuanyuan/root-compressor-dummy,Duraznos/root,CristinaCristescu/root,thomaskeck/root,olifre/root,perovic/root,evgeny-boger/root,perovic/root,CristinaCristescu/root,bbockelm/root,thomaskeck/root,beniz/root,abhinavmoudgil95/root,mattkretz/root,arch1tect0r/root,kirbyherm/root-r-tools,esakellari/root,lgiommi/root,buuck/root,gbitzes/root,sirinath/root,satyarth934/root,omazapa/root-old,krafczyk/root,sawenzel/root,CristinaCristescu/root,mkret2/root,bbockelm/root,agarciamontoro/root,gbitzes/root,perovic/root,vukasinmilosevic/root,ffurano/root5,krafczyk/root,bbockelm/root,buuck/root,smarinac/root,jrtomps/root,abhinavmoudgil95/root,veprbl/root,Y--/root,karies/root,krafczyk/root,perovic/root,krafczyk/root,evgeny-boger/root,arch1tect0r/root,Duraznos/root,Duraznos/root,simonpf/root,CristinaCristescu/root,thomaskeck/root,mkret2/root,strykejern/TTreeReader,gganis/root,strykejern/TTreeReader,mattkretz/root,zzxuanyuan/root-compressor-dummy,davidlt/root,buuck/root,zzxuanyuan/root-compressor-dummy,smarinac/root,kirbyherm/root-r-tools,omazapa/root,gganis/root,esakellari/root,sbinet/cxx-root,nilqed/root,lgiommi/root,abhinavmoudgil95/root,olifre/root,evgeny-boger/root,omazapa/root,Dr15Jones/root,gganis/root,sirinath/root,cxx-hep/root-cern,mkret2/root,root-mirror/root,BerserkerTroll/root,zzxuanyuan/root,perovic/root,davidlt/root,cxx-hep/root-cern,esakellari/root,sawenzel/root,pspe/root,dfunke/root,root-mirror/root,gbitzes/root,arch1tect0r/root,esakellari/root,pspe/root,pspe/root,zzxuanyuan/root-compressor-dummy,Duraznos/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,jrtomps/root,simonpf/root,davidlt/root,evgeny-boger/root,georgtroska/root,gganis/root,0x0all/ROOT,gganis/root,dfunke/root,root-mirror/root,mkret2/root,cxx-hep/root-cern,georgtroska/root,nilqed/root,arch1tect0r/root,evgeny-boger/root,sbinet/cxx-root,omazapa/root,sirinath/root,gbitzes/root,gbitzes/root,georgtroska/root,Y--/root,olifre/root,zzxuanyuan/root-compressor-dummy,veprbl/root,root-mirror/root,tc3t/qoot,davidlt/root,karies/root,sbinet/cxx-root,satyarth934/root,beniz/root,esakellari/root,Duraznos/root,BerserkerTroll/root,perovic/root,arch1tect0r/root,arch1tect0r/root,evgeny-boger/root,dfunke/root,0x0all/ROOT,smarinac/root,pspe/root,sbinet/cxx-root,CristinaCristescu/root,krafczyk/root,jrtomps/root,bbockelm/root,agarciamontoro/root,gbitzes/root,Y--/root,davidlt/root,Duraznos/root,sirinath/root,sawenzel/root,mhuwiler/rootauto,simonpf/root,lgiommi/root,buuck/root,mattkretz/root,tc3t/qoot,vukasinmilosevic/root,Dr15Jones/root,BerserkerTroll/root,lgiommi/root,alexschlueter/cern-root,Y--/root,dfunke/root,BerserkerTroll/root,dfunke/root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,omazapa/root-old,Y--/root,smarinac/root,nilqed/root,mattkretz/root,abhinavmoudgil95/root,CristinaCristescu/root,abhinavmoudgil95/root,pspe/root,buuck/root,georgtroska/root,jrtomps/root,lgiommi/root,mkret2/root,thomaskeck/root,ffurano/root5,olifre/root,tc3t/qoot,mattkretz/root,davidlt/root,0x0all/ROOT,esakellari/my_root_for_test,veprbl/root,davidlt/root,vukasinmilosevic/root,0x0all/ROOT,thomaskeck/root,smarinac/root,dfunke/root,krafczyk/root,mhuwiler/rootauto,zzxuanyuan/root,simonpf/root,BerserkerTroll/root,mkret2/root,nilqed/root,olifre/root,Dr15Jones/root,thomaskeck/root,veprbl/root,evgeny-boger/root,thomaskeck/root,abhinavmoudgil95/root,pspe/root,arch1tect0r/root,esakellari/my_root_for_test,CristinaCristescu/root,root-mirror/root,karies/root,Y--/root,esakellari/root,agarciamontoro/root,sbinet/cxx-root,Duraznos/root,sirinath/root,alexschlueter/cern-root,bbockelm/root,nilqed/root,smarinac/root,karies/root,omazapa/root,vukasinmilosevic/root,omazapa/root-old,esakellari/my_root_for_test,root-mirror/root,pspe/root,gganis/root,krafczyk/root,omazapa/root-old,thomaskeck/root,karies/root,gbitzes/root,mattkretz/root,sirinath/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,BerserkerTroll/root,olifre/root,bbockelm/root,dfunke/root,simonpf/root,CristinaCristescu/root,omazapa/root-old,CristinaCristescu/root,omazapa/root-old,pspe/root,CristinaCristescu/root,arch1tect0r/root,abhinavmoudgil95/root,esakellari/root,buuck/root,sirinath/root,satyarth934/root,0x0all/ROOT,zzxuanyuan/root,veprbl/root,lgiommi/root,krafczyk/root,tc3t/qoot,jrtomps/root,0x0all/ROOT,mhuwiler/rootauto,satyarth934/root,evgeny-boger/root,BerserkerTroll/root,cxx-hep/root-cern,zzxuanyuan/root,jrtomps/root,tc3t/qoot,BerserkerTroll/root,omazapa/root,satyarth934/root,agarciamontoro/root,jrtomps/root,gbitzes/root,zzxuanyuan/root,mhuwiler/rootauto,esakellari/root,agarciamontoro/root,veprbl/root,zzxuanyuan/root,olifre/root,vukasinmilosevic/root,bbockelm/root,sbinet/cxx-root,karies/root,sawenzel/root,esakellari/my_root_for_test,Y--/root,jrtomps/root,mkret2/root,Y--/root,smarinac/root,abhinavmoudgil95/root,mattkretz/root,sirinath/root,davidlt/root,sirinath/root,simonpf/root,davidlt/root,sawenzel/root,strykejern/TTreeReader,0x0all/ROOT,perovic/root,jrtomps/root,sawenzel/root,mattkretz/root,gbitzes/root,buuck/root,beniz/root,veprbl/root,agarciamontoro/root,alexschlueter/cern-root,cxx-hep/root-cern,Duraznos/root,mkret2/root,zzxuanyuan/root,tc3t/qoot,nilqed/root,gganis/root,mhuwiler/rootauto,Dr15Jones/root,esakellari/root,veprbl/root,root-mirror/root,sawenzel/root,satyarth934/root,strykejern/TTreeReader,gbitzes/root,alexschlueter/cern-root,vukasinmilosevic/root,cxx-hep/root-cern,pspe/root,satyarth934/root,bbockelm/root,sbinet/cxx-root,ffurano/root5,BerserkerTroll/root,esakellari/my_root_for_test,pspe/root,nilqed/root,beniz/root,omazapa/root,gganis/root,satyarth934/root,strykejern/TTreeReader,Dr15Jones/root,gganis/root,strykejern/TTreeReader,georgtroska/root,gganis/root,perovic/root,mhuwiler/rootauto,buuck/root,cxx-hep/root-cern,karies/root,karies/root,sawenzel/root,kirbyherm/root-r-tools,davidlt/root,georgtroska/root,agarciamontoro/root,beniz/root,dfunke/root,simonpf/root,buuck/root,sbinet/cxx-root,bbockelm/root,evgeny-boger/root,alexschlueter/cern-root,satyarth934/root,vukasinmilosevic/root,arch1tect0r/root,sawenzel/root,jrtomps/root,CristinaCristescu/root,ffurano/root5,omazapa/root,0x0all/ROOT,georgtroska/root,dfunke/root,satyarth934/root,ffurano/root5,mhuwiler/rootauto,kirbyherm/root-r-tools,krafczyk/root,esakellari/root,bbockelm/root,cxx-hep/root-cern,evgeny-boger/root,mkret2/root,karies/root,georgtroska/root,beniz/root,smarinac/root,evgeny-boger/root,sirinath/root,mkret2/root,esakellari/my_root_for_test,arch1tect0r/root,mattkretz/root,perovic/root,lgiommi/root,simonpf/root,kirbyherm/root-r-tools,lgiommi/root,georgtroska/root,esakellari/my_root_for_test,alexschlueter/cern-root,beniz/root,abhinavmoudgil95/root,zzxuanyuan/root,omazapa/root-old,veprbl/root,zzxuanyuan/root,omazapa/root-old,sawenzel/root,olifre/root,omazapa/root-old,georgtroska/root,perovic/root,simonpf/root,root-mirror/root,agarciamontoro/root,vukasinmilosevic/root,nilqed/root,esakellari/my_root_for_test,Dr15Jones/root,perovic/root,mhuwiler/rootauto,mkret2/root,buuck/root,smarinac/root,nilqed/root,olifre/root,karies/root,veprbl/root,arch1tect0r/root,mattkretz/root,satyarth934/root,lgiommi/root,simonpf/root,olifre/root,davidlt/root,esakellari/my_root_for_test,tc3t/qoot,gbitzes/root,root-mirror/root,gganis/root,omazapa/root,beniz/root,vukasinmilosevic/root,omazapa/root,esakellari/root,georgtroska/root,vukasinmilosevic/root,abhinavmoudgil95/root,nilqed/root,Duraznos/root,sbinet/cxx-root,Y--/root,zzxuanyuan/root,karies/root,beniz/root,BerserkerTroll/root,Duraznos/root,thomaskeck/root,zzxuanyuan/root,krafczyk/root,buuck/root,esakellari/my_root_for_test,beniz/root,thomaskeck/root,abhinavmoudgil95/root,tc3t/qoot,sirinath/root,sbinet/cxx-root,beniz/root,omazapa/root-old,mhuwiler/rootauto,jrtomps/root,omazapa/root,nilqed/root,kirbyherm/root-r-tools,root-mirror/root,omazapa/root,zzxuanyuan/root,Y--/root,bbockelm/root,agarciamontoro/root,0x0all/ROOT,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,lgiommi/root,lgiommi/root,sbinet/cxx-root,dfunke/root,agarciamontoro/root,root-mirror/root,tc3t/qoot,krafczyk/root,BerserkerTroll/root,vukasinmilosevic/root,smarinac/root,Y--/root,kirbyherm/root-r-tools,pspe/root,olifre/root,alexschlueter/cern-root,Dr15Jones/root,ffurano/root5,dfunke/root,Duraznos/root,strykejern/TTreeReader,sawenzel/root,mattkretz/root,omazapa/root-old |
6c72b3e07b950bfc1a7d129cf80ef2ae06ce9fa2 | test/test_all.c | test/test_all.c | #include <CuTest.h>
#include <stdio.h>
#include <util.h>
CuSuite* StrUtilGetSuite();
CuSuite* make_regex_suite();
CuSuite* make_csv_suite();
void RunAllTests(void)
{
CuString *output = CuStringNew();
CuSuite* suite = CuSuiteNew();
CuSuiteAddSuite(suite, StrUtilGetSuite());
CuSuiteAddSuite(suite, make_regex_suite());
CuSuiteAddSuite(suite, make_csv_suite());
CuSuiteRun(suite);
CuSuiteSummary(suite, output);
CuSuiteDetails(suite, output);
printf("%s\n", output->buffer);
}
int main(void)
{
out_fd = stdout; /*For Logging*/
RunAllTests();
}
| #include <CuTest.h>
#include <stdio.h>
#include <util.h>
CuSuite* StrUtilGetSuite();
CuSuite* make_regex_suite();
CuSuite* make_csv_suite();
void RunAllTests(void)
{
CuString *output = CuStringNew();
CuSuite* suite = CuSuiteNew();
#if 1
CuSuiteAddSuite(suite, StrUtilGetSuite());
CuSuiteAddSuite(suite, make_regex_suite());
CuSuiteAddSuite(suite, make_csv_suite());
#endif
CuSuiteRun(suite);
CuSuiteSummary(suite, output);
CuSuiteDetails(suite, output);
printf("%s\n", output->buffer);
}
int main(void)
{
out_fd = stdout; /*For Logging*/
RunAllTests();
}
| Add possibility to disable tests. | Add possibility to disable tests.
| C | apache-2.0 | Moddus/mpi_search,Moddus/mpi_search,Moddus/mpi_search,Moddus/mpi_search |
0f2284c7545819484849b2afb39fa34dd2730545 | tests/integration_tests.c | tests/integration_tests.c | #include "unity.h"
#include <math.h>
#include <stdlib.h>
#include "quac.h"
#include "operators.h"
#include "solver.h"
#include "dm_utilities.h"
#include "quantum_gates.h"
#include "petsc.h"
#include "tests.h"
void test_timedep(void)
{
double *populations;
int num_pop;
/* Initialize QuaC */
timedep_test(&populations,&num_pop);
/* These values assume TSRK3BS */
TEST_ASSERT_EQUAL_FLOAT(populations[0],-1.487990e-04);
TEST_ASSERT_EQUAL_FLOAT(populations[1],1.799424e-04);
}
int main(int argc, char** argv)
{
UNITY_BEGIN();
QuaC_initialize(argc,argv);
RUN_TEST(test_timedep);
QuaC_finalize();
return UNITY_END();
}
| #include "unity.h"
#include <math.h>
#include <stdlib.h>
#include "quac.h"
#include "operators.h"
#include "solver.h"
#include "dm_utilities.h"
#include "quantum_gates.h"
#include "petsc.h"
#include "tests.h"
void test_timedep(void)
{
double *populations;
int num_pop;
/* Initialize QuaC */
timedep_test(&populations,&num_pop);
/* These values assume TSRK3BS */
/* TEST_ASSERT_EQUAL_FLOAT(0.0,populations[0]); */
/* TEST_ASSERT_EQUAL_FLOAT(0.0,populations[1]); */
}
int main(int argc, char** argv)
{
UNITY_BEGIN();
QuaC_initialize(argc,argv);
RUN_TEST(test_timedep);
QuaC_finalize();
return UNITY_END();
}
| Remove time_dep test for now - it is too dependent on exact conditions. | Remove time_dep test for now - it is too dependent on exact conditions.
| C | mit | 0tt3r/QuaC,0tt3r/QuaC,0tt3r/QuaC |
e95e9a6f76556afe4f266b0b527e8e4a30459a9c | tests/regression/02-base/66-no-eval-on-write-multi.c | tests/regression/02-base/66-no-eval-on-write-multi.c | //PARAM: --enable ana.int.interval --enable ana.int.enums --exp.privatization "write"
#include<pthread.h>
// Test case that shows how avoiding reading integral globals can reduce the number of solver evaluations.
// Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 20 in this test case.
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
int glob = 10;
void* t_fun(void* ptr) {
pthread_mutex_lock(&mutex);
glob = 3;
glob = 4;
glob = 1;
pthread_mutex_unlock(&mutex);
return NULL;
}
void bar() {
glob = 2;
}
int main() {
pthread_t t;
pthread_create(&t, NULL, t_fun, NULL);
pthread_mutex_lock(&mutex);
bar();
pthread_mutex_unlock(&mutex);
pthread_join(t, NULL);
assert(glob >= 1);
assert(glob <= 2);
return 0;
}
| //PARAM: --enable ana.int.interval --enable ana.int.enums --exp.privatization "write"
#include<pthread.h>
// Test case that shows how avoiding reading integral globals can reduce the number of solver evaluations.
// Avoiding to evaluate integral globals when setting them reduced the number of necessary evaluations from 62 to 20 in this test case.
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
int glob = 10;
void* t_fun(void* ptr) {
pthread_mutex_lock(&mutex);
glob = 3;
glob = 4;
glob = 1;
pthread_mutex_unlock(&mutex);
return NULL;
}
void bar() {
glob = 2;
}
int main() {
pthread_t t;
pthread_create(&t, NULL, t_fun, NULL);
pthread_mutex_lock(&mutex);
bar();
pthread_mutex_unlock(&mutex);
pthread_join(t, NULL);
assert(glob >= 1);
assert(glob <= 2); //UNKNOWN
assert(glob <= 10);
return 0;
}
| Fix test case to not fail due to imprecison of analysis | Fix test case to not fail due to imprecison of analysis
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
3f61a44c965c1acf6623b9e8502f077c5c997404 | resource/c_common/windows/include/memmem.h | resource/c_common/windows/include/memmem.h | /* *****************************************************************
*
* Copyright 2017 Microsoft
*
*
* 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 MEMMEM_H__
#define MEMMEM_H__
#ifdef __cplusplus
extern "C" {
#endif
void *memmem(const void *haystack, size_t haystackLen, const void *needle, size_t needleLen);
#ifdef __cplusplus
}
#endif
#endif
| /* *****************************************************************
*
* Copyright 2017 Microsoft
*
*
* 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 MEMMEM_H__
#define MEMMEM_H__
// crtdefs.h is required for size_t
#include <crtdefs.h>
#ifdef __cplusplus
extern "C" {
#endif
void *memmem(const void *haystack, size_t haystackLen, const void *needle, size_t needleLen);
#ifdef __cplusplus
}
#endif
#endif
| Fix a build break on Windows X86. | Fix a build break on Windows X86.
The newly added memmem function uses size_t in the function
definition. However size_t is not defined at the time memmem.h
is included. Adding crtdefs.h into memmem.h to fix.
Change-Id: I7a474e7befbf3bdc5dd8aa0bd4ca45d6bfa28d71
Signed-off-by: Mike Fenelon <[email protected]>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16359
Reviewed-by: Dan Mihai <[email protected]>
Reviewed-by: Phil Coval <[email protected]>
Tested-by: jenkins-iotivity <[email protected]>
Reviewed-by: Dave Thaler <[email protected]>
| C | apache-2.0 | iotivity/iotivity,iotivity/iotivity,iotivity/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity |
7686f1b38b13a660ac14b799c62f453fa012b4d7 | avahi-gobject/ga-error.h | avahi-gobject/ga-error.h | /*
* ga-error.h - Header for Avahi error types
* Copyright (C) 2005 Collabora Ltd.
* Copyright (C) 2005 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __GA_ERROR_H__
#define __GA_ERROR_H__
#include <glib-object.h>
G_BEGIN_DECLS
#include <avahi-common/error.h>
GQuark ga_error_quark(void);
#define GA_ERROR ga_error_quark()
G_END_DECLS
#endif /* #ifndef __GA_ERROR_H__ */
| /*
* ga-error.h - Header for Avahi error types
* Copyright (C) 2005 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __GA_ERROR_H__
#define __GA_ERROR_H__
#include <glib-object.h>
G_BEGIN_DECLS
#include <avahi-common/error.h>
GQuark ga_error_quark(void);
#define GA_ERROR ga_error_quark()
G_END_DECLS
#endif /* #ifndef __GA_ERROR_H__ */
| Remove C Nokia notice that actually remained from the copyright boilerplate | Remove C Nokia notice that actually remained from the copyright boilerplate
git-svn-id: ff687e355030673c307e7da231f59639d58f56d5@1671 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
| C | lgpl-2.1 | lathiat/avahi,heftig/avahi,sunilghai/avahi-clone,Kisensum/xmDNS-avahi,gloryleague/avahi,heftig/avahi-1,Kisensum/xmDNS-avahi,heftig/avahi-1,everbase/catta,heftig/avahi,heftig/avahi,heftig/avahi,everbase/catta,gloryleague/avahi,Distrotech/avahi,lathiat/avahi,heftig/avahi-1,lathiat/avahi,lathiat/avahi,Distrotech/avahi,Distrotech/avahi,Distrotech/avahi,heftig/avahi-1,gloryleague/avahi,gloryleague/avahi,catta-x/catta,everbase/catta,lathiat/avahi,catta-x/catta,Kisensum/xmDNS-avahi,heftig/avahi,sunilghai/avahi-clone,sunilghai/avahi-clone,Distrotech/avahi,heftig/avahi-1,lathiat/avahi,heftig/avahi-1,Distrotech/avahi,sunilghai/avahi-clone,Kisensum/xmDNS-avahi,Kisensum/xmDNS-avahi,gloryleague/avahi,sunilghai/avahi-clone,heftig/avahi,sunilghai/avahi-clone,gloryleague/avahi,Kisensum/xmDNS-avahi,catta-x/catta |
fe70dac3a7a7e34b66fcfc5ef0c6844d37a594ed | include/tasks/clock_server.h | include/tasks/clock_server.h |
#ifndef __CLOCK_SERVER_H__
#define __CLOCK_SERVER_H__
#include <std.h>
#include <scheduler.h>
extern int clock_server_tid;
typedef enum {
CLOCK_NOTIFY = 1,
CLOCK_DELAY = 2,
CLOCK_TIME = 3,
CLOCK_DELAY_UNTIL = 4
} clock_req_type;
typedef struct {
clock_req_type type;
uint ticks;
} clock_req;
void clock_server(void);
#endif
|
#ifndef __CLOCK_SERVER_H__
#define __CLOCK_SERVER_H__
#include <std.h>
#include <scheduler.h>
extern int clock_server_tid;
typedef enum {
CLOCK_NOTIFY = 1,
CLOCK_DELAY = 2,
CLOCK_TIME = 3,
CLOCK_DELAY_UNTIL = 4
} clock_req_type;
typedef struct {
clock_req_type type;
uint ticks;
} clock_req;
void __attribute__ ((noreturn)) clock_server(void);
#endif
| Fix warning given by Clang | Fix warning given by Clang | C | mit | ferrous26/cs452-flaming-meme,ferrous26/cs452-flaming-meme,ferrous26/cs452-flaming-meme |
3a321900d4205ba7819fdc421a1efa3c8724d6b0 | Opcodes/ftest.c | Opcodes/ftest.c | #include "csdl.h"
#include <math.h>
void tanhtable(FUNC *ftp, FGDATA *ff)
{
MYFLT *fp = ftp->ftable;
MYFLT range = ff->e.p[5];
double step = (double)range/(ff->e.p[3]);
int i;
double x;
for (i=0, x=FL(0.0); i<ff->e.p[3]; i++, x+=step)
*fp++ = (MYFLT)tanh(x);
}
static void gentune(FUNC *ftp, FGDATA *ff) /* Gab 1/3/2005 */
{
int j;
int notenum;
int grade;
int numgrades;
int basekeymidi;
MYFLT basefreq, factor,interval;
MYFLT *fp = ftp->ftable, *pp = &(ff->e.p[5]);
int nvals = ff->e.pcnt - 4;
numgrades = (int) *pp++;
interval = *pp++;
basefreq = *pp++;
basekeymidi= (int) *pp++;
nvals = ff->flenp1 - 1;
for (j =0; j < nvals; j++) {
notenum = j;
if (notenum < basekeymidi) {
notenum = basekeymidi - notenum;
grade = (numgrades-(notenum % numgrades)) % numgrades;
factor = - (MYFLT)(int) ((notenum+numgrades-1) / numgrades) ;
}
else {
notenum = notenum - basekeymidi;
grade = notenum % numgrades;
factor = (MYFLT)(int) (notenum / numgrades);
}
factor = (MYFLT)pow((double)interval, (double)factor);
fp[j] = pp[grade] * factor * basefreq;
}
}
static NGFENS localfgens[] = {
{ "tanh", (void(*)(void))tanhtable},
{ "cpstune", (void(*)(void))gentune},
{ NULL, NULL}
};
#define S sizeof
static OENTRY localops[] = {};
FLINKAGE
| #include "csdl.h"
#include <math.h>
void tanhtable(FUNC *ftp, FGDATA *ff)
{
MYFLT *fp = ftp->ftable;
MYFLT range = ff->e.p[5];
double step = (double)range/(ff->e.p[3]);
int i;
double x;
for (i=0, x=FL(0.0); i<ff->e.p[3]; i++, x+=step)
*fp++ = (MYFLT)tanh(x);
}
static NGFENS localfgens[] = {
{ "tanh", (void(*)(void))tanhtable},
{ NULL, NULL}
};
#define S sizeof
static OENTRY localops[] = {};
FLINKAGE
| Remove gen from loadable code | Remove gen from loadable code
| C | lgpl-2.1 | audiokit/csound,nikhilsinghmus/csound,mcanthony/csound,audiokit/csound,nikhilsinghmus/csound,audiokit/csound,max-ilse/csound,audiokit/csound,audiokit/csound,audiokit/csound,audiokit/csound,nikhilsinghmus/csound,mcanthony/csound,nikhilsinghmus/csound,Angeldude/csound,max-ilse/csound,nikhilsinghmus/csound,Angeldude/csound,nikhilsinghmus/csound,Angeldude/csound,max-ilse/csound,nikhilsinghmus/csound,mcanthony/csound,Angeldude/csound,iver56/csound,nikhilsinghmus/csound,iver56/csound,iver56/csound,iver56/csound,max-ilse/csound,Angeldude/csound,mcanthony/csound,nikhilsinghmus/csound,mcanthony/csound,max-ilse/csound,iver56/csound,max-ilse/csound,iver56/csound,audiokit/csound,mcanthony/csound,Angeldude/csound,Angeldude/csound,iver56/csound,mcanthony/csound,mcanthony/csound,audiokit/csound,iver56/csound,Angeldude/csound,Angeldude/csound,mcanthony/csound,iver56/csound,audiokit/csound,max-ilse/csound,mcanthony/csound,max-ilse/csound,nikhilsinghmus/csound,max-ilse/csound,iver56/csound,Angeldude/csound,max-ilse/csound |
7b85805e58926dda017903ac9f6dff657279436d | bugs/gcc-vs-clang-struct-decl.c | bugs/gcc-vs-clang-struct-decl.c | struct A
{
int i;
};
int main(void)
{
struct B
{
struct A;
struct A a;
};
struct B b;
b.a.i = 3;
return b.a.i;
}
| Add struct declaration bug - GCC mismatch with Clang | Add struct declaration bug - GCC mismatch with Clang
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
|
de8e4435d61cd4b5e23e80f53fc33bc00dcef1d4 | test/Headers/tgmath.c | test/Headers/tgmath.c | // RUN: %clang -fsyntax-only %s
#ifdef __STDC_HOSTED__
#include <tgmath.h>
float f;
double d;
long double l;
float complex fc;
double complex dc;
long double complex lc;
// creal
_Static_assert(sizeof(creal(f)) == sizeof(f), "");
_Static_assert(sizeof(creal(d)) == sizeof(d), "");
_Static_assert(sizeof(creal(l)) == sizeof(l), "");
_Static_assert(sizeof(creal(fc)) == sizeof(f), "");
_Static_assert(sizeof(creal(dc)) == sizeof(d), "");
_Static_assert(sizeof(creal(lc)) == sizeof(l), "");
// fabs
_Static_assert(sizeof(fabs(f)) == sizeof(f), "");
_Static_assert(sizeof(fabs(d)) == sizeof(d), "");
_Static_assert(sizeof(fabs(l)) == sizeof(l), "");
_Static_assert(sizeof(fabs(fc)) == sizeof(f), "");
_Static_assert(sizeof(fabs(dc)) == sizeof(d), "");
_Static_assert(sizeof(fabs(lc)) == sizeof(l), "");
// logb
_Static_assert(sizeof(logb(f)) == sizeof(f), "");
_Static_assert(sizeof(logb(d)) == sizeof(d), "");
_Static_assert(sizeof(logb(l)) == sizeof(l), "");
#endif
| Add testcase missed from r181527. | Add testcase missed from r181527.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@181531 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
|
c493ec3cd5cc9f0b662ebdbcf40a9d8ffddff2f3 | Code/Network/Network.h | Code/Network/Network.h | //
// Network.h
// RestKit
//
// Created by Blake Watters on 9/30/10.
// Copyright 2010 Two Toasters
//
// 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 "RKClient.h"
#import "RKURL.h"
#import "RKRequest.h"
#import "RKResponse.h"
#import "RKRequestSerializable.h"
#import "RKReachabilityObserver.h"
#import "RKRequestQueue.h"
#import "RKNotifications.h"
#import "RKClientOAuth.h"
| //
// Network.h
// RestKit
//
// Created by Blake Watters on 9/30/10.
// Copyright 2010 Two Toasters
//
// 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 "RKClient.h"
#import "RKURL.h"
#import "RKRequest.h"
#import "RKResponse.h"
#import "RKRequestSerializable.h"
#import "RKReachabilityObserver.h"
#import "RKRequestQueue.h"
#import "RKNotifications.h"
#import "RKOAuthClient.h"
| Fix for missing rename on OAuth client | Fix for missing rename on OAuth client
| C | apache-2.0 | vilinskiy-playdayteam/RestKit,Gaantz/RestKit,sachin-khard/NucRestKit,DejaMi/RestKit,lmirosevic/RestKit,PonderProducts/RestKit,jrtaal/RestKit,thomaschristensen/RestKit,jonesgithub/RestKit,qingsong-xu/RestKit,DocuSignDev/RestKit,moritzh/RestKit,gauravstomar/RestKit,HarrisLee/RestKit,kevmeyer/RestKit,dx285/RestKit,mberube09/RestKit,REXLabsInc/RestKit,HYPERHYPER/RestKit2,samanalysis/RestKit,DejaMi/RestKit,zhenlove/RestKit,money-alex2006hw/RestKit,REXLabsInc/RestKit,loverbabyz/RestKit,RyanCodes/RestKit,QLGu/RestKit,QLGu/RestKit,Papercloud/RestKit,baumatron/RestKit,paperlesspost/RestKit,aleufms/RestKit,pat2man/RestKit,timbodeit/RestKit,HYPERHYPER/RestKit2,fedegasp/RestKit,paperlesspost/RestKit,mikarun/RestKit,samanalysis/RestKit,Flutterbee/RestKit,Meihualu/RestKit,hanangellove/RestKit,loverbabyz/RestKit,wireitcollege/RestKit,sachin-khard/NucleusRestKit,fhchina/RestKit,imton/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,sachin-khard/NucleusRestKit,Meihualu/RestKit,DocuSignDev/RestKit,apontador/RestKit,pbogdanv/RestKit,jonesgithub/RestKit,wuxsoft/RestKit,nalindz/pulpfiction-RestKit,forcedotcom/RestKit,gauravstomar/RestKit,damiannz/RestKit,pat2man/RestKit,QLGu/RestKit,StasanTelnov/RestKit,djz-code/RestKit,hejunbinlan/RestKit,orta/RestKit,mumer92/RestKit,thomaschristensen/RestKit,orta/RestKit,braindata/RestKit,zaichang/RestKit,hanangellove/RestKit,zilaiyedaren/RestKit,LiuShulong/RestKit,cfis/RestKit,agworld/RestKit,pat2man/RestKit,moneytree/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,paperlesspost/RestKit,justinyaoqi/RestKit,Flutterbee/RestKit,zaichang/RestKit,fhchina/RestKit,money-alex2006hw/RestKit,Juraldinio/RestKit,wangjiangwen/RestKit,percysnoodle/RestKit,Juraldinio/RestKit,Livestream/RestKit,common2015/RestKit,qingsong-xu/RestKit,braindata/RestKit-1,jrtaal/RestKit,oligriffiths/RestKit,djz-code/RestKit,concreteinteractive/RestKit,zjh171/RestKit,Bogon/RestKit,Papercloud/RestKit,zjh171/RestKit,QLGu/RestKit,CodewareTechnology/RestKit,nett55/RestKit,ForrestAlfred/RestKit,oye-lionel/GithubTest,sachin-khard/NucRestKit,mavericksunny/RestKit,jonesgithub/RestKit,RestKit/RestKit,ppierson/RestKit,wireitcollege/RestKit,common2015/RestKit,apontador/RestKit,wangjiangwen/RestKit,agworld/RestKit,forcedotcom/RestKit,kevmeyer/RestKit,samanalysis/RestKit,Livestream/RestKit,sandyway/RestKit,ChinaPicture/RestKit,fhchina/RestKit,Bogon/RestKit,sandyway/RestKit,REXLabsInc/RestKit,wangjiangwen/RestKit,nalindz/pulpfiction-RestKit,adozenlines/RestKit,naqi/RestKit,timbodeit/RestKit,SinnerSchraderMobileMirrors/RestKit,nphkh/RestKit,baumatron/RestKit,hanangellove/RestKit,TheFarm/RestKit,mumer92/RestKit,imton/RestKit,PonderProducts/RestKit,imton/RestKit,oye-lionel/GithubTest,lucasecf/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,moneytree/RestKit,moritzh/RestKit,antondarki/RestKit,0dayZh/RestKit,mavericksunny/RestKit,fedegasp/RestKit,gank0326/restkit,goldstar/RestKit,Flutterbee/RestKit,ChinaPicture/RestKit,Meihualu/RestKit,concreteinteractive/RestKit,agworld/RestKit,Livestream/RestKit,ipmobiletech/RestKit,HYPERHYPER/RestKit2,hejunbinlan/RestKit,samkrishna/RestKit,money-alex2006hw/RestKit,StasanTelnov/RestKit,dx285/RestKit,timbodeit/RestKit,0dayZh/RestKit,mikarun/RestKit,HarrisLee/RestKit,oye-lionel/GithubTest,zhenlove/RestKit,wireitcollege/RestKit,hejunbinlan/RestKit,erichedstrom/RestKit,concreteinteractive/RestKit,0x73/RestKit,0x73/RestKit,braindata/RestKit-1,Papercloud/RestKit,braindata/RestKit-1,sachin-khard/NucRestKit,qingsong-xu/RestKit,naqi/RestKit,ipmobiletech/RestKit,wyzzarz/RestKit,coderChrisLee/RestKit,percysnoodle/RestKit,zjh171/RestKit,braindata/RestKit,Bogon/RestKit,ipmobiletech/RestKit,Papercloud/RestKit,Juraldinio/RestKit,concreteinteractive/RestKit,braindata/RestKit-1,damiannz/RestKit,gank0326/restkit,LiuShulong/RestKit,mikarun/RestKit,cryptojuice/RestKit,lmirosevic/RestKit,zhenlove/RestKit,RyanCodes/RestKit,justinyaoqi/RestKit,StasanTelnov/RestKit,naqi/RestKit,sachin-khard/NucleusRestKit,zilaiyedaren/RestKit,pat2man/RestKit,adozenlines/RestKit,timbodeit/RestKit,caamorales/RestKit,nett55/RestKit,loverbabyz/RestKit,mcfedr/RestKit,wireitcollege/RestKit,nett55/RestKit,zhenlove/RestKit,adozenlines/RestKit,apontador/RestKit,mberube09/RestKit,HarrisLee/RestKit,CenterDevice/RestKit,caamorales/RestKit,goldstar/RestKit,oligriffiths/RestKit,youssman/RestKit,agworld/RestKit,vilinskiy-playdayteam/RestKit,baumatron/RestKit,nphkh/RestKit,wuxsoft/RestKit,RyanCodes/RestKit,percysnoodle/RestKit,timbodeit/RestKit,loverbabyz/RestKit,antondarki/RestKit,samkrishna/RestKit,justinyaoqi/RestKit,apontador/RestKit,taptaptap/RestKit,SuPair/RestKit,ForrestAlfred/RestKit,DejaMi/RestKit,samanalysis/RestKit,sandyway/RestKit,SuPair/RestKit,Meihualu/RestKit,moritzh/RestKit,ForrestAlfred/RestKit,CodewareTechnology/RestKit,coderChrisLee/RestKit,ppierson/RestKit,DejaMi/RestKit,samkrishna/RestKit,braindata/RestKit,zjh171/RestKit,caamorales/RestKit,TimeIncOSS/RestKit,ChinaPicture/RestKit,ppierson/RestKit,mumer92/RestKit,jonesgithub/RestKit,samanalysis/RestKit,qingsong-xu/RestKit,DocuSignDev/RestKit,gauravstomar/RestKit,money-alex2006hw/RestKit,DejaMi/RestKit,Flutterbee/RestKit,taptaptap/RestKit,youssman/RestKit,pbogdanv/RestKit,kevmeyer/RestKit,djz-code/RestKit,LiuShulong/RestKit,coderChrisLee/RestKit,pbogdanv/RestKit,kevmeyer/RestKit,concreteinteractive/RestKit,oligriffiths/RestKit,taptaptap/RestKit,wuxsoft/RestKit,dx285/RestKit,ipmobiletech/RestKit,cnbin/RestKit,SinnerSchraderMobileMirrors/RestKit,jrtaal/RestKit,adozenlines/RestKit,Gaantz/RestKit,zilaiyedaren/RestKit,thomaschristensen/RestKit,CenterDevice/RestKit,pat2man/RestKit,hanangellove/RestKit,caamorales/RestKit,lucasecf/RestKit,hejunbinlan/RestKit,cryptojuice/RestKit,zilaiyedaren/RestKit,youssman/RestKit,ppierson/RestKit,dx285/RestKit,cryptojuice/RestKit,lucasecf/RestKit,PonderProducts/RestKit,ppierson/RestKit,cnbin/RestKit,HarrisLee/RestKit,forcedotcom/RestKit,0x73/RestKit,loverbabyz/RestKit,gank0326/restkit,antondarki/RestKit,lucasecf/RestKit,moneytree/RestKit,antondarki/RestKit,mumer92/RestKit,zaichang/RestKit,TheFarm/RestKit,canaydogan/RestKit,vilinskiy-playdayteam/RestKit,taptaptap/RestKit,TimeIncOSS/RestKit,nphkh/RestKit,mavericksunny/RestKit,Bogon/RestKit,PonderProducts/RestKit,gank0326/restkit,fedegasp/RestKit,margarina/RestKit-latest,oligriffiths/RestKit,SuPair/RestKit,REXLabsInc/RestKit,margarina/RestKit-latest,CenterDevice/RestKit,cnbin/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,hanangellove/RestKit,mikarun/RestKit,sandyway/RestKit,gauravstomar/RestKit,LiuShulong/RestKit,coderChrisLee/RestKit,adozenlines/RestKit,moneytree/RestKit,jrtaal/RestKit,forcedotcom/RestKit,CodewareTechnology/RestKit,mavericksunny/RestKit,nalindz/pulpfiction-RestKit,sachin-khard/NucRestKit,RyanCodes/RestKit,jrtaal/RestKit,zjh171/RestKit,oye-lionel/GithubTest,canaydogan/RestKit,sachin-khard/NucleusRestKit,sachin-khard/NucleusRestKit,canaydogan/RestKit,mikarun/RestKit,cfis/RestKit,nett55/RestKit,sandyway/RestKit,ipmobiletech/RestKit,nphkh/RestKit,braindata/RestKit,zaichang/RestKit,wyzzarz/RestKit,vilinskiy-playdayteam/RestKit,dx285/RestKit,gauravstomar/RestKit,nalindz/pulpfiction-RestKit,Gaantz/RestKit,ForrestAlfred/RestKit,wyzzarz/RestKit,goldstar/RestKit,lmirosevic/RestKit,ForrestAlfred/RestKit,pbogdanv/RestKit,Gaantz/RestKit,0dayZh/RestKit,sachin-khard/NucRestKit,CodewareTechnology/RestKit,erichedstrom/RestKit,percysnoodle/RestKit,LiuShulong/RestKit,canaydogan/RestKit,Meihualu/RestKit,common2015/RestKit,RyanCodes/RestKit,oligriffiths/RestKit,baumatron/RestKit,mberube09/RestKit,youssman/RestKit,cfis/RestKit,youssman/RestKit,RestKit/RestKit,cnbin/RestKit,pbogdanv/RestKit,fedegasp/RestKit,aleufms/RestKit,cnbin/RestKit,zhenlove/RestKit,cryptojuice/RestKit,ChinaPicture/RestKit,Juraldinio/RestKit,damiannz/RestKit,CodewareTechnology/RestKit,mberube09/RestKit,antondarki/RestKit,erichedstrom/RestKit,mumer92/RestKit,aleufms/RestKit,ChinaPicture/RestKit,caamorales/RestKit,fhchina/RestKit,QLGu/RestKit,zilaiyedaren/RestKit,money-alex2006hw/RestKit,lucasecf/RestKit,TwinEngineLabs-Engineering/RestKit-TEL,wyzzarz/RestKit,Papercloud/RestKit,aleufms/RestKit,coderChrisLee/RestKit,lmirosevic/RestKit,imton/RestKit,naqi/RestKit,common2015/RestKit,0dayZh/RestKit,HYPERHYPER/RestKit2,margarina/RestKit-latest,imton/RestKit,wuxsoft/RestKit,SinnerSchraderMobileMirrors/RestKit,gumdal/RestKit,fedegasp/RestKit,gumdal/RestKit,canaydogan/RestKit,damiannz/RestKit,Livestream/RestKit,wangjiangwen/RestKit,HarrisLee/RestKit,kevmeyer/RestKit,nphkh/RestKit,mcfedr/RestKit,RestKit/RestKit,common2015/RestKit,moneytree/RestKit,qingsong-xu/RestKit,moritzh/RestKit,gank0326/restkit,HYPERHYPER/RestKit2,wireitcollege/RestKit,aleufms/RestKit,jonesgithub/RestKit,oye-lionel/GithubTest,SinnerSchraderMobileMirrors/RestKit,lmirosevic/RestKit,hejunbinlan/RestKit,0x73/RestKit,baumatron/RestKit,fhchina/RestKit,margarina/RestKit-latest,damiannz/RestKit,Gaantz/RestKit,thomaschristensen/RestKit,braindata/RestKit-1,nett55/RestKit,wangjiangwen/RestKit,SuPair/RestKit,SuPair/RestKit,justinyaoqi/RestKit,apontador/RestKit,Bogon/RestKit,djz-code/RestKit,gumdal/RestKit,justinyaoqi/RestKit,wuxsoft/RestKit,moritzh/RestKit,TheFarm/RestKit,Juraldinio/RestKit,TimeIncOSS/RestKit,CenterDevice/RestKit,goldstar/RestKit,cryptojuice/RestKit,0x73/RestKit,paperlesspost/RestKit |
d33166e318318a9bb1e5e3855150d8d8ffe655b0 | thrust/detail/casts.h | thrust/detail/casts.h | /*
* Copyright 2008-2009 NVIDIA Corporation
*
* 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.
*/
/*! \file casts.h
* \brief Unsafe casts for internal use.
*/
#pragma once
#include <thrust/iterator/iterator_traits.h>
namespace thrust
{
namespace detail
{
namespace dispatch
{
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *
raw_pointer_cast(TrivialIterator i,
thrust::random_access_host_iterator_tag)
{
typedef typename thrust::iterator_traits<TrivialIterator>::value_type * Pointer;
// cast away constness
return const_cast<Pointer>(&*i);
} // end raw_pointer_cast()
// this path will work for device_ptr & device_vector::iterator
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *
raw_pointer_cast(TrivialIterator i,
thrust::random_access_device_iterator_tag)
{
typedef typename thrust::iterator_traits<TrivialIterator>::value_type * Pointer;
// cast away constness
return const_cast<Pointer>((&*i).get());
} // end raw_pointer_cast()
} // end dispatch
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *raw_pointer_cast(TrivialIterator i)
{
return detail::dispatch::raw_pointer_cast(i, thrust::iterator_traits<TrivialIterator>::iterator_category());
} // end raw_pointer_cast()
} // end detail
} // end thrust
| Add git r done version of detail::raw_pointer_cast | Add git r done version of detail::raw_pointer_cast
--HG--
extra : convert_revision : svn%3A83215879-3e5a-4751-8c9d-778f44bb06a5/trunk%40150
| C | apache-2.0 | thvasilo/thrust,dachziegel/thrust,dachziegel/thrust,thrust/thrust,marksantos/thrust,jaredhoberock/thrust,zeryx/thrust,sarvex/thrust,xiongzhanblake/thrust,thrust/thrust,zeryx/thrust,arnabgho/thrust,sdalton1/thrust,sdalton1/thrust,arnabgho/thrust,marksantos/thrust,GrimDerp/thrust,andrewcorrigan/thrust-multi-permutation-iterator,sarvex/thrust,xiongzhanblake/thrust,GrimDerp/thrust,Ricardo666666/thrust,jaredhoberock/thrust,raygit/thrust,zhenglaizhang/thrust,thvasilo/thrust,jaredhoberock/thrust,jaredhoberock/thrust,sarvex/thrust,Ricardo666666/thrust,jaredhoberock/thrust,thrust/thrust,xiongzhanblake/thrust_src,zhenglaizhang/thrust,zhenglaizhang/thrust,egaburov/thrust,xiongzhanblake/thrust_src,thrust/thrust,marksantos/thrust,andrewcorrigan/thrust-multi-permutation-iterator,dachziegel/thrust,raygit/thrust,thvasilo/thrust,mohamed-ali/thrust,mohamed-ali/thrust,egaburov/thrust,sdalton1/thrust,thrust/thrust,mohamed-ali/thrust,andrewcorrigan/thrust-multi-permutation-iterator,xiongzhanblake/thrust_src,raygit/thrust,egaburov/thrust,GrimDerp/thrust,xiongzhanblake/thrust,Ricardo666666/thrust,arnabgho/thrust,zeryx/thrust |
|
d14db182365578e79f5f60c5cf1052d5f9a0edef | lib/asan/output_tests/use-after-free.c | lib/asan/output_tests/use-after-free.c | #include <stdlib.h>
int main() {
char *x = (char*)malloc(10 * sizeof(char));
free(x);
return x[5];
}
// CHECK: heap-use-after-free
// CHECKSLEEP: Sleeping for 1 second
// CHECKSTRIP-NOT: #0 0x{{.*}} ({{[/].*}})
| #include <stdlib.h>
int main() {
char *x = (char*)malloc(10 * sizeof(char));
free(x);
return x[5];
}
// CHECK: heap-use-after-free
// CHECK: free
// CHECK: main{{.*}}use-after-free.c:4
// CHECK: malloc
// CHECK: main{{.*}}use-after-free.c:3
// CHECKSLEEP: Sleeping for 1 second
// CHECKSTRIP-NOT: #0 0x{{.*}} ({{[/].*}})
| Check for filenames and numbers to detect possible problems with asan_symbolize.py on -fPIE binaries. | Check for filenames and numbers to detect possible problems with asan_symbolize.py on -fPIE binaries.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@161948 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 |
46c067da604293804aa900f784a0a419ed82b1e2 | IA32ABI/xabicc.c | IA32ABI/xabicc.c | /*
* xabicc.c - platform-agnostic root for ALien call-outs and callbacks.
*
* Support for Call-outs and Call-backs from the IA32ABI Plugin.
* The plgin is misnamed. It should be the AlienPlugin, but its history
* dictates otherwise.
*/
#if i386|i486|i586|i686
# include "ia32abicc.c"
#elif powerpc|ppc
# include "ppcia32abicc.c"
#elif x86_64|x64
# include "x64ia32abicc.o"
#endif
| Add a processor-agnostic file to include the relevant processor-specific callout and callback support for the ALien plugin. | Add a processor-agnostic file to include the relevant processor-specific callout
and callback support for the ALien plugin.
git-svn-id: http://squeakvm.org/svn/squeak/trunk@3227 fa1542d4-bde8-0310-ad64-8ed1123d492a
Former-commit-id: de732c745d80769e5a3541e07042f7ba8c112911 | C | mit | peteruhnak/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,peteruhnak/pharo-vm,timfel/squeakvm,timfel/squeakvm,bencoman/pharo-vm,bencoman/pharo-vm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,OpenSmalltalk/vm,timfel/squeakvm,timfel/squeakvm,peteruhnak/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,OpenSmalltalk/vm,OpenSmalltalk/vm,timfel/squeakvm,peteruhnak/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,peteruhnak/pharo-vm,timfel/squeakvm |
|
e98d0be00b0694bb4480cbc1e2aac77cd1b57cd5 | source/common/hal/version.h | source/common/hal/version.h | /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* 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 VERSION_H
#define VERSION_H
#include "stdint.h"
// built for bootloader 1xxx
//#define FW_BUILD "1203"
// build for bootloader 0xxx
#define FW_BUILD "0226"
void update_html_file(uint8_t *buf, uint32_t bufsize);
uint8_t * get_uid_string (void);
uint8_t get_len_string_interface(void);
uint8_t * get_uid_string_interface(void);
void init_auth_config (void);
void build_mac_string(uint32_t *uuid_data);
#endif
| /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* 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 VERSION_H
#define VERSION_H
#include "stdint.h"
// built for bootloader 1xxx
//#define FW_BUILD "1203"
// build for bootloader 0xxx
#define FW_BUILD "0227"
void update_html_file(uint8_t *buf, uint32_t bufsize);
uint8_t * get_uid_string (void);
uint8_t get_len_string_interface(void);
uint8_t * get_uid_string_interface(void);
void init_auth_config (void);
void build_mac_string(uint32_t *uuid_data);
#endif
| Increment FW_BUILD. Initial release for kl26z_nrf51822_if with CDC support | Increment FW_BUILD. Initial release for kl26z_nrf51822_if with CDC support
| C | apache-2.0 | sg-/DAPLink,google/DAPLink-port,google/DAPLink-port,sg-/DAPLink,google/DAPLink-port,sg-/DAPLink,google/DAPLink-port |
74f48a2f6d0f3589415963b1be8f75e5b6da7525 | 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. 2.0.1 (beta)"
namespace QGC
{
const QString APPNAME = "QGROUNDCONTROL";
const QString ORG_NAME = "QGROUNDCONTROL.ORG"; //can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps
const QString ORG_DOMAIN = "org.qgroundcontrol";//can be customized by forks
const int APPLICATIONVERSION = 201; // 2.0.1
}
#endif // QGC_CONFIGURATION_H
| #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 5
/** @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. 2.0.1 (beta)"
namespace QGC
{
const QString APPNAME = "QGROUNDCONTROL";
const QString ORG_NAME = "QGROUNDCONTROL.ORG"; //can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps
const QString ORG_DOMAIN = "org.qgroundcontrol";//can be customized by forks
const int APPLICATIONVERSION = 201; // 2.0.1
}
#endif // QGC_CONFIGURATION_H
| Read UART faster to prevent buffer overflows | Read UART faster to prevent buffer overflows
| C | agpl-3.0 | josephlewis42/UDenverQGC2,greenoaktree/qgroundcontrol,catch-twenty-two/qgroundcontrol,remspoor/qgroundcontrol,RedoXyde/PX4_qGCS,fizzaly/qgroundcontrol,iidioter/qgroundcontrol,Hunter522/qgroundcontrol,Hunter522/qgroundcontrol,cfelipesouza/qgroundcontrol,jy723/qgroundcontrol,CornerOfSkyline/qgroundcontrol,RedoXyde/PX4_qGCS,dagoodma/qgroundcontrol,RedoXyde/PX4_qGCS,hejunbok/qgroundcontrol,iidioter/qgroundcontrol,lis-epfl/qgroundcontrol,devbharat/qgroundcontrol,fizzaly/qgroundcontrol,iidioter/qgroundcontrol,RedoXyde/PX4_qGCS,nado1688/qgroundcontrol,scott-eddy/qgroundcontrol,kd0aij/qgroundcontrol,TheIronBorn/qgroundcontrol,BMP-TECH/qgroundcontrol,scott-eddy/qgroundcontrol,iidioter/qgroundcontrol,scott-eddy/qgroundcontrol,kd0aij/qgroundcontrol,CornerOfSkyline/qgroundcontrol,LIKAIMO/qgroundcontrol,lis-epfl/qgroundcontrol,kd0aij/qgroundcontrol,jy723/qgroundcontrol,catch-twenty-two/qgroundcontrol,nado1688/qgroundcontrol,lis-epfl/qgroundcontrol,BMP-TECH/qgroundcontrol,devbharat/qgroundcontrol,lis-epfl/qgroundcontrol,RedoXyde/PX4_qGCS,kd0aij/qgroundcontrol,greenoaktree/qgroundcontrol,fizzaly/qgroundcontrol,TheIronBorn/qgroundcontrol,remspoor/qgroundcontrol,cfelipesouza/qgroundcontrol,dagoodma/qgroundcontrol,caoxiongkun/qgroundcontrol,greenoaktree/qgroundcontrol,CornerOfSkyline/qgroundcontrol,RedoXyde/PX4_qGCS,hejunbok/qgroundcontrol,jy723/qgroundcontrol,fizzaly/qgroundcontrol,devbharat/qgroundcontrol,scott-eddy/qgroundcontrol,Hunter522/qgroundcontrol,UAVenture/qgroundcontrol,mihadyuk/qgroundcontrol,BMP-TECH/qgroundcontrol,cfelipesouza/qgroundcontrol,BMP-TECH/qgroundcontrol,caoxiongkun/qgroundcontrol,UAVenture/qgroundcontrol,BMP-TECH/qgroundcontrol,scott-eddy/qgroundcontrol,mihadyuk/qgroundcontrol,iidioter/qgroundcontrol,UAVenture/qgroundcontrol,caoxiongkun/qgroundcontrol,nado1688/qgroundcontrol,nado1688/qgroundcontrol,UAVenture/qgroundcontrol,cfelipesouza/qgroundcontrol,greenoaktree/qgroundcontrol,ethz-asl/qgc_asl,ethz-asl/qgc_asl,Hunter522/qgroundcontrol,CornerOfSkyline/qgroundcontrol,UAVenture/qgroundcontrol,mihadyuk/qgroundcontrol,scott-eddy/qgroundcontrol,CornerOfSkyline/qgroundcontrol,hejunbok/qgroundcontrol,catch-twenty-two/qgroundcontrol,cfelipesouza/qgroundcontrol,LIKAIMO/qgroundcontrol,jy723/qgroundcontrol,caoxiongkun/qgroundcontrol,devbharat/qgroundcontrol,dagoodma/qgroundcontrol,kd0aij/qgroundcontrol,catch-twenty-two/qgroundcontrol,TheIronBorn/qgroundcontrol,dagoodma/qgroundcontrol,iidioter/qgroundcontrol,dagoodma/qgroundcontrol,remspoor/qgroundcontrol,hejunbok/qgroundcontrol,mihadyuk/qgroundcontrol,ethz-asl/qgc_asl,LIKAIMO/qgroundcontrol,TheIronBorn/qgroundcontrol,remspoor/qgroundcontrol,fizzaly/qgroundcontrol,cfelipesouza/qgroundcontrol,UAVenture/qgroundcontrol,dagoodma/qgroundcontrol,nado1688/qgroundcontrol,greenoaktree/qgroundcontrol,devbharat/qgroundcontrol,LIKAIMO/qgroundcontrol,ethz-asl/qgc_asl,mihadyuk/qgroundcontrol,jy723/qgroundcontrol,jy723/qgroundcontrol,remspoor/qgroundcontrol,josephlewis42/UDenverQGC2,nado1688/qgroundcontrol,devbharat/qgroundcontrol,mihadyuk/qgroundcontrol,caoxiongkun/qgroundcontrol,greenoaktree/qgroundcontrol,catch-twenty-two/qgroundcontrol,lis-epfl/qgroundcontrol,caoxiongkun/qgroundcontrol,LIKAIMO/qgroundcontrol,kd0aij/qgroundcontrol,josephlewis42/UDenverQGC2,catch-twenty-two/qgroundcontrol,Hunter522/qgroundcontrol,LIKAIMO/qgroundcontrol,CornerOfSkyline/qgroundcontrol,josephlewis42/UDenverQGC2,BMP-TECH/qgroundcontrol,Hunter522/qgroundcontrol,fizzaly/qgroundcontrol,TheIronBorn/qgroundcontrol,remspoor/qgroundcontrol,hejunbok/qgroundcontrol,TheIronBorn/qgroundcontrol,ethz-asl/qgc_asl,hejunbok/qgroundcontrol |
55ca2704359dbd97169eeed03e258f9005d7336d | helloworld.c | helloworld.c | #include <stdio.h>
int main()
{
/* hi this is a multi-line comment
hi.
*/
// single-line comment
printf ("Hello world!\n"); // this works too
// some vars and control flow
int numDaysInYear = 365;
printf ("days per year: %d\n", numDaysInYear);
if (numDaysInYear == 366) {
printf ("Seems reasonable\n");
}
else {
int long someReallyLongNumber = 100000000000000L;
printf ("Some long number: %ld\n", someReallyLongNumber);
}
// loops
int i;
for (i=0; i<5; i++) {
printf ("i=%d\n", i);
}
}
| #include <stdio.h>
int main()
{
/* hi this is a multi-line comment
hi.
*/
// single-line comment
printf ("Hello world!\n"); // this works too
// some vars and control flow
int numDaysInYear = 365;
printf ("days per year: %d\n", numDaysInYear);
if (numDaysInYear == 366) {
printf ("Seems reasonable\n");
}
else {
int long someReallyLongNumber = 100000000000000L;
printf ("Some long number: %ld\n", someReallyLongNumber);
}
// loops
int i;
for (i=0; i<5; i++) {
printf ("i=%d\n", i);
}
// https://www.seas.gwu.edu/~simhaweb/C/lectures/module2/module2
int x = 5;
int *intPtr;
// print mem address of variable i
printf ("Variable x is located at memory address %lu\n", &x);
// extract address of var i into the pointer
intPtr = & x;
printf ("The int at memory location %lu is %d\n", intPtr, *intPtr);
// TODO: examine compiler warnings
}
| Add c pointer basic example | Add c pointer basic example
| C | mit | oldhill/halloween,oldhill/halloween,oldhill/halloween,oldhill/halloween |
a0d5875d501e07e7b55ea71f413951e8ec2318aa | plugin/xlib/gvplugin_xlib.c | plugin/xlib/gvplugin_xlib.c | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#include "gvplugin.h"
extern gvplugin_installed_t gvdevice_types_xlib;
static gvplugin_api_t apis[] = {
{API_device, &gvdevice_types_xlib},
{(api_t)0, 0},
};
gvplugin_library_t gvplugin_xlib_LTX_library = { "xlib", apis };
| /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#include "gvplugin.h"
extern gvplugin_installed_t gvdevice_types_xlib[];
static gvplugin_api_t apis[] = {
{API_device, gvdevice_types_xlib},
{(api_t)0, 0},
};
gvplugin_library_t gvplugin_xlib_LTX_library = { "xlib", apis };
| Apply patch for C standards compliance: "All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined." (That's from ISO/IEC 9899:TC2 final committee draft, section 6.2.7.) | Apply patch for C standards compliance:
"All declarations that
refer to the same object or function shall have compatible type;
otherwise, the behavior is undefined." (That's from ISO/IEC 9899:TC2
final committee draft, section 6.2.7.)
This doesn't trigger issues with most C implementations, but there
is one implementation in development (GCC LTO branch) which does
flag this issue.
Patch from: Chris Demetriou <[email protected]>
| C | epl-1.0 | MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,tkelman/graphviz,BMJHayward/graphviz,ellson/graphviz,tkelman/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,kbrock/graphviz,BMJHayward/graphviz,tkelman/graphviz,jho1965us/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,tkelman/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,tkelman/graphviz,ellson/graphviz,jho1965us/graphviz,jho1965us/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,BMJHayward/graphviz,kbrock/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,MjAbuz/graphviz,ellson/graphviz,MjAbuz/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,kbrock/graphviz |
0519bdcd3d19063cd3640cabc9f25f6f11cbffb2 | include/llvm/Intrinsics.h | include/llvm/Intrinsics.h | //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
//
// This file defines a set of enums which allow processing of intrinsic
// functions. Values of these enum types are returned by
// Function::getIntrinsicID.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_INTRINSICS_H
#define LLVM_INTRINSICS_H
namespace LLVMIntrinsic {
enum ID {
not_intrinsic = 0, // Must be zero
va_start, // Used to represent a va_start call in C
va_end, // Used to represent a va_end call in C
va_copy, // Used to represent a va_copy call in C
setjmp, // Used to represent a setjmp call in C
longjmp, // Used to represent a longjmp call in C
};
}
#endif
| //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
//
// This file defines a set of enums which allow processing of intrinsic
// functions. Values of these enum types are returned by
// Function::getIntrinsicID.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_INTRINSICS_H
#define LLVM_INTRINSICS_H
/// LLVMIntrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM. These enum values are
/// returned by Function::getIntrinsicID().
///
namespace LLVMIntrinsic {
enum ID {
not_intrinsic = 0, // Must be zero
va_start, // Used to represent a va_start call in C
va_end, // Used to represent a va_end call in C
va_copy, // Used to represent a va_copy call in C
setjmp, // Used to represent a setjmp call in C
longjmp, // Used to represent a longjmp call in C
};
}
#endif
| Add comment for doxygen for namespace | Add comment for doxygen for namespace
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@6578 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm |
329ff94d0a13fecb39abf68b7649dd3a397ee38d | src/engine/utils/include/halley/data_structures/maybe_ref.h | src/engine/utils/include/halley/data_structures/maybe_ref.h | #pragma once
#include <gsl/gsl>
namespace Halley {
// Note: it's important that this class has the same layout and binary structure as a plain pointer
template <typename T>
class MaybeRef {
public:
MaybeRef() : pointer(nullptr) {}
MaybeRef(T* pointer) : pointer(pointer) {}
MaybeRef(T& ref) : pointer(&ref) {}
bool hasValue() const
{
return pointer != nullptr;
}
T& get()
{
Expects(pointer != nullptr);
return *pointer;
}
const T& get() const
{
Expects(pointer != nullptr);
return *pointer;
}
T* operator->()
{
Expects(pointer != nullptr);
return pointer;
}
const T* operator->() const
{
Expects(pointer != nullptr);
return pointer;
}
operator bool() const
{
return pointer != nullptr;
}
private:
T* pointer;
};
}
| #pragma once
#include <gsl/gsl>
namespace Halley {
// Note: it's important that this class has the same layout and binary structure as a plain pointer
template <typename T>
class MaybeRef {
public:
MaybeRef() : pointer(nullptr) {}
MaybeRef(T* pointer) : pointer(pointer) {}
MaybeRef(T& ref) : pointer(&ref) {}
bool hasValue() const
{
return pointer != nullptr;
}
T& get()
{
Expects(pointer != nullptr);
return *pointer;
}
const T& get() const
{
Expects(pointer != nullptr);
return *pointer;
}
T* operator->()
{
Expects(pointer != nullptr);
return pointer;
}
const T* operator->() const
{
Expects(pointer != nullptr);
return pointer;
}
operator bool() const
{
return pointer != nullptr;
}
T* tryGet()
{
return pointer;
}
const T* tryGet() const
{
return pointer;
}
private:
T* pointer;
};
}
| Allow getting raw pointer from MaybeRef | Allow getting raw pointer from MaybeRef
| C | apache-2.0 | amzeratul/halley,amzeratul/halley,amzeratul/halley |
ec43f8052c9d0783b0ac8ffd7ffe9054ea8b6f5f | test/FrontendC/2011-02-21-DATA-common.c | test/FrontendC/2011-02-21-DATA-common.c | // RUN: %llvmgcc -S %s -o /dev/null
struct rtxc_snapshot {
int a, b, c, d;
};
__attribute__ ((section("__DATA, __common"))) static struct rtxc_snapshot rtxc_log_A[4];
| Test case for r126127. Radar 9012638. | Test case for r126127. Radar 9012638.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@126131 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm |
|
04c5a9c0838a9c44b55afb427169318ec4a44ec2 | src/win32/mingw-compat.h | src/win32/mingw-compat.h | /*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_mingw_compat__
#define INCLUDE_mingw_compat__
#if defined(__MINGW32__)
#undef stat
#if _WIN32_WINNT >= 0x0601
#define stat __stat64
#else
#define stat _stati64
#endif
#endif
#endif /* INCLUDE_mingw_compat__ */
| /*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_mingw_compat__
#define INCLUDE_mingw_compat__
#if defined(__MINGW32__)
#undef stat
#if _WIN32_WINNT >= 0x0601
#define stat __stat64
#else
#define stat _stati64
#endif
#if _WIN32_WINNT < 0x0600 && !defined(__MINGW64_VERSION_MAJOR)
#undef MemoryBarrier
void __mingworg_MemoryBarrier(void);
#define MemoryBarrier __mingworg_MemoryBarrier
#define VOLUME_NAME_DOS 0x0
#endif
#endif
#endif /* INCLUDE_mingw_compat__ */
| Add some missing definitions for mingw.org | Add some missing definitions for mingw.org
these shouldn't be necessary if _WIN32_WINNT >= _WIN32_WINNT_VISTA
| C | lgpl-2.1 | whoisj/libgit2,chiayolin/libgit2,falqas/libgit2,swisspol/DEMO-libgit2,spraints/libgit2,rcorre/libgit2,Tousiph/Demo1,kenprice/libgit2,dleehr/libgit2,iankronquist/libgit2,swisspol/DEMO-libgit2,oaastest/libgit2,stewid/libgit2,saurabhsuniljain/libgit2,yosefhackmon/libgit2,stewid/libgit2,leoyanggit/libgit2,leoyanggit/libgit2,since2014/libgit2,sim0629/libgit2,amyvmiwei/libgit2,mcanthony/libgit2,magnus98/TEST,amyvmiwei/libgit2,since2014/libgit2,joshtriplett/libgit2,since2014/libgit2,saurabhsuniljain/libgit2,sim0629/libgit2,MrHacky/libgit2,oaastest/libgit2,mrksrm/Mingijura,ardumont/libgit2,magnus98/TEST,JIghtuse/libgit2,ardumont/libgit2,jeffhostetler/public_libgit2,kissthink/libgit2,amyvmiwei/libgit2,leoyanggit/libgit2,falqas/libgit2,amyvmiwei/libgit2,rcorre/libgit2,joshtriplett/libgit2,sygool/libgit2,jeffhostetler/public_libgit2,dleehr/libgit2,since2014/libgit2,yongthecoder/libgit2,yongthecoder/libgit2,yongthecoder/libgit2,spraints/libgit2,iankronquist/libgit2,falqas/libgit2,mrksrm/Mingijura,claudelee/libgit2,saurabhsuniljain/libgit2,Corillian/libgit2,mingyaaaa/libgit2,spraints/libgit2,MrHacky/libgit2,nokiddin/libgit2,mingyaaaa/libgit2,rcorre/libgit2,JIghtuse/libgit2,kenprice/libgit2,MrHacky/libgit2,mhp/libgit2,nokiddin/libgit2,ardumont/libgit2,KTXSoftware/libgit2,Tousiph/Demo1,t0xicCode/libgit2,falqas/libgit2,yongthecoder/libgit2,MrHacky/libgit2,rcorre/libgit2,mcanthony/libgit2,linquize/libgit2,rcorre/libgit2,claudelee/libgit2,saurabhsuniljain/libgit2,kenprice/libgit2,Tousiph/Demo1,falqas/libgit2,kenprice/libgit2,mrksrm/Mingijura,falqas/libgit2,magnus98/TEST,sim0629/libgit2,kissthink/libgit2,spraints/libgit2,swisspol/DEMO-libgit2,skabel/manguse,mcanthony/libgit2,Corillian/libgit2,mhp/libgit2,skabel/manguse,MrHacky/libgit2,mhp/libgit2,magnus98/TEST,claudelee/libgit2,saurabhsuniljain/libgit2,KTXSoftware/libgit2,linquize/libgit2,jeffhostetler/public_libgit2,swisspol/DEMO-libgit2,linquize/libgit2,mingyaaaa/libgit2,JIghtuse/libgit2,Corillian/libgit2,yosefhackmon/libgit2,iankronquist/libgit2,saurabhsuniljain/libgit2,yosefhackmon/libgit2,dleehr/libgit2,yosefhackmon/libgit2,Tousiph/Demo1,mhp/libgit2,magnus98/TEST,KTXSoftware/libgit2,ardumont/libgit2,mrksrm/Mingijura,leoyanggit/libgit2,oaastest/libgit2,skabel/manguse,chiayolin/libgit2,joshtriplett/libgit2,yosefhackmon/libgit2,jeffhostetler/public_libgit2,iankronquist/libgit2,yongthecoder/libgit2,t0xicCode/libgit2,iankronquist/libgit2,JIghtuse/libgit2,stewid/libgit2,whoisj/libgit2,spraints/libgit2,nokiddin/libgit2,kenprice/libgit2,sygool/libgit2,sygool/libgit2,t0xicCode/libgit2,swisspol/DEMO-libgit2,kissthink/libgit2,stewid/libgit2,iankronquist/libgit2,magnus98/TEST,mcanthony/libgit2,sim0629/libgit2,whoisj/libgit2,chiayolin/libgit2,oaastest/libgit2,swisspol/DEMO-libgit2,skabel/manguse,t0xicCode/libgit2,yosefhackmon/libgit2,dleehr/libgit2,stewid/libgit2,claudelee/libgit2,linquize/libgit2,chiayolin/libgit2,sim0629/libgit2,sim0629/libgit2,since2014/libgit2,chiayolin/libgit2,dleehr/libgit2,leoyanggit/libgit2,JIghtuse/libgit2,oaastest/libgit2,mhp/libgit2,linquize/libgit2,KTXSoftware/libgit2,Tousiph/Demo1,Tousiph/Demo1,MrHacky/libgit2,since2014/libgit2,mcanthony/libgit2,leoyanggit/libgit2,dleehr/libgit2,kissthink/libgit2,stewid/libgit2,Corillian/libgit2,skabel/manguse,kenprice/libgit2,mhp/libgit2,kissthink/libgit2,joshtriplett/libgit2,oaastest/libgit2,mrksrm/Mingijura,whoisj/libgit2,skabel/manguse,ardumont/libgit2,sygool/libgit2,Corillian/libgit2,rcorre/libgit2,mrksrm/Mingijura,sygool/libgit2,sygool/libgit2,spraints/libgit2,joshtriplett/libgit2,mingyaaaa/libgit2,jeffhostetler/public_libgit2,Corillian/libgit2,KTXSoftware/libgit2,whoisj/libgit2,jeffhostetler/public_libgit2,t0xicCode/libgit2,claudelee/libgit2,claudelee/libgit2,KTXSoftware/libgit2,nokiddin/libgit2,nokiddin/libgit2,yongthecoder/libgit2,ardumont/libgit2,linquize/libgit2,mcanthony/libgit2,JIghtuse/libgit2,joshtriplett/libgit2,amyvmiwei/libgit2,mingyaaaa/libgit2,chiayolin/libgit2,whoisj/libgit2,kissthink/libgit2,mingyaaaa/libgit2,t0xicCode/libgit2,nokiddin/libgit2,amyvmiwei/libgit2 |
b77f0a23e98d6e379ae66b494d0ccb15f434bac3 | libyaul/scu/bus/cpu/cpu.h | libyaul/scu/bus/cpu/cpu.h | /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _CPU_H_
#define _CPU_H_
#include <cpu/cache.h>
#include <cpu/divu.h>
#include <cpu/dmac.h>
#include <cpu/dual.h>
#include <cpu/endian.h>
#include <cpu/frt.h>
#include <cpu/instructions.h>
#include <cpu/intc.h>
#include <cpu/registers.h>
#include <cpu/sync.h>
#include <cpu/wdt.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern void cpu_init(void);
extern void _slave_polling_entry(void);
extern void _slave_ici_entry(void);
extern void _exception_illegal_instruction(void);
extern void _exception_illegal_slot(void);
extern void _exception_cpu_address_error(void);
extern void _exception_dma_address_error(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_CPU_H_ */
| /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _CPU_H_
#define _CPU_H_
#include <cpu/cache.h>
#include <cpu/divu.h>
#include <cpu/dmac.h>
#include <cpu/dual.h>
#include <cpu/endian.h>
#include <cpu/frt.h>
#include <cpu/instructions.h>
#include <cpu/intc.h>
#include <cpu/registers.h>
#include <cpu/sync.h>
#include <cpu/wdt.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern void cpu_init(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_CPU_H_ */
| Remove prototypes for static methods | Remove prototypes for static methods | C | mit | ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul |
98009edde9aee61ccfe582febd990d2bd409b48d | Wangscape/Exp.h | Wangscape/Exp.h | #pragma once
#include <noise/noise.h>
#include <cmath>
// This is similar to noise::module::Exp.
// However, no rescaling is performed,
// and no attempt is made to guard against invalid operations.
// Make sure the range of the source module
// is compatible with the base of the exponential!
// This module names its parameter "base" rather than "exponent",
// because the formula is pow(base, source_value),
// not pow(source_value, exponent).
class Exp : public noise::module::Module
{
public:
double base;
Exp() :
Module(GetSourceModuleCount()),
mBase(2.)
{};
virtual int GetSourceModuleCount() const
{
return 1;
}
void SetBase(double base)
{
mBase = base;
}
double GetBase() const
{
return mBase;
}
virtual double GetValue(double x, double y, double z) const
{
return pow(mBase, GetSourceModule(0).GetValue(x,y,z));
};
protected:
double mBase;
};
// Noise module that raises a source module to an exponent.
// No attempt is made to guard against invalid operations.
// Make sure the range of the source module
// is compatible with the exponent!
// The formula is pow(source_value, exponent)
class Power : public noise::module::Module
{
public:
double exponent;
Power() :
Module(GetSourceModuleCount()),
mExponent(2.)
{};
virtual int GetSourceModuleCount() const
{
return 1;
}
void SetExponent(double exponent)
{
mExponent = exponent;
}
double GetExponent() const
{
return mExponent;
}
virtual double GetValue(double x, double y, double z) const
{
return pow(GetSourceModule(0).GetValue(x, y, z), mExponent);
};
protected:
double mExponent;
};
| Make module^p and b^module modules | Make module^p and b^module modules
| C | mit | Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape |
|
f8d99a9dcc3c5a7bfd67dd8ad6da687a9302c504 | api/binding/void_ptr.h | api/binding/void_ptr.h | /*
* Appcelerator Kroll - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved.
*/
#ifndef _KR_VOID_PTR_OBJECT_H_
#define _KR_VOID_PTR_OBJECT_H_
#include "../kroll.h"
namespace kroll
{
/**
* An object that represents an arbitrary amount of binary data§
*/
class KROLL_API VoidPtr : public StaticBoundObject
{
public:
VoidPtr(void* pointer) :
StaticBoundObject("VoidPtr"),
pointer(pointer) {}
void* GetPtr() { return pointer; }
private:
void* pointer;
};
}
#endif
| Add missing VoidPtr implementation from last commit. | Add missing VoidPtr implementation from last commit.
| C | apache-2.0 | mital/kroll,mital/kroll,mital/kroll,mital/kroll,appcelerator/kroll,appcelerator/kroll,appcelerator/kroll |
|
abd003aaf24b0f4e7d5d815e492282bca5ed70fb | Nimble/Nimble.h | Nimble/Nimble.h | #import <Foundation/Foundation.h>
#import <Nimble/NMBExceptionCapture.h>
#import <Nimble/DSL.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
| #import <Foundation/Foundation.h>
#import "NMBExceptionCapture.h"
#import "DSL.h"
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
| Convert module-based imports to relative | Convert module-based imports to relative
| C | apache-2.0 | dgdosen/Nimble,dgdosen/Nimble,Quick/Nimble,phatblat/Nimble,AnthonyMDev/Nimble,DanielAsher/Nimble,ashfurrow/Nimble,AnthonyMDev/Nimble,abbeycode/Nimble,phatblat/Nimble,feinstruktur/Nimble,ashfurrow/Nimble,phatblat/Nimble,ashfurrow/Nimble,jeffh/Nimble,twobitlabs/Nimble,abbeycode/Nimble,jeffh/Nimble,DanielAsher/Nimble,jeffh/Nimble,dgdosen/Nimble,Quick/Nimble,DanielAsher/Nimble,mishimay/Nimble,jeffh/Nimble,abbeycode/Nimble,feinstruktur/Nimble,abbeycode/Nimble,AnthonyMDev/Nimble,dgdosen/Nimble,mishimay/Nimble,mishimay/Nimble,Quick/Nimble,twobitlabs/Nimble,twobitlabs/Nimble,feinstruktur/Nimble |
8c55edb94221daa2b71ca122c959f9720128987d | src/world/Server/Packets/SmsgWeather.h | src/world/Server/Packets/SmsgWeather.h | /*
Copyright (c) 2014-2018 AscEmu Team <http://www.ascemu.org>
This file is released under the MIT license. See README-MIT for more information.
*/
#pragma once
#include <cstdint>
#include "ManagedPacket.h"
namespace AscEmu { namespace Packets
{
class SmsgWeather : public ManagedPacket
{
#if VERSION_STRING != Cata
public:
uint32_t type;
float_t density;
uint32_t sound;
SmsgWeather() : SmsgWeather(0, 0, 0)
{
}
SmsgWeather(uint32_t type, float_t density, uint32_t sound) :
ManagedPacket(SMSG_WEATHER, 13),
type(type),
density(density),
sound(sound)
{
}
protected:
bool internalSerialise(WorldPacket& packet) override
{
packet << type << density << sound << uint8_t(0);
return true;
}
bool internalDeserialise(WorldPacket& packet) override { return false; }
#endif
};
}}
| /*
Copyright (c) 2014-2018 AscEmu Team <http://www.ascemu.org>
This file is released under the MIT license. See README-MIT for more information.
*/
#pragma once
#include <cstdint>
#include "ManagedPacket.h"
namespace AscEmu { namespace Packets
{
class SmsgWeather : public ManagedPacket
{
public:
uint32_t type;
float_t density;
uint32_t sound;
SmsgWeather() : SmsgWeather(0, 0, 0)
{
}
SmsgWeather(uint32_t type, float_t density, uint32_t sound) :
ManagedPacket(SMSG_WEATHER, 13),
type(type),
density(density),
sound(sound)
{
}
protected:
bool internalSerialise(WorldPacket& packet) override
{
packet << type << density << sound << uint8_t(0);
return true;
}
bool internalDeserialise(WorldPacket& packet) override { return false; }
};
}}
| Enable serialise packet for Cata | Enable serialise packet for Cata
| C | agpl-3.0 | AscEmu/AscEmu,master312/AscEmu,Appled/AscEmu,master312/AscEmu,master312/AscEmu,Appled/AscEmu,Appled/AscEmu,AscEmu/AscEmu,AscEmu/AscEmu,master312/AscEmu,master312/AscEmu,master312/AscEmu |
72c4accefc3d2ac122d650f696d04b189abc43be | src/xml/ixmldeserializing.h | src/xml/ixmldeserializing.h | #ifndef QTXXML_IXMLDESERIALIZING_H
#define QTXXML_IXMLDESERIALIZING_H
#include "xmlglobal.h"
#include <QtCore>
QTX_BEGIN_NAMESPACE
class IXmlDeserializing
{
public:
virtual ~IXmlDeserializing() {};
virtual IXmlDeserializing *deserializeXmlStartElement(XmlDeserializer *deserializer, const QStringRef & name, const QStringRef & namespaceUri, const QXmlStreamAttributes & attributes) = 0;
virtual void deserializeXmlEndElement(XmlDeserializer *deserializer, const QStringRef & name, const QStringRef & namespaceUri) = 0;
virtual void deserializeXmlAttributes(XmlDeserializer *deserializer, const QXmlStreamAttributes & attributes) = 0;
virtual void deserializeXmlCharacters(XmlDeserializer *deserializer, const QStringRef & text) = 0;
};
QTX_END_NAMESPACE
#endif // QTXXML_IXMLDESERIALIZING_H
| #ifndef QTXXML_IXMLDESERIALIZING_H
#define QTXXML_IXMLDESERIALIZING_H
#include "xmlglobal.h"
#include <QtCore>
QTX_BEGIN_NAMESPACE
class IXmlDeserializing
{
public:
virtual ~IXmlDeserializing() {};
virtual IXmlDeserializing *deserializeXmlStartElement(XmlDeserializer * deserializer, const QStringRef & name, const QStringRef & namespaceUri, const QXmlStreamAttributes & attributes)
{
Q_UNUSED(deserializer)
Q_UNUSED(name)
Q_UNUSED(namespaceUri)
Q_UNUSED(attributes)
return 0;
}
virtual void deserializeXmlEndElement(XmlDeserializer *deserializer, const QStringRef & name, const QStringRef & namespaceUri)
{
Q_UNUSED(deserializer)
Q_UNUSED(name)
Q_UNUSED(namespaceUri)
}
virtual void deserializeXmlAttributes(XmlDeserializer *deserializer, const QXmlStreamAttributes & attributes)
{
Q_UNUSED(deserializer)
Q_UNUSED(attributes)
}
virtual void deserializeXmlCharacters(XmlDeserializer *deserializer, const QStringRef & text)
{
Q_UNUSED(deserializer)
Q_UNUSED(text)
}
};
QTX_END_NAMESPACE
#endif // QTXXML_IXMLDESERIALIZING_H
| Add default implementations of IXmlDeserializing methods. | Add default implementations of IXmlDeserializing methods.
| C | apache-2.0 | jaredhanson/qtxxml,jaredhanson/qtxxml |
70cc0d04e55e04eb9c0abe0f6f5e0f2877a5ca99 | cgi/fcgi_hello.c | cgi/fcgi_hello.c | /**
* Copyright 2006 Mike Tsao. All rights reserved.
*
* Hello World using FastCGI and ClearSilver.
*/
#include "ClearSilver.h"
#include <string>
#include <fcgi_stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <syslog.h>
static bool quit = false;
static int cs_printf(void *ctx, const char *s, va_list args) {
return printf(s, args);
}
static int cs_write(void *ctx, const char *s, int n) {
return fwrite(const_cast<char *>(s), n, 1, FCGI_stdout);
}
int main(int argc, char **argv, char **envp) {
openlog(argv[0], 0, LOG_USER);
syslog(LOG_INFO, "%s started.", argv[0]);
int hits = 0;
while (FCGI_Accept() >= 0) {
HDF *hdf = NULL;
CGI *cgi = NULL;
/* Note that we aren't doing any error handling here, we really should. */
hdf_init(&hdf);
// Takes ownership of HDF.
cgi_init(&cgi, hdf);
hits++;
/* Initialize the standard cgiwrap environment. FastCGI already wraps some
* of the standard calls that cgiwrap wraps. */
cgiwrap_init_std(argc, argv, environ);
/* Then, we install our own wrappers for some cgiwrap calls that aren't
* already wrapped in the standard wrappers. */
cgiwrap_init_emu(NULL, NULL, cs_printf, cs_write, NULL, NULL, NULL);
hdf_read_file(cgi->hdf, "common.hdf");
hdf_read_file(cgi->hdf, "hello_world.hdf");
cgi_display(cgi, "hello_world.cs");
// This destroys HDF.
cgi_destroy(&cgi);
}
syslog(LOG_INFO, "%s ending.", argv[0]);
return 0;
}
| Add a very simple example which uses FastCGI, a stripped down version of one given by Mike Tsao. | Add a very simple example which uses FastCGI, a stripped down
version of one given by Mike Tsao. | C | bsd-2-clause | hljyunxi/clearsilver,manuelluis/clearsilver,alisonjoe/clearsilver,WillYee/clearsilver,hljyunxi/clearsilver,hljyunxi/clearsilver,apfeltee/clearsilver,hobby/clearsilver,manuelluis/clearsilver,apfeltee/clearsilver,alisonjoe/clearsilver,hczhang/clearsilver,manuelluis/clearsilver,hongruiqi/clearsilver,manuelluis/clearsilver,hongruiqi/clearsilver,WillYee/clearsilver,hczhang/clearsilver,hljyunxi/clearsilver,hczhang/clearsilver,apfeltee/clearsilver,hczhang/clearsilver,manuelluis/clearsilver,WillYee/clearsilver,hljyunxi/clearsilver,alisonjoe/clearsilver,WillYee/clearsilver,hongruiqi/clearsilver,manuelluis/clearsilver,alisonjoe/clearsilver,WillYee/clearsilver,hobby/clearsilver,hczhang/clearsilver,hczhang/clearsilver,hongruiqi/clearsilver,alisonjoe/clearsilver,apfeltee/clearsilver,hobby/clearsilver,manuelluis/clearsilver,manuelluis/clearsilver,apfeltee/clearsilver,hongruiqi/clearsilver,apfeltee/clearsilver,hljyunxi/clearsilver,hongruiqi/clearsilver,apfeltee/clearsilver,alisonjoe/clearsilver,alisonjoe/clearsilver,hczhang/clearsilver,hobby/clearsilver,hobby/clearsilver,hljyunxi/clearsilver,WillYee/clearsilver,WillYee/clearsilver,alisonjoe/clearsilver,hobby/clearsilver,apfeltee/clearsilver,WillYee/clearsilver,hobby/clearsilver,hobby/clearsilver,manuelluis/clearsilver,hczhang/clearsilver,hongruiqi/clearsilver,hljyunxi/clearsilver,hczhang/clearsilver,hongruiqi/clearsilver,apfeltee/clearsilver,hongruiqi/clearsilver,hljyunxi/clearsilver,alisonjoe/clearsilver,hobby/clearsilver,WillYee/clearsilver |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.