after stringlengths 72 2.11k | before stringlengths 21 1.55k | diff stringlengths 85 2.31k | instruction stringlengths 20 1.71k | license stringclasses 13
values | repos stringlengths 7 82.6k | commit stringlengths 40 40 |
|---|---|---|---|---|---|---|
/**
* Win32 EntropySource Header File
* (C) 1999-2008 Jack Lloyd
*/
#ifndef BOTAN_ENTROPY_SRC_WIN32_H__
#define BOTAN_ENTROPY_SRC_WIN32_H__
#include <botan/entropy_src.h>
namespace Botan {
/**
* Win32 Entropy Source
*/
class BOTAN_DLL Win32_EntropySource : public EntropySource
{
public:
std::string name... | /**
* Win32 EntropySource Header File
* (C) 1999-2008 Jack Lloyd
*/
#ifndef BOTAN_ENTROPY_SRC_WIN32_H__
#define BOTAN_ENTROPY_SRC_WIN32_H__
#include <botan/entropy_src.h>
namespace Botan {
/**
* Win32 Entropy Source
*/
class BOTAN_DLL Win32_EntropySource : public EntropySource
{
public:
std::string name... | ---
+++
@@ -17,8 +17,9 @@
{
public:
std::string name() const { return "Win32 Statistics"; }
- void fast_poll(byte buf[], u32bit length);
- void slow_poll(byte buf[], u32bit length);
+
+ u32bit fast_poll(byte buf[], u32bit length);
+ u32bit slow_poll(byte buf[], u32bit length);
}... | Fix return types in declaration
| bsd-2-clause | webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz... | cf1dc543f142263917468c19249d6a3e920b17b2 |
#include <stdio.h>
#include <stdlib.h>
#include "../brk.h"
#include <unistd.h>
#include "clock.h"
#define MIN_ALLOC (1024)
#define HEADER_SIZE (16)
int main(int argc, char *argv[]) {
void **ptrs;
long num;
long i;
int small_malloc = HEADER_SIZE;
int medium_malloc = (MIN_ALLOC - 3) * HEADER_SIZE;
int larg... | #include <stdio.h>
#include <stdlib.h>
#include "../brk.h"
#include <unistd.h>
#include "clock.h"
int main(int argc, char *argv[]) {
int nbytes = 5;
void **ptrs;
long num;
long i;
num = atol(argv[1]);
ptrs = malloc(sizeof(void*) * num);
for(i = 0; i < num; i++) {
ptrs[i] = malloc(nbytes);
mall... | ---
+++
@@ -4,19 +4,25 @@
#include <unistd.h>
#include "clock.h"
+#define MIN_ALLOC (1024)
+#define HEADER_SIZE (16)
+
int main(int argc, char *argv[]) {
- int nbytes = 5;
void **ptrs;
long num;
long i;
+
+ int small_malloc = HEADER_SIZE;
+ int medium_malloc = (MIN_ALLOC - 3) * HEADER_SIZE;
+ int la... | Make worst case actual worst case.
| mit | mbark/os14,mbark/os14,mbark/os14 | f78169f840c0a551e90df1c45ef17325263ee95c |
#include "mruby.h"
#include "mruby/value.h"
static mrb_value longsize(mrb_state *mrb, mrb_value self)
{
uint8_t size = (uint8_t)sizeof(long);
return mrb_fixnum_value(size);
}
/* ruby calls this to load the extension */
void mrb_mruby_rubyffi_compat_gem_init(mrb_state *mrb)
{
struct RClass *mod = mrb_define_m... | #include "mruby.h"
#include "mruby/value.h"
static mrb_value longsize(mrb_state *mrb, mrb_value self)
{
uint8_t size = (uint8_t)sizeof(long);
return mrb_fixnum_value(size);
}
/* ruby calls this to load the extension */
void mrb_mruby_rubyffi_compat_gem_init(mrb_state *mrb)
{
struct RClass *mod = mrb_define_m... | ---
+++
@@ -14,7 +14,7 @@
void mrb_mruby_rubyffi_compat_gem_init(mrb_state *mrb)
{
struct RClass *mod = mrb_define_module(mrb, "FFI");
- mrb_define_class_method(mrb, mod, "longsize", longsize, ARGS_NONE());
+ mrb_define_class_method(mrb, mod, "longsize", longsize, MRB_ARGS_NONE());
}
void mrb_mruby_rubyffi... | Fix for "implicit declaration of function 'ARGS_NONE' is invalid" error
| mit | schmurfy/mruby-rubyffi-compat,schmurfy/mruby-rubyffi-compat,schmurfy/mruby-rubyffi-compat | 7cad08e5c045a002e25c710ccb528f22e21ed835 |
#include <stdio.h>
#include <stdlib.h>
#ifndef METADATA_H
#define METADATA_H
typedef struct Metadata
{
/**
* File's name.
*/
char md_name[255];
/**
* File's extension.
*/
char md_extension[10];
/**
* List of keywords to describe the file.
*/
char md_keywords[255];
... | #include <stdio.h>
#include <stdlib.h>
#ifndef METADATA_H
#define METADATA_H
typedef struct Metadata
{
/**
* File's name.
*/
char md_name[255];
/**
* File's extension.
*/
char md_extension[10];
/**
* List of keywords to describe the file.
*/
char md_keywords[255];
/**
* Hash of t... | ---
+++
@@ -6,27 +6,27 @@
typedef struct Metadata
{
- /**
- * File's name.
- */
- char md_name[255];
+ /**
+ * File's name.
+ */
+ char md_name[255];
- /**
- * File's extension.
- */
- char md_extension[10];
+ /**
+ * File's extension.
+ */
+ char md_extension[10];
- /**
-... | Indent better than Videl :)
| mit | Videl/FrogidelTorrent,Videl/FrogidelTorrent | 94212f6fdc2b9f135f69e42392485adce8b04cc7 |
/*
Copyright 2019 The Matrix.org Foundation C.I.C
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... | /*
Copyright 2019 The Matrix.org Foundation C.I.C
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... | ---
+++
@@ -26,7 +26,7 @@
*/
@interface MXReplyEventParser : NSObject
-- (MXReplyEventParts*)parse:(MXEvent*)replyEvent;
+- (nullable MXReplyEventParts*)parse:(MXEvent*)replyEvent;
@end
| Make reply parser result optional
| apache-2.0 | matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk | cc884148c3ba9903d9d2355cfd31ddbba3a2b77d |
/* Exercise 5-3 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc < 3 || argc > 4) {
usageErr("%s filename num-bytes [x]", argv[0]);
}
long n = getLong(argv[2], GN_NONNEG | GN_ANY_BASE, "num-bytes");
Boolean x = argc == 4 && strcmp(argv[3], "x") ... | /* Exercise 5-3 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc < 3 || argc > 4) {
usageErr("%s filename num-bytes [x]", argv[0]);
}
long n = getLong(argv[2], GN_NONNEG | GN_ANY_BASE, "num-bytes");
Boolean x = argc == 4 && strcmp(argv[3], "x") ... | ---
+++
@@ -24,4 +24,10 @@
errExit("write byte a");
}
}
+
+ if (close(fd) == -1) {
+ errExit("close output");
+ }
+
+ exit(EXIT_SUCCESS);
} | Add missing close for file descriptor
| mit | dalleng/tlpi-exercises,timjb/tlpi-exercises,dalleng/tlpi-exercises,timjb/tlpi-exercises | ecd76f902198765339c7923c2e3f8538a431ac1f |
//! \file WalkerException.h
#ifndef WALKEREXCEPTION_H
#define WALKEREXCEPTION_H
#include <stdexcept>
#include <string>
namespace WikiWalker
{
//! (base) class for exceptions in WikiWalker
class WalkerException : public std::runtime_error
{
public:
/*! Create a Walker exception with a message.
*
... | //! \file WalkerException.h
#ifndef WALKEREXCEPTION_H
#define WALKEREXCEPTION_H
#include <stdexcept>
#include <string>
namespace WikiWalker
{
//! (base) class for exceptions in WikiWalker
class WalkerException : public std::runtime_error
{
public:
/*! Create a Walker exception with a message.
*
... | ---
+++
@@ -19,7 +19,7 @@
*
* \param exmessage The exception message.
*/
- explicit WalkerException(std::string exmessage) : runtime_error(exmessage)
+ explicit WalkerException(const std::string& exmessage) : runtime_error(exmessage)
{
}
}; | Use const reference for exception
| mit | dueringa/WikiWalker | 14ca78ef6e4f09ca085f0d19c9029895d5c57376 |
/*-------------------------------------------------------------------------
*
* dynahash--
* POSTGRES dynahash.h file definitions
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: dynahash.h,v 1.2 1996/11/14 20:06:39 scrappy Exp $
*
*------------------------------------------------... | /*-------------------------------------------------------------------------
*
* dynahash--
* POSTGRES dynahash.h file definitions
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: dynahash.h,v 1.1 1996/11/09 05:48:28 momjian Exp $
*
*------------------------------------------------... | ---
+++
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dynahash.h,v 1.1 1996/11/09 05:48:28 momjian Exp $
+ * $Id: dynahash.h,v 1.2 1996/11/14 20:06:39 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,5 +15,5 @... | Fix a comment that wasn't commente'd out
Pointed out by: Erik Bertelsen <erik@sockdev.uni-c.dk>
| apache-2.0 | adam8157/gpdb,Chibin/gpdb,adam8157/gpdb,rubikloud/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,zeroae/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,Quikling/gpdb,chrishajas/gpdb,chrishajas/gpdb,zaksoup/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,y... | fb3b9d76611d1e7ac1d7896aff469a52d36b6078 |
/*
* Copyright (c) 2002-2004, Index Data
* See the file LICENSE for details.
*
* $Id: tstnmem.c,v 1.3 2005-01-05 10:29:42 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <yaz/nmem.h>
int main (int argc, char **arg... | /*
* Copyright (c) 2002-2004, Index Data
* See the file LICENSE for details.
*
* $Id: tstnmem.c,v 1.2 2004-09-29 20:15:48 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <yaz/nmem.h>
int main (int argc, char **arg... | ---
+++
@@ -2,7 +2,7 @@
* Copyright (c) 2002-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: tstnmem.c,v 1.2 2004-09-29 20:15:48 adam Exp $
+ * $Id: tstnmem.c,v 1.3 2005-01-05 10:29:42 adam Exp $
*/
#if HAVE_CONFIG_H
@@ -31,6 +31,14 @@
cp = nmem_malloc(n, j);
if (!cp)
... | Check that assignments to NMEM memory for some basic types
| bsd-3-clause | dcrossleyau/yaz,nla/yaz,dcrossleyau/yaz,nla/yaz,nla/yaz,dcrossleyau/yaz,nla/yaz | 7788edff9108cafc593759e9e406d6da6509c799 |
// Test this without pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
// Test with pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h &&
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o -
char *g0(cha... | // Test this without pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
// Test with pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -o %t %S/va_arg.h &&
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o -
char *g0(char** argv, ... | ---
+++
@@ -2,7 +2,7 @@
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
// Test with pch.
-// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -o %t %S/va_arg.h &&
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h &&
// RUN: clang-cc -tri... | Fix a problem with the RUN line of one of the PCH tests
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@70227 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | ce5148894cbf4a465e2bc1158e8a4f8a729f6632 |
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
unsigned long int buffer_length = ... | /* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
static unsigned char buffer[256 * 1024] = { 0 };
int LLVMFuzzerTestOneInput(const uint8_t* data, siz... | ---
+++
@@ -8,13 +8,23 @@
#include "miniz.h"
-static unsigned char buffer[256 * 1024] = { 0 };
-
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
- unsigned long int buffer_length = sizeof(buffer);
+ unsigned long int buffer_length = 1;
+ unsigned char *buffer = NULL;
+ int z_status =... | Use variable size input buffer in uncompress fuzzer.
| mit | richgel999/miniz,richgel999/miniz,richgel999/miniz | 1e7621d96cb9d0821c61db6f4e3ef36ddc19b0cd |
#ifndef _DOORS_H_
#define _DOORS_H_
#ifndef NUMBER_OF_DOORS
#define NUMBER_OF_DOORS 3
#endif
#include <limits.h>
#if (NUMBER_OF_DOORS > UINT_MAX)
#error (n) doors exceeds storage allocation limit for `unsigned int'.
#endif
typedef struct {
unsigned int has_prize : 1;
unsigned int currently_s... | #ifndef _DOORS_H_
#define _DOORS_H_
#ifndef NUMBER_OF_DOORS
#define NUMBER_OF_DOORS 3
#endif
typedef struct {
unsigned int has_prize : 1;
unsigned int currently_selected: 1;
unsigned int revealed : 1;
} door;
/*
* game status updates
*/
extern void set_doors(void);
extern vo... | ---
+++
@@ -3,6 +3,11 @@
#ifndef NUMBER_OF_DOORS
#define NUMBER_OF_DOORS 3
+#endif
+
+#include <limits.h>
+#if (NUMBER_OF_DOORS > UINT_MAX)
+#error (n) doors exceeds storage allocation limit for `unsigned int'.
#endif
typedef struct { | Throw a fatal pre-processor error if (n > UINT_MAX).
| cc0-1.0 | cxd4/Monty-Hall,cxd4/Monty-Hall | 02abf1a1f71cbd7db8b0e0e4d9e94ea1070d7d9a |
/**
https://www.urionlinejudge.com.br/judge/en/problems/view/1098
*/
#include <stdio.h>
int main(){
int i, j;
float iR, jR;
for(i = 0; i <= 20; i += 2){
for (j = 10; j <= 30; j += 10){
iR = (float) i/10;
jR = (float) (i+j)/10;
if (i % 10) printf("I=%.1f J=%.1f\n", iR, jR);
else printf("I=%.0f J... | /**
https://www.urionlinejudge.com.br/judge/en/problems/view/1098
TODO:
Resolver a formatação da última impressão do loop.
Está:
I=2.0 J=3.0
I=2.0 J=4.0
I=2.0 J=5.0
Mas deveria estar:
I=2 J=3
I=2 J=4
I=2 J=5
*/
#include <stdio.h>
int main(){
double i, j;
i = 0;
do{
for (j = 1; j <= 3; j++){
if (i == (int... | ---
+++
@@ -1,40 +1,25 @@
/**
https://www.urionlinejudge.com.br/judge/en/problems/view/1098
-
-TODO:
-Resolver a formatação da última impressão do loop.
-Está:
-I=2.0 J=3.0
-I=2.0 J=4.0
-I=2.0 J=5.0
-Mas deveria estar:
-I=2 J=3
-I=2 J=4
-I=2 J=5
-
*/
#include <stdio.h>
int main(){
- double i, j;
+ int i, j... | Fix bug and solves the sequence
| unknown | Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/MISC-Algs | 7bf1f1785e610d9d5148552963edb7b00ff77700 |
//
// SVNetworking.h
// SVNetworking
//
// Created by Nate Stedman on 3/14/14.
// Copyright (c) 2014 Svpply. All rights reserved.
//
#import "NSObject+SVBindings.h"
#import "NSObject+SVMultibindings.h"
#import "SVDataRequest.h"
#import "SVDiskCache.h"
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSO... | //
// SVNetworking.h
// SVNetworking
//
// Created by Nate Stedman on 3/14/14.
// Copyright (c) 2014 Svpply. All rights reserved.
//
#import "NSObject+SVBindings.h"
#import "NSObject+SVMultibindings.h"
#import "SVDataRequest.h"
#import "SVDiskCache.h"
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSO... | ---
+++
@@ -13,10 +13,12 @@
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSONRequest.h"
+#import "SVRemoteArray.h"
#import "SVRemoteImage.h"
#import "SVRemoteImageProtocol.h"
#import "SVRemoteDataRequestResource.h"
#import "SVRemoteDataResource.h"
+#import "SVRemoteJSONArray.h"
#import "SVRemot... | Add remote array classes to headers.
| bsd-3-clause | eBay/SVNetworking,eBay/SVNetworking | b4bf84df34dd90041f076eb777454d01c41042c0 |
#ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#include "rvalue.h"
namespace ehl
{
template<typename T>
class isr_written_variable
{
private:
mutable volatile bool modified;
volatile T value;
public:
isr_written_variable() = default;
isr_writte... | #ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#include "rvalue.h"
namespace ehl
{
template<typename T>
class isr_written_variable
{
private:
mutable volatile bool modified;
volatile T value;
public:
isr_written_variable() = default;
isr_writte... | ---
+++
@@ -36,14 +36,13 @@
operator T() const
{
- modified = false;
- T v = value;
- while(modified)
+ while(true)
{
modified = false;
- v = value;
+ T v = value;
+ if(!modified)
+ return v;
}
- return v;
}
};
} | Refactor to clean up isr written variable
| mit | hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary | fac8751ad9ac6eab7f5b86fe5fc82d1ca59a7b2a |
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8))
#define PT_DISPATCH_RETAIN_RELEASE 1
#endif
#define PT_PRECISE_LIF... | #if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8))
#define PT_DISPATCH_RETAIN_RELEASE 1
#endif
#if PT_DISPATCH_RETAIN... | ---
+++
@@ -3,10 +3,10 @@
#define PT_DISPATCH_RETAIN_RELEASE 1
#endif
-#if PT_DISPATCH_RETAIN_RELEASE
#define PT_PRECISE_LIFETIME
#define PT_PRECISE_LIFETIME_UNUSED
-#else
+
+#if defined(PT_DISPATCH_RETAIN_RELEASE) && PT_DISPATCH_RETAIN_RELEASE
#define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime))... | Fix logic that enables pre-ARC behavior
| mit | fly19890211/peertalk,philikon/peertalk,fly19890211/peertalk,yexihu/peertalk,yexihu/peertalk,fly19890211/peertalk,rsms/peertalk,ChetanGandhi/peertalk,philikon/peertalk,ChetanGandhi/peertalk,yexihu/peertalk,rsms/peertalk,msdgwzhy6/peertalk,TaoXueCheng/peertalk,artifacts/peertalk,artifacts/peertalk,dguillamot/PFMacOSClien... | f0b582a6639ad908211c938287fad26fc99a34dc |
#ifndef TGBOT_EXPORT_H
#define TGBOT_EXPORT_H
#ifndef TGBOT_API
#ifdef TGBOT_DLL
#if defined _WIN32 || defined __CYGWIN__
#define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport)
#define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport)
#else
#if __GNUC__ >= 4
... | #ifndef TGBOT_EXPORT_H
#define TGBOT_EXPORT_H
#ifndef TGBOT_API
#ifdef TGBOT_DLL
#if defined _WIN32 || defined __CYGWIN__
#define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport)
#define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport)
#else
#if __GNUC__ >= 4
... | ---
+++
@@ -4,21 +4,21 @@
#ifndef TGBOT_API
#ifdef TGBOT_DLL
#if defined _WIN32 || defined __CYGWIN__
+ #define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport)
#define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport)
- #define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport)
... | Fix mistake FOX and reorder EXPORT/IMPORT
| mit | reo7sp/tgbot-cpp,reo7sp/tgbot-cpp,reo7sp/tgbot-cpp | 3b7da8cd1e2f77d73cc19533fc657ba10a80c8cd |
#include "openflow_flowtable.h"
#include "mut.h"
#include <stdint.h>
#include "common_def.h"
extern void openflow_flowtable_set_defaults(void);
extern uint8_t openflow_flowtable_ip_compare(uint32_t ip_1, uint32_t ip_2,
uint8_t ip_len);
TESTSUITE_BEGIN
TEST_BEGIN("Flowtable Modification")
openflow_flowtabl... | #include "openflow_flowtable.h"
#include "mut.h"
#include <stdint.h>
#include "common_def.h"
extern void openflow_flowtable_set_defaults(void);
extern uint8_t openflow_flowtable_ip_compare(uint32_t ip_1, uint32_t ip_2,
uint8_t ip_len);
TESTSUITE_BEGIN
TEST_BEGIN("Flowtable Modification")
openflow_flowtabl... | ---
+++
@@ -15,10 +15,13 @@
openflow_flowtable_init();
ofp_flow_mod mod;
uint16_t error_code, error_type;
- mod.flags = OFPFF_SEND_FLOW_REM;
- mod.command = OFPFC_ADD;
- mod.match.wildcards = OFPFW_ALL;
- mod.out_port = OFPP_NONE;
+ memset(&mod, 0, sizeof(ofp_flow_mod));
+ mod.flags = htons(OFPFF_SEND_FLOW_... | Clean up test, use proper structuring functions
| mit | anrl/gini3,anrl/gini3,anrl/gini3,anrl/gini3,michaelkourlas/gini,michaelkourlas/gini,anrl/gini3,michaelkourlas/gini,michaelkourlas/gini,michaelkourlas/gini | 2d3728610e716835f1d54606dee0f7c5cb404f66 |
//
// BRScrollerUtilities.h
// BRScroller
//
// Created by Matt on 7/11/13.
// Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#ifndef BRScroller_BRScrollerUtilities_h
#define BRScroller_BRScrollerUtilities_h
#include <CoreGraphics/CoreGraphics.h>
bool BRFloat... | //
// BRScrollerUtilities.h
// BRScroller
//
// Created by Matt on 7/11/13.
// Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#ifndef BRScroller_BRScrollerUtilities_h
#define BRScroller_BRScrollerUtilities_h
#include <CoreFoundation/CoreFoundation.h>
#include ... | ---
+++
@@ -9,8 +9,7 @@
#ifndef BRScroller_BRScrollerUtilities_h
#define BRScroller_BRScrollerUtilities_h
-#include <CoreFoundation/CoreFoundation.h>
-#include <QuartzCore/QuartzCore.h>
+#include <CoreGraphics/CoreGraphics.h>
bool BRFloatsAreEqual(CGFloat a, CGFloat b);
| Fix import to what's actually needed.
| apache-2.0 | Blue-Rocket/BRScroller,Blue-Rocket/BRScroller | de7f24245a2b51af5ff3489d897ed490d8a0e776 |
#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GR_GL_PLATFORM_HEADER <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_E... | #ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GR_GL_PLATFORM_HEADER <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_E... | ---
+++
@@ -15,7 +15,7 @@
#define GR_GL_PROC_ADDRESS(X) &X
// chrome always assumes BGRA
-#define GR_GL_32BPP_COLOR_FORMAT GR_BGRA
+#define GR_GL_32BPP_COLOR_FORMAT GR_GL_BGRA
// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START 0 | Fix macro in Chrome's GL config file
Review URL: http://codereview.appspot.com/4308041/
git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@980 2bbb7eff-a529-9590-31e7-b0007b416f81
| bsd-3-clause | Cue/skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Cue/skia,mrobinson/skia,metajack/skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,metajack/skia,hbwhlklive/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color... | 9866c2c2d649fac485bc47aa77cffbc93d1c6c9e |
#import "PSControlTableCell.h"
@class UIActivityIndicatorView;
@interface PSSwitchTableCell : PSControlTableCell {
UIActivityIndicatorView *_activityIndicator;
}
@property (nonatomic) BOOL loading;
@end
| #import "PSControlTableCell.h"
@class UIActivityIndicatorView;
@interface PSSwitchTableCell : PSControlTableCell {
UIActivityIndicatorView *_activityIndicator;
}
@property BOOL loading;
- (BOOL)loading;
- (void)setLoading:(BOOL)loading;
- (id)controlValue;
- (id)newControl;
- (void)setCellEnabled:(BOOL)enabled... | ---
+++
@@ -2,23 +2,10 @@
@class UIActivityIndicatorView;
-@interface PSSwitchTableCell : PSControlTableCell {
- UIActivityIndicatorView *_activityIndicator;
+@interface PSSwitchTableCell : PSControlTableCell {
+ UIActivityIndicatorView *_activityIndicator;
}
-@property BOOL loading;
-
-- (BOOL)loading;
-... | [Preferences] Clean up what looks like a direct class-dump header.
| unlicense | hbang/headers,hbang/headers | 9246d17556bfb4e9e5ba05f90ca3983dd7ad28d3 |
/*
* Written by Scott Bennett.
* Public domain.
*/
#ifndef LOADER_H
#define LOADER_H
#include "bool.h"
bool load(const char * fileName);
#endif /* LOADER_H */
| /*
* Copyright (c) 2014, 2016 Scott Bennett <scottb@fastmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS... | ---
+++
@@ -1,17 +1,6 @@
/*
- * Copyright (c) 2014, 2016 Scott Bennett <scottb@fastmail.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
-... | Move this file into public domain; it's too simple to copyright...
| isc | sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS | 490fabb3cf7bd259a4d2a26cfece0c0c70564e37 |
/*
* 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 r... | /*
* 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 r... | ---
+++
@@ -33,4 +33,9 @@
@end
-extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
+#if defined(__cplusplus)
+extern "C"
+#else
+extern
+#endif
+OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); | 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. | 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 | c21ae1451dd3a20b4ff0566ae45a0e58a35081fe |
//
// Created by dar on 1/29/16.
//
#ifndef C003_OS_H
#define C003_OS_H
enum class OS {
WIN32 = 0,
UNIX,
ANDROID,
IOS,
MAC
};
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
constexpr const OS OPERATING_SYTEM =
#ifdef _WIN32
OS::WIN32
#elif __APPLE__
#if TARGET_IPHONE_SIMULATOR |... | //
// Created by dar on 1/29/16.
//
#ifndef C003_OS_H
#define C003_OS_H
enum class OS {
WIN32 = 0,
UNIX,
ANDROID,
APPLE
};
constexpr const OS OPERATING_SYTEM =
#ifdef _WIN32
OS::WIN32
#elif __APPLE__
OS::APPLE
#elif __ANDROID__
OS::ANDROID
#elif __unix__
OS::UNIX
#endif
;
constexpr c... | ---
+++
@@ -9,21 +9,34 @@
WIN32 = 0,
UNIX,
ANDROID,
- APPLE
+ IOS,
+ MAC
};
+
+#ifdef __APPLE__
+#include "TargetConditionals.h"
+#endif
constexpr const OS OPERATING_SYTEM =
#ifdef _WIN32
OS::WIN32
#elif __APPLE__
- OS::APPLE
+ #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
+... | Split APPLE operating system to IOS and MAC
| mit | darsto/spooky,darsto/spooky | 8afc766b82b045474873b2c6365bd31b449749ef |
#define CAN_RECONNECT
#define USE_POSIX
#define POSIX_SIGNALS
#define USE_UTIME
#define USE_WAITPID
#define HAVE_GETRUSAGE
#define HAVE_FCHMOD
#define NEED_PSELECT
#define HAVE_SA_LEN
#define SETPWENT_VOID
#define RLIMIT_TYPE rlim_t
#define RLIMIT_LONGLONG
#define RLIMIT_FILE_INFINITY
#define HAVE_CHROOT
#define CAN_CH... | #define CAN_RECONNECT
#define USE_POSIX
#define POSIX_SIGNALS
#define USE_UTIME
#define USE_WAITPID
#define HAVE_GETRUSAGE
#define HAVE_FCHMOD
#define NEED_PSELECT
#define HAVE_SA_LEN
#define USE_LOG_CONS
#define HAVE_CHROOT
#define CAN_CHANGE_ID
#define _TIMEZONE timezone
#define PORT_NONBLOCK O_NONBLOCK
#define POR... | ---
+++
@@ -7,7 +7,10 @@
#define HAVE_FCHMOD
#define NEED_PSELECT
#define HAVE_SA_LEN
-#define USE_LOG_CONS
+#define SETPWENT_VOID
+#define RLIMIT_TYPE rlim_t
+#define RLIMIT_LONGLONG
+#define RLIMIT_FILE_INFINITY
#define HAVE_CHROOT
#define CAN_CHANGE_ID
| Update for some -current quirks, and some other things taken from the
*bsd bind-8 ports.
(our setpwent() was changed to return void, but our setgrent() returns
int still!)
| 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 | a82eba7c6c263e67ad58f5211dbc6d32d3963cb3 |
/*
* NovelProcessTool.h
*
* Created on: 2015年2月19日
* Author: nemo
*/
#ifndef SRC_NOVELPROCESSTOOL_H_
#define SRC_NOVELPROCESSTOOL_H_
#include <string>
#include <fstream>
#include <vector>
using namespace std;
class NovelProcessTool {
public:
NovelProcessTool();
virtual ~NovelProcessTool();
protected:
... | /*
* NovelProcessTool.h
*
* Created on: 2015年2月19日
* Author: nemo
*/
#ifndef SRC_NOVELPROCESSTOOL_H_
#define SRC_NOVELPROCESSTOOL_H_
#include <string>
#include <fstream>
#include <vector>
using namespace std;
class NovelProcessTool {
public:
NovelProcessTool();
virtual ~NovelProcessTool();
protected:
... | ---
+++
@@ -33,6 +33,9 @@
/// Analysis the temp folder.
void analysisFile();
+ /// Novel tool action, implement in sub class.
+ virtual void parseContents() = 0;
+
fstream _fileInStream; ///< The file input stream.
fstream _fileOutStream; ///< The file out stream.
| Modify void parseContents(0) as pure virtual function.
| apache-2.0 | NemoChenTW/NovelProcessTools,NemoChenTW/NovelProcessTools,NemoChenTW/NovelProcessTools | 8d942517ca5d635a6510d1ebba97917b03eebb23 |
/**
* Exercise 1-2
*
* Experiment to find out what happens when printfs's argument string contains \c,
* where c is some character not listed above.
*
* The C Programming Language - the second edition
* by Brian Kernighan and Dennis Ritchie
*
* Author: Li Zhineng <lizhineng@gmail.com>
* URL: https://zhinen... | /**
* Exercise 1-2
*
* Experiment to find out what happens when prints's argument string contains \c,
* where c is some character not listed above.
*
* The C Programming Language - the second edition
* by Brian Kernighan and Dennis Ritchie
*
* Author: Li Zhineng <lizhineng@gmail.com>
* URL: https://zhineng... | ---
+++
@@ -1,7 +1,7 @@
/**
* Exercise 1-2
*
- * Experiment to find out what happens when prints's argument string contains \c,
+ * Experiment to find out what happens when printfs's argument string contains \c,
* where c is some character not listed above.
*
* The C Programming Language - the second editi... | Fix misspelling in execrise 2 in chapter 1
| mit | lizhineng/learning-the-c-programming-language | a9865d3e8694bfe5f94e69fd87d6d90798578936 |
#include "canard.h"
#include "canard_internals.h"
CANARD_INTERNAL void canardInitPoolAllocator(CanardPoolAllocator* allocator, CanardPoolAllocatorBlock* buf, unsigned int buf_len)
{
unsigned int current_index = 0;
CanardPoolAllocatorBlock** current_block = &(allocator->free_list);
while (current_index < bu... | #include "canard.h"
#include "canard_internals.h"
void canardInitPoolAllocator(CanardPoolAllocator* allocator, CanardPoolAllocatorBlock* buf, unsigned int buf_len)
{
unsigned int current_index = 0;
CanardPoolAllocatorBlock** current_block = &(allocator->free_list);
while (current_index < buf_len)
{
... | ---
+++
@@ -1,7 +1,7 @@
#include "canard.h"
#include "canard_internals.h"
-void canardInitPoolAllocator(CanardPoolAllocator* allocator, CanardPoolAllocatorBlock* buf, unsigned int buf_len)
+CANARD_INTERNAL void canardInitPoolAllocator(CanardPoolAllocator* allocator, CanardPoolAllocatorBlock* buf, unsigned int buf... | Apply internal API marker to declarations too
| mit | UAVCAN/libcanard,UAVCAN/libcanard,antoinealb/libcanard,UAVCAN/libcanard,antoinealb/libcanard | b1d73df29598cb3df43425377a395c1e4cafc1db |
//
// Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry
//
// 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 ... | //
// Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry
//
// 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 ... | ---
+++
@@ -22,7 +22,7 @@
@property (nonatomic, strong) UIImage *imageValue;
@property (nonatomic, strong) NSString *imageValueNamed;
@property (nonatomic, assign) float imageMaxLength;
-@property(nonatomic) enum UIImagePickerControllerSourceType source;
+@property(nonatomic) UIImagePickerControllerSourceType sour... | Fix bug that was causing error building pod in RubyMotion project
| mit | raiffeisennet/QuickDialog | d352a1145f833ee804dff6576b4c0d5ee04cb099 |
#pragma once
#include "Function.h"
#include "FunctionInterface.h"
class MMSTestFunc;
template <>
InputParameters validParams<MMSTestFunc>();
/**
* Function of RHS for manufactured solution in spatial_constant_helmholtz test
*/
class MMSTestFunc : public Function, public FunctionInterface
{
public:
MMSTestFunc(... | #ifndef MMSTESTFUNC_H
#define MMSTESTFUNC_H
#include "Function.h"
#include "FunctionInterface.h"
class MMSTestFunc;
template <>
InputParameters validParams<MMSTestFunc>();
/**
* Function of RHS for manufactured solution in spatial_constant_helmholtz test
*/
class MMSTestFunc : public Function, public FunctionInt... | ---
+++
@@ -1,5 +1,4 @@
-#ifndef MMSTESTFUNC_H
-#define MMSTESTFUNC_H
+#pragma once
#include "Function.h"
#include "FunctionInterface.h"
@@ -37,5 +36,3 @@
MooseEnum _component;
};
-
-#endif // MMSTESTFUNC_H | Convert to pragma once in test functions
refs #21085
| lgpl-2.1 | laagesen/moose,harterj/moose,andrsd/moose,sapitts/moose,milljm/moose,milljm/moose,idaholab/moose,lindsayad/moose,harterj/moose,idaholab/moose,andrsd/moose,sapitts/moose,harterj/moose,sapitts/moose,dschwen/moose,andrsd/moose,dschwen/moose,milljm/moose,sapitts/moose,dschwen/moose,laagesen/moose,lindsayad/moose,andrsd/moo... | 0e8f41582505e156243a37100568f94f158ec978 |
//
// OCTFileContent.h
// OctoKit
//
// Created by Aron Cedercrantz on 14-07-2013.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "OCTContent.h"
// A file in a git repository.
@interface OCTFileContent : OCTContent
// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString... | //
// OCTFileContent.h
// OctoKit
//
// Created by Aron Cedercrantz on 14-07-2013.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "OCTContent.h"
// A file in a git repository.
@interface OCTFileContent : OCTContent
// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString... | ---
+++
@@ -16,7 +16,7 @@
// The raw, encoded, content of the file.
//
-// See encoding for the encoding used.
+// See `encoding` for the encoding used.
@property (nonatomic, copy, readonly) NSString *content;
@end | Add backticks around the ref to encoding property.
Signed-off-by: Aron Cedercrantz <ce30127eefa07a02d568832e3de6952fb491981c@cedercrantz.se> | mit | daukantas/octokit.objc,cnbin/octokit.objc,CHNLiPeng/octokit.objc,phatblat/octokit.objc,cnbin/octokit.objc,GroundControl-Solutions/octokit.objc,yeahdongcn/octokit.objc,jonesgithub/octokit.objc,GroundControl-Solutions/octokit.objc,daemonchen/octokit.objc,CleanShavenApps/octokit.objc,wrcj12138aaa/octokit.objc,xantage/octo... | 5ad831820bf5c3c557f3b49e70c76c54a92e0085 |
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, unsigned int timeout) {
csp_log_lock("Wai... |
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, uint32_t timeout) {
csp_log_lock("Wait: %... | ---
+++
@@ -12,7 +12,7 @@
xSemaphoreGive(sem);
}
-int csp_bin_sem_wait(csp_bin_sem_t * sem, uint32_t timeout) {
+int csp_bin_sem_wait(csp_bin_sem_t * sem, unsigned int timeout) {
csp_log_lock("Wait: %p", sem);
if (timeout != CSP_MAX_TIMEOUT) {
timeout = timeout / portTICK_PERIOD_MS; | Fix function prototype for sem_wait on freertos
| mit | libcsp/libcsp,libcsp/libcsp | c88a81fc3174e3989a0d75f68f2836ab55f1639e |
#ifndef __CONFIG_H
#define __CONFIG_H
enum {
CONFIG_KEY_RESOLUTION = 0,
CONFIG_KEY_BLEND_USER1,
CONFIG_KEY_BLEND_USER2,
CONFIG_KEY_BLEND_USER3,
CONFIG_KEY_BLEND_USER4,
CONFIG_KEY_COUNT
};
#ifdef BOARD_MINISPARTAN6
#define CONFIG_DEFAULTS { 5, 1, 2, 3, 4 }
#else
#define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 }
#endif
... | #ifndef __CONFIG_H
#define __CONFIG_H
enum {
CONFIG_KEY_RESOLUTION = 0,
CONFIG_KEY_BLEND_USER1,
CONFIG_KEY_BLEND_USER2,
CONFIG_KEY_BLEND_USER3,
CONFIG_KEY_BLEND_USER4,
CONFIG_KEY_COUNT
};
#define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 }
void config_init(void);
void config_write_all(void);
unsigned char config_get(un... | ---
+++
@@ -11,7 +11,11 @@
CONFIG_KEY_COUNT
};
+#ifdef BOARD_MINISPARTAN6
+#define CONFIG_DEFAULTS { 5, 1, 2, 3, 4 }
+#else
#define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 }
+#endif
void config_init(void);
void config_write_all(void); | firmware/lm32: Make 800x600 the default mode for the minispartan6+
| bsd-2-clause | mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware | 526b09b014c8219cfe3747170c6021fe92fb65d5 |
/*
*
* Copyright 2018 Asylo 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 agree... | /*
*
* Copyright 2018 Asylo 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 agree... | ---
+++
@@ -19,6 +19,8 @@
#ifndef ASYLO_TEST_UTIL_TEST_FLAGS_H_
#define ASYLO_TEST_UTIL_TEST_FLAGS_H_
+#include <string>
+
#include "absl/flags/declare.h"
// Location for all temporary test files. | Add missing include of string
PiperOrigin-RevId: 317401762
Change-Id: Icbc4d0e2a4e99a9e73a4d8e7ad148e34ee2e9d03
| apache-2.0 | google/asylo,google/asylo,google/asylo,google/asylo,google/asylo,google/asylo | cd2450371d48da1c548b8894cccc0a67cd8b0e99 |
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2014 Couchbase, Inc.
*
* 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://ww... | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2014 Couchbase, Inc.
*
* 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://ww... | ---
+++
@@ -20,11 +20,19 @@
#include <platform/visibility.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PLATFORM_PUBLIC_API
int asprintf(char **ret, const char *format, ...);
PLATFORM_PUBLIC_API
int vasprintf(char **ret, const char *format, va_list ap);
+
+#ifdef __cplusplus
+}
+#endif
/*
* We have a ... | Set C linkage for win32 [v]asprintf
Change-Id: I7f82255467c05936baa702fa1d532156b0caba12
Reviewed-on: http://review.couchbase.org/52114
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
| apache-2.0 | vmx/platform,vmx/platform | 814fd55d1b26335f1765ed59fda4b6325893a9ad |
#ifndef MCLISP_CONS_H_
#define MCLISP_CONS_H_
#include <string>
namespace mclisp
{
struct ConsCell
{
ConsCell* car;
ConsCell* cdr;
};
typedef struct ConsCell ConsCell;
bool operator==(const ConsCell& lhs, const ConsCell& rhs);
bool operator!=(const ConsCell& lhs, const ConsCell& rhs);
bool operator< (const Con... | #ifndef MCLISP_CONS_H_
#define MCLISP_CONS_H_
#include <string>
namespace mclisp
{
class ConsCell
{
public:
ConsCell(): car(nullptr), cdr(nullptr) {}
ConsCell(ConsCell* car, ConsCell* cdr): car(car), cdr(cdr) {}
ConsCell* car;
ConsCell* cdr;
};
bool operator==(const ConsCell& lhs, const ConsCell& r... | ---
+++
@@ -6,15 +6,13 @@
namespace mclisp
{
-class ConsCell
+struct ConsCell
{
-public:
- ConsCell(): car(nullptr), cdr(nullptr) {}
- ConsCell(ConsCell* car, ConsCell* cdr): car(car), cdr(cdr) {}
+ ConsCell* car;
+ ConsCell* cdr;
+};
- ConsCell* car;
- ConsCell* cdr;
-};
+typedef struct ConsCell... | Convert ConsCell from class to POD.
| mit | appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp | 1aa266b2b3406f046e00b65bb747a19c6d4445d7 |
// -*- c++ -*-
#ifndef LOCKS_H
#define LOCKS_H
#include <cstdio>
#include <pthread.h>
namespace locks {
template <typename L>
void unlocker(void* lock_ptr)
{
L* lock = (L*) lock_ptr;
fprintf(stderr, "Releasing lock (unchecked) during cancellation!\n");
lock->unlock();
}
template <typename L>
void unlock... | // -*- c++ -*-
#ifndef LOCKS_H
#define LOCKS_H
#include <pthread.h>
namespace locks {
template <typename L>
void unlocker(void* lock_ptr)
{
L* lock = (L*) lock_ptr;
lock->unlock();
}
template <typename L>
void unlocker_checked(void* lock_ptr)
{
L& lock = *((L*) lock_ptr);
if (lock)
lock.unlo... | ---
+++
@@ -2,6 +2,7 @@
#ifndef LOCKS_H
#define LOCKS_H
+#include <cstdio>
#include <pthread.h>
namespace locks {
@@ -10,6 +11,7 @@
void unlocker(void* lock_ptr)
{
L* lock = (L*) lock_ptr;
+ fprintf(stderr, "Releasing lock (unchecked) during cancellation!\n");
lock->unlock();
}
@@ -17,8 +19,... | Add logging etc. to lock release code.
| lgpl-2.1 | csw/libraft,csw/libraft | 6ec5fad7e7122413b6e15d07f2ead6a5be8220b9 |
// Copyright (c) 2021 The Orbit 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 USER_SPACE_INSTRUMENTATION_ATTACH_H_
#define USER_SPACE_INSTRUMENTATION_ATTACH_H_
#include <sys/types.h>
#include "OrbitBase/Result.h"
namespa... | // Copyright (c) 2021 The Orbit 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 USER_SPACE_INSTRUMENTATION_ATTACH_H_
#define USER_SPACE_INSTRUMENTATION_ATTACH_H_
#include <sys/types.h>
#include "OrbitBase/Result.h"
namespa... | ---
+++
@@ -11,8 +11,11 @@
namespace orbit_user_space_instrumentation {
+// Attaches to and stops all threads of the process `pid` using `PTRACE_ATTACH`. Being attached to a
+// process using this function is a precondition for using any of the tooling provided here.
[[nodiscard]] ErrorMessageOr<void> AttachAnd... | Fix missing comment in header.
| bsd-2-clause | google/orbit,google/orbit,google/orbit,google/orbit | 8012d2842d234a838b2ff27c27c5222a665cf7f7 |
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o /dev/null
#define _JBLEN ((9 * 2) + 3 + 16)
typedef int sigjmp_buf[_JBLEN + 1];
int sigsetjmp(sigjmp_buf env, int savemask);
sigjmp_buf B;
int foo() {
sigsetjmp(B, 1);
bar();
}
| // RUN: %clang -S -emit-llvm %s -o /dev/null
// XFAIL: mingw,win32
#include <setjmp.h>
sigjmp_buf B;
int foo() {
sigsetjmp(B, 1);
bar();
}
| ---
+++
@@ -1,8 +1,8 @@
-// RUN: %clang -S -emit-llvm %s -o /dev/null
-// XFAIL: mingw,win32
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o /dev/null
-#include <setjmp.h>
-
+#define _JBLEN ((9 * 2) + 3 + 16)
+typedef int sigjmp_buf[_JBLEN + 1];
+int sigsetjmp(sigjmp_buf env, int savemask);
sigj... | Remove the need for a header and specify a triple so that the type
sizes make sense.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136309 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | 95ee667503b8b3123951242e3f7b93598cb9f9b9 |
// Explorer loader problem list
// /problem.h
#ifndef PROBLEM_H_
#define PROBLEM_H_
/**错误列表*/
#define ERR_NO_MEM_FOR_ID 1 // 没有可用于中断描述符表的内存
#define ERR_NO_MEM_FOR_SD 2 // 没有可用于储存器描述符表的内存
#define ERR_NO_MEM_FOR_SCTBUF 3 // 没有可用于扇区缓存的内存
#define ERR_NO_MEM_FOR_CONFIG 4 // 没有可以分配给引导配置文件的内存
#define ERR_NO_MEM_FOR_... | // Explorer loader problem list
// /problem.h
#ifndef PROBLEM_H_
#define PROBLEM_H_
/**错误列表*/
#define ERR_NO_MEM_FOR_ID 1 // 没有可用于中断描述符表的内存
#define ERR_NO_MEM_FOR_SD 2 // 没有可用于储存器描述符表的内存
#define ERR_NO_MEM_FOR_SCTBUF 3 // 没有可用于扇区缓存的内存
#define ERR_NO_MEM_FOR_CONFIG 4 // 没有可以分配给引导配置文件的内存
#define ERR_NO_MEM_FO... | ---
+++
@@ -5,18 +5,21 @@
#define PROBLEM_H_
/**错误列表*/
-#define ERR_NO_MEM_FOR_ID 1 // 没有可用于中断描述符表的内存
-#define ERR_NO_MEM_FOR_SD 2 // 没有可用于储存器描述符表的内存
+#define ERR_NO_MEM_FOR_ID 1 // 没有可用于中断描述符表的内存
+#define ERR_NO_MEM_FOR_SD 2 // 没有可用于储存器描述符表的内存
#define ERR_NO_MEM_FOR_SCTBUF 3 // 没有可用于扇区缓存的内存
#define... | Add new error and warning number
| bsd-2-clause | MakeOS/GhostBirdOS,MakeOS/GhostBirdOS | 10f5254d144aaa8af56eb6445cea08a491d9fcb8 |
/* SPDX-License-Identifier: BSD-2-Clause */
#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>
#include <tilck/kernel/sched.h>
#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>
void
early_init_acpi_module(void)
{
ACPI_STATUS rc;
rc = AcpiInitializeSubsys... | /* SPDX-License-Identifier: BSD-2-Clause */
#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>
#include <tilck/kernel/sched.h>
#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>
static ACPI_TABLE_DESC acpi_tables[16];
void
early_init_acpi_module(void)
{
ACPI... | ---
+++
@@ -9,8 +9,6 @@
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>
-static ACPI_TABLE_DESC acpi_tables[16];
-
void
early_init_acpi_module(void)
{
@@ -21,7 +19,7 @@
if (rc != AE_OK)
panic("AcpiInitializeSubsystem() failed with: %d", rc);
- rc = AcpiInitializeTables(acpi_... | [acpi] Make AcpiInitializeTables to dynamically alloc tables
| bsd-2-clause | vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs | 8fa7230f1fee1f68f7ae6ed03cdc72c63a8c97b2 |
#include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The divide by zero below appears to be perhaps on purpose to create
a numerical exception. */
#ifdef _MSC_VER
# pragma warning (disable: 4723) /* potential divide by 0 */
#endif
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer ... | #include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer pow_ii(integer *ap, integer *bp)
#endif
{
integer pow, x, n;
unsigned long u;
x = *ap;
n = *bp;
if (n <= 0) {
if (n == 0 || x ==... | ---
+++
@@ -1,6 +1,12 @@
#include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
+#endif
+
+/* The divide by zero below appears to be perhaps on purpose to create
+ a numerical exception. */
+#ifdef _MSC_VER
+# pragma warning (disable: 4723) /* potential divide by 0 */
#endif
#ifdef KR_headers | COMP: Disable divide by zero warning for VS6 to avoid modifying function implementation.
| apache-2.0 | InsightSoftwareConsortium/ITK,rhgong/itk-with-dom,LucHermitte/ITK,LucasGandel/ITK,cpatrick/ITK-RemoteIO,jcfr/ITK,paulnovo/ITK,blowekamp/ITK,eile/ITK,GEHC-Surgery/ITK,hjmjohnson/ITK,atsnyder/ITK,biotrump/ITK,richardbeare/ITK,jmerkow/ITK,blowekamp/ITK,vfonov/ITK,jcfr/ITK,malaterre/ITK,jmerkow/ITK,hjmjohnson/ITK,vfonov/IT... | 01b0b70139f2378c410b089f843c61fb61583031 |
#include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf(" ADDR LEN TY... | #include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf("ADDR LOW ADDR HI LEN LOW LEN HI ... | ---
+++
@@ -9,14 +9,14 @@
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
- vty_printf("ADDR LOW ADDR HI LEN LOW LEN HI TYPE RESERVED\n");
+ vty_printf(" ADDR LEN TYPE RESERVED\n");
for(int i = 0; i < *bios_... | Tweak display of BIOS memory map
| mit | wconrad/brazzle,wconrad/brazzle | b4aeaf99c621d17a147acf431d7e131c6860f5ac |
#include <stddef.h>
#include <stdint.h>
#include "cc1.h"
Symbol *curfun;
extern Node *convert(Node *np, Type *tp1, char iscast);
static void
Return(void)
{
Node *np;
Type *tp = curfun->type->type;
expect(RETURN);
np = expr();
if (np->type != tp) {
if (tp == voidtype)
warn(1, "function returning void ret... |
#include <stddef.h>
#include <stdint.h>
#include "cc1.h"
Symbol *curfun;
extern Node *convert(Node *np, Type *tp1, char iscast);
static void
Return(void)
{
Node *np;
Type *tp = curfun->type->type;
expect(RETURN);
np = expr();
if (np->type != tp) {
if ((np = convert(np, tp, 0)) == NULL)
error("incorrect ... | ---
+++
@@ -17,7 +17,9 @@
expect(RETURN);
np = expr();
if (np->type != tp) {
- if ((np = convert(np, tp, 0)) == NULL)
+ if (tp == voidtype)
+ warn(1, "function returning void returns a value");
+ else if ((np = convert(np, tp, 0)) == NULL)
error("incorrect type in return");
}
emitret(tp); | Check that void function can return a value
| isc | k0gaMSX/scc,k0gaMSX/kcc,k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/kcc,8l/scc,8l/scc,8l/scc | ee6d21258db24ac2640a410bc27ea1b552b36ca1 |
//
// main.c
// Check if a string has all unique characters by counting how many times each character appears using its ASCII code
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
//
#include <stdio.h>
_Bool isUniqueChars(char *str) {
int frequencyDictionary[127] = ... | //
// main.c
// unique-characters
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
//
#include <stdio.h>
void printCharacters(char *inputString) {
int dictinary[30] = {};
while (*inputString) {
dictinary[(int) *inputString]++;
printf("Current ch... | ---
+++
@@ -1,6 +1,6 @@
//
// main.c
-// unique-characters
+// Check if a string has all unique characters by counting how many times each character appears using its ASCII code
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
@@ -8,28 +8,30 @@
#include <stdio.... | Check if a string has all unique characters algorithm
| mit | jack-zuban/c-practice | 8ae38b029c6566f18bcf7a8781c1235f2d57acbc |
#include <gst/gst.h>
#include <gst/farsight/fs-codec.h>
#include "fs-rtp-discover-codecs.h"
int main (int argc, char **argv)
{
GList *elements = NULL;
GError *error = NULL;
gst_init (&argc, &argv);
g_debug ("AUDIO STARTING!!");
elements = fs_rtp_blueprints_get (FS_MEDIA_TYPE_AUDIO, &error);
if (err... |
#include <gst/gst.h>
#include <gst/farsight/fs-codec.h>
#include "fs-rtp-discover-codecs.h"
int main (int argc, char **argv)
{
GList *elements = NULL;
GError *error = NULL;
gst_init (&argc, &argv);
g_debug ("AUDIO STARTING!!");
elements = load_codecs (FS_MEDIA_TYPE_AUDIO, &error);
if (error)
g_... | ---
+++
@@ -15,27 +15,27 @@
g_debug ("AUDIO STARTING!!");
- elements = load_codecs (FS_MEDIA_TYPE_AUDIO, &error);
+ elements = fs_rtp_blueprints_get (FS_MEDIA_TYPE_AUDIO, &error);
if (error)
g_debug ("Error: %s", error->message);
g_clear_error (&error);
- unload_codecs (FS_MEDIA_TYPE_AUDIO);
... | Use the new function names for the codec discovery tests
| lgpl-2.1 | tieto/farstream,tieto/farstream,pexip/farstream,ahmedammar/skype_farsight2,pexip/farstream,tieto/farstream,shadeslayer/farstream,pexip/farstream,ahmedammar/skype_farsight2,kakaroto/farstream,ahmedammar/skype_farsight2,pexip/farstream,tieto/farstream,kakaroto/farstream,ahmedammar/skype_farsight2,shadeslayer/farstream,ka... | eed9cdf420ef882a796d9f8e9a233ded25c9becb |
#pragma once
#include "jwtxx/jwt.h"
#include <string>
namespace JWTXX
{
struct Key::Impl
{
// Need this for polymorphic behavior.
virtual ~Impl() = default;
// Need this due to the Rule of Five.
Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(Imp... | #pragma once
#include "jwtxx/jwt.h"
#include <string>
namespace JWTXX
{
struct Key::Impl
{
virtual ~Impl() {}
virtual std::string sign(const void* data, size_t size) const = 0;
virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0;
};
}
| ---
+++
@@ -9,7 +9,15 @@
struct Key::Impl
{
- virtual ~Impl() {}
+ // Need this for polymorphic behavior.
+ virtual ~Impl() = default;
+ // Need this due to the Rule of Five.
+ Impl() = default;
+ Impl(const Impl&) = delete;
+ Impl& operator=(const Impl&) = delete;
+ Impl(Impl&&) = default... | Enable move and disable copy for key implementations.
| mit | madf/jwtxx,madf/jwtxx,RealImage/jwtxx,RealImage/jwtxx | 0b08a3698e0cc1a26d7a85238c5035ceeb564e3a |
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
extern void abort() __attribute__((noreturn));
void f1() {
abort();
}
// CHECK-LABEL: define {{.*}}void @f1()
// CHECK-NEXT: entry:
// CHECK-NEXT: call void @abort()
// CHECK-NEXT: unreachable
// CHECK-NEXT: }
void *f2() {
abort();
return 0;
}
// CHECK-L... | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
extern void abort() __attribute__((noreturn));
void f1() {
abort();
}
// CHECK-LABEL: define void @f1()
// CHECK-NEXT: entry:
// CHECK-NEXT: call void @abort()
// CHECK-NEXT: unreachable
// CHECK-NEXT: }
void *f2() {
abort();
return 0;
}
// CHECK-LABEL: ... | ---
+++
@@ -5,7 +5,7 @@
void f1() {
abort();
}
-// CHECK-LABEL: define void @f1()
+// CHECK-LABEL: define {{.*}}void @f1()
// CHECK-NEXT: entry:
// CHECK-NEXT: call void @abort()
// CHECK-NEXT: unreachable
@@ -15,7 +15,7 @@
abort();
return 0;
}
-// CHECK-LABEL: define i8* @f2()
+// CHECK-LABEL: def... | Fix for different build configurations.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@358125 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | 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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... | f5d025e4a30b5f0dc1a4df85135e0ee507847342 |
#include "../common.c"
#include "m-dict.h"
static inline bool oor_equal_p(unsigned int k, unsigned char n)
{
return k == (unsigned int)n;
}
static inline void oor_set(unsigned int *k, unsigned char n)
{
*k = (unsigned int)n;
}
DICT_OA_DEF2(dict_oa_uint,
unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(o... | #include "../common.c"
#include "m-dict.h"
static inline bool oor_equal_p(unsigned int k, unsigned char n)
{
return k == (unsigned int)n;
}
static inline void oor_set(unsigned int *k, unsigned char n)
{
*k = (unsigned int)n;
}
DICT_OA_DEF2(dict_oa_uint,
unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(o... | ---
+++
@@ -22,9 +22,9 @@
for (i = 0, x = x0; i < n; ++i) {
x = hash32(x);
unsigned int key = get_key(n, x);
- unsigned int *ptr = dict_oa_uint_get(h, key);
- if (ptr) { (*ptr)++; z+= *ptr; }
- else { dict_oa_uint_set_at(h, key, 1); z+=1; }
+ unsigned int *ptr = dict_oa_uint_get_at(h, key);
+... | Simplify code to use get_at method with its get & create semantic
| bsd-2-clause | P-p-H-d/mlib,P-p-H-d/mlib | f1e5e9d9db6e8e467d994f6307452147d2becbca |
#ifndef CPR_TIMEOUT_H
#define CPR_TIMEOUT_H
#include <cstdint>
#include <chrono>
#include <limits>
#include <stdexcept>
namespace cpr {
class Timeout {
public:
Timeout(const std::chrono::milliseconds& duration) : ms{duration} {
if(ms.count() > std::numeric_limits<long>::max()) {
throw std::... | #ifndef CPR_TIMEOUT_H
#define CPR_TIMEOUT_H
#include <cstdint>
#include <chrono>
namespace cpr {
class Timeout {
public:
Timeout(const std::chrono::milliseconds& timeout) : ms(timeout) {}
Timeout(const std::int32_t& timeout) : ms(timeout) {}
std::chrono::milliseconds ms;
};
} // namespace cpr
#endif... | ---
+++
@@ -3,13 +3,23 @@
#include <cstdint>
#include <chrono>
+#include <limits>
+#include <stdexcept>
namespace cpr {
class Timeout {
public:
- Timeout(const std::chrono::milliseconds& timeout) : ms(timeout) {}
- Timeout(const std::int32_t& timeout) : ms(timeout) {}
+ Timeout(const std::chrono... | Check for under/overflow in Timeout constructor. Codestyle fixes.
| mit | msuvajac/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,msuvajac/cpr,whoshuu/cpr | 457459df300b2c65084cac758b8dc28538da8c06 |
//
// YTConnector.h
// AKYouTube
//
// Created by Anton Pomozov on 10.09.13.
// Copyright (c) 2013 Akademon Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class YTConnector;
@protocol YTLoginViewControllerInterface <NSObject>
@property (nonatomic, strong, readonly) UIWebView *webView;
@optiona... | //
// YTConnector.h
// AKYouTube
//
// Created by Anton Pomozov on 10.09.13.
// Copyright (c) 2013 Akademon Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class YTConnector;
@protocol YTLoginViewControllerInterface <NSObject>
@property (nonatomic, strong, readonly) UIWebView *webView;
@property... | ---
+++
@@ -13,6 +13,9 @@
@protocol YTLoginViewControllerInterface <NSObject>
@property (nonatomic, strong, readonly) UIWebView *webView;
+
+@optional
+
@property (nonatomic, assign) BOOL shouldPresentCloseButton;
@property (nonatomic, strong) UIImage *closeButtonImageName;
| [Mod]: Make close button properties optional.
| mit | pomozoff/AKYouTube,pomozoff/AKYouTube,pomozoff/AKYouTube | 875a794dd1d9c3e183b456b8fe826c04874bbf55 |
// Copyright (c) 2009 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 NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_
namespace flip {
const unsigned int kStreamIdMask = 0x7fffffff; // StreamId mas... | // Copyright (c) 2009 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 NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_
namespace flip {
const int kStreamIdMask = 0x7fffffff; // StreamId mask from th... | ---
+++
@@ -7,12 +7,11 @@
namespace flip {
-const int kStreamIdMask = 0x7fffffff; // StreamId mask from the FlipHeader
-const int kControlFlagMask = 0x8000; // Control flag mask from the FlipHeader
-const int kPriorityMask = 0xc0; // Priority mask from the SYN_FRAME
-const int kLengthMask = 0xffffff; ... | linux: Fix signed vs unsigned issue
Review URL: http://codereview.chromium.org/297015
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@30099 0039d316-1c4b-4281-b951-d872f2087c98
| bsd-3-clause | krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,zcbenz/cefode-chromium,dednal/chromium.src,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,fujunwei/c... | 49d8436a2b84d7bd90fc76c17b723ad5c89772a7 |
#ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
... | #ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
... | ---
+++
@@ -46,4 +46,15 @@
ByteRegister& high_byte;
};
+class Offset {
+public:
+ Offset(uint8_t val) : val(val) {};
+ Offset(ByteRegister& reg) : val(reg.value()) {};
+
+ uint8_t value() { return val; }
+
+private:
+ uint8_t val;
+};
+
#endif | Add the mini offset utility class
| bsd-3-clause | jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator | a394a676b804449c2c939a26ee394a025f7c325c |
/*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
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
ht... | /*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
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
ht... | ---
+++
@@ -18,13 +18,11 @@
#import "GTMAppAuthFetcherAuthorization.h"
#import "GTMAppAuthFetcherAuthorization+Keychain.h"
-#import "GTMKeychain.h"
#if TARGET_OS_TV
#elif TARGET_OS_WATCH
-#elif TARGET_OS_IOS
-#import "GTMOAuth2KeychainCompatibility.h"
-#elif TARGET_OS_MAC
+#elif TARGET_OS_IOS || TARGET_OS_MAC... | Move to iOS and Mac targets only. | apache-2.0 | google/GTMAppAuth,google/GTMAppAuth | 2a3b7a9e9928124865cfce561f410a9018aaeb94 |
#pragma once
#include <time.h>
#include <sys/time.h>
#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#endif
static inline unsigned long long current_time_ns() {
#ifdef __MACH__
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
... | #pragma once
#include <time.h>
#include <sys/time.h>
static inline unsigned long long current_time_ns() {
#ifdef __MACH__
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self()... | ---
+++
@@ -2,6 +2,11 @@
#include <time.h>
#include <sys/time.h>
+
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
static inline unsigned long long current_time_ns() {
#ifdef __MACH__ | Fix compilation errors on Mac OS
| bsd-3-clause | habanero-rice/tasking-micro-benchmark-suite,habanero-rice/tasking-micro-benchmark-suite,habanero-rice/tasking-micro-benchmark-suite | e3a06f573bba62836623a5bc6aab7b6df4c235e5 |
//
// ArticleCellView.h
// PXListView
//
// Adapted from PXListView by Alex Rozanski
// Modified by Barijaona Ramaholimihaso
//
#import <Cocoa/Cocoa.h>
#import "PXListViewCell.h"
#import "ArticleView.h"
@interface ArticleCellView : PXListViewCell
{
AppController * controller;
ArticleView *articleView;
NSProg... | //
// ArticleCellView.h
// PXListView
//
// Adapted from PXListView by Alex Rozanski
// Modified by Barijaona Ramaholimihaso
//
#import <Cocoa/Cocoa.h>
#import "PXListViewCell.h"
#import "ArticleView.h"
@interface ArticleCellView : PXListViewCell
{
AppController * controller;
ArticleView *articleView;
NSProg... | ---
+++
@@ -17,6 +17,8 @@
AppController * controller;
ArticleView *articleView;
NSProgressIndicator * progressIndicator;
+ BOOL inProgress;
+ int folderId;
}
@property (nonatomic, retain) ArticleView *articleView; | Fix a static analyzer error | apache-2.0 | Feitianyuan/vienna-rss,josh64x2/vienna-rss,lapcat/vienna-rss,Eitot/vienna-rss,aidanamavi/vienna-rss,iamjasonchoi/vienna-rss,tothgy/vienna-rss,barijaona/vienna-rss,ViennaRSS/vienna-rss,Feitianyuan/vienna-rss,barijaona/vienna-rss,iamjasonchoi/vienna-rss,barijaona/vienna-rss,Eitot/vienna-rss,barijaona/vienna-rss,lapcat/vi... | ab7b4a594efab038c9b40f52b0a525c445a25d8d |
#pragma once
#include "FSMState.h"
#define END_STATE_TABLE {nullptr, 0, nullptr} //!< Append this to the end of your state tables; the init function will recognize it and stop searching the table for states.
namespace ADBLib
{
struct FSMTransition
{
FSMState* currentState; //!< The current state.
int input; ... | #pragma once
#include "FSMState.h"
#define END_STATE_TABLE {nullptr, 0, false} //!< Append this to the end of your state tables; the init function will recognize it and stop searching the table for states.
namespace ADBLib
{
class FSMTransition
{
public:
FSMState* currentState; //!< The current state.
int inp... | ---
+++
@@ -2,15 +2,14 @@
#include "FSMState.h"
-#define END_STATE_TABLE {nullptr, 0, false} //!< Append this to the end of your state tables; the init function will recognize it and stop searching the table for states.
+#define END_STATE_TABLE {nullptr, 0, nullptr} //!< Append this to the end of your state tabl... | Fix END_STATE_TABLE define causing bool -> ptr conversion error
| mit | Dreadbot/ADBLib,Dreadbot/ADBLib,Sourec/ADBLib,Sourec/ADBLib | 0efa7eda72c851959fa7da2bd084cc9aec310a77 |
#include "Allocator.h"
#ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
class StackAllocator : public Allocator {
protected:
/* Offset from the start of the memory block */
std::size_t m_offset;
public:
/* Allocation of real memory */
StackAllocator(const long totalSize);
/* Frees all memory */
virtual ~Stack... | #include "LinearAllocator.h"
#ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
class StackAllocator : public LinearAllocator {
public:
/* Allocation of real memory */
StackAllocator(const long totalSize);
/* Frees all memory */
virtual ~StackAllocator();
/* Allocate virtual memory */
virtual void* Allocate(co... | ---
+++
@@ -1,9 +1,12 @@
-#include "LinearAllocator.h"
+#include "Allocator.h"
#ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
-class StackAllocator : public LinearAllocator {
+class StackAllocator : public Allocator {
+protected:
+ /* Offset from the start of the memory block */
+ std::size_t m_offset;
publ... | Change parent class from LinearAllocator to Allocator.
| mit | mtrebi/memory-allocators | 66c950522a3563c96cb7d4aca0ba4e940b769462 |
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#define HAVE_ALLOCA_H 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_LIBPTHREAD 1
/* Define to 1 if you h... | /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#define HAVE_ALLOCA_H 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_LIBPTHREAD 1
/* Define to 1 if you h... | ---
+++
@@ -21,6 +21,9 @@
#undef HAVE_LIBPTHREAD
#undef HAVE_FSEEKO
#endif
+#ifdef __FreeBSD__
+#undef HAVE_ALLOCA_H
+#endif
# ifndef __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS 1 | Fix build on FreeBSD, which has no alloca.h
| isc | YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys,YosysHQ/yosys | 0302e97ebcbb18c9b0bd97ac6641f4b79c401bd0 |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <fizz/protocol/CertificateVerifier.h>
namespace quic::test {
class TestCertificateVerifier : public fizz... | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <fizz/protocol/CertificateVerifier.h>
namespace quic::test {
class TestCertificateVerifier : public fizz... | ---
+++
@@ -15,9 +15,10 @@
public:
~TestCertificateVerifier() override = default;
- void verify(const std::vector<std::shared_ptr<const fizz::PeerCert>>&)
+ std::shared_ptr<const folly::AsyncTransportCertificate> verify(
+ const std::vector<std::shared_ptr<const fizz::PeerCert>>& certs)
const ove... | Replace fizz server cert with leaf cert returned from verification
Summary: Added code to return the leaf cert after successfully verification of the server cert. The returned cert is then used for replacing the server cert.
Reviewed By: AjanthanAsogamoorthy
Differential Revision: D35898220
fbshipit-source-id: 8f54... | mit | facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst | 32df46c68c5f8756b4383b1228d17df6538ae671 |
#ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
#include <QHash>
#include <QObject>
#include <QScriptValue>
class QScriptEngine;
class ScriptWindow : public QObject {
Q_OBJECT
public:
explicit ScriptWindow(const QScriptValue &originalWindow, QObject *parent = 0);
QScriptValue toScriptValue(... | #ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
#include <stdint.h>
#include <QHash>
#include <QObject>
#include <QScriptValue>
class QScriptEngine;
class ScriptWindow : public QObject {
Q_OBJECT
public:
explicit ScriptWindow(const QScriptValue &originalWindow, QObject *parent = 0);
QScrip... | ---
+++
@@ -1,7 +1,5 @@
#ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
-
-#include <stdint.h>
#include <QHash>
#include <QObject>
@@ -19,7 +17,7 @@
QScriptValue toScriptValue();
- Q_INVOKABLE int randomInt(int min = 0, int max = INT32_MAX) const;
+ Q_INVOKABLE int randomInt(int min = 0... | Fix compile error on Amazon EC2.
| agpl-3.0 | arendjr/PlainText,arendjr/PlainText,arendjr/PlainText | f160c0edd74d9f31c936b92c7e7e6b4c9fb6848e |
/*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _UTILS_ASSUME_H
#define _UTILS_ASSUME_H
#include <utils/attribute.h>
#inclu... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _UTILS_ASSUME_H
#define _UTILS_ASSUME_H
#include <utils/builtin.h>
/* This... | ---
+++
@@ -11,7 +11,9 @@
#ifndef _UTILS_ASSUME_H
#define _UTILS_ASSUME_H
+#include <utils/attribute.h>
#include <utils/builtin.h>
+#include <utils/stringify.h>
/* This idiom is a way of passing extra information or hints to GCC. It is only
* occasionally successful, so don't think of it as a silver optimis... | libutils: Add dedicated macros to indicate hot and cold execution paths.
| bsd-2-clause | agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs | a3c982089a1443e909ebf8d6cf9be88f23c1f452 |
#ifndef _EFFECTLESS
#define EFFECTLESS
/*
Macros without multiple execution of side-effects.
*/
/*
Generic min and max without double execution of side-effects:
http://stackoverflow.com/questions/3437404/min-and-max-in-c
*/
#define _CHOOSE(boolop, a, b, uid) \
({ ... | #ifndef _EFFECTLESS
#define EFFECTLESS
/*
Macros without multiple execution of side-effects.
*/
/*
Generic min and max without double execution of side-effects:
http://stackoverflow.com/questions/3437404/min-and-max-in-c
*/
#define _CHOOSE(boolop, a, b, uid) \
({ \
decltype(a) _... | ---
+++
@@ -10,11 +10,11 @@
http://stackoverflow.com/questions/3437404/min-and-max-in-c
*/
-#define _CHOOSE(boolop, a, b, uid) \
- ({ \
- decltype(a) _a_ ## uid = (a); \
- decltype(b) _b_ ## uid = (b); \
- (a) boolop (b) ? (a) : (b); \
+#define _CHOOSE(boolop, a, b, ... | Fix `_CHOOSE` to use the copies instead of double execution of side-effects (issue reported by tromp at bitcointalk.org)
| unlicense | shelby3/cmacros,shelby3/cmacros | b817c6cc5a0231a0ad9bb1e71a69a15df05e4d80 |
/* Chapter 27, drill
1. Write a Hello World program
2. Define two variables holding "Hello" and "World!", concatenate them with
a space in between and output them as "Hello World!"
3. Define a function taking a char* p and an int x, print their values in
the format "p is 'foo' and x is 7". Ca... | /* Chapter 27, drill
1. Write a Hello World program
2. Define two variables holding "Hello" and "World!", concatenate them with
a space in between and output them as "Hello World!"
3. Define a function taking a char* p and an int x, print their values in
the format "p is 'foo' and x is 7". Ca... | ---
+++
@@ -17,15 +17,15 @@
int main()
{
printf("Hello World!\n");
-
- char* hello = "Hello";
- char* world = "World!";
- char* hello_world = (char*) malloc(strlen(hello)+strlen(world)+2);
- strcpy(hello_world,hello);
- hello_world[strlen(hello)] = ' ';
- strcpy(hello_world+strlen(hello)+1,wo... | Modify Chapter 27, drill to comply with C89 standard
| mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | e141aba93148a0e2b5bbcbde36b37d3cf171d1f2 |
#ifndef LINE_EQUATION_H
#define LINE_EQUATION_H
#include "Vector2.h"
class LineEquation
{
public:
LineEquation();
LineEquation(Vector2 p1, Vector2 p2);
LineEquation(Vector2 p, double m);
~LineEquation();
LineEquation(const LineEquation& e);
LineEquation(LineEquation&& e);
LineEquation& operator=(const Line... | #ifndef LINE_EQUATION_H
#define LINE_EQUATION_H
#include "Vector2.h"
class LineEquation
{
public:
LineEquation();
LineEquation(Vector2 a, Vector2 b);
LineEquation(Vector2 p, double m);
~LineEquation();
LineEquation(const LineEquation& e);
LineEquation(LineEquation&& e);
LineEquation& operator=(const LineEq... | ---
+++
@@ -7,7 +7,7 @@
{
public:
LineEquation();
- LineEquation(Vector2 a, Vector2 b);
+ LineEquation(Vector2 p1, Vector2 p2);
LineEquation(Vector2 p, double m);
~LineEquation(); | Modify parameter's name (name conflict)
| mit | utilForever/PolyMapGenerator | 9ebd09954a3b53fa5d87e8e3f1b1bb49c15b62e5 |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning... | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning... | ---
+++
@@ -21,6 +21,13 @@
* This attribute must be used to mark all DIFs which return an error value of
* some kind, to ensure that callers do not accidentally drop the error on the
* ground.
+ *
+ * Normally, the standard way to drop such a value on the ground explicitly is
+ * with the syntax `(void)expr;`, ... | [dif] Add a comment explaining how to drop an error on the ground
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509, which
necessitates doing this in a non-standard, but still portable, manner.
Signed-off-by: Miguel Young de la Sota <71b8e7f4945fd97b98544cf897992af89646547a@google.com>
| apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | 642e338cf79c78704ebfa7833fdd148f561921f5 |
#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 m... | #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 n... | ---
+++
@@ -7,6 +7,13 @@
#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 {
@@ -14,7 +21,7 @@
ALCenum mErrorCode;
public:
... | Add the printf format attribute to backend_exception's constructor
| lgpl-2.1 | aaronmjacobs/openal-soft,aaronmjacobs/openal-soft | b9592bddbc014759941b94b76596c1dbf2245ad3 |
#include "val_interfaces.h"
#include "pal_mbed_os_crypto.h"
#include "lifecycle.h"
#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
#endif
void test_entry_p003(v... | #include "val_interfaces.h"
#include "pal_mbed_os_crypto.h"
#include "lifecycle.h"
#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
#end... | ---
+++
@@ -5,7 +5,9 @@
#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
+#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
+#endif
void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
#endif
| Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
| apache-2.0 | andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed | 16a59cb9926bc96792cc9d1b7a996689f7bf1b86 |
/*
* Principal component analysis
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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 of the License, o... | /*
* Principal component analysis
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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 of the License, o... | ---
+++
@@ -23,7 +23,12 @@
* Principal component analysis
*/
+#ifndef FFMPEG_PCA_H
+#define FFMPEG_PCA_H
+
struct PCA *ff_pca_init(int n);
void ff_pca_free(struct PCA *pca);
void ff_pca_add(struct PCA *pca, double *v);
int ff_pca(struct PCA *pca, double *eigenvector, double *eigenvalue);
+
+#endif /* FFMPEG... | Make diego happy before he notices.
git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@14810 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
| lgpl-2.1 | prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg | a995514733949a433e39edec0966ba2789b57ada |
#ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#ifndef FLT_EPSILON
#define FLT_EPSILON (1.19209290e-07f)
#endif
#define DEG2RAD(x) ((ALfloat)(x)... | #ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#ifndef FLT_EPSILON
#define FLT_EPSILON (1.19209290e-07f)
#endif
#define DEG2RAD(x) ((ALfloat)(x) * (F_PI/180.0f))
#define RAD2DEG(x) ((ALfloat... | ---
+++
@@ -1,5 +1,9 @@
#ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
+
+#ifdef HAVE_FLOAT_H
+#include <float.h>
+#endif
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f) | Include float.h if present before defining math stuff
| lgpl-2.1 | aaronmjacobs/openal-soft,alexxvk/openal-soft,alexxvk/openal-soft,aaronmjacobs/openal-soft | 858230f4528ad2f418f97414e3a8be46865c367c |
#include <ifdhandler.h>
#include <stdio.h>
RESPONSECODE IFDHCreateChannelByName(DWORD Lun, LPSTR DeviceName)
{
return IFD_NO_SUCH_DEVICE;
}
RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel)
{
char buf[40];
snprintf(buf, sizeof(buf), "/dev/o2scr%d", Channel);
return IFDHCreateChannelByName(Lun, buf);
}
RE... | #include <ifdhandler.h>
| ---
+++
@@ -1 +1,57 @@
#include <ifdhandler.h>
+
+#include <stdio.h>
+
+RESPONSECODE IFDHCreateChannelByName(DWORD Lun, LPSTR DeviceName)
+{
+ return IFD_NO_SUCH_DEVICE;
+}
+
+RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel)
+{
+ char buf[40];
+ snprintf(buf, sizeof(buf), "/dev/o2scr%d", Channel);
+ return I... | Add empty dummy implementation of ifd handler
Signed-off-by: Dmitry Eremin-Solenikov <b6edad08270b2e4ffbcb0879e25a0e29a48c5275@gmail.com>
| lgpl-2.1 | lumag/o2scr-ifd | bcdfda8195e5414119afebb64601f89b37cf04fc |
#ifndef TYPES_H
#define TYPES_H
// Explicitly-sized versions of integer types
typedef __signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef... | #ifndef TYPES_H
#define TYPES_H
// Explicitly-sized versions of integer types
typedef __signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
// size... | ---
+++
@@ -11,6 +11,10 @@
typedef long long int64_t;
typedef unsigned long long uint64_t;
+typedef uint8_t bool;
+#define true 1;
+#define false 0;
+
// size_t is used for memory object sizes.
typedef uint32_t size_t;
| Define bool type together with true/false
| mit | dutra/x86_kernel,dutra/x86_kernel | b85b36e461985e3732e346d850e69f9e28135044 |
#pragma once
class UnicodeUtf16StringSearcher
{
private:
const wchar_t* m_Pattern;
uint32_t m_PatternLength;
public:
UnicodeUtf16StringSearcher() :
m_Pattern(nullptr)
{
}
void Initialize(const wchar_t* pattern, size_t patternLength)
{
if (patternLength > std::numeric_limits<uint32_t>::max() / 2)
__fast... | #pragma once
class UnicodeUtf16StringSearcher
{
private:
const wchar_t* m_Pattern;
uint32_t m_PatternLength;
public:
UnicodeUtf16StringSearcher() :
m_Pattern(nullptr)
{
}
void Initialize(const wchar_t* pattern, size_t patternLength)
{
if (patternLength > std::numeric_limits<uint32_t>::max() / 2)
__fast... | ---
+++
@@ -26,7 +26,7 @@
{
while (textEnd - textBegin >= m_PatternLength)
{
- auto comparisonResult = CompareStringEx(LOCALE_NAME_SYSTEM_DEFAULT, NORM_IGNORECASE, textBegin, static_cast<int>(textEnd - textBegin), m_Pattern, static_cast<int>(m_PatternLength), nullptr, nullptr, 0);
+ auto comparisonResult ... | Fix case insensitive UTF16 string search.
| mit | TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch | 8bc349742bc3c97da5bb88d382bc0860f7eb3399 |
#include "uart.h"
void uart_putchar(char c, FILE *stream) {
if( c == '\n' )
uart_putchar('\r', stream);
loop_until_bit_is_set(UCSR0A, UDRE0);
UDR0 = c;
}
static FILE uart_out = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
void uart_init(void) {
UBRR0L = BAUDRATE&0xFF;
UBRR0H ... | #include "uart.h"
void uart_putchar(char c, FILE *stream) {
if( c == '\n' )
uart_putchar( '\r', stream );
UDR0 = c;
loop_until_bit_is_set(UCSR0A, TXC0);
}
static FILE uart_out = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
void uart_init(void) {
UBRR0L = BAUDRATE&0xFF;
UBRR0H... | ---
+++
@@ -2,9 +2,9 @@
void uart_putchar(char c, FILE *stream) {
if( c == '\n' )
- uart_putchar( '\r', stream );
+ uart_putchar('\r', stream);
+ loop_until_bit_is_set(UCSR0A, UDRE0);
UDR0 = c;
- loop_until_bit_is_set(UCSR0A, TXC0);
}
static FILE uart_out = FDEV_SETUP_STREAM(uart_... | Reorder UART transmission. Instead of waiting for cache to be empty and then sending the value, we first add the value to cache and then wait for transmission. This way no characters are lost during transmission
| mit | nathanhi/steep-beta,nathanhi/steep-beta | 667e5c1daf0f5e6183361e8c6ff47b34bae3bea3 |
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#inc... | /*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#inc... | ---
+++
@@ -9,30 +9,4 @@
#include <uapi/asm/swab.h>
-static __inline__ __u16 ld_le16(const volatile __u16 *addr)
-{
- __u16 val;
-
- __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
- return val;
-}
-
-static __inline__ void st_le16(volatile __u16 *addr, const __u16 val)
-{
- __asm_... | powerpc: Remove unused st_le*() and ld_le* functions
The powerpc specific st_le*() and ld_le*() functions in
arch/powerpc/asm/swab.h no longer have any users. They are also
misleadingly named, since they always byteswap, even on a little-endian
host.
This patch removes them.
Signed-off-by: David Gibson <aa743a0aaec... | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs | 0eebf9b5d2da61f84cddd0ec2bb41be93f8fc82b |
#include <bert/encoder.h>
#include <bert/magic.h>
#include <bert/errno.h>
#include "test.h"
unsigned char output[6];
void test_output()
{
if (output[0] != BERT_MAGIC)
{
test_fail("bert_encoder_push did not add the magic byte");
}
if (output[1] != BERT_INT)
{
test_fail("bert_encoder_push did not add the INT... | #include <bert/encoder.h>
#include <bert/magic.h>
#include <bert/errno.h>
#include "test.h"
unsigned char output[6];
void test_output()
{
if (output[0] != BERT_MAGIC)
{
test_fail("bert_encoder_push did not add the magic byte");
}
if (output[1] != BERT_INT)
{
test_fail("bert_encoder_push did not add the INT... | ---
+++
@@ -18,15 +18,9 @@
test_fail("bert_encoder_push did not add the INT magic byte");
}
- unsigned int i;
+ unsigned char bytes[] = {0xff, 0xff, 0xff, 0xff};
- for (i=2;i<6;i++)
- {
- if (output[i] != 0xff)
- {
- test_fail("output[%u] is 0x%x, expected 0x%x",output[i],0xff);
- }
- }
+ test_bytes(out... | Make use of test_bytes in the int encoder test.
| mit | postmodern/libBERT | 2448675327ceaa844ae2fab4a15c46d0981cad17 |
// Copyright (c) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef UPDATE_H
#define UPDATE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include ... | // Copyright (c) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef UPDATE_H
#define UPDATE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include ... | ---
+++
@@ -11,8 +11,8 @@
#include <QNetworkReply>
#include <QUrl>
-const static QString KARBO_UPDATE_URL = "https://api.github.com/repos/Karbovanets/karbowanecwallet/tags";
-const static QString KARBO_DOWNLOAD_URL = "https://github.com/Karbovanets/karbowanecwallet/releases/";
+const static QString KARBO_UPDATE... | Change repository urls to proper for this version
| mit | seredat/karbowanecwallet,seredat/karbowanecwallet,seredat/karbowanecwallet | 452dbb09e2fd05a8f9fcfa300dd12ceefe9bf8ab |
#include "couv-private.h"
static int couv_hrtime(lua_State *L) {
lua_pushnumber(L, uv_hrtime());
return 1;
}
static const struct luaL_Reg functions[] = {
{ "hrtime", couv_hrtime },
{ NULL, NULL }
};
int luaopen_couv_native(lua_State *L) {
lua_createtable(L, 0, ARRAY_SIZE(functions) - 1);
couvL_setfuncs(L... | #include "couv-private.h"
static int couv_hrtime(lua_State *L) {
lua_pushnumber(L, uv_hrtime() / 1e9);
return 1;
}
static const struct luaL_Reg functions[] = {
{ "hrtime", couv_hrtime },
{ NULL, NULL }
};
int luaopen_couv_native(lua_State *L) {
lua_createtable(L, 0, ARRAY_SIZE(functions) - 1);
couvL_setf... | ---
+++
@@ -1,7 +1,7 @@
#include "couv-private.h"
static int couv_hrtime(lua_State *L) {
- lua_pushnumber(L, uv_hrtime() / 1e9);
+ lua_pushnumber(L, uv_hrtime());
return 1;
}
| Change return value of hrtime from seconds to nano seconds.
| mit | hnakamur/couv,hnakamur/couv | 0d95270ddad8133f04047a15a6b8b2887a5d97a8 |
// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s
void *f0()
{
return __builtin_thread_pointer();
}
void f1(char *a, char *b) {
__clear_cache(a,b);
}
// CHECK: call void @__clear_cache
| // RUN: %clang_cc1 -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o %t %s
void *f0()
{
return __builtin_thread_pointer();
}
| ---
+++
@@ -1,6 +1,12 @@
-// RUN: %clang_cc1 -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o %t %s
+// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s
void *f0()
{
return __builtin_thread_pointer();
}
+
+void f1(char *a, char *b) {
+ ... | Add a test to the previous commit.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@105596 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | a71d3c65375114146bb515b31820c5bf5d670128 |
#include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_FUNC(ring_get_gl_false)
{
RING_API_RETNUMBER(GL_FALSE);
}
RING_FUNC(ring_get_gl_logic_op)
{
RING_AP... | #include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_FUNC(ring_get_gl_false)
{
RING_API_RETNUMBER(GL_FALSE);
}
RING_FUNC(ring_get_gl_logic_op)
{
RING_AP... | ---
+++
@@ -25,9 +25,15 @@
RING_API_RETNUMBER(GL_LOGIC_OP);
}
+RING_FUNC(ring_get_gl_none)
+{
+ RING_API_RETNUMBER(GL_NONE);
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("get_gl_zero",ring_get_gl_zero);
ring_vm_funcregister("get_gl_false",ring_get_gl_false);
ring_vm_funcr... | Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_NONE
| mit | ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring | e87f79e573ba951dad55b81433b3a1839dd85332 |
#include "bst.h"
static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v);
struct BSTNode
{
BSTNode* left;
BSTNode* right;
BSTNode* p;
void* k;
};
struct BST
{
BSTNode* root;
};
BST* BST_Create(void)
{
BST* T = (BST* )malloc(sizeof(BST));
T->root = NULL;
return T;
}
BSTNode* BSTNode_Create(void* k)
{
BS... | #include "bst.h"
static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v);
struct BSTNode
{
BSTNode* left;
BSTNode* right;
BSTNode* p;
void* k;
};
struct BST
{
BSTNode* root;
};
BST* BST_Create(void)
{
BST* T = (BST* )malloc(sizeof(BST));
T->root = NULL;
return T;
}
| ---
+++
@@ -22,3 +22,12 @@
return T;
}
+BSTNode* BSTNode_Create(void* k)
+{
+ BSTNode* n = (BSTNode* )malloc(sizeof(BSTNode));
+ n->left = NULL;
+ n->right = NULL;
+ n->p = NULL;
+ n->k = k;
+}
+ | Add BSTNode create function implementation
| mit | MaxLikelihood/CADT | 51f8c2e766d7d7110e073630b6a1885eb7d7cabc |
#include <stdio.h>
#define CAP 8
const int currency[CAP] = {1, 2, 5, 10, 20, 50, 100, 200};
int total[CAP] = {0, 0, 0, 0, 0, 0, 0, 0};
const int limit = 200;
static inline int calculate_total(void)
{
int sum = 0;
for (int i=0; i < CAP; i++)
sum += total[i];
return sum;
}
int... | #include <stdio.h>
#define CAP 8
const int currency[CAP] = {1, 2, 5, 10, 20, 50, 100, 200};
int total[CAP] = {0, 0, 0, 0, 0, 0, 0, 0};
const int limit = 200;
static inline int calculate_total(void)
{
int sum = 0;
for (int i=0; i < CAP; i++)
sum += total[i];
return sum;
}
int... | ---
+++
@@ -28,12 +28,11 @@
total[idx] += currency[idx];
int sum = calculate_total();
- if (sum == limit)
- ways++;
-
- if (total[idx] < limit)
+ if (sum < limit)
idx = 0;
- else if (total[idx] >= limit) {
+ else {
+ if (sum == ... | Check against sum, 30 second improvement
| mit | tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler | 2e8abb7a804ed24013202b53784c31f7e1131429 |
#define MODULE sample
#include <sqmodule.h>
#include <stdio.h>
DECLARE_SQAPI
static SQInteger func(HSQUIRRELVM v)
{
static char s[] = "Hello, modules!";
SQAPI(pushstring)(v, s, sizeof(s) - 1);
return 1;
}
// Module init function
SQRESULT MODULE_INIT(HSQUIRRELVM v, HSQAPI api)
{
printf("in sqmodule_l... | #define MODULE sample
#include <sqmodule.h>
#include <stdio.h>
DECLARE_SQAPI
static SQInteger func(HSQUIRRELVM v)
{
static char s[] = "Hello, modules!";
SQAPI(pushstring)(v, s, sizeof(s) - 1);
return 1;
}
// Module init function
SQRESULT MODULE_INIT(HSQUIRRELVM v, HSQAPI api)
{
printf("in sqmodule_l... | ---
+++
@@ -17,7 +17,7 @@
{
printf("in sqmodule_load\n");
- INIT_SQAPI(api);
+ INIT_SQAPI(v, api);
SQAPI(pushstring)(v, _SC("func"), -1);
SQAPI(newclosure)(v, func, 0); | Update for sqmodule API change.
| mit | pfalcon/squirrel-modules,pfalcon/squirrel-modules,pfalcon/squirrel-modules | 807d73e3f1ae1cf89d5c000d8070c9e43d80b453 |
#ifndef _INC_UTILS_H
#define _INC_UTILS_H
#include "basetypes.h"
inline void *advancePtr(void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
inline const void *advancePtr(const void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
#endif//_INC_UTILS_H | #ifndef _INC_UTILS_H
#define _INC_UTILS_H
#include "basetypes.h"
void *advancePtr(void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
const void *advancePtr(const void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
#endif//_INC_UTILS_H | ---
+++
@@ -3,11 +3,11 @@
#include "basetypes.h"
-void *advancePtr(void *vp, SizeType len) {
+inline void *advancePtr(void *vp, SizeType len) {
return (void*)((unsigned char *)(vp) + len);
}
-const void *advancePtr(const void *vp, SizeType len) {
+inline const void *advancePtr(const void *vp, SizeType le... | Fix header methods to be inline
| mit | aroxby/cpu,aroxby/cpu | d4ea2ac1a1bbf61ed190ac9b6e78d6be4ce687f6 |
#ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0.2dev"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
| #ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0.1"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
| ---
+++
@@ -2,7 +2,7 @@
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
- #define PHP_SHMT_EXTVER "1.0.1"
+ #define PHP_SHMT_EXTVER "1.0.2dev"
#ifdef HAVE_CONFIG_H
#include "config.h" | Update the version after tagging | mit | sevenval/SHMT,sevenval/SHMT | 65c761a0d8dd7a84c9fbf9c108dafc1b8b690ac6 |
//
// SFBLELogging.h
// SFBluetoothLowEnergyDevice
//
// Created by Thomas Billicsich on 2014-04-04.
// Copyright (c) 2014 Thomas Billicsich. All rights reserved.
#import <CocoaLumberjack/CocoaLumberjack.h>
// To define a different local (per file) log level
// put the following line _before_ the import of SFBLE... | //
// SFBLELogging.h
// SFBluetoothLowEnergyDevice
//
// Created by Thomas Billicsich on 2014-04-04.
// Copyright (c) 2014 Thomas Billicsich. All rights reserved.
#import <CocoaLumberjack/CocoaLumberjack.h>
// To define a different local (per file) log level
// put the following line _before_ the import of SFBLE... | ---
+++
@@ -11,7 +11,7 @@
// To define a different local (per file) log level
// put the following line _before_ the import of SFBLELogging.h
// #define LOCAL_LOG_LEVEL LOG_LEVEL_DEBUG
-#define GLOBAL_LOG_LEVEL DDLogLevelVerbose
+#define GLOBAL_LOG_LEVEL DDLogLevelInfo
#ifndef LOCAL_LOG_LEVEL
#define LOCAL_LO... | Set default log level to info
[Delivers #87082830]
| mit | martinjacala/SFBluetoothLowEnergyDevice,simpliflow/SFBluetoothLowEnergyDevice | b07d89ca854f79eca700a95f5e1d23d5b5f6f1ba |
//
// ViewController.h
// AAChartKit
//
// Created by An An on 17/3/13.
// Copyright © 2017年 An An. All rights reserved.
// source code ----*** https://github.com/AAChartModel/AAChartKit ***--- source code
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger,SecondeViewControllerChartType){
SecondeViewControl... | //
// ViewController.h
// AAChartKit
//
// Created by An An on 17/3/13.
// Copyright © 2017年 An An. All rights reserved.
// source code ----*** https://github.com/AAChartModel/AAChartKit ***--- source code
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger,ENUM_secondeViewController_chartType){
ENUM_seconde... | ---
+++
@@ -8,20 +8,20 @@
//
#import <UIKit/UIKit.h>
-typedef NS_ENUM(NSInteger,ENUM_secondeViewController_chartType){
- ENUM_secondeViewController_chartTypeColumn =0,
- ENUM_secondeViewController_chartTypeBar,
- ENUM_secondeViewController_chartTypeArea,
- ENUM_secondeViewController_chartTypeAreasplin... | Correct the naming notations of enumeration
| mit | AAChartModel/AAChartKit,AAChartModel/AAChartKit,AAChartModel/AAChartKit | 08d8a5ec7d018c771787bd33b429c2b2d096a578 |
/* dtkComposerSceneNodeLeaf.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 12:34:45 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu May 31 09:45:52 2012 (+0200)
* By: tkloczko
* Update #: 11
*/
/* Commentary:
*
*/
/* Change log:
*
... | /* dtkComposerSceneNodeLeaf.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 12:34:45 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu Feb 16 14:47:09 2012 (+0100)
* By: Julien Wintz
* Update #: 10
*/
/* Commentary:
*
*/
/* Change log:
... | ---
+++
@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 12:34:45 2012 (+0100)
* Version: $Id$
- * Last-Updated: Thu Feb 16 14:47:09 2012 (+0100)
- * By: Julien Wintz
- * Update #: 10
+ * Last-Updated: Thu May 31 09:45:52 2012 (+0200)
+ * By: tkloczk... | Add export rules for scene node leaf.
| bsd-3-clause | d-tk/dtk,d-tk/dtk,NicolasSchnitzler/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,d-tk/dtk | 08d9391c8f90f0c5c997bd3ab41517774dd582f3 |
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
printf("stack overflow %d\n", i);
longjmp(try, ++i);
assert(0);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int m... | #include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
jmp_buf try;
void handler(int sig) {
static int i = 0;
write(2, "stack overflow\n", 15);
longjmp(try, ++i);
_exit(1);
}
unsigned recurse(unsigned x) {
return recurse(x)+1;
}
int ma... | ---
+++
@@ -10,9 +10,9 @@
void handler(int sig) {
static int i = 0;
- write(2, "stack overflow\n", 15);
+ printf("stack overflow %d\n", i);
longjmp(try, ++i);
- _exit(1);
+ assert(0);
}
unsigned recurse(unsigned x) {
@@ -34,6 +34,7 @@
sigaltstack(&ss, 0);
sigfillset(&sa.sa_mask);
sigaction(S... | Add assert, more print info
| apache-2.0 | danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets | 88dd832b22b4927f9d571158c0429df0a50fd6d8 |
#include <kotaka/paths.h>
#include <kotaka/privilege.h>
#include <kotaka/bigstruct.h>
#include <kotaka/log.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
load_dir("obj", 1);
load_dir("sys", 1);
}
void full_reset()
{
object turkeylist;
object cursor;
object first;
object this;
ACCESS_CH... | #include <kotaka/paths.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
load_dir("obj", 1);
load_dir("sys", 1);
}
| ---
+++
@@ -1,4 +1,7 @@
#include <kotaka/paths.h>
+#include <kotaka/privilege.h>
+#include <kotaka/bigstruct.h>
+#include <kotaka/log.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
@@ -8,3 +11,42 @@
load_dir("obj", 1);
load_dir("sys", 1);
}
+
+void full_reset()
+{
+ object turkeylist;
+ object cursor;
+ obj... | Allow help module to be rebooted
| agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka | febcd73e5ebc12d91f72bd948d8d8abd2043d84d |
#import <Foundation/Foundation.h>
@class JSObjectionInjector;
@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, weak) JSObjectionInjector *injector;
- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObject... | #import <Foundation/Foundation.h>
@class JSObjectionInjector;
@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, strong) JSObjectionInjector *injector;
- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObje... | ---
+++
@@ -3,7 +3,7 @@
@class JSObjectionInjector;
@interface JSObjectFactory : NSObject
-@property (nonatomic, readonly, strong) JSObjectionInjector *injector;
+@property (nonatomic, readonly, weak) JSObjectionInjector *injector;
- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)cl... | Use weak reference in object factory to avoid cyclical references | mit | ApplauseAQI/objection,alexfeng/objection,ApplauseAQI/objection,zjh171/objection,atomicobject/objection,technology-ebay-de/objection,paulz/objection,technology-ebay-de/objection,hzm0318hzm/objection,ApplauseAQI/objection,alexfeng/objection,hzm0318hzm/objection,zjh171/objection,paulz/objection,atomicobject/objection,Reut... | 052f525884c6664c3047b03b607ca5f7d19e9524 |
#ifndef _CGMINER_MINER_H
#define _CGMINER_MINER_H
#include <stdint.h>
#include <stdbool.h>
struct work {
uint8_t *midstate;
uint8_t *data;
};
#ifndef MAX
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
#ifndef MIN
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#endif
#endif
| #ifndef _CGMINER_MINER_H
#define _CGMINER_MINER_H
#include <stdint.h>
struct work {
uint8_t *midstate;
uint8_t *data;
};
#ifndef MAX
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
#ifndef MIN
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#endif
typedef enum {
false = 0,
true = 1
} bool;
#endif
| ---
+++
@@ -2,6 +2,7 @@
#define _CGMINER_MINER_H
#include <stdint.h>
+#include <stdbool.h>
struct work {
uint8_t *midstate;
@@ -15,8 +16,4 @@
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#endif
-typedef enum {
- false = 0,
- true = 1
-} bool;
#endif | Use stdbool.h for bool definition.
Our own collides with applications using strbool.h
| mit | KnCMiner/knc-asic,KnCMiner/knc-asic,KnCMiner/knc-asic | cb39939355915d400a9ea0f0bee5e6fcc5dfeb37 |
// RUN: %check %s
// extern
extern inline int f()
{
static int i;
return i++;
}
// static
static inline int h()
{
static int i;
return i++;
}
// neither
inline int g()
{
static int i; // CHECK: warning: mutable static variable in pure-inline function - may differ per file
return i++;
}
// neither, but const
i... | // RUN: %check %s
// extern
extern inline int f()
{
static int i;
return i++;
}
// static
static inline int h()
{
static int i;
return i++;
}
// neither
inline int g()
{
static int i; // CHECK: warning: static variable in pure-inline function - may differ per file
return i++;
}
// neither, but const
inline in... | ---
+++
@@ -17,7 +17,7 @@
// neither
inline int g()
{
- static int i; // CHECK: warning: static variable in pure-inline function - may differ per file
+ static int i; // CHECK: warning: mutable static variable in pure-inline function - may differ per file
return i++;
}
| Fix inline static local warning
| mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler | 51f9648c1af205b9822a1dfe220c825eef07a2cc |
/* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
static int refcount = 0;
void dict_drivers_register_builtin(void)
{
if (refcount++ > 0)
return;
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver... | /* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
void dict_drivers_register_builtin(void)
{
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver_register(&dict_driver_fs);
dict_driver_register(&dict_d... | ---
+++
@@ -3,8 +3,12 @@
#include "lib.h"
#include "dict-private.h"
+static int refcount = 0;
+
void dict_drivers_register_builtin(void)
{
+ if (refcount++ > 0)
+ return;
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver_register(&dict_driver_fs);
@@ -15,6 +1... | lib-dict: Allow registering builtin dict drivers multiple times.
| mit | dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot | 9ac14d7ea9468fd480cfd5375242b4101ef37441 |
// @(#)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+;
... | // @(#)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+;
... | ---
+++
@@ -1,4 +1,4 @@
-// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $
+// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $
#ifdef __CINT__
#pragma link off all globals;
@@ -14,6 +14,7 @@
#pragma link C++ class TVirtualMCApplication+;
#pragma link C++ cla... | Add TMCVerbose to the list of mc classes
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@6190 27541ba8-7e3a-0410-8455-c3a389f83636
| lgpl-2.1 | satyarth934/root,dfunke/root,tc3t/qoot,georgtroska/root,georgtroska/root,perovic/root,sawenzel/root,alexschlueter/cern-root,kirbyherm/root-r-tools,arch1tect0r/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,cxx-hep/root-cern,agarciamontoro/root,nilqed/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-du... | 7210b0870c273abcd45c9d7663623242a846e256 |
//===--- Dwarf.h - DWARF constants ------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | //===--- Dwarf.h - DWARF constants ------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | ---
+++
@@ -17,7 +17,7 @@
#ifndef SWIFT_BASIC_DWARF_H
#define SWIFT_BASIC_DWARF_H
-#include "llvm/Support/Dwarf.h"
+#include "llvm/BinaryFormat/Dwarf.h"
namespace swift {
/// The DWARF version emitted by the Swift compiler. | Adjust for new LLVM BinaryFormat library in r304864.
| apache-2.0 | lorentey/swift,xedin/swift,frootloops/swift,stephentyrone/swift,ahoppen/swift,xedin/swift,stephentyrone/swift,sschiau/swift,huonw/swift,benlangmuir/swift,karwa/swift,alblue/swift,ahoppen/swift,airspeedswift/swift,OscarSwanros/swift,return/swift,practicalswift/swift,jmgc/swift,frootloops/swift,airspeedswift/swift,parker... | 1d40a955d93f517c1468a62896fd2ec24e3660ce |
#ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
#include "Allocator.h"
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short align... | #ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
#include "Allocator.h"
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short align... | ---
+++
@@ -14,7 +14,7 @@
virtual void* Allocate(const std::size_t size, const short alignment = 0);
- virtual void Free(const std::size_t size);
+ virtual void Free(void* ptr);
virtual void Init() override;
@@ -22,7 +22,7 @@
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
... | Change allocation header member padding type from char to unsigned short
| mit | mtrebi/memory-allocators | 4b516c3c5a41476be8b4ede752eea260879a0602 |
// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' &&
// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement' &&
// RUN: clang-cc %s -x cl -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(4) )) flo... | // RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement' &&
// RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement' &&
// RUN: clang-cc %s -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(4) )) float float4;
float2... | ---
+++
@@ -1,6 +1,6 @@
-// RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement' &&
-// RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement' &&
-// RUN: clang-cc %s -emit-llvm -o - | grep 'shufflevector'
+// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' &&
+// RUN: clang-cc %s -x c... | Add test for OpenCL vector initializer codegen
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@84445 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-cl... | bd339f71c7a5a3e2b883f4306689c8bc39077895 |
//===- lld/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h --------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------... | //===- lld/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h --------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------... | ---
+++
@@ -19,15 +19,12 @@
class AMDGPUTargetRelocationHandler final : public TargetRelocationHandler {
public:
- AMDGPUTargetRelocationHandler(AMDGPUTargetLayout &layout)
- : _targetLayout(layout) {}
+ AMDGPUTargetRelocationHandler(AMDGPUTargetLayout &layout) { }
std::error_code applyRelocation(ELFW... | ELF/AMDGPU: Remove another unused private member variable
git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@246164 91177308-0d34-0410-b5e6-96231b3b80d8
| apache-2.0 | llvm-mirror/lld,llvm-mirror/lld | 396890929c29d0c7a9b1474f9e0fa6683903ed1a |
#ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2,
DEPTH_HOLD = 3
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
| #ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
| ---
+++
@@ -5,9 +5,10 @@
{
enum ControlMode
{
- OPEN_LOOP = 0,
- SIXDOF = 1,
- RPY_DEPTH = 2
+ OPEN_LOOP = 0,
+ SIXDOF = 1,
+ RPY_DEPTH = 2,
+ DEPTH_HOLD = 3
};
}
typedef ControlModes::ControlMode ControlMode; | Add depth hold mode to enum
| mit | vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control | 73d73eeaa0fdd21bfb1592e2f7066590ef7ee920 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.