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
|
---|---|---|---|---|---|---|---|---|---|
8c57d9ca2da9eb7d35c0b1e41e67477449ba34e0 | src/win32/random_win.c | src/win32/random_win.c | /*
*The MIT License (MIT)
*
* Copyright (c) <2017> <Stephan Gatzka>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stddef.h>
#include <Windows.h>
#include <Wincrypt.h>
#include "jet_random.h"
void cjet_get_random_bytes(void *bytes, size_t num_bytes)
{
HCRYPTPROV hCryptProv = 0;
CryptGenRandom(hCryptProv, (DWORD)num_bytes, bytes);
} | Add stub for windows random implementation. | Add stub for windows random implementation.
| C | mit | gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet |
|
18d9964f98298e426a488c00300834cc5441ee1b | src/framework/cmd/core.c | src/framework/cmd/core.c | /**
* @file
* @brief Command registry and invocation code.
*
* @date 01.03.11
* @author Eldar Abusalimov
*/
#include <framework/cmd/api.h>
#include <framework/cmd/types.h>
#include <ctype.h>
#include <stddef.h>
#include <errno.h>
#include <string.h>
#include <util/array.h>
#include <util/getopt.h>
ARRAY_SPREAD_DEF(const struct cmd * const, __cmd_registry);
int cmd_exec(const struct cmd *cmd, int argc, char **argv) {
int err;
if (!cmd)
return -EINVAL;
err = mod_activate_app(cmd2mod(cmd));
if (err)
return err;
getopt_init();
return cmd->exec(argc, argv);
}
const struct cmd *cmd_lookup(const char *name) {
const struct cmd *cmd = NULL;
if (!strncmp(name, "/bin/", strlen("/bin/"))) {
name += strlen("/bin/");
}
cmd_foreach(cmd) {
if (strcmp(cmd_name(cmd), name) == 0) {
return cmd;
}
}
return NULL;
}
| /**
* @file
* @brief Command registry and invocation code.
*
* @date 01.03.11
* @author Eldar Abusalimov
*/
#include <framework/cmd/api.h>
#include <framework/cmd/types.h>
#include <ctype.h>
#include <stddef.h>
#include <errno.h>
#include <string.h>
#include <util/array.h>
#include <util/getopt.h>
ARRAY_SPREAD_DEF(const struct cmd * const, __cmd_registry);
int cmd_exec(const struct cmd *cmd, int argc, char **argv) {
int err;
if (!cmd)
return -EINVAL;
err = mod_activate_app(cmd2mod(cmd));
if (err)
return err;
getopt_init();
err = cmd->exec(argc, argv);
/* FIXME Here we make app's data and bss as they was
* before app execution. It's required because we call all
* C++ ctors on every app launch. When we will call only ctors
* of the running app, this workaround can be removed. */
mod_activate_app(cmd2mod(cmd));
return err;
}
const struct cmd *cmd_lookup(const char *name) {
const struct cmd *cmd = NULL;
if (!strncmp(name, "/bin/", strlen("/bin/"))) {
name += strlen("/bin/");
}
cmd_foreach(cmd) {
if (strcmp(cmd_name(cmd), name) == 0) {
return cmd;
}
}
return NULL;
}
| Fix running of c++ apps when there are multiple apps in mods.conf | Fix running of c++ apps when there are multiple apps in mods.conf
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
429be9362d598d3b7b3ea6e19b1be2dca867aa0a | test/tools/llvm-symbolizer/print_context.c | test/tools/llvm-symbolizer/print_context.c | // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5 : #include
// CHECK: 6 :
// CHECK: 7 >: int inc
// CHECK: 8 : return
// CHECK: 9 : }
| // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
// CHECK: inc
// CHECK: print_context.c:[[@LINE+9]]
// CHECK: [[@LINE+6]] : #include
// CHECK: [[@LINE+6]] :
// CHECK: [[@LINE+6]] >: int inc
// CHECK: [[@LINE+6]] : return
// CHECK: [[@LINE+6]] : }
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
| Make test robust to changes in prefix/avoid hardcoded line numbers | Make test robust to changes in prefix/avoid hardcoded line numbers
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@309516 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm |
a35e09994e5ffe1fb364bb69860056be5c89efea | testcode/typedef_in_header_file_main.c | testcode/typedef_in_header_file_main.c | /*
* Three files to show how to put a typedef struct and
* functions into a header file.
*
* Copyright 2017 Dave Cuthbert, MIT license
*/
#include <stdlib.h>
#include <stdio.h>
#include "typedef_in_header_file.h"
int main(int argc, char *argv[])
{
Node *root;
root = new_node();
root->value = 1;
printf("ROOT: %d\n", root->value);
Node *node_ptr = new_node();
node_ptr = root;
printf("NODE PTR: %d\n", root->value);
/* Add another node */
node_ptr->next = new_node();
/* Move forward to new node */
node_ptr = node_ptr->next;
node_ptr->next = 0;
node_ptr->value = 2;
printf("NEW NODE: %d\n", node_ptr->value);
return 0;
}
| Add typdef in header main() | Add typdef in header main() | C | mit | daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various |
|
e0aaf216fbf480f46f78b9c4ecca9dd7da682811 | src/compat/posix/include/dirent.h | src/compat/posix/include/dirent.h | /**
*
* @date 23.11.2012
* @author Alexander Kalmuk
*/
#ifndef DIRENT_H_
#define DIRENT_H_
#include <sys/types.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
#define DIRENT_DNAME_LEN 40
struct dirent {
ino_t d_ino; /* File serial number. */
char d_name[DIRENT_DNAME_LEN]; /* Name of entry. */
};
struct node;
struct directory {
struct dirent current;
struct node *node;
//struct tree_link *child_lnk;
};
typedef struct directory DIR;
extern int closedir(DIR *);
extern DIR *opendir(const char *);
extern struct dirent *readdir(DIR *);
extern int readdir_r(DIR *, struct dirent *, struct dirent **);
__END_DECLS
#endif /* DIRENT_H_ */
| /**
*
* @date 23.11.2012
* @author Alexander Kalmuk
*/
#ifndef DIRENT_H_
#define DIRENT_H_
#include <sys/types.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
#define DIRENT_DNAME_LEN 40
struct dirent {
ino_t d_ino; /* File serial number. */
char d_name[DIRENT_DNAME_LEN]; /* Name of entry. */
};
struct node;
typedef struct {
struct dirent current;
struct node *node;
//struct tree_link *child_lnk;
} DIR;
extern int closedir(DIR *);
extern DIR *opendir(const char *);
extern struct dirent *readdir(DIR *);
extern int readdir_r(DIR *, struct dirent *, struct dirent **);
__END_DECLS
#endif /* DIRENT_H_ */
| Fix multiply difination of the struct directory | extbld-porting: Fix multiply difination of the struct directory | C | bsd-2-clause | gzoom13/embox,Kefir0192/embox,Kakadu/embox,abusalimov/embox,mike2390/embox,embox/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,Kakadu/embox,vrxfile/embox-trik,mike2390/embox,Kakadu/embox,embox/embox,mike2390/embox,Kefir0192/embox,mike2390/embox,Kakadu/embox,vrxfile/embox-trik,embox/embox,abusalimov/embox,Kefir0192/embox,abusalimov/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,Kefir0192/embox,mike2390/embox,vrxfile/embox-trik,vrxfile/embox-trik,gzoom13/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,embox/embox,vrxfile/embox-trik,Kefir0192/embox,Kefir0192/embox,gzoom13/embox,mike2390/embox,mike2390/embox,gzoom13/embox,gzoom13/embox,Kakadu/embox,vrxfile/embox-trik,embox/embox,embox/embox |
9d1a3a942f093baf3d33c3fef7505db86bcf9fac | bindings/python/plmodule.h | bindings/python/plmodule.h | #include <Python.h>
#include <arrayobject.h>
#include "plplot/plplot.h"
#include "plplot/plplotP.h"
#if defined(PL_DOUBLE) || defined(DOUBLE)
#define PL_ARGS(a, b) (a)
#define PyArray_PLFLT PyArray_DOUBLE
#else
#define PL_ARGS(a, b) (b)
#define PyArray_PLFLT PyArray_FLOAT
#endif
#define TRY(E) if(! (E)) return NULL
int pl_PyArray_AsFloatArray (PyObject **, PLFLT **, PLINT *);
int pl_PyArray_AsIntArray (PyObject **, PLINT **, PLINT *);
int pl_PyArray_AsFloatMatrix (PyObject **, PLINT*, PLINT*, PLFLT ***);
int pl_PyList_AsStringArray (PyObject *, char ***, int *);
int pl_PyList_SetFromStringArray (PyObject *, char **, int);
PLFLT pyf2eval2( PLINT ix, PLINT iy, PLPointer plf2eval_data );
| #include <Python.h>
/* Change this to the recommended
#include <Numeric/arrayobject.h>
once we no longer support python1.5 */
#include <arrayobject.h>
#include "plplot/plplot.h"
#include "plplot/plplotP.h"
#if defined(PL_DOUBLE) || defined(DOUBLE)
#define PL_ARGS(a, b) (a)
#define PyArray_PLFLT PyArray_DOUBLE
#else
#define PL_ARGS(a, b) (b)
#define PyArray_PLFLT PyArray_FLOAT
#endif
#define TRY(E) if(! (E)) return NULL
int pl_PyArray_AsFloatArray (PyObject **, PLFLT **, PLINT *);
int pl_PyArray_AsIntArray (PyObject **, PLINT **, PLINT *);
int pl_PyArray_AsFloatMatrix (PyObject **, PLINT*, PLINT*, PLFLT ***);
int pl_PyList_AsStringArray (PyObject *, char ***, int *);
int pl_PyList_SetFromStringArray (PyObject *, char **, int);
PLFLT pyf2eval2( PLINT ix, PLINT iy, PLPointer plf2eval_data );
| Comment the current arrayobject.h situation. Right now for Numpy packages that are consistent with python-1.5, this file could be a number of places relative to /usr/include/python$version so configure must look specifically for it. However, later Numpy packages consistent with python2.x always put it in a standard location of /usr/include/python$version/Numeric. Thus, the relative location of arrayobject.h to the normal python includes is consistent, and we will no longer have to look specifically for this file once we stop supporting python-1.5. | Comment the current arrayobject.h situation. Right now for Numpy packages
that are consistent with python-1.5, this file could be a number of places
relative to /usr/include/python$version so configure must look specifically
for it. However, later Numpy packages consistent with python2.x always put
it in a standard location of /usr/include/python$version/Numeric. Thus, the
relative location of arrayobject.h to the normal python includes is
consistent, and we will no longer have to look specifically for this file
once we stop supporting python-1.5.
svn path=/trunk/; revision=3687
| C | lgpl-2.1 | FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot |
a6d12c298014af99c12d1efe29eb19216ae4aef8 | src/native/test/KeilTest/Logger.c | src/native/test/KeilTest/Logger.c | #include "AceUnitLogging.h"
#ifdef ACEUNIT_LOG_RUNNER
/** @see TestLogger_t.runnerStarted */
void logRunnerStarted()
{
}
#endif
#ifdef ACEUNIT_LOG_SUITE
/** @see TestLogger_t.suiteStarted */
void logSuiteStarted()
{
}
#endif
#ifdef ACEUNIT_LOG_FIXTURE
/** @see TestLogger_t.fixtureStarted */
void logFixtureStarted(const FixtureId_t fixture)
{
}
#endif
#ifdef ACEUNIT_LOG_TESTCASE
/** @see TestLogger_t.testCaseStarted */
void logTestCaseStarted(TestCaseId_t testCase)
{
}
#endif
/** @see TestLogger_t.testCaseCailed */
void logTestCaseFailed(const AssertionError_t *error)
{
}
#ifdef ACEUNIT_LOG_TESTCASE
/** @see TestLogger_t.testCaseEnded */
void logTestCaseEnded(TestCaseId_t testCase)
{
}
#endif
#ifdef ACEUNIT_LOG_FIXTURE
void logFixtureEnded(const FixtureId_t fixture)
{
}
#endif
#ifdef ACEUNIT_LOG_SUITE
/** @see TestLogger_t.suiteEnded */
void logSuiteEnded()
{
}
#endif
#ifdef ACEUNIT_LOG_RUNNER
/** @see TestLogger_t.runnerEnded */
void logRunnerEnded()
{
}
#endif
/** This Logger. */
AceUnitNewLogger(
loggerStub, /* CHANGE THIS NAME!!! */
logRunnerStarted,
logSuiteStarted,
logFixtureStarted,
logTestCaseStarted,
logTestCaseFailed,
logTestCaseEnded,
logFixtureEnded,
logSuiteEnded,
logRunnerEnded
);
TestLogger_t *globalLogger = &loggerStub; /* XXX Hack. Remove. */
| #include "AceUnitLogging.h"
#ifdef ACEUNIT_LOG_RUNNER
/** @see TestLogger_t.runnerStarted */
void logRunnerStarted()
{
}
#endif
#ifdef ACEUNIT_LOG_RUNNER
/** @see TestLogger_t.runnerEnded */
void logRunnerEnded()
{
}
#endif
/** This Logger. */
AceUnitNewLogger(
loggerStub, /* CHANGE THIS NAME!!! */
logRunnerStarted,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
logRunnerEnded
);
TestLogger_t *globalLogger = &loggerStub; /* XXX Hack. Remove. */
| Remove some compiler warnings for C251. | Remove some compiler warnings for C251.
| C | bsd-3-clause | christianhujer/aceunit,christianhujer/aceunit,christianhujer/aceunit |
b266bef9100ffb6915c1367ca761a6cc67bf1283 | tomviz/pybind11/PybindVTKTypeCaster.h | tomviz/pybind11/PybindVTKTypeCaster.h | #ifndef pybind_extension_vtk_source_VTKTypeCaster_h
#define pybind_extension_vtk_source_VTKTypeCaster_h
#include <pybind11/pybind11.h>
#include <type_traits>
#include "vtkObjectBase.h"
#include "vtkPythonUtil.h"
#define PYBIND11_VTK_TYPECASTER(VTK_OBJ) \
namespace pybind11 { \
namespace detail { \
template <> \
struct type_caster<VTK_OBJ> { \
protected: \
VTK_OBJ *value; \
public: \
static PYBIND11_DESCR name() { return type_descr(_(#VTK_OBJ)); } \
static handle cast(const VTK_OBJ *src, return_value_policy policy, \
handle parent) { \
return cast(*src, policy, parent); \
} \
operator VTK_OBJ *() { return value; } \
operator VTK_OBJ &() { return *value; } \
template <typename _T> using cast_op_type = \
pybind11::detail::cast_op_type<_T>; \
bool load(handle src, bool) { \
value = dynamic_cast< VTK_OBJ *>( \
vtkPythonUtil::GetPointerFromObject(src.ptr(), #VTK_OBJ)); \
if (!value) { \
PyErr_Clear(); \
throw reference_cast_error(); \
} \
return value != nullptr; \
} \
static handle cast(const VTK_OBJ& src, return_value_policy, handle) { \
return vtkPythonUtil::GetObjectFromPointer( \
const_cast< VTK_OBJ *>(&src)); \
} \
}; \
}}
#endif
| Add VTK type caster to convert VTK wrapped classes | Add VTK type caster to convert VTK wrapped classes
This type caster from SMTK manages converting VTK wrapped class into
the appropriate VTK class on the C++ side.
| C | bsd-3-clause | OpenChemistry/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,mathturtle/tomviz,mathturtle/tomviz |
|
8aa16932e265e483217d9a5fabfb8a8c26cbed15 | src/internal/Hash.h | src/internal/Hash.h | #ifndef ARBITER_HASH_H
#define ARBITER_HASH_H
#ifndef __cplusplus
#error "This file must be compiled as C++."
#endif
#include <functional>
#include <type_traits>
namespace Arbiter {
template<typename T>
size_t hashOf (const T &value)
{
return std::hash<T>()(value);
}
}
#endif
| Add convenience function for hashing arbitrary types | Add convenience function for hashing arbitrary types
| C | mit | jspahrsummers/Arbiter,jspahrsummers/Arbiter,ArbiterLib/Arbiter,jspahrsummers/Arbiter,ArbiterLib/Arbiter,jspahrsummers/Arbiter,ArbiterLib/Arbiter,ArbiterLib/Arbiter |
|
60f560824bf9fb6ec9148f5b36eae83827b5de42 | test2/code_gen/dead_code_elim.c | test2/code_gen/dead_code_elim.c | // RUN: %ocheck 3 %s
g()
{
return 3;
}
main()
{
if(0){
f(); // shouldn't hit a linker error here - dead code
a:
return g();
}
goto a;
}
| // RUN: %ocheck 3 %s -g
// test debug emission too
g()
{
return 3;
}
main()
{
if(0){
int i;
f(); // shouldn't hit a linker error here - dead code
a:
i = 2;
return g(i);
}
goto a;
}
| Test debug label emission with local variables | Test debug label emission with local variables
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
1c4ea5e3d584a3344182d41e286ecbb9967d841a | src/includes/TritonTypes.h | src/includes/TritonTypes.h | /*
** Copyright (C) - Triton
**
** This program is under the terms of the LGPLv3 License.
*/
#ifndef TRITONTYPES_H
#define TRITONTYPES_H
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/numeric/conversion/cast.hpp>
#define BIT_MAX 512
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
typedef boost::multiprecision::uint128_t uint128;
typedef boost::multiprecision::uint512_t uint512;
typedef signed char sint8;
typedef signed short sint16;
typedef signed int sint32;
typedef signed long long sint64;
typedef boost::multiprecision::int128_t sint128;
typedef boost::multiprecision::int512_t sint512;
#endif /* !TRITONTYPES_H */
| /*
** Copyright (C) - Triton
**
** This program is under the terms of the LGPLv3 License.
*/
#ifndef TRITONTYPES_H
#define TRITONTYPES_H
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/numeric/conversion/cast.hpp>
#define BIT_MAX 512
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef boost::multiprecision::uint64 _t uint64;
typedef boost::multiprecision::uint128_t uint128;
typedef boost::multiprecision::uint256_t uint256;
typedef boost::multiprecision::uint512_t uint512;
typedef signed char sint8;
typedef signed short sint16;
typedef signed int sint32;
typedef boost::multiprecision::int64 _t sint64;
typedef boost::multiprecision::int128_t sint128;
typedef boost::multiprecision::int256_t sint256;
typedef boost::multiprecision::int512_t sint512;
#endif /* !TRITONTYPES_H */
| Use boost multiprecision even for 64b | Use boost multiprecision even for 64b
| C | apache-2.0 | JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton,JonathanSalwan/Triton |
1b9e6ae6667c81d2687ff665925fa953b93135ae | pintool/boost_interprocess.h | pintool/boost_interprocess.h | /* Headers needed for multiprocess communication through boost interprocess.
* This needs to be included BEFORE anything referencing machine.h,
* or macro definitions from machine.h would mess template args.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnarrowing"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#include <boost/interprocess/containers/deque.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <boost/interprocess/containers/map.hpp>
#include <boost/interprocess/containers/vector.hpp>
#include <boost/unordered_map.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/interprocess_fwd.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>
#pragma GCC diagnostic pop
#include "shared_map.h"
#include "shared_unordered_map.h"
| /* Headers needed for multiprocess communication through boost interprocess.
* This needs to be included BEFORE anything referencing machine.h,
* or macro definitions from machine.h would mess template args.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnarrowing"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include <boost/interprocess/containers/deque.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <boost/interprocess/containers/map.hpp>
#include <boost/interprocess/containers/vector.hpp>
#include <boost/unordered_map.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/interprocess_fwd.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>
#pragma GCC diagnostic pop
#include "shared_map.h"
#include "shared_unordered_map.h"
| Add ignore warning pragma for deprecated declarations. | Add ignore warning pragma for deprecated declarations.
| C | bsd-3-clause | s-kanev/XIOSim,s-kanev/XIOSim,s-kanev/XIOSim,s-kanev/XIOSim |
011cf09ddd3cf759de55ff1f95ef37a3f04c70c9 | test/CFrontend/bit-accurate-int.c | test/CFrontend/bit-accurate-int.c | // RUN: %llvmgcc -S %s -o - /dev/null
// XFAIL: *
#define ATTR_BITS(N) __attribute__((bitwidth(N)))
typedef int ATTR_BITS( 4) My04BitInt;
typedef int ATTR_BITS(16) My16BitInt;
typedef int ATTR_BITS(17) My17BitInt;
typedef int ATTR_BITS(37) My37BitInt;
typedef int ATTR_BITS(65) My65BitInt;
struct MyStruct {
My04BitInt i4Field;
short ATTR_BITS(12) i12Field;
long ATTR_BITS(17) i17Field;
My37BitInt i37Field;
};
My37BitInt doit( short ATTR_BITS(23) num) {
My17BitInt i;
struct MyStruct strct;
int bitsize1 = sizeof(My17BitInt);
int __attribute__((bitwidth(9))) j;
int bitsize2 = sizeof(j);
int result = bitsize1 + bitsize2;
strct.i17Field = result;
result += sizeof(struct MyStruct);
return result;
}
int
main ( int argc, char** argv)
{
return (int ATTR_BITS(32)) doit((short ATTR_BITS(23))argc);
}
| // RUN: %llvmgcc -S %s -o - /dev/null 2>&1 > /dev/null | \
// RUN: not grep warning
// XFAIL: *
#define ATTR_BITS(N) __attribute__((bitwidth(N)))
typedef int ATTR_BITS( 4) My04BitInt;
typedef int ATTR_BITS(16) My16BitInt;
typedef int ATTR_BITS(17) My17BitInt;
typedef int ATTR_BITS(37) My37BitInt;
typedef int ATTR_BITS(65) My65BitInt;
struct MyStruct {
My04BitInt i4Field;
short ATTR_BITS(12) i12Field;
long ATTR_BITS(17) i17Field;
My37BitInt i37Field;
};
My37BitInt doit( short ATTR_BITS(23) num) {
My17BitInt i;
struct MyStruct strct;
int bitsize1 = sizeof(My17BitInt);
int __attribute__((bitwidth(9))) j;
int bitsize2 = sizeof(j);
int result = bitsize1 + bitsize2;
strct.i17Field = result;
result += sizeof(struct MyStruct);
return result;
}
int
main ( int argc, char** argv)
{
return (int ATTR_BITS(32)) doit((short ATTR_BITS(23))argc);
}
| Make this test actually test what its supposed to test. | Make this test actually test what its supposed to test.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@33369 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm |
465819d7c20d1f80d71e9b219dcd02e812bc7540 | include/core/SkMilestone.h | include/core/SkMilestone.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 92
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 93
#endif
| Update Skia milestone to 93 | Update Skia milestone to 93
Change-Id: Ib9a9832dbd63b6a306f5c955f4528b195c29c71f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411278
Reviewed-by: Eric Boren <[email protected]>
| C | bsd-3-clause | aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia |
530e6a93a7a953a460502a28a6733d889a245da0 | src/physics/state.h | src/physics/state.h | #ifndef ZOMBIE_STATE_H
#define ZOMBIE_STATE_H
#include "box2ddef.h"
namespace zombie {
struct State {
Position position_{0, 0};
Velocity velocity_{0, 0};
float angle_{0.f};
float anglularVelocity_{0.f};
};
}
#endif
| #ifndef ZOMBIE_STATE_H
#define ZOMBIE_STATE_H
#include "box2ddef.h"
namespace zombie {
struct State {
Position position_;
Velocity velocity_;
float angle_;
float anglularVelocity_;
};
}
#endif
| Make State struct a clean POD strcut | Make State struct a clean POD strcut
| C | mit | mwthinker/Zombie |
41a44d0765463bce34808c201e39ad2595f400b9 | Source/Version.h | Source/Version.h | #ifndef Version_h
#define Version_h
#define BFARCHIVE_COMMA_SEPARATED_VERSION 3,0,0,0
#define BFARCHIVE_VERSION_STRING "3.0.0"
#endif
| #ifndef Version_h
#define Version_h
#define BFARCHIVE_COMMA_SEPARATED_VERSION 9,1,0,0
#define BFARCHIVE_VERSION_STRING "9.1.0"
#endif
| Bump version to 9.1.0 to avoid confusion | Bump version to 9.1.0 to avoid confusion
| C | apache-2.0 | bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive |
1416862d7c9382a58813f0609c4d4d1c858724c8 | include/llvm/ExecutionEngine/GenericValue.h | include/llvm/ExecutionEngine/GenericValue.h | //===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The GenericValue class is used to represent an LLVM value of arbitrary type.
//
//===----------------------------------------------------------------------===//
#ifndef GENERIC_VALUE_H
#define GENERIC_VALUE_H
#include "llvm/Support/DataTypes.h"
namespace llvm {
typedef uintptr_t PointerTy;
union GenericValue {
bool Int1Val;
unsigned char Int8Val;
unsigned short Int16Val;
unsigned int Int32Val;
uint64_t Int64Val;
double DoubleVal;
float FloatVal;
struct { unsigned int first; unsigned int second; } UIntPairVal;
PointerTy PointerVal;
unsigned char Untyped[8];
GenericValue() {}
GenericValue(void *V) {
PointerVal = (PointerTy)(intptr_t)V;
}
};
inline GenericValue PTOGV(void *P) { return GenericValue(P); }
inline void* GVTOP(const GenericValue &GV) {
return (void*)(intptr_t)GV.PointerVal;
}
} // End llvm namespace
#endif
| //===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The GenericValue class is used to represent an LLVM value of arbitrary type.
//
//===----------------------------------------------------------------------===//
#ifndef GENERIC_VALUE_H
#define GENERIC_VALUE_H
#include "llvm/Support/DataTypes.h"
namespace llvm {
typedef uintptr_t PointerTy;
class APInt;
class Type;
union GenericValue {
bool Int1Val;
unsigned char Int8Val;
unsigned short Int16Val;
unsigned int Int32Val;
uint64_t Int64Val;
APInt *APIntVal;
double DoubleVal;
float FloatVal;
struct { unsigned int first; unsigned int second; } UIntPairVal;
PointerTy PointerVal;
unsigned char Untyped[8];
GenericValue() {}
GenericValue(void *V) {
PointerVal = (PointerTy)(intptr_t)V;
}
};
inline GenericValue PTOGV(void *P) { return GenericValue(P); }
inline void* GVTOP(const GenericValue &GV) {
return (void*)(intptr_t)GV.PointerVal;
}
} // End llvm namespace
#endif
| Add APIntVal as a possible GenericeValue. | Add APIntVal as a possible GenericeValue.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@34879 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap |
dc2eb3a8e3c7535fea57932e8c6c35771b8724aa | strings/gemstones.c | strings/gemstones.c | /*
Problem Statement
John has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lower-case Latin letter from 'a' to 'z'. An element can be present multiple times in a rock. An element is called a gem-element if it occurs at least once in each of the rocks.
Given the list of N rocks with their compositions, display the number of gem-elements that exist in those rocks.
Input Format
The first line consists of an integer, N, the number of rocks.
Each of the next N lines contains a rock's composition. Each composition consists of lower-case letters of English alphabet.
Constraints
1≤N≤100
Each composition consists of only lower-case Latin letters ('a'-'z').
1≤ length of each composition ≤100
Output Format
Print the number of gem-elements that are common in these rocks. If there are none, print 0.
Sample Input
3
abcdde
baccd
eeabg
Sample Output
2
Explanation
Only "a" and "b" are the two kinds of gem-elements, since these are the only characters that occur in every rock's composition.
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int n;
scanf("%d",&n);
char rock [n][101];
int i,j;
for(i=0; i<n; i++){
scanf("%s",rock[i]);
}
int array[26];
for(j=0 ; j<26; j++){
array[j]=0;
}
char char_int = 97;
char* result = NULL;
for (j = 0 ; j<26 ; j++){
for(i =0 ; i<n ; i++){
result = strchr(rock[i],char_int);
if(result != NULL){
array[j]++;
}
}
char_int ++;
}
int count =0;
for(j=0 ; j<26; j++){
if (array[j]== n){
count++;
}
}
printf("%d",count);
return 0;
}
| Add Gemstone which makes use of alphabet array and strchr | Add Gemstone which makes use of alphabet array and strchr
| C | mit | anaghajoshi/HackerRank |
|
d48276b0554488cfc3ff58646dae7e5d71f6c32d | bst.h | bst.h | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
#endif | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Tree_Minimum(BSTNode* n);
BSTNode* BST_Tree_Maximum(BSTNode* n);
#endif | Add BST Tree Min/Max function declaration | Add BST Tree Min/Max function declaration
| C | mit | MaxLikelihood/CADT |
7e0e8ab88d3607daf5fc06c13f9d85c95b82eeb2 | src/script_handle.h | src/script_handle.h | #pragma once
#include <v8.h>
#include "isolate/holder.h"
#include "transferable_handle.h"
#include <memory>
namespace ivm {
class ScriptHandle : public TransferableHandle {
private:
class ScriptHandleTransferable : public Transferable {
private:
std::shared_ptr<IsolateHolder> isolate;
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script;
public:
ScriptHandleTransferable(
std::shared_ptr<IsolateHolder> isolate,
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script
);
v8::Local<v8::Value> TransferIn() final;
};
std::shared_ptr<IsolateHolder> isolate;
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script;
public:
ScriptHandle(
std::shared_ptr<IsolateHolder> isolate,
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script
);
static IsolateEnvironment::IsolateSpecific<v8::FunctionTemplate>& TemplateSpecific();
static v8::Local<v8::FunctionTemplate> Definition();
std::unique_ptr<Transferable> TransferOut() final;
template <bool async>
v8::Local<v8::Value> Run(class ContextHandle* context_handle, v8::MaybeLocal<v8::Object> maybe_options);
};
} // namespace ivm
| #pragma once
#include <v8.h>
#include "isolate/holder.h"
#include "transferable_handle.h"
#include <memory>
namespace ivm {
class ContextHandle;
class ScriptHandle : public TransferableHandle {
private:
class ScriptHandleTransferable : public Transferable {
private:
std::shared_ptr<IsolateHolder> isolate;
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script;
public:
ScriptHandleTransferable(
std::shared_ptr<IsolateHolder> isolate,
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script
);
v8::Local<v8::Value> TransferIn() final;
};
std::shared_ptr<IsolateHolder> isolate;
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script;
public:
ScriptHandle(
std::shared_ptr<IsolateHolder> isolate,
std::shared_ptr<v8::Persistent<v8::UnboundScript>> script
);
static IsolateEnvironment::IsolateSpecific<v8::FunctionTemplate>& TemplateSpecific();
static v8::Local<v8::FunctionTemplate> Definition();
std::unique_ptr<Transferable> TransferOut() final;
template <bool async>
v8::Local<v8::Value> Run(ContextHandle* context_handle, v8::MaybeLocal<v8::Object> maybe_options);
};
} // namespace ivm
| Fix stupid msvc compile error | Fix stupid msvc compile error
It thinks the forward declaration defines a template. Clang and GCC do
not agree.
| C | isc | laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm |
c8a20cabb71b249072a001ccf9c1c306640a511a | include/llvm/MC/MCParser/MCAsmParserUtils.h | include/llvm/MC/MCParser/MCAsmParserUtils.h | //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
#define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
namespace llvm {
namespace MCParserUtils {
/// Parse a value expression and return whether it can be assigned to a symbol
/// with the given name.
///
/// On success, returns false and sets the Symbol and Value output parameters.
bool parseAssignmentExpression(StringRef Name, bool allow_redef,
MCAsmParser &Parser, MCSymbol *&Symbol,
const MCExpr *&Value);
} // namespace MCParserUtils
} // namespace llvm
#endif
| //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
#define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
namespace llvm {
class MCAsmParser;
class MCExpr;
class MCSymbol;
class StringRef;
namespace MCParserUtils {
/// Parse a value expression and return whether it can be assigned to a symbol
/// with the given name.
///
/// On success, returns false and sets the Symbol and Value output parameters.
bool parseAssignmentExpression(StringRef Name, bool allow_redef,
MCAsmParser &Parser, MCSymbol *&Symbol,
const MCExpr *&Value);
} // namespace MCParserUtils
} // namespace llvm
#endif
| Make header parse standalone. NFC. | Make header parse standalone. NFC.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@240814 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm |
e1ee5b52f528babb241950d4ec57927933a46a6c | tests/compiler/longlong.c | tests/compiler/longlong.c | #include <stdio.h>
typedef unsigned int fixed_t;
fixed_t multiplyFixed(fixed_t a, fixed_t b)
{
return ((long long) a * (long long) b) >> 16;
}
int main(int argc, const char *argv[])
{
printf("%08x\n", multiplyFixed(0xffffe350, 0x009fe0c6)); // CHECK: e0b4157f
}
| Add 64 bit multiplication test | Add 64 bit multiplication test
| C | apache-2.0 | hoangt/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,FulcronZ/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,FulcronZ/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor |
|
f8e41d53d4a604cb4a398a4002b2f2037f23c135 | include/core/SkMilestone.h | include/core/SkMilestone.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 55
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 57
#endif
| Update Skia milestone to 57 | Update Skia milestone to 57
Milestone that we typically update, but note that change from 55->56 was missed, will cherry pick to branch.
This change gets current file caught up to show working milestone after branch.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4927
Change-Id: If10e0db2d4acc908f5da7c4e9d30497deef6a2ff
Reviewed-on: https://skia-review.googlesource.com/4927
Reviewed-by: Brian Salomon <[email protected]>
Reviewed-by: Heather Miller <[email protected]>
Commit-Queue: Heather Miller <[email protected]>
| C | bsd-3-clause | HalCanary/skia-hc,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,rubenvb/skia,google/skia,google/skia,rubenvb/skia,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia |
21af464aecd8de83858acad3e2a48ad5c968fcf5 | src/background/direction.c | src/background/direction.c | #include "direction.h"
#include <assert.h>
#include <base/base.h>
enum direction
direction_90_degrees_left(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 270) % 360;
}
enum direction
direction_90_degrees_right(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 90) % 360;
}
extern inline bool
direction_is_valid(unsigned direction);
char const *
direction_name(enum direction direction)
{
assert(direction_is_valid(direction));
switch (direction) {
case direction_north: return "north";
case direction_northeast: return "northeast";
case direction_east: return "east";
case direction_southeast: return "southeast";
case direction_south: return "south";
case direction_southwest: return "southwest";
case direction_west: return "west";
case direction_northwest: return "northwest";
}
}
enum direction
direction_opposite(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 180) % 360;
}
enum direction
direction_random(struct rnd *rnd)
{
return rnd_next_uniform_value(rnd, 8) * 45;
}
| #include "direction.h"
#include <assert.h>
#include <base/base.h>
enum direction
direction_90_degrees_left(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 270) % 360;
}
enum direction
direction_90_degrees_right(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 90) % 360;
}
extern inline bool
direction_is_valid(unsigned direction);
char const *
direction_name(enum direction direction)
{
assert(direction_is_valid(direction));
switch (direction) {
case direction_north: return "north";
case direction_northeast: return "northeast";
case direction_east: return "east";
case direction_southeast: return "southeast";
case direction_south: return "south";
case direction_southwest: return "southwest";
case direction_west: return "west";
case direction_northwest: return "northwest";
}
return "north";
}
enum direction
direction_opposite(enum direction direction)
{
assert(direction_is_valid(direction));
return (direction + 180) % 360;
}
enum direction
direction_random(struct rnd *rnd)
{
return rnd_next_uniform_value(rnd, 8) * 45;
}
| Fix "control reaches end of non-void function" warning. | Fix "control reaches end of non-void function" warning.
On the Debian / GCC build with `-Wall` set, the `direction_name()`
function causes this warning. Add a catch-all return value after the
exhaustive `switch`.
| C | bsd-2-clause | donmccaughey/FiendsAndFortune,donmccaughey/FiendsAndFortune,donmccaughey/FiendsAndFortune |
bc552606f319023f360417c596f5b6da4c91fdd2 | sigaltstack.c | sigaltstack.c | #define _XOPEN_SOURCE 700
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
printf("stack overflow %d\n", i);
longjmp(try, ++i);
assert(0);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int main() {
char* stack;
stack = malloc(sizeof(stack) * SIGSTKSZ);
stack_t ss = {
.ss_size = SIGSTKSZ,
.ss_sp = stack,
};
struct sigaction sa = {
.sa_handler = handler,
.sa_flags = SA_ONSTACK
};
sigaltstack(&ss, 0);
sigfillset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, 0);
if (setjmp(try) < 3) {
recurse(0);
} else {
printf("caught exception!\n");
}
return 0;
}
| #define _XOPEN_SOURCE 700
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
printf("stack overflow %d\n", i);
longjmp(try, ++i);
assert(0);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int main() {
char* stack;
stack = malloc(sizeof(stack) * SIGSTKSZ);
stack_t ss = {
.ss_size = SIGSTKSZ,
.ss_sp = stack,
};
struct sigaction sa = {
.sa_handler = handler,
.sa_flags = SA_ONSTACK
};
sigaltstack(&ss, 0);
sigfillset(&sa.sa_mask);
sigaction(SIGALRM, &sa, 0);
raise(SIGALRM);
return 0;
if (setjmp(try) < 3) {
recurse(0);
} else {
printf("caught exception!\n");
}
return 0;
}
| Switch to SIGLARM, to allow seamless gdb usage | Switch to SIGLARM, to allow seamless gdb usage
| C | apache-2.0 | danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets |
29b6f3869ed2b4ee706b604dbd563a302d4bbba9 | test/Index/c-index-crasher-rdar_7487294.c | test/Index/c-index-crasher-rdar_7487294.c | // RUN: c-index-test -test-load-source local %s 2>&1 | FileCheck %s
// This is invalid source. Previously a double-free caused this
// example to crash c-index-test.
int foo(int x) {
int y[x * 3];
help
};
// CHECK: 8:3: error: use of undeclared identifier 'help'
// CHECK: help
// CHECK: 12:102: error: expected '}'
| // RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s
// IMPORTANT: This test case intentionally DOES NOT use --disable-free. It
// tests that we are properly reclaiming the ASTs and we do not have a double free.
// Previously we tried to free the size expression of the VLA twice.
int foo(int x) {
int y[x * 3];
help
};
// CHECK: 9:3: error: use of undeclared identifier 'help'
// CHECK: help
// CHECK: 14:102: error: expected '}'
| Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future). | Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@92043 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
774ae7b87f85601780a9361d3ab39e37600adf5b | 3RVX/Controllers/Volume/VolumeController.h | 3RVX/Controllers/Volume/VolumeController.h | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
class VolumeTransformation;
class VolumeController {
public:
struct DeviceInfo {
std::wstring name;
std::wstring id;
};
/// <summary>
/// Retrieves the current volume level as a float, ranging from 0.0 - 1.0
/// </summary>
virtual float Volume() = 0;
/// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary>
virtual void Volume(float vol) = 0;
virtual bool Muted() = 0;
virtual void Muted(bool mute) = 0;
virtual void ToggleMute() {
(Muted() == true) ? Muted(false) : Muted(true);
}
virtual void Transformation(VolumeTransformation *transform) = 0;
virtual VolumeTransformation* Transformation() = 0;
public:
static const int MSG_VOL_CHNG = WM_APP + 1080;
static const int MSG_VOL_DEVCHNG = WM_APP + 1081;
}; | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
class VolumeTransformation;
class VolumeController {
public:
struct DeviceInfo {
std::wstring name;
std::wstring id;
};
/// <summary>
/// Retrieves the current volume level as a float, ranging from 0.0 - 1.0
/// </summary>
virtual float Volume() = 0;
/// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary>
virtual void Volume(float vol) = 0;
virtual bool Muted() = 0;
virtual void Muted(bool mute) = 0;
virtual void ToggleMute() {
(Muted() == true) ? Muted(false) : Muted(true);
}
virtual void AddTransformation(VolumeTransformation *transform) = 0;
virtual void RemoveTransformation(VolumeTransformation *transform) = 0;
public:
static const int MSG_VOL_CHNG = WM_APP + 1080;
static const int MSG_VOL_DEVCHNG = WM_APP + 1081;
}; | Change transform interface to add/remove | Change transform interface to add/remove
This allows support for multiple transformations
| C | bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX |
00fc16bc4f99131e154c2e6ddb02a0c10c5369f2 | src/testall.c | src/testall.c | /*
The MIT License (MIT)
Copyright (c) 2015 Alexander Zazhigin [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "broadcasttalk.h"
#include "threadsocket.h"
#include "threadoutaudio.h"
#include "threadinaudio.h"
#include "maindata.h"
#include "udpsocket.h"
#ifdef __ANDROID__
#else
/* Main application */
void main(void * arg){
LOGI("Enter: main\n");
LOGI("Exit: main\n");
}
#endif
| Add test file for testing func | Add test file for testing func
| C | mit | keich/Chataka,keich/Chataka |
|
73606739ba6dba3ae32debf6823ea05483429e53 | src/libc4/include/router.h | src/libc4/include/router.h | #ifndef ROUTER_H
#define ROUTER_H
#include <apr_queue.h>
#include "operator/operator.h"
#include "planner/planner.h"
#include "types/tuple.h"
typedef struct C4Router C4Router;
C4Router *router_make(C4Runtime *c4, apr_queue_t *queue);
void router_main_loop(C4Router *router);
apr_queue_t *router_get_queue(C4Router *router);
void router_enqueue_program(apr_queue_t *queue, const char *src);
void router_enqueue_tuple(apr_queue_t *queue, Tuple *tuple,
TableDef *tbl_def);
char *router_enqueue_dump_table(apr_queue_t *queue, const char *table,
apr_pool_t *pool);
/* Internal APIs: XXX: clearer naming */
void router_install_tuple(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
void router_enqueue_internal(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
void router_enqueue_net(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
OpChainList *router_get_opchain_list(C4Router *router, const char *tbl_name);
void router_add_op_chain(C4Router *router, OpChain *op_chain);
#endif /* ROUTER_H */
| #ifndef ROUTER_H
#define ROUTER_H
#include <apr_queue.h>
#include "operator/operator.h"
#include "planner/planner.h"
#include "types/tuple.h"
typedef struct C4Router C4Router;
C4Router *router_make(C4Runtime *c4, apr_queue_t *queue);
void router_main_loop(C4Router *router);
apr_queue_t *router_get_queue(C4Router *router);
void router_enqueue_program(apr_queue_t *queue, const char *src);
void router_enqueue_tuple(apr_queue_t *queue, Tuple *tuple,
TableDef *tbl_def);
char *router_enqueue_dump_table(apr_queue_t *queue, const char *tbl_name,
apr_pool_t *pool);
/* Internal APIs: XXX: clearer naming */
void router_install_tuple(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
void router_enqueue_internal(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
void router_enqueue_net(C4Router *router, Tuple *tuple,
TableDef *tbl_def);
OpChainList *router_get_opchain_list(C4Router *router, const char *tbl_name);
void router_add_op_chain(C4Router *router, OpChain *op_chain);
#endif /* ROUTER_H */
| Tweak a function prototype in header. | Tweak a function prototype in header.
| C | mit | bloom-lang/c4,bloom-lang/c4,bloom-lang/c4 |
0c2596f9c2142d8ba52065132a2b59745cf41fb2 | inc/Signals.h | inc/Signals.h | #include "interface.h"
#include "ecg.h"
#include "AFE4400.h"
SPI_Interface afe4400_spi(spi_c2);
ECG ecg = ECG(1,1,4,9,PB0,4096,RA8875_BLUE,RA8875_BLACK,1000,tim3,&tft);
PulseOx spo2 = PulseOx(6,1,3,3,&afe4400_spi,PC8,PA9,PA8,PB7,&tft);
void enableSignalAcquisition(void) {
spo2.enable();
ecg.enable();
}
void connectSignalsToScreen(Screen& s) {
s.add(ecg.signalTrace);
s.add((ScreenElement*) &spo2);
}
| #include "interface.h"
#include "ecg.h"
#include "AFE4400.h"
SPI_Interface afe4400_spi(spi_c2);
ECG ecg = ECG(1,1,4,9,PB0,4096,RA8875_BLUE,RA8875_BLACK,1000,tim3,&tft);
PulseOx spo2 = PulseOx(5,1,4,9,&afe4400_spi,PC8,PA9,PA8,PB7,&tft);
void enableSignalAcquisition(void) {
spo2.enable();
ecg.enable();
}
void connectSignalsToScreen(Screen& s) {
s.add(ecg.signalTrace);
s.add((ScreenElement*) &spo2);
}
| Adjust display position for pulse ox | Adjust display position for pulse ox
| C | mit | ReeceStevens/freepulse,ReeceStevens/freepulse,ReeceStevens/freepulse |
fd48ecfb7227ce106630993137052d41de585c65 | common_video/interface/texture_video_frame.h | common_video/interface/texture_video_frame.h | /*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H
#define COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H
#include "webrtc/common_video/interface/i420_video_frame.h"
// TODO(magjed): Remove this when all external dependencies are updated.
namespace webrtc {
typedef I420VideoFrame TextureVideoFrame;
} // namespace webrtc
#endif // COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H
| Add intermediate TextureVideoFrame typedef for Chromium | Add intermediate TextureVideoFrame typedef for Chromium
BUG=1128
[email protected]
TBR=stefan
Review URL: https://webrtc-codereview.appspot.com/42239004
Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#8630}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: f98030b029edad449a75309546d7bf4803dfa750
| C | bsd-3-clause | sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc |
|
4377b21c870e9b41ca10b4798f5252d2accd571a | libPhoneNumber-iOS/libPhoneNumberiOS.h | libPhoneNumber-iOS/libPhoneNumberiOS.h | //
// libPhoneNumber-iOS.h
// libPhoneNumber-iOS
//
// Created by Roy Marmelstein on 04/08/2015.
// Copyright (c) 2015 ohtalk.me. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for libPhoneNumber-iOS.
FOUNDATION_EXPORT double libPhoneNumber_iOSVersionNumber;
//! Project version string for libPhoneNumber-iOS.
FOUNDATION_EXPORT const unsigned char libPhoneNumber_iOSVersionString[];
// In this header, you should import all the public headers of your framework
// using statements like #import <libPhoneNumber_iOS/PublicHeader.h>
#import "NBPhoneNumberDefines.h"
// Features
#import "NBAsYouTypeFormatter.h"
#import "NBPhoneNumberUtil.h"
// Metadata
#import "NBMetadataHelper.h"
// Model
#import "NBNumberFormat.h"
#import "NBPhoneMetaData.h"
#import "NBPhoneNumber.h"
#import "NBPhoneNumberDesc.h"
| //
// libPhoneNumber-iOS.h
// libPhoneNumber-iOS
//
// Created by Roy Marmelstein on 04/08/2015.
// Copyright (c) 2015 ohtalk.me. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for libPhoneNumber-iOS.
FOUNDATION_EXPORT double libPhoneNumber_iOSVersionNumber;
//! Project version string for libPhoneNumber-iOS.
FOUNDATION_EXPORT const unsigned char libPhoneNumber_iOSVersionString[];
// In this header, you should import all the public headers of your framework
// using statements like #import <libPhoneNumber_iOS/PublicHeader.h>
#import "NBPhoneNumberDefines.h"
// Features
#import "NBAsYouTypeFormatter.h"
#import "NBPhoneNumberUtil.h"
// Metadata
#import "NBMetadataHelper.h"
#import "NBGeocoderMetadataHelper.h"
// Model
#import "NBNumberFormat.h"
#import "NBPhoneMetaData.h"
#import "NBPhoneNumber.h"
#import "NBPhoneNumberDesc.h"
| Fix 'umbrella header for module does not include...' error | Fix 'umbrella header for module does not include...' error
| C | apache-2.0 | iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS |
c853d88052c6a360978037c941976330f42aa3aa | tests/example.c | tests/example.c | #include <stdio.h>
int simpleloop (int x, int y) {
while (x < y) {
if (x < 3)
x++;
else
x+=2;
}
return x;
}
int main () {
printf("%i", simpleloop(0, 10), stdout);
}
| int simpleloop (int x, int y) {
while (x < y) {
if (x < 3)
x++;
else
x+=2;
}
return x;
}
| Add Pagai's invariants extraction, fix various typos. | Add Pagai's invariants extraction, fix various typos.
| C | lgpl-2.1 | termite-analyser/llvm2smt |
8e943ab7b33d2e0fb8688dd53ad4886fd94d1242 | Snapper/Source/Shared/SNPBlockUserOperation.h | Snapper/Source/Shared/SNPBlockUserOperation.h | //
// SNPBlockUserOperation.h
// Snapper
//
// Created by Paul Schifferer on 5/12/13.
// Copyright (c) 2013 Pilgrimage Software. All rights reserved.
//
#import <Snapper/Snapper.h>
#import "SNPUserParameters.h"
@interface SNPBlockUserOperation : SNPBaseUserTokenOperation
<SNPUserParameters>
// -- Properties --
@property (nonatomic, assign) NSUInteger userId;
// -- Initialization --
- (id)initWithUserId:(NSUInteger)userId
accountId:(NSString*)accountId
finishBlock:(void (^)(SNPResponse* response))finishBlock;
@end
| //
// SNPBlockUserOperation.h
// Snapper
//
// Created by Paul Schifferer on 5/12/13.
// Copyright (c) 2013 Pilgrimage Software. All rights reserved.
//
#import "SNPBaseUserTokenOperation.h"
#import "SNPUserParameters.h"
@interface SNPBlockUserOperation : SNPBaseUserTokenOperation
<SNPUserParameters>
// -- Properties --
@property (nonatomic, assign) NSUInteger userId;
// -- Initialization --
- (id)initWithUserId:(NSUInteger)userId
accountId:(NSString*)accountId
finishBlock:(void (^)(SNPResponse* response))finishBlock;
@end
| Use the right import type. | Use the right import type.
| C | mit | exsortis/Snapper |
3891f287447bc15e84f40f2779ecb7ca0861b83b | Classes/iOS/MTStackableNavigationController.h | Classes/iOS/MTStackableNavigationController.h | //
// MTStackableNavigationController.h
//
// Created by Mat Trudel on 2013-02-05.
// Copyright (c) 2013 Mat Trudel. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UIViewController+MTStackableNavigationController.h"
@interface MTStackableNavigationController : UIViewController <UINavigationBarDelegate>
@property(nonatomic, readonly) NSArray *viewControllers;
- (id)initWithRootViewController:(UIViewController *)rootViewController;
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (UIViewController *)popViewControllerAnimated:(BOOL)animated;
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;
@property(nonatomic,readonly,retain) UIViewController *topViewController; // The top view controller on the stack.
@end
| //
// MTStackableNavigationController.h
//
// Created by Mat Trudel on 2013-02-05.
// Copyright (c) 2013 Mat Trudel. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UIViewController+MTStackableNavigationController.h"
#import "MTStackableNavigationItem.h"
@interface MTStackableNavigationController : UIViewController <UINavigationBarDelegate>
@property(nonatomic, readonly) NSArray *viewControllers;
- (id)initWithRootViewController:(UIViewController *)rootViewController;
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (UIViewController *)popViewControllerAnimated:(BOOL)animated;
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;
@property(nonatomic,readonly,retain) UIViewController *topViewController; // The top view controller on the stack.
@end
| Include all headers by default | Include all headers by default | C | mit | mtrudel/MTStackableNavigationController |
57f1dd4f2e4e9ea31c583eeabca9c4e3086b560d | chapter27/chapter27_ex09.c | chapter27/chapter27_ex09.c | /* Chapter 27, exercise 9: using only C facilities, including the C standard
library, read a sequence of words from stdin and write them to stdout in
lexicographical order. Use qsort() or insert the words into an ordered list
as you read them. */
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define WORD_LEN 256
#define ARR_LEN 128
void print(char* words[])
{
while (*words)
printf("%s\n",*words++);
}
char* get_word()
{
char* word = (char*)malloc(WORD_LEN);
char* word_ptr = word;
int x;
while ((x=getchar()) != EOF) {
if (x=='\n') {
*word_ptr = 0;
break;
}
*word_ptr = x;
++word_ptr;
}
return word;
}
/* wrapper fro strcmp so it can be used with qsort */
int cmpstr(const void* a, const void* b)
{
const char* aa = *(const char**)a;
const char* bb = *(const char**)b;
return strcmp(aa,bb);
}
int main()
{
char* words[ARR_LEN] = { 0 };
int ctr = 0;
char* word;
while (strcmp(word = get_word(),"quit"))
words[ctr++] = word;
printf("\nSequence of words before sorting:\n");
print(words);
qsort(words,ctr,sizeof(char*),cmpstr);
printf("\nSequence after sorting:\n");
print(words);
}
| Add Chapter 27, exercise 9 | Add Chapter 27, exercise 9
| C | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp |
|
0e759ce768538ef7c0740771c069d36833feca46 | sys/shell/commands/sc_ps.c | sys/shell/commands/sc_ps.c | /*
* Copyright (C) 2013 INRIA.
*
* 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 sys_shell_commands
* @{
*
* @file
* @brief Shell commands for the PS module
*
* @author Oliver Hahm <[email protected]>
*
* @}
*/
#include "ps.h"
int _ps_handler(int argc, char **argv)
{
(void) argc;
(void) argv;
ps();
return 0;
}
| /*
* Copyright (C) 2013 INRIA.
*
* 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 sys_shell_commands
* @{
*
* @file
* @brief Shell commands for the PS module
*
* @author Oliver Hahm <[email protected]>
*
* @}
*/
#ifdef MODULE_PS
#include "ps.h"
int _ps_handler(int argc, char **argv)
{
(void) argc;
(void) argv;
ps();
return 0;
}
#endif | Fix ps depedency when ps not included | Fix ps depedency when ps not included
| C | lgpl-2.1 | ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT,ximus/RIOT |
449ce31d5120a192e62d21fdf9389b0e8ca06d8e | test/CodeGen/nobuiltin.c | test/CodeGen/nobuiltin.c | // RUN: %clang_cc1 -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=MEMSET %s
// RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s
// RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=NOMEMSET %s
void PR13497() {
char content[2];
// make sure we don't optimize this call to strcpy()
// STRCPY-NOT: __strcpy_chk
// NOSTRCPY: __strcpy_chk
__builtin___strcpy_chk(content, "", 1);
}
void PR4941(char *s) {
// Make sure we don't optimize this loop to a memset().
// NOMEMSET-NOT: memset
// MEMSET: memset
for (unsigned i = 0; i < 8192; ++i)
s[i] = 0;
}
| // RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=MEMSET %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin -O1 -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=NOMEMSET %s
void PR13497() {
char content[2];
// make sure we don't optimize this call to strcpy()
// STRCPY-NOT: __strcpy_chk
// NOSTRCPY: __strcpy_chk
__builtin___strcpy_chk(content, "", 1);
}
void PR4941(char *s) {
// Make sure we don't optimize this loop to a memset().
// NOMEMSET-NOT: memset
// MEMSET: memset
for (unsigned i = 0; i < 8192; ++i)
s[i] = 0;
}
| Add target triples to fix test on non-x86. | Add target triples to fix test on non-x86.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@281790 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
11ac5afd65a335cafd8ad8884507fe3210dc80bc | src/dtkComposer/dtkComposerMetatype.h | src/dtkComposer/dtkComposerMetatype.h | /* dtkComposerMetatype.h ---
*
* Author: tkloczko
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Sat Aug 4 00:26:47 2012 (+0200)
* Version: $Id$
* Last-Updated: Wed Oct 17 11:45:26 2012 (+0200)
* By: Julien Wintz
* Update #: 12
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#ifndef DTKCOMPOSERMETATYPE_H
#define DTKCOMPOSERMETATYPE_H
#include <QtCore>
// /////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////
Q_DECLARE_METATYPE(bool*);
Q_DECLARE_METATYPE(int*);
Q_DECLARE_METATYPE(uint*);
Q_DECLARE_METATYPE(qlonglong*);
Q_DECLARE_METATYPE(qulonglong*);
Q_DECLARE_METATYPE(qreal*);
Q_DECLARE_METATYPE(QString*);
#endif
| /* dtkComposerMetatype.h ---
*
* Author: tkloczko
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Sat Aug 4 00:26:47 2012 (+0200)
* Version: $Id$
* Last-Updated: Thu Jun 13 14:55:45 2013 (+0200)
* By: Thibaud Kloczko
* Update #: 15
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#ifndef DTKCOMPOSERMETATYPE_H
#define DTKCOMPOSERMETATYPE_H
#include <QtCore>
// /////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////
Q_DECLARE_METATYPE(bool*);
Q_DECLARE_METATYPE(int*);
Q_DECLARE_METATYPE(uint*);
Q_DECLARE_METATYPE(qlonglong*);
Q_DECLARE_METATYPE(qulonglong*);
Q_DECLARE_METATYPE(qreal*);
Q_DECLARE_METATYPE(double **)
Q_DECLARE_METATYPE(QString*);
#endif
| Add declaration of double** to Qt metatype engine. | Add declaration of double** to Qt metatype engine.
| C | bsd-3-clause | d-tk/dtk,d-tk/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,rdebroiz/dtk,d-tk/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk |
eec85a4a55631f44199bc235c9db891e61be3c67 | spotify-fs.c | spotify-fs.c | #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include "spotify-fs.h"
int main(int argc, char *argv[])
{
int retval = 0;
char *password = NULL;
char *username = malloc(SPOTIFY_USERNAME_MAXLEN);
if ((getuid() == 0) || (geteuid() == 0)) {
fprintf(stderr, "Running %s as root is not a good idea\n", application_name);
return 1;
}
printf("spotify username: ");
username = fgets(username, SPOTIFY_USERNAME_MAXLEN, stdin);
long username_len = strlen(username);
if(username[username_len-1] == '\n') {
username[username_len-1] = '\0';
}
password = getpass("spotify password: ");
if (strlen(password) <= 0)
{
password = NULL;
}
/* should we do something about this, really?
* Maybe put error logging here instead of in
* spotify_session_init()*/
(void) spotify_session_init(username, password, NULL);
retval = fuse_main(argc, argv, &spfs_operations, NULL);
return retval;
}
| #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include "spotify-fs.h"
int main(int argc, char *argv[])
{
int retval = 0;
char *password = NULL;
char *username = malloc(SPOTIFY_USERNAME_MAXLEN);
if ((getuid() == 0) || (geteuid() == 0)) {
fprintf(stderr, "Running %s as root is not a good idea\n", application_name);
return 1;
}
printf("spotify username: ");
username = fgets(username, SPOTIFY_USERNAME_MAXLEN, stdin);
long username_len = strlen(username);
if(username_len > 0 && username[username_len-1] == '\n') {
username[username_len-1] = '\0';
}
password = getpass("spotify password: ");
if (strlen(password) <= 0)
{
password = NULL;
}
/* should we do something about this, really?
* Maybe put error logging here instead of in
* spotify_session_init()*/
(void) spotify_session_init(username, password, NULL);
retval = fuse_main(argc, argv, &spfs_operations, NULL);
return retval;
}
| Check that there's something in the username buffer before reading it | Check that there's something in the username buffer before reading it
| C | bsd-3-clause | chelmertz/spotifile,catharsis/spotifile,catharsis/spotifile,raoulh/spotifile,catharsis/spotifile,raoulh/spotifile,raoulh/spotifile,chelmertz/spotifile,chelmertz/spotifile |
776befec10531a6cdc260154f8364bec10f01f58 | libsmart_priv.h | libsmart_priv.h | #ifndef _LIBSMART_PRIV_H
#define _LIBSMART_PRIV_H
typedef struct smart_s {
smart_protocol_e protocol;
/* Device / OS specific follows this structure */
} smart_t;
#endif
| Add header file def for private structure | Add header file def for private structure
| C | isc | ctuffli/smart,ctuffli/smart |
|
6a983da6189220b79795474c5d3f2315702a984e | Utilities/kwsys/testDynload.c | Utilities/kwsys/testDynload.c | #ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif
DL_EXPORT int TestDynamicLoaderData;
DL_EXPORT void TestDynamicLoaderFunction()
{
}
| #ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif
DL_EXPORT int TestDynamicLoaderData = 0;
DL_EXPORT void TestDynamicLoaderFunction()
{
}
| Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format) | COMP: Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format)
| C | bsd-3-clause | candy7393/VTK,arnaudgelas/VTK,sumedhasingla/VTK,johnkit/vtk-dev,mspark93/VTK,collects/VTK,biddisco/VTK,daviddoria/PointGraphsPhase1,mspark93/VTK,mspark93/VTK,Wuteyan/VTK,jeffbaumes/jeffbaumes-vtk,sumedhasingla/VTK,aashish24/VTK-old,Wuteyan/VTK,keithroe/vtkoptix,Wuteyan/VTK,mspark93/VTK,ashray/VTK-EVM,ashray/VTK-EVM,spthaolt/VTK,hendradarwin/VTK,candy7393/VTK,demarle/VTK,gram526/VTK,naucoin/VTKSlicerWidgets,sankhesh/VTK,daviddoria/PointGraphsPhase1,spthaolt/VTK,ashray/VTK-EVM,msmolens/VTK,keithroe/vtkoptix,hendradarwin/VTK,berendkleinhaneveld/VTK,daviddoria/PointGraphsPhase1,candy7393/VTK,hendradarwin/VTK,gram526/VTK,johnkit/vtk-dev,jeffbaumes/jeffbaumes-vtk,aashish24/VTK-old,gram526/VTK,collects/VTK,naucoin/VTKSlicerWidgets,sankhesh/VTK,arnaudgelas/VTK,johnkit/vtk-dev,gram526/VTK,SimVascular/VTK,biddisco/VTK,demarle/VTK,msmolens/VTK,SimVascular/VTK,berendkleinhaneveld/VTK,arnaudgelas/VTK,jeffbaumes/jeffbaumes-vtk,msmolens/VTK,hendradarwin/VTK,demarle/VTK,hendradarwin/VTK,sumedhasingla/VTK,biddisco/VTK,sumedhasingla/VTK,spthaolt/VTK,jmerkow/VTK,jeffbaumes/jeffbaumes-vtk,msmolens/VTK,collects/VTK,cjh1/VTK,gram526/VTK,collects/VTK,jmerkow/VTK,arnaudgelas/VTK,SimVascular/VTK,daviddoria/PointGraphsPhase1,johnkit/vtk-dev,biddisco/VTK,Wuteyan/VTK,collects/VTK,ashray/VTK-EVM,naucoin/VTKSlicerWidgets,sankhesh/VTK,naucoin/VTKSlicerWidgets,naucoin/VTKSlicerWidgets,aashish24/VTK-old,ashray/VTK-EVM,keithroe/vtkoptix,jmerkow/VTK,arnaudgelas/VTK,spthaolt/VTK,jmerkow/VTK,collects/VTK,mspark93/VTK,berendkleinhaneveld/VTK,berendkleinhaneveld/VTK,berendkleinhaneveld/VTK,sumedhasingla/VTK,mspark93/VTK,biddisco/VTK,keithroe/vtkoptix,candy7393/VTK,aashish24/VTK-old,ashray/VTK-EVM,cjh1/VTK,mspark93/VTK,cjh1/VTK,johnkit/vtk-dev,sankhesh/VTK,sumedhasingla/VTK,SimVascular/VTK,keithroe/vtkoptix,keithroe/vtkoptix,ashray/VTK-EVM,SimVascular/VTK,jeffbaumes/jeffbaumes-vtk,keithroe/vtkoptix,jmerkow/VTK,aashish24/VTK-old,jmerkow/VTK,spthaolt/VTK,Wuteyan/VTK,demarle/VTK,sankhesh/VTK,SimVascular/VTK,daviddoria/PointGraphsPhase1,jmerkow/VTK,arnaudgelas/VTK,candy7393/VTK,demarle/VTK,ashray/VTK-EVM,sumedhasingla/VTK,candy7393/VTK,jmerkow/VTK,gram526/VTK,spthaolt/VTK,Wuteyan/VTK,gram526/VTK,keithroe/vtkoptix,johnkit/vtk-dev,gram526/VTK,sankhesh/VTK,mspark93/VTK,Wuteyan/VTK,sankhesh/VTK,candy7393/VTK,msmolens/VTK,biddisco/VTK,msmolens/VTK,SimVascular/VTK,cjh1/VTK,cjh1/VTK,jeffbaumes/jeffbaumes-vtk,hendradarwin/VTK,candy7393/VTK,sankhesh/VTK,biddisco/VTK,sumedhasingla/VTK,demarle/VTK,johnkit/vtk-dev,aashish24/VTK-old,demarle/VTK,daviddoria/PointGraphsPhase1,msmolens/VTK,SimVascular/VTK,naucoin/VTKSlicerWidgets,berendkleinhaneveld/VTK,msmolens/VTK,hendradarwin/VTK,spthaolt/VTK,berendkleinhaneveld/VTK,cjh1/VTK,demarle/VTK |
3b4878c31f8659a1a8c05225ced397ee76a12208 | testmud/mud/home/Game/sys/bin/rebuild.c | testmud/mud/home/Game/sys/bin/rebuild.c | #include <kotaka/paths.h>
#include <game/paths.h>
inherit LIB_BIN;
void main(string args)
{
object user;
user = query_user();
if (user->query_class() < 2) {
send_out("You do not have sufficient access rights to rebuild.\n");
return;
}
OBJECTD->klib_recompile();
OBJECTD->global_recompile();
}
| #include <kotaka/paths.h>
#include <game/paths.h>
inherit LIB_BIN;
void main(string args)
{
object user;
user = query_user();
if (user->query_class() < 1) {
send_out("You do not have sufficient access rights to rebuild.\n");
return;
}
OBJECTD->recompile_everything();
}
| Update Game to new objectd api | Update Game to new objectd api
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
88421a4d5cd49aa4dcb48687395577cb9e19cbaf | cbits/Engine.h | cbits/Engine.h | #ifndef HSQML_ENGINE_H
#define HSQML_ENGINE_H
#include <QtCore/QScopedPointer>
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
#include "hsqml.h"
class HsQMLObjectProxy;
class HsQMLWindow;
struct HsQMLEngineConfig
{
HsQMLEngineConfig()
: contextObject(NULL)
, stopCb(NULL)
{}
HsQMLObjectProxy* contextObject;
QString initialURL;
QStringList importPaths;
QStringList pluginPaths;
HsQMLTrivialCb stopCb;
};
class HsQMLEngine : public QObject
{
Q_OBJECT
public:
HsQMLEngine(const HsQMLEngineConfig&);
~HsQMLEngine();
bool eventFilter(QObject*, QEvent*);
QQmlEngine* declEngine();
private:
Q_DISABLE_COPY(HsQMLEngine)
Q_SLOT void componentStatus(QQmlComponent::Status);
QQmlEngine mEngine;
QQmlComponent mComponent;
QList<QObject*> mObjects;
HsQMLTrivialCb mStopCb;
};
#endif /*HSQML_ENGINE_H*/
| #ifndef HSQML_ENGINE_H
#define HSQML_ENGINE_H
#include <QtCore/QScopedPointer>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
#include "hsqml.h"
class HsQMLObjectProxy;
class HsQMLWindow;
struct HsQMLEngineConfig
{
HsQMLEngineConfig()
: contextObject(NULL)
, stopCb(NULL)
{}
HsQMLObjectProxy* contextObject;
QString initialURL;
QStringList importPaths;
QStringList pluginPaths;
HsQMLTrivialCb stopCb;
};
class HsQMLEngine : public QObject
{
Q_OBJECT
public:
HsQMLEngine(const HsQMLEngineConfig&);
~HsQMLEngine();
bool eventFilter(QObject*, QEvent*);
QQmlEngine* declEngine();
private:
Q_DISABLE_COPY(HsQMLEngine)
Q_SLOT void componentStatus(QQmlComponent::Status);
QQmlEngine mEngine;
QQmlComponent mComponent;
QList<QObject*> mObjects;
HsQMLTrivialCb mStopCb;
};
#endif /*HSQML_ENGINE_H*/
| Fix missing include breaking compilation with Qt 5.0. | Fix missing include breaking compilation with Qt 5.0.
Ignore-this: 5dff167c44ad1cc6ee31684cae68da9e
darcs-hash:20150127225150-4d2ae-3a04dfc67645719182188ee9c21c2bed04a8101c
| C | bsd-3-clause | johntyree/HsQML,johntyree/HsQML |
de1ecd4aee0442d68861da0e0ba2724d3880ed7c | HLT/PHOS/AliHLTPHOSRcuCellEnergyData.h | HLT/PHOS/AliHLTPHOSRcuCellEnergyData.h | #ifndef ALIHLTPHOSRCUCELLENERGYDATA_H
#define ALIHLTPHOSRCUCELLENERGYDATA_H
struct AliHLTPHOSRcuCellEnergyData
{
AliHLTUInt8_t fRcuX;
AliHLTUInt8_t fRcuY;
AliHLTUInt8_t fModuleID;
unsigned long cellEnergies[32][28][2];
};
#endif
| Structure to hold data abouth crystal/cell energies corresponding to a single RCU block | Structure to hold data abouth crystal/cell energies corresponding to a single RCU block
| C | bsd-3-clause | shahor02/AliRoot,miranov25/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,shahor02/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,miranov25/AliRoot,shahor02/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,alisw/AliRoot,coppedis/AliRoot |
|
5d697e859aa4711d270f5c3170449fcce1fbc412 | test/Driver/arm-fixed-r9.c | test/Driver/arm-fixed-r9.c | // RUN: %clang -target arm-none-gnueeabi -ffixed-r9 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-FIXED-R9 < %t %s
// CHECK-FIXED-R9: "-backend-option" "-arm-reserve-r9"
| // RUN: %clang -target arm-none-gnueabi -ffixed-r9 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-FIXED-R9 < %t %s
// CHECK-FIXED-R9: "-backend-option" "-arm-reserve-r9"
| Fix typo in ARM reserved-r9 test case | Fix typo in ARM reserved-r9 test case
Patch by Charlie Turner.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@219569 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
e45534d027c685561d6da233e3cf5e0c1dde726c | include/llvm/CodeGen/GCs.h | include/llvm/CodeGen/GCs.h | //===-- GCs.h - Garbage collector linkage hacks ---------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains hack functions to force linking in the GC components.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GCS_H
#define LLVM_CODEGEN_GCS_H
namespace llvm {
class GCStrategy;
class GCMetadataPrinter;
/// FIXME: Collector instances are not useful on their own. These no longer
/// serve any purpose except to link in the plugins.
/// Creates an ocaml-compatible garbage collector.
void linkOcamlGC();
/// Creates an ocaml-compatible metadata printer.
void linkOcamlGCPrinter();
/// Creates an erlang-compatible garbage collector.
void linkErlangGC();
/// Creates an erlang-compatible metadata printer.
void linkErlangGCPrinter();
/// Creates a shadow stack garbage collector. This collector requires no code
/// generator support.
void linkShadowStackGC();
}
#endif
| //===-- GCs.h - Garbage collector linkage hacks ---------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains hack functions to force linking in the GC components.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GCS_H
#define LLVM_CODEGEN_GCS_H
namespace llvm {
class GCStrategy;
class GCMetadataPrinter;
/// FIXME: Collector instances are not useful on their own. These no longer
/// serve any purpose except to link in the plugins.
/// Creates an ocaml-compatible garbage collector.
void linkOcamlGC();
/// Creates an ocaml-compatible metadata printer.
void linkOcamlGCPrinter();
/// Creates an erlang-compatible garbage collector.
void linkErlangGC();
/// Creates an erlang-compatible metadata printer.
void linkErlangGCPrinter();
/// Creates a shadow stack garbage collector. This collector requires no code
/// generator support.
void linkShadowStackGC();
}
#endif
| Test commit: Remove trailing whitespace. | Test commit: Remove trailing whitespace.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@203502 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm |
19d03376c20ef7e98c2e4907004a40f8e658c10a | source/glbinding/include/glbinding/glbinding.h | source/glbinding/include/glbinding/glbinding.h | #pragma once
#include <glbinding/glbinding_api.h>
#include <glbinding/ContextId.h>
namespace glbinding {
GLBINDING_API void initialize();
GLBINDING_API void initialize(ContextId contextId, bool useContext = true, bool resolveFunctions = false);
GLBINDING_API void resolveFunctions();
GLBINDING_API void useCurrentContext();
GLBINDING_API void useContext(ContextId contextId);
GLBINDING_API void finalizeCurrentContext();
GLBINDING_API void finalizeContext(ContextId contextId);
} // namespace glbinding
| #pragma once
#include <glbinding/glbinding_api.h>
#include <glbinding/ContextId.h>
namespace glbinding {
GLBINDING_API void initialize();
GLBINDING_API void initialize(ContextId contextId, bool useContext = true, bool resolveFunctions = true);
GLBINDING_API void resolveFunctions();
GLBINDING_API void useCurrentContext();
GLBINDING_API void useContext(ContextId contextId);
GLBINDING_API void finalizeCurrentContext();
GLBINDING_API void finalizeContext(ContextId contextId);
} // namespace glbinding
| Change default parameter to true | Change default parameter to true
| C | mit | mcleary/glbinding,j-o/glbinding,mcleary/glbinding,hpi-r2d2/glbinding,hpicgs/glbinding,hpicgs/glbinding,hpicgs/glbinding,cginternals/glbinding,mcleary/glbinding,j-o/glbinding,hpicgs/glbinding,hpi-r2d2/glbinding,hpi-r2d2/glbinding,cginternals/glbinding,hpi-r2d2/glbinding,mcleary/glbinding,j-o/glbinding,j-o/glbinding |
4fddd802417ad903fe7dd590d7175d556c0697dd | gfx/size_io.h | gfx/size_io.h | // LAF Gfx Library
// Copyright (C) 2019 Igara Studio S.A.
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef GFX_SIZE_IO_H_INCLUDED
#define GFX_SIZE_IO_H_INCLUDED
#pragma once
#include "gfx/size.h"
#include <iosfwd>
namespace gfx {
inline std::ostream& operator<<(std::ostream& os, const Size& size) {
return os << "("
<< size.x << ", "
<< size.y << ")";
}
inline std::istream& operator>>(std::istream& in, Size& size) {
while (in && in.get() != '(')
;
if (!in)
return in;
char chr;
in >> size.x >> chr
>> size.y;
return in;
}
}
#endif
| // LAF Gfx Library
// Copyright (C) 2019 Igara Studio S.A.
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef GFX_SIZE_IO_H_INCLUDED
#define GFX_SIZE_IO_H_INCLUDED
#pragma once
#include "gfx/size.h"
#include <iosfwd>
namespace gfx {
inline std::ostream& operator<<(std::ostream& os, const Size& size) {
return os << "("
<< size.w << ", "
<< size.h << ")";
}
inline std::istream& operator>>(std::istream& in, Size& size) {
while (in && in.get() != '(')
;
if (!in)
return in;
char chr;
in >> size.w >> chr
>> size.h;
return in;
}
}
#endif
| Fix operator<<(ostream&) and operator>>(istream&) for gfx::Size | Fix operator<<(ostream&) and operator>>(istream&) for gfx::Size
| C | mit | aseprite/laf,aseprite/laf |
666d003deec427657491dcfef7c4871ed2c4eb66 | src/blueprint.c | src/blueprint.c | #include "blueprint.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "parson.h"
#include "bstrlib.h"
void free_blueprint(struct blueprint *bp)
{
if (bp == NULL)
return;
bdestroy(bp->name);
bdestroy(bp->blueprint_name);
bdestroy(bp->Name);
bdestroy(bp->game_version);
for (int i = 0; i < bp->num_sc; i++)
free_blueprint(&bp->SCs[i]);
free(bp->blocks);
free(bp);
}
| #include "blueprint.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "parson.h"
#include "bstrlib.h"
void free_blueprint(struct blueprint *bp)
{
if (bp == NULL)
return;
bdestroy(bp->name);
bdestroy(bp->blueprint_name);
bdestroy(bp->Name);
bdestroy(bp->game_version);
for (int i = 0; i < bp->num_sc; i++)
free_blueprint(&bp->SCs[i]);
for (int i = 0; i < bp->total_block_count; i++)
{
if (bp->blocks[i].string_data == NULL)
continue;
bdestroy(bp->blocks[i].string_data);
}
free(bp->blocks);
free(bp);
}
| Remove yet another memory leak | Remove yet another memory leak
| C | mit | Dean4Devil/libblueprint,Dean4Devil/libblueprint |
4d1379897a62ac0598366561b69fe21d4d4bd091 | src/goontools.c | src/goontools.c | #include "goontools.h"
void usage(char* prog)
{
fprintf(stderr, "\n");
fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog);
fprintf(stderr, "\n");
fprintf(stderr, "subcommands:\n");
fprintf(stderr, " index index file\n");
fprintf(stderr, " sort sort file\n");
fprintf(stderr, " view view/slice file\n");
fprintf(stderr, " idxstat print index information\n");
fprintf(stderr, "\n");
}
int dispatch(int argc, char *argv[])
{
char *subcommands[] = {
"index",
"view",
"sort",
"idxstats",
NULL // sentinel
};
Subcommand dispatch[] = {
&goonindex,
&goonview,
&goonsort,
&goonidxstat
};
char **s;
for (s = subcommands; *s != NULL; s += 1) {
if (strcmp(argv[1], *s) == 0) {
break;
}
}
if (*s == NULL) {
usage(argv[0]);
return -1;
}
return dispatch[s-subcommands](argc-1, argv+1);
}
int main(int argc, char *argv[])
{
if (argc == 1) {
usage(argv[0]);
return EXIT_FAILURE;
}
if (dispatch(argc, argv) != 0) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
| #include "goontools.h"
void usage(char* prog)
{
fprintf(stderr, "\n");
fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog);
fprintf(stderr, "\n");
fprintf(stderr, "subcommands:\n");
fprintf(stderr, " index index file\n");
fprintf(stderr, " sort sort file\n");
fprintf(stderr, " view view/slice file\n");
fprintf(stderr, " idxstat print index information\n");
fprintf(stderr, "\n");
}
int dispatch(int argc, char *argv[])
{
char *subcommands[] = {
"index",
"view",
"sort",
"idxstat",
NULL // sentinel
};
Subcommand dispatch[] = {
&goonindex,
&goonview,
&goonsort,
&goonidxstat
};
char **s;
for (s = subcommands; *s != NULL; s += 1) {
if (strcmp(argv[1], *s) == 0) {
break;
}
}
if (*s == NULL) {
usage(argv[0]);
return -1;
}
return dispatch[s-subcommands](argc-1, argv+1);
}
int main(int argc, char *argv[])
{
if (argc == 1) {
usage(argv[0]);
return EXIT_FAILURE;
}
if (dispatch(argc, argv) != 0) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
| Fix typo in `idxstat` subcommand | Fix typo in `idxstat` subcommand
| C | mit | mhyfritz/goontools,mhyfritz/goontools,mhyfritz/goontools |
74fc900360426b3f0f620734f23cd47d879c73da | kmail/kmfoldertype.h | kmail/kmfoldertype.h | #ifndef KMFOLDERTYPE_H
#define KMFOLDERTYPE_H
typedef enum
{
KMFolderTypeMbox = 0,
KMFolderTypeMaildir,
KMFolderTypeCachedImap,
KMFolderTypeImap,
KMFolderTypeSearch
} KMFolderType;
typedef enum
{
KMStandardDir = 0,
KMImapDir,
KMSearchDir
} KMFolderDirType;
#endif // KMFOLDERTYPE_H
| #ifndef KMFOLDERTYPE_H
#define KMFOLDERTYPE_H
typedef enum
{
KMFolderTypeMbox = 0,
KMFolderTypeMaildir,
KMFolderTypeCachedImap,
KMFolderTypeImap,
KMFolderTypeSearch,
KMFolderTypeUnknown
} KMFolderType;
typedef enum
{
KMStandardDir = 0,
KMImapDir,
KMSearchDir
} KMFolderDirType;
#endif // KMFOLDERTYPE_H
| Add an unknown folder type | Add an unknown folder type
svn path=/trunk/kdenetwork/kmail/; revision=197411
| C | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi |
a9a7737f4f0120d49ef870a1aa5bf74e05dac1e8 | src/arch/posix/csp_clock.c | src/arch/posix/csp_clock.c | /*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 Gomspace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <csp/arch/csp_clock.h>
#include <time.h>
void clock_get_time(timestamp_t * timestamp) {
timestamp->tv_sec = time(0);
}
void clock_set_time(timestamp_t * timestamp) {
return;
}
| /*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 Gomspace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <csp/arch/csp_clock.h>
#include <time.h>
void clock_get_time(csp_timestamp_t * timestamp) {
timestamp->tv_sec = time(0);
}
void clock_set_time(csp_timestamp_t * timestamp) {
return;
}
| Fix compile of posix clock after timestamp_t was renamed to csp_timestamp_t | Fix compile of posix clock after timestamp_t was renamed to csp_timestamp_t
| C | apache-2.0 | Psykar/kubos,kubostech/KubOS,libcsp/libcsp,pacheco017/libcsp,pacheco017/libcsp,GomSpace/libcsp,GomSpace/libcsp,pacheco017/libcsp,Psykar/kubos,Psykar/kubos,satlab/libcsp,Psykar/kubos,Psykar/kubos,Psykar/kubos,Psykar/kubos,satlab/libcsp,libcsp/libcsp,GomSpace/libcsp,satlab/libcsp,kubostech/KubOS,pacheco017/libcsp |
b693b103d46a00a88314a0fa0349ad85d26efd2d | source/gloperate/include/gloperate/painter/PipelineOutputCapability.h | source/gloperate/include/gloperate/painter/PipelineOutputCapability.h | #pragma once
#include <gloperate/gloperate_api.h>
#include <gloperate/painter/AbstractOutputCapability.h>
#include <gloperate/pipeline/AbstractPipeline.h>
#include <string>
#include <vector>
namespace gloperate
{
class AbstractData;
template <typename T>
class Data;
/**
* @brief
* OutputCapability for pipelines
*
*/
class GLOPERATE_API PipelineOutputCapability : public AbstractOutputCapability
{
public:
/**
* @brief
* Constructor
*/
PipelineOutputCapability(gloperate::AbstractPipeline & pipeline);
/**
* @brief
* Destructor
*/
virtual ~PipelineOutputCapability();
virtual std::vector<gloperate::AbstractData*> allOutputs() const;
protected:
gloperate::AbstractPipeline & m_pipeline;
};
} // namespace gloperate
| #pragma once
#include <gloperate/gloperate_api.h>
#include <gloperate/painter/AbstractOutputCapability.h>
#include <gloperate/pipeline/AbstractPipeline.h>
#include <string>
#include <vector>
namespace gloperate
{
class AbstractData;
template <typename T>
class Data;
/**
* @brief
* OutputCapability for pipelines
*
*/
class GLOPERATE_API PipelineOutputCapability : public AbstractOutputCapability
{
public:
/**
* @brief
* Constructor
*/
PipelineOutputCapability(gloperate::AbstractPipeline & pipeline);
/**
* @brief
* Destructor
*/
virtual ~PipelineOutputCapability();
virtual std::vector<gloperate::AbstractData*> allOutputs() const override;
protected:
gloperate::AbstractPipeline & m_pipeline;
};
} // namespace gloperate
| Add override to overridden method | Add override to overridden method
| C | mit | lanice/gloperate,hpicgs/gloperate,j-o/gloperate,lanice/gloperate,cginternals/gloperate,lanice/gloperate,Beta-Alf/gloperate,p-otto/gloperate,hpicgs/gloperate,p-otto/gloperate,cginternals/gloperate,p-otto/gloperate,lanice/gloperate,Beta-Alf/gloperate,Beta-Alf/gloperate,p-otto/gloperate,Beta-Alf/gloperate,hpicgs/gloperate,lanice/gloperate,j-o/gloperate,hpi-r2d2/gloperate,cginternals/gloperate,j-o/gloperate,cginternals/gloperate,p-otto/gloperate,hpicgs/gloperate,hpi-r2d2/gloperate,j-o/gloperate,hpicgs/gloperate,Beta-Alf/gloperate |
2fcf5b345b9b2b37fe9d41434c9df4ebc8c9e3f2 | CefSharp.Core/Internals/CefCallbackWrapper.h | CefSharp.Core/Internals/CefCallbackWrapper.h | // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "include\cef_callback.h"
namespace CefSharp
{
public ref class CefCallbackWrapper : public ICallback
{
private:
MCefRefPtr<CefCallback> _callback;
public:
CefCallbackWrapper(CefRefPtr<CefCallback> &callback) : _callback(callback)
{
}
!CefCallbackWrapper()
{
_callback = NULL;
}
~CefCallbackWrapper()
{
this->!CefCallbackWrapper();
}
virtual void Cancel()
{
if (this == nullptr)
{
return;
}
_callback->Cancel();
delete this;
}
virtual void Continue()
{
if (this == nullptr)
{
return;
}
_callback->Continue();
delete this;
}
};
} | // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "include\cef_callback.h"
namespace CefSharp
{
public ref class CefCallbackWrapper : public ICallback
{
private:
MCefRefPtr<CefCallback> _callback;
public:
CefCallbackWrapper(CefRefPtr<CefCallback> &callback) : _callback(callback)
{
}
!CefCallbackWrapper()
{
_callback = NULL;
}
~CefCallbackWrapper()
{
this->!CefCallbackWrapper();
}
virtual void Cancel()
{
if (_callback.get() == nullptr)
{
return;
}
_callback->Cancel();
delete this;
}
virtual void Continue()
{
if (_callback.get() == nullptr)
{
return;
}
_callback->Continue();
delete this;
}
};
} | Use MCefRefPtr::get() to check for null reference | Use MCefRefPtr::get() to check for null reference
| C | bsd-3-clause | haozhouxu/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,yoder/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,haozhouxu/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,ruisebastiao/CefSharp,twxstar/CefSharp,dga711/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,battewr/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,ruisebastiao/CefSharp,AJDev77/CefSharp,Livit/CefSharp,VioletLife/CefSharp,Livit/CefSharp,illfang/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,joshvera/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,twxstar/CefSharp,illfang/CefSharp,dga711/CefSharp,wangzheng888520/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,VioletLife/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,illfang/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,windygu/CefSharp,twxstar/CefSharp,VioletLife/CefSharp,gregmartinhtc/CefSharp,NumbersInternational/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,AJDev77/CefSharp,yoder/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,Livit/CefSharp,battewr/CefSharp |
31ef4104b26541707de078fd748f0cd80577e590 | libredex/Util.h | libredex/Util.h | /**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#pragma once
#include <algorithm>
#include <memory>
#include <utility>
namespace std {
#if __cplusplus<201402L
// simple implementation of make_unique since C++11 doesn't have it available
// note that it doesn't work properly if T is an array type
template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif
}
/**
* Insert into the proper location in a sorted container.
*/
template <class Container, class T, class Compare>
void insert_sorted(Container& c, const T& e, Compare comp) {
c.insert(std::lower_bound(c.begin(), c.end(), e, comp), e);
}
| /**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#pragma once
#include <algorithm>
#include <memory>
#include <utility>
namespace std {
#if __cplusplus<201300L
// simple implementation of make_unique since C++11 doesn't have it available
// note that it doesn't work properly if T is an array type
template <typename T, typename... Args>
std::unique_ptr<T> make_unique(Args... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif
}
/**
* Insert into the proper location in a sorted container.
*/
template <class Container, class T, class Compare>
void insert_sorted(Container& c, const T& e, Compare comp) {
c.insert(std::lower_bound(c.begin(), c.end(), e, comp), e);
}
| Fix the `__cplusplus` gating for std::make_unique | Fix the `__cplusplus` gating for std::make_unique
Summary: Once we upgrade to gcc 4.9 and have `std::make_unique` redex chokes. Properly gate the definition of `std::make_unique` to the right compiler macro
Reviewed By: int3, satnam6502
Differential Revision: D3970944
fbshipit-source-id: 453bb43da0bfa5d3c61d38cd62cfb17b3983ce68
| C | mit | facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex |
acc490b880c0719f2f07fa724f9802a0cb402a12 | include/cppoptlib/solver/gradientdescentsolver.h | include/cppoptlib/solver/gradientdescentsolver.h | // CppNumericalSolver
#ifndef GRADIENTDESCENTSOLVER_H_
#define GRADIENTDESCENTSOLVER_H_
#include <Eigen/Dense>
#include "isolver.h"
#include "../linesearch/morethuente.h"
namespace cppoptlib {
template<typename T>
class GradientDescentSolver : public ISolver<T, 1> {
public:
/**
* @brief minimize
* @details [long description]
*
* @param objFunc [description]
*/
void minimize(Problem<T> &objFunc, Vector<T> & x0) {
Vector<T> direction(x0.rows());
size_t iter = 0;
T gradNorm = 0;
do {
objFunc.gradient(x0, direction);
const T rate = MoreThuente<T, decltype(objFunc), 1>::linesearch(x0, -direction, objFunc) ;
x0 = x0 - rate * direction;
gradNorm = direction.template lpNorm<Eigen::Infinity>();
// std::cout << "iter: "<<iter<< " f = " << objFunc.value(x0) << " ||g||_inf "<<gradNorm << std::endl;
iter++;
} while ((gradNorm > this->settings_.gradTol) && (iter < this->settings_.maxIter));
}
};
} /* namespace cppoptlib */
#endif /* GRADIENTDESCENTSOLVER_H_ */
| // CppNumericalSolver
#ifndef GRADIENTDESCENTSOLVER_H_
#define GRADIENTDESCENTSOLVER_H_
#include <Eigen/Dense>
#include "isolver.h"
#include "../linesearch/morethuente.h"
namespace cppoptlib {
template<typename T>
class GradientDescentSolver : public ISolver<T, 1> {
public:
/**
* @brief minimize
* @details [long description]
*
* @param objFunc [description]
*/
void minimize(Problem<T> &objFunc, Vector<T> & x0) {
Vector<T> direction(x0.rows());
size_t iter = 0;
T gradNorm = 0;
do {
objFunc.gradient(x0, direction);
const T rate = MoreThuente<T, decltype(objFunc), 1>::linesearch(x0, -direction, objFunc) ;
x0 = x0 - rate * direction;
objFunc.applyBounds(x0);
gradNorm = direction.template lpNorm<Eigen::Infinity>();
// std::cout << "iter: "<<iter<< " f = " << objFunc.value(x0) << " ||g||_inf "<<gradNorm << std::endl;
iter++;
} while ((gradNorm > this->settings_.gradTol) && (iter < this->settings_.maxIter));
}
};
} /* namespace cppoptlib */
#endif /* GRADIENTDESCENTSOLVER_H_ */
| Apply box constraints in GriadientDescentSolver. | Apply box constraints in GriadientDescentSolver.
| C | mit | jdumas/CppNumericalSolvers,jdumas/CppNumericalSolvers,jdumas/CppNumericalSolvers,jdumas/CppNumericalSolvers |
96b4eefd5026af81d7f4d6555737d625dd55ec33 | src/win32/jet_string_win.c | src/win32/jet_string_win.c | /*
*The MIT License (MIT)
*
* Copyright (c) <2017> <Stephan Gatzka>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <ctype.h>
#include <stddef.h>
#include <string.h>
#include "jet_string.h"
void *jet_memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
{
register char *cur, *last;
const char *cl = (const char *)haystack;
const char *cs = (const char *)needle;
if (haystacklen == 0 || needlelen == 0)
return NULL;
if (haystacklen < needlelen)
return NULL;
if (needlelen == 1)
return memchr(haystack, (int)*cs, haystacklen);
last = (char *)cl + haystacklen - needlelen;
for (cur = (char *)cl; cur <= last; cur++)
if (cur[0] == cs[0] && memcmp(cur, cs, needlelen) == 0)
return cur;
return NULL;
}
const char *jet_strcasestr(const char *haystack, const char *needle)
{
char c, sc;
size_t len;
if ((c = *needle++) != 0) {
c = tolower((unsigned char)c);
len = strlen(needle);
do {
do {
if ((sc = *haystack++) == 0)
return (NULL);
} while ((char)tolower((unsigned char)sc) != c);
} while (jet_strncasecmp(haystack, needle, len) != 0);
haystack--;
}
return (haystack);
}
int jet_strncasecmp(const char *s1, const char *s2, size_t n)
{
return _strnicmp(s1, s2, n);
}
int jet_strcasecmp(const char *s1, const char *s2)
{
return _stricmp(s1, s2);
}
| Add string manipulation functions for windows. | Add string manipulation functions for windows.
| C | mit | mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet |
|
b0fab27e4614b0d716561983d516d3b47b8f078f | include/cpr/curlholder.h | include/cpr/curlholder.h | #ifndef CPR_CURL_HOLDER_H
#define CPR_CURL_HOLDER_H
#include <memory>
#include <curl/curl.h>
namespace cpr {
struct CurlHolder {
CURL* handle;
struct curl_slist* chunk;
char error[CURL_ERROR_SIZE];
};
} // namespace cpr
#endif
| #ifndef CPR_CURL_HOLDER_H
#define CPR_CURL_HOLDER_H
#include <memory>
#include <curl/curl.h>
namespace cpr {
struct CurlHolder {
CURL* handle;
struct curl_slist* chunk;
struct curl_httppost* formpost;
char error[CURL_ERROR_SIZE];
};
} // namespace cpr
#endif
| Add formpost pointer in curl handle | Add formpost pointer in curl handle
| C | mit | msuvajac/cpr,whoshuu/cpr,msuvajac/cpr,whoshuu/cpr,msuvajac/cpr,whoshuu/cpr |
8b9b074fcb831e16ff33062c1ad7065f00831341 | src/include/common/config.h | src/include/common/config.h | //===----------------------------------------------------------------------===//
//
// Peloton
//
// config.h
//
// Identification: src/include/common/config.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#pragma once
#include <string>
namespace peloton {
class PelotonConfiguration {
public:
static void PrintHelp();
int GetPort() const;
void SetPort(const int port);
int GetMaxConnections() const;
void SetMaxConnections(const int max_connections);
std::string GetSocketFamily() const;
void SetSocketFamily(const std::string& socket_family);
protected:
// Peloton port
int port = 12345;
// Maximum number of connections
int max_connections = 64;
// Socket family (AF_UNIX, AF_INET)
std::string socket_family = "AF_INET";
};
} // End peloton namespace
| //===----------------------------------------------------------------------===//
//
// Peloton
//
// config.h
//
// Identification: src/include/common/config.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//
#pragma once
#include <string>
namespace peloton {
class PelotonConfiguration {
public:
static void PrintHelp();
int GetPort() const;
void SetPort(const int port);
int GetMaxConnections() const;
void SetMaxConnections(const int max_connections);
std::string GetSocketFamily() const;
void SetSocketFamily(const std::string& socket_family);
protected:
// Peloton port
int port = 5432;
// Maximum number of connections
int max_connections = 64;
// Socket family (AF_UNIX, AF_INET)
std::string socket_family = "AF_INET";
};
} // End peloton namespace
| Change default port number 5432 | Change default port number 5432
| C | apache-2.0 | wangziqi2016/peloton,malin1993ml/peloton,eric-haibin-lin/peloton-1,prashasthip/peloton,AngLi-Leon/peloton,apavlo/peloton,seojungmin/peloton,jessesleeping/iso_peloton,AllisonWang/peloton,apavlo/peloton,seojungmin/peloton,seojungmin/peloton,yingjunwu/peloton,wangziqi2016/peloton,jessesleeping/iso_peloton,malin1993ml/peloton,apavlo/peloton,AngLi-Leon/peloton,vittvolt/15721-peloton,cmu-db/peloton,AllisonWang/peloton,phisiart/peloton-p3,prashasthip/peloton,jessesleeping/iso_peloton,yingjunwu/peloton,yingjunwu/peloton,malin1993ml/peloton,cmu-db/peloton,AngLi-Leon/peloton,apavlo/peloton,AllisonWang/peloton,prashasthip/peloton,PauloAmora/peloton,ShuxinLin/peloton,wangziqi2016/peloton,PauloAmora/peloton,haojin2/peloton,malin1993ml/peloton,prashasthip/peloton,vittvolt/peloton,jessesleeping/iso_peloton,vittvolt/15721-peloton,haojin2/peloton,vittvolt/peloton,vittvolt/15721-peloton,seojungmin/peloton,ShuxinLin/peloton,vittvolt/peloton,malin1993ml/peloton,seojungmin/peloton,eric-haibin-lin/peloton-1,phisiart/peloton-p3,wangziqi2016/peloton,apavlo/peloton,prashasthip/peloton,AngLi-Leon/peloton,eric-haibin-lin/peloton-1,jessesleeping/iso_peloton,cmu-db/peloton,PauloAmora/peloton,cmu-db/peloton,PauloAmora/peloton,ShuxinLin/peloton,eric-haibin-lin/peloton-1,vittvolt/peloton,vittvolt/peloton,phisiart/peloton-p3,PauloAmora/peloton,AllisonWang/peloton,eric-haibin-lin/peloton-1,yingjunwu/peloton,ShuxinLin/peloton,cmu-db/peloton,AllisonWang/peloton,prashasthip/peloton,malin1993ml/peloton,yingjunwu/peloton,jessesleeping/iso_peloton,ShuxinLin/peloton,haojin2/peloton,yingjunwu/peloton,haojin2/peloton,wangziqi2016/peloton,apavlo/peloton,AllisonWang/peloton,seojungmin/peloton,phisiart/peloton-p3,phisiart/peloton-p3,PauloAmora/peloton,vittvolt/peloton,AngLi-Leon/peloton,ShuxinLin/peloton,haojin2/peloton,AngLi-Leon/peloton,jessesleeping/iso_peloton,wangziqi2016/peloton,phisiart/peloton-p3,cmu-db/peloton,eric-haibin-lin/peloton-1,vittvolt/15721-peloton,vittvolt/15721-peloton,vittvolt/15721-peloton,haojin2/peloton |
aa6cb15c3969e2f711e98c3f3012efbe0679d87e | src/lms7002m/mcu_programs.h | src/lms7002m/mcu_programs.h | #ifndef LMS7_MCU_PROGRAMS_H
#define LMS7_MCU_PROGRAMS_H
#include "LimeSuiteConfig.h"
#include <stdint.h>
#define MCU_PROGRAM_SIZE 16384
#define MCU_ID_DC_IQ_CALIBRATIONS 0x01
#define MCU_ID_CALIBRATIONS_SINGLE_IMAGE 0x05
#define MCU_FUNCTION_CALIBRATE_TX 1
#define MCU_FUNCTION_CALIBRATE_RX 2
#define MCU_FUNCTION_UPDATE_BW 3
#define MCU_FUNCTION_UPDATE_REF_CLK 4
#define MCU_FUNCTION_TUNE_TX_FILTER 5
#define MCU_FUNCTION_TUNE_RX_FILTER 6
#define MCU_FUNCTION_UPDATE_EXT_LOOPBACK_PAIR 9
#define MCU_FUNCTION_CALIBRATE_TX_EXTLOOPB 17
#define MCU_FUNCTION_CALIBRATE_RX_EXTLOOPB 18
#define MCU_FUNCTION_AGC 10
#define MCU_FUNCTION_GET_PROGRAM_ID 255
LIME_API extern const uint8_t mcu_program_lms7_dc_iq_calibration_bin[16384];
#endif
| #ifndef LMS7_MCU_PROGRAMS_H
#define LMS7_MCU_PROGRAMS_H
#include "LimeSuiteConfig.h"
#include <stdint.h>
#define MCU_PROGRAM_SIZE 16384
#define MCU_ID_DC_IQ_CALIBRATIONS 0x01
#define MCU_ID_CALIBRATIONS_SINGLE_IMAGE 0x05
#define MCU_FUNCTION_CALIBRATE_TX 1
#define MCU_FUNCTION_CALIBRATE_RX 2
#define MCU_FUNCTION_UPDATE_BW 3
#define MCU_FUNCTION_UPDATE_REF_CLK 4
#define MCU_FUNCTION_TUNE_RX_FILTER 5
#define MCU_FUNCTION_TUNE_TX_FILTER 6
#define MCU_FUNCTION_UPDATE_EXT_LOOPBACK_PAIR 9
#define MCU_FUNCTION_CALIBRATE_TX_EXTLOOPB 17
#define MCU_FUNCTION_CALIBRATE_RX_EXTLOOPB 18
#define MCU_FUNCTION_AGC 10
#define MCU_FUNCTION_GET_PROGRAM_ID 255
LIME_API extern const uint8_t mcu_program_lms7_dc_iq_calibration_bin[16384];
#endif
| Fix MCU procedure ID definitions. | Fix MCU procedure ID definitions. | C | apache-2.0 | myriadrf/LimeSuite,myriadrf/LimeSuite,myriadrf/LimeSuite,myriadrf/LimeSuite,myriadrf/LimeSuite |
8c78f0ec63f3e16bac1b888dbabf2b6c2d53a1ae | include/openssl/ossl_typ.h | include/openssl/ossl_typ.h | /*
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
/*
* The original <openssl/ossl_typ.h> was renamed to <openssl/types.h>
*
* This header file only exists for compatibility reasons with older
* applications which #include <openssl/ossl_typ.h>.
*/
# include <openssl/types.h>
| Reorganize public header files (part 2) | Reorganize public header files (part 2)
Add an <openssl/ossl_typ.h> compatibility header.
Reviewed-by: Richard Levitte <[email protected]>
(Merged from https://github.com/openssl/openssl/pull/9333)
| C | apache-2.0 | openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl |
|
a703dbcdce9b95fc4a6ae294b03a5a8707b16f4d | test/Driver/response-file-extra-whitespace.c | test/Driver/response-file-extra-whitespace.c | // Check that clang is able to process response files with extra whitespace.
// We generate a dos-style file with \r\n for line endings, and then split
// some joined arguments (like "-x c") across lines to ensure that regular
// clang (not clang-cl) can process it correctly.
//
// RUN: echo -en "-x\r\nc\r\n-DTEST\r\n" > %t.0.txt
// RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT
// SHORT: extern int it_works;
#ifdef TEST
extern int it_works;
#endif
| // Check that clang is able to process response files with extra whitespace.
// We generate a dos-style file with \r\n for line endings, and then split
// some joined arguments (like "-x c") across lines to ensure that regular
// clang (not clang-cl) can process it correctly.
//
// RUN: printf " -x\r\nc\r\n-DTEST\r\n" > %t.0.txt
// RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT
// SHORT: extern int it_works;
#ifdef TEST
extern int it_works;
#endif
| Use printf instead of "echo -ne". | Use printf instead of "echo -ne".
Not all echo commands support "-e".
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@285162 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
83d1847a56a08c8b44dcde86d58bdf9429b0642f | test/test_codegen_retval.c | test/test_codegen_retval.c | // RUN: clang %s -emit-llvm -O0 -o - -S | FileCheck %s
#include <enerc.h>
int main () {
return 0;
}
int fp(int p) {
return p * 2;
// CHECK: ret i32 %mul, !quals !0
}
APPROX int fa(int p) {
return p * 2;
// CHECK: ret i32 %mul, !quals !1
}
int fp2(int p) {
if (p > 2) {
return p * 3;
// CHECK: store i32 %mul, i32* %retval, !quals !0
} else {
return p + 3;
// CHECK: store i32 %add, i32* %retval, !quals !0
}
// CHECK: ret i32 %3, !quals !0
}
APPROX int fa2(int p) {
if (p > 2) {
return p * 3;
// CHECK: store i32 %mul, i32* %retval, !quals !1
} else {
return p + 3;
// CHECK: store i32 %add, i32* %retval, !quals !1
}
// CHECK: ret i32 %3, !quals !1
}
// CHECK: !0 = metadata !{i32 0}
// CHECK: !1 = metadata !{i32 1}
| Test for return value codegen | Test for return value codegen
| C | mit | uwsampa/accept,jck/accept,jck/accept,jck/accept,uwsampa/accept,jck/accept,uwsampa/accept,uwsampa/accept |
|
8418da4072b1579a7b51c13468bc36d0c2335255 | src/condor_ckpt/machdep.h | src/condor_ckpt/machdep.h | #if defined(ULTRIX42)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(ULTRIX43)
extern "C" char *brk( char * );
extern "C" char *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(SUNOS41)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(OSF1)
extern "C" int brk( void * );
# include <sys/types.h>
extern "C" void *sbrk( ssize_t );
typedef void (*SIG_HANDLER)( int );
#elif defined(HPUX9)
extern "C" int brk( const void * );
extern "C" void *sbrk( int );
# include <signal.h>
typedef void (*SIG_HANDLER)( __harg );
#else
# error UNKNOWN PLATFORM
#endif
| #if defined(ULTRIX42)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(ULTRIX43)
extern "C" char *brk( char * );
extern "C" char *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(SUNOS41)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)();
#elif defined(OSF1)
extern "C" int brk( void * );
# include <sys/types.h>
extern "C" void *sbrk( ssize_t );
typedef void (*SIG_HANDLER)( int );
#elif defined(HPUX9)
extern "C" int brk( const void * );
extern "C" void *sbrk( int );
# include <signal.h>
typedef void (*SIG_HANDLER)( __harg );
#elif defined(AIX32)
extern "C" int brk( void * );
extern "C" void *sbrk( int );
typedef void (*SIG_HANDLER)( int );
#else
# error UNKNOWN PLATFORM
#endif
| Add definitions for AIX 3.2. | Add definitions for AIX 3.2.
| C | apache-2.0 | bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,clalancette/condor-dcloud,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/condor,djw8605/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud |
84cfb518f0b28578c264ee27f76c9c4003c12040 | windows.h | windows.h | /*
This is part of pyahocorasick Python module.
Windows declarations
Author : Wojciech Muła, [email protected]
WWW : http://0x80.pl
License : BSD-3-Clause (see LICENSE)
*/
#ifndef PYAHCORASICK_WINDOWS_H__
#define PYAHCORASICK_WINDOWS_H__
typedef unsigned char uint8_t;
typedef short unsigned int uint16_t;
#define PY_OBJECT_HEAD_INIT PyVarObject_HEAD_INIT(NULL, 0)
#endif
| /*
This is part of pyahocorasick Python module.
Windows declarations
Author : Wojciech Muła, [email protected]
WWW : http://0x80.pl
License : BSD-3-Clause (see LICENSE)
*/
#ifndef PYAHCORASICK_WINDOWS_H__
#define PYAHCORASICK_WINDOWS_H__
typedef unsigned char uint8_t;
typedef short unsigned int uint16_t;
typedef unsigned int uint32_t;
#define PY_OBJECT_HEAD_INIT PyVarObject_HEAD_INIT(NULL, 0)
#endif
| Add custom def for uint32_t | Add custom def for uint32_t
| C | bsd-3-clause | pombredanne/pyahocorasick,WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,woakesd/pyahocorasick,pombredanne/pyahocorasick,woakesd/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick |
55e3f242fddf4256c96878167d432e176b9650c8 | source/common/math.h | source/common/math.h | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef MATH_H
#define MATH_H
namespace Common {
template<typename T>
inline T Min(const T& a, const T& b) {
return a < b ? a : b;
}
template<typename T>
inline T Max(const T& a, const T& b) {
return a > b ? a : b;
}
template<typename T>
inline T Lerp(const T& a, const T& b, float t) {
return a + (b - a)*t;
}
template<typename T>
inline T Clamp(const T& x, const T& low, const T& high) {
return x < low ? low : (x > high ? high : x);
}
} // End of namespace Common
#endif // MATHHELPER_H | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef MATH_H
#define MATH_H
#include "common/halfling_sys.h"
namespace Common {
template<typename T>
inline T Min(const T& a, const T& b) {
return a < b ? a : b;
}
template<typename T>
inline T Max(const T& a, const T& b) {
return a > b ? a : b;
}
template<typename T>
inline T Lerp(const T& a, const T& b, float t) {
return a + (b - a)*t;
}
template<typename T>
inline T Clamp(const T& x, const T& low, const T& high) {
return x < low ? low : (x > high ? high : x);
}
// Returns random float in [0, 1).
static float RandF() {
return (float)(rand()) / (float)RAND_MAX;
}
// Returns random float in [a, b).
static float RandF(float a, float b) {
return a + RandF()*(b - a);
}
} // End of namespace Common
#endif // MATHHELPER_H | Create helper functions for creating random floats | COMMON: Create helper functions for creating random floats
| C | apache-2.0 | RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject |
e95f31e37ff53c7030e335d58c484e30514a4805 | libs/minzip/inline_magic.h | libs/minzip/inline_magic.h | /*
* Copyright (C) 2007 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 MINZIP_INLINE_MAGIC_H_
#define MINZIP_INLINE_MAGIC_H_
#ifndef MINZIP_GENERATE_INLINES
#define INLINE extern __inline__
#else
#define INLINE
#endif
#endif // MINZIP_INLINE_MAGIC_H_
| /*
* Copyright (C) 2007 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 MINZIP_INLINE_MAGIC_H_
#define MINZIP_INLINE_MAGIC_H_
#ifndef MINZIP_GENERATE_INLINES
#define INLINE extern inline __attribute((__gnu_inline__))
#else
#define INLINE
#endif
#endif // MINZIP_INLINE_MAGIC_H_
| Fix multiple defined symbol errors | Fix multiple defined symbol errors
Use of __inline__ by projects in bootable/* was causing problems with
clang. Following the BKM and replaced use of __inline__ with
__attribute((__gnu_inline)).
Change-Id: If4ccfded685bb2c9d9c23c9b92ee052208399ef0
Author: Edwin Vane <[email protected]>
Reviewed-by: Kevin P Schoedel <[email protected]>
| C | apache-2.0 | M1cha/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,amarullz/libaroma,M1cha/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,ProjectOpenCannibal/libaroma,amarullz/libaroma,amarullz/libaroma,ProjectOpenCannibal/libaroma,M1cha/libaroma,amarullz/libaroma,amarullz/libaroma |
3ddd22e1ade2716f96439e7d1e3b044217c44b2a | src/adts/adts_list.h | src/adts/adts_list.h |
#ifndef _H_ADTS_LIST
#define _H_ADTS_LIST
#include <string.h>
#include <stdbool.h>
#include <inttypes.h>
/**
**************************************************************************
* \details
*
**************************************************************************
*/
#define ADTS_LIST_BYTES (32)
#define ADTS_LIST_ELEM_BYTES (32)
/**
**************************************************************************
* \details
*
**************************************************************************
*/
typedef struct {
char reserved[ ADTS_LIST_BYTES ];
} adts_list_t;
typedef struct {
char reserved[ ADTS_LIST_ELEM_BYTES ];
} adts_list_elem_t;
void
utest_adts_list( void );
#endif /* _H_ADTS_LIST */
|
#ifndef _H_ADTS_LIST
#define _H_ADTS_LIST
#include <string.h>
#include <stdbool.h>
#include <inttypes.h>
/**
**************************************************************************
* \details
*
**************************************************************************
*/
#define ADTS_LIST_BYTES (32)
#define ADTS_LIST_ELEM_BYTES (32)
/**
**************************************************************************
* \details
*
**************************************************************************
*/
typedef struct {
const char reserved[ ADTS_LIST_BYTES ];
} adts_list_t;
typedef struct {
const char reserved[ ADTS_LIST_ELEM_BYTES ];
} adts_list_elem_t;
void
utest_adts_list( void );
#endif /* _H_ADTS_LIST */
| Make list.h non-modifiabe in ADT | Make list.h non-modifiabe in ADT
| C | mit | 78613/sample,78613/sample |
c3900001475664339b0d3c5d63576c190e432d27 | src/condor_c++_util/url_condor.h | src/condor_c++_util/url_condor.h | #if !defined(_URL_CONDOR_H)
#define _URL_CONDOR_H
#include <sys/types.h>
#include <limits.h>
#include "machdep.h"
typedef int (*open_function_type)(const char *, int, size_t);
class URLProtocol {
public:
URLProtocol(char *protocol_key, char *protocol_name,
open_function_type protocol_open_func);
/* int (*protocol_open_func)(const char *, int, size_t)); */
~URLProtocol();
char *get_key() { return key; }
char *get_name() { return name; }
int call_open_func(const char *fname, int flags, size_t n_bytes)
{ return open_func( fname, flags, n_bytes); }
URLProtocol *get_next() { return next; }
void init() { }
private:
char *key;
char *name;
open_function_type open_func;
/* int (*open_func)(const char *, int, size_t); */
URLProtocol *next;
};
URLProtocol *FindProtocolByKey(const char *key);
extern "C" int open_url( const char *name, int flags, size_t n_bytes );
#endif
| #if !defined(_URL_CONDOR_H)
#define _URL_CONDOR_H
#include <sys/types.h>
#include <limits.h>
typedef int (*open_function_type)(const char *, int, size_t);
class URLProtocol {
public:
URLProtocol(char *protocol_key, char *protocol_name,
open_function_type protocol_open_func);
/* int (*protocol_open_func)(const char *, int, size_t)); */
~URLProtocol();
char *get_key() { return key; }
char *get_name() { return name; }
int call_open_func(const char *fname, int flags, size_t n_bytes)
{ return open_func( fname, flags, n_bytes); }
URLProtocol *get_next() { return next; }
void init() { }
private:
char *key;
char *name;
open_function_type open_func;
/* int (*open_func)(const char *, int, size_t); */
URLProtocol *next;
};
URLProtocol *FindProtocolByKey(const char *key);
extern "C" int open_url( const char *name, int flags, size_t n_bytes );
#endif
| Remove the include of machdep.h which didn't need to be there, and didn't work on Solaris. | Remove the include of machdep.h which didn't need to be there, and didn't
work on Solaris.
| C | apache-2.0 | htcondor/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/condor,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor |
94a124ba3e39903511d1a5fb4dc5a50b0e9c1f1f | stromx/runtime/Locale.h | stromx/runtime/Locale.h | /*
* Copyright 2014 Matthias Fuchs
*
* 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 STROMX_RUNTIME_LOCALE_H
#define STROMX_RUNTIME_LOCALE_H
#include <locale>
#define L_(id) stromx::runtime::Locale::gettext(id, locale)
namespace stromx
{
namespace runtime
{
extern std::locale locale;
class Locale
{
public:
static std::string gettext(const char* const id, const std::locale & locale);
static std::locale generate(const char* const path, const char* const domain);
};
}
}
#endif // STROMX_RUNTIME_LOCALE_H
| /*
* Copyright 2014 Matthias Fuchs
*
* 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 STROMX_RUNTIME_LOCALE_H
#define STROMX_RUNTIME_LOCALE_H
#include <locale>
#include "stromx/runtime/Config.h"
#define L_(id) stromx::runtime::Locale::gettext(id, locale)
namespace stromx
{
namespace runtime
{
extern std::locale locale;
class STROMX_RUNTIME_API Locale
{
public:
static std::string gettext(const char* const id, const std::locale & locale);
static std::locale generate(const char* const path, const char* const domain);
};
}
}
#endif // STROMX_RUNTIME_LOCALE_H
| Make runtime locale API available on windows | Make runtime locale API available on windows
| C | apache-2.0 | sparsebase/stromx,uboot/stromx,uboot/stromx,sparsebase/stromx |
26c08aecc5388ac1fd85ba877538b7e286e50751 | src/pdbfile.h | src/pdbfile.h | /**
* Declarations of data structures in PDB files.
*
* These are, for the most part, undocumented. At the time of this writing there
* is no detailed documentation on the PDB file format. Microsoft has open
* sourced the PDB file format:
*
* https://github.com/Microsoft/microsoft-pdb
*
* This is among the worst professional code I've ever seen. It may as well be
* obfuscated. There is no documentation and the code is horribly crufty and
* difficult to read. It is a wonder how anyone at Microsoft is able to maintain
* that obfuscated mess.
*
* Since Microsoft hasn't done it, I'll do my best to document the format here
* as I decrypt it.
*
* Common terminology in the microsoft-pdb repository:
*
* - PN = Page number
* - UPN = Universal page number
* - CB = Count of bytes
* - FPM = Free page map
*/
#pragma once
/**
* The PDB file starts with the MultiStream File (MSF) header. There are two
* types of MSF headers:
*
* 1. The PDB 2.0 format.
* 2. The MSF 7.0 format.
*
* These are distinguished by a magic string, but we only care about the second
* format. Thus, we will ignore the existence of the first because it is a very
* old format.
*/
const size_t kMaxDirPages = 73;
const size_t kMaxPageSize = 0x1000;
const char kMsfHeaderMagic[] = "Microsoft C/C++ MSF 7.00\r\n\x1a\x44\x53\0\0";
struct MsfHeader {
char magic[32]; // version string
uint32_t pageSize; // page size
uint32_t freePageMap; // page index of valid FPM
uint32_t pageCount; // Number of pages
uint32_t directorySize; // Size of the directory in bytes
uint32_t reserved;
uint32_t pages[kMaxDirPages];
};
| Add initial PDB file format | Add initial PDB file format
| C | mit | jasonwhite/pepatch,jasonwhite/pepatch,jasonwhite/pepatch |
|
4e06d09835ac8baa578ba1f0ecff0c9e527a1ee5 | src/rebootd.c | src/rebootd.c | #include <wiringPi.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <sys/reboot.h>
#include <stdio.h>
void gpio4Callback(void) {
sync();
reboot(RB_AUTOBOOT);
}
int main(){
sigset_t set;
int sig;
int *sigptr = &sig;
int ret_val;
sigemptyset(&set);
sigaddset(&set, SIGQUIT);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGTERM);
sigprocmask( SIG_BLOCK, &set, NULL );
wiringPiSetup () ;
wiringPiISR (4, INT_EDGE_FALLING, &gpio4Callback) ;
ret_val = sigwait(&set,sigptr);
if(ret_val == -1)
perror("sigwait failed\n");
return 0;
}
| Add reboot programm for demon | Add reboot programm for demon
| C | mit | Kolkir/orange-pi,Kolkir/orange-pi,Kolkir/orange-pi,Kolkir/orange-pi |
|
c09b7287e3768a54a51dd1d64bf949ba7e2e24e4 | include/clang/Basic/Stack.h | include/clang/Basic/Stack.h | //===--- Stack.h - Utilities for dealing with stack space -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Defines utilities for dealing with stack allocation and stack space.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_BASIC_STACK_H
#define LLVM_CLANG_BASIC_STACK_H
namespace clang {
/// The amount of stack space that Clang would like to be provided with.
/// If less than this much is available, we may be unable to reach our
/// template instantiation depth limit and other similar limits.
constexpr size_t DesiredStackSize = 8 << 20;
} // end namespace clang
#endif // LLVM_CLANG_BASIC_STACK_H
| //===--- Stack.h - Utilities for dealing with stack space -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Defines utilities for dealing with stack allocation and stack space.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_BASIC_STACK_H
#define LLVM_CLANG_BASIC_STACK_H
#include <cstddef>
namespace clang {
/// The amount of stack space that Clang would like to be provided with.
/// If less than this much is available, we may be unable to reach our
/// template instantiation depth limit and other similar limits.
constexpr size_t DesiredStackSize = 8 << 20;
} // end namespace clang
#endif // LLVM_CLANG_BASIC_STACK_H
| Add missing include for size_t | Add missing include for size_t
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@336261 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
7bc5ce4a79c61ab7238b188f9af48f41ff1392f9 | fuzz/fuzzer.h | fuzz/fuzzer.h | /*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 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
* https://www.openssl.org/source/license.html
* or in the file LICENSE in the source distribution.
*/
#include <stdint.h> /* for uint8_t */
#include <stddef.h> /* for size_t */
int FuzzerTestOneInput(const uint8_t *buf, size_t len);
int FuzzerInitialize(int *argc, char ***argv);
void FuzzerCleanup(void);
void FuzzerSetRand(void);
void FuzzerClearRand(void);
| /*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 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
* https://www.openssl.org/source/license.html
* or in the file LICENSE in the source distribution.
*/
#include <stddef.h> /* for size_t */
#include <openssl/e_os2.h> /* for uint8_t */
int FuzzerTestOneInput(const uint8_t *buf, size_t len);
int FuzzerInitialize(int *argc, char ***argv);
void FuzzerCleanup(void);
void FuzzerSetRand(void);
void FuzzerClearRand(void);
| Use <openssl/e_os2.h> rather than <stdint.h> | Use <openssl/e_os2.h> rather than <stdint.h>
<stdint.h> is C99, which means that on older compiler, it can't be included.
We have code in <openssl/e_os2.h> that compensates.
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from https://github.com/openssl/openssl/pull/19697)
| C | apache-2.0 | openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl |
b83bb1cc7a748158a3d969d09262f5016bd3dee5 | reboot.c | reboot.c | #include "defs.h"
#include "xlat/bootflags1.h"
#include "xlat/bootflags2.h"
#include "xlat/bootflags3.h"
SYS_FUNC(reboot)
{
printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
tprints(", ");
printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
tprints(", ");
printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
if (tcp->u_arg[2] == (long) LINUX_REBOOT_CMD_RESTART2) {
tprints(", ");
printstr(tcp, tcp->u_arg[3], -1);
}
return RVAL_DECODED;
}
| #include "defs.h"
#include "xlat/bootflags1.h"
#include "xlat/bootflags2.h"
#include "xlat/bootflags3.h"
SYS_FUNC(reboot)
{
const unsigned int magic1 = tcp->u_arg[0];
const unsigned int magic2 = tcp->u_arg[1];
const unsigned int cmd = tcp->u_arg[2];
printflags(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???");
tprints(", ");
printflags(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???");
tprints(", ");
printflags(bootflags3, cmd, "LINUX_REBOOT_CMD_???");
if (cmd == LINUX_REBOOT_CMD_RESTART2) {
tprints(", ");
printstr(tcp, tcp->u_arg[3], -1);
}
return RVAL_DECODED;
}
| Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument | Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument
* reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int.
| C | bsd-3-clause | Saruta/strace,cuviper/strace,cuviper/strace,cuviper/strace,cuviper/strace,Saruta/strace,Saruta/strace,Saruta/strace,Saruta/strace,cuviper/strace |
09f760a42b52975948e9c92acb3506295a3e783d | tools/minigame/minigame.c | tools/minigame/minigame.c | #include <mruby.h>
#include <mruby/compile.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
mrb_state *mrb;
mrbc_context *c;
mrb_value v;
FILE *fp;
fp = fopen("init_minigame.rb", "rb");
if (fp == NULL) {
fputs("Couldn't load 'init_minigame.rb'", stderr);
return EXIT_FAILURE;
}
mrb = mrb_open();
if (mrb == NULL) {
fputs("Invalid mrb_state, exiting mruby", stderr);
return EXIT_FAILURE;
}
c = mrbc_context_new(mrb);
v = mrb_load_file_cxt(mrb, fp, c);
fclose(fp);
mrbc_context_free(mrb, c);
if (mrb->exc && !mrb_undef_p(v)) mrb_print_error(mrb);
return EXIT_SUCCESS;
}
| #include <mruby.h>
#include <mruby/compile.h>
#include <windows.h>
#include <stdlib.h>
#include <stdlib.h>
#ifdef _WIN32
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
#else
int
main(int argc, char **argv)
#endif
{
mrb_state *mrb;
mrbc_context *c;
mrb_value v;
FILE *fp;
fp = fopen("init_minigame.rb", "rb");
if (fp == NULL) {
fputs("Couldn't load 'init_minigame.rb'", stderr);
return EXIT_FAILURE;
}
mrb = mrb_open();
if (mrb == NULL) {
fputs("Invalid mrb_state, exiting mruby", stderr);
return EXIT_FAILURE;
}
c = mrbc_context_new(mrb);
v = mrb_load_file_cxt(mrb, fp, c);
fclose(fp);
mrbc_context_free(mrb, c);
if (mrb->exc && !mrb_undef_p(v)) mrb_print_error(mrb);
return EXIT_SUCCESS;
}
| Add WinMain for windows platform | Add WinMain for windows platform
| C | mit | bggd/mruby-minigame,bggd/mruby-minigame |
57e4785123d830cfaa827474485596c9943cd2ae | test/CFrontend/2007-08-22-CTTZ.c | test/CFrontend/2007-08-22-CTTZ.c | // RUN: %llvmgcc -O2 -S -o - -emit-llvm %s | grep {llvm.cttz.i64} | count 1
// RUN: %llvmgcc -O2 -S -o - -emit-llvm %s | not grep {lshr}
int bork(unsigned long long x) {
return __builtin_ctzll(x);
}
| // RUN: %llvmgcc -O2 -S -o - %s | grep {llvm.cttz.i64} | count 2
// RUN: %llvmgcc -O2 -S -o - %s | not grep {lshr}
int bork(unsigned long long x) {
return __builtin_ctzll(x);
}
| Fix this testcase: there are two matches for llvm.cttz.i64 because of the declaration of the intrinsic. Also, emit-llvm is automatic and doesn't need to be specified. | Fix this testcase: there are two matches for
llvm.cttz.i64 because of the declaration of
the intrinsic. Also, emit-llvm is automatic
and doesn't need to be specified.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@41326 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm |
e1749156066a17bc43f28be7ccaefba33635f8ba | test/CodeGen/relax.c | test/CodeGen/relax.c | // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations %s -mrelocation-model pic -o %t
// RUN: llvm-readobj -r %t | FileCheck %s
// CHECK: R_X86_64_REX_GOTPCRELX foo
extern int foo;
int *f(void) {
return &foo;
}
| // REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations %s -mrelocation-model pic -o %t
// RUN: llvm-readobj -r %t | FileCheck %s
// CHECK: R_X86_64_REX_GOTPCRELX foo
extern int foo;
int *f(void) {
return &foo;
}
| Mark test as requiring x86-registered-target. | Mark test as requiring x86-registered-target.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@271163 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
ebfc10557b1be7f5c4bf320437511f5a1ae5695c | tests/regression/34-congruence/01-simple.c | tests/regression/34-congruence/01-simple.c | //PARAM: --enable ana.int.congruence --disable ana.int.def_exc --disable ana.int.enums
int main() {
int a = 1;
int b = 2;
int c = 3;
int d = 4;
int e = 0;
while (d < 9) {
b = 2 * a;
d = d + 4;
e = e - 4 * a;
a = b - a;
c = e + d;
}
a = d / 2;
b = d % 2;
assert (c == 4); // UNKNOWN!
assert (d == 12); // UNKNOWN
assert (a == 6); // UNKNOWN
assert (b == 0);
return 0;
}
| Add simple regression test for congruence domain | Add simple regression test for congruence domain
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
6bd2207f5562ce6be8bbf18ec5000580f11d6cba | src/malloc_threadx.c | src/malloc_threadx.c | #include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <threadx/tx_api.h>
#pragma mark - Definitions -
/*
* In this example, I am using the compiler's builtin atomic compare and swap
* Routine. This will provide atomic access to swapping the malloc pointer,
* and only one function will initialize the memory pool.
*/
#define atomic_compare_and_swap __sync_val_compare_and_swap
#pragma mark - Prototypes -
#pragma mark - Declarations -
// ThreadX internal memory pool stucture
static TX_BYTE_POOL malloc_pool_ = {0};
/*
* Flag that is used in do_malloc() to cause competing threads to wait until
* initialization is completed before allocating memory.
*/
volatile static bool initialized_ = false;
#pragma mark - Private Functions -
/*
* init_malloc must be called before memory allocation calls are made
* This sets up a byte pool for the heap using the defined HEAP_START and HEAP_END macros
* Size is passed to do_malloc and allocated to the caller
*/
void malloc_addblock(void *addr, size_t size)
{
assert(addr && (size > 0));
uint8_t r;
/**
* This is ThreadX's API to create a byte pool using a memory block.
* We are essentially just wrapping ThreadX APIs into a simpler form
*/
r = tx_byte_pool_create(&malloc_pool_, "Heap Memory Pool",
addr,
size);
assert(r == TX_SUCCESS);
//Signal to any threads waiting on do_malloc that we are done
initialized_ = true;
}
void * malloc(size_t size)
{
void * ptr = NULL;
/**
* Since multiple threads could be racing to malloc, if we lost the race
* we need to make sure the ThreadX pool has been created before we
* try to allocate memory, or there will be an error
*/
while(!initialized_)
{
tx_thread_sleep(1);
}
if(size > 0)
{
// We simply wrap the threadX call into a standard form
uint8_t r = tx_byte_allocate(&malloc_pool_, &ptr, size, TX_WAIT_FOREVER);
//I add the string to provide a more helpful error output. It's value is always true.
assert(r == TX_SUCCESS && "malloc failed");
} //else NULL if there was an error
return ptr;
}
void free(void * ptr)
{
//free should NEVER be called before malloc is init'd
assert(initialized_);
if(ptr) {
//We simply wrap the threadX call into a standard form
uint8_t r = tx_byte_release(ptr);
ptr = NULL;
assert(r == TX_SUCCESS);
}
}
| Add a ThreadX implementation of malloc | Add a ThreadX implementation of malloc
| C | mit | embeddedartistry/libmalloc |
|
2bc4e02f68c599d6a7137e52f6b3080713d80b64 | include/kotlib/compat/c99.h | include/kotlib/compat/c99.h | /*!
* @file c99.h
* @brief Provide C99 compatibility
* @author koturn
*/
#ifndef KOTLIB_COMPAT_C99_H
#define KOTLIB_COMPAT_C99_H
#include "defsupport.h"
#if defined(_MSC_VER) || KOTLIB_COMPAT_IS_SUPPORT_C99
# define __func__ __FUNCTION__
#endif
#ifndef __cplusplus
# if defined(_MSC_VER)
# define inline __inline
# define __inline__ __inline
# elif !defined(__GNUC__) && KOTLIB_COMPAT_IS_SUPPORT_C99
# define inline
# define __inline
# endif
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define restrict __restrict
# define __restrict__ __restrict
#elif !KOTLIB_COMPAT_IS_SUPPORT_C99
# if defined(__GNUC__)
# define restrict __restrict
# else
# define restrict
# define __restrict
# define __restrict__
# endif
#endif
#endif // KOTLIB_COMPAT_C99_H
| Add header to provide C99 compatibility | Add header to provide C99 compatibility
| C | mit | koturn/kotlib,koturn/kotlib |
|
f9804666229069cf31d0a255fce07f24097a03b1 | pkg/gridalt/gridalt_mapping.h | pkg/gridalt/gridalt_mapping.h | c Alternate grid Mapping Common
c ------------------------------
common /gridalt_mapping/ nlperdyn,dpphys0,dpphys
integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy)
_RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
_RL dpphys(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
| c Alternate grid Mapping Common
c ------------------------------
common /gridalt_mapping/ nlperdyn,dpphys0,dpphys,
. dxfalt,dyfalt,drfalt
integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy)
_RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
_RL dpphys(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
_RL dxfalt,dyfalt,drfalt
| Add terms for more general mapping (other than just vertical for fizhi) | Add terms for more general mapping (other than just vertical for fizhi)
| C | mit | altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h |
f22dcf3b7c3f0c49724cb3bb097cef56543b9523 | 2015-2016/G/21/04/square.c | 2015-2016/G/21/04/square.c | #include <stdio.h>
int isMagic(int squere[3][3])
{
int currSum = 0;
int sum = squere[0][0]+squere[0][1]+squere[0][2];
int i = 0;
for(i=1;i<3;i++)
{
int j;
for(j=0;j<3;j++)
{
currSum+=squere[i][j];
}
if(currSum != sum)
{
return 0;
}
currSum = 0;
}
currSum = 0;
for(i=0;i<3;i++)
{
currSum += squere[i][i];
}
if(currSum!=sum)
{
return 0;
}
currSum = 0;
int j;
for(i=0,j=2;i<3;i++,j--)
{
currSum += squere[i][j];
}
if(currSum!=sum)
{
return 0;
}
return 1;
}
int main()
{
int squere[3][3];
int i = 0;
for(i=0;i<3;i++)
{
int j = 0;
for(j=0;j<3;j++)
{
scanf("%d",&squere[i][j]);
}
}
if(isMagic(squere))
{
printf("Magicheki e\n");
}
else
{
printf("ne e magicheski\n");
}
}
| #include <stdio.h>
int isMagic(int n,int squere[n][n])
{
int currSum = 0;
int sum = 0;
int i = 0;
for(i=0;i<n;i++)
{
int j;
for(j=0;j<n;j++)
{
currSum+=squere[i][j];
}
if(i==0)
{
sum = currSum;
}
if(currSum != sum)
{
return 0;
}
currSum = 0;
}
currSum = 0;
for(i=0;i<n;i++)
{
currSum += squere[i][i];
}
if(currSum!=sum)
{
return 0;
}
currSum = 0;
int j;
for(i=0,j=n-1;i<n;i++,j--)
{
currSum += squere[i][j];
}
if(currSum!=sum)
{
return 0;
}
return 1;
}
int main()
{
int n;
scanf("%d",&n);
int squere[n][n];
int i = 0;
for(i=0;i<n;i++)
{
int j = 0;
for(j=0;j<n;j++)
{
scanf("%d",&squere[i][j]);
}
}
if(isMagic(n,squere))
{
printf("Magicheki e\n");
}
else
{
printf("ne e magicheski\n");
}
}
| Make squere.c to work with nXn | Make squere.c to work with nXn
| C | mit | AlexAndreev/po-homework,Georgigt23/po-homework,kriss960/po-homework,VVurbanov/po-homework,ivanmilevtues/po-homework,karakonjel/po-homework,vincho7012/po-homework,Verbo1806/po-homework |
83d192b1f1a6a92dea158f0ff8cbacff94926b17 | include/spdlog/sinks/sink.h | include/spdlog/sinks/sink.h | //
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#pragma once
#include <spdlog/details/log_msg.h>
namespace spdlog
{
namespace sinks
{
class sink
{
public:
sink(): _level( level::trace ) {}
virtual ~sink() {}
virtual void log(const details::log_msg& msg) = 0;
virtual void flush() = 0;
bool should_log(level::level_enum msg_level) const;
void set_level(level::level_enum log_level);
level::level_enum level() const;
private:
level_t _level;
};
inline bool sink::should_log(level::level_enum msg_level) const
{
return msg_level >= _level.load(std::memory_order_relaxed);
}
inline void sink::set_level(level::level_enum log_level)
{
_level.store(log_level);
}
inline level::level_enum sink::level() const
{
return static_cast<spdlog::level::level_enum>(_level.load(std::memory_order_relaxed));
}
}
}
| //
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#pragma once
#include <spdlog/details/log_msg.h>
namespace spdlog
{
namespace sinks
{
class sink
{
public:
sink() { _level = (int)level::trace; }
virtual ~sink() {}
virtual void log(const details::log_msg& msg) = 0;
virtual void flush() = 0;
bool should_log(level::level_enum msg_level) const;
void set_level(level::level_enum log_level);
level::level_enum level() const;
private:
level_t _level;
};
inline bool sink::should_log(level::level_enum msg_level) const
{
return msg_level >= _level.load(std::memory_order_relaxed);
}
inline void sink::set_level(level::level_enum log_level)
{
_level.store(log_level);
}
inline level::level_enum sink::level() const
{
return static_cast<spdlog::level::level_enum>(_level.load(std::memory_order_relaxed));
}
}
}
| Fix compilation error C2664 on VS2013 | Fix compilation error C2664 on VS2013
No converting constructor
| C | mit | icylord/spdlog,hunter-packages/spdlog,hunter-packages/spdlog,COMBINE-lab/spdlog,mihadyuk/spdlog,mihadyuk/spdlog,icylord/spdlog,godbyk/spdlog,godbyk/spdlog,mihadyuk/spdlog,icylord/spdlog,COMBINE-lab/spdlog,godbyk/spdlog,hunter-packages/spdlog,COMBINE-lab/spdlog |
f0f64f7df90f281af279ec66c1432b2538ddcb77 | test2/parsing/sizeof_expr.c | test2/parsing/sizeof_expr.c | // RUN: %ocheck 0 %s
typedef struct
{
int x;
} A;
main()
{
int sz = sizeof((A *)0)->x;
if(sz != sizeof(int))
abort();
return 0;
}
| // RUN: %ocheck 0 %s
typedef struct
{
int x;
} A;
main()
{
int sz = sizeof((A *)0)->x;
if(sz != sizeof(int))
abort();
int ar[10];
sz = sizeof(ar)[0];
if(sz != sizeof(int))
abort();
return 0;
}
| Add array size check to sizeof() test | Add array size check to sizeof() test
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
ad8d0dbeae32fb2d5eae1296e9bee2baadb3db66 | pebblebike/src/screen_map.h | pebblebike/src/screen_map.h | #ifndef SCREEN_MAP_H
#define SCREEN_MAP_H
// in meters/pixels
#define MAP_SCALE_MIN 250
#define MAP_SCALE_MAX 64000
#define MAP_SCALE_INI (MAP_SCALE_MIN*8)
#define MAP_VSIZE_X 4000
#define MAP_VSIZE_Y 4000
#define XINI MAP_VSIZE_X/2
#define YINI MAP_VSIZE_Y/2
// external variables (debug purpose)
extern int map_scale;
extern int nb_points;
void screen_map_zoom_in(int factor);
void screen_map_zoom_out(int factor);
void screen_map_update_location();
void screen_map_layer_init(Window* window);
void screen_map_layer_deinit();
void screen_map_update_map(bool force_recenter);
#endif // SCREEN_MAP_H
| #ifndef SCREEN_MAP_H
#define SCREEN_MAP_H
// at level 7 (MAP_SCALE=16000), the screen width is approximatively 14.5km => 100m/px)
// level 1: MAP_SCALE=250 => 1.5m/px - screen 225m
// level 8: MAP_SCALE_MAX 32000 => 200m/px - screen: 29km
#define MAP_SCALE_MIN 250
#define MAP_SCALE_MAX 32000
//2000=MAP_SCALE_MIN * 8 => level 4 (250-500-1000-2000)
#define MAP_SCALE_INI 2000
#define MAP_VSIZE_X 4000
#define MAP_VSIZE_Y 4000
#define XINI MAP_VSIZE_X/2
#define YINI MAP_VSIZE_Y/2
// external variables (debug purpose)
extern int map_scale;
extern int nb_points;
void screen_map_zoom_in(int factor);
void screen_map_zoom_out(int factor);
void screen_map_update_location();
void screen_map_layer_init(Window* window);
void screen_map_layer_deinit();
void screen_map_update_map(bool force_recenter);
#endif // SCREEN_MAP_H
| Add a zoom level + comments | Add a zoom level + comments
| C | mit | jay3/Ventoo-PebbleWatchFace,pebble-bike/PebbleBike-PebbleWatchFace,team-mount-ventoux/PebbleVentoo-WatchFace,team-mount-ventoux/PebbleVentoo-WatchFace,ventoo-bike/Ventoo-PebbleWatchFace,ventoo-bike/Ventoo-PebbleWatchFace,team-mount-ventoux/PebbleVentoo-WatchFace,jay3/PebbleBike-PebbleWatchFace,team-mount-ventoux/PebbleVentoo-WatchFace,pebble-bike/PebbleBike-PebbleWatchFace,jay3/PebbleBike-PebbleWatchFace,team-mount-ventoux/PebbleVentoo-WatchFace,jay3/PebbleBike-PebbleWatchFace,jay3/Ventoo-PebbleWatchFace,ventoo-bike/Ventoo-PebbleWatchFace,ventoo-bike/Ventoo-PebbleWatchFace,jay3/Ventoo-PebbleWatchFace,jay3/Ventoo-PebbleWatchFace,ventoo-bike/Ventoo-PebbleWatchFace,jay3/Ventoo-PebbleWatchFace,pebble-bike/PebbleBike-PebbleWatchFace |
3002c25d88f54003ea38cdb0d6091b4a8b593d3e | meta/inc/TVirtualIsAProxy.h | meta/inc/TVirtualIsAProxy.h | // @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.1 2005/05/27 16:42:58 pcanal Exp $
// Author: Markus Frank 20/05/2005
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVirtualIsAProxy
#define ROOT_TVirtualIsAProxy
//////////////////////////////////////////////////////////////////////////
// //
// TClass //
// //
// Virtual IsAProxy base class. //
// //
//////////////////////////////////////////////////////////////////////////
class TVirtualIsAProxy {
public:
virtual ~TVirtualIsAProxy() { }
virtual void SetClass(TClass *cl) = 0;
virtual TClass* operator()(const void *obj) = 0;
};
#endif // ROOT_TVirtualIsAProxy
| // @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.2 2005/06/08 18:51:36 rdm Exp $
// Author: Markus Frank 20/05/2005
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVirtualIsAProxy
#define ROOT_TVirtualIsAProxy
//////////////////////////////////////////////////////////////////////////
// //
// TClass //
// //
// Virtual IsAProxy base class. //
// //
//////////////////////////////////////////////////////////////////////////
class TClass;
class TVirtualIsAProxy {
public:
virtual ~TVirtualIsAProxy() { }
virtual void SetClass(TClass *cl) = 0;
virtual TClass* operator()(const void *obj) = 0;
};
#endif // ROOT_TVirtualIsAProxy
| Add the necessary includes and forward declarations such that the class can be compiled independently. | Add the necessary includes and forward declarations such that the class can be compiled independently.
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@19581 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | abhinavmoudgil95/root,veprbl/root,alexschlueter/cern-root,simonpf/root,sawenzel/root,bbockelm/root,sbinet/cxx-root,abhinavmoudgil95/root,agarciamontoro/root,georgtroska/root,zzxuanyuan/root-compressor-dummy,veprbl/root,gbitzes/root,simonpf/root,strykejern/TTreeReader,agarciamontoro/root,mkret2/root,smarinac/root,bbockelm/root,root-mirror/root,pspe/root,krafczyk/root,gbitzes/root,0x0all/ROOT,mattkretz/root,dfunke/root,veprbl/root,vukasinmilosevic/root,lgiommi/root,mkret2/root,perovic/root,arch1tect0r/root,krafczyk/root,ffurano/root5,alexschlueter/cern-root,sawenzel/root,evgeny-boger/root,bbockelm/root,gganis/root,root-mirror/root,satyarth934/root,beniz/root,abhinavmoudgil95/root,vukasinmilosevic/root,karies/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,karies/root,lgiommi/root,nilqed/root,gbitzes/root,gganis/root,dfunke/root,cxx-hep/root-cern,omazapa/root,beniz/root,omazapa/root-old,strykejern/TTreeReader,tc3t/qoot,agarciamontoro/root,alexschlueter/cern-root,tc3t/qoot,cxx-hep/root-cern,BerserkerTroll/root,root-mirror/root,Duraznos/root,perovic/root,gbitzes/root,krafczyk/root,vukasinmilosevic/root,esakellari/my_root_for_test,evgeny-boger/root,dfunke/root,sirinath/root,arch1tect0r/root,nilqed/root,sbinet/cxx-root,lgiommi/root,sbinet/cxx-root,arch1tect0r/root,strykejern/TTreeReader,gganis/root,esakellari/root,kirbyherm/root-r-tools,Y--/root,zzxuanyuan/root,CristinaCristescu/root,pspe/root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,olifre/root,sirinath/root,omazapa/root,evgeny-boger/root,davidlt/root,abhinavmoudgil95/root,sawenzel/root,root-mirror/root,Duraznos/root,bbockelm/root,Y--/root,abhinavmoudgil95/root,CristinaCristescu/root,simonpf/root,zzxuanyuan/root-compressor-dummy,ffurano/root5,davidlt/root,ffurano/root5,sawenzel/root,gganis/root,veprbl/root,nilqed/root,perovic/root,Duraznos/root,mhuwiler/rootauto,gbitzes/root,Dr15Jones/root,davidlt/root,kirbyherm/root-r-tools,0x0all/ROOT,esakellari/my_root_for_test,sirinath/root,BerserkerTroll/root,arch1tect0r/root,georgtroska/root,Duraznos/root,kirbyherm/root-r-tools,thomaskeck/root,veprbl/root,perovic/root,gganis/root,simonpf/root,Dr15Jones/root,0x0all/ROOT,zzxuanyuan/root,gbitzes/root,smarinac/root,satyarth934/root,kirbyherm/root-r-tools,georgtroska/root,esakellari/root,veprbl/root,satyarth934/root,lgiommi/root,buuck/root,satyarth934/root,dfunke/root,nilqed/root,jrtomps/root,olifre/root,evgeny-boger/root,zzxuanyuan/root,mkret2/root,abhinavmoudgil95/root,esakellari/root,arch1tect0r/root,esakellari/root,mkret2/root,jrtomps/root,simonpf/root,omazapa/root,mkret2/root,omazapa/root-old,mattkretz/root,CristinaCristescu/root,simonpf/root,buuck/root,zzxuanyuan/root,Y--/root,sawenzel/root,jrtomps/root,evgeny-boger/root,pspe/root,mhuwiler/rootauto,karies/root,dfunke/root,veprbl/root,thomaskeck/root,root-mirror/root,smarinac/root,sawenzel/root,davidlt/root,evgeny-boger/root,jrtomps/root,Dr15Jones/root,cxx-hep/root-cern,omazapa/root-old,karies/root,sawenzel/root,simonpf/root,evgeny-boger/root,simonpf/root,Y--/root,Duraznos/root,bbockelm/root,beniz/root,esakellari/my_root_for_test,buuck/root,vukasinmilosevic/root,vukasinmilosevic/root,kirbyherm/root-r-tools,olifre/root,Y--/root,buuck/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,sirinath/root,jrtomps/root,thomaskeck/root,agarciamontoro/root,mkret2/root,thomaskeck/root,CristinaCristescu/root,mkret2/root,Duraznos/root,tc3t/qoot,esakellari/my_root_for_test,mattkretz/root,davidlt/root,CristinaCristescu/root,omazapa/root,cxx-hep/root-cern,perovic/root,georgtroska/root,veprbl/root,sbinet/cxx-root,veprbl/root,alexschlueter/cern-root,dfunke/root,Y--/root,sirinath/root,bbockelm/root,Duraznos/root,esakellari/my_root_for_test,dfunke/root,krafczyk/root,davidlt/root,omazapa/root,ffurano/root5,sbinet/cxx-root,agarciamontoro/root,Dr15Jones/root,sirinath/root,jrtomps/root,arch1tect0r/root,evgeny-boger/root,olifre/root,lgiommi/root,karies/root,dfunke/root,lgiommi/root,mhuwiler/rootauto,buuck/root,lgiommi/root,nilqed/root,evgeny-boger/root,krafczyk/root,dfunke/root,zzxuanyuan/root-compressor-dummy,arch1tect0r/root,georgtroska/root,vukasinmilosevic/root,Y--/root,beniz/root,thomaskeck/root,Duraznos/root,mhuwiler/rootauto,bbockelm/root,satyarth934/root,mattkretz/root,simonpf/root,mkret2/root,omazapa/root-old,georgtroska/root,tc3t/qoot,esakellari/root,gganis/root,nilqed/root,sirinath/root,mkret2/root,ffurano/root5,CristinaCristescu/root,mkret2/root,mattkretz/root,mhuwiler/rootauto,0x0all/ROOT,beniz/root,bbockelm/root,lgiommi/root,smarinac/root,Y--/root,mhuwiler/rootauto,BerserkerTroll/root,pspe/root,smarinac/root,gbitzes/root,esakellari/my_root_for_test,mhuwiler/rootauto,0x0all/ROOT,sbinet/cxx-root,smarinac/root,perovic/root,georgtroska/root,CristinaCristescu/root,sbinet/cxx-root,davidlt/root,Dr15Jones/root,tc3t/qoot,thomaskeck/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,agarciamontoro/root,pspe/root,root-mirror/root,georgtroska/root,perovic/root,alexschlueter/cern-root,abhinavmoudgil95/root,esakellari/root,karies/root,sawenzel/root,sirinath/root,zzxuanyuan/root,olifre/root,mhuwiler/rootauto,krafczyk/root,perovic/root,sirinath/root,buuck/root,mhuwiler/rootauto,zzxuanyuan/root,cxx-hep/root-cern,kirbyherm/root-r-tools,satyarth934/root,abhinavmoudgil95/root,beniz/root,veprbl/root,root-mirror/root,davidlt/root,arch1tect0r/root,zzxuanyuan/root,esakellari/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,Duraznos/root,karies/root,olifre/root,tc3t/qoot,esakellari/root,satyarth934/root,root-mirror/root,esakellari/my_root_for_test,CristinaCristescu/root,smarinac/root,gbitzes/root,omazapa/root,krafczyk/root,smarinac/root,omazapa/root-old,georgtroska/root,BerserkerTroll/root,simonpf/root,veprbl/root,CristinaCristescu/root,buuck/root,nilqed/root,olifre/root,tc3t/qoot,abhinavmoudgil95/root,satyarth934/root,tc3t/qoot,mhuwiler/rootauto,BerserkerTroll/root,omazapa/root-old,bbockelm/root,vukasinmilosevic/root,BerserkerTroll/root,strykejern/TTreeReader,sirinath/root,jrtomps/root,vukasinmilosevic/root,Dr15Jones/root,esakellari/root,Y--/root,omazapa/root,omazapa/root,perovic/root,buuck/root,gganis/root,gbitzes/root,arch1tect0r/root,dfunke/root,beniz/root,satyarth934/root,pspe/root,mattkretz/root,mattkretz/root,thomaskeck/root,root-mirror/root,satyarth934/root,pspe/root,nilqed/root,perovic/root,omazapa/root,karies/root,sawenzel/root,0x0all/ROOT,krafczyk/root,georgtroska/root,nilqed/root,gganis/root,satyarth934/root,zzxuanyuan/root-compressor-dummy,0x0all/ROOT,agarciamontoro/root,agarciamontoro/root,perovic/root,gganis/root,krafczyk/root,tc3t/qoot,gbitzes/root,Y--/root,agarciamontoro/root,vukasinmilosevic/root,krafczyk/root,thomaskeck/root,strykejern/TTreeReader,strykejern/TTreeReader,omazapa/root,olifre/root,BerserkerTroll/root,beniz/root,nilqed/root,0x0all/ROOT,buuck/root,beniz/root,smarinac/root,esakellari/my_root_for_test,vukasinmilosevic/root,zzxuanyuan/root,sbinet/cxx-root,BerserkerTroll/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,sawenzel/root,pspe/root,bbockelm/root,lgiommi/root,sbinet/cxx-root,sirinath/root,kirbyherm/root-r-tools,olifre/root,Dr15Jones/root,buuck/root,omazapa/root-old,mattkretz/root,Duraznos/root,jrtomps/root,mattkretz/root,omazapa/root-old,pspe/root,agarciamontoro/root,lgiommi/root,beniz/root,smarinac/root,CristinaCristescu/root,krafczyk/root,davidlt/root,sbinet/cxx-root,evgeny-boger/root,cxx-hep/root-cern,buuck/root,bbockelm/root,jrtomps/root,davidlt/root,Y--/root,CristinaCristescu/root,arch1tect0r/root,BerserkerTroll/root,0x0all/ROOT,esakellari/root,Duraznos/root,nilqed/root,jrtomps/root,mattkretz/root,zzxuanyuan/root,jrtomps/root,gbitzes/root,gganis/root,strykejern/TTreeReader,cxx-hep/root-cern,BerserkerTroll/root,simonpf/root,zzxuanyuan/root-compressor-dummy,olifre/root,omazapa/root-old,zzxuanyuan/root,mkret2/root,arch1tect0r/root,ffurano/root5,lgiommi/root,cxx-hep/root-cern,agarciamontoro/root,dfunke/root,davidlt/root,esakellari/my_root_for_test,esakellari/my_root_for_test,beniz/root,karies/root,esakellari/root,root-mirror/root,evgeny-boger/root,pspe/root,mhuwiler/rootauto,zzxuanyuan/root,sbinet/cxx-root,abhinavmoudgil95/root,georgtroska/root,abhinavmoudgil95/root,alexschlueter/cern-root,mattkretz/root,olifre/root,pspe/root,karies/root,tc3t/qoot,gganis/root,vukasinmilosevic/root,omazapa/root,sawenzel/root,ffurano/root5,alexschlueter/cern-root,karies/root,omazapa/root-old |
19c229319206969f13d427bf00bda84203426154 | views/controls/menu/native_menu_host_delegate.h | views/controls/menu/native_menu_host_delegate.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 VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
namespace views {
namespace internal {
class NativeMenuHostDelegate {
public:
virtual ~NativeMenuHostDelegate() {}
};
} // namespace internal
} // namespace views
#endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_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 VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
namespace views {
namespace internal {
class NativeMenuHostDelegate {
public:
virtual ~NativeMenuHostDelegate() {}
};
} // namespace internal
} // namespace views
#endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
| Add newline to end of file. | Add newline to end of file.
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@80087 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium |
f149841cd24851add6ea9e8680a0f65f00bf1652 | src/rng/auto_rng/auto_rng.h | src/rng/auto_rng/auto_rng.h | /*
* Auto Seeded RNG
* (C) 2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_AUTO_SEEDING_RNG_H__
#define BOTAN_AUTO_SEEDING_RNG_H__
#include <botan/rng.h>
#include <string>
namespace Botan {
/**
* RNG that attempts to seed itself
*/
class BOTAN_DLL AutoSeeded_RNG : public RandomNumberGenerator
{
public:
void randomize(byte out[], u32bit len)
{ rng->randomize(out, len); }
bool is_seeded() const
{ return rng->is_seeded(); }
void clear() throw() { rng->clear(); }
std::string name() const
{ return "AutoSeeded(" + rng->name() + ")"; }
void reseed(u32bit poll_bits) { rng->reseed(poll_bits); }
void add_entropy_source(EntropySource* es)
{ rng->add_entropy_source(es); }
void add_entropy(const byte in[], u32bit len)
{ rng->add_entropy(in, len); }
AutoSeeded_RNG(u32bit poll_bits = 256);
~AutoSeeded_RNG() { delete rng; }
private:
RandomNumberGenerator* rng;
};
}
#endif
| /*
* Auto Seeded RNG
* (C) 2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_AUTO_SEEDING_RNG_H__
#define BOTAN_AUTO_SEEDING_RNG_H__
#include <botan/rng.h>
#include <string>
namespace Botan {
/**
* RNG that attempts to seed itself
*/
class BOTAN_DLL AutoSeeded_RNG : public RandomNumberGenerator
{
public:
void randomize(byte out[], u32bit len)
{ rng->randomize(out, len); }
bool is_seeded() const
{ return rng->is_seeded(); }
void clear() throw() { rng->clear(); }
std::string name() const
{ return "AutoSeeded(" + rng->name() + ")"; }
void reseed(u32bit poll_bits = 256) { rng->reseed(poll_bits); }
void add_entropy_source(EntropySource* es)
{ rng->add_entropy_source(es); }
void add_entropy(const byte in[], u32bit len)
{ rng->add_entropy(in, len); }
AutoSeeded_RNG(u32bit poll_bits = 256);
~AutoSeeded_RNG() { delete rng; }
private:
RandomNumberGenerator* rng;
};
}
#endif
| Make AutoSeeded_RNG::reseed's parameter default to 256 for compatability with the version in earlier releases. Rickard Bondesson pointed out that this was a problem on the mailing list. | Make AutoSeeded_RNG::reseed's parameter default to 256 for compatability
with the version in earlier releases. Rickard Bondesson pointed out that
this was a problem on the mailing list.
| C | bsd-2-clause | webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,webmaster128/botan,randombit/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan |
2f0754c068fb97036f2a78e56768e27e5668e3c7 | test/Driver/aarch64-cpus.c | test/Driver/aarch64-cpus.c | // Check target CPUs are correctly passed.
// RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s
// GENERIC: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "generic"
// RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s
// CA53: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a53"
// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s
// CA57: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "cortex-a57"
| // Check target CPUs are correctly passed.
// RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s
// GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic"
// RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s
// CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53"
// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s
// CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57"
| Fix wildcard matching on CHECK lines. Now recognises arch64--. | AArch64: Fix wildcard matching on CHECK lines. Now recognises arch64--.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@193858 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
5852b273a6e8b1e066026ebf5aef9f00e0f70f5a | hab/proxr/cb-set-resource.c | hab/proxr/cb-set-resource.c | #include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
double data;
double content;
int id;
bionet_node_t *node;
bionet_value_get_float(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
// command proxr to adjust to new value
set_potentiometer(id, (int)data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_float(resource, content, NULL);
hab_report_datapoints(node);
return;
}
}
}
| #include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
double data;
double content;
int id;
bionet_node_t *node;
bionet_value_get_float(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
// command proxr to adjust to new value
set_potentiometer(id, (int)data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_double(resource, content, NULL);
hab_report_datapoints(node);
return;
}
}
}
| Change to double. Missed from previous commit. | Change to double. Missed from previous commit.
| C | lgpl-2.1 | ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead |
0bd3a274a2d2f2ed68fc3835f64cbe6a5f52bea9 | iosstart.h | iosstart.h |
#include "glk.h"
extern void iosglk_set_can_restart_flag(int);
extern int iosglk_can_restart_cleanly(void);
extern void iosglk_shut_down_process(void) GLK_ATTRIBUTE_NORETURN;
|
#include "glk.h"
#include "iosglk_startup.h"
extern void iosglk_set_can_restart_flag(int);
extern int iosglk_can_restart_cleanly(void);
extern void iosglk_shut_down_process(void) GLK_ATTRIBUTE_NORETURN;
| Include the generic startup header, since that declares iosglk_startup_code(). | Include the generic startup header, since that declares
iosglk_startup_code().
| C | mit | erkyrath/glulxe,erkyrath/glulxe |
8ee49a928070436198b8663c2e5306fc7e0a64a2 | software/src/master/src/kernel/Vca_VTypePattern.h | software/src/master/src/kernel/Vca_VTypePattern.h | #ifndef Vca_VTypePattern_Interface
#define Vca_VTypePattern_Interface
/*********************
***** Library *****
*********************/
#include "Vca.h"
/**************************
***** Declarations *****
**************************/
class VString;
/*************************
***** Definitions *****
*************************/
namespace Vca {
/*******************************************************
*---- template <typename T> struct VTypePattern ----*
*******************************************************/
template <typename T> struct VTypePattern {
typedef T val_t;
typedef T var_t;
};
/*****************************************************************
*---- template <typename T> struct VTypePattern<T const&> ----*
*****************************************************************/
template <typename T> struct VTypePattern<T const&> {
typedef T const& val_t;
typedef T var_t;
};
/***********************************************************
*---- template <typename T> struct VTypePattern<T*> ----*
***********************************************************/
template <typename T> struct VTypePattern<T*> {
typedef T val_t;
typedef typename T::Reference var_t;
};
/**********************************************************
*---- template <> struct VTypePattern<char const*> ----*
**********************************************************/
template <> struct VTypePattern<char const*> {
typedef char const* val_t;
typedef VString var_t;
};
}
#endif
| #ifndef Vca_VTypePattern_Interface
#define Vca_VTypePattern_Interface
/*********************
***** Library *****
*********************/
#include "Vca.h"
/**************************
***** Declarations *****
**************************/
class VString;
/*************************
***** Definitions *****
*************************/
namespace Vca {
/*******************************************************
*---- template <typename T> struct VTypePattern ----*
*******************************************************/
template <typename T> struct VTypePattern {
typedef T val_t;
typedef T var_t;
};
/*****************************************************************
*---- template <typename T> struct VTypePattern<T const&> ----*
*****************************************************************/
template <typename T> struct VTypePattern<T const&> {
typedef T const& val_t;
typedef T var_t;
};
/***********************************************************
*---- template <typename T> struct VTypePattern<T*> ----*
***********************************************************/
template <typename T> struct VTypePattern<T*> {
typedef T* val_t;
typedef typename T::Reference var_t;
};
/**********************************************************
*---- template <> struct VTypePattern<char const*> ----*
**********************************************************/
template <> struct VTypePattern<char const*> {
typedef char const* val_t;
typedef VString var_t;
};
}
#endif
| Fix unused incorrect 'VTypePattern<T*>::val_t' definition | Fix unused incorrect 'VTypePattern<T*>::val_t' definition
| C | bsd-3-clause | vision-dbms/vision,MichaelJCaruso/vision,vision-dbms/vision,c-kuhlman/vision,MichaelJCaruso/vision,c-kuhlman/vision,vision-dbms/vision,MichaelJCaruso/vision,VisionAerie/vision,MichaelJCaruso/vision,c-kuhlman/vision,VisionAerie/vision,c-kuhlman/vision,VisionAerie/vision,vision-dbms/vision,vision-dbms/vision,VisionAerie/vision,VisionAerie/vision,c-kuhlman/vision,MichaelJCaruso/vision,MichaelJCaruso/vision,VisionAerie/vision,vision-dbms/vision,VisionAerie/vision |
d3a0143babe7410117ec231571c6cf4f036cf6c8 | suite/regress/invalid_read_in_print_operand.c | suite/regress/invalid_read_in_print_operand.c | #include <capstone.h>
#define BINARY "\x3b\x30\x62\x93\x5d\x61\x03\xe8"
int main(int argc, char **argv, char **envp) {
csh handle;
if (cs_open(CS_ARCH_X86, CS_MODE_64, &handle)) {
printf("cs_open(…) failed\n");
return 1;
}
cs_insn *insn;
cs_disasm(handle, (uint8_t *)BINARY, sizeof(BINARY) - 1, 0x1000, 0, &insn);
return 0;
}
| Add crash case: "Invalid read of size 4" in printOperand(…) | Add crash case: "Invalid read of size 4" in printOperand(…)
| C | bsd-3-clause | bSr43/capstone,bSr43/capstone,AmesianX/capstone,pranith/capstone,bigendiansmalls/capstone,AmesianX/capstone,pombredanne/capstone,pranith/capstone,bigendiansmalls/capstone,bigendiansmalls/capstone,AmesianX/capstone,pranith/capstone,pombredanne/capstone,bigendiansmalls/capstone,pranith/capstone,bigendiansmalls/capstone,AmesianX/capstone,pombredanne/capstone,AmesianX/capstone,pranith/capstone,pombredanne/capstone,pombredanne/capstone,bigendiansmalls/capstone,bigendiansmalls/capstone,pombredanne/capstone,bSr43/capstone,pranith/capstone,AmesianX/capstone,AmesianX/capstone,bSr43/capstone,bSr43/capstone,bSr43/capstone,pombredanne/capstone,bSr43/capstone,pranith/capstone |
|
c08b1f2c070ad030064c608cdc09e22f7bfc7bd6 | tests/regression/06-symbeq/37-var_eq-widen1.c | tests/regression/06-symbeq/37-var_eq-widen1.c | // SKIP PARAM: --set ana.activated[+] var_eq
// manually minimized from sv-benchmarks/c/ldv-linux-3.16-rc1/205_9a_array_unsafes_linux-3.16-rc1.tar.xz-205_9a-drivers--net--usb--cx82310_eth.ko-entry_point.cil.out.i
// used to call widen incorrectly
typedef _Bool bool;
void usb_bulk_msg(int *arg4, int x) {
}
void cx82310_cmd(bool reply ,unsigned char *wdata , int wlen)
{
int actual_len ;
int retries ;
int __min1 ;
__min1 = wlen;
retries = 0;
while (retries <= 4) {
usb_bulk_msg(&actual_len, 1U);
if (actual_len > 0)
return;
retries = retries + 1;
}
}
int main(void)
{
cx82310_cmd(1, "a", 1);
return 0;
}
| Add var_eq test with invalid widen | Add var_eq test with invalid widen
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
b59eeaf2d1365e2c42ea1bdb9521a5e0302469b8 | src/cli/main.c | src/cli/main.c | #include <stdio.h>
#include <string.h>
#include "os.h"
#include "vm.h"
#include "wren.h"
int main(int argc, const char* argv[])
{
if (argc == 2 && strcmp(argv[1], "--help") == 0)
{
printf("Usage: wren [file] [arguments...]\n");
printf(" --help Show command line usage\n");
return 0;
}
osSetArguments(argc, argv);
if (argc == 1)
{
runRepl();
}
else
{
runFile(argv[1]);
}
return 0;
}
| #include <stdio.h>
#include <string.h>
#include "os.h"
#include "vm.h"
#include "wren.h"
int main(int argc, const char* argv[])
{
if (argc == 2 && strcmp(argv[1], "--help") == 0)
{
printf("Usage: wren [file] [arguments...]\n");
printf(" --help Show command line usage\n");
return 0;
}
if (argc == 2 && strcmp(argv[1], "--version") == 0)
{
printf("wren %s\n", WREN_VERSION_STRING);
return 0;
}
osSetArguments(argc, argv);
if (argc == 1)
{
runRepl();
}
else
{
runFile(argv[1]);
}
return 0;
}
| Support "--version" in the CLI to print the version. | Support "--version" in the CLI to print the version.
| C | mit | Nelarius/wren,minirop/wren,minirop/wren,munificent/wren,foresterre/wren,minirop/wren,foresterre/wren,munificent/wren,minirop/wren,foresterre/wren,munificent/wren,Nelarius/wren,munificent/wren,minirop/wren,munificent/wren,foresterre/wren,Nelarius/wren,munificent/wren,Nelarius/wren,Nelarius/wren,foresterre/wren |
5abfe2c2363d3c9f2597664edf3810a80017759f | test/Sema/complex-promotion.c | test/Sema/complex-promotion.c | // RUN: clang %s -verify -fsyntax-only
float a;
int b[__builtin_classify_type(a + 1i) == 9 ? 1 : -1];
int c[__builtin_classify_type(1i + a) == 9 ? 1 : -1];
double d;
__typeof__ (d + 1i) e;
int f[sizeof(e) == 2 * sizeof(double) ? 1 : -1];
| // RUN: clang %s -verify -fsyntax-only
float a;
int b[__builtin_classify_type(a + 1i) == 9 ? 1 : -1];
int c[__builtin_classify_type(1i + a) == 9 ? 1 : -1];
double d;
__typeof__ (d + 1i) e;
int f[sizeof(e) == 2 * sizeof(double) ? 1 : -1];
int g;
int h[__builtin_classify_type(g + 1.0i) == 9 ? 1 : -1];
int i[__builtin_classify_type(1.0i + a) == 9 ? 1 : -1];
| Add another complex promotion test. | Add another complex promotion test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@60863 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
cfd192b0140f004404a208cde967ac8eef16cdff | tests-clar/threads/basic.c | tests-clar/threads/basic.c | #include "clar_libgit2.h"
#include "cache.h"
static git_repository *g_repo;
void test_threads_basic__initialize(void)
{
g_repo = cl_git_sandbox_init("testrepo");
}
void test_threads_basic__cleanup(void)
{
cl_git_sandbox_cleanup();
}
void test_threads_basic__cache(void)
{
// run several threads polling the cache at the same time
cl_assert(1 == 1);
}
| #include "clar_libgit2.h"
#include "cache.h"
static git_repository *g_repo;
void test_threads_basic__initialize(void)
{
g_repo = cl_git_sandbox_init("testrepo");
}
void test_threads_basic__cleanup(void)
{
cl_git_sandbox_cleanup();
}
void test_threads_basic__cache(void)
{
// run several threads polling the cache at the same time
cl_assert(1 == 1);
}
void test_threads_basic__multiple_init(void)
{
git_repository *nested_repo;
git_threads_init();
cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git")));
git_repository_free(nested_repo);
git_threads_shutdown();
cl_git_pass(git_repository_open(&nested_repo, cl_fixture("testrepo.git")));
git_repository_free(nested_repo);
}
| Add test for multiple thread init/shutdown | Add test for multiple thread init/shutdown
| C | lgpl-2.1 | mhp/libgit2,maxiaoqian/libgit2,t0xicCode/libgit2,rcorre/libgit2,KTXSoftware/libgit2,Aorjoa/libgit2_maked_lib,chiayolin/libgit2,claudelee/libgit2,claudelee/libgit2,sygool/libgit2,nokiddin/libgit2,yongthecoder/libgit2,oaastest/libgit2,Tousiph/Demo1,spraints/libgit2,Aorjoa/libgit2_maked_lib,leoyanggit/libgit2,yosefhackmon/libgit2,since2014/libgit2,Snazz2001/libgit2,mhp/libgit2,claudelee/libgit2,skabel/manguse,falqas/libgit2,kissthink/libgit2,Snazz2001/libgit2,yosefhackmon/libgit2,maxiaoqian/libgit2,ardumont/libgit2,Tousiph/Demo1,ardumont/libgit2,jflesch/libgit2-mariadb,skabel/manguse,falqas/libgit2,sim0629/libgit2,iankronquist/libgit2,whoisj/libgit2,sygool/libgit2,saurabhsuniljain/libgit2,saurabhsuniljain/libgit2,since2014/libgit2,dleehr/libgit2,falqas/libgit2,raybrad/libit2,oaastest/libgit2,kissthink/libgit2,yongthecoder/libgit2,spraints/libgit2,kissthink/libgit2,magnus98/TEST,rcorre/libgit2,JIghtuse/libgit2,sim0629/libgit2,raybrad/libit2,leoyanggit/libgit2,sygool/libgit2,since2014/libgit2,mcanthony/libgit2,mcanthony/libgit2,spraints/libgit2,nokiddin/libgit2,falqas/libgit2,KTXSoftware/libgit2,mingyaaaa/libgit2,sygool/libgit2,skabel/manguse,Snazz2001/libgit2,kenprice/libgit2,yosefhackmon/libgit2,kenprice/libgit2,Tousiph/Demo1,maxiaoqian/libgit2,dleehr/libgit2,linquize/libgit2,KTXSoftware/libgit2,MrHacky/libgit2,leoyanggit/libgit2,Tousiph/Demo1,rcorre/libgit2,kenprice/libgit2,kenprice/libgit2,jflesch/libgit2-mariadb,Aorjoa/libgit2_maked_lib,Aorjoa/libgit2_maked_lib,ardumont/libgit2,chiayolin/libgit2,jflesch/libgit2-mariadb,jeffhostetler/public_libgit2,saurabhsuniljain/libgit2,yongthecoder/libgit2,iankronquist/libgit2,whoisj/libgit2,joshtriplett/libgit2,linquize/libgit2,yongthecoder/libgit2,raybrad/libit2,mcanthony/libgit2,linquize/libgit2,falqas/libgit2,saurabhsuniljain/libgit2,whoisj/libgit2,swisspol/DEMO-libgit2,amyvmiwei/libgit2,KTXSoftware/libgit2,mhp/libgit2,joshtriplett/libgit2,mingyaaaa/libgit2,kissthink/libgit2,dleehr/libgit2,stewid/libgit2,yosefhackmon/libgit2,spraints/libgit2,oaastest/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,skabel/manguse,magnus98/TEST,nokiddin/libgit2,MrHacky/libgit2,JIghtuse/libgit2,oaastest/libgit2,leoyanggit/libgit2,mcanthony/libgit2,magnus98/TEST,jeffhostetler/public_libgit2,stewid/libgit2,rcorre/libgit2,mrksrm/Mingijura,dleehr/libgit2,sim0629/libgit2,yongthecoder/libgit2,stewid/libgit2,mrksrm/Mingijura,JIghtuse/libgit2,JIghtuse/libgit2,mhp/libgit2,claudelee/libgit2,Corillian/libgit2,mrksrm/Mingijura,sim0629/libgit2,Snazz2001/libgit2,JIghtuse/libgit2,dleehr/libgit2,joshtriplett/libgit2,since2014/libgit2,mrksrm/Mingijura,skabel/manguse,KTXSoftware/libgit2,magnus98/TEST,oaastest/libgit2,ardumont/libgit2,mingyaaaa/libgit2,saurabhsuniljain/libgit2,leoyanggit/libgit2,JIghtuse/libgit2,amyvmiwei/libgit2,whoisj/libgit2,kenprice/libgit2,kenprice/libgit2,mcanthony/libgit2,stewid/libgit2,ardumont/libgit2,mingyaaaa/libgit2,spraints/libgit2,magnus98/TEST,falqas/libgit2,Corillian/libgit2,Corillian/libgit2,jflesch/libgit2-mariadb,yosefhackmon/libgit2,MrHacky/libgit2,swisspol/DEMO-libgit2,linquize/libgit2,t0xicCode/libgit2,claudelee/libgit2,maxiaoqian/libgit2,Aorjoa/libgit2_maked_lib,oaastest/libgit2,skabel/manguse,swisspol/DEMO-libgit2,Tousiph/Demo1,mingyaaaa/libgit2,iankronquist/libgit2,jeffhostetler/public_libgit2,MrHacky/libgit2,jeffhostetler/public_libgit2,Tousiph/Demo1,joshtriplett/libgit2,mcanthony/libgit2,nokiddin/libgit2,spraints/libgit2,MrHacky/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,joshtriplett/libgit2,KTXSoftware/libgit2,mhp/libgit2,leoyanggit/libgit2,raybrad/libit2,ardumont/libgit2,swisspol/DEMO-libgit2,maxiaoqian/libgit2,rcorre/libgit2,t0xicCode/libgit2,iankronquist/libgit2,claudelee/libgit2,whoisj/libgit2,t0xicCode/libgit2,magnus98/TEST,amyvmiwei/libgit2,since2014/libgit2,Corillian/libgit2,nokiddin/libgit2,dleehr/libgit2,chiayolin/libgit2,Snazz2001/libgit2,mhp/libgit2,amyvmiwei/libgit2,yongthecoder/libgit2,sygool/libgit2,jflesch/libgit2-mariadb,chiayolin/libgit2,t0xicCode/libgit2,mrksrm/Mingijura,sim0629/libgit2,sim0629/libgit2,iankronquist/libgit2,jflesch/libgit2-mariadb,stewid/libgit2,chiayolin/libgit2,stewid/libgit2,mrksrm/Mingijura,linquize/libgit2,t0xicCode/libgit2,yosefhackmon/libgit2,rcorre/libgit2,raybrad/libit2,amyvmiwei/libgit2,sygool/libgit2,Corillian/libgit2,mingyaaaa/libgit2,Snazz2001/libgit2,linquize/libgit2,since2014/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,chiayolin/libgit2,kissthink/libgit2,MrHacky/libgit2,swisspol/DEMO-libgit2,amyvmiwei/libgit2,nokiddin/libgit2,whoisj/libgit2,iankronquist/libgit2,maxiaoqian/libgit2,kissthink/libgit2 |
fa890d586cc127ce72597ba0a909bfecf784e10c | include/linux/isa.h | include/linux/isa.h | /*
* ISA bus.
*/
#ifndef __LINUX_ISA_H
#define __LINUX_ISA_H
#include <linux/device.h>
#include <linux/kernel.h>
struct isa_driver {
int (*match)(struct device *, unsigned int);
int (*probe)(struct device *, unsigned int);
int (*remove)(struct device *, unsigned int);
void (*shutdown)(struct device *, unsigned int);
int (*suspend)(struct device *, unsigned int, pm_message_t);
int (*resume)(struct device *, unsigned int);
struct device_driver driver;
struct device *devices;
};
#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
int isa_register_driver(struct isa_driver *, unsigned int);
void isa_unregister_driver(struct isa_driver *);
#endif /* __LINUX_ISA_H */
| /*
* ISA bus.
*/
#ifndef __LINUX_ISA_H
#define __LINUX_ISA_H
#include <linux/device.h>
#include <linux/kernel.h>
struct isa_driver {
int (*match)(struct device *, unsigned int);
int (*probe)(struct device *, unsigned int);
int (*remove)(struct device *, unsigned int);
void (*shutdown)(struct device *, unsigned int);
int (*suspend)(struct device *, unsigned int, pm_message_t);
int (*resume)(struct device *, unsigned int);
struct device_driver driver;
struct device *devices;
};
#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
#ifdef CONFIG_ISA
int isa_register_driver(struct isa_driver *, unsigned int);
void isa_unregister_driver(struct isa_driver *);
#else
static inline int isa_register_driver(struct isa_driver *d, unsigned int i)
{
return 0;
}
static inline void isa_unregister_driver(struct isa_driver *d)
{
}
#endif
#endif /* __LINUX_ISA_H */
| Fix non-ISA link error in drivers/scsi/advansys.c | Fix non-ISA link error in drivers/scsi/advansys.c
When CONFIG_ISA is disabled, the isa_driver support will not be compiled
in. Define stubs so that we don't get link-time errors.
Signed-off-by: Matthew Wilcox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.