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
|
---|---|---|---|---|---|---|---|---|---|
8c79cb12cffdb76543fa79455083ad1daef89194 | shaderDefines.h | shaderDefines.h | #define ATTR_POS 0
#define ATTR_UV 1
#define ATTR_COLOR 2
#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5
#ifdef __cplusplus
struct Globals
#else // __cplusplus
layout(binding = 0, std140) uniform Globals
#endif // __cplusplus
{
vec4 screenSize;
mat4 viewProj;
mat4 guiOrtho;
};
struct Cube {
vec4 rotation;
vec3 position;
unsigned int color;
};
| #define ATTR_POS 0
#define ATTR_UV 1
#define ATTR_COLOR 2
#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5
#ifdef __cplusplus
struct Globals
#else // __cplusplus
layout(binding = 0, std140) uniform Globals
#endif // __cplusplus
{
vec4 screenSize;
mat4 viewProj;
mat4 guiOrtho;
};
struct Cube {
vec4 rotation;
vec3 position;
uint color;
};
| Change "unsigned int" -> "uint" for better GLSL compatibility | Change "unsigned int" -> "uint" for better GLSL compatibility
| C | mit | turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo |
655f3d4c389dbcb1e23c2ba425ccfd85234f6fce | include/rng.h | include/rng.h | /*************************************************
* RandomNumberGenerator Header File *
* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__
#include <botan/exceptn.h>
namespace Botan {
/*************************************************
* Entropy Source *
*************************************************/
class BOTAN_DLL EntropySource
{
public:
virtual u32bit slow_poll(byte[], u32bit) = 0;
virtual u32bit fast_poll(byte[], u32bit);
virtual ~EntropySource() {}
};
/*************************************************
* Random Number Generator *
*************************************************/
class BOTAN_DLL RandomNumberGenerator
{
public:
virtual void randomize(byte[], u32bit) throw(PRNG_Unseeded) = 0;
virtual bool is_seeded() const = 0;
virtual void clear() throw() {};
byte next_byte();
void add_entropy(const byte[], u32bit);
u32bit add_entropy(EntropySource&, bool = true);
virtual ~RandomNumberGenerator() {}
private:
virtual void add_randomness(const byte[], u32bit) = 0;
};
}
#endif
| /*************************************************
* RandomNumberGenerator Header File *
* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__
#include <botan/exceptn.h>
namespace Botan {
/*************************************************
* Entropy Source *
*************************************************/
class BOTAN_DLL EntropySource
{
public:
virtual u32bit slow_poll(byte[], u32bit) = 0;
virtual u32bit fast_poll(byte[], u32bit);
virtual ~EntropySource() {}
};
/*************************************************
* Random Number Generator *
*************************************************/
class BOTAN_DLL RandomNumberGenerator
{
public:
virtual void randomize(byte[], u32bit) = 0;
virtual bool is_seeded() const = 0;
virtual void clear() throw() {};
byte next_byte();
void add_entropy(const byte[], u32bit);
u32bit add_entropy(EntropySource&, bool = true);
virtual ~RandomNumberGenerator() {}
private:
virtual void add_randomness(const byte[], u32bit) = 0;
};
}
#endif
| Remove exception specifier from RandomNumberGenerator::randomize | Remove exception specifier from RandomNumberGenerator::randomize
| C | bsd-2-clause | Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan |
743a89c5c27c3c17b87af5df8c381d95b00f2f42 | pg_query.c | pg_query.c | #include "pg_query.h"
#include "pg_query_internal.h"
const char* progname = "pg_query";
void pg_query_init(void)
{
MemoryContextInit();
}
| #include "pg_query.h"
#include "pg_query_internal.h"
#include <mb/pg_wchar.h>
const char* progname = "pg_query";
void pg_query_init(void)
{
MemoryContextInit();
SetDatabaseEncoding(PG_UTF8);
}
| Set database encoding to UTF8. | Set database encoding to UTF8.
Fixes error when parsing this statement:
SELECT U&'\0441\043B\043E\043D'
The error is:
Unicode escape values cannot be used for code point values above
007F when the server encoding is not UTF8.
Perhapes there could be an API to set the encoding used by the
parser. But I think it makes sense to use UTF8 by default.
| C | bsd-3-clause | lfittl/libpg_query,ranxian/peloton-frontend,lfittl/libpg_query,lfittl/libpg_query,ranxian/peloton-frontend,ranxian/peloton-frontend,ranxian/peloton-frontend,ranxian/peloton-frontend |
b3cc864f59fe9edd44a3407e9ab814323cfb424a | cc1/tests/test032.c | cc1/tests/test032.c |
/*
name: TEST032
description: test special characters @ and $ in macro definitions
output:
F3 I
G4 F3 main
{
\
A6 P p
A6 "54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021 'P :P
r A6 #P0 !I
}
*/
#define M1(x) "This is a string $ or # or ##" ## #x
int
main(void)
{
char *p = M1(and it is ok!);
return p != 0;
}
| Add test for special characters in macro definition | Add test for special characters in macro definition
@ and $ only can appear in strings or in characters,
and cc1 use them for special purposes in macro
definitions. Test that it is ok is they are in
a macro (character test should be done to).
| C | isc | k0gaMSX/scc,8l/scc,k0gaMSX/scc,k0gaMSX/kcc,8l/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc |
|
a83e22d75dfffd2003fa7ebdeb35a9ca3a6731ec | src/lib/llist.h | src/lib/llist.h | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \
*(list) = (item)->next; \
else \
(item)->prev->next = (item)->next; \
if ((item)->next != NULL) \
(item)->next->prev = (item)->prev; \
} STMT_END
#endif
| #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \
*(list) = (item)->next; \
else \
(item)->prev->next = (item)->next; \
if ((item)->next != NULL) { \
(item)->next->prev = (item)->prev; \
(item)->next = NULL; \
} \
(item)->prev = NULL; \
} STMT_END
#endif
| Set removed item's prev/next pointers to NULL. | DLLIST_REMOVE(): Set removed item's prev/next pointers to NULL.
| C | mit | LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot |
33de317e5a27d5dfc368cc0488c12b42236183e8 | tensorflow/core/lib/core/threadpool_interface.h | tensorflow/core/lib/core/threadpool_interface.h | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#define EIGEN_USE_THREADS
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
namespace tensorflow {
namespace thread {
class ThreadPoolInterface : public Eigen::ThreadPoolInterface {};
} // namespace thread
} // namespace tensorflow
#endif // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
| /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#ifndef EIGEN_USE_THREADS
#define EIGEN_USE_THREADS
#endif
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
namespace tensorflow {
namespace thread {
class ThreadPoolInterface : public Eigen::ThreadPoolInterface {};
} // namespace thread
} // namespace tensorflow
#endif // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
| Define EIGEN_USE_THREADS only if it is not defined yet | Define EIGEN_USE_THREADS only if it is not defined yet
PiperOrigin-RevId: 253269616
| C | apache-2.0 | renyi533/tensorflow,xzturn/tensorflow,petewarden/tensorflow,DavidNorman/tensorflow,davidzchen/tensorflow,aldian/tensorflow,jhseu/tensorflow,cxxgtxy/tensorflow,renyi533/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,ppwwyyxx/tensorflow,freedomtan/tensorflow,alsrgv/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,yongtang/tensorflow,petewarden/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,chemelnucfin/tensorflow,karllessard/tensorflow,adit-chandra/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,annarev/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,aldian/tensorflow,aam-at/tensorflow,petewarden/tensorflow,arborh/tensorflow,ppwwyyxx/tensorflow,chemelnucfin/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,karllessard/tensorflow,gunan/tensorflow,adit-chandra/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,arborh/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,chemelnucfin/tensorflow,sarvex/tensorflow,DavidNorman/tensorflow,petewarden/tensorflow,aam-at/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,ppwwyyxx/tensorflow,petewarden/tensorflow,karllessard/tensorflow,alsrgv/tensorflow,arborh/tensorflow,alsrgv/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,Intel-Corporation/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,gunan/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,freedomtan/tensorflow,chemelnucfin/tensorflow,annarev/tensorflow,alsrgv/tensorflow,ppwwyyxx/tensorflow,karllessard/tensorflow,chemelnucfin/tensorflow,DavidNorman/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,petewarden/tensorflow,frreiss/tensorflow-fred,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,jhseu/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,alsrgv/tensorflow,arborh/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,xzturn/tensorflow,petewarden/tensorflow,xzturn/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,gautam1858/tensorflow,cxxgtxy/tensorflow,alsrgv/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,annarev/tensorflow,gautam1858/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,aldian/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,ppwwyyxx/tensorflow,alsrgv/tensorflow,alsrgv/tensorflow,gunan/tensorflow,xzturn/tensorflow,frreiss/tensorflow-fred,alsrgv/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,cxxgtxy/tensorflow,paolodedios/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,aldian/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,gautam1858/tensorflow,adit-chandra/tensorflow,yongtang/tensorflow,jhseu/tensorflow,xzturn/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,yongtang/tensorflow,arborh/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,paolodedios/tensorflow,aldian/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,annarev/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,freedomtan/tensorflow,yongtang/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,freedomtan/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,chemelnucfin/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,arborh/tensorflow,sarvex/tensorflow,aam-at/tensorflow,aam-at/tensorflow,DavidNorman/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xzturn/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,gunan/tensorflow,arborh/tensorflow,ppwwyyxx/tensorflow,gunan/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,aam-at/tensorflow,annarev/tensorflow,davidzchen/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,chemelnucfin/tensorflow,annarev/tensorflow,gunan/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,renyi533/tensorflow,Intel-Corporation/tensorflow,petewarden/tensorflow,adit-chandra/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aldian/tensorflow,aam-at/tensorflow,arborh/tensorflow,jhseu/tensorflow,xzturn/tensorflow,renyi533/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,gunan/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,ppwwyyxx/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,DavidNorman/tensorflow,DavidNorman/tensorflow,DavidNorman/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,arborh/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,aldian/tensorflow,paolodedios/tensorflow,DavidNorman/tensorflow,gunan/tensorflow,chemelnucfin/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,adit-chandra/tensorflow,karllessard/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,xzturn/tensorflow |
0a2f80571ac2077fdfe3eebbfe1b0f624a9cae2a | SudokuStart01/Sudoku9by9SolverAnalyzer.h | SudokuStart01/Sudoku9by9SolverAnalyzer.h | //
// Sudoku 9by9 Solver and Analyzer
//
#include "Sudoku9by9Board.h"
class Sudoku9by9SolverAnalyzer
{
private:
Sudoku9by9Board *board_ptr;
int number_of_solutions;
public:
Sudoku9by9SolverAnalyzer();
Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr);
bool NextTryOrBackTrack(int i, int j, bool backtrack);
void Solve(void);
bool Check_Conflicts(int p, int i, int j);
int get_number_of_solutions(void);
~Sudoku9by9SolverAnalyzer();
}; | Create separate Solver Analyzer class | Create separate Solver Analyzer class
| C | mit | gitguy101/SudokuStartxx |
|
73d73eeaa0fdd21bfb1592e2f7066590ef7ee920 | uranus_dp/include/uranus_dp/control_mode_enum.h | uranus_dp/include/uranus_dp/control_mode_enum.h | #ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
| #ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2,
DEPTH_HOLD = 3
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
| Add depth hold mode to enum | Add depth hold mode to enum
| C | mit | vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control |
7ad25fb1b0ea83c40a3c2a0c8bfa9e378626ec4f | STM/FindArg.h | STM/FindArg.h | #include <type_traits>
namespace WSTM
{
//!{
/**
* Finds the given type in the given pack of arguments. This is useful for having variadic
* argument lists for functions. To have variadic arguments in a function just make the function
* a template and take a parameter pack of arguments. Then use findArg to find any given type in
* the parameter pack (each argument you want to be able to find needs to have a unique type,
* which is easy to arrange by using the FIND_ARG__MAKE_ARG_TYPE macro). findArg will return the
* argument of the given type or a default constructed object of the given type if there was no
* object of the given type in the argument pack.
*/
template <typename Wanted_t, typename A_t, typename ... As_t>
std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a, const As_t&...)
{
return a;
}
template <typename Wanted_t, typename A_t, typename ... As_t>
std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&, const As_t&... as)
{
return findArg<Wanted_t> (as...);
}
template <typename Wanted_t, typename A_t>
std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a)
{
return a;
}
template <typename Wanted_t, typename A_t>
std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&)
{
return Wanted_t ();
}
template <typename Wanted_t>
typename Wanted_t findArg ()
{
return Wanted_t ();
}
//!}
/**
* Creates a type for use with findArg. The created type will have a "m_value" member that
* contains the actual value for the argument.
*
* @param type The type for m_value.
* @param name The name that shoudl be given to the create type.
* @param def The default value for m_value.
*/
#define MAKE_ARG_TYPE(type, name, def) \
struct name \
{ \
type m_value; \
name () : m_value (def) {} \
name (const type value) : m_value (value) {} \
};//
}
| Create fidnArgs to replace CombinatorArgs | Create fidnArgs to replace CombinatorArgs
| C | bsd-3-clause | bretthall/Wyatt-STM |
|
eff9494ed346005f825ccdd6fcdd3fa425041023 | include/bignum-conf.h | include/bignum-conf.h | /* Configuration for the mruby-bignum gem */
#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H
/* Size of a Bignum digit: 16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 64
/* Define to enable recursive algorithms for multiplication, division,
squaring, and conversion to and from strings */
#define MRB_BIGNUM_ENABLE_RECURSION
/* Cutoffs for recursive multiplication, squaring and division */
#define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32
#define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64
#define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32
#endif
| /* Configuration for the mruby-bignum gem */
#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H
/* Size of a Bignum digit: 16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 32
/* Define to enable recursive algorithms for multiplication, division,
squaring, and conversion to and from strings */
#define MRB_BIGNUM_ENABLE_RECURSION
/* Cutoffs for recursive multiplication, squaring and division */
#define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32
#define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64
#define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32
#endif
| Set the default bit width to 32. | Set the default bit width to 32.
32 bit Bignums don't need any non-C99 features.
| C | mit | chasonr/mruby-bignum,chasonr/mruby-bignum |
42150430ce7cbcee73173c7b8302c24f2efbae76 | testsuite/abi.c | testsuite/abi.c |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int offset;
int expected_offset;
int error = 0;
offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} else {
expected_offset = 9688;
}
if (offset != expected_offset) {
printf("ABI bug: OrcProgram->code_exec should be at offset %d instead of %d\n",
offset, expected_offset);
error = 1;
}
return error;
}
|
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
long offset;
int expected_offset;
int error = 0;
offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} else {
expected_offset = 9688;
}
if (offset != expected_offset) {
printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n",
offset, expected_offset);
error = 1;
}
return error;
}
| Fix compilation of the ABI test on 64 bit architectures | tests: Fix compilation of the ABI test on 64 bit architectures
Casting a pointer to a plain int will cause a compiler error, use long instead.
| C | bsd-3-clause | MOXfiles/orc,Distrotech/orc,ahmedammar/platform_external_gst_liborc,jpakkane/orc,jpakkane/orc,ahmedammar/platform_external_gst_liborc,MOXfiles/orc,ijsf/OpenWebRTC-orc,okuoku/nmosh-orc,MOXfiles/orc,Distrotech/orc,okuoku/nmosh-orc,mojaves/orc,Distrotech/orc,ijsf/OpenWebRTC-orc,mojaves/orc,ijsf/OpenWebRTC-orc,jpakkane/orc,mojaves/orc,okuoku/nmosh-orc |
27575f2a32ef4fd1f6bd6987b86473791ff394f7 | test/arduino_compat.h | test/arduino_compat.h | #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef bool boolean;
//#define uint8_t unsigned char
#define FILE_READ O_RDONLY
#define FILE_WRITE (O_RDWR | O_CREAT)
#endif
| #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
typedef bool boolean;
//#define uint8_t unsigned char
#define FILE_READ O_RDONLY
#define FILE_WRITE (O_RDWR | O_CREAT)
#endif
| Use stdint.h for unsigned integer typedefs | Use stdint.h for unsigned integer typedefs
Fixes problem compiling regression tests on 64 bit OS.
| C | lgpl-2.1 | stevemarple/IniFile,stevemarple/IniFile |
a7deb40634762debd15fe2e3f13c869aef9608d8 | source/SoAd.h | source/SoAd.h | /* Copyright (C) 2015 Joakim Plate
*
* 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
*/
#ifndef SOAD_H_
#define SOAD_H_
#include "TcpIp.h"
typedef struct {
uint8 dummy;
} SoAd_SocketConnection;
typedef struct {
uint32 headerid;
} SoAd_SocketRoute;
typedef struct {
uint8 dummy;
} SoAd_ConfigType;
void SoAd_Init(const SoAd_ConfigType* config);
void SoAd_MainFunction(void);
#endif
| /* Copyright (C) 2015 Joakim Plate
*
* 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
*/
#ifndef SOAD_H_
#define SOAD_H_
#include "TcpIp.h"
#define SOAD_MODULEID 56u
#define SOAD_INSTANCEID 0u
typedef struct {
uint8 dummy;
} SoAd_SocketConnection;
typedef struct {
uint32 headerid;
} SoAd_SocketRoute;
typedef struct {
uint8 dummy;
} SoAd_ConfigType;
void SoAd_Init(const SoAd_ConfigType* config);
void SoAd_MainFunction(void);
#endif
| Add moduleid and instance id | Add moduleid and instance id
| C | lgpl-2.1 | elupus/autosar-soad,elupus/autosar-soad |
614310c7aedf3273523352b1ee16660e7bbf9601 | test/Analysis/security-syntax-checks.c | test/Analysis/security-syntax-checks.c | // RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-checker=security.insecureAPI
void builtin_function_call_crash_fixes(char *c) {
__builtin_strncpy(c, "", 6); // expected-warning{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
__builtin_memset(c, '\0', (0)); // expected-warning{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
__builtin_memcpy(c, c, 0); // expected-warning{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
}
| // RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu11 \
// RUN: -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu99 \
// RUN: -analyzer-checker=security.insecureAPI
void builtin_function_call_crash_fixes(char *c) {
__builtin_strncpy(c, "", 6);
__builtin_memset(c, '\0', (0));
__builtin_memcpy(c, c, 0);
#if __STDC_VERSION__ > 199901
// expected-warning@-5{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
// expected-warning@-5{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
// expected-warning@-5{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
#else
// expected-no-diagnostics
#endif
}
| Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings. | Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@358626 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,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 |
21ebc95f83d4a857ffbbd13d1332d919f4752614 | check_tests/eas_main_tests.c | check_tests/eas_main_tests.c | #include <stdlib.h>
#include <check.h>
Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);
int main (void)
{
int number_failed;
SRunner* sr = srunner_create (eas_daemon_suite());
// Only to be used manually, updating the sync key to see manual
// changes on the server reflected to the client
// srunner_add_suite (sr, eas_folderhierarchy_suite());
srunner_add_suite (sr, eas_autodiscover_suite());
srunner_add_suite (sr, eas_libeasmail_suite());
srunner_add_suite (sr, eas_libeascal_suite());
// srunner_add_suite (sr, eas_libeassync_suite());
srunner_add_suite (sr, eas_libeascon_suite());
srunner_set_xml (sr, "eas-daemon_test.xml");
srunner_set_log (sr, "eas-daemon_test.log");
srunner_run_all (sr, CK_NORMAL);
number_failed = srunner_ntests_failed (sr);
srunner_free (sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
| #include <stdlib.h>
#include <check.h>
Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);
int main (void)
{
int number_failed;
SRunner* sr = srunner_create (eas_daemon_suite());
/** Only to be used manually, updating the sync key to see manual
* changes on the server reflected to the client
*/
// srunner_add_suite (sr, eas_folderhierarchy_suite());
srunner_add_suite (sr, eas_autodiscover_suite());
srunner_add_suite (sr, eas_libeasmail_suite());
srunner_add_suite (sr, eas_libeascal_suite());
srunner_add_suite (sr, eas_libeassync_suite());
srunner_add_suite (sr, eas_libeascon_suite());
srunner_set_xml (sr, "eas-daemon_test.xml");
srunner_set_log (sr, "eas-daemon_test.log");
srunner_run_all (sr, CK_NORMAL);
number_failed = srunner_ntests_failed (sr);
srunner_free (sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
| Enable all test suites except the manual folder hierarchy one | Enable all test suites except the manual folder hierarchy one
| C | lgpl-2.1 | simo5/evolution-activesync,simo5/evolution-activesync,simo5/evolution-activesync |
8bc6d9116a731dd70366b9fcc3fba4f182df91f2 | c/selective.h | c/selective.h | #ifndef _SELECTIVE_H
#define _SELECTIVE_H
#include "psyco.h"
#include "codemanager.h"
#define FUN_BOUND -1
#define MAX_RECURSION 1
EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);
#endif
| #ifndef _SELECTIVE_H
#define _SELECTIVE_H
#include "psyco.h"
#include "codemanager.h"
#define FUN_BOUND -1
#define MAX_RECURSION 99
EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);
#endif
| Set the MAX_RECURSION macro to 99 instead of 1 | Set the MAX_RECURSION macro to 99 instead of 1
| C | mit | tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni |
76fea900b9aedf4f8063f36b4f45a0616cdee5bb | odroid/energymon-odroid-ioctl.h | odroid/energymon-odroid-ioctl.h | /**
* Energy reading for an ODROID with INA231 power sensors, using ioctl on
* device files instead of sysfs.
*
* @author Connor Imes
* @date 2015-10-14
*/
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include "energymon.h"
int energymon_init_odroid_ioctl(energymon* em);
uint64_t energymon_read_total_odroid_ioctl(const energymon* em);
int energymon_finish_odroid_ioctl(energymon* em);
char* energymon_get_source_odroid_ioctl(char* buffer, size_t n);
uint64_t energymon_get_interval_odroid_ioctl(const energymon* em);
uint64_t energymon_get_precision_odroid_ioctl(const energymon* em);
int energymon_is_exclusive_odroid_ioctl();
int energymon_get_odroid_ioctl(energymon* em);
#ifdef __cplusplus
}
#endif
#endif
| /**
* Energy reading for an ODROID with INA231 power sensors, using ioctl on
* device files instead of sysfs.
*
* @author Connor Imes
* @date 2015-10-14
*/
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#include "energymon.h"
int energymon_init_odroid_ioctl(energymon* em);
uint64_t energymon_read_total_odroid_ioctl(const energymon* em);
int energymon_finish_odroid_ioctl(energymon* em);
char* energymon_get_source_odroid_ioctl(char* buffer, size_t n);
uint64_t energymon_get_interval_odroid_ioctl(const energymon* em);
uint64_t energymon_get_precision_odroid_ioctl(const energymon* em);
int energymon_is_exclusive_odroid_ioctl();
int energymon_get_odroid_ioctl(energymon* em);
#ifdef __cplusplus
}
#endif
#endif
| Add missing include (mostly for good practice as it's currently included transitively anyway) | Add missing include (mostly for good practice as it's currently included transitively anyway)
| C | apache-2.0 | energymon/energymon |
966a2dd4410d9aa4a15f7560a52b97626e787a91 | ghighlighter/gh-about-dialog.c | ghighlighter/gh-about-dialog.c | #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
return dialog;
}
| #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
static gchar const *title = "About ghighlighter";
gtk_window_set_title (GTK_WINDOW (dialog), title);
return dialog;
}
| Set about dialog title through static const variable | Set about dialog title through static const variable | C | mit | chdorner/ghighlighter-c |
f9edd7237e870e4fb0c573f005b9cecf51eb91bd | src/arch/xen/kernel_init.c | src/arch/xen/kernel_init.c | /**
* @file
* @brief 2nd level boot on Xen
*
* @date 04.11.2016
* @author Andrey Golikov
* @author Anton Kozlov
*/
#include <hal/arch.h>
#include <hal/ipl.h>
#include <drivers/diag.h>
#include <embox/runlevel.h>
#include <kernel/printk.h>
#include <xen/features.h>
#include <stdint.h>
#include <xen/xen.h>
#include <hypercall-x86_32.h>
#include <xen/event_channel.h>
#include <xen/io/console.h>
#include "event.h"
void kernel_start(void);
uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
extern shared_info_t shared_info;
extern void handle_input(evtchn_port_t port, struct pt_regs * regs);
shared_info_t *HYPERVISOR_shared_info;
start_info_t * start_info_global;
void kernel_start_xen(start_info_t * start_info) {
HYPERVISOR_update_va_mapping((unsigned long) &shared_info,
__pte(start_info->shared_info | 7),
UVMF_INVLPG);
start_info_global = start_info;
HYPERVISOR_shared_info = &shared_info;
init_events();
kernel_start();
}
| Move xen kernel init from global files | Move xen kernel init from global files
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
|
b430fafc3f57105e5c96f936e7a62b29117e8586 | include/tce/types.h | include/tce/types.h | typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
#define __EMBEDDED_PROFILE__ 1
#undef cles_khr_int64
#define cl_khr_fp16
#undef cl_khr_fp64
typedef uint size_t;
typedef int ptrdiff_t;
typedef int intptr_t;
typedef uint uintptr_t;
| Add removed TCE type definitions back. | Add removed TCE type definitions back.
| C | mit | pocl/pocl,pocl/pocl,0charleschen0/pocl,sting47/pocl,vkorhonen/pocl,vkorhonen/pocl,maZZZu/pocl,Oblomov/pocl,0charleschen0/pocl,franz/pocl,0charleschen0/pocl,Oblomov/pocl,pocl/pocl,dsandersimgtec/pocl,Oblomov/pocl,pavanky/pocl,rjodin/pocl,hugwijst/pocl,franz/pocl,jrprice/pocl,franz/pocl,pavanky/pocl,pavanky/pocl,rjodin/pocl,pocl/pocl,maZZZu/pocl,dsandersimgtec/pocl,Oblomov/pocl,dsandersimgtec/pocl,sting47/pocl,hugwijst/pocl,hugwijst/pocl,sting47/pocl,Oblomov/pocl,rjodin/pocl,hugwijst/pocl,pocl/pocl,rjodin/pocl,franz/pocl,sting47/pocl,hugwijst/pocl,jrprice/pocl,sting47/pocl,vkorhonen/pocl,vkorhonen/pocl,maZZZu/pocl,dsandersimgtec/pocl,jrprice/pocl,jrprice/pocl,0charleschen0/pocl,maZZZu/pocl,franz/pocl,pavanky/pocl |
|
9fac183df59fc6aa4bb6c244cce394b9fa9993c1 | src/core/src/NIOperations+Subclassing.h | src/core/src/NIOperations+Subclassing.h | //
// Copyright 2011-2014 NimbusKit
//
// 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.
//
@interface NIOperation()
@property (strong) NSError* lastError;
@end
| //
// Copyright 2011-2014 NimbusKit
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "NIOperations.h"
@interface NIOperation()
@property (strong) NSError* lastError;
@end
| Add proper import for NIOperations | Add proper import for NIOperations | C | apache-2.0 | bangquangvn/nimbus,zilaiyedaren/nimbus,zilaiyedaren/nimbus,panume/nimbus,panume/nimbus,bangquangvn/nimbus,WeeTom/nimbus,bogardon/nimbus,quyixia/nimbus,kisekied/nimbus,chanffdavid/nimbus,bogardon/nimbus,quyixia/nimbus,JyHu/nimbus,Arcank/nimbus,dmishe/nimbus,chanffdavid/nimbus,kisekied/nimbus,marcobgoogle/nimbus,Arcank/nimbus,compositeprimes/nimbus,chanffdavid/nimbus,dachaoisme/nimbus,kisekied/nimbus,michaelShab/nimbus,kisekied/nimbus,compositeprimes/nimbus,kisekied/nimbus,bogardon/nimbus,panume/nimbus,JyHu/nimbus,bangquangvn/nimbus,WeeTom/nimbus,WeeTom/nimbus,JyHu/nimbus,chanffdavid/nimbus,quyixia/nimbus,marcobgoogle/nimbus,jverkoey/nimbus,bangquangvn/nimbus,dmishe/nimbus,quyixia/nimbus,marcobgoogle/nimbus,michaelShab/nimbus,michaelShab/nimbus,jverkoey/nimbus,jverkoey/nimbus,zilaiyedaren/nimbus,michaelShab/nimbus,dmishe/nimbus,compositeprimes/nimbus,dachaoisme/nimbus,chanffdavid/nimbus,quyixia/nimbus,dachaoisme/nimbus,quyixia/nimbus,Arcank/nimbus,panume/nimbus,compositeprimes/nimbus,bogardon/nimbus,WeeTom/nimbus,WeeTom/nimbus,jverkoey/nimbus,zilaiyedaren/nimbus,Arcank/nimbus,chanffdavid/nimbus,bangquangvn/nimbus,panume/nimbus,michaelShab/nimbus,quyixia/nimbus,bogardon/nimbus,marcobgoogle/nimbus,jverkoey/nimbus,compositeprimes/nimbus,WeeTom/nimbus,JyHu/nimbus,michaelShab/nimbus,bogardon/nimbus,dmishe/nimbus,bogardon/nimbus,dmishe/nimbus,marcobgoogle/nimbus,compositeprimes/nimbus,Arcank/nimbus,bangquangvn/nimbus,panume/nimbus,marcobgoogle/nimbus,kisekied/nimbus,jverkoey/nimbus,Arcank/nimbus,jverkoey/nimbus,dachaoisme/nimbus,zilaiyedaren/nimbus,dmishe/nimbus,marcobgoogle/nimbus,dachaoisme/nimbus,JyHu/nimbus,Arcank/nimbus,JyHu/nimbus,dachaoisme/nimbus,zilaiyedaren/nimbus,JyHu/nimbus,compositeprimes/nimbus |
4868db0afaf583dc008e842b35c1701df732333b | kernel/init/kmain.c | kernel/init/kmain.c | #include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;
void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);
int kernel_idle_process() {
int i = 0;
for(;;) {
// Attempt to reschedule other processes unless things need to be done
// So, check if theres anything that needs to be done (like kernel state verification)
// Execute that, make sure everything is preemptable
// Then, attempt to reschedule processes if there isn't anything.
// Otherwise cpu time is wasted.
if(i != 500) {
printf("test%d\n",i++);
}
}
return 0;
}
int kmain() {
low_printname();
init_early_malloc(&_kernel_end);
init_pmm();
vmm_init();
heap_init();
timing_system_engine_reportstatustoconsole();
kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation
kernel_idle_process();
return 0;
}
| #include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;
void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);
int kernel_idle_process() {
for(;;) {
// Attempt to reschedule other processes unless things need to be done
// So, check if theres anything that needs to be done (like kernel state verification)
// Execute that, make sure everything is preemptable
// Then, attempt to reschedule processes if there isn't anything.
// Otherwise cpu time is wasted.
}
return 0;
}
int kmain() {
low_printname();
init_early_malloc(&_kernel_end);
init_pmm();
vmm_init();
heap_init();
timing_system_engine_reportstatustoconsole();
kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation
kernel_idle_process();
return 0;
}
| Remove test scrolling code from idle_process | Remove test scrolling code from idle_process
| C | mit | Lionel07/Cedille,Lionel07/Cedille,Lionel07/Cedille |
cdb6e95182e874765dd7a51155534111d186d631 | src/roman_convert_to_int.c | src/roman_convert_to_int.c | #include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
if (!numeral)
{
return -1;
}
const char first_letter = *numeral;
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
return 100;
case 'D':
return 500;
case 'M':
return 1000;
default:
return -1;
}
}
| #include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
const char first_letter = numeral ? *numeral : '?';
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
return 100;
case 'D':
return 500;
case 'M':
return 1000;
default:
return -1;
}
}
| Simplify error handling for missing/unknown numerals | Simplify error handling for missing/unknown numerals
| C | mit | greghaskins/roman-calculator.c |
5ec58ad6ad9f1687ab4022bed72dc879f8940f98 | tests/regression/02-base/47-no-threadescape.c | tests/regression/02-base/47-no-threadescape.c | // PARAM: --set ana.activated "['base','mallocWrapper','threadflag']"
#include <pthread.h>
int g = 10;
void* t(void *v) {
int* p = (int*) v;
*p = 4711;
}
int main(void){
int l = 42;
pthread_t tid;
pthread_create(&tid, NULL, t, (void *)&l);
pthread_join(tid, NULL);
assert(l==42); //UNKNOWN!
return 0;
}
| Add failing test without threadescape | Add failing test without threadescape
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
05489fc77e7bd485bf3333a7a5579e257e150fac | src/imap/cmd-create.c | src/imap/cmd-create.c | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "mail-namespace.h"
#include "commands.h"
bool cmd_create(struct client_command_context *cmd)
{
struct mail_namespace *ns;
const char *mailbox, *full_mailbox;
bool directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(cmd, 1, &mailbox))
return FALSE;
full_mailbox = mailbox;
ns = client_find_namespace(cmd, &mailbox);
if (ns == NULL)
return TRUE;
len = strlen(full_mailbox);
if (len == 0 || full_mailbox[len-1] != ns->sep)
directory = FALSE;
else {
/* name ends with hierarchy separator - client is just
informing us that it wants to create children under this
mailbox. */
directory = TRUE;
mailbox = t_strndup(mailbox, len-1);
full_mailbox = t_strndup(full_mailbox, strlen(full_mailbox)-1);
}
if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
return TRUE;
if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
client_send_storage_error(cmd, ns->storage);
else
client_send_tagline(cmd, "OK Create completed.");
return TRUE;
}
| /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "mail-namespace.h"
#include "commands.h"
bool cmd_create(struct client_command_context *cmd)
{
struct mail_namespace *ns;
const char *mailbox, *full_mailbox;
bool directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(cmd, 1, &mailbox))
return FALSE;
full_mailbox = mailbox;
ns = client_find_namespace(cmd, &mailbox);
if (ns == NULL)
return TRUE;
len = strlen(full_mailbox);
if (len == 0 || full_mailbox[len-1] != ns->sep)
directory = FALSE;
else {
/* name ends with hierarchy separator - client is just
informing us that it wants to create children under this
mailbox. */
directory = TRUE;
mailbox = t_strndup(mailbox, strlen(mailbox)-1);
full_mailbox = t_strndup(full_mailbox, len-1);
}
if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
return TRUE;
if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
client_send_storage_error(cmd, ns->storage);
else
client_send_tagline(cmd, "OK Create completed.");
return TRUE;
}
| CREATE ns_prefix/box/ didn't work right when namespace prefix existed. | CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
| C | mit | damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot |
64e8feb20086dea45debf19dacdf10bcc8587d6a | userspace/engine/falco_engine_version.h | userspace/engine/falco_engine_version.h | /*
Copyright (C) 2021 The Falco Authors.
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.
*/
// The version of rules/filter fields/etc supported by this Falco
// engine.
#define FALCO_ENGINE_VERSION (11)
// This is the result of running "falco --list -N | sha256sum" and
// represents the fields supported by this version of Falco. It's used
// at build time to detect a changed set of fields.
#define FALCO_FIELDS_CHECKSUM "9822482ceda8c4ee3475e698ba35a74c5e7abf971deb4e989e26415434bbd89b"
| /*
Copyright (C) 2021 The Falco Authors.
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.
*/
// The version of rules/filter fields/etc supported by this Falco
// engine.
#define FALCO_ENGINE_VERSION (11)
// This is the result of running "falco --list -N | sha256sum" and
// represents the fields supported by this version of Falco. It's used
// at build time to detect a changed set of fields.
#define FALCO_FIELDS_CHECKSUM "4de812495f8529ac20bda2b9774462b15911a51df293d59fe9ccb6b922fdeb9d"
| Update fields checksum (no changes, order only) | Update fields checksum (no changes, order only)
With the new implementation of list_fields(), the order of fields
changed slightly. So update the checksum.
Signed-off-by: Mark Stemm <[email protected]>
| C | apache-2.0 | draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco |
9fdde28b480bbdd66651b4cad1814afcfeca6698 | multiply_by_diagonal.c | multiply_by_diagonal.c | void multiply_by_diagonal(const int rows, const int cols,
double* restrict diagonal, double* restrict matrix) {
/*
* Multiply a matrix by a diagonal matrix (represented as a flat array
* of n values). The diagonal structure is exploited (so that we use
* n^2 multiplications instead of n^3); the product looks something
* like
*
* sage: A = matrix([[a,b,c], [d,e,f],[g,h,i]]);
* sage: w = matrix([[z1,0,0],[0,z2,0],[0,0,z3]]);
* sage: A * w
* => [a*z1 b*z2 c*z3]
* [d*z1 e*z2 f*z3]
* [g*z1 h*z2 i*z3]
*/
int i, j;
/* traverse the matrix in the correct order. */
#ifdef USE_COL_MAJOR
for (j = 0; j < cols; j++)
for (i = 0; i < rows; i++)
#else
for (i = 0; i < rows; i++)
for (j = 0; j < cols; j++)
#endif
matrix[ORDER(i, j, rows, cols)] *= diagonal[j];
}
| REFACTOR removed duplicates and created own file for this | REFACTOR removed duplicates and created own file for this
| C | bsd-3-clause | VT-ICAM/ArgyrisPack,VT-ICAM/ArgyrisPack,VT-ICAM/ArgyrisPack |
|
c33a24ad0fc8900b1e1a4ddb1c81194a9b8feaf6 | src/Sched.h | src/Sched.h | #ifndef SCHED_H
#define SCHED_H
#include <Input.h>
#include <Watch.h>
#include <Display.h>
#include <unistd.h> // for sleep()
class Sched
{
public:
Sched(Input* input, Watch* watch, Display* display)
: input_(input)
, watch_(watch)
, display_(display)
{}
public:
void run()
{
while(!shouldStop())
{
sleep(1);
input_->frame();
// watch_->frame();
// display_->frame();
}
}
bool shouldStop() const
{ return input_->shouldStop(); }
private:
Input* input_;
Watch* watch_;
Display* display_;
};
#endif
| #ifndef SCHED_H
#define SCHED_H
#include <Input.h>
#include <Watch.h>
#include <Display.h>
#include <unistd.h> // for sleep()
#include <iostream>
class Sched
{
public:
Sched(Input* input, Watch* watch, Display* display)
: input_(input)
, watch_(watch)
, display_(display)
{}
public:
void run()
{
while(!shouldStop())
{
sleep(1);
// clear screen, normally this should be done in Display
// but we want to fsm debug output to be shown (and not wiped away by this
// clear screen)
std::cout << "\x1B[2J\x1B[H";
input_->frame();
// watch_->frame();
// display_->frame();
}
}
bool shouldStop() const
{ return input_->shouldStop(); }
private:
Input* input_;
Watch* watch_;
Display* display_;
};
#endif
| Clear screen before each cycle | Clear screen before each cycle
| C | mit | dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm,dkrikun/casio-fsm |
073a4cfe77ec0117663b30156b2eade8ca751fe9 | src/libcsg/modules/io/lammpsdumpwriter.h | src/libcsg/modules/io/lammpsdumpwriter.h | /*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* 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 __VOTCA_CSG_LAMMPSDUMPWRITER_H
#define __VOTCA_CSG_LAMMPSDUMPWRITER_H
#include <stdio.h>
#include <votca/csg/topology.h>
#include <votca/csg/trajectorywriter.h>
namespace votca {
namespace csg {
class LAMMPSDumpWriter : public TrajectoryWriter {
public:
void Open(std::string file, bool bAppend = false) override;
void Close() override;
void Write(Topology *conf) override;
private:
FILE *_out;
};
} // namespace csg
} // namespace votca
#endif // __VOTCA_CSG_LAMMPSDUMPWRITER_H
| /*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* 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 __VOTCA_CSG_LAMMPSDUMPWRITER_H
#define __VOTCA_CSG_LAMMPSDUMPWRITER_H
#include <stdio.h>
#include <votca/csg/topology.h>
#include <votca/csg/trajectorywriter.h>
#include <votca/tools/unitconverter.h>
namespace votca {
namespace csg {
class LAMMPSDumpWriter : public TrajectoryWriter {
public:
void Open(std::string file, bool bAppend = false) override;
void Close() override;
void Write(Topology *conf) override;
private:
FILE *_out;
};
} // namespace csg
} // namespace votca
#endif // __VOTCA_CSG_LAMMPSDUMPWRITER_H
| Add unit converter include to lammps dump writer | Add unit converter include to lammps dump writer
| C | apache-2.0 | votca/csg,votca/csg,MrTheodor/csg,MrTheodor/csg,MrTheodor/csg,votca/csg,MrTheodor/csg,MrTheodor/csg,votca/csg |
f980d4b926ede4fefa5bb5dae6fba6bf843bf6e9 | src/libguac/guacamole/parser-constants.h | src/libguac/guacamole/parser-constants.h | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _GUAC_PARSER_CONSTANTS_H
#define _GUAC_PARSER_CONSTANTS_H
/**
* Constants related to the Guacamole protocol parser.
*
* @file parser-constants.h
*/
/**
* The maximum number of characters per instruction.
*/
#define GUAC_INSTRUCTION_MAX_LENGTH 8192
/**
* The maximum number of digits to allow per length prefix.
*/
#define GUAC_INSTRUCTION_MAX_DIGITS 5
/**
* The maximum number of elements per instruction, including the opcode.
*/
#define GUAC_INSTRUCTION_MAX_ELEMENTS 64
#endif
| /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _GUAC_PARSER_CONSTANTS_H
#define _GUAC_PARSER_CONSTANTS_H
/**
* Constants related to the Guacamole protocol parser.
*
* @file parser-constants.h
*/
/**
* The maximum number of characters per instruction.
*/
#define GUAC_INSTRUCTION_MAX_LENGTH 8192
/**
* The maximum number of digits to allow per length prefix.
*/
#define GUAC_INSTRUCTION_MAX_DIGITS 5
/**
* The maximum number of elements per instruction, including the opcode.
*/
#define GUAC_INSTRUCTION_MAX_ELEMENTS 128
#endif
| Merge changes allowing up to 128 elements per Guacamole instruction. | GUACAMOLE-587: Merge changes allowing up to 128 elements per Guacamole instruction.
| C | apache-2.0 | apache/guacamole-server,apache/guacamole-server,glyptodon/guacamole-server,glyptodon/guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,glyptodon/guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,apache/guacamole-server |
30909be64f02c27b012e9067c6af7f7e93e41008 | inc/WikiWalker.h | inc/WikiWalker.h | //! \file WikiWalker.h
#ifndef WIKIWALKER_H
#define WIKIWALKER_H
#include <string>
#include "CurlWikiGrabber.h"
#include "Walker.h"
namespace WikiWalker
{
//! main "app" class
class WikiWalker : public Walker
{
public:
/*! given an URL, start collecting links
* \param url start point for analysis
*/
void startWalking(const std::string& url);
/*! fetch not only requested article, but also linked ones.
* \param depth whether to fetch linked articles as well
*/
void setDeep(bool depth)
{
fetchGenerator = depth;
}
/*! Read data from cache file.
* Used for initialization.
* \param cacheFile file name of the cache.
*/
void readCache(const std::string& cacheFile);
/*! Write data to cache file.
* \param cacheFile file name of the cache.
*/
void writeCache(const std::string& cacheFile);
private:
CurlWikiGrabber grabber;
bool fetchGenerator;
};
} // namespace WikiWalker
#endif // WIKIWALKER_H
| //! \file WikiWalker.h
#ifndef WIKIWALKER_H
#define WIKIWALKER_H
#include <string>
#include "CurlWikiGrabber.h"
#include "Walker.h"
namespace WikiWalker
{
//! main "app" class
class WikiWalker : public Walker
{
public:
//! Creates a new instance
WikiWalker() : Walker(), fetchGenerator(false), grabber()
{
}
/*! given an URL, start collecting links
* \param url start point for analysis
*/
void startWalking(const std::string& url);
/*! fetch not only requested article, but also linked ones.
* \param depth whether to fetch linked articles as well
*/
void setDeep(bool depth)
{
fetchGenerator = depth;
}
/*! Read data from cache file.
* Used for initialization.
* \param cacheFile file name of the cache.
*/
void readCache(const std::string& cacheFile);
/*! Write data to cache file.
* \param cacheFile file name of the cache.
*/
void writeCache(const std::string& cacheFile);
private:
CurlWikiGrabber grabber;
bool fetchGenerator;
};
} // namespace WikiWalker
#endif // WIKIWALKER_H
| Add contructor to initialize fetchGenerator correctly | Add contructor to initialize fetchGenerator correctly
| C | mit | dueringa/WikiWalker |
a9afc0a1eb8cd6e5b0ea0f766f6a3a4012770679 | media/rx/video-rx.h | media/rx/video-rx.h | #ifndef __VIDEO_RX_H__
#define __VIDEO_RX_H__
#include "libavformat/avformat.h"
typedef struct DecodedFrame {
AVFrame* pFrameRGB;
uint8_t *buffer;
} DecodedFrame;
typedef struct FrameManager {
enum PixelFormat pix_fmt;
void (*put_video_frame_rx)(uint8_t *data, int width, int height, int nframe);
DecodedFrame* (*get_decoded_frame_buffer)(int width, int height);
void (*release_decoded_frame_buffer)(void);
} FrameManager;
int start_video_rx(const char* sdp, int maxDelay, FrameManager *frame_manager);
int stop_video_rx();
#endif /* __VIDEO_RX_H__ */
| #ifndef __VIDEO_RX_H__
#define __VIDEO_RX_H__
#include "libavformat/avformat.h"
typedef struct DecodedFrame {
AVFrame* pFrameRGB;
uint8_t *buffer;
void *priv_data; /* User private data */
} DecodedFrame;
typedef struct FrameManager {
enum PixelFormat pix_fmt;
void (*put_video_frame_rx)(uint8_t *data, int width, int height, int nframe);
DecodedFrame* (*get_decoded_frame_buffer)(int width, int height);
void (*release_decoded_frame_buffer)(void);
} FrameManager;
int start_video_rx(const char* sdp, int maxDelay, FrameManager *frame_manager);
int stop_video_rx();
#endif /* __VIDEO_RX_H__ */
| Add priv_data field in DecodedFrame struct. | Add priv_data field in DecodedFrame struct.
| C | lgpl-2.1 | Kurento/kc-media-native,Kurento/kc-media-native,shelsonjava/kc-media-native,shelsonjava/kc-media-native |
efdec03d85fbd561f27f6bbfcb10306d9dc5ba76 | tests/simple/test-loop-3.c | tests/simple/test-loop-3.c | /* Challenging example:
To keep the relationship x = y - 1 while x <= 31 is easy.
The tricky part is when x = 32:
- We add one to x so the relationship between x and y is x = y so
the assertion still holds.
- Set err to 1.
Once err is one we don't update x or y anymore.
After the switch we lose whether err is 0 or 1 so we will
keep incrementing x and y.
*/
extern int nd(void);
extern void __VERIFIER_error(void) __attribute__((noreturn));
#define assert(X) if(!(X)){__VERIFIER_error();}
extern void __VERIFIER_assume (int v);
#define assume(X) __VERIFIER_assume(X)
int main(){
// Constructor
int x = 0;
int y = 1;
while (nd()) {
int fid = nd();
// We create snapshots for all state variables.
int nx = x;
int ny = y;
int err = 0;
switch (fid) {
case 0:
if (nx < 32) {
nx += 2;
ny += 2;
} else {
nx++;
err = 1;
}
break;
default:;;
}
if (err == 0) {
// Commit state changes.
x = nx;
y = ny;
}
}
assert(x <= y);
return 0;
}
| Add test that is unprovable for now | Add test that is unprovable for now
| C | apache-2.0 | seahorn/crab-llvm,seahorn/crab-llvm,seahorn/crab-llvm |
|
e80aaa099bf8da5fc89854af50cab0e93467ee01 | solutions/problem_10/solution.c | solutions/problem_10/solution.c | #include <stdlib.h>
#include <stdio.h>
#include "utils.h"
#define LIMIT 2000000
unsigned long solution(){
unsigned long n;
unsigned long total_sum = 0L;
n = 2L;
while(n <= LIMIT){
if(is_prime(n) == 1){
total_sum = total_sum + n;
}
n += 1L;
}
return total_sum;
}
int main(int argc, char *argv[]){
unsigned_long_time_it(solution);
return 0;
}
| Add C implementation for problem 10 | Add C implementation for problem 10
| C | mit | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler |
|
0fa14ec3cba7347d58bc4e1ec10273c129b87b29 | src/imap/cmd-create.c | src/imap/cmd-create.c | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "mail-namespace.h"
#include "commands.h"
bool cmd_create(struct client_command_context *cmd)
{
struct mail_namespace *ns;
const char *mailbox, *full_mailbox;
bool directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(cmd, 1, &mailbox))
return FALSE;
full_mailbox = mailbox;
ns = client_find_namespace(cmd, &mailbox);
if (ns == NULL)
return TRUE;
len = strlen(full_mailbox);
if (len == 0 || full_mailbox[len-1] != ns->sep)
directory = FALSE;
else {
/* name ends with hierarchy separator - client is just
informing us that it wants to create children under this
mailbox. */
directory = TRUE;
mailbox = t_strndup(mailbox, len-1);
full_mailbox = t_strndup(full_mailbox, strlen(full_mailbox)-1);
}
if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
return TRUE;
if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
client_send_storage_error(cmd, ns->storage);
else
client_send_tagline(cmd, "OK Create completed.");
return TRUE;
}
| /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "mail-namespace.h"
#include "commands.h"
bool cmd_create(struct client_command_context *cmd)
{
struct mail_namespace *ns;
const char *mailbox, *full_mailbox;
bool directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(cmd, 1, &mailbox))
return FALSE;
full_mailbox = mailbox;
ns = client_find_namespace(cmd, &mailbox);
if (ns == NULL)
return TRUE;
len = strlen(full_mailbox);
if (len == 0 || full_mailbox[len-1] != ns->sep)
directory = FALSE;
else {
/* name ends with hierarchy separator - client is just
informing us that it wants to create children under this
mailbox. */
directory = TRUE;
mailbox = t_strndup(mailbox, strlen(mailbox)-1);
full_mailbox = t_strndup(full_mailbox, len-1);
}
if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
return TRUE;
if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
client_send_storage_error(cmd, ns->storage);
else
client_send_tagline(cmd, "OK Create completed.");
return TRUE;
}
| CREATE ns_prefix/box/ didn't work right when namespace prefix existed. | CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
| C | mit | Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot |
018638ec7f304a4acd11b881be3d02bd6af966b4 | BindingShort.h | BindingShort.h | // This file is part of nbind, copyright (C) 2014-2015 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
#pragma once
#ifdef BUILDING_NODE_EXTENSION
#include "Binding.h"
#define NBIND_ERR(message) nbind::Bindings::setError(message)
#define NBIND_CLASS(Name) \
template<class Bound> struct BindInvoker { \
BindInvoker(); \
nbind::BindClass<Name> linkage; \
nbind::BindDefiner<Name> definer; \
}; \
static struct BindInvoker<Name> bindInvoker##Name; \
template<class Bound> BindInvoker<Bound>::BindInvoker():definer(#Name)
#define method(name) definer.function(#name, &Bound::name)
#define constructor definer.constructor
#define NBIND_INIT(moduleName) NODE_MODULE(moduleName, nbind::Bindings::initModule)
#else
#define NBIND_ERR(message)
#endif
| // This file is part of nbind, copyright (C) 2014-2015 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
#pragma once
#ifdef BUILDING_NODE_EXTENSION
#include "Binding.h"
#define NBIND_ERR(message) nbind::Bindings::setError(message)
#define NBIND_CLASS(Name) \
template<class Bound> struct BindInvoker { \
BindInvoker(); \
nbind::BindClass<Name> linkage; \
nbind::BindDefiner<Name> definer; \
}; \
static struct BindInvoker<Name> bindInvoker##Name; \
template<class Bound> BindInvoker<Bound>::BindInvoker():definer(#Name)
#define method(name) definer.function(#name, &Bound::name)
#define construct definer.constructor
#define NBIND_INIT(moduleName) NODE_MODULE(moduleName, nbind::Bindings::initModule)
#else
#define NBIND_ERR(message)
#endif
| Fix GCC keyword conflict with simpler API. | Fix GCC keyword conflict with simpler API.
| C | mit | charto/nbind,charto/nbind,charto/nbind,charto/nbind,charto/nbind,charto/nbind |
a7894a26d2e6487555024344f3fed9f5a8828140 | thrust/detail/casts.h | thrust/detail/casts.h | /*
* Copyright 2008-2009 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*! \file casts.h
* \brief Unsafe casts for internal use.
*/
#pragma once
#include <thrust/iterator/iterator_traits.h>
namespace thrust
{
namespace detail
{
namespace dispatch
{
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *
raw_pointer_cast(TrivialIterator i,
thrust::random_access_host_iterator_tag)
{
typedef typename thrust::iterator_traits<TrivialIterator>::value_type * Pointer;
// cast away constness
return const_cast<Pointer>(&*i);
} // end raw_pointer_cast()
// this path will work for device_ptr & device_vector::iterator
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *
raw_pointer_cast(TrivialIterator i,
thrust::random_access_device_iterator_tag)
{
typedef typename thrust::iterator_traits<TrivialIterator>::value_type * Pointer;
// cast away constness
return const_cast<Pointer>((&*i).get());
} // end raw_pointer_cast()
} // end dispatch
template<typename TrivialIterator>
typename thrust::iterator_traits<TrivialIterator>::value_type *raw_pointer_cast(TrivialIterator i)
{
return detail::dispatch::raw_pointer_cast(i, thrust::iterator_traits<TrivialIterator>::iterator_category());
} // end raw_pointer_cast()
} // end detail
} // end thrust
| Add git r done version of detail::raw_pointer_cast | Add git r done version of detail::raw_pointer_cast
| C | apache-2.0 | Vishwa07/thrust,lishi0927/thrust,malenie/thrust,bfurtaw/thrust,UIKit0/thrust,lishi0927/thrust,UIKit0/thrust,h1arshad/thrust,UIKit0/thrust,allendaicool/thrust,levendlee/thrust,rdmenezes/thrust,google-code-export/thrust,rdmenezes/thrust,julianromera/thrust,allendaicool/thrust,hemmingway/thrust,Vishwa07/thrust,julianromera/thrust,google-code-export/thrust,allendaicool/thrust,Vishwa07/thrust,bfurtaw/thrust,rdmenezes/thrust,rdmenezes/thrust,malenie/thrust,julianromera/thrust,levendlee/thrust,google-code-export/thrust,julianromera/thrust,malenie/thrust,lishi0927/thrust,levendlee/thrust,hemmingway/thrust,levendlee/thrust,UIKit0/thrust,Vishwa07/thrust,lishi0927/thrust,malenie/thrust,hemmingway/thrust,hemmingway/thrust,h1arshad/thrust,bfurtaw/thrust,allendaicool/thrust,google-code-export/thrust,h1arshad/thrust,bfurtaw/thrust,h1arshad/thrust |
|
c2d80c25893d00dfb8172caa05ac39b4eecaede1 | include/swift/Runtime/Once.h | include/swift/Runtime/Once.h | //===--- Once.h - Runtime support for lazy initialization ------*- C++ -*--===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Swift runtime functions in support of lazy initialization.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_RUNTIME_ONCE_H
#define SWIFT_RUNTIME_ONCE_H
#include "swift/Runtime/HeapObject.h"
namespace swift {
#ifdef __APPLE__
// On OS X and iOS, swift_once_t matches dispatch_once_t.
typedef long swift_once_t;
#else
// On other platforms swift_once_t is pointer-sized.
typedef int swift_once_t;
#endif
/// Runs the given function with the given context argument exactly once.
/// The predicate argument must point to a global or static variable of static
/// extent of type swift_once_t.
extern "C"
void swift_once(swift_once_t *predicate, void (*fn)(HeapObject *ctx),
HeapObject *ctx);
}
#endif
| //===--- Once.h - Runtime support for lazy initialization ------*- C++ -*--===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Swift runtime functions in support of lazy initialization.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_RUNTIME_ONCE_H
#define SWIFT_RUNTIME_ONCE_H
#include "swift/Runtime/HeapObject.h"
namespace swift {
#ifdef __APPLE__
// On OS X and iOS, swift_once_t matches dispatch_once_t.
typedef long swift_once_t;
#else
// On other platforms swift_once_t is pointer-sized.
typedef void *swift_once_t;
#endif
/// Runs the given function with the given context argument exactly once.
/// The predicate argument must point to a global or static variable of static
/// extent of type swift_once_t.
extern "C"
void swift_once(swift_once_t *predicate, void (*fn)(HeapObject *ctx),
HeapObject *ctx);
}
#endif
| Change swift_once_t to be actually pointer-sized on non-Darwin | Change swift_once_t to be actually pointer-sized on non-Darwin
Swift SVN r22384
| C | apache-2.0 | nathawes/swift,danielmartin/swift,ben-ng/swift,jtbandes/swift,ken0nek/swift,gregomni/swift,Ivacker/swift,gottesmm/swift,LeoShimonaka/swift,gregomni/swift,tardieu/swift,swiftix/swift,adrfer/swift,xedin/swift,KrishMunot/swift,tardieu/swift,kentya6/swift,djwbrown/swift,swiftix/swift.old,devincoughlin/swift,zisko/swift,SwiftAndroid/swift,parkera/swift,gmilos/swift,roambotics/swift,OscarSwanros/swift,jtbandes/swift,karwa/swift,ahoppen/swift,russbishop/swift,practicalswift/swift,kusl/swift,mightydeveloper/swift,MukeshKumarS/Swift,calebd/swift,kperryua/swift,felix91gr/swift,atrick/swift,practicalswift/swift,frootloops/swift,felix91gr/swift,swiftix/swift,JGiola/swift,devincoughlin/swift,austinzheng/swift,practicalswift/swift,slavapestov/swift,hooman/swift,kentya6/swift,glessard/swift,jmgc/swift,sdulal/swift,huonw/swift,hughbe/swift,felix91gr/swift,OscarSwanros/swift,sschiau/swift,jmgc/swift,MukeshKumarS/Swift,therealbnut/swift,frootloops/swift,codestergit/swift,tjw/swift,mightydeveloper/swift,xwu/swift,sschiau/swift,nathawes/swift,modocache/swift,Ivacker/swift,uasys/swift,CodaFi/swift,roambotics/swift,uasys/swift,tinysun212/swift-windows,roambotics/swift,gregomni/swift,devincoughlin/swift,khizkhiz/swift,felix91gr/swift,kstaring/swift,xedin/swift,kentya6/swift,mightydeveloper/swift,parkera/swift,brentdax/swift,ben-ng/swift,hughbe/swift,tinysun212/swift-windows,lorentey/swift,Jnosh/swift,Ivacker/swift,khizkhiz/swift,xedin/swift,rudkx/swift,gottesmm/swift,ahoppen/swift,lorentey/swift,roambotics/swift,calebd/swift,austinzheng/swift,modocache/swift,sdulal/swift,benlangmuir/swift,stephentyrone/swift,austinzheng/swift,xwu/swift,uasys/swift,devincoughlin/swift,sdulal/swift,danielmartin/swift,LeoShimonaka/swift,kentya6/swift,tkremenek/swift,austinzheng/swift,stephentyrone/swift,arvedviehweger/swift,hooman/swift,JaSpa/swift,dduan/swift,KrishMunot/swift,IngmarStein/swift,felix91gr/swift,glessard/swift,nathawes/swift,slavapestov/swift,ben-ng/swift,russbishop/swift,Jnosh/swift,djwbrown/swift,therealbnut/swift,kusl/swift,codestergit/swift,OscarSwanros/swift,austinzheng/swift,kperryua/swift,milseman/swift,airspeedswift/swift,alblue/swift,JGiola/swift,manavgabhawala/swift,cbrentharris/swift,cbrentharris/swift,roambotics/swift,jopamer/swift,gmilos/swift,gribozavr/swift,arvedviehweger/swift,uasys/swift,zisko/swift,amraboelela/swift,manavgabhawala/swift,CodaFi/swift,ben-ng/swift,OscarSwanros/swift,gribozavr/swift,jopamer/swift,huonw/swift,milseman/swift,brentdax/swift,aschwaighofer/swift,shahmishal/swift,jmgc/swift,swiftix/swift.old,emilstahl/swift,adrfer/swift,CodaFi/swift,CodaFi/swift,shahmishal/swift,zisko/swift,manavgabhawala/swift,amraboelela/swift,cbrentharris/swift,uasys/swift,frootloops/swift,nathawes/swift,zisko/swift,deyton/swift,jopamer/swift,kstaring/swift,cbrentharris/swift,mightydeveloper/swift,swiftix/swift.old,stephentyrone/swift,rudkx/swift,khizkhiz/swift,lorentey/swift,harlanhaskins/swift,kperryua/swift,dduan/swift,kperryua/swift,MukeshKumarS/Swift,gmilos/swift,practicalswift/swift,gmilos/swift,LeoShimonaka/swift,tkremenek/swift,aschwaighofer/swift,jckarter/swift,return/swift,kusl/swift,codestergit/swift,CodaFi/swift,allevato/swift,tinysun212/swift-windows,codestergit/swift,practicalswift/swift,gribozavr/swift,milseman/swift,airspeedswift/swift,khizkhiz/swift,rudkx/swift,lorentey/swift,dduan/swift,karwa/swift,modocache/swift,kentya6/swift,shajrawi/swift,jckarter/swift,jtbandes/swift,practicalswift/swift,devincoughlin/swift,bitjammer/swift,Ivacker/swift,johnno1962d/swift,return/swift,tinysun212/swift-windows,deyton/swift,ken0nek/swift,shahmishal/swift,sschiau/swift,JGiola/swift,dreamsxin/swift,slavapestov/swift,dduan/swift,bitjammer/swift,manavgabhawala/swift,arvedviehweger/swift,JaSpa/swift,ken0nek/swift,jckarter/swift,shajrawi/swift,kusl/swift,gregomni/swift,deyton/swift,tjw/swift,johnno1962d/swift,johnno1962d/swift,hughbe/swift,IngmarStein/swift,parkera/swift,SwiftAndroid/swift,stephentyrone/swift,xedin/swift,modocache/swift,return/swift,bitjammer/swift,swiftix/swift.old,LeoShimonaka/swift,therealbnut/swift,devincoughlin/swift,swiftix/swift,sschiau/swift,sdulal/swift,danielmartin/swift,dduan/swift,cbrentharris/swift,xedin/swift,allevato/swift,russbishop/swift,sschiau/swift,brentdax/swift,apple/swift,harlanhaskins/swift,allevato/swift,kperryua/swift,sschiau/swift,austinzheng/swift,adrfer/swift,xwu/swift,aschwaighofer/swift,alblue/swift,natecook1000/swift,gribozavr/swift,gmilos/swift,tkremenek/swift,mightydeveloper/swift,calebd/swift,tinysun212/swift-windows,sdulal/swift,adrfer/swift,milseman/swift,swiftix/swift,mightydeveloper/swift,KrishMunot/swift,airspeedswift/swift,allevato/swift,apple/swift,amraboelela/swift,stephentyrone/swift,therealbnut/swift,harlanhaskins/swift,lorentey/swift,tjw/swift,arvedviehweger/swift,tardieu/swift,swiftix/swift,MukeshKumarS/Swift,xwu/swift,apple/swift,jmgc/swift,benlangmuir/swift,arvedviehweger/swift,CodaFi/swift,bitjammer/swift,nathawes/swift,shajrawi/swift,brentdax/swift,adrfer/swift,lorentey/swift,modocache/swift,tardieu/swift,shahmishal/swift,JaSpa/swift,tinysun212/swift-windows,LeoShimonaka/swift,brentdax/swift,return/swift,zisko/swift,kperryua/swift,tkremenek/swift,IngmarStein/swift,harlanhaskins/swift,allevato/swift,gottesmm/swift,benlangmuir/swift,natecook1000/swift,atrick/swift,roambotics/swift,OscarSwanros/swift,uasys/swift,johnno1962d/swift,tardieu/swift,kperryua/swift,bitjammer/swift,ahoppen/swift,cbrentharris/swift,jmgc/swift,emilstahl/swift,shajrawi/swift,ben-ng/swift,lorentey/swift,xwu/swift,Ivacker/swift,calebd/swift,kstaring/swift,glessard/swift,natecook1000/swift,slavapestov/swift,rudkx/swift,hooman/swift,atrick/swift,gottesmm/swift,codestergit/swift,codestergit/swift,Jnosh/swift,brentdax/swift,parkera/swift,stephentyrone/swift,swiftix/swift.old,xwu/swift,emilstahl/swift,gribozavr/swift,slavapestov/swift,atrick/swift,tjw/swift,LeoShimonaka/swift,frootloops/swift,hughbe/swift,manavgabhawala/swift,karwa/swift,arvedviehweger/swift,JaSpa/swift,MukeshKumarS/Swift,adrfer/swift,jopamer/swift,deyton/swift,xedin/swift,kentya6/swift,gottesmm/swift,dduan/swift,jmgc/swift,xedin/swift,parkera/swift,zisko/swift,manavgabhawala/swift,LeoShimonaka/swift,rudkx/swift,devincoughlin/swift,arvedviehweger/swift,karwa/swift,therealbnut/swift,kstaring/swift,JaSpa/swift,tkremenek/swift,alblue/swift,zisko/swift,russbishop/swift,ben-ng/swift,kstaring/swift,jopamer/swift,tjw/swift,karwa/swift,djwbrown/swift,jckarter/swift,gribozavr/swift,Jnosh/swift,xwu/swift,gmilos/swift,ahoppen/swift,gregomni/swift,milseman/swift,jckarter/swift,aschwaighofer/swift,airspeedswift/swift,SwiftAndroid/swift,atrick/swift,dduan/swift,danielmartin/swift,slavapestov/swift,ahoppen/swift,sdulal/swift,karwa/swift,slavapestov/swift,amraboelela/swift,johnno1962d/swift,return/swift,hooman/swift,Jnosh/swift,rudkx/swift,SwiftAndroid/swift,huonw/swift,swiftix/swift.old,russbishop/swift,uasys/swift,IngmarStein/swift,huonw/swift,kusl/swift,harlanhaskins/swift,tardieu/swift,modocache/swift,dreamsxin/swift,swiftix/swift,JGiola/swift,gribozavr/swift,glessard/swift,Jnosh/swift,harlanhaskins/swift,practicalswift/swift,jopamer/swift,SwiftAndroid/swift,alblue/swift,Ivacker/swift,swiftix/swift.old,OscarSwanros/swift,hughbe/swift,shahmishal/swift,khizkhiz/swift,jmgc/swift,JaSpa/swift,khizkhiz/swift,kusl/swift,alblue/swift,jtbandes/swift,tkremenek/swift,allevato/swift,ahoppen/swift,gottesmm/swift,shajrawi/swift,johnno1962d/swift,danielmartin/swift,KrishMunot/swift,hooman/swift,tardieu/swift,gmilos/swift,emilstahl/swift,airspeedswift/swift,karwa/swift,gottesmm/swift,nathawes/swift,stephentyrone/swift,codestergit/swift,parkera/swift,frootloops/swift,tjw/swift,kstaring/swift,IngmarStein/swift,deyton/swift,calebd/swift,swiftix/swift.old,ken0nek/swift,felix91gr/swift,airspeedswift/swift,parkera/swift,danielmartin/swift,austinzheng/swift,hughbe/swift,therealbnut/swift,glessard/swift,russbishop/swift,amraboelela/swift,sdulal/swift,IngmarStein/swift,djwbrown/swift,apple/swift,KrishMunot/swift,parkera/swift,manavgabhawala/swift,modocache/swift,shahmishal/swift,ken0nek/swift,apple/swift,kstaring/swift,IngmarStein/swift,adrfer/swift,benlangmuir/swift,milseman/swift,SwiftAndroid/swift,mightydeveloper/swift,MukeshKumarS/Swift,natecook1000/swift,jckarter/swift,natecook1000/swift,ken0nek/swift,JGiola/swift,danielmartin/swift,cbrentharris/swift,calebd/swift,amraboelela/swift,deyton/swift,Ivacker/swift,JaSpa/swift,JGiola/swift,SwiftAndroid/swift,jckarter/swift,jtbandes/swift,kusl/swift,gribozavr/swift,gregomni/swift,deyton/swift,emilstahl/swift,aschwaighofer/swift,bitjammer/swift,airspeedswift/swift,OscarSwanros/swift,emilstahl/swift,calebd/swift,natecook1000/swift,khizkhiz/swift,aschwaighofer/swift,amraboelela/swift,LeoShimonaka/swift,huonw/swift,tkremenek/swift,sdulal/swift,emilstahl/swift,jopamer/swift,Ivacker/swift,shahmishal/swift,sschiau/swift,CodaFi/swift,kusl/swift,glessard/swift,kentya6/swift,MukeshKumarS/Swift,bitjammer/swift,ben-ng/swift,felix91gr/swift,therealbnut/swift,sschiau/swift,cbrentharris/swift,atrick/swift,johnno1962d/swift,lorentey/swift,tinysun212/swift-windows,KrishMunot/swift,benlangmuir/swift,KrishMunot/swift,Jnosh/swift,kentya6/swift,mightydeveloper/swift,natecook1000/swift,harlanhaskins/swift,shajrawi/swift,huonw/swift,frootloops/swift,brentdax/swift,hooman/swift,devincoughlin/swift,nathawes/swift,hooman/swift,djwbrown/swift,huonw/swift,xedin/swift,swiftix/swift,tjw/swift,return/swift,alblue/swift,jtbandes/swift,shajrawi/swift,allevato/swift,djwbrown/swift,apple/swift,jtbandes/swift,hughbe/swift,aschwaighofer/swift,djwbrown/swift,frootloops/swift,emilstahl/swift,return/swift,benlangmuir/swift,russbishop/swift,karwa/swift,ken0nek/swift,milseman/swift,practicalswift/swift,shahmishal/swift,shajrawi/swift,alblue/swift |
9798249d63e84964367186af697156e76dffa06c | tests/regression/02-base/56-printf-ptr.c | tests/regression/02-base/56-printf-ptr.c | #include <stdio.h>
#include <assert.h>
int main() {
int x = 42;
printf("&x = %p\n", &x); // doesn't invalidate x despite taking address
assert(x == 42);
return 0;
}
| Add test where printf shouldn't invalidate pointer argument | Add test where printf shouldn't invalidate pointer argument
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
b165ed7f282b736bb7fe9fa5e98455a437d23fa4 | test/CodeGen/arm-asm-variable.c | test/CodeGen/arm-asm-variable.c | // RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s
#include <stdint.h>
#define ldrex_func(p, rl, rh) \
__asm__ __volatile__( \
"ldrexd%[_rl], %[_rh], [%[_p]]" \
: [_rl] "=&r" (rl), [_rh] "=&r" (rh) \
: [_p] "p" (p) : "memory")
int64_t foo(int64_t v, volatile int64_t *p)
{
register uint32_t rl asm("r1");
register uint32_t rh asm("r2");
int64_t r;
uint32_t t;
__asm__ __volatile__( \
"ldrexd%[_rl], %[_rh], [%[_p]]" \
: [_rl] "=&r" (rl), [_rh] "=&r" (rh) \
: [_p] "p" (p) : "memory");
// CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64* %tmp)
return r;
}
| // RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s
#include <stdint.h>
#define ldrex_func(p, rl, rh) \
__asm__ __volatile__( \
"ldrexd%[_rl], %[_rh], [%[_p]]" \
: [_rl] "=&r" (rl), [_rh] "=&r" (rh) \
: [_p] "p" (p) : "memory")
int64_t foo(int64_t v, volatile int64_t *p)
{
register uint32_t rl asm("r1");
register uint32_t rh asm("r2");
int64_t r;
uint32_t t;
__asm__ __volatile__( \
"ldrexd%[_rl], %[_rh], [%[_p]]" \
: [_rl] "=&r" (rl), [_rh] "=&r" (rh) \
: [_p] "p" (p) : "memory");
// CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64*
return r;
}
| Make this test suitable for optimized builds by avoiding the name. | Make this test suitable for optimized builds by avoiding the name.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@133238 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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
cf6afff7e568d87b92f9bbdae6e3c6608a981e6a | Classes/KRCloudSyncBlocks.h | Classes/KRCloudSyncBlocks.h | //
// KRCloudSyncBlocks.h
// CloudSync
//
// Created by allting on 12. 10. 19..
// Copyright (c) 2012년 allting. All rights reserved.
//
#ifndef CloudSync_KRCloudSyncBlocks_h
#define CloudSync_KRCloudSyncBlocks_h
@class KRSyncItem;
typedef void (^KRCloudSyncStartBlock)(NSArray* syncItems);
typedef void (^KRCloudSyncProgressBlock)(KRSyncItem* synItem, float progress);
typedef void (^KRCloudSyncCompletedBlock)(NSArray* syncItems, NSError* error);
typedef void (^KRCloudSyncResultBlock)(BOOL succeeded, NSError* error);
typedef void (^KRCloudSyncPublishingURLBlock)(NSURL* url, BOOL succeeded, NSError* error);
typedef void (^KRResourcesCompletedBlock)(NSArray* resources, NSError* error);
typedef void (^KRServiceAvailableBlock)(BOOL available);
typedef void (^KRiCloudRemoveFileBlock)(BOOL succeeded, NSError* error);
#endif
| //
// KRCloudSyncBlocks.h
// CloudSync
//
// Created by allting on 12. 10. 19..
// Copyright (c) 2012년 allting. All rights reserved.
//
#ifndef CloudSync_KRCloudSyncBlocks_h
#define CloudSync_KRCloudSyncBlocks_h
@class KRSyncItem;
typedef void (^KRCloudSyncStartBlock)(NSArray* syncItems);
typedef void (^KRCloudSyncProgressBlock)(KRSyncItem* synItem, CGFloat progress);
typedef void (^KRCloudSyncCompletedBlock)(NSArray* syncItems, NSError* error);
typedef void (^KRCloudSyncResultBlock)(BOOL succeeded, NSError* error);
typedef void (^KRCloudSyncPublishingURLBlock)(NSURL* url, BOOL succeeded, NSError* error);
typedef void (^KRResourcesCompletedBlock)(NSArray* resources, NSError* error);
typedef void (^KRServiceAvailableBlock)(BOOL available);
typedef void (^KRiCloudRemoveFileBlock)(BOOL succeeded, NSError* error);
#endif
| Support amd64. Release 2.3.5. Replace crittercism sdk.(ver 4.3.7) | Support amd64.
Release 2.3.5.
Replace crittercism sdk.(ver 4.3.7)
| C | mit | MindPreview/KRCloudSync,MindPreview/KRCloudSync |
2e1f71bdc24f162a88b0262350743d641b67bc4d | src/os/Win32/plugin.h | src/os/Win32/plugin.h | #ifndef PLUGIN_H_
#define PLUGIN_H_
#include <windows.h>
#define EXPORT_CALLING __stdcall
#define EXPORT __declspec(dllexport) EXPORT_CALLING
#include "common.h"
// just defined to make compilation work ; ignored
#define RTLD_DEFAULT NULL
#define RTLD_LOCAL -1
#define RTLD_LAZY -1
static inline void *dlopen(const char *name, int flags)
{
// TODO use LoadLibraryEx() and flags ?
return LoadLibrary(name);
}
static inline void *dlsym(void *handle, const char *name)
{
FARPROC g = GetProcAddress(handle, name);
void *h;
*(FARPROC*)&h = g;
return h;
}
static inline char *dlerror(void)
{
static __thread char buf[1024];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&buf,
sizeof buf, NULL);
return buf;
}
static inline int dlclose(void *handle)
{
return !FreeLibrary(handle);
}
#endif
| #ifndef PLUGIN_H_
#define PLUGIN_H_
#include <windows.h>
// TODO use __stdcall
#define EXPORT_CALLING __cdecl
#define EXPORT __declspec(dllexport) EXPORT_CALLING
#include "common.h"
// just defined to make compilation work ; ignored
#define RTLD_DEFAULT NULL
#define RTLD_LOCAL -1
#define RTLD_LAZY -1
static inline void *dlopen(const char *name, int flags)
{
// TODO use LoadLibraryEx() and flags ?
return LoadLibrary(name);
}
static inline void *dlsym(void *handle, const char *name)
{
FARPROC g = GetProcAddress(handle, name);
void *h;
*(FARPROC*)&h = g;
return h;
}
static inline char *dlerror(void)
{
static __thread char buf[1024];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&buf,
sizeof buf, NULL);
return buf;
}
static inline int dlclose(void *handle)
{
return !FreeLibrary(handle);
}
#endif
| Switch to __cdecl till we get --kill-at to work | Switch to __cdecl till we get --kill-at to work
With this build, 32-bit windows DLL loads and checks out, but we really
want to use __stdcall for the DLL entry points.
| C | mit | kulp/tenyr,kulp/tenyr,kulp/tenyr |
7752089ccdc6fd6c25c0af25275752cf2317eb0b | common.h | common.h | #ifndef _COMMON_H
#define _COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef _LINUX
#include <bsd/string.h>
#endif
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlsave.h>
#include <libxml/encoding.h>
#include <libxml/xmlstring.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#ifndef _READLINE
#include <histedit.h>
#else
#include <readline/readline.h>
#include <readline/history.h>
#endif
#define NAME "kc"
#define VERSION "2.2.0"
#define USAGE "[-k database file] [-r] [-p password file] [-m cipher mode] [-b] [-v] [-h]"
#define PASSWORD_MAXLEN 64
enum {
KC_GENERATE_IV = 1,
KC_GENERATE_SALT = 1 << 1,
KC_GENERATE_KEY = 1 << 2
};
#ifndef _READLINE
const char *el_prompt_null(void);
#endif
const char *prompt_str(void);
int malloc_check(void *);
void version(void);
void quit(int);
#endif
| #ifndef _COMMON_H
#define _COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef _LINUX
#include <bsd/string.h>
#endif
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlsave.h>
#include <libxml/encoding.h>
#include <libxml/xmlstring.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#ifndef _READLINE
#include <histedit.h>
#else
#include <readline/readline.h>
#include <readline/history.h>
#endif
#define NAME "kc"
#define VERSION "2.2.0rc2"
#define USAGE "[-k database file] [-r] [-p password file] [-m cipher mode] [-b] [-v] [-h]"
#define PASSWORD_MAXLEN 64
enum {
KC_GENERATE_IV = 1,
KC_GENERATE_SALT = 1 << 1,
KC_GENERATE_KEY = 1 << 2
};
#ifndef _READLINE
const char *el_prompt_null(void);
#endif
const char *prompt_str(void);
int malloc_check(void *);
void version(void);
void quit(int);
#endif
| Call this version what it is. Missed in earlier. | Call this version what it is. Missed in earlier.
| C | bsd-2-clause | levaidaniel/kc,levaidaniel/kc,levaidaniel/kc |
c3767e9e67b7cf8d3b1c562ba5d260a42baabf1d | config.h | config.h | #ifndef PICAM_CONFIG_H
#define PICAM_CONFIG_H
#if defined(__cplusplus)
extern "C" {
#endif
// Even if we specify 30 FPS, Raspberry Pi Camera provides slighly lower FPS.
#define TARGET_FPS 30
#define GOP_SIZE TARGET_FPS
#define H264_BIT_RATE 3000 * 1000 // 3 Mbps
// 1600x900 is the upper limit if you don't use tunnel from camera to video_encode.
// 720p (1280x720) is good enough for most cases.
#define WIDTH 1280
#define HEIGHT 720
// Choose the value that results in non-repeating decimal when divided by 90000.
// e.g. 48000 and 32000 are fine, but 44100 and 22050 are bad.
#define AUDIO_SAMPLE_RATE 48000
#define AAC_BIT_RATE 40000 // 40 kbps
// Set this value to 1 if you want to produce audio-only stream for debugging.
#define AUDIO_ONLY 0
#if defined(__cplusplus)
}
#endif
#endif
| #ifndef PICAM_CONFIG_H
#define PICAM_CONFIG_H
#if defined(__cplusplus)
extern "C" {
#endif
// 1600x900 is the upper limit if you don't use tunnel from camera to video_encode.
// 720p (1280x720) is good enough for most cases.
#define WIDTH 1280
#define HEIGHT 720
// Even if we specify 30 FPS, Raspberry Pi Camera provides slighly lower FPS.
#define TARGET_FPS 30
// Distance between two key frames
#define GOP_SIZE TARGET_FPS
#define H264_BIT_RATE 2000 * 1000 // 2 Mbps
// Choose the value that results in non-repeating decimal when divided by 90000.
// e.g. 48000 and 32000 are fine, but 44100 and 22050 are bad.
#define AUDIO_SAMPLE_RATE 48000
#define AAC_BIT_RATE 40000 // 40 Kbps
// Set this value to 1 if you want to produce audio-only stream for debugging.
#define AUDIO_ONLY 0
#if defined(__cplusplus)
}
#endif
#endif
| Change video bitrate to 2 Mbps | Change video bitrate to 2 Mbps
| C | lgpl-2.1 | iizukanao/picam,Rutong/picam,thagenbeek/picam,thagenbeek/picam,iizukanao/picam,iizukanao/picam,thagenbeek/picam,Rutong/picam |
a07ddde4fa630539f5bd13d22485dd4715b067e1 | argv.h | argv.h | /*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in
* the LICENSE file in the root directory of this source tree. An
* additional grant of patent rights can be found in the PATENTS file
* in the same directory.
*
*/
#pragma once
#include <stddef.h>
size_t argv_count(const char* const* argv);
const char** argv_concat(const char* const* argv1, ...);
const char** argv_concat_deepcopy(const char* const* argv1, ...);
extern const char* const empty_argv[];
| /*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in
* the LICENSE file in the root directory of this source tree. An
* additional grant of patent rights can be found in the PATENTS file
* in the same directory.
*
*/
#pragma once
#include <stddef.h>
size_t argv_count(const char* const* argv);
const char** argv_concat(const char* const* argv1, ...);
const char** argv_concat_deepcopy(const char* const* argv1, ...);
extern const char* const empty_argv[];
#define ARGV(...) ((const char*[]){__VA_ARGS__ , NULL})
#define ARGV_CONCAT(...) argv_concat(__VA_ARGS__ , NULL)
| Add ARGV and ARGV_CONCAT macros | Add ARGV and ARGV_CONCAT macros
| C | bsd-3-clause | JuudeDemos/fb-adb,JuudeDemos/fb-adb,tcmulcahy/fb-adb,JuudeDemos/fb-adb,0359xiaodong/fb-adb,tcmulcahy/fb-adb,biddyweb/fb-adb,biddyweb/fb-adb,tcmulcahy/fb-adb,biddyweb/fb-adb,0359xiaodong/fb-adb,0359xiaodong/fb-adb |
6ffac22050217acb02c85c9f199c2bb18131b484 | main.c | main.c | // Copyright 2016, Jeffrey E. Bedard
#include "xstatus.h"
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static const char * helptext =
"DESCRIPTION: Simple X toolbar for minimalistic"
" window managers.\n"
"USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
"\t-d DELAY Set delay between status updates,"
" in seconds.\n"
"\t-f FILE Set FILE to be continuously polled and"
" displayed.\n"
"\t-h Print this usage information. \n"
"Copyright 2016, Jeffrey E. Bedard <[email protected]>\n"
"Project page: https://github.com/jefbed/xstatus\n";
int main(int argc, char ** argv)
{
char *filename=DEFAULTF;
uint8_t delay=1;
int opt;
while((opt = getopt(argc, argv, "d:f:h")) != -1) {
switch(opt) {
case 'd':
delay=atoi(optarg);
break;
case 'f':
filename=optarg;
break;
case 'h':
default:
fprintf(stdout, "%s", helptext);
exit(0);
}
}
run_xstatus(filename, delay);
}
| // Copyright 2016, Jeffrey E. Bedard
#include "xstatus.h"
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static const char helptext[] =
"DESCRIPTION: Simple X toolbar for minimalistic"
" window managers.\n"
"USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
"\t-d DELAY Set delay between status updates,"
" in seconds.\n"
"\t-f FILE Set FILE to be continuously polled and"
" displayed.\n"
"\t-h Print this usage information. \n"
"Copyright 2016, Jeffrey E. Bedard <[email protected]>\n"
"Project page: https://github.com/jefbed/xstatus\n";
int main(int argc, char ** argv)
{
char *filename=DEFAULTF;
uint8_t delay=1;
int opt;
while((opt = getopt(argc, argv, "d:f:h")) != -1) {
switch(opt) {
case 'd':
delay=atoi(optarg);
break;
case 'f':
filename=optarg;
break;
case 'h':
default:
write(2, helptext, sizeof(helptext));
exit(0);
}
}
run_xstatus(filename, delay);
}
| Use write(2) to display helptext. | Use write(2) to display helptext.
| C | mit | jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus |
f9e0b90cd8c66238a9e267fd78b95d0146b89064 | SmartDeviceLink/SDLMacros.h | SmartDeviceLink/SDLMacros.h | //
// SDLMacros.h
// SmartDeviceLink-iOS
//
// Created by Muller, Alexander (A.) on 10/17/16.
// Copyright © 2016 smartdevicelink. All rights reserved.
//
#ifndef SDLMacros_h
#define SDLMacros_h
// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
#if __has_attribute(NS_STRING_ENUM)
#define SDL_SWIFT_ENUM NS_STRING_ENUM
#else
#define SDL_SWIFT_ENUM
#endif
#endif
#endif /* SDLMacros_h */
| //
// SDLMacros.h
// SmartDeviceLink-iOS
//
// Created by Muller, Alexander (A.) on 10/17/16.
// Copyright © 2016 smartdevicelink. All rights reserved.
//
#ifndef SDLMacros_h
#define SDLMacros_h
// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
#if __has_attribute(swift_wrapper)
#define SDL_SWIFT_ENUM NS_STRING_ENUM
#else
#define SDL_SWIFT_ENUM
#endif
#endif
#endif /* SDLMacros_h */
| Revert "Changed macro to look specifically for NS_STRING_ENUM" | Revert "Changed macro to look specifically for NS_STRING_ENUM"
This reverts commit de01a9f7b3ed63f683604d3595568bacf5f54a5e.
| C | bsd-3-clause | FordDev/sdl_ios,FordDev/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,APCVSRepo/sdl_ios,smartdevicelink/sdl_ios,FordDev/sdl_ios,FordDev/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios |
6634d796894e48cdd9247687eb7edc233fb77d23 | slavetypes.h | slavetypes.h | typedef struct
{
uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready
uint8_t *Frame; //Response frame content
} MODBUSResponseStatus; //Type containing information about frame that is set up at slave side
typedef struct
{
uint8_t Address;
uint16_t *Registers;
uint16_t RegisterCount;
MODBUSResponseStatus Response;
} MODBUSSlaveStatus; //Type containing slave device configuration data
| Move types declarations to new file | Move types declarations to new file
| C | mit | Jacajack/modlib |
|
d4aa975d6504cf9c0653775cb9bee4976db48f36 | src/mmu.h | src/mmu.h | #pragma once
#include "address.h"
#include "options.h"
#include "cartridge/cartridge.h"
#include <vector>
#include <memory>
class Video;
class CPU;
class Serial;
class Input;
class Timer;
class MMU {
public:
MMU(std::shared_ptr<Cartridge> inCartridge, CPU& inCPU, Video& inVideo, Input& input, Serial& serial, Timer& timer, Options& options);
auto read(const Address& address) const -> u8;
void write(const Address& address, u8 byte);
private:
auto boot_rom_active() const -> bool;
auto read_io(const Address& address) const -> u8;
void write_io(const Address& address, u8 byte);
auto memory_read(const Address& address) const -> u8;
void memory_write(const Address& address, u8 byte);
void dma_transfer(const u8 byte);
std::shared_ptr<Cartridge> cartridge;
CPU& cpu;
Video& video;
Input& input;
Serial& serial;
Timer& timer;
Options& options;
std::vector<u8> memory;
friend class Debugger;
};
| #pragma once
#include "address.h"
#include "options.h"
#include "cartridge/cartridge.h"
#include <vector>
#include <memory>
class Video;
class CPU;
class Serial;
class Input;
class Timer;
class MMU {
public:
MMU(std::shared_ptr<Cartridge> inCartridge, CPU& inCPU, Video& inVideo, Input& input, Serial& serial, Timer& timer, Options& options);
auto read(const Address& address) const -> u8;
void write(const Address& address, u8 byte);
private:
auto boot_rom_active() const -> bool;
auto read_io(const Address& address) const -> u8;
void write_io(const Address& address, u8 byte);
auto memory_read(const Address& address) const -> u8;
void memory_write(const Address& address, u8 byte);
void dma_transfer(u8 byte);
std::shared_ptr<Cartridge> cartridge;
CPU& cpu;
Video& video;
Input& input;
Serial& serial;
Timer& timer;
Options& options;
std::vector<u8> memory;
friend class Debugger;
};
| Remove unnecessary const qualifier in function declaration | Remove unnecessary const qualifier in function declaration
| C | bsd-3-clause | jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator |
3225819105d4aeea7f374963cfb9d001e3add21b | include/inform/inform.h | include/inform/inform.h | // Copyright 2016 ELIFE. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
#pragma once
#include <inform/dist.h>
#include <inform/entropy.h>
#include <inform/state_encoding.h>
#include <inform/active_info.h>
#include <inform/entropy_rate.h>
#include <inform/transfer_entropy.h>
| // Copyright 2016 ELIFE. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
#pragma once
#include <inform/dist.h>
#include <inform/shannon.h>
#include <inform/state_encoding.h>
#include <inform/active_info.h>
#include <inform/entropy_rate.h>
#include <inform/transfer_entropy.h>
| Include shannon.h instead of entropy.h | Include shannon.h instead of entropy.h
| C | mit | dglmoore/Inform,ELIFE-ASU/Inform,ELIFE-ASU/Inform,dglmoore/Inform |
b50d0ebfcb55a818f6ffd78838fef642e8a9ca07 | include/dt-bindings/clock/mcux_lpc_syscon_clock.h | include/dt-bindings/clock/mcux_lpc_syscon_clock.h | /*
* Copyright (c) 2020, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MCUX_LPC_SYSCON_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MCUX_LPC_SYSCON_H_
#define MCUX_FLEXCOMM0_CLK 0
#define MCUX_FLEXCOMM1_CLK 1
#define MCUX_FLEXCOMM2_CLK 2
#define MCUX_FLEXCOMM3_CLK 3
#define MCUX_FLEXCOMM4_CLK 4
#define MCUX_FLEXCOMM5_CLK 5
#define MCUX_FLEXCOMM6_CLK 6
#define MCUX_FLEXCOMM7_CLK 7
#define MCUX_HS_SPI_CLK 8
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MCUX_LPC_SYSCON_H_ */
| Add NXP LPC clock control driver | include: Add NXP LPC clock control driver
DTS bindings file for NXP LPC clock control driver that
uses the MCUX SDK drivers
Signed-off-by: Mahesh Mahadevan <[email protected]>
| C | apache-2.0 | Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,galak/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,galak/zephyr,nashif/zephyr,finikorg/zephyr,galak/zephyr,Vudentz/zephyr,nashif/zephyr,finikorg/zephyr |
|
cdf007579b40a6de97eed519fae989398f9dcf26 | src/lib/RandomnessDelegate.h | src/lib/RandomnessDelegate.h | //
// RandomnessDelegate.h
// jdemon
//
// Created by Mark Larus on 3/19/13.
// Copyright (c) 2013 Kenyon College. All rights reserved.
//
#ifndef __jdemon__RandomnessDelegate__
#define __jdemon__RandomnessDelegate__
#include <gsl/gsl_rng.h>
#include <stdexcept>
namespace Randomness {
class Delegate {
protected:
Delegate() {}
public:
virtual bool binaryEventWithProbability(double probabilityOfHappening) = 0;
virtual int randomIntegerFromInclusiveRange(int begin, int end) = 0;
};
class GSLDelegate : public Delegate {
gsl_rng *RNG;
public:
bool binaryEventWithProbability( double probabilityOfHappening ) {
return gsl_rng_get(RNG) < probabilityOfHappening ? 1 : 0;
};
int randomIntegerFromInclusiveRange(int begin, int end) {
if (end<begin) {
throw std::runtime_error("Invalid RNG range. 'begin' must be less than 'end'");
}
return (int)gsl_rng_uniform_int(RNG, end-begin) + begin;
}
GSLDelegate(gsl_rng *r) : RNG(r) {}
};
}
#endif /* defined(__jdemon__RandomnessDelegate__) */
| //
// RandomnessDelegate.h
// jdemon
//
// Created by Mark Larus on 3/19/13.
// Copyright (c) 2013 Kenyon College. All rights reserved.
//
#ifndef __jdemon__RandomnessDelegate__
#define __jdemon__RandomnessDelegate__
#include <gsl/gsl_rng.h>
#include <stdexcept>
namespace Randomness {
class Delegate {
protected:
Delegate() {}
public:
virtual bool binaryEventWithProbability(double probabilityOfHappening) = 0;
virtual int randomIntegerFromInclusiveRange(int begin, int end) = 0;
};
class GSLDelegate : public Delegate {
gsl_rng *RNG;
public:
bool binaryEventWithProbability( double probabilityOfHappening ) {
return gsl_rng_uniform(RNG) < probabilityOfHappening ? 1 : 0;
};
int randomIntegerFromInclusiveRange(int begin, int end) {
if (end<begin) {
throw std::runtime_error("Invalid RNG range. 'begin' must be less than 'end'");
}
return (int)gsl_rng_uniform_int(RNG, end-begin) + begin;
}
GSLDelegate(gsl_rng *r) : RNG(r) {}
};
}
#endif /* defined(__jdemon__RandomnessDelegate__) */
| Use gsl_rng_uniform instead of gsl_rng_get | Use gsl_rng_uniform instead of gsl_rng_get
| C | mit | marblar/demon,marblar/demon,marblar/demon,marblar/demon |
ad59ece0e473ce0278ab3516e9d0a757955a5da1 | test/cfi/icall/external-call.c | test/cfi/icall/external-call.c | // RUN: %clang_cfi -lm -o %t1 %s
// RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s
// RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s
// This test uses jump tables containing PC-relative references to external
// symbols, which the Mach-O object writer does not currently support.
// XFAIL: darwin
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv) {
// CFI: 1
fprintf(stderr, "1\n");
double (*fn)(double);
if (argv[1][0] == 's')
fn = sin;
else
fn = cos;
fn(atof(argv[2]));
// CFI: 2
fprintf(stderr, "2\n");
}
| // RUN: %clang_cfi -lm -o %t1 %s
// RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s
// RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s
// This test uses jump tables containing PC-relative references to external
// symbols, which the Mach-O object writer does not currently support.
// The test passes on i386 Darwin and fails on x86_64, hence unsupported instead of xfail.
// UNSUPPORTED: darwin
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv) {
// CFI: 1
fprintf(stderr, "1\n");
double (*fn)(double);
if (argv[1][0] == 's')
fn = sin;
else
fn = cos;
fn(atof(argv[2]));
// CFI: 2
fprintf(stderr, "2\n");
}
| Mark a test as unsupported on darwin. | [cfi] Mark a test as unsupported on darwin.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@315007 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
82525d9d804d64d3f5ec9b999e0a2996a33e6900 | examples/help_output.c | examples/help_output.c | #include <argparse.h>
#include <stdio.h>
int main(int argc, char **argv) {
args *args = args_new();
args_add_option(args, option_new("f", "feature", "description of feature"));
args_help(args, stdout);
args_free(args);
}
| Add example for help output | Add example for help output
| C | mit | ntnn/libargparse,ntnn/libargparse |
|
098c879ed8c055047261c5cce0567b81fecbf197 | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_SUPPORT_LEGACY_GETBLENDMODE
#define SK_SUPPORT_LEGACY_SETFILTERQUALITY
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| Add flags to stage Skia API changes | Add flags to stage Skia API changes
Test: make
Bug: 178700363
Change-Id: I5d214f8fd69f7419f8b98f61a6e2f26f08587ff7
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
a55236affb0c47b07533db1a13b094b0b567606c | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
#define SK_SUPPORT_LEGACY_PAINT_QUALITY_APIS
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| Add flag to stage api change | Add flag to stage api change
Related skia cl: https://skia-review.googlesource.com/c/skia/+/358736
Test: make
Change-Id: Ic02219b27117280addfd083481a1ae2440584d65
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
20abb0f77e5ddbf3481d9bd4e9335d7a32fcfc40 | lib/GPIOlib.h | lib/GPIOlib.h | #ifndef GPIOLIB_H
#define GPIOLIB_H
#define FORWARD 1
#define BACKWARD 0
namespace GPIO
{
int init();
//direction is either FORWARD or BACKWARD. speed can be an integer ranging from 0 to 100.
int controlLeft(int direction,int speed);
int controlRight(int direction,int speed);
int stopLeft();
int stopRight();
int resetCounter();
void getCounter(int *countLeft,int *countRight);
//angle is available in the range of -90 to 90.
int turnTo(int angle);
void delay(int milliseconds);
}
#endif
| #ifndef GPIOLIB_H
#define GPIOLIB_H
#define FORWARD 1
#define BACKWARD 0
namespace GPIO
{
int init();
int controlLeft(int direction,int speed);
int controlRight(int direction,int speed);
int stopLeft();
int stopRight();
int resetCounter();
void getCounter(int *countLeft,int *countRight);
int turnTo(int angle);
void delay(int milliseconds);
}
#endif
| Remove texts for unserstanding to Wiki pages | Remove texts for unserstanding to Wiki pages
| C | mit | miaoxw/EmbeddedSystemNJU2017-Demo |
bcb8a9fa53da3a99f9ee035e7c5407dd61853d6f | common/c_cpp/src/c/windows/wombat/wUuid.h | common/c_cpp/src/c/windows/wombat/wUuid.h | /* $Id: wUuid.h,v 1.1.2.2 2012/03/20 11:15:17 emmapollock Exp $
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Inc.
*
* 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
*/
#ifndef WUUID_H__
#define WUUID_H__
#include "wombat/port.h"
typedef int wUuid;
COMMONExpDLL
void wUuid_generate_time (wUuid myUuid);
COMMONExpDLL
void wUuid_unparse (wUuid myUuid, char* out);
#endif /* WUUID_H__ */
| /* $Id: wUuid.h,v 1.1.2.2 2012/03/20 11:15:17 emmapollock Exp $
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Inc.
*
* 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
*/
#ifndef WUUID_H__
#define WUUID_H__
#include "wombat/port.h"
typedef char* wUuid;
COMMONExpDLL
void wUuid_generate_time (wUuid myUuid);
COMMONExpDLL
void wUuid_unparse (wUuid myUuid, char* out);
#endif /* WUUID_H__ */
| Change uuid to char* from int for Windows | [common] Change uuid to char* from int for Windows
| C | lgpl-2.1 | MattMulhern/OpenMAMA,cloudsmith-io/openmama,dmaguire/OpenMAMA,dmaguire/OpenMAMA,dmaguire/OpenMAMA,vulcanft/openmama,fquinner/OpenMAMA,fquinner/OpenMAMA,jacobraj/MAMA,dpauls/OpenMAMA,dmaguire/OpenMAMA,philippreston/OpenMAMA,dmaguire/OpenMAMA,philippreston/OpenMAMA,philippreston/OpenMAMA,jacobraj/MAMA,cloudsmith-io/openmama,cloudsmith-io/openmama,fquinner/OpenMAMA,jacobraj/MAMA,MattMulhern/OpenMAMA,dmagOM/OpenMAMA-dynamic,kuangtu/OpenMAMA,MattMulhern/OpenMamaCassandra,MattMulhern/OpenMamaCassandra,dpauls/OpenMAMA,dmaguire/OpenMAMA,philippreston/OpenMAMA,dmagOM/OpenMAMA-dynamic,MattMulhern/OpenMAMA,dpauls/OpenMAMA,dmaguire/OpenMAMA,vulcanft/openmama,MattMulhern/OpenMAMA,kuangtu/OpenMAMA,kuangtu/OpenMAMA,MattMulhern/OpenMamaCassandra,dpauls/OpenMAMA,cloudsmith-io/openmama,vulcanft/openmama,philippreston/OpenMAMA,MattMulhern/OpenMAMA,cloudsmith-io/openmama,vulcanft/openmama,MattMulhern/OpenMamaCassandra,kuangtu/OpenMAMA,dpauls/OpenMAMA,dmagOM/OpenMAMA-dynamic,dmagOM/OpenMAMA-dynamic,dmagOM/OpenMAMA-dynamic,kuangtu/OpenMAMA,fquinner/OpenMAMA,cloudsmith-io/openmama,vulcanft/openmama,fquinner/OpenMAMA,dmagOM/OpenMAMA-dynamic,MattMulhern/OpenMamaCassandra,fquinner/OpenMAMA,MattMulhern/OpenMAMA,vulcanft/openmama,dpauls/OpenMAMA,fquinner/OpenMAMA,jacobraj/MAMA,jacobraj/MAMA,jacobraj/MAMA,vulcanft/openmama,cloudsmith-io/openmama,MattMulhern/OpenMAMA,MattMulhern/OpenMamaCassandra,kuangtu/OpenMAMA,kuangtu/OpenMAMA,dpauls/OpenMAMA,philippreston/OpenMAMA,philippreston/OpenMAMA |
c33df657a16fbc23df2b6ec1c38060060cd3608a | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
// b/145995037
#define SK_LEGACY_WEBP_LOOP_COUNT
#endif // SkUserConfigManual_DEFINED
| Maintain the legacy behavior for WebP loop count | Maintain the legacy behavior for WebP loop count
Bug: 145995037
Test: No change in behavior; no new tests
https://skia-review.googlesource.com/c/skia/+/259161 updates Skia to
report the proper number of repetitions for a WebP file. This build flag
ensures that we stick with the existing behavior until we're ready to
switch.
Change-Id: Ib70615e9d7655264badcd5c63a54d2813c86bc32
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
24ccdf6f2a0802a286416133d31364d42d18d720 | slave/sregisters.h | slave/sregisters.h | #define _SLAVEREGISTERS
#include <inttypes.h>
//Functions needed from other modules
extern void MODBUSBuildException( uint8_t, uint8_t );
//Functions for parsing requests
extern void MODBUSParseRequest03( union MODBUSParser *Parser );
extern void MODBUSParseRequest06( union MODBUSParser *Parser );
extern void MODBUSParseRequest16( union MODBUSParser *Parser );
| #define _SLAVEREGISTERS
#include <inttypes.h>
//Functions needed from other modules
extern void MODBUSBuildException( uint8_t, uint8_t );
//Functions for parsing requests
extern void MODBUSParseRequest03( union MODBUSParser *Parser );
extern void MODBUSParseRequest06( union MODBUSParser *Parser );
extern void MODBUSParseRequest16( union MODBUSParser *Parser );
//Functions for building responses
extern void MODBUSBuildResponse03( union MODBUSParser *Parser );
extern void MODBUSBuildResponse06( union MODBUSParser *Parser );
extern void MODBUSBuildResponse16( union MODBUSParser *Parser );
| Add prototypes of response-building functions | Add prototypes of response-building functions
| C | mit | Jacajack/modlib |
a57adb1ba137c47d7ebaef9f64e265fcf653debe | include/config.h | include/config.h | /*************************************************
* Configuration Handling Header File *
* (C) 1999-2007 Jack Lloyd *
*************************************************/
#ifndef BOTAN_POLICY_CONF_H__
#define BOTAN_POLICY_CONF_H__
#include <botan/mutex.h>
#include <string>
#include <vector>
#include <map>
namespace Botan {
/*************************************************
* Library Configuration Settings *
*************************************************/
class BOTAN_DLL Config
{
public:
Config();
~Config();
void load_defaults();
std::string get(const std::string&, const std::string&) const;
bool is_set(const std::string&, const std::string&) const;
void set(const std::string&, const std::string&,
const std::string&, bool = true);
std::string option(const std::string&) const;
u32bit option_as_time(const std::string&) const;
void set_option(const std::string, const std::string&);
void add_alias(const std::string&, const std::string&);
std::string deref_alias(const std::string&) const;
void load_inifile(const std::string&);
private:
Config(const Config&) {}
Config& operator=(const Config&) { return (*this); }
std::map<std::string, std::string> settings;
Mutex* mutex;
};
/*************************************************
* Hook for the global config *
*************************************************/
BOTAN_DLL Config& global_config();
}
#endif
| /*************************************************
* Configuration Handling Header File *
* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_POLICY_CONF_H__
#define BOTAN_POLICY_CONF_H__
#include <botan/mutex.h>
#include <string>
#include <map>
namespace Botan {
/*************************************************
* Library Configuration Settings *
*************************************************/
class BOTAN_DLL Config
{
public:
Config();
~Config();
void load_defaults();
std::string get(const std::string&, const std::string&) const;
bool is_set(const std::string&, const std::string&) const;
void set(const std::string&, const std::string&,
const std::string&, bool = true);
std::string option(const std::string&) const;
u32bit option_as_time(const std::string&) const;
void set_option(const std::string, const std::string&);
void add_alias(const std::string&, const std::string&);
std::string deref_alias(const std::string&) const;
void load_inifile(const std::string&);
private:
Config(const Config&) {}
Config& operator=(const Config&) { return (*this); }
std::map<std::string, std::string> settings;
Mutex* mutex;
};
/*************************************************
* Hook for the global config *
*************************************************/
BOTAN_DLL Config& global_config();
}
#endif
| Remove unused include of <vector> | Remove unused include of <vector>
| C | bsd-2-clause | randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,randombit/botan,webmaster128/botan |
1ab12bed7f1c38c280876197408bd32e289ac41f | modlib.c | modlib.c | #include "modlib.h"
uint16_t MODBUSSwapEndian( uint16_t Data )
{
//Change big-endian to little-endian and vice versa
unsigned char Swap;
//Create 2 bytes long union
union Conversion
{
uint16_t Data;
unsigned char Bytes[2];
} Conversion;
//Swap bytes
Conversion.Data = Data;
Swap = Conversion.Bytes[0];
Conversion.Bytes[0] = Conversion.Bytes[1];
Conversion.Bytes[1] = Swap;
return Conversion.Data;
}
| #include "modlib.h"
uint16_t MODBUSSwapEndian( uint16_t Data )
{
//Change big-endian to little-endian and vice versa
unsigned char Swap;
//Create 2 bytes long union
union Conversion
{
uint16_t Data;
unsigned char Bytes[2];
} Conversion;
//Swap bytes
Conversion.Data = Data;
Swap = Conversion.Bytes[0];
Conversion.Bytes[0] = Conversion.Bytes[1];
Conversion.Bytes[1] = Swap;
return Conversion.Data;
}
uint16_t CRC16( uint16_t *Data, uint16_t Length )
{
//Calculate CRC16 checksum using given data and length
uint16_t CRC = 0xFFFF;
uint16_t i;
unsigned char j;
for ( i = 0; i < Length; i++ )
{
CRC ^= Data[i]; //XOR current data byte with CRC value
for ( j = 8; j != 0; j-- )
{
//For each bit
//Is least-significant-bit is set?
if ( ( CRC & 0x0001 ) != 0 )
{
CRC >>= 1; //Shift to right and xor
CRC ^= 0xA001;
}
else // Else LSB is not set
CRC >>= 1;
}
}
return CRC;
}
| Add CRC16 checksum calculation function | Add CRC16 checksum calculation function
| C | mit | Jacajack/modlib |
d4ea2ac1a1bbf61ed190ac9b6e78d6be4ce687f6 | src/utils.h | src/utils.h | #ifndef _INC_UTILS_H
#define _INC_UTILS_H
#include "basetypes.h"
void *advancePtr(void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
const void *advancePtr(const void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
#endif//_INC_UTILS_H | #ifndef _INC_UTILS_H
#define _INC_UTILS_H
#include "basetypes.h"
inline void *advancePtr(void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
inline const void *advancePtr(const void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
#endif//_INC_UTILS_H | Fix header methods to be inline | Fix header methods to be inline
| C | mit | aroxby/cpu,aroxby/cpu |
0b78dce3a2bd416375327b1e4436883da673009e | test2/type_parsing_printing/typeof_skip.c | test2/type_parsing_printing/typeof_skip.c | // RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') xyz()"
long *x;
__typeof(int *) ip;
__typeof(int *) *a1;
__typeof(int *) a2[2];
__typeof(int *) a3();
__typeof(x) xyz()
{
}
| // RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') abc()" "typeof(expr: identifier) (aka 'long *') xyz()"
long *x;
__typeof(int *) ip;
__typeof(int *) *a1;
__typeof(int *) a2[2];
__typeof(int *) a3();
auto abc() -> __typeof(x)
{
}
__typeof(x) xyz()
{
}
| Add trailing return type to type printing test | Add trailing return type to type printing test
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
d7dcfd3383fe903697b6aac817df17426de2f5a7 | cbits/hashByteString.c | cbits/hashByteString.c | /* Bernstein's hash */
int djb_hash(const char* str, int len, int hash) {
while (len--) {
hash = (hash * 33) ^ *str++;
}
return hash;
}
| /* Bernstein's hash */
int djb_hash(const unsigned char* str, int len, int hash) {
while (len--) {
hash = (hash * 33) ^ *str++;
}
return hash;
}
| Fix the handling of signedness, which caused a nasty bug | Fix the handling of signedness, which caused a nasty bug
| C | bsd-3-clause | ekmett/hashable |
fa52b947edea97d14f48e656125c7d640d748e85 | cbits/hashByteString.c | cbits/hashByteString.c | int hashByteString(const char* str, int len) {
int hash = 0;
while (len--) {
hash = (hash * 33) ^ *str++;
}
return hash;
}
| /* Bernstein's hash */
int hashByteString(const char* str, int len) {
int hash = 0;
while (len--) {
hash = (hash * 33) ^ *str++;
}
return hash;
}
| Document where our hash function comes from | Document where our hash function comes from
| C | bsd-3-clause | ekmett/hashable |
e7a73040132035225ee11a735afb54c3590f7648 | lib/journal.h | lib/journal.h | /* libcopy -- journal support
* (c) 2011 Michał Górny
* 2-clause BSD-licensed
*/
#pragma once
#ifndef _ATOMIC_INSTALL_JOURNAL_H
#define _ATOMIC_INSTALL_JOURNAL_H
typedef struct ai_journal *journal_t;
int ai_journal_create(const char *journal_path, const char *location);
int ai_journal_open(const char *journal_path, journal_t *ret);
int ai_journal_close(journal_t j);
const char *ai_journal_get_files(journal_t j);
#endif /*_ATOMIC_INSTALL_COPY_H*/
| /* libcopy -- journal support
* (c) 2011 Michał Górny
* 2-clause BSD-licensed
*/
#pragma once
#ifndef _ATOMIC_INSTALL_JOURNAL_H
#define _ATOMIC_INSTALL_JOURNAL_H
typedef struct ai_journal *journal_t;
int ai_journal_create(const char *journal_path, const char *location);
int ai_journal_open(const char *journal_path, journal_t *ret);
int ai_journal_close(journal_t j);
const char *ai_journal_get_files(journal_t j);
#endif /*_ATOMIC_INSTALL_JOURNAL_H*/
| Fix comment in header guard. | Fix comment in header guard.
| C | bsd-2-clause | mgorny/atomic-install |
0bc5dac3db25de42dfd86cfd7c3e4cc33587d8f3 | src/client/crypt.c | src/client/crypt.c | #include <openssl/aes.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <string.h>
#include "crypt.h"
typedef unsigned char aes_t;
void generate_bytes(aes_t *buf) {
if (!RAND_bytes(buf, sizeof(buf))) {
fprintf(stderr, "[!] Could not generate key");
}
}
aes_t *encrypt(char *plaintext, aes_t *key, aes_t *iv) {
aes_t *ciphertext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_encrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt((aes_t *)plaintext, ciphertext, sizeof(ciphertext), &wctx, iv, AES_ENCRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return ciphertext;
}
char *decrypt(aes_t *ciphertext, aes_t *key, aes_t *iv) {
aes_t *plaintext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_decrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt(ciphertext, plaintext, sizeof(plaintext), &wctx, iv, AES_DECRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return (char *) plaintext;
}
| #include <openssl/aes.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <string.h>
#include "crypt.h"
typedef unsigned char aes_t;
void generate_bytes(aes_t *buf) {
if (!RAND_bytes(buf, sizeof(buf))) {
fprintf(stderr, "[!] Could not generate key");
}
}
aes_t *encrypt(char *plaintext, aes_t *key, aes_t *iv) {
aes_t *ciphertext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_encrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt((aes_t *)plaintext, ciphertext, strlen(plaintext), &wctx, iv, AES_ENCRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return ciphertext;
}
char *decrypt(aes_t *ciphertext, aes_t *key, aes_t *iv) {
aes_t *plaintext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_decrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt(ciphertext, plaintext, strlen((char *)ciphertext), &wctx, iv, AES_DECRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return (char *) plaintext;
}
| Use strlen instead of sizeof | Use strlen instead of sizeof
| C | mit | ThisIsMyNick/CChat,ThisIsMyNick/CChat |
9aa854c9ff8be24d6d16404b591f9a5b2e2e5237 | priv/qfappscriptdispatcherwrapper.h | priv/qfappscriptdispatcherwrapper.h | #ifndef QFAPPSCRIPTDISPATCHERWRAPPER_H
#define QFAPPSCRIPTDISPATCHERWRAPPER_H
#include <QQuickItem>
#include <QPointer>
#include "qfappdispatcher.h"
class QFAppScriptDispatcherWrapper : public QQuickItem
{
Q_OBJECT
public:
QFAppScriptDispatcherWrapper();
QString type() const;
void setType(const QString &type);
QFAppDispatcher *dispatcher() const;
void setDispatcher(QFAppDispatcher *dispatcher);
public slots:
void dispatch(QJSValue arguments);
private:
QString m_type;
QPointer<QFAppDispatcher> m_dispatcher;
};
#endif // QFAPPSCRIPTDISPATCHERWRAPPER_H
| #ifndef QFAPPSCRIPTDISPATCHERWRAPPER_H
#define QFAPPSCRIPTDISPATCHERWRAPPER_H
#include <QQuickItem>
#include <QPointer>
#include "qfappdispatcher.h"
class QFAppScriptDispatcherWrapper : public QObject
{
Q_OBJECT
public:
QFAppScriptDispatcherWrapper();
QString type() const;
void setType(const QString &type);
QFAppDispatcher *dispatcher() const;
void setDispatcher(QFAppDispatcher *dispatcher);
public slots:
void dispatch(QJSValue arguments);
private:
QString m_type;
QPointer<QFAppDispatcher> m_dispatcher;
};
#endif // QFAPPSCRIPTDISPATCHERWRAPPER_H
| Change parent of QFAppScriptDispatcherWrapper from QQuickItem to QObject | Change parent of QFAppScriptDispatcherWrapper from QQuickItem to QObject
| C | apache-2.0 | benlau/quickflux,benlau/quickflux |
6f5ad61c73d1a214864716d55dddbf723fe1b3bc | src/test/for_all.c | src/test/for_all.c | int sum = 0;
void test_sum(){
if(sum == 45)
printf("Ok!\n");
else
printf("Wrong!\n");
sum = 0;
}
int main(){
int x;
for(int x; x < 10; x++)
sum += x;
test_sum();
for(x = 0; x < 10; x++)
sum += x;
test_sum();
x = 0;
for(;x < 10; x++)
sum += x;
test_sum();
x = 0;
for(;; x++){
if( x >= 10) break;
sum += x;
}
test_sum();
x = 0;
for(;;){
if( x >= 10) break;
sum += x;
x++;
}
test_sum();
x = 0;
for(;x < 10;){
sum += x;
x++;
}
test_sum();
sum = 0;
for(int x = 0;;x++){
if( x >= 10) break;
sum += x;
}
test_sum();
for(x = 0;;x++){
if( x >= 10) break;
sum += x;
}
test_sum();
sum = 0;
for(int x = 0;x < 10;){
sum += x;
x++;
}
test_sum();
sum = 0;
for(x = 0;x < 10;){
sum += x;
x++;
}
test_sum();
for(int x;;){
if( x >= 10) break;
sum += x;
x++;
}
test_sum();
for(x = 0;;){
if( x >= 10) break;
sum += x;
x++;
}
test_sum();
return 0;
}
| Add file testing all forms of for loop | Add file testing all forms of for loop
| C | mit | Sibert-Aerts/c2p,Sibert-Aerts/c2p,Sibert-Aerts/c2p |
|
1505139f741e601408dc4aaddf8e352d28085f00 | test/Driver/offloading-interoperability.c | test/Driver/offloading-interoperability.c | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" {{.*}}"-m" "elf64lppc"
| // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: {{ld(.exe)?"}} {{.*}}"-m" "elf64lppc"
| Allow .exe extension to ld to fix test with mingw. | Allow .exe extension to ld to fix test with mingw.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@277334 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
5446062ac8d33adda2927d122e7fe4e7052c2666 | sys/pc98/include/param.h | sys/pc98/include/param.h | /*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#include <i386/param.h>
| /*-
* Copyright (c) 2005 TAKAHASHI Yoshihiro.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#define MACHINE "pc98"
#include <i386/param.h>
| Switch MACHINE to "pc98" on FreeBSD/pc98. Add copyright. | Switch MACHINE to "pc98" on FreeBSD/pc98.
Add copyright.
Approved by: FreeBSD/pc98 development team.
| C | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase |
7cbd4e0a5c84abd6c23672e4e87ecab24b70c00a | tests/test_empty.c | tests/test_empty.c | /*
====================================================================
Copyright (c) 2008 Ian Blumel. All rights reserved.
This software is licensed as described in the file LICENSE, which
you should have received as part of this distribution.
====================================================================
File: test_basic.c
Provides a dumping ground for basic tests of fct.
*/
#include "fct.h"
FCT_BGN()
{
}
FCT_END();
| Add missing 'empty' test program. | Add missing 'empty' test program.
| C | bsd-3-clause | imb/fctx,imb/fctx,imb/fctx,imb/fctx |
|
617ff31664d7aaaf391272da30d3ae65d0426df7 | test/Analysis/array-struct.c | test/Analysis/array-struct.c | // RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
void f6() {
char *p;
p = __builtin_alloca(10);
p[1] = 'a';
}
struct s2;
void g2(struct s2 *p);
void f7() {
struct s2 *p = __builtin_alloca(10);
g2(p);
}
void f8() {
int a[10];
a[sizeof(a) - 1] = 1;
}
| // RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
void f6() {
char *p;
p = __builtin_alloca(10);
p[1] = 'a';
}
struct s2;
void g2(struct s2 *p);
void f7() {
struct s2 *p = __builtin_alloca(10);
g2(p);
}
void f8() {
int a[10];
a[sizeof(a) - 1] = 1;
}
void f9() {
struct s a[10];
}
| Add test cast for struct array. | Add test cast for struct array.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59522 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,apple/swift-clang,llvm-mirror/clang,apple/swift-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 |
f49f7674b9ec11b777b0954ea9fa0fe73a7ad4be | RobotC/Headers/Helper.h | RobotC/Headers/Helper.h | #ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Returns sign of float
int helpFindSign(float x) {
if (x > 0.0) {
return 1;
} else if (x < 0.0) {
return -1;
} else {
return 0;
}
}
int helpRoundFloat(float x) {
if (x > 0) {
return (int)(x+0.5);
} else {
return (int)(x-0.5);
}
}
#endif
| #ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Returns sign of int
int helpFindSign(int x) {
if (x > 0.0) {
return 1;
} else if (x < 0.0) {
return -1;
} else {
return 0;
}
}
int helpRoundFloat(float x) {
if (x > 0) {
return (int)(x+0.5);
} else {
return (int)(x-0.5);
}
}
#endif
| Fix helpFindSign (floats don't have signs....) | Fix helpFindSign (floats don't have signs....)
| C | mit | RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015 |
0d06b78d10a5648560158f958973f9e07edd194b | swap.c | swap.c | #include <stdio.h>
#define SWAP(x, y) { \
typeof (x) tmp = y; \
y = x; \
x = tmp; \
}
int main() {
int a = 1;
int b = 2;
SWAP(a, b);
printf("a: %d, b: %d\n", a, b);
return 0;
}
| #include <stdio.h>
#define SWAP(x, y) { \
typeof (x) tmp = y; \
y = x; \
x = tmp; \
}
int main() {
int a = 1;
int b = 2;
SWAP(a, b);
printf("a: %d, b: %d\n", a, b);
float arr[2] = {3.0, 4.0};
SWAP(arr[0], arr[1]);
printf("arr[0]: %f, arr[1]: %f\n", arr[0], arr[1]);
return 0;
}
| Test we work with other, more complex types. | Test we work with other, more complex types.
| C | mit | Wilfred/comparative_macrology,Wilfred/comparative_macrology,Wilfred/comparative_macrology,Wilfred/comparative_macrology |
cf45dd1238806c0a9ff74043694f5d276efc7f4a | phase-01/main.c | phase-01/main.c | /**
* Phase 01 - Get a Window that works and can be closed.
*
* This code won't be structured very well, just trying to get stuff working.
*/
#include <stdlib.h>
int main(int argc, char *argv[])
{
return EXIT_SUCCESS;
}
| /**
* Phase 01 - Get a Window that works and can be closed.
*
* This code won't be structured very well, just trying to get stuff working.
*/
#include <stdlib.h>
#include <X11/Xlib.h>
int main(int argc, char *argv[])
{
Display *dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
return EXIT_FAILURE;
}
XCloseDisplay(dpy);
dpy = NULL;
return EXIT_SUCCESS;
}
| Create the display, free it at the end, exit with failure if the display doesn't open | Create the display, free it at the end, exit with failure if the display doesn't open
| C | mit | Faison/xlib-learning |
af533b7e864c9a3790abe2095110924cc374af3c | DocFormats/DFTypes.h | DocFormats/DFTypes.h | // Copyright 2012-2014 UX Productivity Pty Ltd
//
// 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 DocFormats_DFTypes_h
#define DocFormats_DFTypes_h
#ifdef _MSC_VER
#define ATTRIBUTE_ALIGNED(n)
#define ATTRIBUTE_FORMAT(archetype,index,first)
#else
#define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n)))
#define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first)))
#endif
#include <sys/types.h>
#include <stdint.h>
#include <stdarg.h>
#endif
| // Copyright 2012-2014 UX Productivity Pty Ltd
//
// 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 DocFormats_DFTypes_h
#define DocFormats_DFTypes_h
#ifdef _MSC_VER
#define ATTRIBUTE_ALIGNED(n)
#define ATTRIBUTE_FORMAT(archetype,index,first)
#else
#define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n)))
#define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first)))
#endif
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <sys/types.h>
#include <stdint.h>
#include <stdarg.h>
#endif
| Disable warnings about insecure functions | Win32: Disable warnings about insecure functions
Set the _CRT_SECURE_NO_WARNINGS macro so that VC++ doesn't complain
about commonly-used functions like open and vsnprintf that it considers
"unsafe". The alternatives it suggests are not available on Unix-based
platforms, and they're used extensively throughout the codebase.
| C | apache-2.0 | apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,corinthia/corinthia-docformats,corinthia/corinthia-docformats,apache/incubator-corinthia |
991fa7648b54c6d03bfe0d112a37d17dd2054d52 | test_utils/mock_queue.h | test_utils/mock_queue.h | #ifndef TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#define TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#include "gmock/gmock.h"
#include "lib/queue_interface.h"
namespace tachyon {
namespace testing {
// Mock class for queues.
template <class T>
class MockQueue : public QueueInterface<T> {
public:
MOCK_METHOD1_T(Enqueue, bool(const T &item));
MOCK_METHOD1_T(EnqueueBlocking, bool(const T &item));
MOCK_METHOD1_T(DequeueNext, bool(T *item));
MOCK_METHOD1_T(DequeueNextBlocking, void(T *item));
MOCK_METHOD0_T(GetOffset, int());
MOCK_METHOD0_T(FreeQueue, void());
};
} // namespace testing
} // namespace tachyon
#endif // TACHYON_TEST_UTILS_MOCK_QUEUE_H_
| #ifndef TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#define TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#include "gmock/gmock.h"
#include "lib/queue_interface.h"
namespace tachyon {
namespace testing {
// Mock class for queues.
template <class T>
class MockQueue : public QueueInterface<T> {
public:
MOCK_METHOD1_T(Enqueue, bool(const T &item));
MOCK_METHOD1_T(EnqueueBlocking, bool(const T &item));
MOCK_METHOD1_T(DequeueNext, bool(T *item));
MOCK_METHOD1_T(DequeueNextBlocking, void(T *item));
MOCK_CONST_METHOD0_T(GetOffset, int());
MOCK_METHOD0_T(FreeQueue, void());
};
} // namespace testing
} // namespace tachyon
#endif // TACHYON_TEST_UTILS_MOCK_QUEUE_H_
| Fix issue with mock method. | Fix issue with mock method.
| C | mit | djpetti/gaia,djpetti/gaia,djpetti/gaia |
21ae225c5b7e15ef2ea46608f8cb4d9b8777a9cf | test2/initialisation/struct/empty/init.c | test2/initialisation/struct/empty/init.c | // RUN: %layout_check %s
// RUN: %check %s
struct A
{
}; // CHEKC: /warning: empty struct/
struct Containter
{
struct A a;
};
struct Pre
{
int i;
struct A a;
int j;
};
struct Pre p = { 1, /* warn */ 2 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct Pre q = { 1, {}, 2 };
main()
{
struct A a = { 5 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct A b = {};
struct Containter c = {{}};
c.a = (struct A){};
}
| // RUN: %layout_check %s
// RUN: %check %s
struct A
{
}; // CHECK: /warning: empty struct/
struct Container
{
struct A a;
};
struct Pre
{
int i;
struct A a;
int j;
};
struct Pre p = { 1, /* warn */ 2 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct Pre q = { 1, {}, 2 };
main()
{
struct A a = { 5 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct A b = {};
struct Container c = {{}};
c.a = (struct A){};
}
| Fix typo in empty struct test check | Fix typo in empty struct test check
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
eebb04875392e162a7372d79b8eb2f72d9086d65 | src/gallium/targets/egl/pipe_i915.c | src/gallium/targets/egl/pipe_i915.c |
#include "target-helpers/inline_wrapper_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "i915/drm/i915_drm_public.h"
#include "i915/i915_public.h"
static struct pipe_screen *
create_screen(int fd)
{
struct brw_winsys_screen *bws;
struct pipe_screen *screen;
bws = i915_drm_winsys_screen_create(fd);
if (!bws)
return NULL;
screen = i915_screen_create(bws);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
| Add missing egl pipe file | i915g: Add missing egl pipe file
| C | mit | benaadams/glsl-optimizer,adobe/glsl2agal,adobe/glsl2agal,wolf96/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,metora/MesaGLSLCompiler,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,KTXSoftware/glsl2agal,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,adobe/glsl2agal,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,adobe/glsl2agal,dellis1972/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,KTXSoftware/glsl2agal,zeux/glsl-optimizer,KTXSoftware/glsl2agal,KTXSoftware/glsl2agal,adobe/glsl2agal,metora/MesaGLSLCompiler,wolf96/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,KTXSoftware/glsl2agal,jbarczak/glsl-optimizer |
|
9e95e999cf87215b33d0b5b203b4a3cd0381a368 | verilog/tools/kythe/kythe_proto_output.h | verilog/tools/kythe/kythe_proto_output.h | // Copyright 2017-2020 The Verible Authors.
//
// 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 VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#define VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#include "verilog/tools/kythe/kythe_facts.h"
#include "verilog/tools/kythe/kythe_facts_extractor.h"
namespace verilog {
namespace kythe {
class KytheProtoOutput : public KytheOutput {
public:
KytheProtoOutput() = default;
// Output all Kythe facts from the indexing data in proto format.
void Emit(const KytheIndexingData& indexing_data);
};
} // namespace kythe
} // namespace verilog
#endif // VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
| // Copyright 2017-2020 The Verible Authors.
//
// 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 VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#define VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#include "verilog/tools/kythe/kythe_facts.h"
#include "verilog/tools/kythe/kythe_facts_extractor.h"
namespace verilog {
namespace kythe {
class KytheProtoOutput : public KytheOutput {
public:
// Output all Kythe facts from the indexing data in proto format.
void Emit(const KytheIndexingData& indexing_data);
};
} // namespace kythe
} // namespace verilog
#endif // VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
| Remove unnecessary default constructor from KytheProtoOutput | [kythe] Remove unnecessary default constructor from KytheProtoOutput
| C | apache-2.0 | chipsalliance/verible,chipsalliance/verible,chipsalliance/verible,chipsalliance/verible,chipsalliance/verible |
3a999bf6de5a6c4963f448c5498cd2c9c488d1a0 | temperature.c | temperature.c | // Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
#include <string.h>
// Returns x offset for next item
uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset)
{
const uint8_t v
= xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000;
uint8_t sz = 4;
char buf[sz];
const struct JBDim f = xstatus_get_font_size();
sz = snprintf(buf, sz, "%dC", v);
xcb_image_text_8(xc, sz, xstatus_get_window(xc),
xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf);
return f.w * strlen(buf) + offset + XSTATUS_CONST_WIDE_PAD
+ XSTATUS_CONST_PAD;
}
| // Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
static uint16_t get_offset(const uint16_t fw, const uint16_t offset,
const uint8_t len)
{
return fw * len + offset + XSTATUS_CONST_WIDE_PAD
+ XSTATUS_CONST_PAD;
}
// Returns x offset for next item
uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset)
{
const uint8_t v
= xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000;
uint8_t sz = 4;
char buf[sz];
const struct JBDim f = xstatus_get_font_size();
sz = snprintf(buf, sz, "%dC", v);
xcb_image_text_8(xc, sz, xstatus_get_window(xc),
xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf);
return get_offset(f.w, offset, sz);
}
| Split out get_offset(). Eliminated unnecessary call to strlen(). | Split out get_offset(). Eliminated unnecessary call to strlen().
| C | mit | jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus |
1c0969525f2500603fbb9f2360fbda3439831003 | thingshub/CDZThingsHubErrorDomain.h | thingshub/CDZThingsHubErrorDomain.h | //
// CDZThingsHubErrorDomain.h
// thingshub
//
// Created by Chris Dzombak on 1/14/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import "CDZThingsHubApplication.h"
extern NSString * const kThingsHubErrorDomain;
typedef NS_ENUM(NSInteger, CDZErrorCode) {
CDZErrorCodeConfigurationValidationError = CDZThingsHubApplicationReturnCodeConfigError,
CDZErrorCodeTestError = -1,
};
| //
// CDZThingsHubErrorDomain.h
// thingshub
//
// Created by Chris Dzombak on 1/14/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import "CDZThingsHubApplication.h"
extern NSString * const kThingsHubErrorDomain;
typedef NS_ENUM(NSInteger, CDZErrorCode) {
CDZErrorCodeTestError = 0,
CDZErrorCodeAuthError = CDZThingsHubApplicationReturnCodeAuthError,
CDZErrorCodeConfigurationValidationError = CDZThingsHubApplicationReturnCodeConfigError,
CDZErrorCodeSyncFailure = CDZThingsHubApplicationReturnCodeSyncFailed,
};
| Make error domain constants mirror app return codes | Make error domain constants mirror app return codes | C | mit | cdzombak/thingshub,cdzombak/thingshub,cdzombak/thingshub |
d01500c7ed2b6445d37176a05c911f25a299f38a | Pod/Classes/Private/IRLSizePrivate.h | Pod/Classes/Private/IRLSizePrivate.h | //
// IRLSizePrivate.h
// IRLSize
//
// Created by Jeff Kelley on 6/29/16.
// Copyright © 2016 Detroit Labs. All rights reserved.
//
#ifndef IRLSizePrivate_h
#define IRLSizePrivate_h
typedef float RawLengthMeasurement; // meters
typedef struct {
RawLengthMeasurement width;
RawLengthMeasurement height;
} RawSize;
#define RAW_SIZE_UNIT [NSUnitLength meters]
#endif /* IRLSizePrivate_h */
| //
// IRLSizePrivate.h
// IRLSize
//
// Created by Jeff Kelley on 6/29/16.
// Copyright © 2016 Detroit Labs. All rights reserved.
//
#ifndef IRLSizePrivate_h
#define IRLSizePrivate_h
typedef float RawLengthMeasurement; // meters
typedef struct {
RawLengthMeasurement width;
RawLengthMeasurement height;
} RawSize;
#define RAW_SIZE_UNIT NSUnitLength.meters
#endif /* IRLSizePrivate_h */
| Use the class property instead of getter method | Use the class property instead of getter method | C | mit | detroit-labs/IRLSize,detroit-labs/IRLSize,detroit-labs/IRLSize |
ad18456cbcd2a498a259eaefa98d77263a5eebb5 | src/gdomdebug.c | src/gdomdebug.c | #include <gdomdebug.h>
#include <glib/gprintf.h>
static gboolean debug_enabled = FALSE;
void
gdom_debug (char const *format, ...)
{
va_list args;
if (!debug_enabled)
return;
va_start (args, format);
g_vprintf (format, args);
g_printf ("\n");
va_end (args);
}
void
gdom_debug_enable (void)
{
debug_enabled = TRUE;
}
| #include <gdomdebug.h>
#include <glib/gprintf.h>
#include <stdlib.h>
static gboolean debug_checked = FALSE;
static gboolean debug_enabled = FALSE;
static gboolean
_is_debug_enabled ()
{
const char *debug_var;
if (debug_checked)
return debug_enabled;
debug_var = g_getenv ("GMATHML_DEBUG");
debug_enabled = debug_var != NULL ? atoi (debug_var) != 0 : FALSE;
debug_checked = TRUE;
return debug_enabled;
}
void
gdom_debug (char const *format, ...)
{
va_list args;
if (!_is_debug_enabled())
return;
va_start (args, format);
g_vprintf (format, args);
g_printf ("\n");
va_end (args);
}
void
gdom_debug_enable (void)
{
debug_enabled = TRUE;
debug_checked = TRUE;
}
| Allow debug messages using GMATHML_DEBUG environment variable. | [debug] Allow debug messages using GMATHML_DEBUG environment variable.
| C | lgpl-2.1 | wavewave/lasem,gjtorikian/lasem,janmarthedal/mathml2svg,wavewave/lasem,gjtorikian/lasem,wavewave/lasem,janmarthedal/mathml2svg,wavewave/lasem,gjtorikian/lasem,janmarthedal/mathml2svg,gjtorikian/lasem,janmarthedal/mathml2svg |
7cc016a29a41f110f50f7863e184afef85185aa5 | tests/test-static-link-gen.c | tests/test-static-link-gen.c | /* libunwind - a platform-independent unwind library
Copyright (C) 2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Copyright (c) 2003 Hewlett-Packard Co.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <stdio.h>
#include <libunwind.h>
extern int verbose;
static void *funcs[] =
{
(void *) &unw_get_reg,
(void *) &unw_get_fpreg,
(void *) &unw_set_reg,
(void *) &unw_set_fpreg,
(void *) &unw_resume,
(void *) &unw_create_addr_space,
(void *) &unw_destroy_addr_space,
(void *) &unw_get_accessors,
(void *) &unw_flush_cache,
(void *) &unw_set_caching_policy,
(void *) &unw_regname,
(void *) &unw_get_proc_info,
(void *) &unw_get_save_loc,
(void *) &unw_is_signal_frame,
(void *) &unw_get_proc_name
};
int
test_generic (void)
{
unw_cursor_t c;
if (verbose)
printf (__FILE__": funcs[0]=%p\n", funcs[0]);
#ifndef UNW_REMOTE_ONLY
{
ucontext_t uc;
unw_getcontext (&uc);
unw_init_local (&c, &uc);
unw_init_remote (&c, unw_local_addr_space, &uc);
}
return unw_step (&c);
#else
return 0;
#endif
}
| Clean it up so it compiles cleanly and works for REMOTE_ONLY case. | (test_generic): Clean it up so it compiles cleanly and works for
REMOTE_ONLY case.
(Logical change 1.158)
| C | mit | ehsan/libunwind,yuyichao/libunwind,vtjnash/libunwind,Chilledheart/libunwind,olibc/libunwind,lat/libunwind,vegard/libunwind,adsharma/libunwind,unkadoug/libunwind,djwatson/libunwind,cloudius-systems/libunwind,adsharma/libunwind,libunwind/libunwind,jrmuizel/libunwind,mpercy/libunwind,geekboxzone/lollipop_external_libunwind,fdoray/libunwind,tony/libunwind,yuyichao/libunwind,vtjnash/libunwind,atanasyan/libunwind-android,unkadoug/libunwind,android-ia/platform_external_libunwind,androidarmv6/android_external_libunwind,lat/libunwind,fdoray/libunwind,0xlab/0xdroid-external_libunwind,djwatson/libunwind,SyndicateRogue/libunwind,rogwfu/libunwind,frida/libunwind,maltek/platform_external_libunwind,Keno/libunwind,rantala/libunwind,vegard/libunwind,martyone/libunwind,adsharma/libunwind,dropbox/libunwind,cloudius-systems/libunwind,frida/libunwind,frida/libunwind,evaautomation/libunwind,krytarowski/libunwind,CyanogenMod/android_external_libunwind,0xlab/0xdroid-external_libunwind,atanasyan/libunwind-android,fdoray/libunwind,igprof/libunwind,igprof/libunwind,geekboxzone/mmallow_external_libunwind,pathscale/libunwind,tronical/libunwind,jrmuizel/libunwind,DroidSim/platform_external_libunwind,atanasyan/libunwind-android,pathscale/libunwind,tronical/libunwind,martyone/libunwind,atanasyan/libunwind,olibc/libunwind,joyent/libunwind,androidarmv6/android_external_libunwind,pathscale/libunwind,joyent/libunwind,fillexen/libunwind,yuyichao/libunwind,fillexen/libunwind,dropbox/libunwind,zeldin/platform_external_libunwind,ehsan/libunwind,android-ia/platform_external_libunwind,rntz/libunwind,maltek/platform_external_libunwind,dagar/libunwind,tony/libunwind,tony/libunwind,zeldin/platform_external_libunwind,wdv4758h/libunwind,mpercy/libunwind,unkadoug/libunwind,zeldin/platform_external_libunwind,project-zerus/libunwind,rntz/libunwind,bo-on-software/libunwind,atanasyan/libunwind,cms-externals/libunwind,vegard/libunwind,dagar/libunwind,ehsan/libunwind,DroidSim/platform_external_libunwind,mpercy/libunwind,geekboxzone/lollipop_external_libunwind,cloudius-systems/libunwind,dreal-deps/libunwind,android-ia/platform_external_libunwind,rogwfu/libunwind,CyanogenMod/android_external_libunwind,evaautomation/libunwind,libunwind/libunwind,dreal-deps/libunwind,djwatson/libunwind,zliu2014/libunwind-tilegx,atanasyan/libunwind,dagar/libunwind,wdv4758h/libunwind,CyanogenMod/android_external_libunwind,Chilledheart/libunwind,geekboxzone/mmallow_external_libunwind,lat/libunwind,zliu2014/libunwind-tilegx,project-zerus/libunwind,geekboxzone/mmallow_external_libunwind,wdv4758h/libunwind,maltek/platform_external_libunwind,tronical/libunwind,krytarowski/libunwind,tkelman/libunwind,bo-on-software/libunwind,Chilledheart/libunwind,Keno/libunwind,DroidSim/platform_external_libunwind,vtjnash/libunwind,cms-externals/libunwind,zliu2014/libunwind-tilegx,tkelman/libunwind,olibc/libunwind,rntz/libunwind,rantala/libunwind,fillexen/libunwind,martyone/libunwind,jrmuizel/libunwind,krytarowski/libunwind,dropbox/libunwind,cms-externals/libunwind,Keno/libunwind,tkelman/libunwind,rantala/libunwind,dreal-deps/libunwind,libunwind/libunwind,androidarmv6/android_external_libunwind,rogwfu/libunwind,0xlab/0xdroid-external_libunwind,joyent/libunwind,bo-on-software/libunwind,geekboxzone/lollipop_external_libunwind,SyndicateRogue/libunwind,igprof/libunwind,evaautomation/libunwind,project-zerus/libunwind,SyndicateRogue/libunwind |
|
982c1323303be930ecafb072c7075de0319dd48c | src/starlight.h | src/starlight.h | #pragma once
#include <string>
#if 0
int Stricmp(const char* str1, const char* str2) {
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++;
str2++;
}
return d;
}
int Strnicmp(const char* str1, const char* str2, int count) {
int d = 0;
while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++; str2++; count--;
}
return d;
}
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1800
#define SL_CALL __vectorcall
#else
#define SL_CALL __cdecl
#endif
#else
#define SL_CALL
#endif
#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));
// For this to work, at least one .cpp file using this macro
// needs to be compiled on _every_ build, otherwise it is outdated.
#define SL_BUILD_DATE __DATE__ __TIME__
| #pragma once
#include <string>
#if 0
int Stricmp(const char* str1, const char* str2) {
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++;
str2++;
}
return d;
}
int Strnicmp(const char* str1, const char* str2, int count) {
int d = 0;
while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++; str2++; count--;
}
return d;
}
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1800
#define SL_CALL __vectorcall
#else
#define SL_CALL __cdecl
#endif
#else
#define SL_CALL
#endif
#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));
// For this to work, at least one .cpp file using this macro
// needs to be compiled on _every_ build, otherwise it is outdated.
#define SL_BUILD_DATE __DATE__ " " __TIME__
| Add space between date and time | Add space between date and time
| C | mit | darkedge/starlight,darkedge/starlight,darkedge/starlight |
d9ee51a1ce04dfe0db1f89c34aa21ebc408ad869 | input.c | input.c | #include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
| #include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
| Add bye to exit words | Add bye to exit words
| C | mit | Roadagain/Calculator,Roadagain/Calculator |
0872c7be8541e059241d0bbe89a442a8c4b90215 | Include/genobject.h | Include/genobject.h |
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
struct _frame; /* Avoid including frameobject.h */
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_frame can be NULL if the generator is "finished" */
struct _frame *gi_frame;
/* True if generator is being executed. */
int gi_running;
/* The code object backing the generator */
PyObject *gi_code;
/* List of weak reference. */
PyObject *gi_weakreflist;
} PyGenObject;
PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
PyAPI_FUNC(int) PyGen_FetchStopIterationValue(PyObject **);
#ifdef __cplusplus
}
#endif
#endif /* !Py_GENOBJECT_H */
#endif /* Py_LIMITED_API */
|
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
struct _frame; /* Avoid including frameobject.h */
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_frame can be NULL if the generator is "finished" */
struct _frame *gi_frame;
/* True if generator is being executed. */
char gi_running;
/* The code object backing the generator */
PyObject *gi_code;
/* List of weak reference. */
PyObject *gi_weakreflist;
} PyGenObject;
PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
PyAPI_FUNC(int) PyGen_FetchStopIterationValue(PyObject **);
#ifdef __cplusplus
}
#endif
#endif /* !Py_GENOBJECT_H */
#endif /* Py_LIMITED_API */
| Fix regression after c8d1df9ac987 (PPC buildbot) | Fix regression after c8d1df9ac987
(PPC buildbot)
| C | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator |
c2475f236c7da439da5acc27114a92ae9ffe5ef4 | LYCategory/Classes/_UIKit/UIColor+Speed.h | LYCategory/Classes/_UIKit/UIColor+Speed.h | //
// UIColor+Speed.h
// LYCategory
//
// CREATED BY LUO YU ON 26/10/2016.
// COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//
#import <UIKit/UIKit.h>
@interface UIColor (Speed)
- (UIColor *)colorWithR:(CGFloat)redValue G:(CGFloat)greenValue B:(CGFloat)blueValue;
@end
| //
// UIColor+Speed.h
// LYCategory
//
// CREATED BY LUO YU ON 26/10/2016.
// COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//
#import <UIKit/UIKit.h>
@interface UIColor (Speed)
/**
generate color object with red-green-blue values
@param redValue red color value, 0~255
@param greenValue green color value, 0~255
@param blueValue blue color value, 0~255
@return color object
*/
- (UIColor *)colorWithR:(CGFloat)redValue G:(CGFloat)greenValue B:(CGFloat)blueValue;
@end
| Modify : doc for color | Modify : doc for color
| C | mit | blodely/LYCategory,blodely/LYCategory,blodely/LYCategory,blodely/LYCategory |
a2a0e6f33f8b84f80a558c382214378fa156ecee | findbarcode.c | findbarcode.c | #include <stdio.h>
#include "stb_image.c"
#define FILENAME "wikipedia_barcode.png"
int main(int argc, char **argv)
{
int width, height, bytes_per_pixel;
unsigned char *data = stbi_load(FILENAME, &width, &height, &bytes_per_pixel, STBI_default);
if (data) {
// Run through every pixel and print its greyscale value.
for (int row = 0; row < height; row++) {
int row_offset = row * width;
for (int col = 0; col < width; col++) {
char grey = data[row_offset + col];
printf("row %d, col %d: %d\n", row, col, grey);
}
}
stbi_image_free(data);
printf("width: %d\nheight: %d\nbytes per pixel: %d\n", width, height, bytes_per_pixel);
} else {
printf("stbi_load() failed with error: \"%s\"\n", stbi_failure_reason());
}
return 0;
}
| #include <stdio.h>
#include "stb_image.c"
#define FILENAME "wikipedia_barcode.png"
int main(int argc, char **argv)
{
int width, height, bytes_per_pixel;
unsigned char *data = stbi_load(FILENAME, &width, &height, &bytes_per_pixel, STBI_default);
if (data) {
// Run through every pixel and print its greyscale value.
for (int row = 0; row < height; row++) {
int row_offset = row * width;
for (int col = 0; col < width; col++) {
char grey = data[row_offset + col];
printf("row %d, col %d: %u\n", row, col, grey);
}
}
stbi_image_free(data);
printf("width: %d\nheight: %d\nbytes per pixel: %d\n", width, height, bytes_per_pixel);
} else {
printf("stbi_load() failed with error: \"%s\"\n", stbi_failure_reason());
}
return 0;
}
| Print grey pixel value as unsigned | Print grey pixel value as unsigned
| C | mit | jakeboxer/findbarcode |
2c1b1a2343f5882ee6f98328ff391478d0d58c23 | src/3rdparty/win32_src/pdcurses/wincon/pdcwin.h | src/3rdparty/win32_src/pdcurses/wincon/pdcwin.h | /* PDCurses */
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(PDC_WIDE) && !defined(UNICODE)
# define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef MOUSE_MOVED
#include <curspriv.h>
typedef struct {short r, g, b; bool mapped;} PDCCOLOR;
extern PDCCOLOR pdc_color[PDC_MAXCOL];
extern HANDLE pdc_con_out, pdc_con_in;
extern DWORD pdc_quick_edit;
extern DWORD pdc_last_blink;
extern short pdc_curstoreal[16], pdc_curstoansi[16];
extern short pdc_oldf, pdc_oldb, pdc_oldu;
extern bool pdc_conemu, pdc_wt, pdc_ansi;
extern void PDC_blink_text(void);
| /* PDCurses */
#ifndef __PDC_WIN_H__
#define __PDC_WIN_H__
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(PDC_WIDE) && !defined(UNICODE)
# define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef MOUSE_MOVED
#include <curspriv.h>
typedef struct {short r, g, b; bool mapped;} PDCCOLOR;
extern PDCCOLOR pdc_color[PDC_MAXCOL];
extern HANDLE pdc_con_out, pdc_con_in;
extern DWORD pdc_quick_edit;
extern DWORD pdc_last_blink;
extern short pdc_curstoreal[16], pdc_curstoansi[16];
extern short pdc_oldf, pdc_oldb, pdc_oldu;
extern bool pdc_conemu, pdc_wt, pdc_ansi;
extern void PDC_blink_text(void);
#endif | Add include guard to fix wincon compile. | Add include guard to fix wincon compile.
| C | bsd-3-clause | clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube |
0f034d699c77ae4c7c989bf41405ff1b433e37ca | core/base/inc/LinkDef.h | core/base/inc/LinkDef.h | #include "core/base/inc/LinkDef1.h"
#include "core/base/inc/LinkDef2.h"
#include "core/base/inc/LinkDef3.h"
#include "core/clib/inc/LinkDef.h"
#include "core/cont/inc/LinkDef.h"
#include "core/meta/inc/LinkDef.h"
#include "core/metautils/inc/LinkDef.h"
#include "core/textinput/inc/LinkDef.h"
#include "core/zip/inc/LinkDef.h"
#if defined(SYSTEM_TYPE_winnt)
#include "core/winnt/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_macosx)
#include "core/macosx/inc/LinkDef.h"
#include "core/unix/inc/LinkDef.h"
#else
#include "core/unix/inc/LinkDef.h"
#endif
| #include "core/base/inc/LinkDef1.h"
#include "core/base/inc/LinkDef2.h"
#include "core/base/inc/LinkDef3.h"
#include "core/clib/inc/LinkDef.h"
#include "core/cont/inc/LinkDef.h"
#include "core/meta/inc/LinkDef.h"
#include "core/metautils/inc/LinkDef.h"
#include "core/textinput/inc/LinkDef.h"
#include "core/zip/inc/LinkDef.h"
#if defined(SYSTEM_TYPE_winnt)
#include "core/winnt/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_macosx)
#include "core/macosx/inc/LinkDef.h"
#include "core/unix/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_unix)
#include "core/unix/inc/LinkDef.h"
#else
# error "Unsupported system type."
#endif
| Verify that one of SYSTEM_TYPE_... is set. | Verify that one of SYSTEM_TYPE_... is set.
| C | lgpl-2.1 | agarciamontoro/root,abhinavmoudgil95/root,abhinavmoudgil95/root,buuck/root,beniz/root,BerserkerTroll/root,BerserkerTroll/root,beniz/root,beniz/root,davidlt/root,simonpf/root,agarciamontoro/root,gganis/root,davidlt/root,karies/root,olifre/root,zzxuanyuan/root-compressor-dummy,simonpf/root,gbitzes/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,beniz/root,zzxuanyuan/root,zzxuanyuan/root,satyarth934/root,gbitzes/root,simonpf/root,buuck/root,BerserkerTroll/root,bbockelm/root,gbitzes/root,gbitzes/root,davidlt/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,olifre/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,davidlt/root,buuck/root,abhinavmoudgil95/root,gganis/root,karies/root,zzxuanyuan/root-compressor-dummy,olifre/root,satyarth934/root,mhuwiler/rootauto,BerserkerTroll/root,root-mirror/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,simonpf/root,mhuwiler/rootauto,buuck/root,zzxuanyuan/root,olifre/root,beniz/root,zzxuanyuan/root,BerserkerTroll/root,root-mirror/root,davidlt/root,root-mirror/root,olifre/root,simonpf/root,mhuwiler/rootauto,bbockelm/root,satyarth934/root,abhinavmoudgil95/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,davidlt/root,abhinavmoudgil95/root,BerserkerTroll/root,olifre/root,buuck/root,zzxuanyuan/root,satyarth934/root,simonpf/root,agarciamontoro/root,satyarth934/root,mhuwiler/rootauto,gbitzes/root,bbockelm/root,bbockelm/root,root-mirror/root,root-mirror/root,root-mirror/root,agarciamontoro/root,BerserkerTroll/root,mhuwiler/rootauto,BerserkerTroll/root,zzxuanyuan/root,beniz/root,gganis/root,root-mirror/root,olifre/root,gganis/root,bbockelm/root,abhinavmoudgil95/root,bbockelm/root,agarciamontoro/root,beniz/root,agarciamontoro/root,gganis/root,karies/root,abhinavmoudgil95/root,simonpf/root,buuck/root,simonpf/root,zzxuanyuan/root,zzxuanyuan/root,mhuwiler/rootauto,bbockelm/root,agarciamontoro/root,karies/root,davidlt/root,gbitzes/root,gganis/root,satyarth934/root,agarciamontoro/root,satyarth934/root,gganis/root,bbockelm/root,karies/root,root-mirror/root,buuck/root,buuck/root,beniz/root,olifre/root,gganis/root,buuck/root,bbockelm/root,karies/root,olifre/root,davidlt/root,bbockelm/root,root-mirror/root,gbitzes/root,buuck/root,gbitzes/root,gganis/root,agarciamontoro/root,satyarth934/root,karies/root,mhuwiler/rootauto,buuck/root,simonpf/root,karies/root,gganis/root,davidlt/root,gbitzes/root,olifre/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,davidlt/root,root-mirror/root,davidlt/root,gbitzes/root,satyarth934/root,gganis/root,mhuwiler/rootauto,karies/root,simonpf/root,BerserkerTroll/root,beniz/root,mhuwiler/rootauto,satyarth934/root,beniz/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,karies/root,mhuwiler/rootauto,beniz/root,zzxuanyuan/root,simonpf/root,root-mirror/root,satyarth934/root,abhinavmoudgil95/root,BerserkerTroll/root,zzxuanyuan/root,agarciamontoro/root,olifre/root,gbitzes/root,karies/root |
c28b765893ed505ac62864c9d4ce67cd4f9b9fc0 | include/bl2/bl2.h | include/bl2/bl2.h | /*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef BL2_H__
#define BL2_H__
struct entry_point_info;
void bl2_main(void);
struct entry_point_info *bl2_load_images(void);
#endif /* BL2_H__ */
| /*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef BL2_H__
#define BL2_H__
void bl2_main(void);
#endif /* BL2_H__ */
| Fix MISRA rule 8.5 in common code | Fix MISRA rule 8.5 in common code
Rule 8.5: An external object or function shall be declared
once in one and only one file.
Change-Id: I7c3d4ec7d3ba763fdb4600008ba10b4b93ecdfce
Signed-off-by: Roberto Vargas <[email protected]>
| C | bsd-3-clause | achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware |
4575d0a769a4b85012bd82f328038a80555917bd | config.h | config.h | #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT \
11122
#define LISTEN_BACKLOG \
40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE \
256
/* Linux specific configs */
#define MAX_EPOLL_EVENTS \
100
#endif
| #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT \
11122
#define LISTEN_BACKLOG \
40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE \
512
/* Linux specific configs */
#define MAX_EPOLL_EVENTS \
100
#endif
| Increase read and write buffer size per peer. | Increase read and write buffer size per peer.
| C | mit | mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet |
04c226aab970da86fc9f59ec3a808cf916458261 | test/CodeGen/arm-neon-fma.c | test/CodeGen/arm-neon-fma.c | // REQUIRES: arm-registered-target
// RUN: %clang -target thumbv7-none-linux-gnueabihf \
// RUN: -mcpu=cortex-a8 -mfloat-abi=hard \
// RUN: -O3 -S -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
float32x2_t test_fma_order(float32x2_t accum, float32x2_t lhs, float32x2_t rhs) {
return vfma_f32(accum, lhs, rhs);
// CHECK: call <2 x float> @llvm.fma.v2f32(<2 x float> %lhs, <2 x float> %rhs, <2 x float> %accum)
}
float32x4_t test_fmaq_order(float32x4_t accum, float32x4_t lhs, float32x4_t rhs) {
return vfmaq_f32(accum, lhs, rhs);
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %lhs, <4 x float> %rhs, <4 x float> %accum)
}
| // REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple thumbv7-none-linux-gnueabihf \
// RUN: -target-abi aapcs \
// RUN: -target-cpu cortex-a8 \
// RUN: -mfloat-abi hard \
// RUN: -ffreestanding \
// RUN: -O3 -S -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
float32x2_t test_fma_order(float32x2_t accum, float32x2_t lhs, float32x2_t rhs) {
return vfma_f32(accum, lhs, rhs);
// CHECK: call <2 x float> @llvm.fma.v2f32(<2 x float> %lhs, <2 x float> %rhs, <2 x float> %accum)
}
float32x4_t test_fmaq_order(float32x4_t accum, float32x4_t lhs, float32x4_t rhs) {
return vfmaq_f32(accum, lhs, rhs);
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %lhs, <4 x float> %rhs, <4 x float> %accum)
}
| Fix recent test for more diverse environments. | Fix recent test for more diverse environments.
I think the main issue was the lack of -ffreestanding, which pulled in
the host's stdint.h. After that things went rapidly downhill.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@172653 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
b288888c9a5546844c146d8b7161d24ebbd7c7f7 | tests/testutils.h | tests/testutils.h | #ifndef _TESTUTILS_H
#define _TESTUTILS_H
/*
* tslib/tests/testutils.h
*
* Copyright (C) 2004 Michael Opdenacker <[email protected]>
*
* This file is placed under the LGPL.
*
*
* Misc utils for ts test programs
*/
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define BLUE "\033[34m"
#define YELLOW "\033[33m"
struct ts_button {
int x, y, w, h;
char *text;
int flags;
#define BUTTON_ACTIVE 0x00000001
};
void button_draw(struct ts_button *button);
int button_handle(struct ts_button *button, int x, int y, unsigned int pressure);
void getxy(struct tsdev *ts, int *x, int *y);
void ts_flush (struct tsdev *ts);
void print_ascii_logo(void);
#endif /* _TESTUTILS_H */
| #ifndef _TESTUTILS_H
#define _TESTUTILS_H
/*
* tslib/tests/testutils.h
*
* Copyright (C) 2004 Michael Opdenacker <[email protected]>
*
* This file is placed under the GPL.
*
* SPDX-License-Identifier: GPL-2.0+
*
*
* Misc utils for ts test programs
*/
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define BLUE "\033[34m"
#define YELLOW "\033[33m"
struct ts_button {
int x, y, w, h;
char *text;
int flags;
#define BUTTON_ACTIVE 0x00000001
};
void button_draw(struct ts_button *button);
int button_handle(struct ts_button *button, int x, int y, unsigned int pressure);
void getxy(struct tsdev *ts, int *x, int *y);
void ts_flush (struct tsdev *ts);
void print_ascii_logo(void);
#endif /* _TESTUTILS_H */
| Fix license statement in header comment and add SPDS identifier | tests: Fix license statement in header comment and add SPDS identifier
This file had been copied around a long time ago, and included a wrong
license. All files in the tests directory (except for this small header)
are GPL licensed.
I actually doubt that the copyright notice is accurate here -.-
Signed-off-by: Martin Kepplinger <[email protected]>
| C | lgpl-2.1 | kergoth/tslib,kergoth/tslib,kergoth/tslib,kergoth/tslib |
b1e1910a974865a362546d7d4bee35becb69b5e2 | src/condor_syscall_lib/scanner.h | src/condor_syscall_lib/scanner.h | #define FUNC 1
#define PARAM 2
#define PTR_PARAM 3
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_mapped;
int is_array;
int extract;
struct node *next;
struct node *prev;
};
union yystype {
struct token tok;
struct node *node;
};
#define YYSTYPE union yystype
| #define FUNC 1
#define PARAM 2
#define PTR_PARAM 3
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
int is_array;
int in_param;
int out_param;
int extract;
struct node *next;
struct node *prev;
};
struct p_mode {
int in;
int out;
};
union yystype {
struct token tok;
struct node *node;
struct p_mode param_mode;
int bool;
};
#define YYSTYPE union yystype
| Add boolean type so yacc productions can return a boolean value. Add parameter mode type so we can tag parameters as IN, OUT, or BOTH. | Add boolean type so yacc productions can return a boolean value.
Add parameter mode type so we can tag parameters as IN, OUT, or BOTH.
| C | apache-2.0 | htcondor/htcondor,djw8605/condor,htcondor/htcondor,htcondor/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud |
894bbab6314e85b5bdc5b03b97d8561fbe8545a7 | test/CodeGen/PR2001-bitfield-reload.c | test/CodeGen/PR2001-bitfield-reload.c | // RUN: clang --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t &&
// RUN: grep "ret i32" %t | count 1 &&
// RUN: grep "ret i32 1" %t | count 1
// PR2001
/* Test that the result of the assignment properly uses the value *in
the bitfield* as opposed to the RHS. */
static int foo(int i) {
struct {
int f0 : 2;
} x;
return (x.f0 = i);
}
int bar() {
return foo(-5) == -1;
}
| Add test case for PR2001. | Add test case for PR2001.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@54352 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,apple/swift-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,llvm-mirror/clang |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.