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
|
---|---|---|---|---|---|---|---|---|---|
392cf8bd4bd139f67b326d6a488f4b8b7bdc7100 | jansson_config.h | jansson_config.h | /*
* Copyright (c) 2010-2012 Petri Lehtinen <[email protected]>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*
*
* This file specifies a part of the site-specific configuration for
* Jansson, namely those things that affect the public API in
* jansson.h.
*
* The configure script copies this file to jansson_config.h and
* replaces @var@ substitutions by values that fit your system. If you
* cannot run the configure script, you can do the value substitution
* by hand.
*/
#ifndef JANSSON_CONFIG_H
#define JANSSON_CONFIG_H
/* If your compiler supports the inline keyword in C, JSON_INLINE is
defined to `inline', otherwise empty. In C++, the inline is always
supported. */
#ifdef __cplusplus
#define JSON_INLINE inline
#else
#define JSON_INLINE inline
#endif
/* If your compiler supports the `long long` type and the strtoll()
library function, JSON_INTEGER_IS_LONG_LONG is defined to 1,
otherwise to 0. */
#define JSON_INTEGER_IS_LONG_LONG 1
/* If locale.h and localeconv() are available, define to 1,
otherwise to 0. */
#define JSON_HAVE_LOCALECONV 1
#endif
| Add a file that was required for building jansson from CMake. | Add a file that was required for building jansson from CMake.
| C | bsd-3-clause | dazeus/dazeus-core,dazeus/dazeus-core,dazeus/dazeus-core,dazeus/dazeus-core |
|
bbf5d9516d6fac481b97fa8fc08ead890236edd4 | Interfaces/WorldLogicInterface.h | Interfaces/WorldLogicInterface.h | /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#include "ServiceInterface.h"
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ForwardDefines.h"
#include <QObject>
class QString;
namespace Foundation
{
class WorldLogicInterface : public QObject, public ServiceInterface
{
Q_OBJECT
public:
/// Default constructor.
WorldLogicInterface() {}
/// Destructor.
virtual ~WorldLogicInterface() {}
/// Returns user's avatar entity.
virtual Scene::EntityPtr GetUserAvatarEntity() const = 0;
/// Returns currently active camera entity.
virtual Scene::EntityPtr GetCameraEntity() const = 0;
/// Returns entity with certain entity component in it or null if not found.
/// @param entity_id Entity ID.
/// @param component Type name of the component.
virtual Scene::EntityPtr GetEntityWithComponent(uint entity_id, const QString &component) const = 0;
/// Hack function for getting EC_AvatarAppearance info to UiModule
virtual const QString &GetAvatarAppearanceProperty(const QString &name) const = 0;
signals:
/// Emitted just before we start to delete world (scene).
void AboutToDeleteWorld();
};
}
#endif
| /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ServiceInterface.h"
#include "ForwardDefines.h"
#include <QObject>
class QString;
namespace Foundation
{
class WorldLogicInterface : public QObject, public ServiceInterface
{
Q_OBJECT
public:
/// Default constructor.
WorldLogicInterface() {}
/// Destructor.
virtual ~WorldLogicInterface() {}
/// Returns user's avatar entity.
virtual Scene::EntityPtr GetUserAvatarEntity() const = 0;
/// Returns currently active camera entity.
virtual Scene::EntityPtr GetCameraEntity() const = 0;
/// Returns entity with certain entity component in it or null if not found.
/// @param entity_id Entity ID.
/// @param component Type name of the component.
virtual Scene::EntityPtr GetEntityWithComponent(uint entity_id, const QString &component) const = 0;
/// Hack function for getting EC_AvatarAppearance info to UiModule
virtual const QString &GetAvatarAppearanceProperty(const QString &name) const = 0;
signals:
/// Emitted just before we start to delete world (scene).
void AboutToDeleteWorld();
};
}
#endif
| Move include within include guards. | Move include within include guards.
| C | apache-2.0 | jesterKing/naali,realXtend/tundra,AlphaStaxLLC/tundra,jesterKing/naali,realXtend/tundra,jesterKing/naali,BogusCurry/tundra,pharos3d/tundra,jesterKing/naali,realXtend/tundra,realXtend/tundra,AlphaStaxLLC/tundra,pharos3d/tundra,BogusCurry/tundra,antont/tundra,pharos3d/tundra,pharos3d/tundra,realXtend/tundra,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,antont/tundra,antont/tundra,BogusCurry/tundra,pharos3d/tundra,jesterKing/naali,pharos3d/tundra,BogusCurry/tundra,jesterKing/naali,BogusCurry/tundra,BogusCurry/tundra,antont/tundra,AlphaStaxLLC/tundra,antont/tundra,realXtend/tundra,antont/tundra,jesterKing/naali,antont/tundra |
f5180d98f775f5e56ce3ef250240e24995655472 | lilthumb.h | lilthumb.h | #ifndef lilthumb
#define lilthumb
#include <ctime>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
}
#define logger(message) std::cerr << lilthumb::timeString() << " | "<< message << std::endl;
#endif
| #ifndef lilthumb
#define lilthumb
#include <ctime>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
}
#define logger(stream,message) stream << lilthumb::timeString() << " | "<< message << std::endl;
#endif
| Change macro to let user choose output stream | Change macro to let user choose output stream
| C | apache-2.0 | jeromevelut/lilthumb |
0d7b37d846af64a22f99f8181d32c0b8ff632e8f | system/check.c | system/check.c | #include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>
#include "system/check.h"
bool SystemCheck() {
bool kickv40 = SysBase->LibNode.lib_Version >= 40;
bool chipaga = GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA);
bool cpu68040 = SysBase->AttnFlags & AFF_68040;
bool fpu68882 = SysBase->AttnFlags & AFF_68882;
Printf("System check:\n");
Printf(" - Kickstart v40 : %s\n", (ULONG)(kickv40 ? "yes" : "no"));
Printf(" - ChipSet AGA : %s\n", (ULONG)(chipaga ? "yes" : "no"));
Printf(" - CPU 68040 : %s\n", (ULONG)(cpu68040 ? "yes" : "no"));
Printf(" - FPU 68882 : %s\n", (ULONG)(fpu68882 ? "yes" : "no"));
return (kickv40 && cpu68040 && fpu68882 && chipaga);
}
| #include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>
#include "system/check.h"
bool SystemCheck() {
bool kickv40 = SysBase->LibNode.lib_Version >= 40;
bool chipaga = GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA);
bool cpu68040 = SysBase->AttnFlags & AFF_68040;
bool fpu68882 = SysBase->AttnFlags & AFF_68882;
Printf("System check:\r\n");
Printf(" - Kickstart v40 : %s\r\n", (ULONG)(kickv40 ? "yes" : "no"));
Printf(" - ChipSet AGA : %s\r\n", (ULONG)(chipaga ? "yes" : "no"));
Printf(" - CPU 68040 : %s\r\n", (ULONG)(cpu68040 ? "yes" : "no"));
Printf(" - FPU 68882 : %s\r\n", (ULONG)(fpu68882 ? "yes" : "no"));
return (kickv40 && cpu68040 && fpu68882 && chipaga);
}
| Break lines properly on serial console. | Break lines properly on serial console.
| C | artistic-2.0 | cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene |
398f341668286bd3d82256aa22a5547dc32e0f50 | tests/Test.h | tests/Test.h | #pragma once
#include "Jitter.h"
#define TEST_VERIFY(a) if(!(a)) { int* p = 0; (*p) = 0; }
class CTest
{
public:
virtual ~CTest() {}
virtual void Run() = 0;
virtual void Compile(Jitter::CJitter&) = 0;
#ifdef _MSC_VER
//Overload operator new and delete to make sure we get proper 16-byte aligned structures
//C++11 has support for aligned struct/classes, but VC++2013 doesn't support them
void* operator new(size_t allocSize)
{
return _aligned_malloc(allocSize, 16);
}
void operator delete(void* ptr)
{
_aligned_free(ptr);
}
#endif
};
| #pragma once
#include "AlignedAlloc.h"
#include "Jitter.h"
#define TEST_VERIFY(a) if(!(a)) { int* p = 0; (*p) = 0; }
class CTest
{
public:
virtual ~CTest() {}
virtual void Run() = 0;
virtual void Compile(Jitter::CJitter&) = 0;
void* operator new(size_t allocSize)
{
return framework_aligned_alloc(allocSize, 0x10);
}
void operator delete(void* ptr)
{
framework_aligned_free(ptr);
}
};
| Use aligned alloc for test allocation. | Use aligned alloc for test allocation.
| C | bsd-2-clause | Alloyed/Play--CodeGen,Alloyed/Play--CodeGen,Alloyed/Play--CodeGen,Alloyed/Play--CodeGen |
014409aedf3da620da63c502ff039ee746cdfe6a | include/deal.II/base/tensor_accessors.h | include/deal.II/base/tensor_accessors.h | // ---------------------------------------------------------------------
//
// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, 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.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
#ifndef dealii__tensor_accessors_h
#define dealii__tensor_accessors_h
#include <deal.II/base/config.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/table_indices.h>
DEAL_II_NAMESPACE_OPEN
/**
* This namespace is a collection of algorithms working on generic
* tensorial objects (of arbitrary rank).
*
* The rationale to implement such functionality in a generic fashion in a
* separate namespace is
* - to easy code reusability and therefore avoid code duplication.
* - to have a well-defined interface that allows to exchange the low
* level implementation.
*
*
* A tensorial object has the notion of a rank and allows a rank-times
* recursive application of the index operator, e.g., if <code>t</code> is
* a tensorial object of rank 4, the following access is valid:
* @code
* t[1][2][1][4]
* @endcode
*
* deal.II has its own implementation for tensorial objects such as
* dealii::Tensor<rank, dim, Number> and
* dealii::SymmetricTensor<rank, dim, Number>
*
* The methods and algorithms implemented in this namespace, however, are
* fully generic. More precisely, it can operate on nested c-style arrays,
* or on class types <code>T</code> with a minimal interface that provides
* a local typedef <code>value_type</code> and an index operator
* <code>operator[](unsigned int)</code> that returns a (const or
* non-const) reference of <code>value_type</code>:
* @code
* template<...>
* class T
* {
* typedef ... value_type;
* value_type & operator[](unsigned int);
* const value_type & operator[](unsigned int) const;
* };
* @endcode
*
* This namespace provides primitves for access, reordering and contraction
* of such objects.
*
* @ingroup geomprimitives
*/
namespace TensorAccessors
{
} /* namespace TensorAccessors */
DEAL_II_NAMESPACE_CLOSE
#endif /* dealii__tensor_accessors_h */
| Add a new namespace TensorAccessors | Add a new namespace TensorAccessors
This namespace will contain a collection of algorithms working on generic
tensorial objects (of arbitrary rank).
The rationale to implement such functionality in a generic fashion in a
separate namespace is
- to easy code reusability and therefore avoid code duplication.
- to have a well-defined interface that allows to exchange the low
level implementation.
| C | lgpl-2.1 | shakirbsm/dealii,ESeNonFossiIo/dealii,YongYang86/dealii,danshapero/dealii,Arezou-gh/dealii,pesser/dealii,andreamola/dealii,naliboff/dealii,andreamola/dealii,naliboff/dealii,maieneuro/dealii,YongYang86/dealii,spco/dealii,danshapero/dealii,angelrca/dealii,sairajat/dealii,JaeryunYim/dealii,danshapero/dealii,gpitton/dealii,johntfoster/dealii,pesser/dealii,ibkim11/dealii,gpitton/dealii,naliboff/dealii,EGP-CIG-REU/dealii,andreamola/dealii,gpitton/dealii,ESeNonFossiIo/dealii,adamkosik/dealii,nicolacavallini/dealii,sairajat/dealii,kalj/dealii,ibkim11/dealii,ESeNonFossiIo/dealii,gpitton/dealii,spco/dealii,naliboff/dealii,adamkosik/dealii,sairajat/dealii,maieneuro/dealii,EGP-CIG-REU/dealii,angelrca/dealii,Arezou-gh/dealii,spco/dealii,adamkosik/dealii,sairajat/dealii,gpitton/dealii,YongYang86/dealii,JaeryunYim/dealii,pesser/dealii,JaeryunYim/dealii,spco/dealii,spco/dealii,EGP-CIG-REU/dealii,ibkim11/dealii,Arezou-gh/dealii,andreamola/dealii,angelrca/dealii,JaeryunYim/dealii,Arezou-gh/dealii,jperryhouts/dealii,adamkosik/dealii,Arezou-gh/dealii,naliboff/dealii,maieneuro/dealii,angelrca/dealii,maieneuro/dealii,YongYang86/dealii,jperryhouts/dealii,jperryhouts/dealii,sairajat/dealii,YongYang86/dealii,shakirbsm/dealii,ESeNonFossiIo/dealii,kalj/dealii,nicolacavallini/dealii,danshapero/dealii,YongYang86/dealii,gpitton/dealii,johntfoster/dealii,kalj/dealii,andreamola/dealii,JaeryunYim/dealii,pesser/dealii,ibkim11/dealii,shakirbsm/dealii,EGP-CIG-REU/dealii,Arezou-gh/dealii,kalj/dealii,johntfoster/dealii,EGP-CIG-REU/dealii,shakirbsm/dealii,maieneuro/dealii,kalj/dealii,adamkosik/dealii,johntfoster/dealii,nicolacavallini/dealii,kalj/dealii,spco/dealii,shakirbsm/dealii,johntfoster/dealii,YongYang86/dealii,gpitton/dealii,angelrca/dealii,pesser/dealii,jperryhouts/dealii,pesser/dealii,EGP-CIG-REU/dealii,shakirbsm/dealii,JaeryunYim/dealii,sairajat/dealii,sairajat/dealii,jperryhouts/dealii,pesser/dealii,naliboff/dealii,jperryhouts/dealii,ibkim11/dealii,adamkosik/dealii,jperryhouts/dealii,ESeNonFossiIo/dealii,shakirbsm/dealii,adamkosik/dealii,ibkim11/dealii,danshapero/dealii,ESeNonFossiIo/dealii,johntfoster/dealii,angelrca/dealii,ibkim11/dealii,andreamola/dealii,naliboff/dealii,johntfoster/dealii,angelrca/dealii,nicolacavallini/dealii,JaeryunYim/dealii,kalj/dealii,maieneuro/dealii,nicolacavallini/dealii,Arezou-gh/dealii,danshapero/dealii,nicolacavallini/dealii,andreamola/dealii,maieneuro/dealii,nicolacavallini/dealii,danshapero/dealii,spco/dealii,EGP-CIG-REU/dealii,ESeNonFossiIo/dealii |
|
8f1e45e84583b476bd86de7fb2d23bf391a67f9a | main.c | main.c | #include <stdio.h>
#include <string.h>
#include <math.h>
#include "calc.h"
#include "input.h"
int main(void)
{
while (1){
char input[65536];
double ans;
read_line(input);
if (strcmp(input, "exit") == 0 || strcmp(input, "quit") == 0){
break;
}
ans = calc(input, 0);
if (floor(ans) == ans){
printf("%.0f\n", ans);
}
else{
printf("%f\n", calc(input, 0));
}
}
return (0);
}
| #include <stdio.h>
#include <string.h>
#include <math.h>
#include "calc.h"
#include "input.h"
int main(void)
{
while (1){
char input[65536];
double ans;
read_line(input);
if (strlen(input) == 0 || strcmp(input, "exit") == 0 || strcmp(input, "quit") == 0){
break;
}
ans = calc(input, 0);
if (floor(ans) == ans){
printf("%.0f\n", ans);
}
else{
printf("%f\n", calc(input, 0));
}
}
return (0);
}
| Exit when input line is empty | Exit when input line is empty
| C | mit | Roadagain/Calculator,Roadagain/Calculator |
3201618e6105204892a52265ecd84372f6b7925b | CMake/TestQnanhibit.c | CMake/TestQnanhibit.c | #include <stdio.h>
#include <float.h>
int
main(int argc, char *argv[])
{
char *me;
float qnan, zero;
int i;
me = argv[0];
if (sizeof(float) != sizeof(int))
{
fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n",
me, (int)sizeof(float), (int)sizeof(int));
return -1;
}
zero = 0;
qnan=zero/zero;
i=*(int*)(&qnan);
printf("-DTEEM_QNANHIBIT=%d\n", (i >> 22) & 1);
return (int)((i >> 22) & 1);
}
| #include <stdio.h>
#include <float.h>
#if defined(__BORLANDC__)
# include <math.h>
# include <float.h>
#endif
int
main(int argc, char *argv[])
{
#if defined(__BORLANDC__)
// Disable floating point exceptions in Borland
_control87(MCW_EM, MCW_EM);
#endif // defined(__BORLANDC__)
char *me;
float qnan, zero;
int i;
me = argv[0];
if (sizeof(float) != sizeof(int))
{
fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n",
me, (int)sizeof(float), (int)sizeof(int));
return -1;
}
zero = 0;
qnan=zero/zero;
i=*(int*)(&qnan);
printf("-DTEEM_QNANHIBIT=%d\n", (i >> 22) & 1);
return (int)((i >> 22) & 1);
}
| Disable floating point exceptions on Borland compiler | FIX: Disable floating point exceptions on Borland compiler
| C | apache-2.0 | LucHermitte/ITK,cpatrick/ITK-RemoteIO,hendradarwin/ITK,PlutoniumHeart/ITK,blowekamp/ITK,InsightSoftwareConsortium/ITK,daviddoria/itkHoughTransform,biotrump/ITK,hendradarwin/ITK,LucHermitte/ITK,CapeDrew/DCMTK-ITK,CapeDrew/DCMTK-ITK,wkjeong/ITK,InsightSoftwareConsortium/ITK,eile/ITK,hinerm/ITK,GEHC-Surgery/ITK,paulnovo/ITK,fbudin69500/ITK,BlueBrain/ITK,vfonov/ITK,jmerkow/ITK,Kitware/ITK,Kitware/ITK,fuentesdt/InsightToolkit-dev,hjmjohnson/ITK,heimdali/ITK,fedral/ITK,fedral/ITK,fedral/ITK,stnava/ITK,GEHC-Surgery/ITK,cpatrick/ITK-RemoteIO,fbudin69500/ITK,Kitware/ITK,heimdali/ITK,hjmjohnson/ITK,BlueBrain/ITK,hinerm/ITK,daviddoria/itkHoughTransform,richardbeare/ITK,heimdali/ITK,hinerm/ITK,hendradarwin/ITK,BlueBrain/ITK,msmolens/ITK,malaterre/ITK,BRAINSia/ITK,atsnyder/ITK,BRAINSia/ITK,Kitware/ITK,heimdali/ITK,daviddoria/itkHoughTransform,PlutoniumHeart/ITK,InsightSoftwareConsortium/ITK,wkjeong/ITK,wkjeong/ITK,BRAINSia/ITK,LucasGandel/ITK,zachary-williamson/ITK,CapeDrew/DCMTK-ITK,ajjl/ITK,rhgong/itk-with-dom,fuentesdt/InsightToolkit-dev,cpatrick/ITK-RemoteIO,thewtex/ITK,biotrump/ITK,fuentesdt/InsightToolkit-dev,stnava/ITK,BRAINSia/ITK,richardbeare/ITK,paulnovo/ITK,paulnovo/ITK,hjmjohnson/ITK,ajjl/ITK,LucasGandel/ITK,jmerkow/ITK,wkjeong/ITK,jmerkow/ITK,hendradarwin/ITK,msmolens/ITK,jcfr/ITK,paulnovo/ITK,blowekamp/ITK,paulnovo/ITK,CapeDrew/DITK,cpatrick/ITK-RemoteIO,zachary-williamson/ITK,msmolens/ITK,LucasGandel/ITK,paulnovo/ITK,InsightSoftwareConsortium/ITK,CapeDrew/DITK,eile/ITK,ajjl/ITK,msmolens/ITK,fbudin69500/ITK,BRAINSia/ITK,PlutoniumHeart/ITK,GEHC-Surgery/ITK,GEHC-Surgery/ITK,jcfr/ITK,malaterre/ITK,CapeDrew/DITK,GEHC-Surgery/ITK,spinicist/ITK,PlutoniumHeart/ITK,malaterre/ITK,biotrump/ITK,ajjl/ITK,thewtex/ITK,biotrump/ITK,CapeDrew/DITK,fbudin69500/ITK,jcfr/ITK,CapeDrew/DITK,LucasGandel/ITK,fedral/ITK,rhgong/itk-with-dom,PlutoniumHeart/ITK,zachary-williamson/ITK,InsightSoftwareConsortium/ITK,itkvideo/ITK,rhgong/itk-with-dom,Kitware/ITK,atsnyder/ITK,malaterre/ITK,ajjl/ITK,fbudin69500/ITK,richardbeare/ITK,fbudin69500/ITK,jmerkow/ITK,thewtex/ITK,heimdali/ITK,heimdali/ITK,spinicist/ITK,hinerm/ITK,paulnovo/ITK,zachary-williamson/ITK,CapeDrew/DCMTK-ITK,richardbeare/ITK,rhgong/itk-with-dom,hinerm/ITK,GEHC-Surgery/ITK,wkjeong/ITK,zachary-williamson/ITK,BRAINSia/ITK,jmerkow/ITK,atsnyder/ITK,blowekamp/ITK,itkvideo/ITK,jcfr/ITK,cpatrick/ITK-RemoteIO,GEHC-Surgery/ITK,itkvideo/ITK,jmerkow/ITK,daviddoria/itkHoughTransform,ajjl/ITK,BRAINSia/ITK,rhgong/itk-with-dom,paulnovo/ITK,malaterre/ITK,jcfr/ITK,hinerm/ITK,richardbeare/ITK,itkvideo/ITK,BlueBrain/ITK,zachary-williamson/ITK,biotrump/ITK,stnava/ITK,hjmjohnson/ITK,PlutoniumHeart/ITK,PlutoniumHeart/ITK,itkvideo/ITK,blowekamp/ITK,blowekamp/ITK,wkjeong/ITK,thewtex/ITK,blowekamp/ITK,richardbeare/ITK,stnava/ITK,malaterre/ITK,rhgong/itk-with-dom,PlutoniumHeart/ITK,eile/ITK,Kitware/ITK,thewtex/ITK,rhgong/itk-with-dom,CapeDrew/DCMTK-ITK,wkjeong/ITK,fuentesdt/InsightToolkit-dev,InsightSoftwareConsortium/ITK,spinicist/ITK,wkjeong/ITK,daviddoria/itkHoughTransform,LucasGandel/ITK,spinicist/ITK,CapeDrew/DITK,atsnyder/ITK,hinerm/ITK,hinerm/ITK,jmerkow/ITK,vfonov/ITK,LucHermitte/ITK,stnava/ITK,blowekamp/ITK,fedral/ITK,LucasGandel/ITK,msmolens/ITK,ajjl/ITK,atsnyder/ITK,BlueBrain/ITK,CapeDrew/DCMTK-ITK,hjmjohnson/ITK,vfonov/ITK,itkvideo/ITK,rhgong/itk-with-dom,fuentesdt/InsightToolkit-dev,heimdali/ITK,jmerkow/ITK,spinicist/ITK,spinicist/ITK,heimdali/ITK,LucHermitte/ITK,zachary-williamson/ITK,fedral/ITK,thewtex/ITK,Kitware/ITK,vfonov/ITK,spinicist/ITK,thewtex/ITK,atsnyder/ITK,vfonov/ITK,fuentesdt/InsightToolkit-dev,hendradarwin/ITK,msmolens/ITK,CapeDrew/DITK,eile/ITK,spinicist/ITK,CapeDrew/DITK,CapeDrew/DCMTK-ITK,InsightSoftwareConsortium/ITK,malaterre/ITK,vfonov/ITK,LucHermitte/ITK,itkvideo/ITK,CapeDrew/DCMTK-ITK,eile/ITK,daviddoria/itkHoughTransform,jcfr/ITK,cpatrick/ITK-RemoteIO,fbudin69500/ITK,vfonov/ITK,stnava/ITK,CapeDrew/DCMTK-ITK,fedral/ITK,hinerm/ITK,hendradarwin/ITK,fuentesdt/InsightToolkit-dev,LucasGandel/ITK,LucHermitte/ITK,atsnyder/ITK,jcfr/ITK,eile/ITK,blowekamp/ITK,malaterre/ITK,cpatrick/ITK-RemoteIO,biotrump/ITK,daviddoria/itkHoughTransform,BlueBrain/ITK,hjmjohnson/ITK,biotrump/ITK,richardbeare/ITK,vfonov/ITK,LucHermitte/ITK,spinicist/ITK,stnava/ITK,vfonov/ITK,fuentesdt/InsightToolkit-dev,atsnyder/ITK,hendradarwin/ITK,eile/ITK,hjmjohnson/ITK,cpatrick/ITK-RemoteIO,msmolens/ITK,stnava/ITK,zachary-williamson/ITK,LucasGandel/ITK,fuentesdt/InsightToolkit-dev,zachary-williamson/ITK,BlueBrain/ITK,daviddoria/itkHoughTransform,stnava/ITK,daviddoria/itkHoughTransform,CapeDrew/DITK,eile/ITK,LucHermitte/ITK,eile/ITK,GEHC-Surgery/ITK,BlueBrain/ITK,itkvideo/ITK,hendradarwin/ITK,atsnyder/ITK,biotrump/ITK,ajjl/ITK,malaterre/ITK,jcfr/ITK,msmolens/ITK,fbudin69500/ITK,itkvideo/ITK,fedral/ITK |
d3821b4d33b0ac75f5880c53ffdf960b3d7ea419 | src/choices.h | src/choices.h | /** \file choices.h switches that control debugging in source code.
* Uncomment the defines below to allow a specific type of compilation
*/
#ifndef __choices_h__
#define __choices_h__
/** Turn on YACAS_DEBUG if you want to see run-time statistics
* after typing Exit()
*/
//#define YACAS_DEBUG
/** Turn on USE_ASSERT to find programming errors through the asserts
* placed in various places of the application.
*/
//#define USE_ASSERT
/** Turn on NO_EXCEPTIONS if you want to disable run-time checking
* while executing commands.
*/
//#define NO_EXCEPTIONS
/** Enable long reference counts. This makes EVERY object 2 bytes
larger, so use only if needed.
*/
//#define USE_LONG_REF_COUNTS
#endif
| /** \file choices.h switches that control debugging in source code.
* Uncomment the defines below to allow a specific type of compilation
*/
#ifndef __choices_h__
#define __choices_h__
/** Turn on YACAS_DEBUG if you want to see run-time statistics
* after typing Exit()
*/
//#define YACAS_DEBUG
/** Turn on USE_ASSERT to find programming errors through the asserts
* placed in various places of the application.
*/
//#define USE_ASSERT
/** Turn on NO_EXCEPTIONS if you want to disable run-time checking
* while executing commands.
*/
//#define NO_EXCEPTIONS
/** Enable long reference counts. This makes EVERY object 2 bytes
larger, so use only if needed.
*/
#define USE_LONG_REF_COUNTS
#endif
| Use at least 32 bits long reference counters by default to avoid nasty, hard to track segfaults when calculations get larger | Use at least 32 bits long reference counters by default to avoid nasty,
hard to track segfaults when calculations get larger
| C | lgpl-2.1 | grzegorzmazur/yacas,tomaszkrysiuk/yacas,MateuszSnamina/yacas,MateuszSnamina/yacas,tomaszkrysiuk/yacas,qwert2003/yacas,martanoga/yacas,qwert2003/yacas,grzegorzmazur/yacas,grzegorzmazur/yacas,grzegorzmazur/yacas,MateuszSnamina/yacas,martanoga/yacas,grzegorzmazur/yacas,tomaszkrysiuk/yacas,qwert2003/yacas,martanoga/yacas,MateuszSnamina/yacas,qwert2003/yacas,grzegorzmazur/yacas,tomaszkrysiuk/yacas,martanoga/yacas,grzegorzmazur/yacas,MateuszSnamina/yacas,MateuszSnamina/yacas,MateuszSnamina/yacas,qwert2003/yacas,tomaszkrysiuk/yacas,qwert2003/yacas,tomaszkrysiuk/yacas,martanoga/yacas,qwert2003/yacas,tomaszkrysiuk/yacas,martanoga/yacas,martanoga/yacas |
d53c524fde11a730c3f89d709980706ec93ce881 | src/rtcmix/gen/fsize.c | src/rtcmix/gen/fsize.c | #include <ugens.h>
#include <stdio.h>
/* these 3 defined in makegen.c */
extern double *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
int
fsize(int genno)
/* returns the size of function number genno */
{
if(!sizeof_farray[f_goto[genno]]) {
fprintf(stderr,"fsize: You haven't allocated function %d yet!\n",genno);
closesf();
}
return(sizeof_farray[f_goto[genno]]);
}
| #include <ugens.h>
#include <stdio.h>
/* these 3 defined in makegen.c */
extern double *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* returns the size of function number genno */
int
fsize(int genno)
{
if (!sizeof_farray[f_goto[genno]]) {
die("fsize", "You haven't allocated function %d yet!", genno);
return -1;
}
return sizeof_farray[f_goto[genno]];
}
| Use die and return instead of exiting. | Use die and return instead of exiting.
| C | apache-2.0 | RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix |
973ad55a32a58adc24d0d4f217a57cca3289e71a | src/main/cc/any_sketch/util/macros.h | src/main/cc/any_sketch/util/macros.h | #ifndef SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define RETURN_IF_ERROR(status) \
do { \
Status _status = (status); \
if (!_status.ok()) return _status; \
} while (0)
#endif // SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
| /*
* Copyright 2020 The Any Sketch 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 SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define RETURN_IF_ERROR(status) \
do { \
Status _status = (status); \
if (!_status.ok()) return _status; \
} while (0)
#endif // SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
| Add LICENSE and source headers to any-sketch repo. | Add LICENSE and source headers to any-sketch repo.
BUG=161899344
Change-Id: I201d5420c80f9e16b6832c1bc31adf6ca6ab8cb1
| C | apache-2.0 | world-federation-of-advertisers/common-cpp |
e795d5fbcbb4658c49cb607694eb07ce85a10528 | php_shmt.h | php_shmt.h | #ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
| #ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0.1dev"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
| Modify the SHMT version to 1.0.1dev | Modify the SHMT version to 1.0.1dev
| C | mit | sevenval/SHMT,sevenval/SHMT |
192d8dbbd110766bf3c5c5bf39f1f08ffbe0760b | You-DataStore/datastore.h | You-DataStore/datastore.h | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
friend class Transaction;
public:
Transaction&& begin();
// Modifying methods
static bool post(TaskId, SerializedTask&);
static bool put(TaskId, SerializedTask&);
static bool erase(TaskId);
static std::vector<SerializedTask> getAllTask();
private:
static DataStore& get();
bool isServing = false;
std::deque<Internal::IOperation> operationsQueue;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
friend class Transaction;
public:
Transaction&& begin();
// Modifying methods
bool post(TaskId, SerializedTask&);
bool put(TaskId, SerializedTask&);
bool erase(TaskId);
std::vector<SerializedTask> getAllTask();
private:
static DataStore& get();
bool isServing = false;
std::deque<Internal::IOperation> operationsQueue;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| Change methods in DataStore to non-static anymore (it is alr a singleton) | Change methods in DataStore to non-static anymore (it is alr a singleton)
| C | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main |
f94601e977ea6bf7c466e30d62cce8f05d9973fd | src/shared/buxtonkey.h | src/shared/buxtonkey.h | /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton 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.
*/
#pragma once
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "buxton.h"
#include "buxtonstring.h"
/**
* Represents a data key in Buxton
*/
typedef struct BuxtonKey {
BuxtonString group; /**<Value of the key's group */
BuxtonString name; /**<Value of the key's name */
BuxtonString layer; /**<Value of the key's layer */
BuxtonDataType type; /**<Type of value associated with key */
} _BuxtonKey;
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
| Add internal representation of a BuxtonKey | shared: Add internal representation of a BuxtonKey
Keys will represent a single item identifying a value in buxton. The
key can contain any data needed to reference a value.
| C | lgpl-2.1 | sofar/buxton,sofar/buxton |
|
c8f1d5e9e726372211ccf0d44017d565aabcc3dc | openacc/2-manual-sum.c | openacc/2-manual-sum.c | #include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) {
const int sample = 10000;
size_t size = sample * sizeof(int);
int *restrict a1, *restrict a2, *restrict a3;
a1 = (int*) malloc(size);
a2 = (int*) malloc(size);
a3 = (int*) malloc(size);
int sum = 0;
int i;
#pragma acc data create(i, a1[0:sample], a2[0:sample], a3[0:sample]), copyin(sample), copy(sum)
{
#pragma acc parallel loop
for (i = 0; i < sample; ++i) {
a1[i] = a2[i] = 1;
}
#pragma acc parallel loop
for (i = 0; i < sample; ++i) {
a3[i] = a1[i] + a2[i];
}
#pragma acc parallel loop reduction(+:sum)
for (i = 0; i < sample; ++i) {
sum += a3[i];
}
}
free(a1);
free(a2);
free(a3);
printf("Sample size: %d | Sum: %d\n", sample, sum);
}
| Add a more elaborate example of acc computation. | Add a more elaborate example of acc computation.
| C | mit | Timer/parallel-computing,Timer/parallel-computing |
|
06a8fac3e909e7df4bd888cbb76964479ae80abc | gtk/tests/accessible.c | gtk/tests/accessible.c | #include <gtk/gtk.h>
static void
test_type (GType t)
{
GtkWidget *w;
AtkObject *a;
if (g_type_is_a (t, GTK_TYPE_WIDGET))
{
w = (GtkWidget *)g_object_new (t, NULL);
a = gtk_widget_get_accessible (w);
g_assert (GTK_IS_ACCESSIBLE (a));
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w);
g_object_unref (w);
}
}
int
main (int argc, char *argv[])
{
GType *tp;
gint i;
gtk_init (&argc, &argv);
tp = g_new0 (GType, 1000);
#undef GDK_WINDOWING_X11
#include "../gtktypefuncs.c"
*tp = 0;
for (i = 0; tp[i]; i++)
test_type (tp[i]);
return 0;
}
| #include <gtk/gtk.h>
static void
test_type (GType t)
{
GtkWidget *w;
AtkObject *a;
if (g_type_is_a (t, GTK_TYPE_WIDGET))
{
w = (GtkWidget *)g_object_new (t, NULL);
a = gtk_widget_get_accessible (w);
g_assert (GTK_IS_ACCESSIBLE (a));
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w);
g_object_unref (w);
}
}
int
main (int argc, char *argv[])
{
const GType *tp;
guint i, n;
gtk_init (&argc, &argv);
tp = gtk_test_list_all_types (&n);
for (i = 0; i < n; n++)
test_type (tp[i]);
return 0;
}
| Use testing API instead of duplicating it | tests: Use testing API instead of duplicating it
| C | lgpl-2.1 | ebassi/gtk,ebassi/gtk,jigpu/gtk,chergert/gtk,ahodesuka/gtk,msteinert/gtk,Lyude/gtk-,bratsche/gtk-,Adamovskiy/gtk,davidgumberg/gtk,davidgumberg/gtk,alexlarsson/gtk,ahodesuka/gtk,msteinert/gtk,bratsche/gtk-,chergert/gtk,Sidnioulz/SandboxGtk,ahodesuka/gtk,jadahl/gtk,Lyude/gtk-,bratsche/gtk-,chergert/gtk,Sidnioulz/SandboxGtk,alexlarsson/gtk,jadahl/gtk,Distrotech/gtk2,jigpu/gtk,jessevdk/gtk,Distrotech/gtk2,Lyude/gtk-,grubersjoe/adwaita,grubersjoe/adwaita,jigpu/gtk,bratsche/gtk-,jadahl/gtk,alexlarsson/gtk,grubersjoe/adwaita,Sidnioulz/SandboxGtk,Adamovskiy/gtk,davidgumberg/gtk,alexlarsson/gtk,Lyude/gtk-,jigpu/gtk,davidgumberg/gtk,Sidnioulz/SandboxGtk,jessevdk/gtk,ahodesuka/gtk,jessevdk/gtk,grubersjoe/adwaita,alexlarsson/gtk,Lyude/gtk-,jigpu/gtk,ebassi/gtk,bratsche/gtk-,ebassi/gtk,Sidnioulz/SandboxGtk,chergert/gtk,jessevdk/gtk,chergert/gtk,chergert/gtk,jessevdk/gtk,jigpu/gtk,jadahl/gtk,alexlarsson/gtk,Adamovskiy/gtk,Sidnioulz/SandboxGtk,Distrotech/gtk2,chergert/gtk,msteinert/gtk,grubersjoe/adwaita,ebassi/gtk,Lyude/gtk-,Adamovskiy/gtk,Distrotech/gtk2,ebassi/gtk,Lyude/gtk-,jadahl/gtk,Distrotech/gtk2,Adamovskiy/gtk,msteinert/gtk,jigpu/gtk,davidgumberg/gtk,bratsche/gtk-,Adamovskiy/gtk,jessevdk/gtk,ahodesuka/gtk,msteinert/gtk,grubersjoe/adwaita,ahodesuka/gtk,alexlarsson/gtk,alexlarsson/gtk,jadahl/gtk,Lyude/gtk-,grubersjoe/adwaita,davidgumberg/gtk,jadahl/gtk,Distrotech/gtk2,msteinert/gtk,Adamovskiy/gtk,jigpu/gtk,jadahl/gtk,davidgumberg/gtk,grubersjoe/adwaita,davidgumberg/gtk,ahodesuka/gtk,chergert/gtk,jessevdk/gtk,Adamovskiy/gtk,ahodesuka/gtk |
aacc405f32026f676293f5ba64d50e9a70ef50a9 | testmud/mud/home/Test/initd.c | testmud/mud/home/Test/initd.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading...");
load_dir("obj", 1);
load_dir("sys", 1);
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}
| /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
KERNELD->set_global_access("Test", 1);
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading...");
load_dir("obj", 1);
load_dir("sys", 1);
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}
| Add global access to test subsystem | Add global access to test subsystem
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
c0cf830770eba3893b0c61317d8772f9e837ddbf | Example/SMPageControl/SMViewController.h | Example/SMPageControl/SMViewController.h | //
// SMViewController.h
// SMPageControl
//
// Created by Jerry Jones on 10/13/12.
// Copyright (c) 2012 Spaceman Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SMPageControl.h"
@interface SMViewController : UIViewController
@property (nonatomic, readonly) IBOutlet UIScrollView *scrollview;
@property (nonatomic, readonly) IBOutlet UIPageControl *pageControl;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl1;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl2;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl3;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl4;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl5;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl6;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl7;
@property (nonatomic, readonly) IBOutlet SMPageControl *spacePageControl8;
@end
| //
// SMViewController.h
// SMPageControl
//
// Created by Jerry Jones on 10/13/12.
// Copyright (c) 2012 Spaceman Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SMPageControl.h"
@interface SMViewController : UIViewController
@property (nonatomic, weak) IBOutlet UIScrollView *scrollview;
@property (nonatomic, weak) IBOutlet UIPageControl *pageControl;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl1;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl2;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl3;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl4;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl5;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl6;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl7;
@property (nonatomic, weak) IBOutlet SMPageControl *spacePageControl8;
@end
| Change IBOutlet attributes from readonly to weak | Change IBOutlet attributes from readonly to weak
This fixes the warning "readonly IBOutlet property when auto-synthesized may not work correctly with 'nib' loader".
Also, weak is better than assign when using weak references to objects, because weak prevents dangling pointers.
| C | mit | doanhkisi/SMPageControl,CorzFree/SMPageControl,Spaceman-Labs/SMPageControl,HelloWilliam/SMPageControl |
5ba364466dabf4e4d8809218197b5bd0761db881 | IntelFrameworkPkg/Include/FrameworkDxe.h | IntelFrameworkPkg/Include/FrameworkDxe.h | /** @file
Header file that supports Framework extension to UEFI/PI for DXE modules.
This header file must include Framework extension definitions common to DXE
modules.
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FrameworkDxe.h
**/
#ifndef _FRAMEWORK_DXE_H_
#define _FRAMEWORK_DXE_H_
#include <FrameworkPei.h>
#include <Framework/DxeCis.h>
#include <Framework/FrameworkInternalFormRepresentation.h>
#endif
| /** @file
Header file that supports Framework extension to UEFI/PI for DXE modules.
This header file must include Framework extension definitions common to DXE
modules.
Copyright (c) 2007-2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _FRAMEWORK_DXE_H_
#define _FRAMEWORK_DXE_H_
#include <FrameworkPei.h>
#include <Framework/DxeCis.h>
#include <Framework/FrameworkInternalFormRepresentation.h>
#endif
| Update Copyright. Delete erroneous "Module Name" line. | Update Copyright. Delete erroneous "Module Name" line.
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8673 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
590ed8f60ad02fe8f1ed66c086c04e3fe4ea29b5 | src/lib/MarbleLocale.h | src/lib/MarbleLocale.h | //
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 Torsten Rahn <[email protected]>
// Copyright 2007 Inge Wallin <[email protected]>
//
#ifndef MARBLE_LOCALE_H
#define MARBLE_LOCALE_H
#include "marble_export.h"
#include "global.h"
namespace Marble
{
class MarbleLocalePrivate;
/**
* @short A class that contains all localization stuff for Marble.
*
* The class stores properties like the Distance Unit.
*/
class MARBLE_EXPORT MarbleLocale
{
public:
MarbleLocale();
~MarbleLocale();
void setDistanceUnit( DistanceUnit distanceUnit );
DistanceUnit distanceUnit() const;
void setMeasureSystem( MeasureSystem measureSystem );
MeasureSystem measureSystem() const;
static QString languageCode();
static QString simpleLanguageCode();
private:
Q_DISABLE_COPY( MarbleLocale )
MarbleLocalePrivate * const d;
};
}
#endif // MARBLE_LOCALE_H
| //
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 Torsten Rahn <[email protected]>
// Copyright 2007 Inge Wallin <[email protected]>
//
#ifndef MARBLE_LOCALE_H
#define MARBLE_LOCALE_H
#include "marble_export.h"
#include "global.h"
namespace Marble
{
class MarbleLocalePrivate;
/**
* @short A class that contains all localization stuff for Marble.
*
* The class stores properties like the Distance Unit.
*/
class MARBLE_EXPORT MarbleLocale
{
public:
MarbleLocale();
~MarbleLocale();
void setDistanceUnit( DistanceUnit distanceUnit );
DistanceUnit distanceUnit() const;
void setMeasureSystem( MeasureSystem measureSystem );
MeasureSystem measureSystem() const;
static QString languageCode();
private:
Q_DISABLE_COPY( MarbleLocale )
MarbleLocalePrivate * const d;
};
}
#endif // MARBLE_LOCALE_H
| Remove simpleLanguageCode (unused and not implemented). | Remove simpleLanguageCode (unused and not implemented).
svn path=/trunk/KDE/kdeedu/marble/; revision=1102505
| C | lgpl-2.1 | AndreiDuma/marble,tucnak/marble,utkuaydin/marble,Earthwings/marble,probonopd/marble,Earthwings/marble,adraghici/marble,AndreiDuma/marble,AndreiDuma/marble,utkuaydin/marble,rku/marble,probonopd/marble,oberluz/marble,probonopd/marble,AndreiDuma/marble,rku/marble,oberluz/marble,David-Gil/marble-dev,utkuaydin/marble,rku/marble,David-Gil/marble-dev,adraghici/marble,Earthwings/marble,Earthwings/marble,quannt24/marble,oberluz/marble,quannt24/marble,Earthwings/marble,AndreiDuma/marble,rku/marble,oberluz/marble,tucnak/marble,tzapzoor/marble,tzapzoor/marble,tzapzoor/marble,rku/marble,adraghici/marble,quannt24/marble,adraghici/marble,tzapzoor/marble,tucnak/marble,oberluz/marble,adraghici/marble,utkuaydin/marble,probonopd/marble,tucnak/marble,rku/marble,tucnak/marble,adraghici/marble,tzapzoor/marble,utkuaydin/marble,probonopd/marble,quannt24/marble,Earthwings/marble,tzapzoor/marble,tzapzoor/marble,tzapzoor/marble,tucnak/marble,tucnak/marble,quannt24/marble,AndreiDuma/marble,quannt24/marble,David-Gil/marble-dev,David-Gil/marble-dev,David-Gil/marble-dev,oberluz/marble,utkuaydin/marble,probonopd/marble,probonopd/marble,quannt24/marble,David-Gil/marble-dev |
bcdfda8195e5414119afebb64601f89b37cf04fc | src/ifdhandler.c | src/ifdhandler.c | #include <ifdhandler.h>
| #include <ifdhandler.h>
#include <stdio.h>
RESPONSECODE IFDHCreateChannelByName(DWORD Lun, LPSTR DeviceName)
{
return IFD_NO_SUCH_DEVICE;
}
RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel)
{
char buf[40];
snprintf(buf, sizeof(buf), "/dev/o2scr%d", Channel);
return IFDHCreateChannelByName(Lun, buf);
}
RESPONSECODE IFDHCloseChannel(DWORD Lun)
{
return IFD_SUCCESS;
}
RESPONSECODE IFDHGetCapabilities (DWORD Lun, DWORD Tag, PDWORD Length, PUCHAR Value)
{
// FIXME
(*Length) = 0;
return IFD_ERROR_TAG;
}
RESPONSECODE IFDHSetCapabilities (DWORD Lun, DWORD Tag, DWORD Length, PUCHAR Value)
{
return IFD_NOT_SUPPORTED;
}
RESPONSECODE IFDHPowerICC (DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD AtrLength)
{
return IFD_NOT_SUPPORTED;
}
RESPONSECODE IFDHTransmitToICC (DWORD Lun, SCARD_IO_HEADER SendPci, PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, PDWORD RxLength, PSCARD_IO_HEADER RecvPci)
{
return IFD_NOT_SUPPORTED;
}
RESPONSECODE IFDHICCPresence (DWORD Lun)
{
return IFD_ICC_NOT_PRESENT;
}
RESPONSECODE IFDHControl (DWORD Lun, DWORD dwControlCode, PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, DWORD RxLength, LPDWORD pdwBytesReturned)
{
return IFD_NOT_SUPPORTED;
}
RESPONSECODE IFDHSetProtocolParameters (DWORD Lun, DWORD Protocol, UCHAR Flags, UCHAR PTS1, UCHAR PTS2, UCHAR PTS3)
{
return IFD_NOT_SUPPORTED;
}
| Add empty dummy implementation of ifd handler | Add empty dummy implementation of ifd handler
Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
| C | lgpl-2.1 | lumag/o2scr-ifd |
5c015c4a0da723ab62abcedc2a861daa1c320a00 | tutorial/clock.h | tutorial/clock.h | // A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
extern "C" bool QueryPerformanceCounter(uint64_t *);
extern "C" bool QueryPerformanceFrequency(uint64_t *);
double current_time() {
uint64_t t, freq;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq);
return (t * 1000.0) / freq;
}
#else
#include <sys/time.h>
double current_time() {
static bool first_call = true;
static timeval reference_time;
if (first_call) {
first_call = false;
gettimeofday(&reference_time, NULL);
return 0.0;
} else {
timeval t;
gettimeofday(&t, NULL);
return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
(t.tv_usec - reference_time.tv_usec)/1000.0);
}
}
#endif
| // A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
#include <Windows.h>
double current_time() {
LARGE_INTEGER freq, t;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq);
return (t.QuadPart * 1000.0) / freq.QuadPart;
}
// Gross, these come from Windows.h
#undef max
#undef min
#else
#include <sys/time.h>
double current_time() {
static bool first_call = true;
static timeval reference_time;
if (first_call) {
first_call = false;
gettimeofday(&reference_time, NULL);
return 0.0;
} else {
timeval t;
gettimeofday(&t, NULL);
return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
(t.tv_usec - reference_time.tv_usec)/1000.0);
}
}
#endif
| Fix build of tutorials that require libpng under Visual Studio. | Fix build of tutorials that require libpng under Visual Studio.
Former-commit-id: ca864cc2e2063756ba8e48de390d1cf947f2efad | C | mit | Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide |
61fbb5891d9dcde973da71de4011ba748948fca1 | src/init.c | src/init.c | #include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include "common.h"
static void reap(char *argv[]);
static pid_t spawn(char *argv[]);
extern void init(char *argv[]);
int main(int argc, char *argv[])
{
const char *name = getenv("PROCNAME");
if (name && *name)
setprocname(name, argv[0]);
if (getpid() == 1) {
/* parent process */
reap(argv);
} else {
/* child process */
prepare_env();
init(argv + 1);
}
return 1;
}
static void reap(char *argv[])
{
pid_t child = 0;
for (;;) {
if (!child)
child = spawn(argv);
pid_t died = wait(NULL);
if (died > 0 && died == child)
child = 0;
}
}
static pid_t spawn(char *argv[])
{
/* block signals so child process can't wreak havoc for parent */
sigset_t sigs;
sigfillset(&sigs);
sigprocmask(SIG_BLOCK, &sigs, 0);
pid_t pid = fork();
if (!pid) {
sigprocmask(SIG_UNBLOCK, &sigs, 0);
execv(argv[0], argv);
}
return pid;
}
| #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include "common.h"
static void reap(char *argv[]);
static pid_t spawn(char *argv[]);
extern void init(char *argv[]);
const char *path;
int main(int argc, char *argv[])
{
path = strdup(argv[0]);
const char *name = getenv("PROCNAME");
if (name && *name)
setprocname(name, argv[0]);
if (getpid() == 1) {
/* parent process */
reap(argv);
} else {
/* child process */
prepare_env();
init(argv + 1);
}
return 1;
}
static void reap(char *argv[])
{
pid_t child = 0;
for (;;) {
if (!child)
child = spawn(argv);
pid_t died = wait(NULL);
if (died > 0 && died == child)
child = 0;
}
}
static pid_t spawn(char *argv[])
{
/* block signals so child process can't wreak havoc for parent */
sigset_t sigs;
sigfillset(&sigs);
sigprocmask(SIG_BLOCK, &sigs, 0);
pid_t pid = fork();
if (!pid) {
sigprocmask(SIG_UNBLOCK, &sigs, 0);
execv(path, argv);
}
return pid;
}
| Save program path before doing setprocname(). | Save program path before doing setprocname().
| C | bsd-2-clause | Shizmob/finite |
c1e16b1a0d2179370ae26c8f567441e6be803294 | ugeneric.h | ugeneric.h | #include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"
| #if defined(__cplusplus)
extern "C" {
#endif
#include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"
#if defined(__cplusplus)
}
#endif
| Add a little bit of c++ awareness to the main header | Add a little bit of c++ awareness to the main header
| C | mit | vslapik/ugeneric,vslapik/ugeneric,vslapik/ugeneric |
a91d1e7ba1332bad5a735c067c487ab0c9d0eb9d | src/laco.h | src/laco.h | #ifndef __LACO_H
#define __LACO_H
struct lua_State;
/* State of laco REPL */
struct LacoState;
/**
* Makes a new LacoState.
*
* param argument count (argc)
* param arguments (argv)
*
* return a pointer to new LacoState.
*/
struct LacoState* laco_newLacoState(int, const char**);
/**
* Destroys the internal variable, but doesn't try to free the LacoState
* pointer itself.
*
* param pointer to LacoState
*
* return 1 if pointer isn't NULL
*/
int laco_destroyLacoState(struct LacoState*);
struct lua_State* laco_getLacoLuaState(struct LacoState*);
const char* laco_getLacoVersion(struct LacoState*);
const char** laco_getLacoArgs(struct LacoState*);
int laco_getLacoStatus(struct LacoState*);
void laco_setLacoStatus(struct LacoState*, int);
#endif /* __LACO_H */
| #ifndef __LACO_H
#define __LACO_H
struct lua_State;
/* State of laco REPL */
struct LacoState;
/**
* Makes a new LacoState.
*
* param argument count (argc)
* param arguments (argv)
*
* return a pointer to new LacoState.
*/
struct LacoState* laco_newLacoState(int, const char**);
/**
* Destroys the internal variable, but doesn't try to free the LacoState
* pointer itself.
*
* param pointer to LacoState
*
* return 1 if pointer isn't NULL
*/
int laco_destroyLacoState(struct LacoState*);
/**
* Gets the lua state held with laco.
*
* param pointer to LacoState
*
* return a pointer to lua_State
*/
struct lua_State* laco_getLacoLuaState(struct LacoState*);
/**
* Gets the laco version held with laco.
*
* param pointer to LacoState
*
* return a string of characters representing laco's version number
*/
const char* laco_getLacoVersion(struct LacoState*);
/**
* Gets the arraying of arguments passed to laco.
*
* param pointer to LacoState
*
* return an array of characters string passes into laco
*/
const char** laco_getLacoArgs(struct LacoState*);
/**
* Get the current status of the laco repl.
*
* param pointer to LacoState
*
* return the current status of laco
*/
int laco_getLacoStatus(struct LacoState*);
/**
* Set the current status of laco.
*
* param pointer to LacoState
* param status to be set
*/
void laco_setLacoStatus(struct LacoState*, int);
#endif /* __LACO_H */
| Add documentation for new get and set functions | Add documentation for new get and set functions
| C | bsd-2-clause | sourrust/laco |
8e280cced6657669e8f47b19ee22f587ff91b721 | Wikipedia/Code/WMFRelatedSearchResults.h | Wikipedia/Code/WMFRelatedSearchResults.h | #import <Foundation/Foundation.h>
@class MWKSearchResult;
@interface WMFRelatedSearchResults : NSObject
@property (nonatomic, strong, readonly) NSURL *siteURL;
@property (nonatomic, strong, readonly) NSArray<MWKSearchResult *> *results;
- (instancetype)initWithURL:(NSURL *)URL results:(NSArray *)results;
@end
| #import <Mantle/Mantle.h>
@class MWKSearchResult;
@interface WMFRelatedSearchResults : MTLModel
@property (nonatomic, strong, readonly) NSURL *siteURL;
@property (nonatomic, strong, readonly) NSArray<MWKSearchResult *> *results;
- (instancetype)initWithURL:(NSURL *)URL results:(NSArray *)results;
@end
| Make search results storable in database as metadata | Make search results storable in database as metadata
Just need to inherit from MTLModel for NSCoding
| C | mit | anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios |
7fb9042a91ebeeb34a622f73ff61c9feef891e8b | src/main.c | src/main.c | /*
* Copyright 2015, Wink Saville
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*/
#include <sel4/printf.h>
/**
* No parameters are passed to main, the return
* value is ignored and the program hangs.
*/
int main(void) {
seL4_Printf("Hello, World!\n");
return 0;
}
| /*
* Copyright 2015, Wink Saville
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*/
#include <sel4/printf.h>
/**
* No parameters are passed to main, the return
* value is ignored and the program hangs.
*/
int main(void) {
seL4_Printf("Hello, World!\n");
return 0;
}
| Change indent to 4 spaces. | Change indent to 4 spaces.
| C | bsd-2-clause | winksaville/sel4-app-helloworld |
7e3576d2e120fb69cc360c976341bf5491bbb633 | src/port.h | src/port.h | // Copyright 2013 by Tetsuo Kiso
//
// 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 FAST_ALIGN_PORT_H_
#define FAST_ALIGN_PORT_H_
// As of OS X 10.9, it looks like C++ TR1 headers are removed from the
// search paths. Instead, we can include C++11 headers.
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
#include <unordered_map>
#include <functional>
#else // Assuming older OS X, Linux or similar platforms
#include <tr1/unordered_map>
#include <tr1/functional>
namespace std {
using tr1::unordered_map;
using tr1::hash;
} // namespace std
#endif
#endif // FAST_ALIGN_PORT_H_
| // Copyright 2013 by Tetsuo Kiso
//
// 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 FAST_ALIGN_PORT_H_
#define FAST_ALIGN_PORT_H_
// As of OS X 10.9, it looks like C++ TR1 headers are removed from the
// search paths. Instead, we can include C++11 headers.
#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#endif
#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_9) && \
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
#include <unordered_map>
#include <functional>
#else // Assuming older OS X, Linux or similar platforms
#include <tr1/unordered_map>
#include <tr1/functional>
namespace std {
using tr1::unordered_map;
using tr1::hash;
} // namespace std
#endif
#endif // FAST_ALIGN_PORT_H_
| Include the OS X specific header to use OS specific macros. | Include the OS X specific header to use OS specific macros.
| C | apache-2.0 | clab/fast_align,spanishdict/fast_align,LoreDema/fast_align,clab/fast_align,christianbuck/fast_align,LoreDema/fast_align,spanishdict/fast_align,christianbuck/fast_align |
51f8c2e766d7d7110e073630b6a1885eb7d7cabc | bst.c | bst.c | #include "bst.h"
static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v);
struct BSTNode
{
BSTNode* left;
BSTNode* right;
BSTNode* p;
void* k;
};
struct BST
{
BSTNode* root;
};
BST* BST_Create(void)
{
BST* T = (BST* )malloc(sizeof(BST));
T->root = NULL;
return T;
}
| #include "bst.h"
static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v);
struct BSTNode
{
BSTNode* left;
BSTNode* right;
BSTNode* p;
void* k;
};
struct BST
{
BSTNode* root;
};
BST* BST_Create(void)
{
BST* T = (BST* )malloc(sizeof(BST));
T->root = NULL;
return T;
}
BSTNode* BSTNode_Create(void* k)
{
BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode));
n->left = NULL;
n->right = NULL;
n->p = NULL;
n->k = k;
}
| Add BSTNode create function implementation | Add BSTNode create function implementation
| C | mit | MaxLikelihood/CADT |
c80f71802443a6a352a7ed7c0f1dfbeda97d961a | bst.h | bst.h | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Tree_Minimum(BSTNode* n);
BSTNode* BST_Tree_Maximum(BSTNode* n);
#endif | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Tree_Minimum(BSTNode* n);
BSTNode* BST_Tree_Maximum(BSTNode* n);
BSTNode* BST_Tree_Root(BST* T);
#endif | Add BST Tree Root function declaration | Add BST Tree Root function declaration
| C | mit | MaxLikelihood/CADT |
8ae38b029c6566f18bcf7a8781c1235f2d57acbc | unique-characters/unique-characters/main.c | unique-characters/unique-characters/main.c | //
// main.c
// unique-characters
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
//
#include <stdio.h>
void printCharacters(char *inputString) {
int dictinary[30] = {};
while (*inputString) {
dictinary[(int) *inputString]++;
printf("Current character is: %c\n", *inputString);
inputString++;
}
}
int main(int argc, const char * argv[]) {
void printCharacters(char *inputString);
char inputString[80] = {};
printf("Please enter your string: ");
scanf("%s", inputString);
// build a hash table with caracters
printCharacters(inputString);
printf("Your string is: %s\n", inputString);
return 0;
}
| //
// main.c
// Check if a string has all unique characters by counting how many times each character appears using its ASCII code
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
//
#include <stdio.h>
_Bool isUniqueChars(char *str) {
int frequencyDictionary[127] = {};
while(*str) {
frequencyDictionary[(int) *str]++;
if (frequencyDictionary[(int) *str] > 1) {
return 0;
}
str++;
}
return 1;
}
int main(void) {
_Bool isUniqueChars(char *string);
char inputString[127] = {};
printf("Please enter your string: ");
fgets(inputString, 128, stdin);
printf("This string with %s\n", isUniqueChars(inputString) ? "unique characters." : "duplicates.");
return 0;
}
| Check if a string has all unique characters algorithm | Check if a string has all unique characters algorithm
| C | mit | jack-zuban/c-practice |
b832d36facff0cf57695e537e06a7ba1f484c6e6 | ugeneric.h | ugeneric.h | #include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "string_utils.h"
#include "file_utils.h"
| Add common header for library functions | Add common header for library functions
| C | mit | vslapik/ugeneric,vslapik/ugeneric,vslapik/ugeneric |
|
d56b3dc386fbcc966e600b357768b078ceea550d | ios/RNFlurryAnalytics.h | ios/RNFlurryAnalytics.h | #import "RCTBridgeModule.h"
@interface RNFlurryAnalytics : NSObject <RCTBridgeModule>
@end
| #import <React/RCTBridgeModule.h>
@interface RNFlurryAnalytics : NSObject <RCTBridgeModule>
@end
| Update header include paths to support React Native 0.40 | Update header include paths to support React Native 0.40
| C | mit | xxsnakerxx/react-native-flurry-analytics,xxsnakerxx/react-native-flurry-analytics |
77cea865bdef876d2745442ce2894ec8288d6cb3 | kernel/kernel.c | kernel/kernel.c | #include <stddef.h>
#include <stdint.h>
#include "./arch/x86/idt.h"
#include <terminal.h>
#include <kabort.h>
#include <kassert.h>
void kernel_main()
{
term_initialize();
idt_install();
kputs("Interrupt?");
int i = 0;
int b = 128;
int d = 1;
d = b / i;
while (1)
;
}
| #include <stddef.h>
#include <stdint.h>
#include "./arch/x86/gdt.h"
#include "./arch/x86/idt.h"
#include <terminal.h>
#include <kabort.h>
#include <kassert.h>
void kernel_main()
{
term_initialize();
gdt_install();
idt_install();
kputs("Hello kernel!");
while (1) {
};
}
| Install GDT and remove division by 0 | Install GDT and remove division by 0
| C | mit | iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,Herbstein/kernel-of-truth |
57bd2cbba55e1dc808ac5daec0b8440d542eafbe | ios/src/TGGeoPoint.h | ios/src/TGGeoPoint.h | //
// TGGeoPoint.h
// tangram
//
// Created by Karim Naaji on 10/27/16.
//
//
#ifndef TGGeoPoint_h
#define TGGeoPoint_h
struct TGGeoPoint {
double longitude;
double latitude;
};
typedef struct TGGeoPoint TGGeoPoint;
static inline TGGeoPoint TGGeoPointMake(double lat, double lon)
{
TGGeoPoint p;
p.latitude = lat;
p.longitude = lon;
return p;
}
#endif /* TGGeoPoint_h */
| //
// TGGeoPoint.h
// tangram
//
// Created by Karim Naaji on 10/27/16.
//
//
#pragma once
struct TGGeoPoint {
double longitude;
double latitude;
};
typedef struct TGGeoPoint TGGeoPoint;
static inline TGGeoPoint TGGeoPointMake(double lat, double lon)
{
TGGeoPoint p;
p.latitude = lat;
p.longitude = lon;
return p;
}
| Update for pragma syntax - Only unsupported on older versions of GCC | Update for pragma syntax
- Only unsupported on older versions of GCC
| C | mit | quitejonny/tangram-es,tangrams/tangram-es,tangrams/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,cleeus/tangram-es,tangrams/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,tangrams/tangram-es,tangrams/tangram-es,cleeus/tangram-es,cleeus/tangram-es,cleeus/tangram-es,tangrams/tangram-es |
4be116f58417a5f94ea51babff4e1a06425ab37e | loopback_test.c | loopback_test.c | #include "usbdmx.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
int result;
int set_value;
int count = 0;
TDMXArray dmx_out;
TDMXArray dmx_in;
// Open Interface in Mode 6 (PC Out -> DMX Out & DMX In -> PC In)
// See head of this file for details
result = OpenInterface(&dmx_out, &dmx_in, 6);
if(result == 0) {
// Open failed
printf("Unable to open Interface\n");
exit(1);
}
while(1) {
set_value = count % 256;
dmx_out[0] = set_value;
dmx_out[1] = set_value;
dmx_out[2] = set_value;
usleep(50000); // Wait 50 ms
if ( (dmx_in[0] != set_value) ||
(dmx_in[1] != set_value) ||
(dmx_out[2] != set_value)) {
printf("FAIL %d\n", count);
} else {
count ++;
printf("Still working %d\n", count);
}
}
return 0;
}
| #include "usbdmx.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
int result;
int set_value;
int count = 0;
TDMXArray dmx_out;
TDMXArray dmx_in;
// Open Interface in Mode 6 (PC Out -> DMX Out & DMX In -> PC In)
// See head of this file for details
result = OpenInterface(&dmx_out, &dmx_in, 6);
if(result == 0) {
// Open failed
printf("Unable to open Interface\n");
exit(1);
}
while(1) {
set_value = count % 256;
dmx_out[0] = set_value;
dmx_out[1] = set_value;
dmx_out[2] = set_value;
usleep(50000); // Wait 50 ms
if ( (dmx_in[0] != set_value) ||
(dmx_in[1] != set_value) ||
(dmx_in[2] != set_value)) {
printf("FAIL %d\n", count);
} else {
count ++;
printf("Still working %d\n", count);
}
}
return 0;
}
| Fix typo dmx_out instead of dmx_in | Fix typo dmx_out instead of dmx_in
| C | bsd-3-clause | DMXControl/usbdmx,DMXControl/usbdmx,DMXControl/usbdmx,fx5/usbdmx,fx5/usbdmx,fx5/usbdmx |
f74c134dddc1b7307c24f98180256cd0fec1d316 | Useful/FunTypes.h | Useful/FunTypes.h | #if defined TESTFLIGHT
#define TESTFLIGHT YES
#define DISTRIBUTION NO
#elif defined DEBUG
#define TESTFLIGHT NO
#define DISTRIBUTION NO
#else
#define TESTFLIGHT NO
#define DISTRIBUTION YES
#endif
#define CLIP(X,min,max) MIN(MAX(X, min), max)
#define white [UIColor whiteColor]
#define yellow [UIColor yellowColor]
#define transparent [UIColor clearColor]
#define black [UIColor blackColor]
#if defined __MAC_OS_X_VERSION_MAX_ALLOWED
#define PLATFORM_OSX
#define UIApplicationDelegate NSApplicationDelegate
#define UIView NSView
#define UIApplication NSApplication
#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED
#define PLATFORM_IOS
#endif
void error(NSError* err);
NSError* makeError(NSString* localMessage);
typedef void (^Block)();
typedef void (^Callback)(NSError* err, NSDictionary* res);
typedef void (^StringCallback)(NSError* err, NSString* res);
typedef void (^ArrayCallback)(NSError* err, NSArray* res);
typedef void (^DataCallback)(NSError* err, NSData* data);
typedef void (^ImageCallback)(NSError* err, UIImage* image);
typedef void (^ViewCallback)(NSError* err, UIView* view);
void after(CGFloat delayInSeconds, Block block);
void vibrateDevice();
NSString* concat(id arg1, ...);
NSNumber* num(int i);
| #define MODE_DEV 1
#define MODE_TESTFLIGHT 2
#define MODE_DISTRIBUTION 3
#if defined TESTFLIGHT
#define MODE MODE_TESTFLIGHT
#elif defined DEBUG
#define MODE MODE_DEV
#else
#define MODE MODE_DISTRIBUTION
#endif
#define IS_DISTRIBUTION (MODE == MODE_DISTRIBUTION)
#define CLIP(X,min,max) MIN(MAX(X, min), max)
#define white [UIColor whiteColor]
#define yellow [UIColor yellowColor]
#define transparent [UIColor clearColor]
#define black [UIColor blackColor]
#if defined __MAC_OS_X_VERSION_MAX_ALLOWED
#define PLATFORM_OSX
#define UIApplicationDelegate NSApplicationDelegate
#define UIView NSView
#define UIApplication NSApplication
#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED
#define PLATFORM_IOS
#endif
void error(NSError* err);
NSError* makeError(NSString* localMessage);
typedef void (^Block)();
typedef void (^Callback)(NSError* err, NSDictionary* res);
typedef void (^StringCallback)(NSError* err, NSString* res);
typedef void (^ArrayCallback)(NSError* err, NSArray* res);
typedef void (^DataCallback)(NSError* err, NSData* data);
typedef void (^ImageCallback)(NSError* err, UIImage* image);
typedef void (^ViewCallback)(NSError* err, UIView* view);
void after(CGFloat delayInSeconds, Block block);
void vibrateDevice();
NSString* concat(id arg1, ...);
NSNumber* num(int i);
| Add macro MODE and MODE_DEV, MODE_TESTFLIGHT, MODE_DISTRIBUTION | Add macro MODE and MODE_DEV, MODE_TESTFLIGHT, MODE_DISTRIBUTION
| C | mit | ASAPPinc/fun-go,marcuswestin/fun-go,marcuswestin/FunGo |
37a8410bea290d24e316a841d3fac2fe03815011 | xftwidth.c | xftwidth.c | #include <X11/Xft/Xft.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
if (argc < 3) {
printf("xftwidth font string\n");
return 1;
}
Display *dpy;
XftFont *fn;
XGlyphInfo ext;
FcChar8 *str;
char *name = argv[1];
size_t len = strlen(argv[2]) + 1;
str = (FcChar8*) malloc(len * sizeof(FcChar8));
strncpy((char*)str, argv[2], len);
dpy = XOpenDisplay(NULL);
fn = XftFontOpenName(dpy, 0, name);
if (fn == NULL) {
printf("Font not found.\n");
return 1;
}
XftTextExtents8(dpy, fn, str, (int)len, &ext);
printf("%d\n", ext.width);
XCloseDisplay(dpy);
free((void*)str);
return 0;
}
| #include <X11/Xft/Xft.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
if (argc < 3) {
printf("xftwidth font string\n");
return 1;
}
Display *dpy;
XftFont *fn;
XGlyphInfo ext;
FcChar8 *str;
char *name = argv[1];
size_t len = strlen(argv[2]);
str = (FcChar8*) malloc(len * sizeof(FcChar8));
strncpy((char*)str, argv[2], len);
dpy = XOpenDisplay(NULL);
fn = XftFontOpenName(dpy, 0, name);
if (fn == NULL) {
printf("Font not found.\n");
return 1;
}
XftTextExtents8(dpy, fn, str, (int)len, &ext);
printf("%d\n", ext.width);
XCloseDisplay(dpy);
free((void*)str);
return 0;
}
| Fix wrong result caused by newline character. | Fix wrong result caused by newline character.
| C | mit | vixus0/xftwidth |
071d3ba3b99c9bd61b31eb08f7778afd094bd779 | searchsummary/src/vespa/searchsummary/docsummary/slime_filler_filter.h | searchsummary/src/vespa/searchsummary/docsummary/slime_filler_filter.h | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_map.h>
#include <optional>
namespace search::docsummary {
/*
* Class filtering which fields to render in a struct field.
*/
class SlimeFillerFilter {
vespalib::hash_map<vespalib::string, std::unique_ptr<SlimeFillerFilter>> _filter;
std::optional<const SlimeFillerFilter*> get_filter(vespalib::stringref field_name) const;
public:
SlimeFillerFilter();
~SlimeFillerFilter();
static std::optional<const SlimeFillerFilter*> get_filter(const SlimeFillerFilter*, vespalib::stringref field_name);
bool empty() const;
SlimeFillerFilter& add(vespalib::stringref field_path);
};
}
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_map.h>
#include <optional>
namespace search::docsummary {
/*
* Class filtering which fields to render in a struct field.
*/
class SlimeFillerFilter {
vespalib::hash_map<vespalib::string, std::unique_ptr<SlimeFillerFilter>> _filter;
std::optional<const SlimeFillerFilter*> get_filter(vespalib::stringref field_name) const;
public:
SlimeFillerFilter();
~SlimeFillerFilter();
/*
* If field is blocked by the filter then the return value is not set,
* otherwise it is set to the filter for the next level.
*/
static std::optional<const SlimeFillerFilter*> get_filter(const SlimeFillerFilter* filter, vespalib::stringref field_name);
bool empty() const;
SlimeFillerFilter& add(vespalib::stringref field_path);
};
}
| Add comment describing semantics of return value from SlimeFillerFilter::get_filter(). | Add comment describing semantics of return value from
SlimeFillerFilter::get_filter().
| C | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa |
3129fa53af679c2f869d0799c42bc8cf41465fda | common/spherical_coordinates.h | common/spherical_coordinates.h | #ifndef LAGER_COMMON_SPHERICAL_COORDINATES_H
#define LAGER_COMMON_SPHERICAL_COORDINATES_H
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
struct SphericalCoordinates {
int phi;
int theta;
bool operator==(const SphericalCoordinates &other) const
{
return (phi == other.phi && theta == other.theta);
}
};
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
namespace std {
template<>
struct hash<SphericalCoordinates>
{
std::size_t operator()(const SphericalCoordinates& k) const
{
// Compute individual hash values for mPhi and mTheta
// and combine them using XOR and bit shifting:
return ((hash<int>()(k.phi) ^ (hash<int>()(k.theta) << 1)));
}
};
}
double DegreesToRadians(double degrees)
{
return (degrees/180 * M_PI);
}
#endif /* LAGER_COMMON_SPHERICAL_COORDINATES_H */
| #ifndef LAGER_COMMON_SPHERICAL_COORDINATES_H
#define LAGER_COMMON_SPHERICAL_COORDINATES_H
#include <math.h>
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
struct SphericalCoordinates {
int phi;
int theta;
bool operator==(const SphericalCoordinates &other) const
{
return (phi == other.phi && theta == other.theta);
}
};
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
namespace std {
template<>
struct hash<SphericalCoordinates>
{
std::size_t operator()(const SphericalCoordinates& k) const
{
// Compute individual hash values for mPhi and mTheta
// and combine them using XOR and bit shifting:
return ((hash<int>()(k.phi) ^ (hash<int>()(k.theta) << 1)));
}
};
}
double DegreesToRadians(double degrees)
{
return (degrees/180 * M_PI);
}
#endif /* LAGER_COMMON_SPHERICAL_COORDINATES_H */
| Add missing math.h include for M_PHI definition | Common: Add missing math.h include for M_PHI definition
| C | mit | andresodio/lager,andresodio/lager,andresodio/lager,andresodio/lager |
5a9f64253ca71c0923304c033d121d5f27dd69ad | document/src/vespa/document/serialization/annotationdeserializer.h | document/src/vespa/document/serialization/annotationdeserializer.h | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/document/annotation/span.h>
#include <vespa/document/serialization/util.h>
namespace vespalib {
class nbostream;
}
namespace document {
class AlternateSpanList;
class Annotation;
class FixedTypeRepo;
class SpanList;
class SpanTree;
class SimpleSpanList;
class AnnotationDeserializer {
public:
AnnotationDeserializer(const FixedTypeRepo &repo, vespalib::nbostream &stream, uint16_t version);
std::unique_ptr<SpanTree> readSpanTree();
std::unique_ptr<SpanNode> readSpanNode();
// returns 0 if the annotation type is unknown.
std::unique_ptr<AlternateSpanList> readAlternateSpanList();
void readAnnotation(Annotation & annotation);
private:
std::unique_ptr<SpanList> readSpanList();
std::unique_ptr<SimpleSpanList> readSimpleSpanList();
void readSpan(Span & span) {
span.from(getInt1_2_4Bytes(_stream));
span.length(getInt1_2_4Bytes(_stream));
}
const FixedTypeRepo &_repo;
vespalib::nbostream &_stream;
uint16_t _version;
std::vector<SpanNode *> _nodes;
};
} // namespace document
| // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/document/annotation/span.h>
#include <vespa/document/serialization/util.h>
#include <vector>
namespace vespalib {
class nbostream;
}
namespace document {
class AlternateSpanList;
class Annotation;
class FixedTypeRepo;
class SpanList;
class SpanTree;
class SimpleSpanList;
class AnnotationDeserializer {
public:
AnnotationDeserializer(const FixedTypeRepo &repo, vespalib::nbostream &stream, uint16_t version);
std::unique_ptr<SpanTree> readSpanTree();
std::unique_ptr<SpanNode> readSpanNode();
// returns 0 if the annotation type is unknown.
std::unique_ptr<AlternateSpanList> readAlternateSpanList();
void readAnnotation(Annotation & annotation);
private:
std::unique_ptr<SpanList> readSpanList();
std::unique_ptr<SimpleSpanList> readSimpleSpanList();
void readSpan(Span & span) {
span.from(getInt1_2_4Bytes(_stream));
span.length(getInt1_2_4Bytes(_stream));
}
const FixedTypeRepo &_repo;
vespalib::nbostream &_stream;
uint16_t _version;
std::vector<SpanNode *> _nodes;
};
} // namespace document
| Include what you need as gcc 6 provides less. | Include what you need as gcc 6 provides less.
| C | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa |
35fac131d1331779d31a9de6d40b3ba1d8a4d5b9 | include/shmlog_tags.h | include/shmlog_tags.h | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d, e, f, g) SLTM(b)
#include "http_headers.h"
#undef HTTPH
| /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d, e, f, g) SLTM(b)
#include "http_headers.h"
#undef HTTPH
| Add a Debug shmemlog tag. | Add a Debug shmemlog tag.
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@104 d4fa192b-c00b-0410-8231-f00ffab90ce4
| C | bsd-2-clause | chrismoulton/Varnish-Cache,feld/Varnish-Cache,ambernetas/varnish-cache,drwilco/varnish-cache-drwilco,franciscovg/Varnish-Cache,drwilco/varnish-cache-old,ajasty-cavium/Varnish-Cache,varnish/Varnish-Cache,1HLtd/Varnish-Cache,ajasty-cavium/Varnish-Cache,drwilco/varnish-cache-old,franciscovg/Varnish-Cache,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,drwilco/varnish-cache-old,ssm/pkg-varnish,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,feld/Varnish-Cache,zhoualbeart/Varnish-Cache,alarky/varnish-cache-doc-ja,alarky/varnish-cache-doc-ja,varnish/Varnish-Cache,ajasty-cavium/Varnish-Cache,gauthier-delacroix/Varnish-Cache,ajasty-cavium/Varnish-Cache,gquintard/Varnish-Cache,varnish/Varnish-Cache,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,gquintard/Varnish-Cache,zhoualbeart/Varnish-Cache,wikimedia/operations-debs-varnish,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,feld/Varnish-Cache,1HLtd/Varnish-Cache,mrhmouse/Varnish-Cache,gauthier-delacroix/Varnish-Cache,ambernetas/varnish-cache,varnish/Varnish-Cache,drwilco/varnish-cache-drwilco,chrismoulton/Varnish-Cache,mrhmouse/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,ajasty-cavium/Varnish-Cache,ambernetas/varnish-cache,franciscovg/Varnish-Cache,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,wikimedia/operations-debs-varnish,chrismoulton/Varnish-Cache,ssm/pkg-varnish,zhoualbeart/Varnish-Cache,alarky/varnish-cache-doc-ja,alarky/varnish-cache-doc-ja,mrhmouse/Varnish-Cache,ssm/pkg-varnish,chrismoulton/Varnish-Cache,franciscovg/Varnish-Cache,drwilco/varnish-cache-drwilco,varnish/Varnish-Cache,wikimedia/operations-debs-varnish,alarky/varnish-cache-doc-ja,1HLtd/Varnish-Cache,ssm/pkg-varnish,feld/Varnish-Cache,gquintard/Varnish-Cache,zhoualbeart/Varnish-Cache,ssm/pkg-varnish,chrismoulton/Varnish-Cache |
f7499f65a6149495f5750a1aade611d7ce44d9e9 | src/common.h | src/common.h | #ifndef __COMMON_H__
#define __COMMON_H__
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif
#endif
| #ifndef __COMMON_H__
#define __COMMON_H__
#ifdef NODE_VERSION_AT_LEAST
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif
#endif
#endif
| Fix build under node.js 0.10.0 | Fix build under node.js 0.10.0
| C | lgpl-2.1 | zenozeng/yapcduino.js,zenozeng/yapcduino.js,zenozeng/yapcduino.js,zenozeng/yapcduino.js,zenozeng/yapcduino.js |
5b146eb8735ca22eb8182a58c14381996ebaf173 | src/safequeue.h | src/safequeue.h | // Copyright (c) 2017 Shift Devices AG
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef LIBDBB_SAFEQUEUE_H
#define LIBDBB_SAFEQUEUE_H
#include <stdint.h>
#include <stdlib.h>
#include <atomic>
#include <queue>
#include <mutex>
#include <condition_variable>
// A threadsafe-queue.
template <class T>
class SafeQueue
{
public:
SafeQueue(void)
: q()
, m()
, c()
{}
~SafeQueue(void)
{}
// Add an element to the queue.
size_t size()
{
std::lock_guard<std::mutex> lock(m);
return q.size();
}
// Add an element to the queue.
void enqueue(T t)
{
std::lock_guard<std::mutex> lock(m);
q.push(t);
c.notify_one();
}
// Get the "front"-element.
// If the queue is empty, wait till a element is avaiable.
T dequeue(void)
{
std::unique_lock<std::mutex> lock(m);
while(q.empty())
{
// release lock as long as the wait and reaquire it afterwards.
c.wait(lock);
}
T val = q.front();
q.pop();
return val;
}
private:
std::queue<T> q;
mutable std::mutex m;
std::condition_variable c;
};
#endif // LIBDBB_SAFEQUEUE_H
| Add thread safe queue class | Add thread safe queue class
| C | mit | digitalbitbox/libdbb,digitalbitbox/libdbb,digitalbitbox/libdbb |
|
47f47c7d5a7c9bf8d222a1b6ecb62ebaa28617fc | MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h | MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern NSString * const kMagicalRecordImportUnixTimeString;
extern NSString * const kMagicalRecordImportAttributeKeyMapKey;
extern NSString * const kMagicalRecordImportAttributeValueClassNameKey;
extern NSString * const kMagicalRecordImportRelationshipMapKey;
extern NSString * const kMagicalRecordImportRelationshipLinkedByKey;
extern NSString * const kMagicalRecordImportRelationshipTypeKey;
@interface NSManagedObject (MagicalRecord_DataImport)
- (BOOL) MR_importValuesForKeysWithObject:(id)objectData;
+ (instancetype) MR_importFromObject:(id)data;
+ (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context;
@end
@interface NSManagedObject (MagicalRecord_DataImportControls)
- (BOOL) shouldImport:(id)data;
- (void) willImport:(id)data;
- (void) didImport:(id)data;
@end
| //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern NSString * const kMagicalRecordImportUnixTimeString;
extern NSString * const kMagicalRecordImportAttributeKeyMapKey;
extern NSString * const kMagicalRecordImportAttributeValueClassNameKey;
extern NSString * const kMagicalRecordImportRelationshipMapKey;
extern NSString * const kMagicalRecordImportRelationshipLinkedByKey;
extern NSString * const kMagicalRecordImportRelationshipTypeKey;
@interface NSManagedObject (MagicalRecord_DataImport)
+ (instancetype) MR_importFromObject:(id)data;
+ (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context;
@end
@interface NSManagedObject (MagicalRecord_DataImportControls)
- (BOOL) shouldImport:(id)data;
- (void) willImport:(id)data;
- (void) didImport:(id)data;
@end
| Remove unnecessarily public method from interface | Remove unnecessarily public method from interface
| C | mit | lifcio/MagicalRecord,akaking/MagicalRecord,csotiriou/MagicalRecord,donvaughn/MagicalRecord,BlessNeo/MagicalRecord,tmacyml/MagicalRecord,sujeking/MagicalRecord,zyncro/MagicalRecord,libiao88/MagicalRecord,lintaoSuper/MagicalRecord,zezefamily/MagicalRecord,kidaa/MagicalRecord,donvaughn/MagicalRecord,yanyuqingshi/MagicalRecord,orta/MagicalRecord,kingloveyy/MagicalRecord,wongzigii/MagicalRecord,qingsong-xu/MagicalRecord,Gaantz/MagicalRecord,csotiriou/MagicalRecord,cnbin/MagicalRecord,TheGiantPixelCorporation/MagicalRecord,iosRookie/MagicalRecord,AnthonyMDev/MagicalRecord,AnthonyMDev/MagicalRecord,AlanJN/MagicalRecord,msdgwzhy6/MagicalRecord,zezefamily/MagicalRecord,megawina/MagicalRecord,simoncoulton/MagicalRecord,mmmilo/MagicalRecord,tranhoanganh/MagicalRecord,csotiriou/MagicalRecord,hsoi/MagicalRecord,tmacyml/MagicalRecord,ziyabal/MagicalRecord,akaking/MagicalRecord,zhouwude/MagicalRecord,iosdevvivek/MagicalRecord,z514306470/MagicalRecord,Vincent8ziv/MagicalRecord,mmmilo/MagicalRecord,PeterStudio/MagicalRecord,ruikong/MagicalRecord,diejmon/MagicalRecord,ondev/MagicalRecord,iosdevvivek/MagicalRecord,lifcio/MagicalRecord,avielg/MagicalRecord,TheGiantPixelCorporation/MagicalRecord,pronebird/MagicalRecord,spex-app/MagicalRecord,z514306470/MagicalRecord,tranhoanganh/MagicalRecord,Gaantz/MagicalRecord,xb123456456/MagicalRecord,fhchina/MagicalRecord,justinjing/MagicalRecord,ChinaPicture/MagicalRecord,pengleelove/MagicalRecord,sburavtsov/MagicalRecord,wongzigii/MagicalRecord,hanangellove/MagicalRecord,fhchina/MagicalRecord,caoer/MagicalRecord,ondev/MagicalRecord,hanangellove/MagicalRecord,cnbin/MagicalRecord,hsoi/MagicalRecord,igroomgrim/MagicalRecord,zhouwude/MagicalRecord,12207480/MagicalRecord,msdgwzhy6/MagicalRecord,qingsong-xu/MagicalRecord,justinjing/MagicalRecord,ChinaPicture/MagicalRecord,lintaoSuper/MagicalRecord,PeterStudio/MagicalRecord,happy201993/MagicalRecord,xxkkk/MagicalRecord,orta/MagicalRecord,sburavtsov/MagicalRecord,zhaoguohui/MagicalRecord,avielg/MagicalRecord,yanyuqingshi/MagicalRecord,liufeigit/MagicalRecord,xb123456456/MagicalRecord,ruikong/MagicalRecord,pengleelove/MagicalRecord,AnthonyMDev/MagicalRecord,zhaoguohui/MagicalRecord,12207480/MagicalRecord,pronebird/MagicalRecord,jiamaozheng/MagicalRecord,yiplee/MagicalRecord,liufeigit/MagicalRecord,iosRookie/MagicalRecord,Vincent8ziv/MagicalRecord,lintaoSuper/MagicalRecord,caoer/MagicalRecord,AlanJN/MagicalRecord,vascoorey/MagicalRecord,sujeking/MagicalRecord,happy201993/MagicalRecord,yiplee/MagicalRecord,diejmon/MagicalRecord,ziyabal/MagicalRecord,diejmon/MagicalRecord,igroomgrim/MagicalRecord,igroomgrim/MagicalRecord,kidaa/MagicalRecord,AmitaiB/MagicalRecord,xxkkk/MagicalRecord,AmitaiB/MagicalRecord,libiao88/MagicalRecord,spex-app/MagicalRecord,kingloveyy/MagicalRecord,BlessNeo/MagicalRecord,orta/MagicalRecord,hsoi/MagicalRecord,zyncro/MagicalRecord,simoncoulton/MagicalRecord,spex-app/MagicalRecord,vascoorey/MagicalRecord,jiamaozheng/MagicalRecord,megawina/MagicalRecord |
dcc7db1fa3167c6dca1fef18dd38b820952faa49 | CoreFoundation/Base.subproj/CFAsmMacros.h | CoreFoundation/Base.subproj/CFAsmMacros.h | // 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
//
#if !defined(__COREFOUNDATION_CFASMMACROS__)
#define __COREFOUNDATION_CFASMMACROS__ 1
#define CONCAT(a,b) a##b
#define CONCAT_EXPANDED(a,b) CONCAT(a,b)
#define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name)
#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__)
#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
#else
#define NO_EXEC_STACK_DIRECTIVE
#endif
#endif
| // 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
//
#if !defined(__COREFOUNDATION_CFASMMACROS__)
#define __COREFOUNDATION_CFASMMACROS__ 1
#define CONCAT(a,b) a##b
#define CONCAT_EXPANDED(a,b) CONCAT(a,b)
#define _C_LABEL(name) CONCAT_EXPANDED(__USER_LABEL_PREFIX__,name)
#if defined(__GNU__) || defined(__GNUC__) || defined(__ANDROID__) || defined(__FreeBSD__)
#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
#else
#define NO_EXEC_STACK_DIRECTIVE
#endif
#endif
| Fix libFoundation.so being flagged as requiring executable stack | Fix libFoundation.so being flagged as requiring executable stack
libFoundation.so is flagged as requiring an executable stack on Linux, although it does not. This is due to GNU as behavior.
Please see discussion at https://bugs.swift.org/browse/SR-2700?jql=text%20~%20%22executable%20stack%22
This was already intended to be solved by https://github.com/apple/swift-corelibs-foundation/pull/649/, but did not work as intended in Ubuntu. Checking for __GNUC__ in addition resolves the issue.
| C | apache-2.0 | ikesyo/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,parkera/swift-corelibs-foundation,alblue/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,apple/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,e78l/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,johnno1962b/swift-corelibs-foundation,alblue/swift-corelibs-foundation,alblue/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,amraboelela/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,apple/swift-corelibs-foundation,ikesyo/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,e78l/swift-corelibs-foundation,parkera/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,apple/swift-corelibs-foundation,alblue/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,e78l/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,e78l/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,mattrajca/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,alblue/swift-corelibs-foundation,e78l/swift-corelibs-foundation,parkera/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,JGiola/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,parkera/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,parkera/swift-corelibs-foundation,bolshedvorsky/swift-corelibs-foundation,johnno1962e/swift-corelibs-foundation,amosavian/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation,mohitathwani/swift-corelibs-foundation,johnno1962c/swift-corelibs-foundation |
c3eea81ded78e7803b42f09697bc202e1b1aaf86 | sbr/read_line.c | sbr/read_line.c | #include <h/mh.h>
const char *
read_line(void)
{
char *cp;
static char line[BUFSIZ];
fflush(stdout);
if (fgets(line, sizeof(line), stdin) == NULL)
return NULL;
if ((cp = strchr(line, '\n')))
*cp = 0;
return line;
}
| #include <h/mh.h>
#include <h/utils.h>
const char *
read_line(void)
{
static char line[BUFSIZ];
fflush(stdout);
if (fgets(line, sizeof(line), stdin) == NULL)
return NULL;
TrimSuffixC(line, '\n');
return line; /* May not be a complete line. */
}
| Replace strchr() condition with TrimSuffixC(). | Replace strchr() condition with TrimSuffixC().
| C | bsd-3-clause | mcr/nmh,mcr/nmh |
dad599a4b721780c6b11122bf88c39bdda5c9eed | include/tiramisu/MainPage.h | include/tiramisu/MainPage.h | /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Tiramisu Optimization Framework
* Tiramisu is a library that is designed to simplify code optimization and code generation. The user can express his code in the Tiramisu intermediate representation (Tiramisu IR), he can use the Tiramisu API to perform different optimizations and finaly he can generate an LLVM code from the optimized Tiramisu IR.
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: a function is composed of multiple computations and a vector of arguments (functions arguments).
* - The \ref tiramisu::computation class: a computation is composed of an expression and an iteration space but is not associated with any memory location.
* - The \ref tiramisu::buffer class: a class to represent memory buffers.
*
* \example tutorials/tutorial_01.cpp
* \example tutorials/tutorial_02.cpp
* \example tutorials/tutorial_03.cpp
* \example tutorials/tutorial_04.cpp
* \example tutorials/tutorial_05.cpp
* \example tutorials/tutorial_06.cpp
*/
| /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Documentation of the API if the Tiramisu Compiler
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C.
* - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar.
* - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function.
* - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain.
* - The \ref tiramisu::buffer class: a class to represent memory buffers.
*
*/
| Fix the documentation main page | Fix the documentation main page
| C | mit | rbaghdadi/ISIR,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/COLi,rbaghdadi/ISIR,rbaghdadi/tiramisu,rbaghdadi/COLi |
37dd8f83def8e85cdf1b71528832980021078d86 | compat/linux/sys/user.h | compat/linux/sys/user.h | // Copyright 2018 The Crashpad 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 CRASHPAD_COMPAT_LINUX_SYS_USER_H_
#define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
#include_next <sys/user.h>
#include <features.h>
// glibc for 64-bit ARM uses different names for these structs prior to 2.20.
#if defined(__aarch64__) && defined(__GLIBC__)
#if !__GLIBC_PREREQ(2, 20)
using user_regs_struct = user_pt_regs;
using user_fpsimd_struct = user_fpsimd_state;
#endif
#endif
#endif // CRASHPAD_COMPAT_LINUX_SYS_USER_H_
| // Copyright 2018 The Crashpad 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 CRASHPAD_COMPAT_LINUX_SYS_USER_H_
#define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
#include_next <sys/user.h>
#include <features.h>
// glibc for 64-bit ARM uses different names for these structs prior to 2.20.
// However, Debian's glibc 2.19-8 backported the change so it's not sufficient
// to only test the version. user_pt_regs and user_fpsimd_state are actually
// defined in <asm/ptrace.h> so we use the include guard here.
#if defined(__aarch64__) && defined(__GLIBC__)
#if !__GLIBC_PREREQ(2, 20) && defined(__ASM_PTRACE_H)
using user_regs_struct = user_pt_regs;
using user_fpsimd_struct = user_fpsimd_state;
#endif
#endif
#endif // CRASHPAD_COMPAT_LINUX_SYS_USER_H_
| Fix compilation issue on arm64 with Debian's glibc 2.19 | Fix compilation issue on arm64 with Debian's glibc 2.19
Fuchsia's glibc is derived from Debian so it's causing issues on
Fuchsia.
Change-Id: I46368eb08f7cc7338783f115869e5c761f35e465
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2630288
Reviewed-by: Joshua Peraza <[email protected]>
Commit-Queue: Joshua Peraza <[email protected]>
| C | apache-2.0 | chromium/crashpad,chromium/crashpad,chromium/crashpad |
e6a2cdb5e6ab64d929c96981f5ef3b53c8f9c49a | test/struct-init-swap.c | test/struct-init-swap.c | /* From Listing 3 in "Test-Case Reduction for C Compiler Bugs" paper, avaiable
* at http://www.cs.utah.edu/~regehr/papers/pldi12-preprint.pdf.
*/
int printf (const char *, ...);
struct {
int f0;
int f1;
int f2;
} a, b = { 0, 0, 1 };
void fn1 () {
a = b;
a = a;
}
int main () {
fn1 ();
printf ("%d\n", a.f2);
return 0;
}
| Add test case on struct initialization and assignment | Add test case on struct initialization and assignment
| C | mit | larmel/lacc,larmel/c-compiler,larmel/lacc,larmel/c-compiler,larmel/c-compiler |
|
699f3c15e0d84c2005741464cbb988b354b4da54 | ir-debug-robotc.c | ir-debug-robotc.c | #pragma config(Sensor, S1, ir, sensorHiTechnicIRSeeker600)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() {
while (true) {
nxtDisplayTextLine(0, "S:%d", SensorValue[ir]);
nxtDisplayTextLine(1, "R:%d", SensorRaw[ir]);
}
}
| Add IR sensor debugging program, using robotc API | Add IR sensor debugging program, using robotc API
| C | mit | patrickmess/ftc-2013,patrickmess/ftc-2013 |
|
0bcab9dae52e680b345f83228a83370f370fc929 | c_src/kinit.c | c_src/kinit.c | #include <erl_nif.h>
static ERL_NIF_TERM kinit(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
return enif_make_atom(env, "true");
}
static ErlNifFunc nif_funcs[] = {
{"kinit", 2, kinit}
};
ERL_NIF_INIT(kinit, nif_funcs, NULL, NULL, NULL, NULL)
| #include <erl_nif.h>
static ERL_NIF_TERM kinit(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {
return enif_make_atom(env, "true");
}
int noop(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info) {
return 0;
}
static ErlNifFunc nif_funcs[] = {
{"kinit", 2, kinit}
};
ERL_NIF_INIT(kinit, nif_funcs, NULL, NULL, noop, NULL)
| Add a noop for upgrade so we don't get the warning. | Add a noop for upgrade so we don't get the warning.
| C | bsd-3-clause | simmel/rabbitmq-auth-backend-kerberos |
41e9e0c4988a92ba3cba90959622ae8673f7c1f7 | src/rtcmix/io.c | src/rtcmix/io.c | #include <stdio.h>
extern int print_is_on;
double m_open(float *, short, double *);
double
m_input(float *p,short n_args,double *pp)
{
p[1] = (n_args > 1) ? p[1] : 0.;
p[2] = 0;
n_args = 3;
if(print_is_on)
fprintf(stderr,"Opening input file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
double
m_output(float *p,short n_args,double *pp)
{
int i;
p[1] = (n_args > 1) ? p[1] : 1.;
p[2] = 2;
n_args = 3;
i = p[0];
if(print_is_on)
fprintf(stderr,"Opening output file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
| #include <globals.h>
#include <stdio.h>
extern double m_open(float *, short, double *);
double
m_input(float *p,short n_args,double *pp)
{
p[1] = (n_args > 1) ? p[1] : 0.;
p[2] = 0;
n_args = 3;
if(print_is_on)
fprintf(stderr,"Opening input file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
double
m_output(float *p,short n_args,double *pp)
{
int i;
p[1] = (n_args > 1) ? p[1] : 1.;
p[2] = 2;
n_args = 3;
i = p[0];
if(print_is_on)
fprintf(stderr,"Opening output file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
| Move some globals to globals.h. | Move some globals to globals.h.
| C | apache-2.0 | RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix |
198b1ef1cc1c23cb15f3cc880b93b9ca2d3fd232 | src/shared.c | src/shared.c | #include <openssl/conf.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <string.h>
#include "shared.h"
int base64_decode
(char *src, bytes *dest)
{
BIO *bio, *b64;
unsigned int max_len = strlen(src) * 0.75;
dest->data = malloc(max_len);
if (dest->data == NULL) return -1;
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_mem_buf(src, -1);
bio = BIO_push(b64, bio);
dest->length = (int)BIO_read(bio, dest->data, max_len);
BIO_free_all(bio);
return 0;
}
int base64_encode
(char *src, int src_len, char **dest)
{
return -1;
}
| #include <openssl/conf.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <string.h>
#include <stdio.h>
#include "shared.h"
int base64_decode
(char *src, bytes *dest)
{
BIO *bio, *b64;
unsigned int max_len = strlen(src) * 3 / 4;
dest->data = malloc(max_len);
if (dest->data == NULL) return -1;
FILE* stream = fmemopen(src, strlen(src), "r");
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_fp(stream, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
dest->length = BIO_read(bio, dest->data, max_len);
BIO_free_all(bio);
return 0;
}
int base64_encode
(char *src, int src_len, char **dest)
{
return -1;
}
| Fix overflow bug in OpenSSL | Fix overflow bug in OpenSSL
| C | bsd-3-clause | undesktop/libopkeychain |
175c55b147b047c632edba546e15441207febf83 | tests/recordinit.c | tests/recordinit.c | typedef struct list {
struct list *next;
struct list *prev;
} list_t;
typedef struct record {
int data1;
list_t node;
int data2;
} record_t;
#define container(p) ((record_t*)((int*)(p) - 1))
void init_record(list_t *p) {
record_t *r = container(p);
r->data2 = 42;
}
void init_all_records(list_t *p) {
while (p != NULL) {
init_record(p);
p = p->next;
}
}
| Add Qadeer record init example | Add Qadeer record init example
| C | bsd-3-clause | ucsd-progsys/csolve,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak,ucsd-progsys/csolve-bak |
|
27ebeb2662d52baeab1afd0e1b61fefa18eb40c3 | src/flags.c | src/flags.c | #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
const char* version = laco_get_laco_version(laco);
printf("laco version %s\n", version);
laco_kill(laco, 0, NULL);
}
/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
puts("A better REPL for Lua.\n");
puts("Usage: laco [options]\n");
puts("-h | -? | --help \tPrint this help screen");
puts("-v | --version \tPrint current version");
laco_kill(laco, 0, NULL);
}
static const struct LacoCommand flag_commands[] = {
{ version_matches, handle_version },
{ help_matches, handle_help },
{ NULL, NULL}
};
/* External API */
void laco_handle_flag(LacoState* laco) {
const char* command = laco_get_laco_args(laco)[1];
laco_dispatch(flag_commands, laco, command, NULL);
}
| #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
const char* version = laco_get_laco_version(laco);
printf("laco version %s\n", version);
laco_kill(laco, 0, NULL);
}
/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
puts("A better REPL for Lua.\n");
puts("Usage: laco [options]\n");
puts("-h | -? | --help \tPrint this help screen");
puts("-v | --version \tPrint current version");
laco_kill(laco, 0, NULL);
}
static const struct LacoCommand flag_commands[] = {
{ version_matches, handle_version },
{ help_matches, handle_help },
{ NULL, NULL }
};
/* External API */
void laco_handle_flag(LacoState* laco) {
const char* command = laco_get_laco_args(laco)[1];
laco_dispatch(flag_commands, laco, command, NULL);
}
| Add a space to the terminating array entry | Add a space to the terminating array entry
| C | bsd-2-clause | sourrust/laco |
793b2d601c9cafff4f4d1284da6fcc39bf1023d2 | common/log.h | common/log.h | /**
* log.h - Header of log class
* includes 2 methods to show warrnings and errors
* @author Pavel Kryukov
* Copyright 2017 MIPT-MIPS team
*/
#ifndef LOG_H
#define LOG_H
#include <iostream>
#include <ostream>
class LogOstream
{
const bool enable;
std::ostream& stream;
public:
struct Critical { };
LogOstream(bool value, std::ostream& _out) : enable(value), stream(_out) { }
friend LogOstream& operator<<(LogOstream&, const Critical&) {
exit(-1);
}
LogOstream& operator<<(std::ostream& (*F)(std::ostream&)) {
if ( enable)
F(stream);
return *this;
}
template<typename T>
LogOstream& operator<<(const T& v) {
if ( enable) {
stream << v;
}
return *this;
}
};
class Log
{
public:
LogOstream sout;
LogOstream serr;
LogOstream::Critical critical;
Log(bool value) : sout(value, std::cout), serr(true, std::cerr), critical() { }
virtual ~Log() { }
};
#endif /* LOG_H */
| /**
* log.h - Header of log class
* includes 2 methods to show warrnings and errors
* @author Pavel Kryukov
* Copyright 2017 MIPT-MIPS team
*/
#ifndef LOG_H
#define LOG_H
#include <iostream>
#include <ostream>
class LogOstream
{
const bool enable;
std::ostream& stream;
public:
struct Critical { };
LogOstream(bool value, std::ostream& _out) : enable(value), stream(_out) { }
friend LogOstream& operator<<(LogOstream&, const Critical&) {
exit(-1);
}
LogOstream& operator<<(std::ostream& (*F)(std::ostream&)) {
if ( enable)
F(stream);
return *this;
}
template<typename T>
LogOstream& operator<<(const T& v) {
if ( enable) {
stream << v;
}
return *this;
}
};
class Log
{
public:
mutable LogOstream sout;
mutable LogOstream serr;
const LogOstream::Critical critical;
Log(bool value) : sout(value, std::cout), serr(true, std::cerr), critical() { }
virtual ~Log() { }
};
#endif /* LOG_H */
| Make serr and sout mutable to use them in const methods | Make serr and sout mutable to use them in const methods
| C | mit | MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015,gkorepanov/mipt-mips,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015 |
370602bb15aaa83d5a976ea255883a8c9d0b9152 | EXAMPLE_CODE/hw.c | EXAMPLE_CODE/hw.c | /*******************************************************************************
* File : hw.c
* Author : Sandeep Koranne
*
* Purpose : Hello, World in C
*
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello, World!\n");
return ( EXIT_SUCCESS );
}
| Add hello world C example | Add hello world C example
| C | cc0-1.0 | skoranne/CST223,skoranne/CST223,skoranne/CST223 |
|
8da70953568e44c46d7aebeea3147c029135a824 | MRHexKeyboard.h | MRHexKeyboard.h | //
// MRHexKeyboard.h
//
// Created by Mikk Rätsep on 02/10/13.
// Copyright (c) 2013 Mikk Rätsep. All rights reserved.
//
@import UIKit;
@interface MRHexKeyboard : UIView <UITextFieldDelegate>
@property(nonatomic, assign) CGFloat height;
@property(nonatomic, assign) BOOL display0xButton;
@property(nonatomic, assign) BOOL add0x;
@end
| //
// MRHexKeyboard.h
//
// Created by Mikk Rätsep on 02/10/13.
// Copyright (c) 2013 Mikk Rätsep. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MRHexKeyboard : UIView <UITextFieldDelegate>
@property(nonatomic, assign) CGFloat height;
@property(nonatomic, assign) BOOL display0xButton;
@property(nonatomic, assign) BOOL add0x;
@end
| Switch to importing framework header | Switch to importing framework header
Some Apps may not use modules
| C | mit | doofyus/HexKeyboard |
0163470450726394efaf11570daade9f34eb2f6e | util/util_export.h | util/util_export.h | //
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols.
#ifndef UTIL_EXPORT_H_
#define UTIL_EXPORT_H_
#if !defined(ANGLE_UTIL_EXPORT)
# if defined(_WIN32)
# if defined(LIBANGLE_UTIL_IMPLEMENTATION)
# define ANGLE_UTIL_EXPORT __declspec(dllexport)
# else
# define ANGLE_UTIL_EXPORT __declspec(dllimport)
# endif
# elif defined(__GNUC__)
# define ANGLE_UTIL_EXPORT __attribute__((visibility("default")))
# else
# define ANGLE_UTIL_EXPORT
# endif
#endif // !defined(ANGLE_UTIL_EXPORT)
#endif // UTIL_EXPORT_H_
| //
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols.
#ifndef UTIL_EXPORT_H_
#define UTIL_EXPORT_H_
#if !defined(ANGLE_UTIL_EXPORT)
# if defined(_WIN32)
# if defined(LIBANGLE_UTIL_IMPLEMENTATION)
# define ANGLE_UTIL_EXPORT __declspec(dllexport)
# else
# define ANGLE_UTIL_EXPORT __declspec(dllimport)
# endif
# elif defined(__GNUC__)
# if defined(LIBANGLE_UTIL_IMPLEMENTATION)
# define ANGLE_UTIL_EXPORT __attribute__((visibility("default")))
# else
# define ANGLE_UTIL_EXPORT
# endif
# else
# define ANGLE_UTIL_EXPORT
# endif
#endif // !defined(ANGLE_UTIL_EXPORT)
#endif // UTIL_EXPORT_H_
| Revert "util: Always specify default visibility on exports." | Revert "util: Always specify default visibility on exports."
This reverts commit 2bf23ea84e4f071c18f01b94748f3be7dccc4019.
Reason for revert: Probably not the right fix. Will export
all angle_utils symbols in places where they shouldn't be.
Original change's description:
> util: Always specify default visibility on exports.
>
> This fixes undefined behaviour with CFI.
>
> Bug: chromium:1015810
> Bug: angleproject:3162
> Change-Id: I58cfb78adabbff05e5b4560dfd70b190411fa26d
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869303
> Reviewed-by: Jamie Madill <[email protected]>
> Commit-Queue: Jamie Madill <[email protected]>
[email protected],[email protected]
Change-Id: Ie847a9e6506178eb2b14e63a1ee5e9a1775b4548
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1015810, angleproject:3162
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869546
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
| C | bsd-3-clause | ppy/angle,ppy/angle,ppy/angle,ppy/angle |
40489836d8c58602f60a2f2fa7b564754d41d7ae | include/psp2/avconfig.h | include/psp2/avconfig.h | /**
* \usergroup{SceAVConfig}
* \usage{psp2/avconfig.h,SceAVConfig_stub}
*/
#ifndef _PSP2_AVCONFIG_H_
#define _PSP2_AVCONFIG_H_
#include <psp2/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/***
* Get the maximum brightness.
*
* @param[out] maxBrightness - Maximum brightness.
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness);
/***
* Set the screen brightness.
*
* @param brightness - Brightness that the screen will be set to (range 21-65536, 0 turns off the screen).
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigSetDisplayBrightness(int brightness);
#ifdef __cplusplus
}
#endif
#endif
| /**
* \usergroup{SceAVConfig}
* \usage{psp2/avconfig.h,SceAVConfig_stub}
*/
#ifndef _PSP2_AVCONFIG_H_
#define _PSP2_AVCONFIG_H_
#include <psp2/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/***
* Get the maximum brightness.
*
* @param[out] maxBrightness - Maximum brightness.
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness);
/***
* Set the screen brightness.
*
* @param brightness - Brightness that the screen will be set to (range 21-65536, 0 turns off the screen).
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigSetDisplayBrightness(int brightness);
/***
* Get the shutter volume.
*
* @param[out] volume - shutter volume.
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigGetShutterVol(int *volume);
/***
* Get the system volume.
*
* @param[out] volume - System volume.
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigGetSystemVol(int *volume);
/***
* Set the system volume.
*
* @param volume - volume that the device will be set to (range 0-30).
*
* @return 0 on success, < 0 on error.
*/
int sceAVConfigSetSystemVol(int volume);
/**
* Turns on mute.
*
* @return 0 on success, < 0 on error.
*
*/
int sceAVConfigMuteOn(void);
#ifdef __cplusplus
}
#endif
#endif
| Add some sceAVConfig volume functions | Add some sceAVConfig volume functions
| C | mit | Rinnegatamante/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,vitasdk/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,vitasdk/vita-headers,Rinnegatamante/vita-headers |
7cca2ec8a54c5bd937eaf08ceb49712f627d1c7a | lib/IRGen/CallingConvention.h | lib/IRGen/CallingConvention.h | //===--- CallingConvention.h - Calling conventions --------------*- 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
//
//===----------------------------------------------------------------------===//
//
// This file declares the interfaces for working with abstract and
// phsyical calling conventions.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IRGEN_CALLINGCONVENTION_H
#define SWIFT_IRGEN_CALLINGCONVENTION_H
#include "llvm/IR/CallingConv.h"
namespace llvm {
class AttributeSet;
class Value;
}
namespace swift {
class ValueDecl;
enum class SILFunctionTypeRepresentation : uint8_t;
namespace irgen {
class IRGenModule;
/// Expand an abstract SIL function type representation into a physical
/// convention.
llvm::CallingConv::ID expandCallingConv(IRGenModule &IGM,
SILFunctionTypeRepresentation convention);
} // end namespace irgen
} // end namespace swift
#endif
| //===--- CallingConvention.h - Calling conventions --------------*- 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
//
//===----------------------------------------------------------------------===//
//
// This file declares the interfaces for working with abstract and
// physical calling conventions.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IRGEN_CALLINGCONVENTION_H
#define SWIFT_IRGEN_CALLINGCONVENTION_H
#include "llvm/IR/CallingConv.h"
namespace llvm {
class AttributeSet;
class Value;
}
namespace swift {
class ValueDecl;
enum class SILFunctionTypeRepresentation : uint8_t;
namespace irgen {
class IRGenModule;
/// Expand an abstract SIL function type representation into a physical
/// convention.
llvm::CallingConv::ID expandCallingConv(IRGenModule &IGM,
SILFunctionTypeRepresentation convention);
} // end namespace irgen
} // end namespace swift
#endif
| Fix typo phsyical => physical | Fix typo phsyical => physical | C | apache-2.0 | khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift,khizkhiz/swift |
562bd95583a33d69e31b1e9bdea8f2076d8df46a | src/swganh/tre/visitors/objects/object_visitor-intl.h | src/swganh/tre/visitors/objects/object_visitor-intl.h | // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
namespace swganh
{
namespace tre
{
template <class T> T ObjectVisitor::attribute(const std::string& key)
{
std::map<std::string, std::shared_ptr<boost::any>>::const_iterator it = attributes_.find(key);
if(it != attributes_.cend())
{
return boost::any_cast<T>(*it->second);
}
throw std::runtime_error("Invalid type requested for attribute");
}
}
}
| // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include<stdexcept>
namespace swganh
{
namespace tre
{
template <class T> T ObjectVisitor::attribute(const std::string& key)
{
std::map<std::string, std::shared_ptr<boost::any>>::const_iterator it = attributes_.find(key);
if(it != attributes_.cend())
{
return boost::any_cast<T>(*it->second);
}
throw std::runtime_error("Invalid type requested for attribute");
}
}
}
| Fix for missing include that vs studio forgot to complain about | Fix for missing include that vs studio forgot to complain about
| C | mit | anhstudios/swganh,anhstudios/swganh,anhstudios/swganh |
09d4f342619ac11e29128f044e3ab5c802ae7833 | include/parrot/enums.h | include/parrot/enums.h | #if !defined(PARROT_ENUMS_H_GUARD)
#define PARROT_ENUMS_H_GUARD
typedef enum {
NO_STACK_ENTRY_TYPE = 0,
STACK_ENTRY_INT = 1,
STACK_ENTRY_FLOAT = 2,
STACK_ENTRY_STRING = 3,
STACK_ENTRY_PMC = 4,
STACK_ENTRY_POINTER = 5,
STACK_ENTRY_DESTINATION = 6
} Stack_entry_type;
typedef enum {
NO_STACK_ENTRY_FLAGS = 0,
STACK_ENTRY_CLEANUP_FLAG = 1 << 0
} Stack_entry_flags;
typedef enum {
NO_STACK_CHUNK_FLAGS = 0,
STACK_CHUNK_COW_FLAG = 1 << 0
} Stack_chunk_flags;
#endif
| /* enums.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* Overview:
* enums shared by much of the stack-handling code
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_ENUMS_H_GUARD)
#define PARROT_ENUMS_H_GUARD
typedef enum {
NO_STACK_ENTRY_TYPE = 0,
STACK_ENTRY_INT = 1,
STACK_ENTRY_FLOAT = 2,
STACK_ENTRY_STRING = 3,
STACK_ENTRY_PMC = 4,
STACK_ENTRY_POINTER = 5,
STACK_ENTRY_DESTINATION = 6
} Stack_entry_type;
typedef enum {
NO_STACK_ENTRY_FLAGS = 0,
STACK_ENTRY_CLEANUP_FLAG = 1 << 0
} Stack_entry_flags;
typedef enum {
NO_STACK_CHUNK_FLAGS = 0,
STACK_CHUNK_COW_FLAG = 1 << 0
} Stack_chunk_flags;
#endif
/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: expandtab shiftwidth=4:
*/
| Add header and footer comments | Add header and footer comments
git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@3957 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
| C | artistic-2.0 | ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot |
8c1ce215a8dbfb004a0d105d9bae637ed166d5c3 | src/Console.h | src/Console.h | #ifndef CONSOLE_H
#define CONSOLE_H
#include <string>
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
Divider(int interval = 1) {
setInterval(interval);
}
void setInterval(int interval) {
this->interval = interval;
clockCounter = interval - 1;
}
void tick() {
clockCounter++;
if (clockCounter == interval) {
clockCounter = 0;
}
}
bool hasClocked() {
return clockCounter == 0;
}
private:
int interval;
int clockCounter;
};
class Console {
public:
Console() : cpuDivider(3) { }
void boot();
bool loadINesFile(std::string fileName);
uint32_t *getFrameBuffer();
void runForOneFrame();
Cart cart;
Controller controller1;
APU apu;
private:
void tick();
PPU ppu;
CPU cpu;
Divider cpuDivider;
};
#endif
| #ifndef CONSOLE_H
#define CONSOLE_H
#include <string>
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
Divider(int interval = 1) {
setInterval(interval);
}
void setInterval(int interval) {
this->interval = interval;
clockCounter = interval - 1;
}
void tick() {
clockCounter++;
if (clockCounter == interval) {
clockCounter = 0;
}
}
bool hasClocked() {
return clockCounter == 0;
}
private:
int interval;
int clockCounter;
};
class Console {
public:
Console() : cpuDivider(3) { }
void boot();
bool loadINesFile(std::string fileName);
uint32_t *getFrameBuffer();
void runForOneFrame();
Controller controller1;
private:
void tick();
Cart cart;
APU apu;
PPU ppu;
CPU cpu;
Divider cpuDivider;
};
#endif
| Make cart and apu members private | Make cart and apu members private
| C | mit | scottjcrouch/ScootNES,scottjcrouch/ScootNES,scottjcrouch/ScootNES |
44b95f9ebc976a6e5b521de7b6c44e0858b14ebf | tests/test_header.h | tests/test_header.h | #include <stdio.h>
#include <stdlib.h>
#include "../libcpsl.h"
#include <signal.h>
#define RUNTEST(x) ((CurrentTest = #x), x(), printf("Test \"%s\" passed.\n", #x))
static const char *CurrentTest = NULL;
static void SigHandler(const int Signal);
static inline void InitTestUnit(void)
{
CPSL_Configure(malloc, free, realloc);
signal(SIGABRT, SigHandler);
signal(SIGSEGV, SigHandler);
signal(SIGTERM, SigHandler);
signal(SIGILL, SigHandler);
signal(SIGFPE, SigHandler);
signal(SIGQUIT, SigHandler);
signal(SIGBUS, SigHandler);
}
static void SigHandler(const int Signal)
{
fprintf(stderr, "Received signal number %d while running test \"%s()\"\n", Signal, CurrentTest);
exit(1);
}
| #include <stdio.h>
#include <stdlib.h>
#include "../libcpsl.h"
#include <signal.h>
#define RUNTEST(x) ((CurrentTest = #x), x(), printf("Subtest \"%s\" passed.\n", #x))
static const char *CurrentTest = NULL;
static void SigHandler(const int Signal);
static inline void InitTestUnit(void)
{
CPSL_Configure(malloc, free, realloc);
signal(SIGABRT, SigHandler);
signal(SIGSEGV, SigHandler);
signal(SIGTERM, SigHandler);
signal(SIGILL, SigHandler);
signal(SIGFPE, SigHandler);
signal(SIGQUIT, SigHandler);
signal(SIGBUS, SigHandler);
puts("Running test \"" __FILE__ "\"");
}
static void SigHandler(const int Signal)
{
fprintf(stderr, "Received signal number %d while running test \"%s()\"\n", Signal, CurrentTest);
exit(1);
}
| Fix some wording for unit tests. | Fix some wording for unit tests.
| C | unlicense | Subsentient/libcpsl,Subsentient/libcpsl,Subsentient/libcpsl |
187f9787c989c5ed8cf84a7daf010769cc3213c5 | calc.c | calc.c | #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p, int mul_div_flag)
{
int i;
int ans;
ans = atoi(p);
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++;
}
switch (p[i]){
case '+':
return (ans + calc(p + i + 1, 0));
case '-':
return (ans - calc(p + i + 1, 0));
case '*':
ans *= calc(p + i + 1, 1);
if (p[i + 1] == '('){
while (p[i] != ')'){
i++;
}
}
i++;
break;
case '/':
ans /= calc(p + i + 1, 1);
if (p[i + 1] == '('){
while (p[i] != ')'){
i++;
}
}
i++;
break;
case '(':
return (calc(p + i + 1, 0));
case ')':
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
return (ans);
}
| #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p, int mul_div_flag)
{
int i;
int ans;
ans = atoi(p);
if (p[0] != '(' && mul_div_flag == 1){
return (ans);
}
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++;
}
switch (p[i]){
case '+':
return (ans + calc(p + i + 1, 0));
case '-':
return (ans - calc(p + i + 1, 0));
case '*':
ans *= calc(p + i + 1, 1);
if (p[i + 1] == '('){
while (p[i] != ')'){
i++;
}
}
i++;
break;
case '/':
ans /= calc(p + i + 1, 1);
if (p[i + 1] == '('){
while (p[i] != ')'){
i++;
}
}
i++;
break;
case '(':
return (calc(p + i + 1, 0));
case ')':
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
return (ans);
}
| Return answer when multiple or divide | Return answer when multiple or divide
| C | mit | Roadagain/Calculator,Roadagain/Calculator |
a6fb75a75e2efd5409e124ebbf89d4ca6eab0e1d | archive/src/080.c | archive/src/080.c | #include <stdio.h>
#include <math.h>
#include <gmp.h>
int is_perfect_sq(int n)
{
int s = sqrt(n);
return s * s == n;
}
int main(void)
{
// 10^100 ~< 2^400
mpf_set_default_prec(512);
mpf_t a;
mpf_init(a);
int total_sum = 0;
// Count through 100 irrational roots
for (int i = 2; i <= 100; ++i) {
if (is_perfect_sq(i)) {
continue;
}
mpf_sqrt_ui(a, i);
int digital_sum = 0;
// Count 100 decimal digits
for (int i = 0; i < 100; ++i) {
long ip = mpf_get_ui(a);
digital_sum += ip % 10;
mpf_sub_ui(a, a, ip);
mpf_mul_ui(a, a, 10);
}
total_sum += digital_sum;
}
printf("%d\n", total_sum);
mpf_clear(a);
}
| Add solution for problem 80 | Add solution for problem 80
This is done using C, since GMP is already a dependency and the code is
fairly simple.
| C | mit | tiehuis/euler,tiehuis/euler,tiehuis/euler,tiehuis/euler |
|
040a902e166dbe1c4daaa53080f920242cb9dc71 | src/selector.h | src/selector.h | #pragma once
#include <atomic>
#include "util.h"
namespace happyntrain {
template <typename SelectorImpt>
class Selector : NoCopy {
SelectorImpt _selector;
int64_t _id;
public:
template <typename... Vars>
Selector(Vars&&... args) : _id(GetNewId()), _selector(args...) {}
~Selector() {}
inline void AddChannel() { _selector.AddChannel(); }
inline void RemoveChannel() { _selector.RemoveChannel(); }
inline void UpdateChannel() { _selector.UpdateChannel(); }
private:
static int64_t GetNewId() {
static std::atomic<int64_t> id(0);
return id++;
}
};
// end happyntrain
} | #pragma once
#include <atomic>
#include "util.h"
namespace happyntrain {
const int kMaxSelectEvents = 2000;
template <typename SelectorImpt>
class Selector : NoCopy {
SelectorImpt _selector;
int64_t _id;
public:
template <typename... Vars>
Selector(Vars&&... args) : _id(GetNewId()), _selector(args...) {}
~Selector() {}
inline void AddChannel() { _selector.AddChannel(); }
inline void RemoveChannel() { _selector.RemoveChannel(); }
inline void UpdateChannel() { _selector.UpdateChannel(); }
private:
static int64_t GetNewId() {
static std::atomic<int64_t> id(0);
return id++;
}
};
// end happyntrain
} | Add constants - max events | Add constants - max events
| C | mit | emengjzs/happyntrain |
2498c6a0ed3edffe5becc54b27ef86bbd33d4023 | You-DataStore/internal/operation.h | You-DataStore/internal/operation.h | #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
/// Executes the operation
virtual bool run() = 0;
protected:
TaskId taskId;
SerializedTask task;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
| #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
virtual ~IOperation();
/// Executes the operation
virtual bool run() = 0;
protected:
TaskId taskId;
SerializedTask task;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
| Add back virtual dtor for IOperation | Add back virtual dtor for IOperation
| C | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main |
3a41b9926ac545e4497fb2faf6cf7f22c05eb4b5 | src/condor_utils/perf_counter.linux.h | src/condor_utils/perf_counter.linux.h | /***************************************************************
*
* Copyright (C) 1990-2021, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* 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.
*
***************************************************************/
// Encapsulate the linux peformance counter, for insn retired
// Note this is included in the procd, so we can't use full condor libraries
#ifndef __PERF_COUNTER_H
#define _PERF_COUNTER_H
#include <sys/types.h>
class PerfCounter {
public:
PerfCounter(pid_t pid);
virtual ~PerfCounter();
void start() const;
void stop() const;
long long getInsns() const;
private:
pid_t pid;
int fd;
};
#endif
| /***************************************************************
*
* Copyright (C) 1990-2021, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* 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.
*
***************************************************************/
// Encapsulate the linux peformance counter, for insn retired
// Note this is included in the procd, so we can't use full condor libraries
#ifndef __PERF_COUNTER_H
#define __PERF_COUNTER_H
#include <sys/types.h>
class PerfCounter {
public:
PerfCounter(pid_t pid);
virtual ~PerfCounter();
void start() const;
void stop() const;
long long getInsns() const;
private:
pid_t pid;
int fd;
};
#endif
| Fix typo in macro guard HTCONDOR-390 | Fix typo in macro guard HTCONDOR-390
| C | apache-2.0 | htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor |
0f427d7730b007e8740fff16d9a7b0dc5ebb692a | TMCache/TMCacheBackgroundTaskManager.h | TMCache/TMCacheBackgroundTaskManager.h | //
// TMCacheBackgroundTaskManager.h
// TMCache
//
// Created by Bryan Irace on 4/24/15.
// Copyright (c) 2015 Tumblr. All rights reserved.
//
@import UIKit;
/**
A protocol that classes who can begin and end background tasks can conform to. This protocol provides an abstraction in
order to avoid referencing `+ [UIApplication sharedApplication]` from within an iOS application extension.
*/
@protocol TMCacheBackgroundTaskManager <NSObject>
/**
Marks the beginning of a new long-running background task.
@return A unique identifier for the new background task. You must pass this value to the `endBackgroundTask:` method to
mark the end of this task. This method returns `UIBackgroundTaskInvalid` if running in the background is not possible.
*/
- (UIBackgroundTaskIdentifier)beginBackgroundTask;
/**
Marks the end of a specific long-running background task.
@param identifier An identifier returned by the `beginBackgroundTaskWithExpirationHandler:` method.
*/
- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;
@end
| //
// TMCacheBackgroundTaskManager.h
// TMCache
//
// Created by Bryan Irace on 4/24/15.
// Copyright (c) 2015 Tumblr. All rights reserved.
//
@import UIKit;
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
typedef NSUInteger UIBackgroundTaskIdentifier;
#endif
/**
A protocol that classes who can begin and end background tasks can conform to. This protocol provides an abstraction in
order to avoid referencing `+ [UIApplication sharedApplication]` from within an iOS application extension.
*/
@protocol TMCacheBackgroundTaskManager <NSObject>
/**
Marks the beginning of a new long-running background task.
@return A unique identifier for the new background task. You must pass this value to the `endBackgroundTask:` method to
mark the end of this task. This method returns `UIBackgroundTaskInvalid` if running in the background is not possible.
*/
- (UIBackgroundTaskIdentifier)beginBackgroundTask;
/**
Marks the end of a specific long-running background task.
@param identifier An identifier returned by the `beginBackgroundTaskWithExpirationHandler:` method.
*/
- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;
@end
| Define UIBackgroundTaskIdentifier if on OS X | Define UIBackgroundTaskIdentifier if on OS X
| C | apache-2.0 | paulkite/TMCache,paulkite/TMCache |
6f435b65aea63975a33c18e251654c56bacb38b5 | private/TupleManipulation.h | private/TupleManipulation.h | #pragma once
namespace TupleManipulation {
template<int... Integers>
struct sequence { };
template<int N, int... Integers>
struct gen_sequence : public gen_sequence<N - 1, N - 1, Integers...> { };
template<int... Integers>
struct gen_sequence<0, Integers...> : public sequence<Integers...> { };
template<typename Tuple, typename Functor, int... Integers>
void for_each(Tuple&& tuple, Functor functor, sequence<Integers...>)
{
auto l = { (functor(std::get<Integers>(tuple)), 0)... };
(void)l;
}
template<typename... Types, typename Functor>
void for_each_in_tuple(std::tuple<Types...> & tuple, Functor functor)
{
for_each(tuple, functor, gen_sequence<sizeof...(Types)>());
}
template <typename T, typename Tuple>
struct has_type;
template <typename T>
struct has_type<T, std::tuple<>>
{
static constexpr bool value = false;
};
template <typename T, typename U, typename... Ts>
struct has_type<T, std::tuple<U, Ts...>> : has_type<T, std::tuple<Ts...>> {};
template <typename T, typename... Ts>
struct has_type<T, std::tuple<T, Ts...>> : std::true_type
{
static constexpr bool value = true;
};
}
| #pragma once
namespace TupleManipulation {
template<int... Integers>
struct sequence { };
template<int N, int... Integers>
struct gen_sequence : public gen_sequence<N - 1, N - 1, Integers...> { };
template<int... Integers>
struct gen_sequence<0, Integers...> : public sequence<Integers...> { };
template<typename Tuple, typename Functor, int... Integers>
void for_each(Tuple&& tuple, Functor functor, sequence<Integers...>)
{
auto l = { (functor(std::get<Integers>(tuple)), 0)... };
(void)l;
}
template<typename... Types, typename Functor>
void for_each_in_tuple(std::tuple<Types...> & tuple, Functor functor)
{
for_each(tuple, functor, gen_sequence<sizeof...(Types)>());
}
template <typename T, typename Tuple>
struct has_type;
template <typename T>
struct has_type<T, std::tuple<>>
{
static constexpr bool value = false;
};
template <typename T, typename U, typename... Ts>
struct has_type<T, std::tuple<U, Ts...>> : public has_type<T, std::tuple<Ts...>> {};
template <typename T, typename... Ts>
struct has_type<T, std::tuple<T, Ts...>> : public std::true_type
{
static constexpr bool value = true;
};
}
| Fix compiler warning in IAR | Fix compiler warning in IAR
| C | mit | PabloMansanet/Panku,PabloMansanet/Panku |
a721476360ad88fa3e28202b4a399af3e7da2259 | src/Engine/windowManager.h | src/Engine/windowManager.h | #ifndef windowManager_H
#define windowManager_H
#include <iostream>
// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
class windowManager
{
public:
void init();
void windowManager::getScreenSize();
//Functions to return dimensions of window
int getWindowHeight();
int getWindowWidth();
GLFWwindow* getWindow();
private:
//The window height
int width;
int height;
GLFWwindow* currentWindow;
};
#endif
| #ifndef windowManager_H
#define windowManager_H
#include <iostream>
// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
class windowManager
{
public:
void init();
void getScreenSize();
//Functions to return dimensions of window
int getWindowHeight();
int getWindowWidth();
GLFWwindow* getWindow();
private:
//The window height
int width;
int height;
GLFWwindow* currentWindow;
};
#endif
| Fix building error on Linux | Fix building error on Linux
| C | apache-2.0 | Afrostie/Mopviewer |
4b405904603ee76220a24b92d4fce1689592836f | plugins/solokey/fu-plugin-solokey.c | plugins/solokey/fu-plugin-solokey.c | /*
* Copyright (C) 2019 Richard Hughes <[email protected]>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-plugin-vfuncs.h"
#include "fu-solokey-device.h"
void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
}
| /*
* Copyright (C) 2019 Richard Hughes <[email protected]>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-plugin-vfuncs.h"
#include "fu-solokey-device.h"
#include "fu-solokey-firmware.h"
void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
fu_plugin_add_firmware_gtype (plugin, "solokey", FU_TYPE_SOLOKEY_FIRMWARE);
}
| Allow parsing firmware with fwupdtool | solokey: Allow parsing firmware with fwupdtool
| C | lgpl-2.1 | fwupd/fwupd,fwupd/fwupd,hughsie/fwupd,fwupd/fwupd,hughsie/fwupd,hughsie/fwupd,hughsie/fwupd,fwupd/fwupd |
e5ac979a8b86bedf6d0ca74806c0cbfd6feebb20 | IntelFrameworkPkg/Include/Protocol/Crc32GuidedSectionExtraction.h | IntelFrameworkPkg/Include/Protocol/Crc32GuidedSectionExtraction.h | /** @file
This file declares GUIDed section extraction protocol.
This interface provides a means of decoding a GUID defined encapsulation
section. There may be multiple different GUIDs associated with the GUIDed
section extraction protocol. That is, all instances of the GUIDed section
extraction protocol must have the same interface structure.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: GuidedSectionExtraction.h
@par Revision Reference:
This protocol is defined in Firmware Volume Specification.
Version 0.9
**/
#ifndef __CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
#define __CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
//
// Protocol GUID definition. Each GUIDed section extraction protocol has the
// same interface but with different GUID. All the GUIDs is defined here.
// May add multiple GUIDs here.
//
#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
{ \
0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
}
//
// may add other GUID here
//
extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
#endif
| Rename GuidedSectionExtraction.h to Crc32GuidedSectonExtraction.h to avoid naming collision with that in MdePkg. Remove the duplicate definition. | Rename GuidedSectionExtraction.h to Crc32GuidedSectonExtraction.h to avoid naming collision with that in MdePkg.
Remove the duplicate definition.
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@2821 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
|
5929f9c0d0dd4510eb0a38f626b981666a179b78 | bottleopener/shiftrConnector.h | bottleopener/shiftrConnector.h | #pragma once
#include <YunMQTTClient.h>
class ShiftrConnector {
public :
void sendCounter(int counter);
void init();
void loop();
//default constructor
ShiftrConnector() {};
private :
YunMQTTClient client;
void connect();
};
| #pragma once
//https://github.com/256dpi/arduino-mqtt
#include <YunMQTTClient.h>
class ShiftrConnector {
public :
void sendCounter(int counter);
void init();
void loop();
//default constructor
ShiftrConnector() {};
private :
YunMQTTClient client;
void connect();
};
| Add link to the library | Add link to the library
| C | mit | Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot |
52a4ae2b1dbc35f768406dc831ae980ca3f43244 | snapshots/hacl-c-experimental/aead_chacha20_poly1305.h | snapshots/hacl-c-experimental/aead_chacha20_poly1305.h | #include "Chacha20.h"
#include "Poly1305_64.h"
void blit(uint8_t* src, uint32_t len, uint8_t* dest, uint32_t pos);
void poly1305_key_gen(uint8_t* otk, uint8_t* key, uint8_t* nonce);
uint32_t hacl_aead_chacha20_poly1305_encrypt(uint8_t *plaintext, uint32_t plaintext_len,
uint8_t *aad, uint32_t aad_len,
uint8_t *key, uint8_t *iv,
uint8_t *ciphertext, uint8_t *tag);
| #include "Chacha20.h"
#include "Poly1305_64.h"
void poly1305_key_gen(uint8_t* otk, uint8_t* key, uint8_t* nonce);
uint32_t hacl_aead_chacha20_poly1305_encrypt(uint8_t *plaintext, uint32_t plaintext_len,
uint8_t *aad, uint32_t aad_len,
uint8_t *key, uint8_t *iv,
uint8_t *ciphertext, uint8_t *tag);
| Remove exposed function from AEAD Chacha20 Poly1305 code | Remove exposed function from AEAD Chacha20 Poly1305 code
| C | apache-2.0 | mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star,mitls/hacl-star |
d0a65bfeac62294ce218c3d4c2d57c7bfca6ad20 | RandomNumbers.h | RandomNumbers.h | /*===- RandomNumbers.h - libSimulation -========================================
*
* DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/
#ifndef RANDOMNUMBERS
#define RANDOMNUMBERS
#include <random>
#include "VectorCompatibility.h"
class RandomNumbers {
public:
RandomNumbers();
~RandomNumbers() {}
const double uniformZeroToOne();
const double uniformZeroToTwoPi();
const double guassian(std::normal_distribution<double> &dist);
private:
std::mt19937_64 engine;
std::uniform_real_distribution<double> zeroToOne;
std::uniform_real_distribution<double> zeroToTwoPi;
};
class RandCache {
public:
__m128d r;
double l, h;
RandCache(const __m128d r_ = _mm_set1_pd(0.0),
const double l_ = 0.0, const double h_ = 0.0)
: r(r_), l(l_), h(h_) {}
};
#endif // RANDOMNUMBERS
| /*===- RandomNumbers.h - libSimulation -========================================
*
* DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/
#ifndef RANDOMNUMBERS
#define RANDOMNUMBERS
#include <random>
#include "VectorCompatibility.h"
class RandomNumbers {
public:
RandomNumbers();
~RandomNumbers() {}
const double uniformZeroToOne();
const double uniformZeroToTwoPi();
const double guassian(std::normal_distribution<double> &dist);
private:
std::mt19937_64 engine;
std::uniform_real_distribution<double> zeroToOne;
std::uniform_real_distribution<double> zeroToTwoPi;
};
// Structure to hold precomuted random numbers for use with thermal forces.
struct RandCache {
__m128d r;
double l, h;
RandCache(const __m128d r_ = _mm_set1_pd(0.0),
const double l_ = 0.0, const double h_ = 0.0)
: r(r_), l(l_), h(h_) {}
};
#endif // RANDOMNUMBERS
| Change rand cache to a struct since everything is public. Add comment. | Change rand cache to a struct since everything is public. Add comment. | C | bsd-3-clause | leios/demonsimulationcode,leios/demonsimulationcode |
867fea2c7e060a1ed593e6728042effbe7274f1b | iface.h | iface.h | #ifndef IFACE_H_INCLUDED
#define IFACE_H_INCLUDED
#include <fcntl.h>
typedef struct funcs_t {
unsigned char *(*get_mem_buf_hash)(unsigned char *mem_buf, unsigned long int mem_size);
unsigned char *(*hash_to_str)(unsigned char *mem_hash);
int (*is_mem_buf_dumped)(unsigned char *mem_hash);
void (*dump_mem_buf)(unsigned char *mem_buf, unsigned long int mem_size, char *fname);
} funcs_t;
typedef struct plugin_t {
void *hndl;
char *name;
char *description;
struct plugin_t *next;
} plugin_t;
#endif | #ifndef IFACE_H_INCLUDED
#define IFACE_H_INCLUDED
#include <fcntl.h>
typedef struct plugin_t {
void *hndl;
char *name;
char *description;
struct plugin_t *next;
} plugin_t;
#ifdef __cplusplus
extern "C" plugin_t *init();
#endif
#endif | Make plugins's init() function external C | Make plugins's init() function external C
| C | unlicense | alexandernst/memory-dumper |
f325ae16249c115a28ce6a92d179315085ed13b9 | bacula/src/version.h | bacula/src/version.h | /* */
#undef VERSION
#define VERSION "1.35.2"
#define BDATE "28 August 2004"
#define LSMDATE "28Aug04"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* Debug flags not normally turned on */
/* #define TRACE_JCR_CHAIN 1 */
/* #define TRACE_RES 1 */
/* #define DEBUG_MEMSET 1 */
#define DEBUG_BLOCK_ZEROING 1
/* #define FULL_DEBUG 1 */ /* normally on for testing only */
/* Turn this on ONLY if you want all Dmsg() to append to the
* trace file. Implemented mainly for Win32 ...
*/
/* #define SEND_DMSG_TO_FILE 1 */
/* #define NO_ATTRIBUTES_TEST 1 */
/* #define NO_TAPE_WRITE_TEST 1 */
/* #define FD_NO_SEND TEST 1 */
/* #define DEBUG_MUTEX 1 */
| /* */
#undef VERSION
#define VERSION "1.35.2"
#define BDATE "30 August 2004"
#define LSMDATE "30Aug04"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* Debug flags not normally turned on */
/* #define TRACE_JCR_CHAIN 1 */
/* #define TRACE_RES 1 */
/* #define DEBUG_MEMSET 1 */
#define DEBUG_BLOCK_ZEROING 1
/* #define FULL_DEBUG 1 */ /* normally on for testing only */
/* Turn this on ONLY if you want all Dmsg() to append to the
* trace file. Implemented mainly for Win32 ...
*/
/* #define SEND_DMSG_TO_FILE 1 */
/* #define NO_ATTRIBUTES_TEST 1 */
/* #define NO_TAPE_WRITE_TEST 1 */
/* #define FD_NO_SEND TEST 1 */
/* #define DEBUG_MUTEX 1 */
| Update manual Fix CDROM script to handle non-existant files | Update manual
Fix CDROM script to handle non-existant files
git-svn-id: bb0627f6f70d46b61088c62c6186faa4b96a9496@1568 91ce42f0-d328-0410-95d8-f526ca767f89
| C | agpl-3.0 | rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula |
c343de856dbe3f7049ad0193911216b3e7acdc54 | PSET2/caesar.c | PSET2/caesar.c | #include <stdio.h>
#include <cs50.h>
int main(int argc, char *argv[]) {
// check entered key
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage: ./caesar k\nWhere k is a non negative integer.\n");
return 1;
}
int key = atoi(argv[1]);
return 0;
}
| #include <stdio.h>
#include <cs50.h>
#include <string.h>
#define ALPHA_NUM 26
int main(int argc, char *argv[]) {
// check argument number and argument key to be greater than -1
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage (k >= 0):\n./caesar k \n");
return 1;
}
int key = atoi(argv[1]) % ALPHA_NUM;
// get plaintext from user
printf("plaintext: ");
string plaintext = get_string();
printf("\n");
string ciphertext = "";
// encode plaintext
size_t text_len = strlen(plaintext);
for (int i = 0; i < text_len; ++i) {
}
return 0;
}
| Add unfinished loop to encode message | Add unfinished loop to encode message
| C | unlicense | Implaier/CS50,Implaier/CS50,Implaier/CS50,Implaier/CS50 |
c706f245992f760afdb7d41d3f40c60b3d85ee89 | src/bgp/security_group/security_group.h | src/bgp/security_group/security_group.h | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#define SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#include <boost/array.hpp>
#include <boost/system/error_code.hpp>
#include <string>
#include "base/parse_object.h"
#include "bgp/bgp_common.h"
class SecurityGroup {
public:
static const int kSize = 8;
static const uint32_t kMinGlobalId = 1000000;
static const uint32_t kMaxGlobalId = 1999999;
typedef boost::array<uint8_t, kSize> bytes_type;
SecurityGroup(as_t asn, uint32_t id);
explicit SecurityGroup(const bytes_type &data);
as_t as_number() const;
uint32_t security_group_id() const;
bool IsGlobal() const;
const bytes_type &GetExtCommunity() const {
return data_;
}
const uint64_t GetExtCommunityValue() const {
return get_value(data_.begin(), 8);
}
std::string ToString();
private:
bytes_type data_;
};
#endif // SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
| /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#define SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#include <boost/array.hpp>
#include <boost/system/error_code.hpp>
#include <string>
#include "base/parse_object.h"
#include "bgp/bgp_common.h"
class SecurityGroup {
public:
static const int kSize = 8;
static const uint32_t kMinGlobalId = 1;
static const uint32_t kMaxGlobalId = 7999999;
typedef boost::array<uint8_t, kSize> bytes_type;
SecurityGroup(as_t asn, uint32_t id);
explicit SecurityGroup(const bytes_type &data);
as_t as_number() const;
uint32_t security_group_id() const;
bool IsGlobal() const;
const bytes_type &GetExtCommunity() const {
return data_;
}
const uint64_t GetExtCommunityValue() const {
return get_value(data_.begin(), 8);
}
std::string ToString();
private:
bytes_type data_;
};
#endif // SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
| Update min/max global SGIDs values to match Schema Transformer | Update min/max global SGIDs values to match Schema Transformer
Change-Id: I63d5634e9a374ce33e9e0e779caf499e8fbccdec
Closes-Bug: 1381145
| C | apache-2.0 | rombie/contrail-controller,eonpatapon/contrail-controller,cloudwatt/contrail-controller,cloudwatt/contrail-controller,srajag/contrail-controller,DreamLab/contrail-controller,rombie/contrail-controller,reiaaoyama/contrail-controller,vmahuli/contrail-controller,nischalsheth/contrail-controller,numansiddique/contrail-controller,srajag/contrail-controller,srajag/contrail-controller,DreamLab/contrail-controller,hthompson6/contrail-controller,srajag/contrail-controller,numansiddique/contrail-controller,nischalsheth/contrail-controller,tcpcloud/contrail-controller,rombie/contrail-controller,cloudwatt/contrail-controller,vmahuli/contrail-controller,nischalsheth/contrail-controller,sajuptpm/contrail-controller,reiaaoyama/contrail-controller,reiaaoyama/contrail-controller,vmahuli/contrail-controller,tcpcloud/contrail-controller,rombie/contrail-controller,codilime/contrail-controller,vpramo/contrail-controller,sajuptpm/contrail-controller,vpramo/contrail-controller,srajag/contrail-controller,tcpcloud/contrail-controller,eonpatapon/contrail-controller,eonpatapon/contrail-controller,nischalsheth/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,codilime/contrail-controller,tcpcloud/contrail-controller,facetothefate/contrail-controller,sajuptpm/contrail-controller,rombie/contrail-controller,DreamLab/contrail-controller,vpramo/contrail-controller,eonpatapon/contrail-controller,rombie/contrail-controller,facetothefate/contrail-controller,facetothefate/contrail-controller,nischalsheth/contrail-controller,nischalsheth/contrail-controller,numansiddique/contrail-controller,eonpatapon/contrail-controller,numansiddique/contrail-controller,numansiddique/contrail-controller,reiaaoyama/contrail-controller,sajuptpm/contrail-controller,vpramo/contrail-controller,codilime/contrail-controller,tcpcloud/contrail-controller,sajuptpm/contrail-controller,sajuptpm/contrail-controller,facetothefate/contrail-controller,nischalsheth/contrail-controller,facetothefate/contrail-controller,hthompson6/contrail-controller,DreamLab/contrail-controller,hthompson6/contrail-controller,DreamLab/contrail-controller,eonpatapon/contrail-controller,codilime/contrail-controller,vmahuli/contrail-controller,hthompson6/contrail-controller,rombie/contrail-controller,eonpatapon/contrail-controller,vmahuli/contrail-controller,tcpcloud/contrail-controller,cloudwatt/contrail-controller,vpramo/contrail-controller,hthompson6/contrail-controller,nischalsheth/contrail-controller,reiaaoyama/contrail-controller,cloudwatt/contrail-controller |
1f0cf96991c2601d361416ca067be796e8b54494 | blogcomment_p.h | blogcomment_p.h | /*
This file is part of the kblog library.
Copyright (c) 2006-2007 Christian Weilbach <[email protected]>
Copyright (c) 2007 Mike Arthur <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef BLOGPOSTINGCOMMENT_P_H
#define BLOGPOSTINGCOMMENT_P_H
#include "blogcomment.h"
#include <KDateTime>
#include <KUrl>
namespace KBlog{
class BlogCommentPrivate
{
public:
BlogComment *q_ptr;
QString mTitle;
QString mContent;
QString mEmail;
QString mName;
QString mCommentId;
KUrl mUrl;
QString mError;
BlogComment::Status mStatus;
KDateTime mModificationDateTime;
KDateTime mCreationDateTime;
};
} // namespace KBlog
#endif
| Add file that SVN somehow missed. | Add file that SVN somehow missed.
svn path=/trunk/KDE/kdepimlibs/; revision=711804
| C | lgpl-2.1 | KDE/kblog,KDE/kblog |
|
061ced8ae25bc5dad4d1179a7f9cd258ebb05ed3 | 2015-2016/B/10/02/task5.c | 2015-2016/B/10/02/task5.c | #include <stdio.h>
void increase_coordinates();
typedef struct {
int x;
int y;
int z;
} Point;
Point pt;
int main () {
printf("x = ");scanf("%d",&pt.x);
printf("y = ");scanf("%d",&pt.y);
printf("z = ");scanf("%d",&pt.z);
increase_coordinates();
printf("\nx = %d", pt.x);
printf("\ny = %d", pt.y);
printf("\nz = %d", pt.z);
return 0;
}
void increase_coordinates () {
pt.x = pt.x + 1;
pt.y = pt.y + 1;
pt.z = pt.z + 1;
}
| Add task with points for October | Add task with points for October
| C | mit | AlexAndreev/po-homework,VVurbanov/po-homework,ivanmilevtues/po-homework |
|
d3437f42ec20df8e99fdb6ff84bea6b64a3824b5 | tests/regression/01-cpa/10-posneg.c | tests/regression/01-cpa/10-posneg.c | //PARAM: --enable ana.int.wrap_on_signed_overflow
#include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// simple arithmetic
i = k + 1;
assert(i != 6);
i = k - 1;
assert(i != 4);
i = k * 3; // multiplication with odd numbers is injective
assert(i != 15);
i = k * 2; // multiplication with even numbers is not injective
assert(i != 10); // UNKNOWN! k could be -2147483643;
i = k / 2;
assert(i != 2); // UNKNOWN! k could be 4
return 0;
}
| //PARAM: --enable ana.int.wrap_on_signed_overflow
// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
#include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT).
// Signed overflows are undefined behavior, so by default we go to top when they might occur.
// Here we activated wrap_on_signed_overflow, so we retain precision, assuming that signed overflows are defined (via the usual two's complement representation).
// simple arithmetic
i = k + 1;
assert(i != 6);
i = k - 1;
assert(i != 4);
i = k * 3; // multiplication with odd numbers is injective
assert(i != 15);
i = k * 2; // multiplication with even numbers is not injective
assert(i != 10); // UNKNOWN! k could be -2147483643;
i = k / 2;
assert(i != 2); // UNKNOWN! k could be 4
return 0;
}
| Add comment on why ana.int.wrap_on_signed_overflow needs to enabled for test case | Add comment on why ana.int.wrap_on_signed_overflow needs to enabled for test case
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
f20b64d03463cbd35bcacea1d80848b19d15ea6a | KVODelegate/KVODelegate.h | KVODelegate/KVODelegate.h | //
// KVODelegate.h
// KVODelegate
//
// Created by Ian Gregory on 15-03-2017.
// Copyright © 2017 ThatsJustCheesy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <KVODelegate/KVOObservationDelegate.h>
#import <KVODelegate/KVONotificationDelegate.h>
| //
// KVODelegate.h
// KVODelegate
//
// Created by Ian Gregory on 15-03-2017.
// Copyright © 2017 ThatsJustCheesy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KVOObservationDelegate.h"
#import "KVONotificationDelegate.h"
| Use quoted includes in umbrella header | Use quoted includes in umbrella header
| C | mit | ThatsJustCheesy/KVODelegate,ThatsJustCheesy/KVODelegate |
9f6244e43e007f27ccf02d8e4ebcdf12d182a39b | src/meat/math/abBlood.c | src/meat/math/abBlood.c | #include <math.h>
#include "abBlood.h"
void updateAB(simBac *sim)
{
sim->c_b = sim->c_b_peak * \
exp( -1 * sim->param.k_a * \
( sim->t - sim->param.doses_t[sim->dose_num-1] ) \
/ sim->param.v_w );
// Exponential decay from last time spike
// ( 1.0 - sim->param.t_s * sim->param.gam_ab ) * sim->c_b;
// Exponential decay according to renal clearance rate
if (sim->c_b < 0) // set 0 as min concentration
{
sim->c_b = 0;
}
if (sim->dose_num < sim->param.num_doses) // if under total number of doses
{
if (sim->t >= sim->param.doses_t[sim->dose_num])
// If we're at the next dosing time...
{
sim->c_b += sim->param.doses_c[sim->dose_num];
// Add concentration of next dose to blood
++sim->dose_num; // Advance dose counter
sim->c_b_peak = sim->c_b; // set new peak concentration
}
}
}
| #include <math.h>
#include "abBlood.h"
void updateAB(simBac *sim)
{
sim->c_b = sim->c_b_peak * \
exp( -1 * sim->param.k_a * \
( sim->t - sim->param.doses_t[sim->dose_num-1] ) \
/ sim->param.v_w );
// Exponential decay from last time spike
// ( 1.0 - sim->param.t_s * sim->param.gam_ab ) * sim->c_b;
// Exponential decay according to renal clearance rate
if (sim->c_b < sim->param.c_c / 2) // set half of c_c as min concentration
{
sim->c_b = sim->param.c_c / 2;
}
if (sim->dose_num < sim->param.num_doses) // if under total number of doses
{
if (sim->t >= sim->param.doses_t[sim->dose_num])
// If we're at the next dosing time...
{
sim->c_b += sim->param.doses_c[sim->dose_num];
// Add concentration of next dose to blood
++sim->dose_num; // Advance dose counter
sim->c_b_peak = sim->c_b; // set new peak concentration
}
}
}
| Add antibiotic concentration artificial minimum floor | Add antibiotic concentration artificial minimum floor
| C | mit | bacteriaboyz/CheatingTheCheaters,bacteriaboyz/CheatingTheCheaters,bacteriaboyz/CheatingTheCheaters,bacteriaboyz/CheatingTheCheaters |
4f5125e0b0ec6b3ddef8fa967b30ced19759fafa | drivers/spmi/spmi-dbgfs.h | drivers/spmi/spmi-dbgfs.h | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _SPMI_DBGFS_H
#define _SPMI_DBGFS_H
#include <linux/debugfs.h>
#ifdef CONFIG_DEBUG_FS
int spmi_dfs_add_controller(struct spmi_controller *ctrl);
int spmi_dfs_del_controller(struct spmi_controller *ctrl);
#else
static inline int spmi_dfs_add_controller(struct spmi_controller *ctrl)
{
return 0;
}
static inline int spmi_dfs_del_controller(struct spmi_controller *ctrl)
{
return 0;
}
#endif
struct dentry *spmi_dfs_create_file(struct spmi_controller *ctrl,
const char *name, void *data,
const struct file_operations *fops);
#endif /* _SPMI_DBGFS_H */
| /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _SPMI_DBGFS_H
#define _SPMI_DBGFS_H
#include <linux/debugfs.h>
#ifdef CONFIG_DEBUG_FS
int spmi_dfs_add_controller(struct spmi_controller *ctrl);
int spmi_dfs_del_controller(struct spmi_controller *ctrl);
struct dentry *spmi_dfs_create_file(struct spmi_controller *ctrl,
const char *name, void *data,
const struct file_operations *fops);
#else
static inline int spmi_dfs_add_controller(struct spmi_controller *ctrl)
{
return 0;
}
static inline int spmi_dfs_del_controller(struct spmi_controller *ctrl)
{
return 0;
}
static inline struct dentry *spmi_dfs_create_file(struct spmi_controller *ctrl,
const char *name, void *data,
const struct file_operations *fops)
{
return 0;
}
#endif
#endif /* _SPMI_DBGFS_H */
| Fix compilation error when debugfs is disabled | spmi: Fix compilation error when debugfs is disabled
Code does not compile with debugfs disabled. Fix this.
Change-Id: I11fa09401f29e9f2fb65d19668cae455253f6355
Signed-off-by: Olav Haugan <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas |
56bddeda24adcb927dd5ceafd75f84ebc2eb4203 | test/Sema/static-init.c | test/Sema/static-init.c | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s
#include <stdint.h>
static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t s = (intptr_t) &s;
_Bool t = &t;
union bar {
int i;
};
struct foo {
unsigned ptr;
};
union bar u[1];
struct foo x = {(intptr_t) u}; // no-error
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
typedef __typeof((int*) 0 - (int*) 0) intptr_t;
static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t s = (intptr_t) &s;
_Bool t = &t;
union bar {
int i;
};
struct foo {
unsigned ptr;
};
union bar u[1];
struct foo x = {(intptr_t) u}; // no-error
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
| Fix test to not force triple, and also to not need stdint.h. | Fix test to not force triple, and also to not need stdint.h.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@96499 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
b51602b1db901e46fd1fec4d76c669b31a538079 | components/libc/compilers/common/nogcc/sys/types.h | components/libc/compilers/common/nogcc/sys/types.h | /*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__
#include <stdint.h>
#include <stddef.h>
#include <time.h>
typedef int32_t clockid_t;
typedef int32_t key_t; /* Used for interprocess communication. */
typedef int pid_t; /* Used for process IDs and process group IDs. */
typedef unsigned short uid_t;
typedef unsigned short gid_t;
typedef signed long off_t;
typedef int mode_t;
#ifndef ARCH_CPU_64BIT
typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */
#else
typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */
#endif
typedef long suseconds_t; /* microseconds. */
typedef unsigned long useconds_t; /* microseconds (unsigned) */
typedef unsigned long dev_t;
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned long u_long;
#endif | /*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__
#include <stdint.h>
#include <stddef.h>
#include <time.h>
typedef int32_t clockid_t;
typedef int32_t key_t; /* Used for interprocess communication. */
typedef int pid_t; /* Used for process IDs and process group IDs. */
typedef unsigned short uid_t;
typedef unsigned short gid_t;
typedef signed long off_t;
typedef int mode_t;
#ifndef ARCH_CPU_64BIT
typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */
#else
typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */
#endif
typedef long suseconds_t; /* microseconds. */
typedef unsigned long useconds_t; /* microseconds (unsigned) */
typedef unsigned long dev_t;
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned long u_long;
#endif
| Add a blank line at the end | [update] Add a blank line at the end
| C | apache-2.0 | nongxiaoming/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread,RT-Thread/rt-thread,hezlog/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,RT-Thread/rt-thread,hezlog/rt-thread,nongxiaoming/rt-thread,geniusgogo/rt-thread,hezlog/rt-thread,hezlog/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,hezlog/rt-thread,nongxiaoming/rt-thread,RT-Thread/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread |
aa075fd45fabc26875fb3ac5c34cce70fe3a7030 | LargeBarrelAnalysis/EventCategorizerTools.h | LargeBarrelAnalysis/EventCategorizerTools.h | /**
* @copyright Copyright 2017 The J-PET Framework 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 find a copy of the License in the LICENCE file.
*
* 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 EventCategorizerTools.h
*/
#ifndef _EVENTCATEGORIZERTOOLS_H_
#define _EVENTCATEGORIZERTOOLS_H_
#include <DataObjects/JPetHit/JPetHit.h>
struct Point3D
{
double x=0;
double y=0;
double z=0;
};
class EventCategorizerTools
{
public:
static double calculateTOF(const JPetHit& firstHit, const JPetHit& latterHit);
static Point3D calculateAnnihilationPoint(const JPetHit& firstHit, const JPetHit& latterHit);
};
#endif /* !EVENTCATEGORIZERTOOLS_H */
| /**
* @copyright Copyright 2017 The J-PET Framework 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 find a copy of the License in the LICENCE file.
*
* 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 EventCategorizerTools.h
*/
#ifndef _EVENTCATEGORIZERTOOLS_H_
#define _EVENTCATEGORIZERTOOLS_H_
#include <JPetHit/JPetHit.h>
struct Point3D
{
double x=0;
double y=0;
double z=0;
};
class EventCategorizerTools
{
public:
static double calculateTOF(const JPetHit& firstHit, const JPetHit& latterHit);
static Point3D calculateAnnihilationPoint(const JPetHit& firstHit, const JPetHit& latterHit);
};
#endif /* !EVENTCATEGORIZERTOOLS_H */
| Change include to proper one | Change include to proper one
| C | apache-2.0 | JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples |
b657af02c49fa95c889454f82609ed2a7672949a | kmail/kmversion.h | kmail/kmversion.h | // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.9"
#endif /*kmversion_h*/
| // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.10"
#endif /*kmversion_h*/
| Increase version number for KDE 3.5.10. | Increase version number for KDE 3.5.10.
svn path=/branches/KDE/3.5/kdepim/; revision=846406
| C | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi |
bbdf0450f0c99355a84db41a35d78f37a4879e16 | include/program_options/item.h | include/program_options/item.h | /*
* parser item
* (c) Copyright 2015 Micooz
*
* Released under the Apache License.
* See the LICENSE file or
* http://www.apache.org/licenses/LICENSE-2.0.txt for more information.
*/
#ifndef PARSER_ITEM_H_
#define PARSER_ITEM_H_
#include <sstream>
namespace program_options {
class ParseItem {
public:
ParseItem(const std::string& value);
/*
* dynamic type cast, support base data types including std::string
*/
template <typename T>
T as() {
T r;
std::stringstream buf;
buf << value_;
buf >> r;
return r;
}
/*
* alias of as<std::string>()
*/
inline std::string val() const { return value_; }
private:
std::string value_;
};
}
#endif // PARSER_ITEM_H_ | /*
* parser item
* (c) Copyright 2015 Micooz
*
* Released under the Apache License.
* See the LICENSE file or
* http://www.apache.org/licenses/LICENSE-2.0.txt for more information.
*/
#ifndef PARSER_ITEM_H_
#define PARSER_ITEM_H_
#include <sstream>
namespace program_options {
class ParseItem {
public:
ParseItem(const std::string& value);
/*
* dynamic type cast, support base data types including std::string
*/
template<typename T>
T as() {
T r;
std::stringstream buf;
buf << value_;
buf >> r;
return r;
}
/*
* alias of as<std::string>()
*/
inline std::string val() const { return value_; }
/*
* returns c-style string, will be useful if you want a const char*
*/
inline const char* c_str() const { return value_.c_str(); }
private:
std::string value_;
};
}
#endif // PARSER_ITEM_H_ | Add a function of ParseItem which returns a c-style string directly. | Add a function of ParseItem which returns a c-style string directly.
| C | apache-2.0 | Micooz/program_options,Micooz/program_options,Micooz/program_options,Micooz/program_options |
49546b6634d2ab100761e27f76a824909fcf89dc | src/themis/secure_record.h | src/themis/secure_record.h | /**
* @file
*
* (c) CossackLabs
*/
#ifndef _SECURE_RECORD_H_
#define _SECURE_RECORD_H_
typedef struct themis_secure_record_type themis_secure_record_t;
themis_secure_record_t* themis_secure_record_create(const uint8_t* master_key, const size_t master_key_length);
themis_status_t themis_secure_record_encrypt_1(themis_secure_record_t* ctx,
const uint8_t* message,
const size_t message_length,
uint8_t* encrypted_message,
size_t* encrypted_message_length);
themis_status_t themis_secure_record_decrypt_1(themis_secure_record_t* ctx,
const uint8_t* encrypted_message,
const size_t encrypted_message_length,
uint8_t* plain_message,
size_t* plain_message_length);
themis_status_t themis_secure_record_encrypt_2(themis_secure_record_t* ctx,
const uint8_t* message,
const size_t message_length,
uint8_t* auth_tag_iv,
size_t* auth_tag_iv_length,
uint8_t* encrypted_message,
size_t* encrypted_message_length);
themis_status_t themis_secure_record_decrypt_2(themis_secure_record_t* ctx,
const uint8_t* encrypted_message,
const size_t encrypted_message_length,
const uint8_t* auth_tag_iv,
const size_t auth_tag_iv_length,
uint8_t* plain_message,
size_t* plain_message_length);
themis_status_t themis_secure_record_encrypt_3(themis_secure_record_t* ctx,
const uint8_t* message,
const size_t message_length,
const uint8_t* auth_tag_iv,
const size_t auth_tag_iv_length,
uint8_t* encrypted_message,
size_t* encrypted_message_length);
themis_status_t themis_secure_record_decrypt_3(themis_secure_record_t* ctx,
const uint8_t* encrypted_message,
const size_t encrypted_message_length,
const uint8_t* auth_tag_iv,
const size_t auth_tag_iv_length,
uint8_t* plain_message,
size_t* plain_message_length);
themis_status_t themis_secure_record_destroy(themis_secure_record_t* ctx);
#endif /* _SECURE_RECORD_H_ */
| Add THEMIS Secure Record interface | Add THEMIS Secure Record interface
| C | apache-2.0 | cossacklabs/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,Lagovas/themis,cossacklabs/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,cossacklabs/themis,storojs72/themis,cossacklabs/themis,Lagovas/themis,mnaza/themis,cossacklabs/themis,cossacklabs/themis,mnaza/themis,mnaza/themis,Lagovas/themis,storojs72/themis,storojs72/themis,mnaza/themis,Lagovas/themis,Lagovas/themis,storojs72/themis,storojs72/themis,cossacklabs/themis,mnaza/themis,mnaza/themis,storojs72/themis,cossacklabs/themis,storojs72/themis,Lagovas/themis,mnaza/themis,cossacklabs/themis,Lagovas/themis,mnaza/themis,storojs72/themis,cossacklabs/themis,cossacklabs/themis,mnaza/themis |
|
2a1b1a4cc8a1da74d35401adc5713f63ff93f5b6 | bindings/ios/Private/MEGAHandleList+init.h | bindings/ios/Private/MEGAHandleList+init.h | /**
* @file MEGAHandleList+init
* @brief Private functions of MEGAHandleList
*
* (c) 2013-2017 by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth in the Terms of Service.
*
* The MEGA SDK 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.
*
* @copyright Simplified (2-clause) BSD License.
*
* You should have received a copy of the license along with this
* program.
*/
#import "MEGAHandleList.h"
#import "megaapi.h"
@interface MEGAHandleList (init)
- (mega::MegaHandleList *)getCPtr;
@end
| /**
* @file MEGAHandleList+init
* @brief Private functions of MEGAHandleList
*
* (c) 2013-2017 by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth in the Terms of Service.
*
* The MEGA SDK 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.
*
* @copyright Simplified (2-clause) BSD License.
*
* You should have received a copy of the license along with this
* program.
*/
#import "MEGAHandleList.h"
#import "megaapi.h"
@interface MEGAHandleList (init)
- (instancetype)initWithMegaHandleList:(mega::MegaHandleList *)megaHandleList cMemoryOwn:(BOOL)cMemoryOwn;
- (mega::MegaHandleList *)getCPtr;
@end
| Add the ctor for MEGAHandleList (Obj-C) | Add the ctor for MEGAHandleList (Obj-C)
| C | bsd-2-clause | Acidburn0zzz/sdk,meganz/sdk,Acidburn0zzz/sdk,meganz/sdk,meganz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,meganz/sdk,Acidburn0zzz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,Acidburn0zzz/sdk |
74a1e19dc9d9b5f1e4275745a384f594922c4ac9 | test/Driver/aarch64-ssbs.c | test/Driver/aarch64-ssbs.c | // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+ssbs %s 2>&1 | FileCheck %s
// CHECK: "-target-feature" "+ssbs"
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+nossbs %s 2>&1 | FileCheck %s --check-prefix=NOSSBS
// NOSSBS: "-target-feature" "-ssbs"
// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTSSBS
// ABSENTSSBS-NOT: "-target-feature" "+ssbs"
// ABSENTSSBS-NOT: "-target-feature" "-ssbs"
| Add command-line option for SSBS | [AArch64] Add command-line option for SSBS
Summary:
SSBS (Speculative Store Bypass Safe) is only mandatory from 8.5
onwards but is optional from Armv8.0-A. This patch adds testing for
the ssbs command line option, added to allow enabling the feature
in previous Armv8-A architectures to 8.5.
Reviewers: olista01, samparker, aemerson
Reviewed By: samparker
Subscribers: javed.absar, kristof.beyls, cfe-commits
Differential Revision: https://reviews.llvm.org/D54961
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@348142 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
|
736a848b590fdebcdf1848eba11b19c0081269c3 | Capu/include/capu/os/Windows/EnvironmentVariables.h | Capu/include/capu/os/Windows/EnvironmentVariables.h | /*
* Copyright (C) 2015 BMW Car IT GmbH
*
* 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 CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
#define CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
#include <capu/os/Generic/EnvironmentVariables.h>
namespace capu
{
namespace os
{
class EnvironmentVariables: private capu::generic::EnvironmentVariables
{
public:
using capu::generic::EnvironmentVariables::getAll;
static bool get(const String& key, String& value);
};
inline
bool EnvironmentVariables::get(const String& key, String& value)
{
char* envValue = 0;
bool found = (0 == _dupenv_s(&envValue, 0, key.c_str()));
value = envValue;
free(envValue);
return found;
}
}
}
#endif // CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
| /*
* Copyright (C) 2015 BMW Car IT GmbH
*
* 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 CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
#define CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
#include <capu/os/Generic/EnvironmentVariables.h>
namespace capu
{
namespace os
{
class EnvironmentVariables: private capu::generic::EnvironmentVariables
{
public:
using capu::generic::EnvironmentVariables::getAll;
static bool get(const String& key, String& value);
};
inline
bool EnvironmentVariables::get(const String& key, String& value)
{
char* envValue = 0;
errno_t err = _dupenv_s(&envValue, 0, key.c_str());
bool found = (err == 0 && envValue != 0);
value = envValue;
free(envValue);
return found;
}
}
}
#endif // CAPU_WINDOWS_ENVIRONMENTVARIABLES_H
| Fix enviroment variable getter on windows | Fix enviroment variable getter on windows
found result was always true because condition only checked error code,
not if there is really a value
Change-Id: Ie8b8edab0419c629dd558ce9b5466a582de359f8
| C | apache-2.0 | bmwcarit/capu,bmwcarit/capu |
96e593920711c2b6cecace99061d02d1b8738f10 | LYCategory/_Foundation/_Fix/NSNumber+Fix.h | LYCategory/_Foundation/_Fix/NSNumber+Fix.h | //
// NSNumber+Fix.h
// LYCategory
//
// Created by Rick Luo on 11/25/13.
// Copyright (c) 2013 Luo Yu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSNumber (Fix)
- (id)objectAtIndex:(NSUInteger)index;
- (id)objectForKey:(id)aKey;
- (BOOL)isEqualToString:(NSString *)aString;
- (NSUInteger)length;
- (NSString *)string;
@end
| //
// NSNumber+Fix.h
// LYCategory
//
// Created by Rick Luo on 11/25/13.
// Copyright (c) 2013 Luo Yu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSNumber (Fix)
- (id)objectAtIndex:(NSUInteger)index;
- (id)objectForKey:(id)aKey;
- (BOOL)isEqualToString:(NSString *)aString;
- (NSUInteger)length;
- (NSString *)string;
- (BOOL)isReal;
@end
| Fix : is real for number object. | Fix : is real for number object.
| C | mit | blodely/LYCategory,blodely/LYCategory,blodely/LYCategory,blodely/LYCategory |
7363dfbdfb0f51a5a52c1eecdbb847dfcd026f4a | test/asan/TestCases/printf-4.c | test/asan/TestCases/printf-4.c | // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: sprintf is not intercepted on Windows yet.
// XFAIL: win32
#include <stdio.h>
int main() {
volatile char c = '0';
volatile int x = 12;
volatile float f = 1.239;
volatile char s[] = "34";
volatile char buf[2];
puts("before sprintf");
sprintf((char *)buf, "%c %d %.3f %s\n", c, x, f, s);
puts("after sprintf");
puts((const char *)buf);
return 0;
// Check that size of output buffer is sanitized.
// CHECK-ON: before sprintf
// CHECK-ON-NOT: after sprintf
// CHECK-ON: stack-buffer-overflow
// CHECK-ON-NOT: 0 12 1.239 34
}
| // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: sprintf is not intercepted on Windows yet.
// XFAIL: win32
#include <stdio.h>
int main() {
volatile char c = '0';
volatile int x = 12;
volatile float f = 1.239;
volatile char s[] = "34";
volatile char buf[2];
fputs(stderr, "before sprintf");
sprintf((char *)buf, "%c %d %.3f %s\n", c, x, f, s);
fputs(stderr, "after sprintf");
fputs(stderr, (const char *)buf);
return 0;
// Check that size of output buffer is sanitized.
// CHECK-ON: before sprintf
// CHECK-ON-NOT: after sprintf
// CHECK-ON: stack-buffer-overflow
// CHECK-ON-NOT: 0 12 1.239 34
}
| Switch to fputs stderr to try to fix output buffering issues | Switch to fputs stderr to try to fix output buffering issues
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@263293 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 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.