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
|
---|---|---|---|---|---|---|---|---|---|
329ca68e8c93524d269611d301a4dea908bb33d3 | test/ClangModules/Inputs/custom-modules/ObjCImplicitProperties.h | test/ClangModules/Inputs/custom-modules/ObjCImplicitProperties.h | __attribute__((objc_root_class))
@interface ImplicitProperties
- (id)implicitProperty;
- (void)setImplicitProperty:(id)implicitProperty;
- (void)setAnotherImplicitProperty:(int)implicitProperty;
- (int)anotherImplicitProperty;
@end
__attribute__((objc_root_class))
@interface BadImplicitProperties
- (int)nonVoidReturn;
- (int)setNonVoidReturn:(int)val;
- (void)setNonMatchingType:(id)val;
- (int)nonMatchingType;
- (int)wrongGetterArgs:(int)val;
- (void)setWrongGetterArgs:(int)val;
- (void)setWrongSetterArgs:(int)val extra:(int)another;
- (int)wrongSetterArgs;
- (int)wrongSetterArgs2;
- (void)setWrongSetterArgs2;
- (int)getterOnly;
- (void)setSetterOnly:(int)val;
@end
| __attribute__((objc_root_class))
@interface ImplicitProperties
- (id)implicitProperty;
- (void)setImplicitProperty:(id)implicitProperty;
- (void)setAnotherImplicitProperty:(int)implicitProperty;
- (int)anotherImplicitProperty;
@end
__attribute__((objc_root_class))
@interface BadImplicitProperties
- (int)nonVoidReturn;
- (int)setNonVoidReturn:(int)val;
- (void)setNonMatchingType:(id)val;
- (int)nonMatchingType;
- (int)wrongGetterArgs:(int)val;
- (void)setWrongGetterArgs:(int)val;
- (void)setWrongSetterArgs:(int)val extra:(int)another;
- (int)wrongSetterArgs;
- (int)wrongSetterArgs2;
- (void)setWrongSetterArgs2;
- (int)getterOnly;
- (void)setSetterOnly:(int)val;
@end
@protocol PropertiesProto
- (id)methodInProto;
@property id propertyInProto;
@end
__attribute__((objc_root_class))
@interface Base <PropertiesProto>
- (id)methodInBase;
@property(readonly) id propertyInBase;
- (id)methodPairInBase;
- (void)setMethodPairInBase:(id)value;
- (id)getterOnlyInBase;
- (void)setSetterOnlyInBase:(id)value;
@property id methodInProto;
- (id)propertyInProto;
- (id)methodInBaseButPropertyInProto;
@property id propertyInBaseButMethodInProto;
@end
@protocol SubProto
- (id)propertyInBaseButMethodInProto;
@property id methodInBaseButPropertyInProto;
@end
@interface Sub : Base <SubProto>
@property id methodInBase;
- (id)propertyInBase;
- (void)setMethodPairInBase:(id)value;
- (id)getterOnlyInBase;
- (void)setGetterOnlyInBase:(id)value;
- (id)setterOnlyInBase;
@end
| Add some more tests for mixing methods and properties. | [ClangImporter] Add some more tests for mixing methods and properties.
The rule right now is basically "the class is most important, followed by
the superclass, followed by protocols", which I think is the right rule.
As long as we aren't required to /check/ the conformance to an Objective-C
protocol, we should be fine.
Swift SVN r16036
| C | apache-2.0 | russbishop/swift,calebd/swift,zisko/swift,dduan/swift,rudkx/swift,slavapestov/swift,slavapestov/swift,Jnosh/swift,amraboelela/swift,xwu/swift,shajrawi/swift,alblue/swift,devincoughlin/swift,LeoShimonaka/swift,tjw/swift,mightydeveloper/swift,sdulal/swift,hooman/swift,jtbandes/swift,jckarter/swift,tardieu/swift,practicalswift/swift,sschiau/swift,brentdax/swift,jtbandes/swift,kusl/swift,jmgc/swift,kstaring/swift,lorentey/swift,roambotics/swift,kperryua/swift,Ivacker/swift,CodaFi/swift,gribozavr/swift,xwu/swift,kentya6/swift,huonw/swift,uasys/swift,russbishop/swift,xwu/swift,milseman/swift,natecook1000/swift,rudkx/swift,tjw/swift,frootloops/swift,natecook1000/swift,milseman/swift,kentya6/swift,shajrawi/swift,khizkhiz/swift,nathawes/swift,djwbrown/swift,KrishMunot/swift,gottesmm/swift,apple/swift,IngmarStein/swift,hooman/swift,JGiola/swift,calebd/swift,Ivacker/swift,parkera/swift,parkera/swift,bitjammer/swift,devincoughlin/swift,gribozavr/swift,gmilos/swift,SwiftAndroid/swift,rudkx/swift,jmgc/swift,russbishop/swift,ahoppen/swift,codestergit/swift,zisko/swift,bitjammer/swift,MukeshKumarS/Swift,calebd/swift,SwiftAndroid/swift,sdulal/swift,airspeedswift/swift,manavgabhawala/swift,sschiau/swift,stephentyrone/swift,alblue/swift,gregomni/swift,kperryua/swift,dduan/swift,shajrawi/swift,tinysun212/swift-windows,glessard/swift,therealbnut/swift,emilstahl/swift,KrishMunot/swift,Jnosh/swift,ben-ng/swift,austinzheng/swift,kusl/swift,allevato/swift,cbrentharris/swift,codestergit/swift,manavgabhawala/swift,atrick/swift,manavgabhawala/swift,stephentyrone/swift,johnno1962d/swift,airspeedswift/swift,harlanhaskins/swift,CodaFi/swift,MukeshKumarS/Swift,kusl/swift,CodaFi/swift,huonw/swift,SwiftAndroid/swift,ben-ng/swift,ahoppen/swift,glessard/swift,shajrawi/swift,aschwaighofer/swift,IngmarStein/swift,deyton/swift,russbishop/swift,johnno1962d/swift,ken0nek/swift,swiftix/swift,kentya6/swift,OscarSwanros/swift,dduan/swift,sschiau/swift,aschwaighofer/swift,lorentey/swift,deyton/swift,adrfer/swift,natecook1000/swift,tkremenek/swift,glessard/swift,allevato/swift,karwa/swift,milseman/swift,gmilos/swift,austinzheng/swift,gregomni/swift,danielmartin/swift,SwiftAndroid/swift,airspeedswift/swift,therealbnut/swift,apple/swift,LeoShimonaka/swift,gottesmm/swift,JGiola/swift,jckarter/swift,deyton/swift,kperryua/swift,jtbandes/swift,jopamer/swift,swiftix/swift.old,modocache/swift,CodaFi/swift,jtbandes/swift,shajrawi/swift,karwa/swift,swiftix/swift.old,jckarter/swift,apple/swift,tinysun212/swift-windows,kusl/swift,benlangmuir/swift,practicalswift/swift,allevato/swift,shahmishal/swift,KrishMunot/swift,practicalswift/swift,gottesmm/swift,devincoughlin/swift,shajrawi/swift,JaSpa/swift,gottesmm/swift,MukeshKumarS/Swift,devincoughlin/swift,codestergit/swift,brentdax/swift,apple/swift,tardieu/swift,parkera/swift,benlangmuir/swift,hooman/swift,kusl/swift,natecook1000/swift,parkera/swift,xwu/swift,codestergit/swift,karwa/swift,arvedviehweger/swift,emilstahl/swift,bitjammer/swift,hughbe/swift,brentdax/swift,djwbrown/swift,hooman/swift,hughbe/swift,harlanhaskins/swift,MukeshKumarS/Swift,jopamer/swift,karwa/swift,arvedviehweger/swift,IngmarStein/swift,dduan/swift,LeoShimonaka/swift,CodaFi/swift,deyton/swift,lorentey/swift,gribozavr/swift,kstaring/swift,hooman/swift,ahoppen/swift,tkremenek/swift,djwbrown/swift,natecook1000/swift,cbrentharris/swift,roambotics/swift,glessard/swift,LeoShimonaka/swift,therealbnut/swift,stephentyrone/swift,kusl/swift,JaSpa/swift,therealbnut/swift,atrick/swift,bitjammer/swift,MukeshKumarS/Swift,hooman/swift,bitjammer/swift,devincoughlin/swift,gottesmm/swift,ken0nek/swift,shahmishal/swift,kusl/swift,MukeshKumarS/Swift,cbrentharris/swift,manavgabhawala/swift,dduan/swift,danielmartin/swift,kentya6/swift,karwa/swift,zisko/swift,calebd/swift,tkremenek/swift,shajrawi/swift,felix91gr/swift,mightydeveloper/swift,manavgabhawala/swift,shahmishal/swift,felix91gr/swift,khizkhiz/swift,ben-ng/swift,sschiau/swift,tardieu/swift,practicalswift/swift,CodaFi/swift,harlanhaskins/swift,sdulal/swift,dduan/swift,JGiola/swift,kperryua/swift,swiftix/swift,slavapestov/swift,nathawes/swift,airspeedswift/swift,zisko/swift,deyton/swift,uasys/swift,russbishop/swift,swiftix/swift,therealbnut/swift,ken0nek/swift,emilstahl/swift,roambotics/swift,Ivacker/swift,austinzheng/swift,KrishMunot/swift,benlangmuir/swift,jopamer/swift,aschwaighofer/swift,OscarSwanros/swift,harlanhaskins/swift,modocache/swift,danielmartin/swift,huonw/swift,khizkhiz/swift,Ivacker/swift,frootloops/swift,emilstahl/swift,ken0nek/swift,xedin/swift,ken0nek/swift,alblue/swift,OscarSwanros/swift,tinysun212/swift-windows,aschwaighofer/swift,jmgc/swift,shahmishal/swift,slavapestov/swift,gmilos/swift,hughbe/swift,cbrentharris/swift,nathawes/swift,swiftix/swift.old,xedin/swift,amraboelela/swift,zisko/swift,ben-ng/swift,johnno1962d/swift,parkera/swift,atrick/swift,djwbrown/swift,felix91gr/swift,calebd/swift,kstaring/swift,tkremenek/swift,Jnosh/swift,mightydeveloper/swift,OscarSwanros/swift,swiftix/swift.old,djwbrown/swift,karwa/swift,stephentyrone/swift,aschwaighofer/swift,return/swift,sdulal/swift,huonw/swift,LeoShimonaka/swift,kusl/swift,gribozavr/swift,benlangmuir/swift,roambotics/swift,frootloops/swift,apple/swift,practicalswift/swift,hooman/swift,hughbe/swift,JaSpa/swift,IngmarStein/swift,tardieu/swift,arvedviehweger/swift,sschiau/swift,mightydeveloper/swift,jckarter/swift,harlanhaskins/swift,karwa/swift,glessard/swift,sdulal/swift,LeoShimonaka/swift,emilstahl/swift,zisko/swift,OscarSwanros/swift,sschiau/swift,return/swift,kstaring/swift,gmilos/swift,roambotics/swift,airspeedswift/swift,rudkx/swift,uasys/swift,felix91gr/swift,cbrentharris/swift,dreamsxin/swift,alblue/swift,tkremenek/swift,kperryua/swift,rudkx/swift,xedin/swift,gmilos/swift,adrfer/swift,bitjammer/swift,dreamsxin/swift,slavapestov/swift,devincoughlin/swift,allevato/swift,austinzheng/swift,calebd/swift,allevato/swift,amraboelela/swift,manavgabhawala/swift,gribozavr/swift,swiftix/swift,kstaring/swift,sschiau/swift,tinysun212/swift-windows,modocache/swift,therealbnut/swift,tardieu/swift,felix91gr/swift,jmgc/swift,gottesmm/swift,LeoShimonaka/swift,KrishMunot/swift,milseman/swift,return/swift,benlangmuir/swift,gribozavr/swift,aschwaighofer/swift,kstaring/swift,atrick/swift,danielmartin/swift,KrishMunot/swift,hughbe/swift,kentya6/swift,nathawes/swift,lorentey/swift,austinzheng/swift,JGiola/swift,bitjammer/swift,johnno1962d/swift,sdulal/swift,deyton/swift,harlanhaskins/swift,devincoughlin/swift,huonw/swift,danielmartin/swift,lorentey/swift,danielmartin/swift,arvedviehweger/swift,JaSpa/swift,ben-ng/swift,return/swift,modocache/swift,slavapestov/swift,kstaring/swift,kperryua/swift,sschiau/swift,jckarter/swift,kentya6/swift,SwiftAndroid/swift,jckarter/swift,LeoShimonaka/swift,tjw/swift,ben-ng/swift,ken0nek/swift,frootloops/swift,manavgabhawala/swift,return/swift,xedin/swift,djwbrown/swift,jopamer/swift,parkera/swift,emilstahl/swift,shahmishal/swift,jopamer/swift,xwu/swift,gregomni/swift,cbrentharris/swift,JaSpa/swift,SwiftAndroid/swift,jckarter/swift,ben-ng/swift,Ivacker/swift,ahoppen/swift,swiftix/swift.old,amraboelela/swift,frootloops/swift,uasys/swift,benlangmuir/swift,jtbandes/swift,khizkhiz/swift,return/swift,xedin/swift,parkera/swift,arvedviehweger/swift,tinysun212/swift-windows,jmgc/swift,mightydeveloper/swift,adrfer/swift,adrfer/swift,uasys/swift,lorentey/swift,atrick/swift,lorentey/swift,natecook1000/swift,gregomni/swift,Jnosh/swift,cbrentharris/swift,swiftix/swift,tardieu/swift,ahoppen/swift,tjw/swift,IngmarStein/swift,modocache/swift,nathawes/swift,russbishop/swift,mightydeveloper/swift,milseman/swift,brentdax/swift,amraboelela/swift,alblue/swift,glessard/swift,khizkhiz/swift,modocache/swift,kentya6/swift,Jnosh/swift,xedin/swift,cbrentharris/swift,mightydeveloper/swift,Jnosh/swift,stephentyrone/swift,gmilos/swift,harlanhaskins/swift,adrfer/swift,gribozavr/swift,djwbrown/swift,tjw/swift,xwu/swift,devincoughlin/swift,tjw/swift,KrishMunot/swift,JaSpa/swift,shahmishal/swift,kentya6/swift,adrfer/swift,allevato/swift,brentdax/swift,johnno1962d/swift,felix91gr/swift,amraboelela/swift,xwu/swift,allevato/swift,MukeshKumarS/Swift,IngmarStein/swift,arvedviehweger/swift,swiftix/swift,johnno1962d/swift,sdulal/swift,lorentey/swift,sdulal/swift,stephentyrone/swift,tardieu/swift,johnno1962d/swift,brentdax/swift,huonw/swift,tkremenek/swift,jopamer/swift,stephentyrone/swift,modocache/swift,huonw/swift,therealbnut/swift,frootloops/swift,SwiftAndroid/swift,jtbandes/swift,gottesmm/swift,codestergit/swift,Jnosh/swift,gregomni/swift,atrick/swift,emilstahl/swift,shahmishal/swift,airspeedswift/swift,gribozavr/swift,uasys/swift,natecook1000/swift,return/swift,practicalswift/swift,slavapestov/swift,OscarSwanros/swift,swiftix/swift.old,tinysun212/swift-windows,OscarSwanros/swift,hughbe/swift,shajrawi/swift,nathawes/swift,tinysun212/swift-windows,jopamer/swift,hughbe/swift,rudkx/swift,tkremenek/swift,JaSpa/swift,gregomni/swift,jmgc/swift,parkera/swift,swiftix/swift.old,austinzheng/swift,Ivacker/swift,practicalswift/swift,milseman/swift,Ivacker/swift,mightydeveloper/swift,CodaFi/swift,deyton/swift,xedin/swift,jtbandes/swift,arvedviehweger/swift,kperryua/swift,apple/swift,swiftix/swift,alblue/swift,JGiola/swift,Ivacker/swift,danielmartin/swift,dduan/swift,amraboelela/swift,nathawes/swift,khizkhiz/swift,aschwaighofer/swift,airspeedswift/swift,IngmarStein/swift,xedin/swift,JGiola/swift,roambotics/swift,austinzheng/swift,khizkhiz/swift,ahoppen/swift,gmilos/swift,calebd/swift,karwa/swift,adrfer/swift,uasys/swift,emilstahl/swift,codestergit/swift,swiftix/swift.old,frootloops/swift,codestergit/swift,ken0nek/swift,jmgc/swift,zisko/swift,alblue/swift,milseman/swift,tjw/swift,brentdax/swift,russbishop/swift,felix91gr/swift,practicalswift/swift,shahmishal/swift |
a879a164495db6daa4d809fbaba1617c9ade5919 | test/Driver/mips-long-double.c | test/Driver/mips-long-double.c | // RUN: %clang_cc1 -triple mips64-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-linux-std=c11 -verify %s
// RUN: %clang_cc1 -triple mips64-unknown-linux-std=c11 -verify %s
// expected-no-diagnostics
#ifdef _ABI64
# ifdef __FreeBSD__
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
# else
_Static_assert(sizeof(long double) == 16, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 16, "alignof long double is wrong");
# endif
#else
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
#endif
| // RUN: %clang_cc1 -triple mips64-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-linux -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips64-unknown-linux -std=c11 -verify %s
// expected-no-diagnostics
#ifdef _ABI64
# ifdef __FreeBSD__
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
# else
_Static_assert(sizeof(long double) == 16, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 16, "alignof long double is wrong");
# endif
#else
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
#endif
| Add missing spaces. This doesn't cause problems in practice because we only warn about _Static_assert with -pedantic. | Add missing spaces. This doesn't cause problems in practice because we only warn
about _Static_assert with -pedantic.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@171860 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
90de5eb32b7edd7107ad5ab7c083d55ee84bee83 | 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 107
#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 108
#endif
| Update Skia milestone to 108 | Update Skia milestone to 108
Change-Id: I9b44ccf2c942eefbb9992e0a130690c8d24116ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/581916
Commit-Queue: Heather Miller <[email protected]>
Auto-Submit: Rakshit Sharma <[email protected]>
Reviewed-by: Rakshit Sharma <[email protected]>
Reviewed-by: Heather Miller <[email protected]>
| C | bsd-3-clause | google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia |
55662d5c57bbd169747d58cd26319062054a6303 | kernel/core/main.c | kernel/core/main.c | #include <truth/cpu.h>
#include <truth/types.h>
#include <truth/log.h>
#include <truth/physical_allocator.h>
void kernel_main(void *multiboot_tables) {
init_interrupts();
enum status unused(status) = init_log("log");
init_physical_allocator(multiboot_tables);
logf("The Kernel of Truth\n\tVersion %d.%d.%d\n\tCommit %s\n", kernel_major, kernel_minor, kernel_patch, vcs_version);
halt();
}
| #include <truth/cpu.h>
#include <truth/types.h>
#include <truth/log.h>
#include <truth/physical_allocator.h>
void kernel_main(void *multiboot_tables) {
init_interrupts();
enum status unused(status) = init_log("log");
init_physical_allocator(multiboot_tables);
logf("The Kernel of Truth\n\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n",
kernel_major, kernel_minor, kernel_patch, vcs_version,
project_website);
halt();
}
| Add project website to startup message | Add project website to startup message
| C | mit | iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth |
e2db3e62cfe0e413b0497a345c6d5bf03097974a | DOM/TKDOMMaker.h | DOM/TKDOMMaker.h | //
// TKDOMProxyMaker.h
// TumblKitNG
//
// Created by uasi on 09/10/31.
// Copyright 2009 99cm.org. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import <ActorKit/ActorKit.h>
// TKDOMMaker
//
// Make a DOMDocument from given URL synchronously
//
@interface TKDOMMaker : NSObject {
NSMutableSet *workerPool_;
}
+ (id)DOMMaker;
// NOTE:
// - Do NOT perform newDOMDocumentWithURLString on the main thread
// - Returned DOMDocument MUST be released with releaseDOM:
//
- (DOMDocument *)newDOMDocumentWithURLString:(NSString *)URLString;
- (void)releaseDOM:(id)object;
@end
| //
// TKDOMProxyMaker.h
// TumblKitNG
//
// Created by uasi on 09/10/31.
// Copyright 2009 99cm.org. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import <ActorKit/ActorKit.h>
// TKDOMMaker
//
// Make a DOMDocument from given URL synchronously
//
@interface TKDOMMaker : NSObject {
}
+ (id)DOMMaker;
// NOTE:
// - Do NOT perform newDOMDocumentWithURLString on the main thread
// - Returned DOMDocument MUST be released with releaseDOM:
//
- (DOMDocument *)newDOMDocumentWithURLString:(NSString *)URLString;
- (void)releaseDOM:(id)object;
@end
| Remove unused instance variable 'workerPool_' | Remove unused instance variable 'workerPool_'
| C | bsd-2-clause | uasi/tumblkit,uasi/tumblkit |
9c0c3451a66ad78dad1c9394d38a2a3be2dc89df | src/helpers/TimingHelpers.h | src/helpers/TimingHelpers.h | /*
Copyright (C) 2015 George White <[email protected]>, All rights reserved.
See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details.
*/
// ******************* Timing helpers *******************
void startTimer(long &timer) {
timer = millis();
}
boolean isTimerExpired(long &timer, int expiration) {
long current = millis() - timer;
return current > expiration;
}
void clearTimer(long &timer) {
timer = 0;
}
| /*
Copyright (C) 2015 George White <[email protected]>, All rights reserved.
See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details.
*/
// ******************* Timing helpers *******************
void startTimer(long &timer) {
timer = millis();
}
boolean isTimerExpired(long &timer, long expiration) {
long current = millis() - timer;
return current > expiration;
}
void clearTimer(long &timer) {
timer = 0;
}
| Fix bug in timing helper | Fix bug in timing helper | C | mit | stonehippo/tankbot,stonehippo/tankbot |
ddff322b329ad4425fc5bd53a7c911a6709c98ae | lib/neatogen/multispline.h | lib/neatogen/multispline.h | /* $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 *
**********************************************************/
#ifndef MULTISPLINE_H
#define MULTISPLINE_H
#include <render.h>
#include <pathutil.h>
typedef struct router_s router_t;
extern void freeRouter (router_t* rtr);
extern router_t* mkRouter (Ppoly_t** obs, int npoly);
extern int makeMultiSpline(edge_t* e, router_t * rtr, int);
#endif
| Add support for edge routing to ports on the periphery of nodes, and splines for multiedges. | Add support for edge routing to ports on the periphery of nodes,
and splines for multiedges.
| C | epl-1.0 | BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,kbrock/graphviz,kbrock/graphviz,BMJHayward/graphviz,jho1965us/graphviz,tkelman/graphviz,MjAbuz/graphviz,tkelman/graphviz,BMJHayward/graphviz,kbrock/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,tkelman/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,pixelglow/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,ellson/graphviz,tkelman/graphviz,ellson/graphviz,BMJHayward/graphviz,tkelman/graphviz,tkelman/graphviz |
|
237c7004130c08be3ea1a06d0e5ac76b1a153e5a | peer_testing.h | peer_testing.h | #ifndef CJET_PEER_TESTING_H
#define CJET_PEER_TESTING_H
#ifdef TESTING
#define READ \
fake_read
#else
#define READ \
read
#endif
#endif
| #ifndef CJET_PEER_TESTING_H
#define CJET_PEER_TESTING_H
#ifdef TESTING
#ifdef __cplusplus
extern "C" {
#endif
ssize_t fake_read(int fd, void *buf, size_t count);
#ifdef __cplusplus
}
#endif
#define READ \
fake_read
#else
#define READ \
read
#endif
#endif
| Add "extern C" stuff for clean compile of tests. | Add "extern C" stuff for clean compile of tests.
| C | mit | mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet |
2b7d5dd221477e233f77c8c729ee34f61600cfca | es-app/src/EmulationStation.h | es-app/src/EmulationStation.h | #pragma once
// These numbers and strings need to be manually updated for a new version.
// Do this version number update as the very last commit for the new release version.
#define PROGRAM_VERSION_MAJOR 2
#define PROGRAM_VERSION_MINOR 0
#define PROGRAM_VERSION_MAINTENANCE 1
#define PROGRAM_VERSION_STRING "2.0.1a"
#define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__
#define RESOURCE_VERSION_STRING "2,0,1\0"
#define RESOURCE_VERSION PROGRAM_VERSION_MAJOR,PROGRAM_VERSION_MINOR,PROGRAM_VERSION_MAINTENANCE
| #pragma once
// These numbers and strings need to be manually updated for a new version.
// Do this version number update as the very last commit for the new release version.
#define PROGRAM_VERSION_MAJOR 2
#define PROGRAM_VERSION_MINOR 0
#define PROGRAM_VERSION_MAINTENANCE 1
#define PROGRAM_VERSION_STRING "2.0.1b SDL mod by Krejza9"
#define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__
#define RESOURCE_VERSION_STRING "2,0,1\0"
#define RESOURCE_VERSION PROGRAM_VERSION_MAJOR,PROGRAM_VERSION_MINOR,PROGRAM_VERSION_MAINTENANCE
| Update version to 2.0.1b SDL mod by Krejza9. | Update version to 2.0.1b SDL mod by Krejza9. | C | mit | Krejza9/EmulationStation-sdlmixer,Krejza9/EmulationStation-sdlmixer,Krejza9/EmulationStation-sdlmixer |
ad9448408a5d2863db4aa2cb5d1f0d4a27689528 | IntelSiliconPkg/Include/IndustryStandard/FirmwareVersionInfo.h | IntelSiliconPkg/Include/IndustryStandard/FirmwareVersionInfo.h | /** @file
Intel Firmware Version Info (FVI) related definitions.
@todo: update document/spec reference
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Specification Reference:
System Management BIOS (SMBIOS) Reference Specification v3.0.0 dated 2015-Feb-12
http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0.pdf
**/
#ifndef __FIRMWARE_VERSION_INFO_H__
#define __FIRMWARE_VERSION_INFO_H__
#include <IndustryStandard/SmBios.h>
#define INTEL_FIRMWARE_VERSION_INFO_GROUP_NAME "Firmware Version Info"
#pragma pack(1)
///
/// Firmware Version Structure
///
typedef struct {
UINT8 MajorVersion;
UINT8 MinorVersion;
UINT8 Revision;
UINT16 BuildNumber;
} INTEL_FIRMWARE_VERSION;
///
/// Firmware Version Info (FVI) Structure
///
typedef struct {
SMBIOS_TABLE_STRING ComponentName; ///< String Index of Component Name
SMBIOS_TABLE_STRING VersionString; ///< String Index of Version String
INTEL_FIRMWARE_VERSION Version; ///< Firmware version
} INTEL_FIRMWARE_VERSION_INFO;
///
/// SMBIOS OEM Type Intel Firmware Version Info (FVI) Structure
///
typedef struct {
SMBIOS_STRUCTURE Header; ///< SMBIOS structure header
UINT8 Count; ///< Number of FVI entries in this structure
INTEL_FIRMWARE_VERSION_INFO Fvi[1]; ///< FVI structure(s)
} SMBIOS_TABLE_TYPE_OEM_INTEL_FVI;
#pragma pack()
#endif
| Add Intel Firmware Version Info (FVI) definitions | IntelSiliconPkg: Add Intel Firmware Version Info (FVI) definitions
Adding Intel Firmware Version Info (FVI) related defines & structures.
FVI enables reporting the Firmware Versions using SMBIOS OEM Type.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
|
c9b5c9177cf8e289da3459ef82770bac4c685e1b | misc/c_hex_esc.c | misc/c_hex_esc.c | /*
* Hex escapes in C code can be confusing; this is non-portable:
*
* const char *str = "\xffab";
*
* GCC will warn:
*
* warning: hex escape sequence out of range [enabled by default]
*
* To avoid this, you can e.g. use the following form:
*
* const char *str = "\xff" "ab";
*
* If the C hex escape is terminated by a character that cannot be a
* valid hex digit, there is no need for this (but breaking up the
* string is still good practice), e.g.:
*
* const char *str = "\xffquux";
*
* Another hex escape always terminates a previous hex escape. For
* instance, to write a user internal property constant with two
* leading 0xFF bytes:
*
* const char *str = "\xff\xff" "quux";
*/
#include <stdio.h>
int main(int argc, char *argv[]) {
const char *str = "\xffabcdef"; /* Generates a warning on GCC */
printf("%s\n", str);
return 0;
}
| Add an example of C string hex escape quirks | Add an example of C string hex escape quirks
| C | mit | eddieh/duktape,thurday/duktape,skomski/duktape,haosu1987/duktape,pombredanne/duktape,zeropool/duktape,markand/duktape,sloth4413/duktape,zeropool/duktape,eddieh/duktape,pombredanne/duktape,tassmjau/duktape,chenyaqiuqiu/duktape,harold-b/duktape,thurday/duktape,sloth4413/duktape,jmptrader/duktape,thurday/duktape,thurday/duktape,svaarala/duktape,markand/duktape,kphillisjr/duktape,jmptrader/duktape,reqshark/duktape,skomski/duktape,reqshark/duktape,nivertech/duktape,markand/duktape,kphillisjr/duktape,skomski/duktape,svaarala/duktape,jmptrader/duktape,rwaldron/duktape,harold-b/duktape,zeropool/duktape,svaarala/duktape,sloth4413/duktape,kphillisjr/duktape,kphillisjr/duktape,daimajia/duktape,jmptrader/duktape,svaarala/duktape,kphillisjr/duktape,sloth4413/duktape,svaarala/duktape,zeropool/duktape,nivertech/duktape,thurday/duktape,sloth4413/duktape,tassmjau/duktape,sloth4413/duktape,nivertech/duktape,sloth4413/duktape,jmptrader/duktape,chenyaqiuqiu/duktape,harold-b/duktape,eddieh/duktape,skomski/duktape,thurday/duktape,chenyaqiuqiu/duktape,daimajia/duktape,reqshark/duktape,rwaldron/duktape,daimajia/duktape,harold-b/duktape,chenyaqiuqiu/duktape,reqshark/duktape,haosu1987/duktape,zeropool/duktape,thurday/duktape,eddieh/duktape,svaarala/duktape,zeropool/duktape,reqshark/duktape,eddieh/duktape,markand/duktape,reqshark/duktape,harold-b/duktape,pombredanne/duktape,chenyaqiuqiu/duktape,rwaldron/duktape,nivertech/duktape,skomski/duktape,chenyaqiuqiu/duktape,chenyaqiuqiu/duktape,eddieh/duktape,haosu1987/duktape,markand/duktape,eddieh/duktape,eddieh/duktape,sloth4413/duktape,chenyaqiuqiu/duktape,jmptrader/duktape,reqshark/duktape,tassmjau/duktape,harold-b/duktape,jmptrader/duktape,harold-b/duktape,haosu1987/duktape,pombredanne/duktape,zeropool/duktape,chenyaqiuqiu/duktape,svaarala/duktape,reqshark/duktape,pombredanne/duktape,zeropool/duktape,nivertech/duktape,svaarala/duktape,pombredanne/duktape,haosu1987/duktape,harold-b/duktape,nivertech/duktape,rwaldron/duktape,daimajia/duktape,haosu1987/duktape,markand/duktape,pombredanne/duktape,haosu1987/duktape,tassmjau/duktape,nivertech/duktape,haosu1987/duktape,tassmjau/duktape,tassmjau/duktape,tassmjau/duktape,eddieh/duktape,daimajia/duktape,skomski/duktape,sloth4413/duktape,jmptrader/duktape,thurday/duktape,kphillisjr/duktape,eddieh/duktape,haosu1987/duktape,markand/duktape,markand/duktape,zeropool/duktape,svaarala/duktape,jmptrader/duktape,skomski/duktape,reqshark/duktape,daimajia/duktape,markand/duktape,pombredanne/duktape,jmptrader/duktape,kphillisjr/duktape,kphillisjr/duktape,harold-b/duktape,skomski/duktape,pombredanne/duktape,rwaldron/duktape,haosu1987/duktape,zeropool/duktape,markand/duktape,skomski/duktape,thurday/duktape,chenyaqiuqiu/duktape,harold-b/duktape,thurday/duktape,tassmjau/duktape,nivertech/duktape,reqshark/duktape,nivertech/duktape,kphillisjr/duktape,pombredanne/duktape,rwaldron/duktape,tassmjau/duktape,nivertech/duktape,skomski/duktape,tassmjau/duktape,kphillisjr/duktape,sloth4413/duktape |
|
4e24df1ba483b3028017176b08bc336b8ca79274 | AFToolkit/AFToolkit.h | AFToolkit/AFToolkit.h | //
// Toolkit header to include the main headers of the 'AFToolkit' library.
//
#pragma mark - Common Import
#import "AFLogHelper.h"
#import "AFFileHelper.h"
#import "AFPlatformHelper.h"
#import "AFKVO.h"
#import "AFArray.h"
#import "AFMutableArray.h"
#import "UITableViewCell+Universal.h"
#import "AFDBClient.h"
#import "AFView.h"
#import "AFViewController.h" | //
// Toolkit header to include the main headers of the 'AFToolkit' library.
//
#import "AFDefines.h"
#import "AFLogHelper.h"
#import "AFFileHelper.h"
#import "AFPlatformHelper.h"
#import "AFKVO.h"
#import "AFArray.h"
#import "AFMutableArray.h"
#import "UITableViewCell+Universal.h"
#import "AFDBClient.h"
#import "AFView.h"
#import "AFViewController.h" | Add defines header to toolkit header | Add defines header to toolkit header
| C | mit | mlatham/AFToolkit |
83cf9c9d6a93e0a651547662d556da840bf66b98 | testmud/mud/home/Game/sys/testd.c | testmud/mud/home/Game/sys/testd.c | #include <kotaka/paths.h>
#include <kotaka/log.h>
#include "~/test.h"
#include <status.h>
static void create()
{
}
void ignite(int count)
{
call_out("bomb", 0, count);
}
static void bomb(int quota)
{
int max;
max = (int)sqrt((float)quota);
if (quota % max != 0) {
max = quota % max;
}
if (max > quota) {
max = quota;
}
for (; quota > 0 && max > 0; quota--, max--) {
clone_object("~/obj/bomb");
}
LOGD->post_message("test", LOG_INFO, quota + " bombs left to clone.");
if (quota > 0) {
call_out("bomb", 0, quota);
}
}
| #include <kotaka/paths.h>
#include <kotaka/log.h>
#include "~/test.h"
#include <status.h>
static void create()
{
}
void ignite(int count)
{
call_out("bomb", 0, count);
}
void touchall()
{
int i;
LOGD->post_message("test", LOG_INFO, "Beginning touch");
call_out("do_touch", 0, status(ST_OTABSIZE) - 1);
}
static void do_touch(int quota)
{
int limit;
limit = 1024;
if (quota % limit != 0) {
limit = quota % limit;
}
for (; quota >= 0 && limit > 0; quota--, limit--) {
object bomb;
if (bomb = find_object("~/obj/bomb" + quota)) {
call_touch(bomb);
}
}
LOGD->post_message("test", LOG_INFO, quota + " objects left to check for touches.");
if (quota > 0) {
call_out("do_touch", 0, quota);
}
}
static void bomb(int quota)
{
int limit;
limit = 200;
for (; quota > 0 && limit > 0; quota--, limit--) {
clone_object("~/obj/bomb");
}
LOGD->post_message("test", LOG_INFO, quota + " bombs left to clone.");
if (quota > 0) {
call_out("bomb", 0, quota);
}
}
| Add call_touch to game test | Add call_touch to game test
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
ad7f53cdb35644304350b077a9ac11e5ec588036 | tests/include/alt-dummy/ecp_alt.h | tests/include/alt-dummy/ecp_alt.h | /* ecp_alt.h with dummy types for MBEDTLS_ECP_ALT */
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECP_ALT_H
#define ECP_ALT_H
typedef struct mbedtls_ecp_group
{
int dummy;
}
mbedtls_ecp_group;
#if !defined(MBEDTLS_ECP_WINDOW_SIZE)
#define MBEDTLS_ECP_WINDOW_SIZE 6
#endif
#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM)
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1
#endif
#endif /* ecp_alt.h */
| /* ecp_alt.h with dummy types for MBEDTLS_ECP_ALT */
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECP_ALT_H
#define ECP_ALT_H
typedef struct mbedtls_ecp_group
{
const mbedtls_ecp_group_id id;
const mbedtls_mpi P;
const mbedtls_mpi A;
const mbedtls_mpi B;
const mbedtls_ecp_point G;
const mbedtls_mpi N;
const size_t pbits;
const size_t nbits;
}
mbedtls_ecp_group;
#endif /* ecp_alt.h */
| Define public fields of mbedtls_ecp_group in alt test header | Define public fields of mbedtls_ecp_group in alt test header
And don't define configuration macros that only apply to the built-in
implementation.
Signed-off-by: Gilles Peskine <[email protected]>
| C | apache-2.0 | Mbed-TLS/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,NXPmicro/mbedtls |
192b4b9f4ff72f49c2b04255be5bf9f83c036b99 | SSPSolution/AIDLL/AIComponent.h | SSPSolution/AIDLL/AIComponent.h | #ifndef AIDLL_AI_AICOMPONENT_H
#define AIDLL_AI_AICOMPONENT_H
#include <DirectXMath.h>
struct AIComponent
{
int active = 0;
int entityID = -1;
int direction;
int currentPos;
int nextPos;
DirectX::XMVECTOR waypoints[8];
};
#endif | #ifndef AIDLL_AI_AICOMPONENT_H
#define AIDLL_AI_AICOMPONENT_H
#include <DirectXMath.h>
struct AIComponent
{
int active = 0;
int entityID = -1;
int direction;
int currentWaypoint;
int nextWaypoint;
DirectX::XMVECTOR waypoints[8];
};
#endif | UPDATE changes made to names of variables in the AIComopnent | UPDATE changes made to names of variables in the AIComopnent
| C | apache-2.0 | Chringo/SSP,Chringo/SSP |
45169603e17e944b18aa19f66602c32c54fbf90e | sploits/sploit1.c | sploits/sploit1.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "shellcode.h"
#define TARGET "/tmp/target2"
int main(void)
{
char *args[3];
char *env[1];
char buf[248];
memset(buf, 0x90, 248);
strncpy(buf+195, shellcode, 45);
strncpy(buf+244, "\x08\xfd\xff\xbf", 4);
//strncpy(buf+244, "\x12\x34\x56\x78", 4);
args[0] = TARGET;
args[1] = buf;
args[2] = NULL;
env[0] = NULL;
if (0 > execve(TARGET, args, env))
fprintf(stderr, "execve failed.\n");
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "shellcode.h"
#define TARGET "/tmp/target1"
int main(void)
{
char *args[3];
char *env[1];
char buf[248];
memset(buf, 0x90, 248);
strncpy(buf+195, shellcode, 45);
strncpy(buf+244, "\x08\xfd\xff\xbf", 4);
//strncpy(buf+244, "\x12\x34\x56\x78", 4);
args[0] = TARGET;
args[1] = buf;
args[2] = NULL;
env[0] = NULL;
if (0 > execve(TARGET, args, env))
fprintf(stderr, "execve failed.\n");
return 0;
}
| Make sure the sploit points to the correct target | Make sure the sploit points to the correct target | C | mit | somethingnew2-0/CS642-HW1 |
a4e756b0fb114822a5c2cc0c3a1ecd68308093a4 | KPNavViewController.h | KPNavViewController.h | #import <KPToolbox/KPViewController.h>
@class KPNavigationController;
@interface KPNavViewController : KPViewController
@property(readwrite, weak) KPNavigationController* navigationController;
@property(readwrite, strong) NSString* navigationTitle;
@property(readwrite, strong) NSButton* backButton;
@property(readwrite, strong) IBOutlet NSView* leftNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* centerNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* rightNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* navigationToolbar;
- (void) viewWillAppear: (BOOL) animated;
- (void) viewDidAppear: (BOOL) animated;
- (void) viewWillDisappear: (BOOL) animated;
- (void) viewDidDisappear: (BOOL) animated;
@end
| #import <KPToolbox/KPViewController.h>
@class KPNavigationController;
@interface KPNavViewController : KPViewController
@property(readwrite, weak) KPNavigationController* navigationController;
@property(readwrite, copy) NSString* navigationTitle;
@property(readwrite, strong) NSButton* backButton;
@property(readwrite, strong) IBOutlet NSView* leftNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* centerNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* rightNavigationBarView;
@property(readwrite, strong) IBOutlet NSView* navigationToolbar;
- (void) viewWillAppear: (BOOL) animated;
- (void) viewDidAppear: (BOOL) animated;
- (void) viewWillDisappear: (BOOL) animated;
- (void) viewDidDisappear: (BOOL) animated;
@end
| Use a copy property semantics instead of strong. | Use a copy property semantics instead of strong.
| C | mit | konstantinpavlikhin/KSPNavigationController |
223c87c1570327fc88dd8e98534aef9e1ac8c534 | AdjacentDifferenceStreamProvider.h | AdjacentDifferenceStreamProvider.h | #ifndef ADJACENT_DIFFERENCE_STREAM_PROVIDER_H
#define ADJACENT_DIFFERENCE_STREAM_PROVIDER_H
#include "StreamProvider.h"
#include "Utility.h"
template<typename T, typename Subtractor>
class AdjacentDifferenceStreamProvider
: public StreamProvider<ReturnType<Subtractor, T&, T&>> {
public:
using DiffType = ReturnType<Subtractor, T&, T&>;
AdjacentDifferenceStreamProvider(StreamProviderPtr<T> source,
Subtractor&& subtract)
: source_(std::move(source)), subtract_(subtract) {}
std::shared_ptr<DiffType> get() override {
return std::make_shared<DiffType>(subtract_(*second_, *first_));
}
bool advance() override {
if(first_advance_) {
first_advance_ = false;
if(source_->advance()) {
first_ = source_->get();
} else {
return false;
}
if(source_->advance()) {
second_ = source_->get();
} else {
first_.reset();
return false;
}
return true;
}
first_ = std::move(second_);
if(source_->advance()) {
second_ = source_->get();
return true;
}
first_.reset();
return false;
}
private:
StreamProviderPtr<T> source_;
Subtractor subtract_;
std::shared_ptr<T> first_;
std::shared_ptr<T> second_;
bool first_advance_ = true;
};
#endif
| #ifndef ADJACENT_DIFFERENCE_STREAM_PROVIDER_H
#define ADJACENT_DIFFERENCE_STREAM_PROVIDER_H
#include "StreamProvider.h"
#include "Utility.h"
template<typename T, typename Subtractor>
class AdjacentDifferenceStreamProvider
: public StreamProvider<ReturnType<Subtractor, T&, T&>> {
public:
using DiffType = ReturnType<Subtractor, T&, T&>;
AdjacentDifferenceStreamProvider(StreamProviderPtr<T> source,
Subtractor&& subtract)
: source_(std::move(source)), subtract_(subtract) {}
std::shared_ptr<DiffType> get() override {
return result_;
}
bool advance() override {
if(first_advance_) {
first_advance_ = false;
if(source_->advance()) {
first_ = source_->get();
} else {
return false;
}
if(source_->advance()) {
second_ = source_->get();
} else {
first_.reset();
return false;
}
result_ = std::make_shared<DiffType>(subtract_(*second_, *first_));
return true;
}
first_ = std::move(second_);
if(source_->advance()) {
second_ = source_->get();
result_ = std::make_shared<DiffType>(subtract_(*second_, *first_));
return true;
}
first_.reset();
result_.reset();
return false;
}
private:
StreamProviderPtr<T> source_;
Subtractor subtract_;
std::shared_ptr<T> first_;
std::shared_ptr<T> second_;
std::shared_ptr<DiffType> result_;
bool first_advance_ = true;
};
#endif
| Make adjacent difference getter consistent with other providers | Make adjacent difference getter consistent with other providers
| C | mit | jscheiny/Streams,respu/Streams,bowlofstew/Streams,bowlofstew/Streams,respu/Streams,jscheiny/Streams |
9496821bdda5defa93aa3ae2ea476b662fb729b5 | src/commands.h | src/commands.h | #ifndef LACO_COMMANDS_H
#define LACO_COMMANDS_H
struct LacoState;
typedef void (*LacoHandler)(struct LacoState* laco, const char** arguments);
struct LacoCommand {
const char** matches;
LacoHandler handler;
};
void laco_dispatch(const struct LacoCommand* commands,
struct LacoState* laco, const char* command_keyword,
const char** arguments);
/**
* Gets passed ever line to see if it matches one of the REPL command. If it
* does, that command will be executed.
*/
void laco_handle_command(struct LacoState* laco, char* line);
#endif /* LACO_COMMANDS_H */
| #ifndef LACO_COMMANDS_H
#define LACO_COMMANDS_H
struct LacoState;
typedef void (*LacoHandler)(struct LacoState* laco, const char** arguments);
struct LacoCommand {
const char** matches;
LacoHandler handler;
};
/**
* Goes through each instance from the list of commands and see if there is
* a match with for command_keyword. When there is a match, the defined
* handler inside the LacoCommand gets called -- passing in LacoState and
* the arguments. The list of commands expects the last entry of the array
* to be `{ NULL, NULL }` for ease of iteration.
*/
void laco_dispatch(const struct LacoCommand* commands,
struct LacoState* laco, const char* command_keyword,
const char** arguments);
/**
* Gets passed ever line to see if it matches one of the REPL command. If it
* does, that command will be executed.
*/
void laco_handle_command(struct LacoState* laco, char* line);
#endif /* LACO_COMMANDS_H */
| Add documentation for the laco_dispatch function | Add documentation for the laco_dispatch function
| C | bsd-2-clause | sourrust/laco |
6420adb9d93a17d3d16ae17bb67b012273fa0e8d | sbr/context_del.c | sbr/context_del.c |
/*
* context_del.c -- delete an entry from the context/profile list
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
#include <h/mh.h>
/*
* Delete a key/value pair from the context/profile list.
* Return 0 if key is found, else return 1.
*/
int
context_del (char *key)
{
struct node *np, *pp;
for (np = m_defs, pp = NULL; np; pp = np, np = np->n_next) {
if (!strcasecmp (np->n_name ? np->n_name : "", key ? key : "")) {
if (!np->n_context)
admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name);
if (pp)
pp->n_next = np->n_next;
else
m_defs = np->n_next;
free (np->n_name);
if (np->n_field)
free (np->n_field);
free ((char *) np);
ctxflags |= CTXMOD;
return 0;
}
}
return 1;
}
|
/*
* context_del.c -- delete an entry from the context/profile list
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
#include <h/mh.h>
#include <h/utils.h>
/*
* Delete a key/value pair from the context/profile list.
* Return 0 if key is found, else return 1.
*/
int
context_del (char *key)
{
struct node *np, *pp;
for (np = m_defs, pp = NULL; np; pp = np, np = np->n_next) {
if (!strcasecmp (np->n_name ? np->n_name : "", key ? key : "")) {
if (!np->n_context)
admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name);
if (pp)
pp->n_next = np->n_next;
else
m_defs = np->n_next;
free (np->n_name);
mh_xfree(np->n_field);
free ((char *) np);
ctxflags |= CTXMOD;
return 0;
}
}
return 1;
}
| Replace `if (p) free(p)' with `mh_xfree(p)'. | Replace `if (p) free(p)' with `mh_xfree(p)'.
| C | bsd-3-clause | mcr/nmh,mcr/nmh |
7b2d21e3710781fa223d8200b59c841771ff73d3 | test/Analysis/array-struct.c | test/Analysis/array-struct.c | // RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
| // RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
| Append the test runs with '&&'. | Append the test runs with '&&'.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58851 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
f35eea985e4b20020c8a91533fcd769c5745662b | stm8/src/main.c | stm8/src/main.c | #include <stdint.h>
#include "stm8s208s.h"
void main(void)
{
MEMLOC(CLK_CKDIVR) = 0x00; // Set the frequency to 16 MHz
BITSET(CLK_PCKENR1, 7);
// Configure timer
// 1000 ticks per second
MEMLOC(TIM1_PSCRH) = (16000>>8);
MEMLOC(TIM1_PSCRL) = (uint8_t)(16000 & 0xff);
// Enable timer
MEMLOC(TIM1_CR1) = 0x01;
/* Set PB0 as output */
BITSET(PB_DDR, 0);
/* Set low speed mode */
BITRST(PB_CR2, 0);
/* Set Push/Pull mode */
BITSET(PB_CR1, 0);
for(;;)
{
if ((MEMLOC(TIM1_CNTRL)) % 1000 <= 500) {
BITTOG(PB_ODR, 0);
}
}
}
| #include <stdint.h>
#include "stm8s208s.h"
void main(void)
{
MEMLOC(CLK_CKDIVR) = 0x00; /* Set the frequency to 16 MHz */
BITSET(CLK_PCKENR1, 7); /* Enable clk to TIM1 */
// Configure timer
// 250 ticks per second
MEMLOC(TIM1_PSCRH) = (64000>>8);
MEMLOC(TIM1_PSCRL) = (uint8_t)(64000 & 0xff);
MEMLOC(TIM1_CR1) = 0x01; /* Enable timer */
BITSET(PB_DDR, 0); /* Set PB0 as output */
BITRST(PB_CR2, 0); /* Set low speed mode */
BITSET(PB_CR1, 0); /* Set Push/Pull mode */
for(;;) {
if ((MEMLOC(TIM1_CNTRL)) % 250 <= 125) {
BITTOG(PB_ODR, 0);
}
}
}
| Reduce ticks to 250 to use 8bit diff | Reduce ticks to 250 to use 8bit diff
| C | bsd-3-clause | spoorcc/docker_embedded,spoorcc/docker_embedded |
b675c4d898d18514312a867ffca73d09e438f7c0 | t/aget_value_t.c | t/aget_value_t.c | #include "maxminddb_test_helper.h"
void run_tests(int mode, const char *mode_desc)
{
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
lookup_string_ok(mmdb, ip, filename, mode_desc);
MMDB_entry_data_s entry_data;
char *lookup_path[] = { "array", "0", NULL };
int status = MMDB_aget_value(&result.entry, &entry_data, lookup_path);
cmp_ok(status, "==", MMDB_SUCCESS,
"status for MMDB_get_value() is MMDB_SUCCESS");
ok(entry_data.has_data, "found a value with MMDB_aget_value");
cmp_ok(entry_data.type, "==", MMDB_DATA_TYPE_UINT32,
"returned entry type is uint32");
cmp_ok(entry_data.uint32, "==", 1, "entry value is 1");
MMDB_close(mmdb);
free(mmdb);
}
int main(void)
{
plan(NO_PLAN);
for_all_modes(&run_tests);
done_testing();
}
| #include "maxminddb_test_helper.h"
void run_tests(int mode, const char *mode_desc)
{
const char *filename = "MaxMind-DB-test-decoder.mmdb";
const char *path = test_database_path(filename);
MMDB_s *mmdb = open_ok(path, mode, mode_desc);
free((void *)path);
const char *ip = "1.1.1.1";
MMDB_lookup_result_s result =
lookup_string_ok(mmdb, ip, filename, mode_desc);
MMDB_entry_data_s entry_data;
char *lookup_path[] = { "array", "0", NULL };
int status = MMDB_aget_value(&result.entry, &entry_data, lookup_path);
cmp_ok(status, "==", MMDB_SUCCESS,
"status for MMDB_aget_value() is MMDB_SUCCESS");
ok(entry_data.has_data, "found a value with MMDB_aget_value");
cmp_ok(entry_data.type, "==", MMDB_DATA_TYPE_UINT32,
"returned entry type is uint32");
cmp_ok(entry_data.uint32, "==", 1, "entry value is 1");
MMDB_close(mmdb);
free(mmdb);
}
int main(void)
{
plan(NO_PLAN);
for_all_modes(&run_tests);
done_testing();
}
| Fix typo in test description | Fix typo in test description
| C | apache-2.0 | maxmind/libmaxminddb,maxmind/libmaxminddb,maxmind/libmaxminddb |
8afc766b82b045474873b2c6365bd31b449749ef | src/os.h | src/os.h | //
// Created by dar on 1/29/16.
//
#ifndef C003_OS_H
#define C003_OS_H
enum class OS {
WIN32 = 0,
UNIX,
ANDROID,
APPLE
};
constexpr const OS OPERATING_SYTEM =
#ifdef _WIN32
OS::WIN32
#elif __APPLE__
OS::APPLE
#elif __ANDROID__
OS::ANDROID
#elif __unix__
OS::UNIX
#endif
;
constexpr const bool IS_MOBILE = OPERATING_SYTEM == OS::ANDROID || OPERATING_SYTEM == OS::APPLE;
#endif //C003_OS_H
| //
// Created by dar on 1/29/16.
//
#ifndef C003_OS_H
#define C003_OS_H
enum class OS {
WIN32 = 0,
UNIX,
ANDROID,
IOS,
MAC
};
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
constexpr const OS OPERATING_SYTEM =
#ifdef _WIN32
OS::WIN32
#elif __APPLE__
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
OS::IOS
#elif TARGET_OS_MAC
OS::MAC
#else
#error "Unknown Apple platform"
#endif
#elif __ANDROID__
OS::ANDROID
#elif __unix__
OS::UNIX
#else
#error "Unknown platform"
#endif
;
constexpr const bool IS_MOBILE = OPERATING_SYTEM == OS::ANDROID || OPERATING_SYTEM == OS::IOS;
#endif //C003_OS_H
| Split APPLE operating system to IOS and MAC | Split APPLE operating system to IOS and MAC
| C | mit | darsto/spooky,darsto/spooky |
cd8b79f334adff93acea8dfe586d61bb7eaec3e4 | src/phys_const.h | src/phys_const.h | #ifndef LIBEFP_PHYS_CONST_H
#define LIBEFP_PHYS_CONST_H
/* Bohr radius in angstroms */
#define BOHR_RADIUS 0.52917724924
#endif /* LIBEFP_PHYS_CONST_H */
| #ifndef LIBEFP_PHYS_CONST_H
#define LIBEFP_PHYS_CONST_H
/* Bohr radius in angstroms */
#define BOHR_RADIUS 0.52917721092
#endif /* LIBEFP_PHYS_CONST_H */
| Use value from CODATA 2010. | Use value from CODATA 2010.
| C | bsd-2-clause | libefp/libefp,libefp/libefp,libefp/libefp |
fea93e818380d4d9b3b68bc47509058f60b8cdb7 | src/arch/sparc/kernel/arch.c | src/arch/sparc/kernel/arch.c | /**
* @file
* @brief Implements ARCH interface for sparc processors
*
* @date 14.02.10
* @author Eldar Abusalimov
*/
#include <hal/arch.h>
#include <asm/cache.h>
#include <hal/ipl.h>
void arch_init(void) {
cache_enable();
}
void arch_idle(void) {
}
unsigned int arch_excep_disable(void) {
unsigned int ret;
unsigned int tmp;
__asm__ __volatile__ (
"rd %%psr, %0\n\t"
"andn %0, %2, %1\n\t"
"wr %1, 0, %%psr\n\t"
" nop; nop; nop\n"
: "=&r" (ret), "=r" (tmp)
: "i" (PSR_ET)
: "memory"
);
return ret;
}
void __attribute__ ((noreturn)) arch_shutdown(arch_shutdown_mode_t mode) {
ipl_disable();
arch_excep_disable();
asm ("ta 0");
while (1) {}
}
| /**
* @file
* @brief Implements ARCH interface for sparc processors
*
* @date 14.02.10
* @author Eldar Abusalimov
*/
#include <hal/arch.h>
#include <asm/cache.h>
#include <hal/ipl.h>
void arch_init(void) {
cache_enable();
}
void arch_idle(void) {
__asm__ __volatile__ ("wr %g0, %asr19");
}
unsigned int arch_excep_disable(void) {
unsigned int ret;
unsigned int tmp;
__asm__ __volatile__ (
"rd %%psr, %0\n\t"
"andn %0, %2, %1\n\t"
"wr %1, 0, %%psr\n\t"
" nop; nop; nop\n"
: "=&r" (ret), "=r" (tmp)
: "i" (PSR_ET)
: "memory"
);
return ret;
}
void __attribute__ ((noreturn)) arch_shutdown(arch_shutdown_mode_t mode) {
ipl_disable();
arch_excep_disable();
asm ("ta 0");
while (1) {}
}
| Add power down mode for idle circle | sparc: Add power down mode for idle circle | C | bsd-2-clause | abusalimov/embox,mike2390/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,embox/embox,embox/embox,abusalimov/embox,gzoom13/embox,gzoom13/embox,Kakadu/embox,mike2390/embox,mike2390/embox,embox/embox,gzoom13/embox,Kefir0192/embox,Kakadu/embox,Kakadu/embox,Kefir0192/embox,gzoom13/embox,mike2390/embox,Kakadu/embox,Kefir0192/embox,abusalimov/embox,abusalimov/embox,Kakadu/embox,vrxfile/embox-trik,embox/embox,gzoom13/embox,Kefir0192/embox,Kefir0192/embox,mike2390/embox,abusalimov/embox,vrxfile/embox-trik,mike2390/embox,vrxfile/embox-trik,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,Kefir0192/embox,vrxfile/embox-trik,embox/embox,mike2390/embox,embox/embox,Kakadu/embox,gzoom13/embox |
5527ee34788794f84b8730d01eb8383aa898fd59 | include/mintpack/random.h | include/mintpack/random.h | #ifndef __MINTPACK_RANDOM_H__
#define __MINTPACK_RANDOM_H__
#include <mintomic/mintomic.h>
//-------------------------------------
// PRNG that seeds itself using various information from the environment.
// generate() is uniformly distributed across all 32-bit integer values.
// generateUnique() returns unique integers 2^32 times in a row, then repeats the sequence.
//-------------------------------------
class Random
{
private:
static const int kNumOffsets = 8;
static mint_atomic32_t m_sharedCounter;
uint32_t m_value;
uint32_t m_offsets[kNumOffsets];
public:
Random();
uint32_t generate32();
uint32_t generateUnique32();
uint64_t generate64()
{
return (((uint64_t) generate32()) << 32) | generate32();
}
};
#endif // __MINTPACK_RANDOM_H__
| #ifndef __MINTPACK_RANDOM_H__
#define __MINTPACK_RANDOM_H__
#include <mintomic/mintomic.h>
//-------------------------------------
// PRNG that seeds itself using various information from the environment.
// generate32() is uniformly distributed across all 32-bit integer values.
// generateUnique32() returns unique integers 2^32 times in a row, then repeats the sequence.
//-------------------------------------
class Random
{
private:
static const int kNumOffsets = 8;
static mint_atomic32_t m_sharedCounter;
uint32_t m_value;
uint32_t m_offsets[kNumOffsets];
public:
Random();
uint32_t generate32();
uint32_t generateUnique32();
uint64_t generate64()
{
return (((uint64_t) generate32()) << 32) | generate32();
}
};
#endif // __MINTPACK_RANDOM_H__
| Fix function names in Random comment | Fix function names in Random comment
| C | bsd-3-clause | adream307/mintomic,UIKit0/mintomic,adream307/mintomic,mulle-nat/mintomic,mintomic/mintomic,mintomic/mintomic,mulle-nat/mintomic,UIKit0/mintomic |
a9623da05f8a2930fadafd27fe621b16886b259d | drivers/scsi/qla4xxx/ql4_version.h | drivers/scsi/qla4xxx/ql4_version.h | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k11"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k0"
| Update driver version to 5.04.00-k0 | [SCSI] qla4xxx: Update driver version to 5.04.00-k0
Signed-off-by: Vikas Chaudhary <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
0cd78c0a12ebc84b56a58016fbcc83aefba64e1a | fitz/base_time.c | fitz/base_time.c | #ifdef _WIN32
#include <time.h>
#include <winsock2.h>
#include <windows.h>
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
struct timeval;
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
unsigned __int64 tmpres = 0;
if (tv)
{
GetSystemTimeAsFileTime(&ft);
tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;
tmpres /= 10; /*convert into microseconds*/
/*converting file time to unix epoch*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}
return 0;
}
#else
void fz_gettimeofday_dummy() { }
#endif
| #ifdef _WIN32
#include <time.h>
#ifndef METRO
#include <winsock2.h>
#endif
#include <windows.h>
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
struct timeval;
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
unsigned __int64 tmpres = 0;
if (tv)
{
GetSystemTimeAsFileTime(&ft);
tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;
tmpres /= 10; /*convert into microseconds*/
/*converting file time to unix epoch*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}
return 0;
}
#else
void fz_gettimeofday_dummy() { }
#endif
| Tweak to allow building on metro. | Tweak to allow building on metro.
Limited testing seems to suggest that the only thing stopping the MuPDF
library building on metro seems to be the use of winsock.h.
| C | agpl-3.0 | hackqiang/mupdf,crow-misia/mupdf,knielsen/mupdf,lustersir/MuPDF,ArtifexSoftware/mupdf,lamemate/mupdf,flipstudio/MuPDF,FabriceSalvaire/mupdf-cmake,lolo32/mupdf-mirror,MokiMobility/muPDF,geetakaur/NewApps,sebras/mupdf,Kalp695/mupdf,kobolabs/mupdf,asbloomf/mupdf,hxx0215/MuPDFMirror,michaelcadilhac/pdfannot,tophyr/mupdf,hjiayz/forkmupdf,muennich/mupdf,benoit-pierre/mupdf,muennich/mupdf,xiangxw/mupdf,FabriceSalvaire/mupdf-v1.3,github201407/MuPDF,zeniko/mupdf,poor-grad-student/mupdf,flipstudio/MuPDF,ArtifexSoftware/mupdf,seagullua/MuPDF,MokiMobility/muPDF,knielsen/mupdf,ylixir/mupdf,github201407/MuPDF,PuzzleFlow/mupdf,derek-watson/mupdf,crow-misia/mupdf,wzhsunn/mupdf,kobolabs/mupdf,cgogolin/penandpdf,wzhsunn/mupdf,lustersir/MuPDF,Kalp695/mupdf,lamemate/mupdf,fluks/mupdf-x11-bookmarks,nqv/mupdf,hackqiang/mupdf,github201407/MuPDF,fluks/mupdf-x11-bookmarks,ccxvii/mupdf,sebras/mupdf,clchiou/mupdf,ArtifexSoftware/mupdf,ArtifexSoftware/mupdf,andyhan/mupdf,michaelcadilhac/pdfannot,derek-watson/mupdf,samturneruk/mupdf_secure_android,tribals/mupdf,wzhsunn/mupdf,Kalp695/mupdf,wild0/opened_mupdf,FabriceSalvaire/mupdf-v1.3,wild0/opened_mupdf,ArtifexSoftware/mupdf,issuestand/mupdf,TamirEvan/mupdf,muennich/mupdf,andyhan/mupdf,kobolabs/mupdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,robamler/mupdf-nacl,sebras/mupdf,muennich/mupdf,tribals/mupdf,issuestand/mupdf,hackqiang/mupdf,ccxvii/mupdf,ArtifexSoftware/mupdf,cgogolin/penandpdf,geetakaur/NewApps,asbloomf/mupdf,andyhan/mupdf,nqv/mupdf,loungeup/mupdf,hxx0215/MuPDFMirror,lustersir/MuPDF,wild0/opened_mupdf,fluks/mupdf-x11-bookmarks,seagullua/MuPDF,lamemate/mupdf,knielsen/mupdf,wzhsunn/mupdf,MokiMobility/muPDF,TamirEvan/mupdf,hjiayz/forkmupdf,github201407/MuPDF,nqv/mupdf,lolo32/mupdf-mirror,nqv/mupdf,samturneruk/mupdf_secure_android,PuzzleFlow/mupdf,loungeup/mupdf,Kalp695/mupdf,andyhan/mupdf,hjiayz/forkmupdf,hjiayz/forkmupdf,derek-watson/mupdf,hxx0215/MuPDFMirror,robamler/mupdf-nacl,sebras/mupdf,tribals/mupdf,seagullua/MuPDF,issuestand/mupdf,lustersir/MuPDF,Kalp695/mupdf,issuestand/mupdf,MokiMobility/muPDF,isavin/humblepdf,FabriceSalvaire/mupdf-cmake,samturneruk/mupdf_secure_android,clchiou/mupdf,hackqiang/mupdf,lolo32/mupdf-mirror,robamler/mupdf-nacl,FabriceSalvaire/mupdf-v1.3,wild0/opened_mupdf,github201407/MuPDF,isavin/humblepdf,zeniko/mupdf,tribals/mupdf,loungeup/mupdf,Kalp695/mupdf,hxx0215/MuPDFMirror,FabriceSalvaire/mupdf-v1.3,ziel/mupdf,zeniko/mupdf,cgogolin/penandpdf,zeniko/mupdf,tophyr/mupdf,lolo32/mupdf-mirror,TamirEvan/mupdf,hackqiang/mupdf,TamirEvan/mupdf,lamemate/mupdf,lolo32/mupdf-mirror,ziel/mupdf,muennich/mupdf,FabriceSalvaire/mupdf-cmake,geetakaur/NewApps,hjiayz/forkmupdf,robamler/mupdf-nacl,TamirEvan/mupdf,lolo32/mupdf-mirror,isavin/humblepdf,ccxvii/mupdf,lolo32/mupdf-mirror,flipstudio/MuPDF,knielsen/mupdf,ArtifexSoftware/mupdf,clchiou/mupdf,derek-watson/mupdf,benoit-pierre/mupdf,PuzzleFlow/mupdf,ylixir/mupdf,lamemate/mupdf,crow-misia/mupdf,MokiMobility/muPDF,samturneruk/mupdf_secure_android,poor-grad-student/mupdf,cgogolin/penandpdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,flipstudio/MuPDF,benoit-pierre/mupdf,MokiMobility/muPDF,andyhan/mupdf,flipstudio/MuPDF,isavin/humblepdf,geetakaur/NewApps,lustersir/MuPDF,FabriceSalvaire/mupdf-v1.3,isavin/humblepdf,FabriceSalvaire/mupdf-cmake,wzhsunn/mupdf,benoit-pierre/mupdf,xiangxw/mupdf,muennich/mupdf,clchiou/mupdf,ziel/mupdf,geetakaur/NewApps,michaelcadilhac/pdfannot,benoit-pierre/mupdf,derek-watson/mupdf,sebras/mupdf,asbloomf/mupdf,knielsen/mupdf,kobolabs/mupdf,benoit-pierre/mupdf,zeniko/mupdf,xiangxw/mupdf,isavin/humblepdf,PuzzleFlow/mupdf,PuzzleFlow/mupdf,tophyr/mupdf,michaelcadilhac/pdfannot,FabriceSalvaire/mupdf-v1.3,tophyr/mupdf,lustersir/MuPDF,wzhsunn/mupdf,ylixir/mupdf,samturneruk/mupdf_secure_android,TamirEvan/mupdf,michaelcadilhac/pdfannot,crow-misia/mupdf,tophyr/mupdf,geetakaur/NewApps,PuzzleFlow/mupdf,zeniko/mupdf,ylixir/mupdf,loungeup/mupdf,fluks/mupdf-x11-bookmarks,loungeup/mupdf,asbloomf/mupdf,ylixir/mupdf,github201407/MuPDF,tribals/mupdf,tophyr/mupdf,xiangxw/mupdf,poor-grad-student/mupdf,ziel/mupdf,fluks/mupdf-x11-bookmarks,xiangxw/mupdf,clchiou/mupdf,poor-grad-student/mupdf,crow-misia/mupdf,xiangxw/mupdf,loungeup/mupdf,isavin/humblepdf,ziel/mupdf,hjiayz/forkmupdf,andyhan/mupdf,kobolabs/mupdf,ArtifexSoftware/mupdf,issuestand/mupdf,knielsen/mupdf,seagullua/MuPDF,FabriceSalvaire/mupdf-cmake,seagullua/MuPDF,muennich/mupdf,Kalp695/mupdf,nqv/mupdf,cgogolin/penandpdf,crow-misia/mupdf,nqv/mupdf,hackqiang/mupdf,TamirEvan/mupdf,samturneruk/mupdf_secure_android,xiangxw/mupdf,kobolabs/mupdf,ziel/mupdf,ccxvii/mupdf,fluks/mupdf-x11-bookmarks,ylixir/mupdf,PuzzleFlow/mupdf,ccxvii/mupdf,tribals/mupdf,kobolabs/mupdf,robamler/mupdf-nacl,wild0/opened_mupdf,flipstudio/MuPDF,fluks/mupdf-x11-bookmarks,lamemate/mupdf,FabriceSalvaire/mupdf-cmake,clchiou/mupdf,ccxvii/mupdf,sebras/mupdf,derek-watson/mupdf,michaelcadilhac/pdfannot,wild0/opened_mupdf,cgogolin/penandpdf,wild0/opened_mupdf,TamirEvan/mupdf,asbloomf/mupdf,issuestand/mupdf,robamler/mupdf-nacl,asbloomf/mupdf,seagullua/MuPDF |
65a65f46dc4b8d2cf1ee83f05a280fdacbfd2416 | critmem.h | critmem.h | #ifndef CRITMEM_H
#define CRITMEM_H
#include <sys/types.h>
/*@only@*//*@out@*//*@notnull@*/ void *mycritmalloc(const char *f, long, size_t size,
const char *message);
/*@only@*//*@notnull@*/ void *mycritcalloc(const char *f, long, size_t size,
const char *message);
/*@only@*//*@out@*//*@notnull@*/ void *mycritrealloc(const char *f, long,
/*@null@*//*@only@*//*@out@*//*@returned@*/
void *a, size_t size,
const char *message);
/*@only@*/ char *mycritstrdup(const char *f, long, const char *,
const char *message);
#define critmalloc(a,b) mycritmalloc(__FILE__,(long)__LINE__,a,b)
#define critcalloc(a,b) mycritcalloc(__FILE__,(long)__LINE__,a,b)
#define critrealloc(a,b,c) mycritrealloc(__FILE__,(long)__LINE__,a,b,c)
#define critstrdup(a,b) mycritstrdup(__FILE__,(long)__LINE__,a,b)
#endif
| #ifndef CRITMEM_H
#define CRITMEM_H
#include "config.h"
#include <sys/types.h>
/*@only@*//*@out@*//*@notnull@*/ void *mycritmalloc(const char *f, long, size_t size,
const char *message);
/*@only@*//*@notnull@*/ void *mycritcalloc(const char *f, long, size_t size,
const char *message);
/*@only@*//*@out@*//*@notnull@*/ void *mycritrealloc(const char *f, long,
/*@null@*//*@only@*//*@out@*//*@returned@*/
void *a, size_t size,
const char *message);
/*@only@*/ char *mycritstrdup(const char *f, long, const char *,
const char *message);
#define critmalloc(a,b) mycritmalloc(__FILE__,(long)__LINE__,a,b)
#define critcalloc(a,b) mycritcalloc(__FILE__,(long)__LINE__,a,b)
#define critrealloc(a,b,c) mycritrealloc(__FILE__,(long)__LINE__,a,b,c)
#define critstrdup(a,b) mycritstrdup(__FILE__,(long)__LINE__,a,b)
#endif
| Include config.h, patch by Ralf Wildenhues. | Include config.h, patch by Ralf Wildenhues. | C | lgpl-2.1 | BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode |
ea88107869edaa94959d13d635d8077561942557 | test/Driver/arm-restrict-it.c | test/Driver/arm-restrict-it.c | // RUN: %clang -target arm-none-gnueabi -mrestrict-it -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-RESTRICTED < %t %s
// RUN: %clang -target armv8a-none-gnueabi -mrestrict-it -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-RESTRICTED < %t %s
// CHECK-RESTRICTED: "-backend-option" "-arm-restrict-it"
// RUN: %clang -target arm-none-gnueabi -mno-restrict-it -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s
// RUN: %clang -target armv8a-none-gnueabi -mno-restrict-it -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s
// CHECK-NO-RESTRICTED: "-backend-option" "-arm-no-restrict-it"
| Add test case for r194593 | Add test case for r194593
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@194606 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
|
979b40c26118cfc50d27eed458d71020e87dc629 | mcrouter/CyclesObserver.h | mcrouter/CyclesObserver.h | /*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <folly/experimental/fibers/ExecutionObserver.h>
#include "mcrouter/lib/cycles/Cycles.h"
namespace facebook { namespace memcache { namespace mcrouter {
class CyclesObserver : public folly::fibers::ExecutionObserver {
public:
void starting() noexcept override {
if (!cycles::start()) {
// Should never happen
DCHECK(false) << "There is already one cycles interval "
"active in this thread";
}
}
void stopped() noexcept override {
cycles::finish();
}
};
}}} // facebook::memcache::mcrouter
| /*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <folly/experimental/fibers/ExecutionObserver.h>
#include "mcrouter/lib/cycles/Cycles.h"
namespace facebook { namespace memcache { namespace mcrouter {
class CyclesObserver : public folly::fibers::ExecutionObserver {
public:
void starting(uintptr_t id) noexcept override {
if (!cycles::start()) {
// Should never happen
DCHECK(false) << "There is already one cycles interval "
"active in this thread";
}
}
void runnable(uintptr_t id) noexcept override {}
void stopped(uintptr_t id) noexcept override {
cycles::finish();
}
};
}}} // facebook::memcache::mcrouter
| Add 'runnable' callback to ExecutionObserver | Add 'runnable' callback to ExecutionObserver
Summary: Add a callback when a fiber becomes runnable
Test Plan: unit tests
Reviewed By: @andriigrynenko
Differential Revision: D2081306 | C | bsd-3-clause | synecdoche/mcrouter,yqzhang/mcrouter,tempbottle/mcrouter,easyfmxu/mcrouter,reddit/mcrouter,is00hcw/mcrouter,nvaller/mcrouter,is00hcw/mcrouter,easyfmxu/mcrouter,easyfmxu/mcrouter,tempbottle/mcrouter,leitao/mcrouter,leitao/mcrouter,facebook/mcrouter,facebook/mcrouter,nvaller/mcrouter,reddit/mcrouter,zhlong73/mcrouter,is00hcw/mcrouter,evertrue/mcrouter,zhlong73/mcrouter,evertrue/mcrouter,glensc/mcrouter,nvaller/mcrouter,easyfmxu/mcrouter,zhlong73/mcrouter,glensc/mcrouter,yqzhang/mcrouter,zhlong73/mcrouter,synecdoche/mcrouter,leitao/mcrouter,synecdoche/mcrouter,nvaller/mcrouter,reddit/mcrouter,yqzhang/mcrouter,facebook/mcrouter,reddit/mcrouter,evertrue/mcrouter,synecdoche/mcrouter,evertrue/mcrouter,is00hcw/mcrouter,yqzhang/mcrouter,tempbottle/mcrouter,glensc/mcrouter,tempbottle/mcrouter,leitao/mcrouter,facebook/mcrouter,glensc/mcrouter |
9882794a65d52a2d39738f941709a837098f7b5f | shellcode/syscall_inline.c | shellcode/syscall_inline.c | // gcc -mpreferred-stack-boundary=2 -ggdb syscall_inline.c -o syscall_inline
// syscall.s in inline asm: print to stdout and exit from inline assembler
#include <stdio.h>
void f() {
char* str = "hi\n";
__asm__(
// write str (first local variable, at %ebp-4)
"movl $4, %eax \n\t"
"movl $1, %ebx \n\t"
"movl -4(%ebp), %ecx \n\t"
"movl $3, %edx \n\t"
"int $0x80 \n\t"
// exit 0
"movl $1, %eax; \n\t"
"movl $0, %ebx; \n\t"
"int $0x80; \n\t"
);
}
int main(void) {
f();
// never called because exit
printf("skipped\n");
return 0;
}
| Make syscalls from C/inline assembler | Make syscalls from C/inline assembler
| C | mit | jwhitfieldseed/sandbox,jwhitfieldseed/sandbox,jwhitfieldseed/sandbox,jwhitfieldseed/sandbox |
|
e7e2501f33c89d23bd938fe9f57964cf3f2e276a | fw/libs/AdapterBoard/usb_commands.h | fw/libs/AdapterBoard/usb_commands.h | /* USB commands use the first byte as the 'type' variable.
* Subsequent bytes are generally the 'arguments'.
* So host->device usb packets usually look like:
* [command, arg1, arg2, 0, 0, ... , 0, 0]
* to which the device will respond with
* [CMD_ACK, command, 0, 0, 0 ..., 0, 0]
*
* The exception to this, are the commands which 'GET'
* For them host->device generally looks like:
* [command, 0, ..., 0, 0]
* to which the device responds
* [CMD_RESP, command, arg1, arg2, 0, ..., 0, 0]
* */
#ifndef USB_COMMANDS_H
#define USB_COMMANDS_H
#define CMD_ACK 0xAF
#define CMD_RESP 0xBF
#define CMD_BL_ON 0x10
#define CMD_BL_OFF 0x11
#define CMD_BL_LEVEL 0x12
#define CMD_BL_UP 0x13
#define CMD_BL_DOWN 0x14
#define CMD_BL_GET_STATE 0x1F
#define CMD_RGB_SET 0x20
#define CMD_RGB_GET 0x2F
#endif
| /* USB commands use the first byte as the 'type' variable.
* Subsequent bytes are generally the 'arguments'.
* So host->device usb packets usually look like:
* [command, arg1, arg2, 0, 0, ... , 0, 0]
* to which the device will respond with
* [CMD_ACK, command, 0, 0, 0 ..., 0, 0]
*
* The exception to this, are the commands which 'GET'
* For them host->device generally looks like:
* [command, 0, ..., 0, 0]
* to which the device responds
* [CMD_RESP, command, arg1, arg2, 0, ..., 0, 0]
* */
#ifndef USB_COMMANDS_H
#define USB_COMMANDS_H
#define CMD_ACK 0xAF
#define CMD_RESP 0xBF
#define CMD_BL_ON 0x10
#define CMD_BL_OFF 0x11
#define CMD_BL_LEVEL 0x12
#define CMD_BL_UP 0x13
#define CMD_BL_DOWN 0x14
#define CMD_BL_GET_STATE 0x1F
#define CMD_RGB_SET 0x20
#define CMD_RGB_GET 0x2F
#define IS_GET(x) (x == CMD_RGB_GET || x == CMD_BL_GET_STATE)
#endif
| Add a macro to determine whether a GET command | Add a macro to determine whether a GET command
| C | bsd-3-clause | OSCARAdapter/OSCAR,OSCARAdapter/OSCAR |
392db70fa268f52058018bc3b4fe672576e384e5 | ReactiveCocoaFramework/ReactiveCocoa/NSUserDefaults+RACSupport.h | ReactiveCocoaFramework/ReactiveCocoa/NSUserDefaults+RACSupport.h | //
// NSUserDefaults+RACSupport.h
// ReactiveCocoa
//
// Created by Matt Diephouse on 12/19/13.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@class RACChannelTerminal;
@interface NSUserDefaults (RACSupport)
// Creates and returns a terminal for binding the user defaults key.
//
// key - The user defaults key to create the channel terminal for.
//
// This makes it easy to bind a property to a default by assigning to
// `RACChannelTo`.
//
// The terminal will send the value of the user defaults key upon subscription.
//
// Returns a channel terminal.
- (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key;
@end
| //
// NSUserDefaults+RACSupport.h
// ReactiveCocoa
//
// Created by Matt Diephouse on 12/19/13.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@class RACChannelTerminal;
@interface NSUserDefaults (RACSupport)
/// Creates and returns a terminal for binding the user defaults key.
///
/// key - The user defaults key to create the channel terminal for.
///
/// This makes it easy to bind a property to a default by assigning to
/// `RACChannelTo`.
///
/// The terminal will send the value of the user defaults key upon subscription.
///
/// Returns a channel terminal.
- (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key;
@end
| Add a third slash for Xcode | Add a third slash for Xcode
| C | mit | dachaoisme/ReactiveCocoa,almassapargali/ReactiveCocoa,on99/ReactiveCocoa,itschaitanya/ReactiveCocoa,brightcove/ReactiveCocoa,tonyarnold/ReactiveCocoa,chao95957/ReactiveCocoa,zhiwen1024/ReactiveCocoa,Khan/ReactiveCocoa,cnbin/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,bencochran/ReactiveCocoa,jeelun/ReactiveCocoa,leelili/ReactiveCocoa,wpstarnice/ReactiveCocoa,mtxs007/ReactiveCocoa,xiaobing2007/ReactiveCocoa,DreamHill/ReactiveCocoa,beni55/ReactiveCocoa,hbucius/ReactiveCocoa,zhukaixy/ReactiveCocoa,nikita-leonov/ReactiveCocoa,emodeqidao/ReactiveCocoa,dachaoisme/ReactiveCocoa,ohwutup/ReactiveCocoa,hj3938/ReactiveCocoa,FelixYin66/ReactiveCocoa,tonyarnold/ReactiveCocoa,sdhzwm/ReactiveCocoa,Pikdays/ReactiveCocoa,koamac/ReactiveCocoa,Eveian/ReactiveCocoa,gabemdev/ReactiveCocoa,yizzuide/ReactiveCocoa,kevin-zqw/ReactiveCocoa,windgo/ReactiveCocoa,yoichitgy/ReactiveCocoa,ailyanlu/ReactiveCocoa,Farteen/ReactiveCocoa,rpowelll/ReactiveCocoa,yoichitgy/ReactiveCocoa,lixar/ReactiveCocoa,nikita-leonov/ReactiveCocoa,tzongw/ReactiveCocoa,tiger8888/ReactiveCocoa,200895045/ReactiveCocoa,sandyway/ReactiveCocoa,ShawnLeee/ReactiveCocoa,gengjf/ReactiveCocoa,hoanganh6491/ReactiveCocoa,jeelun/ReactiveCocoa,esttorhe/ReactiveCocoa,calebd/ReactiveCocoa,valleyman86/ReactiveCocoa,kevin-zqw/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,andersio/ReactiveCocoa,jaylib/ReactiveCocoa,yonekawa/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,eyu1988/ReactiveCocoa,xiaoliyang/ReactiveCocoa,cstars135/ReactiveCocoa,KuPai32G/ReactiveCocoa,JohnJin007/ReactiveCocoa,wangqi211/ReactiveCocoa,Pikdays/ReactiveCocoa,SuPair/ReactiveCocoa,bensonday/ReactiveCocoa,wangqi211/ReactiveCocoa,Remitly/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,jackywpy/ReactiveCocoa,tipbit/ReactiveCocoa,mxxiv/ReactiveCocoa,valleyman86/ReactiveCocoa,WEIBP/ReactiveCocoa,richeterre/ReactiveCocoa,zhigang1992/ReactiveCocoa,nickcheng/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,LHDsimon/ReactiveCocoa,ailyanlu/ReactiveCocoa,victorlin/ReactiveCocoa,buildo/ReactiveCocoa,ohwutup/ReactiveCocoa,richeterre/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,335g/ReactiveCocoa,koamac/ReactiveCocoa,j364960953/ReactiveCocoa,alvinvarghese/ReactiveCocoa,xiaoliyang/ReactiveCocoa,eyu1988/ReactiveCocoa,ceekayel/ReactiveCocoa,natestedman/ReactiveCocoa,stupidfive/ReactiveCocoa,Pingco/ReactiveCocoa,sugar2010/ReactiveCocoa,huiping192/ReactiveCocoa,zhiwen1024/ReactiveCocoa,chieryw/ReactiveCocoa,howandhao/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,liufeigit/ReactiveCocoa,isghe/ReactiveCocoa,kaylio/ReactiveCocoa,tornade0913/ReactiveCocoa,CQXfly/ReactiveCocoa,kaylio/ReactiveCocoa,jaylib/ReactiveCocoa,ShawnLeee/ReactiveCocoa,esttorhe/ReactiveCocoa,brightcove/ReactiveCocoa,tornade0913/ReactiveCocoa,monkeydbobo/ReactiveCocoa,zzzworm/ReactiveCocoa,isghe/ReactiveCocoa,tzongw/ReactiveCocoa,mattpetters/ReactiveCocoa,tornade0913/ReactiveCocoa,jrmiddle/ReactiveCocoa,OneSmallTree/ReactiveCocoa,terry408911/ReactiveCocoa,KuPai32G/ReactiveCocoa,fhchina/ReactiveCocoa,jsslai/ReactiveCocoa,sujeking/ReactiveCocoa,bscarano/ReactiveCocoa,BrooksWon/ReactiveCocoa,DreamHill/ReactiveCocoa,ericzhou2008/ReactiveCocoa,Rupert-RR/ReactiveCocoa,gabemdev/ReactiveCocoa,BlessNeo/ReactiveCocoa,libiao88/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,loupman/ReactiveCocoa,zzzworm/ReactiveCocoa,loupman/ReactiveCocoa,Ray0218/ReactiveCocoa,stupidfive/ReactiveCocoa,stevielu/ReactiveCocoa,ohwutup/ReactiveCocoa,tipbit/ReactiveCocoa,goodheart/ReactiveCocoa,KJin99/ReactiveCocoa,calebd/ReactiveCocoa,yizzuide/ReactiveCocoa,tonyli508/ReactiveCocoa,kevin-zqw/ReactiveCocoa,sujeking/ReactiveCocoa,llb1119/test,yonekawa/ReactiveCocoa,jianwoo/ReactiveCocoa,zhenlove/ReactiveCocoa,bensonday/ReactiveCocoa,bencochran/ReactiveCocoa,JohnJin007/ReactiveCocoa,goodheart/ReactiveCocoa,jianwoo/ReactiveCocoa,Liquidsoul/ReactiveCocoa,JohnJin007/ReactiveCocoa,icepy/ReactiveCocoa,ericzhou2008/ReactiveCocoa,terry408911/ReactiveCocoa,ShawnLeee/ReactiveCocoa,tiger8888/ReactiveCocoa,takeshineshiro/ReactiveCocoa,dachaoisme/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,CQXfly/ReactiveCocoa,CQXfly/ReactiveCocoa,dskatz22/ReactiveCocoa,victorlin/ReactiveCocoa,natestedman/ReactiveCocoa,Rupert-RR/ReactiveCocoa,yytong/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,pzw224/ReactiveCocoa,Ricowere/ReactiveCocoa,loupman/ReactiveCocoa,dz1111/ReactiveCocoa,hilllinux/ReactiveCocoa,AlanJN/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,fanghao085/ReactiveCocoa,wangqi211/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,fanghao085/ReactiveCocoa,on99/ReactiveCocoa,ztchena/ReactiveCocoa,ioshger0125/ReactiveCocoa,jrmiddle/ReactiveCocoa,huiping192/ReactiveCocoa,zzzworm/ReactiveCocoa,add715/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,fhchina/ReactiveCocoa,esttorhe/ReactiveCocoa,cogddo/ReactiveCocoa,rpowelll/ReactiveCocoa,tonyli508/ReactiveCocoa,natan/ReactiveCocoa,pzw224/ReactiveCocoa,gengjf/ReactiveCocoa,zhigang1992/ReactiveCocoa,bencochran/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,howandhao/ReactiveCocoa,ikesyo/ReactiveCocoa,ailyanlu/ReactiveCocoa,eyu1988/ReactiveCocoa,cstars135/ReactiveCocoa,jackywpy/ReactiveCocoa,gengjf/ReactiveCocoa,imkerberos/ReactiveCocoa,DreamHill/ReactiveCocoa,mtxs007/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,200895045/ReactiveCocoa,kiurentu/ReactiveCocoa,chao95957/ReactiveCocoa,SmartEncounter/ReactiveCocoa,hbucius/ReactiveCocoa,yoichitgy/ReactiveCocoa,OneSmallTree/ReactiveCocoa,pzw224/ReactiveCocoa,j364960953/ReactiveCocoa,stevielu/ReactiveCocoa,eliperkins/ReactiveCocoa,longv2go/ReactiveCocoa,Juraldinio/ReactiveCocoa,KuPai32G/ReactiveCocoa,brasbug/ReactiveCocoa,lixar/ReactiveCocoa,Juraldinio/ReactiveCocoa,libiao88/ReactiveCocoa,dz1111/ReactiveCocoa,smilypeda/ReactiveCocoa,luerhouhou/ReactiveCocoa,zzqiltw/ReactiveCocoa,ddc391565320/ReactiveCocoa,leichunfeng/ReactiveCocoa,huiping192/ReactiveCocoa,paulyoung/ReactiveCocoa,BlessNeo/ReactiveCocoa,sandyway/ReactiveCocoa,xumaolin/ReactiveCocoa,sandyway/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,leelili/ReactiveCocoa,AllanChen/ReactiveCocoa,jrmiddle/ReactiveCocoa,mattpetters/ReactiveCocoa,jsslai/ReactiveCocoa,jianwoo/ReactiveCocoa,andersio/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,BrooksWon/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,Ray0218/ReactiveCocoa,esttorhe/ReactiveCocoa,towik/ReactiveCocoa,libiao88/ReactiveCocoa,Rupert-RR/ReactiveCocoa,Eveian/ReactiveCocoa,taylormoonxu/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,qq644531343/ReactiveCocoa,ddc391565320/ReactiveCocoa,j364960953/ReactiveCocoa,sdhzwm/ReactiveCocoa,clg0118/ReactiveCocoa,AlanJN/ReactiveCocoa,dullgrass/ReactiveCocoa,dskatz22/ReactiveCocoa,JackLian/ReactiveCocoa,FelixYin66/ReactiveCocoa,mxxiv/ReactiveCocoa,walkingsmarts/ReactiveCocoa,takeshineshiro/ReactiveCocoa,koamac/ReactiveCocoa,bensonday/ReactiveCocoa,zhukaixy/ReactiveCocoa,calebd/ReactiveCocoa,ceekayel/ReactiveCocoa,huiping192/ReactiveCocoa,zxq3220122/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,WEIBP/ReactiveCocoa,hoanganh6491/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,zhaoguohui/ReactiveCocoa,335g/ReactiveCocoa,on99/ReactiveCocoa,isghe/ReactiveCocoa,tiger8888/ReactiveCocoa,dz1111/ReactiveCocoa,brasbug/ReactiveCocoa,windgo/ReactiveCocoa,ztchena/ReactiveCocoa,JackLian/ReactiveCocoa,Ethan89/ReactiveCocoa,SanChain/ReactiveCocoa,towik/ReactiveCocoa,buildo/ReactiveCocoa,AlanJN/ReactiveCocoa,jackywpy/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,BrooksWon/ReactiveCocoa,335g/ReactiveCocoa,leichunfeng/ReactiveCocoa,dullgrass/ReactiveCocoa,hj3938/ReactiveCocoa,hilllinux/ReactiveCocoa,longv2go/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,xulibao/ReactiveCocoa,AllanChen/ReactiveCocoa,stupidfive/ReactiveCocoa,liufeigit/ReactiveCocoa,200895045/ReactiveCocoa,Ethan89/ReactiveCocoa,mxxiv/ReactiveCocoa,emodeqidao/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,bscarano/ReactiveCocoa,add715/ReactiveCocoa,jam891/ReactiveCocoa,ikesyo/ReactiveCocoa,nickcheng/ReactiveCocoa,Liquidsoul/ReactiveCocoa,eliperkins/ReactiveCocoa,Remitly/ReactiveCocoa,Eveian/ReactiveCocoa,dskatz22/ReactiveCocoa,richeterre/ReactiveCocoa,KJin99/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,ioshger0125/ReactiveCocoa,SanChain/ReactiveCocoa,icepy/ReactiveCocoa,windgo/ReactiveCocoa,xiaobing2007/ReactiveCocoa,ceekayel/ReactiveCocoa,Carthage/ReactiveCocoa,smilypeda/ReactiveCocoa,Ray0218/ReactiveCocoa,itschaitanya/ReactiveCocoa,luerhouhou/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,cnbin/ReactiveCocoa,stevielu/ReactiveCocoa,towik/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,luerhouhou/ReactiveCocoa,beni55/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,xumaolin/ReactiveCocoa,xulibao/ReactiveCocoa,Khan/ReactiveCocoa,sugar2010/ReactiveCocoa,zzqiltw/ReactiveCocoa,vincentiss/ReactiveCocoa,leichunfeng/ReactiveCocoa,SmartEncounter/ReactiveCocoa,longv2go/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,zhiwen1024/ReactiveCocoa,hj3938/ReactiveCocoa,fanghao085/ReactiveCocoa,dullgrass/ReactiveCocoa,ddc391565320/ReactiveCocoa,tonyarnold/ReactiveCocoa,imkerberos/ReactiveCocoa,zhaoguohui/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,almassapargali/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,leelili/ReactiveCocoa,imkerberos/ReactiveCocoa,OneSmallTree/ReactiveCocoa,yizzuide/ReactiveCocoa,terry408911/ReactiveCocoa,walkingsmarts/ReactiveCocoa,Pikdays/ReactiveCocoa,taylormoonxu/ReactiveCocoa,chao95957/ReactiveCocoa,kiurentu/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,icepy/ReactiveCocoa,almassapargali/ReactiveCocoa,Remitly/ReactiveCocoa,chieryw/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,lixar/ReactiveCocoa,paulyoung/ReactiveCocoa,monkeydbobo/ReactiveCocoa,shaohung001/ReactiveCocoa,bscarano/ReactiveCocoa,BlessNeo/ReactiveCocoa,beni55/ReactiveCocoa,zhigang1992/ReactiveCocoa,zhenlove/ReactiveCocoa,qq644531343/ReactiveCocoa,taylormoonxu/ReactiveCocoa,mtxs007/ReactiveCocoa,FelixYin66/ReactiveCocoa,jeelun/ReactiveCocoa,Farteen/ReactiveCocoa,brasbug/ReactiveCocoa,takeshineshiro/ReactiveCocoa,jaylib/ReactiveCocoa,alvinvarghese/ReactiveCocoa,jam891/ReactiveCocoa,yytong/ReactiveCocoa,zhenlove/ReactiveCocoa,jam891/ReactiveCocoa,zhaoguohui/ReactiveCocoa,paulyoung/ReactiveCocoa,victorlin/ReactiveCocoa,wpstarnice/ReactiveCocoa,xulibao/ReactiveCocoa,xiaoliyang/ReactiveCocoa,sugar2010/ReactiveCocoa,cstars135/ReactiveCocoa,clg0118/ReactiveCocoa,goodheart/ReactiveCocoa,tonyli508/ReactiveCocoa,xumaolin/ReactiveCocoa,natan/ReactiveCocoa,natan/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,nikita-leonov/ReactiveCocoa,JackLian/ReactiveCocoa,Ricowere/ReactiveCocoa,ztchena/ReactiveCocoa,yytong/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,monkeydbobo/ReactiveCocoa,ericzhou2008/ReactiveCocoa,kaylio/ReactiveCocoa,WEIBP/ReactiveCocoa,sdhzwm/ReactiveCocoa,jsslai/ReactiveCocoa,Farteen/ReactiveCocoa,zhukaixy/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,kiurentu/ReactiveCocoa,cnbin/ReactiveCocoa,shaohung001/ReactiveCocoa,add715/ReactiveCocoa,brightcove/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,valleyman86/ReactiveCocoa,zxq3220122/ReactiveCocoa,natestedman/ReactiveCocoa,cogddo/ReactiveCocoa,nickcheng/ReactiveCocoa,smilypeda/ReactiveCocoa,vincentiss/ReactiveCocoa,KJin99/ReactiveCocoa,tzongw/ReactiveCocoa,wpstarnice/ReactiveCocoa,Carthage/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,jaylib/ReactiveCocoa,hilllinux/ReactiveCocoa,SuPair/ReactiveCocoa,itschaitanya/ReactiveCocoa,fhchina/ReactiveCocoa,cogddo/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,Ricowere/ReactiveCocoa,Ricowere/ReactiveCocoa,clg0118/ReactiveCocoa,buildo/ReactiveCocoa,qq644531343/ReactiveCocoa,hbucius/ReactiveCocoa,vincentiss/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,xiaobing2007/ReactiveCocoa,liufeigit/ReactiveCocoa,Juraldinio/ReactiveCocoa,rpowelll/ReactiveCocoa,andersio/ReactiveCocoa,sujeking/ReactiveCocoa,llb1119/test,SuPair/ReactiveCocoa,nickcheng/ReactiveCocoa,Pingco/ReactiveCocoa,hoanganh6491/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,zzqiltw/ReactiveCocoa,ioshger0125/ReactiveCocoa,Liquidsoul/ReactiveCocoa,chieryw/ReactiveCocoa,howandhao/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,Carthage/ReactiveCocoa,llb1119/test,eliperkins/ReactiveCocoa,Khan/ReactiveCocoa,walkingsmarts/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,LHDsimon/ReactiveCocoa,alvinvarghese/ReactiveCocoa,zxq3220122/ReactiveCocoa,mattpetters/ReactiveCocoa,Ethan89/ReactiveCocoa,shaohung001/ReactiveCocoa,yonekawa/ReactiveCocoa,LHDsimon/ReactiveCocoa,SanChain/ReactiveCocoa,Pingco/ReactiveCocoa,emodeqidao/ReactiveCocoa |
e8740f26827c1aed33005aac3862e6e7840ee72d | src/Puddle.c | src/Puddle.c | #include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0xE3, 0x7B, 0xFC, 0xE9, 0x30, 0xD7, 0x4B, 0xC3, 0x96, 0x93, 0x15, 0x0C, 0x35, 0xDC, 0xB8, 0x58 }
PBL_APP_INFO(MY_UUID,
"Template App", "Your Company",
1, 0, /* App version */
DEFAULT_MENU_ICON,
APP_INFO_STANDARD_APP);
Window window;
void handle_init(AppContextRef ctx) {
window_init(&window, "Window Name");
window_stack_push(&window, true /* Animated */);
}
void pbl_main(void *params) {
PebbleAppHandlers handlers = {
.init_handler = &handle_init
};
app_event_loop(params, &handlers);
}
| #include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0xE3, 0x7B, 0xFC, 0xE9, 0x30, 0xD7, 0x4B, 0xC3, 0x96, 0x93, 0x15, 0x0C, 0x35, 0xDC, 0xB8, 0x58 }
PBL_APP_INFO(MY_UUID,
"Puddle", "Jon Speicher",
0, 1, /* App version */
DEFAULT_MENU_ICON,
APP_INFO_STANDARD_APP);
Window window;
void handle_init(AppContextRef ctx) {
window_init(&window, "Puddle Main");
window_stack_push(&window, true /* Animated */);
}
void pbl_main(void *params) {
PebbleAppHandlers handlers = {
.init_handler = &handle_init
};
app_event_loop(params, &handlers);
}
| Change framework app name, comopany, version, and window debug | Change framework app name, comopany, version, and window debug
| C | mit | jonspeicher/Puddle,jonspeicher/Puddle,jonspeicher/Puddle |
9da39b0de57a9a7dfbc87379948d5c36c2c1078c | src/common.h | src/common.h | // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_COMMON_H_
#define SCALLOC_COMMON_H_
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
#define cache_aligned __attribute__((aligned(64)))
#define always_inline inline __attribute__((always_inline))
#define no_inline __attribute__((noinline))
always_inline size_t PadSize(size_t size, size_t multiple) {
return (size + multiple - 1) / multiple * multiple;
}
#endif // SCALLOC_COMMON_H_
| // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_COMMON_H_
#define SCALLOC_COMMON_H_
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
#define cache_aligned __attribute__((aligned(64)))
#define always_inline inline __attribute__((always_inline))
#define no_inline __attribute__((noinline))
const size_t kSystemPageSize = 4096;
always_inline size_t PadSize(size_t size, size_t multiple) {
return (size + multiple - 1) / multiple * multiple;
}
#endif // SCALLOC_COMMON_H_
| Add system page size constant. | Add system page size constant.
Signed-off-by: Michael Lippautz <[email protected]>
| C | bsd-2-clause | cksystemsgroup/scalloc,cksystemsgroup/scalloc,cksystemsgroup/scalloc |
041a67a595d4afb732a1b5cc97843b0b05d1cff0 | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
#define SK_SUPPORT_STROKEANDFILL
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| Add flag to stage API change | Add flag to stage API change
Test: make
Bug: 178700363
Change-Id: I15d678d3896efb896d1b87f11f32df7787a53577
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
05b95d853c0ba6c4c27755245a5cac26c9fd8937 | src/dsemem.h | src/dsemem.h | /* dsemem.h
*
* routines for managing a free list of DataStackEntry structs
*
*/
#ifndef _DSEMEM_H_
#define _DSEMEM_H_
#include "dataStackEntry.h"
DataStackEntry *dse_alloc(void);
void dse_free(DataStackEntry *dse);
#endif /* _DSEMEM_H_ */
| /*
* Copyright (c) 2013, Court of the University of Glasgow
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of the University of Glasgow nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* dsemem.h
*
* routines for managing a free list of DataStackEntry structs
*
*/
#ifndef _DSEMEM_H_
#define _DSEMEM_H_
#include "dataStackEntry.h"
DataStackEntry *dse_alloc(void);
void dse_free(DataStackEntry *dse);
#endif /* _DSEMEM_H_ */
| Add BSD 3-clause open source header | Add BSD 3-clause open source header
| C | bsd-3-clause | fergul/Cache,jsventek/Cache,jsventek/Cache,jsventek/Cache,fergul/Cache,fergul/Cache |
e9ee6c8da6a11aed867a9eadefd7a03c3b7e0b82 | src/sw/settings/include/primitives/sw/sw.settings.program_name.h | src/sw/settings/include/primitives/sw/sw.settings.program_name.h | #include <primitives/sw/settings_program_name.h>
#if defined(SW_EXECUTABLE)
EXPORT_FROM_EXECUTABLE
std::string getProgramName()
{
// this will trigger build error if executable forget to set
// PackageDefinitions = true;
#ifndef PACKAGE_NAME_CLEAN
#error "Set '.PackageDefinitions = true;' on your target."
#endif
return PACKAGE_NAME_CLEAN;
}
// use gitrev instead?
EXPORT_FROM_EXECUTABLE
std::string getVersionString()
{
std::string s;
s += ::sw::getProgramName();
s += " version ";
s += PACKAGE_VERSION;
s += "\n";
s += "assembled " __DATE__ " " __TIME__;
return s;
}
#endif
| #include <primitives/sw/settings_program_name.h>
#if defined(SW_EXECUTABLE) && !defined(SW_CUSTOM_PROGRAM_NAME)
EXPORT_FROM_EXECUTABLE
std::string getProgramName()
{
// this will trigger build error if executable forget to set
// PackageDefinitions = true;
#ifndef PACKAGE_NAME_CLEAN
#error "Set '.PackageDefinitions = true;' on your target."
#endif
return PACKAGE_NAME_CLEAN;
}
// use gitrev instead?
EXPORT_FROM_EXECUTABLE
std::string getVersionString()
{
std::string s;
s += ::sw::getProgramName();
s += " version ";
s += PACKAGE_VERSION;
s += "\n";
s += "assembled " __DATE__ " " __TIME__;
return s;
}
#endif
| Allow to define custom program name. | [sw.settings] Allow to define custom program name.
| C | mpl-2.0 | egorpugin/primitives,egorpugin/primitives |
12665d4150306223d969787e1b00ab0e99101976 | src/layers/embedding_reader.h | src/layers/embedding_reader.h | #pragma once
#include <fstream>
#include <string>
#include <vector>
#include "3rd_party/exception.h"
#include "common/definitions.h"
#include "common/utils.h"
#include "data/vocab.h"
#include "data/types.h"
#include "layers/param_initializers.h"
namespace marian {
class EmbeddingReader {
public:
EmbeddingReader() {}
std::vector<float> read(const std::string& fileName,
int dimVoc,
int dimEmb) {
std::ifstream embFile(fileName);
UTIL_THROW_IF2(!embFile.is_open(),
"Unable to open file with embeddings: " + fileName);
std::string line;
// Read the first line with two values: a number of words in the vocabulary
// and the length of embedding vector
std::getline(embFile, line);
std::vector<std::string> values;
Split(line, values);
UTIL_THROW_IF2(values.size() != 2,
"Unexpected format of the first line in file with embeddings");
UTIL_THROW_IF2(stoi(values[1]) != dimEmb,
"Unexpected length of embedding vectors");
// Read embedding vectors of words present in the vocabulary
std::unordered_map<Word, std::vector<float>> word2vec;
while(std::getline(embFile, line)) {
values.clear();
Split(line, values);
Word word = std::stoi(values.front());
// Skip unknown words, but not <unk> word
if(word == UNK_ID && values.front() != UNK_STR)
continue;
std::transform(values.begin() + 1,
values.end(),
word2vec[word].begin(),
[](const std::string& s) { return std::stof(s); });
}
std::vector<float> embs;
embs.reserve(dimVoc * dimEmb);
// Populate output vector with embedding
for(size_t word = 0; word < (size_t)dimVoc; ++word) {
auto pos = embs.begin() + (word * dimEmb);
if(word2vec.find(word) != word2vec.end()) {
embs.insert(pos, word2vec[word].begin(), word2vec[word].end());
} else {
// For words not occuring in the file use uniform distribution
std::vector<float> values;
values.reserve(dimEmb);
// @TODO: consider generating values once for all missing words and
// then use the generated numbers to bucket into embedding vectors
inits::distribution<std::uniform_real_distribution<float>>(
values, -0.1, 0.1);
embs.insert(pos, values.begin(), values.end());
}
}
return embs;
}
};
} // namespace marian
| Add reader for embedding vectors from word2vec | Add reader for embedding vectors from word2vec
| C | mit | emjotde/amunmt,amunmt/marian,emjotde/Marian,marian-nmt/marian-train,emjotde/amunn,DianaDespa/marian-train,DianaDespa/marian-train,amunmt/marian,DianaDespa/marian-train,emjotde/Marian,marian-nmt/marian-train,emjotde/amunn,DianaDespa/marian-train,emjotde/amunmt,DianaDespa/marian-train,emjotde/amunmt,emjotde/amunn,emjotde/amunmt,marian-nmt/marian-train,marian-nmt/marian-train,emjotde/amunn,marian-nmt/marian-train,amunmt/marian |
|
2d6ced93beb3c575ae99f56372be7425dd197dae | service/basis/common/primitiveResource/include/internal/AssertUtils.h | service/basis/common/primitiveResource/include/internal/AssertUtils.h | //******************************************************************
//
// Copyright 2015 Samsung Electronics All Rights Reserved.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// 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 __PRIMITIVERESOURCE_ASSERTUTILS_H
#define __PRIMITIVERESOURCE_ASSERTUTILS_H
#include <cstdint>
#include <octypes.h>
#include <PrimitiveException.h>
namespace OIC
{
namespace Service
{
inline void expectOCStackResult(OCStackResult actual, OCStackResult expected)
{
if (actual != expected)
{
throw PlatformException(actual);
}
}
inline void expectOCStackResultOK(OCStackResult actual)
{
expectOCStackResult(actual, OC_STACK_OK);
}
}
}
#endif // __PRIMITIVERESOURCE_ASSERTUTILS_H
| Add assertion util to handle OCStackResult code with exception | Add assertion util to handle OCStackResult code with exception
Change-Id: I574da5d88abef73bf89c800bdf2a1bc10460d1e4
Signed-off-by: coderhyme <[email protected]>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1249
Tested-by: jenkins-iotivity <[email protected]>
Reviewed-by: Uze Choi <[email protected]>
| C | apache-2.0 | santais/iotivity,santais/iotivity_1.1,iotivity/iotivity,WojciechLuczkow/iotivity,santais/iotivity_1.1,rzr/iotivity,santais/iotivity_1.1,tienfuc/iotivity-democlient-snap,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1,rzr/iotivity,santais/iotivity_1.1.0,santais/iotivity_1.1,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1.0,tienfuc/iotivity-democlient-snap,santais/iotivity,santais/iotivity_1.1,tienfuc/iotivity-democlient-snap,WojciechLuczkow/iotivity,santais/iotivity_1.1,rzr/iotivity,santais/iotivity,iotivity/iotivity,rzr/iotivity,WojciechLuczkow/iotivity,santais/iotivity,iotivity/iotivity,WojciechLuczkow/iotivity,iotivity/iotivity,santais/iotivity_1.1.0,santais/iotivity,WojciechLuczkow/iotivity,santais/iotivity_1.1.0,rzr/iotivity,tienfuc/iotivity-democlient-snap,tienfuc/iotivity-democlient-snap,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1.0,WojciechLuczkow/iotivity,rzr/iotivity,rzr/iotivity,WojciechLuczkow/iotivity,WojciechLuczkow/iotivity,iotivity/iotivity,santais/iotivity_1.1.0,iotivity/iotivity,santais/iotivity_1.1,santais/iotivity_1.1.0,tienfuc/iotivity-democlient-snap,santais/iotivity,iotivity/iotivity,santais/iotivity,iotivity/iotivity,tienfuc/iotivity-democlient-snap |
|
fb4154cc57191d47239dfa44036d50e467879373 | cpplib/mysociety_config.h | cpplib/mysociety_config.h | //
// mysociety_config.cpp:
// Read the terrible mySociety PHP format config files, as similar code for
// other languages.
//
// Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
// Email: [email protected]; WWW: http://www.mysociety.org/
//
// $Id: mysociety_error.h,v 1.4 2009-09-24 22:00:29 francis Exp $
//
#include "error.h"
#include <iostream>
#include <fstream>
void mysociety_read_conf(const std::string& mysociety_conf_file) {
setenv("MYSOCIETY_CONFIG_FILE_PATH", mysociety_conf_file.c_str(), 1);
std::string tmp_php_script = (boost::format("/tmp/c-php-mysociety-conf-%d") % getpid()).str();
{
std::ofstream out(tmp_php_script.c_str(), std::ios::out);
out <<
"#!/usr/bin/php\n"
"<?php\n"
"$b = get_defined_constants();\n"
"require(getenv(\"MYSOCIETY_CONFIG_FILE_PATH\"));\n"
"$a = array_diff_assoc(get_defined_constants(), $b);\n"
"foreach ($a as $k => $v) {\n"
" print \"$k=$v\\n\";\n"
"}\n"
"?>\n";
}
chmod(tmp_php_script.c_str(), 0555);
FILE * f = popen(tmp_php_script.c_str(), "r");
if (f == 0) {
throw Exception("Couldn't open temporary mySociety conf PHP script");
}
const int BUFSIZE = 2048;
char buf[BUFSIZE];
while(fgets(buf, BUFSIZE, f)) {
std::string line = std::string(buf);
std::string::size_type found = line.find_first_of("=");
if (found == std::string::npos) {
throw Exception("config output had line without = in it");
}
std::string key = line.substr(0, found);
std::string value = line.substr(found + 1, line.size() - found - 2);
debug_log(boost::format("mySociety config loaded: %s %s") % key % value);
setenv(key.c_str(), value.c_str(), 1);
}
pclose(f);
}
| Include dependencies, remove excess debugging. | Include dependencies, remove excess debugging.
| C | agpl-3.0 | MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg |
|
0d062b5d2f63e051cafde0eded86309fca2ad005 | 5_TimerExternalClockCounter.c | 5_TimerExternalClockCounter.c | /*
* main.c
*
* Created on: 2 Nov 2016
* Author: rafpe
*/
#include "stm32f4xx.h"
#include "stm32f407xx.h"
int main(void)
{
volatile uint32_t delay;
RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOAEN; // enable the clock for GPIOs
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN | RCC_APB2ENR_TIM1EN; // enable SYSCFG for external interrupts & TIM1
__DSB(); // Data Synchronization Barrier
GPIOD->MODER = (1 << 26); // PIND to output mode
GPIOE->MODER = GPIO_MODER_MODER1_0; // PE1 - output
/*
* We start off with setting this is AF. Once done we map it to AF.
* PA8 to be used as alternate function TIM1_CH1
*
* AF details you always find in datasheet
* AF mapping you will find in RM
*/
GPIOA->MODER |= GPIO_MODER_MODER8_1; // PA8 - AF
GPIOA->AFR[1] = ( (GPIOA->AFR[1] && 0xFFFFFFF0 ) | 0x1);
TIM1->CCMR1 = TIM_CCMR1_CC1S_0; // CC1 channel is configured as output
TIM1->CCER = TIM_CCER_CC1P |
TIM_CCER_CC1NP; // Set up rising edge polarity
TIM1->SMCR = TIM_SMCR_TS_0 | TIM_SMCR_TS_2 | // Filtered Timer Input 1 (TI1FP1)
TIM_SMCR_SMS; // External Clock Mode 1
TIM1->ARR = 10; // How many values we will count
TIM1->DIER = TIM_DIER_UIE; // Update Event Interrupt
TIM1->CR1 = TIM_CR1_CEN; // Enable & Start timer
NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn); // Set up interrupt handler
SysTick_Config(1600000);
while (1)
{
} /* while */
} /* main */
void TIM1_UP_TIM10_IRQHandler(void)
{
if (TIM1->SR & TIM_SR_UIF)
{
GPIOD->ODR ^= (1 << 13); // Blink
TIM1->SR = ~TIM_SR_UIF; // clear flag - rc_w0 => Read Clear Write 0
}
}
void SysTick_Handler(void)
{
GPIOE->ODR ^= (1 << 1); // PE1 - flapp
}
| Add timer with external clock count | Add timer with external clock count
| C | apache-2.0 | RafPe/STM32F407VGTx-examples |
|
3b2a9a00dd4267fcffd370390037001f912347a3 | src/cxa_atexit.c | src/cxa_atexit.c | #ifdef __sun__
#include <pthread.h>
#include <stdlib.h>
static struct atexit_handler {
void (*f)(void *);
void *p;
void *d;
struct atexit_handler *next;
} *head;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
int __cxa_atexit( void (*f)(void *), void *p, void *d) {
pthread_mutex_lock(&lock);
struct atexit_handler *h = malloc(sizeof(*d));
if (!h) {
pthread_mutex_unlock(&lock);
return 1;
}
h->f = f;
h->p = p;
h->d = d;
h->next = head;
head = h;
pthread_mutex_unlock(&lock);
return 0;
}
void __cxa_finalize(void *d ) {
pthread_mutex_lock(&lock);
struct atexit_handler **last = &head;
for (struct atexit_handler *h = head ; h ; h = h->next) {
if ((h->d == d) || (d == 0)) {
*last = h->next;
h->f(h->p);
free(h);
} else {
last = &head->next;
}
}
pthread_mutex_unlock(&lock);
}
#endif
| #ifdef __sun__
#include <pthread.h>
#include <stdlib.h>
static struct atexit_handler {
void (*f)(void *);
void *p;
void *d;
struct atexit_handler *next;
} *head;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
int __cxa_atexit( void (*f)(void *), void *p, void *d) {
pthread_mutex_lock(&lock);
struct atexit_handler *h = malloc(sizeof(*h));
if (!h) {
pthread_mutex_unlock(&lock);
return 1;
}
h->f = f;
h->p = p;
h->d = d;
h->next = head;
head = h;
pthread_mutex_unlock(&lock);
return 0;
}
void __cxa_finalize(void *d ) {
pthread_mutex_lock(&lock);
struct atexit_handler **last = &head;
for (struct atexit_handler *h = head ; h ; h = h->next) {
if ((h->d == d) || (d == 0)) {
*last = h->next;
h->f(h->p);
free(h);
} else {
last = &h->next;
}
}
pthread_mutex_unlock(&lock);
}
#endif
| Fix bugs caused by writing code while half asleep. | Fix bugs caused by writing code while half asleep.
| C | bsd-2-clause | cemeyer/libcxxrt,xin3liang/platform_external_libcxxrt,sudosurootdev/external_libcxxrt,cemeyer/libcxxrt,xin3liang/platform_external_libcxxrt,vegard/libcxxrt,sudosurootdev/external_libcxxrt,vegard/libcxxrt,sudosurootdev/external_libcxxrt,cemeyer/libcxxrt,xin3liang/platform_external_libcxxrt,vegard/libcxxrt |
7fc9119df40544c5048308be5a6ff46b61213972 | src/validation.h | src/validation.h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_VALIDATION_H
#define BITCOIN_VALIDATION_H
#include <stdint.h>
#include <string>
static const int64_t DEFAULT_MAX_TIP_AGE = 120; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
extern int64_t nMaxTipAge;
class CBlockIndex;
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);
bool IsInitialBlockDownload();
/** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */
double GuessVerificationProgress(CBlockIndex* pindex);
#endif // BITCOIN_VALIDATION_H
| // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_VALIDATION_H
#define BITCOIN_VALIDATION_H
#include <stdint.h>
#include <string>
static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
extern int64_t nMaxTipAge;
class CBlockIndex;
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);
bool IsInitialBlockDownload();
/** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */
double GuessVerificationProgress(CBlockIndex* pindex);
#endif // BITCOIN_VALIDATION_H
| Put back default max tip age | Put back default max tip age
| C | mit | neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron |
08622e9601da87b2c663042a06ba404e6bc1577a | Engine/source/gfx/gl/tGL/tGL.h | Engine/source/gfx/gl/tGL/tGL.h | //-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 T_GL_H
#define T_GL_H
#include "GL/glew.h"
#define gglHasExtension(EXTENSION) GLEW_##EXTENSION
#endif
| //-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 T_GL_H
#define T_GL_H
#include "GL/glew.h"
// Slower but reliably detects extensions
#define gglHasExtension(EXTENSION) glewGetExtension("GL_##EXTENSION")
#endif
| Use different extension detection mechanism | Use different extension detection mechanism
I got this from looking at the code from the glew utility 'glewinfo' on my system it reported the following for GL_ARB_geometry_shader4: OK [MISSING]. This lead me to believe that there are two different ways of determining extensions. The first 'OK' seems to refer to the entrypoint existing while the second one seems to refer to the extension being available.
The difference is this:
The first OK comes from : GLEW_ARB_geometry_shader4 the global whereas the second 'MISSING' comes from glewGetExtension("GL_ARB_geometry_shader4"). By replacing the gglHasExtension I got the desired result.
We may want to implement some caching if we want to keep using GLEW perhaps?
Anyway I suggest this merely as a test, I'm not sure if this is a viable long-term solution.
| C | mit | ValtoGameEngines/Torque3D,JeffProgrammer/Torque3D,Will-of-the-Wisp/Torque3D,aaravamudan2014/Torque3D,aaravamudan2014/Torque3D,ValtoGameEngines/Torque3D,Will-of-the-Wisp/Torque3D,GarageGames/Torque3D,lukaspj/Speciality,Azaezel/Torque3D,rextimmy/Torque3D,Duion/Torque3D,JeffProgrammer/Torque3D,John3/Torque3D,Bloodknight/Torque3D,Phantom139/Torque3D,aaravamudan2014/Torque3D,elfprince13/Torque3D,Phantom139/Torque3D,Torque3D-GameEngine/Torque3D,Phantom139/Torque3D,chaigler/Torque3D,elfprince13/Torque3D,chaigler/Torque3D,elfprince13/Torque3D,Will-of-the-Wisp/Torque3D,aaravamudan2014/Torque3D,Duion/Torque3D,Azaezel/Torque3D,lukaspj/Speciality,John3/Torque3D,ValtoGameEngines/Torque3D,FITTeamIndecisive/Torque3D,rextimmy/Torque3D,elfprince13/Torque3D,elfprince13/Torque3D,JeffProgrammer/Torque3D,GarageGames/Torque3D,JeffProgrammer/Torque3D,Bloodknight/Torque3D,Duion/Torque3D,Phantom139/Torque3D,chaigler/Torque3D,Torque3D-GameEngine/Torque3D,Bloodknight/Torque3D,Will-of-the-Wisp/Torque3D,Bloodknight/Torque3D,John3/Torque3D,Phantom139/Torque3D,lukaspj/Speciality,John3/Torque3D,aaravamudan2014/Torque3D,aaravamudan2014/Torque3D,Phantom139/Torque3D,Bloodknight/Torque3D,Phantom139/Torque3D,aaravamudan2014/Torque3D,JeffProgrammer/Torque3D,Azaezel/Torque3D,Torque3D-GameEngine/Torque3D,FITTeamIndecisive/Torque3D,Will-of-the-Wisp/Torque3D,elfprince13/Torque3D,lukaspj/Speciality,ValtoGameEngines/Torque3D,Duion/Torque3D,Phantom139/Torque3D,John3/Torque3D,FITTeamIndecisive/Torque3D,elfprince13/Torque3D,Azaezel/Torque3D,rextimmy/Torque3D,Bloodknight/Torque3D,Will-of-the-Wisp/Torque3D,rextimmy/Torque3D,rextimmy/Torque3D,chaigler/Torque3D,FITTeamIndecisive/Torque3D,JeffProgrammer/Torque3D,lukaspj/Speciality,aaravamudan2014/Torque3D,GarageGames/Torque3D,aaravamudan2014/Torque3D,John3/Torque3D,Azaezel/Torque3D,John3/Torque3D,rextimmy/Torque3D,Bloodknight/Torque3D,GarageGames/Torque3D,Duion/Torque3D,Will-of-the-Wisp/Torque3D,Torque3D-GameEngine/Torque3D,rextimmy/Torque3D,Torque3D-GameEngine/Torque3D,JeffProgrammer/Torque3D,FITTeamIndecisive/Torque3D,Azaezel/Torque3D,chaigler/Torque3D,John3/Torque3D,elfprince13/Torque3D,Phantom139/Torque3D,Azaezel/Torque3D,lukaspj/Speciality,GarageGames/Torque3D,lukaspj/Speciality,John3/Torque3D,ValtoGameEngines/Torque3D,GarageGames/Torque3D,chaigler/Torque3D,lukaspj/Speciality,Azaezel/Torque3D,Torque3D-GameEngine/Torque3D,Will-of-the-Wisp/Torque3D,Will-of-the-Wisp/Torque3D,lukaspj/Speciality,Duion/Torque3D,Torque3D-GameEngine/Torque3D,GarageGames/Torque3D,FITTeamIndecisive/Torque3D,Torque3D-GameEngine/Torque3D,FITTeamIndecisive/Torque3D,ValtoGameEngines/Torque3D,ValtoGameEngines/Torque3D,FITTeamIndecisive/Torque3D,Bloodknight/Torque3D,Azaezel/Torque3D,chaigler/Torque3D,John3/Torque3D,rextimmy/Torque3D,elfprince13/Torque3D,chaigler/Torque3D,Torque3D-GameEngine/Torque3D,Will-of-the-Wisp/Torque3D,ValtoGameEngines/Torque3D,GarageGames/Torque3D,chaigler/Torque3D,rextimmy/Torque3D,Will-of-the-Wisp/Torque3D,Torque3D-GameEngine/Torque3D,elfprince13/Torque3D,rextimmy/Torque3D,JeffProgrammer/Torque3D,Bloodknight/Torque3D,Azaezel/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,Duion/Torque3D,ValtoGameEngines/Torque3D,Phantom139/Torque3D,lukaspj/Speciality,Duion/Torque3D,FITTeamIndecisive/Torque3D,FITTeamIndecisive/Torque3D,aaravamudan2014/Torque3D,Duion/Torque3D,GarageGames/Torque3D |
f408c35b1716e255634a2a2e9b3366b47eb7b3d7 | test/Analysis/misc-driver.c | test/Analysis/misc-driver.c | // RUN: %clang -### --analyze %s 2>&1 | FileCheck %s
// CHECK: -D__clang_analyzer__
| // RUN: %clang --analyze %s
#ifndef __clang_analyzer__
#error __clang_analyzer__ not defined
#endif
| Revert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__" | Revert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"
This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@372685 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
1dec7cc40215a7f692987749e15c05062fe11d4f | delay.h | delay.h | #ifndef DELAY_H
#define DELAY_H
#include <stdlib.h>
typedef struct drand48_data delay_t;
static inline void delay_init(delay_t * state, int id)
{
srand48_r(id + 1, state);
}
static inline void delay_exec(delay_t * state)
{
long n;
lrand48_r(state, &n);
int j;
for (j = 50; j < 50 + n % 100; ++j) {
__asm__ ("nop");
}
}
#endif /* end of include guard: DELAY_H */
| #ifndef DELAY_H
#define DELAY_H
#include <time.h>
#include <stdlib.h>
typedef struct drand48_data delay_t;
static inline void delay_init(delay_t * state, int id)
{
srand48_r(time(NULL) + id, state);
}
static inline void delay_exec(delay_t * state)
{
long n;
lrand48_r(state, &n);
int j;
for (j = 50; j < 50 + n % 100; ++j) {
__asm__ ("nop");
}
}
#endif /* end of include guard: DELAY_H */
| Use time based seed for generating random numbers. | Use time based seed for generating random numbers.
| C | mit | chaoran/fast-wait-free-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/hpc-queue |
d829f7b401a34e1b97bf473518014bce7ec606ac | src/runtime/scoped_mutex_lock.h | src/runtime/scoped_mutex_lock.h | #ifndef HALIDE_RUNTIME_MUTEX_H
#define HALIDE_RUNTIME_MUTEX_H
#include "HalideRuntime.h"
// Avoid ODR violations
namespace {
// An RAII mutex
struct ScopedMutexLock {
halide_mutex *mutex;
ScopedMutexLock(halide_mutex *mutex) : mutex(mutex) {
halide_mutex_lock(mutex);
}
~ScopedMutexLock() {
halide_mutex_unlock(mutex);
}
};
}
#endif
| Add an OS mutex to Halide runtime. | Add an OS mutex to Halide runtime.
Document an issue with the POSIX thread pool.
Ensure memoization cache is cleaned up when a JITted module is
shutdown. (Also provides a way to clear the cache from AOT code.)
Former-commit-id: 67b04dc5ae26ee489f051e7ead819f482d2fccb6 | C | mit | Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide |
|
7def4047c2c74d530e19e33708c890aacd243c40 | tests/regression/13-privatized/71-branched-thread-creation-priv.c | tests/regression/13-privatized/71-branched-thread-creation-priv.c | extern int __VERIFIER_nondet_int();
#include <pthread.h>
#include <assert.h>
int global = 5;
pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
return NULL;
}
int main() {
int r = __VERIFIER_nondet_int();
pthread_t id;
if (r) {
pthread_create(&id, NULL, t_fun, NULL);
}
else {
global = 10;
}
// sync join needs to publish global also to protected/mutex_inits like enter_multithreaded
pthread_mutex_lock(&m);
assert(global == 5); // UNKNOWN!
pthread_mutex_unlock(&m);
return 0;
} | Add branched thread creation privatization test, where protected and mutex_inits are unsound | Add branched thread creation privatization test, where protected and mutex_inits are unsound
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
c7f3302ed936837192f56accc0ad69e7504782a6 | src/libgfx/fps.h | src/libgfx/fps.h | #ifndef GFX_FPS_H
#define GFX_FPS_H
#include <chrono>
namespace GFX {
class FramesPerSecond
{
public:
FramesPerSecond() : m_millisecs(0.0), m_frames(0)
{
}
void startRender()
{
m_start = std::chrono::high_resolution_clock::now();
}
void stopRender()
{
std::chrono::time_point<std::chrono::high_resolution_clock> stop = std::chrono::high_resolution_clock::now();
++m_frames;
std::cout << "# millisecs: " << std::chrono::duration_cast<std::chrono::milliseconds>(stop - m_start).count() << std::endl;
m_millisecs += std::chrono::duration_cast<std::chrono::milliseconds>(stop - m_start).count();
}
double fps() const
{
return 1000.0 * m_frames / m_millisecs;
}
private:
std::chrono::time_point<std::chrono::high_resolution_clock> m_start;
double m_millisecs;
int m_frames;
};
}
#endif
| Add frames per second counter.. | Add frames per second counter..
| C | bsd-3-clause | timvdm/ComputerGraphics,timvdm/ComputerGraphics,timvdm/ComputerGraphics |
|
429a4f4ccd8614679a2ec304bf8065c4944adfab | conceitos/basicos/gerais/0x07_loops/do_while/example_do_while.c | conceitos/basicos/gerais/0x07_loops/do_while/example_do_while.c | /*
* Author: Jhonatan Casale (jhc)
*
* Contact : [email protected]
* : [email protected]
* : https://github.com/jhonatancasale
* : https://twitter.com/jhonatancasale
* : http://jhonatancasale.github.io/
*
* Create date Wed 1 Mar 02:02:10 BRT 2017
*
*/
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char **argv)
{
int value = 0;
do {
printf ("Choose one:\n");
printf ("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: ");
scanf("%i", &value);
} while ( value <= 0 || value > 10 );
int i = 0;
do printf ("%i\n", i);
while ( ++i < value );
return (EXIT_SUCCESS);
}
| Add do while loop examples, really | Add do while loop examples, really
| C | apache-2.0 | jhonatancasale/learning-c,klaussjhc/learning-c,jhonatancasale/learning-c |
|
0aaead5e49315267cd6785ec64d5b5884ae123c2 | libyaul/scu/bus/b/vdp/vdp1.h | libyaul/scu/bus/b/vdp/vdp1.h | /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _VDP1_H_
#define _VDP1_H_
#include <vdp1/cmdt.h>
#include <vdp1/env.h>
#include <vdp1/map.h>
#include <vdp1/vram.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_VDP1_H_ */
| /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _VDP1_H_
#define _VDP1_H_
#include <vdp1/cmdt.h>
#include <vdp1/env.h>
#include <vdp1/map.h>
#include <vdp1/vram.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct vdp1_transfer_status {
union {
struct {
unsigned :14;
unsigned vte_cef:1;
unsigned vte_bef:1;
} __packed;
uint16_t raw;
};
} __packed __aligned(2);
struct vdp1_mode_status {
union {
struct {
unsigned vms_version:4;
unsigned :3;
unsigned vms_ptm1:1;
unsigned vms_eos:1;
unsigned vms_die:1;
unsigned vms_dil:1;
unsigned vms_fcm:1;
unsigned vms_vbe:1;
unsigned vms_tvm:3;
} __packed;
uint16_t raw;
};
} __packed __aligned(2);
static inline void __attribute__ ((always_inline))
vdp1_mode_status_get(struct vdp1_mode_status *status)
{
/* If the structure isn't aligned on a 2-byte boundary, GCC will
* attempt to invoke memcpy() */
*status = *(volatile struct vdp1_mode_status *)VDP1(MODR);
}
static inline void __attribute__ ((always_inline))
vdp1_transfer_status_get(struct vdp1_transfer_status *status)
{
/* If the structure isn't aligned on a 2-byte boundary, GCC will
* attempt to invoke memcpy() */
*status = *(volatile struct vdp1_transfer_status *)VDP1(EDSR);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_VDP1_H_ */
| Add VDP1 status getters for transfer end and mode status | Add VDP1 status getters for transfer end and mode status
| C | mit | ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul |
952171538ce7d5d76dabf8191e15b9ca9c9d958a | Source/DSLogger.h | Source/DSLogger.h | //
// DSLogger.h
// ControlPlane
//
// Created by David Symonds on 22/07/07.
// Modified by Vladimir Beloborodov on 01 Apr 2013.
//
@interface DSLogger : NSObject
+ (void)initialize;
+ (DSLogger *)sharedLogger;
+ (void)logFromFunction:(NSString *)fnName withInfo:(NSString *)info;
- (id)init;
- (void)dealloc;
- (void)logFromFunction:(NSString *)fnName withInfo:(NSString *)info;
- (NSString *)buffer;
#define DSLog(format, ...) \
[DSLogger logFromFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] withInfo:[NSString stringWithFormat:(format),##__VA_ARGS__]]
@end
| //
// DSLogger.h
// ControlPlane
//
// Created by David Symonds on 22/07/07.
// Modified by Vladimir Beloborodov on 01 Apr 2013.
//
@interface DSLogger : NSObject
+ (void)initialize;
+ (DSLogger *)sharedLogger;
+ (void)logFromFunction:(NSString *)fnName withInfo:(NSString *)info;
- (id)init;
- (void)dealloc;
- (void)logFromFunction:(NSString *)fnName withInfo:(NSString *)info;
- (NSString *)buffer;
#define DSLog(...) \
[DSLogger logFromFunction:@(__PRETTY_FUNCTION__) withInfo:[NSString stringWithFormat:__VA_ARGS__]]
@end
| Simplify and improve definition of DSLog macro | Simplify and improve definition of DSLog macro
| C | bsd-3-clause | ajostergaard/ControlPlane,ajostergaard/ControlPlane,ajostergaard/ControlPlane,ajostergaard/ControlPlane |
062bc13039462e6f3f9baaea835ff9b863a18daf | include/cprtypes.h | include/cprtypes.h | #ifndef CPR_TYPES_H
#define CPR_TYPES_H
#include <map>
#include <string>
namespace cpr {
class CaseInsenstiveCompare {
public:
bool operator()(const std::string& a, const std::string& b) const;
private:
static void char_to_lower(char& c);
static std::string to_lower(const std::string& a);
};
typedef std::map<std::string, std::string, CaseInsenstiveCompare> Header;
typedef std::string Url;
}
#endif
| #ifndef CPR_TYPES_H
#define CPR_TYPES_H
#include <map>
#include <string>
namespace cpr {
class CaseInsenstiveCompare {
public:
bool operator()(const std::string& a, const std::string& b) const;
private:
static void char_to_lower(char& c);
static std::string to_lower(const std::string& a);
};
using Header = std::map<std::string, std::string, CaseInsenstiveCompare>;
using Url = std::string;
}
#endif
| Use C++11 `using` instead of `typedef` | Use C++11 `using` instead of `typedef` | C | mit | skystrife/cpr,msuvajac/cpr,SuperV1234/cpr,SuperV1234/cpr,skystrife/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,msuvajac/cpr,skystrife/cpr,SuperV1234/cpr,whoshuu/cpr |
4659f32c7023d6c92874e284d3c031418d634728 | t/04-nativecall/01-argless.c | t/04-nativecall/01-argless.c | #include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT Nothing()
{
/* we don't even print something */
}
DLLEXPORT int Argless()
{
return 2;
}
DLLEXPORT int long_and_complicated_name()
{
return 3;
}
| #include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT void Nothing()
{
/* we don't even print something */
}
DLLEXPORT int Argless()
{
return 2;
}
DLLEXPORT int long_and_complicated_name()
{
return 3;
}
| Fix compiler warnings on OS X / JVM backend | Fix compiler warnings on OS X / JVM backend
| C | artistic-2.0 | Leont/rakudo,softmoth/rakudo,salortiz/rakudo,skids/rakudo,dankogai/rakudo,laben/rakudo,ugexe/rakudo,ungrim97/rakudo,labster/rakudo,tony-o/deb-rakudodaily,salortiz/rakudo,usev6/rakudo,salortiz/rakudo,tony-o/deb-rakudodaily,teodozjan/rakudo,nbrown/rakudo,rakudo/rakudo,ungrim97/rakudo,MasterDuke17/rakudo,awwaiid/rakudo,zostay/rakudo,tony-o/rakudo,labster/rakudo,nunorc/rakudo,usev6/rakudo,b2gills/rakudo,jonathanstowe/rakudo,salortiz/rakudo,samcv/rakudo,sjn/rakudo,tbrowder/rakudo,zostay/rakudo,softmoth/rakudo,jonathanstowe/rakudo,lucasbuchala/rakudo,Gnouc/rakudo,ab5tract/rakudo,dankogai/rakudo,ugexe/rakudo,b2gills/rakudo,cognominal/rakudo,skids/rakudo,tony-o/deb-rakudodaily,cygx/rakudo,zostay/rakudo,tony-o/rakudo,LLFourn/rakudo,zhuomingliang/rakudo,cognominal/rakudo,ab5tract/rakudo,tony-o/deb-rakudodaily,sergot/rakudo,tony-o/rakudo,MasterDuke17/rakudo,lucasbuchala/rakudo,tony-o/deb-rakudodaily,labster/rakudo,rakudo/rakudo,raydiak/rakudo,raydiak/rakudo,cygx/rakudo,nbrown/rakudo,lucasbuchala/rakudo,azawawi/rakudo,nbrown/rakudo,azawawi/rakudo,Gnouc/rakudo,skids/rakudo,samcv/rakudo,paultcochrane/rakudo,awwaiid/rakudo,LLFourn/rakudo,usev6/rakudo,ugexe/rakudo,skids/rakudo,samcv/rakudo,jonathanstowe/rakudo,paultcochrane/rakudo,niner/rakudo,b2gills/rakudo,laben/rakudo,nbrown/rakudo,ugexe/rakudo,cognominal/rakudo,sjn/rakudo,laben/rakudo,samcv/rakudo,ugexe/rakudo,raydiak/rakudo,LLFourn/rakudo,paultcochrane/rakudo,laben/rakudo,cygx/rakudo,raydiak/rakudo,sergot/rakudo,ab5tract/rakudo,azawawi/rakudo,paultcochrane/rakudo,tbrowder/rakudo,tbrowder/rakudo,nunorc/rakudo,awwaiid/rakudo,rakudo/rakudo,ab5tract/rakudo,usev6/rakudo,labster/rakudo,tony-o/deb-rakudodaily,softmoth/rakudo,tony-o/rakudo,teodozjan/rakudo,niner/rakudo,nunorc/rakudo,zhuomingliang/rakudo,cygx/rakudo,Gnouc/rakudo,azawawi/rakudo,usev6/rakudo,softmoth/rakudo,Gnouc/rakudo,dankogai/rakudo,sergot/rakudo,Gnouc/rakudo,salortiz/rakudo,ab5tract/rakudo,zhuomingliang/rakudo,awwaiid/rakudo,b2gills/rakudo,tony-o/rakudo,sjn/rakudo,labster/rakudo,Gnouc/rakudo,samcv/rakudo,rakudo/rakudo,ungrim97/rakudo,LLFourn/rakudo,ungrim97/rakudo,rakudo/rakudo,tbrowder/rakudo,tbrowder/rakudo,awwaiid/rakudo,Leont/rakudo,tony-o/rakudo,MasterDuke17/rakudo,cognominal/rakudo,azawawi/rakudo,tbrowder/rakudo,dankogai/rakudo,MasterDuke17/rakudo,softmoth/rakudo,labster/rakudo,nbrown/rakudo,Leont/rakudo,lucasbuchala/rakudo,cygx/rakudo,b2gills/rakudo,salortiz/rakudo,sjn/rakudo,cognominal/rakudo,MasterDuke17/rakudo,tony-o/deb-rakudodaily,nunorc/rakudo,paultcochrane/rakudo,nbrown/rakudo,MasterDuke17/rakudo,sergot/rakudo,Leont/rakudo,jonathanstowe/rakudo,zhuomingliang/rakudo,niner/rakudo,skids/rakudo,ungrim97/rakudo,teodozjan/rakudo,teodozjan/rakudo,LLFourn/rakudo,rakudo/rakudo,lucasbuchala/rakudo,dankogai/rakudo,zostay/rakudo,sjn/rakudo,jonathanstowe/rakudo,niner/rakudo |
0afe6ff5d9626a553163739011c10c68d0a862aa | arc/arc/Model/FileObject.h | arc/arc/Model/FileObject.h | //
// FileObject.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FileObject : NSObject {
@private
NSURL* _url;
}
// The name of this object.
@property (strong, nonatomic) NSString* name;
// The full file path of this object.
@property (strong, nonatomic) NSString* path;
// The parent of this object (if any.)
@property (weak, nonatomic) FileObject* parent;
// The contents of this object.
@property id contents;
// Creates a FileObject to represent the given URL.
// url should be an object on the file system.
- (id)initWithURL:(NSURL*)url;
// Creates a FileObject to represent the given URL,
// with its parent set to the given FileObject.
- (id)initWithURL:(NSURL*)url parent:(FileObject*)parent;
// Refreshes the contents of this object by reloading
// them from the file system.
// Returns the contents when done.
- (id)refreshContents;
// Removes this object from the file system.
- (void)remove;
@end
| //
// FileObject.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FileObject : NSObject {
@private
NSURL* _url;
id _contents;
}
// The name of this object.
@property (strong, nonatomic) NSString* name;
// The full file path of this object.
@property (strong, nonatomic) NSString* path;
// The parent of this object (if any.)
@property (weak, nonatomic) FileObject* parent;
// Creates a FileObject to represent the given URL.
// url should be an object on the file system.
- (id)initWithURL:(NSURL*)url;
// Creates a FileObject to represent the given URL,
// with its parent set to the given FileObject.
- (id)initWithURL:(NSURL*)url parent:(FileObject*)parent;
// Refreshes the contents of this object by reloading
// them from the file system.
// Returns the contents when done.
- (id)refreshContents;
// Gets the contents of this object.
- (id)getContents;
// Removes this object from the file system.
- (void)remove;
@end
| Replace contents property with private array and getter. | Replace contents property with private array and getter.
| C | mit | BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc |
9e528bef6f5e4094e9fc497e1be3607341df7b01 | util/ncgg/main.c | util/ncgg/main.c | #ifndef NORCSID
static char rcsid[]= "$Header$";
#endif
#include <stdio.h>
char *filename;
main(argc,argv) char **argv; {
extern int nerrors;
extern int code_in_c;
extern int tabledebug;
extern int verbose;
while (argc >1 && argv[1][0]=='-') {
switch(argv[1][1]) {
case 'c':
code_in_c = 0;
break;
case 'd':
tabledebug++;
break;
case 'v':
verbose++;
break;
default:
error("Unknown flag -%c",argv[1][1]);
}
argc--; argv++;
}
if (argc==2) {
if (freopen(argv[1],"r",stdin)==NULL) {
error("Can't open %s",argv[1]);
exit(-1);
}
filename = argv[1];
} else
error("Usage: %s [-c] [-d] [-v] table",argv[0]);
initemhash();
enterkeyw();
initnodes();
initio();
yyparse();
if (nerrors==0) {
finishio();
statistics();
if (verbose)
hallverbose();
} else {
errorexit();
}
return(nerrors==0 ? 0 : -1);
}
| #ifndef NORCSID
static char rcsid[]= "$Header$";
#endif
#include <stdio.h>
char *filename;
main(argc,argv) char **argv; {
extern int nerrors;
extern int code_in_c;
extern int tabledebug;
extern int verbose;
while (argc >1 && argv[1][0]=='-') {
switch(argv[1][1]) {
case 'c':
code_in_c = 0;
break;
case 'd':
tabledebug++;
break;
case 'v':
verbose++;
break;
default:
error("Unknown flag -%c",argv[1][1]);
}
argc--; argv++;
}
if (argc==2) {
if (freopen(argv[1],"r",stdin)==NULL) {
error("Can't open %s",argv[1]);
exit(-1);
}
filename = argv[1];
}
else if (argc == 1) {
filename = "";
} else
error("Usage: %s [-c] [-d] [-v] [table]",argv[0]);
initemhash();
enterkeyw();
initnodes();
initio();
yyparse();
if (nerrors==0) {
finishio();
statistics();
if (verbose)
hallverbose();
} else {
errorexit();
}
return(nerrors==0 ? 0 : -1);
}
| Allow reading from standard input | Allow reading from standard input
| C | bsd-3-clause | Godzil/ack,Godzil/ack,Godzil/ack,Godzil/ack,Godzil/ack |
c8ece79ccd6542c4a522092c02e456edc17b2355 | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSec.c | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSec.c | /** @file
*
* Copyright (c) 2011, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
* which accompanies this distribution. The full text of the license may be found at
* http://opensource.org/licenses/bsd-license.php
*
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*
**/
#include <Library/IoLib.h>
#include <Library/ArmPlatformLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Drivers/PL341Dmc.h>
#include <Drivers/SP804Timer.h>
#include <ArmPlatform.h>
/**
Initialize the Secure peripherals and memory regions
If Trustzone is supported by your platform then this function makes the required initialization
of the secure peripherals and memory regions.
**/
VOID
ArmPlatformTrustzoneInit (
VOID
)
{
//ASSERT(FALSE);
DEBUG((EFI_D_ERROR,"Initialize Trustzone Hardware\n"));
}
/**
Initialize controllers that must setup at the early stage
Some peripherals must be initialized in Secure World.
For example, some L2x0 requires to be initialized in Secure World
**/
VOID
ArmPlatformSecInitialize (
VOID
) {
// Do nothing yet
}
/**
Call before jumping to Normal World
This function allows the firmware platform to do extra actions before
jumping to the Normal World
**/
VOID
ArmPlatformSecExtraAction (
IN UINTN CoreId,
OUT UINTN* JumpAddress
)
{
*JumpAddress = PcdGet32(PcdNormalFvBaseAddress);
}
| Fix ARM RealView EB and VE builds (2) | ArmPlatformPkg: Fix ARM RealView EB and VE builds (2)
This file is missing from the earlier commit (ArmPlatformPkg: Fix ARM RealView EB and VE builds).
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@12235 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
|
c360775fb7ed8352ca26f08c0270d21a6cb19e7f | test/Analysis/malloc.c | test/Analysis/malloc.c | // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
#include <stdlib.h>
void f1() {
int *p = malloc(10);
return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}
// THIS TEST CURRENTLY FAILS.
void f1_b() {
int *p = malloc(10);
}
void f2() {
int *p = malloc(10);
free(p);
free(p); // expected-warning{{Try to free a memory block that has been released}}
}
// This case tests that storing malloc'ed memory to a static variable which is then returned
// is not leaked. In the absence of known contracts for functions or inter-procedural analysis,
// this is a conservative answer.
int *f3() {
static int *p = 0;
p = malloc(10); // no-warning
return p;
}
// This case tests that storing malloc'ed memory to a static global variable which is then returned
// is not leaked. In the absence of known contracts for functions or inter-procedural analysis,
// this is a conservative answer.
static int *p_f4 = 0;
int *f4() {
p_f4 = malloc(10); // no-warning
return p_f4;
}
| // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
typedef long unsigned int size_t;
void *malloc(size_t);
void free(void *);
void f1() {
int *p = malloc(10);
return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}
// THIS TEST CURRENTLY FAILS.
void f1_b() {
int *p = malloc(10);
}
void f2() {
int *p = malloc(10);
free(p);
free(p); // expected-warning{{Try to free a memory block that has been released}}
}
// This case tests that storing malloc'ed memory to a static variable which is then returned
// is not leaked. In the absence of known contracts for functions or inter-procedural analysis,
// this is a conservative answer.
int *f3() {
static int *p = 0;
p = malloc(10); // no-warning
return p;
}
// This case tests that storing malloc'ed memory to a static global variable which is then returned
// is not leaked. In the absence of known contracts for functions or inter-procedural analysis,
// this is a conservative answer.
static int *p_f4 = 0;
int *f4() {
p_f4 = malloc(10); // no-warning
return p_f4;
}
| Remove test case's dependency on header file. | Remove test case's dependency on header file.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@88685 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
a0323adc1a9714c7889137413f7d59b41bfe1665 | Classes/AXKCollectionViewTools.h | Classes/AXKCollectionViewTools.h | //
// AXKCollectionViewTools.h
// Alexander Kolov
//
// Created by Alexander Kolov on 30/10/13.
// Copyright (c) 2013 Alexander Kolov. All rights reserved.
//
#import "UICollectionReusableView+ReuseIdentifier.h"
#import "UICollectionViewCell+IndexPath.h"
#import "UICollectionViewCell+ReuseIdentifier.h"
#import "UITableViewCell+IndexPath.h"
#import "UITableViewCell+ReuseIdentifier.h"
| //
// AXKCollectionViewTools.h
// Alexander Kolov
//
// Created by Alexander Kolov on 30/10/13.
// Copyright (c) 2013 Alexander Kolov. All rights reserved.
//
#import "UICollectionReusableView+ReuseIdentifier.h"
#import "UICollectionViewCell+IndexPath.h"
#import "UICollectionViewCell+ReuseIdentifier.h"
#import "UITableViewCell+IndexPath.h"
#import "UITableViewCell+ReuseIdentifier.h"
#import "UITableViewHeaderFooterView+ReuseIdentifier.h"
| Add files to the master header | Add files to the master header
| C | mit | akolov/AXKCollectionViewTools |
1416089f44fab6fa35e3523aed3408ee30457a7f | include/llvm/Bytecode/Reader.h | include/llvm/Bytecode/Reader.h | //===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=//
//
// This functionality is implemented by the lib/BytecodeReader library.
// This library is used to read VM bytecode files from an iostream.
//
// Note that performance of this library is _crucial_ for performance of the
// JIT type applications, so we have designed the bytecode format to support
// quick reading.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_READER_H
#define LLVM_BYTECODE_READER_H
#include <string>
class Module;
// Parse and return a class...
//
Module *ParseBytecodeFile(const std::string &Filename,
std::string *ErrorStr = 0);
Module *ParseBytecodeBuffer(const char *Buffer, unsigned BufferSize,
std::string *ErrorStr = 0);
#endif
| //===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=//
//
// This functionality is implemented by the lib/BytecodeReader library.
// This library is used to read VM bytecode files from an iostream.
//
// Note that performance of this library is _crucial_ for performance of the
// JIT type applications, so we have designed the bytecode format to support
// quick reading.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_READER_H
#define LLVM_BYTECODE_READER_H
#include <string>
class Module;
// Parse and return a class...
//
Module *ParseBytecodeFile(const std::string &Filename,
std::string *ErrorStr = 0);
Module *ParseBytecodeBuffer(const char *Buffer, unsigned BufferSize);
#endif
| Fix prototype to make function. | Fix prototype to make function.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@2939 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap |
eda3142317dd8e9e8bfbd73da430dcba57be768c | include/kotlib/compat/msvc.h | include/kotlib/compat/msvc.h | /*!
* @file msvc.h
* @brief Provide MSVC compatibility
* @author koturn
*/
#ifndef KOTLIB_COMPAT_MSVC_H
#define KOTLIB_COMPAT_MSVC_H
#ifndef _MSC_VER
# define _declspec(x)
# define __declspec(x)
#endif
#endif // KOTLIB_COMPAT_MSVC_H
| Add header to provide MSVC compatibility | Add header to provide MSVC compatibility
| C | mit | koturn/kotlib,koturn/kotlib |
|
2f9f822c764b9635807326d6fff442ce799d4438 | runtime/platform/utils_win.h | runtime/platform/utils_win.h | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef PLATFORM_UTILS_WIN_H_
#define PLATFORM_UTILS_WIN_H_
#include <intrin.h>
namespace dart {
inline int Utils::CountTrailingZeros(uword x) {
uword result;
#if defined(ARCH_IS_32_BIT)
_BitScanReverse(&result, x);
return __builtin_ctzl(x);
#elif defined(ARCH_IS_64_BIT)
_BitScanReverse64(&result, x);
#else
#error Architecture is not 32-bit or 64-bit.
#endif
return static_cast<int>(result);
};
} // namespace dart
#endif // PLATFORM_UTILS_WIN_H_
| // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef PLATFORM_UTILS_WIN_H_
#define PLATFORM_UTILS_WIN_H_
#include <intrin.h>
namespace dart {
inline int Utils::CountTrailingZeros(uword x) {
unsigned long result; // NOLINT
#if defined(ARCH_IS_32_BIT)
_BitScanReverse(&result, x);
#elif defined(ARCH_IS_64_BIT)
_BitScanReverse64(&result, x);
#else
#error Architecture is not 32-bit or 64-bit.
#endif
return static_cast<int>(result);
};
} // namespace dart
#endif // PLATFORM_UTILS_WIN_H_
| Fix the build breakage on Windows caused by CountTrailingZeros. | Fix the build breakage on Windows caused by CountTrailingZeros.
Review URL: https://chromiumcodereview.appspot.com//10818020
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@9838 260f80e4-7a28-3924-810f-c04153c831b5
| C | bsd-3-clause | dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk |
4cfaf8cd78fdf46a6a6831e2c5ff4eae34809a34 | lab_2_brightness/main_window.h | lab_2_brightness/main_window.h | #ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QGroupBox>
#include <QVBoxLayout>
#include <base_window.h>
class MainWindow : public gui::BaseWindow {
public:
MainWindow();
virtual ~MainWindow();
protected:
/**
* Callback for resize window.
*
* @param event[in] Event params.
*/
void resizeEvent(QResizeEvent *event) override;
private:
/** Result image and it's container */
QImage result_image;
QLabel *result_image_label;
};
#endif // MAIN_WINDOW_H
| #ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QGroupBox>
#include <QVBoxLayout>
#include <base_window.h>
class MainWindow : public gui::BaseWindow {
public:
MainWindow();
virtual ~MainWindow();
protected:
/**
* Callback for resize window.
*
* @param event[in] Event params.
*/
void resizeEvent(QResizeEvent *event) override;
private slots:
void fix_color_correct();
void gray_world();
void gamma_correct();
void contrast_correct();
void hist_normalization();
void hist_equalization();
private:
/** Result image and it's container */
QImage result_image;
QLabel *result_image_label;
};
#endif // MAIN_WINDOW_H
| Add slots for second lab | Add slots for second lab
| C | mit | Dmitry94/Image_Processing,Dmitry94/Image_Processing,Dmitry94/Image_Processing |
80d8a396ee09d9117594ce512ba4133a996568ae | cras/src/server/cras_volume_curve.c | cras/src/server/cras_volume_curve.c | /* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stddef.h>
/* Default to 1dB per tick. Volume level 100 = 0dB level 0 = -100dB. */
long cras_volume_curve_get_db_for_index(size_t volume)
{
/* dB to cut * 100 */
return (volume - 100) * 100;
}
| /* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stddef.h>
/* Default to 1dB per tick.
* Volume = 100 -> 0dB.
* Volume = 0 -> -100dB. */
long cras_volume_curve_get_db_for_index(size_t volume)
{
/* dB to cut * 100 */
return (volume - 100) * 100;
}
| Fix poorly worded volume comment. | CRAS: Fix poorly worded volume comment.
BUG=none
TEST=none
Change-Id: I7a5854c84bc48a393fa65c374fddd83ce7721f8d
Signed-off-by: Dylan Reid <[email protected]>
| C | bsd-3-clause | drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd |
0d766ad199ed257aea53398011d0c833f6cc86d7 | runtime/CLSmith.h | runtime/CLSmith.h | #ifndef RANDOM_RUNTIME_H
#define RANDOM_RUNTIME_H
#include "safe_math_macros.h"
static uint32_t crc32_tab[256];
static uint32_t crc32_context = 0xFFFFFFFFUL;
/*static void
crc32_gentab (void)
{
uint32_t crc;
const uint32_t poly = 0xEDB88320UL;
int i, j;
for (i = 0; i < 256; i++) {
crc = i;
for (j = 8; j > 0; j--) {
if (crc & 1) {
crc = (crc >> 1) ^ poly;
} else {
crc >>= 1;
}
}
crc32_tab[i] = crc;
}
}
static void
crc32_byte (uint8_t b) {
crc32_context =
((crc32_context >> 8) & 0x00FFFFFF) ^
crc32_tab[(crc32_context ^ b) & 0xFF];
}
static void
crc32_8bytes (uint64_t val)
{
crc32_byte ((val>>0) & 0xff);
crc32_byte ((val>>8) & 0xff);
crc32_byte ((val>>16) & 0xff);
crc32_byte ((val>>24) & 0xff);
crc32_byte ((val>>32) & 0xff);
crc32_byte ((val>>40) & 0xff);
crc32_byte ((val>>48) & 0xff);
crc32_byte ((val>>56) & 0xff);
}
static void
transparent_crc (uint64_t val, const __constant char* vname, int flag)
{
crc32_8bytes(val);
}*/
static inline void crc32_gentab (void)
{
}
static inline void
transparent_crc (uint32_t val, const __constant char* vname, int flag)
{
crc32_context += val;
}
#endif /* RANDOM_RUNTIME_H */
| Include for OpenCL progs. Similar to the csmith include. Will only work with the minimal version at the moment. | Include for OpenCL progs. Similar to the csmith include. Will only work with the minimal version at the moment.
| C | bsd-2-clause | ChrisLidbury/CLSmith,ChrisLidbury/CLSmith,ChrisLidbury/CLSmith,ChrisLidbury/CLSmith,ChrisLidbury/CLSmith |
|
bb7e3ee1c8bb59b4fde439565bd1757880cbb8ec | xchainer/arithmetic_ops.h | xchainer/arithmetic_ops.h | #pragma once
#include "xchainer/macro.h"
namespace xchainer {
template <typename T>
class ArithmeticOps {
public:
XCHAINER_HOST_DEVICE static T Add(T lhs, T rhs) { return lhs + rhs; }
XCHAINER_HOST_DEVICE static T Multiply(T lhs, T rhs) { return lhs * rhs; }
XCHAINER_HOST_DEVICE static T Divide(T lhs, T rhs) { return lhs / rhs; }
};
template <>
class ArithmeticOps<bool> {
public:
XCHAINER_HOST_DEVICE static bool Add(bool lhs, bool rhs) { return lhs || rhs; }
XCHAINER_HOST_DEVICE static bool Multiply(bool lhs, bool rhs) { return lhs && rhs; }
XCHAINER_HOST_DEVICE static bool Divide(bool lhs, bool rhs) { return lhs && rhs; }
};
} // namespace xchainer
| #pragma once
#include "xchainer/macro.h"
namespace xchainer {
template <typename T>
class ArithmeticOps {
public:
XCHAINER_HOST_DEVICE static T Add(T lhs, T rhs) { return lhs + rhs; }
XCHAINER_HOST_DEVICE static T Multiply(T lhs, T rhs) { return lhs * rhs; }
XCHAINER_HOST_DEVICE static T Divide(T lhs, T rhs) { return lhs / rhs; }
};
template <>
class ArithmeticOps<bool> {
public:
XCHAINER_HOST_DEVICE static bool Add(bool lhs, bool rhs) { return lhs || rhs; }
XCHAINER_HOST_DEVICE static bool Multiply(bool lhs, bool rhs) { return lhs && rhs; }
// TODO(beam2d): It's a tentative implementation. Make distinction between TrueDivide and FloorDivide for better NumPy compatibility.
// The current implementation is of boolean FloorDivide except for warnings.
XCHAINER_HOST_DEVICE static bool Divide(bool lhs, bool rhs) { return lhs && rhs; }
};
} // namespace xchainer
| Add a TODO comment about boolean division | Add a TODO comment about boolean division
| C | mit | okuta/chainer,pfnet/chainer,hvy/chainer,ktnyt/chainer,okuta/chainer,jnishi/chainer,wkentaro/chainer,keisuke-umezawa/chainer,niboshi/chainer,keisuke-umezawa/chainer,hvy/chainer,ktnyt/chainer,wkentaro/chainer,niboshi/chainer,okuta/chainer,ktnyt/chainer,jnishi/chainer,niboshi/chainer,jnishi/chainer,keisuke-umezawa/chainer,okuta/chainer,chainer/chainer,wkentaro/chainer,chainer/chainer,ktnyt/chainer,hvy/chainer,wkentaro/chainer,tkerola/chainer,hvy/chainer,niboshi/chainer,chainer/chainer,keisuke-umezawa/chainer,jnishi/chainer,chainer/chainer |
8accd2d73920c43de6e3859f3148ff942b85f28d | scripts/stm32/embox_stm32_it_template.c | scripts/stm32/embox_stm32_it_template.c | /**
* GENERATED FILE
*/
#include <kernel/irq.h>
#include "main.h"
#include "stm32_PLATFORM_xx_it.h"
#define EMBOX_STM32_IRQ_HANDLER(prefix) \
static irq_return_t embox_##prefix##_IRQHandler(unsigned int irq_nr, void *data) { \
prefix##_IRQHandler(); \
return IRQ_HANDLED; \
}
_IRQ_HANDLERS_DECLARE_
extern void (*cortexm_external_clock_hnd)(void);
int embox_stm32_setup_irq_handlers(void) {
int res = 0;
cortexm_external_clock_hnd = SysTick_Handler;
_STM32_IRQ_ATTACH_
return res;
}
| Add forgotten file for 3f2e592 | stm32: Add forgotten file for 3f2e592
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
|
309d7d5860070360f423f25d55cfb1d5a2e9a8ca | lib/stdarg.h | lib/stdarg.h | #ifndef __STDARG_H
#define __STDARG_H
#include "sys/types.h"
typedef void *va_list;
#define va_start(l, arg) l = (void *)&arg
#define va_arg(l, type) (*(type *)(l += __WORDSIZE / 8))
#define va_end(l)
#endif
| #ifndef __STDARG_H
#define __STDARG_H
#include "sys/types.h"
typedef void *va_list;
#define va_start(l, arg) l = (void *)&arg
/*
* va_arg assumes arguments are promoted to
* machine-word size when pushed onto the stack
*/
#define va_arg(l, type) (*(type *)(l += sizeof *l))
#define va_end(l)
#endif
| Move by machine word size | Move by machine word size
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
c28e0e7d97aba40968b0b9ca96cb7d3b4b7b1fef | src/mesa/drivers/dri/r600/r700_driconf.h | src/mesa/drivers/dri/r600/r700_driconf.h | /*
* Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
*
* 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 COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Authors:
* Richard Li <[email protected]>, <[email protected]>
*/
#ifndef _R700_DRICONF_H_
#define _R700_DRICONF_H_
#define DRI_CONF_FP_OPTIMIZATION_SPEED 0
#define DRI_CONF_FP_OPTIMIZATION_QUALITY 1
#endif /* _R700_DRICONF_H_ */
| Add missing file from local. | Add missing file from local.
| C | mit | jbarczak/glsl-optimizer,adobe/glsl2agal,KTXSoftware/glsl2agal,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,KTXSoftware/glsl2agal,djreep81/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,adobe/glsl2agal,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,zz85/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,adobe/glsl2agal,bkaradzic/glsl-optimizer,adobe/glsl2agal,benaadams/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,KTXSoftware/glsl2agal,benaadams/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,KTXSoftware/glsl2agal,dellis1972/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,KTXSoftware/glsl2agal,zeux/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,adobe/glsl2agal,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer |
|
afa8074ccfc405d91803f946d4dcc878886620d0 | WebDriverAgentLib/Utilities/FBConfiguration.h | WebDriverAgentLib/Utilities/FBConfiguration.h | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
Accessors for Global Constants.
*/
@interface FBConfiguration : NSObject
/*! If set to YES will ask TestManagerDaemon for element visibility */
@property (class, nonatomic, assign) BOOL shouldUseTestManagerForVisibilityDetection;
/* The maximum typing frequency for all typing activities */
@property (class, nonatomic, assign) NSUInteger maxTypingFrequency;
/**
Switch for enabling/disabling reporting fake collection view cells by Accessibility framework.
If set to YES it will report also invisible cells.
*/
+ (void)shouldShowFakeCollectionViewCells:(BOOL)showFakeCells;
/**
The range of ports that the HTTP Server should attempt to bind on launch
*/
+ (NSRange)bindingPortRange;
/**
YES if verbose logging is enabled. NO otherwise.
*/
+ (BOOL)verboseLoggingEnabled;
@end
NS_ASSUME_NONNULL_END
| /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
Accessors for Global Constants.
*/
@interface FBConfiguration : NSObject
/*! If set to YES will ask TestManagerDaemon for element visibility */
+ (void)setShouldUseTestManagerForVisibilityDetection:(BOOL)value;
+ (BOOL)shouldUseTestManagerForVisibilityDetection;
/* The maximum typing frequency for all typing activities */
+ (void)setMaxTypingFrequency:(NSUInteger)value;
+ (NSUInteger)maxTypingFrequency;
/**
Switch for enabling/disabling reporting fake collection view cells by Accessibility framework.
If set to YES it will report also invisible cells.
*/
+ (void)shouldShowFakeCollectionViewCells:(BOOL)showFakeCells;
/**
The range of ports that the HTTP Server should attempt to bind on launch
*/
+ (NSRange)bindingPortRange;
/**
YES if verbose logging is enabled. NO otherwise.
*/
+ (BOOL)verboseLoggingEnabled;
@end
NS_ASSUME_NONNULL_END
| Switch from class property to methods | Switch from class property to methods
Summary:
Some recent changes use class properties, which break building with Xcode 7. This exposes the same API without the new syntax.
Closes https://github.com/facebook/WebDriverAgent/pull/539
Differential Revision: D4880364
Pulled By: marekcirkos
fbshipit-source-id: dace4b2413cb8c52dd0783da03f216da8a26fc97
| C | bsd-3-clause | PiranhaTeam/WebDriverAgent,ymin/WebDriverAgent,PiranhaTeam/WebDriverAgent,PiranhaTeam/WebDriverAgent,ymin/WebDriverAgent,ymin/WebDriverAgent,PiranhaTeam/WebDriverAgent,ymin/WebDriverAgent,PiranhaTeam/WebDriverAgent |
1b30978d7c553bdb9786286374f02c9e41ebb6bd | arch/sgi/include/vmparam.h | arch/sgi/include/vmparam.h | /* $OpenBSD: vmparam.h,v 1.9 2011/05/30 22:25:22 oga Exp $ */
/* public domain */
#ifndef _MACHINE_VMPARAM_H_
#define _MACHINE_VMPARAM_H_
#define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */
/*
* On Origin and Octane families, DMA to 32-bit PCI devices is restricted.
*
* Systems with physical memory after the 2GB boundary need to ensure
* memory which may used for DMA transfers is allocated from the low
* memory range.
*
* Other systems, like the O2, do not have such a restriction, but can not
* have more than 2GB of physical memory, so this doesn't affect them.
*/
#include <mips64/vmparam.h>
#endif /* _MACHINE_VMPARAM_H_ */
| /* $OpenBSD: vmparam.h,v 1.10 2014/07/13 15:48:32 miod Exp $ */
/* public domain */
#ifndef _MACHINE_VMPARAM_H_
#define _MACHINE_VMPARAM_H_
#define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */
#include <mips64/vmparam.h>
#endif /* _MACHINE_VMPARAM_H_ */
| Remove stale comment which used to explain why we had a special 31-bit freelist for DMA, back when this was applicable. | Remove stale comment which used to explain why we had a special 31-bit freelist
for DMA, back when this was applicable.
| C | isc | orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars |
3218e01b76602eaa399a7e43caa219d7330855d7 | iActiveRecord/Classes/class_getSubclasses.h | iActiveRecord/Classes/class_getSubclasses.h | //
// class_getSubclasses.h
// iActiveRecord
//
// Created by Alex Denisov on 21.03.12.
// Copyright (c) 2012 okolodev.org. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
static NSArray *class_getSubclasses(Class parentClass) {
int numClasses = objc_getClassList(NULL, 0);
Class classes[sizeof(Class) * numClasses];
numClasses = objc_getClassList(classes, numClasses);
NSMutableArray *result = [NSMutableArray array];
for (NSInteger i = 0; i < numClasses; i++) {
Class superClass = classes[i];
do {
superClass = class_getSuperclass(superClass);
} while (superClass && superClass != parentClass);
if (superClass == nil) {
continue;
}
[result addObject:classes[i]];
}
return result;
}
| //
// class_getSubclasses.h
// iActiveRecord
//
// Created by Alex Denisov on 21.03.12.
// Copyright (c) 2012 okolodev.org. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
static NSArray *class_getSubclasses(Class parentClass) {
int numClasses = objc_getClassList(NULL, 0);
Class *classes = NULL;
classes = (__unsafe_unretained Class *)malloc(sizeof(Class) * numClasses);
numClasses = objc_getClassList(classes, numClasses);
NSMutableArray *result = [NSMutableArray array];
for (NSInteger i = 0; i < numClasses; i++) {
Class superClass = classes[i];
do {
superClass = class_getSuperclass(superClass);
} while (superClass && superClass != parentClass);
if (superClass == nil) {
continue;
}
[result addObject:classes[i]];
}
free(classes);
return result;
}
| Fix for crashes in iOS 10 | Fix for crashes in iOS 10 | C | mit | AlexDenisov/iActiveRecord,3dcl/iActiveRecord,3dcl/iActiveRecord,AlexDenisov/iActiveRecord,3dcl/iActiveRecord,AlexDenisov/iActiveRecord,3dcl/iActiveRecord |
2760cf5a705f1fe853cd163f534f5cc2106cdb8f | src/math/p_tanh.c | src/math/p_tanh.c | #include <pal.h>
/**
*
* Calculates the hyperbolic tangent of the input vector 'a'.
* Angles are specified in radians.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
#include <math.h>
void p_tanh_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
*(c + i) = tanhf(*(a + i));
}
}
| #include <pal.h>
#include "p_exp.h"
/*
* tanh z = sinh z / cosh z
* = (exp z - exp -z) / (exp z + ezp -z)
* = (exp 2z - 1) / (exp 2z + 1)
*/
static inline float _p_tanh(const float z)
{
float exp_2z = _p_exp(2.f * z);
return (exp_2z - 1.f) / (exp_2z + 1.f);
}
/**
*
* Calculates the hyperbolic tangent of the input vector 'a'.
* Angles are specified in radians.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
void p_tanh_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
c[i] = _p_tanh(a[i]);
}
}
| Implement the hyperbolic tangent function. | math:tanh: Implement the hyperbolic tangent function.
Signed-off-by: Mansour Moufid <[email protected]>
| C | apache-2.0 | parallella/pal,debug-de-su-ka/pal,parallella/pal,olajep/pal,debug-de-su-ka/pal,mateunho/pal,8l/pal,eliteraspberries/pal,parallella/pal,aolofsson/pal,mateunho/pal,eliteraspberries/pal,olajep/pal,mateunho/pal,parallella/pal,parallella/pal,eliteraspberries/pal,olajep/pal,8l/pal,aolofsson/pal,olajep/pal,debug-de-su-ka/pal,eliteraspberries/pal,8l/pal,debug-de-su-ka/pal,8l/pal,eliteraspberries/pal,aolofsson/pal,aolofsson/pal,debug-de-su-ka/pal,mateunho/pal,mateunho/pal |
c530ab012c5f8053453e5be3c3c093cc7fba10ed | base/inc/Htypes.h | base/inc/Htypes.h | /* @(#)root/base:$Name: $:$Id: Htypes.h,v 1.1.1.1 2000/05/16 17:00:39 rdm Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_Htypes
#define ROOT_Htypes
//////////////////////////////////////////////////////////////////////////
// //
// Htypes //
// //
// Types used by the histogramming classes. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
typedef double Axis_t; //Axis values type
typedef double Stat_t; //Statistics type
#endif
| /* @(#)root/base:$Name: $:$Id: Htypes.h,v 1.2 2000/06/13 12:25:52 brun Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_Htypes
#define ROOT_Htypes
//////////////////////////////////////////////////////////////////////////
// //
// Htypes //
// //
// Types used by the histogramming classes. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
typedef double Axis_t; //Axis values type (double)
typedef double Stat_t; //Statistics type (double)
#endif
| Add more comments describing Stat_t and Axis_t | Add more comments describing Stat_t and Axis_t
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@3097 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | nilqed/root,davidlt/root,omazapa/root-old,krafczyk/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,esakellari/root,sirinath/root,zzxuanyuan/root,esakellari/my_root_for_test,pspe/root,karies/root,buuck/root,sbinet/cxx-root,mhuwiler/rootauto,sirinath/root,arch1tect0r/root,perovic/root,veprbl/root,mhuwiler/rootauto,omazapa/root,CristinaCristescu/root,root-mirror/root,abhinavmoudgil95/root,cxx-hep/root-cern,veprbl/root,mattkretz/root,zzxuanyuan/root,satyarth934/root,bbockelm/root,mhuwiler/rootauto,arch1tect0r/root,mhuwiler/rootauto,sawenzel/root,mhuwiler/rootauto,pspe/root,mkret2/root,CristinaCristescu/root,0x0all/ROOT,evgeny-boger/root,bbockelm/root,pspe/root,nilqed/root,sirinath/root,arch1tect0r/root,perovic/root,sawenzel/root,vukasinmilosevic/root,simonpf/root,nilqed/root,zzxuanyuan/root-compressor-dummy,olifre/root,buuck/root,esakellari/root,sirinath/root,omazapa/root-old,smarinac/root,krafczyk/root,buuck/root,nilqed/root,nilqed/root,pspe/root,omazapa/root-old,bbockelm/root,perovic/root,karies/root,0x0all/ROOT,esakellari/root,Duraznos/root,pspe/root,esakellari/root,thomaskeck/root,BerserkerTroll/root,Duraznos/root,krafczyk/root,vukasinmilosevic/root,agarciamontoro/root,ffurano/root5,zzxuanyuan/root-compressor-dummy,Duraznos/root,omazapa/root-old,zzxuanyuan/root-compressor-dummy,nilqed/root,nilqed/root,root-mirror/root,perovic/root,buuck/root,dfunke/root,abhinavmoudgil95/root,pspe/root,dfunke/root,omazapa/root,gbitzes/root,BerserkerTroll/root,perovic/root,evgeny-boger/root,tc3t/qoot,gganis/root,arch1tect0r/root,omazapa/root,arch1tect0r/root,mkret2/root,georgtroska/root,gbitzes/root,ffurano/root5,dfunke/root,beniz/root,vukasinmilosevic/root,CristinaCristescu/root,Duraznos/root,root-mirror/root,perovic/root,BerserkerTroll/root,gbitzes/root,alexschlueter/cern-root,tc3t/qoot,sawenzel/root,root-mirror/root,esakellari/root,davidlt/root,gbitzes/root,satyarth934/root,karies/root,olifre/root,mkret2/root,Dr15Jones/root,cxx-hep/root-cern,evgeny-boger/root,sawenzel/root,jrtomps/root,ffurano/root5,ffurano/root5,bbockelm/root,thomaskeck/root,sbinet/cxx-root,evgeny-boger/root,Y--/root,satyarth934/root,vukasinmilosevic/root,smarinac/root,bbockelm/root,pspe/root,omazapa/root-old,evgeny-boger/root,strykejern/TTreeReader,sawenzel/root,gbitzes/root,beniz/root,davidlt/root,agarciamontoro/root,beniz/root,olifre/root,vukasinmilosevic/root,Dr15Jones/root,mkret2/root,perovic/root,dfunke/root,mhuwiler/rootauto,omazapa/root-old,tc3t/qoot,veprbl/root,smarinac/root,simonpf/root,zzxuanyuan/root-compressor-dummy,tc3t/qoot,zzxuanyuan/root-compressor-dummy,tc3t/qoot,vukasinmilosevic/root,omazapa/root-old,Y--/root,dfunke/root,krafczyk/root,0x0all/ROOT,mkret2/root,alexschlueter/cern-root,BerserkerTroll/root,veprbl/root,perovic/root,simonpf/root,vukasinmilosevic/root,root-mirror/root,gganis/root,mkret2/root,satyarth934/root,mhuwiler/rootauto,krafczyk/root,root-mirror/root,agarciamontoro/root,zzxuanyuan/root,davidlt/root,Dr15Jones/root,nilqed/root,olifre/root,simonpf/root,lgiommi/root,CristinaCristescu/root,thomaskeck/root,simonpf/root,CristinaCristescu/root,mkret2/root,agarciamontoro/root,agarciamontoro/root,gbitzes/root,karies/root,abhinavmoudgil95/root,jrtomps/root,evgeny-boger/root,veprbl/root,sirinath/root,strykejern/TTreeReader,georgtroska/root,zzxuanyuan/root,agarciamontoro/root,gganis/root,esakellari/my_root_for_test,mkret2/root,zzxuanyuan/root,mkret2/root,mattkretz/root,abhinavmoudgil95/root,lgiommi/root,zzxuanyuan/root-compressor-dummy,kirbyherm/root-r-tools,arch1tect0r/root,perovic/root,tc3t/qoot,simonpf/root,agarciamontoro/root,abhinavmoudgil95/root,0x0all/ROOT,perovic/root,karies/root,georgtroska/root,sawenzel/root,tc3t/qoot,BerserkerTroll/root,BerserkerTroll/root,gbitzes/root,nilqed/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,CristinaCristescu/root,thomaskeck/root,cxx-hep/root-cern,alexschlueter/cern-root,omazapa/root-old,BerserkerTroll/root,davidlt/root,esakellari/my_root_for_test,alexschlueter/cern-root,arch1tect0r/root,mattkretz/root,gganis/root,abhinavmoudgil95/root,georgtroska/root,BerserkerTroll/root,sawenzel/root,jrtomps/root,sbinet/cxx-root,mattkretz/root,evgeny-boger/root,veprbl/root,Dr15Jones/root,jrtomps/root,sbinet/cxx-root,omazapa/root-old,esakellari/my_root_for_test,strykejern/TTreeReader,cxx-hep/root-cern,strykejern/TTreeReader,abhinavmoudgil95/root,omazapa/root,root-mirror/root,kirbyherm/root-r-tools,sawenzel/root,krafczyk/root,lgiommi/root,0x0all/ROOT,ffurano/root5,buuck/root,buuck/root,gbitzes/root,zzxuanyuan/root,esakellari/my_root_for_test,bbockelm/root,esakellari/root,pspe/root,sirinath/root,root-mirror/root,jrtomps/root,mhuwiler/rootauto,gbitzes/root,simonpf/root,bbockelm/root,sirinath/root,mattkretz/root,root-mirror/root,veprbl/root,esakellari/root,davidlt/root,smarinac/root,0x0all/ROOT,bbockelm/root,ffurano/root5,karies/root,thomaskeck/root,georgtroska/root,thomaskeck/root,omazapa/root,beniz/root,agarciamontoro/root,vukasinmilosevic/root,evgeny-boger/root,strykejern/TTreeReader,jrtomps/root,arch1tect0r/root,davidlt/root,buuck/root,smarinac/root,beniz/root,thomaskeck/root,davidlt/root,omazapa/root-old,zzxuanyuan/root,smarinac/root,Y--/root,cxx-hep/root-cern,lgiommi/root,smarinac/root,root-mirror/root,thomaskeck/root,krafczyk/root,davidlt/root,kirbyherm/root-r-tools,satyarth934/root,lgiommi/root,Duraznos/root,Duraznos/root,cxx-hep/root-cern,esakellari/my_root_for_test,vukasinmilosevic/root,pspe/root,buuck/root,jrtomps/root,Y--/root,satyarth934/root,agarciamontoro/root,vukasinmilosevic/root,satyarth934/root,tc3t/qoot,omazapa/root,evgeny-boger/root,gganis/root,zzxuanyuan/root-compressor-dummy,Y--/root,veprbl/root,Duraznos/root,CristinaCristescu/root,gganis/root,mattkretz/root,gganis/root,davidlt/root,mhuwiler/rootauto,gganis/root,esakellari/root,zzxuanyuan/root-compressor-dummy,beniz/root,satyarth934/root,omazapa/root,gganis/root,pspe/root,jrtomps/root,gganis/root,omazapa/root,georgtroska/root,gbitzes/root,smarinac/root,abhinavmoudgil95/root,perovic/root,zzxuanyuan/root,satyarth934/root,esakellari/my_root_for_test,CristinaCristescu/root,abhinavmoudgil95/root,thomaskeck/root,buuck/root,agarciamontoro/root,beniz/root,bbockelm/root,Dr15Jones/root,mattkretz/root,sirinath/root,jrtomps/root,karies/root,sbinet/cxx-root,sirinath/root,olifre/root,Duraznos/root,olifre/root,lgiommi/root,sbinet/cxx-root,sawenzel/root,kirbyherm/root-r-tools,olifre/root,BerserkerTroll/root,alexschlueter/cern-root,BerserkerTroll/root,arch1tect0r/root,Y--/root,buuck/root,olifre/root,lgiommi/root,sawenzel/root,georgtroska/root,sbinet/cxx-root,beniz/root,zzxuanyuan/root,mattkretz/root,bbockelm/root,thomaskeck/root,lgiommi/root,dfunke/root,kirbyherm/root-r-tools,esakellari/root,satyarth934/root,jrtomps/root,simonpf/root,strykejern/TTreeReader,evgeny-boger/root,Dr15Jones/root,mhuwiler/rootauto,mattkretz/root,0x0all/ROOT,dfunke/root,olifre/root,davidlt/root,cxx-hep/root-cern,krafczyk/root,simonpf/root,nilqed/root,Duraznos/root,sbinet/cxx-root,krafczyk/root,olifre/root,zzxuanyuan/root-compressor-dummy,smarinac/root,karies/root,buuck/root,beniz/root,zzxuanyuan/root,dfunke/root,Y--/root,CristinaCristescu/root,dfunke/root,krafczyk/root,Duraznos/root,zzxuanyuan/root,omazapa/root-old,alexschlueter/cern-root,satyarth934/root,mattkretz/root,abhinavmoudgil95/root,vukasinmilosevic/root,ffurano/root5,esakellari/my_root_for_test,veprbl/root,omazapa/root,georgtroska/root,Y--/root,mkret2/root,Y--/root,Y--/root,sbinet/cxx-root,sawenzel/root,lgiommi/root,omazapa/root,tc3t/qoot,georgtroska/root,Dr15Jones/root,simonpf/root,omazapa/root,esakellari/my_root_for_test,CristinaCristescu/root,veprbl/root,jrtomps/root,root-mirror/root,mattkretz/root,CristinaCristescu/root,evgeny-boger/root,beniz/root,krafczyk/root,karies/root,georgtroska/root,smarinac/root,0x0all/ROOT,Y--/root,nilqed/root,dfunke/root,arch1tect0r/root,bbockelm/root,pspe/root,tc3t/qoot,dfunke/root,lgiommi/root,0x0all/ROOT,gbitzes/root,abhinavmoudgil95/root,gganis/root,esakellari/root,strykejern/TTreeReader,BerserkerTroll/root,sbinet/cxx-root,veprbl/root,alexschlueter/cern-root,cxx-hep/root-cern,mhuwiler/rootauto,kirbyherm/root-r-tools,esakellari/root,karies/root,arch1tect0r/root,kirbyherm/root-r-tools,sirinath/root,lgiommi/root,esakellari/my_root_for_test,agarciamontoro/root,Duraznos/root,karies/root,beniz/root,georgtroska/root,simonpf/root,sirinath/root,olifre/root,mkret2/root |
8c5a18cd999cfd0edc1871e5cf797ff5e04ea20e | libevmjit/Common.h | libevmjit/Common.h | #pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some log library?
enum class ReturnCode
{
Stop = 0,
Return = 1,
Suicide = 2,
BadJumpDestination = 101,
OutOfGas = 102,
StackTooSmall = 103,
BadInstruction = 104,
LLVMConfigError = 201,
LLVMCompileError = 202,
LLVMLinkError = 203,
};
/// Representation of 256-bit value binary compatible with LLVM i256
// TODO: Replace with h256
struct i256
{
uint64_t a;
uint64_t b;
uint64_t c;
uint64_t d;
};
static_assert(sizeof(i256) == 32, "Wrong i265 size");
#define UNTESTED assert(false)
}
}
}
| #pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some log library?
enum class ReturnCode
{
Stop = 0,
Return = 1,
Suicide = 2,
BadJumpDestination = 101,
OutOfGas = 102,
StackTooSmall = 103,
BadInstruction = 104,
LLVMConfigError = 201,
LLVMCompileError = 202,
LLVMLinkError = 203,
};
/// Representation of 256-bit value binary compatible with LLVM i256
// TODO: Replace with h256
struct i256
{
uint64_t a = 0;
uint64_t b = 0;
uint64_t c = 0;
uint64_t d = 0;
};
static_assert(sizeof(i256) == 32, "Wrong i265 size");
#define UNTESTED assert(false)
}
}
}
| Fix some GCC initialization warnings | Fix some GCC initialization warnings
| C | mit | debris/evmjit,debris/evmjit,ethcore/evmjit,ethcore/evmjit |
787355ea64fb4a8967718cb1331b7cd1fa0d02e4 | test/cases/vla/argument_eval.c | test/cases/vla/argument_eval.c | // RUN: %ocheck 0 %s
// RUN: %ocheck 0 %s -fstack-protector-all
extern void abort(void);
as, bs, fs;
static int a(){ as++; return 2; }
static int b(){ bs++; return 2; }
static int f(int p[a()][b()])
{
fs++;
return p[0][0] + p[0][1] + p[1][0] + p[1][1];
}
static void assert(_Bool b)
{
if(!b)
abort();
}
int main()
{
int ar[a()][b()];
assert(as == 1);
assert(bs == 1);
assert(fs == 0);
ar[0][0] = 5;
ar[0][1] = 4;
ar[1][0] = 3;
ar[1][1] = 2;
assert(as == 1);
assert(bs == 1);
assert(fs == 0);
assert(f(ar) == 14);
assert(as == 2);
assert(bs == 2);
assert(fs == 1);
return 0;
}
| // RUN: %ocheck 0 %s
// RUN: %ocheck 0 %s -fstack-protector-all
extern void abort(void);
as, bs, fs;
static int a(){ as++; return 2; }
static int b(){ bs++; return 2; }
static int f(int p[a()][b()])
{
fs++;
return p[0][0] // 5
+ p[0][1] // 4
+ p[1][0] // 3
+ p[1][1] // 2
+ sizeof(p) // sizeof(T (*)[...]) = 8
+ sizeof(p[0]) // 2 * sizeof(int) = 8
+ sizeof(p[1][2]); // sizeof(int) = 4
}
static void assert(_Bool b)
{
if(!b)
abort();
}
int main()
{
int ar[a()][b()];
assert(as == 1);
assert(bs == 1);
assert(fs == 0);
ar[0][0] = 5;
ar[0][1] = 4;
ar[1][0] = 3;
ar[1][1] = 2;
assert(as == 1);
assert(bs == 1);
assert(fs == 0);
assert(f(ar) == 34);
assert(as == 2);
assert(bs == 2);
assert(fs == 1);
return 0;
}
| Improve checks for vla-argument test | Improve checks for vla-argument test
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
1f4f7b5c2796c5e950457563e6221351791958e6 | lib/int_util.h | lib/int_util.h | /* ===-- int_util.h - internal utility functions ----------------------------===
*
* 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 file is not part of the interface of this library.
*
* This file defines non-inline utilities which are available for use in the
* library. The function definitions themselves are all contained in int_util.c
* which will always be compiled into any compiler-rt library.
*
* ===-----------------------------------------------------------------------===
*/
#ifndef INT_UTIL_H
#define INT_UTIL_H
/** \brief Trigger a program abort (or panic for kernel code). */
#define compilerrt_abort() compilerrt_abort_impl(__FILE__, __LINE__, \
__FUNCTION__)
void compilerrt_abort_impl(const char *file, int line,
const char *function)
#ifndef KERNEL_USE
__attribute__((weak))
#endif
__attribute__((noreturn)) __attribute__((visibility("hidden")));
#endif /* INT_UTIL_H */
| /* ===-- int_util.h - internal utility functions ----------------------------===
*
* 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 file is not part of the interface of this library.
*
* This file defines non-inline utilities which are available for use in the
* library. The function definitions themselves are all contained in int_util.c
* which will always be compiled into any compiler-rt library.
*
* ===-----------------------------------------------------------------------===
*/
#ifndef INT_UTIL_H
#define INT_UTIL_H
/** \brief Trigger a program abort (or panic for kernel code). */
#define compilerrt_abort() compilerrt_abort_impl(__FILE__, __LINE__, \
__FUNCTION__)
void compilerrt_abort_impl(const char *file, int line,
const char *function) __attribute__((noreturn));
#endif /* INT_UTIL_H */
| Remove __attribute__((weak)) on function prototype. It has a different meaning on prototypes then it does on definitions. It is not needed on the prototype and causes build failures for static codegen | Remove __attribute__((weak)) on function prototype. It has a different meaning on prototypes then it does on definitions. It is not needed on the prototype and causes build failures for static codegen
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@149720 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 |
01cfab200399196583a306ad90e56349caf1925d | src/unshield-deobfuscate.c | src/unshield-deobfuscate.c | #include <stdio.h>
#include <stdlib.h>
#include "../lib/libunshield.h"
int main(int argc, char** argv)
{
unsigned seed = 0;
FILE* input = NULL;
FILE* output = NULL;
size_t size;
unsigned char buffer[16384];
if (argc != 3)
{
fprintf(stderr,
"Syntax:\n"
" %s INPUT-FILE OUTPUT-FILE\n",
argv[0]);
exit(1);
}
input = fopen(argv[1], "r");
if (!input)
{
fprintf(stderr,
"Failed to open %s for reading\n",
argv[1]);
exit(2);
}
output = fopen(argv[2], "w");
if (!output)
{
fprintf(stderr,
"Failed to open %s for writing\n",
argv[2]);
exit(3);
}
while ((size = fread(buffer, 1, sizeof(buffer), input)) != 0)
{
unshield_deobfuscate(buffer, size, &seed);
if (fwrite(buffer, 1, size, output) != size)
{
fprintf(stderr,
"Failed to write %lu bytes to %s\n",
(unsigned long)size, argv[2]);
exit(4);
}
}
fclose(input);
fclose(output);
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
#include "../lib/libunshield.h"
int main(int argc, char** argv)
{
unsigned seed = 0;
FILE* input = NULL;
FILE* output = NULL;
size_t size;
unsigned char buffer[16384];
if (argc != 3)
{
fprintf(stderr,
"Syntax:\n"
" %s INPUT-FILE OUTPUT-FILE\n",
argv[0]);
exit(1);
}
input = fopen(argv[1], "rb");
if (!input)
{
fprintf(stderr,
"Failed to open %s for reading\n",
argv[1]);
exit(2);
}
output = fopen(argv[2], "wb");
if (!output)
{
fprintf(stderr,
"Failed to open %s for writing\n",
argv[2]);
exit(3);
}
while ((size = fread(buffer, 1, sizeof(buffer), input)) != 0)
{
unshield_deobfuscate(buffer, size, &seed);
if (fwrite(buffer, 1, size, output) != size)
{
fprintf(stderr,
"Failed to write %lu bytes to %s\n",
(unsigned long)size, argv[2]);
exit(4);
}
}
fclose(input);
fclose(output);
return 0;
}
| Fix for binary files on Windows | Fix for binary files on Windows
Thanks @Djamana
Closes #46
| C | mit | twogood/unshield,twogood/unshield |
1bd3ca1cda84cf6eb32c99d83961904fe0bbc4b2 | lispy.h | lispy.h | #ifndef _LISPY_H
#define _LISPY_H
#include "lib/mpc.h"
/* Compile these functions if we're on Windows */
#ifdef _WIN32
static char buffer[2048];
char* readline(char* prompt) {
fputs(prompt, stdout);
fgets(buffer, 2048, stdin);
char* cpy = malloc(strlen(buffer) + 1);
strcpy(cpy, buffer);
cpy[strlen(cpy) - 1] = "\0";
return cpy;
}
void add_history(char* unused) {}
#elif __APPLE__
#include <editline/readline.h>
#else
#include <editline/readline.h>
#include <editline/history.h>
#endif
/***************************
* Macros, Enums, and Structs
***************************/
#define LASSERT(args, cond, err) if (!(cond)) { lval_del(args); return lval_err(err); }
/* lval possible types */
enum { LVAL_NUM, LVAL_ERR, LVAL_SYM, LVAL_SEXPR, LVAL_QEXPR };
/* Lisp Value struct */
typedef struct lval {
int type;
long num;
/* String data for err and sym types */
char* err;
char* sym;
/* Count and pointer to a list of lvals */
int count;
struct lval** cell;
} lval;
/**********************
* Function declarations
**********************/
lval* lval_num(long);
lval* lval_err(char*);
lval* lval_sym(char*);
lval* lval_sexpr(void);
lval* lval_qepxr(void);
void lval_del(lval*);
lval* lval_add(lval*, lval*);
void lval_expr_print(lval*, char, char);
void lval_print(lval*);
void lval_println(lval*);
lval* lval_read_num(mpc_ast_t*);
lval* lval_read(mpc_ast_t*);
lval* lval_pop(lval*, int);
lval* lval_take(lval*, int);
lval* lval_eval(lval*);
lval* lval_eval_sexpr(lval*);
lval* builtin(lval*, char*);
lval* builtin_op(lval*, char*);
lval* builtin_head(lval*);
lval* builtin_tail(lval*);
lval* builtin_list(lval*);
lval* builtin_eval(lval*);
lval* builtin_join(lval*);
lval* lval_join(lval*, lval*);
#endif | Add header file to git | Add header file to git
| C | mit | mahimahi42/lispy |
|
c0d5a95745e15c8f215a66445cca5e05e46e0c10 | arc/arc/Controllers/Protocols/FolderViewControllerDelegate.h | arc/arc/Controllers/Protocols/FolderViewControllerDelegate.h | //
// FolderViewControllerDelegate.h
// arc
//
// Created by Jerome Cheng on 17/4/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "File.h"
#import "Folder.h"
@class FolderViewController;
@protocol FolderViewControllerDelegate <NSObject>
- (void)folderViewController:(FolderViewController *)sender selectedFile:(id<File>)file;
- (void)folderViewController:(FolderViewController *)sender selectedFolder:(id<Folder>)folder;
@end
| //
// FolderViewControllerDelegate.h
// arc
//
// Created by Jerome Cheng on 17/4/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "File.h"
#import "Folder.h"
@class FolderViewController;
@protocol FolderViewControllerDelegate <NSObject>
// Allows delegate to know which file or folder was selected in navigation mode.
- (void)folderViewController:(FolderViewController *)sender selectedFile:(id<File>)file;
- (void)folderViewController:(FolderViewController *)sender selectedFolder:(id<Folder>)folder;
// Allows the delegate to know if the controller has entered or left editing mode.
- (void)folderViewController:(FolderViewController *)folderviewController
DidEnterEditModeAnimate:(BOOL)animate;
- (void)folderViewController:(FolderViewController *)folderviewController DidExitEditModeAnimate:(BOOL)animate;
@end
| Add methods to notify FolderView delegate when edit mode is toggled. | Add methods to notify FolderView delegate when edit mode is toggled.
| C | mit | BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc |
7f736d700feb00e8a5d39c687f1f118f067429d6 | projects/com.oracle.truffle.llvm.test/tests/c/long-to-function-ptr-call.c | projects/com.oracle.truffle.llvm.test/tests/c/long-to-function-ptr-call.c | void abort();
int add(int a, int b) { return a + b; }
int sub(int a, int b) { return a - b; }
int mul(int a, int b) { return a * b; }
int div(int a, int b) { return a / b; }
int rem(int a, int b) { return a % b; }
long arr[5] = {(long)&add, (long)&sub, (long)&mul, (long)&div, (long)&rem };
int main() {
int i;
int sum = 0;
for (i = 0; i < 10000; i++) {
int (*p)(int x, int y) = (int (*)(int x, int y))arr[i % 5];
sum += p(i, 2);
}
if (sum != 44991000) {
abort();
}
}
| Add test case for casting longs to function pointers | Add test case for casting longs to function pointers
| C | bsd-3-clause | lxp/sulong,crbb/sulong,lxp/sulong,PrinzKatharina/sulong,lxp/sulong,crbb/sulong,lxp/sulong,PrinzKatharina/sulong,crbb/sulong,crbb/sulong,PrinzKatharina/sulong,PrinzKatharina/sulong |
|
56a77a274be12217e07ca8c4b5e2dabdac3c0c2b | peertalk/PTPrivate.h | peertalk/PTPrivate.h | #if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8))
#define PT_DISPATCH_RETAIN_RELEASE 1
#endif
#if (!defined(PT_DISPATCH_RETAIN_RELEASE))
#define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime))
#define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused))
#else
#define PT_PRECISE_LIFETIME
#define PT_PRECISE_LIFETIME_UNUSED
#endif
| #if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8))
#define PT_DISPATCH_RETAIN_RELEASE 1
#else
#define PT_DISPATCH_RETAIN_RELEASE 0
#endif
#if PT_DISPATCH_RETAIN_RELEASE
#define PT_PRECISE_LIFETIME
#define PT_PRECISE_LIFETIME_UNUSED
#else
#define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime))
#define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused))
#endif
| Synchronize logical grouping of defines | Synchronize logical grouping of defines
| C | mit | rsms/peertalk,rsms/peertalk,rsms/peertalk |
ae3b44ac78004f3e03173b13a0d1cc456677370a | objc/message.h | objc/message.h | #ifndef _OBJC_MESSAGE_H_
#define _OBJC_MESSAGE_H_
#if defined(__x86_64) || defined(__i386) || defined(__arm__) || \
defined(__mips_n64) || defined(__mips_n32)
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return either an
* integer, a pointer, or a small structure value that is returned in
* registers. Be aware that calling conventions differ between operating
* systems even within the same architecture, so take great care if using this
* function for small (two integer) structures.
*/
id objc_msgSend(id self, SEL _cmd, ...);
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return a
* structure that is not returned in registers. Be aware that calling
* conventions differ between operating systems even within the same
* architecture, so take great care if using this function for small (two
* integer) structures.
*/
#ifdef __cplusplus
id objc_msgSend_stret(id self, SEL _cmd, ...);
#else
void objc_msgSend_stret(id self, SEL _cmd, ...);
#endif
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return floating
* point values.
*/
long double objc_msgSend_fpret(id self, SEL _cmd, ...);
#endif
#endif //_OBJC_MESSAGE_H_
| Fix clang's stupid warning to work around a bug in OS X headers... | Fix clang's stupid warning to work around a bug in OS X headers...
| C | mit | darlinghq/darling-libobjc2,davidchisnall/libobjc2,darlinghq/darling-libobjc2,gnustep/libobjc2,davidchisnall/libobjc2,gnustep/libobjc2,crystax/android-vendor-libobjc2,crystax/android-vendor-libobjc2,ngrewe/libobjc2,ngrewe/libobjc2 |
|
130f6f3b116db2168b0656d8e1cf4bb7053388ec | cuser/acpica/acenv_header.h | cuser/acpica/acenv_header.h | #define ACPI_MACHINE_WIDTH 64
#define ACPI_SINGLE_THREADED
#define ACPI_DEBUG_OUTPUT
#define ACPI_DISASSEMBLER
#define ACPI_USE_LOCAL_CACHE
#define ACPI_INLINE inline
#define ACPI_USE_NATIVE_DIVIDE
// Depends on threading support
#define ACPI_DEBUGGER
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
// Depends on debugger support
//#define ACPI_DBG_TRACK_ALLOCATIONS
#define ACPI_PHYS_BASE 0x100000000
#if 0
#define AcpiException(ModName, Line, Status, Format, ...) \
AcpiOsPrintf(ACPI_MSG_EXCEPTION "%s, " Format, \
AcpiFormatException(Status), \
## __VA_ARGS__)
#endif
#include <stdint.h>
#include <stdarg.h>
#define AcpiOsPrintf printf
#define AcpiOsVprintf vprintf
| #define ACPI_MACHINE_WIDTH 64
#define ACPI_SINGLE_THREADED
#define ACPI_DEBUG_OUTPUT
#define ACPI_DISASSEMBLER
#define ACPI_USE_LOCAL_CACHE
#define ACPI_INLINE inline
#define ACPI_USE_NATIVE_DIVIDE
// Depends on threading support
#define ACPI_DEBUGGER
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
// Depends on debugger support
//#define ACPI_DBG_TRACK_ALLOCATIONS
#define ACPI_PHYS_BASE 0x100000000
#if 0
#define AcpiException(ModName, Line, Status, Format, ...) \
AcpiOsPrintf(ACPI_MSG_EXCEPTION "%s, " Format, \
AcpiFormatException(Status), \
## __VA_ARGS__)
#endif
#define ACPI_GET_FUNCTION_NAME __FUNCTION__
#include <stdint.h>
#include <stdarg.h>
#define AcpiOsPrintf printf
#define AcpiOsVprintf vprintf
| Use GCC's __FUNCTION__ for ACPI_GET_FUNCTION_NAME | Use GCC's __FUNCTION__ for ACPI_GET_FUNCTION_NAME
| C | mit | olsner/os,olsner/os,olsner/os,olsner/os |
1d092135d5973e22550e260c944c2c5e7678923a | src/main.c | src/main.c | #include <stdlib.h>
#include <ncurses.h>
/**
* The main function, called when atcso is started (duh).
*/
int main(int argc, char** argv) {
initscr();
raw(); // Disable line buffering
noecho(); // Don't show things the user is typing
printw("hai wurld");
refresh();
while (getch() != 'q'); // Wait for the user to hit `q' to quit
endwin();
return EXIT_SUCCESS;
}
| #include <stdlib.h>
#include <ncurses.h>
#include <time.h>
typedef struct {
} AtcsoData;
void mainloop();
WINDOW *createRadarWin();
void updateRadarWin(AtcsoData *data, WINDOW *radarWin);
/**
* The main function, called when atcso is started (duh).
*/
int main(int argc, char **argv) {
initscr();
raw(); // Disable line buffering
noecho(); // Don't show things the user is typing
nodelay(stdscr, TRUE); // Non-blocking getch()
mainloop(); // Start the game!
endwin();
return EXIT_SUCCESS;
}
/**
* The main loop: runs infinitely until the game is ended.
*/
void mainloop() {
// get all our windows
refresh();
WINDOW *radarWin = createRadarWin();
// TODO put this somewhere... better
const int TICK_DELAY = 2;
// the main loop
int ch;
time_t lastTick = time(NULL);
AtcsoData data;
for (;;) {
if (difftime(time(NULL), lastTick) > TICK_DELAY) {
updateRadarWin(&data, radarWin);
lastTick += TICK_DELAY;
}
if ((ch = getch()) != ERR) {
switch (ch) {
case 'q':
case 'Q':
goto cleanup;
}
}
}
cleanup:
delwin(radarWin);
}
/**
* Creates the radar window, the biggest one that has all the planes and stuff.
*/
WINDOW *createRadarWin() {
WINDOW *radarWin = newwin(21, 60, 0, 0);
for (int i = 0; i < 59; ++i) waddch(radarWin, '-');
waddch(radarWin, ' ');
for (int i = 0; i < 19; ++i) {
waddstr(radarWin, "| ");
for (int j = 0; j < 28; ++j) waddstr(radarWin, ". ");
waddstr(radarWin, "| ");
}
for (int i = 0; i < 59; ++i) waddch(radarWin, '-');
waddch(radarWin, ' ');
wrefresh(radarWin);
return radarWin;
}
/**
* Update and refresh the radar window.
*/
void updateRadarWin(AtcsoData *data, WINDOW *radarWin) {
// TODO do stuff
}
| Implement outline of "radar window" | Implement outline of "radar window"
The radar window is simply the "main" window, with all the planes and
stuff.
This commit draws the outline of this window, and it also adds a few
pieces of code that will serve as a framework for future inter-window
communication.
| C | mit | KeyboardFire/atcso |
07eb6bd1593c5e96c68d418ea23706e27874b7e8 | features/netsocket/nsapi.h | features/netsocket/nsapi.h |
/** \addtogroup netsocket */
/** @{*/
/* nsapi.h - The network socket API
* Copyright (c) 2015 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 NSAPI_H
#define NSAPI_H
// entry point for nsapi types
#include "nsapi_types.h"
#ifdef __cplusplus
// entry point for C++ api
#include "netsocket/SocketAddress.h"
#include "netsocket/NetworkStack.h"
#include "netsocket/NetworkInterface.h"
#include "netsocket/EthInterface.h"
#include "netsocket/WiFiInterface.h"
#include "netsocket/CellularBase.h"
#include "netsocket/MeshInterface.h"
#include "netsocket/Socket.h"
#include "netsocket/UDPSocket.h"
#include "netsocket/TCPSocket.h"
#include "netsocket/TCPServer.h"
#endif
#endif
/** @}*/
|
/** \addtogroup netsocket */
/** @{*/
/* nsapi.h - The network socket API
* Copyright (c) 2015 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 NSAPI_H
#define NSAPI_H
// entry point for nsapi types
#include "nsapi_types.h"
#ifdef __cplusplus
// entry point for C++ api
#include "netsocket/SocketAddress.h"
#include "netsocket/NetworkStack.h"
#include "netsocket/NetworkInterface.h"
#include "netsocket/EthInterface.h"
#include "netsocket/WiFiInterface.h"
#include "netsocket/CellularBase.h"
#include "netsocket/MeshInterface.h"
#include "netsocket/Socket.h"
#include "netsocket/UDPSocket.h"
#include "netsocket/TCPSocket.h"
#include "netsocket/TCPServer.h"
#include "netsocket/TLSSocket.h"
#endif
#endif
/** @}*/
| Add missing include for TLSSocket | Add missing include for TLSSocket
TCP and UDP sockets are automatically available when mbed.h is
included in an application.
This change lets the TLSSocket be used in the same way.
| C | apache-2.0 | andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os |
88dd832b22b4927f9d571158c0429df0a50fd6d8 | sigaltstack.c | sigaltstack.c | #include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
write(2, "stack overflow\n", 15);
longjmp(try, ++i);
_exit(1);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int main() {
char* stack;
stack = malloc(sizeof(stack) * SIGSTKSZ);
stack_t ss = {
.ss_size = SIGSTKSZ,
.ss_sp = stack,
};
struct sigaction sa = {
.sa_handler = handler,
.sa_flags = SA_ONSTACK
};
sigaltstack(&ss, 0);
sigfillset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, 0);
if (setjmp(try) < 3) {
recurse(0);
} else {
printf("caught exception!\n");
}
return 0;
}
| #include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
printf("stack overflow %d\n", i);
longjmp(try, ++i);
assert(0);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int main() {
char* stack;
stack = malloc(sizeof(stack) * SIGSTKSZ);
stack_t ss = {
.ss_size = SIGSTKSZ,
.ss_sp = stack,
};
struct sigaction sa = {
.sa_handler = handler,
.sa_flags = SA_ONSTACK
};
sigaltstack(&ss, 0);
sigfillset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, 0);
if (setjmp(try) < 3) {
recurse(0);
} else {
printf("caught exception!\n");
}
return 0;
}
| Add assert, more print info | Add assert, more print info
| C | apache-2.0 | danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets |
13bdfcd1c659359289f373052b21fb9f998dcc0b | test/Preprocessor/microsoft-import.c | test/Preprocessor/microsoft-import.c | // RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:100:2: error: #import of type library is an unsupported Microsoft feature'
// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:200:2: error: #import of type library is an unsupported Microsoft feature'
// RUN: %clang_cc1 -E -fms-compatibility %s 2>&1 | grep 'doh.c:300:2: error: #import of type library is an unsupported Microsoft feature'
#line 100 "doh.c"
#import "pp-record.h" // expected-error {{#import of type library is an unsupported Microsoft feature}}
// Test attributes
#line 200 "doh.c"
#import "pp-record.h" no_namespace, auto_rename // expected-error {{#import of type library is an unsupported Microsoft feature}}
// This will also fire the "#import of type library is an unsupported Microsoft feature"
// error, but we can't use -verify because there's no way to put the comment on the proper line
#line 300 "doh.c"
#import "pp-record.h" no_namespace \
auto_rename \
auto_search
| // RUN: %clang_cc1 -E -verify -fms-compatibility %s
#import "pp-record.h" // expected-error {{#import of type library is an unsupported Microsoft feature}}
// Test attributes
#import "pp-record.h" no_namespace, auto_rename // expected-error {{#import of type library is an unsupported Microsoft feature}}
#import "pp-record.h" no_namespace \
auto_rename \
auto_search
// expected-error@-3 {{#import of type library is an unsupported Microsoft feature}}
| Migrate a test to -verify | Migrate a test to -verify
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@173716 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
b0e5fd7a307529651190ddd452f54b25d1c38a78 | src/ptwise/updates.h | src/ptwise/updates.h |
// Upwind updater
void updater_first_order_dimensional_splitting(real* q,
const real* aux,
const int nx,
const int ny,
const real* amdq,
const real* apdq,
const real* wave,
const real* wave_speeds,
const rp_grid_params grid_params
)
{
int col, row, idx_left, idx_center, idx_up, idx_out_x, idx_out_y;
const int num_ghost = grid_params.num_ghost;
const int num_states = grid_params.num_states;
// const int num_waves = rp_grid_params.num_waves;
#pragma omp parallel for schedule(runtime) nowait
for(row = num_ghost; row <= ny + num_ghost; ++row) {
for(col = num_ghost; col <= nx + num_ghost; ++col) {
idx_left = col + row*(nx + 2*num_ghost) - 1;
idx_up = col + (row - 1)*(nx + 2*num_ghost);
idx_center = idx_left + 1;
idx_out_x = (col - num_ghost) + (row - num_ghost) * (nx + 1);
idx_out_y = idx_out_x + ((nx + 1)*(ny + 1));
for(int state=0; state < num_states; ++state){
q[idx_left*num_states + state] -= amdq[idx_out_x*num_states + state];
q[idx_up*num_states + state] -= amdq[idx_out_y*num_states + state];
q[idx_center*num_states + state] -= apdq[idx_out_x*num_states + state];
q[idx_center*num_states + state] -= apdq[idx_out_y*num_states + state];
}
}
}
}
| Add first order dimensional sweep updating | Add first order dimensional sweep updating
| C | bsd-3-clause | ManyClaw/ManyClaw,ManyClaw/ManyClaw,ManyClaw/ManyClaw |
|
49248d85df3037126b8282cae0610f9c499da548 | tests/compiler/cxx_runtime.h | tests/compiler/cxx_runtime.h | //
// Copyright 2013 Jeff Bush
//
// 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.
//
//
// Symbols that need to be defined to use C++. These are stubs and don't
// actually do anything
//
namespace __cxxabiv1
{
class __class_type_info
{
public:
__class_type_info() {}
virtual ~__class_type_info() {}
};
class __si_class_type_info
{
public:
__si_class_type_info() {}
virtual ~__si_class_type_info() {}
};
__class_type_info cti;
__si_class_type_info sicti;
}
void operator delete(void *ptr) throw()
{
}
extern "C" void __dso_handle()
{
}
extern "C" void __cxa_atexit()
{
} | //
// Copyright 2013 Jeff Bush
//
// 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.
//
//
// Symbols that need to be defined to use C++. These are stubs and don't
// actually do anything
//
namespace __cxxabiv1
{
class __class_type_info
{
public:
__class_type_info() {}
virtual ~__class_type_info() {}
};
class __si_class_type_info
{
public:
__si_class_type_info() {}
virtual ~__si_class_type_info() {}
};
__class_type_info cti;
__si_class_type_info sicti;
}
void operator delete(void *ptr) throw()
{
}
void *__dso_handle;
extern "C" void __cxa_atexit(void (*f)(void *), void *objptr, void *dso)
{
} | Make these a bit more correct | Make these a bit more correct
| C | apache-2.0 | FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziProcessor,FulcronZ/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,hoangt/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor |
9f51152f683a4d5f48d6dd2db66b2909fd183b3c | Wangscape/codecs/TilesetCodec.h | Wangscape/codecs/TilesetCodec.h | #pragma once
#include <spotify/json.hpp>
#include "Tileset.h"
using namespace spotify::json::codec;
namespace spotify
{
namespace json
{
template<>
struct default_codec_t<Tileset>
{
static object_t<Tileset> codec()
{
auto codec = object<Tileset>();
codec.required("resolution", &Tileset::resolution);
codec.required("filename", &Tileset::filename);
codec.required("x", &Tileset::x);
codec.required("y", &Tileset::y);
codec.required("terrains", &Tileset::terrains);
return codec;
}
};
}
}
| Add a codec for Tileset | Add a codec for Tileset
| C | mit | serin-delaunay/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape |
|
7fe3a44fbf3767cc27c2c91dd0f328839be714a6 | src/commands.h | src/commands.h | #ifndef LACO_COMMANDS_H
#define LACO_COMMANDS_H
struct LacoState;
/**
* Gets passed ever line to see if it matches one of the REPL command. If it
* does, that command will be executed.
*/
void laco_handle_command(struct LacoState* laco, char* line);
#endif /* LACO_COMMANDS_H */
| #ifndef LACO_COMMANDS_H
#define LACO_COMMANDS_H
struct LacoState;
typedef void (*LacoHandler)(struct LacoState* laco, const char** arguments);
struct LacoCommand {
const char** matches;
LacoHandler handler;
};
/**
* Gets passed ever line to see if it matches one of the REPL command. If it
* does, that command will be executed.
*/
void laco_handle_command(struct LacoState* laco, char* line);
#endif /* LACO_COMMANDS_H */
| Define data types for structured command handling | Define data types for structured command handling
| C | bsd-2-clause | sourrust/laco |
97ccfa599c0479a4ea9b4df9291c564d5afd80e3 | test/Analysis/inline2.c | test/Analysis/inline2.c | // RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s
// Test parameter 'a' is registered to LiveVariables analysis data although it
// is not referenced in the function body.
int f1(int a) {
return 1;
}
void f2() {
int x;
x = f1(1);
}
| // RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s
// Test parameter 'a' is registered to LiveVariables analysis data although it
// is not referenced in the function body.
// Before processing 'return 1;', in RemoveDeadBindings(), we query the liveness
// of 'a', because we have a binding for it due to parameter passing.
int f1(int a) {
return 1;
}
void f2() {
int x;
x = f1(1);
}
| Add comments to test case. | Add comments to test case.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@97619 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
aee95684b289b3a34702454fbd1fa1bbd4e48d38 | src/gfx/gl/texture.h | src/gfx/gl/texture.h | /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "glad/glad.h"
#include "../texture.h"
namespace game { namespace gfx { namespace gl
{
struct GL_Texture : public Texture
{
void allocate_(Vec<int> const&, Image_Format) noexcept override;
inline void blit_data_(Volume<int> const& vol,
Color const* data) noexcept override
{
// Fuck it, it might work.
blit_data_(vol, Data_Type::Integer, data);
}
inline void blit_data_(Volume<int> const& vol,
float const* data) noexcept override
{
blit_data_(vol, Data_Type::Float, data);
}
void blit_data_(Volume<int> const&, Data_Type,
void const*) noexcept override;
GLuint tex_id;
GLenum texture_type;
Image_Format format_;
void bind(unsigned int loc) const noexcept;
};
} } }
| /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "glad/glad.h"
#include "../texture.h"
namespace game { namespace gfx { namespace gl
{
struct GL_Texture : public Texture
{
void allocate_(Vec<int> const&, Image_Format) noexcept override;
inline void blit_data_(Volume<int> const& vol,
Color const* data) noexcept override
{
// Fuck it, it might work.
static_assert(sizeof(Color) == sizeof(Color::c_t) * 4,
"Color struct must not have any padding.");
blit_data_(vol, Data_Type::Integer, data);
}
inline void blit_data_(Volume<int> const& vol,
float const* data) noexcept override
{
blit_data_(vol, Data_Type::Float, data);
}
void blit_data_(Volume<int> const&, Data_Type,
void const*) noexcept override;
GLuint tex_id;
GLenum texture_type;
Image_Format format_;
void bind(unsigned int loc) const noexcept;
};
} } }
| Verify array of colors is contigous | Verify array of colors is contigous
| C | bsd-3-clause | RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine |
909d0e643ab120ef34344d4b589408ac50d23570 | src/io/disk.h | src/io/disk.h | #ifndef DISK_H
#define DISK_H
#include "../process/process.h"
#ifdef __i386__
#define IOPRIO_GET 290
#elif __x86_64__
#define IOPRIO_GET 252
#endif
#define IOPRIO_WHO_PROCESS 1
#define IOPRIO_CLASS_SHIFT (13)
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
#define PRIOLEN 8
char *filesystem_type(void);
int ioprio_get(int pid);
char *ioprio_class(int pid);
char *ioprio_class_nice(int pid);
void proc_io(proc_t *procs);
#endif
| #ifndef DISK_H
#define DISK_H
#include <stdint.h>
#include "../process/process.h"
#ifdef __i386__
#define IOPRIO_GET 290
#elif __x86_64__
#define IOPRIO_GET 252
#endif
#define IOPRIO_WHO_PROCESS 1
#define IOPRIO_CLASS_SHIFT (13)
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
#define PRIOLEN 8
char *filesystem_type(void);
int ioprio_get(int pid);
char *ioprio_class(int pid);
char *ioprio_class_nice(int pid);
uint64_t get_process_taskstat_io(int pid, char field);
#endif
| Adjust declaration for taskstats io call | Adjust declaration for taskstats io call
| C | mit | tijko/dashboard |
105129546008a77655b14ed4987baee1401d5058 | fortune_points/geom/point.h | fortune_points/geom/point.h | #pragma once
struct Point{
double x,y;
Point();
/*
first double input param: x coordinate.
second double input param: y coordinate.
*/
Point(double,double);
bool operator<(Point)const;
bool operator==(Point)const;
};
double dist(Point a,Point b); | #pragma once
class Point{
public:
double x,y;
Point();
/*
first double input param: x coordinate.
second double input param: y coordinate.
*/
Point(double,double);
bool operator<(Point)const;
bool operator==(Point)const;
};
| Remove deprecated function and use class to define a Point | Remove deprecated function and use class to define a Point
| C | mit | matheusdallrosa/voronoi-diagram-construction,matheusdallrosa/voronoi-diagram-construction |
59d679f48e3c528ed883b8d0142b2e5086b2d45c | hab/proxr/cb-set-resource.c | hab/proxr/cb-set-resource.c | #include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
double data;
double content;
int id;
bionet_node_t *node;
bionet_value_get_float(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
// command proxr to adjust to new value
set_potentiometer(id, (int)data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_double(resource, content, NULL);
hab_report_datapoints(node);
return;
}
}
}
| #include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
double data;
double content;
int id;
bionet_node_t *node;
bionet_value_get_double(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
// command proxr to adjust to new value
set_potentiometer(id, (int)data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_double(resource, content, NULL);
hab_report_datapoints(node);
return;
}
}
}
| Change another float to double. | Change another float to double.
| C | lgpl-2.1 | ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.