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
|
---|---|---|---|---|---|---|---|---|---|
8a89ea553494c0ca429a57f792a097adb1f25ce2 | Sources/ObjectiveChain.h | Sources/ObjectiveChain.h | //
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
| //
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
#import "OCAConnection.h"
#import "OCAProducer.h"
| Add first classes to umbrella header | Add first classes to umbrella header
| C | mit | Tricertops/Objective-Chain,iMartinKiss/Objective-Chain |
97d3b3cf2a7b220c34f7b467129fe9de8558e2be | utils/metatag.c | utils/metatag.c | /* metatag.c: Program for adding metadata to a file
* By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap,
* Connie Yu
*
* 2014/06/06
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv){
char* buffer;
int fd, i, len;
if(argc < 3){
fprintf(stderr, "Usage: metatag FILE TAG\n");
exit(1);
}
fd=open(argv[1], O_RDWR);
if(fd == -1){
fprintf(stderr, "Error, file not found\n");
exit(1);
}
buffer = "";
for(i=2; i<argc; i++){
strcat(buffer, argv[i]);
strcat(buffer, " ");
}
len = strlen(buffer);
metawrite(fd,&buffer,len);
close(fd);
return 0;
}
| /* metatag.c: Program for adding metadata to a file
* By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap,
* Connie Yu
*
* 2014/06/06
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN 1024
int main(int argc, char** argv){
char* buffer;
int fd, i, len;
if(argc < 3){
fprintf(stderr, "Usage: metatag FILE TAG\n");
exit(1);
}
fd=open(argv[1], O_RDWR);
if(fd == -1){
fprintf(stderr, "Error, file not found\n");
exit(1);
}
buffer = "";
for(i=2; i<argc; i++){
strcat(buffer, argv[i]);
strcat(buffer, " ");
}
len = strlen(buffer);
if(len > MAX_LEN-1){
fprintf(stderr, "Input stream exceeds max length\n");
exit(1);
}
metawrite(fd,&buffer,len);
close(fd);
return 0;
}
| Add max length error check | Add max length error check
| C | mit | dmtaylor/cmps111-proj4,dmtaylor/cmps111-proj4 |
b8b9c29202e0ab25889fc745d3e5f7f99c3e9624 | regs_amd64.h | regs_amd64.h | // Offset of each register in the register map,
// as it's saved by asm_entry_amd64.s
#pragma once
#define RAX 0x00
#define RBX 0x08
#define RCX 0x10
#define RDX 0x18
#define RSI 0x20
#define RDI 0x28
#define R8 0x30
#define R9 0x38
#define R10 0x40
#define R11 0x48
#define R12 0x50
#define R13 0x58
#define R14 0x60
#define R15 0x68
#define XMM0 0x70
#define XMM1 0x80
#define XMM2 0x90
#define XMM3 0xA0
#define XMM4 0xB0
#define XMM5 0xC0
#define XMM6 0xE0
#define XMM7 0xF0
| // Offset of each register in the register map,
// as it's saved by asm_entry_amd64.s
#pragma once
#define RAX 0x00
#define RBX 0x08
#define RCX 0x10
#define RDX 0x18
#define RSI 0x20
#define RDI 0x28
#define R8 0x30
#define R9 0x38
#define R10 0x40
#define R11 0x48
#define R12 0x50
#define R13 0x58
#define R14 0x60
#define R15 0x68
#define XMM0 0x70
#define XMM1 0x80
#define XMM2 0x90
#define XMM3 0xA0
#define XMM4 0xB0
#define XMM5 0xC0
#define XMM6 0xD0
#define XMM7 0xE0
| Fix one more register addressing bug | Fix one more register addressing bug
| C | mit | yamnikov-oleg/cgo-callback,yamnikov-oleg/cgo-callback |
605871452bcb4c742ed960c09d518be03b349cf3 | base/inc/TVersionCheck.h | base/inc/TVersionCheck.h | // @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.2 2007/05/10 16:04:32 rdm Exp $
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_RVersion
#include "RVersion.h"
#endif
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
#endif
| // @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.3 2007/05/10 18:16:58 rdm Exp $
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_RVersion
#include "RVersion.h"
#endif
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
#ifndef __CINT__
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
#endif
#endif
| Hide a static function to CINT. With this fix g4root compiles OK. | Hide a static function to CINT. With this fix g4root compiles OK.
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@18737 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | simonpf/root,jrtomps/root,tc3t/qoot,vukasinmilosevic/root,mkret2/root,0x0all/ROOT,root-mirror/root,root-mirror/root,Dr15Jones/root,omazapa/root-old,esakellari/root,mhuwiler/rootauto,esakellari/my_root_for_test,nilqed/root,mkret2/root,cxx-hep/root-cern,olifre/root,lgiommi/root,satyarth934/root,gbitzes/root,davidlt/root,karies/root,Duraznos/root,perovic/root,dfunke/root,davidlt/root,bbockelm/root,Duraznos/root,beniz/root,mattkretz/root,CristinaCristescu/root,abhinavmoudgil95/root,beniz/root,gbitzes/root,sawenzel/root,0x0all/ROOT,olifre/root,lgiommi/root,lgiommi/root,abhinavmoudgil95/root,lgiommi/root,nilqed/root,zzxuanyuan/root,zzxuanyuan/root,sirinath/root,zzxuanyuan/root,Y--/root,alexschlueter/cern-root,esakellari/root,buuck/root,perovic/root,arch1tect0r/root,kirbyherm/root-r-tools,mhuwiler/rootauto,strykejern/TTreeReader,karies/root,ffurano/root5,esakellari/root,omazapa/root,georgtroska/root,bbockelm/root,simonpf/root,cxx-hep/root-cern,sbinet/cxx-root,pspe/root,dfunke/root,root-mirror/root,bbockelm/root,sbinet/cxx-root,zzxuanyuan/root,agarciamontoro/root,BerserkerTroll/root,gganis/root,root-mirror/root,omazapa/root-old,ffurano/root5,root-mirror/root,0x0all/ROOT,beniz/root,zzxuanyuan/root,gbitzes/root,arch1tect0r/root,vukasinmilosevic/root,arch1tect0r/root,gganis/root,pspe/root,esakellari/my_root_for_test,sirinath/root,lgiommi/root,alexschlueter/cern-root,Y--/root,Duraznos/root,zzxuanyuan/root-compressor-dummy,mkret2/root,vukasinmilosevic/root,krafczyk/root,evgeny-boger/root,karies/root,smarinac/root,gganis/root,alexschlueter/cern-root,CristinaCristescu/root,Y--/root,dfunke/root,sawenzel/root,georgtroska/root,agarciamontoro/root,pspe/root,omazapa/root,agarciamontoro/root,abhinavmoudgil95/root,olifre/root,olifre/root,lgiommi/root,georgtroska/root,strykejern/TTreeReader,pspe/root,mattkretz/root,evgeny-boger/root,root-mirror/root,veprbl/root,Dr15Jones/root,omazapa/root-old,smarinac/root,sawenzel/root,mhuwiler/rootauto,Duraznos/root,gganis/root,gganis/root,lgiommi/root,CristinaCristescu/root,BerserkerTroll/root,simonpf/root,davidlt/root,nilqed/root,georgtroska/root,root-mirror/root,evgeny-boger/root,sawenzel/root,cxx-hep/root-cern,mattkretz/root,zzxuanyuan/root-compressor-dummy,olifre/root,thomaskeck/root,esakellari/root,mattkretz/root,karies/root,omazapa/root,omazapa/root-old,mattkretz/root,BerserkerTroll/root,pspe/root,bbockelm/root,simonpf/root,sirinath/root,davidlt/root,zzxuanyuan/root-compressor-dummy,alexschlueter/cern-root,Duraznos/root,agarciamontoro/root,mattkretz/root,abhinavmoudgil95/root,BerserkerTroll/root,karies/root,mkret2/root,vukasinmilosevic/root,gbitzes/root,buuck/root,kirbyherm/root-r-tools,CristinaCristescu/root,veprbl/root,krafczyk/root,sbinet/cxx-root,bbockelm/root,thomaskeck/root,BerserkerTroll/root,karies/root,esakellari/my_root_for_test,Dr15Jones/root,kirbyherm/root-r-tools,esakellari/root,abhinavmoudgil95/root,gbitzes/root,smarinac/root,sawenzel/root,Y--/root,lgiommi/root,omazapa/root,Y--/root,pspe/root,gbitzes/root,jrtomps/root,dfunke/root,sawenzel/root,cxx-hep/root-cern,olifre/root,mkret2/root,gbitzes/root,sirinath/root,esakellari/my_root_for_test,georgtroska/root,cxx-hep/root-cern,0x0all/ROOT,kirbyherm/root-r-tools,strykejern/TTreeReader,beniz/root,veprbl/root,Dr15Jones/root,perovic/root,mhuwiler/rootauto,sbinet/cxx-root,davidlt/root,evgeny-boger/root,esakellari/root,agarciamontoro/root,buuck/root,zzxuanyuan/root,satyarth934/root,pspe/root,zzxuanyuan/root,krafczyk/root,georgtroska/root,veprbl/root,abhinavmoudgil95/root,karies/root,georgtroska/root,satyarth934/root,buuck/root,thomaskeck/root,arch1tect0r/root,perovic/root,esakellari/my_root_for_test,dfunke/root,Duraznos/root,ffurano/root5,root-mirror/root,ffurano/root5,mattkretz/root,mattkretz/root,evgeny-boger/root,sirinath/root,mhuwiler/rootauto,gbitzes/root,arch1tect0r/root,Duraznos/root,thomaskeck/root,root-mirror/root,gganis/root,esakellari/root,abhinavmoudgil95/root,pspe/root,olifre/root,beniz/root,lgiommi/root,sirinath/root,BerserkerTroll/root,smarinac/root,smarinac/root,gganis/root,georgtroska/root,zzxuanyuan/root,agarciamontoro/root,olifre/root,dfunke/root,strykejern/TTreeReader,0x0all/ROOT,zzxuanyuan/root,bbockelm/root,satyarth934/root,krafczyk/root,0x0all/ROOT,mhuwiler/rootauto,mhuwiler/rootauto,sbinet/cxx-root,kirbyherm/root-r-tools,gbitzes/root,tc3t/qoot,mhuwiler/rootauto,Y--/root,alexschlueter/cern-root,sawenzel/root,esakellari/my_root_for_test,vukasinmilosevic/root,beniz/root,karies/root,georgtroska/root,nilqed/root,bbockelm/root,olifre/root,smarinac/root,zzxuanyuan/root-compressor-dummy,evgeny-boger/root,Y--/root,sirinath/root,simonpf/root,abhinavmoudgil95/root,beniz/root,vukasinmilosevic/root,krafczyk/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,veprbl/root,veprbl/root,buuck/root,alexschlueter/cern-root,esakellari/my_root_for_test,perovic/root,dfunke/root,veprbl/root,root-mirror/root,olifre/root,mkret2/root,omazapa/root,abhinavmoudgil95/root,mattkretz/root,sbinet/cxx-root,CristinaCristescu/root,karies/root,agarciamontoro/root,dfunke/root,root-mirror/root,mattkretz/root,bbockelm/root,buuck/root,sbinet/cxx-root,karies/root,beniz/root,lgiommi/root,CristinaCristescu/root,mkret2/root,buuck/root,dfunke/root,smarinac/root,tc3t/qoot,gganis/root,beniz/root,lgiommi/root,omazapa/root,CristinaCristescu/root,gganis/root,zzxuanyuan/root,esakellari/my_root_for_test,sawenzel/root,nilqed/root,georgtroska/root,mhuwiler/rootauto,CristinaCristescu/root,perovic/root,Dr15Jones/root,BerserkerTroll/root,zzxuanyuan/root,kirbyherm/root-r-tools,mattkretz/root,veprbl/root,Y--/root,olifre/root,mkret2/root,satyarth934/root,zzxuanyuan/root-compressor-dummy,nilqed/root,davidlt/root,simonpf/root,krafczyk/root,esakellari/my_root_for_test,sirinath/root,Duraznos/root,beniz/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,smarinac/root,cxx-hep/root-cern,veprbl/root,esakellari/root,thomaskeck/root,simonpf/root,strykejern/TTreeReader,omazapa/root,davidlt/root,agarciamontoro/root,simonpf/root,krafczyk/root,zzxuanyuan/root,perovic/root,BerserkerTroll/root,jrtomps/root,Dr15Jones/root,thomaskeck/root,bbockelm/root,CristinaCristescu/root,pspe/root,nilqed/root,zzxuanyuan/root-compressor-dummy,davidlt/root,sbinet/cxx-root,satyarth934/root,sawenzel/root,simonpf/root,esakellari/root,georgtroska/root,davidlt/root,perovic/root,tc3t/qoot,omazapa/root,tc3t/qoot,sirinath/root,kirbyherm/root-r-tools,jrtomps/root,CristinaCristescu/root,perovic/root,krafczyk/root,tc3t/qoot,jrtomps/root,vukasinmilosevic/root,omazapa/root-old,arch1tect0r/root,nilqed/root,Duraznos/root,mhuwiler/rootauto,arch1tect0r/root,sawenzel/root,davidlt/root,omazapa/root-old,omazapa/root,esakellari/root,buuck/root,mkret2/root,sawenzel/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,jrtomps/root,krafczyk/root,bbockelm/root,evgeny-boger/root,evgeny-boger/root,omazapa/root-old,tc3t/qoot,karies/root,sbinet/cxx-root,vukasinmilosevic/root,Dr15Jones/root,mhuwiler/rootauto,tc3t/qoot,thomaskeck/root,Y--/root,arch1tect0r/root,tc3t/qoot,omazapa/root-old,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,krafczyk/root,omazapa/root-old,agarciamontoro/root,evgeny-boger/root,omazapa/root-old,vukasinmilosevic/root,agarciamontoro/root,arch1tect0r/root,nilqed/root,mkret2/root,gbitzes/root,thomaskeck/root,esakellari/root,alexschlueter/cern-root,0x0all/ROOT,thomaskeck/root,jrtomps/root,nilqed/root,dfunke/root,strykejern/TTreeReader,Duraznos/root,Duraznos/root,gbitzes/root,omazapa/root,tc3t/qoot,jrtomps/root,strykejern/TTreeReader,cxx-hep/root-cern,BerserkerTroll/root,satyarth934/root,simonpf/root,ffurano/root5,Y--/root,CristinaCristescu/root,evgeny-boger/root,omazapa/root,sbinet/cxx-root,krafczyk/root,buuck/root,dfunke/root,davidlt/root,ffurano/root5,nilqed/root,buuck/root,smarinac/root,abhinavmoudgil95/root,buuck/root,thomaskeck/root,Y--/root,smarinac/root,jrtomps/root,pspe/root,cxx-hep/root-cern,ffurano/root5,pspe/root,gganis/root,sirinath/root,BerserkerTroll/root,sirinath/root,satyarth934/root,gganis/root,mkret2/root,simonpf/root,veprbl/root,perovic/root,jrtomps/root,beniz/root,esakellari/my_root_for_test,arch1tect0r/root,veprbl/root,arch1tect0r/root,satyarth934/root,vukasinmilosevic/root,perovic/root,BerserkerTroll/root,vukasinmilosevic/root,omazapa/root-old,evgeny-boger/root,sbinet/cxx-root,agarciamontoro/root,0x0all/ROOT,satyarth934/root,0x0all/ROOT,satyarth934/root |
c44c18c4d13d6fde1d38e603f00029deaf7ff002 | src/libc4/include/util/error.h | src/libc4/include/util/error.h | #ifndef ERROR_H
#define ERROR_H
/*
* Note that we include "fmt" in the variadic argument list, because C99
* apparently doesn't allow variadic macros to be invoked without any vargs
* parameters.
*/
#define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__)
#define FAIL() simple_error(__FILE__, __LINE__)
#define FAIL_APR(s) apr_error((s), __FILE__, __LINE__)
#define FAIL_SQLITE(c) sqlite_error((c), __FILE__, __LINE__)
#ifdef ASSERT_ENABLED
#define ASSERT(cond) \
do { \
if (!(cond)) \
assert_fail(APR_STRINGIFY(cond), __FILE__, __LINE__); \
} while (0)
#else
#define ASSERT(cond)
#endif
void apr_error(apr_status_t s, const char *file, int line_num) __attribute__((noreturn));
void sqlite_error(C4Runtime *c4, const char *file, int line_num) __attribute__((noreturn));
void simple_error(const char *file, int line_num) __attribute__((noreturn));
void var_error(const char *file, int line_num,
const char *fmt, ...) __attribute__((format(printf, 3, 4), noreturn));
void assert_fail(const char *cond, const char *file, int line_num) __attribute__((noreturn));
#endif /* ERROR_H */
| #ifndef ERROR_H
#define ERROR_H
/*
* Note that we include "fmt" in the variadic argument list, because C99
* apparently doesn't allow variadic macros to be invoked without any vargs
* parameters.
*/
#define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__)
#define FAIL() simple_error(__FILE__, __LINE__)
#define FAIL_APR(s) apr_error((s), __FILE__, __LINE__)
#define FAIL_SQLITE(c) sqlite_error((c), __FILE__, __LINE__)
#ifdef C4_ASSERT_ENABLED
#define ASSERT(cond) \
do { \
if (!(cond)) \
assert_fail(APR_STRINGIFY(cond), __FILE__, __LINE__); \
} while (0)
#else
#define ASSERT(cond)
#endif
void apr_error(apr_status_t s, const char *file, int line_num) __attribute__((noreturn));
void sqlite_error(C4Runtime *c4, const char *file, int line_num) __attribute__((noreturn));
void simple_error(const char *file, int line_num) __attribute__((noreturn));
void var_error(const char *file, int line_num,
const char *fmt, ...) __attribute__((format(printf, 3, 4), noreturn));
void assert_fail(const char *cond, const char *file, int line_num) __attribute__((noreturn));
#endif /* ERROR_H */
| Fix braindamage: assertions were not enabled in debug builds. | Fix braindamage: assertions were not enabled in debug builds.
| C | mit | bloom-lang/c4,bloom-lang/c4,bloom-lang/c4 |
42d51980ef24c2e9b93fcfd2d3aa8c0e50dc27a7 | CefSharp.Core/RequestContext.h | CefSharp.Core/RequestContext.h | // Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "Internals\MCefRefPtr.h"
#include "RequestContextSettings.h"
#include "include\cef_request_context.h"
using namespace CefSharp;
namespace CefSharp
{
public ref class RequestContext
{
private:
MCefRefPtr<CefRequestContext> _requestContext;
RequestContextSettings^ _settings;
public:
RequestContext()
{
CefRequestContextSettings settings;
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
RequestContext(RequestContextSettings^ settings) : _settings(settings)
{
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
!RequestContext()
{
_requestContext = NULL;
}
~RequestContext()
{
this->!RequestContext();
delete _settings;
}
operator CefRefPtr<CefRequestContext>()
{
return _requestContext.get();
}
};
} | // Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "Internals\MCefRefPtr.h"
#include "RequestContextSettings.h"
#include "include\cef_request_context.h"
using namespace CefSharp;
namespace CefSharp
{
public ref class RequestContext
{
private:
MCefRefPtr<CefRequestContext> _requestContext;
RequestContextSettings^ _settings;
public:
RequestContext()
{
CefRequestContextSettings settings;
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
RequestContext(RequestContextSettings^ settings) : _settings(settings)
{
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
!RequestContext()
{
_requestContext = NULL;
}
~RequestContext()
{
this->!RequestContext();
delete _settings;
}
operator CefRefPtr<CefRequestContext>()
{
if(this == nullptr)
{
return NULL;
}
return _requestContext.get();
}
};
} | Add nullptr check and return NULL for implicitor operator when object is not initialized | Add nullptr check and return NULL for implicitor operator when object is not initialized
| C | bsd-3-clause | jamespearce2006/CefSharp,dga711/CefSharp,twxstar/CefSharp,battewr/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,windygu/CefSharp,joshvera/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,VioletLife/CefSharp,battewr/CefSharp,NumbersInternational/CefSharp,Haraguroicha/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,AJDev77/CefSharp,windygu/CefSharp,illfang/CefSharp,dga711/CefSharp,dga711/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,Livit/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,zhangjingpu/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,AJDev77/CefSharp,Livit/CefSharp,ruisebastiao/CefSharp,dga711/CefSharp,AJDev77/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,ruisebastiao/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,Haraguroicha/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,ITGlobal/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp |
f606322980ae5739c9358a5b374da676ce796627 | include/common.h | include/common.h | /**
* common.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_COMMON_H
#define GIT_STASHD_COMMON_H
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NOOPT_FOUND_V -1
#define CLEAN_CATCH_V -2
#endif
| /**
* common.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_COMMON_H
#define GIT_STASHD_COMMON_H
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NULL_BYTE 1
#define NOT_FOUND -1
#define ERR_CATCH -2
#endif
| Add NULL_BYTE macro, rename others | Add NULL_BYTE macro, rename others
| C | mit | nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd |
3fbbffc2c6a09a8faffcbd40645029d41d1044ad | test/default/cmptest.h | test/default/cmptest.h |
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp_out;
int c;
if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
perror("fopen(" TEST_NAME_RES ")");
return 99;
}
if (sodium_init() != 0) {
return 99;
}
xmain();
rewind(fp_res);
if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
perror("fopen(" TEST_NAME_OUT ")");
return 99;
}
do {
if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
return 99;
}
} while (c != EOF);
return 0;
}
#undef printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain
#endif
|
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp_out;
int c;
if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
perror("fopen(" TEST_NAME_RES ")");
return 99;
}
if (sodium_init() != 0) {
return 99;
}
if (xmain() != 0) {
return 99;
}
rewind(fp_res);
if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
perror("fopen(" TEST_NAME_OUT ")");
return 99;
}
do {
if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
return 99;
}
} while (c != EOF);
return 0;
}
#undef printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain
#endif
| Check xmain() return code in tests. | Check xmain() return code in tests.
| C | isc | Payshare/libsodium,Payshares/libsodium,donpark/libsodium,netroby/libsodium,mvduin/libsodium,akkakks/libsodium,Payshares/libsodium,tml/libsodium,donpark/libsodium,pmienk/libsodium,akkakks/libsodium,optedoblivion/android_external_libsodium,GreatFruitOmsk/libsodium,paragonie-scott/libsodium,donpark/libsodium,GreatFruitOmsk/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,JackWink/libsodium,JackWink/libsodium,pyparallel/libsodium,pmienk/libsodium,rustyhorde/libsodium,soumith/libsodium,Payshare/libsodium,paragonie-scott/libsodium,soumith/libsodium,netroby/libsodium,eburkitt/libsodium,HappyYang/libsodium,pyparallel/libsodium,eburkitt/libsodium,pyparallel/libsodium,kytvi2p/libsodium,soumith/libsodium,rustyhorde/libsodium,zhuqling/libsodium,zhuqling/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,pmienk/libsodium,Payshares/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,SpiderOak/libsodium,tml/libsodium,Payshare/libsodium,SpiderOak/libsodium,optedoblivion/android_external_libsodium,GreatFruitOmsk/libsodium,HappyYang/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,akkakks/libsodium,mvduin/libsodium,paragonie-scott/libsodium,rustyhorde/libsodium,tml/libsodium,eburkitt/libsodium,zhuqling/libsodium,netroby/libsodium,kytvi2p/libsodium,JackWink/libsodium,akkakks/libsodium,optedoblivion/android_external_libsodium,SpiderOak/libsodium,rustyhorde/libsodium,mvduin/libsodium,HappyYang/libsodium |
a67b4a35ab897730d7847a96ca4b20925e0c7c38 | test/profile/instrprof-error.c | test/profile/instrprof-error.c | // RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE="%t/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
| // RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE=%t/ LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
| Remove quotes around env variable, NFC | [profile] Remove quotes around env variable, NFC
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@264824 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 |
f8c8f68c19c6fdb074047ebd0d05f5595a6a5686 | src/output/output_hls.h | src/output/output_hls.h | #include "output_http.h"
#include "output_ts_base.h"
namespace Mist{
class OutHLS : public TSOutput{
public:
OutHLS(Socket::Connection &conn);
~OutHLS();
static void init(Util::Config *cfg);
void sendTS(const char *tsData, size_t len = 188);
void sendNext();
void onHTTP();
bool isReadyForPlay();
virtual void onFail(const std::string &msg, bool critical = false);
protected:
std::string h264init(const std::string &initData);
std::string h265init(const std::string &initData);
bool hasSessionIDs(){return !config->getBool("mergesessions");}
std::string liveIndex();
std::string liveIndex(size_t tid, const std::string &sessId);
size_t vidTrack;
size_t audTrack;
uint64_t until;
};
}// namespace Mist
typedef Mist::OutHLS mistOut;
| #include "output_http.h"
#include "output_ts_base.h"
namespace Mist{
class OutHLS : public TSOutput{
public:
OutHLS(Socket::Connection &conn);
~OutHLS();
static void init(Util::Config *cfg);
void sendTS(const char *tsData, size_t len = 188);
void sendNext();
void onHTTP();
bool isReadyForPlay();
virtual void onFail(const std::string &msg, bool critical = false);
virtual std::string getStatsName(){return Output::getStatsName();}
protected:
std::string h264init(const std::string &initData);
std::string h265init(const std::string &initData);
bool hasSessionIDs(){return !config->getBool("mergesessions");}
std::string liveIndex();
std::string liveIndex(size_t tid, const std::string &sessId);
size_t vidTrack;
size_t audTrack;
uint64_t until;
};
}// namespace Mist
typedef Mist::OutHLS mistOut;
| Fix HLS being seen as input during init | Fix HLS being seen as input during init
| C | unlicense | DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver |
21dbe15f7dd0f0511bc0178d142213c3fadfcb99 | arch/arm/mach-w90x900/include/mach/regs-usb.h | arch/arm/mach-w90x900/include/mach/regs-usb.h | /*
* arch/arm/mach-w90x900/include/mach/regs-usb.h
*
* Copyright (c) 2008 Nuvoton technology corporation.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation;version 2 of the License.
*
*/
#ifndef __ASM_ARCH_REGS_USB_H
#define __ASM_ARCH_REGS_USB_H
/* usb Control Registers */
#define USBH_BA W90X900_VA_USBEHCIHOST
#define USBD_BA W90X900_VA_USBDEV
#define USBO_BA W90X900_VA_USBOHCIHOST
/* USB Host Control Registers */
#define REG_UPSCR0 (USBH_BA+0x064)
#define REG_UPSCR1 (USBH_BA+0x068)
#define REG_USBPCR0 (USBH_BA+0x0C4)
#define REG_USBPCR1 (USBH_BA+0x0C8)
/* USBH OHCI Control Registers */
#define REG_OpModEn (USBO_BA+0x204)
/*This bit controls the polarity of over
*current flag from external power IC.
*/
#define OCALow 0x08
#endif /* __ASM_ARCH_REGS_USB_H */
| Add Usb register controller header file dfine | [ARM] 5499/1: Add Usb register controller header file dfine
Add Usb register controller header file dfine.
w90p910 usb ip is standard,but some mutifunction
controll pin must be special define in w90p910
Signed-off-by: Wan ZongShun <7d90017055ae88f9b614c1a99b7a29176cffa725@gmail.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
|
4eaa650e89278c8f6e3defd636433629d6bc2770 | src/main/entity/components/SkillComponent.h | src/main/entity/components/SkillComponent.h | #ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
/**
* Enumeration for identifying different skills.
*/
enum skill_t {
Melee,
Swords,
BastardSword,
Maces,
SpikedMace,
FirstAid
};
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
skill_t skill; ///< The type of skill
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
#endif
| #ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
/**
* Enumeration for identifying different skills.
*/
enum skill_t {
NOSKILL,
Melee,
Swords,
BastardSword,
Maces,
SpikedMace,
FirstAid
};
/**
* This array defines our parent skill relationships.
*
* If a skill's parent is NOSKILL, it has no parent.
*/
const skill_t* PARENT_SKILLS = { NOSKILL, NOSKILL, Melee, Swords, Melee, Maces, NOSKILL };
#endif
| Add NOSKILL skill type, remove from component | Add NOSKILL skill type, remove from component
The component will be going into a MultiComponentManager, so it will already be indexed by skill_t; storing skill_t in the component as well is redundant, unnecessary, and redundant.
| C | mit | Kromey/roglick |
631e13f0aac39105f7837035cffccf9c48fe16ab | mc/inc/LinkDef.h | mc/inc/LinkDef.h | // @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ global gMC;
#pragma link C++ enum PDG_t;
#pragma link C++ enum TMCProcess;
#pragma link C++ class TVirtualMC+;
#pragma link C++ class TVirtualMCApplication+;
#pragma link C++ class TVirtualMCStack+;
#pragma link C++ class TVirtualMCDecayer+;
#endif
| // @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ global gMC;
#pragma link C++ enum PDG_t;
#pragma link C++ enum TMCProcess;
#pragma link C++ class TVirtualMC+;
#pragma link C++ class TVirtualMCApplication+;
#pragma link C++ class TVirtualMCStack+;
#pragma link C++ class TVirtualMCDecayer+;
#pragma link C++ class TMCVerbose+;
#endif
| Add TMCVerbose to the list of mc classes | Add TMCVerbose to the list of mc classes
git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@6190 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | dawehner/root,bbannier/ROOT,dawehner/root,dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT |
5f5f1422181bf195aafc27e30339d5960a787f7a | main.c | main.c | #include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"
void entry(void) {
pic_remap(IRQ0, IRQ8);
pic_set_masks(0, 0);
gdt_init((struct GDT *)(0x500));
idt_init((struct IDT *)(0x500 + sizeof(struct GDT)));
__asm__ __volatile__ ("sti");
screen_init();
__asm__ __volatile__ ("int $0x50");
for(;;) { __asm__ __volatile__ ("hlt"); }
}
| #include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"
void entry(void) {
pic_remap(IRQ0, IRQ8);
pic_set_masks(0, 0);
idt_init((struct IDT *)(0x500));
gdt_init((struct GDT *)(0x500 + sizeof(struct IDT)));
__asm__ __volatile__ ("sti");
screen_init();
__asm__ __volatile__ ("int $0x50");
for(;;) { __asm__ __volatile__ ("hlt"); }
}
| Set up IDT first to ensure exceptions are handled | Set up IDT first to ensure exceptions are handled
| C | apache-2.0 | shockkolate/shockk-os,shockkolate/shockk-os,shockkolate/shockk-os |
10fbce820f580d058bdfb1ab89cf01a027da3161 | gitst.c | gitst.c |
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#define GITBUF 2048
int
main(int argc, char **argv)
{
int pid, ret;
int pipes[2];
char gitbuff[GITBUF];
size_t gitlen;
char b;
char *br;
int childst;
if(pipe(pipes) != 0)
{
perror("Error creating pipes");
exit(1);
}
if((pid = fork()) == -1)
{
perror("Error forking git");
exit(1);
}
if(pid == 0) //child
{
if(dup2(pipes[1], STDOUT_FILENO) == -1)
{
perror("Error duplicating stdout");
exit(1);
}
close(STDERR_FILENO);
ret = execlp("git", "git", "status", "-z", "-b", (char*)0);
}
waitpid(pid, &childst, 0);
if(childst != 0) {
exit(2);
}
gitlen = read(pipes[0], gitbuff, GITBUF);
br = &gitbuff[3];
putchar('(');
while(*br != '\0')
{
// Three dots separate the branch from the tracking branch
if(*br == '.' && *(br+1) == '.' && *(br+2) == '.') break;
putchar(*br++);
}
putchar(')');
putchar('\n');
}
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#define GITBUF 2048
int
main(int argc, char **argv)
{
int pid, ret;
int pipes[2];
char gitbuff[GITBUF];
size_t gitlen;
char b;
char *br;
int childst;
if(pipe(pipes) != 0)
{
perror("Error creating pipes");
exit(1);
}
if((pid = fork()) == -1)
{
perror("Error forking git");
exit(1);
}
if(pid == 0) //child
{
if(dup2(pipes[1], STDOUT_FILENO) == -1)
{
perror("Error duplicating stdout");
exit(1);
}
close(STDERR_FILENO);
ret = execlp("git", "git", "branch", "--list", (char*)0);
}
waitpid(pid, &childst, 0);
if(childst != 0) {
exit(2);
}
gitlen = read(pipes[0], gitbuff, GITBUF);
br = gitbuff;
putchar('(');
while(*br++ != '*') {}
// skip the '*' and the space after it
br++;
while(*br != '\n')
{
putchar(*br++);
}
putchar(')');
putchar('\n');
}
| Convert to `git branch` for performance | Convert to `git branch` for performance
- Using `git status` is eificient to get only the current branch but in
a repo with a large number of untracked files it can stall for a long
time getting the status of a repository. Git Branch is much better in
these cases.
| C | bsd-3-clause | wnh/prompt_utils |
df717db1600e062dcd96be7ba4ae431252d578dd | test2/float/call/many_floats.c | test2/float/call/many_floats.c | // RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n",
5,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3); // this causes an infinite loop in glibc's printf()
printf("Hello %d %.1f\n",
5,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3, // this causes an infinite loop in glibc's printf()
2.3); // and this causes a crash
// suspect the bug is to do with double alignment when passed as stack arguments
return 0;
}
| // RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n"
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
5,
5.9,
7.3,
8.7,
10.1,
11.5,
12.9,
14.3,
15.7,
17.1,
18.5,
19.9); // this causes an infinite loop in glibc's printf()
printf("Hello %d %.1f\n"
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
5,
15.7,
14.3,
12.9,
11.5,
10.1,
8.7,
7.3,
5.9,
4.5,
3.1,
1.7, // this causes an infinite loop in glibc's printf()
0.3); // and this causes a crash
// suspect the bug is to do with double alignment when passed as stack arguments
return 0;
}
| Format strings and more through test for stack floats | Format strings and more through test for stack floats
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
7ba01aa3a21bd1edb41e5639584f153d694b967a | test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h | test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h | /*
*
* Copyright 2018 gRPC 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 TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#define TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#include <memory>
#include <string>
#include <grpcpp/grpcpp.h>
namespace grpc {
namespace gcp {
// If max_expected_concurrent_rpcs is non-zero, the fake handshake service
// will track the number of concurrent RPCs that it handles and abort
// if if ever exceeds that number.
std::unique_ptr<grpc::Service> CreateFakeHandshakerService(
int max_expected_concurrent_rpcs);
} // namespace gcp
} // namespace grpc
#endif // TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
| /*
*
* Copyright 2018 gRPC 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 TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#define TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#include <memory>
#include <string>
#include <grpcpp/grpcpp.h>
namespace grpc {
namespace gcp {
// If max_expected_concurrent_rpcs is non-zero, the fake handshake service
// will track the number of concurrent RPCs that it handles and abort
// if if ever exceeds that number.
std::unique_ptr<grpc::Service> CreateFakeHandshakerService(
int expected_max_concurrent_rpcs);
} // namespace gcp
} // namespace grpc
#endif // TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
| Fix differing parameter name clang tidy warning | Fix differing parameter name clang tidy warning
| C | apache-2.0 | muxi/grpc,muxi/grpc,vjpai/grpc,ctiller/grpc,nicolasnoble/grpc,firebase/grpc,muxi/grpc,donnadionne/grpc,jtattermusch/grpc,jboeuf/grpc,ctiller/grpc,grpc/grpc,stanley-cheung/grpc,jboeuf/grpc,stanley-cheung/grpc,ejona86/grpc,ejona86/grpc,stanley-cheung/grpc,firebase/grpc,muxi/grpc,stanley-cheung/grpc,nicolasnoble/grpc,grpc/grpc,ctiller/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,muxi/grpc,jtattermusch/grpc,donnadionne/grpc,nicolasnoble/grpc,grpc/grpc,ctiller/grpc,nicolasnoble/grpc,ejona86/grpc,grpc/grpc,jtattermusch/grpc,jtattermusch/grpc,grpc/grpc,ejona86/grpc,nicolasnoble/grpc,stanley-cheung/grpc,stanley-cheung/grpc,muxi/grpc,jtattermusch/grpc,ctiller/grpc,firebase/grpc,jboeuf/grpc,donnadionne/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,ctiller/grpc,nicolasnoble/grpc,jtattermusch/grpc,vjpai/grpc,nicolasnoble/grpc,firebase/grpc,nicolasnoble/grpc,firebase/grpc,vjpai/grpc,ejona86/grpc,ejona86/grpc,jboeuf/grpc,firebase/grpc,donnadionne/grpc,grpc/grpc,grpc/grpc,nicolasnoble/grpc,vjpai/grpc,firebase/grpc,vjpai/grpc,donnadionne/grpc,jboeuf/grpc,firebase/grpc,jboeuf/grpc,grpc/grpc,ctiller/grpc,ejona86/grpc,muxi/grpc,ejona86/grpc,jboeuf/grpc,firebase/grpc,jboeuf/grpc,donnadionne/grpc,stanley-cheung/grpc,nicolasnoble/grpc,vjpai/grpc,firebase/grpc,donnadionne/grpc,donnadionne/grpc,stanley-cheung/grpc,stanley-cheung/grpc,grpc/grpc,jboeuf/grpc,grpc/grpc,vjpai/grpc,nicolasnoble/grpc,ejona86/grpc,jtattermusch/grpc,donnadionne/grpc,ctiller/grpc,donnadionne/grpc,ejona86/grpc,vjpai/grpc,firebase/grpc,jtattermusch/grpc,jtattermusch/grpc,ctiller/grpc,jtattermusch/grpc,muxi/grpc,ejona86/grpc,jboeuf/grpc,stanley-cheung/grpc,vjpai/grpc,muxi/grpc,jtattermusch/grpc,firebase/grpc,muxi/grpc,jboeuf/grpc,stanley-cheung/grpc,jtattermusch/grpc,donnadionne/grpc,nicolasnoble/grpc,muxi/grpc,ctiller/grpc,ejona86/grpc,jboeuf/grpc,vjpai/grpc,muxi/grpc,stanley-cheung/grpc,donnadionne/grpc |
b5707323dd01a74be0169d3550d565b35c2c6ca2 | webkit/glue/webkit_constants.h | webkit/glue/webkit_constants.h | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms. We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops. Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;
// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 0.004;
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
| // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms. We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops. Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;
// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 1.0;
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
| Increase the minimum interval for timers on background tabs to reduce their CPU consumption. | Increase the minimum interval for timers on background tabs to reduce
their CPU consumption.
The new interval is 1000 ms, or once per second. We can easily adjust
this value up or down, but this seems like a reasonable value to judge
the compatibility impact of this change.
BUG=66078
TEST=none (tested manually with minimal test case)
Review URL: http://codereview.chromium.org/6546021
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@75430 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | adobe/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,gavinp/chromium |
73d218160c386019ea849719d36212c06d3962d2 | core/alsp_src/win32/mswin32_config.h | core/alsp_src/win32/mswin32_config.h | /*
* mswin32_config.h Hand made MSWin32 configuration file.
* Copyright (c) 1996 Applied Logic Systems, Inc.
*
* Author: Chuck Houpt
* Creation: 1/30/96
*/
#include "dfltsys.h"
#define MSWin32 1
#define OSStr "mswin32"
#ifdef __GNUC__
#define EXTERNAL_STATE 1
#endif
/* Temp. disable threading until threading GUI stub is fixed */
#ifdef __GNUC__
#define Bytecode 1
#endif
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STRING_H 1
#define HAVE_SRAND 1
#define HAVE_TIME 1
#define HAVE_SOCKET 1
#define BERKELEY_SOCKETS 1
#define HAVE_SELECT 1
#define MISSING_UNIX_DOMAIN_SOCKETS 1
#define APP_PRINTF_CALLBACK 1
#define HAVE_STRCSPN 1
#define HAVE_STRSPN 1
#define HAVE_STRTOK 1
#define REVERSE_ENDIAN 1
/* The windows headers in Cygwin 1.3.4 are missing some prototypes,
so define them here to silence the waring messages. */
#ifdef __GNUC__
extern __inline__ void* GetCurrentFiber(void);
extern __inline__ void* GetFiberData(void);
#endif
#include <winsock2.h>
#include <windows.h>
| /*
* mswin32_config.h Hand made MSWin32 configuration file.
* Copyright (c) 1996 Applied Logic Systems, Inc.
*
* Author: Chuck Houpt
* Creation: 1/30/96
*/
#include "dfltsys.h"
#define MSWin32 1
#define OSStr "mswin32"
#ifdef __GNUC__
#define EXTERNAL_STATE 1
#endif
/* Temp. disable threading until threading GUI stub is fixed */
#ifdef __GNUC__
#define Bytecode 1
#endif
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STRING_H 1
#define HAVE_SRAND 1
#define HAVE_TIME 1
#define HAVE_SOCKET 1
#define BERKELEY_SOCKETS 1
#define HAVE_SELECT 1
#define MISSING_UNIX_DOMAIN_SOCKETS 1
#define APP_PRINTF_CALLBACK 1
#define HAVE_STRCSPN 1
#define HAVE_STRSPN 1
#define HAVE_STRTOK 1
#define REVERSE_ENDIAN 1
#include <winsock2.h>
#include <windows.h>
| Remove defunct missing defs that interfere with CI build | Remove defunct missing defs that interfere with CI build | C | mit | AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog |
19a8fcca4bd4a935f4cb03292046d193176edd7e | chrome/browser/desktop_notification_handler.h | chrome/browser/desktop_notification_handler.h | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/renderer_host/render_view_host_observer.h"
class GURL;
struct DesktopNotificationHostMsg_Show_Params;
// Per-tab Desktop notification handler. Handles desktop notification IPCs
// coming in from the renderer.
class DesktopNotificationHandler : public RenderViewHostObserver {
public:
explicit DesktopNotificationHandler(RenderViewHost* render_view_host);
virtual ~DesktopNotificationHandler();
private:
// RenderViewHostObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message);
// IPC handlers.
void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
void OnCancel(int notification_id);
void OnRequestPermission(const GURL& origin, int callback_id);
private:
DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler);
};
#endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
| // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/renderer_host/render_view_host_observer.h"
class GURL;
struct DesktopNotificationHostMsg_Show_Params;
// Per-tab Desktop notification handler. Handles desktop notification IPCs
// coming in from the renderer.
class DesktopNotificationHandler : public RenderViewHostObserver {
public:
explicit DesktopNotificationHandler(RenderViewHost* render_view_host);
virtual ~DesktopNotificationHandler();
private:
// RenderViewHostObserver implementation.
bool OnMessageReceived(const IPC::Message& message);
// IPC handlers.
void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
void OnCancel(int notification_id);
void OnRequestPermission(const GURL& origin, int callback_id);
private:
DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler);
};
#endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
| Revert 80939 - Fix clang error TBR=jam@chromium.org | Revert 80939 - Fix clang error
TBR=jam@chromium.org
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@80954 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
| C | bsd-3-clause | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser |
0750c7aa88ead737570fe37e825f267b046c5e53 | tos/types/NxIeeeEui64.h | tos/types/NxIeeeEui64.h | /**
* Struct for IEEE EUI64 with network byte order and nx_structs.
*
* @author Raido Pahtma
* @license MIT
*/
#ifndef NXIEEEEUI64_H
#define NXIEEEEUI64_H
#include "IeeeEui64.h"
typedef nx_struct nx_ieee_eui64 {
nx_uint8_t data[IEEE_EUI64_LENGTH];
} nx_ieee_eui64_t;
#endif // NXIEEEEUI64_H
| Add separate file for nx_ieee_eui64, since tinyos-main is unable to support it. | Add separate file for nx_ieee_eui64, since tinyos-main is unable to support it.
| C | mit | thinnect/tos-groundlib,thinnect/tosgroundlib,thinnect/tos-groundlib,thinnect/tosgroundlib |
|
0d3d2c64205b736d86a038b0411e833d77f1581e | lib/grn_report.h | lib/grn_report.h | /* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRN_REPORT_H
#define GRN_REPORT_H
#include "grn_ctx.h"
#ifdef __cplusplus
extern "C" {
#endif
const grn_log_level GRN_REPORT_INDEX_LOG_LEVEL;
void grn_report_index(grn_ctx *ctx,
const char *action,
const char *tag,
grn_obj *index);
#ifdef __cplusplus
}
#endif
#endif /* GRN_REPORT_H */
| /* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRN_REPORT_H
#define GRN_REPORT_H
#include "grn_ctx.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const grn_log_level GRN_REPORT_INDEX_LOG_LEVEL;
void grn_report_index(grn_ctx *ctx,
const char *action,
const char *tag,
grn_obj *index);
#ifdef __cplusplus
}
#endif
#endif /* GRN_REPORT_H */
| Add missing extern to variable in header | Add missing extern to variable in header
This missing extern causes following error in OSX:
```log
...
2403 warnings generated.
CXXLD libgroonga.la
duplicate symbol _GRN_REPORT_INDEX_LOG_LEVEL in:
.libs/db.o
.libs/expr.o
duplicate symbol _GRN_REPORT_INDEX_LOG_LEVEL in:
.libs/db.o
.libs/report.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libgroonga.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
```
| C | lgpl-2.1 | groonga/groonga,cosmo0920/groonga,komainu8/groonga,komainu8/groonga,cosmo0920/groonga,kenhys/groonga,komainu8/groonga,naoa/groonga,cosmo0920/groonga,kenhys/groonga,hiroyuki-sato/groonga,naoa/groonga,groonga/groonga,kenhys/groonga,groonga/groonga,groonga/groonga,komainu8/groonga,kenhys/groonga,hiroyuki-sato/groonga,komainu8/groonga,hiroyuki-sato/groonga,komainu8/groonga,cosmo0920/groonga,naoa/groonga,groonga/groonga,cosmo0920/groonga,cosmo0920/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,kenhys/groonga,komainu8/groonga,kenhys/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,naoa/groonga,kenhys/groonga,groonga/groonga,naoa/groonga,cosmo0920/groonga,komainu8/groonga,naoa/groonga,groonga/groonga,hiroyuki-sato/groonga,groonga/groonga,naoa/groonga,kenhys/groonga,naoa/groonga,cosmo0920/groonga |
4e3196697dce9040ff115cea09c1d422a4691dd8 | src/util/thread_specific.h | src/util/thread_specific.h | /**
* \file thread_specific.h
*
* A thread specific type.
*
* \author eaburns
* \date 2009-07-23
*/
#if !defined(_THREAD_SPECIFIC_H_)
#define _THREAD_SPECIFIC_H_
#include <vector>
using namespace std;
#include "thread.h"
/* To attempt to prevent cache ping-ponging? */
#define PADDING 24 /* bytes */
template <class T>
class ThreadSpecific {
private:
/* Ensure that the array is large enough for [tid] number of
* elements. */
void ensure_size(unsigned int tid)
{
if (tid >= entries.size()) {
struct padded_entry ent;
ent.data = init_val;
entries.resize(tid + 1, ent);
}
}
public:
ThreadSpecific(T iv)
{
init_val = iv;
}
T get_value(void)
{
unsigned int tid = Thread::current()->get_id();
ensure_size(tid);
return entries[tid].data;
}
void set_value(T v)
{
unsigned int tid = Thread::current()->get_id();
ensure_size(tid);
entries[tid].data = v;
}
/**
* Get all entries.
*/
vector<T> get_all_entries(void)
{
typename vector<struct padded_entry>::iterator iter;
vector<T> ret;
for (iter = entries.begin(); iter != entries.end(); iter++)
ret.push_back((*iter).data);
return ret;
}
private:
T init_val;
/* We want to try to get each element of the array on a
* seperate cache line. */
struct padded_entry {
T data;
char padding[PADDING];
};
vector<struct padded_entry> entries;
};
#endif /* !_THREAD_SPECIFIC_H_ */
| Add the thread specific class. | Add the thread specific class.
| C | mit | eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf |
|
b59a3395e6e276e715d9972749ec5c4cefb4157a | chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h | chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/common/extensions/api/cryptotoken_private.h"
#include "extensions/browser/extension_function.h"
// Implementations for chrome.cryptotokenPrivate API functions.
namespace infobars {
class InfoBar;
}
namespace extensions {
namespace api {
class CryptotokenPrivateCanOriginAssertAppIdFunction
: public UIThreadExtensionFunction {
public:
CryptotokenPrivateCanOriginAssertAppIdFunction();
DECLARE_EXTENSION_FUNCTION("cryptotokenPrivate.canOriginAssertAppId",
CRYPTOTOKENPRIVATE_CANORIGINASSERTAPPID)
protected:
~CryptotokenPrivateCanOriginAssertAppIdFunction() override {}
ResponseAction Run() override;
private:
ChromeExtensionFunctionDetails chrome_details_;
};
} // namespace api
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
| // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/common/extensions/api/cryptotoken_private.h"
#include "extensions/browser/extension_function.h"
// Implementations for chrome.cryptotokenPrivate API functions.
namespace extensions {
namespace api {
class CryptotokenPrivateCanOriginAssertAppIdFunction
: public UIThreadExtensionFunction {
public:
CryptotokenPrivateCanOriginAssertAppIdFunction();
DECLARE_EXTENSION_FUNCTION("cryptotokenPrivate.canOriginAssertAppId",
CRYPTOTOKENPRIVATE_CANORIGINASSERTAPPID)
protected:
~CryptotokenPrivateCanOriginAssertAppIdFunction() override {}
ResponseAction Run() override;
private:
ChromeExtensionFunctionDetails chrome_details_;
};
} // namespace api
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
| Remove an unneeded forward declaration. | Remove an unneeded forward declaration.
BUG=457769
R=pkasting@chromium.org,rockot@chromium.org
Review URL: https://codereview.chromium.org/930493002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#316348}
| C | bsd-3-clause | PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,ltilve/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,ltilve/chromium,axinging/chromium-crosswalk,Chilledheart/chromium |
cb3786e6ed05e08592b4697beff83c3879ce13bf | libc/sysdeps/linux/common/getgid.c | libc/sysdeps/linux/common/getgid.c | /* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
_syscall0(gid_t, getgid);
libc_hidden_proto(getgid)
libc_hidden_def(getgid)
| /* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
libc_hidden_proto(getgid)
_syscall0(gid_t, getgid);
libc_hidden_def(getgid)
| Make gcc4 happy as well | Make gcc4 happy as well
| C | lgpl-2.1 | joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc |
59306802d58df62203ecd17271bacbdc9d268bfd | Marshal/Marshal.h | Marshal/Marshal.h | //
// Marshal.h
// Marshal
//
// Created by Jason Larsen on 2/24/16.
// Copyright © 2016 Utah iOS & Mac. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for Marshal.
FOUNDATION_EXPORT double MarshalVersionNumber;
//! Project version string for Marshal.
FOUNDATION_EXPORT const unsigned char MarshalVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Marshal/PublicHeader.h>
| //
// M A R S H A L
//
// ()
// /\
// ()--' '--()
// `. .'
// / .. \
// ()' '()
//
//
#import <Foundation/Foundation.h>
//! Project version number for Marshal.
FOUNDATION_EXPORT double MarshalVersionNumber;
//! Project version string for Marshal.
FOUNDATION_EXPORT const unsigned char MarshalVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Marshal/PublicHeader.h>
| Use Foundation to resolve macros instead of UIKit | Use Foundation to resolve macros instead of UIKit
| C | mit | utahiosmac/Marshal,utahiosmac/Marshal |
2f0befaa35ec8b1baa2fe61438f9705206e694cb | MeetingApp/Meeting/Protocols/IMeetingDelegate.h | MeetingApp/Meeting/Protocols/IMeetingDelegate.h | //
// IMeetingDelegate.h
// MeetingApp
//
// Created by Estefania Chavez Guardado on 2/27/16.
// Copyright © 2016 Estefania Chavez Guardado. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Meeting.h"
@protocol IMeetingDelegate <NSObject>
@optional
- (void) update: (MutableMeeting *) newMeeting;
- (void) moveToInactiveMeetings:(int) indexMeeting
andInactiveTheMeeting: (NSString *) idMeeting;
- (void) updateDetail: (MutableMeeting *) meeting;
@end | //
// IMeetingDelegate.h
// MeetingApp
//
// Created by Estefania Chavez Guardado on 2/27/16.
// Copyright © 2016 Estefania Chavez Guardado. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Meeting.h"
typedef enum NotificationType {
NOTIFICATION_TYPE_EMAIL,
NOTIFICATION_TYPE_CALENDAR
} NotificationType;
@protocol IMeetingDelegate <NSObject>
@optional
- (void) update: (MutableMeeting *) newMeeting;
- (void) moveToInactiveMeetings:(int) indexMeeting
andInactiveTheMeeting: (NSString *) idMeeting;
- (void) updateDetail: (MutableMeeting *) meeting;
// TODO: Send to update the notification
- (void) updateNotification: (NotificationType) type withCallback:(void (^)(BOOL updated)) callback;
@end | Define the method updateNotification in meetingbussiness | Define the method updateNotification in meetingbussiness
| C | apache-2.0 | iTermin/app_iOS |
b9592bddbc014759941b94b76596c1dbf2245ad3 | common/alexcpt.h | common/alexcpt.h | #ifndef ALEXCPT_H
#define ALEXCPT_H
#include <exception>
#include <string>
#include "AL/alc.h"
namespace al {
class backend_exception final : public std::exception {
std::string mMessage;
ALCenum mErrorCode;
public:
backend_exception(ALCenum code, const char *msg, ...);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }
};
} // namespace al
#define START_API_FUNC try
#define END_API_FUNC catch(...) { std::terminate(); }
#endif /* ALEXCPT_H */
| #ifndef ALEXCPT_H
#define ALEXCPT_H
#include <exception>
#include <string>
#include "AL/alc.h"
#ifdef __GNUC__
#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else
#define ALEXCPT_FORMAT(x, y, z)
#endif
namespace al {
class backend_exception final : public std::exception {
std::string mMessage;
ALCenum mErrorCode;
public:
backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }
};
} // namespace al
#define START_API_FUNC try
#define END_API_FUNC catch(...) { std::terminate(); }
#endif /* ALEXCPT_H */
| Add the printf format attribute to backend_exception's constructor | Add the printf format attribute to backend_exception's constructor
| C | lgpl-2.1 | aaronmjacobs/openal-soft,aaronmjacobs/openal-soft |
bea288dff2de7385645f1c787565cda9cb6fdb51 | tests/regression/29-svcomp/11_arithmetic_bot.c | tests/regression/29-svcomp/11_arithmetic_bot.c | // PARAM: --conf=conf/svcomp21.json
// from: ldv-linux-3.0/usb_urb-drivers-vhost-vhost_net.ko.cil.out.i
typedef unsigned long long u64;
int main( )
{ u64 a ;
unsigned long flag ;
unsigned long roksum ;
struct thread_info *tmp___7 ;
int tmp___8 ;
long tmp___9;
void *log_base;
unsigned long sz;
u64 addr;
{
a = (addr / 4096ULL) / 8ULL;
if (a > (u64 )(0x0fffffffffffffffUL - (unsigned long )log_base)) {
return (0);
} else {
if (a + (u64 )((unsigned long )log_base) > 0x0fffffffffffffffULL) {
return (0);
} else {
}
}
{
tmp___7 = current_thread_info();
// __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (log_base + a),
// "g" ((long )((((sz + 32768UL) - 1UL) / 4096UL) / 8UL)), "rm" (tmp___7->addr_limit.seg));
}
if (flag == 0UL) {
tmp___8 = 1;
} else {
tmp___8 = 0;
}
{
tmp___9 = __builtin_expect((long )tmp___8, 1L);
}
return ((int )tmp___9);
}
}
| Add failing test case with max u long long | Add failing test case with max u long long
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
6e332e0b23f37fb0bf9c8f8a68acb6bd81bf955e | test/Driver/arm-xscale.c | test/Driver/arm-xscale.c | // RUN: %clang -target arm-freebsd -mcpu=xscale -### -c %s 2>&1 | FileCheck %s
// CHECK-NOT: error: the clang compiler does not support '-mcpu=xscale'
// CHECK: "-cc1"{{.*}} "-target-cpu" "xscale"{{.*}}
| Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets). | Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@257509 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
|
e0c1a00bbff90dffccc5d5aab9142b076b72a821 | thingshub/CDZIssueSyncEngine.h | thingshub/CDZIssueSyncEngine.h | //
// CDZIssueSyncEngine.h
// thingshub
//
// Created by Chris Dzombak on 1/13/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import <ReactiveCocoa/ReactiveCocoa.h>
@class OCTClient;
@class CDZThingsHubConfiguration;
@protocol CDZIssueSyncDelegate;
@interface CDZIssueSyncEngine : NSObject
/// Designated initializer
- (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate
configuration:(CDZThingsHubConfiguration *)config
authenticatedClient:(OCTClient *)client;
/// Returns a signal which will either complete or error after the sync operation.
- (RACSignal *)sync;
@end
| //
// CDZIssueSyncEngine.h
// thingshub
//
// Created by Chris Dzombak on 1/13/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import <ReactiveCocoa/ReactiveCocoa.h>
@class OCTClient;
@class CDZThingsHubConfiguration;
@protocol CDZIssueSyncDelegate;
@interface CDZIssueSyncEngine : NSObject
/// Designated initializer
- (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate
configuration:(CDZThingsHubConfiguration *)config
authenticatedClient:(OCTClient *)client;
/// Returns a signal which will asynchronously return strings as status updates,
/// and either complete or error after the sync operation.
- (RACSignal *)sync;
@end
| Update sync method docs in IssueSyncEngine | Update sync method docs in IssueSyncEngine | C | mit | cdzombak/thingshub,cdzombak/thingshub,cdzombak/thingshub |
3393cde61f40f1629a04688460a4d2dd5c76fff3 | bindings/f95/plflt.c | bindings/f95/plflt.c | /* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio>
#include <stdlib>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile ;
char *kind ;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0"
#else
kind = "1.0"
#endif
fprintf{ outfile, "\
! NOTE: Generated code\n\
!\n\
! Type of floating-point numbers in PLplot\n\
!\n\
integer, parameter :: plf = kind(%s)\n\
integer, parameter :: plflt = plf\n", kind ) ;
fclose( outfile ) ;
}
| /* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio.h>
#include <stdlib.h>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile;
char *kind;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0";
#else
kind = "1.0";
#endif
fprintf( outfile, "C NOTE: Generated code\n");
fprintf( outfile, "C\n");
fprintf( outfile, "C Type of floating-point numbers in PLplot\n");
fprintf( outfile, "C\n");
fprintf( outfile, " integer, parameter :: plf = kind(%s)\n", kind);
fprintf( outfile, " integer, parameter :: plflt = plf\n");
fclose( outfile);
}
| Fix large number of syntax errors (at least for gcc). | Fix large number of syntax errors (at least for gcc).
svn path=/trunk/; revision=6508
| C | lgpl-2.1 | FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot |
a2dce448551cd5c010f07341e080729188999a9a | include/libport/unistd.h | include/libport/unistd.h | #ifndef LIBPORT_UNISTD_H
# define LIBPORT_UNISTD_H
# include "detect_win32.h"
# include "libport/config.h"
// This is traditional Unix file.
# ifdef LIBPORT_HAVE_UNISTD_H
# include "unistd.h"
# endif
// This seems to be its WIN32 equivalent.
// http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7.
# if defined WIN32 || defined LIBPORT_WIN32
# include "io.h"
# endif
#if defined LIBPORT_HAVE__GETCWD
# define getcwd _getcwd
#elif !defined LIBPORT_HAVE_GETCWD
# error I need either getcwd() or _getcwd()
#endif
#endif // !LIBPORT_UNISTD_H
| #ifndef LIBPORT_UNISTD_H
# define LIBPORT_UNISTD_H
# include "detect_win32.h"
# include "libport/config.h"
// This is traditional Unix file.
# ifdef LIBPORT_HAVE_UNISTD_H
# include "unistd.h"
# endif
// This seems to be its WIN32 equivalent.
// http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7.
# if defined WIN32 || defined LIBPORT_WIN32
# include "io.h"
# endif
#if defined LIBPORT_URBI_ENV_AIBO
static char *getcwd(char *buf, size_t size)
{
if (buf == 0 || size <= 3)
return 0;
strncpy (buf, "/MS", size);
return buf;
}
#else
# if defined LIBPORT_HAVE__GETCWD
# define getcwd _getcwd
# elif !defined LIBPORT_HAVE_GETCWD
# error I need either getcwd() or _getcwd()
# endif
#endif
#endif // !LIBPORT_UNISTD_H
| Add dummy static version of getcwd for Aibo. | Add dummy static version of getcwd for Aibo.
* include/libport/unistd.h: Here. | C | bsd-3-clause | aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport |
9834e5a66c91f1681d70369550e55d96b2d961d9 | Classes/Categories/Categories.h | Classes/Categories/Categories.h | #import "NSManagedObject+ActiveRecord.h"
#import "NSString+StringBetweenStrings.h"
#import <Artsy+UIColors/UIColor+ArtsyColors.h>
#import "UIColor+FolioColours.h"
#import <Artsy+UIFonts/UIFont+ArtsyFonts.h>
#import "NSObject+Notifications.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIButton+FolioButtons.h"
#import "UIColor+DebugColours.h"
#import "NSString+StringSize.h"
#import "UIBarButtonItem+toolbarHelpers.h"
#import "UIImageView+ArtsySetURL.h"
| #import "NSManagedObject+ActiveRecord.h"
#import "NSString+StringBetweenStrings.h"
#import <Artsy+UIColors/UIColor+ArtsyColors.h>
#import "UIColor+FolioColours.h"
#if __has_include(<Artsy+UIFonts/UIFont+ArtsyFonts.h>)
#import <Artsy+UIFonts/UIFont+ArtsyFonts.h>
#endif
#if __has_include(<Artsy+OSSUIFonts/UIFont+OSSArtsyFonts.h>)
#import <Artsy+OSSUIFonts/UIFont+OSSArtsyFonts.h>
#endif
#import "NSObject+Notifications.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIButton+FolioButtons.h"
#import "UIColor+DebugColours.h"
#import "NSString+StringSize.h"
#import "UIBarButtonItem+toolbarHelpers.h"
#import "UIImageView+ArtsySetURL.h"
| Support running from the OSS fonts | Support running from the OSS fonts
| C | mit | tomdev2008/energy,tomdev2008/energy,artsy/energy,gaurav1981/energy,gaurav1981/energy,gaurav1981/energy,artsy/energy,tomdev2008/energy,tomdev2008/energy,gaurav1981/energy,gaurav1981/energy,tomdev2008/energy,artsy/energy,artsy/energy,artsy/energy,tomdev2008/energy |
48600172e57f4f4e9dd06f6a4704032e3d6bc53e | file4.c | file4.c | file4.c - r1
Test checkin in master1-updated - updated_by_master
Test checkin in master2
Test checkin in master3
Test checkin in master4
| Test checkin in master1-updated - updated_by_master
Test checkin in master1-updated - updated2
Test checkin in master2
Test checkin in master3
Test checkin in master4
| Test commit merges feature to master | Test commit merges feature to master
| C | apache-2.0 | shahedmolla/test |
36ebfc68edd9b7052ffd14cca2a4775f9c450f18 | llvm-external-projects/iree-dialects/include/iree-dialects/Transforms/ListenerGreedyPatternRewriteDriver.h | llvm-external-projects/iree-dialects/include/iree-dialects/Transforms/ListenerGreedyPatternRewriteDriver.h | // Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "iree-dialects/Transforms/Listener.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
namespace mlir {
struct GreedyRewriteConfig;
/// Applies the specified patterns on `op` alone while also trying to fold it,
/// by selecting the highest benefits patterns in a greedy manner. Returns
/// success if no more patterns can be matched. `erased` is set to true if `op`
/// was folded away or erased as a result of becoming dead. Note: This does not
/// apply any patterns recursively to the regions of `op`. Accepts a listener
/// so the caller can be notified of rewrite events.
LogicalResult applyPatternsAndFoldGreedily(
MutableArrayRef<Region> regions, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener);
inline LogicalResult applyPatternsAndFoldGreedily(
Operation *op, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener) {
return applyPatternsAndFoldGreedily(op->getRegions(), patterns, config,
listener);
}
} // namespace mlir
| // Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "iree-dialects/Transforms/Listener.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
namespace mlir {
struct GreedyRewriteConfig;
/// Applies the specified patterns on `op` alone while also trying to fold it,
/// by selecting the highest benefits patterns in a greedy manner. Returns
/// success if no more patterns can be matched. `erased` is set to true if `op`
/// was folded away or erased as a result of becoming dead. Note: This does not
/// apply any patterns recursively to the regions of `op`. Accepts a listener
/// so the caller can be notified of rewrite events.
LogicalResult applyPatternsAndFoldGreedily(
MutableArrayRef<Region> regions, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener);
inline LogicalResult applyPatternsAndFoldGreedily(
Operation *op, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener) {
return applyPatternsAndFoldGreedily(op->getRegions(), patterns, config,
listener);
}
} // namespace mlir
| Add include for GreedyPatternRewriteDriver implementation. | Add include for GreedyPatternRewriteDriver implementation.
Not sure if this is correct. There was an unresolved symbol error on MSVC that this fixes though.
| C | apache-2.0 | iree-org/iree,iree-org/iree,google/iree,iree-org/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,google/iree,iree-org/iree |
0c04638755b14023abbc7ff4c87609e026de14fc | src/thermostat.h | src/thermostat.h | #pragma once
#define DHT22_PIN 6
#define DHT22_SAMPLE_RATE 3000
#define TEMPORATURE_TARGET (204)
#define HEATER_PIN 10
#define HEATER_ACTION_DELAY (15*60) // minimal seconds to open/close heater, prevent switch heater too frequently.
| #pragma once
#define DHT22_PIN 6
#define DHT22_SAMPLE_RATE 20000
#define TEMPORATURE_TARGET (204)
#define HEATER_PIN 10
#define HEATER_ACTION_DELAY (15*60) // minimal seconds to open/close heater, prevent switch heater too frequently.
| Change DHT22 sensor sample rate to 20 seconds | Change DHT22 sensor sample rate to 20 seconds
3 seconds is used for debug purpose
| C | apache-2.0 | redforks/thermostat,redforks/thermostat |
b74ae5b33ec0f0ac4614e831043c65cdb38ee5f2 | TASKS/TASK_1/sources/vector3d.h | TASKS/TASK_1/sources/vector3d.h | #ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint = { 0.0, 0.0, 0.0 };
public:
Vector3D();
Vector3D(Point3D point = nullPoint);
Vector3D(double x = 0.0, double y = 0.0, double z = 0.0);
~Vector3D();
double getModule() const;
Vector3D copy() const;
Vector3D getReversed() const;
void multiplyByScalar(const double);
void normalize();
void print() const;
static Vector3D add(Vector3D&, Vector3D&);
static Vector3D substract(Vector3D&, Vector3D&);
static Vector3D vectorMultiply(Vector3D&, Vector3D&) ;
static double scalarMultiply(Vector3D&, Vector3D&);
static double sin(Vector3D&, Vector3D&);
static double cos(Vector3D&, Vector3D&);
static double angle(Vector3D&, Vector3D&);
};
}
#endif // VECTOR_3D_H
| #ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
typedef const char* err;
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint;
static unsigned int idCounter;
public:
Vector3D(Point3D point = nullPoint);
Vector3D(double x, double y = 0.0, double z = 0.0);
~Vector3D();
inline double getModule() const;
inline void print() const;
inline const Point3D& getPoint() const;
Vector3D copy() const;
void multiplyByScalar(const double);
void normalize();
static Vector3D add(Vector3D&, Vector3D&);
static Vector3D substract(Vector3D&, Vector3D&);
static Vector3D vectorMultiply(Vector3D&, Vector3D&) ;
static double scalarMultiply(Vector3D&, Vector3D&);
static double sin(Vector3D&, Vector3D&);
static double cos(Vector3D&, Vector3D&);
static double angle(Vector3D&, Vector3D&);
};
}
#endif // VECTOR_3D_H
| Change signatures of methods and fields of class | Change signatures of methods and fields of class
| C | mit | reeFridge/learn-oop-through-cpp |
009fef84e0c393522bc6bb3c66cd7d6779dcff98 | exemplos/primeiro-trimestre/01-hello-world.c | exemplos/primeiro-trimestre/01-hello-world.c | /**
* Exemplo 01 - Hello World!
*
* Este é o exemplo mais simples da linguagem C. Consiste apenas em um programa que
* imprime a mensagem "Hello World!" e termina sua execução.
* Apesar de simples, é um bom programa para se basear na estrutura, além de testar
* se o compilador está funcionando corretamente
*/
#include <stdio.h>
int main(void)
{
puts("Hello World!");
return 0;
} | Add first example! (Hello World) | Add first example! (Hello World)
| C | unlicense | atropelando/terceiro-ano-programacao |
|
220e81db102f180b4c30eb85398e6f55d74faca2 | calc.c | calc.c | #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p)
{
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));
case '-':
return (ans - calc(p + i + 1));
case '*':
ans *= atoi(p + i + 1);
i++;
break;
case '/':
ans /= atoi(p + i + 1);
i++;
break;
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
}
| #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p)
{
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));
case '-':
return (ans - calc(p + i + 1));
case '*':
ans *= atoi(p + i + 1);
i++;
break;
case '/':
ans /= atoi(p + i + 1);
i++;
break;
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
return (ans);
}
| Return answer when reading formula was finished | Return answer when reading formula was finished
| C | mit | Roadagain/Calculator,Roadagain/Calculator |
2cb9cb84dfe98c11ae6eb8beca6720b3c587a614 | sys/dev/acpica/acpi_powerprofile.c | sys/dev/acpica/acpi_powerprofile.c | /*-
* Copyright (c) 2001 Michael Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include "opt_acpi.h" /* XXX trim includes */
#include <sys/param.h>
#include <sys/mutex.h>
#include <sys/bus.h>
#include "acpi.h"
#include <dev/acpica/acpivar.h>
static int powerprofile_state = POWERPROFILE_PERFORMANCE;
int
powerprofile_get_state(void)
{
return(powerprofile_state);
}
void
powerprofile_set_state(int state)
{
int changed;
ACPI_LOCK;
if (state != powerprofile_state) {
powerprofile_state = state;
changed = 1;
printf("system power profile changed to '%s'\n",
(state == POWERPROFILE_PERFORMANCE) ? "performance" : "economy");
} else {
changed = 0;
}
ACPI_UNLOCK;
if (changed)
EVENTHANDLER_INVOKE(powerprofile_change);
}
| Support for system "power profiles". Currently we support two profiles; "economy" and "performance". | Support for system "power profiles". Currently we support two profiles;
"economy" and "performance".
| C | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase |
|
581c0f20d6d4109ed7b905aa6f11cca2bea33b41 | Os_Cfg.h | Os_Cfg.h | /* OSEKOS Implementation of an OSEK Scheduler
* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef OS_CFG_H_
#define OS_CFG_H_
#ifdef OS_CFG_ARCH_POSIX
#include "Os_Arch_Posix.h"
#endif
#ifdef OS_CFG_ARCH_FIBERS
#include "Os_Arch_Fibers.h"
#endif
#define OS_TASK_COUNT 3
#define OS_PRIO_COUNT 3
#define OS_TICK_US 100000U
extern void errorhook(StatusType ret);
#define OS_ERRORHOOK(_ret) errorhook(_ret)
#endif /* OS_CFG_H_ */
| /* OSEKOS Implementation of an OSEK Scheduler
* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef OS_CFG_H_
#define OS_CFG_H_
#ifdef OS_CFG_ARCH_POSIX
#include "Os_Arch_Posix.h"
#endif
#ifdef OS_CFG_ARCH_FIBERS
#include "Os_Arch_Fibers.h"
#endif
#define OS_TASK_COUNT 3
#define OS_PRIO_COUNT 3
#define OS_TICK_US 1000000U
extern void errorhook(StatusType ret);
#define OS_ERRORHOOK(_ret) errorhook(_ret)
#endif /* OS_CFG_H_ */
| Increment timer ticks for now | Increment timer ticks for now
| C | lgpl-2.1 | elupus/osek,elupus/osek,elupus/osek |
224017fde6a9c4ae850e870563136d66843b4963 | include/llvm/MC/MCSymbolXCOFF.h | include/llvm/MC/MCSymbolXCOFF.h | //===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCSYMBOLXCOFF_H
#define LLVM_MC_MCSYMBOLXCOFF_H
#include "llvm/BinaryFormat/XCOFF.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/IR/GlobalValue.h"
namespace llvm {
class MCSymbolXCOFF : public MCSymbol {
// The IR symbol this MCSymbolXCOFF is based on. It is set on function
// entry point symbols when they are the callee operand of a direct call
// SDNode.
const GlobalValue *GV = nullptr;
public:
MCSymbolXCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
: MCSymbol(SymbolKindXCOFF, Name, isTemporary) {}
void setGlobalValue(const GlobalValue *G) { GV = G; }
const GlobalValue *getGlobalValue() const { return GV; }
static bool classof(const MCSymbol *S) { return S->isXCOFF(); }
};
} // end namespace llvm
#endif // LLVM_MC_MCSYMBOLXCOFF_H
| //===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCSYMBOLXCOFF_H
#define LLVM_MC_MCSYMBOLXCOFF_H
#include "llvm/BinaryFormat/XCOFF.h"
#include "llvm/MC/MCSymbol.h"
namespace llvm {
class GlobalValue;
class MCSymbolXCOFF : public MCSymbol {
// The IR symbol this MCSymbolXCOFF is based on. It is set on function
// entry point symbols when they are the callee operand of a direct call
// SDNode.
const GlobalValue *GV = nullptr;
public:
MCSymbolXCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
: MCSymbol(SymbolKindXCOFF, Name, isTemporary) {}
void setGlobalValue(const GlobalValue *G) { GV = G; }
const GlobalValue *getGlobalValue() const { return GV; }
static bool classof(const MCSymbol *S) { return S->isXCOFF(); }
};
} // end namespace llvm
#endif // LLVM_MC_MCSYMBOLXCOFF_H
| Work around a circular dependency between IR and MC introduced in r362735 | Work around a circular dependency between IR and MC introduced in r362735
I replaced the circular library dependency with a forward declaration,
but it is only a workaround, not a real fix.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@362782 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm |
e541bf3d60bfb9615802c471f1b9d26547ef5b0a | test/CodeGen/debug-info-257-args.c | test/CodeGen/debug-info-257-args.c | // RUN: %clang_cc1 -x c++ -g -emit-llvm -triple x86_64-linux-gnu -o - %s | FileCheck %s
// PR23332
// CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 255
// CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 256
// CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 257
void fn1(int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int, int, int,
int, int, int, int, int) {}
| Add a clang test for LLVM fix for PR23332 | DebugInfo: Add a clang test for LLVM fix for PR23332
Add a clang test for LLVM r235955, which added support for up to 2^16
arguments.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@235956 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
|
381363802706bd30c45a8e6d8ac6fdcaa6248780 | c/list.c | c/list.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Node Node;
struct Node {
int value;
Node *next;
};
void addFirst(Node **head, int v) {
Node *newNode = (Node * )malloc(sizeof(Node));
newNode->value = v;
newNode->next = *head;
*head = newNode;
}
void printList(Node *head) {
Node *curr = head;
while (curr != NULL) {
printf("%d\n", curr->value);
curr = curr->next;
}
}
Node *init(int v) {
Node *head = (Node *)malloc(sizeof(Node));
head->value = v;
head->next = NULL;
return head;
}
int main() {
Node *head = init(1);
addFirst(&head, 2);
addFirst(&head, 3);
printList(head);
return 0;
}
| Implement Linked List in C | Implement Linked List in C
C언어로 오랫만에 구현
수업시간에 이중포인터를 설명하기 위해서 구현했다.
| C | mit | honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice |
|
831405d274f7a3cbb097fb09ce317f976f16c9fe | rs.h | rs.h | /**
* Generic reservoir sampling.
*/
#ifndef _RS_H
#define _RS_H
/* print actions to the reservoir */
#ifndef PRINT_RS_TRACE
#define PRINT_RS_TRACE 1
#endif
struct reservoir;
struct drand48_data;
struct reservoir *init_reservoir(size_t sz,
#if PRINT_RS_TRACE
void (*print_fun)(void *it),
#endif
void *(*clone_fun)(const void *it, size_t sz),
void (*free_fun)(void *it));
void free_reservoir(struct reservoir *r);
/* Notice one extra parameter when tracing the reservoir */
void add_to_reservoir(struct reservoir *r, const void *it, size_t sz,
double w, struct drand48_data *randbuffer);
void add_to_reservoir_log(struct reservoir *r, const void *it, size_t sz,
double logw, struct drand48_data *randbuffer);
#endif
| /**
* Generic reservoir sampling.
*/
#ifndef _RS_H
#define _RS_H
/* print actions to the reservoir */
#ifndef PRINT_RS_TRACE
#define PRINT_RS_TRACE 1
#endif
struct reservoir;
struct drand48_data;
/* Notice one extra parameter when tracing the reservoir */
struct reservoir *init_reservoir(size_t sz,
#if PRINT_RS_TRACE
void (*print_fun)(void *it),
#endif
void *(*clone_fun)(const void *it, size_t sz),
void (*free_fun)(void *it));
void free_reservoir(struct reservoir *r);
void add_to_reservoir(struct reservoir *r, const void *it, size_t sz,
double w, struct drand48_data *randbuffer);
void add_to_reservoir_log(struct reservoir *r, const void *it, size_t sz,
double logw, struct drand48_data *randbuffer);
#endif
| Move comment to the code it comments on | Move comment to the code it comments on
| C | bsd-3-clause | mihaimaruseac/dphcar |
ee758e12198cd82c29a387193a154e6a8f88fc99 | src/domain.h | src/domain.h | /***************************************************************************//**
* \file domain.h
* \author Krishnan, A. (anush@bu.edu)
* \brief Definition of the class \c domain
*/
#pragma once
#include "types.h"
/**
* \class domain
* \brief Store the mesh grid information
*/
class domain
{
public:
int nx, ///< number of cells in the x-direction
ny; ///< number of cells in the y-direction
vecH x, ///< x-coordinates of the nodes
y, ///< y-coordinates of the nodes
dx, ///< cell widths in the x-direction
dy; ///< cell widths in the y-direction
vecD xD, ///< x-coordinates of the nodes stored on the device
yD, ///< y-coordinates of the nodes stored on the device
dxD, ///< x- cell widths stored on the device
dyD; ///< y- cell widths stored on the device
vecH xu, ///< x-coordinates of the locations at which the x-component of velocity is evaluated
yu, ///< y-coordinates of the locations at which the x-component of velocity is evaluated
xv, ///< x-coordinates of the locations at which the y-component of velocity is evaluated
yv; ///< y-coordinates of the locations at which the y-component of velocity is evaluated
};
| /***************************************************************************//**
* \file domain.h
* \author Anush Krishnan (anush@bu.edu)
* \brief Definition of the class \c domain.
*/
#pragma once
#include "types.h"
/**
* \class domain
* \brief Stores information about the computational grid.
*/
class domain
{
public:
int nx, ///< number of cells in the x-direction
ny; ///< number of cells in the y-direction
vecH x, ///< x-coordinates of the nodes
y, ///< y-coordinates of the nodes
dx, ///< cell widths in the x-direction
dy; ///< cell widths in the y-direction
vecD xD, ///< x-coordinates of the nodes stored on the device
yD, ///< y-coordinates of the nodes stored on the device
dxD, ///< x- cell widths stored on the device
dyD; ///< y- cell widths stored on the device
vecH xu, ///< x-coordinates of the locations at which the x-component of velocity is evaluated
yu, ///< y-coordinates of the locations at which the x-component of velocity is evaluated
xv, ///< x-coordinates of the locations at which the y-component of velocity is evaluated
yv; ///< y-coordinates of the locations at which the y-component of velocity is evaluated
};
| Update Doxygen documentation with conventions | Update Doxygen documentation with conventions
| C | mit | barbagroup/cuIBM,barbagroup/cuIBM,barbagroup/cuIBM |
c21ae1451dd3a20b4ff0566ae45a0e58a35081fe | Source/OCMock/OCMLocation.h | Source/OCMock/OCMLocation.h | /*
* Copyright (c) 2014-2015 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
}
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (id)testCase;
- (NSString *)file;
- (NSUInteger)line;
@end
extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
| /*
* Copyright (c) 2014-2015 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
}
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (id)testCase;
- (NSString *)file;
- (NSUInteger)line;
@end
#if defined(__cplusplus)
extern "C"
#else
extern
#endif
OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
| Fix linking in Objective–C++ tests. | Fix linking in Objective–C++ tests.
As detailed in #238, linking tests sometimes fails when OCMock is being used in Objective-C++ (.mm) test case files.
This commit solves that problem by conditionally declaring `OCMMakeLocation` as `extern C` in when included in a C++ compilation unit. | C | apache-2.0 | Lightricks/ocmock,Lightricks/ocmock,Lightricks/ocmock,NextThought/ocmock,erikdoe/ocmock,firebase/ocmock,BohdanOrlov/ocmock,Lightricks/ocmock,erikdoe/ocmock,dhardiman/ocmock,erikdoe/ocmock,imhuntingwabbits/ocmock,erikdoe/ocmock,SteveFortune/ocmock |
18ca3c88bfab828cf26f5a184cfa30ba012089e4 | memory.c | memory.c | /*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
uint8_t getmembyte(uint16_t addr)
{
return *(memory_area + addr);
}
uint16_t getmemword(uint16_t addr)
{
return (getmembyte(addr+1) << 8 | getmembyte(addr));
}
void putmembyte(uint16_t addr, uint8_t byte)
{
// FIXME: must control if addr is readonly (TODO: implement MBC controllers)
*(memory_area + addr) = byte;
}
void putmemword(uint16_t addr, uint16_t word)
{
putmembyte(addr, (word >> 8));
putmembyte(addr+1, (word & 0xFF));
}
| /*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
inline uint8_t getmembyte(uint16_t addr)
{
return *(memory_area + addr);
}
inline uint16_t getmemword(uint16_t addr)
{
return (getmembyte(addr+1) << 8 | getmembyte(addr));
}
void putmembyte(uint16_t addr, uint8_t byte)
{
// FIXME: must control if addr is readonly (TODO: implement MBC controllers)
*(memory_area + addr) = byte;
}
void putmemword(uint16_t addr, uint16_t word)
{
putmembyte(addr, (word >> 8));
putmembyte(addr+1, (word & 0xFF));
}
| Change "getmembyte" and "getmemword" to inline functions | Change "getmembyte" and "getmemword" to inline functions
| C | mit | nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu |
4957aeebad39f4dc1c3ed05e81a171d4ab213b15 | TwIRCk/GLGInputParserDelegate.h | TwIRCk/GLGInputParserDelegate.h | //
// GLGInputParserDelegate.h
// TwIRCk
//
// Created by Tim Jarratt on 11/29/13.
// Copyright (c) 2013 General Linear Group. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol GLGInputParserDelegate <NSObject>
- (void) didJoinChannel:(NSString *)channel
rawCommand:(NSString *)rawCommand;
- (void) didPartChannel:(NSString *)channel
rawCommand:(NSString *)rawCommand;
- (void) didChangeNick:(NSString *)newNick
rawCommand:(NSString *)rawCommand;
- (void) didChangePassword:(NSString *)newPassword
rawCommand:(NSString *)rawCommand;
@end
| //
// GLGInputParserDelegate.h
// TwIRCk
//
// Created by Tim Jarratt on 11/29/13.
// Copyright (c) 2013 General Linear Group. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol GLGInputParserDelegate <NSObject>
- (void) didJoinChannel:(NSString *)channel
rawCommand:(NSString *)command;
- (void) didPartChannel:(NSString *)channel
rawCommand:(NSString *)channel;
- (void) didChangeNick:(NSString *)newNick
rawCommand:(NSString *)channel;
- (void) didChangePassword:(NSString *)newPassword
rawCommand:(NSString *)channel;
@end
| Revert "Name these protocol method variables better" | Revert "Name these protocol method variables better"
This reverts commit 0dc63736e1b8398d1fc9692473f285076aa862ee.
| C | mit | tjarratt/twIRCk,tjarratt/twIRCk,tjarratt/twIRCk |
9bf77934c4d06067d3619abc4c40ca5adf3dde9f | include/kernel/idt.h | include/kernel/idt.h | #ifndef IDT_H
#define IDT_H
#include <stdint.h>
struct IDTEntry {
uint16_t base_address_low;
uint16_t selector;
uint8_t reserved;
uint8_t type : 4;
uint8_t storage_segment : 1;
uint8_t privilege : 2;
uint8_t present : 1;
uint16_t base_address_high;
} __attribute__((packed));
struct IDTDescriptor {
uint16_t limiter;
uint32_t base_address;
} __attribute__((packed));
struct IDT {
struct IDTDescriptor descriptor;
struct IDTEntry entries[256];
} __attribute__((packed));
void idt_init(struct IDT *);
#endif
| #ifndef IDT_H
#define IDT_H
#include <stdint.h>
struct IDTEntry {
uint16_t base_address_low;
uint16_t selector;
uint8_t reserved;
uint8_t type : 4;
uint8_t storage_segment : 1;
uint8_t privilege : 2;
uint8_t present : 1;
uint16_t base_address_high;
} __attribute__((packed));
struct IDTDescriptor {
uint16_t limiter;
uint32_t base_address;
} __attribute__((packed));
struct IDT {
struct IDTDescriptor descriptor;
struct IDTEntry entries[128];
} __attribute__((packed));
void idt_init(struct IDT *);
#endif
| Cut space required for IDT in half | Cut space required for IDT in half
| C | apache-2.0 | shockkolate/shockk-os,shockkolate/shockk-os,shockkolate/shockk-os |
6cffd9ec486df91cad16b752c3da4ab0aa992119 | src/db.h | src/db.h | // Copyright 2016 Ben Trask
// MIT licensed (see LICENSE for details)
#include <kvstore/db_schema.h>
enum {
harc_timeid_to_entry = 20,
harc_url_timeid = 21,
harc_hash_timeid = 50,
};
#define harc_timeid_to_entry_keypack(val, time, id) \
DB_VAL_STORAGE(val, DB_VARINT_MAX*3); \
db_bind_uint64((val), harc_timeid_to_entry); \
db_bind_uint64((val), (time)); \
db_bind_uint64((val), (id)); \
DB_VAL_STORAGE_VERIFY(val);
// TODO: How to pack/unpack list of hashes?
#define harc_hash_timeid_keypack(val, url, time, id) \
DB_VAL_STORAGE(val, DB_VARINT_MAX*3 + DB_INLINE_MAX); \
db_bind_uint64((val), harc_url_timeid); \
db_bind_string((val), (url), 8); \
db_bind_uint64((val), (time)); \
db_bind_uint64((val), (id)); \
DB_VAL_STORAGE_VERIFY(val);
#define harc_hash_timeid_keypack(val, algo, hash, time, id) \
DB_VAL_STORAGE(val, DB_VARINT_MAX*3 + DB_BLOB_MAX(8)); \
db_bind_uint64((val), harc_hash_timeid+(algo)); \
db_bind_blob((val), (hash), 8); \
db_bind_uint64((val), (time)); \
db_bind_uint64((val), (id)); \
DB_VAL_STORAGE_VERIFY(val);
| Add beginnings of DB layer. | Add beginnings of DB layer.
| C | mit | btrask/hash-archive,btrask/hash-archive,btrask/hash-archive |
|
c7b43401d7bca2f3919c40391473e37a384093ca | types.h | types.h | /*
* types.h
*
* Created on: Mar 11, 2014
* Author: Chase
*/
#ifndef TYPES_H_
#define TYPES_H_
#include <stdint.h>
//Don't use stdbool.h, we have to make sure bool is only a byte in size!
typedef uint8_t bool;
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
typedef uint8_t char8_t;
typedef uint16_t char16_t;
#endif /* TYPES_H_ */
| /*
* types.h
*
* Created on: Mar 11, 2014
* Author: Chase
*/
#ifndef TYPES_H_
#define TYPES_H_
#include <stdint.h>
//Don't use stdbool.h, we have to make sure bool is only a byte in size!
typedef uint8_t bool;
enum {
true = 1,
false = 0,
TRUE = 1,
FALSE = 0
};
typedef uint8_t char8_t;
typedef uint16_t char16_t;
#endif /* TYPES_H_ */
| Change bool true/false to enum | Change bool true/false to enum
| C | mit | Chase-san/libspec,Chase-san/libspec |
a2c9184cb990b90c7575053637f1abc99f3d32e9 | src/untrusted/nacl/pthread_initialize_minimal.c | src/untrusted/nacl/pthread_initialize_minimal.c | /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <unistd.h>
#include "native_client/src/untrusted/nacl/nacl_irt.h"
#include "native_client/src/untrusted/nacl/nacl_thread.h"
#include "native_client/src/untrusted/nacl/tls.h"
/*
* This initialization happens early in startup with or without libpthread.
* It must make it safe for vanilla newlib code to run.
*/
void __pthread_initialize_minimal(size_t tdb_size) {
/* Adapt size for sbrk. */
/* TODO(robertm): this is somewhat arbitrary - re-examine). */
size_t combined_size = (__nacl_tls_combined_size(tdb_size) + 15) & ~15;
/*
* Use sbrk not malloc here since the library is not initialized yet.
*/
void *combined_area = sbrk(combined_size);
/*
* Fill in that memory with its initializer data.
*/
void *tp = __nacl_tls_initialize_memory(combined_area, tdb_size);
/*
* Set %gs, r9, or equivalent platform-specific mechanism. Requires
* a syscall since certain bitfields of these registers are trusted.
*/
nacl_tls_init(tp);
/*
* Initialize newlib's thread-specific pointer.
*/
__newlib_thread_init();
}
| /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <unistd.h>
#include "native_client/src/untrusted/nacl/nacl_irt.h"
#include "native_client/src/untrusted/nacl/nacl_thread.h"
#include "native_client/src/untrusted/nacl/tls.h"
/*
* This initialization happens early in startup with or without libpthread.
* It must make it safe for vanilla newlib code to run.
*/
void __pthread_initialize_minimal(size_t tdb_size) {
size_t combined_size = __nacl_tls_combined_size(tdb_size);
/*
* Use sbrk not malloc here since the library is not initialized yet.
*/
void *combined_area = sbrk(combined_size);
/*
* Fill in that memory with its initializer data.
*/
void *tp = __nacl_tls_initialize_memory(combined_area, tdb_size);
/*
* Set %gs, r9, or equivalent platform-specific mechanism. Requires
* a syscall since certain bitfields of these registers are trusted.
*/
nacl_tls_init(tp);
/*
* Initialize newlib's thread-specific pointer.
*/
__newlib_thread_init();
}
| Remove unnecessary rounding when allocating initial thread block | Cleanup: Remove unnecessary rounding when allocating initial thread block
The other calls to __nacl_tls_combined_size() don't do this.
__nacl_tls_combined_size() should be doing any necessary rounding itself.
BUG=none
TEST=trybots
Review URL: https://codereview.chromium.org/18555008
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@11698 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
| C | bsd-3-clause | sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client |
2e7fdd6a1db4a649f7e3e469729946d3978f83a1 | test/test_buffer_small_read.c | test/test_buffer_small_read.c | #include <bert/buffer.h>
#include <string.h>
#include <stdio.h>
#include "test.h"
#define DATA_SIZE 4
int main()
{
unsigned char data[4];
bert_buffer_t buffer;
bert_buffer_init(&buffer);
memset(data,'A',DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
unsigned char output[DATA_SIZE];
size_t result;
if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE)
{
test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE);
}
if (memcmp(output,data,DATA_SIZE))
{
test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]);
}
return 0;
}
| #include <bert/buffer.h>
#include <string.h>
#include <stdio.h>
#include "test.h"
#define DATA_SIZE 4
int main()
{
unsigned char data[4];
bert_buffer_t buffer;
bert_buffer_init(&buffer);
memset(data,'A',DATA_SIZE);
unsigned int i;
for (i=0;i<((BERT_CHUNK_SIZE / DATA_SIZE) * 2);i++)
{
bert_buffer_write(&buffer,data,DATA_SIZE);
}
unsigned char output[DATA_SIZE];
size_t result;
if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE)
{
test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE);
}
if (memcmp(output,data,DATA_SIZE))
{
test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]);
}
return 0;
}
| Make sure the buffer small read populates the buffer with multiple chunks. | Make sure the buffer small read populates the buffer with multiple chunks.
| C | mit | postmodern/libBERT |
6fd49de120156dfac40ce3ce57d52f986b66aa3e | C/SysLib/SysLib.h | C/SysLib/SysLib.h | /*****************************************************************************\
* *
* Filename SysLib.h *
* *
* Description SysLib Library core definitions *
* *
* Notes Included indirectly by the include files that need it. *
* Do not include directly. *
* *
* History *
* 2016-04-12 JFL Created this file. *
* 2016-04-22 JFL Renamed the MULTIOS library as SYSLIB. *
* *
* © Copyright 2016 Hewlett Packard Enterprise Development LP *
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#ifndef __SYSLIB_H__ /* Prevent multiple inclusions */
#define __SYSLIB_H__
/* Force linking with the SysLib.lib library */
#if defined(_MSC_VER)
#define _SYSLIB_LIB "SysLib.lib"
#pragma message("Adding pragma comment(lib, \"" _SYSLIB_LIB "\")")
#pragma comment(lib, _SYSLIB_LIB)
#endif /* defined(_MSC_VER) */
#if defined(__unix__)
#define _SYSLIB_LIB "libSysLib.a"
#endif
#endif /* defined(__SYSLIB_H__) */
| /*****************************************************************************\
* *
* Filename SysLib.h *
* *
* Description SysLib Library core definitions *
* *
* Notes Included indirectly by the include files that need it. *
* Do not include directly. *
* *
* History *
* 2016-04-12 JFL Created this file. *
* 2016-04-22 JFL Renamed the MULTIOS library as SYSLIB. *
* *
* © Copyright 2016 Hewlett Packard Enterprise Development LP *
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#ifndef __SYSLIB_H__ /* Prevent multiple inclusions */
#define __SYSLIB_H__
/* Force linking with the SysLib.lib library */
#if defined(_MSC_VER)
#define _SYSLIB_LIB "SysLib.lib"
#pragma message("Adding pragma comment(lib, \"" _SYSLIB_LIB "\")")
#pragma comment(lib, _SYSLIB_LIB)
#else /* GCC, clang, etc. */
#define _SYSLIB_LIB "libSysLib.a"
#endif
#endif /* defined(__SYSLIB_H__) */
| Fix compatibility with all non-Microsoft compilers | Fix compatibility with all non-Microsoft compilers
| C | apache-2.0 | JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib |
8236a6d84a13fa1511aaa8d8dea1b0155fe78c95 | fifo.h | fifo.h | #ifndef FIFO_H
#define FIFO_H
#include "align.h"
#define FIFO_NODE_SIZE 510
struct _fifo_node_t;
typedef struct DOUBLE_CACHE_ALIGNED {
volatile size_t enq DOUBLE_CACHE_ALIGNED;
volatile size_t deq DOUBLE_CACHE_ALIGNED;
volatile struct {
int index;
struct _fifo_node_t * node;
} head DOUBLE_CACHE_ALIGNED;
size_t nprocs;
} fifo_t;
typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t {
struct _fifo_handle_t * next;
struct _fifo_node_t * enq;
struct _fifo_node_t * deq;
struct _fifo_node_t * hazard;
struct _fifo_node_t * retired;
int winner;
} fifo_handle_t;
void fifo_init(fifo_t * fifo, size_t width);
void fifo_register(fifo_t * fifo, fifo_handle_t * handle);
void * fifo_get(fifo_t * fifo, fifo_handle_t * handle);
void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data);
#endif /* end of include guard: FIFO_H */
| #ifndef FIFO_H
#define FIFO_H
#include "align.h"
#define FIFO_NODE_SIZE (1 << 20 - 2)
struct _fifo_node_t;
typedef struct DOUBLE_CACHE_ALIGNED {
volatile size_t enq DOUBLE_CACHE_ALIGNED;
volatile size_t deq DOUBLE_CACHE_ALIGNED;
volatile struct {
size_t index;
struct _fifo_node_t * node;
} head DOUBLE_CACHE_ALIGNED;
size_t nprocs;
} fifo_t;
typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t {
struct _fifo_handle_t * next;
struct _fifo_node_t * enq;
struct _fifo_node_t * deq;
struct _fifo_node_t * hazard;
struct _fifo_node_t * retired;
int winner;
} fifo_handle_t;
void fifo_init(fifo_t * fifo, size_t width);
void fifo_register(fifo_t * fifo, fifo_handle_t * handle);
void * fifo_get(fifo_t * fifo, fifo_handle_t * handle);
void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data);
#endif /* end of include guard: FIFO_H */
| Use the same size of lcrq. | Use the same size of lcrq.
| C | mit | chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue |
0920b4d3988702e09e175fdfc9ac40aee61a90f5 | libslax/jsonwriter.h | libslax/jsonwriter.h | /*
* $Id$
*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- turn json-oriented XML into json text
*/
int
slaxJsonWriteNode (slaxWriterFunc_t func, void *data, xmlNodePtr nodep,
unsigned flags);
int
slaxJsonWriteDoc (slaxWriterFunc_t func, void *data, xmlDocPtr docp,
unsigned flags);
#define JWF_ROOT (1<<0) /* Root node */
#define JWF_ARRAY (1<<1) /* Inside array */
#define JWF_NODESET (1<<2) /* Top of a nodeset */
#define JWF_PRETTY (1<<3) /* Pretty print (newlines) */
#define JWF_OPTIONAL_QUOTES (1<<4) /* Don't use quotes unless needed */
| /*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- turn json-oriented XML into json text
*/
int
slaxJsonWriteNode (slaxWriterFunc_t func, void *data, xmlNodePtr nodep,
unsigned flags);
int
slaxJsonWriteDoc (slaxWriterFunc_t func, void *data, xmlDocPtr docp,
unsigned flags);
#define JWF_ROOT (1<<0) /* Root node */
#define JWF_ARRAY (1<<1) /* Inside array */
#define JWF_NODESET (1<<2) /* Top of a nodeset */
#define JWF_PRETTY (1<<3) /* Pretty print (newlines) */
#define JWF_OPTIONAL_QUOTES (1<<4) /* Don't use quotes unless needed */
| Drop $Id$ and update copyright | Drop $Id$ and update copyright
| C | bsd-3-clause | Juniper/libslax,Juniper/libslax,Juniper/libslax |
c532f633a94f3d91b4435c8ed84dc3ef7bcf2afa | test/Analysis/stack-addr-ps.c | test/Analysis/stack-addr-ps.c | // RUN: clang -checker-simple -verify %s
int* f1() {
int x = 0;
return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
int* f2(int y) {
return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}
int* f3(int x, int *y) {
int w = 0;
if (x)
y = &w;
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
unsigned short* compound_literal() {
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}}
}
| // RUN: clang -checker-simple -verify %s
int* f1() {
int x = 0;
return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
int* f2(int y) {
return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}
int* f3(int x, int *y) {
int w = 0;
if (x)
y = &w;
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
unsigned short* compound_literal() {
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
}
| Add 'expected-warning' for braces around scalar initializer | Add 'expected-warning' for braces around scalar initializer
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58280 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
64f5f1fea0b17b4798bbdc926ea5e54f6f62d019 | kernel/gdt.c | kernel/gdt.c | /*GDT stands for "Global Descriptor Table".
It is a table available on i386 (ix86?)
processors. The GDT is a list of 64 bit entries.
GRUB (or our boot) loader will install the GDT for us.
If we overwrite the GDT we will cause a 'triple fault'
and the machine will be reset.
Based on the tutorial, we will write a GDT with only 3 fields
and will not concern ourselves with the other fields.
The above was paraphrased from:
http://www.osdever.net/bkerndev/Docs/gdt.htm
*/
typedef unsigned short usort;
typedef unsigned char uchar;
typedef unsigned int uint;
/* the __attribute__((packed))
tells the compiler not to 'optimize' the struct for us by
packing.
*/
struct gdt_entry
{
ushort limit_low;
ushort base_low;
uchar base_middle;
uchar access;
uchar granularity;
uchar base_high;
}__attribute__((packed));
/* the following is a special pointer representing
the max bytes taken up by the GDT -1 */
struct gdt_ptr
{
ushort limit;
uint base;
}__attribute__((packed));
struct gdt_entry gdt[3];
struct gdt_ptr gdtp;
/* A function in start.am. Used to properly
reload the new segment registers */
//extern void gdt_flush();
| Add structs used in the GDT | Add structs used in the GDT
| C | mit | Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth |
|
cc83e1e54763daf0dcb2e80989517a5065b5ce0a | include/stamp.h | include/stamp.h | /*
* Time stamp of last source code repository commit.
*/
#define ___STAMP_YMD 20131223
#define ___STAMP_HMS 145645
| /*
* Time stamp of last source code repository commit.
*/
#define ___STAMP_YMD 20131223
#define ___STAMP_HMS 172203
| Clarify that LD_LIBRARY_PATH must be set when Gambit is build with shared libs | Clarify that LD_LIBRARY_PATH must be set when Gambit is build with shared libs
| C | apache-2.0 | BeImprovised/gambit,jasperla/gambit,BeImprovised/gambit,BeImprovised/gambit,acenode/gambit,thewhimer/gambit,jasperla/gambit,BeImprovised/gambit,thewhimer/gambit,thewhimer/gambit,jasperla/gambit,acenode/gambit,jasperla/gambit,thewhimer/gambit,acenode/gambit,acenode/gambit,thewhimer/gambit,thewhimer/gambit |
df24731a1a75f55efa4a4453aed9ad108dfe52cf | libs/samson/stream/QueueTaskManager.h | libs/samson/stream/QueueTaskManager.h |
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER
#define _H_SAMSON_QUEUE_TASK_MANAGER
#include "au/list.h" // au::list
namespace samson {
namespace stream {
class QueueTask;
class QueueTaskManager
{
au::list< QueueTask > queueTasks;
size_t id; // Id of the current task
public:
void add( QueueTask* task );
std::string getStatus();
};
}
}
#endif
|
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER
#define _H_SAMSON_QUEUE_TASK_MANAGER
#include "au/list.h" // au::list
#include <string> // std::string
namespace samson {
namespace stream {
class QueueTask;
class QueueTaskManager
{
au::list< QueueTask > queueTasks;
size_t id; // Id of the current task
public:
void add( QueueTask* task );
std::string getStatus();
};
}
}
#endif
| Fix broken compilation of Linux for the famous string.h header | Fix broken compilation of Linux for the famous string.h header
git-svn-id: 9714148d14941aebeae8d7f7841217f5ffc02bc5@1260 4143565c-f3ec-42ea-b729-f8ce0cf5cbc3
| C | apache-2.0 | telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform |
ff3cc8c9b31ed62299c14f800f55097588a2c0f5 | SwitecX25.h | SwitecX25.h | #ifndef SwitecX25_h
#define SwitecX25_h
class SwitecX25
{
public:
static const unsigned char pinCount = 4;
static const unsigned char stateCount = 6;
unsigned char pins[pinCount];
unsigned char currentState; // 6 steps
unsigned int currentStep; // step we are currently at
unsigned int targetStep; // target we are moving to
unsigned int steps; // total steps available
unsigned long time0; // time when we entered this state
unsigned int microDelay; // microsecs until next state
unsigned short (*accelTable)[2]; // accel table can be modified.
unsigned int maxVel; // fastest vel allowed
unsigned int vel; // steps travelled under acceleration
char dir; // direction -1,0,1
boolean stopped; // true if stopped
SwitecX25(unsigned int steps, unsigned char pin1, unsigned char pin2, unsigned char pin3, unsigned char pin4);
void stepUp();
void stepDown();
void zero();
void update();
void setPosition(unsigned int pos);
private:
void advance();
void writeIO();
};
#endif
| #ifndef SwitecX25_h
#define SwitecX25_h
#include <Arduino.h>
class SwitecX25
{
public:
static const unsigned char pinCount = 4;
static const unsigned char stateCount = 6;
unsigned char pins[pinCount];
unsigned char currentState; // 6 steps
unsigned int currentStep; // step we are currently at
unsigned int targetStep; // target we are moving to
unsigned int steps; // total steps available
unsigned long time0; // time when we entered this state
unsigned int microDelay; // microsecs until next state
unsigned short (*accelTable)[2]; // accel table can be modified.
unsigned int maxVel; // fastest vel allowed
unsigned int vel; // steps travelled under acceleration
char dir; // direction -1,0,1
boolean stopped; // true if stopped
SwitecX25(unsigned int steps, unsigned char pin1, unsigned char pin2, unsigned char pin3, unsigned char pin4);
void stepUp();
void stepDown();
void zero();
void update();
void setPosition(unsigned int pos);
private:
void advance();
void writeIO();
};
#endif
| Include Arduino.h to make sure we have types like "boolean" | Include Arduino.h to make sure we have types like "boolean"
| C | bsd-2-clause | timkettering/SwitecX25 |
1c8f270a75665f44f8570735762003a4319cbe19 | test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c | test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c | /* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_
*
* __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
* just like explicit setjmp/longjmp calls are.
*/
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
int main(void) {
__builtin_setjmp(0);
jumpaway(0);
}
| /* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
*
* __builtin_longjmp/setjmp should get transformed into intrinsics.
*/
// CHECK-NOT: builtin_longjmp
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
int main(void) {
__builtin_setjmp(0);
jumpaway(0);
}
| Fix test in two ways: remove incorrect comment (the intrinsic generated now is of the llvm.sjlj.* flavore) and convert grep->FileCheck | Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@181468 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
d564544ee0462850815967d943d8350f4aa298bc | native/fallocate_linux.c | native/fallocate_linux.c | #define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <stdint.h>
#include <linux/falloc.h>
int native_fallocate(int fd, uint64_t len) {
return fallocate(fd, 0, 0, (off_t)len);
}
| #define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <stdint.h>
int native_fallocate(int fd, uint64_t len) {
return fallocate(fd, 0, 0, (off_t)len);
}
| Remove falloc header from linux build | Remove falloc header from linux build
| C | isc | Luminarys/synapse,Luminarys/synapse,Luminarys/synapse |
5f2e3c068b323d97d73b921623decc34f7ac7325 | p_liberrno.h | p_liberrno.h | /*
* Copyright 2013 Mo McRoberts.
*
* 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 P_LIBERRNO_H_
# define P_LIBERRNO_H_ 1
# include <ux/cdefs.h>
# include "errno.h"
# undef errno
int *get_errno_ux2003(void) UX_SYM03_(errno);
#endif /*!P_LIBERRNO_H_*/ | /*
* Copyright 2013 Mo McRoberts.
*
* 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 P_LIBERRNO_H_
# define P_LIBERRNO_H_ 1
# include <ux/cdefs.h>
# include "errno.h"
# undef errno
int *errno_ux2003(void) UX_SYM03_(errno);
#endif /*!P_LIBERRNO_H_*/ | Fix symbol name of errno$UX$2003 | Fix symbol name of errno$UX$2003
| C | apache-2.0 | coreux/liberrno,coreux/liberrno |
ca864cc2e2063756ba8e48de390d1cf947f2efad | 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.
| C | mit | lglucin/Halide,jiawen/Halide,kenkuang1213/Halide,psuriana/Halide,dougkwan/Halide,kenkuang1213/Halide,mcanthony/Halide,damienfir/Halide,jiawen/Halide,dan-tull/Halide,kenkuang1213/Halide,dan-tull/Halide,myrtleTree33/Halide,mcanthony/Halide,lglucin/Halide,adasworks/Halide,rodrigob/Halide,fengzhyuan/Halide,rodrigob/Halide,aam/Halide,damienfir/Halide,ayanazmat/Halide,rodrigob/Halide,lglucin/Halide,dougkwan/Halide,myrtleTree33/Halide,fengzhyuan/Halide,damienfir/Halide,myrtleTree33/Halide,mcanthony/Halide,myrtleTree33/Halide,smxlong/Halide,adasworks/Halide,damienfir/Halide,aam/Halide,damienfir/Halide,kgnk/Halide,psuriana/Halide,kenkuang1213/Halide,dan-tull/Halide,dan-tull/Halide,aam/Halide,mcanthony/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,myrtleTree33/Halide,myrtleTree33/Halide,fengzhyuan/Halide,mcanthony/Halide,jiawen/Halide,jiawen/Halide,dougkwan/Halide,jiawen/Halide,rodrigob/Halide,ronen/Halide,psuriana/Halide,delcypher/Halide,fengzhyuan/Halide,jiawen/Halide,delcypher/Halide,dougkwan/Halide,dougkwan/Halide,damienfir/Halide,smxlong/Halide,mcanthony/Halide,ronen/Halide,delcypher/Halide,aam/Halide,adasworks/Halide,ayanazmat/Halide,ronen/Halide,rodrigob/Halide,fengzhyuan/Halide,dan-tull/Halide,fengzhyuan/Halide,fengzhyuan/Halide,psuriana/Halide,dougkwan/Halide,smxlong/Halide,lglucin/Halide,tdenniston/Halide,smxlong/Halide,mcanthony/Halide,tdenniston/Halide,delcypher/Halide,tdenniston/Halide,damienfir/Halide,smxlong/Halide,tdenniston/Halide,kenkuang1213/Halide,ayanazmat/Halide,ronen/Halide,fengzhyuan/Halide,psuriana/Halide,tdenniston/Halide,rodrigob/Halide,kgnk/Halide,tdenniston/Halide,ayanazmat/Halide,kgnk/Halide,smxlong/Halide,dougkwan/Halide,jiawen/Halide,damienfir/Halide,adasworks/Halide,delcypher/Halide,dan-tull/Halide,kenkuang1213/Halide,dan-tull/Halide,adasworks/Halide,dougkwan/Halide,ayanazmat/Halide,dan-tull/Halide,lglucin/Halide,kgnk/Halide,myrtleTree33/Halide,adasworks/Halide,kgnk/Halide,kenkuang1213/Halide,tdenniston/Halide,aam/Halide,kgnk/Halide,ayanazmat/Halide,rodrigob/Halide,mcanthony/Halide,aam/Halide,kgnk/Halide,lglucin/Halide,kenkuang1213/Halide,kgnk/Halide,rodrigob/Halide,ayanazmat/Halide,myrtleTree33/Halide,delcypher/Halide,delcypher/Halide,aam/Halide,smxlong/Halide,adasworks/Halide,smxlong/Halide,adasworks/Halide,ronen/Halide,psuriana/Halide,ronen/Halide,tdenniston/Halide,lglucin/Halide,ayanazmat/Halide,delcypher/Halide |
548a5f97ccdab26e90a7e0ba87b1510cfd490dbb | src/boreutils.h | src/boreutils.h | #ifndef BOREUTILS_H
#define BOREUTILS_H
#include <string.h>
static const char *BOREUTILS_VERSION = "0.0.0b1";
int has_arg(int argc, char **argv, char *search);
void bu_missing_argument(char *name);
int bu_handle_version(int argc, char **argv);
// FIXME: Having this in a header is definitely a hack.
int has_arg(int argc, char **argv, char *search)
{
for (int idx = 1; idx < argc; idx++) {
if (strcmp(argv[idx], search) == 0) {
return 1;
}
}
return 0;
}
void bu_missing_argument(char *name) {
fprintf(stderr, "%s: Missing argument\nSee '%s --help' for more information.\n", name, name);
}
int bu_handle_version(int argc, char **argv) {
if (has_arg(argc, argv, "--version")) {
printf("Boreutils %s v%s\n", argv[0], BOREUTILS_VERSION);
return 1;
}
return 0;
}
#endif
| #ifndef BOREUTILS_H
#define BOREUTILS_H
#include <string.h>
static const char *BOREUTILS_VERSION = "0.0.0b1";
int has_arg(int argc, char **argv, char *search);
void bu_missing_argument(char *name);
int bu_handle_version(int argc, char **argv);
// FIXME: Having this in a header is definitely a hack.
int has_arg(int argc, char **argv, char *search)
{
for (int idx = 1; idx < argc; idx++) {
if (strcmp(argv[idx], search) == 0) {
return 1;
}
}
return 0;
}
void bu_missing_argument(char *name) {
fprintf(stderr, "%s: Missing argument\nSee '%s --help' for more information.\n", name, name);
}
int bu_handle_version(int argc, char **argv) {
if (has_arg(argc, argv, "--version")) {
printf("%s (Boreutils) %s\n", argv[0], BOREUTILS_VERSION);
return 1;
}
return 0;
}
#endif
| Change --version format to "<name> (Boreutils) <version>" | Change --version format to "<name> (Boreutils) <version>"
| C | isc | duckinator/boreutils,duckinator/boreutils |
c8d4b754fb316cf620dcd8a933e3e9886103d878 | bindings/perl/Champlain/champlain-perl.h | bindings/perl/Champlain/champlain-perl.h | #ifndef _CHAMPLAIN_PERL_H_
#include <clutterperl.h>
#include <champlain/champlain.h>
#include "ppport.h"
#include "champlain-autogen.h"
#ifdef CHAMPLAINPERL_GTK
#include <champlain-gtk/champlain-gtk.h>
#endif
#endif /* _CHAMPLAIN_PERL_H_ */
| #ifndef _CHAMPLAIN_PERL_H_
#include <clutterperl.h>
#include <champlain/champlain.h>
#ifdef CHAMPLAINPERL_GTK
#include <champlain-gtk/champlain-gtk.h>
#endif
#include "ppport.h"
#include "champlain-autogen.h"
#endif /* _CHAMPLAIN_PERL_H_ */
| Move the include file around. | Move the include file around.
| C | lgpl-2.1 | GNOME/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,potyl/champlain,GNOME/libchamplain,GNOME/perl-Champlain,potyl/champlain,Distrotech/libchamplain,StanciuMarius/Libchamplain-map-wrapping,Distrotech/libchamplain,GNOME/perl-Champlain,GNOME/perl-Gtk2-Champlain,Distrotech/libchamplain,Distrotech/libchamplain,potyl/champlain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,potyl/champlain,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,Distrotech/libchamplain,GNOME/perl-Gtk2-Champlain,StanciuMarius/Libchamplain-map-wrapping |
fb514a31f0c99c252e0948fa88ffb75ba5b5ec69 | Source/CoreData+MagicalRecord.h | Source/CoreData+MagicalRecord.h | //
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#define ENABLE_ACTIVE_RECORD_LOGGING
#ifdef ENABLE_ACTIVE_RECORD_LOGGING
#define ARLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#else
#define ARLog(...)
#endif
#import <CoreData/CoreData.h>
#import "MagicalRecordHelpers.h"
#import "MRCoreDataAction.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectModel+MagicalRecord.h"
#import "NSPersistentStore+MagicalRecord.h"
#import "NSManagedObject+MagicalDataImport.h" | //
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#ifdef MR_LOGGING
#define ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef DEBUG
#define ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef MR_NO_LOGGING
#undef ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef ENABLE_ACTIVE_RECORD_LOGGING
#define ARLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#else
#define ARLog(...)
#endif
#import <CoreData/CoreData.h>
#import "MagicalRecordHelpers.h"
#import "MRCoreDataAction.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectModel+MagicalRecord.h"
#import "NSPersistentStore+MagicalRecord.h"
#import "NSManagedObject+MagicalDataImport.h" | Define MR_NO_LOGGING to force no logging. | Define MR_NO_LOGGING to force no logging.
| C | mit | zwaldowski/AZCoreRecord,zwaldowski/AZCoreRecord |
9e70fda79924a066f39a9b366c88d1b69561184c | src/policy/rbf.h | src/policy/rbf.h | // Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_POLICY_RBF_H
#define SYSCOIN_POLICY_RBF_H
#include <txmempool.h>
enum class RBFTransactionState {
UNKNOWN,
REPLACEABLE_BIP125,
FINAL
};
// Determine whether an in-mempool transaction is signaling opt-in to RBF
// according to BIP 125
// This involves checking sequence numbers of the transaction, as well
// as the sequence numbers of all in-mempool ancestors.
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
// SYSCOIN
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool, CTxMemPool::setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // SYSCOIN_POLICY_RBF_H
| // Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_POLICY_RBF_H
#define SYSCOIN_POLICY_RBF_H
#include <txmempool.h>
/** The rbf state of unconfirmed transactions */
enum class RBFTransactionState {
/** Unconfirmed tx that does not signal rbf and is not in the mempool */
UNKNOWN,
/** Either this tx or a mempool ancestor signals rbf */
REPLACEABLE_BIP125,
/** Neither this tx nor a mempool ancestor signals rbf */
FINAL,
};
/**
* Determine whether an unconfirmed transaction is signaling opt-in to RBF
* according to BIP 125
* This involves checking sequence numbers of the transaction, as well
* as the sequence numbers of all in-mempool ancestors.
*
* @param tx The unconfirmed transaction
* @param pool The mempool, which may contain the tx
*
* @return The rbf state
*/
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
// SYSCOIN
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool, CTxMemPool::setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // SYSCOIN_POLICY_RBF_H
| Add doxygen comment to IsRBFOptIn | doc: Add doxygen comment to IsRBFOptIn
Former-commit-id: 6c99ae13e834f996721944c8571101bd2c16ba81 | C | mit | syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin |
adfbba6447aa458e95ffad652ba815e080e3b2d3 | src/util/timeit.h | src/util/timeit.h | /*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <iostream>
#include <time.h>
namespace lean {
/**
\brief Low tech timer for used for testing.
*/
class timeit {
std::ostream & m_out;
std::string m_msg;
clock_t m_start;
public:
timeit(std::ostream & out, char const * msg):m_out(out), m_msg(msg) {
m_start = clock();
}
~timeit() {
clock_t end = clock();
std::cout << m_msg << " " << ((static_cast<double>(end) - static_cast<double>(m_start)) / CLOCKS_PER_SEC) << " secs\n";
}
};
}
| /*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <iostream>
#include <time.h>
namespace lean {
/**
\brief Low tech timer for used for testing.
*/
class timeit {
std::ostream & m_out;
std::string m_msg;
clock_t m_start;
public:
timeit(std::ostream & out, char const * msg):m_out(out), m_msg(msg) {
m_start = clock();
}
~timeit() {
clock_t end = clock();
m_out << m_msg << " " << ((static_cast<double>(end) - static_cast<double>(m_start)) / CLOCKS_PER_SEC) << " secs\n";
}
};
}
| Fix problem reported by Soonho | Fix problem reported by Soonho
Signed-off-by: Leonardo de Moura <7610bae85f2b530654cc716772f1fe653373e892@microsoft.com>
| C | apache-2.0 | digama0/lean,soonhokong/lean,dselsam/lean,fgdorais/lean,leanprover-community/lean,leodemoura/lean,soonhokong/travis_test,eigengrau/lean,soonhokong/lean-osx,leanprover/lean,leodemoura/lean,dselsam/lean,leodemoura/lean,leanprover/lean,levnach/lean,codyroux/lean0.1,avigad/lean,johoelzl/lean,leodemoura/lean,rlewis1988/lean,UlrikBuchholtz/lean,soonhokong/lean-windows,fgdorais/lean,eigengrau/lean,htzh/lean,fgdorais/lean,UlrikBuchholtz/lean,avigad/lean,javra/lean,johoelzl/lean,leanprover/lean,javra/lean,htzh/lean,soonhokong/lean,levnach/lean,levnach/lean,leanprover-community/lean,eigengrau/lean,leanprover-community/lean,htzh/lean,digama0/lean,fgdorais/lean,johoelzl/lean,c-cube/lean,rlewis1988/lean,digama0/lean,eigengrau/lean,sp3ctum/lean,Kha/lean,codyroux/lean0.1,soonhokong/lean-osx,UlrikBuchholtz/lean,dselsam/lean,Kha/lean,codyroux/lean0.1,soonhokong/travis_test,htzh/lean,sp3ctum/lean,fpvandoorn/lean,eigengrau/lean,soonhokong/lean-osx,javra/lean,c-cube/lean,fpvandoorn/lean,fpvandoorn/lean,leanprover/lean,leanprover/lean,Kha/lean,Kha/lean,fgdorais/lean,fpvandoorn/lean2,soonhokong/lean-windows,javra/lean,soonhokong/travis_test,Kha/lean,c-cube/lean,c-cube/lean,c-cube/lean,digama0/lean,rlewis1988/lean,soonhokong/lean,avigad/lean,UlrikBuchholtz/lean,leanprover-community/lean,fpvandoorn/lean,soonhokong/lean-windows,levnach/lean,Kha/lean,fpvandoorn/lean2,dselsam/lean,fpvandoorn/lean,htzh/lean,leodemoura/lean,soonhokong/lean-osx,UlrikBuchholtz/lean,avigad/lean,dselsam/lean,soonhokong/travis_test,avigad/lean,sp3ctum/lean,johoelzl/lean,leanprover-community/lean,digama0/lean,fpvandoorn/lean2,soonhokong/lean,digama0/lean,levnach/lean,leanprover/lean,soonhokong/lean,leodemoura/lean,fpvandoorn/lean2,johoelzl/lean,rlewis1988/lean,fpvandoorn/lean2,soonhokong/lean-osx,soonhokong/lean-windows,dselsam/lean,javra/lean,avigad/lean,johoelzl/lean,fpvandoorn/lean,sp3ctum/lean,rlewis1988/lean,rlewis1988/lean,leanprover-community/lean,soonhokong/lean-windows,fgdorais/lean,codyroux/lean0.1,sp3ctum/lean |
540dfec095e25e78d44cc27d84bb2a32932e5714 | libraries/datastruct/hash/create.c | libraries/datastruct/hash/create.c | /* --------------------------------------------------------------------------
* Name: create.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "utils/utils.h"
#include "utils/primes.h"
#include "datastruct/hash.h"
#include "impl.h"
/* ----------------------------------------------------------------------- */
error hash_create(const void *default_value,
int nbins,
hash_fn *fn,
hash_compare *compare,
hash_destroy_key *destroy_key,
hash_destroy_value *destroy_value,
hash_t **ph)
{
hash_t *h;
hash__node_t **bins;
h = malloc(sizeof(*h));
if (h == NULL)
return error_OOM;
nbins = prime_nearest(nbins);
bins = calloc(nbins, sizeof(*h->bins));
if (bins == NULL)
return error_OOM;
h->bins = bins;
h->nbins = nbins;
h->count = 0;
h->default_value = default_value;
h->hash_fn = fn;
h->compare = compare;
h->destroy_key = destroy_key;
h->destroy_value = destroy_value;
*ph = h;
return error_OK;
}
| /* --------------------------------------------------------------------------
* Name: create.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "utils/utils.h"
#include "utils/primes.h"
#include "datastruct/hash.h"
#include "impl.h"
/* ----------------------------------------------------------------------- */
error hash_create(const void *default_value,
int nbins,
hash_fn *fn,
hash_compare *compare,
hash_destroy_key *destroy_key,
hash_destroy_value *destroy_value,
hash_t **ph)
{
hash_t *h;
hash__node_t **bins;
h = malloc(sizeof(*h));
if (h == NULL)
return error_OOM;
nbins = prime_nearest(nbins);
bins = calloc(nbins, sizeof(*h->bins));
if (bins == NULL)
{
free(h);
return error_OOM;
}
h->bins = bins;
h->nbins = nbins;
h->count = 0;
h->default_value = default_value;
h->hash_fn = fn;
h->compare = compare;
h->destroy_key = destroy_key;
h->destroy_value = destroy_value;
*ph = h;
return error_OK;
}
| Fix leak in calloc failure path. | Fix leak in calloc failure path.
| C | bsd-2-clause | dpt/Containers,dpt/Containers |
17d7dfc032eaa26e78855a5f91762f3663faf9f1 | libpqxx/include/pqxx/util.h | libpqxx/include/pqxx/util.h | /*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this mistake,
* or contact the author.
*
*-------------------------------------------------------------------------
*/
#ifndef PQXX_UTIL_H
#define PQXX_UTIL_H
#if defined(PQXX_HAVE_CPP_WARNING)
#warning "Deprecated libpqxx header included. Use headers without '.h'"
#elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE)
#pragma message("Deprecated libpqxx header included. Use headers without '.h'")
#endif
#define PQXX_DEPRECATED_HEADERS
#include "pqxx/util"
#endif
| /*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this mistake,
* or contact the author.
*
*-------------------------------------------------------------------------
*/
#ifndef PQXX_UTIL_H
#define PQXX_UTIL_H
#if !defined(PQXXYES_I_KNOW_DEPRECATED_HEADER)
#define PQXXYES_I_KNOW_DEPRECATED_HEADER
#if defined(PQXX_HAVE_CPP_WARNING)
#warning "Deprecated libpqxx header included. Use headers without '.h'"
#elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE)
#pragma message("Deprecated libpqxx header included. Use headers without '.h'")
#endif
#endif
#define PQXX_DEPRECATED_HEADERS
#include "pqxx/util"
#endif
| Allow suppression of "deprecated header" warning | Allow suppression of "deprecated header" warning
git-svn-id: 27238e37a5eae711b76ec703b45445819ea9563e@600 c3353b84-d008-0410-9ed9-b55c4f7fa7e8
| C | bsd-3-clause | svn2github/libpqxx,svn2github/libpqxx,svn2github/libpqxx |
c98e8774e1173d05e733fb02032d06e61813a6a3 | licharger.c | licharger.c | #include <avr/io.h>
int main (void) {
//Set pin 3 as output to source current?
PORTB = 1<<PORTB3;
DDRB = 1<<DDB3;
} | #include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
int main ( void ) {
//Disable interrupts and reset WDT timer
cli();
wdt_reset();
//Reset MCU status register
MCUSR &= ~(1<<WDRF);
//Disable watchdog
WDTCR |= (1<<WDCE) | (1<<WDE);
WDTCR = 0;
//Enable LED
DDRB = 1<<DDB3;
PORTB = 1<<PORTB3;
//Start watchdog
WDTCR |= (1<<WDCE) | (1<<WDE);
WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP1);
//Enable interrupts
sei();
while(1);
}
//Catching WatchDog interrupts
ISR ( WDT_vect ) {
PORTB ^= 1<<PORTB3;
} | Make a watchdog timer blink a LED | Make a watchdog timer blink a LED
| C | mit | Atom058/ArduinoLithiumCharger,Atom058/ArduinoLithiumCharger |
8634f6fcca8961d4a7db9dedaebf2ce216cd0592 | include/support/newlib/xlocale.h | include/support/newlib/xlocale.h | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#if defined(_NEWLIB_VERSION)
#include <cstdlib>
#include <clocale>
#include <cwctype>
#include <ctype.h>
#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
__NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
#include <support/xlocale/__nop_locale_mgmt.h>
#endif
#include <support/xlocale/__posix_l_fallback.h>
#include <support/xlocale/__strtonum_fallback.h>
#endif // _NEWLIB_VERSION
#endif
| //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#if defined(_NEWLIB_VERSION)
#include <cstdlib>
#include <clocale>
#include <cwctype>
#include <ctype.h>
#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
__NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
#include <support/xlocale/__nop_locale_mgmt.h>
#include <support/xlocale/__posix_l_fallback.h>
#include <support/xlocale/__strtonum_fallback.h>
#endif
#endif // _NEWLIB_VERSION
#endif
| Exclude posix_l/strtonum fallback inclusion for newlib > 2.4 | [libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
Summary:
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.:
projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l'
inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
^
lib/include/wctype.h:55:12: note: previous definition is here
extern int iswcntrl_l (wint_t, locale_t);
These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard.
[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=238455adfab4f8070ac65400aac22bb8a9e502fc
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=8493c1631643fada62384768408852bc0fa6ff44
Reviewers: ldionne, rsmith, EricWF
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D49927
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@338157 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx |
23de80419998d6bc4420efb1019941c1cb7bcbd5 | src/lib-fts/fts-common.h | src/lib-fts/fts-common.h | #ifndef FTS_COMMON_H
#define FTS_COMMON_H
#define IS_NONASCII_APOSTROPHE(c) \
((c) == 0x2019 || (c) == 0xFF07)
#define IS_APOSTROPHE(c) \
((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c))
#endif
| #ifndef FTS_COMMON_H
#define FTS_COMMON_H
/* Some might consider 0x02BB an apostrophe also. */
#define IS_NONASCII_APOSTROPHE(c) \
((c) == 0x2019 || (c) == 0xFF07)
#define IS_APOSTROPHE(c) \
((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c))
#endif
| Add note about possible additional apostrophe. | lib-fts: Add note about possible additional apostrophe.
| C | mit | dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot |
7e020bc3c13dadd82deed0f53740fb0bd743dfca | c/lists.c | c/lists.c | #include <stdlib.h>
#include <stdio.h>
typedef struct list {
int data;
struct list * next;
} list;
list * make_elem(void) {
list * pe;
if(NULL == (pe = malloc(sizeof(list)))) {
fprintf(stderr, "Erreur d'allocation memoire\n");
exit(EXIT_FAILURE);
}
return pe;
}
int main() {
list *pl, *pe1, *pe2, *pe3, *pe4;
pe1 = make_elem();
pe2 = make_elem();
pe3 = make_elem();
pe4 = make_elem();
pe1->data = 2;
pe2->data = 3;
pe3->data = 5;
pe4->data = 7;
pl = pe1;
pe1->next = pe2;
pe2->next = pe3;
pe3->next = pe4;
pe4->next = NULL;
list * c;
for(c=pl ; c ; c=c->next) {
printf("%d\n", c->data);
}
free(pe1);
free(pe2);
free(pe3);
free(pe4);
return 0;
}
| Add a snippet (lang C). | Add a snippet (lang C).
| C | mit | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets |
|
7f27e1272b40cf4ec090947fd3b4b620ca7de80d | examples/complex_struct.c | examples/complex_struct.c | #include <stdio.h>
typedef struct {
int *x;
int **y;
} inner ;
typedef struct {
int *g;
inner in[3];
} outer;
int *ep;
int main(int argc, char *argv[])
{
outer o;
int z = 5;
printf("%d\n" , z);
ep = &z;
o.in[2].x = ep;
*o.in[2].x = 3;
printf("%d\n" , z);
outer oo[4];
oo[2].in[2].y = &ep;
return 0;
}
| #include <stdio.h>
typedef struct {
int *x;
int **y;
} inner ;
typedef struct {
int *g;
inner in[3];
} outer;
int *ep;
int main(int argc, char *argv[])
{
outer o;
int z = 5;
int zzz;
printf("%d\n" , z);
ep = &z;
o.in[2].x = ep;
*o.in[2].x = 3;
printf("%d\n" , z);
inner i;
i.x = &zzz;
o.in[1] = i;
int **ptr = &o.in[0].x;
int *p = *ptr;
/* outer oo[4]; */
/* oo[2].in[2].y = &ep; */
return 0;
}
| Add bitwise copy of struct to complex struct example. | Add bitwise copy of struct to complex struct example.
| C | mit | plast-lab/cclyzer,plast-lab/llvm-datalog |
a32f3b03d56c02033bdebf8a5f7207738f1492ab | TDTChocolate/FoundationAdditions/NSDictionary+TDTNullNormalization.h | TDTChocolate/FoundationAdditions/NSDictionary+TDTNullNormalization.h | #import <Foundation/Foundation.h>
// Motivation:
// JSON responses frequently contain 'null'. For our purposes, a JSON object with
// a null property is equivalent to the same object with that property missing.
// However, JSON parsers treat the former as `NSNull` and the latter as nil;
// This leads to problems for the subsequent code because NSNull is a bona-fide
// object while messages to nil are discarded. Furthermore, Objective C truthy
// checks work for NSNull and fail for nil.
@interface NSDictionary (TDTNullNormalization)
/**
@return NSDictionary created by removing all enteries whose @p value is an
instance of @p NSNull.
@see NSArray+TDTNullNormalization
*/
- (NSDictionary *)tdt_dictionaryByRemovingNulls;
@end
| #import <Foundation/Foundation.h>
@interface NSDictionary (TDTNullNormalization)
/**
@return NSDictionary created by removing all enteries whose @p value is an
instance of @p NSNull.
@see NSArray+TDTNullNormalization
*/
- (NSDictionary *)tdt_dictionaryByRemovingNulls;
@end
| Remove now irrelevant motivation section | Remove now irrelevant motivation section
| C | bsd-3-clause | talk-to/Chocolate,talk-to/Chocolate |
787598f0259728ae44dcdd5ceb414a49d2a887ff | bibdesk/BDSKSearchGroupViewController.h | bibdesk/BDSKSearchGroupViewController.h | //
// BDSKSearchGroupViewController.h
// Bibdesk
//
// Created by Christiaan Hofman on 1/2/07.
/*
This software is Copyright (c) 2007
Christiaan Hofman. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
- Neither the name of Christiaan Hofman nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
@class BDSKCollapsibleView, BDSKEdgeView, BDSKSearchGroup;
@interface BDSKSearchGroupViewController : NSWindowController {
IBOutlet BDSKCollapsibleView *view;
IBOutlet BDSKEdgeView *edgeView;
IBOutlet NSSearchField *searchField;
IBOutlet NSButton *searchButton;
BDSKSearchGroup *group;
}
- (NSView *)view;
- (BDSKSearchGroup *)group;
- (void)setGroup:(BDSKSearchGroup *)newGroup;
- (IBAction)changeSearchTerm:(id)sender;
- (IBAction)nextSearch:(id)sender;
@end
| Add new header file. (or: xcode is stupid) | Add new header file. (or: xcode is stupid) | C | bsd-3-clause | ycaihua/skim-app,WoLpH/skim,WoLpH/skim,WoLpH/skim,ycaihua/skim-app,ycaihua/skim-app,WoLpH/skim,ycaihua/skim-app,WoLpH/skim,ycaihua/skim-app |
|
8055b9fdd7a11b15b6b64105dcd74daca6352ee3 | include/nekit/utils/async_io_interface.h | include/nekit/utils/async_io_interface.h | // MIT License
// Copyright (c) 2017 Zhuhao Wang
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <boost/asio.hpp>
namespace nekit {
namespace utils {
class AsyncIoInterface {
public:
AsyncIoInterface(boost::asio::io_service& io) : io_{&io} {};
~AsyncIoInterface() = default;
boost::asio::io_service& io() const { return *io_; }
private:
boost::asio::io_service* io_;
};
} // namespace utils
} // namespace nekit
| Make things based on Asio `service_io` inherite from same base | FEAT: Make things based on Asio `service_io` inherite from same base
| C | mit | zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit |
|
376f541859f5ea5914bea3c084f4be3c119ab4aa | linkedLists/isIdentical.c | linkedLists/isIdentical.c | #include "listHelper.h"
int isIdentical(struct linkList *head1, struct linkList *head2)
{
/* list1 and list2 has to have same data and length
* even if length or data mismatch , we return
* list as non identical.
*/
while(head1 != NULL && head2 != NULL) {
if(head1->data != head2->data)
return 0;
head1 = head1->next;
head2 = head2->next;
}
if(head1 == NULL && head2 == NULL)
return 1;
else
return 0;
}
void
main() {
int dat;
struct linkList *list1 = NULL, *list2 = NULL;
InsertLinkedList(&list1, 21, 1); /*Insert node in Beginning */
InsertLinkedList(&list1, 31, 2); /*Insert at position 2 */
InsertLinkedList(&list1, 41, 3);
InsertLinkedList(&list1, 51, 4);
InsertLinkedList(&list1, 61, 5);
InsertLinkedList(&list1, 72, 6);
InsertLinkedList(&list1, 87, 7);
InsertLinkedList(&list1, 98, 8);
InsertLinkedList(&list2, 21, 1); /*Insert node in Beginning */
InsertLinkedList(&list2, 31, 2); /*Insert at position 2 */
InsertLinkedList(&list2, 41, 3);
InsertLinkedList(&list2, 51, 4);
InsertLinkedList(&list2, 61, 5);
InsertLinkedList(&list2, 72, 6);
InsertLinkedList(&list2, 87, 7);
InsertLinkedList(&list2, 98, 8);
InsertLinkedList(&list2, 2014, 9);
if(isIdentical(list1, list2))
printf("isIdentical\n");
else
printf("Not Identical\n");
}
| Check if two linked lists are identical or same. | Check if two linked lists are identical or same. | C | mit | vidya-ranganathan/algorithms |
|
7c47ca226bed8793611b3262d462585de31a9309 | Classes/YSProcessTimer/YSProcessTimer.h | Classes/YSProcessTimer/YSProcessTimer.h | //
// YSProcessTimer.h
// YSProcessTimeExample
//
// Created by Yu Sugawara on 2014/02/21.
// Copyright (c) 2014年 Yu Sugawara. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef DEBUG
#define kYSProcessTimerInvalid 1
#endif
@interface YSProcessTimer : NSObject
+ (instancetype)sharedInstance;
- (instancetype)initWithProcessName:(NSString*)processName;
@property (nonatomic) NSString *processName;
- (void)startWithComment:(NSString*)comment;
- (NSTimeInterval)currentRapTime;
- (void)addRapWithComment:(NSString *)comment;
- (void)stopWithComment:(NSString*)stopComment;
@end
| //
// YSProcessTimer.h
// YSProcessTimeExample
//
// Created by Yu Sugawara on 2014/02/21.
// Copyright (c) 2014年 Yu Sugawara. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef DEBUG
#define kYSProcessTimerInvalid 1
#endif
@interface YSProcessTimer : NSObject
+ (instancetype)sharedInstance;
- (instancetype)initWithProcessName:(NSString*)processName;
@property (nonatomic, copy) NSString *processName;
- (void)startWithComment:(NSString*)comment;
- (NSTimeInterval)currentRapTime;
- (void)addRapWithComment:(NSString *)comment;
- (void)stopWithComment:(NSString*)stopComment;
@end
| Change NSString property to copy | Change NSString property to copy
| C | mit | yusuga/YSProcessTimer |
3a9c2313f04ef18261d5c8936a5724150e614eeb | EScript/Utils/SyncTools.h | EScript/Utils/SyncTools.h | // SyncTools.h
// This file is part of the EScript programming language (https://github.com/EScript)
//
// Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de>
//
// Licensed under the MIT License. See LICENSE file for details.
// ---------------------------------------------------------------------------------
#ifndef SYNCTOOLS_H_INCLUDED
#define SYNCTOOLS_H_INCLUDED
#include <thread>
#include <mutex>
#include <atomic>
namespace EScript{
namespace SyncTools{
namespace _Internals{
//! \see http://en.cppreference.com/w/cpp/atomic/atomic_flag
class SpinLock{
private:
std::atomic_flag f;
public:
SpinLock():f(ATOMIC_FLAG_INIT){}
void lock() { while(!f.test_and_set(std::memory_order_acquire)); }
bool try_lock() { return !f.test_and_set(std::memory_order_acquire); }
void unlock() { f.clear(std::memory_order_release); }
};
}
typedef std::atomic<int> atomicInt;
typedef std::atomic<bool> atomicBool;
//typedef std::mutex FastLock;
typedef _Internals::SpinLock FastLock;
typedef std::unique_lock<FastLock> FastLockHolder;
}
}
#endif // SYNCTOOLS_H_INCLUDED
| // SyncTools.h
// This file is part of the EScript programming language (https://github.com/EScript)
//
// Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de>
//
// Licensed under the MIT License. See LICENSE file for details.
// ---------------------------------------------------------------------------------
#ifndef SYNCTOOLS_H_INCLUDED
#define SYNCTOOLS_H_INCLUDED
#include <thread>
#include <mutex>
#include <atomic>
namespace EScript{
namespace SyncTools{
namespace _Internals{
//! \see http://en.cppreference.com/w/cpp/atomic/atomic_flag
class SpinLock{
std::atomic_flag f;
public:
SpinLock():f(ATOMIC_FLAG_INIT){}
void lock() { while(f.test_and_set(std::memory_order_acquire)); }
bool try_lock() { return !f.test_and_set(std::memory_order_acquire); }
void unlock() { f.clear(std::memory_order_release); }
};
}
typedef std::atomic<int> atomicInt;
typedef std::atomic<bool> atomicBool;
//typedef std::mutex FastLock;
typedef _Internals::SpinLock FastLock;
//typedef std::mutex FastLock;
typedef std::unique_lock<FastLock> FastLockHolder;
inline SyncTools::FastLockHolder tryLock(FastLock& lock){
return std::move(FastLockHolder(lock, std::try_to_lock) );
}
}
}
#endif // SYNCTOOLS_H_INCLUDED
| Fix SpinLock and add tryLock. | Fix SpinLock and add tryLock.
| C | mit | eikel/EScript,eikel/EScript |
906010c818b625f61331fde4d7384e553629912a | src/utils.h | src/utils.h | #ifndef TAILPRODUCE_UTILS_H
#define TAILPRODUCE_UTILS_H
#include <string>
#include <sstream>
#include <memory>
#include <unordered_map>
#include <utility>
#include <cereal/cereal.hpp>
#include <cereal/archives/json.hpp>
#include <cereal/types/string.hpp>
#include "helpers.h"
#include "stream.h"
#include "dbm_iterator.h"
#include "config_values.h"
#include "stream_persist.h"
namespace TailProduce {
// This block of code is used to create a stream and a producer pair from the stream persist objects in the db
template<typename ORDER_KEY, typename STORAGE>
auto
RestorePersistedStreams(TailProduce::StreamsRegistry& registry,
STORAGE& storage,
TailProduce::ConfigValues const& cv) ->
std::unordered_map< std::string, std::shared_ptr<TailProduce::Stream<ORDER_KEY>>>
{
typedef TailProduce::Stream<ORDER_KEY> STREAM;
typedef std::shared_ptr<STREAM> STREAM_PTR;
std::unordered_map<std::string, STREAM_PTR> results;
auto knownStreamsKey = cv.GetStreamsRegister(""); // passing an empty string will allow creating an iterator of all known streams
auto iterator = storage.GetIterator(knownStreamsKey);
while(!iterator.Done()) {
std::string streamValues = antibytes(iterator.Value());
TailProduce::StreamPersist persisted;
std::istringstream is(streamValues); // make the string a stream
cereal::JSONInputArchive ar(is); // make a JSON Input Archive from the string
ar(persisted); // populate Persisted
auto stream = STREAM_PTR(new STREAM(registry,
cv,
persisted.stream_name,
persisted.entry_type_name,
persisted.order_key_type_name));
results.insert(std::make_pair(stream->GetId(), stream));
iterator.Next();
}
return results;
}
template<typename STORAGE>
void
PersistStream(STORAGE storage,
TailProduce::StreamPersist &sp,
TailProduce::ConfigValues& cv)
{
// The reverse of this is to store the known streams in the DB.
std::ostringstream os;
(cereal::JSONOutputArchive(os))(sp);
std::string objStr = os.str();
TailProduce::Storage::KEY_TYPE skey = cv.GetStreamsRegister(sp.stream_name);
storage.AdminSet(skey, TailProduce::bytes(objStr));
}
};
#endif
| Add missing file. Remove debuggig statements | Add missing file. Remove debuggig statements
| C | mit | Staance/tailproduce,Staance/tailproduce |
|
3f27d22593d0d595bc4e9695d122fa16051d8990 | src/SpiralLinesGLWidget.h | src/SpiralLinesGLWidget.h | #ifndef SPIRALLINESGLWIDGET_H
#define SPIRALLINESGLWIDGET_H
#include "GLWidget.h"
#include <cmath>
class SpiralLinesGLWidget : public GLWidget
{
public:
SpiralLinesGLWidget(QWidget* parent = 0);
protected:
void initializeGL();
void render();
};
SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {}
void SpiralLinesGLWidget::initializeGL()
{
GLWidget::initializeGL();
setXRotation(-45);
setYRotation(15);
setZRotation(45);
}
void SpiralLinesGLWidget::render()
{
// How many revolutions of the spiral are rendered.
static const float REVOLUTIONS = 10;
static const float PI = 3.14159;
glBegin(GL_LINE_STRIP);
for (float angle = 0; angle < 2*PI*REVOLUTIONS; angle += PI / (2 * REVOLUTIONS * 10)) {
glVertex2f(
angle * (float) sin(angle),
angle * (float) cos(angle));
}
glEnd();
}
#endif // SPIRALLINESGLWIDGET_H
| #ifndef SPIRALLINESGLWIDGET_H
#define SPIRALLINESGLWIDGET_H
#include "GLWidget.h"
#include <cmath>
class SpiralLinesGLWidget : public GLWidget
{
public:
SpiralLinesGLWidget(QWidget* parent = 0);
protected:
void initializeGL();
void render();
};
SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {}
void SpiralLinesGLWidget::initializeGL()
{
GLWidget::initializeGL();
setXRotation(-45);
setYRotation(15);
setZRotation(45);
}
void SpiralLinesGLWidget::render()
{
// How many revolutions of the spiral are rendered.
static const float REVOLUTIONS = 10;
static const float PI = 3.14159;
// How many vertices per revolution.
static const float SLICES = 10;
glBegin(GL_LINE_STRIP);
for (int i = 0; i <= REVOLUTIONS * SLICES; i++) {
const float angle = i * 2 * PI / SLICES;
glVertex2f(
angle * (float) sin(angle),
angle * (float) cos(angle));
}
glEnd();
}
#endif // SPIRALLINESGLWIDGET_H
| Use integers instead of floats in for-loop | Use integers instead of floats in for-loop
While this adds a few more lines to the program, I think it makes it
more explicit where the constants come from. It also faciliates
easier modification of the example.
It's also safer to use an integer instead of a float as a conditional
in a for-loop. This is because floating point values are imprecise.
As a result, you may end up with one more or one fewer iteration than
you anticipated. Integers don't have this disadvantage.
| C | mit | dafrito/alpha,dafrito/alpha,dafrito/alpha |
2abad81843d091274a4615e6b04f5ba465254029 | learner/src/learner-service.h | learner/src/learner-service.h | #pragma once
#include <pthread.h>
#include <glb-lib/output.h>
#include <kmq.h>
#include <knd_shard.h>
struct kndLearnerService;
struct kndLearnerOptions
{
char *config_file;
struct addrinfo *address;
};
struct kndLearnerService
{
struct kmqKnode *knode;
struct kmqEndPoint *entry_point;
struct kndShard *shard;
char name[KND_NAME_SIZE];
size_t name_size;
char path[KND_NAME_SIZE];
size_t path_size;
char schema_path[KND_NAME_SIZE];
size_t schema_path_size;
char delivery_addr[KND_NAME_SIZE];
size_t delivery_addr_size;
size_t max_users;
const struct kndLearnerOptions *opts;
/********************* public interface *********************************/
int (*start)(struct kndLearnerService *self);
void (*del)(struct kndLearnerService *self);
};
int kndLearnerService_new(struct kndLearnerService **service, const struct kndLearnerOptions *opts);
| #pragma once
#include <pthread.h>
#include <glb-lib/output.h>
#include <kmq.h>
#include <knd_shard.h>
struct kndLearnerService;
struct kndLearnerOptions
{
char *config_file;
struct addrinfo *address;
};
struct kndLearnerService
{
struct kmqKnode *knode;
struct kmqEndPoint *entry_point;
struct kndShard *shard;
char name[KND_NAME_SIZE];
size_t name_size;
// char path[KND_NAME_SIZE];
// size_t path_size;
//
// char schema_path[KND_NAME_SIZE];
// size_t schema_path_size;
//
// char delivery_addr[KND_NAME_SIZE];
// size_t delivery_addr_size;
// size_t max_users;
const struct kndLearnerOptions *opts;
/********************* public interface *********************************/
int (*start)(struct kndLearnerService *self);
void (*del)(struct kndLearnerService *self);
};
int kndLearnerService_new(struct kndLearnerService **service, const struct kndLearnerOptions *opts);
| Comment out unused fields in kndLearnerService | Comment out unused fields in kndLearnerService
| C | agpl-3.0 | globbie/knowdy,globbie/knowdy,globbie/knowdy |
fc3cad92574b76d27c629b704f23c70ef46a2428 | core/httpd-platform.h | core/httpd-platform.h | #ifndef HTTPD_PLATFORM_H
#define HTTPD_PLATFORM_H
void httpdPlatSendData(ConnTypePtr conn, char *buff, int len);
void httpdPlatDisconnect(ConnTypePtr conn);
void httpdPlatInit(int port, int maxConnCt);
#endif | #ifndef HTTPD_PLATFORM_H
#define HTTPD_PLATFORM_H
int httpdPlatSendData(ConnTypePtr conn, char *buff, int len);
void httpdPlatDisconnect(ConnTypePtr conn);
void httpdPlatInit(int port, int maxConnCt);
#endif | Change to send routine: return status | Change to send routine: return status
| C | mpl-2.0 | chmorgan/libesphttpd |
04e7f7e951bcefbc37e8e127cf268c67f9a20e17 | setcapslock.c | setcapslock.c | #include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#define CAPSLOCK 2
void setcaps(int on)
{
Display* display = XOpenDisplay(NULL);
XkbLockModifiers(display, XkbUseCoreKbd, CAPSLOCK, on ? CAPSLOCK : 0);
XCloseDisplay(display);
}
void usage(const char* program_name)
{
printf("Usage: %s [on|off]\n\n", program_name);
printf("Use '%s' to disable your caps key");
}
int main(int argc, char** argv)
{
if (argc > 2) {
usage(argv[0]);
return 1;
}
int on = 1;
if (argc == 2) {
if (strcmp(argv[1], "on") == 0) {
on = 1;
}
else if (strcmp(argv[1], "off") == 0) {
on = 0;
}
else {
usage(argv[0]);
return 1;
}
}
setcaps(on);
return 0;
}
| #include <stdio.h>
#include <strings.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#define CAPSLOCK 2
void setcaps(int on)
{
Display* display = XOpenDisplay(NULL);
XkbLockModifiers(display, XkbUseCoreKbd, CAPSLOCK, on ? CAPSLOCK : 0);
XCloseDisplay(display);
}
void usage(const char* program_name)
{
printf("Usage: %s [on|off]\n\n", program_name);
printf("Use '%s' to disable your caps key");
}
int main(int argc, char** argv)
{
if (argc > 2) {
usage(argv[0]);
return 1;
}
int on = 1;
if (argc == 2) {
if (strcasecmp(argv[1], "on") == 0) {
on = 1;
}
else if (strcasecmp(argv[1], "off") == 0) {
on = 0;
}
else {
usage(argv[0]);
return 1;
}
}
setcaps(on);
return 0;
}
| Make command line argument case insensitive | Make command line argument case insensitive
| C | unlicense | coldfix/setcapslock |
9dec0d1f2e9a86a174b6d51b552d198a24f9ae11 | SBUF.c | SBUF.c | #! /usr/bin/tcc -run
/*** construct scroll ready screen buffer ***/
// y = 0,1,2 ... (text buffer first line, second line, ...)
// x = 0,1,2 ... (screen buffer first character in line y, ...)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
size_t linecap;
FILE *fp;
typedef struct slot
{
ssize_t size;
char *row;
int count;
} slot;
slot line;
slot* text;
void screenBuffer(int star, int stop)
{
printf("%s","entering screenBuffer\n");
slot* display = (slot *) malloc( (25)*sizeof(slot));
for (int i=0; i<25; i++) {display[i].size = 1;
display[i].row = "~";
display[i].count = 0;}
int i; int dy = -1;
for (int i = star; i<(stop+1); i++)
{dy++ ; display[dy] = text[i];}
dy = -1 ;
for (int i = star; i<(stop+1); i++)
{
dy++ ;
int stringLength = display[dy].size;
char* pointerToString = display[dy].row;
printf("%.*s", stringLength, pointerToString);
}
}
int readAline(void)
{
line.row = NULL; linecap = 0;
line.size = getline (&line.row, &linecap, fp);
if (line.size == -1) {return line.size;}
if((line.count == 0))
{ text = (slot *) malloc( (1+line.count)*sizeof(slot));}
else { text = (slot *)realloc(text,(1+line.count)*sizeof(slot));}
char * ptr = malloc(line.size*sizeof(char));
text[line.count].row = ptr ;
text[line.count].size = line.size;
memcpy(ptr,line.row,line.size);
line.count++;
return 0;
}
int main(int arc, char** argv)
{
printf("\n%s executing\n\n",argv[0]);
char *filename = "NDEX.dat"; fp = fopen(filename,"r");
int lastline;
line.count = 0;
while((readAline() != -1)) {lastline = line.count;}
for (int y = 0; y < lastline; y++)
{
for (int x = 0; x < text[y].size; x++)
{char ch = text[y].row[x]; printf("%c",ch);}
}
printf("%s","here i should be\n");
screenBuffer(1,3);
}
| Add routine screenBuffer to enable scrolling view and to enable syntax highlighting. | Add routine screenBuffer to enable scrolling view and to enable
syntax highlighting.
| C | bsd-2-clause | eingaeph/pip.imbue.hood,eingaeph/pip.imbue.hood |
|
1bc76e90771befd2be6accd71b32ae2547e98f6a | include/user.c | include/user.c | #include "user.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
user_t* NewUser(int fd,char *addr,unsigned short port,char *name){
user_t *user = malloc(sizeof(user_t));
if(user == NULL){
goto ret;
}
if(fd < 0 || addr == NULL || name == NULL){
free(user);
user = NULL;
goto ret;
}
user->fd = fd;
strcpy(user->addr,addr);
user->port = port;
strcpy(user->name,name);
user->next = NULL;
ret:
return user;
}
void AddUserToList(user_t *root,user_t *newUser){
user_t *cur = root;
while(cur->next != NULL){
cur = cur->next;
}
cur->next = newUser;
}
int CheckUserValid(user_t *root,char *name){
user_t *cur=root;
int len = strlen(name);
if(len < 2 || len > 12){
return 0;
}
if(strcmp(name,"anonymous") == 0){
return 0;
}
while(cur != NULL){
if(strcmp(cur->name,name) == 0){
return 0;
}
cur = cur->next;
}
return 1;
}
| #include "user.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
user_t* NewUser(int fd,char *addr,unsigned short port,char *name){
user_t *user = malloc(sizeof(user_t));
if(user == NULL){
goto ret;
}
if(fd < 0 || addr == NULL || name == NULL){
free(user);
user = NULL;
goto ret;
}
user->fd = fd;
strcpy(user->addr,addr);
user->port = port;
strcpy(user->name,name);
user->next = NULL;
ret:
return user;
}
void AddUserToList(user_t *root,user_t *newUser){
user_t *cur = root;
if(root == NULL){
return;
}
while(cur->next != NULL){
cur = cur->next;
}
cur->next = newUser;
}
int CheckUserValid(user_t *root,char *name){
user_t *cur=root;
int len = strlen(name);
if(len < 2 || len > 12){
return 0;
}
if(strcmp(name,"anonymous") == 0){
return 0;
}
while(cur != NULL){
if(strcmp(cur->name,name) == 0){
return 0;
}
cur = cur->next;
}
return 1;
}
| Fix AddUserToList bug when root is NULL | Fix AddUserToList bug when root is NULL
| C | apache-2.0 | Billy4195/Simple_Chatroom |
a51cfb2c9e02993446f822a491bb9d2910883a19 | kmail/kmversion.h | kmail/kmversion.h | // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.8"
#endif /*kmversion_h*/
| // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.9"
#endif /*kmversion_h*/
| Increase version number for KDE 3.5.9. | Increase version number for KDE 3.5.9.
svn path=/branches/KDE/3.5/kdepim/; revision=771811
| C | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi |
f9d5482c1d20f6724ea6ddb4cd2395db0bdc670a | src/agent/downloader.h | src/agent/downloader.h | // Copyright (c) 2015, Galaxy Authors. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: yuanyi03@baidu.com
#ifndef _DOWNLOAD_H
#define _DOWNLOAD_H
#include <string>
namespace galaxy {
class Downloader {
public:
virtual int Fetch(const std::string& uri, const std::string& dir) = 0;
virtual void Stop() = 0;
};
} // ending namespace galaxy
#endif //_DOWNLOAD_H
/* vim: set ts=4 sw=4 sts=4 tw=100 */
| // Copyright (c) 2015, Galaxy Authors. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: yuanyi03@baidu.com
#ifndef _DOWNLOAD_H
#define _DOWNLOAD_H
#include <string>
namespace galaxy {
class Downloader {
public:
virtual ~Downloader() {}
virtual int Fetch(const std::string& uri, const std::string& dir) = 0;
virtual void Stop() = 0;
};
} // ending namespace galaxy
#endif //_DOWNLOAD_H
/* vim: set ts=4 sw=4 sts=4 tw=100 */
| Add virtual deconstructor for abstract class Downloader | Add virtual deconstructor for abstract class Downloader
| C | bsd-3-clause | fxsjy/galaxy,fxsjy/galaxy,baidu/galaxy,szxw/galaxy,WangCrystal/galaxy,sdgdsffdsfff/galaxy,May2016/galaxy,ontologyzsy/galaxy,imotai/galaxy,sdgdsffdsfff/galaxy,Kai-Zhang/galaxy,May2016/galaxy,ontologyzsy/galaxy,fxsjy/galaxy,imotai/galaxy,WangCrystal/galaxy,imotai/galaxy,linyvxiang/galaxy,baidu/galaxy,fxsjy/galaxy,imotai/galaxy,bluebore/galaxy,Kai-Zhang/galaxy,ontologyzsy/galaxy,baidu/galaxy,taotaowill/galaxy,ontologyzsy/galaxy,fxsjy/galaxy,bluebore/galaxy,taotaowill/galaxy,linyvxiang/galaxy,sdgdsffdsfff/galaxy,May2016/galaxy,WangCrystal/galaxy,szxw/galaxy,imotai/galaxy,linyvxiang/galaxy,linyvxiang/galaxy,szxw/galaxy,bluebore/galaxy,bluebore/galaxy,fxsjy/galaxy,linyvxiang/galaxy,szxw/galaxy,Kai-Zhang/galaxy,fxsjy/galaxy,bluebore/galaxy,sdgdsffdsfff/galaxy,taotaowill/galaxy,ontologyzsy/galaxy,szxw/galaxy,sdgdsffdsfff/galaxy,linyvxiang/galaxy |
f3826a11eb29d54ecc30ed509699aaec7c20a969 | luv.c | luv.c | #include <string.h>
#include "luv.h"
#include "luv_functions.c"
int luv_newindex(lua_State* L) {
lua_getfenv(L, 1);
lua_pushvalue(L, 2);
lua_pushvalue(L, 3);
lua_rawset(L, -3);
lua_pop(L, 1);
return 0;
}
LUALIB_API int luaopen_luv (lua_State *L) {
luv_main_thread = L;
luaL_newmetatable(L, "luv_handle");
lua_pushcfunction(L, luv_newindex);
lua_setfield(L, -2, "__newindex");
lua_pop(L, 1);
// Module exports
lua_newtable (L);
luv_setfuncs(L, luv_functions);
return 1;
}
| #include <string.h>
#include "luv.h"
#include "luv_functions.c"
static int luv_newindex(lua_State* L) {
lua_getfenv(L, 1);
lua_pushvalue(L, 2);
lua_pushvalue(L, 3);
lua_rawset(L, -3);
lua_pop(L, 1);
return 0;
}
static int luv_index(lua_State* L) {
#ifdef LUV_STACK_CHECK
int top = lua_gettop(L);
#endif
lua_getfenv(L, 1);
lua_pushvalue(L, 2);
lua_rawget(L, -2);
lua_remove(L, -2);
#ifdef LUV_STACK_CHECK
assert(lua_gettop(L) == top + 1);
#endif
return 1;
}
LUALIB_API int luaopen_luv (lua_State *L) {
luv_main_thread = L;
luaL_newmetatable(L, "luv_handle");
lua_pushcfunction(L, luv_newindex);
lua_setfield(L, -2, "__newindex");
lua_pushcfunction(L, luv_index);
lua_setfield(L, -2, "__index");
lua_pop(L, 1);
// Module exports
lua_newtable (L);
luv_setfuncs(L, luv_functions);
return 1;
}
| Allow reading back callbacks set to handles | Allow reading back callbacks set to handles
| C | apache-2.0 | leecrest/luv,DBarney/luv,RomeroMalaquias/luv,brimworks/luv,mkschreder/luv,daurnimator/luv,xpol/luv,zhaozg/luv,daurnimator/luv,daurnimator/luv,luvit/luv,RomeroMalaquias/luv,kidaa/luv,brimworks/luv,mkschreder/luv,NanXiao/luv,NanXiao/luv,xpol/luv,joerg-krause/luv,joerg-krause/luv,DBarney/luv,zhaozg/luv,luvit/luv,kidaa/luv,leecrest/luv,RomeroMalaquias/luv |
f487686bba37f0a7a22f0f87d915b05115094948 | libc/stdio/gets.c | libc/stdio/gets.c | /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
*
* GNU Library General Public License (LGPL) version 2 or later.
*
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
#include "_stdio.h"
link_warning(gets, "the 'gets' function is dangerous and should not be used.")
/* UNSAFE FUNCTION -- do not bother optimizing */
libc_hidden_proto(getchar_unlocked)
libc_hidden_proto(__fgetc_unlocked)
libc_hidden_proto(__stdin)
char *gets(char *s)
{
register char *p = s;
int c;
__STDIO_AUTO_THREADLOCK_VAR;
__STDIO_AUTO_THREADLOCK(stdin);
/* Note: don't worry about performance here... this shouldn't be used!
* Therefore, force actual function call. */
while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) {
++p;
}
if ((c == EOF) || (s == p)) {
s = NULL;
} else {
*p = 0;
}
__STDIO_AUTO_THREADUNLOCK(stdin);
return s;
}
| /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
*
* GNU Library General Public License (LGPL) version 2 or later.
*
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
#include "_stdio.h"
link_warning(gets, "the 'gets' function is dangerous and should not be used.")
/* UNSAFE FUNCTION -- do not bother optimizing */
libc_hidden_proto(getchar_unlocked)
libc_hidden_proto(__fgetc_unlocked)
#ifdef __STDIO_GETC_MACRO
libc_hidden_proto(__stdin)
#else
#define __stdin stdin
#endif
char *gets(char *s)
{
register char *p = s;
int c;
__STDIO_AUTO_THREADLOCK_VAR;
__STDIO_AUTO_THREADLOCK(stdin);
/* Note: don't worry about performance here... this shouldn't be used!
* Therefore, force actual function call. */
while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) {
++p;
}
if ((c == EOF) || (s == p)) {
s = NULL;
} else {
*p = 0;
}
__STDIO_AUTO_THREADUNLOCK(stdin);
return s;
}
| Build if GETC_MACRO use is disabled | Build if GETC_MACRO use is disabled
| C | lgpl-2.1 | joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc |
da7beedbb4b1f5cfa2b546d6fe41bb158845afe0 | src/pch.h | src/pch.h | #pragma once
#define NOMINMAX
#include <windows.h>
#include <streams.h>
#include <audioclient.h>
#include <comdef.h>
#include <malloc.h>
#include <mmdeviceapi.h>
#include <process.h>
#include <algorithm>
#include <array>
#include <cassert>
#include <deque>
#include <functional>
#include <future>
#include <map>
#include <memory>
#include "Utils.h"
namespace SaneAudioRenderer
{
_COM_SMARTPTR_TYPEDEF(IMMDeviceEnumerator, __uuidof(IMMDeviceEnumerator));
_COM_SMARTPTR_TYPEDEF(IMMDevice, __uuidof(IMMDevice));
_COM_SMARTPTR_TYPEDEF(IAudioClient, __uuidof(IAudioClient));
_COM_SMARTPTR_TYPEDEF(IAudioRenderClient, __uuidof(IAudioRenderClient));
_COM_SMARTPTR_TYPEDEF(IAudioClock, __uuidof(IAudioClock));
_COM_SMARTPTR_TYPEDEF(IMediaSample, __uuidof(IMediaSample));
}
| #pragma once
#ifndef NOMINMAX
# define NOMINMAX
#endif
#include <windows.h>
#include <streams.h>
#include <audioclient.h>
#include <comdef.h>
#include <malloc.h>
#include <mmdeviceapi.h>
#include <process.h>
#include <algorithm>
#include <array>
#include <cassert>
#include <deque>
#include <functional>
#include <future>
#include <map>
#include <memory>
#include "Utils.h"
namespace SaneAudioRenderer
{
_COM_SMARTPTR_TYPEDEF(IMMDeviceEnumerator, __uuidof(IMMDeviceEnumerator));
_COM_SMARTPTR_TYPEDEF(IMMDevice, __uuidof(IMMDevice));
_COM_SMARTPTR_TYPEDEF(IAudioClient, __uuidof(IAudioClient));
_COM_SMARTPTR_TYPEDEF(IAudioRenderClient, __uuidof(IAudioRenderClient));
_COM_SMARTPTR_TYPEDEF(IAudioClock, __uuidof(IAudioClock));
_COM_SMARTPTR_TYPEDEF(IMediaSample, __uuidof(IMediaSample));
}
| Make sure NOMINMAX is not redefined | Make sure NOMINMAX is not redefined
| C | lgpl-2.1 | kasper93/sanear,kasper93/sanear,alexmarsev/sanear,kasper93/sanear,alexmarsev/sanear |
1ec14d4fd52cb05096b46a940d490433635508b4 | PWGLF/NUCLEX/Hypernuclei/Vertexer3Body/AliVertexerHyperTriton3Body.h | PWGLF/NUCLEX/Hypernuclei/Vertexer3Body/AliVertexerHyperTriton3Body.h | #ifndef ALIVERTEXERHYPERTRITON3BODY_H
#define ALIVERTEXERHYPERTRITON3BODY_H
#include <AliVertexerTracks.h>
class AliESDVertex;
class AliESDtrack;
class AliExternalTrackParam;
class AliVertexerHyperTriton3Body
{
public:
AliVertexerHyperTriton3Body();
AliESDVertex* GetCurrentVertex() { return mCurrentVertex; }
bool FindDecayVertex(AliESDtrack *track1, AliESDtrack *track2, AliESDtrack* track3, float b);
static void Find2ProngClosestPoint(AliExternalTrackParam *track1, AliExternalTrackParam *track2, float b, float* pos);
void SetMaxDinstanceInit(float maxD) { mMaxDistanceInitialGuesses = maxD; }
void SetToleranceGuessCompatibility(int tol) { mToleranceGuessCompatibility = tol; }
AliVertexerTracks mVertexerTracks;
private:
AliESDVertex* mCurrentVertex;
float mPosition[3];
float mCovariance[6];
float mMaxDistanceInitialGuesses;
int mToleranceGuessCompatibility;
};
#endif | #ifndef ALIVERTEXERHYPERTRITON3BODY_H
#define ALIVERTEXERHYPERTRITON3BODY_H
class TClonesArray; /// This will be removed as soon as alisw/AliRoot#898 is merged and a new tag is available
#include <AliVertexerTracks.h>
class AliESDVertex;
class AliESDtrack;
class AliExternalTrackParam;
class AliVertexerHyperTriton3Body
{
public:
AliVertexerHyperTriton3Body();
AliESDVertex* GetCurrentVertex() { return mCurrentVertex; }
bool FindDecayVertex(AliESDtrack *track1, AliESDtrack *track2, AliESDtrack* track3, float b);
static void Find2ProngClosestPoint(AliExternalTrackParam *track1, AliExternalTrackParam *track2, float b, float* pos);
void SetMaxDinstanceInit(float maxD) { mMaxDistanceInitialGuesses = maxD; }
void SetToleranceGuessCompatibility(int tol) { mToleranceGuessCompatibility = tol; }
AliVertexerTracks mVertexerTracks;
private:
AliESDVertex* mCurrentVertex;
float mPosition[3];
float mCovariance[6];
float mMaxDistanceInitialGuesses;
int mToleranceGuessCompatibility;
};
#endif | Fix for missing forward declaration in AliROOT | Fix for missing forward declaration in AliROOT
| C | bsd-3-clause | AMechler/AliPhysics,victor-gonzalez/AliPhysics,kreisl/AliPhysics,hcab14/AliPhysics,pbuehler/AliPhysics,carstooon/AliPhysics,fcolamar/AliPhysics,AMechler/AliPhysics,dmuhlhei/AliPhysics,dmuhlhei/AliPhysics,preghenella/AliPhysics,hcab14/AliPhysics,akubera/AliPhysics,sebaleh/AliPhysics,hcab14/AliPhysics,fbellini/AliPhysics,dmuhlhei/AliPhysics,fbellini/AliPhysics,SHornung1/AliPhysics,victor-gonzalez/AliPhysics,pbuehler/AliPhysics,hzanoli/AliPhysics,amatyja/AliPhysics,nschmidtALICE/AliPhysics,fbellini/AliPhysics,preghenella/AliPhysics,amaringarcia/AliPhysics,adriansev/AliPhysics,hzanoli/AliPhysics,alisw/AliPhysics,amaringarcia/AliPhysics,amatyja/AliPhysics,pchrista/AliPhysics,sebaleh/AliPhysics,preghenella/AliPhysics,carstooon/AliPhysics,alisw/AliPhysics,pchrista/AliPhysics,nschmidtALICE/AliPhysics,btrzecia/AliPhysics,rbailhac/AliPhysics,amatyja/AliPhysics,pchrista/AliPhysics,mpuccio/AliPhysics,btrzecia/AliPhysics,amatyja/AliPhysics,akubera/AliPhysics,mpuccio/AliPhysics,mvala/AliPhysics,nschmidtALICE/AliPhysics,lcunquei/AliPhysics,SHornung1/AliPhysics,mpuccio/AliPhysics,carstooon/AliPhysics,alisw/AliPhysics,hcab14/AliPhysics,alisw/AliPhysics,rihanphys/AliPhysics,hcab14/AliPhysics,preghenella/AliPhysics,SHornung1/AliPhysics,alisw/AliPhysics,sebaleh/AliPhysics,mvala/AliPhysics,kreisl/AliPhysics,rbailhac/AliPhysics,rihanphys/AliPhysics,rbailhac/AliPhysics,rbailhac/AliPhysics,akubera/AliPhysics,kreisl/AliPhysics,mpuccio/AliPhysics,rihanphys/AliPhysics,kreisl/AliPhysics,pbuehler/AliPhysics,btrzecia/AliPhysics,nschmidtALICE/AliPhysics,sebaleh/AliPhysics,akubera/AliPhysics,kreisl/AliPhysics,AMechler/AliPhysics,lcunquei/AliPhysics,adriansev/AliPhysics,kreisl/AliPhysics,hcab14/AliPhysics,carstooon/AliPhysics,victor-gonzalez/AliPhysics,amaringarcia/AliPhysics,SHornung1/AliPhysics,btrzecia/AliPhysics,sebaleh/AliPhysics,akubera/AliPhysics,carstooon/AliPhysics,kreisl/AliPhysics,victor-gonzalez/AliPhysics,rihanphys/AliPhysics,AMechler/AliPhysics,victor-gonzalez/AliPhysics,AMechler/AliPhysics,amaringarcia/AliPhysics,preghenella/AliPhysics,pchrista/AliPhysics,rbailhac/AliPhysics,amaringarcia/AliPhysics,pchrista/AliPhysics,lcunquei/AliPhysics,fcolamar/AliPhysics,lcunquei/AliPhysics,fcolamar/AliPhysics,victor-gonzalez/AliPhysics,btrzecia/AliPhysics,mpuccio/AliPhysics,amatyja/AliPhysics,pchrista/AliPhysics,btrzecia/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,pbuehler/AliPhysics,amatyja/AliPhysics,adriansev/AliPhysics,preghenella/AliPhysics,hcab14/AliPhysics,adriansev/AliPhysics,fcolamar/AliPhysics,fbellini/AliPhysics,hzanoli/AliPhysics,adriansev/AliPhysics,hzanoli/AliPhysics,AMechler/AliPhysics,fbellini/AliPhysics,akubera/AliPhysics,fcolamar/AliPhysics,hzanoli/AliPhysics,rbailhac/AliPhysics,preghenella/AliPhysics,adriansev/AliPhysics,AMechler/AliPhysics,rihanphys/AliPhysics,hzanoli/AliPhysics,dmuhlhei/AliPhysics,mvala/AliPhysics,carstooon/AliPhysics,amaringarcia/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,rihanphys/AliPhysics,victor-gonzalez/AliPhysics,pbuehler/AliPhysics,fcolamar/AliPhysics,carstooon/AliPhysics,fcolamar/AliPhysics,dmuhlhei/AliPhysics,nschmidtALICE/AliPhysics,mvala/AliPhysics,pbuehler/AliPhysics,adriansev/AliPhysics,btrzecia/AliPhysics,mpuccio/AliPhysics,rihanphys/AliPhysics,lcunquei/AliPhysics,mvala/AliPhysics,nschmidtALICE/AliPhysics,fbellini/AliPhysics,mvala/AliPhysics,fbellini/AliPhysics,alisw/AliPhysics,amaringarcia/AliPhysics,pbuehler/AliPhysics,hzanoli/AliPhysics,alisw/AliPhysics,amatyja/AliPhysics,akubera/AliPhysics,sebaleh/AliPhysics,dmuhlhei/AliPhysics,dmuhlhei/AliPhysics,sebaleh/AliPhysics,mpuccio/AliPhysics,SHornung1/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,mvala/AliPhysics,pchrista/AliPhysics |
2f40aad6b9d0ed57c32b48854d4b7a4358924738 | sys/i386/linux/linux_genassym.c | sys/i386/linux/linux_genassym.c | /* $FreeBSD$ */
#include <sys/param.h>
#include <sys/assym.h>
#include <i386/linux/linux.h>
ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
ASSYM(LINUX_SC_GS, offsetof(struct l_sigcontext, sc_gs));
ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags));
ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
| /* $FreeBSD$ */
#include <sys/param.h>
#include <sys/assym.h>
#include <sys/systm.h>
#include <i386/linux/linux.h>
ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
ASSYM(LINUX_SC_GS, offsetof(struct l_sigcontext, sc_gs));
ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags));
ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
| Include <sys/systm.h> for the definition of offsetof() instead of depending on the definition being misplaced in <sys/types.h>. The definition probably belongs in <sys/stddef.h>. | Include <sys/systm.h> for the definition of offsetof() instead of depending
on the definition being misplaced in <sys/types.h>. The definition probably
belongs in <sys/stddef.h>.
| C | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase |
175264adfef6d6e050c2ca7caf5e8afddefeceb7 | src/Core/RAlloc.h | src/Core/RAlloc.h | #ifndef RUTIL2_RALLOC_H
#define RUTIL2_RALLOC_H
#include "OO.h"
void* RAlloc(int Size);
void* RAlign(int Align, int Size);
#if defined(__MINGW32__)
#define _aligned_malloc __mingw_aligned_malloc
#define _aligned_free __mingw_aligned_free
#define memalign(align, size) _aligned_malloc(size, align)
#endif //For MinGW
#define RFree(...) __RFree(__VA_ARGS__, (void*)(- 1))
void __RFree(void* a, ...);
#define RAlloc_Class(Name, Size) \
(Name*)__RAlloc_Class(Size, sizeof(Name), _C(__ClassID_, Name, __));
void* __RAlloc_Class(int Size, int UnitSize, int ClassID);
#if 0
#include "_RAlloc.h"
#endif
#ifdef __RUtil2_Install
#define _RTAddress "RUtil2/Core/_RAlloc.h"
#else
#define _RTAddress "Core/_RAlloc.h"
#endif
#define _ClassName
#define _Attr 1
#include "Include_T1AllTypes.h"
#endif //RUTIL2_RALLOC_H
| #ifndef RUTIL2_RALLOC_H
#define RUTIL2_RALLOC_H
#include <memory.h>
#include "OO.h"
void* RAlloc(int Size);
void* RAlign(int Align, int Size);
#if defined(__MINGW32__)
#define _aligned_malloc __mingw_aligned_malloc
#define _aligned_free __mingw_aligned_free
#define memalign(align, size) _aligned_malloc(size, align)
#endif //For MinGW
#define RClean(Ptr) memset(Ptr, 0, sizeof(Ptr));
#define RFree(...) __RFree(__VA_ARGS__, (void*)(- 1))
void __RFree(void* a, ...);
#define RAlloc_Class(Name, Size) \
(Name*)__RAlloc_Class(Size, sizeof(Name), _C(__ClassID_, Name, __));
void* __RAlloc_Class(int Size, int UnitSize, int ClassID);
#if 0
#include "_RAlloc.h"
#endif
#ifdef __RUtil2_Install
#define _RTAddress "RUtil2/Core/_RAlloc.h"
#else
#define _RTAddress "Core/_RAlloc.h"
#endif
#define _ClassName
#define _Attr 1
#include "Include_T1AllTypes.h"
#endif //RUTIL2_RALLOC_H
| Add method 'RClean' for clean memory | Add method 'RClean' for clean memory
| C | mit | Icenowy/RUtil2,Rocaloid/RUtil2,Rocaloid/RUtil2,Icenowy/RUtil2,Icenowy/RUtil2,Rocaloid/RUtil2 |