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
|
---|---|---|---|---|---|---|---|---|---|
f7daed906287e6141ea04a1097672a544765f105 | src/qt/bitcoinaddressvalidator.h | src/qt/bitcoinaddressvalidator.h | #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base48 entry widget validator.
Corrects near-miss characters and refuses characters that are no part of base48.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressValidator(QObject *parent = 0);
State validate(QString &input, int &pos) const;
static const int MaxAddressLength = 35;
};
#endif // BITCOINADDRESSVALIDATOR_H
| #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator.
Corrects near-miss characters and refuses characters that are not part of base58.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressValidator(QObject *parent = 0);
State validate(QString &input, int &pos) const;
static const int MaxAddressLength = 35;
};
#endif // BITCOINADDRESSVALIDATOR_H
| Fix typo in a comment: it's base58, not base48. | Fix typo in a comment: it's base58, not base48.
| C | mit | Checkcoin/checkcoin,zemrys/vertcoin,KaSt/equikoin,bitgoldcoin-project/bitgoldcoin,Coinfigli/coinfigli,privatecoin/privatecoin,coinkeeper/2015-06-22_18-51_vertcoin,ohac/sakuracoin,gwangjin2/gwangcoin-core,coinkeeper/2015-04-19_21-20_litecoindark,brightcoin/brightcoin,Czarcoin/czarcoin,kryptokredyt/ProjektZespolowyCoin,degenorate/Deftcoin,chrisfranko/aiden,Rav3nPL/doubloons-08,bitgoldcoin-project/bitgoldcoin,coinkeeper/2015-04-19_21-20_litecoindark,marscoin/marscoin,coinkeeper/2015-06-22_18-46_razor,DrCrypto/darkcoin,zzkt/solarcoin,Ziftr/litecoin,shadowoneau/ozcoin,scamcoinz/scamcoin,netswift/vertcoin,icook/vertcoin,oklink-dev/litecoin_block,mooncoin-project/mooncoin-landann,Electronic-Gulden-Foundation/egulden,mrtexaznl/mediterraneancoin,IlfirinIlfirin/shavercoin,greencoin-dev/greencoin-dev,dakk/soundcoin,oklink-dev/litecoin_block,zebrains/Blotter,IlfirinCano/shavercoin,earthcoinproject/earthcoin,Dajackal/Ronpaulcoin,shadowoneau/ozcoin,okinc/litecoin,IlfirinCano/shavercoin,ronpaulcoin/ronpaulcoin,oklink-dev/litecoin_block,ohac/sakuracoin,CrimeaCoin/crimeacoin,Electronic-Gulden-Foundation/egulden,IlfirinCano/shavercoin,degenorate/Deftcoin,novaexchange/EAC,KaSt/equikoin,KaSt/equikoin,Litecoindark/LTCD,Checkcoin/checkcoin,netswift/vertcoin,vertcoin/eyeglass,shurcoin/shurcoin,wekuiz/wekoin,ohac/sha1coin,kryptokredyt/ProjektZespolowyCoin,ronpaulcoin/ronpaulcoin,Ziftr/litecoin,mooncoin-project/mooncoin-landann,brightcoin/brightcoin,micryon/GPUcoin,scamcoinz/scamcoin,plankton12345/litecoin,jiffe/cosinecoin,icook/vertcoin,cryptcoins/cryptcoin,Litecoindark/LTCD,gwangjin2/gwangcoin-core,ohac/sha1coin,united-scrypt-coin-project/unitedscryptcoin,chrisfranko/aiden,tensaix2j/bananacoin,ohac/sha1coin,united-scrypt-coin-project/unitedscryptcoin,brightcoin/brightcoin,coinkeeper/2015-04-19_21-20_litecoindark,bitgoldcoin-project/bitgoldcoin,plankton12345/litecoin,Ziftr/litecoin,shadowoneau/ozcoin,novaexchange/EAC,Ziftr/litecoin,cryptcoins/cryptcoin,Litecoindark/LTCD,bootycoin-project/bootycoin,privatecoin/privatecoin,zebrains/Blotter,IlfirinCano/shavercoin,shadowoneau/ozcoin,Tetcoin/tetcoin,Coinfigli/coinfigli,bitgoldcoin-project/bitgoldcoin,ohac/sakuracoin,neutrinofoundation/neutrino-digital-currency,DrCrypto/darkcoin,stamhe/litecoin,micryon/GPUcoin,tensaix2j/bananacoin,Czarcoin/czarcoin,richo/dongcoin,scamcoinz/scamcoin,ccoin-project/ccoin,gwangjin2/gwangcoin-core,coinkeeper/2015-04-19_21-20_litecoindark,mrtexaznl/mediterraneancoin,Litecoindark/LTCD,brightcoin/brightcoin,ANCompany/birdcoin-dev,netswift/vertcoin,plankton12345/litecoin,zemrys/vertcoin,scamcoinz/scamcoin,tensaix2j/bananacoin,okinc/litecoin,Dajackal/Ronpaulcoin,neutrinofoundation/neutrino-digital-currency,shurcoin/shurcoin,zebrains/Blotter,tensaix2j/bananacoin,dakk/soundcoin,jiffe/cosinecoin,IlfirinIlfirin/shavercoin,coinkeeper/2015-06-22_18-46_razor,coinkeeper/2015-06-22_18-46_razor,marscoin/marscoin,razor-coin/razor,earthcoinproject/earthcoin,coinkeeper/2015-06-22_18-46_razor,netswift/vertcoin,privatecoin/privatecoin,Electronic-Gulden-Foundation/egulden,marscoin/marscoin,brishtiteveja/sherlockholmescoin,Dajackal/Ronpaulcoin,bootycoin-project/bootycoin,Rav3nPL/doubloons-08,neutrinofoundation/neutrino-digital-currency,oklink-dev/litecoin_block,alexandrcoin/vertcoin,okinc/litecoin,mooncoin-project/mooncoin-landann,brishtiteveja/sherlockholmescoin,ANCompany/birdcoin-dev,coinkeeper/2015-06-22_19-13_florincoin,Dajackal/Ronpaulcoin,greencoin-dev/greencoin-dev,Czarcoin/czarcoin,KaSt/equikoin,coinkeeper/2015-06-22_19-13_florincoin,razor-coin/razor,Coinfigli/coinfigli,gwangjin2/gwangcoin-core,coinkeeper/2015-06-22_19-13_florincoin,shadowoneau/ozcoin,coinkeeper/2015-06-22_19-13_florincoin,koharjidan/litecoin,shapiroisme/datadollar,Cancercoin/Cancercoin,vertcoin/eyeglass,privatecoin/privatecoin,IlfirinIlfirin/shavercoin,jiffe/cosinecoin,razor-coin/razor,Tetcoin/tetcoin,zebrains/Blotter,vertcoin/eyeglass,Coinfigli/coinfigli,koharjidan/litecoin,richo/dongcoin,alexandrcoin/vertcoin,razor-coin/razor,koharjidan/litecoin,micryon/GPUcoin,Tetcoin/tetcoin,shurcoin/shurcoin,brishtiteveja/sherlockholmescoin,stamhe/litecoin,brishtiteveja/sherlockholmescoin,ohac/sha1coin,vertcoin/eyeglass,kryptokredyt/ProjektZespolowyCoin,Cancercoin/Cancercoin,coinkeeper/2015-06-22_18-51_vertcoin,ccoin-project/ccoin,earthcoinproject/earthcoin,zzkt/solarcoin,marscoin/marscoin,koharjidan/litecoin,richo/dongcoin,DrCrypto/darkcoin,brishtiteveja/sherlockholmescoin,novaexchange/EAC,vertcoin/eyeglass,kryptokredyt/ProjektZespolowyCoin,chrisfranko/aiden,bitgoldcoin-project/bitgoldcoin,shurcoin/shurcoin,degenorate/Deftcoin,kryptokredyt/ProjektZespolowyCoin,plankton12345/litecoin,cryptcoins/cryptcoin,alexandrcoin/vertcoin,coinkeeper/2015-06-22_18-51_vertcoin,CrimeaCoin/crimeacoin,Ziftr/litecoin,richo/dongcoin,Tetcoin/tetcoin,degenorate/Deftcoin,micryon/GPUcoin,chrisfranko/aiden,united-scrypt-coin-project/unitedscryptcoin,koharjidan/litecoin,Cancercoin/Cancercoin,icook/vertcoin,zzkt/solarcoin,Checkcoin/checkcoin,ohac/sakuracoin,united-scrypt-coin-project/unitedscryptcoin,novaexchange/EAC,greencoin-dev/greencoin-dev,mrtexaznl/mediterraneancoin,richo/dongcoin,shapiroisme/datadollar,alexandrcoin/vertcoin,stamhe/litecoin,chrisfranko/aiden,CrimeaCoin/crimeacoin,DrCrypto/darkcoin,cryptcoins/cryptcoin,coinkeeper/2015-06-22_18-46_razor,neutrinofoundation/neutrino-digital-currency,cryptcoins/cryptcoin,bootycoin-project/bootycoin,plankton12345/litecoin,earthcoinproject/earthcoin,marscoin/marscoin,Rav3nPL/doubloons-08,zebrains/Blotter,shurcoin/shurcoin,ANCompany/birdcoin-dev,oklink-dev/litecoin_block,Rav3nPL/doubloons-08,zemrys/vertcoin,Electronic-Gulden-Foundation/egulden,IlfirinIlfirin/shavercoin,greencoin-dev/greencoin-dev,Electronic-Gulden-Foundation/egulden,shapiroisme/datadollar,CrimeaCoin/crimeacoin,zzkt/solarcoin,zzkt/solarcoin,Czarcoin/czarcoin,coinkeeper/2015-06-22_18-51_vertcoin,gwangjin2/gwangcoin-core,netswift/vertcoin,IlfirinIlfirin/shavercoin,dakk/soundcoin,ANCompany/birdcoin-dev,mooncoin-project/mooncoin-landann,wekuiz/wekoin,united-scrypt-coin-project/unitedscryptcoin,coinkeeper/2015-06-22_18-51_vertcoin,dakk/soundcoin,okinc/litecoin,coinkeeper/2015-04-19_21-20_litecoindark,Rav3nPL/doubloons-08,netswift/vertcoin,shapiroisme/datadollar,Cancercoin/Cancercoin,wekuiz/wekoin,earthcoinproject/earthcoin,ronpaulcoin/ronpaulcoin,Electronic-Gulden-Foundation/egulden,Litecoindark/LTCD,stamhe/litecoin,Checkcoin/checkcoin,zemrys/vertcoin,Tetcoin/tetcoin,ohac/sha1coin,okinc/litecoin,wekuiz/wekoin,ccoin-project/ccoin,ohac/sakuracoin,novaexchange/EAC,dakk/soundcoin,ronpaulcoin/ronpaulcoin,shapiroisme/datadollar,zemrys/vertcoin,mrtexaznl/mediterraneancoin,razor-coin/razor,mooncoin-project/mooncoin-landann,Cancercoin/Cancercoin,koharjidan/litecoin,CrimeaCoin/crimeacoin,degenorate/Deftcoin,brightcoin/brightcoin,greencoin-dev/greencoin-dev,marscoin/marscoin,IlfirinCano/shavercoin,ccoin-project/ccoin,Czarcoin/czarcoin,ronpaulcoin/ronpaulcoin,scamcoinz/scamcoin,zemrys/vertcoin,icook/vertcoin,privatecoin/privatecoin,bootycoin-project/bootycoin,micryon/GPUcoin,ANCompany/birdcoin-dev,Dajackal/Ronpaulcoin,icook/vertcoin,Coinfigli/coinfigli,KaSt/equikoin,tensaix2j/bananacoin,wekuiz/wekoin,jiffe/cosinecoin,bootycoin-project/bootycoin,Checkcoin/checkcoin,mrtexaznl/mediterraneancoin,coinkeeper/2015-06-22_19-13_florincoin |
50d89048e3f9f8e98f0bcaa813bd87a1517e6d05 | Cutelyst/cutelyst_global.h | Cutelyst/cutelyst_global.h | #ifndef CUTELYST_GLOBAL_H
#define CUTELYST_GLOBAL_H
#include <QtCore/QtGlobal>
#if defined(CUTELYST_LIBRARY)
# define CUTELYST_LIBRARY Q_DECL_EXPORT
#else
# define CUTELYST_LIBRARY Q_DECL_IMPORT
#endif
#endif // CUTELYST_GLOBAL_H
| #ifndef CUTELYST_GLOBAL_H
#define CUTELYST_GLOBAL_H
#include <QtCore/QtGlobal>
// defined by cmake when building this library
#if defined(cutelyst_qt5_EXPORTS)
# define CUTELYST_LIBRARY Q_DECL_EXPORT
#else
# define CUTELYST_LIBRARY Q_DECL_IMPORT
#endif
#endif // CUTELYST_GLOBAL_H
| Make sure export macro is properly set | Make sure export macro is properly set
| C | bsd-3-clause | simonaw/cutelyst,cutelyst/cutelyst,buschmann23/cutelyst,buschmann23/cutelyst,cutelyst/cutelyst,cutelyst/cutelyst,buschmann23/cutelyst,simonaw/cutelyst |
1f2d0a53e4be19d374b02ac85442ba8ebe20ff30 | engine/include/graphics/Vertex.h | engine/include/graphics/Vertex.h | /*
* Copyright (c) 2017 Lech Kulina
*
* This file is part of the Realms Of Steel.
* For conditions of distribution and use, see copyright details in the LICENSE file.
*/
#ifndef ROS_VERTEX_H
#define ROS_VERTEX_H
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <core/Common.h>
#include <core/Environment.h>
namespace ros {
struct ROS_API Vertex {
glm::vec3 position;
glm::vec3 normal;
glm::vec3 tangent;
glm::vec3 bitangent;
glm::vec2 textureCoordinates;
glm::vec4 color;
};
typedef std::vector<Vertex> VertexVector;
typedef std::vector<U32> IndexVector;
}
#endif // ROS_VERTEX_H
| /*
* Copyright (c) 2017 Lech Kulina
*
* This file is part of the Realms Of Steel.
* For conditions of distribution and use, see copyright details in the LICENSE file.
*/
#ifndef ROS_VERTEX_H
#define ROS_VERTEX_H
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <core/Common.h>
#include <core/Environment.h>
namespace ros {
struct ROS_API Vertex {
static const U32 MAX_COLORS = 3;
static const U32 MAX_TEXTURE_COORDS = 3;
glm::vec4 colors[MAX_COLORS];
glm::vec3 textureCoords[MAX_TEXTURE_COORDS];
glm::vec3 position;
glm::vec3 normal;
glm::vec3 tangent;
glm::vec3 bitangent;
};
typedef std::vector<Vertex> VerticesVector;
}
#endif // ROS_VERTEX_H
| Support several texture coords and colors per vertex | Support several texture coords and colors per vertex
| C | apache-2.0 | lechkulina/RealmsOfSteel,lechkulina/RealmsOfSteel |
3b7b8507444b059534fe4d708ad8fd251b42c0c4 | ext/libxml/ruby_xml_namespaces.h | ext/libxml/ruby_xml_namespaces.h | /* $Id: ruby_xml_ns.h 612 2008-11-21 08:01:29Z cfis $ */
/* Please see the LICENSE file for copyright and distribution information */
#ifndef __RXML_NAMESPACES__
#define __RXML_NAMESPACES__
extern VALUE cXMLNamespaces;
void ruby_init_xml_namespaces(void);
#endif
| /* $Id: ruby_xml_ns.h 612 2008-11-21 08:01:29Z cfis $ */
/* Please see the LICENSE file for copyright and distribution information */
#ifndef __RXML_NAMESPACES__
#define __RXML_NAMESPACES__
extern VALUE cXMLNamespaces;
void rxml_init_namespaces(void);
#endif
| Fix up name of init_namespaces method. | Fix up name of init_namespaces method.
| C | mit | sferik/libxml-ruby,xml4r/libxml-ruby,sferik/libxml-ruby,increments/libxml-ruby,sferik/libxml-ruby,increments/libxml-ruby,sferik/libxml-ruby,xml4r/libxml-ruby,sferik/libxml-ruby,increments/libxml-ruby,sferik/libxml-ruby,xml4r/libxml-ruby |
9339344aec109c94237278e4544c8111cee6b3f4 | stdinc/sys/mman.h | stdinc/sys/mman.h | #pragma once
#include <uk/mman.h>
BEGIN_DECLS
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t length, int prot);
int madvise(void *addr, size_t length, int advice);
END_DECLS
| #pragma once
#include <sys/types.h>
#include <uk/mman.h>
BEGIN_DECLS
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t length, int prot);
int madvise(void *addr, size_t length, int advice);
END_DECLS
| Fix missing dependency on sys/types.h | stdinc: Fix missing dependency on sys/types.h
| C | mit | aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,bowlofstew/sv6,aclements/sv6,bowlofstew/sv6,aclements/sv6,aclements/sv6,bowlofstew/sv6 |
7ae7d98acee75625a8eaaa9074b0bc66deda76bd | main.c | main.c | //
// Created by wan on 1/2/16.
//
#include <stdio.h>
int main(void) {
printf("Input:");
int a;
scanf("%d", &a);
if (2016 % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = 2016;
printf("2016 = ");
int flag = 0, b;
for (b = 1111; b >= 1; b /= 10) {
int t = a * b;
for (;;) {
if (s >= t) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
else
break;
}
}
printf("\n");
return 0;
}
| //
// Created by Hexapetalous on 1/1/16.
//
#include <stdio.h>
int main(void) {
printf("Input[1]:");
int a;
scanf("%d", &a);
printf("Input[2]:");
int z;
scanf("%d", &z);
if (z % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = z;
printf("%d = ", z);
int flag = 0, b;
for (b = 1; b < s; b = b * 10 + 1)
;
for (b /= 10; b >= 1; b /= 10) {
int t = a * b;
for (; s >= t;) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
}
printf("\n");
return 0;
}
| Support to division every number. | Support to division every number.
| C | mit | hxptls/P0000,hxptls/P0000 |
5e6b427fb951576718f177f837daf81bf02cd721 | main.c | main.c | #include "scheme.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#ifndef DEFAULT_BOOTFILE_PATH
# define DEFAULT_BOOTFILE_PATH "./shen.boot"
#endif
static void custom_init(void) {}
int main(int argc, char *argv[]) {
int status;
char *bfpath = getenv("SHEN_BOOTFILE_PATH");
if (bfpath == NULL) {
bfpath = DEFAULT_BOOTFILE_PATH;
}
if (access(bfpath, F_OK) == -1) {
fprintf(stderr, "ERROR: boot file '%s' doesn't exist or is not readable.\n",
bfpath);
exit(1);
}
Sscheme_init(NULL);
Sregister_boot_file(bfpath);
Sbuild_heap(NULL, custom_init);
status = Sscheme_start(argc + 1, (const char**)argv - 1);
Sscheme_deinit();
exit(status);
}
| #include "scheme.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#ifndef DEFAULT_BOOTFILE_PATH
# define DEFAULT_BOOTFILE_PATH NULL
#endif
static void custom_init(void) {}
int main(int argc, char *argv[]) {
int status;
char *bfpath = getenv("SHEN_BOOTFILE_PATH");
if (bfpath == NULL) {
if (DEFAULT_BOOTFILE_PATH != NULL) {
bfpath = DEFAULT_BOOTFILE_PATH;
} else {
char buf[PATH_MAX];
char *last_slash;
realpath(argv[0], buf);
last_slash = strrchr(buf, '/') + 1;
strlcpy(last_slash, "shen.boot", last_slash - buf);
bfpath = buf;
}
}
if (access(bfpath, F_OK) == -1) {
fprintf(stderr, "ERROR: boot file '%s' doesn't exist or is not readable.\n",
bfpath);
exit(1);
}
Sscheme_init(NULL);
Sregister_boot_file(bfpath);
Sbuild_heap(NULL, custom_init);
status = Sscheme_start(argc + 1, (const char**)argv - 1);
Sscheme_deinit();
exit(status);
}
| Make it so that if no path for the shen boot file is specified, it is looked at the same directory of the shen-scheme executable | Make it so that if no path for the shen boot file is specified, it is looked at the same directory of the shen-scheme executable
| C | bsd-3-clause | tizoc/chibi-shen |
d7579b98bf36dbb78472aabfc269939e646f73bf | src/essentia/utils/extractor_freesound/extractor_version.h | src/essentia/utils/extractor_freesound/extractor_version.h | #ifndef EXTRACTOR_VERSION_H_
#define EXTRACTOR_VERSION_H_
#define FREESOUND_EXTRACTOR_VERSION "freesound 2.0"
#endif /* EXTRACTOR_VERSION_H_ */
| #ifndef EXTRACTOR_VERSION_H_
#define EXTRACTOR_VERSION_H_
#define FREESOUND_EXTRACTOR_VERSION "freesound 0.5"
#endif /* EXTRACTOR_VERSION_H_ */
| Change FreesoundExtractor version to 0.5 | Change FreesoundExtractor version to 0.5
After discussion (#582) we decided to keep incrementing 0.4
| C | agpl-3.0 | MTG/essentia,carthach/essentia,carthach/essentia,MTG/essentia,carthach/essentia,MTG/essentia,carthach/essentia,carthach/essentia,MTG/essentia,MTG/essentia |
8ff46ef395b30e1e3f9dd84c08e1b93796ab524d | Classes/AHKNavigationController.h | Classes/AHKNavigationController.h | // Created by Arkadiusz on 01-04-14.
#import <UIKit/UIKit.h>
/// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used.
@interface AHKNavigationController : UINavigationController
@end
| // Created by Arkadiusz on 01-04-14.
#import <UIKit/UIKit.h>
/// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used.
@interface AHKNavigationController : UINavigationController
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated __attribute__((objc_requires_super));
@end
| Add warning when a subclass doesn’t call super on pushViewController:animated: | Add warning when a subclass doesn’t call super on pushViewController:animated:
This method is used for keeping an internal state, so calling super is mandatory.
| C | mit | viccc/AHKNavigationController,kingiol/AHKNavigationController,MrAPPs-RSM/AHKNavigationController,fastred/AHKNavigationController |
afe1e6b8d950fe94627a200cf210a1e387c0c4d7 | generic/include/math/clc_ldexp.h | generic/include/math/clc_ldexp.h | _CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int);
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(double, int);
#endif
| _CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int);
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
_CLC_DEF _CLC_OVERLOAD double __clc_ldexp(double, int);
#endif
| Fix double precision function return type | ldexp: Fix double precision function return type
Fixes ~1200 external calls from nvtpx library.
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <[email protected]>
git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@315170 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc |
710392d8d8ce1a8938cee441186e5ff699b65973 | test/Driver/ubsan-ld.c | test/Driver/ubsan-ld.c | // Test UndefinedBehaviorSanitizer ld flags.
// RUN: %clang -fcatch-undefined-behavior %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LINUX %s
// CHECK-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-LINUX-NOT: "-lc"
// CHECK-LINUX: libclang_rt.ubsan-i386.a"
// CHECK-LINUX: "-lpthread"
| Add test for link flags added by -fcatch-undefined-behavior. | Add test for link flags added by -fcatch-undefined-behavior.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@167306 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-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,llvm-mirror/clang,llvm-mirror/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 |
|
bb97296d4b4285e6884e61ceda833af5a453cb91 | src/libfuzzymatch/util.h | src/libfuzzymatch/util.h | #include <cstdint>
#include <cstring>
#include <string>
#include <vector>
#include "../utf8/utf8.h"
/*
* Convert UTF-8 string to std::vector<uint32_t>
*/
void utf8to32(const std::string &s, std::vector<uint32_t> &vec) {
vec.assign(utf8::distance(s.cbegin(), s.cend()), 0);
utf8::utf8to32(s.cbegin(), s.cend(), vec.data());
}
/*
* Convert UTF-8 C-string to std::vector<uint32_t>
*/
void utf8to32(char* const s, std::vector<uint32_t> &vec) {
const size_t len(strlen(s));
vec.assign(utf8::distance(s, s+len), 0);
utf8::utf8to32(s, s+len, vec.data());
}
| #include <cstdint>
#include <cstring>
#include <string>
#include <vector>
#include "../utf8/utf8.h"
/*
* Convert UTF-8 string to std::vector<uint32_t>
*/
void inline utf8to32(const std::string &s, std::vector<uint32_t> &vec) {
vec.assign(utf8::distance(s.cbegin(), s.cend()), 0);
utf8::utf8to32(s.cbegin(), s.cend(), vec.data());
}
/*
* Convert UTF-8 C-string to std::vector<uint32_t>
*/
void inline utf8to32(char* const s, std::vector<uint32_t> &vec) {
const size_t len(strlen(s));
vec.assign(utf8::distance(s, s+len), 0);
utf8::utf8to32(s, s+len, vec.data());
}
| Use inline as a workaround so that the utf8 functions are not exported | Use inline as a workaround so that the utf8 functions are not exported
| C | mit | xhochy/libfuzzymatch,xhochy/libfuzzymatch |
fa9ee52556f493e4a896e2570ca1a3102d777d9a | src/policy/rbf.h | src/policy/rbf.h | // Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H
#include <txmempool.h>
enum class RBFTransactionState {
UNKNOWN,
REPLACEABLE_BIP125,
FINAL
};
// Determine whether an in-mempool transaction is signaling opt-in to RBF
// according to BIP 125
// This involves checking sequence numbers of the transaction, as well
// as the sequence numbers of all in-mempool ancestors.
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // BITCOIN_POLICY_RBF_H
| // Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H
#include <txmempool.h>
/** The rbf state of unconfirmed transactions */
enum class RBFTransactionState {
/** Unconfirmed tx that does not signal rbf and is not in the mempool */
UNKNOWN,
/** Either this tx or a mempool ancestor signals rbf */
REPLACEABLE_BIP125,
/** Neither this tx nor a mempool ancestor signals rbf */
FINAL,
};
/**
* Determine whether an unconfirmed transaction is signaling opt-in to RBF
* according to BIP 125
* This involves checking sequence numbers of the transaction, as well
* as the sequence numbers of all in-mempool ancestors.
*
* @param tx The unconfirmed transaction
* @param pool The mempool, which may contain the tx
*
* @return The rbf state
*/
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // BITCOIN_POLICY_RBF_H
| Add doxygen comment to IsRBFOptIn | doc: Add doxygen comment to IsRBFOptIn
| C | mit | MarcoFalke/bitcoin,AkioNak/bitcoin,GroestlCoin/GroestlCoin,dscotese/bitcoin,ElementsProject/elements,litecoin-project/litecoin,anditto/bitcoin,jamesob/bitcoin,EthanHeilman/bitcoin,jambolo/bitcoin,ajtowns/bitcoin,pataquets/namecoin-core,tecnovert/particl-core,sstone/bitcoin,domob1812/namecore,mm-s/bitcoin,jlopp/statoshi,AkioNak/bitcoin,EthanHeilman/bitcoin,ElementsProject/elements,namecoin/namecoin-core,ajtowns/bitcoin,achow101/bitcoin,mruddy/bitcoin,bitcoin/bitcoin,qtumproject/qtum,practicalswift/bitcoin,apoelstra/bitcoin,n1bor/bitcoin,mruddy/bitcoin,qtumproject/qtum,MeshCollider/bitcoin,jlopp/statoshi,pataquets/namecoin-core,lateminer/bitcoin,dscotese/bitcoin,ajtowns/bitcoin,yenliangl/bitcoin,AkioNak/bitcoin,prusnak/bitcoin,jamesob/bitcoin,achow101/bitcoin,andreaskern/bitcoin,bitcoinknots/bitcoin,kallewoof/bitcoin,mruddy/bitcoin,fanquake/bitcoin,cdecker/bitcoin,particl/particl-core,jambolo/bitcoin,practicalswift/bitcoin,MeshCollider/bitcoin,rnicoll/dogecoin,cdecker/bitcoin,MarcoFalke/bitcoin,GroestlCoin/bitcoin,namecoin/namecore,dscotese/bitcoin,prusnak/bitcoin,domob1812/namecore,prusnak/bitcoin,mm-s/bitcoin,practicalswift/bitcoin,rnicoll/bitcoin,namecoin/namecore,bitcoinsSG/bitcoin,cdecker/bitcoin,Sjors/bitcoin,ajtowns/bitcoin,GroestlCoin/GroestlCoin,jamesob/bitcoin,jonasschnelli/bitcoin,alecalve/bitcoin,anditto/bitcoin,GroestlCoin/bitcoin,jonasschnelli/bitcoin,pataquets/namecoin-core,bitcoinknots/bitcoin,JeremyRubin/bitcoin,mruddy/bitcoin,particl/particl-core,jlopp/statoshi,bitcoinsSG/bitcoin,anditto/bitcoin,AkioNak/bitcoin,mm-s/bitcoin,jamesob/bitcoin,MarcoFalke/bitcoin,fujicoin/fujicoin,practicalswift/bitcoin,jlopp/statoshi,prusnak/bitcoin,qtumproject/qtum,MeshCollider/bitcoin,pstratem/bitcoin,fanquake/bitcoin,alecalve/bitcoin,anditto/bitcoin,GroestlCoin/bitcoin,namecoin/namecore,apoelstra/bitcoin,litecoin-project/litecoin,particl/particl-core,namecoin/namecore,jonasschnelli/bitcoin,sstone/bitcoin,MarcoFalke/bitcoin,Xekyo/bitcoin,rnicoll/bitcoin,apoelstra/bitcoin,achow101/bitcoin,bitcoin/bitcoin,yenliangl/bitcoin,ElementsProject/elements,cdecker/bitcoin,sstone/bitcoin,pstratem/bitcoin,bitcoinsSG/bitcoin,kallewoof/bitcoin,rnicoll/dogecoin,namecoin/namecoin-core,instagibbs/bitcoin,rnicoll/bitcoin,yenliangl/bitcoin,lateminer/bitcoin,jlopp/statoshi,jambolo/bitcoin,tecnovert/particl-core,instagibbs/bitcoin,n1bor/bitcoin,domob1812/namecore,Xekyo/bitcoin,n1bor/bitcoin,JeremyRubin/bitcoin,pstratem/bitcoin,prusnak/bitcoin,namecoin/namecoin-core,bitcoin/bitcoin,jnewbery/bitcoin,domob1812/namecore,Xekyo/bitcoin,bitcoin/bitcoin,bitcoinknots/bitcoin,instagibbs/bitcoin,sstone/bitcoin,sipsorcery/bitcoin,yenliangl/bitcoin,apoelstra/bitcoin,dscotese/bitcoin,pstratem/bitcoin,achow101/bitcoin,particl/particl-core,kallewoof/bitcoin,anditto/bitcoin,qtumproject/qtum,MeshCollider/bitcoin,EthanHeilman/bitcoin,JeremyRubin/bitcoin,EthanHeilman/bitcoin,domob1812/bitcoin,apoelstra/bitcoin,pataquets/namecoin-core,ElementsProject/elements,particl/particl-core,bitcoinsSG/bitcoin,andreaskern/bitcoin,instagibbs/bitcoin,litecoin-project/litecoin,jnewbery/bitcoin,yenliangl/bitcoin,JeremyRubin/bitcoin,domob1812/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,GroestlCoin/bitcoin,qtumproject/qtum,MarcoFalke/bitcoin,instagibbs/bitcoin,MarcoFalke/bitcoin,sstone/bitcoin,JeremyRubin/bitcoin,litecoin-project/litecoin,ajtowns/bitcoin,andreaskern/bitcoin,kallewoof/bitcoin,domob1812/bitcoin,sipsorcery/bitcoin,cdecker/bitcoin,mruddy/bitcoin,GroestlCoin/bitcoin,namecoin/namecore,pataquets/namecoin-core,jnewbery/bitcoin,n1bor/bitcoin,Xekyo/bitcoin,ElementsProject/elements,jnewbery/bitcoin,bitcoinsSG/bitcoin,kallewoof/bitcoin,jamesob/bitcoin,particl/particl-core,mm-s/bitcoin,andreaskern/bitcoin,jlopp/statoshi,alecalve/bitcoin,pstratem/bitcoin,achow101/bitcoin,litecoin-project/litecoin,domob1812/namecore,Sjors/bitcoin,Sjors/bitcoin,rnicoll/dogecoin,tecnovert/particl-core,apoelstra/bitcoin,cdecker/bitcoin,tecnovert/particl-core,ElementsProject/elements,andreaskern/bitcoin,Sjors/bitcoin,dscotese/bitcoin,achow101/bitcoin,rnicoll/bitcoin,rnicoll/dogecoin,EthanHeilman/bitcoin,lateminer/bitcoin,GroestlCoin/bitcoin,GroestlCoin/GroestlCoin,rnicoll/dogecoin,alecalve/bitcoin,tecnovert/particl-core,lateminer/bitcoin,alecalve/bitcoin,fanquake/bitcoin,AkioNak/bitcoin,litecoin-project/litecoin,pataquets/namecoin-core,n1bor/bitcoin,Xekyo/bitcoin,dscotese/bitcoin,sipsorcery/bitcoin,practicalswift/bitcoin,rnicoll/bitcoin,andreaskern/bitcoin,bitcoinknots/bitcoin,bitcoin/bitcoin,tecnovert/particl-core,jambolo/bitcoin,domob1812/namecore,mm-s/bitcoin,prusnak/bitcoin,Xekyo/bitcoin,sipsorcery/bitcoin,lateminer/bitcoin,qtumproject/qtum,bitcoin/bitcoin,fanquake/bitcoin,fujicoin/fujicoin,fujicoin/fujicoin,fujicoin/fujicoin,sipsorcery/bitcoin,namecoin/namecoin-core,namecoin/namecoin-core,qtumproject/qtum,bitcoinknots/bitcoin,fujicoin/fujicoin,jambolo/bitcoin,jnewbery/bitcoin,practicalswift/bitcoin,n1bor/bitcoin,fanquake/bitcoin,ajtowns/bitcoin,namecoin/namecore,mruddy/bitcoin,GroestlCoin/GroestlCoin,fujicoin/fujicoin,MeshCollider/bitcoin,domob1812/bitcoin,jamesob/bitcoin,GroestlCoin/GroestlCoin,jambolo/bitcoin,Sjors/bitcoin,kallewoof/bitcoin,pstratem/bitcoin,fanquake/bitcoin,EthanHeilman/bitcoin,alecalve/bitcoin,rnicoll/bitcoin,sstone/bitcoin,jonasschnelli/bitcoin,GroestlCoin/GroestlCoin,namecoin/namecoin-core,JeremyRubin/bitcoin,sipsorcery/bitcoin,bitcoinsSG/bitcoin,anditto/bitcoin,mm-s/bitcoin,domob1812/bitcoin,MeshCollider/bitcoin,yenliangl/bitcoin,domob1812/bitcoin,instagibbs/bitcoin,jonasschnelli/bitcoin |
e2cd49be27b0e40467415fbc3318a5a4a5ad9161 | AFToolkit/AFToolkit.h | AFToolkit/AFToolkit.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 "NSBundle+Universal.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 "AFReachability.h"
#import "AFKVO.h"
#import "AFArray.h"
#import "AFMutableArray.h"
#import "NSBundle+Universal.h"
#import "UITableViewCell+Universal.h"
#import "AFDBClient.h"
#import "AFView.h"
#import "AFViewController.h" | Add Reachability to toolkit header. | Add Reachability to toolkit header.
| C | mit | mlatham/AFToolkit |
8ebf7bc9546695c516859093d8db0d300d8bd23c | stdlib/public/SwiftShims/RuntimeStubs.h | stdlib/public/SwiftShims/RuntimeStubs.h | //===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Misc stubs for functions which should be defined in the core standard
// library, but are difficult or impossible to write in Swift at the
// moment.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#define SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#include "LibcShims.h"
#ifdef __cplusplus
namespace swift { extern "C" {
#endif
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
__swift_ssize_t
swift_stdlib_readLine_stdin(char * _Nullable * _Nonnull LinePtr);
SWIFT_END_NULLABILITY_ANNOTATIONS
#ifdef __cplusplus
}} // extern "C", namespace swift
#endif
#endif // SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
| //===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Misc stubs for functions which should be defined in the core standard
// library, but are difficult or impossible to write in Swift at the
// moment.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#define SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#include "LibcShims.h"
#ifdef __cplusplus
namespace swift { extern "C" {
#endif
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
SWIFT_RUNTIME_STDLIB_INTERFACE
__swift_ssize_t
swift_stdlib_readLine_stdin(char * _Nullable * _Nonnull LinePtr);
SWIFT_END_NULLABILITY_ANNOTATIONS
#ifdef __cplusplus
}} // extern "C", namespace swift
#endif
#endif // SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
| Add export attribute to header declaration. | Add export attribute to header declaration.
| C | apache-2.0 | gribozavr/swift,djwbrown/swift,xedin/swift,calebd/swift,austinzheng/swift,lorentey/swift,gmilos/swift,shajrawi/swift,tardieu/swift,alblue/swift,roambotics/swift,rudkx/swift,IngmarStein/swift,codestergit/swift,jtbandes/swift,practicalswift/swift,manavgabhawala/swift,brentdax/swift,airspeedswift/swift,aschwaighofer/swift,tjw/swift,jmgc/swift,CodaFi/swift,parkera/swift,ahoppen/swift,practicalswift/swift,gregomni/swift,nathawes/swift,natecook1000/swift,frootloops/swift,gottesmm/swift,jmgc/swift,jckarter/swift,modocache/swift,practicalswift/swift,parkera/swift,gribozavr/swift,milseman/swift,devincoughlin/swift,JGiola/swift,tardieu/swift,gottesmm/swift,karwa/swift,hooman/swift,deyton/swift,practicalswift/swift,ben-ng/swift,shahmishal/swift,amraboelela/swift,ben-ng/swift,deyton/swift,gribozavr/swift,ben-ng/swift,amraboelela/swift,austinzheng/swift,atrick/swift,shahmishal/swift,natecook1000/swift,brentdax/swift,harlanhaskins/swift,bitjammer/swift,austinzheng/swift,jopamer/swift,danielmartin/swift,sschiau/swift,ben-ng/swift,karwa/swift,nathawes/swift,Jnosh/swift,roambotics/swift,jtbandes/swift,tinysun212/swift-windows,harlanhaskins/swift,xedin/swift,JaSpa/swift,bitjammer/swift,uasys/swift,xedin/swift,therealbnut/swift,shajrawi/swift,shahmishal/swift,benlangmuir/swift,parkera/swift,huonw/swift,lorentey/swift,gregomni/swift,manavgabhawala/swift,IngmarStein/swift,therealbnut/swift,alblue/swift,shajrawi/swift,tjw/swift,xwu/swift,benlangmuir/swift,arvedviehweger/swift,atrick/swift,allevato/swift,tjw/swift,bitjammer/swift,natecook1000/swift,swiftix/swift,JaSpa/swift,gmilos/swift,lorentey/swift,aschwaighofer/swift,rudkx/swift,bitjammer/swift,OscarSwanros/swift,milseman/swift,amraboelela/swift,manavgabhawala/swift,brentdax/swift,JGiola/swift,nathawes/swift,xedin/swift,jtbandes/swift,shahmishal/swift,calebd/swift,Jnosh/swift,tinysun212/swift-windows,devincoughlin/swift,russbishop/swift,allevato/swift,dreamsxin/swift,Jnosh/swift,Jnosh/swift,swiftix/swift,allevato/swift,uasys/swift,return/swift,felix91gr/swift,hooman/swift,shajrawi/swift,tinysun212/swift-windows,airspeedswift/swift,benlangmuir/swift,JaSpa/swift,aschwaighofer/swift,arvedviehweger/swift,practicalswift/swift,parkera/swift,sschiau/swift,deyton/swift,harlanhaskins/swift,modocache/swift,kperryua/swift,gregomni/swift,shajrawi/swift,huonw/swift,ken0nek/swift,huonw/swift,natecook1000/swift,return/swift,shajrawi/swift,ken0nek/swift,calebd/swift,bitjammer/swift,JaSpa/swift,sschiau/swift,jopamer/swift,jmgc/swift,parkera/swift,jmgc/swift,felix91gr/swift,sschiau/swift,zisko/swift,shahmishal/swift,lorentey/swift,parkera/swift,IngmarStein/swift,stephentyrone/swift,calebd/swift,devincoughlin/swift,djwbrown/swift,tinysun212/swift-windows,atrick/swift,hooman/swift,swiftix/swift,stephentyrone/swift,frootloops/swift,kperryua/swift,kstaring/swift,austinzheng/swift,ben-ng/swift,ahoppen/swift,stephentyrone/swift,tjw/swift,kstaring/swift,uasys/swift,djwbrown/swift,atrick/swift,modocache/swift,austinzheng/swift,sschiau/swift,stephentyrone/swift,gmilos/swift,practicalswift/swift,JaSpa/swift,gribozavr/swift,glessard/swift,manavgabhawala/swift,IngmarStein/swift,brentdax/swift,milseman/swift,Jnosh/swift,kperryua/swift,huonw/swift,devincoughlin/swift,nathawes/swift,deyton/swift,kstaring/swift,felix91gr/swift,russbishop/swift,jtbandes/swift,codestergit/swift,codestergit/swift,huonw/swift,gribozavr/swift,hughbe/swift,roambotics/swift,swiftix/swift,allevato/swift,sschiau/swift,hooman/swift,uasys/swift,tardieu/swift,frootloops/swift,ken0nek/swift,danielmartin/swift,kstaring/swift,shajrawi/swift,milseman/swift,milseman/swift,practicalswift/swift,karwa/swift,zisko/swift,alblue/swift,ahoppen/swift,codestergit/swift,glessard/swift,glessard/swift,allevato/swift,return/swift,Jnosh/swift,shahmishal/swift,djwbrown/swift,milseman/swift,jmgc/swift,devincoughlin/swift,uasys/swift,milseman/swift,tjw/swift,karwa/swift,natecook1000/swift,karwa/swift,jckarter/swift,rudkx/swift,austinzheng/swift,devincoughlin/swift,ahoppen/swift,xwu/swift,airspeedswift/swift,harlanhaskins/swift,CodaFi/swift,modocache/swift,atrick/swift,therealbnut/swift,JGiola/swift,kperryua/swift,airspeedswift/swift,manavgabhawala/swift,gregomni/swift,aschwaighofer/swift,OscarSwanros/swift,russbishop/swift,parkera/swift,codestergit/swift,natecook1000/swift,russbishop/swift,rudkx/swift,ben-ng/swift,IngmarStein/swift,allevato/swift,zisko/swift,jckarter/swift,CodaFi/swift,gmilos/swift,frootloops/swift,deyton/swift,ken0nek/swift,return/swift,harlanhaskins/swift,gottesmm/swift,kperryua/swift,djwbrown/swift,ahoppen/swift,swiftix/swift,stephentyrone/swift,russbishop/swift,gribozavr/swift,huonw/swift,arvedviehweger/swift,therealbnut/swift,airspeedswift/swift,jtbandes/swift,tkremenek/swift,lorentey/swift,lorentey/swift,OscarSwanros/swift,CodaFi/swift,atrick/swift,Jnosh/swift,tardieu/swift,tkremenek/swift,JGiola/swift,nathawes/swift,airspeedswift/swift,tardieu/swift,benlangmuir/swift,dreamsxin/swift,return/swift,rudkx/swift,gottesmm/swift,swiftix/swift,JGiola/swift,felix91gr/swift,shahmishal/swift,danielmartin/swift,kperryua/swift,devincoughlin/swift,swiftix/swift,lorentey/swift,xedin/swift,russbishop/swift,xwu/swift,calebd/swift,allevato/swift,brentdax/swift,alblue/swift,xwu/swift,karwa/swift,therealbnut/swift,apple/swift,jopamer/swift,roambotics/swift,jmgc/swift,arvedviehweger/swift,devincoughlin/swift,felix91gr/swift,deyton/swift,jopamer/swift,kstaring/swift,hooman/swift,roambotics/swift,danielmartin/swift,modocache/swift,uasys/swift,hughbe/swift,huonw/swift,kstaring/swift,frootloops/swift,nathawes/swift,glessard/swift,jopamer/swift,JaSpa/swift,bitjammer/swift,therealbnut/swift,ken0nek/swift,sschiau/swift,apple/swift,felix91gr/swift,aschwaighofer/swift,gregomni/swift,alblue/swift,codestergit/swift,OscarSwanros/swift,modocache/swift,hughbe/swift,jtbandes/swift,xwu/swift,harlanhaskins/swift,gottesmm/swift,CodaFi/swift,zisko/swift,tinysun212/swift-windows,danielmartin/swift,jckarter/swift,tkremenek/swift,zisko/swift,hooman/swift,benlangmuir/swift,return/swift,apple/swift,karwa/swift,hughbe/swift,hughbe/swift,shahmishal/swift,kperryua/swift,aschwaighofer/swift,gottesmm/swift,apple/swift,jmgc/swift,xedin/swift,xedin/swift,amraboelela/swift,airspeedswift/swift,tinysun212/swift-windows,hughbe/swift,gmilos/swift,stephentyrone/swift,aschwaighofer/swift,IngmarStein/swift,kstaring/swift,jckarter/swift,IngmarStein/swift,CodaFi/swift,nathawes/swift,ahoppen/swift,zisko/swift,parkera/swift,amraboelela/swift,rudkx/swift,deyton/swift,gribozavr/swift,uasys/swift,arvedviehweger/swift,jtbandes/swift,frootloops/swift,jckarter/swift,danielmartin/swift,jckarter/swift,manavgabhawala/swift,tinysun212/swift-windows,gmilos/swift,gmilos/swift,return/swift,brentdax/swift,zisko/swift,tardieu/swift,tjw/swift,benlangmuir/swift,natecook1000/swift,apple/swift,stephentyrone/swift,karwa/swift,danielmartin/swift,arvedviehweger/swift,amraboelela/swift,roambotics/swift,practicalswift/swift,sschiau/swift,arvedviehweger/swift,jopamer/swift,modocache/swift,OscarSwanros/swift,hughbe/swift,alblue/swift,codestergit/swift,therealbnut/swift,felix91gr/swift,djwbrown/swift,tkremenek/swift,tardieu/swift,xwu/swift,JaSpa/swift,xedin/swift,glessard/swift,tjw/swift,OscarSwanros/swift,JGiola/swift,ben-ng/swift,calebd/swift,OscarSwanros/swift,ken0nek/swift,gottesmm/swift,apple/swift,gregomni/swift,austinzheng/swift,tkremenek/swift,jopamer/swift,harlanhaskins/swift,alblue/swift,ken0nek/swift,hooman/swift,russbishop/swift,brentdax/swift,gribozavr/swift,amraboelela/swift,lorentey/swift,bitjammer/swift,djwbrown/swift,tkremenek/swift,CodaFi/swift,manavgabhawala/swift,glessard/swift,frootloops/swift,calebd/swift,xwu/swift,shajrawi/swift,tkremenek/swift |
b009cbb951c0ac55f7122b9a492a4f9e395a3d86 | src/tests/test-grabber.c | src/tests/test-grabber.c | /* Media Server - a library and daemon for medias indexation and streaming
*
* Copyright (C) 2012 Enna Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED "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.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ems_private.h"
static void
_end_grab_cb(void *data __UNUSED__, const char *filename __UNUSED__)
{
DBG("End Grab");
ecore_main_loop_quit();
}
/*============================================================================*
* Global *
*============================================================================*/
int main(int argc __UNUSED__, char **argv)
{
Eina_Module *m;
char tmp[PATH_MAX];
void (*grab)(const char *filename, Ems_Media_Type type,
void (*Ems_Grabber_End_Cb)(void *data, const char *filename),
void *data
);
ems_init(NULL);
eina_init();
ecore_init();
ecore_con_init();
ecore_con_url_init();
DBG("%s init", argv[0]);
if (!argv[1])
{
printf("USAGE : %s grabber_name", argv[0]);
exit(0);
}
DBG("Try to load %s", argv[1]);
DBG("Searh for modules in %s with arch %s", PACKAGE_LIB_DIR "/ems/grabbers", MODULE_ARCH);
snprintf(tmp, sizeof(tmp), PACKAGE_LIB_DIR"/ems/grabbers/%s/%s/module.so", argv[1], MODULE_ARCH);
DBG("Complete path module %s", tmp);
m = eina_module_new(tmp);
eina_module_load(m);
grab = eina_module_symbol_get(m, "ems_grabber_grab");
if (grab)
{
DBG("Grab file");
grab(argv[2],
1,
_end_grab_cb, NULL);
}
ecore_main_loop_begin();
eina_module_free(m);
ems_shutdown();
return EXIT_SUCCESS;
} | Add test program for easier grabber's tests | Add test program for easier grabber's tests
| C | bsd-2-clause | raoulh/Enna-Media-Server,raoulh/Enna-Media-Server,enna-project/Enna-Media-Server,enna-project/Enna-Media-Server,enna-project/Enna-Media-Server,raoulh/Enna-Media-Server,raoulh/Enna-Media-Server,raoulh/Enna-Media-Server,enna-project/Enna-Media-Server,enna-project/Enna-Media-Server |
|
e1559a5b92d6db3880f6226e03aed4f5cc1182e0 | src/chip8.c | src/chip8.c | #include <stdlib.h>
#include "chip8.h"
chip8_t *
chip8_new(void) {
chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));
/* The first 512 bytes are used by the interpreter. */
self->program_counter = 0x200;
self->index_register = 0;
self->stack_pointer = 0;
self->opcode = 0;
return self;
}
void
chip8_free(chip8_t * self) {
free(self);
}
| #include <stdlib.h>
#include "chip8.h"
chip8_t * chip8_new(void) {
chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));
/* The first 512 bytes are used by the interpreter. */
self->program_counter = 0x200;
self->index_register = 0;
self->stack_pointer = 0;
self->opcode = 0;
return self;
}
void chip8_free(chip8_t * self) {
free(self);
}
| Define the functions on one line | Define the functions on one line
| C | mit | gsamokovarov/chip8.c,gsamokovarov/chip8.c |
8f6c32d4d8124bd58caf7886dda3032641416ded | CCMessageWindow/Utils.h | CCMessageWindow/Utils.h | #ifndef StringUtils_h
#define StringUtils_h
#include <stdio.h>
#include <string.h>
namespace CCMessageWindow {
class Utils {
public:
static std::string substringUTF8(const char* str, int from, int length);
static std::vector<std::string> split(const std::string& input, char delimiter);
static std::string replace(std::string base, std::string src, std::string dst);
};
}
#endif /* StringUtils_hpp */
| #ifndef StringUtils_h
#define StringUtils_h
#include "cocos2d.h"
namespace CCMessageWindow {
class Utils {
public:
static std::string substringUTF8(const char* str, int from, int length);
static std::vector<std::string> split(const std::string& input, char delimiter);
static std::string replace(std::string base, std::string src, std::string dst);
};
}
#endif /* StringUtils_hpp */
| Fix build error on Android | Fix build error on Android
| C | mit | giginet/CCMessageWindow,giginet/CCMessageWindow |
1a848c2eb37fc488b610ad36f562c705594b7e00 | UICountingLabel.h | UICountingLabel.h | #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef enum {
UILabelCountingMethodEaseInOut,
UILabelCountingMethodEaseIn,
UILabelCountingMethodEaseOut,
UILabelCountingMethodLinear
} UILabelCountingMethod;
typedef NSString* (^UICountingLabelFormatBlock)(float value);
typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(float value);
@interface UICountingLabel : UILabel
@property (nonatomic, strong) NSString *format;
@property (nonatomic, assign) UILabelCountingMethod method;
@property (nonatomic, assign) NSTimeInterval animationDuration;
@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock;
@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock;
@property (nonatomic, copy) void (^completionBlock)();
-(void)countFrom:(float)startValue to:(float)endValue;
-(void)countFrom:(float)startValue to:(float)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromCurrentValueTo:(float)endValue;
-(void)countFromCurrentValueTo:(float)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromZeroTo:(float)endValue;
-(void)countFromZeroTo:(float)endValue withDuration:(NSTimeInterval)duration;
- (CGFloat)currentValue;
@end
| #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, UILabelCountingMethod) {
UILabelCountingMethodEaseInOut,
UILabelCountingMethodEaseIn,
UILabelCountingMethodEaseOut,
UILabelCountingMethodLinear
};
typedef NSString* (^UICountingLabelFormatBlock)(float value);
typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(float value);
@interface UICountingLabel : UILabel
@property (nonatomic, strong) NSString *format;
@property (nonatomic, assign) UILabelCountingMethod method;
@property (nonatomic, assign) NSTimeInterval animationDuration;
@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock;
@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock;
@property (nonatomic, copy) void (^completionBlock)();
-(void)countFrom:(float)startValue to:(float)endValue;
-(void)countFrom:(float)startValue to:(float)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromCurrentValueTo:(float)endValue;
-(void)countFromCurrentValueTo:(float)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromZeroTo:(float)endValue;
-(void)countFromZeroTo:(float)endValue withDuration:(NSTimeInterval)duration;
- (CGFloat)currentValue;
@end
| Use NS_ENUM instead of enum makes more clear | Use NS_ENUM instead of enum makes more clear
| C | mit | AlexanderMazaletskiy/UICountingLabel,HarrisLee/UICountingLabel,jesseclay/UICountingLabel,flovilmart/UICountingLabel,kalsariyac/UICountingLabel,ElaWorkshop/UICountingLabel,Bogon/UICountingLabel,dataxpress/UICountingLabel |
4dc9c4567301f2481b12965bdcf02a7281963b61 | tests/utils/core-utils.h | tests/utils/core-utils.h | /* * This file is part of meego-im-framework *
*
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* Contact: Nokia Corporation ([email protected])
*
* If you have questions regarding the use of this file, please contact
* Nokia at [email protected].
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* and appearing in the file LICENSE.LGPL included in the packaging
* of this file.
*/
#ifndef CORE_UTILS_H__
#define CORE_UTILS_H__
#include <QString>
#include <QObject>
namespace MaliitTestUtils {
bool isTestingInSandbox();
QString getTestPluginPath();
QString getTestDataPath();
void waitForSignal(const QObject* object, const char* signal, int timeout);
void waitAndProcessEvents(int waitTime);
}
#endif // CORE_UTILS_H__
| /* * This file is part of meego-im-framework *
*
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* Contact: Nokia Corporation ([email protected])
*
* If you have questions regarding the use of this file, please contact
* Nokia at [email protected].
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* and appearing in the file LICENSE.LGPL included in the packaging
* of this file.
*/
#ifndef CORE_UTILS_H__
#define CORE_UTILS_H__
#include <QString>
#include <QObject>
#include "abstractsurfacegroup.h"
#include "abstractsurfacegroupfactory.h"
namespace MaliitTestUtils {
bool isTestingInSandbox();
QString getTestPluginPath();
QString getTestDataPath();
void waitForSignal(const QObject* object, const char* signal, int timeout);
void waitAndProcessEvents(int waitTime);
class TestSurfaceGroup : public Maliit::Server::AbstractSurfaceGroup {
public:
TestSurfaceGroup() {}
Maliit::Plugins::AbstractSurfaceFactory *factory() { return 0; }
void activate() {}
void deactivate() {}
void setRotation(Maliit::OrientationAngle) {}
};
class TestSurfaceGroupFactory : public Maliit::Server::AbstractSurfaceGroupFactory {
public:
TestSurfaceGroupFactory() {}
QSharedPointer<Maliit::Server::AbstractSurfaceGroup> createSurfaceGroup()
{
return QSharedPointer<Maliit::Server::AbstractSurfaceGroup>(new TestSurfaceGroup);
}
};
}
#endif // CORE_UTILS_H__
| Add surface server side implementation for tests | Add surface server side implementation for tests
Add a TestSurfaceGroup and TestSurfaceGroupFactory class for tests.
RevBy: TrustMe.
| C | lgpl-2.1 | binlaten/framework,RHawkeyed/framework,jpetersen/framework,Elleo/framework,jpetersen/framework,RHawkeyed/framework,Elleo/framework |
a2a4eaa93d4a34930006126154be25f5543182c7 | CONFIG/nlp_exception.h | CONFIG/nlp_exception.h | /**
* nlp_exception.h
* Copyright (C) 2015 Tony Lim <[email protected]>
*
* Distributed under terms of the MIT license.
*/
#ifndef NLP_EXCEPTION_H
#define NLP_EXCEPTION_H
#include <exception>
using namespace std;
namespace NLP
{
class unimplemented_exc: public exception
{
virtual const char* what() const throw()
{
return "Unimplemented error.";
}
};
} /* NLP */
#endif /* !NLP_EXCEPTION_H */
| Add global exception functions to CONFIG | Add global exception functions to CONFIG
| C | mit | NLP/NLP |
|
15ddd7987b08b24d572ad3c767fd477dfc5a3bd7 | inc/m_types.h | inc/m_types.h | /*********************************** LICENSE **********************************\
* Copyright 2017 Morphux *
* *
* 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 M_TYPES_H
# define M_TYPES_H
/* Generic types */
typedef signed char s8_t;
typedef signed short s16_t;
typedef signed int s32_t;
typedef signed long long s64_t;
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned int u32_t;
typedef unsigned long long u64_t;
#endif /* M_TYPES_H */
| /*********************************** LICENSE **********************************\
* Copyright 2017 Morphux *
* *
* 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 M_TYPES_H
# define M_TYPES_H
/* Generic types */
typedef signed char s8_t;
typedef signed short s16_t;
typedef signed int s32_t;
typedef signed long long s64_t;
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned int u32_t;
typedef unsigned long long u64_t;
#endif /* M_TYPES_H */
| Fix comment style in mtypes | Fix(Comment): Fix comment style in mtypes
| C | apache-2.0 | Morphux/lib,Morphux/lib |
bcd0f03a33b360f54b0223e64bd5dae90d3a0e2c | include/lambdacommon/document/document.h | include/lambdacommon/document/document.h | /*
* Copyright © 2017 AperLambda <[email protected]>
*
* This file is part of λcommon.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
#ifndef LAMBDACOMMON_DOCUMENT_H
#define LAMBDACOMMON_DOCUMENT_H
#include "../lambdacommon.h"
#include <map>
namespace lambdacommon
{
class LAMBDACOMMON_API Content
{};
class LAMBDACOMMON_API Document
{};
}
#endif //LAMBDACOMMON_DOCUMENT_H | /*
* Copyright © 2017 AperLambda <[email protected]>
*
* This file is part of λcommon.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
#ifndef LAMBDACOMMON_DOCUMENT_H
#define LAMBDACOMMON_DOCUMENT_H
#include "../lambdacommon.h"
#include <map>
namespace lambdacommon
{
class LAMBDACOMMON_API Element
{};
class LAMBDACOMMON_API Document
{};
}
#endif //LAMBDACOMMON_DOCUMENT_H | Change the Content class to the Element class | :floppy_disk: Change the Content class to the Element class
| C | mit | AperEntertainment/AperCommon,AperEntertainment/AperCommon |
56165c0f2c2978fe33730fae100183291c828361 | src/example/kernel/thread/event_thread.c | src/example/kernel/thread/event_thread.c | /**
* @file
*
* @brief
*
* @date 15.01.2013
* @author Lapshin Alexander
*/
#include <stdio.h>
#include <errno.h>
#include <framework/example/self.h>
#include <kernel/thread/api.h>
#include <kernel/thread/event.h>
#include <util/macro.h>
/**
* This macro is used to register this example at the system.
*/
EMBOX_EXAMPLE(run);
/** The thread handler function*/
static void *thread_run(void *arg) {
struct event *event = (struct event *)arg;
/**waiting until event receives */
printf("waiting for event's notifying...\n");
event_wait(event, SCHED_TIMEOUT_INFINITE);
printf("event has been received.\n");
return 0;
}
static int run(int argc, char **argv) {
struct event sync_event;
struct thread *thread;
event_init(&sync_event, "sync_event");
thread_create(&thread, 0, thread_run, &sync_event);
/**need some delay here
* because thread should have time to sleep
* within "event_wait" till invoking
* "event_notify" function.
*/
sleep(1);
event_notify(&sync_event);
thread_join(thread, NULL);
return ENOERR;
}
| Add example for working threads and events | Add example for working threads and events | C | bsd-2-clause | embox/embox,embox/embox,vrxfile/embox-trik,embox/embox,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,Kefir0192/embox,vrxfile/embox-trik,gzoom13/embox,mike2390/embox,Kefir0192/embox,abusalimov/embox,gzoom13/embox,Kakadu/embox,Kakadu/embox,abusalimov/embox,embox/embox,Kakadu/embox,mike2390/embox,embox/embox,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,mike2390/embox,Kakadu/embox,embox/embox,abusalimov/embox,vrxfile/embox-trik,gzoom13/embox,mike2390/embox,gzoom13/embox,Kefir0192/embox,gzoom13/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,mike2390/embox,vrxfile/embox-trik,mike2390/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,mike2390/embox,Kefir0192/embox,gzoom13/embox,abusalimov/embox |
|
b00e6535be25fca1e9775951bd09542fdb88ce7d | libyaul/common/internal_exception_show.c | libyaul/common/internal_exception_show.c | /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#include <stdlib.h>
#include <vdp1.h>
#include <vdp2.h>
#include <vdp2/tvmd.h>
#include <vdp2/vram.h>
#include <cons.h>
void __noreturn
internal_exception_show(const char *buffer)
{
/* Reset the VDP1 */
vdp1_init();
/* Reset the VDP2 */
vdp2_init();
vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A,
TVMD_VERT_224);
vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE),
COLOR_RGB555(0, 7, 0));
vdp2_tvmd_display_set();
cons_init(CONS_DRIVER_VDP2, 40, 28);
cons_buffer(buffer);
vdp2_tvmd_vblank_out_wait();
vdp2_tvmd_vblank_in_wait();
vdp2_commit();
cons_flush();
abort();
}
| /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#include <stdlib.h>
#include <vdp1.h>
#include <vdp2.h>
#include <vdp2/tvmd.h>
#include <vdp2/vram.h>
#include <cons.h>
void __noreturn
internal_exception_show(const char *buffer)
{
/* Reset the VDP1 */
vdp1_init();
/* Reset the VDP2 */
vdp2_init();
vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A,
TVMD_VERT_224);
vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE),
COLOR_RGB555(0, 7, 0));
/* Set sprite to type 0 and set its priority to 0 (invisible) */
vdp2_sprite_type_set(0);
vdp2_sprite_priority_set(0, 0);
vdp2_tvmd_display_set();
cons_init(CONS_DRIVER_VDP2, 40, 28);
cons_buffer(buffer);
vdp2_tvmd_vblank_out_wait();
vdp2_tvmd_vblank_in_wait();
vdp2_commit();
cons_flush();
abort();
}
| Hide VDP1 even if FB hasn't been erased and changed | Hide VDP1 even if FB hasn't been erased and changed
| C | mit | ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul |
61eadb0255925c8ad74710c0694ac7d9639b3c30 | test/CFrontend/2002-11-07-Redefinition.c | test/CFrontend/2002-11-07-Redefinition.c | /* Provide Declarations */
#ifndef NULL
#define NULL 0
#endif
#ifndef __cplusplus
typedef unsigned char bool;
#endif
/* Support for floating point constants */
typedef unsigned long long ConstantDoubleTy;
typedef unsigned int ConstantFloatTy;
/* Global Declarations */
/* External Global Variable Declarations */
/* Function Declarations */
void __main();
int printf(signed char *, ...);
void testfunc(short l5_s, float l11_X, signed char l3_C, signed long long l9_LL, int l7_I, double l12_D);
void main();
/* Malloc to make sun happy */
extern void * malloc(size_t);
/* Global Variable Declerations */
extern signed char l27_d_LC0[26];
/* Global Variable Definitions and Initialization */
static signed char l27_d_LC0[26] = "%d, %f, %d, %lld, %d, %f\n";
/* Function Bodies */
void testfunc(short l5_s, float l11_X, signed char l3_C, signed long long l9_LL, int l7_I, double l12_D) {
int l7_reg226;
l7_reg226 = printf((&(l27_d_LC0[0ll])), ((unsigned )l5_s), ((double )l11_X), ((unsigned )l3_C), l9_LL, l7_I, l12_D);
return;
}
void main() {
const ConstantFloatTy FloatConstant0 = 0x3f9f5c29; /* 1.245 */
const ConstantDoubleTy FloatConstant1 = 0x432ff973cafa8000; /* 4.5e+15 */
__main();
testfunc(12, (*(float*)&FloatConstant0), 120, 123456677890ll, -10, (*(double*)&FloatConstant1));
return;
}
| Check in an old testcase | Check in an old testcase
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@4951 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap |
|
ea9bfa8b10fc564c1b76d6984baadd9c72f8041b | test/test_list.c | test/test_list.c | #include <stdio.h>
#include <stdlib.h>
#include "list.h"
struct list {
int ctx;
struct list_head loc;
};
int main(int argc, char *argv[])
{
struct list l[3];
for(int i = 0; i < 3; i++)
{
l[i].ctx = i * 10;
//l[i].loc = (struct list_head *) malloc(sizeof(struct list_head));
}
LIST_HEAD(start);
//INIT_LIST_HEAD(l[0].loc);
//INIT_LIST_HEAD(l[1].loc);
//INIT_LIST_HEAD(l[2].loc);
//struct list_head *start = l[0].loc;
//list_add(start, l[1].loc);
//list_add(start, l[2].loc);
list_add_tail(&l[0].loc, &start);
list_add_tail(&l[1].loc, &start);
list_add_tail(&l[2].loc, &start);
//struct list_head *tmp = start;
struct list_head *tmp;
list_for_each(tmp, &start)
{
printf("%d\n", list_entry(tmp, struct list, loc)->ctx);
}
}
| Test "list" embeding to arbitary struct It is not confortable for me to use too much "address of". | Test "list" embeding to arbitary struct
It is not confortable for me to use too much "address of".
| C | bsd-2-clause | yenWu/DDNS,yenWu/DDNS |
|
0773e72754c7ec546ccf0a93bf6b4b321fc7899e | windows/dirent.h | windows/dirent.h | #ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H
#if defined(__cplusplus)
extern "C" {
#endif
//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper. We might convert these into an toku_os_* type api.
enum {
DT_UNKNOWN = 0,
DT_DIR = 4,
DT_REG = 8
};
struct dirent {
char d_name[_MAX_PATH];
unsigned char d_type;
};
struct __toku_windir;
typedef struct __toku_windir DIR;
DIR *opendir(const char *name);
struct dirent *readdir(DIR *dir);
int closedir(DIR *dir);
#ifndef NAME_MAX
#define NAME_MAX 255
#endif
#if defined(__cplusplus)
};
#endif
#endif
| #ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H
#include "toku_os_types.h"
#if defined(__cplusplus)
extern "C" {
#endif
//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper. We might convert these into an toku_os_* type api.
enum {
DT_UNKNOWN = 0,
DT_DIR = 4,
DT_REG = 8
};
struct dirent {
char d_name[_MAX_PATH];
unsigned char d_type;
};
struct __toku_windir;
typedef struct __toku_windir DIR;
DIR *opendir(const char *name);
struct dirent *readdir(DIR *dir);
int closedir(DIR *dir);
#ifndef NAME_MAX
#define NAME_MAX 255
#endif
#if defined(__cplusplus)
};
#endif
#endif
| Fix broken windows build due to r19902 (merge of 2499d branch) | [t:2499] Fix broken windows build due to r19902 (merge of 2499d branch)
git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@19935 c7de825b-a66e-492c-adef-691d508d4ae1
| C | lgpl-2.1 | natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,natsys/mariadb_10.2,kuszmaul/PerconaFT,flynn1973/mariadb-aix,davidl-zend/zenddbi,kuszmaul/PerconaFT-tmp,davidl-zend/zenddbi,ottok/PerconaFT,ollie314/server,slanterns/server,BohuTANG/ft-index,percona/PerconaFT,BohuTANG/ft-index,davidl-zend/zenddbi,ollie314/server,kuszmaul/PerconaFT-tmp,ollie314/server,ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,BohuTANG/ft-index,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,ottok/PerconaFT,percona/PerconaFT,natsys/mariadb_10.2,davidl-zend/zenddbi,davidl-zend/zenddbi,natsys/mariadb_10.2,kuszmaul/PerconaFT-tmp,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,ottok/PerconaFT,flynn1973/mariadb-aix,percona/PerconaFT,percona/PerconaFT,flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,kuszmaul/PerconaFT-tmp,ottok/PerconaFT,natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,kuszmaul/PerconaFT,flynn1973/mariadb-aix,kuszmaul/PerconaFT,flynn1973/mariadb-aix,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,BohuTANG/ft-index,flynn1973/mariadb-aix,ollie314/server,kuszmaul/PerconaFT |
05fd893ea40718a0f0f81246425dfcb4b711642c | drivers/auth/mbedtls/mbedtls_common.c | drivers/auth/mbedtls/mbedtls_common.c | /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
/* mbed TLS headers */
#include <mbedtls/memory_buffer_alloc.h>
#include <mbedtls/platform.h>
/*
* mbed TLS heap
*/
#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
#define MBEDTLS_HEAP_SIZE (14*1024)
#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
#define MBEDTLS_HEAP_SIZE (8*1024)
#endif
static unsigned char heap[MBEDTLS_HEAP_SIZE];
/*
* mbed TLS initialization function
*/
void mbedtls_init(void)
{
static int ready;
if (!ready) {
/* Initialize the mbed TLS heap */
mbedtls_memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);
/* Use reduced version of snprintf to save space. */
mbedtls_platform_set_snprintf(tf_snprintf);
ready = 1;
}
}
| /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
/* mbed TLS headers */
#include <mbedtls/memory_buffer_alloc.h>
#include <mbedtls/platform.h>
/*
* mbed TLS heap
*/
#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
#define MBEDTLS_HEAP_SIZE (14*1024)
#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
#define MBEDTLS_HEAP_SIZE (6*1024)
#endif
static unsigned char heap[MBEDTLS_HEAP_SIZE];
/*
* mbed TLS initialization function
*/
void mbedtls_init(void)
{
static int ready;
if (!ready) {
/* Initialize the mbed TLS heap */
mbedtls_memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);
/* Use reduced version of snprintf to save space. */
mbedtls_platform_set_snprintf(tf_snprintf);
ready = 1;
}
}
| Define optimized mbed TLS heap size | mbedtls: Define optimized mbed TLS heap size
mbed TLS provides the debug API `mbedtls_memory_buffer_alloc_status()`
to analyse the RAM usage of the library.
When RSA is selected as algorithm, the maximum heap usage in FVP and
Juno has been determined empirically to be approximately 5.5 KiB.
However, The default heap size used when RSA is selected is 8 KiB.
This patch reduces the buffer from 8 KiB to 6 KiB so that the BSS
sections of both BL1 and BL2 are 2 KiB smaller when the firmware is
compiled with TBB support.
Change-Id: I43878a4e7af50c97be9c8d027c728c8483f24fbf
Signed-off-by: Antonio Nino Diaz <[email protected]>
| C | bsd-3-clause | achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware,lsigithub/arm-trusted-firmware_public,lsigithub/arm-trusted-firmware_public |
758d5af6abf26753054ae0662395b27ff4ab2221 | src/lz4mt_compat.h | src/lz4mt_compat.h | #ifndef LZ4MT_COMPAT_H
#define LZ4MT_COMPAT_H
namespace Lz4Mt {
unsigned getHardwareConcurrency();
struct launch {
#if defined(_MSC_VER)
typedef std::launch::launch Type;
#else
typedef std::launch Type;
#endif
static const Type deferred;
static const Type async;
};
}
#endif
| #ifndef LZ4MT_COMPAT_H
#define LZ4MT_COMPAT_H
namespace Lz4Mt {
unsigned getHardwareConcurrency();
struct launch {
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
typedef std::launch::launch Type;
#else
typedef std::launch Type;
#endif
static const Type deferred;
static const Type async;
};
}
#endif
| Fix compile error with VC++2013 preview | Fix compile error with VC++2013 preview
| C | bsd-2-clause | rgde/lz4mt,tempbottle/lz4mt,t-mat/lz4mt,t-mat/lz4mt,tempbottle/lz4mt,rgde/lz4mt,t-mat/lz4mt |
67b04dc5ae26ee489f051e7ead819f482d2fccb6 | 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.)
| C | mit | tdenniston/Halide,kenkuang1213/Halide,gchauras/Halide,dougkwan/Halide,lglucin/Halide,ronen/Halide,delcypher/Halide,lglucin/Halide,delcypher/Halide,ronen/Halide,mcanthony/Halide,dougkwan/Halide,damienfir/Halide,ayanazmat/Halide,kgnk/Halide,psuriana/Halide,rodrigob/Halide,fengzhyuan/Halide,smxlong/Halide,lglucin/Halide,ayanazmat/Halide,smxlong/Halide,aam/Halide,mcanthony/Halide,rodrigob/Halide,dan-tull/Halide,dan-tull/Halide,jiawen/Halide,smxlong/Halide,lglucin/Halide,damienfir/Halide,fengzhyuan/Halide,damienfir/Halide,damienfir/Halide,kenkuang1213/Halide,rodrigob/Halide,lglucin/Halide,kenkuang1213/Halide,tdenniston/Halide,dougkwan/Halide,mcanthony/Halide,fengzhyuan/Halide,lglucin/Halide,lglucin/Halide,mcanthony/Halide,ronen/Halide,kgnk/Halide,dan-tull/Halide,dougkwan/Halide,smxlong/Halide,ronen/Halide,aam/Halide,dan-tull/Halide,gchauras/Halide,ronen/Halide,rodrigob/Halide,dougkwan/Halide,tdenniston/Halide,myrtleTree33/Halide,adasworks/Halide,delcypher/Halide,myrtleTree33/Halide,kgnk/Halide,ayanazmat/Halide,damienfir/Halide,aam/Halide,adasworks/Halide,gchauras/Halide,gchauras/Halide,rodrigob/Halide,mcanthony/Halide,myrtleTree33/Halide,delcypher/Halide,delcypher/Halide,fengzhyuan/Halide,smxlong/Halide,dan-tull/Halide,myrtleTree33/Halide,myrtleTree33/Halide,kenkuang1213/Halide,dan-tull/Halide,dougkwan/Halide,rodrigob/Halide,kgnk/Halide,ayanazmat/Halide,myrtleTree33/Halide,adasworks/Halide,mcanthony/Halide,myrtleTree33/Halide,delcypher/Halide,jiawen/Halide,tdenniston/Halide,jiawen/Halide,kenkuang1213/Halide,psuriana/Halide,fengzhyuan/Halide,ayanazmat/Halide,damienfir/Halide,rodrigob/Halide,jiawen/Halide,aam/Halide,tdenniston/Halide,tdenniston/Halide,aam/Halide,smxlong/Halide,damienfir/Halide,kgnk/Halide,myrtleTree33/Halide,ayanazmat/Halide,ayanazmat/Halide,kgnk/Halide,fengzhyuan/Halide,jiawen/Halide,psuriana/Halide,aam/Halide,psuriana/Halide,tdenniston/Halide,dan-tull/Halide,delcypher/Halide,kgnk/Halide,kgnk/Halide,kenkuang1213/Halide,adasworks/Halide,adasworks/Halide,damienfir/Halide,ayanazmat/Halide,adasworks/Halide,mcanthony/Halide,dougkwan/Halide,gchauras/Halide,kenkuang1213/Halide,rodrigob/Halide,smxlong/Halide,delcypher/Halide,adasworks/Halide,gchauras/Halide,psuriana/Halide,jiawen/Halide,tdenniston/Halide,ronen/Halide,fengzhyuan/Halide,adasworks/Halide,aam/Halide,dougkwan/Halide,kenkuang1213/Halide,dan-tull/Halide,mcanthony/Halide,jiawen/Halide,psuriana/Halide,smxlong/Halide,ronen/Halide,fengzhyuan/Halide,ronen/Halide,psuriana/Halide |
|
11fb3304ba88fa84e2349c08f73b4ffaf0a8fd89 | OctoKit/OctoKit.h | OctoKit/OctoKit.h | //
// OctoKit.h
// OctoKit
//
// Created by Piet Brauer on 25/08/15.
// Copyright (c) 2015 nerdish by nature. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;
//! Project version string for OctoKit.
FOUNDATION_EXPORT const unsigned char OctoKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OctoKit/PublicHeader.h>
| //
// OctoKit.h
// OctoKit
//
// Created by Piet Brauer on 25/08/15.
// Copyright (c) 2015 nerdish by nature. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;
//! Project version string for OctoKit.
FOUNDATION_EXPORT const unsigned char OctoKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OctoKit/PublicHeader.h>
| Use Foundation instead of UIKit | Use Foundation instead of UIKit | C | mit | nerdishbynature/octokit.swift,nerdishbynature/octokit.swift,nerdishbynature/octokit.swift,phatblat/octokit.swift,phatblat/octokit.swift |
68584771ffe6608ed50dcb8f7e414d9ba6bcafa4 | src/api-mock.h | src/api-mock.h | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#endif | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#include "core/exceptions.h"
#endif | Include exceptions in main header | Include exceptions in main header
| C | mit | Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock |
4bd45e4d59931a8aa4873f40ddb77b5142fb175f | src/bin/e_signals.c | src/bin/e_signals.c | /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#include <execinfo.h>
/* a tricky little devil, requires e and it's libs to be built
* with the -rdynamic flag to GCC for any sort of decent output.
*/
void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255];
size_t size;
write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace(array, 255);
backtrace_symbols_fd(array, size, 2);
exit(-11);
}
| /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
* NOTE TO FreeBSD users. Install libexecinfo from
* ports/devel/libexecinfo and add -lexecinfo to LDFLAGS
* to add backtrace support.
*/
#include "e.h"
#include <execinfo.h>
/* a tricky little devil, requires e and it's libs to be built
* with the -rdynamic flag to GCC for any sort of decent output.
*/
void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255];
size_t size;
write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace(array, 255);
backtrace_symbols_fd(array, size, 2);
exit(-11);
}
| Add note to help FreeBSD users. | Add note to help FreeBSD users.
| C | bsd-2-clause | jordemort/e17,jordemort/e17,jordemort/e17 |
0a2825db5a26372454d53fc20a877e0e0bc82123 | libipc/ipcreg_internal.h | libipc/ipcreg_internal.h | //===-- ipcreg_internal.h -------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Internal types and data for IPC registration logic
//
//===----------------------------------------------------------------------===//
#ifndef _IPCREG_INTERNAL_H_
#define _IPCREG_INTERNAL_H_
#include "ipcd.h"
#include <assert.h>
typedef enum {
STATE_UNOPT = 0,
STATE_ID_EXCHANGE,
STATE_OPTIMIZED,
STATE_LOCALFD
} EndpointState;
typedef struct {
size_t bytes_trans;
int localfd;
endpoint ep;
EndpointState state;
bool valid;
} ipc_info;
// For now, just index directly into pre-allocate table with fd.
// We will also need a way to go from nonce to fd!
const unsigned TABLE_SIZE = 1 << 10;
extern ipc_info IpcDescTable[TABLE_SIZE];
static inline char inbounds_fd(int fd) { return (unsigned)fd <= TABLE_SIZE; }
static inline ipc_info *getFDDesc(int fd) {
assert(inbounds_fd(fd));
return &IpcDescTable[fd];
}
#endif // _IPCREG_INTERNAL_H_
| //===-- ipcreg_internal.h -------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Internal types and data for IPC registration logic
//
//===----------------------------------------------------------------------===//
#ifndef _IPCREG_INTERNAL_H_
#define _IPCREG_INTERNAL_H_
#include "ipcd.h"
#include <assert.h>
typedef enum {
STATE_UNOPT = 0,
STATE_ID_EXCHANGE,
STATE_OPTIMIZED,
STATE_LOCALFD
} EndpointState;
typedef struct {
size_t bytes_trans;
int localfd;
endpoint ep;
EndpointState state;
bool valid;
} ipc_info;
// For now, just index directly into pre-allocate table with fd.
// We will also need a way to go from nonce to fd!
const unsigned TABLE_SIZE = 1 << 10;
extern ipc_info IpcDescTable[TABLE_SIZE];
static inline char inbounds_fd(int fd) { return (unsigned)fd <= TABLE_SIZE; }
static inline ipc_info *getFDDesc(int fd) {
if (!inbounds_fd(fd)) {
ipclog("Attempt to access out-of-bounds fd: %d (TABLE_SIZE=%u)\n", fd,
TABLE_SIZE);
}
assert(inbounds_fd(fd));
return &IpcDescTable[fd];
}
#endif // _IPCREG_INTERNAL_H_
| Extend assert in getFDDesc to print invalid fd. | Extend assert in getFDDesc to print invalid fd.
Helps debug issues like one fixed by previous commit.
| C | isc | dtzWill/ipcopter,dtzWill/ipcopter,dtzWill/ipcopter,dtzWill/ipcopter,dtzWill/ipcopter,dtzWill/ipcopter |
6521caab4016e59941bb8c97ace364f83b34ba9c | src/modules/conf_randr/e_smart_monitor.h | src/modules/conf_randr/e_smart_monitor.h | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
# endif
#endif
| #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
# endif
#endif
| Add header function for creating new monitors. | Add header function for creating new monitors.
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84123
| C | bsd-2-clause | rvandegrift/e,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e |
72caa3963e9d0ef6b47774f9b9a7a0de83634ec4 | src/trace_processor/types/version_number.h | src/trace_processor/types/version_number.h | /*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#define SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#include <tuple>
namespace perfetto {
namespace trace_processor {
struct VersionNumber {
uint32_t major;
uint32_t minor;
bool operator==(const VersionNumber& other) {
return std::tie(major, minor) == std::tie(other.major, other.minor);
}
bool operator<(const VersionNumber& other) {
return std::tie(major, minor) < std::tie(other.major, other.minor);
}
bool operator>=(const VersionNumber& other) {
return std::tie(major, minor) >= std::tie(other.major, other.minor);
}
};
} // namespace trace_processor
} // namespace perfetto
#endif // SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
| /*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#define SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#include <tuple>
namespace perfetto {
namespace trace_processor {
struct VersionNumber {
uint32_t major;
uint32_t minor;
bool operator==(const VersionNumber& other) const {
return std::tie(major, minor) == std::tie(other.major, other.minor);
}
bool operator<(const VersionNumber& other) const {
return std::tie(major, minor) < std::tie(other.major, other.minor);
}
bool operator>=(const VersionNumber& other) const {
return std::tie(major, minor) >= std::tie(other.major, other.minor);
}
};
} // namespace trace_processor
} // namespace perfetto
#endif // SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
| Fix VersionNumber comparison operator constness | Fix VersionNumber comparison operator constness
Currently Perfetto builds are broken in Chromium.
Change-Id: I09b2e29682667e6dfecc36ea072327dd51f5e071
| C | apache-2.0 | google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto |
0de12dcf3dde407ceaff96b28c2b292a3aa463e2 | Classes/APIRouter.h | Classes/APIRouter.h | //
// APIRouter.h
// APIClient
//
// Created by Klaas Pieter Annema on 14-09-13.
// Copyright (c) 2013 Klaas Pieter Annema. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APIInflector.h"
@protocol APIRouter <NSObject>
@property (nonatomic, readonly, strong) id<APIInflector> inflector;
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end
@interface APIRouter : NSObject <APIRouter>
- (id)initWithInflector:(id<APIInflector>)inflector;
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end
| //
// APIRouter.h
// APIClient
//
// Created by Klaas Pieter Annema on 14-09-13.
// Copyright (c) 2013 Klaas Pieter Annema. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APIInflector.h"
@protocol APIRouter <NSObject>
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end
@interface APIRouter : NSObject <APIRouter>
@property (nonatomic, readonly, strong) id<APIInflector> inflector;
- (id)initWithInflector:(id<APIInflector>)inflector;
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end
| Remove the inflector from the router protocol | Remove the inflector from the router protocol
| C | mit | klaaspieter/APIClient |
8c75289033623c366a6949adfabe4cdcf550d4ac | tests/Tests.h | tests/Tests.h | #pragma once
#if defined(_MSC_VER)
#define DLL_API __declspec(dllexport)
#define STDCALL __stdcall
#define CDECL __cdecl
#else
#define DLL_API __attribute__ ((visibility ("default")))
#define STDCALL __attribute__((stdcall))
#define CDECL __attribute__((cdecl))
#endif
#define CS_OUT | #pragma once
#if defined(_MSC_VER)
#define DLL_API __declspec(dllexport)
#ifndef STDCALL
#define STDCALL __stdcall
#endif
#ifndef CDECL
#define CDECL __cdecl
#endif
#else
#define DLL_API __attribute__ ((visibility ("default")))
#ifndef STDCALL
#define STDCALL __attribute__((stdcall))
#endif
#ifndef CDECL
#define CDECL __attribute__((cdecl))
#endif
#endif
#define CS_OUT | Check for defines before defining to get rid of some warnings. | Check for defines before defining to get rid of some warnings.
| C | mit | xistoso/CppSharp,mohtamohit/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp,xistoso/CppSharp,imazen/CppSharp,mono/CppSharp,imazen/CppSharp,SonyaSa/CppSharp,Samana/CppSharp,xistoso/CppSharp,genuinelucifer/CppSharp,mohtamohit/CppSharp,mono/CppSharp,ktopouzi/CppSharp,inordertotest/CppSharp,Samana/CppSharp,imazen/CppSharp,ktopouzi/CppSharp,txdv/CppSharp,mydogisbox/CppSharp,genuinelucifer/CppSharp,inordertotest/CppSharp,genuinelucifer/CppSharp,u255436/CppSharp,ddobrev/CppSharp,txdv/CppSharp,SonyaSa/CppSharp,u255436/CppSharp,KonajuGames/CppSharp,inordertotest/CppSharp,nalkaro/CppSharp,xistoso/CppSharp,u255436/CppSharp,imazen/CppSharp,nalkaro/CppSharp,u255436/CppSharp,genuinelucifer/CppSharp,KonajuGames/CppSharp,nalkaro/CppSharp,nalkaro/CppSharp,zillemarco/CppSharp,KonajuGames/CppSharp,mono/CppSharp,Samana/CppSharp,SonyaSa/CppSharp,zillemarco/CppSharp,mono/CppSharp,SonyaSa/CppSharp,mohtamohit/CppSharp,Samana/CppSharp,KonajuGames/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,mydogisbox/CppSharp,mydogisbox/CppSharp,ddobrev/CppSharp,SonyaSa/CppSharp,u255436/CppSharp,mohtamohit/CppSharp,imazen/CppSharp,txdv/CppSharp,ktopouzi/CppSharp,Samana/CppSharp,mydogisbox/CppSharp,xistoso/CppSharp,KonajuGames/CppSharp,mohtamohit/CppSharp,ddobrev/CppSharp,zillemarco/CppSharp,txdv/CppSharp,mono/CppSharp,ktopouzi/CppSharp,genuinelucifer/CppSharp,mydogisbox/CppSharp,inordertotest/CppSharp,nalkaro/CppSharp,txdv/CppSharp,ktopouzi/CppSharp,mono/CppSharp,ddobrev/CppSharp |
b56546c04b262d215df290c3f9dbe900cdc910f1 | Clue/Classes/Protocols/CLURecordableModule.h | Clue/Classes/Protocols/CLURecordableModule.h | //
// CLURecordableModule.h
// Clue
//
// Created by Ahmed Sulaiman on 5/18/16.
// Copyright © 2016 Ahmed Sulaiman. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol CLURecordableModule <NSObject>
@required
- (void)startRecording;
- (void)stopRecording;
- (BOOL)addNewFrameWithTimestamp:(CFTimeInterval)timestamp;
@end
| Add basic interface for recordable modules | Add basic interface for recordable modules
| C | mit | Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue,Geek-1001/Clue |
|
846e6f3b71fcf9fca2df36c101e6de2d080dcb83 | PHPHub/Constants/SecretConstant.example.h | PHPHub/Constants/SecretConstant.example.h | //
// SecretConstant.example.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define Client_id @"kHOugsx4dmcXwvVbmLkd"
#define Client_secret @"PuuFCrF94MloSbSkxpwS"
#define UMENG_APPKEY @"Set up UMEng App Key"
#define UMENG_QQ_ID @"Set up qq id"
#define UMENG_QQ_APPKEY @"Set up qq appkey"
#define WX_APP_ID @"Set up weixin app id"
#define WX_APP_SECRET @"Set up weixin app secret"
#define TRACKING_ID @"Set up google anlytics tracking id" | //
// SecretConstant.example.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#if DEBUG
#define Client_id @"kHOugsx4dmcXwvVbmLkd"
#define Client_secret @"PuuFCrF94MloSbSkxpwS"
#else
#define Client_id @"Set up a client id for production env"
#define Client_secret @"Set up a client secret for production env"
#endif
#define UMENG_APPKEY @"Set up UMEng App Key"
#define UMENG_QQ_ID @"Set up qq id"
#define UMENG_QQ_APPKEY @"Set up qq appkey"
#define WX_APP_ID @"Set up weixin app id"
#define WX_APP_SECRET @"Set up weixin app secret"
#define TRACKING_ID @"Set up google anlytics tracking id" | Set up a client id and a client secret for production environment | Set up a client id and a client secret for production environment
| C | mit | Aufree/phphub-ios |
b70923c9dc77371c24b3d2183b0573969602eca0 | Source/Pester_Prefix.h | Source/Pester_Prefix.h | //
// Prefix header for all source files of the 'Pester' target in the 'Pester' project
//
#import "NJROperatingSystemVersion.h" | //
// Prefix header for all source files of the 'Pester' target in the 'Pester' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import "NJROperatingSystemVersion.h"
#endif
| Fix Pester prefix header to import Cocoa again. | Fix Pester prefix header to import Cocoa again. | C | bsd-2-clause | ssp/Pester,ssp/Pester,ssp/Pester,ssp/Pester,nriley/Pester,ssp/Pester,nriley/Pester |
37a155226210640f16018e1033d4769b2fb36909 | gitst.c | gitst.c |
#include <stdio.h>
#include "lib/proc.h"
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
//int out = run_proc(&gitbuff, "ls", "-l", "-h", 0);
if (out != 0)
{
fprintf(stderr, "Error running subprocess:%d\n", out);
exit(1);
}
//printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff);
char *br;
br = gitbuff;
putchar('(');
while(*br++ != '*') {}
// skip the '*' and the space after it
br++;
while(*br != '\n')
{
putchar(*br++);
}
putchar(')');
putchar('\n');
}
|
#include <stdio.h>
#include <string.h>
#include "lib/proc.h"
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
if (out != 0)
{
exit(1);
}
char *token;
char *sep=" \r\n";
int next = 0;
while((token = strsep(&gitbuff, sep)) != NULL)
{
if (token[0] == '*') {
token = strsep(&gitbuff, sep);
printf("(%s)", token);
break;
}
}
return 0;
}
| Use strsep to split output | Use strsep to split output
| C | bsd-3-clause | wnh/prompt_utils |
0dc3d4785076cad20dfc015c32a6d656ec9b1b68 | PodioKit/Common/Core/PKTHTTPClient.h | PodioKit/Common/Core/PKTHTTPClient.h | //
// PKTClient.h
// PodioKit
//
// Created by Sebastian Rehnby on 16/01/14.
// Copyright (c) 2014 Citrix Systems, Inc. All rights reserved.
//
#import "PKTRequest.h"
#import "PKTResponse.h"
#import "PKTRequestSerializer.h"
#import "PKTResponseSerializer.h"
typedef void(^PKTRequestCompletionBlock)(PKTResponse *response, NSError *error);
@interface PKTHTTPClient : NSObject
@property (nonatomic, copy, readonly) NSURL *baseURL;
@property (nonatomic, strong, readonly) PKTRequestSerializer *requestSerializer;
@property (nonatomic, strong, readonly) PKTResponseSerializer *responseSerializer;
/**
* Controls whether or not to pin the server public key to that of any .cer certificate included in the app bundle.
*/
@property (nonatomic) BOOL useSSLPinning;
- (NSURLSessionTask *)taskForRequest:(PKTRequest *)request completion:(PKTRequestCompletionBlock)completion;
@end
| //
// PKTClient.h
// PodioKit
//
// Created by Sebastian Rehnby on 16/01/14.
// Copyright (c) 2014 Citrix Systems, Inc. All rights reserved.
//
#import "PKTRequest.h"
#import "PKTResponse.h"
#import "PKTRequestSerializer.h"
#import "PKTResponseSerializer.h"
typedef void(^PKTRequestCompletionBlock)(PKTResponse *response, NSError *error);
@interface PKTHTTPClient : NSObject
@property (nonatomic, copy) NSURL *baseURL;
@property (nonatomic, strong, readonly) PKTRequestSerializer *requestSerializer;
@property (nonatomic, strong, readonly) PKTResponseSerializer *responseSerializer;
/**
* Controls whether or not to pin the server public key to that of any .cer certificate included in the app bundle.
*/
@property (nonatomic) BOOL useSSLPinning;
- (NSURLSessionTask *)taskForRequest:(PKTRequest *)request completion:(PKTRequestCompletionBlock)completion;
@end
| Add ability to set base URL | Add ability to set base URL
| C | mit | podio/podio-objc,shelsonjava/podio-objc,shelsonjava/podio-objc,podio/podio-objc,shelsonjava/podio-objc,podio/podio-objc |
f4b5386b0f67a1ef693a768d2d952633e9b55d83 | src/cc/common/nofilelimit.h | src/cc/common/nofilelimit.h | //---------------------------------------------------------- -*- Mode: C++ -*-
// $Id$
//
// Created 2012/10/25
// Author: Mike Ovsiannikov
//
// Copyright 2012 Quantcast Corp.
//
// This file is part of Kosmos File System (KFS).
//
// Licensed under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
//
// \file nofilelimit.h
// \brief function to set process max number of open files.
//
//----------------------------------------------------------------------------
#ifndef KFS_NOFILELIMIT_H
#define KFS_NOFILELIMIT_H
namespace KFS {
int SetMaxNoFileLimit();
}
#endif /* KFS_NOFILELIMIT_H */
| Fix previous commit: by committing new include file. | Fix previous commit: by committing new include file.
| C | apache-2.0 | qnu/qfs,thebigbrain/qfs,quantcast/qfs,quantcast/qfs,qnu/qfs,quantcast/qfs,fengshao0907/qfs,chanwit/qfs,quantcast/qfs,thebigbrain/qfs,thebigbrain/qfs,thebigbrain/qfs,chanwit/qfs,fengshao0907/qfs,chanwit/qfs,thebigbrain/qfs,chanwit/qfs,chanwit/qfs,thebigbrain/qfs,qnu/qfs,qnu/qfs,thebigbrain/qfs,fengshao0907/qfs,thebigbrain/qfs,fengshao0907/qfs,qnu/qfs,chanwit/qfs,chanwit/qfs,fengshao0907/qfs,chanwit/qfs,quantcast/qfs,qnu/qfs,quantcast/qfs,qnu/qfs,quantcast/qfs,fengshao0907/qfs,qnu/qfs,quantcast/qfs,fengshao0907/qfs,fengshao0907/qfs |
|
5b9f10c0f8dcaef1d142f3abfd4a717c9475d085 | tests/regression/01-cpa/56-def_exc-fp1.c | tests/regression/01-cpa/56-def_exc-fp1.c | // PARAM: --enable ana.sv-comp.functions
// manually minimized from sv-benchmarks/c/seq-mthreaded/pals_lcr.3.ufo.UNBOUNDED.pals.c
// used to not reach fixpoint due to def_exc range
_Bool __VERIFIER_nondet_bool(void) ;
_Bool mode1 ;
void node1(void)
{
if (mode1)
mode1 = 0;
else
mode1 = 1;
}
int main(void)
{
mode1 = __VERIFIER_nondet_bool();
while (1)
node1();
return 0;
}
| Add test for def_exc bool fixpoint error | Add test for def_exc bool fixpoint error
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
ac11de6c4775bb08fbdfbf35536dc39a425508f0 | iserv/cbits/iservmain.c | iserv/cbits/iservmain.c | #include "../rts/PosixSource.h"
#include "Rts.h"
#include "HsFFI.h"
int main (int argc, char *argv[])
{
RtsConfig conf = defaultRtsConfig;
// We never know what symbols GHC will look up in the future, so
// we must retain CAFs for running interpreted code.
conf.keep_cafs = 1;
extern StgClosure ZCMain_main_closure;
hs_main(argc, argv, &ZCMain_main_closure, conf);
}
| #include "../rts/PosixSource.h"
#include "Rts.h"
#include "HsFFI.h"
int main (int argc, char *argv[])
{
RtsConfig conf = defaultRtsConfig;
// We never know what symbols GHC will look up in the future, so
// we must retain CAFs for running interpreted code.
conf.keep_cafs = 1;
conf.rts_opts_enabled = RtsOptsAll;
extern StgClosure ZCMain_main_closure;
hs_main(argc, argv, &ZCMain_main_closure, conf);
}
| Allow all RTS options to iserv | Allow all RTS options to iserv
(cherry picked from commit db121b2ec4596b99fed9781ec2d055f29e0d5b20)
| C | bsd-3-clause | GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc |
08f5b1c7ec09c16d20466dd18317a6c6f3d4895b | tests/regression/36-octapron/26-combine-forget-local-lval.c | tests/regression/36-octapron/26-combine-forget-local-lval.c | // SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>
int f(int x) {
return x + 1;
}
int main(void) {
int y = 42;
y = f(42);
// combine should forget caller's y before unifying with y == 43 to avoid bottom
assert(y);
return 0;
}
| Add test for octApron combine forgetting return assign locally | Add test for octApron combine forgetting return assign locally
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
f6de960fb76ab36550a119b1465e8a24e59af219 | plat/rpi3/rpi3_stack_protector.c | plat/rpi3/rpi3_stack_protector.c | /*
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <lib/utils.h>
#include "rpi3_private.h"
/* Get 128 bits of entropy and fuse the values together to form the canary. */
#define TRNG_NBYTES 16U
u_register_t plat_get_stack_protector_canary(void)
{
size_t i;
u_register_t buf[TRNG_NBYTES / sizeof(u_register_t)];
u_register_t ret = 0U;
rpi3_rng_read(buf, sizeof(buf));
for (i = 0U; i < ARRAY_SIZE(buf); i++)
ret ^= buf[i];
return ret;
}
| /*
* Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <lib/utils.h>
#include <lib/utils_def.h>
#include "rpi3_private.h"
/* Get 128 bits of entropy and fuse the values together to form the canary. */
#define TRNG_NBYTES 16U
u_register_t plat_get_stack_protector_canary(void)
{
size_t i;
u_register_t buf[TRNG_NBYTES / sizeof(u_register_t)];
u_register_t ret = 0U;
rpi3_rng_read(buf, sizeof(buf));
for (i = 0U; i < ARRAY_SIZE(buf); i++)
ret ^= buf[i];
return ret;
}
| Fix compilation error when stack protector is enabled | rpi3: Fix compilation error when stack protector is enabled
Include necessary header file to use ARRAY_SIZE() macro
Change-Id: I5b7caccd02c14c598b7944cf4f347606c1e7a8e7
Signed-off-by: Madhukar Pappireddy <[email protected]>
| C | bsd-3-clause | achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware |
6dab1e9536c81bb9848c806faf4d0eb80cc48ca4 | src/file-events/headers/jni_support.h | src/file-events/headers/jni_support.h | #pragma once
#include <jni.h>
/**
* Support for using JNI in a multi-threaded environment.
*/
class JniSupport {
public:
JniSupport(JavaVM* jvm);
JniSupport(JNIEnv* env);
protected:
jclass findClass(const char* className);
JNIEnv* getThreadEnv();
protected:
JavaVM* jvm;
};
/**
* Attach a native thread to JNI.
*/
class JniThreadAttacher : public JniSupport {
public:
JniThreadAttacher(JavaVM* jvm, const char* name, bool daemon);
~JniThreadAttacher();
};
| #pragma once
#include <jni.h>
#include <stdexcept>
/**
* Support for using JNI in a multi-threaded environment.
*/
class JniSupport {
public:
JniSupport(JavaVM* jvm);
JniSupport(JNIEnv* env);
protected:
jclass findClass(const char* className);
JNIEnv* getThreadEnv();
protected:
JavaVM* jvm;
};
/**
* Attach a native thread to JNI.
*/
class JniThreadAttacher : public JniSupport {
public:
JniThreadAttacher(JavaVM* jvm, const char* name, bool daemon);
~JniThreadAttacher();
};
| Add include necessary on Linux | Add include necessary on Linux
| C | apache-2.0 | adammurdoch/native-platform,adammurdoch/native-platform,adammurdoch/native-platform,adammurdoch/native-platform |
cc74b1067d791ce7f765eba8b67e2d1000c2cfcb | src/condor_c++_util/directory.h | src/condor_c++_util/directory.h | #ifndef DIRECTORY_H
#define DIRECTORY_H
#if defined (ULTRIX42) || defined(ULTRIX43) /* _POSIX_SOURCE should have taken care of this, */
#define __POSIX /* but for some reason the ULTRIX version of dirent.h */
#endif /* is not POSIX conforming without it... */
#include <dirent.h>
class Directory
{
public:
Directory( const char *name );
~Directory();
void Rewind();
char *Next();
private:
DIR *dirp;
};
#endif
| #ifndef DIRECTORY_H
#define DIRECTORY_H
#if defined (ULTRIX42) || defined(ULTRIX43)
/* _POSIX_SOURCE should have taken care of this,
but for some reason the ULTRIX version of dirent.h
is not POSIX conforming without it...
*/
# define __POSIX
#endif
#include <dirent.h>
#if defined(SUNOS41)
/* Note that function seekdir() is not required by POSIX, but the sun
implementation of rewinddir() (which is required by POSIX) is
a macro utilizing seekdir(). Thus we need the prototype.
*/
extern "C" void seekdir( DIR *dirp, int loc );
#endif
class Directory
{
public:
Directory( const char *name );
~Directory();
void Rewind();
char *Next();
private:
DIR *dirp;
};
#endif
| Add prototype for seekdir() for Suns. | Add prototype for seekdir() for Suns.
| C | apache-2.0 | htcondor/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,htcondor/htcondor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/condor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,djw8605/condor,neurodebian/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,clalancette/condor-dcloud,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor |
dc544bd4b9662bdb72af33fc1120f3c189fa0308 | cc1/tests/test023.c | cc1/tests/test023.c |
/*
name: TEST023
description: Basic test for long constants
comments: This test is done for z80 data types
output:
F1
G1 F1 main
{
-
A2 W i
A3 Z u
A2 #W1 :W
A2 #WFFFFFFFF :W
A2 #WFFFFFFFF :W
A2 #WFFFFFFFF :W
A2 #WFFFFFFFF :W
A2 #W3 :W
A2 #W1 :W
A2 #W0 :W
A3 #Z1 :Z
A3 #ZFFFFFFFF :Z
A3 #ZFFFFFFFF :Z
A3 #ZFFFFFFFF :Z
A3 #ZFFFFFFFF :Z
A3 #Z3 :Z
A3 #Z1 :Z
A3 #Z0 :Z
y #I0
}
*/
int
main(void)
{
long i;
unsigned long u;
i = 1;
i = -1;
i = -1l;
i = -1u;
i = -1ll;
i = (1ll << 32) - 1 & 3;
i = (long) ((1ll << 32) - 1) < 0;
i = -1u < 0;
u = 1;
u = -1;
u = -1l;
u = -1u;
u = -1ll;
u = (1ll << 32) - 1 & 3;
u = (long) ((1ll << 32) - 1) < 0;
u = -1u < 0;
return 0;
}
| Add basic test for long constants | Add basic test for long constants
| C | mit | 8l/scc,k0gaMSX/kcc,8l/scc,k0gaMSX/kcc,k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc,8l/scc |
|
caceb4cf2704b445379874a36f0274ee54c141eb | src/libreset/util/macros.h | src/libreset/util/macros.h | #ifndef __MACROS_H__
#define __MACROS_H__
/**
* @file macros.h
*
* This file contains simple helper macros
*/
/**
* @addtogroup internal_util_helper_macros "(internal) helper macros"
*
* This group contains helper macros for internal use only.
*
* @{
*/
/**
* Computes the maximum value of the two passed values
*
* @note Provides compile-time type checking by using temp variables before
* doing the comparison.
*
* @note Opens own scope, so the temp variables do not show up outside of the
* macro.
*/
#define MAX(x,y) \
((__typeof__(x)) x > (__typeof__(x)) y ? \
(__typeof__(x)) x : (__typeof__(x)) y)
/**
* Computes the minimum value of the two passed values
*
* @note Provides compile-time type checking by using temp variables before
* doing the comparison.
*
* @note Opens own scope, so the temp variables do not show up outside of the
* macro.
*/
#define MIN(x,y) \
({ __typeof__ (x) _x = (x); \
__typeof__ (y) _y = (y); \
_x < _y ? _x : _y; })
/** @} */
#endif //__MACROS_H__
| #ifndef __MACROS_H__
#define __MACROS_H__
/**
* @file macros.h
*
* This file contains simple helper macros
*/
/**
* @addtogroup internal_util_helper_macros "(internal) helper macros"
*
* This group contains helper macros for internal use only.
*
* @{
*/
/**
* Computes the maximum value of the two passed values
*
* @note Provides compile-time type checking by using temp variables before
* doing the comparison.
*
* @note Opens own scope, so the temp variables do not show up outside of the
* macro.
*/
#define MAX(x,y) \
((__typeof__(x)) x > (__typeof__(x)) y ? \
(__typeof__(x)) x : (__typeof__(x)) y)
/**
* Computes the minimum value of the two passed values
*
* @note Provides compile-time type checking by using temp variables before
* doing the comparison.
*
* @note Opens own scope, so the temp variables do not show up outside of the
* macro.
*/
#define MIN(x,y) \
((__typeof__(x)) x > (__typeof__(x)) y ? \
(__typeof__(x)) y : (__typeof__(x)) x)
/** @} */
#endif //__MACROS_H__
| Modify MIN(x,y) to not contain a scope | Modify MIN(x,y) to not contain a scope
| C | lgpl-2.1 | waysome/libreset,waysome/libreset |
1bebcf5659d89bc92b743ef201dbd9590744cfd3 | src/tests/test_hashtable.c | src/tests/test_hashtable.c | /*
* File: test_hashtable.c
*
* Testing suite for hashtables.
*
* Author: Jack Romo <[email protected]>
*/
#include "../cnoodle.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
hashtable table;
} hfixture;
void table_setup(hfixture *hf, gconstpointer test_data) {
hf->table = make_hashtable();
t_entity *ent1 = make_entity(NULL, 0, 0, NULL);
ent1->id = 0;
hashtable_add(*(hf->table), (void *) ent1, ENTITY);
t_entity *ent2 = make_entity(NULL, 1, 1, (void *) ent1);
ent2->id = 1;
hashtable_add(*(hf->table), (void *) ent2, ENTITY);
}
void table_teardown(hfixture *hf, gconstpointer test_data) {
hashtable_free(hf->table);
}
// TODO: tests here
int main() {
// TODO: run tests here
}
| Add setup and teardown for hashtable tests | Add setup and teardown for hashtable tests
| C | mit | jackromo/CNoodle |
|
268fdc1e10931c3a9c0e4c8c6699139516429adc | knode/kngrouppropdlg.h | knode/kngrouppropdlg.h | /*
kngrouppropdlg.h
KNode, the KDE newsreader
Copyright (c) 1999-2001 the KNode authors.
See file AUTHORS for details
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
*/
#ifndef KNGROUPPROPDLG_H
#define KNGROUPPROPDLG_H
#include <kdialogbase.h>
class QCheckBox;
class KLineEdit;
class KNGroup;
namespace KNConfig {
class IdentityWidget;
};
class KNGroupPropDlg : public KDialogBase {
public:
KNGroupPropDlg(KNGroup *group, QWidget *parent=0, const char *name=0);
~KNGroupPropDlg();
bool nickHasChanged() { return n_ickChanged; }
protected:
KNGroup *g_rp;
bool n_ickChanged;
KNConfig::IdentityWidget* i_dWidget;
KLineEdit *n_ick;
QCheckBox *u_seCharset;
QComboBox *c_harset;
protected slots:
void slotOk();
};
#endif
| /*
kngrouppropdlg.h
KNode, the KDE newsreader
Copyright (c) 1999-2001 the KNode authors.
See file AUTHORS for details
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
*/
#ifndef KNGROUPPROPDLG_H
#define KNGROUPPROPDLG_H
#include <kdialogbase.h>
class QCheckBox;
class QComboBox;
class KLineEdit;
class KNGroup;
namespace KNConfig {
class IdentityWidget;
};
class KNGroupPropDlg : public KDialogBase {
public:
KNGroupPropDlg(KNGroup *group, QWidget *parent=0, const char *name=0);
~KNGroupPropDlg();
bool nickHasChanged() { return n_ickChanged; }
protected:
KNGroup *g_rp;
bool n_ickChanged;
KNConfig::IdentityWidget* i_dWidget;
KLineEdit *n_ick;
QCheckBox *u_seCharset;
QComboBox *c_harset;
protected slots:
void slotOk();
};
#endif
| Add forward declaration for QComboBox | Add forward declaration for QComboBox
svn path=/trunk/kdenetwork/knode/; revision=144112
| C | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi |
649ae48e2b2c5b9e03379294fa93aa100c850e71 | Paystack/Classes/PublicHeaders/Paystack.h | Paystack/Classes/PublicHeaders/Paystack.h | //
// Paystack.h
// Paystack
//
// Created by Ibrahim Lawal on 02/02/16.
// Copyright (c) 2016 Paystack. All rights reserved.
//
// The code in this workspace was adapted from https://github.com/stripe/stripe-ios.
// Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within
// apps that are using both Paystack and Stripe.
#import <Paystack/PSTCKAPIClient.h>
#import <Paystack/PaystackError.h>
#import <Paystack/PSTCKCardBrand.h>
#import <Paystack/PSTCKCardParams.h>
#import <Paystack/PSTCKTransactionParams.h>
#import <Paystack/PSTCKCard.h>
#import <Paystack/PSTCKCardValidationState.h>
#import <Paystack/PSTCKCardValidator.h>
#import <Paystack/PSTCKToken.h>
#import <Paystack/PSTCKRSA.h>
#if TARGET_OS_IPHONE
#import <Paystack/PSTCKPaymentCardTextField.h>
#endif
| //
// Paystack.h
// Paystack
//
// Created by Ibrahim Lawal on 02/02/16.
// Copyright (c) 2016 Paystack. All rights reserved.
//
// The code in this workspace was adapted from https://github.com/stripe/stripe-ios.
// Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within
// apps that are using both Paystack and Stripe.
#import "PSTCKAPIClient.h"
#import "PaystackError.h"
#import "PSTCKCardBrand.h"
#import "PSTCKCardParams.h"
#import "PSTCKTransactionParams.h"
#import "PSTCKCard.h"
#import "PSTCKCardValidationState.h"
#import "PSTCKCardValidator.h"
#import "PSTCKToken.h"
#import "PSTCKRSA.h"
#if TARGET_OS_IPHONE
#import "PSTCKPaymentCardTextField.h"
#endif
| Update umbrella header file declaration | Update umbrella header file declaration
| C | mit | PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios |
6e019dc5d59b16dd053e7519528f48bb2c7a24f4 | mtulio_d/src/mtuliod/mtd_server_cmd_run.c | mtulio_d/src/mtuliod/mtd_server_cmd_run.c | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define PFIX_CLI "[MTd]"
#define MAX_BUF_SIZE 200
int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message);
/* Get hostname */
int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message)
{
FILE *fd;
char str_cmd[MAX_BUF_SIZE], str_buf[MAX_BUF_SIZE];
memset (str_cmd, 0, MAX_BUF_SIZE);
/* Create a command */
sprintf(str_cmd, "hostname");
/* Run a command */
fd = popen(str_cmd, "r");
if (!fd) {
sprintf(message, "%s_%s ERR%% Error reading hostname.", PFIX_CLI, msg_cmd);
return 1;
}
/* Get command stdout */
while (fgets (str_buf, sizeof (str_buf), fd) <= 0);
pclose (fd);
sprintf(message, "%s_%s OK# Hostname is: %s", PFIX_CLI, msg_cmd, str_buf);
return 0;
}
| Create file to implement commands | Create file to implement commands
| C | apache-2.0 | mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb |
|
06cfb4f02ad9f2561302f21f4f38ec5f5ed4372f | SmartDeviceLink/SDLMacros.h | SmartDeviceLink/SDLMacros.h | //
// SDLMacros.h
// SmartDeviceLink-iOS
//
// Created by Muller, Alexander (A.) on 10/17/16.
// Copyright © 2016 smartdevicelink. All rights reserved.
//
#ifndef SDLMacros_h
#define SDLMacros_h
// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
#if __has_attribute(NS_STRING_ENUM)
#define SDL_SWIFT_ENUM NS_STRING_ENUM
#else
#define SDL_SWIFT_ENUM
#endif
#endif
#endif /* SDLMacros_h */
| //
// SDLMacros.h
// SmartDeviceLink-iOS
//
// Created by Muller, Alexander (A.) on 10/17/16.
// Copyright © 2016 smartdevicelink. All rights reserved.
//
#ifndef SDLMacros_h
#define SDLMacros_h
// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
#if __has_attribute(swift_wrapper)
#define SDL_SWIFT_ENUM NS_STRING_ENUM
#else
#define SDL_SWIFT_ENUM
#endif
#endif
#endif /* SDLMacros_h */
| Revert "Changed macro to look specifically for NS_STRING_ENUM" | Revert "Changed macro to look specifically for NS_STRING_ENUM"
This reverts commit de01a9f7b3ed63f683604d3595568bacf5f54a5e.
| C | bsd-3-clause | APCVSRepo/sdl_ios,FordDev/sdl_ios,FordDev/sdl_ios,kshala-ford/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,FordDev/sdl_ios,smartdevicelink/sdl_ios,FordDev/sdl_ios |
4346c30bae8b1a64acba564f6775cb0bacd026e4 | generic/include/clc/integer/definitions.h | generic/include/clc/integer/definitions.h | #define CHAR_BIT 8
#define INT_MAX 2147483647
#define INT_MIN -2147483648
#define LONG_MAX 0x7fffffffffffffffL
#define LONG_MIN -0x8000000000000000L
#define SCHAR_MAX 127
#define SCHAR_MIN -128
#define CHAR_MAX 127
#define CHAR_MIN -128
#define SHRT_MAX 32767
#define SHRT_MIN -32768
#define UCHAR_MAX 255
#define USHRT_MAX 65535
#define UINT_MAX 0xffffffff
#define ULONG_MAX 0xffffffffffffffffUL
| #define CHAR_BIT 8
#define INT_MAX 2147483647
#define INT_MIN ((int)(-2147483647 - 1))
#define LONG_MAX 0x7fffffffffffffffL
#define LONG_MIN (-0x7fffffffffffffffL - 1)
#define CHAR_MAX SCHAR_MAX
#define CHAR_MIN SCHAR_MIN
#define SCHAR_MAX 127
#define SCHAR_MIN ((char)(-127 - 1))
#define SHRT_MAX 32767
#define SHRT_MIN ((short)(-32767 - 1))
#define UCHAR_MAX 255
#define USHRT_MAX 65535
#define UINT_MAX 0xffffffff
#define ULONG_MAX 0xffffffffffffffffUL
| Update integer limits to comply with spec | integer: Update integer limits to comply with spec
The values for the char/short/integer/long minimums were declared with
their actual values, not the definitions from the CL spec (v1.1). As
a result, (-2147483648) was actually being treated as a long by the
compiler, not an int, which caused issues when trying to add/subtract
that value from a vector.
Update the definitions to use the values declared by the spec, and also
add explicit casts for the char/short/int minimums so that the compiler
actually treats them as shorts/chars. Without those casts, they
actually end up stored as integers, and the compiler may end up storing
the INT_MIN as a long.
The compiler can sign extend the values if it needs to convert the
char->short, short->int, or int->long
v2: Add explicit cast for INT_MIN and fix some type-o's and wrapping
in the commit message.
Reported-by: Moritz Pflanzer <[email protected]>
CC: Moritz Pflanzer <[email protected]>
Reviewed-by: Tom Stellard <[email protected]>
Signed-off-by: Aaron Watry <[email protected]>
git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@247661 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc |
75463d8bb33ca74e64842c871740002fbc32c902 | src/ios/BEMServerSyncCommunicationHelper.h | src/ios/BEMServerSyncCommunicationHelper.h | //
// DataUtils.h
// CFC_Tracker
//
// Created by Kalyanaraman Shankari on 3/9/15.
// Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@interface BEMServerSyncCommunicationHelper: NSObject
// Top level method
+ (void) backgroundSync:(void (^)(UIBackgroundFetchResult))completionHandler;
// Wrappers around the communication methods
+ (void) pushAndClearUserCache:(void (^)(BOOL))completionHandler;
+ (void) pullIntoUserCache:(void (^)(BOOL))completionHandler;
+ (void) pushAndClearStats:(void (^)(BOOL))completionHandler;
// Communication methods (copied from communication handler to make it generic)
+(void)phone_to_server:(NSArray*) entriesToPush
completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)server_to_phone:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)setClientStats:(NSDictionary*)statsToSend completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+ (NSInteger)fetchedData:(NSData *)responseData;
@end
| //
// DataUtils.h
// CFC_Tracker
//
// Created by Kalyanaraman Shankari on 3/9/15.
// Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
typedef void (^SilentPushCompletionHandler)(UIBackgroundFetchResult);
@interface BEMServerSyncCommunicationHelper: NSObject
// Top level method
+ (void) backgroundSync:(SilentPushCompletionHandler)completionHandler;
// Wrappers around the communication methods
+ (void) pushAndClearUserCache:(void (^)(BOOL))completionHandler;
+ (void) pullIntoUserCache:(void (^)(BOOL))completionHandler;
+ (void) pushAndClearStats:(void (^)(BOOL))completionHandler;
// Communication methods (copied from communication handler to make it generic)
+(void)phone_to_server:(NSArray*) entriesToPush
completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)server_to_phone:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)setClientStats:(NSDictionary*)statsToSend completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+ (NSInteger)fetchedData:(NSData *)responseData;
@end
| Move the SilentPushCompletionHandler typedef in here | Move the SilentPushCompletionHandler typedef in here
Since it is likely to be used as part of background sync
| C | bsd-3-clause | e-mission/cordova-server-sync,e-mission/cordova-server-sync,e-mission/cordova-server-sync |
43e02f563314f179b1221921034c145887a968fa | include/lyra2.h | include/lyra2.h | #pragma once
#include <stdlib.h>
#include <stdint.h>
#define PHS_NCOLS 64
int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T);
int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen, unsigned int t_cost, unsigned int m_cost);
| #pragma once
#include <stdlib.h>
#include <stdint.h>
#define PHS_NCOLS 256
int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T);
int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen, unsigned int t_cost, unsigned int m_cost);
| Use 256 cols when in PHS mode. | Use 256 cols when in PHS mode.
| C | mit | guilherme-pg/lyra2,guilherme-pg/lyra2,eggpi/lyra2,eggpi/lyra2,eggpi/lyra2,guilherme-pg/lyra2 |
c2a85cdcb14b4b04619593261a49c310a8f59185 | libsel4/arch_include/x86/sel4/arch/mapping.h | libsel4/arch_include/x86/sel4/arch/mapping.h | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef __LIBSEL4_ARCH_MAPPING
#define __LIBSEL4_ARCH_MAPPING
#define SEL4_MAPPING_LOOKUP_LEVEL 2
#define SEL4_MAPPING_LOOKUP_NO_PT 22
static inline seL4_Word seL4_MappingFailedLookupLevel()
{
return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL);
}
#endif
| /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef __LIBSEL4_ARCH_MAPPING
#define __LIBSEL4_ARCH_MAPPING
#include <autoconf.h>
#define SEL4_MAPPING_LOOKUP_LEVEL 2
#ifdef CONFIG_PAE_PAGING
#define SEL4_MAPPING_LOOKUP_NO_PT 21
#define SEL4_MAPPING_LOOKUP_NO_PD 30
#else
#define SEL4_MAPPING_LOOKUP_NO_PT 22
#endif
static inline seL4_Word seL4_MappingFailedLookupLevel()
{
return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL);
}
#endif
| Define different lookup levels for PAE | libsel4: Define different lookup levels for PAE
| C | bsd-2-clause | cmr/seL4,zhicheng/seL4,cmr/seL4,cmr/seL4,zhicheng/seL4,zhicheng/seL4 |
47107014052cf2345f4d22066e236582f4bbc0a9 | tests/ssp/main.c | tests/ssp/main.c | /*
* Copyright (C) 2016 Kaspar Schleiser <[email protected]>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief ssp test application
*
* This test should crash badly when *not* using the ssp module, and panic if
* using it.
*
* @author Kaspar Schleiser <[email protected]>
*
* @}
*/
#include <stdio.h>
#include <string.h>
void test_func(void)
{
char buf[16];
/* cppcheck-suppress bufferAccessOutOfBounds
* (reason: deliberately overflowing stack) */
memset(buf, 0, 32);
}
int main(void)
{
puts("calling stack corruption function");
test_func();
puts("back to main");
return 0;
}
| /*
* Copyright (C) 2016 Kaspar Schleiser <[email protected]>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief ssp test application
*
* This test should crash badly when *not* using the ssp module, and panic if
* using it.
*
* @author Kaspar Schleiser <[email protected]>
*
* @}
*/
#include <stdio.h>
#include <string.h>
void test_func(void)
{
char buf[16];
/* clang will detect the buffer overflow
* and throw an error if we use `buf` directly */
void *buffer_to_confuse_compiler = buf;
/* cppcheck-suppress bufferAccessOutOfBounds
* (reason: deliberately overflowing stack) */
memset(buffer_to_confuse_compiler, 0, 32);
}
int main(void)
{
puts("calling stack corruption function");
test_func();
puts("back to main");
return 0;
}
| Fix on macOS while compiling w/ clang | tests/ssp: Fix on macOS while compiling w/ clang
On macOS using Apple LLVM version 9.0.0 this test would
not compile due to clang detecting the buffer overflow.
Since this test is all about having a buffer overflow, I
tricked clang into not detecting this anymore.
This loosely relates to #6473.
| C | lgpl-2.1 | mfrey/RIOT,smlng/RIOT,miri64/RIOT,authmillenon/RIOT,miri64/RIOT,rfuentess/RIOT,avmelnikoff/RIOT,jasonatran/RIOT,basilfx/RIOT,LudwigOrtmann/RIOT,roberthartung/RIOT,basilfx/RIOT,biboc/RIOT,rfuentess/RIOT,cladmi/RIOT,jasonatran/RIOT,BytesGalore/RIOT,basilfx/RIOT,toonst/RIOT,biboc/RIOT,smlng/RIOT,toonst/RIOT,immesys/RiSyn,OlegHahm/RIOT,biboc/RIOT,immesys/RiSyn,adrianghc/RIOT,adrianghc/RIOT,kbumsik/RIOT,immesys/RiSyn,RIOT-OS/RIOT,authmillenon/RIOT,yogo1212/RIOT,immesys/RiSyn,immesys/RiSyn,ant9000/RIOT,yogo1212/RIOT,neiljay/RIOT,ant9000/RIOT,kbumsik/RIOT,rfuentess/RIOT,avmelnikoff/RIOT,mfrey/RIOT,mtausig/RIOT,toonst/RIOT,mtausig/RIOT,gebart/RIOT,x3ro/RIOT,neiljay/RIOT,yogo1212/RIOT,jasonatran/RIOT,A-Paul/RIOT,basilfx/RIOT,Josar/RIOT,kYc0o/RIOT,ks156/RIOT,Josar/RIOT,mtausig/RIOT,aeneby/RIOT,toonst/RIOT,smlng/RIOT,biboc/RIOT,ant9000/RIOT,lazytech-org/RIOT,ant9000/RIOT,RIOT-OS/RIOT,kYc0o/RIOT,OlegHahm/RIOT,authmillenon/RIOT,LudwigKnuepfer/RIOT,kaspar030/RIOT,avmelnikoff/RIOT,LudwigOrtmann/RIOT,authmillenon/RIOT,miri64/RIOT,authmillenon/RIOT,josephnoir/RIOT,ks156/RIOT,cladmi/RIOT,miri64/RIOT,roberthartung/RIOT,Josar/RIOT,BytesGalore/RIOT,OlegHahm/RIOT,RIOT-OS/RIOT,aeneby/RIOT,neiljay/RIOT,OTAkeys/RIOT,aeneby/RIOT,LudwigOrtmann/RIOT,smlng/RIOT,A-Paul/RIOT,yogo1212/RIOT,josephnoir/RIOT,gebart/RIOT,aeneby/RIOT,BytesGalore/RIOT,OTAkeys/RIOT,josephnoir/RIOT,miri64/RIOT,gebart/RIOT,ant9000/RIOT,adrianghc/RIOT,cladmi/RIOT,mfrey/RIOT,kaspar030/RIOT,BytesGalore/RIOT,kbumsik/RIOT,x3ro/RIOT,Josar/RIOT,authmillenon/RIOT,kbumsik/RIOT,adrianghc/RIOT,immesys/RiSyn,LudwigOrtmann/RIOT,rfuentess/RIOT,LudwigKnuepfer/RIOT,OTAkeys/RIOT,RIOT-OS/RIOT,lazytech-org/RIOT,jasonatran/RIOT,toonst/RIOT,kaspar030/RIOT,x3ro/RIOT,LudwigOrtmann/RIOT,A-Paul/RIOT,roberthartung/RIOT,A-Paul/RIOT,avmelnikoff/RIOT,roberthartung/RIOT,BytesGalore/RIOT,ks156/RIOT,mtausig/RIOT,gebart/RIOT,RIOT-OS/RIOT,kbumsik/RIOT,neiljay/RIOT,cladmi/RIOT,yogo1212/RIOT,rfuentess/RIOT,OlegHahm/RIOT,biboc/RIOT,gebart/RIOT,roberthartung/RIOT,OTAkeys/RIOT,mtausig/RIOT,ks156/RIOT,kYc0o/RIOT,ks156/RIOT,LudwigKnuepfer/RIOT,mfrey/RIOT,jasonatran/RIOT,x3ro/RIOT,x3ro/RIOT,cladmi/RIOT,mfrey/RIOT,adrianghc/RIOT,smlng/RIOT,lazytech-org/RIOT,OTAkeys/RIOT,lazytech-org/RIOT,avmelnikoff/RIOT,aeneby/RIOT,OlegHahm/RIOT,kYc0o/RIOT,LudwigOrtmann/RIOT,kaspar030/RIOT,Josar/RIOT,LudwigKnuepfer/RIOT,yogo1212/RIOT,josephnoir/RIOT,josephnoir/RIOT,basilfx/RIOT,kaspar030/RIOT,A-Paul/RIOT,neiljay/RIOT,LudwigKnuepfer/RIOT,lazytech-org/RIOT,kYc0o/RIOT |
b981ad885a6f4e0a79506451157c1459141320f5 | exception_handling_3.c | exception_handling_3.c | /*
* Author: NagaChaitanya Vellanki
*
* TRY/THROW/CATCH/FINALLY - example
* Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#define FOO_EXCEPTION (1)
#define BAR_EXCEPTION (2)
#define GOO_EXCEPTION (3)
#define TRY do{ jmp_buf env; switch(setjmp(env)) { case 0: while(1) {
#define CATCH(exception) break; case exception:
#define FINALLY break; } default:
#define END_TRY } }while(0)
#define THROW(exception) longjmp(env, exception)
int main(int argc, char *argv[]) {
TRY {
printf("In TRY statement\n");
THROW(GOO_EXCEPTION);
printf("not reachable\n");
}
CATCH(FOO_EXCEPTION) {
printf("FOO exception caught\n");
}
CATCH(BAR_EXCEPTION) {
printf("BAR exception caught\n");
}
CATCH(GOO_EXCEPTION) {
printf("GOO exception caught\n");
}
FINALLY {
printf("Finally \n");
}
END_TRY;
exit(EXIT_SUCCESS);
}
| /*
* Author: NagaChaitanya Vellanki
*
* TRY/THROW/CATCH/FINALLY - example
* Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html
*
* use gcc -E -P exception_handling_3.c to see the result of the preprocessing
* step
*/
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#define FOO_EXCEPTION (1)
#define BAR_EXCEPTION (2)
#define GOO_EXCEPTION (3)
#define TRY do{ jmp_buf env; switch(setjmp(env)) { case 0: while(1) {
#define CATCH(exception) break; case exception:
#define FINALLY break; } default:
#define END_TRY } }while(0)
#define THROW(exception) longjmp(env, exception)
int main(int argc, char *argv[]) {
TRY {
printf("In TRY statement\n");
THROW(GOO_EXCEPTION);
printf("not reachable\n");
}
CATCH(FOO_EXCEPTION) {
printf("FOO exception caught\n");
}
CATCH(BAR_EXCEPTION) {
printf("BAR exception caught\n");
}
CATCH(GOO_EXCEPTION) {
printf("GOO exception caught\n");
}
FINALLY {
printf("Finally \n");
}
END_TRY;
exit(EXIT_SUCCESS);
}
| Add command to see output of preprocessor | Add command to see output of preprocessor
| C | isc | chaitanyav/cprograms,chaitanyav/cprograms |
2f5741458f22ed495dd05f989be98b62f18108d9 | timer.h | timer.h | #ifndef TIMER_H_
#define TIMER_H_ 1
/*
* By default, the timer calls the function a few extra times that aren't
* measured to get it into cache and ensure more consistent running times.
* Specifying this option in flags will stop this.
*/
#define TIMER_NO_EXTRA 1
struct timer {
unsigned long long ns;
unsigned int reps;
};
/*
* Measures function 'func'. Sets timer->ns to the number of nanoseconds it took,
* and timer->reps to the number of repetitions. Uses the existing values of
* timer->ns and timer->reps as maximums - it won't do any more repetitions or take
* significantly more time than those specify. However, you can set one of them
* to 0 to make it unlimited. 0 is returned on success, -1 on failure.
*/
int
timer_measure(void (*func)(void), struct timer *timer, int flags);
// These next functions are shortcuts that use timer_measure and use the
// default flags.
int
timer_measure_ms(void (*func)(void), unsigned long long ms,
struct timer *timer);
int
timer_measure_reps(void (*func)(void), unsigned int reps, struct timer *timer);
#endif
| #ifndef TIMER_H_
#define TIMER_H_ 1
/*
* By default, the timer calls the function a few extra times that aren't
* measured to get it into cache and ensure more consistent running times.
* Specifying this option in flags will stop this.
*/
#define TIMER_NO_EXTRA 1
/*
* By default, each of these functions assumes that the function is single
* threaded. Specify this option to make sure that timing is done properly with
* multi-threaded functions.
*/
#define TIMER_MULTI_THREAD 2
/*
* The timer might create new processes to isolate the code being timed.
* Specifying this flag prevents any new processes from being created.
*/
#define TIMER_NOPROC 4
/*
* The timer might create new threads to isolate the code being timed.
* Specifying this flag prevents any new threads from being created.
*/
#define TIMER_NOTHREAD 8
struct timer {
unsigned long long ns;
unsigned int reps;
};
/*
* Measures function 'func'. Sets timer->ns to the number of nanoseconds it took,
* and timer->reps to the number of repetitions. Uses the existing values of
* timer->ns and timer->reps as maximums - it won't do any more repetitions or take
* significantly more time than those specify. However, you can set one of them
* to 0 to make it unlimited. 0 is returned on success, -1 on failure.
*/
int
timer_measure(void (*func)(void), struct timer *timer, int flags);
// These next functions are shortcuts that use timer_measure and use the
// default flags. They just use 'timer' as an out argument.
int
timer_measure_ms(void (*func)(void), unsigned long long ms,
struct timer *timer);
int
timer_measure_reps(void (*func)(void), unsigned int reps, struct timer *timer);
#endif
| Add more flags and documentation | Add more flags and documentation
| C | mit | joeljk13/Timer,joeljk13/Timer |
64286c63308db83935b5112b4adc2524f7c7f28f | chrome/browser/extensions/extension_management_api_constants.h | chrome/browser/extensions/extension_management_api_constants.h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#pragma once
namespace extension_management_api_constants {
// Keys used for incoming arguments and outgoing JSON data.
extern const char kAppLaunchUrlKey[];
extern const char kDescriptionKey[];
extern const char kEnabledKey[];
extern const char kDisabledReasonKey[];
extern const char kHomepageUrlKey[];
extern const char kHostPermissionsKey[];
extern const char kIconsKey[];
extern const char kIdKey[];
extern const char kIsAppKey[];
extern const char kNameKey[];
extern const char kOfflineEnabledKey[];
extern const char kOptionsUrlKey[];
extern const char kPermissionsKey[];
extern const char kMayDisableKey[];
extern const char kSizeKey[];
extern const char kUpdateUrlKey[];
extern const char kUrlKey[];
extern const char kVersionKey[];
// Values for outgoing JSON data.
extern const char kDisabledReasonPermissionsIncrease[];
extern const char kDisabledReasonUnknown[];
// Error messages.
extern const char kExtensionCreateError[];
extern const char kGestureNeededForEscalationError[];
extern const char kManifestParseError[];
extern const char kNoExtensionError[];
extern const char kNotAnAppError[];
extern const char kUserCantDisableError[];
extern const char kUserDidNotReEnableError[];
} // namespace extension_management_api_constants
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
| // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#pragma once
namespace extension_management_api_constants {
// Keys used for incoming arguments and outgoing JSON data.
extern const char kAppLaunchUrlKey[];
extern const char kDisabledReasonKey[];
extern const char kHostPermissionsKey[];
extern const char kIconsKey[];
extern const char kIsAppKey[];
extern const char kPermissionsKey[];
extern const char kSizeKey[];
extern const char kUpdateUrlKey[];
extern const char kUrlKey[];
// Values for outgoing JSON data.
extern const char kDisabledReasonPermissionsIncrease[];
extern const char kDisabledReasonUnknown[];
// Error messages.
extern const char kExtensionCreateError[];
extern const char kGestureNeededForEscalationError[];
extern const char kManifestParseError[];
extern const char kNoExtensionError[];
extern const char kNotAnAppError[];
extern const char kUserCantDisableError[];
extern const char kUserDidNotReEnableError[];
} // namespace extension_management_api_constants
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
| Remove leftover constant declarations accidentally left behind by a previous patch. | Remove leftover constant declarations accidentally left behind by a previous patch.
BUG=119692
TEST=compile succeeds
Review URL: https://chromiumcodereview.appspot.com/9903017
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@129799 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | fujunwei/chromium-crosswalk,littlstar/chromium.src,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,robclark/chromium,robclark/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,ChromiumWebApps/chromium,robclark/chromium,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,ondra-novak/chromium.src,nacl-webkit/chrome_deps,robclark/chromium,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,patrickm/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,keishi/chromium,ChromiumWebApps/chromium,jaruba/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,dednal/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,dushu1203/chromium.src,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,dushu1203/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,Just-D/chromium-1,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,ltilve/chromium,Chilledheart/chromium,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,chuan9/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,keishi/chromium,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,M4sse/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,Jonekee/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,dushu1203/chromium.src,Jonekee/chromium.src,nacl-webkit/chrome_deps,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,robclark/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,Jonekee/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,keishi/chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,zcbenz/cefode-chromium,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,robclark/chromium,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk,keishi/chromium,dednal/chromium.src,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,ltilve/chromium,robclark/chromium,zcbenz/cefode-chromium,keishi/chromium,Jonekee/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,ltilve/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,keishi/chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,robclark/chromium,ChromiumWebApps/chromium,anirudhSK/chromium,dednal/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,anirudhSK/chromium,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,Chilledheart/chromium,nacl-webkit/chrome_deps,Chilledheart/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,hujiajie/pa-chromium,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,keishi/chromium,ltilve/chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,ltilve/chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,keishi/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,keishi/chromium,ondra-novak/chromium.src,jaruba/chromium.src,Chilledheart/chromium,littlstar/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,jaruba/chromium.src,jaruba/chromium.src,robclark/chromium |
af9bb33aa33d4beb5d0ac505d48530a56856f66c | include/media/v4l2-image-sizes.h | include/media/v4l2-image-sizes.h | /*
* Standard image size definitions
*
* Copyright (C) 2013, Sylwester Nawrocki <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _IMAGE_SIZES_H
#define _IMAGE_SIZES_H
#define CIF_WIDTH 352
#define CIF_HEIGHT 288
#define QCIF_WIDTH 176
#define QCIF_HEIGHT 144
#define QQCIF_WIDTH 88
#define QQCIF_HEIGHT 72
#define QQVGA_WIDTH 160
#define QQVGA_HEIGHT 120
#define QVGA_WIDTH 320
#define QVGA_HEIGHT 240
#define SXGA_WIDTH 1280
#define SXGA_HEIGHT 1024
#define VGA_WIDTH 640
#define VGA_HEIGHT 480
#endif /* _IMAGE_SIZES_H */
| Add header file defining standard image sizes | [media] V4L: Add header file defining standard image sizes
Add common header file defining standard image sizes, so we can
avoid redefining those in each driver.
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas |
|
3a8985756e68560b5aa84adab988b681e1695f84 | generate/templates/manual/include/configurable_class_wrapper.h | generate/templates/manual/include/configurable_class_wrapper.h | #ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#include <memory>
#include <nan.h>
#include <string>
#include "cleanup_handle.h"
namespace nodegit {
class Context;
template<typename Traits>
class ConfigurableClassWrapper : public CleanupHandle {
public:
typedef typename Traits::cType cType;
typedef typename Traits::configurableCppClass configurableCppClass;
struct v8ConversionResult {
v8ConversionResult(std::string _error)
: error(std::move(_error)), result(nullptr)
{}
v8ConversionResult(std::shared_ptr<configurableCppClass> _result)
: result(std::move(_result))
{}
std::string error;
std::shared_ptr<configurableCppClass> result;
};
// We copy the entity
ConfigurableClassWrapper(nodegit::Context *_nodeGitContext)
: nodegitContext(_nodeGitContext), raw(nullptr) {}
virtual ~ConfigurableClassWrapper() {
if (raw != nullptr) {
delete raw;
raw = nullptr;
}
}
const Context *nodegitContext = nullptr;
cType *GetValue() {
return raw;
}
protected:
cType *raw;
std::vector<std::shared_ptr<CleanupHandle>> childCleanupVector;
};
}
#endif
| #ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#include <memory>
#include <nan.h>
#include <string>
#include "cleanup_handle.h"
namespace nodegit {
class Context;
template<typename Traits>
class ConfigurableClassWrapper : public CleanupHandle {
public:
typedef typename Traits::cType cType;
typedef typename Traits::configurableCppClass configurableCppClass;
struct v8ConversionResult {
v8ConversionResult(std::string _error)
: error(std::move(_error)), result(nullptr)
{}
v8ConversionResult(std::shared_ptr<configurableCppClass> _result)
: result(std::move(_result))
{}
std::string error;
std::shared_ptr<configurableCppClass> result;
};
// We copy the entity
ConfigurableClassWrapper(nodegit::Context *_nodeGitContext)
: nodegitContext(_nodeGitContext), raw(nullptr) {}
ConfigurableClassWrapper(const ConfigurableClassWrapper &) = delete;
ConfigurableClassWrapper(ConfigurableClassWrapper &&) = delete;
ConfigurableClassWrapper &operator=(const ConfigurableClassWrapper &) = delete;
ConfigurableClassWrapper &operator=(ConfigurableClassWrapper &&) = delete;
virtual ~ConfigurableClassWrapper() {
if (raw != nullptr) {
delete raw;
raw = nullptr;
}
}
const Context *nodegitContext = nullptr;
cType *GetValue() {
return raw;
}
protected:
cType *raw;
std::vector<std::shared_ptr<CleanupHandle>> childCleanupVector;
};
}
#endif
| Delete copy and move constructors for ConfigurableClassWrapper | Delete copy and move constructors for ConfigurableClassWrapper
| C | mit | jmurzy/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit,jmurzy/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit,nodegit/nodegit,jmurzy/nodegit |
8e37740dc6b20c6ec044e5db3b23894614c7784f | test/Driver/offloading-interoperability.c | test/Driver/offloading-interoperability.c | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf64lppc"
| // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" {{.*}}"-m" "elf64lppc"
| Fix link command pattern in offloading interoperability test. | [OpenMP] Fix link command pattern in offloading interoperability test.
It was causing a few bots to fail.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@276983 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
14320dcce2895b07e85d11bdbb1d47aaeaad9142 | server.h | server.h | #ifndef _SERVER_H
#define _SERVER_H
#include <time.h>
#include <sys/epoll.h>
#include "list.h"
#include "threadpool.h"
int open_listenfd(int port);
void* check_connections(void* data);
struct http_socket {
int fd;
/*struct pollfd* poll_fd;*/
struct epoll_event event;
char* read_buffer;
int read_buffer_size;
time_t last_access;
struct list_elem elem;
};
struct future_elem {
struct future* future;
struct list_elem elem;
};
#endif
| #ifndef _SERVER_H
#define _SERVER_H
#include <time.h>
#include <sys/epoll.h>
#include "list.h"
#include "threadpool.h"
struct http_socket;
int open_listenfd(int port);
void* check_connections(void* data);
int watch_read(struct http_socket* http);
int watch_write(struct http_socket* http);
int destroy_socket(struct http_socket* http);
struct http_socket {
int fd;
/*struct pollfd* poll_fd;*/
struct epoll_event event;
char* read_buffer;
int read_buffer_size;
time_t last_access;
struct list_elem elem;
};
struct future_elem {
struct future* future;
struct list_elem elem;
};
#endif
| Define functions for polling of sockets. | Define functions for polling of sockets.
| C | apache-2.0 | tbporter/http-server,tbporter/http-server,tbporter/http-server |
f9457b88e1be84a0a03f8185d4b86e9f07562506 | pblib/pblib/PBMacros.h | pblib/pblib/PBMacros.h | //
// PBMacros.h
// pblib
//
// Created by haxpor on 3/5/15.
// Copyright (c) 2015 Maethee Chongchitnant. All rights reserved.
//
#ifndef pblib_PBMacros_h
#define pblib_PBMacros_h
#define PB_IS_NSNull(obj) ((obj == (id)[NSNull null]) ? YES : NO)
#define PB_IS_NIL_OR_NSNull(obj) ((obj == nil) || (obj == (id)[NSNull null]) ? YES : NO)
#endif
| //
// PBMacros.h
// pblib
//
// Created by haxpor on 3/5/15.
// Copyright (c) 2015 Maethee Chongchitnant. All rights reserved.
//
#ifndef pblib_PBMacros_h
#define pblib_PBMacros_h
/**
Check against NSNull.
If input obj is NSNull then return YES, otherwise return NO.
*/
#define PB_IS_NSNull(obj) ((obj == (id)[NSNull null]) ? YES : NO)
/**
Check against nil or NSNull.
If input obj is nil, or NSNull then return YES, otherwise return NO.
*/
#define PB_IS_NIL_OR_NSNull(obj) ((obj == nil) || (obj == (id)[NSNull null]) ? YES : NO)
#endif
| Add comment for added macros. | Add comment for added macros.
| C | mit | haxpor/playbasis-ios,haxpor/playbasis-ios,playbasis/mobile-sdk-ios |
49d804b0623790650086764dfdda15cc36b068e4 | pkg/fizhi/fizhi_land_SIZE.h | pkg/fizhi/fizhi_land_SIZE.h | C $Header$
C $Name$
c Land Grid Horizontal Dimension (Number of Tiles)
c ------------------------------------------------
integer nchp, maxtyp
parameter (maxtyp = 10)
c parameter (nchp = sNx*sNy*maxtyp)
parameter (nchp = 2048)
| C $Header$
C $Name$
c Land Grid Horizontal Dimension (Number of Tiles)
c ------------------------------------------------
integer nchp, maxtyp
parameter (maxtyp = 10)
parameter (nchp = sNx*sNy*maxtyp)
| Make sure nchp is big enough for real vegetation tiles | Make sure nchp is big enough for real vegetation tiles
| C | mit | altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h |
756145fb4b46c5a8a77c4a3e0bef8c5382fbd951 | tests/regression/02-base/61-no-int-context.c | tests/regression/02-base/61-no-int-context.c | // PARAM: --enable ana.int.interval --disable exp.widen-context --disable ana.base.context.int
#include <assert.h>
int f(int x) {
if (x)
return f(x+1);
else
return x;
}
int main () {
int a = f(1);
assert(!a);
return 0;
}
| Add test for ana.base.context.int disabled | Add test for ana.base.context.int disabled
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
962d09e8e4566fe6780f106e98d8b131542defb5 | ui/aura/aura_switches.h | ui/aura/aura_switches.h | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_AURA_SWITCHES_H_
#define UI_AURA_AURA_SWITCHES_H_
#pragma once
namespace switches {
extern const char kAuraHostWindowSize[];
extern const char kAuraWindows[];
} // namespace switches
#endif // UI_AURA_AURA_SWITCHES_H_
| // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_AURA_SWITCHES_H_
#define UI_AURA_AURA_SWITCHES_H_
#pragma once
#include "ui/aura/aura_export.h"
namespace switches {
AURA_EXPORT extern const char kAuraHostWindowSize[];
AURA_EXPORT extern const char kAuraWindows[];
} // namespace switches
#endif // UI_AURA_AURA_SWITCHES_H_
| Fix shared library build for aura. | Fix shared library build for aura.
[email protected],[email protected]
[email protected],[email protected]
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8438039
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@108299 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | yitian134/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,adobe/chromium |
c5f7bcbae9e82ae3e54987510397d063b941d14f | test/CFrontend/2007-05-07-NestedStructReturn.c | test/CFrontend/2007-05-07-NestedStructReturn.c | // RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}
struct X { int m, n; };
struct X p(int n) {
struct X c(int m) {
struct X x;
x.m = m;
x.n = n;
return x;
}
return c(n);
}
| // RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}
struct X { int m, n, o, p; };
struct X p(int n) {
struct X c(int m) {
struct X x;
x.m = m;
x.n = n;
return x;
}
return c(n);
}
| Make the struct bigger, in an attempt to get a "struct return" on more platforms. | Make the struct bigger, in an attempt to get a "struct return" on more
platforms.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@37489 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap |
35069f4960fce71e3d8052465ee90b70e6eb3b55 | plugins/webpresence/webpresenceprefs.ui.h | plugins/webpresence/webpresenceprefs.ui.h | /****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
void WebPresencePrefsUI::init()
{
m_url->setMode( KFile::File );
m_userStyleSheet->setFilter( "*.xsl" );
}
| Support using KURLRequester with remote files | Support using KURLRequester with remote files
svn path=/trunk/kdenetwork/kopete/; revision=198696
| C | lgpl-2.1 | Jtalk/kopete-fork-xep0136,josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136 |
|
5ad831820bf5c3c557f3b49e70c76c54a92e0085 | OctoKit/OCTFileContent.h | OctoKit/OCTFileContent.h | //
// OCTFileContent.h
// OctoKit
//
// Created by Aron Cedercrantz on 14-07-2013.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "OCTContent.h"
// A file in a git repository.
@interface OCTFileContent : OCTContent
// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString *encoding;
// The raw, encoded, content of the file.
//
// See encoding for the encoding used.
@property (nonatomic, copy, readonly) NSString *content;
@end
| //
// OCTFileContent.h
// OctoKit
//
// Created by Aron Cedercrantz on 14-07-2013.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "OCTContent.h"
// A file in a git repository.
@interface OCTFileContent : OCTContent
// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString *encoding;
// The raw, encoded, content of the file.
//
// See `encoding` for the encoding used.
@property (nonatomic, copy, readonly) NSString *content;
@end
| Add backticks around the ref to encoding property. | Add backticks around the ref to encoding property.
Signed-off-by: Aron Cedercrantz <[email protected]> | C | mit | daukantas/octokit.objc,cnbin/octokit.objc,CHNLiPeng/octokit.objc,phatblat/octokit.objc,cnbin/octokit.objc,GroundControl-Solutions/octokit.objc,yeahdongcn/octokit.objc,jonesgithub/octokit.objc,GroundControl-Solutions/octokit.objc,daemonchen/octokit.objc,CleanShavenApps/octokit.objc,wrcj12138aaa/octokit.objc,xantage/octokit.objc,CHNLiPeng/octokit.objc,Palleas/octokit.objc,daemonchen/octokit.objc,leichunfeng/octokit.objc,wrcj12138aaa/octokit.objc,leichunfeng/octokit.objc,phatblat/octokit.objc,Acidburn0zzz/octokit.objc,daukantas/octokit.objc,Acidburn0zzz/octokit.objc,xantage/octokit.objc,jonesgithub/octokit.objc,Palleas/octokit.objc |
0245c9fed8f4a463a005a2562e7a06a999fc1b5f | categories/software_Development/C/run_linux_command-popen/runcmd.c | categories/software_Development/C/run_linux_command-popen/runcmd.c | #include<stdlib.h>
#include<stdio.h>
/* Run an program (in this case 'ls -la') and show it in stdout */
int main(void)
{
FILE *fd;
char str_cmd[1024], str_buf[1024];
sprintf(str_cmd, "ls -la /tmp >/dev/null && echo testmt > /tmp/sysmt.log && cat /tmp/sysmt.log");
//sprintf(str_cmd, "ls -la /tmp");
fd = popen(str_cmd, "r");
while (fgets(str_buf, 1024, fd) != NULL)
printf("%s", str_buf);
fclose(fd);
exit(0);
}
| Add example to run an command on linux using C language | Add example to run an command on linux using C language
| C | apache-2.0 | mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb,mtulio/kb |
|
09c0f20bb9372909232397300d74329cc793c552 | ui/reflectionview.h | ui/reflectionview.h | #pragma once
#include <QtGui/QMouseEvent>
#include <QtGui/QPaintEvent>
#include <QtWidgets/QWidget>
#include "binaryninjaapi.h"
#include "dockhandler.h"
#include "uitypes.h"
class ContextMenuManager;
class DisassemblyContainer;
class Menu;
class ViewFrame;
class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler
{
Q_OBJECT
Q_INTERFACES(DockContextHandler)
ViewFrame* m_frame;
BinaryViewRef m_data;
DisassemblyContainer* m_disassemblyContainer;
public:
ReflectionView(ViewFrame* frame, BinaryViewRef data);
~ReflectionView();
virtual void notifyOffsetChanged(uint64_t offset) override;
virtual void notifyViewChanged(ViewFrame* frame) override;
virtual bool shouldBeVisible(ViewFrame* frame) override;
protected:
virtual void contextMenuEvent(QContextMenuEvent* event) override;
};
| #pragma once
#include <QtGui/QMouseEvent>
#include <QtGui/QPaintEvent>
#include <QtWidgets/QWidget>
#include "binaryninjaapi.h"
#include "dockhandler.h"
#include "uitypes.h"
class ContextMenuManager;
class DisassemblyContainer;
class Menu;
class ViewFrame;
class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler
{
Q_OBJECT
Q_INTERFACES(DockContextHandler)
ViewFrame* m_frame;
BinaryViewRef m_data;
DisassemblyContainer* m_disassemblyContainer;
public:
ReflectionView(ViewFrame* frame, BinaryViewRef data);
~ReflectionView();
virtual void notifyOffsetChanged(uint64_t offset) override;
virtual void notifyViewChanged(ViewFrame* frame) override;
virtual void notifyVisibilityChanged(bool visible) override;
virtual bool shouldBeVisible(ViewFrame* frame) override;
protected:
virtual void contextMenuEvent(QContextMenuEvent* event) override;
};
| Update reflection view on transition to visible state. | Update reflection view on transition to visible state.
| C | mit | Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api |
6a5ae45aad7943b8da905f2f1d7c894e412843ea | cli/tests/hello/hello.c | cli/tests/hello/hello.c | #include <stdio.h>
#ifndef ENV_NAME
# define ENV_NAME "host"
#endif
int main(int argc, char* argv)
{
printf("Hello World from Rebuild environment " ENV_NAME "\n");
return 0;
}
| #include <stdio.h>
#ifndef ENV_NAME
# define ENV_NAME "host"
#endif
int main(int argc, char** argv)
{
printf("Hello World from Rebuild environment " ENV_NAME "\n");
return 0;
}
| Fix main parameter of the test application | tests: Fix main parameter of the test application
[ci skip]
Signed-off-by: Yan Vugenfirer <[email protected]>
| C | apache-2.0 | rbld/rebuild,daynix/rebuild,rbld/rebuild,daynix/rebuild,daynix/rebuild,rbld/rebuild |
8ebd28f63a1d16787621568363329a99b56d4184 | platform/stm32f7/cmds/stm32f7_lcd_test.c | platform/stm32f7/cmds/stm32f7_lcd_test.c |
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include "stm32746g_discovery.h"
#include "stm32746g_discovery_lcd.h"
#include "stm32746g_discovery_sdram.h"
#define LCD_FRAMEBUFFER SDRAM_DEVICE_ADDR
static void lcd_test(void) {
if (BSP_LCD_Init() != LCD_OK) {
printf(">>> BSP_LCD_Init failed\n");
}
/* Initialize the LCD Layers */
BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FRAMEBUFFER);
/* Set LCD Foreground Layer */
BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
/* Clear the LCD */
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set the LCD Text Color */
BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE);
/* Display LCD messages */
BSP_LCD_DisplayStringAt(0, 10, (uint8_t *)"STM32F746G BSP", CENTER_MODE);
BSP_LCD_SetTextColor(LCD_COLOR_DARKGREEN);
BSP_LCD_DisplayStringAt(0, 60, (uint8_t *)"Embox LCD example", CENTER_MODE);
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_DisplayStringAt(0, 200, (uint8_t *)"All rights reserved", CENTER_MODE);
}
int main(int argc, char *argv[]) {
printf("STM32F7 LCD test start\n");
lcd_test();
while (1) {
}
return 0;
}
| Add new cube-based LCD test | stm32f7: Add new cube-based LCD test
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
|
a339e7138090b2a756b89bdc1f3b9969bb5c5870 | tests/regression/36-octapron/50-evalint.c | tests/regression/36-octapron/50-evalint.c | // SKIP PARAM: --sets ana.activated[+] octApron --enable ana.int.interval
#include <assert.h>
void foo(int a, int *pb) {
int b = *pb;
// base knows a == 4 and b == 4, octApron only knows a == 4
assert(a == b);
}
void main() {
int x, y, z, a, b;
if (x < y && y < z) {
// base doesn't know anything, octApron knows x < y < z
assert(x < y);
assert(y < z);
assert(x < z);
if (3 <= x && z <= 5) {
// base knows 3 <= x and z <= 5, octApron knows x == 3 and y == 4 and z == 5
a = y; // base should now know a == 4 via EvalInt query
assert(x == 3);
assert(y == 4);
assert(z == 5);
assert(a == 4);
b = 4;
foo(a, &b); // base should add a == 4 and b == 4 to context, octApron only adds a == 4
}
}
}
| Add octapron test where base gets precise value for variable from octapron via EvalInt query | Add octapron test where base gets precise value for variable from octapron via EvalInt query
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
04e00705faf26d7d6f009350cdadc5279dd4e72a | Classes/AXTabBar.h | Classes/AXTabBar.h | //
// AXTabBar.h
// Pods
//
#import <UIKit/UIKit.h>
typedef enum : NSUInteger {
AXTabBarStyleDefault = 0,
AXTabBarStyleVariableWidthButton,
} AXTabBarStyle;
@class AXTabBar;
@protocol AXTabBarDelegate <NSObject>
@optional
- (BOOL)tabBar:(AXTabBar *)tabBar shouldSelectItem:(UITabBarItem *)item;
- (void)tabBar:(AXTabBar *)tabBar didSelectItem:(UITabBarItem *)item;
@end
@interface AXTabBar : UIView
@property (copy, nonatomic) NSArray *items;
@property (assign, nonatomic) UITabBarItem *selectedItem;
@property (assign, nonatomic) id<AXTabBarDelegate> delegate;
@property (strong, nonatomic) UIFont *tabBarButtonFont;
// TODO: implement this style option.
//@property (nonatomic) AXTabBarStyle tabBarStyle;
@end
| //
// AXTabBar.h
// Pods
//
#import <UIKit/UIKit.h>
typedef enum : NSUInteger {
AXTabBarStyleDefault = 0,
AXTabBarStyleVariableWidthButton,
} AXTabBarStyle;
@class AXTabBar;
@protocol AXTabBarDelegate <NSObject>
@optional
- (BOOL)tabBar:(AXTabBar *)tabBar shouldSelectItem:(UITabBarItem *)item;
- (void)tabBar:(AXTabBar *)tabBar didSelectItem:(UITabBarItem *)item;
@end
@interface AXTabBar : UIView
@property (copy, nonatomic) NSArray *items;
@property (assign, nonatomic) UITabBarItem *selectedItem;
@property (assign, nonatomic) id<AXTabBarDelegate> delegate;
@property (strong, nonatomic) UIFont *tabBarButtonFont;
@property (nonatomic) AXTabBarStyle tabBarStyle;
@end
| Allow tab bar style property | Allow tab bar style property | C | mit | nickelsberry/AXStretchableHeaderTabViewController,nickelsberry/AXStretchableHeaderTabViewController,nickelsberry/AXStretchableHeaderTabViewController |
63acafe0c39437980004f0cfbdb394f828958bfb | alura/c/ponteiro.c | alura/c/ponteiro.c | #include <stdio.h>
void calcula(int* c) {
printf("calcula %d %d\n", (*c), c);
(*c)++;
printf("calcula %d %d\n", (*c), c);
}
int main() {
int c = 10;
printf("main %d %d\n", c, &c);
calcula(&c);
printf("main %d %d\n", c, &c);
}
| Update files, Alura, Introdução a C - Parte 2, Aula 5.1 | Update files, Alura, Introdução a C - Parte 2, Aula 5.1
| C | mit | fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs |
|
2cb74a0913f6568a87de9246063e74089c38ea10 | Example/BonMot/NSDictionary+BONEquality.h | Example/BonMot/NSDictionary+BONEquality.h | //
// NSDictionary+BONEquality.h
// BonMot
//
// Created by Zev Eisenberg on 7/11/15.
// Copyright © 2015 Zev Eisenberg. All rights reserved.
//
@import Foundation;
@import CoreGraphics.CGBase;
OBJC_EXTERN const CGFloat kBONCGFloatEpsilon;
OBJC_EXTERN BOOL BONCGFloatsCloseEnough(CGFloat float1, CGFloat float2);
// clang-format off
@interface NSDictionary <KeyType, ObjectType> (BONEquality)
- (BOOL)bon_isCloseEnoughEqualToDictionary : (NSDictionary<KeyType, ObjectType> *_Nullable)dictionary;
@end
// clang-format off
| //
// NSDictionary+BONEquality.h
// BonMot
//
// Created by Zev Eisenberg on 7/11/15.
// Copyright © 2015 Zev Eisenberg. All rights reserved.
//
@import Foundation;
@import CoreGraphics.CGBase;
OBJC_EXTERN const CGFloat kBONCGFloatEpsilon;
OBJC_EXTERN BOOL BONCGFloatsCloseEnough(CGFloat float1, CGFloat float2);
// clang-format off
@interface NSDictionary <KeyType, ObjectType> (BONEquality)
- (BOOL)bon_isCloseEnoughEqualToDictionary : (NSDictionary<KeyType, ObjectType> *_Nullable)dictionary;
@end
// clang-format on
| Fix copypasta to re-enable clang-format. | Fix copypasta to re-enable clang-format.
| C | mit | Raizlabs/BonMot,Raizlabs/BonMot,Raizlabs/BonMot |
7afb68bf3ea5c1549f10e3bdb7f25ecb51256786 | tests.c | tests.c | #include "lua.h"
#include "lua_debug.h"
int main() {
return 0;
}
| #include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "lua_debug.h"
static const luaL_Reg STANDARD_LIBS[] = {
{ "_G", luaopen_base },
{ LUA_TABLIBNAME, luaopen_table },
{ LUA_STRLIBNAME, luaopen_string },
{ LUA_MATHLIBNAME, luaopen_math },
{ LUA_DBLIBNAME, luaopen_debug },
{ 0, 0 }
};
int main() {
lua_State * l = (lua_State *)luaL_newstate();
const luaL_Reg *lib;
for (lib = STANDARD_LIBS; lib->func; ++lib) {
luaL_requiref(l, lib->name, lib->func, 1);
lua_pop(l, 1);
}
lua_debug_init(l, "/tmp/socket_lua_debug");
return 0;
}
| Add a test program with a bit more substance. | Add a test program with a bit more substance.
| C | mit | laarmen/lua_debug,laarmen/lua_debug |
542c416be33f1cc748530f20db2025f43f490b30 | content/public/common/resource_devtools_info.h | content/public/common/resource_devtools_info.h | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
#define CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
namespace content {
struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> {
typedef std::vector<std::pair<std::string, std::string> >
HeadersVector;
CONTENT_EXPORT ResourceDevToolsInfo();
int32 http_status_code;
std::string http_status_text;
HeadersVector request_headers;
HeadersVector response_headers;
std::string request_headers_text;
std::string response_headers_text;
private:
friend class base::RefCounted<ResourceDevToolsInfo>;
CONTENT_EXPORT ~ResourceDevToolsInfo();
};
} // namespace content
#endif // CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
| // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
#define CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_split.h"
#include "content/common/content_export.h"
namespace content {
struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> {
typedef base::StringPairs HeadersVector;
CONTENT_EXPORT ResourceDevToolsInfo();
int32 http_status_code;
std::string http_status_text;
HeadersVector request_headers;
HeadersVector response_headers;
std::string request_headers_text;
std::string response_headers_text;
private:
friend class base::RefCounted<ResourceDevToolsInfo>;
CONTENT_EXPORT ~ResourceDevToolsInfo();
};
} // namespace content
#endif // CONTENT_COMMON_RESOURCE_DEVTOOLS_INFO_H_
| Use base::StringPairs where appropriate from /content | Use base::StringPairs where appropriate from /content
Because base/strings/string_split.h defines:
typedef std::vector<std::pair<std::string, std::string> > StringPairs;
BUG=412250
Review URL: https://codereview.chromium.org/600163003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#296649}
| C | bsd-3-clause | hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,ltilve/chromium,dednal/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,M4sse/chromium.src,ltilve/chromium,markYoungH/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,Jonekee/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,Fireblend/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,M4sse/chromium.src,M4sse/chromium.src,dednal/chromium.src,Just-D/chromium-1,Just-D/chromium-1,M4sse/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dednal/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,ltilve/chromium,ltilve/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk |
c57a5ce0df04be61bafedc0f3043d568103c7ab5 | arch/powerpc/include/uapi/asm/byteorder.h | arch/powerpc/include/uapi/asm/byteorder.h | #ifndef _ASM_POWERPC_BYTEORDER_H
#define _ASM_POWERPC_BYTEORDER_H
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/byteorder/big_endian.h>
#endif /* _ASM_POWERPC_BYTEORDER_H */
| #ifndef _ASM_POWERPC_BYTEORDER_H
#define _ASM_POWERPC_BYTEORDER_H
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifdef __LITTLE_ENDIAN__
#include <linux/byteorder/little_endian.h>
#else
#include <linux/byteorder/big_endian.h>
#endif
#endif /* _ASM_POWERPC_BYTEORDER_H */
| Include the appropriate endianness header | powerpc: Include the appropriate endianness header
This patch will have powerpc include the appropriate generic endianness
header depending on what the compiler reports.
Signed-off-by: Ian Munsie <[email protected]>
Signed-off-by: Anton Blanchard <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
4618ec7636fa2cbd3f8907d3f72d4ad7cb772d36 | tests/regression/02-base/51-evalint-deep.c | tests/regression/02-base/51-evalint-deep.c | // from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c
// contains deep integer expressions that shouldn't cause extremely exponential slowdown
// when evaluated by base's eval_rv and EvalInt jointly
// runs (as unknown) under 0.1s
#include <assert.h>
void assume_abort_if_not(int cond) {
if(!cond) {abort();}
}
int main() {
short k;
long long y, x, c;
assume_abort_if_not(k>=0 && k<=5);
assume_abort_if_not(k <= 256);
y = 0;
x = 0;
c = 0;
while (1) {
assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0);
if (!(c < k))
break;
c = c + 1;
y = y + 1;
x = y * y * y * y * y + x;
}
assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0);
assert(k*y == y*y);
return 0;
}
| Add regression test with deep integer expressions | Add regression test with deep integer expressions
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
98c1fbe223dd5469e194a4e772b8e5b181b692ee | src/ui.h | src/ui.h | #pragma once
void draw_seconds(GContext *ctx, uint8_t seconds, Layer *layer);
void draw_minutes(GContext *ctx, uint8_t minutes, Layer *layer);
void draw_hours(GContext *ctx, uint8_t hours, Layer *layer);
| #pragma once
/*
This header file declares drawing methods that are defined in rect.c or round.c,
depending on the platform being built. Since the methods share the same function
signature, they can share the same header file, even though the implementations
of the functions themselves are different.
*/
void draw_seconds(GContext *ctx, uint8_t seconds, Layer *layer);
void draw_minutes(GContext *ctx, uint8_t minutes, Layer *layer);
void draw_hours(GContext *ctx, uint8_t hours, Layer *layer);
| Add comment to header file about change | Add comment to header file about change
| C | mit | NiVZ78/concentricity,pebble-examples/concentricity,NiVZ78/concentricity,pebble-examples/concentricity,pebble-examples/concentricity |
93ae893e22571cc61f7d334cf36bb5642460a39c | extensions/ringopengl/opengl11/ring_opengl11.c | extensions/ringopengl/opengl11/ring_opengl11.c | #include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <[email protected]>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_FUNC(ring_get_gl_false)
{
RING_API_RETNUMBER(GL_FALSE);
}
RING_FUNC(ring_get_gl_logic_op)
{
RING_API_RETNUMBER(GL_LOGIC_OP);
}
RING_FUNC(ring_get_gl_none)
{
RING_API_RETNUMBER(GL_NONE);
}
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("get_gl_zero",ring_get_gl_zero);
ring_vm_funcregister("get_gl_false",ring_get_gl_false);
ring_vm_funcregister("get_gl_logic_op",ring_get_gl_logic_op);
ring_vm_funcregister("get_gl_none",ring_get_gl_none);
}
| #include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <[email protected]>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_FUNC(ring_get_gl_false)
{
RING_API_RETNUMBER(GL_FALSE);
}
RING_FUNC(ring_get_gl_logic_op)
{
RING_API_RETNUMBER(GL_LOGIC_OP);
}
RING_FUNC(ring_get_gl_none)
{
RING_API_RETNUMBER(GL_NONE);
}
RING_FUNC(ring_get_gl_texture_components)
{
RING_API_RETNUMBER(GL_TEXTURE_COMPONENTS);
}
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("get_gl_zero",ring_get_gl_zero);
ring_vm_funcregister("get_gl_false",ring_get_gl_false);
ring_vm_funcregister("get_gl_logic_op",ring_get_gl_logic_op);
ring_vm_funcregister("get_gl_none",ring_get_gl_none);
ring_vm_funcregister("get_gl_texture_components",ring_get_gl_texture_components);
}
| Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_TEXTURE_COMPONENTS | Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_TEXTURE_COMPONENTS
| C | mit | ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring |
bbcb290dc0e1d1e9f9442b5e97c291fe79b66058 | rootkit.c | rootkit.c | #include <linux/module.h> // included for all kernel modules
#include <linux/kernel.h> // included for KERN_INFO
#include <linux/init.h> // included for __init and __exit macros
#include <linux/proc_fs.h>
#define MODULE_NAME "rootkit"
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Julia Evans");
MODULE_DESCRIPTION("The tiniest rootkit");
static struct file_operations handler_fops;
const struct file_operations *handler_original = 0;
struct proc_dir_entry *handler, *root;
static ssize_t make_pid_root (
struct file *filp,
const char __user *data,
size_t sz,
loff_t *l)
{
printk("YOU HAVE BEEN HACKED\n");
return -1;
}
/**
* Infects /proc/buddyinfo with a device handler that sets
*/
void install_handler(struct proc_dir_entry *root) {
struct proc_dir_entry *ptr = root->subdir;
while(ptr && strcmp(ptr->name, "buddyinfo"))
ptr = ptr->next;
if(ptr) {
handler = ptr;
ptr->mode |= S_IWUGO;
handler_original = (struct file_operations*)ptr->proc_fops;
// create new handler
handler_fops = *ptr->proc_fops;
handler_fops.write = make_pid_root;
ptr->proc_fops = &handler_fops;
}
}
static int __init module_init_proc(void) {
static struct file_operations fileops_struct = {0};
struct proc_dir_entry *new_proc;
// dummy to get proc_dir_entry of /proc
new_proc = proc_create("dummy", 0644, 0, &fileops_struct);
root = new_proc->parent;
// install the handler to wait for orders...
install_handler(root);
// it's no longer required.
remove_proc_entry("dummy", 0);
return 0;
}
static int __init rootkit_init(void)
{
module_init_proc();
printk(KERN_INFO "Starting kernel module!\n");
return 0; // Non-zero return means that the module couldn't be loaded.
}
static void __exit rootkit_cleanup(void)
{
handler->proc_fops = handler_original;
printk(KERN_INFO "Cleaning up module.\n");
}
module_init(rootkit_init);
module_exit(rootkit_cleanup);
| Add module that prints YOU HAVE BEEN HACKED when writing to /proc/buddyinfo | Add module that prints YOU HAVE BEEN HACKED when writing to /proc/buddyinfo
| C | mit | jvns/kernel-module-fun,rictator/kernel-module-fun,abhinavthukral28/kernel-module-fun,onestraw/kernel-module-fun,tzhenghao/kernel-module-fun |
|
29db01601e61470f99eff92e5191bfefa64f2a7d | src/irc.h | src/irc.h | #ifndef _IRC_H
#define _IRC_H
#define NICK "slackboat"
#define SERVER "irc.what.cd"
#define PASSWORD "thisistheonlygoodbot"
void irc_notice_event(char *, char *, char *);
void irc_welcome_event(void);
void irc_privmsg_event(char *, char *, char *);
void irc_privmsg(const char *, const char *);
void irc_join_channel(const char *);
#endif
| #ifndef _IRC_H
#define _IRC_H
#define NICK "slackboat"
#define SERVER "irc.what.cd"
#define PASSWORD "PASSWORD"
void irc_notice_event(char *, char *, char *);
void irc_welcome_event(void);
void irc_privmsg_event(char *, char *, char *);
void irc_privmsg(const char *, const char *);
void irc_join_channel(const char *);
#endif
| Structure the program for minimum coupling | Structure the program for minimum coupling
| C | isc | Zlacki/slackboat,Zlacki/slackboat,Zlacki/slackboat,Zlacki/slackboat |
35bc38ac4592800a2c3d13b001a0b66679c8f0b7 | include/api/ofp_epoll.h | include/api/ofp_epoll.h | /* Copyright (c) 2016, Nokia
* Copyright (c) 2016, ENEA Software AB
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __OFP_EPOLL_H__
#define __OFP_EPOLL_H__
#include <stdint.h>
typedef union ofp_epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} ofp_epoll_data_t;
struct ofp_epoll_event {
uint32_t events;
ofp_epoll_data_t data;
};
enum OFP_EPOLL_EVENTS {
OFP_EPOLLIN = 0x001,
#define OFP_EPOLLIN OFP_EPOLLIN
};
#define OFP_EPOLL_CTL_ADD 1
#define OFP_EPOLL_CTL_DEL 2
#define OFP_EPOLL_CTL_MOD 3
int ofp_epoll_create(int size);
int ofp_epoll_ctl(int epfd, int op, int fd, struct ofp_epoll_event *event);
int ofp_epoll_wait(int epfd, struct ofp_epoll_event *events, int maxevents, int timeout);
#endif
| /* Copyright (c) 2016, Nokia
* Copyright (c) 2016, ENEA Software AB
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __OFP_EPOLL_H__
#define __OFP_EPOLL_H__
#include <stdint.h>
#if __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
typedef union ofp_epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} ofp_epoll_data_t;
struct ofp_epoll_event {
uint32_t events;
ofp_epoll_data_t data;
};
enum OFP_EPOLL_EVENTS {
OFP_EPOLLIN = 0x001,
#define OFP_EPOLLIN OFP_EPOLLIN
};
#define OFP_EPOLL_CTL_ADD 1
#define OFP_EPOLL_CTL_DEL 2
#define OFP_EPOLL_CTL_MOD 3
int ofp_epoll_create(int size);
int ofp_epoll_ctl(int epfd, int op, int fd, struct ofp_epoll_event *event);
int ofp_epoll_wait(int epfd, struct ofp_epoll_event *events, int maxevents, int timeout);
#if __GNUC__ >= 4
#pragma GCC visibility pop
#endif
#endif
| Add visibility to epoll headers | Add visibility to epoll headers
The odp_epoll_* symbols were not visible in the final library built with
GCC.
Signed-off-by: Oriol Arcas <[email protected]>
Reviewed-by: Sorin Vultureanu <[email protected]>
| C | bsd-3-clause | TolikH/ofp,TolikH/ofp,OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp,TolikH/ofp,OpenFastPath/ofp |
70e2648e02232c1a439a7418388f18fee9afb3fe | json-glib/tests/json-test-utils.h | json-glib/tests/json-test-utils.h | #include <string.h>
#include <math.h>
#include <float.h>
#include <glib.h>
#include <json-glib/json-glib.h>
#define json_fuzzy_equals(n1,n2,epsilon) \
(((n1) > (n2) ? ((n1) - (n2)) : ((n2) - (n1))) < (epsilon))
#define json_assert_fuzzy_equals(n1,n2,epsilon) \
G_STMT_START { \
double __n1 = (n1), __n2 = (n2), __epsilon = (epsilon); \
if (json_fuzzy_equals (__n1, __n2, __epsilon)) ; else { \
g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
#n1 " == " #n2 " (+/- " #epsilon ")", \
__n1, "==", __n2, 'f'); \
} \
} G_STMT_END
#define json_assert_almost_equals(n1,n2) \
json_assert_fuzzy_equals (n1, n2, DBL_EPSILON)
| Add float comparison utility macros for tests | Add float comparison utility macros for tests
We do compare floating point values elsewhere in our code, so we should
ensure that we're doing that with a certain amount of fuzziness.
| C | lgpl-2.1 | GNOME/json-glib,frida/json-glib,GNOME/json-glib,frida/json-glib |
|
6626332f97efce89d2322a203058b4ab74ffc17b | cmd_start_daemon.c | cmd_start_daemon.c | /*
* Copyright (c) 2014, 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.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <arpa/inet.h>
#include <string.h>
#include "util.h"
#include "autocmd.h"
#include "fs.h"
#include "child.h"
#include "net.h"
#include "strutil.h"
#include "constants.h"
FORWARD(start_daemon);
#if !FBADB_MAIN
#include "stubdaemon.h"
int
start_daemon_main(const struct cmd_start_daemon_info* info)
{
struct cmd_stub_info sinfo = {
.stub.listen = true,
.stub.daemonize = true,
.stub.replace = info->start_daemon.replace,
};
return stub_main(&sinfo);
}
#endif
| /*
* Copyright (c) 2014, 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.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <arpa/inet.h>
#include <string.h>
#include "util.h"
#include "autocmd.h"
#include "fs.h"
#include "child.h"
#include "net.h"
#include "strutil.h"
#include "constants.h"
FORWARD(start_daemon);
#if !FBADB_MAIN
#include "stubdaemon.h"
int
start_daemon_main(const struct cmd_start_daemon_info* info)
{
SCOPED_RESLIST(rl);
struct cmd_stub_info sinfo = {
.stub.listen = true,
.stub.daemonize = true,
.stub.replace = info->start_daemon.replace,
};
set_prgname(xaprintf("%s stub", xbasename(orig_argv0)));
return stub_main(&sinfo);
}
#endif
| Set prgname to stub while in daemon | Set prgname to stub while in daemon
| C | bsd-3-clause | JuudeDemos/fb-adb,JuudeDemos/fb-adb,biddyweb/fb-adb,0359xiaodong/fb-adb,0359xiaodong/fb-adb,0359xiaodong/fb-adb,biddyweb/fb-adb,biddyweb/fb-adb,tcmulcahy/fb-adb,tcmulcahy/fb-adb,JuudeDemos/fb-adb,tcmulcahy/fb-adb |
31ab70c9b25b7203422c12d18439cfdee95a6d8d | ir/be/test/CallingTest.c | ir/be/test/CallingTest.c | #include <stdio.h>
int int_func(void)
{
return 42;
}
float float_func(void)
{
return 13.5f;
}
int main(int argc, char *argv[])
{
printf("calltest.c\n");
printf(" Calling int function: %d\n", int_func());
printf(" Calling float function: %f\n", float_func());
return 0;
}
| #include <stdio.h>
int int_func(void)
{
return 42;
}
float float_func(void)
{
return 13.5f;
}
double double_func(void)
{
return 13.5;
}
int main(int argc, char *argv[])
{
printf("calltest.c\n");
printf(" Calling int function: %d\n", int_func());
printf(" Calling float function: %f\n", float_func());
printf(" Calling double function: %f\n", double_func());
return 0;
}
| Add test for double call | Add test for double call
[r15890]
| C | lgpl-2.1 | libfirm/libfirm,libfirm/libfirm,libfirm/libfirm,jonashaag/libfirm,davidgiven/libfirm,davidgiven/libfirm,jonashaag/libfirm,8l/libfirm,davidgiven/libfirm,MatzeB/libfirm,killbug2004/libfirm,8l/libfirm,MatzeB/libfirm,davidgiven/libfirm,jonashaag/libfirm,killbug2004/libfirm,8l/libfirm,davidgiven/libfirm,jonashaag/libfirm,8l/libfirm,MatzeB/libfirm,8l/libfirm,libfirm/libfirm,libfirm/libfirm,jonashaag/libfirm,MatzeB/libfirm,davidgiven/libfirm,killbug2004/libfirm,jonashaag/libfirm,8l/libfirm,jonashaag/libfirm,MatzeB/libfirm,davidgiven/libfirm,killbug2004/libfirm,MatzeB/libfirm,killbug2004/libfirm,killbug2004/libfirm,killbug2004/libfirm,MatzeB/libfirm,8l/libfirm |
0416ae00706748da9fb6a1c716b824aa33cac1a5 | hello_world.c | hello_world.c | #include <stdio.h>
int main()
{
printf("hello, world\n");
} | #include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
| Fix gcc warning when -Wall (implicit return). | Fix gcc warning when -Wall (implicit return).
warning: control reaches end of non-void function [-Wreturn-type]
}
^ | C | mit | learnclang/1-helloworld |
394d0cdb020eaf4342d6f0fb31ca85d802f529f9 | src/util/dlist/dlist_debug.c | src/util/dlist/dlist_debug.c | /**
* @file
* @brief Paranoia checks of doubly-linked lists
*
* @date 05.12.2013
* @author Eldar Abusalimov
*/
#include <inttypes.h>
#include <assert.h>
#include <util/dlist.h>
#if DLIST_DEBUG_VERSION
void __dlist_debug_check(const struct dlist_head *head) {
const struct dlist_head *p = head->prev;
const struct dlist_head *n = head->next;
uintptr_t poison = head->poison;
assertf(((!poison || (void *) ~poison == head) &&
n->prev == head &&
p->next == head),
"\n"
"head: %p, poison: %p, ~poison: %p,\n"
"n: %p, n->prev: %p,\n"
"p: %p, p->next: %p\n",
head, (void *)poison, (void *) ~poison,
n, n->prev,
p, p->next);
}
#endif
| /**
* @file
* @brief Paranoia checks of doubly-linked lists
*
* @date 05.12.2013
* @author Eldar Abusalimov
*/
#include <inttypes.h>
#include <assert.h>
#include <util/dlist.h>
#if DLIST_DEBUG_VERSION
void __dlist_debug_check(const struct dlist_head *head) {
#ifndef NDEBUG
const struct dlist_head *p = head->prev;
const struct dlist_head *n = head->next;
uintptr_t poison = head->poison;
assertf(((!poison || (void *) ~poison == head) &&
n->prev == head &&
p->next == head),
"\n"
"head: %p, poison: %p, ~poison: %p,\n"
"n: %p, n->prev: %p,\n"
"p: %p, p->next: %p\n",
head, (void *)poison, (void *) ~poison,
n, n->prev,
p, p->next);
#endif
}
#endif
| Fix dlist compilation with NDEBUG flag | minor: Fix dlist compilation with NDEBUG flag
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
9d0a5d628d92adea01f2d5f6927b35cd0189fcc2 | randbin.c | randbin.c | // compile with clang:
// clang -march=skylake randbin.c
// or whatever architecture you have. It only works on certain architectures.
#include <math.h>
#include <stdio.h>
int main(int argc, char **argv) {
int filesize = 0;
char byte_multiplier = 0;
if (argc <= 1) {
filesize = 512 * 1024;
} else {
sscanf(argv[1], "%u%c", &filesize, &byte_multiplier);
}
switch (byte_multiplier) {
case 'k':
case 'K':
filesize *= 1024;
break;
case 'm':
case 'M':
filesize *= 1024 * 1024;
break;
}
FILE *fout = fopen("out.bin", "wb");
if (filesize <= 4) {
unsigned int a = 0;
__builtin_ia32_rdrand32_step(&a);
fwrite(&a, 1, filesize, fout);
} else {
int bytes = (int)floor((double)filesize / 4) + (filesize % 4);
for (int i = 0; i < bytes; i++) {
unsigned int a = 0;
__builtin_ia32_rdrand32_step(&a);
fwrite(&a, sizeof a, 1, fout);
}
}
fclose(fout);
return 0;
}
| Add little program that generates random binaries | Add little program that generates random binaries
I uses the assembly instruction ```rdrand``` via the clang compiler's builtin. | C | mit | Phyllostachys/junkcode,Phyllostachys/junkcode,Phyllostachys/junkcode,Phyllostachys/junkcode,Phyllostachys/junkcode |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.