commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
1980b7bb0ffee0750ed832fc1b474c6ae6e85b00
|
lib/libc/minimal/include/stddef.h
|
lib/libc/minimal/include/stddef.h
|
/* stddef.h */
/*
* Copyright (c) 2014 Wind River Systems, 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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __INC_stddef_h__
#define __INC_stddef_h__
#include <bits/null.h>
#include <bits/size_t.h>
#if !defined(__ptrdiff_t_defined)
#define __ptrdiff_t_defined
typedef int ptrdiff_t;
#endif
#define offsetof(type, member) ((size_t) (&((type *) NULL)->member))
#endif /* __INC_stddef_h__ */
|
/* stddef.h */
/*
* Copyright (c) 2014 Wind River Systems, 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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __INC_stddef_h__
#define __INC_stddef_h__
#include <bits/null.h>
#include <bits/size_t.h>
#if !defined(__ptrdiff_t_defined)
#define __ptrdiff_t_defined
typedef int ptrdiff_t;
#endif
#if defined(__GNUC__)
#define offsetof(type, member) __builtin_offsetof(type, member)
#else
#define offsetof(type, member) ((size_t) (&((type *) NULL)->member))
#endif
#endif /* __INC_stddef_h__ */
|
Use offsetof() builtin with GCC
|
lib: Use offsetof() builtin with GCC
The default offsetof() implementation generates a warning
(variably modified <variable> at file scope) when used in
to define the size of an array. By using this builtin with
GCC we avoid the warning and make sure no variable-size
arrays are used.
Change-Id: Iae215f777241f7daaa061067230086dffaa8311d
Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>
|
C
|
apache-2.0
|
erwango/zephyr,zephyriot/zephyr,rsalveti/zephyr,runchip/zephyr-cc3220,holtmann/zephyr,aceofall/zephyr-iotos,holtmann/zephyr,punitvara/zephyr,finikorg/zephyr,pklazy/zephyr,zephyriot/zephyr,kraj/zephyr,erwango/zephyr,galak/zephyr,bboozzoo/zephyr,finikorg/zephyr,mbolivar/zephyr,runchip/zephyr-cc3220,ldts/zephyr,galak/zephyr,Vudentz/zephyr,ldts/zephyr,fractalclone/zephyr-riscv,galak/zephyr,kraj/zephyr,mbolivar/zephyr,kraj/zephyr,nashif/zephyr,fractalclone/zephyr-riscv,tidyjiang8/zephyr-doc,bboozzoo/zephyr,erwango/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,fbsder/zephyr,mbolivar/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,nashif/zephyr,kraj/zephyr,sharronliu/zephyr,bigdinotech/zephyr,sharronliu/zephyr,fractalclone/zephyr-riscv,runchip/zephyr-cc3220,nashif/zephyr,tidyjiang8/zephyr-doc,holtmann/zephyr,holtmann/zephyr,explora26/zephyr,Vudentz/zephyr,punitvara/zephyr,runchip/zephyr-cc3200,rsalveti/zephyr,fbsder/zephyr,aceofall/zephyr-iotos,GiulianoFranchetto/zephyr,sharronliu/zephyr,bigdinotech/zephyr,finikorg/zephyr,aceofall/zephyr-iotos,pklazy/zephyr,nashif/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,sharronliu/zephyr,runchip/zephyr-cc3200,tidyjiang8/zephyr-doc,bboozzoo/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,pklazy/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,pklazy/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,aceofall/zephyr-iotos,erwango/zephyr,zephyriot/zephyr,rsalveti/zephyr,tidyjiang8/zephyr-doc,bboozzoo/zephyr,finikorg/zephyr,galak/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,erwango/zephyr,pklazy/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,rsalveti/zephyr,rsalveti/zephyr,zephyriot/zephyr,holtmann/zephyr,sharronliu/zephyr,Vudentz/zephyr,kraj/zephyr,fbsder/zephyr,explora26/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,punitvara/zephyr,fractalclone/zephyr-riscv,zephyriot/zephyr,tidyjiang8/zephyr-doc,mbolivar/zephyr,fbsder/zephyr,Vudentz/zephyr,punitvara/zephyr,mbolivar/zephyr,galak/zephyr,explora26/zephyr,runchip/zephyr-cc3220,fbsder/zephyr,bboozzoo/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr
|
188b56251284352d2a2da90d5fab31276a834ff7
|
testsuite/tests/rts/T7037_main.c
|
testsuite/tests/rts/T7037_main.c
|
#include <stddef.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
const char *args[2] = {"T7037", NULL};
execv("./T7037", args);
}
|
#include <stddef.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
#ifdef __MINGW32__
const
#endif
char * args[2] = {"T7037", NULL};
execv("./T7037", args);
}
|
Make T7037 work on both Windows and other platforms
|
Make T7037 work on both Windows and other platforms
|
C
|
bsd-3-clause
|
mcschroeder/ghc,forked-upstream-packages-for-ghcjs/ghc,tibbe/ghc,ryantm/ghc,TomMD/ghc,oldmanmike/ghc,nkaretnikov/ghc,mettekou/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,nkaretnikov/ghc,mfine/ghc,mettekou/ghc,mcschroeder/ghc,AlexanderPankiv/ghc,christiaanb/ghc,snoyberg/ghc,ghc-android/ghc,snoyberg/ghc,christiaanb/ghc,hferreiro/replay,spacekitteh/smcghc,acowley/ghc,fmthoma/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,ghc-android/ghc,da-x/ghc,nushio3/ghc,nkaretnikov/ghc,bitemyapp/ghc,anton-dessiatov/ghc,holzensp/ghc,nkaretnikov/ghc,oldmanmike/ghc,vikraman/ghc,bitemyapp/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,elieux/ghc,christiaanb/ghc,oldmanmike/ghc,TomMD/ghc,vikraman/ghc,spacekitteh/smcghc,mfine/ghc,frantisekfarka/ghc-dsi,ryantm/ghc,frantisekfarka/ghc-dsi,sdiehl/ghc,vikraman/ghc,jstolarek/ghc,GaloisInc/halvm-ghc,forked-upstream-packages-for-ghcjs/ghc,nathyong/microghc-ghc,holzensp/ghc,elieux/ghc,anton-dessiatov/ghc,fmthoma/ghc,lukexi/ghc-7.8-arm64,nushio3/ghc,christiaanb/ghc,mettekou/ghc,nushio3/ghc,hferreiro/replay,nkaretnikov/ghc,forked-upstream-packages-for-ghcjs/ghc,ezyang/ghc,sgillespie/ghc,ghc-android/ghc,mettekou/ghc,sgillespie/ghc,gridaphobe/ghc,sgillespie/ghc,AlexanderPankiv/ghc,da-x/ghc,vTurbine/ghc,urbanslug/ghc,ryantm/ghc,christiaanb/ghc,anton-dessiatov/ghc,elieux/ghc,oldmanmike/ghc,holzensp/ghc,TomMD/ghc,urbanslug/ghc,siddhanathan/ghc,snoyberg/ghc,elieux/ghc,gcampax/ghc,ml9951/ghc,ezyang/ghc,shlevy/ghc,oldmanmike/ghc,bitemyapp/ghc,urbanslug/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,green-haskell/ghc,urbanslug/ghc,nushio3/ghc,jstolarek/ghc,frantisekfarka/ghc-dsi,hferreiro/replay,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,anton-dessiatov/ghc,sdiehl/ghc,nushio3/ghc,tibbe/ghc,vTurbine/ghc,wxwxwwxxx/ghc,mettekou/ghc,ml9951/ghc,nkaretnikov/ghc,acowley/ghc,da-x/ghc,GaloisInc/halvm-ghc,da-x/ghc,shlevy/ghc,olsner/ghc,gcampax/ghc,oldmanmike/ghc,snoyberg/ghc,olsner/ghc,vTurbine/ghc,lukexi/ghc-7.8-arm64,sdiehl/ghc,green-haskell/ghc,ezyang/ghc,hferreiro/replay,tibbe/ghc,nathyong/microghc-ghc,gridaphobe/ghc,sdiehl/ghc,ml9951/ghc,sdiehl/ghc,wxwxwwxxx/ghc,TomMD/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,ezyang/ghc,sgillespie/ghc,ml9951/ghc,urbanslug/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,lukexi/ghc,ezyang/ghc,wxwxwwxxx/ghc,vTurbine/ghc,sgillespie/ghc,gridaphobe/ghc,lukexi/ghc,tjakway/ghcjvm,bitemyapp/ghc,olsner/ghc,tjakway/ghcjvm,acowley/ghc,mcschroeder/ghc,christiaanb/ghc,gcampax/ghc,fmthoma/ghc,lukexi/ghc,christiaanb/ghc,AlexanderPankiv/ghc,hferreiro/replay,ml9951/ghc,gridaphobe/ghc,olsner/ghc,mfine/ghc,ml9951/ghc,olsner/ghc,lukexi/ghc,vikraman/ghc,shlevy/ghc,fmthoma/ghc,olsner/ghc,shlevy/ghc,mfine/ghc,tibbe/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,ezyang/ghc,bitemyapp/ghc,tjakway/ghcjvm,mcschroeder/ghc,ezyang/ghc,wxwxwwxxx/ghc,gcampax/ghc,mcschroeder/ghc,holzensp/ghc,lukexi/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,nkaretnikov/ghc,hferreiro/replay,gcampax/ghc,sdiehl/ghc,nathyong/microghc-ghc,sgillespie/ghc,ghc-android/ghc,jstolarek/ghc,siddhanathan/ghc,ryantm/ghc,spacekitteh/smcghc,lukexi/ghc-7.8-arm64,ghc-android/ghc,ml9951/ghc,fmthoma/ghc,mfine/ghc,green-haskell/ghc,gcampax/ghc,TomMD/ghc,da-x/ghc,acowley/ghc,mettekou/ghc,forked-upstream-packages-for-ghcjs/ghc,ghc-android/ghc,vikraman/ghc,fmthoma/ghc,vTurbine/ghc,mettekou/ghc,nushio3/ghc,sdiehl/ghc,green-haskell/ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,acowley/ghc,elieux/ghc,gridaphobe/ghc,snoyberg/ghc,gridaphobe/ghc,vTurbine/ghc,ghc-android/ghc,tjakway/ghcjvm,snoyberg/ghc,fmthoma/ghc,nushio3/ghc,ryantm/ghc,mcschroeder/ghc,nathyong/microghc-ghc,holzensp/ghc,vikraman/ghc,elieux/ghc,hferreiro/replay,wxwxwwxxx/ghc,mfine/ghc,elieux/ghc,acowley/ghc,lukexi/ghc-7.8-arm64,wxwxwwxxx/ghc,ml9951/ghc,shlevy/ghc,jstolarek/ghc,da-x/ghc,shlevy/ghc,nathyong/microghc-ghc,tjakway/ghcjvm,mfine/ghc,sgillespie/ghc,gcampax/ghc,acowley/ghc,oldmanmike/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,spacekitteh/smcghc,vikraman/ghc,urbanslug/ghc,lukexi/ghc-7.8-arm64,spacekitteh/smcghc,TomMD/ghc,AlexanderPankiv/ghc,jstolarek/ghc,siddhanathan/ghc,mcschroeder/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,shlevy/ghc,da-x/ghc,AlexanderPankiv/ghc,gridaphobe/ghc,siddhanathan/ghc,frantisekfarka/ghc-dsi,tibbe/ghc,snoyberg/ghc,green-haskell/ghc
|
27e5d7c74125784cb278b44e12881ca3596ee868
|
STM32F103GNU/src/startup.c
|
STM32F103GNU/src/startup.c
|
/*
* startup.h
*
* Created on: Nov 15, 2016
* Author: RoyerAriel
*/
#ifndef STARTUP_C_
#define STARTUP_C_
#include "Timer.h"
void startup()
{
//Start Systick Timer at 1ms
Systick_Startup();
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x2000000
}
#endif /* STARTUP_C_ */
|
/*
* startup.h
*
* Created on: Nov 15, 2016
* Author: RoyerAriel
*/
#ifndef STARTUP_C_
#define STARTUP_C_
#include "Timer.h"
void startup()
{
//Start Systick Timer at 1ms
Systick_Startup();
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x2000000disable jtag
}
#endif /* STARTUP_C_ */
|
Disable Jtag came enable by default
|
Disable Jtag came enable by default
Disable Jtag came enable by default and use GPIOB P04,P03 and P05
|
C
|
epl-1.0
|
royel21/STM32F103GNU,royel21/STM32F103GNU
|
d6e3fda253c18d1a30c14d5b176737c337c00b00
|
IAAI.c
|
IAAI.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";
const char default_str[] = "I AM AN IDIOT ";
int main(int argc, char **argv) {
system(RAW);
const char *str;
if ( argc == 2 )
str = argv[1];
else
str = default_str;
size_t len = strlen(str);
while ( 1 ) {
for ( size_t i = 0 ; i < len ; i++ ) {
getchar();
printf("\b%c", str[i]);
}
system(COOKED);
printf("\n");
system(RAW);
}
return 0;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";
const char default_str[] = "I AM AN IDIOT ";
int main(int argc, char **argv) {
system(RAW);
const char *str;
if ( argc == 2 )
str = argv[1];
else
str = default_str;
size_t len = strlen(str);
while ( 1 ) {
for ( size_t i = 0 ; i < len ; i++ ) {
getchar();
printf("\r");
for ( size_t j = 0 ; j <= i ; j++ ) {
printf("%c", str[j]);
}
}
system(COOKED);
printf("\n");
system(RAW);
}
return 0;
}
|
Allow non printing chars to also work well
|
Allow non printing chars to also work well
|
C
|
mit
|
vinamarora8/IAAI
|
7e9ee0eb7233bcfb93f53a18320cf8187c5f5d89
|
libutils/include/utils/fence.h
|
libutils/include/utils/fence.h
|
/*
* Copyright 2016, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* 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(D61_BSD)
*/
#pragma once
/* Prevent the compiler from re-ordering any read or write across the fence. */
#define COMPILER_MEMORY_FENCE() __atomic_signal_fence(__ATOMIC_ACQ_REL)
/* Prevent the compiler from re-ordering any write which follows the fence
* in program order with any read or write which preceeds the fence in
* program order. */
#define COMPILER_MEMORY_RELEASE() __atomic_signal_fence(__ATOMIC_RELEASE)
/* Prevent the compiler from re-ordering any read which preceeds the fence
* in program order with any read or write which follows the fence in
* program order */.
#define COMPILER_MEMORY_ACQUIRE() __atomic_signal_fence(__ATOMIC_ACQUIRE)
|
/*
* Copyright 2016, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* 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(D61_BSD)
*/
#pragma once
/* Prevent the compiler from re-ordering any read or write across the fence. */
#define COMPILER_MEMORY_FENCE() __atomic_signal_fence(__ATOMIC_ACQ_REL)
/* Prevent the compiler from re-ordering any write which follows the fence
* in program order with any read or write which preceeds the fence in
* program order. */
#define COMPILER_MEMORY_RELEASE() __atomic_signal_fence(__ATOMIC_RELEASE)
/* Prevent the compiler from re-ordering any read which preceeds the fence
* in program order with any read or write which follows the fence in
* program order. */
#define COMPILER_MEMORY_ACQUIRE() __atomic_signal_fence(__ATOMIC_ACQUIRE)
|
Move trailing . inside comment
|
libutils: Move trailing . inside comment
|
C
|
bsd-2-clause
|
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
|
86fb835194f54ccecc33bfaf71f38b636993baab
|
test/Preprocessor/comment_save_macro.c
|
test/Preprocessor/comment_save_macro.c
|
// RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar // zot
// RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s
// CHECK: boo bork /* blah*/ bar // zot
// RUN: clang-cc -E %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar
#define FOO bork // blah
boo FOO bar // zot
|
// RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s &&
// CHECK: boo bork bar // zot
// RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s &&
// CHECK: boo bork /* blah*/ bar // zot
// RUN: clang-cc -E %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar
#define FOO bork // blah
boo FOO bar // zot
|
Fix a broken test in rev. 85199.
|
Fix a broken test in rev. 85199.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@85200 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
|
22f57814c548ceb55bd4295768ff1873f3f4e3ae
|
webserver.c
|
webserver.c
|
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
int main(int argc, char** argv)
{
int listen_fd;
struct sockaddr_in serv_addr;
listen_fd = socket(AF_INET, SOCK_STREAM, 0);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(8080);
bind(listen_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
if (listen(listen_fd, 64)) {
perror("listen");
} else {
}
return 0;
}
|
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#define TRUE 1
#define BUFFER_SIZE 8096
int main(int argc, char** argv)
{
int listen_fd;
int connection_fd;
socklen_t length;
int err;
int read_len;
char buffer[BUFFER_SIZE+1];
struct sockaddr_in serv_addr;
struct sockaddr_in client_addr;
listen_fd = socket(AF_INET, SOCK_STREAM, 0);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(8080);
err = bind(listen_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
if (err == -1) {
perror("bind");
}
err = listen(listen_fd, 64);
if (err == -1) {
perror("listen");
}
while (TRUE) {
connection_fd = accept(listen_fd, (struct sockaddr*)&client_addr, &length);
read_len = read(connection_fd, buffer, BUFFER_SIZE);
printf("Read %d bytes: %s\n", read_len, buffer);
close(connection_fd);
}
return 0;
}
|
Implement accept of incoming requests
|
Implement accept of incoming requests
|
C
|
apache-2.0
|
benjic/web-server,benjic/web-server
|
a2c066c1346a897b8a62fac75951009107437f34
|
serialization/include/SerializationToStream.h
|
serialization/include/SerializationToStream.h
|
/// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include "ISerializable.h"
#include "IStorage.h"
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
/// Serialize object to ostream
std::ostream& operator<<(std::ostream& outStream, simpson::ISerializable& obj);
/// Deserialize object from istream
std::istream& operator>>(std::istream& inStream, simpson::ISerializable* obj);
} // simpson
|
/// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include "IStorage.h"
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
class ISerializable;
/// Serialize object to ostream
std::ostream& operator<<(std::ostream& outStream, ISerializable& obj);
/// Deserialize object from istream
std::istream& operator>>(std::istream& inStream, ISerializable* obj);
} // simpson
|
Change include to forward declaration
|
Change include to forward declaration
|
C
|
mit
|
artem-ogre/simpson,artem-ogre/simpson
|
6779aa4e1884e4bb6e87820f7d29f08a84fde425
|
Kiwi/KiwiConfiguration.h
|
Kiwi/KiwiConfiguration.h
|
//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#if defined(__BLOCKS__)
#define KW_BLOCKS_ENABLED 1
#endif // #if defined(__BLOCKS__)
// As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or
// forwardInvocation: boundary in the simulator will terminate the app instead
// of being caught in @catch blocks from the caller side of the -invoke. Kiwi
// tries to handle this by storing the first exception that it would have
// otherwise thrown in a nasty global that callers can look for and handle.
// (Buggy termination is less desirable than global variables).
//
// Obviously, this can only handles cases where Kiwi itself would have raised
// an exception.
#if TARGET_IPHONE_SIMULATOR
#define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1
#endif // #if TARGET_IPHONE_SIMULATOR
|
//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#if defined(__BLOCKS__)
#ifndef KW_BLOCKS_ENABLED
#define KW_BLOCKS_ENABLED 1
#endif // #ifndef KW_BLOCKS_ENABLED
#endif // #if defined(__BLOCKS__)
// As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or
// forwardInvocation: boundary in the simulator will terminate the app instead
// of being caught in @catch blocks from the caller side of the -invoke. Kiwi
// tries to handle this by storing the first exception that it would have
// otherwise thrown in a nasty global that callers can look for and handle.
// (Buggy termination is less desirable than global variables).
//
// Obviously, this can only handles cases where Kiwi itself would have raised
// an exception.
#if TARGET_IPHONE_SIMULATOR
#define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1
#endif // #if TARGET_IPHONE_SIMULATOR
|
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
|
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
|
C
|
bsd-3-clause
|
ecaselles/Kiwi,allending/Kiwi,LiuShulong/Kiwi,TaemoonCho/Kiwi,emodeqidao/Kiwi,weslindsay/Kiwi,depop/Kiwi,emodeqidao/Kiwi,unisontech/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,indiegogo/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,ashfurrow/Kiwi,howandhao/Kiwi,iosRookie/Kiwi,hyperoslo/Tusen,emodeqidao/Kiwi,indiegogo/Kiwi,alloy/Kiwi,unisontech/Kiwi,weslindsay/Kiwi,alloy/Kiwi,tcirwin/Kiwi,tangwei6423471/Kiwi,ecaselles/Kiwi,iosRookie/Kiwi,tonyarnold/Kiwi,samkrishna/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,ashfurrow/Kiwi,emodeqidao/Kiwi,depop/Kiwi,ecaselles/Kiwi,JoistApp/Kiwi,tonyarnold/Kiwi,ecaselles/Kiwi,hyperoslo/Tusen,cookov/Kiwi,hyperoslo/Tusen,tangwei6423471/Kiwi,howandhao/Kiwi,LiuShulong/Kiwi,tcirwin/Kiwi,samkrishna/Kiwi,tcirwin/Kiwi,JoistApp/Kiwi,tcirwin/Kiwi,hyperoslo/Tusen,howandhao/Kiwi,cookov/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,allending/Kiwi,carezone/Kiwi,TaemoonCho/Kiwi,depop/Kiwi,depop/Kiwi,unisontech/Kiwi,allending/Kiwi,iosRookie/Kiwi,TaemoonCho/Kiwi,ashfurrow/Kiwi,howandhao/Kiwi,cookov/Kiwi,TaemoonCho/Kiwi,LiuShulong/Kiwi,alloy/Kiwi,unisontech/Kiwi,cookov/Kiwi,weslindsay/Kiwi,iosRookie/Kiwi,tonyarnold/Kiwi,JoistApp/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,weslindsay/Kiwi,PaulTaykalo/Kiwi,PaulTaykalo/Kiwi,carezone/Kiwi,allending/Kiwi,carezone/Kiwi
|
5df03525b7db34b41c9993140e55877a1f0e8fd3
|
test/Driver/avr-mmcu.c
|
test/Driver/avr-mmcu.c
|
// A test for the propagation of the -mmcu option to -cc1 and -cc1as
// RUN: %clang -### -target avr -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s
// CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p"
// CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
|
// A test for the propagation of the -mmcu option to -cc1 and -cc1as
// RUN: %clang -### -target avr -no-canonical-prefixes -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s
// CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p"
// CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
|
Add a missing -no-canonical-prefixes to test.
|
[Driver] Add a missing -no-canonical-prefixes to test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@300873 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
6f92873e8a06ee7d5159d04aac1377c67e2b8c44
|
BIObjCHelpers/Interface/BIObjCHelpers.h
|
BIObjCHelpers/Interface/BIObjCHelpers.h
|
//
// BIObjCHelpers.h
// BIObjCHelpersExample
//
// Created by Bogdan Iusco on 1/19/15.
// Copyright (c) 2015 Bogdan Iusco. All rights reserved.
//
// Starters
#import "BIStarterProtocol.h"
#import "BILifecycle.h"
#import "BIStartersFactory.h"
#import "BIOperationQueue.h"
// Views
#import "BITableView.h"
// Datasources
#import "BIDatasourceTableView.h"
#import "BIDatasourceCollectionView.h"
#import "BIDatasourceFetchedTableView.h"
#import "BIDatasourceFetchedCollectionView.h"
#import "BIDatasourceFeedTableView.h"
#import "BIBatch.h"
// Handlers
#import "BIHandlerBase.h"
#import "BIHandlerTableView.h"
// Categories
#import "NSBundle+BIExtra.h"
#import "NSString+BIExtra.h"
#import "NSDate+BIAttributedString.h"
// Batch
#import "BIBatch.h"
#import "BIBatchRequest.h"
#import "BIBatchResponse.h"
|
//
// BIObjCHelpers.h
// BIObjCHelpersExample
//
// Created by Bogdan Iusco on 1/19/15.
// Copyright (c) 2015 Bogdan Iusco. All rights reserved.
//
// Starters
#import "BIStarterProtocol.h"
#import "BILifecycle.h"
#import "BIStartersFactory.h"
#import "BIOperationQueue.h"
#import "BILaunchStartersFactory.h"
// Views
#import "BITableView.h"
// Datasources
#import "BIDatasourceTableView.h"
#import "BIDatasourceCollectionView.h"
#import "BIDatasourceFetchedTableView.h"
#import "BIDatasourceFetchedCollectionView.h"
#import "BIDatasourceFeedTableView.h"
#import "BIBatch.h"
// Handlers
#import "BIHandlerBase.h"
#import "BIHandlerTableView.h"
// Categories
#import "NSBundle+BIExtra.h"
#import "NSString+BIExtra.h"
#import "NSDate+BIAttributedString.h"
// Batch
#import "BIBatch.h"
#import "BIBatchRequest.h"
#import "BIBatchResponse.h"
|
Add BILaunchStartersFactory to interface file
|
Add BILaunchStartersFactory to interface file
|
C
|
mit
|
grigaci/BIObjCHelpers
|
0e4d41f065f7803d096e6c53b3956c820186c3ea
|
freebsd/util.h
|
freebsd/util.h
|
#include <libutil.h>
#ifndef TAILQ_END
#define TAILQ_END(head) NULL
#endif
|
#include <libutil.h>
#ifndef TAILQ_END
#define TAILQ_END(head) NULL
#endif
#ifndef SIMPLEQ_HEAD
#define SIMPLEQ_HEAD STAILQ_HEAD
#define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER
#define SIMPLEQ_ENTRY STAILQ_ENTRY
#define SIMPLEQ_INIT STAILQ_INIT
#define SIMPLEQ_INSERT_AFTER STAILQ_INSERT_AFTER
#define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
#define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
#define SIMPLEQ_EMPTY STAILQ_EMPTY
#define SIMPLEQ_FIRST STAILQ_FIRST
#define SIMPLEQ_REMOVE_AFTER STAILQ_REMOVE_AFTER
#define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD
#define SIMPLEQ_FOREACH STAILQ_FOREACH
#define SIMPLEQ_END(head) NULL
#endif
|
Add SIMPLEQ->STAILQ macros for freebsd.
|
Add SIMPLEQ->STAILQ macros for freebsd.
|
C
|
isc
|
conformal/spectrwm,conformal/spectrwm,conformal/spectrwm
|
264a4058eb58ba078069f2cc2ff6fa9ae015bc4d
|
src/stack.h
|
src/stack.h
|
#ifndef _STACK_H_
#define _STACK_H_
/*
* data stack for use with automaton infrastructure
*/
#include "dataStackEntry.h"
typedef struct stack Stack;
Stack *stack_create(int size);
void stack_destroy(Stack *st);
void reset(Stack *st);
void push(Stack *st, DataStackEntry d);
DataStackEntry pop(Stack *st);
#endif /* _STACK_H_ */
|
/*
* Copyright (c) 2013, Court of the University of Glasgow
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of the University of Glasgow nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _STACK_H_
#define _STACK_H_
/*
* data stack for use with automaton infrastructure
*/
#include "dataStackEntry.h"
typedef struct stack Stack;
Stack *stack_create(int size);
void stack_destroy(Stack *st);
void reset(Stack *st);
void push(Stack *st, DataStackEntry d);
DataStackEntry pop(Stack *st);
#endif /* _STACK_H_ */
|
Add BSD 3-clause open source header
|
Add BSD 3-clause open source header
|
C
|
bsd-3-clause
|
jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache
|
eee5fc4106b389daeb709112f77b1a2e41ceee30
|
src/sysdeps/tryarc4random_addrandom.c
|
src/sysdeps/tryarc4random_addrandom.c
|
/* ISC license. */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include <stdlib.h>
int main (void)
{
arc4random_addrandom("", 1) ;
return 0 ;
}
|
/* ISC license. */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include <stdlib.h>
int main (void)
{
unsigned char *blah = "" ;
arc4random_addrandom(blah, 1) ;
return 0 ;
}
|
Fix arc4random_addrandom detection for -Werror=pointer-sign
|
Fix arc4random_addrandom detection for -Werror=pointer-sign
|
C
|
isc
|
skarnet/skalibs,skarnet/skalibs
|
b56a4389c1ae7ce29e2221db3339ce7a9ec2ff62
|
test/main.c
|
test/main.c
|
#include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init(argv[1]);
unsigned int i, j;
binarycookies_flag flags;
// Output in Netscape cookies.txt format
for (i = 0; i < bc->num_pages; i++) {
for (j = 0; j < bc->pages[i]->number_of_cookies; j++) {
flags = bc->pages[i]->cookies[j]->flags;
// domain, flag, path, secure, expiration, name, value
printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n",
bc->pages[i]->cookies[j]->url,
bc->pages[i]->cookies[j]->url[0] == '.' ? "TRUE" : "FALSE",
bc->pages[i]->cookies[j]->path,
flags == secure || flags == secure_http_only ? "TRUE" : "FALSE",
bc->pages[i]->cookies[j]->expiration_date,
bc->pages[i]->cookies[j]->name,
bc->pages[i]->cookies[j]->value);
}
}
binarycookies_free(bc);
return 0;
}
|
#include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init(argv[1]);
unsigned int i, j;
// Output in Netscape cookies.txt format
for (i = 0; i < bc->num_pages; i++) {
for (j = 0; j < bc->pages[i]->number_of_cookies; j++) {
// domain, flag, path, secure, expiration, name, value
printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n",
bc->pages[i]->cookies[j]->url,
bc->pages[i]->cookies[j]->url[0] == '.' ? "TRUE" : "FALSE",
bc->pages[i]->cookies[j]->path,
binarycookies_is_secure(bc->pages[i]->cookies[j]) ? "TRUE" : "FALSE",
bc->pages[i]->cookies[j]->expiration_date,
bc->pages[i]->cookies[j]->name,
bc->pages[i]->cookies[j]->value);
}
}
binarycookies_free(bc);
return 0;
}
|
Use macro to check security of cookie
|
Use macro to check security of cookie
|
C
|
mit
|
Tatsh/libbinarycookies,Tatsh/libbinarycookies
|
1f1e880a7ff7fc1dcb3dbba5910ff6e5a65603c6
|
net/proxy/proxy_resolver_mac.h
|
net/proxy/proxy_resolver_mac.h
|
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once
#include <string>
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_resolver.h"
namespace net {
// Implementation of ProxyResolver that uses the Mac CFProxySupport to implement
// proxies.
class ProxyResolverMac : public ProxyResolver {
public:
ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {}
// ProxyResolver methods:
virtual int GetProxyForURL(const GURL& url,
ProxyInfo* results,
CompletionCallback* callback,
RequestHandle* request,
const BoundNetLog& net_log);
virtual void CancelRequest(RequestHandle request) {
NOTREACHED();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
CompletionCallback* /*callback*/) {
script_data_ = script_data_;
return OK;
}
private:
scoped_refptr<ProxyResolverScriptData> script_data_;
};
} // namespace net
#endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
|
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once
#include <string>
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_resolver.h"
namespace net {
// Implementation of ProxyResolver that uses the Mac CFProxySupport to implement
// proxies.
class ProxyResolverMac : public ProxyResolver {
public:
ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {}
// ProxyResolver methods:
virtual int GetProxyForURL(const GURL& url,
ProxyInfo* results,
CompletionCallback* callback,
RequestHandle* request,
const BoundNetLog& net_log);
virtual void CancelRequest(RequestHandle request) {
NOTREACHED();
}
virtual int SetPacScript(
const scoped_refptr<ProxyResolverScriptData>& script_data,
CompletionCallback* /*callback*/) {
script_data_ = script_data;
return OK;
}
private:
scoped_refptr<ProxyResolverScriptData> script_data_;
};
} // namespace net
#endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
|
Fix a typo, that could cause a crash on mac.
|
Fix a typo, that could cause a crash on mac.
BUG=50717
TBR=rvargas
TEST=Set system proxy settings to use a custom PAC script, then launch TestShell.app -- should not crash.
Review URL: http://codereview.chromium.org/3023030
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@54279 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
|
C
|
bsd-3-clause
|
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
|
6f608d521539a6c6d492185c964853021ba4a5a3
|
lib/assembly.h
|
lib/assembly.h
|
/* ===-- assembly.h - compiler-rt assembler support macros -----------------===
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file defines macros for use in compiler-rt assembler source.
* This file is not part of the interface of this library.
*
* ===----------------------------------------------------------------------===
*/
#ifndef COMPILERRT_ASSEMBLY_H
#define COMPILERRT_ASSEMBLY_H
// Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use
// USER_LABEL_PREFIX directly because of cpp brokenness.
#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
#define SYMBOL_NAME(name) name
#define SEPARATOR @
#else
#define SYMBOL_NAME(name) _##name
#define SEPARATOR ;
#endif
#define DEFINE_COMPILERRT_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
.private_extern SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#endif /* COMPILERRT_ASSEMBLY_H */
|
/* ===-- assembly.h - compiler-rt assembler support macros -----------------===
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file defines macros for use in compiler-rt assembler source.
* This file is not part of the interface of this library.
*
* ===----------------------------------------------------------------------===
*/
#ifndef COMPILERRT_ASSEMBLY_H
#define COMPILERRT_ASSEMBLY_H
// Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use
// USER_LABEL_PREFIX directly because of cpp brokenness.
#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
#define SYMBOL_NAME(name) name
#define SEPARATOR @
#else
#define SYMBOL_NAME(name) #__USER_LABEL_PREFIX__ ##name
#define SEPARATOR ;
#endif
#define DEFINE_COMPILERRT_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
.private_extern SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#endif /* COMPILERRT_ASSEMBLY_H */
|
Use __USER_LABEL_PREFIX__ so that we don't add a _ prefix on ELF.
|
Use __USER_LABEL_PREFIX__ so that we don't add a _ prefix on ELF.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@86542 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
|
c1c9990cbac5231efe8989ab34909ef948fb73cd
|
cpp/include/phevaluator/card.h
|
cpp/include/phevaluator/card.h
|
#ifndef PHEVALUATOR_CARD_H
#define PHEVALUATOR_CARD_H
#ifdef __cplusplus
#include <unordered_map>
#include <string>
namespace phevaluator {
class Card {
public:
Card() {}
Card(int id) : id_(id) {}
Card(std::string name) {
const std::unordered_map<char, int> rankMap = {
{'2', 0}, {'3', 1}, {'4', 2}, {'5', 3},
{'6', 4}, {'7', 5}, {'8', 6}, {'9', 7},
{'T', 8}, {'J', 9}, {'Q', 10}, {'K', 11}, {'A', 12},
};
const std::unordered_map<char, int> suitMap = {
{'C', 0}, {'D', 1}, {'H', 2}, {'S', 3},
{'c', 0}, {'d', 1}, {'h', 2}, {'s', 3},
};
if (name.length() < 2) {
// TODO: throw an exception here
}
id_ = rankMap.at(name[0]) * 4 + suitMap.at(name[1]);
}
operator int() const { return id_; }
private:
int id_;
};
} // namespace phevaluator
#endif // __cplusplus
#endif // PHEVALUATOR_CARD_H
|
#ifndef PHEVALUATOR_CARD_H
#define PHEVALUATOR_CARD_H
#ifdef __cplusplus
#include <unordered_map>
#include <string>
namespace phevaluator {
class Card {
public:
Card() {}
Card(int id) : id_(id) {}
Card(std::string name) {
const std::unordered_map<char, int> rankMap = {
{'2', 0}, {'3', 1}, {'4', 2}, {'5', 3},
{'6', 4}, {'7', 5}, {'8', 6}, {'9', 7},
{'T', 8}, {'J', 9}, {'Q', 10}, {'K', 11}, {'A', 12},
};
const std::unordered_map<char, int> suitMap = {
{'C', 0}, {'D', 1}, {'H', 2}, {'S', 3},
{'c', 0}, {'d', 1}, {'h', 2}, {'s', 3},
};
if (name.length() < 2) {
// TODO: throw an exception here
}
id_ = rankMap.at(name[0]) * 4 + suitMap.at(name[1]);
}
Card(const char name[]) : Card(std::string(name)) {}
operator int() const { return id_; }
private:
int id_;
};
} // namespace phevaluator
#endif // __cplusplus
#endif // PHEVALUATOR_CARD_H
|
Add parameter type `const char []` to the Card constructor
|
Add parameter type `const char []` to the Card constructor
|
C
|
apache-2.0
|
HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator
|
c13fa6ae63ef93364adc41d332eaa249f3585ec6
|
lib/bytestream.h
|
lib/bytestream.h
|
#ifndef __BYTESTREAM__
#define __BYTESTREAM__
#include <stdint.h>
#include <unistd.h>
#define BS_RO 0
#define BS_RW 1
typedef struct _ByteStream {
char* filename;
size_t size;
uint8_t* data;
uint32_t offset;
int exhausted;
} ByteStream;
ByteStream* bsalloc(unsigned int size);
ByteStream* bsmap(char* filename);
int bsfree(ByteStream* bstream);
void bsseek(ByteStream* bs, uint32_t offset);
void bsreset(ByteStream* bs);
unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size);
unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size,
uint32_t offset);
int bswrite(ByteStream* bs, uint8_t* data, unsigned int size);
unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size,
uint32_t offset);
int bssave(ByteStream* bs, char* filename);
#endif
|
#ifndef __BYTESTREAM__
#define __BYTESTREAM__
#include <stdint.h>
#include <unistd.h>
#define BS_RO 0
#define BS_RW 1
// MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
typedef struct _ByteStream {
char* filename;
size_t size;
uint8_t* data;
uint32_t offset;
int exhausted;
} ByteStream;
ByteStream* bsalloc(unsigned int size);
ByteStream* bsmap(char* filename);
int bsfree(ByteStream* bstream);
void bsseek(ByteStream* bs, uint32_t offset);
void bsreset(ByteStream* bs);
unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size);
unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size,
uint32_t offset);
int bswrite(ByteStream* bs, uint8_t* data, unsigned int size);
unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size,
uint32_t offset);
int bssave(ByteStream* bs, char* filename);
#endif
|
Fix compilation on OSX MAP_ANONYMOUS is MAP_ANON on OSX, so this will let the project compile.
|
Fix compilation on OSX
MAP_ANONYMOUS is MAP_ANON on OSX, so this
will let the project compile.
|
C
|
bsd-3-clause
|
strazzere/dexterity,rchiossi/dexterity,rchiossi/dexterity,rchiossi/dexterity,strazzere/dexterity,strazzere/dexterity
|
766a76e551d945fc2513a7c2968544a19c810d96
|
common/bpf/lib/dbg.h
|
common/bpf/lib/dbg.h
|
#ifndef __LIB_DBG__
#define __LIB_DBG__
#define DEBUG
#ifdef DEBUG
# define printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
#else
# define printk(fmt, ...) \
do { } while (0)
#endif
#endif /* __LIB_DBG__ */
|
#ifndef __LIB_DBG__
#define __LIB_DBG__
#ifdef DEBUG
# define printk(fmt, ...) \
({ \
char ____fmt[] = fmt; \
trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \
})
#else
# define printk(fmt, ...) \
do { } while (0)
#endif
#endif /* __LIB_DBG__ */
|
Remove DEBUG for performance testing.
|
Remove DEBUG for performance testing.
|
C
|
apache-2.0
|
gumpt/cilium,mskarbek/cilium,scanf/cilium,tgraf/cilium,scanf/cilium,cilium/cilium,gumpt/cilium,ivar-lazzaro/cilium,michi-covalent/cilium,michi-covalent/cilium,michi-covalent/cilium,ivar-lazzaro/cilium,scanf/cilium,michi-covalent/cilium,tklauser/cilium,mskarbek/cilium,gumpt/cilium,scanf/cilium,ivar-lazzaro/cilium,mskarbek/cilium,cilium/cilium,tgraf/cilium,ivar-lazzaro/cilium,eloycoto/cilium,eloycoto/cilium,tgraf/cilium,gumpt/cilium,scanf/cilium,eloycoto/cilium,ivar-lazzaro/cilium,tklauser/cilium,tgraf/cilium,mskarbek/cilium,eloycoto/cilium,mskarbek/cilium,gumpt/cilium,scanf/cilium,scanf/cilium,gumpt/cilium,tgraf/cilium,eloycoto/cilium,ivar-lazzaro/cilium,eloycoto/cilium,tklauser/cilium,eloycoto/cilium,cilium/cilium,cilium-team/cilium,tklauser/cilium,mskarbek/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,cilium-team/cilium,cilium/cilium,tgraf/cilium,gumpt/cilium
|
399869422abf30a0f635596263fd315ea9bde266
|
Kiwi/KiwiConfiguration.h
|
Kiwi/KiwiConfiguration.h
|
//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#if defined(__BLOCKS__)
#define KW_BLOCKS_ENABLED 1
#endif // #if defined(__BLOCKS__)
// As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or
// forwardInvocation: boundary in the simulator will terminate the app instead
// of being caught in @catch blocks from the caller side of the -invoke. Kiwi
// tries to handle this by storing the first exception that it would have
// otherwise thrown in a nasty global that callers can look for and handle.
// (Buggy termination is less desirable than global variables).
//
// Obviously, this can only handles cases where Kiwi itself would have raised
// an exception.
#if TARGET_IPHONE_SIMULATOR
#define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1
#endif // #if TARGET_IPHONE_SIMULATOR
|
//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#if defined(__BLOCKS__)
#ifndef KW_BLOCKS_ENABLED
#define KW_BLOCKS_ENABLED 1
#endif // #ifndef KW_BLOCKS_ENABLED
#endif // #if defined(__BLOCKS__)
// As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or
// forwardInvocation: boundary in the simulator will terminate the app instead
// of being caught in @catch blocks from the caller side of the -invoke. Kiwi
// tries to handle this by storing the first exception that it would have
// otherwise thrown in a nasty global that callers can look for and handle.
// (Buggy termination is less desirable than global variables).
//
// Obviously, this can only handles cases where Kiwi itself would have raised
// an exception.
#if TARGET_IPHONE_SIMULATOR
#define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1
#endif // #if TARGET_IPHONE_SIMULATOR
|
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
|
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
|
C
|
bsd-3-clause
|
LiuShulong/Kiwi,samkrishna/Kiwi,carezone/Kiwi,howandhao/Kiwi,ecaselles/Kiwi,allending/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,JoistApp/Kiwi,samkrishna/Kiwi,indiegogo/Kiwi,carezone/Kiwi,LiuShulong/Kiwi,unisontech/Kiwi,ashfurrow/Kiwi,weslindsay/Kiwi,iosRookie/Kiwi,depop/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,ashfurrow/Kiwi,cookov/Kiwi,tangwei6423471/Kiwi,ecaselles/Kiwi,allending/Kiwi,weslindsay/Kiwi,emodeqidao/Kiwi,alloy/Kiwi,weslindsay/Kiwi,tangwei6423471/Kiwi,PaulTaykalo/Kiwi,PaulTaykalo/Kiwi,TaemoonCho/Kiwi,TaemoonCho/Kiwi,tcirwin/Kiwi,emodeqidao/Kiwi,tangwei6423471/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,depop/Kiwi,iosRookie/Kiwi,unisontech/Kiwi,hyperoslo/Tusen,cookov/Kiwi,indiegogo/Kiwi,weslindsay/Kiwi,cookov/Kiwi,cookov/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,unisontech/Kiwi,depop/Kiwi,allending/Kiwi,JoistApp/Kiwi,hyperoslo/Tusen,samkrishna/Kiwi,samkrishna/Kiwi,ashfurrow/Kiwi,alloy/Kiwi,iosRookie/Kiwi,ecaselles/Kiwi,howandhao/Kiwi,unisontech/Kiwi,emodeqidao/Kiwi,iosRookie/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,alloy/Kiwi,emodeqidao/Kiwi,hyperoslo/Tusen,indiegogo/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,tcirwin/Kiwi,tonyarnold/Kiwi,tcirwin/Kiwi,tangwei6423471/Kiwi,allending/Kiwi,ecaselles/Kiwi,PaulTaykalo/Kiwi,tcirwin/Kiwi,depop/Kiwi,tonyarnold/Kiwi,hyperoslo/Tusen
|
d2283df39723e542416a1fcb4fd292780fe690f5
|
src/qt4compat.h
|
src/qt4compat.h
|
#ifndef QT4COMPAT_H
#define QT4COMPAT_H
#include <QtCore/QtGlobal>
#ifndef Q_LIKELY
# define Q_LIKELY(s) s
#endif
#ifndef Q_UNLIKELY
# define Q_UNLIKELY(s) s
#endif
#ifndef Q_UNREACHABLE
# define Q_UNREACHABLE() Q_ASSERT(false)
#endif
#ifndef Q_ASSUME
# define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); }
#endif
#endif // QT4COMPAT_H
|
#ifndef QT4COMPAT_H
#define QT4COMPAT_H
#include <QtCore/QtGlobal>
#if !defined(Q_UNREACHABLE) && !defined(Q_ASSUME)
# if defined(Q_CC_INTEL) || defined(Q_CC_MSVC)
# define Q_UNREACHABLE() __assume(0)
# define Q_ASSUME(s) __assume(s)
# elif defined(Q_CC_CLANG)
# define Q_UNREACHABLE() __builtin_unreachable()
# elif defined(Q_CC_GNU) && defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
# define Q_UNREACHABLE() __builtin_unreachable()
# endif
#endif
#if !defined(Q_LIKELY) && !defined(Q_UNLIKELY)
# ifdef __GNUC__
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
# endif
#endif
#ifndef Q_LIKELY
# define Q_LIKELY(s) s
#endif
#ifndef Q_UNLIKELY
# define Q_UNLIKELY(s) s
#endif
#ifndef Q_UNREACHABLE
# define Q_UNREACHABLE() Q_ASSERT(false)
#endif
#ifndef Q_ASSUME
# define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); }
#endif
#endif // QT4COMPAT_H
|
Use compiler detection for Q_LIKELY, Q_UNLIKELY, Q_ASSUME, Q_UNREACHABLE
|
Use compiler detection for Q_LIKELY, Q_UNLIKELY, Q_ASSUME, Q_UNREACHABLE [ci skip]
|
C
|
mit
|
sjinks/qt_eventdispatcher_epoll,sjinks/qt_eventdispatcher_epoll
|
6f55e50c181265bae4615173f62f806db75bc33f
|
src/streampos.h
|
src/streampos.h
|
#ifndef ICAL_STREAMPOS_H
#define ICAL_STREAMPOS_H
namespace ical {
/**
* Represents a postion in the (source) stream. It is used for constructing
* nice error messages.
*
* Note: only CRLF ("\r\n") is considered as a line ending in order to match
* the definition of 'content line' from RFC 5545.
*/
class StreamPos
{
private:
unsigned long column = 0;
unsigned long line = 0;
public:
unsigned long getLine() const { return line; }
unsigned long getColumn() const { return column; }
StreamPos() { }
void advanceColumn()
{
++column;
}
void advanceLine()
{
column = 0;
++line;
}
};
} // namespace ical
#endif // ICAL_STREAMPOS_H
|
#ifndef ICAL_STREAMPOS_H
#define ICAL_STREAMPOS_H
namespace ical {
/**
* Represents a postion in the (source) stream. It is used for constructing
* nice error messages.
*
* Note: only CRLF ("\r\n") is considered as a line ending in order to match
* the definition of 'content line' from RFC 5545.
*/
class StreamPos
{
private:
unsigned long column = 0;
unsigned long line = 0;
public:
unsigned long getLine() const { return line + 1; }
unsigned long getColumn() const { return column + 1; }
StreamPos() { }
void advanceColumn()
{
++column;
}
void advanceLine()
{
column = 0;
++line;
}
};
} // namespace ical
#endif // ICAL_STREAMPOS_H
|
Return one-based line/column numbers from StreamPos.
|
Return one-based line/column numbers from StreamPos.
(Because obviously people expect "Line 1" to mean the first line...)
|
C
|
mit
|
LuboO/iCalendar-parser_PA193_Rteam
|
e4953de7dde3021a682d99e05b2784177ebebc93
|
include/icmpv4.h
|
include/icmpv4.h
|
#ifndef ICMPV4_H
#define ICMPV4_H
#include "syshead.h"
#include "netdev.h"
#define ICMP_V4_REPLY 0x00
#define ICMP_V4_DST_UNREACHABLE 0x03
#define ICMP_V4_SRC_QUENCH 0x04
#define ICMP_V4_REDIRECT 0x05
#define ICMP_V4_ECHO 0x08
#define ICMP_V4_ROUTER_ADV 0x09
#define ICMP_V4_ROUTER_SOL 0x0a
#define ICMP_V4_TIMEOUT 0x0b
#define ICMP_V4_MALFORMED 0x0c
struct icmp_v4 {
uint8_t type;
uint8_t code;
uint16_t csum;
uint8_t data[];
} __attribute__((packed));
struct icmp_v4_echo {
uint16_t id;
uint16_t seq;
uint8_t data[];
} __attribute__((packed));
void icmpv4_incoming(struct netdev *netdev, struct eth_hdr *hdr);
void icmpv4_reply(struct netdev *netdev, struct eth_hdr *hdr);
#endif
|
#ifndef ICMPV4_H
#define ICMPV4_H
#include "syshead.h"
#include "netdev.h"
#define ICMP_V4_REPLY 0x00
#define ICMP_V4_DST_UNREACHABLE 0x03
#define ICMP_V4_SRC_QUENCH 0x04
#define ICMP_V4_REDIRECT 0x05
#define ICMP_V4_ECHO 0x08
#define ICMP_V4_ROUTER_ADV 0x09
#define ICMP_V4_ROUTER_SOL 0x0a
#define ICMP_V4_TIMEOUT 0x0b
#define ICMP_V4_MALFORMED 0x0c
struct icmp_v4 {
uint8_t type;
uint8_t code;
uint16_t csum;
uint8_t data[];
} __attribute__((packed));
struct icmp_v4_echo {
uint16_t id;
uint16_t seq;
uint8_t data[];
} __attribute__((packed));
struct icmp_v4_dst_unreachable {
uint8_t unused;
uint8_t len;
uint16_t var;
uint8_t data[];
} __attribute__((packed));
void icmpv4_incoming(struct netdev *netdev, struct eth_hdr *hdr);
void icmpv4_reply(struct netdev *netdev, struct eth_hdr *hdr);
#endif
|
Add ICMPv4 dst unreachable -message definition
|
Add ICMPv4 dst unreachable -message definition
Yeah, this might end up being unimplemented :-(
|
C
|
mit
|
saminiir/level-ip,saminiir/level-ip
|
fc1d23276088fe389f4e804da1b8f071ee3b00f9
|
src/tool/hpcrun/utilities/arch/aarch64/specific-inline-asm-gctxt.h
|
src/tool/hpcrun/utilities/arch/aarch64/specific-inline-asm-gctxt.h
|
#ifndef SPECIFIC_INLINE_ASM_GCTXT
#define SPECIFIC_INLINE_ASM_GCTXT
#endif
|
#ifndef SPECIFIC_INLINE_ASM_GCTXT
#define SPECIFIC_INLINE_ASM_GCTXT
#define INLINE_ASM_GCTXT(uc) getcontext(&uc)
#endif
|
Define the INLINE_ASM_GCTXT() macro for aarch64. This was breaking the MEMLEAK source on arm.
|
Define the INLINE_ASM_GCTXT() macro for aarch64.
This was breaking the MEMLEAK source on arm.
|
C
|
bsd-3-clause
|
HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit
|
0cad538ae17f8e05375d1edf1d9f49bb4049e39b
|
test/Preprocessor/header_lookup1.c
|
test/Preprocessor/header_lookup1.c
|
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4'
#include <stddef.h>
|
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3'
#include <stddef.h>
|
Change this test to reflect the state we are moving in. The Clang builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point, and Clang's own builtin headers can simply be changed if there is any issue with this. Clang should be free to include these however it wants, and so shorter and simpler is better.
|
Change this test to reflect the state we are moving in. The Clang
builtin headers are no longer going to receive the old 'implicit extern
"C" block' semantics. This hint is actually ignored by both Clang and
GCC at this point, and Clang's own builtin headers can simply be changed
if there is any issue with this. Clang should be free to include these
however it wants, and so shorter and simpler is better.
Note: *nothing* is changing about the *system* stddef.h include. That
should always have the exact same include semantics, whether with Clang
or GCC or any other compiler. Only the compiler-builtin header search
path is changing.
If anyone knows of some risk that this introduces that I've not thought
of, please chime in. So far, only Windows has switched to the Brave New
World, but others should be switching soon.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143806 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
|
ccdd7bb8566b2fd1da5c4b5c8eaa2db43a69e720
|
testsuite/libffi.go/static-chain.h
|
testsuite/libffi.go/static-chain.h
|
#ifdef __aarch64__
# define STATIC_CHAIN_REG "x18"
#elif defined(__alpha__)
# define STATIC_CHAIN_REG "r1"
#elif defined(__arm__)
# define STATIC_CHAIN_REG "ip"
#elif defined(__sparc__)
# if defined(__arch64__) || defined(__sparcv9)
# define STATIC_CHAIN_REG "g5"
# else
# define STATIC_CHAIN_REG "g2"
# endif
#elif defined(__x86_64__)
# define STATIC_CHAIN_REG "r10"
#elif defined(__i386__)
# ifndef ABI_NUM
# define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */
# endif
#endif
|
#ifdef __aarch64__
# define STATIC_CHAIN_REG "x18"
#elif defined(__alpha__)
# define STATIC_CHAIN_REG "$1"
#elif defined(__arm__)
# define STATIC_CHAIN_REG "ip"
#elif defined(__sparc__)
# if defined(__arch64__) || defined(__sparcv9)
# define STATIC_CHAIN_REG "g5"
# else
# define STATIC_CHAIN_REG "g2"
# endif
#elif defined(__x86_64__)
# define STATIC_CHAIN_REG "r10"
#elif defined(__i386__)
# ifndef ABI_NUM
# define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */
# endif
#endif
|
Fix alpha static chain register name
|
testsuite: Fix alpha static chain register name
|
C
|
mit
|
biosbits/libffi,Distrotech/libffi,Distrotech/libffi,joshtriplett/libffi,Pan7/libffi,Pan7/libffi,biosbits/libffi,s1341/libffi,bgarrels/libffi,joshtriplett/libffi,nmav/libffi,rth7680/libffi,joshtriplett/libffi,rth7680/libffi,plicease/libffi,Pan7/libffi,bgarrels/libffi,s1341/libffi,nmav/libffi,biosbits/libffi,joshtriplett/libffi,nmav/libffi,Pan7/libffi,plicease/libffi,bgarrels/libffi,nmav/libffi,rth7680/libffi,Distrotech/libffi,s1341/libffi,plicease/libffi,bgarrels/libffi,s1341/libffi,Distrotech/libffi,plicease/libffi,rth7680/libffi,biosbits/libffi
|
d4bca385d8d7e068e7d2075131bf14e5bb417692
|
src/autowiring/stdafx.h
|
src/autowiring/stdafx.h
|
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#pragma once
// Internal build flag for namespace discrimination
#define AUTOWIRING_IS_BEING_BUILT
// Only include these headers in cases where a pch can be generated
// Currently this is only supported on MSVC
#ifdef _MSC_VER
#include <thread>
#ifndef NOMINMAX
#define NOMINMAX
#endif
#endif
#ifndef _MSC_VER
#include <stdlib.h>
#endif
// Preconfiguration:
#include "AutowiringConfig.h"
// C++11 glue logic, for platforms that have incomplete C++11 support
#include "C++11/cpp11.h"
|
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#pragma once
// Internal build flag for namespace discrimination
#define AUTOWIRING_IS_BEING_BUILT
// Only include these headers in cases where a pch can be generated
// Currently this is only supported on MSVC
#ifdef _MSC_VER
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <algorithm>
#include <functional>
#include <future>
#include <iosfwd>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#endif
#ifndef _MSC_VER
#include <stdlib.h>
#endif
// Preconfiguration:
#include "AutowiringConfig.h"
// C++11 glue logic, for platforms that have incomplete C++11 support
#include "C++11/cpp11.h"
|
Make better use of precompiled header
|
Make better use of precompiled header
These headers are used pretty much everywhere in autowiring. New compile time is 50% of what it was on MSVC.
Before: 33.87s
After: 17.77s
|
C
|
apache-2.0
|
leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring,leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring,codemercenary/autowiring,codemercenary/autowiring,codemercenary/autowiring,leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring
|
8a89ea553494c0ca429a57f792a097adb1f25ce2
|
Sources/ObjectiveChain.h
|
Sources/ObjectiveChain.h
|
//
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
|
//
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
#import "OCAConnection.h"
#import "OCAProducer.h"
|
Add first classes to umbrella header
|
Add first classes to umbrella header
|
C
|
mit
|
Tricertops/Objective-Chain,iMartinKiss/Objective-Chain
|
97d3b3cf2a7b220c34f7b467129fe9de8558e2be
|
utils/metatag.c
|
utils/metatag.c
|
/* metatag.c: Program for adding metadata to a file
* By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap,
* Connie Yu
*
* 2014/06/06
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv){
char* buffer;
int fd, i, len;
if(argc < 3){
fprintf(stderr, "Usage: metatag FILE TAG\n");
exit(1);
}
fd=open(argv[1], O_RDWR);
if(fd == -1){
fprintf(stderr, "Error, file not found\n");
exit(1);
}
buffer = "";
for(i=2; i<argc; i++){
strcat(buffer, argv[i]);
strcat(buffer, " ");
}
len = strlen(buffer);
metawrite(fd,&buffer,len);
close(fd);
return 0;
}
|
/* metatag.c: Program for adding metadata to a file
* By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap,
* Connie Yu
*
* 2014/06/06
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN 1024
int main(int argc, char** argv){
char* buffer;
int fd, i, len;
if(argc < 3){
fprintf(stderr, "Usage: metatag FILE TAG\n");
exit(1);
}
fd=open(argv[1], O_RDWR);
if(fd == -1){
fprintf(stderr, "Error, file not found\n");
exit(1);
}
buffer = "";
for(i=2; i<argc; i++){
strcat(buffer, argv[i]);
strcat(buffer, " ");
}
len = strlen(buffer);
if(len > MAX_LEN-1){
fprintf(stderr, "Input stream exceeds max length\n");
exit(1);
}
metawrite(fd,&buffer,len);
close(fd);
return 0;
}
|
Add max length error check
|
Add max length error check
|
C
|
mit
|
dmtaylor/cmps111-proj4,dmtaylor/cmps111-proj4
|
b8b9c29202e0ab25889fc745d3e5f7f99c3e9624
|
regs_amd64.h
|
regs_amd64.h
|
// Offset of each register in the register map,
// as it's saved by asm_entry_amd64.s
#pragma once
#define RAX 0x00
#define RBX 0x08
#define RCX 0x10
#define RDX 0x18
#define RSI 0x20
#define RDI 0x28
#define R8 0x30
#define R9 0x38
#define R10 0x40
#define R11 0x48
#define R12 0x50
#define R13 0x58
#define R14 0x60
#define R15 0x68
#define XMM0 0x70
#define XMM1 0x80
#define XMM2 0x90
#define XMM3 0xA0
#define XMM4 0xB0
#define XMM5 0xC0
#define XMM6 0xE0
#define XMM7 0xF0
|
// Offset of each register in the register map,
// as it's saved by asm_entry_amd64.s
#pragma once
#define RAX 0x00
#define RBX 0x08
#define RCX 0x10
#define RDX 0x18
#define RSI 0x20
#define RDI 0x28
#define R8 0x30
#define R9 0x38
#define R10 0x40
#define R11 0x48
#define R12 0x50
#define R13 0x58
#define R14 0x60
#define R15 0x68
#define XMM0 0x70
#define XMM1 0x80
#define XMM2 0x90
#define XMM3 0xA0
#define XMM4 0xB0
#define XMM5 0xC0
#define XMM6 0xD0
#define XMM7 0xE0
|
Fix one more register addressing bug
|
Fix one more register addressing bug
|
C
|
mit
|
yamnikov-oleg/cgo-callback,yamnikov-oleg/cgo-callback
|
605871452bcb4c742ed960c09d518be03b349cf3
|
base/inc/TVersionCheck.h
|
base/inc/TVersionCheck.h
|
// @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.2 2007/05/10 16:04:32 rdm Exp $
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_RVersion
#include "RVersion.h"
#endif
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
#endif
|
// @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.3 2007/05/10 18:16:58 rdm Exp $
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_RVersion
#include "RVersion.h"
#endif
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
#ifndef __CINT__
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
#endif
#endif
|
Hide a static function to CINT. With this fix g4root compiles OK.
|
Hide a static function to CINT. With this fix g4root compiles OK.
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@18737 27541ba8-7e3a-0410-8455-c3a389f83636
|
C
|
lgpl-2.1
|
simonpf/root,jrtomps/root,tc3t/qoot,vukasinmilosevic/root,mkret2/root,0x0all/ROOT,root-mirror/root,root-mirror/root,Dr15Jones/root,omazapa/root-old,esakellari/root,mhuwiler/rootauto,esakellari/my_root_for_test,nilqed/root,mkret2/root,cxx-hep/root-cern,olifre/root,lgiommi/root,satyarth934/root,gbitzes/root,davidlt/root,karies/root,Duraznos/root,perovic/root,dfunke/root,davidlt/root,bbockelm/root,Duraznos/root,beniz/root,mattkretz/root,CristinaCristescu/root,abhinavmoudgil95/root,beniz/root,gbitzes/root,sawenzel/root,0x0all/ROOT,olifre/root,lgiommi/root,lgiommi/root,abhinavmoudgil95/root,lgiommi/root,nilqed/root,zzxuanyuan/root,zzxuanyuan/root,sirinath/root,zzxuanyuan/root,Y--/root,alexschlueter/cern-root,esakellari/root,buuck/root,perovic/root,arch1tect0r/root,kirbyherm/root-r-tools,mhuwiler/rootauto,strykejern/TTreeReader,karies/root,ffurano/root5,esakellari/root,omazapa/root,georgtroska/root,bbockelm/root,simonpf/root,cxx-hep/root-cern,sbinet/cxx-root,pspe/root,dfunke/root,root-mirror/root,bbockelm/root,sbinet/cxx-root,zzxuanyuan/root,agarciamontoro/root,BerserkerTroll/root,gganis/root,root-mirror/root,omazapa/root-old,ffurano/root5,root-mirror/root,0x0all/ROOT,beniz/root,zzxuanyuan/root,gbitzes/root,arch1tect0r/root,vukasinmilosevic/root,arch1tect0r/root,gganis/root,pspe/root,esakellari/my_root_for_test,sirinath/root,lgiommi/root,alexschlueter/cern-root,Y--/root,Duraznos/root,zzxuanyuan/root-compressor-dummy,mkret2/root,vukasinmilosevic/root,krafczyk/root,evgeny-boger/root,karies/root,smarinac/root,gganis/root,alexschlueter/cern-root,CristinaCristescu/root,Y--/root,dfunke/root,sawenzel/root,georgtroska/root,agarciamontoro/root,pspe/root,omazapa/root,agarciamontoro/root,abhinavmoudgil95/root,olifre/root,olifre/root,lgiommi/root,georgtroska/root,strykejern/TTreeReader,pspe/root,mattkretz/root,evgeny-boger/root,root-mirror/root,veprbl/root,Dr15Jones/root,omazapa/root-old,smarinac/root,sawenzel/root,mhuwiler/rootauto,Duraznos/root,gganis/root,gganis/root,lgiommi/root,CristinaCristescu/root,BerserkerTroll/root,simonpf/root,davidlt/root,nilqed/root,georgtroska/root,root-mirror/root,evgeny-boger/root,sawenzel/root,cxx-hep/root-cern,mattkretz/root,zzxuanyuan/root-compressor-dummy,olifre/root,thomaskeck/root,esakellari/root,mattkretz/root,karies/root,omazapa/root,omazapa/root-old,mattkretz/root,BerserkerTroll/root,pspe/root,bbockelm/root,simonpf/root,sirinath/root,davidlt/root,zzxuanyuan/root-compressor-dummy,alexschlueter/cern-root,Duraznos/root,agarciamontoro/root,mattkretz/root,abhinavmoudgil95/root,BerserkerTroll/root,karies/root,mkret2/root,vukasinmilosevic/root,gbitzes/root,buuck/root,kirbyherm/root-r-tools,CristinaCristescu/root,veprbl/root,krafczyk/root,sbinet/cxx-root,bbockelm/root,thomaskeck/root,BerserkerTroll/root,karies/root,esakellari/my_root_for_test,Dr15Jones/root,kirbyherm/root-r-tools,esakellari/root,abhinavmoudgil95/root,gbitzes/root,smarinac/root,sawenzel/root,Y--/root,lgiommi/root,omazapa/root,Y--/root,pspe/root,gbitzes/root,jrtomps/root,dfunke/root,sawenzel/root,cxx-hep/root-cern,olifre/root,mkret2/root,gbitzes/root,sirinath/root,esakellari/my_root_for_test,georgtroska/root,cxx-hep/root-cern,0x0all/ROOT,kirbyherm/root-r-tools,strykejern/TTreeReader,beniz/root,veprbl/root,Dr15Jones/root,perovic/root,mhuwiler/rootauto,sbinet/cxx-root,davidlt/root,evgeny-boger/root,esakellari/root,agarciamontoro/root,buuck/root,zzxuanyuan/root,satyarth934/root,pspe/root,zzxuanyuan/root,krafczyk/root,georgtroska/root,veprbl/root,abhinavmoudgil95/root,karies/root,georgtroska/root,satyarth934/root,buuck/root,thomaskeck/root,arch1tect0r/root,perovic/root,esakellari/my_root_for_test,dfunke/root,Duraznos/root,ffurano/root5,root-mirror/root,ffurano/root5,mattkretz/root,mattkretz/root,evgeny-boger/root,sirinath/root,mhuwiler/rootauto,gbitzes/root,arch1tect0r/root,Duraznos/root,thomaskeck/root,root-mirror/root,gganis/root,esakellari/root,abhinavmoudgil95/root,pspe/root,olifre/root,beniz/root,lgiommi/root,sirinath/root,BerserkerTroll/root,smarinac/root,smarinac/root,gganis/root,georgtroska/root,zzxuanyuan/root,agarciamontoro/root,olifre/root,dfunke/root,strykejern/TTreeReader,0x0all/ROOT,zzxuanyuan/root,bbockelm/root,satyarth934/root,krafczyk/root,0x0all/ROOT,mhuwiler/rootauto,mhuwiler/rootauto,sbinet/cxx-root,kirbyherm/root-r-tools,gbitzes/root,tc3t/qoot,mhuwiler/rootauto,Y--/root,alexschlueter/cern-root,sawenzel/root,esakellari/my_root_for_test,vukasinmilosevic/root,beniz/root,karies/root,georgtroska/root,nilqed/root,bbockelm/root,olifre/root,smarinac/root,zzxuanyuan/root-compressor-dummy,evgeny-boger/root,Y--/root,sirinath/root,simonpf/root,abhinavmoudgil95/root,beniz/root,vukasinmilosevic/root,krafczyk/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,veprbl/root,veprbl/root,buuck/root,alexschlueter/cern-root,esakellari/my_root_for_test,perovic/root,dfunke/root,veprbl/root,root-mirror/root,olifre/root,mkret2/root,omazapa/root,abhinavmoudgil95/root,mattkretz/root,sbinet/cxx-root,CristinaCristescu/root,karies/root,agarciamontoro/root,dfunke/root,root-mirror/root,mattkretz/root,bbockelm/root,buuck/root,sbinet/cxx-root,karies/root,beniz/root,lgiommi/root,CristinaCristescu/root,mkret2/root,buuck/root,dfunke/root,smarinac/root,tc3t/qoot,gganis/root,beniz/root,lgiommi/root,omazapa/root,CristinaCristescu/root,gganis/root,zzxuanyuan/root,esakellari/my_root_for_test,sawenzel/root,nilqed/root,georgtroska/root,mhuwiler/rootauto,CristinaCristescu/root,perovic/root,Dr15Jones/root,BerserkerTroll/root,zzxuanyuan/root,kirbyherm/root-r-tools,mattkretz/root,veprbl/root,Y--/root,olifre/root,mkret2/root,satyarth934/root,zzxuanyuan/root-compressor-dummy,nilqed/root,davidlt/root,simonpf/root,krafczyk/root,esakellari/my_root_for_test,sirinath/root,Duraznos/root,beniz/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,smarinac/root,cxx-hep/root-cern,veprbl/root,esakellari/root,thomaskeck/root,simonpf/root,strykejern/TTreeReader,omazapa/root,davidlt/root,agarciamontoro/root,simonpf/root,krafczyk/root,zzxuanyuan/root,perovic/root,BerserkerTroll/root,jrtomps/root,Dr15Jones/root,thomaskeck/root,bbockelm/root,CristinaCristescu/root,pspe/root,nilqed/root,zzxuanyuan/root-compressor-dummy,davidlt/root,sbinet/cxx-root,satyarth934/root,sawenzel/root,simonpf/root,esakellari/root,georgtroska/root,davidlt/root,perovic/root,tc3t/qoot,omazapa/root,tc3t/qoot,sirinath/root,kirbyherm/root-r-tools,jrtomps/root,CristinaCristescu/root,perovic/root,krafczyk/root,tc3t/qoot,jrtomps/root,vukasinmilosevic/root,omazapa/root-old,arch1tect0r/root,nilqed/root,Duraznos/root,mhuwiler/rootauto,arch1tect0r/root,sawenzel/root,davidlt/root,omazapa/root-old,omazapa/root,esakellari/root,buuck/root,mkret2/root,sawenzel/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,jrtomps/root,krafczyk/root,bbockelm/root,evgeny-boger/root,evgeny-boger/root,omazapa/root-old,tc3t/qoot,karies/root,sbinet/cxx-root,vukasinmilosevic/root,Dr15Jones/root,mhuwiler/rootauto,tc3t/qoot,thomaskeck/root,Y--/root,arch1tect0r/root,tc3t/qoot,omazapa/root-old,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,krafczyk/root,omazapa/root-old,agarciamontoro/root,evgeny-boger/root,omazapa/root-old,vukasinmilosevic/root,agarciamontoro/root,arch1tect0r/root,nilqed/root,mkret2/root,gbitzes/root,thomaskeck/root,esakellari/root,alexschlueter/cern-root,0x0all/ROOT,thomaskeck/root,jrtomps/root,nilqed/root,dfunke/root,strykejern/TTreeReader,Duraznos/root,Duraznos/root,gbitzes/root,omazapa/root,tc3t/qoot,jrtomps/root,strykejern/TTreeReader,cxx-hep/root-cern,BerserkerTroll/root,satyarth934/root,simonpf/root,ffurano/root5,Y--/root,CristinaCristescu/root,evgeny-boger/root,omazapa/root,sbinet/cxx-root,krafczyk/root,buuck/root,dfunke/root,davidlt/root,ffurano/root5,nilqed/root,buuck/root,smarinac/root,abhinavmoudgil95/root,buuck/root,thomaskeck/root,Y--/root,smarinac/root,jrtomps/root,pspe/root,cxx-hep/root-cern,ffurano/root5,pspe/root,gganis/root,sirinath/root,BerserkerTroll/root,sirinath/root,satyarth934/root,gganis/root,mkret2/root,simonpf/root,veprbl/root,perovic/root,jrtomps/root,beniz/root,esakellari/my_root_for_test,arch1tect0r/root,veprbl/root,arch1tect0r/root,satyarth934/root,vukasinmilosevic/root,perovic/root,BerserkerTroll/root,vukasinmilosevic/root,omazapa/root-old,evgeny-boger/root,sbinet/cxx-root,agarciamontoro/root,0x0all/ROOT,satyarth934/root,0x0all/ROOT,satyarth934/root
|
c44c18c4d13d6fde1d38e603f00029deaf7ff002
|
src/libc4/include/util/error.h
|
src/libc4/include/util/error.h
|
#ifndef ERROR_H
#define ERROR_H
/*
* Note that we include "fmt" in the variadic argument list, because C99
* apparently doesn't allow variadic macros to be invoked without any vargs
* parameters.
*/
#define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__)
#define FAIL() simple_error(__FILE__, __LINE__)
#define FAIL_APR(s) apr_error((s), __FILE__, __LINE__)
#define FAIL_SQLITE(c) sqlite_error((c), __FILE__, __LINE__)
#ifdef ASSERT_ENABLED
#define ASSERT(cond) \
do { \
if (!(cond)) \
assert_fail(APR_STRINGIFY(cond), __FILE__, __LINE__); \
} while (0)
#else
#define ASSERT(cond)
#endif
void apr_error(apr_status_t s, const char *file, int line_num) __attribute__((noreturn));
void sqlite_error(C4Runtime *c4, const char *file, int line_num) __attribute__((noreturn));
void simple_error(const char *file, int line_num) __attribute__((noreturn));
void var_error(const char *file, int line_num,
const char *fmt, ...) __attribute__((format(printf, 3, 4), noreturn));
void assert_fail(const char *cond, const char *file, int line_num) __attribute__((noreturn));
#endif /* ERROR_H */
|
#ifndef ERROR_H
#define ERROR_H
/*
* Note that we include "fmt" in the variadic argument list, because C99
* apparently doesn't allow variadic macros to be invoked without any vargs
* parameters.
*/
#define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__)
#define FAIL() simple_error(__FILE__, __LINE__)
#define FAIL_APR(s) apr_error((s), __FILE__, __LINE__)
#define FAIL_SQLITE(c) sqlite_error((c), __FILE__, __LINE__)
#ifdef C4_ASSERT_ENABLED
#define ASSERT(cond) \
do { \
if (!(cond)) \
assert_fail(APR_STRINGIFY(cond), __FILE__, __LINE__); \
} while (0)
#else
#define ASSERT(cond)
#endif
void apr_error(apr_status_t s, const char *file, int line_num) __attribute__((noreturn));
void sqlite_error(C4Runtime *c4, const char *file, int line_num) __attribute__((noreturn));
void simple_error(const char *file, int line_num) __attribute__((noreturn));
void var_error(const char *file, int line_num,
const char *fmt, ...) __attribute__((format(printf, 3, 4), noreturn));
void assert_fail(const char *cond, const char *file, int line_num) __attribute__((noreturn));
#endif /* ERROR_H */
|
Fix braindamage: assertions were not enabled in debug builds.
|
Fix braindamage: assertions were not enabled in debug builds.
|
C
|
mit
|
bloom-lang/c4,bloom-lang/c4,bloom-lang/c4
|
42d51980ef24c2e9b93fcfd2d3aa8c0e50dc27a7
|
CefSharp.Core/RequestContext.h
|
CefSharp.Core/RequestContext.h
|
// Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "Internals\MCefRefPtr.h"
#include "RequestContextSettings.h"
#include "include\cef_request_context.h"
using namespace CefSharp;
namespace CefSharp
{
public ref class RequestContext
{
private:
MCefRefPtr<CefRequestContext> _requestContext;
RequestContextSettings^ _settings;
public:
RequestContext()
{
CefRequestContextSettings settings;
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
RequestContext(RequestContextSettings^ settings) : _settings(settings)
{
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
!RequestContext()
{
_requestContext = NULL;
}
~RequestContext()
{
this->!RequestContext();
delete _settings;
}
operator CefRefPtr<CefRequestContext>()
{
return _requestContext.get();
}
};
}
|
// Copyright 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "Internals\MCefRefPtr.h"
#include "RequestContextSettings.h"
#include "include\cef_request_context.h"
using namespace CefSharp;
namespace CefSharp
{
public ref class RequestContext
{
private:
MCefRefPtr<CefRequestContext> _requestContext;
RequestContextSettings^ _settings;
public:
RequestContext()
{
CefRequestContextSettings settings;
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
RequestContext(RequestContextSettings^ settings) : _settings(settings)
{
_requestContext = CefRequestContext::CreateContext(settings, NULL);
}
!RequestContext()
{
_requestContext = NULL;
}
~RequestContext()
{
this->!RequestContext();
delete _settings;
}
operator CefRefPtr<CefRequestContext>()
{
if(this == nullptr)
{
return NULL;
}
return _requestContext.get();
}
};
}
|
Add nullptr check and return NULL for implicitor operator when object is not initialized
|
Add nullptr check and return NULL for implicitor operator when object is not initialized
|
C
|
bsd-3-clause
|
jamespearce2006/CefSharp,dga711/CefSharp,twxstar/CefSharp,battewr/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,Livit/CefSharp,windygu/CefSharp,joshvera/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,VioletLife/CefSharp,battewr/CefSharp,NumbersInternational/CefSharp,Haraguroicha/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,AJDev77/CefSharp,windygu/CefSharp,illfang/CefSharp,dga711/CefSharp,dga711/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,Livit/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,zhangjingpu/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,AJDev77/CefSharp,Livit/CefSharp,ruisebastiao/CefSharp,dga711/CefSharp,AJDev77/CefSharp,Haraguroicha/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,ruisebastiao/CefSharp,joshvera/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,NumbersInternational/CefSharp,illfang/CefSharp,Haraguroicha/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,ITGlobal/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,gregmartinhtc/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp
|
f606322980ae5739c9358a5b374da676ce796627
|
include/common.h
|
include/common.h
|
/**
* common.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_COMMON_H
#define GIT_STASHD_COMMON_H
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NOOPT_FOUND_V -1
#define CLEAN_CATCH_V -2
#endif
|
/**
* common.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_COMMON_H
#define GIT_STASHD_COMMON_H
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define _GNU_SOURCE
#define NULL_BYTE 1
#define NOT_FOUND -1
#define ERR_CATCH -2
#endif
|
Add NULL_BYTE macro, rename others
|
Add NULL_BYTE macro, rename others
|
C
|
mit
|
nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd
|
3fbbffc2c6a09a8faffcbd40645029d41d1044ad
|
test/default/cmptest.h
|
test/default/cmptest.h
|
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp_out;
int c;
if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
perror("fopen(" TEST_NAME_RES ")");
return 99;
}
if (sodium_init() != 0) {
return 99;
}
xmain();
rewind(fp_res);
if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
perror("fopen(" TEST_NAME_OUT ")");
return 99;
}
do {
if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
return 99;
}
} while (c != EOF);
return 0;
}
#undef printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain
#endif
|
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp_out;
int c;
if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
perror("fopen(" TEST_NAME_RES ")");
return 99;
}
if (sodium_init() != 0) {
return 99;
}
if (xmain() != 0) {
return 99;
}
rewind(fp_res);
if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
perror("fopen(" TEST_NAME_OUT ")");
return 99;
}
do {
if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
return 99;
}
} while (c != EOF);
return 0;
}
#undef printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain
#endif
|
Check xmain() return code in tests.
|
Check xmain() return code in tests.
|
C
|
isc
|
Payshare/libsodium,Payshares/libsodium,donpark/libsodium,netroby/libsodium,mvduin/libsodium,akkakks/libsodium,Payshares/libsodium,tml/libsodium,donpark/libsodium,pmienk/libsodium,akkakks/libsodium,optedoblivion/android_external_libsodium,GreatFruitOmsk/libsodium,paragonie-scott/libsodium,donpark/libsodium,GreatFruitOmsk/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,JackWink/libsodium,JackWink/libsodium,pyparallel/libsodium,pmienk/libsodium,rustyhorde/libsodium,soumith/libsodium,Payshare/libsodium,paragonie-scott/libsodium,soumith/libsodium,netroby/libsodium,eburkitt/libsodium,HappyYang/libsodium,pyparallel/libsodium,eburkitt/libsodium,pyparallel/libsodium,kytvi2p/libsodium,soumith/libsodium,rustyhorde/libsodium,zhuqling/libsodium,zhuqling/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,pmienk/libsodium,Payshares/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,SpiderOak/libsodium,tml/libsodium,Payshare/libsodium,SpiderOak/libsodium,optedoblivion/android_external_libsodium,GreatFruitOmsk/libsodium,HappyYang/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,akkakks/libsodium,mvduin/libsodium,paragonie-scott/libsodium,rustyhorde/libsodium,tml/libsodium,eburkitt/libsodium,zhuqling/libsodium,netroby/libsodium,kytvi2p/libsodium,JackWink/libsodium,akkakks/libsodium,optedoblivion/android_external_libsodium,SpiderOak/libsodium,rustyhorde/libsodium,mvduin/libsodium,HappyYang/libsodium
|
a67b4a35ab897730d7847a96ca4b20925e0c7c38
|
test/profile/instrprof-error.c
|
test/profile/instrprof-error.c
|
// RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE="%t/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
|
// RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE=%t/ LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
int main(int argc, const char *argv[]) {
if (argc < 2)
return 1;
return 0;
}
// CHECK: LLVM Profile: Failed to write file
|
Remove quotes around env variable, NFC
|
[profile] Remove quotes around env variable, NFC
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@264824 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
|
f8c8f68c19c6fdb074047ebd0d05f5595a6a5686
|
src/output/output_hls.h
|
src/output/output_hls.h
|
#include "output_http.h"
#include "output_ts_base.h"
namespace Mist{
class OutHLS : public TSOutput{
public:
OutHLS(Socket::Connection &conn);
~OutHLS();
static void init(Util::Config *cfg);
void sendTS(const char *tsData, size_t len = 188);
void sendNext();
void onHTTP();
bool isReadyForPlay();
virtual void onFail(const std::string &msg, bool critical = false);
protected:
std::string h264init(const std::string &initData);
std::string h265init(const std::string &initData);
bool hasSessionIDs(){return !config->getBool("mergesessions");}
std::string liveIndex();
std::string liveIndex(size_t tid, const std::string &sessId);
size_t vidTrack;
size_t audTrack;
uint64_t until;
};
}// namespace Mist
typedef Mist::OutHLS mistOut;
|
#include "output_http.h"
#include "output_ts_base.h"
namespace Mist{
class OutHLS : public TSOutput{
public:
OutHLS(Socket::Connection &conn);
~OutHLS();
static void init(Util::Config *cfg);
void sendTS(const char *tsData, size_t len = 188);
void sendNext();
void onHTTP();
bool isReadyForPlay();
virtual void onFail(const std::string &msg, bool critical = false);
virtual std::string getStatsName(){return Output::getStatsName();}
protected:
std::string h264init(const std::string &initData);
std::string h265init(const std::string &initData);
bool hasSessionIDs(){return !config->getBool("mergesessions");}
std::string liveIndex();
std::string liveIndex(size_t tid, const std::string &sessId);
size_t vidTrack;
size_t audTrack;
uint64_t until;
};
}// namespace Mist
typedef Mist::OutHLS mistOut;
|
Fix HLS being seen as input during init
|
Fix HLS being seen as input during init
|
C
|
unlicense
|
DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver
|
4eaa650e89278c8f6e3defd636433629d6bc2770
|
src/main/entity/components/SkillComponent.h
|
src/main/entity/components/SkillComponent.h
|
#ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
/**
* Enumeration for identifying different skills.
*/
enum skill_t {
Melee,
Swords,
BastardSword,
Maces,
SpikedMace,
FirstAid
};
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
skill_t skill; ///< The type of skill
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
#endif
|
#ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
/**
* Enumeration for identifying different skills.
*/
enum skill_t {
NOSKILL,
Melee,
Swords,
BastardSword,
Maces,
SpikedMace,
FirstAid
};
/**
* This array defines our parent skill relationships.
*
* If a skill's parent is NOSKILL, it has no parent.
*/
const skill_t* PARENT_SKILLS = { NOSKILL, NOSKILL, Melee, Swords, Melee, Maces, NOSKILL };
#endif
|
Add NOSKILL skill type, remove from component
|
Add NOSKILL skill type, remove from component
The component will be going into a MultiComponentManager, so it will already be indexed by skill_t; storing skill_t in the component as well is redundant, unnecessary, and redundant.
|
C
|
mit
|
Kromey/roglick
|
631e13f0aac39105f7837035cffccf9c48fe16ab
|
mc/inc/LinkDef.h
|
mc/inc/LinkDef.h
|
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ global gMC;
#pragma link C++ enum PDG_t;
#pragma link C++ enum TMCProcess;
#pragma link C++ class TVirtualMC+;
#pragma link C++ class TVirtualMCApplication+;
#pragma link C++ class TVirtualMCStack+;
#pragma link C++ class TVirtualMCDecayer+;
#endif
|
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ global gMC;
#pragma link C++ enum PDG_t;
#pragma link C++ enum TMCProcess;
#pragma link C++ class TVirtualMC+;
#pragma link C++ class TVirtualMCApplication+;
#pragma link C++ class TVirtualMCStack+;
#pragma link C++ class TVirtualMCDecayer+;
#pragma link C++ class TMCVerbose+;
#endif
|
Add TMCVerbose to the list of mc classes
|
Add TMCVerbose to the list of mc classes
git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@6190 27541ba8-7e3a-0410-8455-c3a389f83636
|
C
|
lgpl-2.1
|
dawehner/root,bbannier/ROOT,dawehner/root,dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT
|
5f5f1422181bf195aafc27e30339d5960a787f7a
|
main.c
|
main.c
|
#include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"
void entry(void) {
pic_remap(IRQ0, IRQ8);
pic_set_masks(0, 0);
gdt_init((struct GDT *)(0x500));
idt_init((struct IDT *)(0x500 + sizeof(struct GDT)));
__asm__ __volatile__ ("sti");
screen_init();
__asm__ __volatile__ ("int $0x50");
for(;;) { __asm__ __volatile__ ("hlt"); }
}
|
#include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"
void entry(void) {
pic_remap(IRQ0, IRQ8);
pic_set_masks(0, 0);
idt_init((struct IDT *)(0x500));
gdt_init((struct GDT *)(0x500 + sizeof(struct IDT)));
__asm__ __volatile__ ("sti");
screen_init();
__asm__ __volatile__ ("int $0x50");
for(;;) { __asm__ __volatile__ ("hlt"); }
}
|
Set up IDT first to ensure exceptions are handled
|
Set up IDT first to ensure exceptions are handled
|
C
|
apache-2.0
|
shockkolate/shockk-os,shockkolate/shockk-os,shockkolate/shockk-os
|
10fbce820f580d058bdfb1ab89cf01a027da3161
|
gitst.c
|
gitst.c
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#define GITBUF 2048
int
main(int argc, char **argv)
{
int pid, ret;
int pipes[2];
char gitbuff[GITBUF];
size_t gitlen;
char b;
char *br;
int childst;
if(pipe(pipes) != 0)
{
perror("Error creating pipes");
exit(1);
}
if((pid = fork()) == -1)
{
perror("Error forking git");
exit(1);
}
if(pid == 0) //child
{
if(dup2(pipes[1], STDOUT_FILENO) == -1)
{
perror("Error duplicating stdout");
exit(1);
}
close(STDERR_FILENO);
ret = execlp("git", "git", "status", "-z", "-b", (char*)0);
}
waitpid(pid, &childst, 0);
if(childst != 0) {
exit(2);
}
gitlen = read(pipes[0], gitbuff, GITBUF);
br = &gitbuff[3];
putchar('(');
while(*br != '\0')
{
// Three dots separate the branch from the tracking branch
if(*br == '.' && *(br+1) == '.' && *(br+2) == '.') break;
putchar(*br++);
}
putchar(')');
putchar('\n');
}
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#define GITBUF 2048
int
main(int argc, char **argv)
{
int pid, ret;
int pipes[2];
char gitbuff[GITBUF];
size_t gitlen;
char b;
char *br;
int childst;
if(pipe(pipes) != 0)
{
perror("Error creating pipes");
exit(1);
}
if((pid = fork()) == -1)
{
perror("Error forking git");
exit(1);
}
if(pid == 0) //child
{
if(dup2(pipes[1], STDOUT_FILENO) == -1)
{
perror("Error duplicating stdout");
exit(1);
}
close(STDERR_FILENO);
ret = execlp("git", "git", "branch", "--list", (char*)0);
}
waitpid(pid, &childst, 0);
if(childst != 0) {
exit(2);
}
gitlen = read(pipes[0], gitbuff, GITBUF);
br = gitbuff;
putchar('(');
while(*br++ != '*') {}
// skip the '*' and the space after it
br++;
while(*br != '\n')
{
putchar(*br++);
}
putchar(')');
putchar('\n');
}
|
Convert to `git branch` for performance
|
Convert to `git branch` for performance
- Using `git status` is eificient to get only the current branch but in
a repo with a large number of untracked files it can stall for a long
time getting the status of a repository. Git Branch is much better in
these cases.
|
C
|
bsd-3-clause
|
wnh/prompt_utils
|
df717db1600e062dcd96be7ba4ae431252d578dd
|
test2/float/call/many_floats.c
|
test2/float/call/many_floats.c
|
// RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n",
5,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3); // this causes an infinite loop in glibc's printf()
printf("Hello %d %.1f\n",
5,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3, // this causes an infinite loop in glibc's printf()
2.3); // and this causes a crash
// suspect the bug is to do with double alignment when passed as stack arguments
return 0;
}
|
// RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n"
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
5,
5.9,
7.3,
8.7,
10.1,
11.5,
12.9,
14.3,
15.7,
17.1,
18.5,
19.9); // this causes an infinite loop in glibc's printf()
printf("Hello %d %.1f\n"
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
5,
15.7,
14.3,
12.9,
11.5,
10.1,
8.7,
7.3,
5.9,
4.5,
3.1,
1.7, // this causes an infinite loop in glibc's printf()
0.3); // and this causes a crash
// suspect the bug is to do with double alignment when passed as stack arguments
return 0;
}
|
Format strings and more through test for stack floats
|
Format strings and more through test for stack floats
|
C
|
mit
|
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
|
7ba01aa3a21bd1edb41e5639584f153d694b967a
|
test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h
|
test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h
|
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#define TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#include <memory>
#include <string>
#include <grpcpp/grpcpp.h>
namespace grpc {
namespace gcp {
// If max_expected_concurrent_rpcs is non-zero, the fake handshake service
// will track the number of concurrent RPCs that it handles and abort
// if if ever exceeds that number.
std::unique_ptr<grpc::Service> CreateFakeHandshakerService(
int max_expected_concurrent_rpcs);
} // namespace gcp
} // namespace grpc
#endif // TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
|
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#define TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
#include <memory>
#include <string>
#include <grpcpp/grpcpp.h>
namespace grpc {
namespace gcp {
// If max_expected_concurrent_rpcs is non-zero, the fake handshake service
// will track the number of concurrent RPCs that it handles and abort
// if if ever exceeds that number.
std::unique_ptr<grpc::Service> CreateFakeHandshakerService(
int expected_max_concurrent_rpcs);
} // namespace gcp
} // namespace grpc
#endif // TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H
|
Fix differing parameter name clang tidy warning
|
Fix differing parameter name clang tidy warning
|
C
|
apache-2.0
|
muxi/grpc,muxi/grpc,vjpai/grpc,ctiller/grpc,nicolasnoble/grpc,firebase/grpc,muxi/grpc,donnadionne/grpc,jtattermusch/grpc,jboeuf/grpc,ctiller/grpc,grpc/grpc,stanley-cheung/grpc,jboeuf/grpc,stanley-cheung/grpc,ejona86/grpc,ejona86/grpc,stanley-cheung/grpc,firebase/grpc,muxi/grpc,stanley-cheung/grpc,nicolasnoble/grpc,grpc/grpc,ctiller/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,muxi/grpc,jtattermusch/grpc,donnadionne/grpc,nicolasnoble/grpc,grpc/grpc,ctiller/grpc,nicolasnoble/grpc,ejona86/grpc,grpc/grpc,jtattermusch/grpc,jtattermusch/grpc,grpc/grpc,ejona86/grpc,nicolasnoble/grpc,stanley-cheung/grpc,stanley-cheung/grpc,muxi/grpc,jtattermusch/grpc,ctiller/grpc,firebase/grpc,jboeuf/grpc,donnadionne/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,ctiller/grpc,nicolasnoble/grpc,jtattermusch/grpc,vjpai/grpc,nicolasnoble/grpc,firebase/grpc,nicolasnoble/grpc,firebase/grpc,vjpai/grpc,ejona86/grpc,ejona86/grpc,jboeuf/grpc,firebase/grpc,donnadionne/grpc,grpc/grpc,grpc/grpc,nicolasnoble/grpc,vjpai/grpc,firebase/grpc,vjpai/grpc,donnadionne/grpc,jboeuf/grpc,firebase/grpc,jboeuf/grpc,grpc/grpc,ctiller/grpc,ejona86/grpc,muxi/grpc,ejona86/grpc,jboeuf/grpc,firebase/grpc,jboeuf/grpc,donnadionne/grpc,stanley-cheung/grpc,nicolasnoble/grpc,vjpai/grpc,firebase/grpc,donnadionne/grpc,donnadionne/grpc,stanley-cheung/grpc,stanley-cheung/grpc,grpc/grpc,jboeuf/grpc,grpc/grpc,vjpai/grpc,nicolasnoble/grpc,ejona86/grpc,jtattermusch/grpc,donnadionne/grpc,ctiller/grpc,donnadionne/grpc,ejona86/grpc,vjpai/grpc,firebase/grpc,jtattermusch/grpc,jtattermusch/grpc,ctiller/grpc,jtattermusch/grpc,muxi/grpc,ejona86/grpc,jboeuf/grpc,stanley-cheung/grpc,vjpai/grpc,muxi/grpc,jtattermusch/grpc,firebase/grpc,muxi/grpc,jboeuf/grpc,stanley-cheung/grpc,jtattermusch/grpc,donnadionne/grpc,nicolasnoble/grpc,muxi/grpc,ctiller/grpc,ejona86/grpc,jboeuf/grpc,vjpai/grpc,muxi/grpc,stanley-cheung/grpc,donnadionne/grpc
|
b5707323dd01a74be0169d3550d565b35c2c6ca2
|
webkit/glue/webkit_constants.h
|
webkit/glue/webkit_constants.h
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms. We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops. Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;
// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 0.004;
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms. We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops. Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;
// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 1.0;
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
|
Increase the minimum interval for timers on background tabs to reduce their CPU consumption.
|
Increase the minimum interval for timers on background tabs to reduce
their CPU consumption.
The new interval is 1000 ms, or once per second. We can easily adjust
this value up or down, but this seems like a reasonable value to judge
the compatibility impact of this change.
BUG=66078
TEST=none (tested manually with minimal test case)
Review URL: http://codereview.chromium.org/6546021
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@75430 0039d316-1c4b-4281-b951-d872f2087c98
|
C
|
bsd-3-clause
|
adobe/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,gavinp/chromium
|
73d218160c386019ea849719d36212c06d3962d2
|
core/alsp_src/win32/mswin32_config.h
|
core/alsp_src/win32/mswin32_config.h
|
/*
* mswin32_config.h Hand made MSWin32 configuration file.
* Copyright (c) 1996 Applied Logic Systems, Inc.
*
* Author: Chuck Houpt
* Creation: 1/30/96
*/
#include "dfltsys.h"
#define MSWin32 1
#define OSStr "mswin32"
#ifdef __GNUC__
#define EXTERNAL_STATE 1
#endif
/* Temp. disable threading until threading GUI stub is fixed */
#ifdef __GNUC__
#define Bytecode 1
#endif
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STRING_H 1
#define HAVE_SRAND 1
#define HAVE_TIME 1
#define HAVE_SOCKET 1
#define BERKELEY_SOCKETS 1
#define HAVE_SELECT 1
#define MISSING_UNIX_DOMAIN_SOCKETS 1
#define APP_PRINTF_CALLBACK 1
#define HAVE_STRCSPN 1
#define HAVE_STRSPN 1
#define HAVE_STRTOK 1
#define REVERSE_ENDIAN 1
/* The windows headers in Cygwin 1.3.4 are missing some prototypes,
so define them here to silence the waring messages. */
#ifdef __GNUC__
extern __inline__ void* GetCurrentFiber(void);
extern __inline__ void* GetFiberData(void);
#endif
#include <winsock2.h>
#include <windows.h>
|
/*
* mswin32_config.h Hand made MSWin32 configuration file.
* Copyright (c) 1996 Applied Logic Systems, Inc.
*
* Author: Chuck Houpt
* Creation: 1/30/96
*/
#include "dfltsys.h"
#define MSWin32 1
#define OSStr "mswin32"
#ifdef __GNUC__
#define EXTERNAL_STATE 1
#endif
/* Temp. disable threading until threading GUI stub is fixed */
#ifdef __GNUC__
#define Bytecode 1
#endif
#define HAVE_STDARG_H 1
#define HAVE_STDLIB_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STRING_H 1
#define HAVE_SRAND 1
#define HAVE_TIME 1
#define HAVE_SOCKET 1
#define BERKELEY_SOCKETS 1
#define HAVE_SELECT 1
#define MISSING_UNIX_DOMAIN_SOCKETS 1
#define APP_PRINTF_CALLBACK 1
#define HAVE_STRCSPN 1
#define HAVE_STRSPN 1
#define HAVE_STRTOK 1
#define REVERSE_ENDIAN 1
#include <winsock2.h>
#include <windows.h>
|
Remove defunct missing defs that interfere with CI build
|
Remove defunct missing defs that interfere with CI build
|
C
|
mit
|
AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog
|
19a8fcca4bd4a935f4cb03292046d193176edd7e
|
chrome/browser/desktop_notification_handler.h
|
chrome/browser/desktop_notification_handler.h
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/renderer_host/render_view_host_observer.h"
class GURL;
struct DesktopNotificationHostMsg_Show_Params;
// Per-tab Desktop notification handler. Handles desktop notification IPCs
// coming in from the renderer.
class DesktopNotificationHandler : public RenderViewHostObserver {
public:
explicit DesktopNotificationHandler(RenderViewHost* render_view_host);
virtual ~DesktopNotificationHandler();
private:
// RenderViewHostObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message);
// IPC handlers.
void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
void OnCancel(int notification_id);
void OnRequestPermission(const GURL& origin, int callback_id);
private:
DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler);
};
#endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/renderer_host/render_view_host_observer.h"
class GURL;
struct DesktopNotificationHostMsg_Show_Params;
// Per-tab Desktop notification handler. Handles desktop notification IPCs
// coming in from the renderer.
class DesktopNotificationHandler : public RenderViewHostObserver {
public:
explicit DesktopNotificationHandler(RenderViewHost* render_view_host);
virtual ~DesktopNotificationHandler();
private:
// RenderViewHostObserver implementation.
bool OnMessageReceived(const IPC::Message& message);
// IPC handlers.
void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
void OnCancel(int notification_id);
void OnRequestPermission(const GURL& origin, int callback_id);
private:
DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler);
};
#endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
|
Revert 80939 - Fix clang error TBR=jam@chromium.org
|
Revert 80939 - Fix clang error
TBR=jam@chromium.org
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@80954 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
|
C
|
bsd-3-clause
|
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
|
0d3d2c64205b736d86a038b0411e833d77f1581e
|
lib/grn_report.h
|
lib/grn_report.h
|
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRN_REPORT_H
#define GRN_REPORT_H
#include "grn_ctx.h"
#ifdef __cplusplus
extern "C" {
#endif
const grn_log_level GRN_REPORT_INDEX_LOG_LEVEL;
void grn_report_index(grn_ctx *ctx,
const char *action,
const char *tag,
grn_obj *index);
#ifdef __cplusplus
}
#endif
#endif /* GRN_REPORT_H */
|
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRN_REPORT_H
#define GRN_REPORT_H
#include "grn_ctx.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const grn_log_level GRN_REPORT_INDEX_LOG_LEVEL;
void grn_report_index(grn_ctx *ctx,
const char *action,
const char *tag,
grn_obj *index);
#ifdef __cplusplus
}
#endif
#endif /* GRN_REPORT_H */
|
Add missing extern to variable in header
|
Add missing extern to variable in header
This missing extern causes following error in OSX:
```log
...
2403 warnings generated.
CXXLD libgroonga.la
duplicate symbol _GRN_REPORT_INDEX_LOG_LEVEL in:
.libs/db.o
.libs/expr.o
duplicate symbol _GRN_REPORT_INDEX_LOG_LEVEL in:
.libs/db.o
.libs/report.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libgroonga.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
```
|
C
|
lgpl-2.1
|
groonga/groonga,cosmo0920/groonga,komainu8/groonga,komainu8/groonga,cosmo0920/groonga,kenhys/groonga,komainu8/groonga,naoa/groonga,cosmo0920/groonga,kenhys/groonga,hiroyuki-sato/groonga,naoa/groonga,groonga/groonga,kenhys/groonga,groonga/groonga,groonga/groonga,komainu8/groonga,kenhys/groonga,hiroyuki-sato/groonga,komainu8/groonga,hiroyuki-sato/groonga,komainu8/groonga,cosmo0920/groonga,naoa/groonga,groonga/groonga,cosmo0920/groonga,cosmo0920/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,kenhys/groonga,komainu8/groonga,kenhys/groonga,hiroyuki-sato/groonga,hiroyuki-sato/groonga,naoa/groonga,kenhys/groonga,groonga/groonga,naoa/groonga,cosmo0920/groonga,komainu8/groonga,naoa/groonga,groonga/groonga,hiroyuki-sato/groonga,groonga/groonga,naoa/groonga,kenhys/groonga,naoa/groonga,cosmo0920/groonga
|
b59a3395e6e276e715d9972749ec5c4cefb4157a
|
chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h
|
chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/common/extensions/api/cryptotoken_private.h"
#include "extensions/browser/extension_function.h"
// Implementations for chrome.cryptotokenPrivate API functions.
namespace infobars {
class InfoBar;
}
namespace extensions {
namespace api {
class CryptotokenPrivateCanOriginAssertAppIdFunction
: public UIThreadExtensionFunction {
public:
CryptotokenPrivateCanOriginAssertAppIdFunction();
DECLARE_EXTENSION_FUNCTION("cryptotokenPrivate.canOriginAssertAppId",
CRYPTOTOKENPRIVATE_CANORIGINASSERTAPPID)
protected:
~CryptotokenPrivateCanOriginAssertAppIdFunction() override {}
ResponseAction Run() override;
private:
ChromeExtensionFunctionDetails chrome_details_;
};
} // namespace api
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/common/extensions/api/cryptotoken_private.h"
#include "extensions/browser/extension_function.h"
// Implementations for chrome.cryptotokenPrivate API functions.
namespace extensions {
namespace api {
class CryptotokenPrivateCanOriginAssertAppIdFunction
: public UIThreadExtensionFunction {
public:
CryptotokenPrivateCanOriginAssertAppIdFunction();
DECLARE_EXTENSION_FUNCTION("cryptotokenPrivate.canOriginAssertAppId",
CRYPTOTOKENPRIVATE_CANORIGINASSERTAPPID)
protected:
~CryptotokenPrivateCanOriginAssertAppIdFunction() override {}
ResponseAction Run() override;
private:
ChromeExtensionFunctionDetails chrome_details_;
};
} // namespace api
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_
|
Remove an unneeded forward declaration.
|
Remove an unneeded forward declaration.
BUG=457769
R=pkasting@chromium.org,rockot@chromium.org
Review URL: https://codereview.chromium.org/930493002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#316348}
|
C
|
bsd-3-clause
|
PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,ltilve/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,ltilve/chromium,axinging/chromium-crosswalk,Chilledheart/chromium
|
cb3786e6ed05e08592b4697beff83c3879ce13bf
|
libc/sysdeps/linux/common/getgid.c
|
libc/sysdeps/linux/common/getgid.c
|
/* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
_syscall0(gid_t, getgid);
libc_hidden_proto(getgid)
libc_hidden_def(getgid)
|
/* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
libc_hidden_proto(getgid)
_syscall0(gid_t, getgid);
libc_hidden_def(getgid)
|
Make gcc4 happy as well
|
Make gcc4 happy as well
|
C
|
lgpl-2.1
|
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
|
59306802d58df62203ecd17271bacbdc9d268bfd
|
Marshal/Marshal.h
|
Marshal/Marshal.h
|
//
// Marshal.h
// Marshal
//
// Created by Jason Larsen on 2/24/16.
// Copyright © 2016 Utah iOS & Mac. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for Marshal.
FOUNDATION_EXPORT double MarshalVersionNumber;
//! Project version string for Marshal.
FOUNDATION_EXPORT const unsigned char MarshalVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Marshal/PublicHeader.h>
|
//
// M A R S H A L
//
// ()
// /\
// ()--' '--()
// `. .'
// / .. \
// ()' '()
//
//
#import <Foundation/Foundation.h>
//! Project version number for Marshal.
FOUNDATION_EXPORT double MarshalVersionNumber;
//! Project version string for Marshal.
FOUNDATION_EXPORT const unsigned char MarshalVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Marshal/PublicHeader.h>
|
Use Foundation to resolve macros instead of UIKit
|
Use Foundation to resolve macros instead of UIKit
|
C
|
mit
|
utahiosmac/Marshal,utahiosmac/Marshal
|
2f0befaa35ec8b1baa2fe61438f9705206e694cb
|
MeetingApp/Meeting/Protocols/IMeetingDelegate.h
|
MeetingApp/Meeting/Protocols/IMeetingDelegate.h
|
//
// IMeetingDelegate.h
// MeetingApp
//
// Created by Estefania Chavez Guardado on 2/27/16.
// Copyright © 2016 Estefania Chavez Guardado. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Meeting.h"
@protocol IMeetingDelegate <NSObject>
@optional
- (void) update: (MutableMeeting *) newMeeting;
- (void) moveToInactiveMeetings:(int) indexMeeting
andInactiveTheMeeting: (NSString *) idMeeting;
- (void) updateDetail: (MutableMeeting *) meeting;
@end
|
//
// IMeetingDelegate.h
// MeetingApp
//
// Created by Estefania Chavez Guardado on 2/27/16.
// Copyright © 2016 Estefania Chavez Guardado. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Meeting.h"
typedef enum NotificationType {
NOTIFICATION_TYPE_EMAIL,
NOTIFICATION_TYPE_CALENDAR
} NotificationType;
@protocol IMeetingDelegate <NSObject>
@optional
- (void) update: (MutableMeeting *) newMeeting;
- (void) moveToInactiveMeetings:(int) indexMeeting
andInactiveTheMeeting: (NSString *) idMeeting;
- (void) updateDetail: (MutableMeeting *) meeting;
// TODO: Send to update the notification
- (void) updateNotification: (NotificationType) type withCallback:(void (^)(BOOL updated)) callback;
@end
|
Define the method updateNotification in meetingbussiness
|
Define the method updateNotification in meetingbussiness
|
C
|
apache-2.0
|
iTermin/app_iOS
|
b9592bddbc014759941b94b76596c1dbf2245ad3
|
common/alexcpt.h
|
common/alexcpt.h
|
#ifndef ALEXCPT_H
#define ALEXCPT_H
#include <exception>
#include <string>
#include "AL/alc.h"
namespace al {
class backend_exception final : public std::exception {
std::string mMessage;
ALCenum mErrorCode;
public:
backend_exception(ALCenum code, const char *msg, ...);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }
};
} // namespace al
#define START_API_FUNC try
#define END_API_FUNC catch(...) { std::terminate(); }
#endif /* ALEXCPT_H */
|
#ifndef ALEXCPT_H
#define ALEXCPT_H
#include <exception>
#include <string>
#include "AL/alc.h"
#ifdef __GNUC__
#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else
#define ALEXCPT_FORMAT(x, y, z)
#endif
namespace al {
class backend_exception final : public std::exception {
std::string mMessage;
ALCenum mErrorCode;
public:
backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }
};
} // namespace al
#define START_API_FUNC try
#define END_API_FUNC catch(...) { std::terminate(); }
#endif /* ALEXCPT_H */
|
Add the printf format attribute to backend_exception's constructor
|
Add the printf format attribute to backend_exception's constructor
|
C
|
lgpl-2.1
|
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
|
e0c1a00bbff90dffccc5d5aab9142b076b72a821
|
thingshub/CDZIssueSyncEngine.h
|
thingshub/CDZIssueSyncEngine.h
|
//
// CDZIssueSyncEngine.h
// thingshub
//
// Created by Chris Dzombak on 1/13/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import <ReactiveCocoa/ReactiveCocoa.h>
@class OCTClient;
@class CDZThingsHubConfiguration;
@protocol CDZIssueSyncDelegate;
@interface CDZIssueSyncEngine : NSObject
/// Designated initializer
- (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate
configuration:(CDZThingsHubConfiguration *)config
authenticatedClient:(OCTClient *)client;
/// Returns a signal which will either complete or error after the sync operation.
- (RACSignal *)sync;
@end
|
//
// CDZIssueSyncEngine.h
// thingshub
//
// Created by Chris Dzombak on 1/13/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import <ReactiveCocoa/ReactiveCocoa.h>
@class OCTClient;
@class CDZThingsHubConfiguration;
@protocol CDZIssueSyncDelegate;
@interface CDZIssueSyncEngine : NSObject
/// Designated initializer
- (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate
configuration:(CDZThingsHubConfiguration *)config
authenticatedClient:(OCTClient *)client;
/// Returns a signal which will asynchronously return strings as status updates,
/// and either complete or error after the sync operation.
- (RACSignal *)sync;
@end
|
Update sync method docs in IssueSyncEngine
|
Update sync method docs in IssueSyncEngine
|
C
|
mit
|
cdzombak/thingshub,cdzombak/thingshub,cdzombak/thingshub
|
3393cde61f40f1629a04688460a4d2dd5c76fff3
|
bindings/f95/plflt.c
|
bindings/f95/plflt.c
|
/* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio>
#include <stdlib>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile ;
char *kind ;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0"
#else
kind = "1.0"
#endif
fprintf{ outfile, "\
! NOTE: Generated code\n\
!\n\
! Type of floating-point numbers in PLplot\n\
!\n\
integer, parameter :: plf = kind(%s)\n\
integer, parameter :: plflt = plf\n", kind ) ;
fclose( outfile ) ;
}
|
/* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio.h>
#include <stdlib.h>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile;
char *kind;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0";
#else
kind = "1.0";
#endif
fprintf( outfile, "C NOTE: Generated code\n");
fprintf( outfile, "C\n");
fprintf( outfile, "C Type of floating-point numbers in PLplot\n");
fprintf( outfile, "C\n");
fprintf( outfile, " integer, parameter :: plf = kind(%s)\n", kind);
fprintf( outfile, " integer, parameter :: plflt = plf\n");
fclose( outfile);
}
|
Fix large number of syntax errors (at least for gcc).
|
Fix large number of syntax errors (at least for gcc).
svn path=/trunk/; revision=6508
|
C
|
lgpl-2.1
|
FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot
|
a2dce448551cd5c010f07341e080729188999a9a
|
include/libport/unistd.h
|
include/libport/unistd.h
|
#ifndef LIBPORT_UNISTD_H
# define LIBPORT_UNISTD_H
# include "detect_win32.h"
# include "libport/config.h"
// This is traditional Unix file.
# ifdef LIBPORT_HAVE_UNISTD_H
# include "unistd.h"
# endif
// This seems to be its WIN32 equivalent.
// http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7.
# if defined WIN32 || defined LIBPORT_WIN32
# include "io.h"
# endif
#if defined LIBPORT_HAVE__GETCWD
# define getcwd _getcwd
#elif !defined LIBPORT_HAVE_GETCWD
# error I need either getcwd() or _getcwd()
#endif
#endif // !LIBPORT_UNISTD_H
|
#ifndef LIBPORT_UNISTD_H
# define LIBPORT_UNISTD_H
# include "detect_win32.h"
# include "libport/config.h"
// This is traditional Unix file.
# ifdef LIBPORT_HAVE_UNISTD_H
# include "unistd.h"
# endif
// This seems to be its WIN32 equivalent.
// http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmgch09_topic7.
# if defined WIN32 || defined LIBPORT_WIN32
# include "io.h"
# endif
#if defined LIBPORT_URBI_ENV_AIBO
static char *getcwd(char *buf, size_t size)
{
if (buf == 0 || size <= 3)
return 0;
strncpy (buf, "/MS", size);
return buf;
}
#else
# if defined LIBPORT_HAVE__GETCWD
# define getcwd _getcwd
# elif !defined LIBPORT_HAVE_GETCWD
# error I need either getcwd() or _getcwd()
# endif
#endif
#endif // !LIBPORT_UNISTD_H
|
Add dummy static version of getcwd for Aibo.
|
Add dummy static version of getcwd for Aibo.
* include/libport/unistd.h: Here.
|
C
|
bsd-3-clause
|
aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport
|
9834e5a66c91f1681d70369550e55d96b2d961d9
|
Classes/Categories/Categories.h
|
Classes/Categories/Categories.h
|
#import "NSManagedObject+ActiveRecord.h"
#import "NSString+StringBetweenStrings.h"
#import <Artsy+UIColors/UIColor+ArtsyColors.h>
#import "UIColor+FolioColours.h"
#import <Artsy+UIFonts/UIFont+ArtsyFonts.h>
#import "NSObject+Notifications.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIButton+FolioButtons.h"
#import "UIColor+DebugColours.h"
#import "NSString+StringSize.h"
#import "UIBarButtonItem+toolbarHelpers.h"
#import "UIImageView+ArtsySetURL.h"
|
#import "NSManagedObject+ActiveRecord.h"
#import "NSString+StringBetweenStrings.h"
#import <Artsy+UIColors/UIColor+ArtsyColors.h>
#import "UIColor+FolioColours.h"
#if __has_include(<Artsy+UIFonts/UIFont+ArtsyFonts.h>)
#import <Artsy+UIFonts/UIFont+ArtsyFonts.h>
#endif
#if __has_include(<Artsy+OSSUIFonts/UIFont+OSSArtsyFonts.h>)
#import <Artsy+OSSUIFonts/UIFont+OSSArtsyFonts.h>
#endif
#import "NSObject+Notifications.h"
#import <UIView+BooleanAnimations/UIView+BooleanAnimations.h>
#import "UIButton+FolioButtons.h"
#import "UIColor+DebugColours.h"
#import "NSString+StringSize.h"
#import "UIBarButtonItem+toolbarHelpers.h"
#import "UIImageView+ArtsySetURL.h"
|
Support running from the OSS fonts
|
Support running from the OSS fonts
|
C
|
mit
|
tomdev2008/energy,tomdev2008/energy,artsy/energy,gaurav1981/energy,gaurav1981/energy,gaurav1981/energy,artsy/energy,tomdev2008/energy,tomdev2008/energy,gaurav1981/energy,gaurav1981/energy,tomdev2008/energy,artsy/energy,artsy/energy,artsy/energy,tomdev2008/energy
|
48600172e57f4f4e9dd06f6a4704032e3d6bc53e
|
file4.c
|
file4.c
|
file4.c - r1
Test checkin in master1-updated - updated_by_master
Test checkin in master2
Test checkin in master3
Test checkin in master4
|
Test checkin in master1-updated - updated_by_master
Test checkin in master1-updated - updated2
Test checkin in master2
Test checkin in master3
Test checkin in master4
|
Test commit merges feature to master
|
Test commit merges feature to master
|
C
|
apache-2.0
|
shahedmolla/test
|
36ebfc68edd9b7052ffd14cca2a4775f9c450f18
|
llvm-external-projects/iree-dialects/include/iree-dialects/Transforms/ListenerGreedyPatternRewriteDriver.h
|
llvm-external-projects/iree-dialects/include/iree-dialects/Transforms/ListenerGreedyPatternRewriteDriver.h
|
// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "iree-dialects/Transforms/Listener.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
namespace mlir {
struct GreedyRewriteConfig;
/// Applies the specified patterns on `op` alone while also trying to fold it,
/// by selecting the highest benefits patterns in a greedy manner. Returns
/// success if no more patterns can be matched. `erased` is set to true if `op`
/// was folded away or erased as a result of becoming dead. Note: This does not
/// apply any patterns recursively to the regions of `op`. Accepts a listener
/// so the caller can be notified of rewrite events.
LogicalResult applyPatternsAndFoldGreedily(
MutableArrayRef<Region> regions, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener);
inline LogicalResult applyPatternsAndFoldGreedily(
Operation *op, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener) {
return applyPatternsAndFoldGreedily(op->getRegions(), patterns, config,
listener);
}
} // namespace mlir
|
// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "iree-dialects/Transforms/Listener.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Rewrite/FrozenRewritePatternSet.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
namespace mlir {
struct GreedyRewriteConfig;
/// Applies the specified patterns on `op` alone while also trying to fold it,
/// by selecting the highest benefits patterns in a greedy manner. Returns
/// success if no more patterns can be matched. `erased` is set to true if `op`
/// was folded away or erased as a result of becoming dead. Note: This does not
/// apply any patterns recursively to the regions of `op`. Accepts a listener
/// so the caller can be notified of rewrite events.
LogicalResult applyPatternsAndFoldGreedily(
MutableArrayRef<Region> regions, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener);
inline LogicalResult applyPatternsAndFoldGreedily(
Operation *op, const FrozenRewritePatternSet &patterns,
const GreedyRewriteConfig &config, RewriteListener *listener) {
return applyPatternsAndFoldGreedily(op->getRegions(), patterns, config,
listener);
}
} // namespace mlir
|
Add include for GreedyPatternRewriteDriver implementation.
|
Add include for GreedyPatternRewriteDriver implementation.
Not sure if this is correct. There was an unresolved symbol error on MSVC that this fixes though.
|
C
|
apache-2.0
|
iree-org/iree,iree-org/iree,google/iree,iree-org/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,google/iree,iree-org/iree
|
0c04638755b14023abbc7ff4c87609e026de14fc
|
src/thermostat.h
|
src/thermostat.h
|
#pragma once
#define DHT22_PIN 6
#define DHT22_SAMPLE_RATE 3000
#define TEMPORATURE_TARGET (204)
#define HEATER_PIN 10
#define HEATER_ACTION_DELAY (15*60) // minimal seconds to open/close heater, prevent switch heater too frequently.
|
#pragma once
#define DHT22_PIN 6
#define DHT22_SAMPLE_RATE 20000
#define TEMPORATURE_TARGET (204)
#define HEATER_PIN 10
#define HEATER_ACTION_DELAY (15*60) // minimal seconds to open/close heater, prevent switch heater too frequently.
|
Change DHT22 sensor sample rate to 20 seconds
|
Change DHT22 sensor sample rate to 20 seconds
3 seconds is used for debug purpose
|
C
|
apache-2.0
|
redforks/thermostat,redforks/thermostat
|
b74ae5b33ec0f0ac4614e831043c65cdb38ee5f2
|
TASKS/TASK_1/sources/vector3d.h
|
TASKS/TASK_1/sources/vector3d.h
|
#ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint = { 0.0, 0.0, 0.0 };
public:
Vector3D();
Vector3D(Point3D point = nullPoint);
Vector3D(double x = 0.0, double y = 0.0, double z = 0.0);
~Vector3D();
double getModule() const;
Vector3D copy() const;
Vector3D getReversed() const;
void multiplyByScalar(const double);
void normalize();
void print() const;
static Vector3D add(Vector3D&, Vector3D&);
static Vector3D substract(Vector3D&, Vector3D&);
static Vector3D vectorMultiply(Vector3D&, Vector3D&) ;
static double scalarMultiply(Vector3D&, Vector3D&);
static double sin(Vector3D&, Vector3D&);
static double cos(Vector3D&, Vector3D&);
static double angle(Vector3D&, Vector3D&);
};
}
#endif // VECTOR_3D_H
|
#ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
typedef const char* err;
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint;
static unsigned int idCounter;
public:
Vector3D(Point3D point = nullPoint);
Vector3D(double x, double y = 0.0, double z = 0.0);
~Vector3D();
inline double getModule() const;
inline void print() const;
inline const Point3D& getPoint() const;
Vector3D copy() const;
void multiplyByScalar(const double);
void normalize();
static Vector3D add(Vector3D&, Vector3D&);
static Vector3D substract(Vector3D&, Vector3D&);
static Vector3D vectorMultiply(Vector3D&, Vector3D&) ;
static double scalarMultiply(Vector3D&, Vector3D&);
static double sin(Vector3D&, Vector3D&);
static double cos(Vector3D&, Vector3D&);
static double angle(Vector3D&, Vector3D&);
};
}
#endif // VECTOR_3D_H
|
Change signatures of methods and fields of class
|
Change signatures of methods and fields of class
|
C
|
mit
|
reeFridge/learn-oop-through-cpp
|
220e81db102f180b4c30eb85398e6f55d74faca2
|
calc.c
|
calc.c
|
#include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p)
{
int i;
int ans;
ans = atoi(p);
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++;
}
switch (p[i]){
case '+':
return (ans + calc(p + i + 1));
case '-':
return (ans - calc(p + i + 1));
case '*':
ans *= atoi(p + i + 1);
i++;
break;
case '/':
ans /= atoi(p + i + 1);
i++;
break;
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
}
|
#include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p)
{
int i;
int ans;
ans = atoi(p);
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++;
}
switch (p[i]){
case '+':
return (ans + calc(p + i + 1));
case '-':
return (ans - calc(p + i + 1));
case '*':
ans *= atoi(p + i + 1);
i++;
break;
case '/':
ans /= atoi(p + i + 1);
i++;
break;
case '\0':
return (ans);
default:
puts("Error");
return (0);
}
}
return (ans);
}
|
Return answer when reading formula was finished
|
Return answer when reading formula was finished
|
C
|
mit
|
Roadagain/Calculator,Roadagain/Calculator
|
581c0f20d6d4109ed7b905aa6f11cca2bea33b41
|
Os_Cfg.h
|
Os_Cfg.h
|
/* OSEKOS Implementation of an OSEK Scheduler
* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef OS_CFG_H_
#define OS_CFG_H_
#ifdef OS_CFG_ARCH_POSIX
#include "Os_Arch_Posix.h"
#endif
#ifdef OS_CFG_ARCH_FIBERS
#include "Os_Arch_Fibers.h"
#endif
#define OS_TASK_COUNT 3
#define OS_PRIO_COUNT 3
#define OS_TICK_US 100000U
extern void errorhook(StatusType ret);
#define OS_ERRORHOOK(_ret) errorhook(_ret)
#endif /* OS_CFG_H_ */
|
/* OSEKOS Implementation of an OSEK Scheduler
* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef OS_CFG_H_
#define OS_CFG_H_
#ifdef OS_CFG_ARCH_POSIX
#include "Os_Arch_Posix.h"
#endif
#ifdef OS_CFG_ARCH_FIBERS
#include "Os_Arch_Fibers.h"
#endif
#define OS_TASK_COUNT 3
#define OS_PRIO_COUNT 3
#define OS_TICK_US 1000000U
extern void errorhook(StatusType ret);
#define OS_ERRORHOOK(_ret) errorhook(_ret)
#endif /* OS_CFG_H_ */
|
Increment timer ticks for now
|
Increment timer ticks for now
|
C
|
lgpl-2.1
|
elupus/osek,elupus/osek,elupus/osek
|
224017fde6a9c4ae850e870563136d66843b4963
|
include/llvm/MC/MCSymbolXCOFF.h
|
include/llvm/MC/MCSymbolXCOFF.h
|
//===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCSYMBOLXCOFF_H
#define LLVM_MC_MCSYMBOLXCOFF_H
#include "llvm/BinaryFormat/XCOFF.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/IR/GlobalValue.h"
namespace llvm {
class MCSymbolXCOFF : public MCSymbol {
// The IR symbol this MCSymbolXCOFF is based on. It is set on function
// entry point symbols when they are the callee operand of a direct call
// SDNode.
const GlobalValue *GV = nullptr;
public:
MCSymbolXCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
: MCSymbol(SymbolKindXCOFF, Name, isTemporary) {}
void setGlobalValue(const GlobalValue *G) { GV = G; }
const GlobalValue *getGlobalValue() const { return GV; }
static bool classof(const MCSymbol *S) { return S->isXCOFF(); }
};
} // end namespace llvm
#endif // LLVM_MC_MCSYMBOLXCOFF_H
|
//===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCSYMBOLXCOFF_H
#define LLVM_MC_MCSYMBOLXCOFF_H
#include "llvm/BinaryFormat/XCOFF.h"
#include "llvm/MC/MCSymbol.h"
namespace llvm {
class GlobalValue;
class MCSymbolXCOFF : public MCSymbol {
// The IR symbol this MCSymbolXCOFF is based on. It is set on function
// entry point symbols when they are the callee operand of a direct call
// SDNode.
const GlobalValue *GV = nullptr;
public:
MCSymbolXCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
: MCSymbol(SymbolKindXCOFF, Name, isTemporary) {}
void setGlobalValue(const GlobalValue *G) { GV = G; }
const GlobalValue *getGlobalValue() const { return GV; }
static bool classof(const MCSymbol *S) { return S->isXCOFF(); }
};
} // end namespace llvm
#endif // LLVM_MC_MCSYMBOLXCOFF_H
|
Work around a circular dependency between IR and MC introduced in r362735
|
Work around a circular dependency between IR and MC introduced in r362735
I replaced the circular library dependency with a forward declaration,
but it is only a workaround, not a real fix.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@362782 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm
|
831405d274f7a3cbb097fb09ce317f976f16c9fe
|
rs.h
|
rs.h
|
/**
* Generic reservoir sampling.
*/
#ifndef _RS_H
#define _RS_H
/* print actions to the reservoir */
#ifndef PRINT_RS_TRACE
#define PRINT_RS_TRACE 1
#endif
struct reservoir;
struct drand48_data;
struct reservoir *init_reservoir(size_t sz,
#if PRINT_RS_TRACE
void (*print_fun)(void *it),
#endif
void *(*clone_fun)(const void *it, size_t sz),
void (*free_fun)(void *it));
void free_reservoir(struct reservoir *r);
/* Notice one extra parameter when tracing the reservoir */
void add_to_reservoir(struct reservoir *r, const void *it, size_t sz,
double w, struct drand48_data *randbuffer);
void add_to_reservoir_log(struct reservoir *r, const void *it, size_t sz,
double logw, struct drand48_data *randbuffer);
#endif
|
/**
* Generic reservoir sampling.
*/
#ifndef _RS_H
#define _RS_H
/* print actions to the reservoir */
#ifndef PRINT_RS_TRACE
#define PRINT_RS_TRACE 1
#endif
struct reservoir;
struct drand48_data;
/* Notice one extra parameter when tracing the reservoir */
struct reservoir *init_reservoir(size_t sz,
#if PRINT_RS_TRACE
void (*print_fun)(void *it),
#endif
void *(*clone_fun)(const void *it, size_t sz),
void (*free_fun)(void *it));
void free_reservoir(struct reservoir *r);
void add_to_reservoir(struct reservoir *r, const void *it, size_t sz,
double w, struct drand48_data *randbuffer);
void add_to_reservoir_log(struct reservoir *r, const void *it, size_t sz,
double logw, struct drand48_data *randbuffer);
#endif
|
Move comment to the code it comments on
|
Move comment to the code it comments on
|
C
|
bsd-3-clause
|
mihaimaruseac/dphcar
|
ee758e12198cd82c29a387193a154e6a8f88fc99
|
src/domain.h
|
src/domain.h
|
/***************************************************************************//**
* \file domain.h
* \author Krishnan, A. (anush@bu.edu)
* \brief Definition of the class \c domain
*/
#pragma once
#include "types.h"
/**
* \class domain
* \brief Store the mesh grid information
*/
class domain
{
public:
int nx, ///< number of cells in the x-direction
ny; ///< number of cells in the y-direction
vecH x, ///< x-coordinates of the nodes
y, ///< y-coordinates of the nodes
dx, ///< cell widths in the x-direction
dy; ///< cell widths in the y-direction
vecD xD, ///< x-coordinates of the nodes stored on the device
yD, ///< y-coordinates of the nodes stored on the device
dxD, ///< x- cell widths stored on the device
dyD; ///< y- cell widths stored on the device
vecH xu, ///< x-coordinates of the locations at which the x-component of velocity is evaluated
yu, ///< y-coordinates of the locations at which the x-component of velocity is evaluated
xv, ///< x-coordinates of the locations at which the y-component of velocity is evaluated
yv; ///< y-coordinates of the locations at which the y-component of velocity is evaluated
};
|
/***************************************************************************//**
* \file domain.h
* \author Anush Krishnan (anush@bu.edu)
* \brief Definition of the class \c domain.
*/
#pragma once
#include "types.h"
/**
* \class domain
* \brief Stores information about the computational grid.
*/
class domain
{
public:
int nx, ///< number of cells in the x-direction
ny; ///< number of cells in the y-direction
vecH x, ///< x-coordinates of the nodes
y, ///< y-coordinates of the nodes
dx, ///< cell widths in the x-direction
dy; ///< cell widths in the y-direction
vecD xD, ///< x-coordinates of the nodes stored on the device
yD, ///< y-coordinates of the nodes stored on the device
dxD, ///< x- cell widths stored on the device
dyD; ///< y- cell widths stored on the device
vecH xu, ///< x-coordinates of the locations at which the x-component of velocity is evaluated
yu, ///< y-coordinates of the locations at which the x-component of velocity is evaluated
xv, ///< x-coordinates of the locations at which the y-component of velocity is evaluated
yv; ///< y-coordinates of the locations at which the y-component of velocity is evaluated
};
|
Update Doxygen documentation with conventions
|
Update Doxygen documentation with conventions
|
C
|
mit
|
barbagroup/cuIBM,barbagroup/cuIBM,barbagroup/cuIBM
|
c21ae1451dd3a20b4ff0566ae45a0e58a35081fe
|
Source/OCMock/OCMLocation.h
|
Source/OCMock/OCMLocation.h
|
/*
* Copyright (c) 2014-2015 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
}
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (id)testCase;
- (NSString *)file;
- (NSUInteger)line;
@end
extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
|
/*
* Copyright (c) 2014-2015 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import <Foundation/Foundation.h>
@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
}
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
- (id)testCase;
- (NSString *)file;
- (NSUInteger)line;
@end
#if defined(__cplusplus)
extern "C"
#else
extern
#endif
OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
|
Fix linking in Objective–C++ tests.
|
Fix linking in Objective–C++ tests.
As detailed in #238, linking tests sometimes fails when OCMock is being used in Objective-C++ (.mm) test case files.
This commit solves that problem by conditionally declaring `OCMMakeLocation` as `extern C` in when included in a C++ compilation unit.
|
C
|
apache-2.0
|
Lightricks/ocmock,Lightricks/ocmock,Lightricks/ocmock,NextThought/ocmock,erikdoe/ocmock,firebase/ocmock,BohdanOrlov/ocmock,Lightricks/ocmock,erikdoe/ocmock,dhardiman/ocmock,erikdoe/ocmock,imhuntingwabbits/ocmock,erikdoe/ocmock,SteveFortune/ocmock
|
18ca3c88bfab828cf26f5a184cfa30ba012089e4
|
memory.c
|
memory.c
|
/*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
uint8_t getmembyte(uint16_t addr)
{
return *(memory_area + addr);
}
uint16_t getmemword(uint16_t addr)
{
return (getmembyte(addr+1) << 8 | getmembyte(addr));
}
void putmembyte(uint16_t addr, uint8_t byte)
{
// FIXME: must control if addr is readonly (TODO: implement MBC controllers)
*(memory_area + addr) = byte;
}
void putmemword(uint16_t addr, uint16_t word)
{
putmembyte(addr, (word >> 8));
putmembyte(addr+1, (word & 0xFF));
}
|
/*
* Copyright (c) 2012, Nadir Sampaoli
* See the LICENSE for more information
*/
#include "memory.h"
#include <stdlib.h>
#include <stdio.h>
static uint8_t *memory_area;
void allocmemory(void)
{
while(!memory_area) {
memory_area = malloc(MEM_SIZE * sizeof(uint8_t));
}
}
inline uint8_t getmembyte(uint16_t addr)
{
return *(memory_area + addr);
}
inline uint16_t getmemword(uint16_t addr)
{
return (getmembyte(addr+1) << 8 | getmembyte(addr));
}
void putmembyte(uint16_t addr, uint8_t byte)
{
// FIXME: must control if addr is readonly (TODO: implement MBC controllers)
*(memory_area + addr) = byte;
}
void putmemword(uint16_t addr, uint16_t word)
{
putmembyte(addr, (word >> 8));
putmembyte(addr+1, (word & 0xFF));
}
|
Change "getmembyte" and "getmemword" to inline functions
|
Change "getmembyte" and "getmemword" to inline functions
|
C
|
mit
|
nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu,nadirs/dmgemu
|
4957aeebad39f4dc1c3ed05e81a171d4ab213b15
|
TwIRCk/GLGInputParserDelegate.h
|
TwIRCk/GLGInputParserDelegate.h
|
//
// GLGInputParserDelegate.h
// TwIRCk
//
// Created by Tim Jarratt on 11/29/13.
// Copyright (c) 2013 General Linear Group. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol GLGInputParserDelegate <NSObject>
- (void) didJoinChannel:(NSString *)channel
rawCommand:(NSString *)rawCommand;
- (void) didPartChannel:(NSString *)channel
rawCommand:(NSString *)rawCommand;
- (void) didChangeNick:(NSString *)newNick
rawCommand:(NSString *)rawCommand;
- (void) didChangePassword:(NSString *)newPassword
rawCommand:(NSString *)rawCommand;
@end
|
//
// GLGInputParserDelegate.h
// TwIRCk
//
// Created by Tim Jarratt on 11/29/13.
// Copyright (c) 2013 General Linear Group. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol GLGInputParserDelegate <NSObject>
- (void) didJoinChannel:(NSString *)channel
rawCommand:(NSString *)command;
- (void) didPartChannel:(NSString *)channel
rawCommand:(NSString *)channel;
- (void) didChangeNick:(NSString *)newNick
rawCommand:(NSString *)channel;
- (void) didChangePassword:(NSString *)newPassword
rawCommand:(NSString *)channel;
@end
|
Revert "Name these protocol method variables better"
|
Revert "Name these protocol method variables better"
This reverts commit 0dc63736e1b8398d1fc9692473f285076aa862ee.
|
C
|
mit
|
tjarratt/twIRCk,tjarratt/twIRCk,tjarratt/twIRCk
|
9bf77934c4d06067d3619abc4c40ca5adf3dde9f
|
include/kernel/idt.h
|
include/kernel/idt.h
|
#ifndef IDT_H
#define IDT_H
#include <stdint.h>
struct IDTEntry {
uint16_t base_address_low;
uint16_t selector;
uint8_t reserved;
uint8_t type : 4;
uint8_t storage_segment : 1;
uint8_t privilege : 2;
uint8_t present : 1;
uint16_t base_address_high;
} __attribute__((packed));
struct IDTDescriptor {
uint16_t limiter;
uint32_t base_address;
} __attribute__((packed));
struct IDT {
struct IDTDescriptor descriptor;
struct IDTEntry entries[256];
} __attribute__((packed));
void idt_init(struct IDT *);
#endif
|
#ifndef IDT_H
#define IDT_H
#include <stdint.h>
struct IDTEntry {
uint16_t base_address_low;
uint16_t selector;
uint8_t reserved;
uint8_t type : 4;
uint8_t storage_segment : 1;
uint8_t privilege : 2;
uint8_t present : 1;
uint16_t base_address_high;
} __attribute__((packed));
struct IDTDescriptor {
uint16_t limiter;
uint32_t base_address;
} __attribute__((packed));
struct IDT {
struct IDTDescriptor descriptor;
struct IDTEntry entries[128];
} __attribute__((packed));
void idt_init(struct IDT *);
#endif
|
Cut space required for IDT in half
|
Cut space required for IDT in half
|
C
|
apache-2.0
|
shockkolate/shockk-os,shockkolate/shockk-os,shockkolate/shockk-os
|
c7b43401d7bca2f3919c40391473e37a384093ca
|
types.h
|
types.h
|
/*
* types.h
*
* Created on: Mar 11, 2014
* Author: Chase
*/
#ifndef TYPES_H_
#define TYPES_H_
#include <stdint.h>
//Don't use stdbool.h, we have to make sure bool is only a byte in size!
typedef uint8_t bool;
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
typedef uint8_t char8_t;
typedef uint16_t char16_t;
#endif /* TYPES_H_ */
|
/*
* types.h
*
* Created on: Mar 11, 2014
* Author: Chase
*/
#ifndef TYPES_H_
#define TYPES_H_
#include <stdint.h>
//Don't use stdbool.h, we have to make sure bool is only a byte in size!
typedef uint8_t bool;
enum {
true = 1,
false = 0,
TRUE = 1,
FALSE = 0
};
typedef uint8_t char8_t;
typedef uint16_t char16_t;
#endif /* TYPES_H_ */
|
Change bool true/false to enum
|
Change bool true/false to enum
|
C
|
mit
|
Chase-san/libspec,Chase-san/libspec
|
a2c9184cb990b90c7575053637f1abc99f3d32e9
|
src/untrusted/nacl/pthread_initialize_minimal.c
|
src/untrusted/nacl/pthread_initialize_minimal.c
|
/*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <unistd.h>
#include "native_client/src/untrusted/nacl/nacl_irt.h"
#include "native_client/src/untrusted/nacl/nacl_thread.h"
#include "native_client/src/untrusted/nacl/tls.h"
/*
* This initialization happens early in startup with or without libpthread.
* It must make it safe for vanilla newlib code to run.
*/
void __pthread_initialize_minimal(size_t tdb_size) {
/* Adapt size for sbrk. */
/* TODO(robertm): this is somewhat arbitrary - re-examine). */
size_t combined_size = (__nacl_tls_combined_size(tdb_size) + 15) & ~15;
/*
* Use sbrk not malloc here since the library is not initialized yet.
*/
void *combined_area = sbrk(combined_size);
/*
* Fill in that memory with its initializer data.
*/
void *tp = __nacl_tls_initialize_memory(combined_area, tdb_size);
/*
* Set %gs, r9, or equivalent platform-specific mechanism. Requires
* a syscall since certain bitfields of these registers are trusted.
*/
nacl_tls_init(tp);
/*
* Initialize newlib's thread-specific pointer.
*/
__newlib_thread_init();
}
|
/*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <unistd.h>
#include "native_client/src/untrusted/nacl/nacl_irt.h"
#include "native_client/src/untrusted/nacl/nacl_thread.h"
#include "native_client/src/untrusted/nacl/tls.h"
/*
* This initialization happens early in startup with or without libpthread.
* It must make it safe for vanilla newlib code to run.
*/
void __pthread_initialize_minimal(size_t tdb_size) {
size_t combined_size = __nacl_tls_combined_size(tdb_size);
/*
* Use sbrk not malloc here since the library is not initialized yet.
*/
void *combined_area = sbrk(combined_size);
/*
* Fill in that memory with its initializer data.
*/
void *tp = __nacl_tls_initialize_memory(combined_area, tdb_size);
/*
* Set %gs, r9, or equivalent platform-specific mechanism. Requires
* a syscall since certain bitfields of these registers are trusted.
*/
nacl_tls_init(tp);
/*
* Initialize newlib's thread-specific pointer.
*/
__newlib_thread_init();
}
|
Remove unnecessary rounding when allocating initial thread block
|
Cleanup: Remove unnecessary rounding when allocating initial thread block
The other calls to __nacl_tls_combined_size() don't do this.
__nacl_tls_combined_size() should be doing any necessary rounding itself.
BUG=none
TEST=trybots
Review URL: https://codereview.chromium.org/18555008
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@11698 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
|
C
|
bsd-3-clause
|
sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client
|
2e7fdd6a1db4a649f7e3e469729946d3978f83a1
|
test/test_buffer_small_read.c
|
test/test_buffer_small_read.c
|
#include <bert/buffer.h>
#include <string.h>
#include <stdio.h>
#include "test.h"
#define DATA_SIZE 4
int main()
{
unsigned char data[4];
bert_buffer_t buffer;
bert_buffer_init(&buffer);
memset(data,'A',DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
bert_buffer_write(&buffer,data,DATA_SIZE);
unsigned char output[DATA_SIZE];
size_t result;
if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE)
{
test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE);
}
if (memcmp(output,data,DATA_SIZE))
{
test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]);
}
return 0;
}
|
#include <bert/buffer.h>
#include <string.h>
#include <stdio.h>
#include "test.h"
#define DATA_SIZE 4
int main()
{
unsigned char data[4];
bert_buffer_t buffer;
bert_buffer_init(&buffer);
memset(data,'A',DATA_SIZE);
unsigned int i;
for (i=0;i<((BERT_CHUNK_SIZE / DATA_SIZE) * 2);i++)
{
bert_buffer_write(&buffer,data,DATA_SIZE);
}
unsigned char output[DATA_SIZE];
size_t result;
if ((result = bert_buffer_read(output,&buffer,DATA_SIZE)) != DATA_SIZE)
{
test_fail("bert_buffer_read only read %u bytes, expected %u",result,DATA_SIZE);
}
if (memcmp(output,data,DATA_SIZE))
{
test_fail("bert_buffer_read return %c%c%c%c, expected AAAA",output[0],output[1],output[2],output[3]);
}
return 0;
}
|
Make sure the buffer small read populates the buffer with multiple chunks.
|
Make sure the buffer small read populates the buffer with multiple chunks.
|
C
|
mit
|
postmodern/libBERT
|
6fd49de120156dfac40ce3ce57d52f986b66aa3e
|
C/SysLib/SysLib.h
|
C/SysLib/SysLib.h
|
/*****************************************************************************\
* *
* Filename SysLib.h *
* *
* Description SysLib Library core definitions *
* *
* Notes Included indirectly by the include files that need it. *
* Do not include directly. *
* *
* History *
* 2016-04-12 JFL Created this file. *
* 2016-04-22 JFL Renamed the MULTIOS library as SYSLIB. *
* *
* © Copyright 2016 Hewlett Packard Enterprise Development LP *
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#ifndef __SYSLIB_H__ /* Prevent multiple inclusions */
#define __SYSLIB_H__
/* Force linking with the SysLib.lib library */
#if defined(_MSC_VER)
#define _SYSLIB_LIB "SysLib.lib"
#pragma message("Adding pragma comment(lib, \"" _SYSLIB_LIB "\")")
#pragma comment(lib, _SYSLIB_LIB)
#endif /* defined(_MSC_VER) */
#if defined(__unix__)
#define _SYSLIB_LIB "libSysLib.a"
#endif
#endif /* defined(__SYSLIB_H__) */
|
/*****************************************************************************\
* *
* Filename SysLib.h *
* *
* Description SysLib Library core definitions *
* *
* Notes Included indirectly by the include files that need it. *
* Do not include directly. *
* *
* History *
* 2016-04-12 JFL Created this file. *
* 2016-04-22 JFL Renamed the MULTIOS library as SYSLIB. *
* *
* © Copyright 2016 Hewlett Packard Enterprise Development LP *
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#ifndef __SYSLIB_H__ /* Prevent multiple inclusions */
#define __SYSLIB_H__
/* Force linking with the SysLib.lib library */
#if defined(_MSC_VER)
#define _SYSLIB_LIB "SysLib.lib"
#pragma message("Adding pragma comment(lib, \"" _SYSLIB_LIB "\")")
#pragma comment(lib, _SYSLIB_LIB)
#else /* GCC, clang, etc. */
#define _SYSLIB_LIB "libSysLib.a"
#endif
#endif /* defined(__SYSLIB_H__) */
|
Fix compatibility with all non-Microsoft compilers
|
Fix compatibility with all non-Microsoft compilers
|
C
|
apache-2.0
|
JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib
|
8236a6d84a13fa1511aaa8d8dea1b0155fe78c95
|
fifo.h
|
fifo.h
|
#ifndef FIFO_H
#define FIFO_H
#include "align.h"
#define FIFO_NODE_SIZE 510
struct _fifo_node_t;
typedef struct DOUBLE_CACHE_ALIGNED {
volatile size_t enq DOUBLE_CACHE_ALIGNED;
volatile size_t deq DOUBLE_CACHE_ALIGNED;
volatile struct {
int index;
struct _fifo_node_t * node;
} head DOUBLE_CACHE_ALIGNED;
size_t nprocs;
} fifo_t;
typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t {
struct _fifo_handle_t * next;
struct _fifo_node_t * enq;
struct _fifo_node_t * deq;
struct _fifo_node_t * hazard;
struct _fifo_node_t * retired;
int winner;
} fifo_handle_t;
void fifo_init(fifo_t * fifo, size_t width);
void fifo_register(fifo_t * fifo, fifo_handle_t * handle);
void * fifo_get(fifo_t * fifo, fifo_handle_t * handle);
void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data);
#endif /* end of include guard: FIFO_H */
|
#ifndef FIFO_H
#define FIFO_H
#include "align.h"
#define FIFO_NODE_SIZE (1 << 20 - 2)
struct _fifo_node_t;
typedef struct DOUBLE_CACHE_ALIGNED {
volatile size_t enq DOUBLE_CACHE_ALIGNED;
volatile size_t deq DOUBLE_CACHE_ALIGNED;
volatile struct {
size_t index;
struct _fifo_node_t * node;
} head DOUBLE_CACHE_ALIGNED;
size_t nprocs;
} fifo_t;
typedef struct DOUBLE_CACHE_ALIGNED _fifo_handle_t {
struct _fifo_handle_t * next;
struct _fifo_node_t * enq;
struct _fifo_node_t * deq;
struct _fifo_node_t * hazard;
struct _fifo_node_t * retired;
int winner;
} fifo_handle_t;
void fifo_init(fifo_t * fifo, size_t width);
void fifo_register(fifo_t * fifo, fifo_handle_t * handle);
void * fifo_get(fifo_t * fifo, fifo_handle_t * handle);
void fifo_put(fifo_t * fifo, fifo_handle_t * handle, void * data);
#endif /* end of include guard: FIFO_H */
|
Use the same size of lcrq.
|
Use the same size of lcrq.
|
C
|
mit
|
chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue,chaoran/fast-wait-free-queue,chaoran/hpc-queue
|
0920b4d3988702e09e175fdfc9ac40aee61a90f5
|
libslax/jsonwriter.h
|
libslax/jsonwriter.h
|
/*
* $Id$
*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- turn json-oriented XML into json text
*/
int
slaxJsonWriteNode (slaxWriterFunc_t func, void *data, xmlNodePtr nodep,
unsigned flags);
int
slaxJsonWriteDoc (slaxWriterFunc_t func, void *data, xmlDocPtr docp,
unsigned flags);
#define JWF_ROOT (1<<0) /* Root node */
#define JWF_ARRAY (1<<1) /* Inside array */
#define JWF_NODESET (1<<2) /* Top of a nodeset */
#define JWF_PRETTY (1<<3) /* Pretty print (newlines) */
#define JWF_OPTIONAL_QUOTES (1<<4) /* Don't use quotes unless needed */
|
/*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- turn json-oriented XML into json text
*/
int
slaxJsonWriteNode (slaxWriterFunc_t func, void *data, xmlNodePtr nodep,
unsigned flags);
int
slaxJsonWriteDoc (slaxWriterFunc_t func, void *data, xmlDocPtr docp,
unsigned flags);
#define JWF_ROOT (1<<0) /* Root node */
#define JWF_ARRAY (1<<1) /* Inside array */
#define JWF_NODESET (1<<2) /* Top of a nodeset */
#define JWF_PRETTY (1<<3) /* Pretty print (newlines) */
#define JWF_OPTIONAL_QUOTES (1<<4) /* Don't use quotes unless needed */
|
Drop $Id$ and update copyright
|
Drop $Id$ and update copyright
|
C
|
bsd-3-clause
|
Juniper/libslax,Juniper/libslax,Juniper/libslax
|
c532f633a94f3d91b4435c8ed84dc3ef7bcf2afa
|
test/Analysis/stack-addr-ps.c
|
test/Analysis/stack-addr-ps.c
|
// RUN: clang -checker-simple -verify %s
int* f1() {
int x = 0;
return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
int* f2(int y) {
return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}
int* f3(int x, int *y) {
int w = 0;
if (x)
y = &w;
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
unsigned short* compound_literal() {
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}}
}
|
// RUN: clang -checker-simple -verify %s
int* f1() {
int x = 0;
return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
int* f2(int y) {
return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}
int* f3(int x, int *y) {
int w = 0;
if (x)
y = &w;
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
unsigned short* compound_literal() {
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
}
|
Add 'expected-warning' for braces around scalar initializer
|
Add 'expected-warning' for braces around scalar initializer
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58280 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
cc83e1e54763daf0dcb2e80989517a5065b5ce0a
|
include/stamp.h
|
include/stamp.h
|
/*
* Time stamp of last source code repository commit.
*/
#define ___STAMP_YMD 20131223
#define ___STAMP_HMS 145645
|
/*
* Time stamp of last source code repository commit.
*/
#define ___STAMP_YMD 20131223
#define ___STAMP_HMS 172203
|
Clarify that LD_LIBRARY_PATH must be set when Gambit is build with shared libs
|
Clarify that LD_LIBRARY_PATH must be set when Gambit is build with shared libs
|
C
|
apache-2.0
|
BeImprovised/gambit,jasperla/gambit,BeImprovised/gambit,BeImprovised/gambit,acenode/gambit,thewhimer/gambit,jasperla/gambit,BeImprovised/gambit,thewhimer/gambit,thewhimer/gambit,jasperla/gambit,acenode/gambit,jasperla/gambit,thewhimer/gambit,acenode/gambit,acenode/gambit,thewhimer/gambit,thewhimer/gambit
|
df24731a1a75f55efa4a4453aed9ad108dfe52cf
|
libs/samson/stream/QueueTaskManager.h
|
libs/samson/stream/QueueTaskManager.h
|
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER
#define _H_SAMSON_QUEUE_TASK_MANAGER
#include "au/list.h" // au::list
namespace samson {
namespace stream {
class QueueTask;
class QueueTaskManager
{
au::list< QueueTask > queueTasks;
size_t id; // Id of the current task
public:
void add( QueueTask* task );
std::string getStatus();
};
}
}
#endif
|
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER
#define _H_SAMSON_QUEUE_TASK_MANAGER
#include "au/list.h" // au::list
#include <string> // std::string
namespace samson {
namespace stream {
class QueueTask;
class QueueTaskManager
{
au::list< QueueTask > queueTasks;
size_t id; // Id of the current task
public:
void add( QueueTask* task );
std::string getStatus();
};
}
}
#endif
|
Fix broken compilation of Linux for the famous string.h header
|
Fix broken compilation of Linux for the famous string.h header
git-svn-id: 9714148d14941aebeae8d7f7841217f5ffc02bc5@1260 4143565c-f3ec-42ea-b729-f8ce0cf5cbc3
|
C
|
apache-2.0
|
telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform
|
ff3cc8c9b31ed62299c14f800f55097588a2c0f5
|
SwitecX25.h
|
SwitecX25.h
|
#ifndef SwitecX25_h
#define SwitecX25_h
class SwitecX25
{
public:
static const unsigned char pinCount = 4;
static const unsigned char stateCount = 6;
unsigned char pins[pinCount];
unsigned char currentState; // 6 steps
unsigned int currentStep; // step we are currently at
unsigned int targetStep; // target we are moving to
unsigned int steps; // total steps available
unsigned long time0; // time when we entered this state
unsigned int microDelay; // microsecs until next state
unsigned short (*accelTable)[2]; // accel table can be modified.
unsigned int maxVel; // fastest vel allowed
unsigned int vel; // steps travelled under acceleration
char dir; // direction -1,0,1
boolean stopped; // true if stopped
SwitecX25(unsigned int steps, unsigned char pin1, unsigned char pin2, unsigned char pin3, unsigned char pin4);
void stepUp();
void stepDown();
void zero();
void update();
void setPosition(unsigned int pos);
private:
void advance();
void writeIO();
};
#endif
|
#ifndef SwitecX25_h
#define SwitecX25_h
#include <Arduino.h>
class SwitecX25
{
public:
static const unsigned char pinCount = 4;
static const unsigned char stateCount = 6;
unsigned char pins[pinCount];
unsigned char currentState; // 6 steps
unsigned int currentStep; // step we are currently at
unsigned int targetStep; // target we are moving to
unsigned int steps; // total steps available
unsigned long time0; // time when we entered this state
unsigned int microDelay; // microsecs until next state
unsigned short (*accelTable)[2]; // accel table can be modified.
unsigned int maxVel; // fastest vel allowed
unsigned int vel; // steps travelled under acceleration
char dir; // direction -1,0,1
boolean stopped; // true if stopped
SwitecX25(unsigned int steps, unsigned char pin1, unsigned char pin2, unsigned char pin3, unsigned char pin4);
void stepUp();
void stepDown();
void zero();
void update();
void setPosition(unsigned int pos);
private:
void advance();
void writeIO();
};
#endif
|
Include Arduino.h to make sure we have types like "boolean"
|
Include Arduino.h to make sure we have types like "boolean"
|
C
|
bsd-2-clause
|
timkettering/SwitecX25
|
1c8f270a75665f44f8570735762003a4319cbe19
|
test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
|
test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
|
/* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_
*
* __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
* just like explicit setjmp/longjmp calls are.
*/
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
int main(void) {
__builtin_setjmp(0);
jumpaway(0);
}
|
/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
*
* __builtin_longjmp/setjmp should get transformed into intrinsics.
*/
// CHECK-NOT: builtin_longjmp
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
int main(void) {
__builtin_setjmp(0);
jumpaway(0);
}
|
Fix test in two ways: remove incorrect comment (the intrinsic generated now is of the llvm.sjlj.* flavore) and convert grep->FileCheck
|
Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@181468 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
|
d564544ee0462850815967d943d8350f4aa298bc
|
native/fallocate_linux.c
|
native/fallocate_linux.c
|
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <stdint.h>
#include <linux/falloc.h>
int native_fallocate(int fd, uint64_t len) {
return fallocate(fd, 0, 0, (off_t)len);
}
|
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <stdint.h>
int native_fallocate(int fd, uint64_t len) {
return fallocate(fd, 0, 0, (off_t)len);
}
|
Remove falloc header from linux build
|
Remove falloc header from linux build
|
C
|
isc
|
Luminarys/synapse,Luminarys/synapse,Luminarys/synapse
|
5f2e3c068b323d97d73b921623decc34f7ac7325
|
p_liberrno.h
|
p_liberrno.h
|
/*
* Copyright 2013 Mo McRoberts.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef P_LIBERRNO_H_
# define P_LIBERRNO_H_ 1
# include <ux/cdefs.h>
# include "errno.h"
# undef errno
int *get_errno_ux2003(void) UX_SYM03_(errno);
#endif /*!P_LIBERRNO_H_*/
|
/*
* Copyright 2013 Mo McRoberts.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef P_LIBERRNO_H_
# define P_LIBERRNO_H_ 1
# include <ux/cdefs.h>
# include "errno.h"
# undef errno
int *errno_ux2003(void) UX_SYM03_(errno);
#endif /*!P_LIBERRNO_H_*/
|
Fix symbol name of errno$UX$2003
|
Fix symbol name of errno$UX$2003
|
C
|
apache-2.0
|
coreux/liberrno,coreux/liberrno
|
ca864cc2e2063756ba8e48de390d1cf947f2efad
|
tutorial/clock.h
|
tutorial/clock.h
|
// A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
extern "C" bool QueryPerformanceCounter(uint64_t *);
extern "C" bool QueryPerformanceFrequency(uint64_t *);
double current_time() {
uint64_t t, freq;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq);
return (t * 1000.0) / freq;
}
#else
#include <sys/time.h>
double current_time() {
static bool first_call = true;
static timeval reference_time;
if (first_call) {
first_call = false;
gettimeofday(&reference_time, NULL);
return 0.0;
} else {
timeval t;
gettimeofday(&t, NULL);
return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
(t.tv_usec - reference_time.tv_usec)/1000.0);
}
}
#endif
|
// A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
#include <Windows.h>
double current_time() {
LARGE_INTEGER freq, t;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq);
return (t.QuadPart * 1000.0) / freq.QuadPart;
}
// Gross, these come from Windows.h
#undef max
#undef min
#else
#include <sys/time.h>
double current_time() {
static bool first_call = true;
static timeval reference_time;
if (first_call) {
first_call = false;
gettimeofday(&reference_time, NULL);
return 0.0;
} else {
timeval t;
gettimeofday(&t, NULL);
return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
(t.tv_usec - reference_time.tv_usec)/1000.0);
}
}
#endif
|
Fix build of tutorials that require libpng under Visual Studio.
|
Fix build of tutorials that require libpng under Visual Studio.
|
C
|
mit
|
lglucin/Halide,jiawen/Halide,kenkuang1213/Halide,psuriana/Halide,dougkwan/Halide,kenkuang1213/Halide,mcanthony/Halide,damienfir/Halide,jiawen/Halide,dan-tull/Halide,kenkuang1213/Halide,dan-tull/Halide,myrtleTree33/Halide,mcanthony/Halide,lglucin/Halide,adasworks/Halide,rodrigob/Halide,fengzhyuan/Halide,rodrigob/Halide,aam/Halide,damienfir/Halide,ayanazmat/Halide,rodrigob/Halide,lglucin/Halide,dougkwan/Halide,myrtleTree33/Halide,fengzhyuan/Halide,damienfir/Halide,myrtleTree33/Halide,mcanthony/Halide,myrtleTree33/Halide,smxlong/Halide,adasworks/Halide,damienfir/Halide,aam/Halide,damienfir/Halide,kgnk/Halide,psuriana/Halide,kenkuang1213/Halide,dan-tull/Halide,dan-tull/Halide,aam/Halide,mcanthony/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,myrtleTree33/Halide,myrtleTree33/Halide,fengzhyuan/Halide,mcanthony/Halide,jiawen/Halide,jiawen/Halide,dougkwan/Halide,jiawen/Halide,rodrigob/Halide,ronen/Halide,psuriana/Halide,delcypher/Halide,fengzhyuan/Halide,jiawen/Halide,delcypher/Halide,dougkwan/Halide,dougkwan/Halide,damienfir/Halide,smxlong/Halide,mcanthony/Halide,ronen/Halide,delcypher/Halide,aam/Halide,adasworks/Halide,ayanazmat/Halide,ronen/Halide,rodrigob/Halide,fengzhyuan/Halide,dan-tull/Halide,fengzhyuan/Halide,fengzhyuan/Halide,psuriana/Halide,dougkwan/Halide,smxlong/Halide,lglucin/Halide,tdenniston/Halide,smxlong/Halide,mcanthony/Halide,tdenniston/Halide,delcypher/Halide,tdenniston/Halide,damienfir/Halide,smxlong/Halide,tdenniston/Halide,kenkuang1213/Halide,ayanazmat/Halide,ronen/Halide,fengzhyuan/Halide,psuriana/Halide,tdenniston/Halide,rodrigob/Halide,kgnk/Halide,tdenniston/Halide,ayanazmat/Halide,kgnk/Halide,smxlong/Halide,dougkwan/Halide,jiawen/Halide,damienfir/Halide,adasworks/Halide,delcypher/Halide,dan-tull/Halide,kenkuang1213/Halide,dan-tull/Halide,adasworks/Halide,dougkwan/Halide,ayanazmat/Halide,dan-tull/Halide,lglucin/Halide,kgnk/Halide,myrtleTree33/Halide,adasworks/Halide,kgnk/Halide,kenkuang1213/Halide,tdenniston/Halide,aam/Halide,kgnk/Halide,ayanazmat/Halide,rodrigob/Halide,mcanthony/Halide,aam/Halide,kgnk/Halide,lglucin/Halide,kenkuang1213/Halide,kgnk/Halide,rodrigob/Halide,ayanazmat/Halide,myrtleTree33/Halide,delcypher/Halide,delcypher/Halide,aam/Halide,smxlong/Halide,adasworks/Halide,smxlong/Halide,adasworks/Halide,ronen/Halide,psuriana/Halide,ronen/Halide,tdenniston/Halide,lglucin/Halide,ayanazmat/Halide,delcypher/Halide
|
548a5f97ccdab26e90a7e0ba87b1510cfd490dbb
|
src/boreutils.h
|
src/boreutils.h
|
#ifndef BOREUTILS_H
#define BOREUTILS_H
#include <string.h>
static const char *BOREUTILS_VERSION = "0.0.0b1";
int has_arg(int argc, char **argv, char *search);
void bu_missing_argument(char *name);
int bu_handle_version(int argc, char **argv);
// FIXME: Having this in a header is definitely a hack.
int has_arg(int argc, char **argv, char *search)
{
for (int idx = 1; idx < argc; idx++) {
if (strcmp(argv[idx], search) == 0) {
return 1;
}
}
return 0;
}
void bu_missing_argument(char *name) {
fprintf(stderr, "%s: Missing argument\nSee '%s --help' for more information.\n", name, name);
}
int bu_handle_version(int argc, char **argv) {
if (has_arg(argc, argv, "--version")) {
printf("Boreutils %s v%s\n", argv[0], BOREUTILS_VERSION);
return 1;
}
return 0;
}
#endif
|
#ifndef BOREUTILS_H
#define BOREUTILS_H
#include <string.h>
static const char *BOREUTILS_VERSION = "0.0.0b1";
int has_arg(int argc, char **argv, char *search);
void bu_missing_argument(char *name);
int bu_handle_version(int argc, char **argv);
// FIXME: Having this in a header is definitely a hack.
int has_arg(int argc, char **argv, char *search)
{
for (int idx = 1; idx < argc; idx++) {
if (strcmp(argv[idx], search) == 0) {
return 1;
}
}
return 0;
}
void bu_missing_argument(char *name) {
fprintf(stderr, "%s: Missing argument\nSee '%s --help' for more information.\n", name, name);
}
int bu_handle_version(int argc, char **argv) {
if (has_arg(argc, argv, "--version")) {
printf("%s (Boreutils) %s\n", argv[0], BOREUTILS_VERSION);
return 1;
}
return 0;
}
#endif
|
Change --version format to "<name> (Boreutils) <version>"
|
Change --version format to "<name> (Boreutils) <version>"
|
C
|
isc
|
duckinator/boreutils,duckinator/boreutils
|
c8d4b754fb316cf620dcd8a933e3e9886103d878
|
bindings/perl/Champlain/champlain-perl.h
|
bindings/perl/Champlain/champlain-perl.h
|
#ifndef _CHAMPLAIN_PERL_H_
#include <clutterperl.h>
#include <champlain/champlain.h>
#include "ppport.h"
#include "champlain-autogen.h"
#ifdef CHAMPLAINPERL_GTK
#include <champlain-gtk/champlain-gtk.h>
#endif
#endif /* _CHAMPLAIN_PERL_H_ */
|
#ifndef _CHAMPLAIN_PERL_H_
#include <clutterperl.h>
#include <champlain/champlain.h>
#ifdef CHAMPLAINPERL_GTK
#include <champlain-gtk/champlain-gtk.h>
#endif
#include "ppport.h"
#include "champlain-autogen.h"
#endif /* _CHAMPLAIN_PERL_H_ */
|
Move the include file around.
|
Move the include file around.
|
C
|
lgpl-2.1
|
GNOME/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,potyl/champlain,GNOME/libchamplain,GNOME/perl-Champlain,potyl/champlain,Distrotech/libchamplain,StanciuMarius/Libchamplain-map-wrapping,Distrotech/libchamplain,GNOME/perl-Champlain,GNOME/perl-Gtk2-Champlain,Distrotech/libchamplain,Distrotech/libchamplain,potyl/champlain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,potyl/champlain,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,Distrotech/libchamplain,GNOME/perl-Gtk2-Champlain,StanciuMarius/Libchamplain-map-wrapping
|
fb514a31f0c99c252e0948fa88ffb75ba5b5ec69
|
Source/CoreData+MagicalRecord.h
|
Source/CoreData+MagicalRecord.h
|
//
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#define ENABLE_ACTIVE_RECORD_LOGGING
#ifdef ENABLE_ACTIVE_RECORD_LOGGING
#define ARLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#else
#define ARLog(...)
#endif
#import <CoreData/CoreData.h>
#import "MagicalRecordHelpers.h"
#import "MRCoreDataAction.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectModel+MagicalRecord.h"
#import "NSPersistentStore+MagicalRecord.h"
#import "NSManagedObject+MagicalDataImport.h"
|
//
// MagicalRecord for Core Data.
//
// Created by Saul Mora.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
// enable to use caches for the fetchedResultsControllers (iOS only)
#if TARGET_OS_IPHONE
#define STORE_USE_CACHE
#endif
#define kCreateNewCoordinatorOnBackgroundOperations 0
#ifdef MR_LOGGING
#define ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef DEBUG
#define ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef MR_NO_LOGGING
#undef ENABLE_ACTIVE_RECORD_LOGGING
#endif
#ifdef ENABLE_ACTIVE_RECORD_LOGGING
#define ARLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#else
#define ARLog(...)
#endif
#import <CoreData/CoreData.h>
#import "MagicalRecordHelpers.h"
#import "MRCoreDataAction.h"
#import "NSManagedObject+MagicalRecord.h"
#import "NSManagedObjectContext+MagicalRecord.h"
#import "NSPersistentStoreCoordinator+MagicalRecord.h"
#import "NSManagedObjectModel+MagicalRecord.h"
#import "NSPersistentStore+MagicalRecord.h"
#import "NSManagedObject+MagicalDataImport.h"
|
Define MR_NO_LOGGING to force no logging.
|
Define MR_NO_LOGGING to force no logging.
|
C
|
mit
|
zwaldowski/AZCoreRecord,zwaldowski/AZCoreRecord
|
9e70fda79924a066f39a9b366c88d1b69561184c
|
src/policy/rbf.h
|
src/policy/rbf.h
|
// Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_POLICY_RBF_H
#define SYSCOIN_POLICY_RBF_H
#include <txmempool.h>
enum class RBFTransactionState {
UNKNOWN,
REPLACEABLE_BIP125,
FINAL
};
// Determine whether an in-mempool transaction is signaling opt-in to RBF
// according to BIP 125
// This involves checking sequence numbers of the transaction, as well
// as the sequence numbers of all in-mempool ancestors.
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
// SYSCOIN
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool, CTxMemPool::setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // SYSCOIN_POLICY_RBF_H
|
// Copyright (c) 2016-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_POLICY_RBF_H
#define SYSCOIN_POLICY_RBF_H
#include <txmempool.h>
/** The rbf state of unconfirmed transactions */
enum class RBFTransactionState {
/** Unconfirmed tx that does not signal rbf and is not in the mempool */
UNKNOWN,
/** Either this tx or a mempool ancestor signals rbf */
REPLACEABLE_BIP125,
/** Neither this tx nor a mempool ancestor signals rbf */
FINAL,
};
/**
* Determine whether an unconfirmed transaction is signaling opt-in to RBF
* according to BIP 125
* This involves checking sequence numbers of the transaction, as well
* as the sequence numbers of all in-mempool ancestors.
*
* @param tx The unconfirmed transaction
* @param pool The mempool, which may contain the tx
*
* @return The rbf state
*/
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
// SYSCOIN
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool, CTxMemPool::setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // SYSCOIN_POLICY_RBF_H
|
Add doxygen comment to IsRBFOptIn
|
doc: Add doxygen comment to IsRBFOptIn
Former-commit-id: 6c99ae13e834f996721944c8571101bd2c16ba81
|
C
|
mit
|
syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin
|
adfbba6447aa458e95ffad652ba815e080e3b2d3
|
src/util/timeit.h
|
src/util/timeit.h
|
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <iostream>
#include <time.h>
namespace lean {
/**
\brief Low tech timer for used for testing.
*/
class timeit {
std::ostream & m_out;
std::string m_msg;
clock_t m_start;
public:
timeit(std::ostream & out, char const * msg):m_out(out), m_msg(msg) {
m_start = clock();
}
~timeit() {
clock_t end = clock();
std::cout << m_msg << " " << ((static_cast<double>(end) - static_cast<double>(m_start)) / CLOCKS_PER_SEC) << " secs\n";
}
};
}
|
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <iostream>
#include <time.h>
namespace lean {
/**
\brief Low tech timer for used for testing.
*/
class timeit {
std::ostream & m_out;
std::string m_msg;
clock_t m_start;
public:
timeit(std::ostream & out, char const * msg):m_out(out), m_msg(msg) {
m_start = clock();
}
~timeit() {
clock_t end = clock();
m_out << m_msg << " " << ((static_cast<double>(end) - static_cast<double>(m_start)) / CLOCKS_PER_SEC) << " secs\n";
}
};
}
|
Fix problem reported by Soonho
|
Fix problem reported by Soonho
Signed-off-by: Leonardo de Moura <7610bae85f2b530654cc716772f1fe653373e892@microsoft.com>
|
C
|
apache-2.0
|
digama0/lean,soonhokong/lean,dselsam/lean,fgdorais/lean,leanprover-community/lean,leodemoura/lean,soonhokong/travis_test,eigengrau/lean,soonhokong/lean-osx,leanprover/lean,leodemoura/lean,dselsam/lean,leodemoura/lean,leanprover/lean,levnach/lean,codyroux/lean0.1,avigad/lean,johoelzl/lean,leodemoura/lean,rlewis1988/lean,UlrikBuchholtz/lean,soonhokong/lean-windows,fgdorais/lean,eigengrau/lean,htzh/lean,fgdorais/lean,UlrikBuchholtz/lean,avigad/lean,javra/lean,johoelzl/lean,leanprover/lean,javra/lean,htzh/lean,soonhokong/lean,levnach/lean,levnach/lean,leanprover-community/lean,eigengrau/lean,leanprover-community/lean,htzh/lean,digama0/lean,fgdorais/lean,johoelzl/lean,c-cube/lean,rlewis1988/lean,digama0/lean,eigengrau/lean,sp3ctum/lean,Kha/lean,codyroux/lean0.1,soonhokong/lean-osx,UlrikBuchholtz/lean,dselsam/lean,Kha/lean,codyroux/lean0.1,soonhokong/travis_test,htzh/lean,sp3ctum/lean,fpvandoorn/lean,eigengrau/lean,soonhokong/lean-osx,javra/lean,c-cube/lean,fpvandoorn/lean,fpvandoorn/lean,leanprover/lean,leanprover/lean,Kha/lean,Kha/lean,fgdorais/lean,fpvandoorn/lean2,soonhokong/lean-windows,javra/lean,soonhokong/travis_test,Kha/lean,c-cube/lean,c-cube/lean,c-cube/lean,digama0/lean,rlewis1988/lean,soonhokong/lean,avigad/lean,UlrikBuchholtz/lean,leanprover-community/lean,fpvandoorn/lean,soonhokong/lean-windows,levnach/lean,Kha/lean,fpvandoorn/lean2,dselsam/lean,fpvandoorn/lean,htzh/lean,leodemoura/lean,soonhokong/lean-osx,UlrikBuchholtz/lean,avigad/lean,dselsam/lean,soonhokong/travis_test,avigad/lean,sp3ctum/lean,johoelzl/lean,leanprover-community/lean,digama0/lean,fpvandoorn/lean2,soonhokong/lean,digama0/lean,levnach/lean,leanprover/lean,soonhokong/lean,leodemoura/lean,fpvandoorn/lean2,johoelzl/lean,rlewis1988/lean,fpvandoorn/lean2,soonhokong/lean-osx,soonhokong/lean-windows,dselsam/lean,javra/lean,avigad/lean,johoelzl/lean,fpvandoorn/lean,sp3ctum/lean,rlewis1988/lean,rlewis1988/lean,leanprover-community/lean,soonhokong/lean-windows,fgdorais/lean,codyroux/lean0.1,sp3ctum/lean
|
540dfec095e25e78d44cc27d84bb2a32932e5714
|
libraries/datastruct/hash/create.c
|
libraries/datastruct/hash/create.c
|
/* --------------------------------------------------------------------------
* Name: create.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "utils/utils.h"
#include "utils/primes.h"
#include "datastruct/hash.h"
#include "impl.h"
/* ----------------------------------------------------------------------- */
error hash_create(const void *default_value,
int nbins,
hash_fn *fn,
hash_compare *compare,
hash_destroy_key *destroy_key,
hash_destroy_value *destroy_value,
hash_t **ph)
{
hash_t *h;
hash__node_t **bins;
h = malloc(sizeof(*h));
if (h == NULL)
return error_OOM;
nbins = prime_nearest(nbins);
bins = calloc(nbins, sizeof(*h->bins));
if (bins == NULL)
return error_OOM;
h->bins = bins;
h->nbins = nbins;
h->count = 0;
h->default_value = default_value;
h->hash_fn = fn;
h->compare = compare;
h->destroy_key = destroy_key;
h->destroy_value = destroy_value;
*ph = h;
return error_OK;
}
|
/* --------------------------------------------------------------------------
* Name: create.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "utils/utils.h"
#include "utils/primes.h"
#include "datastruct/hash.h"
#include "impl.h"
/* ----------------------------------------------------------------------- */
error hash_create(const void *default_value,
int nbins,
hash_fn *fn,
hash_compare *compare,
hash_destroy_key *destroy_key,
hash_destroy_value *destroy_value,
hash_t **ph)
{
hash_t *h;
hash__node_t **bins;
h = malloc(sizeof(*h));
if (h == NULL)
return error_OOM;
nbins = prime_nearest(nbins);
bins = calloc(nbins, sizeof(*h->bins));
if (bins == NULL)
{
free(h);
return error_OOM;
}
h->bins = bins;
h->nbins = nbins;
h->count = 0;
h->default_value = default_value;
h->hash_fn = fn;
h->compare = compare;
h->destroy_key = destroy_key;
h->destroy_value = destroy_value;
*ph = h;
return error_OK;
}
|
Fix leak in calloc failure path.
|
Fix leak in calloc failure path.
|
C
|
bsd-2-clause
|
dpt/Containers,dpt/Containers
|
17d7dfc032eaa26e78855a5f91762f3663faf9f1
|
libpqxx/include/pqxx/util.h
|
libpqxx/include/pqxx/util.h
|
/*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this mistake,
* or contact the author.
*
*-------------------------------------------------------------------------
*/
#ifndef PQXX_UTIL_H
#define PQXX_UTIL_H
#if defined(PQXX_HAVE_CPP_WARNING)
#warning "Deprecated libpqxx header included. Use headers without '.h'"
#elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE)
#pragma message("Deprecated libpqxx header included. Use headers without '.h'")
#endif
#define PQXX_DEPRECATED_HEADERS
#include "pqxx/util"
#endif
|
/*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this mistake,
* or contact the author.
*
*-------------------------------------------------------------------------
*/
#ifndef PQXX_UTIL_H
#define PQXX_UTIL_H
#if !defined(PQXXYES_I_KNOW_DEPRECATED_HEADER)
#define PQXXYES_I_KNOW_DEPRECATED_HEADER
#if defined(PQXX_HAVE_CPP_WARNING)
#warning "Deprecated libpqxx header included. Use headers without '.h'"
#elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE)
#pragma message("Deprecated libpqxx header included. Use headers without '.h'")
#endif
#endif
#define PQXX_DEPRECATED_HEADERS
#include "pqxx/util"
#endif
|
Allow suppression of "deprecated header" warning
|
Allow suppression of "deprecated header" warning
git-svn-id: 27238e37a5eae711b76ec703b45445819ea9563e@600 c3353b84-d008-0410-9ed9-b55c4f7fa7e8
|
C
|
bsd-3-clause
|
svn2github/libpqxx,svn2github/libpqxx,svn2github/libpqxx
|
c98e8774e1173d05e733fb02032d06e61813a6a3
|
licharger.c
|
licharger.c
|
#include <avr/io.h>
int main (void) {
//Set pin 3 as output to source current?
PORTB = 1<<PORTB3;
DDRB = 1<<DDB3;
}
|
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
int main ( void ) {
//Disable interrupts and reset WDT timer
cli();
wdt_reset();
//Reset MCU status register
MCUSR &= ~(1<<WDRF);
//Disable watchdog
WDTCR |= (1<<WDCE) | (1<<WDE);
WDTCR = 0;
//Enable LED
DDRB = 1<<DDB3;
PORTB = 1<<PORTB3;
//Start watchdog
WDTCR |= (1<<WDCE) | (1<<WDE);
WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP1);
//Enable interrupts
sei();
while(1);
}
//Catching WatchDog interrupts
ISR ( WDT_vect ) {
PORTB ^= 1<<PORTB3;
}
|
Make a watchdog timer blink a LED
|
Make a watchdog timer blink a LED
|
C
|
mit
|
Atom058/ArduinoLithiumCharger,Atom058/ArduinoLithiumCharger
|
8634f6fcca8961d4a7db9dedaebf2ce216cd0592
|
include/support/newlib/xlocale.h
|
include/support/newlib/xlocale.h
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#if defined(_NEWLIB_VERSION)
#include <cstdlib>
#include <clocale>
#include <cwctype>
#include <ctype.h>
#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
__NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
#include <support/xlocale/__nop_locale_mgmt.h>
#endif
#include <support/xlocale/__posix_l_fallback.h>
#include <support/xlocale/__strtonum_fallback.h>
#endif // _NEWLIB_VERSION
#endif
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
#if defined(_NEWLIB_VERSION)
#include <cstdlib>
#include <clocale>
#include <cwctype>
#include <ctype.h>
#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
__NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
#include <support/xlocale/__nop_locale_mgmt.h>
#include <support/xlocale/__posix_l_fallback.h>
#include <support/xlocale/__strtonum_fallback.h>
#endif
#endif // _NEWLIB_VERSION
#endif
|
Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
|
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
Summary:
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.:
projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l'
inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
^
lib/include/wctype.h:55:12: note: previous definition is here
extern int iswcntrl_l (wint_t, locale_t);
These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard.
[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=238455adfab4f8070ac65400aac22bb8a9e502fc
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=8493c1631643fada62384768408852bc0fa6ff44
Reviewers: ldionne, rsmith, EricWF
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D49927
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@338157 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx
|
23de80419998d6bc4420efb1019941c1cb7bcbd5
|
src/lib-fts/fts-common.h
|
src/lib-fts/fts-common.h
|
#ifndef FTS_COMMON_H
#define FTS_COMMON_H
#define IS_NONASCII_APOSTROPHE(c) \
((c) == 0x2019 || (c) == 0xFF07)
#define IS_APOSTROPHE(c) \
((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c))
#endif
|
#ifndef FTS_COMMON_H
#define FTS_COMMON_H
/* Some might consider 0x02BB an apostrophe also. */
#define IS_NONASCII_APOSTROPHE(c) \
((c) == 0x2019 || (c) == 0xFF07)
#define IS_APOSTROPHE(c) \
((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c))
#endif
|
Add note about possible additional apostrophe.
|
lib-fts: Add note about possible additional apostrophe.
|
C
|
mit
|
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
|
7f27e1272b40cf4ec090947fd3b4b620ca7de80d
|
examples/complex_struct.c
|
examples/complex_struct.c
|
#include <stdio.h>
typedef struct {
int *x;
int **y;
} inner ;
typedef struct {
int *g;
inner in[3];
} outer;
int *ep;
int main(int argc, char *argv[])
{
outer o;
int z = 5;
printf("%d\n" , z);
ep = &z;
o.in[2].x = ep;
*o.in[2].x = 3;
printf("%d\n" , z);
outer oo[4];
oo[2].in[2].y = &ep;
return 0;
}
|
#include <stdio.h>
typedef struct {
int *x;
int **y;
} inner ;
typedef struct {
int *g;
inner in[3];
} outer;
int *ep;
int main(int argc, char *argv[])
{
outer o;
int z = 5;
int zzz;
printf("%d\n" , z);
ep = &z;
o.in[2].x = ep;
*o.in[2].x = 3;
printf("%d\n" , z);
inner i;
i.x = &zzz;
o.in[1] = i;
int **ptr = &o.in[0].x;
int *p = *ptr;
/* outer oo[4]; */
/* oo[2].in[2].y = &ep; */
return 0;
}
|
Add bitwise copy of struct to complex struct example.
|
Add bitwise copy of struct to complex struct example.
|
C
|
mit
|
plast-lab/cclyzer,plast-lab/llvm-datalog
|
a32f3b03d56c02033bdebf8a5f7207738f1492ab
|
TDTChocolate/FoundationAdditions/NSDictionary+TDTNullNormalization.h
|
TDTChocolate/FoundationAdditions/NSDictionary+TDTNullNormalization.h
|
#import <Foundation/Foundation.h>
// Motivation:
// JSON responses frequently contain 'null'. For our purposes, a JSON object with
// a null property is equivalent to the same object with that property missing.
// However, JSON parsers treat the former as `NSNull` and the latter as nil;
// This leads to problems for the subsequent code because NSNull is a bona-fide
// object while messages to nil are discarded. Furthermore, Objective C truthy
// checks work for NSNull and fail for nil.
@interface NSDictionary (TDTNullNormalization)
/**
@return NSDictionary created by removing all enteries whose @p value is an
instance of @p NSNull.
@see NSArray+TDTNullNormalization
*/
- (NSDictionary *)tdt_dictionaryByRemovingNulls;
@end
|
#import <Foundation/Foundation.h>
@interface NSDictionary (TDTNullNormalization)
/**
@return NSDictionary created by removing all enteries whose @p value is an
instance of @p NSNull.
@see NSArray+TDTNullNormalization
*/
- (NSDictionary *)tdt_dictionaryByRemovingNulls;
@end
|
Remove now irrelevant motivation section
|
Remove now irrelevant motivation section
|
C
|
bsd-3-clause
|
talk-to/Chocolate,talk-to/Chocolate
|
7c47ca226bed8793611b3262d462585de31a9309
|
Classes/YSProcessTimer/YSProcessTimer.h
|
Classes/YSProcessTimer/YSProcessTimer.h
|
//
// YSProcessTimer.h
// YSProcessTimeExample
//
// Created by Yu Sugawara on 2014/02/21.
// Copyright (c) 2014年 Yu Sugawara. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef DEBUG
#define kYSProcessTimerInvalid 1
#endif
@interface YSProcessTimer : NSObject
+ (instancetype)sharedInstance;
- (instancetype)initWithProcessName:(NSString*)processName;
@property (nonatomic) NSString *processName;
- (void)startWithComment:(NSString*)comment;
- (NSTimeInterval)currentRapTime;
- (void)addRapWithComment:(NSString *)comment;
- (void)stopWithComment:(NSString*)stopComment;
@end
|
//
// YSProcessTimer.h
// YSProcessTimeExample
//
// Created by Yu Sugawara on 2014/02/21.
// Copyright (c) 2014年 Yu Sugawara. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef DEBUG
#define kYSProcessTimerInvalid 1
#endif
@interface YSProcessTimer : NSObject
+ (instancetype)sharedInstance;
- (instancetype)initWithProcessName:(NSString*)processName;
@property (nonatomic, copy) NSString *processName;
- (void)startWithComment:(NSString*)comment;
- (NSTimeInterval)currentRapTime;
- (void)addRapWithComment:(NSString *)comment;
- (void)stopWithComment:(NSString*)stopComment;
@end
|
Change NSString property to copy
|
Change NSString property to copy
|
C
|
mit
|
yusuga/YSProcessTimer
|
3a9c2313f04ef18261d5c8936a5724150e614eeb
|
EScript/Utils/SyncTools.h
|
EScript/Utils/SyncTools.h
|
// SyncTools.h
// This file is part of the EScript programming language (https://github.com/EScript)
//
// Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de>
//
// Licensed under the MIT License. See LICENSE file for details.
// ---------------------------------------------------------------------------------
#ifndef SYNCTOOLS_H_INCLUDED
#define SYNCTOOLS_H_INCLUDED
#include <thread>
#include <mutex>
#include <atomic>
namespace EScript{
namespace SyncTools{
namespace _Internals{
//! \see http://en.cppreference.com/w/cpp/atomic/atomic_flag
class SpinLock{
private:
std::atomic_flag f;
public:
SpinLock():f(ATOMIC_FLAG_INIT){}
void lock() { while(!f.test_and_set(std::memory_order_acquire)); }
bool try_lock() { return !f.test_and_set(std::memory_order_acquire); }
void unlock() { f.clear(std::memory_order_release); }
};
}
typedef std::atomic<int> atomicInt;
typedef std::atomic<bool> atomicBool;
//typedef std::mutex FastLock;
typedef _Internals::SpinLock FastLock;
typedef std::unique_lock<FastLock> FastLockHolder;
}
}
#endif // SYNCTOOLS_H_INCLUDED
|
// SyncTools.h
// This file is part of the EScript programming language (https://github.com/EScript)
//
// Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de>
//
// Licensed under the MIT License. See LICENSE file for details.
// ---------------------------------------------------------------------------------
#ifndef SYNCTOOLS_H_INCLUDED
#define SYNCTOOLS_H_INCLUDED
#include <thread>
#include <mutex>
#include <atomic>
namespace EScript{
namespace SyncTools{
namespace _Internals{
//! \see http://en.cppreference.com/w/cpp/atomic/atomic_flag
class SpinLock{
std::atomic_flag f;
public:
SpinLock():f(ATOMIC_FLAG_INIT){}
void lock() { while(f.test_and_set(std::memory_order_acquire)); }
bool try_lock() { return !f.test_and_set(std::memory_order_acquire); }
void unlock() { f.clear(std::memory_order_release); }
};
}
typedef std::atomic<int> atomicInt;
typedef std::atomic<bool> atomicBool;
//typedef std::mutex FastLock;
typedef _Internals::SpinLock FastLock;
//typedef std::mutex FastLock;
typedef std::unique_lock<FastLock> FastLockHolder;
inline SyncTools::FastLockHolder tryLock(FastLock& lock){
return std::move(FastLockHolder(lock, std::try_to_lock) );
}
}
}
#endif // SYNCTOOLS_H_INCLUDED
|
Fix SpinLock and add tryLock.
|
Fix SpinLock and add tryLock.
|
C
|
mit
|
eikel/EScript,eikel/EScript
|
3f27d22593d0d595bc4e9695d122fa16051d8990
|
src/SpiralLinesGLWidget.h
|
src/SpiralLinesGLWidget.h
|
#ifndef SPIRALLINESGLWIDGET_H
#define SPIRALLINESGLWIDGET_H
#include "GLWidget.h"
#include <cmath>
class SpiralLinesGLWidget : public GLWidget
{
public:
SpiralLinesGLWidget(QWidget* parent = 0);
protected:
void initializeGL();
void render();
};
SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {}
void SpiralLinesGLWidget::initializeGL()
{
GLWidget::initializeGL();
setXRotation(-45);
setYRotation(15);
setZRotation(45);
}
void SpiralLinesGLWidget::render()
{
// How many revolutions of the spiral are rendered.
static const float REVOLUTIONS = 10;
static const float PI = 3.14159;
glBegin(GL_LINE_STRIP);
for (float angle = 0; angle < 2*PI*REVOLUTIONS; angle += PI / (2 * REVOLUTIONS * 10)) {
glVertex2f(
angle * (float) sin(angle),
angle * (float) cos(angle));
}
glEnd();
}
#endif // SPIRALLINESGLWIDGET_H
|
#ifndef SPIRALLINESGLWIDGET_H
#define SPIRALLINESGLWIDGET_H
#include "GLWidget.h"
#include <cmath>
class SpiralLinesGLWidget : public GLWidget
{
public:
SpiralLinesGLWidget(QWidget* parent = 0);
protected:
void initializeGL();
void render();
};
SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {}
void SpiralLinesGLWidget::initializeGL()
{
GLWidget::initializeGL();
setXRotation(-45);
setYRotation(15);
setZRotation(45);
}
void SpiralLinesGLWidget::render()
{
// How many revolutions of the spiral are rendered.
static const float REVOLUTIONS = 10;
static const float PI = 3.14159;
// How many vertices per revolution.
static const float SLICES = 10;
glBegin(GL_LINE_STRIP);
for (int i = 0; i <= REVOLUTIONS * SLICES; i++) {
const float angle = i * 2 * PI / SLICES;
glVertex2f(
angle * (float) sin(angle),
angle * (float) cos(angle));
}
glEnd();
}
#endif // SPIRALLINESGLWIDGET_H
|
Use integers instead of floats in for-loop
|
Use integers instead of floats in for-loop
While this adds a few more lines to the program, I think it makes it
more explicit where the constants come from. It also faciliates
easier modification of the example.
It's also safer to use an integer instead of a float as a conditional
in a for-loop. This is because floating point values are imprecise.
As a result, you may end up with one more or one fewer iteration than
you anticipated. Integers don't have this disadvantage.
|
C
|
mit
|
dafrito/alpha,dafrito/alpha,dafrito/alpha
|
2abad81843d091274a4615e6b04f5ba465254029
|
learner/src/learner-service.h
|
learner/src/learner-service.h
|
#pragma once
#include <pthread.h>
#include <glb-lib/output.h>
#include <kmq.h>
#include <knd_shard.h>
struct kndLearnerService;
struct kndLearnerOptions
{
char *config_file;
struct addrinfo *address;
};
struct kndLearnerService
{
struct kmqKnode *knode;
struct kmqEndPoint *entry_point;
struct kndShard *shard;
char name[KND_NAME_SIZE];
size_t name_size;
char path[KND_NAME_SIZE];
size_t path_size;
char schema_path[KND_NAME_SIZE];
size_t schema_path_size;
char delivery_addr[KND_NAME_SIZE];
size_t delivery_addr_size;
size_t max_users;
const struct kndLearnerOptions *opts;
/********************* public interface *********************************/
int (*start)(struct kndLearnerService *self);
void (*del)(struct kndLearnerService *self);
};
int kndLearnerService_new(struct kndLearnerService **service, const struct kndLearnerOptions *opts);
|
#pragma once
#include <pthread.h>
#include <glb-lib/output.h>
#include <kmq.h>
#include <knd_shard.h>
struct kndLearnerService;
struct kndLearnerOptions
{
char *config_file;
struct addrinfo *address;
};
struct kndLearnerService
{
struct kmqKnode *knode;
struct kmqEndPoint *entry_point;
struct kndShard *shard;
char name[KND_NAME_SIZE];
size_t name_size;
// char path[KND_NAME_SIZE];
// size_t path_size;
//
// char schema_path[KND_NAME_SIZE];
// size_t schema_path_size;
//
// char delivery_addr[KND_NAME_SIZE];
// size_t delivery_addr_size;
// size_t max_users;
const struct kndLearnerOptions *opts;
/********************* public interface *********************************/
int (*start)(struct kndLearnerService *self);
void (*del)(struct kndLearnerService *self);
};
int kndLearnerService_new(struct kndLearnerService **service, const struct kndLearnerOptions *opts);
|
Comment out unused fields in kndLearnerService
|
Comment out unused fields in kndLearnerService
|
C
|
agpl-3.0
|
globbie/knowdy,globbie/knowdy,globbie/knowdy
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.